岗位序列模块
parent
23944db568
commit
902f845543
@ -0,0 +1,15 @@
|
||||
package com.api.organization.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
*
|
||||
* @description: TODO
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/05/12
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Path("/bs/hrmorganization/sequence")
|
||||
public class SequenceController extends com.engine.organization.web.SequenceController {
|
||||
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package com.engine.organization.entity.sequence.dto;
|
||||
|
||||
import com.engine.organization.entity.sequence.param.SequenceSearchParam;
|
||||
import com.engine.organization.entity.sequence.po.SequencePO;
|
||||
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 SequenceDTO {
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
private long id;
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String sequenceNo;
|
||||
/**
|
||||
* 方案名称
|
||||
*/
|
||||
private String sequenceName;
|
||||
/**
|
||||
* 方案说明
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 等级方案
|
||||
*/
|
||||
private Long schemeId;
|
||||
/**
|
||||
* 禁用标记
|
||||
*/
|
||||
private int forbiddenTag;
|
||||
|
||||
private Long creator;
|
||||
|
||||
private int deleteType;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
public static SequencePO convertParamToPO(SequenceSearchParam param, Long employeeId) {
|
||||
if (param == null) {
|
||||
return null;
|
||||
}
|
||||
return SequencePO.builder()
|
||||
.id(param.getId() == null ? 0 : param.getId())
|
||||
.sequenceNo(param.getSequenceNo() == null ? null : param.getSequenceNo())
|
||||
.sequenceName(param.getSequenceName() == null ? null : param.getSequenceName())
|
||||
.description(param.getDescription() == null ? null : param.getDescription())
|
||||
.schemeId(param.getSchemeId() == null ? 0 : param.getSchemeId())
|
||||
.forbiddenTag(param.getForbiddenTag() == null ? 0 : param.getForbiddenTag() ? 0 : 1)
|
||||
.deleteType(0)
|
||||
.createTime(new Date())
|
||||
.updateTime(new Date())
|
||||
.creator(employeeId)
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.engine.organization.entity.sequence.param;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author dxfeng
|
||||
* @Description: TODO
|
||||
* @Date 2022/5/12
|
||||
* @Version V1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SequenceSearchParam {
|
||||
|
||||
private Long id;
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String sequenceNo;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String sequenceName;
|
||||
|
||||
/**
|
||||
* 方案说明
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 等级方案
|
||||
*/
|
||||
private Long schemeId;
|
||||
|
||||
/**
|
||||
* 禁用标记
|
||||
*/
|
||||
private Boolean forbiddenTag;
|
||||
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package com.engine.organization.entity.sequence.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @description: TODO
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/05/12
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SequencePO {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String sequenceNo;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String sequenceName;
|
||||
/**
|
||||
* 描述说明
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 等级方案
|
||||
*/
|
||||
private Long schemeId;
|
||||
/**
|
||||
* 禁用标记
|
||||
*/
|
||||
private Integer forbiddenTag;
|
||||
private Long creator;
|
||||
private int deleteType;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package com.engine.organization.entity.sequence.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/12
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@OrganizationTable(pageId = "3a0b752e-d028-11ec-91fc-00ffcbed7508",
|
||||
fields = "t.id," +
|
||||
"t.sequence_no," +
|
||||
"t.sequence_name," +
|
||||
"t.description," +
|
||||
"s.scheme_name," +
|
||||
"t.forbidden_tag," +
|
||||
"t.creator," +
|
||||
"t.delete_type," +
|
||||
"t.create_time," +
|
||||
"t.update_time",
|
||||
fromSql = "FROM jcl_org_sequence t inner join jcl_org_scheme s on t.scheme_id = s.id ",
|
||||
orderby = "id desc",
|
||||
primarykey = "id",
|
||||
operates = {
|
||||
@OrganizationTableOperate(index = "0", text = "编辑"),
|
||||
@OrganizationTableOperate(index = "1", text = "删除")
|
||||
}
|
||||
)
|
||||
public class SequenceTableVO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@OrganizationTableColumn(column = "id", display = false)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@OrganizationTableColumn(text = "编号", width = "20%", column = "sequence_no")
|
||||
private String sequenceNo;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@OrganizationTableColumn(text = "名称", width = "20%", column = "sequence_name")
|
||||
private String sequenceName;
|
||||
|
||||
/**
|
||||
* 描述说明
|
||||
*/
|
||||
@OrganizationTableColumn(text = "描述说明", width = "20%", column = "description")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 等级方案
|
||||
*/
|
||||
@OrganizationTableColumn(text = "等级方案", width = "20%", column = "scheme_name")
|
||||
private String schemeName;
|
||||
|
||||
/**
|
||||
* 禁用标记
|
||||
*/
|
||||
@OrganizationTableColumn(text = "禁用标记", width = "20%", column = "forbidden_tag")
|
||||
private Integer forbiddenTag;
|
||||
}
|
@ -0,0 +1,153 @@
|
||||
<?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.sequence.SequenceMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.organization.entity.sequence.po.SequencePO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="sequence_no" property="sequenceNo"/>
|
||||
<result column="sequence_name" property="sequenceName"/>
|
||||
<result column="description" property="description"/>
|
||||
<result column="scheme_id" property="schemeId"/>
|
||||
<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.sequence_no
|
||||
, t.sequence_name
|
||||
, t.description
|
||||
, t.scheme_id
|
||||
, t.forbidden_tag
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
, t.create_time
|
||||
, t.update_time
|
||||
</sql>
|
||||
<select id="getSequenceByID" parameterType="com.engine.organization.entity.sequence.po.SequencePO"
|
||||
resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_org_sequence t where id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<select id="listByNo" parameterType="com.engine.organization.entity.sequence.po.SequencePO" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_org_sequence t where sequence_no = #{sequenceNo} AND delete_type = 0
|
||||
</select>
|
||||
<select id="getCountByTag" resultType="java.lang.Integer">
|
||||
select count(1) from jcl_org_sequence where 1=1 AND delete_type = 0
|
||||
<if test=" tag != -1 " >
|
||||
and forbidden_tag = #{tag}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="listSequencesByIds" resultType="java.util.Map">
|
||||
select
|
||||
id,
|
||||
sequence_name as name
|
||||
from jcl_org_sequence t
|
||||
WHERE delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<update id="updateSequence" parameterType="com.engine.organization.entity.sequence.po.SequencePO">
|
||||
update jcl_org_sequence
|
||||
<set>
|
||||
creator=#{creator},
|
||||
update_time=#{updateTime},
|
||||
sequence_no=#{sequenceNo},
|
||||
sequence_name=#{sequenceName},
|
||||
description=#{description},
|
||||
scheme_id=#{schemeId},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.sequence.po.SequencePO" keyProperty="id"
|
||||
keyColumn="id" useGeneratedKeys="true">
|
||||
INSERT INTO jcl_org_sequence
|
||||
<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="sequenceNo != null ">
|
||||
sequence_no,
|
||||
</if>
|
||||
<if test="sequenceName != null ">
|
||||
sequence_name,
|
||||
</if>
|
||||
<if test="description != null ">
|
||||
description,
|
||||
</if>
|
||||
<if test="schemeId != null ">
|
||||
scheme_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="sequenceNo != null ">
|
||||
#{sequenceNo},
|
||||
</if>
|
||||
<if test="sequenceName != null ">
|
||||
#{sequenceName},
|
||||
</if>
|
||||
<if test="description != null ">
|
||||
#{description},
|
||||
</if>
|
||||
<if test="schemeId != null ">
|
||||
#{schemeId},
|
||||
</if>
|
||||
0,
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateForbiddenTagById" parameterType="com.engine.organization.entity.sequence.po.SequencePO">
|
||||
update jcl_org_sequence
|
||||
<set>
|
||||
forbidden_tag=#{forbiddenTag},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
<update id="deleteByIds">
|
||||
UPDATE jcl_org_sequence
|
||||
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.sequence.param.SequenceSearchParam;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @description: TODO
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/05/12
|
||||
* @version: 1.0
|
||||
*/
|
||||
public interface SequenceService {
|
||||
/**
|
||||
* 岗位列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> listPage(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 新增岗位
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
int saveSequence(SequenceSearchParam param);
|
||||
|
||||
/**
|
||||
* 更新岗位信息
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
int updateSequence(SequenceSearchParam param);
|
||||
|
||||
/**
|
||||
* 更新禁用标记
|
||||
*
|
||||
* @param params
|
||||
*/
|
||||
int updateForbiddenTagById(SequenceSearchParam 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> getSequenceForm(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 获取列表页面按钮信息
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> getHasRight();
|
||||
|
||||
/**
|
||||
* 获取列表tabs
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> getTabInfo();
|
||||
|
||||
}
|
@ -0,0 +1,189 @@
|
||||
package com.engine.organization.service.impl;
|
||||
|
||||
import com.api.browser.bean.BrowserBean;
|
||||
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.QueryParam;
|
||||
import com.engine.organization.entity.TopTab;
|
||||
import com.engine.organization.entity.sequence.dto.SequenceDTO;
|
||||
import com.engine.organization.entity.sequence.param.SequenceSearchParam;
|
||||
import com.engine.organization.entity.sequence.po.SequencePO;
|
||||
import com.engine.organization.entity.sequence.vo.SequenceTableVO;
|
||||
import com.engine.organization.mapper.sequence.SequenceMapper;
|
||||
import com.engine.organization.mapper.scheme.SchemeMapper;
|
||||
import com.engine.organization.service.SequenceService;
|
||||
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/12
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class SequenceServiceImpl extends Service implements SequenceService {
|
||||
|
||||
private SequenceMapper getSequenceMapper() {
|
||||
return MapperProxyFactory.getProxy(SequenceMapper.class);
|
||||
}
|
||||
|
||||
private SchemeMapper getSchemeMapper() {
|
||||
return MapperProxyFactory.getProxy(SchemeMapper.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> listPage(Map<String, Object> params) {
|
||||
OrganizationWeaTable<SequenceTableVO> table = new OrganizationWeaTable<>(user, SequenceTableVO.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 saveSequence(SequenceSearchParam param) {
|
||||
List<SequencePO> list = getSequenceMapper().listByNo(Util.null2String(param.getSequenceNo()));
|
||||
OrganizationAssert.isEmpty(list, "编号不允许重复");
|
||||
SequencePO sequencePO = SequenceDTO.convertParamToPO(param, (long) user.getUID());
|
||||
return getSequenceMapper().insertIgnoreNull(sequencePO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateSequence(SequenceSearchParam param) {
|
||||
SequencePO sequencePO = SequenceDTO.convertParamToPO(param, (long) user.getUID());
|
||||
return getSequenceMapper().updateSequence(sequencePO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateForbiddenTagById(SequenceSearchParam params) {
|
||||
SequencePO sequencePO = SequencePO.builder().id(params.getId()).forbiddenTag(params.getForbiddenTag() ? 0 : 1).build();
|
||||
return getSequenceMapper().updateForbiddenTagById(sequencePO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByIds(Collection<Long> ids) {
|
||||
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
|
||||
return getSequenceMapper().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, 2, false, "等级方案", "161", "schemeId", "schemeBrowser");
|
||||
SearchConditionItem sequenceNameCondition = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "名称", "sequenceName");
|
||||
conditionItems.add(browserItem);
|
||||
conditionItems.add(sequenceNameCondition);
|
||||
addGroups.add(new SearchConditionGroup("高级搜索条件", true, conditionItems));
|
||||
apiDatas.put("conditions", addGroups);
|
||||
return apiDatas;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getSequenceForm(Map<String, Object> params) {
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionItem> selectItems = new ArrayList<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
SearchConditionItem sequenceNameCondition = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, "名称", "sequenceName");
|
||||
sequenceNameCondition.setRules("required|string");
|
||||
SearchConditionItem sequenceNoCondition = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, "编号", "sequenceNo");
|
||||
sequenceNoCondition.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", "schemeBrowser");
|
||||
|
||||
// 编辑状态下赋值操作
|
||||
String id = Util.null2String(params.get("id"));
|
||||
if (!StringUtil.isEmpty(id)) {
|
||||
SequencePO sequencePO = getSequenceMapper().getSequenceByID(Integer.parseInt(id));
|
||||
OrganizationAssert.notNull(sequencePO, "选择的数据不存在,或数据已删除");
|
||||
|
||||
sequenceNameCondition.setValue(sequencePO.getSequenceName());
|
||||
sequenceNoCondition.setValue(sequencePO.getSequenceNo());
|
||||
descriptionCondition.setValue(sequencePO.getDescription());
|
||||
browserItem.setValue(sequencePO.getSchemeId());
|
||||
|
||||
BrowserBean browserBean = browserItem.getBrowserConditionParam();
|
||||
List<Map<String, Object>> maps = getSchemeMapper().listSchemesByIds(QueryParam.builder().ids(sequencePO.getSchemeId().toString()).build().getIds());
|
||||
|
||||
browserBean.setReplaceDatas(maps);
|
||||
browserItem.setBrowserConditionParam(browserBean);
|
||||
// 编辑状态下,编号只读
|
||||
sequenceNoCondition.setViewAttr(1);
|
||||
}
|
||||
|
||||
selectItems.add(sequenceNoCondition);
|
||||
selectItems.add(sequenceNameCondition);
|
||||
selectItems.add(descriptionCondition);
|
||||
selectItems.add(browserItem);
|
||||
addGroups.add(new SearchConditionGroup("基本信息", true, selectItems));
|
||||
apiDatas.put("condition", addGroups);
|
||||
return apiDatas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getHasRight() {
|
||||
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", getSequenceMapper().getCountByTag(-1));
|
||||
countMap.put("enable", getSequenceMapper().getCountByTag(0));
|
||||
countMap.put("disable", getSequenceMapper().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 sequenceName = (String) params.get("sequenceName");
|
||||
if (StringUtils.isNotBlank(sequenceName)) {
|
||||
sqlWhere += " AND t.sequence_name " + dbType.like(sequenceName);
|
||||
}
|
||||
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 = '" + viewCondition + "'";
|
||||
}
|
||||
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.sequence.param.SequenceSearchParam;
|
||||
import com.engine.organization.service.SequenceService;
|
||||
import com.engine.organization.service.impl.SequenceServiceImpl;
|
||||
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/12
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class SequenceWrapper extends Service {
|
||||
private SequenceService getSequenceService(User user) {
|
||||
return ServiceUtil.getService(SequenceServiceImpl.class, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 岗位列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> listPage(Map<String, Object> params) {
|
||||
return getSequenceService(user).listPage(params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增岗位
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
public int saveSequence(SequenceSearchParam param) {
|
||||
return getSequenceService(user).saveSequence(param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新岗位
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
public int updateSequence(SequenceSearchParam param) {
|
||||
return getSequenceService(user).updateSequence(param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新禁用标记
|
||||
*
|
||||
* @param params
|
||||
*/
|
||||
public int updateForbiddenTagById(SequenceSearchParam params) {
|
||||
return getSequenceService(user).updateForbiddenTagById(params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID批量删除
|
||||
*
|
||||
* @param ids
|
||||
*/
|
||||
public int deleteByIds(@Param("ids") Collection<Long> ids) {
|
||||
return getSequenceService(user).deleteByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取搜索条件
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
|
||||
return getSequenceService(user).getSearchCondition(params);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取新增表单
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> getSequenceForm(Map<String, Object> params) {
|
||||
return getSequenceService(user).getSequenceForm(params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取列表页面按钮信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> getHasRight() {
|
||||
return getSequenceService(user).getHasRight();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取列表tabs
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> getTabInfo() {
|
||||
return getSequenceService(user).getTabInfo();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue