20 changed files with 456 additions and 59 deletions
@ -0,0 +1,41 @@ |
|||
package com.qs.serve.modules.bms.entity.so; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import com.fasterxml.jackson.annotation.JsonProperty; |
|||
import com.qs.serve.common.framework.mybatis.handler.meta.SplitStringTypeHandler; |
|||
import com.qs.serve.modules.his.entity.HisUserSupplier; |
|||
import lombok.Data; |
|||
import org.apache.ibatis.type.JdbcType; |
|||
import org.hibernate.validator.constraints.Length; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 供应商 实体类 |
|||
* @author YenHex |
|||
* @since 2022-10-11 |
|||
*/ |
|||
@Data |
|||
public class BmsSupplierSo implements Serializable { |
|||
|
|||
|
|||
/** 名称 */ |
|||
@NotBlank(message = "名称不能为空") |
|||
@Length(max = 20,message = "名称长度不能超过20字") |
|||
private String name; |
|||
|
|||
/** 客户编码 */ |
|||
@NotBlank(message = "客户编码不能为空") |
|||
@Length(max = 20,message = "客户编码长度不能超过20字") |
|||
private String code; |
|||
|
|||
} |
|||
|
@ -0,0 +1,33 @@ |
|||
package com.qs.serve.modules.pay.entity.bo; |
|||
|
|||
import lombok.Data; |
|||
import org.hibernate.validator.constraints.Length; |
|||
|
|||
import javax.validation.constraints.DecimalMin; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 支付 Bo |
|||
* @author YenHex |
|||
* @since 2022-12-15 |
|||
*/ |
|||
@Data |
|||
public class PayUnPaymentBo implements Serializable { |
|||
|
|||
/** 供应商id */ |
|||
@NotNull(message = "供应商id不能为空") |
|||
private Long supplierId; |
|||
|
|||
/** 支付金额 */ |
|||
@DecimalMin(value = "0.01",message = "支付金额必须大于0元") |
|||
@NotNull(message = "支付金额不能为空") |
|||
private BigDecimal payAmount; |
|||
|
|||
/** 备注 */ |
|||
@Length(max = 255,message = "备注长度不能超过255字") |
|||
private String remark; |
|||
|
|||
} |
|||
|
@ -0,0 +1,17 @@ |
|||
package com.qs.serve.modules.pay.entity.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* @author YenHex |
|||
* @since 2023/1/13 |
|||
*/ |
|||
@Data |
|||
public class PaySupplierAmountDto { |
|||
|
|||
private Long supplierId; |
|||
private BigDecimal sumAmount; |
|||
|
|||
} |
@ -0,0 +1,35 @@ |
|||
package com.qs.serve.modules.pay.entity.vo; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* @author YenHex |
|||
* @since 2023/1/13 |
|||
*/ |
|||
@Data |
|||
public class PaySupplierVo { |
|||
|
|||
/** 客户id */ |
|||
private Long supplierId; |
|||
|
|||
/** 客户编号 */ |
|||
private String supplierCode; |
|||
|
|||
/** 客户 */ |
|||
private String supplierName; |
|||
|
|||
/** 已申请费用金额(通过审批) */ |
|||
private BigDecimal sumAmountOfCost; |
|||
|
|||
/** 已核销金额(通过审批)*/ |
|||
private BigDecimal sumAmountOfCheck; |
|||
|
|||
/** 已支付金额 */ |
|||
private BigDecimal sumAmountOfPay; |
|||
|
|||
/** 不再支付金额 */ |
|||
private BigDecimal sumAmountOfUnPay; |
|||
|
|||
} |
@ -0,0 +1,41 @@ |
|||
package com.qs.serve.modules.pay.mapper; |
|||
|
|||
import com.qs.serve.modules.pay.entity.dto.PaySupplierAmountDto; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
/** |
|||
* @author YenHex |
|||
* @since 2023/1/13 |
|||
*/ |
|||
public interface PaySupplierMapper { |
|||
|
|||
/** |
|||
* 统计费用明细 |
|||
* @param supplierIds |
|||
* @return |
|||
*/ |
|||
List<PaySupplierAmountDto> sumCostAmount(@Param("queryList") List<String> supplierIds); |
|||
|
|||
/** |
|||
* 统计核销金额 |
|||
* @param supplierIds |
|||
* @return |
|||
*/ |
|||
List<PaySupplierAmountDto> sumCheckAmount(@Param("queryList") List<String> supplierIds); |
|||
|
|||
/** |
|||
* 统计支付金额 |
|||
* @param supplierIds |
|||
* @return |
|||
*/ |
|||
List<PaySupplierAmountDto> sumPayAmount(@Param("queryList") List<String> supplierIds); |
|||
|
|||
/** |
|||
* 统计未支付金额 |
|||
* @param supplierIds |
|||
* @return |
|||
*/ |
|||
List<PaySupplierAmountDto> sumUnPayAmount(@Param("queryList") List<String> supplierIds); |
|||
|
|||
} |
@ -0,0 +1,76 @@ |
|||
<?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.pay.mapper.PaySupplierMapper"> |
|||
|
|||
<resultMap id="supplierAmountMap" type="com.qs.serve.modules.pay.entity.dto.PaySupplierAmountDto" > |
|||
<result property="supplierId" column="supplier_id"/> |
|||
<result property="sumAmount" column="sum_amount"/> |
|||
</resultMap> |
|||
|
|||
<select id="sumCostAmount" resultMap="supplierAmountMap"> |
|||
SELECT |
|||
supplier_id, |
|||
sum(total_activity_amount) sum_amount |
|||
FROM `tbs_cost_apply` |
|||
<where> |
|||
/*状态:0=未发布;1=审批中;2=待执行;3=完成;4-被驳回*/ |
|||
and `tbs_cost_apply`.`charge_state` in (2,3) |
|||
and `tbs_cost_apply`.`supplier_id` in |
|||
<foreach collection="queryList" item ="selectId" index="i" open="(" close=")" separator=","> |
|||
#{selectId} |
|||
</foreach> |
|||
</where> |
|||
GROUP BY supplier_id |
|||
</select> |
|||
|
|||
<select id="sumCheckAmount" resultMap="supplierAmountMap"> |
|||
SELECT |
|||
supplier_id, |
|||
sum(amount) sum_amount |
|||
FROM `vtb_verification` |
|||
<where> |
|||
/*状态:0=审批中;1=完成;2-中止;3-回滚*/ |
|||
and `vtb_verification`.`verification_state` = 1 |
|||
and `vtb_verification`.`supplier_id` in |
|||
<foreach collection="queryList" item ="selectId" index="i" open="(" close=")" separator=","> |
|||
#{selectId} |
|||
</foreach> |
|||
</where> |
|||
GROUP BY supplier_id |
|||
</select> |
|||
|
|||
<select id="sumPayAmount" resultMap="supplierAmountMap"> |
|||
SELECT |
|||
supplier_id, |
|||
sum(pay_amount) sum_amount |
|||
FROM `pay_payment` |
|||
<where> |
|||
and cancel_flag = '0' |
|||
and pay_type = 'pay' |
|||
and `vtb_verification`.`supplier_id` in |
|||
<foreach collection="queryList" item ="selectId" index="i" open="(" close=")" separator=","> |
|||
#{selectId} |
|||
</foreach> |
|||
</where> |
|||
GROUP BY supplier_id |
|||
</select> |
|||
|
|||
<select id="sumUnPayAmount" resultMap="supplierAmountMap"> |
|||
SELECT |
|||
supplier_id, |
|||
sum(pay_amount) sum_amount |
|||
FROM `pay_payment` |
|||
<where> |
|||
and cancel_flag = '0' |
|||
and pay_type = 'unPay' |
|||
and `vtb_verification`.`supplier_id` in |
|||
<foreach collection="queryList" item ="selectId" index="i" open="(" close=")" separator=","> |
|||
#{selectId} |
|||
</foreach> |
|||
</where> |
|||
GROUP BY supplier_id |
|||
</select> |
|||
|
|||
</mapper> |
Loading…
Reference in new issue