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
10bd1225
Commit
10bd1225
authored
Nov 25, 2024
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MVP1.7.2 工行5次提交_明细发放状态更新
parent
360749cd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
116 additions
and
43 deletions
+116
-43
EkpBankResultVo.java
...n/java/com/yifu/cloud/plus/v1/ekp/vo/EkpBankResultVo.java
+1
-1
IcbcTransactionFlowIssueController.java
...v1/ekp/controller/IcbcTransactionFlowIssueController.java
+4
-2
IcbcTransactionFlowIssueService.java
.../plus/v1/ekp/service/IcbcTransactionFlowIssueService.java
+3
-1
IcbcTransactionFlowIssueServiceImpl.java
...ekp/service/impl/IcbcTransactionFlowIssueServiceImpl.java
+108
-39
No files found.
yifu-ekp/yifu-ekp-api/src/main/java/com/yifu/cloud/plus/v1/ekp/vo/EkpBankResultVo.java
View file @
10bd1225
...
...
@@ -16,5 +16,5 @@ public class EkpBankResultVo implements Serializable {
private
String
fdId
;
private
String
fdParentId
;
private
String
fdWxNo
;
private
String
num
;
private
Integer
num
;
}
yifu-ekp/yifu-ekp-biz/src/main/java/com/yifu/cloud/plus/v1/ekp/controller/IcbcTransactionFlowIssueController.java
View file @
10bd1225
package
com
.
yifu
.
cloud
.
plus
.
v1
.
ekp
.
controller
;
import
com.icbc.api.response.JftApiPayrollQueryDetailResponseV1
;
import
com.yifu.cloud.plus.v1.ekp.service.IcbcTransactionFlowIssueService
;
import
com.yifu.cloud.plus.v1.ekp.vo.EkpBankAttaReturnVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
...
...
@@ -60,8 +61,9 @@ public class IcbcTransactionFlowIssueController {
*/
@Operation
(
summary
=
"代发工资明细查询"
,
description
=
"代发工资明细查询"
)
@PostMapping
(
"/page"
)
public
R
selectIcbcTransactionFlowInfo
()
{
return
icbcTransactionFlowIssueService
.
selectIcbcTransactionFlowInfo
();
public
JftApiPayrollQueryDetailResponseV1
selectIcbcTransactionFlowInfo
(
@RequestParam
String
wxNo
,
@RequestParam
String
startId
,
@RequestParam
String
endId
)
{
return
icbcTransactionFlowIssueService
.
selectIcbcTransactionFlowInfo
(
wxNo
,
startId
,
endId
);
}
/**
...
...
yifu-ekp/yifu-ekp-biz/src/main/java/com/yifu/cloud/plus/v1/ekp/service/IcbcTransactionFlowIssueService.java
View file @
10bd1225
package
com
.
yifu
.
cloud
.
plus
.
v1
.
ekp
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.icbc.api.response.JftApiPayrollQueryDetailResponseV1
;
import
com.yifu.cloud.plus.v1.ekp.entity.EkpBankAtta
;
import
com.yifu.cloud.plus.v1.ekp.entity.EkpSocialInfo
;
import
com.yifu.cloud.plus.v1.ekp.vo.EkpBankAttaReturnVo
;
...
...
@@ -32,7 +33,7 @@ public interface IcbcTransactionFlowIssueService extends IService<EkpSocialInfo>
* @Date: 2024-11-12
* @return: R
**/
R
selectIcbcTransactionFlowInfo
(
);
JftApiPayrollQueryDetailResponseV1
selectIcbcTransactionFlowInfo
(
String
wxNo
,
String
startId
,
String
endId
);
R
asyncNotice
(
HttpServletRequest
request
)
throws
Exception
;
...
...
@@ -64,6 +65,7 @@ public interface IcbcTransactionFlowIssueService extends IService<EkpSocialInfo>
**/
R
<
String
>
submitBankTask
(
String
fdId
,
String
type
);
// 验证下载文件的正确性
void
exportAll
(
HttpServletResponse
response
);
/**
...
...
yifu-ekp/yifu-ekp-biz/src/main/java/com/yifu/cloud/plus/v1/ekp/service/impl/IcbcTransactionFlowIssueServiceImpl.java
View file @
10bd1225
...
...
@@ -148,7 +148,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
* @Date: 2024-11-12
* @return: R
**/
public
R
selectIcbcTransactionFlowInfo
(
)
{
public
JftApiPayrollQueryDetailResponseV1
selectIcbcTransactionFlowInfo
(
String
wxNo
,
String
startId
,
String
endId
)
{
DefaultIcbcClient
client
=
new
DefaultIcbcClient
(
icbcConfigProperties
.
getAppId
(),
IcbcConstants
.
SIGN_TYPE_RSA2
,
icbcConfigProperties
.
getAppPrivateKey
(),
IcbcConstants
.
CHARSET_UTF8
,
IcbcConstants
.
FORMAT_JSON
,
...
...
@@ -164,24 +164,26 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
//查询类型:1 批次 2 批次明细
bizContent
.
setType
(
"2"
);
//批次号,appSerialno为空时,必输
bizContent
.
setAppBatserialno
(
"WX203"
);
// bizContent.setAppBatserialno("WX203")
bizContent
.
setAppBatserialno
(
wxNo
);
//内部批次号,组成规则:批次号-顺序号,appBatserialno为空时必输
// bizContent.setAppSerialno("WX04-1");
//开始条数,如果送1,则返回排序的第一条开始,appBatserialno不为空时必输
bizContent
.
setStartId
(
"0"
);
//bizContent.setStartId("0")
bizContent
.
setStartId
(
startId
);
//结束条数,每次最多返回50条,返回条数按照结束-开始+1,appBatserialno不为空时必输
bizContent
.
setEndId
(
"10"
);
//bizContent.setEndId("10")
bizContent
.
setEndId
(
endId
);
request
.
setBizContent
(
bizContent
);
try
{
JftApiPayrollQueryDetailResponseV1
responseV1
=
client
.
execute
(
request
);
if
(
Common
.
isNotNull
(
responseV1
))
{
return
R
.
ok
()
;
return
responseV1
;
}
}
catch
(
IcbcApiException
e
)
{
e
.
printStackTrace
();
return
R
.
failed
();
log
.
error
(
"查询银企付款结果出错:"
,
e
);
}
return
R
.
ok
()
;
return
null
;
}
/**
...
...
@@ -501,10 +503,10 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
}
}
}
String
batchNo
=
"WX"
+
DateUtil
.
getThisTimeNoLine
()
+
"000"
+
new
Date
().
getTime
();
String
batchNo
=
"WX"
+
new
Date
().
getTime
();
String
cur
=
ekpBankGrantDetailService
.
getWxNoByWxNo
(
batchNo
);
if
(
Common
.
isNotNull
(
cur
))
{
batchNo
=
"WX
CUR"
+
DateUtil
.
getThisTimeNoLine
()
+
"000
"
+
new
Date
().
getTime
();
batchNo
=
"WX"
+
new
Date
().
getTime
();
}
// 组装、上传文件
return
getEkpBankAttaVo
(
batchNo
,
vo
,
fdId
,
Integer
.
parseInt
(
type
),
list
);
...
...
@@ -727,37 +729,104 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
// 2:获取主表已发放且明细表发放中的明细表数据,查询工行接口
List
<
EkpBankResultVo
>
detailList
=
ekpBankPayTaskService
.
getEkpBankMainByNeedResultDetail
();
JftApiPayrollQueryDetailResponseV1
responseV1
;
// 主表
if
(
mainList
!=
null
&&
!
mainList
.
isEmpty
())
{
int
startNum
;
int
endNum
;
List
<
JftApiPayrollQueryDetailResponseV1
.
JftApiPayrollDetail
>
dataList
;
List
<
EkpBankGrantDetail
>
detailDataList
;
EkpBankGrantDetail
detailData
;
EkpBankPayTask
main
;
for
(
EkpBankResultVo
vo
:
mainList
)
{
for
(
int
i
=
0
;
i
<
vo
.
getNum
();
i
+=
50
)
{
startNum
=
i
+
1
;
endNum
=
i
+
50
;
if
(
endNum
>
vo
.
getNum
())
{
endNum
=
vo
.
getNum
();
}
responseV1
=
selectIcbcTransactionFlowInfo
(
vo
.
getFdWxNo
(),
String
.
valueOf
(
startNum
),
String
.
valueOf
(
endNum
));
if
(
Common
.
isNotNull
(
responseV1
))
{
// 返回码,交易成功返回0,正表示业务报错,负表示系统报错
if
(
"0"
.
equals
(
responseV1
.
getReturn_code
()))
{
// 处理状态: 00-待提交,01-已提交 02-待授权 03-待银行处理, 04-处理成功,05-处理失败
if
(
"04"
.
equals
(
responseV1
.
getStatus
()))
{
//
dataList
=
responseV1
.
getDatalist
();
if
(
dataList
!=
null
&&
!
dataList
.
isEmpty
())
{
detailDataList
=
new
ArrayList
<>();
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-生成发放失败待处理表数据-也可以 批量 生成
}
detailDataList
.
add
(
detailData
);
}
main
=
new
EkpBankPayTask
();
main
.
setFdId
(
vo
.
getFdId
());
main
.
setFdGrantStatus
(
"已发放"
);
ekpBankPayTaskService
.
updateById
(
main
);
// todo-更新明细状态为成功或失败
//ekpBankGrantDetailService.updateStatusByGrant(detailDataList);
}
}
else
if
(
"05"
.
equals
(
responseV1
.
getStatus
()))
{
main
=
new
EkpBankPayTask
();
main
.
setFdId
(
vo
.
getFdId
());
main
.
setFdGrantStatus
(
"拒绝授权"
);
ekpBankPayTaskService
.
updateById
(
main
);
// todo-更新明细状态为 发放失败,原因为拒绝授权
//ekpBankGrantDetailService.updateStatusByGrant(detailDataList);
}
}
return
R
.
ok
();
}
}
}
}
DefaultIcbcClient
client
=
new
DefaultIcbcClient
(
icbcConfigProperties
.
getAppId
(),
IcbcConstants
.
SIGN_TYPE_RSA2
,
icbcConfigProperties
.
getAppPrivateKey
(),
IcbcConstants
.
CHARSET_UTF8
,
IcbcConstants
.
FORMAT_JSON
,
icbcConfigProperties
.
getApigwPublicKey
(),
IcbcConstants
.
ENCRYPT_TYPE_AES
,
icbcConfigProperties
.
getAesKey
()
,
null
,
null
);
JftApiPayrollQueryDetailRequestV1
request
=
new
JftApiPayrollQueryDetailRequestV1
();
request
.
setServiceUrl
(
"https://gw.open.icbc.com.cn/api/jft/api/payroll/querydetail/V1"
);
JftApiPayrollQueryDetailRequestV1
.
JftApiPayrollQueryDetailRequestV1Biz
bizContent
=
new
JftApiPayrollQueryDetailRequestV1
.
JftApiPayrollQueryDetailRequestV1Biz
();
bizContent
.
setAppId
(
icbcConfigProperties
.
getAppId
());
//企业编号
bizContent
.
setOutVendorId
(
icbcConfigProperties
.
getCompanyNo
());
//查询类型:1 批次 2 批次明细
bizContent
.
setType
(
"2"
);
//批次号,appSerialno为空时,必输
bizContent
.
setAppBatserialno
(
"WX203"
);
//内部批次号,组成规则:批次号-顺序号,appBatserialno为空时必输
// bizContent.setAppSerialno("WX04-1");
//开始条数,如果送1,则返回排序的第一条开始,appBatserialno不为空时必输
bizContent
.
setStartId
(
"0"
);
//结束条数,每次最多返回50条,返回条数按照结束-开始+1,appBatserialno不为空时必输
bizContent
.
setEndId
(
"10"
);
request
.
setBizContent
(
bizContent
);
try
{
JftApiPayrollQueryDetailResponseV1
responseV1
=
client
.
execute
(
request
);
if
(
Common
.
isNotNull
(
responseV1
))
{
return
R
.
ok
();
// 明细表
if
(
mainList
!=
null
&&
!
mainList
.
isEmpty
())
{
List
<
JftApiPayrollQueryDetailResponseV1
.
JftApiPayrollDetail
>
dataList
;
List
<
EkpBankGrantDetail
>
detailDataList
=
new
ArrayList
<>();
EkpBankGrantDetail
detailData
;
for
(
EkpBankResultVo
vo
:
mainList
)
{
responseV1
=
selectIcbcTransactionFlowInfo
(
vo
.
getFdWxNo
(),
"1"
,
"10"
);
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-生成发放失败待处理表数据-也可以 批量 生成
}
detailDataList
.
add
(
detailData
);
}
}
}
}
}
}
catch
(
IcbcApiException
e
)
{
e
.
printStackTrace
();
return
R
.
failed
(
);
// todo-生成发放失败待处理表数据-也可以 批量 生成
// todo-更新明细状态为成功或失败
//ekpBankGrantDetailService.updateStatusByGrant(detailDataList
);
}
return
R
.
ok
();
}
...
...
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