Merge remote-tracking branch 'remotes/origin/feature/231001-福利档案基数调整记录' into release/2.9.6.2310.01

This commit is contained in:
sy 2023-10-24 14:11:22 +08:00
commit 05b2c1868b
11 changed files with 848 additions and 42 deletions

View File

@ -18,10 +18,7 @@ import com.engine.salary.encrypt.AESEncryptUtil;
import com.engine.salary.encrypt.EncryptUtil;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.siarchives.bo.InsuranceArchivesBO;
import com.engine.salary.entity.siarchives.dto.InsuranceArchivesBaseDTO;
import com.engine.salary.entity.siarchives.dto.InsuranceArchivesFundSchemeDTO;
import com.engine.salary.entity.siarchives.dto.InsuranceArchivesOtherSchemeDTO;
import com.engine.salary.entity.siarchives.dto.InsuranceArchivesSocialSchemeDTO;
import com.engine.salary.entity.siarchives.dto.*;
import com.engine.salary.entity.siarchives.param.*;
import com.engine.salary.entity.siarchives.po.*;
import com.engine.salary.entity.sicategory.po.ICategoryPO;
@ -33,10 +30,7 @@ import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum;
import com.engine.salary.enums.siaccount.EmployeeStatusEnum;
import com.engine.salary.enums.sicategory.*;
import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.mapper.siarchives.FundSchemeMapper;
import com.engine.salary.mapper.siarchives.InsuranceBaseInfoMapper;
import com.engine.salary.mapper.siarchives.OtherSchemeMapper;
import com.engine.salary.mapper.siarchives.SocialSchemeMapper;
import com.engine.salary.mapper.siarchives.*;
import com.engine.salary.mapper.sicategory.ICategoryMapper;
import com.engine.salary.mapper.sischeme.InsuranceSchemeDetailMapper;
import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper;
@ -58,6 +52,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.BeanUtils;
import org.springframework.util.StopWatch;
import weaver.conn.mybatis.MyBatisFactory;
import weaver.general.Util;
@ -667,8 +662,22 @@ public class SIArchivesBiz {
otherIds.add(param.getId());
List<InsuranceArchivesOtherSchemePO> oldOtherInfoList = otherSchemeMapper.getOtherById(otherIds);
//设置福利档案基数调整记录数据
InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder()
.adjustAfterSchemeId(param.getOtherSchemeId())
.adjustAfterBaseJson(paramReq.getPaymentForm())
.welfareType(paramReq.getWelfareType().getValue())
.employeeId(param.getEmployeeId())
.paymentOrganization(param.getPaymentOrganization())
.build();
if (oldOtherInfoList.size() == 1) {
InsuranceArchivesOtherSchemePO oldOtherInfo = oldOtherInfoList.get(0);
//设置福利档案基数调整记录数据
encryptUtil.decrypt(oldOtherInfo, InsuranceArchivesOtherSchemePO.class);
adjustInfo.setAdjustBeforeBaseJson(oldOtherInfo.getOtherPaymentBaseString());
adjustInfo.setAdjustBeforeSchemeId(oldOtherInfo.getOtherSchemeId());
//新数据
InsuranceArchivesOtherSchemePO updateOtherInfo =
InsuranceArchivesOtherSchemePO.builder()
.id(oldOtherInfo.getId())
@ -745,10 +754,13 @@ public class SIArchivesBiz {
} else {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "档案不存在!"));
}
}
//生成福利档案基数调整记录数据
List<InsuranceArchivesBaseHistoryPO> adjustHistoryList = createAdjustInfo(adjustInfo, employeeId);
//福利档案基数调整记录数据入库
batchInsertAdjustHistory(adjustHistoryList, employeeId);
} finally {
sqlSession.close();
}
@ -776,8 +788,22 @@ public class SIArchivesBiz {
fundIds.add(param.getId());
List<InsuranceArchivesFundSchemePO> oldFundInfoList = fundSchemeMapper.getFundById(fundIds);
//设置福利档案基数调整记录数据
InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder()
.adjustAfterSchemeId(param.getFundSchemeId())
.adjustAfterBaseJson(paramReq.getPaymentForm())
.welfareType(paramReq.getWelfareType().getValue())
.employeeId(param.getEmployeeId())
.paymentOrganization(param.getPaymentOrganization())
.build();
if (oldFundInfoList.size() == 1) {
InsuranceArchivesFundSchemePO oldFundInfo = oldFundInfoList.get(0);
//设置福利档案基数调整记录数据
encryptUtil.decrypt(oldFundInfo, InsuranceArchivesFundSchemePO.class);
adjustInfo.setAdjustBeforeBaseJson(oldFundInfo.getFundPaymentBaseString());
adjustInfo.setAdjustBeforeSchemeId(oldFundInfo.getFundSchemeId());
//新数据
InsuranceArchivesFundSchemePO updateFundInfo = InsuranceArchivesFundSchemePO.builder()
.id(oldFundInfo.getId())
.fundSchemeId(param.getFundSchemeId())
@ -860,6 +886,11 @@ public class SIArchivesBiz {
}
//生成福利档案基数调整记录数据
List<InsuranceArchivesBaseHistoryPO> adjustHistoryList = createAdjustInfo(adjustInfo, employeeId);
//福利档案基数调整记录数据入库
batchInsertAdjustHistory(adjustHistoryList, employeeId);
} finally {
sqlSession.close();
}
@ -893,10 +924,25 @@ public class SIArchivesBiz {
List<Long> socialIds = new ArrayList();
socialIds.add(param.getId());
List<InsuranceArchivesSocialSchemePO> oldSocialInfoList = socialSchemeMapper.getSocialById(socialIds);
//设置福利档案基数调整记录数据
InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder()
.adjustAfterSchemeId(param.getSocialSchemeId())
.adjustAfterBaseJson(paramReq.getPaymentForm())
.welfareType(paramReq.getWelfareType().getValue())
.employeeId(param.getEmployeeId())
.paymentOrganization(param.getPaymentOrganization())
.build();
//组装新数据
if (oldSocialInfoList.size() == 1) {
//老数据
InsuranceArchivesSocialSchemePO oldSocialInfo = oldSocialInfoList.get(0);
//设置福利档案基数调整记录数据
encryptUtil.decrypt(oldSocialInfo, InsuranceArchivesSocialSchemePO.class);
adjustInfo.setAdjustBeforeBaseJson(oldSocialInfo.getSocialPaymentBaseString());
adjustInfo.setAdjustBeforeSchemeId(oldSocialInfo.getSocialSchemeId());
//新数据
InsuranceArchivesSocialSchemePO updateSocialInfo =
InsuranceArchivesSocialSchemePO.builder()
.id(oldSocialInfo.getId())
@ -979,6 +1025,10 @@ public class SIArchivesBiz {
}
//生成福利档案基数调整记录数据
List<InsuranceArchivesBaseHistoryPO> adjustHistoryList = createAdjustInfo(adjustInfo, employeeId);
//福利档案基数调整记录数据入库
batchInsertAdjustHistory(adjustHistoryList, employeeId);
} finally {
sqlSession.close();
}
@ -1822,4 +1872,220 @@ public class SIArchivesBiz {
}
return getInsuranceBaseInfoMapper().listEndDateIsNull(employeeIds);
}
public List<InsuranceArchivesBaseHistoryPO> dealSocialBaseAdjustInfoList(List<InsuranceArchivesSocialSchemePO> adjustList, Long creator) {
List<InsuranceArchivesBaseHistoryPO> adjustHistoryList = new ArrayList<>();
if (adjustList.size() > 0) {
//遍历待更新的福利档案数据对每组档案生成基数调整记录基数单元未变化则忽略
for (InsuranceArchivesSocialSchemePO po : adjustList) {
List<InsuranceArchivesSocialSchemePO> oldBaseInfoList = getSocialSchemeMapper().getSocialByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder()
.paymentOrganization(po.getPaymentOrganization()).employeeId(po.getEmployeeId()).build());
InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder()
.adjustAfterSchemeId(po.getSocialSchemeId())
.adjustAfterBaseJson(po.getSocialPaymentBaseString())
.welfareType(po.getWelfareType())
.employeeId(po.getEmployeeId())
.paymentOrganization(po.getPaymentOrganization())
.build();
if (oldBaseInfoList.size() == 1) {
//新增调整记录变更
InsuranceArchivesSocialSchemePO oldBaseInfo = oldBaseInfoList.get(0);
encryptUtil.decrypt(oldBaseInfo, InsuranceArchivesSocialSchemePO.class);
adjustInfo.setAdjustBeforeBaseJson(oldBaseInfo.getSocialPaymentBaseString());
adjustInfo.setAdjustBeforeSchemeId(oldBaseInfo.getSocialSchemeId());
} else if (oldBaseInfoList.size() > 1) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保档案存在冗余数据!"));
}
adjustHistoryList.addAll(createAdjustInfo(adjustInfo, creator));
}
}
return adjustHistoryList;
}
public List<InsuranceArchivesBaseHistoryPO> dealFundBaseAdjustInfoList(List<InsuranceArchivesFundSchemePO> adjustList, Long creator) {
List<InsuranceArchivesBaseHistoryPO> adjustHistoryList = new ArrayList<>();
if (adjustList.size() > 0) {
//遍历待更新的福利档案数据对每组档案生成基数调整记录基数单元未变化则忽略
for (InsuranceArchivesFundSchemePO po : adjustList) {
List<InsuranceArchivesFundSchemePO> oldBaseInfoList = getFundSchemeMapper().getFundByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder()
.paymentOrganization(po.getPaymentOrganization()).employeeId(po.getEmployeeId()).build());
InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder()
.adjustAfterSchemeId(po.getFundSchemeId())
.adjustAfterBaseJson(po.getFundPaymentBaseString())
.welfareType(po.getWelfareType())
.employeeId(po.getEmployeeId())
.paymentOrganization(po.getPaymentOrganization())
.build();
if (oldBaseInfoList.size() == 1) {
//新增调整记录变更
InsuranceArchivesFundSchemePO oldBaseInfo = oldBaseInfoList.get(0);
encryptUtil.decrypt(oldBaseInfo, InsuranceArchivesFundSchemePO.class);
adjustInfo.setAdjustBeforeBaseJson(oldBaseInfo.getFundPaymentBaseString());
adjustInfo.setAdjustBeforeSchemeId(oldBaseInfo.getFundSchemeId());
} else if (oldBaseInfoList.size() > 1) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金档案存在冗余数据!"));
}
adjustHistoryList.addAll(createAdjustInfo(adjustInfo, creator));
}
}
return adjustHistoryList;
}
public List<InsuranceArchivesBaseHistoryPO> dealOtherBaseAdjustInfoList(List<InsuranceArchivesOtherSchemePO> adjustList, Long creator) {
List<InsuranceArchivesBaseHistoryPO> adjustHistoryList = new ArrayList<>();
if (adjustList.size() > 0) {
//遍历待更新的福利档案数据对每组档案生成基数调整记录基数单元未变化则忽略
for (InsuranceArchivesOtherSchemePO po : adjustList) {
List<InsuranceArchivesOtherSchemePO> oldBaseInfoList = getOtherSchemeMapper().getOtherByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder()
.paymentOrganization(po.getPaymentOrganization()).employeeId(po.getEmployeeId()).build());
InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder()
.adjustAfterSchemeId(po.getOtherSchemeId())
.adjustAfterBaseJson(po.getOtherPaymentBaseString())
.welfareType(po.getWelfareType())
.employeeId(po.getEmployeeId())
.paymentOrganization(po.getPaymentOrganization())
.build();
if (oldBaseInfoList.size() == 1) {
//新增调整记录变更
InsuranceArchivesOtherSchemePO oldBaseInfo = oldBaseInfoList.get(0);
encryptUtil.decrypt(oldBaseInfo, InsuranceArchivesOtherSchemePO.class);
adjustInfo.setAdjustBeforeBaseJson(oldBaseInfo.getOtherPaymentBaseString());
adjustInfo.setAdjustBeforeSchemeId(oldBaseInfo.getOtherSchemeId());
} else if (oldBaseInfoList.size() > 1) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利档案存在冗余数据!"));
}
adjustHistoryList.addAll(createAdjustInfo(adjustInfo, creator));
}
}
return adjustHistoryList;
}
//生成基数调整记录基数单元未变化则忽略
public List<InsuranceArchivesBaseHistoryPO> createAdjustInfo(InsuranceArchivesBaseHistoryDTO adjustInfo, Long creator) {
Date now = new Date();
List<InsuranceArchivesBaseHistoryPO> toCreateAdjustHistoryList = new ArrayList<>();
//旧档案不存在基数信息则直接遍历新的基数数据生成调整记录旧档案存在基数信息则合并新旧基数数据遍历合并后的技术数据中的key生成调整记录
if(adjustInfo.getAdjustAfterBaseJson() != null && adjustInfo.getAdjustBeforeBaseJson() == null) {
Map<String, Object> adjustAfterBaseMap = JSON.parseObject(adjustInfo.getAdjustAfterBaseJson(), new TypeReference<Map<String, Object>>() {
});
for (String key : adjustAfterBaseMap.keySet()) {
InsuranceArchivesBaseHistoryPO adjustItem = new InsuranceArchivesBaseHistoryPO();
BeanUtils.copyProperties(adjustInfo, adjustItem);
adjustItem.setAdjustWelfareItemId(Long.valueOf(key));
adjustItem.setAdjustAfterBaseValue((String) adjustAfterBaseMap.get(key));
adjustItem.setOperateTime(now);
adjustItem.setOperator(creator);
adjustItem.setCreator(creator);
adjustItem.setCreateTime(now);
adjustItem.setUpdateTime(now);
adjustItem.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue());
adjustItem.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY);
adjustItem.setId(IdGenerator.generate());
toCreateAdjustHistoryList.add(adjustItem);
}
} else if (adjustInfo.getAdjustAfterBaseJson() != null && adjustInfo.getAdjustBeforeBaseJson() != null) {
Map<String, Object> adjustAfterBaseMap = JSON.parseObject(adjustInfo.getAdjustAfterBaseJson(), new TypeReference<Map<String, Object>>() {
});
Map<String, Object> adjustBeforeBaseMap = JSON.parseObject(adjustInfo.getAdjustBeforeBaseJson(), new TypeReference<Map<String, Object>>() {
});
Map<String, Object> reDealMap = new HashMap<>();
reDealMap.putAll(adjustAfterBaseMap);
reDealMap.putAll(adjustBeforeBaseMap);
for (String key : reDealMap.keySet()) {
String beforeValue = (String) adjustBeforeBaseMap.get(key);
String afterValue = (String) adjustAfterBaseMap.get(key);
if (SalaryEntityUtil.empty2Zero(beforeValue).compareTo(SalaryEntityUtil.empty2Zero(afterValue)) == 0) {
continue;
}
InsuranceArchivesBaseHistoryPO adjustItem = new InsuranceArchivesBaseHistoryPO();
BeanUtils.copyProperties(adjustInfo, adjustItem);
adjustItem.setAdjustWelfareItemId(Long.valueOf(key));
adjustItem.setAdjustBeforeBaseValue(beforeValue);
adjustItem.setAdjustAfterBaseValue(afterValue);
adjustItem.setOperateTime(now);
adjustItem.setOperator(creator);
adjustItem.setCreator(creator);
adjustItem.setCreateTime(now);
adjustItem.setUpdateTime(now);
adjustItem.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue());
adjustItem.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY);
adjustItem.setId(IdGenerator.generate());
toCreateAdjustHistoryList.add(adjustItem);
}
}
return toCreateAdjustHistoryList;
}
/**
* 新增福利档案基数调整记录
*
*/
public void batchInsertAdjustHistory(List<InsuranceArchivesBaseHistoryPO> adjustHistoryList, long employeeId) {
if (CollectionUtils.isEmpty(adjustHistoryList)) {
return;
}
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
InsuranceBaseAdjustHistoryMapper mapper = sqlSession.getMapper(InsuranceBaseAdjustHistoryMapper.class);
List<List<InsuranceArchivesBaseHistoryPO>> partition = Lists.partition(adjustHistoryList, 100);
partition.forEach(mapper::batchSave);
sqlSession.commit();
} finally {
sqlSession.close();
}
}
/**
* 获取福利档案基数调整记录
*
*/
public List<InsuranceArchivesBaseHistoryDTO> getAdjustHistoryList(Long paymentOrganization, Long employeeId) {
if (paymentOrganization == null && employeeId == null) {
return null;
}
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
InsuranceBaseAdjustHistoryMapper mapper = sqlSession.getMapper(InsuranceBaseAdjustHistoryMapper.class);
List<InsuranceArchivesBaseHistoryDTO> list = mapper.listByEmployeeIdAndPayOrg(paymentOrganization, employeeId);
return list;
} finally {
sqlSession.close();
}
}
/**
* 获取福利档案基数调整记录
*
*/
public List<InsuranceArchivesBaseHistoryDTO> getBaseHistoryByEmployeeIdAndOperator(Long operator, Long employeeId) {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
InsuranceBaseAdjustHistoryMapper mapper = sqlSession.getMapper(InsuranceBaseAdjustHistoryMapper.class);
List<InsuranceArchivesBaseHistoryDTO> list = mapper.listByEmployeeIdAndOperator(operator, employeeId);
return list;
} finally {
sqlSession.close();
}
}
public List<WeaTableColumn> buildAdjustHistoryColumns(long operateId) {
List<WeaTableColumn> list = new ArrayList<>();
WeaTableColumn nameColumn = new WeaTableColumn("100px", "福利项名称", "welfareItemName");
nameColumn.setFixed("left");
list.add(nameColumn);
list.add(new WeaTableColumn("150px", "调整前方案", "adjustBeforeSchemeName"));
list.add(new WeaTableColumn("150px", "调整前基数", "adjustBeforeBaseValue"));
list.add(new WeaTableColumn("150px", "调整后方案", "adjustAfterSchemeName"));
list.add(new WeaTableColumn("150px", "调整后基数", "adjustAfterBaseValue"));
list.add(new WeaTableColumn("150px", "操作人", "operatorName"));
list.add(new WeaTableColumn("150px", "操作时间", "operatorTime"));
return list;
}
}

View File

@ -228,7 +228,10 @@ public class InsuranceComparisonResultBO {
map.put(welfare.getId() + baseTypeInfo + welfareStand, temp);
// 薪资项目字段的字段类型
map.put(welfare.getId() + baseTypeInfo + welfareStand + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !temp.get("acctResultValue").equals(temp.get("excelResultValue"))) {
// if (map.get("different").equals("false") && !temp.get("acctResultValue").equals(temp.get("excelResultValue"))) {
// map.put("different", "true");
// }
if (map.get("different").equals("false") && SalaryEntityUtil.empty2Zero(temp.get("acctResultValue").toString()).compareTo(SalaryEntityUtil.empty2Zero(temp.get("excelResultValue").toString())) != 0) {
map.put("different", "true");
}
}
@ -243,7 +246,11 @@ public class InsuranceComparisonResultBO {
socialPerSumTemp.put("excelResultValue", dealNull(excelAccountExportPO.getSocialPerSum()));
map.put("socialPerSum", socialPerSumTemp);
map.put("socialPerSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !socialPerSumTemp.get("acctResultValue").equals(socialPerSumTemp.get("excelResultValue"))) {
// if (map.get("different").equals("false") && !socialPerSumTemp.get("acctResultValue").equals(socialPerSumTemp.get("excelResultValue"))) {
// map.put("different", "true");
// }
if (map.get("different").equals("false") && SalaryEntityUtil.empty2Zero(socialPerSumTemp.get("acctResultValue").toString())
.compareTo(SalaryEntityUtil.empty2Zero(socialPerSumTemp.get("excelResultValue").toString())) != 0) {
map.put("different", "true");
}
@ -252,7 +259,11 @@ public class InsuranceComparisonResultBO {
fundPerSumTemp.put("excelResultValue", dealNull(excelAccountExportPO.getFundPerSum()));
map.put("fundPerSum", fundPerSumTemp);
map.put("fundPerSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !fundPerSumTemp.get("acctResultValue").equals(fundPerSumTemp.get("excelResultValue"))) {
// if (map.get("different").equals("false") && !fundPerSumTemp.get("acctResultValue").equals(fundPerSumTemp.get("excelResultValue"))) {
// map.put("different", "true");
// }
if (map.get("different").equals("false") && SalaryEntityUtil.empty2Zero(fundPerSumTemp.get("acctResultValue").toString())
.compareTo(SalaryEntityUtil.empty2Zero(fundPerSumTemp.get("excelResultValue").toString())) != 0) {
map.put("different", "true");
}
@ -261,7 +272,11 @@ public class InsuranceComparisonResultBO {
otherPerSumTemp.put("excelResultValue", dealNull(excelAccountExportPO.getOtherPerSum()));
map.put("otherPerSum", otherPerSumTemp);
map.put("otherPerSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !otherPerSumTemp.get("acctResultValue").equals(otherPerSumTemp.get("excelResultValue"))) {
// if (map.get("different").equals("false") && !otherPerSumTemp.get("acctResultValue").equals(otherPerSumTemp.get("excelResultValue"))) {
// map.put("different", "true");
// }
if (map.get("different").equals("false") && SalaryEntityUtil.empty2Zero(otherPerSumTemp.get("acctResultValue").toString())
.compareTo(SalaryEntityUtil.empty2Zero(otherPerSumTemp.get("excelResultValue").toString())) != 0) {
map.put("different", "true");
}
@ -270,7 +285,11 @@ public class InsuranceComparisonResultBO {
perSumTemp.put("excelResultValue", dealNull(excelAccountExportPO.getPerSum()));
map.put("perSum", perSumTemp);
map.put("perSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !perSumTemp.get("acctResultValue").equals(perSumTemp.get("excelResultValue"))) {
// if (map.get("different").equals("false") && !perSumTemp.get("acctResultValue").equals(perSumTemp.get("excelResultValue"))) {
// map.put("different", "true");
// }
if (map.get("different").equals("false") && SalaryEntityUtil.empty2Zero(perSumTemp.get("acctResultValue").toString())
.compareTo(SalaryEntityUtil.empty2Zero(perSumTemp.get("excelResultValue").toString())) != 0) {
map.put("different", "true");
}
@ -280,7 +299,11 @@ public class InsuranceComparisonResultBO {
socialComSumTemp.put("excelResultValue", dealNull(excelAccountExportPO.getSocialComSum()));
map.put("socialComSum", socialComSumTemp);
map.put("socialComSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !socialComSumTemp.get("acctResultValue").equals(socialComSumTemp.get("excelResultValue"))) {
// if (map.get("different").equals("false") && !socialComSumTemp.get("acctResultValue").equals(socialComSumTemp.get("excelResultValue"))) {
// map.put("different", "true");
// }
if (map.get("different").equals("false") && SalaryEntityUtil.empty2Zero(socialComSumTemp.get("acctResultValue").toString())
.compareTo(SalaryEntityUtil.empty2Zero(socialComSumTemp.get("excelResultValue").toString())) != 0) {
map.put("different", "true");
}
@ -289,7 +312,11 @@ public class InsuranceComparisonResultBO {
fundComSumTemp.put("excelResultValue", dealNull(excelAccountExportPO.getFundComSum()));
map.put("fundComSum", fundComSumTemp);
map.put("fundComSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !fundComSumTemp.get("acctResultValue").equals(fundComSumTemp.get("excelResultValue"))) {
// if (map.get("different").equals("false") && !fundComSumTemp.get("acctResultValue").equals(fundComSumTemp.get("excelResultValue"))) {
// map.put("different", "true");
// }
if (map.get("different").equals("false") && SalaryEntityUtil.empty2Zero(fundComSumTemp.get("acctResultValue").toString())
.compareTo(SalaryEntityUtil.empty2Zero(fundComSumTemp.get("excelResultValue").toString())) != 0) {
map.put("different", "true");
}
@ -298,7 +325,11 @@ public class InsuranceComparisonResultBO {
otherComSumTemp.put("excelResultValue", dealNull(excelAccountExportPO.getOtherComSum()));
map.put("otherComSum", otherComSumTemp);
map.put("otherComSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !otherComSumTemp.get("acctResultValue").equals(otherComSumTemp.get("excelResultValue"))) {
// if (map.get("different").equals("false") && !otherComSumTemp.get("acctResultValue").equals(otherComSumTemp.get("excelResultValue"))) {
// map.put("different", "true");
// }
if (map.get("different").equals("false") && SalaryEntityUtil.empty2Zero(otherComSumTemp.get("acctResultValue").toString())
.compareTo(SalaryEntityUtil.empty2Zero(otherComSumTemp.get("excelResultValue").toString())) != 0) {
map.put("different", "true");
}
@ -307,7 +338,11 @@ public class InsuranceComparisonResultBO {
perComTemp.put("excelResultValue", dealNull(excelAccountExportPO.getComSum()));
map.put("comSum", perComTemp);
map.put("comSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !perComTemp.get("acctResultValue").equals(perComTemp.get("excelResultValue"))) {
// if (map.get("different").equals("false") && !perComTemp.get("acctResultValue").equals(perComTemp.get("excelResultValue"))) {
// map.put("different", "true");
// }
if (map.get("different").equals("false") && SalaryEntityUtil.empty2Zero(perComTemp.get("acctResultValue").toString())
.compareTo(SalaryEntityUtil.empty2Zero(perComTemp.get("excelResultValue").toString())) != 0) {
map.put("different", "true");
}
@ -317,7 +352,11 @@ public class InsuranceComparisonResultBO {
socialSumTemp.put("excelResultValue", dealNull(excelAccountExportPO.getSocialSum()));
map.put("socialSum", socialSumTemp);
map.put("socialSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !socialSumTemp.get("acctResultValue").equals(socialSumTemp.get("excelResultValue"))) {
// if (map.get("different").equals("false") && !socialSumTemp.get("acctResultValue").equals(socialSumTemp.get("excelResultValue"))) {
// map.put("different", "true");
// }
if (map.get("different").equals("false") && SalaryEntityUtil.empty2Zero(socialSumTemp.get("acctResultValue").toString())
.compareTo(SalaryEntityUtil.empty2Zero(socialSumTemp.get("excelResultValue").toString())) != 0) {
map.put("different", "true");
}
@ -326,7 +365,11 @@ public class InsuranceComparisonResultBO {
fundSumTemp.put("excelResultValue", dealNull(excelAccountExportPO.getFundSum()));
map.put("fundSum", fundSumTemp);
map.put("fundSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !fundSumTemp.get("acctResultValue").equals(fundSumTemp.get("excelResultValue"))) {
// if (map.get("different").equals("false") && !fundSumTemp.get("acctResultValue").equals(fundSumTemp.get("excelResultValue"))) {
// map.put("different", "true");
// }
if (map.get("different").equals("false") && SalaryEntityUtil.empty2Zero(fundSumTemp.get("acctResultValue").toString())
.compareTo(SalaryEntityUtil.empty2Zero(fundSumTemp.get("excelResultValue").toString())) != 0) {
map.put("different", "true");
}
@ -335,7 +378,11 @@ public class InsuranceComparisonResultBO {
otherSumTemp.put("excelResultValue", dealNull(excelAccountExportPO.getOtherSum()));
map.put("otherSum", otherSumTemp);
map.put("otherSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !otherSumTemp.get("acctResultValue").equals(otherSumTemp.get("excelResultValue"))) {
// if (map.get("different").equals("false") && !otherSumTemp.get("acctResultValue").equals(otherSumTemp.get("excelResultValue"))) {
// map.put("different", "true");
// }
if (map.get("different").equals("false") && SalaryEntityUtil.empty2Zero(otherSumTemp.get("acctResultValue").toString())
.compareTo(SalaryEntityUtil.empty2Zero(otherSumTemp.get("excelResultValue").toString())) != 0) {
map.put("different", "true");
}
@ -344,7 +391,11 @@ public class InsuranceComparisonResultBO {
totalTemp.put("excelResultValue", dealNull(excelAccountExportPO.getTotal()));
map.put("total", totalTemp);
map.put("total" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !totalTemp.get("acctResultValue").equals(totalTemp.get("excelResultValue"))) {
// if (map.get("different").equals("false") && !totalTemp.get("acctResultValue").equals(totalTemp.get("excelResultValue"))) {
// map.put("different", "true");
// }
if (map.get("different").equals("false") && SalaryEntityUtil.empty2Zero(totalTemp.get("acctResultValue").toString())
.compareTo(SalaryEntityUtil.empty2Zero(totalTemp.get("excelResultValue").toString())) != 0) {
map.put("different", "true");
}

View File

@ -0,0 +1,91 @@
package com.engine.salary.entity.siarchives.dto;
import com.engine.salary.annotation.TableTitle;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @Author: sy
* @Description:
* @Date: 2023/10/16
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class InsuranceArchivesBaseHistoryDTO {
private Long id;
/**
* 人员id
*/
private Long employeeId;
/**
*个税扣缴义务人id
*/
private Long paymentOrganization;
/**
* 福利类型
*/
private Integer welfareType;
/**
* 调整前方案id
*/
private Long adjustBeforeSchemeId;
/**
* 调整后方案id
*/
private Long adjustAfterSchemeId;
/**
* 调整的福利项id
*/
private Long adjustWelfareItemId;
/**
* 操作人
*/
private Long operator;
private String tenantKey;
private Long creator;
private Integer deleteType;
private Date createTime;
private Date updateTime;
private String adjustBeforeBaseJson;
private String adjustAfterBaseJson;
@TableTitle(title = "对象", dataIndex = "employeeName", key = "employeeName")
private String employeeName;
@TableTitle(title = "个税扣缴义务人", dataIndex = "paymentOrganizationName", key = "paymentOrganizationName")
private String paymentOrganizationName;
@TableTitle(title = "福利项名称", dataIndex = "welfareItemName", key = "welfareItemName")
private String welfareItemName;
@TableTitle(title = "调整前方案", dataIndex = "adjustBeforeSchemeName", key = "adjustBeforeSchemeName")
private String adjustBeforeSchemeName;
@TableTitle(title = "调整前基数", dataIndex = "adjustBeforeBaseValue", key = "adjustBeforeBaseValue")
private String adjustBeforeBaseValue;
@TableTitle(title = "调整后方案", dataIndex = "adjustAfterSchemeName", key = "adjustAfterSchemeName")
private String adjustAfterSchemeName;
@TableTitle(title = "调整后基数", dataIndex = "adjustAfterBaseValue", key = "adjustAfterBaseValue")
private String adjustAfterBaseValue;
@TableTitle(title = "操作人", dataIndex = "operatorName", key = "operatorName")
private String operatorName;
@TableTitle(title = "操作时间", dataIndex = "operateTime", key = "operateTime")
private Date operateTime;
}

View File

@ -0,0 +1,28 @@
package com.engine.salary.entity.siarchives.param;
import com.engine.salary.enums.sicategory.WelfareTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author: sy
* @Description: 基数调整历史列表查询参数
* @Date: 2023/10/17
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SIArchiveBaseHistoryListParam {
private WelfareTypeEnum welfareTypeEnum;
private Long employeeId;
private Long operator;
private Long paymentOrganization;
private int current;
private int pageSize;
}

View File

@ -0,0 +1,80 @@
package com.engine.salary.entity.siarchives.po;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @Author: sy
* @Description: 福利档案基数调整记录
* @Date: 2023/10/16
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
//hrsa_insurance_base_history
public class InsuranceArchivesBaseHistoryPO {
private Long id;
/**
* 人员id
*/
private Long employeeId;
/**
* 个税扣缴义务人id
*/
private Long paymentOrganization;
/**
* 福利类别
*/
private Integer welfareType;
/**
* 调整前方案id
*/
private Long adjustBeforeSchemeId;
/**
* 调整后方案id
*/
private Long adjustAfterSchemeId;
/**
* 调整前基数值
*/
private String adjustBeforeBaseValue;
/**
* 调整后基数值
*/
private String adjustAfterBaseValue;
/**
* 调整的福利项id
*/
private Long adjustWelfareItemId;
/**
* 操作人
*/
private Long operator;
/**
* 操作时间
*/
private Date operateTime;
private String tenantKey;
private Long creator;
private Integer deleteType;
private Date createTime;
private Date updateTime;
}

View File

@ -0,0 +1,29 @@
package com.engine.salary.mapper.siarchives;
import com.engine.salary.entity.siarchives.dto.InsuranceArchivesBaseHistoryDTO;
import com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseHistoryPO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @Author sy
* @Date 2023/10/16
**/
public interface InsuranceBaseAdjustHistoryMapper {
/**
* 批量保存
*/
void batchSave(@Param("infos") List<InsuranceArchivesBaseHistoryPO> infos);
/**
* 根据人员id和个税扣缴义务人id获取基数调整记录
*/
List<InsuranceArchivesBaseHistoryDTO> listByEmployeeIdAndPayOrg(@Param("paymentOrganization")Long paymentOrganization, @Param("employeeId")Long employeeId);
/**
* 根据操作人或操作对象获取基数调整记录
*/
List<InsuranceArchivesBaseHistoryDTO> listByEmployeeIdAndOperator(@Param("operator")Long operator, @Param("employeeId")Long employeeId);
}

View File

@ -0,0 +1,199 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.engine.salary.mapper.siarchives.InsuranceBaseAdjustHistoryMapper">
<resultMap id="BaseResultMap" type="com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseHistoryPO">
<result column="id" property="id"/>
<result column="employee_id" property="employeeId"/>
<result column="payment_organization" property="paymentOrganization"/>
<result column="welfare_type" property="welfareType"/>
<result column="adjust_before_scheme_id" property="adjustBeforeSchemeId"/>
<result column="adjust_after_scheme_id" property="adjustAfterSchemeId"/>
<result column="adjust_before_base_value" property="adjustBeforeBaseValue"/>
<result column="adjust_after_base_value" property="adjustAfterBaseValue"/>
<result column="adjust_welfare_item_id" property="adjustWelfareItemId"/>
<result column="operator" property="operator"/>
<result column="operate_time" property="operateTime"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
<result column="tenant_key" property="tenantKey"/>
</resultMap>
<!-- 表字段 -->
<sql id="baseColumns">
t.id
, t.employee_id
, t.payment_organization
, t.welfare_type
, t.adjust_before_scheme_id
, t.adjust_after_scheme_id
, t.adjust_before_base_value
, t.adjust_after_base_value
, t.adjust_welfare_item_id
, t.operator
, t.operate_time
, t.create_time
, t.update_time
, t.creator
, t.delete_type
, t.tenant_key
</sql>
<insert id="batchSave">
INSERT INTO hrsa_insurance_base_history
(id,employee_id,payment_organization,welfare_type,
adjust_before_scheme_id,adjust_after_scheme_id,
adjust_before_base_value,adjust_after_base_value,
adjust_welfare_item_id,operator,operate_time,
tenant_key,creator,delete_type,create_time,update_time)
VALUES
<foreach collection="infos" item="item" separator=",">
(
#{item.id},
#{item.employeeId},
#{item.paymentOrganization},
#{item.welfareType},
#{item.adjustBeforeSchemeId},
#{item.adjustAfterSchemeId},
#{item.adjustBeforeBaseValue},
#{item.adjustAfterBaseValue},
#{item.adjustWelfareItemId},
#{item.operator},
#{item.operateTime},
#{item.tenantKey},
#{item.creator},
#{item.deleteType},
#{item.createTime},
#{item.updateTime}
)
</foreach>
</insert>
<insert id="batchSave" databaseId="oracle">
INSERT INTO hrsa_insurance_base_history
(id,employee_id,payment_organization,welfare_type,
adjust_before_scheme_id,adjust_after_scheme_id,
adjust_before_base_value,adjust_after_base_value,
adjust_welfare_item_id,operator,operate_time,
tenant_key,creator,delete_type,create_time,update_time)
<foreach collection="infos" item="item" separator="union all">
select
#{item.id,jdbcType=DOUBLE},
#{item.employeeId,jdbcType=DOUBLE},
#{item.paymentOrganization,jdbcType=DOUBLE},
#{item.welfareType,jdbcType=DOUBLE},
#{item.adjustBeforeSchemeId,jdbcType=DOUBLE},
#{item.adjustAfterSchemeId,jdbcType=DOUBLE},
#{item.adjustBeforeBaseValue,jdbcType=VARCHAR},
#{item.adjustAfterBaseValue,jdbcType=VARCHAR},
#{item.adjustWelfareItemId,jdbcType=DOUBLE},
#{item.operator,jdbcType=DOUBLE},
#{item.operateTime},
#{item.tenantKey,jdbcType=VARCHAR},
#{item.creator,jdbcType=DOUBLE},
#{item.deleteType},
#{item.createTime},
#{item.updateTime}
from dual
</foreach>
</insert>
<insert id="batchSave" databaseId="sqlserver">
<foreach collection="infos" item="item" separator=";">
INSERT INTO hrsa_insurance_base_history
(id,employee_id,payment_organization,welfare_type,
adjust_before_scheme_id,adjust_after_scheme_id,
adjust_before_base_value,adjust_after_base_value,
adjust_welfare_item_id,operator,operate_time,
tenant_key,creator,delete_type,create_time,update_time)
VALUES
(
#{item.id},
#{item.employeeId},
#{item.paymentOrganization},
#{item.welfareType},
#{item.adjustBeforeSchemeId},
#{item.adjustAfterSchemeId},
#{item.adjustBeforeBaseValue},
#{item.adjustAfterBaseValue},
#{item.adjustWelfareItemId},
#{item.operator},
#{item.operateTime},
#{item.tenantKey},
#{item.creator},
#{item.deleteType},
#{item.createTime},
#{item.updateTime}
)
</foreach>
</insert>
<select id="listByEmployeeIdAndPayOrg" resultType="com.engine.salary.entity.siarchives.dto.InsuranceArchivesBaseHistoryDTO">
SELECT
t.id
, t.employee_id
, t.payment_organization
, t.welfare_type
, t.adjust_before_scheme_id
, t.adjust_after_scheme_id
, t.adjust_before_base_value
, t.adjust_after_base_value
, t.adjust_welfare_item_id
, t.operator
, t.operate_time
, ca.insurance_name as welfareItemName
, sb.scheme_name as adjustBeforeSchemeName
, sa.scheme_name as adjustAfterSchemeName
, eo.lastname as operatorName
, ee.lastname as employeeName
, p.name as paymentOrganizationName
FROM hrsa_insurance_base_history t
LEFT JOIN hrmresource eo on eo.id = t.operator
LEFT JOIN hrmresource ee on ee.id = t.employee_id
LEFT JOIN hrsa_social_security_scheme sb on sb.id = t.adjust_before_scheme_id
LEFT JOIN hrsa_social_security_scheme sa on sa.id = t.adjust_after_scheme_id
LEFT JOIN hrsa_insurance_category ca on ca.id = t.adjust_welfare_item_id
LEFT JOIN hrsa_tax_agent p on p.id = t.payment_organization
WHERE t.delete_type = 0
AND t.employee_id = #{employeeId}
AND t.payment_organization = #{paymentOrganization}
ORDER BY t.operate_time DESC, t.adjust_welfare_item_id ASC
</select>
<select id="listByEmployeeIdAndOperator" resultType="com.engine.salary.entity.siarchives.dto.InsuranceArchivesBaseHistoryDTO">
SELECT
t.id
, t.employee_id
, t.payment_organization
, t.welfare_type
, t.adjust_before_scheme_id
, t.adjust_after_scheme_id
, t.adjust_before_base_value
, t.adjust_after_base_value
, t.adjust_welfare_item_id
, t.operator
, t.operate_time
, ca.insurance_name as welfareItemName
, sb.scheme_name as adjustBeforeSchemeName
, sa.scheme_name as adjustAfterSchemeName
, eo.lastname as operatorName
, ee.lastname as employeeName
, p.name as paymentOrganizationName
FROM hrsa_insurance_base_history t
LEFT JOIN hrmresource eo on eo.id = t.operator
LEFT JOIN hrmresource ee on ee.id = t.employee_id
LEFT JOIN hrsa_social_security_scheme sb on sb.id = t.adjust_before_scheme_id
LEFT JOIN hrsa_social_security_scheme sa on sa.id = t.adjust_after_scheme_id
LEFT JOIN hrsa_insurance_category ca on ca.id = t.adjust_welfare_item_id
LEFT JOIN hrsa_tax_agent p on p.id = t.payment_organization
WHERE t.delete_type = 0
<if test="employeeId != null ">
AND t.employee_id = #{employeeId}
</if>
<if test="operator != null ">
AND t.operator = #{operator}
</if>
ORDER BY t.operate_time DESC, t.adjust_welfare_item_id ASC
</select>
</mapper>

View File

@ -1,9 +1,12 @@
package com.engine.salary.service;
import com.engine.salary.entity.siarchives.dto.InsuranceArchivesBaseHistoryDTO;
import com.engine.salary.entity.siarchives.param.InsuranceArchivesListParam;
import com.engine.salary.entity.siarchives.param.InsuranceArchivesSaveParam;
import com.engine.salary.entity.siarchives.param.SIArchiveBaseHistoryListParam;
import com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO;
import com.engine.salary.entity.siarchives.po.InsuranceArchivesEmployeePO;
import com.engine.salary.util.page.PageInfo;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import java.util.Collection;
@ -103,4 +106,8 @@ public interface SIArchivesService {
void deleteArchive(Collection<Long> longs);
void handleStayDelData(long currentEmployeeId);
PageInfo<InsuranceArchivesBaseHistoryDTO> getAdjustHistoryList(SIArchiveBaseHistoryListParam param);
PageInfo<InsuranceArchivesBaseHistoryDTO> historyListByEmployeeIdAndOperator(SIArchiveBaseHistoryListParam param);
}

View File

@ -7,8 +7,10 @@ import com.engine.core.impl.Service;
import com.engine.salary.biz.SIArchivesBiz;
import com.engine.salary.cmd.siarchives.SIArchivesTipsCmd;
import com.engine.salary.entity.siarchives.bo.InsuranceArchivesBaseInfoBO;
import com.engine.salary.entity.siarchives.dto.InsuranceArchivesBaseHistoryDTO;
import com.engine.salary.entity.siarchives.param.InsuranceArchivesListParam;
import com.engine.salary.entity.siarchives.param.InsuranceArchivesSaveParam;
import com.engine.salary.entity.siarchives.param.SIArchiveBaseHistoryListParam;
import com.engine.salary.entity.siarchives.po.*;
import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO;
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO;
@ -37,6 +39,8 @@ import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.db.MapperProxyFactory;
import com.engine.salary.util.excel.ExcelUtil;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.util.page.SalaryPageUtil;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
@ -1133,5 +1137,32 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
}
}
@Override
public PageInfo<InsuranceArchivesBaseHistoryDTO> getAdjustHistoryList(SIArchiveBaseHistoryListParam param) {
if (param.getWelfareTypeEnum() == null) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "参数错误"));
}
List<InsuranceArchivesBaseHistoryDTO> adjustHistoryDTOS = siArchivesBiz.getAdjustHistoryList(param.getPaymentOrganization(), param.getEmployeeId());
List<InsuranceArchivesBaseHistoryDTO> targetHistory = adjustHistoryDTOS.stream()
.filter(f -> f.getWelfareType().equals(param.getWelfareTypeEnum().getValue())).collect(Collectors.toList());
PageInfo<InsuranceArchivesBaseHistoryDTO> listPage = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(),
targetHistory , InsuranceArchivesBaseHistoryDTO.class);
return listPage;
}
@Override
public PageInfo<InsuranceArchivesBaseHistoryDTO> historyListByEmployeeIdAndOperator(SIArchiveBaseHistoryListParam param) {
List<InsuranceArchivesBaseHistoryDTO> adjustHistoryDTOS = siArchivesBiz.getBaseHistoryByEmployeeIdAndOperator(param.getOperator(), param.getEmployeeId());
PageInfo<InsuranceArchivesBaseHistoryDTO> listPage = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(),
adjustHistoryDTOS , InsuranceArchivesBaseHistoryDTO.class);
return listPage;
}
}

View File

@ -1379,53 +1379,63 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
//导入社保档案
List<InsuranceArchivesSocialSchemePO> socialSchemePOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getSocial).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(socialSchemePOS)) {
// socialSchemePOS = socialSchemePOS.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesSocialSchemePO::getEmployeeId))), ArrayList::new));
//根据人员id和个税扣缴义务人id删除对应档案
socialSchemePOS.forEach(getSocialSchemeMapper()::deleteByEmployeeIdAndPayOrg);
// List<Long> socialEmployeeIds = socialSchemePOS.stream().map(InsuranceArchivesSocialSchemePO::getEmployeeId).collect(Collectors.toList());
// List<List<Long>> socialEmployeeIdPartition = Lists.partition(socialEmployeeIds, 100);
// socialEmployeeIdPartition.forEach(getSocialSchemeMapper()::batchDeleteByEmployeeIds);
//去除员工id+个税扣缴义务人下重复的数据
socialSchemePOS = socialSchemePOS.stream()
.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getPaymentOrganization() + "-" + f.getEmployeeId()))), ArrayList::new));
//生成福利档案基数调整历史记录
List<InsuranceArchivesBaseHistoryPO> adjustSocialHistoryPOList = siArchivesBiz.dealSocialBaseAdjustInfoList(socialSchemePOS, (long) user.getUID());
//根据人员id和个税扣缴义务人id删除对应旧档案
socialSchemePOS.forEach(getSocialSchemeMapper()::deleteByEmployeeIdAndPayOrg);
//新建新档案
List<InsuranceArchivesSocialSchemePO> insuranceArchivesSocialSchemePOS = encryptUtil.encryptList(socialSchemePOS, InsuranceArchivesSocialSchemePO.class);
List<List<InsuranceArchivesSocialSchemePO>> partition = Lists.partition(insuranceArchivesSocialSchemePOS, 100);
partition.forEach(getSocialSchemeMapper()::batchSave);
//新建福利档案基数调整历史记录
siArchivesBiz.batchInsertAdjustHistory(adjustSocialHistoryPOList, user.getUID());
}
//导入公积金档案
List<InsuranceArchivesFundSchemePO> fundSchemePOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getFund).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(fundSchemePOS)) {
// fundSchemePOS = fundSchemePOS.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesFundSchemePO::getEmployeeId))), ArrayList::new));
//根据人员id和个税扣缴义务人id删除对应档案
fundSchemePOS.forEach(getFundSchemeMapper()::deleteByEmployeeIdAndPayOrg);
// List<Long> fundEmployeeIds = fundSchemePOS.stream().map(InsuranceArchivesFundSchemePO::getEmployeeId).collect(Collectors.toList());
// List<List<Long>> fundEmployeeIdsPartition = Lists.partition(fundEmployeeIds, 100);
// fundEmployeeIdsPartition.forEach(getFundSchemeMapper()::batchDeleteByEmployeeIds);
//去除员工id+个税扣缴义务人下重复的数据
fundSchemePOS = fundSchemePOS.stream()
.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getPaymentOrganization() + "-" + f.getEmployeeId()))), ArrayList::new));
//生成福利档案基数调整历史记录
List<InsuranceArchivesBaseHistoryPO> adjustFundHistoryPOList = siArchivesBiz.dealFundBaseAdjustInfoList(fundSchemePOS, (long) user.getUID());
//根据人员id和个税扣缴义务人id删除对应档案
fundSchemePOS.forEach(getFundSchemeMapper()::deleteByEmployeeIdAndPayOrg);
//新建新档案
List<InsuranceArchivesFundSchemePO> insuranceArchivesFundSchemePOS = encryptUtil.encryptList(fundSchemePOS, InsuranceArchivesFundSchemePO.class);
List<List<InsuranceArchivesFundSchemePO>> partition = Lists.partition(insuranceArchivesFundSchemePOS, 100);
partition.forEach(getFundSchemeMapper()::batchSave);
//新建福利档案基数调整历史记录
siArchivesBiz.batchInsertAdjustHistory(adjustFundHistoryPOList, user.getUID());
}
//导入其他福利档案
List<InsuranceArchivesOtherSchemePO> otherSchemePOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getOther).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(otherSchemePOS)) {
// otherSchemePOS = otherSchemePOS.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesOtherSchemePO::getEmployeeId))), ArrayList::new));
//根据人员id和个税扣缴义务人id删除对应档案
otherSchemePOS.forEach(getOtherSchemeMapper()::deleteByEmployeeIdAndPayOrg);
// List<Long> otherEmployeeIds = otherSchemePOS.stream().map(InsuranceArchivesOtherSchemePO::getEmployeeId).collect(Collectors.toList());
// List<List<Long>> otherEmployeeIdsPartition = Lists.partition(otherEmployeeIds, 100);
// otherEmployeeIdsPartition.forEach(getOtherSchemeMapper()::batchDeleteByEmployeeIds);
//去除员工id+个税扣缴义务人下重复的数据
otherSchemePOS = otherSchemePOS.stream()
.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getPaymentOrganization() + "-" + f.getEmployeeId()))), ArrayList::new));
//生成福利档案基数调整历史记录
List<InsuranceArchivesBaseHistoryPO> adjustOtherHistoryPOList = siArchivesBiz.dealOtherBaseAdjustInfoList(otherSchemePOS, (long) user.getUID());
//根据人员id和个税扣缴义务人id删除对应档案
otherSchemePOS.forEach(getOtherSchemeMapper()::deleteByEmployeeIdAndPayOrg);
//新建新档案
List<InsuranceArchivesOtherSchemePO> insuranceArchivesOtherSchemePOS = encryptUtil.encryptList(otherSchemePOS, InsuranceArchivesOtherSchemePO.class);
List<List<InsuranceArchivesOtherSchemePO>> partition = Lists.partition(insuranceArchivesOtherSchemePOS, 100);
partition.forEach(getOtherSchemeMapper()::batchSave);
//新建福利档案基数调整历史记录
siArchivesBiz.batchInsertAdjustHistory(adjustOtherHistoryPOList, user.getUID());
}
//导入福利档案基础信息
List<InsuranceArchivesBaseInfoPO> baseInfoPOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getBaseInfo).collect(Collectors.toList());

View File

@ -2,13 +2,16 @@ package com.engine.salary.web;
import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.salary.entity.siarchives.dto.InsuranceArchivesBaseHistoryDTO;
import com.engine.salary.entity.siarchives.param.InsuranceArchivesListParam;
import com.engine.salary.entity.siarchives.param.InsuranceArchivesSaveParam;
import com.engine.salary.entity.siarchives.param.SIArchiveBaseHistoryListParam;
import com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO;
import com.engine.salary.enums.sicategory.WelfareTypeEnum;
import com.engine.salary.service.SIArchivesService;
import com.engine.salary.service.impl.SIArchivesServiceImpl;
import com.engine.salary.util.ResponseResult;
import com.engine.salary.util.page.PageInfo;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;
@ -249,4 +252,15 @@ public class SIArchivesController {
param.setExtWelArchiveList(true);
return new ResponseResult<InsuranceArchivesListParam,Map<String,Object>>(user).run(getService(user)::listPage, param);
}
/**
* 查询档案基数调整记录列表
*/
@POST
@Path("/getAdjustHistoryList")
@Produces(MediaType.APPLICATION_JSON)
public String getAdjustHistoryList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SIArchiveBaseHistoryListParam param) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<SIArchiveBaseHistoryListParam, PageInfo<InsuranceArchivesBaseHistoryDTO>>(user).run(getService(user)::historyListByEmployeeIdAndOperator, param);
}
}