From dd033b96c11cb484a6b7b99381b9b7bc820307de Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期三, 21 八月 2024 17:11:24 +0800
Subject: [PATCH] 最新版本
---
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java | 71 +++++++++++++++++++++++++++++++++++
1 files changed, 71 insertions(+), 0 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 84fb6c9..a5ec104 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,17 +13,22 @@
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.PlatformJobMapper;
import com.doumee.dao.business.PlatformMapper;
+import com.doumee.dao.business.join.PlatformJobJoinMapper;
import com.doumee.dao.business.model.Platform;
import com.doumee.dao.business.model.PlatformBooks;
import com.doumee.dao.business.model.PlatformJob;
+import com.doumee.dao.business.model.PlatformReason;
import com.doumee.dao.web.reqeust.JobDetailDTO;
+import com.doumee.dao.web.reqeust.LineUpDetailDTO;
import com.doumee.dao.web.reqeust.SignInDTO;
import com.doumee.dao.web.response.DriverHomeVO;
+import com.doumee.dao.web.response.LineUpVO;
import com.doumee.service.business.PlatformJobService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -34,6 +39,7 @@
import java.util.Date;
import java.util.List;
import java.util.Objects;
+import java.util.stream.Collectors;
/**
* 鏈堝彴璋冨害浣滀笟淇℃伅琛⊿ervice瀹炵幇
@@ -45,6 +51,9 @@
@Autowired
private PlatformJobMapper platformJobMapper;
+
+ @Autowired
+ private PlatformJobJoinMapper platformJobJoinMapper;
@Autowired
private SystemDictDataBiz systemDictDataBiz;
@@ -328,7 +337,69 @@
+ @Override
+ public LineUpVO lineUpDetail(LineUpDetailDTO lineUpDetailDTO){
+ if(Objects.isNull(lineUpDetailDTO)
+ || Objects.isNull(lineUpDetailDTO.getQueryType())){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST);
+ }
+ LineUpVO lineUpVO = new LineUpVO();
+ //鏌ヨ鎵�鏈変换鍔�
+ List<PlatformJob> platformJobList = platformJobJoinMapper.selectJoinList(PlatformJob.class,
+ new MPJLambdaWrapper<PlatformJob>()
+ .selectAll(PlatformJob.class)
+ .selectAs(PlatformReason::getGroupId,PlatformJob::getGroupId)
+ .leftJoin(PlatformBooks.class,PlatformBooks::getJobId,PlatformJob::getId)
+ .leftJoin(PlatformReason.class,PlatformReason::getId,PlatformBooks::getReasonId)
+ .eq(PlatformJob::getIsdeleted,Constants.ZERO)
+ .eq(Constants.equalsInteger(lineUpDetailDTO.getQueryType(),Constants.ZERO)
+ ,PlatformJob::getDrivierPhone,lineUpDetailDTO.getMobile())
+ .eq(Constants.equalsInteger(lineUpDetailDTO.getQueryType(),Constants.ONE)
+ ,PlatformJob::getId,lineUpDetailDTO.getJobId())
+ .in(PlatformJob::getStatus,Constants.PlatformJobStatus.WAIT_CALL.getKey(),
+ Constants.PlatformJobStatus.IN_WAIT.getKey(),
+ Constants.PlatformJobStatus.CALLED.getKey())
+ .orderByAsc(PlatformJob::getSignDate)
+ );
+ //鑾峰彇鎵�鏈夋湀鍙�
+ List<Integer> platformIdList = platformJobList.stream().map(m->m.getGroupId()).collect(Collectors.toList());
+ List<Platform> platformList = platformMapper.selectList(new QueryWrapper<Platform>().lambda()
+ .eq(Platform::getIsdeleted,Constants.ZERO)
+ .in(Platform::getId,platformIdList));
+ for (Platform platform:platformList) {
+ //鏌ヨ鏈湀鍙颁笅 鑷繁鐨勬暟鎹� 鏈�鏃╃鍒扮殑
+ PlatformJob platformJob = platformJobList.stream().filter(i->Constants.equalsInteger(i.getGroupId(),platform.getId())).findFirst().orElse(null);
+ //鏌ヨ鍦ㄥ綋鍓嶆湀鍙颁笅 绛惧埌鎺掗槦杞﹁締鏁版嵁
+ List<PlatformJob> platformJobSignInList = platformJobJoinMapper.selectJoinList(PlatformJob.class,
+ new MPJLambdaWrapper<PlatformJob>()
+ .selectAll(PlatformJob.class)
+ .selectAs(PlatformReason::getGroupId,PlatformJob::getGroupId)
+ .leftJoin(PlatformBooks.class,PlatformBooks::getJobId,PlatformJob::getId)
+ .leftJoin(PlatformReason.class,PlatformReason::getId,PlatformBooks::getReasonId)
+ .eq(PlatformJob::getIsdeleted,Constants.ZERO)
+ .ge(Objects.nonNull(platformJob),PlatformJob::getSignDate,DateUtil.getDate(platformJob.getSignDate(),"yyyy-MM-dd HH:mm:ss"))
+ .in(PlatformJob::getStatus,Constants.PlatformJobStatus.WAIT_CALL.getKey(),
+ Constants.PlatformJobStatus.IN_WAIT.getKey(),
+ Constants.PlatformJobStatus.CALLED.getKey())
+ .orderByDesc(PlatformJob::getSignDate));
+ platform.setSignJobList(platformJobSignInList);
+ //鏌ヨ褰撳墠鏈堝彴涓�
+ List<PlatformJob> platformJobWorkList = platformJobJoinMapper.selectJoinList(PlatformJob.class,
+ new MPJLambdaWrapper<PlatformJob>()
+ .selectAll(PlatformJob.class)
+ .selectAs(PlatformReason::getGroupId,PlatformJob::getGroupId)
+ .leftJoin(PlatformBooks.class,PlatformBooks::getJobId,PlatformJob::getId)
+ .leftJoin(PlatformReason.class,PlatformReason::getId,PlatformBooks::getReasonId)
+ .eq(PlatformJob::getIsdeleted,Constants.ZERO)
+ .eq(PlatformJob::getStatus,Constants.PlatformJobStatus.WORKING.getKey())
+ .orderByDesc(PlatformJob::getSignDate));
+ platform.setSignJobList(platformJobSignInList);
+ platform.setWorkJobList(platformJobWorkList);
+ }
+ lineUpVO.setPlatformList(platformList);
+ return lineUpVO;
+ }
--
Gitblit v1.9.3