From f4cf11fa6ddf3cd51c99437a3638951bf5ac9304 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期一, 09 十二月 2024 18:17:12 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/funingyunwei
---
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractBillServiceImpl.java | 35 +++++++++++++++++++++++------------
1 files changed, 23 insertions(+), 12 deletions(-)
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractBillServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractBillServiceImpl.java
index 03953ce..00daa7a 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractBillServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractBillServiceImpl.java
@@ -98,11 +98,14 @@
ywContractBill.setEndDate(ywContractBill.getPlanPayDate());
}
//鏌ヨ鍚堝悓涓嬬殑鏈�澶х殑搴忓彿
- List<YwContractBill> ywContractBillList = ywContractBillMapper.selectList(new QueryWrapper<YwContractBill>().lambda().eq(YwContractBill::getContractId,ywContract.getId()).orderByDesc(YwContractBill::getId));
+ List<YwContractBill> ywContractBillList = ywContractBillMapper.selectList(new QueryWrapper<YwContractBill>()
+ .lambda().eq(YwContractBill::getContractId,ywContract.getId())
+ .in(YwContractBill::getCostType,Constants.ZERO,Constants.SIX,Constants.FOUR,Constants.FIVE,7)
+ .orderByDesc(YwContractBill::getId));
if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ywContractBillList)){
ywContractBill.setSortnum(ywContractBillList.size() + 1 );
}else{
- ywContractBill.setSortnum(Constants.ZERO);
+ ywContractBill.setSortnum(0);
}
ywContractBillMapper.insert(ywContractBill);
@@ -186,9 +189,11 @@
public YwContractBill getDetail(Integer id) {
YwContractBill ywContractBill = ywContractBillMapper.selectJoinOne(YwContractBill.class,
new MPJLambdaWrapper<YwContractBill>().selectAll(YwContractBill.class)
- .select(" ( select ifnull(sum(case when yw.REVENUE_TYPE = 0 then yw.ACT_RECEIVABLE_FEE else -yw.ACT_RECEIVABLE_FEE end),0) from yw_contract_revenue yw where yw.bill_id = t.id and yw.status = 0 and yw.isdeleted = 0 ) as actReceivableFee ")
+ //.select(" ( select ifnull(sum(case when yw.REVENUE_TYPE = 0 then yw.ACT_RECEIVABLE_FEE else -yw.ACT_RECEIVABLE_FEE end),0) from yw_contract_revenue yw where yw.bill_id = t.id and yw.status = 0 and yw.isdeleted = 0 ) as actReceivableFee ")
+ .select(" ( select ifnull( sum( CASE WHEN t.bill_type = 0 and yw.REVENUE_TYPE = 0 THEN yw.ACT_RECEIVABLE_FEE when t.bill_type = 0 and yw.REVENUE_TYPE = 1 then -yw.ACT_RECEIVABLE_FEE when t.bill_type = 1 and yw.REVENUE_TYPE = 0 then -yw.ACT_RECEIVABLE_FEE else yw.ACT_RECEIVABLE_FEE END),0) from yw_contract_revenue yw where yw.bill_id = t.id and yw.status = 0 and yw.isdeleted = 0 ) as actReceivableFee ")
.selectAs(YwContract::getCode,YwContractBill::getContractCode)
.selectAs(YwCustomer::getName,YwContractBill::getCustomerName)
+ .selectAs(Company::getId,YwContractBill::getCompanyId)
.selectAs(Company::getName,YwContractBill::getCompanyName)
.selectAs(SystemUser::getRealname,YwContractBill::getRealname)
.leftJoin(YwContract.class,YwContract::getId,YwContractBill::getContractId)
@@ -205,7 +210,8 @@
);
//鎴挎簮鏁版嵁
- ywContractBill.setYwContractRoomList(ywContractRoomMapper.selectJoinList(YwContractRoom.class,new MPJLambdaWrapper<YwContractRoom>()
+ ywContractBill.setYwContractRoomList(
+ ywContractRoomMapper.selectJoinList(YwContractRoom.class,new MPJLambdaWrapper<YwContractRoom>()
.selectAll(YwContractRoom.class)
.selectAs(YwProject::getName,YwRoom::getProjectName)
.selectAs(YwFloor::getName,YwRoom::getFloorName)
@@ -218,8 +224,8 @@
.leftJoin(YwBuilding.class,YwBuilding::getId,YwRoom::getBuildingId)
.eq(Constants.equalsInteger(ywContractBill.getType(),Constants.ONE),YwContractRoom::getContractId,id)
.eq(Constants.equalsInteger(ywContractBill.getType(),Constants.ONE),YwContractRoom::getType,Constants.ONE)
- .eq(Constants.equalsInteger(ywContractBill.getType(),Constants.ZERO),YwContractRoom::getContractId,ywContractBill.getContractId())
- .eq(Constants.equalsInteger(ywContractBill.getType(),Constants.ZERO),YwContractRoom::getType,Constants.ZERO)
+ .eq(Constants.equalsInteger(ywContractBill.getType(),Constants.ZERO) || Constants.equalsInteger(ywContractBill.getType(),Constants.TWO),YwContractRoom::getContractId,ywContractBill.getContractId())
+ .eq(Constants.equalsInteger(ywContractBill.getType(),Constants.ZERO)| Constants.equalsInteger(ywContractBill.getType(),Constants.TWO),YwContractRoom::getType,Constants.ZERO)
));
//鏀舵敮璁板綍
@@ -276,7 +282,8 @@
YwContractBill model = pageWrap.getModel();
IPage<YwContractBill> iPage = ywContractBillMapper.selectJoinPage(page,YwContractBill.class,
queryWrapper.selectAll(YwContractBill.class)
- .select(" ( select ifnull(sum(case when yw.REVENUE_TYPE = 0 then yw.ACT_RECEIVABLE_FEE else -yw.ACT_RECEIVABLE_FEE end),0) from yw_contract_revenue yw where yw.bill_id = t.id and yw.status = 0 and yw.isdeleted = 0 ) as actReceivableFee ")
+// .select(" ( select ifnull(sum(case when yw.REVENUE_TYPE = 0 then yw.ACT_RECEIVABLE_FEE else -yw.ACT_RECEIVABLE_FEE end),0) from yw_contract_revenue yw where yw.bill_id = t.id and yw.status = 0 and yw.isdeleted = 0 ) as actReceivableFee ")
+ .select(" ( select ifnull( sum( CASE WHEN t.bill_type = 0 and yw.REVENUE_TYPE = 0 THEN yw.ACT_RECEIVABLE_FEE when t.bill_type = 0 and yw.REVENUE_TYPE = 1 then -yw.ACT_RECEIVABLE_FEE when t.bill_type = 1 and yw.REVENUE_TYPE = 0 then -yw.ACT_RECEIVABLE_FEE else yw.ACT_RECEIVABLE_FEE END),0) from yw_contract_revenue yw where yw.bill_id = t.id and yw.status = 0 and yw.isdeleted = 0 ) as actReceivableFee ")
.selectAs(YwContract::getCode,YwContractBill::getContractCode)
.selectAs(YwCustomer::getName,YwContractBill::getCustomerName)
.leftJoin(YwContract.class,YwContract::getId,YwContractBill::getContractId)
@@ -297,8 +304,9 @@
.like(Objects.nonNull(model)&&StringUtils.isNotBlank(model.getContractCode()),
YwContract::getCode,model.getContractCode())
.ge(Objects.nonNull(model)&&Objects.nonNull(model.getPlanPayDateStart()),YwContractBill::getPlanPayDate, Utils.Date.getStart(model.getPlanPayDateStart()))
- .le(Objects.nonNull(model)&&Objects.nonNull(model.getPlanPayDateEnd()),YwContractBill::getPlanPayDate, Utils.Date.getEnd(model.getPlanPayDateEnd())) )
- ;
+ .le(Objects.nonNull(model)&&Objects.nonNull(model.getPlanPayDateEnd()),YwContractBill::getPlanPayDate, Utils.Date.getEnd(model.getPlanPayDateEnd()))
+ .orderByDesc(YwContractBill::getId));
+
this.dealRoomDetail(iPage.getRecords());
for (YwContractBill ywContractBill:iPage.getRecords()) {
//闇�鏀堕噾棰�
@@ -387,7 +395,7 @@
for (YwContractBill ywContractBill:ywContractBillList) {
if(Constants.equalsInteger(ywContractBill.getType(),Constants.ZERO)){
ywContractBill.setYwContractRoomList(
- ywContractRoomList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.ZERO)&&Constants.equalsInteger(i.getContractId(),ywContractBill.getContractId())).collect(Collectors.toList())
+ ywContractRoomList.stream().filter(i->(Constants.equalsInteger(i.getType(),Constants.TWO)||Constants.equalsInteger(i.getType(),Constants.ZERO))&&Constants.equalsInteger(i.getContractId(),ywContractBill.getContractId())).collect(Collectors.toList())
);
}else{
ywContractBill.setYwContractRoomList(
@@ -457,7 +465,8 @@
public List<YwContractBill> getCanBackBill(YwContractBill model) {
List<YwContractBill> list = ywContractBillMapper.selectJoinList(YwContractBill.class,
new MPJLambdaWrapper<YwContractBill>().selectAll(YwContractBill.class)
- .select(" ( select ifnull(sum(case when yw.REVENUE_TYPE = 0 then yw.ACT_RECEIVABLE_FEE else -yw.ACT_RECEIVABLE_FEE end),0) from yw_contract_revenue yw where yw.bill_id = t.id and yw.status = 0 and yw.isdeleted = 0 ) as actReceivableFee ")
+// .select(" ( select ifnull(sum(case when yw.REVENUE_TYPE = 0 then yw.ACT_RECEIVABLE_FEE else -yw.ACT_RECEIVABLE_FEE end),0) from yw_contract_revenue yw where yw.bill_id = t.id and yw.status = 0 and yw.isdeleted = 0 ) as actReceivableFee ")
+ .select(" ( select ifnull( sum( CASE WHEN t.bill_type = 0 and yw.REVENUE_TYPE = 0 THEN yw.ACT_RECEIVABLE_FEE when t.bill_type = 0 and yw.REVENUE_TYPE = 1 then -yw.ACT_RECEIVABLE_FEE when t.bill_type = 1 and yw.REVENUE_TYPE = 0 then -yw.ACT_RECEIVABLE_FEE else yw.ACT_RECEIVABLE_FEE END),0) from yw_contract_revenue yw where yw.bill_id = t.id and yw.status = 0 and yw.isdeleted = 0 ) as actReceivableFee ")
.selectAs(YwContract::getCode,YwContractBill::getContractCode)
.selectAs(YwCustomer::getName,YwContractBill::getCustomerName)
.leftJoin(YwContract.class,YwContract::getId,YwContractBill::getContractId)
@@ -466,7 +475,9 @@
.in(YwContractBill::getCostType,Constants.ZERO,Constants.ONE,Constants.FOUR,Constants.FIVE,7)
.eq(Objects.nonNull(model)&&Objects.nonNull(model.getContractId()),
YwContractBill::getContractId,model.getContractId())
- .le(Objects.nonNull(model)&&Objects.nonNull(model.getPlanPayDateEnd()),YwContractBill::getStartDate, Utils.Date.getEnd(model.getPlanPayDateEnd())) )
+ .and(Objects.nonNull(model)&&Objects.nonNull(model.getPlanPayDateEnd()),
+ i->i.le(YwContractBill::getStartDate, Utils.Date.getEnd(model.getPlanPayDateEnd())).or()
+ .in(YwContractBill::getPayStatus,Constants.ONE,Constants.TWO) ))
;
for (YwContractBill ywContractBill:list) {
--
Gitblit v1.9.3