Commit f2d9bdad authored by hongguangwu's avatar hongguangwu

MVP1.6.4-优化社保士兵

parent 771fa273
...@@ -323,63 +323,6 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper, ...@@ -323,63 +323,6 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
return cellValue; 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 private void importTSocialInfo(List<TSocialSoldierReturnErrorVo> excelVOList, Map<String, TSocialInfo> idCardMap
, Map<String, FailReasonConfig> errorMap, String doAddId) { , Map<String, FailReasonConfig> errorMap, String doAddId) {
// 个性化校验逻辑 // 个性化校验逻辑
...@@ -460,12 +403,12 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper, ...@@ -460,12 +403,12 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
// 过期自动变为终止 // 过期自动变为终止
if (CommonConstants.ONE_STRING.equals(socialInfo.getYgsOverDueFlag())) { if (CommonConstants.ONE_STRING.equals(socialInfo.getYgsOverDueFlag())) {
updateSocial.setYgsRemarkOld("已过期,自动中止办理!"); handleRemark = "已过期,自动中止办理!";
updateSocial.setYgsRemarkOld(handleRemark);
ygsHandleStatus = CommonConstants.FOUR_STRING; ygsHandleStatus = CommonConstants.FOUR_STRING;
ygsFailList = new ArrayList<>(); ygsFailList = new ArrayList<>();
ygsFailList.add(socialInfo.getDispatchId()); ygsFailList.add(socialInfo.getDispatchId());
handleRemark = "社保士兵自动办理失败!已过期,自动中止办理!"; remark = handleRemark;
remark = "社保士兵自动办理失败!!已过期,自动中止办理!";
} else if (Common.isNotNull(excel.getMsg())) { } else if (Common.isNotNull(excel.getMsg())) {
// 如果找到了失败原因配置: // 如果找到了失败原因配置:
failConfig = getConfig(excel.getMsg(),errorMap); failConfig = getConfig(excel.getMsg(),errorMap);
...@@ -487,8 +430,8 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper, ...@@ -487,8 +430,8 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
ygsHandleStatus = CommonConstants.FOUR_STRING; ygsHandleStatus = CommonConstants.FOUR_STRING;
ygsFailList = new ArrayList<>(); ygsFailList = new ArrayList<>();
ygsFailList.add(socialInfo.getDispatchId()); ygsFailList.add(socialInfo.getDispatchId());
handleRemark = "社保士兵自动办理失败!中止办理:"+failConfig.getSimpleReason(); handleRemark = "中止办理:"+failConfig.getSimpleReason();
remark = "社保士兵自动办理失败!!中止办理:" + failConfig.getSimpleReason(); remark = "中止办理:" + failConfig.getSimpleReason();
} else if (CommonConstants.THREE_STRING.equals(failConfig.getReplay())) { } else if (CommonConstants.THREE_STRING.equals(failConfig.getReplay())) {
ygsHandleStatus = CommonConstants.FIVE_STRING; ygsHandleStatus = CommonConstants.FIVE_STRING;
...@@ -537,12 +480,12 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper, ...@@ -537,12 +480,12 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
updateSocial.setYsdRemarkOld(excel.getMsg()); updateSocial.setYsdRemarkOld(excel.getMsg());
// 过期自动变为终止 // 过期自动变为终止
if (CommonConstants.ONE_STRING.equals(socialInfo.getYsdOverDueFlag())) { if (CommonConstants.ONE_STRING.equals(socialInfo.getYsdOverDueFlag())) {
updateSocial.setYsdRemarkOld("已过期,自动中止办理!"); handleRemark = "已过期,自动中止办理!";
updateSocial.setYsdRemarkOld(handleRemark);
ysdHandleStatus = CommonConstants.FOUR_STRING; ysdHandleStatus = CommonConstants.FOUR_STRING;
ysdFailList = new ArrayList<>(); ysdFailList = new ArrayList<>();
ysdFailList.add(socialInfo.getDispatchId()); ysdFailList.add(socialInfo.getDispatchId());
handleRemark = "社保士兵自动办理失败!已过期,自动中止办理!"; remark = handleRemark;
remark = "社保士兵自动办理失败!!已过期,自动中止办理!";
} else if (Common.isNotNull(excel.getMsg())) { } else if (Common.isNotNull(excel.getMsg())) {
// 如果找到了失败原因配置: // 如果找到了失败原因配置:
failConfig = getConfig(excel.getMsg(),errorMap); failConfig = getConfig(excel.getMsg(),errorMap);
...@@ -565,8 +508,8 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper, ...@@ -565,8 +508,8 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
ysdHandleStatus = CommonConstants.FOUR_STRING; ysdHandleStatus = CommonConstants.FOUR_STRING;
ysdFailList = new ArrayList<>(); ysdFailList = new ArrayList<>();
ysdFailList.add(socialInfo.getDispatchId()); ysdFailList.add(socialInfo.getDispatchId());
handleRemark = "社保士兵自动办理失败!中止办理:"+failConfig.getSimpleReason(); handleRemark = "中止办理:"+failConfig.getSimpleReason();
remark = "社保士兵自动办理失败!!中止办理:" + failConfig.getSimpleReason(); remark = "中止办理:" + failConfig.getSimpleReason();
} else if (CommonConstants.THREE_STRING.equals(failConfig.getReplay())) { } else if (CommonConstants.THREE_STRING.equals(failConfig.getReplay())) {
ysdHandleStatus = CommonConstants.FIVE_STRING; ysdHandleStatus = CommonConstants.FIVE_STRING;
// 新增流程进展明细 // 新增流程进展明细
...@@ -626,48 +569,6 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper, ...@@ -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);
}*/
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment