Commit 7e7beacc authored by huyuchen's avatar huyuchen

实缴费用导入接口修改

parent ab1323d9
......@@ -416,6 +416,14 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
@Override
public R<List<ErrorMessage>> importSocialDiy(InputStream inputStream) {
YifuUser user = SecurityUtils.getUser();
String sumNumKey = user.getId() + CommonConstants.DOWN_LINE_STRING + "sum_key";
if (Common.isNotNull((String)redisUtil.get(sumNumKey))) {
redisUtil.remove(sumNumKey);
}
String importSuccessKey = user.getId() + CommonConstants.DOWN_LINE_STRING + CommonConstants.PAYMENT_SOCIAL_WAIT_EXPORT;
if (Common.isNotNull((String)redisUtil.get(importSuccessKey))) {
redisUtil.remove(importSuccessKey);
}
List<ErrorMessage> errorMessageList = new ArrayList<>();
//养老
ConcurrentHashMap<String, BigDecimal> pensionMoneyMap = new ConcurrentHashMap<>();
......@@ -479,8 +487,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
importTPaymentSocialInfo(cachedDataList, errorMessageList, user, rowNumber,pensionMoneyMap,
bigMoneyMap,unEmpMoneyMap,birMoneyMap,injuryMoneyMap,medicalMoneyMap,accrualMoneyMap);
importTPaymentSocialInfo(cachedDataList, sumNumKey,importSuccessKey,errorMessageList, user,
rowNumber,pensionMoneyMap, bigMoneyMap,unEmpMoneyMap,birMoneyMap,injuryMoneyMap,
medicalMoneyMap,accrualMoneyMap);
log.info("存储数据库成功!");
}
}).sheet().doRead();
......@@ -498,7 +507,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
return R.ok(errorMessageList);
}
private void importTPaymentSocialInfo(List<TPaymentInfoVo> list, List<ErrorMessage> errorMessageList,
private void importTPaymentSocialInfo(List<TPaymentInfoVo> list, String sumNumKey,String importSuccessKey,
List<ErrorMessage> errorMessageList,
YifuUser user, Integer rowNumber,
ConcurrentHashMap<String, BigDecimal> pensionMoneyMap,
ConcurrentHashMap<String, BigDecimal> bigMoneyMap,
......@@ -726,12 +736,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
}
// -----------------------------生成paymentInfoMap本段结束--------------------------------
// -----------------------------生成paymentInfoMap本段结束--------------------------------
// -----------------------------线程池处理list,批量保存社保信息开始--------------------------------
List<TPaymentInfoVo> tempList = new ArrayList<>();
// -----------------------------线程池处理list,批量保存社保信息开始--------------------------------
List<TPaymentInfoVo> tempList = new ArrayList<>();
String importSuccessKey = user.getId() + CommonConstants.DOWN_LINE_STRING + CommonConstants.PAYMENT_SOCIAL_WAIT_EXPORT;
List<CompletableFuture<List<ErrorMessage>>> completableFutureList = new ArrayList<>();
// 创建一个数值格式化对象
......@@ -739,7 +748,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
// 设置精确到小数点后2位
numberFormat.setMaximumFractionDigits(2);
String maerialRatio = "";
String sumNumKey = user.getId() + CommonConstants.DOWN_LINE_STRING + "sum_key";
Integer bfInt = (Integer) redisUtil.get(sumNumKey);
if (Common.isNotNull(bfInt)) {
if (rowNumber > bfInt + 1) {
......@@ -748,7 +756,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
redisUtil.set(sumNumKey, bfInt, 360L);
} else {
maerialRatio = "100";
redisUtil.remove(sumNumKey);
}
} else {
if (rowNumber >= 100) {
......@@ -757,7 +764,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
redisUtil.set(sumNumKey, bfInt, 360L);
} else {
maerialRatio = "100";
redisUtil.remove(sumNumKey);
}
}
redisUtil.set(importSuccessKey, maerialRatio, 360L);
......@@ -1349,6 +1355,14 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
@Override
public R<List<ErrorMessage>> importSocialHeFeiDiy(InputStream inputStream, String random, String type) {
YifuUser user = SecurityUtils.getUser();
String sumNumKey = user.getId() + CommonConstants.DOWN_LINE_STRING + "sum_key";
if (Common.isNotNull((String)redisUtil.get(sumNumKey))) {
redisUtil.remove(sumNumKey);
}
String importSuccessKey = user.getId() + CommonConstants.DOWN_LINE_STRING + CommonConstants.PAYMENT_SOCIAL_WAIT_EXPORT;
if (Common.isNotNull((String)redisUtil.get(importSuccessKey))) {
redisUtil.remove(importSuccessKey);
}
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<TPaymentHeFeiVo> util1 = new ExcelUtil<>(TPaymentHeFeiVo.class);
ConcurrentHashMap<String, BigDecimal> pensionMoneyMap = new ConcurrentHashMap<>();
......@@ -1403,7 +1417,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
importTPaymentSocialHeFei(cachedDataList, errorMessageList, user, type, rowNumber,pensionMoneyMap,
bigMoneyMap,unEmpMoneyMap,injuryMoneyMap,medicalMoneyMap);
bigMoneyMap,unEmpMoneyMap,injuryMoneyMap,medicalMoneyMap,sumNumKey,importSuccessKey);
log.info("存储数据库成功!");
}
}).sheet().doRead();
......@@ -1687,7 +1701,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
ConcurrentHashMap<String, BigDecimal> bigMoneyMap,
ConcurrentHashMap<String, BigDecimal> unEmpMoneyMap,
ConcurrentHashMap<String, BigDecimal> injuryMoneyMap,
ConcurrentHashMap<String, BigDecimal> medicalMoneyMap) {
ConcurrentHashMap<String, BigDecimal> medicalMoneyMap,
String sumNumKey,String importSuccessKey) {
HashMap<String, String> areaMap = new HashMap<>();
HashMap<String, String> areaMap2 = new HashMap<>();
......@@ -1860,14 +1875,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
List<CompletableFuture<List<ErrorMessage>>> completableFutureList = new ArrayList<>();
String importSuccessKey = user.getId() + CommonConstants.DOWN_LINE_STRING + CommonConstants.PAYMENT_SOCIAL_WAIT_EXPORT;
// 创建一个数值格式化对象
NumberFormat numberFormat = NumberFormat.getInstance();
// 设置精确到小数点后2位
numberFormat.setMaximumFractionDigits(2);
String maerialRatio = "";
String sumNumKey = user.getId() + CommonConstants.DOWN_LINE_STRING + "sum_key";
Integer bfInt = (Integer) redisUtil.get(sumNumKey);
if (Common.isNotNull(bfInt)) {
if (rowNumber > bfInt + 1) {
......@@ -1876,7 +1888,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
redisUtil.set(sumNumKey, bfInt, 360L);
} else {
maerialRatio = "100";
redisUtil.remove(sumNumKey);
}
} else {
if (rowNumber >= 100) {
......@@ -1885,7 +1896,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
redisUtil.set(sumNumKey, bfInt, 360L);
} else {
maerialRatio = "100";
redisUtil.remove(sumNumKey);
}
}
redisUtil.set(importSuccessKey, maerialRatio, 360L);
......
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