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
decc6d2d
Commit
decc6d2d
authored
Aug 05, 2025
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化--反馈附件下载优化:24内办理中或办理成功用历史requestId 超时或失败的用新的请求,记录下载日志-fxj
parent
61805f1d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
153 additions
and
51 deletions
+153
-51
TSocialFriendBackLog.java
...loud/plus/v1/yifu/social/entity/TSocialFriendBackLog.java
+10
-1
SocialSoldierBackVo.java
...ifu/cloud/plus/v1/yifu/social/vo/SocialSoldierBackVo.java
+11
-0
SocialFriendConfig.java
.../cloud/plus/v1/yifu/social/config/SocialFriendConfig.java
+60
-39
TDispatchInfoServiceImpl.java
...v1/yifu/social/service/impl/TDispatchInfoServiceImpl.java
+46
-10
FeedBackUrlVo.java
.../com/yifu/cloud/plus/v1/yifu/social/vo/FeedBackUrlVo.java
+21
-0
TDispatchInfoMapper.xml
...ial-biz/src/main/resources/mapper/TDispatchInfoMapper.xml
+4
-1
TSocialFriendBackLogMapper.xml
.../src/main/resources/mapper/TSocialFriendBackLogMapper.xml
+1
-0
No files found.
yifu-social/yifu-social-api/src/main/java/com/yifu/cloud/plus/v1/yifu/social/entity/TSocialFriendBackLog.java
View file @
decc6d2d
...
@@ -65,7 +65,7 @@ public class TSocialFriendBackLog {
...
@@ -65,7 +65,7 @@ public class TSocialFriendBackLog {
/**
/**
* @Description: 类型1社保增 2社保减 3医保增 4医保减 5推送的日志 6社保图片路径7医保图片路径
* @Description: 类型1社保增 2社保减 3医保增 4医保减 5推送的日志 6社保图片路径7医保图片路径
* 8社保解除劳动合同9医保解除劳动合同11社保增拉取 12社保减拉取 13医保增拉取 14医保减拉取16社保单个图片17医保单个图片
* 8社保解除劳动合同9医保解除劳动合同11社保增拉取 12社保减拉取 13医保增拉取 14医保减拉取16社保单个图片17医保单个图片
18 反馈附件下载
* @Author: hgw
* @Author: hgw
* @Date: 2025/5/27 10:15
* @Date: 2025/5/27 10:15
**/
**/
...
@@ -89,4 +89,13 @@ public class TSocialFriendBackLog {
...
@@ -89,4 +89,13 @@ public class TSocialFriendBackLog {
@Schema
(
description
=
"创建时间"
)
@Schema
(
description
=
"创建时间"
)
private
LocalDateTime
createTime
;
private
LocalDateTime
createTime
;
/**
* 任务状态
*/
@ExcelAttribute
(
name
=
"任务状态"
)
@ExcelProperty
(
"任务状态"
)
@Schema
(
description
=
"任务状态"
)
private
String
status
;
}
}
yifu-social/yifu-social-api/src/main/java/com/yifu/cloud/plus/v1/yifu/social/vo/SocialSoldierBackVo.java
View file @
decc6d2d
...
@@ -75,4 +75,15 @@ public class SocialSoldierBackVo implements Serializable {
...
@@ -75,4 +75,15 @@ public class SocialSoldierBackVo implements Serializable {
private
String
socialHouseholdName
;
private
String
socialHouseholdName
;
/**
* 请求ID
*/
@ExcelAttribute
(
name
=
"请求ID"
,
needExport
=
true
)
@Schema
(
description
=
"请求ID"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"请求ID"
)
private
String
requestId
;
}
}
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/config/SocialFriendConfig.java
View file @
decc6d2d
...
@@ -11,10 +11,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
...
@@ -11,10 +11,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
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.SysHouseHoldInfo
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.SysHouseHoldInfo
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFriendBackLog
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFriendBackLog
;
import
com.yifu.cloud.plus.v1.yifu.social.vo.FriendResult
;
import
com.yifu.cloud.plus.v1.yifu.social.vo.*
;
import
com.yifu.cloud.plus.v1.yifu.social.vo.SociaFriendYgsAddVo
;
import
com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierBackVo
;
import
com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierExportVo
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
...
@@ -777,7 +774,6 @@ public class SocialFriendConfig {
...
@@ -777,7 +774,6 @@ public class SocialFriendConfig {
public
HashMap
<
String
,
String
>
getDownloadEmployeeAsync
(
RestTemplate
restTemplate
,
SysHouseHoldInfo
houseHold
,
public
HashMap
<
String
,
String
>
getDownloadEmployeeAsync
(
RestTemplate
restTemplate
,
SysHouseHoldInfo
houseHold
,
SocialSoldierBackVo
backVo
)
{
SocialSoldierBackVo
backVo
)
{
HashMap
<
String
,
String
>
result
=
new
HashMap
<>();
HashMap
<
String
,
String
>
result
=
new
HashMap
<>();
try
{
try
{
// 构建请求头
// 构建请求头
HttpHeaders
headers
=
buildCommonHeaders
(
null
);
HttpHeaders
headers
=
buildCommonHeaders
(
null
);
...
@@ -797,9 +793,6 @@ public class SocialFriendConfig {
...
@@ -797,9 +793,6 @@ public class SocialFriendConfig {
if
(
"Y"
.
equals
(
head
.
getString
(
"status"
)))
{
if
(
"Y"
.
equals
(
head
.
getString
(
"status"
)))
{
String
requestId
=
JSON
.
parseObject
(
response
.
getString
(
"body"
)).
getString
(
"requestId"
);
String
requestId
=
JSON
.
parseObject
(
response
.
getString
(
"body"
)).
getString
(
"requestId"
);
result
.
put
(
backVo
.
getSocialId
(),
requestId
);
result
.
put
(
backVo
.
getSocialId
(),
requestId
);
/*if (Common.isNotNull(requestId)) {
urls.addAll(getDownloadFeedbackUrls(restTemplate, requestId));
}*/
}
}
}
}
...
@@ -834,11 +827,7 @@ public class SocialFriendConfig {
...
@@ -834,11 +827,7 @@ public class SocialFriendConfig {
private
JSONObject
buildDownloadRequestJson
(
SysHouseHoldInfo
vo
,
SocialSoldierBackVo
exportVo
)
{
private
JSONObject
buildDownloadRequestJson
(
SysHouseHoldInfo
vo
,
SocialSoldierBackVo
exportVo
)
{
JSONObject
json
=
new
JSONObject
();
JSONObject
json
=
new
JSONObject
();
/*json.put("bizNo", "211429621163811844098020250715-172343");
json
.
put
(
"bizNo"
,
exportVo
.
getSocialId
()
+
DateUtil
.
getThisTime
());
json.put("qymc", "安徽皖信人力资源管理有限公司0");
json.put("nsrsbh", "91340152570242449C");
json.put("areaid", "340100");*/
json
.
put
(
"bizNo"
,
exportVo
.
getSocialId
());
json
.
put
(
"qymc"
,
vo
.
getName
());
json
.
put
(
"qymc"
,
vo
.
getName
());
json
.
put
(
"nsrsbh"
,
vo
.
getUnitCreditCode
());
json
.
put
(
"nsrsbh"
,
vo
.
getUnitCreditCode
());
json
.
put
(
"areaid"
,
vo
.
getAreaCode
());
json
.
put
(
"areaid"
,
vo
.
getAreaCode
());
...
@@ -877,18 +866,26 @@ public class SocialFriendConfig {
...
@@ -877,18 +866,26 @@ public class SocialFriendConfig {
}
}
// 获取反馈 URL 列表
// 获取反馈 URL 列表
public
List
<
String
>
getDownloadFeedbackUrls
(
RestTemplate
restTemplate
,
String
requestId
)
{
public
FeedBackUrlVo
getDownloadFeedbackUrls
(
RestTemplate
restTemplate
,
String
requestId
,
List
<
TSocialFriendBackLog
>
backLogList
,
String
socialId
)
{
FeedBackUrlVo
result
=
new
FeedBackUrlVo
();
List
<
String
>
urls
=
new
ArrayList
<>();
List
<
String
>
urls
=
new
ArrayList
<>();
if
(
null
==
backLogList
){
backLogList
=
new
ArrayList
<>();
}
String
downloadEmployeeFeedbackUrl
=
urlPre
+
urlDownloadEmployeeFeedback
+
"?requestId="
+
requestId
;
String
downloadEmployeeFeedbackUrl
=
urlPre
+
urlDownloadEmployeeFeedback
+
"?requestId="
+
requestId
;
int
retryCount
=
0
;
int
retryCount
=
0
;
final
int
maxRetries
=
2
;
final
int
maxRetries
=
4
;
final
long
delayMillis
=
2000
;
// 2 seconds
final
long
delayMillis
=
2000
;
// 2 seconds
TSocialFriendBackLog
backLog
;
JSONObject
dataObject
=
null
;
String
msg
=
""
;
String
zt
=
"0"
;
try
{
try
{
// 构建请求头
// 构建请求头
HttpHeaders
headers
=
buildCommonHeaders
(
requestId
);
HttpHeaders
headers
=
buildCommonHeaders
(
requestId
);
// 构建请求体
// 构建请求体
HttpEntity
<
String
>
formEntity
=
new
HttpEntity
<>(
headers
);
HttpEntity
<
String
>
formEntity
=
new
HttpEntity
<>(
headers
);
//具体的项目办理状态:1-处理中,2-处理成功,3-处理失败 如果是处理中继续重试2次,处理成功则返回反馈URL
while
(
retryCount
<=
maxRetries
)
{
while
(
retryCount
<=
maxRetries
)
{
ResponseEntity
<
String
>
response
=
restTemplate
.
exchange
(
ResponseEntity
<
String
>
response
=
restTemplate
.
exchange
(
...
@@ -896,39 +893,52 @@ public class SocialFriendConfig {
...
@@ -896,39 +893,52 @@ public class SocialFriendConfig {
// 处理返回值
// 处理返回值
if
(
response
!=
null
&&
response
.
getStatusCodeValue
()
==
200
)
{
if
(
response
!=
null
&&
response
.
getStatusCodeValue
()
==
200
)
{
JSONObject
dataObject
=
JSON
.
parseObject
(
response
.
getBody
());
dataObject
=
JSON
.
parseObject
(
response
.
getBody
());
String
head
=
dataObject
.
getString
(
"head"
);
String
head
=
dataObject
.
getString
(
"head"
);
if
(
Common
.
isNotNull
(
head
))
{
if
(
Common
.
isNotNull
(
head
))
{
JSONObject
headObject
=
JSON
.
parseObject
(
head
);
JSONObject
headObject
=
JSON
.
parseObject
(
head
);
if
(
"Y"
.
equals
(
headObject
.
getString
(
"status"
)))
{
if
(
"Y"
.
equals
(
headObject
.
getString
(
"status"
)))
{
JSONObject
bodyObject
=
JSON
.
parseObject
(
dataObject
.
getString
(
"body"
));
JSONObject
bodyObject
=
JSON
.
parseObject
(
dataObject
.
getString
(
"body"
));
String
ryywbljglb
=
bodyObject
.
getString
(
"ryywbljglb"
);
//1:处理中 2:成功 3:失败
JSONArray
ryywbljglbArr
=
JSON
.
parseArray
(
ryywbljglb
);
zt
=
bodyObject
.
getString
(
"zt"
);
if
(
ryywbljglbArr
!=
null
&&
!
ryywbljglbArr
.
isEmpty
()){
if
(
"2"
.
equals
(
zt
)){
for
(
Object
itemObj
:
ryywbljglbArr
)
{
String
ryywbljglb
=
bodyObject
.
getString
(
"ryywbljglb"
);
JSONObject
ryywbljglbItem
=
(
JSONObject
)
itemObj
;
JSONArray
ryywbljglbArr
=
JSON
.
parseArray
(
ryywbljglb
);
JSONArray
blxmjglbArr
=
JSON
.
parseArray
(
ryywbljglbItem
.
getString
(
"blxmjglb"
));
if
(
ryywbljglbArr
!=
null
&&
!
ryywbljglbArr
.
isEmpty
()){
if
(
blxmjglbArr
!=
null
&&
!
blxmjglbArr
.
isEmpty
()){
for
(
Object
itemObj
:
ryywbljglbArr
)
{
for
(
Object
blxmjglbObj
:
blxmjglbArr
)
{
JSONObject
ryywbljglbItem
=
(
JSONObject
)
itemObj
;
JSONObject
blxmjglbItem
=
(
JSONObject
)
blxmjglbObj
;
JSONArray
blxmjglbArr
=
JSON
.
parseArray
(
ryywbljglbItem
.
getString
(
"blxmjglb"
));
JSONArray
jgmxlbArr
=
JSON
.
parseArray
(
blxmjglbItem
.
getString
(
"jgmxlb"
));
if
(
blxmjglbArr
!=
null
&&
!
blxmjglbArr
.
isEmpty
()){
if
(
jgmxlbArr
!=
null
&&
!
jgmxlbArr
.
isEmpty
()){
for
(
Object
blxmjglbObj
:
blxmjglbArr
)
{
for
(
Object
jgmxlbObj
:
jgmxlbArr
)
{
JSONObject
blxmjglbItem
=
(
JSONObject
)
blxmjglbObj
;
JSONObject
jgmxlbItem
=
(
JSONObject
)
jgmxlbObj
;
//具体的项目办理状态:1-处理中,2-处理成功,3-处理失败
JSONArray
wjdzlb
=
jgmxlbItem
.
getJSONArray
(
"wjdzlb"
);
zt
=
blxmjglbItem
.
getString
(
"zt"
);
if
(
"2"
.
equals
(
zt
)){
if
(
wjdzlb
!=
null
&&
!
wjdzlb
.
isEmpty
())
{
JSONArray
jgmxlbArr
=
JSON
.
parseArray
(
blxmjglbItem
.
getString
(
"jgmxlb"
));
urls
.
addAll
(
wjdzlb
.
toJavaList
(
String
.
class
));
if
(
jgmxlbArr
!=
null
&&
!
jgmxlbArr
.
isEmpty
()){
for
(
Object
jgmxlbObj
:
jgmxlbArr
)
{
JSONObject
jgmxlbItem
=
(
JSONObject
)
jgmxlbObj
;
JSONArray
wjdzlb
=
jgmxlbItem
.
getJSONArray
(
"wjdzlb"
);
if
(
wjdzlb
!=
null
&&
!
wjdzlb
.
isEmpty
())
{
urls
.
addAll
(
wjdzlb
.
toJavaList
(
String
.
class
));
}
}
}
}
}
else
{
msg
=
bodyObject
.
getString
(
"cwxx"
);
}
}
}
}
}
}
}
}
}
}
}
else
{
msg
=
bodyObject
.
getString
(
"cwxx"
);
}
}
}
}
}
}
// 先记录每次的反馈请求
}
}
// 如果成功获取到数据,则跳出循环
// 如果成功获取到数据,则跳出循环
...
@@ -936,9 +946,9 @@ public class SocialFriendConfig {
...
@@ -936,9 +946,9 @@ public class SocialFriendConfig {
break
;
break
;
}
}
// 如果没有获取到数据,等待一段时间后重试
// 如果没有获取到数据,等待一段时间后重试
(处理中重试)
if
(
retryCount
<
maxRetries
)
{
if
(
retryCount
<
maxRetries
&&
zt
.
equals
(
"1"
)
)
{
Thread
.
sleep
(
delayMillis
);
Thread
.
sleep
(
delayMillis
*
retryCount
);
retryCount
++;
retryCount
++;
}
else
{
}
else
{
break
;
break
;
...
@@ -947,8 +957,19 @@ public class SocialFriendConfig {
...
@@ -947,8 +957,19 @@ public class SocialFriendConfig {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"获取税友人员审核查询证明文件反馈链接失败"
,
e
);
log
.
error
(
"获取税友人员审核查询证明文件反馈链接失败"
,
e
);
}
}
backLog
=
new
TSocialFriendBackLog
();
return
urls
;
backLog
.
setId
(
socialId
);
backLog
.
setRequestId
(
requestId
);
backLog
.
setSocialId
(
socialId
);
backLog
.
setStatus
(
zt
);
backLog
.
setType
(
18
);
backLog
.
setLogInfo
(
null
==
dataObject
?
""
:
dataObject
.
toJSONString
());
backLog
.
setCreateTime
(
LocalDateTime
.
now
());
backLogList
.
add
(
backLog
);
result
.
setUrls
(
urls
);
result
.
setRequestId
(
requestId
);
result
.
setMsg
(
msg
);
return
result
;
}
}
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TDispatchInfoServiceImpl.java
View file @
decc6d2d
...
@@ -171,6 +171,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -171,6 +171,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
private
final
RestTemplate
restTemplate
;
private
final
RestTemplate
restTemplate
;
private
final
SocialFriendConfig
socialFriendConfig
;
private
final
SocialFriendConfig
socialFriendConfig
;
@Autowired
private
TSocialFriendBackLogService
socialFriendBackLogService
;
/**
/**
* 派单信息记录表简单分页查询
* 派单信息记录表简单分页查询
*
*
...
@@ -8442,7 +8445,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -8442,7 +8445,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
list
=
baseMapper
.
getSocialSoldierAllListBackFile
(
searchVo
,
Common
.
getList
(
idStr
));
list
=
baseMapper
.
getSocialSoldierAllListBackFile
(
searchVo
,
Common
.
getList
(
idStr
));
}
}
// 收集所有需要下载的 URL
// 收集所有需要下载的 URL
Map
<
String
,
List
<
String
>
>
urlMap
=
new
HashMap
<>();
Map
<
String
,
FeedBackUrlVo
>
urlMap
=
new
HashMap
<>();
Map
<
String
,
SocialSoldierBackVo
>
socialMap
=
new
HashMap
<>();
Map
<
String
,
SocialSoldierBackVo
>
socialMap
=
new
HashMap
<>();
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
// 获取社保户信息
// 获取社保户信息
...
@@ -8456,6 +8459,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -8456,6 +8459,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
HashMap
<
String
,
String
>
requestIdMap
=
new
HashMap
<>();
HashMap
<
String
,
String
>
requestIdMap
=
new
HashMap
<>();
// 获取URL前先获取下载反馈的requestId
// 获取URL前先获取下载反馈的requestId
for
(
SocialSoldierBackVo
item
:
list
)
{
for
(
SocialSoldierBackVo
item
:
list
)
{
//查询到24内有处理中或请求成功的数据直接用历史数据区请求
if
(
StringUtils
.
isNotBlank
(
item
.
getRequestId
())){
requestIdMap
.
put
(
item
.
getSocialId
(),
item
.
getRequestId
());
continue
;
}
String
householdName
=
item
.
getSocialHouseholdName
();
String
householdName
=
item
.
getSocialHouseholdName
();
if
(
StringUtils
.
isNotBlank
(
householdName
))
{
if
(
StringUtils
.
isNotBlank
(
householdName
))
{
SysHouseHoldInfo
holdInfo
=
holdInfoMap
.
get
(
householdName
);
SysHouseHoldInfo
holdInfo
=
holdInfoMap
.
get
(
householdName
);
...
@@ -8468,12 +8476,19 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -8468,12 +8476,19 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if
(
CollectionUtils
.
isNotEmpty
(
requestIdMap
))
{
if
(
CollectionUtils
.
isNotEmpty
(
requestIdMap
))
{
// 循环 requestIdMap
// 循环 requestIdMap
List
<
String
>
urls
;
List
<
String
>
urls
;
//请求反馈日志
List
<
TSocialFriendBackLog
>
backLogList
=
new
ArrayList
<>();
FeedBackUrlVo
backUrlVo
=
null
;
for
(
Map
.
Entry
<
String
,
String
>
entry
:
requestIdMap
.
entrySet
()){
for
(
Map
.
Entry
<
String
,
String
>
entry
:
requestIdMap
.
entrySet
()){
urls
=
socialFriendConfig
.
getDownloadFeedbackUrls
(
restTemplate
,
entry
.
getValue
());
backUrlVo
=
socialFriendConfig
.
getDownloadFeedbackUrls
(
restTemplate
,
entry
.
getValue
(),
backLogList
,
entry
.
getKey
());
if
(
!
CollectionUtils
.
isEmpty
(
urls
)){
if
(
Common
.
isNotNull
(
backUrlVo
)){
urlMap
.
put
(
entry
.
getKey
(),
urls
);
urlMap
.
put
(
entry
.
getKey
(),
backUrlVo
);
}
}
}
}
// 记录反馈文件下载失败信息
if
(
Common
.
isNotNull
(
backLogList
)){
socialFriendBackLogService
.
saveOrUpdateBatch
(
backLogList
);
}
}
}
if
(
CollectionUtils
.
isEmpty
(
urlMap
)){
if
(
CollectionUtils
.
isEmpty
(
urlMap
)){
sendErrorResponse
(
response
,
"无附件可下载"
);
sendErrorResponse
(
response
,
"无附件可下载"
);
...
@@ -8496,9 +8511,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -8496,9 +8511,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
SocialSoldierBackVo
socialVo
;
SocialSoldierBackVo
socialVo
;
List
<
String
>
urlList
;
List
<
String
>
urlList
;
HttpGet
httpGet
;
HttpGet
httpGet
;
for
(
Map
.
Entry
<
String
,
List
<
String
>>
entry
:
urlMap
.
entrySet
())
{
FeedBackUrlVo
backUrlVo
=
null
;
for
(
Map
.
Entry
<
String
,
FeedBackUrlVo
>
entry
:
urlMap
.
entrySet
())
{
String
socialId
=
entry
.
getKey
();
String
socialId
=
entry
.
getKey
();
urlList
=
entry
.
getValue
();
backUrlVo
=
entry
.
getValue
();
if
(
null
==
backUrlVo
)
continue
;
urlList
=
backUrlVo
.
getUrls
();
if
(
CollectionUtils
.
isEmpty
(
urlList
))
continue
;
if
(
CollectionUtils
.
isEmpty
(
urlList
))
continue
;
socialVo
=
socialMap
.
get
(
socialId
);
socialVo
=
socialMap
.
get
(
socialId
);
...
@@ -8544,14 +8562,16 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -8544,14 +8562,16 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
}
}
}
private
void
updateBackFileFlage
(
Map
<
String
,
SocialSoldierBackVo
>
socialMap
,
Map
<
String
,
List
<
String
>
>
urlMap
)
{
private
void
updateBackFileFlage
(
Map
<
String
,
SocialSoldierBackVo
>
socialMap
,
Map
<
String
,
FeedBackUrlVo
>
urlMap
)
{
if
(
null
!=
urlMap
&&
!
urlMap
.
isEmpty
()){
if
(
null
!=
urlMap
&&
!
urlMap
.
isEmpty
()){
SocialSoldierBackVo
socialVo
;
SocialSoldierBackVo
socialVo
;
List
<
String
>
dispatchIds
=
new
ArrayList
<>();
List
<
String
>
dispatchIds
=
new
ArrayList
<>();
for
(
Map
.
Entry
<
String
,
List
<
String
>>
entry
:
urlMap
.
entrySet
())
{
FeedBackUrlVo
backUrlVo
=
null
;
for
(
Map
.
Entry
<
String
,
FeedBackUrlVo
>
entry
:
urlMap
.
entrySet
())
{
String
socialId
=
entry
.
getKey
();
String
socialId
=
entry
.
getKey
();
socialVo
=
socialMap
.
get
(
socialId
);
socialVo
=
socialMap
.
get
(
socialId
);
if
(
null
!=
socialVo
&&
null
!=
entry
.
getValue
()
&&
!
entry
.
getValue
().
isEmpty
())
{
backUrlVo
=
entry
.
getValue
();
if
(
null
!=
socialVo
&&
null
!=
backUrlVo
&&
!
backUrlVo
.
getUrls
().
isEmpty
())
{
dispatchIds
.
add
(
socialVo
.
getDispatchId
());
dispatchIds
.
add
(
socialVo
.
getDispatchId
());
}
}
}
}
...
@@ -8603,6 +8623,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -8603,6 +8623,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
HashMap
<
String
,
String
>
requestIdMap
=
new
HashMap
<>();
HashMap
<
String
,
String
>
requestIdMap
=
new
HashMap
<>();
// 获取URL前先获取下载反馈的requestId
// 获取URL前先获取下载反馈的requestId
for
(
SocialSoldierBackVo
item
:
list
)
{
for
(
SocialSoldierBackVo
item
:
list
)
{
//查询到24内有处理中或请求成功的数据直接用历史数据区请求
if
(
StringUtils
.
isNotBlank
(
item
.
getRequestId
())){
requestIdMap
.
put
(
item
.
getSocialId
(),
item
.
getRequestId
());
continue
;
}
String
householdName
=
item
.
getSocialHouseholdName
();
String
householdName
=
item
.
getSocialHouseholdName
();
if
(
StringUtils
.
isNotBlank
(
householdName
))
{
if
(
StringUtils
.
isNotBlank
(
householdName
))
{
SysHouseHoldInfo
holdInfo
=
holdInfoMap
.
get
(
householdName
);
SysHouseHoldInfo
holdInfo
=
holdInfoMap
.
get
(
householdName
);
...
@@ -8613,8 +8638,16 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -8613,8 +8638,16 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
}
// 通过requestId 获取反馈的URL 因为对方是异步请求
// 通过requestId 获取反馈的URL 因为对方是异步请求
List
<
String
>
urls
=
null
;
List
<
String
>
urls
=
null
;
//请求反馈日志
List
<
TSocialFriendBackLog
>
backLogList
=
new
ArrayList
<>();
FeedBackUrlVo
backUrlVo
=
null
;
if
(
CollectionUtils
.
isNotEmpty
(
requestIdMap
))
{
if
(
CollectionUtils
.
isNotEmpty
(
requestIdMap
))
{
urls
=
socialFriendConfig
.
getDownloadFeedbackUrls
(
restTemplate
,
requestIdMap
.
get
(
list
.
get
(
0
).
getSocialId
()));
backUrlVo
=
socialFriendConfig
.
getDownloadFeedbackUrls
(
restTemplate
,
requestIdMap
.
get
(
list
.
get
(
0
).
getSocialId
()),
backLogList
,
list
.
get
(
0
).
getSocialId
());
urls
=
null
==
backUrlVo
?
null
:
backUrlVo
.
getUrls
();
}
// 记录反馈文件下载失败信息
if
(
Common
.
isNotNull
(
backLogList
)){
socialFriendBackLogService
.
saveOrUpdateBatch
(
backLogList
);
}
}
if
(
Common
.
isNotNull
(
urls
)){
if
(
Common
.
isNotNull
(
urls
)){
// 更新反馈文件状态
// 更新反馈文件状态
...
@@ -8623,6 +8656,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -8623,6 +8656,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
baseMapper
.
updateBackFileFlag
(
dispatchIds
);
baseMapper
.
updateBackFileFlag
(
dispatchIds
);
return
R
.
ok
(
urls
.
get
(
0
));
return
R
.
ok
(
urls
.
get
(
0
));
}
}
if
(
Common
.
isNotNull
(
backUrlVo
)
&&
Common
.
isNotNull
(
backUrlVo
.
getMsg
())){
return
R
.
failed
(
"下载失败:"
+
backUrlVo
.
getMsg
()
+
" (requestId:"
+
backUrlVo
.
getRequestId
()+
")"
);
}
}
}
return
R
.
failed
(
"未找到反馈文件"
);
return
R
.
failed
(
"未找到反馈文件"
);
}
}
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/vo/FeedBackUrlVo.java
0 → 100644
View file @
decc6d2d
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
social
.
vo
;
import
lombok.Data
;
import
java.util.List
;
/**
* @Author fxj
* @Date 2025/8/5
* @Description
* @Version 1.0
*/
@Data
public
class
FeedBackUrlVo
{
//反馈文件数组
private
List
<
String
>
urls
;
private
String
requestId
;
private
String
msg
;
}
yifu-social/yifu-social-biz/src/main/resources/mapper/TDispatchInfoMapper.xml
View file @
decc6d2d
...
@@ -365,6 +365,8 @@
...
@@ -365,6 +365,8 @@
<result
property=
"ygsHandleStatus"
column=
"ygs_Handle_Status"
/>
<result
property=
"ygsHandleStatus"
column=
"ygs_Handle_Status"
/>
<result
property=
"ysdHandleStatus"
column=
"ysd_Handle_Status"
/>
<result
property=
"ysdHandleStatus"
column=
"ysd_Handle_Status"
/>
<result
property=
"socialHouseholdName"
column=
"SOCIAL_HOUSEHOLD_NAME"
/>
<result
property=
"socialHouseholdName"
column=
"SOCIAL_HOUSEHOLD_NAME"
/>
<result
property=
"requestId"
column=
"REQUEST_ID"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
a.ID,
a.ID,
...
@@ -2855,9 +2857,10 @@
...
@@ -2855,9 +2857,10 @@
a.EMP_IDCARD
a.EMP_IDCARD
,s.ygs_Handle_Status
,s.ygs_Handle_Status
,s.ysd_Handle_Status
,s.ysd_Handle_Status
,a.SOCIAL_HOUSEHOLD_NAME
,a.SOCIAL_HOUSEHOLD_NAME
,c.REQUEST_ID
FROM t_dispatch_info a
FROM t_dispatch_info a
left join t_social_info s on a.SOCIAL_ID = s.id
left join t_social_info s on a.SOCIAL_ID = s.id
LEFT JOIN (SELECT b.id,b.REQUEST_ID from t_social_friend_back_log b WHERE b.TYPE='18' and b.`STATUS` in ('1','2') and b.CREATE_TIME > DATE_SUB(NOW(), INTERVAL 24 HOUR)) c ON c.id=a.SOCIAL_ID
<where>
<where>
a.DELETE_FLAG = '0'
a.DELETE_FLAG = '0'
AND a.social_id is not null
AND a.social_id is not null
...
...
yifu-social/yifu-social-biz/src/main/resources/mapper/TSocialFriendBackLogMapper.xml
View file @
decc6d2d
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
<result
property=
"logInfo"
column=
"LOG_INFO"
/>
<result
property=
"logInfo"
column=
"LOG_INFO"
/>
<result
property=
"type"
column=
"TYPE"
/>
<result
property=
"type"
column=
"TYPE"
/>
<result
property=
"createTime"
column=
"CREATE_TIME"
/>
<result
property=
"createTime"
column=
"CREATE_TIME"
/>
<result
property=
"status"
column=
"STATUS"
/>
</resultMap>
</resultMap>
</mapper>
</mapper>
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