|  | @@ -635,6 +635,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 | 
	
		
			
				|  |  |  					QueryWrapper queryWrapper=new QueryWrapper();
 | 
	
		
			
				|  |  |  					queryWrapper.in("id", Arrays.asList(ids.split(",")));
 | 
	
		
			
				|  |  |  					queryWrapper.select("sum(total) as total");
 | 
	
		
			
				|  |  | +					queryWrapper.eq("del_Flag","0");//未删除
 | 
	
		
			
				|  |  |  					SyPreAssembledPackingListItem syshippings=syPreAssembledPackingListItemMapper.selectOne(queryWrapper);
 | 
	
		
			
				|  |  |  					if(syshippings==null){
 | 
	
		
			
				|  |  |  						throw new JeecgBootException("该单据在上游未找到");
 | 
	
	
		
			
				|  | @@ -644,6 +645,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 | 
	
		
			
				|  |  |  					queryWrapper=new QueryWrapper();
 | 
	
		
			
				|  |  |  					queryWrapper.in("sy_Pre_Assembled_Packing_List_Item_Id", Arrays.asList(ids.split(",")));
 | 
	
		
			
				|  |  |  					queryWrapper.select("sum(total) as total");
 | 
	
		
			
				|  |  | +					queryWrapper.eq("del_Flag","0");//未删除
 | 
	
		
			
				|  |  |  					SyPackingListTailoringItem syPackingItem=syPackingListTailoringItemMapper.selectOne(queryWrapper);
 | 
	
		
			
				|  |  |  					if(syPackingItem!=null){
 | 
	
		
			
				|  |  |  					//	total2=syPackingItem.getTotal();
 | 
	
	
		
			
				|  | @@ -663,27 +665,27 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 | 
	
		
			
				|  |  |  	private PurchaseWarehousingMapper purchaseWarehousingMapper;//采购入库表
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	@DS("multi-one")
 | 
	
		
			
				|  |  | -	public Map<String,Object> one(List<SyPackingListTailoring> mains,Map<String,Object> map){
 | 
	
		
			
				|  |  | -		return saveBatch(mains,map);
 | 
	
		
			
				|  |  | +	public Map<String,Object> one(SyPackingListTailoring main,Map<String,Object> map){
 | 
	
		
			
				|  |  | +		return saveBatch(main,map);
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	@DS("multi-two")
 | 
	
		
			
				|  |  | -	public Map<String,Object> two(List<SyPackingListTailoring> mains,Map<String,Object> map){
 | 
	
		
			
				|  |  | -		return saveBatch(mains,map);
 | 
	
		
			
				|  |  | +	public Map<String,Object> two(SyPackingListTailoring main,Map<String,Object> map){
 | 
	
		
			
				|  |  | +		return saveBatch(main,map);
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	@DS("multi-three")
 | 
	
		
			
				|  |  | -	public Map<String,Object> three(List<SyPackingListTailoring> mains,Map<String,Object> map){
 | 
	
		
			
				|  |  | -		return saveBatch(mains,map);
 | 
	
		
			
				|  |  | +	public Map<String,Object> three(SyPackingListTailoring main,Map<String,Object> map){
 | 
	
		
			
				|  |  | +		return saveBatch(main,map);
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	public String getOrderDataId(String id){
 | 
	
		
			
				|  |  |  		return syPackingListTailoringMapper.getOrderDataId(id);
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -	Map<String,Object> saveBatch(List<SyPackingListTailoring> mains,Map<String,Object> mapt){
 | 
	
		
			
				|  |  | +	Map<String,Object> saveBatch(SyPackingListTailoring 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();
 | 
	
	
		
			
				|  | @@ -697,7 +699,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		JSONArray mapLists=new JSONArray();
 | 
	
		
			
				|  |  |  		//账套号
 | 
	
		
			
				|  |  | -		for (SyPackingListTailoring main : mains){
 | 
	
		
			
				|  |  | +		if (main!=null){
 | 
	
		
			
				|  |  |  			Map<String,String> mapSort=new HashMap<>();
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  			String createBy="进出口平台管理员";
 | 
	
	
		
			
				|  | @@ -851,7 +853,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 | 
	
		
			
				|  |  |  				mapt.put("poid","one");//重置销售订单id
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  				//if(item.getSyOrderDataItemId()!=null){//销售发货单 ---查询销售订单子表数据  顺序---5
 | 
	
		
			
				|  |  | -				if(orderDataItem!=null&&orderDataItem.containsKey("iSOsID")){
 | 
	
		
			
				|  |  | +				if(orderDataItem!=null&&orderDataItem.containsKey("iSOsID")&&!orderDataItem.get("iSOsID").equals("")){
 | 
	
		
			
				|  |  |  					Map<String,Object> orderDataItem2=syPackingListTailoringMapper.getSoMainItem(orderDataItem.get("iSOsID").toString());
 | 
	
		
			
				|  |  |  					mapSort.put(item.getId(),orderDataItem2.get("irowno").toString());
 | 
	
		
			
				|  |  |  					mapItem3.put("ITAXUNITPRICE",orderDataItem2.get("iTaxUnitPrice"));//原币含税单价(如果传空,取来源单据)(以含税单价为准自动计算相关价格及金额)
 | 
	
	
		
			
				|  | @@ -941,6 +943,23 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 | 
	
		
			
				|  |  |  			}
 | 
	
		
			
				|  |  |  			mapt.put("itemSort",mapSort);
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/*
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		if(true){
 | 
	
		
			
				|  |  | +			main.setRecording("903-3-1000130,902-2-1000244");
 | 
	
		
			
				|  |  | +			return null;
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		if(main.getRecording()!=null&&!main.getRecording().equals("")){
 | 
	
		
			
				|  |  | +			//上面已经收集到信息 可以进入到下次循环
 | 
	
		
			
				|  |  | +			//如何获取到发货单和出库单做采购订单是一个问题
 | 
	
		
			
				|  |  | +			//1、直接查询最后一个生成的单子	可能会搞混
 | 
	
		
			
				|  |  | +			//2、保存在recording里	可以但需要分离
 | 
	
		
			
				|  |  | +			//903-3-CVOUCHCODE,
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +*/
 | 
	
		
			
				|  |  |  		text(mapList,"采购入库单");
 | 
	
		
			
				|  |  |  		text(mapList3,"销售发货单");
 | 
	
		
			
				|  |  |  		text(mapList5,"采购发票单");
 | 
	
	
		
			
				|  | @@ -949,15 +968,15 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 | 
	
		
			
				|  |  |  		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());//采购入库单
 | 
	
		
			
				|  |  | +		result(resturn1,"采购入库单",((Map) mapList.get(0)).get("CACCID").toString(),main.getId());//采购入库单
 | 
	
		
			
				|  |  |  		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());//销售发货单
 | 
	
		
			
				|  |  | +		result(resturn3,"销售发货单",((Map) mapList.get(0)).get("CACCID").toString(),main.getId());//销售发货单
 | 
	
		
			
				|  |  |  		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());//采购发票单
 | 
	
		
			
				|  |  | +		result(resturn5,"采购发票单",((Map) mapList.get(0)).get("CACCID").toString(),main.getId());//采购发票单
 | 
	
		
			
				|  |  |  		this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn5.getJSONObject(0).get("U8ReceiptNo").toString()),"109");
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		JSONObject jsonObject3=resturn3.getJSONObject(0);//销售发货单
 | 
	
	
		
			
				|  | @@ -981,7 +1000,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		text(mapList4,"销售出库单");
 | 
	
		
			
				|  |  |  		JSONArray resturn4 = InterfaceConnUtils.doPost(mapList4,"saleout_import");//
 | 
	
		
			
				|  |  | -		result(resturn4,"销售出库单",((Map) mapList.get(0)).get("CACCID").toString(),mains.get(0).getId());//销售出库单
 | 
	
		
			
				|  |  | +		result(resturn4,"销售出库单",((Map) mapList.get(0)).get("CACCID").toString(),main.getId());//销售出库单
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		JSONObject jsonObject4=resturn4.getJSONObject(0);//销售出库单
 | 
	
	
		
			
				|  | @@ -1007,7 +1026,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  		text(mapList6,"销售发票单");
 | 
	
		
			
				|  |  |  		JSONArray resturn6 = InterfaceConnUtils.doPost(mapList6,"saleinvoice_import");//销售发票单
 | 
	
		
			
				|  |  | -		result(resturn6,"销售发票单",((Map) mapList.get(0)).get("CACCID").toString(),mains.get(0).getId());//销售发票单
 | 
	
		
			
				|  |  | +		result(resturn6,"销售发票单",((Map) mapList.get(0)).get("CACCID").toString(),main.getId());//销售发票单
 | 
	
		
			
				|  |  |  		//this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn6.getJSONObject(0).get("U8ReceiptNo").toString()),"120");
 | 
	
		
			
				|  |  |  		return mapt;
 | 
	
		
			
				|  |  |  	}
 | 
	
	
		
			
				|  | @@ -1031,7 +1050,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 | 
	
		
			
				|  |  |  			/*SyPackingListTailoring syPackingListTailoring=syPackingListTailoringMapper.selectById(id);
 | 
	
		
			
				|  |  |  			syPackingListTailoring.setRecording(account+"-"+tableName);
 | 
	
		
			
				|  |  |  			syPackingListTailoringMapper.updateById(syPackingListTailoring);*/
 | 
	
		
			
				|  |  | -			throw new JeecgBootException("报错账套"+account+"接口"+tableName+",原因\t"+ jsonObject.get("Description"));
 | 
	
		
			
				|  |  | +			throw new JeecgBootException("账套"+account+"接口"+tableName+",原因\t"+ jsonObject.get("Description"));
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  
 |