| | |
| | | Date date = new Date(); |
| | | List<String> codeList =new ArrayList<>(); |
| | | for(PlatformWmsDetail d : details){ |
| | | codeList.add(d.getContractNum()); |
| | | if(StringUtils.isNotBlank(d.getContractNum())){ |
| | | if(StringUtils.isNotBlank(d.getContractNum())){ |
| | | codeList.add(d.getContractNum()); |
| | | } |
| | | } |
| | | } |
| | | TmsLockStatusQueryRequest tmsLock = new TmsLockStatusQueryRequest(); |
| | | tmsLock.setContractNumbers(codeList); |
| | | List<Integer> jobIds = new ArrayList<>(); |
| | | TmsBaseResponse<List<TmsLockStatusQueryResponse>> lockResult = tmsService.lockStatusQuery(tmsLock); |
| | | if(lockResult!=null && lockResult.getCode()!=null && lockResult.getCode().equals("0")&& lockResult.getData()!=null ){ |
| | | for(TmsLockStatusQueryResponse s : lockResult.getData()){ |
| | | try { |
| | | //异常处理,能处理一个是一个 |
| | | platformWmsDetailMapper.update(null,new UpdateWrapper<PlatformWmsDetail>().lambda() |
| | | .eq(PlatformWmsDetail::getContractNum,s.getContractNumber()) |
| | | .set(PlatformWmsDetail::getEditDate,date) |
| | | .set(PlatformWmsDetail::getLockDate,s.getOutDate()) |
| | | .set(PlatformWmsDetail::getLockStatus,Constants.ONE) |
| | | .eq(PlatformWmsDetail::getIsdeleted,Constants.ZERO)); |
| | | PlatformWmsDetail job = getJobByContractnumFromDetail(s.getContractNumber(),details); |
| | | if(job != null){ |
| | | jobIds.add(job.getJobId()); |
| | | if(codeList.size()>0){ |
| | | TmsLockStatusQueryRequest tmsLock = new TmsLockStatusQueryRequest(); |
| | | tmsLock.setContractNumbers(codeList); |
| | | TmsBaseResponse<List<TmsLockStatusQueryResponse>> lockResult = tmsService.lockStatusQuery(tmsLock); |
| | | if(lockResult!=null && lockResult.getCode()!=null && lockResult.getCode().equals("0")&& lockResult.getData()!=null ){ |
| | | for(TmsLockStatusQueryResponse s : lockResult.getData()){ |
| | | try { |
| | | //异常处理,能处理一个是一个 |
| | | platformWmsDetailMapper.update(null,new UpdateWrapper<PlatformWmsDetail>().lambda() |
| | | .eq(PlatformWmsDetail::getContractNum,s.getContractNumber()) |
| | | .set(PlatformWmsDetail::getEditDate,date) |
| | | .set(PlatformWmsDetail::getLockDate,s.getOutDate()) |
| | | .set(PlatformWmsDetail::getLockStatus,Constants.ONE) |
| | | .eq(PlatformWmsDetail::getIsdeleted,Constants.ZERO)); |
| | | PlatformWmsDetail job = getJobByContractnumFromDetail(s.getContractNumber(),details); |
| | | if(job != null){ |
| | | jobIds.add(job.getJobId()); |
| | | } |
| | | }catch (Exception e){ |
| | | logger.error("=============更新电子锁状态信息异常:"+e.getMessage()); |
| | | } |
| | | }catch (Exception e){ |
| | | logger.error("=============更新电子锁状态信息异常:"+e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | |
| | | .in(PlatformJob::getId,jobIdList) |
| | | ); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(platformJobList)){ |
| | | |
| | | platformJobMapper.update(null,new UpdateWrapper<PlatformJob>().lambda() |
| | | .set(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE.getKey()) |
| | | .set(PlatformJob::getDoneDate,new Date()) |