Commit c545d288 authored by huyuchen's avatar huyuchen

接口修改

parent 9d5fc1a5
...@@ -279,7 +279,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -279,7 +279,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
public R<Boolean> removeInFoById(String id) { public R<Boolean> removeInFoById(String id) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
String key = user.getId() + CommonConstants.DOWN_LINE_STRING + CommonConstants.PAYMENT_SOCIAL_PUSH; String key = user.getId() + CommonConstants.DOWN_LINE_STRING + CommonConstants.PAYMENT_SOCIAL_PUSH;
if (Common.isNotNull((String) redisUtil.get(key))) { if (Common.isNotNull(redisUtil.get(key))) {
return R.failed("用户正在推送实缴数据中禁止删除!"); return R.failed("用户正在推送实缴数据中禁止删除!");
} }
TPaymentInfo paymentInfo = baseMapper.selectById(id); TPaymentInfo paymentInfo = baseMapper.selectById(id);
...@@ -307,7 +307,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -307,7 +307,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
} }
String key = user.getId() + CommonConstants.DOWN_LINE_STRING + CommonConstants.PAYMENT_SOCIAL_PUSH; String key = user.getId() + CommonConstants.DOWN_LINE_STRING + CommonConstants.PAYMENT_SOCIAL_PUSH;
if (Common.isNotNull((String) redisUtil.get(key))) { if (Common.isNotNull(redisUtil.get(key))) {
return R.failed("用户正在推送实缴数据中禁止删除!"); return R.failed("用户正在推送实缴数据中禁止删除!");
} }
List<String> idList = Common.initStrToList(ids, CommonConstants.COMMA_STRING); List<String> idList = Common.initStrToList(ids, CommonConstants.COMMA_STRING);
...@@ -349,7 +349,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -349,7 +349,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
String key = user.getId() + CommonConstants.DOWN_LINE_STRING + CommonConstants.PAYMENT_SOCIAL_PUSH; String key = user.getId() + CommonConstants.DOWN_LINE_STRING + CommonConstants.PAYMENT_SOCIAL_PUSH;
if (Common.isNotNull((String) redisUtil.get(key))) { if (Common.isNotNull(redisUtil.get(key))) {
return R.failed("用户正在推送实缴数据中禁止删除!"); return R.failed("用户正在推送实缴数据中禁止删除!");
} }
LambdaQueryWrapper<TPaymentInfo> wrapper = buildQueryWrapper(empIdCard, socialHouseId, fundHouseId, LambdaQueryWrapper<TPaymentInfo> wrapper = buildQueryWrapper(empIdCard, socialHouseId, fundHouseId,
...@@ -416,6 +416,14 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -416,6 +416,14 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
@Override @Override
public R<List<ErrorMessage>> importSocialDiy(InputStream inputStream) { public R<List<ErrorMessage>> importSocialDiy(InputStream inputStream) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
String sumNumKey = user.getId() + CommonConstants.DOWN_LINE_STRING + "sum_key";
if (Common.isNotNull(redisUtil.get(sumNumKey))) {
redisUtil.remove(sumNumKey);
}
String importSuccessKey = user.getId() + CommonConstants.DOWN_LINE_STRING + CommonConstants.PAYMENT_SOCIAL_WAIT_EXPORT;
if (Common.isNotNull(redisUtil.get(importSuccessKey))) {
redisUtil.remove(importSuccessKey);
}
List<ErrorMessage> errorMessageList = new ArrayList<>(); List<ErrorMessage> errorMessageList = new ArrayList<>();
//养老 //养老
ConcurrentHashMap<String, BigDecimal> pensionMoneyMap = new ConcurrentHashMap<>(); ConcurrentHashMap<String, BigDecimal> pensionMoneyMap = new ConcurrentHashMap<>();
...@@ -479,8 +487,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -479,8 +487,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
*/ */
private void saveData() { private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size()); log.info("{}条数据,开始存储数据库!", cachedDataList.size());
importTPaymentSocialInfo(cachedDataList, errorMessageList, user, rowNumber,pensionMoneyMap, importTPaymentSocialInfo(cachedDataList, sumNumKey,importSuccessKey,errorMessageList, user,
bigMoneyMap,unEmpMoneyMap,birMoneyMap,injuryMoneyMap,medicalMoneyMap,accrualMoneyMap); rowNumber,pensionMoneyMap, bigMoneyMap,unEmpMoneyMap,birMoneyMap,injuryMoneyMap,
medicalMoneyMap,accrualMoneyMap);
log.info("存储数据库成功!"); log.info("存储数据库成功!");
} }
}).sheet().doRead(); }).sheet().doRead();
...@@ -498,7 +507,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -498,7 +507,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
return R.ok(errorMessageList); 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, YifuUser user, Integer rowNumber,
ConcurrentHashMap<String, BigDecimal> pensionMoneyMap, ConcurrentHashMap<String, BigDecimal> pensionMoneyMap,
ConcurrentHashMap<String, BigDecimal> bigMoneyMap, ConcurrentHashMap<String, BigDecimal> bigMoneyMap,
...@@ -726,12 +736,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -726,12 +736,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
} }
} }
} }
// -----------------------------生成paymentInfoMap本段结束-------------------------------- // -----------------------------生成paymentInfoMap本段结束--------------------------------
// -----------------------------线程池处理list,批量保存社保信息开始-------------------------------- // -----------------------------线程池处理list,批量保存社保信息开始--------------------------------
List<TPaymentInfoVo> tempList = new ArrayList<>(); 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<>(); List<CompletableFuture<List<ErrorMessage>>> completableFutureList = new ArrayList<>();
// 创建一个数值格式化对象 // 创建一个数值格式化对象
...@@ -739,7 +748,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -739,7 +748,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
// 设置精确到小数点后2位 // 设置精确到小数点后2位
numberFormat.setMaximumFractionDigits(2); numberFormat.setMaximumFractionDigits(2);
String maerialRatio = ""; String maerialRatio = "";
String sumNumKey = user.getId() + CommonConstants.DOWN_LINE_STRING + "sum_key";
Integer bfInt = (Integer) redisUtil.get(sumNumKey); Integer bfInt = (Integer) redisUtil.get(sumNumKey);
if (Common.isNotNull(bfInt)) { if (Common.isNotNull(bfInt)) {
if (rowNumber > bfInt + 1) { if (rowNumber > bfInt + 1) {
...@@ -1349,6 +1357,14 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -1349,6 +1357,14 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
@Override @Override
public R<List<ErrorMessage>> importSocialHeFeiDiy(InputStream inputStream, String random, String type) { public R<List<ErrorMessage>> importSocialHeFeiDiy(InputStream inputStream, String random, String type) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
String sumNumKey = user.getId() + CommonConstants.DOWN_LINE_STRING + "sum_key";
if (Common.isNotNull(redisUtil.get(sumNumKey))) {
redisUtil.remove(sumNumKey);
}
String importSuccessKey = user.getId() + CommonConstants.DOWN_LINE_STRING + CommonConstants.PAYMENT_SOCIAL_WAIT_EXPORT;
if (Common.isNotNull(redisUtil.get(importSuccessKey))) {
redisUtil.remove(importSuccessKey);
}
List<ErrorMessage> errorMessageList = new ArrayList<>(); List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<TPaymentHeFeiVo> util1 = new ExcelUtil<>(TPaymentHeFeiVo.class); ExcelUtil<TPaymentHeFeiVo> util1 = new ExcelUtil<>(TPaymentHeFeiVo.class);
ConcurrentHashMap<String, BigDecimal> pensionMoneyMap = new ConcurrentHashMap<>(); ConcurrentHashMap<String, BigDecimal> pensionMoneyMap = new ConcurrentHashMap<>();
...@@ -1403,7 +1419,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -1403,7 +1419,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
private void saveData() { private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size()); log.info("{}条数据,开始存储数据库!", cachedDataList.size());
importTPaymentSocialHeFei(cachedDataList, errorMessageList, user, type, rowNumber,pensionMoneyMap, importTPaymentSocialHeFei(cachedDataList, errorMessageList, user, type, rowNumber,pensionMoneyMap,
bigMoneyMap,unEmpMoneyMap,injuryMoneyMap,medicalMoneyMap); bigMoneyMap,unEmpMoneyMap,injuryMoneyMap,medicalMoneyMap,sumNumKey,importSuccessKey);
log.info("存储数据库成功!"); log.info("存储数据库成功!");
} }
}).sheet().doRead(); }).sheet().doRead();
...@@ -1687,7 +1703,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -1687,7 +1703,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
ConcurrentHashMap<String, BigDecimal> bigMoneyMap, ConcurrentHashMap<String, BigDecimal> bigMoneyMap,
ConcurrentHashMap<String, BigDecimal> unEmpMoneyMap, ConcurrentHashMap<String, BigDecimal> unEmpMoneyMap,
ConcurrentHashMap<String, BigDecimal> injuryMoneyMap, 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> areaMap = new HashMap<>();
HashMap<String, String> areaMap2 = new HashMap<>(); HashMap<String, String> areaMap2 = new HashMap<>();
...@@ -1860,14 +1877,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -1860,14 +1877,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
List<CompletableFuture<List<ErrorMessage>>> completableFutureList = new ArrayList<>(); List<CompletableFuture<List<ErrorMessage>>> completableFutureList = new ArrayList<>();
String importSuccessKey = user.getId() + CommonConstants.DOWN_LINE_STRING + CommonConstants.PAYMENT_SOCIAL_WAIT_EXPORT;
// 创建一个数值格式化对象 // 创建一个数值格式化对象
NumberFormat numberFormat = NumberFormat.getInstance(); NumberFormat numberFormat = NumberFormat.getInstance();
// 设置精确到小数点后2位 // 设置精确到小数点后2位
numberFormat.setMaximumFractionDigits(2); numberFormat.setMaximumFractionDigits(2);
String maerialRatio = ""; String maerialRatio = "";
String sumNumKey = user.getId() + CommonConstants.DOWN_LINE_STRING + "sum_key";
Integer bfInt = (Integer) redisUtil.get(sumNumKey); Integer bfInt = (Integer) redisUtil.get(sumNumKey);
if (Common.isNotNull(bfInt)) { if (Common.isNotNull(bfInt)) {
if (rowNumber > bfInt + 1) { if (rowNumber > bfInt + 1) {
......
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