Browse Source

推送接口修改

huxy 2 years ago
parent
commit
91c4eb69bf

+ 1 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/spapl/service/impl/SyPreAssembledPackingListServiceImpl.java

@@ -105,6 +105,7 @@ public class SyPreAssembledPackingListServiceImpl extends ServiceImpl<SyPreAssem
 				item1.setSalesDepartment(syItem.getSalesDepartment());//获取销售部门
 				item1.setInventoryCode(syItem.getInventoryCode());
 				item1.setInventoryCcode(syItem.getInventoryCcode());
+				item1.setMasterMetering(syItem.getMasterMetering());
 				syPreAssembledPackingListItemMapper.insert(item1);//添加子表数据
 				//原剩余数量-预装箱单装箱数量=新剩余数量
 				syItem.setSurplusQuantity(syItem.getSurplusQuantity().subtract(item1.getTotal()));

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

@@ -751,50 +751,50 @@ public class SyPackingListFabricController {
 				 result.setMessage("请至少选中一条数据");
 				 return result;
 			 }
-			 List<SyPackingListFabric> mains=new ArrayList<>();
 			 Map<String,Object> map=new HashMap<>();
-			 for (int i=0;i<ids.length;i++){
-				 SyPackingListFabric main=syPackingListFabricService.getById(ids[i]);
-				 QueryWrapper queryWrapper=new QueryWrapper();
-				 queryWrapper.eq("sy_packing_list_fabric_id",main.getId());
-				 queryWrapper.eq("del_flag","0");
-				 List<SyPackingListFabricItem> syPackingListTailoringItems=syPackingListFabricItemService.list(queryWrapper);
-				 if(syPackingListTailoringItems!=null){
-					 main.setSyPackingListFabricItem(syPackingListTailoringItems);
-					 mains=new ArrayList<>();//只存放一条数据
-					 mains.add(main);
-					 map.put("account",main.getSyPackingListFabricItem().get(0).getOmpoAccount());//委外采购账套号
-					 map.put("ompoId",main.getSyPackingListFabricItem().get(0).getOmpoId());//采购委外主表id
-					 map.put("mpOrder",main.getSyPackingListFabricItem().get(0).getPurOrSubOrder());//采购委外订单号
-					 //预装箱单导出	面辅料导入
-					 map.put("customerCode","one");//客户编码
-					 map.put("CVENCODE","one");//供应商编码
-					 map.put("orderNumber","one");//销售订单号
-					 map.put("poid","one");//销售订单id
-					 System.out.println("循环前\n"+map);
-					 for (int x=0;x<3;x++){//最多循环3次
+			 SyPackingListFabric main=syPackingListFabricService.getById(ids);
+			 QueryWrapper queryWrapper=new QueryWrapper();
+			 queryWrapper.eq("sy_packing_list_tailoring_id",main.getId());
+			 queryWrapper.eq("del_flag","0");
+			 List<SyPackingListFabricItem> items=syPackingListFabricItemService.list(queryWrapper);
+			 String message="";//获取报错消息
+			 if(items!=null){
+				 main.setSyPackingListFabricItem(items);
+				 map.put("account",items.get(0).getOmpoAccount());//委外采购账套号
+				 map.put("ompoId",items.get(0).getOmpoId());//采购委外主表id
+				 map.put("mpOrder",items.get(0).getPurOrSubOrder());//采购委外订单号
+				 map.put("customerCode","one");//客户编码
+				 map.put("CVENCODE","one");//供应商编码
+				 map.put("orderNumber","one");//销售订单号
+				 map.put("poid","one");//销售订单id
+				 for (int x=0;x<3;x++){//最多循环3次
+					 try {
 						 if (map.get("account").equals("903")){
-							 System.out.println("第"+(x+1)+"次,访问了903");
-							 syPackingListFabricService.three(mains,map);
+							 syPackingListFabricService.three(main,map);
 						 }else if(map.get("account").equals("902")){
-							 System.out.println("第"+(x+1)+"次,访问了902");
-							 syPackingListFabricService.two(mains,map);
+							 syPackingListFabricService.two(main,map);
 						 }else if(map.get("account").equals("901")){
-							 System.out.println("第"+(x+1)+"次,访问了901");
-							 syPackingListFabricService.one(mains,map);
+							 syPackingListFabricService.one(main,map);
+						 }else{
+							 break;
 						 }
+					 }catch (Exception e){
+						 message+=e.getMessage();
 					 }
-					 System.out.println("循环后\n"+map);
 				 }
+			 }
+			 if(message!=null&&message.length()>0){
+				 main.setPushState("2");//推送失败!
+				 result.setSuccess(false);
+				 result.setMessage(message);
+			 }else{
 				 main.setPushState("1");//推送成功!
-				 syPackingListFabricService.updateById(main);//修改成衣
+				 result.setSuccess(true);
+				 result.setMessage("u8已成功生成单据");
 			 }
-			 result.setSuccess(true);
-			 result.setMessage("u8已成功生成单据");
-		 }catch (Exception e){
-			 SyPackingListFabric main=syPackingListFabricService.getById(ids[0]);
-			 main.setPushState("2");//推送失败!
+			 result.setResult(main);
 			 syPackingListFabricService.updateById(main);//修改成衣
+		 }catch (Exception e){
 			 e.printStackTrace();
 			 result.setSuccess(false);
 			 result.error500("操作失败:"+e.getMessage());

+ 5 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/entity/SyPackingListFabric.java

@@ -163,6 +163,11 @@ public class SyPackingListFabric implements Serializable {
 	@ApiModelProperty(value = "推送状态")
 	private String pushState;
 
+	/*recording*/
+	@ApiModelProperty(value = "u8推送记录")
+	private String recording;
+
+
 	public SyPackingListFabric(){
 
 	}

+ 3 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/service/ISyPackingListFabricService.java

@@ -77,9 +77,9 @@ public interface ISyPackingListFabricService extends IService<SyPackingListFabri
 
 	String excelTest(Map<String, SyPackingListFabric> maps);
 
-    void one(List<SyPackingListFabric> mains, Map<String, Object> map);
+    void one(SyPackingListFabric main, Map<String, Object> map);
 
-	void two(List<SyPackingListFabric> mains, Map<String, Object> map);
+	void two(SyPackingListFabric main, Map<String, Object> map);
 
-	void three(List<SyPackingListFabric> mains, Map<String, Object> map);
+	void three(SyPackingListFabric main, Map<String, Object> map);
 }

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

@@ -703,27 +703,27 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 
 	@Override
 	@DS("multi-one")
-	public void one(List<SyPackingListFabric> mains, Map<String, Object> map) {
-		saveBatch(mains,map);
+	public void one(SyPackingListFabric main, Map<String, Object> map) {
+		saveBatch(main,map);
 	}
 
 	@Override
 	@DS("multi-two")
-	public void two(List<SyPackingListFabric> mains, Map<String, Object> map) {
-		saveBatch(mains,map);
+	public void two(SyPackingListFabric main, Map<String, Object> map) {
+		saveBatch(main,map);
 	}
 
 	@Override
 	@DS("multi-three")
-	public void three(List<SyPackingListFabric> mains, Map<String, Object> map) {
-		saveBatch(mains,map);
+	public void three(SyPackingListFabric main, Map<String, Object> map) {
+		saveBatch(main,map);
 	}
 
 
 
-	Map<String,Object> saveBatch(List<SyPackingListFabric> mains,Map<String,Object> mapt){
+	Map<String,Object> saveBatch(SyPackingListFabric main,Map<String,Object> mapt){
 		mapt.put("customerCode","xxx");//进入方法时设置客户编码为空
-		if(mains==null||mains.size()==0){
+		if(main==null){
 			return new HashMap();//为空就传回空对象
 		}
 		JSONArray mapList=new JSONArray();
@@ -737,7 +737,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 
 		JSONArray mapLists=new JSONArray();
 		//账套号
-		for (SyPackingListFabric main : mains){
+		if (main!=null){
 			Map<String,String> mapSort=new HashMap<>();
 
 			String createBy="进出口平台管理员";
@@ -972,9 +972,9 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 			map6.put("DETAILList",mapItems6);//明细集合
 			mapList6.add(map6);
 
-			if(mapt.get("customerCode").equals("0001")&&!mapt.get("account").equals("901")){
+			if(mapt.get("customerCode").equals("T020001")&&!mapt.get("account").equals("901")){
 				mapt.put("account","901");//账套号
-			}else if(mapt.get("customerCode").equals("T020001")&&!mapt.get("account").equals("902")){
+			}else if(mapt.get("customerCode").equals("0001")&&!mapt.get("account").equals("902")){
 				mapt.put("account","902");//账套号
 			}else{
 				mapt.put("account","904");//账套号
@@ -984,25 +984,101 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 		text(mapList,"采购入库单");
 		text(mapList3,"销售发货单");
 		text(mapList5,"采购发票单");
-		JSONArray resturn1 = InterfaceConnUtils.doPost(mapList,"purchasein_import");//采购入库单		主表添加了一个字段,子表可能要添加一个字段
-		//JSONArray resturn2 = InterfaceConnUtils.doPost(mapList,"materialout_import");//材料出库单
-		JSONArray resturn3 = InterfaceConnUtils.doPost(mapList3,"consignment_import");//销售发货单
-		JSONArray resturn5 = InterfaceConnUtils.doPost(mapList5,"purinvoice_import");//采购发票单
 
-		result(resturn1,"采购入库单",((Map) mapList.get(0)).get("CACCID").toString(),mains.get(0).getId());//采购入库单
+
+		String recording=null;
+		if(main.getRecording()!=null){
+			String[] recordings=main.getRecording().split(",");
+			Map<String,Map<String,String>> maps=new HashMap<>();
+			for (int i=0;i<recordings.length;i++){
+				Map<String,String> map=new HashMap<>();
+				map.put("index",recordings[i].split("-")[1]);
+				map.put("code",recordings[i].split("-")[2]);
+				maps.put(recordings[i].split("-")[0],map);
+			}
+			String account=mapList.getJSONObject(0).get("CACCID").toString();//获取账套号
+			if (maps.containsKey(account)){
+				switch (maps.get(account).get("index")){
+					case "1":	//代表已完成第一道
+						JSONArray resturn3 = InterfaceConnUtils.doPost(mapList3,"consignment_import");//销售发货单
+						recording=result(main,resturn3,"销售发货单",((Map) mapList.get(0)).get("CACCID").toString(),"2");//销售发货单
+						maps.get(account).put("code",resturn3.getJSONObject(0).get("U8ReceiptNo").toString());
+						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");
+					case "2":
+						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");
+					case "3":
+						String consignmentName=maps.get(account).get("code");//获取销售发货单
+						List<Map<String,Object>> consignmentMaps= syPackingListTailoringMapper.getDispatchLists(consignmentName);
+						if(consignmentMaps!=null){
+							for (Map map : consignmentMaps){
+								JSONObject jsonObject=mapList4.getJSONObject(0);//循环迭代
+								List<Map<String,Object>> mapItems4= (List<Map<String,Object>>) jsonObject.get("DETAILList");
+								for (Map itemMap4 :  mapItems4){
+									if(itemMap4.get("size").equals(map.get("cFree2"))&&(Double.parseDouble( itemMap4.get("IQUANTITY").toString())
+											==Double.parseDouble( map.get("iQuantity").toString()))&&!itemMap4.containsKey("AUTOID_SO")){//根据尺码判断
+										getcFree((JSONObject) itemMap4,map);
+										itemMap4.put("AUTOID_SO",map.get("iDLsID"));
+									}
+								}
+								System.out.println("mapItems4\t"+mapItems4);
+							}
+						}
+						text(mapList4,"销售出库单");
+						JSONArray resturn4 = InterfaceConnUtils.doPost(mapList4,"saleout_import");//
+						recording=result(main,resturn4,"销售出库单",((Map) mapList.get(0)).get("CACCID").toString(),"4");//销售出库单
+						maps.get(account).put("code",resturn4.getJSONObject(0).get("U8ReceiptNo").toString());
+						recording(main,recording);
+					case "4":
+						String saleoutName=maps.get(account).get("code");//销售出库单
+
+						this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(saleoutName),"131");
+
+						List<Map<String,Object>> saleoutMaps= syPackingListTailoringMapper.getRdrecord32(saleoutName);
+						if(saleoutMaps!=null){
+							for (Map map : saleoutMaps){
+								JSONObject jsonObject=mapList6.getJSONObject(0);//循环迭代
+								List<Map<String,Object>> mapItems6= (List<Map<String,Object>>) jsonObject.get("DETAILList");
+								for (Map itemMap6 :  mapItems6){
+									itemMap6.put("DISAUTOIDCOL","AUTOID");
+									if(itemMap6.get("size").equals(map.get("cFree2"))&&(Double.parseDouble( itemMap6.get("IQUANTITY").toString())
+											==Double.parseDouble( map.get("iQuantity").toString()))&&!itemMap6.containsKey("AUTOID_DIS")){
+										itemMap6.put("AUTOID_DIS",map.get("autoid"));
+									}
+								}
+							}
+						}
+						text(mapList6,"销售发票单");
+						JSONArray resturn6 = InterfaceConnUtils.doPost(mapList6,"saleinvoice_import");//销售发票单
+						recording=result(main,resturn6,"销售发票单",((Map) mapList.get(0)).get("CACCID").toString(),"5");//销售发票单
+						recording(main,recording);
+				}
+				return mapt;
+			}
+		}
+
+		JSONArray resturn1 = InterfaceConnUtils.doPost(mapList,"purchasein_import");//采购入库单
+		recording=result(main,resturn1,"采购入库单",((Map) mapList.get(0)).get("CACCID").toString(),"1");//采购入库单
+		recording(main,recording);
 		this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn1.getJSONObject(0).get("U8ReceiptNo").toString()),"107");
 
-		result(resturn3,"销售发货单",((Map) mapList.get(0)).get("CACCID").toString(),mains.get(0).getId());//销售发货单
+		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");
 
-
-		result(resturn5,"采购发票单",((Map) mapList.get(0)).get("CACCID").toString(),mains.get(0).getId());//采购发票单
+		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);//销售发货单
 		String consignmentName=jsonObject3.get("U8ReceiptNo").toString();//获取销售发货单
-		//String consignmentName= "20220401T00245841";// jsonObject3.get("U8ReceiptNo").toString();//获取销售发货单
 		List<Map<String,Object>> consignmentMaps= syPackingListTailoringMapper.getDispatchLists(consignmentName);
 		if(consignmentMaps!=null){
 			for (Map map : consignmentMaps){
@@ -1021,17 +1097,15 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 
 		text(mapList4,"销售出库单");
 		JSONArray resturn4 = InterfaceConnUtils.doPost(mapList4,"saleout_import");//
-		result(resturn4,"销售出库单",((Map) mapList.get(0)).get("CACCID").toString(),mains.get(0).getId());//销售出库单
-
+		recording=result(main,resturn4,"销售出库单",((Map) mapList.get(0)).get("CACCID").toString(),"4");//销售出库单
+		recording(main,recording);
 
 		JSONObject jsonObject4=resturn4.getJSONObject(0);//销售出库单
 		String saleoutName=jsonObject4.get("U8ReceiptNo").toString();//销售出库单
 
 		this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(saleoutName),"131");
 
-		//String saleoutName= "0000005974";// jsonObject4.get("U8ReceiptNo").toString();//获取销售发货单
 		List<Map<String,Object>> saleoutMaps= syPackingListTailoringMapper.getRdrecord32(saleoutName);
-		//System.out.println("saleoutMaps\t"+saleoutMaps);
 		if(saleoutMaps!=null){
 			for (Map map : saleoutMaps){
 				JSONObject jsonObject=mapList6.getJSONObject(0);//循环迭代
@@ -1047,9 +1121,12 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 		}
 		text(mapList6,"销售发票单");
 		JSONArray resturn6 = InterfaceConnUtils.doPost(mapList6,"saleinvoice_import");//销售发票单
-		result(resturn6,"销售发票单",((Map) mapList.get(0)).get("CACCID").toString(),mains.get(0).getId());//销售发票单
+		recording=result(main,resturn6,"销售发票单",((Map) mapList.get(0)).get("CACCID").toString(),"5");//销售发票单
+		recording(main,recording);
 		//this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn6.getJSONObject(0).get("U8ReceiptNo").toString()),"120");
 		return mapt;
+
+
 	}
 
 	public void text(JSONArray mapList,String tableName){
@@ -1065,11 +1142,25 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 		}
 	}
 
-	public void result(JSONArray jsonArray,String tableName ,String account,String id){
+	public void recording(SyPackingListFabric syPackingListTailoring,String recording){
+		if(syPackingListTailoring.getRecording()!=null){
+			if(syPackingListTailoring.getRecording().substring(0,3).equals(recording.substring(0,3))){//如果是同一个账套号就被覆盖掉
+				syPackingListTailoring.setRecording(recording);
+			}else{
+				syPackingListTailoring.setRecording(syPackingListTailoring.getRecording()+","+recording);
+			}
+		}else{
+			syPackingListTailoring.setRecording(recording);
+		}
+	}
+
+
+	public String result(SyPackingListFabric main,JSONArray jsonArray,String tableName ,String account,String index){
 		JSONObject jsonObject=jsonArray.getJSONObject(0);
 		if(jsonObject.get("Result").equals("F")){//获取发货单是否成功添加
-			throw new JeecgBootException("账套"+account+"接口"+tableName+",原因\t"+ jsonObject.get("Description"));
+			throw new JeecgBootException("账套"+account+"接口"+tableName+",原因"+ jsonObject.get("Description"));
 		}
+		return account+"-"+index+"-"+jsonObject.get("ReceiptNo");//账套号-序号-生成的单号
 	}
 
 	public void getcFree(JSONObject itemMap,Map<String,Object> mapPOPodetails){
@@ -1173,7 +1264,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 					"and cInvCCode not like '03%'\n" +
 					"and cInvCCode not like '04%'\n" +
 					"and cInvCCode not like '19%'\n" +
-					"and cCusCode='0001' and\n" +
+					"and cCusCode='T020001' and\n" +
 						" f.AutoID in (" + maps.get(account).toString().substring(1, maps.get(account).toString().length() - 1) + ") ";
 				List<Map<String, Object>> list = new ArrayList<>();
 				if (account.equals("903")) {

+ 5 - 5
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/controller/SyPackingListTailoringController.java

@@ -1238,11 +1238,11 @@ public class SyPackingListTailoringController {
 				for (int x=0;x<3;x++){//最多循环3次
 					try {
 						if (map.get("account").equals("903")){
-							syPackingListTailoringService.three(main,map);
+							message+=syPackingListTailoringService.three(main,map);
 						}else if(map.get("account").equals("902")){
-							syPackingListTailoringService.two(main,map);
+							message+=syPackingListTailoringService.two(main,map);
 						}else if(map.get("account").equals("901")){
-							syPackingListTailoringService.one(main,map);
+							message+=syPackingListTailoringService.one(main,map);
 						}else{
 							break;
 						}
@@ -1251,14 +1251,14 @@ public class SyPackingListTailoringController {
 					}
 				}
 			}
-			if(message!=null&&message.length()>0){
+			if(message!=null&&message.length()>0&&message.indexOf("接口")>-1){
 				main.setPushState("2");//推送失败!
 				result.setSuccess(false);
 				result.setMessage(message);
 			}else{
 				main.setPushState("1");//推送成功!
 				result.setSuccess(true);
-				result.setMessage("u8已成功生成单据");
+				result.setMessage(message);
 			}
 			result.setResult(main);
 			syPackingListTailoringService.updateById(main);//修改成衣

+ 3 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/service/ISyPackingListTailoringService.java

@@ -86,11 +86,11 @@ public interface ISyPackingListTailoringService extends IService<SyPackingListTa
 
     String test(List<SyPackingListTailoring> mains);
 
-	Map<String,Object> one(SyPackingListTailoring main, Map<String, Object> map);
+	String one(SyPackingListTailoring main, Map<String, Object> map);
 
-	Map<String,Object> two(SyPackingListTailoring main, Map<String, Object> map);
+	String two(SyPackingListTailoring main, Map<String, Object> map);
 
-	Map<String,Object> three(SyPackingListTailoring main, Map<String, Object> map);
+	String three(SyPackingListTailoring main, Map<String, Object> map);
 
     String getOrderDataId(String id);
 }

+ 15 - 11
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/service/impl/SyPackingListTailoringServiceImpl.java

@@ -173,6 +173,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 					item1.setOrderNumber(syPreItem.getOrderNumber());//销售订单号
 					item1.setSpurOrSubOrder(syPreItem.getSpurOrSubOrder());//获取采购委外订单号
 					item1.setOmpoId(syPreItem.getOmpoId());//获取采购委外主表id
+					item1.setMasterMetering(item1.getMasterMetering());
 					item1.setOmpoIdItem(syPreItem.getOmpoIdItem());//获取采购委外子表id
 					item1.setOmpoAccount(syPreItem.getOmpoAccount());//委外采购账套号
 					item1.setSupplier(syPreItem.getSupplier());
@@ -228,12 +229,15 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 				throw new JeecgBootException("数据库找不到对应的预装箱单子表id"+s1.getSyPreAssembledPackingListItemId());
 			}
 			s1.setId(null);
+			s1.setDelFlag("0");
+			System.out.println("actualPackingQty数量\t"+s1.getActualPackingQty());
+			s1.setTotal(s1.getActualPackingQty().multiply(s1.getBoxNumber()));//各尺码数量
 			s1.setSyPackingListTailoringId(syPackingListTailoring.getId());//主表id
 			s1.setSyPreAssembledPackingListId(syPackingListTailoring.getSyPreAssembledPackingListId());//预装箱单主表id
 
 			if(!mapId.containsKey(s1.getGroupId())){//如果这个发运明细id没有分组id,就生成一个新的分组id
 				mapId.put(s1.getGroupId(), org.jeecg.modules.system.util.oConvertUtils.getId());//分组id
-				syPackingListTailoring.setTotalBoxes(syPackingListTailoring.getTotalBoxes().add(s1.getBoxNumber()));//总箱数
+				syPackingListTailoring.setTotalBoxes(s1.getBoxNumber());//总箱数
 			}
 			s1.setGroupId(mapId.get(s1.getGroupId()));//获取id
 			s1.setUnitPrice(syPreAssembledPackingListItem.getUnitPrice());//单价
@@ -666,17 +670,17 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 	private PurchaseWarehousingMapper purchaseWarehousingMapper;//采购入库表
 
 	@DS("multi-one")
-	public Map<String,Object> one(SyPackingListTailoring main,Map<String,Object> map){
+	public String one(SyPackingListTailoring main,Map<String,Object> map){
 		return saveBatch(main,map);
 	}
 
 	@DS("multi-two")
-	public Map<String,Object> two(SyPackingListTailoring main,Map<String,Object> map){
+	public String two(SyPackingListTailoring main,Map<String,Object> map){
 		return saveBatch(main,map);
 	}
 
 	@DS("multi-three")
-	public Map<String,Object> three(SyPackingListTailoring main,Map<String,Object> map){
+	public String three(SyPackingListTailoring main,Map<String,Object> map){
 		return saveBatch(main,map);
 	}
 
@@ -684,10 +688,10 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 		return syPackingListTailoringMapper.getOrderDataId(id);
 	}
 
-	Map<String,Object> saveBatch(SyPackingListTailoring main,Map<String,Object> mapt){
+	String saveBatch(SyPackingListTailoring main,Map<String,Object> mapt){
 		mapt.put("customerCode","xxx");//进入方法时设置客户编码为空
 		if(main==null){
-			return new HashMap();//为空就传回空对象
+			return "";//为空就传回空对象
 		}
 		JSONArray mapList=new JSONArray();
 		JSONArray mapList3=new JSONArray();
@@ -904,9 +908,9 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 			map6.put("DETAILList",mapItems6);//明细集合
 			mapList6.add(map6);
 
-			if(mapt.get("customerCode").equals("0001")&&!mapt.get("account").equals("901")){
+			if(mapt.get("customerCode").equals("T020001")&&!mapt.get("account").equals("901")){
 				mapt.put("account","901");//账套号
-			}else if(mapt.get("customerCode").equals("T020001")&&!mapt.get("account").equals("902")){
+			}else if(mapt.get("customerCode").equals("0001")&&!mapt.get("account").equals("902")){
 				mapt.put("account","902");//账套号
 			}else{
 				mapt.put("account","904");//账套号
@@ -988,7 +992,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 						recording=result(main,resturn6,"销售发票单",((Map) mapList.get(0)).get("CACCID").toString(),"5");//销售发票单
 						recording(main,recording);
 				}
-				return mapt;
+				return account+"账套推送成功!";
 			}
 		}
 
@@ -1055,7 +1059,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 		recording=result(main,resturn6,"销售发票单",((Map) mapList.get(0)).get("CACCID").toString(),"5");//销售发票单
 		recording(main,recording);
 		//this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn6.getJSONObject(0).get("U8ReceiptNo").toString()),"120");
-		return mapt;
+		return mapList.getJSONObject(0).get("CACCID").toString()+"账套推送成功!";
 	}
 
 	public void recording(SyPackingListTailoring syPackingListTailoring,String recording){
@@ -1086,7 +1090,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 	public String result(SyPackingListTailoring main,JSONArray jsonArray,String tableName ,String account,String index){
 		JSONObject jsonObject=jsonArray.getJSONObject(0);
 		if(jsonObject.get("Result").equals("F")){//获取发货单是否成功添加
-			throw new JeecgBootException("账套"+account+"接口"+tableName+",原因"+ jsonObject.get("Description"));
+			throw new JeecgBootException(account+"账套"+tableName+"接口"+","+ jsonObject.get("Description")+"!");
 		}
 		return account+"-"+index+"-"+jsonObject.get("ReceiptNo");//账套号-序号-生成的单号
 	}