Merge remote-tracking branch 'origin/jtdev' into jtdev
122 files modified
138 files added
| | |
| | | <repositories> |
| | | <repository> |
| | | <id>aliyun-repos</id> |
| | | <url>https://maven.aliyun.com/repository/public/</url> |
| | | <name>Aliyun Public Repository</name> |
| | | <url>https://maven.aliyun.com/repository/public</url> |
| | | <snapshots> |
| | | <enabled>false</enabled> |
| | | </snapshots> |
| | | </repository> |
| | | <repository> |
| | | <id>blade-release</id> |
| | | <name>Release Repository</name> |
| | | <url>http://nexus.javablade.com/repository/maven-releases/</url> |
| | | <id>bladex</id> |
| | | <name>BladeX Release Repository</name> |
| | | <url>https://center.javablade.com/api/packages/blade/maven</url> |
| | | </repository> |
| | | </repositories> |
| | | |
| | | <pluginRepositories> |
| | | <pluginRepository> |
| | | <id>aliyun-plugin</id> |
| | | <url>https://maven.aliyun.com/repository/public/</url> |
| | | <name>Aliyun Public Plugin</name> |
| | | <url>https://maven.aliyun.com/repository/public</url> |
| | | <snapshots> |
| | | <enabled>false</enabled> |
| | | </snapshots> |
| | | </pluginRepository> |
| | | </pluginRepositories> |
| | | |
| | | <distributionManagement> |
| | | <repository> |
| | | <id>bladex</id> |
| | | <name>BladeX Release Repository</name> |
| | | <url>https://center.javablade.com/api/packages/blade/maven</url> |
| | | </repository> |
| | | <snapshotRepository> |
| | | <id>bladex</id> |
| | | <name>BladeX Snapshot Repository</name> |
| | | <url>https://center.javablade.com/api/packages/blade/maven</url> |
| | | </snapshotRepository> |
| | | </distributionManagement> |
| | | |
| | | </project> |
| | |
| | | |
| | | String NACOS_USERNAME = "nacos"; |
| | | |
| | | String NACOS_PASSWORD = "nacos"; |
| | | String NACOS_PASSWORD = "1qaz!QAZ"; |
| | | |
| | | /** |
| | | * nacos test 地址 |
| New file |
| | |
| | | package cn.gistack.common.utils; |
| | | |
| | | import java.util.UUID; |
| | | |
| | | public class IdUtils { |
| | | |
| | | /** |
| | | * 随机生成36位id |
| | | * @return |
| | | */ |
| | | public static String getIdBy36(){ |
| | | //生成uuid |
| | | String randomId = UUID.randomUUID().toString(); |
| | | String trim = randomId.replaceAll("-", ""); |
| | | //再拼接4位 |
| | | long l = System.currentTimeMillis(); |
| | | String time = String.valueOf(l); |
| | | String subTime = time.substring(time.length() - 4); |
| | | return trim + subTime; |
| | | } |
| | | } |
| | |
| | | private String taskId; |
| | | |
| | | private String monitorData; |
| | | |
| | | private String remark; |
| | | } |
| New file |
| | |
| | | package cn.gistack.alerts.alarmRule.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 预报发布信息表 |
| | | */ |
| | | @Data |
| | | @TableName("FS_R_ATMTN_FRCST_INF") |
| | | public class FsRAtmtnFrcstInf implements Serializable { |
| | | /** |
| | | *预报id主键 |
| | | */ |
| | | private String frcstCd; |
| | | /** |
| | | *预报站点 |
| | | */ |
| | | private String STCD; |
| | | /** |
| | | *预报员id |
| | | */ |
| | | private String frcstUsrId; |
| | | /** |
| | | *预报员姓名 |
| | | */ |
| | | private String frcstUsrNm; |
| | | /** |
| | | *发布单位 |
| | | */ |
| | | private String pblshUnt; |
| | | /** |
| | | *类型:1:日常化预报;2:洪水预报 |
| | | */ |
| | | private Integer pblshTyp; |
| | | /** |
| | | *依据条件 |
| | | */ |
| | | private String cndtn; |
| | | /** |
| | | *预报时间 |
| | | */ |
| | | private String frcstTm; |
| | | /** |
| | | *发布时间 |
| | | */ |
| | | private String pblshTm; |
| | | /** |
| | | *发布单位id |
| | | */ |
| | | private String pblshId; |
| | | } |
| New file |
| | |
| | | package cn.gistack.alerts.alarmRule.vo; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import org.checkerframework.checker.units.qual.A; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @Builder |
| | | public class FsRAtmtnFrcstDtDeatilVO implements Serializable { |
| | | private String type; |
| | | private String value; |
| | | } |
| New file |
| | |
| | | package cn.gistack.alerts.alarmRule.vo; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @Builder |
| | | public class FsRAtmtnFrcstDtVO implements Serializable { |
| | | private String FRCST_CD; |
| | | private String TM; |
| | | private Float TZ; |
| | | private Float TQ; |
| | | private List<FsRAtmtnFrcstDtDeatilVO> list; |
| | | } |
| New file |
| | |
| | | package cn.gistack.alerts.alarmRule.vo; |
| | | |
| | | import cn.gistack.alerts.alarmRule.entity.FsRAtmtnFrcstInf; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @Builder |
| | | public class FsRAtmtnFrcstInfVO extends FsRAtmtnFrcstInf { |
| | | |
| | | /** |
| | | * 流量 |
| | | */ |
| | | private List<FsRAtmtnFrcstDtVO> frcstDtVOS; |
| | | /** |
| | | * 站点名 |
| | | */ |
| | | private String STNM; |
| | | /** |
| | | * 河流 |
| | | */ |
| | | private String RVNM; |
| | | /** |
| | | * 警戒水位 |
| | | */ |
| | | private String WRZ; |
| | | /** |
| | | * 保证水位 |
| | | */ |
| | | private String GRZ; |
| | | /** |
| | | * 讯限水位 |
| | | */ |
| | | private String FSLTDZ; |
| | | /** |
| | | * 设防水位 |
| | | */ |
| | | private String SFLZ; |
| | | |
| | | private String FZ;//洪峰水位 |
| | | private String FZTM;//发生时间 |
| | | private String FQ;//洪峰流量 |
| | | private String FQTM;//峰现时间 |
| | | private String RUNOFF; //洪量 |
| | | private String CTM;//预报依据截止时间 |
| | | private String RF;//是否滚动预报 |
| | | |
| | | private String FRCST_CD; |
| | | private String TM; |
| | | private Float TZ; |
| | | private Float TQ; |
| | | } |
| New file |
| | |
| | | package cn.gistack.alerts.alarmRule.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 站点水文信息 |
| | | */ |
| | | @Data |
| | | public class StStbprpBVO { |
| | | /** |
| | | * 站点编码 |
| | | */ |
| | | private String STCD; |
| | | /** |
| | | * 站点名 |
| | | */ |
| | | private String STNM; |
| | | /** |
| | | * 河流 |
| | | */ |
| | | private String RVNM; |
| | | /** |
| | | * 警戒水位 |
| | | */ |
| | | private String WRZ; |
| | | /** |
| | | *保证水位 |
| | | */ |
| | | private String GRZ; |
| | | /** |
| | | * 讯限水位 |
| | | */ |
| | | private String FSLTDZ; |
| | | /** |
| | | * 设防水位 |
| | | */ |
| | | private String SFLZ; |
| | | } |
| New file |
| | |
| | | package cn.gistack.alerts.alarmRule.vo; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @Builder |
| | | public class WarningColorVO { |
| | | /** |
| | | * 颜色 |
| | | */ |
| | | private String colorName; |
| | | /** |
| | | * 条数 |
| | | */ |
| | | private Integer colorWarningNum; |
| | | } |
| New file |
| | |
| | | package cn.gistack.alerts.alarmRule.vo; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @Builder |
| | | public class WarningTypeVO { |
| | | /** |
| | | * 预警类型 |
| | | */ |
| | | private String warningType; |
| | | /** |
| | | * 预警条数 |
| | | */ |
| | | private String warningNum; |
| | | /** |
| | | * 预警种类数量 |
| | | */ |
| | | private String typeNum; |
| | | /** |
| | | * 颜色 |
| | | */ |
| | | private String color; |
| | | /** |
| | | * 子类型 |
| | | */ |
| | | List<WarningTypeVO> childList; |
| | | /** |
| | | * 预警颜色 |
| | | */ |
| | | private List<WarningColorVO> colorVOList; |
| | | } |
| | |
| | | */ |
| | | private String resMsg; |
| | | |
| | | /** |
| | | * 告警规则id |
| | | */ |
| | | private Long alarmRuleId; |
| | | |
| | | } |
| | |
| | | package cn.gistack.alerts.sms.feign; |
| | | |
| | | import cn.gistack.alerts.sms.vo.SmsResultVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | 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.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 短信发送记录 |
| | |
| | | String SEND_SMS_BY_OUT_CALL_NOT_CONNECT = API_PREFIX + "/sendSmsByOutCallNotConnect"; |
| | | String CREATE_OUT_CALL_ERROR_SEND_SMS = API_PREFIX + "/createOutCallErrorSendSms"; |
| | | |
| | | String SELECT_SMS_RESULT_PAGE = API_PREFIX + "/selectSmsResultPage"; |
| | | |
| | | @PostMapping(SELECT_SMS_RESULT_PAGE) |
| | | List<SmsResultVO> smsSuccessList(@RequestBody SmsResultVO smsResult); |
| | | |
| | | /** |
| | | * 保存短信发送记录 |
| | | * @param userNumber |
| | |
| | | package cn.gistack.alerts.sms.feign; |
| | | |
| | | import cn.gistack.alerts.sms.vo.SmsResultVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | |
| | | public class ISmsRecordClientFallback implements ISmsRecordClient{ |
| | | |
| | | @Override |
| | | public List<SmsResultVO> smsSuccessList(SmsResultVO smsResult) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public void saveSmsRecord(String userNumber, String messageContent, String templateId, String code, String msg, Integer number) { |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.hk; |
| | | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * @PROJECT_NAME: skjcmanager |
| | | * @DESCRIPTION: 海康设备水尺监测 |
| | | * @USER: zhongrj |
| | | * @DATE: 2024/06/05 |
| | | */ |
| | | @Component |
| | | public class HkStaffGaugeMonClientFallback implements IHkStaffGaugeMonClient { |
| | | |
| | | @Override |
| | | public void insertHkStaffGaugeMonInfo() { |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.hk; |
| | | |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | /** |
| | | * @PROJECT_NAME: skjcmanager |
| | | * @DESCRIPTION: 海康设备水尺监测 |
| | | * @USER: zhongrj |
| | | * @DATE: 2024/06/05 |
| | | */ |
| | | @FeignClient( |
| | | value = "blade-sm", |
| | | fallback = HkStaffGaugeMonClientFallback.class |
| | | ) |
| | | public interface IHkStaffGaugeMonClient { |
| | | |
| | | String API_PREFIX = "/client"; |
| | | String INSERT_HK_STAFF_GAUGE_MON = API_PREFIX + "/insertHkStaffGaugeMonInfo"; |
| | | |
| | | |
| | | @GetMapping(INSERT_HK_STAFF_GAUGE_MON) |
| | | void insertHkStaffGaugeMonInfo(); |
| | | |
| | | } |
| | |
| | | @Data |
| | | public class CallTaskResultVO extends CallTaskResult { |
| | | |
| | | |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | |
| | | */ |
| | | private Integer isPage; |
| | | |
| | | /** |
| | | * 索引 |
| | | */ |
| | | private String index; |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.DO; |
| | | |
| | | 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 lombok.*; |
| | | import org.springblade.core.mp.base.BaseEntity; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工项目表 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-13 11:51:20 |
| | | */ |
| | | @Data |
| | | @TableName("SG_DEVICE") |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @Builder |
| | | public class SgDeviceDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | |
| | | private Long id; |
| | | |
| | | /** |
| | | * 设备名称 |
| | | */ |
| | | private String deviceName; |
| | | |
| | | /** |
| | | * 设备类型 |
| | | */ |
| | | private String deviceType; |
| | | /** |
| | | * 类型名称 |
| | | */ |
| | | @TableField(exist = false) |
| | | private String typeName; |
| | | /** |
| | | * 设备进度 |
| | | */ |
| | | @TableField(exist = false) |
| | | private String deviceProgress; |
| | | |
| | | @TableField(exist = false) |
| | | private String progress; |
| | | /** |
| | | * 项目id |
| | | */ |
| | | private String programId; |
| | | |
| | | @TableField(exist = false) |
| | | private String programName; |
| | | /** |
| | | * 经度 |
| | | */ |
| | | private String lon; |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | private String lat; |
| | | |
| | | |
| | | /** |
| | | * 安装地址 |
| | | */ |
| | | private String address; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | @TableField(exist = false) |
| | | private Long createUser; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 工序步骤 |
| | | */ |
| | | @TableField(exist = false) |
| | | private List<SgGxStepDO> stepDOList; |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | private Integer status; |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.DO; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工设备工序步骤表 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-13 15:46:18 |
| | | */ |
| | | @Data |
| | | public class SgDeviceGxStepDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 工序编号 |
| | | */ |
| | | private String gxStepNum; |
| | | /** |
| | | * 工序设备id |
| | | */ |
| | | private String gxDeviceId; |
| | | /** |
| | | * 工序设备id |
| | | */ |
| | | private String gxDeviceName; |
| | | |
| | | /** |
| | | * 工序步骤id |
| | | */ |
| | | private String gxId; |
| | | |
| | | /** |
| | | * 工序基础信息id |
| | | */ |
| | | private Integer status; |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.DO; |
| | | |
| | | 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 lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * 设备工序配置角色表 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-15 11:45:35 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("SG_GX_CONFIG") |
| | | public class SgGxConfigDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 设备类型 |
| | | */ |
| | | private String gxDeviceType; |
| | | |
| | | /** |
| | | * 工序步骤id |
| | | */ |
| | | private Long gxStepId; |
| | | |
| | | /** |
| | | * 角色id |
| | | */ |
| | | private String roleId; |
| | | |
| | | /** |
| | | * 审核顺序 |
| | | */ |
| | | private Integer sgOrder; |
| | | |
| | | @TableField(exist = false) |
| | | private Long user; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.DO; |
| | | |
| | | 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 lombok.*; |
| | | import lombok.experimental.Accessors; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工工序基本表 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-13 15:46:18 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName(value ="SG_GX" ,autoResultMap = true) |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @Builder |
| | | public class SgGxDO { |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 工序基本名称 |
| | | */ |
| | | private String gxName; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | private Long createUser; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | private Date updateTime; |
| | | |
| | | private String gxType; |
| | | |
| | | /** |
| | | * 关联设备 |
| | | */ |
| | | @TableField(exist = false) |
| | | private List<SgDeviceDO> deviceDOS; |
| | | |
| | | /** |
| | | * 创建人姓名 |
| | | */ |
| | | @TableField(exist = false) |
| | | private String createUserName; |
| | | |
| | | |
| | | public void setCreateUpdateTime(){ |
| | | Date now = DateUtil.now(); |
| | | if (this.getId()== null) { |
| | | this.createTime = now; |
| | | } |
| | | this.updateTime = now; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.DO; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工工序角色配置通用表 |
| | | * </p> |
| | | * |
| | | * @author 龚丽龙 |
| | | * @since 2024-06-13 15:46:18 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("SG_GX_CONFIG") |
| | | public class SgGxRoleDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 工序类型 |
| | | */ |
| | | private String gxDeviceType; |
| | | |
| | | /** |
| | | * 工序步骤名称 |
| | | */ |
| | | private String gxStepId; |
| | | |
| | | /** |
| | | * 角色id |
| | | */ |
| | | private String roleId; |
| | | |
| | | /** |
| | | * 角色审核顺序 |
| | | */ |
| | | private Integer sgOrder; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.DO; |
| | | |
| | | 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 lombok.*; |
| | | import org.springblade.core.mp.base.BaseEntity; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工工序步骤表 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-13 15:46:18 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("SG_GX_STEP") |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @Builder |
| | | public class SgGxStepDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 工序编号 |
| | | */ |
| | | private String gxStepNum; |
| | | |
| | | /** |
| | | * 工序步骤名称 |
| | | */ |
| | | private String gxStepName; |
| | | |
| | | /** |
| | | * 工序基础信息id |
| | | */ |
| | | private Long gxInfoId; |
| | | |
| | | /** |
| | | * 介绍 |
| | | */ |
| | | private String remark; |
| | | |
| | | @TableField(exist = false) |
| | | private Integer approvalStatus; |
| | | |
| | | @TableField(exist = false) |
| | | private Long deviceId; |
| | | |
| | | @TableField(exist = false) |
| | | private String gxType; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.DO; |
| | | |
| | | 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 lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工进度上报表 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-15 10:22:08 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("SG_PROGRESS_REPORT") |
| | | public class SgProgressReportDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 项目id |
| | | */ |
| | | private Long proframId; |
| | | |
| | | /** |
| | | * 项目名称 |
| | | */ |
| | | private String programName; |
| | | |
| | | /** |
| | | * 工序步骤id |
| | | */ |
| | | private Long gxStepId; |
| | | |
| | | /** |
| | | * 工序步骤名称 |
| | | */ |
| | | private String gxStepName; |
| | | |
| | | /** |
| | | * 上报时间 |
| | | */ |
| | | private Date reportTime; |
| | | |
| | | /** |
| | | * 施工工序进度 |
| | | */ |
| | | private String gxProgress; |
| | | |
| | | /** |
| | | * 施工情况 |
| | | */ |
| | | private String remark; |
| | | |
| | | /** |
| | | * 施工工序状态(0待审核 1进行中,2已完成) |
| | | */ |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 施工设备ID |
| | | */ |
| | | private Long gxDeviceId; |
| | | @TableField(exist = false) |
| | | private String deviceName; |
| | | |
| | | @TableField(exist = false) |
| | | private String deviceType; |
| | | |
| | | @TableField(exist = false) |
| | | private String typeName; |
| | | |
| | | /** |
| | | * 上报人 |
| | | */ |
| | | private Long reportUser; |
| | | |
| | | /** |
| | | * 图片附件 |
| | | */ |
| | | private String imagesUrls; |
| | | |
| | | /** |
| | | * 视频附件 |
| | | */ |
| | | private String videoUrls; |
| | | |
| | | /** |
| | | * 审核意见 |
| | | */ |
| | | private String auditOpinion; |
| | | |
| | | /** |
| | | * 审核人 |
| | | */ |
| | | private String auditPerson; |
| | | |
| | | /** |
| | | * 关联设备 |
| | | */ |
| | | @TableField(exist = false) |
| | | private List<SgGxDO> sgGxDOS; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.DO; |
| | | |
| | | import cn.gistack.sm.sg.VO.PreAcceVO; |
| | | import cn.gistack.sm.sg.VO.SgTypeVO; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工项目表 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-13 11:51:20 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("SG_PROJECT_INFO") |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @Builder |
| | | public class SgProjectInfoDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private Long id; |
| | | |
| | | /** |
| | | * 项目名称 |
| | | */ |
| | | private String projectName; |
| | | |
| | | /** |
| | | * 项目编号 |
| | | */ |
| | | private String projectCode; |
| | | |
| | | /** |
| | | * 所属标段 |
| | | */ |
| | | private String inspectionPerson; |
| | | |
| | | /** |
| | | * 建设期次 |
| | | */ |
| | | private String buildStage; |
| | | |
| | | /** |
| | | * 项目地址 |
| | | */ |
| | | private String projectAddress; |
| | | |
| | | /** |
| | | * 备案号 |
| | | */ |
| | | private String filingCode; |
| | | |
| | | /** |
| | | * 经纬度 |
| | | */ |
| | | private String lonLat; |
| | | |
| | | /** |
| | | * 维护负责人 |
| | | */ |
| | | private String responsiblePerson; |
| | | |
| | | /** |
| | | * 昨程方式 |
| | | */ |
| | | private String remoteMethod; |
| | | |
| | | /** |
| | | * 注册到期时间 |
| | | */ |
| | | private String expTime; |
| | | |
| | | /** |
| | | * 总承包 |
| | | */ |
| | | private String generalContract; |
| | | |
| | | /** |
| | | * 总承包责任人 |
| | | */ |
| | | private String generalPerson; |
| | | |
| | | /** |
| | | * 设计单位 |
| | | */ |
| | | private String designUnit; |
| | | |
| | | /** |
| | | * 设计单位责任人 |
| | | */ |
| | | private String designPerson; |
| | | |
| | | /** |
| | | * 监理单位 |
| | | */ |
| | | private String controlUnit; |
| | | |
| | | /** |
| | | * 监理单位责任人 |
| | | */ |
| | | private String controlPerson; |
| | | |
| | | /** |
| | | * 施工单位 |
| | | */ |
| | | private String constructionUnit; |
| | | |
| | | /** |
| | | * 施工单位责任人 |
| | | */ |
| | | private String constructionPerson; |
| | | |
| | | /** |
| | | * 施工自检单位 |
| | | */ |
| | | private String selfUnit; |
| | | |
| | | /** |
| | | * 施工自检单位责任人 |
| | | */ |
| | | private String selfPerson; |
| | | |
| | | /** |
| | | * 竣工验收检测单位 |
| | | */ |
| | | private String acceptanceUnit; |
| | | |
| | | /** |
| | | * 竣工验收检测单位责任人 |
| | | */ |
| | | private String acceptancePerson; |
| | | |
| | | /** |
| | | * 水库ID |
| | | */ |
| | | private String skId; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | private Long createUser; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private String createTime; |
| | | |
| | | /** |
| | | * 修改人 |
| | | */ |
| | | private Long updateUser; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | private String updateTime; |
| | | |
| | | /** |
| | | * 水库名 |
| | | */ |
| | | private String skName; |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | private List<SgTypeVO> sgGxDOS; |
| | | @TableField(exist = false) |
| | | private List<PreAcceVO> preAcce; |
| | | |
| | | |
| | | |
| | | private Integer status; |
| | | |
| | | @TableField(exist = false) |
| | | private String projectProgress; |
| | | |
| | | @TableField(exist = false) |
| | | private BigDecimal ProjectProgressNum; |
| | | @TableField(exist = false) |
| | | private String cityNm; //市 |
| | | @TableField(exist = false) |
| | | private String countyNm; //县 |
| | | @TableField(exist = false) |
| | | private String townNm; //乡 |
| | | @TableField(exist = false) |
| | | private String engScal; //工程规模 |
| | | @TableField(exist = false) |
| | | private String basGuid; //片区 |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.DO; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工项目人员配置表 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-15 11:45:35 |
| | | */ |
| | | |
| | | @TableName("SG_PROJECT_PERSON_CONFIG") |
| | | @Data |
| | | public class SgProjectPersonConfigDO { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 项目id |
| | | */ |
| | | private Long programId; |
| | | |
| | | /** |
| | | * 角色id |
| | | */ |
| | | private Long roldId; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Long userId; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.DO; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class SgProjectRolePersonV0 { |
| | | private Long id; |
| | | private Long projectId; |
| | | private String projectName; |
| | | private String roleId; |
| | | private String roleName; |
| | | private String userId; |
| | | private String userName; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.DO; |
| | | |
| | | 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 lombok.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 审批报告人 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-15 14:57:55 |
| | | */ |
| | | @Data |
| | | @TableName("SG_REPORT_USER") |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @Builder |
| | | public class SgReportUserDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 报告ID |
| | | */ |
| | | private Long reportId; |
| | | |
| | | /** |
| | | * 用户ID |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 审批状态 0未审批 1通过,2驳回 |
| | | */ |
| | | private Integer approvalStatus; |
| | | |
| | | /** |
| | | * 审批内容 |
| | | */ |
| | | private String approvalContent; |
| | | |
| | | /** |
| | | * 审批时间 |
| | | */ |
| | | private Date approvalTime; |
| | | |
| | | /** |
| | | * 审批顺序 |
| | | */ |
| | | private Integer approvalOrder; |
| | | |
| | | /** |
| | | * 审批顺序 |
| | | */ |
| | | private Integer isHis; |
| | | @TableField(exist = false) |
| | | private String userName; |
| | | |
| | | @TableField(exist = false) |
| | | private String deptName; |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.DTO; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgProjectPersonConfigDO; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class AddSgProjectPersonConfigDTO { |
| | | private List<SgProjectPersonConfigDO> data; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.DTO; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ApprovalDTO { |
| | | private Long id; |
| | | /** |
| | | * 审批状态 1通过 , 2驳回 |
| | | */ |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 审批意见 |
| | | */ |
| | | private String approvalContent; |
| | | |
| | | /** |
| | | * 审核人 |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 0普通审批 1管理员一键驳回 |
| | | */ |
| | | private Integer isReject; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.DTO; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 查询类 |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @Builder |
| | | public class ProjectSearchDTO { |
| | | private String projectName; |
| | | private String adCode; |
| | | private String deviceName; |
| | | private String skName; |
| | | private String gxType; |
| | | private String gxName; |
| | | private String createUser; |
| | | private Long userId; |
| | | private String gxInfoId; |
| | | private String gxStepNum; |
| | | private String projectId; |
| | | private Integer approvalStatus; |
| | | private Integer status; |
| | | private Long reportPerson; |
| | | private List<Long> projectIds; |
| | | private String startTime; |
| | | private String endTime; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.DTO; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 施工设备查询类 |
| | | */ |
| | | @Data |
| | | public class SgDeviceSearchDTO { |
| | | private String deviceName; |
| | | private String deviceType; |
| | | private String projectName; |
| | | private String projectId; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.VO; |
| | | |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @Builder |
| | | public class PreAcceVO { |
| | | |
| | | //记录id |
| | | private String id; |
| | | |
| | | |
| | | //工序名称 |
| | | private String name; |
| | | |
| | | //工序状态 |
| | | private Long status; |
| | | |
| | | //项目id |
| | | private Long programId; |
| | | |
| | | //工序id |
| | | private Long gxStepId; |
| | | |
| | | //设备id |
| | | private Long gxDeviceId; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.VO; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工工序角色配置通用表 |
| | | * </p> |
| | | * |
| | | * @author 龚丽龙 |
| | | * @since 2024-06-13 15:46:18 |
| | | */ |
| | | @Data |
| | | public class SgGxRoleVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | /** |
| | | * 工序类型 |
| | | */ |
| | | private String gxDeviceType; |
| | | |
| | | /** |
| | | * 工序步骤名称 |
| | | */ |
| | | private String gxStepId; |
| | | |
| | | /** |
| | | * 角色id |
| | | */ |
| | | private List<String> roleIds; |
| | | |
| | | /** |
| | | * 角色审核顺序 |
| | | */ |
| | | private List<Integer> orders; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.VO; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgGxDO; |
| | | import cn.gistack.sm.sg.DO.SgGxStepDO; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class SgGxVO extends SgGxDO { |
| | | private List<SgGxStepDO> stepDOList; |
| | | private Integer gxStepCount; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.VO; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgProgressReportDO; |
| | | import cn.gistack.sm.sg.DO.SgReportUserDO; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class SgProgressReportVO extends SgProgressReportDO { |
| | | /** |
| | | * 各级审批流程 |
| | | */ |
| | | private List<SgReportUserDO> sgReportUserDOS; |
| | | /** |
| | | * 同设备流程审批情况 |
| | | */ |
| | | private List<SgStepReportVO> sgStepReportVOS; |
| | | |
| | | private Integer approvalStatus; |
| | | |
| | | private String stepRemark; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.VO; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgDeviceDO; |
| | | import cn.gistack.sm.sg.DO.SgGxDO; |
| | | import cn.gistack.sm.sg.DO.SgGxStepDO; |
| | | import cn.gistack.sm.sg.DO.SgProjectInfoDO; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class SgProjectInfoVO extends SgProjectInfoDO { |
| | | private Long id; |
| | | private String projectName; |
| | | private Long gxId; |
| | | private String gxName; |
| | | private String deviceName; |
| | | private Long dId; |
| | | private Long reportId; |
| | | private Long stepId; |
| | | private String gxStepName; |
| | | private Integer reportStatus; |
| | | private String gxStepNum; |
| | | private String deviceType; |
| | | private String typeName; |
| | | private Integer deviceStatus; |
| | | private Integer projectStatus; |
| | | private String progressName; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.VO; |
| | | |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class SgReportVO { |
| | | |
| | | private Long proframId; |
| | | |
| | | private Long gxDeviceId; |
| | | |
| | | private Long gxStepId; |
| | | |
| | | private Long id; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.VO; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class SgStatisProVO { |
| | | |
| | | private String pcode; |
| | | |
| | | private String pname; |
| | | |
| | | private String code; |
| | | |
| | | private String adGrad; |
| | | |
| | | private String name; |
| | | |
| | | private int projectSum; |
| | | |
| | | private int commenceNum; |
| | | |
| | | private String projectProgress; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| New file |
| | |
| | | package cn.gistack.sm.sg.VO; |
| | | |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class SgStatistccVO { |
| | | |
| | | private String typeName; |
| | | |
| | | private String code;//设备代码 |
| | | |
| | | private int deviceNum; |
| | | |
| | | private String typeProgress; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.VO; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class SgStatisticsVO { |
| | | |
| | | private String projectSum;//总数 |
| | | |
| | | private String noCommenceNum;//未开工 |
| | | |
| | | private String commenceNum;//开工数 |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.VO; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class SgStepReportVO { |
| | | private Long stepId; |
| | | private String stepName; |
| | | private Integer approvalStatus; |
| | | private String stepNum; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date reportTime; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.VO; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgDeviceDO; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @Builder |
| | | public class SgTypeVO { |
| | | private String typeName; |
| | | private String typeProgress; |
| | | private List<SgDeviceDO> deviceDOS; |
| | | } |
| | |
| | | |
| | | /** |
| | | * 责任人类型 |
| | | * 1.政府行政责任人,2.主管部门责任人,3.管理单位责任人,4.技术责任人,5.巡查责任人,6.行政责任人 |
| | | */ |
| | | @ApiModelProperty(value = "责任人类型") |
| | | @TableField("\"type\"") |
| | |
| | | package cn.gistack.sm.sjztmd.feign; |
| | | |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.core.io.InputStreamResource; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.text.ParseException; |
| | | import java.util.List; |
| | | |
| | | @FeignClient( |
| | | value = "blade-sm", |
| | |
| | | |
| | | String GENERATE_DAY_REPORT_FLOOD = API_PREFIX + "generateDayReportFlood"; |
| | | |
| | | String GET_RESERVOIR_RAINFALL_FORECAST = API_PREFIX + "/getReservoirRainfallForecast"; |
| | | |
| | | //保存昨日报汛内容 |
| | | String SAVE_YESTERDAY_FLOOD_REPORT_CONTENT = API_PREFIX + "/saveYesterdayFloodReportContent"; |
| | | |
| | | String GET_PROJECT_CHECK_STATUS = API_PREFIX + "/updateProjectCheckStatus"; |
| | | |
| | | @GetMapping(GENERATE_DAY_REPORT_FLOOD) |
| | | String generateDayReportFlood(@RequestParam("isShow") String isShow) throws Exception; |
| | | |
| | | @GetMapping(SAVE_YESTERDAY_FLOOD_REPORT_CONTENT) |
| | | String saveYesterdayFloodReportContent(@RequestParam("isShow") String isShow) throws Exception; |
| | | |
| | | |
| | | @GetMapping(GET_RESERVOIR_RAINFALL_FORECAST) |
| | | void getReservoirRainfallForecast(@RequestParam("dayIndexList") List<String> dayIndexList) throws Exception; |
| | | |
| | | @GetMapping(GET_PROJECT_CHECK_STATUS) |
| | | void setGetProjectCheckStatus() throws Exception; |
| | | |
| | | } |
| | |
| | | public String generateDayReportFlood(String isShow) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public void getReservoirRainfallForecast(List<String> dayIndexList) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void setGetProjectCheckStatus() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public String saveYesterdayFloodReportContent(String isShow) throws Exception { |
| | | return null; |
| | | } |
| | | } |
| | |
| | | <artifactId>skjcmanager-resource-api</artifactId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.oracle.database.jdbc</groupId> |
| | | <artifactId>ojdbc8</artifactId> |
| | | <version>19.23.0.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.oracle.database.nls</groupId> |
| | | <artifactId>orai18n</artifactId> |
| | | <version>19.23.0.0</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| New file |
| | |
| | | package cn.gistack.alerts.alarmRule.DTO; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import org.checkerframework.checker.units.qual.A; |
| | | |
| | | /** |
| | | * 水量预警查询实体类 |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @Builder |
| | | public class WaterQueryDTO { |
| | | private String tsEdTm; |
| | | private String flag; |
| | | private String wiustTp; |
| | | private String tsBgTm; |
| | | private String tradTp; |
| | | private String wiuNm; |
| | | private String adlCd; |
| | | |
| | | } |
| | |
| | | return R.data(alarmRecordService.statisticAlarmRecord(alarmRecord)); |
| | | } |
| | | |
| | | /** |
| | | * 告警统计按告警分类-等级统计 |
| | | * @param alarmRecord |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="告警记录-告警统计按告警分类-等级统计", notes="告警记录-告警统计按告警分类-等级统计") |
| | | @GetMapping(value = "/statisticAlaByTypeAndLev") |
| | | public R statisticAlaByTypeAndLev(AlarmRecordVO alarmRecord) { |
| | | return R.data(alarmRecordService.statisticAlaByTypeAndLev(alarmRecord)); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.alerts.alarmRule.controller; |
| | | |
| | | import cn.gistack.alerts.alarmRule.service.FsRAtmtnFrcstService; |
| | | import cn.gistack.alerts.alarmRule.vo.AlarmRecordVO; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * 预警信息控制层 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/fsratmtnfrcst") |
| | | public class FsRAtmtnFrcstController { |
| | | @Autowired |
| | | private FsRAtmtnFrcstService fsRAtmtnFrcstService; |
| | | |
| | | /** |
| | | * 预告列表 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="告警记录-自定义分页列表查询", notes="告警记录-自定义分页列表查询") |
| | | @GetMapping(value = "/get_atmtnInfo") |
| | | public R getAtmtnInfo(String STCM,Integer type) { |
| | | return R.data(fsRAtmtnFrcstService.getAtmtnInfo(STCM,type)); |
| | | } |
| | | |
| | | /** |
| | | * 预告统计 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="告警记录-预告统计", notes="告警记录-预告统计") |
| | | @GetMapping(value = "/count_atmtnInfo") |
| | | public R countAtmtnInfo() { |
| | | return R.data(fsRAtmtnFrcstService.countAtmtnInfo()); |
| | | } |
| | | |
| | | /** |
| | | * 预警数量统计-所有类型统计 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="预警数量统计-所有类型统计", notes="预警数量统计-所有类型统计") |
| | | @GetMapping(value = "/warning_statistics") |
| | | public R warningStatistics( ) { |
| | | return R.data(fsRAtmtnFrcstService.warningStatistics()); |
| | | } |
| | | |
| | | /** |
| | | * 预警数量统计-水库统计 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="预警数量统计", notes="预警数量统计") |
| | | @GetMapping(value = "/warning_statistics_sk") |
| | | public R warningStatisticsSK( ) { |
| | | return R.data(fsRAtmtnFrcstService.warningStatisticsSK()); |
| | | } |
| | | |
| | | /** |
| | | * 预警数量统计-水文统计 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="预警数量统计", notes="预警数量统计") |
| | | @GetMapping(value = "/warning_statistics_sw") |
| | | public R warningStatisticsSW( ) { |
| | | return R.data(fsRAtmtnFrcstService.warningStatisticsSW()); |
| | | } |
| | | |
| | | /** |
| | | * 预警数量统计-山洪统计 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="预警数量统计", notes="预警数量统计") |
| | | @GetMapping(value = "/warning_statistics_sh") |
| | | public R warningStatisticsSH( ) { |
| | | return R.data(fsRAtmtnFrcstService.warningStatisticsSH()); |
| | | } |
| | | |
| | | /** |
| | | * 预警数量统计-水资源统计 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="预警数量统计", notes="预警数量统计") |
| | | @GetMapping(value = "/warning_statistics_szy") |
| | | public R warningStatisticsSZY( ) { |
| | | return R.data(fsRAtmtnFrcstService.warningStatisticsSZY()); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | List<StatisticAlarmRecord> statisticsPie(@Param("alarmRecord") AlarmRecordVO alarmRecordVO); |
| | | |
| | | /** |
| | | * 告警统计按告警分类-等级统计 |
| | | * @param alarmRecord |
| | | * @return |
| | | */ |
| | | List<StatisticAlarmRecord> statisticAlaByTypeAndLev(@Param("alarmRecord") AlarmRecordVO alarmRecord); |
| | | } |
| | |
| | | and sar.create_time <= #{alarmRecord.endTime} |
| | | </if> |
| | | <if test="alarmRecord.adCode!=null and alarmRecord.adCode!=''"> |
| | | and a."interior_ad_guid" like concat('%',#{alarmRecord.adCode},'%') |
| | | and concat(a."interior_ad_guid",b."guid",c."guid",d."guid") like concat('%',#{alarmRecord.adCode},'%') |
| | | </if> |
| | | <if test="alarmRecord.alarmLevel != null and alarmRecord.alarmLevel !=''"> |
| | | and sar1.alarm_level = #{alarmRecord.alarmLevel} |
| | |
| | | order by field(rule.alarm_level,'蓝色预警','黄色预警','橙色预警','红色预警') |
| | | </select> |
| | | |
| | | <!--告警统计按告警分类-等级统计--> |
| | | <select id="statisticAlaByTypeAndLev" resultType="cn.gistack.alerts.alarmRule.vo.StatisticAlarmRecord"> |
| | | SELECT |
| | | count(*) num,type as ruleName,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 |
| | | LEFT JOIN SJZT_MD."rel_res_bas_loc" rrbl ON rrbl."res_guid" = record.reservoir_number |
| | | LEFT JOIN SJZT_MD."att_bas_base" abb ON abb."code" = rrbl."bas_guid" |
| | | LEFT JOIN SJZT_MD."att_bas_base" pabb ON abb."p_code" = pabb."code" |
| | | where |
| | | record.is_deleted = 0 |
| | | and rule.type in ('渗压监测','渗流监测','变形监测','水情监测','雨情监测') |
| | | <if test="alarmRecord.reservoirName!=null and alarmRecord.reservoirName!=''"> |
| | | and arb."name" like concat('%',#{alarmRecord.reservoirName},'%') |
| | | </if> |
| | | <if test="alarmRecord.alarmRuleType!=null and alarmRecord.alarmRuleType!=''"> |
| | | and rule.alarm_rule_type = #{alarmRecord.alarmRuleType} |
| | | </if> |
| | | <if test="alarmRecord.createAlarmType!=null and alarmRecord.createAlarmType!=''"> |
| | | and rule.create_alarm_type = #{alarmRecord.createAlarmType} |
| | | </if> |
| | | <if test="alarmRecord.ruleName!=null and alarmRecord.ruleName!=''"> |
| | | and rule.rule_name = #{alarmRecord.ruleName} |
| | | </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.resGuids != null and alarmRecord.resGuids !=''"> |
| | | AND record.reservoir_number in |
| | | <foreach collection="alarmRecord.resGuids.split(',')" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | group by type,rule.alarm_level |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.alerts.alarmRule.mapper; |
| | | |
| | | import cn.gistack.alerts.alarmRule.entity.AlarmRecordDetail; |
| | | import cn.gistack.alerts.alarmRule.vo.AlarmRecordVO; |
| | | import cn.gistack.alerts.alarmRule.vo.FsRAtmtnFrcstInfVO; |
| | | import cn.gistack.alerts.alarmRule.vo.StStbprpBVO; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import lombok.Data; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | public interface FsRAtmtnFrcstInfMapper extends BaseMapper<AlarmRecordDetail> { |
| | | @DS("swyj") |
| | | List<FsRAtmtnFrcstInfVO> getAtmtnInfo(@Param("type") Integer type,@Param("stcds") List<String> stcds); |
| | | @DS("swyj") |
| | | List<FsRAtmtnFrcstInfVO> getAtmtnInfo1(@Param("type") Integer type,@Param("stcds") List<String> stcds); |
| | | @DS("zdsw") |
| | | List<StStbprpBVO> getStationInfo(@Param("stcds") List<String> stcDs); |
| | | @DS("zdsw") |
| | | List<String> getStcdS(@Param("STCM") String stcm); |
| | | } |
| 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.alerts.alarmRule.mapper.FsRAtmtnFrcstInfMapper"> |
| | | |
| | | <select id="getAtmtnInfo" resultType="cn.gistack.alerts.alarmRule.vo.FsRAtmtnFrcstInfVO"> |
| | | SELECT |
| | | inf.FRCST_CD as frcstCd, |
| | | inf.STCD, |
| | | inf.FRCST_TM as frcstTm, |
| | | inf.PBLSH_TM as pblshTm, |
| | | inf.CNDTN , |
| | | inf.FRCST_USR_NM as frcstUsrNm, |
| | | inf.PBLSH_UNT as pblshUnt, |
| | | inf.PBLSH_TYP as pblshTyp, |
| | | dt.TM, |
| | | NVL( dt.Z, 0 ) AS TZ, |
| | | NVL( dt.Q, 0 ) AS TQ |
| | | FROM |
| | | FRCST_SYS.FS_R_ATMTN_FRCST_DT dt |
| | | LEFT JOIN FRCST_SYS.FS_R_ATMTN_FRCST_INF inf ON dt.FRCST_CD = inf.FRCST_CD |
| | | WHERE |
| | | dt.TM BETWEEN SYSDATE |
| | | AND SYSDATE + 3 |
| | | <if test="stcds != null and stcds.size()>0"> |
| | | AND inf.STCD in |
| | | <foreach collection="stcds" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ORDER BY |
| | | dt.TM DESC |
| | | </select> |
| | | <select id="getAtmtnInfo1" resultType="cn.gistack.alerts.alarmRule.vo.FsRAtmtnFrcstInfVO"> |
| | | SELECT |
| | | inf.FRCST_CD, |
| | | inf.STCD, |
| | | inf.FRCST_TM, |
| | | inf.PBLSH_TM, |
| | | inf.CNDTN, |
| | | inf.FRCST_USR_NM, |
| | | inf.PBLSH_UNT, |
| | | inf.PBLSH_TYP, |
| | | dt.TM, |
| | | NVL( dt.Z, 0 ) AS TZ, |
| | | NVL( dt.Q, 0 ) AS TQ, |
| | | fl.FZ, |
| | | fl.FZTM, |
| | | fl.FQ, |
| | | fl.FQTM, |
| | | fl.RUNOFF, |
| | | fl.CTM, |
| | | fl.RF |
| | | FROM |
| | | FRCST_SYS.FS_R_ATMTN_FRCST_FLOODDT dt |
| | | LEFT JOIN FRCST_SYS.FS_R_ATMTN_FRCST_INF inf ON dt.FRCST_CD = inf.FRCST_CD |
| | | LEFT JOIN FRCST_SYS.FS_R_ATMTN_FRCST_FLOOD fl ON dt.FRCST_CD = fl.FRCST_CD |
| | | WHERE |
| | | dt.TM BETWEEN SYSDATE |
| | | AND SYSDATE + 3 |
| | | <if test="stcds != null and stcds.size()>0"> |
| | | AND inf.STCD in |
| | | <foreach collection="stcds" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ORDER BY |
| | | dt.TM DESC |
| | | </select> |
| | | |
| | | <resultMap id="resultMap" type="cn.gistack.alerts.alarmRule.vo.FsRAtmtnFrcstInfVO"> |
| | | <id column="FRCST_CD" property="FRCST_CD"/> |
| | | <result column="FRCST_CD" property="FRCST_CD"/> |
| | | <result column="STCD" property="STCD"/> |
| | | <result column="FRCST_USR_ID" property="FRCST_USR_ID"/> |
| | | <result column="FRCST_USR_NM" property="FRCST_USR_NM"/> |
| | | <result column="PBLSH_UNT" property="PBLSH_UNT"/> |
| | | <result column="PBLSH_TYP" property="PBLSH_TYP"/> |
| | | <result column="CNDTN" property="CNDTN"/> |
| | | <result column="FRCST_TM" property="FRCST_TM"/> |
| | | <result column="PBLSH_TM" property="PBLSH_TM"/> |
| | | <result column="PBLSH_ID" property="PBLSH_ID"/> |
| | | |
| | | <result column="FZ" property="FZ"/> |
| | | <result column="FZTM" property="FZTM"/> |
| | | <result column="FQ" property="FQ"/> |
| | | <result column="FQTM" property="FQTM"/> |
| | | <result column="RUNOFF" property="RUNOFF"/> |
| | | <result column="CTM" property="CTM"/> |
| | | <result column="RF" property="RF"/> |
| | | <!-- <collection property="frcstDtVOS" ofType="cn.gistack.alerts.alarmRule.vo.FsRAtmtnFrcstDtVO" >--> |
| | | <!-- <id property="FRCST_CD" column="FRCST_CD"/>--> |
| | | <!-- <result column="TM" property="TM"/>--> |
| | | <!-- <result column="TZ" property="TZ"/>--> |
| | | <!-- <result column="TQ" property="TQ"/>--> |
| | | <!-- </collection>--> |
| | | <collection property="frcstDtVOS" ofType="cn.gistack.alerts.alarmRule.vo.FsRAtmtnFrcstDtVO" column="FRCST_CD" select="getFsRAtmtnFrcstDtVOs"/> |
| | | </resultMap> |
| | | |
| | | <select id="getFsRAtmtnFrcstDtVOs" resultType="cn.gistack.alerts.alarmRule.vo.FsRAtmtnFrcstDtVO"> |
| | | select dt.TM, NVL(dt.Z,0) AS TZ, NVL(dt.Q,0) AS TQ from FRCST_SYS.FS_R_ATMTN_FRCST_FLOODDT dt where dt.FRCST_CD = #{FRCST_CD} |
| | | </select> |
| | | <select id="getStationInfo" resultType="cn.gistack.alerts.alarmRule.vo.StStbprpBVO"> |
| | | SELECT |
| | | b.STCD, |
| | | b.STNM, |
| | | b.RVNM, |
| | | NVL( rb.WRZ, 0 ) AS WRZ, |
| | | NVL( rb.GRZ, 0 ) AS GRZ, |
| | | NVL( srb.FSLTDZ, 0 )AS FSLTDZ , |
| | | NVL( chb.DSFLZ, 0 ) AS SFLZ |
| | | FROM |
| | | RWDBSYSDBA.ST_STBPRP_B b |
| | | LEFT JOIN RWDBSYSDBA.ST_RVFCCH_B rb ON b.STCD = rb.STCD |
| | | LEFT JOIN RWDBSYSDBA.ST_RSVRFSR_B srb ON b.STCD = srb.STCD |
| | | LEFT JOIN RWDBSYSDBA.ST_RSVRFCCH_B chb ON b.STCD = chb.STCD |
| | | where 1=1 |
| | | <if test="stcds != null and stcds.size()>0"> |
| | | AND b.STCD in |
| | | <foreach collection="stcds" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | <select id="getStcdS" resultType="java.lang.String"> |
| | | SELECT |
| | | b.STCD |
| | | FROM |
| | | RWDBSYSDBA.ST_STBPRP_B b where 1=1 |
| | | <if test="STCM != null and STCM != ''"> |
| | | and b.STNM LIKE '%${STCM}%' ; |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | Boolean updateStatus(AlarmRecord alarmRecord); |
| | | |
| | | Object statisticsPie(AlarmRecordVO alarmRecordVO); |
| | | |
| | | /** |
| | | * 告警统计按告警分类-等级统计 |
| | | * @param alarmRecord |
| | | * @return |
| | | */ |
| | | Object statisticAlaByTypeAndLev(AlarmRecordVO alarmRecord); |
| | | } |
| New file |
| | |
| | | package cn.gistack.alerts.alarmRule.service; |
| | | |
| | | import cn.gistack.alerts.alarmRule.vo.AlarmRecordVO; |
| | | import cn.gistack.alerts.alarmRule.vo.FsRAtmtnFrcstInfVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface FsRAtmtnFrcstService { |
| | | Object getAtmtnInfo(String STCM,Integer type); |
| | | |
| | | Object warningStatistics(); |
| | | |
| | | Object warningStatisticsSK(); |
| | | |
| | | Object warningStatisticsSW(); |
| | | |
| | | Object warningStatisticsSH(); |
| | | |
| | | Object warningStatisticsSZY(); |
| | | |
| | | Object countAtmtnInfo(); |
| | | |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public Object selectAlarmRecordPage(IPage<AlarmRecordVO> page, AlarmRecordVO alarmRecord) { |
| | | if (!Strings.isBlank(alarmRecord.getAdCode())){ |
| | | alarmRecord.setAdCode(alarmRecord.getAdCode().replaceAll("0+$", "")); |
| | | } |
| | | // if (!Strings.isBlank(alarmRecord.getAdCode())){ |
| | | // alarmRecord.setAdCode(alarmRecord.getAdCode().replaceAll("0+$", "")); |
| | | // } |
| | | if (null != alarmRecord.getIsExport()){ |
| | | return baseMapper.selectAlarmRecordPage(null,alarmRecord); |
| | | } |
| | |
| | | List<StatisticAlarmRecord> list = baseMapper.statisticsPie(alarmRecordVO); |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 告警统计按告警分类-等级统计 |
| | | * @param alarmRecord |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Object statisticAlaByTypeAndLev(AlarmRecordVO alarmRecord) { |
| | | Map<String, Object> map = new HashMap<>(4); |
| | | List<StatisticAlarmRecord> recordList = baseMapper.statisticAlaByTypeAndLev(alarmRecord); |
| | | if (recordList.size()>0){ |
| | | map.put("水情监测",setAlaStatisticListByData(recordList,"水情监测")); |
| | | map.put("雨情监测",setAlaStatisticListByData(recordList,"雨情监测")); |
| | | map.put("渗压监测",setAlaStatisticListByData(recordList,"渗压监测")); |
| | | map.put("渗流监测",setAlaStatisticListByData(recordList,"渗流监测")); |
| | | map.put("变形监测",setAlaStatisticListByData(recordList,"变形监测")); |
| | | }else { |
| | | map.put("水情监测",setAlaStatisticList()); |
| | | map.put("雨情监测",setAlaStatisticList()); |
| | | map.put("渗压监测",setAlaStatisticList()); |
| | | map.put("渗流监测",setAlaStatisticList()); |
| | | map.put("变形监测",setAlaStatisticList()); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 设置组装预警统计数据-带参数 |
| | | * @return |
| | | */ |
| | | private List<StatisticAlarmRecord> setAlaStatisticListByData(List<StatisticAlarmRecord> recordList, String typeName) { |
| | | List<StatisticAlarmRecord> list = new ArrayList<>(); |
| | | List<String> levelList = new ArrayList<>(){{ |
| | | add("蓝色预警"); |
| | | add("黄色预警"); |
| | | add("橙色预警"); |
| | | add("红色预警"); |
| | | }}; |
| | | List<String> alarmLevelList = recordList.stream() |
| | | .filter(a -> a.getRuleName().equals(typeName)) |
| | | .map(StatisticAlarmRecord::getAlarmLevel) |
| | | .distinct() |
| | | .collect(Collectors.toList()); |
| | | // 先取差集 |
| | | List<String> diffList = levelList.stream().filter(item -> !alarmLevelList.contains(item)).collect(Collectors.toList()); |
| | | for (StatisticAlarmRecord alarmRecord : recordList) { |
| | | if (alarmRecord.getRuleName().equals(typeName)){ |
| | | StatisticAlarmRecord statisticAlarmRecord = new StatisticAlarmRecord(); |
| | | statisticAlarmRecord.setAlarmLevel(alarmRecord.getAlarmLevel()); |
| | | statisticAlarmRecord.setNum(alarmRecord.getNum()); |
| | | list.add(statisticAlarmRecord); |
| | | } |
| | | } |
| | | if (diffList.size()>0){ |
| | | for (String level : diffList) { |
| | | StatisticAlarmRecord statisticAlarmRecord = new StatisticAlarmRecord(); |
| | | statisticAlarmRecord.setAlarmLevel(level); |
| | | statisticAlarmRecord.setNum(0); |
| | | list.add(statisticAlarmRecord); |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 设置组装预警统计数据 |
| | | * @return |
| | | */ |
| | | private List<StatisticAlarmRecord> setAlaStatisticList() { |
| | | List<StatisticAlarmRecord> list = new ArrayList<>(); |
| | | StatisticAlarmRecord statisticAlarmRecord1 = new StatisticAlarmRecord(); |
| | | statisticAlarmRecord1.setAlarmLevel("蓝色预警"); |
| | | statisticAlarmRecord1.setNum(0); |
| | | |
| | | StatisticAlarmRecord statisticAlarmRecord2 = new StatisticAlarmRecord(); |
| | | statisticAlarmRecord2.setAlarmLevel("黄色预警"); |
| | | statisticAlarmRecord2.setNum(0); |
| | | |
| | | StatisticAlarmRecord statisticAlarmRecord3 = new StatisticAlarmRecord(); |
| | | statisticAlarmRecord3.setAlarmLevel("橙色预警"); |
| | | statisticAlarmRecord3.setNum(0); |
| | | |
| | | StatisticAlarmRecord statisticAlarmRecord4 = new StatisticAlarmRecord(); |
| | | statisticAlarmRecord4.setAlarmLevel("红色预警"); |
| | | statisticAlarmRecord4.setNum(0); |
| | | |
| | | list.add(statisticAlarmRecord1); |
| | | list.add(statisticAlarmRecord2); |
| | | list.add(statisticAlarmRecord3); |
| | | list.add(statisticAlarmRecord4); |
| | | return list; |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.alerts.alarmRule.service.impl; |
| | | |
| | | import cn.gistack.alerts.alarmRule.DTO.WaterQueryDTO; |
| | | import cn.gistack.alerts.alarmRule.entity.FsRAtmtnFrcstInf; |
| | | import cn.gistack.alerts.alarmRule.mapper.FsRAtmtnFrcstInfMapper; |
| | | import cn.gistack.alerts.alarmRule.service.FsRAtmtnFrcstService; |
| | | import cn.gistack.alerts.alarmRule.vo.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.JsonNode; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StopWatch; |
| | | |
| | | import java.io.InputStream; |
| | | import java.net.URI; |
| | | import java.net.http.HttpClient; |
| | | import java.net.http.HttpRequest; |
| | | import java.net.http.HttpResponse; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.Duration; |
| | | import java.time.Instant; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | @Slf4j |
| | | public class FsRAtmtnFrcstServiceImpl implements FsRAtmtnFrcstService { |
| | | @Autowired |
| | | private FsRAtmtnFrcstInfMapper fsRAtmtnFrcstInfMapper; |
| | | |
| | | private static final ObjectMapper objectMapper = new ObjectMapper(); |
| | | |
| | | private static final String apikey = "F1DBECD719108635189480CF60E6553ADB3109616426BD537F25A430DFC613B491A025C4A51E77FD08C6E5B7CBE05917A461286E7B6D69F1AB1B14F946149D2065B0C675F8FEDF4B9B05C1496881BC5A"; |
| | | private static final String cookie = "userobj=%7B%22_id%22%3A%225adfd17ddd000ba4188c53e0%22%2C%22name%22%3A%22%E9%98%B2%E6%B1%9B%E5%80%BC%E7%8F%AD%22%2C%22phone%22%3A%2213612345678%22%2C%22utype%22%3A0%2C%22dept%22%3A%22%E7%9C%81%E6%B0%B4%E5%88%A9%E5%8E%85%22%2C%22tm%22%3A%222018-04-25T00%3A53%3A17.147Z%22%2C%22token%22%3A%224e30701b3ac0996c60569e7f4c65ca5d%22%2C%22chkc%22%3Afalse%2C%22ywjk%22%3Afalse%2C%22yywh%22%3Afalse%7D"; |
| | | |
| | | private static final HttpClient client = HttpClient.newHttpClient(); |
| | | @Override |
| | | public Object getAtmtnInfo(String STCM, Integer type) { |
| | | StopWatch stopWatch = new StopWatch(); |
| | | stopWatch.start("查询预报信息"); |
| | | List<String> stcds = new ArrayList<>(); |
| | | if (StringUtils.isNotBlank(STCM)){ |
| | | stcds = fsRAtmtnFrcstInfMapper.getStcdS(STCM); |
| | | } |
| | | List<FsRAtmtnFrcstInfVO> atmtnInfo = new ArrayList<>(); |
| | | List<FsRAtmtnFrcstInfVO> result = new ArrayList<>(); |
| | | if (type==1){ |
| | | atmtnInfo = fsRAtmtnFrcstInfMapper.getAtmtnInfo(type,stcds); |
| | | }else if (type==2){ |
| | | atmtnInfo = fsRAtmtnFrcstInfMapper.getAtmtnInfo1(type,stcds); |
| | | } |
| | | Map<String, List<FsRAtmtnFrcstInfVO>> map = atmtnInfo.stream().filter(s->s.getSTCD()!=null).collect(Collectors.groupingBy(FsRAtmtnFrcstInf::getSTCD)); |
| | | if (!map.isEmpty()){ |
| | | for (Map.Entry<String, List<FsRAtmtnFrcstInfVO>> entry : map.entrySet()) { |
| | | List<FsRAtmtnFrcstInfVO> value = entry.getValue(); |
| | | List<FsRAtmtnFrcstDtVO> dtVOList = value.stream().map(s -> FsRAtmtnFrcstDtVO.builder().TM(s.getTM()).TZ(s.getTZ()).TQ(s.getTQ()).build()).collect(Collectors.toList()); |
| | | FsRAtmtnFrcstInfVO fsRAtmtnFrcstInfVO = value.get(0); |
| | | fsRAtmtnFrcstInfVO.setFrcstDtVOS(dtVOList); |
| | | result.add(fsRAtmtnFrcstInfVO); |
| | | } |
| | | } |
| | | stopWatch.stop(); |
| | | stopWatch.start("查询站点信息"); |
| | | List<String> STCDs = result.stream().map(FsRAtmtnFrcstInf::getSTCD).collect(Collectors.toList()); |
| | | List<StStbprpBVO> stationInfos = fsRAtmtnFrcstInfMapper.getStationInfo(STCDs); |
| | | stopWatch.stop(); |
| | | stopWatch.start("封装数据"); |
| | | Map<String, StStbprpBVO> stationMap = stationInfos.stream().collect(Collectors.toMap(StStbprpBVO::getSTCD, bvo -> bvo, (oldValue, newValue) -> oldValue)); // 合并函数:如果键冲突,选择保留哪个值(这里保留旧值) |
| | | if (CollectionUtils.isNotEmpty(result)){ |
| | | for (FsRAtmtnFrcstInfVO infVO : result) { |
| | | StStbprpBVO bvo = stationMap.get(infVO.getSTCD()); |
| | | if (Objects.nonNull(bvo)){ |
| | | infVO.setGRZ(bvo.getGRZ()); |
| | | infVO.setRVNM(bvo.getRVNM()==null?null: bvo.getRVNM().replaceAll(" ","")); |
| | | infVO.setSTNM(bvo.getSTNM()==null?null:bvo.getSTNM().replaceAll(" ","")); |
| | | infVO.setWRZ(bvo.getWRZ()); |
| | | infVO.setFSLTDZ(bvo.getFSLTDZ()); |
| | | infVO.setSFLZ(bvo.getSFLZ()); |
| | | } |
| | | for (FsRAtmtnFrcstDtVO dtVO : infVO.getFrcstDtVOS()) { |
| | | List<FsRAtmtnFrcstDtDeatilVO> list = new ArrayList<>(); |
| | | list.add(new FsRAtmtnFrcstDtDeatilVO("水位", dtVO.getTZ()==0?null:dtVO.getTZ().toString())); |
| | | list.add(new FsRAtmtnFrcstDtDeatilVO("流量", dtVO.getTQ()==0?null:dtVO.getTQ().toString())); |
| | | dtVO.setList(list); |
| | | } |
| | | } |
| | | } |
| | | stopWatch.stop(); |
| | | log.info(stopWatch.prettyPrint()); |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public List<WarningTypeVO> warningStatistics() { |
| | | List<WarningTypeVO> result = new ArrayList<>(); |
| | | StopWatch stopWatch = new StopWatch(); |
| | | stopWatch.start("水库统计"); |
| | | //水库统计 |
| | | Map<String,String> map = new HashMap<>(); |
| | | map.put("name","apikey"); |
| | | map.put("value",apikey); |
| | | JsonNode jsonNode = doRequest("GET", "https://sk.hubeishuiyi.cn/services/1234567890ABCDEFGHIJKLMN/res_over_flpr_des_rain/api", map, null); |
| | | JsonNode shuikuNode = jsonNode.get("data").get("data"); |
| | | List<WarningTypeVO> shuikuChild = new ArrayList<>(); |
| | | for (JsonNode node : shuikuNode) { |
| | | String overType = String.valueOf(node.get("over_type")); |
| | | shuikuChild.add(WarningTypeVO.builder().warningType(overType.substring(1, overType.length() - 1)).warningNum(String.valueOf(node.get("over_number"))).build()); |
| | | } |
| | | WarningTypeVO shuiku = WarningTypeVO.builder().warningType("水库").childList(shuikuChild).warningNum(String.valueOf(shuikuChild.stream().mapToInt(s -> Integer.parseInt(s.getWarningNum())).sum())).build(); |
| | | for (WarningTypeVO vo : shuikuChild) { |
| | | if (vo.getWarningType().equals("超设计洪水位")||vo.getWarningType().equals("超防洪高水位")){ |
| | | shuiku.setColor("红色"); |
| | | }else if (vo.getWarningType().equals("暴雨")){ |
| | | shuiku.setColor("黄色"); |
| | | } |
| | | } |
| | | result.add(shuiku); |
| | | stopWatch.stop(); |
| | | |
| | | stopWatch.start("水文统计"); |
| | | //水文统计 |
| | | List<WarningTypeVO> shuiziyuanChild = new ArrayList<>(); |
| | | JsonNode jsonNode1 = doRequest("GET", "https://hfc.mwr.cn/warn-release-api/api/warninfo.custom/4MTAOTM1MzEyQHFxLmNvbQ==", new HashMap<>(), null); |
| | | JsonNode data = jsonNode1.get("Data"); |
| | | List<WarningColorVO> hsChild = new ArrayList<>(); |
| | | List<WarningColorVO> ghChild = new ArrayList<>(); |
| | | for (JsonNode datum : data) { |
| | | String wrType = datum.get("WRType").toString(); |
| | | wrType = wrType.substring(1,wrType.length()-1); |
| | | String WRLevel = datum.get("WRLevel").toString(); |
| | | WRLevel = WRLevel.substring(1,WRLevel.length()-1); |
| | | if (wrType.equals("洪水")){ |
| | | hsChild.add(WarningColorVO.builder().colorName(WRLevel).build()); |
| | | }else { |
| | | ghChild.add(WarningColorVO.builder().colorName(WRLevel).build()); |
| | | } |
| | | } |
| | | WarningTypeVO hs = WarningTypeVO.builder().warningType("洪水预警").warningNum(String.valueOf(hsChild.size())).build(); |
| | | List<WarningColorVO> totals = hsChild.stream() |
| | | .collect(Collectors.groupingBy(WarningColorVO::getColorName, Collectors.counting())) |
| | | .entrySet().stream() |
| | | .map(entry -> new WarningColorVO(entry.getKey(), Math.toIntExact(entry.getValue()))) |
| | | .collect(Collectors.toList()); |
| | | hs.setColorVOList(totals); |
| | | |
| | | WarningTypeVO gh = WarningTypeVO.builder().warningType("干旱预警").warningNum(String.valueOf(ghChild.size())).build(); |
| | | List<WarningColorVO> totals1 = ghChild.stream() |
| | | .collect(Collectors.groupingBy(WarningColorVO::getColorName, Collectors.counting())) |
| | | .entrySet().stream() |
| | | .map(entry -> new WarningColorVO(entry.getKey(), Math.toIntExact(entry.getValue()))) |
| | | .collect(Collectors.toList()); |
| | | gh.setColorVOList(totals1); |
| | | shuiziyuanChild.add(hs); |
| | | shuiziyuanChild.add(gh); |
| | | WarningTypeVO shuiwen = WarningTypeVO.builder().warningType("水文").childList(shuiziyuanChild).warningNum(String.valueOf(shuiziyuanChild.stream().mapToInt(s -> Integer.parseInt(s.getWarningNum())).sum())).build(); |
| | | totals.addAll(totals1); |
| | | if (CollectionUtils.isNotEmpty(totals)){ |
| | | for (WarningColorVO vo : totals) { |
| | | String colorName = vo.getColorName(); |
| | | if (colorName.equals("红色")){ |
| | | shuiwen.setColor("红色"); |
| | | }else if (colorName.equals("橙色")){ |
| | | shuiwen.setColor("橙色"); |
| | | }else if (colorName.equals("黄色")){ |
| | | shuiwen.setColor("黄色"); |
| | | }else if (colorName.equals("蓝色")){ |
| | | shuiwen.setColor("蓝色"); |
| | | } |
| | | } |
| | | } |
| | | result.add(shuiwen); |
| | | stopWatch.stop(); |
| | | |
| | | stopWatch.start("山洪"); |
| | | //山洪 |
| | | List<WarningTypeVO> shList = new ArrayList<>(); |
| | | Map<String,String> map1 = new HashMap<>(); |
| | | map1.put("name","cookie"); |
| | | map1.put("value",cookie); |
| | | Date date = new Date(); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH"); |
| | | String time = format.format(date); |
| | | String type = "sh"; |
| | | JsonNode jsonNode2 = doRequest("GET", "https://sk.hubeishuiyi.cn/contourcale/hour6?tm="+time+"&type="+type, map1, null); |
| | | JsonNode results = jsonNode2.get("results"); |
| | | int cnt = 0,wb = 0,nb = 0; |
| | | for (JsonNode node : results) { |
| | | JsonNode warnmap = node.get("warnmap"); |
| | | if (warnmap!=null){ |
| | | Iterator<JsonNode> elements = warnmap.elements(); |
| | | JsonNode jsonNode3 = elements.next(); |
| | | String cnt1 = jsonNode3.get("cnt").toString(); |
| | | cnt += Integer.parseInt(cnt1); |
| | | |
| | | String nbcnt1 = jsonNode3.get("nbcnt").toString(); |
| | | nb += Integer.parseInt(nbcnt1); |
| | | |
| | | String wbcnt1 = jsonNode3.get("wbcnt").toString(); |
| | | wb += Integer.parseInt(wbcnt1); |
| | | } |
| | | } |
| | | shList.add(WarningTypeVO.builder().warningType("总数").warningNum(String.valueOf(cnt)).build()); |
| | | shList.add(WarningTypeVO.builder().warningType("内部预警").warningNum(String.valueOf(nb)).build()); |
| | | shList.add(WarningTypeVO.builder().warningType("外部预警").warningNum(String.valueOf(wb)).build()); |
| | | WarningTypeVO shanhong = WarningTypeVO.builder().warningType("山洪").childList(shList).warningNum(String.valueOf(cnt)).build(); |
| | | if (wb>0){ |
| | | shanhong.setColor("红色"); |
| | | }else if (nb>0){ |
| | | shanhong.setColor("黄色"); |
| | | } |
| | | result.add(shanhong); |
| | | stopWatch.stop(); |
| | | |
| | | stopWatch.start("生态激流"); |
| | | //水资源 |
| | | //生态激流 |
| | | SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyy"); |
| | | String format1 = format.format(date); |
| | | String format2 = dateFormat1.format(date); |
| | | List<WarningTypeVO> szyList = new ArrayList<>(); |
| | | String dtBgTm = format2+"-01-01 00:00:00"; |
| | | String dtEdTm = format1+" 23:59:59"; |
| | | JsonNode jsonNode3 = doRequest("GET", "http://113.57.190.43:31700/api-szy-0.0.1/api/szy/v0.1/stjl/statis/b/queryBaseFlowList?addvcd=42", new HashMap<>(), null); |
| | | JsonNode result1 = jsonNode3.get("result"); |
| | | int red = 0 , blue = 0; |
| | | for (JsonNode node : result1) { |
| | | if (node.get("Q")!=null){ |
| | | String s = node.get("Q").toString(); |
| | | if (!s.equals("null")){ |
| | | String base_flow = node.get("BASE_FLOW").toString(); |
| | | String blue_alert = node.get("WATER_LEVEL_BLUE_ALERT").toString(); |
| | | double q = Double.parseDouble(s); |
| | | double flow = Double.parseDouble(base_flow.equals("null")?"0":base_flow.substring(1,base_flow.length()-1)); |
| | | double alert = Double.parseDouble(blue_alert.equals("null")?"0":blue_alert.substring(1,blue_alert.length()-1)); |
| | | if (q<flow){ |
| | | red++; |
| | | }else if (q<alert){ |
| | | blue++; |
| | | } |
| | | } |
| | | }else { |
| | | String z = node.get("Z").toString(); |
| | | if (!z.equals("null")){ |
| | | String water_level = node.get("WATER_LEVEL").toString(); |
| | | String blueAlert = node.get("WATER_LEVEL_BLUE_ALERT").toString(); |
| | | double Z = Double.parseDouble(z.substring(1,z.length()-1)); |
| | | double level = Double.parseDouble(water_level.equals("null")?"0": water_level.substring(1,water_level.length()-1)); |
| | | double alert = Double.parseDouble(blueAlert.equals("null")?"0": blueAlert.substring(1,blueAlert.length()-1)); |
| | | if (Z>0){ |
| | | if (Z>level){ |
| | | red++; |
| | | }else if (Z>alert){ |
| | | blue++; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | List<WarningColorVO> stjl = new ArrayList<>(); |
| | | stjl.add(WarningColorVO.builder().colorName("红色").colorWarningNum(red).build()); |
| | | stjl.add(WarningColorVO.builder().colorName("蓝色").colorWarningNum(blue).build()); |
| | | szyList.add(WarningTypeVO.builder().warningNum(String.valueOf(red+blue)).colorVOList(stjl).warningType("河湖断面生态流量").build()); |
| | | stopWatch.stop(); |
| | | |
| | | stopWatch.start("水量"); |
| | | //水量 |
| | | WaterQueryDTO queryDTO = WaterQueryDTO.builder().wiustTp("1").adlCd("42").tsBgTm(format2+"-01-01 00:00:00").tsEdTm(format1+" 00:00:00").build(); |
| | | int red1 = 0 , or = 0,blue1 = 0; |
| | | try { |
| | | String s = objectMapper.writeValueAsString(queryDTO); |
| | | JsonNode jsonNode4 = doRequest("POST", "http://113.57.190.43:31700/api-szy-0.0.1/api/szy/v0.1/wr/wiu/b/list", new HashMap<>(), s); |
| | | JsonNode result2 = jsonNode4.get("result"); |
| | | for (JsonNode node : result2) { |
| | | String ratio = node.get("RATIO").toString(); |
| | | double r = Double.parseDouble(ratio.equals("null") ? "0" : ratio); |
| | | if (r>1){ |
| | | red1++; |
| | | }else if (r>0.9&& r<=1){ |
| | | or++; |
| | | }else if (r>0.8&& r<=0.9){ |
| | | blue1++; |
| | | } |
| | | } |
| | | } catch (JsonProcessingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | List<WarningColorVO> sl = new ArrayList<>(); |
| | | sl.add(WarningColorVO.builder().colorName("红色").colorWarningNum(red1).build()); |
| | | sl.add(WarningColorVO.builder().colorName("橙色").colorWarningNum(or).build()); |
| | | sl.add(WarningColorVO.builder().colorName("蓝色").colorWarningNum(blue1).build()); |
| | | szyList.add(WarningTypeVO.builder().warningNum(String.valueOf(red1+or+blue1)).colorVOList(sl).warningType("水量").build()); |
| | | stopWatch.stop(); |
| | | System.out.println(stopWatch.prettyPrint()); |
| | | WarningTypeVO shuiziyuan = WarningTypeVO.builder().warningType("水资源").childList(szyList).warningNum(String.valueOf(cnt)).build(); |
| | | result.add(shuiziyuan); |
| | | if (red1>0||red>0){ |
| | | shuiziyuan.setColor("红色"); |
| | | }else if (or>0){ |
| | | shuiziyuan.setColor("橙色"); |
| | | }else if (blue1>0||blue>0){ |
| | | shuiziyuan.setColor("蓝色"); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public WarningTypeVO warningStatisticsSK() { |
| | | StopWatch stopWatch = new StopWatch(); |
| | | //水库统计 |
| | | Map<String,String> map = new HashMap<>(); |
| | | map.put("name","apikey"); |
| | | map.put("value",apikey); |
| | | stopWatch.start("调用水库远程接口"); |
| | | JsonNode jsonNode = doRequest("GET", "https://sk.hubeishuiyi.cn/services/1234567890ABCDEFGHIJKLMN/res_over_flpr_des_rain/api", map, null); |
| | | stopWatch.stop(); |
| | | stopWatch.start("封装水库统计数据"); |
| | | JsonNode shuikuNode = jsonNode.get("data").get("data"); |
| | | List<WarningTypeVO> shuikuChild = new ArrayList<>(); |
| | | int typeNum = 0; |
| | | for (JsonNode node : shuikuNode) { |
| | | String overType = String.valueOf(node.get("over_type")); |
| | | JsonNode overNumber = node.get("over_number"); |
| | | if (overNumber!=null){ |
| | | if (Integer.parseInt(overNumber.toString())>0){ |
| | | typeNum++; |
| | | }; |
| | | } |
| | | shuikuChild.add(WarningTypeVO.builder().warningType(overType.substring(1, overType.length() - 1)).warningNum(String.valueOf(node.get("over_number"))).build()); |
| | | } |
| | | WarningTypeVO shuiku = WarningTypeVO.builder().warningType("水库").childList(shuikuChild).warningNum(String.valueOf(shuikuChild.stream().mapToInt(s -> Integer.parseInt(s.getWarningNum())).sum())).build(); |
| | | for (WarningTypeVO vo : shuikuChild) { |
| | | if (vo.getWarningType().equals("超设计洪水位")||vo.getWarningType().equals("超防洪高水位")){ |
| | | shuiku.setColor("红色"); |
| | | }else if (vo.getWarningType().equals("暴雨")){ |
| | | shuiku.setColor("黄色"); |
| | | } |
| | | } |
| | | shuiku.setTypeNum(String.valueOf(typeNum) ); |
| | | stopWatch.stop(); |
| | | log.info(stopWatch.prettyPrint()); |
| | | return shuiku; |
| | | } |
| | | |
| | | @Override |
| | | public WarningTypeVO warningStatisticsSW() { |
| | | //水文统计 |
| | | List<WarningTypeVO> shuiziyuanChild = new ArrayList<>(); |
| | | JsonNode jsonNode1 = doRequest("GET", "https://hfc.mwr.cn/warn-release-api/api/warninfo.custom/4MTAOTM1MzEyQHFxLmNvbQ==", new HashMap<>(), null); |
| | | JsonNode data = jsonNode1.get("Data"); |
| | | List<WarningColorVO> hsChild = new ArrayList<>(); |
| | | List<WarningColorVO> ghChild = new ArrayList<>(); |
| | | for (JsonNode datum : data) { |
| | | String wrType = datum.get("WRType").toString(); |
| | | wrType = wrType.substring(1,wrType.length()-1); |
| | | String WRLevel = datum.get("WRLevel").toString(); |
| | | WRLevel = WRLevel.substring(1,WRLevel.length()-1); |
| | | if (wrType.equals("洪水")){ |
| | | hsChild.add(WarningColorVO.builder().colorName(WRLevel).build()); |
| | | }else { |
| | | ghChild.add(WarningColorVO.builder().colorName(WRLevel).build()); |
| | | } |
| | | } |
| | | WarningTypeVO hs = WarningTypeVO.builder().warningType("洪水预警").warningNum(String.valueOf(hsChild.size())).build(); |
| | | List<WarningColorVO> totals = hsChild.stream() |
| | | .collect(Collectors.groupingBy(WarningColorVO::getColorName, Collectors.counting())) |
| | | .entrySet().stream() |
| | | .map(entry -> new WarningColorVO(entry.getKey(), Math.toIntExact(entry.getValue()))) |
| | | .collect(Collectors.toList()); |
| | | hs.setColorVOList(totals); |
| | | |
| | | WarningTypeVO gh = WarningTypeVO.builder().warningType("干旱预警").warningNum(String.valueOf(ghChild.size())).build(); |
| | | List<WarningColorVO> totals1 = ghChild.stream() |
| | | .collect(Collectors.groupingBy(WarningColorVO::getColorName, Collectors.counting())) |
| | | .entrySet().stream() |
| | | .map(entry -> new WarningColorVO(entry.getKey(), Math.toIntExact(entry.getValue()))) |
| | | .collect(Collectors.toList()); |
| | | gh.setColorVOList(totals1); |
| | | shuiziyuanChild.add(hs); |
| | | shuiziyuanChild.add(gh); |
| | | WarningTypeVO shuiwen = WarningTypeVO.builder().warningType("水文").childList(shuiziyuanChild).warningNum(String.valueOf(shuiziyuanChild.stream().mapToInt(s -> Integer.parseInt(s.getWarningNum())).sum())).build(); |
| | | totals.addAll(totals1); |
| | | if (CollectionUtils.isNotEmpty(totals)){ |
| | | for (WarningColorVO vo : totals) { |
| | | String colorName = vo.getColorName(); |
| | | if (colorName.equals("红色")){ |
| | | shuiwen.setColor("红色"); |
| | | }else if (colorName.equals("橙色")){ |
| | | shuiwen.setColor("橙色"); |
| | | }else if (colorName.equals("黄色")){ |
| | | shuiwen.setColor("黄色"); |
| | | }else if (colorName.equals("蓝色")){ |
| | | shuiwen.setColor("蓝色"); |
| | | } |
| | | } |
| | | } |
| | | shuiwen.setTypeNum(shuiwen.getWarningNum()); |
| | | return shuiwen; |
| | | } |
| | | |
| | | @Override |
| | | public WarningTypeVO warningStatisticsSH() { |
| | | List<WarningTypeVO> shList = new ArrayList<>(); |
| | | Map<String,String> map1 = new HashMap<>(); |
| | | map1.put("name","cookie"); |
| | | map1.put("value",cookie); |
| | | Date date = new Date(); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH"); |
| | | String time = format.format(date); |
| | | String type = "sh"; |
| | | JsonNode jsonNode2 = doRequest("GET", "https://sk.hubeishuiyi.cn/contourcale/hour6?tm="+time+"&type="+type, map1, null); |
| | | JsonNode results = jsonNode2.get("results"); |
| | | int cnt = 0,wb = 0,nb = 0; |
| | | for (JsonNode node : results) { |
| | | JsonNode warnmap = node.get("warnmap"); |
| | | if (warnmap!=null){ |
| | | Iterator<JsonNode> elements = warnmap.elements(); |
| | | JsonNode jsonNode3 = elements.next(); |
| | | String cnt1 = jsonNode3.get("cnt").toString(); |
| | | cnt += Integer.parseInt(cnt1); |
| | | |
| | | String nbcnt1 = jsonNode3.get("nbcnt").toString(); |
| | | nb += Integer.parseInt(nbcnt1); |
| | | |
| | | String wbcnt1 = jsonNode3.get("wbcnt").toString(); |
| | | wb += Integer.parseInt(wbcnt1); |
| | | } |
| | | } |
| | | shList.add(WarningTypeVO.builder().warningType("总数").warningNum(String.valueOf(cnt)).build()); |
| | | shList.add(WarningTypeVO.builder().warningType("内部预警").warningNum(String.valueOf(nb)).build()); |
| | | shList.add(WarningTypeVO.builder().warningType("外部预警").warningNum(String.valueOf(wb)).build()); |
| | | WarningTypeVO shanhong = WarningTypeVO.builder().warningType("山洪").childList(shList).warningNum(String.valueOf(cnt)).build(); |
| | | if (wb>0){ |
| | | shanhong.setColor("红色"); |
| | | }else if (nb>0){ |
| | | shanhong.setColor("黄色"); |
| | | } |
| | | shanhong.setTypeNum(shanhong.getWarningNum()); |
| | | return shanhong; |
| | | } |
| | | |
| | | @Override |
| | | public WarningTypeVO warningStatisticsSZY() { |
| | | StopWatch stopWatch = new StopWatch(); |
| | | //水资源 |
| | | //生态激流 |
| | | Date date = new Date(); |
| | | SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyy"); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String format1 = format.format(date); |
| | | String format2 = dateFormat1.format(date); |
| | | List<WarningTypeVO> szyList = new ArrayList<>(); |
| | | String dtBgTm = format2+"-01-01 00:00:00"; |
| | | String dtEdTm = format1+" 23:59:59"; |
| | | stopWatch.start("调用生态激流接口"); |
| | | JsonNode jsonNode3 = doRequest("GET", "http://113.57.190.43:31700/api-szy-0.0.1/api/szy/v0.1/stjl/statis/b/queryBaseFlowList?addvcd=42", new HashMap<>(), null); |
| | | stopWatch.stop(); |
| | | stopWatch.start("封装生态激流数据"); |
| | | JsonNode result1 = jsonNode3.get("result"); |
| | | int red = 0 , blue = 0; |
| | | for (JsonNode node : result1) { |
| | | if (node.get("Q")!=null){ |
| | | String s = node.get("Q").toString(); |
| | | if (!s.equals("null")){ |
| | | String base_flow = node.get("BASE_FLOW").toString(); |
| | | String blue_alert = node.get("WATER_LEVEL_BLUE_ALERT").toString(); |
| | | float q = Float.parseFloat(s); |
| | | float flow = Float.parseFloat(base_flow.equals("null")?"0":base_flow.substring(1,base_flow.length()-1)); |
| | | float alert = Float.parseFloat(blue_alert.equals("null")?"0":blue_alert.substring(1,blue_alert.length()-1)); |
| | | if (q>=0&&q<flow){ |
| | | red++; |
| | | }else if (q<alert){ |
| | | blue++; |
| | | } |
| | | } |
| | | }else { |
| | | String z = node.get("Z").toString(); |
| | | if (!z.equals("null")){ |
| | | String water_level = node.get("WATER_LEVEL").toString(); |
| | | String blueAlert = node.get("WATER_LEVEL_BLUE_ALERT").toString(); |
| | | float Z = Float.parseFloat(z.substring(1,z.length()-1)); |
| | | float level = Float.parseFloat(water_level.equals("null")?"0": water_level.substring(1,water_level.length()-1)); |
| | | float alert = Float.parseFloat(blueAlert.equals("null")?"0": blueAlert.substring(1,blueAlert.length()-1)); |
| | | if (Z>=0){ |
| | | if (Z>level){ |
| | | red++; |
| | | }else if (Z>alert){ |
| | | blue++; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | List<WarningColorVO> stjl = new ArrayList<>(); |
| | | stjl.add(WarningColorVO.builder().colorName("红色").colorWarningNum(red).build()); |
| | | stjl.add(WarningColorVO.builder().colorName("蓝色").colorWarningNum(blue).build()); |
| | | szyList.add(WarningTypeVO.builder().warningNum(String.valueOf(red+blue)).colorVOList(stjl).warningType("河湖断面生态流量").build()); |
| | | int typeNum = 0; |
| | | if (red>0||blue>0){ |
| | | typeNum += 1; |
| | | } |
| | | stopWatch.stop(); |
| | | //水量 |
| | | WaterQueryDTO queryDTO = WaterQueryDTO.builder().wiustTp("1").adlCd("42").tsBgTm(format2+"-01-01 00:00:00").tsEdTm(format1+" 00:00:00").build(); |
| | | int red1 = 0 , or = 0,blue1 = 0; |
| | | try { |
| | | String s = objectMapper.writeValueAsString(queryDTO); |
| | | stopWatch.start("调用水量接口"); |
| | | JsonNode jsonNode4 = doRequest("POST", "http://113.57.190.43:31700/api-szy-0.0.1/api/szy/v0.1/wr/wiu/b/list", new HashMap<>(), s); |
| | | stopWatch.stop(); |
| | | stopWatch.start("封装水量数据"); |
| | | JsonNode result2 = jsonNode4.get("result"); |
| | | for (JsonNode node : result2) { |
| | | String ratio = node.get("RATIO").toString(); |
| | | double r = Double.parseDouble(ratio.equals("null") ? "0" : ratio); |
| | | if (r>1){ |
| | | red1++; |
| | | }else if (r>0.9&& r<=1){ |
| | | or++; |
| | | }else if (r>0.8&& r<=0.9){ |
| | | blue1++; |
| | | } |
| | | } |
| | | } catch (JsonProcessingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | List<WarningColorVO> sl = new ArrayList<>(); |
| | | sl.add(WarningColorVO.builder().colorName("红色").colorWarningNum(red1).build()); |
| | | sl.add(WarningColorVO.builder().colorName("橙色").colorWarningNum(or).build()); |
| | | sl.add(WarningColorVO.builder().colorName("蓝色").colorWarningNum(blue1).build()); |
| | | szyList.add(WarningTypeVO.builder().warningNum(String.valueOf(red1+or+blue1)).colorVOList(sl).warningType("水量").build()); |
| | | WarningTypeVO shuiziyuan = WarningTypeVO.builder().warningType("水资源").childList(szyList).warningNum(String.valueOf(red1+or+blue1+red+blue)).build(); |
| | | if (red1>0||blue1>0||or>0){ |
| | | typeNum += 1; |
| | | } |
| | | if (red1>0||red>0){ |
| | | shuiziyuan.setColor("红色"); |
| | | }else if (or>0){ |
| | | shuiziyuan.setColor("橙色"); |
| | | }else if (blue1>0||blue>0){ |
| | | shuiziyuan.setColor("蓝色"); |
| | | } |
| | | shuiziyuan.setTypeNum(String.valueOf(typeNum)); |
| | | stopWatch.stop(); |
| | | log.info(stopWatch.prettyPrint()); |
| | | return shuiziyuan; |
| | | } |
| | | |
| | | @Override |
| | | public Object countAtmtnInfo() { |
| | | Map<String,String> map = new HashMap<>(); |
| | | List<FsRAtmtnFrcstInfVO> atmtnInfo = fsRAtmtnFrcstInfMapper.getAtmtnInfo1(null, null); |
| | | // atmtnInfo.addAll(fsRAtmtnFrcstInfMapper.getAtmtnInfo1(null,null)); |
| | | List<String> STCDs = atmtnInfo.stream().map(FsRAtmtnFrcstInf::getSTCD).collect(Collectors.toList()); |
| | | List<StStbprpBVO> stationInfos = fsRAtmtnFrcstInfMapper.getStationInfo(STCDs); |
| | | Map<String, StStbprpBVO> stationMap = stationInfos.stream().collect(Collectors.toMap(StStbprpBVO::getSTCD, bvo -> bvo, (oldValue, newValue) -> oldValue)); |
| | | Integer num = 0; |
| | | if (CollectionUtils.isNotEmpty(atmtnInfo)){ |
| | | for (FsRAtmtnFrcstInfVO vo : atmtnInfo) { |
| | | StStbprpBVO stbprpBVO = stationMap.get(vo.getSTCD()); |
| | | if (vo.getTQ()> Float.parseFloat(stbprpBVO.getWRZ()) ){ |
| | | num++; |
| | | } |
| | | } |
| | | } |
| | | map.put("warningNum",String.valueOf(num)); |
| | | if (num>0){ |
| | | map.put("color","红色"); |
| | | }else { |
| | | map.put("color",""); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | *处理远程请求 |
| | | */ |
| | | private static JsonNode doRequest(String method,String url,Map<String,String> headerParam,String param) { |
| | | HttpRequest.Builder builder = HttpRequest.newBuilder(); |
| | | if (method.equals("GET")){ |
| | | builder.GET(); |
| | | }else { |
| | | builder.POST(HttpRequest.BodyPublishers.ofString(param)); |
| | | } |
| | | builder.uri(URI.create(url)) |
| | | .header("Accept", "application/json").header("Content-Type","application/json"); |
| | | if (!headerParam.isEmpty()){ |
| | | builder.header(headerParam.get("name"),headerParam.get("value")); |
| | | } |
| | | try { |
| | | Instant requestS = Instant.now(); |
| | | HttpResponse<InputStream> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofInputStream()); |
| | | Instant requestE= Instant.now(); |
| | | long requestTime = Duration.between(requestS, requestE).toMillis(); |
| | | log.info("请求时长为: " + requestTime + " milliseconds"); |
| | | Instant writeDataS = Instant.now(); |
| | | JsonNode jsonNode = objectMapper.readTree(response.body()); |
| | | Instant writeDataE = Instant.now(); |
| | | long writeDataTime = Duration.between(writeDataS, writeDataE).toMillis(); |
| | | log.info("接受数据时长: " + writeDataTime + " milliseconds"); |
| | | return jsonNode; |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | } |
| | |
| | | add("town_nm"); |
| | | add("res_nm"); |
| | | add("rz"); |
| | | add("over_dead_z"); |
| | | }}; |
| | | |
| | | /** |
| | |
| | | add("over_1h"); |
| | | add("over_z"); |
| | | add("drp_24"); |
| | | add("flse_lim_stag"); |
| | | }}; |
| | | |
| | | /** |
| | |
| | | add("res_nm"); |
| | | add("rz"); |
| | | add("over_z"); |
| | | add("tb_flse_lim_stag"); |
| | | }}; |
| | | |
| | | /** |
| | |
| | | add("rz"); |
| | | add("over_1h"); |
| | | add("over_z"); |
| | | add("flse_lim_stag"); |
| | | }}; |
| | | |
| | | /** |
| | |
| | | add("over_1h"); |
| | | add("over_z"); |
| | | add("drp_24"); |
| | | add("flse_lim_stag"); |
| | | }}; |
| | | |
| | | /** |
| | |
| | | add("rz"); |
| | | add("over_1h"); |
| | | add("over_z"); |
| | | add("flse_lim_stag"); |
| | | }}; |
| | | |
| | | |
| | |
| | | add("over_des_wtr_level"); |
| | | add("diff_dam"); |
| | | add("drp_24"); |
| | | add("des_fl_stag"); |
| | | }}; |
| | | |
| | | /** |
| | |
| | | add("cd_nm"); |
| | | add("max_value"); |
| | | add("diff_val"); |
| | | add("dam_top_elevation"); |
| | | }}; |
| | | |
| | | /** |
| | |
| | | add("cd_nm"); |
| | | add("dayNum"); |
| | | add("diff_val"); |
| | | add("val1"); |
| | | add("val2"); |
| | | add("val5"); |
| | | add("val10"); |
| | | add("val30"); |
| | | add("diff_2"); |
| | | add("diff_5"); |
| | | add("diff_10"); |
| | | add("diff_30"); |
| | | }}; |
| | | |
| | | /** |
| | |
| | | add("val1"); |
| | | add("dayNum"); |
| | | add("diff_val"); |
| | | add("val1"); |
| | | add("val2"); |
| | | add("val5"); |
| | | add("val10"); |
| | | add("val30"); |
| | | add("diff_2"); |
| | | add("diff_5"); |
| | | add("diff_10"); |
| | | add("diff_30"); |
| | | }}; |
| | | |
| | | /** |
| | |
| | | add("val1"); |
| | | add("dayNum"); |
| | | add("diff_val"); |
| | | add("val1"); |
| | | add("val2"); |
| | | add("val5"); |
| | | add("val10"); |
| | | add("val30"); |
| | | add("diff_2"); |
| | | add("diff_5"); |
| | | add("diff_10"); |
| | | add("diff_30"); |
| | | }}; |
| | | |
| | | /** |
| | |
| | | add("sy_val"); |
| | | add("type"); |
| | | add("diff_val"); |
| | | add("lead_val"); |
| | | }}; |
| | | |
| | | /** |
| | |
| | | add("cd_nm"); |
| | | add("direction"); |
| | | add("val"); |
| | | add("de_val"); |
| | | add("dn_val"); |
| | | add("du_value"); |
| | | }}; |
| | | |
| | | /** |
| | |
| | | add("cd_nm"); |
| | | add("direction"); |
| | | add("val"); |
| | | add("de_val"); |
| | | add("dn_val"); |
| | | add("du_value"); |
| | | }}; |
| | | |
| | | /** |
| | |
| | | add("cd_nm"); |
| | | add("direction"); |
| | | add("val"); |
| | | add("de_val"); |
| | | add("dn_val"); |
| | | add("du_value"); |
| | | }}; |
| | | |
| | | /** |
| | |
| | | add("res_nm"); |
| | | add("cd_nm"); |
| | | add("value"); |
| | | add("lead_val"); |
| | | add("lead2_val"); |
| | | }}; |
| | | |
| | | |
| | |
| | | add("res_nm"); |
| | | add("video_name"); |
| | | }}; |
| | | |
| | | |
| | | /** |
| | | * 42 水位超防洪高水位告警处理 |
| | | */ |
| | | public static List<String> topLevOfFloAlertList = new ArrayList<String>() |
| | | {{ |
| | | add("town_nm"); |
| | | add("res_nm"); |
| | | add("rz"); |
| | | add("over_des_wtr_level"); |
| | | add("diff_dam"); |
| | | add("drp_24"); |
| | | add("flpr_high_stag"); |
| | | }}; |
| | | } |
| | |
| | | public static final String alarm_rain_6_over_api = "/services/1234567890ABCDEFGHIJKLMN/alarm/rain/6/over/api"; |
| | | |
| | | /** |
| | | * 18. 6小时降雨告警2 |
| | | */ |
| | | public static final String alarm_rain_only_6_over_api = "/services/1234567890ABCDEFGHIJKLMN/alarm/rain/only/6/over/api"; |
| | | |
| | | /** |
| | | * 19. 大坝安全监测告警-数据缺失(2024.03.12分开渗压、渗流、变形) |
| | | */ |
| | | public static final String alarm_db_api = "/services/1234567890ABCDEFGHIJKLMN/alarm/dt/sy/api"; |
| | |
| | | */ |
| | | public static final String alarm_video_offline_api = "/services/1234567890ABCDEFGHIJKLMN/wmst_not_online_list/api?pageNo=1&pageSize=9999"; |
| | | |
| | | /** |
| | | * 42. 超防洪高水位告警 |
| | | */ |
| | | public static final String over_flpr_rz_warn_api = "/services/1234567890ABCDEFGHIJKLMN/over_flpr_rz/warn"; |
| | | |
| | | } |
| | |
| | | import cn.gistack.resource.vo.AlertTextualResearchAttachVO; |
| | | import cn.gistack.sm.intelligentCall.feign.OutCallClient; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | // 后面依次拼接市县水利部门人员姓名电话 |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | |
| | | String remark = StringUtil.format("水位:{}\n死水位:{}米\n超低于死水位:{}米\n", |
| | | list.get(9), |
| | | String.format("%.2f", Double.valueOf(list.get(9).replace("米", "")) - Double.valueOf(list.get(10))), |
| | | list.get(10) |
| | | ); |
| | | list.remove(10); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | |
| | | noticeHandle.addPatrolTechnologyInfo(list, false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | |
| | | String remark = StringUtil.format("水位:{}\n汛限水位:{}米\n接近汛限水位:{}米\n", |
| | | list.get(9), list.get(13), String.format("%.2f", Double.valueOf(list.get(9).replace("米", "")) - Double.valueOf(list.get(13))) |
| | | ); |
| | | list.remove(13); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | |
| | | noticeHandle.addPatrolTechnologyInfo(list, false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | |
| | | String remark = StringUtil.format("水位:{}\n汛限水位:{}米\n超汛限水位:{}米\n", |
| | | list.get(9), list.get(11), String.format("%.2f", Double.valueOf(list.get(9).replace("米", "")) - Double.valueOf(list.get(11))) |
| | | ); |
| | | list.remove(11); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | |
| | | noticeHandle.addPatrolTechnologyInfo(list, false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | |
| | | String remark = StringUtil.format("水位:{}\n汛限水位:{}米\n超汛限水位:{}米\n", |
| | | list.get(9), list.get(12), String.format("%.2f", Double.valueOf(list.get(9).replace("米", "")) - Double.valueOf(list.get(12))) |
| | | ); |
| | | list.remove(12); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | |
| | | noticeHandle.addPatrolTechnologyInfo(list, true); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | // noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | |
| | | String remark = StringUtil.format("水位:{}\n汛限水位:{}米\n超汛限水位:{}米\n", |
| | | list.get(9), list.get(12), String.format("%.2f", Double.valueOf(list.get(9).replace("米", "")) - Double.valueOf(list.get(12))) |
| | | ); |
| | | list.remove(12); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | |
| | | noticeHandle.addPatrolTechnologyInfo(list, false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | |
| | | String remark = StringUtil.format("水位:{}\n汛限水位:{}米\n超汛限水位:{}米\n", |
| | | list.get(9), list.get(13), String.format("%.2f", Double.valueOf(list.get(9).replace("米", "")) - Double.valueOf(list.get(13))) |
| | | ); |
| | | list.remove(13); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次拼接巡查责任人,技术责任人姓名联系电话 |
| | | noticeHandle.addPatrolTechnologyInfo(list, true); |
| | | |
| | | String remark = StringUtil.format("水位:{}\n汛限水位:{}米\n超汛限水位:{}米\n", |
| | | list.get(9), list.get(12), String.format("%.2f", Double.valueOf(list.get(9).replace("米", "")) - Double.valueOf(list.get(12))) |
| | | ); |
| | | list.remove(12); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 调用短信服务 |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // map = smsService.sendSignMsg(smsRequestTemplate); |
| | | return map; |
| | | } |
| | | return map; |
| | |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | String remark = StringUtil.format("降雨:{}\n", |
| | | list.get(6) + "毫米" |
| | | ); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | |
| | | |
| | | String remark = StringUtil.format("水位:{}\n设计洪水位:{}米\n超设计洪水位:{}米\n", |
| | | list.get(9), list.get(13), String.format("%.2f", Double.valueOf(list.get(9).replace("米", "")) - Double.valueOf(list.get(13))) |
| | | ); |
| | | list.remove(13); |
| | | |
| | | // System.out.println(remark); |
| | | // 依次添加行政责任人,主管部门责任人,技术责任人,巡查责任人信息(姓名,联系电话) |
| | | noticeHandle.addWaterMoreDesignPatrolTechnologyInfo(list, "1,2,4,5"); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | |
| | | // 依次添加行政责任人,主管部门责任人,技术责任人,巡查责任人信息(姓名,联系电话) |
| | | noticeHandle.addWaterMoreDesignPatrolTechnologyInfo(list, "1,2,4,5"); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | |
| | | String remark = StringUtil.format("水位:{}\n校核洪水位:{}米\n{}米\n", |
| | | list.get(9), list.get(10), list.get(11) |
| | | ); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list, false); |
| | | // // 依次添加行巡查责任人,技术责任人信息,主管部门责任人(姓名) |
| | | // noticeHandle.addPatrolTechnologyInfoNew(list, false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | |
| | | String remark = StringUtil.format("近1h水位陡升:{}\n", |
| | | list.get(10) |
| | | ); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list, false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | // // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | |
| | | String remark = StringUtil.format("近1h水位陡降:{}\n", |
| | | list.get(10) |
| | | ); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | |
| | | // 依次添加巡查责任人技术责任人信息姓名 |
| | | noticeHandle.addPatrolTechnologyInfo(list, false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | |
| | | String remark = list.get(9); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | |
| | | // 依次添加巡查责任人技术责任人信息姓名 |
| | | noticeHandle.addPatrolTechnologyInfo(list, false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | |
| | | String remark = list.get(9); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行政责任人,主管部门责任人,技术责任人,巡查责任人信息(姓名,联系电话) |
| | | noticeHandle.addWaterMoreDesignPatrolTechnologyInfo(list, "1,2,4,5"); |
| | | // noticeHandle.addWaterMoreDesignPatrolTechnologyInfo(list, "1,2,4,5"); |
| | | // 主管部门责任人,技术责任人,巡查责任人信息 2024-05-29修改 |
| | | noticeHandle.addWaterMoreDesignPatrolTechnologyInfoNew(list, "2,4,5"); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | |
| | | String remark = StringUtil.format("降雨:{}\n", |
| | | list.get(6) + "毫米" |
| | | ); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | |
| | | } |
| | | //如果参数是day,表示是每天生成告警,不需要发信息 |
| | | if (isDay.equals("day")) return map; |
| | | map = smsService.sendSignMsgMergeCd(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | map = smsService.sendSignMsgMergeCd(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | |
| | | } |
| | | return map; |
| | |
| | | |
| | | //如果参数是day,表示是每天生成告警,不需要发信息 |
| | | if (isDay.equals("day")) return; |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate, alarmRule); |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate, alarmRule); |
| | | |
| | | } |
| | | } |
| | |
| | | } |
| | | //如果参数是day,表示是每天生成告警,不需要发信息 |
| | | if (isDay.equals("day")) return; |
| | | // 需要合并水库保存站内信记录信息 |
| | | noticeHandle.saveInStationInfoMerge(smsRequestTemplate, alarmRule); |
| | | // 需要合并水库保存站内信记录信息 |
| | | noticeHandle.saveInStationInfoMerge(smsRequestTemplate, alarmRule); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | //如果参数是day,表示是每天生成告警,不需要发信息 |
| | | if (isDay.equals("day")) return map; |
| | | map = smsService.sendSignMsgMergeCd(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | 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,String isDay) { |
| | | public Map<String, Object> damSafetySyDataMissingHandle(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day"))return map; |
| | | if (isDay.equals("day")) return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | |
| | | * @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,String isDay) { |
| | | public Map<String, Object> damSafetySyLessThenPipeHandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | |
| | | String remark = StringUtil.format("渗压水位:{}\n管底高程:{}\n", |
| | | list.get(3), String.format("%.2f", Double.valueOf(list.get(11)) + Double.valueOf(list.get(12))) |
| | | ); |
| | | // System.out.println(remark); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day"))return map; |
| | | if (isDay.equals("day")) return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetySyLessThenPipeHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid,String isDay) { |
| | | public void damSafetySyLessThenPipeHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | |
| | | String remark = StringUtil.format("渗压水位:{}\n管底高程:{}\n", |
| | | list.get(3), String.format("%.2f", Double.valueOf(list.get(11)) + Double.valueOf(list.get(12))) |
| | | ); |
| | | // System.out.println(remark); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day"))return; |
| | | if (isDay.equals("day")) return; |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate, alarmRule); |
| | | } |
| | |
| | | * @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,String isDay) { |
| | | public Map<String, Object> damSafetySyHigherThenNozzleHandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | |
| | | String remark = StringUtil.format("渗压水位:{}\n管口高程:{}\n", |
| | | list.get(11), list.get(12) |
| | | ); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day"))return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | if (isDay.equals("day")) return map; |
| | | // map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetySyHigherThenNozzleHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid,String isDay) { |
| | | public void damSafetySyHigherThenNozzleHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | |
| | | String remark = StringUtil.format("渗压水位:{}\n管口高程:{}\n", |
| | | list.get(11), list.get(12) |
| | | ); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day"))return; |
| | | if (isDay.equals("day")) return; |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate, alarmRule); |
| | | } |
| | |
| | | * @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,String isDay) { |
| | | public Map<String, Object> damSafetySyHigherThenBdElevationHandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day"))return map; |
| | | if (isDay.equals("day")) return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetySyHigherThenBdElevationHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid,String isDay) { |
| | | public void damSafetySyHigherThenBdElevationHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | |
| | | String remark = StringUtil.format("渗压水位:{}\n坝顶高程:{}\n", |
| | | list.get(11), list.get(13) |
| | | ); |
| | | list.remove(13); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day"))return; |
| | | if (isDay.equals("day")) return; |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate, alarmRule); |
| | | } |
| | |
| | | * @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,String isDay) { |
| | | public Map<String, Object> damSafetySyHigherThenWaterLevelHandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day"))return map; |
| | | if (isDay.equals("day")) return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetySyHigherThenWaterLevelHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid,String isDay) { |
| | | public void damSafetySyHigherThenWaterLevelHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | |
| | | String remark = StringUtil.format("渗压水位:{}\n库水位:{}\n", |
| | | list.get(11), list.get(12) |
| | | ); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day"))return; |
| | | if (isDay.equals("day")) return; |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate, alarmRule); |
| | | } |
| | |
| | | * @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,String isDay) { |
| | | public Map<String, Object> damSafetySyYellowChangeHandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day"))return map; |
| | | if (isDay.equals("day")) return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetySyYellowChangeHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid,String isDay) { |
| | | public void damSafetySyYellowChangeHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | String remark = StringUtil.format("一日测值:{}\n二日测值:{}\n五日测值:{}\n十日测值:{}\n三十日测值:{}\n" + |
| | | "二日变幅:{}\n五日变幅:{}\n十日变幅:{}\n三十日变幅:{}\n", |
| | | list.get(13), list.get(14), list.get(15), list.get(16), list.get(17), |
| | | list.get(18), list.get(19), list.get(20), list.get(21) |
| | | ); |
| | | // System.out.println(remark); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day"))return; |
| | | if (isDay.equals("day")) return; |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate, alarmRule); |
| | | } |
| | |
| | | * @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,String isDay) { |
| | | public Map<String, Object> damSafetySyOrangeChangeHandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day"))return map; |
| | | if (isDay.equals("day")) return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetySyOrangeChangeHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid,String isDay) { |
| | | public void damSafetySyOrangeChangeHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | |
| | | noticeHandle.addPatrolTechnologyInfo(list, false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | |
| | | String remark = StringUtil.format("一日测值:{}\n二日测值:{}\n五日测值:{}\n十日测值:{}\n三十日测值:{}\n" + |
| | | "二日变幅:{}\n五日变幅:{}\n十日变幅:{}\n三十日变幅:{}\n", |
| | | list.get(14), list.get(15), list.get(16), list.get(17), list.get(18), |
| | | list.get(19), list.get(20), list.get(21), list.get(22) |
| | | ); |
| | | list.remove(14); |
| | | list.remove(15); |
| | | list.remove(16); |
| | | list.remove(17); |
| | | list.remove(18); |
| | | list.remove(19); |
| | | list.remove(20); |
| | | list.remove(21); |
| | | list.remove(22); |
| | | // System.out.println(remark); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day"))return; |
| | | if (isDay.equals("day")) return; |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate, alarmRule); |
| | | } |
| | |
| | | * @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,String isDay) { |
| | | public Map<String, Object> damSafetySyRedChangeHandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day"))return map; |
| | | if (isDay.equals("day")) return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetySyRedChangeHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid,String isDay) { |
| | | public void damSafetySyRedChangeHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | |
| | | noticeHandle.addPatrolTechnologyInfo(list, false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | |
| | | String remark = StringUtil.format("一日测值:{}\n二日测值:{}\n五日测值:{}\n十日测值:{}\n三十日测值:{}\n" + |
| | | "二日变幅:{}\n五日变幅:{}\n十日变幅:{}\n三十日变幅:{}\n", |
| | | list.get(14), list.get(15), list.get(16), list.get(17), list.get(18), |
| | | list.get(19), list.get(20), list.get(21), list.get(22) |
| | | ); |
| | | list.remove(14); |
| | | list.remove(15); |
| | | list.remove(16); |
| | | list.remove(17); |
| | | list.remove(18); |
| | | list.remove(19); |
| | | list.remove(20); |
| | | list.remove(21); |
| | | list.remove(22); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day"))return; |
| | | if (isDay.equals("day")) return; |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate, alarmRule); |
| | | } |
| | |
| | | * @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,String isDay) { |
| | | public Map<String, Object> damSafetySyRz1hChangeHandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | |
| | | noticeHandle.addPatrolTechnologyInfo(list, false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day"))return map; |
| | | if (isDay.equals("day")) return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetySyRz1hChangeHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid,String isDay) { |
| | | public void damSafetySyRz1hChangeHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | |
| | | noticeHandle.addPatrolTechnologyInfo(list, false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | |
| | | String remark = StringUtil.format("当前测值:{}\n近1H测值:{}\n{}:{}\n", |
| | | list.get(11), list.get(14), list.get(12), list.get(13) |
| | | ); |
| | | // 不拼接短信内容需要删除 |
| | | list.remove(14); |
| | | System.out.println(remark); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day"))return; |
| | | if (isDay.equals("day")) return; |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate, alarmRule); |
| | | } |
| | |
| | | * @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,String isDay) { |
| | | public Map<String, Object> damSafetyWyOver2Less5HandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day"))return map; |
| | | if (isDay.equals("day")) return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetyWyOver2Less5HandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid,String isDay) { |
| | | public void damSafetyWyOver2Less5HandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list, false); |
| | | |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | |
| | | String remark = StringUtil.format("上下游:{}\n左右岸:{}\n垂直位移:{}\n", |
| | | list.get(13), list.get(14), list.get(15) |
| | | ); |
| | | list.remove(13); |
| | | list.remove(14); |
| | | list.remove(15); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day"))return; |
| | | if (isDay.equals("day")) return; |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate, alarmRule); |
| | | } |
| | |
| | | * @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,String isDay) { |
| | | public Map<String, Object> damSafetyWyOver5Less10HandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day"))return map; |
| | | if (isDay.equals("day")) return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetyWyOver5Less10HandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid,String isDay) { |
| | | public void damSafetyWyOver5Less10HandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | |
| | | noticeHandle.addPatrolTechnologyInfo(list, false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | |
| | | String remark = StringUtil.format("上下游:{}\n左右岸:{}\n垂直位移:{}\n", |
| | | list.get(13), list.get(14), list.get(15) |
| | | ); |
| | | list.remove(13); |
| | | list.remove(14); |
| | | list.remove(15); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day"))return; |
| | | if (isDay.equals("day")) return; |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate, alarmRule); |
| | | } |
| | |
| | | * @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,String isDay) { |
| | | public Map<String, Object> damSafetyWyOver10HandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | |
| | | noticeHandle.addPatrolTechnologyInfo(list, false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | |
| | | String remark = StringUtil.format("上下游:{}\n左右岸:{}\n垂直位移:{}\n", |
| | | list.get(13), list.get(14), list.get(15) |
| | | ); |
| | | list.remove(13); |
| | | list.remove(14); |
| | | list.remove(15); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day"))return map; |
| | | if (isDay.equals("day")) return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetyWyOver10HandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid,String isDay) { |
| | | public void damSafetyWyOver10HandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | |
| | | noticeHandle.addPatrolTechnologyInfo(list, false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | |
| | | String remark = StringUtil.format("上下游:{}\n左右岸:{}\n垂直位移:{}\n", |
| | | list.get(13), list.get(14), list.get(15) |
| | | ); |
| | | list.remove(13); |
| | | list.remove(14); |
| | | list.remove(15); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day"))return; |
| | | if (isDay.equals("day")) return; |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate, alarmRule); |
| | | } |
| | |
| | | noticeHandle.addPatrolTechnologyInfo(list, false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | |
| | | String remark = StringUtil.format("当前:{}\n一日:{}\n二日:{}\n", |
| | | list.get(11), list.get(12), list.get(13) |
| | | ); |
| | | list.remove(12); |
| | | list.remove(13); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 策略42 站内信----- 超防洪高水位告警 |
| | | * |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param ztData 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void topLevOfFloAlertHandleStation(AlarmRule alarmRule, |
| | | AlarmRuleDetail alarmRuleDetail, |
| | | JSONArray data, |
| | | List<String> columnList, |
| | | boolean flag, |
| | | String adCode, |
| | | boolean isSendStation, |
| | | String uuid, |
| | | String isDay |
| | | ) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | String remark = StringUtil.format("水位:{}\n防洪高水位:{}米\n超防洪高水位:{}米\n", |
| | | list.get(9), list.get(13), String.format("%.2f", Double.valueOf(list.get(9).replace("米", "")) - Double.valueOf(list.get(13))) |
| | | ); |
| | | list.remove(13); |
| | | System.out.println(remark); |
| | | // 依次添加行政责任人,主管部门责任人,技术责任人,巡查责任人信息(姓名,联系电话) |
| | | noticeHandle.addWaterMoreDesignPatrolTechnologyInfo(list, "1,2,4,5"); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid,remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | |
| | | //如果参数是day,表示是每天生成告警,不需要发信息 |
| | | if (isDay.equals("day")) return; |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate, alarmRule); |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.google.common.collect.Lists; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | |
| | | set.add(tempStr); |
| | | String stcd = jsonArray.getJSONObject(i).getString("stcd"); |
| | | if (StringUtil.isBlank(stcd)) { |
| | | stcd = jsonArray.getJSONObject(i).getString("rain_stcd"); |
| | | } |
| | | if (StringUtil.isBlank(stcd)) { |
| | | stcd = jsonArray.getJSONObject(i).getString("cd"); |
| | | } |
| | | //如果stcd是空的就设置为-1 |
| | |
| | | // 加入集合 |
| | | list.add(format); |
| | | } |
| | | lists.add(list); |
| | | //处理重复发送手机号 |
| | | boolean isAdd = true; |
| | | for (List<String> listStr : lists) { |
| | | if (listStr.contains(res_cd) && listStr.contains(personVO.getPhone())) { |
| | | isAdd = false; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (isAdd) |
| | | lists.add(list); |
| | | } |
| | | } |
| | | personLists.addAll(personVOList); |
| | |
| | | return format; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存告警记录信息 |
| | | * |
| | |
| | | */ |
| | | public AlarmRecord saveAlarmRecord(List<String> list, AlarmRule alarmRule, String uuid) { |
| | | AlarmRecord alarmRecord = alarmRecordService.getOne(new QueryWrapper<AlarmRecord>() |
| | | // .eq("temp_code", uuid) |
| | | .eq("temp_code", uuid) |
| | | .eq("alarm_rule_id", alarmRule.getId()) |
| | | .eq("reservoir_number", list.get(1)) |
| | | .eq("alarm_survey_station_code",list.get(0)) |
| | | // .eq("alarm_survey_station_code",list.get(0)) |
| | | ); |
| | | if (null != alarmRecord) { |
| | | |
| | | if (null!=alarmRecord) { |
| | | //删除测值 |
| | | list.remove(3); |
| | | // 删除测站编号 |
| | |
| | | alarm.setAlarmCondition(alarmRule.getRuleRemark()); |
| | | alarm.setTempCode(uuid); |
| | | alarm.setMonitorData(list.get(3)); |
| | | //删除测值 |
| | | list.remove(3); |
| | | // 新增 |
| | | boolean save = alarmRecordService.save(alarm); |
| | | // 删除测站编号 |
| | | list.remove(0); |
| | | if (save) { |
| | | return alarm; |
| | | } |
| | | } |
| | | // 返回 |
| | | return null; |
| | | } |
| | | |
| | | public AlarmRecord saveAlarmRecord(List<String> list, AlarmRule alarmRule, String uuid, String remark) { |
| | | AlarmRecord alarmRecord = alarmRecordService.getOne(new QueryWrapper<AlarmRecord>() |
| | | .eq("temp_code", uuid) |
| | | .eq("alarm_rule_id", alarmRule.getId()) |
| | | .eq("reservoir_number", list.get(1)) |
| | | // .eq("alarm_survey_station_code",list.get(0)) |
| | | ); |
| | | if (null!=alarmRecord) { |
| | | //删除测值 |
| | | list.remove(3); |
| | | // 删除测站编号 |
| | | list.remove(0); |
| | | return alarmRecord; |
| | | } else { |
| | | AlarmRecord alarm = new AlarmRecord(); |
| | | // 设置相关信息 |
| | | alarm.setAlarmRuleId(alarmRule.getId().toString()); |
| | | // 分别设置测站编号和水库编码 |
| | | alarm.setAlarmSurveyStationCode(list.get(0)); |
| | | alarm.setReservoirNumber(list.get(1)); |
| | | alarm.setAlarmCondition(alarmRule.getRuleRemark()); |
| | | alarm.setTempCode(uuid); |
| | | alarm.setMonitorData(list.get(3)); |
| | | alarm.setRemark(remark); |
| | | //删除测值 |
| | | list.remove(3); |
| | | // 新增 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 依次添加巡查责任人,技术责任人信息,主管部门责任人 |
| | | * |
| | | * @param list |
| | | * @param isPhone 是否保护电话 |
| | | */ |
| | | public void addPatrolTechnologyInfoNew(List<String> list, Boolean isPhone) { |
| | | // 根据水库id查询巡查责任人姓名,技术责任人姓名信息 |
| | | List<PersonVO> personVOList = attResManagePersonClient.getPersonListByResGuid(list.get(1), "4,5,2"); |
| | | if (personVOList.size() > 0) { |
| | | String xczrr = "-"; |
| | | String jszrr = "-"; |
| | | String jgzrr = "-"; |
| | | for (PersonVO personVO : personVOList) { |
| | | if (personVO.getType().equals("5")) { |
| | | xczrr = isPhone ? personVO.getName() + ":" + personVO.getPhone() : personVO.getName(); |
| | | } |
| | | if (personVO.getType().equals("4")) { |
| | | jszrr = isPhone ? personVO.getName() + ":" + personVO.getPhone() : personVO.getName(); |
| | | } |
| | | if (personVO.getType().equals("2")) { |
| | | jgzrr = isPhone ? personVO.getName() + ":" + personVO.getPhone() : personVO.getName(); |
| | | } |
| | | } |
| | | // 巡查责任人姓名 |
| | | list.add(xczrr); |
| | | // 技术责任人姓名 |
| | | list.add(jszrr); |
| | | list.add(jgzrr); |
| | | } else { |
| | | // 巡查责任人姓名 |
| | | list.add("-"); |
| | | // 技术责任人姓名 |
| | | list.add("-"); |
| | | list.add("-"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 拼接市县水利部人员姓名及联系方式 |
| | | * |
| | | * @param list |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 依次添加行政责任人,主管部门责任人,技术责任人,巡查责任人信息 |
| | | * |
| | | * @param list |
| | | * @param personTypes |
| | | */ |
| | | public void addWaterMoreDesignPatrolTechnologyInfoNew(List<String> list, String personTypes) { |
| | | String[] split = personTypes.split(","); |
| | | // 查询巡查责任人姓名,技术责任人姓名信息 |
| | | List<PersonVO> personVOList = attResManagePersonClient.getPersonListByResGuid(list.get(1), personTypes); |
| | | if (personVOList.size() > 0) { |
| | | String zgzrr = "-"; |
| | | String jszrr = "-"; |
| | | String xczrr = "-"; |
| | | for (PersonVO personVO : personVOList) { |
| | | String str = null != personVO.getPhone() ? ":" + personVO.getPhone() : "-"; |
| | | if (personVO.getType().equals(split[0])) { |
| | | zgzrr = personVO.getName() + str; |
| | | } |
| | | if (personVO.getType().equals(split[1])) { |
| | | jszrr = personVO.getName() + str; |
| | | } |
| | | if (personVO.getType().equals(split[2])) { |
| | | xczrr = personVO.getName() + str; |
| | | } |
| | | } |
| | | |
| | | // 主管 |
| | | list.add(zgzrr); |
| | | // 技术责任人姓名 |
| | | list.add(jszrr); |
| | | // 巡查责任人姓名 |
| | | list.add(xczrr); |
| | | } else { |
| | | for (String type : split) { |
| | | list.add("-"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 调用中台接口查询数据 |
| | |
| | | return null; |
| | | } |
| | | |
| | | public Map<String, String> jsonObjectToMap(JSONObject jsonObject) { |
| | | Map<String, String> map = new HashMap<>(); |
| | | for (String key : jsonObject.keySet()) { |
| | | map.put(key, jsonObject.get(key).toString()); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 调用中台接口查询数据,返回结果不同处理 |
| | |
| | | } |
| | | 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() + "智能外呼"; |
| | | String taskName = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy年MM月dd日HH:mm:ss")) +"-"+ smsRequestTemplate.getAlarmRule().getRuleName() + "-智能外呼"; |
| | | map.put("taskName", taskName); |
| | | String taskScheduleTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | map.put("taskScheduleTime", taskScheduleTime); |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.time.LocalTime; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | // 电话,站内信需满足规定时间范围内才发送 |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.waterComeOverHandle(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.waterComeOverList, true, adCode, true); |
| | | } |
| | | } |
| | |
| | | */ |
| | | public String waterFirstOverHandle(String arg1, String arg2) { |
| | | String adCode = "421303000000"; |
| | | // String adCode = null; |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_over_z_small_over_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | if (alarmRuleDetailList.get(0).getAlarmMode().equals("短信")) { |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | // 返回 |
| | | return "水位小幅超汛限告警"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略7.1: 水位小幅超汛限告警2--水位高于汛限水位20cm |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String waterSmallScaleOver20Handle(String arg1, String arg2) { |
| | | // String adCode = "421303000000"; |
| | | String adCode = null; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("?diff_value=0.2", ZtApiUrlConstant.res_over_z_small_over_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterComeDesignHandleBySms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.waterComeDesignList1, true, adCode, false, uuid); |
| | | } |
| | | // if (alarmRuleDetail.getAlarmMode().equals("电话")) { |
| | | // 电话,站内信需满足规定时间范围内才发送 |
| | | // if (alarmRuleDetail.getAlarmMode().equals("电话") && isTimeSend()) { |
| | | // asyncNoticeHandle.outCallHandleCall(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterComeDesignList2,true, adCode, false,uuid); |
| | | // } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | // 电话,站内信需满足规定时间范围内才发送 |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.waterComeDesignHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.waterComeDesignList3, true, adCode, true, uuid); |
| | | } |
| | | } |
| | |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.over_des_rz_warn_api); |
| | | JSONArray ztData = noticeHandle.getZtData("?is_show=1", ZtApiUrlConstant.over_des_rz_warn_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterMoreDesignHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.waterMoreDesignList, true, adCode, false, uuid); |
| | | } |
| | | // if (alarmRuleDetail.getAlarmMode().equals("电话")) { |
| | | // if (alarmRuleDetail.getAlarmMode().equals("电话") && isTimeSend()) { |
| | | // asyncNoticeHandle.outCallHandleCall(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterMoreDesignList,true, adCode, false,uuid); |
| | | // } |
| | | } |
| | |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_over_chec_api); |
| | | JSONArray ztData = noticeHandle.getZtData("?is_show=1", ZtApiUrlConstant.res_over_chec_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterMoreCheckHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.waterMoreCheckList, true, adCode, false, uuid); |
| | | } |
| | | // if (alarmRuleDetail.getAlarmMode().equals("电话")) { |
| | | // if (alarmRuleDetail.getAlarmMode().equals("电话") && isTimeSend()) { |
| | | // asyncNoticeHandle.outCallHandleCall(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterMoreCheckList,true, adCode, false,uuid); |
| | | // } |
| | | } |
| | |
| | | // 遍历 |
| | | 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, false, adCode, false); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 遍历 |
| | | 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, false, adCode, false); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 遍历 |
| | | 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, false, adCode, false, uuid); |
| | | } |
| | | // if (alarmRuleDetail.getAlarmMode().equals("电话")) { |
| | | // if (alarmRuleDetail.getAlarmMode().equals("电话") && isTimeSend()) { |
| | | // asyncNoticeHandle.outCallHandleCall(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.sixHourRainList,true, adCode, false,uuid); |
| | | // } |
| | | } |
| | | } |
| | | } |
| | | // 返回 |
| | | return "6小时降雨告警"; |
| | | } |
| | | |
| | | /** |
| | | * 策略18: 6小时降雨告警2 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String sixHourRainHandle2(String arg1, String arg2) { |
| | | //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("?drp=50", ZtApiUrlConstant.alarm_rain_only_6_over_api); |
| | | // 外呼对应数据 |
| | | JSONArray whztData = noticeHandle.getZtData("?drp=100", ZtApiUrlConstant.alarm_rain_only_6_over_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.sixHourRainHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.sixHourRainList, false, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("电话") && isTimeSend()) { |
| | | asyncNoticeHandle.outCallHandleCall(alarmRule, alarmRuleDetail, whztData,ZtApiDataColumnConstant.sixHourRainList,false, adCode, false,uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetyHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.damSafetyList, true, adCode, false, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySyHandle(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.damSafetySyList, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyHandle(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.damSafetyList, false, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySyNoneHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.damSafetyList, false, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.damSafetyList, false, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySyNoneHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.damSafetyList, false, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyHandle(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.damSafetyList, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySyNoneHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.damSafetyList, false, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySyDataMissingHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syDataMissingList, false, adCode, true, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")){ |
| | |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySyDataMissingHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.bxDataMissingList, false, adCode, true, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")){ |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyLessThenPipeHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syLessThenPipe, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySyLessThenPipeHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syLessThenPipe, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyHigherThenNozzleHandleSms(alarmRule, alarmRuleDetail, resultData,ZtApiDataColumnConstant.syHigherThenNozzle,true, adCode, false,uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySyHigherThenNozzleHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syHigherThenNozzle, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyHigherThenBdElevationHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syHigherThenBdElevation, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySyHigherThenBdElevationHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syHigherThenBdElevation, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyHigherThenWaterLevelHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syHigherThenWaterLevel, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySyHigherThenWaterLevelHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syHigherThenWaterLevel, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyYellowChangeHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syYellowRzChange, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySyYellowChangeHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syYellowRzChange, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyOrangeChangeHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syOrangeRzChange, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySyOrangeChangeHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syOrangeRzChange, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyRedChangeHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syRedRzChange, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySyRedChangeHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syRedRzChange, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sy_rz_1h_change_api); |
| | | |
| | | // 处理数据 |
| | | JSONArray data = judgeType(ztData); |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData = filterNoAlertRes(data,arg1); |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyRz1hChangeHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syRz1hChange, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySyRz1hChangeHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syRz1hChange, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyWyOver2Less5HandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wyOver2Less5, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetyWyOver2Less5HandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wyOver2Less5, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyWyOver5Less10HandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wyOver5Less10, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetyWyOver5Less10HandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wyOver5Less10, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * 近1h变形值大于10cm以上 |
| | | * 变形值大于100mm |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | |
| | | // 查询当前策略对应的告警规则信息 |
| | | 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 ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_wy_value_api); |
| | | JSONArray data = judgeDirection(ztData, "3"); |
| | | |
| | | |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyWyOver10HandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wyOver10, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetyWyOver10HandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wyOver10, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyWy1hChangeOver10HandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wy1hChangeOver10, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetyWy1hChangeOver10HandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wy1hChangeOver10, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySlOverLessHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.slOverLess, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySlOverLessHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.slOverLess, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySlOverLessHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.slOverLess, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySlOverLessHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.slOverLess, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySlOverLessHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.slOverLess, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySlOverLessHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.slOverLess, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.videoOfflineHandleStation(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.videoOffline, false, adCode, true, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | |
| | | } |
| | | |
| | | return "视频信息缺失告警"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略42: 水位防洪高水位告警 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String topLevOfFloAlertHandle(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.over_flpr_rz_warn_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("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.topLevOfFloAlertHandleStation(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.topLevOfFloAlertList, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // 返回 |
| | | return "水位防洪高水位告警"; |
| | | } |
| | | |
| | | private JSONArray filterData(JSONArray ztData, String level) { |
| | |
| | | //左右岸方向 |
| | | Double dnVal = jsonObject.getDouble("dn_val"); |
| | | //垂直 |
| | | Double duValue = jsonObject.getDouble("du_value"); |
| | | Double duValue = jsonObject.getDouble("垂直位移"); |
| | | |
| | | String direction = ""; |
| | | String val = ""; |
| | |
| | | } |
| | | |
| | | jsonObject.put("type", type); |
| | | jsonObject.put("monitorData",jsonObject.getString("diff_val")); |
| | | jsonObject.put("monitorData",jsonObject.getString("sy_val")); |
| | | array.add(jsonObject); |
| | | } |
| | | return array; |
| | |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 是否在时间范围内发送 |
| | | * @return |
| | | */ |
| | | public boolean isTimeSend(){ |
| | | boolean flag = false; |
| | | // 判断时间范围 |
| | | // 开始时间 |
| | | LocalTime startTime = LocalTime.parse("08:00"); |
| | | // 结束时间 |
| | | LocalTime endTime = LocalTime.parse("22:00"); |
| | | // 当前时间 |
| | | LocalTime now = LocalTime.now(); |
| | | // 比较 |
| | | flag = !now.isBefore(startTime) && !now.isAfter(endTime); |
| | | // 返回 |
| | | return flag; |
| | | } |
| | | } |
| | |
| | | strategyMap.put("waterFirstOverHandle", (arg1, arg2) -> noticeStrategyImpl.waterFirstOverHandle(arg1, arg2)); |
| | | //7 |
| | | strategyMap.put("waterSmallScaleOverHandle", (arg1, arg2) -> noticeStrategyImpl.waterSmallScaleOverHandle(arg1, arg2)); |
| | | //7.1 |
| | | strategyMap.put("waterSmallScaleOver20Handle", (arg1, arg2) -> noticeStrategyImpl.waterSmallScaleOver20Handle(arg1, arg2)); |
| | | //8 |
| | | strategyMap.put("waterBigScaleOverHandle", (arg1, arg2) -> noticeStrategyImpl.waterBigScaleOverHandle(arg1, arg2)); |
| | | //9 |
| | |
| | | strategyMap.put("alreadyRainstormHandle", (arg1, arg2) -> noticeStrategyImpl.alreadyRainstormHandle(arg1, arg2)); |
| | | //17 |
| | | strategyMap.put("twoHourRainHandle", (arg1, arg2) -> noticeStrategyImpl.twoHourRainHandle(arg1, arg2)); |
| | | //18 |
| | | //18 6小时降雨告警 |
| | | strategyMap.put("sixHourRainHandle", (arg1, arg2) -> noticeStrategyImpl.sixHourRainHandle(arg1, arg2)); |
| | | //19 |
| | | //18 6小时降雨告警2 |
| | | strategyMap.put("sixHourRainHandle2", (arg1, arg2) -> noticeStrategyImpl.sixHourRainHandle2(arg1, arg2)); |
| | | //19 大坝安全监测告警-数据缺失 |
| | | strategyMap.put("damSafetyHandle", (arg1, arg2) -> noticeStrategyImpl.damSafetyHandle(arg1, arg2)); |
| | | //20 |
| | | //20 大坝安全监测告警-渗压管水位 |
| | | strategyMap.put("damSafetySyHandle", (arg1, arg2) -> noticeStrategyImpl.damSafetySyHandle(arg1, arg2)); |
| | | //21 渗压信息接收不到 |
| | | strategyMap.put("damSafetySyNoneHandle", (arg1, arg2) -> noticeStrategyImpl.damSafetySyNoneHandle(arg1, arg2)); |
| | |
| | | strategyMap.put("damSafetySlOver10Handle",(arg1,arg2)->noticeStrategyImpl.damSafetySlOver10Handle(arg1,arg2)); |
| | | //41 视频信息接收不到 |
| | | strategyMap.put("videoOfflineHandle",(arg1,arg2)->noticeStrategyImpl.videoOfflineHandle(arg1,arg2)); |
| | | //42 水位-超防洪高水位告警 |
| | | strategyMap.put("topLevOfFloAlertHandle",(arg1,arg2)->noticeStrategyImpl.topLevOfFloAlertHandle(arg1,arg2)); |
| | | } |
| | | |
| | | /** |
| | |
| | | saveCodeForRedis("super_admin","123456"); |
| | | } |
| | | |
| | | @GetMapping("/testSms") |
| | | public ComResult<DynSMSSendDataResult> testSms() { |
| | | String [][] str = { |
| | | {"手机号码","日期","小时","分钟","乡镇","水库名称","水库水位值","超过设计洪水位值", |
| | | "距离或漫过坝顶值及说明","雨量值","姓名联系电话1","姓名联系电话2","姓名联系电话3","姓名联系电话4","姓名联系电话最多6人"}, |
| | | {"18179770967","25","12","50","会昌县","测试水库","10.10","12.12", |
| | | "距离或漫过坝顶值及说明","10.13","谢斌18179770967","钟日健14212457896","qwe13426007894","asd13685201234","aix18179770967;aix21234567891"}, |
| | | {"15170720695","25","12","50","会昌县","测试水库","10.10","12.12", |
| | | "距离或漫过坝顶值及说明","10.13","谢斌18179770967","钟日健14212457896","qwe13426007894","asd13685201234","aix18179770967;aix21234567891"}, |
| | | {"15179776420","25","12","50","会昌县","测试水库","10.10","12.12", |
| | | "距离或漫过坝顶值及说明","10.13","谢斌18179770967","钟日健14212457896","qwe13426007894","asd13685201234","aix18179770967;aix21234567891"} |
| | | }; |
| | | String tempId = "2431012216677"; |
| | | return smsService.testSend(tempId,str); |
| | | } |
| | | |
| | | /** |
| | | * 短信固定内容发送通用方法(仅支持 {xx} 模式的模板) |
| | | * request 必须包含手机号,模板id,拼接好的内容 |
| | |
| | | // 发送操作 |
| | | ComResult<SMSSendDataResult> resultComResult = SmsUtils.sendMsg(request); |
| | | // 记录发送记录操作 |
| | | SmsResult smsResult = smsService.saveSendResult(resultComResult.getCode().toString(),resultComResult.getMsg(),request, 1); |
| | | SmsResult smsResult = smsService.saveSendResult(null,resultComResult.getCode().toString(),resultComResult.getMsg(),request, 1); |
| | | if (null != smsResult){ |
| | | smsService.saveSendRecord(request, resultComResult.getCode().toString(),resultComResult.getMsg(),smsResult.getId()); |
| | | } |
| | |
| | | // 发送操作 |
| | | ComResult<SMSSendDataResult> resultComResult = SmsUtils.sendMsg(request); |
| | | // 记录发送记录操作 |
| | | SmsResult smsResult = smsService.saveSendResult(resultComResult.getCode().toString(),resultComResult.getMsg(),request, 1); |
| | | SmsResult smsResult = smsService.saveSendResult(null,resultComResult.getCode().toString(),resultComResult.getMsg(),request, 1); |
| | | if (null != smsResult){ |
| | | smsService.saveSendRecord(request, resultComResult.getCode().toString(),resultComResult.getMsg(),smsResult.getId()); |
| | | } |
| | |
| | | |
| | | import cn.com.flaginfo.sdk.cmc.api.sms.send.SMSSendRequest; |
| | | import cn.gistack.alerts.sms.entity.SmsResult; |
| | | import cn.gistack.alerts.sms.service.ISmsResultService; |
| | | import cn.gistack.alerts.sms.service.SmsService; |
| | | import cn.gistack.alerts.sms.vo.SmsResponseVO; |
| | | import cn.gistack.alerts.sms.vo.SmsResultVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | public class SmsRecordClient implements ISmsRecordClient { |
| | | |
| | | private final SmsService smsService; |
| | | private final ISmsResultService smsResultService; |
| | | |
| | | @Override |
| | | public List<SmsResultVO> smsSuccessList(SmsResultVO smsResult) { |
| | | List<SmsResultVO> resultVOList = (List<SmsResultVO>) smsResultService.selectSmsResultPage(null, smsResult); |
| | | return resultVOList; |
| | | } |
| | | |
| | | /** |
| | | * 短信记录发送保存 |
| | |
| | | request.setTemplateId(templateId); |
| | | request.setMessageContent(messageContent); |
| | | // 记录发送记录操作 |
| | | SmsResult smsResult = smsService.saveSendResult(code,msg,request, number); |
| | | SmsResult smsResult = smsService.saveSendResult(null,code,msg,request, number); |
| | | if (null != smsResult){ |
| | | smsService.saveSendRecord(request, code,msg,smsResult.getId()); |
| | | } |
| | |
| | | sar.rule_name as ruleName, |
| | | sst.content templateContent,sst.sms_type as smsType |
| | | from sm_sms_result ssr |
| | | left join YWXT.sm_alarm_rule sar on sar.id = ssr.alarm_rule_id |
| | | left join sm_sms_template sst on sst.template_id = ssr.template_id and sst.is_deleted = 0 |
| | | left join YWXT.sm_alarm_rule_detail sard on sard.template_id = sst.id |
| | | left join YWXT.sm_alarm_rule sar on sar.id = sard.alarm_rule_id |
| | | where 1=1 and ssr.is_deleted = 0 |
| | | <if test="smsResult.templateId!=null and smsResult.templateId!=''"> |
| | | and ssr.template_id = #{smsResult.templateId} |
| | |
| | | and sst.content like concat('%',#{smsResult.templateContent},'%') |
| | | </if> |
| | | <if test="smsResult.startTime!=null and smsResult.startTime!=''"> |
| | | and date_format(ssr.create_time,'%Y-%m-%d') >= #{smsResult.startTime} |
| | | and ssr.create_time >= #{smsResult.startTime} |
| | | </if> |
| | | <if test="smsResult.endTime!=null and smsResult.endTime!=''"> |
| | | and date_format(ssr.create_time,'%Y-%m-%d') <= #{smsResult.endTime} |
| | | and ssr.create_time <= #{smsResult.endTime} |
| | | </if> |
| | | <if test="smsResult.smsType!=null and smsResult.smsType!=''"> |
| | | and sst.sms_type = #{smsResult.smsType} |
| | |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | order by id desc |
| | | order by ssr.id desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | */ |
| | | public interface SmsService { |
| | | |
| | | public ComResult<DynSMSSendDataResult> testSend(String tempId,String [][] strss); |
| | | |
| | | /** |
| | | * 发送 xx 变量模板短信 |
| | | * @param phoneNumbers 手机号集合 |
| | |
| | | * @param number |
| | | * @return |
| | | */ |
| | | SmsResult saveSendResult(String code,String msg, SMSSendRequest request, Integer number); |
| | | SmsResult saveSendResult(Long alarmRuleId,String code,String msg, SMSSendRequest request, Integer number); |
| | | |
| | | /** |
| | | * 短信发送记录保存 |
| | |
| | | @Autowired |
| | | private NoticeHandle noticeHandle; |
| | | |
| | | @Override |
| | | public ComResult<DynSMSSendDataResult> testSend(String tempId, String[][] strss) { |
| | | return sendDynSMSSendDataResultComResult(tempId,strss); |
| | | } |
| | | |
| | | /** |
| | | * 发送 xx 变量模板短信 |
| | | * @param phoneNumbers 手机号集合 |
| | |
| | | List<ComResult<SMSSendDataResult>> list = new ArrayList<>(); |
| | | if (phoneNumbers.size()>0){ |
| | | // 先保存结果记录 |
| | | SmsResult smsResult = saveSendResult(null,null,request, phoneNumbers.size()); |
| | | SmsResult smsResult = saveSendResult(null,null,null,request, phoneNumbers.size()); |
| | | // 遍历发送 |
| | | for (String phone : phoneNumbers) { |
| | | request.setUserNumber(phone); |
| | |
| | | SmsTemplate smsTemplate = smsRequestTemplate.getSmsTemplate(); |
| | | request.setTemplateId(smsTemplate.getTemplateId()); |
| | | List<List<String>> templateContent = smsRequestTemplate.getTemplateContent(); |
| | | AlarmRule alarmRule = smsRequestTemplate.getAlarmRule(); |
| | | // 是否同时发送站内信 |
| | | Boolean isSendStation = false; |
| | | if (null!=smsRequestTemplate.getIsSendStation()){ |
| | |
| | | int count = Integer.parseInt(map.get("errCount").toString()); |
| | | ComResult<DynSMSSendDataResult> resultComResult =(ComResult<DynSMSSendDataResult>) map.get("resultComResult"); |
| | | // 保存短信结果记录 |
| | | SmsResult smsResult = saveSendResult(resultComResult.getCode().toString(),resultComResult.getMsg(),request, list.size() - count); |
| | | SmsResult smsResult = saveSendResult(alarmRule.getId(),resultComResult.getCode().toString(),resultComResult.getMsg(),request, list.size() - count); |
| | | // 保存详情记录(短信详情,告警详情) |
| | | List<SmsRecord> smsRecordList = saveAlertsAndSmsDetail(smsResult,resultComResult,smsRequestTemplate.getSmsTemplate(), |
| | | templateList,request,smsRequestTemplate.getAlarmRule(),isSendStation); |
| | |
| | | * @param number 号码个数 |
| | | */ |
| | | @Override |
| | | public SmsResult saveSendResult(String code,String msg, SMSSendRequest request, Integer number) { |
| | | public SmsResult saveSendResult(Long alarmRuleId,String code,String msg, SMSSendRequest request, Integer number) { |
| | | // 先保存结果表 |
| | | SmsResult smsResult = new SmsResult(); |
| | | smsResult.setTemplateId(request.getTemplateId()); |
| | | smsResult.setNumber(number); |
| | | smsResult.setResCode(code); |
| | | smsResult.setResMsg(msg); |
| | | smsResult.setAlarmRuleId(alarmRuleId); |
| | | //插入记录 |
| | | boolean save = smsResultService.save(smsResult); |
| | | if (save){ |
| | |
| | | SMSSendRequest request = new SMSSendRequest(); |
| | | request.setTemplateId(templateId); |
| | | // 先保存结果记录 |
| | | return saveSendResult(code,msg,request, rows.length); |
| | | return saveSendResult(null,code,msg,request, rows.length); |
| | | } |
| | | |
| | | /** |
| | |
| | | SmsTemplate smsTemplate = smsRequestTemplate.getSmsTemplate(); |
| | | request.setTemplateId(smsTemplate.getTemplateId()); |
| | | List<List<String>> templateContent = smsRequestTemplate.getTemplateContent(); |
| | | AlarmRule alarmRule = smsRequestTemplate.getAlarmRule(); |
| | | List<Temp> tempList = new ArrayList<>(); |
| | | // 合并数据 |
| | | for (List<String> list : templateContent) { |
| | |
| | | //请求参数 |
| | | ComResult<DynSMSSendDataResult> resultComResult = sendDynSMSSendDataResultComResult(smsTemplate.getTemplateId(), dyns); |
| | | // 先保存结果记录 |
| | | SmsResult smsResult = saveSendResult(resultComResult.getCode().toString(),resultComResult.getMsg(),request, 1); |
| | | SmsResult smsResult = saveSendResult(alarmRule.getId(),resultComResult.getCode().toString(),resultComResult.getMsg(),request, 1); |
| | | // 设置手机号 |
| | | request.setUserNumber(s); |
| | | // 内容处理 |
| | |
| | | SmsTemplate smsTemplate = smsRequestTemplate.getSmsTemplate(); |
| | | request.setTemplateId(smsTemplate.getTemplateId()); |
| | | List<List<String>> templateContent = smsRequestTemplate.getTemplateContent(); |
| | | AlarmRule alarmRule = smsRequestTemplate.getAlarmRule(); |
| | | List<Temp> tempList = new ArrayList<>(); |
| | | // 合并数据 |
| | | for (List<String> list : templateContent) { |
| | |
| | | //请求参数 |
| | | ComResult<DynSMSSendDataResult> resultComResult = sendDynSMSSendDataResultComResult(smsTemplate.getTemplateId(), dyns); |
| | | // 先保存结果记录 |
| | | SmsResult smsResult = saveSendResult(resultComResult.getCode().toString(),resultComResult.getMsg(),request, 1); |
| | | SmsResult smsResult = saveSendResult(alarmRule.getId(),resultComResult.getCode().toString(),resultComResult.getMsg(),request, 1); |
| | | // 设置手机号 |
| | | request.setUserNumber(s); |
| | | // 内容处理 |
| | |
| | | SmsTemplate smsTemplate = smsRequestTemplate.getSmsTemplate(); |
| | | request.setTemplateId(smsTemplate.getTemplateId()); |
| | | List<List<String>> templateContent = smsRequestTemplate.getTemplateContent(); |
| | | AlarmRule alarmRule = smsRequestTemplate.getAlarmRule(); |
| | | List<Temp> tempList = new ArrayList<>(); |
| | | // 合并数据 |
| | | for (List<String> list : templateContent) { |
| | |
| | | //请求参数 |
| | | ComResult<DynSMSSendDataResult> resultComResult = sendDynSMSSendDataResultComResult(smsTemplate.getTemplateId(), dyns); |
| | | // 先保存结果记录 |
| | | SmsResult smsResult = saveSendResult(resultComResult.getCode().toString(),resultComResult.getMsg(),request, 1); |
| | | SmsResult smsResult = saveSendResult(alarmRule.getId(),resultComResult.getCode().toString(),resultComResult.getMsg(),request, 1); |
| | | // 设置手机号 |
| | | request.setUserNumber(s); |
| | | // 内容处理 |
| | |
| | | SmsTemplate smsTemplate, |
| | | List<String> rowList, |
| | | List<AlarmRecordDetailVO> alarmRecordDetailList) { |
| | | AlarmRule alarmRule = smsRequestTemplate.getAlarmRule(); |
| | | // 组装数据 |
| | | String[] titleArr = smsRequestTemplate.getTitle().split(","); |
| | | String[][] dyns = new String[rowList.size() + 1][titleArr.length]; |
| | |
| | | //请求参数 |
| | | ComResult<DynSMSSendDataResult> resultComResult = sendDynSMSSendDataResultComResult(smsTemplate.getTemplateId(), dyns); |
| | | // 先保存结果记录 |
| | | SmsResult smsResult = saveSendResult(resultComResult.getCode().toString(),resultComResult.getMsg(),request, rowList.size()); |
| | | SmsResult smsResult = saveSendResult(alarmRule.getId(),resultComResult.getCode().toString(),resultComResult.getMsg(),request, rowList.size()); |
| | | List<AlarmRecordDetail> alarmRecordDetailArrayList = new ArrayList<>(); |
| | | // 遍历 |
| | | for (AlarmRecordDetailVO alarmRecordDetailVO : alarmRecordDetailList) { |
| | |
| | | url: ${blade.datasource.dev.znwh.url} |
| | | username: ${blade.datasource.dev.znwh.username} |
| | | password: ${blade.datasource.dev.znwh.password} |
| | | #水文预警(oracle) |
| | | swyj: |
| | | driver-class-name: ${blade.datasource.dev.swyj.driver-class-name} |
| | | url: ${blade.datasource.dev.swyj.url} |
| | | username: ${blade.datasource.dev.swyj.username} |
| | | password: ${blade.datasource.dev.swyj.password} |
| | | #站点水文信息(oracle) |
| | | zdsw: |
| | | driver-class-name: ${blade.datasource.dev.zdsw.driver-class-name} |
| | | url: ${blade.datasource.dev.zdsw.url} |
| | | username: ${blade.datasource.dev.zdsw.username} |
| | | password: ${blade.datasource.dev.zdsw.password} |
| | | main: |
| | | allow-circular-references: true |
| | | getui: |
| | |
| | | url: ${blade.datasource.prod.znwh.url} |
| | | username: ${blade.datasource.prod.znwh.username} |
| | | password: ${blade.datasource.prod.znwh.password} |
| | | #水文预警(oracle) |
| | | swyj: |
| | | driver-class-name: ${blade.datasource.prod.swyj.driver-class-name} |
| | | url: ${blade.datasource.prod.swyj.url} |
| | | username: ${blade.datasource.prod.swyj.username} |
| | | password: ${blade.datasource.prod.swyj.password} |
| | | #站点水文信息(oracle) |
| | | zdsw: |
| | | driver-class-name: ${blade.datasource.prod.zdsw.driver-class-name} |
| | | url: ${blade.datasource.prod.zdsw.url} |
| | | username: ${blade.datasource.prod.zdsw.username} |
| | | password: ${blade.datasource.prod.zdsw.password} |
| | | main: |
| | | allow-circular-references: true |
| | | getui: |
| | |
| | | url: ${blade.datasource.test.znwh.url} |
| | | username: ${blade.datasource.test.znwh.username} |
| | | password: ${blade.datasource.test.znwh.password} |
| | | swyj: |
| | | driver-class-name: ${blade.datasource.test.swyj.driver-class-name} |
| | | url: ${blade.datasource.test.swyj.url} |
| | | username: ${blade.datasource.test.swyj.username} |
| | | password: ${blade.datasource.test.swyj.password} |
| | | #站点水文信息(oracle) |
| | | zdsw: |
| | | driver-class-name: ${blade.datasource.test.zdsw.driver-class-name} |
| | | url: ${blade.datasource.test.zdsw.url} |
| | | username: ${blade.datasource.test.zdsw.username} |
| | | password: ${blade.datasource.test.zdsw.password} |
| | | main: |
| | | allow-circular-references: true |
| | | getui: |
| | |
| | | JSONObject targetJson = new JSONObject(); |
| | | targetJson.put("TimeStamp", String.valueOf(System.currentTimeMillis())); |
| | | targetJson.put("Token", getToken()); |
| | | targetJson.put("Algorithm", "1445a67edb89302f6b9f055112b42c13"); |
| | | targetJson.put("Algorithm", "SM4"); |
| | | |
| | | jsonParm.put("Target", targetJson); |
| | | return apiRequest(url, jsonParm.toJSONString()).getData(); |
| | |
| | | } |
| | | |
| | | public ResultDTO apiRequest(String url, String params) { |
| | | logger.info("url:" + url); |
| | | logger.info("请求参数:" + params); |
| | | // 声明一个header变量 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | |
| | | <artifactId>im4java</artifactId> |
| | | <version>1.4.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.hutool</groupId> |
| | | <artifactId>hutool-all</artifactId> |
| | | <version>5.8.25</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework</groupId> |
| | | <artifactId>spring-mock</artifactId> |
| | | <version>2.0.8</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | } |
| | | |
| | | /** |
| | | * 大坝安全监测预警异常统计 |
| | | * 大坝安全监测预警异常统计-南科院 |
| | | * @param damStationStatistics |
| | | * @return |
| | | */ |
| | |
| | | return R.data(list); |
| | | } |
| | | |
| | | /** |
| | | * 大坝安全监测预警异常统计-中台预警 |
| | | * @param damMonitor |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "大坝安全统计-大坝安全监测预警异常统计", notes = "大坝安全统计-大坝安全监测预警异常统计") |
| | | @GetMapping(value = "/alarmResCountZt") |
| | | public R alarmResCountZt(DamMonitor damMonitor){ |
| | | if (StringUtil.isBlank(damMonitor.getStartTime()) || StringUtil.isBlank(damMonitor.getEndTime())) |
| | | return R.fail("查询时间不能为空"); |
| | | List<DamStationStatistics> list = damSecurityService.alarmResCount(damMonitor); |
| | | return R.data(list); |
| | | } |
| | | |
| | | // /** |
| | | // * 业务一张图 大坝安全监测 |
| | | // * @param adCode |
| | |
| | | |
| | | List<DamStationStatistics> alarmResCount(@Param("dam") DamStationStatistics damStationStatistics,@Param("basCodes") String basCodes); |
| | | |
| | | List<DamStationStatistics> alarmResCountByZt(@Param("dam") DamMonitor damMonitor); |
| | | |
| | | List<DamStatisticsRes> damResInfoCount(@Param("adCode") String adCode); |
| | | |
| | | List<DamStationStatistics> getResErrorList(@Param("dam") DamStatisticsRes damStatisticsRes, @Param("adCode") String adCode); |
| | |
| | | |
| | | |
| | | |
| | | <select id="alarmResCountByZt" resultType="cn.gistack.sm.damSecurity.vo.DamStationStatistics"> |
| | | SELECT |
| | | arb."center_long" AS longitude, |
| | | arb."center_lat" AS latitude, |
| | | arb."name" as resName, |
| | | sar.reservoir_number resCd, |
| | | abb."code" AS basCode, |
| | | abb."name" AS basName |
| | | FROM |
| | | ( |
| | | |
| | | select sar.* from YWXT.sm_alarm_record sar |
| | | left join ywxt.sm_alarm_rule b on (sar.alarm_rule_id = b.id) |
| | | where sar.create_time >= #{dam.startTime} and sar.create_time <= #{dam.endTime} |
| | | and b.create_alarm_type not like '%缺失%' |
| | | and (b.type = '渗压监测' or b.type = '变形监测' or b.type = '渗流监测') |
| | | and (b.ALARM_LEVEL = '红色预警' or b.ALARM_LEVEL = '橙色预警') |
| | | ) sar |
| | | LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = sar.reservoir_number |
| | | 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."guid" = town."p_ad_code" |
| | | LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code" |
| | | LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code" |
| | | |
| | | LEFT JOIN SJZT_MD."rel_res_bas_loc" rrbl ON rrbl."res_guid" = sar.reservoir_number |
| | | LEFT JOIN SJZT_MD."att_bas_base" abb ON abb."code" = rrbl."bas_guid" |
| | | LEFT JOIN SJZT_MD."att_bas_base" pabb ON abb."p_code" = pabb."code" |
| | | </select> |
| | | |
| | | <select id="alarmResCount" resultType="cn.gistack.sm.damSecurity.vo.DamStationStatistics"> |
| | | SELECT |
| | | arb."center_long" AS longitude, |
| | |
| | | */ |
| | | List<DamStationStatistics> alarmResCount(DamStationStatistics damStationStatistics,String basCode); |
| | | |
| | | List<DamStationStatistics> alarmResCount(DamMonitor damMonitor); |
| | | |
| | | /** |
| | | * 业务一张图大坝安全监测 |
| | | * @param adCode 行政区划 |
| | |
| | | import cn.gistack.sm.damSecurity.mapper.DamSecurityMapper; |
| | | import cn.gistack.sm.damSecurity.service.IDamSecurityService; |
| | | import cn.gistack.sm.damSecurity.vo.*; |
| | | 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; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLDecoder; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<DamStationStatistics> alarmResCount(DamMonitor damMonitor) { |
| | | return damSecurityMapper.alarmResCountByZt(damMonitor); |
| | | } |
| | | |
| | | @Override |
| | | public List<DamStatisticsRes> damResInfoCount(String adCode) { |
| | | |
| | | List<DamStatisticsRes> list = damSecurityMapper.damResInfoCount(adCode); |
| | |
| | | */ |
| | | public static final String regionNodesByParamsURLs = "/api/irds/v2/region/nodesByParams"; |
| | | |
| | | /** |
| | | * 查询水尺监测信息 |
| | | */ |
| | | public static final String waterGaugeURLs = "/api/v1/waterGauge/list"; |
| | | |
| | | |
| | | |
| | |
| | | * 区域入侵 131588 |
| | | * 徘徊侦测 131590 |
| | | * 人员聚集 131593 |
| | | * 监控点离线 889196545 |
| | | */ |
| | | public static List<String> videoList = new ArrayList<>() |
| | | {{ |
| | |
| | | add("131588"); |
| | | add("131590"); |
| | | add("131593"); |
| | | add("889196545"); |
| | | }}; |
| | | |
| | | /** |
| | |
| | | put("131590","loitering"); |
| | | put("131593","group"); |
| | | }}; |
| | | |
| | | /** |
| | | * 海康事件图片基础路径 |
| | | */ |
| | | public static Map<String,String> picUrlMap = new HashMap() |
| | | {{ |
| | | put("test","https://sk.hubeishuiyi.cn/haikEventSfImg"); |
| | | put("dev","https://sk.hubeishuiyi.cn/haikEventSfImg"); |
| | | put("prod","https://sk.hubeishuiyi.cn/haikEventSfImg"); |
| | | }}; |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "海康设备-海康摄像头云台的控制", notes = "海康设备-海康摄像头云台的控制") |
| | | @GetMapping(value = "/handleCameraPosition") |
| | | @GetMapping(value = "/handleCameraPosition2") |
| | | public R handleCameraPosition(HkVO hk) { |
| | | // 获取海康播放url |
| | | String result = controlling(null==hk.getType()?1:hk.getType(),HkConstant.controllingURLs, |
| New file |
| | |
| | | package cn.gistack.sm.hk.controller; |
| | | |
| | | |
| | | import cn.gistack.sm.hk.entity.HkStaffGaugeMon; |
| | | import cn.gistack.sm.hk.service.HkStaffGaugeMonService; |
| | | import cn.gistack.sm.hk.vo.HkStaffGaugeMonVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * @author zhongrj |
| | | * @Description: 水尺监测 |
| | | * @date 2024-06-05 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = "水尺监测") |
| | | @RestController |
| | | @RequestMapping("/hk/hkStaffGaugeMon") |
| | | @AllArgsConstructor |
| | | public class HkStaffGaugeMonController { |
| | | |
| | | private final HkStaffGaugeMonService hkStaffGaugeMonService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | | * |
| | | * @param hkStaffGaugeMon |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="水尺监测-分页列表查询", notes="水尺监测-分页列表查询") |
| | | @GetMapping(value = "/list") |
| | | public R queryPageList(HkStaffGaugeMon hkStaffGaugeMon, Query query) { |
| | | IPage<HkStaffGaugeMon> pageList = hkStaffGaugeMonService.page(Condition.getPage(query), Condition.getQueryWrapper(hkStaffGaugeMon)); |
| | | return R.data(pageList); |
| | | } |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * @param query |
| | | * @param hkStaffGaugeMon |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="水尺监测-自定义分页列表查询", notes="水尺监测-自定义分页列表查询") |
| | | @GetMapping(value = "/page") |
| | | public R selectAlarmPage(HkStaffGaugeMonVO hkStaffGaugeMon, Query query) { |
| | | return R.data(hkStaffGaugeMonService.selectHkStaffGaugeMonPage(Condition.getPage(query),hkStaffGaugeMon)); |
| | | } |
| | | |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @param hkStaffGaugeMon |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="水尺监测-添加", notes="水尺监测-添加") |
| | | @PostMapping(value = "/add") |
| | | public R add(@RequestBody HkStaffGaugeMon hkStaffGaugeMon) { |
| | | return R.data(hkStaffGaugeMonService.save(hkStaffGaugeMon)); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param hkStaffGaugeMon |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="水尺监测-编辑", notes="水尺监测-编辑") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public R edit(@RequestBody HkStaffGaugeMon hkStaffGaugeMon) { |
| | | return R.data(hkStaffGaugeMonService.updateById(hkStaffGaugeMon)); |
| | | } |
| | | |
| | | /** |
| | | * 通过id查询 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="水尺监测-通过id查询", notes="水尺监测-通过id查询") |
| | | @GetMapping(value = "/queryById") |
| | | public R queryById(@RequestParam(name="id",required=true) String id) { |
| | | HkStaffGaugeMon hkStaffGaugeMon = hkStaffGaugeMonService.getById(id); |
| | | return R.data(hkStaffGaugeMon); |
| | | } |
| | | |
| | | /** |
| | | * 定时读取 |
| | | * @return |
| | | */ |
| | | @GetMapping(value = "/insert") |
| | | public void insert() { |
| | | // 保存数据 |
| | | hkStaffGaugeMonService.saveHkStaffGaugeMonInfo(); |
| | | } |
| | | |
| | | /** |
| | | * 定时读取 |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/test") |
| | | public void insert(@RequestBody String data) { |
| | | // 保存数据 |
| | | hkStaffGaugeMonService.saveHkStaffGaugeMonInfo(data); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | @Data |
| | | @TableName(value = "sm_hk_event") |
| | | @ApiModel(value = "sm_hk_event对象", description = "考核方案") |
| | | @ApiModel(value = "sm_hk_event对象", description = "海康视频事件") |
| | | public class HkEvent implements Serializable { |
| | | |
| | | /** |
| New file |
| | |
| | | package cn.gistack.sm.hk.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 海康水尺监测 |
| | | * |
| | | * @author zhongrj |
| | | * @date 2024-06-05 |
| | | */ |
| | | @Data |
| | | @TableName(value = "sm_hk_staff_gauge_mon") |
| | | @ApiModel(value = "sm_hk_staff_gauge_mon对象", description = "水尺监测") |
| | | public class HkStaffGaugeMon implements Serializable { |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(value = "id") |
| | | private String id; |
| | | |
| | | /** |
| | | * 监测id |
| | | */ |
| | | @ApiModelProperty(value = "监测id") |
| | | private String gaugeMonId; |
| | | |
| | | /** |
| | | * 水尺名称 |
| | | */ |
| | | @ApiModelProperty(value = "水尺名称") |
| | | private String waterGaugeName; |
| | | |
| | | /** |
| | | * 水尺编号 |
| | | */ |
| | | @ApiModelProperty(value = "水尺编号") |
| | | private String waterGaugeCode; |
| | | |
| | | /** |
| | | * 设备编号 |
| | | */ |
| | | @ApiModelProperty(value = "设备编号") |
| | | private String cameraIndexCode; |
| | | |
| | | /** |
| | | * 设备名称 |
| | | */ |
| | | @ApiModelProperty(value = "设备名称") |
| | | private String cameraName; |
| | | |
| | | /** |
| | | * 监测位置 |
| | | */ |
| | | @ApiModelProperty(value = "监测位置") |
| | | private String location; |
| | | |
| | | /** |
| | | * 原始的比对的图片 |
| | | */ |
| | | @ApiModelProperty(value = "原始的比对的图片") |
| | | private String markPic; |
| | | |
| | | /** |
| | | * 虚拟水尺的坐标 |
| | | */ |
| | | @ApiModelProperty(value = "虚拟水尺的坐标") |
| | | private String markData; |
| | | |
| | | /** |
| | | * 当前虚拟水尺图片 |
| | | */ |
| | | @ApiModelProperty(value = "当前虚拟水尺图片") |
| | | private String currentPic; |
| | | |
| | | /** |
| | | * 水位高度 |
| | | */ |
| | | @ApiModelProperty(value = "水位高度") |
| | | private Double alarmHeight; |
| | | |
| | | /** |
| | | * 备注1 |
| | | */ |
| | | @ApiModelProperty(value = "备注1") |
| | | private String remark1; |
| | | |
| | | /** |
| | | * 备注2 |
| | | */ |
| | | @ApiModelProperty(value = "备注2") |
| | | private String remark2; |
| | | |
| | | /** |
| | | * 备注3 |
| | | */ |
| | | @ApiModelProperty(value = "备注3") |
| | | private String remark3; |
| | | /** |
| | | * 备注4 |
| | | */ |
| | | @ApiModelProperty(value = "备注4") |
| | | private String remark4; |
| | | /** |
| | | * 备注5 |
| | | */ |
| | | @ApiModelProperty(value = "备注5") |
| | | private String remark5; |
| | | |
| | | /** |
| | | * 设置更新时间 |
| | | */ |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "设置更新时间") |
| | | private Date configUpdateTime; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "创建时间") |
| | | @TableField(value = "create_time",fill = FieldFill.INSERT) |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 数据分析上报时间 |
| | | */ |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "数据分析上报时间") |
| | | @TableField(value = "update_time") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 系统创建时间 |
| | | */ |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "系统创建时间") |
| | | @TableField(value = "sys_create_time",fill = FieldFill.INSERT) |
| | | private Date sysCreateTime; |
| | | |
| | | /** |
| | | * 删除状态 |
| | | */ |
| | | @ApiModelProperty(value = "删除状态") |
| | | private Integer deleteStatus; |
| | | |
| | | /** |
| | | * 标记图片url |
| | | */ |
| | | @ApiModelProperty(value = "标记图片url") |
| | | private String taggedPic; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.hk.feign; |
| | | |
| | | import cn.gistack.sm.hk.IHkStaffGaugeMonClient; |
| | | import cn.gistack.sm.hk.service.HkStaffGaugeMonService; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | /** |
| | | * @PROJECT_NAME: skjcmanager |
| | | * @DESCRIPTION: 海康设备水尺监测 |
| | | * @USER: zhongrj |
| | | * @DATE: 2024/06/05 |
| | | */ |
| | | @NonDS |
| | | @ApiIgnore |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @Slf4j |
| | | public class HkStaffGaugeMonClient implements IHkStaffGaugeMonClient { |
| | | |
| | | private final HkStaffGaugeMonService hkStaffGaugeMonService; |
| | | |
| | | /** |
| | | * 保存水尺监测数据 |
| | | */ |
| | | @Override |
| | | public void insertHkStaffGaugeMonInfo() { |
| | | hkStaffGaugeMonService.saveHkStaffGaugeMonInfo(); |
| | | } |
| | | } |
| | |
| | | LEFT JOIN SJZT_MD."att_ad_base" c ON b."p_ad_code" = c."guid" |
| | | LEFT JOIN SJZT_MD."att_ad_base" d ON c."p_ad_code" = d."guid" |
| | | where 1 =1 |
| | | <if test="hkEvent.resGuid!=null and hkEvent.resGuid!=''"> |
| | | and awb."res_guid" = #{hkEvent.resGuid} |
| | | </if> |
| | | <if test="hkEvent.srcName!=null and hkEvent.srcName!=''"> |
| | | and she.src_name like concat('%',#{hkEvent.srcName},'%') |
| | | </if> |
| New file |
| | |
| | | package cn.gistack.sm.hk.mapper; |
| | | |
| | | import cn.gistack.sm.hk.entity.HkStaffGaugeMon; |
| | | import cn.gistack.sm.hk.vo.HkStaffGaugeMonVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface HkStaffGaugeMonMapper extends BaseMapper<HkStaffGaugeMon> { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * @param page |
| | | * @param hkStaffGaugeMon |
| | | * @return |
| | | */ |
| | | List<HkStaffGaugeMonVO> selectHkStaffGaugeMonPage(@Param("page") IPage<HkStaffGaugeMonVO> page, |
| | | @Param("hkStaffGaugeMon") HkStaffGaugeMonVO hkStaffGaugeMon); |
| | | } |
| 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.hk.mapper.HkStaffGaugeMonMapper"> |
| | | |
| | | <!--自定义分页列表查询--> |
| | | <select id="selectHkStaffGaugeMonPage" resultType="cn.gistack.sm.hk.vo.HkStaffGaugeMonVO"> |
| | | select |
| | | shsgm.*, |
| | | awb."res_guid" as resGuid, |
| | | a."name" as resName, |
| | | case when b."ad_grad" = 4 THEN b."ad_name" |
| | | ELSE NULL END AS townName, |
| | | case when b."ad_grad" = 3 THEN b."ad_name" |
| | | when c."ad_grad" = 3 THEN C."ad_name" |
| | | 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 |
| | | from YWXT.sm_hk_staff_gauge_mon shsgm |
| | | left join ( |
| | | select "res_guid","video_guid" from SJZT_MD."att_wmst_base" |
| | | union all |
| | | select "regionindexcode" as "res_guid","gbindexcode" as "video_guid" from SJZT_ODS."haik_gb_wmst_base" |
| | | ) |
| | | awb on awb."video_guid" = shsgm.camera_index_code |
| | | left join SJZT_MD."att_res_base" a on a."guid" = awb."res_guid" |
| | | left join SJZT_MD."att_ad_base" b on b."guid" = a."interior_ad_guid" |
| | | LEFT JOIN SJZT_MD."att_ad_base" c ON b."p_ad_code" = c."guid" |
| | | LEFT JOIN SJZT_MD."att_ad_base" d ON c."p_ad_code" = d."guid" |
| | | where 1 =1 |
| | | <if test="hkStaffGaugeMon.resGuid!=null and hkStaffGaugeMon.resGuid!=''"> |
| | | and awb."res_guid" = #{hkStaffGaugeMon.resGuid} |
| | | </if> |
| | | <if test="hkStaffGaugeMon.cameraName!=null and hkStaffGaugeMon.cameraName!=''"> |
| | | and shsgm.camera_name like concat('%',#{hkStaffGaugeMon.cameraName},'%') |
| | | </if> |
| | | <if test="hkStaffGaugeMon.resName!=null and hkStaffGaugeMon.resName!=''"> |
| | | and a."name" like concat('%',#{hkStaffGaugeMon.resName},'%') |
| | | </if> |
| | | <if test="hkStaffGaugeMon.startTime !=null and hkStaffGaugeMon.startTime !=''"> |
| | | AND DATE_FORMAT(shsgm.update_time,'%Y-%m-%d') >= #{hkStaffGaugeMon.startTime} |
| | | </if> |
| | | <if test="hkStaffGaugeMon.endTime !=null and hkStaffGaugeMon.endTime !=''"> |
| | | AND DATE_FORMAT(shsgm.update_time,'%Y-%m-%d') <= #{hkStaffGaugeMon.endTime} |
| | | </if> |
| | | <if test="hkStaffGaugeMon.sendTime !=null and hkStaffGaugeMon.sendTime !=''"> |
| | | AND DATE_FORMAT(shsgm.update_time,'%Y-%m-%d') <= #{hkStaffGaugeMon.sendTime} |
| | | </if> |
| | | <if test="hkStaffGaugeMon.adCode != null and hkStaffGaugeMon.adCode !='' and hkStaffGaugeMon.adCode !='420000000000'"> |
| | | AND (b."ad_code" = #{hkStaffGaugeMon.adCode} or c."ad_code" =#{hkStaffGaugeMon.adCode} or d."ad_code" = #{hkStaffGaugeMon.adCode}) |
| | | </if> |
| | | order by shsgm.id desc,shsgm.update_time desc |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.hk.service; |
| | | |
| | | |
| | | import cn.gistack.sm.hk.entity.HkStaffGaugeMon; |
| | | import cn.gistack.sm.hk.vo.HkStaffGaugeMonVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * 水尺监测服务接口层 |
| | | * @author zhongrj |
| | | * @date 2024-06-05 |
| | | */ |
| | | public interface HkStaffGaugeMonService extends IService<HkStaffGaugeMon> { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * @param page |
| | | * @param hkStaffGaugeMon |
| | | * @return |
| | | */ |
| | | IPage<HkStaffGaugeMonVO> selectHkStaffGaugeMonPage(IPage<HkStaffGaugeMonVO> page, HkStaffGaugeMonVO hkStaffGaugeMon); |
| | | |
| | | /** |
| | | * 保存水尺监测数据 |
| | | * @return |
| | | */ |
| | | void saveHkStaffGaugeMonInfo(); |
| | | |
| | | /** |
| | | * 测试保存水尺监测数据 |
| | | * @param data |
| | | * @return |
| | | */ |
| | | void saveHkStaffGaugeMonInfo(String data); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.hk.service.impl; |
| | | |
| | | import cn.gistack.common.utils.IdUtils; |
| | | import cn.gistack.common.utils.SpringContextUtil; |
| | | import cn.gistack.resource.feign.IOssClient; |
| | | import cn.gistack.sm.hk.constant.HkEventConstant; |
| | | import cn.gistack.sm.hk.entity.HkStaffGaugeMon; |
| | | import cn.gistack.sm.hk.mapper.HkStaffGaugeMonMapper; |
| | | import cn.gistack.sm.hk.service.HkStaffGaugeMonService; |
| | | import cn.gistack.sm.hk.util.GetCameraUtils; |
| | | import cn.gistack.sm.hk.vo.HkStaffGaugeMonVO; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.mock.web.MockMultipartFile; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.imageio.ImageIO; |
| | | import java.awt.*; |
| | | import java.awt.geom.Line2D; |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.*; |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static cn.gistack.sm.hk.constant.HkConstant.waterGaugeURLs; |
| | | |
| | | /** |
| | | * 水尺监测服务接口实现层 |
| | | * @author zhongrj |
| | | * @date 2024-06-05 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class HkStaffGaugeMonServiceImpl extends ServiceImpl<HkStaffGaugeMonMapper, HkStaffGaugeMon> implements HkStaffGaugeMonService { |
| | | |
| | | @Autowired |
| | | private IOssClient ossClient; |
| | | |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * @param page |
| | | * @param hkStaffGaugeMon |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<HkStaffGaugeMonVO> selectHkStaffGaugeMonPage(IPage<HkStaffGaugeMonVO> page, HkStaffGaugeMonVO hkStaffGaugeMon) { |
| | | return page.setRecords(baseMapper.selectHkStaffGaugeMonPage(page,hkStaffGaugeMon)); |
| | | } |
| | | |
| | | /** |
| | | * 保存数据 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void saveHkStaffGaugeMonInfo() { |
| | | // 解析json |
| | | String result = GetCameraUtils.getStaffGaugeMon(3, waterGaugeURLs); |
| | | // 保存 |
| | | saveHkStaffGaugeMonInfo(result); |
| | | } |
| | | |
| | | /** |
| | | * 保存数据 |
| | | * @param result |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void saveHkStaffGaugeMonInfo(String result) { |
| | | // 解析json |
| | | log.info("水尺监测信息:" + result); |
| | | JSONObject jsonObject = JSONObject.parseObject(result); |
| | | JSONArray jsonArray = jsonObject.getJSONArray("data"); |
| | | if (null!= jsonArray && jsonArray.size()>0) { |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | String cameraIndexCode = jsonArray.getJSONObject(i).getString("cameraIndexCode"); |
| | | Date updateTime = jsonArray.getJSONObject(i).getDate("updateTime"); |
| | | // 查询去重 |
| | | QueryWrapper<HkStaffGaugeMon> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("camera_index_code",cameraIndexCode).eq("update_time",updateTime); |
| | | List<HkStaffGaugeMon> list = list(wrapper); |
| | | if (list.size()==0) { |
| | | HkStaffGaugeMon hkStaffGaugeMon = new HkStaffGaugeMon(); |
| | | // 设置数据 |
| | | hkStaffGaugeMon.setId(IdUtils.getIdBy36()); |
| | | hkStaffGaugeMon.setGaugeMonId(jsonArray.getJSONObject(i).getString("id")); |
| | | hkStaffGaugeMon.setWaterGaugeName(jsonArray.getJSONObject(i).getString("waterGaugeName")); |
| | | hkStaffGaugeMon.setWaterGaugeCode(jsonArray.getJSONObject(i).getString("waterGaugeCode")); |
| | | hkStaffGaugeMon.setCameraIndexCode(jsonArray.getJSONObject(i).getString("cameraIndexCode")); |
| | | hkStaffGaugeMon.setCameraName(jsonArray.getJSONObject(i).getString("cameraName")); |
| | | hkStaffGaugeMon.setLocation(jsonArray.getJSONObject(i).getString("location")); |
| | | hkStaffGaugeMon.setMarkPic(jsonArray.getJSONObject(i).getString("markPic")); |
| | | hkStaffGaugeMon.setMarkData(jsonArray.getJSONObject(i).getString("markData")); |
| | | hkStaffGaugeMon.setCreateTime(jsonArray.getJSONObject(i).getDate("createTime")); |
| | | hkStaffGaugeMon.setConfigUpdateTime(jsonArray.getJSONObject(i).getDate("configUpdateTime")); |
| | | hkStaffGaugeMon.setUpdateTime(jsonArray.getJSONObject(i).getDate("updateTime")); |
| | | hkStaffGaugeMon.setDeleteStatus(jsonArray.getJSONObject(i).getInteger("deleteStatus")); |
| | | hkStaffGaugeMon.setCurrentPic(jsonArray.getJSONObject(i).getString("currentPic")); |
| | | hkStaffGaugeMon.setAlarmHeight(jsonArray.getJSONObject(i).getDouble("alarmHeight")); |
| | | hkStaffGaugeMon.setRemark1(jsonArray.getJSONObject(i).getString("remark1")); |
| | | hkStaffGaugeMon.setRemark2(jsonArray.getJSONObject(i).getString("remark2")); |
| | | hkStaffGaugeMon.setRemark3(jsonArray.getJSONObject(i).getString("remark3")); |
| | | hkStaffGaugeMon.setRemark4(jsonArray.getJSONObject(i).getString("remark4")); |
| | | hkStaffGaugeMon.setRemark5(jsonArray.getJSONObject(i).getString("remark5")); |
| | | hkStaffGaugeMon.setSysCreateTime(new Date()); |
| | | // 设置标记图片 |
| | | hkStaffGaugeMon.setTaggedPic(setTaggedUrl(hkStaffGaugeMon)); |
| | | // 保存 |
| | | save(hkStaffGaugeMon); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 设置标记图片 |
| | | * @param hkStaffGaugeMon |
| | | * @return |
| | | */ |
| | | private String setTaggedUrl(HkStaffGaugeMon hkStaffGaugeMon) { |
| | | String url = null; |
| | | if (!Strings.isBlank(hkStaffGaugeMon.getMarkPic()) && |
| | | !Strings.isBlank(hkStaffGaugeMon.getMarkData())){ |
| | | String tagGedUrl = hkStaffGaugeMon.getMarkPic(); |
| | | // 获取环境 |
| | | String activeProfile = SpringContextUtil.getActiveProfile(); |
| | | String preUrl = HkEventConstant.picUrlMap.get(activeProfile); |
| | | // 替换url |
| | | tagGedUrl = tagGedUrl.replace("http://10.42.7.245:6120",preUrl); |
| | | // url 转换 |
| | | url = drawAndGetPictureUrl(tagGedUrl,hkStaffGaugeMon.getMarkData(),hkStaffGaugeMon.getAlarmHeight(),Color.RED); |
| | | } |
| | | return url; |
| | | } |
| | | |
| | | /** |
| | | * 图片处理 |
| | | * @param url 原始图片地址 |
| | | * @param data:图片数据 |
| | | * @param drawColor:画框的颜色 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public String drawAndGetPictureUrl(String url,String data,Double alarmHeight, Color drawColor) { |
| | | String tagGedUrl = null; |
| | | BufferedImage bufferedImage = null; |
| | | // 读取图片文件,得到BufferedImage对象 |
| | | try { |
| | | InputStream inputStream = null; |
| | | HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection(); |
| | | connection.setRequestMethod("GET"); |
| | | if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) { |
| | | inputStream = connection.getInputStream(); |
| | | } |
| | | bufferedImage = ImageIO.read(inputStream); |
| | | // 得到Graphics2D 对象 |
| | | Graphics2D g2D = (Graphics2D) bufferedImage.getGraphics(); |
| | | // 设置颜色、画笔粗细 |
| | | g2D.setColor(drawColor); |
| | | g2D.setStroke(new BasicStroke(2f)); |
| | | // 绘制线 |
| | | drawLine(g2D,data,bufferedImage); |
| | | // 标记点位文字 |
| | | drawWord(g2D,data,bufferedImage,alarmHeight,24); |
| | | // 释放图形上下文 |
| | | g2D.dispose(); |
| | | // 将处理后的图片转换为输入流 |
| | | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| | | ImageIO.write(bufferedImage, "jpg", new File("F:\\out.jpg")); |
| | | // 写入 |
| | | ImageIO.write(bufferedImage, "jpg", byteArrayOutputStream); |
| | | ByteArrayInputStream stream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray()); |
| | | String fileName = System.currentTimeMillis() + ".jpg"; |
| | | // 使用MinIO客户端上传图片 |
| | | MockMultipartFile multipartFile |
| | | = new MockMultipartFile("__init__.py", fileName, "application/octet-stream", stream); |
| | | // 上传 |
| | | tagGedUrl = ossClient.uploadFile(fileName, multipartFile); |
| | | // 返回 |
| | | return tagGedUrl; |
| | | } catch (Exception e) { |
| | | log.error("绘制图片失败:,原图片:{},error:{}", url, e); |
| | | } |
| | | // 返回 |
| | | return tagGedUrl; |
| | | } |
| | | |
| | | /** |
| | | * 画矩形 |
| | | * @param x:该参数用于返回检测框左上角位置的横坐标(x)所在的像素位置,结合剩余参数可唯一确定检测框的大小和位置。 |
| | | * @param y:该参数用于返回检测框左上角位置的纵坐标(y)所在的像素位置,结合剩余参数可唯一确定检测框的大小和位置。 |
| | | * @param width: 该参数用于返回检测框的宽度(由左上角出发在x轴向右延伸的长度),结合剩余参数可唯一确定检测框的大小和位置。 |
| | | * @param height:该参数用于返回检测框的高度(由左上角出发在y轴向下延伸的长度),结合剩余参数可唯一确定检测框的大小和位置。 |
| | | * @param g2D |
| | | */ |
| | | public void drawRectangle(int x, int y, int width, int height, Graphics2D g2D) { |
| | | //绘制矩形 |
| | | g2D.drawRect(x, y, width, height); |
| | | } |
| | | |
| | | /** |
| | | * 画线 |
| | | * @param g2D |
| | | * @param data |
| | | * @param bufferedImage |
| | | */ |
| | | public void drawLine(Graphics2D g2D,String data,BufferedImage bufferedImage) { |
| | | int width = bufferedImage.getWidth(); |
| | | int height = bufferedImage.getHeight(); |
| | | // 解析data |
| | | JSONObject jsonObject = JSONObject.parseObject(data); |
| | | // 转换为Map |
| | | Map<String, Double> map = new HashMap<>(); |
| | | for (String key : jsonObject.keySet()) { |
| | | map.put(key, jsonObject.getDoubleValue(key)); |
| | | |
| | | } |
| | | // 打印转换后的Map |
| | | Line2D.Double line = new Line2D.Double(map.get("x1")*width, map.get("y1")*height, |
| | | map.get("x2")*width, map.get("y2")*height); |
| | | g2D.draw(line); |
| | | Line2D.Double line1 = new Line2D.Double(map.get("x2")*width, map.get("y2")*height, |
| | | map.get("x3")*width, map.get("y3")*height); |
| | | g2D.draw(line1); |
| | | } |
| | | |
| | | /** |
| | | * 画线--int 类型 |
| | | * @param g2D |
| | | * @param data |
| | | */ |
| | | public void drawLineInt(Graphics2D g2D,String data) { |
| | | //绘制矩形 |
| | | // 定义多个点,每个点由x和y坐标组成 |
| | | int[] xPoints = {10, 100, 50, 150, 20}; |
| | | int[] yPoints = {10, 150, 100, 50, 10}; |
| | | // 绘制多点划线 |
| | | g2D.drawPolyline(xPoints, yPoints, xPoints.length); |
| | | } |
| | | |
| | | /** |
| | | * 画文字 |
| | | * @param g2D |
| | | * @param data |
| | | * @param data 数据 |
| | | * @param bufferedImage |
| | | * @param size 文字大小 |
| | | */ |
| | | public void drawWord(Graphics2D g2D, String data,BufferedImage bufferedImage,Double alarmHeight,int size) { |
| | | g2D.setFont(new Font("", Font.BOLD, size)); |
| | | int width = bufferedImage.getWidth(); |
| | | int height = bufferedImage.getHeight(); |
| | | // 解析data |
| | | JSONObject jsonObject = JSONObject.parseObject(data); |
| | | // 转换为Map |
| | | Map<String, Double> map = new HashMap<>(); |
| | | for (String key : jsonObject.keySet()) { |
| | | map.put(key, jsonObject.getDoubleValue(key)); |
| | | } |
| | | g2D.drawString("A:" + map.get("h3") + "米", (float)(map.get("x3")*width-5), (float) (map.get("y3")*height-10)); |
| | | g2D.drawString("B:" + map.get("h2") + "米", (float)(map.get("x2")*width-5), (float) (map.get("y2")*height-10)); |
| | | g2D.drawString("C:" + map.get("h1") + "米", (float)(map.get("x1")*width-5), (float) (map.get("y1")*height-10)); |
| | | |
| | | g2D.setColor(Color.BLUE); |
| | | g2D.drawString("当前水位:" + alarmHeight + "米", (float)(map.get("x2")*width-100), (float) (map.get("y2")*height+60)); |
| | | } |
| | | } |
| | |
| | | return common(null==eventVO.getType()?1:eventVO.getType(),url, body); |
| | | } |
| | | |
| | | /** |
| | | * 调用水尺检测信息 |
| | | * @param type |
| | | * @param url |
| | | * @return |
| | | */ |
| | | public static String getStaffGaugeMon(Integer type, String url) { |
| | | /** |
| | | * 组装请求参数 |
| | | */ |
| | | JSONObject jsonBody = new JSONObject(); |
| | | String body = jsonBody.toJSONString(); |
| | | |
| | | /** |
| | | * 调用接口并返回数据 |
| | | * post请求application/json类型参数; |
| | | */ |
| | | return common(null==type?1:type,url, body); |
| | | } |
| | | |
| | | // public static void main(String[] args) { |
| | | // |
| | | // String previewURL = GetCameraPreviewURL(1, HkConstant.previewURLs, |
| New file |
| | |
| | | package cn.gistack.sm.hk.vo; |
| | | |
| | | import cn.gistack.sm.hk.entity.HkStaffGaugeMon; |
| | | import lombok.Data; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | public class HkStaffGaugeMonVO extends HkStaffGaugeMon implements Serializable { |
| | | |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | private String startTime; |
| | | |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | private String endTime; |
| | | |
| | | /** |
| | | * 发送时间 |
| | | */ |
| | | private String sendTime; |
| | | /** |
| | | * 水库编号 |
| | | */ |
| | | private String resGuid; |
| | | |
| | | /** |
| | | * 水库名称 |
| | | */ |
| | | private String resName; |
| | | |
| | | /** |
| | | * 市州名称 |
| | | */ |
| | | private String cityName; |
| | | |
| | | /** |
| | | * 区县 |
| | | */ |
| | | private String countyName; |
| | | |
| | | /** |
| | | * 乡镇 |
| | | */ |
| | | private String townName; |
| | | |
| | | /** |
| | | * 区域编号 |
| | | */ |
| | | private String adCode; |
| | | } |
| | |
| | | import cn.gistack.sm.intelligentCall.service.ICallSmsNoticeTaskService; |
| | | import cn.gistack.sm.intelligentCall.vo.CallTaskResultVO; |
| | | import cn.gistack.sm.intelligentCall.vo.CallTaskStatistic; |
| | | import cn.gistack.sm.sjztmd.word.vo.DzkInfo; |
| | | import cn.gistack.sm.sjztmd.word.vo.OverDetail; |
| | | import cn.gistack.sm.sjztmd.word.vo.TotalInfo; |
| | | import com.alibaba.excel.EasyExcel; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | return R.data(callService.getCallResultListTemp(Condition.getPage(query),callTaskResult)); |
| | | } |
| | | |
| | | /** |
| | | * 外呼数据导出 |
| | | * @param callTaskResult |
| | | * @param response |
| | | * @return |
| | | */ |
| | | @GetMapping("/exportCallResultList") |
| | | public void getCallResultListTemp(CallTaskResultVO callTaskResult,Query query,HttpServletResponse response) throws Exception { |
| | | //获取总览、大中库、明细数据 |
| | | List<CallTaskResultVO> callTaskResultVOList |
| | | = callService.getCallResultListTemp(Condition.getPage(query), callTaskResult); |
| | | cn.gistack.sm.intelligentCall.util.ExcelUtil.generateExcel(response,callTaskResultVOList,callTaskResult); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导入表格发送智能外呼 |
| | |
| | | List<CallExcel> list = new ArrayList<>(); |
| | | ExcelUtil.export(response, "智能外呼数据模板", "智能外呼数据表", list, CallExcel.class); |
| | | } |
| | | |
| | | /** |
| | | * 测试接口-调用外呼库查询任务详情信息 |
| | | */ |
| | | @GetMapping("/getTaskDetail") |
| | | public R getTaskDetail(Integer taskId) { |
| | | return R.data(callService.getTaskDetail(taskId)); |
| | | } |
| | | } |
| | |
| | | @DS("ztznwh") |
| | | @InterceptorIgnore(tenantLine = "true") |
| | | List<Scene> getCallListByArea(); |
| | | |
| | | /** |
| | | * 测试接口-调用外呼库查询任务详情信息 |
| | | */ |
| | | @DS("znwh") |
| | | Map<Object,Object> getTaskDetail(@Param("taskId") Integer taskId); |
| | | } |
| | |
| | | where 1=1 |
| | | <if test="callTaskResult.startTime!=null and callTaskResult.startTime!=''"> |
| | | and ct."scene_id" = 228 |
| | | and date_format(ctr."gmt_create",'%Y-%m-%d') >= #{callTaskResult.startTime} |
| | | and ctr."gmt_create" >= #{callTaskResult.startTime} |
| | | </if> |
| | | <if test="callTaskResult.endTime!=null and callTaskResult.endTime!=''"> |
| | | and date_format(ctr."gmt_create",'%Y-%m-%d') <= #{callTaskResult.endTime} |
| | | and ctr."gmt_create" <= #{callTaskResult.endTime} |
| | | </if> |
| | | <if test="list != null and list.size()>0"> |
| | | and ctr."task_id" in |
| | |
| | | and arb."eng_scal"!='中型' and arb."eng_scal"!='大(2)型' and arb."eng_scal"!='大(1)型' |
| | | </select> |
| | | |
| | | <!--测试接口-调用外呼库查询任务详情信息--> |
| | | <select id="getTaskDetail" resultType="java.util.Map"> |
| | | select * from call_task where id = #{taskId} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | * @param page |
| | | * @return |
| | | */ |
| | | Object getCallResultListTemp(IPage<CallTaskResultVO> page, CallTaskResultVO callTaskResult); |
| | | List<CallTaskResultVO> getCallResultListTemp(IPage<CallTaskResultVO> page, CallTaskResultVO callTaskResult); |
| | | |
| | | /** |
| | | * 创建告警外呼任务 |
| | |
| | | * @return |
| | | */ |
| | | Object importCall(List<CallExcel> list,String time); |
| | | |
| | | /** |
| | | * 测试接口-调用外呼库查询任务详情信息 |
| | | */ |
| | | Object getTaskDetail(Integer taskId); |
| | | } |
| | |
| | | if (success){ |
| | | //通过任务名称查询taskId |
| | | taskId = callTaskMapper.getTaskIdByTaskName(taskName); |
| | | }else { |
| | | // 任务创建失败,发送短信告知 |
| | | asyncCallService.createOutCallErrorSendSms(jsonObject.getString("code"),jsonObject.getString("message")); |
| | | } |
| | | List<String> list = new ArrayList<>(); |
| | | list.add(response.getBody()); |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Object getCallResultListTemp(IPage<CallTaskResultVO> page, CallTaskResultVO callTaskResult) { |
| | | public List<CallTaskResultVO> getCallResultListTemp(IPage<CallTaskResultVO> page, CallTaskResultVO callTaskResult) { |
| | | List<String> list = new ArrayList<>(); |
| | | if (null!=callTaskResult.getIds() && !callTaskResult.getIds().equals("")){ |
| | | list = Arrays.asList(callTaskResult.getIds().split(",")); |
| | |
| | | // 返回 |
| | | return R.data(400,errorMsg,null); |
| | | } |
| | | |
| | | /** |
| | | * 测试接口-调用外呼库查询任务详情信息 |
| | | */ |
| | | @Override |
| | | public Object getTaskDetail(Integer taskId) { |
| | | return callTaskMapper.getTaskDetail(taskId); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.intelligentCall.util; |
| | | |
| | | import cn.gistack.sm.intelligentCall.vo.CallTaskResultVO; |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.support.ExcelTypeEnum; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.excel.write.metadata.fill.FillWrapper; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | import java.net.URLEncoder; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * excel工具类 |
| | | */ |
| | | public class ExcelUtil { |
| | | |
| | | /** |
| | | * 导出数据 |
| | | * @param response |
| | | * @param callTaskResultVOS |
| | | * @param callTaskResult |
| | | * @throws Exception |
| | | */ |
| | | public static void generateExcel(HttpServletResponse response, List<CallTaskResultVO> callTaskResultVOS,CallTaskResultVO callTaskResult) throws Exception { |
| | | String fileName = callTaskResult.getStartTime() + "~" + callTaskResult.getEndTime() + "智能外呼统计情况表" + System.currentTimeMillis() + ".xlsx"; |
| | | HashMap<String, Object> info = formatInfo(callTaskResultVOS,callTaskResult); |
| | | //获取模板(带公式的模板需要文件编辑之后才会显示正常数据) |
| | | InputStream inputStream = ExcelUtil.class.getClassLoader().getResourceAsStream("excel/xlsx/callStatisticTemplate.xlsx"); |
| | | ExcelWriter excelWriter = EasyExcel.write(getOutputStream(fileName, response)).withTemplate(inputStream).excelType(ExcelTypeEnum.XLSX).build(); |
| | | //设置公式生效 |
| | | WriteSheet writeSheet = EasyExcel.writerSheet(0,"sheet").build(); |
| | | // 这个传进去的 map 就是非表格数据,详见我定义的模板中图片位置上方那部分 |
| | | excelWriter.fill(info, writeSheet); |
| | | excelWriter.fill(new FillWrapper("data", callTaskResultVOS), writeSheet); |
| | | excelWriter.finish(); |
| | | } |
| | | |
| | | /** |
| | | * 数据格式化处理 |
| | | * @param callTaskResultVOS |
| | | * @param callTaskResult |
| | | * @return |
| | | */ |
| | | private static HashMap<String,Object> formatInfo(List<CallTaskResultVO> callTaskResultVOS,CallTaskResultVO callTaskResult) { |
| | | HashMap<String,Object> info = new HashMap<>(); |
| | | info.put("startTime",callTaskResult.getStartTime()); |
| | | info.put("endTime",callTaskResult.getEndTime()); |
| | | int total = callTaskResultVOS.size(); |
| | | int jtTotal = 0; |
| | | int wtTotal = 0; |
| | | int isNotMan = 0; |
| | | int isMan = 0; |
| | | int patrol = 0; |
| | | int noOver = 0; |
| | | int noDanger = 0; |
| | | String bl = "0"; |
| | | |
| | | //给总览加序号 |
| | | for (int i = 0; i < callTaskResultVOS.size(); i++) { |
| | | CallTaskResultVO callResult = callTaskResultVOS.get(i); |
| | | callResult.setIndex(String.valueOf(i+1)); |
| | | |
| | | // 通话时长计算 |
| | | if (!callResult.getCallDuration().equals("0")) { |
| | | int result = Integer.parseInt(callResult.getCallDuration()); |
| | | // double h = Math.floor(result / 3600) < 10 ? '0' + Math.floor(result / 3600) : Math.floor(result / 3600) |
| | | double m = Math.floor((result / 60 % 60)) < 10 ? '0' + Math.floor((result / 60 % 60)) : Math.floor((result / 60 % 60)); |
| | | double s = Math.floor((result % 60)) < 10 ? '0' + Math.floor((result % 60)) : Math.floor((result % 60)); |
| | | StringBuilder builder = new StringBuilder(); |
| | | builder.append(m).append(":").append(s); |
| | | callResult.setCallDuration(builder.toString()); |
| | | } |
| | | |
| | | // 是否巡查责任人 0:未知或空 1:不是巡查责任人 2:是巡查责任人 |
| | | if (callResult.getIsMan().equals("0")) { |
| | | callResult.setIsMan(""); |
| | | } |
| | | if (callResult.getIsMan().equals("1")) { |
| | | callResult.setIsMan("否"); |
| | | } |
| | | if (callResult.getIsMan().equals("2")) { |
| | | callResult.setIsMan("是"); |
| | | } |
| | | |
| | | // 是否已巡查 0:未知或空 1:未巡查 2:已巡查 |
| | | if (callResult.getIsPatrol().equals("0")) { |
| | | callResult.setIsPatrol(""); |
| | | } |
| | | if (callResult.getIsPatrol().equals("1")) { |
| | | callResult.setIsPatrol("否"); |
| | | } |
| | | if (callResult.getIsPatrol().equals("2")) { |
| | | callResult.setIsPatrol("是"); |
| | | } |
| | | |
| | | // 是否超汛限 0:未知或空 1:未超汛限 2:超汛限 |
| | | if (callResult.getIsOver().equals("0")) { |
| | | callResult.setIsOver(""); |
| | | } |
| | | if (callResult.getIsOver().equals("1")) { |
| | | callResult.setIsOver("否"); |
| | | } |
| | | if (callResult.getIsOver().equals("2")) { |
| | | callResult.setIsOver("是"); |
| | | } |
| | | |
| | | // 是否发现险情 0:未知或空 1:未发现险情 2:发现险情 |
| | | if (callResult.getIsDange().equals("0")) { |
| | | callResult.setIsDange(""); |
| | | } |
| | | if (callResult.getIsDange().equals("1")) { |
| | | callResult.setIsDange("否"); |
| | | } |
| | | if (callResult.getIsDange().equals("2")) { |
| | | callResult.setIsDange("是"); |
| | | } |
| | | |
| | | // 挂断方向 A机器 B用户 |
| | | if (callResult.getCallHangupDirection().equals("A")) { |
| | | callResult.setCallHangupDirection("机器"); |
| | | } |
| | | if (callResult.getCallHangupDirection().equals("B")) { |
| | | callResult.setCallHangupDirection("用户"); |
| | | } |
| | | |
| | | if (callResult.getCallResult().equals("200000") || |
| | | callResult.getIsSmsFill().equals("已反馈") |
| | | ){ |
| | | if (callResult.getIsSmsFill().equals("已反馈")){ |
| | | setCallResult(callResult); |
| | | }else { |
| | | callResult.setCallResult("接通"); |
| | | } |
| | | jtTotal += 1; |
| | | }else { |
| | | wtTotal += 1; |
| | | setCallResult(callResult); |
| | | } |
| | | |
| | | // 接通并是巡查责任人 |
| | | if ((callResult.getCallResult().equals("接通") && callResult.getIsMan().equals("是")) || |
| | | (callResult.getIsSmsFill().equals("已反馈") && callResult.getIsMan().equals("是")) |
| | | ) { |
| | | isMan += 1; |
| | | } |
| | | |
| | | // 接通并不是巡查责任人 |
| | | if ((callResult.getCallResult().equals("接通") && callResult.getIsMan().equals("否")) || |
| | | (callResult.getIsSmsFill().equals("已反馈") && callResult.getIsMan().equals("否")) |
| | | ) { |
| | | isNotMan += 1; |
| | | } |
| | | |
| | | // 接通并已巡查 |
| | | if ((callResult.getCallResult().equals("接通") && callResult.getIsPatrol().equals("是") && callResult.getIsMan().equals("是") ) || |
| | | (callResult.getIsSmsFill().equals("已反馈") && callResult.getIsPatrol().equals("是") && callResult.getIsMan().equals("是")) |
| | | ) { |
| | | patrol += 1; |
| | | } |
| | | |
| | | // 接通并不是超汛限 |
| | | if ((callResult.getCallResult().equals("接通") && callResult.getIsOver().equals("否") && callResult.getIsMan().equals("是") ) || |
| | | (callResult.getIsSmsFill().equals("已反馈") && callResult.getIsOver().equals("否") && callResult.getIsMan().equals("是")) |
| | | ) { |
| | | noOver += 1; |
| | | } |
| | | |
| | | // 接通并没有发现险情 |
| | | if ((callResult.getCallResult().equals("接通") && callResult.getIsDange().equals("否") && callResult.getIsMan().equals("是") ) || |
| | | (callResult.getIsSmsFill().equals("已反馈") && callResult.getIsDange().equals("否") && callResult.getIsMan().equals("是")) |
| | | ) { |
| | | noDanger += 1; |
| | | } |
| | | } |
| | | |
| | | if (total > 0) { |
| | | // 计算百分比 |
| | | double number = (double) jtTotal/total; |
| | | // 格式化 |
| | | String result = String.format("%.2f", number*100); |
| | | // 设置 |
| | | bl = result; |
| | | String[] split = bl.split("\\."); |
| | | if (split.length==2){ |
| | | if (split[1].equals("00")){ |
| | | bl = split[0]; |
| | | } |
| | | } |
| | | } |
| | | // 备注说明拼接 |
| | | StringBuilder builder = new StringBuilder(); |
| | | builder.append("统计:智能外呼系统于 ") |
| | | .append(callTaskResult.getStartTime()).append(" 至 ") |
| | | .append(callTaskResult.getEndTime()).append(" 以来对湖北省超汛限水库进行巡查责任人电话抽查其中湖北省进行了") |
| | | .append(total).append("人次的电话抽查,接通") |
| | | .append(jtTotal).append("个,未接通") |
| | | .append(wtTotal).append("个,实际触达率为") |
| | | .append(bl).append("%;有效通话中的") |
| | | .append(jtTotal).append("个水库,其中") |
| | | .append(isNotMan).append("人反馈不是巡查责任人;在巡查问答环节的") |
| | | .append(isMan).append("个责任人中,") |
| | | .append(patrol).append("人均已表示巡查,") |
| | | .append(noOver).append("人表示水位未超汛限水位,") |
| | | .append(noDanger).append("人表示未发现险情。"); |
| | | // 设置说明 |
| | | info.put("remark", builder.toString()); |
| | | // 返回 |
| | | return info; |
| | | } |
| | | |
| | | /** |
| | | * 设置通话结果 |
| | | * @param callResult |
| | | */ |
| | | private static void setCallResult(CallTaskResultVO callResult) { |
| | | if (callResult.getCallResult().equals("200001")) { |
| | | callResult.setCallResult("用户提前挂机未完整收听"); |
| | | } |
| | | if (callResult.getCallResult().equals("200002")) { |
| | | callResult.setCallResult("占线"); |
| | | } |
| | | if (callResult.getCallResult().equals("200003")) { |
| | | callResult.setCallResult("未接通"); |
| | | } |
| | | if (callResult.getCallResult().equals("200004")) { |
| | | callResult.setCallResult("空号"); |
| | | } |
| | | if (callResult.getCallResult().equals("200005")) { |
| | | callResult.setCallResult("拒接"); |
| | | } |
| | | if (callResult.getCallResult().equals("200007")) { |
| | | callResult.setCallResult("无法接通/不在服务区"); |
| | | } |
| | | if (callResult.getCallResult().equals("200010")) { |
| | | callResult.setCallResult("关机"); |
| | | } |
| | | if (callResult.getCallResult().equals("200011")) { |
| | | callResult.setCallResult("停机"); |
| | | } |
| | | if (callResult.getCallResult().equals("200100")) { |
| | | callResult.setCallResult("转接"); |
| | | } |
| | | if (callResult.getCallResult().equals("200130")) { |
| | | callResult.setCallResult("其他(无法识别)"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 导出文件时为Writer生成OutputStream. |
| | | * |
| | | * @param fileName 文件名 |
| | | * @param response response |
| | | * @return "" |
| | | */ |
| | | public static OutputStream getOutputStream(String fileName, HttpServletResponse response) throws Exception { |
| | | try { |
| | | fileName = URLEncoder.encode(fileName, "UTF-8"); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf8"); |
| | | response.setHeader("Content-Disposition", "attachment; filename=" + fileName); |
| | | return response.getOutputStream(); |
| | | } catch (IOException e) { |
| | | throw new Exception("导出excel表格失败!", e); |
| | | } |
| | | } |
| | | } |
| | |
| | | @ApiModelProperty("今日降雨(毫米)") |
| | | private String curDrp; |
| | | |
| | | private String daysw;//当日水位 |
| | | |
| | | private String daykr;//当日库容 |
| | | |
| | | private String rkll;//入库流量 |
| | | |
| | | private String ckllgg;//出库流量-灌溉 |
| | | private String ckllfd;//出库流量-发电 |
| | | private String ckllxth;//出库流量-泄调洪 |
| | | private String ckllqt;//出库流量-其它 |
| | | |
| | | /** |
| | | * 老站监测水位(米) |
| | | */ |
| | |
| | | <result property="images" column="images" typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/> |
| | | <result property="videos" column="videos" typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/> |
| | | <result property="curDrp" column="cur_drp"/> |
| | | <result property="daysw" column="daysw"/> |
| | | <result property="daykr" column="daykr"/> |
| | | <result property="rkll" column="rkll"/> |
| | | <result property="ckllgg" column="ckllgg"/> |
| | | <result property="ckllfd" column="ckllfd"/> |
| | | <result property="ckllxth" column="ckllxth"/> |
| | | <result property="ckllqt" column="ckllqt"/> |
| | | <result property="gateStatus" column="gate_status"/> |
| | | <result property="isOver" column="is_over"/> |
| | | <result property="lkOverZ" column="lk_over_z"/> |
| New file |
| | |
| | | package cn.gistack.sm.sg.controller; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgDeviceDO; |
| | | import cn.gistack.sm.sg.DO.SgGxStepDO; |
| | | import cn.gistack.sm.sg.DTO.SgDeviceSearchDTO; |
| | | import cn.gistack.sm.sg.service.SgDeviceService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工项目子设备表前端控制器 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-13 11:51:20 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sg_device") |
| | | public class SgDeviceController extends BladeController { |
| | | @Autowired |
| | | private SgDeviceService sgDeviceService; |
| | | /** |
| | | * 分页列表查询 |
| | | */ |
| | | @GetMapping(value = "/list") |
| | | public R queryPageList(SgDeviceSearchDTO searchDTO, Query query) { |
| | | IPage<SgDeviceDO> page = sgDeviceService.queryPageList(Condition.getPage(query), searchDTO); |
| | | return R.data(page); |
| | | } |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @param sgDeviceDO |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="子设备-添加", notes="子设备-添加") |
| | | @PostMapping(value = "/add") |
| | | public R add(@RequestBody SgDeviceDO sgDeviceDO) { |
| | | Date now = DateUtil.now(); |
| | | if (sgDeviceDO.getId() == null) { |
| | | sgDeviceDO.setCreateTime(now); |
| | | } |
| | | sgDeviceDO.setUpdateTime(now); |
| | | return R.data(sgDeviceService.saveById(sgDeviceDO)); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param sgDeviceDO |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="子设备-编辑", notes="子设备-编辑") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public R edit(@RequestBody SgDeviceDO sgDeviceDO) { |
| | | Date now = DateUtil.now(); |
| | | if (sgDeviceDO.getId() == null) { |
| | | sgDeviceDO.setCreateTime(now); |
| | | } |
| | | sgDeviceDO.setUpdateTime(now); |
| | | return R.data(sgDeviceService.updateById(sgDeviceDO)); |
| | | } |
| | | |
| | | /** |
| | | * 通过id删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="子设备-通过id删除", notes="子设备-通过id删除") |
| | | @PostMapping(value = "/delete") |
| | | public R delete(@RequestParam(name="id",required=true) String id) { |
| | | return R.data(sgDeviceService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="子设备-批量删除", notes="子设备-批量删除") |
| | | @PostMapping(value = "/deleteBatch") |
| | | public R deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | return R.data(sgDeviceService.removeByIds(Arrays.asList(ids.split(",")))); |
| | | } |
| | | |
| | | /** |
| | | * 通过id查询 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="子设备-通过id查询", notes="子设备-通过id查询") |
| | | @GetMapping(value = "/queryById") |
| | | public R queryById(@RequestParam(name="id",required=true) String id) { |
| | | SgDeviceDO sgDeviceDO = sgDeviceService.getSgDeviceById(id); |
| | | return R.data(sgDeviceDO); |
| | | } |
| | | |
| | | @GetMapping(value = "/getDeviceList") |
| | | public R getDeviceList(@RequestParam(name="programId",required=true) String programId) { |
| | | List<SgDeviceDO> page = sgDeviceService.getDeviceList(programId); |
| | | return R.data(page); |
| | | } |
| | | |
| | | @GetMapping(value = "/getStepList") |
| | | public R queryStepList(@RequestParam(name="deviceId",required=true) String deviceId) { |
| | | List<SgGxStepDO> page = sgDeviceService.queryStepList(deviceId); |
| | | return R.data(page); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.controller; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgGxDO; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import cn.gistack.sm.sg.VO.SgGxVO; |
| | | import cn.gistack.sm.sg.service.SgGxService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工工序基本表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-13 15:46:18 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sg_gx") |
| | | public class SgGxController extends BladeController { |
| | | @Autowired |
| | | private SgGxService sgGxService; |
| | | |
| | | /** |
| | | * 新增工序 |
| | | */ |
| | | @PostMapping(value = "/add") |
| | | public R add(@RequestBody SgGxDO sgGxDO) { |
| | | sgGxService.add(sgGxDO); |
| | | return R.success("添加成功"); |
| | | } |
| | | |
| | | /** |
| | | * 修改工序 |
| | | */ |
| | | @PostMapping(value = "/update") |
| | | public R update(@RequestBody SgGxDO sgGxDO) { |
| | | sgGxService.update(sgGxDO); |
| | | return R.success("修改成功"); |
| | | } |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | @GetMapping(value = "/page") |
| | | public R queryPageList(ProjectSearchDTO searchDTO, Query query) { |
| | | IPage<SgGxVO> page = sgGxService.queryPageList(Condition.getPage(query), searchDTO); |
| | | return R.data(page); |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @GetMapping(value = "/detail") |
| | | public R detail(Long id) { |
| | | |
| | | SgGxVO sgGxDO = sgGxService.detail(id); |
| | | return R.data(sgGxDO); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @GetMapping(value = "/delete") |
| | | public R delete(Long id) { |
| | | sgGxService.delete(id); |
| | | return R.success("删除成功"); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.controller; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgGxRoleDO; |
| | | import cn.gistack.sm.sg.DO.SgGxStepDO; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import cn.gistack.sm.sg.VO.SgGxRoleVO; |
| | | import cn.gistack.sm.sg.VO.SgGxVO; |
| | | import cn.gistack.sm.sg.service.SgGxStepService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工工序步骤表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-13 15:46:18 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sg_gx_step") |
| | | public class SgGxStepController extends BladeController { |
| | | @Autowired |
| | | private SgGxStepService sgGxStepService; |
| | | |
| | | /** |
| | | * 新增工序步骤 |
| | | */ |
| | | @PostMapping(value = "/add") |
| | | public R add(@RequestBody SgGxStepDO sgGxStepDO) { |
| | | sgGxStepService.add(sgGxStepDO); |
| | | return R.success("添加成功"); |
| | | } |
| | | |
| | | /** |
| | | * 修改工序步骤 |
| | | */ |
| | | @PostMapping(value = "/update") |
| | | public R update(@RequestBody SgGxStepDO sgGxStepDO) { |
| | | sgGxStepService.updateOne(sgGxStepDO); |
| | | return R.success("修改成功"); |
| | | } |
| | | |
| | | /** |
| | | * 删除工序步骤 |
| | | */ |
| | | @GetMapping(value = "/delete") |
| | | public R delete(String id) { |
| | | sgGxStepService.delete(id); |
| | | return R.success("删除成功"); |
| | | } |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | @GetMapping(value = "/page") |
| | | public R queryPageList(ProjectSearchDTO searchDTO, Query query) { |
| | | IPage<SgGxStepDO> page = sgGxStepService.queryPageList(Condition.getPage(query), searchDTO); |
| | | return R.data(page); |
| | | } |
| | | |
| | | @GetMapping(value = "/sg_list") |
| | | public R sgGxStepList() { |
| | | List<SgGxStepDO> sgGxStepDOS = sgGxStepService.sgGxStepList(); |
| | | return R.data(sgGxStepDOS); |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @GetMapping(value = "/detail") |
| | | public R queryPageList(String id) { |
| | | return R.data(sgGxStepService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 新增工序角色配置记录 |
| | | * @param SgGxRoleVO |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/addSgGxRole") |
| | | public R addSgGxRole(@RequestBody SgGxRoleVO SgGxRoleVO) { |
| | | |
| | | sgGxStepService.insertSgGxRole(SgGxRoleVO); |
| | | return R.success("添加成功"); |
| | | } |
| | | /** |
| | | * 更新工序角色配置记录 |
| | | * @param SgGxRoleVO |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/updateSgGxRole") |
| | | public R updateSgGxRole(@RequestBody SgGxRoleVO SgGxRoleVO) { |
| | | |
| | | sgGxStepService.updateSgGxRole(SgGxRoleVO); |
| | | return R.success("修改成功"); |
| | | } |
| | | |
| | | @GetMapping(value = "/getSgGxRoles") |
| | | public R getSgGxRoles(String gxDeviceType,String gxStepId) { |
| | | List<String> roleIds=sgGxStepService.getSgGxRoles(gxDeviceType,gxStepId); |
| | | return R.data(roleIds); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.controller; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgProgressReportDO; |
| | | import cn.gistack.sm.sg.DO.SgProjectInfoDO; |
| | | import cn.gistack.sm.sg.DTO.ApprovalDTO; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import cn.gistack.sm.sg.VO.SgProgressReportVO; |
| | | import cn.gistack.sm.sg.VO.SgProjectInfoVO; |
| | | import cn.gistack.sm.sg.VO.SgReportVO; |
| | | import cn.gistack.sm.sg.service.SgProgressReportService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工进度上报表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-15 10:22:08 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/progress_report") |
| | | public class SgProgressReportController { |
| | | @Autowired |
| | | private SgProgressReportService sgProgressReportService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | | */ |
| | | @GetMapping(value = "/page") |
| | | public R queryPageList(ProjectSearchDTO searchDTO, Query query) { |
| | | IPage<SgProgressReportVO> page = sgProgressReportService.queryPageList(Condition.getPage(query), searchDTO); |
| | | return R.data(page); |
| | | } |
| | | |
| | | /** |
| | | * 分页列表查询(所有数据,管理员用) |
| | | */ |
| | | @GetMapping(value = "/page_all") |
| | | public R queryPageListAll(ProjectSearchDTO searchDTO, Query query) { |
| | | IPage<SgProgressReportVO> page = sgProgressReportService.queryPageListAll(Condition.getPage(query), searchDTO); |
| | | return R.data(page); |
| | | } |
| | | |
| | | /** |
| | | * 新增上报 |
| | | */ |
| | | @PostMapping(value = "/add") |
| | | public R add(@RequestBody SgProgressReportDO sgProgressReportDO) { |
| | | sgProgressReportService.add(sgProgressReportDO); |
| | | return R.success("添加成功"); |
| | | } |
| | | |
| | | /** |
| | | * 修改上报 |
| | | */ |
| | | @PostMapping(value = "/update") |
| | | public R update(@RequestBody SgProgressReportDO sgProgressReportDO) { |
| | | sgProgressReportService.updateReport(sgProgressReportDO); |
| | | return R.success("添加成功"); |
| | | } |
| | | |
| | | /** |
| | | * 上报详情 |
| | | */ |
| | | @GetMapping(value = "/detail") |
| | | public R detail(String id) { |
| | | SgProgressReportVO sgProgressReportVO = sgProgressReportService.detail(id); |
| | | return R.data(sgProgressReportVO); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 审批 |
| | | */ |
| | | @PostMapping(value = "/approval") |
| | | public R approval(@RequestBody ApprovalDTO approvalDTO) { |
| | | sgProgressReportService.approval(approvalDTO); |
| | | return R.success("审批成功"); |
| | | } |
| | | |
| | | /** |
| | | * 待办列表(APP) |
| | | */ |
| | | @GetMapping(value = "/list") |
| | | public R queryList(ProjectSearchDTO searchDTO) { |
| | | List<SgProgressReportVO> list = sgProgressReportService.queryList( searchDTO); |
| | | return R.data(list); |
| | | } |
| | | |
| | | /** |
| | | * 待办列表分页 |
| | | */ |
| | | @GetMapping(value = "/project_progress_page") |
| | | public R progressPage(ProjectSearchDTO searchDTO,Query query) { |
| | | IPage<SgProgressReportVO> page = sgProgressReportService.progressPage(Condition.getPage(query),searchDTO); |
| | | return R.data(page); |
| | | } |
| | | |
| | | /** |
| | | * 待办列表统计(超级管理员) |
| | | */ |
| | | @GetMapping(value = "/approval_count_all") |
| | | public R countListAll(ProjectSearchDTO searchDTO) { |
| | | Map<String,Long> map= sgProgressReportService.countListAll( searchDTO); |
| | | return R.data(map); |
| | | } |
| | | |
| | | /** |
| | | * 待办列表统计(APP) |
| | | */ |
| | | @GetMapping(value = "/approval_count") |
| | | public R countList(ProjectSearchDTO searchDTO) { |
| | | Map<String,Long> map= sgProgressReportService.countList( searchDTO); |
| | | return R.data(map); |
| | | } |
| | | |
| | | /** |
| | | * 审批状态统计 |
| | | */ |
| | | @GetMapping(value = "/status_count") |
| | | public R statusCount(ProjectSearchDTO searchDTO) { |
| | | Map<String,Long> map= sgProgressReportService.statusCount(searchDTO); |
| | | return R.data(map); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 审批情况检验(APP) |
| | | */ |
| | | @GetMapping(value = "/check_step") |
| | | public R checkStep(@RequestParam Long deviceId , @RequestParam Long stepId) { |
| | | boolean flag = sgProgressReportService.checkStep(deviceId,stepId); |
| | | return R.data(flag); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询当前设备审批记录 |
| | | */ |
| | | @GetMapping(value = "/get_device_report") |
| | | public R getDeviceReport(@RequestParam Long deviceId , @RequestParam(required = false) Long stepId) { |
| | | String reportId = sgProgressReportService.getDeviceReport(deviceId,stepId); |
| | | return R.data(reportId); |
| | | } |
| | | |
| | | /** |
| | | * 查询当前设备审批记录 |
| | | */ |
| | | @GetMapping(value = "/get_device_reportcopy") |
| | | public R getDeviceReportcopy(@RequestParam Long deviceId , @RequestParam(required = false) Long stepId) { |
| | | SgReportVO sgReportVO = sgProgressReportService.getDeviceReportcopy(deviceId, stepId); |
| | | return R.data(sgReportVO); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.controller; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgProjectInfoDO; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import cn.gistack.sm.sg.VO.SgProjectInfoVO; |
| | | import cn.gistack.sm.sg.VO.SgStatisProVO; |
| | | import cn.gistack.sm.sg.VO.SgStatistccVO; |
| | | import cn.gistack.sm.sg.VO.SgStatisticsVO; |
| | | import cn.gistack.sm.sg.excel.ProjectExcel; |
| | | import cn.gistack.sm.sg.excel.ProjectImport; |
| | | import cn.gistack.sm.sg.service.SgProjectInfoService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.ApiOperation; |
| | | 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.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工项目表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-13 11:51:20 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sg_project_info") |
| | | public class SgProjectInfoController extends BladeController { |
| | | @Autowired |
| | | private SgProjectInfoService sgProjectInfoService; |
| | | /** |
| | | * 分页列表查询 |
| | | */ |
| | | @GetMapping(value = "/list") |
| | | public R queryPageList(ProjectSearchDTO searchDTO, Query query) { |
| | | IPage<SgProjectInfoDO> page = sgProjectInfoService.queryPageList(Condition.getPage(query), searchDTO); |
| | | return R.data(page); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询所有接口 |
| | | */ |
| | | @GetMapping(value = "/list_all") |
| | | public R queryPageList(ProjectSearchDTO searchDTO) { |
| | | List<SgProjectInfoDO> list = sgProjectInfoService.listAll(searchDTO); |
| | | return R.data(list); |
| | | } |
| | | |
| | | /** |
| | | * 查询项目进度情况 |
| | | */ |
| | | @GetMapping(value = "/project_step") |
| | | public R queryStepByProject(ProjectSearchDTO searchDTO) { |
| | | List<SgProjectInfoDO> list= sgProjectInfoService.queryStepByProject(searchDTO); |
| | | return R.data(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 项目进度列表(APP) |
| | | */ |
| | | @GetMapping(value = "/project_progress_list") |
| | | public R progressList(ProjectSearchDTO searchDTO) { |
| | | List<SgProjectInfoVO> list= sgProjectInfoService.progressList(searchDTO); |
| | | return R.data(list); |
| | | } |
| | | |
| | | /** |
| | | * 项目进度列表(分页) |
| | | */ |
| | | @GetMapping(value = "/project_progress_page") |
| | | public R progressPage(ProjectSearchDTO searchDTO,Query query) { |
| | | IPage<SgProjectInfoVO> page= sgProjectInfoService.progressPage(Condition.getPage(query),searchDTO); |
| | | return R.data(page); |
| | | } |
| | | |
| | | /** |
| | | * 首页项目统计(APP) |
| | | */ |
| | | @GetMapping(value = "/project_count") |
| | | public R projectCount(ProjectSearchDTO searchDTO) { |
| | | Map<String,Object> map = sgProjectInfoService.projectCount(searchDTO); |
| | | return R.data(map); |
| | | } |
| | | |
| | | /** |
| | | * 导入项目 |
| | | */ |
| | | @PostMapping("import_project") |
| | | public R importUser(MultipartFile file, Integer isCovered) { |
| | | ProjectImport projectImport = new ProjectImport(sgProjectInfoService, isCovered == 1); |
| | | ExcelUtil.save(file, projectImport, ProjectExcel.class); |
| | | return R.success("操作成功"); |
| | | } |
| | | |
| | | /** |
| | | * 统计项目饼状图 |
| | | */ |
| | | @GetMapping("statisticsce") |
| | | public R projectStatisSum(String code) { |
| | | SgStatisticsVO sgStatisticsVO = sgProjectInfoService.getsgStatistics(code); |
| | | return R.data(sgStatisticsVO); |
| | | } |
| | | |
| | | /** |
| | | * 统计项目图列表 |
| | | */ |
| | | @GetMapping("statisticsBarlist") |
| | | public R projectStatisList(String code) { |
| | | List<SgStatisProVO> sgStatisProVOS = sgProjectInfoService.getsgStatisticsList(code); |
| | | return R.data(sgStatisProVOS); |
| | | } |
| | | |
| | | /** |
| | | * 统计项目柱状图 |
| | | */ |
| | | @GetMapping("statisticsBar") |
| | | public R projectStatis(String code) { |
| | | List<SgStatistccVO> sgStatisProVOS = sgProjectInfoService.getsgStatisticscc(code); |
| | | return R.data(sgStatisProVOS); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.controller; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgProjectInfoDO; |
| | | import cn.gistack.sm.sg.DO.SgProjectPersonConfigDO; |
| | | import cn.gistack.sm.sg.DO.SgProjectRolePersonV0; |
| | | import cn.gistack.sm.sg.DTO.AddSgProjectPersonConfigDTO; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import cn.gistack.sm.sg.service.SgProjectPersonConfigService; |
| | | import org.checkerframework.checker.units.qual.A; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工项目人员配置表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-15 11:45:35 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/project_person") |
| | | public class SgProjectPersonConfigController { |
| | | @Autowired |
| | | private SgProjectPersonConfigService projectPersonConfigService; |
| | | |
| | | /** |
| | | * 查询项目下角色 |
| | | * @param searchDTO |
| | | * @return |
| | | */ |
| | | @GetMapping(value = "/get_role_list") |
| | | public R getRoleList(ProjectSearchDTO searchDTO) { |
| | | List<String> list= projectPersonConfigService.getRoleList(searchDTO); |
| | | return R.data(list); |
| | | } |
| | | |
| | | /** |
| | | * 新增项目人员配置 |
| | | */ |
| | | @PostMapping(value = "/add") |
| | | public R add(@RequestBody AddSgProjectPersonConfigDTO dto) { |
| | | projectPersonConfigService.add(dto); |
| | | return R.success("新增成功"); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @GetMapping(value = "/delete") |
| | | public R delete( String ids) { |
| | | projectPersonConfigService.removeBatchByIds(List.of(ids.split(","))); |
| | | return R.success("删除成功"); |
| | | } |
| | | |
| | | /** |
| | | * 列表 |
| | | */ |
| | | @GetMapping(value = "/list") |
| | | public R list( ProjectSearchDTO searchDTO) { |
| | | List<SgProjectRolePersonV0> list = projectPersonConfigService.getList(searchDTO); |
| | | return R.data(list); |
| | | } |
| | | |
| | | /** |
| | | * 根据角色查用户 |
| | | */ |
| | | @GetMapping(value = "/get_user_by_role") |
| | | public R getUserByRole( @RequestParam String roleId) { |
| | | List<Map<String,Object>> list = projectPersonConfigService.getUserByRole(roleId); |
| | | return R.data(list); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.excel; |
| | | |
| | | 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; |
| | | |
| | | @Data |
| | | @ColumnWidth(25) |
| | | @HeadRowHeight(20) |
| | | @ContentRowHeight(18) |
| | | public class ProjectExcel implements Serializable { |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.excel; |
| | | |
| | | import cn.gistack.sm.sg.service.SgProjectInfoService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springblade.core.excel.support.ExcelImporter; |
| | | |
| | | import java.util.List; |
| | | |
| | | @RequiredArgsConstructor |
| | | public class ProjectImport implements ExcelImporter<ProjectExcel> { |
| | | private final SgProjectInfoService service; |
| | | private final Boolean isCovered; |
| | | |
| | | @Override |
| | | public void save(List<ProjectExcel> data) { |
| | | service.importProject(data, isCovered); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.mapper; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgDeviceDO; |
| | | import cn.gistack.sm.sg.DTO.SgDeviceSearchDTO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工项目子设备表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-13 11:51:20 |
| | | */ |
| | | public interface SgDeviceMapper extends BaseMapper<SgDeviceDO> { |
| | | |
| | | List<SgDeviceDO> queryPageList(@Param("page")IPage<SgDeviceDO> page,@Param("dto") SgDeviceSearchDTO dto); |
| | | |
| | | SgDeviceDO getSgDeviceById(@Param("id")String id); |
| | | } |
| 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.sg.mapper.SgDeviceMapper"> |
| | | |
| | | <select id="queryPageList" resultType="cn.gistack.sm.sg.DO.SgDeviceDO"> |
| | | select ds.*,project.project_name as programName,dict."DICT_VALUE" as typeName from YWXT."SG_DEVICE" as ds left join YWXT."SG_PROJECT_INFO" as project on ds.program_id=project.id |
| | | left join YWXT."BLADE_DICT_BIZ" as dict on ds.device_type=dict.DICT_KEY and dict.CODE='SG_DEVICE_TYPE' where 1=1 |
| | | <if test="dto.projectName != null and dto.projectName != ''"> |
| | | and project.project_name like CONCAT(CONCAT('%', #{dto.projectName}), '%') |
| | | </if> |
| | | <if test="dto.projectId != null and dto.projectId != ''"> |
| | | and project.id = #{dto.projectId} |
| | | </if> |
| | | <if test="dto.deviceName != null and dto.deviceName != ''"> |
| | | and ds.device_name like CONCAT(CONCAT('%', #{dto.deviceName}), '%') |
| | | </if> |
| | | <if test="dto.deviceType != null and dto.deviceType != ''"> |
| | | and ds.device_type = #{dto.deviceType} |
| | | </if> |
| | | </select> |
| | | <select id="getSgDeviceById" resultType="cn.gistack.sm.sg.DO.SgDeviceDO"> |
| | | select ds.*,project.project_name as programName,dict."DICT_VALUE" as typeName from YWXT."SG_DEVICE" as ds left join YWXT."SG_PROJECT_INFO" as project on ds.program_id=project.id |
| | | left join YWXT."BLADE_DICT_BIZ" as dict on ds.device_type=dict.DICT_KEY and dict.CODE='SG_DEVICE_TYPE' where ds.id = #{id} |
| | | |
| | | </select> |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.sg.mapper; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgGxConfigDO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 设备工序配置角色表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-15 11:45:35 |
| | | */ |
| | | public interface SgGxConfigMapper extends BaseMapper<SgGxConfigDO> { |
| | | |
| | | } |
| 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.sg.mapper.SgGxConfigMapper"> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.sg.mapper; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgGxDO; |
| | | import cn.gistack.sm.sg.DO.SgGxStepDO; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import cn.gistack.sm.sg.VO.SgGxVO; |
| | | import cn.gistack.system.user.vo.UserVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工工序基本表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-13 15:46:18 |
| | | */ |
| | | public interface SgGxMapper extends BaseMapper<SgGxDO> { |
| | | |
| | | List<SgGxVO> queryPageList(IPage<SgGxVO> page, @Param("dto") ProjectSearchDTO dto); |
| | | |
| | | List<SgGxStepDO> queryStepByIds(@Param("ids") List<Long> ids); |
| | | |
| | | SgGxDO selectByGxType(@Param("gxType") String gxType); |
| | | |
| | | SgGxVO getById(@Param("id") Long id); |
| | | } |
| 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.sg.mapper.SgGxMapper"> |
| | | |
| | | <select id="queryPageList" resultType="cn.gistack.sm.sg.VO.SgGxVO"> |
| | | select * from YWXT.SG_GX gx where 1=1 and GX_TYPE not in('sgzb','sgys') |
| | | <if test="dto.gxType != null and dto.gxType != ''"> |
| | | and gx.gx_type LIKE CONCAT('%', #{dto.gxType}, '%') |
| | | </if> |
| | | <if test="dto.gxName != null and dto.gxName != ''"> |
| | | and gx.gx_name LIKE CONCAT('%', #{dto.gxName}, '%') |
| | | </if> |
| | | </select> |
| | | <select id="queryStepByIds" resultType="cn.gistack.sm.sg.DO.SgGxStepDO"> |
| | | select * from YWXT.SG_GX_STEP step where 1=1 |
| | | <if test="ids.size>0 and ids != null"> |
| | | and step.gx_info_id in |
| | | <foreach collection="ids" open="(" close=")" separator="," item="id"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | <select id="selectByGxType" resultType="cn.gistack.sm.sg.VO.SgGxVO"> |
| | | select * from YWXT.SG_GX where gx_type = #{gxType} |
| | | </select> |
| | | <select id="getById" resultType="cn.gistack.sm.sg.VO.SgGxVO"> |
| | | select * from YWXT.SG_GX where id = #{id} |
| | | </select> |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.sg.mapper; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgGxRoleDO; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工工序角色配置表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-13 15:46:18 |
| | | */ |
| | | public interface SgGxRoleMapper extends BaseMapper<SgGxRoleDO> { |
| | | |
| | | List<SgGxRoleDO> selectSgGxRole(@Param("gxDeviceType") String gxDeviceType,@Param("gxStepId") String gxStepId); |
| | | |
| | | /** |
| | | * 批量插入 |
| | | * @param sgGxRoles |
| | | */ |
| | | void insertBach(List<SgGxRoleDO> sgGxRoles); |
| | | |
| | | /** |
| | | * 根据工序类型、工序步骤id删除绑定 |
| | | * @param gxDeviceType |
| | | * @param gxStepId |
| | | */ |
| | | void deleteSgGxRoleDOs(@Param("gxDeviceType") String gxDeviceType,@Param("gxStepId") String gxStepId); |
| | | |
| | | List<String> getSgGxRoles(@Param("gxDeviceType") String gxDeviceType,@Param("gxStepId") String gxStepId); |
| | | } |
| 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.sg.mapper.SgGxRoleMapper"> |
| | | <insert id="insertBach"> |
| | | INSERT INTO YWXT.SG_GX_CONFIG (gx_device_type,gx_step_id,role_id,sg_order) |
| | | VALUES |
| | | <foreach collection="list" item="item" index="index" separator="," > |
| | | (#{item.gxDeviceType},#{item.gxStepId},#{item.roleId},#{item.sgOrder}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <delete id="deleteSgGxRoleDOs"> |
| | | delete from YWXT.SG_GX_CONFIG where gx_device_type = #{gxDeviceType} and gx_step_id = #{gxStepId} |
| | | |
| | | </delete> |
| | | |
| | | <select id="selectSgGxRole" resultType="cn.gistack.sm.sg.DO.SgGxRoleDO"> |
| | | select * from YWXT.SG_GX_CONFIG where gx_device_type = #{gxDeviceType} and gx_step_id = #{gxStepId} |
| | | |
| | | </select> |
| | | <select id="getSgGxRoles" resultType="java.lang.String"> |
| | | select role_id from YWXT.SG_GX_CONFIG where gx_device_type = #{gxDeviceType} |
| | | |
| | | <if test="gxStepId !=null and gxStepId !=''"> |
| | | and gx_step_id = #{gxStepId} |
| | | </if> |
| | | order by sg_order asc |
| | | |
| | | </select> |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.sg.mapper; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgDeviceGxStepDO; |
| | | import cn.gistack.sm.sg.DO.SgGxStepDO; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工工序步骤表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-13 15:46:18 |
| | | */ |
| | | public interface SgGxStepMapper extends BaseMapper<SgGxStepDO> { |
| | | |
| | | List<SgGxStepDO> selectByGxInfoId(@Param("gxInfoId") Long gxInfoId); |
| | | |
| | | List<SgGxStepDO> queryPageList(IPage<SgGxStepDO> page, @Param("dto") ProjectSearchDTO searchDTO); |
| | | |
| | | /** |
| | | * 查询设备下的工序状态 |
| | | * @param deviceId |
| | | * @return |
| | | */ |
| | | List<SgDeviceGxStepDO> getDeviceGXList(@Param("deviceId") Long deviceId); |
| | | |
| | | List<SgGxStepDO> queryStepList(@Param("deviceId")String deviceId); |
| | | |
| | | List<SgGxStepDO> getDEviceGXtwo(); |
| | | |
| | | List<SgGxStepDO> queryStepLists(@Param("deviceType") String deviceType); |
| | | } |
| 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.sg.mapper.SgGxStepMapper"> |
| | | |
| | | <select id="selectByGxInfoId" resultType="cn.gistack.sm.sg.DO.SgGxStepDO"> |
| | | select * from YWXT.SG_GX_STEP step where step.GX_INFO_ID = #{gxInfoId} order by step.GX_STEP_NUM ASC |
| | | </select> |
| | | <select id="queryPageList" resultType="cn.gistack.sm.sg.DO.SgGxStepDO"> |
| | | select step.*,GX.GX_TYPE from YWXT.SG_GX_STEP step left join YWXT.SG_GX GX ON step.GX_INFO_ID = GX.ID where 1=1 |
| | | <if test="dto.gxInfoId != null and dto.gxInfoId != ''"> |
| | | and step.GX_INFO_ID = #{dto.gxInfoId} |
| | | </if> |
| | | <if test="dto.gxStepNum != null and dto.gxStepNum != ''"> |
| | | and step.GX_STEP_NUM = #{dto.gxStepNum} |
| | | </if> |
| | | </select> |
| | | <select id="getDeviceGXList" resultType="cn.gistack.sm.sg.DO.SgDeviceGxStepDO"> |
| | | |
| | | |
| | | select info.*,ifnull(sp.status,0) as status from ( select sd.id as gxDeviceId ,sd.device_name as gxDeviceName,step.id as gxId, step.gx_step_num from YWXT.SG_DEVICE sd |
| | | |
| | | inner join YWXT.SG_GX sg on sd.device_type=sg.gx_type |
| | | |
| | | left join YWXT.SG_GX_STEP step on sg.id=step.gx_info_id |
| | | |
| | | where sd.id= #{deviceId} |
| | | |
| | | ) info left join YWXT.SG_PROGRESS_REPORT sp on info.gxDeviceId= sp.gx_device_id and info.gxId = sp.GX_STEP_ID |
| | | |
| | | |
| | | |
| | | </select> |
| | | <select id="queryStepList" resultType="cn.gistack.sm.sg.DO.SgGxStepDO"> |
| | | select step.* from YWXT.SG_GX_STEP step inner join YWXT.SG_GX sg on sg.id=step.gx_info_id |
| | | left join YWXT.SG_DEVICE sd on sd.device_type=sg.gx_type |
| | | where sd.id= #{deviceId} order by id asc |
| | | </select> |
| | | <select id="getDEviceGXtwo" resultType="cn.gistack.sm.sg.DO.SgGxStepDO"> |
| | | select step.*,GX.GX_TYPE from YWXT.SG_GX_STEP step left join YWXT.SG_GX GX ON step.GX_INFO_ID = GX.ID |
| | | where |
| | | GX.GX_TYPE in ('sgzb','sgys') order by id asc |
| | | |
| | | </select> |
| | | <select id="queryStepLists" resultType="cn.gistack.sm.sg.DO.SgGxStepDO"> |
| | | select step.* from YWXT.SG_GX_STEP step inner join YWXT.SG_GX sg on sg.id=step.gx_info_id |
| | | left join YWXT.SG_DEVICE sd on sd.device_type=sg.gx_type |
| | | where sg.GX_TYPE= #{deviceType} order by id asc |
| | | </select> |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.sg.mapper; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgProgressReportDO; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import cn.gistack.sm.sg.VO.SgProgressReportVO; |
| | | import cn.gistack.sm.sg.VO.SgStepReportVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工进度上报表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-15 10:22:08 |
| | | */ |
| | | public interface SgProgressReportMapper extends BaseMapper<SgProgressReportDO> { |
| | | |
| | | List<SgProgressReportVO> queryPageList(IPage<SgProgressReportVO> page, @Param("dto") ProjectSearchDTO searchDTO); |
| | | |
| | | SgProgressReportVO queryById(@Param("id") String id); |
| | | |
| | | List<SgProgressReportVO> queryList(@Param("dto") ProjectSearchDTO searchDTO); |
| | | List<SgProgressReportVO> queryList(IPage<SgProgressReportVO> page,@Param("dto") ProjectSearchDTO searchDTO); |
| | | |
| | | Long countList(@Param("dto") ProjectSearchDTO searchDTO); |
| | | |
| | | List<SgStepReportVO> selectByDeviceId(@Param("deviceId") Long gxDeviceId); |
| | | |
| | | List<SgProgressReportVO> statusCount(@Param("dto") ProjectSearchDTO searchDTO); |
| | | |
| | | List<Map<String, Object>> getUserByIds(@Param("ids") List<Long> ids); |
| | | |
| | | List<SgProgressReportVO> queryPageListAll(@Param("page") IPage<SgProgressReportVO> page, @Param("dto") ProjectSearchDTO searchDTO); |
| | | |
| | | Long selectProframId(Long deviceId); |
| | | } |
| 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.sg.mapper.SgProgressReportMapper"> |
| | | |
| | | <select id="queryPageList" resultType="cn.gistack.sm.sg.VO.SgProgressReportVO"> |
| | | SELECT |
| | | report.*, |
| | | de.device_name, |
| | | de.device_type, |
| | | dict."DICT_VALUE" as typeName |
| | | FROM |
| | | ywxt.SG_PROGRESS_REPORT report |
| | | LEFT JOIN ywxt.sg_device de ON report.gx_device_id = de.id |
| | | left join YWXT."BLADE_DICT_BIZ" as dict on de.device_type=dict.DICT_KEY and dict.CODE='SG_DEVICE_TYPE' |
| | | where 1=1 |
| | | <if test="dto.projectName != null and dto.projectName != ''"> |
| | | and report.PROGRAM_NAME like CONCAT(CONCAT('%',#{dto.projectName}),'%') |
| | | </if> |
| | | <if test="dto.deviceName != null and dto.deviceName != ''"> |
| | | and de.device_name like CONCAT(CONCAT('%', #{dto.deviceName}), '%') |
| | | </if> |
| | | <if test="dto.status != null "> |
| | | and report.status = #{dto.status} |
| | | </if> |
| | | <if test="dto.reportPerson != null "> |
| | | and report.report_user = #{dto.reportPerson} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="queryPageListAll" resultType="cn.gistack.sm.sg.VO.SgProgressReportVO"> |
| | | SELECT |
| | | report.*, |
| | | de.device_name, |
| | | de.device_type, |
| | | dict."DICT_VALUE" as typeName |
| | | FROM |
| | | ywxt.SG_PROGRESS_REPORT report |
| | | LEFT JOIN ywxt.sg_device de ON report.gx_device_id = de.id |
| | | left join YWXT."BLADE_DICT_BIZ" as dict on de.device_type=dict.DICT_KEY and dict.CODE='SG_DEVICE_TYPE' |
| | | where 1=1 and report."STATUS" != 4 |
| | | <if test="dto.projectName != null and dto.projectName != ''"> |
| | | and report.PROGRAM_NAME like CONCAT(CONCAT('%',#{dto.projectName}),'%') |
| | | </if> |
| | | <if test="dto.deviceName != null and dto.deviceName != ''"> |
| | | and de.device_name like CONCAT(CONCAT('%', #{dto.deviceName}), '%') |
| | | </if> |
| | | <if test="dto.status != null "> |
| | | and report.status = #{dto.status} |
| | | </if> |
| | | <if test="dto.startTime != null and dto.startTime != ''"> |
| | | and report.create_time >= #{dto.startTime} |
| | | </if> |
| | | <if test="dto.endTime != null and dto.endTime != ''"> |
| | | and report.create_time <= #{dto.endTime} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="queryById" resultType="cn.gistack.sm.sg.VO.SgProgressReportVO"> |
| | | select * from SG_PROGRESS_REPORT report where id = #{id} |
| | | </select> |
| | | <select id="queryList" resultType="cn.gistack.sm.sg.VO.SgProgressReportVO"> |
| | | SELECT distinct |
| | | report.id, |
| | | report.program_name, |
| | | report.gx_step_name, |
| | | report."STATUS", |
| | | report.audit_person, |
| | | report.report_time, |
| | | report.create_time, |
| | | report.gx_progress, |
| | | report.remark, |
| | | DBMS_LOB.SUBSTR(report.images_urls) imagesUrls , |
| | | DBMS_LOB.SUBSTR(report.video_urls) videoUrls, |
| | | de.device_name, |
| | | de.device_type, |
| | | <!-- userR.approval_status, --> |
| | | dict."DICT_VALUE" as typeName |
| | | FROM |
| | | ywxt.SG_PROGRESS_REPORT report |
| | | LEFT JOIN ywxt.sg_device de ON report.gx_device_id = de.id |
| | | left join YWXT."BLADE_DICT_BIZ" as dict on de.device_type=dict.DICT_KEY and dict.CODE='SG_DEVICE_TYPE' |
| | | LEFT JOIN ywxt.sg_report_user userR ON report.id = userR.report_id |
| | | WHERE |
| | | 1 = 1 and report."STATUS" != 4 |
| | | <!-- AND userR.is_his = 0 --> |
| | | <if test="dto.projectName != null and dto.projectName != ''"> |
| | | and report.PROGRAM_NAME like CONCAT(CONCAT('%',#{dto.projectName}),'%') |
| | | </if> |
| | | <if test="dto.deviceName != null and dto.deviceName != ''"> |
| | | and de.device_name like CONCAT(CONCAT('%', #{dto.deviceName}), '%') |
| | | </if> |
| | | <if test="dto.userId != null and dto.userId != ''"> |
| | | and userR.user_id = #{dto.userId} |
| | | </if> |
| | | <if test="dto.approvalStatus != null and dto.approvalStatus != 3"> |
| | | <if test="dto.approvalStatus != null and dto.approvalStatus ==0"> |
| | | and userR.approval_status = 0 |
| | | </if> |
| | | <if test="dto.approvalStatus != null and dto.approvalStatus ==1"> |
| | | and userR.approval_status != 0 |
| | | </if> |
| | | AND userR.approval_order != 0 |
| | | </if> |
| | | <choose > |
| | | <when test="dto.approvalStatus != null and dto.approvalStatus == 0"> |
| | | and report.audit_person = #{dto.userId} and (report."STATUS" = 0 or report."STATUS" = 1) |
| | | </when> |
| | | <when test="dto.approvalStatus != null and dto.approvalStatus == 1"> |
| | | and report."STATUS" != 0 |
| | | </when> |
| | | <when test="dto.approvalStatus != null and dto.approvalStatus == 3"> |
| | | and report.report_user = #{dto.userId} |
| | | </when> |
| | | </choose> |
| | | </select> |
| | | <select id="countList" resultType="java.lang.Long"> |
| | | select count(1) from ywxt.SG_PROGRESS_REPORT report |
| | | left join ywxt.sg_device de on report.gx_device_id = de.id |
| | | left join ywxt.sg_report_user userR on report.id = userR.report_id |
| | | where 1=1 and userR.is_his = 0 and userR.approval_order != 0 |
| | | <if test="dto.userId != null and dto.userId != ''"> |
| | | and userR.user_id = #{dto.userId} |
| | | </if> |
| | | <if test="dto.approvalStatus != null "> |
| | | and userR.approval_status = #{dto.approvalStatus} |
| | | </if> |
| | | <choose > |
| | | <when test="dto.approvalStatus != null and dto.approvalStatus == 0"> |
| | | and report.audit_person = #{dto.userId} |
| | | </when> |
| | | </choose> |
| | | </select> |
| | | <select id="selectByDeviceId" resultType="cn.gistack.sm.sg.VO.SgStepReportVO"> |
| | | SELECT |
| | | step.id AS stepId, |
| | | step.gx_step_name AS stepName, |
| | | step.gx_step_num AS stepNum, |
| | | re.STATUS AS approvalStatus, |
| | | re.report_time |
| | | FROM |
| | | ywxt.sg_gx_step step |
| | | LEFT JOIN ywxt.sg_gx gx ON step.gx_info_id = gx.id |
| | | LEFT JOIN ywxt.sg_device de ON gx.gx_type = de.device_type |
| | | LEFT JOIN ywxt.sg_progress_report re ON re.gx_step_id = step.id and re.gx_device_id = de.id and re."STATUS" != 4 |
| | | WHERE |
| | | 1 =1 and de.id = #{deviceId} |
| | | </select> |
| | | <select id="statusCount" resultType="cn.gistack.sm.sg.VO.SgProgressReportVO"> |
| | | SELECT |
| | | report.*, |
| | | de.device_name, |
| | | de.device_type, |
| | | dict."DICT_VALUE" as typeName |
| | | FROM |
| | | ywxt.SG_PROGRESS_REPORT report |
| | | LEFT JOIN ywxt.sg_device de ON report.gx_device_id = de.id |
| | | left join YWXT."BLADE_DICT_BIZ" as dict on de.device_type=dict.DICT_KEY and dict.CODE='SG_DEVICE_TYPE' |
| | | where 1=1 |
| | | <if test="dto.projectName != null and dto.projectName != ''"> |
| | | and report.PROGRAM_NAME like CONCAT(CONCAT('%',#{dto.projectName}),'%') |
| | | </if> |
| | | <if test="dto.deviceName != null and dto.deviceName != ''"> |
| | | and de.device_name like CONCAT(CONCAT('%', #{dto.deviceName}), '%') |
| | | </if> |
| | | <if test="dto.reportPerson != null"> |
| | | and report.report_user = #{dto.reportPerson} |
| | | </if> |
| | | </select> |
| | | <select id="getUserByIds" resultType="java.util.Map"> |
| | | select u.id ,u.real_name ,d.full_name as deptName from ywxt.blade_user u inner join ywxt.blade_dept d on u.dept_id = convert(varchar(100),d.id) where 1 = 1 |
| | | <if test="ids != null and ids.size>0"> |
| | | AND u.id in |
| | | <foreach collection="ids" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | <select id="selectProframId" resultType="java.lang.Long"> |
| | | select program_id from ywxt.sg_device where id = #{deviceId} |
| | | </select> |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.sg.mapper; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgGxStepDO; |
| | | import cn.gistack.sm.sg.DO.SgProjectInfoDO; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import cn.gistack.sm.sg.VO.SgProjectInfoVO; |
| | | import cn.gistack.sm.sg.VO.SgStatisProVO; |
| | | import cn.gistack.sm.sg.VO.SgStatistccVO; |
| | | import cn.gistack.sm.sg.VO.SgStatisticsVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工项目表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-13 11:51:20 |
| | | */ |
| | | public interface SgProjectInfoMapper extends BaseMapper<SgProjectInfoDO> { |
| | | |
| | | List<SgProjectInfoDO> queryPageList(IPage<SgProjectInfoDO> page, @Param("dto") ProjectSearchDTO dto); |
| | | |
| | | List<SgProjectInfoVO> queryStepByProject(@Param("dto") ProjectSearchDTO searchDTO); |
| | | |
| | | List<SgProjectInfoVO> progressList(@Param("dto") ProjectSearchDTO searchDTO); |
| | | |
| | | List<SgProjectInfoVO> progressList(IPage<SgProjectInfoVO> page, @Param("dto") ProjectSearchDTO searchDTO); |
| | | |
| | | SgStatisticsVO getSgstatiss(@Param("grad") String grad, String code); |
| | | |
| | | List<SgStatisProVO> getsgStatisticsList(String code); |
| | | |
| | | List<SgStatisProVO> getsgStatisticsZero(String code); |
| | | |
| | | List<SgStatisProVO> getsgStatisticsOne(String code); |
| | | |
| | | List<String> getProjectId(@Param("grad") String grad,@Param("code") String code); |
| | | |
| | | List<SgStatistccVO> getSgdevices(@Param("code")String code,@Param("grad") String adGrad); |
| | | |
| | | String getname(String code); |
| | | |
| | | List<SgProjectInfoVO> progressList1(IPage<SgProjectInfoVO> page, @Param("dto") ProjectSearchDTO dto); |
| | | |
| | | List<SgProjectInfoVO> queryStepByProject1(@Param("dto") ProjectSearchDTO searchDTO); |
| | | |
| | | //List<String> getProjectIds(String code,@Param("grad") String grad ); |
| | | } |
| 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.sg.mapper.SgProjectInfoMapper"> |
| | | |
| | | <select id="queryPageList" resultType="cn.gistack.sm.sg.DO.SgProjectInfoDO"> |
| | | SELECT |
| | | info.*, |
| | | dria."city_nm", |
| | | dria."county_nm", |
| | | dria."town_nm", |
| | | dria."eng_scal", |
| | | dria."bas_guid" |
| | | FROM |
| | | YWXT.SG_PROJECT_INFO info |
| | | LEFT JOIN SJZT_DW."dim_res_info_a" dria ON dria."res_cd" = info.sk_id |
| | | WHERE |
| | | 1 =1 |
| | | <if test="dto.projectName != null and dto.projectName != ''"> |
| | | and info.project_name like concat( concat ('%',#{dto.projectName}),'%') |
| | | </if> |
| | | <if test="dto.skName != null and dto.skName != ''"> |
| | | and info.sk_name like concat(concat('%',#{dto.skName}),'%') |
| | | </if> |
| | | <if test="dto.projectIds != null and dto.projectIds.size > 0"> |
| | | and info.id in |
| | | <foreach collection="dto.projectIds" item="id" separator="," open="(" close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | ORDER BY info.status desc |
| | | </select> |
| | | <select id="queryStepByProject" resultType="cn.gistack.sm.sg.VO.SgProjectInfoVO"> |
| | | |
| | | SELECT |
| | | pro.id, |
| | | pro.project_name, |
| | | gx.id AS gxId, |
| | | gx.gx_name, |
| | | d.device_name, |
| | | d.device_type, |
| | | dict."DICT_VALUE" AS typeName, |
| | | d.id AS dId, |
| | | step.gx_step_name, |
| | | step.gx_step_num, |
| | | step.id AS stepId, |
| | | re.STATUS AS reportStatus, |
| | | d.STATUS AS deviceStatus, |
| | | pro.STATUS AS projectStatus, |
| | | re.id AS reportId, |
| | | pro.lon_lat |
| | | FROM |
| | | ywxt.sg_project_info pro |
| | | LEFT JOIN ywxt.sg_device d ON pro.id = d.program_id |
| | | LEFT JOIN YWXT."BLADE_DICT_BIZ" AS dict ON d.device_type = dict.DICT_KEY |
| | | AND dict.CODE = 'SG_DEVICE_TYPE' |
| | | LEFT JOIN ywxt.sg_gx gx ON d.device_type = gx.gx_type |
| | | LEFT JOIN ywxt.sg_gx_step step ON gx.id = step.gx_info_id |
| | | LEFT JOIN ywxt.sg_progress_report re ON re.gx_step_id = step.id |
| | | AND re.gx_device_id = d.id |
| | | where 1=1 |
| | | <if test="dto.projectId != null and dto.projectId != ''"> |
| | | and pro.id = #{dto.projectId} |
| | | </if> |
| | | <if test="dto.projectName != null and dto.projectName != ''"> |
| | | and pro.project_name like CONCAT(CONCAT('%', #{dto.projectName}), '%') |
| | | </if> |
| | | <if test="dto.status != null"> |
| | | and pro.status = #{dto.status} |
| | | </if> |
| | | <if test="dto.projectIds != null and dto.projectIds.size > 0"> |
| | | and pro.id in |
| | | <foreach collection="dto.projectIds" item="id" separator="," open="(" close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | <select id="progressList" resultType="cn.gistack.sm.sg.VO.SgProjectInfoVO"> |
| | | SELECT |
| | | pro.id, |
| | | pro.project_name, |
| | | pro.lon_lat, |
| | | pro.status |
| | | FROM |
| | | ywxt.sg_project_info pro |
| | | WHERE 1=1 |
| | | <if test="dto.status != null"> |
| | | and pro.status = #{dto.status} |
| | | </if> |
| | | <if test="dto.projectName != null and dto.projectName != ''"> |
| | | and pro.project_name like CONCAT(CONCAT('%',#{dto.projectName}),'%') |
| | | </if> |
| | | </select> |
| | | <select id="getSgstatiss" resultType="cn.gistack.sm.sg.VO.SgStatisticsVO"> |
| | | SELECT |
| | | SUM( CASE WHEN info.STATUS = 0 THEN 1 ELSE 0 END ) AS noCommenceNum, |
| | | SUM( CASE WHEN info.STATUS IN ( 1, 2 ) THEN 1 ELSE 0 END ) AS commenceNum, |
| | | count( info.STATUS ) projectSum |
| | | FROM |
| | | YWXT.SG_PROJECT_INFO info |
| | | LEFT JOIN SJZT_DW."dim_res_info_a" dria ON dria."res_cd" = info.sk_id |
| | | WHERE |
| | | 1 = 1 |
| | | <if test="grad == 0"> |
| | | AND |
| | | dria."bas_name" = #{code} |
| | | </if> |
| | | <if test="grad == 2"> |
| | | AND |
| | | dria."city_cd" = #{code} |
| | | </if> |
| | | <if test="grad == 3"> |
| | | AND |
| | | dria."county_cd" = #{code} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | <select id="getsgStatisticsList" resultType="cn.gistack.sm.sg.VO.SgStatisProVO"> |
| | | SELECT |
| | | a."ad_code" CODE, |
| | | a."ad_name" NAME, |
| | | SUM( CASE WHEN b.STATUS IN ( 1, 2 ) THEN 1 ELSE 0 END ) AS commenceNum, |
| | | count( b.STATUS ) projectSum |
| | | FROM |
| | | ( |
| | | SELECT |
| | | dria."county_cd" AS countyCode, |
| | | att."guid" AS cityCode, |
| | | ad."ad_code" AS provinceCode, |
| | | info.STATUS |
| | | FROM |
| | | YWXT.SG_PROJECT_INFO info |
| | | LEFT JOIN SJZT_DW."dim_res_info_a" dria ON dria."res_cd" = info.sk_id |
| | | LEFT JOIN YWXT."att_ad_base" att ON att."ad_code" = dria."city_cd" |
| | | LEFT JOIN YWXT."att_ad_base" ad ON att."p_ad_code" = ad."ad_code" |
| | | LEFT JOIN YWXT."att_ad_base" aad ON aad."ad_code" = ad."p_ad_code" |
| | | ) b |
| | | LEFT JOIN YWXT."att_ad_base" a ON ( |
| | | ( b.countyCode = a."guid" ) |
| | | OR ( b.cityCode = a."guid" ) |
| | | OR ( b.provinceCode = a."guid" )) |
| | | WHERE |
| | | a."p_ad_code" = #{code} |
| | | GROUP BY |
| | | a."ad_code", |
| | | a."ad_name" |
| | | </select> |
| | | |
| | | <select id="getsgStatisticsZero" resultType="cn.gistack.sm.sg.VO.SgStatisProVO"> |
| | | SELECT |
| | | dria."city_cd" code, dria."city_nm" name , |
| | | sum( CASE WHEN info.STATUS IN ( 1, 2 ) THEN 1 ELSE 0 END ) AS commenceNum, |
| | | count( info.STATUS ) projectSum |
| | | FROM |
| | | YWXT.SG_PROJECT_INFO info |
| | | LEFT JOIN SJZT_DW."dim_res_info_a" dria ON dria."res_cd" = info.sk_id |
| | | WHERE |
| | | 1 = 1 |
| | | AND |
| | | dria."bas_name" =#{code} |
| | | Group By dria."city_cd",dria."city_nm" |
| | | HAVING |
| | | dria."city_cd" IS NOT NULL AND |
| | | dria."city_nm" IS NOT NULL |
| | | </select> |
| | | |
| | | <select id="getsgStatisticsOne" resultType="cn.gistack.sm.sg.VO.SgStatisProVO"> |
| | | SELECT |
| | | dria."bas_name" AS code, |
| | | dria."bas_guid" AS name, |
| | | sum( CASE WHEN info.STATUS IN ( 1, 2 ) THEN 1 ELSE 0 END ) AS commenceNum, |
| | | count( info.STATUS ) AS projectSum |
| | | FROM |
| | | YWXT.SG_PROJECT_INFO info |
| | | LEFT JOIN SJZT_DW."dim_res_info_a" dria ON dria."res_cd" = info.sk_id |
| | | WHERE |
| | | 1 = 1 |
| | | GROUP BY |
| | | dria."bas_guid", |
| | | dria."bas_name" |
| | | HAVING |
| | | dria."bas_guid" IS NOT NULL AND |
| | | dria."bas_name" IS NOT NULL |
| | | </select> |
| | | |
| | | <select id="getProjectId" resultType="java.lang.String"> |
| | | select id from YWXT.SG_PROJECT_INFO info |
| | | LEFT JOIN SJZT_DW."dim_res_info_a" dria ON dria."res_cd" = info.sk_id |
| | | where info.STATUS<![CDATA[<>]]>'0' and 1=1 |
| | | <if test="grad == 0"> |
| | | AND |
| | | dria."bas_name" = #{code} |
| | | </if> |
| | | <if test="grad == 2"> |
| | | AND |
| | | dria."city_cd" = #{code} |
| | | </if> |
| | | <if test="grad == 3"> |
| | | AND |
| | | dria."county_cd" = #{code} |
| | | </if> |
| | | </select> |
| | | <select id="getSgdevices" resultType="cn.gistack.sm.sg.VO.SgStatistccVO"> |
| | | SELECT |
| | | dict."DICT_VALUE" AS typeName, |
| | | dict.CODE code, |
| | | count(ds.ID) as deviceNum |
| | | FROM |
| | | YWXT."SG_DEVICE" AS ds |
| | | LEFT JOIN YWXT."SG_PROJECT_INFO" AS project ON ds.program_id = project.id |
| | | LEFT JOIN YWXT."BLADE_DICT_BIZ" AS dict ON ds.device_type = dict.DICT_KEY |
| | | AND dict.CODE = 'SG_DEVICE_TYPE' |
| | | LEFT JOIN SJZT_DW."dim_res_info_a" dria ON dria."res_cd" = project.sk_id |
| | | WHERE |
| | | 1 =1 |
| | | <if test="grad == 0"> |
| | | AND |
| | | dria."bas_name" = #{code} |
| | | </if> |
| | | <if test="grad == 2"> |
| | | AND |
| | | dria."city_cd" = #{code} |
| | | </if> |
| | | <if test="grad == 3"> |
| | | AND |
| | | dria."county_cd" = #{code} |
| | | </if> |
| | | Group By dict.CODE,dict."DICT_VALUE" |
| | | </select> |
| | | <select id="getname" resultType="java.lang.String"> |
| | | select DISTINCT "bas_guid" from SJZT_DW."dim_res_info_a" where "bas_name" = #{code} |
| | | </select> |
| | | <select id="progressList1" resultType="cn.gistack.sm.sg.VO.SgProjectInfoVO"> |
| | | select pro.id, |
| | | pro.project_name, |
| | | pro.lon_lat, |
| | | pro.status |
| | | from |
| | | (SELECT |
| | | pro.id, |
| | | pro.project_name, |
| | | pro.lon_lat, |
| | | pro.status, |
| | | dria."county_cd" AS countyCode, |
| | | att."guid" AS cityCode, |
| | | ad."ad_code" AS provinceCode |
| | | FROM |
| | | ywxt.sg_project_info pro |
| | | LEFT JOIN SJZT_DW."dim_res_info_a" dria ON dria."res_cd" = pro.sk_id |
| | | LEFT JOIN YWXT."att_ad_base" att ON att."ad_code" = dria."city_cd" |
| | | LEFT JOIN YWXT."att_ad_base" ad ON att."p_ad_code" = ad."ad_code" |
| | | LEFT JOIN YWXT."att_ad_base" aad ON aad."ad_code" = ad."p_ad_code") pro |
| | | LEFT JOIN YWXT."att_ad_base" a ON ( |
| | | ( pro.countyCode = a."guid" ) |
| | | OR ( pro.cityCode = a."guid" ) |
| | | OR ( pro.provinceCode = a."guid" )) |
| | | WHERE 1=1 and a."p_ad_code" = #{dto.adCode} |
| | | <if test="dto.status != null"> |
| | | and pro.status = #{dto.status} |
| | | </if> |
| | | <if test="dto.projectName != null and dto.projectName != ''"> |
| | | and pro.project_name like CONCAT(CONCAT('%',#{dto.projectName}),'%') |
| | | </if> |
| | | </select> |
| | | <select id="queryStepByProject1" resultType="cn.gistack.sm.sg.VO.SgProjectInfoVO"> |
| | | select |
| | | pro.id, |
| | | pro.project_name, |
| | | pro.gxId, |
| | | pro.gx_name, |
| | | pro.device_name, |
| | | pro.device_type, |
| | | pro.typeName, |
| | | pro.dId, |
| | | pro.gx_step_name, |
| | | pro.gx_step_num, |
| | | pro.stepId, |
| | | pro.reportStatus, |
| | | pro.deviceStatus, |
| | | pro.projectStatus, |
| | | pro.reportId, |
| | | pro.lon_lat |
| | | from |
| | | (SELECT |
| | | pro.id, |
| | | pro.project_name, |
| | | gx.id AS gxId, |
| | | gx.gx_name, |
| | | d.device_name, |
| | | d.device_type, |
| | | dict."DICT_VALUE" AS typeName, |
| | | d.id AS dId, |
| | | step.gx_step_name, |
| | | step.gx_step_num, |
| | | step.id AS stepId, |
| | | re.STATUS AS reportStatus, |
| | | d.STATUS AS deviceStatus, |
| | | pro.STATUS AS projectStatus, |
| | | re.id AS reportId, |
| | | pro.lon_lat, |
| | | dria."county_cd" AS countyCode, |
| | | att."guid" AS cityCode, |
| | | ad."ad_code" AS provinceCode |
| | | FROM |
| | | ywxt.sg_project_info pro |
| | | LEFT JOIN ywxt.sg_device d ON pro.id = d.program_id |
| | | LEFT JOIN YWXT."BLADE_DICT_BIZ" AS dict ON d.device_type = dict.DICT_KEY |
| | | AND dict.CODE = 'SG_DEVICE_TYPE' |
| | | LEFT JOIN ywxt.sg_gx gx ON d.device_type = gx.gx_type |
| | | LEFT JOIN ywxt.sg_gx_step step ON gx.id = step.gx_info_id |
| | | LEFT JOIN ywxt.sg_progress_report re ON re.gx_step_id = step.id |
| | | AND re.gx_device_id = d.id |
| | | LEFT JOIN SJZT_DW."dim_res_info_a" dria ON dria."res_cd" = pro.sk_id |
| | | LEFT JOIN YWXT."att_ad_base" att ON att."ad_code" = dria."city_cd" |
| | | LEFT JOIN YWXT."att_ad_base" ad ON att."p_ad_code" = ad."ad_code" |
| | | LEFT JOIN YWXT."att_ad_base" aad ON aad."ad_code" = ad."p_ad_code") pro |
| | | LEFT JOIN YWXT."att_ad_base" a ON ( |
| | | ( pro.countyCode = a."guid" ) |
| | | OR ( pro.cityCode = a."guid" ) |
| | | OR ( pro.provinceCode = a."guid" )) |
| | | WHERE 1=1 and a."p_ad_code" = #{dto.adCode} |
| | | <if test="dto.projectId != null and dto.projectId != ''"> |
| | | and pro.id = #{dto.projectId} |
| | | </if> |
| | | <if test="dto.projectName != null and dto.projectName != ''"> |
| | | and pro.project_name like CONCAT(CONCAT('%', #{dto.projectName}), '%') |
| | | </if> |
| | | <if test="dto.status != null"> |
| | | and pro.status = #{dto.status} |
| | | </if> |
| | | <if test="dto.projectIds != null and dto.projectIds.size > 0"> |
| | | and pro.id in |
| | | <foreach collection="dto.projectIds" item="id" separator="," open="(" close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | <!-- <select id="getProjectIds" resultType="java.lang.String">--> |
| | | |
| | | <!-- </select>--> |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.sg.mapper; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgProjectPersonConfigDO; |
| | | import cn.gistack.sm.sg.DO.SgProjectRolePersonV0; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工项目人员配置表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-15 11:45:35 |
| | | */ |
| | | public interface SgProjectPersonConfigMapper extends BaseMapper<SgProjectPersonConfigDO> { |
| | | |
| | | SgProjectPersonConfigDO selectByUserId(@Param("userId") Long reportUser); |
| | | |
| | | List<String> getRoleList(@Param("dto") ProjectSearchDTO searchDTO); |
| | | |
| | | List<SgProjectRolePersonV0> getList(@Param("dto") ProjectSearchDTO searchDTO); |
| | | |
| | | List<Map<String, Object>> getUserByRole(@Param("roleId") String roleId); |
| | | } |
| 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.sg.mapper.SgProjectPersonConfigMapper"> |
| | | |
| | | <select id="selectByUserId" resultType="cn.gistack.sm.sg.DO.SgProjectPersonConfigDO"> |
| | | select * from YWXT.SG_PROJECT_PERSON_CONFIG where USER_ID = #{userId} |
| | | </select> |
| | | <select id="getRoleList" resultType="java.lang.String"> |
| | | SELECT |
| | | <!-- pro.id, |
| | | pro.project_name, |
| | | sgc.gx_device_type as deviceType, |
| | | d.id as deviceId, --> |
| | | sgc.role_id as roleId |
| | | FROM |
| | | ywxt.sg_project_info pro |
| | | LEFT JOIN ywxt.sg_device d ON pro.id = d.program_id |
| | | LEFT JOIN ywxt.sg_gx_config sgc ON d.device_type = sgc.gx_device_type |
| | | where 1=1 |
| | | <if test="dto.projectId != null"> |
| | | and pro.id = #{dto.projectId} |
| | | </if> |
| | | </select> |
| | | <select id="getList" resultType="cn.gistack.sm.sg.DO.SgProjectRolePersonV0"> |
| | | SELECT |
| | | DISTINCT |
| | | sgc.role_id as roleId, |
| | | pro.id as projectId, |
| | | pro.project_name, |
| | | ro.role_name |
| | | -- d.id as device_id, |
| | | -- d.device_name |
| | | , sppc.user_id |
| | | , sppc.id |
| | | , bu.real_name as userName |
| | | FROM |
| | | ywxt.sg_project_info pro |
| | | inner JOIN ywxt.sg_device d ON pro.id = d.program_id |
| | | Left JOIN ywxt.sg_gx_config sgc ON d.device_type = sgc.gx_device_type or sgc.gx_device_type in ('sgzb','sgys') |
| | | left join ywxt.blade_role ro on ro.id = sgc.role_id |
| | | left join ywxt.sg_project_person_config sppc on sgc.role_id = sppc.rold_id and sppc.program_id = pro.id |
| | | left join ywxt.blade_user bu on sppc.user_id = bu.id |
| | | where 1=1 and pro.id = #{dto.projectId} |
| | | </select> |
| | | <select id="getUserByRole" resultType="java.util.Map"> |
| | | select id,real_name as realName from ywxt.blade_user where role_id = #{roleId} |
| | | </select> |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.sg.mapper; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgReportUserDO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 审批报告人 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-15 14:57:55 |
| | | */ |
| | | public interface SgReportUserMapper extends BaseMapper<SgReportUserDO> { |
| | | } |
| 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.sg.mapper.SgReportUserMapper"> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.sg.service; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgDeviceDO; |
| | | import cn.gistack.sm.sg.DO.SgGxStepDO; |
| | | import cn.gistack.sm.sg.DTO.SgDeviceSearchDTO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工子设备表 服务类 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-13 11:51:20 |
| | | */ |
| | | public interface SgDeviceService extends IService<SgDeviceDO> { |
| | | |
| | | IPage<SgDeviceDO> queryPageList(IPage<SgDeviceDO> page, SgDeviceSearchDTO searchDTO); |
| | | |
| | | /** |
| | | * 根据项目id查询下下面的设备list |
| | | * @param programId |
| | | * @return |
| | | */ |
| | | List<SgDeviceDO> getDeviceList(String programId); |
| | | |
| | | SgDeviceDO getSgDeviceById(String id); |
| | | |
| | | List<SgGxStepDO> queryStepList(String deviceId); |
| | | |
| | | boolean saveById(SgDeviceDO sgDeviceDO); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.service; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgGxDO; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import cn.gistack.sm.sg.VO.SgGxVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工工序基本表 服务类 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-13 15:46:18 |
| | | */ |
| | | public interface SgGxService extends IService<SgGxDO> { |
| | | |
| | | IPage<SgGxVO> queryPageList(IPage<SgGxVO> page, ProjectSearchDTO searchDTO); |
| | | |
| | | void add(SgGxDO sgGxDO); |
| | | |
| | | void update(SgGxDO sgGxDO); |
| | | |
| | | SgGxVO detail(Long id); |
| | | |
| | | void delete(Long id); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.service; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgGxRoleDO; |
| | | import cn.gistack.sm.sg.DO.SgGxStepDO; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import cn.gistack.sm.sg.VO.SgGxRoleVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工工序步骤表 服务类 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-13 15:46:18 |
| | | */ |
| | | public interface SgGxStepService extends IService<SgGxStepDO> { |
| | | |
| | | void add(SgGxStepDO sgGxStepDO); |
| | | |
| | | void updateOne(SgGxStepDO sgGxStepDO); |
| | | |
| | | void delete(String id); |
| | | |
| | | IPage<SgGxStepDO> queryPageList(IPage<SgGxStepDO> page, @Param("dto") ProjectSearchDTO searchDTO); |
| | | |
| | | |
| | | /** |
| | | * 新增绑定的角色 |
| | | * @param sgGxRoleVO |
| | | */ |
| | | void insertSgGxRole(SgGxRoleVO sgGxRoleVO); |
| | | |
| | | /** |
| | | * 更新绑定的角色 |
| | | * @param sgGxRoleVO |
| | | */ |
| | | void updateSgGxRole(SgGxRoleVO sgGxRoleVO); |
| | | |
| | | /** |
| | | * 获取绑定的角色 |
| | | * @param gxDeviceType |
| | | * @param gxStepId |
| | | * @return |
| | | */ |
| | | List<String> getSgGxRoles(String gxDeviceType, String gxStepId); |
| | | |
| | | List<SgGxStepDO> sgGxStepList(); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.service; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgProgressReportDO; |
| | | import cn.gistack.sm.sg.DTO.ApprovalDTO; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import cn.gistack.sm.sg.VO.SgProgressReportVO; |
| | | import cn.gistack.sm.sg.VO.SgReportVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工进度上报表 服务类 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-15 10:22:08 |
| | | */ |
| | | public interface SgProgressReportService extends IService<SgProgressReportDO> { |
| | | |
| | | IPage<SgProgressReportVO> queryPageList(IPage<SgProgressReportVO> page, ProjectSearchDTO searchDTO); |
| | | |
| | | IPage<SgProgressReportVO> queryPageListAll(IPage<SgProgressReportVO> page, ProjectSearchDTO searchDTO); |
| | | |
| | | void add(SgProgressReportDO sgProgressReportDO); |
| | | |
| | | SgProgressReportVO detail(String id); |
| | | |
| | | void approval(ApprovalDTO approvalDTO); |
| | | |
| | | void updateReport(SgProgressReportDO sgProgressReportDO); |
| | | |
| | | List<SgProgressReportVO> queryList(ProjectSearchDTO searchDTO); |
| | | |
| | | Map<String, Long> countList(ProjectSearchDTO searchDTO); |
| | | |
| | | Map<String, Long> countListAll(ProjectSearchDTO searchDTO); |
| | | |
| | | Map<String, Long> statusCount(ProjectSearchDTO searchDTO); |
| | | |
| | | boolean checkStep(Long deviceId, Long stepId); |
| | | |
| | | IPage<SgProgressReportVO> progressPage(IPage<SgProgressReportVO> page, ProjectSearchDTO searchDTO); |
| | | |
| | | String getDeviceReport(Long deviceId, Long stepId); |
| | | |
| | | |
| | | SgReportVO getDeviceReportcopy(Long deviceId, Long stepId); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.service; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgProjectInfoDO; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import cn.gistack.sm.sg.VO.SgProjectInfoVO; |
| | | import cn.gistack.sm.sg.VO.SgStatisProVO; |
| | | import cn.gistack.sm.sg.VO.SgStatistccVO; |
| | | import cn.gistack.sm.sg.VO.SgStatisticsVO; |
| | | import cn.gistack.sm.sg.excel.ProjectExcel; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工项目表 服务类 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-13 11:51:20 |
| | | */ |
| | | public interface SgProjectInfoService extends IService<SgProjectInfoDO> { |
| | | |
| | | IPage<SgProjectInfoDO> queryPageList(IPage<SgProjectInfoDO> page, ProjectSearchDTO searchDTO); |
| | | |
| | | List<SgProjectInfoDO> queryStepByProject(ProjectSearchDTO searchDTO); |
| | | |
| | | List<SgProjectInfoVO> progressList(ProjectSearchDTO searchDTO); |
| | | |
| | | Map<String, Object> projectCount(ProjectSearchDTO searchDTO); |
| | | |
| | | void importProject(List<ProjectExcel> data, Boolean isCovered); |
| | | |
| | | IPage<SgProjectInfoVO> progressPage(IPage<SgProjectInfoVO> page, ProjectSearchDTO searchDTO); |
| | | |
| | | List<SgProjectInfoDO> listAll(ProjectSearchDTO searchDTO); |
| | | |
| | | SgStatisticsVO getsgStatistics(String code); |
| | | |
| | | List<SgStatisProVO> getsgStatisticsList(String code); |
| | | |
| | | List<SgStatistccVO> getsgStatisticscc(String code); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.service; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgProjectPersonConfigDO; |
| | | import cn.gistack.sm.sg.DO.SgProjectRolePersonV0; |
| | | import cn.gistack.sm.sg.DTO.AddSgProjectPersonConfigDTO; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工项目人员配置表 服务类 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-15 11:45:35 |
| | | */ |
| | | public interface SgProjectPersonConfigService extends IService<SgProjectPersonConfigDO> { |
| | | |
| | | List<String> getRoleList(ProjectSearchDTO searchDTO); |
| | | |
| | | void add(AddSgProjectPersonConfigDTO dto); |
| | | |
| | | |
| | | List<SgProjectRolePersonV0> getList(ProjectSearchDTO searchDTO); |
| | | |
| | | List<Map<String, Object>> getUserByRole(String roleId); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.service.impl; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgDeviceDO; |
| | | import cn.gistack.sm.sg.DO.SgGxStepDO; |
| | | import cn.gistack.sm.sg.DO.SgProgressReportDO; |
| | | import cn.gistack.sm.sg.DTO.SgDeviceSearchDTO; |
| | | import cn.gistack.sm.sg.mapper.SgDeviceMapper; |
| | | import cn.gistack.sm.sg.mapper.SgGxStepMapper; |
| | | import cn.gistack.sm.sg.mapper.SgProgressReportMapper; |
| | | import cn.gistack.sm.sg.service.SgDeviceService; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工项目子设备 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-13 11:51:20 |
| | | */ |
| | | @Service |
| | | public class SgDeviceServiceImpl extends ServiceImpl<SgDeviceMapper, SgDeviceDO> implements SgDeviceService { |
| | | @Autowired |
| | | private SgGxStepMapper sgGxStepMapper; |
| | | |
| | | @Autowired |
| | | private SgProgressReportMapper sgProgressReportMapper; |
| | | |
| | | |
| | | @Override |
| | | public IPage<SgDeviceDO> queryPageList(IPage<SgDeviceDO> page, SgDeviceSearchDTO searchDTO) { |
| | | List<SgDeviceDO> sgDeviceDOS = baseMapper.queryPageList(page,searchDTO); |
| | | return page.setRecords(sgDeviceDOS); |
| | | } |
| | | |
| | | /** |
| | | * 根据项目id查询下下面的设备list |
| | | * |
| | | * @param programId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<SgDeviceDO> getDeviceList(String programId) { |
| | | List<SgDeviceDO> list = new ArrayList<>(); |
| | | QueryWrapper<SgDeviceDO> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("program_id", programId); |
| | | SgDeviceDO sg1 = new SgDeviceDO(); |
| | | sg1.setId((long) 999); |
| | | sg1.setDeviceName("施工准备"); |
| | | sg1.setDeviceType("sgzb"); |
| | | sg1.setStatus(0); |
| | | list.add(sg1); |
| | | |
| | | List<SgDeviceDO> sgDeviceDOS = baseMapper.selectList(queryWrapper); |
| | | if (CollectionUtils.isNotEmpty(sgDeviceDOS)) { |
| | | list.addAll(sgDeviceDOS); |
| | | } |
| | | |
| | | SgDeviceDO sg2 = new SgDeviceDO(); |
| | | sg2.setId((long) 998); |
| | | sg2.setDeviceName("施工验收"); |
| | | sg2.setDeviceType("sgys"); |
| | | sg2.setStatus(0); |
| | | list.add(sg2); |
| | | |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public SgDeviceDO getSgDeviceById(String id) { |
| | | return baseMapper.getSgDeviceById(id); |
| | | } |
| | | |
| | | @Override |
| | | public List<SgGxStepDO> queryStepList(String deviceId) { |
| | | if(deviceId.equals("998")){ |
| | | return sgGxStepMapper.queryStepLists("sgys"); |
| | | }else if (deviceId.equals("999")){ |
| | | return sgGxStepMapper.queryStepLists("sgzb"); |
| | | } |
| | | List<SgGxStepDO> sgGxStepDOS = sgGxStepMapper.queryStepList(deviceId); |
| | | return sgGxStepDOS; |
| | | } |
| | | |
| | | @Override |
| | | public boolean saveById(SgDeviceDO sgDeviceDO) { |
| | | QueryWrapper<SgProgressReportDO> queryWrapper = new QueryWrapper<>(); |
| | | SgProgressReportDO sgProgressReportDO = sgProgressReportMapper.selectOne(queryWrapper.eq("profram_id", sgDeviceDO.getProgramId()).eq("gx_step_id",26)); |
| | | if (sgProgressReportDO != null) { |
| | | if(sgProgressReportDO.getStatus().equals(2)){ |
| | | throw new ServiceException("施工验收完成不能增加设备"); |
| | | } |
| | | } |
| | | |
| | | return save(sgDeviceDO); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.service.impl; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgGxDO; |
| | | import cn.gistack.sm.sg.DO.SgGxStepDO; |
| | | import cn.gistack.sm.sg.DO.SgReportUserDO; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import cn.gistack.sm.sg.VO.SgGxVO; |
| | | import cn.gistack.sm.sg.mapper.SgGxMapper; |
| | | import cn.gistack.sm.sg.mapper.SgGxStepMapper; |
| | | import cn.gistack.sm.sg.mapper.SgProgressReportMapper; |
| | | import cn.gistack.sm.sg.service.SgGxService; |
| | | import cn.gistack.sm.sg.service.SgGxStepService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工工序基本表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-13 15:46:18 |
| | | */ |
| | | @Service |
| | | public class SgGxServiceImpl extends ServiceImpl<SgGxMapper, SgGxDO> implements SgGxService { |
| | | @Autowired |
| | | private SgGxMapper sgGxMapper; |
| | | |
| | | @Autowired |
| | | private SgGxStepMapper sgGxStepMapper; |
| | | |
| | | @Autowired |
| | | private SgGxStepService sgGxStepService; |
| | | |
| | | @Autowired |
| | | private SgProgressReportMapper sgProgressReportMapper; |
| | | @Override |
| | | public IPage<SgGxVO> queryPageList(IPage<SgGxVO> page, ProjectSearchDTO searchDTO) { |
| | | List<SgGxVO> list = sgGxMapper.queryPageList(page,searchDTO); |
| | | if (CollectionUtils.isNotEmpty(list)){ |
| | | List<Long> ids = list.stream().map(SgGxDO::getId).collect(Collectors.toList()); |
| | | List<Long> userIds = list.stream().map(SgGxDO::getCreateUser).collect(Collectors.toList()); |
| | | List<Map<String,Object>> users = sgProgressReportMapper.getUserByIds(userIds); |
| | | List<SgGxStepDO> stepDOS = sgGxMapper.queryStepByIds(ids); |
| | | if (CollectionUtils.isNotEmpty(stepDOS)){ |
| | | Map<Long, List<SgGxStepDO>> map = stepDOS.stream().collect(Collectors.groupingBy(SgGxStepDO::getGxInfoId)); |
| | | for (SgGxVO sgGxDO : list) { |
| | | for (Map<String, Object> user : users) { |
| | | if (user.get("ID").equals(sgGxDO.getCreateUser())){ |
| | | sgGxDO.setCreateUserName(user.get("REAL_NAME").toString()); |
| | | } |
| | | } |
| | | List<SgGxStepDO> sgGxStepDOS = map.get(sgGxDO.getId()); |
| | | if (CollectionUtils.isNotEmpty(sgGxStepDOS)){ |
| | | sgGxDO.setStepDOList(sgGxStepDOS); |
| | | sgGxDO.setGxStepCount(sgGxStepDOS.size()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return page.setRecords(list); |
| | | } |
| | | |
| | | @Override |
| | | public void add(SgGxDO sgGxDO) { |
| | | sgGxDO.setCreateUpdateTime(); |
| | | if (sgGxMapper.selectByGxType(sgGxDO.getGxType())!= null){ |
| | | throw new ServiceException("工序类型已存在"); |
| | | } |
| | | this.save(sgGxDO); |
| | | } |
| | | |
| | | @Override |
| | | public void update(SgGxDO sgGxDO) { |
| | | sgGxDO.setCreateUpdateTime(); |
| | | SgGxDO one = sgGxMapper.selectByGxType(sgGxDO.getGxType()); |
| | | if (one != null && one.getId()!= sgGxDO.getId() ){ |
| | | throw new ServiceException("工序类型已存在"); |
| | | } |
| | | this.updateById(sgGxDO); |
| | | } |
| | | |
| | | @Override |
| | | public SgGxVO detail(Long id) { |
| | | SgGxVO byId = sgGxMapper.getById(id); |
| | | List<SgGxStepDO> stepDOS = sgGxMapper.queryStepByIds(List.of(id)); |
| | | byId.setStepDOList(stepDOS); |
| | | return byId; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void delete(Long id) { |
| | | SgGxDO byId = this.getById(id); |
| | | List<SgGxStepDO> list = new LambdaQueryChainWrapper<>(sgGxStepMapper).eq(SgGxStepDO::getGxInfoId, id).list(); |
| | | if (CollectionUtils.isNotEmpty(list)){ |
| | | throw new ServiceException("此工序存在工序步骤,不允许删除"); |
| | | } |
| | | this.delete(id); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.service.impl; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgGxRoleDO; |
| | | import cn.gistack.sm.sg.DO.SgGxStepDO; |
| | | import cn.gistack.sm.sg.DO.SgProgressReportDO; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import cn.gistack.sm.sg.VO.SgGxRoleVO; |
| | | import cn.gistack.sm.sg.mapper.SgGxRoleMapper; |
| | | import cn.gistack.sm.sg.mapper.SgGxStepMapper; |
| | | import cn.gistack.sm.sg.mapper.SgProgressReportMapper; |
| | | import cn.gistack.sm.sg.service.SgGxStepService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工工序步骤表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-13 15:46:18 |
| | | */ |
| | | @Service |
| | | public class SgGxStepServiceImpl extends ServiceImpl<SgGxStepMapper, SgGxStepDO> implements SgGxStepService { |
| | | @Autowired |
| | | private SgGxStepMapper sgGxStepMapper; |
| | | @Autowired |
| | | private SgGxRoleMapper sgGxRoleMapper; |
| | | |
| | | @Autowired |
| | | private SgProgressReportMapper sgProgressReportMapper; |
| | | |
| | | @Override |
| | | public void add(SgGxStepDO sgGxStepDO) { |
| | | List<SgGxStepDO> list= sgGxStepMapper.selectByGxInfoId(sgGxStepDO.getGxInfoId()); |
| | | if (CollectionUtils.isNotEmpty(list)){ |
| | | if (Integer.parseInt(sgGxStepDO.getGxStepNum()) - Integer.parseInt(list.get(0).getGxStepNum()) != 1){ |
| | | throw new ServiceException("请按顺序配置工序"); |
| | | } |
| | | } |
| | | this.save(sgGxStepDO); |
| | | } |
| | | |
| | | @Override |
| | | public void updateOne(SgGxStepDO sgGxStepDO) { |
| | | this.updateById(sgGxStepDO); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(String id) { |
| | | SgGxStepDO sgGxStepDO = sgGxStepMapper.selectById(id); |
| | | if (!new LambdaQueryChainWrapper<>(sgGxRoleMapper).eq(SgGxRoleDO::getGxStepId,id).list().isEmpty()){ |
| | | throw new ServiceException(sgGxStepDO.getGxStepName()+ "已绑定角色,无法删除"); |
| | | } |
| | | List<SgGxStepDO> list= sgGxStepMapper.selectByGxInfoId(sgGxStepDO.getGxInfoId()); |
| | | if (!sgGxStepDO.getGxStepNum().equals(list.get(0).getGxStepNum())){ |
| | | throw new ServiceException("请按顺序删除工序步骤"); |
| | | } |
| | | this.removeById(id); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<SgGxStepDO> queryPageList(IPage<SgGxStepDO> page, ProjectSearchDTO searchDTO) { |
| | | List<SgGxStepDO> list = sgGxStepMapper.queryPageList(page,searchDTO); |
| | | return page.setRecords(list); |
| | | } |
| | | |
| | | /** |
| | | * 新增工序角色配置逻辑 |
| | | * @param sgGxRoleVO |
| | | */ |
| | | @Override |
| | | public void insertSgGxRole(SgGxRoleVO sgGxRoleVO){ |
| | | |
| | | |
| | | if (sgGxRoleVO.getGxStepId()==null){ |
| | | throw new ServiceException("工序步骤参数错误"); |
| | | } |
| | | if (sgGxRoleVO.getGxDeviceType()==null){ |
| | | throw new ServiceException("工序类型参数错误"); |
| | | } |
| | | |
| | | List<SgGxRoleDO> sgGxRoleDOS = sgGxRoleMapper.selectSgGxRole(sgGxRoleVO.getGxDeviceType(), sgGxRoleVO.getGxStepId()); |
| | | if (sgGxRoleDOS==null||sgGxRoleDOS.size()>0){ |
| | | throw new ServiceException("已存在相同的工序角色配置"); |
| | | } |
| | | List<SgGxRoleDO> sgGxRoles=new ArrayList<>(); |
| | | |
| | | if (sgGxRoleVO.getRoleIds()==null||sgGxRoleVO.getRoleIds().size()==0){ |
| | | throw new ServiceException("工序角色参数错误"); |
| | | } |
| | | List<String> roleIds = sgGxRoleVO.getRoleIds(); |
| | | for (int i = 0; i <roleIds.size() ; i++) { |
| | | SgGxRoleDO sgGxRoleDO=new SgGxRoleDO(); |
| | | sgGxRoleDO.setGxDeviceType(sgGxRoleVO.getGxDeviceType()); |
| | | sgGxRoleDO.setGxStepId(sgGxRoleVO.getGxStepId()); |
| | | sgGxRoleDO.setRoleId(roleIds.get(i)); |
| | | sgGxRoleDO.setSgOrder(sgGxRoleVO.getOrders().get(i)); |
| | | sgGxRoles.add(sgGxRoleDO); |
| | | } |
| | | sgGxRoleMapper.insertBach(sgGxRoles); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 更新工序角色配置 |
| | | * @param sgGxRoleVO |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public void updateSgGxRole(SgGxRoleVO sgGxRoleVO){ |
| | | String gxStepId = sgGxRoleVO.getGxStepId(); |
| | | List<SgProgressReportDO> reportDOS = new LambdaQueryChainWrapper<>(sgProgressReportMapper).eq(SgProgressReportDO::getGxStepId, gxStepId).list(); |
| | | List<SgGxRoleDO> list = new LambdaQueryChainWrapper<>(sgGxRoleMapper).eq(SgGxRoleDO::getGxStepId, gxStepId).orderByAsc(SgGxRoleDO::getSgOrder).list(); |
| | | List<String> roles = list.stream().map(SgGxRoleDO::getRoleId).map(Object::toString).collect(Collectors.toList()); |
| | | List<Integer> orders = list.stream().map(SgGxRoleDO::getSgOrder).collect(Collectors.toList()); |
| | | if (!reportDOS.isEmpty()){ |
| | | if (! roles.equals(sgGxRoleVO.getRoleIds()) || ! orders.equals(sgGxRoleVO.getOrders())) { |
| | | throw new ServiceException("此配置已有上报记录,不允许修改"); |
| | | } |
| | | } |
| | | if (sgGxRoleVO.getGxStepId()==null){ |
| | | throw new ServiceException("工序步骤参数错误"); |
| | | } |
| | | if (sgGxRoleVO.getGxDeviceType()==null){ |
| | | throw new ServiceException("工序类型参数错误"); |
| | | } |
| | | |
| | | List<SgGxRoleDO> sgGxRoleDOS = sgGxRoleMapper.selectSgGxRole(sgGxRoleVO.getGxDeviceType(), sgGxRoleVO.getGxStepId()); |
| | | if (sgGxRoleDOS==null||sgGxRoleDOS.size()>0){ |
| | | //删除原来的 |
| | | sgGxRoleMapper.deleteSgGxRoleDOs(sgGxRoleVO.getGxDeviceType(),sgGxRoleVO.getGxStepId()); |
| | | } |
| | | List<SgGxRoleDO> sgGxRoles=new ArrayList<>(); |
| | | |
| | | if (sgGxRoleVO.getRoleIds()==null||sgGxRoleVO.getRoleIds().size()==0){ |
| | | throw new ServiceException("工序角色参数错误"); |
| | | } |
| | | List<String> roleIds = sgGxRoleVO.getRoleIds(); |
| | | for (int i = 0; i <roleIds.size() ; i++) { |
| | | SgGxRoleDO sgGxRoleDO=new SgGxRoleDO(); |
| | | sgGxRoleDO.setGxDeviceType(sgGxRoleVO.getGxDeviceType()); |
| | | sgGxRoleDO.setGxStepId(sgGxRoleVO.getGxStepId()); |
| | | sgGxRoleDO.setRoleId(roleIds.get(i)); |
| | | sgGxRoleDO.setSgOrder(sgGxRoleVO.getOrders().get(i)); |
| | | sgGxRoles.add(sgGxRoleDO); |
| | | } |
| | | sgGxRoleMapper.insertBach(sgGxRoles); |
| | | } |
| | | |
| | | /** |
| | | * 获取绑定的角色进行回显 |
| | | * |
| | | * @param gxDeviceType |
| | | * @param gxStepId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<String> getSgGxRoles(String gxDeviceType, String gxStepId) { |
| | | return sgGxRoleMapper.getSgGxRoles(gxDeviceType, gxStepId); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public List<SgGxStepDO> sgGxStepList() { |
| | | return sgGxStepMapper.getDEviceGXtwo(); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.service.impl; |
| | | |
| | | import cn.gistack.sm.sg.DO.*; |
| | | import cn.gistack.sm.sg.DTO.ApprovalDTO; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import cn.gistack.sm.sg.VO.SgProgressReportVO; |
| | | import cn.gistack.sm.sg.VO.SgProjectInfoVO; |
| | | import cn.gistack.sm.sg.VO.SgReportVO; |
| | | import cn.gistack.sm.sg.VO.SgStepReportVO; |
| | | import cn.gistack.sm.sg.mapper.*; |
| | | import cn.gistack.sm.sg.service.SgProgressReportService; |
| | | import cn.hutool.http.useragent.UserAgentUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.support.Kv; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import java.lang.Long; |
| | | import java.util.*; |
| | | import java.util.concurrent.ExecutorService; |
| | | import java.util.concurrent.Executors; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工进度上报表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-15 10:22:08 |
| | | */ |
| | | @Service |
| | | public class SgProgressReportServiceImpl extends ServiceImpl<SgProgressReportMapper, SgProgressReportDO> implements SgProgressReportService { |
| | | @Autowired |
| | | private SgProgressReportMapper sgProgressReportMapper; |
| | | |
| | | @Autowired |
| | | private SgProjectPersonConfigMapper sgProjectPersonConfigMapper; |
| | | |
| | | |
| | | @Autowired |
| | | private SgGxConfigMapper sgGxConfigMapper; |
| | | |
| | | @Autowired |
| | | private SgDeviceMapper sgDeviceMapper; |
| | | |
| | | @Autowired |
| | | private SgReportUserMapper sgReportUserMapper; |
| | | |
| | | @Autowired |
| | | private SgGxStepMapper sgGxStepMapper; |
| | | |
| | | @Autowired |
| | | private SgProjectInfoMapper sgProjectInfoMapper; |
| | | |
| | | ExecutorService cachedThreadPool = Executors.newCachedThreadPool(); |
| | | @Override |
| | | public IPage<SgProgressReportVO> queryPageList(IPage<SgProgressReportVO> page, ProjectSearchDTO searchDTO) { |
| | | List<SgProgressReportVO> list = sgProgressReportMapper.queryPageList(page,searchDTO); |
| | | return page.setRecords(list); |
| | | } |
| | | @Override |
| | | public IPage<SgProgressReportVO> queryPageListAll(IPage<SgProgressReportVO> page, ProjectSearchDTO searchDTO) { |
| | | List<SgProgressReportVO> list = sgProgressReportMapper.queryPageListAll(page,searchDTO); |
| | | return page.setRecords(list); |
| | | } |
| | | @Override |
| | | @Transactional |
| | | public void add(SgProgressReportDO sgProgressReportDO) { |
| | | Long userId = AuthUtil.getUserId(); |
| | | sgProgressReportDO.setReportUser(userId); |
| | | Date now = DateUtil.now(); |
| | | sgProgressReportDO.setReportTime(now); |
| | | sgProgressReportDO.setCreateTime(now); |
| | | //如果为草稿状态,单纯插入 |
| | | if(sgProgressReportDO.getStatus()==4){ |
| | | QueryWrapper<SgProgressReportDO> wrappers = new QueryWrapper<>(); |
| | | wrappers.eq("profram_id", sgProgressReportDO.getProframId()).eq("status", 4).eq("gx_step_id", sgProgressReportDO.getGxStepId()) |
| | | .eq("gx_device_id",sgProgressReportDO.getGxDeviceId()); |
| | | if(sgProgressReportMapper.selectOne(wrappers) == null){ |
| | | sgProgressReportMapper.insert(sgProgressReportDO); |
| | | return; |
| | | }else { |
| | | throw new ServiceException("已有草稿数据,无法保存"); |
| | | } |
| | | |
| | | } |
| | | QueryWrapper<SgProgressReportDO> wrappers = new QueryWrapper<>(); |
| | | wrappers.eq("profram_id", sgProgressReportDO.getProframId()).ne("status", 4).eq("gx_step_name", "施工准备"); |
| | | List<SgProgressReportDO> sgProgressReportDOS1 = sgProgressReportMapper.selectList(wrappers); |
| | | |
| | | if(sgProgressReportDO.getGxDeviceId()==998){ |
| | | ProjectSearchDTO search = new ProjectSearchDTO(); |
| | | search.setProjectId(sgProgressReportDO.getProframId().toString()); |
| | | List<SgProjectInfoVO> sgProjectInfoVOS = sgProjectInfoMapper.queryStepByProject(search); |
| | | if(sgProjectInfoVOS != null){ |
| | | sgProjectInfoVOS.forEach(s ->{ |
| | | if(!s.getProjectStatus().equals(2)){ |
| | | throw new ServiceException("请完成所有设备工序审批!"); |
| | | } |
| | | }); |
| | | }else{ |
| | | throw new ServiceException("无设备审批数据!"); |
| | | } |
| | | |
| | | } |
| | | |
| | | if (sgProgressReportDOS1!= null && sgProgressReportDOS1.size() > 0) { |
| | | for (SgProgressReportDO sgProgressReportDO1 : sgProgressReportDOS1) { |
| | | if (sgProgressReportDO1.getStatus()!= 2) { |
| | | throw new ServiceException("请先完成施工准备的审批!"); |
| | | } |
| | | } |
| | | } else if (sgProgressReportDOS1 == null || (!sgProgressReportDO.getGxStepName().equals("施工准备"))) { |
| | | throw new ServiceException("请先发起施工准备的审批!"); |
| | | } |
| | | Long gxDeviceId = sgProgressReportDO.getGxDeviceId(); |
| | | Long gxStepId = sgProgressReportDO.getGxStepId(); |
| | | SgGxStepDO sgGxStepDO = sgGxStepMapper.selectById(gxStepId); |
| | | List<SgGxStepDO> list = sgGxStepMapper.selectByGxInfoId(sgGxStepDO.getGxInfoId()); |
| | | QueryWrapper<SgProgressReportDO> wrapper = new QueryWrapper<>(); |
| | | if(sgProgressReportDO.getGxDeviceId()==998 || sgProgressReportDO.getGxDeviceId()==999){ |
| | | wrapper.eq("gx_step_id", gxStepId).eq("gx_device_id",gxDeviceId).ne("status",4).eq("profram_id",sgProgressReportDO.getProframId()); |
| | | }else { |
| | | wrapper.eq("gx_step_id", gxStepId).eq("gx_device_id",gxDeviceId).ne("status",4); |
| | | } |
| | | List<SgProgressReportDO> sgProgressReportDOS = sgProgressReportMapper.selectList(wrapper); |
| | | if ( sgProgressReportDOS!=null && sgProgressReportDOS.size()>0){ |
| | | throw new ServiceException("此工序已存在审批!"); |
| | | } |
| | | for (SgGxStepDO gxStepDO : list) { |
| | | if (Integer.parseInt(sgGxStepDO.getGxStepNum()) - Integer.parseInt(gxStepDO.getGxStepNum()) >= 1) { |
| | | QueryWrapper<SgProgressReportDO> wrapper1 = new QueryWrapper<>(); |
| | | wrapper1.eq("gx_step_id", gxStepDO.getId()); |
| | | wrapper1.eq("gx_device_id",gxDeviceId); |
| | | wrapper1.ne("status",4); |
| | | SgProgressReportDO one = sgProgressReportMapper.selectOne(wrapper1); |
| | | if (one == null || one.getStatus() != 2) { |
| | | throw new ServiceException("请先完成" + gxStepDO.getGxStepName() + "的审批!"); |
| | | } |
| | | } |
| | | } |
| | | sgProgressReportDO.setStatus(0); |
| | | sgProgressReportMapper.insert(sgProgressReportDO); |
| | | String deviceType =""; |
| | | SgDeviceDO sgDeviceDO = new SgDeviceDO(); |
| | | if (gxDeviceId == 999){ |
| | | deviceType = "sgzb"; |
| | | }else if(gxDeviceId == 998){ |
| | | deviceType = "sgys"; |
| | | }else { |
| | | sgDeviceDO = sgDeviceMapper.selectById(gxDeviceId); |
| | | deviceType = sgDeviceDO.getDeviceType(); |
| | | } |
| | | List<SgGxConfigDO> sgGxConfigDOS = new LambdaQueryChainWrapper<>(sgGxConfigMapper) |
| | | .eq(SgGxConfigDO::getGxDeviceType, deviceType).eq(SgGxConfigDO::getGxStepId, gxStepId).orderByAsc(SgGxConfigDO::getSgOrder).list(); |
| | | List<String> roIds = sgGxConfigDOS.stream().map(SgGxConfigDO::getRoleId).collect(Collectors.toList()); |
| | | if (CollectionUtils.isEmpty(roIds)){ |
| | | throw new ServiceException("请完成工序角色配置!"); |
| | | } |
| | | List<SgProjectPersonConfigDO> personConfigDOS = new LambdaQueryChainWrapper<>(sgProjectPersonConfigMapper).eq(SgProjectPersonConfigDO::getProgramId,sgProgressReportDO.getProframId()).in(SgProjectPersonConfigDO::getRoldId, roIds).list(); |
| | | if (CollectionUtils.isEmpty(personConfigDOS)){ |
| | | throw new ServiceException("请完成项目审批人员配置!"); |
| | | } |
| | | Map<Long, Long> userMap = personConfigDOS.stream().collect(Collectors.toMap(SgProjectPersonConfigDO::getRoldId, SgProjectPersonConfigDO::getUserId)); |
| | | sgReportUserMapper.insert(SgReportUserDO.builder().reportId(sgProgressReportDO.getId()).userId(sgProgressReportDO.getReportUser()).approvalContent("提交审批").approvalStatus(0).approvalOrder(0).approvalTime(now).build()); |
| | | for (SgGxConfigDO sgGxConfigDO : sgGxConfigDOS) { |
| | | sgGxConfigDO.setUser(userMap.get(Long.parseLong(sgGxConfigDO.getRoleId()))); |
| | | sgReportUserMapper.insert(SgReportUserDO.builder().reportId(sgProgressReportDO.getId()).userId(sgGxConfigDO.getUser()).approvalStatus(0).approvalOrder(sgGxConfigDO.getSgOrder()).build()); |
| | | try { |
| | | Thread.sleep(100); |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | if (sgGxConfigDO.getSgOrder() == 1) { |
| | | sgProgressReportDO.setAuditPerson(String.valueOf(sgGxConfigDO.getUser())); |
| | | sgProgressReportMapper.updateById(sgProgressReportDO); |
| | | } |
| | | } |
| | | |
| | | //加个项目及设备的状态判断 方便统计计算 |
| | | if(gxStepId != 25 && gxStepId != 26 ) { |
| | | if (sgDeviceDO != null && sgDeviceDO.getStatus() == 0) { |
| | | sgDeviceDO.setStatus(1); |
| | | sgDeviceMapper.updateById(sgDeviceDO); |
| | | } |
| | | } |
| | | SgProjectInfoDO sgProjectInfoDO = sgProjectInfoMapper.selectById(sgProgressReportDO.getProframId()); |
| | | if (sgProjectInfoDO != null && sgProjectInfoDO.getStatus() == 0) { |
| | | sgProjectInfoDO.setStatus(1); |
| | | sgProjectInfoMapper.updateById(sgProjectInfoDO); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public SgProgressReportVO detail(String id) { |
| | | SgProgressReportVO sgProgressReportVO = sgProgressReportMapper.queryById(id); |
| | | SgDeviceDO sgDeviceDO = sgDeviceMapper.selectById(sgProgressReportVO.getGxDeviceId()); |
| | | SgGxStepDO sgGxStepDO = sgGxStepMapper.selectById(sgProgressReportVO.getGxStepId()); |
| | | sgProgressReportVO.setStepRemark(sgGxStepDO.getRemark()); |
| | | if(sgProgressReportVO.getGxDeviceId() !=999 && sgProgressReportVO.getGxDeviceId() !=998){ |
| | | sgProgressReportVO.setDeviceName(sgDeviceDO.getDeviceName()); |
| | | }else { |
| | | sgProgressReportVO.setDeviceName("");} |
| | | List<SgReportUserDO> list = new LambdaQueryChainWrapper<>(sgReportUserMapper).eq(SgReportUserDO::getReportId,id).orderByAsc(SgReportUserDO::getId).list(); |
| | | List<Long> ids = list.stream().map(s -> s.getUserId()).collect(Collectors.toList()); |
| | | List<Map<String,Object>> users = sgProgressReportMapper.getUserByIds(ids); |
| | | for (Map<String, Object> user : users) { |
| | | for (SgReportUserDO sgReportUserDO : list) { |
| | | if (user.get("ID").equals(sgReportUserDO.getUserId())){ |
| | | sgReportUserDO.setUserName(user.get("REAL_NAME").toString()); |
| | | sgReportUserDO.setDeptName(user.get("DEPTNAME").toString()); |
| | | } |
| | | } |
| | | } |
| | | sgProgressReportVO.setSgReportUserDOS(list); |
| | | List<SgStepReportVO> sgStepReportVOS = sgProgressReportMapper.selectByDeviceId(sgProgressReportVO.getGxDeviceId()); |
| | | sgProgressReportVO.setSgStepReportVOS(sgStepReportVOS); |
| | | return sgProgressReportVO; |
| | | } |
| | | |
| | | /** |
| | | * 审批 |
| | | * @param approvalDTO |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void approval(ApprovalDTO approvalDTO) { |
| | | Integer isReject = approvalDTO.getIsReject(); |
| | | Long userId = approvalDTO.getUserId(); |
| | | Long id = approvalDTO.getId(); |
| | | SgProgressReportDO sgProgressReportDO = sgProgressReportMapper.selectById(id); |
| | | List<SgReportUserDO> sgReportUserDOS = new LambdaQueryChainWrapper<>(sgReportUserMapper).eq(SgReportUserDO::getReportId, id).ne(SgReportUserDO::getApprovalOrder,0).eq(SgReportUserDO::getIsHis,0) |
| | | .orderByAsc(SgReportUserDO::getApprovalOrder).list(); |
| | | //审批者 |
| | | SgReportUserDO sgReportUserDO = new SgReportUserDO(); |
| | | if (isReject==1 && sgProgressReportDO.getStatus().equals(2)){ |
| | | sgReportUserDO = sgReportUserDOS.get(0); |
| | | }else { |
| | | sgReportUserDO = sgReportUserDOS.stream().filter(s -> s.getUserId().equals(Long.parseLong(sgProgressReportDO.getAuditPerson()))).findFirst().get(); |
| | | } |
| | | Date date = new Date(); |
| | | LambdaUpdateChainWrapper<SgProgressReportDO> updateChainWrapper = new LambdaUpdateChainWrapper<>(sgProgressReportMapper).eq(SgProgressReportDO::getId, id); |
| | | LambdaUpdateChainWrapper<SgReportUserDO> userUpdate = new LambdaUpdateChainWrapper<>(sgReportUserMapper) |
| | | .eq(SgReportUserDO::getId, sgReportUserDO.getId()).set(SgReportUserDO::getApprovalContent,approvalDTO.getApprovalContent()).set(SgReportUserDO::getApprovalTime,date); |
| | | if (approvalDTO.getStatus()==1){ |
| | | Integer approvalOrder = sgReportUserDO.getApprovalOrder(); |
| | | userUpdate.set(SgReportUserDO::getApprovalStatus,1).update(); |
| | | Optional<SgReportUserDO> next = sgReportUserDOS.stream().filter(s -> s.getApprovalOrder() == approvalOrder + 1).findFirst(); |
| | | //如果存在下一个审批人,则继续审批 |
| | | if (next.isPresent()){ |
| | | SgReportUserDO nextUser = next.get(); |
| | | updateChainWrapper.set(SgProgressReportDO::getStatus,1).set(SgProgressReportDO::getAuditPerson,nextUser.getUserId()).update(); |
| | | }else { |
| | | updateChainWrapper.set(SgProgressReportDO::getStatus,2).set(SgProgressReportDO::getAuditPerson,null).update(); |
| | | //工序审核完成后 进行项目和设备状态的判断 |
| | | cachedThreadPool.execute(new Runnable(){ |
| | | @Override |
| | | public void run(){ |
| | | setProgramAndDeviceStatus(sgProgressReportMapper.selectById(approvalDTO.getId()).getProframId()); |
| | | } |
| | | }); |
| | | } |
| | | }else { |
| | | updateChainWrapper.set(SgProgressReportDO::getStatus,3); |
| | | userUpdate.set(SgReportUserDO::getApprovalStatus,2); |
| | | if (isReject==1){ |
| | | userUpdate.set(SgReportUserDO::getUserId,userId); |
| | | } |
| | | userUpdate.update(); |
| | | for (SgReportUserDO reportUserDO : sgReportUserDOS) { |
| | | if (reportUserDO.getApprovalOrder()<=sgReportUserDO.getApprovalOrder()&&reportUserDO.getApprovalOrder()!=0){ |
| | | //更新为历史数据 |
| | | new LambdaUpdateChainWrapper<>(sgReportUserMapper).eq(SgReportUserDO::getId,reportUserDO.getId()).set(SgReportUserDO::getIsHis,1).update(); |
| | | setReportUser(date, reportUserDO); |
| | | sgReportUserMapper.insert(reportUserDO); |
| | | try { |
| | | Thread.sleep(100); |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | }else if (reportUserDO.getApprovalOrder()>sgReportUserDO.getApprovalOrder()){ |
| | | sgReportUserMapper.deleteById(reportUserDO.getId()); |
| | | setReportUser(date, reportUserDO); |
| | | sgReportUserMapper.insert(reportUserDO); |
| | | try { |
| | | Thread.sleep(100); |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | if (reportUserDO.getApprovalOrder()==1){ |
| | | updateChainWrapper.set(SgProgressReportDO::getAuditPerson,reportUserDO.getUserId()); |
| | | } |
| | | } |
| | | updateChainWrapper.update(); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | private void setReportUser(Date date, SgReportUserDO reportUserDO) { |
| | | reportUserDO.setId(null); |
| | | reportUserDO.setApprovalStatus(0); |
| | | reportUserDO.setIsHis(0); |
| | | reportUserDO.setApprovalTime(date); |
| | | reportUserDO.setApprovalContent(null); |
| | | } |
| | | |
| | | |
| | | public void setProgramAndDeviceStatus(Long projectId){ |
| | | //查询所有的项目 |
| | | SgProjectInfoDO sgProjectInfoDO = sgProjectInfoMapper.selectById(projectId); |
| | | List<SgProjectInfoDO> sgProjectInfoDOS = List.of(sgProjectInfoDO); |
| | | if(sgProjectInfoDOS!=null&& !sgProjectInfoDOS.isEmpty()) { |
| | | for (SgProjectInfoDO project : sgProjectInfoDOS) { |
| | | QueryWrapper<SgDeviceDO> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("program_id", project.getId()); |
| | | //所有设备 |
| | | List<SgDeviceDO> sgDeviceDOS = sgDeviceMapper.selectList(queryWrapper); |
| | | //项目下完成的设备数 |
| | | int deviceFinishCount = 0; |
| | | if(!sgProjectInfoDOS.isEmpty()) { |
| | | for (SgDeviceDO sgDeviceDO : sgDeviceDOS) { |
| | | |
| | | //设备的工序 |
| | | List<SgDeviceGxStepDO> sgDeviceGxStepDOs = sgGxStepMapper.getDeviceGXList(sgDeviceDO.getId()); |
| | | |
| | | if (sgDeviceGxStepDOs != null) { |
| | | // int countStatus = 0; |
| | | // for (SgDeviceGxStepDO sgDeviceGxStepDO : sgDeviceGxStepDOs) { |
| | | // countStatus = +sgDeviceGxStepDO.getStatus(); |
| | | // |
| | | // } |
| | | // int size = sgDeviceGxStepDOs.size(); //4 |
| | | boolean allStatusesAreTwo = sgDeviceGxStepDOs.stream() |
| | | .allMatch(s -> s.getStatus() == 2); |
| | | if (allStatusesAreTwo) { |
| | | //如果设备下全部工序审核完成 |
| | | sgDeviceDO.setStatus(2); |
| | | sgDeviceMapper.updateById(sgDeviceDO); |
| | | deviceFinishCount++; |
| | | } |
| | | } |
| | | } |
| | | if (deviceFinishCount!=0 && deviceFinishCount == sgDeviceDOS.size()) { |
| | | //如果项目下的设备下全部完成 |
| | | project.setStatus(2); |
| | | sgProjectInfoMapper.updateById(project); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void updateReport(SgProgressReportDO sgProgressReportDO) { |
| | | sgProgressReportMapper.updateById(sgProgressReportDO); |
| | | } |
| | | |
| | | @Override |
| | | public List<SgProgressReportVO> queryList(ProjectSearchDTO searchDTO) { |
| | | Long userId = AuthUtil.getUserId(); |
| | | searchDTO.setUserId(userId); |
| | | List<SgProgressReportVO> list = sgProgressReportMapper.queryList(searchDTO); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Long> countList(ProjectSearchDTO searchDTO) { |
| | | Long userId = AuthUtil.getUserId(); |
| | | searchDTO.setUserId(userId); |
| | | searchDTO.setApprovalStatus(0); |
| | | List<SgProgressReportVO> pending = sgProgressReportMapper.queryList(searchDTO); |
| | | searchDTO.setApprovalStatus(1); |
| | | List<SgProgressReportVO> over= sgProgressReportMapper.queryList(searchDTO); |
| | | Map<String, Long> map = new HashMap<>(); |
| | | map.put("pending", Long.valueOf(pending.size())); |
| | | map.put("over",Long.valueOf(over.size())); |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Long> countListAll(ProjectSearchDTO searchDTO) { |
| | | List<SgProgressReportVO> list = sgProgressReportMapper.queryPageListAll(null, searchDTO); |
| | | Map<String, Long> map = new HashMap<>(); |
| | | getStatusCountByList(list, map); |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Long> statusCount(ProjectSearchDTO searchDTO) { |
| | | List<SgProgressReportVO> list = sgProgressReportMapper.statusCount(searchDTO); |
| | | Map<String, Long> map = new HashMap<>(); |
| | | getStatusCountByList(list, map); |
| | | return map; |
| | | } |
| | | |
| | | private void getStatusCountByList(List<SgProgressReportVO> list, Map<String, Long> map) { |
| | | List<SgProgressReportVO> pending = list.stream().filter(s -> s.getStatus() == 0).collect(Collectors.toList()); |
| | | List<SgProgressReportVO> progress = list.stream().filter(s -> s.getStatus() == 1).collect(Collectors.toList()); |
| | | List<SgProgressReportVO> over = list.stream().filter(s -> s.getStatus() == 2).collect(Collectors.toList()); |
| | | List<SgProgressReportVO> reject = list.stream().filter(s -> s.getStatus() == 3).collect(Collectors.toList()); |
| | | List<SgProgressReportVO> draft = list.stream().filter(s -> s.getStatus() == 4).collect(Collectors.toList()); |
| | | map.put("all", (long) list.size()); |
| | | map.put("pending", (long) pending.size()); |
| | | map.put("progress", (long) progress.size()); |
| | | map.put("over", (long) over.size()); |
| | | map.put("reject", (long) reject.size()); |
| | | map.put("draft", (long) draft.size()); |
| | | } |
| | | |
| | | @Override |
| | | public boolean checkStep(Long gxDeviceId, Long gxStepId) { |
| | | SgGxStepDO sgGxStepDO = sgGxStepMapper.selectById(gxStepId); |
| | | List<SgGxStepDO> list = sgGxStepMapper.selectByGxInfoId(sgGxStepDO.getGxInfoId()); |
| | | QueryWrapper<SgProgressReportDO> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("gx_step_id", gxStepId).eq("gx_device_id",gxDeviceId).ne("status",4); |
| | | List<SgProgressReportDO> sgProgressReportDOS = sgProgressReportMapper.selectList(wrapper); |
| | | if ( sgProgressReportDOS!=null && sgProgressReportDOS.size()>0){ |
| | | return false; |
| | | } |
| | | for (SgGxStepDO gxStepDO : list) { |
| | | if (Integer.parseInt(sgGxStepDO.getGxStepNum()) - Integer.parseInt(gxStepDO.getGxStepNum()) >= 1) { |
| | | QueryWrapper<SgProgressReportDO> wrapper1 = new QueryWrapper<>(); |
| | | wrapper1.eq("gx_step_id", gxStepDO.getId()); |
| | | wrapper1.eq("gx_device_id", gxDeviceId); |
| | | wrapper1.ne("status",4); |
| | | SgProgressReportDO one = sgProgressReportMapper.selectOne(wrapper1); |
| | | if (one == null || one.getStatus() != 2) { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<SgProgressReportVO> progressPage(IPage<SgProgressReportVO> page, ProjectSearchDTO searchDTO) { |
| | | Long userId = AuthUtil.getUserId(); |
| | | searchDTO.setUserId(userId); |
| | | List<SgProgressReportVO> list = sgProgressReportMapper.queryList(page, searchDTO); |
| | | return page.setRecords(list); |
| | | } |
| | | |
| | | @Override |
| | | public String getDeviceReport(Long gxDeviceId, Long gxStepId) { |
| | | QueryWrapper<SgProgressReportDO> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("gx_device_id",gxDeviceId).ne("status",4); |
| | | if (gxStepId!=null){ |
| | | wrapper.eq("gx_step_id",gxStepId); |
| | | } |
| | | List<SgProgressReportDO> sgProgressReportDOS = sgProgressReportMapper.selectList(wrapper); |
| | | if (CollectionUtils.isNotEmpty(sgProgressReportDOS)){ |
| | | sgProgressReportDOS.sort((u1, u2) -> u2.getCreateTime().compareTo(u1.getCreateTime())); |
| | | return sgProgressReportDOS.get(0).getId().toString(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public SgReportVO getDeviceReportcopy(Long deviceId, Long stepId) { |
| | | SgReportVO sgReportVO = new SgReportVO(); |
| | | QueryWrapper<SgProgressReportDO> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("gx_device_id", deviceId).ne("status", 4); |
| | | |
| | | if (stepId!= null) { |
| | | wrapper.eq("gx_step_id", stepId); |
| | | } |
| | | |
| | | List<SgProgressReportDO> sgProgressReportDOS = sgProgressReportMapper.selectList(wrapper); |
| | | |
| | | // 先检查列表是否为空,进行后续操作 |
| | | if (CollectionUtils.isNotEmpty(sgProgressReportDOS)) { |
| | | sgProgressReportDOS.sort((u1, u2) -> u2.getCreateTime().compareTo(u1.getCreateTime())); |
| | | SgProgressReportDO firstReport = sgProgressReportDOS.get(0); |
| | | sgReportVO.setGxDeviceId(deviceId); |
| | | sgReportVO.setGxStepId(firstReport.getGxStepId()); |
| | | sgReportVO.setId(firstReport.getId()); |
| | | sgReportVO.setProframId(firstReport.getProframId()); |
| | | } else { |
| | | QueryWrapper<SgProgressReportDO> wrappers = new QueryWrapper<>(); |
| | | wrappers.eq("gx_device_id", deviceId).ne("status", 4).orderByDesc("create_time"); |
| | | |
| | | sgProgressReportDOS = sgProgressReportMapper.selectList(wrappers); |
| | | QueryWrapper<SgGxStepDO> wrapperss = new QueryWrapper<>(); |
| | | |
| | | if (CollectionUtils.isNotEmpty(sgProgressReportDOS)) { |
| | | sgProgressReportDOS.sort((u1, u2) -> u2.getCreateTime().compareTo(u1.getCreateTime())); |
| | | SgProgressReportDO firstReport = sgProgressReportDOS.get(0); |
| | | SgGxStepDO sgGxStepDO = sgGxStepMapper.selectOne(wrapperss.eq("id", stepId)); |
| | | List<SgGxStepDO> sgGxStepDOS = sgGxStepMapper.selectList( |
| | | new QueryWrapper<SgGxStepDO>() |
| | | .lt("id", stepId) |
| | | .eq("gx_info_id", sgGxStepDO.getGxInfoId()) |
| | | .orderByDesc("gx_step_num")); |
| | | if (!sgGxStepDOS.isEmpty()) { |
| | | if (sgGxStepDOS.get(0).getGxStepName().equals(firstReport.getGxStepName())&&firstReport.getStatus().equals(2)) { |
| | | sgReportVO.setGxDeviceId(deviceId); |
| | | sgReportVO.setGxStepId(sgGxStepDO.getId()); |
| | | sgReportVO.setProframId(firstReport.getProframId()); |
| | | }else { |
| | | throw new ServiceException("请完成上一步工序!"); |
| | | } |
| | | } |
| | | |
| | | }else { |
| | | if (stepId!=null) { |
| | | SgGxStepDO sg = sgGxStepMapper.selectOne(wrapperss.eq("id", stepId)); |
| | | if (sg.getGxStepNum().equals("01")) { |
| | | sgReportVO.setGxDeviceId(deviceId); |
| | | sgReportVO.setGxStepId(sg.getId()); |
| | | sgReportVO.setProframId(sgProgressReportMapper.selectProframId(deviceId)); |
| | | }else { |
| | | throw new ServiceException("第一工序未进行审批!"); |
| | | } |
| | | |
| | | } |
| | | sgReportVO.setProframId(sgProgressReportMapper.selectProframId(deviceId)); |
| | | sgReportVO.setGxStepId(sgGxStepMapper.queryStepList(deviceId.toString()).get(0).getId()); |
| | | sgReportVO.setGxDeviceId(deviceId); |
| | | } |
| | | } |
| | | |
| | | |
| | | return sgReportVO; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| New file |
| | |
| | | package cn.gistack.sm.sg.service.impl; |
| | | |
| | | import cn.gistack.sm.sg.DO.*; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import cn.gistack.sm.sg.VO.*; |
| | | import cn.gistack.sm.sg.excel.ProjectExcel; |
| | | import cn.gistack.sm.sg.mapper.SgGxStepMapper; |
| | | import cn.gistack.sm.sg.mapper.SgProgressReportMapper; |
| | | import cn.gistack.sm.sg.mapper.SgProjectInfoMapper; |
| | | import cn.gistack.sm.sg.service.SgProjectInfoService; |
| | | import cn.gistack.sm.sjztmd.entity.AttAdBase; |
| | | import cn.gistack.sm.sjztmd.service.IAttAdBaseService; |
| | | import cn.hutool.core.lang.copier.Copier; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jetbrains.annotations.NotNull; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.StopWatch; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.MathContext; |
| | | import java.math.RoundingMode; |
| | | import java.util.*; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工项目表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-13 11:51:20 |
| | | */ |
| | | @Service |
| | | public class SgProjectInfoServiceImpl extends ServiceImpl<SgProjectInfoMapper, SgProjectInfoDO> implements SgProjectInfoService { |
| | | @Autowired |
| | | private SgProjectInfoMapper sgProjectInfoMapper; |
| | | @Autowired |
| | | private IAttAdBaseService iAttAdBaseService; |
| | | |
| | | @Autowired |
| | | private SgProgressReportMapper sgProgressReportMapper; |
| | | |
| | | @Autowired |
| | | private SgGxStepMapper sgGxStepMapper; |
| | | |
| | | @Override |
| | | public IPage<SgProjectInfoDO> queryPageList(IPage<SgProjectInfoDO> page, ProjectSearchDTO searchDTO) { |
| | | List<SgProjectInfoDO> sgProjectInfoDOS = baseMapper.queryPageList(page,searchDTO); |
| | | List<SgProjectInfoDO> projectProgress = getProjectProgress(sgProjectInfoMapper.queryStepByProject(searchDTO)); |
| | | if (CollectionUtils.isNotEmpty(projectProgress)){ |
| | | Map<Long, String> progressMap = projectProgress.stream().filter(s->s.getProjectProgress()!=null).collect(Collectors.toMap(SgProjectInfoDO::getId, SgProjectInfoDO::getProjectProgress)); |
| | | sgProjectInfoDOS.forEach(s->{ |
| | | s.setProjectProgress(progressMap.get(s.getId())); |
| | | }); |
| | | } |
| | | return page.setRecords(sgProjectInfoDOS); |
| | | } |
| | | |
| | | /** |
| | | * 获取项目及项目下设备及设备下工序进度 |
| | | * @param searchDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<SgProjectInfoDO> queryStepByProject(ProjectSearchDTO searchDTO) { |
| | | List<PreAcceVO> palist = new ArrayList<>(); |
| | | List<SgProjectInfoVO> list = sgProjectInfoMapper.queryStepByProject( searchDTO); |
| | | palist.add(handleQuery(25, list.get(0).getId())); |
| | | palist.add(handleQuery(26, list.get(0).getId())); |
| | | List<SgProjectInfoDO> projectProgress = getProjectProgress(list); |
| | | projectProgress.forEach(s->{ |
| | | s.setPreAcce(palist); |
| | | }); |
| | | |
| | | |
| | | return projectProgress; |
| | | } |
| | | |
| | | /** |
| | | * 获取项目进度 |
| | | * @param list |
| | | * @return |
| | | */ |
| | | @NotNull |
| | | private List<SgProjectInfoDO> getProjectProgress(List<SgProjectInfoVO> list) { |
| | | //项目分组 |
| | | Map<Long, List<SgProjectInfoVO>> projectMap = list.stream().collect(Collectors.groupingBy(SgProjectInfoVO::getId)); |
| | | List<SgProjectInfoDO> result = new ArrayList<>(); |
| | | for (Map.Entry<Long, List<SgProjectInfoVO>> entry : projectMap.entrySet()) { |
| | | List<SgDeviceDO> allDevice = new ArrayList<>(); |
| | | Long porId = entry.getKey(); |
| | | List<SgProjectInfoVO> value = entry.getValue(); |
| | | if (CollectionUtils.isEmpty(value)){ |
| | | continue; |
| | | } |
| | | SgProjectInfoVO sgProjectInfoVO = value.get(0); |
| | | SgProjectInfoDO sgProjectInfoDO = SgProjectInfoDO.builder().id(porId).lonLat(sgProjectInfoVO.getLonLat()).status(sgProjectInfoVO.getProjectStatus()).projectName(sgProjectInfoVO.getProjectName()).build(); |
| | | List<SgTypeVO> sgGxDOS = new ArrayList<>(); |
| | | //类型分组 |
| | | Map<String, List<SgProjectInfoVO>> GxMap = value.stream().filter(s->s.getDeviceType()!=null).collect(Collectors.groupingBy(SgProjectInfoVO::getDeviceType)); |
| | | for (Map.Entry<String, List<SgProjectInfoVO>> ty : GxMap.entrySet()) { |
| | | String type = ty.getKey(); |
| | | List<SgProjectInfoVO> gxList = ty.getValue(); |
| | | if (CollectionUtils.isEmpty(gxList)){ |
| | | continue; |
| | | } |
| | | SgTypeVO typeVO = SgTypeVO.builder().typeName(gxList.get(0).getTypeName()).build(); |
| | | List<SgDeviceDO> deviceDOS = new ArrayList<>(); |
| | | //设备分组 |
| | | Map<Long, List<SgProjectInfoVO>> dMap = gxList.stream().collect(Collectors.groupingBy(SgProjectInfoVO::getDId)); |
| | | for (Map.Entry<Long, List<SgProjectInfoVO>> device : dMap.entrySet()) { |
| | | Long dId = device.getKey(); |
| | | List<SgProjectInfoVO> deList = device.getValue(); |
| | | SgDeviceDO sgDeviceDO = new SgDeviceDO(); |
| | | sgDeviceDO.setId(dId); |
| | | sgDeviceDO.setDeviceName(deList.get(0).getDeviceName()); |
| | | List<SgGxStepDO> stepDOS = deList.stream().filter(s->s.getReportStatus()==null || s.getReportStatus()!=4).map(s -> SgGxStepDO.builder().id(s.getStepId()).gxStepNum(s.getGxStepNum()).gxStepName(s.getGxStepName()).deviceId(s.getDId()).approvalStatus(s.getReportStatus()).build()).collect(Collectors.toList()); |
| | | List<SgGxStepDO> stepOver = stepDOS.stream().filter(s -> s.getApprovalStatus() != null && s.getApprovalStatus() == 2).collect(Collectors.toList()); |
| | | BigDecimal stepSize = BigDecimal.valueOf(stepDOS.size()); |
| | | BigDecimal stepOverSize = BigDecimal.ZERO; |
| | | if (!stepOver.isEmpty()){ |
| | | stepOverSize = BigDecimal.valueOf(stepOver.size()); |
| | | } |
| | | BigDecimal divide = stepOverSize.divide(stepSize, 2, RoundingMode.HALF_UP); |
| | | sgDeviceDO.setStatus(divide.compareTo(new BigDecimal(1)) == 0?2:deList.get(0).getDeviceStatus()); |
| | | sgDeviceDO.setProgress(divide.toString()); |
| | | sgDeviceDO.setDeviceProgress(getBigDecimalPercent(divide)); |
| | | sgDeviceDO.setStepDOList(stepDOS); |
| | | deviceDOS.add(sgDeviceDO); |
| | | allDevice.add(sgDeviceDO); |
| | | } |
| | | BigDecimal deviceSize = BigDecimal.valueOf(deviceDOS.size()); |
| | | double sum = deviceDOS.stream().mapToDouble(s -> Double.parseDouble(s.getProgress())).sum(); |
| | | BigDecimal deviceOver = BigDecimal.valueOf(sum); |
| | | BigDecimal divideDevice = deviceOver.divide(deviceSize, 2, RoundingMode.HALF_UP); |
| | | typeVO.setDeviceDOS(deviceDOS); |
| | | typeVO.setTypeProgress(getBigDecimalPercent(divideDevice)); |
| | | sgGxDOS.add(typeVO); |
| | | } |
| | | BigDecimal allDeviceSize = BigDecimal.valueOf(allDevice.size()); |
| | | if (!allDeviceSize.equals(BigDecimal.ZERO)){ |
| | | double sum = allDevice.stream().mapToDouble(s -> Double.parseDouble(s.getProgress())).sum(); |
| | | BigDecimal allDeviceOver = BigDecimal.valueOf(sum); |
| | | BigDecimal allDivideDevice = allDeviceOver.divide(allDeviceSize, 2, RoundingMode.HALF_UP); |
| | | sgProjectInfoDO.setSgGxDOS(sgGxDOS); |
| | | sgProjectInfoDO.setProjectProgress( getBigDecimalPercent(allDivideDevice)); |
| | | sgProjectInfoDO.setProjectProgressNum(allDivideDevice); |
| | | } |
| | | result.add(sgProjectInfoDO); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public List<SgProjectInfoVO> progressList(ProjectSearchDTO searchDTO) { |
| | | List<SgProjectInfoVO> list = new ArrayList<>(); |
| | | List<SgProjectInfoDO> projectProgress = new ArrayList<>(); |
| | | if(!searchDTO.getAdCode().isEmpty()){ |
| | | projectProgress = getProjectProgress(sgProjectInfoMapper.queryStepByProject1(searchDTO)); |
| | | }else { |
| | | projectProgress = getProjectProgress(sgProjectInfoMapper.queryStepByProject(searchDTO)); |
| | | } |
| | | |
| | | if (CollectionUtils.isNotEmpty(projectProgress)){ |
| | | projectProgress.forEach(s->{ |
| | | SgProjectInfoVO sgProjectInfoVO = new SgProjectInfoVO(); |
| | | sgProjectInfoVO.setId(s.getId()); |
| | | sgProjectInfoVO.setProjectName(s.getProjectName()); |
| | | sgProjectInfoVO.setProjectProgress(s.getProjectProgress()); |
| | | sgProjectInfoVO.setLonLat(s.getLonLat()); |
| | | sgProjectInfoVO.setProjectProgressNum(s.getProjectProgressNum()); |
| | | sgProjectInfoVO.setStatus(s.getStatus()); |
| | | list.add(sgProjectInfoVO); |
| | | });} |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 项目进度列表(分页) |
| | | * @param page |
| | | * @param searchDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<SgProjectInfoVO> progressPage(IPage<SgProjectInfoVO> page, ProjectSearchDTO searchDTO) { |
| | | List<SgProjectInfoVO> list = new ArrayList<>(); |
| | | if(!searchDTO.getAdCode().isEmpty()){ |
| | | list = sgProjectInfoMapper.progressList1(page, searchDTO); |
| | | }else { |
| | | list = sgProjectInfoMapper.progressList(page, searchDTO); |
| | | } |
| | | |
| | | List<Long> ids = list.stream().map(SgProjectInfoVO::getId).collect(Collectors.toList()); |
| | | searchDTO.setProjectIds(ids); |
| | | List<SgProjectInfoDO> projectProgress = new ArrayList<>(); |
| | | if(!searchDTO.getAdCode().isEmpty()){ |
| | | projectProgress = getProjectProgress(sgProjectInfoMapper.queryStepByProject1(searchDTO)); |
| | | }else { |
| | | projectProgress = getProjectProgress(sgProjectInfoMapper.queryStepByProject(searchDTO)); |
| | | } |
| | | |
| | | if (CollectionUtils.isNotEmpty(projectProgress)){ |
| | | Map<Long, String> progressMap = projectProgress.stream().filter(s->s!=null && s.getProjectProgress() !=null).collect(Collectors.toMap(SgProjectInfoDO::getId, SgProjectInfoDO::getProjectProgress)); |
| | | list.forEach(s->{ |
| | | s.setProjectProgress(progressMap.get(s.getId())); |
| | | });} |
| | | return page.setRecords(list); |
| | | } |
| | | |
| | | @Override |
| | | public List<SgProjectInfoDO> listAll(ProjectSearchDTO searchDTO) { |
| | | return sgProjectInfoMapper.queryPageList(null,searchDTO); |
| | | } |
| | | |
| | | /** |
| | | * 项目统计饼状图 |
| | | * @param code |
| | | * @return |
| | | */ |
| | | @Override |
| | | public SgStatisticsVO getsgStatistics(String code) { |
| | | AttAdBase ywxtAdDetail = iAttAdBaseService.getYwxtAdDetail(code); |
| | | |
| | | if (ywxtAdDetail == null){ |
| | | return sgProjectInfoMapper.getSgstatiss("0",code); |
| | | } |
| | | return sgProjectInfoMapper.getSgstatiss(ywxtAdDetail.getAdGrad(),code); |
| | | } |
| | | |
| | | /** |
| | | * 项目统计表格 |
| | | * @param code |
| | | * @return |
| | | */ |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public List<SgStatisProVO> getsgStatisticsList(String code) { |
| | | AttAdBase ywxtAdDetail = iAttAdBaseService.getYwxtAdDetail(code); |
| | | List<SgStatisProVO> sgStatisProVOS; |
| | | |
| | | |
| | | //片区 |
| | | if (ywxtAdDetail == null) { |
| | | sgStatisProVOS = sgProjectInfoMapper.getsgStatisticsZero(code); |
| | | String getname = sgProjectInfoMapper.getname(code); |
| | | updateProjectProgress(sgStatisProVOS, code, getname, "2"); |
| | | } else if (ywxtAdDetail.getAdGrad().equals("1")) {//默认 |
| | | sgStatisProVOS = sgProjectInfoMapper.getsgStatisticsOne(code); |
| | | updateProjectProgress(sgStatisProVOS, ywxtAdDetail.getPAdCode(), ywxtAdDetail.getPAdName(), "0"); |
| | | } else {//区县 |
| | | sgStatisProVOS = sgProjectInfoMapper.getsgStatisticsList(code); |
| | | updateProjectProgress(sgStatisProVOS, ywxtAdDetail.getAdCode(), ywxtAdDetail.getAdName(), "3"); |
| | | } |
| | | return sgStatisProVOS; |
| | | } |
| | | |
| | | private void updateProjectProgress(List<SgStatisProVO> sgStatisProVOS, String pcode, String pname, String adGrad) { |
| | | ProjectSearchDTO projectSearchDTO = new ProjectSearchDTO(); |
| | | for (SgStatisProVO s : sgStatisProVOS) { |
| | | if (s.getCommenceNum() == 0) { |
| | | s.setProjectProgress("0%"); |
| | | s.setPcode(pcode); |
| | | s.setPname(pname); |
| | | s.setAdGrad(adGrad); |
| | | } else { |
| | | List<String> ids = sgProjectInfoMapper.getProjectId(adGrad, s.getCode()); |
| | | List<BigDecimal> bigDecimals = new ArrayList<>(); |
| | | |
| | | for (String id : ids) { |
| | | projectSearchDTO.setProjectId(id); |
| | | List<SgProjectInfoVO> list = sgProjectInfoMapper.queryStepByProject(projectSearchDTO); |
| | | getProjectProgress(list).forEach(ss -> bigDecimals.add(ss.getProjectProgressNum())); |
| | | } |
| | | |
| | | BigDecimal reduce = bigDecimals.stream().reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | String bigDecimalPercent1 = getBigDecimalPercent(reduce.divide(BigDecimal.valueOf(s.getProjectSum()), 2, RoundingMode.HALF_UP)); |
| | | s.setProjectProgress(s.getCommenceNum() == 0? "0%" : bigDecimalPercent1); |
| | | s.setPcode(pcode); |
| | | s.setPname(pname); |
| | | s.setAdGrad(adGrad); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public List<SgStatistccVO> getsgStatisticscc(String code) { |
| | | AttAdBase ywxtAdDetail = iAttAdBaseService.getYwxtAdDetail(code); |
| | | |
| | | |
| | | List<String> ids = sgProjectInfoMapper.getProjectId(ywxtAdDetail == null ? "0" : ywxtAdDetail.getAdGrad(), code); |
| | | Map<String, Integer> mun = new HashMap<>(); |
| | | List<SgStatistccVO> sgdevices = sgProjectInfoMapper.getSgdevices(code, ywxtAdDetail == null ? "0" : ywxtAdDetail.getAdGrad()); |
| | | sgdevices.forEach(sgStatistccVO -> { |
| | | mun.put(sgStatistccVO.getTypeName(), sgStatistccVO.getDeviceNum()); |
| | | } |
| | | ); |
| | | Map<String, BigDecimal> bigDecimals = new HashMap<>(); |
| | | ProjectSearchDTO projectSearchDTO = new ProjectSearchDTO(); |
| | | ids.forEach(id -> { |
| | | |
| | | projectSearchDTO.setProjectId(id); |
| | | List<SgProjectInfoVO> list = sgProjectInfoMapper.queryStepByProject(projectSearchDTO); |
| | | List<SgProjectInfoDO> projectProgress = getProjectProgress(list); |
| | | projectProgress.forEach(p -> { |
| | | |
| | | List<SgTypeVO> sgGxDOS = p.getSgGxDOS(); |
| | | sgGxDOS.forEach(sgTypeVO -> { |
| | | String typeProgress = sgTypeVO.getTypeProgress().replace("%", ""); |
| | | BigDecimal percentageBigDecimal = new BigDecimal(typeProgress).divide(new BigDecimal("100"), 2, RoundingMode.HALF_UP); |
| | | bigDecimals.merge(sgTypeVO.getTypeName(), percentageBigDecimal, BigDecimal::add); |
| | | }); |
| | | |
| | | }); |
| | | |
| | | }); |
| | | |
| | | for (String name : bigDecimals.keySet()) { |
| | | |
| | | if (mun.containsKey(name)) { |
| | | |
| | | BigDecimal bigDecimal = bigDecimals.get(name); |
| | | Integer intValue = mun.get(name); |
| | | BigDecimal result = bigDecimal.divide(new BigDecimal(intValue), 2, RoundingMode.HALF_UP); |
| | | |
| | | sgdevices.forEach(sgStatistccVO -> { |
| | | if (sgStatistccVO.getTypeName().equals(name)) { |
| | | sgStatistccVO.setTypeProgress(getBigDecimalPercent(result)); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | return sgdevices; |
| | | } |
| | | |
| | | /** |
| | | * 获取百分比 |
| | | * @param bigDecimal |
| | | * @return |
| | | */ |
| | | private String getBigDecimalPercent(BigDecimal bigDecimal) { |
| | | BigDecimal percentage = bigDecimal.multiply(new BigDecimal("100")); |
| | | // 如果不需要保留小数位,可以设置一个scale为0 |
| | | BigDecimal percentageRounded = percentage.setScale(0, RoundingMode.HALF_UP); |
| | | return percentageRounded+"%"; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> projectCount(ProjectSearchDTO searchDTO) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | List<SgProjectInfoVO> progressList = progressList(searchDTO); |
| | | BigDecimal reduce = progressList.stream().filter(s->s.getProjectProgressNum()!=null).map(SgProjectInfoDO::getProjectProgressNum).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal divide = reduce.divide(BigDecimal.valueOf(progressList.size()), 2, RoundingMode.HALF_UP); |
| | | List<SgProjectInfoDO> pending = progressList.stream().filter(s -> s.getStatus() == 0).collect(Collectors.toList()); |
| | | List<SgProjectInfoDO> progress = progressList.stream().filter(s -> s.getStatus() == 1).collect(Collectors.toList()); |
| | | List<SgProjectInfoDO> over = progressList.stream().filter(s -> s.getStatus() == 2).collect(Collectors.toList()); |
| | | map.put("all", progressList.size()); |
| | | map.put("pending", pending.size()); |
| | | map.put("progress", progress.size()); |
| | | map.put("over", over.size()); |
| | | map.put("projectProgress", getBigDecimalPercent(divide)); |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public void importProject(List<ProjectExcel> data, Boolean isCovered) { |
| | | |
| | | } |
| | | |
| | | // 处理查询和添加到列表的方法 |
| | | private PreAcceVO handleQuery( int stepIdForNull, Long programId) { |
| | | QueryWrapper<SgProgressReportDO> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("gx_step_id", stepIdForNull) |
| | | .eq("profram_id", programId); |
| | | SgProgressReportDO sgProgressReportDO = sgProgressReportMapper.selectOne(queryWrapper); |
| | | |
| | | PreAcceVO preAcceVO = new PreAcceVO(); |
| | | if (sgProgressReportDO!= null) { |
| | | preAcceVO.setId(sgProgressReportDO.getId().toString()); |
| | | preAcceVO.setName(sgProgressReportDO.getGxStepName()); |
| | | preAcceVO.setStatus((long) sgProgressReportDO.getStatus()); |
| | | preAcceVO.setProgramId(programId); |
| | | preAcceVO.setGxDeviceId(sgProgressReportDO.getGxDeviceId()); |
| | | preAcceVO.setGxStepId(sgProgressReportDO.getGxStepId()); |
| | | } else { |
| | | SgGxStepDO sgGxStepDO = sgGxStepMapper.selectById(stepIdForNull); |
| | | preAcceVO.setName(sgGxStepDO.getGxStepName()); |
| | | preAcceVO.setProgramId(programId); |
| | | preAcceVO.setGxDeviceId(stepIdForNull != 25? (long)998:(long)999); |
| | | preAcceVO.setGxStepId(sgGxStepDO.getId()); |
| | | |
| | | } |
| | | return preAcceVO; |
| | | |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sg.service.impl; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgProgressReportDO; |
| | | import cn.gistack.sm.sg.DO.SgProjectPersonConfigDO; |
| | | import cn.gistack.sm.sg.DO.SgProjectRolePersonV0; |
| | | import cn.gistack.sm.sg.DTO.AddSgProjectPersonConfigDTO; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import cn.gistack.sm.sg.mapper.SgProgressReportMapper; |
| | | import cn.gistack.sm.sg.mapper.SgProjectPersonConfigMapper; |
| | | import cn.gistack.sm.sg.service.SgProjectPersonConfigService; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工项目人员配置表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-15 11:45:35 |
| | | */ |
| | | @Service |
| | | public class SgProjectPersonConfigServiceImpl extends ServiceImpl<SgProjectPersonConfigMapper, SgProjectPersonConfigDO> implements SgProjectPersonConfigService { |
| | | @Autowired |
| | | private SgProjectPersonConfigMapper projectPersonConfigMapper; |
| | | @Autowired |
| | | private SgProgressReportMapper sgProgressReportMapper; |
| | | @Override |
| | | public List<String> getRoleList(ProjectSearchDTO searchDTO) { |
| | | List<String> list = projectPersonConfigMapper.getRoleList(searchDTO); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public void add(AddSgProjectPersonConfigDTO dto) { |
| | | for (SgProjectPersonConfigDO sgProjectPersonConfigDO : dto.getData()) { |
| | | Long id = sgProjectPersonConfigDO.getId(); |
| | | Long userId = sgProjectPersonConfigDO.getUserId(); |
| | | if (Objects.isNull(id)){ |
| | | projectPersonConfigMapper.insert(sgProjectPersonConfigDO); |
| | | }else { |
| | | SgProjectPersonConfigDO old = projectPersonConfigMapper.selectById(id); |
| | | boolean isReport = !new LambdaQueryChainWrapper<>(sgProgressReportMapper).eq(SgProgressReportDO::getProframId, old.getProgramId()).list().isEmpty(); |
| | | if (Objects.isNull(userId)){ |
| | | if (isReport){ |
| | | throw new ServiceException("此项目配置存在审批,不允许修改"); |
| | | } |
| | | projectPersonConfigMapper.deleteById(id); |
| | | }else if (!old.getUserId().equals(sgProjectPersonConfigDO.getUserId())){ |
| | | if (isReport){ |
| | | throw new ServiceException("此项目配置存在审批,不允许修改"); |
| | | } |
| | | projectPersonConfigMapper.updateById(sgProjectPersonConfigDO); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<SgProjectRolePersonV0> getList(ProjectSearchDTO searchDTO) { |
| | | List<SgProjectRolePersonV0> list = projectPersonConfigMapper.getList(searchDTO); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getUserByRole(String roleId) { |
| | | return projectPersonConfigMapper.getUserByRole(roleId); |
| | | } |
| | | } |
| | |
| | | |
| | | UPDATE SJZT_DW."dws_water_res_z_eight_detail_all" SET |
| | | <if test="entity.rz != null and entity.rz !='' "> |
| | | "rz" = #{entity.rz}, |
| | | "rz" = #{entity.rz} |
| | | </if> |
| | | <if test="entity.lowZ != null and entity.lowZ !='' "> |
| | | "low_z" = #{entity.lowZ} |
| | | ,"low_z" = #{entity.lowZ} |
| | | </if> |
| | | WHERE 1=1 |
| | | <if test="entity.isTb != null and entity.isTb != ''"> |
| | |
| | | private IDsmSpgSpprmpService dsmSpgSpprmpService; |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void importDbPersonData(List<DbExcel> data, String resGuid,String ch) { |
| | | |
| | | //获取行政区划 |
| | |
| | | List<DsmSpgSpqnmp> dsmSpgSpqnmpList = dsmSpgSpqnmpService.getList(paramSl); |
| | | |
| | | data.forEach(dbExcel->{ |
| | | |
| | | dbExcel.setAvgValue(dbExcel.getAvgValue().replace(",",",")); |
| | | if (StringUtil.isBlank(dbExcel.getRz())){ |
| | | dbExcel.setRz(""); |
| | | } |
| | |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | throw new RuntimeException("表格渗压数据个数超过当前水库断面测点个数"); |
| | | } |
| | | |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.constant; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.IntStream; |
| | | |
| | | public class RainfallConstant { |
| | | |
| | | // 气象未来3天预报服务接口 |
| | | public static final String FORECAST_SERVICE_URL = |
| | | "https://sk.hubeishuiyi.cn/sltqxyb/forecast/extraForecast/getSltRainGridForecastData/"; |
| | | |
| | | public static final String REQUEST_JSON_BODY = "{\"dayIndex\":\"%s\"}"; |
| | | |
| | | public static final String X_TOKEN = "2a1ded7e-85f2-4e42-a97a-5651d745f8e1"; |
| | | |
| | | public static final int[] EMPTY_ATT_RES_NUM_ARRAY = IntStream.generate(() -> 0).limit(8).toArray(); |
| | | |
| | | public static final List<String> RAIN_FALL_RANGES = Arrays.asList("(250,+)", "(100,250]", "(50,100]", "(25,50]" |
| | | , "(10,25]", "(5,10]", "(0.1,5]", "[0,0.1]"); |
| | | |
| | | public static final String CONTAINS_CHINESE = "1" ; |
| | | |
| | | public static final String NOT_CONTAINS_CHINESE = "9" ; |
| | | } |
| | |
| | | }) |
| | | @ApiOperation(value = "加载树列表", notes = "传入code") |
| | | public R<List<AttAdBaseVO>> select(String parentCode, @ApiIgnore @RequestParam Map<String, Object> obj) { |
| | | String code = obj.get("code").toString(); |
| | | if (code.substring(0,4).indexOf("00") > -1) { |
| | | obj.put("code",code.substring(0,2)); |
| | | } else if (code.substring(0,6).indexOf("00") > -1) { |
| | | obj.put("code",code.substring(0,4)); |
| | | }else if (code.substring(0,8).indexOf("00") > -1){ |
| | | obj.put("code",code.substring(0,8)); |
| | | } |
| | | // String code = obj.get("code").toString(); |
| | | // if (code.substring(0,4).indexOf("00") > -1) { |
| | | // obj.put("code",code.substring(0,2)); |
| | | // } else if (code.substring(0,6).indexOf("00") > -1) { |
| | | // obj.put("code",code.substring(0,4)); |
| | | // }else if (code.substring(0,8).indexOf("00") > -1){ |
| | | // obj.put("code",code.substring(0,8)); |
| | | // } |
| | | List<AttAdBaseVO> list = attAdBaseService.lazyTree(parentCode, obj); |
| | | return R.data(listNodeLazyVO(list)); |
| | | } |
| | |
| | | import cn.gistack.sm.sjztmd.service.IAttResBaseService; |
| | | import cn.gistack.sm.sjztmd.vo.AttAdBaseVO; |
| | | import cn.gistack.sm.sjztmd.vo.AttResBaseVO; |
| | | import cn.gistack.sm.sjztmd.vo.AttResWithRainfall; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | 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.secure.utils.AuthUtil; |
| | | 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 io.swagger.annotations.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | |
| | | public void exportAttResBaseUser(@RequestParam Map<String, Object> params, HttpServletResponse response) { |
| | | |
| | | List<AttResBaseUserExcel> list = attResBaseService.exportAttResBaseUser(params); |
| | | |
| | | /** |
| | | * 如果不是超级管理员数据需要处理 处理逻辑如下 |
| | | * (1)大中型水库的行政责任人电话都不显示。 |
| | | * (2)省直管且是大中型的6座水库(漳河、高关、富水、王英、吴岭、蔡贤水库)的主管部门负责人手机号不显示。 |
| | | * (3)三峡、葛洲坝、隔河岩、高坝州、丹江口(以后可以手动加)除了巡查责任人外的责任人的手机号码不显示。 |
| | | */ |
| | | if (!AuthUtil.isAdministrator()) { |
| | | for (AttResBaseUserExcel excel:list) { |
| | | if (excel.getEngScal().equals("大(1)型") || excel.getEngScal().equals("大(2)型") || excel.getEngScal().equals("中型")) { |
| | | excel.setAreaPhone(""); |
| | | } |
| | | if (excel.getName().equals("漳河水库") || excel.getName().equals("高关水库") || excel.getName().equals("富水漳河水库") |
| | | || excel.getName().equals("王英水库") || excel.getName().equals("吴岭水库") || excel.getName().equals("蔡贤水库")) { |
| | | excel.setCustomsPhone(""); |
| | | } |
| | | if (excel.getName().equals("三峡") || excel.getName().equals("葛洲坝") || excel.getName().equals("隔河岩") |
| | | || excel.getName().equals("高坝州") || excel.getName().equals("丹江口")) { |
| | | excel.setAreaPhone("");//行政 |
| | | excel.setCustomsPhone("");//主管 |
| | | excel.setManageUnitPhone("");//管理单位 |
| | | excel.setTechnologyPhone("");//技术 |
| | | } |
| | | } |
| | | } |
| | | |
| | | ExcelUtil.export(response, "水库责任人数据数据" + DateUtil.time(), "水库责任人数据表", list, AttResBaseUserExcel.class); |
| | | } |
| | | |
| | |
| | | return R.status(attResBaseService.updateIsShowStatus(ids,status)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据预报降雨等值面图,识别出雨量范围内的水库清单 |
| | | * @param minRainfall 最小降雨量 |
| | | * @param maxRainfall 最大降雨量 |
| | | * @param dayIndex 预报的时段,0-2代表未来3天 |
| | | * @return 水库对象列表 |
| | | */ |
| | | @ApiOperation(value = "根据预报降雨等值面图,识别出雨量范围内的水库清单", notes = "根据预报降雨等值面图,识别出雨量范围内的水库清单") |
| | | @PostMapping(value = "/getAttResByRainfall") |
| | | public R<List<AttResWithRainfall>> getAttResByRainfall( |
| | | @ApiParam(value = "最小降雨量") @RequestParam String minRainfall, |
| | | @ApiParam(value = "最大降雨量") @RequestParam String maxRainfall, |
| | | @ApiParam(value = "预报的时段,0-2代表未来3天") @RequestParam String dayIndex) { |
| | | return R.data(attResBaseService.getAttResByRainfall(minRainfall, maxRainfall, dayIndex)); |
| | | } |
| | | |
| | | /** |
| | | * 统计不同日降水量范围下的站点个数 |
| | | * @param dayIndex 预报的时段,0-2代表未来3天 |
| | | * @return 站点个数列表 |
| | | */ |
| | | @ApiOperation(value = "统计不同日降水量范围的站点个数", notes = "统计不同日降水量范围的站点个数") |
| | | @PostMapping(value = "/getAttResNumByRainfall") |
| | | public R<int[]> getAttResNumByRainfall(@ApiParam(value = "预报的时段,0-2代表未来3天") @RequestParam String dayIndex) { |
| | | return R.data(attResBaseService.getAttResNumByRainfall(dayIndex)); |
| | | } |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | @GetMapping("/getCityCountyPersonListByResGuid") |
| | | public R getCityCountyPersonListByResGuid(String resCd){ |
| | | return R.data(attResManagePersonService.getCityCountyPersonListByResGuid(resCd)); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.controller; |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.StBdData; |
| | | import cn.gistack.sm.sjztmd.service.IStBdDataService; |
| | | import cn.gistack.sm.sjztmd.vo.StBdDataVO; |
| | | import cn.gistack.sm.sjztmd.vo.StBdVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @Slf4j |
| | | @Api(tags = "北斗平台监测数据") |
| | | @RestController |
| | | @RequestMapping("/sjztmd/stBdData") |
| | | @AllArgsConstructor |
| | | public class StBdDataController extends BladeController { |
| | | |
| | | private final IStBdDataService stBdDataService; |
| | | |
| | | /** |
| | | * 分页查询北斗平台监测数据 |
| | | * @param stBdData 北斗平台监测数据 |
| | | * @param query 查询条件 |
| | | * @return 北斗平台监测数据 |
| | | */ |
| | | @ApiOperation(value="分页查询北斗平台监测数据", notes="分页查询北斗平台监测数据") |
| | | @GetMapping("/list") |
| | | public R<IPage<StBdData>> list(StBdVO stBdData, Query query) throws Exception { |
| | | IPage<StBdData> pageList = stBdDataService.selectAlarmRecordPage( query, stBdData); |
| | | return R.data(pageList); |
| | | } |
| | | |
| | | /** |
| | | * 批量插入北斗平台监测数据 |
| | | * @param stBdDataVO 北斗平台监测数据 |
| | | * @return 插入结果 |
| | | */ |
| | | @PostMapping("/insert") |
| | | public R<Boolean> insert(@RequestBody StBdDataVO stBdDataVO) throws Exception { |
| | | return R.status(stBdDataService.insertData(stBdDataVO)) ; |
| | | } |
| | | } |
| | |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsParams; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsPie; |
| | | import cn.gistack.sm.sjztmd.vo.AttResBaseGeneralInvestigationVO; |
| | | import cn.gistack.sm.sjztmd.vo.DyketionVO; |
| | | import cn.gistack.sm.sjztmd.vo.TbDykeInvestigationParam; |
| | | import cn.gistack.sm.sjztmd.vo.TbResDykeVO; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | // if (tbDykeInvestigation.getGuid() == null) { |
| | | tbDykeInvestigation.setCreateTime(new Date()); |
| | | // } |
| | | |
| | | return tbDykeInvestigationService.saveOrUpdateBy(tbDykeInvestigation); |
| | | } |
| | | |
| | |
| | | return R.data(list); |
| | | } |
| | | |
| | | @GetMapping("/downloadZip") |
| | | @ApiOperation(value = "批量导出白蚁普查的图片视频zip文件") |
| | | public R downloadZip(Query query,String type) throws IOException { |
| | | |
| | | List<String> msg = tbDykeInvestigationService.downZip(Condition.getPage(query),type); |
| | | |
| | | return R.data(msg); |
| | | } |
| | | |
| | | @GetMapping("/downloadZipCopy") |
| | | @ApiOperation(value = "批量导出白蚁普查的图片视频zip文件") |
| | | public R downloadZipCopy(Query query, String type,TbResDykeVO tbResDykeVO) { |
| | | |
| | | List<DyketionVO> msg = tbDykeInvestigationService.downloadZipCopy(Condition.getPage(query),type,tbResDykeVO); |
| | | |
| | | return R.data(msg); |
| | | } |
| | | |
| | | @GetMapping("/statisticsPie") |
| | | public R statisticsPie(StatisticsParams statisticsParams){ |
| | | StatisticsPie statisticsPie = tbDykeInvestigationService.statisticsPie(statisticsParams); |
| | |
| | | return R.data(list); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.controller; |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.TbDykeUnitDanger; |
| | | import cn.gistack.sm.sjztmd.service.ITbDykeUnitDangerService; |
| | | import cn.gistack.sm.sjztmd.vo.TbDykeUnitDangerVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * @Author AIX |
| | | * @Date 2024/6/28 14:12 |
| | | * @Version 1.0 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = "堤防危害等级评定") |
| | | @RestController |
| | | @RequestMapping("/sjztmd/tbDykeUnitDanger") |
| | | @AllArgsConstructor |
| | | public class TbDykeUnitDangerController { |
| | | |
| | | private ITbDykeUnitDangerService tbDykeUnitDangerService; |
| | | |
| | | @ApiOperation(value = "堤防危害等级评定-危害列表", notes = "堤防危害等级评定-危害列表") |
| | | @GetMapping(value = "/listDykeUnitDanger") |
| | | public R listDykeUnitDanger(@ApiIgnore TbDykeUnitDangerVO vo) { |
| | | return R.data(tbDykeUnitDangerService.listDykeUnitDanger(vo)); |
| | | } |
| | | |
| | | @ApiOperation(value = "堤防危害等级评定-添加或者修改", notes = "堤防危害等级评定-添加或者修改") |
| | | @PostMapping(value = "/submit") |
| | | public R submit(@RequestBody TbDykeUnitDanger tbDykeUnitDanger) { |
| | | // 获取当前日期 |
| | | LocalDate today = LocalDate.now(); |
| | | // 获取年份 |
| | | int year = today.getYear(); |
| | | tbDykeUnitDanger.setCreateTime(new Date()); |
| | | tbDykeUnitDanger.setTbYear(year); |
| | | return R.data(tbDykeUnitDangerService.saveOrUpdate(tbDykeUnitDanger)); |
| | | } |
| | | |
| | | @ApiOperation(value = "堤防危害等级评定-批量添加或者修改", notes = "堤防危害等级评定-添加或者修改") |
| | | @PostMapping(value = "/submitBatch") |
| | | public R submit(@RequestBody List<TbDykeUnitDanger> tbDykeUnitDangers) { |
| | | return R.data(tbDykeUnitDangerService.saveOrUpdateBatch(tbDykeUnitDangers)); |
| | | } |
| | | |
| | | } |
| | |
| | | package cn.gistack.sm.sjztmd.controller; |
| | | |
| | | import cn.gistack.sm.sjztmd.dto.TbProjectDTO; |
| | | import cn.gistack.sm.sjztmd.dto.TbProjectIsfillDTO; |
| | | import cn.gistack.sm.sjztmd.excel.TbProjectExcel; |
| | | 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.statisticsVO.*; |
| | | import cn.gistack.sm.sjztmd.vo.StatisticsPrice; |
| | | import cn.gistack.sm.sjztmd.vo.StatisticsPriceVO; |
| | | import cn.gistack.sm.sjztmd.vo.TbProjectIsfillVO; |
| | | import cn.gistack.sm.sjztmd.vo.TbProjectVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | return R.success("操作成功"); |
| | | } |
| | | |
| | | /** |
| | | *校验 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping("checkInfoByGuid") |
| | | public R checkInfoByGuid(@RequestParam String id,@RequestParam String checkState){ |
| | | |
| | | return R.status(tbProjectService.updatecheckState(id,checkState)); |
| | | } |
| | | |
| | | /** |
| | | * 项目管理统计饼状图 |
| | | * @param statisticsParams |
| | | * @return |
| | | */ |
| | | |
| | | @GetMapping("/statisticsPie") |
| | | public R statisticsPie(StatisticsParams statisticsParams){ |
| | | StatisticsPrice statisticsPrice = tbProjectService.statisticsPie(statisticsParams); |
| | | return R.data(statisticsPrice); |
| | | } |
| | | |
| | | @GetMapping("/statisticsBar") |
| | | public R statisticsBar(StatisticsParams statisticsParams){ |
| | | List<StatisticsPriceVO> list = tbProjectService.statisticsBar(statisticsParams); |
| | | return R.data(list); |
| | | } |
| | | |
| | | @PostMapping("isFill") |
| | | public R isFill(@RequestBody TbProjectIsfillDTO fil ){ |
| | | tbProjectService.updateFill(fil); |
| | | return R.success("操作成功"); |
| | | } |
| | | |
| | | @GetMapping("/isfillList") |
| | | public R isFillList(){ |
| | | TbProjectIsfillVO tbProjectIsfillVO = tbProjectService.getfill(); |
| | | return R.data(tbProjectIsfillVO); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.controller; |
| | | |
| | | |
| | | import cn.gistack.sm.sjztmd.service.ITbResAndDykeAllService; |
| | | import cn.gistack.sm.sjztmd.vo.ResAndDykeAll; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Api(tags = "水库堤防统计") |
| | | @RestController |
| | | @RequestMapping("/sjztmd/resAndDkyeAll") |
| | | @AllArgsConstructor |
| | | public class TbResAndDykeController extends BladeController { |
| | | |
| | | @Autowired |
| | | private ITbResAndDykeAllService tbProjectAllService; |
| | | |
| | | @GetMapping("/getStatistics") |
| | | public R getStatistics(String code,String year){ |
| | | List<ResAndDykeAll> list = tbProjectAllService.getStatisticsTable(code,year); |
| | | return R.data(list); |
| | | } |
| | | |
| | | } |
| | |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsPie; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsTable; |
| | | import cn.gistack.sm.sjztmd.vo.AttResBaseGeneralInvestigationVO; |
| | | import cn.gistack.sm.sjztmd.vo.ResGentionVO; |
| | | import cn.gistack.sm.sjztmd.vo.TbResGeneralInvestigationParam; |
| | | import cn.gistack.sm.sjztmd.wrapper.AttResBaseWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | return R.data(tbResGeneralInvestigationService.page(Condition.getPage(query), queryWrapper)); |
| | | } |
| | | |
| | | @ApiOperation(value = "白蚁普查-校核接口", notes = "白蚁普查-添加或者修改") |
| | | @ApiOperation(value = "白蚁普查-校核接口", notes = "白蚁普查-校核接口") |
| | | @PostMapping("/checkInfoByResGuid") |
| | | public R checkInfoByResGuid(@RequestBody TbResGeneralInvestigation tbResGeneralInvestigation) { |
| | | public R checkInfoByResGuid(@RequestBody TbResGeneralInvestigationState tbResGeneralInvestigationState) { |
| | | |
| | | if (tbResGeneralInvestigation.getTbStateId() == null || tbResGeneralInvestigation.getCheckState() == null) { |
| | | if (tbResGeneralInvestigationState.getGuid() == null || tbResGeneralInvestigationState.getCheckState() == null) { |
| | | return R.fail(-1,"参数不对"); |
| | | } |
| | | |
| | | //查询根据状态id查询普查记录表 |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("\"tb_state_id\"", tbResGeneralInvestigation.getTbStateId()); |
| | | queryWrapper.eq("\"tb_state_id\"", tbResGeneralInvestigationState.getGuid()); |
| | | List<TbResGeneralInvestigation> list = tbResGeneralInvestigationService.list(queryWrapper); |
| | | List<TbResGeneralInvestigation> editList = list.stream().map(categoryEntity -> { |
| | | categoryEntity.setCheckState(tbResGeneralInvestigation.getCheckState()); // 给每个categoryEntity对象的EvaluateTaskId属性设置新值 |
| | | categoryEntity.setCheckState(tbResGeneralInvestigationState.getCheckState()); // 给每个categoryEntity对象的EvaluateTaskId属性设置新值 |
| | | return categoryEntity; // 返回修改后的对象 |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | TbResGeneralInvestigationState tbResGeneralInvestigationState = new TbResGeneralInvestigationState(); |
| | | tbResGeneralInvestigationState.setGuid(tbResGeneralInvestigation.getTbStateId()); |
| | | tbResGeneralInvestigationState.setCheckState(tbResGeneralInvestigation.getCheckState()); |
| | | // TbResGeneralInvestigationState tbResGeneralInvestigationState = new TbResGeneralInvestigationState(); |
| | | // tbResGeneralInvestigationState.setGuid(tbResGeneralInvestigation.getGuid()); |
| | | // tbResGeneralInvestigationState.setCheckState(tbResGeneralInvestigation.getCheckState()); |
| | | |
| | | //更新普查记录表状态和状态表状态 |
| | | return R.status(tbResGeneralInvestigationService.updateBatchById(editList) && tbResGeneralInvestigationStateService.updateById(tbResGeneralInvestigationState)); |
| | |
| | | return R.data(list); |
| | | } |
| | | |
| | | @GetMapping("/downloadZip") |
| | | @ApiOperation(value = "批量导出白蚁普查的图片视频zip文件") |
| | | public R downloadZip(Query query,String type) throws IOException { |
| | | |
| | | List<String> msg = tbResGeneralInvestigationService.downZip(Condition.getPage(query),type); |
| | | |
| | | return R.data(msg); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/downloadZipCopy") |
| | | @ApiOperation(value = "批量导出白蚁普查的图片视频zip文件") |
| | | public R downloadZipCopy(Query query,String type,AttResBaseGeneralInvestigationVO attResBase){ |
| | | |
| | | List<ResGentionVO> msg = tbResGeneralInvestigationService.downZipCopy(Condition.getPage(query),type,attResBase); |
| | | |
| | | return R.data(msg); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/statisticsPie") |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.controller; |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.TbResStagCapDisc; |
| | | import cn.gistack.sm.sjztmd.feign.ISjztMdClient; |
| | | import cn.gistack.sm.sjztmd.service.IYwFloodReportInfoService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.SneakyThrows; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * @Author AIX |
| | | * @Date 2024/7/8 12:49 |
| | | * @Version 1.0 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = "每日报汛内容") |
| | | @RestController |
| | | @RequestMapping("/ywxt/ywFloodReportInfo") |
| | | @AllArgsConstructor |
| | | public class YwFloodReportInfoController { |
| | | |
| | | @Autowired |
| | | private ISjztMdClient sjztMdClient; |
| | | |
| | | @SneakyThrows |
| | | @GetMapping(value = "/addFloodReport") |
| | | public R getAll() { |
| | | sjztMdClient.saveYesterdayFloodReportContent("1"); |
| | | return R.status(true); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.dto; |
| | | |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | |
| | | @Data |
| | | public class TbProjectIsfillDTO{ |
| | | |
| | | |
| | | private int isFil; |
| | | |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date stratTime; |
| | | |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date endTime; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.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 io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("\"st_bd_data\"") |
| | | @ApiModel(value = "北斗平台监测数据", description = "北斗平台监测数据") |
| | | public class StBdData implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * id |
| | | */ |
| | | @ApiModelProperty(value = "id") |
| | | @TableId(value = "\"id\"",type = IdType.NONE) |
| | | private String id; |
| | | |
| | | /** |
| | | * 消息内容 |
| | | */ |
| | | @TableField(value = "\"content\"") |
| | | @ApiModelProperty(value = "消息内容") |
| | | private String content; |
| | | |
| | | /** |
| | | * 解析后的消息内容 |
| | | */ |
| | | @TableField(value = "\"parsed_content\"") |
| | | @ApiModelProperty(value = "解析后的消息内容") |
| | | private String parsedContent; |
| | | |
| | | |
| | | /** |
| | | * 经度 |
| | | */ |
| | | @TableField(value = "\"longitude\"") |
| | | @ApiModelProperty(value = "经度") |
| | | private String longitude; |
| | | |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | @TableField(value = "\"latitude\"") |
| | | @ApiModelProperty(value = "纬度") |
| | | private String latitude; |
| | | |
| | | /** |
| | | * 海拔 |
| | | */ |
| | | @TableField(value = "\"altitude\"") |
| | | @ApiModelProperty(value = "海拔") |
| | | private String altitude; |
| | | |
| | | /** |
| | | * 发送卡号 |
| | | */ |
| | | @TableField(value = "\"from_addr\"") |
| | | @ApiModelProperty(value = "发送卡号") |
| | | private String fromAddr; |
| | | |
| | | /** |
| | | * 接收卡号 |
| | | */ |
| | | @TableField(value = "\"to_addr\"") |
| | | @ApiModelProperty(value = "接收卡号") |
| | | private String toAddr; |
| | | |
| | | /** |
| | | * 入库时间 |
| | | */ |
| | | @ApiModelProperty(value = "入库时间") |
| | | @TableField("\"create_time\"") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 通信时间 |
| | | */ |
| | | @ApiModelProperty(value = "通信时间") |
| | | @TableField("\"tm\"") |
| | | private Date tm; |
| | | |
| | | /** |
| | | * 编码类型 |
| | | */ |
| | | @ApiModelProperty(value = "编码类型: 1表示消息内容含有中文,9表示消息内容不包含中文") |
| | | @TableField("\"code_type\"") |
| | | private String codeType; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.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 io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("\"st_res_rainfall\"") |
| | | @ApiModel(value = "监测水库降雨", description = "监测水库降雨") |
| | | public class StResRainfall implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * id |
| | | */ |
| | | @ApiModelProperty(value = "id") |
| | | @TableId(value = "\"id\"",type = IdType.NONE) |
| | | private String id; |
| | | |
| | | |
| | | /** |
| | | * 水库编码 |
| | | */ |
| | | @ApiModelProperty(value = "水库编码") |
| | | @TableField("\"res_cd\"") |
| | | private String resCd; |
| | | |
| | | /** |
| | | * 计降雨 |
| | | */ |
| | | @TableField(value = "\"drp\"") |
| | | @ApiModelProperty(value = "计降雨") |
| | | private String drp; |
| | | |
| | | /** |
| | | * 入库时间 |
| | | */ |
| | | @ApiModelProperty(value = "入库时间") |
| | | @TableField("\"create_time\"") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 预报的时段 |
| | | */ |
| | | @ApiModelProperty(value = "预报的时段") |
| | | @TableField("\"day_index\"") |
| | | private String dayIndex; |
| | | |
| | | /** |
| | | * 文件名称 |
| | | */ |
| | | @ApiModelProperty(value = "文件名称") |
| | | @TableField("\"file_name\"") |
| | | private String fileName; |
| | | } |
| | |
| | | private String signsOfTermiteActivity; |
| | | |
| | | /** |
| | | * 堤身宽度 |
| | | */ |
| | | @ApiModelProperty(value = "堤身宽度") |
| | | @TableField(value = "\"dyke_width\"") |
| | | private String dykeWidth; |
| | | |
| | | /** |
| | | * 危害等级 |
| | | */ |
| | | @ApiModelProperty(value = "桩号") |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.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.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @PROJECT_NAME: skjcmanager |
| | | * @DESCRIPTION: 提防危害等级 |
| | | * @USER: aix |
| | | * @DATE: 2024/6/28 11:02 |
| | | */ |
| | | @Data |
| | | @TableName(value = "\"tb_dyke_unit_danger\"", autoResultMap = true) |
| | | @ApiModel(value = "提防危害等级", description = "提防危害等级") |
| | | public class TbDykeUnitDanger implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId(value = "\"id\"", type = IdType.ASSIGN_ID) |
| | | private String id; |
| | | |
| | | /** |
| | | * 填报年度 |
| | | */ |
| | | @ApiModelProperty(value = "填报年度") |
| | | @TableField("\"tb_year\"") |
| | | private Integer tbYear; |
| | | |
| | | /** |
| | | * 填报季度 |
| | | */ |
| | | @ApiModelProperty(value = "填报季度") |
| | | @TableField(value = "\"tb_quarter\"") |
| | | private String tbQuarter; |
| | | |
| | | /** |
| | | * 提防id |
| | | */ |
| | | @ApiModelProperty(value = "提防id") |
| | | @TableField("\"dyke_id\"") |
| | | private String dykeId; |
| | | |
| | | /** |
| | | * 单元 |
| | | */ |
| | | @ApiModelProperty(value = "单元") |
| | | @TableField(value = "\"unit\"") |
| | | private String unit; |
| | | |
| | | /** |
| | | * 危害等级 |
| | | */ |
| | | @ApiModelProperty(value = "危害等级") |
| | | @TableField(value = "\"danger_level\"") |
| | | private Integer dangerLevel; |
| | | |
| | | /** |
| | | * 危害长度 |
| | | */ |
| | | @ApiModelProperty(value = "危害长度") |
| | | @TableField(value = "\"danger_length\"") |
| | | private Integer dangerLength; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value = "创建时间 ") |
| | | @TableField("\"create_time\"") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | } |
| | |
| | | @TableField("\"center_fund\"") |
| | | private Double centerFund; |
| | | |
| | | @TableField("\"other\"") |
| | | private String other; |
| | | |
| | | //地方资金 |
| | | @TableField("\"local_fund\"") |
| | | @JsonSerialize(nullsUsing = NullSerializer.class) // 值为-1时显示null |
| | |
| | | //合同签订时间 |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @TableField("\"contract_date\"") |
| | | @TableField(value = "\"contract_date\"",fill = FieldFill.UPDATE) |
| | | private Date contractDate; |
| | | |
| | | //合同附件 |
| | |
| | | //计划验收时间 |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @TableField("\"plan_check_date\"") |
| | | @TableField(value = "\"plan_check_date\"",fill = FieldFill.UPDATE) |
| | | private Date planCheckDate; |
| | | |
| | | //验收时间 |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @TableField("\"check_date\"") |
| | | @TableField(value = "\"check_date\"",fill = FieldFill.UPDATE) |
| | | private Date checkDate; |
| | | |
| | | //是否验收 |
| | |
| | | @TableField("\"check_url\"") |
| | | private String checkUrl; |
| | | |
| | | //是否校验 |
| | | @TableField("\"check_state\"") |
| | | private String checkState; |
| | | |
| | | //是否填报完成 |
| | | @TableField("\"is_fill\"") |
| | | private String isFill; |
| | | |
| | | //创建人 |
| | | @TableField("\"create_user\"") |
| | | private String createUser; |
| | |
| | | @ApiModelProperty(value = "部位") |
| | | @TableField(value = "\"part_place\"", fill = FieldFill.UPDATE) |
| | | private String partPlace; |
| | | /** |
| | | * 部位 |
| | | */ |
| | | @ApiModelProperty(value = "部位描述") |
| | | @TableField(value = "\"part_place_info\"", fill = FieldFill.UPDATE) |
| | | private String partPlaceInfo; |
| | | |
| | | /** |
| | | * 普查面积 |
| | |
| | | private String investigationWay; |
| | | |
| | | /** |
| | | * 危害等级 |
| | | * 危害情况 |
| | | */ |
| | | @ApiModelProperty(value = "危害等级") |
| | | @ApiModelProperty(value = "危害情况") |
| | | @TableField(value = "\"hazard_rating\"", fill = FieldFill.UPDATE) |
| | | private String hazardRating; |
| | | |
| | |
| | | @TableField(value = "\"res_guid\"") |
| | | private String resGuid; |
| | | |
| | | /** |
| | | * 危害等级 |
| | | */ |
| | | @ApiModelProperty(value = "危害等级") |
| | | @TableField(value = "\"danger_level\"") |
| | | private Integer dangerLevel; |
| | | |
| | | |
| | | /** |
| | | * 填报状态(0填报中,1待审核,2已审核) |
| | | * 填报状态(0 填报中 1 已提交/待校核 2 已校核/待审核 3已审核) |
| | | */ |
| | | @ApiModelProperty(value = "填报状态(0填报中,1待审核,2已审核") |
| | | @ApiModelProperty(value = "0 填报中 1 已提交/待校核 2 已校核/待审核 3已审核") |
| | | @TableField("\"check_state\"") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Integer checkState; |
| | |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 纬度 |
| | | * 创建用户 |
| | | */ |
| | | @ApiModelProperty(value = "纬度") |
| | | @ApiModelProperty(value = "创建用户") |
| | | @TableField(value = "\"create_user\"") |
| | | private String createUser; |
| | | |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.springblade.core.mp.base.BaseEntity; |
| | | |
| | | /** |
| | | * @Author AIX |
| | | * @Date 2024/7/8 12:34 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | @TableName("YW_FLOOD_REPORT_INFO") |
| | | @ApiModel(value = "每日报汛内容", description = "每日报汛内容对象") |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | public class YwFloodReportInfo extends BaseEntity { |
| | | |
| | | private String totalInfo; |
| | | private String oversmallInfo; |
| | | |
| | | } |
| | |
| | | package cn.gistack.sm.sjztmd.feign; |
| | | |
| | | import cn.gistack.alerts.sms.feign.ISmsRecordClient; |
| | | import cn.gistack.alerts.sms.vo.SmsResultVO; |
| | | import cn.gistack.resource.feign.IOssClient; |
| | | import cn.gistack.resource.vo.MyMultipartFile; |
| | | import cn.gistack.sm.intelligentCall.service.CallService; |
| | | import cn.gistack.sm.intelligentCall.vo.CallTaskResultVO; |
| | | import cn.gistack.sm.sjztmd.entity.AttResBase; |
| | | import cn.gistack.sm.sjztmd.entity.YwFloodReportInfo; |
| | | import cn.gistack.sm.sjztmd.feign.IAttResBaseClient; |
| | | import cn.gistack.sm.sjztmd.feign.ISjztMdClient; |
| | | import cn.gistack.sm.sjztmd.service.IAttResBaseService; |
| | | import cn.gistack.sm.sjztmd.service.ITbProjectService; |
| | | import cn.gistack.sm.sjztmd.service.IYwFloodReportInfoService; |
| | | import cn.gistack.sm.sjztmd.util.MyDateUtils; |
| | | import cn.gistack.sm.sjztmd.word.service.ISjztmdService; |
| | | import cn.gistack.sm.sjztmd.word.util.WordUtil; |
| | | import cn.gistack.sm.sjztmd.word.vo.DzkInfo; |
| | | import cn.gistack.sm.sjztmd.word.vo.OverDetail; |
| | | import cn.gistack.sm.sjztmd.word.vo.SzInfo; |
| | | import cn.gistack.sm.sjztmd.word.vo.TotalInfo; |
| | | import cn.gistack.sm.sjztmd.word.vo.*; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.redis.cache.BladeRedis; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springframework.core.io.InputStreamResource; |
| | | import org.springframework.http.MediaType; |
| | |
| | | import java.io.FileOutputStream; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | private final ISjztmdService sjztmdService; |
| | | private final IOssClient ossClient; |
| | | |
| | | private final ISmsRecordClient smsRecordClient; |
| | | |
| | | private final CallService callService; |
| | | |
| | | private final ITbProjectService tbProjectService; |
| | | |
| | | private final IYwFloodReportInfoService ywFloodReportInfoService; |
| | | |
| | | @Override |
| | | public String saveYesterdayFloodReportContent(String isShow) throws Exception { |
| | | //获取总览、大中库、明细数据 |
| | | List<TotalInfo> totalList = sjztmdService.getTotalInfo(isShow); |
| | | OverWord overWord = WordUtil.GetOverInfo(totalList); |
| | | // bladeRedis.set("yesterDayFloodReport-totalinfo",overWord.getTotalInfo()); |
| | | // bladeRedis.set("yesterDayFloodReport-oversmallinfo",overWord.getOverSmallInfo()); |
| | | YwFloodReportInfo info = new YwFloodReportInfo(); |
| | | info.setCreateTime(new Date()); |
| | | info.setTotalInfo(overWord.getTotalInfo()); |
| | | info.setOversmallInfo(overWord.getOverSmallInfo()); |
| | | ywFloodReportInfoService.save(info); |
| | | return "保存昨日报汛内容"; |
| | | } |
| | | |
| | | @Override |
| | | @GetMapping(GENERATE_DAY_REPORT_FLOOD) |
| | | public String generateDayReportFlood(String isShow) throws Exception{ |
| | | |
| | | public String generateDayReportFlood(String isShow) throws Exception { |
| | | |
| | | |
| | | //获取总览、大中库、明细数据 |
| | |
| | | List<OverDetail> overDetailList = sjztmdService.getOverDetailInfo(isShow); |
| | | List<SzInfo> szInfoList = sjztmdService.getSzInfo(isShow); |
| | | |
| | | HashMap<String,String> over10Params = new HashMap<>(); |
| | | //短信预警数量 |
| | | SmsResultVO vo = new SmsResultVO(); |
| | | // 获取当前日期 |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | // 获取前一天日期 |
| | | LocalDateTime oneDayBefore = now.minusDays(1); |
| | | // 格式化日期并打印 |
| | | // 定义日期时间格式,包含年-月-日 时:分:秒 |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | vo.setStartTime(oneDayBefore.format(formatter)); |
| | | vo.setEndTime(now.format(formatter)); |
| | | vo.setSmsType("2"); |
| | | vo.setResCode("0"); |
| | | List<SmsResultVO> dxyjList = smsRecordClient.smsSuccessList(vo); |
| | | |
| | | //外呼统计 |
| | | DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | CallTaskResultVO callTaskResult = new CallTaskResultVO(); |
| | | callTaskResult.setStartTime(oneDayBefore.format(formatter2)); |
| | | callTaskResult.setEndTime(now.format(formatter2)); |
| | | List<CallTaskResultVO> whtjList = (List<CallTaskResultVO>) callService.getCallResultListTemp(null, callTaskResult); |
| | | |
| | | 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", "0.1"); |
| | | over10Params.put("mid_start_stag", "0.1"); |
| | | over10Params.put("big_start_stag", "0.1"); |
| | | |
| | | HashMap<String,String> normalParams = new HashMap<>(); |
| | | 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 |
| | | normalParams.put("small_start_stag", "0"); |
| | | normalParams.put("mid_start_stag", "0"); |
| | | normalParams.put("big_start_stag", "0"); |
| | | |
| | | List<TotalInfo> totalOverList = sjztmdService.getTotalOverInfo(isShow,normalParams); |
| | | List<TotalInfo> totalOver10List = sjztmdService.getTotalOverInfo(isShow,over10Params); |
| | | byte[] data = null; |
| | | if (MyDateUtils.isTodayInFloodSeason()){ |
| | | data = WordUtil.GetOverInfo(totalList,dzkList,overDetailList,szInfoList); |
| | | }else { |
| | | data= WordUtil.GetNotInSeasonOverInfo(totalList,dzkList,overDetailList,szInfoList,totalOverList,totalOver10List); |
| | | List<TotalInfo> totalOverList = sjztmdService.getTotalOverInfo(isShow, normalParams); |
| | | List<TotalInfo> totalOver10List = sjztmdService.getTotalOverInfo(isShow, over10Params); |
| | | |
| | | |
| | | //昨日报汛内容 |
| | | YwFloodReportInfo ywFloodReportInfo = ywFloodReportInfoService.getLatestReport(oneDayBefore.format(formatter2)); |
| | | |
| | | byte[] data = null; |
| | | if (MyDateUtils.isTodayInFloodSeason()) { |
| | | data = WordUtil.GetOverInfo(totalList, dzkList, overDetailList, szInfoList, dxyjList, whtjList, ywFloodReportInfo); |
| | | } else { |
| | | data = WordUtil.GetNotInSeasonOverInfo(totalList, dzkList, overDetailList, szInfoList, totalOverList, totalOver10List); |
| | | |
| | | } |
| | | // 创建响应实体并设置响应头,将输出流作为响应体返回给客户端 |
| | | // InputStreamResource resource = new InputStreamResource(new ByteArrayInputStream(data)); |
| | | String time = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); |
| | | String fileName = time + "全省水库防汛情况.docx"; |
| | | MultipartFile file = new MyMultipartFile("file",fileName, "text/plain", data); |
| | | MultipartFile file = new MyMultipartFile("file", fileName, "text/plain", data); |
| | | String path = ossClient.uploadFile(fileName, file); |
| | | return path; |
| | | } |
| | | |
| | | private void createFile(String filePath,byte[] bytes){ |
| | | @Override |
| | | @GetMapping(ISjztMdClient.GET_RESERVOIR_RAINFALL_FORECAST) |
| | | public void getReservoirRainfallForecast(List<String> dayIndexList) { |
| | | sjztmdService.getReservoirRainfallForecast(dayIndexList); |
| | | } |
| | | |
| | | @Override |
| | | @GetMapping(ISjztMdClient.GET_PROJECT_CHECK_STATUS) |
| | | public void setGetProjectCheckStatus() throws Exception { |
| | | tbProjectService.updateallcheck(); |
| | | } |
| | | |
| | | private void createFile(String filePath, byte[] bytes) { |
| | | // 将byte[]写入文件 |
| | | try (FileOutputStream fos = new FileOutputStream(filePath)) { |
| | | fos.write(bytes); |
| | |
| | | ( SELECT CASE WHEN count( 1 ) > 0 THEN 1 ELSE 0 END FROM "SJZT_MD"."att_ad_base" WHERE "p_ad_code" = region."ad_code" ) AS "has_children" |
| | | FROM |
| | | "SJZT_MD"."att_ad_base" region |
| | | left join "SJZT_MD"."att_ad_base" b on (region."p_ad_code" = b."ad_code") |
| | | left join "SJZT_MD"."att_ad_base" c on (b."p_ad_code" = c."ad_code") |
| | | left join "SJZT_MD"."att_ad_base" d on (c."p_ad_code" = d."ad_code") |
| | | <where> |
| | | <if test="param1!=null"> |
| | | and region."p_ad_code" = #{param1} |
| | | </if> |
| | | <if test="param2.code!=null and param2.code!=''"> |
| | | and region."ad_code" like concat(#{param2.code},'%') |
| | | and concat(region."ad_code",b."ad_code",c."ad_code",d."ad_code") like concat('%',#{param2.code},'%') |
| | | </if> |
| | | <if test="param2.name!=null and param2.name!=''"> |
| | | and region."ad_name" like concat('%',#{param2.name},'%') |
| | |
| | | ( SELECT CASE WHEN count( 1 ) > 0 THEN 1 ELSE 0 END FROM YWXT."att_ad_base" WHERE "p_ad_code" = region."ad_code" ) AS "has_children" |
| | | FROM |
| | | YWXT."att_ad_base" region |
| | | left join "YWXT"."att_ad_base" b on (region."p_ad_code" = b."ad_code") |
| | | left join "YWXT"."att_ad_base" c on (b."p_ad_code" = c."ad_code") |
| | | left join "YWXT"."att_ad_base" d on (c."p_ad_code" = d."ad_code") |
| | | <where> |
| | | <if test="param1!=null"> |
| | | and region."p_ad_code" = #{param1} |
| | | </if> |
| | | <if test="param2.code!=null and param2.code!=''"> |
| | | and region."ad_code" like concat(#{param2.code},'%') |
| | | and concat(region."ad_code",b."ad_code",c."ad_code",d."ad_code") like concat('%',#{param2.code},'%') |
| | | </if> |
| | | <if test="param2.name!=null and param2.name!=''"> |
| | | and region."ad_name" like concat('%',#{param2.name},'%') |
| | |
| | | start with "ad_code" = (select "interior_ad_guid" from SJZT_MD."att_res_base" where "guid" = #{res_cd} ) |
| | | CONNECT BY PRIOR "p_ad_code" = "ad_code" |
| | | ) |
| | | and locate(br.role_name,concat('%',#{roleName},'%'))>0 |
| | | and br.role_name in |
| | | <foreach collection="roleName.split(',')" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | and bu.phone is not null and bu.phone!='' |
| | | </select> |
| | | |
| | |
| | | import cn.gistack.sm.sjztmd.vo.ManagePersonVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.HashMap; |
| | |
| | | * |
| | | * @author Chill |
| | | */ |
| | | |
| | | @Mapper |
| | | public interface AttResBaseMapper extends BaseMapper<AttResBase> { |
| | | |
| | | |
| | |
| | | b."guid" as tbStateId, |
| | | b."tb_year", |
| | | b."tb_quarter", |
| | | ifnull(b."danger_level",'无') dangerLevel, |
| | | (CASE WHEN tmp.totalDangerNum>0 THEN 1 ELSE 2 END) as hasDanger, |
| | | tmp.totalDangerNum, |
| | | tmp.termiteNum, |
| | | tmp.otherNum, |
| | | ifnull(tmp.totalDanger,0) totalDanger, |
| | | ifnull(tmp.totalDangerSr,0) totalDangerSr, |
| | | ifnull(tmp.totalDangerCb,0) totalDangerCb, |
| | | ifnull(tmp.totalDangerDw,0) totalDangerDw, |
| | | |
| | | 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, |
| | |
| | | |
| | | SUM(CASE WHEN (trgi."hazard_rating" != '无危害') THEN 1 ELSE 0 END) AS totalDangerNum, |
| | | SUM(CASE WHEN (trgi."investigation_variety" = '白蚁' and trgi."hazard_rating" != '无危害') THEN 1 ELSE 0 END) AS termiteNum, |
| | | SUM(CASE WHEN (trgi."investigation_variety" != '白蚁' and trgi."hazard_rating" != '无危害') THEN 1 ELSE 0 END) AS otherNum |
| | | SUM(CASE WHEN (trgi."investigation_variety" != '白蚁' and trgi."hazard_rating" != '无危害') THEN 1 ELSE 0 END) AS otherNum, |
| | | SUM(CASE WHEN (trgi."is_danger" != '否') THEN 1 ELSE 0 END) AS totalDanger, |
| | | SUM(CASE WHEN (json_value(trgi."danger_info", '$.sr') != '') THEN json_value(trgi."danger_info", '$.sr') ELSE 0 END) AS totalDangerSr, |
| | | SUM(CASE WHEN (json_value(trgi."danger_info", '$.cb') != '') THEN json_value(trgi."danger_info", '$.cb') ELSE 0 END) AS totalDangerCb, |
| | | SUM(CASE WHEN (json_value(trgi."danger_info", '$.dw') != '') THEN json_value(trgi."danger_info", '$.dw') ELSE 0 END) AS totalDangerDw |
| | | from sjzt_md."tb_res_general_investigation" trgi |
| | | where 1=1 |
| | | <if test="attResBase.tbYear !=null and attResBase.tbYear !=''"> |
| | |
| | | <if test="attResBase.hasDanger != null and attResBase.hasDanger != '' "> |
| | | and base.hasDanger = #{attResBase.hasDanger} |
| | | </if> |
| | | <if test="attResBase.dangerLevel != null and attResBase.dangerLevel != '' "> |
| | | and base.dangerLevel = #{attResBase.dangerLevel} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | |
| | | |
| | | /** |
| | | * 根据水库编号查询市县水利部人员姓名及联系方式 |
| | | * @param res_cd 水库编号 |
| | | * @param roleAlias 角色别名 |
| | | * @param countyCode 区县编号 |
| | | * @param cityCode 市州编号 |
| | | * @param type 人员类型 |
| | | * @return |
| | | */ |
| | | List<PersonVO> getCityCountyPersonListByResGuid(@Param("adCode") String res_cd, |
| | | @Param("roleAlias") String roleAlias, |
| | | List<PersonVO> getCityCountyPersonListByResGuid(@Param("countyCode") String countyCode, |
| | | @Param("cityCode") String cityCode, |
| | | @Param("type") String type); |
| | | |
| | | List<PatrolResponsiblePerson> getPatrolResponsiblePersonByResCdList(@Param("ids") List<String> reservoirList); |
| | |
| | | and "user_name" not like '%、' |
| | | and length(a."user_phone") = 11 |
| | | order by "user_phone") a |
| | | where not exists(select * from "YWXT"."BLADE_USER" where a."user_phone" = "PHONE")) a |
| | | where not exists(select * from "YWXT"."BLADE_USER" where a."user_phone" = "PHONE" and is_deleted = 0)) a |
| | | </select> |
| | | |
| | | <select id="getPersonByUser" resultType="cn.gistack.sm.sjztmd.vo.UserPersonVO"> |
| | |
| | | </choose> |
| | | </select> |
| | | |
| | | <!--根据水库编号查询市县水利部人员姓名及联系方式--> |
| | | <!--根据水库编号查询市县水利部人员姓名及联系方式(省市县预警短信发送人员)--> |
| | | <select id="getCityCountyPersonListByResGuid" resultType="cn.gistack.sm.sjztmd.vo.PersonVO"> |
| | | select real_name as name,phone,#{type} as type from YWXT.blade_user bu |
| | | left join YWXT.blade_dept bd on locate(bd.id,bu.dept_id)>0 and bd.is_deleted = 0 |
| | | left join YWXT.blade_role br on locate(br.id,bu.role_id)>0 and br.is_deleted = 0 |
| | | where bu.is_deleted = 0 |
| | | and br.role_alias = #{roleAlias} |
| | | and bd.ad_code = #{adCode} |
| | | limit 3 |
| | | ( |
| | | select real_name as name, phone, '预警短信发送人员' as type |
| | | from YWXT.blade_user bu |
| | | left join YWXT.blade_dept bd on locate(bd.id, bu.dept_id) > 0 and bd.is_deleted = 0 |
| | | left join YWXT.blade_role br on locate(br.id, bu.role_id) > 0 and br.is_deleted = 0 |
| | | where bu.is_deleted = 0 |
| | | and br.role_alias = 'sltyjdxfsry' |
| | | and bd.ad_code = '420000000000' limit 2 |
| | | ) |
| | | union |
| | | ( |
| | | select real_name as name, phone, '预警短信发送人员' as type |
| | | from YWXT.blade_user bu |
| | | left join YWXT.blade_dept bd on locate(bd.id, bu.dept_id) > 0 and bd.is_deleted = 0 |
| | | left join YWXT.blade_role br on locate(br.id, bu.role_id) > 0 and br.is_deleted = 0 |
| | | where bu.is_deleted = 0 |
| | | and br.role_alias = 'sjyjdxfsry' |
| | | and bd.ad_code = #{cityCode} limit 2 |
| | | ) |
| | | union |
| | | ( |
| | | select real_name as name, phone, '预警短信发送人员' as type |
| | | from YWXT.blade_user bu |
| | | left join YWXT.blade_dept bd on locate(bd.id, bu.dept_id) > 0 and bd.is_deleted = 0 |
| | | left join YWXT.blade_role br on locate(br.id, bu.role_id) > 0 and br.is_deleted = 0 |
| | | where bu.is_deleted = 0 |
| | | and br.role_alias = 'xjyjdxfsry' |
| | | and bd.ad_code = #{countyCode} limit 2 |
| | | ) |
| | | </select> |
| | | |
| | | <select id="getPatrolResponsiblePersonByResCdList" |
| | | resultType="cn.gistack.sm.sjztmd.entity.PatrolResponsiblePerson"> |
| | | |
| | |
| | | |
| | | public interface AttWmstBaseMapper extends BaseMapper<AttWmstBase> { |
| | | |
| | | List<AttWmstBaseVO> getPage(IPage<AttWmstBaseVO> page, AttWmstBaseVO attWmstBaseVO); |
| | | List<AttWmstBaseVO> getPage(IPage<AttWmstBaseVO> page, @Param("attWmstBaseVO")AttWmstBaseVO attWmstBaseVO); |
| | | |
| | | boolean customizeUpdate(@Param("attWmstBase") AttWmstBase attWmstBase); |
| | | } |
| | |
| | | <if test="attWmstBaseVO.adCode != null and attWmstBaseVO.adCode !=''"> |
| | | and concat(ad."ad_code",ad2."ad_code",ad3."ad_code") like concat('%',#{attWmstBaseVO.adCode},'%') |
| | | </if> |
| | | <if test="attWmstBaseVO.online != null and attWmstBaseVO.online !=''"> |
| | | <if test="attWmstBaseVO.online != null"> |
| | | and awb."online" = #{attWmstBaseVO.online} |
| | | </if> |
| | | <if test="attWmstBaseVO.sysResource != null and attWmstBaseVO.sysResource !=''"> |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import cn.gistack.sm.sjztmd.entity.StBdData; |
| | | |
| | | public interface StBdDataMapper extends BaseMapper<StBdData> { |
| | | } |
| 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.sjztmd.mapper.StBdDataMapper"> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.mapper; |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.StResRainfall; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | public interface StResRainfallMapper extends BaseMapper<StResRainfall> { |
| | | } |
| 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.sjztmd.mapper.StResRainfallMapper"> |
| | | |
| | | </mapper> |
| | |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsBar; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsParams; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsPie; |
| | | import cn.gistack.sm.sjztmd.vo.DyketionVO; |
| | | import cn.gistack.sm.sjztmd.vo.ImageAndVideoVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | List<StatisticsBar> getProvinceStatisticsBar(@Param("params") StatisticsParams statisticsParams); |
| | | |
| | | List<StatisticsBar> getStatisticsBar(@Param("params") StatisticsParams statisticsParams); |
| | | |
| | | List<ImageAndVideoVO> getIamgeAndVideoUrl(IPage<ImageAndVideoVO> page); |
| | | |
| | | List<DyketionVO> getIamgeAndVideoUrlcopy(); |
| | | } |
| | |
| | | |
| | | SELECT |
| | | COUNT(*) totalNum, |
| | | SUM(CASE WHEN (tdis."check_state" = 1 or tdis."check_state" = 2) THEN 1 ELSE 0 END) as finishNum |
| | | SUM(CASE WHEN (tdis."check_state" = 3) THEN 1 ELSE 0 END) as finishNum |
| | | from |
| | | SJZT_MD."tb_res_dyke" trd |
| | | LEFT JOIN SJZT_MD."tb_dyke_investigation_state" tdis ON tdis."dyke_guid" = trd."guid" AND (tdis."check_state" = 1 or tdis."check_state" = 2) |
| | | LEFT JOIN SJZT_MD."tb_dyke_investigation_state" tdis ON tdis."dyke_guid" = trd."guid" AND (tdis."check_state" = 3) |
| | | <if test="params.tbYear != null and params.tbYear !=''"> |
| | | AND tdis."tb_year" = #{params.tbYear} |
| | | </if> |
| | |
| | | SELECT |
| | | TEMP1."tb_state_id", |
| | | TEMP1."unit", |
| | | TEMP1.dangerLength/temp1.num as dangerLength |
| | | TEMP1.dangerLength as dangerLength |
| | | FROM ( |
| | | SELECT |
| | | tdi."tb_state_id", |
| | |
| | | <if test="params.tbYear!=null and params.tbYear!=''"> |
| | | AND tdi."tb_year" = #{params.tbYear} |
| | | </if> |
| | | and tdi."investigation_variety" = '白蚁' |
| | | -- 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) |
| | | where (tdis."check_state" = 3) |
| | | ) 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" |
| | |
| | | </if> |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getIamgeAndVideoUrl" resultType="cn.gistack.sm.sjztmd.vo.ImageAndVideoVO"> |
| | | select "dyke_name" as dykeName, "image_urls" as imagesUrl ,"video_urls" as videosUrl from sjzt_md."tb_dyke_investigation" |
| | | </select> |
| | | <select id="getIamgeAndVideoUrlcopy" resultType="cn.gistack.sm.sjztmd.vo.DyketionVO"> |
| | | select dyke."tb_year" tbYear,dyke."dyke_guid" code, dyke."dyke_name" dname,dyke."image_urls" imagesUrl,dyke."video_urls" videoUrls,LPAD(CAST(ROW_NUMBER() OVER (PARTITION BY dyke."dyke_guid" |
| | | ORDER BY |
| | | dyke."create_time" DESC)AS VARCHAR(3)),3,'0') AS rn, |
| | | ad."ad_name" adname, |
| | | ad."p_ad_name" padname |
| | | from sjzt_md."tb_dyke_investigation" dyke |
| | | left join sjzt_md."tb_dyke_investigation_state" dykes on dyke."dyke_guid" = dykes."dyke_guid" |
| | | left join sjzt_md."tb_res_dyke" tf on dyke."dyke_guid" = tf."guid" |
| | | left join YWXT."att_ad_base" ad on tf."ad_code" =ad."guid" |
| | | where dykes."check_state" = '3' ; |
| | | </select> |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.mapper; |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.TbDykeUnitDanger; |
| | | import cn.gistack.sm.sjztmd.vo.TbDykeUnitDangerVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author AIX |
| | | * @Date 2024/6/28 14:05 |
| | | * @Version 1.0 |
| | | */ |
| | | public interface TbDykeUnitDangerMapper extends BaseMapper<TbDykeUnitDanger> { |
| | | |
| | | /** |
| | | * 获取提防单元危害等级评定列表 |
| | | * @param dykeUnitDangerVO |
| | | * @return |
| | | */ |
| | | List<TbDykeUnitDangerVO> listDykeUnitDanger(@Param("params") TbDykeUnitDangerVO dykeUnitDangerVO); |
| | | |
| | | } |
| 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.sjztmd.mapper.TbDykeUnitDangerMapper"> |
| | | |
| | | <select id="listDykeUnitDanger" resultType="cn.gistack.sm.sjztmd.vo.TbDykeUnitDangerVO"> |
| | | select tdi.*,ifnull(tdud."danger_level",0) dangerLevel,tdud."id" from ( |
| | | select |
| | | "dyke_guid" dykeGuid,"unit",count(*) dangerNum,wm_concat(distinct "signs_of_termite_activity") hdjxs, |
| | | sum("danger_length") as dangerLength |
| | | from sjzt_md."tb_dyke_investigation" |
| | | where "hazard_rating" = '有危害' |
| | | <if test="params.dykeGuid != null and params.dykeGuid != ''"> |
| | | and "dyke_guid" = #{params.dykeGuid} |
| | | </if> |
| | | group by "dyke_guid","unit" |
| | | ) tdi |
| | | left join sjzt_md."tb_dyke_unit_danger" tdud on (tdi.dykeGuid = tdud."dyke_id" and tdi."unit" = tdud."unit") |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | package cn.gistack.sm.sjztmd.mapper; |
| | | |
| | | import cn.gistack.sm.sjztmd.dto.TbProjectDTO; |
| | | import cn.gistack.sm.sjztmd.dto.TbProjectIsfillDTO; |
| | | import cn.gistack.sm.sjztmd.entity.TbProject; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsParams; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsTableProject; |
| | | import cn.gistack.sm.sjztmd.vo.StatisticsPrice; |
| | | import cn.gistack.sm.sjztmd.vo.StatisticsPriceVO; |
| | | import cn.gistack.sm.sjztmd.vo.TbProjectIsfillVO; |
| | | import cn.gistack.sm.sjztmd.vo.TbProjectVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | List<StatisticsTableProject> getStatisticsTable(@Param("params") StatisticsParams statisticsParams); |
| | | |
| | | TbProject getTbProjectInfo(@Param("params") TbProject params); |
| | | |
| | | StatisticsPrice getStatisticsPie(@Param("params") StatisticsParams statisticsParams); |
| | | |
| | | StatisticsPrice getStatisticsPies(@Param("params") StatisticsParams statisticsParams); |
| | | |
| | | List<StatisticsPriceVO> getStatisticsPieBar(@Param("params") StatisticsParams statisticsParams); |
| | | |
| | | List<StatisticsPriceVO> getStatisticsPieBars(@Param("params") StatisticsParams statisticsParams); |
| | | |
| | | void updateallcheck(); |
| | | |
| | | void updateFill(@Param("params") TbProjectIsfillDTO fil); |
| | | |
| | | TbProjectIsfillVO getfill(); |
| | | } |
| | |
| | | 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" |
| | | </sql> |
| | | <update id="updateallcheck"> |
| | | update SJZT_MD."tb_project" set set "is_fill" ='', "check_state" =''; |
| | | </update> |
| | | <update id="updateFill"> |
| | | update SJZT_MD."tb_project_fill" set "isFil" = #{params.isFil}, "start_time" = #{params.stratTime},"end_time"= #{params.endTime} |
| | | </update> |
| | | |
| | | <select id="getList" resultType="cn.gistack.sm.sjztmd.vo.TbProjectVO"> |
| | | |
| | |
| | | <if test="vo.isGovPurchase != null and vo.isGovPurchase != ''"> |
| | | and tb."is_gov_purchase" = #{vo.isGovPurchase} |
| | | </if> |
| | | <if test="vo.contractDate != null and vo.contractDate != ''"> |
| | | and tb."contract_date" = #{vo.contractDate} |
| | | <if test="vo.contractDateQuery != null and vo.contractDateQuery != ''"> |
| | | and tb."contract_date" = #{vo.contractDateQuery} |
| | | </if> |
| | | <if test="vo.startTime!=null and vo.startTime!=''"> |
| | | and tb."check_date">= #{vo.startTime} |
| | |
| | | <if test="vo.endTime!=null and vo.endTime!=''"> |
| | | and tb."check_date" <= #{vo.endTime} |
| | | </if> |
| | | order by city_code,county_code asc |
| | | order by CAST(city_code AS number) asc,CAST(county_code AS number) asc,CAST(guid AS number) desc |
| | | </select> |
| | | |
| | | <resultMap id="dto" type="cn.gistack.sm.sjztmd.dto.TbProjectDTO"> |
| | |
| | | <result property="cityName" column="city_name"/> |
| | | <result property="countyCode" column="county_code"/> |
| | | <result property="countyName" column="county_name"/> |
| | | |
| | | <result property="other" column="other"/> |
| | | <result property="centerFund" column="center_fund"/> |
| | | <result property="localFund" column="local_fund"/> |
| | | <result property="isEstablishPlan" column="is_establish_plan"/> |
| | |
| | | SELECT |
| | | aab."guid" adCode, |
| | | aab."ad_name" adName, |
| | | aab."ad_grad" AS adGrad, |
| | | paab."guid" padCode, |
| | | paab."ad_name" padName, |
| | | tps.curMonthActualFund, |
| | |
| | | and "tb_year" = #{params.tbYear} |
| | | </if> |
| | | </select> |
| | | <select id="getStatisticsPie" resultType="cn.gistack.sm.sjztmd.vo.StatisticsPrice"> |
| | | SELECT |
| | | sum( |
| | | NVL ( a."center_fund", 0 )+ NVL ( a."local_fund", 0 )) AS sumPrice, |
| | | sum( |
| | | NVL ( b."actual_fund", 0 )) sumPay, |
| | | sum( |
| | | NVL ( a."center_fund", 0 )+ NVL ( a."local_fund", 0 ))- sum( |
| | | NVL ( b."actual_fund", 0 )) noPay |
| | | FROM |
| | | sjzt_md."tb_project" a |
| | | LEFT JOIN ( SELECT * FROM sjzt_md."tb_project_schedule" |
| | | WHERE 1=1 |
| | | <if test="params.tbYear != null and params.tbYear !=''"> |
| | | AND "year" = #{params.tbYear} |
| | | </if> |
| | | <if test="params.tbMonth != null and params.tbMonth !=''"> |
| | | AND "month" = #{params.tbMonth} |
| | | </if> |
| | | ) b ON a."guid" = b."tb_project_id" and a."check_state" = 3 |
| | | </select> |
| | | <select id="getStatisticsPies" resultType="cn.gistack.sm.sjztmd.vo.StatisticsPrice"> |
| | | SELECT |
| | | sum( |
| | | NVL ( a."center_fund", 0 )+ NVL ( a."local_fund", 0 )) AS sumPrice, |
| | | sum( |
| | | NVL ( b."actual_fund", 0 )) sumPay, |
| | | sum( |
| | | NVL ( a."center_fund", 0 )+ NVL ( a."local_fund", 0 ))- sum( |
| | | NVL ( b."actual_fund", 0 )) noPay |
| | | FROM |
| | | sjzt_md."tb_project" a |
| | | LEFT JOIN ( SELECT * FROM sjzt_md."tb_project_schedule" |
| | | WHERE |
| | | <if test="params.tbYear != null and params.tbYear !=''"> |
| | | AND "year" = #{params.tbYear} |
| | | </if> |
| | | <if test="params.tbMonth != null and params.tbMonth !=''"> |
| | | AND "month" = #{params.tbMonth} |
| | | </if> |
| | | ) b ON a."guid" = b."tb_project_id" and a."check_state" = 3 |
| | | LEFT JOIN YWXT."att_ad_base" c ON ( a."city_code" = c."guid" ) |
| | | OR ( a."county_code" = c."guid" ) |
| | | WHERE |
| | | c."guid" = #{params.adCode} |
| | | </select> |
| | | <select id="getStatisticsPieBar" resultType="cn.gistack.sm.sjztmd.vo.StatisticsPriceVO"> |
| | | SELECT |
| | | c."ad_code" adCode, |
| | | c."ad_name" adName, |
| | | |
| | | sum( |
| | | NVL ( a."center_fund", 0 )+ NVL ( a."local_fund", 0 )) AS sumPrice, |
| | | sum( |
| | | NVL ( b."actual_fund", 0 )) sumPay, |
| | | sum( |
| | | NVL ( a."center_fund", 0 )+ NVL ( a."local_fund", 0 ))- sum( |
| | | NVL ( b."actual_fund", 0 )) noPay |
| | | FROM |
| | | sjzt_md."tb_project" a |
| | | LEFT JOIN ( SELECT * FROM sjzt_md."tb_project_schedule" |
| | | WHERE 1=1 |
| | | <if test="params.tbYear != null and params.tbYear !=''"> |
| | | AND "year" = #{params.tbYear} |
| | | </if> |
| | | <if test="params.tbMonth != null and params.tbMonth !=''"> |
| | | AND "month" = #{params.tbMonth} |
| | | </if> |
| | | ) b ON a."guid" = b."tb_project_id" and a."check_state" = 3 |
| | | RIGHT JOIN YWXT."att_ad_base" c on c."ad_code" = a."city_code" |
| | | where c."p_ad_code" = #{params.adCode} |
| | | GROUP BY |
| | | c."ad_code" , |
| | | c."ad_name" |
| | | </select> |
| | | <select id="getStatisticsPieBars" resultType="cn.gistack.sm.sjztmd.vo.StatisticsPriceVO"> |
| | | SELECT |
| | | b."ad_name" adName, |
| | | b."ad_code" adCode, |
| | | a.sumPrice sumPrice, |
| | | a.noPay noPay, |
| | | a.sumPay sumPay |
| | | FROM |
| | | ( |
| | | SELECT |
| | | a."county_code", |
| | | a."county_name", |
| | | a."city_code", |
| | | sum( |
| | | NVL ( a."center_fund", 0 )+ NVL ( a."local_fund", 0 )) AS sumPrice, |
| | | sum( |
| | | NVL ( b."actual_fund", 0 )) sumPay, |
| | | sum( |
| | | NVL ( a."center_fund", 0 )+ NVL ( a."local_fund", 0 ))- sum( |
| | | NVL ( b."actual_fund", 0 )) noPay |
| | | FROM |
| | | sjzt_md."tb_project" a |
| | | LEFT JOIN ( SELECT * FROM sjzt_md."tb_project_schedule" |
| | | WHERE 1=1 |
| | | <if test="params.tbYear != null and params.tbYear !=''"> |
| | | AND "year" = #{params.tbYear} |
| | | </if> |
| | | <if test="params.tbMonth != null and params.tbMonth !=''"> |
| | | AND "month" = #{params.tbMonth} |
| | | </if> |
| | | ) b ON a."guid" = b."tb_project_id" and a."check_state" = 3 |
| | | GROUP BY |
| | | a."county_code", |
| | | a."county_name", |
| | | a."city_code" |
| | | ) a |
| | | RIGHT JOIN YWXT."att_ad_base" b ON ( b."guid" = a."city_code" ) |
| | | OR ( b."guid" = a."county_code" ) |
| | | WHERE |
| | | b."p_ad_code" = #{params.adCode} |
| | | </select> |
| | | <select id="getfill" resultType="cn.gistack.sm.sjztmd.vo.TbProjectIsfillVO"> |
| | | select "isFil","end_time" endTime, "start_time" stratTime from SJZT_MD."tb_project_fill" |
| | | </select> |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.mapper; |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.TbProject; |
| | | import cn.gistack.sm.sjztmd.vo.ResAndDykeAll; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface TbResAndDykeAllMapper extends BaseMapper<TbProject> { |
| | | List<ResAndDykeAll> getStatisticsTable(String code,String year); |
| | | } |
| 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.sjztmd.mapper.TbResAndDykeAllMapper"> |
| | | |
| | | <select id="getStatisticsTable" resultType="cn.gistack.sm.sjztmd.vo.ResAndDykeAll"> |
| | | SELECT |
| | | a.*, |
| | | att."p_ad_code" pcode, |
| | | att."p_ad_name" pname, |
| | | att."ad_grad" adGrad, |
| | | ROUND(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" = att."guid" |
| | | OR city."ad_code" = att."guid" |
| | | OR province."ad_code" = att."guid"), 0) / 1000, 3) AS lengthSum, |
| | | ROUND(IFNULL(b.levelOneLengthOne, 0) / 1000, 3) AS levelOneLengthOne, |
| | | ROUND(IFNULL(b.levelOneLengthTwo, 0) / 1000, 3) AS levelOneLengthTwo, |
| | | ROUND(IFNULL(b.levelOneLengthThree, 0) / 1000, 3) AS levelOneLengthThree, |
| | | ROUND(IFNULL(b.levelTwoLengthOne, 0) / 1000, 3) AS levelTwoLengthOne, |
| | | ROUND(IFNULL(b.levelTwoLengthTwo, 0) / 1000, 3) AS levelTwoLengthTwo, |
| | | ROUND(IFNULL(b.levelTwoLengthThree, 0) / 1000, 3) AS levelTwoLengthThree, |
| | | ROUND(IFNULL(b.levelThreeLengthOne, 0) / 1000, 3) AS levelThreeLengthOne, |
| | | ROUND(IFNULL(b.levelThreeLengthTwo, 0) / 1000, 3) AS levelThreeLengthTwo, |
| | | ROUND(IFNULL(b.levelThreeLengthThree, 0) / 1000, 3) AS levelThreeLengthThree, |
| | | ROUND(IFNULL(b.levelFourLengthOne, 0) / 1000, 3) AS levelFourLengthOne, |
| | | ROUND(IFNULL(b.levelFourLengthTwo, 0) / 1000, 3) AS levelFourLengthTwo, |
| | | ROUND(IFNULL(b.levelFourLengthThree, 0) / 1000, 3) AS levelFourLengthThree, |
| | | ROUND(IFNULL(b.levelFiveLengthOne, 0) / 1000, 3) AS levelFiveLengthOne, |
| | | ROUND(IFNULL(b.levelFiveLengthTwo, 0) / 1000, 3) AS levelFiveLengthTwo, |
| | | ROUND(IFNULL(b.levelFiveLengthThree, 0) / 1000, 3) AS levelFiveLengthThree |
| | | FROM |
| | | ( |
| | | SELECT |
| | | a."ad_code" CODE, |
| | | a."ad_name" NAME, |
| | | count( b."guid" ) AS resNum, |
| | | sum( CASE WHEN b."eng_scal" = '大(1)型' AND b."danger_level" = '1' THEN 1 ELSE 0 END ) AS bigOneNum, |
| | | sum( CASE WHEN b."eng_scal" = '大(1)型' AND b."danger_level" = '2' THEN 1 ELSE 0 END ) AS bigTwoNum, |
| | | sum( CASE WHEN b."eng_scal" = '大(1)型' AND b."danger_level" = '3' THEN 1 ELSE 0 END ) AS bigThreeNum, |
| | | sum( CASE WHEN b."eng_scal" = '大(2)型' AND b."danger_level" = '1' THEN 1 ELSE 0 END ) AS bigtOneNum, |
| | | sum( CASE WHEN b."eng_scal" = '大(2)型' AND b."danger_level" = '2' THEN 1 ELSE 0 END ) AS bigtTwoNum, |
| | | sum( CASE WHEN b."eng_scal" = '大(2)型' AND b."danger_level" = '3' THEN 1 ELSE 0 END ) AS bigtThreeNum, |
| | | sum( CASE WHEN b."eng_scal" = '中型' AND b."danger_level" = '1' THEN 1 ELSE 0 END ) AS midOneNum, |
| | | sum( CASE WHEN b."eng_scal" = '中型' AND b."danger_level" = '2' THEN 1 ELSE 0 END ) AS midTwoNum, |
| | | sum( CASE WHEN b."eng_scal" = '中型' AND b."danger_level" = '3' THEN 1 ELSE 0 END ) AS midThreeNum, |
| | | sum( CASE WHEN b."eng_scal" = '小(1)型' AND b."danger_level" = '1' THEN 1 ELSE 0 END ) AS smallOneNum, |
| | | sum( CASE WHEN b."eng_scal" = '小(1)型' AND b."danger_level" = '2' THEN 1 ELSE 0 END ) AS smallTwoNum, |
| | | sum( CASE WHEN b."eng_scal" = '小(1)型' AND b."danger_level" = '3' THEN 1 ELSE 0 END ) AS smallThreeNum, |
| | | sum( CASE WHEN b."eng_scal" = '小(2)型' AND b."danger_level" = '1' THEN 1 ELSE 0 END ) AS smalltOneNum, |
| | | sum( CASE WHEN b."eng_scal" = '小(2)型' AND b."danger_level" = '2' THEN 1 ELSE 0 END ) AS smalltTwoNum, |
| | | sum( CASE WHEN b."eng_scal" = '小(2)型' AND b."danger_level" = '3' THEN 1 ELSE 0 END ) AS smalltThreeNum |
| | | FROM |
| | | YWXT."att_ad_base" a |
| | | LEFT JOIN ( |
| | | SELECT |
| | | a."guid", |
| | | c."danger_level", |
| | | a."eng_scal", |
| | | e."guid" AS countyCode, |
| | | f."guid" AS cityCode, |
| | | g."guid" AS provinceCode |
| | | FROM |
| | | "SJZT_MD"."att_res_base" a |
| | | LEFT JOIN ( SELECT * FROM "SJZT_MD"."tb_res_general_investigation_state" WHERE "danger_level" <![CDATA[<>]]> '0' AND "check_state" = '3' and "tb_year" = #{year} ) c ON a."guid" = c."res_guid" |
| | | LEFT JOIN YWXT."att_ad_base" d ON d."ad_code" = a."interior_ad_guid" |
| | | LEFT JOIN YWXT."att_ad_base" e ON d."p_ad_code" = e."ad_code" |
| | | LEFT JOIN YWXT."att_ad_base" f ON e."p_ad_code" = f."ad_code" |
| | | LEFT JOIN YWXT."att_ad_base" g ON f."p_ad_code" = g."ad_code" |
| | | ) b ON (( |
| | | b.countyCode = a."guid" |
| | | ) |
| | | OR ( b.cityCode = a."guid" ) |
| | | OR ( b.provinceCode = a."guid" )) |
| | | |
| | | GROUP BY |
| | | a."ad_code", |
| | | a."ad_name" |
| | | ) a |
| | | LEFT JOIN ( |
| | | SELECT |
| | | a."ad_code" CODE, |
| | | a."ad_name" NAME, |
| | | sum( b."dyke_length" ) AS lengthSum, |
| | | sum( CASE WHEN b."dyke_level" = '1级' AND b."danger_level" = '1' THEN b."danger_length" ELSE 0 END ) AS levelOneLengthOne, |
| | | sum( CASE WHEN b."dyke_level" = '1级' AND b."danger_level" = '2' THEN b."danger_length" ELSE 0 END ) AS levelOneLengthTwo, |
| | | sum( CASE WHEN b."dyke_level" = '1级' AND b."danger_level" = '3' THEN b."danger_length" ELSE 0 END ) AS levelOneLengthThree, |
| | | sum( CASE WHEN b."dyke_level" = '2级' AND b."danger_level" = '1' THEN b."danger_length" ELSE 0 END ) AS levelTwoLengthOne, |
| | | sum( CASE WHEN b."dyke_level" = '2级' AND b."danger_level" = '2' THEN b."danger_length" ELSE 0 END ) AS levelTwoLengthTwo, |
| | | sum( CASE WHEN b."dyke_level" = '2级' AND b."danger_level" = '3' THEN b."danger_length" ELSE 0 END ) AS levelTwoLengthThree, |
| | | sum( CASE WHEN b."dyke_level" = '3级' AND b."danger_level" = '1' THEN b."danger_length" ELSE 0 END ) AS levelThreeLengthOne, |
| | | sum( CASE WHEN b."dyke_level" = '3级' AND b."danger_level" = '2' THEN b."danger_length" ELSE 0 END ) AS levelThreeLengthTwo, |
| | | sum( CASE WHEN b."dyke_level" = '3级' AND b."danger_level" = '3' THEN b."danger_length" ELSE 0 END ) AS levelThreeLengthThree, |
| | | sum( CASE WHEN b."dyke_level" = '4级' AND b."danger_level" = '1' THEN b."danger_length" ELSE 0 END ) AS levelFourLengthOne, |
| | | sum( CASE WHEN b."dyke_level" = '4级' AND b."danger_level" = '2' THEN b."danger_length" ELSE 0 END ) AS levelFourLengthTwo, |
| | | sum( CASE WHEN b."dyke_level" = '4级' AND b."danger_level" = '3' THEN b."danger_length" ELSE 0 END ) AS levelFourLengthThree, |
| | | sum( CASE WHEN b."dyke_level" = '5级' AND b."danger_level" = '1' THEN b."danger_length" ELSE 0 END ) AS levelFiveLengthOne, |
| | | sum( CASE WHEN b."dyke_level" = '5级' AND b."danger_level" = '2' THEN b."danger_length" ELSE 0 END ) AS levelFiveLengthTwo, |
| | | sum( CASE WHEN b."dyke_level" = '5级' AND b."danger_level" = '3' THEN b."danger_length" ELSE 0 END ) AS levelFiveLengthThree |
| | | FROM |
| | | YWXT."att_ad_base" a |
| | | RIGHT JOIN ( |
| | | SELECT |
| | | a."dyke_length", |
| | | a."dyke_level", |
| | | c."danger_level", |
| | | c."danger_length", |
| | | d."guid" AS countyCode, |
| | | e."guid" AS cityCode, |
| | | f."guid" AS provinceCode |
| | | FROM |
| | | "SJZT_MD"."tb_res_dyke" a |
| | | LEFT JOIN ( |
| | | SELECT |
| | | a.* |
| | | FROM |
| | | SJZT_MD."tb_dyke_unit_danger" a |
| | | LEFT JOIN SJZT_MD."tb_dyke_investigation_state" b ON a."dyke_id" = b."dyke_guid" |
| | | WHERE |
| | | a."danger_level" <![CDATA[<>]]> '0' |
| | | AND b."check_state" = '3' and b."tb_year" = #{year} |
| | | ) c ON a."guid" = c."dyke_id" |
| | | LEFT JOIN YWXT."att_ad_base" d ON d."ad_code" = a."ad_code" |
| | | LEFT JOIN YWXT."att_ad_base" e ON d."p_ad_code" = e."ad_code" |
| | | LEFT JOIN YWXT."att_ad_base" f ON e."p_ad_code" = f."ad_code" |
| | | ) b ON (( |
| | | b.countyCode = a."guid" |
| | | ) |
| | | OR ( b.cityCode = a."guid" ) |
| | | OR ( b.provinceCode = a."guid" )) |
| | | |
| | | GROUP BY |
| | | a."ad_code", |
| | | a."ad_name" |
| | | ) b ON a.CODE = b.CODE |
| | | left join YWXT."att_ad_base" att on a.CODE = att."guid" |
| | | where att."p_ad_code"= #{code} |
| | | |
| | | |
| | | |
| | | </select> |
| | | </mapper> |
| | | |
| | |
| | | import cn.gistack.sm.sjztmd.vo.TbResDykeVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface TbResDykeMapper extends BaseMapper<TbResDyke> { |
| | | List<TbResDykeVO> getPage(IPage<TbResDykeVO> page, @Param("vo") TbResDykeVO tbResDykeVO); |
| | | |
| | |
| | | (CASE WHEN tmp.totalDangerNum>0 THEN 1 ELSE 2 END) as hasDanger, |
| | | tmp.totalDangerNum, |
| | | tmp.termiteNum, |
| | | tmp.otherNum |
| | | tmp.otherNum, |
| | | tmp.totalDangerLength, |
| | | ifnull(tmp.totalDanger,0) totalDanger, |
| | | ifnull(tmp.totalDangerSr,0) totalDangerSr, |
| | | ifnull(tmp.totalDangerCb,0) totalDangerCb, |
| | | ifnull(tmp.totalDangerDw,0) totalDangerDw, |
| | | ( |
| | | select sum(tdud."danger_length") from sjzt_md."tb_dyke_unit_danger" tdud |
| | | left join "SJZT_MD"."tb_dyke_investigation_state" tdis on (tdud."dyke_id" = tdis."dyke_guid") |
| | | where trd."guid" = tdud."dyke_id" and tdud."danger_level" = 1 and tdis."check_state" > 1 |
| | | ) as firstLength, |
| | | ( |
| | | select sum(tdud."danger_length") from sjzt_md."tb_dyke_unit_danger" tdud |
| | | left join "SJZT_MD"."tb_dyke_investigation_state" tdis on (tdud."dyke_id" = tdis."dyke_guid") |
| | | where trd."guid" = tdud."dyke_id" and tdud."danger_level" = 2 and tdis."check_state" > 1 |
| | | ) as secondLength, |
| | | ( |
| | | select sum(tdud."danger_length") from sjzt_md."tb_dyke_unit_danger" tdud |
| | | left join "SJZT_MD"."tb_dyke_investigation_state" tdis on (tdud."dyke_id" = tdis."dyke_guid") |
| | | where trd."guid" = tdud."dyke_id" and tdud."danger_level" = 3 and tdis."check_state" > 1 |
| | | ) as thirdLength |
| | | |
| | | from sjzt_md."tb_res_dyke" trd |
| | | left join "SJZT_MD"."tb_dyke_investigation_state" tdis on trd."guid" = tdis."dyke_guid" |
| | | left join YWXT."att_ad_base" aa on aa."guid" = trd."ad_code" |
| | | left join YWXT."att_ad_base" ab on ab."ad_code" = aa."p_ad_code" |
| | | left join YWXT."att_ad_base" ac on ac."ad_code" = ab."p_ad_code" |
| | | left join YWXT."att_ad_base" ad on ad."ad_code" = ac."p_ad_code" |
| | | left join |
| | | ( |
| | | select |
| | | temp2."tb_state_id", |
| | | temp2."dyke_guid", |
| | | temp2.totalDangerNum, |
| | | temp2.termiteNum, |
| | | temp2.otherNum, |
| | | SUM(CASE WHEN temp2.dangerLength THEN temp2.dangerLength ELSE 0 END) AS totalDangerLength |
| | | sum(temp2.totalDangerNum) as totalDangerNum, |
| | | sum(temp2.termiteNum) as termiteNum, |
| | | sum(temp2.otherNum) as otherNum, |
| | | SUM(CASE WHEN temp2.dangerLength THEN temp2.dangerLength ELSE 0 END) AS totalDangerLength, |
| | | sum(temp2.totalDanger) as totalDanger, |
| | | sum(temp2.totalDangerSr) as totalDangerSr, |
| | | sum(temp2.totalDangerCb) as totalDangerCb, |
| | | sum(temp2.totalDangerDw) as totalDangerDw |
| | | from( |
| | | SELECT |
| | | TEMP1.*, |
| | |
| | | SUM(CASE WHEN (tdi."danger_length") THEN tdi."danger_length" ELSE 0 END) AS dangerLength, |
| | | SUM(CASE WHEN (tdi."hazard_rating" != '无危害') THEN 1 ELSE 0 END) AS totalDangerNum, |
| | | SUM(CASE WHEN (tdi."investigation_variety" = '白蚁' and tdi."hazard_rating" != '无危害') THEN 1 ELSE 0 END) AS termiteNum, |
| | | SUM(CASE WHEN (tdi."investigation_variety" != '白蚁' and tdi."hazard_rating" != '无危害') THEN 1 ELSE 0 END) AS otherNum |
| | | SUM(CASE WHEN (tdi."investigation_variety" != '白蚁' and tdi."hazard_rating" != '无危害') THEN 1 ELSE 0 END) AS otherNum, |
| | | SUM(CASE WHEN (tdi."is_danger" != '否') THEN 1 ELSE 0 END) AS totalDanger, |
| | | SUM(CASE WHEN (json_value(tdi."danger_info", '$.sr') != '') THEN json_value(tdi."danger_info", '$.sr') ELSE 0 END) AS totalDangerSr, |
| | | SUM(CASE WHEN (json_value(tdi."danger_info", '$.cb') != '') THEN json_value(tdi."danger_info", '$.cb') ELSE 0 END) AS totalDangerCb, |
| | | SUM(CASE WHEN (json_value(tdi."danger_info", '$.dw') != '') THEN json_value(tdi."danger_info", '$.dw') ELSE 0 END) AS totalDangerDw |
| | | from sjzt_md."tb_dyke_investigation" tdi |
| | | where 1=1 |
| | | <if test="vo.tbYear !=null and vo.tbYear !=''"> |
| | |
| | | )TEMP1 |
| | | )temp2 group by |
| | | temp2."tb_state_id", |
| | | temp2."dyke_guid", |
| | | temp2.totalDangerNum, |
| | | temp2.termiteNum, |
| | | temp2.otherNum |
| | | temp2."dyke_guid" |
| | | ) tmp on tmp."tb_state_id" = tdis."guid" |
| | | where 1 = 1 |
| | | <if test="vo.name !=null and vo.name !=''"> |
| | |
| | | ) |
| | | </if> |
| | | <if test="vo.adCode != null and vo.adCode != '' "> |
| | | and trd."ad_code" LIKE #{vo.adCode} |
| | | and concat(aa."ad_code",ab."ad_code",ac."ad_code",ad."ad_code") LIKE concat('%',#{vo.adCode},'%') |
| | | </if> |
| | | ) base where 1=1 |
| | | <if test="vo.hasDanger != null and vo.hasDanger != '' "> |
| | | and base.hasDanger = #{vo.hasDanger} |
| | | </if> |
| | | <if test="vo.dangerLevelQuery != null and vo.dangerLevelQuery == 0 "> |
| | | and base.firstLength is null and base.secondLength is null and base.thirdLength is null |
| | | </if> |
| | | <if test="vo.dangerLevelQuery != null and vo.dangerLevelQuery == 1 "> |
| | | and base.firstLength > 0 |
| | | </if> |
| | | <if test="vo.dangerLevelQuery != null and vo.dangerLevelQuery == 2 "> |
| | | and base.secondLength > 0 |
| | | </if> |
| | | <if test="vo.dangerLevelQuery != null and vo.dangerLevelQuery == 3 "> |
| | | and base.thirdLength > 0 |
| | | </if> |
| | | |
| | | </select> |
| | | </mapper> |
| | |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsParams; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsPie; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsTable; |
| | | import cn.gistack.sm.sjztmd.vo.ImageAndVideoVO; |
| | | import cn.gistack.sm.sjztmd.vo.ResGentionVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | List<StatisticsBar> getStatisticsBar(@Param("params") StatisticsParams statisticsParams); |
| | | |
| | | List<StatisticsTable> getStatisticsTable(@Param("params") StatisticsParams statisticsParams); |
| | | |
| | | List<ImageAndVideoVO> getIamgeAndVideoUrl(IPage<ImageAndVideoVO> page); |
| | | |
| | | |
| | | List<ResGentionVO> getIamgeAndVideoUrlcopy(); |
| | | } |
| | |
| | | FROM( |
| | | SELECT |
| | | COUNT(*) totalNum, |
| | | SUM(CASE WHEN (trgis."check_state" = 1 or trgis."check_state" = 2) THEN 1 ELSE 0 END) as finishNum |
| | | SUM(CASE WHEN (trgis."check_state" = 3) THEN 1 ELSE 0 END) as finishNum |
| | | from |
| | | <include refid="resBase"/> |
| | | LEFT JOIN SJZT_MD."tb_res_general_investigation_state" trgis ON trgis."res_guid" = arb."code" AND (trgis."check_state" = 1 or trgis."check_state" = 2) |
| | | LEFT JOIN SJZT_MD."tb_res_general_investigation_state" trgis ON trgis."res_guid" = arb."code" AND (trgis."check_state" = 3) |
| | | <if test="params.tbYear != null and params.tbYear !=''"> |
| | | AND trgis."tb_year" = #{params.tbYear} |
| | | </if> |
| | |
| | | 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 (town."ad_code" = aab."guid" or county."ad_code" = aab."guid" or city."ad_code" = aab."guid" or province."ad_code" = aab."guid") |
| | | <!--控制只有待审核和已审核数据才显示--> |
| | | and (trgis."check_state" = 1 or trgis."check_state" = 2) |
| | | <!--只有已审核数据才显示--> |
| | | and (trgis."check_state" = 3 and totalDangerNum > 0) |
| | | ) |
| | | ) dangerNum |
| | | FROM YWXT."att_ad_base" aab |
| | |
| | | <if test="params.tbYear != null and params.tbYear !=''"> |
| | | and trgis."tb_year" = #{params.tbYear} |
| | | </if> |
| | | and trgis."check_state" = 1 |
| | | and (trgis."check_state" > 1) |
| | | )investigationResNum, |
| | | ( |
| | | SELECT COUNT(*) FROM |
| | |
| | | <if test="params.tbYear != null and params.tbYear !=''"> |
| | | and trgis."tb_year" = #{params.tbYear} |
| | | </if> |
| | | and trgis."check_state" = 2 |
| | | and trgis."check_state" = 3 |
| | | )checkResNum, |
| | | ( |
| | | SELECT COUNT(*) FROM |
| | | ( |
| | | select trgis.*,trgi.dangerNum from SJZT_MD."tb_res_general_investigation_state" trgis |
| | | left join ( |
| | | select * from ( |
| | | select "tb_state_id",count(*) dangerNum from SJZT_MD."tb_res_general_investigation" |
| | | where "hazard_rating" = '有危害' group by "tb_state_id" |
| | | ) |
| | | ) trgi on trgi."tb_state_id" = trgis."guid" |
| | | ) trgis |
| | | left join SJZT_MD."tb_res_general_investigation" trgi on trgi."tb_state_id" = trgis."res_guid" and trgi."hazard_rating" = '有危害' |
| | | LEFT JOIN sjzt_MD."att_res_base" ARB ON ARB."code" = trgis."res_guid" |
| | | LEFT JOIN YWXT."att_ad_base" town ON town."ad_code" = arb."interior_ad_guid" |
| | | LEFT JOIN YWXT."att_ad_base" county ON county."ad_code" = town."p_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 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" = #{params.tbYear} |
| | | </if> |
| | | and trgis."check_state" = 3 and trgis.dangerNum is not null |
| | | )resMayiNum, |
| | | ( |
| | | SELECT COUNT(*) |
| | | FROM SJZT_MD."tb_res_dyke" trd |
| | |
| | | <if test="params.tbYear != null and params.tbYear !=''"> |
| | | and tdis."tb_year" = #{params.tbYear} |
| | | </if> |
| | | and tdis."check_state" = 1 |
| | | and (tdis."check_state" = 1 or tdis."check_state" = 2 or tdis."check_state" = 3) |
| | | )investigationDykeNum, |
| | | ( |
| | | SELECT COUNT(*) FROM |
| | |
| | | <if test="params.tbYear != null and params.tbYear !=''"> |
| | | and tdis."tb_year" = #{params.tbYear} |
| | | </if> |
| | | and tdis."check_state" = 2 |
| | | and (tdis."check_state" = 2 or tdis."check_state" = 3) |
| | | )checkDykeNum, |
| | | IFNULL( |
| | | ( |
| | | SELECT SUM(CASE WHEN trd."dyke_length" THEN trd."dyke_length" ELSE 0 END) FROM ( |
| | | SELECT TRD.* FROM SJZT_MD."tb_dyke_investigation_state" tdis |
| | | LEFT JOIN SJZT_MD."tb_res_dyke" trd on (trd."guid" = tdis."dyke_guid") |
| | | <where> |
| | | <if test="params.tbYear != null and params.tbYear !=''"> |
| | | and tdis."tb_year" = #{params.tbYear} |
| | | </if> |
| | | and tdis."check_state" >= 2 |
| | | </where> |
| | | ) 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 tbDykeLength, |
| | | IFNULL( |
| | | ( |
| | | SELECT |
| | |
| | | SELECT |
| | | TEMP1."tb_state_id", |
| | | TEMP1."unit", |
| | | TEMP1.dangerLength/temp1.num as dangerLength |
| | | TEMP1.dangerLength as dangerLength |
| | | FROM ( |
| | | SELECT |
| | | tdi."tb_state_id", |
| | |
| | | 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) |
| | | where (tdis."check_state" = 3) |
| | | ) 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" |
| | |
| | | order by aab."guid" |
| | | </select> |
| | | |
| | | <select id="getIamgeAndVideoUrl" resultType="cn.gistack.sm.sjztmd.vo.ImageAndVideoVO"> |
| | | select "res_name","image_urls" as imagesUrl ,"video_urls" as videosUrl from sjzt_md."tb_res_general_investigation" |
| | | </select> |
| | | <select id="getIamgeAndVideoUrlcopy" resultType="cn.gistack.sm.sjztmd.vo.ResGentionVO"> |
| | | select resgi."res_name" resname,resgi."res_guid" code,resgi."part_place" ppname ,regis."tb_year" years,LPAD(CAST(ROW_NUMBER() OVER (PARTITION BY regis."res_guid" |
| | | ORDER BY |
| | | regis."create_time" DESC)AS VARCHAR(3)),3,'0') AS rn,resgi."image_urls" imagesUrls,resgi."video_urls" videoUrls, |
| | | 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_name" |
| | | WHEN county."ad_grad" = '2' THEN |
| | | county."ad_name" ELSE city."ad_name" |
| | | END AS cityName |
| | | from SJZT_MD."tb_res_general_investigation" resgi |
| | | left join SJZT_MD."tb_res_general_investigation_state" regis on resgi."res_guid" = regis."res_guid" |
| | | left join SJZT_MD."att_res_base" a on resgi."res_guid" = a."code" |
| | | left join ywxt."att_ad_base" town ON town."guid" = a."interior_ad_guid" |
| | | left join ywxt."att_ad_base" county ON town."p_ad_code" = county."ad_code" |
| | | left join ywxt."att_ad_base" city ON county."p_ad_code" = city."ad_code" |
| | | left join ywxt."att_ad_base" province ON city."p_ad_code" = province."ad_code" |
| | | where regis."check_state" ='3' |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.mapper; |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.YwFloodReportInfo; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author AIX |
| | | * @Date 2024/7/8 12:34 |
| | | * @Version 1.0 |
| | | */ |
| | | public interface YwFloodReportInfoMapper extends BaseMapper<YwFloodReportInfo> { |
| | | |
| | | @Select("SELECT * FROM ywxt.yw_flood_report_info WHERE create_time >= #{oneDayBefore} ORDER BY create_time ASC LIMIT 1") |
| | | YwFloodReportInfo getLatestReport(@Param("oneDayBefore") String oneDayBefore); |
| | | |
| | | } |
| 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.sjztmd.mapper.YwFloodReportInfoMapper"> |
| | | |
| | | </mapper> |
| | |
| | | AttAdBase getYwxtResInfo(String cityName, String countyName); |
| | | |
| | | List<AttResBaseUserExcel> exportAttResBaseUser(Map<String, Object> params); |
| | | |
| | | List<AttResWithRainfall> getAttResByRainfall(String minRainfall, String maxRainfall, String dayIndex) ; |
| | | |
| | | int[] getAttResNumByRainfall(String dayIndex); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.service; |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.StBdData; |
| | | import cn.gistack.sm.sjztmd.vo.StBdDataVO; |
| | | import cn.gistack.sm.sjztmd.vo.StBdVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.core.mp.support.Query; |
| | | |
| | | public interface IStBdDataService extends IService<StBdData>{ |
| | | |
| | | Boolean insertData(StBdDataVO stBdDataVO) throws Exception; |
| | | |
| | | IPage<StBdData> selectAlarmRecordPage(Query query, StBdVO stBdVO); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.service; |
| | | import cn.gistack.sm.sjztmd.entity.StResRainfall; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface IStResRainfallService extends IService<StResRainfall> { |
| | | } |
| | |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsBar; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsParams; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsPie; |
| | | import cn.gistack.sm.sjztmd.vo.TbDykeInvestigationParam; |
| | | import cn.gistack.sm.sjztmd.vo.TbResGeneralInvestigationParam; |
| | | import cn.gistack.sm.sjztmd.vo.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.core.tool.api.R; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public interface ITbDykeInvestigationService extends IService<TbDykeInvestigation> { |
| | | |
| | | /** |
| | | * |
| | | * @param page |
| | | * @return |
| | | */ |
| | | List<String> downZip(IPage<ImageAndVideoVO> page,String type) throws IOException; |
| | | |
| | | /** |
| | | * 自定义保存或者修改对象方法 |
| | | * @param entity |
| | | * @return |
| | |
| | | StatisticsPie statisticsPie(StatisticsParams statisticsParams); |
| | | |
| | | List<StatisticsBar> statisticsBar(StatisticsParams statisticsParams); |
| | | |
| | | List<DyketionVO> downloadZipCopy(IPage<TbResDykeVO> page, String type,TbResDykeVO tbResDykeVO); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.service; |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.TbDykeUnitDanger; |
| | | import cn.gistack.sm.sjztmd.vo.TbDykeUnitDangerVO; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author AIX |
| | | * @Date 2024/6/28 14:02 |
| | | * @Version 1.0 |
| | | */ |
| | | public interface ITbDykeUnitDangerService extends IService<TbDykeUnitDanger> { |
| | | |
| | | List<TbDykeUnitDangerVO> listDykeUnitDanger(@Param("params") TbDykeUnitDangerVO dykeUnitDangerVO); |
| | | |
| | | } |
| | |
| | | package cn.gistack.sm.sjztmd.service; |
| | | |
| | | import cn.gistack.sm.sjztmd.dto.TbProjectDTO; |
| | | import cn.gistack.sm.sjztmd.dto.TbProjectIsfillDTO; |
| | | import cn.gistack.sm.sjztmd.entity.TbProject; |
| | | import cn.gistack.sm.sjztmd.excel.TbProjectExcel; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsParams; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsPie; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsTableProject; |
| | | import cn.gistack.sm.sjztmd.vo.StatisticsPrice; |
| | | import cn.gistack.sm.sjztmd.vo.StatisticsPriceVO; |
| | | import cn.gistack.sm.sjztmd.vo.TbProjectIsfillVO; |
| | | import cn.gistack.sm.sjztmd.vo.TbProjectVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.text.ParseException; |
| | | import java.util.List; |
| | | |
| | | public interface ITbProjectService extends IService<TbProject> { |
| | |
| | | List<StatisticsTableProject> getStatisticsTable(StatisticsParams statisticsParams); |
| | | |
| | | void importUser(List<TbProjectExcel> data, Boolean isCovered); |
| | | |
| | | boolean updatecheckState(String id,String checkState); |
| | | |
| | | StatisticsPrice statisticsPie(StatisticsParams statisticsParams); |
| | | |
| | | List<StatisticsPriceVO> statisticsBar(StatisticsParams statisticsParams); |
| | | |
| | | void updateallcheck() throws Exception; |
| | | |
| | | void updateFill(TbProjectIsfillDTO fil); |
| | | |
| | | TbProjectIsfillVO getfill(); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.service; |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.TbProject; |
| | | |
| | | import cn.gistack.sm.sjztmd.vo.ResAndDykeAll; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | public interface ITbResAndDykeAllService extends IService<TbProject> { |
| | | |
| | | List<ResAndDykeAll> getStatisticsTable(String code,String year); |
| | | } |
| | |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsParams; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsPie; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsTable; |
| | | import cn.gistack.sm.sjztmd.vo.AttResBaseGeneralInvestigationVO; |
| | | import cn.gistack.sm.sjztmd.vo.ImageAndVideoVO; |
| | | import cn.gistack.sm.sjztmd.vo.ResGentionVO; |
| | | import cn.gistack.sm.sjztmd.vo.TbResGeneralInvestigationParam; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.core.tool.api.R; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | List<StatisticsTable> statisticsTable(StatisticsParams statisticsParams); |
| | | |
| | | List<String> downZip(IPage<ImageAndVideoVO> page,String type) throws IOException; |
| | | |
| | | List<ResGentionVO> downZipCopy(IPage<AttResBaseGeneralInvestigationVO> page,String type,AttResBaseGeneralInvestigationVO attResBase); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.service; |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.YwFloodReportInfo; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | |
| | | /** |
| | | * @Author AIX |
| | | * @Date 2024/7/8 12:44 |
| | | * @Version 1.0 |
| | | */ |
| | | public interface IYwFloodReportInfoService extends BaseService<YwFloodReportInfo> { |
| | | YwFloodReportInfo getLatestReport(String oneDayBefore); |
| | | } |
| | |
| | | package cn.gistack.sm.sjztmd.service.impl; |
| | | |
| | | import cn.gistack.sm.intelligentCall.mapper.CallTaskMapper; |
| | | import cn.gistack.sm.sjztmd.constant.RainfallConstant; |
| | | 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.service.IRelResLabelService; |
| | | import cn.gistack.sm.sjztmd.vo.*; |
| | | import cn.gistack.system.feign.ISysClient; |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.JsonNode; |
| | | import cn.hutool.http.HttpRequest; |
| | | import cn.hutool.http.HttpResponse; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @ClassName AttResBaseServiceImpl |
| | |
| | | * @Date 2023/4/21 20:01 |
| | | * @Version 1.0 |
| | | */ |
| | | |
| | | @Slf4j |
| | | @Service |
| | | @DS("zt") |
| | | public class AttResBaseServiceImpl extends ServiceImpl<AttResBaseMapper, AttResBase> implements IAttResBaseService { |
| | | private static final ObjectMapper objectMapper = new ObjectMapper(); |
| | | |
| | | @Autowired |
| | | private CallTaskMapper callTaskMapper; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<AttResWithRainfall> getAttResByRainfall(String minRainfall, String maxRainfall, String dayIndex) { |
| | | if (StrUtil.isNotEmpty(dayIndex) && !Arrays.asList(0,1,2).contains(Integer.parseInt(dayIndex))) { |
| | | throw new ServiceException("无效的dayIndex"); |
| | | } |
| | | Double minRainfallDouble = null; |
| | | Double maxRainfallDouble = null; |
| | | if (StrUtil.isNotEmpty(minRainfall)) { |
| | | minRainfallDouble = Double.parseDouble(minRainfall); |
| | | } |
| | | if (StrUtil.isNotEmpty(minRainfall)) { |
| | | maxRainfallDouble = Double.parseDouble(maxRainfall); |
| | | } |
| | | // 调用气象预报服务接口 |
| | | String resJsonNodeStr; |
| | | try (HttpResponse httpResponse = HttpRequest.post(RainfallConstant.FORECAST_SERVICE_URL) |
| | | .header("Content-Type", "application/json") |
| | | .header("X-token", RainfallConstant.X_TOKEN) |
| | | .contentType("application/json") |
| | | .body(String.format(RainfallConstant.REQUEST_JSON_BODY, StrUtil.isEmpty(dayIndex) ? "0" : dayIndex)).execute()) { |
| | | JsonNode resJsonNode = objectMapper.readTree(httpResponse.body()); |
| | | resJsonNodeStr = resJsonNode.toString(); |
| | | } catch (Exception e) { |
| | | throw new ServiceException("调用气象预报服务接口失败,详情:" + e.getMessage()); |
| | | } |
| | | RainfallGridData gridData; |
| | | try { |
| | | gridData = objectMapper.readValue(resJsonNodeStr, RainfallGridData.class); |
| | | } catch (JsonProcessingException e) { |
| | | throw new ServiceException("转换降雨栅格数据失败,详情:" + e.getMessage()); |
| | | } |
| | | RainfallGridData.Data data = gridData.getData(); |
| | | String fileName = data.getFileName(); |
| | | RainfallGridData.GridInfo gridInfo = data.getGridInfo(); |
| | | List<List<Double>> gridDataList = data.getGridData(); |
| | | if (gridDataList == null || gridDataList.isEmpty()) { |
| | | log.warn("gridDataList为空!"); |
| | | return new ArrayList<>(); |
| | | } |
| | | // 获取网格信息 |
| | | int lonNum = gridInfo.getLonNum(); // 网格横向(经度) |
| | | double lonMax = gridInfo.getLonMax(); |
| | | double lonSpan = gridInfo.getLonSpan(); // 每个网格单元的经度跨度 |
| | | double latSpan = gridInfo.getLatSpan(); // 每个网格单元的纬度跨度 |
| | | double latMin = gridInfo.getLatMin(); // 网格的最小纬度 |
| | | double lonMin = gridInfo.getLonMin(); // 网格的最小经度 |
| | | double latMax = gridInfo.getLatMax(); |
| | | int latNum = gridInfo.getLatNum(); // 网格纵向(纬度) |
| | | |
| | | // 将网格数据转换为二维数组 |
| | | double[][] grid = new double[latNum][lonNum]; |
| | | for (int i = 0; i < latNum; i++) { |
| | | List<Double> row = gridDataList.get(i); |
| | | for (int j = 0; j < lonNum; j++) { |
| | | grid[i][j] = row.get(j); |
| | | } |
| | | } |
| | | |
| | | LambdaQueryWrapper<AttResBase> queryWrapper = Wrappers.<AttResBase>query().lambda(); |
| | | List<AttResBase> attResBases = baseMapper.selectList(queryWrapper); |
| | | List<AttResWithRainfall> attResWithRainfallList = new ArrayList<>(); |
| | | |
| | | for (AttResBase attResBase : attResBases) { |
| | | if (null == attResBase.getCenterLat() || attResBase.getCenterLong() == null) { |
| | | log.warn("过滤掉经度或者纬度为空的水库,水库名称:{}", attResBase.getName()); |
| | | continue; |
| | | } |
| | | // 横向索引(lonIndex):(站点的经度 - 网格最小经度) / 每个网格单元的经度跨度 |
| | | int lonIndex = (int) ((Double.parseDouble(attResBase.getCenterLong()) - lonMin) / lonSpan); |
| | | // 纵向索引(latIndex):(站点的纬度 - 网格最小纬度) / 每个网格单元的纬度跨度 |
| | | int latIndex = (int) ((Double.parseDouble(attResBase.getCenterLat()) - latMin) / latSpan); |
| | | if (lonIndex >= 0 && lonIndex < lonNum && latIndex >= 0 && latIndex < latNum) { |
| | | double rainfall = grid[latIndex][lonIndex]; |
| | | // 降雨量 <= 最小值的站点,都过滤掉, 降雨量为0除外 |
| | | if (null != minRainfallDouble && rainfall != 0 && rainfall <= minRainfallDouble) { |
| | | continue; |
| | | } |
| | | // 降雨量 > 最大值的站点,都过滤掉 |
| | | if (null != maxRainfallDouble && rainfall > maxRainfallDouble) { |
| | | continue; |
| | | } |
| | | AttResWithRainfall attResWithRainfall = new AttResWithRainfall(); |
| | | BeanUtil.copyProperties(attResBase, attResWithRainfall); |
| | | attResWithRainfall.setRainfall(String.valueOf(rainfall)); |
| | | attResWithRainfall.setFileName(fileName); |
| | | attResWithRainfallList.add(attResWithRainfall); |
| | | } else { |
| | | log.warn("水库 {} 超出栅格范围. 中心点经度: {}, 中心点纬度: {}", attResBase.getName(), |
| | | attResBase.getCenterLong(), attResBase.getCenterLat()); |
| | | } |
| | | } |
| | | return attResWithRainfallList; |
| | | } |
| | | |
| | | @Override |
| | | public int[] getAttResNumByRainfall(String dayIndex) { |
| | | List<AttResWithRainfall> attResByRainfall; |
| | | // 获取站点降雨量失败或者返回站点列表为空时,直接返回空数组 |
| | | try { |
| | | attResByRainfall = getAttResByRainfall(null, null, dayIndex); |
| | | } catch (Exception e) { |
| | | return RainfallConstant.EMPTY_ATT_RES_NUM_ARRAY; |
| | | } |
| | | if (attResByRainfall == null || attResByRainfall.isEmpty()) { |
| | | return RainfallConstant.EMPTY_ATT_RES_NUM_ARRAY; |
| | | } |
| | | // 降雨范围-站点数量 |
| | | Map<String, Integer> rainfallRangeAttResNumMap = attResByRainfall.stream() |
| | | .collect(Collectors.groupingBy(attResWithRainfall -> { |
| | | int rainfall = Integer.parseInt(attResWithRainfall.getRainfall()); |
| | | if (rainfall > 250) { |
| | | return "(250,+)"; |
| | | } else if (rainfall > 100) { |
| | | return "(100,250]"; |
| | | } else if (rainfall > 50) { |
| | | return "(50,100]"; |
| | | } else if (rainfall > 25) { |
| | | return "(25,50]"; |
| | | } else if (rainfall > 10) { |
| | | return "(10,25]"; |
| | | } else if (rainfall > 5) { |
| | | return "(5,10]"; |
| | | } else if (rainfall > 0.1) { |
| | | return "(0.1,5]"; |
| | | } else if (rainfall >= 0) { |
| | | return "[0,0.1]"; |
| | | } else { |
| | | throw new ServiceException("无效的降雨值:" + rainfall); |
| | | } |
| | | }, Collectors.collectingAndThen(Collectors.counting(), Long::intValue))); |
| | | int[] attResNumArray = new int[RainfallConstant.RAIN_FALL_RANGES.size()]; |
| | | for (int i = 0; i < RainfallConstant.RAIN_FALL_RANGES.size(); i++) { |
| | | String range = RainfallConstant.RAIN_FALL_RANGES.get(i); |
| | | attResNumArray[i] = rainfallRangeAttResNumMap.getOrDefault(range, 0); |
| | | } |
| | | return attResNumArray; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean updateResBaseByGuid(AttResBase attResBase) { |
| | | attResBase.setUpdateTime(DateUtil.now()); |
| | |
| | | AttResBaseVO attResBaseVO = attResBaseService.getCityCountyCodeByResGuid(res_cd); |
| | | if (null!= attResBaseVO) { |
| | | // 通过编号查询对应的人员 |
| | | List<PersonVO> cityPerson = baseMapper.getCityCountyPersonListByResGuid(attResBaseVO.getCityCode(), "sdglywuser", "市州水库管理业务人员"); |
| | | List<PersonVO> countyPerson = baseMapper.getCityCountyPersonListByResGuid(attResBaseVO.getCountyCode(), "qxglywuser", "区县水库管理业务人员"); |
| | | // 和 |
| | | personVOList.addAll(cityPerson); |
| | | personVOList.addAll(countyPerson); |
| | | List<PersonVO> personListByResGuid = baseMapper.getCityCountyPersonListByResGuid(attResBaseVO.getCountyCode(), attResBaseVO.getCityCode(), ""); |
| | | personVOList.addAll(personListByResGuid); |
| | | } |
| | | // 返回 |
| | | return personVOList; |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.service.impl; |
| | | |
| | | import cn.gistack.sm.sjztmd.constant.RainfallConstant; |
| | | import cn.gistack.sm.sjztmd.entity.StBdData; |
| | | import cn.gistack.sm.sjztmd.mapper.StBdDataMapper; |
| | | import cn.gistack.sm.sjztmd.service.IStBdDataService; |
| | | import cn.gistack.sm.sjztmd.vo.BdParsedContentVO; |
| | | import cn.gistack.sm.sjztmd.vo.StBdDataVO; |
| | | import cn.gistack.sm.sjztmd.vo.StBdVO; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.nio.charset.Charset; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | @DS("zt") |
| | | public class StBdDataServiceImpl extends ServiceImpl<StBdDataMapper, StBdData> implements IStBdDataService { |
| | | |
| | | private final SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | |
| | | private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); |
| | | |
| | | @Override |
| | | public Boolean insertData(StBdDataVO stBdDataVO) throws Exception { |
| | | List<StBdDataVO.CommInfo> commInfos = stBdDataVO.getCommInfos(); |
| | | if (null == commInfos || commInfos.isEmpty()) { |
| | | throw new ServiceException("获取北斗平台数据失败,无效的commInfos"); |
| | | } |
| | | List<StBdData> stBdDataList = new ArrayList<>(); |
| | | for (StBdDataVO.CommInfo commInfo : commInfos) { |
| | | StBdData stBdData = new StBdData(); |
| | | stBdData.setId(UUID.randomUUID().toString().replaceAll("-", "")); |
| | | stBdData.setTm(formatter.parse(commInfo.getTime())); |
| | | stBdData.setCreateTime(new Date()); |
| | | stBdData.setFromAddr(commInfo.getFromAddr()); |
| | | stBdData.setToAddr(commInfo.getToAddr()); |
| | | String content = commInfo.getContent(); |
| | | stBdData.setContent(content); |
| | | BdParsedContentVO parsedContentVO = parseContent(content); |
| | | if (!parsedContentVO.getSuccess()) { |
| | | log.warn("解析content失败, parsedContentVO : {}", parsedContentVO); |
| | | } |
| | | stBdData.setParsedContent(parsedContentVO.getParsedContent()); |
| | | stBdData.setLongitude(parsedContentVO.getLongitude()); |
| | | stBdData.setLatitude(parsedContentVO.getLatitude()); |
| | | stBdData.setAltitude(parsedContentVO.getAltitude()); |
| | | boolean containsChinese = parsedContentVO.isContainChinese(); |
| | | stBdData.setCodeType(containsChinese? RainfallConstant.CONTAINS_CHINESE : RainfallConstant.NOT_CONTAINS_CHINESE); |
| | | stBdDataList.add(stBdData); |
| | | } |
| | | this.saveBatch(stBdDataList); |
| | | return true; |
| | | } |
| | | |
| | | private BdParsedContentVO parseContent(String content) { |
| | | BdParsedContentVO bdParsedContentVO = new BdParsedContentVO(); |
| | | bdParsedContentVO.setContainChinese(false); |
| | | bdParsedContentVO.setSuccess(false); |
| | | if (StrUtil.isEmpty(content)) { |
| | | bdParsedContentVO.setErrorMessage("无效的content"); |
| | | return bdParsedContentVO; |
| | | } |
| | | |
| | | // 信息类型 |
| | | StringBuilder contentSb = new StringBuilder(content); |
| | | String infoType = contentSb.substring(0, 2); |
| | | |
| | | if (!"91".equals(infoType)) { |
| | | bdParsedContentVO.setErrorMessage("报文信息类型不是91,无法解析"); |
| | | return bdParsedContentVO; |
| | | } |
| | | |
| | | // 接受者手机号 |
| | | Long phoneNumber = Long.parseLong(contentSb.substring(2, 12), 16); |
| | | |
| | | String formattedDate = formatter.format(new Date(1000L * Long.parseLong(contentSb.substring(12, 20), 16))); |
| | | |
| | | // 经度 |
| | | String longitude = new BigDecimal(Long.parseLong(contentSb.substring(20, 28), 16)) |
| | | .divide(new BigDecimal(1000000), 6, RoundingMode.HALF_UP).toString(); |
| | | |
| | | // 纬度 |
| | | String latitude = new BigDecimal(Long.parseLong(contentSb.substring(28, 36), 16)) |
| | | .divide(new BigDecimal(1000000), 6 ,RoundingMode.HALF_UP).toString(); |
| | | |
| | | // 海拔 |
| | | String altitude = String.valueOf(Integer.parseInt(contentSb.substring(36, 40), 16)); |
| | | |
| | | // 短信内容解析 |
| | | String textMessage = hexStr2Str(contentSb.substring(40, content.length())); |
| | | |
| | | // 是否包含中文 |
| | | bdParsedContentVO.setContainChinese(contentIsContainChinese(textMessage)); |
| | | |
| | | JSONObject dataObject = new JSONObject(); |
| | | dataObject.put("phone", phoneNumber); |
| | | dataObject.put("time", formattedDate); |
| | | dataObject.put("longitude", longitude); |
| | | dataObject.put("latitude", latitude); |
| | | dataObject.put("altitude", altitude); |
| | | dataObject.put("message", textMessage); |
| | | bdParsedContentVO.setParsedContent(dataObject.toString()); |
| | | bdParsedContentVO.setLongitude(longitude); |
| | | bdParsedContentVO.setLatitude(latitude); |
| | | bdParsedContentVO.setAltitude(altitude); |
| | | bdParsedContentVO.setSuccess(true); |
| | | return bdParsedContentVO; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<StBdData> selectAlarmRecordPage(Query query, StBdVO stBdVO) { |
| | | LambdaQueryWrapper<StBdData> queryWrapper = Wrappers.<StBdData>query().lambda() |
| | | .eq(StrUtil.isNotEmpty(stBdVO.getCodeType()), StBdData::getCodeType, stBdVO.getCodeType()) |
| | | .eq(StrUtil.isNotEmpty(stBdVO.getFromAddr()), StBdData::getFromAddr, stBdVO.getFromAddr()) |
| | | .eq(StrUtil.isNotEmpty(stBdVO.getToAddr()), StBdData::getToAddr, stBdVO.getToAddr()) |
| | | .ge(stBdVO.getStartTime() != null, StBdData::getTm, stBdVO.getStartTime()) |
| | | .le(stBdVO.getEndTime() != null, StBdData::getTm, stBdVO.getEndTime()); |
| | | return page(Condition.getPage(query), queryWrapper); |
| | | } |
| | | |
| | | private boolean contentIsContainChinese(String content) { |
| | | if (content == null || content.isEmpty()) { |
| | | return false; |
| | | } |
| | | String chinesePattern = "[\u4e00-\u9fa5]"; |
| | | Pattern pattern = Pattern.compile(chinesePattern); |
| | | Matcher matcher = pattern.matcher(content); |
| | | return matcher.find(); |
| | | } |
| | | |
| | | public static String hexStr2Str(String hexStr) { |
| | | String str = "0123456789ABCDEF"; // 16进制能用到的所有字符 0-15 |
| | | char[] hexs = hexStr.toCharArray(); // toCharArray() 方法将字符串转换为字符数组。 |
| | | int length = (hexStr.length() / 2); // 1个byte数值 -> 两个16进制字符 |
| | | byte[] bytes = new byte[length]; |
| | | int n; |
| | | for (int i = 0; i < bytes.length; i++) { |
| | | int position = i * 2; //两个16进制字符 -> 1个byte数值 |
| | | n = str.indexOf(hexs[position]) * 16; |
| | | n += str.indexOf(hexs[position + 1]); |
| | | // 保持二进制补码的一致性 因为byte类型字符是8bit的 而int为32bit 会自动补齐高位1 所以与上0xFF之后可以保持高位一致性 |
| | | // 当byte要转化为int的时候,高的24位必然会补1,这样,其二进制补码其实已经不一致了,&0xff可以将高的24位置为0,低8位保持原样, |
| | | // 这样做的目的就是为了保证二进制数据的一致性。 |
| | | bytes[i] = (byte) (n & 0xff); |
| | | } |
| | | return new String(bytes, Charset.forName("GB18030")); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.service.impl; |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.StResRainfall; |
| | | import cn.gistack.sm.sjztmd.mapper.StResRainfallMapper; |
| | | import cn.gistack.sm.sjztmd.service.IStResRainfallService; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | @DS("zt") |
| | | public class StResRainfallServiceImpl extends ServiceImpl<StResRainfallMapper, StResRainfall> implements IStResRainfallService { |
| | | |
| | | } |
| | |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.*; |
| | | import cn.gistack.sm.sjztmd.mapper.TbDykeInvestigationMapper; |
| | | import cn.gistack.sm.sjztmd.mapper.TbResDykeMapper; |
| | | import cn.gistack.sm.sjztmd.mapper.TbResGeneralInvestigationMapper; |
| | | import cn.gistack.sm.sjztmd.service.*; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsBar; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsParams; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsPie; |
| | | import cn.gistack.sm.sjztmd.vo.TbDykeInvestigationParam; |
| | | import cn.gistack.sm.sjztmd.vo.TbResGeneralInvestigationParam; |
| | | import cn.gistack.sm.sjztmd.util.DownloadZipUtils; |
| | | import cn.gistack.sm.sjztmd.vo.*; |
| | | import com.alibaba.nacos.shaded.com.google.gson.Gson; |
| | | import com.alibaba.nacos.shaded.com.google.gson.JsonArray; |
| | | import com.alibaba.nacos.shaded.com.google.gson.JsonElement; |
| | | import com.alibaba.nacos.shaded.com.google.gson.JsonObject; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.val; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.text.DecimalFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @PROJECT_NAME: skjcmanager |
| | |
| | | |
| | | @Autowired |
| | | private IAttAdBaseService attAdBaseService; |
| | | |
| | | @Autowired |
| | | private TbResDykeMapper tbResDykeMapper; |
| | | |
| | | @Autowired |
| | | private HttpServletRequest request; |
| | | |
| | | // @Autowired |
| | | // private HttpServletResponse response; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | |
| | | entity.setTbStateId(state.getGuid()); |
| | | // return R.status(this.saveOrUpdate(entity)); |
| | | |
| | | // 如果有危害,设置危害长度只留一个 |
| | | if (entity.getHazardRating().equals("有危害")) { |
| | | QueryWrapper qw = new QueryWrapper(); |
| | | qw.eq("\"dyke_guid\"",entity.getDykeGuid()); |
| | | qw.eq("\"unit\"",entity.getUnit()); |
| | | long count = count(qw); |
| | | if (count > 0) { |
| | | entity.setDangerLength(0D); |
| | | } |
| | | } |
| | | |
| | | this.saveOrUpdate(entity); |
| | | return R.data(entity); |
| | | } |
| | |
| | | // delete.eq("\"tb_state_id\"",state.getGuid()); |
| | | // boolean remove = remove(delete); |
| | | |
| | | String lengStr = "";//处理危害长度问题 |
| | | for (int i = 0; i < list.size(); i++) { |
| | | TbDykeInvestigation tbDykeInvestigation = list.get(i); |
| | | //id清空方便批量新增 |
| | |
| | | |
| | | //设置状态表id |
| | | tbDykeInvestigation.setTbStateId(state.getGuid()); |
| | | |
| | | |
| | | //处理危害长度 |
| | | if (tbDykeInvestigation.getHazardRating().equals("有危害")) { |
| | | if (lengStr.indexOf(tbDykeInvestigation.getUnit()) > -1) { |
| | | tbDykeInvestigation.setDangerLength(0D); |
| | | } |
| | | } |
| | | |
| | | lengStr = lengStr + tbDykeInvestigation.getUnit(); |
| | | |
| | | } |
| | | |
| | | return R.status(saveOrUpdateBatch(list)); |
| | |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param page |
| | | * @return 操作状态 |
| | | */ |
| | | @Override |
| | | public List<String> downZip(IPage<ImageAndVideoVO> page,String type) throws IOException { |
| | | List<ImageAndVideoVO> iamgeAndVideoUrls; |
| | | if (type.equals("1")) { |
| | | iamgeAndVideoUrls = baseMapper.getIamgeAndVideoUrl(page); |
| | | }else { |
| | | iamgeAndVideoUrls = baseMapper.getIamgeAndVideoUrl(null); |
| | | } |
| | | |
| | | List<String> urls = new ArrayList<>(); |
| | | for (ImageAndVideoVO iamgeAndVideoUrl : iamgeAndVideoUrls) { |
| | | urls.add(iamgeAndVideoUrl.getImagesUrl()); |
| | | urls.add(iamgeAndVideoUrl.getVideosUrl()); |
| | | } |
| | | List<String> urlss = DownloadZipUtils.getUrls(urls); |
| | | if (urlss.isEmpty()) { |
| | | return null; |
| | | } |
| | | // }else { |
| | | // // 打印提取的URLs |
| | | // for (String url1 : urlss) { |
| | | // DownloadZipUtils.downloadFile(url1); |
| | | // } |
| | | // DownloadZipUtils.downloadZip(request, response,0); |
| | | return urlss; |
| | | } |
| | | |
| | | @Override |
| | | public List<DyketionVO> downloadZipCopy(IPage<TbResDykeVO> page,String type,TbResDykeVO tbResDykeVO) { |
| | | //获取已审批的数据 |
| | | List<DyketionVO> iamgeAndVideoUrlcopy = baseMapper.getIamgeAndVideoUrlcopy(); |
| | | |
| | | |
| | | for (DyketionVO dyketionVO : iamgeAndVideoUrlcopy) { |
| | | List<String> urls = new ArrayList<>(); |
| | | List<DyketionallVO> dyketionallVOS = new ArrayList<>(); |
| | | if(dyketionVO.getImagesUrl() != null){ |
| | | urls.add(dyketionVO.getImagesUrl()); |
| | | } |
| | | if(dyketionVO.getVideosUrl() != null) { |
| | | urls.add(dyketionVO.getVideosUrl()); |
| | | } |
| | | |
| | | //解析json中url 放入list集合中 |
| | | List<String> urlss = DownloadZipUtils.getUrls(urls); |
| | | |
| | | int counter=1; |
| | | for (String s : urlss) { |
| | | DyketionallVO dyketionallVO = new DyketionallVO(); |
| | | dyketionallVO.setUrlname(dyketionVO.getDname()+"+"+dyketionVO.getRn()+String.format("%02d", counter++)+s.substring(s.length() - 4)); |
| | | dyketionallVO.setUrl(s); |
| | | dyketionallVOS.add(dyketionallVO); |
| | | } |
| | | dyketionVO.setDyketionallVOS(dyketionallVOS); |
| | | } |
| | | //分页情况下 |
| | | if(type.equals("1")){ |
| | | //获取分页信息 |
| | | // TbResDykeVO tbResDykeVO = new TbResDykeVO(); |
| | | // tbResDykeVO.setTbYear(2024); |
| | | List<TbResDykeVO> tbResDykeVOIPage = tbResDykeMapper.findTbResDykePcBy(page, tbResDykeVO); |
| | | |
| | | List<String> dykeCode = new ArrayList<>(); |
| | | for (TbResDykeVO imageAndVideoVO : tbResDykeVOIPage) { |
| | | dykeCode.add(imageAndVideoVO.getGuid()); |
| | | } |
| | | List<DyketionVO> iamgeAndVideoUrls = iamgeAndVideoUrlcopy.stream() |
| | | .filter(dyketionVO -> dykeCode.contains(dyketionVO.getCode())) |
| | | .collect(Collectors.toList()); |
| | | |
| | | return iamgeAndVideoUrls; |
| | | } |
| | | |
| | | |
| | | return iamgeAndVideoUrlcopy; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.service.impl; |
| | | |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.TbDykeUnitDanger; |
| | | import cn.gistack.sm.sjztmd.mapper.TbDykeUnitDangerMapper; |
| | | import cn.gistack.sm.sjztmd.service.ITbDykeUnitDangerService; |
| | | import cn.gistack.sm.sjztmd.vo.TbDykeUnitDangerVO; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author AIX |
| | | * @Date 2024/6/28 14:04 |
| | | * @Version 1.0 |
| | | */ |
| | | @Service |
| | | @DS("zt") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class TbDykeUnitDangerServiceImpl extends ServiceImpl<TbDykeUnitDangerMapper, TbDykeUnitDanger> implements ITbDykeUnitDangerService { |
| | | |
| | | @Override |
| | | public List<TbDykeUnitDangerVO> listDykeUnitDanger(TbDykeUnitDangerVO dykeUnitDangerVO) { |
| | | return baseMapper.listDykeUnitDanger(dykeUnitDangerVO); |
| | | } |
| | | |
| | | } |
| | |
| | | package cn.gistack.sm.sjztmd.service.impl; |
| | | |
| | | import cn.gistack.sm.sjztmd.dto.TbProjectDTO; |
| | | import cn.gistack.sm.sjztmd.dto.TbProjectIsfillDTO; |
| | | import cn.gistack.sm.sjztmd.entity.AttAdBase; |
| | | import cn.gistack.sm.sjztmd.entity.TbProject; |
| | | import cn.gistack.sm.sjztmd.entity.TbProjectSchedule; |
| | | import cn.gistack.sm.sjztmd.excel.TbProjectExcel; |
| | | import cn.gistack.sm.sjztmd.mapper.TbProjectMapper; |
| | | import cn.gistack.sm.sjztmd.service.IAttAdBaseService; |
| | | import cn.gistack.sm.sjztmd.service.IAttResBaseService; |
| | | 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.StatisticsPie; |
| | | 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.StatisticsPrice; |
| | | import cn.gistack.sm.sjztmd.vo.StatisticsPriceVO; |
| | | import cn.gistack.sm.sjztmd.vo.TbProjectIsfillVO; |
| | | import cn.gistack.sm.sjztmd.vo.TbProjectVO; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | 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 java.math.BigDecimal; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | |
| | | |
| | | private final ITbProjectScheduleService tbProjectScheduleService; |
| | | private final IAttResBaseService attResBaseService; |
| | | @Autowired |
| | | private IAttAdBaseService iAttAdBaseService; |
| | | |
| | | @Override |
| | | public Object getList(TbProjectVO tbProjectVO, IPage<TbProjectVO> page) { |
| | |
| | | |
| | | tbProjectDTO.setUpdateUser(AuthUtil.getUserId().toString()); |
| | | tbProjectDTO.setUpdateTime(DateUtil.now()); |
| | | if(tbProjectDTO.getIsFill().equals("0")){ |
| | | tbProjectDTO.setCheckState("0"); |
| | | }else if(tbProjectDTO.getIsFill().equals("1")){ |
| | | tbProjectDTO.setCheckState("1"); |
| | | } |
| | | //更新项目表 |
| | | boolean update = updateById(tbProjectDTO); |
| | | |
| | |
| | | tbProject.setUpdateTime(DateUtil.now()); |
| | | |
| | | updateById(tbProject); |
| | | }else { |
| | | } else { |
| | | //无数据,新增 |
| | | TbProject save = new TbProject(); |
| | | save.setUpdateUser(AuthUtil.getUserId().toString()); |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | | public boolean updatecheckState(String id,String checkState) { |
| | | TbProject tbProject = getById(id); |
| | | if(checkState.equals("0")){ |
| | | tbProject.setIsFill(checkState); |
| | | } |
| | | tbProject.setCheckState(checkState); |
| | | return saveOrUpdate(tbProject); |
| | | } |
| | | |
| | | @Override |
| | | public StatisticsPrice statisticsPie(StatisticsParams statisticsParams) { |
| | | |
| | | AttAdBase ywxtAdDetail = iAttAdBaseService.getYwxtAdDetail(statisticsParams.getAdCode()); |
| | | if (ywxtAdDetail.getAdGrad().equals("1")) { |
| | | StatisticsPrice statisticsPie =baseMapper.getStatisticsPie(statisticsParams); |
| | | return statisticsPie; |
| | | } |
| | | StatisticsPrice statisticsPie =baseMapper.getStatisticsPies(statisticsParams); |
| | | |
| | | return statisticsPie; |
| | | } |
| | | |
| | | @Override |
| | | public List<StatisticsPriceVO> statisticsBar(StatisticsParams statisticsParams) { |
| | | AttAdBase ywxtAdDetail = iAttAdBaseService.getYwxtAdDetail(statisticsParams.getAdCode()); |
| | | if (ywxtAdDetail.getAdGrad().equals("1")) { |
| | | List<StatisticsPriceVO> statisticsPieBar =baseMapper.getStatisticsPieBar(statisticsParams); |
| | | return statisticsPieBar; |
| | | } |
| | | List<StatisticsPriceVO> statisticsPieBar =baseMapper.getStatisticsPieBars(statisticsParams); |
| | | return statisticsPieBar; |
| | | } |
| | | |
| | | @Override |
| | | public void updateallcheck() throws Exception { |
| | | Date now = new Date(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String today = sdf.format(now); |
| | | |
| | | // 转换为年月格式,用于检查是否为月初 |
| | | String yearMonth = sdf.format(sdf.parse(today).getTime()).substring(0, 7); |
| | | // 检查当前日期是否为月初 |
| | | if (today.startsWith(yearMonth + "-01")) { |
| | | baseMapper.updateallcheck(); |
| | | } else { |
| | | System.out.println("不是月初,不予修改状态"); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void updateFill(TbProjectIsfillDTO fil) { |
| | | baseMapper.updateFill(fil); |
| | | } |
| | | |
| | | @Override |
| | | public TbProjectIsfillVO getfill() { |
| | | return baseMapper.getfill(); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.service.impl; |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.TbProject; |
| | | import cn.gistack.sm.sjztmd.mapper.TbResAndDykeAllMapper; |
| | | import cn.gistack.sm.sjztmd.service.ITbResAndDykeAllService; |
| | | |
| | | import cn.gistack.sm.sjztmd.vo.ResAndDykeAll; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | @DS("zt") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class TbResAndDykeAllServiceImpl extends ServiceImpl<TbResAndDykeAllMapper,TbProject> implements ITbResAndDykeAllService { |
| | | |
| | | @Autowired |
| | | private TbResAndDykeAllMapper tbResAndDykeAllMapper; |
| | | |
| | | @Override |
| | | public List<ResAndDykeAll> getStatisticsTable(String code,String year) { |
| | | return tbResAndDykeAllMapper.getStatisticsTable(code,year) ; |
| | | } |
| | | } |
| | |
| | | @Override |
| | | public IPage<TbResDykeVO> findTbResDykePcBy(IPage<TbResDykeVO> page, TbResDykeVO tbResDykeVO) { |
| | | |
| | | if (StringUtil.isNotBlank(tbResDykeVO.getAdCode())){ |
| | | //若行政区划不为空 |
| | | String adCode =tbResDykeVO.getAdCode(); |
| | | |
| | | if (adCode.substring(0,4).indexOf("00") > -1) { |
| | | //前四位包含00说明是湖北省 4200/00000000 |
| | | adCode =StringUtil.format("%{}%",adCode.substring(0,2)); |
| | | } else if (adCode.substring(0,6).indexOf("00") > -1) { |
| | | //前六位包含00说明是市级 420100/000000 |
| | | // adCode = paramAd.substring(0,4); |
| | | adCode =StringUtil.format("%{}%",adCode.substring(0,4)); |
| | | }else if (adCode.substring(0,8).indexOf("00") > -1){ |
| | | //前8位包含00 说明是区级 42011700/0000 |
| | | // adCode = paramAd.substring(0,6); |
| | | adCode =StringUtil.format("%{}%",adCode.substring(0,6)); |
| | | } |
| | | tbResDykeVO.setAdCode(adCode); |
| | | } |
| | | |
| | | |
| | | // if (StringUtil.isNotBlank(tbResDykeVO.getAdCode())){ |
| | | // //若行政区划不为空 |
| | | // String adCode =tbResDykeVO.getAdCode(); |
| | | // |
| | | // if (adCode.substring(0,4).indexOf("00") > -1) { |
| | | // //前四位包含00说明是湖北省 4200/00000000 |
| | | // adCode =StringUtil.format("%{}%",adCode.substring(0,2)); |
| | | // } else if (adCode.substring(0,6).indexOf("00") > -1) { |
| | | // //前六位包含00说明是市级 420100/000000 |
| | | //// adCode = paramAd.substring(0,4); |
| | | // adCode =StringUtil.format("%{}%",adCode.substring(0,4)); |
| | | // }else if (adCode.substring(0,8).indexOf("00") > -1){ |
| | | // //前8位包含00 说明是区级 42011700/0000 |
| | | //// adCode = paramAd.substring(0,6); |
| | | // adCode =StringUtil.format("%{}%",adCode.substring(0,6)); |
| | | // } |
| | | // tbResDykeVO.setAdCode(adCode); |
| | | // } |
| | | |
| | | if (tbResDykeVO.getIsPage()){ |
| | | return page.setRecords(baseMapper.findTbResDykePcBy(page,tbResDykeVO)); |
| | |
| | | package cn.gistack.sm.sjztmd.service.impl; |
| | | |
| | | import cn.gistack.sm.sjztmd.mapper.AttResBaseMapper; |
| | | import cn.gistack.sm.sjztmd.util.DownloadZipUtils; |
| | | import cn.gistack.sm.sjztmd.entity.TbResGeneralInvestigation; |
| | | import cn.gistack.sm.sjztmd.entity.TbResGeneralInvestigationState; |
| | | import cn.gistack.sm.sjztmd.mapper.TbResGeneralInvestigationMapper; |
| | |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsPie; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsTable; |
| | | import cn.gistack.sm.sjztmd.util.CalculateUtils; |
| | | import cn.gistack.sm.sjztmd.vo.TbResGeneralInvestigationParam; |
| | | import cn.gistack.sm.sjztmd.util.DownloadZipUtils; |
| | | import cn.gistack.sm.sjztmd.vo.*; |
| | | import com.alibaba.nacos.shaded.com.google.gson.Gson; |
| | | import com.alibaba.nacos.shaded.com.google.gson.JsonArray; |
| | | import com.alibaba.nacos.shaded.com.google.gson.JsonElement; |
| | | import com.alibaba.nacos.shaded.com.google.gson.JsonObject; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.val; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.text.DecimalFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @PROJECT_NAME: skjcmanager |
| | |
| | | |
| | | @Autowired |
| | | private ITbResGeneralInvestigationStateService tbResGeneralInvestigationStateService; |
| | | |
| | | @Autowired |
| | | private AttResBaseMapper attResBaseMapper; |
| | | |
| | | @Autowired |
| | | private HttpServletRequest request; |
| | | // @Autowired |
| | | // private HttpServletResponse response; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<String> downZip(IPage<ImageAndVideoVO> page,String type) throws IOException { |
| | | List<String> urls = new ArrayList<>(); |
| | | List<ImageAndVideoVO> iamgeAndVideoUrls; |
| | | if (type.equals("1")) { |
| | | iamgeAndVideoUrls = baseMapper.getIamgeAndVideoUrl(page); |
| | | }else { |
| | | iamgeAndVideoUrls = baseMapper.getIamgeAndVideoUrl(null); |
| | | } |
| | | |
| | | |
| | | |
| | | for (ImageAndVideoVO iamgeAndVideoUrl : iamgeAndVideoUrls) { |
| | | urls.add(iamgeAndVideoUrl.getImagesUrl()); |
| | | urls.add(iamgeAndVideoUrl.getVideosUrl()); |
| | | } |
| | | List<String> urlss =DownloadZipUtils.getUrls(urls); |
| | | if (urlss.isEmpty()) { |
| | | return null; |
| | | }else { |
| | | // 打印提取的URLs |
| | | // for (String url1 : urlss) { |
| | | // //System.out.println(url1+"ssss"); |
| | | // |
| | | // DownloadZipUtils.downloadFile(url1); |
| | | // } |
| | | //DownloadZipUtils.downloadZip(request, response,1); |
| | | return urlss; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<ResGentionVO> downZipCopy(IPage<AttResBaseGeneralInvestigationVO> page,String type,AttResBaseGeneralInvestigationVO attResBase) { |
| | | //获取已审批的数据 |
| | | List<ResGentionVO> iamgeAndVideoUrlcopy = baseMapper.getIamgeAndVideoUrlcopy(); |
| | | |
| | | |
| | | for (ResGentionVO resGentionVO : iamgeAndVideoUrlcopy) { |
| | | List<String> urls = new ArrayList<>(); |
| | | List<DyketionallVO> dyketionallVOS = new ArrayList<>(); |
| | | if(resGentionVO.getImagesUrls() != null){ |
| | | urls.add(resGentionVO.getImagesUrls()); |
| | | } |
| | | if(resGentionVO.getVideoUrls() != null) { |
| | | urls.add(resGentionVO.getVideoUrls()); |
| | | } |
| | | //解析json中url 放入list集合中 |
| | | List<String> urlss = DownloadZipUtils.getUrls(urls); |
| | | int counter=1; |
| | | for (String s : urlss) { |
| | | DyketionallVO dyketionallVO = new DyketionallVO(); |
| | | dyketionallVO.setUrlname(resGentionVO.getResname()+"+"+resGentionVO.getPpname()+"+"+resGentionVO.getRn()+String.format("%02d", counter++)+s.substring(s.length() - 4)); |
| | | dyketionallVO.setUrl(s); |
| | | dyketionallVOS.add(dyketionallVO); |
| | | } |
| | | resGentionVO.setDyketionallVOS(dyketionallVOS); |
| | | } |
| | | //分页情况下 |
| | | if(type.equals("1")){ |
| | | //获取分页信息 |
| | | // AttResBaseGeneralInvestigationVO attResBaseGeneralInvestigationVO = new AttResBaseGeneralInvestigationVO(); |
| | | // attResBaseGeneralInvestigationVO.setTbYear(2024); |
| | | List<AttResBaseGeneralInvestigationVO> attResBaseGeneralInvestigationVOS = attResBaseMapper.selectAttResBaseGeneralInvestigation(page, attResBase); |
| | | |
| | | List<String> resCode = new ArrayList<>(); |
| | | for (AttResBaseGeneralInvestigationVO imageAndVideoVO : attResBaseGeneralInvestigationVOS) { |
| | | resCode.add(imageAndVideoVO.getCode()); |
| | | } |
| | | List<ResGentionVO> iamgeAndVideoUrls = iamgeAndVideoUrlcopy.stream() |
| | | .filter(resGentionVO -> resCode.contains(resGentionVO.getCode())) |
| | | .collect(Collectors.toList()); |
| | | |
| | | return iamgeAndVideoUrls; |
| | | } |
| | | |
| | | return iamgeAndVideoUrlcopy; |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.service.impl; |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.YwFloodReportInfo; |
| | | import cn.gistack.sm.sjztmd.mapper.YwFloodReportInfoMapper; |
| | | import cn.gistack.sm.sjztmd.service.IYwFloodReportInfoService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @Author AIX |
| | | * @Date 2024/7/8 12:45 |
| | | * @Version 1.0 |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class YwFloodReportInfoServiceImpl extends BaseServiceImpl<YwFloodReportInfoMapper, YwFloodReportInfo> implements IYwFloodReportInfoService { |
| | | @Override |
| | | public YwFloodReportInfo getLatestReport(String oneDayBefore) { |
| | | return baseMapper.getLatestReport(oneDayBefore); |
| | | } |
| | | } |
| | |
| | | private int unInvestigationResNum; |
| | | //已校核座数 |
| | | private int checkResNum; |
| | | private int resMayiNum; |
| | | |
| | | //堤防座数 |
| | | private int dykeNum; |
| | |
| | | //堤防总长度 |
| | | private double dykeTotalLength; |
| | | |
| | | //堤防危害长度 |
| | | //堤防危害长度(根据审核通过状态) |
| | | private double dangerTotalLength; |
| | | //堤防填报长度(根据校核通过状态) |
| | | private double tbDykeLength; |
| | | |
| | | } |
| | |
| | | private String adCode; |
| | | |
| | | private String adName; |
| | | private String adGrad; |
| | | |
| | | private String padCode; |
| | | |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.util; |
| | | |
| | | import com.alibaba.nacos.shaded.com.google.gson.Gson; |
| | | import com.alibaba.nacos.shaded.com.google.gson.JsonArray; |
| | | import com.alibaba.nacos.shaded.com.google.gson.JsonElement; |
| | | import com.alibaba.nacos.shaded.com.google.gson.JsonObject; |
| | | import org.apache.commons.io.FileUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.*; |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | | import java.net.URLEncoder; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.zip.ZipEntry; |
| | | import java.util.zip.ZipOutputStream; |
| | | |
| | | |
| | | public class DownloadZipUtils { |
| | | //private static Logger logger = LoggerFactory.getLogger(Test.class); |
| | | /** |
| | | * 需要压缩的文件夹 |
| | | */ |
| | | private final static String downloadDir = "download"; |
| | | /** |
| | | * 打包后的文件夹 |
| | | */ |
| | | private final static String downloadZip = "downloadZip"; |
| | | |
| | | |
| | | public static HttpServletRequest request; |
| | | |
| | | public static HttpServletResponse response; |
| | | |
| | | /** |
| | | * |
| | | * @param urls |
| | | * @return 获取url |
| | | */ |
| | | |
| | | public static List<String> getUrls(List<String> urls){ |
| | | |
| | | List<String> urlss = new ArrayList<>(); |
| | | for (String url : urls) { |
| | | |
| | | Gson gson = new Gson(); |
| | | JsonArray jsonArray = gson.fromJson(url, JsonArray.class); |
| | | |
| | | //解析json数据提取ur |
| | | for (JsonElement element : jsonArray) { |
| | | JsonObject jsonObject = element.getAsJsonObject(); |
| | | String urlsss = jsonObject.get("url").getAsString(); |
| | | urlss.add(urlsss); |
| | | } |
| | | } |
| | | return urlss; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 通过图片url下载图片到指定文件夹 |
| | | * @param downloadUrl 图片url |
| | | */ |
| | | public static void downloadFile(String downloadUrl ) { |
| | | |
| | | |
| | | InputStream inputStream = null; |
| | | OutputStream outputStream = null; |
| | | try { |
| | | //获取连接 |
| | | URL url=new URL(downloadUrl); |
| | | HttpURLConnection connection=(HttpURLConnection)url.openConnection(); |
| | | //连接超时时间 |
| | | //connection.setConnectTimeout(3*1000); |
| | | //设置请求头 |
| | | //connection.setRequestProperty("User-Agent","Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36"); |
| | | //获取输入流 |
| | | inputStream=connection.getInputStream(); |
| | | //System.out.println("竟来了"); |
| | | File fileDir=new File(downloadDir); |
| | | if(!fileDir.exists()){//如果文件夹不存在 |
| | | fileDir.mkdir();//创建文件夹 |
| | | } |
| | | |
| | | //截取文件名称 |
| | | String filePath = downloadDir+"/" + downloadUrl.substring(downloadUrl.lastIndexOf("/")); |
| | | //System.out.println(filePath); |
| | | File file = new File(filePath); |
| | | file.createNewFile();//创建文件,存在覆盖 |
| | | |
| | | outputStream = new FileOutputStream(file); |
| | | int len = 0; |
| | | byte[] buf = new byte[16384]; |
| | | while ((len = inputStream.read(buf, 0, 16384)) != -1) { |
| | | outputStream.write(buf, 0, len); |
| | | } |
| | | outputStream.flush(); |
| | | } catch (Exception e) { |
| | | //logger.error("文件下载出错:" + e); |
| | | } finally { |
| | | try { |
| | | if (inputStream != null) { |
| | | inputStream.close(); |
| | | } |
| | | if (outputStream != null) { |
| | | outputStream.close(); |
| | | } |
| | | } catch (IOException e) { |
| | | //logger.error("关闭流出错:" + e); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 下载压缩包 |
| | | */ |
| | | public static void downloadZip(HttpServletRequest request, HttpServletResponse res,Integer logoType) throws IOException { |
| | | OutputStream out = null; |
| | | File zip = null; |
| | | String zipName; |
| | | try{ |
| | | //多个文件进行压缩,批量打包下载文件 |
| | | //创建压缩文件需要的空的zip包 |
| | | if (logoType==1) { |
| | | zipName="水库白蚁防治图片视频资料.zip"; |
| | | }else { |
| | | zipName="堤坝白蚁防治图片视频资料.zip"; |
| | | } |
| | | |
| | | String zipFilePath = downloadZip+File.separator+zipName; |
| | | |
| | | File fileDir=new File(downloadZip); |
| | | if(!fileDir.exists()){//如果文件夹不存在 |
| | | fileDir.mkdir();//创建文件夹 |
| | | } |
| | | |
| | | //压缩文件 |
| | | zip = new File(zipFilePath); |
| | | zip.createNewFile();//创建文件,存在覆盖 |
| | | |
| | | //创建zip文件输出流 |
| | | ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zip)); |
| | | zipFile(downloadDir, zos); |
| | | zos.close(); |
| | | |
| | | //将打包后的文件写到客户端,输出的方法同上,使用缓冲流输出 |
| | | BufferedInputStream bis = new BufferedInputStream(new FileInputStream(zipFilePath)); |
| | | byte[] buff = new byte[bis.available()]; |
| | | bis.read(buff); |
| | | bis.close(); |
| | | |
| | | //IO流实现下载的功能 |
| | | res.setCharacterEncoding("UTF-8"); //设置编码字符 |
| | | res.setContentType("application/json;charset=utf-8"); //设置下载内容类型application/octet-stream(二进制流,未知文件类型); |
| | | |
| | | //防止文件名乱码 |
| | | String userAgent = request.getHeader("USER-AGENT"); |
| | | if (userAgent.contains("Firefox") || userAgent.contains("firefox")) {//火狐浏览器 |
| | | zipName = new String(zipName.getBytes(), "ISO8859-1"); |
| | | } else { |
| | | zipName = URLEncoder.encode(zipName, "UTF-8");//其他浏览器 |
| | | } |
| | | |
| | | res.setHeader("Content-disposition", "attachment;filename="+zipName);//设置下载的压缩文件名称 |
| | | out = res.getOutputStream(); //创建页面返回方式为输出流,会自动弹出下载框 |
| | | out.write(buff);//输出数据文件 |
| | | //System.out.println("压缩包下载完成"); |
| | | }catch(Exception e) { |
| | | //logger.error("压缩包下载出错:" + e); |
| | | }finally { |
| | | if(out != null){ |
| | | out.flush();//释放缓存 |
| | | //out.close();//关闭输出流 |
| | | } |
| | | |
| | | //下载完后删除文件夹和压缩包 |
| | | File fileDir = new File(downloadDir); |
| | | FileUtils.deleteDirectory(fileDir); |
| | | |
| | | if(zip != null){ |
| | | zip.delete(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 压缩文件 |
| | | * @param filePath 需要压缩的文件夹 |
| | | * @param zos zip文件输出流 |
| | | */ |
| | | private static void zipFile(String filePath, ZipOutputStream zos) throws IOException { |
| | | File inputFile = new File(filePath); //根据文件路径创建文件 |
| | | if(inputFile.exists()) { //判断文件是否存在 |
| | | if (inputFile.isFile()) { //判断是否属于文件,还是文件夹 |
| | | //创建输入流读取文件 |
| | | BufferedInputStream bis = new BufferedInputStream(new FileInputStream(inputFile)); |
| | | |
| | | //将文件写入zip内,即将文件进行打包 |
| | | zos.putNextEntry(new ZipEntry(inputFile.getName())); |
| | | |
| | | //写入文件的方法,同上 |
| | | int size = 0; |
| | | byte[] buffer = new byte[16384]; //设置读取数据缓存大小 |
| | | while ((size = bis.read(buffer)) > 0) { |
| | | zos.write(buffer, 0, size); |
| | | } |
| | | //关闭输入输出流 |
| | | zos.closeEntry(); |
| | | bis.close(); |
| | | |
| | | } else { //如果是文件夹,则使用穷举的方法获取文件,写入zip |
| | | try { |
| | | File[] files = inputFile.listFiles(); |
| | | for (File fileTem:files) { |
| | | zipFile(fileTem.toString(),zos); |
| | | } |
| | | } catch (Exception e) { |
| | | //logger.error("压缩文件出错:" + e); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | private String tbQuarter;//填报季度 |
| | | |
| | | private String dangerLevel;//危害等级 |
| | | |
| | | //危害总普查长度 |
| | | private double totalLength; |
| | | |
| | |
| | | private String countyName; |
| | | private String townCode; |
| | | private String townName; |
| | | private String totalDanger;// 致险总处数 |
| | | private String totalDangerSr;// 渗漏总处数 |
| | | private String totalDangerCb;// 穿坝总处数 |
| | | private String totalDangerDw;// 跌窝总处数 |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.vo; |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.AttResBase; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class AttResWithRainfall extends AttResBase { |
| | | |
| | | @ApiModelProperty(value = "降雨量") |
| | | private String rainfall; |
| | | |
| | | @ApiModelProperty(value = "文件名称") |
| | | private String fileName; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class BdParsedContentVO { |
| | | |
| | | private Boolean success; |
| | | |
| | | private String errorMessage; |
| | | |
| | | private String parsedContent; |
| | | |
| | | private String longitude; |
| | | |
| | | private String latitude; |
| | | |
| | | private String altitude; |
| | | |
| | | private boolean containChinese; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.vo; |
| | | |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class DyketionVO { |
| | | |
| | | private String imagesUrl;//图片url |
| | | |
| | | private String videosUrl;//视频url |
| | | |
| | | private String code;//堤防编码 |
| | | private String tbYear;//年份 |
| | | private String dname;//堤防名称 |
| | | private String rn;//顺序 |
| | | private String adname;//区县 |
| | | private String padname;//市级单位 |
| | | |
| | | private List<DyketionallVO> dyketionallVOS; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.vo; |
| | | |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class DyketionallVO { |
| | | |
| | | |
| | | private String url;//下载地址 |
| | | |
| | | private String urlname;//文件名称 |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.vo; |
| | | |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ImageAndVideoVO { |
| | | |
| | | |
| | | private String dykeName; |
| | | |
| | | private String imagesUrl;//图片url |
| | | |
| | | private String videosUrl;//视频url |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class RainfallGridData { |
| | | private String code; |
| | | |
| | | private String msg; |
| | | |
| | | private Data data; |
| | | |
| | | @lombok.Data |
| | | public static class Data { |
| | | private String fileName; |
| | | |
| | | private GridInfo gridInfo; |
| | | |
| | | private List<List<Double>> gridData; |
| | | |
| | | } |
| | | |
| | | @lombok.Data |
| | | public static class GridInfo { |
| | | private int lonNum; |
| | | |
| | | private double lonMax; |
| | | |
| | | private double lonSpan; |
| | | |
| | | private double latSpan; |
| | | |
| | | private double latMin; |
| | | |
| | | private double lonMin; |
| | | |
| | | private double latMax; |
| | | |
| | | private int latNum; |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ResAndDykeAll { |
| | | |
| | | private String code; |
| | | |
| | | private String name; |
| | | |
| | | private String pcode; |
| | | |
| | | private String pname; |
| | | |
| | | private String adGrad; |
| | | |
| | | private int resNum; |
| | | |
| | | private int bigOneNum; |
| | | private int bigTwoNum; |
| | | private int bigThreeNum; |
| | | private int bigtOneNum; |
| | | private int bigtTwoNum; |
| | | private int bigtThreeNum; |
| | | private int midOneNum; |
| | | private int midTwoNum; |
| | | private int midThreeNum; |
| | | private int smallOneNum; |
| | | private int smallTwoNum; |
| | | private int smallThreeNum; |
| | | private int smalltOneNum; |
| | | private int smalltTwoNum; |
| | | private int smalltThreeNum; |
| | | |
| | | private double lengthSum; |
| | | private double levelOneLengthOne; |
| | | private double levelOneLengthTwo; |
| | | private double levelOneLengthThree; |
| | | private double levelTwoLengthOne; |
| | | private double levelTwoLengthTwo; |
| | | private double levelTwoLengthThree; |
| | | private double levelThreeLengthOne; |
| | | private double levelThreeLengthTwo; |
| | | private double levelThreeLengthThree; |
| | | private double levelFourLengthOne; |
| | | private double levelFourLengthTwo; |
| | | private double levelFourLengthThree; |
| | | private double levelFiveLengthOne; |
| | | private double levelFiveLengthTwo; |
| | | private double levelFiveLengthThree; |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.vo; |
| | | |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class ResGentionVO { |
| | | |
| | | private String resname; |
| | | private String code;//水库编码 |
| | | private String ppname;//部位名称 |
| | | private String years; //年份 |
| | | private String rn;//顺序 |
| | | private String imagesUrls; |
| | | private String videoUrls; |
| | | private String countyName; |
| | | private String cityName; |
| | | |
| | | private List<DyketionallVO> dyketionallVOS; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class StBdDataVO { |
| | | |
| | | private List<CommInfo> commInfos; |
| | | |
| | | @lombok.Data |
| | | public static class CommInfo { |
| | | |
| | | private String toAddr; |
| | | |
| | | private String content; |
| | | |
| | | private String time; |
| | | |
| | | private String fromAddr; |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.vo; |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.StBdData; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class StBdVO extends StBdData { |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | private String startTime; |
| | | |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | private String endTime; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.vo; |
| | | |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class StatisticsPrice { |
| | | |
| | | private int sumPrice; |
| | | |
| | | private int sumPay; |
| | | |
| | | private int noPay; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.vo; |
| | | |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class StatisticsPriceVO { |
| | | |
| | | private String adName; |
| | | |
| | | private String adCode; |
| | | |
| | | private int sumPrice; |
| | | |
| | | private int noPay; |
| | | |
| | | private int sumPay; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author AIX |
| | | * @Date 2024/6/28 15:07 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class TbDykeUnitDangerVO { |
| | | |
| | | private String dykeGuid;//提防id |
| | | private String unit;//提防单元 |
| | | private String dangerNum;//危害处数 |
| | | private String hdjxs;//活动迹象 |
| | | private String id;//危害等级评定id |
| | | private Integer dangerLevel;//危害等级评定 |
| | | private Double dangerLength;//危害长度 |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class TbProjectIsfillVO { |
| | | |
| | | private int isFil; |
| | | |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date stratTime; |
| | | |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date endTime; |
| | | } |
| | |
| | | |
| | | private String isPage; |
| | | |
| | | private String contractDateQuery; |
| | | |
| | | private String startTime; |
| | | private String endTime; |
| | |
| | | //三级危害普查长度 |
| | | private double thirdLength; |
| | | |
| | | private String dangerLevelQuery;//危害等级筛选 |
| | | |
| | | //危害总处数 |
| | | private int totalDangerNum; |
| | | |
| | |
| | | private String tbStateId; |
| | | |
| | | private String hasDanger; |
| | | |
| | | private String totalDanger;// 致险总处数 |
| | | private String totalDangerSr;// 渗漏总处数 |
| | | private String totalDangerCb;// 穿坝总处数 |
| | | private String totalDangerDw;// 跌窝总处数 |
| | | } |
| | |
| | | package cn.gistack.sm.sjztmd.word.controller; |
| | | |
| | | |
| | | |
| | | import cn.gistack.alerts.sms.feign.ISmsRecordClient; |
| | | import cn.gistack.alerts.sms.vo.SmsResultVO; |
| | | import cn.gistack.sm.intelligentCall.service.CallService; |
| | | import cn.gistack.sm.intelligentCall.vo.CallTaskResultVO; |
| | | import cn.gistack.sm.sjztmd.entity.YwFloodReportInfo; |
| | | import cn.gistack.sm.sjztmd.service.IYwFloodReportInfoService; |
| | | import cn.gistack.sm.sjztmd.util.MyDateUtils; |
| | | import cn.gistack.sm.sjztmd.word.service.ISjztmdService; |
| | | import cn.gistack.sm.sjztmd.word.util.BriefReportUtil; |
| | | import cn.gistack.sm.sjztmd.word.util.ExcelUtil; |
| | | import cn.gistack.sm.sjztmd.word.util.WordUtil; |
| | | import cn.gistack.sm.sjztmd.word.vo.*; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.deepoove.poi.XWPFTemplate; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springframework.core.io.InputStreamResource; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.http.ResponseEntity; |
| | |
| | | import java.io.*; |
| | | import java.net.URLEncoder; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | |
| | | private final ISjztmdService sjztmdService; |
| | | |
| | | private final ISmsRecordClient smsRecordClient; |
| | | |
| | | private final CallService callService; |
| | | |
| | | private final IYwFloodReportInfoService ywFloodReportInfoService; |
| | | |
| | | @GetMapping(value = "/getBriefReport") |
| | | public R getBriefReport() { |
| | | //获取总览、大中库、明细数据 |
| | |
| | | |
| | | @GetMapping("/download/{resGuid}") |
| | | public ResponseEntity genera(HttpServletResponse response, @PathVariable String resGuid) throws Exception { |
| | | HashMap<String,Object> obj = sjztmdService.getTbWordVO(resGuid); |
| | | HashMap<String, Object> obj = sjztmdService.getTbWordVO(resGuid); |
| | | |
| | | TbWordVO tbWordVO = (TbWordVO) obj.get("tbWordVO"); |
| | | Map<String,Object> tableMap= (Map<String, Object>) obj.get("tableMap"); |
| | | Map<String, Object> tableMap = (Map<String, Object>) obj.get("tableMap"); |
| | | |
| | | String fileName = resGuid + ".docx"; |
| | | byte[] data = WordUtil.compileTemplateAndRenderData(tbWordVO,tableMap); |
| | | byte[] data = WordUtil.compileTemplateAndRenderData(tbWordVO, tableMap); |
| | | |
| | | // 创建响应实体并设置响应头,将输出流作为响应体返回给客户端 |
| | | InputStreamResource resource = new InputStreamResource(new ByteArrayInputStream(data)); |
| | |
| | | } |
| | | |
| | | @GetMapping("/download/overFloodInfo") |
| | | public ResponseEntity overFloodInfo(String isShow) throws Exception{ |
| | | public ResponseEntity overFloodInfo(String isShow) throws Exception { |
| | | String time = new SimpleDateFormat("yyyy日MM月dd日HH时").format(new Date()); |
| | | String fileName = time+ "报汛文件.docx"; |
| | | String fileName = time + "报汛文件.docx"; |
| | | String fileNameURL = URLEncoder.encode(fileName, "UTF-8"); |
| | | //获取总览、大中库、明细数据 |
| | | List<TotalInfo> totalList = sjztmdService.getTotalInfo(isShow); |
| | |
| | | List<OverDetail> overDetailList = sjztmdService.getOverDetailInfo(isShow); |
| | | List<SzInfo> szInfoList = sjztmdService.getSzInfo(isShow); |
| | | |
| | | HashMap<String,String> over10Params = new HashMap<>(); |
| | | //短信预警数量 |
| | | SmsResultVO vo = new SmsResultVO(); |
| | | // 获取当前日期 |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | // 获取前一天日期 |
| | | LocalDateTime oneDayBefore = now.minusDays(1); |
| | | // 格式化日期并打印 |
| | | // 定义日期时间格式,包含年-月-日 时:分:秒 |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | vo.setStartTime(oneDayBefore.format(formatter)); |
| | | vo.setEndTime(now.format(formatter)); |
| | | vo.setSmsType("2"); |
| | | vo.setResCode("0"); |
| | | vo.setIsExport(1); |
| | | List<SmsResultVO> dxyjList = smsRecordClient.smsSuccessList(vo); |
| | | |
| | | //外呼统计 |
| | | DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | CallTaskResultVO callTaskResult = new CallTaskResultVO(); |
| | | callTaskResult.setStartTime(oneDayBefore.format(formatter2)); |
| | | callTaskResult.setEndTime(now.format(formatter2)); |
| | | List<CallTaskResultVO> whtjList = (List<CallTaskResultVO>) callService.getCallResultListTemp(null, callTaskResult); |
| | | |
| | | 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", "0.1"); |
| | | over10Params.put("mid_start_stag", "0.1"); |
| | | over10Params.put("big_start_stag", "0.1"); |
| | | |
| | | HashMap<String,String> normalParams = new HashMap<>(); |
| | | 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 |
| | | normalParams.put("small_start_stag", "0"); |
| | | normalParams.put("mid_start_stag", "0"); |
| | | normalParams.put("big_start_stag", "0"); |
| | | |
| | | |
| | | List<TotalInfo> totalOverList = sjztmdService.getTotalOverInfo(isShow,normalParams); |
| | | List<TotalInfo> totalOver10List = sjztmdService.getTotalOverInfo(isShow,over10Params); |
| | | byte[] data = null; |
| | | if (MyDateUtils.isTodayInFloodSeason()){ |
| | | data = WordUtil.GetOverInfo(totalList,dzkList,overDetailList,szInfoList); |
| | | }else { |
| | | data= WordUtil.GetNotInSeasonOverInfo(totalList,dzkList,overDetailList,szInfoList,totalOverList,totalOver10List); |
| | | List<TotalInfo> totalOverList = sjztmdService.getTotalOverInfo(isShow, normalParams); |
| | | List<TotalInfo> totalOver10List = sjztmdService.getTotalOverInfo(isShow, over10Params); |
| | | |
| | | //昨日报汛内容 |
| | | YwFloodReportInfo ywFloodReportInfo = ywFloodReportInfoService.getLatestReport(oneDayBefore.format(formatter2)); |
| | | |
| | | byte[] data = null; |
| | | if (MyDateUtils.isTodayInFloodSeason()) { |
| | | data = WordUtil.GetOverInfo(totalList, dzkList, overDetailList, szInfoList, dxyjList, whtjList, ywFloodReportInfo); |
| | | } else { |
| | | data = WordUtil.GetNotInSeasonOverInfo(totalList, dzkList, overDetailList, szInfoList, totalOverList, totalOver10List); |
| | | |
| | | } |
| | | // 创建响应实体并设置响应头,将输出流作为响应体返回给客户端 |
| | |
| | | } |
| | | |
| | | @GetMapping("/download/getOverFloodInfoExcel") |
| | | public void getOverFloodInfoExcel(HttpServletResponse response,String isShow) throws Exception { |
| | | public void getOverFloodInfoExcel(HttpServletResponse response, String isShow) throws Exception { |
| | | |
| | | //获取总览、大中库、明细数据 |
| | | List<TotalInfo> totalList = sjztmdService.getTotalInfo(isShow); |
| | | List<DzkInfo> dzkList = sjztmdService.getDzkInfo(isShow); |
| | | List<OverDetail> overDetailList = sjztmdService.getOverDetailInfo(isShow); |
| | | |
| | | ExcelUtil.generateExcel(response,totalList,dzkList,overDetailList); |
| | | ExcelUtil.generateExcel(response, totalList, dzkList, overDetailList); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.word.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * @Author AIX |
| | | * @Date 2024/7/18 11:51 |
| | | * @Version 1.0 |
| | | */ |
| | | @Getter |
| | | public enum DamBodyTypeEnum { |
| | | /** |
| | | * value: "1", |
| | | * label: "截水槽", |
| | | * value: "2", |
| | | * label: "不完全截水槽", |
| | | * value: "3", |
| | | * label: "混凝土防渗墙", |
| | | * value: "4", |
| | | * label: "板桩", |
| | | * value: "5", |
| | | * label: "粘土铺盖", |
| | | * value: "6", |
| | | * label: "灌浆帷幕", |
| | | * value: "7", |
| | | * label: "混凝土沉井", |
| | | * value: "10", |
| | | * label: "粘土心墙", |
| | | * value: "9", |
| | | * label: "其他", |
| | | * value: "8", |
| | | * label: "无", |
| | | */ |
| | | |
| | | JSC("1","截水槽"), |
| | | DSC("2","不完全截水槽"), |
| | | HNTFSQ("3","混凝土防渗墙"), |
| | | BZ("4","板桩"), |
| | | ZTPG("5","粘土铺盖"), |
| | | GJWM("6","灌浆帷幕"), |
| | | HNTCJ("7","混凝土沉井"), |
| | | NONE("8","无"), |
| | | OTHER("9","其他"), |
| | | ZTXQ("10","粘土心墙"), |
| | | |
| | | NULL_ABLE("-1",""); |
| | | |
| | | String key; |
| | | |
| | | String label; |
| | | DamBodyTypeEnum(String key, String label) { |
| | | this.key = key; |
| | | this.label = label; |
| | | } |
| | | |
| | | public static DamBodyTypeEnum find(String key) { |
| | | return Arrays.stream(values()).filter(resFucEnum -> resFucEnum.key.equals(key)).findAny().orElse(NULL_ABLE); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | public static PlantLayoutTypeEnum find(String key) { |
| | | return Arrays.stream(values()).filter(resFucEnum -> resFucEnum.key == key).findAny().orElse(NULL_ABLE); |
| | | return Arrays.stream(values()).filter(resFucEnum -> resFucEnum.key.equals(key)).findAny().orElse(NULL_ABLE); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | public static SpillwayTypeEnum find(String key) { |
| | | return Arrays.stream(values()).filter(resFucEnum -> resFucEnum.key==key).findAny().orElse(NULL_ABLE); |
| | | return Arrays.stream(values()).filter(resFucEnum -> resFucEnum.key.equals(key)).findAny().orElse(NULL_ABLE); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | public static VerSpillwayTypeEnum find(String key) { |
| | | return Arrays.stream(values()).filter(resFucEnum -> resFucEnum.key==key).findAny().orElse(NULL_ABLE); |
| | | return Arrays.stream(values()).filter(resFucEnum -> resFucEnum.key.equals(key)).findAny().orElse(NULL_ABLE); |
| | | } |
| | | |
| | | } |
| | |
| | | List<StationExport> getOsmotic(HttpServletResponse response, StationParams params, String exportFunc); |
| | | |
| | | List<TotalInfo> getTotalOverInfo(String isShow, HashMap<String, String> over10Params); |
| | | |
| | | void getReservoirRainfallForecast(List<String> dayIndexList); |
| | | } |
| | |
| | | |
| | | import cn.gistack.common.utils.SpringContextUtil; |
| | | import cn.gistack.sm.sjztmd.entity.*; |
| | | import cn.gistack.sm.sjztmd.vo.AttResWithRainfall; |
| | | import cn.gistack.sm.sjztmd.vo.StationExport; |
| | | import cn.gistack.sm.sjztmd.vo.ZtResultInfo; |
| | | import cn.gistack.sm.sjztmd.vo.StationParams; |
| | |
| | | import cn.gistack.sm.sjztmd.service.*; |
| | | import cn.gistack.sm.sjztmd.word.enums.*; |
| | | import cn.gistack.sm.sjztmd.word.service.ISjztmdService; |
| | | import cn.gistack.sm.sjztmd.word.util.WordUtil; |
| | | import cn.gistack.sm.sjztmd.word.vo.*; |
| | | import cn.gistack.sm.sjztods.constant.ZtApiUrlConstant; |
| | | import cn.gistack.sm.sjztods.constant.ZtConfigConstant; |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.parser.Feature; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.tool.utils.ObjectUtil; |
| | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | private final SjztMdMapper mapper; |
| | | |
| | | private final IAttResBaseService attResBase; |
| | | private final ITbAttResBaseService attResBaseService; |
| | | private final ITbAttResStagCharService attResStagCharService; |
| | | private final ITbAttResWaterDeliveryService attResWaterDeliveryService; |
| | |
| | | private final ITbAttResWaterBlockService attResWaterBlockService; |
| | | private final ITbAttResRsbNorspiService attResRsbNorspiService; |
| | | private final ITbAttResPowerStationService attResPowerStationService; |
| | | |
| | | private final IStResRainfallService stResRainfallService; |
| | | private final ITbAttResProjectUtilizeService attResProjectUtilizeService; |
| | | private final ITbAttResInformationProjectService attResInformationProjectService; |
| | | |
| | |
| | | } |
| | | tableMap.put("resFunc", resFunc); |
| | | //水文特征 |
| | | tableMap.put("conArea", tbAttResStagChar==null?"":tbAttResStagChar.getConArea()); |
| | | tableMap.put("moyearRainAvg", tbAttResStagChar==null?"":tbAttResStagChar.getMoyearRainAvg()); |
| | | tableMap.put("moyearFlAvg", tbAttResStagChar==null?"":tbAttResStagChar.getMoyearFlAvg()); |
| | | tableMap.put("downWacoSafeDisc", tbAttResStagChar==null?"":tbAttResStagChar.getDownWacoSafeDisc()); |
| | | tableMap.put("desFlSta", tbAttResStagChar==null?"":tbAttResStagChar.getDesFlSta()); |
| | | tableMap.put("desFlFlow", tbAttResStagChar==null?"":tbAttResStagChar.getDesFlFlow()); |
| | | tableMap.put("desFl1dayCap", tbAttResStagChar==null?"":tbAttResStagChar.getDesFl1dayCap()); |
| | | tableMap.put("desFl3dayCap", tbAttResStagChar==null?"":tbAttResStagChar.getDesFl3dayCap()); |
| | | tableMap.put("checFlSta", tbAttResStagChar==null?"":tbAttResStagChar.getChecFlSta()); |
| | | tableMap.put("checFlFlow", tbAttResStagChar==null?"":tbAttResStagChar.getChecFlFlow()); |
| | | tableMap.put("checFl1dayCap", tbAttResStagChar==null?"":tbAttResStagChar.getChecFl1dayCap()); |
| | | tableMap.put("checFl3dayCap", tbAttResStagChar==null?"":tbAttResStagChar.getChecFl3dayCap()); |
| | | tableMap.put("conArea", tbAttResStagChar==null || tbAttResStagChar.getConArea()==null?"": WordUtil.removeTrailingZero(tbAttResStagChar.getConArea().toString())); |
| | | tableMap.put("moyearRainAvg", tbAttResStagChar==null || tbAttResStagChar.getMoyearRainAvg()==null?"":WordUtil.removeTrailingZero(tbAttResStagChar.getMoyearRainAvg().toString())); |
| | | tableMap.put("moyearFlAvg", tbAttResStagChar==null || tbAttResStagChar.getMoyearFlAvg()==null?"":WordUtil.removeTrailingZero(tbAttResStagChar.getMoyearFlAvg().toString())); |
| | | tableMap.put("downWacoSafeDisc", tbAttResStagChar==null || tbAttResStagChar.getDownWacoSafeDisc()==null?"":WordUtil.removeTrailingZero(tbAttResStagChar.getDownWacoSafeDisc().toString())); |
| | | tableMap.put("desFlSta", tbAttResStagChar==null || tbAttResStagChar.getDesFlSta()==null?"":tbAttResStagChar.getDesFlSta()); |
| | | tableMap.put("desFlFlow", tbAttResStagChar==null || tbAttResStagChar.getDesFlFlow()==null?"":WordUtil.removeTrailingZero(tbAttResStagChar.getDesFlFlow().toString())); |
| | | tableMap.put("desFl1dayCap", tbAttResStagChar==null || tbAttResStagChar.getDesFl1dayCap()==null?"":WordUtil.removeTrailingZero(tbAttResStagChar.getDesFl1dayCap().toString())); |
| | | tableMap.put("desFl3dayCap", tbAttResStagChar==null || tbAttResStagChar.getDesFl3dayCap()==null?"":WordUtil.removeTrailingZero(tbAttResStagChar.getDesFl3dayCap().toString())); |
| | | tableMap.put("checFlSta", tbAttResStagChar==null || tbAttResStagChar.getChecFlSta()==null?"":tbAttResStagChar.getChecFlSta()); |
| | | tableMap.put("checFlFlow", tbAttResStagChar==null || tbAttResStagChar.getChecFlFlow()==null?"":WordUtil.removeTrailingZero(tbAttResStagChar.getChecFlFlow().toString())); |
| | | tableMap.put("checFl1dayCap", tbAttResStagChar==null || tbAttResStagChar.getChecFl1dayCap()==null?"":WordUtil.removeTrailingZero(tbAttResStagChar.getChecFl1dayCap().toString())); |
| | | tableMap.put("checFl3dayCap", tbAttResStagChar==null || tbAttResStagChar.getChecFl3dayCap()==null?"":WordUtil.removeTrailingZero(tbAttResStagChar.getChecFl3dayCap().toString())); |
| | | |
| | | //水库特征 |
| | | tableMap.put("adjustProp", tbAttResStagChar==null?"":AdjustPropEnum.find(tbAttResStagChar.getAdjustProp()).getLabel()); |
| | | tableMap.put("checFlStag", tbAttResStagChar==null?"":tbAttResStagChar.getChecFlStag()); |
| | | tableMap.put("totalCap", tbAttResStagChar==null?"":tbAttResStagChar.getTotalCap()); |
| | | tableMap.put("desFlStag", tbAttResStagChar==null?"":tbAttResStagChar.getDesFlStag()); |
| | | tableMap.put("flprCap", tbAttResStagChar==null?"":tbAttResStagChar.getFlprCap()); |
| | | tableMap.put("flConTopStag", tbAttResStagChar==null?"":tbAttResStagChar.getFlConTopStag()); |
| | | tableMap.put("flSortCap", tbAttResStagChar==null?"":tbAttResStagChar.getFlStorCap()); |
| | | tableMap.put("corNormStag", tbAttResStagChar==null?"":tbAttResStagChar.getCorNormStag()); |
| | | tableMap.put("adjustStorCap", tbAttResStagChar==null?"":tbAttResStagChar.getAdjustStorCap()); |
| | | tableMap.put("deadStag", tbAttResStagChar==null?"":tbAttResStagChar.getDeadStag()); |
| | | tableMap.put("deadCap", tbAttResStagChar==null?"":tbAttResStagChar.getDeadCap()); |
| | | tableMap.put("beforeFloodStag", tbAttResStagChar==null?"":tbAttResStagChar.getBeforeFloodStag()); |
| | | tableMap.put("midFloodStag", tbAttResStagChar==null?"":tbAttResStagChar.getMidFloodStag()); |
| | | tableMap.put("afterFloodStag", tbAttResStagChar==null?"":tbAttResStagChar.getAfterFloodStag()); |
| | | tableMap.put("adjustProp", tbAttResStagChar==null || tbAttResStagChar.getAdjustProp()==null?"":AdjustPropEnum.find(tbAttResStagChar.getAdjustProp()).getLabel()); |
| | | tableMap.put("checFlStag", tbAttResStagChar==null || tbAttResStagChar.getChecFlStag()==null?"":tbAttResStagChar.getChecFlStag()); |
| | | tableMap.put("totalCap", tbAttResStagChar==null || tbAttResStagChar.getTotalCap()==null?"":WordUtil.removeTrailingZero(tbAttResStagChar.getTotalCap().toString())); |
| | | tableMap.put("desFlStag", tbAttResStagChar==null || tbAttResStagChar.getDesFlStag()==null?"":tbAttResStagChar.getDesFlStag()); |
| | | tableMap.put("flprCap", tbAttResStagChar==null || tbAttResStagChar.getFlprCap()==null?"":WordUtil.removeTrailingZero(tbAttResStagChar.getFlprCap().toString())); |
| | | tableMap.put("flConTopStag", tbAttResStagChar==null || tbAttResStagChar.getFlConTopStag()==null?"":tbAttResStagChar.getFlConTopStag()); |
| | | tableMap.put("flSortCap", tbAttResStagChar==null || tbAttResStagChar.getFlStorCap()==null?"":tbAttResStagChar.getFlStorCap()); |
| | | tableMap.put("corNormStag", tbAttResStagChar==null || tbAttResStagChar.getCorNormStag()==null?"":String.format("%.2f",tbAttResStagChar.getCorNormStag())); |
| | | tableMap.put("adjustStorCap", tbAttResStagChar==null || tbAttResStagChar.getAdjustStorCap()==null?"":WordUtil.removeTrailingZero(tbAttResStagChar.getAdjustStorCap().toString())); |
| | | tableMap.put("deadStag", tbAttResStagChar==null || tbAttResStagChar.getDeadStag()==null?"":String.format("%.2f",tbAttResStagChar.getDeadStag())); |
| | | tableMap.put("deadCap", tbAttResStagChar==null || tbAttResStagChar.getDeadCap()==null?"":WordUtil.removeTrailingZero(tbAttResStagChar.getDeadCap().toString())); |
| | | tableMap.put("beforeFloodStag", tbAttResStagChar==null || tbAttResStagChar.getBeforeFloodStag()==null?"":String.format("%.2f",tbAttResStagChar.getBeforeFloodStag())); |
| | | tableMap.put("midFloodStag", tbAttResStagChar==null || tbAttResStagChar.getMidFloodStag()==null?"":String.format("%.2f",tbAttResStagChar.getMidFloodStag())); |
| | | tableMap.put("afterFloodStag", tbAttResStagChar==null || tbAttResStagChar.getAfterFloodStag()==null?"":String.format("%.2f",tbAttResStagChar.getAfterFloodStag())); |
| | | |
| | | //new SimpleDateFormat("yyyy年MM月").format(tbAttResBase.getStartTime()); |
| | | |
| | |
| | | tableMap.put("midFloodEnd", mfe); |
| | | tableMap.put("afterFloodStart", afs); |
| | | tableMap.put("afterFloodEnd", afe); |
| | | tableMap.put("desFloodFlow", tbAttResStagChar==null?"":tbAttResStagChar.getDesFloodFlowMax()); |
| | | tableMap.put("checFloodFlowMax", tbAttResStagChar==null?"":tbAttResStagChar.getChecFloodFlowMax()); |
| | | tableMap.put("desFloodFlowMax", tbAttResStagChar==null || tbAttResStagChar.getDesFloodFlowMax()==null?"":tbAttResStagChar.getDesFloodFlowMax()); |
| | | tableMap.put("checFloodFlowMax", tbAttResStagChar==null || tbAttResStagChar.getChecFloodFlowMax()==null?"":tbAttResStagChar.getChecFloodFlowMax()); |
| | | |
| | | String mainDamType = ""; |
| | | String mainDamMainFoundation = ""; |
| | |
| | | |
| | | mainDamType = DamTypeEnum.find(tbAttResWaterBlock.getDamType()).getLabel(); |
| | | mainDamMainFoundation = tbAttResWaterBlock.getDamMainFoundation(); |
| | | mainDamTopElevation = isNullObject(tbAttResWaterBlock.getDamTopElevation()); |
| | | mainDamTopElevation = StringUtil.isBlank(isNullObject(tbAttResWaterBlock.getDamTopElevation()))?"":String.format("%.2f",tbAttResWaterBlock.getDamTopElevation()); |
| | | mainDamHeight = isNullObject(tbAttResWaterBlock.getDamHeight()); |
| | | mainDamTopLength = isNullObject(tbAttResWaterBlock.getDamTopLength()); |
| | | mainDamWidth = isNullObject(tbAttResWaterBlock.getDamWidth()); |
| | | mainIsTraffic = tbAttResWaterBlock.getIsTraffic(); |
| | | mainWaveWallTopElevation = isNullObject(tbAttResWaterBlock.getWaveWallTopElevation()); |
| | | mainWaveWallTopElevation = StringUtil.isBlank(isNullObject(tbAttResWaterBlock.getWaveWallTopElevation()))?"":String.format("%.2f",tbAttResWaterBlock.getWaveWallTopElevation()); |
| | | mainUpDamProtectType = convertType(tbAttResWaterBlock.getUpDamProtectType(), "Explain"); |
| | | mainDownDamProtectType = convertType(tbAttResWaterBlock.getDownDamProtectType(), "Explain"); |
| | | damMainBodyType = convertType(tbAttResWaterBlock.getDamMainBodyType(), "Explain"); |
| | | damMainBodyTopElevation = isNullObject(tbAttResWaterBlock.getDamTopElevation()); |
| | | damMainDrainType = convertType(tbAttResWaterBlock.getDamMainDrainType(), "Explain"); |
| | | mainDamBodyType = convertType(isNullObject(tbAttResWaterBlock.getDamBodyType()), "Explain"); |
| | | mainDamBodyType = DamBodyTypeEnum.find(convertType(isNullObject(tbAttResWaterBlock.getDamBodyType()), "Explain")).getLabel(); |
| | | |
| | | //副坝 |
| | | subDamNum = isNullObject(tbAttResWaterBlock.getSubDamNum()); |
| | |
| | | String workingGateType = ""; |
| | | String deliverOc = ""; |
| | | |
| | | if (tbAttResWaterDeliveryList != null && tbAttResWaterDeliveryList.size() > 0 && tbAttResWaterDeliveryList.get(0).getNum() > 0) { |
| | | //取设计流量大的进行描述 |
| | | // List<TbAttResWaterDelivery> sortList = tbAttResWaterDeliveryList.stream().sorted((a, b) -> b.getDesignFlow().compareTo(a.getDesignFlow())).collect(Collectors.toList()); |
| | | List<TbAttResWaterDelivery> sortList = |
| | | tbAttResWaterDeliveryList.stream() |
| | | .sorted((a, b) -> { |
| | | Optional<Double> flowA = Optional.ofNullable(a.getDesignFlow()); |
| | | Optional<Double> flowB = Optional.ofNullable(b.getDesignFlow()); |
| | | return flowA.isPresent() && flowB.isPresent() ? flowA.get().compareTo(flowB.get()) : (flowA.isPresent() ? 1 : (flowB.isPresent() ? -1 : 0)); |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | |
| | | TbAttResWaterDelivery tbAttResWaterDelivery = sortList.get(0); |
| | | tableMap.put("输水建筑物名称1", "输水建筑物"); |
| | | tableMap.put("输水建筑物名称2", "输水建筑物"); |
| | | tableMap.put("输水建筑物名称3", "输水建筑物"); |
| | | |
| | | for (int i = 0; i < tbAttResWaterDeliveryList.size(); i++) { |
| | | TbAttResWaterDelivery tbAttResWaterDelivery = tbAttResWaterDeliveryList.get(i); |
| | | |
| | | aqueductType = convertType(tbAttResWaterDelivery.getAqueductType(), "AqueductTypeEnum"); |
| | | aqueductLength = isNullObject(tbAttResWaterDelivery.getAqueductLength()); |
| | | thresholdElevation = isNullObject(tbAttResWaterDelivery.getThresholdElevation()); |
| | | exportElevation = isNullObject(tbAttResWaterDelivery.getExportElevation()); |
| | | deliverSection = StringUtil.format("{}×{}", tbAttResWaterDelivery.getSectionWide(), tbAttResWaterDelivery.getSectionHigh()); |
| | | if (null != tbAttResWaterDelivery.getSectionHigh()) |
| | | deliverSection = StringUtil.format("{}×{}", tbAttResWaterDelivery.getSectionWide(), tbAttResWaterDelivery.getSectionHigh()); |
| | | else |
| | | deliverSection = StringUtil.format("φ{}", tbAttResWaterDelivery.getSectionWide()); |
| | | designFlow = isNullObject(tbAttResWaterDelivery.getDesignFlow()); |
| | | workingGateType = tbAttResWaterDelivery.getWorkingGateType(); |
| | | List<String> list = new ArrayList<>(); |
| | | list.add(tbAttResWaterDelivery.getOcType()); |
| | | list.add(tbAttResWaterDelivery.getOcPower()); |
| | | deliverOc = String.join(",", list); |
| | | } |
| | | tableMap.put("aqueductType", aqueductType); |
| | | tableMap.put("aqueductLength", aqueductLength); |
| | | tableMap.put("thresholdElevation", thresholdElevation); |
| | | tableMap.put("exportElevation", exportElevation); |
| | | tableMap.put("deliverSection", deliverSection); |
| | | tableMap.put("designFlow", designFlow); |
| | | tableMap.put("workingGateType", workingGateType); |
| | | tableMap.put("deliverOc", deliverOc); |
| | | |
| | | if (i == 0) { |
| | | tableMap.put("输水建筑物名称1", StringUtil.isBlank(tbAttResWaterDelivery.getName())?"输水建筑物":tbAttResWaterDelivery.getName()); |
| | | tableMap.put("aqueductType1", aqueductType); |
| | | tableMap.put("aqueductLength1", aqueductLength); |
| | | tableMap.put("thresholdElevation1", thresholdElevation); |
| | | tableMap.put("exportElevation1", exportElevation); |
| | | tableMap.put("deliverSection1", deliverSection); |
| | | tableMap.put("designFlow1", designFlow); |
| | | tableMap.put("workingGateType1", workingGateType); |
| | | tableMap.put("deliverOc1", deliverOc); |
| | | } |
| | | else if (i == 1) { |
| | | tableMap.put("输水建筑物名称2", StringUtil.isBlank(tbAttResWaterDelivery.getName())?"输水建筑物":tbAttResWaterDelivery.getName()); |
| | | tableMap.put("aqueductType2", aqueductType); |
| | | tableMap.put("aqueductLength2", aqueductLength); |
| | | tableMap.put("thresholdElevation2", thresholdElevation); |
| | | tableMap.put("exportElevation2", exportElevation); |
| | | tableMap.put("deliverSection2", deliverSection); |
| | | tableMap.put("designFlow2", designFlow); |
| | | tableMap.put("workingGateType2", workingGateType); |
| | | tableMap.put("deliverOc2", deliverOc); |
| | | } |
| | | else if (i == 3) { |
| | | tableMap.put("输水建筑物名称3", StringUtil.isBlank(tbAttResWaterDelivery.getName())?"输水建筑物":tbAttResWaterDelivery.getName()); |
| | | tableMap.put("aqueductType3", aqueductType); |
| | | tableMap.put("aqueductLength3", aqueductLength); |
| | | tableMap.put("thresholdElevation3", thresholdElevation); |
| | | tableMap.put("exportElevation3", exportElevation); |
| | | tableMap.put("deliverSection3", deliverSection); |
| | | tableMap.put("designFlow3", designFlow); |
| | | tableMap.put("workingGateType3", workingGateType); |
| | | tableMap.put("deliverOc", deliverOc); |
| | | } |
| | | } |
| | | |
| | | // if (tbAttResWaterDeliveryList != null && tbAttResWaterDeliveryList.size() > 0 && tbAttResWaterDeliveryList.get(0).getNum() > 0) { |
| | | // //取设计流量大的进行描述 2024-07-18取消,修改为展示3个列表 ,没有空着 |
| | | //// List<TbAttResWaterDelivery> sortList = tbAttResWaterDeliveryList.stream().sorted((a, b) -> b.getDesignFlow().compareTo(a.getDesignFlow())).collect(Collectors.toList()); |
| | | //// List<TbAttResWaterDelivery> sortList = |
| | | //// tbAttResWaterDeliveryList.stream() |
| | | //// .sorted((a, b) -> { |
| | | //// Optional<Double> flowA = Optional.ofNullable(a.getDesignFlow()); |
| | | //// Optional<Double> flowB = Optional.ofNullable(b.getDesignFlow()); |
| | | //// return flowA.isPresent() && flowB.isPresent() ? flowA.get().compareTo(flowB.get()) : (flowA.isPresent() ? 1 : (flowB.isPresent() ? -1 : 0)); |
| | | //// }) |
| | | //// .collect(Collectors.toList()); |
| | | // |
| | | // TbAttResWaterDelivery tbAttResWaterDelivery = tbAttResWaterDeliveryList.get(0); |
| | | // |
| | | // aqueductType = convertType(tbAttResWaterDelivery.getAqueductType(), "AqueductTypeEnum"); |
| | | // aqueductLength = isNullObject(tbAttResWaterDelivery.getAqueductLength()); |
| | | // thresholdElevation = isNullObject(tbAttResWaterDelivery.getThresholdElevation()); |
| | | // exportElevation = isNullObject(tbAttResWaterDelivery.getExportElevation()); |
| | | // deliverSection = StringUtil.format("{}×{}", tbAttResWaterDelivery.getSectionWide(), tbAttResWaterDelivery.getSectionHigh()); |
| | | // designFlow = isNullObject(tbAttResWaterDelivery.getDesignFlow()); |
| | | // workingGateType = tbAttResWaterDelivery.getWorkingGateType(); |
| | | // List<String> list = new ArrayList<>(); |
| | | // list.add(tbAttResWaterDelivery.getOcType()); |
| | | // list.add(tbAttResWaterDelivery.getOcPower()); |
| | | // deliverOc = String.join(",", list); |
| | | // |
| | | // tableMap.put("输水建筑物名称1", StringUtil.isBlank(tbAttResWaterDelivery.getName())?"输水建筑物":tbAttResWaterDelivery.getName()); |
| | | // |
| | | // } |
| | | |
| | | //水电站 |
| | | String plantLayoutType = ""; |
| | | String installedCapacity = ""; |
| | | double installedCapacity = 0d; |
| | | String yearAvgHour = ""; |
| | | //当电站列表不为空 且 电站列表数量大于0 且num大于0 |
| | | if (tbAttResPowerStationList != null && tbAttResPowerStationList.size() > 0 && tbAttResPowerStationList.get(0).getNum()!=null && tbAttResPowerStationList.get(0).getNum() > 0) { |
| | | TbAttResPowerStation tbAttResPowerStation = tbAttResPowerStationList.get(0); |
| | | //当电站列表不为空 且 电站列表数量大于0 且num大于0 -- 2024-07-18修改,展示多个 |
| | | // if (tbAttResPowerStationList != null && tbAttResPowerStationList.size() > 0 && tbAttResPowerStationList.get(0).getNum()!=null && tbAttResPowerStationList.get(0).getNum() > 0) { |
| | | // TbAttResPowerStation tbAttResPowerStation = tbAttResPowerStationList.get(0); |
| | | // |
| | | // //取第一个电站 |
| | | // plantLayoutType = PlantLayoutTypeEnum.find(tbAttResPowerStation.getPlantLayoutType()).getLabel(); |
| | | // installedCapacity = isNullObject(tbAttResPowerStation.getInstalledCapacity()); |
| | | // yearAvgHour = isNullObject(tbAttResPowerStation.getYearAvgHour()); |
| | | // } |
| | | |
| | | //取第一个电站 |
| | | plantLayoutType = PlantLayoutTypeEnum.find(tbAttResPowerStation.getPlantLayoutType()).getLabel(); |
| | | installedCapacity = isNullObject(tbAttResPowerStation.getInstalledCapacity()); |
| | | yearAvgHour = isNullObject(tbAttResPowerStation.getYearAvgHour()); |
| | | for (int i=0;i < tbAttResPowerStationList.size(); i++) { |
| | | TbAttResPowerStation tbAttResPowerStation = tbAttResPowerStationList.get(i); |
| | | if (StringUtil.isBlank(plantLayoutType)) { |
| | | plantLayoutType = PlantLayoutTypeEnum.find(tbAttResPowerStation.getPlantLayoutType()).getLabel(); |
| | | } else { |
| | | plantLayoutType = plantLayoutType + "、" + PlantLayoutTypeEnum.find(tbAttResPowerStation.getPlantLayoutType()).getLabel(); |
| | | } |
| | | |
| | | installedCapacity = installedCapacity + tbAttResPowerStation.getInstalledCapacity(); |
| | | |
| | | if (StringUtil.isBlank(yearAvgHour)) { |
| | | yearAvgHour = WordUtil.removeTrailingZero(isNullObject(tbAttResPowerStation.getYearAvgHour())); |
| | | } else { |
| | | yearAvgHour = yearAvgHour + "、" + WordUtil.removeTrailingZero(isNullObject(tbAttResPowerStation.getYearAvgHour())); |
| | | } |
| | | } |
| | | |
| | | tableMap.put("plantLayoutType", plantLayoutType); |
| | | tableMap.put("installedCapacity", installedCapacity); |
| | | tableMap.put("installedCapacity", WordUtil.removeTrailingZero(installedCapacity + "")); |
| | | tableMap.put("yearAvgHour", yearAvgHour); |
| | | |
| | | //水库效益 |
| | | List<String> protectList = new ArrayList<>(); |
| | | |
| | | if (null != tbAttResEngBene) { |
| | | |
| | | } |
| | | |
| | | if (tbAttResEngBene!=null &&!tbAttResEngBene.getCity().equals("无") ) { |
| | | protectList.add(tbAttResEngBene.getCity()); |
| | |
| | | tableMap.put("checIrrArea", tbAttResEngBene==null?"":tbAttResEngBene.getChecIrrArea()==null?"":String.format("%.2f", tbAttResEngBene.getChecIrrArea() / 10000)); |
| | | tableMap.put("supplyObject", tbAttResEngBene==null?"":tbAttResEngBene.getSupplyObject()==null?"":tbAttResEngBene.getSupplyObject()); |
| | | |
| | | Double sup = 0.0; |
| | | String supS = ""; |
| | | if (tbAttResEngBene!=null && StringUtil.isNotBlank(tbAttResEngBene.getSupplyPopulation())) { |
| | | sup = Double.parseDouble(tbAttResEngBene.getSupplyPopulation()) / 10000; |
| | | supS = String.format("%.2f", sup); |
| | | } |
| | | // Double sup = 0.0; |
| | | // String supS = ""; |
| | | // if (tbAttResEngBene!=null && StringUtil.isNotBlank(tbAttResEngBene.getSupplyPopulation())) { |
| | | // sup = Double.parseDouble(tbAttResEngBene.getSupplyPopulation()); |
| | | // supS = String.format("%.2f", sup); |
| | | // } |
| | | |
| | | |
| | | tableMap.put("supplyPopulation", supS); |
| | | tableMap.put("supplyPopulation", tbAttResEngBene.getSupplyPopulation()); |
| | | tableMap.put("moyearSupplyAvg", tbAttResEngBene==null?"":tbAttResEngBene.getMoyearSupplyAvg()==null?"":tbAttResEngBene.getMoyearSupplyAvg()); |
| | | tableMap.put("moyearPowerAvg", tbAttResEngBene==null?"":tbAttResEngBene.getMoyearPowerAvg()==null?"":tbAttResEngBene.getMoyearPowerAvg()); |
| | | tableMap.put("ecologicalFlow", tbAttResEngBene==null?"":tbAttResEngBene.getEcologicalFlow()==null?"":tbAttResEngBene.getEcologicalFlow()); |
| | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void getReservoirRainfallForecast(List<String> dayIndexList) { |
| | | List<StResRainfall> stResRainfalls = new ArrayList<>(); |
| | | for (String dayIndex : dayIndexList) { |
| | | List<AttResWithRainfall> attResByRainfall = attResBase.getAttResByRainfall(null, null, dayIndex); |
| | | for (AttResWithRainfall attResWithRainfall : attResByRainfall) { |
| | | StResRainfall stResRainfall = new StResRainfall(); |
| | | stResRainfall.setId(UUID.randomUUID().toString().replaceAll("-", "")); |
| | | stResRainfall.setResCd(attResWithRainfall.getCode()); |
| | | stResRainfall.setDrp(attResWithRainfall.getRainfall()); |
| | | stResRainfall.setFileName(attResWithRainfall.getFileName()); |
| | | stResRainfall.setDayIndex(dayIndex); |
| | | stResRainfall.setCreateTime(new Date()); |
| | | stResRainfalls.add(stResRainfall); |
| | | } |
| | | } |
| | | if (!stResRainfalls.isEmpty()) { |
| | | stResRainfallService.remove(Wrappers.<StResRainfall>query().lambda()); |
| | | stResRainfallService.saveBatch(stResRainfalls); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<DzkInfo> getDzkInfo(String isShow) { |
| | |
| | | package cn.gistack.sm.sjztmd.word.util; |
| | | |
| | | import cn.gistack.alerts.sms.vo.SmsResultVO; |
| | | import cn.gistack.sm.intelligentCall.vo.CallTaskResultVO; |
| | | import cn.gistack.sm.sjztmd.entity.YwFloodReportInfo; |
| | | import cn.gistack.sm.sjztmd.util.MyDateUtils; |
| | | import cn.gistack.sm.sjztmd.word.vo.*; |
| | | import com.deepoove.poi.XWPFTemplate; |
| | |
| | | */ |
| | | public class WordUtil { |
| | | |
| | | public static byte[] compileTemplateAndRenderData(TbWordVO tbWordVO,Map<String,Object> tableMap) throws Exception { |
| | | public static byte[] compileTemplateAndRenderData(TbWordVO tbWordVO, Map<String, Object> tableMap) throws Exception { |
| | | InputStream inputStream = WordUtil.class.getClassLoader().getResourceAsStream("word/doc/skcgmb.docx"); |
| | | ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
| | | XWPFTemplate template = XWPFTemplate.compile(inputStream).render(createParams(tbWordVO,tableMap)); |
| | | XWPFTemplate template = XWPFTemplate.compile(inputStream).render(createParams(tbWordVO, tableMap)); |
| | | template.write(outputStream); |
| | | outputStream.flush(); |
| | | outputStream.close(); |
| | | return outputStream.toByteArray(); |
| | | } |
| | | |
| | | /** |
| | | * 去除小数位为0的 |
| | | * @param num |
| | | * @return |
| | | */ |
| | | public static String removeTrailingZero(String num) { |
| | | // 检查是否包含小数点 |
| | | if (num.contains(".")) { |
| | | // 分割整数和小数部分 |
| | | String[] parts = num.split("\\."); |
| | | if (parts.length == 2) { |
| | | // 去除小数部分末尾的0,并检查是否仅剩下小数点(例如"123.") |
| | | String decimalPart = parts[1].replaceAll("0+$", "").replaceAll("^\\.$", ""); |
| | | // 如果小数部分处理后为空,则返回整数部分;否则拼接整数和小数部分 |
| | | return decimalPart.isEmpty() ? parts[0] : parts[0] + "." + decimalPart; |
| | | } |
| | | } |
| | | // 如果不包含小数点或处理失败,则返回原字符串 |
| | | return num; |
| | | } |
| | | |
| | | /** |
| | | * 根据水库id获取数据 |
| | | * |
| | | * @return |
| | | */ |
| | | private static Map<String, Object> createParams(TbWordVO tbWordVO,Map<String,Object> tableMap) { |
| | | private static Map<String, Object> createParams(TbWordVO tbWordVO, Map<String, Object> tableMap) { |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("水库名称", tbWordVO.getResName()); |
| | | params.put("市", tbWordVO.getCityName()); |
| | |
| | | params.put("河流名称", tbWordVO.getLocRvName()); |
| | | params.put("水库功能", tbWordVO.getResFuncText()); |
| | | params.put("调节性能", tbWordVO.getAdjustPropText()); |
| | | params.put("水库坝址以上控制流域面积", tbWordVO.getConArea()); |
| | | params.put("流域多年平均降雨量", tbWordVO.getMoyearRainAvg()); |
| | | params.put("多年平均年径流量", tbWordVO.getMoyearFlAvg()); |
| | | params.put("水库坝址以上控制流域面积", removeTrailingZero(tbWordVO.getConArea())); |
| | | params.put("流域多年平均降雨量", removeTrailingZero(tbWordVO.getMoyearRainAvg())); |
| | | params.put("多年平均年径流量", removeTrailingZero(tbWordVO.getMoyearFlAvg())); |
| | | params.put("设计洪水标准", tbWordVO.getDesFlSta()); |
| | | params.put("校核洪水标准", tbWordVO.getChecFlSta()); |
| | | params.put("总库容", tbWordVO.getTotalCap()); |
| | | params.put("总库容", removeTrailingZero(tbWordVO.getTotalCap())); |
| | | params.put("水文特征", tbWordVO.getHydrologicalCharacteristics()); |
| | | params.put("工程等别", tbWordVO.getEngGrad()); |
| | | params.put("挡水建筑物泄洪建筑物正常溢洪道", tbWordVO.getBuildingText()); |
| | |
| | | } |
| | | |
| | | |
| | | public static byte[] GetOverInfo(List<TotalInfo> totalList, List<DzkInfo> dzkList, List<OverDetail> overDetailList,List<SzInfo> szInfoList) throws Exception { |
| | | public static byte[] GetOverInfo(List<TotalInfo> totalList, List<DzkInfo> dzkList, List<OverDetail> overDetailList, List<SzInfo> szInfoList, List<SmsResultVO> dxyjList, List<CallTaskResultVO> whtjList, YwFloodReportInfo ywFloodReportInfo) throws Exception { |
| | | InputStream inputStream = WordUtil.class.getClassLoader().getResourceAsStream("word/doc/overFloodTemplate.docx"); |
| | | ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
| | | OverWord overWord = new OverWord(totalList, dzkList, overDetailList, szInfoList); |
| | | XWPFTemplate template = XWPFTemplate.compile(inputStream).render(createOverWordParam(overWord)); |
| | | OverWord overWord = new OverWord(totalList, dzkList, overDetailList, szInfoList, dxyjList, whtjList, null); |
| | | XWPFTemplate template = XWPFTemplate.compile(inputStream).render(createOverWordParam(overWord, ywFloodReportInfo)); |
| | | template.write(outputStream); |
| | | outputStream.flush(); |
| | | outputStream.close(); |
| | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param totalList 全省水库超汛 |
| | | * @param dzkList 大中库超汛 |
| | | * @param overDetailList 超汛明细 |
| | | * @param szInfoList 省直超汛 |
| | | * @param totalOverList 超正常 |
| | | * @param totalList 全省水库超汛 |
| | | * @param dzkList 大中库超汛 |
| | | * @param overDetailList 超汛明细 |
| | | * @param szInfoList 省直超汛 |
| | | * @param totalOverList 超正常 |
| | | * @param totalOver10List 超正常10cm |
| | | * @return |
| | | */ |
| | | public static byte[] GetNotInSeasonOverInfo(List<TotalInfo> totalList, List<DzkInfo> dzkList, List<OverDetail> overDetailList, List<SzInfo> szInfoList, List<TotalInfo> totalOverList, List<TotalInfo> totalOver10List) throws Exception{ |
| | | public static byte[] GetNotInSeasonOverInfo(List<TotalInfo> totalList, List<DzkInfo> dzkList, List<OverDetail> overDetailList, List<SzInfo> szInfoList, List<TotalInfo> totalOverList, List<TotalInfo> totalOver10List) throws Exception { |
| | | InputStream inputStream = WordUtil.class.getClassLoader().getResourceAsStream("word/doc/inFloodSeason_overFloodTemplate.docx"); |
| | | ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
| | | OverWord overWord = new OverWord(totalList, dzkList, overDetailList, szInfoList,totalOverList,totalOver10List); |
| | | OverWord overWord = new OverWord(totalList, dzkList, overDetailList, szInfoList, totalOverList, totalOver10List); |
| | | XWPFTemplate template = XWPFTemplate.compile(inputStream).render(createOverWordParam(overWord)); |
| | | template.write(outputStream); |
| | | outputStream.flush(); |
| | |
| | | String dxStr = StringUtil.isNotBlank(overWord.getOverBigInfo()) ? "超汛限的水库的大型水库有:" : ""; |
| | | params.put("超汛限的水库的大型水库有", dxStr); |
| | | params.put("大型水库详情", overWord.getOverBigInfo()); |
| | | String zxStr = StringUtil.isNotBlank(overWord.getOverMidInfo()) ? "超汛限的水库的中型水库有:" : ""; |
| | | params.put("超汛限的水库的中型水库有", zxStr); |
| | | params.put("中型水库详情", overWord.getOverMidInfo()); |
| | | params.put("省直水库详情", overWord.getProvinceInfo()); |
| | | params.put("短信预警和外呼抽查", overWord.getSmsResultInfo()); |
| | | params.put("重点水库详情", overWord.getZdInfo()); |
| | | //不在汛期内 |
| | | if (!MyDateUtils.isTodayInFloodSeason()){ |
| | | if (!MyDateUtils.isTodayInFloodSeason()) { |
| | | params.put("全省水库超正常", overWord.getTotalOverNormalInfo()); |
| | | params.put("全省水库超正常十厘米以上", overWord.getTotalOverNormal10Info()); |
| | | params.put("超正常小型水库详情", overWord.getOverNormalSmallInfo()); |
| | | params.put("超正常大型水库详情", overWord.getOverNormalBigInfo()); |
| | | params.put("超正常中型水库详情", overWord.getOverNormalMidInfo()); |
| | | } |
| | | |
| | | return params; |
| | | } |
| | | |
| | | private static Map<String, Object> createOverWordParam(OverWord overWord, YwFloodReportInfo info) { |
| | | Map<String, Object> params = new HashMap<>(); |
| | | |
| | | params.put("时间", overWord.getTm()); |
| | | params.put("全省水库超汛限", overWord.getTotalInfo()); |
| | | params.put("小型水库详情", overWord.getOverSmallInfo()); |
| | | String dxStr = StringUtil.isNotBlank(overWord.getOverBigInfo()) ? "超汛限的水库的大型水库有:" : ""; |
| | | params.put("超汛限的水库的大型水库有", dxStr); |
| | | params.put("大型水库详情", overWord.getOverBigInfo()); |
| | | String zxStr = StringUtil.isNotBlank(overWord.getOverMidInfo()) ? "超汛限的水库的中型水库有:" : ""; |
| | | params.put("超汛限的水库的中型水库有", zxStr); |
| | | params.put("中型水库详情", overWord.getOverMidInfo()); |
| | | params.put("省直水库详情", overWord.getProvinceInfo()); |
| | | params.put("短信预警和外呼抽查", overWord.getSmsResultInfo()); |
| | | params.put("重点水库详情", overWord.getZdInfo()); |
| | | //不在汛期内 |
| | | if (!MyDateUtils.isTodayInFloodSeason()) { |
| | | params.put("全省水库超正常", overWord.getTotalOverNormalInfo()); |
| | | params.put("全省水库超正常十厘米以上", overWord.getTotalOverNormal10Info()); |
| | | params.put("超正常小型水库详情", overWord.getOverNormalSmallInfo()); |
| | | params.put("超正常大型水库详情", overWord.getOverNormalBigInfo()); |
| | | params.put("超正常中型水库详情", overWord.getOverNormalMidInfo()); |
| | | } |
| | | |
| | | //昨日报汛 |
| | | params.put("昨日全省水库超汛限", info.getTotalInfo().replace("今日", "昨日")); |
| | | params.put("昨日超汛限的小型水库有", info.getOversmallInfo()); |
| | | |
| | | return params; |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | public static OverWord GetOverInfo(List<TotalInfo> totalList) { |
| | | |
| | | OverWord overWord = new OverWord(totalList); |
| | | return overWord; |
| | | } |
| | | } |
| | |
| | | package cn.gistack.sm.sjztmd.word.vo; |
| | | |
| | | import cn.gistack.alerts.sms.vo.SmsResultVO; |
| | | import cn.gistack.sm.intelligentCall.entity.CallTask; |
| | | import cn.gistack.sm.intelligentCall.vo.CallTaskResultVO; |
| | | import lombok.Data; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.ObjectUtil; |
| | |
| | | //超正常中型水库 |
| | | private String overNormalMidInfo; |
| | | |
| | | public OverWord(List<TotalInfo> totalList, List<DzkInfo> dzkList, List<OverDetail> overDetailList,List<SzInfo> szInfoList){ |
| | | private String smsResultInfo; |
| | | private String zdInfo; |
| | | |
| | | public OverWord(List<TotalInfo> totalList, List<DzkInfo> dzkList, List<OverDetail> overDetailList, List<SzInfo> szInfoList, List<SmsResultVO> resultVOList, List<CallTaskResultVO> whtjList, String isNew) { |
| | | this.tm = new SimpleDateFormat("MM月dd日H时").format(new Date()); |
| | | this.hour = new SimpleDateFormat("H时").format(new Date()); |
| | | |
| | | formatTotalInfo(totalList); |
| | | formatDzkInfo(dzkList); |
| | | formatSzInfo(szInfoList); |
| | | formatSmsResultInfo(resultVOList, whtjList); |
| | | } |
| | | |
| | | public OverWord(List<TotalInfo> totalList, List<DzkInfo> dzkList, List<OverDetail> overDetailList,List<SzInfo> szInfoList,List<TotalInfo> totalOverList, List<TotalInfo> totalOver10List){ |
| | | public OverWord(List<TotalInfo> totalList) { |
| | | this.tm = new SimpleDateFormat("MM月dd日H时").format(new Date()); |
| | | this.hour = new SimpleDateFormat("H时").format(new Date()); |
| | | formatTotalInfo(totalList); |
| | | } |
| | | |
| | | private void formatSmsResultInfo(List<SmsResultVO> resultVOList, List<CallTaskResultVO> whtjList) { |
| | | // 短信预警处理 |
| | | int dxyjCount = 0; |
| | | for (SmsResultVO vo : resultVOList) { |
| | | int number = null == vo.getNumber() ? 0 : vo.getNumber(); |
| | | dxyjCount = dxyjCount + number; |
| | | } |
| | | |
| | | // 外呼统计处理 |
| | | int cityNameIndex = 0; //记录增加行政区划次数 |
| | | String cityNames = ""; //行政区划集合 |
| | | int jtCount = 0; //接通的数量 |
| | | for (CallTaskResultVO callTaskResultVO : whtjList) { |
| | | |
| | | if(null == callTaskResultVO.getId()) { |
| | | continue; |
| | | } |
| | | |
| | | if (StringUtil.isNotBlank(callTaskResultVO.getCityName())) { |
| | | if (StringUtil.isBlank(cityNames)) { |
| | | cityNames = cityNames + callTaskResultVO.getCityName(); |
| | | } else { |
| | | //如果存在不添加 |
| | | if (cityNames.indexOf(callTaskResultVO.getCityName()) < 0 && cityNameIndex < 4) { |
| | | cityNames = cityNames + "、" + callTaskResultVO.getCityName(); |
| | | cityNameIndex = cityNameIndex + 1; |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | if (callTaskResultVO.getCallResult().equals("200000")) { |
| | | jtCount = jtCount + 1; |
| | | } |
| | | |
| | | if (callTaskResultVO.getIsSmsFill().equals("已反馈")) { |
| | | jtCount = jtCount + 1; |
| | | } |
| | | |
| | | } |
| | | |
| | | double whtjCount = whtjList.size() > 0 ? whtjList.size() : 1; |
| | | double jtl = Double.valueOf(jtCount) / whtjCount * 100; |
| | | String str = StringUtil.format("过去24小时内,发送水库短信预警{}条,抽查{}等水库防汛责任人{}人次,应答率{},责任人履职情况总体较好。", |
| | | dxyjCount, cityNames.replace("恩施土家族苗族自治州","恩施州"), whtjList.size(), String.format("%.2f", jtl) + "%"); |
| | | this.smsResultInfo = str; |
| | | } |
| | | |
| | | public OverWord(List<TotalInfo> totalList, List<DzkInfo> dzkList, List<OverDetail> overDetailList, List<SzInfo> szInfoList, List<TotalInfo> totalOverList, List<TotalInfo> totalOver10List) { |
| | | this.tm = new SimpleDateFormat("MM月dd日H时").format(new Date()); |
| | | this.hour = new SimpleDateFormat("H时").format(new Date()); |
| | | |
| | |
| | | formatDzkInfo(dzkList); |
| | | formatSzInfo(szInfoList); |
| | | |
| | | formatOverNormal(totalOverList,totalOver10List); |
| | | formatOverNormal(totalOverList, totalOver10List); |
| | | } |
| | | |
| | | /** |
| | | * 构建超正常信息 |
| | | * |
| | | * @param totalOverList |
| | | * @param totalOver10List |
| | | */ |
| | |
| | | dangerCountTotal += totalInfo.getDanger_count_all(); |
| | | overDangerCountTotal += totalInfo.getOver_danger_count_all(); |
| | | |
| | | if (totalInfo.getSmall_all() != 0){ |
| | | String smallRegionCout = StringUtil.format("{}{}座",totalInfo.getP_ad_name(),totalInfo.getSmall_all()); |
| | | if (totalInfo.getSmall_all() != 0) { |
| | | String smallRegionCout = StringUtil.format("{}{}座", totalInfo.getP_ad_name(), totalInfo.getSmall_all()); |
| | | smallList.add(smallRegionCout); |
| | | } |
| | | // "mid_over_detail": "许家冲水库-5.59,游河水库-1.42,马鞍山水库-0.2,桃园河水库-3.19,白果河水库-1.56,两河口水库-4.97", |
| | | if (totalInfo.getBig_over_detail() != null){ |
| | | if (totalInfo.getBig_over_detail() != null) { |
| | | String bigOverDetail = totalInfo.getBig_over_detail(); |
| | | //许家冲水库-5.59 游河水库-1.42 马鞍山水库-0.2 |
| | | List<String> list = Arrays.asList(bigOverDetail.split(",")); |
| | | |
| | | list.forEach(item->{ |
| | | list.forEach(item -> { |
| | | String reservoirName = item.split("~")[0]; |
| | | bigList.add(reservoirName); |
| | | }); |
| | | } |
| | | |
| | | if (totalInfo.getMid_over_detail() != null){ |
| | | if (totalInfo.getMid_over_detail() != null) { |
| | | String midOverDetail = totalInfo.getMid_over_detail(); |
| | | //许家冲水库-5.59 游河水库-1.42 马鞍山水库-0.2 |
| | | List<String> list = Arrays.asList(midOverDetail.split(",")); |
| | | |
| | | list.forEach(item->{ |
| | | list.forEach(item -> { |
| | | String reservoirName = item.split("~")[0]; |
| | | midList.add(reservoirName); |
| | | }); |
| | |
| | | |
| | | String totalValue = |
| | | StringUtil.format("今日{},全省共有{}座水库超正常水位,其中大型水库{}座、中型水库{}座、小型水库{}座。全省水库持续安全运行。全省病险水库中,有{}座超正常水位,有{}座没有超正常但超了控制运用水位", |
| | | this.hour,total,big,mid,small,dangerCountTotal,overDangerCountTotal); |
| | | this.hour, total, big, mid, small, dangerCountTotal, overDangerCountTotal); |
| | | |
| | | String totalOverNormal10Value = getOverNormal10(totalOver10List); |
| | | String smallValue = ""; |
| | | if (smallList.size()>0){ |
| | | smallValue = String.join("、",smallList); |
| | | }else { |
| | | if (smallList.size() > 0) { |
| | | smallValue = String.join("、", smallList); |
| | | } else { |
| | | smallValue = "没有超正常的小型水库"; |
| | | } |
| | | |
| | | String bigValue=""; |
| | | if (bigList.size()>0){ |
| | | bigValue= |
| | | StringUtil.format(" 其中,超正常的大型水库有{}。",String.join("、",bigList)); |
| | | }else{ |
| | | bigValue= " 其中,没有超正常的大型水库。"; |
| | | String bigValue = ""; |
| | | if (bigList.size() > 0) { |
| | | bigValue = |
| | | StringUtil.format(" 其中,超正常的大型水库有{}。", String.join("、", bigList)); |
| | | } else { |
| | | bigValue = " 其中,没有超正常的大型水库。"; |
| | | } |
| | | |
| | | String midValue = ""; |
| | | if (midList.size()>0){ |
| | | midValue= |
| | | StringUtil.format(" 其中,超正常的中型水库有{}。",String.join("、",midList)); |
| | | }else{ |
| | | midValue= " 其中,没有超正常的中型水库。"; |
| | | if (midList.size() > 0) { |
| | | midValue = |
| | | StringUtil.format(" 其中,超正常的中型水库有{}。", String.join("、", midList)); |
| | | } else { |
| | | midValue = " 其中,没有超正常的中型水库。"; |
| | | } |
| | | |
| | | this.totalOverNormalInfo = totalValue; |
| | | this.overNormalSmallInfo =smallValue; |
| | | this.overNormalSmallInfo = smallValue; |
| | | this.overNormalBigInfo = bigValue; |
| | | this.overNormalMidInfo = midValue; |
| | | this.totalOverNormal10Info = totalOverNormal10Value; |
| | |
| | | |
| | | String totalValue = |
| | | StringUtil.format("今日{},全省共有{}座水库超正常水位,其中大型水库{}座、中型水库{}座、小型水库{}座。全省水库持续安全运行。全省病险水库中,有{}座超正常水位,有{}座没有超正常但超了控制运用水位", |
| | | this.hour,total,big,mid,small,dangerCountTotal,overDangerCountTotal); |
| | | this.hour, total, big, mid, small, dangerCountTotal, overDangerCountTotal); |
| | | |
| | | return totalValue; |
| | | } |
| | | |
| | | /** |
| | | * 构建省直信息 |
| | | * |
| | | * @param szInfoList |
| | | */ |
| | | private void formatSzInfo(List<SzInfo> szInfoList) { |
| | | List<String> list = new ArrayList<>(); |
| | | |
| | | List<String> listZd = new ArrayList<>(); |
| | | |
| | | for (int i = 0; i < szInfoList.size(); i++) { |
| | | SzInfo szInfo = szInfoList.get(i); |
| | | String text = generateSzInfo(szInfo); |
| | | list.add(text); |
| | | if (szInfo.getType().equals("省直水库")) { |
| | | String text = generateSzInfo(szInfo); |
| | | list.add(text); |
| | | } else { |
| | | listZd.add(generateSzInfo(szInfo)); |
| | | } |
| | | |
| | | } |
| | | |
| | | // this.provinceInfo = String.join("\n\r\r\r\r",list); |
| | | this.provinceInfo = String.join("\n",list); |
| | | this.provinceInfo = String.join("\n", list); |
| | | this.zdInfo = String.join("\n", listZd); |
| | | } |
| | | |
| | | private String generateSzInfo(SzInfo szInfo){ |
| | | private String generateSzInfo(SzInfo szInfo) { |
| | | String text = ""; |
| | | |
| | | String oldTm = new SimpleDateFormat("MM月dd日H时").format(DateUtil.parse(szInfo.getOld_tm(),"yyyy-MM-dd HH:mm:ss")); |
| | | String oldTm = new SimpleDateFormat("MM月dd日H时").format(DateUtil.parse(szInfo.getOld_tm(), "yyyy-MM-dd HH:mm:ss")); |
| | | Double oldRz = szInfo.getOld_rz(); |
| | | |
| | | String newTm = new SimpleDateFormat("MM月dd日H时").format(DateUtil.parse(szInfo.getNew_tm(),"yyyy-MM-dd HH:mm:ss")); |
| | | String newTm = new SimpleDateFormat("MM月dd日H时").format(DateUtil.parse(szInfo.getNew_tm(), "yyyy-MM-dd HH:mm:ss")); |
| | | Double newRz = szInfo.getNew_rz(); |
| | | |
| | | Double diffRz = Math.abs(szInfo.getDiff_rz()); |
| | | String resNm = szInfo.getStcd(); |
| | | String upOrDown = ""; |
| | | if (szInfo.getDiff_rz()>=0){ |
| | | if (szInfo.getDiff_rz() >= 0) { |
| | | upOrDown = "上涨"; |
| | | }else { |
| | | } else { |
| | | upOrDown = "下降"; |
| | | } |
| | | String flse_lim_stag=""; |
| | | String flse_lim_stag = ""; |
| | | String control_z = ""; |
| | | String wat_shed_area = ""; |
| | | String weir_top_elevation = ""; |
| | | |
| | | switch (resNm){ |
| | | case "高关水库": |
| | | flse_lim_stag = "118"; |
| | | control_z="117"; |
| | | wat_shed_area = "303"; |
| | | break; |
| | | case "王英水库": |
| | | flse_lim_stag = "70"; |
| | | control_z="67"; |
| | | wat_shed_area = "243"; |
| | | break; |
| | | case "吴岭水库": |
| | | flse_lim_stag = "62.20"; |
| | | control_z=""; |
| | | wat_shed_area = "102"; |
| | | break; |
| | | case "富水水库": |
| | | flse_lim_stag = "57"; |
| | | control_z="55"; |
| | | wat_shed_area = "2450"; |
| | | break; |
| | | case "漳河水库": |
| | | flse_lim_stag = "122.6"; |
| | | control_z="122"; |
| | | wat_shed_area = "2212"; |
| | | break; |
| | | } |
| | | if (null != szInfo.getFlse_lim_stag()) |
| | | flse_lim_stag = String.valueOf(szInfo.getFlse_lim_stag()); |
| | | if (null != szInfo.getControl_z()) |
| | | control_z = String.valueOf(szInfo.getControl_z()); |
| | | if (null != szInfo.getWat_shed_area()) |
| | | wat_shed_area = String.valueOf(szInfo.getWat_shed_area()); |
| | | if (null != szInfo.getWeir_top_elevation()) |
| | | weir_top_elevation = String.valueOf(szInfo.getWeir_top_elevation()); |
| | | |
| | | // 之前临时处理逻辑 --2024-06-20去除-- |
| | | // switch (resNm) { |
| | | // case "高关水库": |
| | | // flse_lim_stag = "118"; |
| | | // control_z = "117"; |
| | | // wat_shed_area = ""; |
| | | // break; |
| | | // case "王英水库": |
| | | // flse_lim_stag = "70"; |
| | | // control_z = "67"; |
| | | // wat_shed_area = ""; |
| | | // break; |
| | | // case "吴岭水库": |
| | | // flse_lim_stag = "62.20"; |
| | | // control_z = ""; |
| | | // wat_shed_area = "102"; |
| | | // break; |
| | | // case "富水水库": |
| | | // flse_lim_stag = "55"; |
| | | // control_z = "54"; |
| | | // wat_shed_area = ""; |
| | | // break; |
| | | // case "漳河水库": |
| | | // flse_lim_stag = "122.6"; |
| | | // control_z = "121.8"; |
| | | // wat_shed_area = ""; |
| | | // break; |
| | | // } |
| | | |
| | | List<String> detailList = new ArrayList<>(); |
| | | if (StringUtil.isNotBlank(flse_lim_stag)){ |
| | | detailList.add(StringUtil.format("汛限水位{}米",flse_lim_stag)); |
| | | if (StringUtil.isNotBlank(weir_top_elevation)) { |
| | | detailList.add(StringUtil.format("堰顶高程{}米", weir_top_elevation)); |
| | | } |
| | | if (StringUtil.isNotBlank(control_z)){ |
| | | detailList.add(StringUtil.format("控制运用水位{}米",control_z)); |
| | | if (StringUtil.isNotBlank(flse_lim_stag)) { |
| | | detailList.add(StringUtil.format("汛限水位{}米", flse_lim_stag)); |
| | | } |
| | | if (StringUtil.isNotBlank(wat_shed_area)){ |
| | | detailList.add(StringUtil.format("集雨面积{}平方千米",wat_shed_area)); |
| | | if (StringUtil.isNotBlank(flse_lim_stag)) { |
| | | detailList.add(StringUtil.format("汛限水位{}米", flse_lim_stag)); |
| | | } |
| | | String detail = StringUtil.join(detailList,","); |
| | | if (StringUtil.isNotBlank(control_z)) { |
| | | detailList.add(StringUtil.format("控制运用水位{}米", control_z)); |
| | | } |
| | | if (StringUtil.isNotBlank(wat_shed_area)) { |
| | | detailList.add(StringUtil.format("集雨面积{}平方千米", wat_shed_area)); |
| | | } |
| | | String detail = StringUtil.join(detailList, ","); |
| | | |
| | | text = StringUtil.format(" {}{}水位{}米,{}库水位{}米,({}{}米,{})。", |
| | | resNm,oldTm,oldRz,newTm,newRz,upOrDown,diffRz,detail); |
| | | resNm, oldTm, oldRz, newTm, newRz, upOrDown, diffRz, detail); |
| | | |
| | | return text; |
| | | } |
| | | |
| | | /** |
| | | * 构建大中库信息 |
| | | * |
| | | * @param dzkList |
| | | */ |
| | | private void formatDzkInfo(List<DzkInfo> dzkList) { |
| | |
| | | // this.overBigInfo = String.join("\n\r\r\r\r",bigListInfo); |
| | | // this.overMidInfo = String.join("\n\r\r\r\r",midListInfo); |
| | | |
| | | this.overBigInfo = String.join("\n",bigListInfo); |
| | | this.overMidInfo = String.join("\n",midListInfo); |
| | | this.overBigInfo = String.join("\n", bigListInfo); |
| | | this.overMidInfo = String.join("\n", midListInfo); |
| | | } |
| | | |
| | | private String generateDzkInfo(DzkInfo dzkInfo){ |
| | | private String generateDzkInfo(DzkInfo dzkInfo) { |
| | | String text = ""; |
| | | |
| | | List<String> detailList = new ArrayList<>(); |
| | | if (StringUtil.isNotBlank(dzkInfo.getIs_gate())){ |
| | | detailList.add(StringUtil.format("溢洪道{}",dzkInfo.getIs_gate())); |
| | | if (StringUtil.isNotBlank(dzkInfo.getIs_gate())) { |
| | | detailList.add(StringUtil.format("溢洪道{}", dzkInfo.getIs_gate())); |
| | | } |
| | | if (ObjectUtil.isNotEmpty(dzkInfo.getOver_stag())){ |
| | | detailList.add(StringUtil.format("超汛限水位{}米",dzkInfo.getOver_stag())); |
| | | if (ObjectUtil.isNotEmpty(dzkInfo.getOver_stag())) { |
| | | detailList.add(StringUtil.format("超汛限水位{}米", dzkInfo.getOver_stag())); |
| | | } |
| | | if (ObjectUtil.isNotEmpty(dzkInfo.getTot_cap())){ |
| | | detailList.add(StringUtil.format("总库容{}万立方米",dzkInfo.getTot_cap())); |
| | | if (ObjectUtil.isNotEmpty(dzkInfo.getTot_cap())) { |
| | | detailList.add(StringUtil.format("总库容{}万立方米", dzkInfo.getTot_cap())); |
| | | } |
| | | if (ObjectUtil.isNotEmpty(dzkInfo.getWat_shed_area())){ |
| | | detailList.add(StringUtil.format("集雨面积{}平方千米",dzkInfo.getWat_shed_area())); |
| | | if (ObjectUtil.isNotEmpty(dzkInfo.getWat_shed_area())) { |
| | | detailList.add(StringUtil.format("集雨面积{}平方千米", dzkInfo.getWat_shed_area())); |
| | | } |
| | | if (ObjectUtil.isNotEmpty(dzkInfo.getTb_norm_pool_stag())){ |
| | | detailList.add(StringUtil.format("正常蓄水位{}米",dzkInfo.getTb_norm_pool_stag())); |
| | | if (ObjectUtil.isNotEmpty(dzkInfo.getTb_norm_pool_stag())) { |
| | | detailList.add(StringUtil.format("正常蓄水位{}米", dzkInfo.getTb_norm_pool_stag())); |
| | | } |
| | | if (ObjectUtil.isNotEmpty(dzkInfo.getTb_flse_lim_stag())){ |
| | | detailList.add(StringUtil.format("汛限水位{}米",dzkInfo.getTb_flse_lim_stag())); |
| | | if (ObjectUtil.isNotEmpty(dzkInfo.getTb_flse_lim_stag())) { |
| | | detailList.add(StringUtil.format("汛限水位{}米", dzkInfo.getTb_flse_lim_stag())); |
| | | } |
| | | if (ObjectUtil.isNotEmpty(dzkInfo.getTb_weir_top_elevation())) { |
| | | detailList.add(StringUtil.format("堰顶高程{}米", dzkInfo.getTb_weir_top_elevation())); |
| | | } |
| | | |
| | | String detail = String.join(",",detailList); |
| | | text = StringUtil.format(" {}{}{}({})。",dzkInfo.getP_ad_name(),dzkInfo.getAd_name(),dzkInfo.getRes_name(),detail); |
| | | String detail = String.join(",", detailList); |
| | | text = StringUtil.format(" {}{}{}({})。", dzkInfo.getP_ad_name(), dzkInfo.getAd_name(), dzkInfo.getRes_name(), detail); |
| | | |
| | | return text; |
| | | } |
| | | |
| | | /** |
| | | * 构建全省水库超汛限信息 |
| | | * |
| | | * @param totalList |
| | | * @return |
| | | */ |
| | | private void formatTotalInfo(List<TotalInfo> totalList){ |
| | | private void formatTotalInfo(List<TotalInfo> totalList) { |
| | | String totalLabel = "全省水库超汛限:"; |
| | | String smallLable = "超汛限的小型水库有:"; |
| | | |
| | |
| | | dangerCountTotal += totalInfo.getDanger_count_all(); |
| | | overDangerCountTotal += totalInfo.getOver_danger_count_all(); |
| | | |
| | | if (totalInfo.getSmall_all() == 0){ |
| | | if (totalInfo.getSmall_all() == 0) { |
| | | continue; |
| | | } |
| | | |
| | | String smallRegionCout = StringUtil.format("{}{}座",totalInfo.getP_ad_name(),totalInfo.getSmall_all()); |
| | | String smallRegionCout = StringUtil.format("{}{}座", totalInfo.getP_ad_name(), totalInfo.getSmall_all()); |
| | | smallList.add(smallRegionCout); |
| | | } |
| | | |
| | | String totalValue = |
| | | StringUtil.format("今日{},全省共有{}座水库超汛限水位,其中大型水库{}座、中型水库{}座、小型水库{}座。全省水库持续安全运行。全省病险水库中,有{}座超汛限水位,有{}座没有超汛限但超了控制运用水位", |
| | | this.hour,total,big,mid,small,dangerCountTotal,overDangerCountTotal); |
| | | this.hour, total, big, mid, small, dangerCountTotal, overDangerCountTotal); |
| | | |
| | | String smallValue = String.join("、",smallList); |
| | | String smallValue = String.join("、", smallList); |
| | | |
| | | this.totalInfo = totalValue; |
| | | this.overSmallInfo =smallValue; |
| | | this.overSmallInfo = smallValue; |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | //水位差值 |
| | | private Double diff_rz; |
| | | |
| | | private Double flse_lim_stag;//汛限水位 |
| | | private Double control_z;//控制水位 |
| | | private Double wat_shed_area;//集雨面积 |
| | | private Double weir_top_elevation;//集雨面积 |
| | | |
| | | private String type; |
| | | |
| | | } |
| | |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.*; |
| | | import cn.gistack.sm.sjztmd.word.enums.*; |
| | | import cn.gistack.sm.sjztmd.word.util.WordUtil; |
| | | import com.alibaba.nacos.common.utils.StringUtils; |
| | | import lombok.Data; |
| | | import org.checkerframework.checker.formatter.qual.UnknownFormat; |
| | |
| | | */ |
| | | |
| | | String typeName = SpillwayTypeEnum.find(norspi.getSpillwayType()).getLabel(); |
| | | if (StringUtil.isBlank(typeName) && norspi.getSpillwayType().indexOf(",") > -1) { |
| | | String [] tmpSt = norspi.getSpillwayType().split(","); |
| | | if (tmpSt[0].equals("9")) { |
| | | typeName = tmpSt[1]; |
| | | } |
| | | } |
| | | |
| | | String gateText = ""; |
| | | String holeText = ""; |
| | |
| | | String disCharge = isNull(norspi.getCheckingFloodDischarge()); |
| | | |
| | | String text = StringUtil.format("溢洪道为{},{},堰顶高程{}m,堰顶净宽{}m{},最大泄洪量{}m³/s。", |
| | | typeName, gateText, weirTopElevation, weirTopWidth, holeText, disCharge); |
| | | typeName, gateText, StringUtil.format("设计洪水位{}m", String.format("%.2f",norspi.getWeirTopElevation())), weirTopWidth, holeText, disCharge); |
| | | |
| | | return text; |
| | | } |
| | |
| | | |
| | | |
| | | String info = StringUtil.format("{}为{},坝顶高程{}m,最大坝高{}m,坝长{}m,坝顶宽{}m。", |
| | | name, mainDamType, mainDamTopElevation, mainDamHeight, mainDamTopLength, mainDamWidth); |
| | | name, mainDamType, Double.parseDouble(String.format("%.2f",tbAttResWaterBlock.getDamTopElevation())), mainDamHeight, mainDamTopLength, mainDamWidth); |
| | | |
| | | return info; |
| | | } |
| | |
| | | this.administrativeUnit = attResManagePerson.getUserUnit(); |
| | | } |
| | | |
| | | if (attResManagePerson.getType().equals("2")) { |
| | | if (attResManagePerson.getType().equals("3")) { |
| | | //主管 |
| | | this.competentDepartmentInfo = StringUtil.format("{}({},{})", |
| | | attResManagePerson.getUserName(), attResManagePerson.getPosition(), attResManagePerson.getUserPhone()); |
| | |
| | | |
| | | String resFuncText = String.join("、", resFucTextList); |
| | | if (resFucList.size() >= 3) { |
| | | resFuncText = resFuncText + "等综合"; |
| | | resFuncText = resFuncText + "等"; |
| | | } |
| | | this.resFuncText = resFuncText; |
| | | |
| | |
| | | |
| | | this.desFlSta = DesFlStaEnum.find(tbAttResStagChar.getDesFlSta()).getLabel(); |
| | | |
| | | this.checFlSta = ChecFlStaEnum.find(tbAttResStagChar.getDesFlSta()).getLabel(); |
| | | this.checFlSta = ChecFlStaEnum.find(tbAttResStagChar.getChecFlSta()).getLabel(); |
| | | |
| | | this.totalCap = isNull(tbAttResStagChar.getTotalCap()); |
| | | //水文特征 |
| | | List<String> hydrologicalCharacteristicsList = new ArrayList<>(); |
| | | |
| | | List<String> hydrologicalCharacteristicsList2 = new ArrayList<>(); |
| | | |
| | | if (tbAttResStagChar.getAdjustStorCap() != null) { |
| | | hydrologicalCharacteristicsList.add(StringUtil.format("兴利库容{}万m³", tbAttResStagChar.getAdjustStorCap().toString())); |
| | | hydrologicalCharacteristicsList.add(StringUtil.format("兴利库容{}万m³", WordUtil.removeTrailingZero(tbAttResStagChar.getAdjustStorCap().toString()))); |
| | | } |
| | | if (tbAttResStagChar.getFlprCap() != null) { |
| | | hydrologicalCharacteristicsList.add(StringUtil.format("调洪库容{}万m³", tbAttResStagChar.getFlprCap().toString())); |
| | | hydrologicalCharacteristicsList.add(StringUtil.format("调洪库容{}万m³", WordUtil.removeTrailingZero(tbAttResStagChar.getFlprCap().toString()))); |
| | | } |
| | | if (tbAttResStagChar.getDeadCap() != null) { |
| | | hydrologicalCharacteristicsList.add(StringUtil.format("死库容{}万m³", tbAttResStagChar.getDeadCap().toString())); |
| | | hydrologicalCharacteristicsList.add(StringUtil.format("死库容{}万m³", WordUtil.removeTrailingZero(tbAttResStagChar.getDeadCap().toString()))); |
| | | } |
| | | if (tbAttResStagChar.getChecFlStag() != null) { |
| | | hydrologicalCharacteristicsList.add(StringUtil.format("校核洪水位{}m", tbAttResStagChar.getChecFlStag().toString())); |
| | | hydrologicalCharacteristicsList2.add(StringUtil.format(this.resName + "校核洪水位{}m", String.format("%.2f",tbAttResStagChar.getChecFlStag()))); |
| | | } |
| | | if (tbAttResStagChar.getDesFlStag() != null) { |
| | | hydrologicalCharacteristicsList.add(StringUtil.format("设计洪水位{}m", tbAttResStagChar.getDesFlStag().toString())); |
| | | hydrologicalCharacteristicsList2.add(StringUtil.format("设计洪水位{}m", String.format("%.2f",tbAttResStagChar.getDesFlStag()))); |
| | | } |
| | | if (tbAttResStagChar.getCorNormStag() != null) { |
| | | hydrologicalCharacteristicsList.add(StringUtil.format("正常蓄水位{}m", tbAttResStagChar.getCorNormStag().toString())); |
| | | hydrologicalCharacteristicsList2.add(StringUtil.format("正常蓄水位{}m", String.format("%.2f",tbAttResStagChar.getCorNormStag()))); |
| | | } |
| | | if (tbAttResStagChar.getDeadStag() != null) { |
| | | hydrologicalCharacteristicsList.add(StringUtil.format("死水位{}m", tbAttResStagChar.getDeadStag().toString())); |
| | | hydrologicalCharacteristicsList2.add(StringUtil.format("死水位{}m", String.format("%.2f",tbAttResStagChar.getDeadStag()))); |
| | | } |
| | | |
| | | this.hydrologicalCharacteristics = String.join(",", hydrologicalCharacteristicsList); |
| | | this.hydrologicalCharacteristics = String.join(",", hydrologicalCharacteristicsList) + ";" + String.join(",", hydrologicalCharacteristicsList2); |
| | | } |
| | | |
| | | private void formatTbAttResWaterDelivery(List<TbAttResWaterDelivery> tbAttResWaterDeliveryList) { |
| | |
| | | |
| | | TbAttResWaterDelivery tbAttResWaterDelivery = tbAttResWaterDeliveryList.get(0); |
| | | if (tbAttResWaterDeliveryList.size() > 1) { |
| | | this.aqueductType = "主要采用"; |
| | | this.aqueductType = "水库主要采用"; |
| | | } else { |
| | | this.aqueductType = "采用"; |
| | | this.aqueductType = "水库采用"; |
| | | } |
| | | |
| | | |
| | |
| | | return; |
| | | } |
| | | |
| | | this.protectCity = tbAttResEngBene.getCity().equals("无")?"":tbAttResEngBene.getCity(); |
| | | this.protectCity = tbAttResEngBene.getCity().equals("无")?tbAttResEngBene.getTown():tbAttResEngBene.getCity(); |
| | | if (StringUtil.isBlank(this.protectCity)) { |
| | | this.protectCity = tbAttResEngBene.getTown().equals("无")?"":tbAttResEngBene.getTown(); |
| | | } |
| | | |
| | | double person = tbAttResEngBene.getFlControlPerson() / 10000.0; |
| | | |
| | | if (person > 0) { |
| | | this.protectPersonLand = String.format("%.2f",person) + "万人口"; |
| | | } |
| | | |
| | | if (tbAttResEngBene.getFlControlLand() > 0) { |
| | | if (StringUtil.isBlank(this.protectPersonLand)) { |
| | | this.protectPersonLand = String.format("%.2f", tbAttResEngBene.getFlControlLand()) + "万亩耕地"; |
| | | } else { |
| | | this.protectPersonLand = this.protectPersonLand + "、" + String.format("%.2f", tbAttResEngBene.getFlControlLand()) + "万亩耕地"; |
| | | } |
| | | } |
| | | |
| | | this.protectPersonLand = |
| | | StringUtil.format("{}万人口、{}万亩耕地", String.format("%.2f",person) , String.format("%.2f", tbAttResEngBene.getFlControlLand() / 1000)); |
| | |
| | | String type = SafetyAppraisalTypeEnum.find(tbAttResSafetyMonitor.getSafetyAppraisalResult()).getLabel(); |
| | | String surveyProblem = tbAttResSafetyMonitor.getSurveyProblem(); |
| | | //(若一类坝,不介绍问题,二、三类坝介绍) |
| | | if (tbAttResSafetyMonitor.equals("1")) { |
| | | if (tbAttResSafetyMonitor.getSafetyAppraisalResult().equals("1")) { |
| | | this.safetyMonitorText = StringUtil.format("{},水库进行安全鉴定,鉴定结果为\"{}\"。", |
| | | time, type); |
| | | } else { |
| | |
| | | } |
| | | |
| | | this.mUnitName = tbAttResMgrSysB.getMUnitName(); |
| | | this.mUnitNature = tbAttResMgrSysB.getMUnitNature().replace("公益类",""); |
| | | this.mUnitNature = tbAttResMgrSysB.getMUnitNature(); |
| | | this.mUnitPersonNumber = tbAttResMgrSysB.getMUnitPersonNumber().toString(); |
| | | } |
| | | |
| | |
| | | @GetMapping("/lazy-tree") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "懒加载树形结构", notes = "树形结构") |
| | | public R<List<DeptVO>> lazyTree(String tenantId, Long parentId, BladeUser bladeUser) { |
| | | public R<List<DeptVO>> lazyTree(String tenantId, String parentId, BladeUser bladeUser) { |
| | | List<DeptVO> tree = deptService.lazyTree(Func.toStrWithEmpty(tenantId, bladeUser.getTenantId()), parentId); |
| | | return R.data(tree); |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据父级角色查询子角色 |
| | | * @param parentId |
| | | * @return |
| | | */ |
| | | @GetMapping("/treeByParentIdNew") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "树形结构", notes = "树形结构") |
| | | public R<List<RoleVO>> treeByParentIdNew(String parentId) { |
| | | List<RoleVO> tree = roleService.treeByParentIdNew(parentId); |
| | | return R.data(tree); |
| | | } |
| | | /** |
| | | * 获取指定角色树形结构 |
| | | */ |
| | | @GetMapping("/tree-by-id") |
| | |
| | | */ |
| | | List<DeptVO> tree(String tenantId); |
| | | |
| | | List<DeptVO> treeByParentId(String parentId); |
| | | List<DeptVO> treeByParentId(List<String> parentIds); |
| | | |
| | | /** |
| | | * 懒加载获取树形节点 |
| | |
| | | * @param parentId |
| | | * @return |
| | | */ |
| | | List<DeptVO> lazyTree(String tenantId, Long parentId); |
| | | List<DeptVO> lazyTree(String tenantId, List<Long> parentId); |
| | | |
| | | /** |
| | | * 获取部门名 |
| | |
| | | |
| | | <select id="treeByParentId" resultMap="treeNodeResultMap"> |
| | | select id, parent_id, dept_name as title, id as "value", id as "key" from blade_dept where is_deleted = 0 |
| | | <if test="_parameter!=null and _parameter!=''"> |
| | | and ( |
| | | id = #{_parameter} or parent_id = #{_parameter} or parent_id in ( |
| | | select b.id from blade_dept b where b.is_deleted = 0 and b.PARENT_ID = #{_parameter} |
| | | <if test="parentIds!=null and parentIds!=''"> |
| | | and |
| | | |
| | | <foreach item="id" collection="parentIds" open="(" separator="or" close=")"> |
| | | id = #{id} or parent_id = #{id} or parent_id in ( |
| | | select b.id from blade_dept b where b.is_deleted = 0 and b.PARENT_ID = #{id} |
| | | ) |
| | | ) |
| | | |
| | | </foreach> |
| | | |
| | | </if> |
| | | ORDER BY sort |
| | | </select> |
| | |
| | | FROM |
| | | blade_dept dept |
| | | WHERE |
| | | dept.parent_id = #{param2} AND dept.is_deleted = 0 |
| | | <foreach item="id" collection="param2" open="(" separator="or" close=")"> |
| | | dept.parent_id = #{id} |
| | | </foreach> |
| | | AND dept.is_deleted = 0 |
| | | <if test="param1!=null and param1!=''"> |
| | | and dept.tenant_id = #{param1} |
| | | </if> |
| | |
| | | List<RoleVO> tree(String tenantId, String excludeRole); |
| | | |
| | | List<RoleVO> treeByParentId(String [] parentId); |
| | | List<RoleVO> treeByParentIdNew(String [] parentId); |
| | | |
| | | /** |
| | | * 获取角色名 |
| | |
| | | ORDER BY sort |
| | | </select> |
| | | |
| | | <select id="treeByParentIdNew" resultMap="treeNodeResultMap"> |
| | | select id, parent_id, role_name as title, id as "value", id as "key" from blade_role where is_deleted = 0 |
| | | <if test="_parameter!=null and _parameter!=''"> |
| | | and ( |
| | | ( |
| | | <foreach collection="array" item="parentId" index="index" open="(" close=")" separator="or"> |
| | | id = #{parentId} |
| | | </foreach> |
| | | ) |
| | | or |
| | | ( |
| | | <foreach collection="array" item="parentId" index="index" open="(" close=")" separator="or"> |
| | | parent_id = #{parentId} |
| | | </foreach> |
| | | ) |
| | | |
| | | or parent_id in ( |
| | | select b.id from blade_role b where b.is_deleted = 0 and |
| | | ( |
| | | <foreach collection="array" item="parentId" index="index" open="(" close=")" separator="or"> |
| | | b.PARENT_ID = #{parentId} |
| | | </foreach> |
| | | ) |
| | | |
| | | ) |
| | | ) |
| | | </if> |
| | | ORDER BY sort |
| | | </select> |
| | | |
| | | <select id="getRoleNames" resultType="java.lang.String"> |
| | | SELECT |
| | | role_name |
| | |
| | | * @param parentId |
| | | * @return |
| | | */ |
| | | List<DeptVO> lazyTree(String tenantId, Long parentId); |
| | | List<DeptVO> lazyTree(String tenantId, String parentIds); |
| | | |
| | | /** |
| | | * 获取部门ID |
| | |
| | | */ |
| | | boolean removeRole(String ids); |
| | | |
| | | List<RoleVO> treeByParentIdNew(String parentId); |
| | | } |
| | |
| | | import cn.gistack.system.wrapper.DeptWrapper; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | if (AuthUtil.isAdministrator() || AuthUtil.isAdmin()) { |
| | | return ForestNodeMerger.merge(baseMapper.tree(StringPool.EMPTY)); |
| | | } |
| | | return ForestNodeMerger.merge(baseMapper.treeByParentId(parentId)); |
| | | String [] parentIds = parentId.split(","); |
| | | List<String> parentIdList = new ArrayList<>(); |
| | | for (String str:parentIds) { |
| | | parentIdList.add(str); |
| | | } |
| | | return ForestNodeMerger.merge(baseMapper.treeByParentId(parentIdList)); |
| | | } |
| | | |
| | | @Override |
| | | public List<DeptVO> lazyTree(String tenantId, Long parentId) { |
| | | public List<DeptVO> lazyTree(String tenantId, String parentIds) { |
| | | if (AuthUtil.isAdministrator()) { |
| | | tenantId = StringPool.EMPTY; |
| | | } |
| | | return ForestNodeMerger.merge(baseMapper.lazyTree(tenantId, parentId)); |
| | | |
| | | String [] parentIdStr = parentIds.split(","); |
| | | List<Long> parentIdList = new ArrayList<>(); |
| | | for (String str:parentIdStr) { |
| | | parentIdList.add(Long.parseLong(str)); |
| | | } |
| | | |
| | | return ForestNodeMerger.merge(baseMapper.lazyTree(tenantId, parentIdList)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | //找到移到哪个行政区划下的机构 |
| | | QueryWrapper<Dept> query2 = new QueryWrapper<>(); |
| | | query2.eq("AD_CODE",adCode); |
| | | query2.likeRight("ID","42");// 临时处理,后续考虑优化 |
| | | Dept adCodeDept = getOne(query2); |
| | | |
| | | if (resDept != null && adCodeDept != null){ |
| | |
| | | } |
| | | return ForestNodeMerger.merge(baseMapper.treeByParentId(parentId.split(","))); |
| | | } |
| | | @Override |
| | | public List<RoleVO> treeByParentIdNew(String parentId) { |
| | | |
| | | return ForestNodeMerger.merge(baseMapper.treeByParentIdNew(parentId.split(","))); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "列表", notes = "传入account和realName") |
| | | // @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R<IPage<UserVO>> page(@ApiIgnore UserVO user, Query query, Long deptId, BladeUser bladeUser) { |
| | | IPage<UserVO> pages = userService.selectUserPage(Condition.getPage(query), user, deptId, (bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID) ? StringPool.EMPTY : bladeUser.getTenantId())); |
| | | public R<IPage<UserVO>> page(@ApiIgnore UserVO user, Query query, String deptIds, BladeUser bladeUser) { |
| | | IPage<UserVO> pages = userService.selectUserPage(Condition.getPage(query), user, deptIds, (bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID) ? StringPool.EMPTY : bladeUser.getTenantId())); |
| | | return R.data(UserVOWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | |
| | | * @param tenantId |
| | | * @return |
| | | */ |
| | | IPage<UserVO> selectUserPage(IPage<UserVO> page, UserVO user, Long deptId, String tenantId); |
| | | IPage<UserVO> selectUserPage(IPage<UserVO> page, UserVO user, String deptIds, String tenantId); |
| | | |
| | | List<UserVO> getAllUser(UserVO user, Long deptId, String tenantId); |
| | | |
| | |
| | | * 自定义分页查询 |
| | | * @param page |
| | | * @param user |
| | | * @param deptId |
| | | * @param deptIds |
| | | * @param tenantId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<UserVO> selectUserPage(IPage<UserVO> page, UserVO user, Long deptId, String tenantId) { |
| | | public IPage<UserVO> selectUserPage(IPage<UserVO> page, UserVO user, String deptIds, String tenantId) { |
| | | List<Long> deptIdList = new ArrayList<>(); |
| | | String [] deptidsStr = deptIds.split(","); |
| | | if (null!=user.getIsDept()) { |
| | | deptIdList.add(deptId); |
| | | for (String str:deptidsStr) { |
| | | deptIdList.add(Long.parseLong(str)); |
| | | } |
| | | }else { |
| | | deptIdList = SysCache.getDeptChildIds(deptId); |
| | | for (String str:deptidsStr) { |
| | | deptIdList.addAll(SysCache.getDeptChildIds(Long.parseLong(str))); |
| | | } |
| | | } |
| | | return page.setRecords(baseMapper.selectUserPage(page, user, deptIdList, tenantId)); |
| | | } |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.concurrent.ExecutorService; |
| | | import java.util.concurrent.Executors; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | |
| | | public ReturnT<String> waterInfoNotHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位信息接收不到","","waterInfoNotHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位信息接收不到","","waterInfoNotHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> waterDataExcHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位数据异常","","waterDataExcHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位数据异常","","waterDataExcHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> waterLessDeadHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位超低于死水位","","waterLessDeadHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位超低于死水位","","waterLessDeadHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> waterMoreDeadLessHJHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位高于死水位,低于旱警水位","","waterMoreDeadLessHJHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位高于死水位,低于旱警水位","","waterMoreDeadLessHJHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> waterComeOverHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位接近汛限告警","","waterComeOverHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位接近汛限告警","","waterComeOverHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> waterFirstOverHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位初次超汛限告警","","waterFirstOverHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位初次超汛限告警","","waterFirstOverHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> waterSmallScaleOverHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位小幅超汛限告警","","waterSmallScaleOverHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位小幅超汛限告警","","waterSmallScaleOverHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 策略7: 水位小幅超汛限告警-新-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("waterSmallScaleOver20Handle") |
| | | public ReturnT<String> waterSmallScaleOver20Handle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位小幅超汛限告警-新","","waterSmallScaleOver20Handle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> waterBigScaleOverHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位大幅超汛限告警","","waterBigScaleOverHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位大幅超汛限告警","","waterBigScaleOverHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> waterComeDesignHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位接近设计洪水位告警","","waterComeDesignHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位接近设计洪水位告警","","waterComeDesignHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> waterMoreDesignHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位超设计洪水位告警","","waterMoreDesignHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位超设计洪水位告警","","waterMoreDesignHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> waterMoreCheckHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位超校核洪水位告警","","waterMoreCheckHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位超校核洪水位告警","","waterMoreCheckHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> waterComeOneHourUpHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("近1h水位陡升","","waterComeOneHourUpHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("近1h水位陡升","","waterComeOneHourUpHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> waterComeOneHourDownHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("近1h水位陡降","","waterComeOneHourDownHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("近1h水位陡降","","waterComeOneHourDownHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> rainstormHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("暴雨降雨预警","","rainstormHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("暴雨降雨预警","","rainstormHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> alreadyHeavyRainHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("已降大雨告警","","alreadyHeavyRainHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("已降大雨告警","","alreadyHeavyRainHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> alreadyRainstormHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("已降暴雨告警","","alreadyRainstormHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("已降暴雨告警","","alreadyRainstormHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> twoHourRainHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("2小时降雨告警","","twoHourRainHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("2小时降雨告警","","twoHourRainHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> sixHourRainHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("6小时降雨告警","","sixHourRainHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("6小时降雨告警","","sixHourRainHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 策略18.1: 6小时降雨告警-新-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("sixHourRainHandle2") |
| | | public ReturnT<String> sixHourRainHandle2(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("6小时降雨告警-新","","sixHourRainHandle2"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> damSafetyHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("监测数据缺失","","damSafetyHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("监测数据缺失","","damSafetyHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> damSafetySyHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("测压管水位大于校核洪水位","","damSafetySyHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("测压管水位大于校核洪水位","","damSafetySyHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> damSafetySyNoneHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("渗压监测数据缺失","","damSafetySyNoneHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("渗压监测数据缺失","","damSafetySyNoneHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> damSafetySlNoneHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("渗流监测数据缺失","","damSafetySlNoneHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("渗流监测数据缺失","","damSafetySlNoneHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> damSafetyWyNoneHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("变形监测数据缺失","","damSafetyWyNoneHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("变形监测数据缺失","","damSafetyWyNoneHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> damSafetySyDataMissingHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("渗压资料缺失","","damSafetySyDataMissingHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("渗压资料缺失","","damSafetySyDataMissingHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> damSafetyBxDataMissingHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("变形资料缺失","","damSafetyBxDataMissingHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("变形资料缺失","","damSafetyBxDataMissingHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> damSafetySyLessThenPipeHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位低于管底高程","","damSafetySyLessThenPipeHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位低于管底高程","","damSafetySyLessThenPipeHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> damSafetySyHigherThenNozzleHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位大于管口高程","","damSafetySyHigherThenNozzleHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位大于管口高程","","damSafetySyHigherThenNozzleHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> damSafetySyHigherThenBdElevationHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位大于坝顶高程","","damSafetySyHigherThenBdElevationHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位大于坝顶高程","","damSafetySyHigherThenBdElevationHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> damSafetySyHigherThenWaterLevelHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位大于库水位","","damSafetySyHigherThenWaterLevelHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位大于库水位","","damSafetySyHigherThenWaterLevelHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> damSafetySyYellowChangeHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位变幅黄色告警","","damSafetySyYellowChangeHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位变幅黄色告警","","damSafetySyYellowChangeHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> damSafetySyOrangeChangeHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位变幅橙色告警","","damSafetySyOrangeChangeHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位变幅橙色告警","","damSafetySyOrangeChangeHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> damSafetySyRedChangeHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位变幅红色告警","","damSafetySyRedChangeHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位变幅红色告警","","damSafetySyRedChangeHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> damSafetySyRz1hChangeHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("近1h水位陡升陡降","","damSafetySyRz1hChangeHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("近1h水位陡升陡降","","damSafetySyRz1hChangeHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> damSafetyWyOver2Less5Handle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("变形值大于2cm小于5cm","","damSafetyWyOver2Less5Handle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("变形值大于2cm小于5cm","","damSafetyWyOver2Less5Handle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> damSafetyWyOver5Less10Handle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("变形值大于5cm小于10cm","","damSafetyWyOver5Less10Handle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("变形值大于5cm小于10cm","","damSafetyWyOver5Less10Handle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> damSafetyWyOver10Handle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("变形值大于10cm以上","","damSafetyWyOver10Handle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("变形值大于10cm以上","","damSafetyWyOver10Handle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> damSafetyWy1hChangeOver10Handle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("近1h变形值大于10cm以上","","damSafetyWy1hChangeOver10Handle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("近1h变形值大于10cm以上","","damSafetyWy1hChangeOver10Handle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> damSafetySlOver5Less8Handle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("渗流量一日大于5L小于8L连续3日增加","","damSafetySlOver5Less8Handle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("渗流量一日大于5L小于8L连续3日增加","","damSafetySlOver5Less8Handle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> damSafetySlOver8Less10Handle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("渗流量一日大于8L小于10L连续3日增加","","damSafetySlOver8Less10Handle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("渗流量一日大于8L小于10L连续3日增加","","damSafetySlOver8Less10Handle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> damSafetySlOver10Handle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("渗流量一日大于10L连续3日增加","","damSafetySlOver10Handle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("渗流量一日大于10L连续3日增加","","damSafetySlOver10Handle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> videoOfflineHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("视频信息接收不到","","videoOfflineHandle"); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("视频信息接收不到","","videoOfflineHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 策略42: 水位超防洪高水位告警-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("topLevOfFloAlertHandle") |
| | | public ReturnT<String> topLevOfFloAlertHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("超过防洪高水位","","topLevOfFloAlertHandle"); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | private IDayReportFloodClient dayReportFloodClient; |
| | | |
| | | /** |
| | | * 南科院Arima请求预测 |
| | | * 获取每日报汛内容 |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @XxlJob("saveYesterdayFloodReportContent") |
| | | public ReturnT<String> saveYesterdayFloodReportContent(String param) { |
| | | XxlJobLogger.log("任务开始"); |
| | | XxlJobLogger.log("定时器执行时间:" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(DateUtil.now())); |
| | | XxlJobLogger.log("参数:" + param); |
| | | JSONObject jsonParam = JSON.parseObject(param); |
| | | String isShow = ""; |
| | | if (jsonParam != null) { |
| | | isShow = jsonParam.getString("isShow"); |
| | | } else { |
| | | isShow = ""; |
| | | } |
| | | try { |
| | | sjztMdClient.saveYesterdayFloodReportContent(isShow); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | |
| | | XxlJobLogger.log("定时器执行结束时间:" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(DateUtil.now())); |
| | | XxlJobLogger.log("结束任务..."); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 每日报汛定时器 |
| | | * |
| | | * @param param |
| | | * @return |
| New file |
| | |
| | | package cn.gistack.job.executor.jobhandler; |
| | | |
| | | import cn.gistack.sm.hk.IHkStaffGaugeMonClient; |
| | | 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.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import java.util.concurrent.ExecutorService; |
| | | import java.util.concurrent.Executors; |
| | | |
| | | /** |
| | | * @PROJECT_NAME: skjcmanager |
| | | * @DESCRIPTION: 海康设备水尺监测 |
| | | * @USER: zhongrj |
| | | * @DATE: 2024/06/05 |
| | | */ |
| | | @Component |
| | | public class HkStaffGaugeMonXxlJob { |
| | | |
| | | @Autowired |
| | | private IHkStaffGaugeMonClient hkStaffGaugeMonClient; |
| | | |
| | | /** |
| | | * 海康设备水尺监测 |
| | | * @return |
| | | */ |
| | | @XxlJob("insertHkStaffGaugeMonInfo") |
| | | public ReturnT<String> insertHkStaffGaugeMonInfo(String param) { |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 海康设备水尺监测任务 |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | // 这里是你的异步任务逻辑 |
| | | hkStaffGaugeMonClient.insertHkStaffGaugeMonInfo(); |
| | | }); |
| | | |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | } |
| | |
| | | import com.xxl.job.core.handler.annotation.XxlJob; |
| | | import com.xxl.job.core.log.XxlJobLogger; |
| | | import io.swagger.models.auth.In; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | 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.concurrent.ExecutorService; |
| | | import java.util.concurrent.Executors; |
| | | |
| | | /** |
| | | * 巡查任务定时任务执行器 |
| | |
| | | * @date 2023-06-03 |
| | | */ |
| | | @Component |
| | | @Slf4j |
| | | public class PatrolXxlJob { |
| | | |
| | | @Autowired |
| | |
| | | String title = jsonParam.getString("title"); |
| | | String content = jsonParam.getString("content"); |
| | | String typeStr = jsonParam.getString("type"); |
| | | int type = 0; |
| | | if (!StringUtil.isBlank(typeStr)) |
| | | type = Integer.parseInt(typeStr); |
| | | |
| | | // 远程调用 |
| | | // List<Integer> taskJobHandler = patrolTasClient.createTaskJobHandler(processDefinitionId, taskType, title, content, type); |
| | | |
| | | List<Integer> taskJobHandler = patrolTasClient.createNewTaskJobHandler(taskType,title,content,type); |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | executorService.submit(() -> { |
| | | int type = 0; |
| | | if (!StringUtil.isBlank(typeStr)) |
| | | type = Integer.parseInt(typeStr); |
| | | // 这里是你的异步任务逻辑 |
| | | List<Integer> taskJobHandler = patrolTasClient.createNewTaskJobHandler(taskType,title,content,type); |
| | | |
| | | log.info("总数量:<span style='color:red'>" + taskJobHandler.get(0) + "</span> ... 失败数量:<span style='color:red'>" + taskJobHandler.get(1) + "</span> "); |
| | | }); |
| | | |
| | | // 打印响应数据 |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | XxlJobLogger.log("总数量:<span style='color:red'>" + taskJobHandler.get(0) + "</span> ... 失败数量:<span style='color:red'>" + taskJobHandler.get(1) + "</span> "); |
| | | |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| New file |
| | |
| | | package cn.gistack.job.executor.jobhandler; |
| | | |
| | | import cn.gistack.sm.sjztmd.feign.ISjztMdClient; |
| | | import cn.gistack.sm.sjztods.vo.SkxsQkTjVO; |
| | | 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.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | |
| | | @Component |
| | | public class ProjectXxlJob { |
| | | @Autowired |
| | | private ISjztMdClient sjztMdClient; |
| | | |
| | | @XxlJob("projectcheckHaJobHandler") |
| | | public ReturnT<String> projectStuta(String param) throws Exception { |
| | | XxlJobLogger.log("执行时间:"+ new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(DateUtil.now())); |
| | | sjztMdClient.setGetProjectCheckStatus(); |
| | | XxlJobLogger.log("完成时间:"+ new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(DateUtil.now())); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | } |
| | |
| | | package cn.gistack.job.executor.jobhandler; |
| | | |
| | | import cn.gistack.alerts.sms.feign.ISmsRecordClient; |
| | | import cn.gistack.sm.sjztmd.feign.ISjztMdClient; |
| | | import cn.gistack.sm.sjztods.feign.ISkxsQkTjClient; |
| | | 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.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.handler.annotation.XxlJob; |
| | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @PROJECT_NAME: skjcmanager |
| | |
| | | |
| | | @Autowired |
| | | private ISkxsQkTjClient skxsQkTjClient; |
| | | |
| | | @Autowired |
| | | private ISjztMdClient sjztMdClient; |
| | | |
| | | /** |
| | | * 大中型水库蓄水量日报 |
| | |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 水库降雨量预报 |
| | | */ |
| | | @XxlJob("reservoirRainfallForecastJobHandler") |
| | | public ReturnT<String> reservoirRainfallForecastJobHandler(String param) throws Exception { |
| | | XxlJobLogger.log("开始执行水库降雨量预报..."); |
| | | JSONObject jsonParam = JSON.parseObject(param); |
| | | // 获取 dayIndexList 数组 |
| | | JSONArray dayIndexArray = jsonParam.getJSONArray("dayIndexList"); |
| | | List<String> dayIndexList = new ArrayList<>(); |
| | | if (null != dayIndexArray && !dayIndexArray.isEmpty()) { |
| | | for (int i = 0; i < dayIndexArray.size(); i++) { |
| | | dayIndexList.add(dayIndexArray.getString(i)); |
| | | } |
| | | } |
| | | if (dayIndexList.isEmpty()) { |
| | | // dayIndex默认值为0 |
| | | dayIndexList.add("0"); |
| | | } |
| | | XxlJobLogger.log("dayIndex: " + dayIndexList); |
| | | sjztMdClient.getReservoirRainfallForecast(dayIndexList); |
| | | XxlJobLogger.log("结束执行水库降雨量预报任务..."); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | } |