|  |  | @ -147,8 +147,7 @@ public class IoOrderDetailBizController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |         AuthAdmin authAdmin = getUser(); |  |  |  |         AuthAdmin authAdmin = getUser(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (addBizProductReqeust.getRelId() == null && CollUtil.isEmpty(addBizProductReqeust.getDatas())) |  |  |  |         if (addBizProductReqeust.getRelId() == null && CollUtil.isEmpty(addBizProductReqeust.getDatas())) | 
			
		
	
		
		
			
				
					
					|  |  |  |             return ResultVOUtils.error(500, "未选择产品信息"); |  |  |  |             return ResultVOUtils.error(500, "未选择产品信息"); | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (addBizProductReqeust.getOrderEntity() == null) |  |  |  |         if (addBizProductReqeust.getOrderEntity() == null) return ResultVOUtils.error(500, "未指定订单"); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             return ResultVOUtils.error(500, "未指定订单"); |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         IoOrderEntity orderEntity = addBizProductReqeust.getOrderEntity(); |  |  |  |         IoOrderEntity orderEntity = addBizProductReqeust.getOrderEntity(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         IoOrderEntity isExit = orderService.findByBillNo(orderEntity.getBillNo()); |  |  |  |         IoOrderEntity isExit = orderService.findByBillNo(orderEntity.getBillNo()); | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (StrUtil.isEmpty(orderEntity.getBillNo()) || isExit == null) { |  |  |  |         if (StrUtil.isEmpty(orderEntity.getBillNo()) || isExit == null) { | 
			
		
	
	
		
		
			
				
					|  |  | @ -304,16 +303,14 @@ public class IoOrderDetailBizController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 outInvCode = invWarehouseEntity.getCode(); |  |  |  |                 outInvCode = invWarehouseEntity.getCode(); | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |             Boolean vailBatchNo = true; |  |  |  |             Boolean vailBatchNo = true; | 
			
		
	
		
		
			
				
					
					|  |  |  |             if (IntUtil.value(bussinessTypeEntity.getVailInvBatchNo())) |  |  |  |             if (IntUtil.value(bussinessTypeEntity.getVailInvBatchNo())) vailBatchNo = false; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 vailBatchNo = false; |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             Integer count = invProductServiceNew.vailStockCount(orderDetailBizEntity.getBindRlFk(), orderDetailBizEntity.getBatchNo(), orderDetailBizEntity.getSupId(), null, outInvCode, null, vailBatchNo); |  |  |  |             Integer count = invProductServiceNew.vailStockCount(orderDetailBizEntity.getBindRlFk(), orderDetailBizEntity.getBatchNo(), orderDetailBizEntity.getSupId(), null, outInvCode, null, vailBatchNo); | 
			
		
	
		
		
			
				
					
					|  |  |  |             count = IntUtil.value(count) - orderDetailBizEntity.getCount(); |  |  |  |             count = IntUtil.value(count) - orderDetailBizEntity.getCount(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             if (count < 0) { |  |  |  |             if (count < 0) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 if (count == -1) { |  |  |  |                 if (count == -1) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     return ResultVOUtils.error(500, "该产品未入库"); |  |  |  |                     return ResultVOUtils.error(500, "该产品未入库"); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } else |  |  |  |                 } else return ResultVOUtils.error(500, "当前库存不足"); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     return ResultVOUtils.error(500, "当前库存不足"); |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -459,8 +456,7 @@ public class IoOrderDetailBizController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |     @AuthRuleAnnotation("") |  |  |  |     @AuthRuleAnnotation("") | 
			
		
	
		
		
			
				
					
					|  |  |  |     @PostMapping("/udiwms/inout/order/addReceiveOrder") |  |  |  |     @PostMapping("/udiwms/inout/order/addReceiveOrder") | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Log(title = "单据管理", businessType = BusinessType.INSERT) |  |  |  |     @Log(title = "单据管理", businessType = BusinessType.INSERT) | 
			
		
	
		
		
			
				
					
					|  |  |  |     public BaseResponse addReceiveOrder(@RequestBody PurReceiveEntity purReceiveEntity, |  |  |  |     public BaseResponse addReceiveOrder(@RequestBody PurReceiveEntity purReceiveEntity, BindingResult bindingResult) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                                         BindingResult bindingResult) { |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (bindingResult.hasErrors()) { |  |  |  |         if (bindingResult.hasErrors()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); |  |  |  |             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); | 
			
		
	
	
		
		
			
				
					|  |  | @ -531,8 +527,7 @@ public class IoOrderDetailBizController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |     @AuthRuleAnnotation("") |  |  |  |     @AuthRuleAnnotation("") | 
			
		
	
		
		
			
				
					
					|  |  |  |     @PostMapping("/udiwms/inout/order/addPurOrder") |  |  |  |     @PostMapping("/udiwms/inout/order/addPurOrder") | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Log(title = "单据管理", businessType = BusinessType.INSERT) |  |  |  |     @Log(title = "单据管理", businessType = BusinessType.INSERT) | 
			
		
	
		
		
			
				
					
					|  |  |  |     public BaseResponse addPurOrder(@RequestBody PurOrderEntity purOrderEntity, |  |  |  |     public BaseResponse addPurOrder(@RequestBody PurOrderEntity purOrderEntity, BindingResult bindingResult) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                                     BindingResult bindingResult) { |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (bindingResult.hasErrors()) { |  |  |  |         if (bindingResult.hasErrors()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); |  |  |  |             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); | 
			
		
	
	
		
		
			
				
					|  |  | @ -628,9 +623,7 @@ public class IoOrderDetailBizController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         String value = systemParamConfigService.selectValueByParamKey("order_detail_visible"); |  |  |  |         String value = systemParamConfigService.selectValueByParamKey("order_detail_visible"); | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (IntUtil.value(value) == 1) { |  |  |  |         if (IntUtil.value(value) == 1) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             list = list.stream() |  |  |  |             list = list.stream().sorted(Comparator.comparing(IoOrderDetailBizResponse::getNameCode)).collect(Collectors.toList()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     .sorted(Comparator.comparing(IoOrderDetailBizResponse::getNameCode)) |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     .collect(Collectors.toList()); |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -679,9 +672,7 @@ public class IoOrderDetailBizController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         String value = systemParamConfigService.selectValueByParamKey("order_detail_visible"); |  |  |  |         String value = systemParamConfigService.selectValueByParamKey("order_detail_visible"); | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (IntUtil.value(value) == 1) { |  |  |  |         if (IntUtil.value(value) == 1) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             list = list.stream() |  |  |  |             list = list.stream().sorted(Comparator.comparing(IoOrderDetailBizResponse::getNameCode)).collect(Collectors.toList()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     .sorted(Comparator.comparing(IoOrderDetailBizResponse::getNameCode)) |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     .collect(Collectors.toList()); |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (CollUtil.isEmpty(list)) { |  |  |  |         if (CollUtil.isEmpty(list)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             PageInfo<IoOrderDetailBizResponse> pageInfo = new PageInfo<>(list); |  |  |  |             PageInfo<IoOrderDetailBizResponse> pageInfo = new PageInfo<>(list); | 
			
		
	
	
		
		
			
				
					|  |  | @ -872,8 +863,7 @@ public class IoOrderDetailBizController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |             String msg = ""; |  |  |  |             String msg = ""; | 
			
		
	
		
		
			
				
					
					|  |  |  |             BigDecimal invoiceAmount = BigDecimal.ZERO; |  |  |  |             BigDecimal invoiceAmount = BigDecimal.ZERO; | 
			
		
	
		
		
			
				
					
					|  |  |  |             for (IoOrderInvoiceEntity orderInvoiceEntity : orderInvoiceEntities) { |  |  |  |             for (IoOrderInvoiceEntity orderInvoiceEntity : orderInvoiceEntities) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 if (StrUtil.trimToEmpty(orderInvoiceEntity.getBatchNo()).equals(StrUtil.trimToEmpty(orderDetailCodeEntity.getBatchNo())) |  |  |  |                 if (StrUtil.trimToEmpty(orderInvoiceEntity.getBatchNo()).equals(StrUtil.trimToEmpty(orderDetailCodeEntity.getBatchNo())) && StrUtil.trimToEmpty(orderInvoiceEntity.getBindRlFk()).equals(StrUtil.trimToEmpty(orderDetailCodeEntity.getBindRlFk() + ""))) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         && StrUtil.trimToEmpty(orderInvoiceEntity.getBindRlFk()).equals(StrUtil.trimToEmpty(orderDetailCodeEntity.getBindRlFk() + ""))) { |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                     if (StrUtil.isNotEmpty(orderInvoiceEntity.getPrice())) { |  |  |  |                     if (StrUtil.isNotEmpty(orderInvoiceEntity.getPrice())) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                         BigDecimal price = new BigDecimal(orderInvoiceEntity.getPrice()); |  |  |  |                         BigDecimal price = new BigDecimal(orderInvoiceEntity.getPrice()); | 
			
		
	
		
		
			
				
					
					|  |  |  |                         invoiceAmount = invoiceAmount.add(price); |  |  |  |                         invoiceAmount = invoiceAmount.add(price); | 
			
		
	
	
		
		
			
				
					|  |  | @ -911,8 +901,7 @@ public class IoOrderDetailBizController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |      * @return |  |  |  |      * @return | 
			
		
	
		
		
			
				
					
					|  |  |  |      */ |  |  |  |      */ | 
			
		
	
		
		
			
				
					
					|  |  |  |     @GetMapping("/udiwms/inout/bizDetail/orderOutRecordPage") |  |  |  |     @GetMapping("/udiwms/inout/bizDetail/orderOutRecordPage") | 
			
		
	
		
		
			
				
					
					|  |  |  |     public BaseResponse orderOutRecordPage(FilterOrderDetailBizRequest orderDetailBizRequest, |  |  |  |     public BaseResponse orderOutRecordPage(FilterOrderDetailBizRequest orderDetailBizRequest, BindingResult bindingResult) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                                            BindingResult bindingResult) { |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         if (bindingResult.hasErrors()) { |  |  |  |         if (bindingResult.hasErrors()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); |  |  |  |             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
	
		
		
			
				
					|  |  | @ -930,12 +919,10 @@ public class IoOrderDetailBizController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |     //录入阳光采购的追溯码
 |  |  |  |     //录入阳光采购的追溯码
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     @PostMapping("/udiwms/inout/order/yc/fileUpload") |  |  |  |     @PostMapping("/udiwms/inout/order/yc/fileUpload") | 
			
		
	
		
		
			
				
					
					|  |  |  |     @CusRedissonAnnotation(cacheName = RedissonCacheKey.XML_UPLOAD, key = {"#billNo"}, timeOutMsg = "系统正在处理,请勿重复上传") |  |  |  |     @CusRedissonAnnotation(cacheName = RedissonCacheKey.XML_UPLOAD, key = {"#billNo"}, timeOutMsg = "系统正在处理,请勿重复上传") | 
			
		
	
		
		
			
				
					
					|  |  |  |     public BaseResponse ycFileUpload(@RequestParam("billNo") String billNo, @RequestParam("file") MultipartFile file) { |  |  |  |     public BaseResponse ycCodeFileUpload(@RequestParam("billNo") String billNo, @RequestParam("file") MultipartFile file, AuthAdmin authAdmin) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         alihealthBusService.ycFileUpload(billNo, file); |  |  |  |         return alihealthBusService.ycFileUpload(billNo, file, authAdmin); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         return ResultVOUtils.successMsg("上传成功!"); |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     //录入阳光采购的采购订单明细
 |  |  |  |     //录入阳光采购的采购订单明细
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     @PostMapping("/udiwms/inout/order/yc/orderFileUpload") |  |  |  |     @PostMapping("/udiwms/inout/order/yc/orderFileUpload") | 
			
		
	
		
		
			
				
					
					|  |  |  |     @CusRedissonAnnotation(cacheName = RedissonCacheKey.XML_UPLOAD, key = {"#billNoJson"}, timeOutMsg = "系统正在处理,请勿重复上传") |  |  |  |     @CusRedissonAnnotation(cacheName = RedissonCacheKey.XML_UPLOAD, key = {"#billNoJson"}, timeOutMsg = "系统正在处理,请勿重复上传") | 
			
		
	
	
		
		
			
				
					|  |  | @ -1079,7 +1066,7 @@ public class IoOrderDetailBizController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 //匹配biz
 |  |  |  |                 //匹配biz
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 IoOrderDetailCodeEntity byRelId = orderDetailCodeService.findByRelNameCode(addOrderRequest.getBillNo(), nameCode, aliYljgBillDetailDrug.getProduceBatchNo()); |  |  |  |                 IoOrderDetailCodeEntity byRelId = orderDetailCodeService.findByRelNameCode(addOrderRequest.getBillNo(), nameCode, aliYljgBillDetailDrug.getProduceBatchNo()); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 if (byRelId!=null){ |  |  |  |                 if (byRelId != null) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                     codeLostEntity.setBizId(byRelId.getId()); |  |  |  |                     codeLostEntity.setBizId(byRelId.getId()); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | 
 |