薪资明细显示模板
This commit is contained in:
parent
15fe5044e8
commit
e537ffaa5a
|
|
@ -0,0 +1,30 @@
|
|||
CREATE TABLE hrsa_page_link
|
||||
(
|
||||
id NUMBER(38,0) primary key NOT NULL,
|
||||
employee_id NUMBER(38,0),
|
||||
page varchar2(200),
|
||||
page_setting_id NUMBER(38,0),
|
||||
creator NUMBER(38,0),
|
||||
create_time date,
|
||||
update_time date,
|
||||
delete_type number,
|
||||
tenant_key varchar2(10)
|
||||
);
|
||||
/
|
||||
|
||||
CREATE TABLE hrsa_page_list_template
|
||||
(
|
||||
id NUMBER(38,0) primary key NOT NULL,
|
||||
name varchar2(200),
|
||||
page varchar2(200),
|
||||
shared_type number,
|
||||
limit_ids varchar2(2000),
|
||||
setting CLOB,
|
||||
creator NUMBER(38,0),
|
||||
create_time date,
|
||||
update_time date,
|
||||
delete_type number,
|
||||
tenant_key varchar2(10)
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
CREATE TABLE hrsa_page_link
|
||||
(
|
||||
id NUMBER(38,0) primary key NOT NULL,
|
||||
employee_id NUMBER(38,0),
|
||||
page varchar2(200),
|
||||
page_setting_id NUMBER(38,0),
|
||||
creator NUMBER(38,0),
|
||||
create_time date,
|
||||
update_time date,
|
||||
delete_type number,
|
||||
tenant_key varchar2(10)
|
||||
);
|
||||
/
|
||||
|
||||
CREATE TABLE hrsa_page_list_template
|
||||
(
|
||||
id NUMBER(38,0) primary key NOT NULL,
|
||||
name varchar2(200),
|
||||
page varchar2(200),
|
||||
shared_type number,
|
||||
limit_ids varchar2(2000),
|
||||
setting CLOB,
|
||||
creator NUMBER(38,0),
|
||||
create_time date,
|
||||
update_time date,
|
||||
delete_type number,
|
||||
tenant_key varchar2(10)
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
CREATE TABLE hrsa_page_link
|
||||
(
|
||||
id NUMBER(38,0) primary key NOT NULL,
|
||||
employee_id NUMBER(38,0),
|
||||
page varchar2(200),
|
||||
page_setting_id NUMBER(38,0),
|
||||
creator NUMBER(38,0),
|
||||
create_time date,
|
||||
update_time date,
|
||||
delete_type number,
|
||||
tenant_key varchar2(10)
|
||||
);
|
||||
/
|
||||
|
||||
CREATE TABLE hrsa_page_list_template
|
||||
(
|
||||
id NUMBER(38,0) primary key NOT NULL,
|
||||
name varchar2(200),
|
||||
page varchar2(200),
|
||||
shared_type number,
|
||||
limit_ids varchar2(2000),
|
||||
setting CLOB,
|
||||
creator NUMBER(38,0),
|
||||
create_time date,
|
||||
update_time date,
|
||||
delete_type number,
|
||||
tenant_key varchar2(10)
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
CREATE TABLE hrsa_page_link
|
||||
(
|
||||
id bigint(0) NOT NULL,
|
||||
employee_id bigint(0),
|
||||
page varchar(200),
|
||||
page_setting_id bigint(0),
|
||||
creator bigint(0),
|
||||
create_time datetime(0),
|
||||
update_time datetime(0),
|
||||
delete_type int(0),
|
||||
tenant_key varchar(10),
|
||||
PRIMARY KEY (id) USING BTREE
|
||||
);
|
||||
|
||||
CREATE TABLE hrsa_page_list_template (
|
||||
id bigint(0) NOT NULL,
|
||||
name varchar(200),
|
||||
page varchar(200),
|
||||
shared_type int(0),
|
||||
limit_ids varchar(2000),
|
||||
setting text,
|
||||
creator bigint(0),
|
||||
create_time datetime(0),
|
||||
update_time datetime(0),
|
||||
delete_type int(0),
|
||||
tenant_key varchar(10),
|
||||
PRIMARY KEY (id) USING BTREE
|
||||
);
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
CREATE TABLE hrsa_page_link
|
||||
(
|
||||
id NUMBER(38,0) primary key NOT NULL,
|
||||
employee_id NUMBER(38,0),
|
||||
page varchar2(200),
|
||||
page_setting_id NUMBER(38,0),
|
||||
creator NUMBER(38,0),
|
||||
create_time date,
|
||||
update_time date,
|
||||
delete_type number,
|
||||
tenant_key varchar2(10)
|
||||
)
|
||||
/
|
||||
|
||||
CREATE TABLE hrsa_page_list_template
|
||||
(
|
||||
id NUMBER(38,0) primary key NOT NULL,
|
||||
name varchar2(200),
|
||||
page varchar2(200),
|
||||
shared_type number,
|
||||
limit_ids varchar2(2000),
|
||||
setting CLOB,
|
||||
creator NUMBER(38,0),
|
||||
create_time date,
|
||||
update_time date,
|
||||
delete_type number,
|
||||
tenant_key varchar2(10)
|
||||
)
|
||||
/
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
create table hrsa_page_link
|
||||
(
|
||||
id bigint primary key,
|
||||
employee_id bigint,
|
||||
page varchar(200),
|
||||
page_setting_id bigint,
|
||||
creator bigint,
|
||||
create_time timestamp,
|
||||
update_time timestamp,
|
||||
delete_type int,
|
||||
tenant_key varchar(10)
|
||||
);
|
||||
|
||||
create table hrsa_page_list_template
|
||||
(
|
||||
id bigint primary key,
|
||||
name varchar(200),
|
||||
page varchar(200),
|
||||
shared_type int,
|
||||
limit_ids varchar(2000),
|
||||
setting text,
|
||||
creator bigint,
|
||||
create_time timestamp,
|
||||
update_time timestamp,
|
||||
delete_type int,
|
||||
tenant_key varchar(10)
|
||||
);
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
create table hrsa_page_link
|
||||
(
|
||||
id bigint primary key,
|
||||
employee_id bigint,
|
||||
page varchar(200),
|
||||
page_setting_id bigint,
|
||||
creator bigint,
|
||||
create_time datetime,
|
||||
update_time datetime,
|
||||
delete_type int,
|
||||
tenant_key varchar(10)
|
||||
)
|
||||
GO
|
||||
|
||||
create table hrsa_page_list_template
|
||||
(
|
||||
id bigint primary key,
|
||||
name varchar(200),
|
||||
page varchar(200),
|
||||
shared_type int,
|
||||
limit_ids varchar(2000),
|
||||
setting text,
|
||||
creator bigint,
|
||||
create_time datetime,
|
||||
update_time datetime,
|
||||
delete_type int,
|
||||
tenant_key varchar(10)
|
||||
)
|
||||
GO
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
CREATE TABLE hrsa_page_link
|
||||
(
|
||||
id NUMBER(38,0) primary key NOT NULL,
|
||||
employee_id NUMBER(38,0),
|
||||
page varchar2(200),
|
||||
page_setting_id NUMBER(38,0),
|
||||
creator NUMBER(38,0),
|
||||
create_time date,
|
||||
update_time date,
|
||||
delete_type number,
|
||||
tenant_key varchar2(10)
|
||||
);
|
||||
/
|
||||
|
||||
CREATE TABLE hrsa_page_list_template
|
||||
(
|
||||
id NUMBER(38,0) primary key NOT NULL,
|
||||
name varchar2(200),
|
||||
page varchar2(200),
|
||||
shared_type number,
|
||||
limit_ids varchar2(2000),
|
||||
setting CLOB,
|
||||
creator NUMBER(38,0),
|
||||
create_time date,
|
||||
update_time date,
|
||||
delete_type number,
|
||||
tenant_key varchar2(10)
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -1,19 +1,20 @@
|
|||
package com.engine.salary.entity.setting.dto;
|
||||
|
||||
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PageListTemplateDTO {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
private List<WeaTableColumn> setting;
|
||||
private List<WeaTableColumn> checked;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.engine.salary.entity.setting.param;
|
||||
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 薪资帐套表
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PageListColumnsQueryParam {
|
||||
|
||||
@DataCheck(require = true,message = "请选择页面")
|
||||
private String page;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.engine.salary.entity.setting.param;
|
||||
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 薪资帐套表
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PageListTemplateChangeParam {
|
||||
|
||||
/**
|
||||
* 页面,0:薪资明细
|
||||
*/
|
||||
@DataCheck(require = true,message = "请选择页面")
|
||||
private String page;
|
||||
|
||||
/**
|
||||
* 模板id
|
||||
*/
|
||||
@DataCheck(require = true,message = "请选择模板")
|
||||
private Long templateId;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -15,8 +15,13 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
public class PageListTemplateQueryParam {
|
||||
|
||||
private Long id;
|
||||
|
||||
@DataCheck(require = true,message = "请选择页面")
|
||||
private String page;
|
||||
|
||||
/**
|
||||
* 字段name
|
||||
*/
|
||||
private String name;
|
||||
}
|
||||
|
|
@ -30,9 +30,14 @@ public class PageListTemplateSaveParam {
|
|||
@DataCheck(require = true,message = "请选择模板名称")
|
||||
private String name;
|
||||
|
||||
@DataCheck(require = true,message = "请选择共享类型")
|
||||
private Integer sharedType;
|
||||
|
||||
private List<Long> limitIds;
|
||||
|
||||
/**
|
||||
* 设置
|
||||
*/
|
||||
@DataCheck(require = true,message = "请选择设置")
|
||||
private List<Long> setting;
|
||||
private List<String> setting;
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
package com.engine.salary.entity.setting.po;
|
||||
|
||||
import com.engine.hrmelog.annotation.ElogTransform;
|
||||
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 PageLinkPO {
|
||||
|
||||
@ElogTransform(name = "id")
|
||||
private Long id;
|
||||
|
||||
@ElogTransform(name = "人员id")
|
||||
private Long employeeId;
|
||||
|
||||
/**
|
||||
* 页面
|
||||
*/
|
||||
@ElogTransform(name = "页面")
|
||||
private String page;
|
||||
|
||||
/**
|
||||
* 页面模板id
|
||||
*/
|
||||
@ElogTransform(name = "页面模板id")
|
||||
private Long templateId;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@ElogTransform(name = "租户ID")
|
||||
private String tenantKey;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ElogTransform(name = "更新时间")
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ElogTransform(name = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ElogTransform(name = "创建人")
|
||||
private Long creator;
|
||||
|
||||
|
||||
/**
|
||||
* 是否已删除。0:未删除、1:已删除
|
||||
*/
|
||||
@ElogTransform(name = "是否已删除。0:未删除、1:已删除")
|
||||
private Integer deleteType;
|
||||
|
||||
|
||||
//主键id集合
|
||||
private Collection<Long> ids;
|
||||
|
||||
}
|
||||
|
|
@ -8,6 +8,7 @@ import lombok.NoArgsConstructor;
|
|||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 薪资帐套表
|
||||
|
|
@ -18,22 +19,9 @@ import java.util.Date;
|
|||
@AllArgsConstructor
|
||||
public class PageListSettingPO {
|
||||
|
||||
|
||||
@ElogTransform(name = "")
|
||||
@ElogTransform(name = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 是否模板:0否,1是
|
||||
*/
|
||||
@ElogTransform(name = "是否模板")
|
||||
private Integer template;
|
||||
|
||||
/**
|
||||
* 模板名称
|
||||
*/
|
||||
@ElogTransform(name = "模板名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 页面,0:薪资明细
|
||||
*/
|
||||
|
|
@ -44,7 +32,7 @@ public class PageListSettingPO {
|
|||
* 设置
|
||||
*/
|
||||
@ElogTransform(name = "设置")
|
||||
private String setting;
|
||||
private List<Long> setting;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,94 @@
|
|||
package com.engine.salary.entity.setting.po;
|
||||
|
||||
import com.engine.hrmelog.annotation.ElogTransform;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 薪资帐套表
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PageListTemplatePO {
|
||||
|
||||
|
||||
@ElogTransform(name = "id")
|
||||
private Long id;
|
||||
|
||||
|
||||
/**
|
||||
* 模板名称
|
||||
*/
|
||||
@ElogTransform(name = "模板名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 页面
|
||||
*/
|
||||
@ElogTransform(name = "页面")
|
||||
private String page;
|
||||
|
||||
/**
|
||||
* 设置
|
||||
*/
|
||||
@ElogTransform(name = "设置")
|
||||
private List<String> setting;
|
||||
|
||||
/**
|
||||
* 是否共享,0否,1是
|
||||
*/
|
||||
@ElogTransform(name = "是否共享,0否,1是")
|
||||
private Integer sharedType;
|
||||
|
||||
|
||||
/**
|
||||
* 限制
|
||||
*/
|
||||
@ElogTransform(name = "限制")
|
||||
private List<Long> limitIds;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@ElogTransform(name = "租户ID")
|
||||
private String tenantKey;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ElogTransform(name = "更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ElogTransform(name = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ElogTransform(name = "创建人")
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 是否已删除。0:未删除、1:已删除
|
||||
*/
|
||||
@ElogTransform(name = "是否已删除。0:未删除、1:已删除")
|
||||
private Integer deleteType;
|
||||
|
||||
|
||||
//主键id集合
|
||||
private Collection<Long> ids;
|
||||
|
||||
private Boolean checked;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
package com.engine.salary.mapper.setting;
|
||||
|
||||
import com.engine.salary.entity.setting.po.PageLinkPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public interface PageLinkMapper {
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<PageLinkPO> listAll();
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<PageLinkPO> listSome(PageLinkPO pageLink);
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
PageLinkPO getById(Long id);
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
*
|
||||
* @param pageLink 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(PageLinkPO pageLink);
|
||||
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param pageLink 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(PageLinkPO pageLink);
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
*
|
||||
* @param pageLink 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(PageLinkPO pageLink);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param pageLink 待删除的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int delete(PageLinkPO pageLink);
|
||||
|
||||
/**
|
||||
* 批量删除记录
|
||||
* @param ids 主键id集合
|
||||
*/
|
||||
void deleteByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
PageLinkPO getLink(@Param("employeeId")Long employeeId, @Param("page")String page);
|
||||
}
|
||||
|
|
@ -0,0 +1,232 @@
|
|||
<?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.setting.PageLinkMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.setting.po.PageLinkPO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="employee_id" property="employeeId"/>
|
||||
<result column="page" property="page"/>
|
||||
<result column="template_id" property="templateId"/>
|
||||
<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
|
||||
.
|
||||
create_time
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
, t.employee_id
|
||||
, t.id
|
||||
, t.page
|
||||
, t.template_id
|
||||
, t.tenant_key
|
||||
, t.update_time
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="listAll" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_page_link t
|
||||
WHERE delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据主键获取单条记录 -->
|
||||
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_page_link t
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 条件查询 -->
|
||||
<select id="listSome" resultMap="BaseResultMap" parameterType="com.engine.salary.entity.setting.po.PageLinkPO">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_page_link 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="employeeId != null">
|
||||
AND employee_id = #{employeeId}
|
||||
</if>
|
||||
<if test="id != null">
|
||||
AND id = #{id}
|
||||
</if>
|
||||
<if test="page != null">
|
||||
AND page = #{page}
|
||||
</if>
|
||||
<if test="templateId != null">
|
||||
AND template_id = #{templateId}
|
||||
</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.setting.po.PageLinkPO">
|
||||
INSERT INTO hrsa_page_link
|
||||
<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="employeeId != null">
|
||||
employee_id,
|
||||
</if>
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="page != null">
|
||||
page,
|
||||
</if>
|
||||
<if test="templateId != null">
|
||||
template_id,
|
||||
</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="employeeId != null">
|
||||
#{employeeId},
|
||||
</if>
|
||||
<if test="id != null">
|
||||
#{id},
|
||||
</if>
|
||||
<if test="page != null">
|
||||
#{page},
|
||||
</if>
|
||||
<if test="templateId != null">
|
||||
#{templateId},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
#{tenantKey},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<!-- 更新,更新全部字段 -->
|
||||
<update id="update" parameterType="com.engine.salary.entity.setting.po.PageLinkPO">
|
||||
UPDATE hrsa_page_link
|
||||
<set>
|
||||
create_time=#{createTime},
|
||||
creator=#{creator},
|
||||
delete_type=#{deleteType},
|
||||
employee_id=#{employeeId},
|
||||
page=#{page},
|
||||
template_id=#{templateId},
|
||||
tenant_key=#{tenantKey},
|
||||
update_time=#{updateTime},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 更新不为NULL的字段 -->
|
||||
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.setting.po.PageLinkPO">
|
||||
UPDATE hrsa_page_link
|
||||
<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="employeeId != null">
|
||||
employee_id=#{employeeId},
|
||||
</if>
|
||||
<if test="page != null">
|
||||
page=#{page},
|
||||
</if>
|
||||
<if test="templateId != null">
|
||||
template_id=#{templateId},
|
||||
</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="delete">
|
||||
UPDATE hrsa_page_link
|
||||
SET delete_type=1
|
||||
WHERE id = #{id}
|
||||
AND delete_type = 0
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByIds">
|
||||
UPDATE hrsa_page_link
|
||||
SET delete_type = 1
|
||||
WHERE delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getLink" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_page_link t
|
||||
WHERE delete_type = 0
|
||||
AND employee_id = #{employeeId}
|
||||
AND page = #{page}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -69,7 +69,9 @@ public interface PageListSettingMapper {
|
|||
*/
|
||||
void deleteByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
//获取页面默认配置
|
||||
PageListSettingPO getByPage(String page);
|
||||
|
||||
//获取页面配置模板
|
||||
List<PageListSettingPO> getTemplatesByPage(String page);
|
||||
}
|
||||
|
|
@ -4,9 +4,7 @@
|
|||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.setting.po.PageListSettingPO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="page" property="page"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="template" property="template"/>
|
||||
<result column="setting" property="setting"/>
|
||||
<result column="setting" property="setting" typeHandler="com.engine.salary.handle.SalaryListTypeHandler"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
|
|
@ -23,8 +21,6 @@
|
|||
, t.delete_type
|
||||
, t.id
|
||||
, t.page
|
||||
, t.name
|
||||
, t.template
|
||||
, t.setting
|
||||
, t.tenant_key
|
||||
, t.update_time
|
||||
|
|
@ -68,15 +64,6 @@
|
|||
<if test="page != null">
|
||||
AND page = #{page}
|
||||
</if>
|
||||
<if test="name != null">
|
||||
AND name = #{name}
|
||||
</if>
|
||||
<if test="template != null">
|
||||
AND template = #{template}
|
||||
</if>
|
||||
<if test="setting != null">
|
||||
AND setting = #{setting}
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
AND tenant_key = #{tenantKey}
|
||||
</if>
|
||||
|
|
@ -113,12 +100,6 @@
|
|||
<if test="page != null">
|
||||
page,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="template != null">
|
||||
template,
|
||||
</if>
|
||||
<if test="setting != null">
|
||||
setting,
|
||||
</if>
|
||||
|
|
@ -145,14 +126,8 @@
|
|||
<if test="page != null">
|
||||
#{page},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name},
|
||||
</if>
|
||||
<if test="template != null">
|
||||
#{template},
|
||||
</if>
|
||||
<if test="setting != null">
|
||||
#{setting},
|
||||
#{setting, jdbcType=ARRAY, typeHandler=com.engine.salary.handle.SalaryListTypeHandler},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
#{tenantKey},
|
||||
|
|
@ -172,9 +147,7 @@
|
|||
creator=#{creator},
|
||||
delete_type=#{deleteType},
|
||||
page=#{page},
|
||||
name=#{name},
|
||||
template=#{template},
|
||||
setting=#{setting},
|
||||
setting=#{setting, jdbcType=ARRAY, typeHandler=com.engine.salary.handle.SalaryListTypeHandler},
|
||||
tenant_key=#{tenantKey},
|
||||
update_time=#{updateTime},
|
||||
</set>
|
||||
|
|
@ -198,14 +171,8 @@
|
|||
<if test="page != null">
|
||||
page=#{page},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name=#{name},
|
||||
</if>
|
||||
<if test="template != null">
|
||||
template=#{template},
|
||||
</if>
|
||||
<if test="setting != null">
|
||||
setting=#{setting},
|
||||
setting=#{setting, jdbcType=ARRAY, typeHandler=com.engine.salary.handle.SalaryListTypeHandler},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key=#{tenantKey},
|
||||
|
|
@ -241,7 +208,6 @@
|
|||
<include refid="baseColumns"/>
|
||||
FROM hrsa_page_list_setting t
|
||||
WHERE delete_type = 0
|
||||
and template = 0
|
||||
and page = #{page}
|
||||
</select>
|
||||
|
||||
|
|
@ -250,7 +216,6 @@
|
|||
<include refid="baseColumns"/>
|
||||
FROM hrsa_page_list_setting t
|
||||
WHERE delete_type = 0
|
||||
and template = 1
|
||||
and page = #{page}
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,73 @@
|
|||
package com.engine.salary.mapper.setting;
|
||||
|
||||
import com.engine.salary.entity.setting.po.PageListTemplatePO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public interface PageListTemplateMapper {
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<PageListTemplatePO> listAll();
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<PageListTemplatePO> listSome(PageListTemplatePO pageListTemplate);
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
PageListTemplatePO getById(Long id);
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
*
|
||||
* @param pageListTemplate 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(PageListTemplatePO pageListTemplate);
|
||||
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param pageListTemplate 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(PageListTemplatePO pageListTemplate);
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
*
|
||||
* @param pageListTemplate 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(PageListTemplatePO pageListTemplate);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param pageListTemplate 待删除的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int delete(PageListTemplatePO pageListTemplate);
|
||||
|
||||
/**
|
||||
* 批量删除记录
|
||||
* @param ids 主键id集合
|
||||
*/
|
||||
void deleteByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,251 @@
|
|||
<?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.setting.PageListTemplateMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.setting.po.PageListTemplatePO">
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
<result column="id" property="id"/>
|
||||
<result column="limit_ids" property="limitIds" typeHandler="com.engine.salary.handle.SalaryListTypeHandler"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="page" property="page"/>
|
||||
<result column="setting" property="setting" typeHandler="com.engine.salary.handle.SalaryListTypeHandler" />
|
||||
<result column="shared_type" property="sharedType"/>
|
||||
<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.limit_ids
|
||||
, t.name
|
||||
, t.page
|
||||
, t.setting
|
||||
, t.shared_type
|
||||
, t.tenant_key
|
||||
, t.update_time
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="listAll" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_page_list_template t
|
||||
WHERE delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据主键获取单条记录 -->
|
||||
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_page_list_template t
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 条件查询 -->
|
||||
<select id="listSome" resultMap="BaseResultMap"
|
||||
parameterType="com.engine.salary.entity.setting.po.PageListTemplatePO">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_page_list_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="name != null">
|
||||
AND name = #{name}
|
||||
</if>
|
||||
<if test="page != null">
|
||||
AND page = #{page}
|
||||
</if>
|
||||
<if test="setting != null">
|
||||
AND setting = #{setting}
|
||||
</if>
|
||||
<if test="sharedType != null">
|
||||
AND shared_type = #{sharedType}
|
||||
</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.setting.po.PageListTemplatePO">
|
||||
INSERT INTO hrsa_page_list_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="limitIds != null">
|
||||
limit_ids,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="page != null">
|
||||
page,
|
||||
</if>
|
||||
<if test="setting != null">
|
||||
setting,
|
||||
</if>
|
||||
<if test="sharedType != null">
|
||||
shared_type,
|
||||
</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="limitIds != null">
|
||||
#{limitIds, jdbcType=ARRAY, typeHandler=com.engine.salary.handle.SalaryListTypeHandler},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name},
|
||||
</if>
|
||||
<if test="page != null">
|
||||
#{page},
|
||||
</if>
|
||||
<if test="setting != null">
|
||||
#{setting , jdbcType=ARRAY, typeHandler=com.engine.salary.handle.SalaryListTypeHandler},
|
||||
</if>
|
||||
<if test="sharedType != null">
|
||||
#{sharedType},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
#{tenantKey},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 更新,更新全部字段 -->
|
||||
<update id="update" parameterType="com.engine.salary.entity.setting.po.PageListTemplatePO">
|
||||
UPDATE hrsa_page_list_template
|
||||
<set>
|
||||
create_time=#{createTime},
|
||||
creator=#{creator},
|
||||
delete_type=#{deleteType},
|
||||
limit_ids=#{limitIds, jdbcType=ARRAY, typeHandler=com.engine.salary.handle.SalaryListTypeHandler},
|
||||
name=#{name},
|
||||
page=#{page},
|
||||
setting=#{setting, jdbcType=ARRAY, typeHandler=com.engine.salary.handle.SalaryListTypeHandler},
|
||||
shared_type=#{sharedType},
|
||||
tenant_key=#{tenantKey},
|
||||
update_time=#{updateTime},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 更新不为NULL的字段 -->
|
||||
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.setting.po.PageListTemplatePO">
|
||||
UPDATE hrsa_page_list_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="limitIds != null">
|
||||
limit_ids=#{limitIds, jdbcType=ARRAY, typeHandler=com.engine.salary.handle.SalaryListTypeHandler},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name=#{name},
|
||||
</if>
|
||||
<if test="page != null">
|
||||
page=#{page},
|
||||
</if>
|
||||
<if test="setting != null">
|
||||
setting=#{setting, jdbcType=ARRAY, typeHandler=com.engine.salary.handle.SalaryListTypeHandler},
|
||||
</if>
|
||||
<if test="sharedType != null">
|
||||
shared_type=#{sharedType},
|
||||
</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="delete">
|
||||
UPDATE hrsa_page_list_template
|
||||
SET delete_type=1
|
||||
WHERE id = #{id}
|
||||
AND delete_type = 0
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByIds">
|
||||
UPDATE hrsa_page_list_template
|
||||
SET delete_type = 1
|
||||
WHERE delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -354,23 +354,6 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
|
|||
Map setting = getSettingService(user).getPageListSetting(param);
|
||||
List<Long> checked = setting.get("checked") != null ? JsonUtil.parseList(setting.get("checked"), Long.class) : new ArrayList<>();
|
||||
List<SalaryItemPO> salaryItemList = getSalaryItemService(user).listByIds(checked);
|
||||
// salaryItemList = salaryItemList.stream()
|
||||
// .sorted(new Comparator<SalaryItemPO>() {
|
||||
// @Override
|
||||
// public int compare(SalaryItemPO o1, SalaryItemPO o2) {
|
||||
// if (o1.getSortedIndex() == null && o2.getSortedIndex() == null) {
|
||||
// Integer systemType1 = o1.getSystemType() == null ? 0 : o1.getSystemType();
|
||||
// Integer systemType2 = o2.getSystemType() == null ? 0 : o2.getSystemType();
|
||||
// return systemType1.compareTo(systemType2);
|
||||
// } else {
|
||||
// Integer sortedIndex1 = o1.getSortedIndex() == null ? 0 : o1.getSortedIndex();
|
||||
// Integer sortedIndex2 = o2.getSortedIndex() == null ? 0 : o2.getSortedIndex();
|
||||
// return sortedIndex2.compareTo(sortedIndex1);
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// .collect(Collectors.toList());
|
||||
|
||||
if (CollectionUtils.isEmpty(salaryAcctEmployeeList)) {
|
||||
return SalaryStatisticsEmployeeDetailResultDTO.builder()
|
||||
.salaryAcctEmployeeList(Collections.emptyList())
|
||||
|
|
@ -383,100 +366,10 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
|
|||
List<Long> salaryAcctEmployeeIds = salaryAcctEmployeeList.stream().map(SalaryAcctEmployeePO::getId).collect(Collectors.toList());
|
||||
List<SalaryAcctResultPO> salaryAcctResultValues = getSalaryAcctResultService(user).listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds);
|
||||
|
||||
|
||||
|
||||
return SalaryStatisticsEmployeeDetailResultDTO.builder()
|
||||
.salaryAcctEmployeeList(salaryAcctEmployeeList)
|
||||
.salaryAcctResultValueList(salaryAcctResultValues)
|
||||
.salaryItemList(salaryItemList)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
// @Override
|
||||
// public void exportDetailList(Map<String, Object> map, SalaryStatisticsEmployeeDetailQueryParam queryParam) {
|
||||
// DataCollectionEmployee employee = getSalaryEmployeeService(user).getEmployeeById(queryParam.getEmployeeId());
|
||||
// // 获取核算数据
|
||||
// SalaryStatisticsEmployeeDetailResultDTO salaryStatisticsEmployeeDetailResult;
|
||||
// if (Objects.isNull(employee)) {
|
||||
// salaryStatisticsEmployeeDetailResult = SalaryStatisticsEmployeeDetailResultDTO.builder()
|
||||
// .salaryAcctEmployeeList(Lists.newArrayList())
|
||||
// .salaryAcctResultValueList(Lists.newArrayList())
|
||||
// .salaryItemList(Lists.newArrayList())
|
||||
// .build();
|
||||
// } else {
|
||||
// salaryStatisticsEmployeeDetailResult = this.getDetailSalaryAcctResult(queryParam);
|
||||
// }
|
||||
//
|
||||
// String nameI18n = (StringUtils.isEmpty(employee.getUsername()) ? "" : "[" + employee.getUsername() + "]") + SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 177855, "薪资明细表");
|
||||
//
|
||||
// List<ExcelSheetData> sheetList = new ArrayList<>();
|
||||
// ExcelSheetData excelSheetData = new ExcelSheetData();
|
||||
// // 1.工作簿名称
|
||||
// excelSheetData.setSheetName(nameI18n);
|
||||
// List<String> headerList = Lists.newArrayList();
|
||||
// headerList.add(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 87614, "薪资所属月"));
|
||||
// headerList.add(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86184, "个税扣缴义务人"));
|
||||
// headerList.add(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 121908, "收入所得项目"));
|
||||
// salaryStatisticsEmployeeDetailResult.getSalaryItemList().forEach(item -> headerList.add(item.getName()));
|
||||
// // 2.表头
|
||||
// excelSheetData.setHeaders(Collections.singletonList(headerList.toArray(new String[]{})));
|
||||
//
|
||||
// List<TaxAgentPO> taxAgentList = getTaxAgentService(user).listAll(tenantKey);
|
||||
// Map<Long, String> taxAgentMap = SalaryEntityUtil.convert2Map(taxAgentList, TaxAgentPO::getId, TaxAgentPO::getName);
|
||||
//
|
||||
// Map<Long, Map<String, String>> acctResultValueMap = SalaryEntityUtil.convert2Map(salaryStatisticsEmployeeDetailResult.getSalaryAcctResultValueList(), SalaryAcctResultPO::getSalaryAcctEmployeeId, SalaryAcctResultPO::getResultValue);
|
||||
//
|
||||
// // 组装数据
|
||||
// List<List<Object>> rows = new ArrayList<>();
|
||||
// for (SalaryAcctEmployeePO se : salaryStatisticsEmployeeDetailResult.getSalaryAcctEmployeeList()) {
|
||||
// if (CollectionUtils.isNotEmpty(queryParam.getIds()) && !queryParam.getIds().contains(se.getId())) {
|
||||
// continue;
|
||||
// }
|
||||
// List<Object> row = new ArrayList<>();
|
||||
// row.add(se.getSalaryMonth());
|
||||
// row.add(taxAgentMap.get(se.getTaxAgentId()));
|
||||
// IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(Integer.parseInt(se.getIncomeCategory()));
|
||||
// row.add(Objects.isNull(incomeCategoryEnum) ? "" : SalaryI18nUtil.getI18nLabel(incomeCategoryEnum.getLabelId(), incomeCategoryEnum.getDefaultLabel()));
|
||||
// // 薪资项目
|
||||
// Map<String, String> resultValueMap = Optional.ofNullable(acctResultValueMap.get(se.getId())).orElse(Maps.newHashMap());
|
||||
// salaryStatisticsEmployeeDetailResult.getSalaryItemList().forEach(item -> row.add(Optional.ofNullable(resultValueMap.get(item.getId().toString())).orElse("")));
|
||||
//
|
||||
// rows.add(row);
|
||||
// }
|
||||
// if (CollectionUtils.isNotEmpty(rows)) {
|
||||
// List<Object> countRow = new ArrayList<>();
|
||||
// countRow.add(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 93278, "合计"));
|
||||
// countRow.add("-");
|
||||
// countRow.add("-");
|
||||
//
|
||||
// for (int i = 3; i < headerList.size(); i++) {
|
||||
// BigDecimal sumBigDecimal = new BigDecimal(SalaryStatisticsReportBO.D_ZERO);
|
||||
// for (List<Object> row : rows) {
|
||||
// sumBigDecimal = sumBigDecimal.add(new BigDecimal(StringUtils.isEmpty(row.get(i).toString()) ? SalaryStatisticsReportBO.ZERO : row.get(i).toString()));
|
||||
// }
|
||||
// countRow.add(sumBigDecimal.toString());
|
||||
// }
|
||||
// rows.add(countRow);
|
||||
// }
|
||||
//
|
||||
// // 3.表数据
|
||||
// excelSheetData.setRows(rows);
|
||||
//
|
||||
// sheetList.add(excelSheetData);
|
||||
//
|
||||
// salaryBatchService.simpleExportExcel(ExportExcelInfo.builder()
|
||||
//// .sharePassword(queryParam.getSharePassword())
|
||||
// .bizId(map.get("biz").toString())
|
||||
// .flag(true)
|
||||
// .userId(employeeId)
|
||||
// .eteamsId(map.get("eteamsId").toString())
|
||||
// .tenantKey(tenantKey)
|
||||
// .operator(map.get("username").toString())
|
||||
// .module(map.get("module").toString())
|
||||
// .fileName(nameI18n + ReportTimeUtil.getFormatLocalDateTime(LocalDateTime.now()))
|
||||
// .handlerName("exportSalaryStatisticsEmployeeDetailList")
|
||||
// .dataType(nameI18n)
|
||||
// .function("exportSalaryStatisticsEmployeeDetailList").build(), sheetList);
|
||||
// }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,11 @@ import com.engine.salary.report.service.SalaryStatisticsEmployeeService;
|
|||
import com.engine.salary.report.service.impl.SalaryStatisticsEmployeeServiceImpl;
|
||||
import com.engine.salary.report.util.ReportDataUtil;
|
||||
import com.engine.salary.service.SalaryItemService;
|
||||
import com.engine.salary.service.SettingService;
|
||||
import com.engine.salary.service.impl.SalaryItemServiceImpl;
|
||||
import com.engine.salary.service.impl.SettingServiceImpl;
|
||||
import com.engine.salary.sys.service.SalarySysConfService;
|
||||
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.excel.ExcelUtilPlus;
|
||||
|
|
@ -46,6 +50,9 @@ import java.util.Map;
|
|||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.engine.salary.enums.setting.PageListSettingPageEnum.SALARY_DETAILS_REPORT;
|
||||
import static com.engine.salary.sys.constant.SalarySysConstant.SALARY_DETAILS_REPORT_SHOW_TYPE;
|
||||
|
||||
/**
|
||||
* 薪酬统计员工明细
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
|
|
@ -64,6 +71,17 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
|
|||
return ServiceUtil.getService(SalaryItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SettingService getSettingService(User user) {
|
||||
return ServiceUtil.getService(SettingServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySysConfService getSalarySysConfService(User user) {
|
||||
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
|
||||
}
|
||||
|
||||
//是否模板显示
|
||||
private final boolean templateShow = "1".equals(getSalarySysConfService(user).getValueByCode(SALARY_DETAILS_REPORT_SHOW_TYPE));
|
||||
|
||||
/**
|
||||
* 员工列表
|
||||
*
|
||||
|
|
@ -189,12 +207,18 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
|
|||
}
|
||||
pageInfo.setTotal(salaryAcctEmployeePageInfo.getTotal());
|
||||
|
||||
// 列表columns
|
||||
List<WeaTableColumn> weaTableColumns = buildDetailTableColumns(salaryStatisticsEmployeeDetailResult, true);
|
||||
List<WeaTableColumn> weaTableColumns;
|
||||
//显示方案1,显示模板
|
||||
if (templateShow) {
|
||||
weaTableColumns = getSettingService(user).getPageListColumns(SALARY_DETAILS_REPORT.getValue());
|
||||
} else {
|
||||
// 显示方案0,显示定制列,默认方式
|
||||
weaTableColumns = buildDetailTableColumns(salaryStatisticsEmployeeDetailResult, true);
|
||||
}
|
||||
|
||||
// 结果
|
||||
resultMap.put("columns", weaTableColumns);
|
||||
if (queryParam.isExport()) {
|
||||
resultMap.put("columns", weaTableColumns);
|
||||
resultMap.put("salaryItems", salaryStatisticsEmployeeDetailResult.getSalaryItemList());
|
||||
resultMap.put("countResult", countResultMap);
|
||||
} else {
|
||||
|
|
@ -229,7 +253,7 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
|
|||
// 获取发薪人员
|
||||
PageInfo<SalaryAcctEmployeePO> salaryAcctEmployeePageInfo = getSalaryStatisticsEmployeeService(user).listSalaryAcctEmp(queryParam);
|
||||
List<SalaryAcctEmployeePO> employeePOS = salaryAcctEmployeePageInfo.getList();
|
||||
if (CollectionUtils.isEmpty(employeePOS)){
|
||||
if (CollectionUtils.isEmpty(employeePOS)) {
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
|
@ -274,9 +298,9 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
|
|||
queryParam.setCurrent(1);
|
||||
queryParam.setExport(true);
|
||||
Map<String, Object> resultMap = salaryList(queryParam);
|
||||
List<WeaTableColumn> columns = (List<WeaTableColumn>)resultMap.get("columns");
|
||||
List<WeaTableColumn> columns = (List<WeaTableColumn>) resultMap.get("columns");
|
||||
List<Map<String, Object>> resultList = ((PageInfo<Map<String, Object>>) resultMap.get("pageInfo")).getList();
|
||||
Map<String, Object> countResult = (Map<String, Object>)resultMap.get("countResult");
|
||||
Map<String, Object> countResult = (Map<String, Object>) resultMap.get("countResult");
|
||||
|
||||
Map<String, WeaTableColumn> columnMap = SalaryEntityUtil.convert2Map(columns, WeaTableColumn::getColumn);
|
||||
// 获取薪资项目保留小数位数
|
||||
|
|
@ -299,7 +323,7 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
|
|||
for (Map<String, Object> valueMap : resultList) {
|
||||
List<Object> list = new ArrayList<>();
|
||||
for (Object column : finalColumns) {
|
||||
WeaTableColumnGroup col = (WeaTableColumnGroup)column;
|
||||
WeaTableColumnGroup col = (WeaTableColumnGroup) column;
|
||||
if (col.getDataType().equals(SalaryDataTypeEnum.NUMBER.getValue())) {
|
||||
try {
|
||||
list.add(new BigDecimal(Util.null2String(valueMap.get(col.getColumn()))));
|
||||
|
|
@ -316,7 +340,7 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
|
|||
List<Object> sumRow = new ArrayList<>();
|
||||
sumRow.add("总计");
|
||||
for (int i = 1; i < finalColumns.size(); i++) {
|
||||
WeaTableColumnGroup weaTableColumnGroup = (WeaTableColumnGroup)finalColumns.get(i);
|
||||
WeaTableColumnGroup weaTableColumnGroup = (WeaTableColumnGroup) finalColumns.get(i);
|
||||
if (weaTableColumnGroup.getDataType().equals(SalaryDataTypeEnum.NUMBER.getValue())) {
|
||||
try {
|
||||
sumRow.add(new BigDecimal(Util.null2String(countResult.get(weaTableColumnGroup.getColumn()))));
|
||||
|
|
|
|||
|
|
@ -1,20 +1,25 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.setting.param.PageListSettingQueryParam;
|
||||
import com.engine.salary.entity.setting.param.PageListSettingSaveParam;
|
||||
import com.engine.salary.entity.setting.param.PageListTemplateQueryParam;
|
||||
import com.engine.salary.entity.setting.param.PageListTemplateSaveParam;
|
||||
import com.engine.salary.entity.setting.po.PageListSettingPO;
|
||||
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
||||
import com.engine.salary.entity.setting.dto.PageListTemplateDTO;
|
||||
import com.engine.salary.entity.setting.param.*;
|
||||
import com.engine.salary.entity.setting.po.PageListTemplatePO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface SettingService {
|
||||
void savePageListSetting(PageListSettingSaveParam pageListSettingSaveParam);
|
||||
void savePageListSetting(PageListSettingSaveParam pageListSettingSaveParam);
|
||||
|
||||
Map getPageListSetting(PageListSettingQueryParam param);
|
||||
Map getPageListSetting(PageListSettingQueryParam param);
|
||||
|
||||
List<PageListSettingPO> getPageListTemplates(PageListTemplateQueryParam queryParam);
|
||||
PageListTemplateDTO getPageListTemplate(PageListTemplateQueryParam param);
|
||||
|
||||
PageListSettingPO savePageListTemplate(PageListTemplateSaveParam param);
|
||||
List<PageListTemplatePO> getPageListTemplates(PageListTemplateQueryParam queryParam);
|
||||
|
||||
PageListTemplatePO savePageListTemplate(PageListTemplateSaveParam param);
|
||||
|
||||
void changePageListTemplate(PageListTemplateChangeParam param);
|
||||
|
||||
List<WeaTableColumn> getPageListColumns(String page);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,21 +1,29 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.cloudstore.eccom.constant.WeaBoolAttr;
|
||||
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.setting.param.PageListSettingQueryParam;
|
||||
import com.engine.salary.entity.setting.param.PageListSettingSaveParam;
|
||||
import com.engine.salary.entity.setting.param.PageListTemplateQueryParam;
|
||||
import com.engine.salary.entity.setting.param.PageListTemplateSaveParam;
|
||||
import com.engine.salary.entity.setting.dto.PageListTemplateDTO;
|
||||
import com.engine.salary.entity.setting.param.*;
|
||||
import com.engine.salary.entity.setting.po.PageLinkPO;
|
||||
import com.engine.salary.entity.setting.po.PageListSettingPO;
|
||||
import com.engine.salary.enums.SalaryOnOffEnum;
|
||||
import com.engine.salary.entity.setting.po.PageListTemplatePO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.setting.PageLinkMapper;
|
||||
import com.engine.salary.mapper.setting.PageListSettingMapper;
|
||||
import com.engine.salary.mapper.setting.PageListTemplateMapper;
|
||||
import com.engine.salary.report.common.constant.SalaryConstant;
|
||||
import com.engine.salary.service.SalaryItemService;
|
||||
import com.engine.salary.service.SalarySobService;
|
||||
import com.engine.salary.service.SettingService;
|
||||
import com.engine.salary.util.JsonUtil;
|
||||
import com.engine.salary.service.TaxAgentService;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
|
|
@ -41,30 +49,36 @@ public class SettingServiceImpl extends Service implements SettingService {
|
|||
return MapperProxyFactory.getProxy(PageListSettingMapper.class);
|
||||
}
|
||||
|
||||
private SalarySobService getSalarySobService(User user) {
|
||||
return ServiceUtil.getService(SalarySobServiceImpl.class, user);
|
||||
private PageListTemplateMapper getPageListTemplateMapper() {
|
||||
return MapperProxyFactory.getProxy(PageListTemplateMapper.class);
|
||||
}
|
||||
|
||||
private PageLinkMapper getPageLinkMapper() {
|
||||
return MapperProxyFactory.getProxy(PageLinkMapper.class);
|
||||
}
|
||||
|
||||
private SalaryItemService getSalaryItemService(User user) {
|
||||
return ServiceUtil.getService(SalaryItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private TaxAgentService getTaxAgentService() {
|
||||
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void savePageListSetting(PageListSettingSaveParam pageListSettingSaveParam) {
|
||||
Date now = new Date();
|
||||
|
||||
PageListSettingPO pageListSettingPO = getPageListSettingMapper().getByPage(pageListSettingSaveParam.getPage());
|
||||
if (pageListSettingPO != null) {
|
||||
pageListSettingPO.setSetting(JsonUtil.toJsonString(pageListSettingSaveParam.getSetting()));
|
||||
pageListSettingPO.setSetting(pageListSettingSaveParam.getSetting());
|
||||
pageListSettingPO.setUpdateTime(now);
|
||||
getPageListSettingMapper().updateIgnoreNull(pageListSettingPO);
|
||||
} else {
|
||||
pageListSettingPO = PageListSettingPO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.name("系统默认模板")
|
||||
.template(SalaryOnOffEnum.OFF.getValue())
|
||||
.page(pageListSettingSaveParam.getPage())
|
||||
.setting(JsonUtil.toJsonString(pageListSettingSaveParam.getSetting()))
|
||||
.setting(pageListSettingSaveParam.getSetting())
|
||||
.creator((long) user.getUID())
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
|
|
@ -103,8 +117,8 @@ public class SettingServiceImpl extends Service implements SettingService {
|
|||
})
|
||||
.collect(Collectors.toList());
|
||||
result.put("setting", salaryItemList);
|
||||
if (pageListSettingPO != null && StrUtil.isNotEmpty(pageListSettingPO.getSetting())) {
|
||||
result.put("checked", JsonUtil.parseList(pageListSettingPO.getSetting(), Long.class));
|
||||
if (pageListSettingPO != null && CollUtil.isNotEmpty(pageListSettingPO.getSetting())) {
|
||||
result.put("checked", pageListSettingPO.getSetting());
|
||||
} else {
|
||||
List<Long> collect = salaryItemList.stream().map(SalaryItemPO::getId).collect(Collectors.toList());
|
||||
result.put("checked", collect);
|
||||
|
|
@ -114,62 +128,165 @@ public class SettingServiceImpl extends Service implements SettingService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<PageListSettingPO> getPageListTemplates(PageListTemplateQueryParam param) {
|
||||
public PageListTemplateDTO getPageListTemplate(PageListTemplateQueryParam param) {
|
||||
String page = param.getPage();
|
||||
Long id = param.getId();
|
||||
if (SALARY_DETAILS_REPORT.getValue().equals(page)) {
|
||||
List<WeaTableColumn> columns = new ArrayList<>();
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(87614, "薪资所属月"), "salaryMonth"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"), "taxAgent"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(86184, "账套"), "salarySob"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "姓名"), "userName"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "分部"), "subCompany"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "部门"), "department"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "岗位"), "jobTitle"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "员工状态"), "status"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "工号"), "workCode"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "入职日期"), "companystartdate"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(86184, "次数"), "acctTimes").setDisplay(WeaBoolAttr.FALSE));
|
||||
if (StrUtil.isNotBlank(param.getName())) {
|
||||
columns = columns.stream().filter(column -> column.getText().contains(param.getName())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
List<SalaryItemPO> salaryItemList = getSalaryItemService(user).listAll();
|
||||
List<WeaTableColumn> collect = salaryItemList.stream()
|
||||
.filter(po -> {
|
||||
String name = param.getName();
|
||||
if (StrUtil.isNotEmpty(name)) {
|
||||
return po.getName() != null && po.getName().contains(name);
|
||||
}
|
||||
return true;
|
||||
})
|
||||
.sorted((o1, o2) -> {
|
||||
if (o1.getSortedIndex() == null && o2.getSortedIndex() == null) {
|
||||
Integer systemType1 = o1.getSystemType() == null ? 0 : o1.getSystemType();
|
||||
Integer systemType2 = o2.getSystemType() == null ? 0 : o2.getSystemType();
|
||||
return systemType1.compareTo(systemType2);
|
||||
} else {
|
||||
Integer sortedIndex1 = o1.getSortedIndex() == null ? 0 : o1.getSortedIndex();
|
||||
Integer sortedIndex2 = o2.getSortedIndex() == null ? 0 : o2.getSortedIndex();
|
||||
return sortedIndex2.compareTo(sortedIndex1);
|
||||
}
|
||||
})
|
||||
.map(item -> new WeaTableColumn("100px", item.getName(), item.getId() + SalaryConstant.DYNAMIC_SUFFIX))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
columns.addAll(collect);
|
||||
|
||||
Map<String, WeaTableColumn> columnMap = SalaryEntityUtil.convert2Map(columns, WeaTableColumn::getColumn);
|
||||
List<WeaTableColumn> checkedList = new ArrayList<>();
|
||||
if (id != null) {
|
||||
PageListTemplatePO po = getPageListTemplateMapper().getById(id);
|
||||
if (po != null) {
|
||||
checkedList = Optional.ofNullable(po.getSetting()).orElse(new ArrayList<>())
|
||||
.stream()
|
||||
.map(s -> columnMap.getOrDefault(s, new WeaTableColumn()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
}
|
||||
}
|
||||
return PageListTemplateDTO.builder().setting(columns).checked(checkedList).build();
|
||||
}
|
||||
|
||||
return PageListTemplateDTO.builder().build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PageListTemplatePO> getPageListTemplates(PageListTemplateQueryParam param) {
|
||||
|
||||
ValidUtil.doValidator(param);
|
||||
|
||||
String page = param.getPage();
|
||||
|
||||
List<PageListSettingPO> settingPOS = new ArrayList<>();
|
||||
//系统默认模板
|
||||
PageListSettingPO settingPO = getPageListSettingMapper().getByPage(page);
|
||||
if (settingPO != null) {
|
||||
settingPOS.add(settingPO);
|
||||
}
|
||||
PageListTemplatePO build = PageListTemplatePO.builder().page(page).build();
|
||||
List<PageListTemplatePO> pos = getPageListTemplateMapper().listSome(build);
|
||||
|
||||
List<PageListSettingPO> pos = getPageListSettingMapper().getTemplatesByPage(page);
|
||||
settingPOS.addAll(pos);
|
||||
//获取当前选择的模板
|
||||
PageLinkPO link = getPageLinkMapper().getLink((long) user.getUID(), SALARY_DETAILS_REPORT.getValue());
|
||||
|
||||
String name = param.getName();
|
||||
if (StrUtil.isNotBlank(name)) {
|
||||
settingPOS = settingPOS.stream().filter(po -> po.getName() != null && po.getName().contains(name)).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return settingPOS;
|
||||
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService().listAllTaxAgents((long) user.getUID());
|
||||
List<Long> taxIds = SalaryEntityUtil.properties(taxAgentPOS, TaxAgentPO::getId, Collectors.toList());
|
||||
pos = pos.stream()
|
||||
.filter(po -> po.getSharedType() != 1 || CollectionUtil.intersection(po.getLimitIds(), taxIds).size() != 0)
|
||||
.peek(po -> {
|
||||
po.setChecked(link != null && po.getId().equals(link.getTemplateId()));
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
return pos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageListSettingPO savePageListTemplate(PageListTemplateSaveParam param) {
|
||||
public PageListTemplatePO savePageListTemplate(PageListTemplateSaveParam param) {
|
||||
ValidUtil.doValidator(param);
|
||||
Date now = new Date();
|
||||
Long id = param.getId();
|
||||
|
||||
PageListSettingPO po;
|
||||
PageListTemplatePO po;
|
||||
if (id == null) {
|
||||
po = PageListSettingPO.builder()
|
||||
po = PageListTemplatePO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.template(SalaryOnOffEnum.ON.getValue())
|
||||
.name(param.getName())
|
||||
.page(param.getPage())
|
||||
.setting(JsonUtil.toJsonString(param.getSetting()))
|
||||
.name(param.getName())
|
||||
.sharedType(param.getSharedType())
|
||||
.limitIds(param.getLimitIds())
|
||||
.setting(param.getSetting())
|
||||
.creator((long) user.getUID())
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.deleteType(0)
|
||||
.tenantKey(DEFAULT_TENANT_KEY)
|
||||
.build();
|
||||
getPageListSettingMapper().insertIgnoreNull(po);
|
||||
getPageListTemplateMapper().insertIgnoreNull(po);
|
||||
} else {
|
||||
po = getPageListSettingMapper().getById(id);
|
||||
po = getPageListTemplateMapper().getById(id);
|
||||
if (po == null) {
|
||||
throw new SalaryRunTimeException("模板不存在!");
|
||||
}
|
||||
po.setName(param.getName());
|
||||
po.setSetting(JsonUtil.toJsonString(param.getSetting()));
|
||||
po.setSharedType(param.getSharedType());
|
||||
po.setLimitIds(param.getLimitIds());
|
||||
po.setSetting(param.getSetting());
|
||||
po.setUpdateTime(now);
|
||||
getPageListSettingMapper().updateIgnoreNull(po);
|
||||
getPageListTemplateMapper().updateIgnoreNull(po);
|
||||
}
|
||||
|
||||
return po;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changePageListTemplate(PageListTemplateChangeParam param) {
|
||||
|
||||
ValidUtil.doValidator(param);
|
||||
|
||||
List<PageLinkPO> pageLinkPOS = getPageLinkMapper().listSome(PageLinkPO.builder().employeeId((long) user.getUID()).page(param.getPage()).build());
|
||||
if (CollUtil.isNotEmpty(pageLinkPOS)) {
|
||||
Set<Long> ids = SalaryEntityUtil.properties(pageLinkPOS, PageLinkPO::getId);
|
||||
getPageLinkMapper().deleteByIds(ids);
|
||||
}
|
||||
PageLinkPO pageLinkPO = PageLinkPO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.employeeId((long) user.getUID())
|
||||
.page(param.getPage())
|
||||
.templateId(param.getTemplateId())
|
||||
.tenantKey(DEFAULT_TENANT_KEY)
|
||||
.createTime(new Date())
|
||||
.updateTime(new Date())
|
||||
.creator((long) user.getUID())
|
||||
.deleteType(0)
|
||||
.build();
|
||||
|
||||
getPageLinkMapper().insertIgnoreNull(pageLinkPO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WeaTableColumn> getPageListColumns(String page) {
|
||||
PageLinkPO link = getPageLinkMapper().getLink((long) user.getUID(), page);
|
||||
if (link != null) {
|
||||
PageListTemplateDTO pageListTemplate = getPageListTemplate(PageListTemplateQueryParam.builder().page(page).id(link.getTemplateId()).build());
|
||||
return pageListTemplate.getChecked();
|
||||
}else {
|
||||
PageListTemplateDTO pageListTemplate = getPageListTemplate(PageListTemplateQueryParam.builder().page(page).build());
|
||||
return pageListTemplate.getSetting();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -166,4 +166,9 @@ public class SalarySysConstant {
|
|||
* 报表组织类型,null/0 :核算时组织信息 1:实时组织信息
|
||||
*/
|
||||
public static final String REPORT_ORGANIZATIN_TYPE = "REPORT_ORGANIZATIN_TYPE";
|
||||
|
||||
/**
|
||||
* 薪资明细页面显示类型
|
||||
*/
|
||||
public static final String SALARY_DETAILS_REPORT_SHOW_TYPE = "SALARY_DETAILS_REPORT_SHOW_TYPE";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
package com.engine.salary.web;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.setting.param.PageListSettingQueryParam;
|
||||
import com.engine.salary.entity.setting.param.PageListSettingSaveParam;
|
||||
import com.engine.salary.entity.setting.param.PageListTemplateQueryParam;
|
||||
import com.engine.salary.entity.setting.param.PageListTemplateSaveParam;
|
||||
import com.engine.salary.entity.setting.dto.PageListTemplateDTO;
|
||||
import com.engine.salary.entity.setting.param.*;
|
||||
import com.engine.salary.entity.setting.po.PageListSettingPO;
|
||||
import com.engine.salary.entity.setting.po.PageListTemplatePO;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import com.engine.salary.util.SalaryEnumUtil;
|
||||
import com.engine.salary.wrapper.SalaryCommonWrapper;
|
||||
|
|
@ -84,6 +83,21 @@ public class SalaryCommonController {
|
|||
return new ResponseResult<PageListSettingQueryParam, Map>(user).run(getSalaryCommonWrapper(user)::getPageListSetting, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 页面模板表单
|
||||
* @param request
|
||||
* @param response
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/pageList/template/get")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getPageListTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody PageListTemplateQueryParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<PageListTemplateQueryParam, PageListTemplateDTO>(user).run(getSalaryCommonWrapper(user)::getPageListTemplate, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 页面模板列表
|
||||
* @param request
|
||||
|
|
@ -96,7 +110,7 @@ public class SalaryCommonController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getPageListTemplates(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody PageListTemplateQueryParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<PageListTemplateQueryParam, List<PageListSettingPO>>(user).run(getSalaryCommonWrapper(user)::getPageListTemplates, param);
|
||||
return new ResponseResult<PageListTemplateQueryParam, List<PageListTemplatePO>>(user).run(getSalaryCommonWrapper(user)::getPageListTemplates, param);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -111,6 +125,21 @@ public class SalaryCommonController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String savePageListTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody PageListTemplateSaveParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<PageListTemplateSaveParam, PageListSettingPO>(user).run(getSalaryCommonWrapper(user)::savePageListTemplate, param);
|
||||
return new ResponseResult<PageListTemplateSaveParam, PageListTemplatePO>(user).run(getSalaryCommonWrapper(user)::savePageListTemplate, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 页面模板列表
|
||||
* @param request
|
||||
* @param response
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/pageList/template/change")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String changeTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody PageListTemplateChangeParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<PageListTemplateChangeParam, PageListSettingPO>(user).run(getSalaryCommonWrapper(user)::changePageListTemplate, param);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,11 +2,9 @@ package com.engine.salary.wrapper;
|
|||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.setting.param.PageListSettingQueryParam;
|
||||
import com.engine.salary.entity.setting.param.PageListSettingSaveParam;
|
||||
import com.engine.salary.entity.setting.param.PageListTemplateQueryParam;
|
||||
import com.engine.salary.entity.setting.param.PageListTemplateSaveParam;
|
||||
import com.engine.salary.entity.setting.po.PageListSettingPO;
|
||||
import com.engine.salary.entity.setting.dto.PageListTemplateDTO;
|
||||
import com.engine.salary.entity.setting.param.*;
|
||||
import com.engine.salary.entity.setting.po.PageListTemplatePO;
|
||||
import com.engine.salary.service.SalaryCacheService;
|
||||
import com.engine.salary.service.SettingService;
|
||||
import com.engine.salary.service.impl.SalaryCacheServiceImpl;
|
||||
|
|
@ -44,11 +42,21 @@ public class SalaryCommonWrapper extends Service {
|
|||
return getSettingService(user).getPageListSetting(param);
|
||||
}
|
||||
|
||||
public List<PageListSettingPO> getPageListTemplates(PageListTemplateQueryParam queryParam) {
|
||||
return getSettingService(user).getPageListTemplates(queryParam);
|
||||
|
||||
public PageListTemplateDTO getPageListTemplate(PageListTemplateQueryParam param) {
|
||||
return getSettingService(user).getPageListTemplate(param);
|
||||
}
|
||||
|
||||
public PageListSettingPO savePageListTemplate(PageListTemplateSaveParam param) {
|
||||
public List<PageListTemplatePO> getPageListTemplates(PageListTemplateQueryParam param) {
|
||||
return getSettingService(user).getPageListTemplates(param);
|
||||
}
|
||||
|
||||
public PageListTemplatePO savePageListTemplate(PageListTemplateSaveParam param) {
|
||||
return getSettingService(user).savePageListTemplate(param);
|
||||
}
|
||||
|
||||
public void changePageListTemplate(PageListTemplateChangeParam param) {
|
||||
getSettingService(user).changePageListTemplate(param);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue