更新代码

This commit is contained in:
xiao-fajia 2024-09-25 19:39:08 +08:00
parent e3188a4c8d
commit 2c8d555fd3
6 changed files with 80 additions and 4 deletions

View File

@ -84,5 +84,16 @@ public class RepairOrderInfoController {
return success(repairOrderInfoService.queryListPage(pageReqVO,page));
}
/**
* 统计未入账和已入账(最简版)
*
* @author 小李
* @date 18:52 2024/9/25
**/
@GetMapping("/census")
@Operation(summary = "统计未入账和已入账")
@PreAuthorize("@ss.hasPermission('repair:order-info:query')")
public CommonResult<?> census() {
return success(repairOrderInfoService.census());
}
}

View File

@ -35,4 +35,13 @@ public interface RepairOrderInfoMapper extends BaseMapper<RepairOrderInfo> {
* @param respVO 查询对象
**/
IPage<RepairOrderInfoRespVO> getOrderPageByStatus(@Param("map") RepairOrderInfoRespVO respVO, Page<RepairOrderInfo> page);
/**
* 统计未入账和已入账(最简版)
*
* @author 小李
* @date 18:52 2024/9/25
**/
RepairOrderCensusVO census();
}

View File

@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.order.service;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.order.entity.RepairOrderInfo;
import cn.iocoder.yudao.module.order.vo.RepairOrderCensusVO;
import cn.iocoder.yudao.module.order.vo.RepairOrderInfoPageReqVO;
import cn.iocoder.yudao.module.order.vo.RepairOrderInfoRespVO;
import cn.iocoder.yudao.module.order.vo.RepairOrderInfoSaveReqVO;
@ -114,4 +115,13 @@ public interface RepairOrderInfoService extends IService<RepairOrderInfo> {
* @date 15:50 2024/9/24
**/
IPage<RepairOrderInfo> getAppraisePage(Page<RepairOrderInfo> page);
/**
* 统计未入账和已入账(最简版)
*
* @author 小李
* @date 18:52 2024/9/25
**/
RepairOrderCensusVO census();
}

View File

@ -10,10 +10,8 @@ import cn.iocoder.yudao.module.custom.service.CustomerBalanceService;
import cn.iocoder.yudao.module.custom.service.CustomerCouponService;
import cn.iocoder.yudao.module.order.entity.RepairOrderInfo;
import cn.iocoder.yudao.module.order.service.RepairOrderInfoService;
import cn.iocoder.yudao.module.order.vo.*;
import cn.iocoder.yudao.module.order.vo.RepairOrderInfoMapper;
import cn.iocoder.yudao.module.order.vo.RepairOrderInfoPageReqVO;
import cn.iocoder.yudao.module.order.vo.RepairOrderInfoRespVO;
import cn.iocoder.yudao.module.order.vo.RepairOrderInfoSaveReqVO;
import cn.iocoder.yudao.module.tickets.entity.Tickets;
import cn.iocoder.yudao.module.tickets.service.TicketsService;
import cn.iocoder.yudao.util.WechatPayConfig;
@ -236,4 +234,15 @@ public class RepairOrderInfoServiceImpl extends ServiceImpl<RepairOrderInfoMappe
.isNotNull(RepairOrderInfo::getCommentDesc);
}));
}
/**
* 统计未入账和已入账(最简版)
*
* @author 小李
* @date 18:52 2024/9/25
**/
@Override
public RepairOrderCensusVO census(){
return baseMapper.census();
}
}

View File

@ -0,0 +1,26 @@
package cn.iocoder.yudao.module.order.vo;
import lombok.Data;
import java.math.BigDecimal;
/**
* 统计用
*
* @author 小李
* @date 18:54 2024/9/25
**/
@Data
public class RepairOrderCensusVO {
/** 已入账 */
private BigDecimal credited;
/** 未入账 */
private BigDecimal notCredited;
/** 线上支付 */
private BigDecimal onlinePay;
/** 现金支付 */
private BigDecimal cashPay;
/** 签单、挂账 */
private BigDecimal signedPay;
}

View File

@ -57,4 +57,15 @@
</if>
order by roi.create_time desc
</select>
<select id="census" resultType="cn.iocoder.yudao.module.order.vo.RepairOrderCensusVO">
SELECT
-- 统计已入账和未入账的数量
SUM(CASE WHEN order_status = '1' THEN pay_money ELSE 0 END) AS credited,
SUM(CASE WHEN order_status = '0' THEN goods_price ELSE 0 END) AS notCredited,
-- 统计已入账的细分情况
SUM(CASE WHEN order_status = '1' AND pay_type = '01' THEN pay_money ELSE 0 END) AS onlinePay,
SUM(CASE WHEN order_status = '1' AND pay_type = '02' THEN pay_money ELSE 0 END) AS cashPay,
SUM(CASE WHEN order_status = '1' AND pay_type = '03' THEN pay_money ELSE 0 END) AS signedPay
FROM repair_order_info;
</select>
</mapper>