|  |  |  | @ -8,6 +8,7 @@ import com.github.pagehelper.PageHelper; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.dao.inout.IoSplitCodeMapper; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.basic.BasicSkPrescribeDiEntity; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.basic.BasicSkPrescribeEntity; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.basic.UdiRelevanceEntity; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.collect.IoCollectOrder; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.collect.IoCollectOrderBiz; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.collect.IoCollectOrderCodeAuto; | 
			
		
	
	
		
			
				
					|  |  |  | @ -17,6 +18,7 @@ import com.glxp.api.entity.inout.IoSplitFifoInv; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.req.inout.IoSplitCodeRequest; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.service.basic.BasicSkPrescribeDiService; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.service.basic.BasicSkPrescribeService; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.service.basic.UdiRelevanceService; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.service.collect.IoCollectOrderBizService; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.service.collect.IoCollectOrderCodeAutoService; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.service.collect.IoCollectOrderService; | 
			
		
	
	
		
			
				
					|  |  |  | @ -29,6 +31,7 @@ import java.util.ArrayList; | 
			
		
	
		
			
				
					|  |  |  |  | import java.util.Collections; | 
			
		
	
		
			
				
					|  |  |  |  | import java.util.Date; | 
			
		
	
		
			
				
					|  |  |  |  | import java.util.List; | 
			
		
	
		
			
				
					|  |  |  |  | import java.util.stream.Collectors; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | @Service | 
			
		
	
		
			
				
					|  |  |  |  | public class IoSplitCodeService extends ServiceImpl<IoSplitCodeMapper, IoSplitCodeEntity> { | 
			
		
	
	
		
			
				
					|  |  |  | @ -262,6 +265,61 @@ public class IoSplitCodeService extends ServiceImpl<IoSplitCodeMapper, IoSplitCo | 
			
		
	
		
			
				
					|  |  |  |  |         collectOrderService.updateById(collectOrder); | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |  |     UdiRelevanceService udiRelevanceService; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     public void finishAutoTagCode(IoCollectOrder collectOrder) { | 
			
		
	
		
			
				
					|  |  |  |  |         List<IoCollectOrderBiz> collectOrderBizs = collectOrderBizService.listByBillNo(collectOrder.getBillNo()); | 
			
		
	
		
			
				
					|  |  |  |  |         List<IoCollectOrderBiz> needAutotagBizs = new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  |  |         for (IoCollectOrderBiz collectOrderBiz : collectOrderBizs) { | 
			
		
	
		
			
				
					|  |  |  |  |             int unTagCount = collectOrderBiz.getCount() - IntUtil.value(collectOrderBiz.getScanActCount()); | 
			
		
	
		
			
				
					|  |  |  |  |             if (unTagCount > 0) { | 
			
		
	
		
			
				
					|  |  |  |  |                 collectOrderBiz.setUnTagCount(unTagCount); | 
			
		
	
		
			
				
					|  |  |  |  |             } else { | 
			
		
	
		
			
				
					|  |  |  |  |                 collectOrderBiz.setTagStatus(3); | 
			
		
	
		
			
				
					|  |  |  |  |                 continue; | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  |             UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(collectOrderBiz.getRelId()); | 
			
		
	
		
			
				
					|  |  |  |  |             int quotient = collectOrderBiz.getUnTagCount() / IntUtil.value(udiRelevanceEntity.getUseLeverCount()); | 
			
		
	
		
			
				
					|  |  |  |  |             int remainder = collectOrderBiz.getUnTagCount() % IntUtil.value(udiRelevanceEntity.getUseLeverCount()); | 
			
		
	
		
			
				
					|  |  |  |  |             if (quotient > 0) { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 for(int i = 0;i<quotient;i++){ | 
			
		
	
		
			
				
					|  |  |  |  | //                    splitFifoCodeService.findByCode()
 | 
			
		
	
		
			
				
					|  |  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     /** | 
			
		
	
		
			
				
					|  |  |  |  |      * 单据预赋码 | 
			
		
	
		
			
				
					|  |  |  |  |      * | 
			
		
	
		
			
				
					|  |  |  |  |      * @param collectOrder | 
			
		
	
		
			
				
					|  |  |  |  |      */ | 
			
		
	
		
			
				
					|  |  |  |  |     public void preAutoTagCode(IoCollectOrder collectOrder) { | 
			
		
	
		
			
				
					|  |  |  |  |         List<IoCollectOrderBiz> collectOrderBizs = collectOrderBizService.listByBillNo(collectOrder.getBillNo()); | 
			
		
	
		
			
				
					|  |  |  |  |         for (IoCollectOrderBiz collectOrderBiz : collectOrderBizs) { | 
			
		
	
		
			
				
					|  |  |  |  |             List<IoSplitFifoCodeEntity> splitFifoCodeEntities = | 
			
		
	
		
			
				
					|  |  |  |  |                     splitFifoCodeService.findByRelId(collectOrder.getWorkPlaceCode(), collectOrder.getBusType(), | 
			
		
	
		
			
				
					|  |  |  |  |                             collectOrderBiz.getRelId(), collectOrderBiz.getBatchNo()); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |             int total = splitFifoCodeEntities.stream() | 
			
		
	
		
			
				
					|  |  |  |  |                     .mapToInt(IoSplitFifoCodeEntity::getTotalCount) | 
			
		
	
		
			
				
					|  |  |  |  |                     .sum(); | 
			
		
	
		
			
				
					|  |  |  |  |             //todo 拆零表里取数据
 | 
			
		
	
		
			
				
					|  |  |  |  |             if (total > IntUtil.value(collectOrderBiz.getCount())) { | 
			
		
	
		
			
				
					|  |  |  |  |                 collectOrderBiz.setAutoTagStatus(2); | 
			
		
	
		
			
				
					|  |  |  |  |             } else if (total > 0) { | 
			
		
	
		
			
				
					|  |  |  |  |                 collectOrderBiz.setAutoTagStatus(3); | 
			
		
	
		
			
				
					|  |  |  |  |             } else | 
			
		
	
		
			
				
					|  |  |  |  |                 collectOrderBiz.setAutoTagStatus(1); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     /** | 
			
		
	
		
			
				
					|  |  |  |  |      * 拆零单据撤回,则将拆零表剩余数量加回预出库队列 | 
			
		
	
	
		
			
				
					|  |  |  | 
 |