Merge remote-tracking branch 'origin/jtdev' into jtdev
| | |
| | | public class AlarmRecord extends BaseEntity { |
| | | |
| | | /** |
| | | * 告警分类 |
| | | * 区域编号 |
| | | */ |
| | | private String type; |
| | | private String areaName; |
| | | |
| | | /** |
| | | * 告警规则类型 |
| | | * 测站名称 |
| | | */ |
| | | private String alarmRuleType; |
| | | private String alarmSurveyStationName; |
| | | |
| | | /** |
| | | * 生成告警类型 |
| | | * 测站类型 |
| | | */ |
| | | private String createAlarmType; |
| | | private String surveyStationType; |
| | | |
| | | /** |
| | | * 校验规则名称 |
| | | * 处置状态 |
| | | */ |
| | | private String ruleName; |
| | | private String disposeStatus; |
| | | |
| | | /** |
| | | * 校验规则描述 |
| | | * 告警条件 |
| | | */ |
| | | private String ruleRemark; |
| | | private String alarmCondition; |
| | | |
| | | /** |
| | | * 指标 |
| | | * 告警规则ID |
| | | */ |
| | | private String target; |
| | | private String alarmRuleId; |
| | | |
| | | /** |
| | | * 阀值 |
| | | * 水库编号 |
| | | */ |
| | | private String threshold; |
| | | private String reservoirNumber; |
| | | |
| | | /** |
| | | * 告警级别 |
| | | * 告警测站编号 |
| | | */ |
| | | private String alarmLevel; |
| | | private String alarmSurveyStationCode; |
| | | |
| | | /** |
| | | * 告警方式 |
| | | * 测站新旧 |
| | | */ |
| | | private String alarmMode; |
| | | |
| | | /** |
| | | * 告警频次 |
| | | */ |
| | | private String alarmFrequency; |
| | | |
| | | /** |
| | | * 告警人 |
| | | */ |
| | | private String alarmPerson; |
| | | |
| | | /** |
| | | * 告警内容 |
| | | */ |
| | | private String alarmContent; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String alarmRemark; |
| | | private String alarmSurveyStationNewOld; |
| | | } |
| | |
| | | import cn.gistack.sm.alarmRule.vo.AlarmRecordVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @param alarmRecord |
| | | * @return |
| | | */ |
| | | List<AlarmRecordVO> selectAlarmRecordPage(IPage<AlarmRecordVO> page, AlarmRecordVO alarmRecord); |
| | | List<AlarmRecordVO> selectAlarmRecordPage(IPage<AlarmRecordVO> page,@Param("alarmRecord") AlarmRecordVO alarmRecord); |
| | | } |
| | |
| | | |
| | | <!--自定义分页列表查询--> |
| | | <select id="selectAlarmRecordPage" resultType="cn.gistack.sm.alarmRule.vo.AlarmRecordVO"> |
| | | select * from sm_alarm_record where is_deleted = 0 |
| | | select sar.* from sm_alarm_record sar left join sm_alarm_rule sar1 on sar.alarm_rule_id = sar1.id |
| | | where 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.type!=null and alarmRecord.type!=''"> |
| | | and sar1.type = #{alarmRule.type} |
| | | </if> |
| | | <if test="alarmRecord.alarmRuleType!=null and alarmRecord.alarmRuleType!=''"> |
| | | and sar1.alarm_rule_type = #{alarmRecord.alarmRuleType} |
| | | </if> |
| | | <if test="alarmRecord.createAlarmType!=null and alarmRecord.createAlarmType!=''"> |
| | | and sar1.create_alarm_type = #{alarmRecord.createAlarmType} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * @param page |
| | | * @param alarmRecord |
| | | * @param alarmRule |
| | | * @return |
| | | */ |
| | | List<AlarmRuleVO> selectAlarmRulePage(IPage<AlarmRuleVO> page,@Param("alarmRule") AlarmRuleVO alarmRule); |
| | |
| | | |
| | | <!--自定义分页列表查询--> |
| | | <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 |
| | | select sar.* from YWXT.sm_alarm_rule sar where sar.is_deleted = 0 |
| | | <if test="alarmRule.type!=null and alarmRule.type!=''"> |
| | | and sar.type = #{alarmRule.type} |
| | | </if> |
| | |
| | | <if test="alarmRule.ruleName!=null and alarmRule.ruleName!=''"> |
| | | and sar.rule_name like concat(concat('%',#{alarmRule.ruleName}),'%') |
| | | </if> |
| | | ) a |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | */ |
| | | @Data |
| | | public class AlarmRecordVO extends AlarmRecord { |
| | | |
| | | /** |
| | | * 告警分类 |
| | | */ |
| | | private String type; |
| | | |
| | | /** |
| | | * 告警规则类型 |
| | | */ |
| | | private String alarmRuleType; |
| | | |
| | | /** |
| | | * 生成告警类型 |
| | | */ |
| | | private String createAlarmType; |
| | | } |
| | |
| | | */ |
| | | @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; |
| | | } |
| | |
| | | @PostMapping("/createCallTaskByParams") |
| | | public R createCallTaskByParam(@RequestBody Map<String, Object> params){ |
| | | // 返回 |
| | | return R.status(callService.createCallTaskByParam(params)); |
| | | return R.data(callService.createCallTaskByParam(params)); |
| | | } |
| | | } |
| | |
| | | * @param params |
| | | * @return |
| | | */ |
| | | boolean createCallTaskByParam(Map<String, Object> params); |
| | | Object createCallTaskByParam(Map<String, Object> params); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean createCallTaskByParam(Map<String, Object> params) { |
| | | public Object createCallTaskByParam(Map<String, Object> params) { |
| | | // 自动创建任务的 4个条件 1:呼叫人数 2:调度时间 3:是否超汛限 4:多少天内呼叫过的不呼叫(天数) |
| | | //1. 调用中台接口查询出所有需要发任务的水库巡查责任人相关信息(该处需要将是否超汛限条件传入) |
| | | JSONArray jsonArray = getZtWaterMangerData(params); |
| | |
| | | params.put("list",setForListMap(taskRandomList)); |
| | | // 调度时间处理 |
| | | params.put("taskScheduleTime",new SimpleDateFormat("yyyy-MM-dd").format(new Date())+ " " +params.get("taskScheduleTime") + ":00"); |
| | | // 创建任务 |
| | | createTask(params); |
| | | //5. 返回 |
| | | return true; |
| | | // 创建任务并返回结果 |
| | | return createTask(params); |
| | | } |
| | | |
| | | /** |
| | |
| | | private String floodSeasonAz; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | * 更新人 |
| | | */ |
| | | @ApiModelProperty(value = "创建时间 ") |
| | | @TableField("\"create_time\"") |
| | | private String createTime; |
| | | @ApiModelProperty(value = "更新人 ") |
| | | @TableField("\"update_by\"") |
| | | private String updateBy; |
| | | |
| | | /** |
| | | * 更新时间 |
| | |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | // |
| | | // /** |
| | | // * 修改人编码 |
| | | // */ |
| | | // @ApiModelProperty(value = "修改人编码 ") |
| | | // @TableField("\"update_user_code\"") |
| | | // private String updateUserCode; |
| | | // |
| | | // /** |
| | | // * 修改人名称 |
| | | // */ |
| | | // @ApiModelProperty(value = "修改人名称 ") |
| | | // @TableField("\"update_user_name\"") |
| | | // private String updateUserName; |
| | | // |
| | | // /** |
| | | // * 修改人联系方式 |
| | | // */ |
| | | // @ApiModelProperty(value = "修改人联系方式 ") |
| | | // @TableField("\"update_user_phone\"") |
| | | // private String updateUserPhone; |
| | | |
| | | // /** |
| | | // * 采集时间 |
| | | // */ |
| | | // @ApiModelProperty(value = "采集时间 ") |
| | | // @TableField("\"collect_time\"") |
| | | // private String collectTime; |
| | | |
| | | |
| | | /** |
| | |
| | | <if test="attResStagChar.watShedArea !=null and attResStagChar.watShedArea != '' "> |
| | | "wat_shed_area" = #{attResStagChar.watShedArea}, |
| | | </if> |
| | | "update_by" = #{attResStagChar.updateBy}, |
| | | "update_time" = #{attResStagChar.updateTime} |
| | | WHERE "res_guid" = #{attResStagChar.resGuid} |
| | | </update> |
| | |
| | | public Boolean customizeUpdateByGuid(AttResStagChar attResStagChar) { |
| | | attResStagChar.setUpdateTime(DateUtil.now()); |
| | | // attResStagChar.setUpdateUserCode(String.valueOf(AuthUtil.getUserId())); |
| | | // attResStagChar.setUpdateUserName(AuthUtil.getUserName()); |
| | | attResStagChar.setUpdateBy(AuthUtil.getUserName() + "-" + userClient.userInfoById(AuthUtil.getUserId()).getData().getPhone()); |
| | | // attResStagChar.setUpdateUserPhone(userClient.userInfoById(AuthUtil.getUserId()).getData().getPhone()); |
| | | return SqlHelper.retBool(baseMapper.customizeUpdateByGuid(attResStagChar)); |
| | | } |
| | |
| | | private String type; |
| | | |
| | | /** |
| | | * 通知类型 1:水情告警 2:雨情告警 |
| | | */ |
| | | @ApiModelProperty(value = "通知类型") |
| | | private String noticeType; |
| | | |
| | | /** |
| | | * 模板内容 |
| | | */ |
| | | @ApiModelProperty(value = "模板内容") |
| | |
| | | <if test="smsTemplate.templateId!=null and smsTemplate.templateId!=''"> |
| | | and template_id like concat(concat('%',#{smsTemplate.templateId}),'%') |
| | | </if> |
| | | <if test="smsTemplate.noticeType!=null and smsTemplate.noticeType!=''"> |
| | | and notice_type = #{smsTemplate.noticeType} |
| | | </if> |
| | | <if test="smsTemplate.type!=null and smsTemplate.type!=''"> |
| | | and type = #{smsTemplate.type} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | map.put("personNumber",jsonParam.getString("personNumber")); |
| | | map.put("day",jsonParam.getString("day")); |
| | | // 创建外呼任务 |
| | | callService.createCallTaskByParam(map); |
| | | Object result = callService.createCallTaskByParam(map); |
| | | XxlJobLogger.log("任务响应结果:" + result); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取字典 |
| | | */ |
| | | @GetMapping("/dictionaryByParentId") |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "获取字典", notes = "获取字典") |
| | | public R<List<DictBiz>> dictionaryByParentId(String code,Long parentId) { |
| | | List<DictBiz> tree = dictService.getListByParentId(code,parentId); |
| | | return R.data(tree); |
| | | } |
| | | |
| | | /** |
| | | * 获取字典树 |
| | | */ |
| | | @GetMapping("/dictionary-tree") |
| | |
| | | */ |
| | | List<DictBizVO> parentTree(); |
| | | |
| | | /** |
| | | * 获取字典 |
| | | * @param code |
| | | * @param parentId |
| | | * @return |
| | | */ |
| | | List<DictBiz> getListByParentId(String code, Long parentId); |
| | | } |
| | |
| | | select id, parent_id, dict_value as title, id as "value", id as "key" from blade_dict_biz where is_deleted = 0 and parent_id = 0 |
| | | </select> |
| | | |
| | | <!--获取字典-根据父id及code--> |
| | | <select id="getListByParentId" resultMap="dictResultMap"> |
| | | select id, tenant_id, parent_id, code, dict_key, dict_value, sort, remark from blade_dict_biz |
| | | where parent_id in( |
| | | select id from blade_dict_biz where parent_id > 0 and is_sealed = 0 and is_deleted = 0 |
| | | and code like concat(concat('%',#{param1}),'%') and parent_id = #{param2} |
| | | ) |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | */ |
| | | List<DictBizVO> childList(Map<String, Object> dict, Long parentId); |
| | | |
| | | /** |
| | | * 获取字典 |
| | | * @param code |
| | | * @param parentId |
| | | * @return |
| | | */ |
| | | List<DictBiz> getListByParentId(String code, Long parentId); |
| | | } |
| | |
| | | List<DictBiz> list = this.list(Condition.getQueryWrapper(dict, DictBiz.class).lambda().ne(DictBiz::getId, parentId).eq(DictBiz::getCode, parentDict.getCode()).orderByAsc(DictBiz::getSort)); |
| | | return DictBizWrapper.build().listNodeVO(list); |
| | | } |
| | | |
| | | /** |
| | | * 获取字典 |
| | | * @param code |
| | | * @param parentId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<DictBiz> getListByParentId(String code, Long parentId) { |
| | | return baseMapper.getListByParentId(code,parentId); |
| | | } |
| | | } |