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
c82bd732
Commit
c82bd732
authored
Dec 11, 2024
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MVP1.7.3-shuiyou 测试提交
parent
1102dd7b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
755 additions
and
103 deletions
+755
-103
SocialTask.java
...n/java/com/yifu/cloud/plus/v1/job/compont/SocialTask.java
+23
-0
FriendResult.java
...a/com/yifu/cloud/plus/v1/yifu/social/vo/FriendResult.java
+21
-0
SocialFriendConfig.java
.../cloud/plus/v1/yifu/social/config/SocialFriendConfig.java
+612
-96
SocialFriendSign.java
...fu/cloud/plus/v1/yifu/social/config/SocialFriendSign.java
+61
-0
TSocialFriendController.java
...us/v1/yifu/social/controller/TSocialFriendController.java
+18
-0
TSocialFriendPushService.java
...plus/v1/yifu/social/service/TSocialFriendPushService.java
+3
-0
TSocialFriendPushServiceImpl.java
...ifu/social/service/impl/TSocialFriendPushServiceImpl.java
+17
-7
No files found.
yifu-job/yifu-job-api/src/main/java/com/yifu/cloud/plus/v1/job/compont/SocialTask.java
View file @
c82bd732
...
@@ -194,6 +194,29 @@ public class SocialTask {
...
@@ -194,6 +194,29 @@ public class SocialTask {
log
.
info
(
"------------2定时任务推送社保士兵-定时任务结束------------"
);
log
.
info
(
"------------2定时任务推送社保士兵-定时任务结束------------"
);
}
}
/**
* @Description: 1定时任务推送税友
* @Author: hgw
* @Date: 2024-12-9 17:00:02
**/
public
void
doPushFriend
()
{
log
.
info
(
"------------1定时任务推送税友-定时任务开始------------"
);
HttpDaprUtil
.
invokeMethodPost
(
daprProperties
.
getAppUrl
(),
daprProperties
.
getAppId
(),
"/tsocialfriend/inner/doPushFriend"
,
""
,
Object
.
class
,
SecurityConstants
.
FROM_IN
);
log
.
info
(
"------------1定时任务推送税友-定时任务结束------------"
);
}
/**
* @Description: 2定时任务获取税友
* @Author: hgw
* @Date: 2024-12-9 16:59:56
**/
public
void
doGetFriendByRequestId
()
{
log
.
info
(
"------------2定时任务获取税友-定时任务开始------------"
);
HttpDaprUtil
.
invokeMethodPost
(
daprProperties
.
getAppUrl
(),
daprProperties
.
getAppId
(),
"/tsocialfriend/inner/doGetFriendByRequestId"
,
""
,
Object
.
class
,
SecurityConstants
.
FROM_IN
);
log
.
info
(
"------------2定时任务获取税友-定时任务结束------------"
);
}
/**
/**
* @Description: 3每日定时任务推送社保士兵审核结果查询
* @Description: 3每日定时任务推送社保士兵审核结果查询
* @Author: hgw
* @Author: hgw
...
...
yifu-social/yifu-social-api/src/main/java/com/yifu/cloud/plus/v1/yifu/social/vo/FriendResult.java
0 → 100644
View file @
c82bd732
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
social
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @Author fxj
* @Date 2024/5/10
* @Description
* @Version 1.0
*/
@Data
public
class
FriendResult
implements
Serializable
{
// 身份证
private
String
idCard
;
// 状态1-处理中,2-处理成功,3-处理失败,4-待办(提交成功,待网厅状态流转,上海特有)
private
String
zt
;
// 提示或者错误信息 SUCCESS
private
String
cwxx
;
}
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/config/SocialFriendConfig.java
View file @
c82bd732
This diff is collapsed.
Click to expand it.
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/config/SocialFriendSign.java
0 → 100644
View file @
c82bd732
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
social
.
config
;
import
javax.crypto.Mac
;
import
javax.crypto.spec.SecretKeySpec
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
import
java.nio.charset.StandardCharsets
;
import
java.security.InvalidKeyException
;
import
java.security.NoSuchAlgorithmException
;
import
java.security.SignatureException
;
import
java.util.Base64
;
import
java.util.Map
;
/**
* @author hgw2
* @description 税友签名接口
* @date 2024/12/9
*/
public
class
SocialFriendSign
{
public
static
String
qianMing
(
Map
<
String
,
String
>
treeMap
)
throws
SignatureException
{
// 1. 将以上 key=value 对的 value 进行合并,生成一下字符串 mergeStr
//System.out.println("header内的信息:"+treeMap.toString())
StringBuilder
mergeStr
=
new
StringBuilder
();
for
(
Map
.
Entry
<
String
,
String
>
stringStringEntry
:
treeMap
.
entrySet
())
{
mergeStr
.
append
(
stringStringEntry
.
getValue
());
}
//System.out.println("Key-Value 合并: " + mergeStr)
// 2. 将生成的 mergeStr 进行 Url 编码
String
encodedStr
=
null
;
try
{
encodedStr
=
URLEncoder
.
encode
(
mergeStr
.
toString
(),
"UTF-8"
);
}
catch
(
UnsupportedEncodingException
e
)
{
// URL 编码失败
throw
new
SignatureException
(
"【税友】URL 编码失败"
);
}
//System.out.println("encodeURL 编码:" + encodedStr)
// 3.利用 HmacSHA256 算法对 signStr 进行哈希运算生成消息摘要,摘要结果以 Base64 结果形式返回,signStr 即为请求参数中的 signature 字段
String
signatureResult
=
""
;
try
{
Mac
mac
=
Mac
.
getInstance
(
"HmacSHA256"
);
SecretKeySpec
signingKey
=
new
SecretKeySpec
(
treeMap
.
get
(
"appSecret"
).
getBytes
(),
"HmacSHA256"
);
mac
.
init
(
signingKey
);
byte
[]
signData
=
mac
.
doFinal
(
encodedStr
.
getBytes
());
byte
[]
resultBytes
=
Base64
.
getEncoder
().
encode
(
signData
);
signatureResult
=
new
String
(
resultBytes
,
StandardCharsets
.
UTF_8
);
}
catch
(
NoSuchAlgorithmException
e
)
{
throw
new
SignatureException
(
"【税友】平台不支持 HmacSHA 摘要方式"
);
}
catch
(
InvalidKeyException
e
)
{
throw
new
SignatureException
(
"【税友】指定的访问密钥无效"
);
}
//ystem.out.println("加密结果: " + signatureResult)
return
signatureResult
;
}
private
SocialFriendSign
()
{
throw
new
IllegalStateException
(
"SocialFriendSign class"
);
}
}
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/controller/TSocialFriendController.java
View file @
c82bd732
...
@@ -17,11 +17,13 @@
...
@@ -17,11 +17,13 @@
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
social
.
controller
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
social
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
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.log.annotation.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner
;
import
com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner
;
import
com.yifu.cloud.plus.v1.yifu.social.service.TSocialFriendPushService
;
import
com.yifu.cloud.plus.v1.yifu.social.service.TSocialFriendPushService
;
import
com.yifu.cloud.plus.v1.yifu.social.service.TSocialFriendService
;
import
com.yifu.cloud.plus.v1.yifu.social.service.TSocialFriendService
;
import
com.yifu.cloud.plus.v1.yifu.social.vo.FriendResult
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
...
@@ -51,6 +53,22 @@ public class TSocialFriendController {
...
@@ -51,6 +53,22 @@ public class TSocialFriendController {
return
tSocialFriendPushService
.
pushFriendTest
(
dispatchIdList
);
return
tSocialFriendPushService
.
pushFriendTest
(
dispatchIdList
);
}
}
@Operation
(
description
=
"1定时任务推送税友"
)
@PostMapping
(
"/inner/doPushFriend"
)
@SysLog
(
"1定时任务推送税友"
)
@Inner
public
R
<
String
>
doPushFriendTest
()
{
return
tSocialFriendPushService
.
pushFriendTest
(
null
);
}
@Operation
(
description
=
"2定时任务获取税友"
)
@PostMapping
(
"/inner/doGetFriendByRequestId"
)
@SysLog
(
"2定时任务获取税友"
)
@Inner
public
R
<
FriendResult
>
doGetFriendByRequestId
()
{
return
tSocialFriendPushService
.
getFriendByRequestIdTest
(
null
);
}
/**
/**
* @param addId 任务id,可为空
* @param addId 任务id,可为空
* @Description: 1获取税友状态
* @Description: 1获取税友状态
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/TSocialFriendPushService.java
View file @
c82bd732
...
@@ -17,9 +17,11 @@
...
@@ -17,9 +17,11 @@
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
social
.
service
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
social
.
service
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.TSocialInfo
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.TSocialInfo
;
import
com.yifu.cloud.plus.v1.yifu.social.vo.FriendResult
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.util.List
;
import
java.util.List
;
...
@@ -50,6 +52,7 @@ public interface TSocialFriendPushService extends IService<TSocialInfo> {
...
@@ -50,6 +52,7 @@ public interface TSocialFriendPushService extends IService<TSocialInfo> {
R
<
String
>
pushSoldier
(
List
<
String
>
dispatchIdList
);
R
<
String
>
pushSoldier
(
List
<
String
>
dispatchIdList
);
R
<
String
>
pushFriendTest
(
List
<
String
>
dispatchIdList
);
R
<
String
>
pushFriendTest
(
List
<
String
>
dispatchIdList
);
R
<
FriendResult
>
getFriendByRequestIdTest
(
List
<
String
>
dispatchIdList
);
/**
/**
* @param
* @param
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TSocialFriendPushServiceImpl.java
View file @
c82bd732
...
@@ -32,10 +32,7 @@ import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialSoldierLog;
...
@@ -32,10 +32,7 @@ import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialSoldierLog;
import
com.yifu.cloud.plus.v1.yifu.social.entity.TSocialSoldierShenBaoTask
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.TSocialSoldierShenBaoTask
;
import
com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialFriendMapper
;
import
com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialFriendMapper
;
import
com.yifu.cloud.plus.v1.yifu.social.service.*
;
import
com.yifu.cloud.plus.v1.yifu.social.service.*
;
import
com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierYgsAddVo
;
import
com.yifu.cloud.plus.v1.yifu.social.vo.*
;
import
com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierYgsAuditVo
;
import
com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierYsdAddVo
;
import
com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierYsdAuditVo
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.log4j.Log4j2
;
import
lombok.extern.log4j.Log4j2
;
import
org.apache.commons.compress.utils.IOUtils
;
import
org.apache.commons.compress.utils.IOUtils
;
...
@@ -172,12 +169,25 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
...
@@ -172,12 +169,25 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
**/
**/
@Override
@Override
public
R
<
String
>
pushFriendTest
(
List
<
String
>
dispatchIdList
)
{
public
R
<
String
>
pushFriendTest
(
List
<
String
>
dispatchIdList
)
{
String
thisTime
=
DateUtil
.
getThisTime
();
// 获取时间限制配置(获取 当月启用 的配置)
// type 1社保增 2社保减 3医保增 4医保减
String
id
=
socialFriendConfig
.
getFourAppAdd
(
restTemplate
);
int
type
=
1
;
String
id
=
socialFriendConfig
.
pushFriendByInfo
(
restTemplate
,
"3"
,
type
,
thisTime
);
return
R
.
ok
(
id
);
return
R
.
ok
(
id
);
}
}
/**
* @Description: 推送到社保士兵
* @Author: hgw
* @Date: 2024/5/10 17:53
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Override
public
R
<
FriendResult
>
getFriendByRequestIdTest
(
List
<
String
>
dispatchIdList
)
{
R
<
FriendResult
>
info
=
socialFriendConfig
.
getFriendByRequestId
(
restTemplate
,
"15074c814b4240a19cdb4425a7ae502c"
);
return
info
;
}
/**
/**
* @Description: 推送到社保士兵
* @Description: 推送到社保士兵
* @Author: hgw
* @Author: hgw
...
...
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