薪酬系统,梳理Mapper类使用方式

This commit is contained in:
sy 2023-03-07 14:21:01 +08:00
parent 9b8e89bf9f
commit b6ee197fe6
13 changed files with 132 additions and 55 deletions

View File

@ -117,6 +117,26 @@ public class SIAccountBiz extends Service {
return (SalaryAcctProgressService) ServiceUtil.getService(SalaryAcctProgressServiceImpl.class, user);
}
private SIAccountDetailTempMapper getSIAccountDetailTempMapper() {
return MapperProxyFactory.getProxy(SIAccountDetailTempMapper.class);
}
private InsuranceSchemeDetailMapper getInsuranceSchemeDetailMapper() {
return MapperProxyFactory.getProxy(InsuranceSchemeDetailMapper.class);
}
private EmployMapper getEmployMapper() {
return MapperProxyFactory.getProxy(EmployMapper.class);
}
private ICategoryMapper getICategoryMapper() {
return MapperProxyFactory.getProxy(ICategoryMapper.class);
}
private TaxAgentMapper getTaxAgentMapper() {
return MapperProxyFactory.getProxy(TaxAgentMapper.class);
}
public PageInfo<InsuranceAccountBatchPO> listPage(InsuranceAccountBatchParam queryParam) {
List<InsuranceAccountBatchPO> list = getInsuranceAccountBatchMapper().list(queryParam);
PageInfo<InsuranceAccountBatchPO> page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(),
@ -343,7 +363,7 @@ public class SIAccountBiz extends Service {
/*}*/
List<List<Long>> partition = Lists.partition((List<Long>) ids, 100);
partition.forEach(part -> {
MapperProxyFactory.getProxy(SIAccountDetailTempMapper.class).batchDelByEmpIdsAndMonthAndPayOrg(part, param.getBillMonth(), param.getPaymentOrganization());
getSIAccountDetailTempMapper().batchDelByEmpIdsAndMonthAndPayOrg(part, param.getBillMonth(), param.getPaymentOrganization());
});
getSalaryAcctProgressService(user).finish(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth(), true);
@ -414,14 +434,14 @@ public class SIAccountBiz extends Service {
//临时表入库前先对可能存在的历史数据进行删除
List<List<Long>> partition = Lists.partition((List<Long>) ids, 100);
partition.forEach(part -> {
MapperProxyFactory.getProxy(SIAccountDetailTempMapper.class).batchDelByEmpIdsAndMonthAndPayOrg(part, billMonth, paymentOrganization);
getSIAccountDetailTempMapper().batchDelByEmpIdsAndMonthAndPayOrg(part, billMonth, paymentOrganization);
});
//临时表数据入库
if (CollectionUtils.isNotEmpty(list)) {
encryptUtil.encryptList(list, InsuranceAccountDetailTempPO.class);
List<List<InsuranceAccountDetailTempPO>> lists = splitList(list, 40);
lists.forEach(subList -> {
MapperProxyFactory.getProxy(SIAccountDetailTempMapper.class).batchSaveAccountTempDetails(subList);
getSIAccountDetailTempMapper().batchSaveAccountTempDetails(subList);
});
}
@ -454,7 +474,7 @@ public class SIAccountBiz extends Service {
//TransactionStatus status = transactionManager.getTransaction(new DefaultTransactionDefinition());
String billMonth = param.getBillMonth();
try {
List<InsuranceAccountDetailTempPO> list = MapperProxyFactory.getProxy(SIAccountDetailTempMapper.class).getListByEmployeeIdsAndBillMonth(ids, billMonth, param.getPaymentOrganization());
List<InsuranceAccountDetailTempPO> list = getSIAccountDetailTempMapper().getListByEmployeeIdsAndBillMonth(ids, billMonth, param.getPaymentOrganization());
encryptUtil.decryptList(list, InsuranceAccountDetailTempPO.class);
Integer paymentStatus = 0;
log.info("核算明细临时表 hrsa_bill_detail_temp待处理数量{}", list.size());
@ -533,7 +553,7 @@ public class SIAccountBiz extends Service {
//判断是否在起始缴纳月和最后缴纳月之间
Boolean inDataRange = SalaryDateUtil.monthInRange(insuranceAccountDetailPO.getBillMonth(), otherPO.getOtherStartTime(), otherPO.getOtherEndTime());
if ((Objects.equals(NonPaymentEnum.YES.getValue(), otherPO.getNonPayment()) || otherPO.getNonPayment() == null) && otherPO.getOtherSchemeId() != null && inDataRange) {
List<InsuranceSchemeDetailPO> detailPOS = MapperProxyFactory.getProxy(InsuranceSchemeDetailMapper.class).queryListBySchemeId(otherPO.getOtherSchemeId());
List<InsuranceSchemeDetailPO> detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(otherPO.getOtherSchemeId());
encryptUtil.decryptList(detailPOS, InsuranceSchemeDetailPO.class);
//方案中包含的需要缴纳其他的个人福利
int monthIndex = Integer.parseInt(billMonth.split("-")[1]) - 1;
@ -675,7 +695,7 @@ public class SIAccountBiz extends Service {
//判断是否在起始缴纳月和最后缴纳月之间
Boolean inDataRange = SalaryDateUtil.monthInRange(insuranceAccountDetailPO.getBillMonth(), fundPO.getFundStartTime(), fundPO.getFundEndTime());
if ((NonPaymentEnum.YES.getValue() == fundPO.getNonPayment() || fundPO.getNonPayment() == null) && fundPO.getFundSchemeId() != null && inDataRange) {
List<InsuranceSchemeDetailPO> detailPOS = MapperProxyFactory.getProxy(InsuranceSchemeDetailMapper.class).queryListBySchemeId(fundPO.getFundSchemeId());
List<InsuranceSchemeDetailPO> detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(fundPO.getFundSchemeId());
encryptUtil.decryptList(detailPOS, InsuranceSchemeDetailPO.class);
//方案中包含的需要缴纳社保的个人福利
int monthIndex = Integer.parseInt(billMonth.split("-")[1]) - 1;
@ -816,7 +836,7 @@ public class SIAccountBiz extends Service {
//判断是否在起始缴纳月和最后缴纳月之间
Boolean inDataRange = SalaryDateUtil.monthInRange(insuranceAccountDetailPO.getBillMonth(), socialPO.getSocialStartTime(), socialPO.getSocialEndTime());
if ((NonPaymentEnum.YES.getValue().equals(socialPO.getNonPayment()) || socialPO.getNonPayment() == null) && socialPO.getSocialSchemeId() != null && inDataRange) {
List<InsuranceSchemeDetailPO> detailPOS = MapperProxyFactory.getProxy(InsuranceSchemeDetailMapper.class).queryListBySchemeId(socialPO.getSocialSchemeId());
List<InsuranceSchemeDetailPO> detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(socialPO.getSocialSchemeId());
encryptUtil.decryptList(detailPOS, InsuranceSchemeDetailPO.class);
//方案中包含的需要缴纳社保的个人福利
int monthIndex = Integer.parseInt(billMonth.split("-")[1]) - 1;
@ -1102,7 +1122,7 @@ public class SIAccountBiz extends Service {
InsuranceAccountBatchPO insuranceAccountBatchPO = getInsuranceAccountBatchMapper().getByBillMonth(billMonth, param.getPaymentOrganization());
encryptUtil.decrypt(insuranceAccountBatchPO, InsuranceAccountBatchPO.class);
DataCollectionEmployee simpleEmployee = MapperProxyFactory.getProxy(EmployMapper.class).getEmployeeById(employeeId);
DataCollectionEmployee simpleEmployee = getEmployMapper().getEmployeeById(employeeId);
insuranceAccountBatchPO.setAccountant(currentUserName);
insuranceAccountBatchPO.setUpdateTime(new Date());
insuranceAccountBatchPO.setSocialPay(socialSum.toPlainString());
@ -1311,7 +1331,7 @@ public class SIAccountBiz extends Service {
}
if (!projects.contains(ProjectTypeEnum.SOCIAL.getValue())) {
List<Long> ids = new ArrayList<>();
List<ICategoryPO> list = MapperProxyFactory.getProxy(ICategoryMapper.class).listByDataType(DataTypeEnum.SYSTEM.getValue());
List<ICategoryPO> list = getICategoryMapper().listByDataType(DataTypeEnum.SYSTEM.getValue());
if (projects.contains(ProjectTypeEnum.ENDOWMENT_INSURANCE.getValue())) {
ICategoryPO insuranceCategoryPO = list.stream().filter(item -> SalaryI18nUtil.getI18nLabel(93113, "养老保险").equals(item.getInsuranceName())).findFirst()
@ -1376,7 +1396,7 @@ public class SIAccountBiz extends Service {
//判断是否在起始缴纳月和最后缴纳月之间
Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, otherPO.getOtherStartTime(), otherPO.getOtherEndTime());
if ((Objects.equals(NonPaymentEnum.YES.getValue(), otherPO.getNonPayment()) || otherPO.getNonPayment() == null) && otherPO.getOtherSchemeId() != null && inDataRange) {
List<InsuranceSchemeDetailPO> detailPOS = MapperProxyFactory.getProxy(InsuranceSchemeDetailMapper.class).queryListBySchemeId(otherPO.getOtherSchemeId());
List<InsuranceSchemeDetailPO> detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(otherPO.getOtherSchemeId());
encryptUtil.decryptList(detailPOS, InsuranceSchemeDetailPO.class);
//方案中包含的需要缴纳其他的个人福利
int monthIndex = Integer.parseInt(billMonth.split("-")[1]) - 1;
@ -1517,7 +1537,7 @@ public class SIAccountBiz extends Service {
//判断是否在起始缴纳月和最后缴纳月之间
Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, fundPO.getFundStartTime(), fundPO.getFundEndTime());
if ((Objects.equals(NonPaymentEnum.YES.getValue(), fundPO.getNonPayment()) || fundPO.getNonPayment() == null) && fundPO.getFundSchemeId() != null && inDataRange) {
List<InsuranceSchemeDetailPO> detailPOS = MapperProxyFactory.getProxy(InsuranceSchemeDetailMapper.class).queryListBySchemeId(fundPO.getFundSchemeId());
List<InsuranceSchemeDetailPO> detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(fundPO.getFundSchemeId());
encryptUtil.decryptList(detailPOS, InsuranceSchemeDetailPO.class);
//方案中包含的需要缴纳社保的个人福利
int monthIndex = Integer.parseInt(billMonth.split("-")[1]) - 1;
@ -1657,7 +1677,7 @@ public class SIAccountBiz extends Service {
//判断是否在起始缴纳月和最后缴纳月之间
Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, socialPO.getSocialStartTime(), socialPO.getSocialEndTime());
if ((Objects.equals(NonPaymentEnum.YES.getValue(), socialPO.getNonPayment()) || socialPO.getNonPayment() == null) && socialPO.getSocialSchemeId() != null && inDataRange) {
List<InsuranceSchemeDetailPO> detailPOS = MapperProxyFactory.getProxy(InsuranceSchemeDetailMapper.class).queryListBySchemeId(socialPO.getSocialSchemeId());
List<InsuranceSchemeDetailPO> detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(socialPO.getSocialSchemeId());
encryptUtil.decryptList(detailPOS, InsuranceSchemeDetailPO.class);
//方案中包含的需要缴纳社保的个人福利
int monthIndex = Integer.parseInt(billMonth.split("-")[1]) - 1;
@ -1804,7 +1824,7 @@ public class SIAccountBiz extends Service {
Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, socialPO.getSocialStartTime(), socialPO.getSocialEndTime());
if ((Objects.equals(NonPaymentEnum.YES.getValue(), socialPO.getNonPayment()) || socialPO.getNonPayment() == null) && socialPO.getSocialSchemeId() != null && inDataRange) {
List<InsuranceSchemeDetailPO> detailPOS = MapperProxyFactory.getProxy(InsuranceSchemeDetailMapper.class).queryListBySchemeId(socialPO.getSocialSchemeId());
List<InsuranceSchemeDetailPO> detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(socialPO.getSocialSchemeId());
encryptUtil.decryptList(detailPOS, InsuranceSchemeDetailPO.class);
//方案中包含的需要缴纳社保的个人福利
int monthIndex = Integer.parseInt(billMonth.split("-")[1]) - 1;
@ -2043,7 +2063,7 @@ public class SIAccountBiz extends Service {
public void file(String billMonth, Long employeeId, Long paymentOrganization) {
// 归档前检查是否有核算异常
// List<InsuranceAccountInspectPO> insuranceAccountInspectPOS = MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class).getByInspectStatusAndBillMonth(InspectStatusEnum.IGNORE.getValue(),billMonth);
// List<InsuranceAccountInspectPO> insuranceAccountInspectPOS = getInsuranceAccountInspectMapper().getByInspectStatusAndBillMonth(InspectStatusEnum.IGNORE.getValue(),billMonth);
// SalaryAssert.isEmpty(insuranceAccountInspectPOS, SalaryI18nUtil.getI18nLabel( 100500, "当前核算月存在核算异常数据"));
//开始归档数据
@ -2100,7 +2120,7 @@ public class SIAccountBiz extends Service {
public List<InsuranceAccountInspectPO> allInspects(Collection<Long> ids, String billMonth) {
List<InsuranceAccountInspectPO> list = MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class).getList(billMonth, InspectStatusEnum.IGNORE.getValue(), ids);
List<InsuranceAccountInspectPO> list = getInsuranceAccountInspectMapper().getList(billMonth, InspectStatusEnum.IGNORE.getValue(), ids);
if (CollectionUtils.isNotEmpty(list)) {
return list;
@ -2116,12 +2136,12 @@ public class SIAccountBiz extends Service {
encryptUtil.decryptList(insuranceAccountDetailPOS, InsuranceAccountDetailPO.class);
//获取扣缴义务人信息
List<TaxAgentPO> paymentList = MapperProxyFactory.getProxy(TaxAgentMapper.class).listAll();
List<TaxAgentPO> paymentList = getTaxAgentMapper().listAll();
SalaryAssert.notEmpty(paymentList, SalaryI18nUtil.getI18nLabel(100341, "该租户无扣缴义务人"));
Map<Long, TaxAgentPO> paymentMap = paymentList.stream().collect(Collectors.toMap(TaxAgentPO::getId, Function.identity()));
List<InsuranceAccountViewListDTO> insuranceAccountViewListDTOS = buildRecords(insuranceAccountDetailPOS, paymentMap);
// List<ICategoryPO> iCategoryPOS = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll();
// List<ICategoryPO> iCategoryPOS = getICategoryMapper().listAll();
// Page<InsuranceCategoryPO> page = FormatManager.getTablePage();
// Page<InsuranceAccountViewListDTO> insuranceAccountViewListDTOPage = new Page<>(page.getCurrent(), insuranceAccountViewListDTOS.size(), insuranceAccountViewListDTOS.size(),
// page.isSearchCount());

View File

@ -30,10 +30,14 @@ import java.util.stream.Collectors;
* @Version V1.0
**/
public class ColumnBuildServiceImpl extends Service implements ColumnBuildService {
private ICategoryMapper getICategoryMapper() {
return MapperProxyFactory.getProxy(ICategoryMapper.class);
}
@Override
public List<WeaTableColumn> buildCommonColumnsWithStyle(List<InsuranceAccountDetailPO> pos, Long employeeId, String tenantKey, Integer paymentStatus) {
List<WeaTableColumn> list = new ArrayList<>();
Map<String, String> categoryIdNameMap = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll().stream().collect(Collectors.toMap(ICategoryPO -> String.valueOf(ICategoryPO.getId()), ICategoryPO::getInsuranceName));
Map<String, String> categoryIdNameMap = getICategoryMapper().listAll().stream().collect(Collectors.toMap(ICategoryPO -> String.valueOf(ICategoryPO.getId()), ICategoryPO::getInsuranceName));
Map<Integer, Map<String, String>> columns = buildPaymentTitle(pos, categoryIdNameMap, employeeId, tenantKey);
Map<Integer, Map<String, String>> personColumns = buildPersonalTitle(pos, categoryIdNameMap, employeeId, tenantKey);
Map<Integer, Map<String, String>> comColumns = buildComTitle(pos, categoryIdNameMap, employeeId, tenantKey);
@ -297,7 +301,7 @@ public class ColumnBuildServiceImpl extends Service implements ColumnBuildServic
SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
List<Long> employeeIds = pos.stream().map(InsuranceAccountInspectPO::getEmployeeId).collect(Collectors.toList());
Map<Long, InsuranceArchivesAccountPO> insuranceArchivesAccountPOMap = siArchivesBiz.buildBatchAccount(employeeIds, paymentOrganization);
Map<String, String> categoryIdNameMap = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll().stream().collect(Collectors.toMap(ICategoryPO -> String.valueOf(ICategoryPO.getId()), ICategoryPO::getInsuranceName));
Map<String, String> categoryIdNameMap = getICategoryMapper().listAll().stream().collect(Collectors.toMap(ICategoryPO -> String.valueOf(ICategoryPO.getId()), ICategoryPO::getInsuranceName));
Map<Integer, Map<String, String>> columns = buildInspectTableTitle(new ArrayList<>(insuranceArchivesAccountPOMap.values()), categoryIdNameMap);
WeaTableColumn weaTableNameColumn = new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 85429, "姓名"), "userName");
weaTableNameColumn.setFixed("left");

View File

@ -15,6 +15,7 @@ import com.engine.salary.enums.UserStatusEnum;
import com.engine.salary.enums.siaccount.BillStatusEnum;
import com.engine.salary.enums.siaccount.ResourceFromEnum;
import com.engine.salary.mapper.datacollection.EmployMapper;
import com.engine.salary.mapper.siaccount.InsuranceAccountInspectMapper;
import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper;
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
import com.engine.salary.service.RecordsBuildService;
@ -38,6 +39,18 @@ import java.util.stream.Collectors;
**/
public class RecordsBuildServiceImpl extends Service implements RecordsBuildService {
private EmployMapper getEmployMapper() {
return MapperProxyFactory.getProxy(EmployMapper.class);
}
private TaxAgentMapper getTaxAgentMapper() {
return MapperProxyFactory.getProxy(TaxAgentMapper.class);
}
private InsuranceSchemeMapper getInsuranceSchemeMapper() {
return MapperProxyFactory.getProxy(InsuranceSchemeMapper.class);
}
@Override
public List<Map<String, Object>> buildCommonRecords(List<InsuranceAccountDetailPO> list, Long employeeId) {
List<Map<String, Object>> result = new ArrayList<>();
@ -48,12 +61,12 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
List<DataCollectionEmployee> employeeByIds = new ArrayList<>();
List<List<Long>> partition = Lists.partition(employeeIds, 1000);
for (List<Long> longs : partition) {
employeeByIds.addAll(MapperProxyFactory.getProxy(EmployMapper.class).getEmployeeByIdsAll(longs));
employeeByIds.addAll(getEmployMapper().getEmployeeByIdsAll(longs));
}
if (CollectionUtils.isEmpty(employeeByIds)) {
return result;
}
List<TaxAgentPO> paymentList = MapperProxyFactory.getProxy(TaxAgentMapper.class).listAll();
List<TaxAgentPO> paymentList = getTaxAgentMapper().listAll();
SalaryAssert.notEmpty(paymentList, SalaryI18nUtil.getI18nLabel(100341, "暂无扣缴义务人"));
Map<Long, TaxAgentPO> paymentMap = paymentList.stream().collect(Collectors.toMap(TaxAgentPO::getId, Function.identity()));
@ -75,7 +88,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
record.put("socialPayOrg", paymentMap.get(item.getSocialPayOrg()) == null ? "" : paymentMap.get(item.getSocialPayOrg()).getName());
record.put("socialAccount", item.getSocialAccount());
record.put("socialSchemeName", MapperProxyFactory.getProxy(InsuranceSchemeMapper.class).querySchemeName(item.getSocialSchemeId()));
record.put("socialSchemeName", getInsuranceSchemeMapper().querySchemeName(item.getSocialSchemeId()));
if (StringUtils.isNotEmpty(item.getSocialPaymentBaseString())) {
Map<String, Object> socialJson = JSON.parseObject(item.getSocialPaymentBaseString(), new HashMap<String, Object>().getClass());
if(socialJson!=null){
@ -86,7 +99,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
}
record.put("fundPayOrg", item.getFundPayOrg() == null ? "" : (paymentMap.getOrDefault(item.getFundPayOrg(),TaxAgentPO.builder().build())).getName());
record.put("fundAccount", item.getFundAccount());
record.put("fundSchemeName", MapperProxyFactory.getProxy(InsuranceSchemeMapper.class).querySchemeName(item.getFundSchemeId()));
record.put("fundSchemeName", getInsuranceSchemeMapper().querySchemeName(item.getFundSchemeId()));
record.put("supplementFundAccount", item.getSupplementFundAccount());
if (StringUtils.isNotEmpty(item.getFundPaymentBaseString())) {
Map<String, Object> socialJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap<String, Object>().getClass());
@ -97,7 +110,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
}
}
record.put("otherPayOrg", item.getOtherPayOrg() == null ? "" : (paymentMap.getOrDefault(item.getOtherPayOrg(),TaxAgentPO.builder().build())).getName());
record.put("otherSchemeName", MapperProxyFactory.getProxy(InsuranceSchemeMapper.class).querySchemeName(item.getOtherSchemeId()));
record.put("otherSchemeName", getInsuranceSchemeMapper().querySchemeName(item.getOtherSchemeId()));
if (StringUtils.isNotEmpty(item.getOtherPaymentBaseString())) {
Map<String, Object> socialJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap<String, Object>().getClass());
if(socialJson!=null){
@ -195,7 +208,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
List<DataCollectionEmployee> employeeByIds = new ArrayList<>();
List<List<Long>> partition = Lists.partition(employeeIds, 1000);
for (List<Long> longs : partition) {
employeeByIds.addAll(MapperProxyFactory.getProxy(EmployMapper.class).getEmployeeByIdsAll(longs));
employeeByIds.addAll(getEmployMapper().getEmployeeByIdsAll(longs));
}
if (CollectionUtils.isEmpty(employeeByIds)) {
return result;
@ -217,7 +230,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
record.put("employeeStatus", simpleEmployee.getStatus());
InsuranceArchivesSocialSchemePO social = insuranceAccountInspectPO.getSocial();
if (social != null) {
record.put("socialSchemeName", MapperProxyFactory.getProxy(InsuranceSchemeMapper.class).querySchemeName(social.getSocialSchemeId()));
record.put("socialSchemeName", getInsuranceSchemeMapper().querySchemeName(social.getSocialSchemeId()));
if (StringUtils.isNotEmpty(social.getSocialPaymentBaseString())) {
Map<String, Object> socialJson = JSON.parseObject(social.getSocialPaymentBaseString(), new HashMap<String, Object>().getClass());
socialJson.forEach((k, v) -> {
@ -227,7 +240,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
}
InsuranceArchivesFundSchemePO fund = insuranceAccountInspectPO.getFund();
if (fund != null) {
record.put("fundSchemeName", MapperProxyFactory.getProxy(InsuranceSchemeMapper.class).querySchemeName(fund.getFundSchemeId()));
record.put("fundSchemeName", getInsuranceSchemeMapper().querySchemeName(fund.getFundSchemeId()));
if (StringUtils.isNotEmpty(fund.getFundPaymentBaseString())) {
Map<String, Object> socialJson = JSON.parseObject(fund.getFundPaymentBaseString(), new HashMap<String, Object>().getClass());
socialJson.forEach((k, v) -> {
@ -237,7 +250,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
}
InsuranceArchivesOtherSchemePO other = insuranceAccountInspectPO.getOther();
if (other != null) {
record.put("otherSchemeName", MapperProxyFactory.getProxy(InsuranceSchemeMapper.class).querySchemeName(other.getOtherSchemeId()));
record.put("otherSchemeName", getInsuranceSchemeMapper().querySchemeName(other.getOtherSchemeId()));
if (StringUtils.isNotEmpty(other.getOtherPaymentBaseString())) {
Map<String, Object> socialJson = JSON.parseObject(other.getOtherPaymentBaseString(), new HashMap<String, Object>().getClass());
socialJson.forEach((k, v) -> {

View File

@ -53,6 +53,10 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
}
private ICategoryMapper getICategoryMapper() {
return MapperProxyFactory.getProxy(ICategoryMapper.class);
}
/**
* 根据列表查询条件查询线下对比结果分页
*/
@ -181,7 +185,7 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar
Set<String> info = new HashSet<>();
List<ICategoryPO> listAll = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll();
List<ICategoryPO> listAll = getICategoryMapper().listAll();
List<ICategoryPO> socialWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 1).collect(Collectors.toList());
List<ICategoryPO> fundWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 2).collect(Collectors.toList());
List<ICategoryPO> otherWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 3).collect(Collectors.toList());

View File

@ -176,6 +176,14 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
private TaxAgentBiz taxAgentBiz = new TaxAgentBiz();
private ICategoryMapper getICategoryMapper() {
return MapperProxyFactory.getProxy(ICategoryMapper.class);
}
private InsuranceAccountInspectMapper getInsuranceAccountInspectMapper() {
return MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class);
}
@Override
public Map<String, Object> listPage(InsuranceAccountBatchParam queryParam) {
Long employeeId = (long) user.getUID();
@ -579,7 +587,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
@Override
public void unconfirmed(Collection<Long> ids) {
List<InsuranceAccountInspectPO> insuranceAccountInspectPOS = MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class).getByInspectStatusAndIds(InspectStatusEnum.COMFORED.getValue(), ids);
List<InsuranceAccountInspectPO> insuranceAccountInspectPOS = getInsuranceAccountInspectMapper().getByInspectStatusAndIds(InspectStatusEnum.COMFORED.getValue(), ids);
if (CollectionUtils.isNotEmpty(insuranceAccountInspectPOS)) {
getInsuranceAccountDetailMapper().batchUnConfirmedInspectDetails(insuranceAccountInspectPOS.stream().map(InsuranceAccountInspectPO::getId).collect(Collectors.toList()));
@ -590,7 +598,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
@Override
public Map<String, Boolean> buttonCheck(String billMonth) {
Map<String, Boolean> result = new HashMap<>();
List<InsuranceAccountInspectPO> list = MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class).getByInspectStatusAndBillMonth(InspectStatusEnum.IGNORE.getValue(), billMonth);
List<InsuranceAccountInspectPO> list = getInsuranceAccountInspectMapper().getByInspectStatusAndBillMonth(InspectStatusEnum.IGNORE.getValue(), billMonth);
if (CollectionUtils.isEmpty(list)) {
result.put("displayFlag", false);
return result;
@ -601,7 +609,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
@Override
public void ignore(Collection<Long> ids) {
List<InsuranceAccountInspectPO> insuranceAccountInspectPOS = MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class).getByInspectStatusAndIds(InspectStatusEnum.IGNORE.getValue(), ids);
List<InsuranceAccountInspectPO> insuranceAccountInspectPOS = getInsuranceAccountInspectMapper().getByInspectStatusAndIds(InspectStatusEnum.IGNORE.getValue(), ids);
if (CollectionUtils.isNotEmpty(insuranceAccountInspectPOS)) {
getInsuranceAccountDetailMapper().batchIgnoreInspectDetails(insuranceAccountInspectPOS.stream().map(InsuranceAccountInspectPO::getId).collect(Collectors.toList()));
@ -723,7 +731,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
public Map<String, Object> getInspectTable(InsuranceAccountDetailParam param) {
Map<String, Object> datas = new HashMap<>();
List<InsuranceAccountInspectPO> insuranceAccountInspectPOS = MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class).getByBillMonth(param.getBillMonth());
List<InsuranceAccountInspectPO> insuranceAccountInspectPOS = getInsuranceAccountInspectMapper().getByBillMonth(param.getBillMonth());
List<Map<String, Object>> records = getService(user).buildInspectRecords(insuranceAccountInspectPOS, Long.valueOf(param.getPaymentOrganization()));
List<Map<String, Object>> paged = SalaryPageUtil.subList(param.getCurrent(), param.getPageSize(), records);
PageInfo<Map<String, Object>> pageInfos = new PageInfo<>(paged);
@ -910,7 +918,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
@Override
public Map<String, String> welfareColumns() {
List<ICategoryPO> listAll = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll();
List<ICategoryPO> listAll = getICategoryMapper().listAll();
List<ICategoryPO> list = new ArrayList<>();
if (CollectionUtils.isNotEmpty(listAll)) {
list.addAll(listAll);
@ -1159,8 +1167,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
@Override
public List<InsuranceAccountInspectPO> allInspects(Collection<Long> ids, String billMonth) {
InsuranceAccountInspectMapper siAccountInspectMapper = MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class);
List<InsuranceAccountInspectPO> list = siAccountInspectMapper.getList(billMonth, InspectStatusEnum.IGNORE.getValue(), ids);
// InsuranceAccountInspectMapper siAccountInspectMapper = MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class);
List<InsuranceAccountInspectPO> list = getInsuranceAccountInspectMapper().getList(billMonth, InspectStatusEnum.IGNORE.getValue(), ids);
if (CollectionUtils.isNotEmpty(list)) {
return list;
}
@ -1819,7 +1827,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
@Override
public XSSFWorkbook exportComparisonWelfareTemplate(InsuranceAcctDetailImportTemplateParam param) {
List<ICategoryPO> listAll = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll();
List<ICategoryPO> listAll = getICategoryMapper().listAll();
List<ICategoryPO> socialWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 1).collect(Collectors.toList());
List<ICategoryPO> fundWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 2).collect(Collectors.toList());
List<ICategoryPO> otherWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 3).collect(Collectors.toList());
@ -2611,7 +2619,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
// 获取租户下所有的人员
List<DataCollectionEmployee> salaryEmployees = employBiz.listEmployee();
List<ICategoryPO> insuranceCategoryPOS = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll();
List<ICategoryPO> insuranceCategoryPOS = getICategoryMapper().listAll();
// 失败的数量
int failCount = 0;
// 成功的数量

View File

@ -530,11 +530,11 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
if (needAuth) {
List<TaxAgentEmployeeDTO> taxAgentEmployeeDTOS = getTaxAgentService(user).listTaxAgentAndEmployee(currentEmployeeId);
Set<Long> employeeIds = SalaryEntityUtil.properties(taxAgentEmployeeDTOS, TaxAgentEmployeeDTO::getEmployeeId);
List<InsuranceArchivesEmployeePO> list = MapperProxyFactory.getProxy(SocialSchemeMapper.class).queryEmployeeList(param);
List<InsuranceArchivesEmployeePO> list = getSocialSchemeMapper().queryEmployeeList(param);
return list.stream().filter(f -> employeeIds.contains(f.getEmployeeId())).collect(Collectors.toList());
}
return MapperProxyFactory.getProxy(SocialSchemeMapper.class).queryEmployeeList(param);
return getSocialSchemeMapper().queryEmployeeList(param);
}
/**

View File

@ -72,7 +72,7 @@ public class SICategoryServiceImpl extends Service implements SICategoryService
@Override
public Map<String, String> categoryIdNameMap() {
//系统福利类型
Map<Long, String> systemAndCustomMap = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll().stream()
Map<Long, String> systemAndCustomMap = getICategoryMapper().listAll().stream()
.collect(Collectors.toMap(ICategoryPO::getId, ICategoryPO::getInsuranceName));
HashMap<Long, String> total = new HashMap<>();
if (MapUtils.isNotEmpty(systemAndCustomMap)) {

View File

@ -80,6 +80,10 @@ public class SICompensationServiceImpl extends Service implements SICompensation
return ServiceUtil.getService(ColumnBuildServiceImpl.class, user);
}
private ICategoryMapper getICategoryMapper() {
return MapperProxyFactory.getProxy(ICategoryMapper.class);
}
/**
* 可调差人员
*/
@ -504,7 +508,7 @@ public class SICompensationServiceImpl extends Service implements SICompensation
List<DataCollectionEmployee> allEmployees = getEmployMapper().listAll();
Map<Long, String> usernameMap = SalaryEntityUtil.convert2Map(allEmployees, DataCollectionEmployee::getEmployeeId, DataCollectionEmployee::getUsername);
List<ICategoryPO> allCategoryList = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll();
List<ICategoryPO> allCategoryList = getICategoryMapper().listAll();
Map<Long, String> categoryNameMap = SalaryEntityUtil.convert2Map(allCategoryList, ICategoryPO::getId, ICategoryPO::getInsuranceName);
boolean haveCompensation = compensationPOList != null && compensationPOList.size() > 0;

View File

@ -90,6 +90,10 @@ public class SIExportServiceImpl extends Service implements SIExportService {
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
}
private ICategoryMapper getICategoryMapper() {
return MapperProxyFactory.getProxy(ICategoryMapper.class);
}
@Override
public XSSFWorkbook exportOverView(InsuranceExportParam queryParam) {
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = getInsuranceAccountDetailMapper().selectList(queryParam.getBillMonth(), StringUtils.isBlank(queryParam.getPaymentOrganization()) ? null : Long.valueOf(queryParam.getPaymentOrganization()));
@ -206,7 +210,7 @@ public class SIExportServiceImpl extends Service implements SIExportService {
private List<Map<String, Object>> buildCommonRecords(List<AccountExportPO> list) {
List<Map<String, Object>> result = new ArrayList<>();
List<TaxAgentPO> paymentList = MapperProxyFactory.getProxy(TaxAgentMapper.class).listAll();
List<TaxAgentPO> paymentList = getTaxAgentMapper().listAll();
SalaryAssert.notEmpty(paymentList, SalaryI18nUtil.getI18nLabel(100341, "该租户无扣缴义务人"));
Map<Long, String> schemeIdNameMap = getSISchemeService(user).getSchemeIdNameMap();
Map<Long, TaxAgentPO> paymentMap = paymentList.stream().collect(Collectors.toMap(TaxAgentPO::getId, Function.identity()));
@ -529,9 +533,9 @@ public class SIExportServiceImpl extends Service implements SIExportService {
private Map<String, String> categoryIdNameMap() {
//系统福利类型
Map<Long, String> systemMap = MapperProxyFactory.getProxy(ICategoryMapper.class).listByDataType(DataTypeEnum.SYSTEM.getValue()).stream()
Map<Long, String> systemMap = getICategoryMapper().listByDataType(DataTypeEnum.SYSTEM.getValue()).stream()
.collect(Collectors.toMap(ICategoryPO::getId, ICategoryPO::getInsuranceName));
Map<Long, String> customMap = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll()
Map<Long, String> customMap = getICategoryMapper().listAll()
.stream().collect(Collectors.toMap(ICategoryPO::getId, ICategoryPO::getInsuranceName));
HashMap<Long, String> total = new HashMap<>();
if (MapUtils.isNotEmpty(systemMap)) {

View File

@ -55,6 +55,18 @@ public class SIImportServiceImpl extends Service implements SIImportService {
return ServiceUtil.getService(SIArchivesServiceImpl.class,user);
}
private ICategoryMapper getICategoryMapper() {
return MapperProxyFactory.getProxy(ICategoryMapper.class);
}
private TaxAgentMapper getTaxAgentMapper() {
return MapperProxyFactory.getProxy(TaxAgentMapper.class);
}
private InsuranceSchemeMapper getInsuranceSchemeMapper() {
return MapperProxyFactory.getProxy(InsuranceSchemeMapper.class);
}
@Override
public XSSFWorkbook exportTemplate(InsuranceArchivesListParam param) {
//工作簿list
@ -213,11 +225,11 @@ public class SIImportServiceImpl extends Service implements SIImportService {
* @return
*/
public Map<String, Long> welfareNameIdMap(WelfareTypeEnum welfareTypeEnum) {
return MapperProxyFactory.getProxy(ICategoryMapper.class).listByWelfareType(welfareTypeEnum.getValue(),null).stream().collect(Collectors.toMap(ICategoryPO::getInsuranceName, ICategoryPO::getId));
return getICategoryMapper().listByWelfareType(welfareTypeEnum.getValue(),null).stream().collect(Collectors.toMap(ICategoryPO::getInsuranceName, ICategoryPO::getId));
}
public Map<Long, String> welfareMap() {
return MapperProxyFactory.getProxy(ICategoryMapper.class).listAll().stream().collect(Collectors.toMap(ICategoryPO::getId, ICategoryPO::getInsuranceName));
return getICategoryMapper().listAll().stream().collect(Collectors.toMap(ICategoryPO::getId, ICategoryPO::getInsuranceName));
}
/**
@ -226,7 +238,7 @@ public class SIImportServiceImpl extends Service implements SIImportService {
* @return
*/
public Map<Long, String> paymentOrganizationIdNameMap() {
List<TaxAgentPO> list = MapperProxyFactory.getProxy(TaxAgentMapper.class).listAll();
List<TaxAgentPO> list = getTaxAgentMapper().listAll();
if (CollectionUtils.isEmpty(list)) {
return new HashMap<>();
}
@ -241,7 +253,7 @@ public class SIImportServiceImpl extends Service implements SIImportService {
Map<Long, String> paymentMap = paymentOrganizationIdNameMap();
//获取id,方案名称的map用于下面组装福利数据
Map<Long, String> schemeMap = new HashMap<>();
List<InsuranceSchemePO> schemeList = MapperProxyFactory.getProxy(InsuranceSchemeMapper.class).listAll();
List<InsuranceSchemePO> schemeList = getInsuranceSchemeMapper().listAll();
if (CollectionUtils.isNotEmpty(schemeList)) {
schemeMap = schemeList.stream().collect(Collectors.toMap(InsuranceSchemePO::getId, InsuranceSchemePO::getSchemeName));
}

View File

@ -51,6 +51,10 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
return MapperProxyFactory.getProxy(OtherSchemeMapper.class);
}
private ICategoryMapper getICategoryMapper() {
return MapperProxyFactory.getProxy(ICategoryMapper.class);
}
/**
* 获取指定月份的福利缴纳基数作为补缴基数
* @param param
@ -84,7 +88,7 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
Map<String, String> targetBaseMap = new HashMap<>();
List<ICategoryPO> allCategoryList = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll();
List<ICategoryPO> allCategoryList = getICategoryMapper().listAll();
Map<Long, String> categoryNameMap = SalaryEntityUtil.convert2Map(allCategoryList, ICategoryPO::getId, ICategoryPO::getInsuranceName);
Map<Long, Integer> welfareTypeMap = SalaryEntityUtil.convert2Map(allCategoryList, ICategoryPO::getId, ICategoryPO::getWelfareType);
@ -107,7 +111,7 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
}
if (!projects.contains(ProjectTypeEnum.SOCIAL.getValue())) {
List<ICategoryPO> list = MapperProxyFactory.getProxy(ICategoryMapper.class).listByDataType(DataTypeEnum.SYSTEM.getValue());
List<ICategoryPO> list = getICategoryMapper().listByDataType(DataTypeEnum.SYSTEM.getValue());
if (projects.contains(ProjectTypeEnum.ENDOWMENT_INSURANCE.getValue())) {
ICategoryPO insuranceCategoryPO = list.stream().filter(item -> SalaryI18nUtil.getI18nLabel(93113, "养老保险").equals(item.getInsuranceName())).findFirst()
@ -202,7 +206,7 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
otherSchemePO = otherSchemePOList.get(0);
}
List<ICategoryPO> allCategoryList = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll();
List<ICategoryPO> allCategoryList = getICategoryMapper().listAll();
Map<Long, String> categoryNameMap = SalaryEntityUtil.convert2Map(allCategoryList, ICategoryPO::getId, ICategoryPO::getInsuranceName);
Map<Long, Integer> welfareTypeMap = SalaryEntityUtil.convert2Map(allCategoryList, ICategoryPO::getId, ICategoryPO::getWelfareType);

View File

@ -434,12 +434,12 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
}
public Collection<InsuranceSchemeDetailPO> queryInsuranceSchemeDetailList(Long id) {
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = MapperProxyFactory.getProxy(InsuranceSchemeDetailMapper.class).queryInsuranceSchemeDetailList(id, IsPaymentEnum.YES.getValue());
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().queryInsuranceSchemeDetailList(id, IsPaymentEnum.YES.getValue());
return encryptUtil.decryptList(insuranceSchemeDetailPOS, InsuranceSchemeDetailPO.class);
}
public String queryInsuranceName(Long id) {
ICategoryPO insuranceCategoryPO = MapperProxyFactory.getProxy(ICategoryMapper.class).getById(id);
ICategoryPO insuranceCategoryPO = getICategoryMapper().getById(id);
return insuranceCategoryPO == null ? "" : Objects.isNull(insuranceCategoryPO.getInsuranceName()) ? "" : insuranceCategoryPO.getInsuranceName();
}

View File

@ -58,6 +58,10 @@ public class SalaryFormulaWrapper extends Service {
private SalaryItemBiz salaryItemBiz = new SalaryItemBiz();
private ICategoryMapper getICategoryMapper() {
return MapperProxyFactory.getProxy(ICategoryMapper.class);
}
/**
* 公式字段列表
*
@ -132,7 +136,7 @@ public class SalaryFormulaWrapper extends Service {
List<InsuranceAcctDetailImportFieldDTO> welfareList = welfareList();
welfareList = welfareList.stream().filter(f -> !f.getSalaryItemName().contains("合计")).collect(Collectors.toList());
List<ICategoryPO> noUseICategoryList= MapperProxyFactory.getProxy(ICategoryMapper.class).listAll().stream().filter(f -> f.getIsUse() == 0).collect(Collectors.toList());
List<ICategoryPO> noUseICategoryList= getICategoryMapper().listAll().stream().filter(f -> f.getIsUse() == 0).collect(Collectors.toList());
if (noUseICategoryList.size() > 0) {
List<String> noUseNameList = noUseICategoryList.stream().map(ICategoryPO::getInsuranceName).collect(Collectors.toList());
welfareList = welfareList.stream().filter(f -> !noUseNameList.contains(f.getSalaryItemName().substring(0, f.getSalaryItemName().length() - 2))).collect(Collectors.toList());