重构sps代码

tags/yfai-pcn-ext-v2.3
臧学普 7 months ago
parent 99ab2c2d85
commit 4599f24b25

@ -4,6 +4,8 @@ import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesConfigService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesNumberRuleMatchDispatchService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProduceSnExtService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesPullingOrderInfoService;
import cn.estsh.i3plus.ext.mes.pcn.apiservice.model.MesSpsDetailInfo;
import cn.estsh.i3plus.ext.mes.pcn.apiservice.model.MesSpsInfo;
import cn.estsh.i3plus.ext.mes.pcn.apiservice.util.MesPcnException;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
@ -336,7 +338,38 @@ public class MesPullingOrderInfoService implements IMesPullingOrderInfoService {
log.error("没有配置表mes_config,cfg_code为WU_HAN_SPS_CODE,key为WU_HAN_WORK_CENTER_CODE_100 或者 WU_HAN_ORGANIZE_CODE没有配置");
return null;
}
return JSON.toJSONString(getPullingOrder(organizeCode, assemblyLine));
MesPullingOrderInfo pullingOrder = getPullingOrder(organizeCode, assemblyLine);
Map<String, MesSpsInfo> result = new HashMap<>();
if (pullingOrder != null){
MesSpsInfo mesSpsInfo = new MesSpsInfo();
mesSpsInfo.setId(pullingOrder.getId());
mesSpsInfo.setSeq(pullingOrder.getProductSeq());
mesSpsInfo.setOrderCode(pullingOrder.getWorkOrderNo());
mesSpsInfo.setCustOrderCode(pullingOrder.getCustOrderNo());
List<MesPullingOrderPartInfo> partList = pullingOrder.getPartList();
List<MesSpsDetailInfo> detailInfoList = new ArrayList<>();
if (partList !=null && !partList.isEmpty()){
for (MesPullingOrderPartInfo part : partList) {
MesSpsDetailInfo detailInfo = new MesSpsDetailInfo();
detailInfo.setPartNo(part.getPartNo());
detailInfo.setQty(part.getPullQty());
detailInfo.setPartName(part.getPartName());
if (part.getLocation().indexOf(",") > 0){
String[] locations = part.getLocation().split(",");
detailInfo.setSection(locations[0]);
detailInfo.setAddress(locations[1]);
}else {
detailInfo.setAddress(part.getLocation());
}
detailInfoList.add(detailInfo);
}
}
mesSpsInfo.setPartList(detailInfoList);
result.put("info", mesSpsInfo);
}
return JSON.toJSONString(result);
}
@Override
@ -378,7 +411,37 @@ public class MesPullingOrderInfoService implements IMesPullingOrderInfoService {
log.error("没有配置表mes_config,cfg_code为WU_HAN_SPS_CODE,key为WU_HAN_WORK_CENTER_CODE_100 或者 WU_HAN_ORGANIZE_CODE没有配置");
return null;
}
return JSON.toJSONString(getPullingOrder(organizeCode, assemblyLine));
MesPullingOrderInfo pullingOrder = getPullingOrder(organizeCode, assemblyLine);
Map<String, MesSpsInfo> result = new HashMap<>();
if (pullingOrder != null){
MesSpsInfo mesSpsInfo = new MesSpsInfo();
mesSpsInfo.setId(pullingOrder.getId());
mesSpsInfo.setSeq(pullingOrder.getProductSeq());
mesSpsInfo.setOrderCode(pullingOrder.getWorkOrderNo());
mesSpsInfo.setCustOrderCode(pullingOrder.getCustOrderNo());
List<MesPullingOrderPartInfo> partList = pullingOrder.getPartList();
List<MesSpsDetailInfo> detailInfoList = new ArrayList<>();
if (partList !=null && !partList.isEmpty()){
for (MesPullingOrderPartInfo part : partList) {
MesSpsDetailInfo detailInfo = new MesSpsDetailInfo();
detailInfo.setPartNo(part.getPartNo());
detailInfo.setQty(part.getPullQty());
detailInfo.setPartName(part.getPartName());
if (part.getLocation().indexOf(",") > 0){
String[] locations = part.getLocation().split(",");
detailInfo.setSection(locations[0]);
detailInfo.setAddress(locations[1]);
}else {
detailInfo.setAddress(part.getLocation());
}
detailInfoList.add(detailInfo);
}
}
mesSpsInfo.setPartList(detailInfoList);
result.put("info", mesSpsInfo);
}
return JSON.toJSONString(result);
}
// @Override

Loading…
Cancel
Save