|
@@ -421,10 +421,12 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
if(planTaskDetails1.size()>0){
|
|
|
PlanTaskDetails planTaskDetails2 = planTaskDetails1.get(0);
|
|
|
String materialId = planTaskDetails2.getMaterialId();
|
|
|
- if(materialId.startsWith("1")){//
|
|
|
- ringScanInformationFirst1.setPackingOrInspection("1");//1开头的 试机,包装,包装检验, 入库
|
|
|
- }else if(materialId.startsWith("2")) {
|
|
|
- ringScanInformationFirst1.setPackingOrInspection("2");//2试机,入库
|
|
|
+ if(materialId.startsWith("1")){// 成品检验
|
|
|
+ ringScanInformationFirst1.setPackingOrInspection("1");//1开头的 成品检验, 入库
|
|
|
+ ringScanInformationFirst1.setPackingQuantity("1"); //插入第一条的时候数量为1
|
|
|
+ }else if(materialId.startsWith("2")) { //试机检验
|
|
|
+ ringScanInformationFirst1.setPackingOrInspection("2");//2试机检验,入库
|
|
|
+ ringScanInformationFirst1.setInspectionQuantity("1"); //插入第一条的时候数量为1
|
|
|
}
|
|
|
}
|
|
|
//扫一次产品记录一次
|
|
@@ -453,7 +455,7 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
if(ringScanInformations1.size()<=0) {
|
|
|
RingScanInformationFirst newRingScanInformationFirst = getRingScanInformationFirst(ringScanInformationFirstNumber.getPackingQuantity(), ringScanInformation, "1");
|
|
|
ringScanInformationFirstMapper.updateRingScanInformationFirstByproductionOrderNumber(newRingScanInformationFirst);
|
|
|
- //生产汇报
|
|
|
+ //生产汇报 等于代表走工序汇报逻辑 1 和 2代表入的什么仓库(1:成品 2:利库) 3和4 代表走工序汇报逻辑(3:成品 4:利库)
|
|
|
// this.generateWarehouseWarrant2(ringScanInformation.getProductionOrderNumber(),ringScanInformation.getProcessName());//生产订单号,工序名
|
|
|
this.generateWarehouseWarrant(ringScanInformation.getProductionOrderNumber(),ringScanInformation.getProcessName(),"3");//生产订单号,工序名
|
|
|
}
|
|
@@ -468,7 +470,8 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
ringScanInformationFirstMapper.updateRingScanInformationFirstByproductionOrderNumber(newRingScanInformationFirst);
|
|
|
//生产汇报
|
|
|
// this.generateWarehouseWarrant2(ringScanInformation.getProductionOrderNumber());
|
|
|
- this.generateWarehouseWarrant(ringScanInformation.getProductionOrderNumber(),ringScanInformation.getProcessName(),"3");//生产订单号,工序名
|
|
|
+ // 等于代表走工序汇报逻辑 1 和 2代表入的什么仓库(1:成品 2:利库) 3和4 代表走工序汇报逻辑(3:成品 4:利库)
|
|
|
+ this.generateWarehouseWarrant(ringScanInformation.getProductionOrderNumber(),ringScanInformation.getProcessName(),"4");//生产订单号,工序名
|
|
|
}
|
|
|
}
|
|
|
else if(materialId.startsWith("1")&&ringScanInformation.getProcessName().equals("入库")){//1开头产品的入库逻辑
|
|
@@ -577,7 +580,7 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
RingScanInformation ringScanInformation1=new RingScanInformation();
|
|
|
BeanUtils.copyProperties(ringScanInformation,ringScanInformation1);
|
|
|
ringScanInformation1.setProcessName("包装");
|
|
|
- ringScanInformation1.setProcess("26");
|
|
|
+ ringScanInformation1.setProcess("28");
|
|
|
ringScanInformation1.setStationId("0");
|
|
|
ringScanInformation1.setStationName("包装工位");
|
|
|
int i2 = ringScanInformationMapper.insertRingScanInformation(ringScanInformation1);
|
|
@@ -836,24 +839,40 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
* @return
|
|
|
*/
|
|
|
private static RingScanInformationFirst getRingScanInformationFirst(String ringScanInformationFirstNumber, RingScanInformation ringScanInformation,String type) {
|
|
|
- if(type.equals("1")){
|
|
|
- //检查出没出现过这个订单信息的扫描,没有就更新第一次订单扫描的数量
|
|
|
+ if(type.equals("1")){ //成品检验
|
|
|
String inspectionQuantity = ringScanInformationFirstNumber;
|
|
|
Double newInspectionQuantity = Double.parseDouble(inspectionQuantity) + 1;
|
|
|
Integer i1 = newInspectionQuantity.intValue();
|
|
|
RingScanInformationFirst newRingScanInformationFirst = new RingScanInformationFirst();
|
|
|
newRingScanInformationFirst.setProductionOrderNumber(ringScanInformation.getProductionOrderNumber());
|
|
|
newRingScanInformationFirst.setPackingQuantity(i1.toString());
|
|
|
+
|
|
|
+ //1开头的机器,如果成品检验了就代表入库了
|
|
|
+ String rKQuantity = ringScanInformationFirstNumber;
|
|
|
+ Double newRkQuantity = Double.parseDouble(rKQuantity) + 1;
|
|
|
+ Integer i3 = newRkQuantity.intValue();
|
|
|
+ newRingScanInformationFirst.setProductionOrderNumber(ringScanInformation.getProductionOrderNumber());
|
|
|
+ newRingScanInformationFirst.setRks(i3.toString());
|
|
|
return newRingScanInformationFirst;
|
|
|
- }else if(type.equals("2")) {
|
|
|
+
|
|
|
+ }else if(type.equals("2")) { //试机检验
|
|
|
+
|
|
|
String inspectionQuantity = ringScanInformationFirstNumber;
|
|
|
Double newInspectionQuantity = Double.parseDouble(inspectionQuantity) + 1;
|
|
|
+
|
|
|
Integer i2 = newInspectionQuantity.intValue();
|
|
|
RingScanInformationFirst newRingScanInformationFirst = new RingScanInformationFirst();
|
|
|
newRingScanInformationFirst.setProductionOrderNumber(ringScanInformation.getProductionOrderNumber());
|
|
|
newRingScanInformationFirst.setInspectionQuantity(i2.toString());
|
|
|
+
|
|
|
+ //2开头的机器,如果试机检验了就代表入库了
|
|
|
+ String rKQuantity = ringScanInformationFirstNumber;
|
|
|
+ Double newRkQuantity = Double.parseDouble(rKQuantity) + 1;
|
|
|
+ Integer i3 = newRkQuantity.intValue();
|
|
|
+ newRingScanInformationFirst.setProductionOrderNumber(ringScanInformation.getProductionOrderNumber());
|
|
|
+ newRingScanInformationFirst.setRks(i3.toString());
|
|
|
return newRingScanInformationFirst;
|
|
|
- }else if(type.equals("3")) {
|
|
|
+ }else if(type.equals("3")) {//入库
|
|
|
String rKQuantity = ringScanInformationFirstNumber;
|
|
|
Double newRkQuantity = Double.parseDouble(rKQuantity) + 1;
|
|
|
Integer i2 = newRkQuantity.intValue();
|
|
@@ -897,7 +916,7 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
}
|
|
|
}
|
|
|
return "正在入库";
|
|
|
- }else if(type.equals("3")){//等于代表走工序汇报逻辑
|
|
|
+ }else if(type.equals("3")||type.equals("4")){//等于代表走工序汇报逻辑 1 和 2代表入的什么仓库(1:成品 2:利库) 3和4 代表走工序汇报逻辑(3:成品 4:利库)
|
|
|
RingScanInformationFirst newRingScanInformationFirst = new RingScanInformationFirst();
|
|
|
newRingScanInformationFirst.setProductionOrderNumber(productionOrderNumber);
|
|
|
//查询第一次新增时确定的是试机入库还是包装入库
|
|
@@ -918,14 +937,20 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
if(ringScanInformationFirst.getPackingQuantity().equals(ringScanInformationFirst.getProductionOrderTotalQuantity())){
|
|
|
// int i = planTaskDetailsMapper.updatePlanTaskDetailsByDemandDocument(planTaskDetails);
|
|
|
//工序汇报
|
|
|
- erpProcessReport(planTaskDetails1.get(0));
|
|
|
+ erpProcessReport(planTaskDetails1.get(0),type);
|
|
|
+ //加更正生产订单状态
|
|
|
+ planTaskDetails.setStatus("2");//生产完成
|
|
|
+ int i2 = planTaskDetailsMapper.updatePlanTaskDetailsByDemandDocument(planTaskDetails);
|
|
|
}
|
|
|
}else if(packingOrInspection.equals("2")){ //试机数量--下推生产汇报单
|
|
|
//看包装跟当前生产订单总数量是否相等
|
|
|
if(ringScanInformationFirst.getInspectionQuantity().equals(ringScanInformationFirst.getProductionOrderTotalQuantity())){
|
|
|
// int i = planTaskDetailsMapper.updatePlanTaskDetailsByDemandDocument(planTaskDetails);
|
|
|
//生产汇报
|
|
|
- erpProcessReport(planTaskDetails1.get(0));
|
|
|
+ erpProcessReport(planTaskDetails1.get(0),type);
|
|
|
+ //加更正生产订单状态
|
|
|
+ planTaskDetails.setStatus("2");//生产完成
|
|
|
+ int i2 = planTaskDetailsMapper.updatePlanTaskDetailsByDemandDocument(planTaskDetails);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -938,7 +963,7 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
* 生产汇报单是否下推提交审核成功
|
|
|
* @param planTaskDetails1
|
|
|
*/
|
|
|
- private void erpProcessReport(PlanTaskDetails planTaskDetails1) {
|
|
|
+ private void erpProcessReport(PlanTaskDetails planTaskDetails1,String type) {
|
|
|
//生产汇报
|
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
|
try {
|
|
@@ -966,6 +991,13 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
HashMap fbomdIdMap=new HashMap();
|
|
|
fbomdIdMap.put("FNumber",planTaskDetails1.getFbomIdFnumber());
|
|
|
map.put("FBomId",fbomdIdMap);
|
|
|
+ HashMap FStockId=new HashMap();
|
|
|
+ if(type.equals("3")){
|
|
|
+ FStockId.put("FNumber","CK007"); //成品仓
|
|
|
+ }else if(type.equals("4")) {
|
|
|
+ FStockId.put("FNumber","CK006"); //利库仓
|
|
|
+ }
|
|
|
+ map.put("FStockId",FStockId);
|
|
|
String FSNUnitIDJson = objectMapper.writeValueAsString( map.get("FSNUnitID"));
|
|
|
Map<String,String > FSNUnitIDMap = objectMapper.readValue(FSNUnitIDJson, Map.class);
|
|
|
FSNUnitIDMap.put("FNumber",planTaskDetails1.getFunitidfNumber());
|
|
@@ -1150,9 +1182,9 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
map7.put("FMOMAINENTRYID",planTaskDetails1.getFtreeEntityFentryid());
|
|
|
HashMap<String, String> fStockId = new HashMap<>();
|
|
|
if(type.equals("1")){
|
|
|
- fStockId.put("FNumber","CK007");
|
|
|
+ fStockId.put("FNumber","CK007"); //成品仓
|
|
|
}else {
|
|
|
- fStockId.put("FNumber","CK006");
|
|
|
+ fStockId.put("FNumber","CK006"); //利库仓
|
|
|
}
|
|
|
map7.put("FStockId",fStockId);
|
|
|
HashMap<String, String> fNumber = new HashMap<>();
|
|
@@ -1952,6 +1984,8 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
ringScanInformation.setOrderNumber(jdProductionOrders.get(0).getDemandDocument());
|
|
|
//生产订单号
|
|
|
ringScanInformation.setProductionOrderNumber(jdProductionOrders.get(0).getDocumentNumber());
|
|
|
+ //唯一标识id
|
|
|
+// ringScanInformation.setId(UUID.randomUUID().toString());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1985,7 +2019,7 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
}
|
|
|
List<Map> mapListTotal = JSON.parseArray(resultJsonTotal, Map.class);
|
|
|
if(mapListTotal.size()<=0){
|
|
|
- ringScanInformation.setExecutionMark("1");//成功
|
|
|
+ ringScanInformation.setExecutionMark("2");//成功
|
|
|
ringScanInformation.setExecutionMessage("扫描失败");
|
|
|
int i2 = ringScanInformationMapper.insertRingScanInformation(ringScanInformation);
|
|
|
return "订单已关闭-扫描失败";
|