Browse Source

支付join维度查询

v1.0
Yen 2 years ago
parent
commit
c22fe42cf0
  1. 8
      src/main/java/com/qs/serve/modules/excel/controller/DateCheckApplyController.java
  2. 122
      src/main/java/com/qs/serve/modules/vtb/entity/dto/PayPaymentItemExtend.java
  3. 6
      src/main/java/com/qs/serve/modules/vtb/entity/so/PayPaymentItemExtendSo.java
  4. 2
      src/main/java/com/qs/serve/modules/vtb/service/impl/VtbVerificationServiceImpl.java
  5. 56
      src/main/resources/mapper/vtb/VtbVerForPayReportMapper.xml

8
src/main/java/com/qs/serve/modules/excel/controller/DateCheckApplyController.java

@ -14,6 +14,7 @@ import com.qs.serve.modules.excel.entity.DataPayMainInfo;
import com.qs.serve.modules.excel.service.DateCheckApplyService;
import com.qs.serve.modules.sys.entity.SysConfig;
import com.qs.serve.modules.sys.service.SysConfigService;
import com.qs.serve.modules.vtb.entity.so.PayPaymentItemExtendSo;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
@ -96,10 +97,9 @@ public class DateCheckApplyController {
*/
@RepeatSubmit
@GetMapping("/getPayJoinList")
@SysLog(module = SystemModule.Verification, title = "客户支付帐", biz = BizType.EXPORT)
public R<DataPayMainInfo> getPayJoinList(DataSupplierSo param){
return R.ok();
public R<DataPayMainInfo> getPayJoinList(PayPaymentItemExtendSo param){
DataPayMainInfo result = dateCheckApplyService.pagePayPaymentItems(param);
return R.ok(result);
}
}

122
src/main/java/com/qs/serve/modules/vtb/entity/dto/PayPaymentItemExtend.java

@ -1,8 +1,130 @@
package com.qs.serve.modules.vtb.entity.dto;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* @author YenHex
* @since 2023/11/15
*/
@Data
public class PayPaymentItemExtend {
/** id */
@TableId(type = IdType.AUTO)
private Long id;
/**
* 支付类型
* pay - 支付
* unPay - 不再支付
**/
private String payType;
/** 支付id */
@NotNull(message = "支付id不能为空")
private Long paymentId;
/** 供应商id */
@NotNull(message = "供应商id不能为空")
private Long supplierId;
/** 支付金额 */
@NotNull(message = "支付金额不能为空")
private BigDecimal itemPayAmount;
/** 核销id */
@NotNull(message = "核销id不能为空")
private Long verificationId;
private String verificationMainCode;
private String verificationCode;
/** 核销科目项id */
@NotNull(message = "核销科目项id不能为空")
private Long verificationSubjectId;
/** 费用申请id */
@NotNull(message = "费用申请id不能为空")
private Long costApplyId;
/** 活动id */
@NotNull(message = "活动id不能为空")
private Long activityId;
private String costApplyCode;
private String costApplyTitle;
/** 活动编码 */
@NotBlank(message = "活动编码不能为空")
@Length(max = 30,message = "活动编码长度不能超过30字")
private String activityCode;
private String activityTitle;
/** 政策项id */
private Long policyItemId;
/** 政策项编码 */
private String policyItemCode;
/** 科目id */
@NotNull(message = "科目id不能为空")
private Long subjectId;
/** 科目编码 */
@NotBlank(message = "科目编码不能为空")
@Length(max = 50,message = "科目编码长度不能超过50字")
private String subjectCode;
/** 科目名称 */
@NotBlank(message = "科目名称不能为空")
@Length(max = 50,message = "科目名称长度不能超过50字")
private String subjectName;
/** 备注 */
@Length(max = 255,message = "备注长度不能超过255字")
private String remark;
/** 创建时间 */
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@TableField(fill = FieldFill.INSERT)
private LocalDateTime createTime;
@TableField(condition = SqlCondition.LIKE)
private String erpId;
@TableField(condition = SqlCondition.LIKE)
private String billNumber;
/** 支付时间 */
@NotNull(message = "支付时间不能为空")
@Length(max = 0,message = "支付时间长度不能超过0字")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private LocalDateTime payTime;
/** 支付时间 */
@NotNull(message = "支付日期不能为空")
@Length(max = 0,message = "支付时间长度不能超过0字")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private LocalDateTime payDate;
}

6
src/main/java/com/qs/serve/modules/vtb/entity/so/PayPaymentItemExtendSo.java

@ -60,6 +60,12 @@ public class PayPaymentItemExtendSo {
@Length(max = 30,message = "活动编码长度不能超过30字")
private String activityCode;
private String activityTitle;
private String costApplyCode;
private String costApplyTitle;
/** 政策项编码 */
private String policyItemCode;

2
src/main/java/com/qs/serve/modules/vtb/service/impl/VtbVerificationServiceImpl.java

@ -1283,7 +1283,7 @@ public class VtbVerificationServiceImpl extends ServiceImpl<VtbVerificationMappe
List<SysSyncLog> sysSyncLogs = sysSyncLogService.list(lqw);
for (SysSyncLog syncLog : sysSyncLogs) {
SysSyncLog syncLogBack = ThirtyVerificationUtil.requestToPayment("to支付请求",syncLog.getRemark(), COST_TO_PAY_API, syncLog.getRequestJson());
if(syncLogBack.getSuccessStatus().equals(1)){
if(syncLogBack.getSuccessStatus()!=null&&syncLogBack.getSuccessStatus().equals(1)){
syncLog.setSuccessStatus(1);
sysSyncLogService.updateById(syncLog);
}else {

56
src/main/resources/mapper/vtb/VtbVerForPayReportMapper.xml

@ -208,6 +208,12 @@
<sql id="payPaymentItemSql">
pay_payment_item.`id`,
pay_payment_item.`verification_main_code`,
pay_payment_item.`verification_code`,
pay_payment_item.`pay_time`,
pay_payment_item.`pay_date`,
pay_payment_item.`bill_number`,
pay_payment_item.`erp_id`,
pay_payment_item.`pay_type`,
pay_payment_item.`payment_id`,
pay_payment_item.`supplier_id`,
@ -215,6 +221,9 @@
pay_payment_item.`verification_id`,
pay_payment_item.`verification_subject_id`,
pay_payment_item.`cost_apply_id`,
cost.`code` as `cost_apply_code`,
cost.`charge_theme` as `cost_apply_title`,
act.`act_title` as `activity_title`,
pay_payment_item.`activity_id`,
pay_payment_item.`activity_code`,
pay_payment_item.`subject_id`,
@ -222,37 +231,27 @@
pay_payment_item.`subject_name`,
pay_payment_item.`remark`,
pay_payment_item.`create_time`,
pay_payment_item.`update_time`,
pay_payment_item.`tenant_id`,
pay_payment_item.`create_by`,
pay_payment_item.`update_by`,
pay_payment_item.`del_flag`,
pay_payment_item.`policy_item_id`,
pay_payment_item.`policy_item_code` </sql>
<sql id="payBaseWhere">
<where>
<if test="query.cancelFlag != null"> and `pay_payment`.`cancel_flag` = #{query.cancelFlag}</if>
<if test="query.id != null"> and `pay_payment_item`.`id` = #{query.id}</if>
and pay_payment_item.del_flag = 0
and vtb.del_flag = 0
and act.del_flag = 0
and act.cancel_flag = 0
and pay_payment.del_flag = 0
<if test="query.payType != null and query.payType != ''"> and `pay_payment_item`.`pay_type` = #{query.payType}</if>
<if test="query.paymentId != null"> and `pay_payment_item`.`payment_id` = #{query.paymentId}</if>
<if test="query.costApplyCode != null and query.costApplyCode != ''"> and `cost`.`code` like concat('%',#{query.costApplyCode},'%') </if>
<if test="query.costApplyTitle != null and query.costApplyTitle != ''"> and `cost`.`charge_theme` like concat('%',#{query.costApplyTitle},'%') </if>
<if test="query.activityTitle != null and query.activityTitle != ''"> and `act`.`act_title` like concat('%',#{query.activityTitle},'%') </if>
<if test="query.supplierId != null"> and `pay_payment_item`.`supplier_id` = #{query.supplierId}</if>
<if test="query.itemPayAmount != null"> and `pay_payment_item`.`item_pay_amount` = #{query.itemPayAmount}</if>
<if test="query.verificationId != null"> and `pay_payment_item`.`verification_id` = #{query.verificationId}</if>
<if test="query.verificationSubjectId != null"> and `pay_payment_item`.`verification_subject_id` = #{query.verificationSubjectId}</if>
<if test="query.costApplyId != null"> and `pay_payment_item`.`cost_apply_id` = #{query.costApplyId}</if>
<if test="query.activityId != null"> and `pay_payment_item`.`activity_id` = #{query.activityId}</if>
<if test="query.activityCode != null and query.activityCode != ''"> and `pay_payment_item`.`activity_code` = #{query.activityCode}</if>
<if test="query.subjectId != null"> and `pay_payment_item`.`subject_id` = #{query.subjectId}</if>
<if test="query.activityCode != null and query.activityCode != ''"> and `pay_payment_item`.`activity_code` like concat('%',#{query.activityCode},'%') </if>
<if test="query.subjectCode != null and query.subjectCode != ''"> and `pay_payment_item`.`subject_code` = #{query.subjectCode}</if>
<if test="query.subjectName != null and query.subjectName != ''"> and `pay_payment_item`.`subject_name` = #{query.subjectName}</if>
<if test="query.createTime != null"> and `pay_payment_item`.`create_time` = #{query.createTime}</if>
<if test="query.updateTime != null"> and `pay_payment_item`.`update_time` = #{query.updateTime}</if>
<if test="query.tenantId != null and query.tenantId != ''"> and `pay_payment_item`.`tenant_id` = #{query.tenantId}</if>
<if test="query.createBy != null and query.createBy != ''"> and `pay_payment_item`.`create_by` = #{query.createBy}</if>
<if test="query.updateBy != null and query.updateBy != ''"> and `pay_payment_item`.`update_by` = #{query.updateBy}</if>
<if test="query.delFlag != null and query.delFlag != ''"> and `pay_payment_item`.`del_flag` = #{query.delFlag}</if>
<if test="query.policyItemId != null"> and `pay_payment_item`.`policy_item_id` = #{query.policyItemId}</if>
<if test="query.policyItemCode != null and query.policyItemCode != ''"> and `pay_payment_item`.`policy_item_code` = #{query.policyItemCode}</if>
<if test="query.costApplyIds!=null and query.costApplyIds.size > 0">
and `pay_payment_item`.`cost_apply_id` in
@ -269,15 +268,28 @@
left join pay_payment on pay_payment_item.payment_id = pay_payment.id
left join vtb_verification vtb on pay_payment_item.verification_id = vtb.id
left join tbs_activity act on act.id = vtb.activity_id
left join tbs_cost_apply cost on cost.id = act.cost_apply_id
<include refid="payBaseWhere"></include>
limit {pageInfo.startIndex},{pageInfo.size}
limit #{pageInfo.startIndex},#{pageInfo.size}
</select>
<select id="countPayItemList" resultType="java.lang.Long">
SELECT count(1)
FROM `pay_payment_item` `pay_payment_item`
left join pay_payment on pay_payment_item.payment_id = pay_payment.id
left join vtb_verification vtb on pay_payment_item.verification_id = vtb.id
left join tbs_activity act on act.id = vtb.activity_id
left join tbs_cost_apply cost on cost.id = act.cost_apply_id
<include refid="payBaseWhere"></include>
</select>
<select id="sumPayItemListAmt" resultType="java.math.BigDecimal">
SELECT SUM(pay_payment_item.item_pay_amount)
FROM `pay_payment_item` `pay_payment_item`
left join pay_payment on pay_payment_item.payment_id = pay_payment.id
left join vtb_verification vtb on pay_payment_item.verification_id = vtb.id
left join tbs_activity act on act.id = vtb.activity_id
left join tbs_cost_apply cost on cost.id = act.cost_apply_id
<include refid="payBaseWhere"></include>
</select>
</mapper>

Loading…
Cancel
Save