2022-04-11 19:07:35 +08:00
|
|
|
package com.engine.salary.service.impl;
|
|
|
|
|
|
2022-04-27 14:36:05 +08:00
|
|
|
import com.alibaba.fastjson.JSON;
|
2022-04-12 19:29:19 +08:00
|
|
|
import com.api.browser.bean.SearchConditionGroup;
|
|
|
|
|
import com.api.browser.bean.SearchConditionItem;
|
2022-04-18 20:24:43 +08:00
|
|
|
import com.api.browser.bean.SearchConditionOption;
|
2022-04-16 16:43:33 +08:00
|
|
|
import com.cloudstore.eccom.pc.table.*;
|
2022-04-11 19:07:35 +08:00
|
|
|
import com.cloudstore.eccom.result.WeaResultMsg;
|
2022-04-12 10:24:21 +08:00
|
|
|
import com.engine.common.util.ServiceUtil;
|
2022-04-11 19:07:35 +08:00
|
|
|
import com.engine.core.impl.Service;
|
|
|
|
|
import com.engine.salary.biz.SIAccountBiz;
|
2022-04-16 16:43:33 +08:00
|
|
|
import com.engine.salary.biz.SIArchivesBiz;
|
2022-04-11 19:07:35 +08:00
|
|
|
import com.engine.salary.component.SalaryWeaTable;
|
2022-04-12 19:29:19 +08:00
|
|
|
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
2022-05-24 09:23:17 +08:00
|
|
|
import com.engine.salary.encrypt.siaccount.InsuranceAccountDetailPOEncrypt;
|
|
|
|
|
import com.engine.salary.encrypt.siaccount.SiAccountEncrypt;
|
2022-04-11 19:07:35 +08:00
|
|
|
import com.engine.salary.entity.siaccount.bo.InsuranceAccountBO;
|
|
|
|
|
import com.engine.salary.entity.siaccount.dto.InsuranceAccountBatchListDTO;
|
2022-04-15 19:01:09 +08:00
|
|
|
import com.engine.salary.entity.siaccount.dto.InsuranceAccountTabDTO;
|
2022-04-18 20:24:43 +08:00
|
|
|
import com.engine.salary.entity.siaccount.dto.InsuranceAccountViewListDTO;
|
2022-04-15 13:17:25 +08:00
|
|
|
import com.engine.salary.entity.siaccount.param.*;
|
2022-04-11 19:07:35 +08:00
|
|
|
import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO;
|
2022-04-12 10:24:21 +08:00
|
|
|
import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO;
|
2022-04-15 13:17:25 +08:00
|
|
|
import com.engine.salary.entity.siaccount.po.InsuranceAccountInspectPO;
|
2022-04-16 16:43:33 +08:00
|
|
|
import com.engine.salary.entity.siarchives.po.InsuranceArchivesEmployeePO;
|
2022-04-27 16:21:24 +08:00
|
|
|
import com.engine.salary.entity.sicategory.po.ICategoryPO;
|
2022-06-08 17:52:10 +08:00
|
|
|
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
2022-04-16 16:43:33 +08:00
|
|
|
import com.engine.salary.enums.UserStatusEnum;
|
2022-04-12 19:29:19 +08:00
|
|
|
import com.engine.salary.enums.siaccount.BillStatusEnum;
|
2022-04-15 13:17:25 +08:00
|
|
|
import com.engine.salary.enums.siaccount.InspectStatusEnum;
|
2022-04-12 19:29:19 +08:00
|
|
|
import com.engine.salary.enums.siaccount.PaymentStatusEnum;
|
2022-04-18 20:24:43 +08:00
|
|
|
import com.engine.salary.enums.siaccount.ProjectTypeEnum;
|
2022-04-27 16:21:24 +08:00
|
|
|
import com.engine.salary.enums.sicategory.WelfareTypeEnum;
|
2022-07-20 15:40:51 +08:00
|
|
|
import com.engine.salary.exception.SalaryRunTimeException;
|
2022-04-14 11:54:16 +08:00
|
|
|
import com.engine.salary.mapper.siaccount.InsuranceAccountBatchMapper;
|
2022-04-12 19:29:19 +08:00
|
|
|
import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper;
|
2022-04-15 13:17:25 +08:00
|
|
|
import com.engine.salary.mapper.siaccount.InsuranceAccountInspectMapper;
|
2022-04-27 16:21:24 +08:00
|
|
|
import com.engine.salary.mapper.sicategory.ICategoryMapper;
|
2022-06-08 17:52:10 +08:00
|
|
|
import com.engine.salary.service.*;
|
2022-04-12 19:29:19 +08:00
|
|
|
import com.engine.salary.util.SalaryDateUtil;
|
2022-04-14 11:54:16 +08:00
|
|
|
import com.engine.salary.util.SalaryFormItemUtil;
|
2022-04-15 19:01:09 +08:00
|
|
|
import com.engine.salary.util.SalaryI18nUtil;
|
2022-04-12 19:29:19 +08:00
|
|
|
import com.engine.salary.util.db.MapperProxyFactory;
|
2022-04-19 12:19:06 +08:00
|
|
|
import com.engine.salary.util.page.Column;
|
2022-04-11 19:07:35 +08:00
|
|
|
import com.engine.salary.util.page.PageInfo;
|
2022-05-25 13:10:03 +08:00
|
|
|
import com.engine.salary.util.page.SalaryPageUtil;
|
2022-04-14 11:54:16 +08:00
|
|
|
import com.engine.salary.util.valid.ValidUtil;
|
2022-04-27 14:36:05 +08:00
|
|
|
import com.google.common.collect.Lists;
|
2022-04-12 19:29:19 +08:00
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
2022-04-12 10:24:21 +08:00
|
|
|
import weaver.hrm.User;
|
2022-04-11 19:07:35 +08:00
|
|
|
|
2022-06-06 19:08:39 +08:00
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
2022-04-11 19:07:35 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Author weaver_cl
|
2022-07-13 11:45:16 +08:00
|
|
|
* @Description:
|
2022-04-11 19:07:35 +08:00
|
|
|
* @Date 2022/4/11
|
|
|
|
|
* @Version V1.0
|
|
|
|
|
**/
|
|
|
|
|
public class SIAccountServiceImpl extends Service implements SIAccountService {
|
|
|
|
|
|
2022-06-08 17:52:10 +08:00
|
|
|
// private SIAccountBiz siAccountBiz = new SIAccountBiz();
|
2022-04-11 19:07:35 +08:00
|
|
|
|
2022-04-16 16:43:33 +08:00
|
|
|
private SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
|
|
|
|
|
|
2022-04-12 10:24:21 +08:00
|
|
|
public RecordsBuildService getService(User user) {
|
2022-07-08 11:19:08 +08:00
|
|
|
return ServiceUtil.getService(RecordsBuildServiceImpl.class, user);
|
2022-04-12 10:24:21 +08:00
|
|
|
}
|
|
|
|
|
|
2022-06-08 17:52:10 +08:00
|
|
|
public SIAccountBiz getSiAccountBiz(User user) {
|
2022-07-08 11:19:08 +08:00
|
|
|
return ServiceUtil.getService(SIAccountBiz.class, user);
|
2022-06-08 17:52:10 +08:00
|
|
|
}
|
|
|
|
|
|
2022-04-12 19:29:19 +08:00
|
|
|
public ColumnBuildService getColumnBuildService(User user) {
|
2022-07-08 11:19:08 +08:00
|
|
|
return ServiceUtil.getService(ColumnBuildServiceImpl.class, user);
|
2022-04-12 19:29:19 +08:00
|
|
|
}
|
|
|
|
|
|
2022-04-27 16:21:24 +08:00
|
|
|
public SICategoryService getSICategoryService(User user) {
|
2022-07-08 11:19:08 +08:00
|
|
|
return ServiceUtil.getService(SICategoryServiceImpl.class, user);
|
2022-04-27 16:21:24 +08:00
|
|
|
}
|
|
|
|
|
|
2022-06-08 17:52:10 +08:00
|
|
|
private TaxAgentService getTaxAgentService(User user) {
|
|
|
|
|
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
|
|
|
|
|
}
|
2022-04-12 19:29:19 +08:00
|
|
|
|
2022-08-02 14:58:18 +08:00
|
|
|
private InsuranceAccountBatchMapper getInsuranceAccountBatchMapper() {
|
|
|
|
|
return MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private InsuranceAccountDetailMapper getInsuranceAccountDetailMapper() {
|
|
|
|
|
return MapperProxyFactory.getProxy(InsuranceAccountDetailMapper.class);
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-11 19:07:35 +08:00
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> listPage(InsuranceAccountBatchParam queryParam) {
|
2022-07-08 11:19:08 +08:00
|
|
|
Long employeeId = (long) user.getUID();
|
|
|
|
|
Map<String, Object> datas = new HashMap<>();
|
2022-04-11 19:07:35 +08:00
|
|
|
|
2022-06-09 18:31:36 +08:00
|
|
|
// 分权逻辑
|
2022-07-06 16:42:13 +08:00
|
|
|
Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID());
|
2022-07-08 11:19:08 +08:00
|
|
|
if (needAuth) {
|
2022-06-09 18:31:36 +08:00
|
|
|
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAllTaxAgents((long) user.getUID());
|
|
|
|
|
List<Long> taxAgents = taxAgentPOS.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
2022-07-08 11:19:08 +08:00
|
|
|
if (CollectionUtils.isEmpty(taxAgents)) {
|
|
|
|
|
//防止普通用户查询
|
|
|
|
|
queryParam.setTaxAgents(Collections.singletonList(-1L));
|
|
|
|
|
} else {
|
|
|
|
|
queryParam.setTaxAgents(taxAgents);
|
|
|
|
|
}
|
2022-06-09 18:31:36 +08:00
|
|
|
}
|
|
|
|
|
|
2022-04-11 19:07:35 +08:00
|
|
|
//福利台账列表
|
2022-07-05 19:19:17 +08:00
|
|
|
PageInfo<InsuranceAccountBatchPO> pageInfo = getSiAccountBiz(user).listPage(queryParam);
|
2022-04-11 19:07:35 +08:00
|
|
|
Collection<InsuranceAccountBatchPO> insuranceAccountBatchPOS = pageInfo.getList();
|
|
|
|
|
|
|
|
|
|
List<InsuranceAccountBatchListDTO> insuranceAccountBatchListDTOS = InsuranceAccountBO.buildAccountBatchDTOList(insuranceAccountBatchPOS);
|
2022-07-08 11:19:08 +08:00
|
|
|
PageInfo<InsuranceAccountBatchListDTO> pageInfos = new PageInfo<>(insuranceAccountBatchListDTOS, InsuranceAccountBatchListDTO.class);
|
2022-04-22 18:50:03 +08:00
|
|
|
pageInfos.setTotal(pageInfo.getTotal());
|
2022-04-11 19:07:35 +08:00
|
|
|
pageInfos.setPageNum(queryParam.getCurrent());
|
|
|
|
|
pageInfos.setPageSize(queryParam.getPageSize());
|
|
|
|
|
|
|
|
|
|
|
2022-07-08 11:19:08 +08:00
|
|
|
List<Map<Integer, List<Permission>>> operatesPermission = new ArrayList<>();
|
2022-04-12 19:29:19 +08:00
|
|
|
|
2022-04-11 19:07:35 +08:00
|
|
|
SalaryWeaTable<InsuranceAccountBatchListDTO> table = new SalaryWeaTable<>(user, InsuranceAccountBatchListDTO.class);
|
2022-04-19 12:19:06 +08:00
|
|
|
List<Column> columns = pageInfos.getColumns();
|
|
|
|
|
List<WeaTableColumn> weaTableColumn = columns.stream().map(v -> new WeaTableColumn("100", v.getTitle(), v.getKey())).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
table.setColumns(weaTableColumn);
|
2022-04-11 19:07:35 +08:00
|
|
|
|
|
|
|
|
//table.getColumns().get(0).setFixed("left");
|
2022-04-12 19:29:19 +08:00
|
|
|
// for (int i = 0; i < insuranceAccountBatchListDTOS.size(); i++) {
|
|
|
|
|
// InsuranceAccountBatchListDTO insuranceAccountBatchListDTO = insuranceAccountBatchListDTOS.get(i);
|
|
|
|
|
// if (Objects.equals(insuranceAccountBatchListDTO.getBillStatus(), BillStatusEnum.ARCHIVED.getDefaultLabel())) {
|
|
|
|
|
// table.getOperates().getOperate().get(i).getIndex();
|
|
|
|
|
//
|
|
|
|
|
// resultTable.getOperatesPermission().get(i).get(0).setVisible(false);
|
|
|
|
|
// resultTable.getOperatesPermission().get(i).get(1).setVisible(false);
|
|
|
|
|
// resultTable.getOperatesPermission().get(i).get(2).setVisible(false);
|
|
|
|
|
// resultTable.getOperatesPermission().get(i).get(3).setVisible(false);
|
|
|
|
|
// resultTable.getOperates().get(4).setOuter(true);
|
|
|
|
|
// }
|
|
|
|
|
// if (Objects.equals(insuranceAccountBatchListDTO.getBillStatus(), BillStatusEnum.NOT_ARCHIVED.getDefaultLabel())) {
|
|
|
|
|
// resultTable.getOperatesPermission().get(i).get(4).setVisible(false);
|
|
|
|
|
// List<InsuranceAccountInspectPO> insuranceAccountInspectPOS = siAccountInspectService.listByBillMonth(insuranceAccountBatchListDTO.getBillMonth(), tenantKey);
|
|
|
|
|
// if (CollectionUtils.isEmpty(insuranceAccountInspectPOS)) {
|
|
|
|
|
// resultTable.getOperatesPermission().get(i).get(2).setVisible(false);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
2022-04-11 19:07:35 +08:00
|
|
|
|
|
|
|
|
WeaResultMsg result = new WeaResultMsg(false);
|
|
|
|
|
result.putAll(table.makeDataResult());
|
|
|
|
|
result.success();
|
|
|
|
|
|
|
|
|
|
datas.put("pageInfo", pageInfos);
|
2022-07-08 11:19:08 +08:00
|
|
|
datas.put("operatesPermission", operatesPermission);
|
|
|
|
|
datas.put("dataKey", result.getResultMap());
|
2022-04-11 19:07:35 +08:00
|
|
|
return datas;
|
|
|
|
|
|
|
|
|
|
// WeaTable<InsuranceAccountBatchListDTO> resultTable = FormatManager.<InsuranceAccountBatchListDTO>getInstance()
|
|
|
|
|
// .genTable(InsuranceAccountBatchListDTO.class, insuranceAccountBatchListDTOPage);
|
|
|
|
|
//
|
|
|
|
|
// resultTable.getOperates().forEach(e -> {
|
|
|
|
|
// if (e.getIndex() == 0) {
|
|
|
|
|
// e.setOuter(true);
|
|
|
|
|
// }
|
|
|
|
|
// });
|
2022-04-12 19:29:19 +08:00
|
|
|
|
2022-04-11 19:07:35 +08:00
|
|
|
// resultTable.setModule("hrmsalary");
|
|
|
|
|
// resultTable.getColumns().get(0).setFixed("left");
|
|
|
|
|
// return WeaResult.success(resultTable);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2022-04-12 10:24:21 +08:00
|
|
|
public Map<String, Object> listCommonPage(InsuranceAccountDetailParam queryParam) {
|
2022-07-08 11:19:08 +08:00
|
|
|
Long employeeId = (long) user.getUID();
|
|
|
|
|
Map<String, Object> datas = new HashMap<>();
|
2022-04-11 19:07:35 +08:00
|
|
|
|
2022-04-12 10:24:21 +08:00
|
|
|
//正常缴纳列表
|
2022-06-08 17:52:10 +08:00
|
|
|
PageInfo<InsuranceAccountDetailPO> pageInfo = getSiAccountBiz(user).listCommonPage(queryParam);
|
2022-04-12 10:24:21 +08:00
|
|
|
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = pageInfo.getList();
|
|
|
|
|
|
|
|
|
|
//数据组装
|
|
|
|
|
List<Map<String, Object>> records = getService(user).buildCommonRecords(insuranceAccountDetailPOS, employeeId);
|
2022-04-15 19:01:09 +08:00
|
|
|
PageInfo<Map<String, Object>> pageInfos = new PageInfo<>(records);
|
2022-04-22 18:50:03 +08:00
|
|
|
pageInfos.setTotal(pageInfo.getTotal());
|
2022-04-12 19:29:19 +08:00
|
|
|
pageInfos.setPageNum(queryParam.getCurrent());
|
|
|
|
|
pageInfos.setPageSize(queryParam.getPageSize());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//动态列组装
|
|
|
|
|
List<WeaTableColumn> weaTableColumn = getColumnBuildService(user).buildCommonColumnsWithStyle(insuranceAccountDetailPOS, employeeId, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY, false);
|
|
|
|
|
|
2022-04-19 13:31:46 +08:00
|
|
|
WeaTable table = new WeaTable();
|
2022-04-19 17:46:24 +08:00
|
|
|
table.setPageUID(UUID.randomUUID().toString());
|
2022-04-12 19:29:19 +08:00
|
|
|
table.setColumns(weaTableColumn);
|
2022-04-19 12:19:06 +08:00
|
|
|
List<Column> columns = weaTableColumn.stream().map(v -> new Column(v.getText(), v.getColumn(), v.getColumn())).collect(Collectors.toList());
|
|
|
|
|
pageInfos.setColumns(columns);
|
2022-04-12 19:29:19 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
WeaResultMsg result = new WeaResultMsg(false);
|
|
|
|
|
result.putAll(table.makeDataResult());
|
|
|
|
|
result.success();
|
|
|
|
|
|
|
|
|
|
datas.put("pageInfo", pageInfos);
|
2022-04-19 17:46:24 +08:00
|
|
|
//datas.put("dataKey",result.getResultMap());
|
2022-04-12 19:29:19 +08:00
|
|
|
return datas;
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-16 16:43:33 +08:00
|
|
|
|
2022-04-12 19:29:19 +08:00
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> listCommonPageByName(InsuranceAccountDetailParam queryParam) {
|
|
|
|
|
//增加查询参数userName
|
|
|
|
|
if (StringUtils.isNotBlank(queryParam.getUserName())) {
|
2022-07-08 11:19:08 +08:00
|
|
|
queryParam.setUserName(queryParam.getUserName());
|
2022-04-12 19:29:19 +08:00
|
|
|
}
|
|
|
|
|
return listCommonPage(queryParam);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> listSupplementaryPage(InsuranceAccountDetailParam queryParam) {
|
2022-07-08 11:19:08 +08:00
|
|
|
Long employeeId = (long) user.getUID();
|
|
|
|
|
Map<String, Object> datas = new HashMap<>();
|
2022-04-12 19:29:19 +08:00
|
|
|
|
2022-04-15 19:01:09 +08:00
|
|
|
//补缴缴纳列表
|
2022-04-12 19:29:19 +08:00
|
|
|
queryParam.setPaymentStatus(PaymentStatusEnum.REPAIR.getValue());
|
2022-05-25 13:10:03 +08:00
|
|
|
SalaryPageUtil.start(queryParam.getCurrent(), queryParam.getPageSize());
|
2022-08-02 14:58:18 +08:00
|
|
|
List<InsuranceAccountDetailPO> list = getInsuranceAccountDetailMapper().list(queryParam);
|
2022-07-08 11:19:08 +08:00
|
|
|
PageInfo<InsuranceAccountDetailPO> pageInfo = new PageInfo<>(list, InsuranceAccountDetailPO.class);
|
2022-04-12 19:29:19 +08:00
|
|
|
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = pageInfo.getList();
|
2022-05-24 09:23:17 +08:00
|
|
|
InsuranceAccountDetailPOEncrypt.decryptInsuranceAccountDetailPOList(insuranceAccountDetailPOS);
|
2022-04-12 19:29:19 +08:00
|
|
|
//数据组装
|
|
|
|
|
List<Map<String, Object>> records = getService(user).buildCommonRecords(insuranceAccountDetailPOS, employeeId);
|
2022-04-19 12:19:06 +08:00
|
|
|
PageInfo<Map<String, Object>> pageInfos = new PageInfo<>(records);
|
2022-04-22 18:50:03 +08:00
|
|
|
pageInfos.setTotal(pageInfo.getTotal());
|
2022-04-12 19:29:19 +08:00
|
|
|
pageInfos.setPageNum(queryParam.getCurrent());
|
|
|
|
|
pageInfos.setPageSize(queryParam.getPageSize());
|
2022-04-12 10:24:21 +08:00
|
|
|
|
|
|
|
|
|
2022-04-12 19:29:19 +08:00
|
|
|
//动态列组装
|
2022-08-04 15:09:40 +08:00
|
|
|
List<WeaTableColumn> weaTableColumn = getColumnBuildService(user).buildCommonColumnsWithStyle(insuranceAccountDetailPOS, employeeId, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY, true);
|
2022-04-12 10:24:21 +08:00
|
|
|
|
2022-04-19 12:19:06 +08:00
|
|
|
SalaryWeaTable<InsuranceAccountDetailPO> table = new SalaryWeaTable<>(user, InsuranceAccountDetailPO.class);
|
2022-04-12 19:29:19 +08:00
|
|
|
table.setColumns(weaTableColumn);
|
2022-04-19 17:46:24 +08:00
|
|
|
List<Column> columns = weaTableColumn.stream().map(v -> new Column(v.getText(), v.getColumn(), v.getColumn())).collect(Collectors.toList());
|
|
|
|
|
pageInfos.setColumns(columns);
|
2022-04-12 19:29:19 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
WeaResultMsg result = new WeaResultMsg(false);
|
|
|
|
|
result.putAll(table.makeDataResult());
|
|
|
|
|
result.success();
|
|
|
|
|
|
|
|
|
|
datas.put("pageInfo", pageInfos);
|
2022-04-19 17:46:24 +08:00
|
|
|
//datas.put("dataKey",result.getResultMap());
|
2022-04-12 10:24:21 +08:00
|
|
|
return datas;
|
2022-04-11 19:07:35 +08:00
|
|
|
}
|
2022-04-12 10:24:21 +08:00
|
|
|
|
2022-04-16 16:43:33 +08:00
|
|
|
|
2022-04-12 19:29:19 +08:00
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> supplementaryByNameList(InsuranceAccountDetailParam queryParam) {
|
|
|
|
|
//增加查询参数userName
|
|
|
|
|
if (StringUtils.isNotBlank(queryParam.getUserName())) {
|
2022-04-19 17:46:24 +08:00
|
|
|
queryParam.setUserName(queryParam.getUserName());
|
2022-04-12 19:29:19 +08:00
|
|
|
}
|
|
|
|
|
return listSupplementaryPage(queryParam);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> getForm(Map<String, Object> params) {
|
2022-04-14 11:54:16 +08:00
|
|
|
Map<String, Object> apidatas = new HashMap<>();
|
2022-04-12 19:29:19 +08:00
|
|
|
|
|
|
|
|
//条件组
|
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
|
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
2022-04-20 19:12:01 +08:00
|
|
|
SearchConditionItem datePickerItem = SalaryFormItemUtil.datePickerItem(user, 2, 16, true, 2, "账单月份", "billMonth");
|
2022-04-14 11:54:16 +08:00
|
|
|
String minDate = SalaryDateUtil.getYearMonth(-1, 0);
|
|
|
|
|
String maxDate = SalaryDateUtil.getYearMonth(0, 6);
|
2022-04-20 19:12:01 +08:00
|
|
|
datePickerItem.setOtherParams(new HashMap<>());
|
2022-07-08 11:19:08 +08:00
|
|
|
datePickerItem.getOtherParams().put("minDate", minDate);
|
|
|
|
|
datePickerItem.getOtherParams().put("maxDate", maxDate);
|
2022-04-14 11:54:16 +08:00
|
|
|
|
2022-08-02 14:58:18 +08:00
|
|
|
List<InsuranceAccountBatchPO> billMonthList = getInsuranceAccountBatchMapper().listByTimeRange(minDate, maxDate);
|
2022-05-24 09:23:17 +08:00
|
|
|
SiAccountEncrypt.decryptInsuranceAccountBatchList(billMonthList);
|
2022-04-14 11:54:16 +08:00
|
|
|
if (CollectionUtils.isEmpty(billMonthList)) {
|
|
|
|
|
datePickerItem.getOtherParams().put("disabledData", Collections.emptyList());
|
|
|
|
|
} else {
|
|
|
|
|
datePickerItem.getOtherParams().put("disabledData", billMonthList.stream().map(InsuranceAccountBatchPO::getBillMonth).collect(Collectors.toList()));
|
|
|
|
|
}
|
|
|
|
|
datePickerItem.getOtherParams().put("type", "month");
|
|
|
|
|
datePickerItem.getOtherParams().put("format", "YYYY-MM");
|
|
|
|
|
datePickerItem.getOtherParams().put("showFormat", "YYYY-MM");
|
|
|
|
|
conditionItems.add(datePickerItem);
|
2022-04-12 19:29:19 +08:00
|
|
|
|
2022-04-20 19:12:01 +08:00
|
|
|
SearchConditionItem textareaItem = SalaryFormItemUtil.textareaItem(user, 2, 16, true, 2, 60, "备注", "remarks");
|
2022-04-14 11:54:16 +08:00
|
|
|
conditionItems.add(textareaItem);
|
2022-07-08 11:19:08 +08:00
|
|
|
addGroups.add(new SearchConditionGroup("常用条件", true, conditionItems));
|
2022-04-14 11:54:16 +08:00
|
|
|
|
|
|
|
|
apidatas.put("billMonth", SalaryDateUtil.getYearMonth(0, 0));
|
|
|
|
|
|
2022-07-08 11:19:08 +08:00
|
|
|
apidatas.put("condition", addGroups);
|
2022-04-14 11:54:16 +08:00
|
|
|
|
|
|
|
|
return apidatas;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2022-04-15 13:17:25 +08:00
|
|
|
public void save(AccountParam param) {
|
2022-07-05 19:19:17 +08:00
|
|
|
ValidUtil.doValidator(param);
|
|
|
|
|
|
2022-07-08 11:19:08 +08:00
|
|
|
Long employeeId = (long) user.getUID();
|
2022-04-15 13:17:25 +08:00
|
|
|
String lastName = user.getLastname();
|
2022-07-08 11:19:08 +08:00
|
|
|
getSiAccountBiz(user).save(param.isFlag(), param, employeeId, lastName);
|
2022-04-15 13:17:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void commonAccount(SaveCommonAccountParam param) {
|
|
|
|
|
ValidUtil.doValidator(param);
|
2022-07-05 19:19:17 +08:00
|
|
|
|
2022-07-08 11:19:08 +08:00
|
|
|
Long employeeId = (long) user.getUID();
|
2022-04-22 15:17:31 +08:00
|
|
|
String currentUserName = user.getLastname();
|
2022-07-08 11:19:08 +08:00
|
|
|
getSiAccountBiz(user).saveCommonAccount(param, employeeId, currentUserName);
|
2022-04-15 13:17:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void delete(AccountParam accountParam) {
|
2022-07-08 11:19:08 +08:00
|
|
|
Long employeeId = (long) user.getUID();
|
|
|
|
|
getSiAccountBiz(user).delete(accountParam, employeeId);
|
2022-04-15 13:17:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void saveCommonAccount(SaveCommonAccountParam accountParam) {
|
2022-07-08 11:19:08 +08:00
|
|
|
Long employeeId = (long) user.getUID();
|
2022-04-22 15:17:31 +08:00
|
|
|
String currentUserName = user.getLastname();
|
2022-07-08 11:19:08 +08:00
|
|
|
getSiAccountBiz(user).saveCommonAccount(accountParam, employeeId, currentUserName);
|
2022-04-15 13:17:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void saveSupplementaryAccount(SaveSupplementaryAccountParam saveSupplementaryAccountParam) {
|
2022-06-28 18:21:44 +08:00
|
|
|
ValidUtil.doValidator(saveSupplementaryAccountParam);
|
|
|
|
|
|
2022-07-08 11:19:08 +08:00
|
|
|
Long employeeId = (long) user.getUID();
|
2022-04-22 15:17:31 +08:00
|
|
|
String currentUserName = user.getLastname();
|
2022-07-08 11:19:08 +08:00
|
|
|
getSiAccountBiz(user).saveSupplementaryAccount(saveSupplementaryAccountParam, employeeId, currentUserName);
|
2022-04-15 13:17:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void deleteCommonAccount(SaveCommonAccountParam param) {
|
2022-06-06 19:08:39 +08:00
|
|
|
ValidUtil.doValidator(param);
|
2022-07-08 11:19:08 +08:00
|
|
|
Long employeeId = (long) user.getUID();
|
2022-04-22 15:17:31 +08:00
|
|
|
String currentUserName = user.getLastname();
|
2022-07-08 11:19:08 +08:00
|
|
|
getSiAccountBiz(user).deleteCommonAccount(param, employeeId, currentUserName);
|
2022-04-15 13:17:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void deleteSummplementaryAccount(List<SupplementAccountBaseParam> supplementAccountBaseParams) {
|
2022-07-08 11:19:08 +08:00
|
|
|
Long employeeId = (long) user.getUID();
|
2022-04-22 15:17:31 +08:00
|
|
|
String currentUserName = user.getLastname();
|
2022-07-08 11:19:08 +08:00
|
|
|
getSiAccountBiz(user).deleteSupplementaryAccount(supplementAccountBaseParams, employeeId, currentUserName);
|
2022-04-15 13:17:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void file(AccountParam accountParam) {
|
2022-07-08 11:19:08 +08:00
|
|
|
Long employeeId = (long) user.getUID();
|
2022-04-15 13:17:25 +08:00
|
|
|
String billMonth = accountParam.getBillMonth();
|
2022-07-08 11:19:08 +08:00
|
|
|
getSiAccountBiz(user).file(billMonth, employeeId, accountParam.getPaymentOrganization());
|
2022-04-15 13:17:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void unconfirmed(Collection<Long> ids) {
|
2022-07-08 11:19:08 +08:00
|
|
|
List<InsuranceAccountInspectPO> insuranceAccountInspectPOS = MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class).getByInspectStatusAndIds(InspectStatusEnum.COMFORED.getValue(), ids);
|
2022-04-15 13:17:25 +08:00
|
|
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(insuranceAccountInspectPOS)) {
|
2022-08-02 14:58:18 +08:00
|
|
|
getInsuranceAccountDetailMapper().batchUnConfirmedInspectDetails(insuranceAccountInspectPOS.stream().map(InsuranceAccountInspectPO::getId).collect(Collectors.toList()));
|
2022-04-15 13:17:25 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Boolean> buttonCheck(String billMonth) {
|
|
|
|
|
Map<String, Boolean> result = new HashMap<>();
|
2022-07-08 11:19:08 +08:00
|
|
|
List<InsuranceAccountInspectPO> list = MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class).getByInspectStatusAndBillMonth(InspectStatusEnum.IGNORE.getValue(), billMonth);
|
2022-04-15 13:17:25 +08:00
|
|
|
if (CollectionUtils.isEmpty(list)) {
|
|
|
|
|
result.put("displayFlag", false);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
result.put("displayFlag", true);
|
|
|
|
|
return result;
|
2022-04-12 19:29:19 +08:00
|
|
|
}
|
|
|
|
|
|
2022-04-15 19:01:09 +08:00
|
|
|
@Override
|
|
|
|
|
public void ignore(Collection<Long> ids) {
|
2022-07-08 11:19:08 +08:00
|
|
|
List<InsuranceAccountInspectPO> insuranceAccountInspectPOS = MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class).getByInspectStatusAndIds(InspectStatusEnum.IGNORE.getValue(), ids);
|
2022-04-15 19:01:09 +08:00
|
|
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(insuranceAccountInspectPOS)) {
|
2022-08-02 14:58:18 +08:00
|
|
|
getInsuranceAccountDetailMapper().batchIgnoreInspectDetails(insuranceAccountInspectPOS.stream().map(InsuranceAccountInspectPO::getId).collect(Collectors.toList()));
|
2022-04-15 19:01:09 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2022-06-06 19:08:39 +08:00
|
|
|
public InsuranceAccountTabDTO tabList(AccountParam build) {
|
2022-04-15 19:01:09 +08:00
|
|
|
InsuranceAccountTabDTO insuranceAccountTabDTO = InsuranceAccountTabDTO.builder().build();
|
2022-08-02 14:58:18 +08:00
|
|
|
InsuranceAccountBatchPO insuranceAccountBatchPO = getInsuranceAccountBatchMapper().getByBillMonth(build.getBillMonth(), build.getPaymentOrganization());
|
2022-05-24 09:23:17 +08:00
|
|
|
insuranceAccountBatchPO = SiAccountEncrypt.decryptInsuranceAccountBatch(insuranceAccountBatchPO);
|
2022-04-15 19:01:09 +08:00
|
|
|
boolean isShow = false;
|
|
|
|
|
if (insuranceAccountBatchPO == null || insuranceAccountBatchPO.getBillStatus() == BillStatusEnum.NOT_ARCHIVED.getValue()) {
|
|
|
|
|
isShow = true;
|
|
|
|
|
}
|
|
|
|
|
if (insuranceAccountBatchPO != null) {
|
|
|
|
|
insuranceAccountTabDTO.setRemarks(insuranceAccountBatchPO.getRemarks());
|
|
|
|
|
}
|
|
|
|
|
List<Map<String, Object>> tabList = new ArrayList<>();
|
|
|
|
|
Map<String, Object> common = new HashMap<>();
|
|
|
|
|
common.put("id", "1");
|
2022-07-08 11:19:08 +08:00
|
|
|
common.put("content", SalaryI18nUtil.getI18nLabel(92265, "正常缴纳"));
|
2022-04-15 19:01:09 +08:00
|
|
|
tabList.add(common);
|
|
|
|
|
if (isShow) {
|
|
|
|
|
Map<String, Object> change = new HashMap<>();
|
|
|
|
|
change.put("id", "2");
|
2022-07-08 11:19:08 +08:00
|
|
|
change.put("content", SalaryI18nUtil.getI18nLabel(100509, "异动清单"));
|
2022-04-15 19:01:09 +08:00
|
|
|
tabList.add(change);
|
|
|
|
|
}
|
|
|
|
|
Map<String, Object> repair = new HashMap<>();
|
|
|
|
|
repair.put("id", "3");
|
|
|
|
|
repair.put("content", SalaryI18nUtil.getI18nLabel(92267, "补缴"));
|
|
|
|
|
tabList.add(repair);
|
|
|
|
|
|
|
|
|
|
Map<String, Object> overView = new HashMap<>();
|
|
|
|
|
overView.put("id", "4");
|
2022-07-08 11:19:08 +08:00
|
|
|
overView.put("content", SalaryI18nUtil.getI18nLabel(99927, "总览"));
|
2022-04-15 19:01:09 +08:00
|
|
|
tabList.add(overView);
|
|
|
|
|
insuranceAccountTabDTO.setTabList(tabList);
|
|
|
|
|
insuranceAccountTabDTO.setShow(isShow);
|
2022-06-06 19:08:39 +08:00
|
|
|
insuranceAccountTabDTO.setBillMonth(build.getBillMonth());
|
2022-04-15 19:01:09 +08:00
|
|
|
return insuranceAccountTabDTO;
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-16 16:43:33 +08:00
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> changeList(InsuranceAccountDetailParam param) {
|
2022-07-08 11:19:08 +08:00
|
|
|
Map<String, Object> datas = new HashMap<>();
|
|
|
|
|
Long employeeId = (long) user.getUID();
|
|
|
|
|
SalaryPageUtil.start(param.getCurrent(), param.getPageSize());
|
2022-08-02 14:58:18 +08:00
|
|
|
List<InsuranceArchivesEmployeePO> insuranceArchivesEmployeePOS = getInsuranceAccountDetailMapper().changeList(param.getUserName());
|
2022-04-22 18:50:03 +08:00
|
|
|
PageInfo<InsuranceArchivesEmployeePO> pageInfo = new PageInfo<>(insuranceArchivesEmployeePOS);
|
|
|
|
|
|
2022-04-16 16:43:33 +08:00
|
|
|
List<Map<String, Object>> records = siArchivesBiz.buildTableData(insuranceArchivesEmployeePOS);
|
|
|
|
|
PageInfo<Map<String, Object>> pageInfos = new PageInfo<>(records);
|
2022-04-22 18:50:03 +08:00
|
|
|
pageInfos.setTotal(pageInfo.getTotal());
|
2022-04-16 16:43:33 +08:00
|
|
|
pageInfos.setPageNum(param.getCurrent());
|
|
|
|
|
pageInfos.setPageSize(param.getPageSize());
|
|
|
|
|
|
|
|
|
|
List<WeaTableColumn> weaTableColumns = siArchivesBiz.buildWeaTableColumns(insuranceArchivesEmployeePOS, employeeId);
|
|
|
|
|
|
|
|
|
|
WeaTable table = new WeaTable();
|
|
|
|
|
table.setPageUID(UUID.randomUUID().toString());
|
|
|
|
|
table.setColumns(weaTableColumns);
|
|
|
|
|
table.setTableType(WeaTableType.CHECKBOX);
|
|
|
|
|
WeaTableOperates weaTableOperates = new WeaTableOperates();
|
|
|
|
|
WeaTableOperate weaTableOperate = new WeaTableOperate();
|
|
|
|
|
weaTableOperate.setIndex("0");
|
|
|
|
|
weaTableOperate.setText("移除");
|
|
|
|
|
WeaTableOperate weaTableOperate1 = new WeaTableOperate();
|
|
|
|
|
weaTableOperate1.setIndex("1");
|
|
|
|
|
weaTableOperate1.setText("添加");
|
|
|
|
|
table.setOperates(weaTableOperates);
|
|
|
|
|
|
|
|
|
|
List<List<Permission>> permissions = new ArrayList<>();
|
|
|
|
|
for (int i = 0; i < records.size(); i++) {
|
|
|
|
|
List<Permission> permission = new ArrayList<>();
|
2022-07-27 16:56:13 +08:00
|
|
|
if (UserStatusEnum.DEPARTURE.getDefaultLabel().equals(records.get(i).get("status"))) {
|
2022-04-16 16:43:33 +08:00
|
|
|
permission.add(new Permission(true, false));
|
|
|
|
|
permission.add(new Permission(false, false));
|
|
|
|
|
permissions.add(permission);
|
|
|
|
|
}
|
2022-07-27 16:56:13 +08:00
|
|
|
if (UserStatusEnum.DEPARTURE.getDefaultLabel().equals(records.get(i).get("status"))) {
|
2022-04-16 16:43:33 +08:00
|
|
|
permission.add(new Permission(false, false));
|
|
|
|
|
permission.add(new Permission(true, false));
|
|
|
|
|
permissions.add(permission);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WeaResultMsg result = new WeaResultMsg(false);
|
|
|
|
|
result.putAll(table.makeDataResult());
|
|
|
|
|
result.success();
|
|
|
|
|
|
2022-07-08 11:19:08 +08:00
|
|
|
datas.put("permissions", permissions);
|
2022-04-16 16:43:33 +08:00
|
|
|
datas.put("pageInfo", pageInfos);
|
2022-07-08 11:19:08 +08:00
|
|
|
datas.put("dataKey", result.getResultMap());
|
2022-04-16 16:43:33 +08:00
|
|
|
return datas;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void accountInspect(InspectAccountParam param) {
|
2022-07-08 11:19:08 +08:00
|
|
|
Long employeeId = (long) user.getUID();
|
2022-04-16 16:43:33 +08:00
|
|
|
ValidUtil.doValidator(param);
|
2022-04-22 15:17:31 +08:00
|
|
|
String currentUserName = user.getLastname();
|
2022-07-08 11:19:08 +08:00
|
|
|
getSiAccountBiz(user).accountInspect(param.getIds(), param.getBillMonth(), employeeId, currentUserName);
|
2022-04-16 16:43:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> getInspectTable(InsuranceAccountDetailParam param) {
|
2022-07-08 11:19:08 +08:00
|
|
|
Map<String, Object> datas = new HashMap<>();
|
2022-04-16 16:43:33 +08:00
|
|
|
|
2022-07-08 11:19:08 +08:00
|
|
|
SalaryPageUtil.start(param.getCurrent(), param.getPageSize());
|
2022-04-16 16:43:33 +08:00
|
|
|
List<InsuranceAccountInspectPO> insuranceAccountInspectPOS = MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class).getByBillMonth(param.getBillMonth());
|
|
|
|
|
List<Map<String, Object>> records = getService(user).buildInspectRecords(insuranceAccountInspectPOS);
|
|
|
|
|
|
|
|
|
|
PageInfo<Map<String, Object>> pageInfos = new PageInfo<>(records);
|
|
|
|
|
pageInfos.setTotal(records.size());
|
|
|
|
|
pageInfos.setPageNum(param.getCurrent());
|
|
|
|
|
pageInfos.setPageSize(param.getPageSize());
|
|
|
|
|
|
|
|
|
|
List<WeaTableColumn> weaTableColumns = getColumnBuildService(user).buildInspectColumns(insuranceAccountInspectPOS);
|
|
|
|
|
WeaTable table = new WeaTable();
|
|
|
|
|
table.setPageUID(UUID.randomUUID().toString());
|
|
|
|
|
table.setColumns(weaTableColumns);
|
|
|
|
|
table.setTableType(WeaTableType.CHECKBOX);
|
|
|
|
|
WeaTableOperates weaTableOperates = new WeaTableOperates();
|
|
|
|
|
WeaTableOperate weaTableOperate = new WeaTableOperate();
|
|
|
|
|
weaTableOperate.setIndex("0");
|
|
|
|
|
weaTableOperate.setText("忽略");
|
|
|
|
|
WeaTableOperate weaTableOperate1 = new WeaTableOperate();
|
|
|
|
|
weaTableOperate1.setIndex("1");
|
|
|
|
|
weaTableOperate1.setText("重置");
|
|
|
|
|
table.setOperates(weaTableOperates);
|
|
|
|
|
|
|
|
|
|
List<List<Permission>> permissions = new ArrayList<>();
|
|
|
|
|
for (int i = 0; i < records.size(); i++) {
|
|
|
|
|
List<Permission> permission = new ArrayList<>();
|
|
|
|
|
Permission permissionCheckBox = new Permission();
|
|
|
|
|
if (InspectStatusEnum.IGNORE.getValue() == records.get(i).get("inspectStatus")) {
|
|
|
|
|
permissionCheckBox.setVisible(true);
|
|
|
|
|
permissionCheckBox.setDisabled(false);
|
|
|
|
|
permission.add(new Permission(true, false));
|
|
|
|
|
permission.add(new Permission(false, true));
|
|
|
|
|
permissions.add(permission);
|
|
|
|
|
}
|
|
|
|
|
if (InspectStatusEnum.COMFORED.getValue() == records.get(i).get("inspectStatus")) {
|
|
|
|
|
permissionCheckBox.setVisible(true);
|
|
|
|
|
permissionCheckBox.setDisabled(true);
|
|
|
|
|
permission.add(new Permission(false, true));
|
|
|
|
|
permission.add(new Permission(true, false));
|
|
|
|
|
permissions.add(permission);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WeaResultMsg result = new WeaResultMsg(false);
|
|
|
|
|
result.putAll(table.makeDataResult());
|
|
|
|
|
result.success();
|
|
|
|
|
|
2022-07-08 11:19:08 +08:00
|
|
|
datas.put("permissions", permissions);
|
2022-04-16 16:43:33 +08:00
|
|
|
datas.put("pageInfo", pageInfos);
|
2022-07-08 11:19:08 +08:00
|
|
|
datas.put("dataKey", result.getResultMap());
|
2022-04-16 16:43:33 +08:00
|
|
|
|
|
|
|
|
return datas;
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-18 20:24:43 +08:00
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> getCommonForm(Map<String, Object> params) {
|
|
|
|
|
Map<String, Object> apidatas = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
//条件组
|
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
|
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
|
|
|
|
List<SearchConditionItem> conditionItem = new ArrayList<>();
|
|
|
|
|
|
2022-04-22 16:42:06 +08:00
|
|
|
SearchConditionItem includes = SalaryFormItemUtil.browserItem(user, 18, 12, 2, true, "对象", "required", "17", "includes");
|
2022-04-18 20:24:43 +08:00
|
|
|
conditionItems.add(includes);
|
2022-04-22 16:42:06 +08:00
|
|
|
SearchConditionItem excludes = SalaryFormItemUtil.browserItem(user, 18, 12, 2, true, "选择人员", "required", "17", "excludes");
|
2022-04-18 20:24:43 +08:00
|
|
|
conditionItem.add(excludes);
|
2022-07-08 11:19:08 +08:00
|
|
|
addGroups.add(new SearchConditionGroup("人员范围", true, conditionItems));
|
|
|
|
|
addGroups.add(new SearchConditionGroup("人员范围排除", true, conditionItem));
|
2022-04-18 20:24:43 +08:00
|
|
|
|
2022-07-08 11:19:08 +08:00
|
|
|
apidatas.put("condition", addGroups);
|
2022-04-18 20:24:43 +08:00
|
|
|
return apidatas;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> getSupplementaryForm(Map<String, Object> params) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> apidatas = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
//条件组
|
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
|
List<SearchConditionItem> condition = new ArrayList<>();
|
|
|
|
|
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
|
|
|
|
List<SearchConditionItem> conditionItem = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
SearchConditionItem billMonthList = SalaryFormItemUtil.datePickerItem(user, 2, 16, true, 2, "账单月份", "billMonth");
|
|
|
|
|
billMonthList.setMultiple(true);
|
2022-04-20 19:12:01 +08:00
|
|
|
billMonthList.setOtherParams(new HashMap<>());
|
2022-04-18 20:24:43 +08:00
|
|
|
billMonthList.getOtherParams().put("type", "months");
|
|
|
|
|
billMonthList.getOtherParams().put("format", "YYYY-MM");
|
|
|
|
|
billMonthList.getOtherParams().put("showFormat", "YYYY-MM");
|
|
|
|
|
billMonthList.setMultiple(true);
|
|
|
|
|
condition.add(billMonthList);
|
|
|
|
|
|
2022-07-08 11:19:08 +08:00
|
|
|
SearchConditionItem billProjects = SalaryFormItemUtil.selectItem(user, buildBillProjectsOptions(), 2, 16, 6, true, "补缴项目", "projects");
|
2022-05-26 11:00:38 +08:00
|
|
|
billProjects.setDetailtype(2);
|
2022-04-18 20:24:43 +08:00
|
|
|
condition.add(billProjects);
|
|
|
|
|
|
2022-04-22 15:17:31 +08:00
|
|
|
SearchConditionItem includes = SalaryFormItemUtil.browserItem(user, 18, 6, 3, true, "对象", "required", "17", "includes");
|
2022-04-18 20:24:43 +08:00
|
|
|
conditionItems.add(includes);
|
2022-05-26 11:00:38 +08:00
|
|
|
// SearchConditionItem excludes = SalaryFormItemUtil.browserItem(user, 18, 6, 2, true, "选择人员", "required", "17", "excludes");
|
|
|
|
|
// excludes.setViewAttr(2);
|
|
|
|
|
// conditionItem.add(excludes);
|
2022-07-08 11:19:08 +08:00
|
|
|
addGroups.add(new SearchConditionGroup("基础信息", true, condition));
|
|
|
|
|
addGroups.add(new SearchConditionGroup("人员范围", true, conditionItems));
|
2022-05-26 11:00:38 +08:00
|
|
|
// addGroups.add(new SearchConditionGroup("人员范围排除",true,conditionItem));
|
2022-04-18 20:24:43 +08:00
|
|
|
|
2022-07-08 11:19:08 +08:00
|
|
|
apidatas.put("condition", addGroups);
|
2022-04-18 20:24:43 +08:00
|
|
|
return apidatas;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public PageInfo<InsuranceAccountViewListDTO> overView(InsuranceAccountDetailParam queryParam) {
|
2022-06-08 17:52:10 +08:00
|
|
|
PageInfo<InsuranceAccountViewListDTO> pageInfos = getSiAccountBiz(user).overView(queryParam);
|
2022-04-18 20:24:43 +08:00
|
|
|
return pageInfos;
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-27 14:36:05 +08:00
|
|
|
@Override
|
2022-07-08 11:19:08 +08:00
|
|
|
public List<Map<String, Object>> welfareData(String billMonth, List<Long> employeeIds, Long taxAgentId) {
|
2022-08-02 14:58:18 +08:00
|
|
|
InsuranceAccountBatchPO insuranceAccountBatchPO = getInsuranceAccountBatchMapper().getByBillMonth(billMonth, taxAgentId);
|
2022-05-24 09:23:17 +08:00
|
|
|
insuranceAccountBatchPO = SiAccountEncrypt.decryptInsuranceAccountBatch(insuranceAccountBatchPO);
|
2022-04-27 14:36:05 +08:00
|
|
|
if (insuranceAccountBatchPO == null || Objects.equals(BillStatusEnum.NOT_ARCHIVED.getValue(), insuranceAccountBatchPO.getBillStatus())) {
|
|
|
|
|
return Lists.newArrayList();
|
|
|
|
|
}
|
2022-08-02 14:58:18 +08:00
|
|
|
List<InsuranceAccountDetailPO> list = queryList(billMonth, taxAgentId, employeeIds);
|
2022-04-27 14:36:05 +08:00
|
|
|
List<Map<String, Object>> result = new ArrayList<>();
|
|
|
|
|
list.stream().forEach(item -> {
|
|
|
|
|
Map<String, Object> record = new HashMap<>();
|
|
|
|
|
record.put("employeeId", item.getEmployeeId());
|
|
|
|
|
if (StringUtils.isNotEmpty(item.getSocialPerJson())) {
|
|
|
|
|
Map<String, Object> socialJson = JSON.parseObject(item.getSocialPerJson(), new HashMap<String, Object>().getClass());
|
|
|
|
|
socialJson.forEach((k, v) -> {
|
|
|
|
|
record.put(k + "socialPer", v);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotEmpty(item.getSocialComJson())) {
|
|
|
|
|
Map<String, Object> socialJson = JSON.parseObject(item.getSocialComJson(), new HashMap<String, Object>().getClass());
|
|
|
|
|
socialJson.forEach((k, v) -> {
|
|
|
|
|
record.put(k + "socialCom", v);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
record.put("socialPerSum", item.getSocialPerSum());
|
|
|
|
|
record.put("socialComSum", item.getSocialComSum());
|
|
|
|
|
if (StringUtils.isNotEmpty(item.getFundPerJson())) {
|
|
|
|
|
Map<String, Object> fundPerJson = JSON.parseObject(item.getFundPerJson(), new HashMap<String, Object>().getClass());
|
|
|
|
|
fundPerJson.forEach((k, v) -> {
|
|
|
|
|
record.put(k + "fundPer", v);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotEmpty(item.getFundComJson())) {
|
|
|
|
|
Map<String, Object> fundPerJson = JSON.parseObject(item.getFundComJson(), new HashMap<String, Object>().getClass());
|
|
|
|
|
fundPerJson.forEach((k, v) -> {
|
|
|
|
|
record.put(k + "fundCom", v);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
record.put("fundPerSum", item.getFundPerSum());
|
|
|
|
|
record.put("fundComSum", item.getFundComSum());
|
|
|
|
|
if (StringUtils.isNotEmpty(item.getOtherPerJson())) {
|
|
|
|
|
Map<String, Object> fundPerJson = JSON.parseObject(item.getOtherPerJson(), new HashMap<String, Object>().getClass());
|
|
|
|
|
fundPerJson.forEach((k, v) -> {
|
|
|
|
|
record.put(k + "otherPer", v);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotEmpty(item.getOtherComJson())) {
|
|
|
|
|
Map<String, Object> fundComJson = JSON.parseObject(item.getOtherComJson(), new HashMap<String, Object>().getClass());
|
2022-08-02 14:58:18 +08:00
|
|
|
if (fundComJson != null) {
|
2022-07-21 17:28:47 +08:00
|
|
|
|
|
|
|
|
}
|
2022-04-27 14:36:05 +08:00
|
|
|
fundComJson.forEach((k, v) -> {
|
|
|
|
|
record.put(k + "otherCom", v);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
record.put("otherPerSum", item.getOtherPerSum());
|
|
|
|
|
record.put("otherComSum", item.getOtherComSum());
|
|
|
|
|
record.put("perSum", item.getPerSum());
|
|
|
|
|
record.put("comSum", item.getComSum());
|
|
|
|
|
result.add(record);
|
|
|
|
|
});
|
|
|
|
|
return result;
|
|
|
|
|
}
|
2022-04-18 20:24:43 +08:00
|
|
|
|
2022-04-27 16:21:24 +08:00
|
|
|
@Override
|
|
|
|
|
public Map<String, String> welfareColumns() {
|
2022-07-08 11:19:08 +08:00
|
|
|
List<ICategoryPO> listAll = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll();
|
2022-04-27 16:21:24 +08:00
|
|
|
List<ICategoryPO> list = new ArrayList<>();
|
|
|
|
|
if (CollectionUtils.isNotEmpty(listAll)) {
|
|
|
|
|
list.addAll(listAll);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Map<String, String> result = new LinkedHashMap<>();
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(100393, "个人合计"), "perSum");
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(100388, "社保个人合计"), "socialPerSum");
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(100390, "公积金个人合计"), "fundPerSum");
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(100392, "其他福利个人合计"), "otherPerSum");
|
|
|
|
|
Map<String, String> categoryIdNameMap = getSICategoryService(user).categoryIdNameMap();
|
|
|
|
|
list.stream().forEach(item -> {
|
|
|
|
|
if (Objects.equals(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), item.getWelfareType())) {
|
|
|
|
|
result.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(87159, "个人"), item.getId() + "socialPer");
|
|
|
|
|
}
|
|
|
|
|
if (Objects.equals(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), item.getWelfareType())) {
|
|
|
|
|
result.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(87159, "个人"), item.getId() + "fundPer");
|
|
|
|
|
}
|
|
|
|
|
if (Objects.equals(WelfareTypeEnum.OTHER.getValue(), item.getWelfareType())) {
|
|
|
|
|
result.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(87159, "个人"), item.getId() + "otherPer");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(100397, "单位合计"), "comSum");
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(100394, "社保单位合计"), "socialComSum");
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(100395, "公积金单位合计"), "fundComSum");
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(100396, "其他福利单位合计"), "otherComSum");
|
|
|
|
|
list.stream().forEach(item -> {
|
|
|
|
|
if (Objects.equals(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), item.getWelfareType())) {
|
|
|
|
|
result.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(100289, "单位"), item.getId() + "socialCom");
|
|
|
|
|
}
|
|
|
|
|
if (Objects.equals(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), item.getWelfareType())) {
|
|
|
|
|
result.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(100289, "单位"), item.getId() + "fundCom");
|
|
|
|
|
}
|
|
|
|
|
if (Objects.equals(WelfareTypeEnum.OTHER.getValue(), item.getWelfareType())) {
|
|
|
|
|
result.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(100289, "单位"), item.getId() + "otherCom");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-18 20:24:43 +08:00
|
|
|
|
|
|
|
|
public List<SearchConditionOption> buildBillProjectsOptions() {
|
|
|
|
|
List<SearchConditionOption> options = new ArrayList<>();
|
|
|
|
|
options.add(new SearchConditionOption(String.valueOf(ProjectTypeEnum.ALL.getValue()),
|
2022-07-08 11:19:08 +08:00
|
|
|
SalaryI18nUtil.getI18nLabel(ProjectTypeEnum.ALL.getLabelId(), ProjectTypeEnum.ALL.getDefaultLabel())));
|
2022-04-18 20:24:43 +08:00
|
|
|
options.add(new SearchConditionOption(String.valueOf(ProjectTypeEnum.SOCIAL.getValue()),
|
2022-07-08 11:19:08 +08:00
|
|
|
SalaryI18nUtil.getI18nLabel(ProjectTypeEnum.SOCIAL.getLabelId(), ProjectTypeEnum.SOCIAL.getDefaultLabel())));
|
2022-04-18 20:24:43 +08:00
|
|
|
options.add(new SearchConditionOption(String.valueOf(ProjectTypeEnum.FUND.getValue()),
|
2022-07-08 11:19:08 +08:00
|
|
|
SalaryI18nUtil.getI18nLabel(ProjectTypeEnum.FUND.getLabelId(), ProjectTypeEnum.FUND.getDefaultLabel())));
|
2022-04-18 20:24:43 +08:00
|
|
|
options.add(new SearchConditionOption(String.valueOf(ProjectTypeEnum.OTHER.getValue()),
|
2022-07-08 11:19:08 +08:00
|
|
|
SalaryI18nUtil.getI18nLabel(ProjectTypeEnum.OTHER.getLabelId(), ProjectTypeEnum.OTHER.getDefaultLabel())));
|
2022-04-18 20:24:43 +08:00
|
|
|
options.add(new SearchConditionOption(String.valueOf(ProjectTypeEnum.ENDOWMENT_INSURANCE.getValue()),
|
2022-07-08 11:19:08 +08:00
|
|
|
SalaryI18nUtil.getI18nLabel(ProjectTypeEnum.ENDOWMENT_INSURANCE.getLabelId(), ProjectTypeEnum.ENDOWMENT_INSURANCE.getDefaultLabel())));
|
2022-04-18 20:24:43 +08:00
|
|
|
options.add(new SearchConditionOption(String.valueOf(ProjectTypeEnum.MEDICAL_INSURANCE.getValue()),
|
2022-07-08 11:19:08 +08:00
|
|
|
SalaryI18nUtil.getI18nLabel(ProjectTypeEnum.MEDICAL_INSURANCE.getLabelId(), ProjectTypeEnum.MEDICAL_INSURANCE.getDefaultLabel())));
|
2022-04-18 20:24:43 +08:00
|
|
|
return options;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2022-08-02 14:58:18 +08:00
|
|
|
public List<InsuranceAccountDetailPO> queryList(String billMonth, Long taxAgentId, List<Long> employeeIds) {
|
2022-08-18 15:02:04 +08:00
|
|
|
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = getInsuranceAccountDetailMapper().queryList(billMonth, taxAgentId, employeeIds);
|
|
|
|
|
List<InsuranceAccountDetailPO> list = buildNewInsuranceDetailPOS(insuranceAccountDetailPOS);
|
2022-06-06 20:05:37 +08:00
|
|
|
// InsuranceAccountDetailPOEncrypt.decryptInsuranceAccountDetailPOList(list);
|
2022-04-27 14:36:05 +08:00
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<InsuranceAccountDetailPO> buildNewInsuranceDetailPOS(List<InsuranceAccountDetailPO> list) {
|
|
|
|
|
List<InsuranceAccountDetailPO> newList = new ArrayList<>();
|
|
|
|
|
if (CollectionUtils.isEmpty(list)) {
|
|
|
|
|
return newList;
|
|
|
|
|
}
|
|
|
|
|
Map<Long, List<InsuranceAccountDetailPO>> employeeMap = list.stream().filter(item -> item.getEmployeeId() != null)
|
|
|
|
|
.collect(Collectors.groupingBy(InsuranceAccountDetailPO::getEmployeeId));
|
|
|
|
|
for (Map.Entry<Long, List<InsuranceAccountDetailPO>> entry : employeeMap.entrySet()) {
|
|
|
|
|
Long k = entry.getKey();
|
|
|
|
|
List<InsuranceAccountDetailPO> v = entry.getValue();
|
|
|
|
|
InsuranceAccountDetailPO insuranceAccountDetailPO = new InsuranceAccountDetailPO();
|
|
|
|
|
insuranceAccountDetailPO.setEmployeeId(k);
|
|
|
|
|
Map<String, String> socialPerMap = new HashMap<>();
|
|
|
|
|
Map<String, String> fundPerMap = new HashMap<>();
|
|
|
|
|
Map<String, String> otherPerMap = new HashMap<>();
|
|
|
|
|
Map<String, String> socialComMap = new HashMap<>();
|
|
|
|
|
Map<String, String> fundComMap = new HashMap<>();
|
|
|
|
|
Map<String, String> otherComMap = new HashMap<>();
|
|
|
|
|
BigDecimal socialPer = new BigDecimal("0");
|
|
|
|
|
BigDecimal socialCom = new BigDecimal("0");
|
|
|
|
|
BigDecimal fundPer = new BigDecimal("0");
|
|
|
|
|
BigDecimal fundCom = new BigDecimal("0");
|
|
|
|
|
BigDecimal otherPer = new BigDecimal("0");
|
|
|
|
|
BigDecimal otherCom = new BigDecimal("0");
|
|
|
|
|
BigDecimal perSum = new BigDecimal("0");
|
|
|
|
|
BigDecimal comSum = new BigDecimal("0");
|
|
|
|
|
for (InsuranceAccountDetailPO item : v) {
|
2022-06-06 20:05:37 +08:00
|
|
|
InsuranceAccountDetailPOEncrypt.decryptItem(item);
|
2022-04-27 14:36:05 +08:00
|
|
|
BigDecimal socialPerSum = StringUtils.isBlank(item.getSocialPerSum()) ? new BigDecimal("0") : new BigDecimal(item.getSocialPerSum());
|
|
|
|
|
BigDecimal socialComSum = StringUtils.isBlank(item.getSocialComSum()) ? new BigDecimal("0") : new BigDecimal(item.getSocialComSum());
|
|
|
|
|
BigDecimal fundPerSum = StringUtils.isBlank(item.getFundPerSum()) ? new BigDecimal("0") : new BigDecimal(item.getFundPerSum());
|
|
|
|
|
BigDecimal fundComSum = StringUtils.isBlank(item.getFundComSum()) ? new BigDecimal("0") : new BigDecimal(item.getFundComSum());
|
|
|
|
|
BigDecimal otherPerSum = StringUtils.isBlank(item.getOtherPerSum()) ? new BigDecimal("0") : new BigDecimal(item.getOtherPerSum());
|
|
|
|
|
BigDecimal otherComSum = StringUtils.isBlank(item.getOtherComSum()) ? new BigDecimal("0") : new BigDecimal(item.getOtherComSum());
|
|
|
|
|
BigDecimal perSumItem = StringUtils.isBlank(item.getPerSum()) ? new BigDecimal("0") : new BigDecimal(item.getPerSum());
|
|
|
|
|
BigDecimal comSumItem = StringUtils.isBlank(item.getComSum()) ? new BigDecimal("0") : new BigDecimal(item.getComSum());
|
|
|
|
|
socialPer = socialPer.add(socialPerSum);
|
|
|
|
|
socialCom = socialCom.add(socialComSum);
|
|
|
|
|
fundPer = fundPer.add(fundPerSum);
|
|
|
|
|
fundCom = fundCom.add(fundComSum);
|
|
|
|
|
otherPer = otherPer.add(otherPerSum);
|
|
|
|
|
otherCom = otherCom.add(otherComSum);
|
|
|
|
|
perSum = perSum.add(perSumItem);
|
|
|
|
|
comSum = comSum.add(comSumItem);
|
|
|
|
|
if (StringUtils.isNotBlank(item.getSocialPerJson())) {
|
|
|
|
|
Map<String, String> socialJson = JSON.parseObject(item.getSocialPerJson(), new HashMap<String, String>().getClass());
|
2022-08-02 14:58:18 +08:00
|
|
|
if (socialJson != null) {
|
2022-07-21 17:28:47 +08:00
|
|
|
socialJson.forEach((insuranceId, num) -> {
|
|
|
|
|
if (socialPerMap.get(insuranceId) == null) {
|
|
|
|
|
socialPerMap.put(insuranceId, num);
|
|
|
|
|
} else {
|
|
|
|
|
String oldNum = socialPerMap.get(insuranceId);
|
|
|
|
|
BigDecimal insuanceNum = new BigDecimal("0");
|
|
|
|
|
BigDecimal oldDecimal = new BigDecimal(oldNum);
|
|
|
|
|
BigDecimal numDecimal = num == null ? new BigDecimal("0") : new BigDecimal(num);
|
|
|
|
|
insuanceNum = insuanceNum.add(numDecimal).add(oldDecimal);
|
|
|
|
|
socialPerMap.put(insuranceId, insuanceNum.toPlainString());
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-27 14:36:05 +08:00
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(item.getSocialComJson())) {
|
|
|
|
|
Map<String, String> socialJson = JSON.parseObject(item.getSocialComJson(), new HashMap<String, String>().getClass());
|
2022-08-02 14:58:18 +08:00
|
|
|
if (socialJson != null) {
|
2022-07-21 17:28:47 +08:00
|
|
|
socialJson.forEach((insuranceId, num) -> {
|
|
|
|
|
if (socialComMap.get(insuranceId) == null) {
|
|
|
|
|
socialComMap.put(insuranceId, num);
|
|
|
|
|
} else {
|
|
|
|
|
String oldNum = socialComMap.get(insuranceId);
|
|
|
|
|
BigDecimal insuanceNum = new BigDecimal("0");
|
|
|
|
|
BigDecimal oldDecimal = new BigDecimal(oldNum);
|
|
|
|
|
BigDecimal numDecimal = num == null ? new BigDecimal("0") : new BigDecimal(num);
|
|
|
|
|
insuanceNum = insuanceNum.add(numDecimal).add(oldDecimal);
|
|
|
|
|
socialComMap.put(insuranceId, insuanceNum.toPlainString());
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-27 14:36:05 +08:00
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(item.getFundPerJson())) {
|
|
|
|
|
Map<String, String> fundJson = JSON.parseObject(item.getFundPerJson(), new HashMap<String, String>().getClass());
|
2022-08-02 14:58:18 +08:00
|
|
|
if (fundJson != null) {
|
2022-07-21 17:28:47 +08:00
|
|
|
fundJson.forEach((insuranceId, num) -> {
|
|
|
|
|
if (fundPerMap.get(insuranceId) == null) {
|
|
|
|
|
fundPerMap.put(insuranceId, num);
|
|
|
|
|
} else {
|
|
|
|
|
String oldNum = fundPerMap.get(insuranceId);
|
|
|
|
|
BigDecimal insuanceNum = new BigDecimal("0");
|
|
|
|
|
BigDecimal oldDecimal = new BigDecimal(oldNum);
|
|
|
|
|
BigDecimal numDecimal = num == null ? new BigDecimal("0") : new BigDecimal(num);
|
|
|
|
|
insuanceNum = insuanceNum.add(numDecimal).add(oldDecimal);
|
|
|
|
|
fundPerMap.put(insuranceId, insuanceNum.toPlainString());
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-27 14:36:05 +08:00
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(item.getFundComJson())) {
|
|
|
|
|
Map<String, String> fundJson = JSON.parseObject(item.getFundComJson(), new HashMap<String, String>().getClass());
|
2022-08-02 14:58:18 +08:00
|
|
|
if (fundJson != null) {
|
2022-07-21 17:28:47 +08:00
|
|
|
fundJson.forEach((insuranceId, num) -> {
|
|
|
|
|
if (fundComMap.get(insuranceId) == null) {
|
|
|
|
|
fundComMap.put(insuranceId, num);
|
|
|
|
|
} else {
|
|
|
|
|
String oldNum = fundComMap.get(insuranceId);
|
|
|
|
|
BigDecimal insuanceNum = new BigDecimal("0");
|
|
|
|
|
BigDecimal oldDecimal = new BigDecimal(oldNum);
|
|
|
|
|
BigDecimal numDecimal = num == null ? new BigDecimal("0") : new BigDecimal(num);
|
|
|
|
|
insuanceNum = insuanceNum.add(numDecimal).add(oldDecimal);
|
|
|
|
|
fundComMap.put(insuranceId, insuanceNum.toPlainString());
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-27 14:36:05 +08:00
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(item.getOtherPerJson())) {
|
|
|
|
|
Map<String, String> otherJson = JSON.parseObject(item.getOtherPerJson(), new HashMap<String, String>().getClass());
|
2022-08-02 14:58:18 +08:00
|
|
|
if (otherJson != null) {
|
2022-07-21 17:28:47 +08:00
|
|
|
otherJson.forEach((insuranceId, num) -> {
|
|
|
|
|
if (otherPerMap.get(insuranceId) == null) {
|
|
|
|
|
otherPerMap.put(insuranceId, num);
|
|
|
|
|
} else {
|
|
|
|
|
String oldNum = otherPerMap.get(insuranceId);
|
|
|
|
|
BigDecimal insuanceNum = new BigDecimal("0");
|
|
|
|
|
BigDecimal oldDecimal = new BigDecimal(oldNum);
|
|
|
|
|
BigDecimal numDecimal = num == null ? new BigDecimal("0") : new BigDecimal(num);
|
|
|
|
|
insuanceNum = insuanceNum.add(numDecimal).add(oldDecimal);
|
|
|
|
|
otherPerMap.put(insuranceId, insuanceNum.toPlainString());
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-27 14:36:05 +08:00
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(item.getOtherComJson())) {
|
|
|
|
|
Map<String, String> otherJson = JSON.parseObject(item.getOtherComJson(), new HashMap<String, String>().getClass());
|
2022-08-02 14:58:18 +08:00
|
|
|
if (otherJson != null) {
|
2022-07-21 17:28:47 +08:00
|
|
|
otherJson.forEach((insuranceId, num) -> {
|
|
|
|
|
if (otherComMap.get(insuranceId) == null) {
|
|
|
|
|
otherComMap.put(insuranceId, num);
|
|
|
|
|
} else {
|
|
|
|
|
String oldNum = otherComMap.get(insuranceId);
|
|
|
|
|
BigDecimal insuanceNum = new BigDecimal("0");
|
|
|
|
|
BigDecimal oldDecimal = new BigDecimal(oldNum);
|
|
|
|
|
BigDecimal numDecimal = num == null ? new BigDecimal("0") : new BigDecimal(num);
|
|
|
|
|
insuanceNum = insuanceNum.add(numDecimal).add(oldDecimal);
|
|
|
|
|
otherComMap.put(insuranceId, insuanceNum.toPlainString());
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-27 14:36:05 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
insuranceAccountDetailPO.setSocialPerJson(JSON.toJSONString(socialPerMap));
|
|
|
|
|
insuranceAccountDetailPO.setSocialComJson(JSON.toJSONString(socialComMap));
|
|
|
|
|
insuranceAccountDetailPO.setFundPerJson(JSON.toJSONString(fundPerMap));
|
|
|
|
|
insuranceAccountDetailPO.setFundComJson(JSON.toJSONString(fundComMap));
|
|
|
|
|
insuranceAccountDetailPO.setOtherPerJson(JSON.toJSONString(otherPerMap));
|
|
|
|
|
insuranceAccountDetailPO.setOtherComJson(JSON.toJSONString(otherComMap));
|
|
|
|
|
insuranceAccountDetailPO.setSocialPerSum(socialPer.toPlainString());
|
|
|
|
|
insuranceAccountDetailPO.setSocialComSum(socialCom.toPlainString());
|
|
|
|
|
insuranceAccountDetailPO.setFundPerSum(fundPer.toPlainString());
|
|
|
|
|
insuranceAccountDetailPO.setFundComSum(fundCom.toPlainString());
|
|
|
|
|
insuranceAccountDetailPO.setOtherPerSum(otherPer.toPlainString());
|
|
|
|
|
insuranceAccountDetailPO.setOtherComSum(otherCom.toPlainString());
|
|
|
|
|
insuranceAccountDetailPO.setPerSum(perSum.toPlainString());
|
|
|
|
|
insuranceAccountDetailPO.setComSum(comSum.toPlainString());
|
|
|
|
|
newList.add(insuranceAccountDetailPO);
|
|
|
|
|
}
|
|
|
|
|
return newList;
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-12 10:24:21 +08:00
|
|
|
|
2022-05-09 11:18:54 +08:00
|
|
|
@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);
|
|
|
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
return Collections.emptyList();
|
|
|
|
|
}
|
|
|
|
|
|
2022-06-08 17:52:10 +08:00
|
|
|
@Override
|
|
|
|
|
public Collection<TaxAgentPO> getAdminTaxAgentList() {
|
2022-07-08 11:19:08 +08:00
|
|
|
return getTaxAgentService(user).listAllTaxAgentsAsAdmin((long) user.getUID());
|
2022-06-08 17:52:10 +08:00
|
|
|
}
|
2022-04-22 15:17:31 +08:00
|
|
|
|
2022-07-20 15:40:51 +08:00
|
|
|
@Override
|
|
|
|
|
public void socialSecurityBenefitsRecalculate(InsuranceAccountBatchPO param) {
|
|
|
|
|
int num = getSiAccountBiz(user).checkIfBusinessaccounting(param);
|
|
|
|
|
//表示已经被核算过不能重新核算
|
2022-08-02 14:58:18 +08:00
|
|
|
if (num > 0) {
|
2022-07-20 15:40:51 +08:00
|
|
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98831, "已被薪酬核算给核算过,无法重新核算!"));
|
|
|
|
|
}
|
|
|
|
|
param.setBillStatus(0);
|
|
|
|
|
getSiAccountBiz(user).updateById(param);
|
|
|
|
|
}
|
2022-04-11 19:07:35 +08:00
|
|
|
}
|