1.枚举类增加领导请假
2.增加查询角色方法 3.增加领导请假流程图 4.请假时如果角色是副所长、总支委员、工会主席、部门主任请假直接由所长审批
This commit is contained in:
parent
a572ed44f1
commit
fbd7e9b207
@ -1,10 +1,12 @@
|
|||||||
package com.xqopen.kehui.common.service;
|
package com.xqopen.kehui.common.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.plugins.Page;
|
import com.baomidou.mybatisplus.plugins.Page;
|
||||||
import com.xqopen.kehui.common.entity.SystemRole;
|
import com.xqopen.kehui.common.entity.SystemRole;
|
||||||
import com.baomidou.mybatisplus.service.IService;
|
import com.baomidou.mybatisplus.service.IService;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@ -23,4 +25,5 @@ public interface ISystemRoleService extends IService<SystemRole> {
|
|||||||
List<SystemRole> getSystemRoleByRoleTagAUserId(String roleTag, Long userId);
|
List<SystemRole> getSystemRoleByRoleTagAUserId(String roleTag, Long userId);
|
||||||
|
|
||||||
SystemRole getLeaderRoleByDeptId(Long orgId);
|
SystemRole getLeaderRoleByDeptId(Long orgId);
|
||||||
|
List<Map> getRoleListMap(@Param("userId") Long userId);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package com.xqopen.kehui.common.service.impl;
|
package com.xqopen.kehui.common.service.impl;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.plugins.Page;
|
import com.baomidou.mybatisplus.plugins.Page;
|
||||||
import com.xqopen.kehui.common.entity.SystemRole;
|
import com.xqopen.kehui.common.entity.SystemRole;
|
||||||
@ -44,4 +46,9 @@ public class SystemRoleServiceImpl extends ServiceImpl<SystemRoleDao, SystemRole
|
|||||||
public SystemRole getLeaderRoleByDeptId(Long orgId) {
|
public SystemRole getLeaderRoleByDeptId(Long orgId) {
|
||||||
return systemRoleDao.getLeaderRoleByDeptId(orgId);
|
return systemRoleDao.getLeaderRoleByDeptId(orgId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Map> getRoleListMap(Long userId) {
|
||||||
|
return systemRoleDao.getRoleListMap(userId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -104,6 +104,9 @@ public class activitiEnum {
|
|||||||
//小假 1、事假/年休假/陪护假/育儿假1天、病假3天以内:申请人-部门主任
|
//小假 1、事假/年休假/陪护假/育儿假1天、病假3天以内:申请人-部门主任
|
||||||
@ApiModelProperty("请假流程审批")
|
@ApiModelProperty("请假流程审批")
|
||||||
leaveMin("请假流程审批"),
|
leaveMin("请假流程审批"),
|
||||||
|
|
||||||
|
@ApiModelProperty("请假流程审批")
|
||||||
|
leaveLeader("领导请假"),
|
||||||
//协会
|
//协会
|
||||||
//请假时间在三天以内:申请人(填单)——部门主任(审核)
|
//请假时间在三天以内:申请人(填单)——部门主任(审核)
|
||||||
//请假时间在三天以上:申请人(填单)——部门主任(审核)——副秘书长(审核)
|
//请假时间在三天以上:申请人(填单)——部门主任(审核)——副秘书长(审核)
|
||||||
@ -524,7 +527,6 @@ public class activitiEnum {
|
|||||||
leave("请假"),
|
leave("请假"),
|
||||||
@ApiModelProperty("请假(婚丧/产假)")
|
@ApiModelProperty("请假(婚丧/产假)")
|
||||||
leaveCountry("请假(婚丧/产假) "),
|
leaveCountry("请假(婚丧/产假) "),
|
||||||
|
|
||||||
@ApiModelProperty("请假(小假)")
|
@ApiModelProperty("请假(小假)")
|
||||||
leaveMin("请假(小假) "),
|
leaveMin("请假(小假) "),
|
||||||
/* @ApiModelProperty("请假")
|
/* @ApiModelProperty("请假")
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.xqopen.kehui.mapper;
|
package com.xqopen.kehui.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.plugins.Page;
|
import com.baomidou.mybatisplus.plugins.Page;
|
||||||
import com.xqopen.kehui.common.entity.SystemRole;
|
import com.xqopen.kehui.common.entity.SystemRole;
|
||||||
@ -26,4 +27,11 @@ public interface SystemRoleDao extends BaseMapper<SystemRole> {
|
|||||||
List<SystemRole> getSystemRoleByRoleTagAUserId(@Param("roleTag") String roleTag, @Param("userId") Long userId);
|
List<SystemRole> getSystemRoleByRoleTagAUserId(@Param("roleTag") String roleTag, @Param("userId") Long userId);
|
||||||
|
|
||||||
SystemRole getLeaderRoleByDeptId(@Param("orgId") Long orgId);
|
SystemRole getLeaderRoleByDeptId(@Param("orgId") Long orgId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过账号id拿到角色集合
|
||||||
|
* @param userId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<Map> getRoleListMap(@Param("userId") Long userId);
|
||||||
}
|
}
|
@ -63,5 +63,12 @@
|
|||||||
AND sr.is_leader = TRUE
|
AND sr.is_leader = TRUE
|
||||||
AND sor.org_id =#{orgId}
|
AND sor.org_id =#{orgId}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getRoleListMap" resultType="java.util.Map">
|
||||||
|
select distinct * from system_user_login sul
|
||||||
|
left join personal_member pm on sul.userinfo_id=pm.id_ and sul.is_deleted=false and pm.is_deleted=false
|
||||||
|
left join system_user_role sug on sug.user_id=pm.id_ and sug.is_deleted=false
|
||||||
|
left join system_role sr on sug.role_id=sr.id_ and sr.is_deleted=false
|
||||||
|
where sul.id_=#{userId}
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -35,6 +35,7 @@ import java.time.temporal.ChronoUnit;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -124,6 +125,30 @@ public class PersonalEventsController implements PersonalEventsApi {
|
|||||||
Date endDate = personalEventsReq.getEndDate(); //结束日期
|
Date endDate = personalEventsReq.getEndDate(); //结束日期
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
if (!ObjectUtils.isEmpty(ext)) {
|
if (!ObjectUtils.isEmpty(ext)) {
|
||||||
|
List<Map> roleListMap = roleService.getRoleListMap(userId);
|
||||||
|
boolean flag = false;
|
||||||
|
if(!ObjectUtils.isEmpty(roleListMap)){
|
||||||
|
for (int i = 0; i < roleListMap.size(); i++) {
|
||||||
|
Map map = roleListMap.get(i);
|
||||||
|
String roleName = String.valueOf(map.get("role_name"));
|
||||||
|
switch (roleName){
|
||||||
|
case "副所长":
|
||||||
|
case "总支委员":
|
||||||
|
case "会主席":
|
||||||
|
case "部门主任":
|
||||||
|
flag = true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
flag = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(flag) break;
|
||||||
|
}
|
||||||
|
if(flag){
|
||||||
|
aType = activitiEnum.activitiType.leaveLeader;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
String beginM = String.valueOf(ext.get("beginM"));//请假时间
|
String beginM = String.valueOf(ext.get("beginM"));//请假时间
|
||||||
String endM = String.valueOf(ext.get("endM")); //结束时间
|
String endM = String.valueOf(ext.get("endM")); //结束时间
|
||||||
if (ext.containsKey("leaveType")) {
|
if (ext.containsKey("leaveType")) {
|
||||||
|
70
src/main/resources/processes/leaveLeader.bpmn
Normal file
70
src/main/resources/processes/leaveLeader.bpmn
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:tns="http://www.activiti.org/testm1525406093092" xmlns:xsd="http://www.w3.org/2001/XMLSchema" id="m1525406093092" name="" targetNamespace="http://www.activiti.org/testm1525406093092" exporter="Camunda Modeler" exporterVersion="5.25.0">
|
||||||
|
<process id="leaveLeader" name="请假(领导)" processType="None" isClosed="false" isExecutable="true">
|
||||||
|
<startEvent id="start" name="StartEvent" />
|
||||||
|
<userTask id="apply" name="申请人" activiti:assignee="${apply}" activiti:exclusive="true" />
|
||||||
|
<userTask id="director" name="所长" activiti:exclusive="true">
|
||||||
|
<extensionElements>
|
||||||
|
<activiti:taskListener class="com.xqopen.kehui.flows.util.MyTaskListener" event="create" />
|
||||||
|
</extensionElements>
|
||||||
|
</userTask>
|
||||||
|
<sequenceFlow id="_6" sourceRef="start" targetRef="apply" />
|
||||||
|
<sequenceFlow id="_7" sourceRef="apply" targetRef="director" />
|
||||||
|
<sequenceFlow id="_3" sourceRef="director" targetRef="end" />
|
||||||
|
<endEvent id="end" name="EndEvent">
|
||||||
|
<extensionElements>
|
||||||
|
<activiti:executionListener class="com.xqopen.kehui.flows.util.MyExecutionListener" event="end" />
|
||||||
|
</extensionElements>
|
||||||
|
<incoming>_3</incoming>
|
||||||
|
</endEvent>
|
||||||
|
</process>
|
||||||
|
<bpmndi:BPMNDiagram id="Diagram-_1" name="New Diagram" documentation="background=#3C3F41;count=1;horizontalcount=1;orientation=0;width=842.4;height=1195.2;imageableWidth=832.4;imageableHeight=1185.2;imageableX=5.0;imageableY=5.0">
|
||||||
|
<bpmndi:BPMNPlane bpmnElement="leaveLeader">
|
||||||
|
<bpmndi:BPMNShape id="Shape-start" bpmnElement="start">
|
||||||
|
<dc:Bounds x="375" y="100" width="32" height="32" />
|
||||||
|
<bpmndi:BPMNLabel>
|
||||||
|
<dc:Bounds x="160" y="80" width="52" height="14" />
|
||||||
|
</bpmndi:BPMNLabel>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape id="Shape-apply" bpmnElement="apply">
|
||||||
|
<dc:Bounds x="355" y="235" width="85" height="55" />
|
||||||
|
<bpmndi:BPMNLabel>
|
||||||
|
<dc:Bounds x="170" y="80" width="85" height="55" />
|
||||||
|
</bpmndi:BPMNLabel>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape id="Shape-business" bpmnElement="director">
|
||||||
|
<dc:Bounds x="355" y="375" width="85" height="55" />
|
||||||
|
<bpmndi:BPMNLabel>
|
||||||
|
<dc:Bounds x="170" y="80" width="85" height="55" />
|
||||||
|
</bpmndi:BPMNLabel>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape id="Shape-end" bpmnElement="end">
|
||||||
|
<dc:Bounds x="385" y="825" width="32" height="32" />
|
||||||
|
<bpmndi:BPMNLabel>
|
||||||
|
<dc:Bounds x="162" y="80" width="48" height="14" />
|
||||||
|
</bpmndi:BPMNLabel>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNEdge id="BPMNEdge__6" bpmnElement="_6" sourceElement="Shape-start" targetElement="Shape-apply">
|
||||||
|
<di:waypoint x="391" y="132" />
|
||||||
|
<di:waypoint x="391" y="235" />
|
||||||
|
<bpmndi:BPMNLabel>
|
||||||
|
<dc:Bounds x="0" y="0" width="0" height="0" />
|
||||||
|
</bpmndi:BPMNLabel>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge id="BPMNEdge__7" bpmnElement="_7" sourceElement="Shape-apply" targetElement="Shape-business">
|
||||||
|
<di:waypoint x="397.5" y="290" />
|
||||||
|
<di:waypoint x="397.5" y="375" />
|
||||||
|
<bpmndi:BPMNLabel>
|
||||||
|
<dc:Bounds x="0" y="0" width="0" height="0" />
|
||||||
|
</bpmndi:BPMNLabel>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge id="BPMNEdge__3" bpmnElement="_3" sourceElement="Shape-business" targetElement="Shape-end">
|
||||||
|
<di:waypoint x="400" y="430" />
|
||||||
|
<di:waypoint x="400" y="825" />
|
||||||
|
<bpmndi:BPMNLabel>
|
||||||
|
<dc:Bounds x="0" y="0" width="0" height="0" />
|
||||||
|
</bpmndi:BPMNLabel>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
</bpmndi:BPMNPlane>
|
||||||
|
</bpmndi:BPMNDiagram>
|
||||||
|
</definitions>
|
Loading…
x
Reference in New Issue
Block a user