|  |  | @ -154,13 +154,21 @@ public class InvPlaceServiceImpl implements InvPlaceService { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 for (Integer i = 0; i < invPlaceOrderDetailEntity.getCount(); i++) { |  |  |  |                 for (Integer i = 0; i < invPlaceOrderDetailEntity.getCount(); i++) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     //拆解库存表
 |  |  |  |                     //拆解库存表
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     InvPreProductDetailEntity invPreInProductDetailEntity=new InvPreProductDetailEntity(); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     QueryWrapper<InvPreProductDetailEntity> ew=new QueryWrapper<>(); |  |  |  |                     QueryWrapper<InvPreProductDetailEntity> ew=new QueryWrapper<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     if(bindInvSpaceRequest.getType()==3){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         ew.eq("code",invPlaceOrderDetailEntity.getCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         ew.eq("invSpaceCode",bindInvSpaceRequest.getInvSpaceCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         ew.last("limit 1"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         invPreInProductDetailEntity=invPreProductDetailDao.selectOne(ew); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     }else{ | 
			
		
	
		
		
			
				
					
					|  |  |  |                         ew.eq("code",invPlaceOrderDetailEntity.getCode()); |  |  |  |                         ew.eq("code",invPlaceOrderDetailEntity.getCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |                         ew.and(o-> o.isNull("invSpaceCode").or().eq("invSpaceCode","")); |  |  |  |                         ew.and(o-> o.isNull("invSpaceCode").or().eq("invSpaceCode","")); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                         ew.gt("inCount",0); |  |  |  |                         ew.gt("inCount",0); | 
			
		
	
		
		
			
				
					
					|  |  |  |                         ew.last("limit 1"); |  |  |  |                         ew.last("limit 1"); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     InvPreProductDetailEntity invPreInProductDetailEntity=invPreProductDetailDao.selectOne(ew); |  |  |  |                         invPreInProductDetailEntity=invPreProductDetailDao.selectOne(ew); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                     if(invPreInProductDetailEntity.getInCount()>0){ |  |  |  |                     if(invPreInProductDetailEntity.getInCount()>0){ | 
			
		
	
		
		
			
				
					
					|  |  |  |                         String nameCode=invPreInProductDetailEntity.getNameCode(); |  |  |  |                         String nameCode=invPreInProductDetailEntity.getNameCode(); | 
			
		
	
		
		
			
				
					
					|  |  |  |                         int reCount=getActCount(nameCode); |  |  |  |                         int reCount=getActCount(nameCode); | 
			
		
	
	
		
		
			
				
					|  |  | @ -172,7 +180,11 @@ public class InvPlaceServiceImpl implements InvPlaceService { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                         ew.clear(); |  |  |  |                         ew.clear(); | 
			
		
	
		
		
			
				
					
					|  |  |  |                         ew.eq("code",invPlaceOrderDetailEntity.getCode()); |  |  |  |                         ew.eq("code",invPlaceOrderDetailEntity.getCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         if(bindInvSpaceRequest.getType()==3){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             ew.eq("invSpaceCode",bindInvSpaceRequest.getChangeSpaceCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         }else{ | 
			
		
	
		
		
			
				
					
					|  |  |  |                             ew.eq("invSpaceCode",invPlaceOrderDetailEntity.getInvSpaceCode()); |  |  |  |                             ew.eq("invSpaceCode",invPlaceOrderDetailEntity.getInvSpaceCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                         InvPreProductDetailEntity invPreInProductDetailEntity1=invPreProductDetailDao.selectOne(ew); |  |  |  |                         InvPreProductDetailEntity invPreInProductDetailEntity1=invPreProductDetailDao.selectOne(ew); | 
			
		
	
		
		
			
				
					
					|  |  |  |                         if(invPreInProductDetailEntity1!=null){ |  |  |  |                         if(invPreInProductDetailEntity1!=null){ | 
			
		
	
	
		
		
			
				
					|  |  | @ -185,8 +197,12 @@ public class InvPlaceServiceImpl implements InvPlaceService { | 
			
		
	
		
		
			
				
					
					|  |  |  |                             invPreInProductDetailEntity.setInCount(1); |  |  |  |                             invPreInProductDetailEntity.setInCount(1); | 
			
		
	
		
		
			
				
					
					|  |  |  |                             invPreInProductDetailEntity.setCount(1); |  |  |  |                             invPreInProductDetailEntity.setCount(1); | 
			
		
	
		
		
			
				
					
					|  |  |  |                             invPreInProductDetailEntity.setOutCount(0); |  |  |  |                             invPreInProductDetailEntity.setOutCount(0); | 
			
		
	
		
		
			
				
					
					|  |  |  |                             invPreInProductDetailEntity.setInvSpaceCode(invPlaceOrderDetailEntity.getInvSpaceCode()); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                             invPreInProductDetailEntity.setReCount(reCount); |  |  |  |                             invPreInProductDetailEntity.setReCount(reCount); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             if (bindInvSpaceRequest.getType()==3){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                 invPreInProductDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getChangeSpaceCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             }else{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                 invPreInProductDetailEntity.setInvSpaceCode(invPlaceOrderDetailEntity.getInvSpaceCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             } | 
			
		
	
		
		
			
				
					
					|  |  |  |                             invPreProductDetailDao.insert(invPreInProductDetailEntity); |  |  |  |                             invPreProductDetailDao.insert(invPreInProductDetailEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |                         } |  |  |  |                         } | 
			
		
	
		
		
			
				
					
					|  |  |  |                     } |  |  |  |                     } | 
			
		
	
	
		
		
			
				
					|  |  | @ -199,13 +215,20 @@ public class InvPlaceServiceImpl implements InvPlaceService { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 for (Integer i = 0; i < invPlaceOrderDetailEntity.getCount(); i++) { |  |  |  |                 for (Integer i = 0; i < invPlaceOrderDetailEntity.getCount(); i++) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     //拆解库存表
 |  |  |  |                     //拆解库存表
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     InvProductDetailEntity invPreInProductDetailEntity=new InvProductDetailEntity(); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     QueryWrapper<InvProductDetailEntity> ew=new QueryWrapper<>(); |  |  |  |                     QueryWrapper<InvProductDetailEntity> ew=new QueryWrapper<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     if(bindInvSpaceRequest.getType()==3){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         ew.eq("code",invPlaceOrderDetailEntity.getCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         ew.eq("invSpaceCode",bindInvSpaceRequest.getInvSpaceCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         ew.last("limit 1"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         invPreInProductDetailEntity=invProductDetailDao.selectOne(ew); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     }else{ | 
			
		
	
		
		
			
				
					
					|  |  |  |                         ew.eq("code",invPlaceOrderDetailEntity.getCode()); |  |  |  |                         ew.eq("code",invPlaceOrderDetailEntity.getCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |                         ew.and(o-> o.isNull("invSpaceCode").or().eq("invSpaceCode","")); |  |  |  |                         ew.and(o-> o.isNull("invSpaceCode").or().eq("invSpaceCode","")); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                         ew.gt("inCount",0); |  |  |  |                         ew.gt("inCount",0); | 
			
		
	
		
		
			
				
					
					|  |  |  |                         ew.last("limit 1"); |  |  |  |                         ew.last("limit 1"); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     InvProductDetailEntity invPreInProductDetailEntity=invProductDetailDao.selectOne(ew); |  |  |  |                         invPreInProductDetailEntity=invProductDetailDao.selectOne(ew); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     } | 
			
		
	
		
		
			
				
					
					|  |  |  |                     if(invPreInProductDetailEntity.getInCount()>0){ |  |  |  |                     if(invPreInProductDetailEntity.getInCount()>0){ | 
			
		
	
		
		
			
				
					
					|  |  |  |                         String nameCode=invPreInProductDetailEntity.getNameCode(); |  |  |  |                         String nameCode=invPreInProductDetailEntity.getNameCode(); | 
			
		
	
		
		
			
				
					
					|  |  |  |                         int reCount=getActCount(nameCode); |  |  |  |                         int reCount=getActCount(nameCode); | 
			
		
	
	
		
		
			
				
					|  |  | @ -217,7 +240,11 @@ public class InvPlaceServiceImpl implements InvPlaceService { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                         ew.clear(); |  |  |  |                         ew.clear(); | 
			
		
	
		
		
			
				
					
					|  |  |  |                         ew.eq("code",invPlaceOrderDetailEntity.getCode()); |  |  |  |                         ew.eq("code",invPlaceOrderDetailEntity.getCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         if(bindInvSpaceRequest.getType()==3){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             ew.eq("invSpaceCode",bindInvSpaceRequest.getChangeSpaceCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         }else{ | 
			
		
	
		
		
			
				
					
					|  |  |  |                             ew.eq("invSpaceCode",invPlaceOrderDetailEntity.getInvSpaceCode()); |  |  |  |                             ew.eq("invSpaceCode",invPlaceOrderDetailEntity.getInvSpaceCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                         InvProductDetailEntity invPreInProductDetailEntity1=invProductDetailDao.selectOne(ew); |  |  |  |                         InvProductDetailEntity invPreInProductDetailEntity1=invProductDetailDao.selectOne(ew); | 
			
		
	
		
		
			
				
					
					|  |  |  |                         if(invPreInProductDetailEntity1!=null){ |  |  |  |                         if(invPreInProductDetailEntity1!=null){ | 
			
		
	
	
		
		
			
				
					|  |  | @ -231,7 +258,11 @@ public class InvPlaceServiceImpl implements InvPlaceService { | 
			
		
	
		
		
			
				
					
					|  |  |  |                             invPreInProductDetailEntity.setCount(1); |  |  |  |                             invPreInProductDetailEntity.setCount(1); | 
			
		
	
		
		
			
				
					
					|  |  |  |                             invPreInProductDetailEntity.setOutCount(0); |  |  |  |                             invPreInProductDetailEntity.setOutCount(0); | 
			
		
	
		
		
			
				
					
					|  |  |  |                             invPreInProductDetailEntity.setReCount(reCount); |  |  |  |                             invPreInProductDetailEntity.setReCount(reCount); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             if (bindInvSpaceRequest.getType()==3){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                 invPreInProductDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getChangeSpaceCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             }else{ | 
			
		
	
		
		
			
				
					
					|  |  |  |                                 invPreInProductDetailEntity.setInvSpaceCode(invPlaceOrderDetailEntity.getInvSpaceCode()); |  |  |  |                                 invPreInProductDetailEntity.setInvSpaceCode(invPlaceOrderDetailEntity.getInvSpaceCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             } | 
			
		
	
		
		
			
				
					
					|  |  |  |                             invProductDetailDao.insert(invPreInProductDetailEntity); |  |  |  |                             invProductDetailDao.insert(invPreInProductDetailEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |                         } |  |  |  |                         } | 
			
		
	
		
		
			
				
					
					|  |  |  |                     } |  |  |  |                     } | 
			
		
	
	
		
		
			
				
					|  |  | 
 |