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
f2d9bdad
Commit
f2d9bdad
authored
May 16, 2024
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MVP1.6.4-优化社保士兵
parent
771fa273
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
109 deletions
+10
-109
TSocialSoldierServiceImpl.java
...1/yifu/social/service/impl/TSocialSoldierServiceImpl.java
+10
-109
No files found.
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TSocialSoldierServiceImpl.java
View file @
f2d9bdad
...
...
@@ -323,63 +323,6 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
return
cellValue
;
}
/*public R<List<ErrorMessage>> importDiy(InputStream inputStream, Map<String, TSocialInfo> idCardMap
, Map<String, FailReasonConfig> errorMap) {
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<TSocialSoldierReturnErrorVo> util1 = new ExcelUtil<>(TSocialSoldierReturnErrorVo.class);
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
try {
EasyExcel.read(inputStream, TSocialSoldierReturnErrorVo.class, new ReadListener<TSocialSoldierReturnErrorVo>() {
*//**
* 单次缓存的数据量
*//*
public static final int BATCH_COUNT = CommonConstants.BATCH_COUNT;
*//**
*临时存储
*//*
private List<TSocialSoldierReturnErrorVo> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
@Override
public void invoke(TSocialSoldierReturnErrorVo data, AnalysisContext context) {
ReadRowHolder readRowHolder = context.readRowHolder();
Integer rowIndex = readRowHolder.getRowIndex();
data.setRowIndex(rowIndex + 1);
ErrorMessage errorMessage = util1.checkEntity(data, data.getRowIndex());
if (Common.isNotNull(errorMessage)) {
errorMessageList.add(errorMessage);
} else {
cachedDataList.add(data);
}
if (cachedDataList.size() >= BATCH_COUNT) {
saveData();
// 存储完成清理 list
cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
}
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
saveData();
}
*//**
* 加上存储数据库
*//*
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
importTSocialInfo(cachedDataList, idCardMap, errorMap);
log.info("存储数据库成功!");
}
}).sheet().doRead();
} catch (Exception e) {
log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR, e);
return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR);
}
return R.ok(errorMessageList);
}*/
private
void
importTSocialInfo
(
List
<
TSocialSoldierReturnErrorVo
>
excelVOList
,
Map
<
String
,
TSocialInfo
>
idCardMap
,
Map
<
String
,
FailReasonConfig
>
errorMap
,
String
doAddId
)
{
// 个性化校验逻辑
...
...
@@ -460,12 +403,12 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
// 过期自动变为终止
if
(
CommonConstants
.
ONE_STRING
.
equals
(
socialInfo
.
getYgsOverDueFlag
()))
{
updateSocial
.
setYgsRemarkOld
(
"已过期,自动中止办理!"
);
handleRemark
=
"已过期,自动中止办理!"
;
updateSocial
.
setYgsRemarkOld
(
handleRemark
);
ygsHandleStatus
=
CommonConstants
.
FOUR_STRING
;
ygsFailList
=
new
ArrayList
<>();
ygsFailList
.
add
(
socialInfo
.
getDispatchId
());
handleRemark
=
"社保士兵自动办理失败!已过期,自动中止办理!"
;
remark
=
"社保士兵自动办理失败!!已过期,自动中止办理!"
;
remark
=
handleRemark
;
}
else
if
(
Common
.
isNotNull
(
excel
.
getMsg
()))
{
// 如果找到了失败原因配置:
failConfig
=
getConfig
(
excel
.
getMsg
(),
errorMap
);
...
...
@@ -487,8 +430,8 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
ygsHandleStatus
=
CommonConstants
.
FOUR_STRING
;
ygsFailList
=
new
ArrayList
<>();
ygsFailList
.
add
(
socialInfo
.
getDispatchId
());
handleRemark
=
"
社保士兵自动办理失败!
中止办理:"
+
failConfig
.
getSimpleReason
();
remark
=
"
社保士兵自动办理失败!!
中止办理:"
+
failConfig
.
getSimpleReason
();
handleRemark
=
"中止办理:"
+
failConfig
.
getSimpleReason
();
remark
=
"中止办理:"
+
failConfig
.
getSimpleReason
();
}
else
if
(
CommonConstants
.
THREE_STRING
.
equals
(
failConfig
.
getReplay
()))
{
ygsHandleStatus
=
CommonConstants
.
FIVE_STRING
;
...
...
@@ -537,12 +480,12 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
updateSocial
.
setYsdRemarkOld
(
excel
.
getMsg
());
// 过期自动变为终止
if
(
CommonConstants
.
ONE_STRING
.
equals
(
socialInfo
.
getYsdOverDueFlag
()))
{
updateSocial
.
setYsdRemarkOld
(
"已过期,自动中止办理!"
);
handleRemark
=
"已过期,自动中止办理!"
;
updateSocial
.
setYsdRemarkOld
(
handleRemark
);
ysdHandleStatus
=
CommonConstants
.
FOUR_STRING
;
ysdFailList
=
new
ArrayList
<>();
ysdFailList
.
add
(
socialInfo
.
getDispatchId
());
handleRemark
=
"社保士兵自动办理失败!已过期,自动中止办理!"
;
remark
=
"社保士兵自动办理失败!!已过期,自动中止办理!"
;
remark
=
handleRemark
;
}
else
if
(
Common
.
isNotNull
(
excel
.
getMsg
()))
{
// 如果找到了失败原因配置:
failConfig
=
getConfig
(
excel
.
getMsg
(),
errorMap
);
...
...
@@ -565,8 +508,8 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
ysdHandleStatus
=
CommonConstants
.
FOUR_STRING
;
ysdFailList
=
new
ArrayList
<>();
ysdFailList
.
add
(
socialInfo
.
getDispatchId
());
handleRemark
=
"
社保士兵自动办理失败!
中止办理:"
+
failConfig
.
getSimpleReason
();
remark
=
"
社保士兵自动办理失败!!
中止办理:"
+
failConfig
.
getSimpleReason
();
handleRemark
=
"中止办理:"
+
failConfig
.
getSimpleReason
();
remark
=
"中止办理:"
+
failConfig
.
getSimpleReason
();
}
else
if
(
CommonConstants
.
THREE_STRING
.
equals
(
failConfig
.
getReplay
()))
{
ysdHandleStatus
=
CommonConstants
.
FIVE_STRING
;
// 新增流程进展明细
...
...
@@ -626,48 +569,6 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
}
}
}
/*
// 处理社保办理成功或失败,
if (!updateSocialList.isEmpty()) {
tSocialInfoService.updateBatchById(updateSocialList);
}
// 处理社保办理成功后的状态同步-成功
String typeSub = CommonConstants.ZERO_STRING;
String handleStatus = CommonConstants.ONE_STRING;
String handleRemark = "社保士兵自动办理成功!";
String remark = "社保士兵自动办理成功!!";
String socialType = "1,4,3";
Set<String> dbAuthsSet = new HashSet<>();
Collection<? extends GrantedAuthority> authorities = AuthorityUtils
.createAuthorityList(dbAuthsSet.toArray(new String[0]));
YifuUser user = new YifuUser("1", 1L, "社保士兵部门", "社保士兵",
"社保士兵", "0", SecurityConstants.BCRYPT + "123456",
"12345678911", true, true, true,
true,
"1", authorities, "1",
null, null,
null);
if (!ygsList.isEmpty()) {
this.doSocialAndDispatch(ygsList, typeSub, handleStatus, handleRemark, socialType, remark, user);
}
if (!ysdList.isEmpty()) {
socialType = "2,5,6";
this.doSocialAndDispatch(ysdList, typeSub, handleStatus, handleRemark, socialType, remark, user);
}
// 处理社保办理成功后的状态同步-失败
handleStatus = CommonConstants.TWO_STRING;
handleRemark = "社保士兵自动办理失败!";
remark = "社保士兵自动办理失败!!";
if (!ygsFailList.isEmpty()) {
socialType = "1,4,3";
this.doSocialAndDispatch(ygsFailList, typeSub, handleStatus, handleRemark, socialType, remark, user);
}
if (!ysdFailList.isEmpty()) {
socialType = "2,5,6";
this.doSocialAndDispatch(ysdFailList, typeSub, handleStatus, handleRemark, socialType, remark, user);
}*/
}
/**
...
...
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