Merge branch 'develop' into feature/archive

This commit is contained in:
钱涛 2022-10-08 11:42:54 +08:00
commit 4a20105260
40 changed files with 2535 additions and 147 deletions

View File

@ -0,0 +1,47 @@
Oracle数据库中常见报错问题
1、工资单发放----新建工资单模板时显示系统异常无法进行下一步
解决方法:在数据库中执行以下语句,第一句执行成功后再执行第二句,如果第一句执行失败请勿执行下面的!!!!!!
-- 创建临时表HRSA_SALARY_TEMPLAT_TEMPT 结构与数据和HRSA_SALARY_TEMPLATE一样
create table HRSA_SALARY_TEMPLAT_TEMPT as select * from HRSA_SALARY_TEMPLATE;
-- 删除原表HRSA_SALARY_TEMPLATE数据
delete from HRSA_SALARY_TEMPLATE;
alter table HRSA_SALARY_TEMPLATE modify salary_item_setting long;
alter table HRSA_SALARY_TEMPLATE modify salary_item_setting CLOB;
insert into HRSA_SALARY_TEMPLATE select * from HRSA_SALARY_TEMPLAT_TEMPT ;
drop table HRSA_SALARY_TEMPLAT_TEMPT;
2、工资单发放----发放工资单时显示系统异常无法进行下一步
解决方法:在数据库中执行以下语句,第一句执行成功后再执行第二句,如果第一句执行失败请勿执行下面的!!!!!!
-- 创建临时表HRSA_SALARY_SEND_INFO_TEMPI结构与数据和HRSA_SALARY_SEND_INFO一样
create table HRSA_SALARY_SEND_INFO_TEMPI as select * from HRSA_SALARY_SEND_INFO;
-- 删除原表HRSA_SALARY_SEND_INFO数据
delete from HRSA_SALARY_SEND_INFO;
alter table HRSA_SALARY_SEND_INFO modify SALARY_TEMPLATE long;
alter table HRSA_SALARY_SEND_INFO modify SALARY_TEMPLATE CLOB;
insert into HRSA_SALARY_SEND_INFO select * from HRSA_SALARY_SEND_INFO_TEMPI;
drop table HRSA_SALARY_SEND_INFO_TEMPI;

View File

@ -11,6 +11,7 @@ import com.engine.salary.mapper.sicategory.ICategoryMapper;
import com.engine.salary.util.SalaryEnumUtil;
import com.mzlion.core.utils.BeanUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.session.SqlSession;
import weaver.conn.mybatis.MyBatisFactory;
@ -74,6 +75,7 @@ public class SICategoryBiz {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
ICategoryMapper iCategoryMapper = sqlSession.getMapper(ICategoryMapper.class);
iCategoryFormDTO.setInsuranceName(StringUtils.trim(iCategoryFormDTO.getInsuranceName()));
List<ICategoryPO> iCategoryPOS = listByName(iCategoryFormDTO.getInsuranceName());
if (CollectionUtils.isNotEmpty(iCategoryPOS)) {
throw new SalaryRunTimeException("福利名称不允许重复");

View File

@ -251,6 +251,7 @@ public class SISchemeBiz {
try {
//保存福利项目主表
InsuranceSchemeMapper insuranceSchemeMapper = sqlSession.getMapper(InsuranceSchemeMapper.class);
saveParam.getInsuranceScheme().setSchemeName(StringUtils.trim(saveParam.getInsuranceScheme().getSchemeName()));
List<InsuranceSchemePO> listResult = insuranceSchemeMapper.listByName(saveParam.getInsuranceScheme().getSchemeName());
SalaryAssert.isEmpty(listResult, "该福利名称已经存在,福利名称系统全局唯一");

View File

@ -0,0 +1,111 @@
package com.engine.salary.encrypt.siaccount;
import com.engine.salary.encrypt.AESEncryptUtil;
import com.engine.salary.entity.siaccount.po.ExcelInsuranceDetailPO;
import java.util.List;
/**
* hrsa_excel_bill_detail: 加解密
* 字段
* social_payment_base_string
* fund_payment_base_string
* other_payment_base_string
* social_per_json
* social_per_sum
* fund_per_json
* fund_per_sum
* other_per_json
* other_per_sum
* per_sum
* social_com_json
* social_com_sum
* fund_com_json
* fund_com_sum
* other_com_json
* other_com_sum
* com_sum
* social_sum
* fund_sum
* other_sum
* total
*/
public class ExcelInsuranceDetailPOEncrypt {
public static List<ExcelInsuranceDetailPO> encryptInsuranceAccountDetailPOList(List<ExcelInsuranceDetailPO> list) {
if(list == null || list.size() == 0) {
return list;
}
list.forEach(item -> {
item.setSocialPaymentBaseString(AESEncryptUtil.encrypt(item.getSocialPaymentBaseString()));
item.setFundPaymentBaseString(AESEncryptUtil.encrypt(item.getFundPaymentBaseString()));
item.setOtherPaymentBaseString(AESEncryptUtil.encrypt(item.getOtherPaymentBaseString()));
item.setSocialPerJson(AESEncryptUtil.encrypt(item.getSocialPerJson()));
item.setSocialPerSum(AESEncryptUtil.encrypt(item.getSocialPerSum()));
item.setFundPerJson(AESEncryptUtil.encrypt(item.getFundPerJson()));
item.setFundPerSum(AESEncryptUtil.encrypt(item.getFundPerSum()));
item.setOtherPerJson(AESEncryptUtil.encrypt(item.getOtherPerJson()));
item.setOtherPerSum(AESEncryptUtil.encrypt(item.getOtherPerSum()));
item.setPerSum(AESEncryptUtil.encrypt(item.getPerSum()));
item.setSocialComJson(AESEncryptUtil.encrypt(item.getSocialComJson()));
item.setSocialComSum(AESEncryptUtil.encrypt(item.getSocialComSum()));
item.setComSum(AESEncryptUtil.encrypt(item.getComSum()));
item.setSocialSum(AESEncryptUtil.encrypt(item.getSocialSum()));
item.setFundSum(AESEncryptUtil.encrypt(item.getFundSum()));
item.setOtherSum(AESEncryptUtil.encrypt(item.getOtherSum()));
item.setTotal(AESEncryptUtil.encrypt(item.getTotal()));
});
return list;
}
public static List<ExcelInsuranceDetailPO> decryptInsuranceAccountDetailPOList(List<ExcelInsuranceDetailPO> list) {
if(list == null || list.size() == 0) {
return list;
}
list.forEach(item -> {
item.setSocialPaymentBaseString(AESEncryptUtil.decrypt(item.getSocialPaymentBaseString()));
item.setFundPaymentBaseString(AESEncryptUtil.decrypt(item.getFundPaymentBaseString()));
item.setOtherPaymentBaseString(AESEncryptUtil.decrypt(item.getOtherPaymentBaseString()));
item.setSocialPerJson(AESEncryptUtil.decrypt(item.getSocialPerJson()));
item.setSocialPerSum(AESEncryptUtil.decrypt(item.getSocialPerSum()));
item.setFundPerJson(AESEncryptUtil.decrypt(item.getFundPerJson()));
item.setFundPerSum(AESEncryptUtil.decrypt(item.getFundPerSum()));
item.setOtherPerJson(AESEncryptUtil.decrypt(item.getOtherPerJson()));
item.setOtherPerSum(AESEncryptUtil.decrypt(item.getOtherPerSum()));
item.setPerSum(AESEncryptUtil.decrypt(item.getPerSum()));
item.setSocialComJson(AESEncryptUtil.decrypt(item.getSocialComJson()));
item.setSocialComSum(AESEncryptUtil.decrypt(item.getSocialComSum()));
item.setComSum(AESEncryptUtil.decrypt(item.getComSum()));
item.setSocialSum(AESEncryptUtil.decrypt(item.getSocialSum()));
item.setFundSum(AESEncryptUtil.decrypt(item.getFundSum()));
item.setOtherSum(AESEncryptUtil.decrypt(item.getOtherSum()));
item.setTotal(AESEncryptUtil.decrypt(item.getTotal()));
});
return list;
}
public static ExcelInsuranceDetailPO decryptItem(ExcelInsuranceDetailPO item) {
if(item == null) {
return item;
}
item.setSocialPaymentBaseString(AESEncryptUtil.decrypt(item.getSocialPaymentBaseString()));
item.setFundPaymentBaseString(AESEncryptUtil.decrypt(item.getFundPaymentBaseString()));
item.setOtherPaymentBaseString(AESEncryptUtil.decrypt(item.getOtherPaymentBaseString()));
item.setSocialPerJson(AESEncryptUtil.decrypt(item.getSocialPerJson()));
item.setSocialPerSum(AESEncryptUtil.decrypt(item.getSocialPerSum()));
item.setFundPerJson(AESEncryptUtil.decrypt(item.getFundPerJson()));
item.setFundPerSum(AESEncryptUtil.decrypt(item.getFundPerSum()));
item.setOtherPerJson(AESEncryptUtil.decrypt(item.getOtherPerJson()));
item.setOtherPerSum(AESEncryptUtil.decrypt(item.getOtherPerSum()));
item.setPerSum(AESEncryptUtil.decrypt(item.getPerSum()));
item.setSocialComJson(AESEncryptUtil.decrypt(item.getSocialComJson()));
item.setSocialComSum(AESEncryptUtil.decrypt(item.getSocialComSum()));
item.setComSum(AESEncryptUtil.decrypt(item.getComSum()));
item.setSocialSum(AESEncryptUtil.decrypt(item.getSocialSum()));
item.setFundSum(AESEncryptUtil.decrypt(item.getFundSum()));
item.setOtherSum(AESEncryptUtil.decrypt(item.getOtherSum()));
item.setTotal(AESEncryptUtil.decrypt(item.getTotal()));
return item;
}
}

View File

@ -0,0 +1,85 @@
package com.engine.salary.encrypt.siexport;
import com.engine.salary.encrypt.AESEncryptUtil;
import com.engine.salary.entity.siexport.po.ExcelAccountExportPO;
import java.util.List;
/**
* hrsa_excel_bill_detail: 加解密
* 字段
* social_payment_base_string
* fund_payment_base_string
* other_payment_base_string
* social_per_json
* social_per_sum
* fund_per_json
* fund_per_sum
* other_per_json
* other_per_sum
* per_sum
* social_com_json
* social_com_sum
* fund_com_json
* fund_com_sum
* other_com_json
* other_com_sum
* com_sum
* social_sum
* fund_sum
* other_sum
* total
*/
public class ExcelAccountExportPOEncrypt {
public static List<ExcelAccountExportPO> encryptExcelAccountExportPOList(List<ExcelAccountExportPO> list) {
if(list == null || list.size() == 0) {
return list;
}
list.forEach(item -> {
item.setSocialPaymentBaseString(AESEncryptUtil.encrypt(item.getSocialPaymentBaseString()));
item.setFundPaymentBaseString(AESEncryptUtil.encrypt(item.getFundPaymentBaseString()));
item.setOtherPaymentBaseString(AESEncryptUtil.encrypt(item.getOtherPaymentBaseString()));
item.setSocialPerJson(AESEncryptUtil.encrypt(item.getSocialPerJson()));
item.setSocialPerSum(AESEncryptUtil.encrypt(item.getSocialPerSum()));
item.setFundPerJson(AESEncryptUtil.encrypt(item.getFundPerJson()));
item.setFundPerSum(AESEncryptUtil.encrypt(item.getFundPerSum()));
item.setOtherPerJson(AESEncryptUtil.encrypt(item.getOtherPerJson()));
item.setOtherPerSum(AESEncryptUtil.encrypt(item.getOtherPerSum()));
item.setPerSum(AESEncryptUtil.encrypt(item.getPerSum()));
item.setSocialComJson(AESEncryptUtil.encrypt(item.getSocialComJson()));
item.setSocialComSum(AESEncryptUtil.encrypt(item.getSocialComSum()));
item.setComSum(AESEncryptUtil.encrypt(item.getComSum()));
item.setSocialSum(AESEncryptUtil.encrypt(item.getSocialSum()));
item.setFundSum(AESEncryptUtil.encrypt(item.getFundSum()));
item.setOtherSum(AESEncryptUtil.encrypt(item.getOtherSum()));
item.setTotal(AESEncryptUtil.encrypt(item.getTotal()));
});
return list;
}
public static List<ExcelAccountExportPO> decryptExcelAccountExportPOList(List<ExcelAccountExportPO> list) {
if(list == null || list.size() == 0) {
return list;
}
list.forEach(item -> {
item.setSocialPaymentBaseString(AESEncryptUtil.decrypt(item.getSocialPaymentBaseString()));
item.setFundPaymentBaseString(AESEncryptUtil.decrypt(item.getFundPaymentBaseString()));
item.setOtherPaymentBaseString(AESEncryptUtil.decrypt(item.getOtherPaymentBaseString()));
item.setSocialPerJson(AESEncryptUtil.decrypt(item.getSocialPerJson()));
item.setSocialPerSum(AESEncryptUtil.decrypt(item.getSocialPerSum()));
item.setFundPerJson(AESEncryptUtil.decrypt(item.getFundPerJson()));
item.setFundPerSum(AESEncryptUtil.decrypt(item.getFundPerSum()));
item.setOtherPerJson(AESEncryptUtil.decrypt(item.getOtherPerJson()));
item.setOtherPerSum(AESEncryptUtil.decrypt(item.getOtherPerSum()));
item.setPerSum(AESEncryptUtil.decrypt(item.getPerSum()));
item.setSocialComJson(AESEncryptUtil.decrypt(item.getSocialComJson()));
item.setSocialComSum(AESEncryptUtil.decrypt(item.getSocialComSum()));
item.setComSum(AESEncryptUtil.decrypt(item.getComSum()));
item.setSocialSum(AESEncryptUtil.decrypt(item.getSocialSum()));
item.setFundSum(AESEncryptUtil.decrypt(item.getFundSum()));
item.setOtherSum(AESEncryptUtil.decrypt(item.getOtherSum()));
item.setTotal(AESEncryptUtil.decrypt(item.getTotal()));
});
return list;
}
}

View File

@ -0,0 +1,351 @@
package com.engine.salary.entity.siaccount.bo;
import com.alibaba.fastjson.JSON;
import com.engine.salary.entity.salaryacct.po.ExcelAcctResultPO;
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
import com.engine.salary.entity.salarysob.dto.SalarySobEmpFieldDTO;
import com.engine.salary.entity.sicategory.po.ICategoryPO;
import com.engine.salary.entity.siexport.po.AccountExportPO;
import com.engine.salary.entity.siexport.po.ExcelAccountExportPO;
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
import com.engine.salary.mapper.sicategory.ICategoryMapper;
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.db.MapperProxyFactory;
import com.engine.salary.util.page.Column;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import static com.engine.salary.enums.UserStatusEnum.getDefaultLabelByValue;
/**
* @Author: sy
* @Description: 福利核算线上线下对比结果
* @Date: 2022/9/28
**/
public class InsuranceComparisonResultBO {
/**
* 数据类型的后缀标识
* 为了展示千分位福利核算结果列表线上线下对比结果列表需要返回给前端列表字段的数据类型字段索引+后缀标识
*/
private static final String DATA_TYPE_SUFFIX = "_type";
/**
* 构建福利核算结果列表的表头线下对比
*
*/
public static List<Column> buildTableColumns4ComparisonResult() {
List<ICategoryPO> listAll = MapperProxyFactory.getProxy(ICategoryMapper.class).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());
List<Column> columns = Lists.newArrayList();
// 员工信息字段
columns.add(new Column("姓名", "userName", "userName"));
columns.add(new Column("部门", "department", "department"));
columns.add(new Column("手机号", "mobile", "mobile"));
columns.add(new Column("工号", "workcode", "workcode"));
columns.add(new Column("员工状态", "employeeStatus", "employeeStatus"));
columns.add(new Column("数据来源", "sourceFrom", "sourceFrom"));
columns.add(new Column("个税扣缴义务人", "socialPayOrg", "socialPayOrg"));
columns.add(new Column("社保账号", "socialAccount", "socialAccount"));
columns.add(new Column("社保方案名称", "socialSchemeName", "socialSchemeName"));
//组装社保基数
for (ICategoryPO po : socialWelfareList) {
columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "socialBase", po.getId() + "socialBase"));
}
columns.add(new Column("公积金账号", "fundAccount", "fundAccount"));
columns.add(new Column("公积金方案名称", "fundSchemeName", "fundSchemeName"));
//组装公积金基数
for (ICategoryPO po : fundWelfareList) {
columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "fundBase", po.getId() + "fundBase"));
}
columns.add(new Column("补充公积金账号", "supplementFundAccount", "supplementFundAccount"));
columns.add(new Column("其他福利方案名称", "otherSchemeName", "otherSchemeName"));
//组装其他福利基数
for (ICategoryPO po : otherWelfareList) {
columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "otherBase", po.getId() + "otherBase"));
}
//社保个人生育保险个人工伤保险个人失业保险个人养老保险个人医疗保险个人
for (ICategoryPO po : socialWelfareList) {
columns.add(new Column(po.getInsuranceName() + "个人", po.getId() + "socialPer", po.getId() + "socialPer"));
}
columns.add(new Column("社保个人合计", "socialPerSum", "socialPerSum"));
//住房公积金个人补充住房公积金个人
for (ICategoryPO po : fundWelfareList) {
columns.add(new Column(po.getInsuranceName() + "个人", po.getId() + "fundPer", po.getId() + "fundPer"));
}
columns.add(new Column("公积金个人合计", "fundPerSum", "fundPerSum"));
//其他个人比如企业年金个人
for (ICategoryPO po : otherWelfareList) {
columns.add(new Column(po.getInsuranceName() + "个人", po.getId() + "otherPer", po.getId() + "otherPer"));
}
columns.add(new Column("其他福利个人合计", "otherPerSum", "otherPerSum"));
columns.add(new Column("个人合计", "perSum", "perSum"));
//社保单位生育保险单位工伤保险单位失业保险单位养老保险单位医疗保险单位
for (ICategoryPO po : socialWelfareList) {
columns.add(new Column(po.getInsuranceName() + "单位", po.getId() + "socialCom", po.getId() + "socialCom"));
}
columns.add(new Column("社保单位合计", "socialComSum", "socialComSum"));
//住房公积金单位补充住房公积金单位
for (ICategoryPO po : fundWelfareList) {
columns.add(new Column(po.getInsuranceName() + "单位", po.getId() + "fundCom", po.getId() + "fundCom"));
}
columns.add(new Column("公积金单位合计", "fundComSum", "fundComSum"));
//其他单位比如企业年金单位
for (ICategoryPO po : otherWelfareList) {
columns.add(new Column(po.getInsuranceName() + "单位", po.getId() + "otherCom", po.getId() + "otherCom"));
}
columns.add(new Column("其他福利单位合计", "otherComSum", "otherComSum"));
columns.add(new Column("单位合计", "comSum", "comSum"));
columns.add(new Column("社保合计", "socialSum", "socialSum"));
columns.add(new Column("公积金合计", "fundSum", "fundSum"));
columns.add(new Column("其他福利合计", "otherSum", "otherSum"));
columns.add(new Column("合计", "total", "total"));
return columns;
}
/**
* 构建福利核算线下对比结果
*
*/
public static List<Map<String, Object>> buildComparisonTableData(List<AccountExportPO> accountExportPOS, List<ExcelAccountExportPO> excelAccountExportPOS) {
Map<String, List<ExcelAccountExportPO>> excelResultMap = SalaryEntityUtil.group2Map(excelAccountExportPOS, ExcelAccountExportPO::getWorkcode);
// Map<String, List<AccountExportPO>> acctResultMap = SalaryEntityUtil.group2Map(accountExportPOS, AccountExportPO::getWorkcode);
List<TaxAgentPO> paymentList = MapperProxyFactory.getProxy(TaxAgentMapper.class).listAll();
Map<Long, TaxAgentPO> paymentMap = paymentList.stream().collect(Collectors.toMap(TaxAgentPO::getId, Function.identity()));
List<Map<String, Object>> resultList = Lists.newArrayListWithExpectedSize(accountExportPOS.size());
//遍历线上数据
for (AccountExportPO accountExportPO : accountExportPOS) {
Map<String, Object> map = Maps.newHashMap();
// 记录线下值和系统值之间是否存在差异
map.put("different", "false");
//设置基本字段信息和类型
map.put("userName", accountExportPO.getUserName());
map.put("userName" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
map.put("department", accountExportPO.getDepartmentName());
map.put("department" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
map.put("mobile", accountExportPO.getTelephone());
map.put("mobile" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
map.put("workcode", accountExportPO.getWorkcode());
map.put("workcode" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
map.put("employeeStatus", accountExportPO.getUserStatus() == null ? "" : getDefaultLabelByValue(accountExportPO.getUserStatus()));
map.put("employeeStatus" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
map.put("socialPayOrg", paymentMap.get(accountExportPO.getSocialPayOrg()) == null ? "" : paymentMap.get(accountExportPO.getSocialPayOrg()).getName());
map.put("socialPayOrg" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
//社保账号公积金账号补充公积金账号
map.put("fundAccount", accountExportPO.getFundAccount());
map.put("fundAccount" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
map.put("socialAccount", accountExportPO.getSocialAccount());
map.put("socialAccount" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
map.put("supplementFundAccount", accountExportPO.getSupplementFundAccount());
map.put("supplementFundAccount" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
//线下值
List<ExcelAccountExportPO> excelResultValueList = excelResultMap.get(accountExportPO.getWorkcode());
ExcelAccountExportPO excelAccountExportPO = new ExcelAccountExportPO();
if (excelResultValueList != null && excelResultValueList.size() == 1) {
excelAccountExportPO = excelResultValueList.get(0);
}
//社保基数socialPaymentBaseString
welfareElementCompare(map, accountExportPO.getSocialPaymentBaseString(), excelAccountExportPO.getSocialPaymentBaseString(), "Base", 1);
//公积金基数fundPaymentBaseString
welfareElementCompare(map, accountExportPO.getFundPaymentBaseString(), excelAccountExportPO.getFundPaymentBaseString(), "Base", 2);
//其他福利基数otherPaymentBaseString
welfareElementCompare(map, accountExportPO.getOtherPaymentBaseString(), excelAccountExportPO.getOtherPaymentBaseString(), "Base", 3);
//社保个人socialPerJson
welfareElementCompare(map, accountExportPO.getSocialPerJson(), excelAccountExportPO.getSocialPerJson(), "Per", 1);
//公积金个人fundPerJson
welfareElementCompare(map, accountExportPO.getFundPerJson(), excelAccountExportPO.getFundPerJson(), "Per", 2);
//其他个人otherPerJson
welfareElementCompare(map, accountExportPO.getOtherPerJson(), excelAccountExportPO.getOtherPerJson(), "Per", 3);
//社保单位socialComJson
welfareElementCompare(map, accountExportPO.getSocialComJson(), excelAccountExportPO.getSocialComJson(), "Com", 1);
//公积金单位fundComJson
welfareElementCompare(map, accountExportPO.getFundComJson(), excelAccountExportPO.getFundComJson(), "Com", 2);
//其他单位otherComJson
welfareElementCompare(map, accountExportPO.getOtherComJson(), excelAccountExportPO.getOtherComJson(), "Com", 3);
//各种合计
welfareSumCompare(map, accountExportPO, excelAccountExportPO);
resultList.add(map);
}
return resultList;
}
private static Map<String, Object> welfareElementCompare(Map<String, Object> map, String accountJson, String excelAccountJson, String welfareStand, Integer welfareType) {
List<ICategoryPO> listAll = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll();
List<ICategoryPO> accountWelfareList = listAll.stream().filter(e -> e.getWelfareType().equals(welfareType)).collect(Collectors.toList());
String baseTypeInfo = welfareType.equals(1) ? "social" : (welfareType.equals(2) ? "fund" : "other");
Map<String, String> accountMap = JSON.parseObject(accountJson, HashMap.class);
Map<String, String> excelAccountMap = JSON.parseObject(excelAccountJson, HashMap.class);
for (ICategoryPO welfare : accountWelfareList) {
Map<String, Object> temp = Maps.newHashMap();
if (accountMap != null && accountMap.get(welfare.getId().toString()) != null) {
temp.put("acctResultValue", accountMap.get(welfare.getId().toString()));
} else {
temp.put("acctResultValue", "");
}
if (excelAccountMap != null && excelAccountMap.get(welfare.getId().toString()) != null) {
temp.put("excelResultValue", excelAccountMap.get(welfare.getId().toString()));
}else {
temp.put("excelResultValue", "");
}
map.put(welfare.getId() + baseTypeInfo + welfareStand, temp);
// 薪资项目字段的字段类型
map.put(welfare.getId() + baseTypeInfo + welfareStand + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !temp.get("acctResultValue").equals(temp.get("excelResultValue"))) {
map.put("different", "true");
}
}
return map;
}
private static Map<String, Object> welfareSumCompare(Map<String, Object> map, AccountExportPO accountExportPO, ExcelAccountExportPO excelAccountExportPO) {
//社保个人合计公积金个人合计其他福利个人合计个人合计
Map<String, Object> socialPerSumTemp = Maps.newHashMap();
socialPerSumTemp.put("acctResultValue", dealNull(accountExportPO.getSocialPerSum()));
socialPerSumTemp.put("excelResultValue", dealNull(excelAccountExportPO.getSocialPerSum()));
map.put("socialPerSum", socialPerSumTemp);
map.put("socialPerSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !socialPerSumTemp.get("acctResultValue").equals(socialPerSumTemp.get("excelResultValue"))) {
map.put("different", "true");
}
Map<String, Object> fundPerSumTemp = Maps.newHashMap();
fundPerSumTemp.put("acctResultValue", dealNull(accountExportPO.getFundPerSum()));
fundPerSumTemp.put("excelResultValue", dealNull(excelAccountExportPO.getFundPerSum()));
map.put("fundPerSum", fundPerSumTemp);
map.put("fundPerSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !fundPerSumTemp.get("acctResultValue").equals(fundPerSumTemp.get("excelResultValue"))) {
map.put("different", "true");
}
Map<String, Object> otherPerSumTemp = Maps.newHashMap();
otherPerSumTemp.put("acctResultValue", dealNull(accountExportPO.getOtherPerSum()));
otherPerSumTemp.put("excelResultValue", dealNull(excelAccountExportPO.getOtherPerSum()));
map.put("otherPerSum", otherPerSumTemp);
map.put("otherPerSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !otherPerSumTemp.get("acctResultValue").equals(otherPerSumTemp.get("excelResultValue"))) {
map.put("different", "true");
}
Map<String, Object> perSumTemp = Maps.newHashMap();
perSumTemp.put("acctResultValue", dealNull(accountExportPO.getPerSum()));
perSumTemp.put("excelResultValue", dealNull(excelAccountExportPO.getPerSum()));
map.put("perSum", perSumTemp);
map.put("perSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !perSumTemp.get("acctResultValue").equals(perSumTemp.get("excelResultValue"))) {
map.put("different", "true");
}
//社保单位合计公积金单位合计其他福利单位合计单位合计
Map<String, Object> socialComSumTemp = Maps.newHashMap();
socialComSumTemp.put("acctResultValue", dealNull(accountExportPO.getSocialComSum()));
socialComSumTemp.put("excelResultValue", dealNull(excelAccountExportPO.getSocialComSum()));
map.put("socialComSum", socialComSumTemp);
map.put("socialComSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !socialComSumTemp.get("acctResultValue").equals(socialComSumTemp.get("excelResultValue"))) {
map.put("different", "true");
}
Map<String, Object> fundComSumTemp = Maps.newHashMap();
fundComSumTemp.put("acctResultValue", dealNull(accountExportPO.getFundComSum()));
fundComSumTemp.put("excelResultValue", dealNull(excelAccountExportPO.getFundComSum()));
map.put("fundComSum", fundComSumTemp);
map.put("fundComSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !fundComSumTemp.get("acctResultValue").equals(fundComSumTemp.get("excelResultValue"))) {
map.put("different", "true");
}
Map<String, Object> otherComSumTemp = Maps.newHashMap();
otherComSumTemp.put("acctResultValue", dealNull(accountExportPO.getOtherComSum()));
otherComSumTemp.put("excelResultValue", dealNull(excelAccountExportPO.getOtherComSum()));
map.put("otherComSum", otherComSumTemp);
map.put("otherComSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !otherComSumTemp.get("acctResultValue").equals(otherComSumTemp.get("excelResultValue"))) {
map.put("different", "true");
}
Map<String, Object> perComTemp = Maps.newHashMap();
perComTemp.put("acctResultValue", dealNull(accountExportPO.getComSum()));
perComTemp.put("excelResultValue", dealNull(excelAccountExportPO.getComSum()));
map.put("comSum", perComTemp);
map.put("comSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !perComTemp.get("acctResultValue").equals(perComTemp.get("excelResultValue"))) {
map.put("different", "true");
}
//社保合计公积金合计其他福利合计合计
Map<String, Object> socialSumTemp = Maps.newHashMap();
socialSumTemp.put("acctResultValue", dealNull(accountExportPO.getSocialSum()));
socialSumTemp.put("excelResultValue", dealNull(excelAccountExportPO.getSocialSum()));
map.put("socialSum", socialSumTemp);
map.put("socialSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !socialSumTemp.get("acctResultValue").equals(socialSumTemp.get("excelResultValue"))) {
map.put("different", "true");
}
Map<String, Object> fundSumTemp = Maps.newHashMap();
fundSumTemp.put("acctResultValue", dealNull(accountExportPO.getFundSum()));
fundSumTemp.put("excelResultValue", dealNull(excelAccountExportPO.getFundSum()));
map.put("fundSum", fundSumTemp);
map.put("fundSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !fundSumTemp.get("acctResultValue").equals(fundSumTemp.get("excelResultValue"))) {
map.put("different", "true");
}
Map<String, Object> otherSumTemp = Maps.newHashMap();
otherSumTemp.put("acctResultValue", dealNull(accountExportPO.getOtherSum()));
otherSumTemp.put("excelResultValue", dealNull(excelAccountExportPO.getOtherSum()));
map.put("otherSum", otherSumTemp);
map.put("otherSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !otherSumTemp.get("acctResultValue").equals(otherSumTemp.get("excelResultValue"))) {
map.put("different", "true");
}
Map<String, Object> totalTemp = Maps.newHashMap();
totalTemp.put("acctResultValue", dealNull(accountExportPO.getTotal()));
totalTemp.put("excelResultValue", dealNull(excelAccountExportPO.getTotal()));
map.put("total", totalTemp);
map.put("total" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !totalTemp.get("acctResultValue").equals(totalTemp.get("excelResultValue"))) {
map.put("different", "true");
}
return map;
}
private static String dealNull(String data) {
if (data == null) {
return "";
}
return data;
}
}

View File

@ -0,0 +1,29 @@
package com.engine.salary.entity.siaccount.dto;
import com.engine.salary.util.page.Column;
import com.engine.salary.util.page.PageInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.util.List;
import java.util.Map;
/**
* @Author: sy
* @Description: 福利核算线下对比结果列表
* @Date: 2022/9/28
**/
@Data
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class InsuranceComparisonResultListDTO {
//列表的表头
private List<Column> weaTableColumns;
//列表数据
private PageInfo<Map<String, Object>> data;
}

View File

@ -0,0 +1,29 @@
package com.engine.salary.entity.siaccount.param;
import com.engine.salary.util.valid.DataCheck;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author: sy
* @Description: 福利核算-线下对比导入参数
* @Date: 2022/9/27
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ExcelInsuranceImportParam {
/**
* 上传文件id
*/
@DataCheck(require = true,message = "imageId为空")
String imageId;
/**
* 账单月份
*/
private String billMonth;
}

View File

@ -0,0 +1,20 @@
package com.engine.salary.entity.siaccount.param;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @Author: sy
* @Description: 福利台账-线上线下对比结果查询参数
* @Date: 2022/9/28
**/
@Data
@EqualsAndHashCode(callSuper = true)
public class InsuranceComparisonResultQueryParam extends InsuranceAccountDetailParam{
//仅显示有差异的人员")
private boolean onlyDiffEmployee;
//仅显示有差异的薪资项目")
// private boolean onlyDiffSalaryItem;
}

View File

@ -0,0 +1,241 @@
package com.engine.salary.entity.siaccount.po;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @Author: sy
* @Description: 线下Excel福利明细表
* @Date: 2022/9/27
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
//hrsa_excel_bill_detail
public class ExcelInsuranceDetailPO {
/**
* 主键id
*/
private Long id;
/**
* 员工id
*/
private Long employeeId;
/**
* 账单月份该处的账单月份即导入的数据需要对比的账单月份
*/
private String billMonth;
/**
* 账单状态 0-未归档 1-已归档
*/
private Integer billStatus;
/**
* 缴纳状态
*/
private Integer paymentStatus;
/**
* 补缴月份
*/
private String supplementaryMonth;
/**
* 补缴项目
*/
private String supplementaryProjects;
/**
* 数据来源 0-系统核算 1-临时数据
*/
private Integer resourceFrom;
/**
* 社保缴纳组织
*/
private Long socialPayOrg;
/**
* 社保账号
*/
private String socialAccount;
/**
* 公积金缴纳组织
*/
private Long fundPayOrg;
/**
* 公积金账号
*/
private String fundAccount;
/**
* 补充公积金账号
*/
private String supplementFundAccount;
/**
* 其他福利缴纳组织
*/
private Long otherPayOrg;
/**
* 社保方案ID
*/
private Long socialSchemeId;
/**
* 社保缴纳基数
*/
private String socialPaymentBaseString;
/**
* 公积金方案ID
*/
private Long fundSchemeId;
/**
* 公积金缴纳基数
*/
private String fundPaymentBaseString;
/**
* 其他福利方案id
*/
private Long otherSchemeId;
/**
* 其他福利缴纳基数
*/
private String otherPaymentBaseString;
/**
* 社保个人缴费明细
*/
private String socialPerJson;
/**
* 社保个人合计
*/
private String socialPerSum;
/**
* 公积金个人缴费明细
*/
private String fundPerJson;
/**
* 公积金个人合计
*/
private String fundPerSum;
/**
* 其他福利个人缴费明细
*/
private String otherPerJson;
/**
* 其他福利个人合计
*/
private String otherPerSum;
/**
* 个人合计
*/
private String perSum;
/**
* 社保单位缴费明细
*/
private String socialComJson;
/**
* 社保单位合计
*/
private String socialComSum;
/**
* 公积金单位缴费明细
*/
private String fundComJson;
/**
* 公积金单位合计
*/
private String fundComSum;
/**
* 其他福利单位缴费明细
*/
private String otherComJson;
/**
* 其他福利单位合计
*/
private String otherComSum;
/**
* 单位合计
*/
private String comSum;
/**
* 社保合计
*/
private String socialSum;
/**
* 公积金合计
*/
private String fundSum;
/**
* 其他福利合计
*/
private String otherSum;
/**
* 合计
*/
private String total;
/**
* 创建人id
*/
private Long creator;
/**
* 是否删除
*/
private Integer deleteType;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 租户key
*/
private String tenantKey;
/**
* 个税扣缴义务人
*/
private Long paymentOrganization;
}

View File

@ -19,6 +19,16 @@ public class AccountExportPO extends InsuranceAccountDetailPO {
private Integer userStatus;
private String workcode;
public void setWorkcode(String workcode) {
this.workcode = workcode;
}
public String getWorkcode() {
return workcode;
}
public String getUserName() {
return userName;
}

View File

@ -0,0 +1,61 @@
package com.engine.salary.entity.siexport.po;
import com.engine.salary.entity.siaccount.po.ExcelInsuranceDetailPO;
/**
* @Author: sy
* @Description:
* @Date: 2022/9/28
**/
public class ExcelAccountExportPO extends ExcelInsuranceDetailPO {
private String userName;
private String telephone;
private String departmentName;
private Integer userStatus;
private String workcode;
public void setWorkcode(String workcode) {
this.workcode = workcode;
}
public String getWorkcode() {
return workcode;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getDepartmentName() {
return departmentName;
}
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}
public Integer getUserStatus() {
return userStatus;
}
public void setUserStatus(Integer userStatus) {
this.userStatus = userStatus;
}
}

View File

@ -1,7 +1,9 @@
package com.engine.salary.mapper;
import com.engine.salary.entity.siaccount.param.InsuranceComparisonResultQueryParam;
import com.engine.salary.entity.siexport.param.InsuranceExportParam;
import com.engine.salary.entity.siexport.po.AccountExportPO;
import com.engine.salary.entity.siexport.po.ExcelAccountExportPO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -14,6 +16,8 @@ import java.util.List;
**/
public interface InsuranceExportMapper {
List<ExcelAccountExportPO> exportExcelAccount(@Param("param") InsuranceComparisonResultQueryParam param);
List<AccountExportPO> exportAccount(@Param("paymentStatus") Integer paymentStatus, @Param("param") InsuranceExportParam param);
}

View File

@ -6,7 +6,8 @@
e.lastname AS userName,
e.MOBILE AS telephone,
d.departmentname AS departmentName,
e.STATUS AS userStatus
e.STATUS AS userStatus,
e.workcode AS workcode
FROM (
SELECT *
from hrsa_bill_detail
@ -30,7 +31,8 @@
e.lastname AS userName,
e.MOBILE AS telephone,
d.departmentname AS departmentName,
e.STATUS AS userStatus
e.STATUS AS userStatus,
e.workcode AS workcode
FROM (
SELECT *
from hrsa_bill_detail
@ -54,7 +56,8 @@
e.lastname AS userName,
e.MOBILE AS telephone,
d.departmentname AS departmentName,
e.STATUS AS userStatus
e.STATUS AS userStatus,
e.workcode AS workcode
FROM (
SELECT *
from hrsa_bill_detail
@ -73,4 +76,41 @@
ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
</if>
</select>
<select id="exportExcelAccount" resultType="com.engine.salary.entity.siexport.po.ExcelAccountExportPO">
SELECT
a.*,e.lastname AS userName,e.MOBILE AS telephone,d.departmentname AS departmentName,e.STATUS AS userStatus,e.workcode AS workcode
FROM(
SELECT * from hrsa_excel_bill_detail
WHERE delete_type = 0 AND bill_month = #{param.billMonth} AND payment_status = #{param.paymentStatus} AND payment_organization = #{param.paymentOrganization}
)a
LEFT JOIN hrmresource e ON e.ID = a.employee_id
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
where e.status not in (7)
and (e.accounttype is null or e.accounttype = 0)
</select>
<select id="exportExcelAccount" resultType="com.engine.salary.entity.siexport.po.ExcelAccountExportPO" databaseId="oracle">
SELECT
a.*,e.lastname AS userName,e.MOBILE AS telephone,d.departmentname AS departmentName,e.STATUS AS userStatus,e.workcode AS workcode
FROM(
SELECT * from hrsa_excel_bill_detail
WHERE delete_type = 0 AND bill_month = #{param.billMonth} AND payment_status = #{param.paymentStatus} AND payment_organization = #{param.paymentOrganization}
)a
LEFT JOIN hrmresource e ON e.ID = a.employee_id
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
where e.status not in (7)
and (e.accounttype is null or e.accounttype = 0)
</select>
<select id="exportExcelAccount" resultType="com.engine.salary.entity.siexport.po.ExcelAccountExportPO" databaseId="sqlserver">
SELECT
a.*,e.lastname AS userName,e.MOBILE AS telephone,d.departmentname AS departmentName,e.STATUS AS userStatus,e.workcode AS workcode
FROM(
SELECT * from hrsa_excel_bill_detail
WHERE delete_type = 0 AND bill_month = #{param.billMonth} AND payment_status = #{param.paymentStatus} AND payment_organization = #{param.paymentOrganization}
)a
LEFT JOIN hrmresource e ON e.ID = a.employee_id
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
where e.status not in (7)
and (e.accounttype is null or e.accounttype = 0)
</select>
</mapper>

View File

@ -0,0 +1,39 @@
package com.engine.salary.mapper.siaccount;
import com.engine.salary.entity.siaccount.po.ExcelInsuranceDetailPO;
import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List;
/**
* @author songyang
*/
public interface ExcelInsuranceDetailMapper {
/**
* 查询对比数据
* @param billMonth 账单月份
* @param paymentOrganization 个税扣缴义务人
* @param employeeId 人员id
* @return
*/
List<ExcelInsuranceDetailPO> queryCompareList(@Param("billMonth") String billMonth, @Param("paymentOrganization") Long paymentOrganization, @Param("employeeId") Long employeeId);
/**
* 根据id删除
*
* @param id
*/
void deleteById(@Param("id") Long id);
/**
* 根据id批量删除
*/
void batchDelByIds(@Param("ids") Collection<Long> ids);
/**
* 批量保存
*/
void batchSave(@Param("accounts") Collection<ExcelInsuranceDetailPO> accounts);
}

View File

@ -0,0 +1,344 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.engine.salary.mapper.siaccount.ExcelInsuranceDetailMapper">
<resultMap id="BaseResultMap" type="com.engine.salary.entity.siaccount.po.ExcelInsuranceDetailPO">
<result column="id" property="id"/>
<result column="employee_id" property="employeeId"/>
<result column="bill_month" property="billMonth"/>
<result column="bill_status" property="billStatus"/>
<result column="payment_status" property="paymentStatus"/>
<result column="supplementary_month" property="supplementaryMonth"/>
<result column="supplementary_projects" property="supplementaryProjects"/>
<result column="resource_from" property="resourceFrom"/>
<result column="social_pay_org" property="socialPayOrg"/>
<result column="social_account" property="socialAccount"/>
<result column="fund_pay_org" property="fundPayOrg"/>
<result column="fund_account" property="fundAccount"/>
<result column="supplement_fund_account" property="supplementFundAccount"/>
<result column="other_pay_org" property="otherPayOrg"/>
<result column="social_scheme_id" property="socialSchemeId"/>
<result column="social_payment_base_string" property="socialPaymentBaseString"/>
<result column="fund_scheme_id" property="fundSchemeId"/>
<result column="fund_payment_base_string" property="fundPaymentBaseString"/>
<result column="other_scheme_id" property="otherSchemeId"/>
<result column="other_payment_base_string" property="otherPaymentBaseString"/>
<result column="social_per_json" property="socialPerJson"/>
<result column="social_per_sum" property="socialPerSum"/>
<result column="fund_per_json" property="fundPerJson"/>
<result column="fund_per_sum" property="fundPerSum"/>
<result column="other_per_json" property="otherPerJson"/>
<result column="other_per_sum" property="otherPerSum"/>
<result column="per_sum" property="perSum"/>
<result column="social_com_json" property="socialComJson"/>
<result column="social_com_sum" property="socialComSum"/>
<result column="fund_com_json" property="fundComJson"/>
<result column="fund_com_sum" property="fundComSum"/>
<result column="other_com_json" property="otherComJson"/>
<result column="other_com_sum" property="otherComSum"/>
<result column="com_sum" property="comSum"/>
<result column="social_sum" property="socialSum"/>
<result column="fund_sum" property="fundSum"/>
<result column="other_sum" property="otherSum"/>
<result column="total" property="total"/>
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="tenant_key" property="tenantKey"/>
<result column="payment_organization" property="paymentOrganization"/>
</resultMap>
<!-- 表字段 -->
<sql id="baseColumns">
t
.
id
, t.employee_id
, e.status as employee_status
, t.bill_month
, t.bill_status
, t.payment_status
, t.supplementary_month
, t.supplementary_projects
, t.resource_from
, t.social_pay_org
, t.social_account
, t.fund_pay_org
, t.fund_account
, t.supplement_fund_account
, t.other_pay_org
, t.social_scheme_id
, t.social_payment_base_string
, t.fund_scheme_id
, t.fund_payment_base_string
, t.other_scheme_id
, t.other_payment_base_string
, t.social_per_json
, t.social_per_sum
, t.fund_per_json
, t.fund_per_sum
, t.other_per_json
, t.other_per_sum
, t.per_sum
, t.social_com_json
, t.social_com_sum
, t.fund_com_json
, t.fund_com_sum
, t.other_com_json
, t.other_com_sum
, t.com_sum
, t.social_sum
, t.fund_sum
, t.other_sum
, t.total
, t.creator
, t.delete_type
, t.create_time
, t.update_time
, t.tenant_key
, t.payment_organization
</sql>
<sql id="paramSqlCommon">
<if test="param.billMonth != null and param.billMonth != ''">
AND
t.bill_month = #{param.billMonth}
</if>
<if test="param.paymentStatus != null">
AND
t.payment_status = #{param.paymentStatus}
</if>
<if test="param.paymentOrganization != null and param.paymentOrganization != ''">
AND
t.payment_organization = #{param.paymentOrganization}
</if>
</sql>
<select id="queryCompareList" resultMap="BaseResultMap">
SELECT
t.id,t.employee_id,t.social_per_json,t.social_com_json,
t.fund_per_json,t.fund_com_json,t.other_per_json,
t.other_com_json,t.social_per_sum,t.social_com_sum,
t.fund_per_sum,t.fund_com_sum,t.other_per_sum,
t.other_com_sum,t.per_sum,t.com_sum
FROM
hrsa_excel_bill_detail t
WHERE t.delete_type = 0
AND t.payment_status = 0
AND t.bill_month = #{billMonth}
AND t.payment_organization = #{paymentOrganization}
AND employee_id = #{employeeId}
</select>
<!-- 根据主键删除记录 -->
<delete id="deleteById" parameterType="com.engine.salary.entity.siaccount.po.ExcelInsuranceDetailPO">
UPDATE hrsa_excel_bill_detail
SET delete_type = 1
WHERE id = #{id}
AND delete_type = 0
</delete>
<!-- 根据id批量删除 -->
<delete id="batchDelByIds">
UPDATE hrsa_excel_bill_detail
SET delete_type = 1
WHERE delete_type = 0
<if test="ids != null and ids.size()>0">
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
</delete>
<insert id="batchSave">
INSERT INTO hrsa_excel_bill_detail
(id,employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string,
fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json,
social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum,
com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization)
VALUES
<foreach collection="accounts" item="item" separator=",">
(
#{item.id},
#{item.employeeId},
#{item.billMonth},
#{item.billStatus},
#{item.paymentStatus},
#{item.supplementaryMonth},
#{item.supplementaryProjects},
#{item.resourceFrom},
#{item.socialPayOrg},
#{item.socialAccount},
#{item.socialSchemeId},
#{item.socialPaymentBaseString},
#{item.fundPayOrg},
#{item.fundAccount},
#{item.supplementFundAccount},
#{item.fundSchemeId},
#{item.fundPaymentBaseString},
#{item.otherPayOrg},
#{item.otherSchemeId},
#{item.otherPaymentBaseString},
#{item.socialPerJson},
#{item.socialPerSum},
#{item.fundPerJson},
#{item.fundPerSum},
#{item.otherPerJson},
#{item.otherPerSum},
#{item.perSum},
#{item.socialComJson},
#{item.socialComSum},
#{item.fundComJson},
#{item.fundComSum},
#{item.otherComJson},
#{item.otherComSum},
#{item.comSum},
#{item.socialSum},
#{item.fundSum},
#{item.otherSum},
#{item.total},
#{item.creator},
#{item.createTime},
#{item.updateTime},
#{item.deleteType},
#{item.tenantKey},
#{item.paymentOrganization}
)
</foreach>
</insert>
<insert id="batchSave" databaseId="oracle">
INSERT INTO hrsa_excel_bill_detail
(id,employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string,
fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json,
social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum,
com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization)
<foreach collection="accounts" item="item" separator="union all">
select
#{item.id,jdbcType=DOUBLE},
#{item.employeeId,jdbcType=DOUBLE},
#{item.billMonth,jdbcType=VARCHAR},
#{item.billStatus,jdbcType=INTEGER},
#{item.paymentStatus,jdbcType=INTEGER},
#{item.supplementaryMonth,jdbcType=VARCHAR},
#{item.supplementaryProjects,jdbcType=VARCHAR},
#{item.resourceFrom,jdbcType=INTEGER},
#{item.socialPayOrg,jdbcType=DOUBLE},
#{item.socialAccount,jdbcType=VARCHAR},
#{item.socialSchemeId,jdbcType=DOUBLE},
#{item.socialPaymentBaseString,jdbcType=VARCHAR},
#{item.fundPayOrg,jdbcType=DOUBLE},
#{item.fundAccount,jdbcType=VARCHAR},
#{item.supplementFundAccount,jdbcType=VARCHAR},
#{item.fundSchemeId,jdbcType=DOUBLE},
#{item.fundPaymentBaseString,jdbcType=VARCHAR},
#{item.otherPayOrg,jdbcType=DOUBLE},
#{item.otherSchemeId,jdbcType=DOUBLE},
#{item.otherPaymentBaseString,jdbcType=VARCHAR},
#{item.socialPerJson,jdbcType=VARCHAR},
#{item.socialPerSum,jdbcType=VARCHAR},
#{item.fundPerJson,jdbcType=VARCHAR},
#{item.fundPerSum,jdbcType=VARCHAR},
#{item.otherPerJson,jdbcType=VARCHAR},
#{item.otherPerSum,jdbcType=VARCHAR},
#{item.perSum,jdbcType=VARCHAR},
#{item.socialComJson,jdbcType=VARCHAR},
#{item.socialComSum,jdbcType=VARCHAR},
#{item.fundComJson,jdbcType=VARCHAR},
#{item.fundComSum,jdbcType=VARCHAR},
#{item.otherComJson,jdbcType=VARCHAR},
#{item.otherComSum,jdbcType=VARCHAR},
#{item.comSum,jdbcType=VARCHAR},
#{item.socialSum,jdbcType=VARCHAR},
#{item.fundSum,jdbcType=VARCHAR},
#{item.otherSum,jdbcType=VARCHAR},
#{item.total,jdbcType=VARCHAR},
#{item.creator,jdbcType=DOUBLE},
#{item.createTime},
#{item.updateTime},
#{item.deleteType},
#{item.tenantKey,jdbcType=VARCHAR},
#{item.paymentOrganization,jdbcType=DOUBLE}
from dual
</foreach>
</insert>
<insert id="batchSave" databaseId="sqlserver">
<foreach collection="accounts" item="item" separator=";">
INSERT INTO hrsa_excel_bill_detail
(id,employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string,
fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json,
social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum,
com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization)
VALUES
(
#{item.id},
#{item.employeeId},
#{item.billMonth},
#{item.billStatus},
#{item.paymentStatus},
#{item.supplementaryMonth},
#{item.supplementaryProjects},
#{item.resourceFrom},
#{item.socialPayOrg},
#{item.socialAccount},
#{item.socialSchemeId},
#{item.socialPaymentBaseString},
#{item.fundPayOrg},
#{item.fundAccount},
#{item.supplementFundAccount},
#{item.fundSchemeId},
#{item.fundPaymentBaseString},
#{item.otherPayOrg},
#{item.otherSchemeId},
#{item.otherPaymentBaseString},
#{item.socialPerJson},
#{item.socialPerSum},
#{item.fundPerJson},
#{item.fundPerSum},
#{item.otherPerJson},
#{item.otherPerSum},
#{item.perSum},
#{item.socialComJson},
#{item.socialComSum},
#{item.fundComJson},
#{item.fundComSum},
#{item.otherComJson},
#{item.otherComSum},
#{item.comSum},
#{item.socialSum},
#{item.fundSum},
#{item.otherSum},
#{item.total},
#{item.creator},
#{item.createTime},
#{item.updateTime},
#{item.deleteType},
#{item.tenantKey},
#{item.paymentOrganization}
)
</foreach>
</insert>
<sql id="likeCondition" databaseId="mysql">
<if test="userName != null and userName != ''">
AND e.lastname like CONCAT('%',#{userName},'%')
</if>
</sql>
<sql id="likeCondition" databaseId="oracle">
<if test="userName != null and userName != ''">
AND e.lastname like '%'||#{userName}||'%'
</if>
</sql>
<sql id="likeCondition" databaseId="sqlserver">
<if test="userName != null and userName != ''">
AND e.lastname like '%'+#{userName}+'%'
</if>
</sql>
</mapper>

View File

@ -103,6 +103,14 @@ public interface InsuranceAccountDetailMapper {
* @return
*/
List<InsuranceAccountDetailPO> querySupplementListByBillMonth(@Param("billMonth") String billMonth, @Param("paymentOrganization") Long paymentOrganization);
/**
* 查询正常缴纳数据
* @param billMonth 账单月份
* @param paymentOrganization 个税扣缴义务人
* @return
*/
List<InsuranceAccountDetailPO> queryNormalListByBillMonth(@Param("billMonth") String billMonth, @Param("paymentOrganization") Long paymentOrganization);
/**
* 根据账单月份删除
*

View File

@ -235,6 +235,17 @@
AND t.payment_organization = #{paymentOrganization}
</select>
<select id="queryNormalListByBillMonth" resultMap="BaseResultMap">
SELECT
t.id,t.employee_id
FROM
hrsa_bill_detail t
WHERE t.delete_type = 0
AND t.payment_status = 0
AND t.bill_month = #{billMonth}
AND t.payment_organization = #{paymentOrganization}
</select>
<select id="selectAccountIds" resultType="java.lang.Long">
SELECT DISTINCT a.ID
FROM (

View File

@ -326,7 +326,7 @@
AND e.lastname like CONCAT('%',#{param.userName},'%')
</if>
<if test="param.jobNum != null and param.jobNum != ''">
AND e.workcode = #{param.jobNum}
AND e.workcode like CONCAT('%',#{param.jobNum},'%')
</if>
<if test="param.departmentIds != null and param.departmentIds.size()>0">
AND e.departmentid IN
@ -386,7 +386,7 @@
AND e.lastname like '%'+#{param.userName}+'%'
</if>
<if test="param.jobNum != null and param.jobNum != ''">
AND e.workcode = #{param.jobNum}
AND e.workcode like '%'+#{param.jobNum}+'%'
</if>
<if test="param.departmentIds != null and param.departmentIds.size()>0">
AND e.departmentid IN
@ -447,7 +447,7 @@
AND e.lastname like '%'||#{param.userName}||'%'
</if>
<if test="param.jobNum != null and param.jobNum != ''">
AND e.workcode = #{param.jobNum}
AND e.workcode like '%'||#{param.jobNum}||'%'
</if>
<if test="param.departmentIds != null and param.departmentIds.size()>0">
AND e.departmentid IN

View File

@ -39,7 +39,7 @@
</resultMap>
<select id="listPage4EmployeeId" resultMap="resultMap">
SELECT DISTINCT employee_type, employee_id
SELECT employee_type, employee_id
FROM hrsa_tax_declaration_detail t
LEFT JOIN hrmresource e ON e.id = t.employee_id
LEFT JOIN hrmdepartment d ON d.id = e.DEPARTMENTID

View File

@ -0,0 +1,30 @@
package com.engine.salary.service;
import com.engine.salary.entity.salaryacct.param.SalaryComparisonResultQueryParam;
import com.engine.salary.entity.siaccount.dto.InsuranceComparisonResultListDTO;
import com.engine.salary.entity.siaccount.param.InsuranceComparisonResultQueryParam;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
/**
* @Author: sy
* @Description: 福利核算的线下对比结果
* @Date: 2022/9/28
**/
public interface SIAComparisonResultService {
/**
* 根据列表查询条件查询线下对比结果分页
*/
InsuranceComparisonResultListDTO listPageByParam(InsuranceComparisonResultQueryParam queryParam);
/**
* 根据列表查询条件查询线下对比结果
*/
InsuranceComparisonResultListDTO listByParam(InsuranceComparisonResultQueryParam queryParam);
/**
* 导出福利核算线下对比结果
*/
XSSFWorkbook exportComparisonResult(InsuranceComparisonResultQueryParam queryParam);
}

View File

@ -227,5 +227,16 @@ public interface SIAccountService {
* 导出福利核算-补缴导入模板
*/
XSSFWorkbook exportSupplyImportTemplate(InsuranceAcctDetailImportTemplateParam param);
/**
* 导出福利核算-线下对比导入模板
*/
XSSFWorkbook exportComparisonWelfareTemplate(InsuranceAcctDetailImportTemplateParam param);
/**
* 将通过福利核算-线下对比导入模板导入的数据更新到hrsa_excel_bill_detail表中
*/
Map<String, Object> importExcelInsuranceDetail(ExcelInsuranceImportParam excelInsuranceImportParam);
}

View File

@ -2,7 +2,6 @@ package com.engine.salary.service.impl;
import com.api.browser.bean.SearchConditionGroup;
import com.api.browser.bean.SearchConditionItem;
import com.api.browser.bean.SearchConditionOption;
import com.api.browser.util.ConditionFactory;
import com.api.browser.util.ConditionType;
import com.api.formmode.mybatis.util.SqlProxyHandle;
@ -53,7 +52,6 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import weaver.file.ImageFileManager;
import weaver.general.Util;
import weaver.hrm.User;
import weaver.systeminfo.SystemEnv;
import java.io.InputStream;
import java.text.SimpleDateFormat;
@ -143,37 +141,37 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
conditionItems.add(jobNum);
SearchConditionItem idNo = conditionFactory.createCondition(ConditionType.INPUT, 25034, "idNo");
idNo.setInputType("input");
idNo.setColSpan(2);
idNo.setFieldcol(16);
idNo.setLabelcol(8);
idNo.setViewAttr(2);
idNo.setLabel("证件号码");
conditionItems.add(idNo);
// SearchConditionItem idNo = conditionFactory.createCondition(ConditionType.INPUT, 25034, "idNo");
// idNo.setInputType("input");
// idNo.setColSpan(2);
// idNo.setFieldcol(16);
// idNo.setLabelcol(8);
// idNo.setViewAttr(2);
// idNo.setLabel("证件号码");
// conditionItems.add(idNo);
//日期范围选项
List<SearchConditionOption> dateOptions = new ArrayList<SearchConditionOption>();
dateOptions.add(new SearchConditionOption("6", SystemEnv.getHtmlLabelName(32530, user.getLanguage()), true));//指定日期范围(必须为6)
SearchConditionItem hiredate = conditionFactory.createCondition(ConditionType.RANGEPICKER, 18648, new String[]{"hiredate", "hiredate"});
hiredate.setInputType("rangepicker");
hiredate.setFormat("yyyy-MM-dd");
hiredate.setFieldcol(16);
hiredate.setLabelcol(8);
hiredate.setViewAttr(2);
hiredate.setLabel("入职日期");
hiredate.setOptions(dateOptions);
conditionItems.add(hiredate);
// List<SearchConditionOption> dateOptions = new ArrayList<SearchConditionOption>();
// dateOptions.add(new SearchConditionOption("6", SystemEnv.getHtmlLabelName(32530, user.getLanguage()), true));//指定日期范围(必须为6)
// SearchConditionItem hiredate = conditionFactory.createCondition(ConditionType.RANGEPICKER, 18648, new String[]{"hiredate", "hiredate"});
// hiredate.setInputType("rangepicker");
// hiredate.setFormat("yyyy-MM-dd");
// hiredate.setFieldcol(16);
// hiredate.setLabelcol(8);
// hiredate.setViewAttr(2);
// hiredate.setLabel("入职日期");
// hiredate.setOptions(dateOptions);
// conditionItems.add(hiredate);
SearchConditionItem mobile = conditionFactory.createCondition(ConditionType.INPUT, 25034, "mobile");
mobile.setInputType("input");
mobile.setColSpan(2);
mobile.setFieldcol(16);
mobile.setLabelcol(8);
mobile.setViewAttr(2);
mobile.setLabel("手机号");
conditionItems.add(mobile);
//
// SearchConditionItem mobile = conditionFactory.createCondition(ConditionType.INPUT, 25034, "mobile");
// mobile.setInputType("input");
// mobile.setColSpan(2);
// mobile.setFieldcol(16);
// mobile.setLabelcol(8);
// mobile.setViewAttr(2);
// mobile.setLabel("手机号");
// conditionItems.add(mobile);
addGroups.add(new SearchConditionGroup("常用条件", true, conditionItems));
@ -676,16 +674,16 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
for(AddUpDeductionDTO dto : list) {
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("username", dto.getUsername());
resultMap.put("departmentName", dto.getDepartmentName());
resultMap.put("mobile", dto.getMobile());
resultMap.put("workcode", dto.getJobNum());
resultMap.put("taxAgentName", dto.getTaxAgentName());
resultMap.put("username", Util.null2String(dto.getUsername()));
resultMap.put("departmentName", Util.null2String(dto.getDepartmentName()));
resultMap.put("mobile", Util.null2String(dto.getMobile()));
resultMap.put("workcode", Util.null2String(dto.getJobNum()));
resultMap.put("taxAgentName", Util.null2String(dto.getTaxAgentName()));
if (dto.getIdNo() != null) {
resultMap.put("idNo", dto.getIdNo());
resultMap.put("idNo", Util.null2String(dto.getIdNo()));
}
if (dto.getHiredate() != null) {
resultMap.put("hiredate", dto.getHiredate());
resultMap.put("hiredate", Util.null2String(dto.getHiredate()));
}
resultList.add(resultMap);

View File

@ -2,7 +2,6 @@ package com.engine.salary.service.impl;
import com.api.browser.bean.SearchConditionGroup;
import com.api.browser.bean.SearchConditionItem;
import com.api.browser.bean.SearchConditionOption;
import com.api.browser.util.ConditionFactory;
import com.api.browser.util.ConditionType;
import com.api.formmode.mybatis.util.SqlProxyHandle;
@ -25,7 +24,10 @@ import com.engine.salary.enums.UserStatusEnum;
import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.mapper.datacollection.AddUpSituationMapper;
import com.engine.salary.mapper.sys.SalarySysConfMapper;
import com.engine.salary.service.*;
import com.engine.salary.service.AddUpDeductionService;
import com.engine.salary.service.AddUpSituationService;
import com.engine.salary.service.SalaryEmployeeService;
import com.engine.salary.service.TaxAgentService;
import com.engine.salary.sys.entity.po.SalarySysConfPO;
import com.engine.salary.sys.entity.vo.OrderRuleVO;
import com.engine.salary.sys.service.SalarySysConfService;
@ -48,7 +50,6 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import weaver.file.ImageFileManager;
import weaver.general.Util;
import weaver.hrm.User;
import weaver.systeminfo.SystemEnv;
import java.io.InputStream;
import java.text.SimpleDateFormat;
@ -129,37 +130,37 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
conditionItems.add(jobNum);
SearchConditionItem idNo = conditionFactory.createCondition(ConditionType.INPUT, 25034, "idNo");
idNo.setInputType("input");
idNo.setColSpan(2);
idNo.setFieldcol(16);
idNo.setLabelcol(8);
idNo.setViewAttr(2);
idNo.setLabel("证件号码");
conditionItems.add(idNo);
//日期范围选项
List<SearchConditionOption> dateOptions = new ArrayList<SearchConditionOption>();
dateOptions.add(new SearchConditionOption("6", SystemEnv.getHtmlLabelName(32530, user.getLanguage()), true));//指定日期范围(必须为6)
SearchConditionItem hiredate = conditionFactory.createCondition(ConditionType.RANGEPICKER, 18648, new String[]{"hiredate", "hiredate"});
hiredate.setInputType("rangepicker");
hiredate.setFormat("yyyy-MM-dd");
hiredate.setFieldcol(16);
hiredate.setLabelcol(8);
hiredate.setViewAttr(2);
hiredate.setLabel("入职日期");
hiredate.setOptions(dateOptions);
conditionItems.add(hiredate);
SearchConditionItem mobile = conditionFactory.createCondition(ConditionType.INPUT, 25034, "mobile");
mobile.setInputType("input");
mobile.setColSpan(2);
mobile.setFieldcol(16);
mobile.setLabelcol(8);
mobile.setViewAttr(2);
mobile.setLabel("手机号");
conditionItems.add(mobile);
// SearchConditionItem idNo = conditionFactory.createCondition(ConditionType.INPUT, 25034, "idNo");
// idNo.setInputType("input");
// idNo.setColSpan(2);
// idNo.setFieldcol(16);
// idNo.setLabelcol(8);
// idNo.setViewAttr(2);
// idNo.setLabel("证件号码");
// conditionItems.add(idNo);
//
// //日期范围选项
// List<SearchConditionOption> dateOptions = new ArrayList<SearchConditionOption>();
// dateOptions.add(new SearchConditionOption("6", SystemEnv.getHtmlLabelName(32530, user.getLanguage()), true));//指定日期范围(必须为6)
// SearchConditionItem hiredate = conditionFactory.createCondition(ConditionType.RANGEPICKER, 18648, new String[]{"hiredate", "hiredate"});
// hiredate.setInputType("rangepicker");
// hiredate.setFormat("yyyy-MM-dd");
// hiredate.setFieldcol(16);
// hiredate.setLabelcol(8);
// hiredate.setViewAttr(2);
// hiredate.setLabel("入职日期");
// hiredate.setOptions(dateOptions);
// conditionItems.add(hiredate);
//
//
// SearchConditionItem mobile = conditionFactory.createCondition(ConditionType.INPUT, 25034, "mobile");
// mobile.setInputType("input");
// mobile.setColSpan(2);
// mobile.setFieldcol(16);
// mobile.setLabelcol(8);
// mobile.setViewAttr(2);
// mobile.setLabel("手机号");
// conditionItems.add(mobile);
addGroups.add(new SearchConditionGroup("常用条件", true, conditionItems));

View File

@ -0,0 +1,228 @@
package com.engine.salary.service.impl;
import com.engine.core.impl.Service;
import com.engine.salary.encrypt.siexport.AccountExportPOEncrypt;
import com.engine.salary.encrypt.siexport.ExcelAccountExportPOEncrypt;
import com.engine.salary.entity.siaccount.bo.InsuranceComparisonResultBO;
import com.engine.salary.entity.siaccount.dto.InsuranceComparisonResultListDTO;
import com.engine.salary.entity.siaccount.param.InsuranceComparisonResultQueryParam;
import com.engine.salary.entity.sicategory.po.ICategoryPO;
import com.engine.salary.entity.siexport.param.InsuranceExportParam;
import com.engine.salary.entity.siexport.po.AccountExportPO;
import com.engine.salary.entity.siexport.po.ExcelAccountExportPO;
import com.engine.salary.mapper.InsuranceExportMapper;
import com.engine.salary.mapper.sicategory.ICategoryMapper;
import com.engine.salary.service.SIAComparisonResultService;
import com.engine.salary.util.db.MapperProxyFactory;
import com.engine.salary.util.excel.ExcelUtil;
import com.engine.salary.util.page.Column;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.util.page.SalaryPageUtil;
import com.engine.salary.util.valid.ValidUtil;
import com.google.common.collect.Lists;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Author: sy
* @Description: 福利核算的线下对比结果
* @Date: 2022/9/28
**/
public class SIAComparisonResultServiceImpl extends Service implements SIAComparisonResultService {
private InsuranceExportMapper getInsuranceExportMapper() {
return MapperProxyFactory.getProxy(InsuranceExportMapper.class);
}
/**
* 根据列表查询条件查询线下对比结果分页
*/
@Override
public InsuranceComparisonResultListDTO listPageByParam(InsuranceComparisonResultQueryParam queryParam) {
return listByParam(true, queryParam);
}
/**
* 根据列表查询条件查询线下对比结果
*/
@Override
public InsuranceComparisonResultListDTO listByParam(InsuranceComparisonResultQueryParam queryParam) {
return listByParam(false, queryParam);
}
@Override
public XSSFWorkbook exportComparisonResult(InsuranceComparisonResultQueryParam queryParam) {
ValidUtil.doValidator(queryParam);
// 查询线下对比结果
InsuranceComparisonResultListDTO insuranceComparisonResultListDTO = listByParam(queryParam);
// 薪资核算线下对比结果列表表头
List<Object> headerList = Lists.newArrayList();
Set<String> employeeInfo = employeeInfo();
Set<String> welfareInfo = welfareInfo();
for (Column weaTableColumn : insuranceComparisonResultListDTO.getWeaTableColumns()) {
// 员工信息字段
if (employeeInfo.contains(weaTableColumn.getKey())) {
headerList.add(weaTableColumn.getTitle());
}
// 薪资项目的表头
if (welfareInfo.contains(weaTableColumn.getKey())) {
headerList.add(weaTableColumn.getTitle() + " (线上值)");
headerList.add(weaTableColumn.getTitle() + " (线下值)");
}
}
List<Map<String, Object>> resultMapList = insuranceComparisonResultListDTO.getData().getList();
// excel导出的数据
List<List<Object>> rows = new ArrayList<>();
rows.add(headerList);
for (Map<String, Object> map : resultMapList) {
List<Object> row = Lists.newArrayList();
for (Column weaTableColumn : insuranceComparisonResultListDTO.getWeaTableColumns()) {
// 员工信息字段的值
if (employeeInfo.contains(weaTableColumn.getKey())) {
row.add(map.get(weaTableColumn.getKey()));
}
// 福利项目的值
if (welfareInfo.contains(weaTableColumn.getKey())) {
Map tempMap = (Map) map.getOrDefault(weaTableColumn.getKey(), Collections.emptyMap());
row.add(tempMap.get("acctResultValue"));
row.add(tempMap.get("excelResultValue"));
}
}
rows.add(row);
}
String sheetName = "线下对比结果";
return ExcelUtil.genWorkbookV2(rows, sheetName);
}
/**
* 根据福利核算人员查询福利核算线下对比结果
*/
private InsuranceComparisonResultListDTO listByParam(boolean needPage, InsuranceComparisonResultQueryParam queryParam) {
//1-查询线上福利核算记录
InsuranceExportParam insuranceExportParam = new InsuranceExportParam();
insuranceExportParam.setBillMonth(queryParam.getBillMonth());
insuranceExportParam.setPaymentOrganization(queryParam.getPaymentOrganization());
List<AccountExportPO> accountExportPOS = getInsuranceExportMapper().exportAccount(queryParam.getPaymentStatus(), insuranceExportParam);
//如果入参包含姓名信息
if (queryParam.getUserName() != null) {
accountExportPOS = accountExportPOS.stream().filter(v -> v.getUserName().contains(queryParam.getUserName())).collect(Collectors.toList());
}
AccountExportPOEncrypt.decryptAccountExportPOList(accountExportPOS);
//2-查询线下对比数据
List<ExcelAccountExportPO> excelAccountExportPOS = getInsuranceExportMapper().exportExcelAccount(queryParam);
ExcelAccountExportPOEncrypt.decryptExcelAccountExportPOList(excelAccountExportPOS);
//3-构建福利核算对比结果列表表头
List<Column> weaTableColumns = InsuranceComparisonResultBO.buildTableColumns4ComparisonResult();
//4-通过线上线下两份数据获得对比结果
List<Map<String, Object>> resultMapList = InsuranceComparisonResultBO.buildComparisonTableData(accountExportPOS, excelAccountExportPOS);
// 系统值和线下值一致的人员
if (queryParam.isOnlyDiffEmployee()) {
// 过滤系统值和线下值一致的薪资核算人员
resultMapList = resultMapList.stream()
.filter(map -> BooleanUtils.toBoolean(String.valueOf(map.get("different"))))
.collect(Collectors.toList());
}
// 分页
PageInfo<Map<String, Object>> dtoPage = new PageInfo<>();
dtoPage.setTotal(resultMapList.size());
if (needPage) {
dtoPage.setList(SalaryPageUtil.subList(queryParam.getCurrent(), queryParam.getPageSize(), resultMapList));
dtoPage.setPageSize(queryParam.getPageSize());
dtoPage.setPageNum(queryParam.getCurrent());
} else {
dtoPage.setList(resultMapList);
}
// 返回结果
return new InsuranceComparisonResultListDTO().setWeaTableColumns(weaTableColumns).setData(dtoPage);
}
private Set<String> welfareInfo() {
Set<String> info = new HashSet<>();
List<ICategoryPO> listAll = MapperProxyFactory.getProxy(ICategoryMapper.class).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());
//组装社保基数
for (ICategoryPO po : socialWelfareList) {
info.add(po.getId() + "socialBase");
}
//组装公积金基数
for (ICategoryPO po : fundWelfareList) {
info.add(po.getId() + "fundBase");
}
//组装其他福利基数
for (ICategoryPO po : otherWelfareList) {
info.add(po.getId() + "otherBase");
}
//社保个人生育保险个人工伤保险个人失业保险个人养老保险个人医疗保险个人
for (ICategoryPO po : socialWelfareList) {
info.add(po.getId() + "socialPer");
}
info.add("socialPerSum");
//住房公积金个人补充住房公积金个人
for (ICategoryPO po : fundWelfareList) {
info.add(po.getId() + "fundPer");
}
info.add("fundPerSum");
//其他个人比如企业年金个人
for (ICategoryPO po : otherWelfareList) {
info.add(po.getId() + "otherPer");
}
info.add("otherPerSum");
info.add("perSum");
//社保单位生育保险单位工伤保险单位失业保险单位养老保险单位医疗保险单位
for (ICategoryPO po : socialWelfareList) {
info.add(po.getId() + "socialCom");
}
info.add("socialComSum");
//住房公积金单位补充住房公积金单位
for (ICategoryPO po : fundWelfareList) {
info.add(po.getId() + "fundCom");
}
info.add("fundComSum");
//其他单位比如企业年金单位
for (ICategoryPO po : otherWelfareList) {
info.add(po.getId() + "otherCom");
}
info.add("otherComSum");
info.add("comSum");
info.add("socialSum");
info.add("fundSum");
info.add("otherSum");
info.add("total");
return info;
}
private Set<String> employeeInfo() {
Set<String> info = new HashSet<>();
info.add("userName");
info.add("department");
info.add("mobile");
info.add("workcode");
info.add("socialPayOrg");
return info;
}
}

View File

@ -12,6 +12,7 @@ import com.engine.core.impl.Service;
import com.engine.salary.biz.*;
import com.engine.salary.component.SalaryWeaTable;
import com.engine.salary.constant.SalaryDefaultTenantConstant;
import com.engine.salary.encrypt.siaccount.ExcelInsuranceDetailPOEncrypt;
import com.engine.salary.encrypt.siaccount.InsuranceAccountDetailPOEncrypt;
import com.engine.salary.encrypt.siaccount.SiAccountEncrypt;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
@ -20,11 +21,13 @@ import com.engine.salary.entity.siaccount.dto.InsuranceAccountBatchListDTO;
import com.engine.salary.entity.siaccount.dto.InsuranceAccountTabDTO;
import com.engine.salary.entity.siaccount.dto.InsuranceAccountViewListDTO;
import com.engine.salary.entity.siaccount.param.*;
import com.engine.salary.entity.siaccount.po.ExcelInsuranceDetailPO;
import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO;
import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO;
import com.engine.salary.entity.siaccount.po.InsuranceAccountInspectPO;
import com.engine.salary.entity.siarchives.po.InsuranceArchivesEmployeePO;
import com.engine.salary.entity.sicategory.po.ICategoryPO;
import com.engine.salary.entity.sischeme.po.InsuranceSchemePO;
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
import com.engine.salary.enums.UserStatusEnum;
import com.engine.salary.enums.siaccount.BillStatusEnum;
@ -33,10 +36,12 @@ import com.engine.salary.enums.siaccount.PaymentStatusEnum;
import com.engine.salary.enums.siaccount.ProjectTypeEnum;
import com.engine.salary.enums.sicategory.WelfareTypeEnum;
import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.mapper.siaccount.ExcelInsuranceDetailMapper;
import com.engine.salary.mapper.siaccount.InsuranceAccountBatchMapper;
import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper;
import com.engine.salary.mapper.siaccount.InsuranceAccountInspectMapper;
import com.engine.salary.mapper.sicategory.ICategoryMapper;
import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper;
import com.engine.salary.mapper.sys.SalarySysConfMapper;
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
import com.engine.salary.service.*;
@ -57,6 +62,7 @@ import com.engine.salary.util.page.SalaryPageUtil;
import com.engine.salary.util.valid.ValidUtil;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import dm.jdbc.util.IdGenerator;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Sheet;
@ -116,6 +122,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
return MapperProxyFactory.getProxy(InsuranceAccountDetailMapper.class);
}
private ExcelInsuranceDetailMapper getExcelInsuranceDetailMapper() {
return MapperProxyFactory.getProxy(ExcelInsuranceDetailMapper.class);
}
private SalaryItemService getSalaryItemService(User user) {
return (SalaryItemService) ServiceUtil.getService(SalaryItemServiceImpl.class, user);
}
@ -138,6 +148,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
}
private InsuranceSchemeMapper getInsuranceSchemeMapper() {
return MapperProxyFactory.getProxy(InsuranceSchemeMapper.class);
}
private EmployBiz employeeBiz = new EmployBiz();
private TaxAgentBiz taxAgentBiz = new TaxAgentBiz();
@ -1032,14 +1046,24 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
SalaryI18nUtil.getI18nLabel(86317, "工号"),
SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"),
"账单月份");
// List<String> dataIndexList = Lists.newArrayList("username", "departmentName", "mobile", "taxAgentName", "billMonth");
List<String> dataIndexList = Lists.newArrayList("username", "departmentName", "mobile", "workcode", "taxAgentName", "billMonth");
// 查询福利核算项目
List<String> welfareNames = (List<String>) param.getWelfareNames();
headerList.addAll(welfareNames);
// excel导出的数据
List<List<Object>> rows = new ArrayList<>();
//查询当前已有的补缴数据
List<Map<String, Object>> resultMapList = getNormalDataByBillMonth(param.getBillMonth(), param.getPaymentOrganization());
// excel导出的数据
List<List<Object>> rows = Lists.newArrayListWithExpectedSize(resultMapList.size());
rows.add(headerList);
for (Map<String, Object> map : resultMapList) {
List<Object> row = Lists.newArrayListWithExpectedSize(headerList.size());
for (String dataIndex : dataIndexList) {
row.add(map.getOrDefault(dataIndex, StringUtils.EMPTY));
}
rows.add(row);
}
String sheetName = "福利核算导入模板";
return ExcelUtil.genWorkbookV2(rows, sheetName);
@ -1346,6 +1370,35 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
return resultList;
}
/**
* 获取福利台账中的正常缴纳数据
* @param billMonth 账单月份
* @param paymentOrganization 个税扣缴义务人id
* @return
*/
private List<Map<String, Object>> getNormalDataByBillMonth(String billMonth, Long paymentOrganization) {
List<Map<String, Object>> resultList = new ArrayList<>();
DataCollectionEmployee employee = new DataCollectionEmployee();
TaxAgentPO taxAgentPO = taxAgentBiz.getById(paymentOrganization);
List<InsuranceAccountDetailPO> supplyDataList = getInsuranceAccountDetailMapper().queryNormalListByBillMonth(billMonth, paymentOrganization);
for(InsuranceAccountDetailPO po : supplyDataList) {
Map<String, Object> resultMap = new HashMap<>();
employee = employeeBiz.getEmployeeById(po.getEmployeeId());
resultMap.put("username", employee.getUsername());
resultMap.put("departmentName", employee.getDepartmentName());
resultMap.put("mobile", employee.getMobile());
resultMap.put("workcode", employee.getWorkcode());
resultMap.put("taxAgentName", taxAgentPO.getName());
resultMap.put("billMonth", billMonth);
resultList.add(resultMap);
}
return resultList;
}
/**
* 将更新的数据设置到老的insuranceAccountDetailPO对象中
@ -1569,4 +1622,436 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
}
}
/**
* 导出福利核算-线下对比导入模板
*/
@Override
public XSSFWorkbook exportComparisonWelfareTemplate(InsuranceAcctDetailImportTemplateParam param) {
List<ICategoryPO> listAll = MapperProxyFactory.getProxy(ICategoryMapper.class).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());
List<Object> headerList = Lists.newArrayList(SalaryI18nUtil.getI18nLabel(85429, "姓名"),
SalaryI18nUtil.getI18nLabel(86185, "部门"),
SalaryI18nUtil.getI18nLabel(86186, "手机号"),
SalaryI18nUtil.getI18nLabel(86317, "工号"),
SalaryI18nUtil.getI18nLabel(86187, "员工状态"),
SalaryI18nUtil.getI18nLabel(100377, "数据来源"),
SalaryI18nUtil.getI18nLabel(91325, "个税扣缴义务人"));
headerList.add(SalaryI18nUtil.getI18nLabel(91324, "社保账号"));
headerList.add(SalaryI18nUtil.getI18nLabel(91323, "社保方案名称"));
// "失业保险申报基数"
// "生育保险申报基数"
// "养老保险申报基数"
// "医疗保险申报基数"
// "工伤保险申报基数"
for (ICategoryPO po : socialWelfareList) {
headerList.add(po.getInsuranceName() + "申报基数");
}
headerList.add(SalaryI18nUtil.getI18nLabel(91486, "公积金账号"));
headerList.add(SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称"));
//组装公积金基数
for (ICategoryPO po : fundWelfareList) {
headerList.add(po.getInsuranceName() + "申报基数");
}
headerList.add(SalaryI18nUtil.getI18nLabel(91487, "补充公积金账号"));
headerList.add(SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称"));
//组装其他福利基数
for (ICategoryPO po : otherWelfareList) {
headerList.add(po.getInsuranceName() + "申报基数");
}
//社保个人生育保险个人工伤保险个人失业保险个人养老保险个人医疗保险个人
for (ICategoryPO po : socialWelfareList) {
headerList.add(po.getInsuranceName() + "个人");
}
headerList.add(SalaryI18nUtil.getI18nLabel(100388, "社保个人合计"));
//住房公积金个人补充住房公积金个人
for (ICategoryPO po : fundWelfareList) {
headerList.add(po.getInsuranceName() + "个人");
}
headerList.add(SalaryI18nUtil.getI18nLabel(100390, "公积金个人合计"));
//其他个人比如企业年金个人
for (ICategoryPO po : otherWelfareList) {
headerList.add(po.getInsuranceName() + "个人");
}
headerList.add(SalaryI18nUtil.getI18nLabel(100392, "其他福利个人合计"));
headerList.add(SalaryI18nUtil.getI18nLabel(100393, "个人合计"));
//社保单位生育保险单位工伤保险单位失业保险单位养老保险单位医疗保险单位
for (ICategoryPO po : socialWelfareList) {
headerList.add(po.getInsuranceName() + "单位");
}
headerList.add(SalaryI18nUtil.getI18nLabel(100394, "社保单位合计"));
//住房公积金单位补充住房公积金单位
for (ICategoryPO po : fundWelfareList) {
headerList.add(po.getInsuranceName() + "单位");
}
headerList.add(SalaryI18nUtil.getI18nLabel(100395, "公积金单位合计"));
//其他单位比如企业年金单位
for (ICategoryPO po : otherWelfareList) {
headerList.add(po.getInsuranceName() + "单位");
}
headerList.add(SalaryI18nUtil.getI18nLabel(100396, "其他福利单位合计"));
headerList.add(SalaryI18nUtil.getI18nLabel(100397, "单位合计"));
headerList.add(SalaryI18nUtil.getI18nLabel(100398, "社保合计"));
headerList.add(SalaryI18nUtil.getI18nLabel(100399, "公积金合计"));
headerList.add(SalaryI18nUtil.getI18nLabel(100400, "其他福利合计"));
headerList.add(SalaryI18nUtil.getI18nLabel(93278, "合计"));
List<List<Object>> rows = new ArrayList<>();
rows.add(headerList);
String sheetName = "福利核算-线下对比导入模板";
return ExcelUtil.genWorkbookV2(rows, sheetName);
}
/**
* 将通过福利核算-线下对比导入模板导入的数据更新到hrsa_excel_bill_detail表中
*/
@Override
public Map<String, Object> importExcelInsuranceDetail(ExcelInsuranceImportParam importParam) {
Map<String, Object> apidatas = new HashMap<String, Object>();
EmployBiz employBiz = new EmployBiz();
//查询对于人员信息导入筛选的全局配置
SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode");
String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0";
//检验参数
//excel文件id
String imageId = Util.null2String(importParam.getImageId());
if (StringUtils.isBlank(imageId)) {
throw new SalaryRunTimeException("文件不存在");
}
// 获取租户下所有的人员
List<DataCollectionEmployee> salaryEmployees = employBiz.listEmployee();
// 失败的数量
int failCount = 0;
// 成功的数量
int successCount = 0;
InputStream fileInputStream = null;
try {
fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(importParam.getImageId()));
Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX);
// 错误提示信息
List<Map> excelComments = Lists.newArrayList();
// 存在错误的那行数据
List<Map<String, Object>> errorDatas = Lists.newArrayList();
// 表头
List<String> headers = ExcelSupport.getSheetHeader(sheet, 0);
// 处理数值
List<Map<String, Object>> data = ExcelParseHelper.parse2Map(sheet, 1);
if (CollectionUtils.isEmpty(headers)) {
throw new RuntimeException("表头为空");
}
if (CollectionUtils.isEmpty(data)) {
throw new RuntimeException("无数据");
}
String billMonth = importParam.getBillMonth();
//存储待更新的InsuranceAccountDetailPO数据
List<ExcelInsuranceDetailPO> addCompareList = new ArrayList<>();
//记录待删除hrsa_excel_bill_detail.id
List<Long> idList = new ArrayList<>();
//遍历excel表具体数据
for (int i = 0; i < data.size(); i++) {
String row = "" + (i + 2) + "";
boolean isError = false;
Map<String, Object> map = data.get(i);
Long employeeId = 0L;
List<ExcelInsuranceDetailPO> list = new ArrayList<>();
String taxAgentName = (String) map.getOrDefault("个税扣缴义务人", "");
Long paymentOrganization = 0L;
List<TaxAgentPO> taxAgentPoList = getTaxAgentMapper().listByName(taxAgentName);
if (taxAgentPoList.size() == 1) {
paymentOrganization = taxAgentPoList.get(0).getId();
} else {
isError = true;
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, SalaryI18nUtil.getI18nLabel(102840, "个税扣缴义务人错误,系统内不存在该个税扣缴义务人")));
excelComments.add(errorMessageMap);
}
//遍历表头
for (int j = 0; j < headers.size(); j++) {
String header = headers.get(j);
String dataKey = header;
if (dataKey == null) {
continue;
}
String dataValue = (String) map.getOrDefault(dataKey.toString(), "");
String deparmentName = (String) map.getOrDefault("部门", "");
String mobile = (String) map.getOrDefault("手机号", "");
String workcode = (String) map.getOrDefault("工号", "");
if (StringUtils.equals(SalaryI18nUtil.getI18nLabel(85429, "姓名"), dataKey.toString())) {
//当人员信息导入筛选的全局配置为"0"姓名才是必填项
if (StringUtils.isEmpty(dataValue) && "0".equals(confValue)) {
isError = true;
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(102838, "姓名不能为空"));
excelComments.add(errorMessageMap);
} else {
//筛选导入人员信息可以在人力资源池中匹配到的人员信息
List<DataCollectionEmployee> employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(salaryEmployees, dataValue, deparmentName, mobile, workcode, null);
if (CollectionUtils.isEmpty(employeeSameIds)) {
isError = true;
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, "姓名错误,系统内不存在该姓名"));
excelComments.add(errorMessageMap);
} else if (employeeSameIds.size() > 1) {
//存在离职和在职状态取在职状态
employeeSameIds = employeeSameIds.stream()
.filter(e -> UserStatusEnum.getNormalStatus().contains(e.getStatus()))
.collect(Collectors.toList());
if (employeeSameIds.size() != 1) {
isError = true;
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", row + "员工信息不存在或者存在多个员工");
excelComments.add(errorMessageMap);
} else {
employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0).getEmployeeId() : null;
}
} else {
employeeId = employeeSameIds.get(0).getEmployeeId();
}
}
}
}
if (!isError){
List<Long> employeeIds = new ArrayList<>();
employeeIds.add(employeeId);
//根据员工id个税扣缴义务人id账单月份查询如果当前对比表中存在数据则记录为待删除数据
list = getExcelInsuranceDetailMapper().queryCompareList(billMonth, paymentOrganization, employeeIds.get(0));
if (!list.isEmpty()) {
List<Long> ids = list.stream().map(ExcelInsuranceDetailPO::getId)
.collect(Collectors.toList());
idList.addAll(ids);
}
//拼装待更新数据
addCompareList.add(handleExcelInsuranceDetail(billMonth, employeeId, paymentOrganization, map));
}
if (isError) {
failCount++;
errorDatas.add(map);
} else {
successCount++;
}
}
//将待更新列表加密
ExcelInsuranceDetailPOEncrypt.encryptInsuranceAccountDetailPOList(addCompareList);
//删除
if (idList.size() > 0) {
getExcelInsuranceDetailMapper().batchDelByIds(idList);
}
//新增
getExcelInsuranceDetailMapper().batchSave(addCompareList);
apidatas.put("successCount", successCount);
apidatas.put("errorCount", failCount);
apidatas.put("errorData", excelComments);
} finally {
IOUtils.closeQuietly(fileInputStream);
}
return apidatas;
}
/**
* 将excel导入的数据行组装成ExcelInsuranceDetailPO对象
* @param billMonth 对比的账单月份
* @param baseMap excel导入的对比数据
*/
private ExcelInsuranceDetailPO handleExcelInsuranceDetail(String billMonth, Long employeeId, Long paymentOrganization, Map<String, Object> baseMap) {
ExcelInsuranceDetailPO excelInsuranceDetailPO = new ExcelInsuranceDetailPO();
excelInsuranceDetailPO.setId(IdGenerator.generate());
//组装json数据,格式Map<String, Object>
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<>();
//组装福利基数
Map<String, String> socialPaymentBaseMap = new HashMap<>();
Map<String, String> fundPaymentBaseMap = new HashMap<>();
Map<String, String> otherPaymentBaseMap = new HashMap<>();
//筛选出福利核算项
Map<String, Object> toDealMap =
baseMap.entrySet().stream()
.filter(map -> !"姓名".equals(map.getKey())
&& !"部门".equals(map.getKey())
&& !"手机号".equals(map.getKey())
&& !"个税扣缴义务人".equals(map.getKey())
&& !"员工状态".equals(map.getKey())
&& !"数据来源".equals(map.getKey())
&& !"工号".equals(map.getKey()))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
for(Map.Entry<String, Object> entry : toDealMap.entrySet()) {
//判断元素是否属于福利类
String keyName = entry.getKey();
//获取元素名后缀方便之后判断个人单位或者基数
String payScope = keyName.substring(keyName.length() - 2);
//获取福利类型
Integer welfareType;
//根据元素名后缀区分截取内容
String targetWelfareName;
if ("基数".equals(payScope)) {
targetWelfareName = entry.getKey().substring(0, keyName.length() - 4);
} else {
targetWelfareName = entry.getKey().substring(0, keyName.length() - 2);
}
List<ICategoryPO> categoryPOList = siCategoryBiz.listByName(targetWelfareName);
if (categoryPOList.size() == 1) {
ICategoryPO iCategoryPO = categoryPOList.get(0);
welfareType = iCategoryPO.getWelfareType();
switch (payScope) {
case "个人":
switch (welfareType) {
case 1:
socialPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString());
break;
case 2:
fundPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString());
break;
case 3:
otherPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString());
break;
default:
throw new SalaryRunTimeException("福利类型不存在");
}
break;
case "单位":
switch (welfareType) {
case 1:
socialComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString());
break;
case 2:
fundComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString());
break;
case 3:
otherComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString());
break;
default:
throw new SalaryRunTimeException("福利类型不存在");
}
break;
case "基数":
switch (welfareType) {
case 1:
socialPaymentBaseMap.put(iCategoryPO.getId().toString(), entry.getValue().toString());
break;
case 2:
fundPaymentBaseMap.put(iCategoryPO.getId().toString(), entry.getValue().toString());
break;
case 3:
otherPaymentBaseMap.put(iCategoryPO.getId().toString(), entry.getValue().toString());
break;
default:
throw new SalaryRunTimeException("福利类型不存在");
}
break;
}
}
}
//设置社保个人和公司缴纳明细
excelInsuranceDetailPO.setSocialPerJson(JSON.toJSONString(socialPerMap));
excelInsuranceDetailPO.setSocialComJson(JSON.toJSONString(socialComMap));
//设置公积金个人和公司缴纳明细
excelInsuranceDetailPO.setFundPerJson(JSON.toJSONString(fundPerMap));
excelInsuranceDetailPO.setFundComJson(JSON.toJSONString(fundComMap));
//设置其他福利个人和公司缴纳明细
excelInsuranceDetailPO.setOtherPerJson(JSON.toJSONString(otherPerMap));
excelInsuranceDetailPO.setOtherComJson(JSON.toJSONString(otherComMap));
//设置社保公积金其他福利缴纳基数
excelInsuranceDetailPO.setSocialPaymentBaseString(JSON.toJSONString(socialPaymentBaseMap));
excelInsuranceDetailPO.setFundPaymentBaseString(JSON.toJSONString(fundPaymentBaseMap));
excelInsuranceDetailPO.setOtherPaymentBaseString(JSON.toJSONString(otherPaymentBaseMap));
//组装新的insuranceAccountDetailPO对象数据
excelInsuranceDetailPO.setEmployeeId(employeeId);
excelInsuranceDetailPO.setBillMonth(billMonth);
excelInsuranceDetailPO.setBillStatus(1);
excelInsuranceDetailPO.setPaymentStatus(0);
excelInsuranceDetailPO.setResourceFrom(1);
excelInsuranceDetailPO.setSocialAccount(baseMap.getOrDefault("社保账号", "").toString());
if (baseMap.getOrDefault("社保方案名称", "") != null) {
List<InsuranceSchemePO> socialSchemeList = getInsuranceSchemeMapper().listByName(baseMap.get("社保方案名称").toString());
if (socialSchemeList.size() == 1) {
//设置社保方案id
excelInsuranceDetailPO.setSocialSchemeId(socialSchemeList.get(0).getId());
}
}
excelInsuranceDetailPO.setFundAccount(baseMap.getOrDefault("公积金账号", "").toString());
excelInsuranceDetailPO.setSupplementFundAccount(baseMap.getOrDefault("补充公积金账号", "").toString());
if (baseMap.getOrDefault("公积金方案名称", "") != null) {
List<InsuranceSchemePO> fundSchemeList = getInsuranceSchemeMapper().listByName(baseMap.get("公积金方案名称").toString());
if (fundSchemeList.size() == 1) {
//设置公积金方案id
excelInsuranceDetailPO.setFundSchemeId(fundSchemeList.get(0).getId());
}
}
if (baseMap.getOrDefault("其他福利方案名称", "") != null) {
List<InsuranceSchemePO> otherSchemeList = getInsuranceSchemeMapper().listByName(baseMap.get("其他福利方案名称").toString());
if (otherSchemeList.size() == 1) {
//其他福利方案id
excelInsuranceDetailPO.setOtherSchemeId(otherSchemeList.get(0).getId());
}
}
excelInsuranceDetailPO.setSocialPerSum(baseMap.getOrDefault("社保个人合计", "").toString());
excelInsuranceDetailPO.setFundPerSum(baseMap.getOrDefault("公积金个人合计", "").toString());
excelInsuranceDetailPO.setOtherPerSum(baseMap.getOrDefault("其他福利个人合计", "").toString());
excelInsuranceDetailPO.setPerSum(baseMap.getOrDefault("个人合计", "").toString());
excelInsuranceDetailPO.setSocialComSum(baseMap.getOrDefault("社保单位合计", "").toString());
excelInsuranceDetailPO.setFundComSum(baseMap.getOrDefault("公积金单位合计", "").toString());
excelInsuranceDetailPO.setOtherComSum(baseMap.getOrDefault("其他福利单位合计", "").toString());
excelInsuranceDetailPO.setComSum(baseMap.getOrDefault("单位合计", "").toString());
excelInsuranceDetailPO.setSocialSum(baseMap.getOrDefault("社保合计", "").toString());
excelInsuranceDetailPO.setFundSum(baseMap.getOrDefault("公积金合计", "").toString());
excelInsuranceDetailPO.setOtherSum(baseMap.getOrDefault("其他福利合计", "").toString());
excelInsuranceDetailPO.setTotal(baseMap.getOrDefault("合计", "").toString());
excelInsuranceDetailPO.setCreator((long) user.getUID());
excelInsuranceDetailPO.setCreateTime(new Date());
excelInsuranceDetailPO.setUpdateTime(new Date());
excelInsuranceDetailPO.setDeleteType(0);
excelInsuranceDetailPO.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY);
excelInsuranceDetailPO.setPaymentOrganization(paymentOrganization);
return excelInsuranceDetailPO;
}
}

View File

@ -173,6 +173,7 @@ public class SIExportServiceImpl extends Service implements SIExportService {
record.put("department", item.getDepartmentName());
record.put("supplementaryMonth", item.getSupplementaryMonth());
record.put("mobile", item.getTelephone());
record.put("workcode", item.getWorkcode());
record.put("employeeStatus", item.getUserStatus() == null ? "" : getDefaultLabelByValue(item.getUserStatus()));
ResourceFromEnum from = SalaryEnumUtil.enumMatchByValue(item.getResourceFrom(), ResourceFromEnum.values(), ResourceFromEnum.class);
record.put("sourceFrom", SalaryI18nUtil.getI18nLabel(from.getLabelId(), from.getDefaultLabel()));
@ -418,6 +419,7 @@ public class SIExportServiceImpl extends Service implements SIExportService {
list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(85429, "姓名"), "userName"));
list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(86185, "部门"), "department"));
list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(86186, "手机号"), "mobile"));
list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(86317, "工号"), "workcode"));
list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(86187, "员工状态"), "employeeStatus"));
list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(100377, "数据来源"), "sourceFrom"));
if (flag) {

View File

@ -140,8 +140,8 @@ public class SIImportServiceImpl extends Service implements SIImportService {
// 4.注释
List<ExcelComment> excelComments = Lists.newArrayList();
excelComments.add(new ExcelComment(0, 0, 3, 2, SalaryI18nUtil.getI18nLabel(100344, "必填")));
excelComments.add(new ExcelComment(4, 0, 5, 2, SalaryI18nUtil.getI18nLabel(100344, "必填")));
excelComments.add(new ExcelComment(5, 0, 6, 2, SalaryI18nUtil.getI18nLabel(100344, "社保,公积金,其他福利方案名称不可同时为空")));
excelComments.add(new ExcelComment(5, 0, 6, 2, SalaryI18nUtil.getI18nLabel(100344, "必填")));
excelComments.add(new ExcelComment(6, 0, 7, 2, SalaryI18nUtil.getI18nLabel(100344, "社保,公积金,其他福利方案名称不可同时为空")));
//工作簿数据

View File

@ -278,12 +278,14 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
Map<String, Object> map = new HashMap<>();
Map<Long, List<SalaryAcctResultPO>> acctResultMap = SalaryEntityUtil.group2Map(salaryAcctResultPOS, SalaryAcctResultPO::getSalaryItemId);
salaryItemPOS.stream().filter(item -> SalaryDataTypeEnum.NUMBER.getValue().equals(item.getDataType())).forEach(item -> {
BigDecimal sum = acctResultMap.get(item.getId()).stream()
BigDecimal sum = Optional.ofNullable(acctResultMap.get(item.getId()))
.orElse(new ArrayList<>())
.stream()
.map(SalaryAcctResultPO::getResultValue)
.filter(NumberUtils::isCreatable)
.map(BigDecimal::new)
.reduce(BigDecimal.ZERO, BigDecimal::add);
map.put(item.getId().toString(), SalaryAcctFormulaBO.roundResultValue(sum.toString(),item));
map.put(item.getId().toString(), SalaryAcctFormulaBO.roundResultValue(sum.toString(), item));
});
return map;
}

View File

@ -85,9 +85,16 @@ public class TaxDeclarationDetailServiceImpl extends Service implements TaxDecla
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
queryParam.setOrderRule(orderRule);
SalaryPageUtil.start(queryParam.getCurrent(), queryParam.getPageSize());
// SalaryPageUtil.start(queryParam.getCurrent(), queryParam.getPageSize());
List<TaxDeclarationEmployeeDTO> taxDeclarationEmployeeDTOS = getTaxDeclarationDetailMapper().listPage4EmployeeId(queryParam);
return new PageInfo<>(taxDeclarationEmployeeDTOS, TaxDeclarationEmployeeDTO.class);
taxDeclarationEmployeeDTOS = taxDeclarationEmployeeDTOS.stream().filter(SalaryEntityUtil.distinctByKey(TaxDeclarationEmployeeDTO::getEmployeeId)).collect(Collectors.toList());
List<TaxDeclarationEmployeeDTO> list = SalaryPageUtil.subList(queryParam.getCurrent(), queryParam.getPageSize(), taxDeclarationEmployeeDTOS);
PageInfo<TaxDeclarationEmployeeDTO> pageInfo = new PageInfo<>(list, TaxDeclarationEmployeeDTO.class);
pageInfo.setPageNum(queryParam.getCurrent());
pageInfo.setPageSize(queryParam.getPageSize());
pageInfo.setTotal(taxDeclarationEmployeeDTOS.size());
return pageInfo;
}
@Override

View File

@ -12,7 +12,9 @@ import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collector;
import java.util.stream.Collectors;
@ -152,6 +154,28 @@ public class SalaryEntityUtil {
Collectors.collectingAndThen(Collectors.toList(), e -> e.stream().map(valueMapper).collect(Collectors.toList()))));
}
/**
* LinkedHashMap有序去重
* @param keyExtractor
* @param <T>
* @return
*/
public static <T> Predicate<T> distinctByKey(Function<? super T, Object> keyExtractor) {
LinkedHashMap<Object, Boolean> map = new LinkedHashMap<>();
return t -> map.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null;
}
/**
* ConcurrentHashMap无序去重
* @param keyExtractor
* @param <T>
* @return
*/
public static <T> Predicate<T> distinctByKeyMap(Function<? super T, Object> keyExtractor) {
ConcurrentHashMap<Object, Boolean> map = new ConcurrentHashMap<>();
return t -> map.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null;
}
public static <T> BigDecimal reduce(Collection<T> objs, Function<T, BigDecimal> function) {
if (CollectionUtils.isEmpty(objs)) {
return BigDecimal.ZERO;

View File

@ -11,6 +11,7 @@ import com.engine.salary.entity.taxagent.po.TaxAgentPO;
import com.engine.salary.service.impl.SIAccountServiceImpl;
import com.engine.salary.util.ResponseResult;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.wrapper.SIAComparisonResultWrapper;
import com.engine.salary.wrapper.SIAccountWrapper;
import com.engine.salary.wrapper.SalaryFormulaWrapper;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
@ -56,6 +57,11 @@ public class SIAccountController {
private SalaryFormulaWrapper getSalaryFormulaWrapper(User user) {
return (SalaryFormulaWrapper) ServiceUtil.getService(SalaryFormulaWrapper.class, user);
}
private SIAComparisonResultWrapper getSIAComparisonResultWrapper(User user) {
return (SIAComparisonResultWrapper) ServiceUtil.getService(SIAComparisonResultWrapper.class, user);
}
/**
* 获取台账列表页
*
@ -409,6 +415,8 @@ public class SIAccountController {
try {
InsuranceAcctDetailImportTemplateParam param = new InsuranceAcctDetailImportTemplateParam();
param.setPaymentOrganization(Long.valueOf(request.getParameter("paymentOrganization")));
param.setBillMonth(request.getParameter("billMonth"));
String welfareNames = request.getParameter("welfareNames");
if (StringUtils.isNotBlank(welfareNames)) {
param.setWelfareNames(Arrays.stream(welfareNames.split(",")).map(String::valueOf).collect(Collectors.toList()));
@ -503,5 +511,105 @@ public class SIAccountController {
}
// **********************************线下对比 start*********************************/
/**
* 导出福利核算导入模板
*/
@GET
@Path("/comparisonwelfare/importtemplate/export")
@Produces(MediaType.APPLICATION_OCTET_STREAM)
public Response exportComparisonWelfareTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
InsuranceAcctDetailImportTemplateParam param = new InsuranceAcctDetailImportTemplateParam();
// String welfareNames = request.getParameter("welfareNames");
// if (StringUtils.isNotBlank(welfareNames)) {
// param.setWelfareNames(Arrays.stream(welfareNames.split(",")).map(String::valueOf).collect(Collectors.toList()));
// }
User user = HrmUserVarify.getUser(request, response);
XSSFWorkbook workbook = getService(user).exportComparisonWelfareTemplate(param);
String time = LocalDate.now().toString();
String fileName = "福利核算-线下对比导入模板" + time;
try {
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
StreamingOutput output = outputStream -> {
workbook.write(outputStream);
outputStream.flush();
};
response.setContentType("application/octet-stream");
return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build();
} catch (Exception e) {
log.error("福利核算-线下对比导入模板导出异常", e);
throw e;
}
}
/**
* 将通过福利核算-线下对比导入模板导入的数据更新到hrsa_excel_bill_detail表中
*/
@POST
@Path("/comparisonwelfare/importExcelInsuranceDetail")
@Produces(MediaType.APPLICATION_JSON)
public String importExcelInsuranceDetail(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ExcelInsuranceImportParam excelInsuranceImportParam) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<ExcelInsuranceImportParam, Map<String, Object>>(user).run(getService(user)::importExcelInsuranceDetail, excelInsuranceImportParam);
}
//福利核算-线上线下对比结果列表
@POST
@Path("/comparisonwelfare/list")
@Produces(MediaType.APPLICATION_JSON)
public String listComparisonResult(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody InsuranceComparisonResultQueryParam param) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<InsuranceComparisonResultQueryParam, PageInfo<Map<String, Object>>>(user).run(getSIAComparisonResultWrapper(user)::listPage, param);
}
//导出福利核算-线上线下对比结果
@GET
@Path("/comparisonresult/export")
@Produces(MediaType.APPLICATION_OCTET_STREAM)
public Response exportComparisonResult(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
InsuranceComparisonResultQueryParam param = new InsuranceComparisonResultQueryParam();
param.setPaymentStatus(Integer.valueOf(request.getParameter("paymentStatus")));
param.setBillMonth(request.getParameter("billMonth"));
param.setPaymentOrganization(request.getParameter("paymentOrganization"));
String onlyDiffEmployee = request.getParameter("onlyDiffEmployee");
if (StringUtils.isNotBlank(onlyDiffEmployee)) {
param.setOnlyDiffEmployee(Boolean.parseBoolean(onlyDiffEmployee));
}
String userName = request.getParameter("userName");
if (StringUtils.isNotBlank(userName)) {
param.setUserName(userName);
}
User user = HrmUserVarify.getUser(request, response);
XSSFWorkbook workbook = getSIAComparisonResultWrapper(user).exportComparisonResult(param);
String time = LocalDate.now().toString();
String fileName = "福利核算-线下对比结果" + time;
try {
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
StreamingOutput output = outputStream -> {
workbook.write(outputStream);
outputStream.flush();
};
response.setContentType("application/octet-stream");
return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build();
} catch (Exception e) {
log.error("福利核算-线下对比结果导出异常", e);
throw e;
}
}
// **********************************线下对比 end*********************************/
}

View File

@ -2,7 +2,6 @@ package com.engine.salary.wrapper;
import com.api.browser.bean.SearchConditionGroup;
import com.api.browser.bean.SearchConditionItem;
import com.api.browser.bean.SearchConditionOption;
import com.api.browser.util.ConditionFactory;
import com.api.browser.util.ConditionType;
import com.engine.common.util.ServiceUtil;
@ -23,7 +22,6 @@ import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.page.PageInfo;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import weaver.hrm.User;
import weaver.systeminfo.SystemEnv;
import java.util.ArrayList;
import java.util.HashMap;
@ -91,37 +89,37 @@ public class OtherDeductionWrapper extends Service {
conditionItems.add(jobNum);
SearchConditionItem idNo = conditionFactory.createCondition(ConditionType.INPUT, 25034, "idNo");
idNo.setInputType("input");
idNo.setColSpan(2);
idNo.setFieldcol(16);
idNo.setLabelcol(8);
idNo.setViewAttr(2);
idNo.setLabel("证件号码");
conditionItems.add(idNo);
//日期范围选项
List<SearchConditionOption> dateOptions = new ArrayList<SearchConditionOption>();
dateOptions.add(new SearchConditionOption("6", SystemEnv.getHtmlLabelName(32530, user.getLanguage()), true));//指定日期范围(必须为6)
SearchConditionItem hiredate = conditionFactory.createCondition(ConditionType.RANGEPICKER, 18648, new String[]{"hiredate", "hiredate"});
hiredate.setInputType("rangepicker");
hiredate.setFormat("yyyy-MM-dd");
hiredate.setFieldcol(16);
hiredate.setLabelcol(8);
hiredate.setViewAttr(2);
hiredate.setLabel("入职日期");
hiredate.setOptions(dateOptions);
conditionItems.add(hiredate);
SearchConditionItem mobile = conditionFactory.createCondition(ConditionType.INPUT, 25034, "mobile");
mobile.setInputType("input");
mobile.setColSpan(2);
mobile.setFieldcol(16);
mobile.setLabelcol(8);
mobile.setViewAttr(2);
mobile.setLabel("手机号");
conditionItems.add(mobile);
// SearchConditionItem idNo = conditionFactory.createCondition(ConditionType.INPUT, 25034, "idNo");
// idNo.setInputType("input");
// idNo.setColSpan(2);
// idNo.setFieldcol(16);
// idNo.setLabelcol(8);
// idNo.setViewAttr(2);
// idNo.setLabel("证件号码");
// conditionItems.add(idNo);
//
// //日期范围选项
// List<SearchConditionOption> dateOptions = new ArrayList<SearchConditionOption>();
// dateOptions.add(new SearchConditionOption("6", SystemEnv.getHtmlLabelName(32530, user.getLanguage()), true));//指定日期范围(必须为6)
// SearchConditionItem hiredate = conditionFactory.createCondition(ConditionType.RANGEPICKER, 18648, new String[]{"hiredate", "hiredate"});
// hiredate.setInputType("rangepicker");
// hiredate.setFormat("yyyy-MM-dd");
// hiredate.setFieldcol(16);
// hiredate.setLabelcol(8);
// hiredate.setViewAttr(2);
// hiredate.setLabel("入职日期");
// hiredate.setOptions(dateOptions);
// conditionItems.add(hiredate);
//
//
// SearchConditionItem mobile = conditionFactory.createCondition(ConditionType.INPUT, 25034, "mobile");
// mobile.setInputType("input");
// mobile.setColSpan(2);
// mobile.setFieldcol(16);
// mobile.setLabelcol(8);
// mobile.setViewAttr(2);
// mobile.setLabel("手机号");
// conditionItems.add(mobile);
addGroups.add(new SearchConditionGroup("常用条件", true, conditionItems));

View File

@ -0,0 +1,55 @@
package com.engine.salary.wrapper;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.entity.salaryacct.dto.SalaryComparisonResultListDTO;
import com.engine.salary.entity.salaryacct.param.SalaryComparisonResultQueryParam;
import com.engine.salary.entity.siaccount.dto.InsuranceComparisonResultListDTO;
import com.engine.salary.entity.siaccount.param.InsuranceComparisonResultQueryParam;
import com.engine.salary.service.SIAComparisonResultService;
import com.engine.salary.service.SalaryComparisonResultService;
import com.engine.salary.service.impl.SIAComparisonResultServiceImpl;
import com.engine.salary.service.impl.SalaryComparisonResultServiceImpl;
import com.engine.salary.util.page.PageInfo;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import weaver.hrm.User;
import java.util.Map;
/**
* @Author: sy
* @Description: 福利核算线下对比结果
* @Date: 2022/9/28
**/
public class SIAComparisonResultWrapper extends Service {
private SIAComparisonResultService getSIAComparisonResultService(User user) {
return (SIAComparisonResultService) ServiceUtil.getService(SIAComparisonResultServiceImpl.class, user);
}
/**
* 福利核算线下对比列表
*
* @param queryParam 列表查询条件
* @return
*/
public PageInfo<Map<String, Object>> listPage(InsuranceComparisonResultQueryParam queryParam) {
// 查询薪资核算线下对比列表
InsuranceComparisonResultListDTO salaryComparisonResultListDTO = getSIAComparisonResultService(user).listPageByParam(queryParam);
PageInfo<Map<String, Object>> pageInfo = salaryComparisonResultListDTO.getData();
pageInfo.setColumns(salaryComparisonResultListDTO.getWeaTableColumns());
return pageInfo;
}
/**
* 导出福利核算线下对比结果
*
* @param queryParam 列表查询条件
* @return
*/
public XSSFWorkbook exportComparisonResult(InsuranceComparisonResultQueryParam queryParam) {
return getSIAComparisonResultService(user).exportComparisonResult( queryParam);
}
}

View File

@ -94,6 +94,12 @@ public class SalaryItemWrapper extends Service {
List<SysSalaryItemPO> sysSalaryItemPOS = getSysSalaryItemService(user).listByIds(sysSalaryItemIds);
// 转换成薪资项目列表dto
List<SalaryItemListDTO> salaryItemListDTOS = SalaryItemBO.convert2ListDTO(salaryItemList, expressFormulas, sysSalaryItemPOS);
//薪资档案引用时不能删除
salaryItemListDTOS.forEach(dto -> {
if (dto.getUseInEmployeeSalary() == 1) {
dto.setCanDelete(false);
}
});
//3被引用的薪资项目不能删除
Set<Long> salaryItemIds = SalaryEntityUtil.properties(salaryItemList, SalaryItemPO::getId);
salarySobItems = getSalarySobItemService(user).listBySalaryItemIds(salaryItemIds);

View File

@ -236,7 +236,7 @@ public class SalarySendWrapper extends Service {
conditionItems.add(position);
//状态
SearchConditionItem status = conditionFactory.createCondition(ConditionType.SELECT, 25034, "taxAgent");
SearchConditionItem status = conditionFactory.createCondition(ConditionType.SELECT, 25034, "userstatus");
status.setColSpan(2);//定义一行显示条件数默认值为2,当值为1时标识该条件单独占一行
status.setFieldcol(16); //条件输入框所占宽度默认值18
status.setLabelcol(8);
@ -248,19 +248,19 @@ public class SalarySendWrapper extends Service {
status.setLabel("状态"); //设置文本值 这个将覆盖多语言标签的值
conditionItems.add(status);
//入职日期
SearchConditionItem hiredate = conditionFactory.createCondition(ConditionType.RANGEPICKER, 25034, "hiredate");
hiredate.setColSpan(2);//定义一行显示条件数默认值为2,当值为1时标识该条件单独占一行
hiredate.setFieldcol(16); //条件输入框所占宽度默认值18
hiredate.setLabelcol(8);
hiredate.setViewAttr(2); // 编辑权限 1只读2可编辑 3必填 默认2
Map<String, Object> otherParams1 = new HashMap<String, Object>();
otherParams1.put("format", "yyyy-MM-dd");
hiredate.setOtherParams(otherParams1);
hiredate.setInputType("day");
hiredate.setMode("day");
hiredate.setLabel("入职日期"); //设置文本值 这个将覆盖多语言标签的值
conditionItems.add(hiredate);
// //入职日期
// SearchConditionItem hiredate = conditionFactory.createCondition(ConditionType.RANGEPICKER, 25034, "hiredate");
// hiredate.setColSpan(2);//定义一行显示条件数默认值为2,当值为1时标识该条件单独占一行
// hiredate.setFieldcol(16); //条件输入框所占宽度默认值18
// hiredate.setLabelcol(8);
// hiredate.setViewAttr(2); // 编辑权限 1只读2可编辑 3必填 默认2
// Map<String, Object> otherParams1 = new HashMap<String, Object>();
// otherParams1.put("format", "yyyy-MM-dd");
// hiredate.setOtherParams(otherParams1);
// hiredate.setInputType("day");
// hiredate.setMode("day");
// hiredate.setLabel("入职日期"); //设置文本值 这个将覆盖多语言标签的值
// conditionItems.add(hiredate);
//发送状态
SearchConditionItem sendStatus = conditionFactory.createCondition(ConditionType.SELECT, 25034, "sendStatus");
@ -417,7 +417,7 @@ public class SalarySendWrapper extends Service {
conditionItems.add(position);
//状态
SearchConditionItem status = conditionFactory.createCondition(ConditionType.SELECT, 25034, "taxAgent");
SearchConditionItem status = conditionFactory.createCondition(ConditionType.SELECT, 25034, "userstatus");
status.setColSpan(2);//定义一行显示条件数默认值为2,当值为1时标识该条件单独占一行
status.setFieldcol(16); //条件输入框所占宽度默认值18
status.setLabelcol(8);
@ -429,19 +429,19 @@ public class SalarySendWrapper extends Service {
status.setLabel("状态"); //设置文本值 这个将覆盖多语言标签的值
conditionItems.add(status);
//入职日期
SearchConditionItem hiredate = conditionFactory.createCondition(ConditionType.RANGEPICKER, 25034, "hiredate");
hiredate.setColSpan(2);//定义一行显示条件数默认值为2,当值为1时标识该条件单独占一行
hiredate.setFieldcol(16); //条件输入框所占宽度默认值18
hiredate.setLabelcol(8);
hiredate.setViewAttr(2); // 编辑权限 1只读2可编辑 3必填 默认2
Map<String, Object> otherParams1 = new HashMap<String, Object>();
otherParams1.put("format", "yyyy-MM-dd");
hiredate.setOtherParams(otherParams1);
hiredate.setInputType("day");
hiredate.setMode("day");
hiredate.setLabel("入职日期"); //设置文本值 这个将覆盖多语言标签的值
conditionItems.add(hiredate);
// //入职日期
// SearchConditionItem hiredate = conditionFactory.createCondition(ConditionType.RANGEPICKER, 25034, "hiredate");
// hiredate.setColSpan(2);//定义一行显示条件数默认值为2,当值为1时标识该条件单独占一行
// hiredate.setFieldcol(16); //条件输入框所占宽度默认值18
// hiredate.setLabelcol(8);
// hiredate.setViewAttr(2); // 编辑权限 1只读2可编辑 3必填 默认2
// Map<String, Object> otherParams1 = new HashMap<String, Object>();
// otherParams1.put("format", "yyyy-MM-dd");
// hiredate.setOtherParams(otherParams1);
// hiredate.setInputType("day");
// hiredate.setMode("day");
// hiredate.setLabel("入职日期"); //设置文本值 这个将覆盖多语言标签的值
// conditionItems.add(hiredate);
//合并计税
SearchConditionItem mergeCountTax = conditionFactory.createCondition(ConditionType.CHECKBOX, 25034, "mergeCountTax");