From c338f3c4de6a9d357e814e3acf23544809a8e385 Mon Sep 17 00:00:00 2001
From: renkang <8417338+k94314517@user.noreply.gitee.com>
Date: 星期一, 25 十一月 2024 10:10:52 +0800
Subject: [PATCH] 客户资料 巡检任务业务
---
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractBillServiceImpl.java | 38 +++++++++++++-----
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwContractBill.java | 29 ++++++++++++--
2 files changed, 52 insertions(+), 15 deletions(-)
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwContractBill.java b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwContractBill.java
index 464dca7..a1eeb1c 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwContractBill.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwContractBill.java
@@ -105,6 +105,10 @@
@ExcelColumn(name="鎬婚噾棰�")
private BigDecimal totleFee;
+ @ApiModelProperty(value = "搴旀敹閲戦", example = "1")
+ @ExcelColumn(name="搴旀敹閲戦")
+ private BigDecimal receivableFee;
+
@ApiModelProperty(value = "璐圭敤绫诲瀷锛�0=绉熻祦璐癸紱1=鐗╀笟璐癸紱2=鎶奸噾锛�3=淇濊瘉閲戯紱4=姘寸數璐癸紱5=鏉傞」璐癸紱6=鍏朵粬", example = "1")
@ExcelColumn(name="璐圭敤绫诲瀷锛�0=绉熻祦璐癸紱1=鐗╀笟璐癸紱2=鎶奸噾锛�3=淇濊瘉閲戯紱4=姘寸數璐癸紱5=鏉傞」璐癸紱6=鍏朵粬")
private Integer costType;
@@ -125,14 +129,31 @@
@TableField(exist = false)
private String customerName;
- @ApiModelProperty(value = "鍚堝悓鍚嶇О", example = "1")
- @TableField(exist = false)
- private String contractName;
-
@ApiModelProperty(value = "鍏徃鍚嶇О", example = "1")
@TableField(exist = false)
private String companyName;
+ @ApiModelProperty(value = "鍚堝悓缂栧彿", example = "1")
+ @TableField(exist = false)
+ private String contractCode;
+
+ @ApiModelProperty(value = "鎴块棿鏁版嵁", example = "1")
+ @TableField(exist = false)
+ private List<YwRoom> ywRoomList ;
+
+
+ @ApiModelProperty(value = "璁″垝浠樻鏃� - 寮�濮�")
+ @TableField(exist = false)
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date planPayDateStart;
+
+
+ @ApiModelProperty(value = "璁″垝浠樻鏃� - 缁撴潫")
+ @TableField(exist = false)
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date planPayDateEnd;
+
+
@ApiModelProperty(value = "闄勪欢淇℃伅", example = "1")
@TableField(exist = false)
private List<Multifile> multifileList;
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 b8cff6b..b090fe2 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
@@ -9,10 +9,7 @@
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.YwContractBillMapper;
import com.doumee.dao.business.YwContractRoomMapper;
-import com.doumee.dao.business.model.YwContract;
-import com.doumee.dao.business.model.YwContractBill;
-import com.doumee.dao.business.model.YwContractRoom;
-import com.doumee.dao.business.model.YwCustomer;
+import com.doumee.dao.business.model.*;
import com.doumee.dao.system.MultifileMapper;
import com.doumee.dao.system.model.Multifile;
import com.doumee.service.business.YwContractBillService;
@@ -51,18 +48,20 @@
@Override
public Integer create(YwContractBill ywContractBill) {
if(Objects.isNull(ywContractBill)
- || Objects.isNull(ywContractBill.getContractId())
- || Objects.isNull(ywContractBill.getTotleFee())
- || Objects.isNull(ywContractBill.getPlanPayData())
+ || Objects.isNull(ywContractBill.getContractId())
+ || Objects.isNull(ywContractBill.getTotleFee())
+ || Objects.isNull(ywContractBill.getPlanPayData())
|| Objects.isNull(ywContractBill.getCostType())
|| Objects.isNull(ywContractBill.getBillType())
|| Objects.isNull(ywContractBill.getCompanyId())
|| Objects.isNull(ywContractBill.getStartDate())
|| Objects.isNull(ywContractBill.getEndDate())
+ || com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(ywContractBill.getYwContractRoomList())
){
throw new BusinessException(ResponseStatus.BAD_REQUEST);
}
LoginUserInfo loginUserInfo = ywContractBill.getLoginUserInfo();
+ ywContractBill.setReceivableFee(ywContractBill.getTotleFee());
ywContractBill.setCreateDate(new Date());
ywContractBill.setCreator(loginUserInfo.getId());
ywContractBill.setIsdeleted(Constants.ZERO);
@@ -95,7 +94,7 @@
multifile.setCreator(loginUserInfo.getId());
multifile.setCreateDate(new Date());
multifile.setIsdeleted(Constants.ZERO);
- multifile.setObjType(Constants.MultiFile.FN_PATROL_POINT_FILE.getKey());
+ multifile.setObjType(Constants.MultiFile.FN_CONTRACT_BILL_FILE.getKey());
multifile.setObjId(ywContractBill.getId());
}
multifileMapper.insert(ywContractBill.getMultifileList());
@@ -160,9 +159,26 @@
IPage<YwContractBill> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
MPJLambdaWrapper<YwContractBill> queryWrapper = new MPJLambdaWrapper<>();
Utils.MP.blankToNull(pageWrap.getModel());
- queryWrapper.selectAll(YwContractBill.class)
- .leftJoin(YwContract.class,YwContract::getId,YwContractBill::getContractId)
- .leftJoin(YwCustomer.class,YwCustomer::getId,YwContract::getRenterId)
+
+ YwContractBill model = pageWrap.getModel();
+
+ ywContractBillMapper.selectJoinPage(page,YwContractBill.class,
+ queryWrapper.selectAll(YwContractBill.class)
+ .selectAs(YwContract::getCode,YwContractBill::getContractCode)
+ .selectAs(YwCustomer::getName,YwContractBill::getCustomerName)
+ .leftJoin(YwContract.class,YwContract::getId,YwContractBill::getContractId)
+ .leftJoin(YwCustomer.class,YwCustomer::getId,YwContract::getRenterId)
+ .eq(YwContractBill::getIsdeleted,Constants.ZERO)
+ .like(Objects.nonNull(model)&&StringUtils.isNotBlank(model.getCustomerName()),
+ YwCustomer::getName,model.getCustomerName())
+ .eq(Objects.nonNull(model)&&Objects.nonNull(model.getStatus()),
+ YwContractBill::getStatus,model.getStatus())
+ .eq(Objects.nonNull(model)&&Objects.nonNull(model.getPayStatus()),
+ YwContractBill::getPayStatus,model.getPayStatus())
+ .eq(Objects.nonNull(model)&&Objects.nonNull(model.getType()),
+ YwContractBill::getType,model.getType())
+ .ge(YwContractBill::getPlanPayDate, Utils.Date.getStart(model.getPlanPayDateStart()))
+ .le(YwContractBill::getPlanPayDate, Utils.Date.getEnd(model.getPlanPayDateEnd())) )
;
return PageData.from(ywContractBillMapper.selectPage(page, queryWrapper));
--
Gitblit v1.9.3