10 changed files with 384 additions and 8 deletions
@ -0,0 +1,43 @@ |
|||||
|
package com.qs.serve.modules.vtb.controller; |
||||
|
|
||||
|
import com.qs.serve.common.model.dto.PageVo; |
||||
|
import com.qs.serve.common.model.dto.R; |
||||
|
import com.qs.serve.modules.vtb.entity.dto.VtbActivityCheckDTO; |
||||
|
import com.qs.serve.modules.vtb.entity.so.VtbActivityCheckSo; |
||||
|
import com.qs.serve.modules.vtb.mapper.VtbVerReportMapper; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2023/9/4 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@AllArgsConstructor |
||||
|
@RestController |
||||
|
@RequestMapping("vtb/data") |
||||
|
public class VtbVerificationDataController { |
||||
|
|
||||
|
private final VtbVerReportMapper verReportMapper; |
||||
|
|
||||
|
@GetMapping("pageActivityCheck") |
||||
|
public R<?> getActivityData(VtbActivityCheckSo query){ |
||||
|
Long count = verReportMapper.countActivityCheck(query); |
||||
|
if(count>0){ |
||||
|
List<VtbActivityCheckDTO> list = verReportMapper.pageActivityCheck(query); |
||||
|
PageVo<VtbActivityCheckDTO> page = new PageVo<>(); |
||||
|
page.initPageByTotal(count); |
||||
|
page.setList(list); |
||||
|
return R.ok(page); |
||||
|
} |
||||
|
return R.byEmptyList(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,68 @@ |
|||||
|
package com.qs.serve.modules.vtb.entity.dto; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import lombok.Data; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.time.LocalDateTime; |
||||
|
|
||||
|
/** |
||||
|
* 活动的核销情况 |
||||
|
* @author YenHex |
||||
|
* @since 2023/9/4 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class VtbActivityCheckDTO { |
||||
|
|
||||
|
private String costApplyId; |
||||
|
|
||||
|
/** 费用编码 */ |
||||
|
private String costApplyCode; |
||||
|
|
||||
|
private String costTitle; |
||||
|
|
||||
|
/** 客户id */ |
||||
|
private String supplierId; |
||||
|
|
||||
|
private String supplierCode; |
||||
|
|
||||
|
private String supplierName; |
||||
|
|
||||
|
/** 提交实际 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
private LocalDateTime submitTime; |
||||
|
|
||||
|
/** 活动编码 */ |
||||
|
private String activityCode; |
||||
|
|
||||
|
private String activityTitle; |
||||
|
|
||||
|
private String activityAmount; |
||||
|
|
||||
|
/** 核销金额 */ |
||||
|
private String checkAmount; |
||||
|
|
||||
|
/** 核销完成 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
private LocalDateTime checkFinishedDate; |
||||
|
|
||||
|
/** 释放标识 */ |
||||
|
private Integer releaseFlag; |
||||
|
|
||||
|
/** 释放金额 */ |
||||
|
private BigDecimal releaseAmount; |
||||
|
|
||||
|
/** 释放时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
private LocalDateTime releaseTime; |
||||
|
|
||||
|
/** 释放人员id */ |
||||
|
private String releaseUserId; |
||||
|
|
||||
|
/** 释放人员 */ |
||||
|
private String releaseUserName; |
||||
|
} |
@ -0,0 +1,68 @@ |
|||||
|
package com.qs.serve.modules.vtb.entity.dto; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import lombok.Data; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.time.LocalDateTime; |
||||
|
|
||||
|
/** |
||||
|
* 活动的核销情况 |
||||
|
* @author YenHex |
||||
|
* @since 2023/9/4 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class VtbVerificationDTO { |
||||
|
|
||||
|
private String costApplyId; |
||||
|
|
||||
|
/** 费用编码 */ |
||||
|
private String costApplyCode; |
||||
|
|
||||
|
private String costTitle; |
||||
|
|
||||
|
/** 客户id */ |
||||
|
private String supplierId; |
||||
|
|
||||
|
private String supplierCode; |
||||
|
|
||||
|
private String supplierName; |
||||
|
|
||||
|
/** 提交实际 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
private LocalDateTime submitTime; |
||||
|
|
||||
|
/** 活动编码 */ |
||||
|
private String activityCode; |
||||
|
|
||||
|
private String activityTitle; |
||||
|
|
||||
|
private String activityAmount; |
||||
|
|
||||
|
/** 核销金额 */ |
||||
|
private String checkAmount; |
||||
|
|
||||
|
/** 核销完成 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
private LocalDateTime checkFinishedDate; |
||||
|
|
||||
|
/** 释放标识 */ |
||||
|
private Integer releaseFlag; |
||||
|
|
||||
|
/** 释放金额 */ |
||||
|
private BigDecimal releaseAmount; |
||||
|
|
||||
|
/** 释放时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
private LocalDateTime releaseTime; |
||||
|
|
||||
|
/** 释放人员id */ |
||||
|
private String releaseUserId; |
||||
|
|
||||
|
/** 释放人员 */ |
||||
|
private String releaseUserName; |
||||
|
} |
@ -0,0 +1,58 @@ |
|||||
|
package com.qs.serve.modules.vtb.entity.so; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import lombok.Data; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.time.LocalDateTime; |
||||
|
|
||||
|
/** |
||||
|
* 活动的核销情况 |
||||
|
* @author YenHex |
||||
|
* @since 2023/9/4 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class VtbActivityCheckSo { |
||||
|
|
||||
|
/** 费用编码 */ |
||||
|
private String costApplyCode; |
||||
|
|
||||
|
private String costTitle; |
||||
|
|
||||
|
/** 客户 */ |
||||
|
private String supplierCode; |
||||
|
|
||||
|
private String supplierName; |
||||
|
|
||||
|
/** 活动编码 */ |
||||
|
private String activityCode; |
||||
|
|
||||
|
private String activityTitle; |
||||
|
|
||||
|
|
||||
|
/** 提交开始时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
private LocalDateTime queryStartSubmitTime; |
||||
|
|
||||
|
/** 提交结束时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
private LocalDateTime queryEndSubmitTime; |
||||
|
|
||||
|
/** 核销开始时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
private LocalDateTime queryStartCheckTime; |
||||
|
|
||||
|
/** 核销开始时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
private LocalDateTime queryEndCheckTime; |
||||
|
|
||||
|
private Integer pageSize; |
||||
|
|
||||
|
private Integer startRow; |
||||
|
|
||||
|
} |
@ -0,0 +1,8 @@ |
|||||
|
package com.qs.serve.modules.vtb.entity.so; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2023/9/4 |
||||
|
*/ |
||||
|
public class VtbVerificationCheckSo { |
||||
|
} |
@ -0,0 +1,25 @@ |
|||||
|
package com.qs.serve.modules.vtb.mapper; |
||||
|
|
||||
|
import com.qs.serve.modules.vtb.entity.dto.VtbActivityCheckDTO; |
||||
|
import com.qs.serve.modules.vtb.entity.dto.VtbVerificationDTO; |
||||
|
import com.qs.serve.modules.vtb.entity.so.VtbActivityCheckSo; |
||||
|
import com.qs.serve.modules.vtb.entity.so.VtbVerificationCheckSo; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2023/9/4 |
||||
|
*/ |
||||
|
public interface VtbVerReportMapper { |
||||
|
|
||||
|
List<VtbActivityCheckDTO> pageActivityCheck(@Param("query") VtbActivityCheckSo query); |
||||
|
|
||||
|
Long countActivityCheck(@Param("query") VtbActivityCheckSo query); |
||||
|
|
||||
|
List<VtbVerificationDTO> pageVerificationCheck(@Param("query") VtbVerificationCheckSo query); |
||||
|
|
||||
|
Long countVerificationCheck(@Param("query") VtbVerificationCheckSo query); |
||||
|
|
||||
|
} |
@ -0,0 +1,91 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.qs.serve.modules.vtb.mapper.VtbVerReportMapper"> |
||||
|
|
||||
|
|
||||
|
<sql id="baseSelectCheckWhere"> |
||||
|
where 1=1 |
||||
|
and tbs_activity.del_flag = 0 |
||||
|
and tbs_activity.cancel_flag = 0 |
||||
|
and tbs_cost_apply.del_flag = 0 |
||||
|
and tbs_cost_apply.charge_state in(2,3) |
||||
|
and tbs_cost_apply.cancel_flag = 0 |
||||
|
<if test="query.activityCode != null and query.activityCode != ''"> and `tbs_activity`.`activity_code` like concat('%',#{query.activityCode},'%')</if> |
||||
|
<if test="query.activityTitle != null and query.activityTitle != ''"> and `tbs_activity`.`act_title` like concat('%',#{query.activityTitle},'%')</if> |
||||
|
<if test="query.queryStartSubmitTime != null and query.queryStartSubmitTime != ''"> and `tbs_cost_apply`.`submit_time` >= #{query.queryStartSubmitTime} </if> |
||||
|
<if test="query.queryEndSubmitTime != null and query.queryEndSubmitTime != ''"> and `tbs_cost_apply`.`submit_time` <= #{query.queryEndSubmitTime} </if> |
||||
|
<if test="query.supplierCode != null and query.supplierCode != ''"> and `tbs_cost_apply`.`supplier_code` like concat('%',#{query.supplierCode},'%') </if> |
||||
|
<if test="query.supplierName != null and query.supplierName != ''"> and `tbs_cost_apply`.`supplier_name` like concat('%',#{query.supplierName},'%') </if> |
||||
|
<if test="query.costApplyCode != null and query.costApplyCode != ''"> and `tbs_cost_apply`.`code` like concat('%',#{query.costApplyCode},'%') </if> |
||||
|
<if test="query.costTitle != null and query.costTitle != ''"> and `tbs_cost_apply`.`charge_theme` like concat('%',#{query.costTitle},'%') </if> |
||||
|
</sql> |
||||
|
|
||||
|
<select id="pageActivityCheck" resultType="com.qs.serve.modules.vtb.entity.dto.VtbActivityCheckDTO"> |
||||
|
select |
||||
|
tbs_cost_apply.`id` as costApplyId, |
||||
|
tbs_cost_apply.`code` as costApplyCode, |
||||
|
tbs_cost_apply.charge_theme as costTitle, |
||||
|
tbs_cost_apply.supplier_id , |
||||
|
tbs_cost_apply.supplier_code , |
||||
|
tbs_cost_apply.supplier_name , |
||||
|
tbs_cost_apply.submit_time , |
||||
|
tbs_activity.activity_code, |
||||
|
tbs_activity.act_title as activity_title, |
||||
|
tbs_activity.total_amount as activity_amount, |
||||
|
vvtb.act_check_amt as check_amount, |
||||
|
vvtb.vtb_finished_date as check_finished_date, |
||||
|
tbs_activity.`release_flag`, |
||||
|
tbs_activity.`release_amount`, |
||||
|
tbs_activity.`release_time`, |
||||
|
tbs_activity.`release_user_id`, |
||||
|
tbs_activity.`release_user_name` |
||||
|
from tbs_activity |
||||
|
left join tbs_cost_apply on tbs_activity.cost_apply_id = tbs_cost_apply.id |
||||
|
left join ( |
||||
|
select |
||||
|
vtb.activity_id, |
||||
|
sum(vtb.amount) as act_check_amt, |
||||
|
max(vtb.finished_time) as vtb_finished_date |
||||
|
from vtb_verification vtb |
||||
|
where |
||||
|
vtb.del_flag = 0 |
||||
|
<if test="query.queryStartCheckTime != null and query.queryStartCheckTime != ''"> |
||||
|
and vtb.finished_time >= #{query.queryStartCheckTime} </if> |
||||
|
<if test="query.queryEndSubmitTime != null and query.queryEndSubmitTime != ''"> |
||||
|
and vtb.finished_time <= #{query.queryEndSubmitTime} </if> |
||||
|
group by vtb.activity_id |
||||
|
) vvtb on vvtb.activity_id = tbs_activity.id |
||||
|
<include refid="baseSelectCheckWhere"></include> |
||||
|
limit #{query.startRow},#{query.pageSize} |
||||
|
</select> |
||||
|
|
||||
|
<select id="countActivityCheck" resultType="java.lang.Long"> |
||||
|
select |
||||
|
count(1) |
||||
|
from tbs_activity |
||||
|
left join tbs_cost_apply on tbs_activity.cost_apply_id = tbs_cost_apply.id |
||||
|
left join ( |
||||
|
select |
||||
|
vtb.activity_id |
||||
|
from vtb_verification vtb |
||||
|
where |
||||
|
vtb.del_flag = 0 |
||||
|
<if test="query.queryStartCheckTime != null and query.queryStartCheckTime != ''"> |
||||
|
and vtb.finished_time >= #{query.queryStartCheckTime} </if> |
||||
|
<if test="query.queryEndSubmitTime != null and query.queryEndSubmitTime != ''"> |
||||
|
and vtb.finished_time <= #{query.queryEndSubmitTime} </if> |
||||
|
group by vtb.activity_id |
||||
|
) vvtb on vvtb.activity_id = tbs_activity.id |
||||
|
<include refid="baseSelectCheckWhere"></include> |
||||
|
</select> |
||||
|
|
||||
|
|
||||
|
<select id="pageVerificationCheck" resultType="com.qs.serve.modules.vtb.entity.dto.VtbVerificationDTO"> |
||||
|
|
||||
|
</select> |
||||
|
|
||||
|
<select id="countVerificationCheck" resultType="java.lang.Long"> |
||||
|
|
||||
|
</select> |
||||
|
</mapper> |
||||
|
|
Loading…
Reference in new issue