Merge remote-tracking branch 'origin/jtdev' into jtdev
104 files modified
57 files added
| | |
| | | http.headers().frameOptions().disable(); |
| | | http.httpBasic().and().csrf().disable(); |
| | | http.formLogin().loginPage("/oauth/login").loginProcessingUrl("/oauth/form"); |
| | | |
| | | // 添加对 /v2/api-docs 的访问控制 |
| | | http.authorizeRequests() |
| | | .antMatchers("/v2/api-docs").denyAll(); // 拒绝所有对 /v2/api-docs 的访问 |
| | | } |
| | | |
| | | @Override |
| | |
| | | userInfo.getDetail().set("phone",Base64Utils.getBase64Encode(user.getPhone())); |
| | | |
| | | String deptStr = ""; |
| | | if (userInfo.getUser().getDeptId().indexOf(",") > 0){ |
| | | deptStr = userInfo.getUser().getDeptId().split(",")[0]; |
| | | |
| | | String deptIds = userInfo.getUser().getDeptId(); |
| | | if (deptIds.indexOf(",") > 0){ |
| | | deptStr = deptIds.split(",")[0]; |
| | | }else { |
| | | deptStr = userInfo.getUser().getDeptId(); |
| | | deptStr = deptIds; |
| | | } |
| | | |
| | | String resDeptIds = ""; |
| | | |
| | | resDeptIds = sysClient.getResDept(deptIds); |
| | | userInfo.getDetail().set("resDeptIds",resDeptIds); |
| | | |
| | | R<Dept> deptRes = sysClient.getDept(Long.valueOf(deptStr)); |
| | | if (StringUtil.isBlank(deptRes.getData().getAdCode())) { |
| | | // 部门为空 |
| | |
| | | userInfo.getDetail().set("adCodeBase", ""); |
| | | userInfo.getDetail().set("parentDept",0); |
| | | } else { |
| | | userInfo.getDetail().set("adCodeBase",attResManagePersonClient.getAdBaseById(deptRes.getData().getAdCode()).getData()); |
| | | //根据用户标识类型判断是水库还是堤防 |
| | | if (user.getType().equals("堤防")){ |
| | | //堤防需要从自己的库中获取行政区划 |
| | | userInfo.getDetail().set("adCodeBase",attResManagePersonClient.getYwxtAdBaseById(deptRes.getData().getAdCode()).getData()); |
| | | }else{ |
| | | //水库从中台表中获取行政区划 |
| | | userInfo.getDetail().set("adCodeBase",attResManagePersonClient.getAdBaseById(deptRes.getData().getAdCode()).getData()); |
| | | } |
| | | userInfo.getDetail().set("parentDept",deptRes.getData().getParentId()); |
| | | } |
| | | |
| | | String collectResIds = collectClient.getMyCollect(user.getId().toString()); |
| | | userInfo.getDetail().set("collect",collectResIds); |
| | | |
| | |
| | | /** |
| | | * 默认密码 |
| | | */ |
| | | String DEFAULT_PASSWORD = "Zhsk@123456"; |
| | | String DEFAULT_PASSWORD = "Zhsk@1123"; |
| | | |
| | | /** |
| | | * 默认密码参数值 |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package cn.gistack.resource.feign; |
| | | |
| | | import cn.gistack.resource.vo.AlertTextualResearchAttachVO; |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | import org.springblade.core.sms.model.SmsResponse; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ISmsClient |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @FeignClient( |
| | | value = AppConstant.APPLICATION_RESOURCE_NAME, |
| | | fallback = ITextualResearchAttachFallback.class |
| | | ) |
| | | public interface ITextualResearchAttachClient { |
| | | String API_PREFIX = "/client"; |
| | | |
| | | String GET_SY_DATA_MISSING = API_PREFIX + "getSyDataMissing"; |
| | | |
| | | String GET_BX_DATA_MISSING = API_PREFIX + "getBxDataMissing"; |
| | | |
| | | |
| | | @PostMapping(GET_SY_DATA_MISSING) |
| | | List<AlertTextualResearchAttachVO> getSyDataMissing(); |
| | | |
| | | @PostMapping(GET_BX_DATA_MISSING) |
| | | List<AlertTextualResearchAttachVO> getBxDataMissing(); |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package cn.gistack.resource.feign; |
| | | |
| | | import cn.gistack.resource.vo.AlertTextualResearchAttachVO; |
| | | import dm.jdbc.filter.stat.json.JSONArray; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 流程远程调用失败处理类 |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Component |
| | | public class ITextualResearchAttachFallback implements ITextualResearchAttachClient { |
| | | |
| | | |
| | | @Override |
| | | public List<AlertTextualResearchAttachVO> getSyDataMissing() { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public List<AlertTextualResearchAttachVO> getBxDataMissing() { |
| | | return null; |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.resource.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 告警资料缺失vo |
| | | */ |
| | | @Data |
| | | public class AlertTextualResearchAttachVO { |
| | | |
| | | private String res_cd; |
| | | private String res_nm; |
| | | private String town_cd; |
| | | private String town_nm; |
| | | private String county_cd; |
| | | private String county_nm; |
| | | private String city_cd; |
| | | private String city_nm; |
| | | |
| | | private String type; |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package cn.gistack.resource.feign; |
| | | |
| | | import cn.gistack.resource.service.TextualResearchAttachService; |
| | | import cn.gistack.resource.vo.AlertTextualResearchAttachVO; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static cn.gistack.resource.utils.SmsUtil.*; |
| | | |
| | | /** |
| | | * 短信远程调用服务 |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @NonDS |
| | | @RestController |
| | | @AllArgsConstructor |
| | | public class TextualResearchAttachClient implements ITextualResearchAttachClient { |
| | | private final TextualResearchAttachService textualResearchAttachService; |
| | | |
| | | |
| | | @Override |
| | | @PostMapping(GET_SY_DATA_MISSING) |
| | | public List<AlertTextualResearchAttachVO> getSyDataMissing() { |
| | | List<AlertTextualResearchAttachVO> syLackAlertList = textualResearchAttachService.getSyLackAlertList(); |
| | | return syLackAlertList; |
| | | } |
| | | |
| | | @Override |
| | | public List<AlertTextualResearchAttachVO> getBxDataMissing() { |
| | | List<AlertTextualResearchAttachVO> syLackAlertList = textualResearchAttachService.getWyLackAlertList(); |
| | | return syLackAlertList; |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | import cn.gistack.resource.entity.TextualResearchAttach; |
| | | import cn.gistack.resource.vo.AlertTextualResearchAttachVO; |
| | | import cn.gistack.resource.vo.TextualResearchAttachVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | */ |
| | | List<TextualResearchAttachVO> selectTextualResearchAttachPage(IPage<TextualResearchAttachVO> page, |
| | | @Param("textualResearchAttach") TextualResearchAttachVO textualResearchAttach); |
| | | |
| | | List<AlertTextualResearchAttachVO> getSyLackAlertList(); |
| | | |
| | | List<AlertTextualResearchAttachVO> getWyLackAlertList(); |
| | | } |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <resultMap id="vo" type="cn.gistack.resource.vo.AlertTextualResearchAttachVO"> |
| | | <result property="res_nm" column="res_nm"/> |
| | | <result property="res_cd" column="res_cd"/> |
| | | <result property="town_cd" column="town_cd"/> |
| | | <result property="town_nm" column="town_nm"/> |
| | | <result property="county_cd" column="county_cd"/> |
| | | <result property="county_nm" column="county_nm"/> |
| | | <result property="city_cd" column="city_cd"/> |
| | | <result property="city_nm" column="city_nm"/> |
| | | <result property="type" column="type"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="getSyLackAlertList" resultMap="vo"> |
| | | SELECT |
| | | info.res_cd, |
| | | info.res_nm, |
| | | info.town_cd, |
| | | info.town_nm, |
| | | info.county_cd, |
| | | info.county_nm, |
| | | info.city_cd, |
| | | info.city_nm, |
| | | info.typeList as type |
| | | |
| | | FROM ( |
| | | SELECT |
| | | basic."guid" res_cd, |
| | | basic."name" res_nm, |
| | | basic.townCode town_cd, |
| | | basic.townName town_nm, |
| | | basic.countyCode county_cd, |
| | | basic.countyName county_nm, |
| | | basic.cityCode city_cd, |
| | | basic.cityName city_nm, |
| | | LISTAGG(basic.type, ',') WITHIN GROUP (ORDER BY basic.type ASC) typeList from ( |
| | | SELECT |
| | | distinct |
| | | arb."guid",arb."name", |
| | | stra.type, |
| | | case when town."ad_grad" = 4 THEN town."ad_code" ELSE NULL END AS townCode, |
| | | case when town."ad_grad" = 4 THEN town."ad_name" ELSE NULL END AS townName, |
| | | case |
| | | when town."ad_grad" = 3 THEN town."ad_code" |
| | | when county."ad_grad" = 3 THEN county."ad_code" END AS countyCode, |
| | | case |
| | | when town."ad_grad" = 3 THEN town."ad_name" |
| | | when county."ad_grad" = 3 THEN county."ad_name" END AS countyName, |
| | | case |
| | | when town."ad_grad" = 2 THEN town."ad_code" |
| | | when county."ad_grad" = 2 THEN county."ad_code" |
| | | ELSE city."ad_code" END AS cityCode, |
| | | case |
| | | when town."ad_grad" = 2 THEN town."ad_name" |
| | | when county."ad_grad" = 2 THEN county."ad_name" |
| | | ELSE city."ad_name" END AS cityName |
| | | FROM SJZT_MD."att_res_base" arb |
| | | LEFT JOIN SJZT_MD."att_ad_base" town ON town."ad_code" = arb."interior_ad_guid" |
| | | LEFT JOIN SJZT_MD."att_ad_base" county ON county."ad_code" = town."p_ad_code" |
| | | LEFT JOIN SJZT_MD."att_ad_base" city ON city."ad_code" = county."p_ad_code" |
| | | LEFT JOIN YWXT.SM_TEXTUAL_RESEARCH_ATTACH STRA ON STRA.RES_GUID = arb."guid" and (stra.type = 2 or stra.type = 3 or stra.type = 8 or stra.type = 11 or stra.type = 12) |
| | | )basic |
| | | group by basic."guid",basic."name", |
| | | basic.townCode,basic.townName, |
| | | basic.countyCode,basic.countyName, |
| | | basic.cityCode,basic.cityName |
| | | )info |
| | | where info.typeList != '2,3,8,11,12' or info.typeList is null |
| | | </select> |
| | | <select id="getWyLackAlertList" resultMap="vo"> |
| | | |
| | | SELECT |
| | | distinct |
| | | arb."guid" res_cd, |
| | | arb."name" res_nm, |
| | | case when town."ad_grad" = 4 THEN town."ad_code" ELSE NULL END AS town_cd, |
| | | case when town."ad_grad" = 4 THEN town."ad_name" ELSE NULL END AS town_nm, |
| | | case |
| | | when town."ad_grad" = 3 THEN town."ad_code" |
| | | when county."ad_grad" = 3 THEN county."ad_code" END AS county_cd, |
| | | case |
| | | when town."ad_grad" = 3 THEN town."ad_name" |
| | | when county."ad_grad" = 3 THEN county."ad_name" END AS county_nm, |
| | | case |
| | | when town."ad_grad" = 2 THEN town."ad_code" |
| | | when county."ad_grad" = 2 THEN county."ad_code" |
| | | ELSE city."ad_code" END AS city_cd, |
| | | case |
| | | when town."ad_grad" = 2 THEN town."ad_name" |
| | | when county."ad_grad" = 2 THEN county."ad_name" |
| | | ELSE city."ad_name" END AS city_nm, |
| | | stra.type |
| | | from sjzt_md."att_res_base" arb |
| | | LEFT JOIN SJZT_MD."att_ad_base" town ON town."ad_code" = arb."interior_ad_guid" |
| | | LEFT JOIN SJZT_MD."att_ad_base" county ON county."ad_code" = town."p_ad_code" |
| | | LEFT JOIN SJZT_MD."att_ad_base" city ON city."ad_code" = county."p_ad_code" |
| | | LEFT JOIN YWXT.SM_TEXTUAL_RESEARCH_ATTACH STRA ON STRA.RES_GUID = arb."guid" and stra.type = 1 |
| | | where stra.type != 1 or stra.type is null |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | |
| | | import cn.gistack.resource.entity.TextualResearchAttach; |
| | | import cn.gistack.resource.vo.AlertTextualResearchAttachVO; |
| | | import cn.gistack.resource.vo.TextualResearchAttachVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 考证附件服务层 |
| | |
| | | * @return |
| | | */ |
| | | Object selectTextualResearchAttachPage(IPage<TextualResearchAttachVO> page, TextualResearchAttachVO textualResearchAttach); |
| | | |
| | | |
| | | /** |
| | | * 获取渗压监测基础资料缺失水库列表 |
| | | * @return |
| | | */ |
| | | List<AlertTextualResearchAttachVO> getSyLackAlertList(); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取位移监测基础资料缺失水库列表 |
| | | * @return |
| | | */ |
| | | List<AlertTextualResearchAttachVO> getWyLackAlertList(); |
| | | } |
| | |
| | | import cn.gistack.resource.entity.TextualResearchAttach; |
| | | import cn.gistack.resource.mapper.TextualResearchAttachMapper; |
| | | import cn.gistack.resource.service.TextualResearchAttachService; |
| | | import cn.gistack.resource.vo.AlertTextualResearchAttachVO; |
| | | import cn.gistack.resource.vo.TextualResearchAttachVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 考证附件服务实现层 |
| | |
| | | } |
| | | return page.setRecords(baseMapper.selectTextualResearchAttachPage(page,textualResearchAttach)); |
| | | } |
| | | |
| | | @Override |
| | | public List<AlertTextualResearchAttachVO> getSyLackAlertList() { |
| | | List<AlertTextualResearchAttachVO> list = baseMapper.getSyLackAlertList(); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<AlertTextualResearchAttachVO> getWyLackAlertList() { |
| | | List<AlertTextualResearchAttachVO> list = baseMapper.getWyLackAlertList(); |
| | | return list; |
| | | } |
| | | } |
| | |
| | | private String adCode; |
| | | |
| | | private String adLevel; |
| | | |
| | | private String alarmLevel; |
| | | } |
| | |
| | | * 数量 |
| | | */ |
| | | private Integer num; |
| | | |
| | | private String alarmLevel; |
| | | } |
| | |
| | | */ |
| | | private String source; |
| | | |
| | | private String resGuid; |
| | | |
| | | private String feedback; |
| | | |
| | | //是否异常 1是 2 否 |
| | | private String alertStatus; |
| | | } |
| | |
| | | String GET_NOT_READ_NUMBER = API_PREFIX + "/getNotReadNumber"; |
| | | String GET_NOT_READ_LIST = API_PREFIX + "/getNotReadList"; |
| | | |
| | | String GET_NO_ALERT_RES_LIST = API_PREFIX + "/getNoAlertResList"; |
| | | |
| | | /** |
| | | * 保存站内信记录信息 |
| | | * @param messageRecord |
| | |
| | | */ |
| | | @GetMapping(GET_NOT_READ_LIST) |
| | | List<MessageRecord> getNotReadList(@RequestParam("userId")String userId); |
| | | |
| | | @GetMapping(GET_NO_ALERT_RES_LIST) |
| | | String getNoAlertRes(@RequestParam("ruleName") String ruleName); |
| | | } |
| | |
| | | public List<MessageRecord> getNotReadList(String userId) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public String getNoAlertRes(String ruleName) { |
| | | return null; |
| | | } |
| | | } |
| | |
| | | String API_PREFIX = "/client"; |
| | | String QUERY_LIST_BY_PHONE = API_PREFIX + "/queryListByPhone"; |
| | | String GET_AD_BASE = API_PREFIX + "/getAdBaseById"; |
| | | String GET_YWXT_AD_BASE = API_PREFIX + "/getYwxtAdBaseById"; |
| | | String GET_PERSONG_LIST_BY_RES_GUID = API_PREFIX + "/getPersonListByResGuid"; |
| | | String GET_USER_LIST_BY_RES_GUID = API_PREFIX + "/getUserListByResGuid"; |
| | | String SYNCHARONIZATION_ADD_USER = API_PREFIX + "/synchronizationAddUser"; |
| | |
| | | |
| | | @GetMapping(GET_AD_BASE) |
| | | R getAdBaseById(@RequestParam("guid") String guid); |
| | | |
| | | @GetMapping(GET_YWXT_AD_BASE) |
| | | R getYwxtAdBaseById(@RequestParam("guid")String guid); |
| | | |
| | | /** |
| | | * 根据水库编号及责任人类型查询相关责任人信息 |
| | |
| | | */ |
| | | @GetMapping(GET_CITY_COUNTY_PERSONG_LIST_BY_RES_GUID) |
| | | List<PersonVO> getCityCountyPersonListByResGuid(@RequestParam("res_cd") String res_cd); |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R getYwxtAdBaseById(String guid) { |
| | | return R.fail("获取数据失败"); |
| | | } |
| | | |
| | | @Override |
| | | public List<PersonVO> getPersonListByResGuid(String res_cd, String personList) { |
| | | return null; |
| | | } |
| | |
| | | @ApiModelProperty(value = "区划名称") |
| | | private String adCode; |
| | | |
| | | private String adGrad; |
| | | |
| | | private String resGuid; |
| | | |
| | | } |
| | |
| | | String PARAM_VALUE = API_PREFIX + "/param-value"; |
| | | String REGION = API_PREFIX + "/region"; |
| | | |
| | | String UPDATE_DEPT_BY_TB = API_PREFIX + "updateDeptByTb"; |
| | | String GET_RES_DEPT = API_PREFIX + "getResDept"; |
| | | |
| | | /** |
| | | * 获取菜单 |
| | | * |
| | |
| | | @GetMapping(REGION) |
| | | R<Region> getRegion(@RequestParam("code") String code); |
| | | |
| | | @GetMapping(UPDATE_DEPT_BY_TB) |
| | | boolean updateDeptByTb(@RequestParam("adCode") String adCode, @RequestParam("resGuid") String resGuid); |
| | | |
| | | @GetMapping(GET_RES_DEPT) |
| | | String getResDept(@RequestParam("deptIds") String deptIds); |
| | | } |
| | |
| | | return R.fail("获取数据失败"); |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateDeptByTb(String adCode, String resGuid) { |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public String getResDept(String deptIds) { |
| | | return null; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | private String maced; |
| | | private String encdata; |
| | | |
| | | //水库或是堤防用户标识 |
| | | private String type; |
| | | |
| | | } |
| | |
| | | private String maced; |
| | | private String encdata; |
| | | |
| | | public UserEncipher(){ |
| | | |
| | | } |
| | | |
| | | public UserEncipher(User user){ |
| | | |
| | | this.setCode(user.getCode()); |
| | |
| | | <artifactId>skjcmanager-system-api</artifactId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.gistack</groupId> |
| | | <artifactId>skjcmanager-resource-api</artifactId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | return R.data(alarmRecordService.statisticAlarmRecordByAlarmRuleType(alarmRecord)); |
| | | } |
| | | |
| | | @GetMapping(value = "/statisticsPie") |
| | | public R statisticsPie(AlarmRecordVO alarmRecordVO){ |
| | | return R.data(alarmRecordService.statisticsPie(alarmRecordVO)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 按行政区统计告警 |
| | | * @param alarmRecord |
| | |
| | | List<AlarmRule> listAlarmRule(@Param("alarmRecord") AlarmRecordVO alarmRecord); |
| | | |
| | | |
| | | List<StatisticAlarmRecord> statisticsPie(@Param("alarmRecord") AlarmRecordVO alarmRecordVO); |
| | | } |
| | |
| | | END AS countyName, |
| | | case when b."ad_grad" = 2 THEN b."ad_name" |
| | | when c."ad_grad" = 2 THEN c."ad_name" |
| | | ELSE d."ad_name" END AS cityName |
| | | ELSE d."ad_name" END AS cityName, |
| | | sar1.alarm_level |
| | | from YWXT.sm_alarm_record sar |
| | | left join YWXT.sm_alarm_rule sar1 on sar.alarm_rule_id = sar1.id and sar1.is_deleted = 0 |
| | | left join SJZT_MD."att_res_base" a on a."guid" = sar.reservoir_number |
| | |
| | | </if> |
| | | <if test="alarmRecord.adCode!=null and alarmRecord.adCode!=''"> |
| | | and a."interior_ad_guid" like concat('%',#{alarmRecord.adCode},'%') |
| | | </if> |
| | | <if test="alarmRecord.alarmLevel != null and alarmRecord.alarmLevel !=''"> |
| | | and sar1.alarm_level = #{alarmRecord.alarmLevel} |
| | | </if> |
| | | order by sar.id desc |
| | | </select> |
| | |
| | | and rule_name = #{alarmRecord.ruleName} |
| | | </if> |
| | | </select> |
| | | <select id="statisticsPie" resultType="cn.gistack.alerts.alarmRule.vo.StatisticAlarmRecord"> |
| | | |
| | | SELECT |
| | | count(*) num,rule.alarm_level alarmLevel |
| | | FROM YWXT.sm_alarm_record record |
| | | LEFT JOIN ywxt.SM_ALARM_RULE rule on rule.id = record.alarm_rule_id |
| | | LEFT JOIN SJZT_MD."att_res_base" arb on arb."guid" = record.reservoir_number |
| | | where |
| | | record.is_deleted = 0 |
| | | <if test="alarmRecord.type != null and alarmRecord.type !=''"> |
| | | and rule.type = #{alarmRecord.type} |
| | | </if> |
| | | <if test="alarmRecord.adCode != null and alarmRecord.adCode !=''"> |
| | | and arb."interior_ad_guid" like concat('%',#{alarmRecord.adCode},'%') |
| | | </if> |
| | | <if test="alarmRecord.startTime!=null and alarmRecord.startTime!=''"> |
| | | and record.create_time >= #{alarmRecord.startTime} |
| | | </if> |
| | | <if test="alarmRecord.endTime!=null and alarmRecord.endTime!=''"> |
| | | and record.create_time <= #{alarmRecord.endTime} |
| | | </if> |
| | | <!-- <if test="alarmRecord.reservoirName != null and alarmRecord.reservoirName !=''">--> |
| | | <!-- and arb."name" LIKE CONCAT('%',#{alarmRecord.reservoirName},'%')--> |
| | | <!-- </if>--> |
| | | group by rule.alarm_level |
| | | order by field(rule.alarm_level,'蓝色预警','黄色预警','橙色预警','红色预警') |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | Object statisticAlarmRecord(AlarmRecordVO alarmRecord); |
| | | |
| | | Boolean updateStatus(AlarmRecord alarmRecord); |
| | | |
| | | Object statisticsPie(AlarmRecordVO alarmRecordVO); |
| | | } |
| | |
| | | |
| | | return b; |
| | | } |
| | | |
| | | @Override |
| | | public Object statisticsPie(AlarmRecordVO alarmRecordVO) { |
| | | if (!Strings.isBlank(alarmRecordVO.getAdCode())){ |
| | | alarmRecordVO.setAdCode(alarmRecordVO.getAdCode().replaceAll("0+$", "")); |
| | | } |
| | | // 查询统计数据 |
| | | List<StatisticAlarmRecord> list = baseMapper.statisticsPie(alarmRecordVO); |
| | | return list; |
| | | } |
| | | } |
| | |
| | | {{ |
| | | // add("county_nm,town_nm"); |
| | | add("res_nm"); |
| | | add("ms_flag"); |
| | | add("cd_nm"); |
| | | }}; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public static List<String> damSafetySyList = new ArrayList<String>() |
| | | {{ |
| | | add("city_nm,county_nm,town_nm"); |
| | | // add("city_nm,county_nm,town_nm"); |
| | | add("town_nm"); |
| | | add("res_nm"); |
| | | add("sy_val"); |
| | | add("tb_chec_fl_stag"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略24: 大坝安全监测告警-渗压资料缺失 |
| | | */ |
| | | public static List<String> syDataMissingList = new ArrayList<String>() |
| | | {{ |
| | | add("res_nm"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略25: 大坝安全监测告警-变形资料缺失 |
| | | */ |
| | | public static List<String> bxDataMissingList = new ArrayList<String>() |
| | | {{ |
| | | add("res_nm"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略26: 大坝安全监测告警-渗压水位低于管底高程 |
| | | */ |
| | | public static List<String> syLessThenPipe = new ArrayList<String>() |
| | | {{ |
| | | add("county_nm"); |
| | | add("town_nm"); |
| | | add("res_nm"); |
| | | add("cd_nm"); |
| | | add("min_value"); |
| | | add("diff_tbb_val_abs"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略27: 大坝安全监测告警-渗压水位高于管口高程 |
| | | */ |
| | | public static List<String> syHigherThenNozzle = new ArrayList<String>() |
| | | {{ |
| | | add("county_nm"); |
| | | add("town_nm"); |
| | | add("res_nm"); |
| | | add("cd_nm"); |
| | | add("max_value"); |
| | | add("diff_tbt_val"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略28: 大坝安全监测告警-水位高于坝顶高程 |
| | | */ |
| | | public static List<String> syHigherThenBdElevation = new ArrayList<String>() |
| | | {{ |
| | | add("county_nm"); |
| | | add("town_nm"); |
| | | add("res_nm"); |
| | | add("cd_nm"); |
| | | add("max_value"); |
| | | add("diff_val"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略29: 大坝安全监测告警-水位高于库水位 |
| | | */ |
| | | public static List<String> syHigherThenWaterLevel = new ArrayList<String>() |
| | | {{ |
| | | add("county_nm"); |
| | | add("town_nm"); |
| | | add("res_nm"); |
| | | add("cd_nm"); |
| | | add("max_value"); |
| | | add("diff_val"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略30: 水位长期不变,五日变幅小于5cm,十日变幅大于5cm小于8cm,三十日变幅大于8cm小于10cm |
| | | */ |
| | | public static List<String> syYellowRzChange = new ArrayList<String>() |
| | | {{ |
| | | add("county_nm"); |
| | | add("town_nm"); |
| | | add("res_nm"); |
| | | add("cd_nm"); |
| | | add("dayNum"); |
| | | add("diff_val"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略31: 渗压水位一日变幅大于0.5米小于1米,五日变幅大于1米小于2米,十日变幅大于2米小于5米,三十日变幅大于5米小于10米 |
| | | */ |
| | | public static List<String> syOrangeRzChange = new ArrayList<String>() |
| | | {{ |
| | | add("county_nm"); |
| | | add("town_nm"); |
| | | add("res_nm"); |
| | | add("cd_nm"); |
| | | add("val1"); |
| | | add("dayNum"); |
| | | add("diff_val"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略32: 渗压水位一日变幅大于1米小于2米,五日变幅大于2米小于5米,十日变幅大于5米小于10米,三十日变幅大于10米 |
| | | */ |
| | | public static List<String> syRedRzChange = new ArrayList<String>() |
| | | {{ |
| | | add("county_nm"); |
| | | add("town_nm"); |
| | | add("res_nm"); |
| | | add("cd_nm"); |
| | | add("val1"); |
| | | add("dayNum"); |
| | | add("diff_val"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略33: 近1h水位陡降 |
| | | */ |
| | | public static List<String> syRz1hChange = new ArrayList<String>() |
| | | {{ |
| | | add("county_nm"); |
| | | add("town_nm"); |
| | | add("res_nm"); |
| | | add("cd_nm"); |
| | | add("sy_val"); |
| | | add("type"); |
| | | add("diff_val"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略34: 变形值大于20mm小于50mm |
| | | */ |
| | | public static List<String> wyOver2Less5 = new ArrayList<String>() |
| | | {{ |
| | | add("city_nm"); |
| | | add("county_nm"); |
| | | add("res_nm"); |
| | | add("cd_nm"); |
| | | add("direction"); |
| | | add("val"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略35: 变形值大于50mm小于100mm |
| | | */ |
| | | public static List<String> wyOver5Less10 = new ArrayList<String>() |
| | | {{ |
| | | add("city_nm"); |
| | | add("county_nm"); |
| | | add("res_nm"); |
| | | add("cd_nm"); |
| | | add("direction"); |
| | | add("val"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略36: 变形值大于100mm |
| | | */ |
| | | public static List<String> wyOver10 = new ArrayList<String>() |
| | | {{ |
| | | add("city_nm"); |
| | | add("county_nm"); |
| | | add("res_nm"); |
| | | add("cd_nm"); |
| | | add("direction"); |
| | | add("val"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略36: 变形值大于100mm |
| | | */ |
| | | public static List<String> wy1hChangeOver10 = new ArrayList<String>() |
| | | {{ |
| | | add("city_nm"); |
| | | add("county_nm"); |
| | | add("res_nm"); |
| | | add("cd_nm"); |
| | | add("direction"); |
| | | add("val"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略36: 变形值大于100mm |
| | | */ |
| | | public static List<String> slOverLess = new ArrayList<String>() |
| | | {{ |
| | | add("county_nm"); |
| | | add("town_nm"); |
| | | add("res_nm"); |
| | | add("cd_nm"); |
| | | add("value"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略36: 变形值大于100mm |
| | | */ |
| | | public static List<String> videoOffline = new ArrayList<String>() |
| | | {{ |
| | | add("res_nm"); |
| | | add("video_name"); |
| | | }}; |
| | | } |
| | |
| | | /** |
| | | * 请求头url 前缀(dev) |
| | | */ |
| | | public static final String url_prefix_dev = "http://10.10.2.192"; |
| | | public static final String url_prefix_dev = "http://10.42.6.192"; |
| | | |
| | | /** |
| | | * 请求头url 前缀(prod) |
| | |
| | | */ |
| | | public static final String alarm_db_wy_none_api = "/services/1234567890ABCDEFGHIJKLMN/alarm/dt/wy/api"; |
| | | |
| | | /** |
| | | * 26.27 大坝安全监测告警-水位低于管底高程或大于管口高程 |
| | | */ |
| | | public static final String alarm_db_sy_less_or_higher_api = "/services/1234567890ABCDEFGHIJKLMN/press/pip/alarm/api"; |
| | | |
| | | /** |
| | | * 28. 大坝安全监测告警-水位大于坝顶高程 |
| | | */ |
| | | public static final String alarm_db_sy_higher_then_bdElevation_api = "/services/1234567890ABCDEFGHIJKLMN/press/dam/alarm/api"; |
| | | |
| | | /** |
| | | * 29. 大坝安全监测告警-水位大于库水位 |
| | | */ |
| | | public static final String alarm_db_sy_higher_then_water_level_api = "/services/1234567890ABCDEFGHIJKLMN/press/rz/alarm/api"; |
| | | |
| | | /** |
| | | * 30. 大坝安全监测告警-水位变幅 |
| | | */ |
| | | public static final String alarm_db_sy_rz_change_api = "/services/1234567890ABCDEFGHIJKLMN/press/bf/alarm/api"; |
| | | |
| | | /** |
| | | * 33. 大坝安全监测告警-近1h水位陡降 |
| | | */ |
| | | public static final String alarm_db_sy_rz_1h_change_api = "/services/1234567890ABCDEFGHIJKLMN/sy/alarm/recent/api"; |
| | | |
| | | /** |
| | | * 34. 大坝安全监测告警-位移变形值区间 |
| | | */ |
| | | public static final String alarm_db_wy_value_api = "/services/1234567890ABCDEFGHIJKLMN/wy/alarm/api"; |
| | | |
| | | /** |
| | | * 37. 大坝安全监测告警-近1h变形值陡变 |
| | | */ |
| | | public static final String alarm_db_wy_value_1h_change_over_10_api = "/services/1234567890ABCDEFGHIJKLMN/wy/alarm/recent/api"; |
| | | |
| | | /** |
| | | * 38. 大坝安全监测告警-渗流量变化 |
| | | */ |
| | | public static final String alarm_db_sl_value_change_api = "/services/1234567890ABCDEFGHIJKLMN/sl/alarm/api"; |
| | | |
| | | /** |
| | | * 38. 大坝安全监测告警-渗流量变化 |
| | | */ |
| | | public static final String alarm_video_offline_api = "/services/1234567890ABCDEFGHIJKLMN/wmst_not_online_list/api?pageNo=1&pageSize=9999"; |
| | | |
| | | } |
| | |
| | | import cn.gistack.alerts.notice.enums.DangerEnum; |
| | | import cn.gistack.alerts.sms.service.SmsService; |
| | | import cn.gistack.alerts.sms.vo.SmsRequestTemplate; |
| | | import cn.gistack.resource.vo.AlertTextualResearchAttachVO; |
| | | import cn.gistack.sm.intelligentCall.feign.OutCallClient; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | * @param isSendStation 是否发送站内信 |
| | | * @return |
| | | */ |
| | | @Async |
| | | public Map<String, Object> damSafetyHandle(AlarmRule alarmRule, |
| | | AlarmRuleDetail alarmRuleDetail, |
| | | JSONArray ztData, |
| | |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | map = smsService.sendSignMsgMergeCd(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate,alarmRule); |
| | | } |
| | | } |
| | | |
| | | |
| | | //保存记录 |
| | | public void damSafetySyNoneHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray ztData, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 拼接内容后面的联系方式,当前模板县水利部人员姓名电话 |
| | | if (smsRequestTemplate.getPersonVOList().size()>0) { |
| | | // 遍历,拼接县水利部人员电话 拼接发送的模板内容 |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list,alarmRule,uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 需要合并水库保存站内信记录信息 |
| | | noticeHandle.saveInStationInfoMerge(smsRequestTemplate,alarmRule); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | public Map<String, Object> damSafetyHandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | map = smsService.sendSignMsgMergeCd(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //渗压资料缺失 |
| | | public Map<String, Object> damSafetySyDataMissingHandle(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 策略26 短信-----渗压水位低于管底高程 |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public Map<String, Object> damSafetySyLessThenPipeHandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 策略26 站内信-----渗压水位低于管底高程 |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetySyLessThenPipeHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate,alarmRule); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略27 短信-----渗压水位高于管口高程 |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public Map<String, Object> damSafetySyHigherThenNozzleHandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 策略26 站内信-----渗压水位高于管口高程 |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetySyHigherThenNozzleHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate,alarmRule); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 策略28 短信-----渗压水位高于坝顶高程 |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public Map<String, Object> damSafetySyHigherThenBdElevationHandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略28 站内信-----渗压水位高于坝顶高程 |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetySyHigherThenBdElevationHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate,alarmRule); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略29 短信-----渗压水位高于库水位 |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public Map<String, Object> damSafetySyHigherThenWaterLevelHandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略29 站内信-----渗压水位高于库水位 |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetySyHigherThenWaterLevelHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate,alarmRule); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 策略30 短信-----水位长期不变,五日变幅小于5cm,十日变幅大于5cm小于8cm,三十日变幅大于8cm小于10cm |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public Map<String, Object> damSafetySyYellowChangeHandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略30 站内信-----水位长期不变,五日变幅小于5cm,十日变幅大于5cm小于8cm,三十日变幅大于8cm小于10cm |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetySyYellowChangeHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate,alarmRule); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 策略31 短信-----渗压水位一日变幅大于0.5米小于1米,五日变幅大于1米小于2米,十日变幅大于2米小于5米,三十日变幅大于5米小于10米 |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public Map<String, Object> damSafetySyOrangeChangeHandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | // for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // // 保存告警记录信息 |
| | | // AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | // if (null != alarmRecord) { |
| | | // list.add(alarmRecord.getId().toString()); |
| | | // } |
| | | // } |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略31 站内信-----渗压水位一日变幅大于0.5米小于1米,五日变幅大于1米小于2米,十日变幅大于2米小于5米,三十日变幅大于5米小于10米 |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetySyOrangeChangeHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | // for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // // 保存告警记录信息 |
| | | // AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | // if (null != alarmRecord) { |
| | | // list.add(alarmRecord.getId().toString()); |
| | | // } |
| | | // } |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate,alarmRule); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 策略32 短信-----渗压水位一日变幅大于1米小于2米,五日变幅大于2米小于5米,十日变幅大于5米小于10米,三十日变幅大于10米 |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public Map<String, Object> damSafetySyRedChangeHandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略32 站内信-----渗压水位一日变幅大于1米小于2米,五日变幅大于2米小于5米,十日变幅大于5米小于10米,三十日变幅大于10米 |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetySyRedChangeHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate,alarmRule); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 策略33 短信-----近1h水位陡降 |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public Map<String, Object> damSafetySyRz1hChangeHandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略33 站内信----- 近1h水位陡降 |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetySyRz1hChangeHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate,alarmRule); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 策略34 短信-----变形值大于20mm小于50mm |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public Map<String, Object> damSafetyWyOver2Less5HandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略34 站内信----- 变形值大于20mm小于50mm |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetyWyOver2Less5HandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate,alarmRule); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 策略35 短信-----变形值大于50mm小于100mm |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public Map<String, Object> damSafetyWyOver5Less10HandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略34 站内信----- 变形值大于50mm小于100mm |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetyWyOver5Less10HandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate,alarmRule); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略34 短信-----变形值大于100mm |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public Map<String, Object> damSafetyWyOver10HandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略34 站内信----- 变形值大于100mm |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetyWyOver10HandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate,alarmRule); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 策略34 短信-----近1h变形值大于10cm以上 |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public Map<String, Object> damSafetyWy1hChangeOver10HandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略34 站内信----- 近1h变形值大于10cm以上 |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetyWy1hChangeOver10HandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate,alarmRule); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 策略34 短信-----渗流值 |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public Map<String, Object> damSafetySlOverLessHandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略34 站内信----- 渗流值 |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetySlOverLessHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate,alarmRule); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 策略34 站内信----- 资料缺失 |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetySyDataMissingHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfoMergeNoCd(smsRequestTemplate,alarmRule); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略34 站内信----- 视频离线 |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void videoOfflineHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfoMergeVideo(smsRequestTemplate,alarmRule); |
| | | } |
| | | |
| | | } |
| | | |
| | | public void damSafetySyDataMissingHandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray ztData, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 遍历 |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list,alarmRule,uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 调用短信服务 |
| | | smsService.sendMergeSignMsg(smsRequestTemplate); |
| | | } |
| | | |
| | | public Map<String, Object> videoOfflineHandleSms(AlarmRule alarmRule, |
| | | AlarmRuleDetail alarmRuleDetail, |
| | | JSONArray ztData, |
| | | List<String> columnList, |
| | | Boolean flag, |
| | | String adCode, |
| | | Boolean isSendStation, |
| | | String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | map = smsService.sendSignMsgMergeCdVideo(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | } |
| | |
| | | package cn.gistack.alerts.notice.service.impl; |
| | | |
| | | import cn.com.flaginfo.sdk.cmc.api.result.ComResult; |
| | | import cn.com.flaginfo.sdk.cmc.api.sms.dynsend.DynSMSSendDataResult; |
| | | import cn.com.flaginfo.sdk.cmc.api.sms.send.SMSSendRequest; |
| | | import cn.gistack.alerts.alarmRule.entity.AlarmRecord; |
| | | import cn.gistack.alerts.alarmRule.entity.AlarmRecordDetail; |
| | | import cn.gistack.alerts.alarmRule.entity.AlarmRule; |
| | | import cn.gistack.alerts.alarmRule.entity.AlarmRuleDetail; |
| | | import cn.gistack.alerts.alarmRule.service.AlarmRecordService; |
| | | import cn.gistack.alerts.alarmRule.vo.AlarmRecordDetailVO; |
| | | import cn.gistack.alerts.notice.constant.ZnwhColumnConstant; |
| | | import cn.gistack.alerts.notice.constant.ZtApiUrlConstant; |
| | | import cn.gistack.alerts.notice.constant.ZtConfigConstant; |
| | | import cn.gistack.alerts.notice.enums.PersonEnum; |
| | | import cn.gistack.alerts.notice.util.FormatUtil; |
| | | import cn.gistack.alerts.push.service.IPushService; |
| | | import cn.gistack.alerts.sms.entity.SmsRecord; |
| | | import cn.gistack.alerts.sms.entity.SmsResult; |
| | | import cn.gistack.alerts.sms.entity.SmsTemplate; |
| | | import cn.gistack.alerts.sms.service.ISmsTemplateService; |
| | | import cn.gistack.alerts.sms.vo.SmsRequestTemplate; |
| | | import cn.gistack.alerts.sms.vo.Temp; |
| | | import cn.gistack.alerts.sse.server.SSEServer; |
| | | import cn.gistack.common.utils.SpringContextUtil; |
| | | import cn.gistack.sm.intelligentCall.feign.OutCallClient; |
| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.google.common.collect.Lists; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpEntity; |
| | |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Component |
| | | @Slf4j |
| | | public class NoticeHandle { |
| | | |
| | | |
| | |
| | | private OutCallClient outCallClient; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 短信发送数据组装 |
| | | * |
| | | * @param jsonArray 告警动态数据 |
| | | * @param alarmRule 告警规则信息 |
| | | * @param jsonArray 告警动态数据 |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param columnsList 列名集合信息 |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区编号(是否过滤区县数据) |
| | | * @param uuid 本次执行临时编号 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @param columnsList 列名集合信息 |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区编号(是否过滤区县数据) |
| | | * @param uuid 本次执行临时编号 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @return |
| | | */ |
| | | public SmsRequestTemplate getSendSmsTemplate(JSONArray jsonArray, |
| | | AlarmRule alarmRule, |
| | | AlarmRuleDetail alarmRuleDetail, |
| | | List<String> columnsList, |
| | | Boolean flag, |
| | | String adCode, |
| | | String uuid, |
| | | Boolean isSendStation) { |
| | | AlarmRule alarmRule, |
| | | AlarmRuleDetail alarmRuleDetail, |
| | | List<String> columnsList, |
| | | Boolean flag, |
| | | String adCode, |
| | | String uuid, |
| | | Boolean isSendStation) { |
| | | // 通过模板id 查询模板相关信息(外呼对应的模板id则为场景id) |
| | | SmsTemplate smsTemplate |
| | | = smsTemplateService.getOne(new QueryWrapper<SmsTemplate>().eq("id",alarmRuleDetail.getTemplateId()).eq("is_deleted",0)); |
| | | = smsTemplateService.getOne(new QueryWrapper<SmsTemplate>().eq("id", alarmRuleDetail.getTemplateId()).eq("is_deleted", 0)); |
| | | if (null != smsTemplate) { |
| | | // 创建消息发送对象 |
| | | SmsRequestTemplate smsRequestTemplate = new SmsRequestTemplate(); |
| | |
| | | // 解析模板并设置 title |
| | | smsRequestTemplate.setTitle(FormatUtil.composeMessage(smsTemplate.getContent())); |
| | | // 列名数据转换 |
| | | getColumnData(jsonArray, columnsList,smsRequestTemplate,alarmRuleDetail,flag,adCode,uuid); |
| | | getColumnData(jsonArray, columnsList, smsRequestTemplate, alarmRuleDetail, flag, adCode, uuid); |
| | | //返回 |
| | | return smsRequestTemplate; |
| | | } |
| | |
| | | |
| | | /** |
| | | * 列名数据转换 |
| | | * @param jsonArray 告警动态数据 |
| | | * @param columnsList 告警动态内容 key |
| | | * |
| | | * @param jsonArray 告警动态数据 |
| | | * @param columnsList 告警动态内容 key |
| | | * @param smsRequestTemplate 消息发送对象 |
| | | * @param alarmRuleDetail 告警人员角色ids |
| | | * @param flag 告警内容是否日期 |
| | | * @param adCode 行政区 code ,用于过滤数据 |
| | | * @param uuid 用于过滤数据 |
| | | * @param alarmRuleDetail 告警人员角色ids |
| | | * @param flag 告警内容是否日期 |
| | | * @param adCode 行政区 code ,用于过滤数据 |
| | | * @param uuid 用于过滤数据 |
| | | * @return |
| | | */ |
| | | private void getColumnData(JSONArray jsonArray, |
| | |
| | | // 告警内容 |
| | | List<List<String>> lists = new ArrayList<>(); |
| | | Set<String> set = new HashSet<>(); |
| | | |
| | | // 查询对应的角色信息 |
| | | List<String> roles = sysClient.getRoleNames(alarmRuleDetail.getAlarmPerson()).getData(); |
| | | |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | if (null!=adCode){ |
| | | if (null != adCode) { |
| | | // city_cd,county_cd 过滤数据 |
| | | String county_cd = jsonArray.getJSONObject(i).getString("county_cd"); |
| | | if (null!= county_cd && county_cd.equals(adCode)) { |
| | | jointData(jsonArray, columnsList, alarmRuleDetail, flag, personLists, lists, i,uuid,set); |
| | | if (null != county_cd && county_cd.equals(adCode)) { |
| | | // jointData(jsonArray, columnsList, alarmRuleDetail, flag, personLists, lists, i,uuid,set); |
| | | jointDataV2(jsonArray, columnsList, alarmRuleDetail, roles, flag, personLists, lists, i, uuid, set); |
| | | } |
| | | }else { |
| | | jointData(jsonArray, columnsList, alarmRuleDetail, flag, personLists, lists, i,uuid,set); |
| | | } else { |
| | | // jointData(jsonArray, columnsList, alarmRuleDetail, flag, personLists, lists, i,uuid,set); |
| | | jointDataV2(jsonArray, columnsList, alarmRuleDetail, roles, flag, personLists, lists, i, uuid, set); |
| | | } |
| | | } |
| | | // 设置信息 |
| | |
| | | smsRequestTemplate.setTemplateContent(lists); |
| | | } |
| | | |
| | | private void jointDataV2(JSONArray jsonArray, List<String> columnsList, AlarmRuleDetail alarmRuleDetail, List<String> roles, Boolean flag, List<PersonVO> personLists, List<List<String>> lists, int i, String uuid, Set<String> set) { |
| | | // 根据水库编号,所在区域查询需要发送的人员手机号及设置 |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | String res_cd = jsonObject.getString("res_cd"); |
| | | String res_nm = jsonObject.getString("res_nm"); |
| | | String town_nm = jsonObject.getString("town_nm"); |
| | | String county_nm = jsonObject.getString("county_nm"); |
| | | String city_nm = jsonObject.getString("city_nm"); |
| | | log.info("当前为第{}个水库,行政区划:{}-{}-{},水库编码:{},水库名称:{}", i + 1, city_nm, county_nm, town_nm, res_cd, res_nm); |
| | | String tempStr = uuid + res_cd; |
| | | // 去重水库操作,如果有重复的水库则不操作 |
| | | if (!set.contains(tempStr)) { |
| | | set.add(tempStr); |
| | | // 取出测站编码 |
| | | String stcd = jsonArray.getJSONObject(i).getString("stcd"); |
| | | if (StringUtil.isBlank(stcd)) { |
| | | stcd = jsonArray.getJSONObject(i).getString("cd"); |
| | | } |
| | | // 判断时间是否存在 |
| | | String tm = jsonArray.getJSONObject(i).getString("tm"); |
| | | String day = ""; |
| | | String hour = ""; |
| | | String minute = ""; |
| | | if (null != tm && !tm.equals("") && flag) { |
| | | //如果显示日期,并且中台的日期不为空,则使用中台的日期 |
| | | flag = true; |
| | | // 加入天,时,分 |
| | | day = tm.substring(8, 10); |
| | | hour = tm.substring(11, 13); |
| | | minute = tm.substring(14, 16); |
| | | } else if (flag) { |
| | | //如果显示日期,但是中台没传日期,就使用当前时间 |
| | | Date now = DateUtil.now(); |
| | | String formatTm = DateUtil.format(now, DateUtil.PATTERN_DATETIME); |
| | | // 加入天,时,分 |
| | | day = formatTm.substring(8, 10); |
| | | hour = formatTm.substring(11, 13); |
| | | minute = formatTm.substring(14, 16); |
| | | } else { |
| | | flag = false; |
| | | } |
| | | // 获取告警人员信息 |
| | | // getAlarmPersonList(jsonArray, columnsList, alarmRuleDetail,flag, personLists, lists, i, res_cd, day, hour, minute, stcd); |
| | | getAlarmPersonListV2(jsonArray, columnsList, alarmRuleDetail, roles, flag, personLists, lists, i, res_cd, day, hour, minute, stcd); |
| | | } |
| | | |
| | | } |
| | | |
| | | private void getAlarmPersonListV2(JSONArray jsonArray, List<String> columnsList, AlarmRuleDetail alarmRuleDetail, List<String> roles, Boolean flag, List<PersonVO> personLists, List<List<String>> lists, int i, String res_cd, String day, String hour, String minute, String stcd) { |
| | | // 查询告警人员信息 |
| | | // List<PersonVO> personVOList = getPersonListByResGuid(res_cd, alarmRuleDetail.getAlarmPerson()); |
| | | List<PersonVO> personVOList = getPersonListByResGuidV2(res_cd, roles); |
| | | if (personVOList.size() > 0) { |
| | | for (PersonVO personVO : personVOList) { |
| | | List<String> list = new ArrayList<>(); |
| | | list.add(stcd); |
| | | list.add(res_cd); |
| | | list.add(personVO.getPhone()); |
| | | if (flag) { |
| | | // 如果是电话告警,需要把日期拼到一起 |
| | | if (alarmRuleDetail.getAlarmMode().equals("电话")) { |
| | | String tem = day + "日" + hour + "时" + minute + "分"; |
| | | list.add(tem); |
| | | } else { |
| | | list.add(day); |
| | | list.add(hour); |
| | | list.add(minute); |
| | | } |
| | | } |
| | | // 变量将值放入集合中 |
| | | for (String column : columnsList) { |
| | | String[] split = column.split(","); |
| | | String format = ""; |
| | | // 内容处理 |
| | | format = addAlarmContent(jsonArray, i, split, format); |
| | | // 加入集合 |
| | | list.add(format); |
| | | } |
| | | lists.add(list); |
| | | } |
| | | } |
| | | personLists.addAll(personVOList); |
| | | |
| | | } |
| | | |
| | | private List<PersonVO> getPersonListByResGuidV2(String res_cd, List<String> roles) { |
| | | List<String> personList = new ArrayList<>(); |
| | | List<String> areaList = new ArrayList<>(); |
| | | // 遍历 |
| | | for (String role : roles) { |
| | | if (role.contains("责任人")) { |
| | | personList.add(PersonEnum.findByName(role).getType().toString()); |
| | | } else { |
| | | areaList.add(role); |
| | | } |
| | | } |
| | | // 根据角色,水库编号查询对应的告警人员信息 |
| | | List<PersonVO> list = new ArrayList<>(); |
| | | //1. 根据水库编号查询除责任人之外的人员信息 |
| | | if (areaList.size() > 0) { |
| | | List<PersonVO> personVOList = attResManagePersonClient.getUserListByResGuid(res_cd, String.join(",", areaList)); |
| | | list.addAll(personVOList); |
| | | } |
| | | //2. 根据水库编号及责任人类型查询相关责任人信息 |
| | | if (personList.size() > 0) { |
| | | List<PersonVO> personVOList1 = attResManagePersonClient.getPersonListByResGuid(res_cd, String.join(",", personList)); |
| | | // 合并人员数据 |
| | | list.addAll(personVOList1); |
| | | } |
| | | // 返回数据 |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 拼接列数据设置告警人员信息 |
| | | * @param jsonArray 告警动态数据 |
| | | * @param columnsList 告警动态内容 key |
| | | * |
| | | * @param jsonArray 告警动态数据 |
| | | * @param columnsList 告警动态内容 key |
| | | * @param alarmRuleDetail 告警人角色ids |
| | | * @param flag 告警内容是否日期 |
| | | * @param personLists 告警人 |
| | | * @param lists 告警内容 |
| | | * @param i 第几个 |
| | | * @param flag 告警内容是否日期 |
| | | * @param personLists 告警人 |
| | | * @param lists 告警内容 |
| | | * @param i 第几个 |
| | | * @return |
| | | */ |
| | | private void jointData(JSONArray jsonArray, |
| | |
| | | |
| | | /** |
| | | * 获取告警人员信息 |
| | | * @param jsonArray 接口水库相关数据 |
| | | * @param columnsList 模板对应列key |
| | | * |
| | | * @param jsonArray 接口水库相关数据 |
| | | * @param columnsList 模板对应列key |
| | | * @param alarmRuleDetail 告警人员角色ids |
| | | * @param flag 模板中是否填入时间 |
| | | * @param personLists 告警人员集合 |
| | | * @param lists 告警内容集合 |
| | | * @param i 第 i 个水库 |
| | | * @param res_cd 水库编码 |
| | | * @param day 日期 |
| | | * @param hour 小时 |
| | | * @param minute 分钟 |
| | | * @param stcd 测站编码 |
| | | * @param flag 模板中是否填入时间 |
| | | * @param personLists 告警人员集合 |
| | | * @param lists 告警内容集合 |
| | | * @param i 第 i 个水库 |
| | | * @param res_cd 水库编码 |
| | | * @param day 日期 |
| | | * @param hour 小时 |
| | | * @param minute 分钟 |
| | | * @param stcd 测站编码 |
| | | */ |
| | | private void getAlarmPersonList(JSONArray jsonArray, |
| | | List<String> columnsList, |
| | |
| | | list.add(personVO.getPhone()); |
| | | if (flag) { |
| | | // 如果是电话告警,需要把日期拼到一起 |
| | | if (alarmRuleDetail.getAlarmMode().equals("电话")){ |
| | | if (alarmRuleDetail.getAlarmMode().equals("电话")) { |
| | | String tem = day + "日" + hour + "时" + minute + "分"; |
| | | list.add(tem); |
| | | }else { |
| | | } else { |
| | | list.add(day); |
| | | list.add(hour); |
| | | list.add(minute); |
| | |
| | | |
| | | /** |
| | | * 告警内容拼接处理 |
| | | * |
| | | * @param jsonArray 数据 |
| | | * @param i 第几个 |
| | | * @param split key 值 |
| | | * @param format 值结果 |
| | | * @param i 第几个 |
| | | * @param split key 值 |
| | | * @param format 值结果 |
| | | * @return |
| | | */ |
| | | private String addAlarmContent(JSONArray jsonArray, int i,String[] split, String format) { |
| | | private String addAlarmContent(JSONArray jsonArray, int i, String[] split, String format) { |
| | | for (String s : split) { |
| | | // 超汛限水位 |
| | | if (s.equals("over_z")) { |
| | | String is_danger_res = "is_danger_res"; |
| | | if (null!= jsonArray.getJSONObject(i).getString(is_danger_res) && jsonArray.getJSONObject(i).getString(is_danger_res).equals("true")) { |
| | | format = format + "控制运用水位" + jsonArray.getJSONObject(i).getString(s); |
| | | } else if (null!= jsonArray.getJSONObject(i).getString(is_danger_res) && jsonArray.getJSONObject(i).getString(is_danger_res).equals("false")) { |
| | | format = format + "汛限水位" + jsonArray.getJSONObject(i).getString(s); |
| | | if (null != jsonArray.getJSONObject(i).getString(is_danger_res) && jsonArray.getJSONObject(i).getString(is_danger_res).equals("true")) { |
| | | format = format + "控制运用水位" + jsonArray.getJSONObject(i).getString(s); |
| | | } else if (null != jsonArray.getJSONObject(i).getString(is_danger_res) && jsonArray.getJSONObject(i).getString(is_danger_res).equals("false")) { |
| | | format = format + "汛限水位" + jsonArray.getJSONObject(i).getString(s); |
| | | } else { |
| | | format = format + jsonArray.getJSONObject(i).getString(s); |
| | | } |
| | | } else if (s.equals("rz")) { |
| | | // 水位 |
| | | String rz = "rz"; |
| | | if (null==jsonArray.getJSONObject(i).getString(rz)) { |
| | | if (null == jsonArray.getJSONObject(i).getString(rz)) { |
| | | format = format + "无数据"; |
| | | } else { |
| | | format = format + jsonArray.getJSONObject(i).getString(s) + "米"; |
| | |
| | | } else if (s.equals("alarm_val")) { |
| | | // 小时雨量 |
| | | String alarm_type = "alarm_type"; |
| | | if (null!=jsonArray.getJSONObject(i).getString(alarm_type) && !jsonArray.getJSONObject(i).getString(alarm_type).equals("")) { |
| | | if (null != jsonArray.getJSONObject(i).getString(alarm_type) && !jsonArray.getJSONObject(i).getString(alarm_type).equals("")) { |
| | | format = format + jsonArray.getJSONObject(i).getString(alarm_type) + "小时坝前点雨量" + jsonArray.getJSONObject(i).getString(s); |
| | | }else { |
| | | } else { |
| | | format = format + jsonArray.getJSONObject(i).getString(s); |
| | | } |
| | | } else if (s.equals("diff_dam")) { |
| | | String over_chec_fl_stag = "over_chec_fl_stag"; |
| | | // 如果是超校核的需要判断超值 |
| | | if (null!=jsonArray.getJSONObject(i).getString(over_chec_fl_stag) && !jsonArray.getJSONObject(i).getString(over_chec_fl_stag).equals("")) { |
| | | if (null != jsonArray.getJSONObject(i).getString(over_chec_fl_stag) && !jsonArray.getJSONObject(i).getString(over_chec_fl_stag).equals("")) { |
| | | // 校核,是否漫过坝顶(正数代表未漫过坝顶,负数则反之) |
| | | String diff_dam = jsonArray.getJSONObject(i).getString(s); |
| | | double parseDouble = Double.parseDouble(diff_dam); |
| | | if (parseDouble>0) { |
| | | if (parseDouble > 0) { |
| | | format = format + "距离大坝坝顶仅" + jsonArray.getJSONObject(i).getString(s); |
| | | }else { |
| | | } else { |
| | | format = format + "已漫过坝顶" + (-parseDouble); |
| | | } |
| | | }else { |
| | | } else { |
| | | format = format + jsonArray.getJSONObject(i).getString(s); |
| | | } |
| | | } else if (s.equals("ms_flag")) { |
| | | // 水位 |
| | | String ms_flag = "ms_flag"; |
| | | if (null!= jsonArray.getJSONObject(i).getString(ms_flag) && jsonArray.getJSONObject(i).getString(ms_flag).equals("sy")) { |
| | | format = format + "渗压"; |
| | | } else if (null!= jsonArray.getJSONObject(i).getString(ms_flag) && jsonArray.getJSONObject(i).getString(ms_flag).equals("sl")) { |
| | | format = format + "渗流" ; |
| | | } else if (null!= jsonArray.getJSONObject(i).getString(ms_flag) && jsonArray.getJSONObject(i).getString(ms_flag).equals("by")) { |
| | | format = format + "白蚁" ; |
| | | } else if (null!= jsonArray.getJSONObject(i).getString(ms_flag) && jsonArray.getJSONObject(i).getString(ms_flag).equals("bx")) { |
| | | format = format + "变形" ; |
| | | if (null != jsonArray.getJSONObject(i).getString(ms_flag) && jsonArray.getJSONObject(i).getString(ms_flag).equals("sy")) { |
| | | format = format + "渗压"; |
| | | } else if (null != jsonArray.getJSONObject(i).getString(ms_flag) && jsonArray.getJSONObject(i).getString(ms_flag).equals("sl")) { |
| | | format = format + "渗流"; |
| | | } else if (null != jsonArray.getJSONObject(i).getString(ms_flag) && jsonArray.getJSONObject(i).getString(ms_flag).equals("by")) { |
| | | format = format + "白蚁"; |
| | | } else if (null != jsonArray.getJSONObject(i).getString(ms_flag) && jsonArray.getJSONObject(i).getString(ms_flag).equals("bx")) { |
| | | format = format + "变形"; |
| | | } else { |
| | | format = format + jsonArray.getJSONObject(i).getString(s); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 保存告警记录信息 |
| | | * |
| | | * @param list |
| | | * @param alarmRule 告警规则 |
| | | * @param uuid 临时id |
| | | * @param uuid 临时id |
| | | * @return |
| | | */ |
| | | public AlarmRecord saveAlarmRecord(List<String> list, AlarmRule alarmRule, String uuid) { |
| | | AlarmRecord alarmRecord = alarmRecordService.getOne(new QueryWrapper<AlarmRecord>() |
| | | .eq("temp_code",uuid) |
| | | .eq("alarm_rule_id",alarmRule.getId()) |
| | | .eq("reservoir_number",list.get(1)) |
| | | .eq("temp_code", uuid) |
| | | .eq("alarm_rule_id", alarmRule.getId()) |
| | | .eq("reservoir_number", list.get(1)) |
| | | ); |
| | | if (null!=alarmRecord) { |
| | | if (null != alarmRecord) { |
| | | // 删除测站编号 |
| | | list.remove(0); |
| | | return alarmRecord; |
| | | }else { |
| | | } else { |
| | | AlarmRecord alarm = new AlarmRecord(); |
| | | // 设置相关信息 |
| | | alarm.setAlarmRuleId(alarmRule.getId().toString()); |
| | |
| | | |
| | | /** |
| | | * 查询告警人员信息 |
| | | * @param res_cd 水库 guid |
| | | * |
| | | * @param res_cd 水库 guid |
| | | * @param roleIds 角色ids |
| | | * @return |
| | | */ |
| | | private List<PersonVO> getPersonListByResGuid(String res_cd,String roleIds) { |
| | | private List<PersonVO> getPersonListByResGuid(String res_cd, String roleIds) { |
| | | // 查询对应的角色信息 |
| | | List<String> roles = sysClient.getRoleNames(roleIds).getData(); |
| | | List<String> roles = sysClient.getRoleNames(roleIds).getData(); |
| | | List<String> personList = new ArrayList<>(); |
| | | List<String> areaList = new ArrayList<>(); |
| | | // 遍历 |
| | | for (String role : roles) { |
| | | if (role.contains("责任人")){ |
| | | if (role.contains("责任人")) { |
| | | personList.add(PersonEnum.findByName(role).getType().toString()); |
| | | }else { |
| | | } else { |
| | | areaList.add(role); |
| | | } |
| | | } |
| | |
| | | List<PersonVO> list = new ArrayList<>(); |
| | | //1. 根据水库编号查询除责任人之外的人员信息 |
| | | if (areaList.size() > 0) { |
| | | List<PersonVO> personVOList = attResManagePersonClient.getUserListByResGuid(res_cd,String.join(",",areaList)); |
| | | List<PersonVO> personVOList = attResManagePersonClient.getUserListByResGuid(res_cd, String.join(",", areaList)); |
| | | list.addAll(personVOList); |
| | | } |
| | | //2. 根据水库编号及责任人类型查询相关责任人信息 |
| | |
| | | |
| | | /** |
| | | * 依次添加巡查责任人,技术责任人信息 |
| | | * |
| | | * @param list |
| | | * @param isPhone 是否保护电话 |
| | | */ |
| | | public void addPatrolTechnologyInfo(List<String> list,Boolean isPhone) { |
| | | // 查询巡查责任人姓名,技术责任人姓名信息 |
| | | List<PersonVO> personVOList = attResManagePersonClient.getPersonListByResGuid(list.get(1),"4,5"); |
| | | if (personVOList.size()>0) { |
| | | public void addPatrolTechnologyInfo(List<String> list, Boolean isPhone) { |
| | | // 根据水库id查询巡查责任人姓名,技术责任人姓名信息 |
| | | List<PersonVO> personVOList = attResManagePersonClient.getPersonListByResGuid(list.get(1), "4,5"); |
| | | if (personVOList.size() > 0) { |
| | | String xczrr = "-"; |
| | | String jszrr = "-"; |
| | | for (PersonVO personVO : personVOList) { |
| | | if (personVO.getType().equals("5")) { |
| | | xczrr = isPhone?personVO.getName()+":"+personVO.getPhone() : personVO.getName(); |
| | | xczrr = isPhone ? personVO.getName() + ":" + personVO.getPhone() : personVO.getName(); |
| | | } |
| | | if (personVO.getType().equals("4")) { |
| | | jszrr = isPhone?personVO.getName()+":"+personVO.getPhone() : personVO.getName(); |
| | | jszrr = isPhone ? personVO.getName() + ":" + personVO.getPhone() : personVO.getName(); |
| | | } |
| | | } |
| | | // 巡查责任人姓名 |
| | | list.add(xczrr); |
| | | // 技术责任人姓名 |
| | | list.add(jszrr); |
| | | }else { |
| | | } else { |
| | | // 巡查责任人姓名 |
| | | list.add("-"); |
| | | // 技术责任人姓名 |
| | |
| | | |
| | | /** |
| | | * 拼接市县水利部人员姓名及联系方式 |
| | | * |
| | | * @param list |
| | | */ |
| | | public void addCityCountyBusinessPersonInfo(List<String> list) { |
| | | // 根据水库编号查询市县水利部人员姓名及联系方式 |
| | | List<PersonVO> personVOList = attResManagePersonClient.getCityCountyPersonListByResGuid(list.get(1)); |
| | | if (personVOList.size()>0){ |
| | | if (personVOList.size() > 0) { |
| | | // 如果没有找到人员? |
| | | StringBuilder builder = new StringBuilder(); |
| | | for (PersonVO personVO : personVOList) { |
| | | builder.append(personVO.getName()).append(":").append(personVO.getPhone()).append(";"); |
| | | } |
| | | // 拼接水利部人员信息 |
| | | list.add(builder.substring(0,builder.length()-1)); |
| | | }else { |
| | | list.add(builder.substring(0, builder.length() - 1)); |
| | | } else { |
| | | list.add("-"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 依次添加行政责任人,主管部门责任人,技术责任人,巡查责任人信息 |
| | | * |
| | | * @param list |
| | | * @param personTypes |
| | | */ |
| | | public void addWaterMoreDesignPatrolTechnologyInfo(List<String> list,String personTypes) { |
| | | public void addWaterMoreDesignPatrolTechnologyInfo(List<String> list, String personTypes) { |
| | | String[] split = personTypes.split(","); |
| | | // 查询巡查责任人姓名,技术责任人姓名信息 |
| | | List<PersonVO> personVOList = attResManagePersonClient.getPersonListByResGuid(list.get(1),personTypes); |
| | | if (personVOList.size()>0) { |
| | | List<PersonVO> personVOList = attResManagePersonClient.getPersonListByResGuid(list.get(1), personTypes); |
| | | if (personVOList.size() > 0) { |
| | | String xzzrr = "-"; |
| | | String zgzrr = "-"; |
| | | String jszrr = "-"; |
| | | String xczrr = "-"; |
| | | for (PersonVO personVO : personVOList) { |
| | | String str = null!=personVO.getPhone() ? ":"+personVO.getPhone():"-"; |
| | | String str = null != personVO.getPhone() ? ":" + personVO.getPhone() : "-"; |
| | | if (personVO.getType().equals(split[0])) { |
| | | xzzrr = personVO.getName() + str; |
| | | } |
| | | if (personVO.getType().equals(split[1])) { |
| | | zgzrr = personVO.getName()+ str; |
| | | zgzrr = personVO.getName() + str; |
| | | } |
| | | if (personVO.getType().equals(split[2])) { |
| | | jszrr = personVO.getName()+ str; |
| | | jszrr = personVO.getName() + str; |
| | | } |
| | | if (personVO.getType().equals(split[3])) { |
| | | xczrr = personVO.getName()+ str; |
| | | xczrr = personVO.getName() + str; |
| | | } |
| | | } |
| | | // 行政 |
| | |
| | | list.add(jszrr); |
| | | // 巡查责任人姓名 |
| | | list.add(xczrr); |
| | | }else { |
| | | } else { |
| | | for (String type : split) { |
| | | list.add("-"); |
| | | } |
| | |
| | | public JSONArray getZtData(String params, String url) { |
| | | // 获取环境 |
| | | String activeProfile = SpringContextUtil.getActiveProfile(); |
| | | if (activeProfile.equals("dev")){ |
| | | if (activeProfile.equals("dev")) { |
| | | url = ZtApiUrlConstant.url_prefix_dev + url; |
| | | } |
| | | if (activeProfile.equals("prod")){ |
| | | if (activeProfile.equals("prod")) { |
| | | url = ZtApiUrlConstant.url_prefix_prod + url; |
| | | } |
| | | if (activeProfile.equals("test")){ |
| | | if (activeProfile.equals("test")) { |
| | | url = ZtApiUrlConstant.url_prefix_test + url; |
| | | } |
| | | //设置请求头 |
| | |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 调用中台接口查询数据,返回结果不同处理 |
| | | * |
| | | * @param params |
| | | * @param url |
| | | * @return |
| | | */ |
| | | public JSONArray getZtDataV2(String params, String url) { |
| | | // 获取环境 |
| | | String activeProfile = SpringContextUtil.getActiveProfile(); |
| | | if (activeProfile.equals("dev")) { |
| | | url = ZtApiUrlConstant.url_prefix_dev + url; |
| | | } |
| | | if (activeProfile.equals("prod")) { |
| | | url = ZtApiUrlConstant.url_prefix_prod + url; |
| | | } |
| | | if (activeProfile.equals("test")) { |
| | | url = ZtApiUrlConstant.url_prefix_test + url; |
| | | } |
| | | //设置请求头 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.add(ZtConfigConstant.header_key, ZtConfigConstant.header_value); |
| | | //封装请求头 |
| | | HttpEntity<MultiValueMap<String, Object>> formEntity = new HttpEntity<MultiValueMap<String, Object>>(headers); |
| | | try { |
| | | //有请求头,有参数请求 |
| | | ResponseEntity<String> responseEntity = |
| | | restTemplate.exchange(url + params, |
| | | HttpMethod.GET, |
| | | formEntity, |
| | | String.class); |
| | | JSONObject jsonObject = JSON.parseObject(responseEntity.getBody()); |
| | | |
| | | JSONObject data = jsonObject.getJSONObject("data"); |
| | | // 返回 |
| | | return JSONArray.parseArray(data.get("data").toString()); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 保存站内信记录信息 |
| | | * |
| | | * @param smsRequestTemplate |
| | | * @param alarmRule |
| | | * @return |
| | |
| | | messageRecord.setSender(AuthUtil.getUserId().toString()); |
| | | messageRecord.setSource("智能告警"); |
| | | messageRecord.setStatus(0); |
| | | |
| | | // 设置告警记录信息 |
| | | AlarmRecordDetail alarmRecordDetail = new AlarmRecordDetail(); |
| | | alarmRecordDetail.setReservoirNumber(list.get(0)); |
| | |
| | | alarmRecordDetail.setStatus(1); |
| | | // 删除 最后一个 告警记录id |
| | | list.remove(list.size() - 1); |
| | | messageRecord.setResGuid(list.get(0)); |
| | | // 删除 0 水库编码 |
| | | list.remove(0); |
| | | |
| | |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 保存站内信记录(水库合并) |
| | | * |
| | | * @param smsRequestTemplate |
| | | * @param alarmRule |
| | | * @return |
| | | */ |
| | | public Map<String, Object> saveInStationInfoMerge(SmsRequestTemplate smsRequestTemplate, AlarmRule alarmRule) { |
| | | // 取出数据 |
| | | SMSSendRequest request = new SMSSendRequest(); |
| | | SmsTemplate smsTemplate = smsRequestTemplate.getSmsTemplate(); |
| | | request.setTemplateId(smsTemplate.getTemplateId()); |
| | | List<List<String>> templateContent = smsRequestTemplate.getTemplateContent(); |
| | | |
| | | List<MessageRecord> messageRecordList = new ArrayList<>(); |
| | | List<Temp> tempList = new ArrayList<>(); |
| | | // 合并数据 |
| | | for (List<String> list : templateContent) { |
| | | Temp temp = new Temp(); |
| | | temp.setPhone(list.get(1)); |
| | | temp.setReservoirCode(list.get(0)); |
| | | temp.setReservoirName(list.get(2)); |
| | | temp.setCdNm(list.get(3)); |
| | | temp.setAlarmRecordId(list.get(list.size() - 1)); |
| | | // 放入临时集合 |
| | | tempList.add(temp); |
| | | } |
| | | |
| | | // 按手机号分组 |
| | | Map<String, List<Temp>> listMap = tempList.stream().collect(Collectors.groupingBy(Temp::getPhone)); |
| | | |
| | | listMap.forEach((phone, temps) -> { |
| | | List<String> resCdList = new ArrayList<>(); |
| | | MessageRecord messageRecord = new MessageRecord(); |
| | | |
| | | messageRecord.setTheme(alarmRule.getRuleName()); |
| | | messageRecord.setSender(AuthUtil.getUserId().toString()); |
| | | messageRecord.setSource("智能告警"); |
| | | messageRecord.setStatus(0); |
| | | messageRecord.setRecipient(phone); |
| | | |
| | | |
| | | StringBuilder builder = new StringBuilder(); |
| | | Map<String, List<Temp>> resCollect = temps.stream().collect(Collectors.groupingBy(Temp::getReservoirCode)); |
| | | List<String> contentList = new ArrayList<>(); |
| | | resCollect.forEach((resCode, contentTemp) -> { |
| | | resCdList.add(resCode); |
| | | List<String> cdNmList = new ArrayList<>(); |
| | | //凤凰水库(测点12170062992),大新众水库(测点12170063012、测点12170062998) |
| | | //因为只能按编号分组,名称会有重复,所以拿第一条数据的名称就行 |
| | | String resName = contentTemp.get(0).getReservoirName(); |
| | | contentTemp.forEach(info -> { |
| | | //把测站加进测站集合里 |
| | | cdNmList.add("测点" + info.getCdNm()); |
| | | }); |
| | | String cdNameListStr = String.join("、", cdNmList); |
| | | contentList.add(StringUtil.format("{}({})", resName, cdNameListStr)); |
| | | }); |
| | | String contentListStr = String.join(",", contentList); |
| | | //需要填充的数据 |
| | | List<String> fillList = new ArrayList<>(); |
| | | fillList.add(contentListStr); |
| | | String sendContent = contentConvert(smsTemplate.getContent(), fillList); |
| | | messageRecord.setContent(sendContent); |
| | | messageRecord.setResGuid(String.join(",",resCdList)); |
| | | messageRecordList.add(messageRecord); |
| | | }); |
| | | |
| | | // 保存告警记录详情信息 |
| | | if (smsRequestTemplate.getIsSendStation()) { |
| | | saveMessageRecord(messageRecordList); |
| | | } |
| | | Map<String, Object> map = new HashMap<>(2); |
| | | // 返回 |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 保存站内信记录(水库合并) |
| | | * |
| | | * @param smsRequestTemplate |
| | | * @param alarmRule |
| | | * @return |
| | | */ |
| | | public Map<String, Object> saveInStationInfoMergeVideo(SmsRequestTemplate smsRequestTemplate, AlarmRule alarmRule) { |
| | | // 取出数据 |
| | | SMSSendRequest request = new SMSSendRequest(); |
| | | SmsTemplate smsTemplate = smsRequestTemplate.getSmsTemplate(); |
| | | request.setTemplateId(smsTemplate.getTemplateId()); |
| | | List<List<String>> templateContent = smsRequestTemplate.getTemplateContent(); |
| | | |
| | | List<MessageRecord> messageRecordList = new ArrayList<>(); |
| | | List<Temp> tempList = new ArrayList<>(); |
| | | // 合并数据 |
| | | for (List<String> list : templateContent) { |
| | | Temp temp = new Temp(); |
| | | temp.setPhone(list.get(1)); |
| | | temp.setReservoirCode(list.get(0)); |
| | | temp.setReservoirName(list.get(2)); |
| | | temp.setCdNm(list.get(3)); |
| | | temp.setAlarmRecordId(list.get(list.size() - 1)); |
| | | // 放入临时集合 |
| | | tempList.add(temp); |
| | | } |
| | | |
| | | // 按手机号分组 |
| | | Map<String, List<Temp>> listMap = tempList.stream().collect(Collectors.groupingBy(Temp::getPhone)); |
| | | |
| | | |
| | | listMap.forEach((phone, temps) -> { |
| | | MessageRecord messageRecord = new MessageRecord(); |
| | | |
| | | messageRecord.setTheme(alarmRule.getRuleName()); |
| | | messageRecord.setSender(AuthUtil.getUserId().toString()); |
| | | messageRecord.setSource("智能告警"); |
| | | messageRecord.setStatus(0); |
| | | messageRecord.setRecipient(phone); |
| | | |
| | | List<String> resCdList = new ArrayList<>(); |
| | | Map<String, List<Temp>> resCollect = temps.stream().collect(Collectors.groupingBy(Temp::getReservoirCode)); |
| | | List<String> contentList = new ArrayList<>(); |
| | | resCollect.forEach((resCode, contentTemp) -> { |
| | | resCdList.add(resCode); |
| | | |
| | | List<String> cdNmList = new ArrayList<>(); |
| | | //凤凰水库(测点12170062992),大新众水库(测点12170063012、测点12170062998) |
| | | //因为只能按编号分组,名称会有重复,所以拿第一条数据的名称就行 |
| | | String resName = contentTemp.get(0).getReservoirName(); |
| | | contentTemp.forEach(info -> { |
| | | //把测站加进测站集合里 |
| | | cdNmList.add( info.getCdNm()); |
| | | }); |
| | | String cdNameListStr = String.join("、", cdNmList); |
| | | contentList.add(StringUtil.format("{}({})", resName, cdNameListStr)); |
| | | }); |
| | | String contentListStr = String.join(",", contentList); |
| | | //需要填充的数据 |
| | | List<String> fillList = new ArrayList<>(); |
| | | fillList.add(contentListStr); |
| | | String sendContent = contentConvert(smsTemplate.getContent(), fillList); |
| | | messageRecord.setContent(sendContent); |
| | | messageRecord.setResGuid(String.join(",",resCdList)); |
| | | messageRecordList.add(messageRecord); |
| | | }); |
| | | |
| | | // 保存告警记录详情信息 |
| | | if (smsRequestTemplate.getIsSendStation()) { |
| | | saveMessageRecord(messageRecordList); |
| | | } |
| | | Map<String, Object> map = new HashMap<>(2); |
| | | // 返回 |
| | | return map; |
| | | } |
| | | |
| | | |
| | | |
| | | public Map<String, Object> saveInStationInfoMergeNoCd(SmsRequestTemplate smsRequestTemplate, AlarmRule alarmRule) { |
| | | |
| | | // 取出数据 |
| | | SMSSendRequest request = new SMSSendRequest(); |
| | | SmsTemplate smsTemplate = smsRequestTemplate.getSmsTemplate(); |
| | | request.setTemplateId(smsTemplate.getTemplateId()); |
| | | List<List<String>> templateContent = smsRequestTemplate.getTemplateContent(); |
| | | |
| | | List<MessageRecord> messageRecordList = new ArrayList<>(); |
| | | List<Temp> tempList = new ArrayList<>(); |
| | | // 合并数据 |
| | | for (List<String> list : templateContent) { |
| | | Temp temp = new Temp(); |
| | | temp.setPhone(list.get(1)); |
| | | temp.setReservoirCode(list.get(0)); |
| | | temp.setReservoirName(list.get(2)); |
| | | temp.setAlarmRecordId(list.get(list.size() - 1)); |
| | | // 放入临时集合 |
| | | tempList.add(temp); |
| | | } |
| | | |
| | | // 按手机号分组 |
| | | Map<String, List<Temp>> listMap = tempList.stream().collect(Collectors.groupingBy(Temp::getPhone)); |
| | | |
| | | List<String> resCdList = new ArrayList<>(); |
| | | listMap.forEach((phone, temps) -> { |
| | | MessageRecord messageRecord = new MessageRecord(); |
| | | |
| | | messageRecord.setTheme(alarmRule.getRuleName()); |
| | | messageRecord.setSender(AuthUtil.getUserId().toString()); |
| | | messageRecord.setSource("智能告警"); |
| | | messageRecord.setStatus(0); |
| | | messageRecord.setRecipient(phone); |
| | | List<String> contentList = new ArrayList<>(); |
| | | //因为只能按编号分组,名称会有重复,所以拿第一条数据的名称就行 |
| | | temps.forEach(info -> { |
| | | resCdList.add(info.getReservoirCode()); |
| | | //把水库加进集合 |
| | | contentList.add(info.getReservoirName()); |
| | | }); |
| | | String contentListStr = String.join(",", contentList); |
| | | //需要填充的数据 |
| | | List<String> fillList = new ArrayList<>(); |
| | | fillList.add(contentListStr); |
| | | String sendContent = contentConvert(smsTemplate.getContent(), fillList); |
| | | messageRecord.setContent(sendContent); |
| | | |
| | | messageRecord.setResGuid(String.join(",",resCdList)); |
| | | messageRecordList.add(messageRecord); |
| | | }); |
| | | |
| | | // 保存告警记录详情信息 |
| | | if (smsRequestTemplate.getIsSendStation()) { |
| | | saveMessageRecord(messageRecordList); |
| | | } |
| | | Map<String, Object> map = new HashMap<>(2); |
| | | // 返回 |
| | | return map; |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 把填充内容补充到模板中 |
| | | * |
| | | * @param templateString 模板 |
| | | * @param strList 填充内容集合 |
| | | * @return |
| | | */ |
| | | private String contentConvert(String templateString, List<String> strList) { |
| | | |
| | | //把{}转换成%s |
| | | String formatTemplate = templateString.replaceAll("\\{.+?\\}", "%s"); |
| | | String content = String.format(formatTemplate, strList.toArray()); |
| | | return content; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 保存站内信记录信息 |
| | | * |
| | | * @param messageRecordList |
| | | */ |
| | | public void saveMessageRecord(List<MessageRecord> messageRecordList) { |
| | |
| | | for (MessageRecord messageRecord : messageRecordList) { |
| | | // 通过手机号获取用户id信息 |
| | | R<List<User>> listR = userClient.userInfoByPhone("000000", messageRecord.getRecipient()); |
| | | if (listR.getData().size()>0) { |
| | | if (listR.getData().size() > 0) { |
| | | messageRecord.setRecipient(listR.getData().get(0).getId().toString()); |
| | | } |
| | | } |
| | |
| | | for (MessageRecord messageRecord : messageRecordList) { |
| | | Map<String, Object> map = new HashMap<>(2); |
| | | // 查询当前用户未读消息个数 |
| | | map.put("count",messageClient.getNotReadNumber(messageRecord.getRecipient())); |
| | | map.put("record",messageRecord); |
| | | SSEServer.sendMessage("web:"+messageRecord.getRecipient(),new JSONObject(map).toJSONString()); |
| | | map.put("count", messageClient.getNotReadNumber(messageRecord.getRecipient())); |
| | | map.put("record", messageRecord); |
| | | SSEServer.sendMessage("web:" + messageRecord.getRecipient(), new JSONObject(map).toJSONString()); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 新增测试信息 |
| | | * |
| | | * @param messageRecordList |
| | | */ |
| | | private void addSendMsgTest(List<MessageRecord> messageRecordList) { |
| | |
| | | |
| | | /** |
| | | * 创建告警外呼任务 |
| | | * |
| | | * @param smsRequestTemplate |
| | | * @return |
| | | */ |
| | |
| | | // 修改手机号码为被叫号码 |
| | | titles.set(0, "被叫号码"); |
| | | titles.add("告警记录id"); |
| | | titles.add(0,"水库编号"); |
| | | map.put("titles",titles); |
| | | titles.add(0, "水库编号"); |
| | | map.put("titles", titles); |
| | | // 处理人员及预警相关数据并组装 |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | Map<String, String> stringMap = new HashMap<>(); |
| | | for (int i = 0; i < titles.size(); i++) { |
| | | stringMap.put(titles.get(i),list.get(i)); |
| | | stringMap.put(titles.get(i), list.get(i)); |
| | | } |
| | | mapList.add(stringMap); |
| | | } |
| | | map.put("list",mapList); |
| | | map.put("scenesId",smsRequestTemplate.getSmsTemplate().getTemplateId()); |
| | | map.put("list", mapList); |
| | | map.put("scenesId", smsRequestTemplate.getSmsTemplate().getTemplateId()); |
| | | String taskName = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy年MM月dd日HH:mm:ss")) + smsRequestTemplate.getAlarmRule().getRuleName() + "智能外呼"; |
| | | map.put("taskName",taskName); |
| | | map.put("taskName", taskName); |
| | | String taskScheduleTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | map.put("taskScheduleTime",taskScheduleTime); |
| | | map.put("taskScheduleTime", taskScheduleTime); |
| | | // 创建外呼任务 |
| | | return outCallClient.createOutCallTaskByAlarm(map); |
| | | } |
| | | |
| | | |
| | | public String getNoAlertRes(String ruleName) { |
| | | return messageClient.getNoAlertRes(ruleName); |
| | | } |
| | | } |
| | |
| | | import cn.gistack.alerts.alarmRule.service.AlarmRuleService; |
| | | import cn.gistack.alerts.notice.constant.ZtApiDataColumnConstant; |
| | | import cn.gistack.alerts.notice.constant.ZtApiUrlConstant; |
| | | import cn.gistack.resource.feign.ITextualResearchAttachClient; |
| | | import cn.gistack.resource.vo.AlertTextualResearchAttachVO; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | |
| | | @Autowired |
| | | private AsyncNoticeHandle asyncNoticeHandle; |
| | | |
| | | |
| | | @Autowired |
| | | private ITextualResearchAttachClient textualResearchAttachClient; |
| | | |
| | | |
| | | /** |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.no_z_last_api_all); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterInfoNotHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterInfoNotList,false, adCode, false); |
| | | asyncNoticeHandle.waterInfoNotHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.waterInfoNotList, false, adCode, false); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_z_not_normal_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterInfoNotHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterDataExcList,false, adCode, false); |
| | | asyncNoticeHandle.waterInfoNotHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.waterDataExcList, false, adCode, false); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_diff_dead_z_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterLessDeadHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterLessDeadList,true, adCode, false); |
| | | asyncNoticeHandle.waterLessDeadHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.waterLessDeadList, true, adCode, false); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 返回 |
| | | return "水位超低于死水位"; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_z_is_warn_over_flse_api); |
| | | //过滤不告警水库 |
| | | JSONArray resultData = filterNoAlertRes(ztData, arg1); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.waterComeOverHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterComeOverList,true, adCode, true); |
| | | asyncNoticeHandle.waterComeOverHandle(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.waterComeOverList, true, adCode, true); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return "水位接近汛限告警"; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.over_z_res_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterFirstOverHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterFirstOverList,true, adCode, true); |
| | | asyncNoticeHandle.waterFirstOverHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.waterFirstOverList, true, adCode, true); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_over_z_small_over_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | if (alarmRuleDetailList.get(0).getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterSmallScaleOverHandle1(alarmRule, alarmRuleDetailList.get(0), ztData,ZtApiDataColumnConstant.waterSmallScaleOverList,true, adCode, false,uuid); |
| | | asyncNoticeHandle.waterSmallScaleOverHandle1(alarmRule, alarmRuleDetailList.get(0), ztData, ZtApiDataColumnConstant.waterSmallScaleOverList, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetailList.get(1).getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterSmallScaleOverHandle2(alarmRule, alarmRuleDetailList.get(1), ztData,ZtApiDataColumnConstant.waterSmallScaleOverList,true, adCode, false,uuid); |
| | | asyncNoticeHandle.waterSmallScaleOverHandle2(alarmRule, alarmRuleDetailList.get(1), ztData, ZtApiDataColumnConstant.waterSmallScaleOverList, true, adCode, false, uuid); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_over_z_big_over_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | if (alarmRuleDetailList.get(0).getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterBigScaleOverHandle1(alarmRule, alarmRuleDetailList.get(0), ztData,ZtApiDataColumnConstant.waterBigScaleOverList1,true, adCode, false,uuid); |
| | | asyncNoticeHandle.waterBigScaleOverHandle1(alarmRule, alarmRuleDetailList.get(0), ztData, ZtApiDataColumnConstant.waterBigScaleOverList1, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetailList.get(1).getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterBigScaleOverHandle2(alarmRule, alarmRuleDetailList.get(1), ztData,ZtApiDataColumnConstant.waterBigScaleOverList2,true, adCode, false,uuid); |
| | | asyncNoticeHandle.waterBigScaleOverHandle2(alarmRule, alarmRuleDetailList.get(1), ztData, ZtApiDataColumnConstant.waterBigScaleOverList2, true, adCode, false, uuid); |
| | | } |
| | | } |
| | | } |
| | |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_over_des_is_warn_api); |
| | | |
| | | //过滤不告警水库 |
| | | JSONArray resultData = filterNoAlertRes(ztData, arg1); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterComeDesignHandleBySms(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterComeDesignList1,true, adCode, false,uuid); |
| | | asyncNoticeHandle.waterComeDesignHandleBySms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.waterComeDesignList1, true, adCode, false, uuid); |
| | | } |
| | | // if (alarmRuleDetail.getAlarmMode().equals("电话")) { |
| | | // asyncNoticeHandle.outCallHandleCall(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterComeDesignList2,true, adCode, false,uuid); |
| | | // } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.waterComeDesignHandleStation(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterComeDesignList3,true, adCode, true,uuid); |
| | | asyncNoticeHandle.waterComeDesignHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.waterComeDesignList3, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.over_des_rz_warn_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterMoreDesignHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterMoreDesignList,true, adCode, false,uuid); |
| | | asyncNoticeHandle.waterMoreDesignHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.waterMoreDesignList, true, adCode, false, uuid); |
| | | } |
| | | // if (alarmRuleDetail.getAlarmMode().equals("电话")) { |
| | | // asyncNoticeHandle.outCallHandleCall(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterMoreDesignList,true, adCode, false,uuid); |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_over_chec_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterMoreCheckHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterMoreCheckList,true, adCode, false,uuid); |
| | | asyncNoticeHandle.waterMoreCheckHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.waterMoreCheckList, true, adCode, false, uuid); |
| | | } |
| | | // if (alarmRuleDetail.getAlarmMode().equals("电话")) { |
| | | // asyncNoticeHandle.outCallHandleCall(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterMoreCheckList,true, adCode, false,uuid); |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_z_diff_up_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterComeOneHourUpHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterComeOneHourUpList,true, adCode, false,uuid); |
| | | asyncNoticeHandle.waterComeOneHourUpHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.waterComeOneHourUpList, true, adCode, false, uuid); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_z_diff_down_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterComeOneHourDownHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterComeOneHourDownList,true, adCode, false,uuid); |
| | | asyncNoticeHandle.waterComeOneHourDownHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.waterComeOneHourDownList, true, adCode, false, uuid); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_rain_dy_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.alreadyHeavyRainHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.alreadyHeavyRainList,true, adCode, false); |
| | | asyncNoticeHandle.alreadyHeavyRainHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.alreadyHeavyRainList, true, adCode, false); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_rain_by_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.alreadyRainstormHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.alreadyRainstormList,true, adCode, false); |
| | | asyncNoticeHandle.alreadyRainstormHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.alreadyRainstormList, true, adCode, false); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_rain_6_over_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.sixHourRainHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.sixHourRainList,true, adCode, false,uuid); |
| | | asyncNoticeHandle.sixHourRainHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.sixHourRainList, true, adCode, false, uuid); |
| | | } |
| | | // if (alarmRuleDetail.getAlarmMode().equals("电话")) { |
| | | // asyncNoticeHandle.outCallHandleCall(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.sixHourRainList,true, adCode, false,uuid); |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.damSafetyList,true, adCode, false,uuid); |
| | | asyncNoticeHandle.damSafetyHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.damSafetyList, true, adCode, false, uuid); |
| | | } |
| | | } |
| | | } |
| | |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("?is_alarm=1", ZtApiUrlConstant.alarm_db_sy_api); |
| | | |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData = filterNoAlertRes(ztData,arg1); |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.damSafetySyList,true, adCode, true,uuid); |
| | | asyncNoticeHandle.damSafetySyHandle(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.damSafetySyList, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | |
| | | //String adCode = "420607000000"; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | String adCode = null; |
| | | // 查询当前策略对应的告警规则信息 |
| | | // 查询当前策略对应的告警规则信息,根据名称获取告警信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sy_none_api); |
| | | |
| | | JSONArray resultData = filterNoAlertRes(ztData, arg1); |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.damSafetyList,true, adCode, false,uuid); |
| | | asyncNoticeHandle.damSafetyHandle(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.damSafetyList, false, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyNoneHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.damSafetyList, false, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sl_none_api); |
| | | JSONArray resultData = filterNoAlertRes(ztData, arg1); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.damSafetyList,true, adCode, false,uuid); |
| | | asyncNoticeHandle.damSafetyHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.damSafetyList, false, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyNoneHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.damSafetyList, false, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_wy_none_api); |
| | | JSONArray resultData = filterNoAlertRes(ztData, arg1); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.damSafetyList,true, adCode, false,uuid); |
| | | asyncNoticeHandle.damSafetyHandle(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.damSafetyList, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyNoneHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.damSafetyList, false, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | |
| | | return "大坝安全监测告警"; |
| | | } |
| | | |
| | | /** |
| | | * 策略24:渗压基础数据缺失 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetySyDataMissingHandle(String arg1, String arg2) { |
| | | |
| | | String uuid = UUID.randomUUID().toString(); |
| | | String adCode = null; |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | //调用本地服务获取数据 |
| | | List<AlertTextualResearchAttachVO> syDataMissing = textualResearchAttachClient.getSyDataMissing(); |
| | | |
| | | JSONArray data = JSON.parseArray(JSON.toJSONString(syDataMissing)); |
| | | JSONArray resultData = filterNoAlertRes(data, arg1); |
| | | |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyDataMissingHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syDataMissingList, false, adCode, true, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")){ |
| | | asyncNoticeHandle.damSafetySyDataMissingHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syDataMissingList, false, adCode, false, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return "大坝安全监测渗压资料缺失告警"; |
| | | } |
| | | |
| | | /** |
| | | * 策略25:变形基础数据缺失 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetyBxDataMissingHandle(String arg1, String arg2) { |
| | | String uuid = UUID.randomUUID().toString(); |
| | | String adCode = null; |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | //调用本地服务获取数据 |
| | | List<AlertTextualResearchAttachVO> syDataMissing = textualResearchAttachClient.getBxDataMissing(); |
| | | |
| | | JSONArray data = JSON.parseArray(JSON.toJSONString(syDataMissing)); |
| | | JSONArray resultData = filterNoAlertRes(data, arg1); |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyDataMissingHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.bxDataMissingList, false, adCode, true, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")){ |
| | | asyncNoticeHandle.damSafetySyDataMissingHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.bxDataMissingList, false, adCode, false, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return "大坝安全监测变形资料缺失告警"; |
| | | } |
| | | |
| | | /** |
| | | * 策略26:水位低于管底高程 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetySyLessThenPipeHandle(String arg1, String arg2) { |
| | | |
| | | |
| | | String adCode = null; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sy_less_or_higher_api); |
| | | JSONArray array = lessOrHigher(ztData, "less"); |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData = filterNoAlertRes(array,arg1); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyLessThenPipeHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syLessThenPipe, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyLessThenPipeHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syLessThenPipe, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return "水位低于管底高程告警"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略27:水位高于管口高程 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetySyHigherThenNozzleHandle(String arg1, String arg2) { |
| | | |
| | | String adCode = null; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sy_less_or_higher_api); |
| | | |
| | | |
| | | JSONArray array = lessOrHigher(ztData, "higher"); |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData = filterNoAlertRes(array,arg1); |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyHigherThenNozzleHandleSms(alarmRule, alarmRuleDetail, resultData,ZtApiDataColumnConstant.syHigherThenNozzle,true, adCode, false,uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyHigherThenNozzleHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syHigherThenNozzle, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return "水位高于管口高程告警"; |
| | | } |
| | | |
| | | /** |
| | | * 策略28:水位高于坝顶高程 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetySyHigherThenBdElevationHandle(String arg1, String arg2) { |
| | | |
| | | String adCode = null; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sy_higher_then_bdElevation_api); |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData = filterNoAlertRes(ztData,arg1); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyHigherThenBdElevationHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syHigherThenBdElevation, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyHigherThenBdElevationHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syHigherThenBdElevation, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return "水位高于坝顶高程告警"; |
| | | } |
| | | |
| | | /** |
| | | * 水位高于库水位告警 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetySyHigherThenWaterLevelHandle(String arg1, String arg2) { |
| | | String adCode = null; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sy_higher_then_water_level_api); |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData = filterNoAlertRes(ztData,arg1); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyHigherThenWaterLevelHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syHigherThenWaterLevel, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyHigherThenWaterLevelHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syHigherThenWaterLevel, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return "水位高于库水位告警"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 水位长期不变,五日变幅小于5cm,十日变幅大于5cm小于8cm,三十日变幅大于8cm小于10cm |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetySyYellowChangeHandle(String arg1, String arg2) { |
| | | String adCode = null; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sy_rz_change_api); |
| | | |
| | | JSONArray data = changeRange(ztData, "1"); |
| | | |
| | | |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData = filterNoAlertRes(data,arg1); |
| | | |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyYellowChangeHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syYellowRzChange, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyYellowChangeHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syYellowRzChange, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return "水位五日变幅小于5cm,十日变幅大于5cm小于8cm,三十日变幅大于8cm小于10cm告警"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 渗压水位一日变幅大于0.5米小于1米,五日变幅大于1米小于2米,十日变幅大于2米小于5米,三十日变幅大于5米小于10米 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetySyOrangeChangeHandle(String arg1, String arg2) { |
| | | String adCode = null; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sy_rz_change_api); |
| | | |
| | | JSONArray data = changeRange(ztData, "2"); |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData = filterNoAlertRes(data,arg1); |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyOrangeChangeHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syOrangeRzChange, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyOrangeChangeHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syOrangeRzChange, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return "水位一日变幅大于0.5米小于1米,五日变幅大于1米小于2米,十日变幅大于2米小于5米,三十日变幅大于5米小于10米告警"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 渗压水位一日变幅大于1米小于2米,五日变幅大于2米小于5米,十日变幅大于5米小于10米,三十日变幅大于10米 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetySyRedChangeHandle(String arg1, String arg2) { |
| | | String adCode = null; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sy_rz_change_api); |
| | | |
| | | JSONArray data = changeRange(ztData, "3"); |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData = filterNoAlertRes(data,arg1); |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyRedChangeHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syRedRzChange, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyRedChangeHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syRedRzChange, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return "水位一日变幅大于0.5米小于1米,五日变幅大于1米小于2米,十日变幅大于2米小于5米,三十日变幅大于5米小于10米告警"; |
| | | } |
| | | |
| | | /** |
| | | * 近1h水位陡降 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetySyRz1hChangeHandle(String arg1, String arg2) { |
| | | String adCode = null; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sy_rz_1h_change_api); |
| | | |
| | | JSONArray data = judgeType(ztData); |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData = filterNoAlertRes(data,arg1); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyRz1hChangeHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syRz1hChange, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyRz1hChangeHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syRz1hChange, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return "近1h水位陡降告警"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 变形值大于20mm小于50mm |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetyWyOver2Less5Handle(String arg1, String arg2) { |
| | | |
| | | String adCode = null; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_wy_value_api); |
| | | |
| | | JSONArray data = judgeDirection(ztData, "1"); |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData = filterNoAlertRes(data,arg1); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyWyOver2Less5HandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wyOver2Less5, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetyWyOver2Less5HandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wyOver2Less5, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return "变形值大于2cm小于5cm告警"; |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 变形值大于50mm小于100mm |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetyWyOver5Less10Handle(String arg1, String arg2) { |
| | | |
| | | String adCode = null; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_wy_value_api); |
| | | |
| | | JSONArray data = judgeDirection(ztData, "2"); |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData = filterNoAlertRes(data,arg1); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyWyOver5Less10HandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wyOver5Less10, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetyWyOver5Less10HandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wyOver5Less10, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return "变形值大于5cm小于10cm告警"; |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 近1h变形值大于10cm以上 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetyWyOver10Handle(String arg1, String arg2) { |
| | | |
| | | String adCode = null; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_wy_value_1h_change_over_10_api); |
| | | JSONArray data = judgeDirection(ztData, "3"); |
| | | |
| | | |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData = filterNoAlertRes(data,arg1); |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyWyOver10HandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wyOver10, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetyWyOver10HandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wyOver10, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return "变形值大于10cm告警"; |
| | | } |
| | | |
| | | /** |
| | | * 近1h变形值大于10cm以上 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetyWy1hChangeOver10Handle(String arg1, String arg2) { |
| | | |
| | | String adCode = null; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_wy_value_1h_change_over_10_api); |
| | | JSONArray data = judgeDirectionV2(ztData); |
| | | |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData = filterNoAlertRes(data,arg1); |
| | | |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyWy1hChangeOver10HandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wy1hChangeOver10, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetyWy1hChangeOver10HandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wy1hChangeOver10, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | return "近1h变形值大于10cm以上告警"; |
| | | } |
| | | |
| | | /** |
| | | * 渗流量一日大于5L小于8L,连续3日增加 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetySlOver5Less8Handle(String arg1, String arg2) { |
| | | |
| | | String adCode = null; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sl_value_change_api); |
| | | JSONArray data = filterData(ztData,"1"); |
| | | |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData = filterNoAlertRes(data,arg1); |
| | | |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySlOverLessHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wy1hChangeOver10, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySlOverLessHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wy1hChangeOver10, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return "渗流量一日大于5L小于8L,连续3日增加告警"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 渗流量一日大于8L小于10L,连续3日增加 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetySlOver8Less10Handle(String arg1, String arg2) { |
| | | |
| | | String adCode = null; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sl_value_change_api); |
| | | JSONArray data = filterData(ztData,"2"); |
| | | |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData = filterNoAlertRes(data,arg1); |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySlOverLessHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wy1hChangeOver10, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySlOverLessHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wy1hChangeOver10, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return "渗流量一日大于5L小于8L,连续3日增加告警"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 渗流量一日大于10L,连续3日增加 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetySlOver10Handle(String arg1, String arg2) { |
| | | |
| | | String adCode = null; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sl_value_change_api); |
| | | JSONArray data = filterData(ztData,"3"); |
| | | |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData = filterNoAlertRes(data,arg1); |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySlOverLessHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wy1hChangeOver10, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySlOverLessHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wy1hChangeOver10, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return "渗流量一日大于5L小于8L,连续3日增加告警"; |
| | | } |
| | | |
| | | /** |
| | | * 视频离线 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String videoOfflineHandle(String arg1, String arg2) { |
| | | |
| | | String adCode = null; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtDataV2("", ZtApiUrlConstant.alarm_video_offline_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.videoOfflineHandleStation(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.videoOffline, false, adCode, true, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.videoOfflineHandleSms(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.videoOffline, false, adCode, false, uuid); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | return "视频信息缺失告警"; |
| | | } |
| | | |
| | | private JSONArray filterData(JSONArray ztData, String level) { |
| | | |
| | | JSONArray array = new JSONArray(); |
| | | for (int i = 0; i < ztData.size(); i++) { |
| | | JSONObject jsonObject = ztData.getJSONObject(i); |
| | | String dataLevel = jsonObject.getString("level"); |
| | | |
| | | if (dataLevel.equals(level)) { |
| | | array.add(jsonObject); |
| | | } |
| | | } |
| | | return array; |
| | | } |
| | | |
| | | /** |
| | | * 判断方向 |
| | | * |
| | | * @param ztData |
| | | * @return |
| | | */ |
| | | private JSONArray judgeDirectionV2(JSONArray ztData) { |
| | | JSONArray array = new JSONArray(); |
| | | for (int i = 0; i < ztData.size(); i++) { |
| | | JSONObject jsonObject = ztData.getJSONObject(i); |
| | | //上下游方向 |
| | | Double diffDe = jsonObject.getDouble("diff_de"); |
| | | //左右岸方向 |
| | | Double diffDn = jsonObject.getDouble("diff_dn"); |
| | | //垂直 |
| | | Double diffDu = jsonObject.getDouble("diff_du"); |
| | | |
| | | String direction = ""; |
| | | String val = ""; |
| | | //近1h变形值大于10cm以上 |
| | | if (diffDe > 100) { |
| | | direction = "上下游方向"; |
| | | val = diffDe.toString(); |
| | | } else if (diffDn > 100) { |
| | | direction = "左右岸方向"; |
| | | val = diffDn.toString(); |
| | | } else if (diffDu > 100) { |
| | | direction = "垂直"; |
| | | val = diffDu.toString(); |
| | | } |
| | | |
| | | jsonObject.put("direction", direction); |
| | | jsonObject.put("val", val); |
| | | array.add(jsonObject); |
| | | |
| | | } |
| | | return array; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 判断方向 |
| | | * |
| | | * @param ztData |
| | | * @return |
| | | */ |
| | | private JSONArray judgeDirection(JSONArray ztData, String level) { |
| | | JSONArray array = new JSONArray(); |
| | | for (int i = 0; i < ztData.size(); i++) { |
| | | JSONObject jsonObject = ztData.getJSONObject(i); |
| | | String dataLevel = jsonObject.getString("level"); |
| | | //上下游方向 |
| | | Double deVal = jsonObject.getDouble("de_val"); |
| | | //左右岸方向 |
| | | Double dnVal = jsonObject.getDouble("dn_val"); |
| | | //垂直 |
| | | Double duValue = jsonObject.getDouble("du_value"); |
| | | |
| | | String direction = ""; |
| | | String val = ""; |
| | | |
| | | if (dataLevel.equals(level)) { |
| | | if (level.equals("1")) { |
| | | //变形值大于20mm小于50mm |
| | | if (20 < deVal && deVal < 50) { |
| | | direction = "上下游方向"; |
| | | val = deVal.toString(); |
| | | } else if (20 < dnVal && dnVal < 50) { |
| | | direction = "左右岸方向"; |
| | | val = dnVal.toString(); |
| | | } else if (20 < duValue && duValue < 50) { |
| | | direction = "垂直"; |
| | | val = duValue.toString(); |
| | | } |
| | | } else if (level.equals("2")) { |
| | | //变形值大于50mm小于100mm |
| | | if (50 < deVal && deVal < 100) { |
| | | direction = "上下游方向"; |
| | | val = deVal.toString(); |
| | | } else if (50 < dnVal && dnVal < 100) { |
| | | direction = "左右岸方向"; |
| | | val = dnVal.toString(); |
| | | } else if (50 < duValue && duValue < 100) { |
| | | direction = "垂直"; |
| | | val = duValue.toString(); |
| | | } |
| | | } else if (level.equals("3")) { |
| | | //变形值大于100mm |
| | | |
| | | if (deVal > 100) { |
| | | direction = "上下游方向"; |
| | | val = deVal.toString(); |
| | | } else if (dnVal > 100) { |
| | | direction = "左右岸方向"; |
| | | val = dnVal.toString(); |
| | | } else if (duValue > 100) { |
| | | direction = "垂直"; |
| | | val = duValue.toString(); |
| | | } |
| | | } |
| | | |
| | | jsonObject.put("direction", direction); |
| | | jsonObject.put("val", val); |
| | | array.add(jsonObject); |
| | | } |
| | | |
| | | } |
| | | return array; |
| | | } |
| | | |
| | | |
| | | private JSONArray judgeType(JSONArray ztData) { |
| | | JSONArray array = new JSONArray(); |
| | | for (int i = 0; i < ztData.size(); i++) { |
| | | JSONObject jsonObject = ztData.getJSONObject(i); |
| | | Double syVal = jsonObject.getDouble("sy_val"); |
| | | Double leadVal = jsonObject.getDouble("lead_val"); |
| | | String type = ""; |
| | | if (syVal > leadVal) { |
| | | //当前水位大于1h |
| | | type = "陡升"; |
| | | } else { |
| | | type = "陡降"; |
| | | } |
| | | |
| | | jsonObject.put("type", type); |
| | | array.add(jsonObject); |
| | | } |
| | | return array; |
| | | } |
| | | |
| | | /** |
| | | * 根据数据过滤不同程度的变幅 |
| | | * |
| | | * @param ztData |
| | | * @param level 1黄、2橙、3红 |
| | | * @return |
| | | */ |
| | | private JSONArray changeRange(JSONArray ztData, String level) { |
| | | JSONArray array = new JSONArray(); |
| | | |
| | | for (int i = 0; i < ztData.size(); i++) { |
| | | JSONObject jsonObject = ztData.getJSONObject(i); |
| | | String dataLevel = jsonObject.getString("level"); |
| | | |
| | | //一日变幅 |
| | | Double diff2 = jsonObject.getDouble("diff_2"); |
| | | |
| | | //五日变幅 |
| | | Double diff5 = jsonObject.getDouble("diff_5"); |
| | | |
| | | //十日变幅 |
| | | Double diff10 = jsonObject.getDouble("diff_10"); |
| | | |
| | | //三十日变幅 |
| | | Double diff30 = jsonObject.getDouble("diff_30"); |
| | | |
| | | String dayNum = ""; |
| | | String diffVal = ""; |
| | | |
| | | if (dataLevel.equals(level)) { |
| | | if (level.equals("1")) { |
| | | //水位长期不变,五日变幅小于5cm,十日变幅大于5cm小于8cm,三十日变幅大于8cm小于10cm |
| | | if (diff5 < 0.05) { |
| | | dayNum = "五"; |
| | | diffVal = diff5.toString(); |
| | | } else if (0.05 < diff10 && diff10 < 0.08) { |
| | | dayNum = "十"; |
| | | diffVal = diff10.toString(); |
| | | } else if (0.08 < diff30 && diff30 < 0.1) { |
| | | dayNum = "三十"; |
| | | diffVal = diff30.toString(); |
| | | } |
| | | } else if (level.equals("2")) { |
| | | //渗压水位一日变幅大于0.5米小于1米,五日变幅大于1米小于2米,十日变幅大于2米小于5米,三十日变幅大于5米小于10米 |
| | | if (0.5 < diff2 && diff2 < 1) { |
| | | dayNum = "一"; |
| | | diffVal = diff2.toString(); |
| | | } else if (1 < diff5 && diff5 < 2) { |
| | | dayNum = "五"; |
| | | diffVal = diff5.toString(); |
| | | } else if (2 < diff10 && diff10 < 5) { |
| | | dayNum = "十"; |
| | | diffVal = diff10.toString(); |
| | | } else if (5 < diff30 && diff30 < 10) { |
| | | dayNum = "三十"; |
| | | diffVal = diff30.toString(); |
| | | } |
| | | } else if (level.equals("3")) { |
| | | //渗压水位一日变幅大于1米小于2米,五日变幅大于2米小于5米,十日变幅大于5米小于10米,三十日变幅大于10米 |
| | | |
| | | if (1 < diff2 && diff2 < 2) { |
| | | dayNum = "一"; |
| | | diffVal = diff2.toString(); |
| | | } else if (2 < diff5 && diff5 < 5) { |
| | | dayNum = "五"; |
| | | diffVal = diff5.toString(); |
| | | } else if (5 < diff10 && diff10 < 10) { |
| | | dayNum = "十"; |
| | | diffVal = diff10.toString(); |
| | | } else if (10 < diff30) { |
| | | dayNum = "三十"; |
| | | diffVal = diff30.toString(); |
| | | } |
| | | } |
| | | |
| | | jsonObject.put("dayNum", dayNum); |
| | | |
| | | if (diffVal.equals("0.0")) { |
| | | diffVal = "0"; |
| | | } |
| | | |
| | | jsonObject.put("diff_val", diffVal); |
| | | array.add(jsonObject); |
| | | } |
| | | } |
| | | return array; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 过滤低于管底高程数据或高于管口高程数据 |
| | | * |
| | | * @param ztData |
| | | * @param flag |
| | | * @return |
| | | */ |
| | | private JSONArray lessOrHigher(JSONArray ztData, String flag) { |
| | | |
| | | JSONArray array = new JSONArray(); |
| | | |
| | | for (int i = 0; i < ztData.size(); i++) { |
| | | JSONObject jsonObject = ztData.getJSONObject(i); |
| | | |
| | | //获取低于管底高程数据min_value < tbbtel 即 min_value - tbbtel <0 即diff_tbb_val <0 |
| | | if (flag == "less") { |
| | | Double differ = jsonObject.getDouble("diff_tbb_val"); |
| | | if (differ < 0) { |
| | | //加进一个绝对值方便展示 |
| | | jsonObject.put("diff_tbb_val_abs", Math.abs(differ)); |
| | | array.add(jsonObject); |
| | | } |
| | | } else if (flag == "higher") { |
| | | //获取高于管口高程数据,即 max_value > tbttel 即 max_value - tbttel >0 即 diff_tbt_val >0 |
| | | Double differ = jsonObject.getDouble("diff_tbt_val"); |
| | | if (differ > 0) { |
| | | array.add(jsonObject); |
| | | } |
| | | } |
| | | } |
| | | return array; |
| | | } |
| | | |
| | | |
| | | |
| | | //过滤不需要告警的水库 |
| | | public JSONArray filterNoAlertRes(JSONArray jsonArray,String ruleName){ |
| | | JSONArray result = new JSONArray(); |
| | | |
| | | //获取要过滤的水库数据 |
| | | String noAlertRes= noticeHandle.getNoAlertRes(ruleName); |
| | | |
| | | if (StringUtil.isBlank(noAlertRes)){ |
| | | //如果没有需要过滤的数据 |
| | | return jsonArray; |
| | | } |
| | | |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | |
| | | String resCd = jsonObject.getString("res_cd"); |
| | | //判断水库是否在不告警水库列表中 |
| | | boolean contains = noAlertRes.contains(resCd); |
| | | |
| | | if (!contains){ |
| | | //不在则往结果集中加入数据 |
| | | result.add(jsonObject); |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | strategyMap.put("damSafetyHandle", (arg1, arg2) -> noticeStrategyImpl.damSafetyHandle(arg1, arg2)); |
| | | //20 |
| | | strategyMap.put("damSafetySyHandle", (arg1, arg2) -> noticeStrategyImpl.damSafetySyHandle(arg1, arg2)); |
| | | //21 |
| | | //21 渗压信息接收不到 |
| | | strategyMap.put("damSafetySyNoneHandle", (arg1, arg2) -> noticeStrategyImpl.damSafetySyNoneHandle(arg1, arg2)); |
| | | //22 |
| | | //22 渗流信息接收不到 |
| | | strategyMap.put("damSafetySlNoneHandle", (arg1, arg2) -> noticeStrategyImpl.damSafetySlNoneHandle(arg1, arg2)); |
| | | //23 |
| | | //23 位移信息接收不到 |
| | | strategyMap.put("damSafetyWyNoneHandle", (arg1, arg2) -> noticeStrategyImpl.damSafetyWyNoneHandle(arg1, arg2)); |
| | | //24 渗压资料缺失 |
| | | strategyMap.put("damSafetySyDataMissingHandle",(arg1,arg2)->noticeStrategyImpl.damSafetySyDataMissingHandle(arg1,arg2)); |
| | | //25 变形资料缺失 |
| | | strategyMap.put("damSafetyBxDataMissingHandle",(arg1,arg2)->noticeStrategyImpl.damSafetyBxDataMissingHandle(arg1,arg2)); |
| | | //26 水位低于管底高程 |
| | | strategyMap.put("damSafetySyLessThenPipeHandle",(arg1,arg2)->noticeStrategyImpl.damSafetySyLessThenPipeHandle(arg1,arg2)); |
| | | //27 水位高于管口高程 |
| | | strategyMap.put("damSafetySyHigherThenNozzleHandle",(arg1,arg2)->noticeStrategyImpl.damSafetySyHigherThenNozzleHandle(arg1,arg2)); |
| | | //28 水位高于坝顶高程 |
| | | strategyMap.put("damSafetySyHigherThenBdElevationHandle",(arg1,arg2)->noticeStrategyImpl.damSafetySyHigherThenBdElevationHandle(arg1,arg2)); |
| | | //29 水位大于库水位 |
| | | strategyMap.put("damSafetySyHigherThenWaterLevelHandle",(arg1,arg2)->noticeStrategyImpl.damSafetySyHigherThenWaterLevelHandle(arg1,arg2)); |
| | | //30 水位长期不变,五日变幅小于5cm,十日变幅大于5cm小于8cm,三十日变幅大于8cm小于10cm |
| | | strategyMap.put("damSafetySyYellowChangeHandle",(arg1,arg2)->noticeStrategyImpl.damSafetySyYellowChangeHandle(arg1,arg2)); |
| | | //31 渗压水位一日变幅大于0.5米小于1米,五日变幅大于1米小于2米,十日变幅大于2米小于5米,三十日变幅大于5米小于10米 |
| | | strategyMap.put("damSafetySyOrangeChangeHandle",(arg1,arg2)->noticeStrategyImpl.damSafetySyOrangeChangeHandle(arg1,arg2)); |
| | | //32 渗压水位一日变幅大于1米小于2米,五日变幅大于2米小于5米,十日变幅大于5米小于10米,三十日变幅大于10米 |
| | | strategyMap.put("damSafetySyRedChangeHandle",(arg1,arg2)->noticeStrategyImpl.damSafetySyRedChangeHandle(arg1,arg2)); |
| | | //33 近1h水位陡降 |
| | | strategyMap.put("damSafetySyRz1hChangeHandle",(arg1,arg2)->noticeStrategyImpl.damSafetySyRz1hChangeHandle(arg1,arg2)); |
| | | //34 变形值大于20mm小于50mm |
| | | strategyMap.put("damSafetyWyOver2Less5Handle",(arg1,arg2)->noticeStrategyImpl.damSafetyWyOver2Less5Handle(arg1,arg2)); |
| | | //35 变形值大于50mm小于100mm |
| | | strategyMap.put("damSafetyWyOver5Less10Handle",(arg1,arg2)->noticeStrategyImpl.damSafetyWyOver5Less10Handle(arg1,arg2)); |
| | | //36 变形值大于100mm |
| | | strategyMap.put("damSafetyWyOver10Handle",(arg1,arg2)->noticeStrategyImpl.damSafetyWyOver10Handle(arg1,arg2)); |
| | | //37 近1h变形值大于10cm以上 |
| | | strategyMap.put("damSafetyWy1hChangeOver10Handle",(arg1,arg2)->noticeStrategyImpl.damSafetyWy1hChangeOver10Handle(arg1,arg2)); |
| | | //38 渗流量一日大于5L小于8L,连续3日增加 |
| | | strategyMap.put("damSafetySlOver5Less8Handle",(arg1,arg2)->noticeStrategyImpl.damSafetySlOver5Less8Handle(arg1,arg2)); |
| | | //39 渗流量一日大于8L小于10L,连续3日增加 |
| | | strategyMap.put("damSafetySlOver8Less10Handle",(arg1,arg2)->noticeStrategyImpl.damSafetySlOver8Less10Handle(arg1,arg2)); |
| | | //40 渗流量一日大于10L以上,连续3日增加 |
| | | strategyMap.put("damSafetySlOver10Handle",(arg1,arg2)->noticeStrategyImpl.damSafetySlOver10Handle(arg1,arg2)); |
| | | //41 视频信息接收不到 |
| | | strategyMap.put("videoOfflineHandle",(arg1,arg2)->noticeStrategyImpl.videoOfflineHandle(arg1,arg2)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | Object importSendSms(List<SendSmsExcel> list,String templateId,String param, String content); |
| | | |
| | | /** |
| | | * 水库测点合并发送 |
| | | * @param smsRequestTemplate |
| | | * @return |
| | | */ |
| | | Map<String, Object> sendSignMsgMergeCd(SmsRequestTemplate smsRequestTemplate); |
| | | |
| | | Map<String, Object> sendSignMsgMergeCdVideo(SmsRequestTemplate smsRequestTemplate); |
| | | } |
| | |
| | | messageRecord.setRecipient(list.get(0)); |
| | | // 设置手机号 |
| | | request.setUserNumber(list.get(0)); |
| | | // 内容处理 |
| | | // 内容处理,把括号内容换成%s,后面用format替换,因此括号内容要和list的个数一样 |
| | | String s = smsTemplate.getContent().replaceAll("\\{.+?\\}", "%s"); |
| | | // 短信内容拼接(完成发送的结果信息) |
| | | // 需要删除最前面的手机号 |
| | |
| | | Temp temp = new Temp(); |
| | | temp.setPhone(list.get(1)); |
| | | temp.setReservoirCode(list.get(0)); |
| | | temp.setReservoirName(list.get(3)); |
| | | temp.setReservoirName(list.get(2)); |
| | | temp.setAlarmRecordId(list.get(list.size()-1)); |
| | | // 放入临时集合 |
| | | tempList.add(temp); |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public Map<String, Object> sendSignMsgMergeCd(SmsRequestTemplate smsRequestTemplate) { |
| | | |
| | | // 取出数据 |
| | | SMSSendRequest request = new SMSSendRequest(); |
| | | SmsTemplate smsTemplate = smsRequestTemplate.getSmsTemplate(); |
| | | request.setTemplateId(smsTemplate.getTemplateId()); |
| | | List<List<String>> templateContent = smsRequestTemplate.getTemplateContent(); |
| | | List<Temp> tempList = new ArrayList<>(); |
| | | // 合并数据 |
| | | for (List<String> list : templateContent) { |
| | | Temp temp = new Temp(); |
| | | temp.setPhone(list.get(1)); |
| | | temp.setReservoirCode(list.get(0)); |
| | | temp.setReservoirName(list.get(2)); |
| | | temp.setCdNm(list.get(3)); |
| | | temp.setAlarmRecordId(list.get(list.size()-1)); |
| | | // 放入临时集合 |
| | | tempList.add(temp); |
| | | } |
| | | // 按手机号分组 |
| | | Map<String, List<Temp>> listMap = tempList.stream().collect(Collectors.groupingBy(Temp::getPhone)); |
| | | // 遍历 map 发送短信 |
| | | listMap.forEach((s, temps) -> { |
| | | StringBuilder builder = new StringBuilder(); |
| | | StringBuilder smsRecordBuilder = new StringBuilder(); |
| | | builder.append(s).append(","); |
| | | |
| | | //按水库再次分组,因为要把测点名称放进水库里 |
| | | Map<String, List<Temp>> resCollectGroup = temps.stream().collect(Collectors.groupingBy(Temp::getReservoirCode)); |
| | | |
| | | //这个集合为了存水库和其多个测站 |
| | | List<Temp> infoList = new ArrayList<>(); |
| | | resCollectGroup.forEach((resCode,temp1)->{ |
| | | Temp temp = new Temp(); |
| | | temp.setPhone(s); |
| | | temp.setReservoirName(temp1.get(0).getReservoirName()); |
| | | temp.setReservoirCode(resCode); |
| | | List<String> cdNameList = new ArrayList<>(); |
| | | temp1.forEach(info->{ |
| | | cdNameList.add("测点" + info.getCdNm()); |
| | | temp.setAlarmRecordId(info.getAlarmRecordId()); |
| | | }); |
| | | temp.setCdNm(String.join("、",cdNameList)); |
| | | infoList.add(temp); |
| | | }); |
| | | |
| | | |
| | | // 如果一人对应水库数量超过30个,则分批发送 |
| | | List<List<Temp>> lists = Lists.partition(new ArrayList<>(infoList), 30); |
| | | for (List<Temp> list : lists) { |
| | | List<AlarmRecordDetailVO> alarmRecordDetailList = new ArrayList<>(); |
| | | // 遍历 |
| | | for (Temp temp : list) { |
| | | builder.append(temp.getReservoirName()+"("+temp.getCdNm() +")").append(","); |
| | | smsRecordBuilder.append(temp.getReservoirName()+"("+temp.getCdNm() +")").append(","); |
| | | AlarmRecordDetailVO alarmRecordDetail = new AlarmRecordDetailVO(); |
| | | alarmRecordDetail.setReservoirNumber(temp.getReservoirCode()); |
| | | alarmRecordDetail.setAlarmRecordId(Long.parseLong(temp.getAlarmRecordId())); |
| | | alarmRecordDetail.setAlarmMode("短信"); |
| | | alarmRecordDetail.setPhone(temp.getPhone()); |
| | | alarmRecordDetail.setReservoirName(temp.getReservoirName()); |
| | | // 加入集合 |
| | | alarmRecordDetailList.add(alarmRecordDetail); |
| | | } |
| | | |
| | | String row = builder.substring(0, builder.length() - 1); |
| | | // 组装数据 |
| | | String[] titleArr = smsRequestTemplate.getTitle().split(","); |
| | | String[][] dyns = new String[2][titleArr.length]; |
| | | dyns[0] = titleArr; |
| | | dyns[1] = row.split(","); |
| | | //请求参数 |
| | | ComResult<DynSMSSendDataResult> resultComResult = sendDynSMSSendDataResultComResult(smsTemplate.getTemplateId(), dyns); |
| | | // 先保存结果记录 |
| | | SmsResult smsResult = saveSendResult(resultComResult.getCode().toString(),resultComResult.getMsg(),request, 1); |
| | | // 设置手机号 |
| | | request.setUserNumber(s); |
| | | // 内容处理 |
| | | String str = smsTemplate.getContent().replaceAll("\\{.+?\\}", "%s"); |
| | | // 短信内容拼接(完成发送的结果信息) |
| | | String substring = smsRecordBuilder.substring(0, smsRecordBuilder.length() - 1); |
| | | // 格式转换 |
| | | String format = String.format(str, substring.split(",")); |
| | | // 设置内容 |
| | | request.setMessageContent(format); |
| | | // 保存短信发送记录 |
| | | SmsRecord smsRecord = saveSendRecord(request, resultComResult.getCode().toString(), resultComResult.getMsg(), smsResult.getId()); |
| | | //保存告警记录详情信息 |
| | | if (null != smsRecord) { |
| | | List<AlarmRecordDetail> alarmRecordDetailArrayList = new ArrayList<>(); |
| | | for (AlarmRecordDetailVO alarmRecordDetail : alarmRecordDetailList) { |
| | | AlarmRecordDetail alarmRecordDetail1 = new AlarmRecordDetail(); |
| | | // 短信内容拼接(完成发送的结果信息) |
| | | // String formatContent = String.format(str, alarmRecordDetail.getReservoirName().split(",")); |
| | | String formatContent = format; |
| | | alarmRecordDetail1.setAlarmContent(formatContent); |
| | | alarmRecordDetail1.setSendRecordId(smsRecord.getId()); |
| | | alarmRecordDetail1.setCreateTime(new Date()); |
| | | alarmRecordDetail1.setReservoirNumber(alarmRecordDetail.getReservoirNumber()); |
| | | alarmRecordDetail1.setAlarmRecordId(alarmRecordDetail.getAlarmRecordId()); |
| | | alarmRecordDetail1.setAlarmMode(alarmRecordDetail.getAlarmMode()); |
| | | alarmRecordDetail1.setPhone(alarmRecordDetail.getPhone()); |
| | | alarmRecordDetailArrayList.add(alarmRecordDetail1); |
| | | } |
| | | // 保存告警记录详情信息 |
| | | try { |
| | | boolean save = alarmRecordDetailService.saveBatch(alarmRecordDetailArrayList); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | |
| | | return null; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Map<String, Object> sendSignMsgMergeCdVideo(SmsRequestTemplate smsRequestTemplate) { |
| | | |
| | | // 取出数据 |
| | | SMSSendRequest request = new SMSSendRequest(); |
| | | SmsTemplate smsTemplate = smsRequestTemplate.getSmsTemplate(); |
| | | request.setTemplateId(smsTemplate.getTemplateId()); |
| | | List<List<String>> templateContent = smsRequestTemplate.getTemplateContent(); |
| | | List<Temp> tempList = new ArrayList<>(); |
| | | // 合并数据 |
| | | for (List<String> list : templateContent) { |
| | | Temp temp = new Temp(); |
| | | temp.setPhone(list.get(1)); |
| | | temp.setReservoirCode(list.get(0)); |
| | | temp.setReservoirName(list.get(2)); |
| | | temp.setCdNm(list.get(3)); |
| | | temp.setAlarmRecordId(list.get(list.size()-1)); |
| | | // 放入临时集合 |
| | | tempList.add(temp); |
| | | } |
| | | // 按手机号分组 |
| | | Map<String, List<Temp>> listMap = tempList.stream().collect(Collectors.groupingBy(Temp::getPhone)); |
| | | // 遍历 map 发送短信 |
| | | listMap.forEach((s, temps) -> { |
| | | StringBuilder builder = new StringBuilder(); |
| | | StringBuilder smsRecordBuilder = new StringBuilder(); |
| | | builder.append(s).append(","); |
| | | |
| | | //按水库再次分组,因为要把测点名称放进水库里 |
| | | Map<String, List<Temp>> resCollectGroup = temps.stream().collect(Collectors.groupingBy(Temp::getReservoirCode)); |
| | | |
| | | //这个集合为了存水库和其多个测站 |
| | | List<Temp> infoList = new ArrayList<>(); |
| | | resCollectGroup.forEach((resCode,temp1)->{ |
| | | Temp temp = new Temp(); |
| | | temp.setPhone(s); |
| | | temp.setReservoirName(temp1.get(0).getReservoirName()); |
| | | temp.setReservoirCode(resCode); |
| | | List<String> cdNameList = new ArrayList<>(); |
| | | temp1.forEach(info->{ |
| | | cdNameList.add( info.getCdNm()); |
| | | temp.setAlarmRecordId(info.getAlarmRecordId()); |
| | | }); |
| | | temp.setCdNm(String.join("、",cdNameList)); |
| | | infoList.add(temp); |
| | | }); |
| | | |
| | | |
| | | // 如果一人对应水库数量超过30个,则分批发送 |
| | | List<List<Temp>> lists = Lists.partition(new ArrayList<>(infoList), 30); |
| | | for (List<Temp> list : lists) { |
| | | List<AlarmRecordDetailVO> alarmRecordDetailList = new ArrayList<>(); |
| | | // 遍历 |
| | | for (Temp temp : list) { |
| | | builder.append(temp.getReservoirName()+"("+temp.getCdNm() +")").append(","); |
| | | smsRecordBuilder.append(temp.getReservoirName()+"("+temp.getCdNm() +")").append(","); |
| | | AlarmRecordDetailVO alarmRecordDetail = new AlarmRecordDetailVO(); |
| | | alarmRecordDetail.setReservoirNumber(temp.getReservoirCode()); |
| | | alarmRecordDetail.setAlarmRecordId(Long.parseLong(temp.getAlarmRecordId())); |
| | | alarmRecordDetail.setAlarmMode("短信"); |
| | | alarmRecordDetail.setPhone(temp.getPhone()); |
| | | alarmRecordDetail.setReservoirName(temp.getReservoirName()); |
| | | // 加入集合 |
| | | alarmRecordDetailList.add(alarmRecordDetail); |
| | | } |
| | | |
| | | String row = builder.substring(0, builder.length() - 1); |
| | | // 组装数据 |
| | | String[] titleArr = smsRequestTemplate.getTitle().split(","); |
| | | String[][] dyns = new String[2][titleArr.length]; |
| | | dyns[0] = titleArr; |
| | | dyns[1] = row.split(","); |
| | | //请求参数 |
| | | ComResult<DynSMSSendDataResult> resultComResult = sendDynSMSSendDataResultComResult(smsTemplate.getTemplateId(), dyns); |
| | | // 先保存结果记录 |
| | | SmsResult smsResult = saveSendResult(resultComResult.getCode().toString(),resultComResult.getMsg(),request, 1); |
| | | // 设置手机号 |
| | | request.setUserNumber(s); |
| | | // 内容处理 |
| | | String str = smsTemplate.getContent().replaceAll("\\{.+?\\}", "%s"); |
| | | // 短信内容拼接(完成发送的结果信息) |
| | | String substring = smsRecordBuilder.substring(0, smsRecordBuilder.length() - 1); |
| | | // 格式转换 |
| | | String format = String.format(str, substring.split(",")); |
| | | // 设置内容 |
| | | request.setMessageContent(format); |
| | | // 保存短信发送记录 |
| | | SmsRecord smsRecord = saveSendRecord(request, resultComResult.getCode().toString(), resultComResult.getMsg(), smsResult.getId()); |
| | | //保存告警记录详情信息 |
| | | if (null != smsRecord) { |
| | | List<AlarmRecordDetail> alarmRecordDetailArrayList = new ArrayList<>(); |
| | | for (AlarmRecordDetailVO alarmRecordDetail : alarmRecordDetailList) { |
| | | AlarmRecordDetail alarmRecordDetail1 = new AlarmRecordDetail(); |
| | | // 短信内容拼接(完成发送的结果信息) |
| | | // String formatContent = String.format(str, alarmRecordDetail.getReservoirName().split(",")); |
| | | String formatContent = format; |
| | | alarmRecordDetail1.setAlarmContent(formatContent); |
| | | alarmRecordDetail1.setSendRecordId(smsRecord.getId()); |
| | | alarmRecordDetail1.setCreateTime(new Date()); |
| | | alarmRecordDetail1.setReservoirNumber(alarmRecordDetail.getReservoirNumber()); |
| | | alarmRecordDetail1.setAlarmRecordId(alarmRecordDetail.getAlarmRecordId()); |
| | | alarmRecordDetail1.setAlarmMode(alarmRecordDetail.getAlarmMode()); |
| | | alarmRecordDetail1.setPhone(alarmRecordDetail.getPhone()); |
| | | alarmRecordDetailArrayList.add(alarmRecordDetail1); |
| | | } |
| | | // 保存告警记录详情信息 |
| | | boolean save = alarmRecordDetailService.saveBatch(alarmRecordDetailArrayList); |
| | | } |
| | | } |
| | | }); |
| | | return null; |
| | | } |
| | | |
| | | |
| | | // /** |
| | | // * 发送合并水库名短信 |
| | |
| | | return R.data(200,"发送成功!",null); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 校验参数 |
| | | * @param smsTemplate |
| | |
| | | */ |
| | | private String reservoirName; |
| | | |
| | | //测站名称 |
| | | private String cdNm; |
| | | |
| | | /** |
| | | * 告警记录id |
| | | */ |
| | |
| | | <version>3.0.1.RELEASE</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.gistack</groupId> |
| | | <artifactId>skjcmanager-system-api</artifactId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-excel</artifactId> |
| | | </dependency> |
| | |
| | | return R.data(nkyClient.updateStatus(alarmGet)); |
| | | } |
| | | |
| | | @GetMapping("/getLatestResRecord") |
| | | public R getLatestResRecord(AlarmGet alarmGet){ |
| | | List<AlarmGetVO> list = damSecurityService.getLatestResRecord(alarmGet); |
| | | return R.data(list); |
| | | } |
| | | |
| | | } |
| | |
| | | package cn.gistack.sm.damSecurity.mapper; |
| | | |
| | | import cn.gistack.nky.entity.AlarmGet; |
| | | import cn.gistack.nky.vo.AlarmGetVO; |
| | | import cn.gistack.sm.damSecurity.vo.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | DamStatisticsRes damResInfoCountWy(@Param("adCode") String adCode); |
| | | |
| | | |
| | | List<AlarmGetVO> getLatestResRecord(@Param("alarmGet")AlarmGet alarmGet); |
| | | |
| | | List<AlarmGetVO> getLatestResRecordWy(@Param("alarmGet") AlarmGet alarmGet); |
| | | } |
| | |
| | | ) |
| | | )TMP |
| | | </select> |
| | | <select id="getLatestResRecord" resultType="cn.gistack.nky.vo.AlarmGetVO"> |
| | | SELECT |
| | | NAG.DAM_ID, |
| | | NAG.POINT_ID, |
| | | NAG.TYPE, |
| | | NAG.TIME, |
| | | NAG.VALUE, |
| | | NAG."DESC", |
| | | NAG.CREATE_TIME, |
| | | NAG.TASK_CATEGORY, |
| | | NAG.LEVEL, |
| | | NAG.BAOJINGZHI, |
| | | NAG.ORIGIN_ID, |
| | | NAG.FORWARD, |
| | | NAG."REVERSE", |
| | | NAG.RATIO, |
| | | |
| | | ARB."name" reservoirName, |
| | | acb."cd_nm" cdName, |
| | | |
| | | case when town."ad_grad" = 4 THEN town."ad_code" ELSE NULL END AS townCode, |
| | | case when town."ad_grad" = 4 THEN town."ad_name" ELSE NULL END AS townName, |
| | | case |
| | | when town."ad_grad" = 3 THEN town."ad_code" |
| | | when county."ad_grad" = 3 THEN county."ad_code" END AS countyCode, |
| | | case |
| | | when town."ad_grad" = 3 THEN town."ad_name" |
| | | when county."ad_grad" = 3 THEN county."ad_name" END AS countyName, |
| | | case |
| | | when town."ad_grad" = 2 THEN town."ad_code" |
| | | when county."ad_grad" = 2 THEN county."ad_code" |
| | | ELSE city."ad_code" END AS cityCode, |
| | | case |
| | | when town."ad_grad" = 2 THEN town."ad_name" |
| | | when county."ad_grad" = 2 THEN county."ad_name" |
| | | ELSE city."ad_name" END AS cityName |
| | | |
| | | FROM YWXT.NKY_ALARM_GET NAG |
| | | right JOIN ( |
| | | SELECT |
| | | NAG.DAM_ID, |
| | | NAG.POINT_ID, |
| | | MAX(NAG.TIME)TIME, |
| | | NAG.TYPE |
| | | FROM YWXT.NKY_ALARM_GET NAG |
| | | LEFT JOIN SJZT_MD."att_res_base" arb on arb."guid" = nag.dam_id |
| | | |
| | | WHERE |
| | | dam_id = #{alarmGet.damId} |
| | | and type = #{alarmGet.type} |
| | | GROUP BY |
| | | NAG.DAM_ID, |
| | | NAG.POINT_ID, |
| | | NAG.TYPE |
| | | |
| | | )TMP ON ( |
| | | TMP.DAM_ID = NAG.DAM_ID |
| | | AND TMP.POINT_ID = NAG.POINT_ID |
| | | AND TMP.TYPE = NAG.TYPE |
| | | AND TMP.TIME = NAG.TIME |
| | | ) |
| | | LEFT JOIN SJZT_MD."att_res_base" arb on arb."guid" = NAG.DAM_ID |
| | | |
| | | LEFT JOIN SJZT_MD."att_ad_base" town ON town."ad_code" = arb."interior_ad_guid" |
| | | LEFT JOIN SJZT_MD."att_ad_base" county ON county."ad_code" = town."p_ad_code" |
| | | LEFT JOIN SJZT_MD."att_ad_base" city ON city."ad_code" = county."p_ad_code" |
| | | |
| | | LEFT JOIN SJZT_MD."att_cd_base" acb on |
| | | acb."res_cd" = #{alarmGet.damId} |
| | | and acb."cd" = nag.point_id |
| | | <if test="alarmGet.type == 1"> |
| | | and acb."cd_type" = 'sy' |
| | | </if> |
| | | <if test="alarmGet.type == 2"> |
| | | and acb."cd_type" = 'sl' |
| | | </if> |
| | | ORDER BY POINT_ID |
| | | </select> |
| | | <select id="getLatestResRecordWy" resultType="cn.gistack.nky.vo.AlarmGetVO"> |
| | | SELECT |
| | | NAG.DAM_ID, |
| | | NAG.POINT_ID, |
| | | NAG.TYPE, |
| | | NAG.TIME, |
| | | NAG.VALUE, |
| | | NAG."DESC", |
| | | NAG.CREATE_TIME, |
| | | NAG.TASK_CATEGORY, |
| | | NAG.LEVEL, |
| | | NAG.BAOJINGZHI, |
| | | NAG.ORIGIN_ID, |
| | | NAG.FORWARD, |
| | | NAG."REVERSE", |
| | | NAG.RATIO, |
| | | |
| | | ARB."name" reservoirName, |
| | | acb."cd_nm" cdName, |
| | | |
| | | case when town."ad_grad" = 4 THEN town."ad_code" ELSE NULL END AS townCode, |
| | | case when town."ad_grad" = 4 THEN town."ad_name" ELSE NULL END AS townName, |
| | | case |
| | | when town."ad_grad" = 3 THEN town."ad_code" |
| | | when county."ad_grad" = 3 THEN county."ad_code" END AS countyCode, |
| | | case |
| | | when town."ad_grad" = 3 THEN town."ad_name" |
| | | when county."ad_grad" = 3 THEN county."ad_name" END AS countyName, |
| | | case |
| | | when town."ad_grad" = 2 THEN town."ad_code" |
| | | when county."ad_grad" = 2 THEN county."ad_code" |
| | | ELSE city."ad_code" END AS cityCode, |
| | | case |
| | | when town."ad_grad" = 2 THEN town."ad_name" |
| | | when county."ad_grad" = 2 THEN county."ad_name" |
| | | ELSE city."ad_name" END AS cityName |
| | | |
| | | FROM YWXT.NKY_ALARM_GET NAG |
| | | right JOIN ( |
| | | SELECT |
| | | NAG.DAM_ID, |
| | | NAG.POINT_ID, |
| | | MAX(NAG.TIME)TIME, |
| | | MAX(NAG.CREATE_TIME) CREATE_TIME, |
| | | NAG.TYPE |
| | | FROM YWXT.NKY_ALARM_GET NAG |
| | | LEFT JOIN SJZT_MD."att_res_base" arb on arb."guid" = nag.dam_id |
| | | |
| | | WHERE |
| | | dam_id = #{alarmGet.damId} |
| | | and (type = '3' or type = '4' or type = '5') |
| | | GROUP BY |
| | | NAG.DAM_ID, |
| | | NAG.POINT_ID, |
| | | NAG.TYPE |
| | | |
| | | )TMP ON ( |
| | | TMP.DAM_ID = NAG.DAM_ID |
| | | AND TMP.POINT_ID = NAG.POINT_ID |
| | | AND TMP.TYPE = NAG.TYPE |
| | | AND TMP.TIME = NAG.TIME |
| | | AND TMP.CREATE_TIME = NAG.CREATE_TIME |
| | | ) |
| | | LEFT JOIN SJZT_MD."att_res_base" arb on arb."guid" = NAG.DAM_ID |
| | | |
| | | LEFT JOIN SJZT_MD."att_ad_base" town ON town."ad_code" = arb."interior_ad_guid" |
| | | LEFT JOIN SJZT_MD."att_ad_base" county ON county."ad_code" = town."p_ad_code" |
| | | LEFT JOIN SJZT_MD."att_ad_base" city ON city."ad_code" = county."p_ad_code" |
| | | |
| | | LEFT JOIN SJZT_MD."att_wy_cd_base" acb on |
| | | acb."res_cd" = #{alarmGet.damId} |
| | | and acb."cd" = nag.point_id |
| | | and acb."cd_type" = 'wy' |
| | | ORDER BY POINT_ID |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | package cn.gistack.sm.damSecurity.service; |
| | | |
| | | import cn.gistack.nky.entity.AlarmGet; |
| | | import cn.gistack.nky.vo.AlarmGetVO; |
| | | import cn.gistack.sm.damSecurity.vo.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | DamSecurityStatistics getSingleRegionCountOptimize(DamSecurityStatistics damSecurityStatistics); |
| | | |
| | | DamStatisticsRes damResInfoCountOptimizeType(String adCode, String type); |
| | | |
| | | List<AlarmGetVO> getLatestResRecord(AlarmGet alarmGet); |
| | | } |
| | |
| | | package cn.gistack.sm.damSecurity.service.impl; |
| | | |
| | | import cn.gistack.nky.entity.AlarmGet; |
| | | import cn.gistack.nky.vo.AlarmGetVO; |
| | | import cn.gistack.sm.damSecurity.mapper.DamSecurityMapper; |
| | | import cn.gistack.sm.damSecurity.service.IDamSecurityService; |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.mysql.cj.protocol.x.ReusableInputStream; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.tool.utils.ObjectUtil; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public List<AlarmGetVO> getLatestResRecord(AlarmGet alarmGet) { |
| | | |
| | | if (StringUtil.isBlank(alarmGet.getDamId())){ |
| | | throw new ServiceException("水库编码为空"); |
| | | } |
| | | |
| | | if (StringUtil.isBlank(alarmGet.getType())){ |
| | | throw new ServiceException("监测类型为空"); |
| | | } |
| | | |
| | | if (alarmGet.getType().equals("3")){ |
| | | //位移,单独取测站名称 |
| | | return damSecurityMapper.getLatestResRecordWy(alarmGet); |
| | | }else{ |
| | | return damSecurityMapper.getLatestResRecord(alarmGet); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | return R.data(messageRecordService.updateById(messageRecord)); |
| | | } |
| | | |
| | | @PostMapping(value = "/update") |
| | | public R update(@RequestBody MessageRecord messageRecord) { |
| | | return R.data(messageRecordService.updateById(messageRecord)); |
| | | } |
| | | |
| | | } |
| | |
| | | messageRecord.setStatus(0); |
| | | return messageRecordService.list(Condition.getQueryWrapper(messageRecord)); |
| | | } |
| | | |
| | | @Override |
| | | @GetMapping(GET_NO_ALERT_RES_LIST) |
| | | public String getNoAlertRes(String ruleName) { |
| | | return messageRecordService.getNoAlertRes(ruleName); |
| | | } |
| | | } |
| | |
| | | */ |
| | | List<MessageRecordVO> selectMessageRecordPageList(@Param("page") IPage<MessageRecordVO> page, |
| | | @Param("messageRecord") MessageRecordVO messageRecord); |
| | | |
| | | String getNoAlertRes(@Param("ruleName") String ruleName); |
| | | } |
| | |
| | | |
| | | ORDER BY ID DESC |
| | | </select> |
| | | |
| | | <!--查询状态为2且,7天后的时间比现在大的数据--> |
| | | <select id="getNoAlertRes" resultType="java.lang.String"> |
| | | select |
| | | wm_concat(res_guid) |
| | | from ywxt.sm_message_record |
| | | where alert_status = 2 |
| | | and add_days(update_time,7)>= now() |
| | | and theme = #{ruleName} |
| | | </select> |
| | | </mapper> |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @PROJECT_NAME: skjcmanager |
| | | * @DESCRIPTION: |
| | |
| | | * @return |
| | | */ |
| | | Object selectMessageRecordPageList(IPage<MessageRecordVO> page, MessageRecordVO messageRecord); |
| | | |
| | | String getNoAlertRes(String ruleName); |
| | | } |
| | |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @PROJECT_NAME: skjcmanager |
| | | * @DESCRIPTION: |
| | |
| | | } |
| | | return page.setRecords(baseMapper.selectMessageRecordPageList(page,messageRecord)); |
| | | } |
| | | |
| | | @Override |
| | | public String getNoAlertRes(String ruleName) { |
| | | return baseMapper.getNoAlertRes(ruleName); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | spt2.name as patrolTypeName, |
| | | u.real_name toUserName, |
| | | u2.real_name createUserName, |
| | | arb."res_loc" regionName |
| | | arb."res_loc" regionName, |
| | | arb."center_long" lon, |
| | | arb."center_lat" lat |
| | | FROM sm_patrol_task spt |
| | | left join sm_patrol_type spt2 on spt.task_type = spt2.id |
| | | LEFT JOIN blade_user u ON u.id = spt.to_user_id |
| | |
| | | |
| | | if (StringUtil.isBlank(patrolTask.getToUserId())) { |
| | | //没传就自己找 |
| | | //有几个就有几个 |
| | | saveTask.setToUserId(StringUtil.join(collect, ",")); |
| | | //只拿第一个 |
| | | saveTask.setToUserId(collect.get(0)); |
| | | } else { |
| | | saveTask.setToUserId(patrolTask.getToUserId()); |
| | | } |
| | |
| | | |
| | | <result property="engScal" column="engScal"/> |
| | | <result property="resRegCode" column="resRegCode"/> |
| | | <result property="lon" column="lon"/> |
| | | <result property="lat" column="lat"/> |
| | | |
| | | </resultMap> |
| | | |
| | |
| | | |
| | | arb."res_reg_code" as resRegCode, |
| | | arb."eng_scal" as engScal, |
| | | arb."center_long" lon, |
| | | arb."center_lat" lat, |
| | | |
| | | case when town."ad_grad" = 4 THEN town."ad_code" ELSE NULL END AS townCode, |
| | | case when town."ad_grad" = 4 THEN town."ad_name" ELSE NULL END AS townName, |
| | |
| | | //工程规模 |
| | | private String engScal; |
| | | |
| | | |
| | | private String lon; |
| | | private String lat; |
| | | } |
| | |
| | | ExcelUtil.export(response, "水库数据质量管理数据" + DateUtil.time(), "水库数据质量管理数据表", list, QualityManageExcel.class); |
| | | } |
| | | |
| | | @GetMapping("getList") |
| | | public R getList(QualityManageVO qualityManageVO){ |
| | | List<QualityManageVO> list = qualityManageService.getList(qualityManageVO); |
| | | return R.data(list); |
| | | } |
| | | } |
| | |
| | | if (StringUtil.isBlank(varStr)) { |
| | | varStr = "'" + getDictValue(rc.getBasic()) + ": " + "'" + "," + getPropValStr(rc.getBasic()); |
| | | } else { |
| | | varStr += "," + "'\n'" + ",'" + getDictValue(rc.getBasic()) + ": " + "'" + "," + getPropValStr(rc.getBasic()); |
| | | //重复指标就不拼接 |
| | | if (varStr.indexOf(getDictValue(rc.getBasic()))<0){ |
| | | varStr += "," + "'\n'" + ",'" + getDictValue(rc.getBasic()) + ": " + "'" + "," + getPropValStr(rc.getBasic()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | if (rc.getProp().equals("TARGET")) { |
| | | varStr += "," + "'\n'" + ",'" + getDictValue(rc.getTarget()) + ": " + "'" + "," + getPropValStr(rc.getTarget()); |
| | | if (varStr.indexOf(getDictValue(rc.getTarget()))<0) { |
| | | varStr += "," + "'\n'" + ",'" + getDictValue(rc.getTarget()) + ": " + "'" + "," + getPropValStr(rc.getTarget()); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | Integer addQualityManage(@Param("ruleId") Long ruleId, @Param("varStr") String varStr, @Param("whereStr") String whereStr); |
| | | |
| | | List<QualityManageExcel> exportData(@Param("vo") QualityManageVO qualityManageVO); |
| | | |
| | | List<QualityManageVO> getList(@Param("vo") QualityManageVO qualityManageVO); |
| | | } |
| | |
| | | |
| | | |
| | | </select> |
| | | <select id="getList" resultType="cn.gistack.sm.resDataCheck.vo.QualityManageVO"> |
| | | |
| | | |
| | | <!-- SELECT--> |
| | | <!-- arb."guid" AS resGuid,--> |
| | | <!-- arb."name" AS resName,--> |
| | | <!-- arb."res_loc" AS resLoc,--> |
| | | <!-- case when town."ad_grad" = 4 THEN town."ad_code" ELSE NULL END AS townCode,--> |
| | | <!-- case when town."ad_grad" = 4 THEN town."ad_name" ELSE NULL END AS townName,--> |
| | | <!-- case when town."ad_grad" = 3 THEN town."ad_code"--> |
| | | <!-- when county."ad_grad" = 3 THEN county."ad_code" END AS countyCode,--> |
| | | <!-- case when town."ad_grad" = 3 THEN town."ad_name"--> |
| | | <!-- when county."ad_grad" = 3 THEN county."ad_name" END AS countyName,--> |
| | | <!-- case when town."ad_grad" = 2 THEN town."ad_code"--> |
| | | <!-- when county."ad_grad" = 2 THEN county."ad_code"--> |
| | | <!-- ELSE city."ad_code" END AS cityCode,--> |
| | | <!-- case when town."ad_grad" = 2 THEN town."ad_name"--> |
| | | <!-- when county."ad_grad" = 2 THEN county."ad_name"--> |
| | | <!-- ELSE city."ad_name" END AS cityName,--> |
| | | <!-- case when town."ad_grad" = 1 THEN town."ad_code"--> |
| | | <!-- when county."ad_grad" = 1 THEN county."ad_code"--> |
| | | <!-- when city."ad_grad" = 1 THEN city."ad_code"--> |
| | | <!-- ELSE province."ad_code" END AS provinceCode,--> |
| | | <!-- case when town."ad_grad" = 1 THEN town."ad_name"--> |
| | | <!-- when county."ad_grad" = 1 THEN county."ad_name"--> |
| | | <!-- when city."ad_grad" = 1 THEN city."ad_name"--> |
| | | <!-- ELSE province."ad_name" END AS provinceName,--> |
| | | |
| | | <!-- qm.val,--> |
| | | <!-- qm.create_time--> |
| | | <!-- FROM (--> |
| | | <!-- select * from SM_RES_DATA_QUALITY_MANAGE qm--> |
| | | <!-- WHERE qm.is_deleted = 0--> |
| | | <!-- <if test="vo.startTime !=null and vo.startTime !=''">--> |
| | | <!-- AND qm.create_time >= #{vo.startTime}--> |
| | | <!-- </if>--> |
| | | <!-- <if test="vo.endTime !=null and vo.endTime !=''">--> |
| | | <!-- AND qm.create_time <= #{vo.endTime}--> |
| | | <!-- </if>--> |
| | | <!-- ) as qm--> |
| | | |
| | | <!-- LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = qm.res_id--> |
| | | <!-- LEFT JOIN SM_RES_DATA_CHECK_RULES rule ON rule.id = qm.rule_id--> |
| | | |
| | | <!-- left join "SJZT_MD"."att_ad_base" town on town."guid" = arb."interior_ad_guid"--> |
| | | <!-- left join "SJZT_MD"."att_ad_base" county on county."ad_code" = town."p_ad_code"--> |
| | | <!-- left join "SJZT_MD"."att_ad_base" city on city."ad_code" = county."p_ad_code"--> |
| | | <!-- left join "SJZT_MD"."att_ad_base" province on province."ad_code" = city."p_ad_code"--> |
| | | <!-- where qm.is_deleted = 0--> |
| | | <!-- and qm.rule_id in ('1775403351266652162')--> |
| | | <!-- <if test="vo.resName !=null and vo.resName !='' ">--> |
| | | <!-- AND arb."name" LIKE CONCAT('%',#{vo.resName},'%')--> |
| | | <!-- </if>--> |
| | | <!-- <if test="vo.engScal !=null and vo.engScal !='' ">--> |
| | | <!-- AND arb."eng_scal" = #{vo.engScal}--> |
| | | <!-- </if>--> |
| | | <!-- <if test="vo.ruleName !=null and vo.ruleName !='' ">--> |
| | | <!-- AND rule.name LIKE CONCAT('%',#{vo.ruleName},'%')--> |
| | | <!-- </if>--> |
| | | <!-- <if test="vo.adCode != null and vo.adCode != '' ">--> |
| | | <!-- and concat(province."ad_code",city."ad_code",county."ad_code",town."ad_code") like CONCAT('%',#{vo.adCode},'%')--> |
| | | <!-- </if>--> |
| | | <!-- order by qm.create_time desc--> |
| | | |
| | | select |
| | | BASIC.*, |
| | | arb."guid" as resGuid, |
| | | arb."name" as resName, |
| | | |
| | | case when town."ad_grad" = 4 then town."ad_code" else null end as townCode , |
| | | case when town."ad_grad" = 4 then town."ad_name" else null end as townName , |
| | | case when town."ad_grad" = 3 then town."ad_code" when county."ad_grad" = 3 then county."ad_code" end as countyCode , |
| | | case when town."ad_grad" = 3 then town."ad_name" when county."ad_grad" = 3 then county."ad_name" end as countyName , |
| | | case when town."ad_grad" = 2 then town."ad_code" when county."ad_grad" = 2 then county."ad_code" else city."ad_code" end as cityCode , |
| | | case when town."ad_grad" = 2 then town."ad_name" when county."ad_grad" = 2 then county."ad_name" else city."ad_name" end as cityName , |
| | | case when town."ad_grad" = 1 then town."ad_code" when county."ad_grad" = 1 then county."ad_code" when city."ad_grad" = 1 then city."ad_code" else province."ad_code" end as provinceCode , |
| | | case when town."ad_grad" = 1 then town."ad_name" when county."ad_grad" = 1 then county."ad_name" when city."ad_grad" = 1 then city."ad_name" else province."ad_name" end as provinceName |
| | | from ( |
| | | select |
| | | qm.res_id,wm_concat(srdcr.description) ruleDesc |
| | | |
| | | from ywxt.SM_RES_DATA_QUALITY_MANAGE qm |
| | | left join ywxt.SM_RES_DATA_CHECK_RULES srdcr on srdcr.id = qm.rule_id |
| | | where qm.is_deleted = 0 |
| | | and qm.rule_id in ( '1777252387305783298', '1777252642021670914', '1777253026366717954', '1777253294051393537', '1777253523538542594', '1777253725028712449', '1777254213505744898', '1777254438337216514', '1777254629534564354', '1777254774644899841' ) |
| | | <if test="vo.startTime !=null and vo.startTime !=''"> |
| | | AND qm.create_time >= #{vo.startTime} |
| | | </if> |
| | | <if test="vo.endTime !=null and vo.endTime !=''"> |
| | | AND qm.create_time <= #{vo.endTime} |
| | | </if> |
| | | group by qm.res_id |
| | | ) |
| | | basic |
| | | left join SJZT_MD."att_res_base" arb on arb."guid" = basic.res_id |
| | | left join "SJZT_MD"."att_ad_base" town on town."guid" = arb."interior_ad_guid" |
| | | left join "SJZT_MD"."att_ad_base" county on county."ad_code" = town."p_ad_code" |
| | | left join "SJZT_MD"."att_ad_base" city on city."ad_code" = county."p_ad_code" |
| | | left join "SJZT_MD"."att_ad_base" province on province."ad_code" = city."p_ad_code" |
| | | where 1 = 1 and concat(province."ad_code", city."ad_code", county."ad_code", town."ad_code") like CONCAT('%', '422826200000', '%') |
| | | |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | Integer addQualityManage(Long ruleId, String varStr, String whereStr); |
| | | |
| | | List<QualityManageExcel> exportData(QualityManageVO qualityManageVO); |
| | | |
| | | List<QualityManageVO> getList(QualityManageVO qualityManageVO); |
| | | } |
| | |
| | | List<QualityManageExcel> list = baseMapper.exportData(qualityManageVO); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<QualityManageVO> getList(QualityManageVO qualityManageVO) { |
| | | return baseMapper.getList(qualityManageVO); |
| | | } |
| | | } |
| | |
| | | |
| | | private String isExport; |
| | | |
| | | private String provinceCode; |
| | | private String provinceName; |
| | | private String cityCode; |
| | | private String cityName; |
| | | private String countyCode; |
| | | private String countyName; |
| | | private String townCode; |
| | | private String townName; |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztdw.controller; |
| | | |
| | | import cn.gistack.sm.sjztdw.excel.DbExcel; |
| | | import cn.gistack.sm.sjztdw.excel.DbExcelImport; |
| | | import cn.gistack.sm.sjztdw.service.IDwsResFormDiService; |
| | | import cn.gistack.sm.sjztdw.vo.DbExcelVO; |
| | | import cn.gistack.sm.sjztdw.vo.ListVO; |
| | | import io.undertow.websockets.jsr.annotated.DecoderUtils; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.Base64; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 大坝人工上报相关接口 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sjztdw/dbReport") |
| | | @AllArgsConstructor |
| | | public class DbPersonReportController extends BladeController { |
| | | |
| | | private IDwsResFormDiService dbPersonReportService; |
| | | |
| | | /** |
| | | * 导入模板 |
| | | */ |
| | | @GetMapping("export-template") |
| | | public void exportTemplate(HttpServletResponse response) { |
| | | List<DbExcel> list = new ArrayList<>(); |
| | | |
| | | for (int i = 0; i < 10; i++) { |
| | | DbExcel dbExcel = new DbExcel(); |
| | | dbExcel.setMonitorDate(StringUtil.format("2024-03-{}",10+i)); |
| | | list.add(dbExcel); |
| | | } |
| | | ExcelUtil.export(response, "人工上报模板", "人工上报数据表", list, DbExcel.class); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导入数据 |
| | | * @param file 导入excel |
| | | * @param resGuid 水库id |
| | | * @param ch 断面 |
| | | * @return |
| | | */ |
| | | @PostMapping("import-data") |
| | | public R importData(MultipartFile file,String resGuid,@RequestParam("ch") String ch) { |
| | | |
| | | DbExcelImport dbExcelImport = new DbExcelImport(dbPersonReportService,resGuid,ch); |
| | | ExcelUtil.save(file, dbExcelImport, DbExcel.class); |
| | | return R.success("操作成功"); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody DbExcelVO dbExcel){ |
| | | Boolean b = dbPersonReportService.update(dbExcel); |
| | | return R.status(b); |
| | | } |
| | | |
| | | @PostMapping("/remove") |
| | | public R remove(@RequestBody DbExcelVO dbExcelVO){ |
| | | Boolean b = dbPersonReportService.remove(dbExcelVO); |
| | | return R.status(b); |
| | | } |
| | | |
| | | @PostMapping("/removeBatch") |
| | | public R removeBatch(@RequestBody ListVO list){ |
| | | Boolean b = dbPersonReportService.removeBatch(list.getList()); |
| | | return R.status(b); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztdw.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | 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.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 水库雨情日统计表 |
| | | */ |
| | | @Data |
| | | @TableName("\"dws_rain_res_di\"") |
| | | public class DwsRainResDi { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | @TableField(value = "\"st_cd\"") |
| | | //雨情测站编码 |
| | | private String stCd; |
| | | |
| | | |
| | | @TableField(value = "\"st_nm\"") |
| | | //雨情测站编码 |
| | | private String stNm; |
| | | |
| | | |
| | | @TableField(value = "\"res_cd\"") |
| | | //雨情测站编码 |
| | | private String resCd; |
| | | |
| | | @TableField(value = "\"res_nm\"") |
| | | //雨情测站编码 |
| | | private String resNm; |
| | | |
| | | |
| | | @TableField(value = "\"province_cd\"") |
| | | //雨情测站编码 |
| | | private String provinceCd; |
| | | |
| | | |
| | | @TableField(value = "\"province_nm\"") |
| | | //雨情测站编码 |
| | | private String provinceNm; |
| | | |
| | | |
| | | @TableField(value = "\"city_cd\"") |
| | | //雨情测站编码 |
| | | private String cityCd; |
| | | |
| | | |
| | | @TableField(value = "\"city_nm\"") |
| | | //雨情测站编码 |
| | | private String cityNm; |
| | | |
| | | |
| | | @TableField(value = "\"county_cd\"") |
| | | //雨情测站编码 |
| | | private String countyCd; |
| | | |
| | | |
| | | @TableField(value = "\"county_nm\"") |
| | | //雨情测站编码 |
| | | private String countyNm; |
| | | |
| | | |
| | | @TableField(value = "\"town_cd\"") |
| | | //雨情测站编码 |
| | | private String townCd; |
| | | |
| | | |
| | | @TableField(value = "\"town_nm\"") |
| | | //雨情测站编码 |
| | | private String townNm; |
| | | |
| | | |
| | | @TableField(value = "\"village_cd\"") |
| | | //雨情测站编码 |
| | | private String villageCd; |
| | | |
| | | @TableField(value = "\"village_nm\"") |
| | | //雨情测站编码 |
| | | private String villageNm; |
| | | |
| | | |
| | | @TableField(value = "\"flag\"") |
| | | //雨情测站编码 |
| | | private String flag; |
| | | |
| | | |
| | | @TableField(value = "\"dt\"") |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd") |
| | | //日期 |
| | | private Date dt; |
| | | |
| | | |
| | | @TableField(value = "\"drp\"") |
| | | //日累计降雨 |
| | | private String drp; |
| | | |
| | | |
| | | @TableField(value = "\"is_tb\"") |
| | | //填报方式 y n |
| | | private String isTb; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztdw.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @TableName("\"dws_res_form_di\"") |
| | | public class DwsResFormDi { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | @TableField(value = "\"city_nm\"") |
| | | private String cityNm; |
| | | |
| | | @TableField(value = "\"city_cd\"") |
| | | private String cityCd; |
| | | |
| | | @TableField(value = "\"county_nm\"") |
| | | private String countyNm; |
| | | |
| | | @TableField(value = "\"county_cd\"") |
| | | private String countyCd; |
| | | |
| | | @TableField(value = "\"town_nm\"") |
| | | private String townNm; |
| | | |
| | | @TableField(value = "\"town_cd\"") |
| | | private String townCd; |
| | | |
| | | @TableField(value = "\"res_nm\"") |
| | | private String resNm; |
| | | |
| | | @TableField(value = "\"res_cd\"") |
| | | private String resCd; |
| | | |
| | | @TableField(value = "\"res_reg_cd\"") |
| | | private String resRegCd; |
| | | |
| | | @TableField(value = "\"ch\"") |
| | | private String ch; |
| | | |
| | | |
| | | @TableField(value = "\"dt\"") |
| | | private String dt; |
| | | |
| | | |
| | | //SJZT_DW dws_rain_res_di表 drp |
| | | @TableField(value = "\"drp\"") |
| | | private String drp; |
| | | |
| | | //SJZT_DW dws_water_res_z_eight_detail_all表 rz 字段 |
| | | |
| | | @TableField(value = "\"rz\"") |
| | | private String rz; |
| | | |
| | | //SJZT_DW dws_water_res_z_eight_detail_all表 low_z 字段 |
| | | |
| | | @TableField(value = "\"low_z\"") |
| | | private String lowZ; |
| | | |
| | | //SJZT_DW dws_res_press_di 存avg_value |
| | | |
| | | @TableField(value = "\"sy_value\"") |
| | | private String syValue; |
| | | |
| | | //SJZT_DW dws_res_sl_di 存avg_spqn_value |
| | | @TableField(value = "\"sl_value\"") |
| | | private String slValue; |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztdw.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 渗压日数据表 |
| | | */ |
| | | @Data |
| | | @TableName("\"dws_res_press_di\"") |
| | | public class DwsResPressDi { |
| | | |
| | | //测点编码 |
| | | @TableField(value = "\"cd\"") |
| | | private String cd; |
| | | |
| | | @TableField(value = "\"cd_nm\"") |
| | | private String cdNm; |
| | | |
| | | @TableField(value = "\"res_cd\"") |
| | | private String resCd; |
| | | |
| | | @TableField(value = "\"res_nm\"") |
| | | private String resNm; |
| | | |
| | | @TableField(value = "\"avg_value\"") |
| | | private String avgValue; |
| | | |
| | | @TableField(value = "\"dt\"") |
| | | private Date dt; |
| | | |
| | | @TableField(value = "\"is_tb\"") |
| | | private String isTb; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztdw.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 渗压日数据表 |
| | | */ |
| | | @Data |
| | | @TableName("\"dws_res_sl_di\"") |
| | | public class DwsResSlDi { |
| | | |
| | | //测点编码 |
| | | @TableField(value = "\"cd\"") |
| | | private String cd; |
| | | |
| | | |
| | | @TableField(value = "\"res_cd\"") |
| | | private String resCd; |
| | | |
| | | @TableField(value = "\"res_reg_code\"") |
| | | private String resRegCode; |
| | | |
| | | @TableField(value = "\"avg_spqn_value\"") |
| | | private String avgSpqnValue; |
| | | |
| | | @TableField(value = "\"dt\"") |
| | | private Date dt; |
| | | |
| | | @TableField(value = "\"is_tb\"") |
| | | private String isTb; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztdw.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("\"dws_water_res_z_eight_detail_all\"") |
| | | public class DwsWaterResZEightDetailAll { |
| | | |
| | | @TableField(value = "\"dt\"") |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date dt; |
| | | |
| | | @TableField(value = "\"tm\"") |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date tm; |
| | | |
| | | @TableField(value = "\"st_cd\"") |
| | | //雨情测站编码 |
| | | private String stCd; |
| | | |
| | | |
| | | @TableField(value = "\"st_nm\"") |
| | | //雨情测站编码 |
| | | private String stNm; |
| | | |
| | | @TableField(value = "\"res_cd\"") |
| | | //雨情测站编码 |
| | | private String resCd; |
| | | |
| | | @TableField(value = "\"res_nm\"") |
| | | //雨情测站编码 |
| | | private String resNm; |
| | | |
| | | @TableField(value = "\"eng_scal\"") |
| | | private String engScal; |
| | | |
| | | @TableField(value = "\"res_lon\"") |
| | | private String resLon; |
| | | |
| | | @TableField(value = "\"res_lat\"") |
| | | private String resLat; |
| | | |
| | | |
| | | @TableField(value = "\"province_cd\"") |
| | | //雨情测站编码 |
| | | private String provinceCd; |
| | | |
| | | |
| | | @TableField(value = "\"province_nm\"") |
| | | //雨情测站编码 |
| | | private String provinceNm; |
| | | |
| | | |
| | | @TableField(value = "\"city_cd\"") |
| | | //雨情测站编码 |
| | | private String cityCd; |
| | | |
| | | |
| | | @TableField(value = "\"city_nm\"") |
| | | //雨情测站编码 |
| | | private String cityNm; |
| | | |
| | | |
| | | @TableField(value = "\"county_cd\"") |
| | | //雨情测站编码 |
| | | private String countyCd; |
| | | |
| | | |
| | | @TableField(value = "\"county_nm\"") |
| | | //雨情测站编码 |
| | | private String countyNm; |
| | | |
| | | |
| | | @TableField(value = "\"town_cd\"") |
| | | //雨情测站编码 |
| | | private String townCd; |
| | | |
| | | |
| | | @TableField(value = "\"town_nm\"") |
| | | //雨情测站编码 |
| | | private String townNm; |
| | | |
| | | |
| | | @TableField(value = "\"village_cd\"") |
| | | //雨情测站编码 |
| | | private String villageCd; |
| | | |
| | | @TableField(value = "\"village_nm\"") |
| | | //雨情测站编码 |
| | | private String villageNm; |
| | | |
| | | @TableField(value = "\"rz\"") |
| | | //监测水位 |
| | | private String rz; |
| | | |
| | | @TableField(value = "\"par_dt\"") |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | //分区日期 |
| | | private Date parDt; |
| | | |
| | | @TableField(value = "\"resource_flag\"") |
| | | //来源 |
| | | private String resourceFlag; |
| | | |
| | | |
| | | @TableField(value = "\"collect_dt\"") |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | //采集时间 |
| | | private Date collectDt; |
| | | |
| | | @TableField(value = "\"low_z\"") |
| | | //下游水位 |
| | | private String lowZ; |
| | | |
| | | @TableField(value = "\"is_tb\"") |
| | | //是否人工 |
| | | private String isTb; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztdw.excel; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnore; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.format.DateTimeFormat; |
| | | import com.alibaba.excel.annotation.write.style.ColumnWidth; |
| | | import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
| | | import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 大坝人工上报 |
| | | */ |
| | | @Data |
| | | @ColumnWidth(30) |
| | | @HeadRowHeight(20) |
| | | @ContentRowHeight(18) |
| | | public class DbExcel implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ExcelProperty("日期") |
| | | @DateTimeFormat("yyyy-MM-dd") |
| | | private String monitorDate; |
| | | |
| | | @ExcelProperty("降雨量(mm)") |
| | | //SJZT_DW dws_rain_res_di表 drp |
| | | private String drp; |
| | | |
| | | //SJZT_DW dws_water_res_z_eight_detail_all表 rz 字段 |
| | | @ExcelProperty("坝前水位(m)") |
| | | private String rz; |
| | | |
| | | //SJZT_DW dws_water_res_z_eight_detail_all表 low_z 字段 |
| | | @ExcelProperty("下游水位(m)") |
| | | private String lowZ; |
| | | |
| | | //SJZT_DW dws_res_press_di 存avg_value |
| | | @ExcelProperty("测压管水位或渗压计值(m)") |
| | | private String avgValue; |
| | | |
| | | //SJZT_DW dws_res_sl_di 存avg_spqn_value |
| | | @ExcelProperty("渗流量(L)") |
| | | private String avgSpqnValue; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztdw.excel; |
| | | |
| | | import cn.gistack.sm.sjztdw.service.IDwsResFormDiService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springblade.core.excel.support.ExcelImporter; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 导入大坝人工上报数据 |
| | | */ |
| | | @RequiredArgsConstructor |
| | | public class DbExcelImport implements ExcelImporter<DbExcel> { |
| | | |
| | | private final IDwsResFormDiService service; |
| | | |
| | | private final String resGuid; |
| | | |
| | | private final String ch; |
| | | |
| | | @Override |
| | | public void save(List<DbExcel> data) { |
| | | service.importDbPersonData(data,resGuid,ch); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztdw.mapper; |
| | | |
| | | import cn.gistack.common.node.TreeNode; |
| | | import cn.gistack.sm.sjztdw.entity.DwsRainResDi; |
| | | import cn.gistack.sm.sjztdw.excel.DbExcel; |
| | | import cn.gistack.sm.sjztdw.vo.DbExcelVO; |
| | | import cn.gistack.sm.sjztmd.entity.AttAdBase; |
| | | import cn.gistack.sm.sjztmd.vo.AttAdBaseVO; |
| | | import cn.gistack.sm.sjztmd.vo.PersonVO; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.MapKey; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * AddAdBaseMapper 接口 |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @DS("ztdw") |
| | | public interface DwsRainResDiMapper extends BaseMapper<DwsRainResDi> { |
| | | |
| | | |
| | | Integer updateCustomize(@Param("entity") DwsRainResDi dwsRainResDi); |
| | | |
| | | Integer updateByBasic(@Param("entity") DbExcelVO dbExcel); |
| | | |
| | | Integer removeByBasic(@Param("entity") DbExcelVO dbExcelVO); |
| | | } |
| 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.sjztdw.mapper.DwsResPressDiMapper"> |
| | | |
| | | |
| | | <update id="updateCustomize"> |
| | | UPDATE SJZT_DW."dws_res_press_di" SET |
| | | <if test="entity.avgValue != null and entity.avgValue !='' "> |
| | | "avg_value" = #{entity.avgValue} |
| | | </if> |
| | | WHERE 1=1 |
| | | <if test="entity.cd != null and entity.cd !=''"> |
| | | AND "cd" = #{entity.cd} |
| | | </if> |
| | | <if test="entity.isTb != null and entity.isTb != ''"> |
| | | AND "is_tb" = #{entity.isTb} |
| | | </if> |
| | | <if test="entity.dt != null"> |
| | | AND "dt" = #{entity.dt} |
| | | </if> |
| | | <if test="entity.resCd != null and entity.resCd !=''"> |
| | | AND "res_cd" = #{entity.resCd} |
| | | </if> |
| | | </update> |
| | | |
| | | |
| | | |
| | | <update id="updateByBasic"> |
| | | UPDATE SJZT_DW."dws_res_press_di" SET |
| | | "avg_value" = #{entity.avgValue} |
| | | WHERE |
| | | "cd" = #{entity.cd} |
| | | AND "is_tb" = 'y' |
| | | AND "dt" = #{entity.monitorDate} |
| | | AND "res_cd" = #{entity.resCd} |
| | | </update> |
| | | |
| | | |
| | | |
| | | |
| | | <delete id="removeByBasic"> |
| | | DELETE FROM SJZT_DW."dws_res_press_di" |
| | | WHERE |
| | | "cd" = #{entity.cd} |
| | | AND "is_tb" = 'y' |
| | | AND "dt" = #{entity.monitorDate} |
| | | AND "res_cd" = #{entity.resCd} |
| | | |
| | | </delete> |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.sjztdw.mapper; |
| | | |
| | | import cn.gistack.sm.sjztdw.entity.DwsResFormDi; |
| | | import cn.gistack.sm.sjztdw.excel.DbExcel; |
| | | import cn.gistack.sm.sjztdw.vo.DbExcelVO; |
| | | import cn.gistack.sm.sjztmd.vo.AttResAdVO; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | @DS("ztdw") |
| | | public interface DwsResFormDiMapper extends BaseMapper<DwsResFormDi> { |
| | | |
| | | |
| | | Integer save(@Param("excel") DbExcel dbExcel,@Param("res") AttResAdVO resAd,@Param("ch") String ch); |
| | | |
| | | Integer edit(@Param("entity") DbExcelVO dbExcel); |
| | | |
| | | Integer remove(@Param("entity")DbExcelVO dbExcelVO); |
| | | |
| | | Integer updateCustomize(@Param("excel") DbExcel dbExcel,@Param("res") AttResAdVO resAd, @Param("ch") String ch); |
| | | } |
| 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.sjztdw.mapper.DwsResFormDiMapper"> |
| | | |
| | | <insert id="save" parameterType="cn.gistack.sm.sjztdw.entity.DwsResFormDi"> |
| | | INSERT INTO SJZT_DW."dws_res_form_di" |
| | | ( |
| | | "city_nm", |
| | | "city_cd", |
| | | "county_nm", |
| | | "county_cd", |
| | | "town_nm", |
| | | "town_cd", |
| | | "res_nm", |
| | | "res_cd", |
| | | "res_reg_cd", |
| | | "ch", |
| | | "dt", |
| | | "drp", |
| | | "rz", |
| | | "low_z", |
| | | "sy_value", |
| | | "sl_value" |
| | | ) |
| | | VALUES |
| | | ( |
| | | #{res.cityName}, |
| | | #{res.cityCode}, |
| | | #{res.countyName}, |
| | | #{res.countyCode}, |
| | | #{res.townName}, |
| | | #{res.townCode}, |
| | | #{res.resName}, |
| | | #{res.resGuid}, |
| | | #{res.resRegCode}, |
| | | #{ch}, |
| | | #{excel.monitorDate}, |
| | | #{excel.drp,jdbcType=VARCHAR}, |
| | | #{excel.rz,jdbcType=VARCHAR}, |
| | | #{excel.lowZ,jdbcType=VARCHAR}, |
| | | #{excel.avgValue,jdbcType=VARCHAR}, |
| | | #{excel.avgSpqnValue,jdbcType=VARCHAR} |
| | | ) |
| | | |
| | | </insert> |
| | | <update id="edit"> |
| | | UPDATE SJZT_DW."dws_res_form_di" |
| | | SET |
| | | "drp" = #{entity.drp,jdbcType=VARCHAR}, |
| | | "rz" = #{entity.rz,jdbcType=VARCHAR}, |
| | | "low_z" = #{entity.lowZ,jdbcType=VARCHAR}, |
| | | "sy_value" = #{entity.avgValue,jdbcType=VARCHAR}, |
| | | "sl_value" = #{entity.avgSpqnValue,jdbcType=VARCHAR} |
| | | WHERE |
| | | "res_cd" = #{entity.resCd} |
| | | AND "dt" = #{entity.monitorDate} |
| | | AND "ch" = #{entity.ch} |
| | | </update> |
| | | <update id="updateCustomize"> |
| | | UPDATE SJZT_DW."dws_res_form_di" |
| | | SET |
| | | "drp" = #{excel.drp}, |
| | | "rz" = #{excel.rz}, |
| | | "low_z" = #{excel.lowZ}, |
| | | "sy_value" = #{excel.avgValue}, |
| | | "sl_value" = #{excel.avgSpqnValue} |
| | | WHERE |
| | | "res_cd" = #{res.resGuid} |
| | | AND "dt" = #{excel.monitorDate} |
| | | AND "ch" = #{ch} |
| | | </update> |
| | | <delete id="remove"> |
| | | DELETE FROM |
| | | SJZT_DW."dws_res_form_di" |
| | | WHERE |
| | | "res_cd" = #{entity.resCd} |
| | | AND "dt" = #{entity.monitorDate} |
| | | AND "ch" = #{entity.ch} |
| | | |
| | | </delete> |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.sjztdw.mapper; |
| | | |
| | | import cn.gistack.sm.sjztdw.entity.DwsRainResDi; |
| | | import cn.gistack.sm.sjztdw.entity.DwsResPressDi; |
| | | import cn.gistack.sm.sjztdw.vo.DbExcelVO; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * AddAdBaseMapper 接口 |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @DS("ztdw") |
| | | public interface DwsResPressDiMapper extends BaseMapper<DwsResPressDi> { |
| | | |
| | | |
| | | Integer updateCustomize(@Param("entity") DwsResPressDi dwsResPressDi); |
| | | |
| | | Integer updateByBasic(@Param("entity") DbExcelVO dbExcel); |
| | | |
| | | Integer removeByBasic(@Param("entity") DbExcelVO dbExcelVO); |
| | | } |
| 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.sjztdw.mapper.DwsRainResDiMapper"> |
| | | |
| | | |
| | | <update id="updateCustomize"> |
| | | |
| | | UPDATE SJZT_DW."dws_rain_res_di" SET |
| | | <if test="entity.drp != null and entity.drp !='' "> |
| | | "drp" = #{entity.drp} |
| | | </if> |
| | | WHERE 1=1 |
| | | AND "is_tb" = 'y' |
| | | <if test="entity.dt != null"> |
| | | AND "dt" = #{entity.dt} |
| | | </if> |
| | | <if test="entity.resCd != null and entity.resCd !=''"> |
| | | AND "res_cd" = #{entity.resCd} |
| | | </if> |
| | | <if test="entity.stCd != null and entity.stCd != ''"> |
| | | AND "st_cd" = #{entity.stCd} |
| | | </if> |
| | | |
| | | |
| | | </update> |
| | | <update id="updateByBasic"> |
| | | UPDATE SJZT_DW."dws_rain_res_di" SET |
| | | <if test="entity.drp != null and entity.drp !='' "> |
| | | "drp" = #{entity.drp} |
| | | </if> |
| | | WHERE 1=1 |
| | | AND "is_tb" = 'y' |
| | | AND "dt" = #{entity.monitorDate} |
| | | AND "res_cd" = #{entity.resCd} |
| | | </update> |
| | | |
| | | |
| | | <delete id="removeByBasic"> |
| | | DELETE FROM SJZT_DW."dws_rain_res_di" |
| | | where |
| | | "is_tb" = 'y' |
| | | AND "dt" = #{entity.monitorDate} |
| | | AND "res_cd" = #{entity.resCd} |
| | | </delete> |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.sjztdw.mapper; |
| | | |
| | | import cn.gistack.sm.sjztdw.entity.DwsResPressDi; |
| | | import cn.gistack.sm.sjztdw.entity.DwsResSlDi; |
| | | import cn.gistack.sm.sjztdw.vo.DbExcelVO; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * AddAdBaseMapper 接口 |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @DS("ztdw") |
| | | public interface DwsResSlDiMapper extends BaseMapper<DwsResSlDi> { |
| | | |
| | | |
| | | Integer updateCustomize(@Param("entity") DwsResSlDi dwsResSlDi); |
| | | |
| | | Integer updateByBasic(@Param("entity") DbExcelVO dbExcel); |
| | | |
| | | Integer removeByBasic(@Param("entity") DbExcelVO dbExcelVO); |
| | | } |
| 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.sjztdw.mapper.DwsResSlDiMapper"> |
| | | |
| | | |
| | | <update id="updateCustomize"> |
| | | |
| | | UPDATE SJZT_DW."dws_res_sl_di" SET |
| | | <if test="entity.avgSpqnValue != null and entity.avgSpqnValue !='' "> |
| | | "avg_spqn_value" = #{entity.avgSpqnValue} |
| | | </if> |
| | | WHERE 1=1 |
| | | <if test="entity.cd != null and entity.cd !=''"> |
| | | AND "cd" = #{entity.cd} |
| | | </if> |
| | | <if test="entity.isTb != null and entity.isTb != ''"> |
| | | AND "is_tb" = #{entity.isTb} |
| | | </if> |
| | | <if test="entity.dt != null"> |
| | | AND "dt" = #{entity.dt} |
| | | </if> |
| | | <if test="entity.resCd != null and entity.resCd !=''"> |
| | | AND "res_cd" = #{entity.resCd} |
| | | </if> |
| | | <if test="entity.resRegCode != null and entity.resRegCode !=''"> |
| | | AND "res_reg_code" = #{entity.resRegCode} |
| | | </if> |
| | | |
| | | </update> |
| | | <update id="updateByBasic"> |
| | | |
| | | UPDATE SJZT_DW."dws_res_sl_di" SET |
| | | "avg_spqn_value" = #{entity.avgSpqnValue} |
| | | WHERE |
| | | "cd" = #{entity.cd} |
| | | AND "is_tb" = 'y' |
| | | AND "dt" = #{entity.monitorDate} |
| | | AND "res_cd" = #{entity.resCd} |
| | | AND "cd" = #{entity.cd} |
| | | </update> |
| | | <delete id="removeByBasic"> |
| | | DELETE FROM SJZT_DW."dws_res_sl_di" |
| | | WHERE |
| | | "cd" = #{entity.cd} |
| | | AND "is_tb" = 'y' |
| | | AND "dt" = #{entity.monitorDate} |
| | | AND "res_cd" = #{entity.resCd} |
| | | AND "cd" = #{entity.cd} |
| | | </delete> |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.sjztdw.mapper; |
| | | |
| | | import cn.gistack.sm.sjztdw.entity.DwsWaterResZEightDetailAll; |
| | | import cn.gistack.sm.sjztdw.vo.DbExcelVO; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * AddAdBaseMapper 接口 |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @DS("ztdw") |
| | | public interface DwsWaterResZEightDetailAllMapper extends BaseMapper<DwsWaterResZEightDetailAll> { |
| | | |
| | | |
| | | Integer updateCustomize(@Param("entity") DwsWaterResZEightDetailAll dwsWaterResZEightDetailAll); |
| | | |
| | | Integer updateByBasic(@Param("entity") DbExcelVO dbExcel); |
| | | |
| | | Integer removeByBasic(@Param("entity") DbExcelVO dbExcelVO); |
| | | } |
| 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.sjztdw.mapper.DwsWaterResZEightDetailAllMapper"> |
| | | |
| | | |
| | | <update id="updateCustomize"> |
| | | |
| | | UPDATE SJZT_DW."dws_water_res_z_eight_detail_all" SET |
| | | <if test="entity.rz != null and entity.rz !='' "> |
| | | "rz" = #{entity.rz}, |
| | | </if> |
| | | <if test="entity.lowZ != null and entity.lowZ !='' "> |
| | | "low_z" = #{entity.lowZ} |
| | | </if> |
| | | WHERE 1=1 |
| | | <if test="entity.isTb != null and entity.isTb != ''"> |
| | | AND "is_tb" = #{entity.isTb} |
| | | </if> |
| | | <if test="entity.collectDt != null"> |
| | | AND "collect_dt" = #{entity.collectDt} |
| | | </if> |
| | | <if test="entity.resCd != null and entity.resCd !=''"> |
| | | AND "res_cd" = #{entity.resCd} |
| | | </if> |
| | | <if test="entity.stCd != null and entity.stCd != ''"> |
| | | AND "st_cd" = #{entity.stCd} |
| | | </if> |
| | | </update> |
| | | |
| | | <update id="updateByBasic"> |
| | | UPDATE SJZT_DW."dws_water_res_z_eight_detail_all" SET |
| | | "rz" = #{entity.rz}, |
| | | "low_z" = #{entity.lowZ} |
| | | WHERE |
| | | "is_tb" = 'y' |
| | | AND "collect_dt" = #{entity.monitorDate} |
| | | AND "res_cd" = #{entity.resCd} |
| | | </update> |
| | | |
| | | <delete id="removeByBasic"> |
| | | DELETE FROM SJZT_DW."dws_water_res_z_eight_detail_all" |
| | | WHERE |
| | | "is_tb" = 'y' |
| | | AND DATE_FORMAT("collect_dt",'%Y-%m-%d') = DATE_FORMAT(#{entity.monitorDate},'%Y-%m-%d') |
| | | AND "res_cd" = #{entity.resCd} |
| | | </delete> |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.sjztdw.service; |
| | | |
| | | import cn.gistack.sm.sjztdw.entity.DwsRainResDi; |
| | | import cn.gistack.sm.sjztdw.excel.DbExcel; |
| | | import cn.gistack.sm.sjztdw.vo.DbExcelVO; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface IDwsRainResDiService extends IService<DwsRainResDi> { |
| | | Integer updateCustomize(DwsRainResDi dwsRainResDi); |
| | | |
| | | Integer updateByBasic(DbExcelVO dbExcel); |
| | | |
| | | Integer removeByBasic(DbExcelVO dbExcelVO); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztdw.service; |
| | | |
| | | import cn.gistack.sm.sjztdw.entity.DwsResFormDi; |
| | | import cn.gistack.sm.sjztdw.excel.DbExcel; |
| | | import cn.gistack.sm.sjztdw.vo.DbExcelVO; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IDwsResFormDiService extends IService<DwsResFormDi> { |
| | | |
| | | void importDbPersonData(List<DbExcel> data, String resGuid,String ch); |
| | | |
| | | Boolean update(DbExcelVO dbExcel); |
| | | |
| | | Boolean remove(DbExcelVO dbExcelVO); |
| | | |
| | | Boolean removeBatch(List<DbExcelVO> list); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztdw.service; |
| | | |
| | | import cn.gistack.sm.sjztdw.entity.DwsRainResDi; |
| | | import cn.gistack.sm.sjztdw.entity.DwsResPressDi; |
| | | import cn.gistack.sm.sjztdw.vo.DbExcelVO; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface IDwsResPressDiService extends IService<DwsResPressDi> { |
| | | Integer updateCustomize(DwsResPressDi dwsResPressDi); |
| | | |
| | | Integer updateByBasic(DbExcelVO dbExcel); |
| | | |
| | | Integer removeByBasic(DbExcelVO dbExcelVO); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztdw.service; |
| | | |
| | | import cn.gistack.sm.sjztdw.entity.DwsResSlDi; |
| | | import cn.gistack.sm.sjztdw.vo.DbExcelVO; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface IDwsResSlDiService extends IService<DwsResSlDi> { |
| | | Integer updateCustomize(DwsResSlDi dwsResSlDi); |
| | | |
| | | Integer updateByBasic(DbExcelVO dbExcel); |
| | | |
| | | Integer removeByBasic(DbExcelVO dbExcelVO); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztdw.service; |
| | | |
| | | import cn.gistack.sm.sjztdw.entity.DwsRainResDi; |
| | | import cn.gistack.sm.sjztdw.entity.DwsWaterResZEightDetailAll; |
| | | import cn.gistack.sm.sjztdw.vo.DbExcelVO; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface IDwsWaterResZEightDetailAllService extends IService<DwsWaterResZEightDetailAll> { |
| | | Integer updateCustomize(DwsWaterResZEightDetailAll dwsWaterResZEightDetailAll); |
| | | |
| | | Integer updateByBasic(DbExcelVO dbExcel); |
| | | |
| | | Integer removeByBasic(DbExcelVO dbExcelVO); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztdw.service.impl; |
| | | |
| | | import cn.gistack.sm.sjztdw.entity.DwsRainResDi; |
| | | import cn.gistack.sm.sjztdw.excel.DbExcel; |
| | | import cn.gistack.sm.sjztdw.mapper.DwsRainResDiMapper; |
| | | import cn.gistack.sm.sjztdw.service.IDwsRainResDiService; |
| | | import cn.gistack.sm.sjztdw.vo.DbExcelVO; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | @DS("ztdw") |
| | | public class DwsRainResDiServiceImpl extends ServiceImpl<DwsRainResDiMapper, DwsRainResDi> implements IDwsRainResDiService { |
| | | @Override |
| | | public Integer updateCustomize(DwsRainResDi dwsRainResDi) { |
| | | return baseMapper.updateCustomize(dwsRainResDi); |
| | | } |
| | | |
| | | @Override |
| | | public Integer updateByBasic(DbExcelVO dbExcel) { |
| | | return baseMapper.updateByBasic(dbExcel); |
| | | } |
| | | |
| | | @Override |
| | | public Integer removeByBasic(DbExcelVO dbExcelVO) { |
| | | return baseMapper.removeByBasic(dbExcelVO); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztdw.service.impl; |
| | | |
| | | import cn.gistack.sm.sjztdw.entity.*; |
| | | import cn.gistack.sm.sjztdw.excel.DbExcel; |
| | | import cn.gistack.sm.sjztdw.mapper.DwsResFormDiMapper; |
| | | import cn.gistack.sm.sjztdw.service.*; |
| | | import cn.gistack.sm.sjztdw.vo.DbExcelVO; |
| | | import cn.gistack.sm.sjztmd.service.IAttResBaseService; |
| | | import cn.gistack.sm.sjztmd.vo.AttResAdVO; |
| | | import cn.gistack.sm.sjztods.entity.DsmSpgSpprmp; |
| | | import cn.gistack.sm.sjztods.entity.DsmSpgSpqnmp; |
| | | import cn.gistack.sm.sjztods.service.IDsmSpgSpprmpService; |
| | | import cn.gistack.sm.sjztods.service.IDsmSpgSpqnmpService; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | @AllArgsConstructor |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @DS("ztdw") |
| | | public class DwsResFormDiServiceImpl extends ServiceImpl<DwsResFormDiMapper, DwsResFormDi> implements IDwsResFormDiService { |
| | | private IAttResBaseService attResBaseService; |
| | | |
| | | //日数据监测 |
| | | private IDwsRainResDiService dwsRainResDiService; |
| | | private IDwsWaterResZEightDetailAllService dwsWaterResZEightDetailAllService; |
| | | private IDwsResPressDiService dwsResPressDiService; |
| | | private IDwsResSlDiService dwsResSlDiService; |
| | | |
| | | //测点表 |
| | | private IDsmSpgSpqnmpService dsmSpgSpqnmpService; |
| | | private IDsmSpgSpprmpService dsmSpgSpprmpService; |
| | | |
| | | @Override |
| | | public void importDbPersonData(List<DbExcel> data, String resGuid,String ch) { |
| | | |
| | | //获取行政区划 |
| | | AttResAdVO resAd = attResBaseService.getResAd(resGuid); |
| | | |
| | | DsmSpgSpprmp paramSy = new DsmSpgSpprmp(); |
| | | paramSy.setCh(ch); |
| | | paramSy.setRscd(resAd.getResRegCode()); |
| | | |
| | | //根据水库注册登记码,断面获取渗压站列表,并按测点编号从小到大排序 |
| | | List<DsmSpgSpprmp> dsmSpgSpprmpList = dsmSpgSpprmpService.getList(paramSy); |
| | | |
| | | //从渗流测点表中根据断面和水库注册登记码获取测点编码 |
| | | DsmSpgSpqnmp paramSl = new DsmSpgSpqnmp(); |
| | | paramSl.setCh(ch); |
| | | paramSl.setRscd(resAd.getResRegCode()); |
| | | List<DsmSpgSpqnmp> dsmSpgSpqnmpList = dsmSpgSpqnmpService.getList(paramSl); |
| | | |
| | | data.forEach(dbExcel->{ |
| | | |
| | | if (StringUtil.isBlank(dbExcel.getRz())){ |
| | | dbExcel.setRz(""); |
| | | } |
| | | if (StringUtil.isBlank(dbExcel.getDrp())){ |
| | | dbExcel.setDrp(""); |
| | | } |
| | | if (StringUtil.isBlank(dbExcel.getLowZ())){ |
| | | dbExcel.setLowZ(""); |
| | | } |
| | | if (StringUtil.isBlank(dbExcel.getAvgValue())){ |
| | | dbExcel.setAvgValue(""); |
| | | } |
| | | if (StringUtil.isBlank(dbExcel.getAvgSpqnValue())){ |
| | | dbExcel.setAvgSpqnValue(""); |
| | | } |
| | | |
| | | //存总表数据 |
| | | Integer i = baseMapper.updateCustomize(dbExcel,resAd,ch); |
| | | if (i<=0){ |
| | | baseMapper.save(dbExcel,resAd,ch); |
| | | } |
| | | |
| | | if (StringUtil.isNotBlank(dbExcel.getDrp())){ |
| | | //存雨情数据 |
| | | saveDayRainFall(dbExcel,resAd); |
| | | } |
| | | |
| | | if (StringUtil.isNotBlank(dbExcel.getRz()) || StringUtil.isNotBlank(dbExcel.getLowZ())){ |
| | | //存水位数据 |
| | | saveWaterLevel(dbExcel,resAd); |
| | | } |
| | | |
| | | if (StringUtil.isNotBlank(dbExcel.getAvgValue())){ |
| | | //存渗压数据 |
| | | saveSy(dbExcel,resAd,dsmSpgSpprmpList); |
| | | } |
| | | |
| | | if (StringUtil.isNotBlank(dbExcel.getAvgSpqnValue())){ |
| | | //存渗流数据 |
| | | saveSl(dbExcel,resAd,dsmSpgSpqnmpList); |
| | | } |
| | | |
| | | |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean update(DbExcelVO dbExcel) { |
| | | |
| | | |
| | | baseMapper.edit(dbExcel); |
| | | |
| | | //根据日期更新数据 |
| | | if (StringUtil.isNotBlank(dbExcel.getMonitorDate())){ |
| | | |
| | | |
| | | |
| | | Integer a = dwsRainResDiService.updateByBasic(dbExcel); |
| | | Integer b = dwsWaterResZEightDetailAllService.updateByBasic(dbExcel); |
| | | |
| | | Integer c = dwsResPressDiService.updateByBasic(dbExcel); |
| | | Integer d = dwsResSlDiService.updateByBasic(dbExcel); |
| | | |
| | | boolean b1 = a > 0; |
| | | boolean b2 = b > 0; |
| | | boolean b3 = c > 0; |
| | | boolean b4 = d > 0; |
| | | return true; |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean remove(DbExcelVO dbExcelVO) { |
| | | |
| | | baseMapper.remove(dbExcelVO); |
| | | |
| | | //根据日期删除数据 |
| | | if (StringUtil.isNotBlank(dbExcelVO.getMonitorDate())){ |
| | | Integer a = dwsRainResDiService.removeByBasic(dbExcelVO); |
| | | Integer b = dwsWaterResZEightDetailAllService.removeByBasic(dbExcelVO); |
| | | Integer c = dwsResPressDiService.removeByBasic(dbExcelVO); |
| | | Integer d = dwsResSlDiService.removeByBasic(dbExcelVO); |
| | | |
| | | boolean b1 = a > 0; |
| | | boolean b2 = b > 0; |
| | | boolean b3 = c > 0; |
| | | boolean b4 = d > 0; |
| | | |
| | | return b1&&b2&&b3&&b4; |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean removeBatch(List<DbExcelVO> list) { |
| | | |
| | | list.forEach(e->{ |
| | | remove(e); |
| | | }); |
| | | |
| | | return true; |
| | | } |
| | | |
| | | private void saveSy(DbExcel dbExcel, AttResAdVO resAd,List<DsmSpgSpprmp> list) { |
| | | try { |
| | | //excel数据应是按测压管从小到大 |
| | | List<String> avgValueList = Arrays.asList(dbExcel.getAvgValue().split(",")); |
| | | |
| | | //有渗压站才添加 |
| | | if (list !=null && list.size()>0){ |
| | | for (int i = 0; i < avgValueList.size(); i++) { |
| | | String avgValue = avgValueList.get(i); |
| | | DsmSpgSpprmp dsmSpgSpprmp = list.get(i); |
| | | |
| | | DwsResPressDi dwsResPressDi = new DwsResPressDi(); |
| | | //站点编码 |
| | | dwsResPressDi.setCd(dsmSpgSpprmp.getMpcd()); |
| | | //站点名称 |
| | | dwsResPressDi.setCdNm(dsmSpgSpprmp.getMpcd()); |
| | | |
| | | dwsResPressDi.setResCd(resAd.getResGuid()); |
| | | dwsResPressDi.setResNm(resAd.getResName()); |
| | | dwsResPressDi.setAvgValue(avgValue); |
| | | |
| | | Date date = dateFormatString(dbExcel.getMonitorDate(), "yyyy-MM-dd"); |
| | | dwsResPressDi.setDt(date); |
| | | dwsResPressDi.setIsTb("y"); |
| | | |
| | | Integer result = dwsResPressDiService.updateCustomize(dwsResPressDi); |
| | | if (result<=0){ |
| | | dwsResPressDiService.save(dwsResPressDi); |
| | | } |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | throw new RuntimeException("表格渗压数据个数超过当前水库断面测点个数"); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | private void saveSl(DbExcel dbExcel, AttResAdVO resAd,List<DsmSpgSpqnmp> list) { |
| | | |
| | | //有渗流站点才添加 |
| | | if (list != null && list.size()>0){ |
| | | DwsResSlDi dwsResSlDi = new DwsResSlDi(); |
| | | |
| | | if (list != null && list.size()>0){ |
| | | dwsResSlDi.setCd(list.get(0).getMpcd()); |
| | | } |
| | | |
| | | dwsResSlDi.setResRegCode(resAd.getResRegCode()); |
| | | dwsResSlDi.setResCd(resAd.getResGuid()); |
| | | |
| | | dwsResSlDi.setAvgSpqnValue(dbExcel.getAvgSpqnValue()); |
| | | |
| | | Date date = dateFormatString(dbExcel.getMonitorDate(), "yyyy-MM-dd"); |
| | | |
| | | dwsResSlDi.setDt(date); |
| | | dwsResSlDi.setIsTb("y"); |
| | | |
| | | |
| | | Integer result = dwsResSlDiService.updateCustomize(dwsResSlDi); |
| | | if (result<=0){ |
| | | dwsResSlDiService.save(dwsResSlDi); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 保存雨情数据 |
| | | * @param dbExcel |
| | | * @param resAd |
| | | */ |
| | | private void saveDayRainFall(DbExcel dbExcel, AttResAdVO resAd) { |
| | | |
| | | DwsRainResDi dwsRainResDi = new DwsRainResDi(); |
| | | |
| | | dwsRainResDi.setStCd(""); |
| | | dwsRainResDi.setStNm("人工上报"); |
| | | dwsRainResDi.setResCd(resAd.getResGuid()); |
| | | dwsRainResDi.setResNm(resAd.getResName()); |
| | | dwsRainResDi.setProvinceCd(resAd.getProvinceCode()); |
| | | dwsRainResDi.setProvinceNm(resAd.getProvinceName()); |
| | | dwsRainResDi.setCityCd(resAd.getCityCode()); |
| | | dwsRainResDi.setCityNm(resAd.getCityName()); |
| | | dwsRainResDi.setCountyCd(resAd.getCountyName()); |
| | | dwsRainResDi.setTownCd(resAd.getTownCode()); |
| | | dwsRainResDi.setTownNm(resAd.getTownName()); |
| | | |
| | | dwsRainResDi.setFlag("人工"); |
| | | |
| | | Date date = dateFormatString(dbExcel.getMonitorDate(), "yyyy-MM-dd"); |
| | | dwsRainResDi.setDt(date); |
| | | dwsRainResDi.setIsTb("y"); |
| | | dwsRainResDi.setDrp(dbExcel.getDrp()); |
| | | //根据参数更新数据,如果受影响的行数为0说明这条数据没有,就添加 |
| | | Integer result = dwsRainResDiService.updateCustomize(dwsRainResDi); |
| | | |
| | | if (result <= 0){ |
| | | dwsRainResDiService.save(dwsRainResDi); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 保存水位数据 |
| | | * @param dbExcel |
| | | * @param resAd |
| | | */ |
| | | private void saveWaterLevel(DbExcel dbExcel, AttResAdVO resAd) { |
| | | DwsWaterResZEightDetailAll dwsWaterResZEightDetailAll = new DwsWaterResZEightDetailAll(); |
| | | |
| | | |
| | | dwsWaterResZEightDetailAll.setStCd(""); |
| | | dwsWaterResZEightDetailAll.setStNm("人工上报"); |
| | | |
| | | dwsWaterResZEightDetailAll.setResCd(resAd.getResGuid()); |
| | | dwsWaterResZEightDetailAll.setResNm(resAd.getResName()); |
| | | dwsWaterResZEightDetailAll.setEngScal(resAd.getEngScal()); |
| | | dwsWaterResZEightDetailAll.setResLat(resAd.getResLat()); |
| | | dwsWaterResZEightDetailAll.setResLon(resAd.getResLon()); |
| | | |
| | | dwsWaterResZEightDetailAll.setProvinceCd(resAd.getProvinceCode()); |
| | | dwsWaterResZEightDetailAll.setProvinceNm(resAd.getProvinceName()); |
| | | dwsWaterResZEightDetailAll.setCityCd(resAd.getCityCode()); |
| | | dwsWaterResZEightDetailAll.setCityNm(resAd.getCityName()); |
| | | dwsWaterResZEightDetailAll.setCountyCd(resAd.getCountyName()); |
| | | dwsWaterResZEightDetailAll.setTownCd(resAd.getTownCode()); |
| | | dwsWaterResZEightDetailAll.setTownNm(resAd.getTownName()); |
| | | |
| | | dwsWaterResZEightDetailAll.setRz(dbExcel.getRz()); |
| | | dwsWaterResZEightDetailAll.setLowZ(dbExcel.getLowZ()); |
| | | |
| | | dwsWaterResZEightDetailAll.setResourceFlag("人工"); |
| | | dwsWaterResZEightDetailAll.setIsTb("y"); |
| | | |
| | | Date date = dateFormatString(dbExcel.getMonitorDate() + " 08:00:00", "yyyy-MM-dd 08:00:00"); |
| | | dwsWaterResZEightDetailAll.setDt(date); |
| | | dwsWaterResZEightDetailAll.setTm(date); |
| | | dwsWaterResZEightDetailAll.setCollectDt(date); |
| | | dwsWaterResZEightDetailAll.setParDt(date); |
| | | |
| | | Integer result = dwsWaterResZEightDetailAllService.updateCustomize(dwsWaterResZEightDetailAll); |
| | | if (result<=0){ |
| | | dwsWaterResZEightDetailAllService.save(dwsWaterResZEightDetailAll); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | private Date dateFormatString(String date,String format){ |
| | | |
| | | if (StringUtil.isNotBlank(date)){ |
| | | try { |
| | | |
| | | Date parse = new SimpleDateFormat(format).parse(date); |
| | | return parse; |
| | | |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztdw.service.impl; |
| | | |
| | | import cn.gistack.sm.sjztdw.entity.DwsResPressDi; |
| | | import cn.gistack.sm.sjztdw.mapper.DwsResPressDiMapper; |
| | | import cn.gistack.sm.sjztdw.service.IDwsResPressDiService; |
| | | import cn.gistack.sm.sjztdw.vo.DbExcelVO; |
| | | import cn.gistack.sm.sjztods.entity.DsmSpgSpprmp; |
| | | import cn.gistack.sm.sjztods.service.IDsmSpgSpprmpService; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | @DS("ztdw") |
| | | @AllArgsConstructor |
| | | public class DwsResPressDiServiceImpl extends ServiceImpl<DwsResPressDiMapper, DwsResPressDi> implements IDwsResPressDiService { |
| | | |
| | | private final IDsmSpgSpprmpService dsmSpgSpprmpService; |
| | | |
| | | @Override |
| | | public Integer updateCustomize(DwsResPressDi dwsResPressDi) { |
| | | return baseMapper.updateCustomize(dwsResPressDi); |
| | | } |
| | | |
| | | @Override |
| | | public Integer updateByBasic(DbExcelVO dbExcel) { |
| | | DsmSpgSpprmp paramSy = new DsmSpgSpprmp(); |
| | | paramSy.setCh(dbExcel.getCh()); |
| | | paramSy.setRscd(dbExcel.getResRegCode()); |
| | | |
| | | //根据水库注册登记码,断面获取渗压站列表,并按测点编号从小到大排序 |
| | | List<DsmSpgSpprmp> list = dsmSpgSpprmpService.getList(paramSy); |
| | | |
| | | //excel数据应是按测压管从小到大 |
| | | List<String> avgValueList = Arrays.asList(dbExcel.getAvgValue().split(",")); |
| | | |
| | | //更新渗压站数据 |
| | | if (list !=null && list.size()>0){ |
| | | for (int i = 0; i < avgValueList.size(); i++) { |
| | | String avgValue = avgValueList.get(i); |
| | | DsmSpgSpprmp dsmSpgSpprmp = list.get(i); |
| | | |
| | | DbExcelVO updateParams = new DbExcelVO(); |
| | | |
| | | updateParams.setResCd(dbExcel.getResCd()); |
| | | updateParams.setCd(dsmSpgSpprmp.getMpcd()); |
| | | updateParams.setMonitorDate(dbExcel.getMonitorDate()); |
| | | updateParams.setAvgValue(avgValue); |
| | | |
| | | baseMapper.updateByBasic(updateParams); |
| | | |
| | | } |
| | | } |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | @Override |
| | | public Integer removeByBasic(DbExcelVO dbExcelVO) { |
| | | return baseMapper.removeByBasic(dbExcelVO); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztdw.service.impl; |
| | | |
| | | import cn.gistack.sm.sjztdw.entity.DwsResSlDi; |
| | | import cn.gistack.sm.sjztdw.mapper.DwsResSlDiMapper; |
| | | import cn.gistack.sm.sjztdw.service.IDwsResSlDiService; |
| | | import cn.gistack.sm.sjztdw.vo.DbExcelVO; |
| | | import cn.gistack.sm.sjztods.entity.DsmSpgSpqnmp; |
| | | import cn.gistack.sm.sjztods.service.IDsmSpgSpqnmpService; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | @DS("ztdw") |
| | | @AllArgsConstructor |
| | | public class DwsResSlDiServiceImpl extends ServiceImpl<DwsResSlDiMapper, DwsResSlDi> implements IDwsResSlDiService { |
| | | |
| | | private IDsmSpgSpqnmpService dsmSpgSpqnmpService; |
| | | |
| | | @Override |
| | | public Integer updateCustomize(DwsResSlDi dwsResSlDi) { |
| | | return baseMapper.updateCustomize(dwsResSlDi); |
| | | } |
| | | |
| | | @Override |
| | | public Integer updateByBasic(DbExcelVO dbExcel) { |
| | | |
| | | //从渗流测点表中根据断面和水库注册登记码获取测点编码 |
| | | DsmSpgSpqnmp paramSl = new DsmSpgSpqnmp(); |
| | | paramSl.setCh(dbExcel.getCh()); |
| | | paramSl.setRscd(dbExcel.getResRegCode()); |
| | | List<DsmSpgSpqnmp> list = dsmSpgSpqnmpService.getList(paramSl); |
| | | |
| | | |
| | | //有渗流站点才添加 |
| | | if (list != null && list.size()>0){ |
| | | String cd = ""; |
| | | |
| | | if (list != null && list.size()>0){ |
| | | cd = list.get(0).getMpcd(); |
| | | } |
| | | |
| | | DbExcelVO updateParams = new DbExcelVO(); |
| | | |
| | | |
| | | updateParams.setAvgSpqnValue(dbExcel.getAvgSpqnValue()); |
| | | |
| | | updateParams.setCd(cd); |
| | | updateParams.setMonitorDate(dbExcel.getMonitorDate()); |
| | | updateParams.setResCd(dbExcel.getResCd()); |
| | | |
| | | return baseMapper.updateByBasic(updateParams); |
| | | } |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public Integer removeByBasic(DbExcelVO dbExcelVO) { |
| | | return baseMapper.removeByBasic(dbExcelVO); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztdw.service.impl; |
| | | |
| | | import cn.gistack.sm.sjztdw.entity.DwsWaterResZEightDetailAll; |
| | | import cn.gistack.sm.sjztdw.mapper.DwsWaterResZEightDetailAllMapper; |
| | | import cn.gistack.sm.sjztdw.service.IDwsWaterResZEightDetailAllService; |
| | | import cn.gistack.sm.sjztdw.vo.DbExcelVO; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | @DS("ztdw") |
| | | public class DwsWaterResZEightDetailAllServiceImpl extends ServiceImpl<DwsWaterResZEightDetailAllMapper, DwsWaterResZEightDetailAll> implements IDwsWaterResZEightDetailAllService { |
| | | @Override |
| | | public Integer updateCustomize(DwsWaterResZEightDetailAll dwsWaterResZEightDetailAll) { |
| | | return baseMapper.updateCustomize(dwsWaterResZEightDetailAll); |
| | | } |
| | | |
| | | @Override |
| | | public Integer updateByBasic(DbExcelVO dbExcel) { |
| | | return baseMapper.updateByBasic(dbExcel); |
| | | } |
| | | |
| | | @Override |
| | | public Integer removeByBasic(DbExcelVO dbExcelVO) { |
| | | return baseMapper.removeByBasic(dbExcelVO); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztdw.vo; |
| | | |
| | | import cn.gistack.sm.sjztdw.excel.DbExcel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class DbExcelVO extends DbExcel { |
| | | |
| | | //水库编码 |
| | | private String resCd; |
| | | |
| | | private String resRegCode; |
| | | |
| | | |
| | | //测点编码 |
| | | private String cd; |
| | | |
| | | private String ch; |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztdw.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class ListVO { |
| | | List<DbExcelVO> list; |
| | | } |
| | |
| | | return ForestNodeMerger.merge(list); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getYwxtAttadBaseList") |
| | | public R getYwxtAttadBaseList(String parentId,String isYwxtRegion){ |
| | | List<AttAdBase> attAdBases = attAdBaseService.getYwxtAttadBaseList(parentId,isYwxtRegion); |
| | | return R.data(attAdBases); |
| | | } |
| | | |
| | | } |
| | |
| | | import cn.gistack.sm.sjztmd.entity.AttAdBase; |
| | | import cn.gistack.sm.sjztmd.entity.AttResBase; |
| | | import cn.gistack.sm.sjztmd.entity.AttResStagChar; |
| | | import cn.gistack.sm.sjztmd.excel.AttResBaseUserExcel; |
| | | import cn.gistack.sm.sjztmd.service.IAttAdBaseService; |
| | | import cn.gistack.sm.sjztmd.service.IAttResBaseService; |
| | | import cn.gistack.sm.sjztmd.vo.AttAdBaseVO; |
| | | import cn.gistack.sm.sjztmd.vo.AttResBaseVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.node.ForestNodeMerger; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | @ApiOperation(value = "中台水库-查询该行政区下的水库", notes = "中台水库-查询该行政区下的水库") |
| | | @GetMapping(value = "/getListByRegion") |
| | | public R getListByRegion(@ApiIgnore @RequestParam Map<String, Object> obj,Query query) { |
| | | IPage<AttResBase> pageList = attResBaseService.getListByRegion(Condition.getPage(query),obj); |
| | | IPage<AttResBaseVO> pageList = attResBaseService.getListByRegion(Condition.getPage(query),obj); |
| | | return R.data(pageList); |
| | | } |
| | | |
| | |
| | | return R.data(attResBaseService.getAttResBaseUserPage(Condition.getPage(query),params)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导出责任人数据 |
| | | * @param params 条件查询参数对象 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "中台水库-导出责任人数据", notes = "中台水库-导出责任人数据") |
| | | @GetMapping(value = "/exportAttResBaseUser") |
| | | public void exportAttResBaseUser(@RequestParam Map<String, Object> params, HttpServletResponse response) { |
| | | |
| | | List<AttResBaseUserExcel> list = attResBaseService.exportAttResBaseUser(params); |
| | | ExcelUtil.export(response, "水库责任人数据数据" + DateUtil.time(), "水库责任人数据表", list, AttResBaseUserExcel.class); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | |
| | | return R.status(tbAttResBaseService.auditByGuid(tbAttResBase)); |
| | | } |
| | | |
| | | |
| | | //初始化数据 |
| | | @GetMapping(value = "/initTbData") |
| | | public R initTbData(){ |
| | | String message = tbAttResBaseService.initTbData(); |
| | | return R.success(message); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import cn.gistack.sm.sjztmd.excel.TbProjectImporter; |
| | | import cn.gistack.sm.sjztmd.service.ITbProjectService; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsParams; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsTable; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsTableProject; |
| | | import cn.gistack.sm.sjztmd.vo.TbProjectVO; |
| | | import io.swagger.annotations.Api; |
| | |
| | | package cn.gistack.sm.sjztmd.controller; |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.TbAttResBase; |
| | | import cn.gistack.sm.sjztmd.entity.TbFileStorageLocation; |
| | | import cn.gistack.sm.sjztmd.entity.TbResStagCapDisc; |
| | | import cn.gistack.sm.sjztmd.excel.TbResStagCapDiscImport; |
| | | import cn.gistack.sm.sjztmd.excel.TbResStagCapDiscImportExcel; |
| | | import cn.gistack.sm.sjztmd.service.ITbResStagCapDiscService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | |
| | | return R.status(tbResStagCapDiscService.auditByGuid(list)); |
| | | } |
| | | |
| | | /** |
| | | * 导入模板 |
| | | */ |
| | | @GetMapping("export-template") |
| | | @ApiOperation(value = "导入模板") |
| | | public void exportUser(HttpServletResponse response) { |
| | | List<TbResStagCapDiscImportExcel> list = new ArrayList<>(); |
| | | ExcelUtil.export(response, "水位库容导入模板", "水位库容数据表", list, TbResStagCapDiscImportExcel.class); |
| | | } |
| | | |
| | | /** |
| | | * 导入数据(返回数据给前端,由前端进行真正的保存) |
| | | */ |
| | | @PostMapping("import-tbResStagCapDisc") |
| | | @ApiOperation(value = "导入用户", notes = "传入excel") |
| | | public R importUser(MultipartFile file,String resGuid) { |
| | | |
| | | List<TbResStagCapDisc> list = tbResStagCapDiscService.readExcel(file); |
| | | |
| | | return R.data(list); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @TableField("\"is_show\"") |
| | | private String isShow; |
| | | |
| | | |
| | | //这个字段为SJZT_ODS."yg_rsvr_b"的字段 |
| | | @TableField("\"height_base_std_tp\"") |
| | | private String heightBaseStdTp; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.excel; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.write.style.ColumnWidth; |
| | | import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
| | | import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ColumnWidth(30) |
| | | @HeadRowHeight(25) |
| | | @ContentRowHeight(18) |
| | | public class AttResBaseUserExcel { |
| | | |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("水库名称") |
| | | private String name; |
| | | |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("市") |
| | | private String cityName; |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("区县") |
| | | private String countyName; |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("街道乡镇") |
| | | private String townName; |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("管理行政区") |
| | | private String adName; |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("工程规模") |
| | | private String engScal; |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("注册登记码") |
| | | private String resRegCode; |
| | | |
| | | @ExcelProperty({"行政责任人", "姓名"}) |
| | | private String areaUsername; |
| | | |
| | | @ExcelProperty({"行政责任人", "职务"}) |
| | | private String areaPosition; |
| | | |
| | | @ExcelProperty({"行政责任人", "所属单位"}) |
| | | private String areaUnitName; |
| | | |
| | | @ExcelProperty({"行政责任人", "联系电话"}) |
| | | private String areaPhone; |
| | | |
| | | |
| | | |
| | | @ExcelProperty({"主管部门责任人", "姓名"}) |
| | | private String customsUsername; |
| | | |
| | | @ExcelProperty({"主管部门责任人", "职务"}) |
| | | private String customsPosition; |
| | | |
| | | @ExcelProperty({"主管部门责任人", "所属单位"}) |
| | | private String customsUnitName; |
| | | |
| | | @ExcelProperty({"主管部门责任人", "联系电话"}) |
| | | private String customsPhone; |
| | | |
| | | |
| | | |
| | | @ExcelProperty({"管理单位责任人", "姓名"}) |
| | | private String manageUnitUsername; |
| | | |
| | | @ExcelProperty({"管理单位责任人", "职务"}) |
| | | private String manageUnitPosition; |
| | | |
| | | @ExcelProperty({"管理单位责任人", "所属单位"}) |
| | | private String manageUnitUnitName; |
| | | |
| | | @ExcelProperty({"管理单位责任人", "联系电话"}) |
| | | private String manageUnitPhone; |
| | | |
| | | |
| | | @ExcelProperty({"技术责任人", "姓名"}) |
| | | private String technologyUsername; |
| | | |
| | | @ExcelProperty({"技术责任人", "职务"}) |
| | | private String technologyPosition; |
| | | |
| | | @ExcelProperty({"技术责任人", "所属单位"}) |
| | | private String technologyUnitName; |
| | | |
| | | @ExcelProperty({"技术责任人", "联系电话"}) |
| | | private String technologyPhone; |
| | | |
| | | |
| | | @ExcelProperty({"巡查责任人", "姓名"}) |
| | | private String patrolUsername; |
| | | |
| | | @ExcelProperty({"巡查责任人", "职务"}) |
| | | private String patrolPosition; |
| | | |
| | | @ExcelProperty({"巡查责任人", "所属单位"}) |
| | | private String patrolUnitName; |
| | | |
| | | @ExcelProperty({"巡查责任人", "联系电话"}) |
| | | private String patrolPhone; |
| | | |
| | | |
| | | } |
| | |
| | | @ExcelProperty("地市") |
| | | private String cityName; |
| | | |
| | | @ExcelIgnore |
| | | @ExcelProperty("县市区") |
| | | private String countyName; |
| | | |
| | | @ExcelIgnore |
| | | @ExcelProperty("中央投资") |
| | | private Double centerFund; |
| | | |
| | | @ExcelIgnore |
| | | @ExcelProperty("地方投资") |
| | | private Double localFund; |
| | | |
| | | @ExcelIgnore |
| | | @ExcelProperty("填报年份") |
| | | private String tbYear; |
| | | |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.excel; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.write.style.ColumnWidth; |
| | | import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
| | | import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 水位库容曲线填报导入excel |
| | | */ |
| | | @Data |
| | | @ColumnWidth(25) |
| | | @HeadRowHeight(20) |
| | | @ContentRowHeight(18) |
| | | public class TbResStagCapDiscExportExcel implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ColumnWidth(20) |
| | | @ExcelProperty(value = "水位") |
| | | private double stag; |
| | | |
| | | |
| | | @ColumnWidth(20) |
| | | @ExcelProperty(value = "库容(万m³)") |
| | | private double area; |
| | | |
| | | @ColumnWidth(20) |
| | | @ExcelProperty(value = "库面面积(km²)") |
| | | private double cap; |
| | | |
| | | @ColumnWidth(20) |
| | | @ExcelProperty({"泄水建筑物泄量(m³/s)", "溢洪道(泄洪洞)"}) |
| | | private double spillway; |
| | | |
| | | @ColumnWidth(20) |
| | | @ExcelProperty({"泄水建筑物泄量(m³/s)", "非常溢洪道"}) |
| | | private double emergencySpillway; |
| | | |
| | | @ColumnWidth(20) |
| | | @ExcelProperty({"泄水建筑物泄量(m³/s)", "总泄量"}) |
| | | private double totalDischarge; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.excel; |
| | | |
| | | import cn.gistack.sm.sjztmd.service.ITbRelResUserService; |
| | | import cn.gistack.sm.sjztmd.service.ITbResStagCapDiscService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springblade.core.excel.support.ExcelImporter; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @PROJECT_NAME: skjcmanager |
| | | * @DESCRIPTION: 导入水库责任人数据 |
| | | * @USER: aix |
| | | * @DATE: 2023/10/26 10:27 |
| | | */ |
| | | @RequiredArgsConstructor |
| | | public class TbResStagCapDiscImport implements ExcelImporter<TbResStagCapDiscImportExcel> { |
| | | |
| | | private final ITbResStagCapDiscService tbResStagCapDiscService; |
| | | |
| | | private final String resGuid; |
| | | |
| | | @Override |
| | | public void save(List<TbResStagCapDiscImportExcel> data) { |
| | | tbResStagCapDiscService.importTbResStagCapDisc(data,resGuid); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.excel; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.write.style.ColumnWidth; |
| | | import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
| | | import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 水位库容曲线填报导入excel |
| | | */ |
| | | @Data |
| | | @ColumnWidth(25) |
| | | @HeadRowHeight(20) |
| | | @ContentRowHeight(18) |
| | | public class TbResStagCapDiscImportExcel implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ColumnWidth(20) |
| | | @ExcelProperty(value = "水位(m)") |
| | | private double stag; |
| | | |
| | | |
| | | @ColumnWidth(20) |
| | | @ExcelProperty(value = "库容(万m³)") |
| | | private double area; |
| | | |
| | | @ColumnWidth(20) |
| | | @ExcelProperty(value = "库面面积(km²)") |
| | | private double cap; |
| | | |
| | | @ColumnWidth(20) |
| | | @ExcelProperty({"泄水建筑物泄量(m³/s)", "溢洪道(泄洪洞)"}) |
| | | private double spillway; |
| | | |
| | | @ColumnWidth(20) |
| | | @ExcelProperty({"泄水建筑物泄量(m³/s)", "非常溢洪道"}) |
| | | private double emergencySpillway; |
| | | } |
| | |
| | | return R.data(null); |
| | | } |
| | | |
| | | @Override |
| | | public R getYwxtAdBaseById(String guid) { |
| | | AttAdBase attAdBase = new AttAdBase(); |
| | | attAdBase.setGuid(guid); |
| | | List<AttAdBase> attAdBases = adBaseService.getYwxtAdList(guid); |
| | | if (attAdBases.size() > 0) |
| | | return R.data(attAdBases.get(0)); |
| | | |
| | | return R.data(null); |
| | | } |
| | | |
| | | /** |
| | | * 查询责任人相关信息 |
| | | * @param guid |
| | |
| | | String getAdGradByAdCode(@Param("adCode") String adCode); |
| | | |
| | | |
| | | AttAdBase getYwxtAdDetail(@Param("adCode") String adCode); |
| | | |
| | | List<AttAdBase> getYwxtAdList(@Param("adCode") String guid); |
| | | |
| | | List<AttAdBase> getYwxtAttAdBaseList(@Param("parentId") String parentId); |
| | | |
| | | List<AttAdBase> getZtAttAdBaseList(@Param("parentId") String parentId); |
| | | } |
| | |
| | | <select id="getAdGradByAdCode" resultType="java.lang.String"> |
| | | select "ad_grad" from SJZT_MD."att_ad_base" where "guid" = #{adCode} |
| | | </select> |
| | | |
| | | <select id="getYwxtAdDetail" resultType="cn.gistack.sm.sjztmd.entity.AttAdBase"> |
| | | select * from ywxt."att_ad_base" where "guid" = #{adCode} |
| | | </select> |
| | | <select id="getYwxtAdList" resultType="cn.gistack.sm.sjztmd.entity.AttAdBase"> |
| | | SELECT * FROM YWXT."att_ad_base" WHERE "ad_code" = #{adCode} |
| | | </select> |
| | | <select id="getZtAttAdBaseList" resultType="cn.gistack.sm.sjztmd.entity.AttAdBase"> |
| | | SELECT * FROM SJZT_MD."att_ad_base" where "p_ad_code" = #{parentId} |
| | | </select> |
| | | <select id="getYwxtAttAdBaseList" resultType="cn.gistack.sm.sjztmd.entity.AttAdBase"> |
| | | SELECT * FROM YWXT."att_ad_base" where "p_ad_code" = #{parentId} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | import cn.gistack.sm.sjztmd.dto.AttResBaseUserDTO; |
| | | import cn.gistack.sm.sjztmd.entity.AttAdBase; |
| | | import cn.gistack.sm.sjztmd.entity.AttResBase; |
| | | import cn.gistack.sm.sjztmd.excel.AttResBaseUserExcel; |
| | | import cn.gistack.sm.sjztmd.vo.AttResAdVO; |
| | | import cn.gistack.sm.sjztmd.vo.AttResBaseGeneralInvestigationVO; |
| | | import cn.gistack.sm.sjztmd.vo.AttResBaseVO; |
| | |
| | | |
| | | List<AttResBaseGeneralInvestigationVO> selectAttResBaseGeneralInvestigation(IPage<AttResBaseGeneralInvestigationVO> page, @Param("attResBase") AttResBaseGeneralInvestigationVO attResBase); |
| | | |
| | | List<AttResBase> getListByRegion(IPage<AttResBase> page,@Param("obj") Map<String, Object> obj); |
| | | List<AttResBaseVO> getListByRegion(IPage<AttResBaseVO> page,@Param("obj") Map<String, Object> obj); |
| | | |
| | | AttResBase getDetailByCode(@Param("code") String code); |
| | | |
| | |
| | | */ |
| | | List<AttResBaseUserDTO> getAttResBaseUserPage(IPage<AttResBaseUserDTO> page, |
| | | @Param("params") Map<String, Object> params); |
| | | |
| | | |
| | | List<AttResBaseUserExcel> getAttResBaseUserExcel(@Param("params") Map<String, Object> params); |
| | | |
| | | /** |
| | | * 查询各类型责任人 |
| | |
| | | AttResAdVO getResAd(@Param("resId") String resId); |
| | | |
| | | AttAdBase getYwxtResInfo(@Param("cityName") String cityName,@Param("countyName") String countyName); |
| | | |
| | | Boolean updateRsvr(@Param("attResBase") AttResBase attResBase); |
| | | |
| | | /** |
| | | * 获取操作记录 |
| | | * @param guid |
| | | * @return |
| | | */ |
| | | String getUpdateLog(@Param("resGuid") String guid); |
| | | |
| | | int updateRelResUpdateLoc(@Param("resGuid") String guid,@Param("updateLog") String updateLog); |
| | | } |
| | |
| | | |
| | | </select> |
| | | |
| | | <select id="getListByRegion" resultType="cn.gistack.sm.sjztmd.entity.AttResBase"> |
| | | SELECT arb."guid",arb."code",arb."name",arb."ad_guid",arb."eng_scal",arb."res_loc" FROM "att_res_base" arb |
| | | left join "att_ad_base" aab on aab."guid" = arb."interior_ad_guid" |
| | | left join "att_ad_base" aa on aab."p_ad_code" = aa."ad_code" |
| | | left join "att_ad_base" ab on aa."p_ad_code" = ab."ad_code" |
| | | left join "att_ad_base" ac on ab."p_ad_code" = ac."ad_code" |
| | | |
| | | <sql id="resBase"> |
| | | case when town."ad_grad" = 4 THEN town."ad_code" ELSE NULL END AS townCode, |
| | | case when town."ad_grad" = 4 THEN town."ad_name" ELSE NULL END AS townName, |
| | | case |
| | | when town."ad_grad" = 3 THEN town."ad_code" |
| | | when county."ad_grad" = 3 THEN county."ad_code" END AS countyCode, |
| | | case |
| | | when town."ad_grad" = 3 THEN town."ad_name" |
| | | when county."ad_grad" = 3 THEN county."ad_name" END AS countyName, |
| | | case |
| | | when town."ad_grad" = 2 THEN town."ad_code" |
| | | when county."ad_grad" = 2 THEN county."ad_code" |
| | | ELSE city."ad_code" END AS cityCode, |
| | | case |
| | | when town."ad_grad" = 2 THEN town."ad_name" |
| | | when county."ad_grad" = 2 THEN county."ad_name" |
| | | ELSE city."ad_name" END AS cityName, |
| | | case |
| | | when town."ad_grad" = 1 THEN town."ad_code" |
| | | when county."ad_grad" = 1 THEN county."ad_code" |
| | | when city."ad_grad" = 1 THEN city."ad_code" |
| | | ELSE province."ad_code" END AS provinceCode, |
| | | case |
| | | when town."ad_grad" = 1 THEN town."ad_name" |
| | | when county."ad_grad" = 1 THEN county."ad_name" |
| | | when city."ad_grad" = 1 THEN city."ad_name" |
| | | ELSE province."ad_name" END AS provinceName |
| | | </sql> |
| | | |
| | | <select id="getListByRegion" resultType="cn.gistack.sm.sjztmd.vo.AttResBaseVO"> |
| | | SELECT |
| | | arb."guid", |
| | | arb."code", |
| | | arb."name", |
| | | arb."ad_guid", |
| | | arb."eng_scal", |
| | | arb."res_loc" , |
| | | arb."res_reg_code", |
| | | <include refid="resBase"></include> |
| | | FROM "att_res_base" arb |
| | | left join "att_ad_base" town on town."guid" = arb."interior_ad_guid" |
| | | left join "att_ad_base" county on town."p_ad_code" = county."ad_code" |
| | | left join "att_ad_base" city on county."p_ad_code" = city."ad_code" |
| | | left join "att_ad_base" province on city."p_ad_code" = province."ad_code" |
| | | WHERE arb."is_deleted"=0 |
| | | <if test="obj.code != null and obj.code != '' "> |
| | | and (aab."ad_code" = #{obj.code} or aa."ad_code" = #{obj.code} or ab."ad_code" = #{obj.code} or ac."ad_code" |
| | | and (town."ad_code" = #{obj.code} or county."ad_code" = #{obj.code} or city."ad_code" = #{obj.code} or province."ad_code" |
| | | = #{obj.code}) |
| | | </if> |
| | | <if test="obj.name !=null and obj.name !=''"> |
| | |
| | | aab."ad_name" as adName, |
| | | 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 |
| | |
| | | and (aab."ad_code" = #{params.adCode} or aa."ad_code" = #{params.adCode} or ab."ad_code" = #{params.adCode} |
| | | or ac."ad_code" = #{params.adCode}) |
| | | </if> |
| | | |
| | | <if test="params.userName !=null and params.userName != ''"> |
| | | AND CONCAT(trmp1."user_name",trmp2."user_name",trmp3."user_name",trmp4."user_name",trmp5."user_name") LIKE CONCAT('%',#{params.userName},'%') |
| | | </if> |
| | | <if test="params.userPhone != null and params.userPhone !=''"> |
| | | AND CONCAT(trmp1."user_phone",trmp2."user_phone",trmp3."user_phone",trmp4."user_phone",trmp5."user_phone") LIKE CONCAT('%',#{params.userPhone},'%') |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | <!--查询各类型责任人--> |
| | |
| | | <if test="attResBase.label ==null or attResBase.label == ''"> |
| | | "label" = '', |
| | | </if> |
| | | "height_base_std_tp" = #{attResBase.heightBaseStdTp}, |
| | | "is_gate" = #{attResBase.isGate}, |
| | | "update_time" = #{attResBase.updateTime} |
| | | WHERE "guid" = #{attResBase.guid} |
| | | </update> |
| | | |
| | | |
| | | <update id="updateRsvr"> |
| | | UPDATE SJZT_ODS."yg_rsvr_b" SET |
| | | "tb_height_base_std_tp" = #{attResBase.tbHeightBaseStdTp} |
| | | WHERE "guid" = #{attResBase.guid} |
| | | </update> |
| | | |
| | |
| | | </foreach> |
| | | |
| | | </update> |
| | | <update id="updateRelResUpdateLoc"> |
| | | UPDATE SJZT_MD."rel_res_update_loc" |
| | | SET "update_by" = #{updateLog} |
| | | WHERE "res_code" = #{resGuid} |
| | | </update> |
| | | |
| | | |
| | | <!--根据水库名称、所在区域查询改水库的数量--> |
| | | <select id="getWaterCountByResNameAndCountyName" resultType="java.lang.Integer"> |
| | |
| | | arb."name" resName, |
| | | arb."guid" resGuid, |
| | | arb."interior_ad_guid", |
| | | arb."eng_scal" engScal, |
| | | arb."res_reg_code" resRegCode, |
| | | arb."center_long" resLon, |
| | | arb."center_lat" resLat, |
| | | case when town."ad_grad" = 4 THEN town."ad_code" ELSE NULL END AS townCode, |
| | | case when town."ad_grad" = 4 THEN town."ad_name" ELSE NULL END AS townName, |
| | | case when town."ad_grad" = 3 THEN town."ad_code" |
| | |
| | | aab."p_ad_name" = #{cityName} |
| | | and aab."ad_name" = #{countyName} |
| | | </select> |
| | | <select id="getAttResBaseUserExcel" resultType="cn.gistack.sm.sjztmd.excel.AttResBaseUserExcel"> |
| | | select |
| | | arb."guid", arb."name", arb."res_loc" as place, arb."res_reg_code" as resRegCode, arb."eng_scal" as engScal, |
| | | REGEXP_SUBSTR (arb."res_loc",'[^-]+',1,2) as cityName, |
| | | REGEXP_SUBSTR (arb."res_loc",'[^-]+',1,3) as countyName, |
| | | REGEXP_SUBSTR (arb."res_loc",'[^-]+',1,4) as townName, |
| | | aab."ad_name" as adName, |
| | | 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" = arb."interior_ad_guid" |
| | | left join "SJZT_MD"."att_ad_base" aa on aab."p_ad_code" = aa."ad_code" |
| | | left join "SJZT_MD"."att_ad_base" ab on aa."p_ad_code" = ab."ad_code" |
| | | left join "SJZT_MD"."att_ad_base" ac on ab."p_ad_code" = ac."ad_code" |
| | | left join ( |
| | | 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("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("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("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("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 |
| | | <if test="params.name !=null and params.name !=''"> |
| | | AND arb."name" LIKE CONCAT('%',#{params.name},'%') |
| | | </if> |
| | | <if test="params.resRegCode !=null and params.resRegCode !=''"> |
| | | AND arb."res_reg_code" LIKE CONCAT('%',#{params.resRegCode},'%') |
| | | </if> |
| | | <if test="params.engScal !=null and params.engScal !=''"> |
| | | AND arb."eng_scal" LIKE CONCAT('%',#{params.engScal},'%') |
| | | </if> |
| | | <if test="params.isWorkable==1"> |
| | | AND ( |
| | | ( |
| | | (arb."eng_scal" = '大(1)型' or arb."eng_scal" = '大(2)型' or arb."eng_scal" = '中型') |
| | | and |
| | | trmp1."user_unit" is not null and trmp2."user_unit" is not null and trmp3."user_unit" is not null |
| | | ) |
| | | or |
| | | ( |
| | | (arb."eng_scal" = '小(1)型' or arb."eng_scal" = '小(2)型') |
| | | and |
| | | trmp1."user_unit" is not null and trmp2."user_unit" is not null and trmp3."user_unit" is not null and |
| | | trmp4."user_unit" is not null and trmp5."user_unit" is not null |
| | | ) |
| | | ) |
| | | </if> |
| | | <if test="params.isWorkable==2"> |
| | | AND ( |
| | | (arb."eng_scal" = '大(1)型' or arb."eng_scal" = '大(2)型' or arb."eng_scal" = '中型') |
| | | and |
| | | (trmp1."user_unit" is null or trmp2."user_unit" is null or trmp3."user_unit" is null) |
| | | or |
| | | ( |
| | | (arb."eng_scal" = '小(1)型' or arb."eng_scal" = '小(2)型') |
| | | and |
| | | (trmp1."user_unit" is null or trmp2."user_unit" is null or trmp3."user_unit" is null or trmp4."user_unit" is |
| | | null or trmp5."user_unit" is null) |
| | | ) |
| | | ) |
| | | </if> |
| | | |
| | | <if test="params.adCode != null and params.adCode != '' "> |
| | | and (aab."ad_code" = #{params.adCode} or aa."ad_code" = #{params.adCode} or ab."ad_code" = #{params.adCode} |
| | | or ac."ad_code" = #{params.adCode}) |
| | | </if> |
| | | |
| | | <if test="params.userName !=null and params.userName != ''"> |
| | | AND CONCAT(trmp1."user_name",trmp2."user_name",trmp3."user_name",trmp4."user_name",trmp5."user_name") LIKE CONCAT('%',#{params.userName},'%') |
| | | </if> |
| | | <if test="params.userPhone != null and params.userPhone !=''"> |
| | | AND CONCAT(trmp1."user_phone",trmp2."user_phone",trmp3."user_phone",trmp4."user_phone",trmp5."user_phone") LIKE CONCAT('%',#{params.userPhone},'%') |
| | | </if> |
| | | </select> |
| | | <select id="getUpdateLog" resultType="java.lang.String"> |
| | | SELECT "update_by" FROM SJZT_MD."rel_res_update_loc" WHERE "res_code" = #{resGuid} |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | @DS("zt") |
| | | @InterceptorIgnore(tenantLine = "true") |
| | | Boolean getFinalCheckStateCheckLoadingByGuid(@Param("guid") String resGuid); |
| | | |
| | | Integer initTbAttResBase(); |
| | | |
| | | Integer initTbAttResStagChar(); |
| | | |
| | | Integer initTbAttResWaterBlock(); |
| | | |
| | | Integer initTbAttResRsbNorspi(); |
| | | |
| | | Integer initTbAttResRsbSpillway(); |
| | | |
| | | Integer initTbAttResRsbVerspi(); |
| | | |
| | | Integer initTbAttResWaterDelivery(); |
| | | |
| | | Integer initTbAttResPowerStation(); |
| | | |
| | | Integer initTbAttResMgrSysB(); |
| | | |
| | | Integer initTbAttResSafetyMonitor(); |
| | | } |
| | |
| | | WHERE "guid" = #{tbAttResBase.guid} |
| | | </update> |
| | | |
| | | |
| | | <!--查询水库基础填报数据--> |
| | | <select id="getTbAttResBaseInfo" resultType="java.util.Map"> |
| | | SELECT 'tb_att_res_base' AS name,ifnull("check_state",-1) as value FROM "tb_att_res_base" WHERE "guid" = #{resGuid} |
| | |
| | | (SELECT if(ifnull(sum("check_state"),-1)>0,1,0) as value FROM "tb_file_storage_location" WHERE "res_guid" = #{guid} limit 1) |
| | | ) a |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <!--初始化水库基础信息--> |
| | | <update id="initTbAttResBase"> |
| | | UPDATE SJZT_MD."tb_att_res_base" tarb |
| | | JOIN SJZT_MD."att_res_base" arb on tarb."guid" = arb."guid" |
| | | JOIN SJZT_ODS."yg_rsvr_b" yrb on yrb."id" = tarb."guid" |
| | | JOIN ( |
| | | select |
| | | REPLACE( |
| | | REPLACE( |
| | | REPLACE( |
| | | REPLACE( |
| | | REPLACE( |
| | | REPLACE( |
| | | REPLACE( |
| | | REPLACE( |
| | | REPLACE( |
| | | REPLACE( |
| | | "res_func",'防洪','1' |
| | | ),'灌溉','2' |
| | | ),'供水','3' |
| | | ),'发电','4' |
| | | ),'航运','5' |
| | | ),'防凌','6' |
| | | ),'生态','7' |
| | | ),'旅游','8' |
| | | ),'养殖','9' |
| | | ),'其他','10' |
| | | ) "res_func","guid" |
| | | FROM SJZT_MD."att_res_base" |
| | | ) arbResFunc on arbResFunc."guid" = tarb."guid" |
| | | |
| | | join ( |
| | | SELECT |
| | | rrbl."res_guid", |
| | | abb."name" |
| | | FROM |
| | | SJZT_MD."rel_res_bas_loc" rrbl |
| | | LEFT JOIN SJZT_MD."att_bas_base" abb ON abb."code" = rrbl."bas_guid" |
| | | ) bas on bas."res_guid" = tarb."guid" |
| | | |
| | | SET |
| | | tarb."res_scal" = |
| | | case |
| | | when arb."eng_scal" = '大(1)型' THEN 1 |
| | | when arb."eng_scal" = '大(2)型' THEN 2 |
| | | when arb."eng_scal" = '中型' THEN 3 |
| | | when arb."eng_scal" = '小(1)型' THEN 4 |
| | | when arb."eng_scal" = '小(2)型' THEN 5 |
| | | END, |
| | | |
| | | tarb."build_address" = arb."res_loc", |
| | | tarb."eng_grad" = arb."eng_grad", |
| | | tarb."lgtd" = arb."center_long", |
| | | tarb."lttd" = arb."center_lat", |
| | | |
| | | tarb."elevation_system" = |
| | | case |
| | | when yrb."height_base_std_tp" = 1 THEN '56黄海高程' |
| | | when yrb."height_base_std_tp" = 2 THEN '85黄海高程' |
| | | when yrb."height_base_std_tp" = 3 THEN '吴淞高程' |
| | | when yrb."height_base_std_tp" = 4 THEN '珠江高程' |
| | | when yrb."height_base_std_tp" = 5 THEN '其他' |
| | | END, |
| | | |
| | | tarb."bas_code" = arb."bas_name", |
| | | tarb."river_sys_code" = |
| | | case |
| | | when arb."bas_guid" = '乌江水系' THEN '0035FE' |
| | | when arb."bas_guid" = '汉江水系' THEN '0035FG' |
| | | when arb."bas_guid" = '洞庭湖水系' THEN '0035FF' |
| | | when arb."bas_guid" = '淮河干流水系' THEN '0034EA' |
| | | when arb."bas_guid" = '长江干流水系' THEN '0035FA' |
| | | END, |
| | | tarb."com_control_bas" = bas."name", |
| | | tarb."res_func" = arbResFunc."res_func", |
| | | --工程始建时间,下闸蓄水时间没找到 |
| | | tarb."industry_dept" = |
| | | case |
| | | when arb."industry_dept" = '水利部门' THEN '1' |
| | | when arb."industry_dept" = '能源部门' THEN '2' |
| | | when arb."industry_dept" = '交通部门' THEN '3' |
| | | when arb."industry_dept" = '住建部门' THEN '4' |
| | | when arb."industry_dept" = '农业部门' THEN '5' |
| | | when arb."industry_dept" = '林业部门' THEN '6' |
| | | when arb."industry_dept" = '旅游部门' THEN '7' |
| | | when arb."industry_dept" = '司法部门' THEN '8' |
| | | when arb."industry_dept" = '国资委' THEN '9' |
| | | when arb."industry_dept" = '其他' THEN '10,' |
| | | END |
| | | WHERE tarb."final_state" = -1 |
| | | |
| | | |
| | | </update> |
| | | |
| | | |
| | | |
| | | <sql id="getAttResStagChar"> |
| | | SELECT |
| | | tarb."guid", |
| | | tarb."guid", |
| | | arsc."con_area", |
| | | NULL, |
| | | arsc."moyear_fl_age", |
| | | NULL, |
| | | arsc."tb_chec_fl_stag", |
| | | arsc."tb_des_fl_stag", |
| | | arsc."tb_flpr_high_stag", |
| | | arsc."tb_norm_pool_stag", |
| | | arsc."tb_dead_stag", |
| | | arsc."tb_tot_cap", |
| | | arsc."stor_fl_cap", |
| | | arsc."flco_cap", |
| | | arsc."ben_res_cap", |
| | | arsc."tb_dead_cap", |
| | | arsc."des_fl_flow_max", |
| | | arsc."chec_fl_flow_max", |
| | | null, |
| | | |
| | | arsc."des_fl_stand", |
| | | arsc."des_fl_flow", |
| | | NULL, |
| | | NULL, |
| | | NULL, |
| | | NULL, |
| | | NULL, |
| | | NULL, |
| | | |
| | | arsc."chec_fl_stand", |
| | | arsc."chec_fl_flow", |
| | | NULL, |
| | | NULL, |
| | | NULL, |
| | | NULL, |
| | | NULL, |
| | | NULL, |
| | | |
| | | beforeArfl."tb_flse_lim_stag", |
| | | NULL, |
| | | NULL, |
| | | |
| | | midArfl."tb_flse_lim_stag", |
| | | NULL, |
| | | NULL, |
| | | |
| | | afterArfl."tb_flse_lim_stag", |
| | | NULL, |
| | | NULL, |
| | | |
| | | '0' as "check_state", |
| | | NOW() as "create_time" |
| | | |
| | | |
| | | FROM |
| | | SJZT_MD."tb_att_res_base" tarb |
| | | LEFT JOIN SJZT_MD."att_res_stag_char" arsc on arsc."res_guid" = tarb."guid" |
| | | LEFT JOIN SJZT_MD."att_res_flse_lim" beforeArfl on beforeArfl."res_guid" = tarb."guid" and beforeArfl."flood_season_name" = '前汛期' |
| | | LEFT JOIN SJZT_MD."att_res_flse_lim" midArfl on midArfl."res_guid" = tarb."guid" and midArfl."flood_season_name" = '中汛期' |
| | | LEFT JOIN SJZT_MD."att_res_flse_lim" afterArfl on afterArfl."res_guid" = tarb."guid" and afterArfl."flood_season_name" = '后汛期' |
| | | WHERE tarb."final_state" = -1 |
| | | </sql> |
| | | |
| | | |
| | | |
| | | <insert id="initTbAttResStagChar"> |
| | | INSERT INTO SJZT_MD."tb_att_res_stag_char" |
| | | ( |
| | | "guid", |
| | | "res_guid", |
| | | "con_area", |
| | | "moyear_rain_avg", |
| | | "moyear_fl_avg", |
| | | "adjust_prop", |
| | | |
| | | "chec_fl_stag", |
| | | "des_fl_stag", |
| | | "fl_con_top_stag", |
| | | "cor_norm_stag", |
| | | "dead_stag", |
| | | |
| | | "total_cap", |
| | | "flpr_cap", |
| | | "fl_stor_cap", |
| | | "adjust_stor_cap", |
| | | "dead_cap", |
| | | |
| | | "des_flood_flow_max", |
| | | "chec_flood_flow_max", |
| | | "down_waco_safe_disc", |
| | | "des_fl_sta", |
| | | "des_fl_flow", |
| | | |
| | | "des_fl_1h_cap", |
| | | "des_fl_3h_cap", |
| | | "des_fl_6h_cap", |
| | | "des_fl_12h_cap", |
| | | "des_fl_1day_cap", |
| | | |
| | | "des_fl_3day_cap", |
| | | "chec_fl_sta", |
| | | "chec_fl_flow", |
| | | "chec_fl_1h_cap", |
| | | "chec_fl_3h_cap", |
| | | |
| | | "chec_fl_6h_cap", |
| | | "chec_fl_12h_cap", |
| | | "chec_fl_1day_cap", |
| | | "chec_fl_3day_cap", |
| | | "before_flood_stag", |
| | | |
| | | "before_flood_start", |
| | | "before_flood_end", |
| | | "mid_flood_stag", |
| | | "mid_flood_start", |
| | | "mid_flood_end", |
| | | |
| | | "after_flood_stag", |
| | | "after_flood_start", |
| | | "after_flood_end", |
| | | "check_state", |
| | | "create_time" |
| | | ) |
| | | <include refid="getAttResStagChar"></include> |
| | | |
| | | |
| | | |
| | | </insert> |
| | | |
| | | <sql id="getAttResWaterBlock"> |
| | | SELECT |
| | | arwb."dam_width", |
| | | '否', |
| | | NULL, |
| | | '其他', |
| | | '其他', |
| | | arwb."guid", |
| | | '', |
| | | CASE when arwb."sub_dam_num" = 0 THEN 1 ELSE arwb."sub_dam_num" +1 END, |
| | | arwb."res_guid", |
| | | case |
| | | when arwb."dam_type" = '常态混凝土实体重力坝' THEN 'DAA001' |
| | | when arwb."dam_type" = '常态混凝土宽缝重力坝' THEN 'DAA002' |
| | | when arwb."dam_type" = '常态混凝土空腹重力坝' THEN 'DAA003' |
| | | when arwb."dam_type" = '碾压混凝土重力坝' THEN 'DAA004' |
| | | when arwb."dam_type" = '混凝土重力坝' THEN 'DAA0' |
| | | |
| | | when arwb."dam_type" = '常态混凝土单曲拱坝' THEN 'DAB001' |
| | | when arwb."dam_type" = '常态混凝土双曲拱坝' THEN 'DAB002' |
| | | when arwb."dam_type" = '常态混凝土变曲拱坝' THEN 'DAB003' |
| | | when arwb."dam_type" = '碾压混凝土单曲拱坝' THEN 'DAB004' |
| | | when arwb."dam_type" = '碾压混凝土双曲拱坝' THEN 'DAB005' |
| | | when arwb."dam_type" = '碾压混凝土变曲拱坝' THEN 'DAB006' |
| | | when arwb."dam_type" = '混凝土拱坝' THEN 'DAB0' |
| | | |
| | | when arwb."dam_type" = '平板坝' THEN 'DAC001' |
| | | when arwb."dam_type" = '大头坝' THEN 'DAC002' |
| | | when arwb."dam_type" = '连拱坝' THEN 'DAC003' |
| | | when arwb."dam_type" = '混凝土支墩坝' THEN 'DAC0' |
| | | when arwb."dam_type" = '混凝土坝' THEN 'DA' |
| | | |
| | | when arwb."dam_type" = '均质土坝' THEN 'DBA001' |
| | | when arwb."dam_type" = '粘土心墙坝' THEN 'DBA002' |
| | | when arwb."dam_type" = '沥青心墙坝' THEN 'DBA003' |
| | | when arwb."dam_type" = '土工膜心墙坝' THEN 'DBA004' |
| | | when arwb."dam_type" = '混凝土心墙坝' THEN 'DBA005' |
| | | when arwb."dam_type" = '粘土斜墙坝' THEN 'DBA006' |
| | | when arwb."dam_type" = '沥青斜墙坝' THEN 'DBA007' |
| | | when arwb."dam_type" = '土工膜斜墙坝' THEN 'DBA008' |
| | | when arwb."dam_type" = '土石混合坝' THEN 'DBA009' |
| | | when arwb."dam_type" = '碾压式土石坝' THEN 'DBA0' |
| | | |
| | | when arwb."dam_type" = '面板堆石坝' THEN 'DBB0' |
| | | when arwb."dam_type" = '水力冲填坝' THEN 'DBC0' |
| | | when arwb."dam_type" = '定向爆破坝' THEN 'DBD0' |
| | | when arwb."dam_type" = '土石坝' THEN 'DB' |
| | | |
| | | when arwb."dam_type" = '砌石重力坝' THEN 'DCA0' |
| | | when arwb."dam_type" = '砌石拱坝' THEN 'DCB0' |
| | | when arwb."dam_type" = '砌石坝' THEN 'DC' |
| | | when arwb."dam_type" = '其他' THEN 'DD' |
| | | END, |
| | | '', |
| | | arwb."tb_dam_top_elevation", |
| | | arwb."dam_height", |
| | | arwb."dam_top_length", |
| | | '其他', |
| | | NULL, |
| | | '无', |
| | | arwb."dam_body_type", |
| | | arwb."sub_dam_num", |
| | | arwb."sub_dam_total_length", |
| | | arwb."sub_dam_max_height", |
| | | NULL, |
| | | '0' as "check_state", |
| | | NOW() as "create_time" |
| | | |
| | | FROM SJZT_MD."tb_att_res_base" tarb |
| | | LEFT JOIN SJZT_MD."att_res_water_block" arwb on arwb."res_guid" = tarb."guid" |
| | | WHERE tarb."final_state" = -1 and arwb."res_guid" is not null |
| | | </sql> |
| | | |
| | | |
| | | |
| | | <insert id="initTbAttResWaterBlock"> |
| | | INSERT INTO SJZT_MD."tb_att_res_water_block" |
| | | ( |
| | | "dam_width", |
| | | "is_traffic", |
| | | "wave_wall_top_elevation", |
| | | "up_dam_protect_type", |
| | | "down_dam_protect_type", |
| | | "guid", |
| | | |
| | | "name", |
| | | "num", |
| | | "res_guid", |
| | | "dam_type", |
| | | "dam_main_foundation", |
| | | |
| | | "dam_top_elevation", |
| | | "dam_height", |
| | | "dam_top_length", |
| | | "dam_main_body_type", |
| | | "dam_main_body_top_elevation", |
| | | |
| | | "dam_main_drain_type", |
| | | "dam_body_type", |
| | | "sub_dam_num", |
| | | "sub_dam_tot_length", |
| | | "sub_dam_max_height", |
| | | |
| | | "sub_dam_top_width", |
| | | "check_state", |
| | | "create_time" |
| | | ) |
| | | <include refid="getAttResWaterBlock"></include> |
| | | </insert> |
| | | |
| | | |
| | | |
| | | <sql id="getAttResRsbNorspi"> |
| | | SELECT |
| | | arrn."guid", |
| | | '', |
| | | 1, |
| | | arrn."res_guid", |
| | | arrn."spillway_type", |
| | | NULL, |
| | | NULL, |
| | | arrn."tb_weir_top_elevation", |
| | | arrn."weir_top_width", |
| | | arrn."working_gate_type", |
| | | NULL, |
| | | NULL, |
| | | NULL, |
| | | NULL, |
| | | arrn."oc_type", |
| | | NULL, |
| | | arrn."dis_energy_type", |
| | | '0' as "check_state", |
| | | NOW() as "create_time" |
| | | |
| | | FROM SJZT_MD."tb_att_res_base" tarb |
| | | LEFT JOIN SJZT_MD."att_res_rsb_norspi" arrn on arrn."res_guid" = tarb."guid" |
| | | WHERE tarb."final_state" = -1 and arrn."res_guid" is not null |
| | | </sql> |
| | | |
| | | |
| | | <insert id="initTbAttResRsbNorspi"> |
| | | INSERT INTO SJZT_MD."tb_att_res_rsb_norspi" |
| | | ( |
| | | "guid", |
| | | "name", |
| | | "num", |
| | | "res_guid", |
| | | "spillway_type", |
| | | "is_loc_dam_body", |
| | | |
| | | "is_gate", |
| | | "weir_top_elevation", |
| | | "weir_top_width", |
| | | "working_gate_type", |
| | | "gate_num", |
| | | |
| | | "gate_length", |
| | | "gate_wide", |
| | | "checking_flood_discharge", |
| | | "oc_type", |
| | | "oc_power", |
| | | |
| | | "dis_energy_type", |
| | | "check_state", |
| | | "create_time" |
| | | ) |
| | | <include refid="getAttResRsbNorspi"></include> |
| | | </insert> |
| | | |
| | | |
| | | |
| | | <sql id="getAttResRsbSpillway"> |
| | | SELECT |
| | | arrs."guid", |
| | | arrs."build_name", |
| | | numTmp.num, |
| | | arrs."res_guid", |
| | | case |
| | | when arrs."spillway_type" = '城门洞型' then '城门洞型' |
| | | when arrs."spillway_type" = '马蹄形' then '马蹄形' |
| | | when arrs."spillway_type" = '圆形' then '圆形' |
| | | when arrs."spillway_type" = '矩形' then '矩形' |
| | | else '其他,' |
| | | end, |
| | | NULL, |
| | | arrs."threshold_elevation", |
| | | NULL, |
| | | arrs."hole_num", |
| | | NULL, |
| | | NULL, |
| | | arrs."checking_flood_discharge", |
| | | arrs."working_gate_type", |
| | | arrs."oc_type", |
| | | NULL, |
| | | '0' as "check_state", |
| | | NOW() as "create_time" |
| | | FROM SJZT_MD."tb_att_res_base" tarb |
| | | LEFT JOIN SJZT_MD."att_res_rsb_spillway" arrs on arrs."res_guid" = tarb."guid" |
| | | |
| | | LEFT JOIN ( |
| | | SELECT COUNT(*) NUM ,"res_guid" FROM SJZT_MD."att_res_rsb_spillway" group by "res_guid" |
| | | )numTmp on numTmp."res_guid" = tarb."guid" |
| | | WHERE tarb."final_state" = -1 and arrs."res_guid" is not null |
| | | </sql> |
| | | |
| | | |
| | | <insert id="initTbAttResRsbSpillway"> |
| | | INSERT INTO SJZT_MD."tb_att_res_rsb_spillway" |
| | | ( |
| | | "guid", |
| | | "name", |
| | | "num", |
| | | "res_guid", |
| | | "spillway_type", |
| | | "cove_length", |
| | | |
| | | "threshold_elevation", |
| | | "export_elevation", |
| | | "section_num", |
| | | "section_length", |
| | | "section_wide", |
| | | |
| | | "check_fl_dis_charge", |
| | | "working_gate_type", |
| | | "oc_type", |
| | | "oc_power", |
| | | |
| | | "check_state", |
| | | "create_time" |
| | | ) |
| | | <include refid="getAttResRsbSpillway"></include> |
| | | </insert> |
| | | |
| | | |
| | | |
| | | <sql id="getTbAttResRsbVerspi"> |
| | | SELECT |
| | | basic."enable_standards", |
| | | basic."checking_flood_discharge", |
| | | basic."guid", |
| | | basic."build_name", |
| | | numTmp.num, |
| | | basic."res_guid", |
| | | basic."spillway_type", |
| | | basic."weir_top_elevation", |
| | | |
| | | '0' as "check_state", |
| | | NOW() as "create_time" |
| | | |
| | | |
| | | FROM SJZT_MD."tb_att_res_base" tarb |
| | | LEFT JOIN SJZT_MD."att_res_rsb_verspi" basic on basic."res_guid" = tarb."guid" |
| | | |
| | | LEFT JOIN ( |
| | | SELECT COUNT(*) NUM ,"res_guid" FROM SJZT_MD."att_res_rsb_verspi" group by "res_guid" |
| | | )numTmp on numTmp."res_guid" = tarb."guid" |
| | | WHERE tarb."final_state" = -1 and basic."res_guid" is not null |
| | | </sql> |
| | | |
| | | <insert id="initTbAttResRsbVerspi"> |
| | | INSERT INTO SJZT_MD."tb_att_res_rsb_verspi" |
| | | ( |
| | | "enable_standards", |
| | | "checking_flood_discharge", |
| | | "guid", |
| | | "name", |
| | | "num", |
| | | "res_guid", |
| | | "spillway_type", |
| | | "weir_top_width", |
| | | |
| | | "check_state", |
| | | "create_time" |
| | | ) |
| | | <include refid="getTbAttResRsbVerspi"></include> |
| | | |
| | | </insert> |
| | | |
| | | <sql id="getTbAttResWaterDelivery"> |
| | | SELECT |
| | | basic."guid", |
| | | '', |
| | | numTmp.num, |
| | | basic."res_guid", |
| | | CASE WHEN basic."aqueduct_type" != 9 then basic."aqueduct_type" else '9,' end, |
| | | |
| | | basic."aqueduct_length", |
| | | NULL, |
| | | NULL, |
| | | NULL, |
| | | NULL, |
| | | |
| | | basic."design_flow", |
| | | NULL, |
| | | NULL, |
| | | NULL, |
| | | NULL, |
| | | |
| | | '0' as "check_state", |
| | | NOW() as "create_time" |
| | | |
| | | |
| | | FROM SJZT_MD."tb_att_res_base" tarb |
| | | LEFT JOIN SJZT_MD."att_res_water_delivery" basic on basic."res_guid" = tarb."guid" |
| | | |
| | | LEFT JOIN ( |
| | | SELECT COUNT(*) NUM ,"res_guid" FROM SJZT_MD."att_res_water_delivery" group by "res_guid" |
| | | )numTmp on numTmp."res_guid" = tarb."guid" |
| | | WHERE tarb."final_state" = -1 and basic."res_guid" is not null |
| | | </sql> |
| | | |
| | | |
| | | |
| | | <insert id="initTbAttResWaterDelivery"> |
| | | |
| | | INSERT INTO SJZT_MD."tb_att_res_water_delivery" |
| | | ( |
| | | "guid", |
| | | "name", |
| | | "num", |
| | | "res_guid", |
| | | "aqueduct_type", |
| | | |
| | | "aqueduct_length", |
| | | "threshold_elevation", |
| | | "export_elevation", |
| | | "section_wide", |
| | | "section_high", |
| | | |
| | | "design_flow", |
| | | "working_gate_type", |
| | | "oc_type", |
| | | "oc_power", |
| | | "is_across_dam_body", |
| | | |
| | | "check_state", |
| | | "create_time" |
| | | ) |
| | | <include refid="getTbAttResWaterDelivery"></include> |
| | | |
| | | </insert> |
| | | |
| | | |
| | | <sql id="getTbAttResPowerStation"> |
| | | SELECT |
| | | basic."id", |
| | | '', |
| | | numTmp.num, |
| | | basic."rs_id", |
| | | basic."plant_layout_type", |
| | | |
| | | basic."installed_capacity", |
| | | NULL, |
| | | |
| | | |
| | | '0' as "check_state", |
| | | NOW() as "create_time" |
| | | |
| | | |
| | | FROM SJZT_MD."tb_att_res_base" tarb |
| | | LEFT JOIN SJZT_ODS."yg_rsvr_power_st" basic on basic."rs_id" = tarb."guid" |
| | | |
| | | LEFT JOIN ( |
| | | SELECT COUNT(*) NUM ,"rs_id" FROM SJZT_ODS."yg_rsvr_power_st" group by "rs_id" |
| | | )numTmp on numTmp."rs_id" = tarb."guid" |
| | | WHERE tarb."final_state" = -1 and basic."rs_id" is not null |
| | | </sql> |
| | | |
| | | |
| | | |
| | | <insert id="initTbAttResPowerStation"> |
| | | INSERT INTO SJZT_MD."tb_att_res_power_station" |
| | | ( |
| | | "guid", |
| | | "name", |
| | | "num", |
| | | "res_guid", |
| | | "plant_layout_type", |
| | | |
| | | "installed_capacity", |
| | | "year_avg_hour", |
| | | "check_state", |
| | | "create_time" |
| | | ) |
| | | <include refid="getTbAttResPowerStation"></include> |
| | | </insert> |
| | | |
| | | |
| | | <sql id="getTbAttResMgrSysB"> |
| | | SELECT |
| | | basic."guid", |
| | | basic."res_guid", |
| | | basic."m_unit_name", |
| | | basic."c_unit_name", |
| | | |
| | | CASE |
| | | WHEN basic."m_unit_nature" = 1 THEN '其他' |
| | | WHEN basic."m_unit_nature" = 2 THEN '企业' |
| | | WHEN basic."m_unit_nature" = 3 THEN '民间组织' |
| | | ELSE '其他' |
| | | END, |
| | | NULL, |
| | | NULL, |
| | | NULL, |
| | | '0' as "check_state", |
| | | NOW() as "create_time" |
| | | |
| | | FROM SJZT_MD."tb_att_res_base" tarb |
| | | LEFT JOIN SJZT_MD."att_res_mgr_sys_b" basic on basic."res_guid" = tarb."guid" |
| | | WHERE tarb."final_state" = -1 and basic."res_guid" is not null |
| | | </sql> |
| | | |
| | | <insert id="initTbAttResMgrSysB"> |
| | | INSERT INTO SJZT_MD."tb_att_res_mgr_sys_b" |
| | | ( |
| | | "guid", |
| | | "res_guid", |
| | | "m_unit_name", |
| | | "c_unit_name", |
| | | "m_unit_nature", |
| | | |
| | | "m_unit_person_number", |
| | | "person_economic_source", |
| | | "maintenance_economic_source", |
| | | "check_state", |
| | | "create_time" |
| | | ) |
| | | <include refid="getTbAttResMgrSysB"></include> |
| | | |
| | | |
| | | </insert> |
| | | <sql id="getTbAttResSafetyMonitor"> |
| | | SELECT |
| | | basic."guid", |
| | | basic."res_guid", |
| | | basic."latest_safety_appraisal_time", |
| | | basic."safety_appraisal_type", |
| | | basic."tb_control_z", |
| | | basic."exist_pblm", |
| | | '否', |
| | | basic."latest_reinforce_time", |
| | | NULL, |
| | | '0' as "check_state", |
| | | NOW() as "create_time" |
| | | FROM SJZT_MD."tb_att_res_base" tarb |
| | | LEFT JOIN SJZT_MD."att_res_danger_manage_special" basic on basic."res_guid" = tarb."guid" |
| | | WHERE tarb."final_state" = -1 and basic."res_guid" is not null |
| | | </sql> |
| | | |
| | | <insert id="initTbAttResSafetyMonitor"> |
| | | INSERT INTO SJZT_MD."tb_att_res_safety_monitor" |
| | | ( |
| | | "guid", |
| | | "res_guid", |
| | | "safety_appraisal_time", |
| | | "safety_appraisal_result", |
| | | "control_rz", |
| | | "survey_problem", |
| | | "is_reinforce", |
| | | "reinforce_tm", |
| | | "completion_time", |
| | | "check_state", |
| | | "create_time" |
| | | ) |
| | | <include refid="getTbAttResSafetyMonitor"></include> |
| | | </insert> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | |
| | | |
| | | <select id="getStatisticsBar" resultType="cn.gistack.sm.sjztmd.statisticsVO.StatisticsBar"> |
| | | SELECT |
| | | aab."guid" code, |
| | | aab."ad_name" name, |
| | | dyke.dykeTotalLength as dykeLength, |
| | | dangerDyke.dykeLength as termiteLength |
| | | FROM YWXT."att_ad_base" aab |
| | | LEFT JOIN ( |
| | | SELECT |
| | | aab."guid" adCode, |
| | | aab."ad_name" adName, |
| | | SUM(CASE WHEN dykeLengthInfo."dyke_length" THEN dykeLengthInfo."dyke_length" ELSE 0 END) dykeTotalLength |
| | | FROM YWXT."att_ad_base" aab |
| | | LEFT JOIN ( |
| | | SELECT |
| | | county."ad_code" countyCode, |
| | | city."ad_code" cityCode, |
| | | province."ad_code" provinceCode, |
| | | trd."dyke_length" |
| | | FROM SJZT_MD."tb_res_dyke" trd |
| | | LEFT JOIN ywxt."att_ad_base" county on county."ad_code" = trd."ad_code" |
| | | LEFT JOIN ywxt."att_ad_base" city on city."ad_code" = county."p_ad_code" |
| | | LEFT JOIN ywxt."att_ad_base" province on province."ad_code" = city."p_ad_code" |
| | | ) dykeLengthInfo on ((dykeLengthInfo.countyCode = aab."guid") or (dykeLengthInfo.cityCode = aab."guid") or (dykeLengthInfo.provinceCode = aab."guid")) |
| | | group by aab."guid",aab."ad_name" |
| | | )dyke on dyke.adCode = aab."guid" |
| | | |
| | | left join ( |
| | | SELECT |
| | | aab."guid", |
| | | aab."ad_name", |
| | | SUM(CASE WHEN trd."dyke_guid" is not null then trd.dangerLength else 0 END) as dykeLength |
| | | FROM YWXT."att_ad_base" aab |
| | | LEFT JOIN ( |
| | | SELECT |
| | | trd."guid", |
| | | trd."dyke_length", |
| | | trd."dyke_level", |
| | | trd."dyke_guid", |
| | | trd.dangerLength, |
| | | county."guid" as countyCode, |
| | | city."guid" as cityCode, |
| | | province."guid" as provinceCode |
| | | FROM ( |
| | | SELECT |
| | | tdis."guid", |
| | | tdis."dyke_guid", |
| | | trd."ad_code", |
| | | trd."dyke_level", |
| | | trd."dyke_length", |
| | | tdi.dangerLength |
| | | FROM SJZT_MD."tb_dyke_investigation_state" tdis |
| | | LEFT JOIN SJZT_MD."tb_res_dyke" trd on trd."guid" = tdis."dyke_guid" |
| | | LEFT JOIN ( |
| | | SELECT |
| | | TEMP1."tb_state_id", |
| | | TEMP1."unit", |
| | | TEMP1.dangerLength/temp1.num as dangerLength |
| | | FROM ( |
| | | SELECT |
| | | tdi."tb_state_id", |
| | | tdi."dyke_guid", |
| | | tdi."unit", |
| | | count(*) as num, |
| | | SUM(CASE WHEN (tdi."danger_length") THEN tdi."danger_length" ELSE 0 END) AS dangerLength |
| | | from sjzt_md."tb_dyke_investigation" tdi |
| | | where 1=1 |
| | | <if test="params.tbYear!=null and params.tbYear!=''"> |
| | | AND tdi."tb_year" = #{params.tbYear} |
| | | </if> |
| | | and tdi."investigation_variety" = '白蚁' |
| | | group by tdi."tb_state_id",tdi."dyke_guid",tdi."unit" |
| | | )TEMP1 |
| | | ) tdi on tdi."tb_state_id" = tdis."guid" |
| | | where (tdis."check_state" = 1 or tdis."check_state" = 2) |
| | | ) trd |
| | | LEFT JOIN YWXT."att_ad_base" county ON county."ad_code" = trd."ad_code" |
| | | LEFT JOIN YWXT."att_ad_base" city ON city."ad_code" = county."p_ad_code" |
| | | LEFT JOIN YWXT."att_ad_base" province ON province."ad_code" = city."p_ad_code" |
| | | )trd on ((trd.countyCode = aab."guid") or (trd.cityCode = aab."guid") or (trd.provinceCode = aab."guid")) |
| | | group by aab."guid",aab."ad_name" |
| | | )dangerDyke on dangerDyke."guid" = aab."guid" |
| | | |
| | | where 1= 1 |
| | | <if test="params.adGrad !=3"> |
| | | <if test="params.adCode != null and params.adCode !=''"> |
| | | AND aab."p_ad_code" = #{params.adCode} |
| | | </if> |
| | | </if> |
| | | <if test="params.adGrad ==3"> |
| | | <if test="params.adCode != null and params.adCode !=''"> |
| | | AND aab."ad_code" = #{params.adCode} |
| | | </if> |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | from sjzt_md."tb_dyke_investigation" tdi |
| | | where 1=1 |
| | | |
| | | AND <if test="params.tbYear != null and params.tbYear != ''"> |
| | | tdi."tb_year" = #{params.tbYear} |
| | | |
| | | <if test="params.tbYear != null and params.tbYear != ''"> |
| | | AND tdi."tb_year" = #{params.tbYear} |
| | | </if> |
| | | group by tdi."tb_state_id",tdi."dyke_guid",tdi."unit" |
| | | )TEMP1 |
| | | ) tdi on tdi."tb_state_id" = tdis."guid" |
| | | <!--统计待审核和已审核的--> |
| | | where (tdis."check_state" = 1 or tdis."check_state" = 2) |
| | | ) trd |
| | | LEFT JOIN YWXT."att_ad_base" county ON county."ad_code" = trd."ad_code" |
| | | LEFT JOIN YWXT."att_ad_base" city ON city."ad_code" = county."p_ad_code" |
| | |
| | | where 1=1 |
| | | and (town."ad_code" = aab."guid" or county."ad_code" = aab."guid" or city."ad_code" = aab."guid" or province."ad_code" = aab."guid") |
| | | <if test="params.tbYear != null and params.tbYear !=''"> |
| | | and trgis."tb_year" = 2024 |
| | | and trgis."tb_year" = #{params.tbYear} |
| | | </if> |
| | | and trgis."check_state" = 1 |
| | | |
| | |
| | | where 1=1 |
| | | and (town."ad_code" = aab."guid" or county."ad_code" = aab."guid" or city."ad_code" = aab."guid" or province."ad_code" = aab."guid") |
| | | <if test="params.tbYear != null and params.tbYear !=''"> |
| | | and trgis."tb_year" = 2024 |
| | | and trgis."tb_year" = #{params.tbYear} |
| | | </if> |
| | | |
| | | and trgis."check_state" = 2 |
| | |
| | | and tdis."tb_year" = #{params.tbYear} |
| | | </if> |
| | | and tdis."check_state" = 2 |
| | | )checkDykeNum |
| | | )checkDykeNum, |
| | | |
| | | |
| | | IFNULL( |
| | | ( |
| | | SELECT |
| | | SUM(CASE WHEN trd."dyke_length" THEN trd."dyke_length" ELSE 0 END) |
| | | FROM SJZT_MD."tb_res_dyke" trd |
| | | LEFT JOIN ywxt."att_ad_base" county on county."ad_code" = trd."ad_code" |
| | | LEFT JOIN ywxt."att_ad_base" city on city."ad_code" = county."p_ad_code" |
| | | LEFT JOIN ywxt."att_ad_base" province on province."ad_code" = city."p_ad_code" |
| | | where (county."ad_code" = aab."guid" or city."ad_code" = aab."guid" or province."ad_code" = aab."guid") |
| | | ),0) AS dykeTotalLength, |
| | | |
| | | |
| | | IFNULL(( |
| | | SELECT |
| | | SUM(CASE WHEN trd.dangerLength THEN trd.dangerLength ELSE 0 END) |
| | | FROM ( |
| | | SELECT |
| | | tdis."guid", |
| | | tdis."dyke_guid", |
| | | trd."ad_code", |
| | | trd."dyke_level", |
| | | trd."dyke_length", |
| | | tdi.dangerLength |
| | | FROM SJZT_MD."tb_dyke_investigation_state" tdis |
| | | LEFT JOIN SJZT_MD."tb_res_dyke" trd on trd."guid" = tdis."dyke_guid" |
| | | LEFT JOIN ( |
| | | SELECT |
| | | TEMP1."tb_state_id", |
| | | TEMP1."unit", |
| | | TEMP1.dangerLength/temp1.num as dangerLength |
| | | FROM ( |
| | | SELECT |
| | | tdi."tb_state_id", |
| | | tdi."dyke_guid", |
| | | tdi."unit", |
| | | count(*) as num, |
| | | SUM(CASE WHEN (tdi."danger_length") THEN tdi."danger_length" ELSE 0 END) AS dangerLength |
| | | from sjzt_md."tb_dyke_investigation" tdi |
| | | where 1=1 |
| | | <if test="params.tbYear != null and params.tbYear != ''"> |
| | | AND tdi."tb_year" = #{params.tbYear} |
| | | </if> |
| | | |
| | | group by tdi."tb_state_id",tdi."dyke_guid",tdi."unit" |
| | | )TEMP1 |
| | | ) tdi on tdi."tb_state_id" = tdis."guid" |
| | | where (tdis."check_state" = 1 or tdis."check_state" = 2) |
| | | ) trd |
| | | LEFT JOIN YWXT."att_ad_base" county ON county."ad_code" = trd."ad_code" |
| | | LEFT JOIN YWXT."att_ad_base" city ON city."ad_code" = county."p_ad_code" |
| | | LEFT JOIN YWXT."att_ad_base" province ON province."ad_code" = city."p_ad_code" |
| | | where (county."ad_code" = aab."guid" or city."ad_code" = aab."guid" or province."ad_code" = aab."guid") |
| | | ),0) AS dangerTotalLength |
| | | |
| | | |
| | | |
| | | FROM YWXT."att_ad_base" aab |
| | | LEFT JOIN YWXT."att_ad_base" paab ON paab."guid" = aab."p_ad_code" |
| | | where |
| | |
| | | aab."p_ad_code" = #{params.adCode} |
| | | </if> |
| | | order by aab."guid" |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | </select> |
| | | |
| | | |
| | |
| | | AttAdBaseVO getDetail(AttAdBase attAdBase); |
| | | |
| | | String getAdGradByAdCode(String adCode); |
| | | |
| | | AttAdBase getYwxtAdDetail(String adCode); |
| | | |
| | | List<AttAdBase> getYwxtAdList(String guid); |
| | | |
| | | List<AttAdBase> getYwxtAttadBaseList(String parentId,String isYwxtRegion); |
| | | } |
| | |
| | | import cn.gistack.sm.sjztmd.dto.AttResBaseUserDTO; |
| | | import cn.gistack.sm.sjztmd.entity.AttAdBase; |
| | | import cn.gistack.sm.sjztmd.entity.AttResBase; |
| | | import cn.gistack.sm.sjztmd.excel.AttResBaseUserExcel; |
| | | import cn.gistack.sm.sjztmd.vo.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | |
| | | |
| | | Object selectAttResBaseGeneralInvestigation(IPage<AttResBaseGeneralInvestigationVO> page, AttResBaseGeneralInvestigationVO attResBase); |
| | | |
| | | IPage<AttResBase> getListByRegion(IPage<AttResBase> page,Map<String, Object> obj); |
| | | IPage<AttResBaseVO> getListByRegion(IPage<AttResBaseVO> page,Map<String, Object> obj); |
| | | |
| | | AttResBase getDetailByCode(String code); |
| | | |
| | |
| | | AttResAdVO getResAd(String resId); |
| | | |
| | | AttAdBase getYwxtResInfo(String cityName, String countyName); |
| | | |
| | | List<AttResBaseUserExcel> exportAttResBaseUser(Map<String, Object> params); |
| | | } |
| | |
| | | * @param state 状态值 |
| | | */ |
| | | Boolean updateFinalState(String resGuid, int state); |
| | | |
| | | String initTbData(); |
| | | } |
| | |
| | | import cn.gistack.sm.sjztmd.entity.TbAttResRsbVerspi; |
| | | import cn.gistack.sm.sjztmd.entity.TbRelResUser; |
| | | import cn.gistack.sm.sjztmd.entity.TbResStagCapDisc; |
| | | import cn.gistack.sm.sjztmd.excel.TbRelResUserExcel; |
| | | import cn.gistack.sm.sjztmd.excel.TbResStagCapDiscImportExcel; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | Boolean auditByGuid(List<TbResStagCapDisc> list); |
| | | |
| | | List<TbResStagCapDisc> getDetailByResGuid(String ResGuid); |
| | | |
| | | void importTbResStagCapDisc(List<TbResStagCapDiscImportExcel> data,String resGuid); |
| | | |
| | | List<TbResStagCapDisc> readExcel(MultipartFile file); |
| | | } |
| | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.core.tool.utils.ObjectUtil; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Comparator; |
| | |
| | | return baseMapper.getAdGradByAdCode(adCode); |
| | | } |
| | | |
| | | @Override |
| | | public AttAdBase getYwxtAdDetail(String adCode) { |
| | | return baseMapper.getYwxtAdDetail(adCode); |
| | | } |
| | | |
| | | @Override |
| | | public List<AttAdBase> getYwxtAdList(String guid) { |
| | | return baseMapper.getYwxtAdList(guid); |
| | | } |
| | | |
| | | @Override |
| | | public List<AttAdBase> getYwxtAttadBaseList(String parentId,String isYwxtRegion) { |
| | | if (StringUtil.isNotBlank(isYwxtRegion)){ |
| | | return baseMapper.getYwxtAttAdBaseList(parentId); |
| | | }else { |
| | | return baseMapper.getZtAttAdBaseList(parentId); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public boolean save(AttAdBase entity) { |
| | |
| | | import cn.gistack.sm.sjztmd.entity.AttAdBase; |
| | | import cn.gistack.sm.sjztmd.entity.AttResBase; |
| | | import cn.gistack.sm.sjztmd.entity.RelResLabel; |
| | | import cn.gistack.sm.sjztmd.excel.AttResBaseUserExcel; |
| | | import cn.gistack.sm.sjztmd.mapper.AttResBaseMapper; |
| | | import cn.gistack.sm.sjztmd.service.IAttResBaseService; |
| | | import cn.gistack.sm.sjztmd.service.IRelResLabelService; |
| | | import cn.gistack.sm.sjztmd.vo.*; |
| | | import cn.gistack.system.feign.ISysClient; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | 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; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @ClassName AttResBaseServiceImpl |
| | |
| | | @Autowired |
| | | private IRelResLabelService relResLabelService; |
| | | |
| | | @Autowired |
| | | private ISysClient sysClient; |
| | | |
| | | |
| | | @Override |
| | | public IPage<AttResBase> selectAttResBasePage(IPage<AttResBase> page, AttResBase attResBase) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public IPage<AttResBase> getListByRegion(IPage<AttResBase> page,Map<String, Object> obj) { |
| | | public IPage<AttResBaseVO> getListByRegion(IPage<AttResBaseVO> page,Map<String, Object> obj) { |
| | | return page.setRecords(baseMapper.getListByRegion(page,obj)); |
| | | } |
| | | |
| | |
| | | return page.setRecords(attResBaseUserDTOList); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<AttResBaseUserExcel> exportAttResBaseUser(Map<String, Object> params) { |
| | | |
| | | |
| | | List<AttResBaseUserExcel> attResBaseUserDTOList = baseMapper.getAttResBaseUserExcel(params); |
| | | return attResBaseUserDTOList; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean updateResBaseByGuid(AttResBase attResBase) { |
| | | attResBase.setUpdateTime(DateUtil.now()); |
| | | |
| | | String updateBy = baseMapper.getUpdateLog(attResBase.getGuid()); |
| | | if (StringUtil.isBlank(updateBy)){ |
| | | updateBy = ""; |
| | | } |
| | | BladeUser user = AuthUtil.getUser(); |
| | | //修改人基础信息 |
| | | String account = user.getAccount(); |
| | | String userName = user.getUserName(); |
| | | String nowTime = DateUtil.format(DateUtil.now(),DateUtil.PATTERN_DATETIME); |
| | | |
| | | String updateUser = StringUtil.format("[{}-{}-{}]",account,userName,nowTime); |
| | | |
| | | //修改的东西 |
| | | String interiorAdGuid = attResBase.getInteriorAdGuid(); |
| | | String label = attResBase.getLabel(); |
| | | String heightBaseStdTp = attResBase.getHeightBaseStdTp(); |
| | | String isGate = attResBase.getIsGate(); |
| | | |
| | | String updateLog = ""; |
| | | List<String> strList = new ArrayList<>(); |
| | | if (StringUtil.isNotBlank(interiorAdGuid)){ |
| | | strList.add("行政区划修改为"+ interiorAdGuid); |
| | | } |
| | | strList.add("标签修改为"+label); |
| | | strList.add("高程基准面修改为"+heightBaseStdTp); |
| | | strList.add("是否有闸修改为"+isGate); |
| | | |
| | | String updateContent = String.join("、",strList); |
| | | |
| | | updateLog = updateUser + updateContent + ";"; |
| | | updateBy = updateBy + updateLog; |
| | | //向水库标签表中更新数据 |
| | | relResLabelService.updateEntity(attResBase.getGuid(),attResBase.getLabel()); |
| | | |
| | | //更新机构表中的水库位置 |
| | | sysClient.updateDeptByTb(interiorAdGuid,attResBase.getGuid()); |
| | | |
| | | //向操作记录表中增加记录 |
| | | baseMapper.updateRelResUpdateLoc(attResBase.getGuid(),updateBy); |
| | | return baseMapper.updateResBaseByGuid(attResBase); |
| | | } |
| | | |
| | |
| | | public AttAdBase getYwxtResInfo(String cityName, String countyName) { |
| | | return baseMapper.getYwxtResInfo(cityName,countyName); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | //更新 |
| | | return updateById(tbAttResBase); |
| | | } |
| | | |
| | | @Override |
| | | public String initTbData() { |
| | | //初始化基础信心 |
| | | Integer tbAttresBase = initTbAttResBase(); |
| | | |
| | | //初始化水文特征 |
| | | Integer tbAttResStagChar = initTbAttResStagChar(); |
| | | |
| | | //初始化挡水建筑物 |
| | | Integer tbAttResWaterBlock= initTbAttResWaterBlock(); |
| | | |
| | | //初始化正常溢洪道 |
| | | Integer tbAttResRsbNorspi= initTbAttResRsbNorspi(); |
| | | |
| | | //初始化泄洪洞 |
| | | Integer tbAttResRsbSpillway= initTbAttResRsbSpillway(); |
| | | |
| | | //初始化非常溢洪道 |
| | | Integer tbAttResRsbVerspi=initTbAttResRsbVerspi(); |
| | | |
| | | //初始化输水建筑物 |
| | | Integer tbAttResWaterDelivery=initTbAttResWaterDelivery(); |
| | | |
| | | //初始化电站 |
| | | Integer tbAttResPowerStation=initTbAttResPowerStation(); |
| | | |
| | | //初始化管理体制 |
| | | Integer tbAttResMgrSysB=initTbAttResMgrSysB(); |
| | | |
| | | //初始化除险加固 |
| | | Integer tbAttResSafetyMonitor=initTbAttResSafetyMonitor(); |
| | | |
| | | String message = StringUtil.format( |
| | | "基础信息更新数量为{}," + |
| | | "水文特征更新数量为{}," + |
| | | "挡水建筑物更新数量为{}," + |
| | | "正常溢洪道更新数量为{}," + |
| | | "泄洪洞更新数量为{}," + |
| | | "非常溢洪道更新数量为{}," + |
| | | "输水建筑物更新数量为{}," + |
| | | "电站更新数量为{}," + |
| | | "管理体制更新数量为{}," + |
| | | "除险加固更新数量为{}",tbAttresBase,tbAttResStagChar,tbAttResWaterBlock,tbAttResRsbNorspi,tbAttResRsbSpillway,tbAttResRsbVerspi,tbAttResWaterDelivery,tbAttResPowerStation,tbAttResMgrSysB,tbAttResSafetyMonitor |
| | | ); |
| | | |
| | | return message; |
| | | } |
| | | |
| | | private Integer initTbAttResSafetyMonitor() { |
| | | return baseMapper.initTbAttResSafetyMonitor(); |
| | | } |
| | | |
| | | private Integer initTbAttResMgrSysB() { |
| | | return baseMapper.initTbAttResMgrSysB(); |
| | | } |
| | | |
| | | private Integer initTbAttResPowerStation() { |
| | | return baseMapper.initTbAttResPowerStation(); |
| | | } |
| | | |
| | | private Integer initTbAttResWaterDelivery() { |
| | | return baseMapper.initTbAttResWaterDelivery(); |
| | | } |
| | | |
| | | private Integer initTbAttResRsbVerspi() { |
| | | return baseMapper.initTbAttResRsbVerspi(); |
| | | } |
| | | |
| | | private Integer initTbAttResRsbSpillway() { |
| | | return baseMapper.initTbAttResRsbSpillway(); |
| | | } |
| | | |
| | | private Integer initTbAttResRsbNorspi() { |
| | | return baseMapper.initTbAttResRsbNorspi(); |
| | | } |
| | | |
| | | private Integer initTbAttResWaterBlock() { |
| | | return baseMapper.initTbAttResWaterBlock(); |
| | | } |
| | | |
| | | /** |
| | | * 初始化填报水文特征表 |
| | | */ |
| | | private Integer initTbAttResStagChar() { |
| | | return baseMapper.initTbAttResStagChar(); |
| | | } |
| | | |
| | | /** |
| | | * 初始化水库基础信息填报表 |
| | | */ |
| | | private Integer initTbAttResBase() { |
| | | Integer i = baseMapper.initTbAttResBase(); |
| | | return i; |
| | | } |
| | | } |
| | |
| | | package cn.gistack.sm.sjztmd.service.impl; |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.TbDykeInvestigation; |
| | | import cn.gistack.sm.sjztmd.entity.TbDykeInvestigationState; |
| | | import cn.gistack.sm.sjztmd.entity.TbResGeneralInvestigation; |
| | | import cn.gistack.sm.sjztmd.entity.TbResGeneralInvestigationState; |
| | | import cn.gistack.sm.sjztmd.entity.*; |
| | | import cn.gistack.sm.sjztmd.mapper.TbDykeInvestigationMapper; |
| | | import cn.gistack.sm.sjztmd.mapper.TbResGeneralInvestigationMapper; |
| | | import cn.gistack.sm.sjztmd.service.*; |
| | |
| | | |
| | | @Autowired |
| | | private ITbDykeInvestigationStateService tbDykeInvestigationStateService; |
| | | |
| | | @Autowired |
| | | private IAttAdBaseService attAdBaseService; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | |
| | | @Override |
| | | public List<StatisticsBar> statisticsBar(StatisticsParams statisticsParams) { |
| | | String adCode = statisticsParams.getAdCode(); |
| | | String adGuid = ""; |
| | | //默认省 |
| | | String adGrad = "1"; |
| | | // String adCode = statisticsParams.getAdCode(); |
| | | // String adGuid = ""; |
| | | // //默认省 |
| | | // String adGrad = "1"; |
| | | // |
| | | // //若行政区划不为空 |
| | | // if (StringUtil.isNotBlank(adCode)){ |
| | | // if (adCode.substring(0,4).indexOf("00") > -1) { |
| | | // //前四位包含00说明是湖北省 4200/00000000 |
| | | // adGrad = "1"; |
| | | // adGuid =StringUtil.format("%{}%",adCode.substring(0,2)); |
| | | // statisticsParams.setAdGuid(adGuid); |
| | | // } else if (adCode.substring(0,6).indexOf("00") > -1) { |
| | | // //前六位包含00说明是市级 420100/000000 |
| | | // adGrad = "2"; |
| | | // adGuid =StringUtil.format("%{}%",adCode.substring(0,4)); |
| | | // statisticsParams.setAdGuid(adGuid); |
| | | // }else if (adCode.substring(0,8).indexOf("00") > -1){ |
| | | // //前8位包含00 说明是区级 42011700/0000 |
| | | // adGrad = "3"; |
| | | // } |
| | | // } |
| | | // |
| | | // List<StatisticsBar> list = new ArrayList<>(); |
| | | // |
| | | // if (adGrad.equals("3")){ |
| | | // //区级展示自己 |
| | | // list = baseMapper.getCountyStatisticsBar(statisticsParams); |
| | | // }else if (adGrad.equals("2")){ |
| | | // //市级展示区 |
| | | // list = baseMapper.getCityStatisticsBar(statisticsParams); |
| | | // }else if (adGrad.equals("1")){ |
| | | // //省级展示市 |
| | | // list = baseMapper.getProvinceStatisticsBar(statisticsParams); |
| | | // } |
| | | |
| | | //若行政区划不为空 |
| | | if (StringUtil.isNotBlank(adCode)){ |
| | | if (adCode.substring(0,4).indexOf("00") > -1) { |
| | | //前四位包含00说明是湖北省 4200/00000000 |
| | | adGrad = "1"; |
| | | adGuid =StringUtil.format("%{}%",adCode.substring(0,2)); |
| | | statisticsParams.setAdGuid(adGuid); |
| | | } else if (adCode.substring(0,6).indexOf("00") > -1) { |
| | | //前六位包含00说明是市级 420100/000000 |
| | | adGrad = "2"; |
| | | adGuid =StringUtil.format("%{}%",adCode.substring(0,4)); |
| | | statisticsParams.setAdGuid(adGuid); |
| | | }else if (adCode.substring(0,8).indexOf("00") > -1){ |
| | | //前8位包含00 说明是区级 42011700/0000 |
| | | adGrad = "3"; |
| | | } |
| | | } |
| | | List<StatisticsBar> list = new ArrayList<>(); |
| | | |
| | | if (adGrad.equals("3")){ |
| | | //区级展示自己 |
| | | list = baseMapper.getCountyStatisticsBar(statisticsParams); |
| | | }else if (adGrad.equals("2")){ |
| | | //市级展示区 |
| | | list = baseMapper.getCityStatisticsBar(statisticsParams); |
| | | }else if (adGrad.equals("1")){ |
| | | //省级展示市 |
| | | list = baseMapper.getProvinceStatisticsBar(statisticsParams); |
| | | } |
| | | |
| | | AttAdBase attAdBase = attAdBaseService.getYwxtAdDetail(statisticsParams.getAdCode()); |
| | | statisticsParams.setAdGrad(attAdBase.getAdGrad()); |
| | | List list = baseMapper.getStatisticsBar(statisticsParams); |
| | | return list; |
| | | } |
| | | |
| | |
| | | import cn.gistack.sm.sjztmd.service.ITbProjectScheduleService; |
| | | import cn.gistack.sm.sjztmd.service.ITbProjectService; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsParams; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsTable; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsTableProject; |
| | | import cn.gistack.sm.sjztmd.util.CalculateUtils; |
| | | import cn.gistack.sm.sjztmd.vo.TbProjectVO; |
| | |
| | | import cn.gistack.sm.sjztmd.entity.TbFileStorageLocation; |
| | | import cn.gistack.sm.sjztmd.entity.TbRelResUser; |
| | | import cn.gistack.sm.sjztmd.entity.TbResStagCapDisc; |
| | | import cn.gistack.sm.sjztmd.excel.TbRelResUserExcel; |
| | | import cn.gistack.sm.sjztmd.excel.TbResStagCapDiscImportExcel; |
| | | import cn.gistack.sm.sjztmd.mapper.TbRelResUserMapper; |
| | | import cn.gistack.sm.sjztmd.mapper.TbResStagCapDiscMapper; |
| | | import cn.gistack.sm.sjztmd.service.ITbAttResBaseService; |
| | | import cn.gistack.sm.sjztmd.service.ITbResStagCapDiscService; |
| | | import cn.gistack.sm.sjztmd.util.CalculateUtils; |
| | | import cn.gistack.system.user.feign.IUserClient; |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.ObjectUtil; |
| | | 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; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.InputStream; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void importTbResStagCapDisc(List<TbResStagCapDiscImportExcel> data,String resGuid) { |
| | | |
| | | for (int i = 0; i < data.size(); i++) { |
| | | TbResStagCapDiscImportExcel excel = data.get(0); |
| | | TbResStagCapDisc tbResStagCapDisc = Objects.requireNonNull(BeanUtil.copy(excel, TbResStagCapDisc.class)); |
| | | tbResStagCapDisc.setResGuid(resGuid); |
| | | double order = (double) i + 1; |
| | | tbResStagCapDisc.setOrderId(order); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public List<TbResStagCapDisc> readExcel(MultipartFile file) { |
| | | List<TbResStagCapDiscImportExcel> excelList = new ArrayList<>(); |
| | | try (InputStream inputStream = file.getInputStream()) { |
| | | EasyExcel.read(inputStream, TbResStagCapDiscImportExcel.class, new AnalysisEventListener<TbResStagCapDiscImportExcel>() { |
| | | @Override |
| | | public void invoke(TbResStagCapDiscImportExcel excelData, AnalysisContext analysisContext) { |
| | | excelList.add(excelData); |
| | | } |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext analysisContext) { |
| | | // 所有数据解析完成后的回调 |
| | | } |
| | | }).sheet().doRead(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | // 处理异常,例如返回错误消息给前端 |
| | | } |
| | | |
| | | List<TbResStagCapDisc> resultList = new ArrayList<>(); |
| | | for (int i = 0; i < excelList.size(); i++) { |
| | | TbResStagCapDiscImportExcel excel = excelList.get(0); |
| | | TbResStagCapDisc tbResStagCapDisc = Objects.requireNonNull(BeanUtil.copy(excel, TbResStagCapDisc.class)); |
| | | double order = (double) i + 1; |
| | | tbResStagCapDisc.setOrderId(order); |
| | | resultList.add(tbResStagCapDisc); |
| | | } |
| | | |
| | | |
| | | return resultList; |
| | | } |
| | | |
| | | @Override |
| | | public List<TbResStagCapDisc> getAll(TbResStagCapDisc tbResStagCapDisc) { |
| | | List<TbResStagCapDisc> list = list(Condition.getQueryWrapper(tbResStagCapDisc) |
| | | .orderByAsc("order_id") |
| | |
| | | |
| | | private String adGuid; |
| | | |
| | | private String adGrad; |
| | | |
| | | //填报年份 |
| | | private Integer tbYear; |
| | | |
| | |
| | | //已校核座数 |
| | | private int checkDykeNum; |
| | | |
| | | //堤防总长度 |
| | | private double dykeTotalLength; |
| | | |
| | | //堤防危害长度 |
| | | private double dangerTotalLength; |
| | | |
| | | } |
| | |
| | | * 水库编号 |
| | | */ |
| | | private String resGuid; |
| | | private String resName; |
| | | private String resRegCode; |
| | | private String engScal; |
| | | private String resLon; |
| | | private String resLat; |
| | | |
| | | private String provinceCode; |
| | | private String provinceName; |
| | |
| | | package cn.gistack.sm.sjztmd.vo; |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.AttResBase; |
| | | import lombok.Data; |
| | | import java.io.Serializable; |
| | | |
| | |
| | | * @author Chill |
| | | */ |
| | | @Data |
| | | public class AttResBaseVO implements Serializable { |
| | | public class AttResBaseVO extends AttResBase { |
| | | |
| | | /** |
| | | * 市编号 |
| | | */ |
| | | private String cityCode; |
| | | private String cityName; |
| | | |
| | | /** |
| | | * 区县编号 |
| | | */ |
| | | private String countyCode; |
| | | private String countyName; |
| | | |
| | | private String townCode; |
| | | private String townName; |
| | | } |
| | |
| | | |
| | | HashMap<String,String> over10Params = new HashMap<>(); |
| | | //small_start_stag=0&small_end_stag=2&mid_start_stag=0&mid_end_stag=2&big_start_stag=0&big_end_stag=2 |
| | | over10Params.put("small_start_stag", "10"); |
| | | over10Params.put("mid_start_stag", "10"); |
| | | over10Params.put("big_start_stag", "10"); |
| | | over10Params.put("small_start_stag", "0.1"); |
| | | over10Params.put("mid_start_stag", "0.1"); |
| | | over10Params.put("big_start_stag", "0.1"); |
| | | |
| | | HashMap<String,String> normalParams = new HashMap<>(); |
| | | //small_start_stag=0&small_end_stag=2&mid_start_stag=0&mid_end_stag=2&big_start_stag=0&big_end_stag=2 |
| New file |
| | |
| | | package cn.gistack.sm.sjztods.controller; |
| | | |
| | | import cn.gistack.sm.sjztods.entity.DsmSpgSpprmp; |
| | | import cn.gistack.sm.sjztods.entity.DsmSpgSpqnmp; |
| | | import cn.gistack.sm.sjztods.service.IDsmSpgSpprmpService; |
| | | import cn.gistack.sm.sjztods.vo.DsmSpgSpprmpVO; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | @Slf4j |
| | | @Api(tags = "渗压站点") |
| | | @RestController |
| | | @RequestMapping("/sjztods/dsmSpgSpprmp") |
| | | @AllArgsConstructor |
| | | public class DsmSpgSpprmpController { |
| | | |
| | | private final IDsmSpgSpprmpService dsmSpgSpprmpService; |
| | | |
| | | @PostMapping("/insert") |
| | | public R insert(DsmSpgSpprmpVO dsmSpgSpprmp){ |
| | | Boolean b = dsmSpgSpprmpService.insertCustomize(dsmSpgSpprmp); |
| | | return R.status(b); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | public R update(DsmSpgSpprmpVO dsmSpgSpprmp){ |
| | | Boolean b = dsmSpgSpprmpService.updateCustomize(dsmSpgSpprmp); |
| | | return R.status(b); |
| | | } |
| | | |
| | | @PostMapping("/remove") |
| | | public R remove(String ids){ |
| | | Boolean b = dsmSpgSpprmpService.removeCustomize(ids); |
| | | return R.status(b); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztods.controller; |
| | | |
| | | import cn.gistack.sm.sjztods.entity.DsmSpgSpqnmp; |
| | | import cn.gistack.sm.sjztods.service.IDsmSpgSpqnmpService; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | @Slf4j |
| | | @Api(tags = "渗流站点") |
| | | @RestController |
| | | @RequestMapping("/sjztods/dsmSpgSpqnmp") |
| | | @AllArgsConstructor |
| | | public class DsmSpgSpqnmpController { |
| | | |
| | | private final IDsmSpgSpqnmpService dsmSpgSpqnmpService; |
| | | |
| | | |
| | | |
| | | @PostMapping("/insert") |
| | | public R insert(DsmSpgSpqnmp dsmSpgSpqnmp){ |
| | | dsmSpgSpqnmp.setIsTb("y"); |
| | | dsmSpgSpqnmp.setDtuptm(DateUtil.now()); |
| | | Boolean b = dsmSpgSpqnmpService.save(dsmSpgSpqnmp); |
| | | return R.status(b); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | public R update(DsmSpgSpqnmp dsmSpgSpqnmp){ |
| | | Boolean b = dsmSpgSpqnmpService.updateCustomize(dsmSpgSpqnmp); |
| | | return R.status(b); |
| | | } |
| | | |
| | | @PostMapping("/remove") |
| | | public R remove(String ids){ |
| | | Boolean b = dsmSpgSpqnmpService.removeCustomize(ids); |
| | | return R.status(b); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztods.entity; |
| | | |
| | | import cn.gistack.sm.sjztods.vo.DsmSpgSpprmpVO; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | *测压管表 |
| | | */ |
| | | @Data |
| | | @TableName("\"dsm_spg_pztb\"") |
| | | public class DsmSpgPztb { |
| | | |
| | | @TableField("\"ch\"") |
| | | //桩号 |
| | | private String ch; |
| | | |
| | | @TableField("\"dm\"") |
| | | //断面 |
| | | private String dm; |
| | | |
| | | @TableField("\"dtuptm\"") |
| | | //资料更新时间 |
| | | private Date dtuptm; |
| | | |
| | | @TableField("\"dvcd\"") |
| | | //仪器编号 |
| | | private String dvcd; |
| | | |
| | | @TableField("\"hycncd\"") |
| | | //水工建筑物编号 |
| | | private String hycncd; |
| | | |
| | | @TableField("\"ipbtel\"") |
| | | //进水段底高程 |
| | | private String ipbtel; |
| | | |
| | | @TableField("\"iptpel\"") |
| | | //进水段顶高程 |
| | | private String iptpel; |
| | | |
| | | @TableField("\"is_tb\"") |
| | | //是否填报 |
| | | private String isTb; |
| | | |
| | | @TableField("\"lgtd\"") |
| | | //经度 |
| | | private String lgtd; |
| | | |
| | | @TableField("\"lttd\"") |
| | | //纬度 |
| | | private String lttd; |
| | | |
| | | @TableField("\"mpcd\"") |
| | | //测点编号 |
| | | private String mpcd; |
| | | |
| | | @TableField("\"msps\"") |
| | | //监测类型 |
| | | private String msps; |
| | | |
| | | @TableField("\"ofax\"") |
| | | //轴距 |
| | | private String ofax; |
| | | |
| | | @TableField("\"rm\"") |
| | | //备注 |
| | | private String rm; |
| | | |
| | | @TableField("\"rscd\"") |
| | | //水库代码 |
| | | private String rscd; |
| | | |
| | | @TableField("\"tbbtel\"") |
| | | //管底高程 |
| | | private String tbbtel; |
| | | |
| | | @TableField("\"tbtpel\"") |
| | | //管口高程 |
| | | private String tbtpel; |
| | | |
| | | |
| | | public DsmSpgPztb(DsmSpgSpprmpVO dsmSpgSpprmp){ |
| | | |
| | | this.setCh(dsmSpgSpprmp.getCh()); |
| | | this.setDm(dsmSpgSpprmp.getDm()); |
| | | this.setDtuptm(dsmSpgSpprmp.getDtuptm()); |
| | | this.setDvcd(dsmSpgSpprmp.getDvcd()); |
| | | this.setHycncd(dsmSpgSpprmp.getHycncd()); |
| | | this.setIsTb(dsmSpgSpprmp.getIsTb()); |
| | | this.setLgtd(dsmSpgSpprmp.getLgtd()); |
| | | this.setLttd(dsmSpgSpprmp.getLttd()); |
| | | this.setMpcd(dsmSpgSpprmp.getMpcd()); |
| | | this.setMsps(dsmSpgSpprmp.getMsps()); |
| | | this.setOfax(dsmSpgSpprmp.getOfax()); |
| | | this.setRm(dsmSpgSpprmp.getRm()); |
| | | this.setRscd(dsmSpgSpprmp.getRscd()); |
| | | |
| | | this.setTbbtel(dsmSpgSpprmp.getTbbtel()); |
| | | this.setTbtpel(dsmSpgSpprmp.getTbtpel()); |
| | | |
| | | this.setIpbtel(dsmSpgSpprmp.getIpbtel()); |
| | | this.setIptpel(dsmSpgSpprmp.getIptpel()); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztods.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 渗压测点表 |
| | | */ |
| | | @Data |
| | | @TableName("\"dsm_spg_spprmp\"") |
| | | public class DsmSpgSpprmp { |
| | | |
| | | @TableField("\"ch\"") |
| | | //桩号 |
| | | private String ch; |
| | | |
| | | @TableField("\"dm\"") |
| | | //断面 |
| | | private String dm; |
| | | |
| | | @TableField("\"dsel\"") |
| | | //坝面高程 |
| | | private String dsel; |
| | | |
| | | @TableField("\"dtuptm\"") |
| | | //资料更新时间 |
| | | private Date dtuptm; |
| | | |
| | | @TableField("\"dvcd\"") |
| | | //仪器编号 |
| | | private String dvcd; |
| | | |
| | | @TableField("\"el\"") |
| | | //高程 |
| | | private String el; |
| | | |
| | | @TableField("\"hycncd\"") |
| | | //水工建筑物编号 |
| | | private String hycncd; |
| | | |
| | | |
| | | @TableField("\"indt\"") |
| | | //安装日期 |
| | | private String indt; |
| | | |
| | | @TableField("\"is_tb\"") |
| | | //是否填报 |
| | | private String isTb; |
| | | |
| | | @TableField("\"lgtd\"") |
| | | //经度 |
| | | private String lgtd; |
| | | |
| | | @TableField("\"lttd\"") |
| | | //纬度 |
| | | private String lttd; |
| | | |
| | | @TableField("\"mpcd\"") |
| | | //测点编号 |
| | | private String mpcd; |
| | | |
| | | @TableField("\"msps\"") |
| | | //监测类型 |
| | | private String msps; |
| | | |
| | | @TableField("\"ofax\"") |
| | | //轴距 |
| | | private String ofax; |
| | | |
| | | @TableField("\"pmbtel\"") |
| | | //透水段底高程 |
| | | private String pmbtel; |
| | | |
| | | @TableField("\"pmtpel\"") |
| | | //透水段顶高程 |
| | | private String pmtpel; |
| | | |
| | | @TableField("\"rm\"") |
| | | //备注 |
| | | private String rm; |
| | | |
| | | @TableField("\"rscd\"") |
| | | //水库代码 |
| | | private String rscd; |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztods.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 渗流测点表 |
| | | */ |
| | | @Data |
| | | @TableName("\"dsm_spg_spqnmp\"") |
| | | public class DsmSpgSpqnmp { |
| | | |
| | | @TableField("\"ch\"") |
| | | //桩号 |
| | | private String ch; |
| | | |
| | | @TableField("\"dm\"") |
| | | //断面 |
| | | private String dm; |
| | | |
| | | @TableField("\"dtuptm\"") |
| | | //资料更新时间 |
| | | private Date dtuptm; |
| | | |
| | | @TableField("\"dvcd\"") |
| | | //仪器编号 |
| | | private String dvcd; |
| | | |
| | | @TableField("\"el\"") |
| | | //高程 |
| | | private String el; |
| | | |
| | | @TableField("\"hycncd\"") |
| | | //水工建筑物编号 |
| | | private String hycncd; |
| | | |
| | | |
| | | @TableField("\"indt\"") |
| | | //安装日期 |
| | | private String indt; |
| | | |
| | | @TableField("\"is_tb\"") |
| | | //是否填报 |
| | | private String isTb; |
| | | |
| | | @TableField("\"lgtd\"") |
| | | //经度 |
| | | private String lgtd; |
| | | |
| | | @TableField("\"lttd\"") |
| | | //纬度 |
| | | private String lttd; |
| | | |
| | | @TableField("\"mpcd\"") |
| | | //测点编号 |
| | | private String mpcd; |
| | | |
| | | @TableField("\"ofax\"") |
| | | //轴距 |
| | | private String ofax; |
| | | |
| | | @TableField("\"rm\"") |
| | | //备注 |
| | | private String rm; |
| | | |
| | | @TableField("\"rscd\"") |
| | | //水库代码 |
| | | private String rscd; |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztods.mapper; |
| | | |
| | | import cn.gistack.sm.sjztods.entity.DsmSpgPztb; |
| | | import cn.gistack.sm.sjztods.vo.DsmSpgSpprmpVO; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | |
| | | @DS("ztznwh") |
| | | public interface DsmPsgPztbMapper extends BaseMapper<DsmSpgPztb> { |
| | | |
| | | |
| | | Boolean updateCustomize(@Param("entity") DsmSpgSpprmpVO dsmSpgSpprmp); |
| | | |
| | | Boolean removeCustomize(@Param("ids") String ids); |
| | | } |
| 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.sjztods.mapper.DsmPsgPztbMapper"> |
| | | |
| | | <update id="updateCustomize"> |
| | | UPDATE |
| | | SJZT_ODS."dsm_spg_pztb" |
| | | SET |
| | | "ch" = #{entity.ch}, |
| | | "ofax" = #{entity.ofax}, |
| | | "dvcd" = #{entity.dvcd}, |
| | | "dtuptm"=#{entity.dtuptm}, |
| | | "tbtpel" = #{entity.tbtpel}, |
| | | "tbbtel" = #{entity.tbbtel} |
| | | WHERE |
| | | "mpcd" = #{entity.mpcd} |
| | | and "is_tb" = 'y' |
| | | and "rscd" = #{entity.rscd} |
| | | </update> |
| | | <delete id="removeCustomize"> |
| | | DELETE |
| | | FROM |
| | | SJZT_ODS."dsm_spg_pztb" |
| | | where |
| | | "is_tb" = 'y' |
| | | AND "mpcd" in |
| | | <foreach collection="ids.split(',')" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </delete> |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.sjztods.mapper; |
| | | |
| | | import cn.gistack.sm.sjztods.entity.DsmSpgSpprmp; |
| | | import cn.gistack.sm.sjztods.entity.DsmSpgSpqnmp; |
| | | import cn.gistack.sm.sjztods.vo.DsmSpgSpprmpVO; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | @DS("ztznwh") |
| | | public interface DsmSpgSpprmpMapper extends BaseMapper<DsmSpgSpprmp> { |
| | | |
| | | |
| | | List<DsmSpgSpprmp> getList(@Param("params") DsmSpgSpprmp paramSy); |
| | | |
| | | Boolean updateCustomize(@Param("entity") DsmSpgSpprmpVO dsmSpgSpprmp); |
| | | |
| | | Boolean removeCustomize(@Param("ids") String ids); |
| | | } |
| 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.sjztods.mapper.DsmSpgSpprmpMapper"> |
| | | <update id="updateCustomize"> |
| | | |
| | | UPDATE |
| | | SJZT_ODS."dsm_spg_spprmp" |
| | | SET |
| | | "ch" = #{entity.ch}, |
| | | "ofax" = #{entity.ofax}, |
| | | "el" = #{entity.el}, |
| | | "dvcd" = #{entity.dvcd}, |
| | | "dtuptm"=#{entity.dtuptm} |
| | | WHERE |
| | | "mpcd" = #{entity.mpcd} |
| | | and "is_tb" = 'y' |
| | | and "rscd" = #{entity.rscd} |
| | | |
| | | </update> |
| | | <delete id="removeCustomize"> |
| | | DELETE |
| | | FROM |
| | | SJZT_ODS."dsm_spg_spprmp" |
| | | where |
| | | "is_tb" = 'y' |
| | | AND "mpcd" in |
| | | <foreach collection="ids.split(',')" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | |
| | | </delete> |
| | | |
| | | <select id="getList" resultType="cn.gistack.sm.sjztods.entity.DsmSpgSpprmp"> |
| | | |
| | | SELECT |
| | | * |
| | | FROM SJZT_ODS."dsm_spg_spprmp" |
| | | where 1=1 |
| | | <if test="params.ch != null and params.ch !=''"> |
| | | AND "ch" = #{params.ch} |
| | | </if> |
| | | <if test="params.rscd != null and params.rscd !=''"> |
| | | AND "rscd" = #{params.rscd} |
| | | </if> |
| | | order by "mpcd" asc |
| | | |
| | | |
| | | </select> |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.sjztods.mapper; |
| | | |
| | | import cn.gistack.sm.sjztods.entity.DsmSpgSpqnmp; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | @DS("ztznwh") |
| | | public interface DsmSpgSpqnmpMapper extends BaseMapper<DsmSpgSpqnmp> { |
| | | |
| | | |
| | | Boolean updateCustomize(@Param("entity") DsmSpgSpqnmp dsmSpgSpqnmp); |
| | | |
| | | List<DsmSpgSpqnmp> getList(@Param("params") DsmSpgSpqnmp paramSl); |
| | | |
| | | Boolean removeCustomize(@Param("ids") String ids); |
| | | } |
| 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.sjztods.mapper.DsmSpgSpqnmpMapper"> |
| | | |
| | | <update id="updateCustomize"> |
| | | |
| | | UPDATE |
| | | SJZT_ODS."dsm_spg_spqnmp" |
| | | SET |
| | | "ch" = #{entity.ch}, |
| | | "ofax" = #{entity.ofax}, |
| | | "el" = #{entity.el}, |
| | | "dvcd" = #{entity.dvcd}, |
| | | "dtuptm"=#{entity.dtuptm} |
| | | WHERE |
| | | "mpcd" = #{entity.mpcd} |
| | | and "is_tb" = 'y' |
| | | and "rscd" = #{entity.rscd} |
| | | </update> |
| | | |
| | | <delete id="removeCustomize"> |
| | | DELETE |
| | | FROM |
| | | SJZT_ODS."dsm_spg_spqnmp" |
| | | where |
| | | "is_tb" = 'y' |
| | | AND "mpcd" in |
| | | <foreach collection="ids.split(',')" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | |
| | | <select id="getList" resultType="cn.gistack.sm.sjztods.entity.DsmSpgSpqnmp"> |
| | | |
| | | SELECT |
| | | * |
| | | FROM SJZT_ODS."dsm_spg_spqnmp" |
| | | where 1=1 |
| | | <if test="params.ch != null and params.ch !=''"> |
| | | AND "ch" = #{params.ch} |
| | | </if> |
| | | <if test="params.rscd != null and params.rscd !=''"> |
| | | AND "rscd" = #{params.rscd} |
| | | </if> |
| | | |
| | | </select> |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.sjztods.service; |
| | | |
| | | import cn.gistack.sm.sjztods.entity.DsmSpgSpprmp; |
| | | import cn.gistack.sm.sjztods.entity.DsmSpgSpqnmp; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface DsmSpgSpprmpService extends IService<DsmSpgSpprmp> { |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztods.service; |
| | | |
| | | import cn.gistack.sm.sjztods.entity.DsmSpgPztb; |
| | | import cn.gistack.sm.sjztods.vo.DsmSpgSpprmpVO; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface IDsmSpgPztbService extends IService<DsmSpgPztb> { |
| | | Boolean updateCustomize(DsmSpgSpprmpVO dsmSpgSpprmp); |
| | | |
| | | Boolean removeCustomize(String ids); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztods.service; |
| | | |
| | | import cn.gistack.sm.sjztods.entity.DsmSpgSpprmp; |
| | | import cn.gistack.sm.sjztods.entity.DsmSpgSpqnmp; |
| | | import cn.gistack.sm.sjztods.vo.DsmSpgSpprmpVO; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IDsmSpgSpprmpService extends IService<DsmSpgSpprmp> { |
| | | Boolean insertCustomize(DsmSpgSpprmpVO dsmSpgSpprmp); |
| | | |
| | | List<DsmSpgSpprmp> getList(DsmSpgSpprmp paramSy); |
| | | |
| | | Boolean updateCustomize(DsmSpgSpprmpVO dsmSpgSpprmp); |
| | | |
| | | Boolean removeCustomize(String ids); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztods.service; |
| | | |
| | | import cn.gistack.sm.sjztods.entity.DsmSpgSpqnmp; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IDsmSpgSpqnmpService extends IService<DsmSpgSpqnmp> { |
| | | Boolean updateCustomize(DsmSpgSpqnmp dsmSpgSpqnmp); |
| | | |
| | | List<DsmSpgSpqnmp> getList(DsmSpgSpqnmp paramSl); |
| | | |
| | | Boolean removeCustomize(String ids); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztods.service.impl; |
| | | |
| | | import cn.gistack.sm.sjztods.entity.DsmSpgPztb; |
| | | import cn.gistack.sm.sjztods.mapper.DsmPsgPztbMapper; |
| | | import cn.gistack.sm.sjztods.service.IDsmSpgPztbService; |
| | | import cn.gistack.sm.sjztods.vo.DsmSpgSpprmpVO; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | @DS("ztznwh") |
| | | public class DsmSpgPztbServiceImpl extends ServiceImpl<DsmPsgPztbMapper, DsmSpgPztb> implements IDsmSpgPztbService { |
| | | @Override |
| | | public Boolean updateCustomize(DsmSpgSpprmpVO dsmSpgSpprmp) { |
| | | return baseMapper.updateCustomize(dsmSpgSpprmp); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean removeCustomize(String ids) { |
| | | return baseMapper.removeCustomize(ids); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztods.service.impl; |
| | | |
| | | import cn.gistack.sm.sjztods.entity.DsmSpgPztb; |
| | | import cn.gistack.sm.sjztods.entity.DsmSpgSpprmp; |
| | | import cn.gistack.sm.sjztods.mapper.DsmSpgSpprmpMapper; |
| | | import cn.gistack.sm.sjztods.service.IDsmSpgPztbService; |
| | | import cn.gistack.sm.sjztods.service.IDsmSpgSpprmpService; |
| | | import cn.gistack.sm.sjztods.vo.DsmSpgSpprmpVO; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | @DS("ztznwh") |
| | | @AllArgsConstructor |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class DsmSpgSpprmpServiceImpl extends ServiceImpl<DsmSpgSpprmpMapper, DsmSpgSpprmp> implements IDsmSpgSpprmpService { |
| | | |
| | | private final IDsmSpgPztbService dsmSpgPztbService; |
| | | |
| | | |
| | | |
| | | @Override |
| | | public Boolean insertCustomize(DsmSpgSpprmpVO dsmSpgSpprmp) { |
| | | |
| | | //往渗压监测表中插入数据 |
| | | |
| | | dsmSpgSpprmp.setIsTb("y"); |
| | | dsmSpgSpprmp.setDtuptm(DateUtil.now()); |
| | | boolean save = save(dsmSpgSpprmp); |
| | | |
| | | |
| | | //往测压管表中插入数据 |
| | | DsmSpgPztb dsmSpgPztb = new DsmSpgPztb(dsmSpgSpprmp); |
| | | boolean save1 = dsmSpgPztbService.save(dsmSpgPztb); |
| | | |
| | | |
| | | return save && save1; |
| | | } |
| | | |
| | | @Override |
| | | public List<DsmSpgSpprmp> getList(DsmSpgSpprmp paramSy) { |
| | | return baseMapper.getList(paramSy); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean updateCustomize(DsmSpgSpprmpVO dsmSpgSpprmp) { |
| | | dsmSpgSpprmp.setDtuptm(DateUtil.now()); |
| | | |
| | | Boolean update = baseMapper.updateCustomize(dsmSpgSpprmp); |
| | | Boolean update2 = dsmSpgPztbService.updateCustomize(dsmSpgSpprmp); |
| | | |
| | | return update&&update2; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean removeCustomize(String ids) { |
| | | |
| | | Boolean b = baseMapper.removeCustomize(ids); |
| | | Boolean b1 = dsmSpgPztbService.removeCustomize(ids); |
| | | |
| | | |
| | | return b&&b1; |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztods.service.impl; |
| | | |
| | | import cn.gistack.sm.sjztods.entity.DsmSpgSpqnmp; |
| | | import cn.gistack.sm.sjztods.mapper.DsmSpgSpqnmpMapper; |
| | | import cn.gistack.sm.sjztods.service.IDsmSpgSpqnmpService; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | @DS("ztznwh") |
| | | public class DsmSpgSpqnmpServiceImpl extends ServiceImpl<DsmSpgSpqnmpMapper, DsmSpgSpqnmp> implements IDsmSpgSpqnmpService { |
| | | @Override |
| | | public Boolean updateCustomize(DsmSpgSpqnmp dsmSpgSpqnmp) { |
| | | dsmSpgSpqnmp.setDtuptm(DateUtil.now()); |
| | | return baseMapper.updateCustomize(dsmSpgSpqnmp); |
| | | } |
| | | |
| | | @Override |
| | | public List<DsmSpgSpqnmp> getList(DsmSpgSpqnmp paramSl) { |
| | | return baseMapper.getList(paramSl); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean removeCustomize(String ids) { |
| | | return baseMapper.removeCustomize(ids); |
| | | } |
| | | } |
| | |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.MultiValueMap; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | |
| | | * @param xsfsQktj |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveOrUpdateData(XsfsQktjVO xsfsQktj) { |
| | | // 参数拼接 |
| | | StringBuilder builder = new StringBuilder("?"); |
| | |
| | | XsfsQktj xsfsQktjBy = baseMapper.selectXsfsQktjBy(adCode,xsfsQktj.getQueryTime()); |
| | | if (null!=xsfsQktjBy){ |
| | | // 跳出本次循环 |
| | | //更新 |
| | | setXsfsQktjInfo(xsfsQktjBy,jsonArray,i,xsfsQktj.getQueryTime()); |
| | | updateById(xsfsQktjBy); |
| | | continue; |
| | | } |
| | | XsfsQktj qkTj = new XsfsQktj(); |
| | |
| | | skxs.setUpdateTime(new Date()); |
| | | skxs.setSysResource("zt"); |
| | | // 总 |
| | | skxs.setZxsTotal(jsonArray.getJSONObject(i).getDouble("tot_cap")); |
| | | // skxs.setZxsTotal(jsonArray.getJSONObject(i).getDouble("tot_cap")); |
| | | skxs.setZxsTotal(jsonArray.getJSONObject(i).getDouble("now_cap")); |
| | | skxs.setZxsSc(jsonArray.getJSONObject(i).getDouble("diff_last_day")); |
| | | skxs.setZxsLastYearTq(jsonArray.getJSONObject(i).getDouble("rate_last_year_cap")); |
| | | skxs.setZxsLastYearTqzj(jsonArray.getJSONObject(i).getDouble("diff_last_year")); |
| | | skxs.setZxsHisTq(jsonArray.getJSONObject(i).getDouble("diff_his_cap")); |
| | | skxs.setZxsHisTqzj(jsonArray.getJSONObject(i).getDouble("rate_avg_cap")); |
| | | // 大型 |
| | | skxs.setDxskXsTotal(jsonArray.getJSONObject(i).getDouble("big_tot_cap")); |
| | | skxs.setDxskXsTotal(jsonArray.getJSONObject(i).getDouble("big_now_cap")); |
| | | skxs.setDxskXsHis(jsonArray.getJSONObject(i).getDouble("big_diff_his")); |
| | | skxs.setDxskXsLastYear(jsonArray.getJSONObject(i).getDouble("big_diff_last_year")); |
| | | // 中型 |
| | | skxs.setZxskXsTotal(jsonArray.getJSONObject(i).getDouble("mid_tot_cap")); |
| | | skxs.setZxskXsTotal(jsonArray.getJSONObject(i).getDouble("mid_now_cap")); |
| | | skxs.setZxskXsHis(jsonArray.getJSONObject(i).getDouble("mid_diff_his")); |
| | | skxs.setZxskXsLastYear(jsonArray.getJSONObject(i).getDouble("mid_diff_last_year")); |
| | | // 小型 |
| | | skxs.setXxskXsTotal(jsonArray.getJSONObject(i).getDouble("small_tot_cap")); |
| | | skxs.setXxskXsTotal(jsonArray.getJSONObject(i).getDouble("small_now_cap")); |
| | | } |
| | | |
| | | /** |
| New file |
| | |
| | | package cn.gistack.sm.sjztods.vo; |
| | | |
| | | import cn.gistack.sm.sjztods.entity.DsmSpgSpprmp; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class DsmSpgSpprmpVO extends DsmSpgSpprmp { |
| | | |
| | | //管底高程 |
| | | private String tbbtel; |
| | | |
| | | //管口高程 |
| | | private String tbtpel; |
| | | |
| | | //进水段底高程 |
| | | private String ipbtel; |
| | | |
| | | //进水段顶高程 |
| | | private String iptpel; |
| | | } |
| | |
| | | url: ${blade.datasource.dev.zt.url} |
| | | username: ${blade.datasource.dev.zt.username} |
| | | password: ${blade.datasource.dev.zt.password} |
| | | ztdw: |
| | | url: ${blade.datasource.dev.ztdw.url} |
| | | username: ${blade.datasource.dev.ztdw.username} |
| | | password: ${blade.datasource.dev.ztdw.password} |
| | | # 智能外呼数据库 |
| | | ztznwh: |
| | | url: ${blade.datasource.dev.ztznwh.url} |
| | |
| | | url: ${blade.datasource.prod.zt.url} |
| | | username: ${blade.datasource.prod.zt.username} |
| | | password: ${blade.datasource.prod.zt.password} |
| | | ztdw: |
| | | url: ${blade.datasource.prod.ztdw.url} |
| | | username: ${blade.datasource.prod.ztdw.username} |
| | | password: ${blade.datasource.prod.ztdw.password} |
| | | # 智能外呼数据库 |
| | | ztznwh: |
| | | url: ${blade.datasource.prod.ztznwh.url} |
| | |
| | | url: ${blade.datasource.test.zt.url} |
| | | username: ${blade.datasource.test.zt.username} |
| | | password: ${blade.datasource.test.zt.password} |
| | | ztdw: |
| | | url: ${blade.datasource.test.ztdw.url} |
| | | username: ${blade.datasource.test.ztdw.username} |
| | | password: ${blade.datasource.test.ztdw.password} |
| | | # 智能外呼数据库 |
| | | ztznwh: |
| | | url: ${blade.datasource.test.ztznwh.url} |
| | |
| | | return R.data(deptService.getDeptAndUserTree(treeNode)); |
| | | } |
| | | |
| | | @GetMapping("updateAllDept") |
| | | public R updateAllDept(){ |
| | | int number = deptService.updateAllDept(); |
| | | return R.data(number); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | return R.data(regionService.getById(code)); |
| | | } |
| | | |
| | | @Override |
| | | @GetMapping(UPDATE_DEPT_BY_TB) |
| | | public boolean updateDeptByTb(String adCode, String resGuid) { |
| | | return deptService.updateDeptByTb(adCode,resGuid); |
| | | } |
| | | |
| | | @Override |
| | | @GetMapping(GET_RES_DEPT) |
| | | public String getResDept(String deptIds) { |
| | | return deptService.getResDept(deptIds); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | @MapKey(value = "id") |
| | | Map<String, DeptUserTreeNode> getUserMap(@Param("treeNode") DeptUserTreeNode treeNode); |
| | | |
| | | String getResDept(@Param("deptIds") String deptIds); |
| | | } |
| | |
| | | and bu.dept_id like concat(concat('%',#{treeNode.id}),'%') |
| | | </if> |
| | | </select> |
| | | <select id="getResDept" resultType="java.lang.String"> |
| | | |
| | | SELECT WM_CONCAT(res_guid) |
| | | FROM blade_dept where res_guid is not null and res_guid != '' |
| | | and id in |
| | | <foreach collection="deptIds.split(',')" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | 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} |
| | | ) |
| | | and is_deleted = 0 |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | * @return |
| | | */ |
| | | List<TreeNode> getDeptAndUserTree(DeptUserTreeNode treeNode); |
| | | |
| | | int updateAllDept(); |
| | | |
| | | boolean updateDeptByTb(String adCode, String resGuid); |
| | | |
| | | /** |
| | | * 根据机构ids获取水库编码 |
| | | * @param deptIds |
| | | * @return |
| | | */ |
| | | String getResDept(String deptIds); |
| | | } |
| | |
| | | import cn.gistack.common.node.TreeNode; |
| | | import cn.gistack.common.utils.NodeTreeUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.constant.BladeConstant; |
| | | import org.springblade.core.tool.node.ForestNodeMerger; |
| | |
| | | // 处理并返回 |
| | | return NodeTreeUtil.getDeptAndUserNodeTree(deptMap); |
| | | } |
| | | |
| | | @Override |
| | | public int updateAllDept() { |
| | | |
| | | Dept params = new Dept(); |
| | | params.setAdGrad("9"); |
| | | List<Dept> list = list(Condition.getQueryWrapper(params)); |
| | | |
| | | list.forEach(dept -> { |
| | | this.submit(dept); |
| | | }); |
| | | return list.size(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateDeptByTb(String adCode, String resGuid) { |
| | | //根据水库编码找到机构 |
| | | QueryWrapper<Dept> query1 = new QueryWrapper<>(); |
| | | query1.eq("RES_GUID",resGuid); |
| | | Dept resDept = getOne(query1); |
| | | |
| | | //找到移到哪个行政区划下的机构 |
| | | QueryWrapper<Dept> query2 = new QueryWrapper<>(); |
| | | query2.eq("AD_CODE",adCode); |
| | | Dept adCodeDept = getOne(query2); |
| | | |
| | | if (resDept != null && adCodeDept != null){ |
| | | resDept.setParentId(adCodeDept.getId()); |
| | | return this.submit(resDept); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public String getResDept(String deptIds) { |
| | | return baseMapper.getResDept(deptIds); |
| | | } |
| | | } |
| | |
| | | @ExcelProperty("生日") |
| | | private Date birthday; |
| | | |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("类型(堤防/水库)") |
| | | private String type; |
| | | |
| | | } |
| | |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implements IUserService { |
| | | private static final String GUEST_NAME = "guest"; |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean removeUser(String userIds) { |
| | | if (Func.contains(Func.toLongArray(userIds), AuthUtil.getUserId())) { |
| | | throw new ServiceException("不能删除本账号!"); |
| | |
| | | if (!AuthUtil.isAdministrator() || StringUtil.isBlank(user.getTenantId())) { |
| | | user.setTenantId(AuthUtil.getTenantId()); |
| | | } |
| | | user.setType(userExcel.getType()); |
| | | // 覆盖数据 |
| | | if (isCovered) { |
| | | // 查询用户是否存在 |
| | |
| | | } |
| | | } |
| | | // 获取默认密码配置 |
| | | String initPassword = ParamCache.getValue(DEFAULT_PARAM_PASSWORD); |
| | | // String initPassword = ParamCache.getValue(DEFAULT_PARAM_PASSWORD); |
| | | |
| | | String initPassword = CommonConstant.DEFAULT_PASSWORD; |
| | | user.setPassword(initPassword); |
| | | this.submit(user); |
| | | }); |
| | |
| | | public ReturnT<String> damSafetySyNoneHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("监测数据缺失","","damSafetySyNoneHandle"); |
| | | noticeClient.createAlarmNoticeTaskJobHandler("渗压监测数据缺失","","damSafetySyNoneHandle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> damSafetySlNoneHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("监测数据缺失","","damSafetySlNoneHandle"); |
| | | noticeClient.createAlarmNoticeTaskJobHandler("渗流监测数据缺失","","damSafetySlNoneHandle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> damSafetyWyNoneHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("监测数据缺失","","damSafetyWyNoneHandle"); |
| | | noticeClient.createAlarmNoticeTaskJobHandler("位移监测数据缺失","","damSafetyWyNoneHandle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略24: 大坝安全监测告警-渗压资料缺失-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetySyDataMissingHandle") |
| | | public ReturnT<String> damSafetySyDataMissingHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("渗压资料缺失","","damSafetySyDataMissingHandle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 策略25: 大坝安全监测告警-变形资料缺失-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetyBxDataMissingHandle") |
| | | public ReturnT<String> damSafetyBxDataMissingHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("变形资料缺失","","damSafetyBxDataMissingHandle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略26: 大坝安全监测告警-水位低于管底高程-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetySyLessThenPipeHandle") |
| | | public ReturnT<String> damSafetySyLessThenPipeHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位低于管底高程","","damSafetySyLessThenPipeHandle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 策略27: 大坝安全监测告警-水位大于管口高程-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetySyHigherThenNozzleHandle") |
| | | public ReturnT<String> damSafetySyHigherThenNozzleHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位大于管口高程","","damSafetySyHigherThenNozzleHandle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 策略28: 大坝安全监测告警-水位大于坝顶高程-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetySyHigherThenBdElevationHandle") |
| | | public ReturnT<String> damSafetySyHigherThenBdElevationHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位大于坝顶高程","","damSafetySyHigherThenBdElevationHandle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 策略29: 大坝安全监测告警-水位大于库水位-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetySyHigherThenWaterLevelHandle") |
| | | public ReturnT<String> damSafetySyHigherThenWaterLevelHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位大于库水位","","damSafetySyHigherThenWaterLevelHandle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略30: 大坝安全监测告警-水位长期不变,五日变幅小于5cm,十日变幅大于5cm小于8cm,三十日变幅大于8cm小于10cm-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetySyYellowChangeHandle") |
| | | public ReturnT<String> damSafetySyYellowChangeHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位变幅黄色告警","","damSafetySyYellowChangeHandle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 策略31: 大坝安全监测告警-渗压水位一日变幅大于0.5米小于1米,五日变幅大于1米小于2米,十日变幅大于2米小于5米,三十日变幅大于5米小于10米-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetySyOrangeChangeHandle") |
| | | public ReturnT<String> damSafetySyOrangeChangeHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位变幅橙色告警","","damSafetySyOrangeChangeHandle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 策略32: 大坝安全监测告警-渗压水位一日变幅大于1米小于2米,五日变幅大于2米小于5米,十日变幅大于5米小于10米,三十日变幅大于10米-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetySyRedChangeHandle") |
| | | public ReturnT<String> damSafetySyRedChangeHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位变幅红色告警","","damSafetySyRedChangeHandle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略33: 大坝安全监测告警-近1h水位陡降-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetySyRz1hChangeHandle") |
| | | public ReturnT<String> damSafetySyRz1hChangeHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("近1h水位陡升陡降","","damSafetySyRz1hChangeHandle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略34: 大坝安全监测告警-变形值大于2cm小于5cm-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetyWyOver2Less5Handle") |
| | | public ReturnT<String> damSafetyWyOver2Less5Handle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("变形值大于2cm小于5cm","","damSafetyWyOver2Less5Handle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略35: 大坝安全监测告警-变形值大于5cm小于10cm-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetyWyOver5Less10Handle") |
| | | public ReturnT<String> damSafetyWyOver5Less10Handle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("变形值大于5cm小于10cm","","damSafetyWyOver5Less10Handle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略36: 大坝安全监测告警-变形值大于10cm以上-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetyWyOver10Handle") |
| | | public ReturnT<String> damSafetyWyOver10Handle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("变形值大于10cm以上","","damSafetyWyOver10Handle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略37: 大坝安全监测告警-近1h变形值大于10cm以上-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetyWy1hChangeOver10Handle") |
| | | public ReturnT<String> damSafetyWy1hChangeOver10Handle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("近1h变形值大于10cm以上","","damSafetyWy1hChangeOver10Handle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略38: 大坝安全监测告警-渗流量一日大于5L小于8L,连续3日增加-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetySlOver5Less8Handle") |
| | | public ReturnT<String> damSafetySlOver5Less8Handle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("渗流量一日大于5L小于8L连续3日增加","","damSafetySlOver5Less8Handle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 策略39: 大坝安全监测告警-渗流量一日大于8L小于10L,连续3日增加-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetySlOver8Less10Handle") |
| | | public ReturnT<String> damSafetySlOver8Less10Handle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("渗流量一日大于8L小于10L连续3日增加","","damSafetySlOver8Less10Handle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 策略40: 大坝安全监测告警-渗流量一日大于10L以上,连续3日增加-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetySlOver10Handle") |
| | | public ReturnT<String> damSafetySlOver10Handle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("渗流量一日大于10L连续3日增加","","damSafetySlOver10Handle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 策略41: 视频告警-视频信息接收不到-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("videoOfflineHandle") |
| | | public ReturnT<String> videoOfflineHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("视频信息接收不到","","videoOfflineHandle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import cn.gistack.sm.sjztods.feign.IXsfsQktjClient; |
| | | import cn.gistack.sm.sjztods.vo.SkxsQkTjVO; |
| | | import cn.gistack.sm.sjztods.vo.XsfsQktjVO; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.handler.annotation.XxlJob; |
| | | import com.xxl.job.core.log.XxlJobLogger; |
| | | 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.Component; |
| | | |
| | |
| | | public ReturnT<String> execute(String param) { |
| | | XxlJobLogger.log("执行时间:"+ new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(DateUtil.now())); |
| | | XsfsQktjVO xsfsQktjVO = new XsfsQktjVO(); |
| | | String todayDate = ""; |
| | | if (StringUtil.isNotBlank(param)){ |
| | | JSONObject jsonParam = JSON.parseObject(param); |
| | | String date = jsonParam.getString("date"); |
| | | todayDate = date; |
| | | }else{ |
| | | //设置今日时间 |
| | | todayDate = new SimpleDateFormat("yyyy-MM-dd").format(DateUtil.now()); |
| | | } |
| | | |
| | | //设置今日时间 |
| | | String todayDate = new SimpleDateFormat("yyyy-MM-dd").format(DateUtil.now()); |
| | | xsfsQktjVO.setQueryTime(todayDate); |
| | | |
| | | xsfsQktjClient.saveRegionData(xsfsQktjVO); |