Merge branch 'feature/qt' into develop
This commit is contained in:
commit
288c274aaf
|
|
@ -0,0 +1,47 @@
|
|||
package com.engine.salary.biz;
|
||||
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobEmpFieldPO;
|
||||
import com.engine.salary.mapper.salarysob.SalarySobEmpFieldMapper;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import weaver.conn.mybatis.MyBatisFactory;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class SalarySobEmpFieldBiz {
|
||||
|
||||
|
||||
public List<SalarySobEmpFieldPO> listSome(SalarySobEmpFieldPO build) {
|
||||
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
SalarySobEmpFieldMapper mapper = sqlSession.getMapper(SalarySobEmpFieldMapper.class);
|
||||
return mapper.listSome(build);
|
||||
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
public void batchInsert(Collection<SalarySobEmpFieldPO> salarySobEmpFieldPOS) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
SalarySobEmpFieldMapper mapper = sqlSession.getMapper(SalarySobEmpFieldMapper.class);
|
||||
mapper.batchInsert(salarySobEmpFieldPOS);
|
||||
sqlSession.commit();
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteBySalarySobIds(Collection<Long> salarySobIds) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
SalarySobEmpFieldMapper mapper = sqlSession.getMapper(SalarySobEmpFieldMapper.class);
|
||||
mapper.deleteBySalarySobIds(salarySobIds);
|
||||
sqlSession.commit();
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -67,6 +67,7 @@ public class TaxRateListCmd extends AbstractCommonCommand<Map<String, Object>> {
|
|||
table.setCheckboxList(checkboxpopedomList);
|
||||
table.setCheckboxpopedom(null);
|
||||
|
||||
|
||||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
result.putAll(table.makeDataResult());
|
||||
result.success();
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import lombok.NoArgsConstructor;
|
|||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@SalaryTable(pageId = "a4f85287-6111-7721-adn9-7d06e54y6rj9",
|
||||
fields = " t.id, t.name, t.category, t.item_type, t.rounding_mode, t.pattern, t.value_type",
|
||||
fields = " t.id, t.name, t.category, t.item_type as itemType, t.rounding_mode as roundingMode, t.pattern, t.value_type as valueType",
|
||||
fromSql = " FROM hrsa_sys_salary_item t",
|
||||
tableType = WeaTableType.CHECKBOX)
|
||||
public class SysSalaryItemListDTO {
|
||||
|
|
@ -39,16 +39,16 @@ public class SysSalaryItemListDTO {
|
|||
@SalaryTableColumn(text = "属性", width = "10%", column = "category")
|
||||
private String category;
|
||||
|
||||
@SalaryTableColumn(text = "类型", width = "10%", column = "itemType")
|
||||
@SalaryTableColumn(text = "类型", width = "10%", column = "itemType",transmethod = "com.engine.salary.transmethod.TransMethod.valueType")
|
||||
private String itemType;
|
||||
|
||||
@SalaryTableColumn(text = "进位规则", width = "10%", column = "roundingMode")
|
||||
@SalaryTableColumn(text = "进位规则", width = "10%", column = "roundingMode",transmethod = "com.engine.salary.transmethod.TransMethod.roundingMode")
|
||||
private String roundingMode;
|
||||
|
||||
@SalaryTableColumn(text = "保留小数位", width = "10%", column = "pattern")
|
||||
private Integer pattern;
|
||||
|
||||
@SalaryTableColumn(text = "取值方式", width = "10%", column = "valueType")
|
||||
@SalaryTableColumn(text = "取值方式", width = "10%", column = "valueType",transmethod = "com.engine.salary.transmethod.TransMethod.datasource")
|
||||
private String valueType;
|
||||
|
||||
@SalaryTableColumn(text = "操作", width = "20%", column = "operate")
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ public class SalarySobItemSaveBO {
|
|||
*
|
||||
* @param saveParam
|
||||
* @param employeeId
|
||||
* @param tenantKey
|
||||
* @return
|
||||
*/
|
||||
public static Result handle(SalarySobItemSaveParam saveParam, Long employeeId) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,95 @@
|
|||
package com.engine.salary.mapper.salarysob;
|
||||
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobEmpFieldPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public interface SalarySobEmpFieldMapper {
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<SalarySobEmpFieldPO> listAll();
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<SalarySobEmpFieldPO> listSome(SalarySobEmpFieldPO SalarySobEmpFieldPO);
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
SalarySobEmpFieldPO getById(Long id);
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
*
|
||||
* @param SalarySobEmpFieldPO 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(SalarySobEmpFieldPO SalarySobEmpFieldPO);
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param SalarySobEmpFieldPO 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(SalarySobEmpFieldPO SalarySobEmpFieldPO);
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
*
|
||||
* @param SalarySobEmpFieldPO 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(SalarySobEmpFieldPO SalarySobEmpFieldPO);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param SalarySobEmpFieldPO 待删除的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int delete(SalarySobEmpFieldPO SalarySobEmpFieldPO);
|
||||
|
||||
|
||||
/**
|
||||
* 批量插入
|
||||
*
|
||||
* @param salarySobEmpFields
|
||||
*/
|
||||
void batchInsert(@Param("collection") Collection<SalarySobEmpFieldPO> salarySobEmpFields);
|
||||
|
||||
/**
|
||||
* 批量更新
|
||||
*
|
||||
* @param salarySobEmpFields
|
||||
*/
|
||||
void batchUpdate(@Param("collection") Collection<SalarySobEmpFieldPO> salarySobEmpFields);
|
||||
|
||||
/**
|
||||
* 根据主键id删除
|
||||
*
|
||||
* @param ids
|
||||
*/
|
||||
void deleteByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 根据薪资账套id删除
|
||||
*
|
||||
* @param salarySobIds
|
||||
*/
|
||||
void deleteBySalarySobIds(@Param("salarySobIds") Collection<Long> salarySobIds);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,330 @@
|
|||
<?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.salarysob.SalarySobEmpFieldMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.salarysob.po.SalarySobEmpFieldPO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="salary_sob_id" property="salarySobId"/>
|
||||
<result column="field_code" property="fieldCode"/>
|
||||
<result column="sorted_index" property="sortedIndex"/>
|
||||
<result column="can_delete" property="canDelete"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
<result column="tenant_key" property="tenantKey"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t
|
||||
.
|
||||
id
|
||||
, t.salary_sob_id
|
||||
, t.field_code
|
||||
, t.sorted_index
|
||||
, t.can_delete
|
||||
, t.creator
|
||||
, t.create_time
|
||||
, t.update_time
|
||||
, t.delete_type
|
||||
, t.tenant_key
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="listAll" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_salary_sob_emp_field t
|
||||
WHERE delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据主键获取单条记录 -->
|
||||
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_salary_sob_emp_field t
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 条件查询 -->
|
||||
<select id="listSome" resultMap="BaseResultMap"
|
||||
parameterType="com.engine.salary.entity.salarysob.po.SalarySobEmpFieldPO">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_salary_sob_emp_field t
|
||||
WHERE delete_type = 0
|
||||
<if test="id != null and id != ''">
|
||||
AND id = #{id}
|
||||
</if>
|
||||
<if test="salarySobId != null and salarySobId != ''">
|
||||
AND salary_sob_id = #{salarySobId}
|
||||
</if>
|
||||
<if test="fieldCode != null and fieldCode != ''">
|
||||
AND field_code = #{fieldCode}
|
||||
</if>
|
||||
<if test="sortedIndex != null and sortedIndex != ''">
|
||||
AND sorted_index = #{sortedIndex}
|
||||
</if>
|
||||
<if test="canDelete != null and canDelete != ''">
|
||||
AND can_delete = #{canDelete}
|
||||
</if>
|
||||
<if test="creator != null and creator != ''">
|
||||
AND creator = #{creator}
|
||||
</if>
|
||||
<if test="createTime != null and createTime != ''">
|
||||
AND create_time = #{createTime}
|
||||
</if>
|
||||
<if test="updateTime != null and updateTime != ''">
|
||||
AND update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="deleteType != null and deleteType != ''">
|
||||
AND delete_type = #{deleteType}
|
||||
</if>
|
||||
<if test="tenantKey != null and tenantKey != ''">
|
||||
AND tenant_key = #{tenantKey}
|
||||
</if>
|
||||
<if test="ids != null and ids.size()>0">
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 插入不为NULL的字段 -->
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.salarysob.po.SalarySobEmpFieldPO"
|
||||
keyProperty="id" keyColumn="id" useGeneratedKeys="true"
|
||||
>
|
||||
INSERT INTO hrsa_salary_sob_emp_field
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="salarySobId != null">
|
||||
salary_sob_id,
|
||||
</if>
|
||||
<if test="fieldCode != null">
|
||||
field_code,
|
||||
</if>
|
||||
<if test="sortedIndex != null">
|
||||
sorted_index,
|
||||
</if>
|
||||
<if test="canDelete != null">
|
||||
can_delete,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type,
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id},
|
||||
</if>
|
||||
<if test="salarySobId != null">
|
||||
#{salarySobId},
|
||||
</if>
|
||||
<if test="fieldCode != null">
|
||||
#{fieldCode},
|
||||
</if>
|
||||
<if test="sortedIndex != null">
|
||||
#{sortedIndex},
|
||||
</if>
|
||||
<if test="canDelete != null">
|
||||
#{canDelete},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
#{deleteType},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
#{tenantKey},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 更新,更新全部字段 -->
|
||||
<update id="update" parameterType="com.engine.salary.entity.salarysob.po.SalarySobEmpFieldPO">
|
||||
UPDATE hrsa_salary_sob_emp_field
|
||||
<set>
|
||||
salary_sob_id=#{salarySobId},
|
||||
field_code=#{fieldCode},
|
||||
sorted_index=#{sortedIndex},
|
||||
can_delete=#{canDelete},
|
||||
creator=#{creator},
|
||||
create_time=#{createTime},
|
||||
update_time=#{updateTime},
|
||||
delete_type=#{deleteType},
|
||||
tenant_key=#{tenantKey},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 更新不为NULL的字段 -->
|
||||
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.salarysob.po.SalarySobEmpFieldPO">
|
||||
UPDATE hrsa_salary_sob_emp_field
|
||||
<set>
|
||||
<if test="salarySobId != null">
|
||||
salary_sob_id=#{salarySobId},
|
||||
</if>
|
||||
<if test="fieldCode != null">
|
||||
field_code=#{fieldCode},
|
||||
</if>
|
||||
<if test="sortedIndex != null">
|
||||
sorted_index=#{sortedIndex},
|
||||
</if>
|
||||
<if test="canDelete != null">
|
||||
can_delete=#{canDelete},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator=#{creator},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time=#{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time=#{updateTime},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type=#{deleteType},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key=#{tenantKey},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 根据主键删除记录 -->
|
||||
<delete id="delete" parameterType="com.engine.salary.entity.salarysob.po.SalarySobEmpFieldPO">
|
||||
UPDATE hrsa_salary_sob_emp_field
|
||||
SET delete_type=1
|
||||
WHERE id = #{id}
|
||||
AND delete_type = 0
|
||||
</delete>
|
||||
|
||||
|
||||
|
||||
<insert id="batchInsert">
|
||||
INSERT INTO
|
||||
hrsa_salary_sob_emp_field(salary_sob_id, field_code, sorted_index, creator, create_time, update_time,
|
||||
delete_type, tenant_key)
|
||||
VALUES
|
||||
<foreach collection="collection" item="item" separator=",">
|
||||
(
|
||||
#{item.salarySobId},
|
||||
#{item.fieldCode},
|
||||
#{item.sortedIndex},
|
||||
#{item.creator},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
0,
|
||||
#{item.tenantKey}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="batchInsert" databaseId="oracle">
|
||||
INSERT INTO
|
||||
hrsa_salary_sob_emp_field( salary_sob_id, field_code, sorted_index, creator, create_time, update_time,
|
||||
delete_type, tenant_key)
|
||||
|
||||
<foreach collection="collection" item="item" separator="union all">
|
||||
select
|
||||
#{item.salarySobId},
|
||||
#{item.fieldCode},
|
||||
#{item.sortedIndex},
|
||||
#{item.creator},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
0,
|
||||
#{item.tenantKey}
|
||||
from dual
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="batchInsert" databaseId="sqlserver">
|
||||
INSERT INTO
|
||||
hrsa_salary_sob_emp_field(salary_sob_id, field_code, sorted_index, creator, create_time, update_time,
|
||||
delete_type, tenant_key)
|
||||
VALUES
|
||||
<foreach collection="collection" item="item" separator=",">
|
||||
(
|
||||
#{item.salarySobId},
|
||||
#{item.fieldCode},
|
||||
#{item.sortedIndex},
|
||||
#{item.creator},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
0,
|
||||
#{item.tenantKey}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="batchUpdate">
|
||||
UPDATE hrsa_salary_sob_emp_field
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<trim prefix="sorted_index = case" suffix="end,">
|
||||
<foreach collection="collection" item="item" index="index">
|
||||
WHEN id = #{item.id} THEN #{item.sortedIndex}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="update_time = case" suffix="end,">
|
||||
<foreach collection="collection" item="item" index="index">
|
||||
WHEN id = #{item.id} THEN #{item.updateTime}
|
||||
</foreach>
|
||||
</trim>
|
||||
</trim>
|
||||
WHERE delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="collection" item="item" open="(" close=")" separator=",">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="deleteByIds">
|
||||
UPDATE hrsa_salary_sob_emp_field
|
||||
SET delete_type = 1
|
||||
WHERE delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="deleteBySalarySobIds">
|
||||
UPDATE hrsa_salary_sob_emp_field
|
||||
SET delete_type = 1
|
||||
WHERE delete_type = 0
|
||||
AND salary_sob_id IN
|
||||
<foreach collection="salarySobIds" open="(" item="salarySobId" separator="," close=")">
|
||||
#{salarySobId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.biz.SalarySobEmpFieldBiz;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobEmpFieldPO;
|
||||
import com.engine.salary.service.SalarySobEmpFieldService;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description: 薪资账套的员工信息字段
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 1/18/22 5:43 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
public class SalarySobEmpFieldServiceImpl extends Service implements SalarySobEmpFieldService {
|
||||
|
||||
private SalarySobEmpFieldBiz salarySobEmpFieldMapper = new SalarySobEmpFieldBiz();
|
||||
|
||||
@Override
|
||||
public List<SalarySobEmpFieldPO> listBySalarySobId(Long salarySobId) {
|
||||
return salarySobEmpFieldMapper.listSome(SalarySobEmpFieldPO.builder().salarySobId(salarySobId).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void batchSave(Collection<SalarySobEmpFieldPO> salarySobEmpFieldPOS) {
|
||||
salarySobEmpFieldMapper.batchInsert(salarySobEmpFieldPOS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteBySalarySobIds(Collection<Long> salarySobIds) {
|
||||
salarySobEmpFieldMapper.deleteBySalarySobIds(salarySobIds);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.biz.SalarySobBiz;
|
||||
import com.engine.salary.biz.SalarySobItemBiz;
|
||||
|
|
@ -18,6 +19,7 @@ import com.engine.salary.util.SalaryEntityUtil;
|
|||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.weaver.excel.formula.api.entity.ExpressFormula;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
|
@ -33,8 +35,15 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe
|
|||
|
||||
private SalarySobItemBiz salarySobItemMapper = new SalarySobItemBiz();
|
||||
private SalarySobBiz salarySobBiz = new SalarySobBiz();
|
||||
private SalarySobEmpFieldService salarySobEmpFieldService;
|
||||
private SalarySobItemGroupService salarySobItemGroupService;
|
||||
|
||||
private SalarySobEmpFieldService getSalarySobEmpFieldService(User user) {
|
||||
return (SalarySobEmpFieldService) ServiceUtil.getService(SalarySobEmpFieldServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobItemGroupService getSalarySobItemGroupService(User user) {
|
||||
return (SalarySobItemGroupService) ServiceUtil.getService(SalarySobItemGroupServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryFormulaService salaryFormulaService;
|
||||
private SalaryItemService salaryItemService;
|
||||
// private LoggerTemplate salarySobLoggerTemplate;
|
||||
|
|
@ -87,9 +96,9 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe
|
|||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98379, "参数错误,薪资账套不存在或者已被删除"));
|
||||
}
|
||||
// 查询薪资账套的员工信息字段
|
||||
List<SalarySobEmpFieldPO> salarySobEmpFieldPOS = salarySobEmpFieldService.listBySalarySobId(salarySobId);
|
||||
List<SalarySobEmpFieldPO> salarySobEmpFieldPOS = getSalarySobEmpFieldService(user).listBySalarySobId(salarySobId);
|
||||
// 查询薪资账套的薪资项目分类
|
||||
List<SalarySobItemGroupPO> salarySobItemGroupPOS = salarySobItemGroupService.listBySalarySobId(salarySobId);
|
||||
List<SalarySobItemGroupPO> salarySobItemGroupPOS = getSalarySobItemGroupService(user).listBySalarySobId(salarySobId);
|
||||
// 查询薪资账套的薪资项目副本
|
||||
List<SalarySobItemPO> salarySobItemPOS = listBySalarySobId(salarySobId);
|
||||
// 薪资账套的薪资项目副本所用的公式id
|
||||
|
|
@ -112,26 +121,27 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe
|
|||
if (Objects.isNull(salarySobPO)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98379, "参数错误,薪资账套不存在或者已被删除"));
|
||||
}
|
||||
// 删除薪资账套的员工信息字段
|
||||
salarySobEmpFieldService.deleteBySalarySobIds(Collections.singleton(saveParam.getSalarySobId()));
|
||||
// 删除薪资账套的薪资项目副本
|
||||
deleteBySalarySobIds(Collections.singleton(saveParam.getSalarySobId()));
|
||||
// 删除薪资账套的薪资项目分类
|
||||
salarySobItemGroupService.deleteBySalarySobIds(Collections.singleton(saveParam.getSalarySobId()));
|
||||
//todo
|
||||
// // 删除薪资账套的员工信息字段
|
||||
// salarySobEmpFieldService.deleteBySalarySobIds(Collections.singleton(saveParam.getSalarySobId()));
|
||||
// // 删除薪资账套的薪资项目副本
|
||||
// deleteBySalarySobIds(Collections.singleton(saveParam.getSalarySobId()));
|
||||
// // 删除薪资账套的薪资项目分类
|
||||
// getSalarySobItemGroupService(user).deleteBySalarySobIds(Collections.singleton(saveParam.getSalarySobId()));
|
||||
|
||||
// 处理保存参数
|
||||
SalarySobItemSaveBO.Result result = SalarySobItemSaveBO.handle(saveParam,(long)user.getUID());
|
||||
// 保存薪资账套的员工信息字段
|
||||
if (CollectionUtils.isNotEmpty(result.getNeedInsertSalarySobEmpFields())) {
|
||||
salarySobEmpFieldService.batchSave(result.getNeedInsertSalarySobEmpFields());
|
||||
}
|
||||
// if (CollectionUtils.isNotEmpty(result.getNeedInsertSalarySobEmpFields())) {
|
||||
// salarySobEmpFieldService.batchSave(result.getNeedInsertSalarySobEmpFields());
|
||||
// }
|
||||
// 保存薪资账套的薪资项目副本
|
||||
if (CollectionUtils.isNotEmpty(result.getNeedInsertSalarySobItems())) {
|
||||
batchSave(result.getNeedInsertSalarySobItems());
|
||||
}
|
||||
// 保存薪资账套的薪资项目分类
|
||||
if (CollectionUtils.isNotEmpty(result.getNeedInsertSalarySobItemGroups())) {
|
||||
salarySobItemGroupService.batchSave(result.getNeedInsertSalarySobItemGroups());
|
||||
getSalarySobItemGroupService(user).batchSave(result.getNeedInsertSalarySobItemGroups());
|
||||
}
|
||||
//todo 记录日志
|
||||
// LoggerContext<SalarySobPO> loggerContext = new LoggerContext<>();
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ import java.util.stream.Collectors;
|
|||
**/
|
||||
public class SalarySobRangeServiceImpl extends Service implements SalarySobRangeService {
|
||||
|
||||
private SalarySobRangeBiz salarySobRangeMapper = new SalarySobRangeBiz();
|
||||
private SalarySobRangeBiz salarySobRangeBiz = new SalarySobRangeBiz();
|
||||
private EmployBiz employBiz = new EmployBiz();
|
||||
OrganizationShowSetBiz orgBiz = new OrganizationShowSetBiz();
|
||||
|
||||
|
|
@ -60,12 +60,12 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange
|
|||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return salarySobRangeMapper.listSome(SalarySobRangePO.builder().ids(ids).build());
|
||||
return salarySobRangeBiz.listSome(SalarySobRangePO.builder().ids(ids).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalarySobRangePO> listBySalarySobIdAndIncludeType(Long salarySobId, Integer includeType) {
|
||||
return salarySobRangeMapper.listSome(SalarySobRangePO.builder().salarySobId(salarySobId).includeType(includeType).build());
|
||||
return salarySobRangeBiz.listSome(SalarySobRangePO.builder().salarySobId(salarySobId).includeType(includeType).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -128,10 +128,10 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange
|
|||
SalarySobRangeSaveBO.Result result = SalarySobRangeSaveBO.handle(salarySobRangePOS, saveParam, (long) user.getUID());
|
||||
// 保存
|
||||
if (CollectionUtils.isNotEmpty(result.getNeedInsertSalarySobRanges())) {
|
||||
salarySobRangeMapper.batchInsert(result.getNeedInsertSalarySobRanges());
|
||||
salarySobRangeBiz.batchInsert(result.getNeedInsertSalarySobRanges());
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(result.getNeedUpdateSalarySobRanges())) {
|
||||
result.getNeedUpdateSalarySobRanges().forEach(e -> salarySobRangeMapper.updateById(e));
|
||||
result.getNeedUpdateSalarySobRanges().forEach(e -> salarySobRangeBiz.updateById(e));
|
||||
}
|
||||
// todo 记录日志
|
||||
// String operateTypeName = Objects.equals(saveParam.getIncludeType(), NumberUtils.INTEGER_ONE) ?
|
||||
|
|
@ -155,7 +155,7 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange
|
|||
}
|
||||
ids = SalaryEntityUtil.properties(salarySobRangePOS, SalarySobRangePO::getId);
|
||||
// 删除薪资账套的人员范围
|
||||
salarySobRangeMapper.deleteByIds(ids);
|
||||
salarySobRangeBiz.deleteByIds(ids);
|
||||
// 查询薪资账套
|
||||
Set<Long> salarySobIds = SalaryEntityUtil.properties(salarySobRangePOS, SalarySobRangePO::getSalarySobId);
|
||||
List<SalarySobPO> salarySobPOS = getSalarySobService(user).listByIds(salarySobIds);
|
||||
|
|
@ -176,6 +176,6 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange
|
|||
|
||||
@Override
|
||||
public void deleteBySalarySobIds(Collection<Long> salarySobIds) {
|
||||
salarySobRangeMapper.deleteBySalarySobIds(salarySobIds);
|
||||
salarySobRangeBiz.deleteBySalarySobIds(salarySobIds);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,21 +1,27 @@
|
|||
package com.engine.salary.web;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobRangeListDTO;
|
||||
import com.engine.salary.entity.salarysob.param.*;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobItemGroupPO;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.wrapper.SalarySobItemWrapper;
|
||||
import com.engine.salary.wrapper.SalarySobRangeWrapper;
|
||||
import com.engine.salary.wrapper.SalarySobWrapper;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
|
|
@ -43,8 +49,10 @@ public class SalarySobController {
|
|||
return ServiceUtil.getService(SalarySobRangeWrapper.class, user);
|
||||
}
|
||||
|
||||
// private SalarySobRangeWrapper salarySobRangeWrapper;
|
||||
// private SalarySobItemWrapper salarySobItemWrapper;
|
||||
private SalarySobItemWrapper getSalarySobItemWrapper(User user) {
|
||||
return ServiceUtil.getService(SalarySobItemWrapper.class, user);
|
||||
}
|
||||
|
||||
// private SalarySobAdjustRuleWrapper salarySobAdjustRuleWrapper;
|
||||
// private SalarySobCheckRuleWrapper salarySobCheckRuleWrapper;
|
||||
|
||||
|
|
@ -189,38 +197,61 @@ public class SalarySobController {
|
|||
|
||||
/**********************************薪资账套的薪资项目 start*********************************/
|
||||
|
||||
// @PostMapping("/item/listSalaryItem")
|
||||
// @ApiOperation("薪资账套可选薪资项目")
|
||||
// @WeaPermission
|
||||
// public WeaResult<WeaTable<SalaryItemListDTO>> listSalaryItem(@RequestBody SalaryItemSearchParam queryParam) {
|
||||
// WeaTable<SalaryItemListDTO> weaTable = salarySobItemWrapper.listPage4SalaryItem(queryParam, TenantContext.getCurrentTenantKey());
|
||||
// return WeaResult.success(weaTable);
|
||||
// }
|
||||
//
|
||||
// @GetMapping("/item/group/getForm")
|
||||
// @ApiOperation("薪资账套项目分组的详情")
|
||||
// @WeaPermission
|
||||
// public WeaResult<WeaForm> getSalarySobItemGroupForm(@RequestParam(name = "id", required = false) Long id) {
|
||||
// WeaForm weaForm = salarySobItemWrapper.getGroupForm(id, TenantContext.getCurrentTenantKey());
|
||||
// return WeaResult.success(weaForm);
|
||||
// }
|
||||
//
|
||||
// @GetMapping("/item/getForm")
|
||||
// @ApiOperation("薪资账套薪资项目详情")
|
||||
// @WeaPermission
|
||||
// public WeaResult<SalarySobItemAggregateDTO> getSalarySobItemForm(@RequestParam(name = "salarySobId") Long salarySobId) {
|
||||
// SalarySobItemAggregateDTO form = salarySobItemWrapper.getForm(salarySobId, TenantContext.getCurrentTenantKey());
|
||||
// return WeaResult.success(form);
|
||||
// }
|
||||
//
|
||||
// @PostMapping("/item/save")
|
||||
// @ApiOperation("保存薪资账套薪资项目")
|
||||
// @WeaPermission
|
||||
// public WeaResult<Object> saveSalarySobItem(@RequestBody @Validated SalarySobItemSaveParam saveParam) {
|
||||
// salarySobItemWrapper.save(saveParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
|
||||
// return WeaResult.success(null);
|
||||
// }
|
||||
//
|
||||
/**
|
||||
* 薪资账套可选薪资项目
|
||||
*/
|
||||
@POST
|
||||
@Path("/item/listSalaryItem")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String listSalaryItem(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryItemSearchParam queryParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryItemSearchParam, Map<String, Object>>().run(getSalarySobItemWrapper(user)::listPage4SalaryItem, queryParam);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 薪资账套可选薪资项目分类
|
||||
*/
|
||||
@GET
|
||||
@Path("/item/group/getForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getSalarySobItemGroupForm(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
String idStr = request.getParameter("id");
|
||||
Long id = null;
|
||||
if(StringUtils.isNotBlank(idStr)){
|
||||
id = Long.valueOf(idStr);
|
||||
}
|
||||
return new ResponseResult<Long, SalarySobItemGroupPO>().run(getSalarySobItemWrapper(user)::getGroupForm, id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 薪资账套薪资项目详情
|
||||
*/
|
||||
@GET
|
||||
@Path("/item/getForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getSalarySobItemForm(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
String salarySobIdStr = request.getParameter("salarySobId");
|
||||
Long salarySobId = null;
|
||||
if(StringUtils.isNotBlank(salarySobIdStr)){
|
||||
salarySobId = Long.valueOf(salarySobIdStr);
|
||||
}
|
||||
return new ResponseResult<Long, SalarySobItemAggregateDTO>().run(getSalarySobItemWrapper(user)::getForm, salarySobId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存薪资账套薪资项目
|
||||
*/
|
||||
@POST
|
||||
@Path("/item/save")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String saveSalarySobItem(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobItemSaveParam saveParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalarySobItemSaveParam, String>().run(getSalarySobItemWrapper(user)::save, saveParam);
|
||||
}
|
||||
|
||||
// /**********************************薪资账套的薪资项目 end*********************************/
|
||||
//
|
||||
// /**********************************调薪计薪规则 start*********************************/
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.wrapper;
|
||||
|
||||
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.component.SalaryWeaTable;
|
||||
import com.engine.salary.entity.salaryitem.dto.SalaryItemListDTO;
|
||||
|
|
@ -12,7 +13,11 @@ import com.engine.salary.service.SalaryFormulaService;
|
|||
import com.engine.salary.service.SalaryItemService;
|
||||
import com.engine.salary.service.SalarySobItemGroupService;
|
||||
import com.engine.salary.service.SalarySobItemService;
|
||||
import com.engine.salary.service.impl.SalaryItemServiceImpl;
|
||||
import com.engine.salary.service.impl.SalarySobItemGroupServiceImpl;
|
||||
import com.engine.salary.service.impl.SalarySobItemServiceImpl;
|
||||
import org.springframework.stereotype.Component;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -27,9 +32,19 @@ import java.util.Map;
|
|||
@Component
|
||||
public class SalarySobItemWrapper extends Service {
|
||||
|
||||
private SalarySobItemService salarySobItemService;
|
||||
private SalarySobItemGroupService salarySobItemGroupService;
|
||||
private SalaryItemService salaryItemService;
|
||||
private SalarySobItemService getSalarySobItemService(User user) {
|
||||
return (SalarySobItemService) ServiceUtil.getService(SalarySobItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobItemGroupService getSalarySobItemGroupService(User user) {
|
||||
return (SalarySobItemGroupService) ServiceUtil.getService(SalarySobItemGroupServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryItemService getSalaryItemService(User user) {
|
||||
return (SalaryItemService) ServiceUtil.getService(SalaryItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
|
||||
private SalaryFormulaService salaryFormulaService;
|
||||
|
||||
/**
|
||||
|
|
@ -101,7 +116,7 @@ public class SalarySobItemWrapper extends Service {
|
|||
* @return
|
||||
*/
|
||||
public SalarySobItemGroupPO getGroupForm(Long salarySobItemGroupId) {
|
||||
return salarySobItemGroupService.getById(salarySobItemGroupId);
|
||||
return getSalarySobItemGroupService(user).getById(salarySobItemGroupId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -111,7 +126,7 @@ public class SalarySobItemWrapper extends Service {
|
|||
* @return
|
||||
*/
|
||||
public SalarySobItemAggregateDTO getForm(Long salarySobId) {
|
||||
return salarySobItemService.getAggregateBySalarySobId(salarySobId);
|
||||
return getSalarySobItemService(user).getAggregateBySalarySobId(salarySobId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -120,6 +135,6 @@ public class SalarySobItemWrapper extends Service {
|
|||
* @param saveParam 保存参数
|
||||
*/
|
||||
public void save(SalarySobItemSaveParam saveParam) {
|
||||
salarySobItemService.save(saveParam);
|
||||
getSalarySobItemService(user).save(saveParam);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue