Merge remote-tracking branch 'origin/jtdev' into jtdev
8 files modified
15 files added
| New file |
| | |
| | | package cn.gistack.sm.alarmRule.controller; |
| | | |
| | | import cn.gistack.sm.alarmRule.entity.AlarmRecord; |
| | | import cn.gistack.sm.alarmRule.service.AlarmRecordService; |
| | | import cn.gistack.sm.alarmRule.vo.AlarmRecordVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * 告警记录控制层 |
| | | * @author zhongrj |
| | | * @date 2023-05-23 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/alarmRecord/alarmRecord") |
| | | public class AlarmRecordController extends BladeController { |
| | | |
| | | private final AlarmRecordService alarmRecordService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | | * |
| | | * @param alarmRecord |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="告警记录-分页列表查询", notes="告警记录-分页列表查询") |
| | | @GetMapping(value = "/list") |
| | | public R queryPageList(AlarmRecord alarmRecord, Query query) { |
| | | IPage<AlarmRecord> pageList = alarmRecordService.page(Condition.getPage(query), Condition.getQueryWrapper(alarmRecord)); |
| | | return R.data(pageList); |
| | | } |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * @param query |
| | | * @param alarmRecord |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="告警记录-自定义分页列表查询", notes="告警记录-自定义分页列表查询") |
| | | @GetMapping(value = "/page") |
| | | public R page(AlarmRecordVO alarmRecord, Query query) { |
| | | return R.data( alarmRecordService.selectAlarmRecordPage(Condition.getPage(query),alarmRecord)); |
| | | } |
| | | |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @param alarmRecord |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="告警记录-添加", notes="告警记录-添加") |
| | | @PostMapping(value = "/add") |
| | | public R add(@RequestBody AlarmRecord alarmRecord) { |
| | | return R.data(alarmRecordService.save(alarmRecord)); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param alarmRecord |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="告警记录-编辑", notes="告警记录-编辑") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public R edit(@RequestBody AlarmRecord alarmRecord) { |
| | | return R.data(alarmRecordService.updateById(alarmRecord)); |
| | | } |
| | | |
| | | /** |
| | | * 通过id删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="告警记录-通过id删除", notes="告警记录-通过id删除") |
| | | @DeleteMapping(value = "/delete") |
| | | public R delete(@RequestParam(name="id",required=true) String id) { |
| | | return R.data(alarmRecordService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="告警记录-批量删除", notes="告警记录-批量删除") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public R deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | return R.data(this.alarmRecordService.removeByIds(Arrays.asList(ids.split(",")))); |
| | | } |
| | | |
| | | /** |
| | | * 通过id查询 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="告警记录-通过id查询", notes="告警记录-通过id查询") |
| | | @GetMapping(value = "/queryById") |
| | | public R queryById(@RequestParam(name="id",required=true) String id) { |
| | | AlarmRecord alarmRecord = alarmRecordService.getById(id); |
| | | return R.data(alarmRecord); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.alarmRule.controller; |
| | | |
| | | import cn.gistack.sm.alarmRule.entity.AlarmRule; |
| | | import cn.gistack.sm.alarmRule.service.AlarmRuleService; |
| | | import cn.gistack.sm.alarmRule.vo.AlarmRuleVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * 告警规则控制层 |
| | | * @author zhongrj |
| | | * @date 2023-05-22 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/alarmRule/alarmRule") |
| | | public class AlarmRuleController extends BladeController { |
| | | |
| | | private final AlarmRuleService alarmRuleService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | | * |
| | | * @param alarmRule |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="告警规则-分页列表查询", notes="告警规则-分页列表查询") |
| | | @GetMapping(value = "/list") |
| | | public R queryPageList(AlarmRule alarmRule, Query query) { |
| | | IPage<AlarmRule> pageList = alarmRuleService.page(Condition.getPage(query), Condition.getQueryWrapper(alarmRule)); |
| | | return R.data(pageList); |
| | | } |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * @param query |
| | | * @param alarmRule |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="告警规则-自定义分页列表查询", notes="告警规则-自定义分页列表查询") |
| | | @GetMapping(value = "/page") |
| | | public R page(AlarmRuleVO alarmRule, Query query) { |
| | | return R.data( alarmRuleService.selectAlarmRulePage(Condition.getPage(query),alarmRule)); |
| | | } |
| | | |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @param alarmRule |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="告警规则-添加", notes="告警规则-添加") |
| | | @PostMapping(value = "/add") |
| | | public R add(@RequestBody AlarmRule alarmRule) { |
| | | return R.data(alarmRuleService.save(alarmRule)); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param alarmRule |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="告警规则-编辑", notes="告警规则-编辑") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public R edit(@RequestBody AlarmRule alarmRule) { |
| | | return R.data(alarmRuleService.updateById(alarmRule)); |
| | | } |
| | | |
| | | /** |
| | | * 通过id删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="告警规则-通过id删除", notes="告警规则-通过id删除") |
| | | @DeleteMapping(value = "/delete") |
| | | public R delete(@RequestParam(name="id",required=true) String id) { |
| | | return R.data(alarmRuleService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="告警规则-批量删除", notes="告警规则-批量删除") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public R deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | return R.data(this.alarmRuleService.removeByIds(Arrays.asList(ids.split(",")))); |
| | | } |
| | | |
| | | /** |
| | | * 通过id查询 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="告警规则-通过id查询", notes="告警规则-通过id查询") |
| | | @GetMapping(value = "/queryById") |
| | | public R queryById(@RequestParam(name="id",required=true) String id) { |
| | | AlarmRule alarmRule = alarmRuleService.getById(id); |
| | | return R.data(alarmRule); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.alarmRule.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import org.springblade.core.mp.base.BaseEntity; |
| | | |
| | | /** |
| | | * 告警记录 |
| | | * @author zhongrj |
| | | * @date 2023-05-23 |
| | | */ |
| | | @Data |
| | | @TableName("sm_alarm_record") |
| | | public class AlarmRecord extends BaseEntity { |
| | | |
| | | /** |
| | | * 告警分类 |
| | | */ |
| | | private String type; |
| | | |
| | | /** |
| | | * 告警规则类型 |
| | | */ |
| | | private String alarmRuleType; |
| | | |
| | | /** |
| | | * 生成告警类型 |
| | | */ |
| | | private String createAlarmType; |
| | | |
| | | /** |
| | | * 校验规则名称 |
| | | */ |
| | | private String ruleName; |
| | | |
| | | /** |
| | | * 校验规则描述 |
| | | */ |
| | | private String ruleRemark; |
| | | |
| | | /** |
| | | * 指标 |
| | | */ |
| | | private String target; |
| | | |
| | | /** |
| | | * 阀值 |
| | | */ |
| | | private String threshold; |
| | | |
| | | /** |
| | | * 告警级别 |
| | | */ |
| | | private String alarmLevel; |
| | | |
| | | /** |
| | | * 告警方式 |
| | | */ |
| | | private String alarmMode; |
| | | |
| | | /** |
| | | * 告警频次 |
| | | */ |
| | | private String alarmFrequency; |
| | | |
| | | /** |
| | | * 告警人 |
| | | */ |
| | | private String alarmPerson; |
| | | |
| | | /** |
| | | * 告警内容 |
| | | */ |
| | | private String alarmContent; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String alarmRemark; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.alarmRule.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import org.springblade.core.mp.base.BaseEntity; |
| | | |
| | | /** |
| | | * 告警规则 |
| | | * @author zhongrj |
| | | * @date 2023-05-22 |
| | | */ |
| | | @Data |
| | | @TableName("sm_alarm_rule") |
| | | public class AlarmRule extends BaseEntity { |
| | | |
| | | /** |
| | | * 告警分类 |
| | | */ |
| | | private String type; |
| | | |
| | | /** |
| | | * 告警规则类型 |
| | | */ |
| | | private String alarmRuleType; |
| | | |
| | | /** |
| | | * 生成告警类型 |
| | | */ |
| | | private String createAlarmType; |
| | | |
| | | /** |
| | | * 校验规则名称 |
| | | */ |
| | | private String ruleName; |
| | | |
| | | /** |
| | | * 校验规则描述 |
| | | */ |
| | | private String ruleRemark; |
| | | |
| | | /** |
| | | * 指标 |
| | | */ |
| | | private String target; |
| | | |
| | | /** |
| | | * 阀值 |
| | | */ |
| | | private String threshold; |
| | | |
| | | /** |
| | | * 告警级别 |
| | | */ |
| | | private String alarmLevel; |
| | | |
| | | /** |
| | | * 告警方式 |
| | | */ |
| | | private String alarmMode; |
| | | |
| | | /** |
| | | * 告警频次 |
| | | */ |
| | | private String alarmFrequency; |
| | | |
| | | /** |
| | | * 告警人 |
| | | */ |
| | | private String alarmPerson; |
| | | |
| | | /** |
| | | * 告警内容 |
| | | */ |
| | | private String alarmContent; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String alarmRemark; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.alarmRule.mapper; |
| | | |
| | | import cn.gistack.sm.alarmRule.entity.AlarmRecord; |
| | | import cn.gistack.sm.alarmRule.vo.AlarmRecordVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 告警记录mapper映射层 |
| | | * @author zhongrj |
| | | * @date 2023-05-23 |
| | | */ |
| | | public interface AlarmRecordMapper extends BaseMapper<AlarmRecord> { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * @param page |
| | | * @param alarmRecord |
| | | * @return |
| | | */ |
| | | List<AlarmRecordVO> selectAlarmRecordPage(IPage<AlarmRecordVO> page, AlarmRecordVO alarmRecord); |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="cn.gistack.sm.alarmRule.mapper.AlarmRecordMapper"> |
| | | |
| | | <!--自定义分页列表查询--> |
| | | <select id="selectAlarmRecordPage" resultType="cn.gistack.sm.alarmRule.vo.AlarmRecordVO"> |
| | | select * from sm_alarm_record where is_deleted = 0 |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.alarmRule.mapper; |
| | | |
| | | import cn.gistack.sm.alarmRule.entity.AlarmRule; |
| | | import cn.gistack.sm.alarmRule.vo.AlarmRuleVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 告警规则mapper映射层 |
| | | * @author zhongrj |
| | | * @date 2023-05-23 |
| | | */ |
| | | public interface AlarmRuleMapper extends BaseMapper<AlarmRule> { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * @param page |
| | | * @param alarmRecord |
| | | * @return |
| | | */ |
| | | List<AlarmRuleVO> selectAlarmRulePage(IPage<AlarmRuleVO> page,@Param("alarmRule") AlarmRuleVO alarmRule); |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="cn.gistack.sm.alarmRule.mapper.AlarmRuleMapper"> |
| | | |
| | | <!--自定义分页列表查询--> |
| | | <select id="selectAlarmRulePage" resultType="cn.gistack.sm.alarmRule.vo.AlarmRuleVO"> |
| | | select |
| | | a.*, |
| | | if(waterAlarmRuleType!='',waterAlarmRuleType,if(rainAlarmRuleType!='',rainAlarmRuleType,'')) as alarmRuleTypeName, |
| | | if(waterCreateAlarmType!='',waterCreateAlarmType,if(rainCreateAlarmType!='',rainCreateAlarmType,'')) as createAlarmTypeName |
| | | from ( |
| | | select |
| | | sar.*, |
| | | bdb1.dict_value as typeName, |
| | | bdb2.dict_value as waterAlarmRuleType, |
| | | bdb3.dict_value as rainAlarmRuleType, |
| | | bdb4.dict_value as waterCreateAlarmType, |
| | | bdb5.dict_value as rainCreateAlarmType, |
| | | bdb6.dict_value as targetName, |
| | | bdb7.dict_value as alarmLevelName, |
| | | bdb8.dict_value as alarmModeName, |
| | | bdb9.dict_value as alarmFrequencyName |
| | | from YWXT.sm_alarm_rule sar |
| | | LEFT JOIN (select * from YWXT.blade_dict_biz where code = 'ALARM_TYPE' and dict_key!=-1 and is_deleted = 0) bdb1 on bdb1.dict_key = sar.type |
| | | LEFT JOIN (select * from YWXT.blade_dict_biz where code = 'WATER_ALARM_RULE_TYPE' and dict_key!=-1 and is_deleted = 0) bdb2 on bdb2.dict_key = sar.ALARM_RULE_TYPE |
| | | LEFT JOIN (select * from YWXT.blade_dict_biz where code = 'RAIN_ALARM_RULE_TYPE' and dict_key!=-1 and is_deleted = 0) bdb3 on bdb3.dict_key = sar.ALARM_RULE_TYPE |
| | | LEFT JOIN (select * from YWXT.blade_dict_biz where code = 'WATER_CREATE_ALARM_TYPE' and dict_key!=-1 and is_deleted = 0) bdb4 on bdb4.dict_key = sar.CREATE_ALARM_TYPE |
| | | LEFT JOIN (select * from YWXT.blade_dict_biz where code = 'RAIN_CREATE_ALARM_TYPE' and dict_key!=-1 and is_deleted = 0) bdb5 on bdb5.dict_key = sar.CREATE_ALARM_TYPE |
| | | LEFT JOIN (select * from YWXT.blade_dict_biz where code = 'ALARM_TARGET' and dict_key!=-1 and is_deleted = 0) bdb6 on bdb6.dict_key = sar.TARGET |
| | | LEFT JOIN (select * from YWXT.blade_dict_biz where code = 'ALARM_LEVEL' and dict_key!=-1 and is_deleted = 0) bdb7 on bdb7.dict_key = sar.ALARM_LEVEL |
| | | LEFT JOIN (select * from YWXT.blade_dict_biz where code = 'ALARM_MODE' and dict_key!=-1 and is_deleted = 0) bdb8 on bdb8.dict_key = sar.ALARM_MODE |
| | | LEFT JOIN (select * from YWXT.blade_dict_biz where code = 'ALARM_FREQUENCY' and dict_key!=-1 and is_deleted = 0) bdb9 on bdb9.dict_key = sar.ALARM_FREQUENCY |
| | | where sar.is_deleted = 0 |
| | | <if test="alarmRule.type!=null and alarmRule.type!=''"> |
| | | and sar.type = #{alarmRule.type} |
| | | </if> |
| | | <if test="alarmRule.alarmRuleType!=null and alarmRule.alarmRuleType!=''"> |
| | | and sar.alarm_rule_type = #{alarmRule.alarmRuleType} |
| | | </if> |
| | | <if test="alarmRule.createAlarmType!=null and alarmRule.createAlarmType!=''"> |
| | | and sar.create_alarm_type = #{alarmRule.createAlarmType} |
| | | </if> |
| | | <if test="alarmRule.ruleName!=null and alarmRule.ruleName!=''"> |
| | | and sar.rule_name like concat(concat('%',#{alarmRule.ruleName}),'%') |
| | | </if> |
| | | ) a |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.alarmRule.service; |
| | | |
| | | import cn.gistack.sm.alarmRule.entity.AlarmRecord; |
| | | import cn.gistack.sm.alarmRule.vo.AlarmRecordVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | |
| | | /** |
| | | * 告警记录服务层 |
| | | * @author zhongrj |
| | | * @date 2023-05-23 |
| | | */ |
| | | public interface AlarmRecordService extends BaseService<AlarmRecord> { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * @param page |
| | | * @param alarmRecord |
| | | * @return |
| | | */ |
| | | IPage<AlarmRecordVO> selectAlarmRecordPage(IPage<AlarmRecordVO> page, AlarmRecordVO alarmRecord); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.alarmRule.service; |
| | | |
| | | import cn.gistack.sm.alarmRule.entity.AlarmRule; |
| | | import cn.gistack.sm.alarmRule.vo.AlarmRuleVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | |
| | | /** |
| | | * 告警规则服务层 |
| | | * @author zhongrj |
| | | * @date 2023-05-55 |
| | | */ |
| | | public interface AlarmRuleService extends BaseService<AlarmRule> { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * @param page |
| | | * @param alarmRule |
| | | * @return |
| | | */ |
| | | IPage<AlarmRuleVO> selectAlarmRulePage(IPage<AlarmRuleVO> page, AlarmRuleVO alarmRule); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.alarmRule.service.impl; |
| | | |
| | | import cn.gistack.sm.alarmRule.entity.AlarmRecord; |
| | | import cn.gistack.sm.alarmRule.mapper.AlarmRecordMapper; |
| | | import cn.gistack.sm.alarmRule.service.AlarmRecordService; |
| | | import cn.gistack.sm.alarmRule.vo.AlarmRecordVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * 告警记录服务实现层 |
| | | * @author zhongrj |
| | | * @date 2023-05-23 |
| | | */ |
| | | @Service |
| | | public class AlarmRecordServiceImpl extends BaseServiceImpl<AlarmRecordMapper, AlarmRecord> implements AlarmRecordService { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * @param page |
| | | * @param alarmRecord |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<AlarmRecordVO> selectAlarmRecordPage(IPage<AlarmRecordVO> page, AlarmRecordVO alarmRecord) { |
| | | return page.setRecords(baseMapper.selectAlarmRecordPage(page,alarmRecord)); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.alarmRule.service.impl; |
| | | |
| | | import cn.gistack.sm.alarmRule.entity.AlarmRule; |
| | | import cn.gistack.sm.alarmRule.mapper.AlarmRuleMapper; |
| | | import cn.gistack.sm.alarmRule.service.AlarmRuleService; |
| | | import cn.gistack.sm.alarmRule.vo.AlarmRuleVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * 告警规则服务实现层 |
| | | * @author zhongrj |
| | | * @date 2023-05-55 |
| | | */ |
| | | @Service |
| | | public class AlarmRuleServiceImpl extends BaseServiceImpl<AlarmRuleMapper, AlarmRule> implements AlarmRuleService { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * @param page |
| | | * @param alarmRule |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<AlarmRuleVO> selectAlarmRulePage(IPage<AlarmRuleVO> page, AlarmRuleVO alarmRule) { |
| | | return page.setRecords(baseMapper.selectAlarmRulePage(page,alarmRule)); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.alarmRule.vo; |
| | | |
| | | import cn.gistack.sm.alarmRule.entity.AlarmRecord; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 告警记录vo |
| | | * @author zhongrj |
| | | * @date 2023-05-23 |
| | | */ |
| | | @Data |
| | | public class AlarmRecordVO extends AlarmRecord { |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.alarmRule.vo; |
| | | |
| | | import cn.gistack.sm.alarmRule.entity.AlarmRule; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 告警规则vo |
| | | * @author zhongrj |
| | | * @date 2023-05-22 |
| | | */ |
| | | @Data |
| | | public class AlarmRuleVO extends AlarmRule{ |
| | | /** |
| | | * 分类名称 |
| | | */ |
| | | private String typeName; |
| | | |
| | | /** |
| | | * 告警规则类型名称 |
| | | */ |
| | | private String alarmRuleTypeName; |
| | | |
| | | /** |
| | | * 生成告警类型名称 |
| | | */ |
| | | private String createAlarmTypeName; |
| | | |
| | | /** |
| | | * 指标名称 |
| | | */ |
| | | private String targetName; |
| | | |
| | | /** |
| | | * 告警等级名称 |
| | | */ |
| | | private String alarmLevelName; |
| | | |
| | | /** |
| | | * 告警通知类型名称 |
| | | */ |
| | | private String alarmModeName; |
| | | |
| | | /** |
| | | * 告警频次名称 |
| | | */ |
| | | private String alarmFrequencyName; |
| | | } |
| | |
| | | public class ZtConstant { |
| | | |
| | | /** |
| | | * 查询水库对应超汛巡查信息url |
| | | * 查询水库对应超汛巡查信息url(内网ip) |
| | | */ |
| | | public static final String patr_person_api = "http://10.10.2.192/services/1234567890ABCDEFGHIJKLMN/over_z_last/patr_person/api"; |
| | | public static final String patr_person_api = "http://10.42.6.192/services/1234567890ABCDEFGHIJKLMN/over_z_last/patr_person/api"; |
| | | |
| | | /** |
| | | * 请求头 key |
| | |
| | | import cn.gistack.sm.sjztmd.entity.AttResFlseLim; |
| | | import cn.gistack.sm.sjztmd.entity.AttResStagChar; |
| | | import cn.gistack.sm.sjztmd.service.IAttResFlseLimService; |
| | | import cn.gistack.sm.sjztmd.vo.EditResInfoVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param attResFlseLim |
| | | * @param editResInfoVO 修改实体类对象 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "水库特征水位-编辑", notes = "水库特征水位-编辑") |
| | | @ApiOperation(value = "水库特征水位、汛期限制水位-编辑", notes = "水库特征水位、汛期限制水位-编辑") |
| | | @PostMapping(value = "/edit") |
| | | public R edit(@RequestBody AttResFlseLim attResFlseLim) { |
| | | if (StringUtil.isBlank(attResFlseLim.getGuid())) { |
| | | public R edit(@RequestBody EditResInfoVO editResInfoVO) { |
| | | if (StringUtil.isBlank(editResInfoVO.getResGuid())) { |
| | | return R.fail("参数不正确"); |
| | | } |
| | | return R.data(attResFlseLimService.updateAttResFlseLimByGuid(attResFlseLim)); |
| | | return R.data(attResFlseLimService.updateAttResFlseLimByGuid(editResInfoVO)); |
| | | } |
| | | } |
| | |
| | | "tb_flse_lim_stag" = #{attResFlseLim.tbFlseLimStag}, |
| | | </if> |
| | | "update_time" = #{attResFlseLim.updateTime} |
| | | WHERE "res_guid" = #{attResFlseLim.resGuid} |
| | | WHERE "res_guid" = #{attResFlseLim.resGuid} and "flood_season_name" = '中汛期' |
| | | </update> |
| | | |
| | | </mapper> |
| | |
| | | package cn.gistack.sm.sjztmd.service; |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.AttResFlseLim; |
| | | import cn.gistack.sm.sjztmd.vo.EditResInfoVO; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public interface IAttResFlseLimService extends IService<AttResFlseLim> { |
| | | |
| | | Boolean updateAttResFlseLimByGuid(AttResFlseLim attResFlseLim); |
| | | Boolean updateAttResFlseLimByGuid(EditResInfoVO editResInfoVO); |
| | | } |
| | |
| | | |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.AttResFlseLim; |
| | | import cn.gistack.sm.sjztmd.entity.AttResStagChar; |
| | | import cn.gistack.sm.sjztmd.mapper.AttResFlseLimMapper; |
| | | import cn.gistack.sm.sjztmd.service.IAttResFlseLimService; |
| | | import cn.gistack.sm.sjztmd.service.IAttResStagCharService; |
| | | import cn.gistack.sm.sjztmd.vo.EditResInfoVO; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * @PROJECT_NAME: skjcmanager |
| | |
| | | @Service |
| | | @DS("zt") |
| | | public class AttResFlseLimServiceImpl extends ServiceImpl<AttResFlseLimMapper, AttResFlseLim> implements IAttResFlseLimService { |
| | | |
| | | @Autowired |
| | | private IAttResStagCharService attResStagCharService; |
| | | |
| | | @Override |
| | | public Boolean updateAttResFlseLimByGuid(AttResFlseLim attResFlseLim) { |
| | | attResFlseLim.setUpdateTime(DateUtil.now()); |
| | | return SqlHelper.retBool(baseMapper.updateAttResFlseLimByGuid(attResFlseLim)); |
| | | @Transactional |
| | | public Boolean updateAttResFlseLimByGuid(EditResInfoVO editResInfoVO) { |
| | | editResInfoVO.setUpdateTime(DateUtil.now()); |
| | | |
| | | // 修改汛期水位 |
| | | if (StringUtil.isNotBlank(String.valueOf(editResInfoVO.getTbFlseLimStag()))) { |
| | | AttResFlseLim attResFlseLim = new AttResFlseLim(); |
| | | attResFlseLim.setResGuid(editResInfoVO.getResGuid()); |
| | | attResFlseLim.setTbFlseLimStag(editResInfoVO.getTbFlseLimStag()); |
| | | baseMapper.updateAttResFlseLimByGuid(attResFlseLim); |
| | | } |
| | | |
| | | // 修改水位特征参数 |
| | | AttResStagChar attResStagChar = new AttResStagChar(); |
| | | attResStagChar.setResGuid(editResInfoVO.getResGuid()); |
| | | if (StringUtil.isNotBlank(editResInfoVO.getChecFlStag())) |
| | | attResStagChar.setTbChecFlStag(editResInfoVO.getChecFlStag()); |
| | | if (StringUtil.isNotBlank(editResInfoVO.getDeadStag())) |
| | | attResStagChar.setTbDeadStag(editResInfoVO.getDeadStag()); |
| | | if (StringUtil.isNotBlank(editResInfoVO.getFlprHighStag())) |
| | | attResStagChar.setTbFlprHighStag(editResInfoVO.getFlprHighStag()); |
| | | if (StringUtil.isNotBlank(editResInfoVO.getNormPoolStag())) |
| | | attResStagChar.setTbNormPoolStag(editResInfoVO.getNormPoolStag()); |
| | | if (StringUtil.isNotBlank(editResInfoVO.getDesFlStag())) |
| | | attResStagChar.setTbDesFlStag(editResInfoVO.getDesFlStag()); |
| | | |
| | | return attResStagCharService.customizeUpdateByGuid(attResStagChar); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @PROJECT_NAME: skjcmanager |
| | | * @DESCRIPTION: |
| | | * @USER: aix |
| | | * @DATE: 2023/5/23 10:06 |
| | | */ |
| | | @Data |
| | | public class EditResInfoVO { |
| | | /** |
| | | * 水库GUID |
| | | */ |
| | | @ApiModelProperty(value = "水库GUID") |
| | | private String resGuid; |
| | | |
| | | /** |
| | | * 填报水库汛期限制水位(米) - 水库汛期限制信息 |
| | | */ |
| | | @ApiModelProperty(value = "填报水库汛期限制水位(米)") |
| | | private BigDecimal tbFlseLimStag; |
| | | |
| | | /** |
| | | * 校核洪水位(米) - 水库特征水位对象 |
| | | */ |
| | | @ApiModelProperty(value = "校核洪水位(米)") |
| | | private String checFlStag; |
| | | |
| | | /** |
| | | * 死水位(米) - 水库特征水位对象 |
| | | */ |
| | | @ApiModelProperty(value = "死水位(米)") |
| | | private String deadStag; |
| | | |
| | | /** |
| | | * 设计洪水位(米) - 水库特征水位对象 |
| | | */ |
| | | @ApiModelProperty(value = "设计洪水位(米)") |
| | | private String desFlStag; |
| | | |
| | | /** |
| | | * 防洪高水位(米) - 水库特征水位对象 |
| | | */ |
| | | @ApiModelProperty(value = "防洪高水位(米)") |
| | | private String flprHighStag; |
| | | |
| | | /** |
| | | * 正常蓄水位(米) - 水库特征水位对象 |
| | | */ |
| | | @ApiModelProperty(value = "正常蓄水位(米)") |
| | | private String normPoolStag; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @ApiModelProperty(value = "更新时间 ") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | } |
| | |
| | | */ |
| | | List<RoleVO> tree(String tenantId, String excludeRole); |
| | | |
| | | List<RoleVO> treeByParentId(String parentId); |
| | | List<RoleVO> treeByParentId(String [] parentId); |
| | | |
| | | /** |
| | | * 获取角色名 |
| | |
| | | select id, parent_id, role_name as title, id as "value", id as "key" from blade_role where is_deleted = 0 |
| | | <if test="_parameter!=null and _parameter!=''"> |
| | | and ( |
| | | id = #{_parameter} or parent_id = #{_parameter} or parent_id in ( |
| | | select b.id from blade_role b where b.is_deleted = 0 and b.PARENT_ID = #{_parameter} |
| | | ( |
| | | <foreach collection="array" item="parentId" index="index" open="(" close=")" separator="or"> |
| | | id = #{parentId} |
| | | </foreach> |
| | | ) |
| | | or |
| | | ( |
| | | <foreach collection="array" item="parentId" index="index" open="(" close=")" separator="or"> |
| | | parent_id = #{parentId} |
| | | </foreach> |
| | | ) |
| | | |
| | | or parent_id in ( |
| | | select b.id from blade_role b where b.is_deleted = 0 and |
| | | ( |
| | | <foreach collection="array" item="parentId" index="index" open="(" close=")" separator="or"> |
| | | b.PARENT_ID = #{parentId} |
| | | </foreach> |
| | | ) |
| | | |
| | | ) or role_alias like '%zrr' |
| | | ) |
| | | </if> |
| | |
| | | if (AuthUtil.isAdministrator() || AuthUtil.isAdmin()) { |
| | | return ForestNodeMerger.merge(baseMapper.tree(null, RoleConstant.ADMINISTRATOR)); |
| | | } |
| | | return ForestNodeMerger.merge(baseMapper.treeByParentId(parentId)); |
| | | return ForestNodeMerger.merge(baseMapper.treeByParentId(parentId.split(","))); |
| | | } |
| | | |
| | | @Override |