Commit 9c916409 authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/MVP1.5' into MVP1.5

parents 8b28ffd1 b77aaa60
......@@ -1776,12 +1776,16 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
relaySalary = BigDecimalUtils.safeAdd(actualSalarySumNow, nowTaxY).setScale(SalaryConstants.PLACES, RoundingMode.HALF_UP);
} else {
// 2个人承担全部
// TODO-@胡 :个人承担全部税费,实发要变为应发,推算出实发、个税
nowTaxY = BigDecimal.ZERO;
relaySalary = a.getActualSalary();
//个人承担全部税费,实发要变为应发,推算出实发、个税
nowTaxY = getNowTax(actualSalarySum);
if (sumOtherTax.compareTo(BigDecimal.ZERO) != 0) {
//历史应发税费
nowTaxY = BigDecimalUtils.safeSubtract(false,nowTaxY, sumOtherTax).setScale(SalaryConstants.PLACES, RoundingMode.HALF_UP);
}
//公司应发和个人实收
relaySalary = BigDecimalUtils.safeSubtract(false,actualSalarySumNow, nowTaxY).setScale(SalaryConstants.PLACES, RoundingMode.HALF_UP);
a.setActualSalary(relaySalary);
a.setSalaryTax(nowTaxY);
}
a.setRelaySalaryUnit(relaySalary);
a.setRelaySalary(actualSalarySumNow);
......
......@@ -13,7 +13,6 @@ import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TConfigSalary;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryConfigStandard;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryEmployee;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandardIssueRes;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryAccountService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryEmployeeService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryUploadParamVo;
......@@ -247,12 +246,6 @@ public class SalaryAccountUtil implements Serializable {
salaryGiveTimeFlag = false;
entity.setSalaryGiveTime(CommonConstants.ONE_STRING);
}
if (SalaryConstants.IS_PERSON.equals(cellValueStr)) {
errorFlag = false;
error = "第" + (i + 2) + "行:个人承担全部税费,正在开发中,下周见~";
errorList.add(new ErrorMessage((i + 2), error));
continue;
}
field = fieldsMap.get(scs.getJavaFiedName());
if (field == null) {
sai = new TSalaryAccountItemVo();
......
......@@ -1428,6 +1428,25 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (Common.isNotNull(redisUtil.get(importSuccessKey))) {
redisUtil.remove(importSuccessKey);
}
//批量插入的集合
List<TPaymentInfo> batchInsertList = new ArrayList<>();
//获取所有项目信息
Map<String, TSettleDomainSelectVo> domainMap = this.getSelectVoMapById();
//地区数据
HashMap<String, String> areaMap = new HashMap<>();
HashMap<String, String> areaMap2 = new HashMap<>();
R<AreaVo> areaListR = upmsDaprUtils.getAreaListR();
if (Common.isNotNull(areaListR)) {
AreaVo areaList = areaListR.getData();
if (null != areaList && !areaList.getSysAreaList().isEmpty()) {
for (SysArea area : areaList.getSysAreaList()) {
areaMap.put(Integer.toString(area.getId()), area.getAreaName());
areaMap2.put(area.getAreaName() + CommonConstants.DOWN_LINE_STRING + (
null == area.getParentId() ? "null" : (0 == area.getParentId() ? "null" : Integer.toString(
area.getParentId()))), Integer.toString(area.getId()));
}
}
}
List<ErrorDetailVO> errorMessageList = new ArrayList<>();
ExcelUtil<TPaymentHeFeiVo> util1 = new ExcelUtil<>(TPaymentHeFeiVo.class);
ConcurrentHashMap<String, BigDecimal> pensionMoneyMap = new ConcurrentHashMap<>();
......@@ -1482,10 +1501,16 @@ 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, sumNumKey, importSuccessKey);
bigMoneyMap, unEmpMoneyMap, injuryMoneyMap, medicalMoneyMap, sumNumKey, importSuccessKey
, batchInsertList, areaMap, areaMap2,domainMap);
log.info("存储数据库成功!");
}
}).sheet().doRead();
//批量插入数据
if (!batchInsertList.isEmpty()) {
this.saveBatch(batchInsertList);
batchInsertList.clear();
}
} catch (Exception e) {
log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR, e);
return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR);
......@@ -1495,6 +1520,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
unEmpMoneyMap.clear();
injuryMoneyMap.clear();
medicalMoneyMap.clear();
areaMap.clear();
areaMap2.clear();
domainMap.clear();
return this.judgeAllMessage(errorMessageList);
}
......@@ -1793,10 +1821,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo.setProvidentSum(null == infoVo.getProvidentSum() ? BigDecimal.ZERO : infoVo.getProvidentSum());
paymentInfo.setSumAll(paymentInfo.getProvidentSum());
paymentInfo.setFundId(UUID.randomUUID().toString());
if (Common.isNotNull(paymentInfo.getSocialCreateMonth()) && Common.isNotNull(paymentInfo.getSocialPayMonth())) {
paymentInfo.setSortTime(paymentInfo.getSocialCreateMonth().concat(paymentInfo.getSocialPayMonth()).concat(
String.valueOf(System.currentTimeMillis())));
}
batchInsertList.add(paymentInfo);
//批量插入数据
if (batchInsertList.size() >= 100000) {
......@@ -1827,22 +1851,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
ConcurrentHashMap<String, BigDecimal> unEmpMoneyMap,
ConcurrentHashMap<String, BigDecimal> injuryMoneyMap,
ConcurrentHashMap<String, BigDecimal> medicalMoneyMap,
String sumNumKey, String importSuccessKey) {
HashMap<String, String> areaMap = new HashMap<>();
HashMap<String, String> areaMap2 = new HashMap<>();
R<AreaVo> areaListR = upmsDaprUtils.getAreaListR();
if (Common.isNotNull(areaListR)) {
AreaVo areaList = areaListR.getData();
if (null != areaList && !areaList.getSysAreaList().isEmpty()) {
for (SysArea area : areaList.getSysAreaList()) {
areaMap.put(Integer.toString(area.getId()), area.getAreaName());
areaMap2.put(area.getAreaName() + CommonConstants.DOWN_LINE_STRING + (null == area.getParentId() ?
"null" : (0 == area.getParentId() ? "null" : Integer.toString(
area.getParentId()))), Integer.toString(area.getId()));
}
}
}
String sumNumKey, String importSuccessKey,
List<TPaymentInfo> batchInsertList,HashMap<String, String> areaMap,
HashMap<String, String> areaMap2,Map<String,TSettleDomainSelectVo> domainMap) {
// 将以下代码提取出来,使用paymentInfoMap提升性能,避免list多次循环查询数据库浪费性能
// 导入前做队列空闲判断,防止队列不足出现数据丢失的场景
......@@ -2032,7 +2043,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
-> executeImportSocialListThree(user, list, areaMap, areaMap2,
paymentInfoPensionMap, paymentInfoMedicalMap, paymentInfoUnEmpMap, paymentInfoInjuryMap,
paymentInfoBigMap, type, errorMessageList, pensionMoneyMap, bigMoneyMap,
unEmpMoneyMap, injuryMoneyMap, medicalMoneyMap),
unEmpMoneyMap, injuryMoneyMap, medicalMoneyMap,batchInsertList,domainMap),
yfSocialImportThreadPoolExecutor);
completableFutureList.add(listCompletableFuture);
}
......@@ -2047,7 +2058,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
areaMap2, paymentInfoPensionMap, paymentInfoMedicalMap, paymentInfoUnEmpMap,
paymentInfoInjuryMap, paymentInfoBigMap, type,
errorMessageList, pensionMoneyMap, bigMoneyMap, unEmpMoneyMap, injuryMoneyMap,
medicalMoneyMap), yfSocialImportThreadPoolExecutor);
medicalMoneyMap,batchInsertList,domainMap), yfSocialImportThreadPoolExecutor);
completableFutureList.add(oneCompletableFuture);
lastIdx = 1;
for (int i = 1; i < list.size(); i++) {
......@@ -2061,7 +2072,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
, areaMap, areaMap2, paymentInfoPensionMap, paymentInfoMedicalMap,
paymentInfoUnEmpMap, paymentInfoInjuryMap, paymentInfoBigMap, type,
errorMessageList, pensionMoneyMap, bigMoneyMap, unEmpMoneyMap,
injuryMoneyMap, medicalMoneyMap), yfSocialImportThreadPoolExecutor);
injuryMoneyMap, medicalMoneyMap,batchInsertList,domainMap),
yfSocialImportThreadPoolExecutor);
completableFutureList.add(listCompletableFuture);
tempList = new ArrayList<>();
}
......@@ -2087,7 +2099,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
-> executeImportSocialListThree(user, finalTempList, areaMap,
areaMap2, paymentInfoPensionMap, paymentInfoMedicalMap, paymentInfoUnEmpMap,
paymentInfoInjuryMap, paymentInfoBigMap, type, errorMessageList, pensionMoneyMap,
bigMoneyMap, unEmpMoneyMap, injuryMoneyMap, medicalMoneyMap)
bigMoneyMap, unEmpMoneyMap, injuryMoneyMap, medicalMoneyMap,batchInsertList,domainMap)
, yfSocialImportThreadPoolExecutor);
completableFutureList.add(listCompletableFuture);
}
......@@ -2124,16 +2136,17 @@ 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,
List<TPaymentInfo> batchInsertList,
Map<String,TSettleDomainSelectVo> domainMap) {
if (Common.isNotNull(list)) {
TPaymentInfo payExists;
TSocialFundInfo socialInfo = null;
TSocialInfo tSocialInfo = null;
String temp;
List<TSocialInfo> socialist;
int res;
List<TSettleDomainSelectVo> settleDomainR;
R<TSettleDomainListVo> listVo;
TSettleDomain domain;
List<TSocialFundInfo> socialInfoList = socialFundInfoMapper.selectList(Wrappers.<TSocialFundInfo>query().lambda()
.in(TSocialFundInfo::getEmpIdcard, Common.listObjectToStrList(list, ExcelAttributeConstants.EMPIDCARD)));
......@@ -2142,8 +2155,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (Common.isNotNull(socialInfoList)) {
for (TSocialFundInfo tSocialInfo1 : socialInfoList) {
socialMap.put(tSocialInfo1.getEmpIdcard()
+ CommonConstants.DOWN_LINE_STRING + tSocialInfo1.getSocialProvince()
+ CommonConstants.DOWN_LINE_STRING + tSocialInfo1.getSocialCity()
+ CommonConstants.DOWN_LINE_STRING + tSocialInfo1.getSocialProvince()
+ CommonConstants.DOWN_LINE_STRING + (null == tSocialInfo1.getSocialTown()
? "null" : tSocialInfo1.getSocialTown()), tSocialInfo1);
}
......@@ -2425,18 +2438,16 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
payExists.setEmpIdcard(tSocialInfo.getEmpIdcard());
payExists.setEmpName(tSocialInfo.getEmpName());
payExists.setSettleDomainId(tSocialInfo.getSettleDomain());
listVo = archivesDaprUtil.selectSettleDomainSelectVoById(tSocialInfo.getSettleDomain());
if (Common.isNotNull(listVo)) {
TSettleDomainListVo tSettleDomainListVo = listVo.getData();
if (Common.isNotNull(tSettleDomainListVo) && Common.isNotEmpty(tSettleDomainListVo.getListSelectVO())) {
settleDomainR = tSettleDomainListVo.getListSelectVO();
for (TSettleDomainSelectVo vo : settleDomainR) {
payExists.setSettleDomainName(vo.getDepartName());
payExists.setSettleDomainCode(vo.getDepartNo());
payExists.setUnitId(vo.getCustomerId());
payExists.setUnitName(vo.getCustomerName());
}
}
if (Common.isNotNull(domainMap)) {
domain = domainMap.get(tSocialInfo.getSettleDomain());
} else {
domain = null;
}
if (Common.isNotNull(domain)) {
payExists.setSettleDomainName(domain.getDepartName());
payExists.setSettleDomainCode(domain.getDepartNo());
payExists.setUnitId(domain.getCustomerId());
payExists.setUnitName(domain.getCustomerName());
}
payExists.setSocialProvince(tSocialInfo.getSocialProvince());
payExists.setSocialCity(tSocialInfo.getSocialCity());
......@@ -2513,12 +2524,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
payExists.setCreateBy(user.getId());
payExists.setCreateName(user.getNickname());
payExists.setSocialId(UUID.randomUUID().toString());
res = insertAndSTimestamp(payExists);
if (res < 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), payExists.getSocialHousehold(), payExists.getProvidentHousehold(), infoVo.getEmpName(), CommonConstants.SAVE_FAILED));
} else {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ONE_INT, infoVo.getEmpIdcard(), payExists.getSocialHousehold(), payExists.getProvidentHousehold(), infoVo.getEmpName(), CommonConstants.SAVE_SUCCESS));
batchInsertList.add(payExists);
//批量插入数据
if (batchInsertList.size() >= 50000) {
this.saveBatch(batchInsertList);
batchInsertList.clear();
}
}
}
......@@ -3109,8 +3119,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (Common.isNotNull(settleDomain.getRiskServerItem()) && ((settleDomain.getRiskServerItem().contains(CommonConstants.ONE_STRING)
&& CommonConstants.ONE_STRING.equals(socialFundFlag)) || (settleDomain.getRiskServerItem().contains(CommonConstants.TWO_STRING)
&& CommonConstants.TWO_STRING.equals(socialFundFlag))) && CommonConstants.ZERO_STRING.equals(settleDomain.getRiskFundTag())
&& CommonConstants.TWO_STRING.equals(settleDomain.getMrSettleType())
&& CommonConstants.ZERO_STRING.equals(settleDomain.getRiskFundTag())) {
&& CommonConstants.TWO_STRING.equals(settleDomain.getMrSettleType())) {
//实缴模式
BigDecimal money;
if (CommonConstants.TWO_STRING.equals(settleDomain.getRiskFundType())) {
......
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