cbs 支付 代发代扣

This commit is contained in:
xiang2lin 2024-06-26 17:02:10 +08:00
parent 6779afc801
commit cd8dba9b1d
15 changed files with 565 additions and 34 deletions

View File

@ -0,0 +1,12 @@
package com.hzya.frame.seeyon.cbs8.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentEntity;
/**
* @Description 代发代扣
* @Author xiangerlin
* @Date 2024/6/26 10:50
**/
public interface IAgentPaymentDao extends IBaseDao<AgentPaymentEntity,String> {
}

View File

@ -0,0 +1,12 @@
package com.hzya.frame.seeyon.cbs8.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentDetailEntity;
/**
* @Description 代发代扣明细
* @Author xiangerlin
* @Date 2024/6/26 10:54
**/
public interface IAgentPaymentDetailDao extends IBaseDao<AgentPaymentDetailEntity,String> {
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.seeyon.cbs8.dao.impl;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.seeyon.cbs8.dao.IAgentPaymentDao;
import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentEntity;
import org.springframework.stereotype.Repository;
/**
* @Description
* @Author xiangerlin
* @Date 2024/6/26 10:51
**/
@Repository("OAAgentPaymentDaoImpl")
public class AgentPaymentDaoImpl extends MybatisGenericDao<AgentPaymentEntity,String> implements IAgentPaymentDao {
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.seeyon.cbs8.dao.impl;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.seeyon.cbs8.dao.IAgentPaymentDetailDao;
import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentDetailEntity;
import org.springframework.stereotype.Repository;
/**
* @Description
* @Author xiangerlin
* @Date 2024/6/26 10:55
**/
@Repository("OAAgentPaymentDetailDaoImpl")
public class AgentPaymentDetailDaoImpl extends MybatisGenericDao<AgentPaymentDetailEntity,String> implements IAgentPaymentDetailDao {
}

View File

@ -8,6 +8,7 @@ import com.hzya.frame.web.entity.BaseEntity;
* @Date 2024/6/18 14:58 * @Date 2024/6/18 14:58
**/ **/
public class AgentPaymentDetailEntity extends BaseEntity { public class AgentPaymentDetailEntity extends BaseEntity {
//每笔明细金额
private String dtlAmount; private String dtlAmount;
//收款账号 //收款账号
private String dtlRevAccount; private String dtlRevAccount;
@ -25,6 +26,11 @@ public class AgentPaymentDetailEntity extends BaseEntity {
//明细序号从1开始递增 //明细序号从1开始递增
private int dtlSeqNum; private int dtlSeqNum;
//支付结果
private String payResult;
//支付日期
private String payDate;
public String getDtlAmount() { public String getDtlAmount() {
return dtlAmount; return dtlAmount;
} }
@ -88,4 +94,20 @@ public class AgentPaymentDetailEntity extends BaseEntity {
public void setDtlSeqNum(int dtlSeqNum) { public void setDtlSeqNum(int dtlSeqNum) {
this.dtlSeqNum = dtlSeqNum; this.dtlSeqNum = dtlSeqNum;
} }
public String getPayResult() {
return payResult;
}
public void setPayResult(String payResult) {
this.payResult = payResult;
}
public String getPayDate() {
return payDate;
}
public void setPayDate(String payDate) {
this.payDate = payDate;
}
} }

View File

@ -0,0 +1,84 @@
<?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.hzya.frame.seeyon.cbs8.dao.impl.AgentPaymentDetailDaoImpl">
<resultMap id="get-AgentPaymentDetailEntity-result" type="com.hzya.frame.seeyon.cbs8.entity.AgentPaymentDetailEntity">
<result property="id" column="id" />
<result property="formmainId" column="formmainId" />
<result property="tabName" column="tabName" />
<result property="dtlSeqNum" column="dtlSeqNum" />
<result property="dtlAmount" column="dtlAmount" />
<result property="dtlRevAccount" column="dtlRevAccount" />
<result property="dtlCnapsCode" column="dtlCnapsCode" />
<result property="dtlRevName" column="dtlRevName" />
<result property="dtlRevBankName" column="dtlRevBankName" />
<result property="payResult" column="payResult" />
<result property="payDate" column="payDate" />
</resultMap>
<sql id="AgentPaymentDetailEntity_Base_Column_List">
id,
formmainId,
tabName,
dtlSeqNum,
dtlAmount,
dtlRevAccount,
dtlCnapsCode,
dtlRevName,
dtlRevBankName,
payResult,
payDate
</sql>
<!-- 采用==查询 -->
<select id="entity_list_base" resultMap="get-AgentPaymentDetailEntity-result" parameterType="com.hzya.frame.seeyon.cbs8.entity.AgentPaymentDetailEntity">
select
<include refid="AgentPaymentDetailEntity_Base_Column_List"/>
from (
SELECT
formson_0225.id,
formson_0225.formmain_id AS formmainId,
'formson_0225' AS tabName,
formson_0225.field0001 AS dtlSeqNum,
formson_0225.field0019 AS dtlAmount,
formson_0225.field0036 AS dtlRevAccount,
formson_0225.field0035 AS dtlCnapsCode,
formson_0225.field0037 AS dtlRevName,
formson_0225.field0034 AS dtlRevBankName,
formson_0225.field0044 AS payResult,
formson_0225.field0045 AS payDate
FROM
formson_0225
)formson_0225
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id !='' "> formson_0225.id = #{id} </if>
<if test="formmainId != null and formmainId !='' "> and formson_0225.formmainId = #{formmainId} </if>
<if test="tabName != null and tabName !='' "> and formson_0225.tabName = #{tabName} </if>
<if test="dtlSeqNum != null and dtlSeqNum !='' "> and formson_0225.dtlSeqNum = #{dtlSeqNum} </if>
<if test="dtlAmount != null and dtlAmount !='' "> and formson_0225.dtlAmount = #{dtlAmount} </if>
<if test="dtlRevAccount != null and dtlRevAccount !='' "> and formson_0225.dtlRevAccount = #{dtlRevAccount} </if>
<if test="dtlCnapsCode != null and dtlCnapsCode !='' "> and formson_0225.dtlCnapsCode = #{dtlCnapsCode} </if>
<if test="dtlRevName != null and dtlRevName !='' "> and formson_0225.dtlRevName = #{dtlRevName} </if>
<if test="dtlRevBankName != null and dtlRevBankName !='' "> and formson_0225.dtlRevBankName = #{dtlRevBankName} </if>
</trim>
</select>
<update id="entity_update" parameterType="com.hzya.frame.seeyon.cbs8.entity.AgentPaymentDetailEntity">
update formson_0225 set
<trim suffix="" suffixOverrides=",">
<if test="payDate != null and payDate !='' ">field0045 =#{payDate},</if>
<if test="payResult != null and payResult !='' ">field0044 =#{payResult}</if>
</trim>
where id = #{id}
</update>
<!-- 更新支付结果 -->
<update id="entity_update_result" parameterType="com.hzya.frame.seeyon.cbs8.entity.AgentPaymentDetailEntity">
update formson_0225 set
<trim suffix="" suffixOverrides=",">
<if test="payDate != null and payDate !='' ">field0045 =#{payDate},</if>
<if test="payResult != null and payResult !='' ">field0044 =#{payResult}</if>
</trim>
where field0001=#{dtlSeqNum} and field0019=#{dtlAmount} and field0035=#{dtlCnapsCode} and field0037=#{dtlRevName}
</update>
</mapper>

View File

@ -9,6 +9,11 @@ import com.hzya.frame.web.entity.BaseEntity;
**/ **/
public class AgentPaymentEntity extends BaseEntity { public class AgentPaymentEntity extends BaseEntity {
//oa id
private String oaId;
private String finishedflag;
//流程标题
private String title;
//业务参考号 //业务参考号
private String referenceNum; private String referenceNum;
/** /**
@ -26,7 +31,10 @@ public class AgentPaymentEntity extends BaseEntity {
private String payAccount; private String payAccount;
//用途 //用途
private String purpose; private String purpose;
//申请单号
private String applyCode;
//支付结果
private String payResult;
private String tableName;//表名称 private String tableName;//表名称
private String billName;//单据名称 private String billName;//单据名称
@ -94,4 +102,44 @@ public class AgentPaymentEntity extends BaseEntity {
public void setBillName(String billName) { public void setBillName(String billName) {
this.billName = billName; this.billName = billName;
} }
public String getOaId() {
return oaId;
}
public void setOaId(String oaId) {
this.oaId = oaId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getFinishedflag() {
return finishedflag;
}
public void setFinishedflag(String finishedflag) {
this.finishedflag = finishedflag;
}
public String getApplyCode() {
return applyCode;
}
public void setApplyCode(String applyCode) {
this.applyCode = applyCode;
}
public String getPayResult() {
return payResult;
}
public void setPayResult(String payResult) {
this.payResult = payResult;
}
} }

View File

@ -0,0 +1,126 @@
<?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.hzya.frame.seeyon.cbs8.dao.impl.AgentPaymentDaoImpl">
<resultMap id="get-AgentPaymentEntity-result" type="com.hzya.frame.seeyon.cbs8.entity.AgentPaymentEntity">
<result property="oaId" column="oaId" />
<result property="title" column="title" />
<result property="finishedflag" column="finishedflag" />
<result property="referenceNum" column="referenceNum" />
<result property="busType" column="busType" />
<result property="amount" column="amount" />
<result property="currency" column="currency" />
<result property="payAccount" column="payAccount" />
<result property="purpose" column="purpose" />
<result property="tableName" column="tableName" />
<result property="billName" column="billName" />
<result property="applyCode" column="applyCode" />
<result property="payResult" column="payResult" />
</resultMap>
<sql id="AgentPaymentEntity_Base_Column_List">
oaId,
tableName,
finishedflag,
title,
billName,
referenceNum,
busType,
amount,
currency,
payAccount,
applyCode,
payResult,
purpose
</sql>
<!-- 采用==查询 -->
<select id="entity_list_base" resultMap="get-AgentPaymentEntity-result" parameterType="com.hzya.frame.seeyon.cbs8.entity.AgentPaymentEntity">
select
<include refid="AgentPaymentEntity_Base_Column_List"/>
from (
SELECT
formmain_0224.id AS oaId,
'formmain_0224' as tableName,
formmain_0224.finishedflag,
COL_SUMMARY.SUBJECT AS title,
'工资表' AS billName,
formmain_0224.field0002 AS referenceNum,
'203' AS busType,
formmain_0224.field0020 AS amount,
'10' AS currency,
'755915707610112' AS payAccount,
formmain_0224.field0043 AS applyCode,
formmain_0224.field0046 AS payResult,
'工资' AS purpose
FROM
formmain_0224
LEFT JOIN COL_SUMMARY ON COL_SUMMARY.FORM_RECORDID = formmain_0224.id
)formmain_0224
<trim prefix="where" prefixOverrides="and">
<if test="referenceNum != null and referenceNum !='' "> formmain_0224.referenceNum = #{referenceNum} </if>
<if test="busType != null and busType !='' "> and formmain_0224.busType = #{busType} </if>
<if test="amount != null and amount !='' ">and formmain_0224.amount = #{amount} </if>
<if test="currency != null and currency !='' "> and formmain_0224.currency = #{currency} </if>
<if test="payAccount != null and payAccount !='' ">and formmain_0224.payAccount = #{payAccount} </if>
<if test="applyCode != null and applyCode !='' ">and formmain_0224.applyCode = #{applyCode} </if>
<if test="payResult != null and payResult !='' ">and formmain_0224.payResult = #{payResult} </if>
<if test="purpose != null and purpose !='' "> and formmain_0224.purpose = #{purpose} </if>
<if test="tableName != null and tableName !='' "> and formmain_0224.tableName = #{tableName} </if>
<if test="oaId != null and oaId !='' ">and formmain_0224.oaId = #{oaId} </if>
<if test="title != null and title !='' "> and formmain_0224.title = #{title} </if>
<if test="billName != null and billName !='' "> and formmain_0224.billName = #{billName} </if>
<if test="finishedflag != null and finishedflag !='' "> and formmain_0224.finishedflag = #{finishedflag} </if>
</trim>
</select>
<select id="entity_list_base_unpaid" resultMap="get-AgentPaymentEntity-result" parameterType="com.hzya.frame.seeyon.cbs8.entity.AgentPaymentEntity">
select
<include refid="AgentPaymentEntity_Base_Column_List"/>
from (
SELECT
formmain_0224.id AS oaId,
'formmain_0224' as tableName,
formmain_0224.finishedflag,
COL_SUMMARY.SUBJECT AS title,
'工资表' AS billName,
formmain_0224.field0002 AS referenceNum,
'203' AS busType,
formmain_0224.field0020 AS amount,
'10' AS currency,
'755915707610112' AS payAccount,
formmain_0224.field0043 AS applyCode,
formmain_0224.field0046 AS payResult,
'工资' AS purpose
FROM
formmain_0224
LEFT JOIN COL_SUMMARY ON COL_SUMMARY.FORM_RECORDID = formmain_0224.id
)formmain_0224
<trim prefix="where" prefixOverrides="and">
<if test="referenceNum != null and referenceNum !='' "> formmain_0224.referenceNum = #{referenceNum} </if>
<if test="busType != null and busType !='' "> and formmain_0224.busType = #{busType} </if>
<if test="amount != null and amount !='' ">and formmain_0224.amount = #{amount} </if>
<if test="currency != null and currency !='' "> and formmain_0224.currency = #{currency} </if>
<if test="payAccount != null and payAccount !='' ">and formmain_0224.payAccount = #{payAccount} </if>
<if test="applyCode != null and applyCode !='' ">and formmain_0224.applyCode = #{applyCode} </if>
<if test="purpose != null and purpose !='' "> and formmain_0224.purpose = #{purpose} </if>
<if test="tableName != null and tableName !='' "> and formmain_0224.tableName = #{tableName} </if>
<if test="oaId != null and oaId !='' ">and formmain_0224.oaId = #{oaId} </if>
<if test="title != null and title !='' "> and formmain_0224.title = #{title} </if>
<if test="billName != null and billName !='' "> and formmain_0224.billName = #{billName} </if>
<if test="finishedflag != null and finishedflag !='' "> and formmain_0224.finishedflag = #{finishedflag} </if>
</trim>
and formmain_0224.applyCode is null
and formmain_0224.payResult is null
</select>
<update id="entity_update" parameterType="com.hzya.frame.seeyon.cbs8.entity.AgentPaymentEntity">
update formmain_0224 set
<trim suffix="" suffixOverrides=",">
<if test="applyCode != null and applyCode !='' ">field0043 =#{applyCode},</if>
<if test="payResult != null and payResult !='' ">field0046 =#{payResult}</if>
</trim>
where id = #{oaId}
</update>
</mapper>

View File

@ -10,6 +10,7 @@ import com.hzya.frame.web.entity.BaseEntity;
public class PaymentEntity extends BaseEntity { public class PaymentEntity extends BaseEntity {
private String oaId;//主表id private String oaId;//主表id
private String formsonId;//明细表id
private String payCompany;//付款公司 private String payCompany;//付款公司
private String title;//流程标题 private String title;//流程标题
private String tableName;//表名称 private String tableName;//表名称
@ -19,12 +20,14 @@ public class PaymentEntity extends BaseEntity {
private String busType;//业务类型 private String busType;//业务类型
private String payResultField;//支付结果字段 private String payResultField;//支付结果字段
private String payDateField;//打款日期字段 private String payDateField;//打款日期字段
private String applyCodeField;//支付申请单号字段
private String receiptFiled;//电子回单字段 private String receiptFiled;//电子回单字段
private String summaryId;//summaryid private String summaryId;//summaryid
private String startDate;//单据日期 private String startDate;//单据日期
private String finishedflag;//流程状态 private String finishedflag;//流程状态
private String payDate;//打款日期 private String payDate;//打款日期
private String payResult;//支付结果 private String payResult;//支付结果
private String applyCode;//支付申请单号
private String payAccount;//付款账号 private String payAccount;//付款账号
private String payBankName;//付款开户银行 private String payBankName;//付款开户银行
private String amount;//金额 private String amount;//金额
@ -297,4 +300,28 @@ public class PaymentEntity extends BaseEntity {
public void setPayCompanyCode(String payCompanyCode) { public void setPayCompanyCode(String payCompanyCode) {
this.payCompanyCode = payCompanyCode; this.payCompanyCode = payCompanyCode;
} }
public String getFormsonId() {
return formsonId;
}
public void setFormsonId(String formsonId) {
this.formsonId = formsonId;
}
public String getApplyCodeField() {
return applyCodeField;
}
public void setApplyCodeField(String applyCodeField) {
this.applyCodeField = applyCodeField;
}
public String getApplyCode() {
return applyCode;
}
public void setApplyCode(String applyCode) {
this.applyCode = applyCode;
}
} }

View File

@ -17,10 +17,13 @@
<result property="personalFlag" column="personalFlag" /> <result property="personalFlag" column="personalFlag" />
<result property="tableName" column="tableName" /> <result property="tableName" column="tableName" />
<result property="oaId" column="oaId" /> <result property="oaId" column="oaId" />
<result property="formsonId" column="formsonId" />
<result property="payCompany" column="payCompany" /> <result property="payCompany" column="payCompany" />
<result property="billName" column="billName" /> <result property="billName" column="billName" />
<result property="payResultField" column="payResultField" /> <result property="payResultField" column="payResultField" />
<result property="payDateField" column="payDateField" /> <result property="payDateField" column="payDateField" />
<result property="applyCodeField" column="applyCodeField" />
<result property="applyCode" column="applyCode" />
<result property="receiptFiled" column="receiptFiled" /> <result property="receiptFiled" column="receiptFiled" />
<result property="summaryId" column="summaryId" /> <result property="summaryId" column="summaryId" />
<result property="startDate" column="startDate" /> <result property="startDate" column="startDate" />
@ -35,6 +38,7 @@
<sql id="PaymentEntity_Base_Column_List"> <sql id="PaymentEntity_Base_Column_List">
oaId, oaId,
formsonId,
payCompany, payCompany,
payCompanyCode, payCompanyCode,
title, title,
@ -44,12 +48,14 @@
busType, busType,
payResultField, payResultField,
payDateField, payDateField,
applyCodeField,
receiptFiled, receiptFiled,
summaryId, summaryId,
startDate, startDate,
finishedflag, finishedflag,
payDate, payDate,
payResult, payResult,
applyCode,
payAccount, payAccount,
payBankName, payBankName,
amount, amount,
@ -68,39 +74,71 @@
<!-- 基础查询语句 --> <!-- 基础查询语句 -->
<sql id="base_sql"> <sql id="base_sql">
SELECT SELECT
formson_0210.id as oaId, formmain_0209.id as oaId, -- 主表id
'formson_0210' as tableName, formson_0210.formsonId,
COL_SUMMARY.SUBJECT as title, 'formson_0210' as tableName, -- 表名
unit.name as payCompany, COL_SUMMARY.SUBJECT as title, -- 单据标题
unit.name as payCompany, -- 付款公司
'差旅费报销单' as billName, '差旅费报销单' as billName,
'field0072' as payResultField, 'field0072' as payResultField, -- 支付结果字段
'field0073' as payDateField, 'field0073' as payDateField, -- 打款日期字段
'' as receiptFiled, 'field0080' AS applyCodeField,-- CBS支付申请单号
'' as receiptFiled,-- 电子回单字段
COL_SUMMARY.id as summaryId, COL_SUMMARY.id as summaryId,
formmain_0209.field0017||'-'||formson_0210.sort as referenceNum, formmain_0209.field0017||'-'||formson_0210.sort as referenceNum, -- 单据编号
formmain_0209.START_DATE as startDate, formmain_0209.START_DATE as startDate, -- 单据日期
formmain_0209.FINISHEDFLAG as finishedflag, formmain_0209.FINISHEDFLAG as finishedflag, -- 流程状态
formson_0210.field0073 as payDate, formson_0210.field0073 as payDate, -- 打款日期
formson_0210.field0072 as payResult, formson_0210.field0072 as payResult, -- 支付结果
REGEXP_REPLACE(formmain_0209.field0042, '[[:space:]]', '') as payAccount, formson_0210.field0080 AS applyCode,-- 支付申请单号
REGEXP_REPLACE(formmain_0209.field0041, '[[:space:]]', '') as payBankName, REGEXP_REPLACE(formmain_0209.field0042, '[[:space:]]', '') as payAccount, -- 付款账户
formson_0210.field0031 as amount, REGEXP_REPLACE(formmain_0209.field0041, '[[:space:]]', '') as payBankName, -- 付款开户行
formmain_0209.field0038 as purpose, formson_0210.field0031 as amount, -- 金额
formmain_0209.field0038 as cbsAbstract, formmain_0209.field0038 as purpose, -- 用途
REGEXP_REPLACE(formson_0210.field0069, '[[:space:]]', '') as revAccount, formmain_0209.field0038 as cbsAbstract, -- 摘要
formson_0210.field0068 as revBankName, REGEXP_REPLACE(formson_0210.field0069, '[[:space:]]', '') as revAccount, -- 收款账户
'测试' as revAccountName, formson_0210.field0068 as revBankName, -- 收款开户行
REGEXP_REPLACE(formson_0210.field0071, '[[:space:]]', '') as cnapsCode, formson_0210.field0075 as revAccountName, -- 收款人
item.showvalue as personalFlag, REGEXP_REPLACE(formson_0210.field0071, '[[:space:]]', '') as cnapsCode, -- 收款联行号
'OTH' as revBankType, item.ENUMVALUE as personalFlag,-- 公私标记
formson_0210.field0079 as revBankType,
'10' as currency, '10' as currency,
'202' as busType, '202' as busType,
'' as receipt '' as receipt -- 电子回单
from FROM
(
SELECT
WM_CONCAT(id) AS formsonId,
formmain_id,
SUM(field0031) AS field0031,
MIN(sort) AS sort,
field0068,
field0069,
field0071,
field0079,
field0075,
field0070,
field0072,
field0073,
field0080
FROM
formson_0210 formson_0210
WHERE
field0067 = '-5486592002512828355'
GROUP BY
formmain_id,
field0068,
field0069,
field0071,
field0079,
field0075,
field0070,
field0072,
field0073,
field0080
)formson_0210
LEFT JOIN formmain_0209 ON formson_0210.FORMMAIN_ID = formmain_0209.id LEFT JOIN formmain_0209 ON formson_0210.FORMMAIN_ID = formmain_0209.id
LEFT JOIN COL_SUMMARY ON COL_SUMMARY.FORM_RECORDID = formmain_0209.id LEFT JOIN COL_SUMMARY ON COL_SUMMARY.FORM_RECORDID = formmain_0209.id
-- LEFT JOIN CTP_AFFAIR ON CTP_AFFAIR.object_id = COL_SUMMARY.id
left join CTP_ENUM_ITEM item on item.id =formson_0210.field0070 left join CTP_ENUM_ITEM item on item.id =formson_0210.field0070
left join ORG_UNIT unit on unit.id =formmain_0209.field0002 left join ORG_UNIT unit on unit.id =formmain_0209.field0002
</sql> </sql>
@ -129,6 +167,7 @@
<if test="title != null and title !='' "> and v.title = #{title} </if> <if test="title != null and title !='' "> and v.title = #{title} </if>
<if test="billName != null and billName !='' "> and v.billName = #{billName} </if> <if test="billName != null and billName !='' "> and v.billName = #{billName} </if>
<if test="payResult != null and payResult !='' ">and v.payResult = #{payResult} </if> <if test="payResult != null and payResult !='' ">and v.payResult = #{payResult} </if>
<if test="applyCode != null and applyCode !='' ">and v.applyCode = #{applyCode} </if>
<if test="payBankName != null and payBankName !='' ">and v.payBankName = #{payBankName} </if> <if test="payBankName != null and payBankName !='' ">and v.payBankName = #{payBankName} </if>
<if test="payType != null and payType !='' "> and v.payType = #{payType} </if> <if test="payType != null and payType !='' "> and v.payType = #{payType} </if>
<if test="finishedflag != null and finishedflag !='' "> and v.finishedflag = #{finishedflag} </if> <if test="finishedflag != null and finishedflag !='' "> and v.finishedflag = #{finishedflag} </if>
@ -235,7 +274,8 @@
<if test="payBankName != null and payBankName !='' ">and v.payBankName = #{payBankName} </if> <if test="payBankName != null and payBankName !='' ">and v.payBankName = #{payBankName} </if>
<if test="payType != null and payType !='' "> and v.payType = #{payType} </if> <if test="payType != null and payType !='' "> and v.payType = #{payType} </if>
<if test="finishedflag != null and finishedflag !='' "> and v.finishedflag = #{finishedflag} </if> <if test="finishedflag != null and finishedflag !='' "> and v.finishedflag = #{finishedflag} </if>
and v.amount > 0
and v.payResult is null
</trim> </trim>
</select> </select>
@ -285,9 +325,10 @@
update ${tableName} set update ${tableName} set
<trim suffix="" suffixOverrides=","> <trim suffix="" suffixOverrides=",">
<if test="payDate != null and payDate !='' ">${payDateField} =#{payDate},</if> <if test="payDate != null and payDate !='' ">${payDateField} =#{payDate},</if>
<if test="payResult != null and payResult !='' ">${payResultField} =#{payResult}</if> <if test="payResult != null and payResult !='' ">${payResultField} =#{payResult},</if>
<if test="applyCodeField != null and applyCodeField !='' ">${applyCodeField} =#{applyCode}</if>
</trim> </trim>
where id = #{oaId} where id = #{formsonId}
</update> </update>
<!--修改电子回单--> <!--修改电子回单-->

View File

@ -0,0 +1,18 @@
package com.hzya.frame.seeyon.cbs8.service;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentDetailEntity;
import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentEntity;
/**
* @Description 代发代扣明细
* @Author xiangerlin
* @Date 2024/6/26 11:00
**/
public interface IAgentPaymentDetailService extends IBaseService<AgentPaymentDetailEntity,String> {
/**
* 更新明细表支付状态
* @param detail
*/
void updatePayResult(AgentPaymentDetailEntity detail);
}

View File

@ -21,6 +21,14 @@ public interface IAgentPaymentService extends IBaseService<AgentPaymentEntity,St
*/ */
List<AgentPaymentEntity> queryUnpaid(AgentPaymentEntity entity) throws Exception; List<AgentPaymentEntity> queryUnpaid(AgentPaymentEntity entity) throws Exception;
/**
* 根据支付申请单号查询
* @param agentPayment
* @return
* @throws Exception
*/
AgentPaymentEntity queryByApplyCode(AgentPaymentEntity agentPayment)throws Exception;
/** /**
* 查询明细表 * 查询明细表
* @param entity * @param entity
@ -28,4 +36,10 @@ public interface IAgentPaymentService extends IBaseService<AgentPaymentEntity,St
* @throws Exception * @throws Exception
*/ */
List<AgentPaymentDetailEntity> queryDetails(AgentPaymentDetailEntity entity)throws Exception; List<AgentPaymentDetailEntity> queryDetails(AgentPaymentDetailEntity entity)throws Exception;
/**
* 更新支付状态
* @param entity
*/
void updateResult(AgentPaymentEntity entity);
} }

View File

@ -0,0 +1,39 @@
package com.hzya.frame.seeyon.cbs8.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.seeyon.cbs8.dao.IAgentPaymentDetailDao;
import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentDetailEntity;
import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentEntity;
import com.hzya.frame.seeyon.cbs8.service.IAgentPaymentDetailService;
import com.hzya.frame.seeyon.cbs8.service.IAgentPaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @Description
* @Author xiangerlin
* @Date 2024/6/26 11:01
**/
@Service("OAAgentPaymentDetailServiceImpl")
public class AgentPaymentDetailServiceImpl extends BaseService<AgentPaymentDetailEntity,String> implements IAgentPaymentDetailService {
private IAgentPaymentDetailDao agentPaymentDetailDao;
@Autowired
public void setAgentPaymentDetailDao(IAgentPaymentDetailDao agentPaymentDetailDao) {
this.agentPaymentDetailDao = agentPaymentDetailDao;
this.dao = agentPaymentDetailDao;
}
/**
* 更新明细表支付状态
*
* @param detail
*/
@DS("#detail.dataSourceCode")
@Override
public void updatePayResult(AgentPaymentDetailEntity detail) {
agentPaymentDetailDao.update("com.hzya.frame.seeyon.cbs8.dao.impl.AgentPaymentDetailDaoImpl.entity_update_result",detail);
}
}

View File

@ -1,9 +1,17 @@
package com.hzya.frame.seeyon.cbs8.service.impl; package com.hzya.frame.seeyon.cbs8.service.impl;
import cn.hutool.core.util.StrUtil;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.service.impl.BaseService; import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.seeyon.cbs8.dao.IAgentPaymentDao;
import com.hzya.frame.seeyon.cbs8.dao.IAgentPaymentDetailDao;
import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentDetailEntity; import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentDetailEntity;
import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentEntity; import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentEntity;
import com.hzya.frame.seeyon.cbs8.service.IAgentPaymentDetailService;
import com.hzya.frame.seeyon.cbs8.service.IAgentPaymentService; import com.hzya.frame.seeyon.cbs8.service.IAgentPaymentService;
import com.hzya.frame.web.exception.BaseSystemException;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
@ -15,6 +23,16 @@ import java.util.List;
**/ **/
@Service(value = "cbs8AgentPaymentServiceImpl") @Service(value = "cbs8AgentPaymentServiceImpl")
public class AgentPaymentServiceImpl extends BaseService<AgentPaymentEntity,String> implements IAgentPaymentService { public class AgentPaymentServiceImpl extends BaseService<AgentPaymentEntity,String> implements IAgentPaymentService {
private IAgentPaymentDao agentPaymentDao;
@Autowired
private IAgentPaymentDetailService agentPaymentDetailService;
@Autowired
public void setAgentPaymentDao(IAgentPaymentDao agentPaymentDao) {
this.agentPaymentDao = agentPaymentDao;
this.dao = agentPaymentDao;
}
/** /**
* 查询待支付待代发代扣 主表 * 查询待支付待代发代扣 主表
* *
@ -22,8 +40,31 @@ public class AgentPaymentServiceImpl extends BaseService<AgentPaymentEntity,Stri
* @return * @return
* @throws Exception * @throws Exception
*/ */
@DS("#entity.dataSourceCode")
@Override @Override
public List<AgentPaymentEntity> queryUnpaid(AgentPaymentEntity entity) throws Exception { public List<AgentPaymentEntity> queryUnpaid(AgentPaymentEntity entity) throws Exception {
List<AgentPaymentEntity> list = agentPaymentDao.queryList(entity, "com.hzya.frame.seeyon.cbs8.dao.impl.AgentPaymentDaoImpl.entity_list_base_unpaid");
return list;
}
/**
* 根据支付申请单号查询
*
* @param entity
* @return
* @throws Exception
*/
@Override
public AgentPaymentEntity queryByApplyCode(AgentPaymentEntity entity) throws Exception {
if (null != entity && StrUtil.isNotEmpty(entity.getApplyCode())){
List<AgentPaymentEntity> list = agentPaymentDao.query(entity);
if (CollectionUtils.isNotEmpty(list)){
if (list.size() > 1){
throw new BaseSystemException("根据"+entity.getApplyCode()+"查询到多条记录");
}
return list.get(0);
}
}
return null; return null;
} }
@ -34,8 +75,19 @@ public class AgentPaymentServiceImpl extends BaseService<AgentPaymentEntity,Stri
* @return * @return
* @throws Exception * @throws Exception
*/ */
@DS("#entity.dataSourceCode")
@Override @Override
public List<AgentPaymentDetailEntity> queryDetails(AgentPaymentDetailEntity entity) throws Exception { public List<AgentPaymentDetailEntity> queryDetails(AgentPaymentDetailEntity entity) throws Exception {
return null; List<AgentPaymentDetailEntity> list = agentPaymentDetailService.query(entity);
return list;
}
/**
* @param entity
*/
@DS("#entity.dataSourceCode")
@Override
public void updateResult(AgentPaymentEntity entity) {
agentPaymentDao.update("com.hzya.frame.seeyon.cbs8.dao.impl.AgentPaymentDaoImpl.entity_update",entity);
} }
} }

View File

@ -120,11 +120,17 @@ public class PaymentServiceImpl extends BaseService<PaymentEntity,String> implem
if (null != entity if (null != entity
&& StrUtil.isNotEmpty(entity.getTableName()) && StrUtil.isNotEmpty(entity.getTableName())
&& StrUtil.isNotEmpty(entity.getOaId()) && StrUtil.isNotEmpty(entity.getOaId())
&& StrUtil.isNotEmpty(entity.getFormsonId())
&& StrUtil.isNotEmpty(entity.getPayDateField()) && StrUtil.isNotEmpty(entity.getPayDateField())
&& StrUtil.isNotEmpty(entity.getPayResultField())){ && StrUtil.isNotEmpty(entity.getPayResultField())){
String formsonId = entity.getFormsonId();
String[] formsonIdArray = formsonId.split(",");
for (String s : formsonIdArray) {
entity.setFormsonId(s);
paymentDao.update("com.hzya.frame.seeyon.cbs8.entity.PaymentEntity.PaymentEntity_update_payState",entity); paymentDao.update("com.hzya.frame.seeyon.cbs8.entity.PaymentEntity.PaymentEntity_update_payState",entity);
} }
} }
}
/** /**
* 更新电子回单字段 * 更新电子回单字段