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
672dd516
Commit
672dd516
authored
Sep 09, 2025
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MVP1.7.15-招行卡
parent
1934370c
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
781 additions
and
1 deletion
+781
-1
EkpZhaoHangDetail.java
.../com/yifu/cloud/plus/v1/ekp/entity/EkpZhaoHangDetail.java
+68
-0
EkpZhaoHangDetailLog.java
...m/yifu/cloud/plus/v1/ekp/entity/EkpZhaoHangDetailLog.java
+56
-0
ZhaoHangConfigProperties.java
...fu/cloud/plus/v1/ekp/config/ZhaoHangConfigProperties.java
+26
-0
ZhaoHangController.java
...yifu/cloud/plus/v1/ekp/controller/ZhaoHangController.java
+48
-0
EkpZhaoHangDetailLogMapper.java
.../cloud/plus/v1/ekp/mapper/EkpZhaoHangDetailLogMapper.java
+32
-0
EkpZhaoHangDetailMapper.java
...ifu/cloud/plus/v1/ekp/mapper/EkpZhaoHangDetailMapper.java
+38
-0
EkpZhaoHangDetailService.java
...u/cloud/plus/v1/ekp/service/EkpZhaoHangDetailService.java
+39
-0
ZhaoHangService.java
...a/com/yifu/cloud/plus/v1/ekp/service/ZhaoHangService.java
+32
-0
EkpZhaoHangDetailServiceImpl.java
...lus/v1/ekp/service/impl/EkpZhaoHangDetailServiceImpl.java
+63
-0
ZhaoHangServiceImpl.java
...u/cloud/plus/v1/ekp/service/impl/ZhaoHangServiceImpl.java
+296
-0
application.yml
yifu-ekp/yifu-ekp-biz/src/main/resources/application.yml
+7
-1
EkpZhaoHangDetailLogMapper.xml
.../src/main/resources/mapper/EkpZhaoHangDetailLogMapper.xml
+25
-0
EkpZhaoHangDetailMapper.xml
...biz/src/main/resources/mapper/EkpZhaoHangDetailMapper.xml
+39
-0
EkpTask.java
...main/java/com/yifu/cloud/plus/v1/job/compont/EkpTask.java
+12
-0
No files found.
yifu-ekp/yifu-ekp-api/src/main/java/com/yifu/cloud/plus/v1/ekp/entity/EkpZhaoHangDetail.java
0 → 100644
View file @
672dd516
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
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.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
/**
* 招行卡
*
* @author hgw
* @date 2025-09-09 16:22:40
*/
@Data
@TableName
(
"ekp_zhao_hang_detail"
)
@Schema
(
description
=
"招行卡"
)
public
class
EkpZhaoHangDetail
{
/**
* 主键
*/
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@ExcelProperty
(
"主键"
)
@Schema
(
description
=
"主键"
)
private
String
fdId
;
@Schema
(
description
=
"流水号"
)
private
String
fdNo
;
@Schema
(
description
=
"交易时间"
)
private
String
fdDate
;
@Schema
(
description
=
"交易金额"
)
private
BigDecimal
fdMoney
;
@Schema
(
description
=
"交易商户名称"
)
private
String
fdAcpName
;
@Schema
(
description
=
"交易卡号"
)
private
String
fdBankNo
;
// 作为EKP登录用户查询的ID(用登录ID,查找ekp_zhao_hang_bank_no里的fdAccountId,再关联本表查询数据)
@Schema
(
description
=
"账户ID"
)
private
String
fdAccountId
;
@Schema
(
description
=
"中文名"
)
private
String
fdEmpName
;
@Schema
(
description
=
"EKP的登录用户的FdId"
)
private
String
fdUserId
;
@Schema
(
description
=
"创建时间"
)
private
LocalDateTime
createTime
;
}
yifu-ekp/yifu-ekp-api/src/main/java/com/yifu/cloud/plus/v1/ekp/entity/EkpZhaoHangDetailLog.java
0 → 100644
View file @
672dd516
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
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.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.time.LocalDateTime
;
/**
* 招行卡
*
* @author hgw
* @date 2025-09-09 16:22:40
*/
@Data
@TableName
(
"ekp_zhao_hang_detail_log"
)
@Schema
(
description
=
"招行卡"
)
public
class
EkpZhaoHangDetailLog
{
/**
* 主键
*/
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@ExcelProperty
(
"主键"
)
@Schema
(
description
=
"主键"
)
private
String
fdId
;
@Schema
(
description
=
"推送参数"
)
private
String
fdParam
;
@Schema
(
description
=
"返回数据"
)
private
String
fdData
;
@Schema
(
description
=
"推送时间"
)
private
LocalDateTime
fdDatePush
;
@Schema
(
description
=
"收到时间"
)
private
LocalDateTime
fdDateBack
;
}
yifu-ekp/yifu-ekp-biz/src/main/java/com/yifu/cloud/plus/v1/ekp/config/ZhaoHangConfigProperties.java
0 → 100644
View file @
672dd516
package
com
.
yifu
.
cloud
.
plus
.
v1
.
ekp
.
config
;
import
lombok.Data
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.cloud.context.config.annotation.RefreshScope
;
/**
* @auther hgw
* @date 2025-9-9 11:31:54
* 招行卡配置信息
*/
@RefreshScope
@ConfigurationProperties
(
prefix
=
"zhaohang"
)
@Data
public
class
ZhaoHangConfigProperties
{
// 客户号 10025498
private
String
clientId
;
// 密码 cno7G+kNfJbf9nyskHdr0g==
private
String
clientSecret
;
// 成本中心号 9910025498
private
String
corNum
;
}
yifu-ekp/yifu-ekp-biz/src/main/java/com/yifu/cloud/plus/v1/ekp/controller/ZhaoHangController.java
0 → 100644
View file @
672dd516
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.service.ZhaoHangService
;
import
com.yifu.cloud.plus.v1.ekp.vo.EkpBankAttaReturnVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
/**
* 招行卡相关控制器
* @author hgw
* @date 2025-9-9 11:24:36
*/
@RestController
@RequiredArgsConstructor
@RequestMapping
(
"/zhaoHang"
)
@Tag
(
name
=
"招行卡相关控制器"
)
public
class
ZhaoHangController
{
private
final
ZhaoHangService
zhaoHangService
;
@Operation
(
summary
=
"每天获取招行卡流水"
,
description
=
"每天获取招行卡流水"
)
@Inner
@PostMapping
(
"/inner/doGetZhaoHangInfo"
)
public
R
<
String
>
doGetZhaoHangInfo
()
{
return
zhaoHangService
.
doGetZhaoHangInfo
();
}
// 特殊情况使用,或者是测试,或者是历史数据,postDate 格式:"2025-07-02"
@Operation
(
summary
=
"测试接口,获取招行卡流水接口数据"
,
description
=
"获取招行卡流水接口数据"
)
@PostMapping
(
"/doGetZhaoHangCore"
)
public
R
<
String
>
doGetZhaoHangCore
(
@RequestParam
String
postDate
)
{
return
zhaoHangService
.
doGetZhaoHangCore
(
postDate
);
}
}
yifu-ekp/yifu-ekp-biz/src/main/java/com/yifu/cloud/plus/v1/ekp/mapper/EkpZhaoHangDetailLogMapper.java
0 → 100644
View file @
672dd516
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
ekp
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yifu.cloud.plus.v1.ekp.entity.EkpZhaoHangDetailLog
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* 招行卡
*
* @author hgw
* @date 2025-09-09 16:22:40
*/
@Mapper
public
interface
EkpZhaoHangDetailLogMapper
extends
BaseMapper
<
EkpZhaoHangDetailLog
>
{
}
yifu-ekp/yifu-ekp-biz/src/main/java/com/yifu/cloud/plus/v1/ekp/mapper/EkpZhaoHangDetailMapper.java
0 → 100644
View file @
672dd516
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
ekp
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yifu.cloud.plus.v1.ekp.entity.EkpZhaoHangDetail
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.KeyValueVo
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 招行卡
*
* @author hgw
* @date 2025-09-09 16:22:40
*/
@Mapper
public
interface
EkpZhaoHangDetailMapper
extends
BaseMapper
<
EkpZhaoHangDetail
>
{
List
<
String
>
getByNo
(
@Param
(
"noList"
)
List
<
String
>
noList
);
List
<
KeyValueVo
>
getAccountIdAndUserId
();
}
yifu-ekp/yifu-ekp-biz/src/main/java/com/yifu/cloud/plus/v1/ekp/service/EkpZhaoHangDetailService.java
0 → 100644
View file @
672dd516
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
ekp
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.ekp.entity.EkpZhaoHangDetail
;
import
java.util.List
;
import
java.util.Map
;
/**
* 招行卡
*
* @author hgw
* @date 2025-09-09 16:22:40
*/
public
interface
EkpZhaoHangDetailService
extends
IService
<
EkpZhaoHangDetail
>
{
// 返回已存在的流水号
List
<
String
>
getByNo
(
List
<
String
>
noList
);
// 返回招行账号ID与EKP用户ID的Map
Map
<
String
,
String
>
getAccountIdAndUserId
();
}
yifu-ekp/yifu-ekp-biz/src/main/java/com/yifu/cloud/plus/v1/ekp/service/ZhaoHangService.java
0 → 100644
View file @
672dd516
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.EkpSocialInfo
;
import
com.yifu.cloud.plus.v1.ekp.vo.EkpBankAttaReturnVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
/**
* 聚富通代发工资相关
*
* @author huyc
* @date 2024-05-24 10:55:24
*/
public
interface
ZhaoHangService
extends
IService
<
EkpSocialInfo
>
{
/**
* @Description: 代发任务确认提交
* @Author: huyc
* @Date: 2024-11-12
* @return: R
**/
R
<
String
>
doGetZhaoHangInfo
();
// 特殊情况使用,或者是测试,或者是历史数据,postDate 格式:"2025-07-02"
R
<
String
>
doGetZhaoHangCore
(
String
postDate
);
}
yifu-ekp/yifu-ekp-biz/src/main/java/com/yifu/cloud/plus/v1/ekp/service/impl/EkpZhaoHangDetailServiceImpl.java
0 → 100644
View file @
672dd516
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
ekp
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.ekp.entity.EkpZhaoHangDetail
;
import
com.yifu.cloud.plus.v1.ekp.mapper.EkpZhaoHangDetailMapper
;
import
com.yifu.cloud.plus.v1.ekp.service.EkpZhaoHangDetailService
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.KeyValueVo
;
import
lombok.extern.log4j.Log4j2
;
import
org.springframework.stereotype.Service
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* 招行卡
*
* @author hgw
* @date 2025-09-09 16:22:40
*/
@Log4j2
@Service
public
class
EkpZhaoHangDetailServiceImpl
extends
ServiceImpl
<
EkpZhaoHangDetailMapper
,
EkpZhaoHangDetail
>
implements
EkpZhaoHangDetailService
{
@Override
public
List
<
String
>
getByNo
(
List
<
String
>
noList
)
{
return
baseMapper
.
getByNo
(
noList
);
}
/**
* @Description: 返回招行账号ID与EKP用户ID的Map
* @Author: hgw
* @Date: 2025/9/9 18:02
* @return: java.util.Map<java.lang.String, java.lang.String>
**/
@Override
public
Map
<
String
,
String
>
getAccountIdAndUserId
()
{
List
<
KeyValueVo
>
list
=
baseMapper
.
getAccountIdAndUserId
();
Map
<
String
,
String
>
returnMap
=
new
HashMap
<>();
if
(
list
!=
null
&&
!
list
.
isEmpty
())
{
for
(
KeyValueVo
keyValueVo
:
list
)
{
returnMap
.
put
(
keyValueVo
.
getKeyStr
(),
keyValueVo
.
getValueStr
());
}
}
return
returnMap
;
}
}
yifu-ekp/yifu-ekp-biz/src/main/java/com/yifu/cloud/plus/v1/ekp/service/impl/ZhaoHangServiceImpl.java
0 → 100644
View file @
672dd516
package
com
.
yifu
.
cloud
.
plus
.
v1
.
ekp
.
service
.
impl
;
import
com.alibaba.excel.EasyExcelFactory
;
import
com.alibaba.excel.support.ExcelTypeEnum
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.icbc.api.DefaultIcbcClient
;
import
com.icbc.api.IcbcApiException
;
import
com.icbc.api.IcbcConstants
;
import
com.icbc.api.UiIcbcClient
;
import
com.icbc.api.request.JftApiPayrollQueryDetailRequestV1
;
import
com.icbc.api.request.JftUiPayrollComfirmSubmitRequestV1
;
import
com.icbc.api.request.MybankEnterpriseAccountQuerybankinfoRequestV1
;
import
com.icbc.api.response.JftApiPayrollQueryDetailResponseV1
;
import
com.icbc.api.response.MybankEnterpriseAccountQuerybankinfoResponseV1
;
import
com.icbc.api.utils.IcbcSignature
;
import
com.icbc.api.utils.WebUtils
;
import
com.jcraft.jsch.*
;
import
com.yifu.cloud.plus.v1.ekp.config.IcbcIssueConfigProperties
;
import
com.yifu.cloud.plus.v1.ekp.config.ZhaoHangConfigProperties
;
import
com.yifu.cloud.plus.v1.ekp.entity.*
;
import
com.yifu.cloud.plus.v1.ekp.mapper.EkpSocialInfoMapper
;
import
com.yifu.cloud.plus.v1.ekp.mapper.EkpZhaoHangDetailLogMapper
;
import
com.yifu.cloud.plus.v1.ekp.mapper.EkpZhaoHangDetailMapper
;
import
com.yifu.cloud.plus.v1.ekp.service.*
;
import
com.yifu.cloud.plus.v1.ekp.vo.EkpBankAttaReturnVo
;
import
com.yifu.cloud.plus.v1.ekp.vo.EkpBankCodeConfiglVo
;
import
com.yifu.cloud.plus.v1.ekp.vo.EkpBankExcelVo
;
import
com.yifu.cloud.plus.v1.ekp.vo.EkpBankResultVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.*
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.log4j.Log4j2
;
import
org.apache.commons.io.FileUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.MediaType
;
import
org.springframework.security.authentication.AuthenticationServiceException
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.client.RestTemplate
;
import
javax.servlet.ServletOutputStream
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.*
;
import
java.math.BigDecimal
;
import
java.math.BigInteger
;
import
java.net.URL
;
import
java.net.URLDecoder
;
import
java.net.URLEncoder
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.file.Files
;
import
java.nio.file.Paths
;
import
java.security.MessageDigest
;
import
java.security.NoSuchAlgorithmException
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
java.util.zip.ZipEntry
;
import
java.util.zip.ZipInputStream
;
/**
* 聚富通到账通知交易流水查询
*
* @author huyc
* @date 2024-05-23 11:21:56
*/
@Log4j2
@Service
@RequiredArgsConstructor
@EnableConfigurationProperties
(
ZhaoHangConfigProperties
.
class
)
public
class
ZhaoHangServiceImpl
extends
ServiceImpl
<
EkpSocialInfoMapper
,
EkpSocialInfo
>
implements
ZhaoHangService
{
@Autowired
private
ZhaoHangConfigProperties
zhaoHangConfigProperties
;
@Autowired
private
EkpZhaoHangDetailService
ekpZhaoHangDetailService
;
@Autowired
private
EkpZhaoHangDetailLogMapper
ekpZhaoHangDetailLogMapper
;
private
RestTemplate
restTemplate
=
new
RestTemplate
();
/**
* @Description: 代发任务确认提交
* @Author: huyc
* @Date: 2024-11-12
* @return: R
**/
@Override
public
R
<
String
>
doGetZhaoHangInfo
()
{
// 每日都查前7天的
for
(
int
i
=-
7
;
i
<
0
;
i
++)
{
doGetZhaoHangCore
(
DateUtil
.
addDay
(
i
));
}
return
R
.
ok
();
}
@Override
public
R
<
String
>
doGetZhaoHangCore
(
String
postDate
)
{
JSONObject
paramJson
=
new
JSONObject
();
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"clientId"
,
zhaoHangConfigProperties
.
getClientId
());
json
.
put
(
"clientSecret"
,
zhaoHangConfigProperties
.
getClientSecret
());
json
.
put
(
"corNum"
,
zhaoHangConfigProperties
.
getCorNum
());
json
.
put
(
"postDate"
,
postDate
);
int
currPage
=
1
;
json
.
put
(
"currPage"
,
currPage
);
paramJson
.
put
(
"paraMap"
,
json
);
HttpHeaders
headers
=
new
HttpHeaders
();
MediaType
type
=
MediaType
.
parseMediaType
(
"application/json; charset=UTF-8"
);
headers
.
setContentType
(
type
);
headers
.
add
(
"Accept"
,
MediaType
.
APPLICATION_JSON
.
toString
());
// 加日志:
EkpZhaoHangDetailLog
detailLog
=
new
EkpZhaoHangDetailLog
();
detailLog
.
setFdParam
(
paramJson
.
toString
());
detailLog
.
setFdDatePush
(
LocalDateTime
.
now
());
ekpZhaoHangDetailLogMapper
.
insert
(
detailLog
);
HttpEntity
<
String
>
formEntity
=
new
HttpEntity
<>(
paramJson
.
toString
(),
headers
);
String
url
=
"https://esp.cc.cmbchina.com/DataTransferPortal/BusiTranDataQuery.getTransData.do"
;
String
dataResultList
=
restTemplate
.
postForEntity
(
url
,
formEntity
,
String
.
class
).
getBody
();
log
.
debug
(
"拉取招行dataResultList="
+
dataResultList
);
if
(
Common
.
isEmpty
(
dataResultList
))
{
// 返回时,更新日志
detailLog
.
setFdData
(
"获取招行数据失败,dataResultList为空"
);
detailLog
.
setFdDateBack
(
LocalDateTime
.
now
());
ekpZhaoHangDetailLogMapper
.
updateById
(
detailLog
);
throw
new
AuthenticationServiceException
(
"获取招行数据失败"
);
}
// 返回时,更新日志
detailLog
.
setFdData
(
dataResultList
);
detailLog
.
setFdDateBack
(
LocalDateTime
.
now
());
ekpZhaoHangDetailLogMapper
.
updateById
(
detailLog
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
dataResultList
);
String
success
=
jsonObject
.
getString
(
"success"
);
String
message
=
jsonObject
.
getString
(
"message"
);
String
sumPage
=
jsonObject
.
getString
(
"sumPage"
);
JSONArray
dataArray
=
jsonObject
.
getJSONArray
(
"object"
);
if
(!
"true"
.
equals
(
success
))
{
return
R
.
failed
(
message
);
}
int
sumPageNum
=
1
;
if
(
Common
.
isNotNull
(
sumPage
))
{
try
{
sumPageNum
=
Integer
.
parseInt
(
sumPage
);
}
catch
(
Exception
e
)
{
log
.
error
(
"获取招行数据失败,sumPage无法转化为整数"
,
sumPage
);
sumPageNum
=
1
;
}
}
Map
<
String
,
String
>
ekpId
=
ekpZhaoHangDetailService
.
getAccountIdAndUserId
();
// 处理数据
this
.
doSetZhaoHangInfoCore
(
dataArray
,
ekpId
);
if
(
sumPageNum
>
1
)
{
// 如果一次没取全,循环取
while
(
currPage
<=
sumPageNum
)
{
json
.
put
(
"currPage"
,
++
currPage
);
// 加日志:
detailLog
=
new
EkpZhaoHangDetailLog
();
detailLog
.
setFdParam
(
paramJson
.
toString
());
detailLog
.
setFdDatePush
(
LocalDateTime
.
now
());
ekpZhaoHangDetailLogMapper
.
insert
(
detailLog
);
formEntity
=
new
HttpEntity
<>(
paramJson
.
toString
(),
headers
);
dataResultList
=
restTemplate
.
postForEntity
(
url
,
formEntity
,
String
.
class
).
getBody
();
if
(
Common
.
isEmpty
(
dataResultList
))
{
// 返回时,更新日志
detailLog
.
setFdData
(
"获取招行数据失败,dataResultList为空"
);
detailLog
.
setFdDateBack
(
LocalDateTime
.
now
());
ekpZhaoHangDetailLogMapper
.
updateById
(
detailLog
);
throw
new
AuthenticationServiceException
(
"获取招行数据失败"
);
}
// 返回时,更新日志
detailLog
.
setFdData
(
dataResultList
);
detailLog
.
setFdDateBack
(
LocalDateTime
.
now
());
ekpZhaoHangDetailLogMapper
.
updateById
(
detailLog
);
jsonObject
=
JSON
.
parseObject
(
dataResultList
);
success
=
jsonObject
.
getString
(
"success"
);
if
(
"true"
.
equals
(
success
))
{
dataArray
=
jsonObject
.
getJSONArray
(
"object"
);
this
.
doSetZhaoHangInfoCore
(
dataArray
,
ekpId
);
}
}
}
return
R
.
ok
();
}
/**
* @Description: 处理数据
* @Author: hgw
* @Date: 2025/9/9 15:24
* @return: void
**/
public
void
doSetZhaoHangInfoCore
(
JSONArray
dataArray
,
Map
<
String
,
String
>
ekpId
)
{
List
<
EkpZhaoHangDetail
>
cpList
=
new
ArrayList
<>();
List
<
String
>
noList
=
new
ArrayList
<>();
if
(
ekpId
==
null
)
{
ekpId
=
new
HashMap
<>();
}
if
(
dataArray
!=
null
)
{
JSONObject
jsonObject
;
// 内部唯一交易流水号 "CCAP1T8ELTL105CJ506P"
String
globalSerialNo
;
// 卡号 "6225819355162461"
String
crdNum
;
// 交易日期 "2025-07-01"
String
trsDte
;
// 交易时间 "174709"
String
trxTim
;
// 交易金额 "769.00"
String
oriCurAmt
;
// 商户名称 "支付宝-(固话)中国电信集团"
String
acpName
;
String
fdAccountId
;
String
fdEmpName
;
// 循环遍历array
EkpZhaoHangDetail
detail
;
for
(
int
i
=
0
;
i
<
dataArray
.
size
();
i
++)
{
detail
=
new
EkpZhaoHangDetail
();
jsonObject
=
dataArray
.
getJSONObject
(
i
);
globalSerialNo
=
jsonObject
.
getString
(
"globalSerialNo"
);
crdNum
=
jsonObject
.
getString
(
"crdNum"
);
trsDte
=
jsonObject
.
getString
(
"trsDte"
);
trxTim
=
jsonObject
.
getString
(
"trxTim"
);
oriCurAmt
=
jsonObject
.
getString
(
"oriCurAmt"
);
acpName
=
jsonObject
.
getString
(
"acpName"
);
fdAccountId
=
jsonObject
.
getString
(
"acctNbr"
);
fdEmpName
=
jsonObject
.
getString
(
"actChiNam"
);
detail
.
setFdNo
(
globalSerialNo
);
noList
.
add
(
globalSerialNo
);
if
(
Common
.
isNotNull
(
trxTim
)
&&
trxTim
.
length
()==
6
)
{
detail
.
setFdDate
(
trsDte
+
" "
+
trxTim
.
substring
(
0
,
2
)
+
":"
+
trxTim
.
substring
(
2
,
4
)
+
":"
+
trxTim
.
substring
(
4
,
6
));
}
else
{
detail
.
setFdDate
(
trsDte
+
" "
+
trxTim
);
}
detail
.
setFdAcpName
(
acpName
);
detail
.
setFdAccountId
(
fdAccountId
);
detail
.
setFdUserId
(
ekpId
.
get
(
fdAccountId
));
detail
.
setFdEmpName
(
fdEmpName
);
detail
.
setFdBankNo
(
crdNum
);
try
{
detail
.
setFdMoney
(
new
BigDecimal
(
oriCurAmt
));
}
catch
(
Exception
e
)
{
detail
.
setFdMoney
(
new
BigDecimal
(
"0"
));
}
detail
.
setCreateTime
(
LocalDateTime
.
now
());
cpList
.
add
(
detail
);
}
// 所有需要保存的,删除已存在的
if
(!
cpList
.
isEmpty
()
&&
!
noList
.
isEmpty
())
{
// 获取已存在的
List
<
String
>
curList
=
ekpZhaoHangDetailService
.
getByNo
(
noList
);
if
(!
curList
.
isEmpty
())
{
Map
<
String
,
Integer
>
curMap
=
new
HashMap
<>();
for
(
String
cur
:
curList
)
{
curMap
.
put
(
cur
,
CommonConstants
.
ONE_INT
);
}
// 删除已存在的
List
<
EkpZhaoHangDetail
>
canSaveList
=
new
ArrayList
<>();
for
(
EkpZhaoHangDetail
cp
:
cpList
)
{
if
(
curMap
.
get
(
cp
.
getFdNo
())
==
null
)
{
canSaveList
.
add
(
cp
);
}
}
cpList
=
canSaveList
;
}
// 保存
if
(!
cpList
.
isEmpty
())
{
ekpZhaoHangDetailService
.
saveBatch
(
cpList
);
}
}
}
}
}
yifu-ekp/yifu-ekp-biz/src/main/resources/application.yml
View file @
672dd516
...
...
@@ -87,4 +87,10 @@ icbcissue:
companyNo
:
'
020101190'
aesKey
:
8jTKCqZ9035g+HRzpZQqZA==
caSm
:
MIICSTCCAeygAwIBAgIGAJuAEtYAMAwGCCqBHM9VAYN1BQAwQTELMAkGA1UEBhMCY24xGzAZBgNVBAoMEnNtMmNvci5pY2JjLmNvbS5jbjEVMBMGA1UEAwwMc20ycm9vdGNhY29yMB4XDTIzMTIyMTA5NTAxNloXDTI4MTIyMTE1NTk1OVowVDELMAkGA1UEBhMCY24xGzAZBgNVBAoMEnNtMmNvci5pY2JjLmNvbS5jbjENMAsGA1UECwwEMTMwMjEZMBcGA1UEAwwQYWh3eC55LjEzMDIuMDIwMTBZMBMGByqGSM49AgEGCCqBHM9VAYItA0IABGEC1fF2rHTWfipQhOr+8SfvXDBiazIrImcsPH5aGaYMFK2RIXv0AF2xe2ZgAzcWRbgop0cAjaBHXpzSfIlnfl6jgbowgbcwHwYDVR0jBBgwFoAUDD6RRlIIkxjZ0/0x6S8mKdW3D2YwCQYDVR0TBAIwADBdBgNVHR8EVjBUMFKgUKBOpEwwSjEQMA4GA1UEAwwHY3JsNDE3MDEMMAoGA1UECwwDY3JsMRswGQYDVQQKDBJzbTJjb3IuaWNiYy5jb20uY24xCzAJBgNVBAYTAmNuMAsGA1UdDwQEAwIHgDAdBgNVHQ4EFgQUd0LHEI6l7Faq6/9GObNld3SH7xswDAYIKoEcz1UBg3UFAANJADBGAiEA68uRM5zYzMhaheAG+fw3AtkRFE5146+Qw6GVP93WojwCIQDzsIL3duLRtTot8ciVuKUQkI+GrXAg7nWnd2M2o9oRBw==
caSmIcbc
:
MIIDdDCCA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tLmNuL29jYTMxL1NNMi9jcmwyNzMwLmNybDAOBgNVHQ8BAf8EBAMCBsAwHQYDVR0OBBYEFOpEqrs73yvBXqvDQoT33v05FnDIMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAMBggqgRzPVQGDdQUAA0kAMEYCIQCdKpfhUijpAKEQekHxlk4LvnqzzaYmODo3T3qmZUJsUwIhAOaMMH0IpwefVTSwJlhrVbmEB5DmoxLo1Xb/1tvfW1l2
# 招行配置
zhaohang
:
clientId
:
10025498
clientSecret
:
cno7G+kNfJbf9nyskHdr0g==
corNum
:
9910025498
\ No newline at end of file
yifu-ekp/yifu-ekp-biz/src/main/resources/mapper/EkpZhaoHangDetailLogMapper.xml
0 → 100644
View file @
672dd516
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yifu.cloud.plus.v1.ekp.mapper.EkpZhaoHangDetailLogMapper"
>
</mapper>
yifu-ekp/yifu-ekp-biz/src/main/resources/mapper/EkpZhaoHangDetailMapper.xml
0 → 100644
View file @
672dd516
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yifu.cloud.plus.v1.ekp.mapper.EkpZhaoHangDetailMapper"
>
<select
id=
"getByNo"
resultType=
"java.lang.String"
>
SELECT
a.FD_NO
FROM ekp_zhao_hang_detail a
where a.FD_NO in
<foreach
item=
"item"
index=
"index"
collection=
"noList"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
</select>
<select
id=
"getAccountIdAndUserId"
resultType=
"com.yifu.cloud.plus.v1.yifu.admin.api.vo.KeyValueVo"
>
select a.FD_ACCOUNT_ID keyStr,a.FD_USER_ID valueStr from ekp_zhao_hang_bank_no a GROUP BY a.FD_ACCOUNT_ID
</select>
</mapper>
yifu-job/yifu-job-api/src/main/java/com/yifu/cloud/plus/v1/job/compont/EkpTask.java
View file @
672dd516
...
...
@@ -93,4 +93,16 @@ public class EkpTask {
HttpDaprUtil
.
invokeMethodPost
(
daprEkpProperties
.
getAppUrl
(),
daprEkpProperties
.
getAppId
(),
"/ekpalerttable/inner/pushBudgetAlertInfoTomanagerMonth"
,
""
,
Object
.
class
,
SecurityConstants
.
FROM_IN
);
log
.
info
(
"------------定时生成每月预算预警信息-定时任务结束------------"
);
}
/**
* @Author hgw
* @Description 每天获取招行卡流水
* @Date 2025-9-9 17:22:21
**/
public
void
doGetZhaoHangInfo
()
{
log
.
info
(
"------------每天获取招行卡流水-定时任务开始------------"
);
HttpDaprUtil
.
invokeMethodPost
(
daprEkpProperties
.
getAppUrl
(),
daprEkpProperties
.
getAppId
()
,
"/zhaoHang/inner/doGetZhaoHangInfo"
,
""
,
Object
.
class
,
SecurityConstants
.
FROM_IN
);
log
.
info
(
"------------每天获取招行卡流水-定时任务结束------------"
);
}
}
\ No newline at end of file
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