Merge branch 'feature/240302-薪资核算导出模板' into custom/上海港湾-多语言
# Conflicts: # src/com/engine/salary/service/SalaryAcctExcelService.java # src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java
This commit is contained in:
commit
4bfa63c3f7
|
|
@ -0,0 +1,13 @@
|
|||
CREATE TABLE hrsa_acct_result_template (
|
||||
id NUMBER(38,0) primary key ,
|
||||
template_name varchar(255),
|
||||
salary_sob_id NUMBER(38,0) ,
|
||||
salary_item_ids varchar(4000),
|
||||
creator NUMBER(38,0),
|
||||
update_time DATE default sysdate,
|
||||
create_time DATE default sysdate,
|
||||
delete_type NUMBER,
|
||||
tenant_key varchar(20)
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
CREATE TABLE hrsa_acct_result_template (
|
||||
id NUMBER(38,0) primary key ,
|
||||
template_name varchar(255),
|
||||
salary_sob_id NUMBER(38,0) ,
|
||||
salary_item_ids varchar(4000),
|
||||
creator NUMBER(38,0),
|
||||
update_time DATE default sysdate,
|
||||
create_time DATE default sysdate,
|
||||
delete_type NUMBER,
|
||||
tenant_key varchar(20)
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
CREATE TABLE hrsa_acct_result_template (
|
||||
id NUMBER(38,0) primary key ,
|
||||
template_name varchar(255),
|
||||
salary_sob_id NUMBER(38,0) ,
|
||||
salary_item_ids varchar(4000),
|
||||
creator NUMBER(38,0),
|
||||
update_time DATE default sysdate,
|
||||
create_time DATE default sysdate,
|
||||
delete_type NUMBER,
|
||||
tenant_key varchar(20)
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
CREATE table hrsa_acct_result_template (
|
||||
id bigint NOT NULL,
|
||||
template_name varchar(255) NULL DEFAULT NULL,
|
||||
salary_sob_id bigint NULL DEFAULT NULL ,
|
||||
salary_item_ids varchar(4000) NULL DEFAULT NULL ,
|
||||
creator bigint NULL DEFAULT NULL,
|
||||
update_time datetime NULL DEFAULT NULL,
|
||||
create_time datetime NULL DEFAULT NULL,
|
||||
delete_type int NULL DEFAULT NULL,
|
||||
tenant_key varchar(20) NULL DEFAULT NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
CREATE TABLE hrsa_acct_result_template (
|
||||
id NUMBER(38,0) primary key ,
|
||||
template_name varchar(255),
|
||||
salary_sob_id NUMBER(38,0) ,
|
||||
salary_item_ids varchar(4000),
|
||||
creator NUMBER(38,0),
|
||||
update_time DATE default sysdate,
|
||||
create_time DATE default sysdate,
|
||||
delete_type NUMBER,
|
||||
tenant_key varchar(20)
|
||||
)
|
||||
/
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
CREATE table hrsa_acct_result_template (
|
||||
id bigint primary key,
|
||||
template_name varchar(255),
|
||||
salary_sob_id bigint ,
|
||||
salary_item_ids varchar(4000) ,
|
||||
creator bigint,
|
||||
update_time timestamp default now(),
|
||||
create_time timestamp default now(),
|
||||
delete_type int default 0,
|
||||
tenant_key varchar(10)
|
||||
);
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
CREATE TABLE hrsa_acct_result_template (
|
||||
id bigint NOT NULL,
|
||||
template_name varchar(255) NULL DEFAULT NULL,
|
||||
salary_sob_id bigint NULL DEFAULT NULL ,
|
||||
salary_item_ids varchar(4000) NULL DEFAULT NULL ,
|
||||
creator bigint NULL DEFAULT NULL,
|
||||
update_time datetime NULL DEFAULT NULL,
|
||||
create_time datetime NULL DEFAULT NULL,
|
||||
delete_type int NULL DEFAULT NULL,
|
||||
tenant_key varchar(20) NULL DEFAULT NULL,
|
||||
PRIMARY KEY (id)
|
||||
)
|
||||
GO
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
package com.engine.salary.entity.salaryacct.dto;
|
||||
|
||||
import com.engine.salary.annotation.TableTitle;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @ClassName SalaryAcctResultTemplatePO
|
||||
* @author Harryxzy
|
||||
* @date 2024/3/26 15:08
|
||||
* @description 薪资核算导出模板
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Data
|
||||
public class SalaryAcctResultTemplateDTO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 模板名称
|
||||
*/
|
||||
@TableTitle(title ="模板名称",key = "templateName",dataIndex = "templateName")
|
||||
private String templateName;
|
||||
|
||||
/**
|
||||
* 薪资账套id
|
||||
*/
|
||||
private Long salarySobId;
|
||||
|
||||
/**
|
||||
* 薪资项目id
|
||||
*/
|
||||
private String salaryItemIds;
|
||||
|
||||
@TableTitle(title ="创建时间",key = "createTime",dataIndex = "createTime")
|
||||
private String createTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
package com.engine.salary.entity.salaryacct.param;
|
||||
|
||||
import com.engine.salary.common.BaseQueryParam;
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName SalaryAcctResultTemplatePO
|
||||
* @author Harryxzy
|
||||
* @date 2024/3/26 15:08
|
||||
* @description 薪资核算导出模板
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Data
|
||||
public class SalaryAcctResultTemplateSaveParam extends BaseQueryParam {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
private List<Long> ids;
|
||||
|
||||
/**
|
||||
* 薪资账套id
|
||||
*/
|
||||
private Long salarySobId;
|
||||
|
||||
private Long salaryAcctRecordId;
|
||||
|
||||
/**
|
||||
* 薪资项目id
|
||||
*/
|
||||
private List<Long> salaryItemIds;
|
||||
|
||||
/**
|
||||
* 模板名称
|
||||
*/
|
||||
@DataCheck(require = true, message= "模板名称不能为空")
|
||||
private String templateName;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
package com.engine.salary.entity.salaryacct.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @ClassName SalaryAcctResultTemplatePO
|
||||
* @author Harryxzy
|
||||
* @date 2024/3/26 15:08
|
||||
* @description 薪资核算导出模板
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Data
|
||||
public class SalaryAcctResultTemplatePO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 模板名称
|
||||
*/
|
||||
private String templateName;
|
||||
|
||||
/**
|
||||
* 薪资账套id
|
||||
*/
|
||||
private Long salarySobId;
|
||||
|
||||
/**
|
||||
* 薪资项目id
|
||||
*/
|
||||
private String salaryItemIds;
|
||||
|
||||
private Long creator;
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private Integer deleteType;
|
||||
|
||||
private String tenantKey;
|
||||
|
||||
//主键id集合
|
||||
private Collection<Long> ids;
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
package com.engine.salary.mapper.salaryacct;
|
||||
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultTemplatePO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SalaryAcctResultTemplateMapper {
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<SalaryAcctResultTemplatePO> listAll();
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<SalaryAcctResultTemplatePO> listSome(SalaryAcctResultTemplatePO salaryAcctResultTemplate);
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
SalaryAcctResultTemplatePO getById(Long id);
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
*
|
||||
* @param salaryAcctResultTemplate 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(SalaryAcctResultTemplatePO salaryAcctResultTemplate);
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param salaryAcctResultTemplate 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(SalaryAcctResultTemplatePO salaryAcctResultTemplate);
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
*
|
||||
* @param salaryAcctResultTemplate 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(SalaryAcctResultTemplatePO salaryAcctResultTemplate);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param id 待删除的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int deleteById(Long id);
|
||||
|
||||
int deleteByIds(@Param("ids") List<Long> ids);
|
||||
}
|
||||
|
|
@ -0,0 +1,221 @@
|
|||
<?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.salaryacct.SalaryAcctResultTemplateMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.salaryacct.po.SalaryAcctResultTemplatePO">
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="creator" property="creator" />
|
||||
<result column="delete_type" property="deleteType" />
|
||||
<result column="id" property="id" />
|
||||
<result column="salary_item_ids" property="salaryItemIds" />
|
||||
<result column="salary_sob_id" property="salarySobId" />
|
||||
<result column="template_name" property="templateName" />
|
||||
<result column="tenant_key" property="tenantKey" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t.create_time
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
, t.id
|
||||
, t.salary_item_ids
|
||||
, t.salary_sob_id
|
||||
, t.template_name
|
||||
, t.tenant_key
|
||||
, t.update_time
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="listAll" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns" />
|
||||
FROM hrsa_acct_result_template t
|
||||
WHERE delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据主键获取单条记录 -->
|
||||
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
|
||||
SELECT
|
||||
<include refid="baseColumns" />
|
||||
FROM hrsa_acct_result_template t
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 条件查询 -->
|
||||
<select id="listSome" resultMap="BaseResultMap" parameterType="com.engine.salary.entity.salaryacct.po.SalaryAcctResultTemplatePO">
|
||||
SELECT
|
||||
<include refid="baseColumns" />
|
||||
FROM hrsa_acct_result_template t
|
||||
WHERE delete_type = 0
|
||||
<if test="createTime != null">
|
||||
AND create_time = #{createTime}
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
AND creator = #{creator}
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
AND delete_type = #{deleteType}
|
||||
</if>
|
||||
<if test="id != null">
|
||||
AND id = #{id}
|
||||
</if>
|
||||
<if test="salaryItemIds != null">
|
||||
AND salary_item_ids = #{salaryItemIds}
|
||||
</if>
|
||||
<if test="salarySobId != null">
|
||||
AND salary_sob_id = #{salarySobId}
|
||||
</if>
|
||||
<if test="templateName != null">
|
||||
AND template_name = #{templateName}
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
AND tenant_key = #{tenantKey}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
AND update_time = #{updateTime}
|
||||
</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.salaryacct.po.SalaryAcctResultTemplatePO">
|
||||
INSERT INTO hrsa_acct_result_template
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type,
|
||||
</if>
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="salaryItemIds != null">
|
||||
salary_item_ids,
|
||||
</if>
|
||||
<if test="salarySobId != null">
|
||||
salary_sob_id,
|
||||
</if>
|
||||
<if test="templateName != null">
|
||||
template_name,
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="createTime != null" >
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="creator != null" >
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null" >
|
||||
#{deleteType},
|
||||
</if>
|
||||
<if test="id != null" >
|
||||
#{id},
|
||||
</if>
|
||||
<if test="salaryItemIds != null" >
|
||||
#{salaryItemIds},
|
||||
</if>
|
||||
<if test="salarySobId != null" >
|
||||
#{salarySobId},
|
||||
</if>
|
||||
<if test="templateName != null" >
|
||||
#{templateName},
|
||||
</if>
|
||||
<if test="tenantKey != null" >
|
||||
#{tenantKey},
|
||||
</if>
|
||||
<if test="updateTime != null" >
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 更新,更新全部字段 -->
|
||||
<update id="update" parameterType="com.engine.salary.entity.salaryacct.po.SalaryAcctResultTemplatePO">
|
||||
UPDATE hrsa_acct_result_template
|
||||
<set>
|
||||
create_time=#{createTime},
|
||||
creator=#{creator},
|
||||
delete_type=#{deleteType},
|
||||
salary_item_ids=#{salaryItemIds},
|
||||
salary_sob_id=#{salarySobId},
|
||||
template_name=#{templateName},
|
||||
tenant_key=#{tenantKey},
|
||||
update_time=#{updateTime},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 更新不为NULL的字段 -->
|
||||
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.salaryacct.po.SalaryAcctResultTemplatePO">
|
||||
UPDATE hrsa_acct_result_template
|
||||
<set>
|
||||
<if test="createTime != null" >
|
||||
create_time=#{createTime},
|
||||
</if>
|
||||
<if test="creator != null" >
|
||||
creator=#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null" >
|
||||
delete_type=#{deleteType},
|
||||
</if>
|
||||
<if test="salaryItemIds != null" >
|
||||
salary_item_ids=#{salaryItemIds},
|
||||
</if>
|
||||
<if test="salarySobId != null" >
|
||||
salary_sob_id=#{salarySobId},
|
||||
</if>
|
||||
<if test="templateName != null" >
|
||||
template_name=#{templateName},
|
||||
</if>
|
||||
<if test="tenantKey != null" >
|
||||
tenant_key=#{tenantKey},
|
||||
</if>
|
||||
<if test="updateTime != null" >
|
||||
update_time=#{updateTime},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 根据主键删除记录 -->
|
||||
<delete id="deleteById" parameterType="com.engine.salary.entity.salaryacct.po.SalaryAcctResultTemplatePO">
|
||||
UPDATE hrsa_acct_result_template
|
||||
SET delete_type=1
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</delete>
|
||||
<delete id="deleteByIds">
|
||||
UPDATE hrsa_acct_result_template
|
||||
SET delete_type=1
|
||||
WHERE delete_type = 0
|
||||
<if test="ids != null and ids.size()>0">
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</delete>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -140,6 +140,30 @@ public interface SalaryAcctExcelService {
|
|||
|
||||
pltxEmployeeDTO pltxGetJbgz(PltxInitEmployeeParam param);
|
||||
|
||||
/**
|
||||
* 保存导出模板
|
||||
* @param saveParam
|
||||
*/
|
||||
void saveExportTemplate(SalaryAcctResultTemplateSaveParam saveParam);
|
||||
|
||||
/**
|
||||
* 删除导出模板
|
||||
* @param templateIds
|
||||
*/
|
||||
void deleteExportTemplate(List<Long> templateIds);
|
||||
|
||||
/**
|
||||
* 获取导出模板详细信息
|
||||
* @param templateId
|
||||
*/
|
||||
Map<String, Object> getExportTemplateForm(Long templateId);
|
||||
|
||||
/**
|
||||
* 根据账套id获取导出模板列表
|
||||
* @param param
|
||||
*/
|
||||
Map<String, Object> exportTemplateList(SalaryAcctResultTemplateSaveParam param);
|
||||
|
||||
//
|
||||
// /**
|
||||
// * 薪资核算结果校验异常导出
|
||||
|
|
|
|||
|
|
@ -0,0 +1,79 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultTemplatePO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Harryxzy
|
||||
* @ClassName SalaryAcctResultTemplateService
|
||||
* @date 2024/03/26 15:28
|
||||
* @description
|
||||
*/
|
||||
public interface SalaryAcctResultTemplateService {
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List <SalaryAcctResultTemplatePO> listAll();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
SalaryAcctResultTemplatePO getById(Long id);
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
*
|
||||
* @param salaryAcctResultTemplate 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(SalaryAcctResultTemplatePO salaryAcctResultTemplate);
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param salaryAcctResultTemplate 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(SalaryAcctResultTemplatePO salaryAcctResultTemplate);
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
*
|
||||
* @param salaryAcctResultTemplate 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(SalaryAcctResultTemplatePO salaryAcctResultTemplate);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param id 待删除的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int deleteById(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param ids 待删除的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int deleteByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 根据账套id获取
|
||||
* @param salarySobId
|
||||
* @return
|
||||
*/
|
||||
List<SalaryAcctResultTemplatePO> listBySalarySobId(Long salarySobId);
|
||||
}
|
||||
|
|
@ -4,11 +4,11 @@ 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.hrmelog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.component.WeaTableColumnGroup;
|
||||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.constant.SalaryItemConstant;
|
||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.report.po.SalaryAcctResultReportPO;
|
||||
import com.engine.salary.entity.salaryacct.bo.SalaryAcctEmployeeBO;
|
||||
|
|
@ -16,6 +16,7 @@ import com.engine.salary.entity.salaryacct.bo.SalaryAcctResultBO;
|
|||
import com.engine.salary.entity.salaryacct.bo.SalaryAcctResultLogBO;
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryAccEmployeeListDTO;
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryAcctImportFieldDTO;
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultTemplateDTO;
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryComparisonResultListDTO;
|
||||
import com.engine.salary.entity.salaryacct.dto.pltxEmployeeDTO;
|
||||
import com.engine.salary.entity.salaryacct.param.*;
|
||||
|
|
@ -51,6 +52,8 @@ import com.engine.salary.util.db.IdGenerator;
|
|||
import com.engine.salary.util.excel.ExcelParseHelper;
|
||||
import com.engine.salary.util.excel.ExcelSupport;
|
||||
import com.engine.salary.util.excel.ExcelUtilPlus;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
import com.engine.salary.wrapper.SalarySobItemWrapper;
|
||||
import com.google.common.collect.Lists;
|
||||
|
|
@ -60,7 +63,7 @@ import com.wbi.util.Util;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
|
|
@ -161,6 +164,10 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryAcctResultTemplateService getSalaryAcctResultTemplateService(User user) {
|
||||
return ServiceUtil.getService(SalaryAcctResultTemplateServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public XSSFWorkbook exportSalaryAcctEmployee(SalaryAcctEmployeeQueryParam queryParam) {
|
||||
ValidUtil.doValidator(queryParam);
|
||||
|
|
@ -1507,6 +1514,90 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存导出模板
|
||||
* @param saveParam
|
||||
*/
|
||||
@Override
|
||||
public void saveExportTemplate(SalaryAcctResultTemplateSaveParam saveParam) {
|
||||
ValidUtil.doValidator(saveParam);
|
||||
Long salaryAcctRecordId = saveParam.getSalaryAcctRecordId();
|
||||
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(salaryAcctRecordId);
|
||||
if (salaryAcctRecordPO == null) {
|
||||
throw new SalaryRunTimeException("薪资核算记录不存在");
|
||||
}
|
||||
saveParam.setSalarySobId(salaryAcctRecordPO.getSalarySobId());
|
||||
List<SalaryAcctResultTemplatePO> templateBySobId = getSalaryAcctResultTemplateService(user).listBySalarySobId(saveParam.getSalarySobId());
|
||||
if (saveParam.getId() != null) {
|
||||
Optional<SalaryAcctResultTemplatePO> saveNameOptional = templateBySobId.stream().filter(po -> po.getTemplateName().equals(saveParam.getTemplateName()) && !po.getId().equals(saveParam.getId())).findFirst();
|
||||
if (saveNameOptional.isPresent()) {
|
||||
throw new SalaryRunTimeException("该账套中已经存在同名模板,请重新设置后保存");
|
||||
}
|
||||
// 更新
|
||||
SalaryAcctResultTemplatePO salaryAcctResultTemplatePO = getSalaryAcctResultTemplateService(user).getById(saveParam.getId());
|
||||
if (salaryAcctResultTemplatePO == null) {
|
||||
throw new SalaryRunTimeException("模板不存在,或已被删除");
|
||||
}
|
||||
salaryAcctResultTemplatePO.setSalaryItemIds(StringUtils.join(saveParam.getSalaryItemIds(), ","));
|
||||
salaryAcctResultTemplatePO.setTemplateName(saveParam.getTemplateName());
|
||||
salaryAcctResultTemplatePO.setUpdateTime(new Date());
|
||||
getSalaryAcctResultTemplateService(user).update(salaryAcctResultTemplatePO);
|
||||
} else {
|
||||
Optional<SalaryAcctResultTemplatePO> saveNameOptional = templateBySobId.stream().filter(po -> po.getTemplateName().equals(saveParam.getTemplateName())).findFirst();
|
||||
if (saveNameOptional.isPresent()) {
|
||||
throw new SalaryRunTimeException("该账套中已经存在同名模板,请重新设置后保存");
|
||||
}
|
||||
// 新建
|
||||
Date now = new Date();
|
||||
getSalaryAcctResultTemplateService(user).insertIgnoreNull(SalaryAcctResultTemplatePO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.salarySobId(saveParam.getSalarySobId())
|
||||
.salaryItemIds(StringUtils.join(saveParam.getSalaryItemIds(), ","))
|
||||
.templateName(saveParam.getTemplateName())
|
||||
.creator(Long.valueOf(user.getUID()))
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.deleteType(0)
|
||||
.build());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteExportTemplate(List<Long> templateIds) {
|
||||
getSalaryAcctResultTemplateService(user).deleteByIds(templateIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getExportTemplateForm(Long templateId) {
|
||||
SalaryAcctResultTemplatePO salaryAcctResultTemplatePO = getSalaryAcctResultTemplateService(user).getById(templateId);
|
||||
if (salaryAcctResultTemplatePO == null) {
|
||||
throw new SalaryRunTimeException("模板不存在或已被删除");
|
||||
}
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
resultMap.put("checkItems", StringUtils.split(salaryAcctResultTemplatePO.getSalaryItemIds(), ","));
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> exportTemplateList(SalaryAcctResultTemplateSaveParam param) {
|
||||
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(param.getSalaryAcctRecordId());
|
||||
if (salaryAcctRecordPO == null){
|
||||
throw new SalaryRunTimeException("薪资核算记录为空");
|
||||
}
|
||||
List<SalaryAcctResultTemplatePO> salaryAcctResultTemplatePOS = getSalaryAcctResultTemplateService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId());
|
||||
if (StringUtils.isNotBlank(param.getTemplateName())) {
|
||||
salaryAcctResultTemplatePOS = salaryAcctResultTemplatePOS.stream().filter(po -> po.getTemplateName().contains(param.getTemplateName())).collect(Collectors.toList());
|
||||
}
|
||||
List<SalaryAcctResultTemplateDTO> resultList = new ArrayList<>();
|
||||
salaryAcctResultTemplatePOS.stream().forEach(po -> resultList.add(SalaryAcctResultTemplateDTO.builder().id(po.getId()).templateName(po.getTemplateName()).createTime(SalaryDateUtil.getFormatLocalDateTime(po.getCreateTime())).build()));
|
||||
PageInfo<SalaryAcctResultTemplateDTO> pageInfo = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), resultList, SalaryAcctResultTemplateDTO.class);
|
||||
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
resultMap.put("pageInfo", pageInfo);
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
// @Override
|
||||
// public Map<String, Object> exportCheckResult(
|
||||
// SalaryCheckResultExportParam exportParam,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,72 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultTemplatePO;
|
||||
import com.engine.salary.mapper.salaryacct.SalaryAcctResultTemplateMapper;
|
||||
import com.engine.salary.service.SalaryAcctResultTemplateService;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Harryxzy
|
||||
* @ClassName SalaryAcctResultTemplateServiceImpl
|
||||
* @date 2024/03/26 15:30
|
||||
* @description
|
||||
*/
|
||||
public class SalaryAcctResultTemplateServiceImpl extends Service implements SalaryAcctResultTemplateService {
|
||||
|
||||
private SalaryAcctResultTemplateMapper getSalaryAcctResultTemplateMapper() {
|
||||
return MapperProxyFactory.getProxy(SalaryAcctResultTemplateMapper.class);
|
||||
}
|
||||
@Override
|
||||
public List<SalaryAcctResultTemplatePO> listAll() {
|
||||
return getSalaryAcctResultTemplateMapper().listAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SalaryAcctResultTemplatePO getById(Long id) {
|
||||
return getSalaryAcctResultTemplateMapper().getById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertIgnoreNull(SalaryAcctResultTemplatePO salaryAcctResultTemplate) {
|
||||
return getSalaryAcctResultTemplateMapper().insertIgnoreNull(salaryAcctResultTemplate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(SalaryAcctResultTemplatePO salaryAcctResultTemplate) {
|
||||
return getSalaryAcctResultTemplateMapper().update(salaryAcctResultTemplate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateIgnoreNull(SalaryAcctResultTemplatePO salaryAcctResultTemplate) {
|
||||
return getSalaryAcctResultTemplateMapper().updateIgnoreNull(salaryAcctResultTemplate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteById(Long id) {
|
||||
if (id == null) {
|
||||
return 0;
|
||||
}
|
||||
return getSalaryAcctResultTemplateMapper().deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByIds(List<Long> ids) {
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return 0;
|
||||
}
|
||||
return getSalaryAcctResultTemplateMapper().deleteByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalaryAcctResultTemplatePO> listBySalarySobId(Long salarySobId) {
|
||||
if (salarySobId == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return getSalaryAcctResultTemplateMapper().listSome(SalaryAcctResultTemplatePO.builder().salarySobId(salarySobId).build());
|
||||
}
|
||||
}
|
||||
|
|
@ -591,6 +591,43 @@ public class SalaryAcctController {
|
|||
return new ResponseResult<List<Long>, String>(user).run(getSalaryAcctExcelService(user)::cacheExportField, param.getSalaryItems());
|
||||
}
|
||||
|
||||
// 保存导出模板
|
||||
@POST
|
||||
@Path("/acctresult/saveExportTemplate")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String saveExportTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctResultTemplateSaveParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryAcctResultTemplateSaveParam, String>(user).run(getSalaryAcctExcelService(user)::saveExportTemplate, param);
|
||||
}
|
||||
|
||||
// 删除导出模板
|
||||
@POST
|
||||
@Path("/acctresult/deleteExportTemplate")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String deleteExportTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctResultTemplateSaveParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<List<Long>, String>(user).run(getSalaryAcctExcelService(user)::deleteExportTemplate, param.getIds());
|
||||
}
|
||||
|
||||
// 获取导出模板详细信息
|
||||
@POST
|
||||
@Path("/acctresult/getExportTemplateForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getExportTemplateForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctResultTemplateSaveParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, Map<String, Object>>(user).run(getSalaryAcctExcelService(user)::getExportTemplateForm, param.getId());
|
||||
}
|
||||
|
||||
// 获取导出模列表
|
||||
@POST
|
||||
@Path("/acctresult/exportTemplateList")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String exportTemplateList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctResultTemplateSaveParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryAcctResultTemplateSaveParam, Map<String, Object>>(user).run(getSalaryAcctExcelService(user)::exportTemplateList, param);
|
||||
}
|
||||
|
||||
|
||||
//导出导入模板
|
||||
@GET
|
||||
@Path("/acctresult/importtemplate/export")
|
||||
|
|
|
|||
Loading…
Reference in New Issue