From 0a99001be87811ebb884b8f3f491f48054a22330 Mon Sep 17 00:00:00 2001
From: renkang <8417338+k94314517@user.noreply.gitee.com>
Date: 星期二, 13 五月 2025 17:29:00 +0800
Subject: [PATCH] 客户资料 巡检任务业务
---
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractRevenueServiceImpl.java | 191 +++++++++++++++++++++++++++++++++++------------
1 files changed, 142 insertions(+), 49 deletions(-)
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractRevenueServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractRevenueServiceImpl.java
index d637c75..a462929 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractRevenueServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractRevenueServiceImpl.java
@@ -1,11 +1,13 @@
package com.doumee.service.business.impl;
+import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
import com.doumee.core.model.LoginUserInfo;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Constants;
+import com.doumee.core.utils.DateUtil;
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.*;
import com.doumee.dao.business.dao.CompanyMapper;
@@ -22,16 +24,14 @@
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.C;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Objects;
+import java.util.*;
import java.util.stream.Collectors;
/**
@@ -66,6 +66,10 @@
@Autowired
private SystemUserMapper systemUserMapper;
+ @Autowired
+ private SystemDictDataBiz systemDictDataBiz;
+
+
@Override
@Transactional(rollbackFor = {Exception.class,BusinessException.class})
@@ -81,7 +85,12 @@
){
throw new BusinessException(ResponseStatus.BAD_REQUEST);
}
- YwContractBill ywContractBill = ywContractBillMapper.selectById(ywContractRevenue.getBillId());
+ YwContractBill ywContractBill = ywContractBillMapper.selectJoinOne(YwContractBill.class,
+ new MPJLambdaWrapper<YwContractBill>()
+ .selectAll(YwContractBill.class)
+ .selectAs(YwContract::getStatus, YwContractBill::getContractStatus)
+ .leftJoin(YwContract.class,YwContract::getId,YwContractBill::getContractId)
+ .eq(YwContractBill::getId,ywContractRevenue.getBillId()));
if(Objects.isNull(ywContractBill)){
throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈠埌璐﹀崟淇℃伅");
}
@@ -111,8 +120,10 @@
ywContractRevenue.setContractId(ywContractBill.getContractId());
//鏍规嵁鏀舵敮鎯呭喌 鏇存柊璐﹀崟鏁版嵁
//鏌ヨ褰撳墠璐﹀崟涓� 宸叉敮浠樼殑璐圭敤
- List<YwContractRevenue> ywContractRevenueList = ywContractRevenueMapper.selectList(new QueryWrapper<YwContractRevenue>().lambda().eq(YwContractRevenue::getIsdeleted,Constants.ZERO)
+ List<YwContractRevenue> ywContractRevenueList = ywContractRevenueMapper.selectList(new QueryWrapper<YwContractRevenue>()
+ .lambda().eq(YwContractRevenue::getIsdeleted,Constants.ZERO)
.eq(YwContractRevenue::getStatus,Constants.ZERO)
+ .eq(YwContractRevenue::getBillId,ywContractRevenue.getBillId())
);
//宸叉敮浠橀噾棰�
BigDecimal payTotal = BigDecimal.ZERO;
@@ -120,7 +131,7 @@
BigDecimal waitPayTotal = BigDecimal.ZERO;
//鏃犱粯娆捐褰� 鍒欎负鍒濇鏀粯 鏍规嵁璐﹀崟绫诲瀷 鍒ゆ柇鏄敮鍑� / 鏀跺叆
if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(ywContractRevenueList)){
- ywContractRevenue.setRevenueType(ywContractBill.getType());
+ ywContractRevenue.setRevenueType(ywContractBill.getBillType());
if(ywContractRevenue.getActReceivableFee().compareTo(ywContractBill.getReceivableFee())>Constants.ZERO){
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"璇疯緭鍏ユ纭殑閲戦锛�");
}else if(ywContractRevenue.getActReceivableFee().compareTo(ywContractBill.getReceivableFee())==Constants.ZERO){
@@ -130,30 +141,50 @@
}
}else{
//鑾峰彇宸叉敮浠樼殑鎬婚噾棰� 锛堝彲鑳芥湁鏀跺叆 鏈夋敮鍑猴級
- payTotal = ywContractRevenueList.stream().map(i->i.getActReceivableFee().multiply(
- BigDecimal.valueOf(Constants.equalsInteger(ywContractRevenue.getRevenueType(),Constants.ZERO)?Constants.ONE:-Constants.ONE))
- ).reduce(BigDecimal.ZERO,BigDecimal::add);
- //鑾峰彇寰呮敮浠樻閲戦 濡傛灉璐﹀崟绫诲瀷涓烘敮鍑� 鎴� 锛堣处鍗曠被鍨嬩负鏀跺叆 涓� 寰呮敮浠橀噾棰� 灏忎簬 0锛� 鍒欎负鏀粯
- waitPayTotal = ywContractBill.getReceivableFee().subtract(payTotal);
- //濡傛灉寰呮敮浠橀噾棰� 澶т簬 0 鍒欐槸 鏀跺叆 鍚﹀垯鏄敮鍑� 鍏朵粬鐘舵�� 涓哄紓甯革紒
- if(waitPayTotal.compareTo(BigDecimal.ZERO)>Constants.ZERO){
- ywContractRevenue.setRevenueType(Constants.ZERO);
- }else if(waitPayTotal.compareTo(BigDecimal.ZERO)<Constants.ZERO){
- ywContractRevenue.setRevenueType(Constants.ONE);
+ if(Constants.equalsInteger(ywContractBill.getBillType(),Constants.ZERO)){
+ payTotal = ywContractRevenueList.stream().map(i->
+ i.getActReceivableFee().multiply(
+ BigDecimal.valueOf(Constants.equalsInteger(i.getRevenueType(),Constants.ZERO)?Constants.ONE:-Constants.ONE))
+ ).reduce(BigDecimal.ZERO,BigDecimal::add);
+ //鑾峰彇寰呮敮浠樻閲戦 濡傛灉璐﹀崟绫诲瀷涓烘敮鍑� 鎴� 锛堣处鍗曠被鍨嬩负鏀跺叆 涓� 寰呮敮浠橀噾棰� 灏忎簬 0锛� 鍒欎负鏀粯
+ waitPayTotal = ywContractBill.getReceivableFee().subtract(payTotal);
+ //濡傛灉寰呮敮浠橀噾棰� 澶т簬 0 鍒欐槸 鏀跺叆 鍚﹀垯鏄敮鍑� 鍏朵粬鐘舵�� 涓哄紓甯革紒
+ if(waitPayTotal.compareTo(BigDecimal.ZERO)>Constants.ZERO){
+ ywContractRevenue.setRevenueType(Constants.ZERO);
+ }else if(waitPayTotal.compareTo(BigDecimal.ZERO)<Constants.ZERO){
+ ywContractRevenue.setRevenueType(Constants.ONE);
+ }else{
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鏀舵敮閲戦寮傚父!璇疯仈绯荤鐞嗗憳");
+ }
}else{
- throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鏀舵敮閲戦寮傚父!璇疯仈绯荤鐞嗗憳");
+ payTotal = ywContractRevenueList.stream().map(i->
+ i.getActReceivableFee().multiply(
+ BigDecimal.valueOf(Constants.equalsInteger(i.getRevenueType(),Constants.ZERO)?-Constants.ONE:Constants.ONE))
+ ).reduce(BigDecimal.ZERO,BigDecimal::add);
+ //鑾峰彇寰呮敮浠樻閲戦 濡傛灉璐﹀崟绫诲瀷涓烘敮鍑� 鎴� 锛堣处鍗曠被鍨嬩负鏀跺叆 涓� 寰呮敮浠橀噾棰� 灏忎簬 0锛� 鍒欎负鏀粯
+ waitPayTotal = ywContractBill.getReceivableFee().subtract(payTotal);
+ //濡傛灉寰呮敮浠橀噾棰� 澶т簬 0 鍒欐槸 鏀跺叆 鍚﹀垯鏄敮鍑� 鍏朵粬鐘舵�� 涓哄紓甯革紒
+ if(waitPayTotal.compareTo(BigDecimal.ZERO)>Constants.ZERO){
+ ywContractRevenue.setRevenueType(Constants.ONE);
+ }else if(waitPayTotal.compareTo(BigDecimal.ZERO)<Constants.ZERO){
+ ywContractRevenue.setRevenueType(Constants.ZERO);
+ }else{
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鏀舵敮閲戦寮傚父!璇疯仈绯荤鐞嗗憳");
+ }
}
+
+
//寰呮敮浠樼殑娴佹按 濡傛灉涓烘敹鍏� 鍒欐瘮瀵� 閲戦鍊� 濡傛灉鏄敮鍑� 鍒欒幏鍙栫粷瀵瑰�� 杩涜瀵规瘮
if(Constants.equalsInteger(ywContractRevenue.getRevenueType(),Constants.ZERO)){
//濡傛灉鏀粯閲戦 澶т簬 寰呮敮浠橀噾棰� 鍒欐彁绀哄紓甯� 濡傛灉鏀粯閲戦灏忎簬 寰呮敮浠橀噾棰� 鍒欑姸鎬佷笉鍙樺寲 鍏朵粬鐘舵�� 寮傚父
- if(waitPayTotal.compareTo(ywContractRevenue.getActReceivableFee())>Constants.ZERO){
+ if(waitPayTotal.compareTo(ywContractRevenue.getActReceivableFee())<Constants.ZERO){
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"璇疯緭鍏ユ纭殑閲戦锛�");
}else if(waitPayTotal.compareTo(ywContractRevenue.getActReceivableFee())==Constants.ZERO){
ywContractBill.setPayStatus(Constants.ONE);
}
}else{
waitPayTotal = waitPayTotal.abs();
- if(waitPayTotal.compareTo(ywContractRevenue.getActReceivableFee())>Constants.ZERO){
+ if(waitPayTotal.compareTo(ywContractRevenue.getActReceivableFee())<Constants.ZERO){
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"璇疯緭鍏ユ纭殑閲戦锛�");
}else if(waitPayTotal.compareTo(ywContractRevenue.getActReceivableFee())==Constants.ZERO){
ywContractBill.setPayStatus(Constants.ONE);
@@ -162,6 +193,22 @@
}
ywContractRevenueMapper.insert(ywContractRevenue);
ywContractBillMapper.updateById(ywContractBill);
+ //濡傛灉璐﹀崟瀹岀粨锛屽垯鏌ヨ鍚堝悓涓嬪紑鍚腑鐨勮处鍗曟槸鍚﹀瓨鍦ㄩ��娆句腑 濡傛灉涓嶅瓨鍦ㄥ垯鏍囪鍚堝悓宸查��娆�
+ if(Constants.equalsInteger(ywContractBill.getContractStatus(),Constants.THREE)
+ && Constants.equalsInteger(ywContractBill.getPayStatus(),Constants.ONE)){
+ if( ywContractBillMapper
+ .selectCount(new QueryWrapper<YwContractBill>().lambda().eq(YwContractBill::getContractId,ywContractBill.getContractId())
+ .ne(YwContractBill::getId,ywContractBill.getId())
+ .eq(YwContractBill::getStatus,Constants.ZERO)
+ .in(YwContractBill::getPayStatus,Constants.ZERO,Constants.FOUR, Constants.TWO,Constants.THREE)
+ ) == Constants.ZERO){
+ ywContractMapper.update(new UpdateWrapper<YwContract>().lambda()
+ .set(YwContract::getStatus,Constants.FOUR)
+ .set(YwContract::getEditDate,DateUtil.getCurrDateTime())
+ .eq(YwContract::getId,ywContractBill.getContractId())
+ );
+ }
+ }
//瀛樺偍闄勪欢淇℃伅
if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ywContractRevenue.getMultifileList())){
for (Multifile multifile:ywContractRevenue.getMultifileList()) {
@@ -227,16 +274,39 @@
new MPJLambdaWrapper<YwContractRevenue>().selectAll(YwContractRevenue.class)
.selectAs(YwContractBill::getCode,YwContractRevenue::getBillCode)
.selectAs(YwContract::getCode,YwContractRevenue::getContractCode)
+ .selectAs(YwContract::getStatus,YwContractRevenue::getContractStatus)
.selectAs(YwCustomer::getName,YwContractRevenue::getCustomerName)
.selectAs(SystemUser::getRealname,YwContractRevenue::getRealname)
+ .selectAs(YwAccount::getTitle,YwContractRevenue::getAccountTitle)
.leftJoin(YwContractBill.class,YwContractBill::getId,YwContractRevenue::getBillId)
.leftJoin(YwContract.class,YwContract::getId,YwContractBill::getContractId)
.leftJoin(YwCustomer.class,YwCustomer::getId,YwContract::getRenterId)
.leftJoin(SystemUser.class,SystemUser::getId,YwContractRevenue::getCreator)
+ .leftJoin(YwAccount.class,YwAccount::getId,YwContractRevenue::getAccountId)
.eq(YwContractRevenue::getId,id)
);
this.getRecordData(ywContractRevenue);
+
+ //闄勪欢鏁版嵁
+ List<Multifile> multifileList = multifileMapper.selectJoinList(Multifile.class,new MPJLambdaWrapper<Multifile>()
+ .selectAll(Multifile.class)
+ .selectAs(SystemUser::getRealname,Multifile::getUserName)
+ .leftJoin(SystemUser.class,SystemUser::getId,Multifile::getCreator)
+ .eq(Multifile::getObjId,id)
+ .eq(Multifile::getIsdeleted,Constants.ZERO)
+ .eq(Multifile::getObjType,Constants.MultiFile.FN_CONTRACT_REVENUE_FILE.getKey()));
+ if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(multifileList)){
+ String path = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode()
+ +systemDictDataBiz.queryByCode(Constants.FTP,Constants.YW_CONTRACT_BILL).getCode();
+ for (Multifile multifile:multifileList) {
+ if(StringUtils.isNotBlank(multifile.getFileurl())){
+ multifile.setFileurlFull(path + multifile.getFileurl());
+ }
+ }
+ ywContractRevenue.setMultifileList(multifileList);
+ }
+
return ywContractRevenue;
}
@@ -288,11 +358,11 @@
if(Objects.isNull(ywContract)){
throw new BusinessException(ResponseStatus.DATA_EMPTY);
}
- if(Constants.equalsInteger(ywContract.getStatus(),Constants.THREE)){
+ if(Constants.equalsInteger(ywContract.getStatus(),Constants.FOUR)){
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鍚堝悓鐘舵�佸凡娴佽浆,鏃犳硶鎿嶄綔");
}
if(Constants.equalsInteger(ywContractBill.getPayStatus(),Constants.ONE)
- || Constants.equalsInteger(ywContractBill.getPayStatus(),Constants.TWO)){
+ || Constants.equalsInteger(ywContractBill.getPayStatus(),Constants.FIVE)){
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"璐﹀崟鐘舵�佸凡娴佽浆,鏃犳硶鎿嶄綔");
}
//鏌ヨ璐﹀崟涓� 鎵�鏈夌殑璐﹀崟
@@ -322,14 +392,14 @@
ywContractBillMapper.update(null,new UpdateWrapper<YwContractBill>().lambda()
.set(YwContractBill::getPayStatus,ywContractBill.getPayStatus())
.set(YwContractBill::getEditor,loginUserInfo.getId())
- .set(YwContractBill::getEditDate," now() ")
+ .set(YwContractBill::getEditDate, DateUtil.getCurrDateTime())
.eq(YwContractBill::getId,ywContractBill.getId())
);
ywContractRevenueMapper.update(null,new UpdateWrapper<YwContractRevenue>().lambda()
.set(YwContractRevenue::getStatus,Constants.ONE)
.set(YwContractRevenue::getEditor,loginUserInfo.getId())
- .set(YwContractRevenue::getEditDate," now() ")
+ .set(YwContractRevenue::getEditDate,DateUtil.getCurrDateTime())
.eq(YwContractRevenue::getId,id));
}
@@ -344,7 +414,7 @@
public List<YwContractRevenue> findList(YwContractRevenue ywContractRevenue) {
List<YwContractRevenue> ywContractRevenueList = ywContractRevenueMapper.selectJoinList(YwContractRevenue.class,new MPJLambdaWrapper<YwContractRevenue>()
.selectAll(YwContractRevenue.class)
- .selectAs(YwCustomer::getName,YwContractRevenue::getCustomerNme)
+ .selectAs(YwCustomer::getName,YwContractRevenue::getCustomerName)
.leftJoin(YwContract.class,YwContract::getId,YwContractRevenue::getContractId)
.leftJoin(YwCustomer.class,YwCustomer::getId,YwContract::getRenterId)
.eq(YwContractRevenue::getStatus,Constants.ZERO)
@@ -362,7 +432,9 @@
IPage<YwContractRevenue> iPage = ywContractRevenueMapper.selectJoinPage(page,YwContractRevenue.class,
queryWrapper.selectAll(YwContractRevenue.class)
.selectAs(YwContractBill::getCode,YwContractRevenue::getBillCode)
+ .selectAs(YwContractBill::getType,YwContractRevenue::getBillType)
.selectAs(YwContract::getCode,YwContractRevenue::getContractCode)
+ .selectAs(YwContract::getStatus,YwContractRevenue::getContractStatus)
.selectAs(YwCustomer::getName,YwContractRevenue::getCustomerName)
.selectAs(SystemUser::getRealname,YwContractRevenue::getRealname)
.leftJoin(YwContractBill.class,YwContractBill::getId,YwContractRevenue::getBillId)
@@ -370,14 +442,15 @@
.leftJoin(YwCustomer.class,YwCustomer::getId,YwContract::getRenterId)
.leftJoin(SystemUser.class,SystemUser::getId,YwContractRevenue::getCreator)
.eq(YwContractRevenue::getIsdeleted,Constants.ZERO)
- .like(Objects.nonNull(model)&&StringUtils.isNotBlank(model.getCustomerNme()),
- YwCustomer::getName,model.getCustomerNme())
+ .like(Objects.nonNull(model)&&StringUtils.isNotBlank(model.getCustomerName()),
+ YwCustomer::getName,model.getCustomerName())
.eq(Objects.nonNull(model)&&Objects.nonNull(model.getPayType()),
YwContractRevenue::getPayType,model.getPayType())
.eq(Objects.nonNull(model)&&Objects.nonNull(model.getRevenueType()),
YwContractRevenue::getRevenueType,model.getRevenueType())
.ge(Objects.nonNull(model)&&Objects.nonNull(model.getPayDateStart()),YwContractRevenue::getActPayDate, Utils.Date.getStart(model.getPayDateStart()))
- .le(Objects.nonNull(model)&&Objects.nonNull(model.getPayDateEnd()),YwContractRevenue::getActPayDate, Utils.Date.getEnd(model.getPayDateEnd())) )
+ .le(Objects.nonNull(model)&&Objects.nonNull(model.getPayDateEnd()),YwContractRevenue::getActPayDate, Utils.Date.getEnd(model.getPayDateEnd()))
+ .orderByDesc(YwContractRevenue::getId))
;
this.dealRoomDetail(iPage.getRecords());
@@ -385,25 +458,39 @@
for (YwContractRevenue ywContractRevenue:iPage.getRecords()) {
//妤煎畤鍚嶇О
List<YwContractRoom> ywContractRoomList = ywContractRevenue.getYwContractRoomList();
- StringBuilder roomPathName = new StringBuilder();
- for (YwContractRoom ywContractRoom:ywContractRoomList) {
- if(StringUtils.isNotBlank(ywContractRoom.getProjectName())){
- roomPathName.append(ywContractRoom.getProjectName()+"/");
+ if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ywContractRoomList)){
+ StringBuilder roomPathName = new StringBuilder();
+ for (YwContractRoom ywContractRoom:ywContractRoomList) {
+ if(Constants.equalsInteger(ywContractRevenue.getBillType(),Constants.ZERO)){
+ if(!(Constants.equalsInteger(ywContractRevenue.getContractId(),ywContractRoom.getContractId())
+ && Constants.equalsInteger(ywContractRoom.getType(),Constants.ZERO))){
+ continue;
+ }
+ }else{
+ if(!(Constants.equalsInteger(ywContractRevenue.getBillId(),ywContractRoom.getContractId())
+ && Constants.equalsInteger(ywContractRoom.getType(),Constants.ONE))){
+ continue;
+ }
+ }
+ if(StringUtils.isNotBlank(ywContractRoom.getProjectName())){
+ roomPathName.append(ywContractRoom.getProjectName()+"/");
+ }
+ if(StringUtils.isNotBlank(ywContractRoom.getBuildingName())){
+ roomPathName.append(ywContractRoom.getBuildingName()+"/");
+ }
+ if(StringUtils.isNotBlank(ywContractRoom.getFloorName())){
+ roomPathName.append(ywContractRoom.getFloorName()+"/");
+ }
+ if(StringUtils.isNotBlank(ywContractRoom.getRoomName())){
+ roomPathName.append(ywContractRoom.getRoomName());
+ }
+ if(StringUtils.isNotBlank(roomPathName)){
+ roomPathName.append(";");
+ }
}
- if(StringUtils.isNotBlank(ywContractRoom.getBuildingName())){
- roomPathName.append(ywContractRoom.getBuildingName()+"/");
- }
- if(StringUtils.isNotBlank(ywContractRoom.getFloorName())){
- roomPathName.append(ywContractRoom.getFloorName()+"/");
- }
- if(StringUtils.isNotBlank(ywContractRoom.getRoomName())){
- roomPathName.append(ywContractRoom.getRoomName());
- }
- if(StringUtils.isNotBlank(roomPathName)){
- roomPathName.append(";");
- }
+ ywContractRevenue.setRoomPathName(roomPathName.toString());
}
- ywContractRevenue.setRoomPathName(roomPathName.toString());
+
}
return PageData.from(iPage);
}
@@ -414,24 +501,30 @@
if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ywContractRevenueList)){
//鑾峰彇鎵�鏈夋暟鎹�
List<Integer> billIdList = ywContractRevenueList.stream().map(i->i.getBillId()).collect(Collectors.toList());
+ List<Integer> contractIdList = ywContractRevenueList.stream().map(i->i.getContractId()).collect(Collectors.toList());
if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(billIdList)){
List<YwContractRoom> ywContractRoomList = ywContractRoomMapper.selectJoinList(YwContractRoom.class,new MPJLambdaWrapper<YwContractRoom>()
.selectAll(YwContractRoom.class)
.selectAs(YwProject::getName,YwRoom::getProjectName)
.selectAs(YwFloor::getName,YwRoom::getFloorName)
.selectAs(YwBuilding::getName,YwRoom::getBuildingName)
- .selectAs(YwRoom::getName,YwContractRoom::getRoomName)
+ .selectAs(YwRoom::getCode,YwContractRoom::getRoomName)
.leftJoin(YwRoom.class,YwRoom::getId,YwContractRoom::getRoomId)
.leftJoin(YwFloor.class,YwFloor::getId,YwRoom::getFloor)
.leftJoin(YwProject.class,YwProject::getId,YwRoom::getProjectId)
.leftJoin(YwBuilding.class,YwBuilding::getId,YwRoom::getBuildingId)
- .in(YwContractRoom::getContractId,billIdList)
- .eq(YwContractRoom::getType,Constants.ONE)
+ .and(i->i.in(YwContractRoom::getContractId,billIdList).eq(YwContractRoom::getType,Constants.ONE)
+ .or().in(YwContractRoom::getContractId,contractIdList).eq(YwContractRoom::getType,Constants.ZERO)
+ )
+// .in(YwContractRoom::getContractId,billIdList)
+// .eq(YwContractRoom::getType,Constants.ONE)
);
if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ywContractRoomList)){
for (YwContractRevenue ywContractRevenue:ywContractRevenueList) {
ywContractRevenue.setYwContractRoomList(
- ywContractRoomList.stream().filter(i->Constants.equalsInteger(i.getContractId(),ywContractRevenue.getBillId())).collect(Collectors.toList())
+ ywContractRoomList.stream().filter(i->
+ Constants.equalsInteger(i.getContractId(),ywContractRevenue.getBillId())||Constants.equalsInteger(i.getContractId(),ywContractRevenue.getContractId()))
+ .collect(Collectors.toList())
);
}
}
--
Gitblit v1.9.3