From d3767d594de66cb5f9d1294931acefea1866f783 Mon Sep 17 00:00:00 2001
From: renkang <8417338+k94314517@user.noreply.gitee.com>
Date: 星期五, 24 一月 2025 18:24:25 +0800
Subject: [PATCH] 客户资料 巡检任务业务
---
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwProjectServiceImpl.java | 29 ++++++++++++++++++++++++++---
1 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwProjectServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwProjectServiceImpl.java
index 2e0587a..36cda9c 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwProjectServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwProjectServiceImpl.java
@@ -23,6 +23,7 @@
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.checkerframework.checker.units.qual.A;
import org.springframework.beans.BeanUtils;
@@ -140,7 +141,21 @@
@Override
public YwProject findById(Integer id) {
- return ywProjectMapper.selectById(id);
+ YwProject ywProject = ywProjectMapper.selectById(id);
+ if(Objects.isNull(ywProject)){
+ throw new BusinessException(ResponseStatus.DATA_EMPTY);
+ }
+ if(Objects.nonNull(ywProject.getAreaId())){
+ Areas a = areasService.findById(ywProject.getAreaId(),Constants.TWO);
+ if(a != null){
+ ywProject.setAreaName(a.getName());
+ ywProject.setCityId(a.getCityId());
+ ywProject.setCityName(a.getCityName());
+ ywProject.setProvinceId(a.getProvinceId());
+ ywProject.setProvinceName(a.getProvinceName());
+ }
+ }
+ return ywProject;
}
@Override
@@ -279,7 +294,15 @@
projectDataVOList.add(projectDataVO);
}
- List<YwRoom> ywRoomList = ywRoomMapper.selectList(new QueryWrapper<YwRoom>().lambda()
+ List<YwRoom> ywRoomList = ywRoomMapper.selectJoinList(YwRoom.class,new MPJLambdaWrapper<YwRoom>()
+ .selectAll(YwRoom.class)
+// .select(" ( SELECT count(1) FROM yw_contract y1 " +
+// " left join yw_contract_room y2 on y1.id = y2.contract_id " +
+// " where 1 = 1 and y2.type = 0 and y1.`STATUS` in( 0,1,2) " +
+// " and y1.START_DATE < now() and y1.END_DATE > now() and y2.ROOM_ID = yw_room.id ) as investmentStatus ")
+ .select(" ifnull( ( select case when y1.status = 3 then now() BETWEEN y1.START_DATE and y1.BT_DATE else now() BETWEEN y1.START_DATE and y1.END_DATE END " +
+ "from yw_contract y1 left join yw_contract_room y2 on y1.id = y2.CONTRACT_ID and y2.TYPE = 0 " +
+ "where y1.`STATUS` <> 4 and y2.room_id = t.id order by y1.create_date desc limit 1 ) ,0) ",YwRoom::getLeaseStatus)
.eq(YwRoom::getIsdeleted,Constants.ZERO)
.eq(YwRoom::getStatus,Constants.ZERO)
.eq(YwRoom::getIsInvestment,Constants.ONE)
@@ -302,13 +325,13 @@
projectDataVO.setArea(data.getRentArea().setScale(2, BigDecimal.ROUND_HALF_UP));
projectDataVO.setPId(data.getFloor());
projectDataVO.setLv(Constants.THREE);
+ projectDataVO.setLeaseStatus(data.getLeaseStatus());
projectDataVOList.add(projectDataVO);
}
ProjectTree treeBuild = new ProjectTree(projectDataVOList);
projectDataVOList = treeBuild.buildTree();
return projectDataVOList;
-
}
--
Gitblit v1.9.3