雷达原始数据列表查询
parent
4576035a3b
commit
cc0cb860ec
|
|
@ -4,6 +4,7 @@ import com.ruoyi.common.annotation.Log;
|
|||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.PrimaryRadarData;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.exception.job.TaskException;
|
||||
|
|
@ -13,6 +14,7 @@ import com.ruoyi.quartz.domain.SysJob;
|
|||
import com.ruoyi.quartz.service.ISysJobService;
|
||||
import com.ruoyi.quartz.util.CronUtils;
|
||||
import com.ruoyi.quartz.util.ScheduleUtils;
|
||||
import com.ruoyi.system.service.PrimaryRadarDataService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.quartz.SchedulerException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -36,7 +38,7 @@ public class SysRadarDataController extends BaseController
|
|||
|
||||
|
||||
@Autowired
|
||||
private ISysJobService jobService;
|
||||
private PrimaryRadarDataService primaryRadarDataService;
|
||||
|
||||
@GetMapping()
|
||||
public String job()
|
||||
|
|
@ -46,197 +48,10 @@ public class SysRadarDataController extends BaseController
|
|||
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(SysJob job)
|
||||
public TableDataInfo list(PrimaryRadarData primaryRadarData)
|
||||
{
|
||||
startPage();
|
||||
List<SysJob> list = jobService.selectJobList(job);
|
||||
List<PrimaryRadarData> list = primaryRadarDataService.selectPrimaryRadarDataList(primaryRadarData);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Log(title = "定时任务", businessType = BusinessType.EXPORT)
|
||||
@RequiresPermissions("monitor:job:export")
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(SysJob job)
|
||||
{
|
||||
List<SysJob> list = jobService.selectJobList(job);
|
||||
ExcelUtil<SysJob> util = new ExcelUtil<SysJob>(SysJob.class);
|
||||
return util.exportExcel(list, "定时任务");
|
||||
}
|
||||
|
||||
@Log(title = "定时任务", businessType = BusinessType.DELETE)
|
||||
@RequiresPermissions("monitor:job:remove")
|
||||
@PostMapping("/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids) throws SchedulerException
|
||||
{
|
||||
jobService.deleteJobByIds(ids);
|
||||
return success();
|
||||
}
|
||||
|
||||
@RequiresPermissions("monitor:job:detail")
|
||||
@GetMapping("/detail/{jobId}")
|
||||
public String detail(@PathVariable("jobId") Long jobId, ModelMap mmap)
|
||||
{
|
||||
mmap.put("name", "job");
|
||||
mmap.put("job", jobService.selectJobById(jobId));
|
||||
return prefix + "/detail";
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务调度状态修改
|
||||
*/
|
||||
@Log(title = "定时任务", businessType = BusinessType.UPDATE)
|
||||
@RequiresPermissions("monitor:job:changeStatus")
|
||||
@PostMapping("/changeStatus")
|
||||
@ResponseBody
|
||||
public AjaxResult changeStatus(SysJob job) throws SchedulerException
|
||||
{
|
||||
SysJob newJob = jobService.selectJobById(job.getJobId());
|
||||
newJob.setStatus(job.getStatus());
|
||||
return toAjax(jobService.changeStatus(newJob));
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务调度立即执行一次
|
||||
*/
|
||||
@Log(title = "定时任务", businessType = BusinessType.UPDATE)
|
||||
@RequiresPermissions("monitor:job:changeStatus")
|
||||
@PostMapping("/run")
|
||||
@ResponseBody
|
||||
public AjaxResult run(SysJob job) throws SchedulerException
|
||||
{
|
||||
boolean result = jobService.run(job);
|
||||
return result ? success() : error("任务不存在或已过期!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增调度
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存调度
|
||||
*/
|
||||
@Log(title = "定时任务", businessType = BusinessType.INSERT)
|
||||
@RequiresPermissions("monitor:job:add")
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(@Validated SysJob job) throws SchedulerException, TaskException
|
||||
{
|
||||
if (!CronUtils.isValid(job.getCronExpression()))
|
||||
{
|
||||
return error("新增任务'" + job.getJobName() + "'失败,Cron表达式不正确");
|
||||
}
|
||||
else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI))
|
||||
{
|
||||
return error("新增任务'" + job.getJobName() + "'失败,目标字符串不允许'rmi'调用");
|
||||
}
|
||||
else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[] { Constants.LOOKUP_LDAP, Constants.LOOKUP_LDAPS }))
|
||||
{
|
||||
return error("新增任务'" + job.getJobName() + "'失败,目标字符串不允许'ldap(s)'调用");
|
||||
}
|
||||
else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[] { Constants.HTTP, Constants.HTTPS }))
|
||||
{
|
||||
return error("新增任务'" + job.getJobName() + "'失败,目标字符串不允许'http(s)'调用");
|
||||
}
|
||||
else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), Constants.JOB_ERROR_STR))
|
||||
{
|
||||
return error("新增任务'" + job.getJobName() + "'失败,目标字符串存在违规");
|
||||
}
|
||||
else if (!ScheduleUtils.whiteList(job.getInvokeTarget()))
|
||||
{
|
||||
return error("新增任务'" + job.getJobName() + "'失败,目标字符串不在白名单内");
|
||||
}
|
||||
job.setCreateBy(getLoginName());
|
||||
return toAjax(jobService.insertJob(job));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改调度
|
||||
*/
|
||||
@RequiresPermissions("monitor:job:edit")
|
||||
@GetMapping("/edit/{jobId}")
|
||||
public String edit(@PathVariable("jobId") Long jobId, ModelMap mmap)
|
||||
{
|
||||
mmap.put("job", jobService.selectJobById(jobId));
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存调度
|
||||
*/
|
||||
@Log(title = "定时任务", businessType = BusinessType.UPDATE)
|
||||
@RequiresPermissions("monitor:job:edit")
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(@Validated SysJob job) throws SchedulerException, TaskException
|
||||
{
|
||||
if (!CronUtils.isValid(job.getCronExpression()))
|
||||
{
|
||||
return error("修改任务'" + job.getJobName() + "'失败,Cron表达式不正确");
|
||||
}
|
||||
else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI))
|
||||
{
|
||||
return error("修改任务'" + job.getJobName() + "'失败,目标字符串不允许'rmi'调用");
|
||||
}
|
||||
else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[] { Constants.LOOKUP_LDAP, Constants.LOOKUP_LDAPS }))
|
||||
{
|
||||
return error("修改任务'" + job.getJobName() + "'失败,目标字符串不允许'ldap'调用");
|
||||
}
|
||||
else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[] { Constants.HTTP, Constants.HTTPS }))
|
||||
{
|
||||
return error("修改任务'" + job.getJobName() + "'失败,目标字符串不允许'http(s)'调用");
|
||||
}
|
||||
else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), Constants.JOB_ERROR_STR))
|
||||
{
|
||||
return error("修改任务'" + job.getJobName() + "'失败,目标字符串存在违规");
|
||||
}
|
||||
else if (!ScheduleUtils.whiteList(job.getInvokeTarget()))
|
||||
{
|
||||
return error("修改任务'" + job.getJobName() + "'失败,目标字符串不在白名单内");
|
||||
}
|
||||
return toAjax(jobService.updateJob(job));
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验cron表达式是否有效
|
||||
*/
|
||||
@PostMapping("/checkCronExpressionIsValid")
|
||||
@ResponseBody
|
||||
public boolean checkCronExpressionIsValid(SysJob job)
|
||||
{
|
||||
return jobService.checkCronExpressionIsValid(job.getCronExpression());
|
||||
}
|
||||
|
||||
/**
|
||||
* Cron表达式在线生成
|
||||
*/
|
||||
@GetMapping("/cron")
|
||||
public String cron()
|
||||
{
|
||||
return prefix + "/cron";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询cron表达式近5次的执行时间
|
||||
*/
|
||||
@GetMapping("/queryCronExpression")
|
||||
@ResponseBody
|
||||
public AjaxResult queryCronExpression(@RequestParam(value = "cronExpression", required = false) String cronExpression)
|
||||
{
|
||||
if (jobService.checkCronExpressionIsValid(cronExpression))
|
||||
{
|
||||
List<String> dateList = CronUtils.getRecentTriggerTime(cronExpression);
|
||||
return success(dateList);
|
||||
}
|
||||
else
|
||||
{
|
||||
return error("表达式无效");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,39 +90,39 @@
|
|||
title: '包号/架号'
|
||||
},
|
||||
{
|
||||
field: 'jobName',
|
||||
field: 'number',
|
||||
title: '天线号',
|
||||
},
|
||||
{
|
||||
field: '1',
|
||||
field: 'tagId',
|
||||
title: 'ID号',
|
||||
},
|
||||
{
|
||||
field: '2',
|
||||
field: 'value1',
|
||||
title: '峰1幅度',
|
||||
},
|
||||
{
|
||||
field: '3',
|
||||
field: 'value2',
|
||||
title: '峰2幅度',
|
||||
},
|
||||
{
|
||||
field: '4',
|
||||
field: 'value3',
|
||||
title: '峰3幅度',
|
||||
},
|
||||
{
|
||||
field: '5',
|
||||
field: 'value4',
|
||||
title: '峰4幅度',
|
||||
},
|
||||
{
|
||||
field: '6',
|
||||
field: 'value5',
|
||||
title: '峰5幅度',
|
||||
},
|
||||
{
|
||||
field: '7',
|
||||
field: 'baseline',
|
||||
title: 'BaseLine',
|
||||
},
|
||||
{
|
||||
field: '8',
|
||||
field: 'queryFre',
|
||||
title: '实时频率',
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.system.mapper;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.NormalIdentifier;
|
||||
import com.ruoyi.common.core.domain.entity.PrimaryRadarData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -18,5 +19,5 @@ public interface PrimaryRadarDataMapper
|
|||
|
||||
int updateNormalIdentifier(NormalIdentifier normalIdentifier);
|
||||
|
||||
List<NormalIdentifier> selectNormalIdentifierList(NormalIdentifier normalIdentifier);
|
||||
List<PrimaryRadarData> selectPrimaryRadarDataList(PrimaryRadarData primaryRadarData);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.NormalIdentifier;
|
||||
import com.ruoyi.common.core.domain.entity.PrimaryRadarData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -11,7 +12,7 @@ import java.util.List;
|
|||
*/
|
||||
public interface PrimaryRadarDataService
|
||||
{
|
||||
public List<NormalIdentifier> selectNormalIdentifierList(NormalIdentifier normalIdentifier);
|
||||
public List<PrimaryRadarData> selectPrimaryRadarDataList(PrimaryRadarData primaryRadarData);
|
||||
|
||||
int insertNormalIdentifier(NormalIdentifier normalIdentifier);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.NormalIdentifier;
|
||||
import com.ruoyi.common.core.domain.entity.PrimaryRadarData;
|
||||
import com.ruoyi.system.mapper.NormalIdentifierMapper;
|
||||
import com.ruoyi.system.mapper.PrimaryRadarDataMapper;
|
||||
import com.ruoyi.system.service.NormalIdentifierService;
|
||||
import com.ruoyi.system.service.PrimaryRadarDataService;
|
||||
import org.slf4j.Logger;
|
||||
|
|
@ -23,7 +25,7 @@ public class PrimaryRadarDataServiceImpl implements PrimaryRadarDataService
|
|||
private static final Logger log = LoggerFactory.getLogger(PrimaryRadarDataServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private NormalIdentifierMapper normalIdentifierMapper;
|
||||
private PrimaryRadarDataMapper primaryRadarDataMapper;
|
||||
|
||||
@Autowired
|
||||
protected Validator validator;
|
||||
|
|
@ -31,28 +33,28 @@ public class PrimaryRadarDataServiceImpl implements PrimaryRadarDataService
|
|||
/**
|
||||
* 根据条件分页查询高温标识器列表
|
||||
*
|
||||
* @param normalIdentifier 用户信息
|
||||
* @return 用户信息集合信息
|
||||
* @param primaryRadarData 原始数据信息
|
||||
* @return 原始数据信息集合
|
||||
*/
|
||||
@Override
|
||||
public List<NormalIdentifier> selectNormalIdentifierList(NormalIdentifier normalIdentifier) {
|
||||
return normalIdentifierMapper.selectNormalIdentifierList(normalIdentifier);
|
||||
public List<PrimaryRadarData> selectPrimaryRadarDataList(PrimaryRadarData primaryRadarData) {
|
||||
return primaryRadarDataMapper.selectPrimaryRadarDataList(primaryRadarData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertNormalIdentifier(NormalIdentifier normalIdentifier) {
|
||||
int rows = normalIdentifierMapper.insertNormalIdentifier(normalIdentifier);
|
||||
int rows = primaryRadarDataMapper.insertNormalIdentifier(normalIdentifier);
|
||||
return rows;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateUser(NormalIdentifier normalIdentifier) {
|
||||
return normalIdentifierMapper.updateNormalIdentifier(normalIdentifier);
|
||||
return primaryRadarDataMapper.updateNormalIdentifier(normalIdentifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NormalIdentifier selectIdentifierById(Long id) {
|
||||
|
||||
return normalIdentifierMapper.selectNormalIdentifierById(id);
|
||||
return primaryRadarDataMapper.selectNormalIdentifierById(id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,51 +23,57 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<select id="selectNormalIdentifierList" resultMap="PrimaryRadarDataResult">
|
||||
select n.id,n.normal_id,n.normal_two,n.normal_three,n.normal_four,n.normal_number,n.create_by,n.create_time,n.update_by,n.update_time,n.remark,n.del_flag from sys_normalIdentifier n
|
||||
where n.del_flag = '0'
|
||||
<if test="normalNumber != null and normalNumber != ''">
|
||||
AND n.normal_number like concat('%',#{normalNumber}, '%')
|
||||
</if>
|
||||
<if test="normalId != null and normalId != ''">
|
||||
AND n.normal_id like concat('%',#{normalId}, '%') or
|
||||
n.normal_two like concat('%',#{normalId}, '%') or
|
||||
n.normal_three like concat('%',#{normalId}, '%') or
|
||||
n.normal_four like concat('%',#{normalId}, '%')
|
||||
</if>
|
||||
<select id="selectPrimaryRadarDataList" resultMap="PrimaryRadarDataResult">
|
||||
select p.id,p.tag_id,p.value1,p.value2,p.value3,p.value4,p.value5,p.base_line,p.query_fre,p.number,p.create_by,p.create_time,p.update_by,p.update_time,p.remark,p.del_flag from sys_primary_radar_data p
|
||||
where p.del_flag = '0'
|
||||
<!-- <if test="normalNumber != null and normalNumber != ''">-->
|
||||
<!-- AND n.normal_number like concat('%',#{normalNumber}, '%')-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="normalId != null and normalId != ''">-->
|
||||
<!-- AND n.normal_id like concat('%',#{normalId}, '%') or-->
|
||||
<!-- n.normal_two like concat('%',#{normalId}, '%') or-->
|
||||
<!-- n.normal_three like concat('%',#{normalId}, '%') or-->
|
||||
<!-- n.normal_four like concat('%',#{normalId}, '%')-->
|
||||
<!-- </if>-->
|
||||
order by i.id asc
|
||||
</select>
|
||||
|
||||
<insert id="insertNormalIdentifier">
|
||||
<insert id="insertPrimaryRadarData">
|
||||
|
||||
insert into sys_normalIdentifier(
|
||||
<if test="id != null and id != 0">id,</if>
|
||||
<if test="normalId != null and normalId != ''">normal_id,</if>
|
||||
<if test="normalTwo != null and normalTwo != ''">normal_two,</if>
|
||||
<if test="normalThree != null and normalThree != ''">normal_three,</if>
|
||||
<if test="normalFour != null and normalFour != ''">normal_four,</if>
|
||||
<if test="normalNumber != null and normalNumber != ''">normal_number,</if>
|
||||
<if test="value1 != null and value1 != ''">value1,</if>
|
||||
<if test="value2 != null and value2 != ''">value2,</if>
|
||||
<if test="value3 != null and value3 != ''">value3,</if>
|
||||
<if test="value4 != null and value4 != ''">value4,</if>
|
||||
<if test="value5 != null and value5 != ''">value5,</if>
|
||||
<if test="baseLine != null and baseLine != ''">base_line,</if>
|
||||
<if test="queryFre != null and queryFre != ''">query_fre,</if>
|
||||
<if test="number != null and number != ''">number,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="id != null and id != 0">#{id},</if>
|
||||
<if test="normalId != null and normalId != ''">#{normalId},</if>
|
||||
<if test="normalTwo != null and normalTwo != ''">#{normalTwo},</if>
|
||||
<if test="normalThree != null and normalThree != ''">#{normalThree},</if>
|
||||
<if test="normalFour != null and normalFour != ''">#{normalFour},</if>
|
||||
<if test="normalNumber != null and normalNumber != ''">#{normalNumber},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},#,</if>
|
||||
<if test="value1 != null and value1 != ''">#{value1},</if>
|
||||
<if test="value2 != null and value2 != ''">#{value2},</if>
|
||||
<if test="value3 != null and value3 != ''">#{value3},</if>
|
||||
<if test="value4 != null and value4 != ''">#{value4},</if>
|
||||
<if test="value5 != null and value5 != ''">#{value5},</if>
|
||||
<if test="baseLine != null and baseLine != ''">#{baseLine},</if>
|
||||
<if test="queryFre != null and queryFre != ''">#{queryFre},</if>
|
||||
<if test="number != null and number != ''">#{number},</if>
|
||||
<if test="createBy!= null and createBy!= ''">#{createBy},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="selectNormalIdentifierById" resultMap="PrimaryRadarDataResult">
|
||||
<select id="selectPrimaryRadarDataById" resultMap="PrimaryRadarDataResult">
|
||||
select n.id,n.normal_id,n.normal_two,n.normal_three,n.normal_four,n.normal_number,n.create_by,n.create_time,n.update_by,n.update_time,n.remark,n.del_flag from sys_normalIdentifier n where n.id = #{id}
|
||||
</select>
|
||||
|
||||
<update id="updateNormalIdentifier">
|
||||
<update id="updatePrimaryRadarData">
|
||||
update sys_normalIdentifier
|
||||
<set>
|
||||
<if test="normalId != null and normalId != ''"> normal_id = #{normalId},</if>
|
||||
|
|
|
|||
Loading…
Reference in New Issue