7 files modified
13 files added
| | |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-excel</artifactId> |
| | | </dependency> |
| | | <!-- 数据编辑操作日志 修改前->修改后 --> |
| | | <dependency> |
| | | <groupId>io.geekidea.spring.boot</groupId> |
| | | <artifactId>update-record-mybatis-spring-boot-starter</artifactId> |
| | | <version>1.0-SNAPSHOT</version> |
| | | </dependency> |
| | | <!-- <!– 数据编辑操作日志 修改前->修改后 –>--> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>io.geekidea.spring.boot</groupId>--> |
| | | <!-- <artifactId>update-record-mybatis-spring-boot-starter</artifactId>--> |
| | | <!-- <version>1.0-SNAPSHOT</version>--> |
| | | <!-- </dependency>--> |
| | | <!-- word填充导出 --> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | |
| | | */ |
| | | @DS("zt") |
| | | Set<Scene> getPatrolPersonListByWaterCodeList(@Param("list") List<String> list); |
| | | |
| | | String getCompetentDepart(@Param("resCd") String resCd); |
| | | |
| | | List<AttResManagePerson> getPersonList(@Param("resCd") String resCd); |
| | | } |
| | |
| | | |
| | | |
| | | </select> |
| | | <select id="getCompetentDepart" resultType="java.lang.String"> |
| | | SELECT "c_unit_name" FROM SJZT_MD."att_res_mgr_sys_b" WHERE "res_guid" = #{resCd} |
| | | </select> |
| | | <select id="getPersonList" resultType="cn.gistack.sm.sjztmd.entity.AttResManagePerson"> |
| | | SELECT * FROM "SJZT_MD"."att_res_manage_person" WHERE "res_guid" = #{resCd} |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.mapper; |
| | | |
| | | import java.util.HashMap; |
| | | |
| | | public interface SjztMdMapper { |
| | | /** |
| | | * 获取 正常溢洪道、泄洪洞、非常溢洪道、电站 |
| | | * @param resCd |
| | | * @return |
| | | */ |
| | | HashMap<String,Integer> countNum(String resCd); |
| | | } |
| 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.SjztMdMapper"> |
| | | |
| | | |
| | | <select id="countNum" resultType="java.util.HashMap"> |
| | | SELECT |
| | | (SELECT COUNT(*) FROM SJZT_MD."tb_att_res_rsb_norspi" WHERE "res_guid" = '42011550078') norspiCount, |
| | | (SELECT COUNT(*) FROM SJZT_MD."tb_att_res_rsb_spillway" WHERE "res_guid" = '42011550078') spillwayCount, |
| | | (SELECT COUNT(*) FROM SJZT_MD."tb_att_res_rsb_verspi" WHERE "res_guid" = '42011550078') spillwayCount |
| | | |
| | | </select> |
| | | </mapper> |
| | |
| | | * @return |
| | | */ |
| | | Set<Scene> getPatrolPersonListByWaterCodeList(List<String> stringList); |
| | | |
| | | /** |
| | | * 从att_res_mgr_sys_b表中获取主管部门 |
| | | * @param resCd |
| | | * @return |
| | | */ |
| | | String getCompetentDepart(String resCd); |
| | | |
| | | /** |
| | | * 根据水库id获取责任人 |
| | | * @param resCd |
| | | * @return |
| | | */ |
| | | List<AttResManagePerson> getPersonList(String resCd); |
| | | } |
| | |
| | | public Set<Scene> getPatrolPersonListByWaterCodeList(List<String> stringList) { |
| | | return baseMapper.getPatrolPersonListByWaterCodeList(stringList); |
| | | } |
| | | |
| | | @Override |
| | | public String getCompetentDepart(String resCd) { |
| | | return baseMapper.getCompetentDepart(resCd); |
| | | } |
| | | |
| | | @Override |
| | | public List<AttResManagePerson> getPersonList(String resCd) { |
| | | return baseMapper.getPersonList(resCd); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | import cn.gistack.sm.sjztmd.word.service.ISjztmdService; |
| | | import cn.gistack.sm.sjztmd.word.util.WordUtil; |
| | | import cn.gistack.sm.sjztmd.word.vo.TbWordVO; |
| | | import com.deepoove.poi.XWPFTemplate; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | @AllArgsConstructor |
| | | public class DownTemplateController { |
| | | |
| | | private final ISjztmdService sjztmdService; |
| | | |
| | | @GetMapping("/download/{resGuid}") |
| | | public ResponseEntity genera(HttpServletResponse response, @PathVariable String resGuid) throws Exception { |
| | | TbWordVO tbWordVO = sjztmdService.getTbWordVO(resGuid); |
| | | |
| | | String fileName = resGuid + ".docx"; |
| | | byte[] data = WordUtil.compileTemplateAndRenderData(); |
| | | byte[] data = WordUtil.compileTemplateAndRenderData(tbWordVO); |
| | | |
| | | // 创建响应实体并设置响应头,将输出流作为响应体返回给客户端 |
| | | InputStreamResource resource = new InputStreamResource(new ByteArrayInputStream(data)); |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.word.enums; |
| | | |
| | | import lombok.Getter; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * 调节性能枚举 |
| | | */ |
| | | @Getter |
| | | public enum AdjustPropEnum { |
| | | /** |
| | | * [{ |
| | | * value: '1', |
| | | * label: '多年调节' |
| | | * }, { |
| | | * value: '2', |
| | | * label: '年调节' |
| | | * }, { |
| | | * value: '3', |
| | | * label: '不完全年调节' |
| | | * }, { |
| | | * value: '4', |
| | | * label: '季调节' |
| | | * }, { |
| | | * value: '5', |
| | | * label: '月调节' |
| | | * }, { |
| | | * value: '6', |
| | | * label: '周调节' |
| | | * }, { |
| | | * value: '7', |
| | | * label: '日调节' |
| | | * }, { |
| | | * value: '8', |
| | | * label: '无' |
| | | * }, { |
| | | * value: '9', |
| | | * label: '其他' |
| | | * }] |
| | | */ |
| | | |
| | | |
| | | DUO_NIAN_TIAO_JIE("1","多年调节"), |
| | | |
| | | NIAN_TIAO_JIE("2","年调节"), |
| | | |
| | | BU_WAN_QUAN_NIAN_TIAO_JIE("3","不完全年调节"), |
| | | |
| | | JI_TIAO_JIE("4","季调节"), |
| | | |
| | | YUE_TIAO_JIE("5","月调节"), |
| | | |
| | | ZHOU_TIAO_JIE("6","周调节"), |
| | | |
| | | RI_TIAO_JIE("7","日调节"), |
| | | |
| | | WU("8","无"), |
| | | |
| | | QI_TA("9","其他"), |
| | | |
| | | NULL_ABLE("",""); |
| | | |
| | | String key; |
| | | |
| | | String label; |
| | | AdjustPropEnum(String key,String label) { |
| | | this.key = key; |
| | | this.label = label; |
| | | } |
| | | |
| | | public static AdjustPropEnum find(String key) { |
| | | return Arrays.stream(values()).filter(resFucEnum -> resFucEnum.key.equals(key)).findAny().orElse(NULL_ABLE); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.word.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * 输水道形式枚举 |
| | | */ |
| | | @Getter |
| | | public enum AqueductTypeEnum { |
| | | |
| | | /** |
| | | * [ |
| | | * { |
| | | * value: 1, |
| | | * label: '管道' |
| | | * }, { |
| | | * value: 2, |
| | | * label: '隧洞' |
| | | * }, { |
| | | * value: 3, |
| | | * label: '地面渠道' |
| | | * }, { |
| | | * value: 4, |
| | | * label: '高架渠道(包括渡槽)' |
| | | * }, { |
| | | * value: 9, |
| | | * label: '其他' |
| | | * } |
| | | * ] |
| | | */ |
| | | |
| | | GUAN_DAO("1","管道"), |
| | | |
| | | SUI_DONG("2","隧道"), |
| | | |
| | | DI_MIAN_QU_DAO("3","地面渠道"), |
| | | |
| | | GAO_JIA_QU_DAO("4","高架渠道(包括渡槽)"), |
| | | |
| | | QI_TA("9","其他"), |
| | | |
| | | NULL_ABLE("",""); |
| | | |
| | | String key; |
| | | |
| | | String label; |
| | | AqueductTypeEnum(String key, String label) { |
| | | this.key = key; |
| | | this.label = label; |
| | | } |
| | | |
| | | public static AqueductTypeEnum find(String key) { |
| | | return Arrays.stream(values()).filter(resFucEnum -> resFucEnum.key.equals(key)).findAny().orElse(NULL_ABLE); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.word.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * 设计洪水标准枚举 |
| | | */ |
| | | @Getter |
| | | public enum ChecFlStaEnum { |
| | | /** |
| | | * [ |
| | | * { |
| | | * value: '0.01', |
| | | * label: '万年一遇' |
| | | * }, |
| | | * { |
| | | * value: '0.02', |
| | | * label: '五千年一遇' |
| | | * }, |
| | | * { |
| | | * value: '0.033', |
| | | * label: '三千年一遇' |
| | | * }, |
| | | * { |
| | | * value: '0.05', |
| | | * label: '两千年一遇' |
| | | * }, |
| | | * { |
| | | * value: '0.1', |
| | | * label: '千年一遇' |
| | | * }, |
| | | * { |
| | | * value: '0.2', |
| | | * label: '五百年一遇' |
| | | * }, |
| | | * { |
| | | * value: '0.33', |
| | | * label: '三百年一遇' |
| | | * }, |
| | | * { |
| | | * value: '0.5', |
| | | * label: '两百年一遇' |
| | | * }, |
| | | * { |
| | | * value: '1', |
| | | * label: '百年一遇' |
| | | * }, |
| | | * { |
| | | * value: '2', |
| | | * label: '五十年一遇' |
| | | * }, |
| | | * { |
| | | * value: '3.33', |
| | | * label: '三十年一遇' |
| | | * }, |
| | | * { |
| | | * value: '5', |
| | | * label: '二十年一遇' |
| | | * }, |
| | | * { |
| | | * value: '10', |
| | | * label: '十年一遇' |
| | | * } |
| | | * ] |
| | | */ |
| | | |
| | | |
| | | WAN("0.01","万年一遇"), |
| | | |
| | | WU_QIAN("0.02","五千年一遇"), |
| | | |
| | | SAN_QIAN("0.033","三千年一遇"), |
| | | |
| | | LIANG_QIAN("0.05","两千年一遇"), |
| | | |
| | | QIAN("0.1","千年一遇"), |
| | | |
| | | WU_BAI("0.2","五百年一遇"), |
| | | |
| | | SAN_BAI("0.33","三百年一遇"), |
| | | |
| | | LIANG_BAI("0.5","两百年一遇"), |
| | | |
| | | YI_BAI("1","百年一遇"), |
| | | |
| | | WU_SHI("2","五十年一遇"), |
| | | |
| | | SAN_SHI("3.33","三十年一遇"), |
| | | |
| | | ER_SHI("5","二十年一遇"), |
| | | SHI("10","十年一遇"), |
| | | WU("20","五年一遇"), |
| | | |
| | | NULL_ABLE("",""); |
| | | |
| | | |
| | | String key; |
| | | |
| | | String label; |
| | | ChecFlStaEnum(String key, String label) { |
| | | this.key = key; |
| | | this.label = label; |
| | | } |
| | | |
| | | public static ChecFlStaEnum find(String key) { |
| | | return Arrays.stream(values()).filter(resFucEnum -> resFucEnum.key.equals(key)).findAny().orElse(NULL_ABLE); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.word.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * 大坝类型枚举 |
| | | */ |
| | | @Getter |
| | | public enum DamTypeEnum { |
| | | /** |
| | | * { |
| | | * "label": "常态混凝土实体重力坝", |
| | | * "value": "DAA001" |
| | | * }, |
| | | * { |
| | | * "label": "常态混凝土宽缝重力坝", |
| | | * "value": "DAA002" |
| | | * }, |
| | | * { |
| | | * "label": "常态混凝土空腹重力坝", |
| | | * "value": "DAA003" |
| | | * }, |
| | | * { |
| | | * "label": "碾压混凝土重力坝", |
| | | * "value": "DAA004" |
| | | * } |
| | | */ |
| | | DAA001("DAA001","常态混凝土实体重力坝"), |
| | | DAA002("DAA002","常态混凝土宽缝重力坝"), |
| | | DAA003("DAA003","常态混凝土空腹重力坝"), |
| | | DAA004("DAA004","碾压混凝土重力坝"), |
| | | |
| | | /** |
| | | * { |
| | | * "label": "常态混凝土单曲拱坝", |
| | | * "value": "DAB001" |
| | | * }, |
| | | * { |
| | | * "label": "常态混凝土双曲拱坝", |
| | | * "value": "DAB002" |
| | | * }, |
| | | * { |
| | | * "label": "常态混凝土变曲拱坝", |
| | | * "value": "DAB003" |
| | | * }, |
| | | * { |
| | | * "label": "碾压混凝土单曲拱坝", |
| | | * "value": "DAB004" |
| | | * }, |
| | | * { |
| | | * "label": "碾压混凝土双曲拱坝", |
| | | * "value": "DAB005" |
| | | * }, |
| | | * { |
| | | * "label": "碾压混凝土变曲拱坝", |
| | | * "value": "DAB006" |
| | | * } |
| | | */ |
| | | DAB001("DAB001","常态混凝土单曲拱坝"), |
| | | DAB002("DAB002","常态混凝土双曲拱坝"), |
| | | DAB003("DAB003","常态混凝土变曲拱坝"), |
| | | DAB004("DAB004","碾压混凝土单曲拱坝"), |
| | | DAB005("DAB005","碾压混凝土双曲拱坝"), |
| | | DAB006("DAB006","碾压混凝土变曲拱坝"), |
| | | |
| | | /** |
| | | * { |
| | | * "label": "平板坝", |
| | | * "value": "DAC001" |
| | | * }, |
| | | * { |
| | | * "label": "大头坝", |
| | | * "value": "DAC002" |
| | | * }, |
| | | * { |
| | | * "label": "连拱坝", |
| | | * "value": "DAC003" |
| | | * } |
| | | */ |
| | | DAC001("DAC001","平板坝"), |
| | | DAC002("DAC002","大头坝"), |
| | | DAC003("DAC003","连拱坝"), |
| | | |
| | | /** |
| | | * { |
| | | * "label": "均质土坝", |
| | | * "value": "DBA001" |
| | | * }, |
| | | * { |
| | | * "label": "粘土心墙坝", |
| | | * "value": "DBA002" |
| | | * }, |
| | | * { |
| | | * "label": "沥青心墙坝", |
| | | * "value": "DBA003" |
| | | * }, |
| | | * { |
| | | * "label": "土工膜心墙坝", |
| | | * "value": "DBA004" |
| | | * }, |
| | | * { |
| | | * "label": "混凝土心墙坝", |
| | | * "value": "DBA005" |
| | | * }, |
| | | * { |
| | | * "label": "粘土斜墙坝", |
| | | * "value": "DBA006" |
| | | * }, |
| | | * { |
| | | * "label": "沥青斜墙坝", |
| | | * "value": "DBA007" |
| | | * }, |
| | | * { |
| | | * "label": "土工膜斜墙坝", |
| | | * "value": "DBA008" |
| | | * }, |
| | | * { |
| | | * "label": "土石混合坝", |
| | | * "value": "DBA009" |
| | | * } |
| | | */ |
| | | DBA001("DBA001","均质土坝"), |
| | | DBA002("DBA002","粘土心墙坝"), |
| | | DBA003("DBA003","沥青心墙坝"), |
| | | DBA004("DBA004","土工膜心墙坝"), |
| | | DBA005("DBA005","粘土斜墙坝"), |
| | | DBA006("DBA006","粘土斜墙坝"), |
| | | DBA007("DBA007","沥青斜墙坝"), |
| | | DBA008("DBA008","土工膜斜墙坝"), |
| | | DBA009("DBA009","土石混合坝"), |
| | | |
| | | /** |
| | | * { |
| | | * "label": "面板堆石坝", |
| | | * "value": "DBB0" |
| | | * }, |
| | | * { |
| | | * "label": "水力冲填坝", |
| | | * "value": "DBC0" |
| | | * }, |
| | | * { |
| | | * "label": "定向爆破坝", |
| | | * "value": "DBD0" |
| | | * } |
| | | */ |
| | | DBB0("DBB0","面板堆石坝"), |
| | | DBC0("DBC0","水力冲填坝"), |
| | | DBD0("DBD0","定向爆破坝"), |
| | | |
| | | /** |
| | | * { |
| | | * "value": "DCA0", |
| | | * "label": "砌石重力坝" |
| | | * }, |
| | | * { |
| | | * "value": "DCB0", |
| | | * "label": "砌石拱坝" |
| | | * } |
| | | */ |
| | | DCA0("DCA0","砌石重力坝"), |
| | | DCB0("DCB0","砌石拱坝"), |
| | | |
| | | QI_TA("DD","其他"), |
| | | |
| | | NULL_ABLE("",""); |
| | | |
| | | String key; |
| | | |
| | | String label; |
| | | DamTypeEnum(String key, String label) { |
| | | this.key = key; |
| | | this.label = label; |
| | | } |
| | | |
| | | public static DamTypeEnum find(String key) { |
| | | return Arrays.stream(values()).filter(resFucEnum -> resFucEnum.key.equals(key)).findAny().orElse(NULL_ABLE); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.word.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * 设计洪水标准枚举 |
| | | */ |
| | | @Getter |
| | | public enum DesFlStaEnum { |
| | | /** |
| | | * [ |
| | | * { |
| | | * value: '0.05', |
| | | * label: '两千年一遇' |
| | | * }, |
| | | * { |
| | | * value: '0.1', |
| | | * label: '千年一遇' |
| | | * }, |
| | | * { |
| | | * value: '0.2', |
| | | * label: '五百年一遇' |
| | | * }, |
| | | * { |
| | | * value: '0.33', |
| | | * label: '三百年一遇' |
| | | * }, |
| | | * { |
| | | * value: '0.5', |
| | | * label: '两百年一遇' |
| | | * }, |
| | | * { |
| | | * value: '1', |
| | | * label: '百年一遇' |
| | | * }, |
| | | * { |
| | | * value: '2', |
| | | * label: '五十年一遇' |
| | | * }, |
| | | * { |
| | | * value: '3.33', |
| | | * label: '三十年一遇' |
| | | * }, |
| | | * { |
| | | * value: '5', |
| | | * label: '二十年一遇' |
| | | * }, |
| | | * { |
| | | * value: '10', |
| | | * label: '十年一遇' |
| | | * }, |
| | | * { |
| | | * value: '20', |
| | | * label: '五年一遇' |
| | | * } |
| | | * ] |
| | | */ |
| | | |
| | | |
| | | LIANG_QIAN("0.05","两千年一遇"), |
| | | |
| | | QIAN("0.1","千年一遇"), |
| | | |
| | | WU_BAI("0.2","五百年一遇"), |
| | | |
| | | SAN_BAI("0.33","三百年一遇"), |
| | | |
| | | LIANG_BAI("0.5","两百年一遇"), |
| | | |
| | | YI_BAI("1","百年一遇"), |
| | | |
| | | WU_SHI("2","五十年一遇"), |
| | | |
| | | SAN_SHI("3.33","三十年一遇"), |
| | | |
| | | ER_SHI("5","二十年一遇"), |
| | | SHI("10","十年一遇"), |
| | | WU("20","五年一遇"), |
| | | NULL_ABLE("",""); |
| | | |
| | | |
| | | String key; |
| | | |
| | | String label; |
| | | DesFlStaEnum(String key, String label) { |
| | | this.key = key; |
| | | this.label = label; |
| | | } |
| | | |
| | | public static DesFlStaEnum find(String key) { |
| | | return Arrays.stream(values()).filter(resFucEnum -> resFucEnum.key.equals(key)).findAny().orElse(NULL_ABLE); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.word.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * 水库功能枚举 |
| | | */ |
| | | @Getter |
| | | public enum ResFucEnum { |
| | | |
| | | /** |
| | | * { |
| | | * value: '1', |
| | | * label: '防洪' |
| | | * }, { |
| | | * value: '2', |
| | | * label: '灌溉' |
| | | * }, { |
| | | * value: '3', |
| | | * label: '供水' |
| | | * }, { |
| | | * value: '4', |
| | | * label: '发电' |
| | | * }, { |
| | | * value: '5', |
| | | * label: '航运' |
| | | * }, { |
| | | * value: '6', |
| | | * label: '防凌' |
| | | * }, { |
| | | * value: '7', |
| | | * label: '生态' |
| | | * }, { |
| | | * value: '8', |
| | | * label: '旅游' |
| | | * }, { |
| | | * value: '9', |
| | | * label: '养殖' |
| | | * }, { |
| | | * value: '10', |
| | | * label: '其他' |
| | | * } |
| | | */ |
| | | |
| | | FANG_HONG("1","防洪"), |
| | | |
| | | GUAN_GAI("2","灌溉"), |
| | | |
| | | GONG_SHUI("3","供水"), |
| | | |
| | | FA_DIAN("4","发电"), |
| | | |
| | | HANG_YUN("5","航运"), |
| | | |
| | | |
| | | FANG_LING("6","防凌"), |
| | | |
| | | SHENG_TAI("7","生态"), |
| | | |
| | | LV_YOU("8","旅游"), |
| | | |
| | | YANG_ZHI("9","养殖"), |
| | | |
| | | QI_TA("10","其他"), |
| | | |
| | | NULL_ABLE("",""); |
| | | |
| | | String key; |
| | | |
| | | String label; |
| | | ResFucEnum(String key,String label) { |
| | | this.key = key; |
| | | this.label = label; |
| | | } |
| | | |
| | | public static ResFucEnum find(String key) { |
| | | return Arrays.stream(values()).filter(resFucEnum -> resFucEnum.key.equals(key)).findAny().orElse(NULL_ABLE); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.word.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * 安全鉴定枚举 |
| | | */ |
| | | @Getter |
| | | public enum SafetyAppraisalTypeEnum { |
| | | |
| | | /** |
| | | * [{ |
| | | * value: '1', |
| | | * label: '一类坝' |
| | | * }, { |
| | | * value: '2', |
| | | * label: '二类坝' |
| | | * }, { |
| | | * value: '3', |
| | | * label: '三类坝' |
| | | * }] |
| | | */ |
| | | |
| | | FIRST("1","一类坝"), |
| | | |
| | | SECOND("2","二类坝"), |
| | | |
| | | THIRD("3","三类坝"), |
| | | NULL_ABLE("",""); |
| | | |
| | | |
| | | String key; |
| | | |
| | | String label; |
| | | SafetyAppraisalTypeEnum(String key, String label) { |
| | | this.key = key; |
| | | this.label = label; |
| | | } |
| | | |
| | | public static SafetyAppraisalTypeEnum find(String key) { |
| | | return Arrays.stream(values()).filter(resFucEnum -> resFucEnum.key.equals(key)).findAny().orElse(NULL_ABLE); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.word.enums; |
| | | |
| | | import io.swagger.models.auth.In; |
| | | import lombok.Getter; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * 正常溢洪道形式枚举 |
| | | */ |
| | | @Getter |
| | | public enum SpillwayTypeEnum { |
| | | |
| | | /** |
| | | * { |
| | | * value: 1, |
| | | * label: '正槽式溢洪道' |
| | | * }, { |
| | | * value: 2, |
| | | * label: '侧槽式溢洪道' |
| | | * }, { |
| | | * value: 3, |
| | | * label: '井式溢洪道' |
| | | * }, { |
| | | * value: 4, |
| | | * label: '虹吸式溢洪道' |
| | | * }, { |
| | | * value: 5, |
| | | * label: '溢流坝段坝顶溢流' |
| | | * }, { |
| | | * value: 9, |
| | | * label: '其他' |
| | | * } |
| | | */ |
| | | |
| | | ZC(1,"正槽式溢洪道"), |
| | | |
| | | CC(2,"侧槽式溢洪道"), |
| | | |
| | | JS(3,"井式溢洪道"), |
| | | |
| | | HX(4,"虹吸式溢洪道"), |
| | | |
| | | YLB(5,"溢流坝段坝顶溢流"), |
| | | |
| | | |
| | | QI_TA(9,"其他"), |
| | | |
| | | NULL_ABLE(-1,""); |
| | | |
| | | Integer key; |
| | | |
| | | String label; |
| | | SpillwayTypeEnum(Integer key, String label) { |
| | | this.key = key; |
| | | this.label = label; |
| | | } |
| | | |
| | | public static SpillwayTypeEnum find(Integer key) { |
| | | return Arrays.stream(values()).filter(resFucEnum -> resFucEnum.key==key).findAny().orElse(NULL_ABLE); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.word.service; |
| | | |
| | | import cn.gistack.sm.sjztmd.word.vo.TbWordVO; |
| | | |
| | | public interface ISjztmdService { |
| | | |
| | | /** |
| | | * 根据水库编码获取填报word对象 |
| | | * @param resCd |
| | | * @return |
| | | */ |
| | | TbWordVO getTbWordVO(String resCd); |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.word.service.impl; |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.*; |
| | | import cn.gistack.sm.sjztmd.mapper.SjztMdMapper; |
| | | import cn.gistack.sm.sjztmd.service.*; |
| | | import cn.gistack.sm.sjztmd.word.service.ISjztmdService; |
| | | import cn.gistack.sm.sjztmd.word.vo.TbWordVO; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | @AllArgsConstructor |
| | | @DS("zt") |
| | | public class SjztmdServiceImpl implements ISjztmdService { |
| | | |
| | | private final SjztMdMapper mapper; |
| | | |
| | | private final ITbAttResBaseService attResBaseService; |
| | | private final ITbAttResStagCharService attResStagCharService; |
| | | private final ITbAttResWaterDeliveryService attResWaterDeliveryService; |
| | | private final ITbAttResEngBeneService attResEngBeneService; |
| | | private final ITbAttResSafetyMonitorService attResSafetyMonitorService; |
| | | private final ITbAttResMgrSysBService attResMgrSysBService; |
| | | private final IAttResManagePersonService attResManagePersonService; |
| | | private final ITbAttResWaterBlockService attResWaterBlockService; |
| | | private final ITbAttResRsbNorspiService attResRsbNorspiService; |
| | | private final ITbAttResPowerStationService attResPowerStationService; |
| | | |
| | | @Override |
| | | public TbWordVO getTbWordVO(String resCd) { |
| | | |
| | | |
| | | TbAttResBase tbAttResBase = attResBaseService.getDetailByGuid(resCd); |
| | | TbAttResStagChar tbAttResStagChar = attResStagCharService.getDetailByGuid(resCd); |
| | | List<TbAttResWaterDelivery> tbAttResWaterDeliveryList = attResWaterDeliveryService.getDetailByGuid(resCd); |
| | | //挡水建筑物 |
| | | List<TbAttResWaterBlock> tbAttResWaterBlockList = attResWaterBlockService.getDetailByGuid(resCd); |
| | | |
| | | //正常溢洪道、泄洪洞、非常溢洪道 |
| | | Map<String, Object> resRsbNorsipiVerspiMionitorDetailByGuid = attResRsbNorspiService.getResRsbNorsipiVerspiMionitorDetailByGuid(resCd); |
| | | |
| | | //电站 |
| | | List<TbAttResPowerStation> tbAttResPowerStationList = attResPowerStationService.getDetailByGuid(resCd); |
| | | |
| | | TbAttResEngBene tbAttResEngBene = attResEngBeneService.getDetailByGuid(resCd); |
| | | TbAttResSafetyMonitor tbAttResSafetyMonitor = attResSafetyMonitorService.getDetailByGuid(resCd); |
| | | TbAttResMgrSysB tbAttResMgrSysB = attResMgrSysBService.getDetailByGuid(resCd); |
| | | List<AttResManagePerson> attResManagePeople = attResManagePersonService.getPersonList(resCd); |
| | | |
| | | String depart = attResManagePersonService.getCompetentDepart(resCd); |
| | | |
| | | TbWordVO tbWordVO = new TbWordVO(tbAttResBase, tbAttResStagChar, tbAttResWaterBlockList,resRsbNorsipiVerspiMionitorDetailByGuid,tbAttResPowerStationList, |
| | | tbAttResWaterDeliveryList, tbAttResEngBene,tbAttResSafetyMonitor,tbAttResMgrSysB,attResManagePeople); |
| | | tbWordVO.setCUnitName(depart); |
| | | |
| | | return tbWordVO; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package cn.gistack.sm.sjztmd.word.util; |
| | | |
| | | import cn.gistack.sm.sjztmd.word.vo.TbWordVO; |
| | | import com.deepoove.poi.XWPFTemplate; |
| | | |
| | | import java.io.*; |
| | |
| | | */ |
| | | public class WordUtil { |
| | | |
| | | public static byte[] compileTemplateAndRenderData() throws Exception { |
| | | public static byte[] compileTemplateAndRenderData(TbWordVO tbWordVO) throws Exception { |
| | | InputStream inputStream = WordUtil.class.getClassLoader().getResourceAsStream("word/doc/skcgmb.docx"); |
| | | ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
| | | XWPFTemplate template = XWPFTemplate.compile(inputStream).render(createParams()); |
| | | XWPFTemplate template = XWPFTemplate.compile(inputStream).render(createParams(tbWordVO)); |
| | | template.write(outputStream); |
| | | outputStream.flush(); |
| | | outputStream.close(); |
| | |
| | | * 根据水库id获取数据 |
| | | * @return |
| | | */ |
| | | private static Map<String, Object> createParams() { |
| | | private static Map<String, Object> createParams(TbWordVO tbWordVO) { |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("水库名称", "杨树堰水库"); |
| | | params.put("市", "黄冈市"); |
| | | params.put("县", "蕲春县"); |
| | | params.put("镇", "土匪镇"); |
| | | params.put("河流名称", "滠水支流泊沫河"); |
| | | params.put("水库功能", "防洪、灌溉、供水等综合"); |
| | | params.put("调节性能", "多年调节"); |
| | | params.put("水库坝址以上控制流域面积", "21"); |
| | | params.put("流域多年平均降雨量", "1171"); |
| | | params.put("多年平均年径流量", "1260"); |
| | | params.put("设计洪水标准", "五十年一遇"); |
| | | params.put("校核洪水标准", "千年一遇"); |
| | | params.put("总库容", "2823"); |
| | | params.put("水文特征", "兴利库容1741万m³,调洪库容568万m³,死库容514万m³;校核洪水位54.18m,设计洪水位53.45m,正常蓄水位51.92m,死水位41.42 m"); |
| | | params.put("工程等别","Ⅲ"); |
| | | params.put("挡水建筑物泄洪建筑物正常溢洪道","副坝、输水混凝土箱涵"); |
| | | params.put("主坝信息","主坝为粘土心墙坝,坝顶高程55.00m,最大坝高22m,坝长230m,坝顶宽5.5m。"); |
| | | params.put("挡水建筑物泄洪建筑物正常溢洪道等详情","副坝为均质土坝,坝顶高程55.00m,最大坝高14.4m,坝长65m,坝顶宽5.5m。" + |
| | | "溢洪道为正槽式溢洪道,无闸控制(溢洪道根据是否有闸控制确定,填有闸控制、无闸控制),堰顶高程51.92m,堰顶净宽36m,最大泄洪量262m³/s。"); |
| | | params.put("输水建筑物输水道形式","主要采用地面渠道输水");//若有两个以上输水建筑物,则描述设计流量较大的,若只有一个输水建筑物则去掉“主要” |
| | | params.put("断面尺寸","3X4"); |
| | | params.put("进口底槛高程","46.12"); |
| | | params.put("设计流量","20"); |
| | | params.put("保护城市","黄陂城区"); |
| | | params.put("保护人口保护耕地","3万人口、2万亩耕地"); |
| | | params.put("保护铁路","京广铁路、京九铁路等");//铁路、公路、管线、企业几个依次罗列,超过三个列出第二个后为“XX等”,后面不需罗列 |
| | | params.put("经济效益","水库为梅院泥灌区(与梅店、院基寺联合运用)提供灌溉用水,设计灌溉面积32.76万亩,有效灌溉面积24万亩,多年平均灌溉水量560万m³。" + |
| | | "此外,水库为罗汉寺街、李家集街12万人提供生活用水,年均供水量511万m³。");//若既有灌溉又有供水,则有“此外,”,无灌溉有供水直接介绍供水 |
| | | params.put("工程始建时间","1958年1月"); |
| | | params.put("下闸蓄水时间","1958年7月"); |
| | | params.put("水库名称", tbWordVO.getResName()); |
| | | params.put("市", tbWordVO.getCityName()); |
| | | params.put("县", tbWordVO.getCountyName()); |
| | | params.put("镇", tbWordVO.getTownName()); |
| | | 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("设计洪水标准", tbWordVO.getDesFlSta()); |
| | | params.put("校核洪水标准", tbWordVO.getChecFlSta()); |
| | | params.put("总库容", tbWordVO.getTotalCap()); |
| | | params.put("水文特征", tbWordVO.getHydrologicalCharacteristics()); |
| | | params.put("工程等别",tbWordVO.getEngGrad()); |
| | | params.put("挡水建筑物泄洪建筑物正常溢洪道",tbWordVO.getBuildingText()); |
| | | params.put("主坝信息",tbWordVO.getMainDamInfo()); |
| | | params.put("挡水建筑物泄洪建筑物正常溢洪道等详情",tbWordVO.getBuildingInfo()); |
| | | params.put("输水建筑物输水道形式",tbWordVO.getAqueductType());//若有两个以上输水建筑物,则描述设计流量较大的,若只有一个输水建筑物则去掉“主要” |
| | | params.put("断面尺寸",tbWordVO.getSection()); |
| | | params.put("进口底槛高程",tbWordVO.getThresholdElevation()); |
| | | params.put("设计流量",tbWordVO.getDesignFlow()); |
| | | params.put("保护城市",tbWordVO.getProtectCity()); |
| | | params.put("保护人口保护耕地",tbWordVO.getProtectPersonLand()); |
| | | params.put("保护铁路",tbWordVO.getProtectThings());//铁路、公路、管线、企业几个依次罗列,超过三个列出第二个后为“XX等”,后面不需罗列 |
| | | params.put("经济效益",tbWordVO.getEconomicBenefit());//若既有灌溉又有供水,则有“此外,”,无灌溉有供水直接介绍供水 |
| | | params.put("工程始建时间",tbWordVO.getStartTime()); |
| | | params.put("下闸蓄水时间",tbWordVO.getWaterStorageTm()); |
| | | // 鉴定时间 > 除险加固 |
| | | params.put("安全鉴定和除险加固","2022年3月,水库进行安全鉴定,鉴定结果为\"三类坝\",工程主要存在问题为2022年安全鉴定武汉市水务局批复为三类坝,大坝中心未出复核意见。心墙渗透系数偏大。"); |
| | | params.put("安全鉴定和除险加固",tbWordVO.getSafetyMonitorText()); |
| | | // 鉴定时间 < 除险加固 |
| | | //params.put("安全鉴定和除险加固","2012年9月,水库进行安全鉴定,鉴定结果为“三类坝”(加一个双引号),工程主要存在问题为坝顶及心墙顶欠高,大坝渗透系数偏大,溢洪道过流能力不足、边墙高度不足等(加一个“等”)。 |
| | | // 针对水库安全鉴定发现的问题,水库除险加固工程于2019年11月动工,2022年6月蓄水验收。"); |
| | | params.put("管理单位名称","武汉市黄陂区梅院泥水库管理处"); |
| | | params.put("管理单位性质","公益类"); |
| | | params.put("主管部门","黄陂区水务和湖泊局管理");// 水库基本信息表,不是填报表 |
| | | params.put("管理单位职工人数","106"); |
| | | params.put("主管部门责任人","敖志雄(领导,13871305098)"); // 责任人信息表,不是填报表 |
| | | params.put("行政主管单位","黄陂区人民政府"); |
| | | params.put("行政责任人职务手机号码","邱昌春(副区长,13995616668)"); // 责任人信息表,不是填报表 |
| | | params.put("管理单位名称",tbWordVO.getMUnitName()); |
| | | params.put("管理单位性质",tbWordVO.getMUnitNature()); |
| | | params.put("主管部门",tbWordVO.getCUnitName());// 水库基本信息表,不是填报表 |
| | | params.put("管理单位职工人数",tbWordVO.getMUnitPersonNumber()); |
| | | params.put("主管部门责任人",tbWordVO.getCompetentDepartmentInfo()); // 责任人信息表,不是填报表 |
| | | params.put("行政主管单位",tbWordVO.getAdministrativeUnit()); |
| | | params.put("行政责任人职务手机号码",tbWordVO.getAdministrativeInfo()); // 责任人信息表,不是填报表 |
| | | return params; |
| | | } |
| | | |
| New file |
| | |
| | | package cn.gistack.sm.sjztmd.word.vo; |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.*; |
| | | import cn.gistack.sm.sjztmd.word.enums.*; |
| | | import com.alibaba.nacos.common.utils.StringUtils; |
| | | import lombok.Data; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Data |
| | | public class TbWordVO { |
| | | |
| | | //水库名称 |
| | | private String resName; |
| | | |
| | | //========================tb_att_res_base======================= |
| | | //市 |
| | | private String cityName; |
| | | |
| | | //区 |
| | | private String countyName; |
| | | |
| | | //镇 |
| | | private String townName; |
| | | |
| | | |
| | | //河流名称(tb_att_res_base) |
| | | private String locRvName; |
| | | |
| | | //水库功能 前端写死的(三个及三个以上需要加等综合) |
| | | private String resFuncText; |
| | | |
| | | //工程等别 |
| | | private String engGrad; |
| | | |
| | | //工程始建时间 |
| | | private String startTime; |
| | | |
| | | //下闸蓄水时间 |
| | | private String waterStorageTm; |
| | | |
| | | //========================tb_att_res_stag_char======================= |
| | | |
| | | //调节性能 前端写死 |
| | | private String adjustPropText; |
| | | |
| | | //水库坝址以上控制流域面积 |
| | | private String conArea; |
| | | |
| | | //流域多年平均降雨量 |
| | | private String moyearRainAvg; |
| | | |
| | | //多年平均年径流量 |
| | | private String moyearFlAvg; |
| | | |
| | | //设计洪水标准 |
| | | private String desFlSta; |
| | | |
| | | //校核洪水标准 |
| | | private String checFlSta; |
| | | |
| | | //总库容 |
| | | private String totalCap; |
| | | |
| | | //有就加,没有就不加 |
| | | //水文特征(兴利库容,调洪库容,死库容,校核洪水位、设计洪水位,正常蓄水位,死水位) |
| | | private String hydrologicalCharacteristics; |
| | | |
| | | //挡水建筑物数量(例:主坝、{{副坝}} 或 主坝、{{副坝(2座)}} ) |
| | | private String buildingText; |
| | | |
| | | |
| | | //======================tb_att_res_water_block==================== |
| | | |
| | | //主坝信息 (主坝为粘土心墙坝,坝顶高程55.00m,最大坝高22m,坝长230m,坝顶宽5.5m) |
| | | private String mainDamInfo; |
| | | |
| | | //副坝信息 |
| | | private String subDamInfo; |
| | | |
| | | //正常溢洪道信息 |
| | | private String norspiInfo; |
| | | |
| | | //泄洪洞信息 |
| | | private String rsbSpillwayInfo; |
| | | |
| | | private String buildingInfo; |
| | | |
| | | |
| | | //===================tb_att_res_water_delivery”=================== |
| | | // (输水建筑物)若有两个以上输水建筑物,则描述设计流量较大的,若只有一个输水建筑物则去掉“主要 |
| | | |
| | | //输水道形式 |
| | | private String aqueductType; |
| | | |
| | | //断面尺寸(sectionWide X sectionHigh) |
| | | private String section; |
| | | |
| | | //进口底槛高程 |
| | | private String thresholdElevation; |
| | | |
| | | //设计流量 |
| | | private String designFlow; |
| | | |
| | | //===================tb_att_res_eng_bene”=================== |
| | | //保护城市 |
| | | private String protectCity; |
| | | |
| | | //保护人口(万),耕地(亩) |
| | | private String protectPersonLand; |
| | | |
| | | //铁路、公路、管线、企业几个依次罗列,超过三个列出第二个后为“XX等”,后面不需罗列 |
| | | //保护铁路 |
| | | private String protectThings; |
| | | |
| | | //经济效益 |
| | | private String economicBenefit; |
| | | |
| | | |
| | | //==========================tb_att_res_safety_monitor=================== |
| | | |
| | | private String safetyMonitorText; |
| | | |
| | | |
| | | //========================tb_att_res_mgr_sys_b====================== |
| | | //管理单位名称 |
| | | private String mUnitName; |
| | | |
| | | //管理单位性质 |
| | | private String mUnitNature; |
| | | |
| | | //管理单位职工人数 |
| | | private String mUnitPersonNumber; |
| | | |
| | | //============================att_res_mgr_sys_b=============== |
| | | //主管部门名称 |
| | | private String cUnitName; |
| | | |
| | | //==========================att_res_manage_person================ |
| | | //主管部门责任人(2) |
| | | //主管部门责任人信息 |
| | | private String competentDepartmentInfo; |
| | | |
| | | //行政主管信息(1) |
| | | private String administrativeInfo; |
| | | |
| | | //行政主管单位 |
| | | private String administrativeUnit; |
| | | |
| | | |
| | | public TbWordVO(TbAttResBase tbAttResBase, TbAttResStagChar tbAttResStagChar, |
| | | List<TbAttResWaterBlock> tbAttResWaterBlockList, Map<String, Object> resRsbNorsipiVerspiMionitorDetailByGuid, List<TbAttResPowerStation> tbAttResPowerStationList, |
| | | List<TbAttResWaterDelivery> tbAttResWaterDeliveryList, TbAttResEngBene tbAttResEngBene, |
| | | TbAttResSafetyMonitor tbAttResSafetyMonitor, TbAttResMgrSysB tbAttResMgrSysB, |
| | | List<AttResManagePerson> attResManagePeople) { |
| | | |
| | | //取设计流量大的进行描述 |
| | | List<TbAttResWaterDelivery> sortList = tbAttResWaterDeliveryList.stream().sorted((a, b) -> b.getDesignFlow().compareTo(a.getDesignFlow())).collect(Collectors.toList()); |
| | | |
| | | formatTbAttResBase(tbAttResBase); |
| | | formatTbAttResStagChar(tbAttResStagChar); |
| | | |
| | | fomatMultiInfo(tbAttResWaterBlockList, sortList, resRsbNorsipiVerspiMionitorDetailByGuid, tbAttResPowerStationList); |
| | | |
| | | |
| | | formatTbAttResWaterDelivery(sortList); |
| | | formatTbAttResEngBene(tbAttResEngBene); |
| | | formatTbAttResSafetyMonitor(tbAttResSafetyMonitor); |
| | | formatTbAttResMgrSysB(tbAttResMgrSysB); |
| | | formatAttResManagePerson(attResManagePeople); |
| | | |
| | | } |
| | | |
| | | private void fomatMultiInfo(List<TbAttResWaterBlock> tbAttResWaterBlockList, List<TbAttResWaterDelivery> tbAttResWaterDeliveryList, Map<String, Object> resRsbNorsipiVerspiMionitorDetailByGuid, List<TbAttResPowerStation> tbAttResPowerStationList) { |
| | | |
| | | //正常溢洪道 |
| | | List<TbAttResRsbNorspi> tbAttResRsbNorspiList = (List<TbAttResRsbNorspi>) resRsbNorsipiVerspiMionitorDetailByGuid.get("tbAttResRsbNorspiList"); |
| | | //泄洪洞 |
| | | List<TbAttResRsbVerspi> tbAttResRsbVerspiList = (List<TbAttResRsbVerspi>) resRsbNorsipiVerspiMionitorDetailByGuid.get("tbAttResRsbVerspiList"); |
| | | //非常溢洪道 |
| | | List<TbAttResRsbSpillway> tbAttResRsbSpillwayList = (List<TbAttResRsbSpillway>) resRsbNorsipiVerspiMionitorDetailByGuid.get("tbAttResRsbSpillwayList"); |
| | | |
| | | |
| | | List<String> buildingList = new ArrayList<>(); |
| | | this.subDamInfo = ""; |
| | | //大坝数量 |
| | | int damCount = tbAttResWaterBlockList.size(); |
| | | if (damCount > 1) { |
| | | buildingList.add(StringUtil.format("副坝({})座", damCount - 1)); |
| | | |
| | | //根据名字判断主坝 |
| | | List<TbAttResWaterBlock> mainDamList = tbAttResWaterBlockList.stream().filter(tbAttResWaterBlock -> tbAttResWaterBlock.getName().indexOf("主坝") > -1).collect(Collectors.toList()); |
| | | |
| | | if (mainDamList.size() > 0) { |
| | | TbAttResWaterBlock mainDam = mainDamList.get(0); |
| | | this.mainDamInfo = GenerateDamInfo("主坝", mainDam); |
| | | } |
| | | |
| | | TbAttResWaterBlock subDam = tbAttResWaterBlockList.get(1); |
| | | String subDamName = ""; |
| | | if (subDam.getName().equals("")) { |
| | | subDamName = "副坝"; |
| | | } else { |
| | | subDamName = subDam.getName(); |
| | | } |
| | | |
| | | this.subDamInfo = GenerateDamInfo(subDamName, subDam); |
| | | }else{ |
| | | TbAttResWaterBlock mainDam = tbAttResWaterBlockList.get(0); |
| | | //第一个就是主坝 |
| | | this.mainDamInfo = GenerateDamInfo("主坝", mainDam); |
| | | } |
| | | |
| | | //正常溢洪道 |
| | | if (tbAttResRsbNorspiList.size() > 0) { |
| | | buildingList.add("正常溢洪道"); |
| | | this.norspiInfo = ""; |
| | | this.norspiInfo = GenerateNorspiInfo(tbAttResRsbNorspiList.get(0)); |
| | | } |
| | | |
| | | //泄洪洞 |
| | | if (tbAttResRsbSpillwayList.size() > 0) { |
| | | buildingList.add("泄洪洞"); |
| | | this.rsbSpillwayInfo = ""; |
| | | this.rsbSpillwayInfo = GenerateRsbSpillwayInfo(tbAttResRsbSpillwayList.get(0)); |
| | | } |
| | | |
| | | //输水建筑物 |
| | | if (tbAttResWaterDeliveryList.size() > 0) { |
| | | tbAttResWaterDeliveryList.forEach(tbAttResWaterDelivery -> { |
| | | buildingList.add( convertType(tbAttResWaterDelivery.getAqueductType(),"AqueductTypeEnum")); |
| | | }); |
| | | } |
| | | |
| | | //电站 |
| | | if (tbAttResPowerStationList.size() > 0) { |
| | | buildingList.add("水电站"); |
| | | } |
| | | |
| | | //非常溢洪道 |
| | | if (tbAttResRsbVerspiList.size() > 0) { |
| | | buildingList.add("非常溢洪道"); |
| | | } |
| | | |
| | | //挡水建筑物泄洪建筑物正常溢洪道 |
| | | this.buildingText = String.join("、", buildingList); |
| | | |
| | | |
| | | if (StringUtil.isNotBlank(this.norspiInfo)) { |
| | | this.buildingInfo = this.subDamInfo + this.norspiInfo; |
| | | } else { |
| | | this.buildingInfo = this.subDamInfo + this.rsbSpillwayInfo; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 生成正常溢洪道描述 |
| | | * |
| | | * @param norspi 正常溢洪道对象 |
| | | * @return |
| | | */ |
| | | private String GenerateNorspiInfo(TbAttResRsbNorspi norspi) { |
| | | /** |
| | | * 溢洪道(第一座泄水建筑物为溢洪道)为正槽式溢洪道(溢洪道型式), |
| | | * 有闸控制(溢洪道根据是否有闸控制确定,填有闸控制、无闸控制),堰顶高程XXm,堰顶净宽XXm, |
| | | * 设X孔(溢洪道闸门数量,有闸控制写,无闸不写,1孔“设X孔”改为“单孔”),最大泄洪量XXm³/s。 |
| | | */ |
| | | |
| | | String typeName = SpillwayTypeEnum.find(norspi.getSpillwayType()).getLabel(); |
| | | |
| | | String gateText = ""; |
| | | String holeText = ""; |
| | | if (norspi.getIsGate().equals("是")) { |
| | | gateText = "有闸控制"; |
| | | String hole = norspi.getGateNum() == 1 ? "单" : String.valueOf(norspi.getGateNum()); |
| | | holeText = StringUtil.format(",设{}孔", hole); |
| | | } else { |
| | | gateText = "无闸控制"; |
| | | } |
| | | |
| | | //堰顶高程 |
| | | String weirTopElevation = isNull(norspi.getWeirTopElevation()); |
| | | |
| | | //堰顶净宽 |
| | | String weirTopWidth = isNull(norspi.getWeirTopWidth()); |
| | | |
| | | String disCharge = isNull(norspi.getCheckingFloodDischarge()); |
| | | |
| | | String text = StringUtil.format("溢洪道为{},{},堰顶高程{}m,堰顶净宽{}m{},最大泄洪量{}m³/s。", |
| | | typeName, gateText, weirTopElevation, weirTopWidth, holeText, disCharge); |
| | | |
| | | return text; |
| | | } |
| | | |
| | | /** |
| | | * 生成泄洪洞描述 |
| | | * |
| | | * @param tbAttResRsbSpillway |
| | | * @return |
| | | */ |
| | | private String GenerateRsbSpillwayInfo(TbAttResRsbSpillway tbAttResRsbSpillway) { |
| | | |
| | | /** |
| | | * 泄洪洞(有溢洪道则不需介绍泄洪洞,无溢洪道则介绍泄洪洞)为XX(泄洪洞型式,若为“其他”,同上生成其他具体内容)泄洪洞, |
| | | * XX(泄洪洞个数,1个为“单”孔)孔,洞长XXm,进口底槛高程XXm,最大泄量(最大泄洪流量)XXm³/s。 |
| | | */ |
| | | |
| | | //需要对其他类型进行判断; |
| | | String type = tbAttResRsbSpillway.getSpillwayType(); |
| | | String holeNum = tbAttResRsbSpillway.getSectionNum() == 1 ? "单" : String.valueOf(tbAttResRsbSpillway.getSectionNum()); |
| | | String coveLength = isNull(tbAttResRsbSpillway.getCoveLength()); |
| | | String thresholdElevation = isNull(tbAttResRsbSpillway.getThresholdElevation()); |
| | | String chec = isNull(tbAttResRsbSpillway.getCheckFlDisCharge()); |
| | | |
| | | String text = StringUtil.format("泄洪洞为{},{}孔,洞长{}m,进口底槛高程{}m,最大泄量(最大泄洪流量){}m³/s。", |
| | | type, holeNum, coveLength, thresholdElevation, chec); |
| | | |
| | | return text; |
| | | } |
| | | |
| | | /** |
| | | * 生成大坝描述 |
| | | * |
| | | * @param name 名字 |
| | | * @param tbAttResWaterBlock 大坝对象 |
| | | * @return |
| | | */ |
| | | private String GenerateDamInfo(String name, TbAttResWaterBlock tbAttResWaterBlock) { |
| | | |
| | | /** |
| | | * XX为XX坝(坝型,填“其他”则对应具体其他内容,下同),坝顶高程XXm,最大坝高XXm,坝长XXm,坝顶宽Xm。 |
| | | */ |
| | | //坝型 |
| | | String mainDamType = DamTypeEnum.find(tbAttResWaterBlock.getDamType()).getLabel(); |
| | | //坝高 |
| | | String mainDamTopElevation = isNull(tbAttResWaterBlock.getDamTopElevation()); |
| | | //最大坝高 |
| | | String mainDamHeight = isNull(tbAttResWaterBlock.getDamHeight()); |
| | | //坝长 |
| | | String mainDamTopLength = isNull(tbAttResWaterBlock.getDamTopLength()); |
| | | //坝宽 |
| | | String mainDamWidth = isNull(tbAttResWaterBlock.getDamWidth()); |
| | | |
| | | |
| | | String info = StringUtil.format("{}为{},坝顶高程{}m,最大坝高{}m,坝长{}m,坝顶宽{}m。", |
| | | name, mainDamType, mainDamTopElevation, mainDamHeight, mainDamTopLength, mainDamWidth); |
| | | |
| | | return info; |
| | | } |
| | | |
| | | |
| | | private void formatAttResManagePerson(List<AttResManagePerson> attResManagePeople) { |
| | | for (int i = 0; i < attResManagePeople.size(); i++) { |
| | | AttResManagePerson attResManagePerson = attResManagePeople.get(i); |
| | | |
| | | if (attResManagePerson.getType().equals("1")) { |
| | | //行政 |
| | | this.administrativeInfo = StringUtil.format("{}({},{})", |
| | | attResManagePerson.getUserName(), attResManagePerson.getPosition(), attResManagePerson.getUserPhone()); |
| | | |
| | | this.administrativeUnit = attResManagePerson.getUserUnit(); |
| | | } |
| | | |
| | | if (attResManagePerson.getType().equals("2")) { |
| | | //主管 |
| | | this.competentDepartmentInfo = StringUtil.format("{}({},{})", |
| | | attResManagePerson.getUserName(), attResManagePerson.getPosition(), attResManagePerson.getUserPhone()); |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | private void formatTbAttResBase(TbAttResBase tbAttResBase) { |
| | | //水库名称 |
| | | this.resName = tbAttResBase.getName(); |
| | | //所在河流 |
| | | this.locRvName = tbAttResBase.getLocRvName(); |
| | | |
| | | //行政区划 市、县、镇 |
| | | if (StringUtil.isNotBlank(tbAttResBase.getBuildAddress())) { |
| | | List<String> regionList = Arrays.asList(tbAttResBase.getBuildAddress().split("-")); |
| | | this.cityName = regionList.get(1); |
| | | this.countyName = regionList.get(2); |
| | | this.townName = regionList.get(3); |
| | | } |
| | | |
| | | //水库功能 |
| | | if (StringUtil.isNotBlank(tbAttResBase.getResFunc())) { |
| | | List<String> resFucList = Arrays.asList(tbAttResBase.getResFunc().split(",")); |
| | | List<String> resFucTextList = new ArrayList<>(); |
| | | for (int i = 0; i < resFucList.size(); i++) { |
| | | //最多三个,三个后加上等综合 |
| | | if (i > 2) { |
| | | break; |
| | | } |
| | | String key = resFucList.get(i); |
| | | ResFucEnum resFucEnum = ResFucEnum.find(key); |
| | | resFucTextList.add(resFucEnum.getLabel()); |
| | | } |
| | | |
| | | String resFuncText = String.join(",", resFucTextList); |
| | | if (resFucList.size() >= 3) { |
| | | resFuncText = resFuncText + "等综合"; |
| | | } |
| | | this.resFuncText = resFuncText; |
| | | |
| | | } |
| | | |
| | | //工程等别 |
| | | this.engGrad = tbAttResBase.getEngGrad(); |
| | | |
| | | //开工时间 (2022年9月) |
| | | this.startTime = new SimpleDateFormat("yyyy年MM月").format(tbAttResBase.getStartTime()); |
| | | |
| | | //蓄水时间(2022年9月) |
| | | this.waterStorageTm = new SimpleDateFormat("yyyy年MM月").format(tbAttResBase.getWaterStorageTm()); |
| | | } |
| | | |
| | | private void formatTbAttResStagChar(TbAttResStagChar tbAttResStagChar) { |
| | | //调节性能 |
| | | this.adjustPropText = AdjustPropEnum.find(tbAttResStagChar.getAdjustProp()).getLabel(); |
| | | |
| | | this.conArea = isNull(tbAttResStagChar.getConArea()); |
| | | |
| | | this.moyearRainAvg = isNull(tbAttResStagChar.getMoyearRainAvg()); |
| | | |
| | | this.moyearFlAvg = isNull(tbAttResStagChar.getMoyearFlAvg()); |
| | | |
| | | this.desFlSta = DesFlStaEnum.find(tbAttResStagChar.getDesFlSta()).getLabel(); |
| | | |
| | | this.checFlSta = ChecFlStaEnum.find(tbAttResStagChar.getDesFlSta()).getLabel(); |
| | | |
| | | this.totalCap = isNull(tbAttResStagChar.getTotalCap()); |
| | | //水文特征 |
| | | List<String> hydrologicalCharacteristicsList = new ArrayList<>(); |
| | | |
| | | if (tbAttResStagChar.getAdjustStorCap() != null) { |
| | | hydrologicalCharacteristicsList.add(StringUtil.format("兴利库容{}万m³", tbAttResStagChar.getAdjustStorCap().toString())); |
| | | } |
| | | if (tbAttResStagChar.getFlprCap() != null) { |
| | | hydrologicalCharacteristicsList.add(StringUtil.format("调洪库容{}万m³", tbAttResStagChar.getFlprCap().toString())); |
| | | } |
| | | if (tbAttResStagChar.getDeadCap() != null) { |
| | | hydrologicalCharacteristicsList.add(StringUtil.format("死库容{}万m³", tbAttResStagChar.getDeadCap().toString())); |
| | | } |
| | | if (tbAttResStagChar.getChecFlStag() != null) { |
| | | hydrologicalCharacteristicsList.add(StringUtil.format("校核洪水位{}m", tbAttResStagChar.getChecFlStag().toString())); |
| | | } |
| | | if (tbAttResStagChar.getDesFlStag() != null) { |
| | | hydrologicalCharacteristicsList.add(StringUtil.format("设计洪水位{}m", tbAttResStagChar.getDesFlStag().toString())); |
| | | } |
| | | if (tbAttResStagChar.getCorNormStag() != null) { |
| | | hydrologicalCharacteristicsList.add(StringUtil.format("正常蓄水位{}m", tbAttResStagChar.getCorNormStag().toString())); |
| | | } |
| | | if (tbAttResStagChar.getDeadStag() != null) { |
| | | hydrologicalCharacteristicsList.add(StringUtil.format("死水位{}m", tbAttResStagChar.getDeadStag().toString())); |
| | | } |
| | | |
| | | this.hydrologicalCharacteristics = String.join(",", hydrologicalCharacteristicsList); |
| | | } |
| | | |
| | | private void formatTbAttResWaterDelivery(List<TbAttResWaterDelivery> tbAttResWaterDeliveryList) { |
| | | TbAttResWaterDelivery tbAttResWaterDelivery = tbAttResWaterDeliveryList.get(0); |
| | | if (tbAttResWaterDeliveryList.size() > 1) { |
| | | this.aqueductType = "主要"; |
| | | } else { |
| | | this.aqueductType = ""; |
| | | } |
| | | |
| | | |
| | | this.aqueductType = this.aqueductType + convertType(tbAttResWaterDelivery.getAqueductType(),"AqueductTypeEnum"); |
| | | |
| | | this.section = tbAttResWaterDelivery.getSectionWide().toString() + "X" + tbAttResWaterDelivery.getSectionHigh().toString(); |
| | | |
| | | this.thresholdElevation = isNull(tbAttResWaterDelivery.getThresholdElevation()); |
| | | |
| | | this.designFlow = isNull(tbAttResWaterDelivery.getDesignFlow()); |
| | | |
| | | } |
| | | |
| | | |
| | | private void formatTbAttResEngBene(TbAttResEngBene tbAttResEngBene) { |
| | | |
| | | this.protectCity = tbAttResEngBene.getCity(); |
| | | this.protectPersonLand = |
| | | StringUtil.format("{}万人口、{}万亩耕地", tbAttResEngBene.getFlControlPerson(), String.format("%.2f", tbAttResEngBene.getFlControlLand() / 1000)); |
| | | ////铁路、公路、管线、企业几个依次罗列,超过三个列出第二个后为“XX等”,后面不需罗列 |
| | | |
| | | String railway = tbAttResEngBene.getRailway(); |
| | | String highway = tbAttResEngBene.getHighway(); |
| | | String importCommunication = tbAttResEngBene.getImportCommunication(); |
| | | String importFactory = tbAttResEngBene.getImportFactory(); |
| | | |
| | | List<String> protectList = new ArrayList<>(); |
| | | |
| | | if (StringUtil.isNotBlank(railway)) { |
| | | protectList.add(railway); |
| | | } |
| | | |
| | | if (StringUtil.isNotBlank(highway)) { |
| | | protectList.add(highway); |
| | | } |
| | | |
| | | if (StringUtil.isNotBlank(importCommunication)) { |
| | | protectList.add(importCommunication); |
| | | } |
| | | |
| | | if (StringUtil.isNotBlank(importFactory)) { |
| | | protectList.add(importFactory); |
| | | } |
| | | this.protectThings = ""; |
| | | //超过三个列出第二个后为“XX等”,后面不需罗列 |
| | | if (protectList.size() > 3) { |
| | | List<String> sublist = protectList.subList(0, 2); |
| | | this.protectThings = String.join(";", sublist) + "等"; |
| | | } else { |
| | | this.protectThings = String.join(";", protectList); |
| | | } |
| | | |
| | | this.economicBenefit = ""; |
| | | //若既有灌溉又有供水,则有“此外,”, |
| | | if (StringUtils.isNotBlank(tbAttResEngBene.getIrrObject())) { |
| | | this.economicBenefit = |
| | | StringUtil.format("水库为{}提供灌溉用水,设计灌溉面积{}万亩,有效灌溉面积{}万亩,多年平均灌溉水量{}万m³。", |
| | | tbAttResEngBene.getIrrObject(), String.format("%.2f", tbAttResEngBene.getDesIrrArea() / 1000), String.format("%.2f", tbAttResEngBene.getChecIrrArea() / 1000), tbAttResEngBene.getMoyearIrrAvg()); |
| | | } |
| | | |
| | | if (StringUtil.isNotBlank(tbAttResEngBene.getSupplyObject())) { |
| | | if (StringUtils.isNotBlank(this.economicBenefit)) { |
| | | this.economicBenefit = this.economicBenefit + |
| | | StringUtil.format("此外,水库为{}{}万人提供生活用水,年均供水量{}万m³。", |
| | | tbAttResEngBene.getSupplyObject(),String.format("%.2f", Double.parseDouble(tbAttResEngBene.getSupplyPopulation())/ 1000), tbAttResEngBene.getMoyearSupplyAvg()); |
| | | } else { |
| | | //无灌溉有供水直接介绍供水 |
| | | this.economicBenefit = |
| | | StringUtil.format("水库为{}{}万人提供生活用水,年均供水量{}万m³。", |
| | | tbAttResEngBene.getSupplyObject(),String.format("%.2f", Double.parseDouble(tbAttResEngBene.getSupplyPopulation())/ 1000), tbAttResEngBene.getMoyearSupplyAvg()); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | private void formatTbAttResSafetyMonitor(TbAttResSafetyMonitor tbAttResSafetyMonitor) { |
| | | String time = new SimpleDateFormat("yyyy年MM月").format(tbAttResSafetyMonitor.getSafetyAppraisalTime()); |
| | | String type = SafetyAppraisalTypeEnum.find(tbAttResSafetyMonitor.getSafetyAppraisalResult()).getLabel(); |
| | | String surveyProblem = tbAttResSafetyMonitor.getSurveyProblem(); |
| | | //(若一类坝,不介绍问题,二、三类坝介绍) |
| | | if (tbAttResSafetyMonitor.equals("1")) { |
| | | this.safetyMonitorText = StringUtil.format("{},水库进行安全鉴定,鉴定结果为\"{}\"。", |
| | | time, type); |
| | | } else { |
| | | this.safetyMonitorText = StringUtil.format("{},水库进行安全鉴定,鉴定结果为\"{}\",工程主要存在问题为{}", |
| | | time, type, surveyProblem); |
| | | } |
| | | } |
| | | |
| | | private void formatTbAttResMgrSysB(TbAttResMgrSysB tbAttResMgrSysB) { |
| | | this.mUnitName = tbAttResMgrSysB.getMUnitName(); |
| | | this.mUnitNature = tbAttResMgrSysB.getMUnitNature(); |
| | | this.mUnitPersonNumber = tbAttResMgrSysB.getMUnitPersonNumber().toString(); |
| | | } |
| | | |
| | | //对有补充说明的选项进行转换 |
| | | private String convertType(String type, String enumName) { |
| | | String text = ""; |
| | | |
| | | List<String> typeList = Arrays.asList(type.split(",")); |
| | | String typeKey = typeList.get(0); |
| | | String explain =""; |
| | | if (typeList.size()>1){ |
| | | explain = typeList.get(1); |
| | | } |
| | | |
| | | //key值表示其他 |
| | | if (typeKey.equals("9") || Integer.parseInt(typeKey) == 9 || typeKey.equals("其他")) { |
| | | text = explain; |
| | | }else{ |
| | | switch (enumName) { |
| | | case "AqueductTypeEnum": |
| | | text = AqueductTypeEnum.find(typeKey).getLabel(); |
| | | break; |
| | | case "SpillwayHoleType": |
| | | text = typeKey; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | return text; |
| | | } |
| | | |
| | | private String isNull(Double target) { |
| | | if (target == null) { |
| | | return ""; |
| | | } else { |
| | | return target.toString(); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |