|  |  |  | @ -3,9 +3,13 @@ package com.glxp.api.controller.inout; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.annotation.CusRedissonAnnotation; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.constant.*; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.basic.*; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.collect.IoCollectOrder; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.inv.InvProductDetailEntity; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.exception.JsonException; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.req.collect.CollectOrderRequest; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.res.inout.IoOrderDetailCodeResponse; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.service.collect.IoCollectOrderService; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.service.collect.IoCollectOriginService; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.service.inout.impl.IoCodeService; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.service.inv.impl.InvProductDetailService; | 
			
		
	
		
			
				
					|  |  |  |  | import org.springframework.beans.BeanUtils; | 
			
		
	
	
		
			
				
					|  |  |  | @ -96,6 +100,10 @@ public class IoCodeTempController extends BaseController { | 
			
		
	
		
			
				
					|  |  |  |  |     IoCheckInvService checkInvService; | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |  |     IoSplitFifoCodeService splitFifoCodeService; | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |  |     IoCollectOriginService collectOriginService; | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |  |     IoCollectOrderService collectOrderService; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     /** | 
			
		
	
		
			
				
					|  |  |  |  |      * PDA-----单据上传 | 
			
		
	
	
		
			
				
					|  |  |  | @ -216,20 +224,45 @@ public class IoCodeTempController extends BaseController { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         UdiEntity udiEntity = FilterUdiUtils.getUdi(code); | 
			
		
	
		
			
				
					|  |  |  |  |         if (udiEntity == null) { | 
			
		
	
		
			
				
					|  |  |  |  |             String sptmtodi = systemParamConfigService.selectValueByParamKey(Constant.SPTM_TO_DI); | 
			
		
	
		
			
				
					|  |  |  |  |             if (sptmtodi.equals("1")) { | 
			
		
	
		
			
				
					|  |  |  |  |                 if (code.length() == 13) { | 
			
		
	
		
			
				
					|  |  |  |  |                     UdiProductEntity udiProductEntity = udiProductService.findBySptm(code); | 
			
		
	
		
			
				
					|  |  |  |  |                     if (udiProductEntity != null) { | 
			
		
	
		
			
				
					|  |  |  |  |                         BaseResponse baseResponse = ResultVOUtils.error(508, "UDI码格式错误"); | 
			
		
	
		
			
				
					|  |  |  |  |                         baseResponse.setData(udiProductEntity); | 
			
		
	
		
			
				
					|  |  |  |  |                         return baseResponse; | 
			
		
	
		
			
				
					|  |  |  |  |             String viewType = addEnterCodeRequest.getViewType(); | 
			
		
	
		
			
				
					|  |  |  |  |             if (viewType.equals("tagCode")){ | 
			
		
	
		
			
				
					|  |  |  |  |                 IoCollectOrder collectOrder = collectOrderService.getByBillNo(code); | 
			
		
	
		
			
				
					|  |  |  |  |                 if (collectOrder == null ){ | 
			
		
	
		
			
				
					|  |  |  |  |                     //=============================================//
 | 
			
		
	
		
			
				
					|  |  |  |  |                     //本地数据库 无此单据时 触发 用billNo 到 处方下载方法 进行下载
 | 
			
		
	
		
			
				
					|  |  |  |  |                     CollectOrderRequest collectOrderRequest = new CollectOrderRequest(); | 
			
		
	
		
			
				
					|  |  |  |  |                     collectOrderRequest.setBusType("YPCF002"); | 
			
		
	
		
			
				
					|  |  |  |  |                     collectOrderRequest.setBillNo(code); | 
			
		
	
		
			
				
					|  |  |  |  |                     BaseResponse baseResponse = collectOriginService.downloadOrder(collectOrderRequest); | 
			
		
	
		
			
				
					|  |  |  |  |                     if (ResultEnum.SUCCESS.getCode() != baseResponse.getCode()) | 
			
		
	
		
			
				
					|  |  |  |  |                         throw new JsonException(500, "处方单据下载失败!"); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                     collectOrder = collectOrderService.getByBillNo(code); | 
			
		
	
		
			
				
					|  |  |  |  |                     //=============================================//
 | 
			
		
	
		
			
				
					|  |  |  |  |                     BaseResponse response = ResultVOUtils.error(601, code); | 
			
		
	
		
			
				
					|  |  |  |  |                     response.setData(collectOrder); | 
			
		
	
		
			
				
					|  |  |  |  |                     return response; | 
			
		
	
		
			
				
					|  |  |  |  |                 }else { | 
			
		
	
		
			
				
					|  |  |  |  |                     BaseResponse response = ResultVOUtils.error(601, code); | 
			
		
	
		
			
				
					|  |  |  |  |                     response.setData(collectOrder); | 
			
		
	
		
			
				
					|  |  |  |  |                     return response; | 
			
		
	
		
			
				
					|  |  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |  |             } else{ | 
			
		
	
		
			
				
					|  |  |  |  |                 String sptmtodi = systemParamConfigService.selectValueByParamKey(Constant.SPTM_TO_DI); | 
			
		
	
		
			
				
					|  |  |  |  |                 if (sptmtodi.equals("1")) { | 
			
		
	
		
			
				
					|  |  |  |  |                     if (code.length() == 13) { | 
			
		
	
		
			
				
					|  |  |  |  |                         UdiProductEntity udiProductEntity = udiProductService.findBySptm(code); | 
			
		
	
		
			
				
					|  |  |  |  |                         if (udiProductEntity != null) { | 
			
		
	
		
			
				
					|  |  |  |  |                             BaseResponse baseResponse = ResultVOUtils.error(508, "UDI码格式错误"); | 
			
		
	
		
			
				
					|  |  |  |  |                             baseResponse.setData(udiProductEntity); | 
			
		
	
		
			
				
					|  |  |  |  |                             return baseResponse; | 
			
		
	
		
			
				
					|  |  |  |  |                         } | 
			
		
	
		
			
				
					|  |  |  |  |                     } | 
			
		
	
		
			
				
					|  |  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |  |                 BaseResponse baseResponse = ResultVOUtils.error(501, "UDI码格式错误"); | 
			
		
	
		
			
				
					|  |  |  |  |                 baseResponse.setData(originCode); | 
			
		
	
		
			
				
					|  |  |  |  |                 return baseResponse; | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  |             BaseResponse baseResponse = ResultVOUtils.error(501, "UDI码格式错误"); | 
			
		
	
		
			
				
					|  |  |  |  |             baseResponse.setData(originCode); | 
			
		
	
		
			
				
					|  |  |  |  |             return baseResponse; | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         if (IntUtil.value(udiEntity.getProductType()) == 2) { | 
			
		
	
		
			
				
					|  |  |  |  |             //药品
 | 
			
		
	
	
		
			
				
					|  |  |  | 
 |