From 4e45a8252d7bccd23a1a57aa541a2ea521760572 Mon Sep 17 00:00:00 2001 From: liukangdong <898885815@qq.com> Date: 星期一, 21 十月 2024 15:39:04 +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 | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 50 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 30c9d7c..a2b09a9 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; @@ -336,7 +342,7 @@ " ( " + " ( t.`STATUS` = "+Constants.PlatformJobStatus.WAIT_CALL.getKey()+" and t.PLATFORM_GROUP_ID = ( SELECT p.group_id FROM platform p WHERE p.id = "+pageWrap.getModel().getPlatformId()+" LIMIT 1 ) )" + " or " + - " (t.`STATUS` = "+Constants.PlatformJobStatus.IN_WAIT.getKey()+" and t.PLATFORM_ID = "+pageWrap.getModel().getPlatformId()+" )" + + " (t.`STATUS` = "+Constants.PlatformJobStatus.IN_WAIT.getKey()+" and t.PLATFORM_GROUP_ID = ( SELECT p.group_id FROM platform p WHERE p.id = "+pageWrap.getModel().getPlatformId()+" LIMIT 1 ) )" + " or " + " (t.`STATUS` = "+Constants.PlatformJobStatus.TRANSFERING.getKey()+" and t.PLATFORM_ID = "+pageWrap.getModel().getPlatformId()+" ) " + ") " @@ -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 ); @@ -1257,6 +1263,12 @@ emayService,smsEmailMapper,smsConfigMapper,platformJobMapper,platformJob.getId(), SmsConstants.platformJobContent.platformJobError,platform.getName(),null ); + + platformJob.setPlatformName(platform.getName()); + this.broadcastAndLEed(platformJob, StringUtils.isBlank(platform.getLedContent())?Constants.PlatformLedContent.IDEL_CONTNET.getName():platform.getLedContent(), + null + ); + } @@ -1347,23 +1359,50 @@ 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(), SmsConstants.platformJobContent.platformJobFinish,platform.getName(),null ); - //骞挎挱 led閫氱煡 platformJob.setPlatformName(platform.getName()); - this.broadcastAndLEed(platformJob,null, + this.broadcastAndLEed(platformJob,Constants.PlatformLedContent.DONE.getInfo(), Constants.PlatformBroadcastContent.DONE.getInfo()); return platformJob; } @@ -1637,7 +1676,6 @@ .selectAs(PlatformWmsJob::getCarrierName,PlatformJob::getCarrierName) .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId) .leftJoin(PlatformWmsJob.class,PlatformWmsJob::getJobId,PlatformJob::getId) - .eq(PlatformJob::getPlatformId,platformId) .eq(PlatformJob::getIsdeleted,Constants.ZERO) .in(PlatformJob::getStatus, Constants.PlatformJobStatus.WAIT_CALL.getKey(), @@ -1645,9 +1683,9 @@ Constants.PlatformJobStatus.CALLED.getKey(), Constants.PlatformJobStatus.WORKING.getKey(), Constants.PlatformJobStatus.EXCEPTION.getKey(), - Constants.PlatformJobStatus.OVER_NUMBER.getKey() + Constants.PlatformJobStatus.OVER_NUMBER.getKey(), + Constants.PlatformJobStatus.TRANSFERING.getKey() ) - .like(PlatformJob::getArriveDate, DateUtil.getCurrDate()) .orderByDesc(PlatformJob::getId) ); for (PlatformJob platformJob:platformJobList) { @@ -2049,4 +2087,6 @@ } + + } -- Gitblit v1.9.3