职等职级接口 表结构SQL更新

pull/5/MERGE
dxfeng 3 years ago
parent 97ac4e5cdf
commit 7bd87d4707

@ -17,7 +17,7 @@ CREATE TABLE JCL_ORG_LEVEL (
level_no varchar(100) NULL, level_no varchar(100) NULL,
level_name varchar(100) NULL, level_name varchar(100) NULL,
description text NULL, description text NULL,
level_scheme int null, scheme_id int null,
forbidden_tag int NULL, forbidden_tag int NULL,
creator int null, creator int null,
delete_type int null, delete_type int null,
@ -31,7 +31,7 @@ CREATE TABLE JCL_ORG_GRADE (
grade_no varchar(100) NULL, grade_no varchar(100) NULL,
grade_name varchar(100) NULL, grade_name varchar(100) NULL,
description text NULL, description text NULL,
level_scheme int null, scheme_id int null,
level_id int null, level_id int null,
forbidden_tag int NULL, forbidden_tag int NULL,
creator int null, creator int null,
@ -47,7 +47,7 @@ CREATE TABLE JCL_ORG_SEQUENCE (
sequence_no varchar(100) NULL, sequence_no varchar(100) NULL,
sequence_name varchar(100) NULL, sequence_name varchar(100) NULL,
description text NULL, description text NULL,
level_scheme int null, scheme_id int null,
forbidden_tag int NULL, forbidden_tag int NULL,
creator int null, creator int null,
delete_type int null, delete_type int null,
@ -248,7 +248,7 @@ CREATE TABLE JCL_ORG_JOB (
parent_comp int null, parent_comp int null,
parent_dept int null, parent_dept int null,
job_sequence int null, job_sequence int null,
level_scheme int null, scheme_id int null,
parent_job int null, parent_job int null,
is_key_job int null, is_key_job int null,
workplace varchar(100) NULL, workplace varchar(100) NULL,

@ -17,7 +17,7 @@ CREATE TABLE JCL_ORG_LEVEL (
LEVEL_NO NVARCHAR2(100) NULL, LEVEL_NO NVARCHAR2(100) NULL,
LEVEL_NAME NVARCHAR2(100) NULL, LEVEL_NAME NVARCHAR2(100) NULL,
DESCRIPTION NVARCHAR2(1000) NULL, DESCRIPTION NVARCHAR2(1000) NULL,
LEVEL_SCHEME NUMBER NULL, SCHEME_ID NUMBER NULL,
FORBIDDEN_TAG NUMBER NULL, FORBIDDEN_TAG NUMBER NULL,
CREATOR NUMBER NULL, CREATOR NUMBER NULL,
DELETE_TYPE NUMBER NULL, DELETE_TYPE NUMBER NULL,
@ -32,7 +32,7 @@ CREATE TABLE JCL_ORG_GRADE (
GRADE_NO NVARCHAR2(100) NULL, GRADE_NO NVARCHAR2(100) NULL,
GRADE_NAME NVARCHAR2(100) NULL, GRADE_NAME NVARCHAR2(100) NULL,
DESCRIPTION NVARCHAR2(1000) NULL, DESCRIPTION NVARCHAR2(1000) NULL,
LEVEL_SCHEME NUMBER NULL, SCHEME_ID NUMBER NULL,
LEVEL_ID NUMBER NULL, LEVEL_ID NUMBER NULL,
FORBIDDEN_TAG NUMBER NULL, FORBIDDEN_TAG NUMBER NULL,
CREATOR NUMBER NULL, CREATOR NUMBER NULL,
@ -49,7 +49,7 @@ CREATE TABLE JCL_ORG_SEQUENCE (
SEQUENCE_NO NVARCHAR2(100) NULL, SEQUENCE_NO NVARCHAR2(100) NULL,
SEQUENCE_NAME NVARCHAR2(100) NULL, SEQUENCE_NAME NVARCHAR2(100) NULL,
DESCRIPTION NVARCHAR2(1000) NULL, DESCRIPTION NVARCHAR2(1000) NULL,
LEVEL_SCHEME NUMBER NULL, SCHEME_ID NUMBER NULL,
FORBIDDEN_TAG NUMBER NULL, FORBIDDEN_TAG NUMBER NULL,
CREATOR NUMBER NULL, CREATOR NUMBER NULL,
DELETE_TYPE NUMBER NULL, DELETE_TYPE NUMBER NULL,
@ -250,7 +250,7 @@ CREATE TABLE JCL_ORG_JOB (
PARENT_COMP NUMBER NULL, PARENT_COMP NUMBER NULL,
PARENT_DEPT NUMBER NULL, PARENT_DEPT NUMBER NULL,
JOB_SEQUENCE NUMBER NULL, JOB_SEQUENCE NUMBER NULL,
LEVEL_SCHEME NUMBER NULL, SCHEME_ID NUMBER NULL,
PARENT_JOB NUMBER NULL, PARENT_JOB NUMBER NULL,
IS_KEY_JOB NUMBER NULL, IS_KEY_JOB NUMBER NULL,
WORKPLACE NVARCHAR2(100) NULL, WORKPLACE NVARCHAR2(100) NULL,

@ -17,7 +17,7 @@ CREATE TABLE JCL_ORG_LEVEL (
level_no varchar(100) COLLATE Chinese_PRC_CI_AS NULL, level_no varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
level_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL, level_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
description text COLLATE Chinese_PRC_CI_AS NULL, description text COLLATE Chinese_PRC_CI_AS NULL,
level_scheme int null, scheme_id int null,
forbidden_tag int NULL, forbidden_tag int NULL,
creator int null, creator int null,
delete_type int null, delete_type int null,
@ -31,7 +31,7 @@ CREATE TABLE JCL_ORG_GRADE (
grade_no varchar(100) COLLATE Chinese_PRC_CI_AS NULL, grade_no varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
grade_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL, grade_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
description text COLLATE Chinese_PRC_CI_AS NULL, description text COLLATE Chinese_PRC_CI_AS NULL,
level_scheme int null, scheme_id int null,
level_id int null, level_id int null,
forbidden_tag int NULL, forbidden_tag int NULL,
creator int null, creator int null,
@ -47,7 +47,7 @@ CREATE TABLE JCL_ORG_SEQUENCE (
sequence_no varchar(100) COLLATE Chinese_PRC_CI_AS NULL, sequence_no varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
sequence_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL, sequence_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
description text COLLATE Chinese_PRC_CI_AS NULL, description text COLLATE Chinese_PRC_CI_AS NULL,
level_scheme int null, scheme_id int null,
forbidden_tag int NULL, forbidden_tag int NULL,
creator int null, creator int null,
delete_type int null, delete_type int null,
@ -248,7 +248,7 @@ CREATE TABLE JCL_ORG_JOB (
parent_comp int null, parent_comp int null,
parent_dept int null, parent_dept int null,
job_sequence int null, job_sequence int null,
level_scheme int null, scheme_id int null,
parent_job int null, parent_job int null,
is_key_job int null, is_key_job int null,
workplace varchar(100) COLLATE Chinese_PRC_CI_AS NULL, workplace varchar(100) COLLATE Chinese_PRC_CI_AS NULL,

@ -0,0 +1,15 @@
package com.api.organization.web;
import javax.ws.rs.Path;
/**
*
* @description: TODO
* @author:dxfeng
* @createTime: 2022/05/10
* @version: 1.0
*/
@Path("/bs/hrmorganization/level")
public class LevelController extends com.engine.organization.web.LevelController {
}

@ -0,0 +1,82 @@
package com.engine.organization.entity.scheme.dto;
import com.engine.organization.entity.scheme.param.LevelSearchParam;
import com.engine.organization.entity.scheme.po.LevelPO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @Author dxfeng
* @Description: TODO
* @Date 2022/5/9
* @Version V1.0
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class LevelDTO {
/**
*
*/
private long id;
/**
*
*/
private String levelNo;
/**
*
*/
private String levelName;
/**
*
*/
private String description;
/**
*
*/
private Long schemeId;
/**
*
*/
private int forbiddenTag;
/**
*
*/
private Long creator;
/**
*
*/
private int deleteType;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
public static LevelPO convertParamToPO(LevelSearchParam param, Long employeeId) {
if (param == null) {
return null;
}
return LevelPO.builder()
.id(param.getId() == null ? 0 : param.getId())
.levelNo(param.getLevelNo() == null ? null : param.getLevelNo())
.levelName(param.getLevelName() == null ? null : param.getLevelName())
.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();
}
}

@ -65,7 +65,7 @@ public class SchemeDTO {
.id(param.get("id") == null ? 0 : Integer.parseInt((String) param.get("id"))) .id(param.get("id") == null ? 0 : Integer.parseInt((String) param.get("id")))
.schemeNo(param.get("scheme_no") == null ? null : (String) param.get("scheme_no")) .schemeNo(param.get("scheme_no") == null ? null : (String) param.get("scheme_no"))
.schemeName(param.get("scheme_name") == null ? null : (String) param.get("scheme_name")) .schemeName(param.get("scheme_name") == null ? null : (String) param.get("scheme_name"))
.schemeDescription(param.get("scheme_description") == null ? null : (String) param.get("descrscheme_descriptioniption")) .schemeDescription(param.get("scheme_description") == null ? null : (String) param.get("scheme_description"))
.forbiddenTag(param.get("forbidden_tag") == null ? 0 : Integer.parseInt((String) param.get("forbidden_tag"))) .forbiddenTag(param.get("forbidden_tag") == null ? 0 : Integer.parseInt((String) param.get("forbidden_tag")))
.deleteType(0) .deleteType(0)
.createTime(new Date()) .createTime(new Date())

@ -0,0 +1,46 @@
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/9
* @Version V1.0
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class LevelSearchParam {
private Long id;
/**
*
*/
private String levelNo;
/**
*
*/
private String levelName;
/**
*
*/
private String description;
/**
*
*/
private Long schemeId;
/**
*
*/
private Boolean forbiddenTag;
}

@ -39,7 +39,7 @@ public class LevelPO {
/** /**
* *
*/ */
private Long levelScheme; private Long schemeId;
/** /**
* *
*/ */

@ -19,13 +19,13 @@ import lombok.NoArgsConstructor;
"t.level_name," + "t.level_name," +
"t.description," + "t.description," +
"s.scheme_name," + "s.scheme_name," +
"t.level_scheme," + "t.scheme_id," +
"t.forbidden_tag," + "t.forbidden_tag," +
"t.creator," + "t.creator," +
"t.delete_type," + "t.delete_type," +
"t.create_time," + "t.create_time," +
"t.update_time", "t.update_time",
fromSql = "FROM jcl_org_level t inner join jcl_org_scheme s on t.level_scheme = s.id ", fromSql = "FROM jcl_org_level t inner join jcl_org_scheme s on t.scheme_id = s.id ",
orderby = "id desc", orderby = "id desc",
primarykey = "id", primarykey = "id",
operates = { operates = {
@ -60,7 +60,7 @@ public class LevelTableVO {
* *
*/ */
// @OrganizationTableColumn(text = "等级方案", width = "20%", column = "level_scheme") // @OrganizationTableColumn(text = "等级方案", width = "20%", column = "level_scheme")
private String levelScheme; private String schemeId;
/** /**
* *

@ -0,0 +1,62 @@
package com.engine.organization.mapper.scheme;
import com.engine.organization.entity.scheme.po.LevelPO;
import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List;
/**
* @Author dxfeng
* @Description: TODO
* @Date 2022/5/9
* @Version V1.0
**/
public interface LevelMapper {
/**
* No
*
* @param levelNo
* @return
*/
List<LevelPO> listByNo(@Param("levelNo") String levelNo);
/**
* ID
* @param id
* @return
*/
LevelPO getLevelByID(@Param("id") long id);
/**
*
* @param levelPO
* @return
*/
int insertIgnoreNull(LevelPO levelPO);
/**
*
*
* @param levelPO
* @return
*/
int updateLevel(LevelPO levelPO);
/**
*
*
* @param levelPO
* @return
*/
int updateForbiddenTagById(LevelPO levelPO);
/**
*
*
* @param ids
*/
int deleteByIds(@Param("ids") Collection<Long> ids);
}

@ -0,0 +1,135 @@
<?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.LevelMapper">
<resultMap id="BaseResultMap" type="com.engine.organization.entity.scheme.po.LevelPO">
<result column="id" property="id"/>
<result column="level_no" property="levelNo"/>
<result column="level_name" property="levelName"/>
<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.level_no
, t.level_name
, t.description
, t.scheme_id
, t.forbidden_tag
, t.creator
, t.delete_type
, t.create_time
, t.update_time
</sql>
<select id="getLevelByID" parameterType="com.engine.organization.entity.scheme.po.LevelPO"
resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_level t where id = #{id} AND delete_type = 0
</select>
<select id="listByNo" parameterType="com.engine.organization.entity.scheme.po.LevelPO" resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_level t where level_no = #{levelNo} AND delete_type = 0
</select>
<update id="updateLevel" parameterType="com.engine.organization.entity.scheme.po.LevelPO">
update jcl_org_level
<set>
creator=#{creator},
update_time=#{updateTime},
level_no=#{levelNo},
level_name=#{levelName},
description=#{description},
scheme_id=#{schemeId},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.scheme.po.LevelPO" keyProperty="id"
keyColumn="id" useGeneratedKeys="true">
INSERT INTO jcl_org_level
<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="levelNo != null ">
level_no,
</if>
<if test="levelName != null ">
level_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="levelNo != null ">
#{levelNo},
</if>
<if test="levelName != null ">
#{levelName},
</if>
<if test="description != null ">
#{description},
</if>
<if test="schemeId != null ">
#{schemeId},
</if>
0,
</trim>
</insert>
<update id="updateForbiddenTagById" parameterType="com.engine.organization.entity.scheme.po.LevelPO">
update jcl_org_level
<set>
forbidden_tag=#{forbiddenTag},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<update id="deleteByIds">
UPDATE jcl_org_level
SET delete_type = 1
WHERE delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

@ -1,5 +1,8 @@
package com.engine.organization.service; package com.engine.organization.service;
import com.engine.organization.entity.scheme.param.LevelSearchParam;
import java.util.Collection;
import java.util.Map; import java.util.Map;
/** /**
@ -10,10 +13,63 @@ import java.util.Map;
*/ */
public interface LevelService { public interface LevelService {
/** /**
* *
* *
* @param params * @param params
* @return * @return
*/ */
Map<String, Object> listPage(Map<String, Object> params); Map<String, Object> listPage(Map<String, Object> params);
/**
*
* @param param
* @return
*/
int saveLevel(LevelSearchParam param);
/**
*
*
* @param param
* @return
*/
int updateLevel(LevelSearchParam param);
/**
*
*
* @param params
*/
int updateForbiddenTagById(LevelSearchParam 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> getLevelForm(Map<String, Object> params);
/**
*
* @return
*/
Map<String, Object> getTableBtn();
} }

@ -1,21 +1,31 @@
package com.engine.organization.service.impl; 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.cloudstore.eccom.result.WeaResultMsg;
import com.engine.core.impl.Service; import com.engine.core.impl.Service;
import com.engine.organization.component.OrganizationWeaTable; import com.engine.organization.component.OrganizationWeaTable;
import com.engine.organization.entity.scheme.dto.LevelDTO;
import com.engine.organization.entity.scheme.param.LevelSearchParam;
import com.engine.organization.entity.scheme.po.LevelPO;
import com.engine.organization.entity.scheme.vo.LevelTableVO; import com.engine.organization.entity.scheme.vo.LevelTableVO;
import com.engine.organization.entity.scheme.vo.SchemeTableVO; import com.engine.organization.mapper.scheme.LevelMapper;
import com.engine.organization.service.LevelService; import com.engine.organization.service.LevelService;
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.DBType;
import com.engine.organization.util.db.MapperProxyFactory;
import com.weaverboot.frame.ioc.anno.classAnno.WeaIocService; import com.weaverboot.frame.ioc.anno.classAnno.WeaIocService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet; import weaver.conn.RecordSet;
import weaver.general.StringUtil;
import weaver.general.Util;
import java.util.Map; import java.util.*;
/** /**
*
* @description: TODO * @description: TODO
* @author:dxfeng * @author:dxfeng
* @createTime: 2022/05/10 * @createTime: 2022/05/10
@ -23,9 +33,14 @@ import java.util.Map;
*/ */
@WeaIocService @WeaIocService
public class LevelServiceImpl extends Service implements LevelService { public class LevelServiceImpl extends Service implements LevelService {
private LevelMapper getLevelMapper() {
return MapperProxyFactory.getProxy(LevelMapper.class);
}
@Override @Override
public Map<String, Object> listPage(Map<String, Object> params) { public Map<String, Object> listPage(Map<String, Object> params) {
OrganizationWeaTable<SchemeTableVO> table = new OrganizationWeaTable<>(user, LevelTableVO.class); OrganizationWeaTable<LevelTableVO> table = new OrganizationWeaTable<>(user, LevelTableVO.class);
String sqlWhere = buildSqlWhere(params); String sqlWhere = buildSqlWhere(params);
table.setSqlwhere(sqlWhere); table.setSqlwhere(sqlWhere);
WeaResultMsg result = new WeaResultMsg(false); WeaResultMsg result = new WeaResultMsg(false);
@ -34,6 +49,92 @@ public class LevelServiceImpl extends Service implements LevelService {
return result.getResultMap(); return result.getResultMap();
} }
@Override
public int saveLevel(LevelSearchParam param) {
List<LevelPO> list = getLevelMapper().listByNo(Util.null2String(param.getLevelNo()));
OrganizationAssert.isEmpty(list, "编号不允许重复");
LevelPO levelPO = LevelDTO.convertParamToPO(param, (long) user.getUID());
System.out.println(levelPO);
return getLevelMapper().insertIgnoreNull(levelPO);
}
@Override
public int updateLevel(LevelSearchParam param) {
LevelPO levelPO = LevelDTO.convertParamToPO(param, (long) user.getUID());
return getLevelMapper().updateLevel(levelPO);
}
@Override
public int updateForbiddenTagById(LevelSearchParam params) {
LevelPO levelPO = LevelPO.builder().id(params.getId()).forbiddenTag(params.getForbiddenTag() ? 0 : 1).build();
return getLevelMapper().updateForbiddenTagById(levelPO);
}
@Override
public int deleteByIds(Collection<Long> ids) {
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
return getLevelMapper().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 levelNameCondition = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "名称", "levelName");
SearchConditionItem levelNoCondition = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "编号", "levelNo");
conditionItems.add(levelNameCondition);
conditionItems.add(levelNoCondition);
addGroups.add(new SearchConditionGroup("高级搜索条件", true, conditionItems));
apiDatas.put("conditions", addGroups);
return apiDatas;
}
@Override
public Map<String, Object> getLevelForm(Map<String, Object> params) {
Map<String, Object> apiDatas = new HashMap<>();
List<SearchConditionItem> selectItems = new ArrayList<>();
List<SearchConditionGroup> addGroups = new ArrayList<>();
SearchConditionItem levelNameCondition = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, "名称", "levelName");
levelNameCondition.setRules("required|string");
SearchConditionItem levelNoCondition = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, "编号", "levelNo");
levelNoCondition.setRules("required|string");
SearchConditionItem descriptionCondition = OrganizationFormItemUtil.textareaItem(user, 2, 16, true, 2, 60, "描述说明", "description");
// TODO 浏览按钮
SearchConditionItem browserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, true, "等级方案", "17", "levelScheme");
// 编辑状态下赋值操作
String id = Util.null2String(params.get("id"));
if (!StringUtil.isEmpty(id)) {
LevelPO levelPO = getLevelMapper().getLevelByID(Integer.parseInt(id));
OrganizationAssert.notNull(levelPO, "选择的数据不存在,或数据已删除");
levelNameCondition.setValue(levelPO.getLevelName());
levelNoCondition.setValue(levelPO.getLevelNo());
descriptionCondition.setValue(levelPO.getDescription());
// TODO 浏览按钮赋值
// 编辑状态下,编号只读
levelNoCondition.setViewAttr(1);
}
selectItems.add(levelNoCondition);
selectItems.add(levelNameCondition);
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();
}
/** /**
* *
* *

@ -34,6 +34,10 @@ import java.util.*;
public class SchemeServiceImpl extends Service implements SchemeService { public class SchemeServiceImpl extends Service implements SchemeService {
private SchemeMapper getSchemeMapper() {
return MapperProxyFactory.getProxy(SchemeMapper.class);
}
@Override @Override
public Map<String, Object> listPage(Map<String, Object> params) { public Map<String, Object> listPage(Map<String, Object> params) {
OrganizationWeaTable<SchemeTableVO> table = new OrganizationWeaTable<>(user, SchemeTableVO.class); OrganizationWeaTable<SchemeTableVO> table = new OrganizationWeaTable<>(user, SchemeTableVO.class);
@ -50,38 +54,32 @@ public class SchemeServiceImpl extends Service implements SchemeService {
@Override @Override
public Map<String, Object> save(SchemeSearchParam param) { public Map<String, Object> save(SchemeSearchParam param) {
Map<String, Object> apidatas = new HashMap<String, Object>(16); Map<String, Object> apidatas = new HashMap<String, Object>(16);
SchemeMapper mapper = MapperProxyFactory.getProxy(SchemeMapper.class); List<SchemePO> list = getSchemeMapper().listByNo(Util.null2String(param.getSchemeNo()));
List<SchemePO> list = mapper.listByNo(Util.null2String(param.getSchemeNo()));
OrganizationAssert.isEmpty(list, "编号不允许重复"); OrganizationAssert.isEmpty(list, "编号不允许重复");
SchemePO schemePO = SchemeDTO.convertParamToPO(param, (long) user.getUID()); SchemePO schemePO = SchemeDTO.convertParamToPO(param, (long) user.getUID());
mapper.insertIgnoreNull(schemePO); getSchemeMapper().insertIgnoreNull(schemePO);
return apidatas; return apidatas;
} }
@Override @Override
public Map<String, Object> updateScheme(SchemeSearchParam param) { public Map<String, Object> updateScheme(SchemeSearchParam param) {
Map<String, Object> apidatas = new HashMap<String, Object>(); Map<String, Object> apidatas = new HashMap<String, Object>();
SchemeMapper mapper = MapperProxyFactory.getProxy(SchemeMapper.class);
SchemePO schemePO = SchemeDTO.convertParamToPO(param, (long) user.getUID()); SchemePO schemePO = SchemeDTO.convertParamToPO(param, (long) user.getUID());
mapper.updateScheme(schemePO); getSchemeMapper().updateScheme(schemePO);
return apidatas; return apidatas;
} }
@Override @Override
public void updateForbiddenTagById(SchemeSearchParam params) { public void updateForbiddenTagById(SchemeSearchParam params) {
SchemeMapper mapper = MapperProxyFactory.getProxy(SchemeMapper.class);
SchemePO schemePO = SchemePO.builder().id(params.getId()).forbiddenTag(params.getForbiddenTag() ? 0 : 1).build(); SchemePO schemePO = SchemePO.builder().id(params.getId()).forbiddenTag(params.getForbiddenTag() ? 0 : 1).build();
mapper.updateForbiddenTagById(schemePO); getSchemeMapper().updateForbiddenTagById(schemePO);
} }
@Override @Override
public void deleteByIds(Collection<Long> ids) { public void deleteByIds(Collection<Long> ids) {
OrganizationAssert.notEmpty(ids, "请选择要删除的数据"); OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
SchemeMapper mapper = MapperProxyFactory.getProxy(SchemeMapper.class); getSchemeMapper().deleteByIds(ids);
List<SchemePO> schemePOS = mapper.listSchemesByIds(ids);
OrganizationAssert.notEmpty(schemePOS, "选择的数据不存在,或数据已删除");
mapper.deleteByIds(ids);
} }
@ -114,8 +112,7 @@ public class SchemeServiceImpl extends Service implements SchemeService {
// 编辑状态下赋值操作 // 编辑状态下赋值操作
String id = Util.null2String(params.get("id")); String id = Util.null2String(params.get("id"));
if (!StringUtil.isEmpty(id)) { if (!StringUtil.isEmpty(id)) {
SchemeMapper mapper = MapperProxyFactory.getProxy(SchemeMapper.class); SchemePO schemePO = getSchemeMapper().getSchemeByID(Integer.parseInt(id));
SchemePO schemePO = mapper.getSchemeByID(Integer.parseInt(id));
OrganizationAssert.notNull(schemePO, "选择的数据不存在,或数据已删除"); OrganizationAssert.notNull(schemePO, "选择的数据不存在,或数据已删除");
schemeNameCondition.setValue(schemePO.getSchemeName()); schemeNameCondition.setValue(schemePO.getSchemeName());
schemeNoCondition.setValue(schemePO.getSchemeNo()); schemeNoCondition.setValue(schemePO.getSchemeNo());
@ -135,22 +132,7 @@ public class SchemeServiceImpl extends Service implements SchemeService {
@Override @Override
public Map<String, Object> getTableBtn() { public Map<String, Object> getTableBtn() {
Map<String, Object> btnDatas = new HashMap<>(); return MenuBtn.getCommonBtnDatas();
ArrayList<MenuBtn> topMenuList = new ArrayList<>();
ArrayList<MenuBtn> rightMenuList = new ArrayList<>();
// 新建
topMenuList.add(MenuBtn.topMenu_addNew());
// 批量删除
topMenuList.add(MenuBtn.topMenu_batchDelete());
btnDatas.put("topMenu", topMenuList);
// 新建
rightMenuList.add(MenuBtn.rightMenu_addNew());
// 日志
rightMenuList.add(MenuBtn.rightMenu_btnLog());
// 显示列定制
rightMenuList.add(MenuBtn.rightMenu_btnColumn());
btnDatas.put("rightMenu",rightMenuList);
return btnDatas;
} }
/** /**

@ -5,8 +5,11 @@ import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
/** /**
*
* @description: MenuBtn * @description: MenuBtn
* @author:dxfeng * @author:dxfeng
* @createTime: 2022/05/09 * @createTime: 2022/05/09
@ -26,44 +29,71 @@ public class MenuBtn {
/** /**
* topMenu * topMenu
*
* @return * @return
*/ */
public static MenuBtn topMenu_addNew(){ public static MenuBtn topMenu_addNew() {
return MenuBtn.builder().isBatch("1").isTop("1").menuFun("new").menuIcon("icon-coms-New-Flow").menuName("新建").type( "BTN_Addnew").build(); return MenuBtn.builder().isBatch("1").isTop("1").menuFun("new").menuIcon("icon-coms-New-Flow").menuName("新建").type("BTN_Addnew").build();
} }
/** /**
* topMenu * topMenu
*
* @return * @return
*/ */
public static MenuBtn topMenu_batchDelete(){ public static MenuBtn topMenu_batchDelete() {
return MenuBtn.builder().isBatch("1").isTop("1").menuFun("new").menuIcon("icon-coms-New-Flow").menuName("新建").type( "BTN_Addnew").build(); return MenuBtn.builder().isBatch("1").isTop("1").menuFun("batchDelete").menuIcon("icon-coms-Batch-delete").menuName("批量删除").type( "BTN_BatchDelete").build();
} }
/** /**
* rightMenu * rightMenu
*
* @return * @return
*/ */
public static MenuBtn rightMenu_addNew(){ public static MenuBtn rightMenu_addNew() {
return MenuBtn.builder().isBatch("0").isTop("1").menuFun("new").menuIcon("icon-coms-New-Flow").menuName("新建").type( "BTN_Addnew").build(); return MenuBtn.builder().isBatch("0").isTop("1").menuFun("new").menuIcon("icon-coms-New-Flow").menuName("新建").type("BTN_Addnew").build();
} }
/** /**
* rightMenu * rightMenu
*
* @return * @return
*/ */
public static MenuBtn rightMenu_btnLog(){ public static MenuBtn rightMenu_btnLog() {
return MenuBtn.builder().isBatch("0").isTop("0").menuFun("log").menuIcon("icon-coms-Print-log").menuName("日志").type( "BTN_log").build(); return MenuBtn.builder().isBatch("0").isTop("0").menuFun("log").menuIcon("icon-coms-Print-log").menuName("日志").type("BTN_log").build();
} }
/** /**
* rightMenu * rightMenu
*
* @return * @return
*/ */
public static MenuBtn rightMenu_btnColumn(){ public static MenuBtn rightMenu_btnColumn() {
return MenuBtn.builder().isBatch("0").isTop("0").menuFun("custom").menuIcon("icon-coms-task-list").menuName("显示列定制").type( "BTN_COLUMN").build(); return MenuBtn.builder().isBatch("0").isTop("0").menuFun("custom").menuIcon("icon-coms-task-list").menuName("显示列定制").type("BTN_COLUMN").build();
} }
/**
*
* @return
*/
public static Map<String, Object> getCommonBtnDatas() {
Map<String, Object> btnDatas = new HashMap<>();
ArrayList<MenuBtn> topMenuList = new ArrayList<>();
ArrayList<MenuBtn> rightMenuList = new ArrayList<>();
// 新建
topMenuList.add(MenuBtn.topMenu_addNew());
// 批量删除
topMenuList.add(MenuBtn.topMenu_batchDelete());
btnDatas.put("topMenu", topMenuList);
// 新建
rightMenuList.add(MenuBtn.rightMenu_addNew());
// 日志
rightMenuList.add(MenuBtn.rightMenu_btnLog());
// 显示列定制
rightMenuList.add(MenuBtn.rightMenu_btnColumn());
btnDatas.put("rightMenu", rightMenuList);
return btnDatas;
}
} }

@ -2,14 +2,18 @@ package com.engine.organization.web;
import com.engine.common.util.ParamUtil; import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil; import com.engine.common.util.ServiceUtil;
import com.engine.organization.entity.QueryParam;
import com.engine.organization.entity.scheme.param.LevelSearchParam;
import com.engine.organization.util.response.ReturnResult; import com.engine.organization.util.response.ReturnResult;
import com.engine.organization.wrapper.LevelWrapper; import com.engine.organization.wrapper.LevelWrapper;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import weaver.hrm.HrmUserVarify; import weaver.hrm.HrmUserVarify;
import weaver.hrm.User; import weaver.hrm.User;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.GET; import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path; import javax.ws.rs.Path;
import javax.ws.rs.Produces; import javax.ws.rs.Produces;
import javax.ws.rs.core.Context; import javax.ws.rs.core.Context;
@ -17,7 +21,6 @@ import javax.ws.rs.core.MediaType;
import java.util.Map; import java.util.Map;
/** /**
*
* @description: TODO * @description: TODO
* @author:dxfeng * @author:dxfeng
* @createTime: 2022/05/10 * @createTime: 2022/05/10
@ -38,7 +41,7 @@ public class LevelController {
@GET @GET
@Path("/getLevelTable") @Path("/getLevelTable")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
public ReturnResult listScheme(@Context HttpServletRequest request, @Context HttpServletResponse response) { public ReturnResult listLevel(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try { try {
User user = HrmUserVarify.getUser(request, response); User user = HrmUserVarify.getUser(request, response);
Map<String, Object> map = ParamUtil.request2Map(request); Map<String, Object> map = ParamUtil.request2Map(request);
@ -47,4 +50,144 @@ public class LevelController {
return ReturnResult.exceptionHandle(e.getMessage()); return ReturnResult.exceptionHandle(e.getMessage());
} }
} }
/**
*
*
* @param request
* @param response
* @return
*/
@POST
@Path("/saveLevel")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult saveLevel(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody LevelSearchParam param) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getLevelWrapper(user).saveLevel(param));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/**
*
*
* @param request
* @param response
* @param param
* @return
*/
@POST
@Path("/updateLevel")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult updateLevel(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody LevelSearchParam param) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getLevelWrapper(user).updateLevel(param));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/**
*
*
* @param request
* @param response
* @param param
* @return
*/
@POST
@Path("/updateForbiddenTagById")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult updateForbiddenTagById(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody LevelSearchParam param) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getLevelWrapper(user).updateForbiddenTagById(param));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/**
* ID
*
* @param request
* @param response
* @param param
* @return
*/
@POST
@Path("/deleteByIds")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult deleteByIds(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody QueryParam param) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getLevelWrapper(user).deleteByIds(param.getIds()));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/**
*
*
* @param request
* @param response
* @return
*/
@GET
@Path("/getSearchCondition")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult getSearchCondition(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User user = HrmUserVarify.getUser(request, response);
Map<String, Object> map = ParamUtil.request2Map(request);
return ReturnResult.successed(getLevelWrapper(user).getSearchCondition(map));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/**
*
*
* @param request
* @param response
* @return
*/
@GET
@Path("/getLevelForm")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult getLevelForm(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User user = HrmUserVarify.getUser(request, response);
Map<String, Object> map = ParamUtil.request2Map(request);
return ReturnResult.successed(getLevelWrapper(user).getLevelForm(map));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/**
*
*
* @param request
* @param response
* @return
*/
@GET
@Path("/getTableBtn")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult getTableBtn(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getLevelWrapper(user).getTableBtn());
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
} }

@ -2,14 +2,16 @@ package com.engine.organization.wrapper;
import com.engine.common.util.ServiceUtil; import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service; 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.LevelService;
import com.engine.organization.service.impl.LevelServiceImpl; import com.engine.organization.service.impl.LevelServiceImpl;
import org.apache.ibatis.annotations.Param;
import weaver.hrm.User; import weaver.hrm.User;
import java.util.Collection;
import java.util.Map; import java.util.Map;
/** /**
*
* @description: TODO * @description: TODO
* @author:dxfeng * @author:dxfeng
* @createTime: 2022/05/10 * @createTime: 2022/05/10
@ -21,7 +23,7 @@ public class LevelWrapper extends Service {
} }
/** /**
* *
* *
* @param params * @param params
* @return * @return
@ -29,4 +31,72 @@ public class LevelWrapper extends Service {
public Map<String, Object> listPage(Map<String, Object> params) { public Map<String, Object> listPage(Map<String, Object> params) {
return getLevelService(user).listPage(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();
}
} }

Loading…
Cancel
Save