增加单点登录接口、OA待办对接接口、禅道BUG修改
正在显示
13 个修改的文件
包含
485 行增加
和
37 行删除
... | @@ -76,11 +76,6 @@ public class AjhMeetingController { | ... | @@ -76,11 +76,6 @@ public class AjhMeetingController { |
76 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | 76 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
77 | HttpServletRequest req) { | 77 | HttpServletRequest req) { |
78 | Result<IPage<AjhMeeting>> result = new Result<IPage<AjhMeeting>>(); | 78 | Result<IPage<AjhMeeting>> result = new Result<IPage<AjhMeeting>>(); |
79 | // if(ajhMeeting.getStartTime()!=null&&ajhMeeting.getEndTime()!=null){ | ||
80 | // String startTime = ajhMeeting.getStartTime()+" 00:00:00"; | ||
81 | // String endTime = ajhMeeting.getEndTime()+" 23:59:59"; | ||
82 | // queryWrapper.between("start_time", startTime, endTime); | ||
83 | // } | ||
84 | Page<AjhMeeting> page = new Page<AjhMeeting>(pageNo, pageSize); | 79 | Page<AjhMeeting> page = new Page<AjhMeeting>(pageNo, pageSize); |
85 | IPage<AjhMeeting> pageList = ajhMeetingService.queryPageList(page, ajhMeeting); | 80 | IPage<AjhMeeting> pageList = ajhMeetingService.queryPageList(page, ajhMeeting); |
86 | result.setSuccess(true); | 81 | result.setSuccess(true); | ... | ... |
... | @@ -89,10 +89,9 @@ public class AjhMeetingSendController { | ... | @@ -89,10 +89,9 @@ public class AjhMeetingSendController { |
89 | queryWrapper.like(ConvertUtils.isNotEmpty(ajhMeetingSend.getMeetTitle()),"meet_title",ajhMeetingSend.getMeetTitle()); | 89 | queryWrapper.like(ConvertUtils.isNotEmpty(ajhMeetingSend.getMeetTitle()),"meet_title",ajhMeetingSend.getMeetTitle()); |
90 | queryWrapper.between(ConvertUtils.isNotEmpty(ajhMeetingSend.getMeetStartTime()),"meet_start_time", | 90 | queryWrapper.between(ConvertUtils.isNotEmpty(ajhMeetingSend.getMeetStartTime()),"meet_start_time", |
91 | ajhMeetingSend.getMeetStartTime()+" 00:00:00",ajhMeetingSend.getMeetEndTime()+" 23:59:59"); | 91 | ajhMeetingSend.getMeetStartTime()+" 00:00:00",ajhMeetingSend.getMeetEndTime()+" 23:59:59"); |
92 | queryWrapper.orderByDesc("send_status"); | ||
92 | Page<AjhMeetingSend> page = new Page<AjhMeetingSend>(pageNo, pageSize); | 93 | Page<AjhMeetingSend> page = new Page<AjhMeetingSend>(pageNo, pageSize); |
93 | IPage<AjhMeetingSend> pageList = ajhMeetingSendService.queryPage(page, queryWrapper); | 94 | IPage<AjhMeetingSend> pageList = ajhMeetingSendService.queryPage(page, queryWrapper); |
94 | |||
95 | |||
96 | result.setSuccess(true); | 95 | result.setSuccess(true); |
97 | result.setResult(pageList); | 96 | result.setResult(pageList); |
98 | return result; | 97 | return result; | ... | ... |
... | @@ -87,7 +87,8 @@ public interface AjhRectificationInfoMapper extends BaseMapper<AjhRectificationI | ... | @@ -87,7 +87,8 @@ public interface AjhRectificationInfoMapper extends BaseMapper<AjhRectificationI |
87 | * @param endDate | 87 | * @param endDate |
88 | * @return | 88 | * @return |
89 | */ | 89 | */ |
90 | List<RectificationInfoAnalyseVO.XAndCount> areaList(@Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate); | 90 | List<RectificationInfoAnalyseVO.XAndCount> areaList(@Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate, |
91 | @Param("departId") String departId); | ||
91 | 92 | ||
92 | /** | 93 | /** |
93 | * 雷达图:安全隐患伤害类别 | 94 | * 雷达图:安全隐患伤害类别 | ... | ... |
... | @@ -46,7 +46,7 @@ | ... | @@ -46,7 +46,7 @@ |
46 | <if test="ajhMeeting.meetCategory !=null and ajhMeeting.meetCategory!=''"> | 46 | <if test="ajhMeeting.meetCategory !=null and ajhMeeting.meetCategory!=''"> |
47 | AND m.meet_category = #{ajhMeeting.meetCategory} | 47 | AND m.meet_category = #{ajhMeeting.meetCategory} |
48 | </if> | 48 | </if> |
49 | order by m.create_time desc | 49 | order by m.create_time desc,m.send_status asc |
50 | </select> | 50 | </select> |
51 | 51 | ||
52 | <select id="getDataById" resultType="com.skua.modules.ajh.vo.AjhMeetingVO"> | 52 | <select id="getDataById" resultType="com.skua.modules.ajh.vo.AjhMeetingVO"> | ... | ... |
... | @@ -162,17 +162,26 @@ | ... | @@ -162,17 +162,26 @@ |
162 | ) t | 162 | ) t |
163 | group by ym; | 163 | group by ym; |
164 | </select> | 164 | </select> |
165 | |||
165 | <select id="areaList" resultType="com.skua.modules.ajh.vo.RectificationInfoAnalyseVO$XAndCount"> | 166 | <select id="areaList" resultType="com.skua.modules.ajh.vo.RectificationInfoAnalyseVO$XAndCount"> |
166 | <!--要求:要返回所有的字典项--> | 167 | <!--要求:要返回所有的字典项--> |
167 | select dic.struct_name x, count | 168 | select dic.struct_name x, count |
168 | from ( | 169 | from ( |
169 | select ri.rec_ord_body,count(*) count | 170 | select ri.rec_ord_body,count(*) count |
170 | from ajh_rectification_info ri | 171 | from ajh_rectification_info ri |
171 | where rec_ord_report_date between #{startDate} and #{endDate} | 172 | where rec_ord_report_date between #{startDate} and #{endDate} |
172 | group by ri.rec_ord_body | 173 | group by ri.rec_ord_body |
173 | ) t | 174 | ) t |
174 | right join sys_struct_dict dic on t.rec_ord_body = dic.id | 175 | right join sys_struct_dict dic on t.rec_ord_body = dic.id |
176 | where 1=1 | ||
177 | <if test="departId!=null and departId!=''"> | ||
178 | and dic.depart_id in | ||
179 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | ||
180 | #{item} | ||
181 | </foreach> | ||
182 | </if> | ||
175 | </select> | 183 | </select> |
184 | |||
176 | <select id="classifyList" resultType="java.lang.String"> | 185 | <select id="classifyList" resultType="java.lang.String"> |
177 | select GROUP_CONCAT(rec_ord_classify) | 186 | select GROUP_CONCAT(rec_ord_classify) |
178 | from ajh_rectification_info ri | 187 | from ajh_rectification_info ri | ... | ... |
... | @@ -255,7 +255,7 @@ public class AjhRectificationInfoServiceImpl extends ServiceImpl<AjhRectificatio | ... | @@ -255,7 +255,7 @@ public class AjhRectificationInfoServiceImpl extends ServiceImpl<AjhRectificatio |
255 | 255 | ||
256 | vo.setLevelHistogramList(mapper.levelHistogramList(startDate, endDate, departId)); | 256 | vo.setLevelHistogramList(mapper.levelHistogramList(startDate, endDate, departId)); |
257 | vo.setDutyHistogramList(mapper.dutyHistogramList(startDate, endDate, departId)); | 257 | vo.setDutyHistogramList(mapper.dutyHistogramList(startDate, endDate, departId)); |
258 | vo.setAreaList(mapper.areaList(startDate, endDate)); | 258 | vo.setAreaList(mapper.areaList(startDate, endDate, departId)); |
259 | 259 | ||
260 | //雷达图:安全隐患伤害类别 (因为一个安全隐患可以选择多个[伤害类别],所以统计会复杂些)------------------------------------------------------------------------------------------- | 260 | //雷达图:安全隐患伤害类别 (因为一个安全隐患可以选择多个[伤害类别],所以统计会复杂些)------------------------------------------------------------------------------------------- |
261 | List<RectificationInfoAnalyseVO.XAndCount> classifyList = new LinkedList<>(); | 261 | List<RectificationInfoAnalyseVO.XAndCount> classifyList = new LinkedList<>(); | ... | ... |
sk-module-biz/src/main/java/com/skua/modules/flow/service/FlowForThirdBusinessService.java
0 → 100644
1 | |||
2 | package com.skua.modules.flow.service; | ||
3 | |||
4 | import com.baomidou.mybatisplus.core.metadata.IPage; | ||
5 | import com.skua.modules.flow.core.entity.BladeFlow; | ||
6 | import com.skua.modules.flow.core.entity.FlowAssemblyEntity; | ||
7 | |||
8 | import java.util.List; | ||
9 | import java.util.Map; | ||
10 | import java.util.Set; | ||
11 | |||
12 | /** | ||
13 | * 流程业务类 | ||
14 | * | ||
15 | * @author Jkadmin | ||
16 | */ | ||
17 | public interface FlowForThirdBusinessService { | ||
18 | |||
19 | /** | ||
20 | * 流程待签列表 | ||
21 | * @param bladeFlow 流程类 | ||
22 | * @return | ||
23 | */ | ||
24 | List<BladeFlow> selectClaimPage(BladeFlow bladeFlow, String userId, String roles); | ||
25 | |||
26 | /** | ||
27 | * 流程待办列表 | ||
28 | * @param bladeFlow 流程类 | ||
29 | * @return | ||
30 | */ | ||
31 | List<BladeFlow> selectTodoPage(BladeFlow bladeFlow, String userId); | ||
32 | |||
33 | } |
sk-module-biz/src/main/java/com/skua/modules/flow/service/impl/FlowForThirdBusinessServiceImpl.java
0 → 100644
1 | package com.skua.modules.flow.service.impl; | ||
2 | |||
3 | import com.skua.core.context.SpringContextUtils; | ||
4 | import com.skua.modules.flow.beans.BladeUser; | ||
5 | import com.skua.modules.flow.business.service.IFlowService; | ||
6 | import com.skua.modules.flow.core.entity.BladeFlow; | ||
7 | import com.skua.modules.flow.core.utils.TaskUtil; | ||
8 | import com.skua.modules.flow.custombiz.handle.IFlowBusinessDescService; | ||
9 | import com.skua.modules.flow.engine.constant.FlowEngineConstant; | ||
10 | import com.skua.modules.flow.service.FlowForThirdBusinessService; | ||
11 | import com.skua.modules.flow.utils.Func; | ||
12 | import com.skua.modules.flow.utils.StringPool; | ||
13 | import com.skua.modules.flow.utils.WebUtil; | ||
14 | import org.flowable.engine.HistoryService; | ||
15 | import org.flowable.engine.RepositoryService; | ||
16 | import org.flowable.engine.TaskService; | ||
17 | import org.flowable.engine.history.HistoricProcessInstance; | ||
18 | import org.flowable.engine.repository.ProcessDefinition; | ||
19 | import org.flowable.task.api.Task; | ||
20 | import org.flowable.task.api.TaskQuery; | ||
21 | import org.springframework.beans.factory.annotation.Autowired; | ||
22 | import org.springframework.stereotype.Service; | ||
23 | import javax.servlet.http.HttpServletRequest; | ||
24 | import java.util.*; | ||
25 | import java.util.stream.Collectors; | ||
26 | |||
27 | |||
28 | /** | ||
29 | * 流程业务实现类 | ||
30 | * @author Jkadmin | ||
31 | */ | ||
32 | @Service | ||
33 | public class FlowForThirdBusinessServiceImpl implements FlowForThirdBusinessService { | ||
34 | |||
35 | @Autowired | ||
36 | private TaskService taskService; | ||
37 | @Autowired | ||
38 | private HistoryService historyService; | ||
39 | @Autowired | ||
40 | private RepositoryService repositoryService; | ||
41 | @Autowired | ||
42 | private IFlowService flowService; | ||
43 | |||
44 | @Override | ||
45 | public List<BladeFlow> selectClaimPage(BladeFlow bladeFlow, String userId, String roles) { | ||
46 | String taskUser = TaskUtil.getTaskUser(userId); | ||
47 | String taskGroup = roles; | ||
48 | List<BladeFlow> flowList = new LinkedList<>(); | ||
49 | |||
50 | // 个人等待签收的任务 | ||
51 | TaskQuery claimUserQuery = taskService.createTaskQuery().taskCandidateUser(taskUser) | ||
52 | .includeProcessVariables().active().orderByTaskCreateTime().desc(); | ||
53 | // 通用流程等待签收的任务 | ||
54 | TaskQuery claimRoleWithoutTenantIdQuery = taskService.createTaskQuery().taskWithoutTenantId().taskCandidateGroupIn(Func.toStrList(taskGroup)) | ||
55 | .includeProcessVariables().active().orderByTaskCreateTime().desc(); | ||
56 | // 构建列表数据 | ||
57 | buildFlowTaskList(bladeFlow, flowList, claimUserQuery, FlowEngineConstant.STATUS_CLAIM); | ||
58 | buildFlowTaskList(bladeFlow, flowList, claimRoleWithoutTenantIdQuery, FlowEngineConstant.STATUS_CLAIM); | ||
59 | |||
60 | flowList = flowList.stream().sorted(Comparator.comparing(BladeFlow::getCreateTime).reversed()).collect(Collectors.toList()); | ||
61 | getFlowBusinessDesc(flowList); | ||
62 | return flowList; | ||
63 | } | ||
64 | |||
65 | @Override | ||
66 | public List<BladeFlow> selectTodoPage(BladeFlow bladeFlow, String userId) { | ||
67 | String taskUser = TaskUtil.getTaskUser(userId); | ||
68 | List<BladeFlow> flowList = new LinkedList<>(); | ||
69 | |||
70 | // 已签收的任务 | ||
71 | TaskQuery todoQuery = taskService.createTaskQuery().taskAssignee(taskUser).active() | ||
72 | .includeProcessVariables().orderByTaskCreateTime().desc(); | ||
73 | |||
74 | if (bladeFlow.getProcessDefinitionName() != null) { | ||
75 | todoQuery.processDefinitionNameLike(bladeFlow.getProcessDefinitionName()); | ||
76 | } | ||
77 | // 构建列表数据 | ||
78 | buildFlowTaskList(bladeFlow, flowList, todoQuery, FlowEngineConstant.STATUS_TODO); | ||
79 | getFlowBusinessDesc(flowList); | ||
80 | return flowList; | ||
81 | } | ||
82 | |||
83 | /** | ||
84 | * 构建流程 | ||
85 | * | ||
86 | * @param bladeFlow 流程通用类 | ||
87 | * @param flowList 流程列表 | ||
88 | * @param taskQuery 任务查询类 | ||
89 | * @param status 状态 | ||
90 | */ | ||
91 | private void buildFlowTaskList(BladeFlow bladeFlow, List<BladeFlow> flowList, TaskQuery taskQuery, String status) { | ||
92 | if (bladeFlow.getCategory() != null) { | ||
93 | taskQuery.processCategoryIn(Func.toStrList(bladeFlow.getCategory())); | ||
94 | } | ||
95 | if (bladeFlow.getBeginDate() != null) { | ||
96 | taskQuery.taskCreatedAfter(bladeFlow.getBeginDate()); | ||
97 | } | ||
98 | if (bladeFlow.getEndDate() != null) { | ||
99 | taskQuery.taskCreatedBefore(bladeFlow.getEndDate()); | ||
100 | } | ||
101 | if (bladeFlow.getProcessDefinitionName() != null) { | ||
102 | taskQuery.processDefinitionNameLike(bladeFlow.getProcessDefinitionName()); | ||
103 | } | ||
104 | if (!org.apache.commons.lang3.StringUtils.isBlank(bladeFlow.getProcessInstanceId())){ | ||
105 | taskQuery.processInstanceId(bladeFlow.getProcessInstanceId()); | ||
106 | } | ||
107 | if (!org.apache.commons.lang3.StringUtils.isBlank(bladeFlow.getProcessDefinitionId())){ | ||
108 | taskQuery.processDefinitionId(bladeFlow.getProcessDefinitionId()); | ||
109 | } | ||
110 | if (!org.apache.commons.lang3.StringUtils.isBlank(bladeFlow.getProcessDefinitionKey())){ | ||
111 | taskQuery.processDefinitionKey(bladeFlow.getProcessDefinitionKey()); | ||
112 | } | ||
113 | List<Task> queryList = taskQuery.list(); | ||
114 | |||
115 | Set<String> processInstanceIdSet = new TreeSet<>(); | ||
116 | Set<String> processDefinitionIdSet = new TreeSet<>(); | ||
117 | queryList.forEach(task -> { | ||
118 | processInstanceIdSet.add(task.getProcessInstanceId()); | ||
119 | processDefinitionIdSet.add(task.getProcessDefinitionId()); | ||
120 | }); | ||
121 | |||
122 | List<HistoricProcessInstance> historicProcessInstanceList = getHistoricProcessInstances(processInstanceIdSet); | ||
123 | Map<String, HistoricProcessInstance> historicProcessInstanceMap = new LinkedHashMap<>(); | ||
124 | historicProcessInstanceList.forEach(historicProcessInstance -> { | ||
125 | historicProcessInstanceMap.put(historicProcessInstance.getId(), historicProcessInstance); | ||
126 | }); | ||
127 | |||
128 | List<ProcessDefinition> processDefinitionList = getProcessDefinitionList(processDefinitionIdSet); | ||
129 | Map<String, ProcessDefinition> processDefinitionMap = new LinkedHashMap<>(); | ||
130 | processDefinitionList.forEach(processDefinition -> { | ||
131 | processDefinitionMap.put(processDefinition.getId(), processDefinition); | ||
132 | }); | ||
133 | List<BladeFlow> dataList = new ArrayList<>(); | ||
134 | queryList.forEach(task -> { | ||
135 | BladeFlow flow = new BladeFlow(); | ||
136 | flow.setTaskId(task.getId()); | ||
137 | flow.setTaskDefinitionKey(task.getTaskDefinitionKey()); | ||
138 | flow.setTaskName(task.getName()); | ||
139 | flow.setAssignee(task.getAssignee()); | ||
140 | flow.setCreateTime(task.getCreateTime()); | ||
141 | flow.setClaimTime(task.getClaimTime()); | ||
142 | flow.setExecutionId(task.getExecutionId()); | ||
143 | flow.setVariables(task.getProcessVariables()); | ||
144 | HistoricProcessInstance historicProcessInstance = historicProcessInstanceMap.get(task.getProcessInstanceId()); | ||
145 | if (Func.isNotEmpty(historicProcessInstance)) { | ||
146 | String[] businessKey = Func.toStrArray(StringPool.COLON, historicProcessInstance.getBusinessKey()); | ||
147 | flow.setBusinessTable(businessKey[0]); | ||
148 | flow.setBusinessId(businessKey[1]); | ||
149 | } | ||
150 | ProcessDefinition processDefinition = processDefinitionMap.get(task.getProcessDefinitionId()); | ||
151 | if (Func.isNotEmpty(processDefinition)) { | ||
152 | flow.setCategory(processDefinition.getCategory()); | ||
153 | flow.setCategoryName("请假流程"); | ||
154 | flow.setProcessDefinitionId(processDefinition.getId()); | ||
155 | flow.setProcessDefinitionName(processDefinition.getName()); | ||
156 | flow.setProcessDefinitionKey(processDefinition.getKey()); | ||
157 | flow.setProcessDefinitionVersion(processDefinition.getVersion()); | ||
158 | } | ||
159 | flow.setProcessInstanceId(task.getProcessInstanceId()); | ||
160 | flow.setStatus(status); | ||
161 | dataList.add(flow); | ||
162 | }); | ||
163 | Map<String,List<String>> businessTableMap = new LinkedHashMap<>(); | ||
164 | List<String> businessIdList; | ||
165 | for (BladeFlow flow : dataList) { | ||
166 | businessIdList = new ArrayList<>(); | ||
167 | if (businessTableMap.get(flow.getBusinessTable()) != null){ | ||
168 | businessIdList = businessTableMap.get(flow.getBusinessTable()); | ||
169 | } | ||
170 | businessIdList.add(flow.getBusinessId()); | ||
171 | businessTableMap.put(flow.getBusinessTable(),businessIdList); | ||
172 | } | ||
173 | List<String> allBusinessIdList = new ArrayList<>(); | ||
174 | for (Map.Entry<String,List<String>> entry : businessTableMap.entrySet()){ | ||
175 | allBusinessIdList.addAll(flowService.getBusinessIdList(entry.getKey(), entry.getValue())); | ||
176 | } | ||
177 | for (BladeFlow flow : dataList) { | ||
178 | if (allBusinessIdList.contains(flow.getBusinessId())){ | ||
179 | flowList.add(flow); | ||
180 | } | ||
181 | } | ||
182 | } | ||
183 | |||
184 | private List<ProcessDefinition> getProcessDefinitionList(Set<String> processDefinitionIdSet) { | ||
185 | if (processDefinitionIdSet.size() > 0){ | ||
186 | return repositoryService.createProcessDefinitionQuery().processDefinitionIds(processDefinitionIdSet).list(); | ||
187 | }else{ | ||
188 | return new ArrayList<>(); | ||
189 | } | ||
190 | |||
191 | } | ||
192 | |||
193 | private List<HistoricProcessInstance> getHistoricProcessInstances(Set<String> processInstanceIdSet) { | ||
194 | if (processInstanceIdSet.size() > 0){ | ||
195 | return historyService.createHistoricProcessInstanceQuery().processInstanceIds(processInstanceIdSet).list(); | ||
196 | }else{ | ||
197 | return new ArrayList<>(); | ||
198 | } | ||
199 | } | ||
200 | |||
201 | /** | ||
202 | * 获取租户ID | ||
203 | * | ||
204 | * @return tenantId | ||
205 | */ | ||
206 | public static String getTenantId() { | ||
207 | BladeUser user = getUser(); | ||
208 | return (null == user) ? StringPool.EMPTY : user.getTenantId(); | ||
209 | } | ||
210 | |||
211 | private static final String BLADE_USER_REQUEST_ATTR = "_BLADE_USER_REQUEST_ATTR_"; | ||
212 | /** | ||
213 | * 获取用户信息 | ||
214 | * | ||
215 | * @return BladeUser | ||
216 | */ | ||
217 | public static BladeUser getUser() { | ||
218 | HttpServletRequest request = WebUtil.getRequest(); | ||
219 | if (request == null) { | ||
220 | return null; | ||
221 | } | ||
222 | // 优先从 request 中获取 | ||
223 | Object bladeUser = request.getAttribute(BLADE_USER_REQUEST_ATTR); | ||
224 | if (bladeUser == null) { | ||
225 | bladeUser = getUser(request); | ||
226 | if (bladeUser != null) { | ||
227 | // 设置到 request 中 | ||
228 | request.setAttribute(BLADE_USER_REQUEST_ATTR, bladeUser); | ||
229 | } | ||
230 | } | ||
231 | return (BladeUser) bladeUser; | ||
232 | } | ||
233 | |||
234 | /** | ||
235 | * 获取用户信息 | ||
236 | * | ||
237 | * @param request request | ||
238 | * @return BladeUser | ||
239 | */ | ||
240 | public static BladeUser getUser(HttpServletRequest request) { | ||
241 | return new BladeUser(); | ||
242 | } | ||
243 | |||
244 | public List<BladeFlow> getFlowBusinessDesc(List<BladeFlow> bladeFlowList){ | ||
245 | List<Map<String,String>> paramList = new ArrayList<>(); | ||
246 | Map<String,String> paramMap; | ||
247 | for (BladeFlow bladeFlow : bladeFlowList) { | ||
248 | paramMap = new HashMap<>(); | ||
249 | paramMap.put("businessTable",bladeFlow.getBusinessTable()); | ||
250 | paramMap.put("businessId",bladeFlow.getBusinessId()); | ||
251 | paramList.add(paramMap); | ||
252 | } | ||
253 | IFlowBusinessDescService flowBusinessDescService = null; | ||
254 | try { | ||
255 | flowBusinessDescService = (IFlowBusinessDescService) SpringContextUtils.getBean("flowBusinessDescService"); | ||
256 | }catch (Exception e){ | ||
257 | //表示系统没有写流程描述接口 | ||
258 | } | ||
259 | if (flowBusinessDescService != null) { | ||
260 | Map<String, String> flowBusinessDescMap = flowBusinessDescService.getFlowBusinessDesc(paramList); | ||
261 | if (flowBusinessDescMap != null) { | ||
262 | for (BladeFlow bladeFlow : bladeFlowList) { | ||
263 | bladeFlow.setBusinessDesc(flowBusinessDescMap.get(bladeFlow.getBusinessId())); | ||
264 | } | ||
265 | } | ||
266 | } | ||
267 | return bladeFlowList; | ||
268 | } | ||
269 | |||
270 | } |
... | @@ -4,20 +4,28 @@ import com.alibaba.fastjson.JSONObject; | ... | @@ -4,20 +4,28 @@ import com.alibaba.fastjson.JSONObject; |
4 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 4 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
5 | import com.baomidou.mybatisplus.core.metadata.IPage; | 5 | import com.baomidou.mybatisplus.core.metadata.IPage; |
6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
7 | import com.skua.core.api.ISysBaseAPI; | ||
7 | import com.skua.core.api.vo.Result; | 8 | import com.skua.core.api.vo.Result; |
8 | import com.skua.core.aspect.annotation.AutoLog; | 9 | import com.skua.core.aspect.annotation.AutoLog; |
9 | import com.skua.core.context.BaseContextHandler; | 10 | import com.skua.core.context.BaseContextHandler; |
10 | import com.skua.core.context.SpringContextUtils; | 11 | import com.skua.core.context.SpringContextUtils; |
12 | import com.skua.core.util.DateUtils; | ||
11 | import com.skua.modules.equipment.entity.EquipmentMaintainTask; | 13 | import com.skua.modules.equipment.entity.EquipmentMaintainTask; |
12 | import com.skua.modules.equipment.service.IEquipmentMaintainTaskService; | 14 | import com.skua.modules.equipment.service.IEquipmentMaintainTaskService; |
15 | |||
13 | import com.skua.modules.flow.business.service.FlowBusinessService; | 16 | import com.skua.modules.flow.business.service.FlowBusinessService; |
14 | import com.skua.modules.flow.core.entity.BladeFlow; | 17 | import com.skua.modules.flow.core.entity.BladeFlow; |
15 | import com.skua.modules.flow.core.utils.TaskUtil; | 18 | import com.skua.modules.flow.service.FlowForThirdBusinessService; |
16 | import com.skua.modules.inspection.entity.InspectionUserWorkingGroup; | 19 | import com.skua.modules.inspection.entity.InspectionUserWorkingGroup; |
17 | import com.skua.modules.inspection.service.IInspectionTaskService; | 20 | import com.skua.modules.inspection.service.IInspectionTaskService; |
18 | import com.skua.modules.inspection.service.IInspectionUserWorkingGroupService; | 21 | import com.skua.modules.inspection.service.IInspectionUserWorkingGroupService; |
19 | import com.skua.modules.process.vo.ProcessStatisticsVO; | 22 | import com.skua.modules.process.vo.ProcessStatisticsVO; |
23 | import com.skua.modules.process.vo.ThirdProcessVO; | ||
20 | import com.skua.modules.quartz.util.BaseUtil; | 24 | import com.skua.modules.quartz.util.BaseUtil; |
25 | import com.skua.modules.system.entity.SysUser; | ||
26 | import com.skua.modules.system.entity.SysUserRole; | ||
27 | import com.skua.modules.system.service.ISysUserRoleService; | ||
28 | import com.skua.modules.system.service.ISysUserService; | ||
21 | import io.swagger.annotations.Api; | 29 | import io.swagger.annotations.Api; |
22 | import io.swagger.annotations.ApiOperation; | 30 | import io.swagger.annotations.ApiOperation; |
23 | import lombok.extern.slf4j.Slf4j; | 31 | import lombok.extern.slf4j.Slf4j; |
... | @@ -27,8 +35,9 @@ import org.springframework.web.bind.annotation.GetMapping; | ... | @@ -27,8 +35,9 @@ import org.springframework.web.bind.annotation.GetMapping; |
27 | import org.springframework.web.bind.annotation.RequestMapping; | 35 | import org.springframework.web.bind.annotation.RequestMapping; |
28 | import org.springframework.web.bind.annotation.RestController; | 36 | import org.springframework.web.bind.annotation.RestController; |
29 | 37 | ||
30 | import java.util.ArrayList; | 38 | import java.time.format.DateTimeFormatter; |
31 | import java.util.List; | 39 | import java.util.*; |
40 | import java.util.stream.Collectors; | ||
32 | 41 | ||
33 | @Slf4j | 42 | @Slf4j |
34 | @Api(tags="测试流程") | 43 | @Api(tags="测试流程") |
... | @@ -37,15 +46,21 @@ import java.util.List; | ... | @@ -37,15 +46,21 @@ import java.util.List; |
37 | public class ProcessStatisticsController { | 46 | public class ProcessStatisticsController { |
38 | 47 | ||
39 | @Autowired | 48 | @Autowired |
49 | private ISysUserService sysUserService; | ||
50 | @Autowired | ||
51 | private ISysBaseAPI sysBaseAPI; | ||
52 | @Autowired | ||
40 | private FlowBusinessService flowBusinessService; | 53 | private FlowBusinessService flowBusinessService; |
41 | @Autowired | 54 | @Autowired |
55 | private FlowForThirdBusinessService flowForThirdBusinessService; | ||
56 | @Autowired | ||
42 | private IEquipmentMaintainTaskService equipMaintainExecuteService; | 57 | private IEquipmentMaintainTaskService equipMaintainExecuteService; |
43 | @Autowired | 58 | @Autowired |
44 | private IInspectionTaskService inspectionTaskService; | 59 | private IInspectionTaskService inspectionTaskService; |
45 | @Autowired | 60 | @Autowired |
46 | private IInspectionUserWorkingGroupService inspectionUserWorkingGroupService; | 61 | private IInspectionUserWorkingGroupService inspectionUserWorkingGroupService; |
47 | 62 | ||
48 | /* 问题上报流程 problemReport | 63 | /* 问题上报流程 problemReport |
49 | 设备维修流程 EquipmentRepair | 64 | 设备维修流程 EquipmentRepair |
50 | 设备缺陷管理 EquipmentDefectManagement | 65 | 设备缺陷管理 EquipmentDefectManagement |
51 | 事故事件流程 EmergencyRiskEvent | 66 | 事故事件流程 EmergencyRiskEvent |
... | @@ -60,9 +75,6 @@ public class ProcessStatisticsController { | ... | @@ -60,9 +75,6 @@ public class ProcessStatisticsController { |
60 | public Result<List<ProcessStatisticsVO>> statistics() { | 75 | public Result<List<ProcessStatisticsVO>> statistics() { |
61 | Result<List<ProcessStatisticsVO>> result = new Result<List<ProcessStatisticsVO>>(); | 76 | Result<List<ProcessStatisticsVO>> result = new Result<List<ProcessStatisticsVO>>(); |
62 | List<ProcessStatisticsVO> processStatisticsList = new ArrayList<>(); | 77 | List<ProcessStatisticsVO> processStatisticsList = new ArrayList<>(); |
63 | /* String taskUser = TaskUtil.getTaskUser(); | ||
64 | String taskGroup = TaskUtil.getCandidateGroup();*/ | ||
65 | |||
66 | String userId = BaseContextHandler.getUserId(); | 78 | String userId = BaseContextHandler.getUserId(); |
67 | IPage<BladeFlow> page = new Page<BladeFlow>(); | 79 | IPage<BladeFlow> page = new Page<BladeFlow>(); |
68 | page.setCurrent(1); | 80 | page.setCurrent(1); |
... | @@ -70,8 +82,6 @@ public class ProcessStatisticsController { | ... | @@ -70,8 +82,6 @@ public class ProcessStatisticsController { |
70 | BladeFlow bladeFlow = new BladeFlow(); | 82 | BladeFlow bladeFlow = new BladeFlow(); |
71 | try { | 83 | try { |
72 | //巡检任务、维修任务、保养任务、危险作业、事故事件、安全隐患、、药剂入库 | 84 | //巡检任务、维修任务、保养任务、危险作业、事故事件、安全隐患、、药剂入库 |
73 | |||
74 | |||
75 | String process_key = "AjhRectification"; | 85 | String process_key = "AjhRectification"; |
76 | processStatisticsList.add( queryProcessStatistics("安全隐患", process_key,page,bladeFlow) ) ; | 86 | processStatisticsList.add( queryProcessStatistics("安全隐患", process_key,page,bladeFlow) ) ; |
77 | process_key = "problemReport"; | 87 | process_key = "problemReport"; |
... | @@ -91,8 +101,6 @@ public class ProcessStatisticsController { | ... | @@ -91,8 +101,6 @@ public class ProcessStatisticsController { |
91 | ProcessStatisticsVO maintainerProcessStatisticsVO = new ProcessStatisticsVO("保养任务" ,"" , "0", baoyangTodoCount.toString() ); | 101 | ProcessStatisticsVO maintainerProcessStatisticsVO = new ProcessStatisticsVO("保养任务" ,"" , "0", baoyangTodoCount.toString() ); |
92 | processStatisticsList.add( maintainerProcessStatisticsVO ); | 102 | processStatisticsList.add( maintainerProcessStatisticsVO ); |
93 | 103 | ||
94 | |||
95 | |||
96 | //巡检 | 104 | //巡检 |
97 | //得到巡检任务 | 105 | //得到巡检任务 |
98 | //得到进行中的任务 | 106 | //得到进行中的任务 |
... | @@ -155,20 +163,7 @@ public class ProcessStatisticsController { | ... | @@ -155,20 +163,7 @@ public class ProcessStatisticsController { |
155 | return result; | 163 | return result; |
156 | } | 164 | } |
157 | 165 | ||
158 | /*** | 166 | private ProcessStatisticsVO queryProcessStatistics(String processName, String process_key, IPage<BladeFlow> page,BladeFlow bladeFlow){ |
159 | * @param process_key | ||
160 | * @return | ||
161 | */ | ||
162 | /* private ProcessStatisticsVO queryProcessStatistics(String processName,String process_key,String taskUser , String taskGroup){ | ||
163 | TaskQuery taskQuery = taskService.createTaskQuery(); | ||
164 | taskQuery.processDefinitionKey( process_key ); | ||
165 | Long todoCount = taskQuery.taskAssignee(taskUser).count();//代办人数 | ||
166 | Long claimCount = taskQuery.taskCandidateGroupIn( Func.toStrList(taskGroup) ).count() ;//todoCount | ||
167 | return new ProcessStatisticsVO(processName ,process_key , todoCount.toString(), claimCount.toString() ); | ||
168 | }*/ | ||
169 | |||
170 | |||
171 | private ProcessStatisticsVO queryProcessStatistics(String processName, String process_key, IPage<BladeFlow> page,BladeFlow bladeFlow){ | ||
172 | // String repairProcessDefinitionKey = "equipServicewx"; | 167 | // String repairProcessDefinitionKey = "equipServicewx"; |
173 | bladeFlow.setProcessDefinitionKey(process_key); | 168 | bladeFlow.setProcessDefinitionKey(process_key); |
174 | long repairClaimCount = flowBusinessService.selectClaimPage(page, bladeFlow).getTotal(); | 169 | long repairClaimCount = flowBusinessService.selectClaimPage(page, bladeFlow).getTotal(); |
... | @@ -177,4 +172,56 @@ public class ProcessStatisticsController { | ... | @@ -177,4 +172,56 @@ public class ProcessStatisticsController { |
177 | 172 | ||
178 | return new ProcessStatisticsVO(processName ,process_key , repairToDoCount+"", repairClaimCount+"" ); | 173 | return new ProcessStatisticsVO(processName ,process_key , repairToDoCount+"", repairClaimCount+"" ); |
179 | } | 174 | } |
175 | |||
176 | @AutoLog(value = "第三方获取待办流程" ) | ||
177 | @ApiOperation(value="第三方获取待办流程", notes="第三方获取待办流程") | ||
178 | @GetMapping(value = "/getProcessByPhone") | ||
179 | public Result<Map<String,Object>> getProcessByPhone(String phone) { | ||
180 | Result<Map<String,Object>> result = new Result<Map<String,Object>>(); | ||
181 | Map<String,Object> map = new HashMap<>(); | ||
182 | List<ThirdProcessVO> list = new ArrayList<>(); | ||
183 | SysUser sysUser = sysUserService.getUserByPhone(phone); | ||
184 | if(sysUser!=null){ | ||
185 | String userName = sysUser.getRealname(); | ||
186 | BladeFlow bladeFlow = new BladeFlow(); | ||
187 | List<BladeFlow> claimList = new ArrayList<>(); | ||
188 | List<BladeFlow> todoList = new ArrayList<>(); | ||
189 | List<String> roleList = sysBaseAPI.getRolesByUserId(sysUser.getId()); | ||
190 | String roles = roleList.stream().map(s -> s.trim()).collect(Collectors.joining(",")); | ||
191 | if(roleList.size() > 0){ | ||
192 | claimList = flowForThirdBusinessService.selectClaimPage(bladeFlow, sysUser.getId(), roles); | ||
193 | for (BladeFlow claim : claimList) { | ||
194 | ThirdProcessVO claimVO = new ThirdProcessVO(); | ||
195 | claimVO.setMsgid(claim.getTaskId()); | ||
196 | claimVO.setMessagenote(claim.getBusinessDesc()); | ||
197 | if(claim.getCreateTime()!=null){ | ||
198 | claimVO.setSenddate(DateUtils.format(new Date(), "YYYY-MM-dd")); | ||
199 | } | ||
200 | claimVO.setCheckcode(phone); | ||
201 | claimVO.setCheckname(userName); | ||
202 | claimVO.setSendercode(phone); | ||
203 | claimVO.setSendername(userName); | ||
204 | list.add(claimVO); | ||
205 | } | ||
206 | } | ||
207 | todoList = flowForThirdBusinessService.selectTodoPage(bladeFlow, sysUser.getId()); | ||
208 | for (BladeFlow todo : todoList) { | ||
209 | ThirdProcessVO todoVO = new ThirdProcessVO(); | ||
210 | todoVO.setMsgid(todo.getTaskId()); | ||
211 | todoVO.setMessagenote(todo.getBusinessDesc()); | ||
212 | if(todo.getCreateTime()!=null){ | ||
213 | todoVO.setSenddate(DateUtils.format(new Date(), "YYYY-MM-dd")); | ||
214 | } | ||
215 | todoVO.setCheckcode(phone); | ||
216 | todoVO.setCheckname(userName); | ||
217 | todoVO.setSendercode(phone); | ||
218 | todoVO.setSendername(userName); | ||
219 | list.add(todoVO); | ||
220 | } | ||
221 | } | ||
222 | map.put("DATAS",list); | ||
223 | map.put("COUNT",list.size()); | ||
224 | result.setResult(map); | ||
225 | return result; | ||
226 | } | ||
180 | } | 227 | } | ... | ... |
1 | package com.skua.modules.process.vo; | ||
2 | |||
3 | import io.swagger.annotations.ApiModel; | ||
4 | import io.swagger.annotations.ApiModelProperty; | ||
5 | import lombok.Data; | ||
6 | |||
7 | @Data | ||
8 | @ApiModel(value="待办数据传输对象", description="待办数据传输对象") | ||
9 | public class ThirdProcessVO { | ||
10 | |||
11 | @ApiModelProperty(value = "待办唯一标识ID") | ||
12 | private String msgid; | ||
13 | |||
14 | @ApiModelProperty(value = "PC端待办链接") | ||
15 | private String messageurlpc; | ||
16 | |||
17 | @ApiModelProperty(value = "移动端待办链接") | ||
18 | private String messageurlmobile; | ||
19 | |||
20 | @ApiModelProperty(value = "创建人手机号") | ||
21 | private String sendercode; | ||
22 | |||
23 | @ApiModelProperty(value = "创建人姓名") | ||
24 | private String sendername; | ||
25 | |||
26 | @ApiModelProperty(value = "待办标题") | ||
27 | private String messagenote; | ||
28 | |||
29 | @ApiModelProperty(value = "待办接收日期") | ||
30 | private String senddate; | ||
31 | |||
32 | @ApiModelProperty(value = "审批人手机号") | ||
33 | private String checkcode; | ||
34 | |||
35 | @ApiModelProperty(value = "审批人姓名") | ||
36 | private String checkname; | ||
37 | |||
38 | } |
... | @@ -46,6 +46,7 @@ public class ShiroConfig { | ... | @@ -46,6 +46,7 @@ public class ShiroConfig { |
46 | filterChainDefinitionMap.put("/sys/login", "anon"); //登录接口排除 | 46 | filterChainDefinitionMap.put("/sys/login", "anon"); //登录接口排除 |
47 | filterChainDefinitionMap.put("/sys/appLogin", "anon"); //移动端登录接口排除 | 47 | filterChainDefinitionMap.put("/sys/appLogin", "anon"); //移动端登录接口排除 |
48 | filterChainDefinitionMap.put("/sys/thirdLogin", "anon"); //三方系统登录接口排除 | 48 | filterChainDefinitionMap.put("/sys/thirdLogin", "anon"); //三方系统登录接口排除 |
49 | filterChainDefinitionMap.put("/sys/sso/login", "anon"); //单点登录接口排除 | ||
49 | filterChainDefinitionMap.put("/sys/logout", "anon"); //登出接口排除 | 50 | filterChainDefinitionMap.put("/sys/logout", "anon"); //登出接口排除 |
50 | filterChainDefinitionMap.put("/sys/getEncryptedString", "anon"); //获取加密串 | 51 | filterChainDefinitionMap.put("/sys/getEncryptedString", "anon"); //获取加密串 |
51 | filterChainDefinitionMap.put("/sys/sms", "anon");//短信验证码 | 52 | filterChainDefinitionMap.put("/sys/sms", "anon");//短信验证码 |
... | @@ -64,7 +65,7 @@ public class ShiroConfig { | ... | @@ -64,7 +65,7 @@ public class ShiroConfig { |
64 | filterChainDefinitionMap.put("/web/erp/materialAcceptanceForm/senderSign", "anon");//采购入库,送货方签名 | 65 | filterChainDefinitionMap.put("/web/erp/materialAcceptanceForm/senderSign", "anon");//采购入库,送货方签名 |
65 | filterChainDefinitionMap.put("/web/erp/materialIN/queryById", "anon");//采购入库,查询采购入库信息 | 66 | filterChainDefinitionMap.put("/web/erp/materialIN/queryById", "anon");//采购入库,查询采购入库信息 |
66 | filterChainDefinitionMap.put("/generic/**", "anon");//pdf预览需要文件 | 67 | filterChainDefinitionMap.put("/generic/**", "anon");//pdf预览需要文件 |
67 | filterChainDefinitionMap.put("/generic/**", "anon");//pdf预览需要文件 | 68 | filterChainDefinitionMap.put("/web/process/getProcessByPhone", "anon");//第三方获取待办事件 |
68 | filterChainDefinitionMap.put("/", "anon"); | 69 | filterChainDefinitionMap.put("/", "anon"); |
69 | filterChainDefinitionMap.put("/doc.html", "anon"); | 70 | filterChainDefinitionMap.put("/doc.html", "anon"); |
70 | filterChainDefinitionMap.put("/**/*.js", "anon"); | 71 | filterChainDefinitionMap.put("/**/*.js", "anon"); | ... | ... |
... | @@ -11,6 +11,8 @@ import java.util.Objects; | ... | @@ -11,6 +11,8 @@ import java.util.Objects; |
11 | import javax.servlet.http.HttpServletRequest; | 11 | import javax.servlet.http.HttpServletRequest; |
12 | import javax.servlet.http.HttpServletResponse; | 12 | import javax.servlet.http.HttpServletResponse; |
13 | 13 | ||
14 | import com.skua.core.util.encryption.MD5Util; | ||
15 | import com.skua.modules.system.vo.SsoLogin; | ||
14 | import org.apache.commons.lang.StringUtils; | 16 | import org.apache.commons.lang.StringUtils; |
15 | import org.apache.shiro.SecurityUtils; | 17 | import org.apache.shiro.SecurityUtils; |
16 | import org.springframework.beans.factory.annotation.Autowired; | 18 | import org.springframework.beans.factory.annotation.Autowired; |
... | @@ -184,6 +186,39 @@ public class LoginController { | ... | @@ -184,6 +186,39 @@ public class LoginController { |
184 | return result; | 186 | return result; |
185 | } | 187 | } |
186 | 188 | ||
189 | /** | ||
190 | * 单点登录接口 | ||
191 | * @param ssoLogin | ||
192 | * @return | ||
193 | */ | ||
194 | @RequestMapping(value = "/sso/login", method = RequestMethod.POST) | ||
195 | @ApiOperation("单点登录接口") | ||
196 | public Result<JSONObject> ssoLogin(@RequestBody SsoLogin ssoLogin){ | ||
197 | Result<JSONObject> result = new Result<JSONObject>(); | ||
198 | String phone = ssoLogin.getPhone();//手机号 | ||
199 | String time = ssoLogin.getTime();//时间戳 | ||
200 | String sign = ssoLogin.getSign();//加密信息 | ||
201 | String key = "szhqydn";//约定标识 | ||
202 | SysUser sysUser = sysUserService.getUserByPhone(ssoLogin.getPhone()); | ||
203 | if(sysUser!=null){ | ||
204 | String origin = key + time + phone;//标识 | ||
205 | String md5 = MD5Util.MD5Encode(origin, null); | ||
206 | if(sign.equals(md5)){ | ||
207 | //校验用户是否有效 | ||
208 | result = sysUserService.checkUserIsEffective(sysUser); | ||
209 | if (!result.isSuccess()) { | ||
210 | return result; | ||
211 | } | ||
212 | //用户登录信息 | ||
213 | userInfo(sysUser, result); | ||
214 | sysBaseAPI.addLog("手机号: " + phone + ",单点登录成功!", CommonConstant.LOG_TYPE_1, null); | ||
215 | } | ||
216 | }else{ | ||
217 | result.error500("手机号不存在本系统"); | ||
218 | } | ||
219 | return result; | ||
220 | } | ||
221 | |||
187 | @RequestMapping(value = "/getSv30Token", method = RequestMethod.POST) | 222 | @RequestMapping(value = "/getSv30Token", method = RequestMethod.POST) |
188 | @ApiOperation("SV30获取token") | 223 | @ApiOperation("SV30获取token") |
189 | public Result<JSONObject> getSv30Token(){ | 224 | public Result<JSONObject> getSv30Token(){ | ... | ... |
1 | package com.skua.modules.system.vo; | ||
2 | import io.swagger.annotations.ApiModel; | ||
3 | import io.swagger.annotations.ApiModelProperty; | ||
4 | import lombok.Data; | ||
5 | |||
6 | /** | ||
7 | * 单点登陆参数 | ||
8 | */ | ||
9 | @Data | ||
10 | @ApiModel(value="SsoLogin", description="单点登陆参数") | ||
11 | public class SsoLogin { | ||
12 | @ApiModelProperty(value = "手机号") | ||
13 | private String phone; | ||
14 | @ApiModelProperty(value = "时间戳") | ||
15 | private String time; | ||
16 | @ApiModelProperty(value = "加密信息") | ||
17 | private String sign; | ||
18 | @ApiModelProperty(value = "约定标识") | ||
19 | private String key; | ||
20 | } |
-
请 注册 或 登录 后发表评论