|
@@ -327,7 +327,7 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
RingScanInformation prodOrderScanning=new RingScanInformation();
|
|
|
prodOrderScanning.setContentInformation(s1);
|
|
|
prodOrderScanning.setProcessName(ringScanInformation.getProcessName());
|
|
|
- List<RingScanInformation> ringScanInformations = ringScanInformationMapper.selectRingScanInformationList(prodOrderScanning);
|
|
|
+ List<RingScanInformation> ringScanInformations = ringScanInformationMapper.selectRingScanInformationListisNotNull(prodOrderScanning);
|
|
|
if(ringScanInformations.size()>0){
|
|
|
ringScanInformation.setExecutionMark("2");//成功
|
|
|
ringScanInformation.setExecutionMessage("重复扫描");
|
|
@@ -339,7 +339,6 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
return stationInformations.get(0).getStationName()+"-"+stationInformations.get(0).getPersonnelName()+"-"+"重复扫描"+"-"
|
|
|
+scanStatistics.getdOrder()+"-"+scanStatistics.getdCount()+"-"+scanStatistics.getDsCount()+"-"+scanStatistics.getDfCount();
|
|
|
}
|
|
|
-
|
|
|
//查询生产订单日志里有没有这个生产订单有就不添加了
|
|
|
RingScanInformationFirst ringScanInformationFirst=new RingScanInformationFirst();
|
|
|
ringScanInformationFirst.setProductionOrderNumber(ringScanInformation.getProductionOrderNumber());
|
|
@@ -371,7 +370,7 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
String materialId = planTaskDetails2.getMaterialId();
|
|
|
if(materialId.startsWith("1")){//
|
|
|
ringScanInformationFirst1.setPackingOrInspection("1");//1开头的 试机,包装,包装检验, 入库
|
|
|
- }else if(materialId.startsWith("201")) {
|
|
|
+ }else if(materialId.startsWith("2")) {
|
|
|
ringScanInformationFirst1.setPackingOrInspection("2");//2试机,入库
|
|
|
}
|
|
|
}
|
|
@@ -392,7 +391,7 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
if(planTaskDetails1.size()>0){
|
|
|
PlanTaskDetails planTaskDetails2 = planTaskDetails1.get(0);
|
|
|
String materialId = planTaskDetails2.getMaterialId();
|
|
|
- if(materialId.startsWith("1")&&ringScanInformation.getProcessName().equals("包装检验")){//1卡头并且当前工序未包装,扫描信息为,更新包装数量
|
|
|
+ if(materialId.startsWith("1")&&ringScanInformation.getProcessName().equals("成品检验")){//1卡头并且当前工序未包装,扫描信息为,更新包装数量
|
|
|
RingScanInformation ringScanInformation1=new RingScanInformation();
|
|
|
ringScanInformation1.setNativeNumbering(ringScanInformation.getNativeNumbering());
|
|
|
ringScanInformation1.setProcessName(ringScanInformation.getProcessName());//工序
|
|
@@ -405,7 +404,7 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
// this.generateWarehouseWarrant2(ringScanInformation.getProductionOrderNumber(),ringScanInformation.getProcessName());//生产订单号,工序名
|
|
|
this.generateWarehouseWarrant(ringScanInformation.getProductionOrderNumber(),ringScanInformation.getProcessName(),"3");//生产订单号,工序名
|
|
|
}
|
|
|
- }else if(materialId.startsWith("201")&&ringScanInformation.getProcessName().equals("试机")) {
|
|
|
+ }else if(materialId.startsWith("2")&&ringScanInformation.getProcessName().equals("试机检验")) {
|
|
|
//有关于这个产品的扫描信息就不更新数量了
|
|
|
RingScanInformation ringScanInformation1=new RingScanInformation();
|
|
|
ringScanInformation1.setNativeNumbering(ringScanInformation.getNativeNumbering());
|
|
@@ -415,9 +414,8 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
RingScanInformationFirst newRingScanInformationFirst = getRingScanInformationFirst(ringScanInformationFirstNumber.getInspectionQuantity(), ringScanInformation,"2");
|
|
|
ringScanInformationFirstMapper.updateRingScanInformationFirstByproductionOrderNumber(newRingScanInformationFirst);
|
|
|
//生产汇报
|
|
|
-// this.generateWarehouseWarrant2(ringScanInformation.getProductionOrderNumber());
|
|
|
- this.generateWarehouseWarrant(ringScanInformation.getProductionOrderNumber(),ringScanInformation.getProcessName(),"3");//生产订单号,工序名
|
|
|
-
|
|
|
+// this.generateWarehouseWarrant2(ringScanInformation.getProductionOrderNumber());
|
|
|
+ this.generateWarehouseWarrant(ringScanInformation.getProductionOrderNumber(),ringScanInformation.getProcessName(),"3");//生产订单号,工序名
|
|
|
}
|
|
|
}
|
|
|
else if(materialId.startsWith("1")&&ringScanInformation.getProcessName().equals("入库")){//1卡头并且当前工序未包装,扫描信息为,更新包装数量
|
|
@@ -433,7 +431,7 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
// this.generateWarehouseWarrant(ringScanInformation.getProductionOrderNumber(),ringScanInformation.getProcessName());//生产订单号,工序名
|
|
|
this.generateWarehouseWarrant(ringScanInformation.getProductionOrderNumber(),ringScanInformation.getProcessName(),"1");
|
|
|
}
|
|
|
- }else if(materialId.startsWith("201")&&ringScanInformation.getProcessName().equals("入库")) {
|
|
|
+ }else if(materialId.startsWith("2")&&ringScanInformation.getProcessName().equals("入库")) {
|
|
|
//有关于这个产品的扫描信息就不更新数量了
|
|
|
RingScanInformation ringScanInformation1=new RingScanInformation();
|
|
|
ringScanInformation1.setNativeNumbering(ringScanInformation.getNativeNumbering());
|
|
@@ -443,7 +441,7 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
RingScanInformationFirst newRingScanInformationFirst = getRingScanInformationFirst(ringScanInformationFirstNumber.getRks(), ringScanInformation,"3");
|
|
|
ringScanInformationFirstMapper.updateRingScanInformationFirstByproductionOrderNumber(newRingScanInformationFirst);
|
|
|
//生产逻辑
|
|
|
- this.generateWarehouseWarrant(ringScanInformation.getProductionOrderNumber(),ringScanInformation.getProcessName(),"1");//生产订单号,工序名
|
|
|
+ this.generateWarehouseWarrant(ringScanInformation.getProductionOrderNumber(),ringScanInformation.getProcessName(),"2");//生产订单号,工序名
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -491,39 +489,69 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
ringScanInformation1.setProductionOrderNumber(ringScanInformation.getProductionOrderNumber());
|
|
|
ringScanInformation1.setProcessName("焊接D");
|
|
|
String s = ringScanInformationMapper.selectRingScanInformationListLike(ringScanInformation1);
|
|
|
- ringScanInformation.setOverNumber(s);
|
|
|
+ int i = Integer.parseInt(s);
|
|
|
+ int ss=i+1;
|
|
|
+ ringScanInformation.setOverNumber(String.valueOf(ss));
|
|
|
}else if(contentInformation.contains("Z")){
|
|
|
RingScanInformation ringScanInformation1=new RingScanInformation();
|
|
|
ringScanInformation1.setProductionOrderNumber(ringScanInformation.getProductionOrderNumber());
|
|
|
ringScanInformation1.setProcessName("焊接Z");
|
|
|
String s = ringScanInformationMapper.selectRingScanInformationListLike(ringScanInformation1);
|
|
|
- ringScanInformation.setOverNumber(s);
|
|
|
+ int i = Integer.parseInt(s);
|
|
|
+ int ss=i+1;
|
|
|
+ ringScanInformation.setOverNumber(String.valueOf(ss));
|
|
|
}
|
|
|
}else {
|
|
|
String s = ringScanInformationMapper.selectRingScanInformationListLike(ringScanInformation);
|
|
|
- ringScanInformation.setOverNumber(s);
|
|
|
+ int i = Integer.parseInt(s);
|
|
|
+ int ss=i+1;
|
|
|
+ ringScanInformation.setOverNumber(String.valueOf(ss));
|
|
|
}
|
|
|
//插入扫描日志信息
|
|
|
ringScanInformation.setExecutionMark("1");
|
|
|
ringScanInformation.setExecutionMessage("扫描成功");
|
|
|
+ if(ringScanInformation.getProcessName().equals("白坯检验")){
|
|
|
+ RingScanInformation ringScanInformation1=new RingScanInformation();
|
|
|
+ BeanUtils.copyProperties(ringScanInformation,ringScanInformation1);
|
|
|
+ ringScanInformation1.setProcessName("浸漆");
|
|
|
+ ringScanInformation1.setProcess("32");
|
|
|
+ ringScanInformation1.setStationId("0");
|
|
|
+ ringScanInformation1.setStationName("浸漆");
|
|
|
+ int i2 = ringScanInformationMapper.insertRingScanInformation(ringScanInformation1);
|
|
|
+ }
|
|
|
+ if(ringScanInformation.getProcessName().equals("成品检验")){
|
|
|
+ RingScanInformation ringScanInformation1=new RingScanInformation();
|
|
|
+ BeanUtils.copyProperties(ringScanInformation,ringScanInformation1);
|
|
|
+ ringScanInformation1.setProcessName("包装");
|
|
|
+ ringScanInformation1.setProcess("26");
|
|
|
+ ringScanInformation1.setStationId("0");
|
|
|
+ ringScanInformation1.setStationName("包装工位");
|
|
|
+ int i2 = ringScanInformationMapper.insertRingScanInformation(ringScanInformation1);
|
|
|
+ }
|
|
|
int i2 = ringScanInformationMapper.insertRingScanInformation(ringScanInformation);
|
|
|
|
|
|
- //扣料操作
|
|
|
+// //扣料操作
|
|
|
String s = this.sweepingMaterial(ringScanInformation.getOrderNumber(), ringScanInformation.getProductionOrderNumber(), //订单号 生产订单号
|
|
|
ringScanInformation.getProcessName(), ringScanInformation.getNativeNumbering());//工序 流转卡信息
|
|
|
|
|
|
//查询当前工位信息
|
|
|
- RingScanInformation ringScanInformation1=new RingScanInformation();
|
|
|
- ringScanInformation1.setProductionOrderNumber(ringScanInformation.getProductionOrderNumber());
|
|
|
- ringScanInformation1.setProcessName(ringScanInformation.getProcessName());
|
|
|
- if(ringScanInformation.getProcessName().equals("焊接")) {
|
|
|
- if (ringScanInformation.getContentInformation().contains("D")) {
|
|
|
- ringScanInformation1.setProcessName("焊接D");
|
|
|
- } else {
|
|
|
- ringScanInformation1.setProcessName("焊接Z");
|
|
|
+ ScanStatistics scanStatistics = null;
|
|
|
+ try {
|
|
|
+ RingScanInformation ringScanInformation1=new RingScanInformation();
|
|
|
+ ringScanInformation1.setProductionOrderNumber(ringScanInformation.getProductionOrderNumber());
|
|
|
+ ringScanInformation1.setProcessName(ringScanInformation.getProcessName());
|
|
|
+ if(ringScanInformation.getProcessName().equals("焊接")) {
|
|
|
+ if (ringScanInformation.getContentInformation().contains("D")) {
|
|
|
+ ringScanInformation1.setProcessName("焊接D");
|
|
|
+ } else {
|
|
|
+ ringScanInformation1.setProcessName("焊接Z");
|
|
|
+ }
|
|
|
}
|
|
|
+ scanStatistics = ringScanInformationMapper.selectScanStatistics(ringScanInformation1);
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
}
|
|
|
- ScanStatistics scanStatistics = ringScanInformationMapper.selectScanStatistics(ringScanInformation1);
|
|
|
+ //记录扫迈欧
|
|
|
return ringScanInformation.getStationName()+"-"+ringScanInformation.getPersonnelName()+"-"+"扫描成功"+"-"+
|
|
|
scanStatistics.getdOrder()+"-"+scanStatistics.getdCount()+"-"+scanStatistics.getDsCount()+"-"+scanStatistics.getDfCount();
|
|
|
}
|
|
@@ -540,6 +568,9 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
*/
|
|
|
@Override
|
|
|
public String sweepingMaterial(String orderNumber,String productNumber,String gxm,String lxkNumber){
|
|
|
+ if(gxm.equals("入库")){
|
|
|
+ return "入库不扣料";
|
|
|
+ }
|
|
|
ProcedureList procedureList=new ProcedureList();
|
|
|
procedureList.setProcedurName(gxm);
|
|
|
List<ProcedureList> procedureLists = procedureListMapper.selectProcedureListList(procedureList);
|
|
@@ -654,7 +685,7 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
String queryString ="{\n" +
|
|
|
" \"FormId\": \"PRD_MO\",\n" +
|
|
|
" \"FieldKeys\": \"FBillNo\",\n" +
|
|
|
- " \"FilterString\": [{\"Left\":\"\",\"FieldName\":\"FSerialNo\",\"Compare\":\"67\",\"Value\":\""+productNumber+"\",\"Right\":\"\",\"Logic\":0}],\n" +
|
|
|
+ " \"FilterString\": [{\"Left\":\"\",\"FieldName\":\"FSerialNo\",\"Compare\":\"67\",\"Value\":\""+lxkNumber+"\",\"Right\":\"\",\"Logic\":0}],\n" +
|
|
|
" \"OrderString\": \"\",\n" +
|
|
|
" \"TopRowCount\": 0,\n" +
|
|
|
" \"StartRow\": 0,\n" +
|
|
@@ -682,8 +713,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" +
|
|
@@ -698,9 +729,13 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
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);//从新绑定条件
|
|
@@ -715,7 +750,7 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
item.setCkNumber("CK005");
|
|
|
item.setDeliveryWarehouse("车间仓");
|
|
|
item.setFlowSequenceNumber(lxkNumber);//流转序列号
|
|
|
- item.setProcess(gxm); //工序
|
|
|
+ item.setMesprocess(gxm); //工序
|
|
|
item.setOrderNumber(orderNumber); //订单
|
|
|
item.setProductionOrderNumber(productNumber); //生产订单
|
|
|
return item;
|
|
@@ -793,6 +828,9 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
List<PlanTaskDetails> planTaskDetails1 = planTaskDetailsMapper.selectPlanTaskDetailsList(planTaskDetails);
|
|
|
//入库 typ 1 入成品 type 入利库
|
|
|
erpWareHouSing(planTaskDetails1.get(0),type);
|
|
|
+ //加更正生产订单状态
|
|
|
+ planTaskDetails.setStatus("2");//生产完成
|
|
|
+ int i2 = planTaskDetailsMapper.updatePlanTaskDetailsByDemandDocument(planTaskDetails);
|
|
|
return "入库成功";
|
|
|
}
|
|
|
}
|
|
@@ -810,20 +848,20 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
planTaskDetails.setDemandDocument(productionOrderNumber);
|
|
|
//查询即将入库的产品信息
|
|
|
List<PlanTaskDetails> planTaskDetails1 = planTaskDetailsMapper.selectPlanTaskDetailsList(planTaskDetails);
|
|
|
- //加更正生产订单状态
|
|
|
- planTaskDetails.setStatus("2");//生产完成
|
|
|
+// //加更正生产订单状态
|
|
|
+// planTaskDetails.setStatus("2");//生产完成
|
|
|
//检查包装或者试机数量
|
|
|
if(packingOrInspection.equals("1")){//检查包装检验 --如果够了-下推生产汇报单
|
|
|
//看包装跟当前生产订单总数量是否相等
|
|
|
if(ringScanInformationFirst.getPackingQuantity().equals(ringScanInformationFirst.getProductionOrderTotalQuantity())){
|
|
|
- int i = planTaskDetailsMapper.updatePlanTaskDetailsByDemandDocument(planTaskDetails);
|
|
|
+// int i = planTaskDetailsMapper.updatePlanTaskDetailsByDemandDocument(planTaskDetails);
|
|
|
//工序汇报
|
|
|
erpProcessReport(planTaskDetails1.get(0));
|
|
|
}
|
|
|
}else if(packingOrInspection.equals("2")){ //试机数量--下推生产汇报单
|
|
|
//看包装跟当前生产订单总数量是否相等
|
|
|
if(ringScanInformationFirst.getInspectionQuantity().equals(ringScanInformationFirst.getProductionOrderTotalQuantity())){
|
|
|
- int i = planTaskDetailsMapper.updatePlanTaskDetailsByDemandDocument(planTaskDetails);
|
|
|
+// int i = planTaskDetailsMapper.updatePlanTaskDetailsByDemandDocument(planTaskDetails);
|
|
|
//生产汇报
|
|
|
erpProcessReport(planTaskDetails1.get(0));
|
|
|
}
|
|
@@ -989,7 +1027,7 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
* @param planTaskDetails1
|
|
|
* type 入那个库
|
|
|
*/
|
|
|
- private void erpWareHouSing(PlanTaskDetails planTaskDetails1,String type){
|
|
|
+ private String erpWareHouSing(PlanTaskDetails planTaskDetails1,String type){
|
|
|
//生产汇报
|
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
|
//生产用料清单结果
|
|
@@ -998,7 +1036,7 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
//查询生产汇报工序的基本信息
|
|
|
String nr="{\n" +
|
|
|
" \"FormId\": \"PRD_MORPT\",\n" +
|
|
|
- " \"FieldKeys\": \"fbillno,fid,FSrcBillNo,FEntity_FEntryId\",\n" +
|
|
|
+ " \"FieldKeys\": \"fbillno,fid,FSrcBillNo,FEntity_FEntryId,FDate,FUnitID.FNumber\",\n" +
|
|
|
" \"FilterString\": [{\"Left\":\"\",\"FieldName\":\"FSrcBillNo\",\"Compare\":\"17\",\"Value\":\""+planTaskDetails1.getDemandDocument()+"\",\"Right\":\"\",\"Logic\":0}],\n" +
|
|
|
" \"OrderString\": \"\",\n" +
|
|
|
" \"TopRowCount\": 0,\n" +
|
|
@@ -1013,40 +1051,53 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
String fbillno = map2.get("fbillno").toString();
|
|
|
String fid = map2.get("fid").toString();
|
|
|
String FEntityFEntryId = map2.get("FEntity.FEntryId").toString();
|
|
|
-
|
|
|
+ String FDate = map2.get("FDate").toString();
|
|
|
+ String FSrcBillNo = map2.get("FSrcBillNo").toString();
|
|
|
+ String FUnitIDFNumber = map2.get("FUnitID.FNumber").toString();
|
|
|
//生成入库单
|
|
|
- Map<String, String> jsonData2 = objectMapper.readValue(storage.getInputStream(), Map.class);
|
|
|
+ Map<String, Object> jsonData2 = objectMapper.readValue(storage.getInputStream(), LinkedHashMap.class);
|
|
|
//得到Model
|
|
|
- String model2 = jsonData2.get("Model");
|
|
|
- Map map6 = JSONObject.parseObject(model2, Map.class);
|
|
|
+ String model2 = objectMapper.writeValueAsString(jsonData2.get("Model"));
|
|
|
+ LinkedHashMap map6 = JSONObject.parseObject(model2, LinkedHashMap.class);
|
|
|
map6.put("FDate",DateUtils.toLocalDateTimeStr(LocalDateTime.now()));
|
|
|
- String fEntity1 = map6.get("FEntity").toString();
|
|
|
- List<Map> mapList = JSONArray.parseArray(fEntity1, Map.class);
|
|
|
- Map map7 = mapList.get(0);
|
|
|
- map7.put("FMoId",fid);
|
|
|
- map7.put("FMoEntryId",FEntityFEntryId);
|
|
|
- map7.put("FMOMAINENTRYID",FEntityFEntryId);
|
|
|
+ String fEntity1 = objectMapper.writeValueAsString(map6.get("FEntity"));
|
|
|
+ List<LinkedHashMap> mapList = JSONArray.parseArray(fEntity1, LinkedHashMap.class);
|
|
|
+ LinkedHashMap map7 = mapList.get(0);
|
|
|
+ map7.put("F_PONP_HBRQ",FDate);
|
|
|
+
|
|
|
map7.put("FSrcEntryId",FEntityFEntryId);
|
|
|
- map7.put("FSrcInterId",FEntityFEntryId);
|
|
|
- map7.put("FSrcBillNo",planTaskDetails1.getDemandDocument());
|
|
|
+ map7.put("FSrcInterId",fid);
|
|
|
+ map7.put("FSrcBillNo",fbillno);
|
|
|
map7.put("FMoBillNo",planTaskDetails1.getDemandDocument());
|
|
|
-
|
|
|
+ map7.put("FMoId",planTaskDetails1.getFid());
|
|
|
+ map7.put("FMoEntryId",planTaskDetails1.getFtreeEntityFentryid());
|
|
|
+ map7.put("FMOMAINENTRYID",planTaskDetails1.getFtreeEntityFentryid());
|
|
|
+ HashMap<String, String> fStockId = new HashMap<>();
|
|
|
+ if(type.equals("1")){
|
|
|
+ fStockId.put("FNumber","CK007");
|
|
|
+ }else {
|
|
|
+ fStockId.put("FNumber","CK006");
|
|
|
+ }
|
|
|
+ map7.put("FStockId",fStockId);
|
|
|
HashMap<String, String> fNumber = new HashMap<>();
|
|
|
fNumber.put("FNumber",planTaskDetails1.getMaterialId());
|
|
|
map7.put("FMaterialId",fNumber);
|
|
|
|
|
|
HashMap<String, String> fUnitIDfNumber = new HashMap<>();
|
|
|
- fUnitIDfNumber.put("FNumber",planTaskDetails1.getFunitidfNumber());
|
|
|
+ fUnitIDfNumber.put("FNumber",FUnitIDFNumber);
|
|
|
map7.put("FUnitID",fUnitIDfNumber);
|
|
|
|
|
|
-
|
|
|
HashMap<String, String> fBaseUnitIdFNumber = new HashMap<>();
|
|
|
- fBaseUnitIdFNumber.put("FNumber",planTaskDetails1.getFunitidfNumber());
|
|
|
+ fBaseUnitIdFNumber.put("FNumber",FUnitIDFNumber);
|
|
|
map7.put("FBaseUnitId",fBaseUnitIdFNumber);
|
|
|
|
|
|
+
|
|
|
+
|
|
|
map7.put("FMustQty",planTaskDetails1.getQuantity());
|
|
|
map7.put("FRealQty",planTaskDetails1.getQuantity());
|
|
|
|
|
|
+
|
|
|
+
|
|
|
List<Map> fEntityLinkList=new ArrayList<>();
|
|
|
String FenJson="{\n" +
|
|
|
"\"FEntity_Link_FRuleId\": \"PRD_MO2INSTOCK\",\n" +
|
|
@@ -1059,13 +1110,20 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
map8.put("FEntity_Link_FSId",FEntityFEntryId);
|
|
|
fEntityLinkList.add(map8);
|
|
|
map7.put("FEntity_Link",fEntityLinkList);
|
|
|
- String rkdcrateJosn = api.executeBillQueryJson(JSONObject.toJSONString(map7));
|
|
|
+ List<LinkedHashMap> map7List = new ArrayList<>();
|
|
|
+ map7List.add(map7);
|
|
|
+ map6.put("FEntity",map7List);
|
|
|
+
|
|
|
+ jsonData2.put("Model",map6);
|
|
|
+
|
|
|
+ String rkdcrateJosn = api.save("PRD_INSTOCK",JSONObject.toJSONString(jsonData2));
|
|
|
|
|
|
documentExecutionJudgment(objectMapper, rkdcrateJosn,"生成入库单创建","入库单创建失败");
|
|
|
|
|
|
//解析入库单创建结果
|
|
|
Map rkdCrateJsonResultString = objectMapper.readValue(rkdcrateJosn, Map.class);
|
|
|
- String rkdCrateResultJson = rkdCrateJsonResultString.get("Result").toString();
|
|
|
+// String rkdCrateResultJson = rkdCrateJsonResultString.get("Result").toString();
|
|
|
+ String rkdCrateResultJson = objectMapper.writeValueAsString(rkdCrateJsonResultString.get("Result"));
|
|
|
Map<String,String> rkdResultMap= objectMapper.readValue(rkdCrateResultJson, Map.class);
|
|
|
String rkdNumber = rkdResultMap.get("Number");//编号
|
|
|
|
|
@@ -1080,8 +1138,8 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
Map<String, Object> jsonData3 = objectMapper.readValue(rkdtj, Map.class);
|
|
|
List<String> list5 =new ArrayList<>();
|
|
|
list5.add(rkdNumber);
|
|
|
- jsonData3.put("Number",list5);
|
|
|
- String tkdtjR = api.executeBillQueryJson(JSONObject.toJSONString(jsonData3));
|
|
|
+ jsonData3.put("Numbers",list5);
|
|
|
+ String tkdtjR = api.submit("PRD_INSTOCK",JSONObject.toJSONString(jsonData3));
|
|
|
documentExecutionJudgment(objectMapper, tkdtjR,"入库单提交成功","入库单提交失败");
|
|
|
|
|
|
//审核
|
|
@@ -1097,11 +1155,12 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
Map<String, Object> jsonData4 = objectMapper.readValue(rkdsh, Map.class);
|
|
|
jsonData4.put("Number",list5);
|
|
|
|
|
|
- String rkdshR = api.executeBillQueryJson(JSONObject.toJSONString(jsonData3));
|
|
|
+ String rkdshR = api.audit("PRD_INSTOCK",JSONObject.toJSONString(jsonData3));
|
|
|
documentExecutionJudgment(objectMapper, rkdshR,"入库单审核成功","入库单审核失败");
|
|
|
} catch (Exception e) {
|
|
|
throw new RuntimeException(e);
|
|
|
}
|
|
|
+ return "入库成功";
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1122,9 +1181,10 @@ public class StationInformationServiceImpl implements IStationInformationService
|
|
|
Map map11 = objectMapper.readValue(responseStatus3, Map.class);
|
|
|
String isSuccess3 = map11.get("IsSuccess").toString();
|
|
|
if(isSuccess3.equals("true")){
|
|
|
- return msg2;
|
|
|
- }else {
|
|
|
return msg1;
|
|
|
+ }else {
|
|
|
+ System.out.println(msg2);
|
|
|
+ throw new RuntimeException(msg2);
|
|
|
}
|
|
|
|
|
|
}
|