职级接口 实现类注解修改
parent
72b62418de
commit
2d53588d39
@ -0,0 +1,88 @@
|
|||||||
|
package com.engine.organization.entity.scheme.dto;
|
||||||
|
|
||||||
|
import com.engine.organization.entity.scheme.param.GradeSearchParam;
|
||||||
|
import com.engine.organization.entity.scheme.po.GradePO;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author dxfeng
|
||||||
|
* @Description: TODO
|
||||||
|
* @Date 2022/5/11
|
||||||
|
* @Version V1.0
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class GradeDTO {
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
private long id;
|
||||||
|
/**
|
||||||
|
* 编号
|
||||||
|
*/
|
||||||
|
private String gradeNo;
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
private String gradeName;
|
||||||
|
/**
|
||||||
|
* 描述说明
|
||||||
|
*/
|
||||||
|
private String description;
|
||||||
|
/**
|
||||||
|
* 等级方案
|
||||||
|
*/
|
||||||
|
private long schemeId;
|
||||||
|
/**
|
||||||
|
* 职等
|
||||||
|
*/
|
||||||
|
private long levelId;
|
||||||
|
/**
|
||||||
|
* 禁用标记
|
||||||
|
*/
|
||||||
|
private int forbiddenTag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private Long creator;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private int deleteType;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
public static GradePO convertParamToPO(GradeSearchParam param, Long employeeId) {
|
||||||
|
if (param == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return GradePO.builder()
|
||||||
|
.id(param.getId() == null ? 0 : param.getId())
|
||||||
|
.gradeNo(param.getGradeNo() == null ? null : param.getGradeNo())
|
||||||
|
.gradeName(param.getGradeName() == null ? null : param.getGradeName())
|
||||||
|
.description(param.getDescription() == null ? null : param.getDescription())
|
||||||
|
.schemeId(param.getSchemeId() == null ? 0 : param.getSchemeId())
|
||||||
|
.levelId(param.getLevelId() == null ? 0 : param.getLevelId())
|
||||||
|
.forbiddenTag(param.getForbiddenTag() == null ? 0 : param.getForbiddenTag() ? 0 : 1)
|
||||||
|
.deleteType(0)
|
||||||
|
.createTime(new Date())
|
||||||
|
.updateTime(new Date())
|
||||||
|
.creator(employeeId)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,49 @@
|
|||||||
|
package com.engine.organization.entity.scheme.param;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author dxfeng
|
||||||
|
* @Description: TODO
|
||||||
|
* @Date 2022/5/11
|
||||||
|
* @Version V1.0
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class GradeSearchParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 编号
|
||||||
|
*/
|
||||||
|
private String gradeNo;
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
private String gradeName;
|
||||||
|
/**
|
||||||
|
* 描述说明
|
||||||
|
*/
|
||||||
|
private String description;
|
||||||
|
/**
|
||||||
|
* 等级方案
|
||||||
|
*/
|
||||||
|
private Long schemeId;
|
||||||
|
/**
|
||||||
|
* 职等
|
||||||
|
*/
|
||||||
|
private Long levelId;
|
||||||
|
/**
|
||||||
|
* 禁用标记
|
||||||
|
*/
|
||||||
|
private Boolean forbiddenTag;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
package com.engine.organization.entity.scheme.po;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: TODO
|
||||||
|
* @author:dxfeng
|
||||||
|
* @createTime: 2022/05/11
|
||||||
|
* @version: 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class GradePO {
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
private long id;
|
||||||
|
/**
|
||||||
|
* 编号
|
||||||
|
*/
|
||||||
|
private String gradeNo;
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
private String gradeName;
|
||||||
|
/**
|
||||||
|
* 描述说明
|
||||||
|
*/
|
||||||
|
private String description;
|
||||||
|
/**
|
||||||
|
* 等级方案
|
||||||
|
*/
|
||||||
|
private long schemeId;
|
||||||
|
/**
|
||||||
|
* 职等
|
||||||
|
*/
|
||||||
|
private long levelId;
|
||||||
|
/**
|
||||||
|
* 禁用标记
|
||||||
|
*/
|
||||||
|
private int forbiddenTag;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private Long creator;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private int deleteType;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,81 @@
|
|||||||
|
package com.engine.organization.entity.scheme.vo;
|
||||||
|
|
||||||
|
import com.engine.organization.annotation.OrganizationTable;
|
||||||
|
import com.engine.organization.annotation.OrganizationTableColumn;
|
||||||
|
import com.engine.organization.annotation.OrganizationTableOperate;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: TODO
|
||||||
|
* @author:dxfeng
|
||||||
|
* @createTime: 2022/05/11
|
||||||
|
* @version: 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@OrganizationTable(pageId = "1afe425c-d0f8-11ec-b80e-00ffcbed7508",
|
||||||
|
fields = "t.id ," +
|
||||||
|
" t.grade_no ," +
|
||||||
|
" t.grade_name ," +
|
||||||
|
" t.description ," +
|
||||||
|
" a.scheme_name ," +
|
||||||
|
" b.level_name ," +
|
||||||
|
" t.forbidden_tag",
|
||||||
|
fromSql = "from jcl_org_grade t inner join jcl_org_scheme a on t.scheme_id = a.id inner join jcl_org_level b on t.level_id = b.id ",
|
||||||
|
orderby = "id desc",
|
||||||
|
primarykey = "id",
|
||||||
|
operates = {
|
||||||
|
@OrganizationTableOperate(index = "0", text = "编辑"),
|
||||||
|
@OrganizationTableOperate(index = "1", text = "删除")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
public class GradeTableVO {
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@OrganizationTableColumn(column = "id", display = false)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 编号
|
||||||
|
*/
|
||||||
|
@OrganizationTableColumn(text = "编号", width = "20%", column = "grade_no")
|
||||||
|
private String gradeNo;
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
@OrganizationTableColumn(text = "名称", width = "20%", column = "grade_name")
|
||||||
|
private String gradeName;
|
||||||
|
/**
|
||||||
|
* 描述说明
|
||||||
|
*/
|
||||||
|
@OrganizationTableColumn(text = "描述说明", width = "20%", column = "description")
|
||||||
|
private String description;
|
||||||
|
/**
|
||||||
|
* 等级方案
|
||||||
|
*/
|
||||||
|
private long schemeId;
|
||||||
|
/**
|
||||||
|
* 等级方案
|
||||||
|
*/
|
||||||
|
@OrganizationTableColumn(text = "等级方案", width = "20%", column = "scheme_name")
|
||||||
|
private String schemeName;
|
||||||
|
/**
|
||||||
|
* 职等
|
||||||
|
*/
|
||||||
|
private long levelId;
|
||||||
|
/**
|
||||||
|
* 职等
|
||||||
|
*/
|
||||||
|
@OrganizationTableColumn(text = "等级方案", width = "20%", column = "level_name")
|
||||||
|
private String levelName;
|
||||||
|
/**
|
||||||
|
* 禁用标记
|
||||||
|
*/
|
||||||
|
@OrganizationTableColumn(text = "禁用标记", width = "20%", column = "forbidden_tag")
|
||||||
|
private int forbiddenTag;
|
||||||
|
}
|
@ -0,0 +1,148 @@
|
|||||||
|
<?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.organization.mapper.scheme.GradeMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.engine.organization.entity.scheme.po.GradePO">
|
||||||
|
<result column="id" property="id"/>
|
||||||
|
<result column="grade_no" property="gradeNo"/>
|
||||||
|
<result column="grade_name" property="gradeName"/>
|
||||||
|
<result column="description" property="description"/>
|
||||||
|
<result column="scheme_id" property="schemeId"/>
|
||||||
|
<result column="level_id" property="levelId"/>
|
||||||
|
<result column="forbidden_tag" property="forbiddenTag"/>
|
||||||
|
<result column="creator" property="creator"/>
|
||||||
|
<result column="creator" property="deleteType"/>
|
||||||
|
<result column="create_time" property="createTime"/>
|
||||||
|
<result column="update_time" property="updateTime"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<!-- 表字段 -->
|
||||||
|
<sql id="baseColumns">
|
||||||
|
t
|
||||||
|
.
|
||||||
|
id
|
||||||
|
, t.grade_no
|
||||||
|
, t.grade_name
|
||||||
|
, t.description
|
||||||
|
, t.scheme_id
|
||||||
|
, t.level_id
|
||||||
|
, t.forbidden_tag
|
||||||
|
, t.creator
|
||||||
|
, t.delete_type
|
||||||
|
, t.create_time
|
||||||
|
, t.update_time
|
||||||
|
</sql>
|
||||||
|
<select id="getGradeByID" parameterType="com.engine.organization.entity.scheme.po.GradePO"
|
||||||
|
resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<include refid="baseColumns"/>
|
||||||
|
from jcl_org_grade t where id = #{id} AND delete_type = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="listByNo" parameterType="com.engine.organization.entity.scheme.po.GradePO" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<include refid="baseColumns"/>
|
||||||
|
from jcl_org_grade t where grade_no = #{gradeNo} AND delete_type = 0
|
||||||
|
</select>
|
||||||
|
<select id="getCountByTag" resultType="java.lang.Integer">
|
||||||
|
select count(1) from jcl_org_grade where 1=1
|
||||||
|
<if test=" tag != -1 " >
|
||||||
|
and forbidden_tag = #{tag}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateGrade" parameterType="com.engine.organization.entity.scheme.po.GradePO">
|
||||||
|
update jcl_org_grade
|
||||||
|
<set>
|
||||||
|
creator=#{creator},
|
||||||
|
update_time=#{updateTime},
|
||||||
|
grade_no=#{gradeNo},
|
||||||
|
grade_name=#{gradeName},
|
||||||
|
description=#{description},
|
||||||
|
scheme_id=#{schemeId},
|
||||||
|
level_id=#{levelId},
|
||||||
|
</set>
|
||||||
|
WHERE id = #{id} AND delete_type = 0
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.scheme.po.GradePO" keyProperty="id"
|
||||||
|
keyColumn="id" useGeneratedKeys="true">
|
||||||
|
INSERT INTO jcl_org_grade
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="creator != null">
|
||||||
|
creator,
|
||||||
|
</if>
|
||||||
|
<if test="deleteType != null">
|
||||||
|
delete_type,
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time,
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
update_time,
|
||||||
|
</if>
|
||||||
|
<if test="gradeNo != null ">
|
||||||
|
grade_no,
|
||||||
|
</if>
|
||||||
|
<if test="gradeName != null ">
|
||||||
|
grade_name,
|
||||||
|
</if>
|
||||||
|
<if test="description != null ">
|
||||||
|
description,
|
||||||
|
</if>
|
||||||
|
<if test="schemeId != null ">
|
||||||
|
scheme_id,
|
||||||
|
</if><if test="levelId != null ">
|
||||||
|
level_id,
|
||||||
|
</if>
|
||||||
|
forbidden_tag,
|
||||||
|
</trim>
|
||||||
|
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="creator != null">
|
||||||
|
#{creator},
|
||||||
|
</if>
|
||||||
|
<if test="deleteType != null">
|
||||||
|
#{deleteType},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
#{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
#{updateTime},
|
||||||
|
</if>
|
||||||
|
<if test="gradeNo != null ">
|
||||||
|
#{gradeNo},
|
||||||
|
</if>
|
||||||
|
<if test="gradeName != null ">
|
||||||
|
#{gradeName},
|
||||||
|
</if>
|
||||||
|
<if test="description != null ">
|
||||||
|
#{description},
|
||||||
|
</if>
|
||||||
|
<if test="schemeId != null ">
|
||||||
|
#{schemeId},
|
||||||
|
</if><if test="levelId != null ">
|
||||||
|
#{levelId},
|
||||||
|
</if>
|
||||||
|
0,
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateForbiddenTagById" parameterType="com.engine.organization.entity.scheme.po.GradePO">
|
||||||
|
update jcl_org_grade
|
||||||
|
<set>
|
||||||
|
forbidden_tag=#{forbiddenTag},
|
||||||
|
</set>
|
||||||
|
WHERE id = #{id} AND delete_type = 0
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="deleteByIds">
|
||||||
|
UPDATE jcl_org_grade
|
||||||
|
SET delete_type = 1
|
||||||
|
WHERE delete_type = 0
|
||||||
|
AND id IN
|
||||||
|
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</update>
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,81 @@
|
|||||||
|
package com.engine.organization.service;
|
||||||
|
|
||||||
|
import com.engine.organization.entity.scheme.param.GradeSearchParam;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: TODO
|
||||||
|
* @author:dxfeng
|
||||||
|
* @createTime: 2022/05/11
|
||||||
|
* @version: 1.0
|
||||||
|
*/
|
||||||
|
public interface GradeService {
|
||||||
|
/**
|
||||||
|
* 职等列表
|
||||||
|
*
|
||||||
|
* @param params
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Map<String, Object> listPage(Map<String, Object> params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增职等
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int saveGrade(GradeSearchParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新职等信息
|
||||||
|
*
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int updateGrade(GradeSearchParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新禁用标记
|
||||||
|
*
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
int updateForbiddenTagById(GradeSearchParam params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
*/
|
||||||
|
int deleteByIds(Collection<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取搜索条件
|
||||||
|
*
|
||||||
|
* @param params
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Map<String, Object> getSearchCondition(Map<String, Object> params);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取新增表单
|
||||||
|
*
|
||||||
|
* @param params
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Map<String, Object> getGradeForm(Map<String, Object> params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取列表页面按钮信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Map<String, Object> getTableBtn();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取列表tabs
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Map<String, Object> getTabInfo();
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,177 @@
|
|||||||
|
package com.engine.organization.service.impl;
|
||||||
|
|
||||||
|
import com.api.browser.bean.SearchConditionGroup;
|
||||||
|
import com.api.browser.bean.SearchConditionItem;
|
||||||
|
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||||
|
import com.engine.core.impl.Service;
|
||||||
|
import com.engine.organization.component.OrganizationWeaTable;
|
||||||
|
import com.engine.organization.entity.TopTab;
|
||||||
|
import com.engine.organization.entity.scheme.dto.GradeDTO;
|
||||||
|
import com.engine.organization.entity.scheme.param.GradeSearchParam;
|
||||||
|
import com.engine.organization.entity.scheme.po.GradePO;
|
||||||
|
import com.engine.organization.entity.scheme.vo.GradeTableVO;
|
||||||
|
import com.engine.organization.mapper.scheme.GradeMapper;
|
||||||
|
import com.engine.organization.service.GradeService;
|
||||||
|
import com.engine.organization.util.MenuBtn;
|
||||||
|
import com.engine.organization.util.OrganizationAssert;
|
||||||
|
import com.engine.organization.util.OrganizationFormItemUtil;
|
||||||
|
import com.engine.organization.util.db.DBType;
|
||||||
|
import com.engine.organization.util.db.MapperProxyFactory;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import weaver.conn.RecordSet;
|
||||||
|
import weaver.general.StringUtil;
|
||||||
|
import weaver.general.Util;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: TODO
|
||||||
|
* @author:dxfeng
|
||||||
|
* @createTime: 2022/05/11
|
||||||
|
* @version: 1.0
|
||||||
|
*/
|
||||||
|
public class GradeServiceImpl extends Service implements GradeService {
|
||||||
|
|
||||||
|
private GradeMapper getGradeMapper() {
|
||||||
|
return MapperProxyFactory.getProxy(GradeMapper.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> listPage(Map<String, Object> params) {
|
||||||
|
OrganizationWeaTable<GradeTableVO> table = new OrganizationWeaTable<>(user, GradeTableVO.class);
|
||||||
|
String sqlWhere = buildSqlWhere(params);
|
||||||
|
table.setSqlwhere(sqlWhere);
|
||||||
|
WeaResultMsg result = new WeaResultMsg(false);
|
||||||
|
result.putAll(table.makeDataResult());
|
||||||
|
result.success();
|
||||||
|
return result.getResultMap();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int saveGrade(GradeSearchParam param) {
|
||||||
|
List<GradePO> list = getGradeMapper().listByNo(Util.null2String(param.getGradeNo()));
|
||||||
|
OrganizationAssert.isEmpty(list, "编号不允许重复");
|
||||||
|
GradePO gradePO = GradeDTO.convertParamToPO(param, (long) user.getUID());
|
||||||
|
System.out.println(gradePO);
|
||||||
|
return getGradeMapper().insertIgnoreNull(gradePO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateGrade(GradeSearchParam param) {
|
||||||
|
GradePO gradePO = GradeDTO.convertParamToPO(param, (long) user.getUID());
|
||||||
|
return getGradeMapper().updateGrade(gradePO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateForbiddenTagById(GradeSearchParam params) {
|
||||||
|
GradePO gradePO = GradePO.builder().id(params.getId()).forbiddenTag(params.getForbiddenTag() ? 0 : 1).build();
|
||||||
|
return getGradeMapper().updateForbiddenTagById(gradePO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int deleteByIds(Collection<Long> ids) {
|
||||||
|
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
|
||||||
|
return getGradeMapper().deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
|
||||||
|
Map<String, Object> apiDatas = new HashMap<>();
|
||||||
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||||
|
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
||||||
|
SearchConditionItem browserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "等级方案", "161", "schemeId", true, "schemeBrowser");
|
||||||
|
SearchConditionItem gradeNameCondition = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "名称", "gradeName");
|
||||||
|
conditionItems.add(browserItem);
|
||||||
|
conditionItems.add(gradeNameCondition);
|
||||||
|
addGroups.add(new SearchConditionGroup("高级搜索条件", true, conditionItems));
|
||||||
|
apiDatas.put("conditions", addGroups);
|
||||||
|
return apiDatas;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getGradeForm(Map<String, Object> params) {
|
||||||
|
Map<String, Object> apiDatas = new HashMap<>();
|
||||||
|
List<SearchConditionItem> selectItems = new ArrayList<>();
|
||||||
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||||
|
SearchConditionItem gradeNameCondition = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, "名称", "gradeName");
|
||||||
|
gradeNameCondition.setRules("required|string");
|
||||||
|
SearchConditionItem gradeNoCondition = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, "编号", "gradeNo");
|
||||||
|
gradeNoCondition.setRules("required|string");
|
||||||
|
SearchConditionItem descriptionCondition = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 60, "描述说明", "description");
|
||||||
|
SearchConditionItem browserItem = OrganizationFormItemUtil.browserItem(user, 2, 17, 3, false, "等级方案", "161", "schemeId", true, "schemeBrowser");
|
||||||
|
|
||||||
|
// 编辑状态下赋值操作
|
||||||
|
String id = Util.null2String(params.get("id"));
|
||||||
|
if (!StringUtil.isEmpty(id)) {
|
||||||
|
GradePO gradePO = getGradeMapper().getGradeByID(Integer.parseInt(id));
|
||||||
|
OrganizationAssert.notNull(gradePO, "选择的数据不存在,或数据已删除");
|
||||||
|
|
||||||
|
gradeNameCondition.setValue(gradePO.getGradeName());
|
||||||
|
gradeNoCondition.setValue(gradePO.getGradeNo());
|
||||||
|
descriptionCondition.setValue(gradePO.getDescription());
|
||||||
|
browserItem.setValue(gradePO.getSchemeId());
|
||||||
|
// 编辑状态下,编号只读
|
||||||
|
gradeNoCondition.setViewAttr(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
selectItems.add(gradeNoCondition);
|
||||||
|
selectItems.add(gradeNameCondition);
|
||||||
|
selectItems.add(descriptionCondition);
|
||||||
|
selectItems.add(browserItem);
|
||||||
|
addGroups.add(new SearchConditionGroup("基本信息", true, selectItems));
|
||||||
|
apiDatas.put("condition", addGroups);
|
||||||
|
return apiDatas;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getTableBtn() {
|
||||||
|
return MenuBtn.getCommonBtnDatas();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getTabInfo() {
|
||||||
|
Map<String, Object> apiDatas = new HashMap<>();
|
||||||
|
List<TopTab> topTabs = new ArrayList<>();
|
||||||
|
topTabs.add(TopTab.builder().color("#000000").groupId("flowAll").showCount(true).title("全部").viewCondition("-1").build());
|
||||||
|
topTabs.add(TopTab.builder().color("#ff3232").groupId("enable").showCount(true).title("启用").viewCondition("0").build());
|
||||||
|
topTabs.add(TopTab.builder().color("#fea468").groupId("disable").showCount(true).title("禁用").viewCondition("1").build());
|
||||||
|
apiDatas.put("topTabs", topTabs);
|
||||||
|
|
||||||
|
HashMap<String, Integer> countMap = new HashMap<>();
|
||||||
|
countMap.put("flowAll", getGradeMapper().getCountByTag(-1));
|
||||||
|
countMap.put("enable", getGradeMapper().getCountByTag(0));
|
||||||
|
countMap.put("disable", getGradeMapper().getCountByTag(1));
|
||||||
|
|
||||||
|
apiDatas.put("topTabCount", countMap);
|
||||||
|
return apiDatas;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询条件
|
||||||
|
*
|
||||||
|
* @param params
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private String buildSqlWhere(Map<String, Object> params) {
|
||||||
|
DBType dbType = DBType.get(new RecordSet().getDBType());
|
||||||
|
String sqlWhere = " where t.delete_type ='0' ";
|
||||||
|
String gradeName = (String) params.get("gradeName");
|
||||||
|
if (StringUtils.isNotBlank(gradeName)) {
|
||||||
|
sqlWhere += " AND t.grade_name " + dbType.like(gradeName);
|
||||||
|
}
|
||||||
|
String schemeId = (String) params.get("schemeId");
|
||||||
|
if (StringUtils.isNotBlank(schemeId)) {
|
||||||
|
sqlWhere += " AND t.scheme_id " + dbType.like(schemeId);
|
||||||
|
}
|
||||||
|
String viewCondition = (String) params.get("viewcondition");
|
||||||
|
// -1:全部、0:启用、1:禁用
|
||||||
|
if (StringUtils.isNotBlank(viewCondition) && !"-1".equalsIgnoreCase(viewCondition)) {
|
||||||
|
sqlWhere += " AND t.forbidden_tag = '" + schemeId + "'";
|
||||||
|
}
|
||||||
|
return sqlWhere;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,111 @@
|
|||||||
|
package com.engine.organization.wrapper;
|
||||||
|
|
||||||
|
import com.engine.common.util.ServiceUtil;
|
||||||
|
import com.engine.core.impl.Service;
|
||||||
|
import com.engine.organization.entity.scheme.param.LevelSearchParam;
|
||||||
|
import com.engine.organization.service.LevelService;
|
||||||
|
import com.engine.organization.service.impl.LevelServiceImpl;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: TODO
|
||||||
|
* @author:dxfeng
|
||||||
|
* @createTime: 2022/05/10
|
||||||
|
* @version: 1.0
|
||||||
|
*/
|
||||||
|
public class GradeWrapper extends Service {
|
||||||
|
private LevelService getLevelService(User user) {
|
||||||
|
return ServiceUtil.getService(LevelServiceImpl.class, user);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 职等列表
|
||||||
|
*
|
||||||
|
* @param params
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Map<String, Object> listPage(Map<String, Object> params) {
|
||||||
|
return getLevelService(user).listPage(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增职等
|
||||||
|
*
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int saveLevel(LevelSearchParam param) {
|
||||||
|
return getLevelService(user).saveLevel(param);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新职等
|
||||||
|
*
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int updateLevel(LevelSearchParam param) {
|
||||||
|
return getLevelService(user).updateLevel(param);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新禁用标记
|
||||||
|
*
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
public int updateForbiddenTagById(LevelSearchParam params) {
|
||||||
|
return getLevelService(user).updateForbiddenTagById(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
*/
|
||||||
|
public int deleteByIds(@Param("ids") Collection<Long> ids) {
|
||||||
|
return getLevelService(user).deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取搜索条件
|
||||||
|
*
|
||||||
|
* @param params
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
|
||||||
|
return getLevelService(user).getSearchCondition(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取新增表单
|
||||||
|
*
|
||||||
|
* @param params
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Map<String, Object> getLevelForm(Map<String, Object> params) {
|
||||||
|
return getLevelService(user).getLevelForm(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取列表页面按钮信息
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Map<String, Object> getTableBtn() {
|
||||||
|
return getLevelService(user).getTableBtn();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取列表tabs
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Map<String, Object> getTabInfo() {
|
||||||
|
return getLevelService(user).getTabInfo();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue