|  |  | @ -21,6 +21,7 @@ import com.glxp.api.dao.inout.IoCodeTempDao; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.entity.auth.AuthAdmin; |  |  |  | import com.glxp.api.entity.auth.AuthAdmin; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.entity.basic.BasicBussinessTypeEntity; |  |  |  | import com.glxp.api.entity.basic.BasicBussinessTypeEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.entity.basic.EntrustReceEntity; |  |  |  | import com.glxp.api.entity.basic.EntrustReceEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.entity.collect.RelCodeBatch; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.entity.inout.*; |  |  |  | import com.glxp.api.entity.inout.*; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.entity.system.SystemParamConfigEntity; |  |  |  | import com.glxp.api.entity.system.SystemParamConfigEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.req.alihealth.AlihealthYljgSinglerelationReqeust; |  |  |  | import com.glxp.api.req.alihealth.AlihealthYljgSinglerelationReqeust; | 
			
		
	
	
		
		
			
				
					|  |  | @ -47,8 +48,10 @@ import com.glxp.api.service.sync.SpsSyncDownloadService; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.service.system.SystemParamConfigService; |  |  |  | import com.glxp.api.service.system.SystemParamConfigService; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.util.*; |  |  |  | import com.glxp.api.util.*; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.util.alihealth.AlihealthYljgUtils; |  |  |  | import com.glxp.api.util.alihealth.AlihealthYljgUtils; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.util.redis.RedisDelayedQueue; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.util.udi.UdiCalCountUtil; |  |  |  | import com.glxp.api.util.udi.UdiCalCountUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import lombok.extern.slf4j.Slf4j; |  |  |  | import lombok.extern.slf4j.Slf4j; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import org.springframework.beans.factory.annotation.Value; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.springframework.validation.BindingResult; |  |  |  | import org.springframework.validation.BindingResult; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.springframework.web.bind.annotation.GetMapping; |  |  |  | import org.springframework.web.bind.annotation.GetMapping; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.springframework.web.bind.annotation.PostMapping; |  |  |  | import org.springframework.web.bind.annotation.PostMapping; | 
			
		
	
	
		
		
			
				
					|  |  | @ -129,13 +132,14 @@ public class IoOrderReviewController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |     private RelCodeDetailService relCodeDetailService; |  |  |  |     private RelCodeDetailService relCodeDetailService; | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Resource |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |     private IoCodeDao ioCodeDao; |  |  |  |     private IoCodeDao ioCodeDao; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     //前端二次审核
 |  |  |  |     //前端二次审核
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     @AuthRuleAnnotation("") |  |  |  |     @AuthRuleAnnotation("") | 
			
		
	
		
		
			
				
					
					|  |  |  |     @PostMapping("/spms/inout/order/web/updateStatus") |  |  |  |     @PostMapping("/spms/inout/order/web/updateStatus") | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Log(title = "单据管理", businessType = BusinessType.UPDATE) |  |  |  |     @Log(title = "单据管理", businessType = BusinessType.UPDATE) | 
			
		
	
		
		
			
				
					
					|  |  |  |     public BaseResponse webUpdateStatus(@RequestBody ReviewFinishRequest updateExportStatusRequest, |  |  |  |     public BaseResponse webUpdateStatus(@RequestBody ReviewFinishRequest updateExportStatusRequest, | 
			
		
	
		
		
			
				
					
					|  |  |  |                                         BindingResult bindingResult) { |  |  |  |                                         BindingResult bindingResult) { | 
			
		
	
		
		
			
				
					
					|  |  |  |         log.error("单据审核进来了==="+updateExportStatusRequest); |  |  |  |         log.error("单据审核进来了===" + updateExportStatusRequest); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         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()); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
	
		
		
			
				
					|  |  | @ -144,13 +148,13 @@ public class IoOrderReviewController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |             return ResultVOUtils.error(500, "未找到该业务单据"); |  |  |  |             return ResultVOUtils.error(500, "未找到该业务单据"); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_CHECK_REW) { |  |  |  |         if (orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_CHECK_REW) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             BaseResponse baseResponse =  updateReview(getUser(), orderEntity); |  |  |  |             BaseResponse baseResponse = updateReview(getUser(), orderEntity); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             log.error("单据审核进来了===orderEntity===="+orderEntity); |  |  |  |             log.error("单据审核进来了===orderEntity====" + orderEntity); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             if(baseResponse.getCode() == 20000) { |  |  |  |             if (baseResponse.getCode() == 20000) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                 //todo 审核通过上传关联关系
 |  |  |  |                 //todo 审核通过上传关联关系
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 BasicBussinessTypeEntity businessType = basicBussinessTypeService.findByAction(orderEntity.getAction()); |  |  |  |                 BasicBussinessTypeEntity businessType = basicBussinessTypeService.findByAction(orderEntity.getAction()); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 log.error("单据审核进来了===businessType===="+businessType); |  |  |  |                 log.error("单据审核进来了===businessType====" + businessType); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 if (businessType.getCorpType() == ConstantStatus.CORP_SP && businessType.getMainAction().equals(ConstantType.TYPE_PUT) && businessType.getProductType() == 2) { |  |  |  |                 if (businessType.getCorpType() == ConstantStatus.CORP_SP && businessType.getMainAction().equals(ConstantType.TYPE_PUT) && businessType.getProductType() == 2) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     aliBillsDispose(orderEntity); |  |  |  |                     aliBillsDispose(orderEntity); | 
			
		
	
	
		
		
			
				
					|  |  | @ -165,9 +169,6 @@ public class IoOrderReviewController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     //前端第三次验收
 |  |  |  |     //前端第三次验收
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -463,8 +464,14 @@ public class IoOrderReviewController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |         ioCheckInoutService.checkThird(orderEntity); |  |  |  |         ioCheckInoutService.checkThird(orderEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |         return ResultVOUtils.success("更新成功"); |  |  |  |         return ResultVOUtils.success("更新成功"); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     @Value("${REL_CODE_DELAY_SECONDS:7200}") | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     private Integer relCodeDelaySeconds; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     private RedisDelayedQueue redisDelayedQueue; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     // 异步处理阿里单据
 |  |  |  |     // 异步处理阿里单据
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     public BaseResponse aliBillsDispose( IoOrderEntity orderEntity) { |  |  |  |     public BaseResponse aliBillsDispose(IoOrderEntity orderEntity) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         ThreadUtil.execAsync(() -> { |  |  |  |         ThreadUtil.execAsync(() -> { | 
			
		
	
		
		
			
				
					
					|  |  |  |             //1.上传入库单
 |  |  |  |             //1.上传入库单
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             AlihealthYljgUploadinoutbillReqeust alihealthYljgUploadinoutbillReqeust = new AlihealthYljgUploadinoutbillReqeust(); |  |  |  |             AlihealthYljgUploadinoutbillReqeust alihealthYljgUploadinoutbillReqeust = new AlihealthYljgUploadinoutbillReqeust(); | 
			
		
	
	
		
		
			
				
					|  |  | @ -475,40 +482,34 @@ public class IoOrderReviewController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |             alihealthYljgUploadinoutbillReqeust.setPhysic_type(3); |  |  |  |             alihealthYljgUploadinoutbillReqeust.setPhysic_type(3); | 
			
		
	
		
		
			
				
					
					|  |  |  |             alihealthYljgUploadinoutbillReqeust.setClient_type("2"); |  |  |  |             alihealthYljgUploadinoutbillReqeust.setClient_type("2"); | 
			
		
	
		
		
			
				
					
					|  |  |  |             // 查询改单据传的码
 |  |  |  |             // 查询改单据传的码
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             List<IoCodeEntity> ioCodeEntityList  = ioCodeDao.selectList(new QueryWrapper<IoCodeEntity>().eq("orderId", orderEntity.getBillNo())); |  |  |  |             List<IoCodeEntity> ioCodeEntityList = ioCodeDao.selectList(new QueryWrapper<IoCodeEntity>().eq("orderId", orderEntity.getBillNo())); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             if(ioCodeEntityList!=null && ioCodeEntityList.size() >0){ |  |  |  |             if (ioCodeEntityList != null && ioCodeEntityList.size() > 0) { | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                 List<String> codeList = new ArrayList<>(); |  |  |  |                 List<String> codeList = new ArrayList<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 for (IoCodeEntity ioCodeEntity : ioCodeEntityList) { |  |  |  |                 for (IoCodeEntity ioCodeEntity : ioCodeEntityList) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     codeList.add(ioCodeEntity.getCode()); |  |  |  |                     codeList.add(ioCodeEntity.getCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |                 Set<String> set = new HashSet<>(codeList); |  |  |  |                 Set<String> set = new HashSet<>(codeList); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |                 alihealthYljgUploadinoutbillReqeust.setTrace_codes(String.join(",", codeList)); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 alihealthYljgUploadinoutbillReqeust.setTrace_codes( String.join(",", codeList)); |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                 // 单据上传先注释了
 |  |  |  |                 // 单据上传先注释了
 | 
			
		
	
		
		
			
				
					
					|  |  |  | //            BaseResponse baseResponseUploadinoutbill = alihealthYljgUtils.yljgUploadinoutbill(alihealthYljgUploadinoutbillReqeust,orderEntity.getFromCorp());
 |  |  |  | //            BaseResponse baseResponseUploadinoutbill = alihealthYljgUtils.yljgUploadinoutbill(alihealthYljgUploadinoutbillReqeust,orderEntity.getFromCorp());
 | 
			
		
	
		
		
			
				
					
					|  |  |  | //            if(baseResponseUploadinoutbill.getCode() == 20000){
 |  |  |  |                 log.error("要查询阿里关联关系的码===" + set); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | //                try {
 |  |  |  |                 String erpId = orderEntity.getFromCorp(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | //                    Thread.sleep(1000);
 |  |  |  |                 for (String code : set) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     log.error("要查询阿里关联关系的码==="+set); |  |  |  |                     relCodeBatchService.addRelCodeAli(code, orderEntity.getFromCorp()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     relCodeBatchService.addRelCodeAli(set, orderEntity.getFromCorp()); |  |  |  |                     RelCodeBatch relCodeBatch = relCodeBatchService.getOne( | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |                             new QueryWrapper<RelCodeBatch>().eq("curCode", code) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |                     ); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |                     if (Objects.isNull(relCodeBatch)) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | //
 |  |  |  |                         redisDelayedQueue.addTaskToQueue(code + "&&&" + erpId, relCodeDelaySeconds, "rel_code_queue"); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | //                } catch (InterruptedException e) {
 |  |  |  |                     } else { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | //                }
 |  |  |  |                         log.error("有关联关系了此码===" + code); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |                     } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | //            }else {
 |  |  |  |                 } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | //                log.error("阿里调用上传单据失败==="+baseResponseUploadinoutbill.getMessage());
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //            }
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |         }); |  |  |  |         }); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         return ResultVOUtils.success("更新成功"); |  |  |  |         return ResultVOUtils.success("更新成功"); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Resource |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |     SpsSyncDownloadService spsSyncDownloadService; |  |  |  |     SpsSyncDownloadService spsSyncDownloadService; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | 
 |