结算改价

This commit is contained in:
mashuai 2024-12-05 17:13:41 +08:00
parent a12636fe37
commit fb18a63163
3 changed files with 60 additions and 5 deletions

View File

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
@ -31,6 +32,15 @@ public class LeaseRepair {
@JsonFormat(pattern = "yyyy-MM-dd")
private String finishEndTime;
@JsonFormat(pattern = "yyyy-MM-dd")
private String orderStartTime;
/**
* 退租截止结束时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private String orderEndTime;
@ApiModelProperty(value = "联系电话")
private String phoneNumber;
@ -38,6 +48,25 @@ public class LeaseRepair {
@JsonFormat(pattern = "yyyy-MM-dd")
private Date rentEndTime;
@ApiModelProperty(value = "下单时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date orderTime;
@ApiModelProperty(value = "租赁金额")
private BigDecimal rentPrice;
@ApiModelProperty(value = "租赁开始金额")
private BigDecimal rentPriceMin;
@ApiModelProperty(value = "租赁结束金额")
private BigDecimal rentPriceMax;
@ApiModelProperty(value = "总租赁开始金额")
private BigDecimal totalCostMin;
@ApiModelProperty(value = "总租赁结束金额")
private BigDecimal totalCostMax;
@ApiModelProperty(value = "承租人")
private String leaseName;
@ -52,4 +81,10 @@ public class LeaseRepair {
@ApiModelProperty(value = "是否已填写退租检修内容0 否1 是)")
private Integer isLeaseContent;
@ApiModelProperty(value = "是否已填写费用改价0 否1 是)")
private Integer isChangePrice;
@ApiModelProperty(value = "总费用")
private BigDecimal totalCost;
}

View File

@ -3,7 +3,6 @@ package com.bonus.material.lease.service.impl;
import com.bonus.common.biz.constant.MaterialConstants;
import com.bonus.common.biz.domain.BmFileInfo;
import com.bonus.common.biz.enums.HttpCodeEnum;
import com.bonus.common.biz.exception.BusinessException;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils;
import com.bonus.common.core.web.domain.AjaxResult;
@ -64,6 +63,19 @@ public class LeaseRepairRecordServiceImpl implements LeaseRepairRecordService {
} else {
leaseRepairVo.setIsLeaseContent(0);
}
if (leaseRepairVo.getOrderId() != null) {
LeaseRecordDto leaseRecordDto = getById(leaseRepairVo);
leaseRepairVo.setTotalCost(leaseRecordDto.getTotalCost());
}
}
if (dto.getTotalCostMin() != null && dto.getTotalCostMax() != null) {
list = list.stream()
.filter(leaseRepair -> {
BigDecimal totalCost = leaseRepair.getTotalCost();
return totalCost != null && totalCost.compareTo(dto.getTotalCostMin()) >= 0 && totalCost.compareTo(dto.getTotalCostMax()) <= 0;
})
.collect(Collectors.toList());
}
}
return list;
@ -251,7 +263,7 @@ public class LeaseRepairRecordServiceImpl implements LeaseRepairRecordService {
if (CollectionUtils.isNotEmpty(repairPriceList)) {
for (LeaseRepairRecord repairRecord : repairPriceList) {
if (repairRecord.getOrderId() == null || repairRecord.getMaId() == null ||
repairRecord.getChangeCost() == null) {
repairRecord.getRepairChangePrice() == null) {
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.TO_PARAM_NULL.getMsg());
}
repairRecord.setChangePriceUser(SecurityUtils.getUserId());
@ -262,7 +274,7 @@ public class LeaseRepairRecordServiceImpl implements LeaseRepairRecordService {
if (CollectionUtils.isNotEmpty(scrapPriceList)) {
for (LeaseRepairRecord scrapRecord : scrapPriceList) {
if (scrapRecord.getOrderId() == null || scrapRecord.getMaId() == null ||
scrapRecord.getChangeCost() == null) {
scrapRecord.getScrapChangePrice() == null) {
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.TO_PARAM_NULL.getMsg());
}
scrapRecord.setChangePriceUser(SecurityUtils.getUserId());
@ -273,7 +285,7 @@ public class LeaseRepairRecordServiceImpl implements LeaseRepairRecordService {
if (CollectionUtils.isNotEmpty(lossPriceList)) {
for (LeaseRepairRecord lossRecord : lossPriceList) {
if (lossRecord.getOrderId() == null || lossRecord.getMaId() == null ||
lossRecord.getChangeCost() == null) {
lossRecord.getLossChangePrice() == null) {
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.TO_PARAM_NULL.getMsg());
}
lossRecord.setChangePriceUser(SecurityUtils.getUserId());

View File

@ -217,7 +217,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
'已退租'
WHEN hh.order_status = 6 THEN
'已完成' ELSE '未知'
END AS orderStatusName
END AS orderStatusName,
hh.create_time AS orderTime,
hh.costs AS rentPrice
FROM
ma_order_details hh
LEFT JOIN ma_order_info moi ON moi.order_id = hh.order_id
@ -261,6 +263,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="finishStartTime != null and finishStartTime != '' and finishEndTime != null and finishEndTime != ''">
and DATE_FORMAT(hh.rent_end_time,'%Y-%m-%d') between #{finishStartTime} and #{finishEndTime}
</if>
<if test="orderStartTime != null and orderStartTime != '' and orderEndTime != null and orderEndTime != ''">
and DATE_FORMAT(hh.create_time,'%Y-%m-%d') between #{orderStartTime} and #{orderEndTime}
</if>
<if test="rentPriceMin != null and rentPriceMax != null">
and hh.costs &gt;= #{rentPriceMin} and hh.costs &lt;= #{rentPriceMax}
</if>
GROUP BY
moi.CODE
</select>