| | |
| | | */ |
| | | @Transactional |
| | | public boolean updateWarning(FieldSetEntity fse) throws BaseException, SchedulerException, TaskException { |
| | | FieldSetEntity fseJob = new FieldSetEntity(); |
| | | fseJob.setTableName("product_sys_timed_task"); |
| | | fseJob.setValue("concurrent", 1); |
| | | fseJob.setValue("job_name", fse.getString("config_name")); |
| | | fseJob.setValue("cron_expression", fse.getString("execution_frequency")); |
| | | fseJob.setValue("invoke_target", "warnTask.triggerSingleWarningTask('" + fse.getUUID() + "')"); |
| | | fseJob.setValue("job_group", "system"); |
| | | fseJob.setValue("misfire_policy", 2); |
| | | fseJob.setValue("remark", ""); |
| | | if (fse.getInteger("config_status") == 0) { |
| | | fseJob.setValue("status", 0); |
| | | sysJobService.pauseJob(fse.getString("time_task_uuid")); |
| | | } else { |
| | | fseJob.setValue("status", 1); |
| | | sysJobService.resumeJob(fse.getString("time_task_uuid")); |
| | | if (fse.getString("type").equals("0")) { |
| | | FieldSetEntity fseJob = new FieldSetEntity(); |
| | | fseJob.setTableName("product_sys_timed_task"); |
| | | fseJob.setValue("concurrent", 1); |
| | | fseJob.setValue("job_name", fse.getString("config_name")); |
| | | fseJob.setValue("cron_expression", fse.getString("execution_frequency")); |
| | | fseJob.setValue("invoke_target", "warnTask.triggerSingleWarningTask('" + fse.getUUID() + "')"); |
| | | fseJob.setValue("job_group", "system"); |
| | | fseJob.setValue("misfire_policy", 2); |
| | | fseJob.setValue("remark", ""); |
| | | if (fse.getInteger("config_status") == 0) { |
| | | fseJob.setValue("status", 0); |
| | | sysJobService.pauseJob(fse.getString("time_task_uuid")); |
| | | } else { |
| | | fseJob.setValue("status", 1); |
| | | sysJobService.resumeJob(fse.getString("time_task_uuid")); |
| | | } |
| | | fseJob.setValue("is_conceal", 1); |
| | | fseJob.setValue("uuid", fse.getString("time_task_uuid")); |
| | | sysJobService.updateJob(fseJob); |
| | | } |
| | | fseJob.setValue("is_conceal", 1); |
| | | fseJob.setValue("uuid", fse.getString("time_task_uuid")); |
| | | sysJobService.updateJob(fseJob); |
| | | |
| | | fse.setValue(CmnConst.UPDATED_BY, SpringMVCContextHolder.getCurrentUser().getUser_id()); |
| | | fse.setValue(CmnConst.UPDATED_UTC_DATETIME, new Date()); |
| | | return baseDao.update(fse); |
| | |
| | | StaffManagerService staffManagerService; |
| | | |
| | | public void sendWarnFeedBackMessage(FieldSetEntity fse) throws BaseException { |
| | | String userId = String.valueOf(SpringMVCContextHolder.getCurrentUser().getUser_id()); |
| | | fse.setValue( CmnConst.USER_ID,userId);//当前人作为消息发送人,其它预警接收人作为收消息人 |
| | | String parent_uuid = fse.getString("puuid"); |
| | | Set<String> receiverSet = this.getReceiver(fse.getString("parent_uuid")); |
| | | if (StringUtils.isEmpty(parent_uuid)) { |
| | |
| | | if (!StringUtils.isEmpty(leaderUserId)) { |
| | | receiverSet.add(leaderUserId); |
| | | } |
| | | String userId = String.valueOf(SpringMVCContextHolder.getCurrentUser().getUser_id()); |
| | | receiverSet.remove(userId); |
| | | if(receiverSet.isEmpty()){ |
| | | logger.error("发送消息,失败"); |