Merge branch 'release/3.0.0.2311.01' into release/个税版本

# Conflicts:
#	src/com/engine/salary/service/SalaryEmployeeService.java
#	src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java
#	src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java
This commit is contained in:
钱涛 2023-11-08 16:20:31 +08:00
commit 75717871d0
56 changed files with 2632 additions and 174 deletions

View File

@ -0,0 +1,27 @@
CREATE TABLE hrsa_expand_field_settings (
id NUMBER(38,0) primary key NOT NULL,
module varchar2(100) NOT NULL ,
module_info varchar2(1000) ,
pk varchar2(100) NOT NULL,
expand_sql varchar2(4000) NOT NULL ,
field_setting varchar2(4000) NOT NULL,
create_time date DEFAULT sysdate,
update_time date DEFAULT sysdate,
creator NUMBER(38,0) NOT NULL ,
delete_type number NOT NULL ,
tenant_key varchar2(10) NOT NULL
);
/
ALTER TABLE hrsa_salary_statistics_item ADD last_rule VARCHAR2(500) NULL;
/
ALTER TABLE hrsa_salary_statistics_item ADD old_rule VARCHAR2(500) NULL;
/
ALTER TABLE hrsa_salary_statistics_item ADD frequent_rule VARCHAR2(500) NULL;
/
ALTER TABLE hrsa_salary_statistics_item ADD tile_rule VARCHAR2(500) NULL;
/

View File

@ -0,0 +1,27 @@
CREATE TABLE hrsa_expand_field_settings (
id NUMBER(38,0) primary key NOT NULL,
module varchar2(100) NOT NULL ,
module_info varchar2(1000) ,
pk varchar2(100) NOT NULL,
expand_sql varchar2(4000) NOT NULL ,
field_setting varchar2(4000) NOT NULL,
create_time date DEFAULT sysdate,
update_time date DEFAULT sysdate,
creator NUMBER(38,0) NOT NULL ,
delete_type number NOT NULL ,
tenant_key varchar2(10) NOT NULL
);
/
ALTER TABLE hrsa_salary_statistics_item ADD last_rule VARCHAR2(500) NULL;
/
ALTER TABLE hrsa_salary_statistics_item ADD old_rule VARCHAR2(500) NULL;
/
ALTER TABLE hrsa_salary_statistics_item ADD frequent_rule VARCHAR2(500) NULL;
/
ALTER TABLE hrsa_salary_statistics_item ADD tile_rule VARCHAR2(500) NULL;
/

View File

@ -0,0 +1,27 @@
CREATE TABLE hrsa_expand_field_settings (
id NUMBER(38,0) primary key NOT NULL,
module varchar2(100) NOT NULL ,
module_info varchar2(1000) ,
pk varchar2(100) NOT NULL,
expand_sql varchar2(4000) NOT NULL ,
field_setting varchar2(4000) NOT NULL,
create_time date DEFAULT sysdate,
update_time date DEFAULT sysdate,
creator NUMBER(38,0) NOT NULL ,
delete_type number NOT NULL ,
tenant_key varchar2(10) NOT NULL
);
/
ALTER TABLE hrsa_salary_statistics_item ADD last_rule VARCHAR2(500) NULL;
/
ALTER TABLE hrsa_salary_statistics_item ADD old_rule VARCHAR2(500) NULL;
/
ALTER TABLE hrsa_salary_statistics_item ADD frequent_rule VARCHAR2(500) NULL;
/
ALTER TABLE hrsa_salary_statistics_item ADD tile_rule VARCHAR2(500) NULL;
/

View File

@ -0,0 +1,21 @@
CREATE TABLE hrsa_expand_field_settings (
id bigint(0) NOT NULL,
module varchar(100) NOT NULL ,
module_info varchar(1000) ,
pk varchar(100) NOT NULL,
expand_sql varchar(4000) NOT NULL ,
field_setting varchar(4000) NOT NULL,
create_time datetime(0) NOT NULL ,
update_time datetime(0) NOT NULL ,
creator bigint(0) NOT NULL ,
delete_type int(0) NOT NULL ,
tenant_key varchar(10) NOT NULL ,
PRIMARY KEY (id) USING BTREE
) ;
ALTER TABLE hrsa_salary_statistics_item
ADD COLUMN last_rule varchar(500) ,
ADD COLUMN old_rule varchar(500) ,
ADD COLUMN frequent_rule varchar(500) ,
ADD COLUMN tile_rule varchar(500) ;

View File

@ -0,0 +1,23 @@
CREATE TABLE hrsa_expand_field_settings (
id NUMBER(38,0) primary key NOT NULL,
module varchar2(100) NOT NULL ,
module_info varchar2(1000) ,
pk varchar2(100) NOT NULL,
expand_sql varchar2(4000) NOT NULL ,
field_setting varchar2(4000) NOT NULL,
create_time date DEFAULT sysdate,
update_time date DEFAULT sysdate,
creator NUMBER(38,0) NOT NULL ,
delete_type number NOT NULL ,
tenant_key varchar2(10) NOT NULL
)
/
ALTER TABLE hrsa_salary_statistics_item ADD last_rule VARCHAR2(500) NULL
/
ALTER TABLE hrsa_salary_statistics_item ADD old_rule VARCHAR2(500) NULL
/
ALTER TABLE hrsa_salary_statistics_item ADD frequent_rule VARCHAR2(500) NULL
/
ALTER TABLE hrsa_salary_statistics_item ADD tile_rule VARCHAR2(500) NULL
/

View File

@ -0,0 +1,20 @@
create table hrsa_expand_field_settings
(
id bigserial not null ,
module varchar(100) NOT NULL ,
module_info varchar(1000) ,
pk varchar(100) NOT NULL,
expand_sql varchar(4000) NOT NULL ,
field_setting varchar(4000) NOT NULL,
create_time timestamp,
update_time timestamp,
creator bigint NOT NULL ,
delete_type int NOT NULL ,
tenant_key varchar(10) NOT NULL ,
PRIMARY KEY ( id )
);
ALTER TABLE hrsa_salary_statistics_item ADD COLUMN last_rule varchar(500) NULL ;
ALTER TABLE hrsa_salary_statistics_item ADD COLUMN old_rule varchar(500) NULL ;
ALTER TABLE hrsa_salary_statistics_item ADD COLUMN frequent_rule varchar(500) NULL ;
ALTER TABLE hrsa_salary_statistics_item ADD COLUMN tile_rule varchar(500) NULL ;

View File

@ -0,0 +1,27 @@
CREATE TABLE hrsa_expand_field_settings (
id bigint NOT NULL,
module varchar(100) NOT NULL ,
module_info varchar(1000) NOT NULL ,
pk varchar(100) NULL DEFAULT NULL ,
expand_sql varchar(4000) NOT NULL ,
field_setting varchar(4000) NOT NULL,
create_time datetime NOT NULL ,
update_time datetime NOT NULL ,
creator bigint NOT NULL ,
delete_type int NOT NULL ,
tenant_key varchar(10) NOT NULL ,
PRIMARY KEY (id)
)
GO
ALTER TABLE hrsa_salary_statistics_item ADD last_rule varchar(500) NULL
GO
ALTER TABLE hrsa_salary_statistics_item ADD old_rule varchar(500) NULL
GO
ALTER TABLE hrsa_salary_statistics_item ADD frequent_rule varchar(500) NULL
GO
ALTER TABLE hrsa_salary_statistics_item ADD tile_rule varchar(500) NULL
GO

View File

@ -0,0 +1,27 @@
CREATE TABLE hrsa_expand_field_settings (
id NUMBER(38,0) primary key NOT NULL,
module varchar2(100) NOT NULL ,
module_info varchar2(1000) ,
pk varchar2(100) NOT NULL,
expand_sql varchar2(4000) NOT NULL ,
field_setting varchar2(4000) NOT NULL,
create_time date DEFAULT sysdate,
update_time date DEFAULT sysdate,
creator NUMBER(38,0) NOT NULL ,
delete_type number NOT NULL ,
tenant_key varchar2(10) NOT NULL
);
/
ALTER TABLE hrsa_salary_statistics_item ADD last_rule VARCHAR2(500) NULL;
/
ALTER TABLE hrsa_salary_statistics_item ADD old_rule VARCHAR2(500) NULL;
/
ALTER TABLE hrsa_salary_statistics_item ADD frequent_rule VARCHAR2(500) NULL;
/
ALTER TABLE hrsa_salary_statistics_item ADD tile_rule VARCHAR2(500) NULL;
/

View File

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

View File

@ -3,7 +3,6 @@ package com.engine.salary.encrypt;
import com.engine.salary.sys.constant.SalarySysConstant;
import com.engine.salary.sys.entity.po.SalarySysConfPO;
import com.engine.salary.sys.enums.OpenEnum;
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
import org.apache.commons.lang3.StringUtils;
import weaver.general.AES;
import weaver.general.BaseBean;
@ -20,7 +19,6 @@ public class AESEncryptUtil {
static BaseBean bb = new BaseBean();
static String aesEncryptScrect = bb.getPropValue("hrmSalary", "AESEncryptScrect");
static SalarySysConfServiceImpl salarySysConfService = new SalarySysConfServiceImpl();
/**
* AES加密
@ -61,8 +59,7 @@ public class AESEncryptUtil {
* @param encryptStr 加密字符串
* @return 解密字符串
*/
public static String closeEncryptSetting(String encryptStr) {
SalarySysConfPO sysConfPo = salarySysConfService.getOneByCode(SalarySysConstant.OPEN_APPLICATION_ENCRYPT);
public static String closeEncryptSetting(String encryptStr,SalarySysConfPO sysConfPo) {
if (encryptStr == null) {
return null;
} else {

View File

@ -6,6 +6,8 @@ import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Map;
/**
* 员工基本信息
* <p>Copyright: Copyright (c) 2022</p>
@ -108,5 +110,10 @@ public class DataCollectionEmployee {
//是否外部人员
private boolean extEmp;
/**
* 扩展数据
*/
private Map<String,String> extendData;
}

View File

@ -0,0 +1,53 @@
package com.engine.salary.entity.hrm.dto;
import com.engine.salary.util.valid.Modify;
import com.engine.salary.util.valid.ModifyTypeEnum;
import com.engine.salary.util.valid.ValueTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* 人员扩展参数
* <p>Copyright: Copyright (c) 2023</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class EmployeeInfoExpandDTO {
private Long id;
/**
* 功能模块
*/
private String module;
/**
* 模块信息
*/
private String moduleInfo;
/**
* 主键
*/
private String pk;
/**
* sql
*/
@Modify(modifyType = ModifyTypeEnum.RESTORE_SQL)
private String expandSql;
/**
* 字段设置
*/
@Modify(valueType = ValueTypeEnum.ARRAY)
private List<FieldSetting> fieldSettings;
}

View File

@ -0,0 +1,35 @@
package com.engine.salary.entity.hrm.dto;
import com.engine.salary.util.valid.Modify;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class FieldSetting {
/**
* 字段
*/
@Modify()
private String field;
/**
* 显示
*/
private String name;
/**
*
*/
private String value;
/**
* 排序
*/
private Integer index;
}

View File

@ -0,0 +1,74 @@
package com.engine.salary.entity.hrm.po;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Collection;
import java.util.Date;
/**
* 人员维度扩展表
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ExpandFieldSettingsPO {
private Long id;
/**
* 功能模块
*/
private String module;
/**
* 模块信息
*/
private String moduleInfo;
/**
* 主键
*/
private String pk;
/**
* sql
*/
private String expandSql;
/**
* 字段设置
*/
private String fieldSetting;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 创建人
*/
private Long creator;
/**
* 是否已删除0未删除1已删除
*/
private Integer deleteType;
/**
* 租户ID
*/
private String tenantKey;
//主键id集合
private Collection<Long> ids;
}

View File

@ -2,6 +2,8 @@ package com.engine.salary.entity.salaryformula.param;
import com.engine.salary.entity.salaryformula.po.FormulaVar;
import com.engine.salary.util.valid.DataCheck;
import com.engine.salary.util.valid.Modify;
import com.engine.salary.util.valid.ModifyTypeEnum;
import com.engine.salary.util.valid.RuntimeTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
@ -61,6 +63,7 @@ public class SalaryFormulaSaveParam {
* 公式内容
*/
@DataCheck(require = true,message = "公式内容为空")
@Modify(modifyType = ModifyTypeEnum.RESTORE_SQL)
private String formula;

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,73 @@
package com.engine.salary.mapper.hrm;
import com.engine.salary.entity.hrm.po.ExpandFieldSettingsPO;
import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List;
public interface ExpandFieldSettingsMapper {
/**
* 查询所有记录
*
* @return 返回集合没有返回空List
*/
List<ExpandFieldSettingsPO> listAll();
/**
* 条件查询
*
* @return 返回集合没有返回空List
*/
List<ExpandFieldSettingsPO> listSome(ExpandFieldSettingsPO expandFieldSettings);
/**
* 根据主键查询
*
* @param id 主键
* @return 返回记录没有返回null
*/
ExpandFieldSettingsPO getById(Long id);
/**
* 新增忽略null字段
*
* @param expandFieldSettings 新增的记录
* @return 返回影响行数
*/
int insertIgnoreNull(ExpandFieldSettingsPO expandFieldSettings);
/**
* 修改修改所有字段
*
* @param expandFieldSettings 修改的记录
* @return 返回影响行数
*/
int update(ExpandFieldSettingsPO expandFieldSettings);
/**
* 修改忽略null字段
*
* @param expandFieldSettings 修改的记录
* @return 返回影响行数
*/
int updateIgnoreNull(ExpandFieldSettingsPO expandFieldSettings);
/**
* 删除记录
*
* @param expandFieldSettings 待删除的记录
* @return 返回影响行数
*/
int delete(ExpandFieldSettingsPO expandFieldSettings);
/**
* 批量删除记录
* @param ids 主键id集合
*/
void deleteByIds(@Param("ids") Collection<Long> ids);
ExpandFieldSettingsPO getByModule(String module);
}

View File

@ -0,0 +1,259 @@
<?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.hrm.ExpandFieldSettingsMapper">
<resultMap id="BaseResultMap" type="com.engine.salary.entity.hrm.po.ExpandFieldSettingsPO">
<result column="id" property="id"/>
<result column="module" property="module"/>
<result column="module_info" property="moduleInfo"/>
<result column="pk" property="pk"/>
<result column="expand_sql" property="expandSql"/>
<result column="field_setting" property="fieldSetting"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
<result column="tenant_key" property="tenantKey"/>
</resultMap>
<!-- 表字段 -->
<sql id="baseColumns">
t
.
id
, t.module
, t.module_info
, t.pk
, t.expand_sql
, t.field_setting
, t.create_time
, t.update_time
, t.creator
, t.delete_type
, t.tenant_key
</sql>
<!-- 查询全部 -->
<select id="listAll" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
FROM hrsa_expand_field_settings t
WHERE delete_type = 0
</select>
<!-- 根据主键获取单条记录 -->
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
SELECT
<include refid="baseColumns"/>
FROM hrsa_expand_field_settings t
WHERE id = #{id} AND delete_type = 0
</select>
<!-- 条件查询 -->
<select id="listSome" resultMap="BaseResultMap"
parameterType="com.engine.salary.entity.hrm.po.ExpandFieldSettingsPO">
SELECT
<include refid="baseColumns"/>
FROM hrsa_expand_field_settings t
WHERE delete_type = 0
<if test="module != null">
AND module = #{module}
</if>
<if test="moduleInfo != null">
AND module_info = #{moduleInfo}
</if>
<if test="pk != null">
AND pk = #{pk}
</if>
<if test="expandSql != null">
AND expand_sql = #{expandSql}
</if>
<if test="fieldSetting != null">
AND field_setting = #{fieldSetting}
</if>
<if test="createTime != null">
AND create_time = #{createTime}
</if>
<if test="updateTime != null">
AND update_time = #{updateTime}
</if>
<if test="creator != null">
AND creator = #{creator}
</if>
<if test="deleteType != null">
AND delete_type = #{deleteType}
</if>
<if test="tenantKey != null">
AND tenant_key = #{tenantKey}
</if>
<if test="ids != null and ids.size()>0">
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
ORDER BY id DESC
</select>
<!-- 插入不为NULL的字段 -->
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.hrm.po.ExpandFieldSettingsPO">
INSERT INTO hrsa_expand_field_settings
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="module != null">
module,
</if>
<if test="moduleInfo != null">
module_info,
</if>
<if test="pk != null">
pk,
</if>
<if test="expandSql != null">
expand_sql,
</if>
<if test="fieldSetting != null">
field_setting,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="creator != null">
creator,
</if>
<if test="deleteType != null">
delete_type,
</if>
<if test="tenantKey != null">
tenant_key,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id},
</if>
<if test="module != null">
#{module},
</if>
<if test="moduleInfo != null">
#{moduleInfo},
</if>
<if test="pk != null">
#{pk},
</if>
<if test="expandSql != null">
#{expandSql},
</if>
<if test="fieldSetting != null">
#{fieldSetting},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
<if test="creator != null">
#{creator},
</if>
<if test="deleteType != null">
#{deleteType},
</if>
<if test="tenantKey != null">
#{tenantKey},
</if>
</trim>
</insert>
<!-- 更新,更新全部字段 -->
<update id="update" parameterType="com.engine.salary.entity.hrm.po.ExpandFieldSettingsPO">
UPDATE hrsa_expand_field_settings
<set>
module=#{module},
module_info=#{moduleInfo},
pk=#{pk},
expand_sql=#{expandSql},
field_setting=#{fieldSetting},
create_time=#{createTime},
update_time=#{updateTime},
creator=#{creator},
delete_type=#{deleteType},
tenant_key=#{tenantKey},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<!-- 更新不为NULL的字段 -->
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.hrm.po.ExpandFieldSettingsPO">
UPDATE hrsa_expand_field_settings
<set>
<if test="module != null">
module=#{module},
</if>
<if test="moduleInfo != null">
module_info=#{moduleInfo},
</if>
<if test="pk != null">
pk=#{pk},
</if>
<if test="expandSql != null">
expand_sql=#{expandSql},
</if>
<if test="fieldSetting != null">
field_setting=#{fieldSetting},
</if>
<if test="createTime != null">
create_time=#{createTime},
</if>
<if test="updateTime != null">
update_time=#{updateTime},
</if>
<if test="creator != null">
creator=#{creator},
</if>
<if test="deleteType != null">
delete_type=#{deleteType},
</if>
<if test="tenantKey != null">
tenant_key=#{tenantKey},
</if>
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<!-- 根据主键删除记录 -->
<delete id="delete">
UPDATE hrsa_expand_field_settings
SET delete_type=1
WHERE id = #{id}
AND delete_type = 0
</delete>
<delete id="deleteByIds">
UPDATE hrsa_expand_field_settings
SET delete_type = 1
WHERE delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</delete>
<!-- 根据主键获取单条记录 -->
<select id="getByModule" resultMap="BaseResultMap" >
SELECT
<include refid="baseColumns"/>
FROM hrsa_expand_field_settings t
WHERE module = #{module} AND delete_type = 0
</select>
</mapper>

View File

@ -19,6 +19,10 @@
<result column="tenant_key" property="tenantKey"/>
<result column="unit_type" property="unitType"/>
<result column="update_time" property="updateTime"/>
<result column="last_rule" property="lastRule"/>
<result column="old_rule" property="oldRule"/>
<result column="frequent_rule" property="frequentRule"/>
<result column="tile_rule" property="tileRule"/>
</resultMap>
<!-- 表字段 -->
@ -42,6 +46,10 @@
, t.tenant_key
, t.unit_type
, t.update_time
, t.last_rule
, t.old_rule
, t.frequent_rule
, t.tile_rule
</sql>
<!-- 查询全部 -->
@ -184,6 +192,18 @@
<if test="updateTime != null">
update_time,
</if>
<if test="lastRule != null">
last_rule,
</if>
<if test="oldRule != null">
old_rule,
</if>
<if test="frequentRule != null">
frequent_rule,
</if>
<if test="tileRule != null">
tile_rule,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="avgRule != null">
@ -237,6 +257,18 @@
<if test="updateTime != null">
#{updateTime},
</if>
<if test="lastRule != null">
#{lastRule},
</if>
<if test="oldRule != null">
#{oldRule},
</if>
<if test="frequentRule != null">
#{frequentRule},
</if>
<if test="tileRule != null">
#{tileRule},
</if>
</trim>
</insert>
@ -260,6 +292,10 @@
tenant_key=#{tenantKey},
unit_type=#{unitType},
update_time=#{updateTime},
last_rule=#{lastRule},
old_rule=#{oldRule},
frequent_rule=#{frequentRule},
tile_rule=#{tileRule},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
@ -317,6 +353,18 @@
<if test="updateTime != null">
update_time=#{updateTime},
</if>
<if test="lastRule != null">
last_rule=#{lastRule},
</if>
<if test="oldRule != null">
old_rule=#{oldRule},
</if>
<if test="frequentRule != null">
frequent_rule=#{frequentRule},
</if>
<if test="tileRule != null">
tile_rule=#{tileRule},
</if>
</set>
WHERE id = #{id} AND delete_type = 0
</update>

View File

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

View File

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

View File

@ -2,7 +2,10 @@ package com.engine.salary.report.entity.bo;
import com.alibaba.fastjson.JSON;
import com.cloudstore.eccom.pc.table.WeaTableColumn;
import com.engine.common.util.ServiceUtil;
import com.engine.salary.component.WeaTableColumnGroup;
import com.engine.salary.entity.hrm.dto.EmployeeInfoExpandDTO;
import com.engine.salary.entity.hrm.dto.FieldSetting;
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
import com.engine.salary.report.common.constant.SalaryStatisticsDimensionConstant;
import com.engine.salary.report.entity.dto.SalaryStatisticsItemRuleDTO;
@ -13,13 +16,17 @@ import com.engine.salary.report.entity.param.SalaryStatisticsReportDataQueryPara
import com.engine.salary.report.entity.po.SalaryStatisticsDimensionPO;
import com.engine.salary.report.entity.po.SalaryStatisticsItemPO;
import com.engine.salary.report.entity.po.SalaryStatisticsReportPO;
import com.engine.salary.report.enums.SalaryStatisticsItemStringRuleEnum;
import com.engine.salary.report.enums.UnitTypeEnum;
import com.engine.salary.report.service.SalaryStatisticsDimensionService;
import com.engine.salary.report.service.impl.SalaryStatisticsDimensionServiceImpl;
import com.engine.salary.report.util.ReportDataUtil;
import com.engine.salary.report.util.ReportTimeUtil;
import com.engine.salary.util.SalaryDateUtil;
import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.page.PageInfo;
import com.google.common.base.Joiner;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import org.apache.commons.collections4.CollectionUtils;
@ -27,6 +34,7 @@ import org.apache.commons.collections4.MapUtils;
import org.apache.commons.compress.utils.Lists;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import weaver.hrm.User;
import java.math.BigDecimal;
import java.math.RoundingMode;
@ -80,6 +88,10 @@ public class SalaryStatisticsReportBO {
public static final String G_YEAR = "year";
public static final String G_ITEM = "ITEM";
private static SalaryStatisticsDimensionService getSalaryStatisticsDimensionService() {
return ServiceUtil.getService(SalaryStatisticsDimensionServiceImpl.class, new User(1));
}
/**
* 参数转换
*
@ -172,6 +184,14 @@ public class SalaryStatisticsReportBO {
calculate4Min(result, item, nowDetail, lastDetail, sameDetail);
// 6.中位数规则数据处理
calculate4Median(result, item, nowDetail, lastDetail, sameDetail);
// 7.最近值
calculate4Last(result, item, nowDetail, lastDetail, sameDetail);
// 8.最久值
calculate4Old(result, item, nowDetail, lastDetail, sameDetail);
// 9.最频繁
calculate4Frequent(result, item, nowDetail, lastDetail, sameDetail);
// 10.平铺
calculate4Tile(result, item, nowDetail, lastDetail, sameDetail);
});
return result;
}
@ -479,6 +499,143 @@ public class SalaryStatisticsReportBO {
}
}
/**
* 最新的值
*
* @param result
* @param item
* @param nowDetail
* @param lastDetail
* @param sameDetail
*/
private static void calculate4Last(Map<String, String> result, SalaryStatisticsItemPO item, List<Map<String, String>> nowDetail, List<Map<String, String>> lastDetail, List<Map<String, String>> sameDetail) {
SalaryStatisticsItemRuleDTO lastRule = JSON.parseObject(item.getLastRule(), SalaryStatisticsItemRuleDTO.class);
if (lastRule == null || lastRule.getTotalValue() != 1) {
return;
}
String lastValue = "";
// 本期
if (lastRule.getTotalValue() == 1) {
List<String> decimalList = Lists.newArrayList();
if (StringUtils.isNotEmpty(item.getItemValue())) {
String[] itemValues = item.getItemValue().split(COMMA);
for (String itemId : itemValues) {
for (Map<String, String> x : nowDetail) {
if (MapUtils.isNotEmpty(x) && StringUtils.isNotBlank(x.get(itemId))) {
decimalList.add(x.get(itemId));
}
}
}
}
// 本期最近值
lastValue = last(decimalList);
nowAndRatio(result, item, lastRule, SalaryStatisticsItemStringRuleEnum.LAST.getValue(), lastValue);
}
}
/**
* 最旧的值
*
* @param result
* @param item
* @param nowDetail
* @param lastDetail
* @param sameDetail
*/
private static void calculate4Old(Map<String, String> result, SalaryStatisticsItemPO item, List<Map<String, String>> nowDetail, List<Map<String, String>> lastDetail, List<Map<String, String>> sameDetail) {
SalaryStatisticsItemRuleDTO oldRule = JSON.parseObject(item.getOldRule(), SalaryStatisticsItemRuleDTO.class);
if (oldRule == null || oldRule.getTotalValue() != 1) {
return;
}
String value = "";
// 本期
if (oldRule.getTotalValue() == 1) {
List<String> decimalList = Lists.newArrayList();
if (StringUtils.isNotEmpty(item.getItemValue())) {
String[] itemValues = item.getItemValue().split(COMMA);
for (String itemId : itemValues) {
for (Map<String, String> x : nowDetail) {
if (MapUtils.isNotEmpty(x) && StringUtils.isNotBlank(x.get(itemId))) {
decimalList.add(x.get(itemId));
}
}
}
}
// 本期最近值
value = old(decimalList);
nowAndRatio(result, item, oldRule, SalaryStatisticsItemStringRuleEnum.OLD.getValue(), value);
}
}
/**
* 最频繁
*
* @param result
* @param item
* @param nowDetail
* @param lastDetail
* @param sameDetail
*/
private static void calculate4Frequent(Map<String, String> result, SalaryStatisticsItemPO item, List<Map<String, String>> nowDetail, List<Map<String, String>> lastDetail, List<Map<String, String>> sameDetail) {
SalaryStatisticsItemRuleDTO frequentRule = JSON.parseObject(item.getOldRule(), SalaryStatisticsItemRuleDTO.class);
if (frequentRule == null || frequentRule.getTotalValue() != 1) {
return;
}
String value = "";
// 本期
if (frequentRule.getTotalValue() == 1) {
List<String> decimalList = Lists.newArrayList();
if (StringUtils.isNotEmpty(item.getItemValue())) {
String[] itemValues = item.getItemValue().split(COMMA);
for (String itemId : itemValues) {
for (Map<String, String> x : nowDetail) {
if (MapUtils.isNotEmpty(x) && StringUtils.isNotBlank(x.get(itemId))) {
decimalList.add(x.get(itemId));
}
}
}
}
// 本期最近值
value = frequent(decimalList);
nowAndRatio(result, item, frequentRule, SalaryStatisticsItemStringRuleEnum.FREQUENT.getValue(), value);
}
}
/**
* 平铺
*
* @param result
* @param item
* @param nowDetail
* @param lastDetail
* @param sameDetail
*/
private static void calculate4Tile(Map<String, String> result, SalaryStatisticsItemPO item, List<Map<String, String>> nowDetail, List<Map<String, String>> lastDetail, List<Map<String, String>> sameDetail) {
SalaryStatisticsItemRuleDTO tileRule = JSON.parseObject(item.getOldRule(), SalaryStatisticsItemRuleDTO.class);
if (tileRule == null || tileRule.getTotalValue() != 1) {
return;
}
String value = "";
// 本期
if (tileRule.getTotalValue() == 1) {
List<String> decimalList = Lists.newArrayList();
if (StringUtils.isNotEmpty(item.getItemValue())) {
String[] itemValues = item.getItemValue().split(COMMA);
for (String itemId : itemValues) {
for (Map<String, String> x : nowDetail) {
if (MapUtils.isNotEmpty(x) && StringUtils.isNotBlank(x.get(itemId))) {
decimalList.add(x.get(itemId));
}
}
}
}
// 本期最近值
value = tile(decimalList);
nowAndRatio(result, item, tileRule, SalaryStatisticsItemStringRuleEnum.TILE.getValue(), value);
}
}
/**
* 本期和占比赋值
*
@ -498,6 +655,21 @@ public class SalaryStatisticsReportBO {
}
}
/**
* 本期和占比赋值
*
* @param result
* @param item
* @param rule
* @param ruleKey
* @param sumDecimal
*/
private static void nowAndRatio(Map<String, String> result, SalaryStatisticsItemPO item, SalaryStatisticsItemRuleDTO rule, String ruleKey, String sumDecimal) {
String keyPrefix = item.getId().toString() + UD + ruleKey;
// 本期合计
result.put(keyPrefix + K_NOW, sumDecimal);
}
/**
* 环比赋值
*
@ -596,6 +768,64 @@ public class SalaryStatisticsReportBO {
}
}
/**
* 最新的值
*
* @param list
* @return
*/
public static String last(List<String> list) {
if (CollectionUtils.isEmpty(list)) {
return "";
}
return list.get(0);
}
/**
* 最旧的值
*
* @param list
* @return
*/
public static String old(List<String> list) {
if (CollectionUtils.isEmpty(list)) {
return "";
}
return list.get(list.size() - 1);
}
/**
* 最频繁
*
* @param list
* @return
*/
public static String frequent(List<String> list) {
if (CollectionUtils.isEmpty(list)) {
return "";
}
return list.stream()
.collect(Collectors.groupingBy(Function.identity(), Collectors.counting()))
.entrySet()
.stream()
.max(Map.Entry.comparingByValue())
.map(Map.Entry::getKey)
.orElse("");
}
/**
* 平铺
*
* @param list
* @return
*/
public static String tile(List<String> list) {
if (CollectionUtils.isEmpty(list)) {
return "";
}
return Joiner.on(",").join((Iterable<?>) list);
}
public static List<Map<String, String>> po2map(List<SalaryAcctEmployeePO> list, Map<Long, Map<String, String>> salaryAcctResultValueMap) {
if (CollectionUtils.isEmpty(list)) {
return new ArrayList<>();
@ -832,11 +1062,12 @@ public class SalaryStatisticsReportBO {
result.add(new WeaTableColumnGroup("150", dimensionName.getDimName(), "dimension"));
//人员维度新增部门和工号
if (SalaryStatisticsDimensionConstant.DM_EMPLOYEE.equals(dimensionName.getDimCode())) {
result.add(new WeaTableColumnGroup("150", "部门", "departmentName"));
result.add(new WeaTableColumnGroup("150", "工号", "workcode"));
}
//扩展维度属性
EmployeeInfoExpandDTO expandFieldSettings = getSalaryStatisticsDimensionService().getExpandFieldSettings("dim_" + dimensionName.getDimCode());
List<FieldSetting> fieldSettings = Optional.ofNullable(Optional.ofNullable(expandFieldSettings).orElse(new EmployeeInfoExpandDTO()).getFieldSettings()).orElse(new ArrayList<>());
fieldSettings.stream().sorted(Comparator.comparing(FieldSetting::getIndex)).forEach(setting -> {
result.add(new WeaTableColumnGroup("150", setting.getName(), setting.getField()));
});
Map<Long, SalaryStatisticsItemPO> itemMap = salaryStatisticsItemList.stream().collect(Collectors.toMap(SalaryStatisticsItemPO::getId, Function.identity()));
Map<Long, String> itemIdNameMap = salaryStatisticsItemList.stream().collect(LinkedHashMap::new, (map, item) -> map.put(item.getId(), item.getItemName()), LinkedHashMap::putAll);
@ -952,6 +1183,26 @@ public class SalaryStatisticsReportBO {
children.add(new WeaTableColumnGroup(COL_WIDTH, SalaryI18nUtil.getI18nLabel(174376, "中位数同比差值"), k + UD + MEDIAN + P_Y2Y_D_VALUE));
children.add(new WeaTableColumnGroup(COL_WIDTH, SalaryI18nUtil.getI18nLabel(174377, "中位数同比增幅"), k + UD + MEDIAN + P_Y2Y_INCREASE));
}
// 7.最新值children
SalaryStatisticsItemRuleDTO lastRule = JSON.parseObject(itemPO.getLastRule(), SalaryStatisticsItemRuleDTO.class);
if (lastRule != null && 1 == lastRule.getTotalValue()) {
children.add(new WeaTableColumnGroup(COL_WIDTH, SalaryI18nUtil.getI18nLabel(174246, "最新值"), k + UD + SalaryStatisticsItemStringRuleEnum.LAST.getValue() + P_NOW));
}
// 8.最旧值children
SalaryStatisticsItemRuleDTO oldRule = JSON.parseObject(itemPO.getOldRule(), SalaryStatisticsItemRuleDTO.class);
if (oldRule != null && 1 == oldRule.getTotalValue()) {
children.add(new WeaTableColumnGroup(COL_WIDTH, SalaryI18nUtil.getI18nLabel(174246, "最旧值"), k + UD + SalaryStatisticsItemStringRuleEnum.OLD.getValue() + P_NOW));
}
// 9.最频繁children
SalaryStatisticsItemRuleDTO frequentRule = JSON.parseObject(itemPO.getFrequentRule(), SalaryStatisticsItemRuleDTO.class);
if (frequentRule != null && 1 == frequentRule.getTotalValue()) {
children.add(new WeaTableColumnGroup(COL_WIDTH, SalaryI18nUtil.getI18nLabel(174246, "最频繁"), k + UD + SalaryStatisticsItemStringRuleEnum.FREQUENT.getValue() + P_NOW));
}
// 10.平铺children
SalaryStatisticsItemRuleDTO tileRule = JSON.parseObject(itemPO.getTileRule(), SalaryStatisticsItemRuleDTO.class);
if (tileRule != null && 1 == tileRule.getTotalValue()) {
children.add(new WeaTableColumnGroup(COL_WIDTH, SalaryI18nUtil.getI18nLabel(174246, "平铺"), k + UD + SalaryStatisticsItemStringRuleEnum.TILE.getValue() + P_NOW));
}
weaTableColumn.setChildren(children);
result.add(weaTableColumn);
});

View File

@ -14,30 +14,29 @@ import java.math.BigDecimal;
@Builder
@NoArgsConstructor
@AllArgsConstructor
//"薪酬统计报表自定义统计项目规则")
public class SalaryStatisticsItemRuleDTO {
//是否有合计列")
//是否有合计列若是文本代表是否显示
private Integer totalValue;
//是否有占比列")
//是否有占比列
private Integer ratioValue;
//是否有环比列")
//是否有环比列
private Integer m2mValue;
//合计环比上限")
//合计环比上限
private BigDecimal m2mUpperLimit;
//合计环比下限")
//合计环比下限
private BigDecimal m2mLowerLimit;
//是否有同比列")
//是否有同比列
private Integer y2yValue;
//合计同比上限")
//合计同比上限
private BigDecimal y2yUpperLimit;
//合计同比下限")
//合计同比下限
private BigDecimal y2yLowerLimit;
}

View File

@ -0,0 +1,23 @@
package com.engine.salary.report.entity.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 薪酬统计报表自定义统计字符项目规则
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SalaryStatisticsItemStringRuleDTO {
/**
* 是否启用
*/
private Integer ableValue;
}

View File

@ -0,0 +1,26 @@
package com.engine.salary.report.entity.param;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 薪酬统计报表自定义统计项目保存参数
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SalaryStatisticsItemGetFormParam {
//统计项目id
private Long id;
//统计项目
private Long itemId;
}

View File

@ -20,38 +20,50 @@ import java.util.List;
@Builder
@NoArgsConstructor
@AllArgsConstructor
//"薪酬统计报表自定义统计项目保存参数")
public class SalaryStatisticsItemSaveParam {
//统计项目id")
//统计项目id
private Long id;
// 报表id")
// 报表id
private Long statReportId;
//统计项目")
//统计项目
private List<String> itemValue;
//统计项名称")
//统计项名称
private String itemName;
//计数规则")
//计数规则
private SalaryStatisticsItemRuleDTO countRule;
//求和规则")
//求和规则
private SalaryStatisticsItemRuleDTO sumRule;
//平均值规则")
//平均值规则
private SalaryStatisticsItemRuleDTO avgRule;
//最大值规则")
//最大值规则
private SalaryStatisticsItemRuleDTO maxRule;
//最小值规则")
//最小值规则
private SalaryStatisticsItemRuleDTO minRule;
//中位数规则")
//中位数规则
private SalaryStatisticsItemRuleDTO medianRule;
//统计单位")
//最近值
private SalaryStatisticsItemRuleDTO lastRule;
//最旧值
private SalaryStatisticsItemRuleDTO oldRule;
//频繁出现
private SalaryStatisticsItemRuleDTO frequentRule;
//平铺
private SalaryStatisticsItemRuleDTO tileRule;
//统计单位
private Integer unitType;
}

View File

@ -126,11 +126,47 @@ public class SalaryStatisticsItemPO implements Serializable {
//中位数规则")
private String medianRule;
/**
* 最近值
* <p>
* "totalValue":"1", 是否使用
*/
private String lastRule;
/**
* 最早值
* <p>
* {
* "totalValue":"1", 是否使用
* }
*/
private String oldRule;
/**
* 出现最多
* <p>
* {
* "totalValue":"1", 是否使用
* }
*/
private String frequentRule;
/**
* 平铺
* <p>
* {
* "totalValue":"1", 是否使用
* }
*/
private String tileRule;
//顺序")
private Integer indexValue;
/**
* 统计单位
*
* @see UnitTypeEnum
*/
//统计单位")

View File

@ -0,0 +1,52 @@
package com.engine.salary.report.enums;
import com.engine.salary.enums.BaseEnum;
import java.util.Objects;
public enum SalaryStatisticsItemStringRuleEnum implements BaseEnum<String> {
LAST("last", "最近值", 83993),
OLD("old", "最早值", 83994),
FREQUENT("frequent", "最频繁", 83994),
TILE("tile", "平铺", 83994),
;
private String value;
private String defaultLabel;
private int labelId;
SalaryStatisticsItemStringRuleEnum(String value, String defaultLabel, int labelId) {
this.value = value;
this.defaultLabel = defaultLabel;
this.labelId = labelId;
}
@Override
public String getValue() {
return value;
}
@Override
public String getDefaultLabel() {
return defaultLabel;
}
@Override
public Integer getLabelId() {
return labelId;
}
public static SalaryStatisticsItemStringRuleEnum parseByValue(String value) {
for (SalaryStatisticsItemStringRuleEnum typeEnum : SalaryStatisticsItemStringRuleEnum.values()) {
if (Objects.equals(typeEnum.getValue(), value)) {
return typeEnum;
}
}
return null;
}
}

View File

@ -3,6 +3,7 @@ package com.engine.salary.report.enums;
import com.engine.salary.enums.BaseEnum;
public enum UnitTypeEnum implements BaseEnum<Integer> {
empty(0, 152745, ""),
REN(1, 157087, ""),
YUAN(2, 152739, ""),
QIAN(3, 157088, ""),

View File

@ -1,5 +1,6 @@
package com.engine.salary.report.service;
import com.engine.salary.entity.hrm.dto.EmployeeInfoExpandDTO;
import com.engine.salary.report.entity.param.SalaryStatisticsDimensionQueryParam;
import com.engine.salary.report.entity.param.SalaryStatisticsDimensionSaveParam;
import com.engine.salary.report.entity.po.SalaryStatisticsDimensionPO;
@ -58,6 +59,20 @@ public interface SalaryStatisticsDimensionService {
*/
String save(SalaryStatisticsDimensionSaveParam saveParam);
/**
* 保存字段扩展
* @param saveParam
* @return
*/
void saveExpandFieldSettings(EmployeeInfoExpandDTO saveParam);
/**
* 查询薪酬统计维度扩展字段设置
* @param module
* @return
*/
EmployeeInfoExpandDTO getExpandFieldSettings(String module);
/**
* 删除薪酬统计维度
*
@ -72,4 +87,5 @@ public interface SalaryStatisticsDimensionService {
* @return
*/
List<SalaryStatisticsDimensionPO> listAllDefaultDimension();
}

View File

@ -70,6 +70,13 @@ public interface SalaryStatisticsReportService {
*/
Map<String, Object> delete(Collection<Long> ids );
/**
* 复制
* @param id
*/
void duplicate(Long id);
/**
* 保存统计范围
*
@ -106,5 +113,4 @@ public interface SalaryStatisticsReportService {
*/
void removeReportCache();
}

View File

@ -3,6 +3,7 @@ package com.engine.salary.report.service.impl;
import com.alibaba.fastjson.JSON;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.entity.hrm.dto.EmployeeInfoExpandDTO;
import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.mapper.report.SalaryStatisticsDimensionMapper;
import com.engine.salary.report.common.constant.SalaryStatisticsDimensionConstant;
@ -13,6 +14,8 @@ import com.engine.salary.report.entity.po.SalaryStatisticsReportPO;
import com.engine.salary.report.enums.SalaryStatisticsDimensionTypeEnum;
import com.engine.salary.report.service.SalaryStatisticsDimensionService;
import com.engine.salary.report.service.SalaryStatisticsReportService;
import com.engine.salary.service.SalaryEmployeeService;
import com.engine.salary.service.impl.SalaryEmployeeServiceImpl;
import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.db.MapperProxyFactory;
import com.engine.salary.util.page.PageInfo;
@ -46,6 +49,10 @@ public class SalaryStatisticsDimensionServiceImpl extends Service implements Sal
return ServiceUtil.getService(SalaryStatisticsReportServiceImpl.class, user);
}
private SalaryEmployeeService getSalaryEmployeeService(User user) {
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
}
/**
* 初始化默认维度
*/
@ -197,6 +204,16 @@ public class SalaryStatisticsDimensionServiceImpl extends Service implements Sal
return StringUtils.EMPTY;
}
@Override
public void saveExpandFieldSettings(EmployeeInfoExpandDTO saveParam) {
getSalaryEmployeeService(user).saveEmployeeExpandFieldSettings(saveParam);
}
@Override
public EmployeeInfoExpandDTO getExpandFieldSettings(String module) {
return getSalaryEmployeeService(user).getExpandFieldSettings(module);
}
@Override
public Map<String, Object> delete(Collection<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {

View File

@ -116,6 +116,10 @@ public class SalaryStatisticsItemServiceImpl extends Service implements SalarySt
.maxRule(SalaryEntityUtil.toJSONString(saveParam.getMaxRule()))
.minRule(SalaryEntityUtil.toJSONString(saveParam.getMinRule()))
.medianRule(SalaryEntityUtil.toJSONString(saveParam.getMedianRule()))
.lastRule(SalaryEntityUtil.toJSONString(saveParam.getMedianRule()))
.oldRule(SalaryEntityUtil.toJSONString(saveParam.getMedianRule()))
.frequentRule(SalaryEntityUtil.toJSONString(saveParam.getMedianRule()))
.tileRule(SalaryEntityUtil.toJSONString(saveParam.getMedianRule()))
.indexValue(max + 1)
.statReportId(saveParam.getStatReportId())
.unitType(saveParam.getUnitType() == null ? UnitTypeEnum.YUAN.getValue() : saveParam.getUnitType())
@ -149,6 +153,10 @@ public class SalaryStatisticsItemServiceImpl extends Service implements SalarySt
itemPO.setMaxRule(SalaryEntityUtil.toJSONString(saveParam.getMaxRule()));
itemPO.setMinRule(SalaryEntityUtil.toJSONString(saveParam.getMinRule()));
itemPO.setMedianRule(SalaryEntityUtil.toJSONString(saveParam.getMedianRule()));
itemPO.setLastRule(SalaryEntityUtil.toJSONString(saveParam.getLastRule()));
itemPO.setOldRule(SalaryEntityUtil.toJSONString(saveParam.getOldRule()));
itemPO.setFrequentRule(SalaryEntityUtil.toJSONString(saveParam.getFrequentRule()));
itemPO.setTileRule(SalaryEntityUtil.toJSONString(saveParam.getTileRule()));
}
getSalaryStatisticsItemMapper().updateIgnoreNull(itemPO);

View File

@ -6,6 +6,8 @@ import com.engine.core.impl.Service;
import com.engine.salary.cache.SalaryCacheKey;
import com.engine.salary.constant.SalaryDefaultTenantConstant;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.hrm.dto.EmployeeInfoExpandDTO;
import com.engine.salary.entity.hrm.dto.FieldSetting;
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
@ -22,6 +24,7 @@ import com.engine.salary.report.entity.po.SalaryStatisticsDimensionPO;
import com.engine.salary.report.entity.po.SalaryStatisticsItemPO;
import com.engine.salary.report.entity.po.SalaryStatisticsReportPO;
import com.engine.salary.report.enums.SalaryStatisticsDimensionTypeEnum;
import com.engine.salary.report.service.SalaryStatisticsDimensionService;
import com.engine.salary.report.service.SalaryStatisticsItemService;
import com.engine.salary.report.service.SalaryStatisticsReportService;
import com.engine.salary.report.util.ReportTimeUtil;
@ -70,6 +73,10 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
return MapperProxyFactory.getProxy(SalaryStatisticsReportMapper.class);
}
private SalaryStatisticsDimensionService getSalaryStatisticsDimensionService(User user) {
return ServiceUtil.getService(SalaryStatisticsDimensionServiceImpl.class, user);
}
private SalaryStatisticsItemService getSalaryStatisticsItemService(User user) {
return ServiceUtil.getService(SalaryStatisticsItemServiceImpl.class, user);
}
@ -331,6 +338,34 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
return resultMap;
}
@Override
public void duplicate(Long id) {
long uid = user.getUID();
Date now = new Date();
SalaryStatisticsReportPO po = getById(id);
SalaryAssert.notNull(po, SalaryI18nUtil.getI18nLabel(152563, "报表不存在"));
po.setId(IdGenerator.generate());
po.setCreator(uid);
po.setCreateTime(now);
po.setUpdateTime(now);
po.setReportName(po.getReportName()+"_copy");
getSalaryStatisticsReportMapper().insertIgnoreNull(po);
List<SalaryStatisticsItemPO> itemPOS = getSalaryStatisticsItemService(user).listByStatisticsReportId(id);
List<SalaryStatisticsItemPO> itemList = itemPOS.stream().map(item -> {
item.setId(IdGenerator.generate());
item.setStatReportId(po.getId());
item.setCreator(uid);
item.setCreateTime(now);
item.setUpdateTime(now);
return item;
}).collect(Collectors.toList());
getSalaryStatisticsItemService(user).saveOrUpdateBatch(itemList);
}
@Override
public PageInfo<Map<String, Object>> buildReportRecords(SalaryStatisticsDimensionPO dimension, SalaryStatisticsReportDataQueryParam param, List<SalaryStatisticsItemPO> salaryStatisticsItemList) {
Map<String, Boolean> checkMap = SalaryStatisticsReportBO.checkLoad(salaryStatisticsItemList);
@ -392,8 +427,8 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
Map<Long, Map<String, String>> resultMap = new HashMap<>();
List<Long> salaryAcctEmployeeIds = salaryAcctEmployeeList.stream().map(SalaryAcctEmployeePO::getId).collect(Collectors.toList());
if( NumberUtils.isCreatable(dimension.getDimCode()) ){
List<SalaryAcctResultPO> salaryAcctResultValues = getSalaryAcctResultService(user).listByAcctEmployeeIdsAndSalaryItemIds(salaryAcctEmployeeIds,Collections.singleton(Long.valueOf(dimension.getDimCode())));
if (NumberUtils.isCreatable(dimension.getDimCode())) {
List<SalaryAcctResultPO> salaryAcctResultValues = getSalaryAcctResultService(user).listByAcctEmployeeIdsAndSalaryItemIds(salaryAcctEmployeeIds, Collections.singleton(Long.valueOf(dimension.getDimCode())));
List<Long> finalSalaryAcctEmpIds = getSalaryAcctResultService(user).listAcctEmpIdByAcctEmpId(salaryAcctEmployeeIds);
Map<Long, List<SalaryAcctResultPO>> salaryAcctEmpResultMap = SalaryEntityUtil.group2Map(salaryAcctResultValues, SalaryAcctResultPO::getSalaryAcctEmpId);
salaryAcctEmpResultMap.forEach((k, v) -> {
@ -401,8 +436,8 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
resultMap.put(k, collect);
});
salaryAcctEmployeeIds.stream().forEach(id -> {
if(!resultMap.containsKey(id) && finalSalaryAcctEmpIds.contains(id))
resultMap.put(id,Collections.emptyMap());
if (!resultMap.containsKey(id) && finalSalaryAcctEmpIds.contains(id))
resultMap.put(id, Collections.emptyMap());
});
}
@ -473,13 +508,13 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
if (StringUtils.isNotBlank(id)) {
//报表下条件id
String salaryReportConditions = getSalaryCacheService(user).get(SalaryCacheKey.SALARY_REPORT_CONDITIONS + id);
List c= new ArrayList<>();
List c = new ArrayList<>();
if (StringUtils.isNotBlank(salaryReportConditions)) {
Arrays.asList(salaryReportConditions.split(",")).forEach(paramMd5 -> {
if (StringUtils.isNotBlank(paramMd5)) {
Map<String, Object> data = getSalaryCacheService(user).get(SalaryCacheKey.SALARY_REPORT_DATA + paramMd5);
Map kv= new HashMap<>();
kv.put(paramMd5,data);
Map kv = new HashMap<>();
kv.put(paramMd5, data);
c.add(kv);
}
}
@ -1014,7 +1049,14 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
Map<Long, List<SalaryAcctEmployeePO>> employeeListMap = accountDetailPOList.stream().collect(Collectors.groupingBy(SalaryAcctEmployeePO::getEmployeeId));
Map<Long, List<SalaryAcctEmployeePO>> lastEmployeeListMap = data.getLastList().stream().collect(Collectors.groupingBy(SalaryAcctEmployeePO::getEmployeeId));
Map<Long, List<SalaryAcctEmployeePO>> sameEmployeeListMap = data.getSameList().stream().collect(Collectors.groupingBy(SalaryAcctEmployeePO::getEmployeeId));
Map<Long, DataCollectionEmployee> employeeByIdMap = getSalaryEmployeeService(user).getEmployeeByIdsAll(accountDetailPOList.stream().map(SalaryAcctEmployeePO::getEmployeeId).distinct().collect(Collectors.toList())).stream().collect(Collectors.toMap(DataCollectionEmployee::getEmployeeId, o -> o));
//人员维度扩展属性
EmployeeInfoExpandDTO employeeInfoExpandDTO = getSalaryStatisticsDimensionService(user).getExpandFieldSettings("dim_employee");
List<FieldSetting> fieldSettings = Optional.ofNullable(Optional.ofNullable(employeeInfoExpandDTO).orElse(new EmployeeInfoExpandDTO()).getFieldSettings()).orElse(new ArrayList<>());
Map<Long, DataCollectionEmployee> employeeByIdMap = getSalaryEmployeeService(user).expandEmployeeInfo(accountDetailPOList.stream().map(SalaryAcctEmployeePO::getEmployeeId).distinct().collect(Collectors.toList()), employeeInfoExpandDTO)
.stream()
.collect(Collectors.toMap(DataCollectionEmployee::getEmployeeId, o -> o));
// List<ExtEmployeePO> extEmployees = extEmployeeService.listByIdsWithDeleted(accountDetailPOList.stream().filter(e -> EmployeeTypeEnum.EXT_EMPLOYEE.getValue().equals(e.getEmployeeType())).map(SalaryAcctEmployeePO::getEmployeeId).distinct().collect(Collectors.toList()), data.getTenantKey());
// Map<Long, String> employeeExtByIdMap = SalaryEntityUtil.convert2Map(extEmployees, ExtEmployeePO::getId, ExtEmployeePO::getUsername);
@ -1025,8 +1067,11 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
Map<String, Object> temp = new HashMap<>();
// temp.put(DM, Objects.nonNull(employeeByIdMap.get(k)) ? employeeByIdMap.get(k) : employeeExtByIdMap.get(k));
temp.put(DM, employeeByIdMap.get(k).getUsername());
temp.put("departmentName", employeeByIdMap.get(k).getDepartmentName());
temp.put("workcode", employeeByIdMap.get(k).getWorkcode());
fieldSettings.forEach(
fieldSetting -> {
temp.put(fieldSetting.getField(), employeeByIdMap.get(k).getExtendData().get(fieldSetting.getField()));
}
);
temp.putAll(SalaryStatisticsReportBO.calculateItem(v, lastEmployeeListMap.get(k), sameEmployeeListMap.get(k), salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
records.add(temp);
} else if (StringUtils.equals(dimensionValue, employeeByIdMap.get(k).getUsername())) {

View File

@ -1,6 +1,7 @@
package com.engine.salary.report.web;
import com.engine.common.util.ServiceUtil;
import com.engine.salary.entity.hrm.dto.EmployeeInfoExpandDTO;
import com.engine.salary.report.entity.dto.SalaryStatisticsDimensionFormDTO;
import com.engine.salary.report.entity.dto.SalaryStatisticsDimensionListDTO;
import com.engine.salary.report.entity.param.SalaryStatisticsDimensionQueryParam;
@ -58,7 +59,7 @@ public class SalaryStatisticsDimensionController {
@GET
@Path("/getForm")
@Produces(MediaType.APPLICATION_JSON)
public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id")Long id) {
public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<Long, SalaryStatisticsDimensionFormDTO>(user).run(getSalaryStatisticsDimensionWrapper(user)::getFrom, id);
}
@ -78,6 +79,33 @@ public class SalaryStatisticsDimensionController {
return new ResponseResult<SalaryStatisticsDimensionSaveParam, String>(user).run(getSalaryStatisticsDimensionWrapper(user)::save, saveParam);
}
/**
* 保存薪酬统计维度扩展字段设置
*
* @param saveParam
* @return
*/
@POST
@Path("/saveExpandFieldSettings")
@Produces(MediaType.APPLICATION_JSON)
public String saveExpandFieldSettings(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeInfoExpandDTO saveParam) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<EmployeeInfoExpandDTO, String>(user).run(getSalaryStatisticsDimensionWrapper(user)::saveExpandFieldSettings, saveParam);
}
/**
* 查询薪酬统计维度扩展字段设置
*
* @return
*/
@GET
@Path("/getExpandFieldSettings")
@Produces(MediaType.APPLICATION_JSON)
public String getExpandFieldSettings(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "module") String module) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<String, EmployeeInfoExpandDTO>(user).run(getSalaryStatisticsDimensionWrapper(user)::getExpandFieldSettings, module);
}
/**
* 删除薪酬统计维度
*

View File

@ -31,6 +31,7 @@ public class SalaryStatisticsItemController {
private SalaryStatisticsItemWrapper getSalaryStatisticsItemWrapper(User user) {
return ServiceUtil.getService(SalaryStatisticsItemWrapper.class, user);
}
/**
* 获取自定义统计项目表单
*
@ -40,11 +41,26 @@ public class SalaryStatisticsItemController {
@GET
@Path("/getForm")
@Produces(MediaType.APPLICATION_JSON)
public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id")Long id) {
public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<Long, SalaryStatisticsItemFormDTO>(user).run(getSalaryStatisticsItemWrapper(user)::getForm, id);
}
/**
* 切换薪资项目
* @param request
* @param response
* @param itemId
* @return
*/
@GET
@Path("/changeTab")
@Produces(MediaType.APPLICATION_JSON)
public String changeTab(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "itemId") Long itemId) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<Long, SalaryStatisticsItemFormDTO>(user).run(getSalaryStatisticsItemWrapper(user)::changeTab, itemId);
}
/**
* 自定义统计项目列表
@ -55,7 +71,7 @@ public class SalaryStatisticsItemController {
@GET
@Path("/list")
@Produces(MediaType.APPLICATION_JSON)
public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "statisticsReportId")Long statisticsReportId) {
public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "statisticsReportId") Long statisticsReportId) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<Long, List<Map<String, Object>>>(user).run(getSalaryStatisticsItemWrapper(user)::list, statisticsReportId);
}

View File

@ -95,6 +95,20 @@ public class SalaryStatisticsReportController {
return new ResponseResult<Collection<Long>, Map<String, Object>>(user).run(getSalaryStatisticsReportWrapper(user)::delete, ids);
}
/**
* 复制薪酬统计报表
*
* @param id
* @return
*/
@GET
@Path("/duplicate")
@Produces(MediaType.APPLICATION_JSON)
public String duplicate(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<Long, String>(user).run(getSalaryStatisticsReportWrapper(user)::duplicate, id);
}
/**
* 获取薪酬统计报表查询条件
*

View File

@ -3,6 +3,7 @@ package com.engine.salary.report.wrapper;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.component.WeaFormOption;
import com.engine.salary.entity.hrm.dto.EmployeeInfoExpandDTO;
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
import com.engine.salary.exception.SalaryRunTimeException;
@ -24,6 +25,7 @@ import com.engine.salary.util.JsonUtil;
import com.engine.salary.util.SalaryI18nUtil;
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.collections4.CollectionUtils;
import weaver.hrm.User;
@ -67,7 +69,7 @@ public class SalaryStatisticsDimensionWrapper extends Service {
public PageInfo<SalaryStatisticsDimensionListDTO> list(SalaryStatisticsDimensionQueryParam queryParam) {
PageInfo<SalaryStatisticsDimensionPO> page = salaryStatisticsDimensionService(user).listPage(queryParam);
List<SalaryStatisticsDimensionPO> list = page.getList();
List<SalaryStatisticsDimensionListDTO> dtoList= new ArrayList<>();
List<SalaryStatisticsDimensionListDTO> dtoList = new ArrayList<>();
// 获取默认维度统计
List<SalaryStatisticsDimensionPO> defaultSalaryStatisticsDimensions = getSalaryStatisticsDimensionService(user).listAllDefaultDimension();
@ -87,11 +89,11 @@ public class SalaryStatisticsDimensionWrapper extends Service {
.canEdit(true)
.canDelete(true)
.build();
if (defaultDimensionIds.contains(dto.getId())){
if (defaultDimensionIds.contains(dto.getId())) {
// 默认维度不允许修改删除
dto.setCanEdit(false);
dto.setCanDelete(false);
}else if(haveUsedDimIds.contains(dto.getId().toString())){
} else if (haveUsedDimIds.contains(dto.getId().toString())) {
// 被薪资统计报表引用的不能删除
dto.setCanDelete(false);
}
@ -138,8 +140,8 @@ public class SalaryStatisticsDimensionWrapper extends Service {
.map(item -> new WeaFormOption(item.getId().toString(), item.getName())).collect(Collectors.toList()));
// 1.构建基础信息表单
Map baseForm = new HashMap<>();
baseForm.put("statsDimOptions",statsDimOptions);
baseForm.put("groupDimOptions",groupDimOptions);
baseForm.put("statsDimOptions", statsDimOptions);
baseForm.put("groupDimOptions", groupDimOptions);
// 2.分组设置
String groupSetting = "[]";
if (id != null) {
@ -187,6 +189,28 @@ public class SalaryStatisticsDimensionWrapper extends Service {
return salaryStatisticsDimensionService(user).save(saveParam);
}
/**
* 保存薪酬统计维度扩展设置
*
* @param saveParam
* @return
*/
public void saveExpandFieldSettings(EmployeeInfoExpandDTO saveParam) {
ValidUtil.modify(saveParam);
// Optional.ofNullable(saveParam.getFieldSettings()).orElse(new ArrayList<>()).forEach(fieldSetting -> fieldSetting.setField(fieldSetting.getField().trim()));
salaryStatisticsDimensionService(user).saveExpandFieldSettings(saveParam);
}
/**
* 查询薪酬统计维度扩展字段设置
*
* @return
*/
public EmployeeInfoExpandDTO getExpandFieldSettings(String module) {
return salaryStatisticsDimensionService(user).getExpandFieldSettings(module);
}
/**
* 删除薪酬统计维度
*
@ -211,4 +235,5 @@ public class SalaryStatisticsDimensionWrapper extends Service {
return map;
}).collect(Collectors.toList());
}
}

View File

@ -5,9 +5,11 @@ import com.cloudstore.eccom.pc.table.WeaTableColumn;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
import com.engine.salary.report.entity.dto.SalaryStatisticsItemFormDTO;
import com.engine.salary.report.entity.param.SalaryStatisticsItemSaveParam;
import com.engine.salary.report.entity.po.SalaryStatisticsItemPO;
import com.engine.salary.report.enums.SalaryStatisticsItemStringRuleEnum;
import com.engine.salary.report.enums.UnitTypeEnum;
import com.engine.salary.report.service.SalaryStatisticsItemService;
import com.engine.salary.report.service.impl.SalaryStatisticsItemServiceImpl;
@ -47,7 +49,7 @@ public class SalaryStatisticsItemWrapper extends Service {
* @return
*/
public SalaryStatisticsItemFormDTO getForm(Long id) {
Map weaForm = new HashMap();
Map<String, Object> weaForm = new HashMap<>();
Map<String, Object> ruleData = new HashMap<>();
if (Objects.nonNull(id)) {
SalaryStatisticsItemPO salaryStatisticsItem = getSalaryStatisticsItemService(user).getById(id);
@ -55,22 +57,24 @@ public class SalaryStatisticsItemWrapper extends Service {
String itemValue = salaryStatisticsItem.getItemValue();
if (StringUtils.isNotBlank(itemValue)) {
List<SalaryItemPO> salaryItems = getSalaryItemService(user).listAll();
Map<String, String> itemsMap = SalaryEntityUtil.convert2Map(salaryItems, k -> k.getId().toString(), SalaryItemPO::getName);
Map<String, SalaryItemPO> itemsMap = SalaryEntityUtil.convert2Map(salaryItems, k -> k.getId().toString());
List<Map<String, String>> welfareItems = new ArrayList<>();
Arrays.stream(itemValue.split(",")).forEach(value -> {
Map<String, String> welfareItem = new HashMap<>();
welfareItem.put("id", value);
welfareItem.put("name", itemsMap.get(value));
welfareItem.put("name", itemsMap.get(value).getName());
welfareItem.put("dataType", itemsMap.get(value).getDataType());
welfareItems.add(welfareItem);
});
Map map = new HashMap();
map.put("itemValue", welfareItems);
Map<String, Object> map = new HashMap<>();
//版本变更由多选变成单选
map.put("itemValue", welfareItems.get(0));
map.put("itemName", salaryStatisticsItem.getItemName());
weaForm.put("data", map);
ruleData = buildRule(salaryStatisticsItem);
ruleData = buildRule(SalaryDataTypeEnum.parseByValue(welfareItems.get(0).get("dataType")), salaryStatisticsItem);
}
} else {
ruleData = buildRule(null);
ruleData = buildRule(null, null);
}
return SalaryStatisticsItemFormDTO.builder()
@ -80,7 +84,86 @@ public class SalaryStatisticsItemWrapper extends Service {
.build();
}
public Map buildRule(SalaryStatisticsItemPO salaryStatisticsItem) {
public SalaryStatisticsItemFormDTO changeTab(Long itemId) {
SalaryItemPO po = getSalaryItemService(user).getById(itemId);
Map<String, Object> ruleData = buildRule(SalaryDataTypeEnum.parseByValue(po.getDataType()), null);
return SalaryStatisticsItemFormDTO.builder().ruleData(ruleData).build();
}
public Map<String, Object> buildRule(SalaryDataTypeEnum dataType, SalaryStatisticsItemPO salaryStatisticsItem) {
Map<String, Object> weaTable;
if (dataType == null || dataType == SalaryDataTypeEnum.NUMBER) {
weaTable = buildNumberRule(salaryStatisticsItem);
} else {
weaTable = buildStringRule(salaryStatisticsItem);
}
return weaTable;
}
/**
* 字符取值规则
*
* @param salaryStatisticsItem 统计项
* @return
*/
private Map<String, Object> buildStringRule(SalaryStatisticsItemPO salaryStatisticsItem) {
Map<String, Object> weaTable = new HashMap<>();
List<WeaTableColumn> list = new ArrayList<>();
WeaTableColumn ruleName = new WeaTableColumn("20%", SalaryI18nUtil.getI18nLabel(157532, "字符取值规则"), "ruleName");
list.add(ruleName);
weaTable.put("columns", list);
List<Map<String, Object>> result = new ArrayList<>();
if (salaryStatisticsItem == null) {
for (SalaryStatisticsItemStringRuleEnum ruleEnum : SalaryStatisticsItemStringRuleEnum.values()) {
Map<String, Object> rule = new HashMap<>();
rule.put("id", ruleEnum.getValue());
rule.put("ruleName", ruleEnum.getDefaultLabel());
rule.put("totalValue", 0);
result.add(rule);
}
} else {
for (SalaryStatisticsItemStringRuleEnum ruleEnum : SalaryStatisticsItemStringRuleEnum.values()) {
Map<String, Object> rule = new HashMap<>();
switch (ruleEnum) {
case LAST:
rule = JSON.parseObject(salaryStatisticsItem.getLastRule(), HashMap.class);
break;
case OLD:
rule = JSON.parseObject(salaryStatisticsItem.getOldRule(), HashMap.class);
break;
case FREQUENT:
rule = JSON.parseObject(salaryStatisticsItem.getFrequentRule(), HashMap.class);
break;
case TILE:
rule = JSON.parseObject(salaryStatisticsItem.getTileRule(), HashMap.class);
break;
default:
break;
}
if (rule == null) {
rule = new HashMap<>();
}
rule.put("id", ruleEnum.getValue());
rule.put("ruleName", ruleEnum.getDefaultLabel());
rule.put("totalValue", Optional.ofNullable(rule.get("totalValue")).orElse(0));
result.add(rule);
}
}
weaTable.put("data", result);
return weaTable;
}
/**
* 数值取值规则
*
* @param salaryStatisticsItem 统计项
* @return
*/
private Map<String, Object> buildNumberRule(SalaryStatisticsItemPO salaryStatisticsItem) {
Map<String, Object> weaTable = new HashMap<>();
List<WeaTableColumn> list = new ArrayList<>();
WeaTableColumn ruleName = new WeaTableColumn("20%", SalaryI18nUtil.getI18nLabel(157532, "统计规则"), "ruleName");
@ -126,22 +209,22 @@ public class SalaryStatisticsItemWrapper extends Service {
Map<String, Object> rule = new HashMap<>();
switch (ruleList.get(i)) {
case "count":
rule = JSON.parseObject(salaryStatisticsItem.getCountRule(), new HashMap<String, String>().getClass());
rule = JSON.parseObject(salaryStatisticsItem.getCountRule(), HashMap.class);
break;
case "sum":
rule = JSON.parseObject(salaryStatisticsItem.getSumRule(), new HashMap<String, String>().getClass());
rule = JSON.parseObject(salaryStatisticsItem.getSumRule(), HashMap.class);
break;
case "avg":
rule = JSON.parseObject(salaryStatisticsItem.getAvgRule(), new HashMap<String, String>().getClass());
rule = JSON.parseObject(salaryStatisticsItem.getAvgRule(), HashMap.class);
break;
case "max":
rule = JSON.parseObject(salaryStatisticsItem.getMaxRule(), new HashMap<String, String>().getClass());
rule = JSON.parseObject(salaryStatisticsItem.getMaxRule(), HashMap.class);
break;
case "min":
rule = JSON.parseObject(salaryStatisticsItem.getMinRule(), new HashMap<String, String>().getClass());
rule = JSON.parseObject(salaryStatisticsItem.getMinRule(), HashMap.class);
break;
case "median":
rule = JSON.parseObject(salaryStatisticsItem.getMedianRule(), new HashMap<String, String>().getClass());
rule = JSON.parseObject(salaryStatisticsItem.getMedianRule(), HashMap.class);
break;
default:
break;
@ -213,4 +296,5 @@ public class SalaryStatisticsItemWrapper extends Service {
public String save(SalaryStatisticsItemSaveParam saveParam) {
return getSalaryStatisticsItemService(user).save(saveParam);
}
}

View File

@ -212,6 +212,16 @@ public class SalaryStatisticsReportWrapper extends Service {
return getSalaryStatisticsReportService(user).delete(ids);
}
/**
* 复制薪资账套
* @param id
*/
public void duplicate(Long id) {
if (id == null) {
throw new SalaryRunTimeException("id为空");
}
getSalaryStatisticsReportService(user).duplicate(id);
}
/**
* 获取统计条件
@ -470,6 +480,7 @@ public class SalaryStatisticsReportWrapper extends Service {
/**
* 权限校验
*
* @param isShared 是否是被分享的报表
* @param po 报表po
*/

View File

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

View File

@ -4,6 +4,7 @@ import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.hrm.DeptInfo;
import com.engine.salary.entity.hrm.PositionInfo;
import com.engine.salary.entity.hrm.SubCompanyInfo;
import com.engine.salary.entity.hrm.dto.EmployeeInfoExpandDTO;
import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam;
import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum;
@ -100,6 +101,28 @@ public interface SalaryEmployeeService {
* @param formatDate
*/
Map<Long, String> getResignationMapByDate(String formatDate);
/**
* 扩展人员信息
* @param ids
* @param param
* @return
*/
List<DataCollectionEmployee> expandEmployeeInfo(List<Long> ids, EmployeeInfoExpandDTO param);
/**
* 保存扩展信息
* @param param
*/
void saveEmployeeExpandFieldSettings(EmployeeInfoExpandDTO param);
/**
* 获取扩展信息
* @param module
* @return
*/
EmployeeInfoExpandDTO getExpandFieldSettings(String module);
/**
* 根据人员id查询身份证
*

View File

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

View File

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

View File

@ -570,12 +570,27 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
@Override
public XSSFWorkbook exportImportTemplate(SalaryAcctImportTemplateParam param) {
ValidUtil.doValidator(param);
// ValidUtil.doValidator(param);
// 从缓存中获取所选的薪资项目
String cacheKey = user.getUID() + SalaryItemConstant.RESULT_IMPORT_FIELD_SIGN;
String cacheValue = (String)Util_DataCache.getObjVal(cacheKey);
List<Long> checkItems = JsonUtil.parseList(cacheValue, Long.class) == null ? new ArrayList<>() : JsonUtil.parseList(cacheValue, Long.class);
// 必须选择导入模板所需的薪资项目
if (CollectionUtils.isEmpty(param.getSalaryItemIds())) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(99019, "参数错误,请选择导入模板所需的薪资项目"));
if (CollectionUtils.isEmpty(checkItems)) {
// 获取所有可以选择的薪资项目
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(param.getSalaryAcctRecordId());
if (Objects.isNull(salaryAcctRecordPO)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除"));
}
// 查询薪资核算记录所用的薪资账套的薪资项目副本
List<SalarySobItemPO> salarySobItems = getSalarySobItemService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId());
List<Long> salaryItemIds = SalaryEntityUtil.properties(salarySobItems, SalarySobItemPO::getSalaryItemId, Collectors.toList());
if (CollectionUtils.isEmpty(salaryItemIds)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "该核算记录不存在薪资项目"));
}
checkItems = salaryItemIds;
}
param.setSalaryItemIds(checkItems);
// 查询薪资核算记录
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(param.getSalaryAcctRecordId());
if (Objects.isNull(salaryAcctRecordPO)) {

View File

@ -1,20 +1,25 @@
package com.engine.salary.service.impl;
import com.alibaba.fastjson.JSON;
import com.api.formmode.mybatis.util.SqlProxyHandle;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.biz.EmployBiz;
import com.engine.salary.constant.SalaryDefaultTenantConstant;
import com.engine.salary.entity.SalarySobExtRangePO;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.hrm.DeptInfo;
import com.engine.salary.entity.hrm.PositionInfo;
import com.engine.salary.entity.hrm.SubCompanyInfo;
import com.engine.salary.entity.hrm.dto.EmployeeInfoExpandDTO;
import com.engine.salary.entity.hrm.dto.FieldSetting;
import com.engine.salary.entity.hrm.po.ExpandFieldSettingsPO;
import com.engine.salary.entity.salarysob.bo.SalarySobRangeBO;
import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam;
import com.engine.salary.entity.salarysob.po.SalarySobRangePO;
import com.engine.salary.enums.UserStatusEnum;
import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum;
import com.engine.salary.mapper.datacollection.EmployMapper;
import com.engine.salary.mapper.hrm.ExpandFieldSettingsMapper;
import com.engine.salary.mapper.sys.SalarySysConfMapper;
import com.engine.salary.service.ExtEmpService;
import com.engine.salary.service.SalaryEmployeeService;
@ -22,11 +27,12 @@ import com.engine.salary.service.SalarySobExtRangeService;
import com.engine.salary.service.SalarySobRangeService;
import com.engine.salary.sys.entity.po.SalarySysConfPO;
import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.db.MapperProxyFactory;
import com.google.common.collect.Lists;
import dm.jdbc.util.IdGenerator;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import weaver.conn.RecordSet;
import weaver.hrm.User;
import java.util.*;
@ -48,15 +54,16 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
return ServiceUtil.getService(SalarySobRangeServiceImpl.class, user);
}
private EmployMapper getEmployMapper() {
return MapperProxyFactory.getProxy(EmployMapper.class);
}
private SalarySysConfMapper getSalarySysConfMapper() {
return SqlProxyHandle.getProxy(SalarySysConfMapper.class);
}
private ExpandFieldSettingsMapper getExpandFieldSettingsMapper() {
return SqlProxyHandle.getProxy(ExpandFieldSettingsMapper.class);
}
private ExtEmpService getExtEmpService(User user) {
return ServiceUtil.getService(ExtEmpServiceImpl.class, user);
}
@ -272,6 +279,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
/**
* 根据离职日期获取离职信息
*
* @param dismissDate
* @return
*/
@ -284,6 +292,95 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
return SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId, DataCollectionEmployee::getDismissdate);
}
@Override
public List<DataCollectionEmployee> expandEmployeeInfo(List<Long> ids, EmployeeInfoExpandDTO param) {
List<DataCollectionEmployee> employees = getEmployeeByIdsAll(ids);
if (param != null) {
RecordSet rs = new RecordSet();
String sql = param.getExpandSql().replace("=$人员id$", "in (" + StringUtils.join(ids, ",") + ")")
.replace("in($人员id$)", "in (" + StringUtils.join(ids, ",") + ")");
String primaryKey = param.getPk();
rs.executeQuery(sql);
while (rs.next()) {
Map<String, String> extendData = new HashMap<>();
param.getFieldSettings().forEach(setting -> {
String field = setting.getField();
String value = rs.getString(field);
setting.setValue(value);
extendData.put(field, value);
});
String id = rs.getString(primaryKey);
employees.stream()
.filter(e -> id.equals(e.getEmployeeId().toString()))
.forEach(e -> e.setExtendData(extendData));
}
}
return employees;
}
@Override
public void saveEmployeeExpandFieldSettings(EmployeeInfoExpandDTO param) {
String settings = JSON.toJSONString(param.getFieldSettings());
Date now = new Date();
if (Objects.nonNull(param.getId())) {
ExpandFieldSettingsPO po = getExpandFieldSettingsMapper().getById(param.getId());
if (po == null) {
throw new RuntimeException("配置不存在!");
}
po.setPk(param.getPk());
po.setExpandSql(param.getExpandSql());
po.setFieldSetting(settings);
po.setCreator((long) user.getUID());
po.setUpdateTime(now);
getExpandFieldSettingsMapper().update(po);
} else {
ExpandFieldSettingsPO po = ExpandFieldSettingsPO.builder()
.id(IdGenerator.generate())
.module(param.getModule())
.moduleInfo(param.getModuleInfo())
.pk(param.getPk())
.fieldSetting(settings)
.expandSql(param.getExpandSql())
.deleteType(0)
.creator((long) user.getUID())
.createTime(now)
.updateTime(now)
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
.build();
getExpandFieldSettingsMapper().insertIgnoreNull(po);
}
}
@Override
public EmployeeInfoExpandDTO getExpandFieldSettings(String module) {
ExpandFieldSettingsPO po = getExpandFieldSettingsMapper().getByModule(module);
if (po != null) {
List<FieldSetting> list = JSON.parseArray(po.getFieldSetting(), FieldSetting.class);
return EmployeeInfoExpandDTO.builder()
.id(po.getId())
.module(po.getModule())
.moduleInfo(po.getModuleInfo())
.pk(po.getPk())
.expandSql(po.getExpandSql())
.fieldSettings(list)
.build();
}
return null;
}
@Override
public Map<Long, String> mapByEmployeeIds(Collection<Long> employeeIds) {
List<DataCollectionEmployee> simpleUserInfos = getEmployeeByIdsAll(new ArrayList<>(employeeIds));

View File

@ -132,24 +132,7 @@ public class SalaryFormulaServiceImpl extends Service implements SalaryFormulaSe
}
//将select因XSS过滤造成的异常字符转换回来
param.setFormula(param.getFormula().replaceAll("", "select"));
param.setFormula(param.getFormula().replaceAll("", "SELECT"));
param.setFormula(param.getFormula().replaceAll("", "join"));
param.setFormula(param.getFormula().replaceAll("", "JOIN"));
param.setFormula(param.getFormula().replaceAll("", "and"));
param.setFormula(param.getFormula().replaceAll("", "AND"));
param.setFormula(param.getFormula().replaceAll("", "or"));
param.setFormula(param.getFormula().replaceAll("", "OR"));
param.setFormula(param.getFormula().replaceAll("", "in"));
param.setFormula(param.getFormula().replaceAll("", "IN"));
param.setFormula(param.getFormula().replaceAll("", "like"));
param.setFormula(param.getFormula().replaceAll("", "like"));
param.setFormula(param.getFormula().replaceAll("", "exists"));
param.setFormula(param.getFormula().replaceAll("", "EXISTS"));
param.setFormula(param.getFormula().replaceAll("", "between"));
param.setFormula(param.getFormula().replaceAll("", "BETWEEN"));
param.setFormula(param.getFormula().replaceAll("", "union"));
param.setFormula(param.getFormula().replaceAll("", "UNION"));
ValidUtil.modify(param);
// 解析公式中的参数
if (ReferenceTypeEnum.parseByValue(param.getReferenceType()) == ReferenceTypeEnum.FORMULA) {

View File

@ -2,6 +2,7 @@ package com.engine.salary.sys.service.impl;
import com.api.formmode.mybatis.util.SqlProxyHandle;
import com.cloudstore.dev.api.util.Util_DataCache;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.encrypt.AESEncryptUtil;
import com.engine.salary.encrypt.EncryptUtil;
@ -58,6 +59,7 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.session.SqlSession;
import weaver.conn.mybatis.MyBatisFactory;
import weaver.general.BaseBean;
import weaver.hrm.User;
import java.util.*;
import java.util.concurrent.ExecutorService;
@ -143,6 +145,10 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
return MapperProxyFactory.getProxy(SpecialAddDeductionMapper.class);
}
private SalarySysConfService getSalarySysConfService(User user) {
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
}
private TaxDeclarationValueMapper getTaxDeclarationValueMapper() {
return MapperProxyFactory.getProxy(TaxDeclarationValueMapper.class);
}
@ -596,6 +602,7 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
Util_DataCache.setObjVal(ENCRYPT_IN_PROGRESS + progressId, "in_progress");
//多线程批量更新需要加密的表
try {
SalarySysConfPO sysConfPo = getSalarySysConfService(user).getOneByCode(SalarySysConstant.OPEN_APPLICATION_ENCRYPT);
Future<Integer> submit = fixedThreadPool.submit(() -> {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
@ -603,8 +610,8 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
if (CollectionUtils.isNotEmpty(salaryAcctResultPos)) {
salaryAcctResultPos.forEach(po -> {
if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) {
po.setResultValue(AESEncryptUtil.closeEncryptSetting(po.getResultValue()));
po.setOriginResultValue(AESEncryptUtil.closeEncryptSetting(po.getOriginResultValue()));
po.setResultValue(AESEncryptUtil.closeEncryptSetting(po.getResultValue(), sysConfPo));
po.setOriginResultValue(AESEncryptUtil.closeEncryptSetting(po.getOriginResultValue(), sysConfPo));
} else {
po.setResultValue(AESEncryptUtil.encrypt(po.getResultValue()));
po.setOriginResultValue(AESEncryptUtil.encrypt(po.getOriginResultValue()));
@ -632,7 +639,7 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
if (CollectionUtils.isNotEmpty(excelAcctResultPos)) {
excelAcctResultPos.forEach(po -> {
if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) {
po.setResultValue(AESEncryptUtil.closeEncryptSetting(po.getResultValue()));
po.setResultValue(AESEncryptUtil.closeEncryptSetting(po.getResultValue(), sysConfPo));
} else {
po.setResultValue(AESEncryptUtil.encrypt(po.getResultValue()));
}
@ -659,7 +666,7 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
if (CollectionUtils.isNotEmpty(taxDeclarationDetailPos)) {
taxDeclarationDetailPos.forEach(po -> {
if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) {
po.setFieldValue(AESEncryptUtil.closeEncryptSetting(po.getFieldValue()));
po.setFieldValue(AESEncryptUtil.closeEncryptSetting(po.getFieldValue(), sysConfPo));
} else {
po.setFieldValue(AESEncryptUtil.encrypt(po.getFieldValue()));
}
@ -686,9 +693,9 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
if (CollectionUtils.isNotEmpty(insuranceSchemeDetailPos)) {
insuranceSchemeDetailPos.forEach(po -> {
if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) {
po.setUpperLimit(AESEncryptUtil.closeEncryptSetting(po.getUpperLimit()));
po.setFixedCost(AESEncryptUtil.closeEncryptSetting(po.getFixedCost()));
po.setLowerLimit(AESEncryptUtil.closeEncryptSetting(po.getLowerLimit()));
po.setUpperLimit(AESEncryptUtil.closeEncryptSetting(po.getUpperLimit(), sysConfPo));
po.setFixedCost(AESEncryptUtil.closeEncryptSetting(po.getFixedCost(), sysConfPo));
po.setLowerLimit(AESEncryptUtil.closeEncryptSetting(po.getLowerLimit(), sysConfPo));
} else {
po.setUpperLimit(AESEncryptUtil.encrypt(po.getUpperLimit()));
po.setFixedCost(AESEncryptUtil.encrypt(po.getFixedCost()));
@ -717,7 +724,7 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
if (CollectionUtils.isNotEmpty(insuranceArchivesSocialSchemePos)) {
insuranceArchivesSocialSchemePos.forEach(po -> {
if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) {
po.setSocialPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentBaseString()));
po.setSocialPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentBaseString(), sysConfPo));
} else {
po.setSocialPaymentBaseString(AESEncryptUtil.encrypt(po.getSocialPaymentBaseString()));
}
@ -744,7 +751,7 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
if (CollectionUtils.isNotEmpty(insuranceArchivesFundSchemePos)) {
insuranceArchivesFundSchemePos.forEach(po -> {
if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) {
po.setFundPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentBaseString()));
po.setFundPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentBaseString(), sysConfPo));
} else {
po.setFundPaymentBaseString(AESEncryptUtil.encrypt(po.getFundPaymentBaseString()));
}
@ -771,7 +778,7 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
if (CollectionUtils.isNotEmpty(insuranceArchivesOtherSchemePos)) {
insuranceArchivesOtherSchemePos.forEach(po -> {
if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) {
po.setOtherPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentBaseString()));
po.setOtherPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentBaseString(), sysConfPo));
} else {
po.setOtherPaymentBaseString(AESEncryptUtil.encrypt(po.getOtherPaymentBaseString()));
}
@ -798,9 +805,9 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
if (CollectionUtils.isNotEmpty(insuranceAccountBatchPos)) {
insuranceAccountBatchPos.forEach(po -> {
if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) {
po.setOtherPay(AESEncryptUtil.closeEncryptSetting(po.getOtherPay()));
po.setSocialPay(AESEncryptUtil.closeEncryptSetting(po.getSocialPay()));
po.setFundPay(AESEncryptUtil.closeEncryptSetting(po.getFundPay()));
po.setOtherPay(AESEncryptUtil.closeEncryptSetting(po.getOtherPay(), sysConfPo));
po.setSocialPay(AESEncryptUtil.closeEncryptSetting(po.getSocialPay(), sysConfPo));
po.setFundPay(AESEncryptUtil.closeEncryptSetting(po.getFundPay(), sysConfPo));
} else {
po.setOtherPay(AESEncryptUtil.encrypt(po.getOtherPay()));
po.setSocialPay(AESEncryptUtil.encrypt(po.getSocialPay()));
@ -829,23 +836,23 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
if (CollectionUtils.isNotEmpty(insuranceAccountDetailPos)) {
insuranceAccountDetailPos.forEach(po -> {
if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) {
po.setSocialPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentBaseString()));
po.setFundPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentBaseString()));
po.setOtherPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentBaseString()));
po.setSocialPerJson(AESEncryptUtil.closeEncryptSetting(po.getSocialPerJson()));
po.setSocialPerSum(AESEncryptUtil.closeEncryptSetting(po.getSocialPerSum()));
po.setFundPerJson(AESEncryptUtil.closeEncryptSetting(po.getFundPerJson()));
po.setFundPerSum(AESEncryptUtil.closeEncryptSetting(po.getFundPerSum()));
po.setOtherPerJson(AESEncryptUtil.closeEncryptSetting(po.getOtherPerJson()));
po.setOtherPerSum(AESEncryptUtil.closeEncryptSetting(po.getOtherPerSum()));
po.setPerSum(AESEncryptUtil.closeEncryptSetting(po.getPerSum()));
po.setSocialComJson(AESEncryptUtil.closeEncryptSetting(po.getSocialComJson()));
po.setSocialComSum(AESEncryptUtil.closeEncryptSetting(po.getSocialComSum()));
po.setComSum(AESEncryptUtil.closeEncryptSetting(po.getComSum()));
po.setSocialSum(AESEncryptUtil.closeEncryptSetting(po.getSocialSum()));
po.setFundSum(AESEncryptUtil.closeEncryptSetting(po.getFundSum()));
po.setOtherSum(AESEncryptUtil.closeEncryptSetting(po.getOtherSum()));
po.setTotal(AESEncryptUtil.closeEncryptSetting(po.getTotal()));
po.setSocialPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentBaseString(), sysConfPo));
po.setFundPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentBaseString(), sysConfPo));
po.setOtherPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentBaseString(), sysConfPo));
po.setSocialPerJson(AESEncryptUtil.closeEncryptSetting(po.getSocialPerJson(), sysConfPo));
po.setSocialPerSum(AESEncryptUtil.closeEncryptSetting(po.getSocialPerSum(), sysConfPo));
po.setFundPerJson(AESEncryptUtil.closeEncryptSetting(po.getFundPerJson(), sysConfPo));
po.setFundPerSum(AESEncryptUtil.closeEncryptSetting(po.getFundPerSum(), sysConfPo));
po.setOtherPerJson(AESEncryptUtil.closeEncryptSetting(po.getOtherPerJson(), sysConfPo));
po.setOtherPerSum(AESEncryptUtil.closeEncryptSetting(po.getOtherPerSum(), sysConfPo));
po.setPerSum(AESEncryptUtil.closeEncryptSetting(po.getPerSum(), sysConfPo));
po.setSocialComJson(AESEncryptUtil.closeEncryptSetting(po.getSocialComJson(), sysConfPo));
po.setSocialComSum(AESEncryptUtil.closeEncryptSetting(po.getSocialComSum(), sysConfPo));
po.setComSum(AESEncryptUtil.closeEncryptSetting(po.getComSum(), sysConfPo));
po.setSocialSum(AESEncryptUtil.closeEncryptSetting(po.getSocialSum(), sysConfPo));
po.setFundSum(AESEncryptUtil.closeEncryptSetting(po.getFundSum(), sysConfPo));
po.setOtherSum(AESEncryptUtil.closeEncryptSetting(po.getOtherSum(), sysConfPo));
po.setTotal(AESEncryptUtil.closeEncryptSetting(po.getTotal(), sysConfPo));
} else {
po.setSocialPaymentBaseString(AESEncryptUtil.encrypt(po.getSocialPaymentBaseString()));
po.setFundPaymentBaseString(AESEncryptUtil.encrypt(po.getFundPaymentBaseString()));
@ -888,7 +895,7 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
if (CollectionUtils.isNotEmpty(salaryArchiveItemPos)) {
salaryArchiveItemPos.forEach(po -> {
if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) {
po.setItemValue(AESEncryptUtil.closeEncryptSetting(po.getItemValue()));
po.setItemValue(AESEncryptUtil.closeEncryptSetting(po.getItemValue(), sysConfPo));
} else {
po.setItemValue(AESEncryptUtil.encrypt(po.getItemValue()));
}
@ -942,11 +949,11 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
if (CollectionUtils.isNotEmpty(otherDeductionPos)) {
otherDeductionPos.forEach(po -> {
if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) {
po.setBusinessHealthyInsurance(AESEncryptUtil.closeEncryptSetting(po.getBusinessHealthyInsurance()));
po.setTaxDelayEndowmentInsurance(AESEncryptUtil.closeEncryptSetting(po.getTaxDelayEndowmentInsurance()));
po.setOtherDeduction(AESEncryptUtil.closeEncryptSetting(po.getOtherDeduction()));
po.setDeductionAllowedDonation(AESEncryptUtil.closeEncryptSetting(po.getDeductionAllowedDonation()));
po.setPrivatePension(AESEncryptUtil.closeEncryptSetting(po.getPrivatePension()));
po.setBusinessHealthyInsurance(AESEncryptUtil.closeEncryptSetting(po.getBusinessHealthyInsurance(), sysConfPo));
po.setTaxDelayEndowmentInsurance(AESEncryptUtil.closeEncryptSetting(po.getTaxDelayEndowmentInsurance(), sysConfPo));
po.setOtherDeduction(AESEncryptUtil.closeEncryptSetting(po.getOtherDeduction(), sysConfPo));
po.setDeductionAllowedDonation(AESEncryptUtil.closeEncryptSetting(po.getDeductionAllowedDonation(), sysConfPo));
po.setPrivatePension(AESEncryptUtil.closeEncryptSetting(po.getPrivatePension(), sysConfPo));
} else {
po.setBusinessHealthyInsurance(AESEncryptUtil.encrypt(po.getBusinessHealthyInsurance()));
po.setTaxDelayEndowmentInsurance(AESEncryptUtil.encrypt(po.getTaxDelayEndowmentInsurance()));

View File

@ -0,0 +1,15 @@
package com.engine.salary.util.valid;
import java.lang.annotation.*;
/**
* 数据参数合法性注解
*/
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Modify {
ModifyTypeEnum[] modifyType() default ModifyTypeEnum.TRIM;
ValueTypeEnum valueType() default ValueTypeEnum.STRING;
}

View File

@ -0,0 +1,13 @@
package com.engine.salary.util.valid;
/**
* 修改参数值
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
public enum ModifyTypeEnum {
TRIM, RESTORE_SQL
}

View File

@ -139,6 +139,21 @@ public class ValidUtil {
return value;
}
private static <T> void setValue(T t, String fieldName, Object value) {
try {
BeanInfo beanInfo = Introspector.getBeanInfo(t.getClass());
PropertyDescriptor[] props = beanInfo.getPropertyDescriptors();
for (PropertyDescriptor property : props) {
if (fieldName.equals(property.getName())) {
Method method = property.getWriteMethod();
method.invoke(t, value);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
private static boolean notNull(Object value) {
if (null == value) {
return false;
@ -184,4 +199,57 @@ public class ValidUtil {
return convertSuccess;
}
public static <T> void modify(T t) {
Class<?> clazz = t.getClass();
Field[] fields = clazz.getDeclaredFields();
for (Field field : fields) {
Modify rule = field.getDeclaredAnnotation(Modify.class);
if (null == rule) {
continue;
}
ModifyTypeEnum[] modifyTypeEnums = rule.modifyType();
ValueTypeEnum valueTypeEnum = rule.valueType();
for (int i = 0; i < modifyTypeEnums.length; i++) {
Object value = getValue(t, field.getName());
if (valueTypeEnum == ValueTypeEnum.STRING) {
String result = value.toString();
if (modifyTypeEnums[i] == ModifyTypeEnum.TRIM) {
result = result.trim();
}
if (modifyTypeEnums[i] == ModifyTypeEnum.RESTORE_SQL) {
result = result.replace("", "select")
.replace("", "SELECT")
.replace("", "join")
.replace("", "JOIN")
.replace("", "and")
.replace("", "AND")
.replace("", "or")
.replace("", "OR")
.replace("", "in")
.replace("", "IN")
.replace("", "like")
.replace("", "like")
.replace("", "exists")
.replace("", "EXISTS")
.replace("", "between")
.replace("", "BETWEEN")
.replace("", "union")
.replace("", "UNION");
}
setValue(t, field.getName(), result);
} else if (valueTypeEnum == ValueTypeEnum.OBJECT) {
modify(value);
} else if (valueTypeEnum == ValueTypeEnum.ARRAY) {
Collection list = (Collection) value;
list.forEach(l -> modify(l));
}
}
}
}
}

View File

@ -0,0 +1,13 @@
package com.engine.salary.util.valid;
/**
* 值类型
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
public enum ValueTypeEnum {
STRING, OBJECT,ARRAY
}

View File

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