流程中心-各分页列表调整。
用户token失效返回信息处理。
This commit is contained in:
+28
@@ -1,6 +1,8 @@
|
||||
package com.jero.config.shiro;
|
||||
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
import com.google.gson.Gson;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authc.AuthenticationException;
|
||||
import org.apache.shiro.authc.AuthenticationInfo;
|
||||
@@ -18,10 +20,14 @@ import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.RedisUtil;
|
||||
import com.jero.common.util.SpringContextUtils;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@@ -41,6 +47,9 @@ public class ShiroRealm extends AuthorizingRealm {
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
@Autowired
|
||||
private HttpServletResponse response;
|
||||
|
||||
/**
|
||||
* 必须重写此方法,不然Shiro会报错
|
||||
*/
|
||||
@@ -124,6 +133,25 @@ public class ShiroRealm extends AuthorizingRealm {
|
||||
}
|
||||
// 校验token是否超时失效 & 或者账号密码是否错误
|
||||
if (!jwtTokenRefresh(token, username, loginUser.getPassword())) {
|
||||
String reponseJson = new Gson().toJson(Result.error(401,"Token失效,请重新登录!"));
|
||||
response.setContentType("application/json; charset=utf-8");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
OutputStream out = null;
|
||||
try {
|
||||
out = response.getOutputStream();
|
||||
out.write(reponseJson.getBytes());
|
||||
}catch (IOException ex){
|
||||
ex.printStackTrace();
|
||||
}finally {
|
||||
if(out != null){
|
||||
try {
|
||||
out.close();
|
||||
out.flush();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
throw new AuthenticationException("Token失效,请重新登录!");
|
||||
}
|
||||
|
||||
|
||||
+27
-30
@@ -1,7 +1,6 @@
|
||||
package com.jero.modules.wkflow.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.modules.wkflow.entity.BusMes;
|
||||
@@ -9,6 +8,7 @@ import com.jero.modules.wkflow.entity.BusProcessName;
|
||||
import com.jero.modules.wkflow.entity.BusProcessNew;
|
||||
import com.jero.modules.wkflow.entity.TaskCommonQuery;
|
||||
import com.jero.modules.wkflow.feginClient.impl.TaskFeignClientImpl;
|
||||
import com.jero.modules.wkflow.page.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -65,21 +65,21 @@ public class TaskController {
|
||||
@AutoLog(value = "我的待办任务列表")
|
||||
@ApiOperation(value="我的待办任务列表", notes="我的待办任务列表")
|
||||
@PostMapping("/todoTaskList")
|
||||
public IPage<BusProcessName> todoTaskListByUserId(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
public Page todoTaskListByUserId(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
List<BusProcessName> busProcessNames = taskFeignClient.todoTaskListByUserId(taskCommonQuery);
|
||||
List list1 = this.startPage(busProcessNames, taskCommonQuery.getCurrent(), taskCommonQuery.getSize());
|
||||
IPage pageInfo = new Page();
|
||||
Page pageInfo = new Page();
|
||||
if(busProcessNames!=null){
|
||||
pageInfo.setRecords(list1);
|
||||
pageInfo.setCurrent(taskCommonQuery.getCurrent());
|
||||
pageInfo.setTotal(Long.valueOf(busProcessNames.size()));
|
||||
pageInfo.setSize(taskCommonQuery.getSize());
|
||||
pageInfo.setList(list1);
|
||||
pageInfo.setPageNo(taskCommonQuery.getCurrent());
|
||||
pageInfo.setCount(Long.valueOf(busProcessNames.size()));
|
||||
pageInfo.setPageSize(taskCommonQuery.getSize());
|
||||
}else{
|
||||
List<BusProcessName> list = new ArrayList<>();
|
||||
pageInfo.setRecords(list);
|
||||
pageInfo.setCurrent(taskCommonQuery.getCurrent());
|
||||
pageInfo.setTotal(Long.valueOf(0));
|
||||
pageInfo.setSize(taskCommonQuery.getSize());
|
||||
pageInfo.setList(list);
|
||||
pageInfo.setPageNo(taskCommonQuery.getCurrent());
|
||||
pageInfo.setCount(Long.valueOf(0));
|
||||
pageInfo.setPageSize(taskCommonQuery.getSize());
|
||||
}
|
||||
return pageInfo;
|
||||
}
|
||||
@@ -87,21 +87,21 @@ public class TaskController {
|
||||
@AutoLog(value = "查询草稿")
|
||||
@ApiOperation(value="查询草稿", notes="查询草稿")
|
||||
@PostMapping("/queryTaskDraft")
|
||||
public IPage<BusProcessName> queryTaskDraft(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
public Page queryTaskDraft(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
List<BusProcessName> busProcessNames = taskFeignClient.queryTaskDraft(taskCommonQuery);
|
||||
List list1 = this.startPage(busProcessNames, taskCommonQuery.getCurrent(), taskCommonQuery.getSize());
|
||||
IPage pageInfo = new Page();
|
||||
Page pageInfo = new Page();
|
||||
if(busProcessNames!=null){
|
||||
pageInfo.setRecords(list1);
|
||||
pageInfo.setCurrent(taskCommonQuery.getCurrent());
|
||||
pageInfo.setTotal(Long.valueOf(busProcessNames.size()));
|
||||
pageInfo.setSize(taskCommonQuery.getSize());
|
||||
pageInfo.setList(list1);
|
||||
pageInfo.setPageNo(taskCommonQuery.getCurrent());
|
||||
pageInfo.setCount(Long.valueOf(busProcessNames.size()));
|
||||
pageInfo.setPageSize(taskCommonQuery.getSize());
|
||||
}else{
|
||||
List<BusProcessName> list = new ArrayList<BusProcessName>();
|
||||
pageInfo.setRecords(list);
|
||||
pageInfo.setCurrent(taskCommonQuery.getCurrent());
|
||||
pageInfo.setTotal(Long.valueOf(0));
|
||||
pageInfo.setSize(taskCommonQuery.getSize());
|
||||
pageInfo.setList(list);
|
||||
pageInfo.setPageNo(taskCommonQuery.getCurrent());
|
||||
pageInfo.setCount(Long.valueOf(0));
|
||||
pageInfo.setPageSize(taskCommonQuery.getSize());
|
||||
}
|
||||
return pageInfo;
|
||||
}
|
||||
@@ -109,25 +109,22 @@ public class TaskController {
|
||||
@AutoLog(value = "已办流程")
|
||||
@ApiOperation(value="已办流程", notes="已办流程")
|
||||
@PostMapping("/doneProcess")
|
||||
public IPage<BusProcessName> doneProcess(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
IPage page = taskFeignClient.doneProcess(taskCommonQuery);
|
||||
return page;
|
||||
public Page doneProcess(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
return taskFeignClient.doneProcess(taskCommonQuery);
|
||||
}
|
||||
|
||||
@AutoLog(value = "已发流程")
|
||||
@ApiOperation(value="已发流程", notes="已发流程")
|
||||
@PostMapping("/IssuedProcess")
|
||||
public IPage<BusProcessName> IssuedProcess(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
IPage page = taskFeignClient.issuedProcess(taskCommonQuery);
|
||||
return page;
|
||||
public Page IssuedProcess(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
return taskFeignClient.issuedProcess(taskCommonQuery);
|
||||
}
|
||||
|
||||
@AutoLog(value = "监控流程列表")
|
||||
@ApiOperation(value="监控流程列表", notes="监控流程列表")
|
||||
@PostMapping("/allProcess")
|
||||
public IPage<BusProcessName> allProcess(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
IPage page= taskFeignClient.allProcess(taskCommonQuery);
|
||||
return page;
|
||||
public Page allProcess(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
return taskFeignClient.allProcess(taskCommonQuery);
|
||||
}
|
||||
|
||||
@AutoLog(value = "已办流程-根据taskId查询已办明细")
|
||||
|
||||
+4
-3
@@ -6,6 +6,7 @@ import com.jero.modules.wkflow.entity.BusMes;
|
||||
import com.jero.modules.wkflow.entity.BusProcessName;
|
||||
import com.jero.modules.wkflow.entity.BusProcessNew;
|
||||
import com.jero.modules.wkflow.entity.TaskCommonQuery;
|
||||
import com.jero.modules.wkflow.page.Page;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -70,7 +71,7 @@ public interface TaskFeignClient {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/doneProcess",method = RequestMethod.POST)
|
||||
IPage doneProcess(@RequestBody TaskCommonQuery taskCommonQuery);
|
||||
Page doneProcess(@RequestBody TaskCommonQuery taskCommonQuery);
|
||||
|
||||
/**
|
||||
* 已发流程
|
||||
@@ -78,7 +79,7 @@ public interface TaskFeignClient {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/issuedProcess",method = RequestMethod.POST)
|
||||
IPage issuedProcess(@RequestBody TaskCommonQuery taskCommonQuery);
|
||||
Page issuedProcess(@RequestBody TaskCommonQuery taskCommonQuery);
|
||||
|
||||
/**
|
||||
* 监控流程列表
|
||||
@@ -86,7 +87,7 @@ public interface TaskFeignClient {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/allProcess",method = RequestMethod.POST)
|
||||
IPage allProcess(@RequestBody TaskCommonQuery taskCommonQuery);
|
||||
Page allProcess(@RequestBody TaskCommonQuery taskCommonQuery);
|
||||
|
||||
/**
|
||||
* 已办流程-根据taskId查询已办明细
|
||||
|
||||
+6
-6
@@ -1,12 +1,12 @@
|
||||
package com.jero.modules.wkflow.feginClient.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.modules.wkflow.entity.BusMes;
|
||||
import com.jero.modules.wkflow.entity.BusProcessName;
|
||||
import com.jero.modules.wkflow.entity.BusProcessNew;
|
||||
import com.jero.modules.wkflow.entity.TaskCommonQuery;
|
||||
import com.jero.modules.wkflow.feginClient.TaskFeignClient;
|
||||
import com.jero.modules.wkflow.page.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -84,8 +84,8 @@ public class TaskFeignClientImpl {
|
||||
* @param taskCommonQuery
|
||||
* @return
|
||||
*/
|
||||
public IPage doneProcess(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
IPage busProcessNames = taskFeignClient.doneProcess(taskCommonQuery);
|
||||
public Page doneProcess(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
Page busProcessNames = taskFeignClient.doneProcess(taskCommonQuery);
|
||||
return busProcessNames;
|
||||
}
|
||||
|
||||
@@ -94,8 +94,8 @@ public class TaskFeignClientImpl {
|
||||
* @param taskCommonQuery
|
||||
* @return
|
||||
*/
|
||||
public IPage issuedProcess(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
IPage busProcessNames = taskFeignClient.issuedProcess(taskCommonQuery);
|
||||
public Page issuedProcess(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
Page busProcessNames = taskFeignClient.issuedProcess(taskCommonQuery);
|
||||
return busProcessNames;
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ public class TaskFeignClientImpl {
|
||||
* @param taskCommonQuery
|
||||
* @return
|
||||
*/
|
||||
public IPage allProcess(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
public Page allProcess(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
return taskFeignClient.allProcess(taskCommonQuery);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.jero.modules.wkflow.page;
|
||||
|
||||
import com.jero.modules.wkflow.entity.BusProcessName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Page {
|
||||
private Integer pageNo;
|
||||
private Integer pageSize;
|
||||
private Long count;
|
||||
private List<BusProcessName> list;
|
||||
|
||||
public Integer getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(Integer pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public Long getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public void setCount(Long count) {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public List<BusProcessName> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<BusProcessName> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
public Integer getPageNo() {
|
||||
return pageNo;
|
||||
}
|
||||
|
||||
public void setPageNo(Integer pageNo) {
|
||||
this.pageNo = pageNo;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user