|  |  | @ -138,6 +138,51 @@ public class IoCodeTempController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |         return ResultVOUtils.success("上传成功,等待后台处理"); |  |  |  |         return ResultVOUtils.success("上传成功,等待后台处理"); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     //前端扫码完整性校验
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     @AuthRuleAnnotation("") | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     @PostMapping("warehouse/inout/enterCodeBillNo") | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     public BaseResponse enterCodeBillNo(@RequestBody AddEnterCodeRequest addEnterCodeRequest) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (StrUtil.isEmpty(addEnterCodeRequest.getCode())) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             return ResultVOUtils.error(500, "单据号不能为空!"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         String code = addEnterCodeRequest.getCode(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         IoCollectOrderResponse collectOrder = collectOrderService.unionSearch(addEnterCodeRequest.getWorkPlaceCode(), addEnterCodeRequest.getBusType(), code); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (collectOrder == null) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             //=============================================//
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             //本地数据库 无此单据时 触发 用billNo 到 处方下载方法 进行下载
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             CollectOrderRequest collectOrderRequest = new CollectOrderRequest(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             collectOrderRequest.setBusType(addEnterCodeRequest.getBusType()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             collectOrderRequest.setWorkPlaceCode(addEnterCodeRequest.getWorkPlaceCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             collectOrderRequest.setBillNo(code); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             BaseResponse baseResponse = collectOriginService.downloadOrderV2(collectOrderRequest); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (ResultEnum.SUCCESS.getCode() == baseResponse.getCode()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 collectOrder = collectOrderService.unionSearch(null, null, code); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 //=============================================//
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 if (collectOrder == null) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     BaseResponse response = ResultVOUtils.error(501, "未查找到对应三方单据,请检查单据号"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     response.setData(code); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     return response; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 collectOrder.setWorkPlaceCode(addEnterCodeRequest.getWorkPlaceCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 collectOrder.setBusType(addEnterCodeRequest.getBusType()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 IoCollectOrder ioCollectOrder = new IoCollectOrder(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 BeanUtils.copyProperties(collectOrder,ioCollectOrder); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 collectOrderService.updateById(ioCollectOrder); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 BaseResponse response = ResultVOUtils.error(601, code); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 response.setData(collectOrder); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 return response; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 BaseResponse response = ResultVOUtils.error(501, "三方单据下载错误"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 response.setData(code); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 return response; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             BaseResponse response = ResultVOUtils.error(601, code); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             response.setData(collectOrder); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             return response; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     //前端扫码完整性校验
 |  |  |  |     //前端扫码完整性校验
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     @AuthRuleAnnotation("") |  |  |  |     @AuthRuleAnnotation("") | 
			
		
	
	
		
		
			
				
					|  |  | @ -227,34 +272,6 @@ public class IoCodeTempController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |         // TODO: 2024/9/13 首次无单进入的时候报错提示,不需要执行校验
 |  |  |  |         // TODO: 2024/9/13 首次无单进入的时候报错提示,不需要执行校验
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         UdiEntity udiEntity = FilterUdiUtils.getUdi(code); |  |  |  |         UdiEntity udiEntity = FilterUdiUtils.getUdi(code); | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (udiEntity == null) { |  |  |  |         if (udiEntity == null) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             String viewType = addEnterCodeRequest.getViewType(); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             if (viewType.equals("tagCode")) { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 IoCollectOrderResponse collectOrder = collectOrderService.unionSearch(addEnterCodeRequest.getWorkPlaceCode(), addEnterCodeRequest.getBusType(), code); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 if (collectOrder == null) { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     //=============================================//
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     //本地数据库 无此单据时 触发 用billNo 到 处方下载方法 进行下载
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     CollectOrderRequest collectOrderRequest = new CollectOrderRequest(); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     collectOrderRequest.setBusType(collectOrderRequest.getBusType()); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     collectOrderRequest.setWorkPlaceCode(collectOrderRequest.getWorkPlaceCode()); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     collectOrderRequest.setBillNo(code); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     BaseResponse baseResponse = collectOriginService.downloadOrderV2(collectOrderRequest); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     if (ResultEnum.SUCCESS.getCode() == baseResponse.getCode()) { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                         collectOrder = collectOrderService.unionSearch(addEnterCodeRequest.getWorkPlaceCode(), addEnterCodeRequest.getBusType(), code); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                         //=============================================//
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                         BaseResponse response = ResultVOUtils.error(601, code); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                         response.setData(collectOrder); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                         return response; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     } else { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                         BaseResponse response = ResultVOUtils.error(501, "UDI码格式错误"); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                         response.setData(originCode); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                         return response; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     } |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } else { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     BaseResponse response = ResultVOUtils.error(601, code); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     response.setData(collectOrder); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     return response; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             } else { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 String sptmtodi = systemParamConfigService.selectValueByParamKey(Constant.SPTM_TO_DI); |  |  |  |                 String sptmtodi = systemParamConfigService.selectValueByParamKey(Constant.SPTM_TO_DI); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 if (sptmtodi.equals("1")) { |  |  |  |                 if (sptmtodi.equals("1")) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     if (code.length() == 13) { |  |  |  |                     if (code.length() == 13) { | 
			
		
	
	
		
		
			
				
					|  |  | @ -270,7 +287,6 @@ public class IoCodeTempController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 baseResponse.setData(originCode); |  |  |  |                 baseResponse.setData(originCode); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 return baseResponse; |  |  |  |                 return baseResponse; | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (IntUtil.value(udiEntity.getProductType()) == 2) { |  |  |  |         if (IntUtil.value(udiEntity.getProductType()) == 2) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             //药品
 |  |  |  |             //药品
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             udiEntity.setCode(code); |  |  |  |             udiEntity.setCode(code); | 
			
		
	
	
		
		
			
				
					|  |  | 
 |