|  | @@ -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")) {
 |