|
@@ -11,6 +11,7 @@ import com.platform.common.model.UserInfo;
|
|
|
import com.platform.common.util.*;
|
|
|
import com.platform.dao.bean.MyPage;
|
|
|
import com.platform.dao.dto.sb.SbModelSpareBomDTO;
|
|
|
+import com.platform.dao.dto.sqarepartmanage.SparePartInfoDTO;
|
|
|
import com.platform.dao.dto.store.*;
|
|
|
import com.platform.dao.entity.purchase.PurchaseDispatchOrder;
|
|
|
import com.platform.dao.entity.purchase.PurchaseDispatchOrderList;
|
|
@@ -25,14 +26,13 @@ import com.platform.dao.enums.*;
|
|
|
import com.platform.dao.mapper.purchase.PurchaseDispatchOrderListMapper;
|
|
|
import com.platform.dao.mapper.purchase.PurchaseDispatchOrderMapper;
|
|
|
import com.platform.dao.mapper.purchase.PurchaseListMapper;
|
|
|
+import com.platform.dao.mapper.sb.SbInfoMapper;
|
|
|
import com.platform.dao.mapper.sb.SbModelSpareBomMapper;
|
|
|
import com.platform.dao.mapper.sqarepartmanage.SparePartInfoMapper;
|
|
|
-import com.platform.dao.mapper.store.InStoreDetailMapper;
|
|
|
-import com.platform.dao.mapper.store.InStoreFormMapper;
|
|
|
-import com.platform.dao.mapper.store.SpareBackFormMapper;
|
|
|
-import com.platform.dao.mapper.store.SpareStoreMapper;
|
|
|
+import com.platform.dao.mapper.store.*;
|
|
|
import com.platform.dao.util.MessageTemplateUtil;
|
|
|
import com.platform.dao.vo.export.store.ExportInStoreSpareNumVO;
|
|
|
+import com.platform.dao.vo.query.sparepartmanage.SparePartInfoVO;
|
|
|
import com.platform.dao.vo.query.store.InStoreFormVO;
|
|
|
import com.platform.dao.vo.query.store.SpareBackDetailVO;
|
|
|
import com.platform.dao.vo.query.store.StoreCheckJobVO;
|
|
@@ -57,9 +57,7 @@ import tk.mybatis.mapper.weekend.WeekendCriteria;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -77,6 +75,8 @@ public class InStoreFormServiceImpl extends BaseServiceImpl<InStoreFormMapper, I
|
|
|
private SpareBackFormMapper spareBackFormMapper;
|
|
|
private SparePartInfoMapper sparePartInfoMapper;
|
|
|
private SbModelSpareBomMapper sbModelSpareBomMapper;
|
|
|
+ private SbInfoMapper sbInfoMapper;
|
|
|
+ private StoreMapper storeMapper;
|
|
|
|
|
|
@Override
|
|
|
public int batchDelete(List<String> ids) {
|
|
@@ -105,7 +105,10 @@ public class InStoreFormServiceImpl extends BaseServiceImpl<InStoreFormMapper, I
|
|
|
model.setSpareIdList(spareList);
|
|
|
}
|
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
|
- return new MyPage(mapper.selectList(model));
|
|
|
+ List<InStoreFormVO> list = mapper.selectList(model);
|
|
|
+ addSbRelationShip(null,list);
|
|
|
+ list = getSparePartInfoVOS(list);
|
|
|
+ return new MyPage(list);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -247,6 +250,68 @@ public class InStoreFormServiceImpl extends BaseServiceImpl<InStoreFormMapper, I
|
|
|
return inStoreForm;
|
|
|
}
|
|
|
|
|
|
+ private void addSbRelationShip(SparePartInfoDTO sparePartInfoDTO, List<InStoreFormVO> list) {
|
|
|
+ // 查询备件关联的设备型号信息
|
|
|
+ List<SbModelSpareBomVO> bomList = sbModelSpareBomMapper.selectExportList2(sparePartInfoDTO);
|
|
|
+ for (InStoreFormVO sparePartInfo : list) {
|
|
|
+// if (sparePartInfo.getYt()==1){
|
|
|
+// sparePartInfo.setYtStr("设备配件");
|
|
|
+// }else if (sparePartInfo.getYt()==2){
|
|
|
+// sparePartInfo.setYtStr("工程物资");
|
|
|
+// }else {
|
|
|
+// sparePartInfo.setYtStr("设备配件");
|
|
|
+// }
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
+ for (SbModelSpareBomVO sbModelSpareBomVO : bomList) {
|
|
|
+ if (sparePartInfo.getId().equals(sbModelSpareBomVO.getSpareId())) {
|
|
|
+
|
|
|
+ SbInfo sbInfo = new SbInfo();
|
|
|
+ sbInfo.setId(sbModelSpareBomVO.getSbId());
|
|
|
+ sbInfo = sbInfoMapper.selectOne(sbInfo);
|
|
|
+ sb = sb.append(sbInfo.getNo()).append(';');
|
|
|
+// sparePartInfo.setModelName(sbModelSpareBomVO.getName());
|
|
|
+// sparePartInfo.setModelModel(sbModelSpareBomVO.getModel());
|
|
|
+// sparePartInfo.setSbNo(sb.append(sbInfo.getNo())+";");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sparePartInfo.setSbNo(sb.toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<InStoreFormVO> getSparePartInfoVOS(List<InStoreFormVO> sparePartInfoVOS){
|
|
|
+ List<StoreVO> stores = storeMapper.selectList(null);
|
|
|
+ Map<String,String> map = new HashMap<>();
|
|
|
+ first:for (StoreVO vo:stores){
|
|
|
+ if (vo.getLevel()==3){
|
|
|
+ for (StoreVO vo1:stores){
|
|
|
+ System.out.println("11111111111");
|
|
|
+ if (vo.getParentId().equals(vo1.getId())){
|
|
|
+ for (StoreVO vo2:stores){
|
|
|
+ System.out.println("22222222222");
|
|
|
+ if (vo1.getParentId().equals(vo2.getId())){
|
|
|
+ System.out.println("33333333333");
|
|
|
+ String name1 = vo2.getName().replaceAll("\\s*","").replaceAll("[^(0-9)]","");
|
|
|
+ String name2 = vo1.getName().replaceAll("\\s*","").replaceAll("[^(0-9)]","");
|
|
|
+ String name =name1+"-"+name2+"-"+vo.getName();
|
|
|
+ map.put(vo.getId(),name);
|
|
|
+ break first;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Set<String> ids = map.keySet();
|
|
|
+ for (String id:ids){
|
|
|
+ for (InStoreFormVO vo:sparePartInfoVOS){
|
|
|
+ if (vo.getStoreId()!=null&&vo.getStoreId().equals(id)){
|
|
|
+ vo.setStoreName(map.get(id));
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return sparePartInfoVOS;
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
public AbstractPageResultBean<InStoreFormVO> getInStoreFormCollect(InStoreFormDTO dto, Integer pageNum,Integer pageSize) {
|
|
@@ -259,6 +324,8 @@ public class InStoreFormServiceImpl extends BaseServiceImpl<InStoreFormMapper, I
|
|
|
}
|
|
|
PageHelper.startPage(pageNum,pageSize);
|
|
|
List<InStoreFormVO> list = mapper.getInStoreFormCollect(dto);
|
|
|
+ addSbRelationShip(null,list);
|
|
|
+ getSparePartInfoVOS(list);
|
|
|
return new MyPage<>(list);
|
|
|
}
|
|
|
|