From eb275c6d06d3c27fd30bbf4975d27c93d7f56eb2 Mon Sep 17 00:00:00 2001 From: jiangping <jp@doumee.com> Date: 星期二, 10 十二月 2024 18:29:03 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java | 180 ++++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 150 insertions(+), 30 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 0145eaa..d1811f2 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 @@ -17,7 +17,10 @@ import com.doumee.core.tms.model.response.TmsBaseResponse; import com.doumee.core.tms.model.response.TmsLockStatusQueryResponse; import com.doumee.core.utils.*; +import com.doumee.core.wx.wxPlat.WxPlatConstants; +import com.doumee.core.wx.wxPlat.WxPlatNotice; import com.doumee.dao.business.*; +import com.doumee.dao.business.dao.SmsConfigMapper; import com.doumee.dao.business.dao.SmsEmailMapper; import com.doumee.dao.business.join.PlatformJobJoinMapper; import com.doumee.dao.business.join.PlatformJoinMapper; @@ -46,6 +49,7 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; @@ -54,6 +58,7 @@ import java.math.RoundingMode; import java.util.*; import java.util.Date; +import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; /** @@ -117,6 +122,10 @@ private PlatformBroadcastLogMapper platformBroadcastLogMapper; @Autowired private PlatformWarnEventServiceImpl platformWarnEventService; + @Autowired + private MemberMapper memberMapper; + @Autowired + private WxNoticeConfigMapper wxNoticeConfigMapper; @Override public Integer create(PlatformJob platformJob) { @@ -321,6 +330,7 @@ .selectAs(Platform::getName,PlatformJob::getPlatformName) .selectAs(Platform::getWorkRate,PlatformJob::getWorkRate) .selectAs(PlatformWmsJob::getCarrierName,PlatformJob::getCarrierName) + .select(" case when t.total_num is null then ( select sum(pwd.IO_QTY) from platform_wms_detail pwd where pwd.JOB_ID = t.id ) else t.total_num end ioQty ") .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId) .leftJoin(PlatformWmsJob.class,PlatformWmsJob::getCarryBillCode,PlatformJob::getBillCode) .leftJoin(PlatformBooks.class,PlatformBooks::getJobId,PlatformJob::getId) @@ -362,8 +372,9 @@ IPage<PlatformJob> platformJobIPage = platformJobJoinMapper.selectJoinPage(page,PlatformJob.class,queryWrapper); platformJobIPage.getRecords().forEach(i->{ i.dealTime(); - this.getWmsJobData(i); - this.queryWaitNum(i); + i.setTotalNum(i.getIoQty()); +// this.getWmsJobData(i); +// this.queryWaitNum(i); }); return PageData.from(platformJobIPage); } @@ -374,7 +385,6 @@ || Constants.equalsInteger(platformJob.getType(),Constants.platformJobType.zyczh) || Constants.equalsInteger(platformJob.getType(),Constants.platformJobType.wxcxh) || Constants.equalsInteger(platformJob.getType(),Constants.platformJobType.wxczh)) { - PlatformWmsJob platformWmsJob = platformWmsJobMapper.selectOne(new QueryWrapper<PlatformWmsJob>().lambda() .eq(PlatformWmsJob::getIsdeleted,Constants.ZERO) .eq(PlatformWmsJob::getJobId,platformJob.getId()) @@ -406,11 +416,7 @@ }else{ platformJob.setLockStatus(Constants.ONE); //閮ㄥ垎涓婇攣 } - } - - - } } } @@ -441,7 +447,8 @@ sumWorkRate = sumWorkRate.add(linePlatformJob.getTotalNum()); } //璁$畻棰勮绛夊緟鏃堕棿 - List<Platform> platformList = platformJoinMapper.selectList(new QueryWrapper<Platform>().lambda().eq(Platform::getIsdeleted,Constants.ZERO).eq(Platform::getGroupId,platformJob.getPlatformGroupId())); + List<Platform> platformList = platformJoinMapper.selectList(new QueryWrapper<Platform>().lambda() + .eq(Platform::getIsdeleted,Constants.ZERO).eq(Platform::getGroupId,platformJob.getPlatformGroupId())); BigDecimal workRate = platformList.stream().map(m->m.getWorkRate()).reduce(BigDecimal.ZERO,BigDecimal::add); if(sumWorkRate.compareTo(BigDecimal.ZERO) > Constants.ZERO && workRate.compareTo(BigDecimal.ZERO) > Constants.ZERO ){ BigDecimal sumMinute = sumWorkRate.divide(workRate,1, RoundingMode.HALF_DOWN).multiply(BigDecimal.valueOf(60L)); @@ -646,11 +653,11 @@ } public void sceneSignIn(SignInDTO signInDTO){ - if( StringUtils.isNotBlank(signInDTO.getQrCodeKey())){ throw new BusinessException(ResponseStatus.BAD_REQUEST); } - if(!signInDTO.getQrCodeKey().equals(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_QRCODE).getCode())){ + if(!signInDTO.getQrCodeKey().equals( + systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_QRCODE_PREFIX).getCode() + systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_QRCODE).getCode())){ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"浜岀淮鐮佸凡杩囨湡,璇峰埛鏂伴噸璇�"); } } @@ -695,7 +702,7 @@ } } platformJob.dealTime(); - this.getWorkTime(platformJob); + this.getWorkTime(platformJob,platformLogMapper); this.getWmsJobData(platformJob); return platformJob; } @@ -777,7 +784,7 @@ * 鑾峰彇宸蹭綔涓氭椂闂� * @param platformJob */ - public Long getWorkTime(PlatformJob platformJob){ + public static Long getWorkTime(PlatformJob platformJob,PlatformLogMapper platformLogMapper){ List<PlatformLog> platformLogList = platformLogMapper.selectList(new QueryWrapper<PlatformLog>() .lambda().eq(PlatformLog::getIsdeleted,Constants.ZERO) .eq(PlatformLog::getJobId,platformJob.getId()) @@ -800,7 +807,7 @@ .last(" limit 1 ") ); if(Objects.nonNull(lastBeginPlatform)){ - String v = Long.toString(System.currentTimeMillis() - lastBeginPlatform.getCreateDate().getTime() / 1000) ; + String v = Long.toString((System.currentTimeMillis() - lastBeginPlatform.getCreateDate().getTime() )/ 1000) ; optTime = optTime + Long.valueOf(v); } } @@ -861,6 +868,20 @@ emayService,smsEmailMapper,smsConfigMapper,platformJobMapper,platformJob.getId(), SmsConstants.platformJobContent.platformJobCallIn,null,null ); + + //鍏紬鍙锋ā鏉挎秷鎭� + if(Objects.nonNull(platformJob.getDriverId())) { + Member member = memberMapper.selectById(platformJob.getDriverId()); + if (Objects.nonNull(member) && StringUtils.isNotBlank(member.getOpenid())) { + WxPlatNotice wxPlatNotice = new WxPlatNotice(); + wxPlatNotice.sendPlatformJobTemplateNotice( + wxNoticeConfigMapper, platformJob, + WxPlatConstants.platformJobContent.platformJobCallIn, + systemDictDataBiz.queryByCode(Constants.WX_PLATFORM, Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), + Arrays.asList(member.getOpenid().split(",")) + ); + } + } return platformJob; } @@ -966,6 +987,7 @@ public void cancelInPark(PlatformJob platformJob){ if(Constants.equalsInteger(platformJob.getType(),Constants.TWO) || Constants.equalsInteger(platformJob.getType(),Constants.THREE) + || StringUtils.isBlank(platformJob.getCarCodeFront()) || Constants.equalsInteger(platformJob.getType(),Constants.FOUR)){ List<VisitPark> visitParkList = visitParkMapper.selectList(new QueryWrapper<VisitPark>().lambda() @@ -973,6 +995,8 @@ .eq(VisitPark::getObjType,Constants.ONE) .eq(VisitPark::getHkStatus,Constants.ONE) .isNotNull(VisitPark::getHkId) + .apply(" END_TIME > now() ") + .orderByDesc(VisitPark::getCreateDate) ); if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(visitParkList)){ for (VisitPark visitPark:visitParkList) { @@ -1055,6 +1079,21 @@ emayService,smsEmailMapper,smsConfigMapper,platformJobMapper,platformJob.getId(), SmsConstants.platformJobContent.platformJobSingIn,platform.getName(),null ); + + //鍏紬鍙锋ā鏉挎秷鎭� + if(Objects.nonNull(platformJob.getDriverId())){ + Member member = memberMapper.selectById(platformJob.getDriverId()); + if(Objects.nonNull(member) && StringUtils.isNotBlank(member.getOpenid())){ + WxPlatNotice wxPlatNotice = new WxPlatNotice(); + wxPlatNotice.sendPlatformJobTemplateNotice( + wxNoticeConfigMapper,platformJob, + WxPlatConstants.platformJobContent.platformJobSingIn, + systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), + Arrays.asList(member.getOpenid().split(",")) + ); + } + } + //骞挎挱 led閫氱煡 platformJob.setPlatformName(platform.getName()); @@ -1186,6 +1225,20 @@ SmsConstants.platformJobContent.platformJobMove,oldPlatform.getName(),platform.getName() ); + //鍏紬鍙锋ā鏉挎秷鎭� + if(Objects.nonNull(platformJob.getDriverId())) { + Member member = memberMapper.selectById(platformJob.getDriverId()); + if (Objects.nonNull(member) && StringUtils.isNotBlank(member.getOpenid())) { + WxPlatNotice wxPlatNotice = new WxPlatNotice(); + wxPlatNotice.sendPlatformJobTemplateNotice( + wxNoticeConfigMapper, platformJob, + WxPlatConstants.platformJobContent.platformJobMove, + systemDictDataBiz.queryByCode(Constants.WX_PLATFORM, Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), + Arrays.asList(member.getOpenid().split(",")) + ); + } + } + platformJob.setPlatformName(oldPlatform.getName()); platformJob.setPlatformId(oldPlatform.getId()); this.broadcastAndLEed(platformJob, StringUtils.isBlank(oldPlatform.getLedContent())?Constants.PlatformLedContent.IDEL_CONTNET.getName():oldPlatform.getLedContent(), @@ -1209,9 +1262,16 @@ if(Objects.isNull(platformJob)){ throw new BusinessException(ResponseStatus.DATA_EMPTY); } + if(!Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.CALLED.getKey())){ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧�,涓氬姟鐘舵�佸凡娴佽浆锛�"); } + + Platform platform = platformJoinMapper.selectById(platformJob.getPlatformId()); + if(Objects.isNull(platform)){ + throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈠埌鏈堝彴淇℃伅"); + } + PlatformJob oldPlatformJob = new PlatformJob(); BeanUtils.copyProperties(platformJob,oldPlatformJob); @@ -1227,6 +1287,24 @@ SmsConstants.platformJobContent.platformJobOverNum,null,null ); + //鍏紬鍙锋ā鏉挎秷鎭� + if(Objects.nonNull(platformJob.getDriverId())){ + Member member = memberMapper.selectById(platformJob.getDriverId()); + if(Objects.nonNull(member) && StringUtils.isNotBlank(member.getOpenid())){ + WxPlatNotice wxPlatNotice = new WxPlatNotice(); + wxPlatNotice.sendPlatformJobTemplateNotice( + wxNoticeConfigMapper,platformJob, + WxPlatConstants.platformJobContent.platformJobOverNum, + systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), + Arrays.asList(member.getOpenid().split(",")) + ); + } + } + + platformJob.setPlatformName(platform.getName()); + this.broadcastAndLEed(platformJob, StringUtils.isBlank(platform.getLedContent())?Constants.PlatformLedContent.IDEL_CONTNET.getName():platform.getLedContent(), + null + ); return platformJob; } @@ -1269,6 +1347,20 @@ emayService,smsEmailMapper,smsConfigMapper,platformJobMapper,platformJob.getId(), SmsConstants.platformJobContent.platformJobError,platform.getName(),null ); + + //鍏紬鍙锋ā鏉挎秷鎭� + if(Objects.nonNull(platformJob.getDriverId())) { + Member member = memberMapper.selectById(platformJob.getDriverId()); + if (Objects.nonNull(member) && StringUtils.isNotBlank(member.getOpenid())) { + WxPlatNotice wxPlatNotice = new WxPlatNotice(); + wxPlatNotice.sendPlatformJobTemplateNotice( + wxNoticeConfigMapper, platformJob, + WxPlatConstants.platformJobContent.platformJobError, + systemDictDataBiz.queryByCode(Constants.WX_PLATFORM, Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), + Arrays.asList(member.getOpenid().split(",")) + ); + } + } platformJob.setPlatformName(platform.getName()); this.broadcastAndLEed(platformJob, StringUtils.isBlank(platform.getLedContent())?Constants.PlatformLedContent.IDEL_CONTNET.getName():platform.getLedContent(), @@ -1319,7 +1411,19 @@ emayService,smsEmailMapper,smsConfigMapper,platformJobMapper,platformJob.getId(), SmsConstants.platformJobContent.platformJobWorking,platform.getName(),null ); - + //鍏紬鍙锋ā鏉挎秷鎭� + if(Objects.nonNull(platformJob.getDriverId())) { + Member member = memberMapper.selectById(platformJob.getDriverId()); + if (Objects.nonNull(member) && StringUtils.isNotBlank(member.getOpenid())) { + WxPlatNotice wxPlatNotice = new WxPlatNotice(); + wxPlatNotice.sendPlatformJobTemplateNotice( + wxNoticeConfigMapper, platformJob, + WxPlatConstants.platformJobContent.platformJobWorking, + systemDictDataBiz.queryByCode(Constants.WX_PLATFORM, Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), + Arrays.asList(member.getOpenid().split(",")) + ); + } + } //骞挎挱 led閫氱煡 platformJob.setPlatformName(platform.getName()); this.broadcastAndLEed(platformJob,Constants.PlatformLedContent.WORKING.getInfo(), @@ -1404,6 +1508,21 @@ emayService,smsEmailMapper,smsConfigMapper,platformJobMapper,platformJob.getId(), SmsConstants.platformJobContent.platformJobFinish,platform.getName(),null ); + + //鍏紬鍙锋ā鏉挎秷鎭� + if(Objects.nonNull(platformJob.getDriverId())) { + Member member = memberMapper.selectById(platformJob.getDriverId()); + if (Objects.nonNull(member) && StringUtils.isNotBlank(member.getOpenid())) { + WxPlatNotice wxPlatNotice = new WxPlatNotice(); + wxPlatNotice.sendPlatformJobTemplateNotice( + wxNoticeConfigMapper, platformJob, + WxPlatConstants.platformJobContent.platformJobFinish, + systemDictDataBiz.queryByCode(Constants.WX_PLATFORM, Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), + Arrays.asList(member.getOpenid().split(",")) + ); + } + } + //骞挎挱 led閫氱煡 platformJob.setPlatformName(platform.getName()); this.broadcastAndLEed(platformJob,Constants.PlatformLedContent.DONE.getInfo(), @@ -1673,10 +1792,11 @@ @Override public PlatformWorkVO getPlatformWorkVOById(Integer platformId){ //鑾峰彇鏈堝彴涓嬬殑鎵�鏈変綔涓氭暟鎹� - List<PlatformJob> platformJobList = platformJobJoinMapper.selectJoinList(PlatformJob.class,new MPJLambdaWrapper<PlatformJob>() + List<PlatformJob> allPlatformJobList = 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 ") + .select(" ( select pl.CREATE_DATE from platform_log pl where t.id = pl.obj_id and pl.OBJ_TYPE = "+Constants.PlatformJobLogType.WORKING.getKey()+" 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 = "+Constants.PlatformJobLogType.CALLED.getKey()+" order by pl.CREATE_DATE desc limit 1 ) as newCallDate ") + .select(" case when t.total_num is null then ( select sum(pwd.IO_QTY) from platform_wms_detail pwd where pwd.JOB_ID = t.id ) else t.total_num end ioQty ") .selectAs(Platform::getName,PlatformJob::getPlatformName) .selectAs(Platform::getWorkRate,PlatformJob::getWorkRate) .selectAs(PlatformWmsJob::getCarrierName,PlatformJob::getCarrierName) @@ -1696,13 +1816,13 @@ ) .orderByDesc(PlatformJob::getId) ); - for (PlatformJob platformJob:platformJobList) { - //澶勭悊WSM鏁伴噺 - this.getWmsJobData(platformJob); - //鏌ヨ鍓嶆柟鎺掗槦鏁伴噺 - this.queryWaitNum(platformJob); - } - PlatformWorkVO platformWorkVO = PlatformGroupServiceImpl.getPlatformWorkVO(platformJoinMapper.selectById(platformId),platformJobList); +// List<PlatformJob> platformJobList = allPlatformJobList.stream().filter(i->Constants.equalsInteger(i.getPlatformId(),platformId)).collect(Collectors.toList()); +// for (PlatformJob platformJob:platformJobList) { +// platformJob.setTotalNum(platformJob.getIoQty()); +// //鏌ヨ鍓嶆柟鎺掗槦鏁伴噺 +// this.queryWaitNum(platformJob); +// } + PlatformWorkVO platformWorkVO = PlatformGroupServiceImpl.getPlatformWorkVO(platformJoinMapper.selectById(platformId),allPlatformJobList); return platformWorkVO; } @@ -1754,8 +1874,8 @@ .selectAs(Platform::getWorkRate, PlatformJob::getWorkRate) .selectAs(Platform::getName, PlatformJob::getPlatformName) .select(" case when t.total_num is null then ( select sum(pwd.IO_QTY) from platform_wms_detail pwd where pwd.JOB_ID = t.id ) else t.total_num end workNum ") - .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 ") + .select(" ( select pl.CREATE_DATE from platform_log pl where t.id = pl.obj_id and pl.OBJ_TYPE = "+Constants.PlatformJobLogType.WORKING.getKey()+" 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 = "+Constants.PlatformJobLogType.CALLED.getKey()+" order by pl.CREATE_DATE desc limit 1 ) as newCallDate ") .leftJoin(Platform.class, Platform::getId, PlatformJob::getPlatformId) .eq(PlatformJob::getStatus, Constants.PlatformJobStatus.WORKING.getKey()) .eq(PlatformJob::getPlatformId, platform.getId()) @@ -1955,8 +2075,8 @@ .selectAs(Platform::getName,PlatformJob::getPlatformName) .selectAs(PlatformGroup::getWaitCallTime,PlatformJob::getWorktimeOutAlarmTime) .select(" case when t.total_num is null then ( select sum(pwd.IO_QTY) from platform_wms_detail pwd where pwd.JOB_ID = t.id ) else t.total_num end workNum ") - .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 ") + .select(" ( select pl.CREATE_DATE from platform_log pl where t.id = pl.obj_id and pl.OBJ_TYPE = "+Constants.PlatformJobLogType.WORKING.getKey()+" 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 = "+Constants.PlatformJobLogType.CALLED.getKey()+" order by pl.CREATE_DATE desc limit 1 ) as newCallDate ") .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId) .leftJoin(PlatformGroup.class,PlatformGroup::getId,Platform::getGroupId) .eq(PlatformJob::getIsdeleted,Constants.ZERO) @@ -2040,7 +2160,7 @@ 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 " + + .select(" ( now() >= DATE_ADD( ( select pl.CREATE_DATE from platform_log pl where t.id = pl.obj_id and pl.OBJ_TYPE = "+Constants.PlatformJobLogType.CALLED.getKey()+" " + "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) @@ -2072,7 +2192,7 @@ .selectAs(Platform::getWorkRate, PlatformJob::getWorkRate) .selectAs(Platform::getWorkTimeoutAlarmTime, PlatformJob::getWorktimeOutAlarmTime) .select(" case when t.total_num is null then ( select sum(pwd.IO_QTY) from platform_wms_detail pwd where pwd.JOB_ID = t.id ) else t.total_num end workNum ") - .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 = "+Constants.PlatformJobLogType.WORKING.getKey()+" order by pl.CREATE_DATE desc limit 1 ) as newStartDate ") .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId) .eq(PlatformJob::getStatus,Constants.PlatformJobStatus.WORKING.getKey()) .eq(PlatformJob::getInOut,Constants.ONE) -- Gitblit v1.9.3