包头增加岗位
This commit is contained in:
parent
439c643a4d
commit
adbf5267b8
@ -0,0 +1,139 @@
|
||||
package com.zhgd.xmgl.modules.baotou.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.zhgd.annotation.OperLog;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import java.util.HashMap;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.jeecg.common.util.oConvertUtils;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.OrgPost;
|
||||
import com.zhgd.xmgl.modules.baotou.service.IOrgPostService;
|
||||
|
||||
import org.simpleframework.xml.core.Validate;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* @Title: Controller
|
||||
* @Description: 组织体系岗位
|
||||
* @author: pds
|
||||
* @date: 2024-12-17
|
||||
* @version: V1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/xmgl/orgPost")
|
||||
@Slf4j
|
||||
@Api(tags = "组织体系岗位相关Api")
|
||||
public class OrgPostController {
|
||||
@Autowired
|
||||
private IOrgPostService orgPostService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "组织体系岗位管理", operType = "分页查询", operDesc = "分页列表查询组织体系岗位信息")
|
||||
@ApiOperation(value = "分页列表查询组织体系岗位信息", notes = "分页列表查询组织体系岗位信息", httpMethod="GET")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
|
||||
})
|
||||
@GetMapping(value = "/page")
|
||||
public Result<IPage<OrgPost>> queryPageList(@ApiIgnore @RequestParam HashMap<String, Object> param) {
|
||||
return Result.success(orgPostService.queryPageList(param));
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "组织体系岗位管理", operType = "列表查询", operDesc = "列表查询组织体系岗位信息")
|
||||
@ApiOperation(value = "列表查询组织体系岗位信息", notes = "列表查询组织体系岗位信息", httpMethod="GET")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<OrgPost>> queryList(@ApiIgnore @RequestParam HashMap<String, Object> param) {
|
||||
return Result.success(orgPostService.queryList(param));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @param orgPost
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "组织体系岗位管理", operType = "添加", operDesc = "添加组织体系岗位信息")
|
||||
@ApiOperation(value = "添加组织体系岗位信息", notes = "添加组织体系岗位信息" , httpMethod="POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<OrgPost> add(@RequestBody @Validate OrgPost orgPost) {
|
||||
orgPostService.add(orgPost);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param orgPost
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "组织体系岗位管理", operType = "编辑", operDesc = "编辑组织体系岗位信息")
|
||||
@ApiOperation(value = "编辑组织体系岗位信息", notes = "编辑组织体系岗位信息" , httpMethod="POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<OrgPost> edit(@RequestBody OrgPost orgPost) {
|
||||
orgPostService.edit(orgPost);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "组织体系岗位管理", operType = "删除", operDesc = "删除组织体系岗位信息")
|
||||
@ApiOperation(value = "删除组织体系岗位信息", notes = "删除组织体系岗位信息" , httpMethod="POST")
|
||||
@ApiImplicitParam(name = "id", value = "组织体系岗位ID", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<OrgPost> delete(@ApiIgnore @RequestBody HashMap<String ,Object> map) {
|
||||
orgPostService.delete(MapUtils.getString(map, "id"));
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "组织体系岗位管理", operType = "通过id查询", operDesc = "通过id查询组织体系岗位信息")
|
||||
@ApiOperation(value = "通过id查询组织体系岗位信息", notes = "通过id查询组织体系岗位信息" , httpMethod="GET")
|
||||
@ApiImplicitParam(name = "id", value = "组织体系岗位ID", paramType = "query", required = true, dataType = "Integer")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<OrgPost> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
return Result.success(orgPostService.queryById(id));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
package com.zhgd.xmgl.modules.baotou.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
/**
|
||||
* @Description: 组织体系岗位
|
||||
* @author: pds
|
||||
* @date: 2024-12-17
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("org_post")
|
||||
@ApiModel(value="OrgPost实体类",description="OrgPost")
|
||||
public class OrgPost implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value="id")
|
||||
private java.lang.Long id ;
|
||||
/**组织id*/
|
||||
@ApiModelProperty(value="组织id")
|
||||
private java.lang.Long orgId ;
|
||||
/**项目sn*/
|
||||
@ApiModelProperty(value="项目sn")
|
||||
private java.lang.String projectSn ;
|
||||
/**岗位名称*/
|
||||
@ApiModelProperty(value="岗位名称")
|
||||
private java.lang.String jobName ;
|
||||
/**岗位编码*/
|
||||
@ApiModelProperty(value="岗位编码")
|
||||
private java.lang.String jobCode ;
|
||||
/**职责*/
|
||||
@ApiModelProperty(value="职责")
|
||||
private java.lang.String responsibility ;
|
||||
/**排序*/
|
||||
@ApiModelProperty(value="排序")
|
||||
private java.lang.Integer sort ;
|
||||
/**创建时间 yyyy-MM-dd HH:mm:ss*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value="创建时间 yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date createTime ;
|
||||
/**更新时间 yyyy-MM-dd HH:mm:ss*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value="更新时间 yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date updateTime ;
|
||||
}
|
||||
@ -0,0 +1,50 @@
|
||||
package com.zhgd.xmgl.modules.baotou.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.HashMap;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.OrgPost;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 组织体系岗位
|
||||
* @author: pds
|
||||
* @date: 2024-12-17
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrgPostMapper extends BaseMapper<OrgPost> {
|
||||
|
||||
/**
|
||||
* 分页列表查询组织体系岗位信息
|
||||
*
|
||||
* @param page
|
||||
* @param queryWrapper
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
IPage<OrgPost> queryList(Page<OrgPost> page, @Param(Constants.WRAPPER) QueryWrapper<OrgPost> queryWrapper, @Param("param") HashMap<String, Object> param);
|
||||
|
||||
/**
|
||||
* 列表查询组织体系岗位信息
|
||||
*
|
||||
* @param queryWrapper
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<OrgPost> queryList(@Param(Constants.WRAPPER) QueryWrapper<OrgPost> queryWrapper, @Param("param") HashMap<String, Object> param);
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询组织体系岗位信息
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
OrgPost queryById(String id);
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
<?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.zhgd.xmgl.modules.baotou.mapper.OrgPostMapper">
|
||||
|
||||
<select id="queryList" resultType="com.zhgd.xmgl.modules.baotou.entity.OrgPost">
|
||||
select * from (
|
||||
select t.*
|
||||
from org_post t
|
||||
)t
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="queryById" resultType="com.zhgd.xmgl.modules.baotou.entity.OrgPost">
|
||||
select * from (
|
||||
select t.*
|
||||
from org_post t
|
||||
)t
|
||||
where t.id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,53 @@
|
||||
package com.zhgd.xmgl.modules.baotou.service;
|
||||
|
||||
import com.zhgd.xmgl.modules.baotou.entity.OrgPost;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 组织体系岗位
|
||||
* @author: pds
|
||||
* @date: 2024-12-17
|
||||
* @version: V1.0
|
||||
*/
|
||||
public interface IOrgPostService extends IService<OrgPost> {
|
||||
/**
|
||||
* 分页列表查询组织体系岗位信息
|
||||
* @param param 参数map
|
||||
* @return
|
||||
*/
|
||||
IPage<OrgPost> queryPageList(HashMap<String, Object> param);
|
||||
/**
|
||||
* 列表查询组织体系岗位信息
|
||||
* @param param 参数map
|
||||
* @return
|
||||
*/
|
||||
List<OrgPost> queryList(HashMap<String, Object> param);
|
||||
/**
|
||||
* 添加组织体系岗位信息
|
||||
* @param orgPost 组织体系岗位
|
||||
* @return
|
||||
*/
|
||||
void add(OrgPost orgPost);
|
||||
/**
|
||||
* 编辑组织体系岗位信息
|
||||
* @param orgPost 组织体系岗位
|
||||
* @return
|
||||
*/
|
||||
void edit(OrgPost orgPost);
|
||||
/**
|
||||
* 根据id删除组织体系岗位信息
|
||||
* @param id 组织体系岗位的id
|
||||
* @return
|
||||
*/
|
||||
void delete(String id);
|
||||
/**
|
||||
* 根据id查询组织体系岗位信息
|
||||
* @param id 组织体系岗位的id
|
||||
* @return
|
||||
*/
|
||||
OrgPost queryById(String id);
|
||||
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
package com.zhgd.xmgl.modules.baotou.service.impl;
|
||||
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.OrgPost;
|
||||
import com.zhgd.xmgl.modules.baotou.mapper.OrgPostMapper;
|
||||
import com.zhgd.xmgl.modules.baotou.service.IOrgPostService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.xmgl.util.PageUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import com.zhgd.xmgl.util.RefUtil;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* @Description: 组织体系岗位
|
||||
* @author: pds
|
||||
* @date: 2024-12-17
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class OrgPostServiceImpl extends ServiceImpl<OrgPostMapper, OrgPost> implements IOrgPostService {
|
||||
@Autowired
|
||||
private OrgPostMapper orgPostMapper;
|
||||
@Override
|
||||
public IPage<OrgPost> queryPageList(HashMap<String, Object> param) {
|
||||
QueryWrapper<OrgPost> queryWrapper = this.getQueryWrapper(param);
|
||||
Page<OrgPost> page = PageUtil.getPage(param);
|
||||
IPage<OrgPost> pageList = baseMapper.queryList(page, queryWrapper,param);
|
||||
pageList.setRecords(this.dealList(pageList.getRecords()));
|
||||
return pageList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrgPost> queryList(HashMap<String, Object> param) {
|
||||
QueryWrapper<OrgPost> queryWrapper = getQueryWrapper(param);
|
||||
return dealList(baseMapper.queryList(queryWrapper,param));
|
||||
}
|
||||
|
||||
private QueryWrapper<OrgPost> getQueryWrapper(HashMap<String, Object> param) {
|
||||
QueryWrapper<OrgPost> queryWrapper = QueryGenerator.initPageQueryWrapper(OrgPost.class, param, true);
|
||||
queryWrapper.orderByAsc(RefUtil.fieldNameUlc(OrgPost::getSort));
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
private List<OrgPost> dealList(List<OrgPost> list) {
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(OrgPost orgPost) {
|
||||
orgPost.setId(null);
|
||||
baseMapper.insert(orgPost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void edit(OrgPost orgPost) {
|
||||
OrgPost oldOrgPost = baseMapper.selectById(orgPost.getId());
|
||||
if(oldOrgPost==null) {
|
||||
throw new OpenAlertException("未找到对应实体");
|
||||
}
|
||||
baseMapper.updateById(orgPost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(String id) {
|
||||
OrgPost orgPost = baseMapper.selectById(id);
|
||||
if(orgPost==null) {
|
||||
throw new OpenAlertException("未找到对应实体");
|
||||
}
|
||||
baseMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrgPost queryById(String id) {
|
||||
OrgPost entity = baseMapper.queryById(id);
|
||||
if (entity == null) {
|
||||
throw new OpenAlertException("未找到对应实体");
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
}
|
||||
@ -143,6 +143,8 @@ public class SystemUser implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "邮箱")
|
||||
private java.lang.String personMail;
|
||||
@ApiModelProperty(value = "岗位id")
|
||||
private java.lang.Long postId;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "角色ID(多个,分割)")
|
||||
@ -220,4 +222,7 @@ public class SystemUser implements Serializable {
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value="人员类型 1、劳务人员,2、管理人员,3临时人员")
|
||||
private java.lang.Integer personType ;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value="组织岗位岗位")
|
||||
private java.lang.String postName;
|
||||
}
|
||||
|
||||
@ -176,8 +176,9 @@ public interface SystemUserMapper extends BaseMapper<SystemUser> {
|
||||
* @param deptId 部门ID
|
||||
* @return 用户列表 type为固定值user
|
||||
*/
|
||||
@Select("SELECT u.user_id id, w.worker_name `name`, 'user' AS 'type', u.avatar " +
|
||||
@Select("SELECT u.user_id id, w.worker_name `name`, 'user' AS 'type', u.avatar, op.job_name as org_post_name " +
|
||||
"FROM system_user u left join worker_info w on u.worker_id = w.id " +
|
||||
"left join org_post op on op.id=u.post_id " +
|
||||
"WHERE u.xz_project_org_id = #{deptId} AND u.account_type = 6")
|
||||
List<OrgTreeVo> selectUsersByDept(@Param("deptId") String deptId);
|
||||
|
||||
@ -211,9 +212,10 @@ public interface SystemUserMapper extends BaseMapper<SystemUser> {
|
||||
* @param projectSn
|
||||
* @return 搜索的用户列表 type为固定值user
|
||||
*/
|
||||
@Select("SELECT u.user_id id, w.worker_name `name`, 'user' AS 'type', u.avatar FROM system_user u " +
|
||||
@Select("SELECT u.user_id id, w.worker_name `name`, 'user' AS 'type', u.avatar, op.job_name as org_post_name FROM system_user u " +
|
||||
"left join worker_info w on u.worker_id = w.id " +
|
||||
" WHERE w.worker_name LIKE '%${py}%' AND w.project_sn = #{projectSn}")
|
||||
"left join org_post op on op.id=u.post_id " +
|
||||
" WHERE (w.worker_name LIKE '%${py}%' or op.job_name like '%${py}%') AND w.project_sn = #{projectSn}")
|
||||
List<OrgTreeVo> selectUsersByPy(@Param("py") String py, @Param("projectSn") String projectSn);
|
||||
|
||||
/**
|
||||
|
||||
@ -44,6 +44,7 @@
|
||||
,if(d.person_type=1,wt.id,di.id) as post_work_type
|
||||
,if(d.person_type=1,wt.type_name,di.department_name) as post_work_type_name
|
||||
,d.person_type
|
||||
,op.job_name as post_name
|
||||
from system_user t
|
||||
LEFT JOIN base_role_user b ON t.user_id = b.user_id
|
||||
LEFT JOIN base_role c ON c.role_id = b.role_id
|
||||
@ -56,6 +57,7 @@
|
||||
LEFT JOIN project_enterprise pe on pe.enterprise_id=ei.id and pe.project_sn=t.sn
|
||||
left join xz_project_org xpo on xpo.id=t.xz_project_org_id
|
||||
left join xz_registry xr on xr.account = t.account and xr.approval_process = 2
|
||||
left join org_post op on op.id=t.post_id
|
||||
<if test="param.qualityRegionId != null and param.qualityRegionId != '' and param.qualityRegionBindType == '1'.toString()">
|
||||
JOIN quality_region_to_user qrtu on ei.id = qrtu.enterprise_id and t.user_id=qrtu.user_id and
|
||||
qrtu.quality_region_id = #{param.qualityRegionId}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user