结算改价
This commit is contained in:
parent
a12636fe37
commit
fb18a63163
|
|
@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -31,6 +32,15 @@ public class LeaseRepair {
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
private String finishEndTime;
|
private String finishEndTime;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private String orderStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退租截止结束时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private String orderEndTime;
|
||||||
|
|
||||||
@ApiModelProperty(value = "联系电话")
|
@ApiModelProperty(value = "联系电话")
|
||||||
private String phoneNumber;
|
private String phoneNumber;
|
||||||
|
|
||||||
|
|
@ -38,6 +48,25 @@ public class LeaseRepair {
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
private Date rentEndTime;
|
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 = "承租人")
|
@ApiModelProperty(value = "承租人")
|
||||||
private String leaseName;
|
private String leaseName;
|
||||||
|
|
||||||
|
|
@ -52,4 +81,10 @@ public class LeaseRepair {
|
||||||
|
|
||||||
@ApiModelProperty(value = "是否已填写退租检修内容(0 否,1 是)")
|
@ApiModelProperty(value = "是否已填写退租检修内容(0 否,1 是)")
|
||||||
private Integer isLeaseContent;
|
private Integer isLeaseContent;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否已填写费用改价(0 否,1 是)")
|
||||||
|
private Integer isChangePrice;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "总费用")
|
||||||
|
private BigDecimal totalCost;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ package com.bonus.material.lease.service.impl;
|
||||||
import com.bonus.common.biz.constant.MaterialConstants;
|
import com.bonus.common.biz.constant.MaterialConstants;
|
||||||
import com.bonus.common.biz.domain.BmFileInfo;
|
import com.bonus.common.biz.domain.BmFileInfo;
|
||||||
import com.bonus.common.biz.enums.HttpCodeEnum;
|
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.exception.ServiceException;
|
||||||
import com.bonus.common.core.utils.DateUtils;
|
import com.bonus.common.core.utils.DateUtils;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
|
@ -64,6 +63,19 @@ public class LeaseRepairRecordServiceImpl implements LeaseRepairRecordService {
|
||||||
} else {
|
} else {
|
||||||
leaseRepairVo.setIsLeaseContent(0);
|
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;
|
return list;
|
||||||
|
|
@ -251,7 +263,7 @@ public class LeaseRepairRecordServiceImpl implements LeaseRepairRecordService {
|
||||||
if (CollectionUtils.isNotEmpty(repairPriceList)) {
|
if (CollectionUtils.isNotEmpty(repairPriceList)) {
|
||||||
for (LeaseRepairRecord repairRecord : repairPriceList) {
|
for (LeaseRepairRecord repairRecord : repairPriceList) {
|
||||||
if (repairRecord.getOrderId() == null || repairRecord.getMaId() == null ||
|
if (repairRecord.getOrderId() == null || repairRecord.getMaId() == null ||
|
||||||
repairRecord.getChangeCost() == null) {
|
repairRecord.getRepairChangePrice() == null) {
|
||||||
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.TO_PARAM_NULL.getMsg());
|
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.TO_PARAM_NULL.getMsg());
|
||||||
}
|
}
|
||||||
repairRecord.setChangePriceUser(SecurityUtils.getUserId());
|
repairRecord.setChangePriceUser(SecurityUtils.getUserId());
|
||||||
|
|
@ -262,7 +274,7 @@ public class LeaseRepairRecordServiceImpl implements LeaseRepairRecordService {
|
||||||
if (CollectionUtils.isNotEmpty(scrapPriceList)) {
|
if (CollectionUtils.isNotEmpty(scrapPriceList)) {
|
||||||
for (LeaseRepairRecord scrapRecord : scrapPriceList) {
|
for (LeaseRepairRecord scrapRecord : scrapPriceList) {
|
||||||
if (scrapRecord.getOrderId() == null || scrapRecord.getMaId() == null ||
|
if (scrapRecord.getOrderId() == null || scrapRecord.getMaId() == null ||
|
||||||
scrapRecord.getChangeCost() == null) {
|
scrapRecord.getScrapChangePrice() == null) {
|
||||||
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.TO_PARAM_NULL.getMsg());
|
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.TO_PARAM_NULL.getMsg());
|
||||||
}
|
}
|
||||||
scrapRecord.setChangePriceUser(SecurityUtils.getUserId());
|
scrapRecord.setChangePriceUser(SecurityUtils.getUserId());
|
||||||
|
|
@ -273,7 +285,7 @@ public class LeaseRepairRecordServiceImpl implements LeaseRepairRecordService {
|
||||||
if (CollectionUtils.isNotEmpty(lossPriceList)) {
|
if (CollectionUtils.isNotEmpty(lossPriceList)) {
|
||||||
for (LeaseRepairRecord lossRecord : lossPriceList) {
|
for (LeaseRepairRecord lossRecord : lossPriceList) {
|
||||||
if (lossRecord.getOrderId() == null || lossRecord.getMaId() == null ||
|
if (lossRecord.getOrderId() == null || lossRecord.getMaId() == null ||
|
||||||
lossRecord.getChangeCost() == null) {
|
lossRecord.getLossChangePrice() == null) {
|
||||||
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.TO_PARAM_NULL.getMsg());
|
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.TO_PARAM_NULL.getMsg());
|
||||||
}
|
}
|
||||||
lossRecord.setChangePriceUser(SecurityUtils.getUserId());
|
lossRecord.setChangePriceUser(SecurityUtils.getUserId());
|
||||||
|
|
|
||||||
|
|
@ -217,7 +217,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
'已退租'
|
'已退租'
|
||||||
WHEN hh.order_status = 6 THEN
|
WHEN hh.order_status = 6 THEN
|
||||||
'已完成' ELSE '未知'
|
'已完成' ELSE '未知'
|
||||||
END AS orderStatusName
|
END AS orderStatusName,
|
||||||
|
hh.create_time AS orderTime,
|
||||||
|
hh.costs AS rentPrice
|
||||||
FROM
|
FROM
|
||||||
ma_order_details hh
|
ma_order_details hh
|
||||||
LEFT JOIN ma_order_info moi ON moi.order_id = hh.order_id
|
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 != ''">
|
<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}
|
and DATE_FORMAT(hh.rent_end_time,'%Y-%m-%d') between #{finishStartTime} and #{finishEndTime}
|
||||||
</if>
|
</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 >= #{rentPriceMin} and hh.costs <= #{rentPriceMax}
|
||||||
|
</if>
|
||||||
GROUP BY
|
GROUP BY
|
||||||
moi.CODE
|
moi.CODE
|
||||||
</select>
|
</select>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue