|
@@ -631,8 +631,8 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
//根据生产订单号查询生产用料清单
|
|
|
String productionMaterialsListQuery="{\n" +
|
|
|
" \"FormId\": \"PRD_PPBOM\",\n" +
|
|
|
- " \"FieldKeys\": \"FMaterialID.FNumber,FMaterialName,FMaterialModel,FMaterialModel2,FDescription,FMaterialID2.FNumber,FMaterialName1,FMaterialModel1,FUnitID2.FName,FMustQty,FMEMO1,FNumerator,FMaterialType\",\n" +
|
|
|
- " \"FilterString\": [{\"Left\":\"\",\"FieldName\":\"FMOBillNO\",\"Compare\":\"17\",\"Value\":\""+documentNumber+"\",\"Right\":\"\",\"Logic\":0},{\"Left\":\"\",\"FieldName\":\"FProcessID.FName\",\"Compare\":\"17\",\"Value\":\""+gxm+"\",\"Right\":\"\",\"Logic\":0}],\n" +
|
|
|
+ " \"FieldKeys\": \"FMaterialID.FNumber,FMaterialName,FMaterialModel,FMaterialModel2,FDescription,FMaterialID2.FNumber,FMaterialName1,FMaterialModel1,FUnitID2.FName,FMustQty,FMEMO1,FNumerator,FMaterialType,FProcessID.FName\",\n" +
|
|
|
+ " \"FilterString\": [],\n" +
|
|
|
" \"OrderString\": \"\",\n" +
|
|
|
" \"TopRowCount\": 0,\n" +
|
|
|
" \"StartRow\": 0,\n" +
|
|
@@ -644,33 +644,39 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
|
|
|
String filterString = map2.get("FilterString").toString();
|
|
|
List<Map> mapList = JSON.parseArray(filterString, Map.class);
|
|
|
- //循环条件
|
|
|
- procedureListErps.forEach(map1 -> {
|
|
|
- String mapTj="{\"Left\":\"\",\"FieldName\":\"FProcessID.FName\",\"Compare\":\"67\",\"Value\":\"111\",\"Right\":\"\",\"Logic\":1}";
|
|
|
- Map mapObj = JSONObject.parseObject(mapTj, Map.class);
|
|
|
- mapObj.put("Value", map1.getProcedurName());
|
|
|
- mapList.add(mapObj);
|
|
|
- });
|
|
|
-
|
|
|
- map2.put("FilterString", mapList);//从新绑定条件
|
|
|
-
|
|
|
- //生产用料清单结果
|
|
|
- String resultJsonJG = api.billQuery(JSON.toJSONString(map2));
|
|
|
- //json转Java实体类对象
|
|
|
- List<MaterialRetentionLogVo> materialRetentionLogVos = JSON.parseArray(resultJsonJG, MaterialRetentionLogVo.class);
|
|
|
- //赋值一些默认值
|
|
|
- List<MaterialRetentionLogVo> collect = materialRetentionLogVos.parallelStream().map(item -> {
|
|
|
- item.setCkNumber("CK005");
|
|
|
- item.setDeliveryWarehouse("车间仓");
|
|
|
- item.setFlowSequenceNumber(lxkNumber);//流转序列号
|
|
|
- item.setProcess(gxm);
|
|
|
- item.setOrderNumber(orderNumber);
|
|
|
- item.setProductionOrderNumber(productNumber);
|
|
|
- item.setCreateTime(new Date());
|
|
|
- return item;
|
|
|
- }).collect(Collectors.toList());
|
|
|
- //分子数量基本的扣料单位
|
|
|
- int i = materialRetentionLogMapper.insertMaterialRetentionLogBatch(collect);
|
|
|
+ if(procedureListErps.size()>0){
|
|
|
+ //循环条件
|
|
|
+ procedureListErps.forEach(map1 -> {
|
|
|
+ String ddh="{\"Left\":\"\",\"FieldName\":\"FMOBillNO\",\"Compare\":\"67\",\"Value\":\"11\",\"Right\":\"\",\"Logic\":0}";
|
|
|
+ String mapTj="{\"Left\":\"\",\"FieldName\":\"FProcessID.FName\",\"Compare\":\"67\",\"Value\":\"111\",\"Right\":\"\",\"Logic\":1}";
|
|
|
+ Map mapObj = JSONObject.parseObject(mapTj, Map.class);
|
|
|
+ Map ddhObj = JSONObject.parseObject(ddh, Map.class);
|
|
|
+ ddhObj.put("Value", productNumber);
|
|
|
+ mapObj.put("Value", map1.getProcedurName());
|
|
|
+ mapList.add(ddhObj);
|
|
|
+ mapList.add(mapObj);
|
|
|
+ });
|
|
|
+
|
|
|
+ map2.put("FilterString", mapList);//从新绑定条件
|
|
|
+
|
|
|
+ //生产用料清单结果
|
|
|
+ String resultJsonJG = api.billQuery(JSON.toJSONString(map2));
|
|
|
+ //json转Java实体类对象
|
|
|
+ List<MaterialRetentionLogVo> materialRetentionLogVos = JSON.parseArray(resultJsonJG, MaterialRetentionLogVo.class);
|
|
|
+ //赋值一些默认值
|
|
|
+ List<MaterialRetentionLogVo> collect = materialRetentionLogVos.parallelStream().map(item -> {
|
|
|
+ item.setCkNumber("CK005");
|
|
|
+ item.setDeliveryWarehouse("车间仓");
|
|
|
+ item.setFlowSequenceNumber(lxkNumber);//流转序列号
|
|
|
+ item.setMesprocess(gxm);
|
|
|
+ item.setOrderNumber(orderNumber);
|
|
|
+ item.setProductionOrderNumber(productNumber);
|
|
|
+ item.setCreateTime(new Date());
|
|
|
+ return item;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ //分子数量基本的扣料单位
|
|
|
+ int i = materialRetentionLogMapper.insertMaterialRetentionLogBatch(collect);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
@@ -727,36 +733,39 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
String filterString = map2.get("FilterString").toString();
|
|
|
|
|
|
List<Map> mapList = JSON.parseArray(filterString, Map.class);
|
|
|
- //循环条件
|
|
|
- procedureListErps.forEach(map1 -> {
|
|
|
- String ddh="{\"Left\":\"\",\"FieldName\":\"FMOBillNO\",\"Compare\":\"67\",\"Value\":\"11\",\"Right\":\"\",\"Logic\":0}";
|
|
|
- String mapTj="{\"Left\":\"\",\"FieldName\":\"FProcessID.FName\",\"Compare\":\"67\",\"Value\":\"111\",\"Right\":\"\",\"Logic\":1}";
|
|
|
- Map mapObj = JSONObject.parseObject(mapTj, Map.class);
|
|
|
- Map ddhObj = JSONObject.parseObject(ddh, Map.class);
|
|
|
- ddhObj.put("Value", productNumber);
|
|
|
- mapObj.put("Value", map1.getProcedurName());
|
|
|
- mapList.add(ddhObj);
|
|
|
- mapList.add(mapObj);
|
|
|
- });
|
|
|
- map2.put("FilterString", mapList);//从新绑定条件
|
|
|
-
|
|
|
-
|
|
|
- //生产用料清单结果
|
|
|
- String resultJsonJG = api.billQuery(JSON.toJSONString(map2));
|
|
|
- //json转Java实体类对象
|
|
|
- List<MaterialRetentionLogVo> materialRetentionLogVos = JSON.parseArray(resultJsonJG, MaterialRetentionLogVo.class);
|
|
|
- //赋值一些默认值
|
|
|
- List<MaterialRetentionLogVo> collect = materialRetentionLogVos.parallelStream().map(item -> {
|
|
|
- item.setCkNumber("CK005");
|
|
|
- item.setDeliveryWarehouse("车间仓");
|
|
|
- item.setFlowSequenceNumber(lxkNumber);//流转序列号
|
|
|
- item.setMesprocess(gxm); //工序
|
|
|
- item.setOrderNumber(orderNumber); //订单
|
|
|
- item.setProductionOrderNumber(productNumber); //生产订单
|
|
|
- return item;
|
|
|
- }).collect(Collectors.toList());
|
|
|
- //分子数量基本的扣料单位
|
|
|
- int i = materialRetentionLogMapper.insertMaterialRetentionLogBatch(collect);
|
|
|
+ if(procedureListErps.size()>0){
|
|
|
+ //循环条件
|
|
|
+ procedureListErps.forEach(map1 -> {
|
|
|
+ String ddh="{\"Left\":\"\",\"FieldName\":\"FMOBillNO\",\"Compare\":\"67\",\"Value\":\"11\",\"Right\":\"\",\"Logic\":0}";
|
|
|
+ String mapTj="{\"Left\":\"\",\"FieldName\":\"FProcessID.FName\",\"Compare\":\"67\",\"Value\":\"111\",\"Right\":\"\",\"Logic\":1}";
|
|
|
+ Map mapObj = JSONObject.parseObject(mapTj, Map.class);
|
|
|
+ Map ddhObj = JSONObject.parseObject(ddh, Map.class);
|
|
|
+ ddhObj.put("Value", productNumber);
|
|
|
+ mapObj.put("Value", map1.getProcedurName());
|
|
|
+ mapList.add(ddhObj);
|
|
|
+ mapList.add(mapObj);
|
|
|
+ });
|
|
|
+ map2.put("FilterString", mapList);//从新绑定条件
|
|
|
+
|
|
|
+
|
|
|
+ //生产用料清单结果
|
|
|
+ String resultJsonJG = api.billQuery(JSON.toJSONString(map2));
|
|
|
+ //json转Java实体类对象
|
|
|
+ List<MaterialRetentionLogVo> materialRetentionLogVos = JSON.parseArray(resultJsonJG, MaterialRetentionLogVo.class);
|
|
|
+ //赋值一些默认值
|
|
|
+ List<MaterialRetentionLogVo> collect = materialRetentionLogVos.parallelStream().map(item -> {
|
|
|
+ item.setCkNumber("CK005");
|
|
|
+ item.setDeliveryWarehouse("车间仓");
|
|
|
+ item.setFlowSequenceNumber(lxkNumber);//流转序列号
|
|
|
+ item.setMesprocess(gxm); //工序
|
|
|
+ item.setOrderNumber(orderNumber); //订单
|
|
|
+ item.setProductionOrderNumber(productNumber); //生产订单
|
|
|
+ item.setCreateTime(new DateTime());//创建时间
|
|
|
+ return item;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ //分子数量基本的扣料单位
|
|
|
+ int i = materialRetentionLogMapper.insertMaterialRetentionLogBatch(collect);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
@@ -928,18 +937,32 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
String FSerialSubEntityJson = objectMapper.writeValueAsString( map.get("FSerialSubEntity"));
|
|
|
List<Map> fSerialSubEntitylist = objectMapper.readValue(FSerialSubEntityJson, List.class);
|
|
|
productionCardFlows.forEach(item->{
|
|
|
- Map map2 = fSerialSubEntitylist.get(0);
|
|
|
- map2.put("FSerialNo",item.getSerialNumber());
|
|
|
- Map<String,String > fSerialIdMap= null;
|
|
|
try {
|
|
|
- String fSerialIdJson = objectMapper.writeValueAsString(map2.get("FSerialId"));
|
|
|
- fSerialIdMap = objectMapper.readValue(fSerialIdJson, Map.class);
|
|
|
+ // 将 fSerialSubEntitylist.get(0) 转换为 JSON 字符串,再反序列化为新的 Map
|
|
|
+ String map2Json = objectMapper.writeValueAsString(fSerialSubEntitylist.get(0));
|
|
|
+ Map<String, Object> map2 = objectMapper.readValue(map2Json, Map.class);
|
|
|
+
|
|
|
+ // 修改 map2 中的 FSerialNo
|
|
|
+ map2.put("FSerialNo", item.getSerialNumber());
|
|
|
+
|
|
|
+ // 处理 FSerialId
|
|
|
+ Map<String, String> fSerialIdMap = null;
|
|
|
+ if (map2.get("FSerialId") != null) {
|
|
|
+ String fSerialIdJson = objectMapper.writeValueAsString(map2.get("FSerialId"));
|
|
|
+ fSerialIdMap = objectMapper.readValue(fSerialIdJson, Map.class);
|
|
|
+ } else {
|
|
|
+ fSerialIdMap = new HashMap<>();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 修改 FSerialId 中的 FNUMBER
|
|
|
+ fSerialIdMap.put("FNUMBER", item.getSerialNumber());
|
|
|
+ map2.put("FSerialId", fSerialIdMap);
|
|
|
+
|
|
|
+ // 将修改后的 map2 添加到 list1
|
|
|
+ list1.add(map2);
|
|
|
} catch (JsonProcessingException e) {
|
|
|
throw new RuntimeException(e);
|
|
|
}
|
|
|
- fSerialIdMap.put("FNUMBER",item.getSerialNumber());
|
|
|
- map2.put("FSerialId",fSerialIdMap);
|
|
|
- list1.add(map2);
|
|
|
});
|
|
|
map.put("FSerialSubEntity",list1);
|
|
|
|
|
@@ -1093,10 +1116,54 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
|
|
|
|
|
|
|
|
|
- map7.put("FMustQty",planTaskDetails1.getQuantity());
|
|
|
- map7.put("FRealQty",planTaskDetails1.getQuantity());
|
|
|
|
|
|
|
|
|
+ //序列号单据体---循环
|
|
|
+ ProductionCardFlow productionCardFlow=new ProductionCardFlow();
|
|
|
+ productionCardFlow.setDemandDocumentNumber(planTaskDetails1.getDemandDocument());//流转卡序列号
|
|
|
+ List<ProductionCardFlow> productionCardFlows = productionCardFlowMapper.selectProductionCardFlowList(productionCardFlow);
|
|
|
+
|
|
|
+ map7.put("FSNQty",productionCardFlows.size()); //序列号数量
|
|
|
+ map7.put("FMustQty",productionCardFlows.size()); //应收实收
|
|
|
+ map7.put("FRealQty",productionCardFlows.size()); //实收
|
|
|
+
|
|
|
+ map7.put("FBaseMustQty",productionCardFlows.size()); //基本单位实收数量
|
|
|
+ map7.put("FBaseRealQty",productionCardFlows.size()); //基本单位库存实收数量
|
|
|
+
|
|
|
+
|
|
|
+ List<Map> list1=new ArrayList<>();
|
|
|
+// String FSerialSubEntity = map.get("FSerialSubEntity").toString();
|
|
|
+ String FSerialSubEntityJson = objectMapper.writeValueAsString( map7.get("FSerialSubEntity"));
|
|
|
+ List<Map> fSerialSubEntitylist = objectMapper.readValue(FSerialSubEntityJson, List.class);
|
|
|
+ productionCardFlows.forEach(item->{
|
|
|
+ try {
|
|
|
+ // 将 fSerialSubEntitylist.get(0) 转换为 JSON 字符串,再反序列化为新的 Map
|
|
|
+ String map2Json = objectMapper.writeValueAsString(fSerialSubEntitylist.get(0));
|
|
|
+ Map<String, Object> map2two = objectMapper.readValue(map2Json, Map.class);
|
|
|
+
|
|
|
+ // 修改 map2 中的 FSerialNo
|
|
|
+ map2two.put("FSerialNo", item.getSerialNumber());
|
|
|
+
|
|
|
+ // 处理 FSerialId
|
|
|
+ Map<String, String> fSerialIdMap = null;
|
|
|
+ if (map2two.get("FSerialId") != null) {
|
|
|
+ String fSerialIdJson = objectMapper.writeValueAsString(map2two.get("FSerialId"));
|
|
|
+ fSerialIdMap = objectMapper.readValue(fSerialIdJson, Map.class);
|
|
|
+ } else {
|
|
|
+ fSerialIdMap = new HashMap<>();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 修改 FSerialId 中的 FNUMBER
|
|
|
+ fSerialIdMap.put("FNumber", item.getSerialNumber());
|
|
|
+ map2two.put("FSerialId", fSerialIdMap);
|
|
|
+
|
|
|
+ // 将修改后的 map2 添加到 list1
|
|
|
+ list1.add(map2two);
|
|
|
+ } catch (JsonProcessingException e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ map7.put("FSerialSubEntity",list1);
|
|
|
|
|
|
List<Map> fEntityLinkList=new ArrayList<>();
|
|
|
String FenJson="{\n" +
|
|
@@ -1186,7 +1253,6 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
System.out.println(msg2);
|
|
|
throw new RuntimeException(msg2);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|