|  |  | @ -1,30 +1,47 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  | package com.glxp.api.service.inout; |  |  |  | package com.glxp.api.service.inout; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import cn.hutool.core.bean.BeanUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import cn.hutool.core.collection.CollUtil; |  |  |  | import cn.hutool.core.collection.CollUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import cn.hutool.core.util.StrUtil; |  |  |  | import cn.hutool.core.util.StrUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.common.enums.ResultEnum; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.common.res.BaseResponse; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.common.util.ResultVOUtils; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.constant.Constant; |  |  |  | import com.glxp.api.constant.Constant; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.constant.ConstantStatus; |  |  |  | import com.glxp.api.constant.ConstantStatus; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.entity.basic.BasicBussinessTypeEntity; |  |  |  | import com.glxp.api.entity.basic.BasicBussinessTypeEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.entity.basic.BasicCorpEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.entity.basic.UdiEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.entity.basic.UdiRlSupEntity; |  |  |  | import com.glxp.api.entity.basic.UdiRlSupEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.entity.inout.IoCodeEntity; |  |  |  | import com.glxp.api.entity.inout.IoCodeEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.entity.inout.IoCodeTempEntity; |  |  |  | import com.glxp.api.entity.inout.IoCodeTempEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.entity.inout.IoOrderDetailCodeEntity; |  |  |  | import com.glxp.api.entity.inout.IoOrderDetailCodeEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.entity.inout.IoOrderEntity; |  |  |  | import com.glxp.api.entity.inout.IoOrderEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.entity.inv.InvProductDetailEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.entity.system.SystemParamConfigEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.req.basic.CompanyProductRelevanceRequest; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.req.basic.FilterCompanyProductRelevanceRequest; |  |  |  | import com.glxp.api.req.basic.FilterCompanyProductRelevanceRequest; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.req.inout.FilterOrderRequest; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.req.inout.PdaCodeEntity; |  |  |  | import com.glxp.api.req.inout.PdaCodeEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.req.inout.PostOrderRequest; |  |  |  | import com.glxp.api.req.inout.PostOrderRequest; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.res.basic.UdiRelevanceResponse; |  |  |  | import com.glxp.api.res.basic.UdiRelevanceResponse; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.service.basic.BasicCorpService; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.service.basic.UdiRelevanceService; |  |  |  | import com.glxp.api.service.basic.UdiRelevanceService; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.service.basic.UdiRlSupService; |  |  |  | import com.glxp.api.service.basic.UdiRlSupService; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.service.basic.IBasicBussinessTypeService; |  |  |  | import com.glxp.api.service.basic.IBasicBussinessTypeService; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.service.inv.InvProductDetailService; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.service.inv.InvProductService; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.service.system.SystemParamConfigService; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.util.CustomUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.util.DateUtil; |  |  |  | import com.glxp.api.util.DateUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.util.GennerOrderUtils; |  |  |  | import com.glxp.api.util.GennerOrderUtils; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.util.OrderNoTypeBean; |  |  |  | import com.glxp.api.util.OrderNoTypeBean; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.util.udi.FilterUdiUtils; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.springframework.beans.BeanUtils; |  |  |  | import org.springframework.beans.BeanUtils; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.springframework.stereotype.Service; |  |  |  | import org.springframework.stereotype.Service; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | import javax.annotation.Resource; |  |  |  | import javax.annotation.Resource; | 
			
		
	
		
		
			
				
					
					|  |  |  | import java.util.ArrayList; |  |  |  | import java.util.ArrayList; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import java.util.Date; | 
			
		
	
		
		
			
				
					
					|  |  |  | import java.util.List; |  |  |  | import java.util.List; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | @Service |  |  |  | @Service | 
			
		
	
	
		
		
			
				
					|  |  | @ -39,11 +56,266 @@ public class IoAddInoutService { | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Resource |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |     IoCodeService codeService; |  |  |  |     IoCodeService codeService; | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Resource |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     IoCodeTempService codeTempService; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |     UdiRlSupService udiRlSupService; |  |  |  |     UdiRlSupService udiRlSupService; | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Resource |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |     IoOrderDetailCodeService orderDetailCodeService; |  |  |  |     IoOrderDetailCodeService orderDetailCodeService; | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Resource |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |     UdiRelevanceService udiRelevanceService; |  |  |  |     UdiRelevanceService udiRelevanceService; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     InvProductDetailService invProductDetailService; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     BasicCorpService basicCorpService; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     IoCheckInoutService ioCheckInoutService; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     SystemParamConfigService systemParamConfigService; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     //新增单据处理
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     public void dealProcess(IoOrderEntity orderEntity) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         orderEntity.setRemark("正在处理!"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         orderEntity.setStatus(ConstantStatus.ORDER_STATUS_PROCESSING); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         orderEntity.setUpdateTime(new Date()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         orderService.update(orderEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         List<IoOrderEntity> orderEntities = orderService.isExitRepeat(orderEntity.getCorpOrderId(), orderEntity.getBillNo()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (CollUtil.isNotEmpty(orderEntities)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             orderEntity.setRemark("单据重复上传"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             orderEntity.setUpdateTime(new Date()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             orderService.update(orderEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             return; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(orderEntity.getAction()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (bussinessTypeEntity == null) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             orderEntity.setRemark("单据类型不存在"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             orderEntity.setUpdateTime(new Date()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             orderService.update(orderEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             return; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (StrUtil.isEmpty(orderEntity.getFromCorp()) && StrUtil.isEmpty(orderEntity.getFromInvCode())) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             orderEntity.setRemark("未选择往来单位"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             orderEntity.setUpdateTime(new Date()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             orderService.update(orderEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             return; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } else if (StrUtil.isNotEmpty(orderEntity.getFromCorp())) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (bussinessTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_INPUT && bussinessTypeEntity.isGenUnit()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 BasicCorpEntity basicCorpEntity = basicCorpService.selectByName(orderEntity.getFromCorp()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 if (basicCorpEntity == null) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     basicCorpEntity = new BasicCorpEntity(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     basicCorpEntity.setErpId(CustomUtil.getUnitId()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     basicCorpEntity.setCorpType(ConstantStatus.CORP_SICK); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     basicCorpEntity.setOutType(ConstantStatus.CORP_SICK_SICK); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     basicCorpEntity.setName(orderEntity.getFromCorp()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 orderEntity.setFromCorp(basicCorpEntity.getErpId()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 orderEntity.setUpdateTime(new Date()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 orderService.update(orderEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 basicCorpService.insertBasicUnitMaintain(basicCorpEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (StrUtil.isEmpty(orderEntity.getInvCode())) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             orderEntity.setRemark("未选择当前仓库信息"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             orderEntity.setUpdateTime(new Date()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             orderService.update(orderEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             return; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         List<IoCodeTempEntity> filterList = codeTempService.findByOrderId(orderEntity.getBillNo()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         List<IoCodeTempEntity> insertList = new ArrayList<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         for (int j = 0; j < filterList.size(); j++) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             IoCodeTempEntity warehouseEntity = filterList.get(j); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             String result = checkOrderRepeatCode(warehouseEntity, filterList); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (result == null) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 insertList.add(warehouseEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 orderEntity.setUpdateTime(new Date()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 orderService.update(orderEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 insertList.clear(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 return; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             //三期校验
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             String checkOriginMsg = checkOriginCode(warehouseEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (StrUtil.isNotEmpty(checkOriginMsg)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 orderEntity.setRemark("checkOriginMsg"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 orderEntity.setUpdateTime(new Date()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 orderService.update(orderEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 insertList.clear(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 return; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             //产品是否已维护已关联
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if ((warehouseEntity.getRelId() == null)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 orderEntity.setUpdateTime(new Date()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 orderEntity.setRemark("udi码:" + warehouseEntity.getCode() + "上传时对照数据丢失,请选择对!"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 orderService.update(orderEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 return; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             //产品是否指定供应商
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (StrUtil.isEmpty(warehouseEntity.getSupId())) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 orderEntity.setUpdateTime(new Date()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 orderEntity.setRemark("udi码:" + warehouseEntity.getCode() + "未指定供应商!"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 orderService.update(orderEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 return; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             //校验是否是当前供应商
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (bussinessTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_OUT) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 UdiRlSupEntity udiRlSupEntity = udiRlSupService.findByUdiRlIdUnitFk(warehouseEntity.getRelId() + "", orderEntity.getFromCorp()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 if (udiRlSupEntity == null) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     orderEntity.setUpdateTime(new Date()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     orderEntity.setRemark("udi码:" + warehouseEntity.getCode() + "当前供应商不存在此配送产品"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     orderService.update(orderEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     return; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             //产品是否可以以使用单元入库
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectGroupById(warehouseEntity.getRelId()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (udiRelevanceResponse == null) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 orderEntity.setUpdateTime(new Date()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 orderEntity.setRemark("udi码:" + warehouseEntity.getCode() + "该产品信息未维护"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 orderService.update(orderEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 return; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } else if (!udiRelevanceResponse.getUseDy() && udiRelevanceResponse.getDiType() == ConstantStatus.DITYPE_SYDY) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 orderEntity.setUpdateTime(new Date()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 orderEntity.setRemark("udi码:" + warehouseEntity.getCode() + "该产品不允许以使用单元入库"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 orderService.update(orderEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 return; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (CollUtil.isNotEmpty(insertList)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             //临时表转正式表
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             List<IoCodeEntity> ioCodeEntities = new ArrayList<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             for (IoCodeTempEntity codeTempEntity : insertList) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 IoCodeEntity codeEntity = new IoCodeEntity(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 BeanUtils.copyProperties(codeTempEntity, codeEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 ioCodeEntities.add(codeEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             codeService.insertBatch(ioCodeEntities); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             //生成扫码单据详情
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (!orderDetailCodeService.isExit(orderEntity.getBillNo())) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 for (IoCodeTempEntity codeTempEntity : insertList) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     genOrderDetailCode(orderEntity, codeTempEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             codeTempService.deleteByBillNo(orderEntity.getBillNo()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             //进行单据校验
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             ioCheckInoutService.check(orderEntity.getBillNo()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     //生成扫码单据详情
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     public void genOrderDetailCode(IoOrderEntity orderEntity, IoCodeTempEntity codeTempEntity) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         List<IoOrderDetailCodeEntity> ioOrderDetailCodeEntities = orderDetailCodeService.findByOrderId(orderEntity.getBillNo()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectGroupById(codeTempEntity.getRelId()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (CollUtil.isEmpty(ioOrderDetailCodeEntities)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             orderDetailCodeService.insert(buildEntity(orderEntity, codeTempEntity, udiRelevanceResponse)); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             ioOrderDetailCodeEntities.forEach(orderDetailCodeEntity -> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 if (orderDetailCodeEntity.getBindRlFk().longValue() == udiRelevanceResponse.getId().longValue() && orderDetailCodeEntity.getBatchNo().equals(codeTempEntity.getBatchNo())) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     orderDetailCodeEntity.setCount(orderDetailCodeEntity.getCount() + codeTempEntity.getCount()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     orderDetailCodeEntity.setReCount(orderDetailCodeEntity.getReCount() + codeTempEntity.getReCount()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     orderDetailCodeService.update(orderDetailCodeEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     orderDetailCodeService.insert(buildEntity(orderEntity, codeTempEntity, udiRelevanceResponse)); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             }); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     //平衡补单
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     public BaseResponse supplementOrder(String orderId) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         IoOrderEntity order = orderService.findByBillNo(orderId); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(order.getAction()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (StrUtil.isBlank(bussinessTypeEntity.getSupplementOrderType())) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             return ResultVOUtils.error(ResultEnum.valueOf("此类型单据不可补单")); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         IoOrderEntity supplementOrder = new IoOrderEntity(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         BeanUtil.copyProperties(order, supplementOrder); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         //生成补单单号,互填单号
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         String supplementOrderNo = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER + StrUtil.trimToEmpty(bussinessTypeEntity.getPrefix()), "yyyyMMdd")); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         supplementOrder.setSupplementNo(orderId); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         order.setSupplementNo(supplementOrderNo); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         supplementOrder.setBillNo(supplementOrderNo); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         supplementOrder.setCorpOrderId(CustomUtil.getId() + "x"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         //修改状态
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("additional_auto_submit"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if ("1".equals(systemParamConfigEntity.getParamValue())) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             supplementOrder.setStatus(ConstantStatus.ORDER_STATUS_PROCESS);        //设置状态为补录单据
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             supplementOrder.setStatus(ConstantStatus.ORDER_STATUS_ADDITIONAL);        //设置状态为补录单据
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         //交换往来信息
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         supplementOrder.setFromDeptCode(order.getDeptCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         supplementOrder.setFromInvCode(order.getInvCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         supplementOrder.setInvCode(order.getFromInvCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         supplementOrder.setDeptCode(order.getFromDeptCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         supplementOrder.setFromType(ConstantStatus.FROM_PEACE_CHANGE); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         //设置往来信息
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         BasicBussinessTypeEntity supplementType = basicBussinessTypeService.findByAction(bussinessTypeEntity.getSupplementOrderType()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         supplementOrder.setMainAction(supplementType.getMainAction()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         supplementOrder.setAction(supplementType.getAction()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         //复制码表
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         List<IoCodeEntity> codes = codeService.findByOrderId(orderId); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         List<IoCodeTempEntity> supplementCodes = new ArrayList<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         codes.forEach( | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 code -> { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     IoCodeTempEntity supplementCode = new IoCodeTempEntity(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     BeanUtil.copyProperties(code, supplementCode); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     supplementCode.setId(null); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     supplementCode.setInvCode(order.getFromInvCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     supplementCode.setDeptCode(order.getFromDeptCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     supplementCode.setOrderId(supplementOrderNo); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     supplementCode.setAction(supplementType.getAction()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     supplementCode.setMainAction(supplementType.getMainAction()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     supplementCodes.add(supplementCode); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         //更新数据
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         orderService.insertOrder(supplementOrder); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         orderService.update(order); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         codeTempService.insertBatch(supplementCodes); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         dealProcess(supplementOrder); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         return ResultVOUtils.success(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     //手持终端上传生成扫码单据
 |  |  |  |     //手持终端上传生成扫码单据
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     public void creatOrderByPda(PostOrderRequest postOrderRequest) { |  |  |  |     public void creatOrderByPda(PostOrderRequest postOrderRequest) { | 
			
		
	
	
		
		
			
				
					|  |  | @ -196,28 +468,62 @@ public class IoAddInoutService { | 
			
		
	
		
		
			
				
					
					|  |  |  |         return null; |  |  |  |         return null; | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     //查询本单是否有重复条码
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     public String checkOrderRepeatCode(IoCodeTempEntity codeEntity, List<IoCodeTempEntity> filterList) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         int count = 0; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (filterList != null) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             for (IoCodeTempEntity temp : filterList) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 if (temp.getCode().equals(codeEntity.getCode())) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     count = count + 1; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (count > 1) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             return codeEntity.getCode() + "条码重复"; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } else | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             return null; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     //生成扫码单据详情
 |  |  |  |     public String checkOriginCode(IoCodeTempEntity warehouseEntity) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     public void genOrderDetailCode(IoOrderEntity orderEntity, IoCodeTempEntity codeTempEntity) { |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         List<IoOrderDetailCodeEntity> ioOrderDetailCodeEntities = orderDetailCodeService.findByOrderId(orderEntity.getBillNo()); |  |  |  |         UdiEntity udiEntity = FilterUdiUtils.getUdi(warehouseEntity.getCode()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectGroupById(codeTempEntity.getRelId()); |  |  |  |         //校验条码的完整性
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         if (CollUtil.isEmpty(ioOrderDetailCodeEntities)) { |  |  |  |         String errMsg = ""; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             orderDetailCodeService.insert(buildEntity(orderEntity, codeTempEntity, udiRelevanceResponse)); |  |  |  |         UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectByNameCode(udiEntity.getUdi()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         } else { |  |  |  |         if (udiRelevanceResponse == null) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             ioOrderDetailCodeEntities.forEach(orderDetailCodeEntity -> |  |  |  |             return "耗材字典不存在此产品"; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 if (orderDetailCodeEntity.getBindRlFk().longValue() == udiRelevanceResponse.getId().longValue() && orderDetailCodeEntity.getBatchNo().equals(codeTempEntity.getBatchNo())) { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     orderDetailCodeEntity.setCount(orderDetailCodeEntity.getCount() + codeTempEntity.getCount()); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     orderDetailCodeEntity.setReCount(orderDetailCodeEntity.getReCount() + codeTempEntity.getReCount()); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     orderDetailCodeService.update(orderDetailCodeEntity); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } else { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     orderDetailCodeService.insert(buildEntity(orderEntity, codeTempEntity, udiRelevanceResponse)); |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |             }); |  |  |  |         InvProductDetailEntity invProductDetailEntity = invProductDetailService.sortFindByCode(warehouseEntity.getCode()); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (invProductDetailEntity != null) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (StrUtil.isEmpty(warehouseEntity.getBatchNo())) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 warehouseEntity.setBatchNo(invProductDetailEntity.getBatchNo()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (StrUtil.isEmpty(warehouseEntity.getProduceDate())) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 warehouseEntity.setProduceDate(invProductDetailEntity.getProduceDate()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (StrUtil.isEmpty(warehouseEntity.getExpireDate())) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 warehouseEntity.setExpireDate(invProductDetailEntity.getExpireDate()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (StrUtil.isEmpty(warehouseEntity.getBatchNo()) && !udiRelevanceResponse.getAllowNoBatch()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             errMsg = errMsg + ",批次号"; | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (StrUtil.isEmpty(warehouseEntity.getProduceDate()) && !udiRelevanceResponse.getAllowNoProduct()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             errMsg = errMsg + ",生产日期"; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (StrUtil.isEmpty(warehouseEntity.getExpireDate()) && !udiRelevanceResponse.getAllowNoExpire()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             errMsg = errMsg + ",失效日期"; | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (StrUtil.isNotEmpty(errMsg)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             return "UDI码" + warehouseEntity.getCode() + "产品三期缺失请补齐" + errMsg.substring(1) + ""; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         return null; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     IoOrderDetailCodeEntity buildEntity(IoOrderEntity orderEntity, IoCodeTempEntity codeTempEntity, UdiRelevanceResponse udiRelevanceResponse) { |  |  |  |     IoOrderDetailCodeEntity buildEntity(IoOrderEntity orderEntity, IoCodeTempEntity codeTempEntity, UdiRelevanceResponse udiRelevanceResponse) { | 
			
		
	
		
		
			
				
					
					|  |  |  |         IoOrderDetailCodeEntity ioOrderDetailCodeEntity = new IoOrderDetailCodeEntity(); |  |  |  |         IoOrderDetailCodeEntity ioOrderDetailCodeEntity = new IoOrderDetailCodeEntity(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         ioOrderDetailCodeEntity.setOrderIdFk(orderEntity.getBillNo()); |  |  |  |         ioOrderDetailCodeEntity.setOrderIdFk(orderEntity.getBillNo()); | 
			
		
	
	
		
		
			
				
					|  |  | @ -240,4 +546,5 @@ public class IoAddInoutService { | 
			
		
	
		
		
			
				
					
					|  |  |  |         return ioOrderDetailCodeEntity; |  |  |  |         return ioOrderDetailCodeEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | } |  |  |  | } | 
			
		
	
	
		
		
			
				
					|  |  | 
 |