fix conflict

This commit is contained in:
sxu 2024-12-18 16:06:39 +08:00
commit c4ebd6a1d3
11 changed files with 141 additions and 6 deletions

View File

@ -2,9 +2,11 @@ package com.bonus.material.comprehensive.controller;
import com.bonus.common.core.web.controller.BaseController; import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult; 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.DevInfo;
import com.bonus.material.device.domain.vo.DevInfoVo; import com.bonus.material.device.domain.vo.DevInfoVo;
import com.bonus.material.device.service.DevInfoService; import com.bonus.material.device.service.DevInfoService;
import com.bonus.material.order.service.OrderService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -25,11 +27,21 @@ import java.util.List;
public class ComprehensiveController extends BaseController { public class ComprehensiveController extends BaseController {
@Resource @Resource
private DevInfoService devInfoService; private DevInfoService devInfoService;
@Resource
private OrderService orderService;
@ApiOperation(value = "综合查询-装备信息") @ApiOperation(value = "综合查询-装备信息")
@GetMapping("/devList") @GetMapping("/devList")
public AjaxResult getDevList(DevInfo devInfo) { public AjaxResult getDevList(DevInfoVo devInfo) {
startPage(); startPage();
List<DevInfoVo> list = devInfoService.getDevList(devInfo); List<DevInfoVo> list = devInfoService.getDevList(devInfo);
return AjaxResult.success(getDataTable(list)); 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));
}
} }

View File

@ -0,0 +1,48 @@
package com.bonus.material.comprehensive.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* @Authorliang.chao
* @Date2024/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;
}

View File

@ -270,4 +270,7 @@ public class DevInfo extends BaseEntity {
@ApiModelProperty(value = "上传人") @ApiModelProperty(value = "上传人")
private String nickName; private String nickName;
@ApiModelProperty(value = "租赁次数")
private Integer rentNum;
} }

View File

@ -188,6 +188,8 @@ public interface DevInfoMapper {
List<DevInfoVo> getTagDevList(DevInfoVo devInfoVo); List<DevInfoVo> getTagDevList(DevInfoVo devInfoVo);
List<DevInfoVo> getDevList(DevInfo devInfo); List<DevInfoVo> getDevList(DevInfoVo devInfo);
DevInfo getDevStatus(DevInfoVo devInfoVo);
} }

View File

@ -111,5 +111,5 @@ public interface DevInfoService {
List<DevInfoVo> getTagDevList(DevInfoVo devInfoVo); List<DevInfoVo> getTagDevList(DevInfoVo devInfoVo);
List<DevInfoVo> getDevList(DevInfo devInfo); List<DevInfoVo> getDevList(DevInfoVo devInfo);
} }

View File

@ -760,8 +760,18 @@ public class DevInfoServiceImpl implements DevInfoService {
} }
@Override @Override
public List<DevInfoVo> getDevList(DevInfo devInfo) { public List<DevInfoVo> getDevList(DevInfoVo devInfo) {
return devInfoMapper.getDevList(devInfo); Integer rentNum = devInfo.getRentNum();
List<DevInfoVo> 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 @Override

View File

@ -1,6 +1,8 @@
package com.bonus.material.order.mapper; 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.DevInfo;
import com.bonus.material.device.domain.vo.DevInfoVo;
import com.bonus.material.lease.domain.LeaseRepairRecord; import com.bonus.material.lease.domain.LeaseRepairRecord;
import com.bonus.material.order.domain.OrderDetailDto; import com.bonus.material.order.domain.OrderDetailDto;
import com.bonus.material.order.domain.OrderInfoDto; import com.bonus.material.order.domain.OrderInfoDto;
@ -46,4 +48,6 @@ public interface OrderMapper {
// int insertCostReliefs(@Param("list") List<OrderDetailCostReliefDto> reliefList); // int insertCostReliefs(@Param("list") List<OrderDetailCostReliefDto> reliefList);
OrderInfoDto getAgreementByOrderId(String orderId); OrderInfoDto getAgreementByOrderId(String orderId);
List<RentDetailDto> getRentDetails(DevInfoVo devInfo);
} }

View File

@ -1,5 +1,7 @@
package com.bonus.material.order.service; 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.OrderDetailDto;
import com.bonus.material.order.domain.OrderInfoDto; import com.bonus.material.order.domain.OrderInfoDto;
@ -20,4 +22,6 @@ public interface OrderService {
Integer submitCostRelief(OrderInfoDto orderInfoDto); Integer submitCostRelief(OrderInfoDto orderInfoDto);
OrderInfoDto getAgreementByOrderId(String orderId); OrderInfoDto getAgreementByOrderId(String orderId);
List<RentDetailDto> getRentDetails(DevInfoVo devInfo);
} }

View File

@ -5,6 +5,9 @@ import com.bonus.common.biz.enums.OrderStatusEnum;
import com.bonus.common.core.utils.DateUtils; import com.bonus.common.core.utils.DateUtils;
import com.bonus.common.core.utils.encryption.Sm4Utils; import com.bonus.common.core.utils.encryption.Sm4Utils;
import com.bonus.common.security.utils.SecurityUtils; 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.LeaseRepair;
import com.bonus.material.lease.domain.LeaseRepairRecord; import com.bonus.material.lease.domain.LeaseRepairRecord;
import com.bonus.material.lease.mapper.LeaseRepairRecordMapper; import com.bonus.material.lease.mapper.LeaseRepairRecordMapper;
@ -200,4 +203,9 @@ public class OrderServiceImpl implements OrderService {
public OrderInfoDto getAgreementByOrderId(String orderId) { public OrderInfoDto getAgreementByOrderId(String orderId) {
return orderMapper.getAgreementByOrderId(orderId); return orderMapper.getAgreementByOrderId(orderId);
} }
@Override
public List<RentDetailDto> getRentDetails(DevInfoVo devInfo) {
return orderMapper.getRentDetails(devInfo);
}
} }

View File

@ -849,11 +849,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="typeId != null"> <if test="typeId != null">
AND d.type_id = #{typeId} AND d.type_id = #{typeId}
</if> </if>
<if test="maStatus != null">
AND d.ma_status = #{maStatus}
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> <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> </if>
ORDER BY ORDER BY
d.create_time DESC d.create_time DESC
</select> </select>
<select id="getDevStatus" resultType="com.bonus.material.device.domain.DevInfo">
SELECT
COUNT( moi.order_id ) AS rentNum,
mdi.ma_status
FROM
ma_dev_info mdi
LEFT JOIN ma_order_details md ON mdi.ma_id = md.ma_id
LEFT JOIN ma_order_info moi ON moi.order_id = md.order_id
WHERE
mdi.ma_id = #{maId}
GROUP BY
mdi.ma_status
ORDER BY
moi.order_time DESC
</select>
</mapper> </mapper>

View File

@ -317,6 +317,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mt.del_flag = '0' mt.del_flag = '0'
AND hh.order_id = #{orderId} AND hh.order_id = #{orderId}
</select> </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 id="deleteCostReliefs">
delete from ma_order_details_relief delete from ma_order_details_relief