| | |
| | | import com.product.quartz.service.impl.SysJobService; |
| | | import com.product.util.BaseUtil; |
| | | import com.product.util.SystemParamReplace; |
| | | import com.product.util.UnifySQLFunction; |
| | | |
| | | import org.apache.commons.codec.binary.Base64; |
| | | import org.quartz.SchedulerException; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | */ |
| | | @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("发送消息,失败"); |
| | |
| | | sql.append("\n select org_level_code from product_sys_staffs sc inner join product_sys_org_levels d on sc.dept_uuid=d.uuid and sc.is_dept_manage=1 and user_id=?"); |
| | | sql.append("\n ) o on s.tricode like concat(o.org_level_code,'%')"); |
| | | sql.append("\n union all"); |
| | | sql.append("\n select ? from dual"); |
| | | sql.append("\n ").append(UnifySQLFunction.dualFunction("?")); |
| | | sql.append("\n) u on concat(',',i.receiver,',') like concat('%,',u.user_id,',%')"); |
| | | sql.append("\nwhere early_warning_uuid is not null"); |
| | | |