Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
17e10b01
Commit
17e10b01
authored
Nov 26, 2024
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MVP1.7.2 工行5次提交_定时任务
parent
72c5e8f5
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
269 additions
and
45 deletions
+269
-45
EkpBankGrantDetail.java
...com/yifu/cloud/plus/v1/ekp/entity/EkpBankGrantDetail.java
+6
-0
EkpBankGrantLog.java
...va/com/yifu/cloud/plus/v1/ekp/entity/EkpBankGrantLog.java
+8
-12
EkpBankGrantLogDetail.java
.../yifu/cloud/plus/v1/ekp/entity/EkpBankGrantLogDetail.java
+2
-1
EkpBankResultVo.java
...n/java/com/yifu/cloud/plus/v1/ekp/vo/EkpBankResultVo.java
+13
-0
EkpBankGrantDetailMapper.java
...fu/cloud/plus/v1/ekp/mapper/EkpBankGrantDetailMapper.java
+5
-0
EkpBankGrantDetailService.java
.../cloud/plus/v1/ekp/service/EkpBankGrantDetailService.java
+6
-0
EkpBankGrantDetailServiceImpl.java
...us/v1/ekp/service/impl/EkpBankGrantDetailServiceImpl.java
+12
-0
IcbcTransactionFlowIssueServiceImpl.java
...ekp/service/impl/IcbcTransactionFlowIssueServiceImpl.java
+184
-27
EkpBankGrantDetailMapper.xml
...iz/src/main/resources/mapper/EkpBankGrantDetailMapper.xml
+29
-1
EkpBankGrantLogMapper.xml
...p-biz/src/main/resources/mapper/EkpBankGrantLogMapper.xml
+0
-2
EkpBankPayTaskMapper.xml
...kp-biz/src/main/resources/mapper/EkpBankPayTaskMapper.xml
+4
-2
No files found.
yifu-ekp/yifu-ekp-api/src/main/java/com/yifu/cloud/plus/v1/ekp/entity/EkpBankGrantDetail.java
View file @
17e10b01
...
...
@@ -221,4 +221,10 @@ public class EkpBankGrantDetail {
@Schema
(
description
=
"MD码"
)
private
String
fdMdCode
;
@ExcelAttribute
(
name
=
"工资明细ID"
,
maxLength
=
36
)
@Length
(
max
=
36
,
message
=
"工资明细ID不能超过36个字符"
)
@ExcelProperty
(
"工资明细ID"
)
@Schema
(
description
=
"工资明细ID,用来同步中信银行状态"
)
private
String
fdSalaryId
;
}
yifu-ekp/yifu-ekp-api/src/main/java/com/yifu/cloud/plus/v1/ekp/entity/EkpBankGrantLog.java
View file @
17e10b01
...
...
@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.ekp.entity;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
...
...
@@ -27,7 +28,10 @@ import lombok.Data;
import
org.hibernate.validator.constraints.Length
;
import
javax.validation.constraints.NotBlank
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.util.Date
;
import
java.util.List
;
/**
* 发放日志(银企付款任务)
...
...
@@ -64,14 +68,6 @@ public class EkpBankGrantLog {
@ExcelProperty
(
"代发批次号"
)
@Schema
(
description
=
"代发批次号"
)
private
String
fdBatchNumber
;
/**
* 代发批次号ID:跳转使用
*/
@ExcelAttribute
(
name
=
"代发批次号ID:跳转使用"
,
maxLength
=
36
)
@Length
(
max
=
36
,
message
=
"代发批次号ID:跳转使用不能超过36个字符"
)
@ExcelProperty
(
"代发批次号ID:跳转使用"
)
@Schema
(
description
=
"代发批次号ID:跳转使用"
)
private
String
fdBatchNumberId
;
/**
* 批量包名称
*/
...
...
@@ -125,28 +121,28 @@ public class EkpBankGrantLog {
@ExcelAttribute
(
name
=
"交易时间"
,
isDate
=
true
)
@ExcelProperty
(
"交易时间"
)
@Schema
(
description
=
"交易时间"
)
private
LocalDateTim
e
fdTransactionTime
;
private
Dat
e
fdTransactionTime
;
/**
* 成功总金额
*/
@ExcelAttribute
(
name
=
"成功总金额"
)
@ExcelProperty
(
"成功总金额"
)
@Schema
(
description
=
"成功总金额"
)
private
Double
fdSuccessFee
;
private
BigDecimal
fdSuccessFee
;
/**
* 失败总金额
*/
@ExcelAttribute
(
name
=
"失败总金额"
)
@ExcelProperty
(
"失败总金额"
)
@Schema
(
description
=
"失败总金额"
)
private
Double
fdFailFee
;
private
BigDecimal
fdFailFee
;
/**
* 总金额
*/
@ExcelAttribute
(
name
=
"总金额"
)
@ExcelProperty
(
"总金额"
)
@Schema
(
description
=
"总金额"
)
private
Double
fdSumFee
;
private
BigDecimal
fdSumFee
;
/**
* 总笔数
*/
...
...
yifu-ekp/yifu-ekp-api/src/main/java/com/yifu/cloud/plus/v1/ekp/entity/EkpBankGrantLogDetail.java
View file @
17e10b01
...
...
@@ -27,6 +27,7 @@ import lombok.Data;
import
org.hibernate.validator.constraints.Length
;
import
javax.validation.constraints.NotBlank
;
import
java.math.BigDecimal
;
/**
* 发放日志明细(银企付款任务)
...
...
@@ -77,7 +78,7 @@ public class EkpBankGrantLogDetail {
@ExcelAttribute
(
name
=
"金额"
)
@ExcelProperty
(
"金额"
)
@Schema
(
description
=
"金额"
)
private
Double
fdMoney
;
private
BigDecimal
fdMoney
;
/**
* 收款银行
*/
...
...
yifu-ekp/yifu-ekp-api/src/main/java/com/yifu/cloud/plus/v1/ekp/vo/EkpBankResultVo.java
View file @
17e10b01
package
com
.
yifu
.
cloud
.
plus
.
v1
.
ekp
.
vo
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.io.Serializable
;
...
...
@@ -16,5 +17,17 @@ public class EkpBankResultVo implements Serializable {
private
String
fdId
;
private
String
fdParentId
;
private
String
fdWxNo
;
private
String
fdSalaryId
;
@Schema
(
description
=
"付款银行名称"
)
private
String
fdBankName
;
@Schema
(
description
=
"付款银行开户行"
)
private
String
fdBankNo
;
@Schema
(
description
=
"付款银行账户"
)
private
String
fdBankAccount
;
@Schema
(
description
=
"收款人名称"
)
private
String
fdPayeeName
;
private
Integer
fdFailNum
;
private
Integer
num
;
}
yifu-ekp/yifu-ekp-biz/src/main/java/com/yifu/cloud/plus/v1/ekp/mapper/EkpBankGrantDetailMapper.java
View file @
17e10b01
...
...
@@ -51,6 +51,11 @@ public interface EkpBankGrantDetailMapper extends BaseMapper<EkpBankGrantDetail>
// 主表拒绝授权时,批量更新明细表为发放失败,原因为拒绝授权
void
updateStatusByGrantFail
(
@Param
(
"fdParentId"
)
String
fdParentId
);
// 发放失败,批量更新中信银行交易流水表fd_3b148bc0c28e48为失败,根据 工资明细fdId:fd_3b1fe00b0f5dde
void
updateZhongXinStatus
(
@Param
(
"salaryIdList"
)
List
<
String
>
salaryIdList
);
// 发放失败,批量更新中信银行交易流水Model表fd_3b148bc0c28e48为失败,根据 工资明细fdId:fd_3b1fe00b0f5dde
void
updateZhongXinMainStatus
(
@Param
(
"salaryIdList"
)
List
<
String
>
salaryIdList
);
// 获取明细表ID来更新状态
List
<
EkpBankGrantDetail
>
getListByParentId
(
@Param
(
"fdParentId"
)
String
fdParentId
);
...
...
yifu-ekp/yifu-ekp-biz/src/main/java/com/yifu/cloud/plus/v1/ekp/service/EkpBankGrantDetailService.java
View file @
17e10b01
...
...
@@ -20,6 +20,7 @@ package com.yifu.cloud.plus.v1.ekp.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.ekp.entity.EkpBankGrantDetail
;
import
com.yifu.cloud.plus.v1.ekp.vo.EkpBankExcelVo
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
...
...
@@ -46,6 +47,11 @@ public interface EkpBankGrantDetailService extends IService<EkpBankGrantDetail>
// 主表发放时,更新明细表的发放时间与状态
void
updateStatusByGrant
(
String
fdParentId
);
// 发放失败,批量更新中信银行交易流水表fd_3b148bc0c28e48为失败,根据 工资明细fdId:fd_3b1fe00b0f5dde
void
updateZhongXinStatus
(
List
<
String
>
salaryIdList
);
void
updateZhongXinMainStatus
(
List
<
String
>
salaryIdList
);
// 主表拒绝授权时,批量更新明细表为发放失败,原因为拒绝授权
void
updateStatusByGrantFail
(
String
fdParentId
);
...
...
yifu-ekp/yifu-ekp-biz/src/main/java/com/yifu/cloud/plus/v1/ekp/service/impl/EkpBankGrantDetailServiceImpl.java
View file @
17e10b01
...
...
@@ -62,6 +62,18 @@ public class EkpBankGrantDetailServiceImpl extends ServiceImpl<EkpBankGrantDetai
baseMapper
.
updateStatusByGrant
(
fdParentId
);
}
// 发放失败,批量更新中信银行交易流水表fd_3b148bc0c28e48为失败,根据 工资明细fdId:fd_3b1fe00b0f5dde
@Override
public
void
updateZhongXinStatus
(
List
<
String
>
salaryIdList
)
{
baseMapper
.
updateZhongXinStatus
(
salaryIdList
);
}
// 发放失败,批量更新中信银行交易流水表fd_3b148bc0c28e48为失败,根据 工资明细fdId:fd_3b1fe00b0f5dde
@Override
public
void
updateZhongXinMainStatus
(
List
<
String
>
salaryIdList
)
{
baseMapper
.
updateZhongXinMainStatus
(
salaryIdList
);
}
@Override
public
void
updateStatusByGrantFail
(
String
fdParentId
)
{
baseMapper
.
updateStatusByGrantFail
(
fdParentId
);
...
...
yifu-ekp/yifu-ekp-biz/src/main/java/com/yifu/cloud/plus/v1/ekp/service/impl/IcbcTransactionFlowIssueServiceImpl.java
View file @
17e10b01
...
...
@@ -73,8 +73,26 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
@Autowired
private
EkpBankAttaService
ekpBankAttaService
;
@Autowired
private
EkpBankGrantLogService
ekpBankGrantLogService
;
@Autowired
private
EkpBankGrantLogDetailService
ekpBankGrantLogDetailService
;
@Autowired
private
OSSUtil
ossUtil
;
// 处理状态:00-提交成功,01-待银行处理 02-处理成功 03-处理失败,4-收方行处理中 5-收方行处理成功 6-收方行处理失败 7-收方行无法反馈
protected
final
static
Map
<
String
,
String
>
STATUS_MAP
;
static
{
STATUS_MAP
=
new
HashMap
<>();
STATUS_MAP
.
put
(
"00"
,
"提交成功"
);
STATUS_MAP
.
put
(
"01"
,
"待银行处理"
);
STATUS_MAP
.
put
(
"02"
,
"处理成功"
);
STATUS_MAP
.
put
(
"03"
,
"处理失败"
);
STATUS_MAP
.
put
(
"04"
,
"收方行处理中"
);
STATUS_MAP
.
put
(
"05"
,
"收方行处理成功"
);
STATUS_MAP
.
put
(
"06"
,
"收方行处理失败"
);
STATUS_MAP
.
put
(
"07"
,
"收方行无法反馈"
);
}
//1、网关公钥
//private static final String APIGW_PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCMpjaWjngB4E3ATh+G1DVAmQnIpiPEFAEDqRfNGAVvvH35yDetqewKi0l7OEceTMN1C6NPym3zStvSoQayjYV+eIcZERkx31KhtFu9clZKgRTyPjdKMIth/wBtPKjL/5+PYalLdomM4ONthrPgnkN4x4R0+D4+EBpXo8gNiAFsNwIDAQAB";
//2、appid
...
...
@@ -726,11 +744,14 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
// 1:获取发放中的主表数据,查询工行接口
List
<
EkpBankResultVo
>
mainList
=
ekpBankPayTaskService
.
getEkpBankMainByNeedResultMain
();
// 2:获取主表已发放且明细表发放中的明细表数据,查询工行接口
List
<
EkpBankResultVo
>
detailList
=
ekpBankPayTaskService
.
getEkpBankMainByNeedResultDetail
();
JftApiPayrollQueryDetailResponseV1
responseV1
;
// 发放日志
List
<
EkpBankGrantLog
>
logList
=
new
ArrayList
<>();
List
<
EkpBankGrantLogDetail
>
logDetailList
=
new
ArrayList
<>();
EkpBankGrantLog
logs
;
EkpBankGrantLogDetail
logDetail
;
BigDecimal
money
;
// 主表
if
(
mainList
!=
null
&&
!
mainList
.
isEmpty
())
{
int
startNum
;
...
...
@@ -740,7 +761,13 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
EkpBankGrantDetail
detailData
;
EkpBankPayTask
main
;
List
<
EkpBankGrantDetail
>
oldDetailList
;
List
<
String
>
zhongXinSalaryIdList
;
Map
<
String
,
EkpBankGrantDetail
>
oldMap
;
BigDecimal
moneySuccess
;
BigDecimal
moneyFail
;
BigDecimal
moneyAll
;
int
numSuccess
;
int
numFail
;
for
(
EkpBankResultVo
vo
:
mainList
)
{
for
(
int
i
=
0
;
i
<
vo
.
getNum
();
i
+=
50
)
{
startNum
=
i
+
1
;
...
...
@@ -754,7 +781,10 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
if
(
"0"
.
equals
(
responseV1
.
getReturn_code
()))
{
// 处理状态: 00-待提交,01-已提交 02-待授权 03-待银行处理, 04-处理成功,05-处理失败
if
(
"04"
.
equals
(
responseV1
.
getStatus
()))
{
//
// 生成日志主表
logs
=
saveNewEkpBankGrantLog
(
responseV1
,
vo
);
dataList
=
responseV1
.
getDatalist
();
oldDetailList
=
ekpBankGrantDetailService
.
getListByParentId
(
vo
.
getFdId
());
oldMap
=
new
HashMap
<>();
...
...
@@ -763,30 +793,72 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
oldMap
.
put
(
temp
.
getFdSerialNumber
(),
temp
);
}
}
moneyAll
=
BigDecimal
.
ZERO
;
moneySuccess
=
BigDecimal
.
ZERO
;
moneyFail
=
BigDecimal
.
ZERO
;
numSuccess
=
0
;
numFail
=
0
;
if
(
dataList
!=
null
&&
!
dataList
.
isEmpty
())
{
detailDataList
=
new
ArrayList
<>();
zhongXinSalaryIdList
=
new
ArrayList
<>();
for
(
JftApiPayrollQueryDetailResponseV1
.
JftApiPayrollDetail
data
:
dataList
)
{
// 交易时间
if
(
Common
.
isNotNull
(
data
.
getCompanyHandleTime
()))
{
logs
.
setFdTransactionTime
(
DateUtil
.
stringToDate
(
data
.
getCompanyHandleTime
(),
DateUtil
.
DATETIME_PATTERN_SECOND
));
}
money
=
BigDecimalUtils
.
safeDivide
(
new
BigDecimal
(
data
.
getPayamt
()),
new
BigDecimal
(
"100"
),
2
);
moneyAll
=
BigDecimalUtils
.
safeAdd
(
moneyAll
,
money
);
// 初始化日志明细
logDetail
=
setLogDetailBaseInfo
(
logs
,
money
,
vo
,
data
);
detailData
=
oldMap
.
get
(
data
.
getPlatDetailId
());
if
(
detailData
!=
null
)
{
// 收款人名称
logDetail
.
setFdPayee
(
detailData
.
getFdPayeeName
());
if
(
"02"
.
equals
(
data
.
getResult
()))
{
moneySuccess
=
BigDecimalUtils
.
safeAdd
(
moneySuccess
,
money
);
numSuccess
++;
detailData
.
setFdGrantStatus
(
"发放成功"
);
detailData
.
setFdHandleStatus
(
"已处理"
);
}
else
{
moneyFail
=
BigDecimalUtils
.
safeAdd
(
moneyFail
,
money
);
numFail
++;
detailData
.
setFdGrantStatus
(
"发放失败"
);
detailData
.
setFdHandleStatus
(
""
);
detailData
.
setFdFailureFeedback
(
data
.
getCompanyHandlerResult
());
//
todo-生成发放失败待处理表数据-也可以 批量 生成
//
批量更新中信银行表数据,使发放失败处理有数据出现
zhongXinSalaryIdList
.
add
(
detailData
.
getFdSalaryId
());
}
detailDataList
.
add
(
detailData
);
}
logDetailList
.
add
(
logDetail
);
}
ekpBankGrantLogDetailService
.
saveBatch
(
logDetailList
);
main
=
new
EkpBankPayTask
();
main
.
setFdId
(
vo
.
getFdId
());
main
.
setFdGrantStatus
(
"已发放"
);
ekpBankPayTaskService
.
updateById
(
main
);
// 更新明细状态为成功或失败
ekpBankGrantDetailService
.
updateBatchById
(
detailDataList
);
// 生成发放失败待处理表数据-也可以 批量 生成
if
(!
zhongXinSalaryIdList
.
isEmpty
())
{
ekpBankGrantDetailService
.
updateZhongXinStatus
(
zhongXinSalaryIdList
);
ekpBankGrantDetailService
.
updateZhongXinMainStatus
(
zhongXinSalaryIdList
);
}
}
// 失败总金额
logs
.
setFdFailFee
(
moneyFail
);
// 成功总金额
logs
.
setFdSuccessFee
(
moneySuccess
);
// 总金额
logs
.
setFdSumFee
(
moneyAll
);
// 失败总笔数
logs
.
setFdTransactionFailToal
(
numFail
);
// 成功总笔数
logs
.
setFdTransactionSuccessTotal
(
numSuccess
);
ekpBankGrantLogService
.
updateById
(
logs
);
}
else
if
(
"05"
.
equals
(
responseV1
.
getStatus
()))
{
main
=
new
EkpBankPayTask
();
main
.
setFdId
(
vo
.
getFdId
());
...
...
@@ -795,7 +867,6 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
// 更新明细状态为 发放失败,原因为拒绝授权
ekpBankGrantDetailService
.
updateStatusByGrantFail
(
vo
.
getFdId
());
}
}
return
R
.
ok
();
}
...
...
@@ -803,42 +874,128 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
}
}
// 2:获取主表已发放且明细表发放中的明细表数据,查询工行接口
List
<
EkpBankResultVo
>
detailList
=
ekpBankPayTaskService
.
getEkpBankMainByNeedResultDetail
();
// 明细表
if
(
detailList
!=
null
&&
!
detailList
.
isEmpty
())
{
List
<
JftApiPayrollQueryDetailResponseV1
.
JftApiPayrollDetail
>
dataList
;
List
<
EkpBankGrantDetail
>
detailDataList
=
new
ArrayList
<>();
EkpBankGrantDetail
detailData
;
List
<
String
>
zhongXinSalaryIdList
=
new
ArrayList
<>();
JftApiPayrollQueryDetailResponseV1
.
JftApiPayrollDetail
data
;
for
(
EkpBankResultVo
vo
:
detailList
)
{
responseV1
=
selectIcbcTransactionFlowInfo
(
vo
.
getFdWxNo
(),
"1"
,
"
10
"
);
responseV1
=
selectIcbcTransactionFlowInfo
(
vo
.
getFdWxNo
(),
"1"
,
"
2
"
);
if
(
Common
.
isNotNull
(
responseV1
))
{
// Return_code返回码,交易成功返回0,正表示业务报错,负表示系统报错
// Status处理状态: 00-待提交,01-已提交 02-待授权 03-待银行处理, 04-处理成功,05-处理失败
if
(
"0"
.
equals
(
responseV1
.
getReturn_code
())
&&
"04"
.
equals
(
responseV1
.
getStatus
()))
{
dataList
=
responseV1
.
getDatalist
();
if
(
dataList
!=
null
&&
!
dataList
.
isEmpty
())
{
for
(
JftApiPayrollQueryDetailResponseV1
.
JftApiPayrollDetail
data
:
dataList
)
{
detailData
=
new
EkpBankGrantDetail
();
detailData
.
setFdParentId
(
vo
.
getFdId
());
detailData
.
setFdSerialNumber
(
data
.
getPlatDetailId
());
if
(
"02"
.
equals
(
data
.
getResult
()))
{
detailData
.
setFdGrantStatus
(
"发放成功"
);
}
else
{
detailData
.
setFdGrantStatus
(
"发放失败"
);
detailData
.
setFdFailureFeedback
(
data
.
getCompanyHandlerResult
());
// todo-生成发放失败待处理表数据-也可以 批量 生成
if
(
"0"
.
equals
(
responseV1
.
getReturn_code
())
&&
"04"
.
equals
(
responseV1
.
getStatus
())
&&
responseV1
.
getDatalist
()
!=
null
&&
!
responseV1
.
getDatalist
().
isEmpty
())
{
}
detailDataList
.
add
(
detailData
);
}
dataList
=
responseV1
.
getDatalist
();
// 明细只有一条
data
=
dataList
.
get
(
0
);
money
=
BigDecimalUtils
.
safeDivide
(
new
BigDecimal
(
data
.
getPayamt
()),
new
BigDecimal
(
"100"
),
2
);
// 生成日志主表
logs
=
saveNewEkpBankGrantLog
(
responseV1
,
vo
);
// 失败总金额
logs
.
setFdFailFee
(
BigDecimal
.
ZERO
);
// 成功总金额
logs
.
setFdSuccessFee
(
BigDecimal
.
ZERO
);
// 总金额
logs
.
setFdSumFee
(
money
);
// 失败总笔数
logs
.
setFdTransactionFailToal
(
0
);
// 成功总笔数
logs
.
setFdTransactionSuccessTotal
(
0
);
// 初始化日志明细
logDetail
=
setLogDetailBaseInfo
(
logs
,
money
,
vo
,
data
);
// 收款人名称
logDetail
.
setFdPayee
(
vo
.
getFdPayeeName
());
ekpBankGrantLogDetailService
.
save
(
logDetail
);
detailData
=
new
EkpBankGrantDetail
();
detailData
.
setFdParentId
(
vo
.
getFdId
());
detailData
.
setFdSerialNumber
(
data
.
getPlatDetailId
());
if
(
"02"
.
equals
(
data
.
getResult
()))
{
// 失败总笔数
logs
.
setFdTransactionSuccessTotal
(
1
);
logs
.
setFdSuccessFee
(
money
);
detailData
.
setFdGrantStatus
(
"发放成功"
);
detailData
.
setFdHandleStatus
(
"已处理"
);
}
else
{
// 失败总笔数
logs
.
setFdTransactionFailToal
(
1
);
// 失败总金额
logs
.
setFdFailFee
(
money
);
detailData
.
setFdGrantStatus
(
"发放失败"
);
detailData
.
setFdHandleStatus
(
""
);
detailData
.
setFdFailureFeedback
(
data
.
getCompanyHandlerResult
());
detailData
.
setFdFailNum
(
vo
.
getFdFailNum
()
+
1
);
// 批量更新中信银行表数据,使发放失败处理有数据出现
zhongXinSalaryIdList
.
add
(
vo
.
getFdSalaryId
());
}
ekpBankGrantLogService
.
updateById
(
logs
);
detailDataList
.
add
(
detailData
);
}
}
}
// todo-生成发放失败待处理表数据-也可以 批量 生成
// todo-更新明细状态为成功或失败
//ekpBankGrantDetailService.updateStatusByGrant(detailDataList);
// 更新明细状态为成功或失败
ekpBankGrantDetailService
.
updateBatchById
(
detailDataList
);
// 生成发放失败待处理表数据-也可以 批量 生成
if
(!
zhongXinSalaryIdList
.
isEmpty
())
{
ekpBankGrantDetailService
.
updateZhongXinStatus
(
zhongXinSalaryIdList
);
ekpBankGrantDetailService
.
updateZhongXinMainStatus
(
zhongXinSalaryIdList
);
}
}
return
R
.
ok
();
}
/**
* @Description: 初始化日志明细
* @Author: hgw
* @Date: 2024/11/26 20:08
* @return: com.yifu.cloud.plus.v1.ekp.entity.EkpBankGrantLogDetail
**/
private
EkpBankGrantLogDetail
setLogDetailBaseInfo
(
EkpBankGrantLog
logs
,
BigDecimal
money
,
EkpBankResultVo
vo
,
JftApiPayrollQueryDetailResponseV1
.
JftApiPayrollDetail
data
)
{
EkpBankGrantLogDetail
logDetail
;
logDetail
=
new
EkpBankGrantLogDetail
();
// 指令状态
logDetail
.
setFdCommandStatus
(
STATUS_MAP
.
get
(
data
.
getResult
()));
logDetail
.
setFdParentId
(
logs
.
getFdId
());
// 收款银行
logDetail
.
setFdRecipientBank
(
vo
.
getFdBankName
());
logDetail
.
setFdMoney
(
money
);
// 收款账号
logDetail
.
setFdPayeeAccount
(
data
.
getRecDepAcc
());
logDetail
.
setFdRemark
(
data
.
getRemark
());
// 汇款用途
logDetail
.
setFdRemittancePurpose
(
"工资"
);
return
logDetail
;
}
/**
* @Description: 初始化生成日志主表
* @Author: hgw
* @Date: 2024/11/26 20:09
* @return: com.yifu.cloud.plus.v1.ekp.entity.EkpBankGrantLog
**/
private
EkpBankGrantLog
saveNewEkpBankGrantLog
(
JftApiPayrollQueryDetailResponseV1
responseV1
,
EkpBankResultVo
vo
)
{
EkpBankGrantLog
logs
;
logs
=
new
EkpBankGrantLog
();
logs
.
setFdBatchNumber
(
vo
.
getFdWxNo
());
logs
.
setFdParentId
(
vo
.
getFdId
());
logs
.
setFdBatchPackage
(
responseV1
.
getRemark
());
logs
.
setFdBusinessType
(
"代发工资"
);
logs
.
setFdCurrency
(
"人民币"
);
logs
.
setFdDrawee
(
vo
.
getFdBankName
());
logs
.
setFdPaymentAccount
(
vo
.
getFdBankAccount
());
logs
.
setFdSubmitTime
(
LocalDateTime
.
now
());
// 总笔数
logs
.
setFdTransactionTotal
(
vo
.
getNum
());
ekpBankGrantLogService
.
save
(
logs
);
return
logs
;
}
}
yifu-ekp/yifu-ekp-biz/src/main/resources/mapper/EkpBankGrantDetailMapper.xml
View file @
17e10b01
...
...
@@ -49,6 +49,7 @@
<result
property=
"fdEmpPhone"
column=
"fd_emp_phone"
/>
<result
property=
"fdWxNo"
column=
"fd_wx_no"
/>
<result
property=
"fdMdCode"
column=
"fd_md_dcode"
/>
<result
property=
"fdSalaryId"
column=
"fd_salary_id"
/>
</resultMap>
<sql
id=
"Base_Excel_Sql"
>
...
...
@@ -118,8 +119,35 @@
<select
id=
"getListByParentId"
resultMap=
"ekpBankGrantDetailMap"
>
select
a.fd_id,fd_serial_number
a.fd_id,
a.fd_salary_id,
fd_serial_number
from ekp_bank_grant_detail a where a.fd_parent_id = #{fdParentId}
</select>
<!-- 发放失败,批量更新中信银行交易流水表fd_3b148bc0c28e48为失败,根据 工资明细fdId:fd_3b1fe00b0f5dde -->
<update
id=
"updateZhongXinStatus"
>
update ekp_db4ed54e25543f4b7a9a a
set a.fd_3b148bc0c28e48='失败',a.fd_3c754f2a7125a0 = '1183b0b84ee4f581bba001c47a78b2d9',fd_3c754a976ddde2=now()
where
<if
test=
"salaryIdList != null and salaryIdList.size() > 0"
>
a.fd_3b1fe00b0f5dde in
<foreach
collection=
"salaryIdList"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
</update>
<!-- 发放失败,批量更新中信银行交易流水Model表fd_3b148bc0c28e48为失败,根据 工资明细fdId:fd_3b1fe00b0f5dde -->
<update
id=
"updateZhongXinMainStatus"
>
UPDATE modeling_simple_main a
JOIN ekp_db4ed54e25543f4b7a9a b on a.fd_id=b.fd_id
SET a.extend_data_xml=JSON_SET(a.extend_data_xml,'$[1].fd_3b148bc0c28e48', '失败', '$[1].fd_3c754f2a7125a0', '1183b0b84ee4f581bba001c47a78b2d9','$[1].fd_3c754a976ddde2', now())
where
<if
test=
"salaryIdList != null and salaryIdList.size() > 0"
>
b.fd_3b56782982b8b2 in
<foreach
collection=
"salaryIdList"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
</update>
</mapper>
yifu-ekp/yifu-ekp-biz/src/main/resources/mapper/EkpBankGrantLogMapper.xml
View file @
17e10b01
...
...
@@ -26,7 +26,6 @@
<resultMap
id=
"ekpBankGrantLogMap"
type=
"com.yifu.cloud.plus.v1.ekp.entity.EkpBankGrantLog"
>
<id
property=
"fdId"
column=
"fd_id"
/>
<result
property=
"fdBatchNumber"
column=
"fd_batch_number"
/>
<result
property=
"fdBatchNumberId"
column=
"fd_batch_number_id"
/>
<result
property=
"fdBatchPackage"
column=
"fd_batch_package"
/>
<result
property=
"fdPaymentAccount"
column=
"fd_payment_account"
/>
<result
property=
"fdDrawee"
column=
"fd_drawee"
/>
...
...
@@ -44,7 +43,6 @@
<sql
id=
"Base_Column_List"
>
a.fd_id,
a.fd_batch_number,
a.fd_batch_number_id,
a.fd_batch_package,
a.fd_payment_account,
a.fd_drawee,
...
...
yifu-ekp/yifu-ekp-biz/src/main/resources/mapper/EkpBankPayTaskMapper.xml
View file @
17e10b01
...
...
@@ -87,7 +87,8 @@
<!-- 获取发放中的主表,查询结果 -->
<select
id=
"getEkpBankMainByNeedResultMain"
resultType=
"com.yifu.cloud.plus.v1.ekp.vo.EkpBankResultVo"
>
select a.fd_id fdId,a.fd_wx_no fdWxNo,count(d.fd_id) num
select a.fd_id fdId,a.fd_wx_no fdWxNo
,count(d.fd_id) num,a.fd_bank_name fdBankName,a.fd_bank_no fdBankNo,a.fd_bank_account fdBankAccount,d.fd_payee_name fdPayeeName
from ekp_bank_pay_task a left join ekp_bank_grant_detail d on a.fd_id = d.fd_parent_id
where a.fd_grant_status = '发放中'
GROUP BY a.fd_id
...
...
@@ -95,7 +96,8 @@
<!-- 获取发放中的明细表,查询结果 -->
<select
id=
"getEkpBankMainByNeedResultDetail"
resultType=
"com.yifu.cloud.plus.v1.ekp.vo.EkpBankResultVo"
>
select d.fd_id fdId,d.fd_wx_no fdWxNo,d.fd_parent_id fdParentId,'1' num
select d.fd_id fdId,d.fd_wx_no fdWxNo,d.fd_parent_id fdParentId,d.fd_fail_num fdFailNum,d.fd_salary_id fdSalaryId
,'1' num,a.fd_bank_name fdBankName,a.fd_bank_no fdBankNo,a.fd_bank_account fdBankAccount,d.fd_payee_name fdPayeeName
from ekp_bank_grant_detail d left join ekp_bank_pay_task a on a.fd_id = d.fd_parent_id
where a.fd_grant_status = '已发放' and d.fd_grant_status = '发放失败' and d.fd_handle_status = '发放中'
</select>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment