Commit 9a400df3 authored by hongguangwu's avatar hongguangwu

MVP1.6.8-审核模板变更,改变逻辑

parent d372983b
......@@ -1241,68 +1241,76 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
@Override
public R<String> getSixJobByAudit() {
// 获取所有需要反馈的任务id
// 社保 type 1:社保;2:医保
List<TSocialInfo> socialList = tSocialInfoService.getSocialSoldierYgsByAudit();
if (socialList != null && !socialList.isEmpty()) {
this.doAuditCoreByType(socialList, CommonConstants.ONE_INT);
}
// 医保
List<TSocialInfo> socialYsdList = tSocialInfoService.getSocialSoldierYsdByAudit();
if (socialYsdList != null && !socialYsdList.isEmpty()) {
if (socialList != null && !socialList.isEmpty()) {
socialList.addAll(socialYsdList);
} else {
socialList = socialYsdList;
}
this.doAuditCoreByType(socialYsdList, CommonConstants.TWO_INT);
}
return R.ok();
}
if (socialList != null && !socialList.isEmpty()) {
Map<String, TSocialInfo> idCardMap = new HashMap<>();
Set<String> addIdSet = new HashSet<>();
for (TSocialInfo socialInfo : socialList) {
if (Common.isNotNull(socialInfo.getYgsAddId())) {
addIdSet.add(socialInfo.getYgsAddId());
idCardMap.put(socialInfo.getYgsAddId() + CommonConstants.DOWN_LINE_STRING + socialInfo.getEmpIdcard(), socialInfo);
}
if (Common.isNotNull(socialInfo.getYsdAddId())) {
addIdSet.add(socialInfo.getYsdAddId());
idCardMap.put(socialInfo.getYsdAddId() + CommonConstants.DOWN_LINE_STRING + socialInfo.getEmpIdcard(), socialInfo);
}
/**
* @param socialList
* @param type 1:社保;2:医保
* @Description: 整合社保与医保
* @Author: hgw
* @Date: 2024/8/16 17:43
* @return: void
**/
private void doAuditCoreByType(List<TSocialInfo> socialList, int type) {
Map<String, TSocialInfo> idCardMap = new HashMap<>();
Set<String> addIdSet = new HashSet<>();
for (TSocialInfo socialInfo : socialList) {
if (type ==1 && Common.isNotNull(socialInfo.getYgsAddId())) {
addIdSet.add(socialInfo.getYgsAddId());
idCardMap.put(socialInfo.getYgsAddId() + CommonConstants.DOWN_LINE_STRING + socialInfo.getEmpIdcard(), socialInfo);
} else if(type ==2 && Common.isNotNull(socialInfo.getYsdAddId())) {
addIdSet.add(socialInfo.getYsdAddId());
idCardMap.put(socialInfo.getYsdAddId() + CommonConstants.DOWN_LINE_STRING + socialInfo.getEmpIdcard(), socialInfo);
}
HttpURLConnection conn;
InputStream in = null;
Map<String, FailReasonConfig> errorMap = failReasonConfigService.getFailReasonMap();
if (!addIdSet.isEmpty()) {
for (String doAddId : addIdSet) {
R<String> resultFile = socialConfig.getFiveJob(restTemplate, doAddId, RESULT_ANNEX);
log.info("resultFileByAudit=" + resultFile);
try {
// 解决中文文件名的乱码问题
String fileTeturnUrl = resultFile.getData();
if (Common.isNotNull(fileTeturnUrl)) {
fileTeturnUrl = this.getEncodeUrl(fileTeturnUrl);
URL url = new URL(fileTeturnUrl);
conn = (HttpURLConnection) url.openConnection();
//设置超时间为30秒
conn.setConnectTimeout(30 * 1000);
in = conn.getInputStream();
// 实际读取文件内容
this.readZip(in, idCardMap, errorMap, doAddId);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
if (in != null) {
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
HttpURLConnection conn;
InputStream in = null;
Map<String, FailReasonConfig> errorMap = failReasonConfigService.getFailReasonMap();
if (!addIdSet.isEmpty()) {
for (String doAddId : addIdSet) {
R<String> resultFile = socialConfig.getFiveJob(restTemplate, doAddId, RESULT_ANNEX);
log.info("resultFileByAudit=" + resultFile);
try {
// 解决中文文件名的乱码问题
String fileTeturnUrl = resultFile.getData();
if (Common.isNotNull(fileTeturnUrl)) {
fileTeturnUrl = this.getEncodeUrl(fileTeturnUrl);
URL url = new URL(fileTeturnUrl);
conn = (HttpURLConnection) url.openConnection();
//设置超时间为30秒
conn.setConnectTimeout(30 * 1000);
in = conn.getInputStream();
// 实际读取文件内容
this.readZip(in, idCardMap, errorMap, doAddId, type);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
if (in != null) {
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
return R.ok();
}
public R<List<TSocialSoldierReturnAuditErrorVo>> readZip(InputStream inputStream, Map<String, TSocialInfo> idCardMap
, Map<String, FailReasonConfig> errorMap, String doAddId) {
, Map<String, FailReasonConfig> errorMap, String doAddId, int type) {
TSocialSoldierReturnAuditErrorVo vo;
List<TSocialSoldierReturnAuditErrorVo> voList = new ArrayList<>();
XSSFWorkbook sheets = null;
......@@ -1461,7 +1469,7 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
}
}
if (!voList.isEmpty()) {
importTSocialSoldierByAudit(voList, idCardMap, errorMap, doAddId);
importTSocialSoldierByAudit(voList, idCardMap, errorMap, doAddId, type);
}
return R.ok(voList);
}
......@@ -1759,7 +1767,7 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
* @return: void
**/
private void importTSocialSoldierByAudit(List<TSocialSoldierReturnAuditErrorVo> excelVOList, Map<String, TSocialInfo> idCardMap
, Map<String, FailReasonConfig> errorMap, String doAddId) {
, Map<String, FailReasonConfig> errorMap, String doAddId, int type) {
// 个性化校验逻辑
// 执行数据插入操作 组装
TSocialSoldierReturnAuditErrorVo excel;
......@@ -1770,6 +1778,9 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
TSocialInfo updateSocial;
// true养工失 false 医生大
boolean typeFlag = true;
if (type == 2) {
typeFlag = false;
}
FailReasonConfig failConfig;
String ygsHandleStatus;
String ysdHandleStatus;
......@@ -1806,7 +1817,6 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
auditRemark = excel.getYgsOperation();
if (Common.isEmpty(auditRemark)) {
auditRemark = excel.getYsdRemark();
typeFlag = false;
}
if (Common.isNotNull(empIdCard)) {
title = "社保";
......
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