Merge remote-tracking branch 'origin/jtdev' into jtdev
18 files modified
7 files added
| | |
| | | |
| | | /** |
| | | * 通过id删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | package cn.gistack.sm.alarmRule.controller; |
| | | |
| | | import cn.gistack.sm.alarmRule.entity.AlarmRule; |
| | | import cn.gistack.sm.alarmRule.entity.AlarmRuleDetail; |
| | | import cn.gistack.sm.alarmRule.service.AlarmRuleDetailService; |
| | | import cn.gistack.sm.alarmRule.service.AlarmRuleService; |
| | | import cn.gistack.sm.alarmRule.vo.AlarmRuleVO; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 告警规则控制层 |
| | |
| | | public class AlarmRuleController extends BladeController { |
| | | |
| | | private final AlarmRuleService alarmRuleService; |
| | | |
| | | private final AlarmRuleDetailService alarmRuleDetailService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | |
| | | */ |
| | | @ApiOperation(value="告警规则-添加", notes="告警规则-添加") |
| | | @PostMapping(value = "/add") |
| | | public R add(@RequestBody AlarmRule alarmRule) { |
| | | return R.data(alarmRuleService.save(alarmRule)); |
| | | public R add(@RequestBody AlarmRuleVO alarmRule) { |
| | | boolean flag = false; |
| | | boolean save = alarmRuleService.save(alarmRule); |
| | | // 新增成功 |
| | | if (save){ |
| | | if (alarmRule.getAlarmRuleDetailList().size() > 0){ |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRule.getAlarmRuleDetailList()) { |
| | | alarmRuleDetail.setAlarmRuleId(alarmRule.getId()); |
| | | // 新增明细 |
| | | flag = alarmRuleDetailService.save(alarmRuleDetail); |
| | | } |
| | | } |
| | | } |
| | | // 返回结果 |
| | | return R.status(flag); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ApiOperation(value="告警规则-编辑", notes="告警规则-编辑") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public R edit(@RequestBody AlarmRule alarmRule) { |
| | | return R.data(alarmRuleService.updateById(alarmRule)); |
| | | public R edit(@RequestBody AlarmRuleVO alarmRule) { |
| | | boolean flag = false; |
| | | // 更新 |
| | | boolean update = alarmRuleService.updateById(alarmRule); |
| | | if (update){ |
| | | if (alarmRule.getAlarmRuleDetailList().size() > 0){ |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRule.getAlarmRuleDetailList()) { |
| | | alarmRuleDetail.setAlarmRuleId(alarmRule.getId()); |
| | | if (null == alarmRuleDetail.getId()){ |
| | | // 新增明细 |
| | | flag = alarmRuleDetailService.save(alarmRuleDetail); |
| | | }else { |
| | | // 修改 |
| | | flag = alarmRuleDetailService.updateById(alarmRuleDetail); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return R.status(flag); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="告警规则-通过id删除", notes="告警规则-通过id删除") |
| | | @DeleteMapping(value = "/delete") |
| | | @PostMapping(value = "/delete") |
| | | public R delete(@RequestParam(name="id",required=true) String id) { |
| | | return R.data(alarmRuleService.removeById(id)); |
| | | return R.status(alarmRuleService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="告警规则-批量删除", notes="告警规则-批量删除") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | @PostMapping(value = "/deleteBatch") |
| | | public R deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | return R.data(this.alarmRuleService.removeByIds(Arrays.asList(ids.split(",")))); |
| | | boolean flag = false; |
| | | // |
| | | boolean remove = alarmRuleService.removeByIds(Arrays.asList(ids.split(","))); |
| | | if (remove){ |
| | | // 查询明细 |
| | | List<String> idList = Arrays.asList(ids.split(",")); |
| | | for (String id : idList) { |
| | | QueryWrapper<AlarmRuleDetail> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("alarm_rule_id",id); |
| | | // 删除明细 |
| | | flag = alarmRuleDetailService.remove(wrapper); |
| | | } |
| | | } |
| | | return R.status(flag); |
| | | } |
| | | |
| | | /** |
| | |
| | | return R.data(alarmRule); |
| | | } |
| | | |
| | | /** |
| | | * 通过id查询 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="告警规则-通过id查询", notes="告警规则-通过id查询") |
| | | @GetMapping(value = "/detail") |
| | | public R getDetail(@RequestParam(name="id",required=true) String id) { |
| | | return R.data(alarmRuleService.getDetail(id)); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.alarmRule.controller; |
| | | |
| | | import cn.gistack.sm.alarmRule.entity.AlarmRuleDetail; |
| | | import cn.gistack.sm.alarmRule.service.AlarmRuleDetailService; |
| | | import cn.gistack.sm.alarmRule.vo.AlarmRuleDetailVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | 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-29 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/alarmRuleDetail/alarmRuleDetail") |
| | | public class AlarmRuleDetailController{ |
| | | |
| | | private final AlarmRuleDetailService alarmRuleDetailService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | | * |
| | | * @param alarmRuleDetail |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="告警规则明细-分页列表查询", notes="告警规则明细-分页列表查询") |
| | | @GetMapping(value = "/list") |
| | | public R queryPageList(AlarmRuleDetail alarmRuleDetail, Query query) { |
| | | IPage<AlarmRuleDetail> pageList = alarmRuleDetailService.page(Condition.getPage(query), Condition.getQueryWrapper(alarmRuleDetail)); |
| | | return R.data(pageList); |
| | | } |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * @param query |
| | | * @param alarmRuleDetail |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="告警规则明细-自定义分页列表查询", notes="告警规则明细-自定义分页列表查询") |
| | | @GetMapping(value = "/page") |
| | | public R page(AlarmRuleDetailVO alarmRuleDetail, Query query) { |
| | | return R.data( alarmRuleDetailService.selectAlarmRuleDetailPage(Condition.getPage(query),alarmRuleDetail)); |
| | | } |
| | | |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @param alarmRuleDetail |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="告警规则明细-添加", notes="告警规则明细-添加") |
| | | @PostMapping(value = "/add") |
| | | public R add(@RequestBody AlarmRuleDetail alarmRuleDetail) { |
| | | return R.data(alarmRuleDetailService.save(alarmRuleDetail)); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param alarmRuleDetail |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="告警规则明细-编辑", notes="告警规则明细-编辑") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public R edit(@RequestBody AlarmRuleDetail alarmRuleDetail) { |
| | | return R.data(alarmRuleDetailService.updateById(alarmRuleDetail)); |
| | | } |
| | | |
| | | /** |
| | | * 通过id删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="告警规则明细-通过id删除", notes="告警规则明细-通过id删除") |
| | | @PostMapping(value = "/delete") |
| | | public R delete(@RequestParam(name="id",required=true) String id) { |
| | | return R.data(alarmRuleDetailService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="告警规则明细-批量删除", notes="告警规则明细-批量删除") |
| | | @PostMapping(value = "/deleteBatch") |
| | | public R deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | return R.data(this.alarmRuleDetailService.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) { |
| | | AlarmRuleDetail alarmRuleDetail = alarmRuleDetailService.getById(id); |
| | | return R.data(alarmRuleDetail); |
| | | } |
| | | |
| | | } |
| | |
| | | public class AlarmRecord extends BaseEntity { |
| | | |
| | | /** |
| | | * 区域编号 |
| | | * 区域名称 |
| | | */ |
| | | private String areaName; |
| | | |
| | |
| | | private String reservoirNumber; |
| | | |
| | | /** |
| | | * 水库名称 |
| | | */ |
| | | private String reservoirName; |
| | | |
| | | /** |
| | | * 告警测站编号 |
| | | */ |
| | | private String alarmSurveyStationCode; |
| | |
| | | private String alarmLevel; |
| | | |
| | | /** |
| | | * 告警方式 |
| | | */ |
| | | private String alarmMode; |
| | | |
| | | /** |
| | | * 告警频次 |
| | | */ |
| | | private String alarmFrequency; |
| | |
| | | private String alarmPerson; |
| | | |
| | | /** |
| | | * 告警内容 |
| | | */ |
| | | private String alarmContent; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String alarmRemark; |
| | | |
| | | /** |
| | | * 模板id |
| | | */ |
| | | private String templateId; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.alarmRule.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springblade.core.mp.base.BaseEntity; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 告警规则明细 |
| | | * @author zhongrj |
| | | * @date 2023-05-29 |
| | | */ |
| | | @Data |
| | | @TableName("sm_alarm_rule_detail") |
| | | public class AlarmRuleDetail implements Serializable { |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @TableId(value = "id",type = IdType.ASSIGN_ID) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 告警规则id |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long alarmRuleId; |
| | | |
| | | /** |
| | | * 告警方式 |
| | | */ |
| | | private String alarmMode; |
| | | |
| | | |
| | | /** |
| | | * 模板id |
| | | */ |
| | | private String templateId; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String alarmRemark; |
| | | } |
| | |
| | | |
| | | <!--自定义分页列表查询--> |
| | | <select id="selectAlarmRecordPage" resultType="cn.gistack.sm.alarmRule.vo.AlarmRecordVO"> |
| | | select sar.* from sm_alarm_record sar left join sm_alarm_rule sar1 on sar.alarm_rule_id = sar1.id |
| | | where is_deleted = 0 |
| | | select |
| | | sar.*, |
| | | sar1.type,sar1.alarm_rule_type as alarmRuleType,sar1.create_alarm_type as createAlarmType |
| | | from sm_alarm_record sar left join sm_alarm_rule sar1 on sar.alarm_rule_id = sar1.id and sar1.is_deleted = 0 |
| | | where sar.is_deleted = 0 |
| | | <if test="alarmRecord.alarmSurveyStationName!=null and alarmRecord.alarmSurveyStationName!=''"> |
| | | and alarm_survey_station_name like concat(concat('%',#{alarmRecord.alarmSurveyStationName}),'%') |
| | | </if> |
| | | <if test="alarmRecord.reservoirName!=null and alarmRecord.reservoirName!=''"> |
| | | and reservoir_name like concat(concat('%',#{alarmRecord.reservoirName}),'%') |
| | | </if> |
| | | <if test="alarmRecord.type!=null and alarmRecord.type!=''"> |
| | | and sar1.type = #{alarmRule.type} |
| | | and sar1.type = #{alarmRecord.type} |
| | | </if> |
| | | <if test="alarmRecord.alarmRuleType!=null and alarmRecord.alarmRuleType!=''"> |
| | | and sar1.alarm_rule_type = #{alarmRecord.alarmRuleType} |
| New file |
| | |
| | | package cn.gistack.sm.alarmRule.mapper; |
| | | |
| | | import cn.gistack.sm.alarmRule.entity.AlarmRuleDetail; |
| | | import cn.gistack.sm.alarmRule.vo.AlarmRuleDetailVO; |
| | | 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-29 |
| | | */ |
| | | public interface AlarmRuleDetailMapper extends BaseMapper<AlarmRuleDetail> { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * @param page |
| | | * @param alarmRuleDetail |
| | | * @return |
| | | */ |
| | | List<AlarmRuleDetailVO> selectAlarmRuleDetailPage(IPage<AlarmRuleDetailVO> page,@Param("alarmRuleDetail") AlarmRuleDetailVO alarmRuleDetail); |
| | | } |
| 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.AlarmRuleDetailMapper"> |
| | | |
| | | <!--自定义分页列表查询--> |
| | | <select id="selectAlarmRuleDetailPage" resultType="cn.gistack.sm.alarmRule.vo.AlarmRuleDetailVO"> |
| | | select * from sm_alarm_rule_detail |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | package cn.gistack.sm.alarmRule.mapper; |
| | | |
| | | import cn.gistack.sm.alarmRule.entity.AlarmRule; |
| | | import cn.gistack.sm.alarmRule.entity.AlarmRuleDetail; |
| | | import cn.gistack.sm.alarmRule.vo.AlarmRuleDetailVO; |
| | | import cn.gistack.sm.alarmRule.vo.AlarmRuleVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | * @return |
| | | */ |
| | | List<AlarmRuleVO> selectAlarmRulePage(IPage<AlarmRuleVO> page,@Param("alarmRule") AlarmRuleVO alarmRule); |
| | | |
| | | /** |
| | | * 通过id查询 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | AlarmRuleVO getDetailById(@Param("id") String id); |
| | | |
| | | /** |
| | | * 查询告警规则详情信息 |
| | | * @param id 告警规则id |
| | | * @return |
| | | */ |
| | | List<AlarmRuleDetailVO> getAlarmRuleDetailList(@Param("id") String id); |
| | | } |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <!--通过id查询--> |
| | | <select id="getDetailById" resultType="cn.gistack.sm.alarmRule.vo.AlarmRuleVO"> |
| | | select * from sm_alarm_rule where is_deleted = 0 and id = #{id} |
| | | </select> |
| | | |
| | | <!--通过id查询--> |
| | | <select id="getAlarmRuleDetailList" resultType="cn.gistack.sm.alarmRule.vo.AlarmRuleDetailVO"> |
| | | select sard.*,sst.content as alarmContent |
| | | from sm_alarm_rule_detail sard left join sm_sms_template sst on sard.template_id = sst.template_id |
| | | where sard.alarm_rule_id = #{id} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | * @param alarmRecord |
| | | * @return |
| | | */ |
| | | IPage<AlarmRecordVO> selectAlarmRecordPage(IPage<AlarmRecordVO> page, AlarmRecordVO alarmRecord); |
| | | Object selectAlarmRecordPage(IPage<AlarmRecordVO> page, AlarmRecordVO alarmRecord); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.alarmRule.service; |
| | | |
| | | import cn.gistack.sm.alarmRule.entity.AlarmRuleDetail; |
| | | import cn.gistack.sm.alarmRule.vo.AlarmRuleDetailVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * 告警规则详情服务层 |
| | | * @author zhongrj |
| | | * @date 2023-05-29 |
| | | */ |
| | | public interface AlarmRuleDetailService extends IService<AlarmRuleDetail> { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * @param page |
| | | * @param alarmRuleDetail |
| | | * @return |
| | | */ |
| | | IPage<AlarmRuleDetailVO> selectAlarmRuleDetailPage(IPage<AlarmRuleDetailVO> page, AlarmRuleDetailVO alarmRuleDetail); |
| | | } |
| | |
| | | * @param alarmRule |
| | | * @return |
| | | */ |
| | | IPage<AlarmRuleVO> selectAlarmRulePage(IPage<AlarmRuleVO> page, AlarmRuleVO alarmRule); |
| | | Object selectAlarmRulePage(IPage<AlarmRuleVO> page, AlarmRuleVO alarmRule); |
| | | |
| | | /** |
| | | * 通过id查询 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | AlarmRuleVO getDetail(String id); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<AlarmRecordVO> selectAlarmRecordPage(IPage<AlarmRecordVO> page, AlarmRecordVO alarmRecord) { |
| | | public Object selectAlarmRecordPage(IPage<AlarmRecordVO> page, AlarmRecordVO alarmRecord) { |
| | | if (null != alarmRecord.getIsExport()){ |
| | | return baseMapper.selectAlarmRecordPage(null,alarmRecord); |
| | | } |
| | | return page.setRecords(baseMapper.selectAlarmRecordPage(page,alarmRecord)); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.alarmRule.service.impl; |
| | | |
| | | import cn.gistack.sm.alarmRule.entity.AlarmRuleDetail; |
| | | import cn.gistack.sm.alarmRule.mapper.AlarmRuleDetailMapper; |
| | | import cn.gistack.sm.alarmRule.service.AlarmRuleDetailService; |
| | | import cn.gistack.sm.alarmRule.vo.AlarmRuleDetailVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * 告警规则详情服务实现层 |
| | | * @author zhongrj |
| | | * @date 2023-05-29 |
| | | */ |
| | | @Service |
| | | public class AlarmRuleDetailServiceImpl extends ServiceImpl<AlarmRuleDetailMapper, AlarmRuleDetail> implements AlarmRuleDetailService { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * @param page |
| | | * @param alarmRuleDetail |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<AlarmRuleDetailVO> selectAlarmRuleDetailPage(IPage<AlarmRuleDetailVO> page, AlarmRuleDetailVO alarmRuleDetail) { |
| | | return page.setRecords(baseMapper.selectAlarmRuleDetailPage(page,alarmRuleDetail)); |
| | | } |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<AlarmRuleVO> selectAlarmRulePage(IPage<AlarmRuleVO> page, AlarmRuleVO alarmRule) { |
| | | public Object selectAlarmRulePage(IPage<AlarmRuleVO> page, AlarmRuleVO alarmRule) { |
| | | if (null != alarmRule.getIsExport()){ |
| | | return baseMapper.selectAlarmRulePage(null,alarmRule); |
| | | } |
| | | return page.setRecords(baseMapper.selectAlarmRulePage(page,alarmRule)); |
| | | } |
| | | |
| | | /** |
| | | * 通过id查询 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AlarmRuleVO getDetail(String id) { |
| | | AlarmRuleVO alarmRule = baseMapper.getDetailById(id); |
| | | // 查询详情信息 |
| | | alarmRule.setAlarmRuleDetailList(baseMapper.getAlarmRuleDetailList(id)); |
| | | // 返回 |
| | | return alarmRule; |
| | | } |
| | | } |
| | |
| | | * 生成告警类型 |
| | | */ |
| | | private String createAlarmType; |
| | | |
| | | /** |
| | | * 是否导出 |
| | | */ |
| | | private Integer isExport; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.alarmRule.vo; |
| | | |
| | | import cn.gistack.sm.alarmRule.entity.AlarmRuleDetail; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 告警记录详情vo |
| | | * @author zhongrj |
| | | * @date 2023-05-29 |
| | | */ |
| | | @Data |
| | | public class AlarmRuleDetailVO extends AlarmRuleDetail { |
| | | |
| | | /** |
| | | * 告警内容 |
| | | */ |
| | | private String alarmContent; |
| | | } |
| | |
| | | package cn.gistack.sm.alarmRule.vo; |
| | | |
| | | import cn.gistack.sm.alarmRule.entity.AlarmRule; |
| | | import cn.gistack.sm.alarmRule.entity.AlarmRuleDetail; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 告警规则vo |
| | |
| | | */ |
| | | @Data |
| | | public class AlarmRuleVO extends AlarmRule{ |
| | | |
| | | /** |
| | | * 规则明细 |
| | | */ |
| | | private List<AlarmRuleDetailVO> alarmRuleDetailList; |
| | | |
| | | |
| | | /** |
| | | * 是否导出 |
| | | */ |
| | | private Integer isExport; |
| | | } |
| | |
| | | package cn.gistack.sm.sjztmd.controller; |
| | | |
| | | import cn.gistack.sm.patrol.entity.PatrolConfig; |
| | | import cn.gistack.sm.sjztmd.entity.AttResManagePerson; |
| | | import cn.gistack.sm.sjztmd.service.IAttResManagePersonService; |
| | | import cn.gistack.system.user.entity.User; |
| | | import cn.gistack.system.user.feign.IUserClient; |
| | | import com.alibaba.nacos.client.utils.TenantUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | @ApiOperation(value = "根据手机号码获取中台责任人水库id组合字符串", notes = "根据手机号码获取中台责任人水库id组合字符串") |
| | | @GetMapping(value = "/queryListByPhone") |
| | | public R queryListByPhone(AttResManagePerson attResManagePerson) { |
| | | List<AttResManagePerson> list = attResManagePersonService.list(Condition.getQueryWrapper(attResManagePerson)); |
| | | final List<AttResManagePerson> list = attResManagePersonService.list(Condition.getQueryWrapper(attResManagePerson)); |
| | | List<String> reslist = new ArrayList<>(); |
| | | list.forEach(item -> { |
| | | reslist.add(item.getResGuid()); |
| | |
| | | return R.data(StringUtil.join(reslist, ",")); |
| | | } |
| | | |
| | | @ApiOperation(value="巡查责任人-添加/修改", notes="巡查责任人-添加/修改") |
| | | @ApiOperation(value="责任人-添加/修改", notes="责任人-添加/修改") |
| | | @PostMapping(value = "/editZrr") |
| | | public R editZrr(@RequestBody AttResManagePerson attResManagePerson) { |
| | | if (StringUtil.isEmpty(attResManagePerson.getResGuid())) |
| | |
| | | return R.data(attResManagePersonService.saveOrUpdateResManagePerson(attResManagePerson)); |
| | | } |
| | | |
| | | @ApiOperation(value="多个责任人-添加/修改", notes="多个责任人-添加/修改") |
| | | @PostMapping(value = "/editListZrr") |
| | | public R editListZrr(@RequestBody List<AttResManagePerson> attResManagePersons) { |
| | | return attResManagePersonService.saveOrUpdateResManagePerson(attResManagePersons); |
| | | } |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "所在地点") |
| | | private String place; |
| | | |
| | | |
| | | /** |
| | | * 行政责任人-id |
| | | */ |
| | | @ApiModelProperty(value = "行政责任人-id") |
| | | private String areaUserGuid; |
| | | |
| | | /** |
| | | * 行政责任人-姓名 |
| | | */ |
| | |
| | | */ |
| | | @ApiModelProperty(value = "行政责任人-所属单位") |
| | | private String areaUnitName; |
| | | |
| | | /** |
| | | * 主管部门责任人-id |
| | | */ |
| | | @ApiModelProperty(value = "主管部门责任人-id") |
| | | private String customsUserGuid; |
| | | /** |
| | | * 主管部门责任人-姓名 |
| | | */ |
| | |
| | | private String customsUnitName; |
| | | |
| | | /** |
| | | * 管理单位责任人-id |
| | | */ |
| | | @ApiModelProperty(value = "管理单位责任人-id") |
| | | private String manageUnitUserGuid; |
| | | |
| | | /** |
| | | * 管理单位责任人-姓名 |
| | | */ |
| | | @ApiModelProperty(value = "管理单位责任人-姓名") |
| | |
| | | */ |
| | | @ApiModelProperty(value = "管理单位责任人-所属单位") |
| | | private String manageUnitUnitName; |
| | | |
| | | |
| | | /** |
| | | * 技术责任人-id |
| | | */ |
| | | @ApiModelProperty(value = "技术责任人-id") |
| | | private String technologyUserGuid; |
| | | |
| | | /** |
| | | * 技术责任人-姓名 |
| | | */ |
| | |
| | | */ |
| | | @ApiModelProperty(value = "技术责任人-所属单位") |
| | | private String technologyUnitName; |
| | | |
| | | /** |
| | | * 巡查责任人-id |
| | | */ |
| | | @ApiModelProperty(value = "巡查责任人-id") |
| | | private String patrolUserGuid; |
| | | |
| | | /** |
| | | * 巡查责任人-姓名 |
| | | */ |
| | |
| | | select |
| | | arb."guid", arb."name", arb."res_loc" as place, arb."res_reg_code" as resRegCode, arb."eng_scal" as engScal, |
| | | aab."ad_name" as adName, |
| | | trmp1."user_unit" areaUnitName,trmp1."user_name" areaUsername,trmp1."user_phone" areaPhone,trmp1."position" areaPosition, |
| | | trmp2."user_unit" customsUnitName,trmp2."user_name" customsUsername,trmp2."user_phone" customsPhone,trmp2."position" customsPosition, |
| | | trmp3."user_unit" manageUnitUnitName,trmp3."user_name" manageUnitUsername,trmp3."user_phone" manageUnitPhone,trmp3."position" manageUnitPosition, |
| | | trmp4."user_unit" technologyUnitName,trmp4."user_name" technologyUsername,trmp4."user_phone" technologyPhone,trmp4."position" technologyPosition, |
| | | trmp5."user_unit" patrolUnitName,trmp5."user_name" patrolUsername,trmp5."user_phone" patrolPhone,trmp5."position" patrolPosition |
| | | trmp1."user_unit" areaUnitName,trmp1."user_name" areaUsername,trmp1."user_phone" areaPhone,trmp1."position" areaPosition,trmp1."guid" areaUserGuid, |
| | | trmp2."user_unit" customsUnitName,trmp2."user_name" customsUsername,trmp2."user_phone" customsPhone,trmp2."position" customsPosition,trmp2."guid" customsUserGuid, |
| | | trmp3."user_unit" manageUnitUnitName,trmp3."user_name" manageUnitUsername,trmp3."user_phone" manageUnitPhone,trmp3."position" manageUnitPosition,trmp3."guid" manageUnitUserGuid, |
| | | trmp4."user_unit" technologyUnitName,trmp4."user_name" technologyUsername,trmp4."user_phone" technologyPhone,trmp4."position" technologyPosition,trmp4."guid" technologyUserGuid, |
| | | trmp5."user_unit" patrolUnitName,trmp5."user_name" patrolUsername,trmp5."user_phone" patrolPhone,trmp5."position" patrolPosition,trmp5."guid" patrolUserGuid |
| | | from SJZT_MD."att_res_base" arb |
| | | left join "SJZT_MD"."att_ad_base" aab on aab."guid" = concat(arb."ad_guid",'000000') |
| | | |
| | | left join ( |
| | | select "res_guid",WM_Concat("user_unit") "user_unit",WM_Concat("user_name") "user_name",WM_Concat("user_phone") "user_phone",WM_Concat("position") "position" |
| | | select "res_guid",WM_Concat("guid") "guid",WM_Concat("user_unit") "user_unit",WM_Concat("user_name") "user_name",WM_Concat("user_phone") "user_phone",WM_Concat("position") "position" |
| | | from "SJZT_MD"."att_res_manage_person" where "type"=1 GROUP BY "res_guid" |
| | | ) trmp1 on arb."guid" = trmp1."res_guid" |
| | | |
| | | left join ( |
| | | select "res_guid",WM_Concat("user_unit") "user_unit",WM_Concat("user_name") "user_name",WM_Concat("user_phone") "user_phone",WM_Concat("position") "position" |
| | | select "res_guid",WM_Concat("guid") "guid",WM_Concat("user_unit") "user_unit",WM_Concat("user_name") "user_name",WM_Concat("user_phone") "user_phone",WM_Concat("position") "position" |
| | | from "SJZT_MD"."att_res_manage_person" where "type"=2 GROUP BY "res_guid" |
| | | ) trmp2 on arb."guid" = trmp2."res_guid" |
| | | |
| | | left join ( |
| | | select "res_guid",WM_Concat("user_unit") "user_unit",WM_Concat("user_name") "user_name",WM_Concat("user_phone") "user_phone",WM_Concat("position") "position" |
| | | select "res_guid",WM_Concat("guid") "guid",WM_Concat("user_unit") "user_unit",WM_Concat("user_name") "user_name",WM_Concat("user_phone") "user_phone",WM_Concat("position") "position" |
| | | from "SJZT_MD"."att_res_manage_person" where "type"=3 GROUP BY "res_guid" |
| | | ) trmp3 on arb."guid" = trmp3."res_guid" |
| | | |
| | | left join ( |
| | | select "res_guid",WM_Concat("user_unit") "user_unit",WM_Concat("user_name") "user_name",WM_Concat("user_phone") "user_phone",WM_Concat("position") "position" |
| | | select "res_guid",WM_Concat("guid") "guid",WM_Concat("user_unit") "user_unit",WM_Concat("user_name") "user_name",WM_Concat("user_phone") "user_phone",WM_Concat("position") "position" |
| | | from "SJZT_MD"."att_res_manage_person" where "type"=4 GROUP BY "res_guid" |
| | | ) trmp4 on arb."guid" = trmp4."res_guid" |
| | | |
| | | left join ( |
| | | select "res_guid",WM_Concat("user_unit") "user_unit",WM_Concat("user_name") "user_name",WM_Concat("user_phone") "user_phone",WM_Concat("position") "position" |
| | | select "res_guid",WM_Concat("guid") "guid",WM_Concat("user_unit") "user_unit",WM_Concat("user_name") "user_name",WM_Concat("user_phone") "user_phone",WM_Concat("position") "position" |
| | | from "SJZT_MD"."att_res_manage_person" where "type"=5 GROUP BY "res_guid" |
| | | ) trmp5 on arb."guid" = trmp5."res_guid" |
| | | where 1=1 |
| | |
| | | import cn.gistack.sm.sjztmd.entity.AttResManagePerson; |
| | | import cn.gistack.sm.sjztmd.entity.PatrolResponsiblePerson; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.core.tool.api.R; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | Boolean saveOrUpdateResManagePerson(AttResManagePerson attResManagePerson); |
| | | |
| | | R saveOrUpdateResManagePerson(List<AttResManagePerson> attResManagePersons); |
| | | |
| | | /** |
| | | * 获取水库巡查责任人列表 |
| | | * @param ResId 水库id数组 |
| | |
| | | import cn.gistack.sm.sjztmd.service.IAttResManagePersonService; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public R saveOrUpdateResManagePerson(List<AttResManagePerson> attResManagePersons) { |
| | | Boolean res = false; |
| | | for (AttResManagePerson attResManagePerson:attResManagePersons) { |
| | | if (jodd.util.StringUtil.isEmpty(attResManagePerson.getResGuid())) |
| | | return R.fail("resGuid不能为空"); |
| | | if (jodd.util.StringUtil.isEmpty(attResManagePerson.getType())) |
| | | return R.fail("type不能为空"); |
| | | if (jodd.util.StringUtil.isEmpty(attResManagePerson.getSysResource())) |
| | | return R.fail("sysResource不能为空"); |
| | | if (jodd.util.StringUtil.isEmpty(attResManagePerson.getUserPhone())) |
| | | return R.fail("userPhone不能为空"); |
| | | if (jodd.util.StringUtil.isEmpty(attResManagePerson.getUserName())) |
| | | return R.fail("userName不能为空"); |
| | | res = saveOrUpdateResManagePerson(attResManagePerson); |
| | | } |
| | | return R.data(res); |
| | | } |
| | | |
| | | @Override |
| | | public List<AttResManagePerson> attResManagePersonListByResIds(String resId) { |
| | | return baseMapper.attResManagePersonListByResId(Func.toLongList(resId)); |
| | | } |