综合查询-设备订单详情
This commit is contained in:
parent
9435687ae9
commit
de6cdb60a8
|
|
@ -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,6 +27,8 @@ import java.util.List;
|
|||
public class ComprehensiveController extends BaseController {
|
||||
@Resource
|
||||
private DevInfoService devInfoService;
|
||||
@Resource
|
||||
private OrderService orderService;
|
||||
@ApiOperation(value = "综合查询-装备信息")
|
||||
@GetMapping("/devList")
|
||||
public AjaxResult getDevList(DevInfoVo devInfo) {
|
||||
|
|
@ -32,4 +36,12 @@ public class ComprehensiveController extends BaseController {
|
|||
List<DevInfoVo> list = devInfoService.getDevList(devInfo);
|
||||
return AjaxResult.success(getDataTable(list));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "综合查询-设备租赁明细")
|
||||
@GetMapping("/rentDetails")
|
||||
public AjaxResult getRentDetails(DevInfoVo devInfo) {
|
||||
startPage();
|
||||
List<RentDetailDto> list = orderService.getRentDetails(devInfo);
|
||||
return AjaxResult.success(getDataTable(list));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
}
|
||||
|
|
@ -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.OrderDetailCostReliefDto;
|
||||
import com.bonus.material.order.domain.OrderDetailDto;
|
||||
|
|
@ -45,4 +47,6 @@ public interface OrderMapper {
|
|||
int insertCostReliefs(@Param("list") List<OrderDetailCostReliefDto> reliefList);
|
||||
|
||||
OrderInfoDto getAgreementByOrderId(String orderId);
|
||||
|
||||
List<RentDetailDto> getRentDetails(DevInfoVo devInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.OrderDetailCostReliefDto;
|
||||
import com.bonus.material.order.domain.OrderDetailDto;
|
||||
import com.bonus.material.order.domain.OrderInfoDto;
|
||||
|
|
@ -21,4 +23,6 @@ public interface OrderService {
|
|||
Integer submitCostRelief(OrderInfoDto orderInfoDto);
|
||||
|
||||
OrderInfoDto getAgreementByOrderId(String orderId);
|
||||
|
||||
List<RentDetailDto> getRentDetails(DevInfoVo devInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +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;
|
||||
|
|
@ -189,4 +191,9 @@ public class OrderServiceImpl implements OrderService {
|
|||
public OrderInfoDto getAgreementByOrderId(String orderId) {
|
||||
return orderMapper.getAgreementByOrderId(orderId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RentDetailDto> getRentDetails(DevInfoVo devInfo) {
|
||||
return orderMapper.getRentDetails(devInfo);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -850,7 +850,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND d.type_id = #{typeId}
|
||||
</if>
|
||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||
AND d.update_time between #{startTime} and #{endTime}
|
||||
AND d.update_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
|
||||
</if>
|
||||
ORDER BY
|
||||
d.create_time DESC
|
||||
|
|
|
|||
|
|
@ -302,6 +302,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mt.del_flag = '0'
|
||||
AND hh.order_id = #{orderId}
|
||||
</select>
|
||||
<select id="getRentDetails" resultType="com.bonus.material.comprehensive.entity.RentDetailDto">
|
||||
SELECT
|
||||
moi.`code` as orderCode,
|
||||
CONCAT( md.rent_begin_time, '至', md.rent_end_time ) as rentTime,
|
||||
md.order_status as orderStatus,
|
||||
md.costs as rentCost,
|
||||
COALESCE ( lrr.repair_change_price, lrr.repair_price, 0 ) AS repairCost,
|
||||
COALESCE ( lrr.loss_change_price, lrr.loss_price, 0 ) AS lossCost,
|
||||
COALESCE ( md.costs, 0 ) + COALESCE ( lrr.repair_change_price, lrr.repair_price, 0 ) + COALESCE ( lrr.loss_change_price, lrr.loss_price, 0 ) AS cost,
|
||||
sd.dept_name as rentCompany,
|
||||
su.nick_name as rentPerson,
|
||||
su.phonenumber as phone,
|
||||
moi.order_time as orderTime
|
||||
FROM
|
||||
ma_order_info moi
|
||||
LEFT JOIN ma_order_details md ON moi.order_id = md.order_id
|
||||
LEFT JOIN ma_dev_info mdi ON mdi.ma_id = md.ma_id
|
||||
LEFT JOIN lease_repair_record lrr ON moi.order_id = lrr.order_id
|
||||
AND md.ma_id = lrr.ma_id
|
||||
LEFT JOIN sys_user su ON moi.buyer_id = su.user_id
|
||||
LEFT JOIN sys_dept sd ON moi.buyer_company = sd.dept_id
|
||||
WHERE
|
||||
md.ma_id = #{maId}
|
||||
ORDER BY
|
||||
moi.order_time DESC
|
||||
</select>
|
||||
|
||||
<delete id="deleteCostReliefs">
|
||||
delete from ma_order_details_relief
|
||||
|
|
|
|||
Loading…
Reference in New Issue