Commit 05a812c3 authored by maoying's avatar maoying

修改巡检定时任务因aop未忽略导致参数异常

parent f9fa00de
...@@ -52,7 +52,9 @@ public class ControllerAop { ...@@ -52,7 +52,9 @@ public class ControllerAop {
@Autowired @Autowired
private RedisUtils redisUtils; private RedisUtils redisUtils;
@Pointcut("execution(public * com.yeejoin.amos.boot.module.*.biz.controller..*(..)) || execution(public * com.yeejoin.amos.*.business.controller..*(..))") @Pointcut("(execution(public * com.yeejoin.amos.boot.module.*.biz.controller..*(..)) "
+ "|| execution(public * com.yeejoin.amos.*.business.controller..*(..)))"
+ " && !@annotation(org.springframework.scheduling.annotation.Scheduled))")
public void userCache() { public void userCache() {
} }
......
...@@ -17,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -17,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
...@@ -52,6 +54,7 @@ public class LatentDangerController extends AbstractBaseController { ...@@ -52,6 +54,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "创建无码无计划隐患", notes = "创建无码无计划隐患") @ApiOperation(value = "创建无码无计划隐患", notes = "创建无码无计划隐患")
@PostMapping(value = "/normal/save") @PostMapping(value = "/normal/save")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse saveNormal(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerNormalParam latentDangerParam) { public CommonResponse saveNormal(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerNormalParam latentDangerParam) {
CommonResponse commonResponse = new CommonResponse(); CommonResponse commonResponse = new CommonResponse();
try { try {
...@@ -80,6 +83,7 @@ public class LatentDangerController extends AbstractBaseController { ...@@ -80,6 +83,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "创建巡检隐患", notes = "创建巡检隐患") @ApiOperation(value = "创建巡检隐患", notes = "创建巡检隐患")
@PostMapping(value = "/patrol/save") @PostMapping(value = "/patrol/save")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse savePatrol(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerPatrolParam latentDangerPatrolParam) { public CommonResponse savePatrol(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerPatrolParam latentDangerPatrolParam) {
try { try {
AgencyUserModel user = getUserInfo(); AgencyUserModel user = getUserInfo();
...@@ -102,6 +106,7 @@ public class LatentDangerController extends AbstractBaseController { ...@@ -102,6 +106,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "隐患列表", notes = "隐患列表") @ApiOperation(value = "隐患列表", notes = "隐患列表")
@PostMapping(value = "/list") @PostMapping(value = "/list")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse list(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerListParam latentDangerListParam) { public CommonResponse list(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerListParam latentDangerListParam) {
Date startDate = new Date(); Date startDate = new Date();
try { try {
...@@ -124,6 +129,7 @@ public class LatentDangerController extends AbstractBaseController { ...@@ -124,6 +129,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "隐患详情", notes = "隐患详情") @ApiOperation(value = "隐患详情", notes = "隐患详情")
@GetMapping(value = "/detail") @GetMapping(value = "/detail")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse detail(@ApiParam(value = "任务Id", required = true) @RequestParam String id, public CommonResponse detail(@ApiParam(value = "任务Id", required = true) @RequestParam String id,
@ApiParam(value = "是否完成", required = true) @RequestParam boolean isFinish) { @ApiParam(value = "是否完成", required = true) @RequestParam boolean isFinish) {
try { try {
...@@ -140,6 +146,7 @@ public class LatentDangerController extends AbstractBaseController { ...@@ -140,6 +146,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "隐患执行记录", notes = "隐患执行记录") @ApiOperation(value = "隐患执行记录", notes = "隐患执行记录")
@GetMapping(value = "/listFlowRecord") @GetMapping(value = "/listFlowRecord")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse listFlowRecord(@ApiParam(value = "隐患编号", required = true) @RequestParam Long id) { public CommonResponse listFlowRecord(@ApiParam(value = "隐患编号", required = true) @RequestParam Long id) {
try { try {
AgencyUserModel user = getUserInfo(); AgencyUserModel user = getUserInfo();
...@@ -155,6 +162,7 @@ public class LatentDangerController extends AbstractBaseController { ...@@ -155,6 +162,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "流程执行", notes = "流程执行") @ApiOperation(value = "流程执行", notes = "流程执行")
@PostMapping(value = "/excute") @PostMapping(value = "/excute")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse excute(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerExcuteParam latentDangerExcuteParam) { public CommonResponse excute(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerExcuteParam latentDangerExcuteParam) {
try { try {
AgencyUserModel user = getUserInfo(); AgencyUserModel user = getUserInfo();
...@@ -186,6 +194,7 @@ public class LatentDangerController extends AbstractBaseController { ...@@ -186,6 +194,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "根据流程实例编号获取隐患信息", notes = "根据流程实例编号获取隐患信息") @ApiOperation(value = "根据流程实例编号获取隐患信息", notes = "根据流程实例编号获取隐患信息")
@GetMapping(value = "/getByInstanceId") @GetMapping(value = "/getByInstanceId")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse getByInstanceId(@ApiParam(value = "流程实例编号", required = true) @RequestParam String instanceId) { public CommonResponse getByInstanceId(@ApiParam(value = "流程实例编号", required = true) @RequestParam String instanceId) {
try { try {
AgencyUserModel user = getUserInfo(); AgencyUserModel user = getUserInfo();
...@@ -201,6 +210,7 @@ public class LatentDangerController extends AbstractBaseController { ...@@ -201,6 +210,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "隐患按错计划流程执行回调", notes = "隐患按错计划流程执行回调") @ApiOperation(value = "隐患按错计划流程执行回调", notes = "隐患按错计划流程执行回调")
@PostMapping(value = "/plan/flow/excuteCallBack") @PostMapping(value = "/plan/flow/excuteCallBack")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse excuteCallBack(@ApiParam(value = "隐患按错计划流程执行回调对象") @RequestBody JSONObject json) { public CommonResponse excuteCallBack(@ApiParam(value = "隐患按错计划流程执行回调对象") @RequestBody JSONObject json) {
try { try {
AgencyUserModel user = getUserInfo(); AgencyUserModel user = getUserInfo();
...@@ -231,6 +241,7 @@ public class LatentDangerController extends AbstractBaseController { ...@@ -231,6 +241,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "获取隐患等级", notes = "获取隐患等级") @ApiOperation(value = "获取隐患等级", notes = "获取隐患等级")
@GetMapping(value = "/dangerLevel") @GetMapping(value = "/dangerLevel")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse getDangerLevel() { public CommonResponse getDangerLevel() {
return CommonResponseUtil.success(iLatentDangerService.getDangerLevel(getToken(), getProduct(), getAppKey(), DictTypeEnum.DANGERLEVEL.getCode())); return CommonResponseUtil.success(iLatentDangerService.getDangerLevel(getToken(), getProduct(), getAppKey(), DictTypeEnum.DANGERLEVEL.getCode()));
} }
...@@ -246,6 +257,7 @@ public class LatentDangerController extends AbstractBaseController { ...@@ -246,6 +257,7 @@ public class LatentDangerController extends AbstractBaseController {
*/ */
@ApiOperation(value = "隐患清单", notes = "隐患清单") @ApiOperation(value = "隐患清单", notes = "隐患清单")
@PostMapping(value = "/page/list") @PostMapping(value = "/page/list")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse listDanger(@ApiParam(value = "查询条件", required = true) @RequestBody PageParam pageParam) { public CommonResponse listDanger(@ApiParam(value = "查询条件", required = true) @RequestBody PageParam pageParam) {
AgencyUserModel user = getUserInfo(); AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) { if (ObjectUtils.isEmpty(user)) {
...@@ -260,6 +272,7 @@ public class LatentDangerController extends AbstractBaseController { ...@@ -260,6 +272,7 @@ public class LatentDangerController extends AbstractBaseController {
*/ */
@ApiOperation(value = "导出隐患清单", notes = "导出隐患清单") @ApiOperation(value = "导出隐患清单", notes = "导出隐患清单")
@PostMapping(value = "/export") @PostMapping(value = "/export")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public void exportDangerList(@ApiParam(value = "查询条件") @RequestBody PageParam pageParam, public void exportDangerList(@ApiParam(value = "查询条件") @RequestBody PageParam pageParam,
HttpServletResponse response) { HttpServletResponse response) {
AgencyUserModel user = getUserInfo(); AgencyUserModel user = getUserInfo();
...@@ -286,6 +299,7 @@ public class LatentDangerController extends AbstractBaseController { ...@@ -286,6 +299,7 @@ public class LatentDangerController extends AbstractBaseController {
*/ */
@ApiOperation(value = "隐患日志", notes = "查询隐患节点信息") @ApiOperation(value = "隐患日志", notes = "查询隐患节点信息")
@GetMapping(value = "/listDangerTimeAxis") @GetMapping(value = "/listDangerTimeAxis")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse listTimeAxis(@ApiParam(value = "时间") @RequestParam(required = false) Integer dateTime) { public CommonResponse listTimeAxis(@ApiParam(value = "时间") @RequestParam(required = false) Integer dateTime) {
AgencyUserModel user = getUserInfo(); AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) { if (ObjectUtils.isEmpty(user)) {
......
...@@ -32,6 +32,8 @@ import org.springframework.data.domain.Page; ...@@ -32,6 +32,8 @@ import org.springframework.data.domain.Page;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
...@@ -206,6 +208,8 @@ public class PlanTaskController extends AbstractBaseController { ...@@ -206,6 +208,8 @@ public class PlanTaskController extends AbstractBaseController {
@RequestMapping(value = "/queryOmission", method = RequestMethod.GET, produces = "application/json;charset=UTF-8") @RequestMapping(value = "/queryOmission", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
public CommonResponse pushCarData() { public CommonResponse pushCarData() {
try { try {
RequestAttributes reqs = RequestContextHolder.getRequestAttributes();
RequestContextHolder.setRequestAttributes(reqs, true);
planTaskService.taskExecution(null); planTaskService.taskExecution(null);
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} catch (Exception e) { } catch (Exception e) {
......
...@@ -802,7 +802,9 @@ public class TaskController extends AbstractBaseController{ ...@@ -802,7 +802,9 @@ public class TaskController extends AbstractBaseController{
String userIds=""; String userIds="";
Set<String> set = new HashSet<>(); Set<String> set = new HashSet<>();
list.forEach(s -> { list.forEach(s -> {
set.add(s.getName()); if(!ObjectUtils.isEmpty(s)){
set.add(s.getName());
}
}); });
List<String> list1 = new ArrayList<>(set); List<String> list1 = new ArrayList<>(set);
......
...@@ -176,7 +176,7 @@ public Page<HashMap<String, Object>> getCatalogTreeInfo(String toke,String produ ...@@ -176,7 +176,7 @@ public Page<HashMap<String, Object>> getCatalogTreeInfo(String toke,String produ
String userIds = ""; String userIds = "";
Set<String> set = new HashSet<>(); Set<String> set = new HashSet<>();
content.forEach(s -> { content.forEach(s -> {
if (s.containsKey("createBy")) { if (s.containsKey("createBy") && !ObjectUtils.isEmpty(s.get("createBy"))) {
set.add(s.get("createBy").toString()); set.add(s.get("createBy").toString());
} }
}); });
......
...@@ -161,7 +161,7 @@ public class CheckServiceImpl implements ICheckService { ...@@ -161,7 +161,7 @@ public class CheckServiceImpl implements ICheckService {
deptIds.remove(null); deptIds.remove(null);
String joinUserId=""; String joinUserId="";
for (String userId:userIds) { for (String userId:userIds) {
if(userId!=null&&!userId.trim().equals("")){ if(!ObjectUtils.isEmpty(userId)){
joinUserId=joinUserId+userId+","; joinUserId=joinUserId+userId+",";
} }
} }
...@@ -808,7 +808,7 @@ public class CheckServiceImpl implements ICheckService { ...@@ -808,7 +808,7 @@ public class CheckServiceImpl implements ICheckService {
deptIds.remove(null); deptIds.remove(null);
String joinUserId=""; String joinUserId="";
for (String userId:userIds) { for (String userId:userIds) {
if(userId!=null&&!userId.trim().equals("")){ if(!ObjectUtils.isEmpty(userId)){
joinUserId=joinUserId+userId+","; joinUserId=joinUserId+userId+",";
} }
} }
...@@ -1194,8 +1194,9 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1194,8 +1194,9 @@ public class CheckServiceImpl implements ICheckService {
//处理用户信息 //处理用户信息
String userIds=""; String userIds="";
Set<String> set = new HashSet<>(); Set<String> set = new HashSet<>();
set.add(checkDetailBo.getCheckUserName()); if(!ObjectUtils.isEmpty(checkDetailBo.getCheckUserName())){
set.add(checkDetailBo.getCheckUserName());
}
List<String> list1 = new ArrayList<>(set); List<String> list1 = new ArrayList<>(set);
userIds = String.join(",", list1); userIds = String.join(",", list1);
List<AgencyUserModel> listd=remoteSecurityService.listUserByUserIds( toke,product,appKey,userIds); List<AgencyUserModel> listd=remoteSecurityService.listUserByUserIds( toke,product,appKey,userIds);
...@@ -1315,7 +1316,9 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1315,7 +1316,9 @@ public class CheckServiceImpl implements ICheckService {
if (!CollectionUtils.isEmpty(content)) { if (!CollectionUtils.isEmpty(content)) {
Set<String> userIds =new HashSet<>(); Set<String> userIds =new HashSet<>();
content.forEach(e -> { content.forEach(e -> {
userIds.add(e.get("userID")+""); if(!ObjectUtils.isEmpty(e.get("userID"))){
userIds.add(e.get("userID")+"");
}
}); });
List<AgencyUserModel> userModels = remoteSecurityService.listUserByUserIds( toke, product, appKey,Joiner.on(",").join(userIds)); List<AgencyUserModel> userModels = remoteSecurityService.listUserByUserIds( toke, product, appKey,Joiner.on(",").join(userIds));
Map<String, String> userModelMap = new HashMap<String,String>(); Map<String, String> userModelMap = new HashMap<String,String>();
...@@ -1512,7 +1515,9 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1512,7 +1515,9 @@ public class CheckServiceImpl implements ICheckService {
String userIds=""; String userIds="";
Set<String> set = new HashSet<>(); Set<String> set = new HashSet<>();
checkAnalysisVos.forEach(s -> { checkAnalysisVos.forEach(s -> {
set.add(s.getName()); if(!ObjectUtils.isEmpty(s.getName())){
set.add(s.getName());
}
}); });
List<String> list1 = new ArrayList<>(set); List<String> list1 = new ArrayList<>(set);
userIds = String.join(",", list1); userIds = String.join(",", list1);
......
...@@ -151,9 +151,11 @@ public class MessageServiceImpl implements IMessageService { ...@@ -151,9 +151,11 @@ public class MessageServiceImpl implements IMessageService {
// List<PushTargetBo> jpushUser = msgMapper.getPushUserBo("app", String.join(",", needUserIds), checkMsgBo.getRouteId(),getAppPushConfig(checkMsgBo.getStatus())); // List<PushTargetBo> jpushUser = msgMapper.getPushUserBo("app", String.join(",", needUserIds), checkMsgBo.getRouteId(),getAppPushConfig(checkMsgBo.getStatus()));
List<PushTargetBo> jpushUser = new ArrayList<>(); List<PushTargetBo> jpushUser = new ArrayList<>();
needUserIds.stream().forEach(action->{ needUserIds.stream().forEach(action->{
PushTargetBo pb = new PushTargetBo(); if(!ObjectUtils.isEmpty(action)){
pb.setUserId(action); PushTargetBo pb = new PushTargetBo();
jpushUser.add(pb); pb.setUserId(action);
jpushUser.add(pb);
}
}); });
//获取需要推送的email的用户 //获取需要推送的email的用户
List<PushTargetBo> emailUser = msgMapper.getPushUserBo("email", String.join(",", needUserIds), checkMsgBo.getRouteId(),getEmailPushConfig(checkMsgBo.getStatus())); List<PushTargetBo> emailUser = msgMapper.getPushUserBo("email", String.join(",", needUserIds), checkMsgBo.getRouteId(),getEmailPushConfig(checkMsgBo.getStatus()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment