职务信息接口

pull/7/MERGE
dxfeng 3 years ago
parent 8e4d698217
commit f576df3495

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

@ -0,0 +1,34 @@
package com.engine.organization.entity.post.dto;
import com.engine.organization.entity.post.param.PostInfoSearchParam;
import com.engine.organization.entity.post.po.PostInfoPO;
import java.util.Date;
/**
* @description: TODO
* @author:dxfeng
* @createTime: 2022/05/13
* @version: 1.0
*/
public class PostInfoDTO {
public static PostInfoPO convertParamToPO(PostInfoSearchParam param, Long employeeId) {
if (param == null) {
return null;
}
return PostInfoPO.builder()
.id(param.getId() == null ? 0 : param.getId())
.postInfoNo(param.getPostInfoNo() == null ? null : param.getPostInfoNo())
.postInfoName(param.getPostInfoName() == null ? null : param.getPostInfoName())
.postInfoAuthority(param.getPostInfoAuthority() == null ? null : param.getPostInfoAuthority())
.postInfoDuty(param.getPostInfoDuty() == null ? null : param.getPostInfoDuty())
.postInfoQualification(param.getPostInfoQualification() == null ? null : param.getPostInfoQualification())
.postId(param.getPostId() == null ? null : param.getPostId())
.description(param.getDescription() == null ? null : param.getDescription())
.deleteType(0)
.createTime(new Date())
.updateTime(new Date())
.creator(employeeId)
.build();
}
}

@ -0,0 +1,51 @@
package com.engine.organization.entity.post.param;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @description: TODO
* @author:dxfeng
* @createTime: 2022/05/13
* @version: 1.0
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PostInfoSearchParam {
/**
*
*/
private Long id;
/**
*
*/
private String postInfoNo;
/**
*
*/
private String postInfoName;
/**
*
*/
private String postInfoAuthority;
/**
*
*/
private String postInfoDuty;
/**
*
*/
private String postInfoQualification;
/**
*
*/
private Integer postId;
/**
*
*/
private String description;
}

@ -0,0 +1,59 @@
package com.engine.organization.entity.post.po;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @description: TODO
* @author:dxfeng
* @createTime: 2022/05/13
* @version: 1.0
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class PostInfoPO {
/**
*
*/
private Long id;
/**
*
*/
private String postInfoNo;
/**
*
*/
private String postInfoName;
/**
*
*/
private String postInfoAuthority;
/**
*
*/
private String postInfoDuty;
/**
*
*/
private String postInfoQualification;
/**
*
*/
private Integer postId;
/**
*
*/
private String description;
private Long creator;
private int deleteType;
private Date createTime;
private Date updateTime;
}

@ -0,0 +1,79 @@
package com.engine.organization.entity.post.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/13
* @version: 1.0
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@OrganizationTable(pageId = "fa30e916-d285-11ec-bc87-00ffcbed7508",
fields = " t.id," +
" t.post_info_no," +
" t.post_info_name," +
" t.post_info_authority," +
" t.post_info_duty," +
" t.post_info_qualification," +
" a.post_name," +
" t.description",
fromSql = " from jcl_org_post_info t inner join jcl_org_post a on t.post_id = a.id ",
orderby = "id desc",
primarykey = "id",
operates = {
@OrganizationTableOperate(index = "0", text = "编辑"),
@OrganizationTableOperate(index = "1", text = "删除")
}
)
public class PostInfoTableVO {
/**
*
*/
@OrganizationTableColumn(column = "id", display = false)
private Long id;
/**
*
*/
@OrganizationTableColumn(text = "编号", width = "20%", column = "post_info_no")
private String postInfoNo;
/**
*
*/
@OrganizationTableColumn(text = "名称", width = "20%", column = "post_info_name")
private String postInfoName;
/**
*
*/
@OrganizationTableColumn(text = "权限", width = "20%", column = "post_info_authority")
private String postInfoAuthority;
/**
*
*/
@OrganizationTableColumn(text = "责任", width = "20%", column = "post_info_duty")
private String postInfoDuty;
/**
*
*/
@OrganizationTableColumn(text = "资格", width = "20%", column = "post_info_qualification")
private String postInfoQualification;
/**
*
*/
@OrganizationTableColumn(text = "职务分类", width = "20%", column = "post_name")
private Integer postName;
/**
*
*/
@OrganizationTableColumn(text = "说明", width = "20%", column = "description")
private String description;
}

@ -0,0 +1,67 @@
package com.engine.organization.mapper.post;
import com.engine.organization.entity.post.po.PostInfoPO;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
* @Author dxfeng
* @Description: TODO
* @Date 2022/5/13
* @Version V1.0
**/
public interface PostInfoMapper {
/**
* No
*
* @param postInfoNo
* @return
*/
List<PostInfoPO> listByNo(@Param("postInfoNo") String postInfoNo);
/**
* ID
* @param id
* @return
*/
PostInfoPO getPostInfoByID(@Param("id") long id);
/**
* ID
*
* @param ids
* @return
*/
@MapKey("id")
List<Map<String,Object>> listPostInfosByIds(@Param("ids") Collection<Long> ids);
/**
*
* @param postInfoPO
* @return
*/
int insertIgnoreNull(PostInfoPO postInfoPO);
/**
*
*
* @param postInfoPO
* @return
*/
int updatePostInfo(PostInfoPO postInfoPO);
/**
*
*
* @param ids
*/
int deleteByIds(@Param("ids") Collection<Long> ids);
}

@ -0,0 +1,165 @@
<?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.post.PostInfoMapper">
<resultMap id="BaseResultMap" type="com.engine.organization.entity.post.po.PostInfoPO">
<result column="id" property="id"/>
<result column="post_info_no" property="postInfoNo"/>
<result column="post_info_name" property="postInfoName"/>
<result column="post_info_authority" property="postInfoAuthority"/>
<result column="post_info_duty" property="postInfoDuty"/>
<result column="post_info_qualification" property="postInfoQualification"/>
<result column="post_id" property="postId"/>
<result column="description" property="description"/>
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<!-- 表字段 -->
<sql id="baseColumns">
t
.
id
, t.post_info_no
, t.post_info_name
, t.post_info_authority
, t.post_info_duty
, t.post_info_qualification
, t.post_id
, t.description
, t.creator
, t.delete_type
, t.create_time
, t.update_time
</sql>
<select id="getPostInfoByID" parameterType="com.engine.organization.entity.post.po.PostInfoPO"
resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_post_info t where id = #{id} AND delete_type = 0
</select>
<select id="listByNo" parameterType="com.engine.organization.entity.post.po.PostInfoPO"
resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_post_info t where post_info_no = #{postInfoNo} AND delete_type = 0
</select>
<select id="listPostInfosByIds" resultType="java.util.Map">
select
id,
post_info_name as name
from jcl_org_post_info t
WHERE delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</select>
<update id="updatePostInfo" parameterType="com.engine.organization.entity.post.po.PostInfoPO">
update jcl_org_post_info
<set>
creator=#{creator},
update_time=#{updateTime},
post_info_no=#{postInfoNo},
post_info_name=#{postInfoName},
post_info_authority=#{postInfoAuthority},
post_info_duty=#{postInfoDuty},
post_info_qualification=#{postInfoQualification},
post_id=#{postId},
description=#{description},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.post.po.PostInfoPO" keyProperty="id"
keyColumn="id" useGeneratedKeys="true">
INSERT INTO jcl_org_post_info
<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="postInfoNo != null">
post_info_no,
</if>
<if test="postInfoName != null">
post_info_name,
</if>
<if test="postInfoAuthority != null">
post_info_authority,
</if>
<if test="postInfoDuty != null">
post_info_duty,
</if>
<if test="postInfoQualification != null">
post_info_qualification,
</if>
<if test="postId != null">
post_id,
</if>
<if test="description != null">
description,
</if>
</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="postInfoNo != null">
#{postInfoNo},
</if>
<if test="postInfoName != null">
#{postInfoName},
</if>
<if test="postInfoAuthority != null">
#{postInfoAuthority},
</if>
<if test="postInfoDuty != null">
#{postInfoDuty},
</if>
<if test="postInfoQualification != null">
#{postInfoQualification},
</if>
<if test="postId != null">
#{postId},
</if>
<if test="description != null">
#{description},
</if>
</trim>
</insert>
<update id="deleteByIds">
UPDATE jcl_org_post_info
SET delete_type = 1
WHERE delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

@ -7,7 +7,7 @@
<result column="post_name" property="postName"/>
<result column="description" property="description"/>
<result column="creator" property="creator"/>
<result column="creator" property="deleteType"/>
<result column="delete_type" property="deleteType"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>

@ -10,7 +10,7 @@
<result column="level_id" property="levelId"/>
<result column="forbidden_tag" property="forbiddenTag"/>
<result column="creator" property="creator"/>
<result column="creator" property="deleteType"/>
<result column="delete_type" property="deleteType"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>

@ -9,7 +9,7 @@
<result column="scheme_id" property="schemeId"/>
<result column="forbidden_tag" property="forbiddenTag"/>
<result column="creator" property="creator"/>
<result column="creator" property="deleteType"/>
<result column="delete_type" property="deleteType"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>

@ -9,7 +9,7 @@
<result column="scheme_id" property="schemeId"/>
<result column="forbidden_tag" property="forbiddenTag"/>
<result column="creator" property="creator"/>
<result column="creator" property="deleteType"/>
<result column="delete_type" property="deleteType"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>

@ -0,0 +1,70 @@
package com.engine.organization.service;
import com.engine.organization.entity.post.param.PostInfoSearchParam;
import java.util.Collection;
import java.util.Map;
/**
* @description: TODO
* @author:dxfeng
* @createTime: 2022/05/13
* @version: 1.0
*/
public interface PostInfoService {
/**
*
*
* @param params
* @return
*/
Map<String, Object> listPage(Map<String, Object> params);
/**
*
* @param param
* @return
*/
int savePostInfo(PostInfoSearchParam param);
/**
*
*
* @param param
* @return
*/
int updatePostInfo(PostInfoSearchParam param);
/**
* 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> getPostInfoForm(Map<String, Object> params);
/**
*
* @return
*/
Map<String, Object> getHasRight();
}

@ -190,7 +190,7 @@ public class GradeServiceImpl extends Service implements GradeService {
}
String schemeId = (String) params.get("schemeId");
if (StringUtils.isNotBlank(schemeId)) {
sqlWhere += " AND t.scheme_id " + dbType.like(schemeId);
sqlWhere += " AND t.scheme_id = '" + schemeId + "'";
}
String viewCondition = (String) params.get("viewCondition");
// -1:全部、0:启用、1:禁用

@ -177,7 +177,7 @@ public class LevelServiceImpl extends Service implements LevelService {
}
String schemeId = (String) params.get("schemeId");
if (StringUtils.isNotBlank(schemeId)) {
sqlWhere += " AND t.scheme_id " + dbType.like(schemeId);
sqlWhere += " AND t.scheme_id = '" + schemeId + "'";
}
String viewCondition = (String) params.get("viewCondition");
// -1:全部、0:启用、1:禁用

@ -0,0 +1,176 @@
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.post.dto.PostInfoDTO;
import com.engine.organization.entity.post.param.PostInfoSearchParam;
import com.engine.organization.entity.post.po.PostInfoPO;
import com.engine.organization.entity.post.vo.PostInfoTableVO;
import com.engine.organization.mapper.post.PostInfoMapper;
import com.engine.organization.mapper.post.PostMapper;
import com.engine.organization.service.PostInfoService;
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/13
* @version: 1.0
*/
public class PostInfoServiceImpl extends Service implements PostInfoService {
private PostInfoMapper getPostInfoMapper() {
return MapperProxyFactory.getProxy(PostInfoMapper.class);
}
private PostMapper getPostMapper() {
return MapperProxyFactory.getProxy(PostMapper.class);
}
@Override
public Map<String, Object> listPage(Map<String, Object> params) {
OrganizationWeaTable<PostInfoTableVO> table = new OrganizationWeaTable<>(user, PostInfoTableVO.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 savePostInfo(PostInfoSearchParam param) {
List<PostInfoPO> list = getPostInfoMapper().listByNo(Util.null2String(param.getPostInfoNo()));
OrganizationAssert.isEmpty(list, "编号不允许重复");
PostInfoPO postInfoPO = PostInfoDTO.convertParamToPO(param, (long) user.getUID());
return getPostInfoMapper().insertIgnoreNull(postInfoPO);
}
@Override
public int updatePostInfo(PostInfoSearchParam param) {
PostInfoPO postInfoPO = PostInfoDTO.convertParamToPO(param, (long) user.getUID());
return getPostInfoMapper().updatePostInfo(postInfoPO);
}
@Override
public int deleteByIds(Collection<Long> ids) {
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
return getPostInfoMapper().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", "postId", "postBrowser");
SearchConditionItem nameCondition = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "名称", "postInfoName");
conditionItems.add(browserItem);
conditionItems.add(nameCondition);
addGroups.add(new SearchConditionGroup("高级搜索条件", true, conditionItems));
apiDatas.put("conditions", addGroups);
return apiDatas;
}
@Override
public Map<String, Object> getPostInfoForm(Map<String, Object> params) {
Map<String, Object> apiDatas = new HashMap<>();
List<SearchConditionItem> selectItems = new ArrayList<>();
List<SearchConditionGroup> addGroups = new ArrayList<>();
// 编号
SearchConditionItem noItem = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, "编号", "postInfoNo");
noItem.setRules("required|string");
// 名称
SearchConditionItem nameItem = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, "名称", "postInfoName");
nameItem.setRules("required|string");
// 权限
SearchConditionItem authorityItem = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, "权限", "postInfoAuthority");
// 责任
SearchConditionItem dutyItem = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, "责任", "postInfoDuty");
// 资格
SearchConditionItem qualificationItem = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, "资格", "postInfoQualification");
// 职务分类
SearchConditionItem postIdBrowser = OrganizationFormItemUtil.browserItem(user, 2, 17, 3, false, "职务分类", "161", "postId", "postBrowser");
// 说明
SearchConditionItem descriptionItem = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 60, "描述说明", "description");
// 编辑状态下赋值操作
String id = Util.null2String(params.get("id"));
if (!StringUtil.isEmpty(id)) {
PostInfoPO postInfoPO = getPostInfoMapper().getPostInfoByID(Integer.parseInt(id));
OrganizationAssert.notNull(postInfoPO, "选择的数据不存在,或数据已删除");
noItem.setValue(postInfoPO.getPostInfoNo());
nameItem.setValue(postInfoPO.getPostInfoName());
authorityItem.setValue(postInfoPO.getPostInfoAuthority());
dutyItem.setValue(postInfoPO.getPostInfoDuty());
qualificationItem.setValue(postInfoPO.getPostInfoQualification());
descriptionItem.setValue(postInfoPO.getDescription());
BrowserBean browserBean = postIdBrowser.getBrowserConditionParam();
List<Map<String, Object>> maps = getPostMapper().listPostsByIds(QueryParam.builder().ids(postInfoPO.getPostId().toString()).build().getIds());
browserBean.setReplaceDatas(maps);
postIdBrowser.setBrowserConditionParam(browserBean);
// 编辑状态下,编号只读
noItem.setViewAttr(1);
}
selectItems.add(noItem);
selectItems.add(nameItem);
selectItems.add(authorityItem);
selectItems.add(dutyItem);
selectItems.add(qualificationItem);
selectItems.add(postIdBrowser);
selectItems.add(descriptionItem);
addGroups.add(new SearchConditionGroup("基本信息", true, selectItems));
apiDatas.put("condition", addGroups);
return apiDatas;
}
@Override
public Map<String, Object> getHasRight() {
return MenuBtn.getCommonBtnDatas();
}
/**
*
*
* @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("postInfoName");
if (StringUtils.isNotBlank(sequenceName)) {
sqlWhere += " AND t.post_info_name " + dbType.like(sequenceName);
}
String postId = (String) params.get("postId");
if (StringUtils.isNotBlank(postId)) {
sqlWhere += " AND t.post_id ='" + postId + "'";
}
return sqlWhere;
}
}

@ -177,7 +177,7 @@ public class SequenceServiceImpl extends Service implements SequenceService {
}
String schemeId = (String) params.get("schemeId");
if (StringUtils.isNotBlank(schemeId)) {
sqlWhere += " AND t.scheme_id " + dbType.like(schemeId);
sqlWhere += " AND t.scheme_id = '" + schemeId + "'";
}
String viewCondition = (String) params.get("viewCondition");
// -1:全部、0:启用、1:禁用

@ -0,0 +1,174 @@
package com.engine.organization.web;
import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.organization.entity.QueryParam;
import com.engine.organization.entity.post.param.PostInfoSearchParam;
import com.engine.organization.util.response.ReturnResult;
import com.engine.organization.wrapper.PostInfoWrapper;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
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;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import java.util.Map;
/**
* @description: TODO
* @author:dxfeng
* @createTime: 2022/05/13
* @version: 1.0
*/
public class PostInfoController {
public PostInfoWrapper getPostInfoWrapper(User user) {
return ServiceUtil.getService(PostInfoWrapper.class, user);
}
/**
* list
*
* @param request
* @param response
* @return
*/
@GET
@Path("/getPostInfoTable")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult listPostInfo(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User user = HrmUserVarify.getUser(request, response);
Map<String, Object> map = ParamUtil.request2Map(request);
return ReturnResult.successed(getPostInfoWrapper(user).listPage(map));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/**
*
*
* @param request
* @param response
* @return
*/
@POST
@Path("/savePostInfo")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult savePostInfo(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody PostInfoSearchParam param) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getPostInfoWrapper(user).savePostInfo(param));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/**
*
*
* @param request
* @param response
* @param param
* @return
*/
@POST
@Path("/updatePostInfo")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult updatePostInfo(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody PostInfoSearchParam param) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getPostInfoWrapper(user).updatePostInfo(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(getPostInfoWrapper(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(getPostInfoWrapper(user).getSearchCondition(map));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/**
*
*
* @param request
* @param response
* @return
*/
@GET
@Path("/getPostInfoForm")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult getPostInfoForm(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User user = HrmUserVarify.getUser(request, response);
Map<String, Object> map = ParamUtil.request2Map(request);
return ReturnResult.successed(getPostInfoWrapper(user).getPostInfoForm(map));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/**
*
*
* @param request
* @param response
* @return
*/
@GET
@Path("/getHasRight")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult getHasRight(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getPostInfoWrapper(user).getHasRight());
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
}

@ -0,0 +1,94 @@
package com.engine.organization.wrapper;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.organization.entity.post.param.PostInfoSearchParam;
import com.engine.organization.service.PostInfoService;
import com.engine.organization.service.impl.PostInfoServiceImpl;
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/13
* @version: 1.0
*/
public class PostInfoWrapper extends Service {
private PostInfoService getPostInfoService(User user) {
return ServiceUtil.getService(PostInfoServiceImpl.class, user);
}
/**
*
*
* @param params
* @return
*/
public Map<String, Object> listPage(Map<String, Object> params) {
return getPostInfoService(user).listPage(params);
}
/**
*
*
* @param param
* @return
*/
public int savePostInfo(PostInfoSearchParam param) {
return getPostInfoService(user).savePostInfo(param);
}
/**
*
*
* @param param
* @return
*/
public int updatePostInfo(PostInfoSearchParam param) {
return getPostInfoService(user).updatePostInfo(param);
}
/**
* ID
*
* @param ids
*/
public int deleteByIds(@Param("ids") Collection<Long> ids) {
return getPostInfoService(user).deleteByIds(ids);
}
/**
*
*
* @param params
* @return
*/
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
return getPostInfoService(user).getSearchCondition(params);
}
/**
*
*
* @param params
* @return
*/
public Map<String, Object> getPostInfoForm(Map<String, Object> params) {
return getPostInfoService(user).getPostInfoForm(params);
}
/**
*
*
* @return
*/
public Map<String, Object> getHasRight() {
return getPostInfoService(user).getHasRight();
}
}
Loading…
Cancel
Save