|  |  | @ -65,6 +65,7 @@ import com.glxp.api.util.GennerOrderUtils; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.util.IntUtil; |  |  |  | import com.glxp.api.util.IntUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.util.OrderNoTypeBean; |  |  |  | import com.glxp.api.util.OrderNoTypeBean; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.util.udi.FilterUdiUtils; |  |  |  | import com.glxp.api.util.udi.FilterUdiUtils; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.util.udi.UdiCalCountUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.springframework.beans.BeanUtils; |  |  |  | import org.springframework.beans.BeanUtils; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.springframework.transaction.annotation.Transactional; |  |  |  | import org.springframework.transaction.annotation.Transactional; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.springframework.validation.BindingResult; |  |  |  | import org.springframework.validation.BindingResult; | 
			
		
	
	
		
		
			
				
					|  |  | @ -689,6 +690,11 @@ public class IoOrderDetailBizController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |     AlihealthBusService alihealthBusService; |  |  |  |     AlihealthBusService alihealthBusService; | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Resource |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |     UdiRelevanceDao udiRelevanceDao; |  |  |  |     UdiRelevanceDao udiRelevanceDao; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     IoCodeLostService ioCodeLostService; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     UdiCalCountUtil udiCalCountUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     //录入阿里送货单的业务单据详情
 |  |  |  |     //录入阿里送货单的业务单据详情
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     @AuthRuleAnnotation("") |  |  |  |     @AuthRuleAnnotation("") | 
			
		
	
	
		
		
			
				
					|  |  | @ -722,7 +728,13 @@ public class IoOrderDetailBizController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |             return ResultVOUtils.error("单据码明细为空!"); |  |  |  |             return ResultVOUtils.error("单据码明细为空!"); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         String code = aliYljgBillDetailDrugCodeList.get(0).getCode(); |  |  |  | 
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         IoOrderEntity ioOrderEntity = addBizProductReqeust.getOrderEntity(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         for (int i = 0; i < aliYljgBillDetailDrugList.size(); i++) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             AliYljgBillDetailDrug aliYljgBillDetailDrug = aliYljgBillDetailDrugList.get(i); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             String code = aliYljgBillDetailDrug.getAliYljgBillDetailDrugCodeList().get(0).getCode(); | 
			
		
	
		
		
			
				
					
					|  |  |  |             if (StrUtil.isEmpty(code)) { |  |  |  |             if (StrUtil.isEmpty(code)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 return ResultVOUtils.error("单据码为空!"); |  |  |  |                 return ResultVOUtils.error("单据码为空!"); | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
	
		
		
			
				
					|  |  | @ -744,43 +756,71 @@ public class IoOrderDetailBizController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 return ResultVOUtils.error("未通过药品标识获取详情信息!"); |  |  |  |                 return ResultVOUtils.error("未通过药品标识获取详情信息!"); | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |             UdiRelevanceResponse udiRelevanceResponse = udiRelevanceResponses.get(0); |  |  |  |             UdiRelevanceResponse udiRelevanceResponse = udiRelevanceResponses.get(0); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |             List<AliYljgBillDetailDrugCode> aliYljgBillDetailDrugCodeList1 = aliYljgBillDetailDrug.getAliYljgBillDetailDrugCodeList(); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             //1、直接模拟增加biz一行
 |  |  |  |             //1、直接模拟增加biz一行
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             addBizProductReqeust.setProductId(String.valueOf(udiRelevanceResponse.getProductId())); |  |  |  |             addBizProductReqeust.setProductId(String.valueOf(udiRelevanceResponse.getProductId())); | 
			
		
	
		
		
			
				
					
					|  |  |  |             addBizProductReqeust.setRelId(udiRelevanceResponse.getRelId()); |  |  |  |             addBizProductReqeust.setRelId(udiRelevanceResponse.getRelId()); | 
			
		
	
		
		
			
				
					
					|  |  |  |             addBizProductReqeust.setZczbhhzbapzbh(udiRelevanceResponse.getZczbhhzbapzbh()); |  |  |  |             addBizProductReqeust.setZczbhhzbapzbh(udiRelevanceResponse.getZczbhhzbapzbh()); | 
			
		
	
		
		
			
				
					
					|  |  |  |             addBizProductReqeust.setSupId(udiRelevanceResponse.getSupId()); |  |  |  |             addBizProductReqeust.setSupId(udiRelevanceResponse.getSupId()); | 
			
		
	
		
		
			
				
					
					|  |  |  |             addBizProductReqeust.setDatas(null); |  |  |  |             addBizProductReqeust.setDatas(null); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             addBizProductReqeust.setCount(aliYljgBillDetailDrugCodeList1.size() * udiCalCountUtil.getCirActCount(udiRelevanceResponse)); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         IoOrderEntity ioOrderEntity = addBizProductReqeust.getOrderEntity(); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         for (int i = 0; i < aliYljgBillDetailDrugList.size(); i++) { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             AliYljgBillDetailDrug aliYljgBillDetailDrug = aliYljgBillDetailDrugList.get(i); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             addBizProductReqeust.setBatchNo(aliYljgBillDetailDrug.getProduceBatchNo()); |  |  |  |             addBizProductReqeust.setBatchNo(aliYljgBillDetailDrug.getProduceBatchNo()); | 
			
		
	
		
		
			
				
					
					|  |  |  |             addBizProductReqeust.setProductDate(aliYljgBillDetailDrug.getProduceDate()); |  |  |  |             if (StrUtil.isNotEmpty(aliYljgBillDetailDrug.getProduceDate())){ | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             addBizProductReqeust.setExpireDate(aliYljgBillDetailDrug.getProduceDate()); |  |  |  |                 addBizProductReqeust.setProductDate(aliYljgBillDetailDrug.getProduceDate().substring(2).replace(" 00:00:00", "").replace("-", "")); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (StrUtil.isNotEmpty(aliYljgBillDetailDrug.getValidEndDate())){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 addBizProductReqeust.setExpireDate(aliYljgBillDetailDrug.getValidEndDate().substring(2).replace(" 00:00:00", "").replace("-", "")); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (i == 0) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 addBizProductReqeust.setOrderEntity(ioOrderEntity); |  |  |  |                 addBizProductReqeust.setOrderEntity(ioOrderEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |             BaseResponse response = orderDetailBizService.addBizProduct(addBizProductReqeust); |  |  |  |             BaseResponse response = orderDetailBizService.addBizProduct(addBizProductReqeust); | 
			
		
	
		
		
			
				
					
					|  |  |  |             if (response.getCode() != 20000) { |  |  |  |             if (response.getCode() != 20000) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 return response; |  |  |  |                 return response; | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |             if (i == 0) { |  |  |  |             if (i == 0) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 ioOrderEntity = JSONObject.parseObject(JSONObject.toJSONString(response.getData()), IoOrderEntity.class); |  |  |  |                 ioOrderEntity = JSONObject.parseObject(JSONObject.toJSONString(response.getData()), IoOrderEntity.class); | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |                 addBizProductReqeust.setOrderEntity(ioOrderEntity); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             AddOrderRequest addOrderRequest = new AddOrderRequest(); |  |  |  |             AddOrderRequest addOrderRequest = new AddOrderRequest(); | 
			
		
	
		
		
			
				
					
					|  |  |  |             BeanUtils.copyProperties(ioOrderEntity, addOrderRequest); |  |  |  |             BeanUtils.copyProperties(ioOrderEntity, addOrderRequest); | 
			
		
	
		
		
			
				
					
					|  |  |  |         for (int i = 0; i < aliYljgBillDetailDrugCodeList.size(); i++) { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |             for (int j = 0; j < aliYljgBillDetailDrugCodeList1.size(); j++) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | //            IoCodeLostEntity ioCodeLostEntity = new IoCodeLostEntity();
 |  |  |  |                 AliYljgBillDetailDrugCode aliYljgBillDetailDrugCode = aliYljgBillDetailDrugCodeList.get(j); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | //            ioCodeLostEntity.set
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //            todo 补三期进扫码补齐表
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             AliYljgBillDetailDrugCode aliYljgBillDetailDrugCode = aliYljgBillDetailDrugCodeList.get(i); |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                 addOrderRequest.setCode(aliYljgBillDetailDrugCode.getCode()); |  |  |  |                 addOrderRequest.setCode(aliYljgBillDetailDrugCode.getCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |             BaseResponse response = ioCodeTempService.addDrugOrderWeb(addOrderRequest); |  |  |  | 
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             if (response.getCode() != 20000) { |  |  |  |                 IoCodeLostEntity codeLostEntity = ioCodeLostService.findByCode(code); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 return response; |  |  |  |                 if (codeLostEntity == null) { | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     codeLostEntity = new IoCodeLostEntity(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     codeLostEntity.setId(IdUtil.getSnowflakeNextId()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     codeLostEntity.setNameCode(nameCode); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     codeLostEntity.setCode(code); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     codeLostEntity.setBatchNo(aliYljgBillDetailDrug.getProduceBatchNo()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     if (StrUtil.isNotEmpty(aliYljgBillDetailDrug.getProduceDate())){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         codeLostEntity.setProduceDate(aliYljgBillDetailDrug.getProduceDate().substring(2).replace(" 00:00:00", "").replace("-", "")); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     if (StrUtil.isNotEmpty(aliYljgBillDetailDrug.getValidEndDate())){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         codeLostEntity.setExpireDate(aliYljgBillDetailDrug.getValidEndDate().substring(2).replace(" 00:00:00", "").replace("-", "")); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 }else { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     codeLostEntity.setBatchNo(aliYljgBillDetailDrug.getProduceBatchNo()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     if (StrUtil.isNotEmpty(aliYljgBillDetailDrug.getProduceDate())){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         codeLostEntity.setProduceDate(aliYljgBillDetailDrug.getProduceDate().substring(2).replace(" 00:00:00", "").replace("-", "")); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     if (StrUtil.isNotEmpty(aliYljgBillDetailDrug.getValidEndDate())){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         codeLostEntity.setExpireDate(aliYljgBillDetailDrug.getValidEndDate().substring(2).replace(" 00:00:00", "").replace("-", "")); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 ioCodeLostService.insertOrUpdate(codeLostEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 BaseResponse response2 = ioCodeTempService.addDrugOrderWeb(addOrderRequest); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 if (response2.getCode() != 20000) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     return response2; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | 
 |