企业注册和新增用户岗位处理

This commit is contained in:
mythxb 2023-07-28 16:33:49 +08:00
parent 82cb76554e
commit 13b01c53cf
7 changed files with 68 additions and 3 deletions

View File

@ -1,5 +1,7 @@
package com.rzyc.enums; package com.rzyc.enums;
import com.fasterxml.jackson.annotation.JsonFormat;
/** /**
* @author dong * @author dong
* @date 2023-07-19 15:32 * @date 2023-07-19 15:32
@ -13,6 +15,8 @@ public enum AuditStatusEnum {
private Integer state; private Integer state;
JsonFormat
AuditStatusEnum(Integer state) { AuditStatusEnum(Integer state) {
this.state = state; this.state = state;
} }

View File

@ -0,0 +1,27 @@
package com.rzyc.enums;
/**
* 岗位类型 1部门 2岗位
* @author dong
* @date 2023-07-20 9:25
* @Version V1.0
*/
public enum PositionTypeEnum {
UNIT(1),
POST(2);
private Integer type;
PositionTypeEnum(Integer type) {
this.type = type;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
}

View File

@ -64,6 +64,9 @@ public interface ListPerformMapper extends BaseMapper<SysEnterprise> {
/*部门岗位*/ /*部门岗位*/
List<ListPerform> unitPost(@Param("listPerformId") String listPerformId); List<ListPerform> unitPost(@Param("listPerformId") String listPerformId);
/*下级岗位数量*/
Integer countPost(@Param("listPerformId") String listPerformId);
/*用户履职信息*/ /*用户履职信息*/
UserDepart userPerform(@Param("listPerformId") String listPerformId); UserDepart userPerform(@Param("listPerformId") String listPerformId);
@ -135,4 +138,8 @@ public interface ListPerformMapper extends BaseMapper<SysEnterprise> {
/*上级岗位*/ /*上级岗位*/
List<ListPerform> topListperformList(@Param("listperformId") String listperformId); List<ListPerform> topListperformList(@Param("listperformId") String listperformId);
/*修改岗位类型*/
Integer changePositionType(@Param("listPerformId") String listPerformId,
@Param("positionType") Integer positionType);
} }

View File

@ -826,8 +826,9 @@
<select id="selectPCList" resultMap="BaseResultMap"> <select id="selectPCList" resultMap="BaseResultMap">
select sys.* select sys.*,bc.IndustryClassName
from SysEnterprise sys from SysEnterprise sys
left join baseinclass bc on sys.work_class_id = bc.BaseInClassId
where 1=1 where 1=1
<if test="2 == isAdmin"> <if test="2 == isAdmin">
AND sys.State='启用' AND sys.State='启用'

View File

@ -556,6 +556,12 @@
ORDER BY lp.`SortId` ASC ORDER BY lp.`SortId` ASC
</select> </select>
<!--部门岗位-->
<select id="countPost" resultType="java.lang.Integer">
SELECT count(*) FROM ListPerform lp
WHERE lp.`SupClassId` = #{listPerformId}
</select>
<!--用户履职信息--> <!--用户履职信息-->
<select id="userPerform" resultMap="UserDepartResultMap"> <select id="userPerform" resultMap="UserDepartResultMap">
@ -601,7 +607,8 @@
<!--岗位列表--> <!--岗位列表-->
<select id="findAll" resultMap="BaseResultMap"> <select id="findAll" resultMap="BaseResultMap">
SELECT lp.* FROM ListPerform lp SELECT lp.*
FROM ListPerform lp
where 1 = 1 where 1 = 1
<if test="null != superPerformId and '' != superPerformId"> <if test="null != superPerformId and '' != superPerformId">
and FIND_IN_SET(#{superPerformId},lp.parent_path) and FIND_IN_SET(#{superPerformId},lp.parent_path)
@ -893,4 +900,11 @@
WHERE FIND_IN_SET(#{listperformId},lf.`ViewJurisdiction`); WHERE FIND_IN_SET(#{listperformId},lf.`ViewJurisdiction`);
</select> </select>
<!--修改岗位类型-->
<update id="changePositionType">
update listperform
set position_type = #{positionType}
where ListPerformId = #{listPerformId}
</update>
</mapper> </mapper>

View File

@ -1,6 +1,6 @@
spring: spring:
profiles: profiles:
active: test #设定打包配置文件 active: yun #设定打包配置文件

View File

@ -1710,6 +1710,13 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
ListPerform perform = listPerformMapper.selectByPrimaryKey(listPerform.getListperformid()); ListPerform perform = listPerformMapper.selectByPrimaryKey(listPerform.getListperformid());
if(null != perform){ if(null != perform){
getPerformPath(listPerform.getSupclassid(),listPerform); getPerformPath(listPerform.getSupclassid(),listPerform);
Integer postNum = listPerformMapper.countPost(listPerform.getListperformid());
if(postNum > 0){
listPerform.setPositionType(PositionTypeEnum.UNIT.getType());
}
//修改 //修改
listPerformMapper.changeListPerform(listPerform); listPerformMapper.changeListPerform(listPerform);
}else{ }else{
@ -1721,9 +1728,14 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
performClassCode = GetSysOrganCode(perform);//生成 performClassCode = GetSysOrganCode(perform);//生成
} }
listPerform.setPerformclasscode(performClassCode); listPerform.setPerformclasscode(performClassCode);
listPerform.setPositionType(PositionTypeEnum.POST.getType());
getPerformPath(listPerform.getSupclassid(),listPerform); getPerformPath(listPerform.getSupclassid(),listPerform);
//新增 //新增
listPerformMapper.insert(listPerform); listPerformMapper.insert(listPerform);
//修改上级部门的部门类型
listPerformMapper.changePositionType(listPerform.getSupclassid(),PositionTypeEnum.UNIT.getType());
} }
return result; return result;