diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/comprehensive/controller/ComprehensiveController.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/comprehensive/controller/ComprehensiveController.java index ab2151b..4059af1 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/comprehensive/controller/ComprehensiveController.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/comprehensive/controller/ComprehensiveController.java @@ -2,9 +2,11 @@ package com.bonus.material.comprehensive.controller; import com.bonus.common.core.web.controller.BaseController; import com.bonus.common.core.web.domain.AjaxResult; +import com.bonus.material.comprehensive.entity.RentDetailDto; import com.bonus.material.device.domain.DevInfo; import com.bonus.material.device.domain.vo.DevInfoVo; import com.bonus.material.device.service.DevInfoService; +import com.bonus.material.order.service.OrderService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.GetMapping; @@ -25,11 +27,21 @@ import java.util.List; public class ComprehensiveController extends BaseController { @Resource private DevInfoService devInfoService; + @Resource + private OrderService orderService; @ApiOperation(value = "综合查询-装备信息") @GetMapping("/devList") - public AjaxResult getDevList(DevInfo devInfo) { + public AjaxResult getDevList(DevInfoVo devInfo) { startPage(); List list = devInfoService.getDevList(devInfo); return AjaxResult.success(getDataTable(list)); } + + @ApiOperation(value = "综合查询-设备租赁明细") + @GetMapping("/rentDetails") + public AjaxResult getRentDetails(DevInfoVo devInfo) { + startPage(); + List list = orderService.getRentDetails(devInfo); + return AjaxResult.success(getDataTable(list)); + } } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/comprehensive/entity/RentDetailDto.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/comprehensive/entity/RentDetailDto.java new file mode 100644 index 0000000..b3861b3 --- /dev/null +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/comprehensive/entity/RentDetailDto.java @@ -0,0 +1,48 @@ +package com.bonus.material.comprehensive.entity; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * @Author:liang.chao + * @Date:2024/12/18 - 14:21 + */ +@Data +public class RentDetailDto { + + @ApiModelProperty("订单编号") + private String orderCode; + + @ApiModelProperty("租赁周期") + private String rentTime; + + @ApiModelProperty("订单状态") + private String orderStatus; + + @ApiModelProperty("租赁费用") + private BigDecimal rentCost; + + @ApiModelProperty("退租检修费用") + private BigDecimal repairCost; + + @ApiModelProperty("丢失费用") + private BigDecimal lossCost; + + @ApiModelProperty("总费用") + private BigDecimal cost; + + @ApiModelProperty("承租公司") + private String rentCompany; + + @ApiModelProperty("承租人") + private String rentPerson; + + @ApiModelProperty("承租人电话") + private String phone; + + @ApiModelProperty("下单时间") + private String orderTime; + +} diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/DevInfo.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/DevInfo.java index e3a4b5d..f582973 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/DevInfo.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/DevInfo.java @@ -270,4 +270,7 @@ public class DevInfo extends BaseEntity { @ApiModelProperty(value = "上传人") private String nickName; + + @ApiModelProperty(value = "租赁次数") + private Integer rentNum; } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/mapper/DevInfoMapper.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/mapper/DevInfoMapper.java index d314c4e..0415553 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/mapper/DevInfoMapper.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/mapper/DevInfoMapper.java @@ -188,6 +188,8 @@ public interface DevInfoMapper { List getTagDevList(DevInfoVo devInfoVo); - List getDevList(DevInfo devInfo); + List getDevList(DevInfoVo devInfo); + + DevInfo getDevStatus(DevInfoVo devInfoVo); } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/DevInfoService.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/DevInfoService.java index f284f1c..99c38c7 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/DevInfoService.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/DevInfoService.java @@ -111,5 +111,5 @@ public interface DevInfoService { List getTagDevList(DevInfoVo devInfoVo); - List getDevList(DevInfo devInfo); + List getDevList(DevInfoVo devInfo); } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java index 62b71f7..0173642 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java @@ -760,8 +760,18 @@ public class DevInfoServiceImpl implements DevInfoService { } @Override - public List getDevList(DevInfo devInfo) { - return devInfoMapper.getDevList(devInfo); + public List getDevList(DevInfoVo devInfo) { + Integer rentNum = devInfo.getRentNum(); + List devList = devInfoMapper.getDevList(devInfo); + for (DevInfoVo devInfoVo : devList) { + DevInfo devInfo1 = devInfoMapper.getDevStatus(devInfoVo); + devInfoVo.setRentNum(devInfo1.getRentNum()); + devInfoVo.setMaStatus(devInfo1.getMaStatus()); + } + if (rentNum != null){ + devList = devList.stream().filter(devInfoVo -> devInfoVo.getRentNum().equals(rentNum)).collect(Collectors.toList()); + } + return devList; } @Override diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/mapper/OrderMapper.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/mapper/OrderMapper.java index b9d986c..09b9fc8 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/mapper/OrderMapper.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/mapper/OrderMapper.java @@ -1,6 +1,8 @@ package com.bonus.material.order.mapper; +import com.bonus.material.comprehensive.entity.RentDetailDto; import com.bonus.material.device.domain.DevInfo; +import com.bonus.material.device.domain.vo.DevInfoVo; import com.bonus.material.lease.domain.LeaseRepairRecord; import com.bonus.material.order.domain.OrderDetailDto; import com.bonus.material.order.domain.OrderInfoDto; @@ -46,4 +48,6 @@ public interface OrderMapper { // int insertCostReliefs(@Param("list") List reliefList); OrderInfoDto getAgreementByOrderId(String orderId); + + List getRentDetails(DevInfoVo devInfo); } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/service/OrderService.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/service/OrderService.java index 94a8726..76053f9 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/service/OrderService.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/service/OrderService.java @@ -1,5 +1,7 @@ package com.bonus.material.order.service; +import com.bonus.material.comprehensive.entity.RentDetailDto; +import com.bonus.material.device.domain.vo.DevInfoVo; import com.bonus.material.order.domain.OrderDetailDto; import com.bonus.material.order.domain.OrderInfoDto; @@ -20,4 +22,6 @@ public interface OrderService { Integer submitCostRelief(OrderInfoDto orderInfoDto); OrderInfoDto getAgreementByOrderId(String orderId); + + List getRentDetails(DevInfoVo devInfo); } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/service/impl/OrderServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/service/impl/OrderServiceImpl.java index 98abfbb..eb676e5 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/service/impl/OrderServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/service/impl/OrderServiceImpl.java @@ -5,6 +5,9 @@ import com.bonus.common.biz.enums.OrderStatusEnum; import com.bonus.common.core.utils.DateUtils; import com.bonus.common.core.utils.encryption.Sm4Utils; import com.bonus.common.security.utils.SecurityUtils; +import com.bonus.material.comprehensive.entity.RentDetailDto; +import com.bonus.material.device.domain.DevInfo; +import com.bonus.material.device.domain.vo.DevInfoVo; import com.bonus.material.lease.domain.LeaseRepair; import com.bonus.material.lease.domain.LeaseRepairRecord; import com.bonus.material.lease.mapper.LeaseRepairRecordMapper; @@ -200,4 +203,9 @@ public class OrderServiceImpl implements OrderService { public OrderInfoDto getAgreementByOrderId(String orderId) { return orderMapper.getAgreementByOrderId(orderId); } + + @Override + public List getRentDetails(DevInfoVo devInfo) { + return orderMapper.getRentDetails(devInfo); + } } diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml index 841a5b8..bdb7d6d 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml @@ -849,11 +849,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND d.type_id = #{typeId} + + AND d.ma_status = #{maStatus} + - AND d.update_time between #{startTime} and #{endTime} + AND d.update_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59') ORDER BY d.create_time DESC + diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/order/OrderInfoMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/order/OrderInfoMapper.xml index 8f0573a..2d612ff 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/order/OrderInfoMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/order/OrderInfoMapper.xml @@ -317,6 +317,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" mt.del_flag = '0' AND hh.order_id = #{orderId} + delete from ma_order_details_relief