Commit b304aede authored by huyuchen's avatar huyuchen

优化修改

parent b69ceeab
......@@ -923,10 +923,12 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (Common.isNotNull(list)) {
TPaymentInfo paymentInfo;
TSocialFundInfo socialInfo;
TSocialInfo tSocialInfo;
TSocialInfo tSocialInfo = new TSocialInfo();
String temp;
int res;
List<TSocialInfo> socialist;
List<TSettleDomainSelectVo> settleDomainR;
R<TSettleDomainListVo> listVo;
List<TSocialFundInfo> socialInfoList = socialFundInfoMapper.selectList(Wrappers.<TSocialFundInfo>query().lambda()
.in(TSocialFundInfo::getEmpIdcard, Common.listObjectToStrList(list, ExcelAttributeConstants.EMPIDCARD)));
......@@ -992,9 +994,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if ((Common.isEmpty(infoVo.getSocialTown()) || (Common.isNotNull(infoVo.getSocialTown()) &&
infoVo.getSocialTown().equals(socialInfo1.getSocialTown()))) &&
DateUtil.dateToString(socialInfo1.getSocialStartDate(),"yyyyMM").compareTo(infoVo.getSocialPayMonth()) <=0 &&
(Common.isEmpty(socialInfo1.getReduceHandleTime()) || (Common.isNotNull(socialInfo1.getReduceHandleTime()) &&
DateUtil.dateToString(socialInfo1.getReduceHandleTime(),"yyyyMM").compareTo(infoVo.getSocialPayMonth()) >=0))) {
(Common.isEmpty(socialInfo1.getSocialReduceDate()) || (Common.isNotNull(socialInfo1.getSocialReduceDate()) &&
DateUtil.dateToString(socialInfo1.getSocialReduceDate(),"yyyyMM").compareTo(infoVo.getSocialPayMonth()) >=0))) {
isTrueAdder = true;
tSocialInfo = socialInfo1;
break;
}
}
......@@ -1252,28 +1255,53 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
continue;
}
}
tSocialInfo = socialInfoMapper.selectOne(Wrappers.<TSocialInfo>query().lambda()
.eq(TSocialInfo::getEmpIdcard, infoVo.getEmpIdcard()).groupBy(TSocialInfo::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isEmpty(tSocialInfo)) {
tSocialInfo = socialInfoMapper.selectOne(Wrappers.<TSocialInfo>query().lambda()
.eq(TSocialInfo::getEmpIdcard, infoVo.getEmpIdcard()).groupBy(TSocialInfo::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL));
}
paymentInfo = new TPaymentInfo();
paymentInfo.setLockStatus(CommonConstants.ZERO_STRING);
paymentInfo.setEmpId(socialInfo.getEmpId());
paymentInfo.setEmpIdcard(socialInfo.getEmpIdcard());
paymentInfo.setEmpName(socialInfo.getEmpName());
paymentInfo.setSettleDomainId(socialInfo.getSettleDomain());
paymentInfo.setSettleDomainName(socialInfo.getSettleDomainName());
paymentInfo.setSettleDomainCode(socialInfo.getSettleDomainCode());
paymentInfo.setUnitId(socialInfo.getUnitId());
paymentInfo.setUnitName(socialInfo.getUnitName());
if (Common.isNotNull(socialInfo)) {
paymentInfo.setEmpId(socialInfo.getEmpId());
paymentInfo.setEmpIdcard(socialInfo.getEmpIdcard());
paymentInfo.setEmpName(socialInfo.getEmpName());
paymentInfo.setSettleDomainId(socialInfo.getSettleDomain());
paymentInfo.setSettleDomainName(socialInfo.getSettleDomainName());
paymentInfo.setSettleDomainCode(socialInfo.getSettleDomainCode());
paymentInfo.setUnitId(socialInfo.getUnitId());
paymentInfo.setUnitName(socialInfo.getUnitName());
paymentInfo.setSocialProvince(socialInfo.getSocialProvince());
paymentInfo.setSocialCity(socialInfo.getSocialCity());
paymentInfo.setSocialTown(socialInfo.getSocialTown());
paymentInfo.setSocialHousehold(socialInfo.getSocialHouseholdName());
} else if(Common.isNotNull(tSocialInfo)){
paymentInfo.setEmpId(tSocialInfo.getEmpId());
paymentInfo.setEmpIdcard(tSocialInfo.getEmpIdcard());
paymentInfo.setEmpName(tSocialInfo.getEmpName());
paymentInfo.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) {
paymentInfo.setSettleDomainName(vo.getDepartName());
paymentInfo.setSettleDomainCode(vo.getDepartNo());
paymentInfo.setUnitId(vo.getCustomerId());
paymentInfo.setUnitName(vo.getCustomerName()); }
}
}
paymentInfo.setSocialProvince(tSocialInfo.getSocialProvince());
paymentInfo.setSocialCity(tSocialInfo.getSocialCity());
paymentInfo.setSocialTown(tSocialInfo.getSocialTown());
paymentInfo.setSocialHousehold(tSocialInfo.getSocialHouseholdName());
}
if (Common.isNotNull(tSocialInfo)) {
paymentInfo.setInauguralTeam(tSocialInfo.getInauguralTeam());
paymentInfo.setEmpNo(tSocialInfo.getEmpNo());
}
paymentInfo.setSocialProvince(socialInfo.getSocialProvince());
paymentInfo.setSocialCity(socialInfo.getSocialCity());
paymentInfo.setSocialTown(socialInfo.getSocialTown());
paymentInfo.setSocialHousehold(socialInfo.getSocialHouseholdName());
paymentInfo.setSocialPayMonth(infoVo.getSocialPayMonth());
if (null != paymentInfo.getSocialProvince()) {
......@@ -1529,6 +1557,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
String temp;
int res = -1;
List<TProvidentFund> fundlist;
TProvidentFund tProvidentFund = new TProvidentFund();
List<TSettleDomainSelectVo> settleDomainR;
R<TSettleDomainListVo> listVo;
//获取身份证列表
List<String> idcards = list.stream().map(TPaymentInfoVo::getEmpIdcard).collect(Collectors.toList());
......@@ -1612,9 +1643,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if ((Common.isEmpty(infoVo.getSocialTown()) || (Common.isNotNull(infoVo.getSocialTown()) &&
infoVo.getFundTown().equals(providentFund.getFundTown()))) &&
DateUtil.dateToString(providentFund.getProvidentStart(),"yyyyMM").compareTo(infoVo.getProvidentPayMonth()) <=0 &&
(Common.isEmpty(providentFund.getReduceHandleTime()) || (Common.isNotNull(providentFund.getReduceHandleTime()) &&
DateUtil.dateToString(providentFund.getReduceHandleTime(),"yyyyMM").compareTo(infoVo.getProvidentPayMonth()) >=0))) {
(Common.isEmpty(providentFund.getFundReduceDate()) || (Common.isNotNull(providentFund.getFundReduceDate()) &&
DateUtil.dateToString(providentFund.getFundReduceDate(),"yyyyMM").compareTo(infoVo.getProvidentPayMonth()) >=0))) {
isTrueAdder = true;
tProvidentFund = providentFund;
break;
}
}
......@@ -1650,29 +1682,54 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
continue;
}
TProvidentFund tProvidentFund = providentFundMapper.selectOne(Wrappers.<TProvidentFund>query().lambda()
.eq(TProvidentFund::getEmpIdcard, infoVo.getEmpIdcard()).groupBy(TProvidentFund::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isEmpty(tProvidentFund)) {
tProvidentFund = providentFundMapper.selectOne(Wrappers.<TProvidentFund>query().lambda()
.eq(TProvidentFund::getEmpIdcard, infoVo.getEmpIdcard()).groupBy(TProvidentFund::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL));
}
paymentInfo = new TPaymentInfo();
paymentInfo.setLockStatus(CommonConstants.ZERO_STRING);
paymentInfo.setEmpId(fund.getEmpId());
paymentInfo.setEmpIdcard(fund.getEmpIdcard());
paymentInfo.setEmpName(fund.getEmpName());
paymentInfo.setSettleDomainId(fund.getSettleDomainFund());
paymentInfo.setSettleDomainName(fund.getSettleDomainNameFund());
paymentInfo.setSettleDomainCode(fund.getSettleDomainCodeFund());
paymentInfo.setUnitId(fund.getUnitIdFund());
paymentInfo.setUnitName(fund.getUnitNameFund());
if (Common.isNotNull(fund)) {
paymentInfo.setEmpId(fund.getEmpId());
paymentInfo.setEmpIdcard(fund.getEmpIdcard());
paymentInfo.setEmpName(fund.getEmpName());
paymentInfo.setSettleDomainId(fund.getSettleDomainFund());
paymentInfo.setSettleDomainName(fund.getSettleDomainNameFund());
paymentInfo.setSettleDomainCode(fund.getSettleDomainCodeFund());
paymentInfo.setUnitId(fund.getUnitIdFund());
paymentInfo.setUnitName(fund.getUnitNameFund());
paymentInfo.setFundProvince(fund.getFundProvince());
paymentInfo.setFundCity(fund.getFundCity());
paymentInfo.setFundTown(fund.getFundTown());
paymentInfo.setProvidentHousehold(fund.getProvidentHouseholdName());
} else if (Common.isNotNull(tProvidentFund)) {
paymentInfo.setEmpId(tProvidentFund.getEmpId());
paymentInfo.setEmpIdcard(tProvidentFund.getEmpIdcard());
paymentInfo.setEmpName(tProvidentFund.getEmpName());
paymentInfo.setSettleDomainId(tProvidentFund.getSettleDomain());
listVo = archivesDaprUtil.selectSettleDomainSelectVoById(tProvidentFund.getSettleDomain());
if (Common.isNotNull(listVo)) {
TSettleDomainListVo tSettleDomainListVo = listVo.getData();
if (Common.isNotNull(tSettleDomainListVo) && Common.isNotEmpty(tSettleDomainListVo.getListSelectVO())) {
settleDomainR = tSettleDomainListVo.getListSelectVO();
for (TSettleDomainSelectVo vo :settleDomainR) {
paymentInfo.setSettleDomainName(vo.getDepartName());
paymentInfo.setSettleDomainCode(vo.getDepartNo());
paymentInfo.setUnitId(vo.getCustomerId());
paymentInfo.setUnitName(vo.getCustomerName()); }
}
}
paymentInfo.setFundProvince(tProvidentFund.getFundProvince());
paymentInfo.setFundCity(tProvidentFund.getFundCity());
paymentInfo.setFundTown(tProvidentFund.getFundTown());
paymentInfo.setProvidentHousehold(tProvidentFund.getProvidentHouseholdName());
}
if (Common.isNotNull(tProvidentFund)) {
paymentInfo.setInauguralTeam(tProvidentFund.getInauguralTeam());
paymentInfo.setEmpNo(tProvidentFund.getEmpNo());
}
paymentInfo.setProvidentPayMonth(infoVo.getProvidentPayMonth());
paymentInfo.setFundProvince(fund.getFundProvince());
paymentInfo.setFundCity(fund.getFundCity());
paymentInfo.setFundTown(fund.getFundTown());
paymentInfo.setProvidentHousehold(fund.getProvidentHouseholdName());
if (null != paymentInfo.getFundProvince()) {
temp = areaMap.get(paymentInfo.getFundProvince());
if (Common.isNotNull(temp)) {
......@@ -1713,7 +1770,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ONE_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(), paymentInfo.getProvidentHousehold(), infoVo.getEmpName()
, CommonConstants.SAVE_SUCCESS));
}
if (Common.isNotNull(paymentInfo.getId()) && Common.isNotNull(paymentInfo.getFundId())) {
if (Common.isNotNull(paymentInfo.getId()) && Common.isNotNull(paymentInfo.getFundId())) {
paymentInfoMap.put(paymentInfo.getProvidentPayAddr()
+ CommonConstants.DOWN_LINE_STRING
+ paymentInfo.getEmpIdcard().trim()
......@@ -2040,11 +2097,12 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (Common.isNotNull(list)) {
TPaymentInfo payExists;
TSocialFundInfo socialInfo = null;
TSocialInfo tSocialInfo;
TSocialInfo tSocialInfo = new TSocialInfo();
String temp;
List<TSocialInfo> socialist;
int res;
List<TSettleDomainSelectVo> settleDomainR;
R<TSettleDomainListVo> listVo;
List<TSocialFundInfo> socialInfoList = socialFundInfoMapper.selectList(Wrappers.<TSocialFundInfo>query().lambda()
.in(TSocialFundInfo::getEmpIdcard, Common.listObjectToStrList(list, ExcelAttributeConstants.EMPIDCARD)));
......@@ -2102,9 +2160,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if ((Common.isEmpty(infoVo.getSocialTown()) || (Common.isNotNull(infoVo.getSocialTown()) &&
infoVo.getSocialTown().toString().equals(socialInfo1.getSocialTown()))) &&
DateUtil.dateToString(socialInfo1.getSocialStartDate(),"yyyyMM").compareTo(infoVo.getSocialPayMonth()) <=0 &&
(Common.isEmpty(socialInfo1.getReduceHandleTime()) || (Common.isNotNull(socialInfo1.getReduceHandleTime()) &&
DateUtil.dateToString(socialInfo1.getReduceHandleTime(),"yyyyMM").compareTo(infoVo.getSocialPayMonth()) >=0))) {
(Common.isEmpty(socialInfo1.getSocialReduceDate()) || (Common.isNotNull(socialInfo1.getSocialReduceDate()) &&
DateUtil.dateToString(socialInfo1.getSocialReduceDate(),"yyyyMM").compareTo(infoVo.getSocialPayMonth()) >=0))) {
isTrueAdder = true;
tSocialInfo = socialInfo1;
break;
}
}
......@@ -2309,30 +2368,53 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
tSocialInfo = socialInfoMapper.selectOne(Wrappers.<TSocialInfo>query().lambda()
.eq(TSocialInfo::getEmpIdcard, infoVo.getEmpIdcard()).groupBy(TSocialInfo::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isEmpty(tSocialInfo)) {
tSocialInfo = socialInfoMapper.selectOne(Wrappers.<TSocialInfo>query().lambda()
.eq(TSocialInfo::getEmpIdcard, infoVo.getEmpIdcard()).groupBy(TSocialInfo::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL));
}
payExists = new TPaymentInfo();
payExists.setLockStatus(CommonConstants.ZERO_STRING);
payExists.setEmpId(socialInfo.getEmpId());
payExists.setEmpIdcard(socialInfo.getEmpIdcard());
payExists.setEmpName(socialInfo.getEmpName());
payExists.setSettleDomainId(socialInfo.getSettleDomain());
payExists.setSettleDomainName(socialInfo.getSettleDomainName());
payExists.setSettleDomainCode(socialInfo.getSettleDomainCode());
payExists.setUnitId(socialInfo.getUnitId());
payExists.setUnitName(socialInfo.getUnitName());
if (Common.isNotNull(socialInfo)) {
payExists.setEmpId(socialInfo.getEmpId());
payExists.setEmpIdcard(socialInfo.getEmpIdcard());
payExists.setEmpName(socialInfo.getEmpName());
payExists.setSettleDomainId(socialInfo.getSettleDomain());
payExists.setSettleDomainName(socialInfo.getSettleDomainName());
payExists.setSettleDomainCode(socialInfo.getSettleDomainCode());
payExists.setUnitId(socialInfo.getUnitId());
payExists.setUnitName(socialInfo.getUnitName());
payExists.setSocialProvince(socialInfo.getSocialProvince());
payExists.setSocialCity(socialInfo.getSocialCity());
payExists.setSocialTown(socialInfo.getSocialTown());
payExists.setSocialHousehold(socialInfo.getSocialHouseholdName());
}else if (Common.isNotNull(tSocialInfo)) {
payExists.setEmpId(tSocialInfo.getEmpId());
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()); }
}
}
payExists.setSocialProvince(tSocialInfo.getSocialProvince());
payExists.setSocialCity(tSocialInfo.getSocialCity());
payExists.setSocialTown(tSocialInfo.getSocialTown());
payExists.setSocialHousehold(tSocialInfo.getSocialHouseholdName());
}
if (Common.isNotNull(tSocialInfo)) {
payExists.setInauguralTeam(tSocialInfo.getInauguralTeam());
payExists.setEmpNo(tSocialInfo.getEmpNo());
}
payExists.setSocialProvince(socialInfo.getSocialProvince());
payExists.setSocialCity(socialInfo.getSocialCity());
payExists.setSocialTown(socialInfo.getSocialTown());
payExists.setSocialHousehold(socialInfo.getSocialHouseholdName());
payExists.setSocialPayMonth(infoVo.getSocialPayMonth());
if (null != payExists.getSocialProvince()) {
......
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