4ac95c0a 张雷

增加单点登录接口、OA待办对接接口、禅道BUG修改

1 个父辈 c937ee54
...@@ -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<>();
......
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 }
...@@ -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 }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!