重构sps代码

tags/yfai-pcn-ext-v2.3
臧学普 7 months ago
parent 540612bf09
commit e689db4edb

@ -344,7 +344,7 @@ public class MesPullingOrderInfoService implements IMesPullingOrderInfoService {
MesSpsInfo mesSpsInfo = new MesSpsInfo(); MesSpsInfo mesSpsInfo = new MesSpsInfo();
mesSpsInfo.setId(pullingOrder.getId()); mesSpsInfo.setId(pullingOrder.getId());
mesSpsInfo.setSeq(pullingOrder.getProductSeq()); mesSpsInfo.setSeq(pullingOrder.getProductSeq());
mesSpsInfo.setOrderCode(pullingOrder.getWorkOrderNo()); mesSpsInfo.setOrderCode(pullingOrder.getPullingOrderNo());
mesSpsInfo.setCustOrderCode(pullingOrder.getCustOrderNo()); mesSpsInfo.setCustOrderCode(pullingOrder.getCustOrderNo());
List<MesPullingOrderPartInfo> partList = pullingOrder.getPartList(); List<MesPullingOrderPartInfo> partList = pullingOrder.getPartList();
@ -358,18 +358,24 @@ public class MesPullingOrderInfoService implements IMesPullingOrderInfoService {
if (part.getLocation().indexOf(",") > 0){ if (part.getLocation().indexOf(",") > 0){
String[] locations = part.getLocation().split(","); String[] locations = part.getLocation().split(",");
detailInfo.setSection(locations[0]); detailInfo.setSection(locations[0]);
detailInfo.setAddress(locations[1]);
}else {
detailInfo.setAddress(part.getLocation());
} }
detailInfo.setAddress(part.getLocation());
detailInfoList.add(detailInfo); detailInfoList.add(detailInfo);
} }
} }
mesSpsInfo.setPartList(detailInfoList); mesSpsInfo.setPartList(detailInfoList);
result.put("info", mesSpsInfo); result.put("info", mesSpsInfo);
} }
String jsonString = JSON.toJSONString(result);
return JSON.toJSONString(result); return jsonString.replaceAll("id", "Id")
.replaceAll("orderCode", "OrderCode")
.replaceAll("custOrderCode", "CustOrderCode")
.replaceAll("seq", "Seq")
.replaceAll("partNo", "PartNo")
.replaceAll("partName", "PartName")
.replaceAll("section", "Section")
.replaceAll("address", "Address")
.replaceAll("qty", "Qty").replaceAll("partList","PartList");
} }
@Override @Override
@ -417,7 +423,7 @@ public class MesPullingOrderInfoService implements IMesPullingOrderInfoService {
MesSpsInfo mesSpsInfo = new MesSpsInfo(); MesSpsInfo mesSpsInfo = new MesSpsInfo();
mesSpsInfo.setId(pullingOrder.getId()); mesSpsInfo.setId(pullingOrder.getId());
mesSpsInfo.setSeq(pullingOrder.getProductSeq()); mesSpsInfo.setSeq(pullingOrder.getProductSeq());
mesSpsInfo.setOrderCode(pullingOrder.getWorkOrderNo()); mesSpsInfo.setOrderCode(pullingOrder.getPullingOrderNo());
mesSpsInfo.setCustOrderCode(pullingOrder.getCustOrderNo()); mesSpsInfo.setCustOrderCode(pullingOrder.getCustOrderNo());
List<MesPullingOrderPartInfo> partList = pullingOrder.getPartList(); List<MesPullingOrderPartInfo> partList = pullingOrder.getPartList();
@ -431,17 +437,24 @@ public class MesPullingOrderInfoService implements IMesPullingOrderInfoService {
if (part.getLocation().indexOf(",") > 0){ if (part.getLocation().indexOf(",") > 0){
String[] locations = part.getLocation().split(","); String[] locations = part.getLocation().split(",");
detailInfo.setSection(locations[0]); detailInfo.setSection(locations[0]);
detailInfo.setAddress(locations[1]);
}else {
detailInfo.setAddress(part.getLocation());
} }
detailInfo.setAddress(part.getLocation());
detailInfoList.add(detailInfo); detailInfoList.add(detailInfo);
} }
} }
mesSpsInfo.setPartList(detailInfoList); mesSpsInfo.setPartList(detailInfoList);
result.put("info", mesSpsInfo); result.put("info", mesSpsInfo);
} }
return JSON.toJSONString(result); String jsonString = JSON.toJSONString(result);
return jsonString.replaceAll("id", "Id")
.replaceAll("orderCode", "OrderCode")
.replaceAll("custOrderCode", "CustOrderCode")
.replaceAll("seq", "Seq")
.replaceAll("partNo", "PartNo")
.replaceAll("partName", "PartName")
.replaceAll("section", "Section")
.replaceAll("address", "Address")
.replaceAll("qty", "Qty").replaceAll("partList","PartList");
} }
// @Override // @Override
@ -514,7 +527,8 @@ public class MesPullingOrderInfoService implements IMesPullingOrderInfoService {
seriesPackBean.setWhereAppend(seriesPackBean.getWhereAppend() + " order by modifyDatetime desc"); seriesPackBean.setWhereAppend(seriesPackBean.getWhereAppend() + " order by modifyDatetime desc");
MesPullingOrderInfo mesPullingOrder = mesPullingOrderInfoRepository.getByProperty(seriesPackBean); MesPullingOrderInfo mesPullingOrder = mesPullingOrderInfoRepository.getByProperty(seriesPackBean);
if (StringUtil.isEmpty(mesPullingOrder)) { log.info("castle-1-查询条件为:workCenterCode:{},pullOrderType:{},pullOrderStatus:{}查询出来的数据为:{}",assemblyLine,MesExtEnumUtil.PART_PULL_ORDER_TYPE.SPS_PULL.getValue(),MesExtEnumUtil.PULL_ORDER_STATUS.JIS_PULL.getValue(),JSON.toJSONString(mesPullingOrder));
if (StringUtil.isEmpty(mesPullingOrder)) {
return null; return null;
} }
//更新主表状态 源系统为25配料完成 现在-【已发送设备-30】 //更新主表状态 源系统为25配料完成 现在-【已发送设备-30】
@ -529,6 +543,8 @@ public class MesPullingOrderInfoService implements IMesPullingOrderInfoService {
if (!org.apache.shiro.util.CollectionUtils.isEmpty(pullingOrderPartInfos)) { if (!org.apache.shiro.util.CollectionUtils.isEmpty(pullingOrderPartInfos)) {
mesPullingOrder.setPartList(pullingOrderPartInfos); mesPullingOrder.setPartList(pullingOrderPartInfos);
} }
log.info("castle-2-查询出来的数据为:{}",JSON.toJSONString(mesPullingOrder));
return mesPullingOrder; return mesPullingOrder;
} }
} }

Loading…
Cancel
Save