From f1d3e99f71f28d42861d6599b3f6190480f830db Mon Sep 17 00:00:00 2001 From: liukangdong <898885815@qq.com> Date: 星期四, 24 十月 2024 09:50:31 +0800 Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/dmvisit --- server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java | 62 ++++++++++++++++++++++++++----- 1 files changed, 52 insertions(+), 10 deletions(-) diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java index 87dcbb4..a708a19 100644 --- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java +++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java @@ -13,6 +13,9 @@ import com.doumee.core.model.LoginUserInfo; import com.doumee.core.model.PageData; import com.doumee.core.model.PageWrap; +import com.doumee.core.tms.model.request.TmsLockStatusQueryRequest; +import com.doumee.core.tms.model.response.TmsBaseResponse; +import com.doumee.core.tms.model.response.TmsLockStatusQueryResponse; import com.doumee.core.utils.*; import com.doumee.dao.business.*; import com.doumee.dao.business.join.PlatformJobJoinMapper; @@ -34,6 +37,7 @@ import com.doumee.service.business.impl.hksync.HkSyncPushServiceImpl; import com.doumee.service.business.impl.thrid.WmsServiceImpl; import com.doumee.service.business.third.EmayService; +import com.doumee.service.business.third.TmsService; import com.doumee.service.business.third.WmsService; import com.github.yulichang.wrapper.MPJLambdaWrapper; import lombok.extern.slf4j.Slf4j; @@ -63,6 +67,8 @@ @Autowired private PlatformJobMapper platformJobMapper; + @Autowired + private TmsService tmsService; @Autowired private PlatformDeviceMapper platformDeviceMapper; @@ -1176,7 +1182,7 @@ ); platformJob.setPlatformName(platform.getName()); - this.broadcastAndLEed(platformJob, StringUtils.isBlank(oldPlatform.getRemark())?Constants.PlatformLedContent.IDEL_CONTNET.getName():oldPlatform.getLedContent(), + this.broadcastAndLEed(platformJob, StringUtils.isBlank(oldPlatform.getLedContent())?Constants.PlatformLedContent.IDEL_CONTNET.getName():oldPlatform.getLedContent(), null ); @@ -1259,7 +1265,7 @@ ); platformJob.setPlatformName(platform.getName()); - this.broadcastAndLEed(platformJob, StringUtils.isBlank(platform.getRemark())?Constants.PlatformLedContent.IDEL_CONTNET.getName():platform.getLedContent(), + this.broadcastAndLEed(platformJob, StringUtils.isBlank(platform.getLedContent())?Constants.PlatformLedContent.IDEL_CONTNET.getName():platform.getLedContent(), null ); @@ -1353,14 +1359,42 @@ savePlatformLog(Constants.PlatformJobLogType.DONE.getKey(),oldPlatformJob,platformJob , Constants.PlatformJobLogType.DONE.getInfo()); - if(Constants.equalsInteger(platformJob.getType(),Constants.TWO)){ - //TODO 澶栧崗杞﹁璐� 鏌ヨTMS 鐢靛瓙閿佹儏鍐� + if(Constants.equalsInteger(platformJob.getType(),Constants.THREE)){ + // 澶栧崗杞﹁璐� 鏌ヨTMS 鐢靛瓙閿佹儏鍐� + List<PlatformWmsDetail> details = platformWmsDetailMapper.selectList(new QueryWrapper<PlatformWmsDetail>().lambda() + .eq(PlatformWmsDetail::getJobId,platformJob.getId()) + .eq(PlatformWmsDetail::getIsdeleted,Constants.ZERO) + ); + if(details!=null && details.size()>0){ + Date date = new Date(); + List<String> codeList =new ArrayList<>(); + for(PlatformWmsDetail d : details){ + codeList.add(d.getIocode()); + } + TmsLockStatusQueryRequest tmsLock = new TmsLockStatusQueryRequest(); + tmsLock.setContractNumbers(codeList); + TmsBaseResponse<List<TmsLockStatusQueryResponse>> lockResult = tmsService.lockStatusQuery(tmsLock); + if(lockResult!=null && lockResult.isSuccess()&& lockResult.getData()!=null ){ + for(TmsLockStatusQueryResponse s : lockResult.getData()){ + platformWmsDetailMapper.update(null,new UpdateWrapper<PlatformWmsDetail>().lambda() + .eq(PlatformWmsDetail::getIocode,s.getContractNumber()) + .set(PlatformWmsDetail::getEditDate,date) + .set(PlatformWmsDetail::getLockDate,s.getOutDate()) + .set(PlatformWmsDetail::getLockStatus,Constants.ONE) + .eq(PlatformWmsDetail::getJobId,platformJob.getId()) + .eq(PlatformWmsDetail::getIsdeleted,Constants.ZERO)); + } + } + } }else if(Constants.equalsInteger(platformJob.getType(),Constants.ONE) || Constants.equalsInteger(platformJob.getType(),Constants.FOUR)){ //TODO 澶栧崗杞﹀嵏璐� 鎴栬�� 甯傚叕鍙歌溅鍗歌揣 鍒欐牴鎹换鍔℃儏鍐� } - + + + + //鍙戦�佺煭淇′俊鎭� SmsEmailServiceImpl.sendPlatformJobSms(systemDictDataBiz, emayService,smsEmailMapper,smsConfigMapper,platformJobMapper,platformJob.getId(), @@ -1637,11 +1671,15 @@ //鑾峰彇鏈堝彴涓嬬殑鎵�鏈変綔涓氭暟鎹� List<PlatformJob> platformJobList = platformJobJoinMapper.selectJoinList(PlatformJob.class,new MPJLambdaWrapper<PlatformJob>() .selectAll(PlatformJob.class) + .select(" ( select pl.CREATE_DATE from platform_log pl where t.id = pl.obj_id and pl.OBJ_TYPE = 5 order by pl.CREATE_DATE desc limit 1 ) as newStartDate ") + .select(" ( select pl.CREATE_DATE from platform_log pl where t.id = pl.obj_id and pl.OBJ_TYPE = 4 order by pl.CREATE_DATE desc limit 1 ) as newCallDate ") .selectAs(Platform::getName,PlatformJob::getPlatformName) .selectAs(Platform::getWorkRate,PlatformJob::getWorkRate) .selectAs(PlatformWmsJob::getCarrierName,PlatformJob::getCarrierName) + .selectAs(PlatformBooks::getId,PlatformJob::getBookId) .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId) .leftJoin(PlatformWmsJob.class,PlatformWmsJob::getJobId,PlatformJob::getId) + .leftJoin(PlatformBooks.class,PlatformBooks::getJobId,PlatformJob::getId) .eq(PlatformJob::getIsdeleted,Constants.ZERO) .in(PlatformJob::getStatus, Constants.PlatformJobStatus.WAIT_CALL.getKey(), @@ -1998,7 +2036,8 @@ List<PlatformJob> platformJobList = platformJobJoinMapper.selectJoinList(PlatformJob.class,new MPJLambdaWrapper<PlatformJob>() .selectAll(PlatformJob.class) .selectAs(Platform::getName,PlatformJob::getPlatformName) - .select(" ( now() > DATE_ADD( ( select pl.CREATE_DATE from platform_log pl where t.id = pl.obj_id and pl.OBJ_TYPE = 4 order by pl.CREATE_DATE desc limit 1 ) ,INTERVAL t2.WAIT_CALL_TIME MINUTE) ) as isTimeOut ") + .select(" ( now() >= DATE_ADD( ( select pl.CREATE_DATE from platform_log pl where t.id = pl.obj_id and pl.OBJ_TYPE = 4 " + + "order by pl.CREATE_DATE desc limit 1 ) ,INTERVAL t2.WAIT_CALL_TIME MINUTE) ) as isTimeOut ") .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId) .leftJoin(PlatformGroup.class,PlatformGroup::getId,Platform::getGroupId) .eq(PlatformJob::getStatus,Constants.PlatformJobStatus.CALLED.getKey()) @@ -2006,10 +2045,13 @@ ); //濡傛灉瓒呮椂 澶勭悊鏁版嵁 骞跺彂閫乴ed涓庡箍鎾� for (PlatformJob platformJob:platformJobList) { - JobOperateDTO jobOperateDTO = new JobOperateDTO(); - jobOperateDTO.setJobId(platformJob.getId()); - this.platformOverNumber(jobOperateDTO); - this.cancelInPark(platformJob); + if(Constants.equalsInteger(platformJob.getIsTimeOut(),Constants.ONE)){ + JobOperateDTO jobOperateDTO = new JobOperateDTO(); + jobOperateDTO.setJobId(platformJob.getId()); + this.platformOverNumber(jobOperateDTO); + this.cancelInPark(platformJob); + } + } } -- Gitblit v1.9.3