瀏覽代碼

面辅料批号调整

huxy 2 年之前
父節點
當前提交
5cfdb660f5

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

@@ -852,6 +852,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 				map5.put("IEXCHRATE",orderData.get("nflat"));//汇率(如果传空,接口默认1)cPayCode
 				map5.put("CPAYCODE",orderData.get("cPayCode"));//付款条件编码(如果传空,取来源单据)
 			}
+			int num1=1;
 			for (SyPackingListFabricItem item : main.getSyPackingListFabricItem()){
 				JSONObject mapItem=new JSONObject();
 				JSONObject mapItem3=new JSONObject();
@@ -869,8 +870,18 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 				map7.put("CACCID",mapt.get("account"));//账套号
 
 
-				mapItem.put("CBATCH",item.getDyelotNumber());//缸号
-
+				if(mapt.get("account").equals("903")){
+					mapItem.put("CBATCH",item.getDyelotNumber());//缸号
+					mapItem4.put("CBATCH",item.getDyelotNumber());//缸号
+				}else{
+					if(item.getDyelotNumber().indexOf("-")<0){
+						throw new JeecgBootException("缸号不规范,请先进行维护");
+					}
+					String cbatch=item.getDyelotNumber().substring(0,item.getDyelotNumber().indexOf("-"));
+					mapItem.put("CBATCH",cbatch+num1);//缸号
+					mapItem4.put("CBATCH",cbatch+num1);//缸号
+				}
+				num1++;
 				Map<String,Object> orderDataItem=null;// inum
 				if(!mapt.get("account").equals("903")){ //采购订单子表数据  顺序---2
 					System.out.println("mapt.get(\"orderNumber\")\n"+mapt.get("orderNumber"));
@@ -1112,6 +1123,9 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 						recording=result(main,resturn5,"采购发票单",((Map) mapList.get(0)).get("CACCID").toString(),"3");//采购发票单
 						recording(main,recording);
 						this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn5.getJSONObject(0).get("U8ReceiptNo").toString()),"109");
+						if(((Map) mapList.get(0)).get("CACCID").toString().equals("901")){
+							return account+"账套推送成功!";
+						}
 					case "3":
 						String consignmentName=maps.get(account).get("code");//获取销售发货单
 						List<Map<String,Object>> consignmentMaps= syPackingListTailoringMapper.getDispatchLists(consignmentName);
@@ -1167,18 +1181,22 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 		recording(main,recording);
 		this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn1.getJSONObject(0).get("U8ReceiptNo").toString()),"107");
 
+		JSONArray resturn5 = InterfaceConnUtils.doPost(mapList5,"purinvoice_import");//采购发票单
+		recording=result(main,resturn5,"采购发票单",((Map) mapList.get(0)).get("CACCID").toString(),"3");//采购发票单
+		recording(main,recording);
+		this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn5.getJSONObject(0).get("U8ReceiptNo").toString()),"109");
+
+		if(((Map) mapList.get(0)).get("CACCID").toString().equals("901")){
+			return mapList.getJSONObject(0).get("CACCID").toString()+"账套推送成功!";
+		}
+
 		JSONArray resturn3 = InterfaceConnUtils.doPost(mapList3,"consignment_import");//销售发货单
 		recording=result(main,resturn3,"销售发货单",((Map) mapList.get(0)).get("CACCID").toString(),"2");//销售发货单
 		recording(main,recording);
 		String u8ReceiptNo103= resturn3.getJSONObject(0).get("U8ReceiptNo").toString();
 		this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(u8ReceiptNo103.substring(u8ReceiptNo103.length()-4 ) ),"108");
 
-		JSONArray resturn5 = InterfaceConnUtils.doPost(mapList5,"purinvoice_import");//采购发票单
-		recording=result(main,resturn5,"采购发票单",((Map) mapList.get(0)).get("CACCID").toString(),"3");//采购发票单
-		recording(main,recording);
-		this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn5.getJSONObject(0).get("U8ReceiptNo").toString()),"109");
-
-		JSONObject jsonObject3=resturn3.getJSONObject(0);//销售发货单
+			JSONObject jsonObject3=resturn3.getJSONObject(0);//销售发货单
 		String consignmentName=jsonObject3.get("U8ReceiptNo").toString();//获取销售发货单
 		List<Map<String,Object>> consignmentMaps= syPackingListTailoringMapper.getDispatchLists(consignmentName);
 		if(consignmentMaps!=null){