Merge branch 'feature/扩展人员维度属性' into feature/报表支持自定义维度
This commit is contained in:
commit
b30c9b1ca9
|
|
@ -1705,15 +1705,6 @@ public class SIArchivesBiz {
|
|||
}
|
||||
|
||||
|
||||
private List<InsuranceSchemeDetailPO> decryptSchemeDetailList(List<InsuranceSchemeDetailPO> encryptList) {
|
||||
encryptList.forEach(item -> {
|
||||
item.setUpperLimit(AESEncryptUtil.decrypt(item.getUpperLimit()));
|
||||
item.setFixedCost(AESEncryptUtil.decrypt(item.getFixedCost()));
|
||||
item.setLowerLimit(AESEncryptUtil.decrypt(item.getLowerLimit()));
|
||||
});
|
||||
return encryptList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否需要生成历史福利档案基本信息
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package com.engine.salary.biz;
|
|||
|
||||
import com.api.formmode.mybatis.util.SqlProxyHandle;
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.encrypt.AESEncryptUtil;
|
||||
import com.engine.salary.encrypt.EncryptUtil;
|
||||
import com.engine.salary.entity.sicategory.po.ICategoryPO;
|
||||
import com.engine.salary.entity.sischeme.bo.InsuranceSchemeBO;
|
||||
|
|
@ -409,7 +408,7 @@ public class SISchemeBiz {
|
|||
insuranceSchemeMapper.insert(batchPO);
|
||||
|
||||
List<InsuranceSchemeDetailPO> detailList = insuranceSchemeDetailMapper.queryListBySchemeId(id);
|
||||
detailList = decryptSchemeDetailList(detailList);
|
||||
detailList = encryptUtil.decryptList(detailList,InsuranceSchemeDetailPO.class);
|
||||
if (CollectionUtils.isNotEmpty(detailList)) {
|
||||
List<InsuranceSchemeDetailPO> detailPOS = detailList.stream().map(item -> InsuranceSchemeDetailPO.builder()
|
||||
.creator(employeeId)
|
||||
|
|
@ -461,16 +460,6 @@ public class SISchemeBiz {
|
|||
|
||||
}
|
||||
|
||||
|
||||
private List<InsuranceSchemeDetailPO> decryptSchemeDetailList(List<InsuranceSchemeDetailPO> encryptList) {
|
||||
encryptList.forEach(item -> {
|
||||
item.setUpperLimit(AESEncryptUtil.decrypt(item.getUpperLimit()));
|
||||
item.setFixedCost(AESEncryptUtil.decrypt(item.getFixedCost()));
|
||||
item.setLowerLimit(AESEncryptUtil.decrypt(item.getLowerLimit()));
|
||||
});
|
||||
return encryptList;
|
||||
}
|
||||
|
||||
public int checkBeforeDeleteSocialscheme(Map<String, Object> params) {
|
||||
return getSIAccountUtilMapper().checkBeforeDeleteSocialscheme((Collection<Long>) params.get("ids")).get(0).getNum();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ import lombok.Builder;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 员工基本信息
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
|
|
@ -99,6 +101,7 @@ public class DataCollectionEmployee {
|
|||
private Double workYear;
|
||||
private Double companyWorkYear;
|
||||
|
||||
@SalaryFormulaVar(defaultLabel = "证件号码", labelId = 98624, dataType = "string")
|
||||
private String idNo;
|
||||
|
||||
//是否是系统管理员
|
||||
|
|
@ -107,5 +110,10 @@ public class DataCollectionEmployee {
|
|||
//是否外部人员
|
||||
private boolean extEmp;
|
||||
|
||||
/**
|
||||
* 扩展数据
|
||||
*/
|
||||
private Map<String,String> extendData;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,48 @@
|
|||
package com.engine.salary.entity.hrm.dto;
|
||||
|
||||
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
|
||||
*/
|
||||
private String expandSql;
|
||||
|
||||
/**
|
||||
* 字段设置
|
||||
*/
|
||||
private List<FieldSetting> fieldSettings;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.engine.salary.entity.hrm.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class FieldSetting {
|
||||
|
||||
/**
|
||||
* 字段
|
||||
*/
|
||||
private String field;
|
||||
|
||||
/**
|
||||
* 显示
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
private String value;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer index;
|
||||
}
|
||||
|
|
@ -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;
|
||||
|
||||
}
|
||||
|
|
@ -116,6 +116,7 @@ public class SalaryAcctFormulaBO {
|
|||
.companystartdate(simpleEmployee.getCompanystartdate())
|
||||
.birthday(simpleEmployee.getBirthday())
|
||||
.workcode(simpleEmployee.getWorkcode())
|
||||
.idNo(simpleEmployee.getIdNo())
|
||||
.build();
|
||||
return JsonUtil.parseMap(JsonUtil.toJsonString(formulaEmployee), String.class);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,8 +75,8 @@ public class SalaryFormulaEmployeeDTO {
|
|||
private String sex;
|
||||
|
||||
|
||||
// @SalaryFormulaVar(defaultLabel = "证件号码", labelId = 86318, dataType = "string")
|
||||
// private String idNo;
|
||||
@SalaryFormulaVar(defaultLabel = "证件号码", labelId = 86318, dataType = "string")
|
||||
private String idNo;
|
||||
|
||||
//邮件
|
||||
@SalaryFormulaVar(defaultLabel = "邮件", labelId = 92919, dataType = "string")
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
@ -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>
|
||||
|
|
@ -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;
|
||||
|
|
@ -15,6 +18,8 @@ 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;
|
||||
|
|
@ -29,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;
|
||||
|
|
@ -82,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));
|
||||
}
|
||||
|
||||
/**
|
||||
* 参数转换
|
||||
*
|
||||
|
|
@ -1052,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);
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
@ -392,8 +399,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 +408,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());
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -464,7 +471,7 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|||
}
|
||||
|
||||
public List getReportCache() {
|
||||
List report = new ArrayList<>();
|
||||
List report = new ArrayList<>();
|
||||
|
||||
//获取所有缓存报表的id
|
||||
String salaryReportIds = Utils.null2String(getSalaryCacheService(user).get(SalaryCacheKey.SALARY_REPORT_IDS));
|
||||
|
|
@ -473,13 +480,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 +1021,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 +1039,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())) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除薪酬统计维度
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -22,6 +23,7 @@ import com.engine.salary.service.SalaryItemService;
|
|||
import com.engine.salary.service.impl.SalaryItemServiceImpl;
|
||||
import com.engine.salary.util.JsonUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.XssSQL;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
|
|
@ -43,11 +45,11 @@ public class SalaryStatisticsDimensionWrapper extends Service {
|
|||
|
||||
|
||||
private SalaryStatisticsDimensionService salaryStatisticsDimensionService(User user) {
|
||||
return ServiceUtil.getService(SalaryStatisticsDimensionServiceImpl.class, user);
|
||||
return ServiceUtil.getService(SalaryStatisticsDimensionServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryItemService salaryItemService(User user) {
|
||||
return ServiceUtil.getService(SalaryItemServiceImpl.class, user);
|
||||
return ServiceUtil.getService(SalaryItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryStatisticsDimensionService getSalaryStatisticsDimensionService(User 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);
|
||||
}
|
||||
|
|
@ -99,7 +101,7 @@ public class SalaryStatisticsDimensionWrapper extends Service {
|
|||
});
|
||||
}
|
||||
|
||||
PageInfo<SalaryStatisticsDimensionListDTO> salaryStatisticsDimensionListDTOPageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize());
|
||||
PageInfo<SalaryStatisticsDimensionListDTO> salaryStatisticsDimensionListDTOPageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize());
|
||||
salaryStatisticsDimensionListDTOPageInfo.setList(dtoList);
|
||||
salaryStatisticsDimensionListDTOPageInfo.setTotal(page.getTotal());
|
||||
return salaryStatisticsDimensionListDTOPageInfo;
|
||||
|
|
@ -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,27 @@ public class SalaryStatisticsDimensionWrapper extends Service {
|
|||
return salaryStatisticsDimensionService(user).save(saveParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存薪酬统计维度扩展设置
|
||||
*
|
||||
* @param saveParam
|
||||
* @return
|
||||
*/
|
||||
public void saveExpandFieldSettings(EmployeeInfoExpandDTO saveParam) {
|
||||
saveParam.setExpandSql(XssSQL.handleXSSContent(saveParam.getExpandSql()));
|
||||
salaryStatisticsDimensionService(user).saveExpandFieldSettings(saveParam);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询薪酬统计维度扩展字段设置
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public EmployeeInfoExpandDTO getExpandFieldSettings(String module) {
|
||||
return salaryStatisticsDimensionService(user).getExpandFieldSettings(module);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除薪酬统计维度
|
||||
*
|
||||
|
|
@ -211,4 +234,5 @@ public class SalaryStatisticsDimensionWrapper extends Service {
|
|||
return map;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package com.engine.salary.service;
|
|||
import com.engine.salary.entity.report.po.SalaryAcctResultReportPO;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 薪资报表
|
||||
|
|
@ -15,23 +14,6 @@ import java.util.List;
|
|||
**/
|
||||
public interface SalaryAcctReportService {
|
||||
|
||||
/**
|
||||
* 薪酬解密方法
|
||||
*
|
||||
* @param s 待解密字符串
|
||||
* @return
|
||||
*/
|
||||
List<String> decrypt(List<String> s);
|
||||
|
||||
|
||||
/**
|
||||
* 薪酬解密方法
|
||||
*
|
||||
* @param s 待解密字符串
|
||||
* @return
|
||||
*/
|
||||
String decrypt(String s);
|
||||
|
||||
/**
|
||||
* 保存核算记录报表数据
|
||||
* @param pos
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
@ -99,4 +100,26 @@ 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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1477,16 +1477,6 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|||
}
|
||||
|
||||
|
||||
private List<InsuranceSchemeDetailPO> decryptSchemeDetailList(List<InsuranceSchemeDetailPO> encryptList) {
|
||||
encryptList.forEach(item -> {
|
||||
item.setUpperLimit(AESEncryptUtil.decrypt(item.getUpperLimit()));
|
||||
item.setFixedCost(AESEncryptUtil.decrypt(item.getFixedCost()));
|
||||
item.setLowerLimit(AESEncryptUtil.decrypt(item.getLowerLimit()));
|
||||
});
|
||||
return encryptList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 校验待新增的社保福利档案数据
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ import com.engine.salary.sys.enums.OpenEnum;
|
|||
import com.engine.salary.sys.service.SalarySysConfService;
|
||||
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import weaver.hrm.User;
|
||||
|
||||
|
|
@ -42,31 +41,6 @@ public class SalaryAcctReportServiceImpl extends Service implements SalaryAcctRe
|
|||
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 薪酬解密方法
|
||||
*
|
||||
* @param s 待解密字符串
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<String> decrypt(List<String> s) {
|
||||
if (s != null) {
|
||||
return s.stream().map(AESEncryptUtil::decrypt).collect(Collectors.toList());
|
||||
}
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 薪酬解密方法
|
||||
*
|
||||
* @param s 待解密字符串
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String decrypt(String s) {
|
||||
return AESEncryptUtil.decrypt(s);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存核算报表数据
|
||||
*
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package com.engine.salary.service.impl;
|
|||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.encrypt.AESEncryptUtil;
|
||||
import com.engine.salary.encrypt.EncryptUtil;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.salaryacct.bo.SalaryAcctResultBO;
|
||||
|
|
@ -17,7 +16,10 @@ import com.engine.salary.entity.salaryformula.ExpressFormula;
|
|||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.bo.SalarySobItemAggregateBO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO;
|
||||
import com.engine.salary.entity.salarysob.po.*;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobEmpFieldPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobItemGroupPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobItemPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.salaryacct.ExcelAcctResultMapper;
|
||||
|
|
@ -268,14 +270,4 @@ public class SalaryComparisonResultServiceImpl extends Service implements Salary
|
|||
public void deleteBySalaryAcctRecordIds(Collection<Long> salaryAcctRecordIds) {
|
||||
getExcelAcctResultMapper().deleteBySalaryAcctRecordIds(salaryAcctRecordIds);
|
||||
}
|
||||
|
||||
private Collection<ExcelAcctResultPO> encryptCollection(Collection<ExcelAcctResultPO> collection) {
|
||||
collection.forEach(item -> item.setResultValue(AESEncryptUtil.encrypt(item.getResultValue())));
|
||||
return collection;
|
||||
}
|
||||
|
||||
private Collection<ExcelAcctResultPO> decryptCollection(Collection<ExcelAcctResultPO> collection) {
|
||||
collection.forEach(item -> item.setResultValue(AESEncryptUtil.decrypt(item.getResultValue())));
|
||||
return collection;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
*/
|
||||
|
|
@ -283,4 +291,93 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
List<DataCollectionEmployee> employeeList = employBiz.listByDismissDate(dismissDate);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
package com.engine.salary.transmethod;
|
||||
|
||||
import com.engine.salary.encrypt.AESEncryptUtil;
|
||||
|
||||
public class EncryptTransMethod {
|
||||
public static String decrypt(String source) {
|
||||
return AESEncryptUtil.decrypt(source);
|
||||
}
|
||||
// public static String decrypt(String source) {
|
||||
// return AESEncryptUtil.decrypt(source);
|
||||
// }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
package com.engine.salary.util;
|
||||
|
||||
public class XssSQL {
|
||||
|
||||
public static String handleXSSContent(String xss) {
|
||||
return xss.replace("select", "select")
|
||||
.replace("SELECT", "SELECT")
|
||||
.replace("join", "join")
|
||||
.replace("JOIN", "JOIN")
|
||||
.replace("and", "and")
|
||||
.replace("AND", "AND")
|
||||
.replace("or", "or")
|
||||
.replace("OR", "OR")
|
||||
.replace("in", "in")
|
||||
.replace("IN", "IN")
|
||||
.replace("like", "like")
|
||||
.replace("LIKE", "like")
|
||||
.replace("exists", "exists")
|
||||
.replace("EXISTS", "EXISTS")
|
||||
.replace("between", "between")
|
||||
.replace("BETWEEN", "BETWEEN")
|
||||
.replace("union", "union")
|
||||
.replace("UNION", "UNION");
|
||||
}
|
||||
}
|
||||
|
|
@ -20,6 +20,7 @@ import com.engine.salary.util.SalaryI18nUtil;
|
|||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.wrapper.SISchemeWrapper;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
|
@ -48,15 +49,16 @@ import java.util.stream.Collectors;
|
|||
* @Date 2022/3/7
|
||||
* @Version V1.0
|
||||
**/
|
||||
@Slf4j
|
||||
public class SISchemeController {
|
||||
|
||||
private SISchemeService getService(User user) {
|
||||
return ServiceUtil.getService(SISchemeServiceImpl.class,user);
|
||||
return ServiceUtil.getService(SISchemeServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SISchemeWrapper getSISchemeWrapper(User user) {
|
||||
|
||||
return ServiceUtil.getService(SISchemeWrapper.class,user);
|
||||
return ServiceUtil.getService(SISchemeWrapper.class, user);
|
||||
}
|
||||
|
||||
private SIAccountService getSIAccountService(User user) {
|
||||
|
|
@ -65,6 +67,7 @@ public class SISchemeController {
|
|||
|
||||
/**
|
||||
* 查询福利方案表单
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
|
|
@ -77,13 +80,14 @@ public class SISchemeController {
|
|||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
//InsuranceSchemeDTO insuranceSchemeDTO = InsuranceSchemeDTO.builder().welfareType(welfareTypeEnum).build();
|
||||
map.put("welfareTypeEnum",welfareTypeEnum);
|
||||
return new ResponseResult< Map<String, Object>, Map<String, Object>>(user).run(getService(user)::getForm,map);
|
||||
map.put("welfareTypeEnum", welfareTypeEnum);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getService(user)::getForm, map);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询福利方案列表
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
|
|
@ -99,6 +103,7 @@ public class SISchemeController {
|
|||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
|
|
@ -109,12 +114,13 @@ public class SISchemeController {
|
|||
public String insertScheme(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody InsuranceSchemeReqParam insuranceSchemeReqParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
map.put("insuranceSchemeReqParam",insuranceSchemeReqParam);
|
||||
return new ResponseResult< Map<String, Object>, Map<String, Object>>(user).run(getService(user)::insertScheme,map);
|
||||
map.put("insuranceSchemeReqParam", insuranceSchemeReqParam);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getService(user)::insertScheme, map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑方案主表和明细表数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param insuranceSchemeReqParam
|
||||
|
|
@ -123,15 +129,16 @@ public class SISchemeController {
|
|||
@POST
|
||||
@Path("/update")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String update(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody InsuranceSchemeReqParam insuranceSchemeReqParam) {
|
||||
public String update(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody InsuranceSchemeReqParam insuranceSchemeReqParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
map.put("insuranceSchemeReqParam",insuranceSchemeReqParam);
|
||||
return new ResponseResult< Map<String, Object>, Map<String, Object>>(user).run(getService(user)::update,map);
|
||||
map.put("insuranceSchemeReqParam", insuranceSchemeReqParam);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getService(user)::update, map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑方案明细表数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param schemeDetailList
|
||||
|
|
@ -140,13 +147,14 @@ public class SISchemeController {
|
|||
@POST
|
||||
@Path("/updateSchemeDetail")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String updateSchemeDetail(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody List<InsuranceSchemeDetailUpdateParam> schemeDetailList) {
|
||||
public String updateSchemeDetail(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody List<InsuranceSchemeDetailUpdateParam> schemeDetailList) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult< List<InsuranceSchemeDetailUpdateParam> , List<String>>(user).run(getService(user)::updateSchemeDetail,schemeDetailList);
|
||||
return new ResponseResult<List<InsuranceSchemeDetailUpdateParam>, List<String>>(user).run(getService(user)::updateSchemeDetail, schemeDetailList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除(接口中暂无)
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param insuranceSchemeReqParam
|
||||
|
|
@ -158,13 +166,14 @@ public class SISchemeController {
|
|||
public String deleteTaxRate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody InsuranceSchemeReqParam insuranceSchemeReqParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
map.put("ids",insuranceSchemeReqParam.getIds());
|
||||
map.put("ids", insuranceSchemeReqParam.getIds());
|
||||
map.put("welfareTypeId", insuranceSchemeReqParam.getWelfareTypeEnum().getValue());
|
||||
return new ResponseResult< Map<String, Object>, Map<String, Object>>(user).run(getService(user)::delete,map);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getService(user)::delete, map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复制福利方案表单
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
|
|
@ -176,55 +185,61 @@ public class SISchemeController {
|
|||
@QueryParam("id") Long id, @QueryParam("schemeName") String schemeName) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
map.put("id",id);
|
||||
map.put("schemeName",schemeName);
|
||||
return new ResponseResult< Map<String, Object>, Map<String, Object>>(user).run(getService(user)::copyScheme,map);
|
||||
map.put("id", id);
|
||||
map.put("schemeName", schemeName);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getService(user)::copyScheme, map);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出档案
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/export")
|
||||
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
||||
public Response export(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
InsuranceArchivesListParam param = buildInsuranceArchivesListParam(request);
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
XSSFWorkbook workbook = getService(user).export(param);
|
||||
String fileName ;
|
||||
//表头
|
||||
if (param.getRunStatuses().size() > 0) {
|
||||
if (param.getRunStatuses().contains(EmployeeStatusEnum.STAY_ADD.getValue()) && param.getRunStatuses().size() == 1) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出" + "-" + EmployeeStatusEnum.STAY_ADD.getDefaultLabel());
|
||||
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.PAYING.getValue()) && param.getRunStatuses().contains(EmployeeStatusEnum.STAY_DEL.getValue()) && param.getRunStatuses().size() == 2) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出" + "-" + "在缴员工");
|
||||
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.STAY_DEL.getValue()) && param.getRunStatuses().size() == 1) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出" + "-" + EmployeeStatusEnum.STAY_DEL.getDefaultLabel());
|
||||
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.STOP_PAYMENT_FROM_ADD.getValue()) && param.getRunStatuses().contains(EmployeeStatusEnum.STOP_PAYMENT_FROM_DEL.getValue()) && param.getRunStatuses().size() == 2) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出" + "-" + "停缴员工");
|
||||
try {
|
||||
InsuranceArchivesListParam param = buildInsuranceArchivesListParam(request);
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
XSSFWorkbook workbook = getService(user).export(param);
|
||||
String fileName;
|
||||
//表头
|
||||
if (param.getRunStatuses().size() > 0) {
|
||||
if (param.getRunStatuses().contains(EmployeeStatusEnum.STAY_ADD.getValue()) && param.getRunStatuses().size() == 1) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出" + "-" + EmployeeStatusEnum.STAY_ADD.getDefaultLabel());
|
||||
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.PAYING.getValue()) && param.getRunStatuses().contains(EmployeeStatusEnum.STAY_DEL.getValue()) && param.getRunStatuses().size() == 2) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出" + "-" + "在缴员工");
|
||||
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.STAY_DEL.getValue()) && param.getRunStatuses().size() == 1) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出" + "-" + EmployeeStatusEnum.STAY_DEL.getDefaultLabel());
|
||||
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.STOP_PAYMENT_FROM_ADD.getValue()) && param.getRunStatuses().contains(EmployeeStatusEnum.STOP_PAYMENT_FROM_DEL.getValue()) && param.getRunStatuses().size() == 2) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出" + "-" + "停缴员工");
|
||||
} else {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出");
|
||||
}
|
||||
} else {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出");
|
||||
}
|
||||
} else {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出");
|
||||
}
|
||||
|
||||
fileName = fileName + LocalDate.now();
|
||||
try {
|
||||
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
fileName = fileName + LocalDate.now();
|
||||
try {
|
||||
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
StreamingOutput output = outputStream -> {
|
||||
workbook.write(outputStream);
|
||||
outputStream.flush();
|
||||
};
|
||||
return Response.ok(output)
|
||||
.header("Content-disposition", "attachment;filename=" + fileName)
|
||||
.header("Cache-Control", "no-cache").build();
|
||||
StreamingOutput output = outputStream -> {
|
||||
workbook.write(outputStream);
|
||||
outputStream.flush();
|
||||
};
|
||||
return Response.ok(output)
|
||||
.header("Content-disposition", "attachment;filename=" + fileName)
|
||||
.header("Cache-Control", "no-cache").build();
|
||||
} catch (Exception e) {
|
||||
log.error("社保福利档案导出异常", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -248,58 +263,63 @@ public class SISchemeController {
|
|||
|
||||
/**
|
||||
* 导出档案和档案模板
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/template/export")
|
||||
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
||||
public Response exportTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
InsuranceArchivesListParam param = buildInsuranceArchivesListParam(request);
|
||||
|
||||
InsuranceArchivesListParam param = buildInsuranceArchivesListParam(request);
|
||||
|
||||
param.setExportData(Boolean.valueOf(request.getParameter("exportData")));
|
||||
param.setExtWelArchiveList(Boolean.valueOf(request.getParameter("extWelArchiveList")));
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
if (param.getInspectAll() != null && param.getInspectAll()) {
|
||||
List<InsuranceAccountInspectPO> insuranceAccountInspectPOS = getSIAccountService(user).allInspects(param.getIds(), param.getBillMonth());
|
||||
param.setEmployeeIds(insuranceAccountInspectPOS.stream().map(InsuranceAccountInspectPO::getEmployeeId).distinct().collect(Collectors.toList()));
|
||||
}
|
||||
XSSFWorkbook workbook = getService(user).exportTemplate(param);
|
||||
String fileName;
|
||||
//表头
|
||||
if (param.isExtWelArchiveList()) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(0, "社保福利档案导入模板") + "-" + SalaryI18nUtil.getI18nLabel(542679, "非系统人员");
|
||||
} else if (param.getRunStatuses().size() > 0) {
|
||||
if (param.getRunStatuses().contains(EmployeeStatusEnum.STAY_ADD.getValue()) && param.getRunStatuses().size() == 1) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板" + "-" + EmployeeStatusEnum.STAY_ADD.getDefaultLabel());
|
||||
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.PAYING.getValue()) && param.getRunStatuses().contains(EmployeeStatusEnum.STAY_DEL.getValue()) && param.getRunStatuses().size() == 2) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板" + "-" + "在缴员工");
|
||||
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.STAY_DEL.getValue()) && param.getRunStatuses().size() == 1) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板" + "-" + EmployeeStatusEnum.STAY_DEL.getDefaultLabel());
|
||||
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.STOP_PAYMENT_FROM_ADD.getValue()) && param.getRunStatuses().contains(EmployeeStatusEnum.STOP_PAYMENT_FROM_DEL.getValue()) && param.getRunStatuses().size() == 2) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板" + "-" + "停缴员工");
|
||||
param.setExportData(Boolean.valueOf(request.getParameter("exportData")));
|
||||
param.setExtWelArchiveList(Boolean.valueOf(request.getParameter("extWelArchiveList")));
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
if (param.getInspectAll() != null && param.getInspectAll()) {
|
||||
List<InsuranceAccountInspectPO> insuranceAccountInspectPOS = getSIAccountService(user).allInspects(param.getIds(), param.getBillMonth());
|
||||
param.setEmployeeIds(insuranceAccountInspectPOS.stream().map(InsuranceAccountInspectPO::getEmployeeId).distinct().collect(Collectors.toList()));
|
||||
}
|
||||
XSSFWorkbook workbook = getService(user).exportTemplate(param);
|
||||
String fileName;
|
||||
//表头
|
||||
if (param.isExtWelArchiveList()) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(0, "社保福利档案导入模板") + "-" + SalaryI18nUtil.getI18nLabel(542679, "非系统人员");
|
||||
} else if (param.getRunStatuses().size() > 0) {
|
||||
if (param.getRunStatuses().contains(EmployeeStatusEnum.STAY_ADD.getValue()) && param.getRunStatuses().size() == 1) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板" + "-" + EmployeeStatusEnum.STAY_ADD.getDefaultLabel());
|
||||
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.PAYING.getValue()) && param.getRunStatuses().contains(EmployeeStatusEnum.STAY_DEL.getValue()) && param.getRunStatuses().size() == 2) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板" + "-" + "在缴员工");
|
||||
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.STAY_DEL.getValue()) && param.getRunStatuses().size() == 1) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板" + "-" + EmployeeStatusEnum.STAY_DEL.getDefaultLabel());
|
||||
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.STOP_PAYMENT_FROM_ADD.getValue()) && param.getRunStatuses().contains(EmployeeStatusEnum.STOP_PAYMENT_FROM_DEL.getValue()) && param.getRunStatuses().size() == 2) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板" + "-" + "停缴员工");
|
||||
} else {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板");
|
||||
}
|
||||
} else {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板");
|
||||
}
|
||||
} else {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板");
|
||||
|
||||
|
||||
fileName = fileName + LocalDate.now();
|
||||
try {
|
||||
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
StreamingOutput output = outputStream -> {
|
||||
workbook.write(outputStream);
|
||||
outputStream.flush();
|
||||
};
|
||||
return Response.ok(output)
|
||||
.header("Content-disposition", "attachment;filename=" + fileName)
|
||||
.header("Cache-Control", "no-cache").build();
|
||||
} catch (Exception e) {
|
||||
log.error("社保福利档案模板导出异常", e);
|
||||
throw e;
|
||||
}
|
||||
|
||||
|
||||
fileName = fileName + LocalDate.now();
|
||||
try {
|
||||
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
StreamingOutput output = outputStream -> {
|
||||
workbook.write(outputStream);
|
||||
outputStream.flush();
|
||||
};
|
||||
return Response.ok(output)
|
||||
.header("Content-disposition", "attachment;filename=" + fileName)
|
||||
.header("Cache-Control", "no-cache").build();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
|
@ -307,13 +327,13 @@ public class SISchemeController {
|
|||
InsuranceArchivesListParam param = new InsuranceArchivesListParam();
|
||||
|
||||
String ids = request.getParameter("ids");
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
param.setIds( Arrays.stream(ids.split(",")).map(Long::valueOf).collect(Collectors.toList()));
|
||||
if (StringUtils.isNotBlank(ids)) {
|
||||
param.setIds(Arrays.stream(ids.split(",")).map(Long::valueOf).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
String runStatuses = request.getParameter("runStatuses");
|
||||
if(StringUtils.isNotBlank(runStatuses)){
|
||||
param.setRunStatuses( Arrays.stream(runStatuses.split(",")).map(String::valueOf).collect(Collectors.toList()));
|
||||
if (StringUtils.isNotBlank(runStatuses)) {
|
||||
param.setRunStatuses(Arrays.stream(runStatuses.split(",")).map(String::valueOf).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
String statusesStr = request.getParameter("statusesStr");
|
||||
|
|
@ -360,5 +380,4 @@ public class SISchemeController {
|
|||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue