修改由于定时任务下无当前登录用户,导致代码报错的bug
This commit is contained in:
parent
5a3a8a2bf3
commit
a73575dbce
@ -171,8 +171,8 @@ public class ReceiverUserController extends DefaultBaseController {
|
|||||||
* 任务执行状态监测
|
* 任务执行状态监测
|
||||||
* 通过获取任务下派时设置的下派超时限制与当前时间做计算来判断是否超时(是否即将超时)
|
* 通过获取任务下派时设置的下派超时限制与当前时间做计算来判断是否超时(是否即将超时)
|
||||||
*/
|
*/
|
||||||
@Scheduled(cron = "0 0/5 * * * ?")
|
// @Scheduled(cron = "0 0/5 * * * ?")
|
||||||
// @Scheduled(cron = "0/5 * * * * ?")
|
@Scheduled(cron = "0/5 * * * * ?")
|
||||||
@Async
|
@Async
|
||||||
public void executeStatusTasks() throws ParseException {
|
public void executeStatusTasks() throws ParseException {
|
||||||
System.err.println("----------任务执行状态监测开始----------");
|
System.err.println("----------任务执行状态监测开始----------");
|
||||||
|
@ -16,6 +16,8 @@ import com.github.pagehelper.PageHelper;
|
|||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.core.Authentication;
|
||||||
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@ -53,8 +55,9 @@ public class DistributeSubServiceImpl extends DefaultBaseService implements IDis
|
|||||||
String distributeSubId = UUIDUtil.getUUID();
|
String distributeSubId = UUIDUtil.getUUID();
|
||||||
Map<String, Object> params = HashMapUtil.beanToMap(distributeSubVO);
|
Map<String, Object> params = HashMapUtil.beanToMap(distributeSubVO);
|
||||||
params.put("distributeSubId", distributeSubId);
|
params.put("distributeSubId", distributeSubId);
|
||||||
|
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||||
try {
|
try {
|
||||||
if (null == securityComponent) {
|
if (null != authentication) {
|
||||||
if (StringUtils.isBlank(token)) {
|
if (StringUtils.isBlank(token)) {
|
||||||
setSaveInfo(params);
|
setSaveInfo(params);
|
||||||
} else {
|
} else {
|
||||||
|
@ -27,6 +27,8 @@ import com.github.pagehelper.PageHelper;
|
|||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.core.Authentication;
|
||||||
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
@ -77,8 +79,9 @@ public class ReceiverUserServiceImpl extends DefaultBaseService implements IRece
|
|||||||
String receiverUserId = UUIDUtil.getUUID();
|
String receiverUserId = UUIDUtil.getUUID();
|
||||||
Map<String, Object> params = HashMapUtil.beanToMap(receiverUserVO);
|
Map<String, Object> params = HashMapUtil.beanToMap(receiverUserVO);
|
||||||
params.put("receiverUserId", receiverUserId);
|
params.put("receiverUserId", receiverUserId);
|
||||||
|
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||||
try {
|
try {
|
||||||
if (null == securityComponent) {
|
if (null != authentication) {
|
||||||
if (StringUtils.isBlank(token)) {
|
if (StringUtils.isBlank(token)) {
|
||||||
setSaveInfo(params);
|
setSaveInfo(params);
|
||||||
} else {
|
} else {
|
||||||
|
@ -17,6 +17,8 @@ import com.github.pagehelper.PageHelper;
|
|||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.core.Authentication;
|
||||||
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@ -54,8 +56,9 @@ public class UrgeServiceImpl extends DefaultBaseService implements IUrgeService
|
|||||||
String urgeId = UUIDUtil.getUUID();
|
String urgeId = UUIDUtil.getUUID();
|
||||||
Map<String, Object> params = HashMapUtil.beanToMap(urgeVO);
|
Map<String, Object> params = HashMapUtil.beanToMap(urgeVO);
|
||||||
params.put("urgeId", urgeId);
|
params.put("urgeId", urgeId);
|
||||||
|
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||||
try {
|
try {
|
||||||
if (null == securityComponent) {
|
if (null != authentication) {
|
||||||
if (StringUtils.isBlank(token)) {
|
if (StringUtils.isBlank(token)) {
|
||||||
setSaveInfo(params);
|
setSaveInfo(params);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user