Browse Source

面辅料推送接口

huxy 2 years ago
parent
commit
48bc1353bb

+ 2 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/controller/SyPackingListFabricController.java

@@ -826,10 +826,11 @@ public class SyPackingListFabricController {
 					if(syItem.getPurOrSubOrder()!=null){
 						item.setPurOrSubOrder(syItem.getPurOrSubOrder());
 					}
+					num=num+1;
 				}
 			}
 		}
 
-	 	return Result.ok("更新了多少条数据");
+	 	return Result.ok("更新了"+num+"条数据");
 	 }
  }

+ 8 - 7
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/mapper/xml/SyPackingListFabricMapper.xml

@@ -136,16 +136,17 @@
     </select>
 
     <select id="getOM_MOMain" resultType="java.util.HashMap" parameterType="java.util.HashMap">
-       select   om1.cVenCode,ve1.cVenDefine2,om3.isosid as isosid,om3.MODetailsID from OM_MOMain om1
+        select * from OM_MOMain om1
         left join Vendor ve1 ON
         om1.cVenCode=ve1.cVenCode
         inner join (
-        SELECT top 1 om3.moid,om3.isosid,om3.MODetailsID
-        FROM om_modetails om3
-        left join OM_MOMaterials om2
-        on om3.MODetailsID=om2.MODetailsID
-        where  om3.MODetailsID=#{id}  and om3.cinvcode=#{cinvCode}
-        )om3
+            select top 1 om1.* from om_modetails om1
+            inner join (SELECT om1.isosid,om2.cinvcode
+            FROM om_modetails om1  left join OM_MOMaterials om2
+            on om1.MODetailsID=om2.MODetailsID
+            where  om1.MODetailsID=#{id}  and om1.cinvcode=#{cinvCode} )om2
+            on om1.isosid=om2.isosid and om1.cinvcode=om2.cinvcode
+        ) om3
         on om1.moid=om3.moid
     </select>
 

+ 11 - 12
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/service/impl/SyPackingListFabricServiceImpl.java

@@ -809,7 +809,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 			map6.put("CMAKER",createBy);//制单人名称
 
 			JSONObject map7=new JSONObject();//采购(委外)入库单
-			map7.put("CVOUCHCODE", org.jeecg.modules.system.util.oConvertUtils.addOne(purchaseWarehousingMapper.getMaxCode("cCode+1","RdRecord01","dnmaketime")));//获取单据号
+			map7.put("CVOUCHCODE", org.jeecg.modules.system.util.oConvertUtils.addOne(org.jeecg.modules.system.util.oConvertUtils.addOne(purchaseWarehousingMapper.getMaxCode("cCode","RdRecord01","dnmaketime"))));//获取单据号
 			map7.put("DDATE",createDate);//日期(格式2015-01-01)
 			map7.put("CMAKER",createBy);//制单人
 			map7.put("cVouchType",1);//传1
@@ -927,6 +927,15 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 							throw new JeecgBootException(mapt.get("account")+"账套,委外订单子表行id"+item.getOmpoIdItem()+"未找到对应的染厂物料");
 						}else if(!mapStr1.containsKey("isosid")||mapStr1.get("isosid")==null){
 							throw new JeecgBootException(mapt.get("account")+"账套,委外订单子表行id"+mapStr1.get("MODetailsID")+"的isosid为空");
+						}else{
+							JSONObject mapItem7=new JSONObject();
+							getcFree(mapItem7,mapStr1);
+							mapItem7.put("ALLCAUTOIDCOL","MODetailsID");//订单明细ID对应字段名(固定MOMaterialsID) MOMaterialsID
+							mapItem7.put("AUTOID_ALL",mapStr1.get("MODetailsID"));//关联明细ID
+							mapItem7.put("CINVCODE",mapStr1.get("cInvCode"));//存货编码(如果来源单据是委外订单,此字段需要传该订单的子件编码)
+							mapItem7.put("IQUANTITY",mapStr1.get("iQuantity"));//数量
+							mapItem7.put("CBATCH",item.getDyelotNumber());//批号
+							mapItems7.add(mapItem7);
 						}
 						String cSOCode=syPackingListFabricMapper.getSO_SOMain(mapStr1.get("isosid").toString());
 						map7.put("CWHCODE",mapStr1.get("cVenDefine2"));
@@ -941,15 +950,6 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 							mapItem2.put("IQUANTITY",stringObjectMap.get("iQuantity"));//数量
 							mapItem2.put("CBATCH",item.getDyelotNumber());//批号
 							mapItems2.add(mapItem2);
-
-							JSONObject mapItem7=new JSONObject();
-							getcFree(mapItem7,stringObjectMap);
-							mapItem7.put("ALLCAUTOIDCOL","MODetailsID");//订单明细ID对应字段名(固定MOMaterialsID) MOMaterialsID
-							mapItem7.put("AUTOID_ALL",stringObjectMap.get("MoDetailsID"));//关联明细ID
-							mapItem7.put("CINVCODE",stringObjectMap.get("cInvCode"));//存货编码(如果来源单据是委外订单,此字段需要传该订单的子件编码)
-							mapItem7.put("IQUANTITY",stringObjectMap.get("iQuantity"));//数量
-							mapItem7.put("CBATCH",item.getDyelotNumber());//批号
-							mapItems7.add(mapItem7);
 						}
 					}
 
@@ -1076,7 +1076,6 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 			text(mapList2,"核销出库单");
 			text(mapList7,"印厂采购入库单");
 		}
-
 		String isSucceed=null;
 		if(mapList2!=null&&mapList2.size()>0&&main.getIsSucceed()!=null){//印花
 			JSONArray resturn2 = InterfaceConnUtils.doPost(mapList2,"materialout_import");//采购入库单
@@ -1085,7 +1084,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 			this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn2.getJSONObject(0).get("U8ReceiptNo").toString()),"107");
 		}else if(mapList2!=null&&mapList2.size()>0){
 			JSONArray resturn7 = InterfaceConnUtils.doPost(mapList7,"purchasein_import");//采购入库单
-			isSucceed=result(main,resturn7,"采购入库单",((Map) mapList.get(0)).get("CACCID").toString(),"7");//采购入库单
+			isSucceed=result(main,resturn7,"印厂采购入库单",((Map) mapList.get(0)).get("CACCID").toString(),"7");//采购入库单
 			isSucceed(main,isSucceed);
 			this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn7.getJSONObject(0).get("U8ReceiptNo").toString()),"107");