From 3a8f9b199e7356d5c2669ede418e581ee363eacf Mon Sep 17 00:00:00 2001 From: LeoAnn <1297441823@qq.com> Date: Fri, 11 Jul 2025 17:40:35 +0800 Subject: [PATCH] feat: .... --- .../src/main/resources/excel/flowResult.xls | Bin 0 -> 21504 bytes .../src/main/resources/excel/hyXsmsrsG.xls | Bin 0 -> 20992 bytes .../service/impl/HyDpCServiceImplTest.java | 15 +- .../controller/ActualSurveyController.java | 52 ++++ .../ActualSurveyExportController.java | 56 +++++ .../swlscx/actualSurvey/domain/po/HyObqG.java | 48 ++++ .../actualSurvey/domain/po/HyXsmsrsG.java | 33 +++ .../actualSurvey/domain/vo/HyObqGVo.java | 60 +++++ .../actualSurvey/domain/vo/HyXsmsrsGVo.java | 44 ++++ .../actualSurvey/mapper/HyObqGMapper.java | 25 ++ .../actualSurvey/mapper/HyXsmsrsGMapper.java | 25 ++ .../actualSurvey/service/HyObqGService.java | 26 ++ .../service/HyXsmsrsGService.java | 22 ++ .../service/impl/HyObqGServiceImpl.java | 210 ++++++++++++++++ .../service/impl/HyXsmsrsGServiceImpl.java | 187 +++++++++++++++ .../basic/controller/BaseInfoController.java | 32 ++- .../swlscx/basic/mapper/HyStscAMapper.java | 4 + .../service/impl/HyStscAServiceImpl.java | 12 + .../controller/TimeTasksController.java | 11 + .../synchronousData/dto/YcResStatInfo.java | 35 +++ .../mapper/YcResTableInfoMapper.java | 33 +++ .../service/YcResTableInfoService.java | 15 ++ .../service/impl/TimeTasksServiceImpl.java | 81 ++++--- .../impl/YcResTableInfoServiceImpl.java | 224 ++++++++++++++++++ .../mapper/actualSurvey/HyObqGMapper.xml | 70 ++++++ .../mapper/actualSurvey/HyXsmsrsGMapper.xml | 54 +++++ .../resources/mapper/basic/HyStscAMapper.xml | 32 +++ .../synchronousData/YcResTableInfoMapper.xml | 84 +++++++ 28 files changed, 1447 insertions(+), 43 deletions(-) create mode 100644 ruoyi-admin/src/main/resources/excel/flowResult.xls create mode 100644 ruoyi-admin/src/main/resources/excel/hyXsmsrsG.xls create mode 100644 swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/controller/ActualSurveyController.java create mode 100644 swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/controller/ActualSurveyExportController.java create mode 100644 swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/domain/po/HyObqG.java create mode 100644 swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/domain/po/HyXsmsrsG.java create mode 100644 swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/domain/vo/HyObqGVo.java create mode 100644 swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/domain/vo/HyXsmsrsGVo.java create mode 100644 swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/mapper/HyObqGMapper.java create mode 100644 swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/mapper/HyXsmsrsGMapper.java create mode 100644 swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/service/HyObqGService.java create mode 100644 swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/service/HyXsmsrsGService.java create mode 100644 swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/service/impl/HyObqGServiceImpl.java create mode 100644 swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/service/impl/HyXsmsrsGServiceImpl.java create mode 100644 swlscx/src/main/java/com/ruoyi/swlscx/synchronousData/dto/YcResStatInfo.java create mode 100644 swlscx/src/main/java/com/ruoyi/swlscx/synchronousData/mapper/YcResTableInfoMapper.java create mode 100644 swlscx/src/main/java/com/ruoyi/swlscx/synchronousData/service/YcResTableInfoService.java create mode 100644 swlscx/src/main/java/com/ruoyi/swlscx/synchronousData/service/impl/YcResTableInfoServiceImpl.java create mode 100644 swlscx/src/main/resources/mapper/actualSurvey/HyObqGMapper.xml create mode 100644 swlscx/src/main/resources/mapper/actualSurvey/HyXsmsrsGMapper.xml create mode 100644 swlscx/src/main/resources/mapper/synchronousData/YcResTableInfoMapper.xml diff --git a/ruoyi-admin/src/main/resources/excel/flowResult.xls b/ruoyi-admin/src/main/resources/excel/flowResult.xls new file mode 100644 index 0000000000000000000000000000000000000000..0c3dcae330bc0e65c7c2bac9cef53d07705656f3 GIT binary patch literal 21504 zcmeHP2Urx>x4*kAun0&;0fnU~RXT!=rq~s+#s?xIi>P1&6$^nViUmZ$9_$56EU`sn z!-@rr8i}zbV2dTzsKmy;b7mNJc6MfizP$Io{J-4g&Yg4aIlp`Exn<_go#EmSCY5Wx zwXPzZ5KOd4jY5y;u=pZ4$4CWZLY&|P=^BMXK{E+~(|^N1$O9k2R%d8DEr=3`+7PkL zbsOpJ(Q6HiKL_>%TAsRu1E4ZLddu2XJeQ`t73`y*05C%Z$Fp71w$w9+%-D6oIqN77d6%mu2l4EcrUimzU~20Z*EKyFD6p`$tYVwl_2 zz2qSvFA?CQSNZV?3Fg5^`4C=v2ni72>k04!1n{K-@+JcE#sYjZ0luC9pW80B5_cGH zW<=yb?kODL(&z!vk$96fgyzJM7A&r4JNW$1Kr?ESzqM0A*#8mb?1|C0Pi?ZTC{E`b#5ye zKwRNR6(&>+@`Vb(JR#^w&_u0;>p@qS&sNpKgyrahLtqFfQJ8uSBknL&@YIV7r(Qcg z2~9$>W-ekB{ptK0dC!DE<`!)`Y?mi}nw$$N2czV_AGyn$hxgeCW6Adf|GGl3!?I zvP6Fg*zZNzk83=Jf7I@%9g*l!d|dZ2d|IC7<64mBCnnPJfs{P14=Mf?5(nkN(vY?X z*NnCNA)zwwx_aR{lH%{FwNv6o;eY^#--6=fdQ(;2o#NvfRF&^d@o` z+O?}rp#cw1mxm|i;Yn(F3Po8Ro`A(T5hyJN>AzCI8G=^8H9JNo2$Xbp8x|7in(6}+ zEyjV#H$?Cjp9uoiHG_ODP^M?W)6XubSqBev>UaVm%~e1YrRpF>MCY$SoK-;{7u6{+ z-LgpjmzKEHfe85o1nPo7bzDJ!_K6meCw``5-B=)H-9Hn=odx3S#|KhZ7dR29jt2{* z?&&q9$4sU50BOMjktgCcp9u^|Jvy5w=rE2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4`@FdqYxA^^_c7*HSa(vSeWsc=C3Y=~Izowc+!T^jd>r(K1n3Pz zq347{IvgI6CBV{F4mlW@`-CoV2iYHJZlA>Qf@2Qf@D6}u3wVU(OFZF-|4#+e0QeVT z$fL)g6QmK4;|Fh~1^}ivyk+eVeKL^Z_=B7;i~(Pe34nh-76Ey!K-(X9fxvAKXA$rK Oj>ZG1f5Rtw;J*PoLTrct literal 0 HcmV?d00001 diff --git a/ruoyi-admin/src/main/resources/excel/hyXsmsrsG.xls b/ruoyi-admin/src/main/resources/excel/hyXsmsrsG.xls new file mode 100644 index 0000000000000000000000000000000000000000..466d142f89505e7985fa0a668caf5d3c48279cf8 GIT binary patch literal 20992 zcmeHP2V4}#_n$isI0O_BP(a}*N|laaqo~+W5o`Rbh{z!-C@LZr0#OuH5CvNd_JSpr z*rKsv#eznO#GZgHDzPR?Y~267UG{EoZ})=!fB*mgli%kz$L#F9dG9-K-n^OJncd~` zkEWGtzq76)oDfWONUg$v=&|S`ILAl@6G9x}1oO2Dg@Ps$0;m58{~!x|1YKJ~=jlL{ zK-7hZeXb8t3ef;!1BiwYjUXCBYzVOtL~sFO3egN=V~FMuEg)J#Yyz<Q>K8#C$4`ChNAWSVnZOMF$YhcPzY&z}yF)L; zQ#L_L3K9ET$z zcOecX$)Kmmhxn2gYfn8^TdUzNchvQWPJUyIuglB4Z(TCYb|Poj;^sB+_sH zi|A*0ajXf84$aaPg@GT8hQ3cEOzlPlwGwG)WiCLMQgqE$G~l5p0CH<`7!At77sDK` zX$=nneu)4bt;df~NH7mR@`v#1Lr8!C-9UgIAb>9w;5QZEHxZyW7N8pl(7F9$D{+T$ z)tHDJ$ODA~+)jBwbR^!S9ib^hNh=oBRuTZ0=B9k?Lr7mDCvjw$fM6h8&#g2CJ)th4 z+UPP{Nf_J)*b0kkubBZEP26De5Dh1?ItAU}Ox0ebwTT!aZ~*H#P*SvPD0OZt z8AM#+M^z?N4bp`wz%n7|snA7jh1)?lmrqyq%7ppoibG%ss8E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lczXWT&!jh^X`5bg2JTgnT&n4T9V3endth;lK05!;%meh!}+Q$NIz- z7b}W9ZA=Q6f&LzEcXS4tE{B#2G}IgY5!>Vf5ke-m73;+|nm`PN$ZZ3bV_;GQ!1)^k z$|GJ1W&m#n98f+BBDQ;1U0xS1wBw;Q_&z_Ar stringList = Arrays.asList("日平均含沙量表195001-199001","日平均含沙量表199001-"); + List stringList = Arrays.asList("逐时潮水位表 (1)","逐时潮水位表 (2)","逐时潮水位表 (3)"); long newTime = System.currentTimeMillis(); System.out.println("当前时间:" + newTime); for (String s : stringList) { - File file = new File("C:\\Users\\12974\\Desktop\\历史查询子系统\\历史数据\\日表类\\日平均含沙量表-已完成\\" + s + ".xls"); +// File file = new File("C:\\Users\\12974\\Desktop\\历史查询子系统\\历史数据\\日表类\\日平均含沙量表-已完成\\" + s + ".xls"); + File file = new File("C:\\Users\\12974\\Downloads\\" + s + ".xls"); // 创建 FileInputStream 对象 FileInputStream fileInputStream = new FileInputStream(file); @@ -65,7 +70,7 @@ class HyDpCServiceImplTest { "application/vnd.ms-excel", fileInputStream ); - hyDcsFService.importHyDcsFData(multipartFile); + hyZscsBService.importHyZscsBData(multipartFile); } System.out.println("总耗时:" + (System.currentTimeMillis() - newTime)); } @@ -74,4 +79,8 @@ class HyDpCServiceImplTest { public void test() { System.out.println(hyStscAService.testSqlServer()); } + + + + } \ No newline at end of file diff --git a/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/controller/ActualSurveyController.java b/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/controller/ActualSurveyController.java new file mode 100644 index 0000000..0517bd6 --- /dev/null +++ b/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/controller/ActualSurveyController.java @@ -0,0 +1,52 @@ +package com.ruoyi.swlscx.actualSurvey.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.ruoyi.common.core.page.R; +import com.ruoyi.swlscx.actualSurvey.domain.vo.HyObqGVo; +import com.ruoyi.swlscx.actualSurvey.domain.vo.HyXsmsrsGVo; +import com.ruoyi.swlscx.actualSurvey.service.HyObqGService; +import com.ruoyi.swlscx.actualSurvey.service.HyXsmsrsGService; +import com.ruoyi.swlscx.basic.domain.vo.HyStscAVo; +import com.ruoyi.swlscx.common.PageParams; +import com.ruoyi.swlscx.year.domain.vo.HyYrpFVo; +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 al + * @Date 2025/7/10 15:49 + * @Description: TODO + * @Version + */ +@RestController +@RequestMapping("/actualSurvey") +public class ActualSurveyController { + + @Autowired + private HyObqGService hyObqGService; + + @Autowired + private HyXsmsrsGService hyXsmsrsGService; + + /** + * 实测流量成果表 + */ + @GetMapping("/getFlowResult") + public R getMonthRainList(Integer pageNum, Integer pageSize, String startTime, String endTime, String stcd, String stnm) { + PageParams pageParams = new PageParams(pageNum.longValue(), pageSize.longValue()); + IPage hyObqGVoIPage = hyObqGService.selectHyObqGDataByPageAndInfo(pageParams, startTime, endTime, stcd, stnm); + return R.ok().put("data", hyObqGVoIPage.getRecords()).put("count", hyObqGVoIPage.getTotal()); + } + + /** + * 实测大断面成果表 + */ + @GetMapping("/getActualMeasurementList") + public R getActualMeasurementList(Integer pageNum, Integer pageSize, String startTime, String endTime, String stcd, String stnm) { + PageParams pageParams = new PageParams(pageNum.longValue(), pageSize.longValue()); + IPage hyXsmsrsGVoIPage = hyXsmsrsGService.selectHyXsmsrsGDataByPageAndInfo(pageParams, startTime, endTime, stcd, stnm); + return R.ok().put("data", hyXsmsrsGVoIPage.getRecords()).put("count", hyXsmsrsGVoIPage.getTotal()); + } +} diff --git a/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/controller/ActualSurveyExportController.java b/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/controller/ActualSurveyExportController.java new file mode 100644 index 0000000..93d222f --- /dev/null +++ b/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/controller/ActualSurveyExportController.java @@ -0,0 +1,56 @@ +package com.ruoyi.swlscx.actualSurvey.controller; + +import com.ruoyi.common.core.page.R; +import com.ruoyi.swlscx.actualSurvey.service.HyObqGService; +import com.ruoyi.swlscx.actualSurvey.service.HyXsmsrsGService; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletResponse; + +/** + * @Author al + * @Date 2025/7/10 16:13 + * @Description: TODO + * @Version + */ + +@RequestMapping("/report") +@RestController +public class ActualSurveyExportController { + + @Autowired + private HyObqGService hyObqGService; + + + @Autowired + private HyXsmsrsGService hyXsmsrsGService; + /** + * 导出实测流量成果表 + */ + @RequestMapping("/flowResult") + public R exportHyObqGtList(HttpServletResponse response, + @RequestParam String startTime, + @RequestParam String endTime, + @RequestParam String stcd, + @RequestParam String stnm) { + return hyObqGService.exportHyObqGData(response, startTime, endTime, stcd, stnm); + } + + + + /** + * 导出实测大断面成果表 + */ + @RequestMapping("/actualMeasurement") + public R exportActualMeasurementList(HttpServletResponse response, + @RequestParam String startTime, + @RequestParam String endTime, + @RequestParam String stcd, + @RequestParam String stnm) { + return hyXsmsrsGService.exportHyXsmsrsGData(response, startTime, endTime, stcd, stnm); + } +} diff --git a/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/domain/po/HyObqG.java b/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/domain/po/HyObqG.java new file mode 100644 index 0000000..6681b60 --- /dev/null +++ b/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/domain/po/HyObqG.java @@ -0,0 +1,48 @@ +package com.ruoyi.swlscx.actualSurvey.domain.po; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.Date; + +/** + * @Author al + * @Date 2025/7/10 15:44 + * @Description: TODO + * @Version + */ +@Data +@TableName("hy_obq_g") +public class HyObqG { + + private String id; // 唯一标识符 + + private String stcd; // 站码 + private Integer yr; // 年份(整数类型) + private Integer mnth; // 月份(整数类型) + private Integer qobno; // 流量施测号数 + + private Date msqbgtm; // 测流起时间(使用LocalDateTime) + private Date msqedtm; // 测流止时间 + + private String xsqlc; // 测流断面位置 + private String msqmt; // 测流方法 + private Double bsggz; // 基本水尺水位 + private Double q; // 流量 + private String qrcd; // 流量注解码 + private Double xstta; // 断面总面积 + private Double xsa; // 断面过水面积 + private String xsarcd; // 断面面积注解码 + private Double xsavv; // 断面平均流速 + private Double xsmxv; // 断面最大流速 + private Double tpwd; // 水面宽 + private Double xsavdp; // 断面平均水深 + private Double xsmxdp; // 断面最大水深 + private Double ibwd; // 水浸冰底宽度 + private Double ibavdp; // 水浸冰底平均水深 + private Double ibmxdp; // 水浸冰底最大水深 + private Double rvsfsl; // 水面比降 + private Double n; // 糙率 + private String obnont; // 测次说明 +} diff --git a/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/domain/po/HyXsmsrsG.java b/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/domain/po/HyXsmsrsG.java new file mode 100644 index 0000000..b06aac5 --- /dev/null +++ b/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/domain/po/HyXsmsrsG.java @@ -0,0 +1,33 @@ +package com.ruoyi.swlscx.actualSurvey.domain.po; + +import com.baomidou.mybatisplus.annotation.IdType; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.Date; + +/** + * @Author al + * @Date 2025/7/11 15:39 + * @Description: TODO + * @Version + */ +@Data +public class HyXsmsrsG { + private String stcd; // 站码 + + private Date obdt; // 施测日期 + + private Integer obno; // 测次号 + + private String vtno; // 垂线号 + + private BigDecimal di; // 起点距(米) + private BigDecimal rvbbel; // 河底高程(米) + private String rvbbelrcd; // 河底高程注解码 + private BigDecimal odbrz; // 测时水位(米) + private String odbrzrcd; // 测时水位注解码 + private String vtaz; // 垂线方位 + private Integer nof; // 默认值1 +} diff --git a/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/domain/vo/HyObqGVo.java b/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/domain/vo/HyObqGVo.java new file mode 100644 index 0000000..ecb0e4e --- /dev/null +++ b/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/domain/vo/HyObqGVo.java @@ -0,0 +1,60 @@ +package com.ruoyi.swlscx.actualSurvey.domain.vo; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author al + * @Date 2025/7/10 15:44 + * @Description: TODO + * @Version + */ +@Data +public class HyObqGVo implements Serializable { + + private String id; // 唯一标识符 + + private String stcd; // 站码 + private Integer yr; // 年份(整数类型) + private Integer mnth; // 月份(整数类型) + private Integer qobno; // 流量施测号数 + + private Date msqbgtm; // 测流起时间(使用LocalDateTime) + private Date msqedtm; // 测流止时间 + + private String xsqlc; // 测流断面位置 + private String msqmt; // 测流方法 + private Double bsggz; // 基本水尺水位 + private Double q; // 流量 + private String qrcd; // 流量注解码 + + + private Double xstta; // 断面总面积 + private Double xsa; // 断面过水面积 + private String xsarcd; // 断面面积注解码 + private Double xsavv; // 断面平均流速 + private Double xsmxv; // 断面最大流速 + + private Double tpwd; // 水面宽 + private Double xsavdp; // 断面平均水深 + private Double xsmxdp; // 断面最大水深 + private Double ibwd; // 水浸冰底宽度 + private Double ibavdp; // 水浸冰底平均水深 + private Double ibmxdp; // 水浸冰底最大水深 + private Double rvsfsl; // 水面比降 + private Double n; // 糙率 + private String obnont; // 测次说明 + + /**站名**/ + private String stnm; + + /** + * 行政区划码 + */ + private String addvcd; + + private static final long serialVersionUID = 1L; +} diff --git a/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/domain/vo/HyXsmsrsGVo.java b/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/domain/vo/HyXsmsrsGVo.java new file mode 100644 index 0000000..7308297 --- /dev/null +++ b/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/domain/vo/HyXsmsrsGVo.java @@ -0,0 +1,44 @@ +package com.ruoyi.swlscx.actualSurvey.domain.vo; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * @Author al + * @Date 2025/7/11 15:39 + * @Description: TODO + * @Version + */ +@Data +public class HyXsmsrsGVo implements Serializable { + private String stcd; // 站码 + + private Date obdt; // 施测日期 + + private Integer obno; // 测次号 + + private String vtno; // 垂线号 + + private BigDecimal di; // 起点距(米) + private BigDecimal rvbbel; // 河底高程(米) + private String rvbbelrcd; // 河底高程注解码 + private BigDecimal odbrz; // 测时水位(米) + private String odbrzrcd; // 测时水位注解码 + private String vtaz; // 垂线方位 + private Integer nof; // 默认值1 + + + /**站名**/ + private String stnm; + + /** + * 行政区划码 + */ + private String addvcd; + + private static final long serialVersionUID = 1L; + +} diff --git a/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/mapper/HyObqGMapper.java b/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/mapper/HyObqGMapper.java new file mode 100644 index 0000000..78209cb --- /dev/null +++ b/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/mapper/HyObqGMapper.java @@ -0,0 +1,25 @@ +package com.ruoyi.swlscx.actualSurvey.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.swlscx.actualSurvey.domain.po.HyObqG; +import com.ruoyi.swlscx.actualSurvey.domain.vo.HyObqGVo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * @Author al + * @Date 2025/7/10 15:46 + * @Description: TODO + * @Version + */ +@Mapper +public interface HyObqGMapper extends BaseMapper { + IPage selectHyObqGDataByPageAndInfo(@Param("page") Page page, @Param("map") Map map); + + List selectHyObqGData(@Param("map") Map map); +} diff --git a/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/mapper/HyXsmsrsGMapper.java b/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/mapper/HyXsmsrsGMapper.java new file mode 100644 index 0000000..5755738 --- /dev/null +++ b/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/mapper/HyXsmsrsGMapper.java @@ -0,0 +1,25 @@ +package com.ruoyi.swlscx.actualSurvey.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.swlscx.actualSurvey.domain.po.HyXsmsrsG; +import com.ruoyi.swlscx.actualSurvey.domain.vo.HyXsmsrsGVo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * @Author al + * @Date 2025/7/11 15:40 + * @Description: TODO + * @Version + */ +@Mapper +public interface HyXsmsrsGMapper extends BaseMapper { + IPage selectHyXsmsrsGDataByPageAndInfo(@Param("page") Page page, @Param("map") Map map); + + List selectHyXsmsrsGData(@Param("map") Map map); +} diff --git a/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/service/HyObqGService.java b/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/service/HyObqGService.java new file mode 100644 index 0000000..7a2a4be --- /dev/null +++ b/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/service/HyObqGService.java @@ -0,0 +1,26 @@ +package com.ruoyi.swlscx.actualSurvey.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.common.core.page.R; +import com.ruoyi.swlscx.actualSurvey.domain.po.HyObqG; +import com.ruoyi.swlscx.actualSurvey.domain.vo.HyObqGVo; +import com.ruoyi.swlscx.common.PageParams; + +import javax.servlet.http.HttpServletResponse; + +/** + * @Author al + * @Date 2025/7/10 15:47 + * @Description: TODO + * @Version + */ +public interface HyObqGService extends IService { + + /** + * 查询实测流量表 + */ + IPage selectHyObqGDataByPageAndInfo(PageParams pageParams, String startTime, String endTime, String stcd, String stnm); + + R exportHyObqGData(HttpServletResponse response, String startTime, String endTime, String stcd, String stnm); +} diff --git a/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/service/HyXsmsrsGService.java b/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/service/HyXsmsrsGService.java new file mode 100644 index 0000000..0ce2290 --- /dev/null +++ b/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/service/HyXsmsrsGService.java @@ -0,0 +1,22 @@ +package com.ruoyi.swlscx.actualSurvey.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.common.core.page.R; +import com.ruoyi.swlscx.actualSurvey.domain.po.HyXsmsrsG; +import com.ruoyi.swlscx.actualSurvey.domain.vo.HyXsmsrsGVo; +import com.ruoyi.swlscx.common.PageParams; + +import javax.servlet.http.HttpServletResponse; + +/** + * @Author al + * @Date 2025/7/11 15:40 + * @Description: TODO + * @Version + */ +public interface HyXsmsrsGService extends IService { + IPage selectHyXsmsrsGDataByPageAndInfo(PageParams pageParams, String startTime, String endTime, String stcd, String stnm); + + R exportHyXsmsrsGData(HttpServletResponse response, String startTime, String endTime, String stcd, String stnm); +} diff --git a/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/service/impl/HyObqGServiceImpl.java b/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/service/impl/HyObqGServiceImpl.java new file mode 100644 index 0000000..0319c60 --- /dev/null +++ b/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/service/impl/HyObqGServiceImpl.java @@ -0,0 +1,210 @@ +package com.ruoyi.swlscx.actualSurvey.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.config.RuoYiConfig; +import com.ruoyi.common.core.page.R; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.swlscx.actualSurvey.domain.po.HyObqG; +import com.ruoyi.swlscx.actualSurvey.domain.vo.HyObqGVo; +import com.ruoyi.swlscx.actualSurvey.mapper.HyObqGMapper; +import com.ruoyi.swlscx.actualSurvey.service.HyObqGService; +import com.ruoyi.swlscx.basic.domain.po.YcExportTask; +import com.ruoyi.swlscx.basic.service.YcExportTaskService; +import com.ruoyi.swlscx.common.PageParams; +import com.ruoyi.swlscx.common.constants.SystemConstants; +import com.ruoyi.swlscx.common.utils.CommonUtils; +import com.ruoyi.swlscx.common.utils.ExcelUtils; +import com.ruoyi.swlscx.common.utils.Query; +import com.ruoyi.swlscx.month.domain.vo.HyMptEVo; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.poi.ss.usermodel.CellStyle; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ThreadPoolExecutor; + +/** + * @Author al + * @Date 2025/7/10 15:47 + * @Description: TODO + * @Version + */ +@Service +public class HyObqGServiceImpl extends ServiceImpl + implements HyObqGService { + + + + @Override + public IPage selectHyObqGDataByPageAndInfo(PageParams pageParams, String startTime, String endTime, String stcd, String stnm) { + Map map = CommonUtils.getMonthDataMap(pageParams, startTime, endTime, stcd, stnm); + return this.baseMapper.selectHyObqGDataByPageAndInfo(new Query().getPage(map), map); + } + + @Override + public R exportHyObqGData(HttpServletResponse response, String startTime, String endTime, String stcd, String stnm) { + Long userId = SecurityUtils.getUserId(); + String tableName = "实测流量表"; + return taskAndExport(tableName,startTime, endTime, stcd, stnm, userId); + } + + @Resource + private ThreadPoolExecutor labelThreadPool; + + @Resource + private YcExportTaskService ycExportTaskService; + + @Resource + private ThreadPoolExecutor importThreadPool; + + @Autowired + private ApplicationContext context; + + private R taskAndExport(String tableName,String startTime, String endTime, String stcd, String stnm, Long userId) { + String startNewTime=""; + String endNewTime=""; + if (ObjectUtils.isNotEmpty(startTime) ){ + startNewTime=startTime.substring(0,6); + } + if (ObjectUtils.isNotEmpty(endTime)){ + endNewTime=endTime.substring(0,6); + } + String filename = tableName + startNewTime + "-" + endNewTime; + // 查询是否已存在相同条件且未完成的任务 + List ongoingTasks = ycExportTaskService.list( + new QueryWrapper() + .eq("user_id", userId) + .eq("filename", filename) + .eq("status", 0) // 状态为0表示任务未完成 + ); + + if (!ongoingTasks.isEmpty()) { + return R.error("当前任务正在下载中,请稍后重试"); + } + + YcExportTask ycExportTask = new YcExportTask(); + String pathPeffix = RuoYiConfig.getExportPath() + + File.separator + userId + File.separator+ + DateUtils.parseDateToStr("yyyy-MM-dd",DateUtils.getNowDate()) + File.separator + + DateUtils.parseDateToStr("HH_mm",DateUtils.getNowDate())+File.separator; + ycExportTask.setFilename(filename); + ycExportTask.setUserId(userId); + ycExportTask.setStartTime(new Date()); + ycExportTask.setStatus(0); + ycExportTask.setFilepath(pathPeffix); + ycExportTaskService.save(ycExportTask); + CompletableFuture.runAsync(() -> { + try { + File dest = new File(pathPeffix); + if (!dest.exists()) { + dest.mkdirs(); + } + String fullPath = pathPeffix + filename; + exportBlackData(fullPath, startTime, endTime, stcd, stnm); + + ycExportTask.setStatus(1); + ycExportTask.setEndTime(new Date()); + ycExportTaskService.updateById(ycExportTask); + } catch (Exception e) { + log.error(e.getMessage(), e); + R.error("任务下载失败"); + } + }, labelThreadPool); + return R.ok("任务已提交,请稍后下载"); + } + + + private void exportBlackData(String tableName, String startTime, String endTime, String stcd, String stnm) { + Map rainMap = CommonUtils.getMonthDataMap(new PageParams(0L, 1000000000L), startTime, endTime, stcd, stnm); + ExcelUtils.excelBackExport2("flowResult.xls", tableName, (Sheet sheet, CellStyle style) -> + dataModel1(rainMap, sheet, style)); + } + public int dataModel1(Map map, Sheet sheet, CellStyle style) { + // 批量查询数据 + List hyObqGVos = this.baseMapper.selectHyObqGData(map); + + // 定义当前sheet的行号 + int rowIndex = 2; // 从第二行开始写入数据 + // 定义全局序号 + int globalIndex = 1; // 从1开始 + + // 定义当前sheet的编号 + int sheetIndex = 1; + + // 最大行数限制 + int maxRowsPerSheet = 65536; // 对于 .xls 文件,最大行数为 65536 + int batchSize = 1000; // 每次批量处理1000行,减少逐行写入的开销 + + // 复制表头到新sheet的逻辑 + ExcelUtils.copyHeader(sheet, style); + + // 批量处理数据 + for (int i = 0; i < hyObqGVos.size(); i += batchSize) { + // 处理一批数据 + int toIndex = Math.min(i + batchSize, hyObqGVos.size()); + List batchList = hyObqGVos.subList(i, toIndex); + + // 批量写入数据 + for (HyObqGVo vo : batchList) { + // 如果当前行数达到最大行数,创建新sheet + if (rowIndex >= maxRowsPerSheet) { + sheetIndex++; + sheet = sheet.getWorkbook().createSheet("实测流量表" + sheetIndex); + rowIndex = 2; // 重置行号 + // 复制表头到新sheet + ExcelUtils.copyHeader(sheet, style); + } + + // 创建新行并写入数据 + Row row = ExcelUtils.createRow(sheet, rowIndex); + + // 使用 globalIndex 作为序号 + ExcelUtils.formatCell(row, 0, String.valueOf(globalIndex), style); + ExcelUtils.formatCell(row, 1, vo.getStcd() != null ? vo.getStcd() : "", style); + ExcelUtils.formatCell(row, 2, vo.getStnm() != null ? vo.getStnm() : "", style); + ExcelUtils.formatCell(row, 3, vo.getAddvcd() != null ? vo.getAddvcd() : "", style); + ExcelUtils.formatCell(row, 4, vo.getYr() != null ? vo.getYr().toString() : "", style); + ExcelUtils.formatCell(row, 5, vo.getMnth() != null ? vo.getMnth().toString() : "", style); + ExcelUtils.formatCell(row, 6, vo.getQobno() != null ? vo.getQobno().toString() : "", style); + ExcelUtils.formatCell(row, 7, vo.getMsqbgtm() != null ? DateUtils.parseDateToStr(SystemConstants.TIME_FORMAT,vo.getMsqbgtm()) : "", style); + ExcelUtils.formatCell(row, 8, vo.getMsqedtm() != null ? DateUtils.parseDateToStr(SystemConstants.TIME_FORMAT,vo.getMsqedtm()) : "", style); + ExcelUtils.formatCell(row, 9, vo.getXsqlc() != null ? vo.getXsqlc() : "", style); + ExcelUtils.formatCell(row, 10, vo.getMsqmt() != null ? vo.getMsqmt() : "", style); + ExcelUtils.formatCell(row, 11, vo.getBsggz() != null ? vo.getBsggz().toString() : "", style); + ExcelUtils.formatCell(row, 12, vo.getQ() != null ? vo.getQ().toString() : "", style); + ExcelUtils.formatCell(row, 13, vo.getQrcd() != null ? vo.getQrcd() : "", style); + ExcelUtils.formatCell(row, 14, vo.getXstta() != null ? vo.getXstta().toString() : "", style); + ExcelUtils.formatCell(row, 15, vo.getXsa() != null ? vo.getXsa().toString() : "", style); + ExcelUtils.formatCell(row, 16, vo.getXsarcd() != null ? vo.getXsarcd() : "", style); + ExcelUtils.formatCell(row, 17, vo.getXsavv() != null ? vo.getXsavv().toString() : "", style); + ExcelUtils.formatCell(row, 18, vo.getXsmxv() != null ? vo.getXsmxv().toString() : "", style); + ExcelUtils.formatCell(row, 19, vo.getTpwd() != null ? vo.getTpwd().toString() : "", style); + ExcelUtils.formatCell(row, 20, vo.getXsavdp() != null ? vo.getXsavdp().toString() : "", style); + ExcelUtils.formatCell(row, 21, vo.getXsmxdp() != null ? vo.getXsmxdp().toString() : "", style); + ExcelUtils.formatCell(row, 22, vo.getIbwd() != null ? vo.getIbwd().toString() : "", style); + ExcelUtils.formatCell(row, 23, vo.getIbavdp() != null ? vo.getIbavdp().toString() : "", style); + ExcelUtils.formatCell(row, 24, vo.getIbmxdp() != null ? vo.getIbmxdp().toString() : "", style); + ExcelUtils.formatCell(row, 25, vo.getRvsfsl() != null ? vo.getRvsfsl().toString() : "", style); + ExcelUtils.formatCell(row, 26, vo.getN() != null ? vo.getN().toString() : "", style); + ExcelUtils.formatCell(row, 27, vo.getObnont() != null ? vo.getObnont() : "", style); + // 增加行号和全局序号 + rowIndex++; + globalIndex++; + } + } + return 0; + } +} diff --git a/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/service/impl/HyXsmsrsGServiceImpl.java b/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/service/impl/HyXsmsrsGServiceImpl.java new file mode 100644 index 0000000..72ef9f9 --- /dev/null +++ b/swlscx/src/main/java/com/ruoyi/swlscx/actualSurvey/service/impl/HyXsmsrsGServiceImpl.java @@ -0,0 +1,187 @@ +package com.ruoyi.swlscx.actualSurvey.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.config.RuoYiConfig; +import com.ruoyi.common.core.page.R; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.swlscx.actualSurvey.domain.po.HyXsmsrsG; +import com.ruoyi.swlscx.actualSurvey.domain.vo.HyObqGVo; +import com.ruoyi.swlscx.actualSurvey.domain.vo.HyXsmsrsGVo; +import com.ruoyi.swlscx.actualSurvey.mapper.HyXsmsrsGMapper; +import com.ruoyi.swlscx.actualSurvey.service.HyXsmsrsGService; +import com.ruoyi.swlscx.basic.domain.po.YcExportTask; +import com.ruoyi.swlscx.basic.service.YcExportTaskService; +import com.ruoyi.swlscx.common.PageParams; +import com.ruoyi.swlscx.common.constants.SystemConstants; +import com.ruoyi.swlscx.common.utils.CommonUtils; +import com.ruoyi.swlscx.common.utils.ExcelUtils; +import com.ruoyi.swlscx.common.utils.Query; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.poi.ss.usermodel.CellStyle; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ThreadPoolExecutor; + +/** + * @Author al + * @Date 2025/7/11 15:41 + * @Description: TODO + * @Version + */ +@Service +public class HyXsmsrsGServiceImpl extends ServiceImpl + implements HyXsmsrsGService { + + @Resource + private ThreadPoolExecutor labelThreadPool; + + @Resource + private YcExportTaskService ycExportTaskService; + + @Override + public IPage selectHyXsmsrsGDataByPageAndInfo(PageParams pageParams, String startTime, String endTime, String stcd, String stnm) { + Map map = CommonUtils.getYearAndDayDataMap(pageParams, startTime, endTime, stcd, stnm); + return this.baseMapper.selectHyXsmsrsGDataByPageAndInfo(new Query().getPage(map), map); + } + + @Override + public R exportHyXsmsrsGData(HttpServletResponse response, String startTime, String endTime, String stcd, String stnm) { + Long userId = SecurityUtils.getUserId(); + String tableName = "实测大断面成果表"; + return taskAndExport(tableName,startTime, endTime, stcd, stnm, userId); + } + + private R taskAndExport(String tableName,String startTime, String endTime, String stcd, String stnm, Long userId) { + String startNewTime=""; + String endNewTime=""; + if (ObjectUtils.isNotEmpty(startTime) ){ + startNewTime=startTime.substring(0,6); + } + if (ObjectUtils.isNotEmpty(endTime)){ + endNewTime=endTime.substring(0,6); + } + String filename = tableName + startNewTime + "-" + endNewTime; + // 查询是否已存在相同条件且未完成的任务 + List ongoingTasks = ycExportTaskService.list( + new QueryWrapper() + .eq("user_id", userId) + .eq("filename", filename) + .eq("status", 0) // 状态为0表示任务未完成 + ); + + if (!ongoingTasks.isEmpty()) { + return R.error("当前任务正在下载中,请稍后重试"); + } + + YcExportTask ycExportTask = new YcExportTask(); + String pathPeffix = RuoYiConfig.getExportPath() + + File.separator + userId + File.separator+ + DateUtils.parseDateToStr("yyyy-MM-dd",DateUtils.getNowDate()) + File.separator + + DateUtils.parseDateToStr("HH_mm",DateUtils.getNowDate())+File.separator; + ycExportTask.setFilename(filename); + ycExportTask.setUserId(userId); + ycExportTask.setStartTime(new Date()); + ycExportTask.setStatus(0); + ycExportTask.setFilepath(pathPeffix); + ycExportTaskService.save(ycExportTask); + CompletableFuture.runAsync(() -> { + try { + File dest = new File(pathPeffix); + if (!dest.exists()) { + dest.mkdirs(); + } + String fullPath = pathPeffix + filename; + exportBlackData(fullPath, startTime, endTime, stcd, stnm); + + ycExportTask.setStatus(1); + ycExportTask.setEndTime(new Date()); + ycExportTaskService.updateById(ycExportTask); + } catch (Exception e) { + log.error(e.getMessage(), e); + R.error("任务下载失败"); + } + }, labelThreadPool); + return R.ok("任务已提交,请稍后下载"); + } + + + private void exportBlackData(String tableName, String startTime, String endTime, String stcd, String stnm) { + Map rainMap = CommonUtils.getYearAndDayDataMap(new PageParams(0L, 1000000000L), startTime, endTime, stcd, stnm); + ExcelUtils.excelBackExport2("hyXsmsrsG.xls", tableName, (Sheet sheet, CellStyle style) -> + dataModel1(rainMap, sheet, style)); + } + + public int dataModel1(Map map, Sheet sheet, CellStyle style) { + // 批量查询数据 + List hyXsmsrsGVos = this.baseMapper.selectHyXsmsrsGData(map); + + // 定义当前sheet的行号 + int rowIndex = 2; // 从第二行开始写入数据 + // 定义全局序号 + int globalIndex = 1; // 从1开始 + + // 定义当前sheet的编号 + int sheetIndex = 1; + + // 最大行数限制 + int maxRowsPerSheet = 65536; // 对于 .xls 文件,最大行数为 65536 + int batchSize = 1000; // 每次批量处理1000行,减少逐行写入的开销 + + // 复制表头到新sheet的逻辑 + ExcelUtils.copyHeader(sheet, style); + + // 批量处理数据 + for (int i = 0; i < hyXsmsrsGVos.size(); i += batchSize) { + // 处理一批数据 + int toIndex = Math.min(i + batchSize, hyXsmsrsGVos.size()); + List batchList = hyXsmsrsGVos.subList(i, toIndex); + + // 批量写入数据 + for (HyXsmsrsGVo vo : batchList) { + // 如果当前行数达到最大行数,创建新sheet + if (rowIndex >= maxRowsPerSheet) { + sheetIndex++; + sheet = sheet.getWorkbook().createSheet("实测大断面成果表" + sheetIndex); + rowIndex = 2; // 重置行号 + // 复制表头到新sheet + ExcelUtils.copyHeader(sheet, style); + } + + // 创建新行并写入数据 + Row row = ExcelUtils.createRow(sheet, rowIndex); + + // 使用 globalIndex 作为序号 + ExcelUtils.formatCell(row, 0, String.valueOf(globalIndex), style); + ExcelUtils.formatCell(row, 1, vo.getStcd() != null ? vo.getStcd() : "", style); + ExcelUtils.formatCell(row, 2, vo.getStnm() != null ? vo.getStnm() : "", style); + ExcelUtils.formatCell(row, 3, vo.getAddvcd() != null ? vo.getAddvcd() : "", style); + ExcelUtils.formatCell(row, 4, vo.getObdt() != null ? DateUtils.parseDateToStr(SystemConstants.TIME_FORMAT,vo.getObdt()) : "", style); + ExcelUtils.formatCell(row, 5, vo.getObno() != null ? vo.getObno().toString() : "", style); + ExcelUtils.formatCell(row, 6, vo.getVtno() != null ? vo.getVtno() : "", style); + ExcelUtils.formatCell(row, 7, vo.getDi() != null ? vo.getDi().toString() : "", style); + ExcelUtils.formatCell(row, 8, vo.getRvbbel() != null ? vo.getRvbbel().toString() : "", style); + ExcelUtils.formatCell(row, 9, vo.getRvbbelrcd() != null ? vo.getRvbbelrcd() : "", style); + ExcelUtils.formatCell(row, 10, vo.getOdbrz() != null ? vo.getOdbrz().toString() : "", style); + ExcelUtils.formatCell(row, 11, vo.getOdbrzrcd() != null ? vo.getOdbrzrcd() : "", style); + ExcelUtils.formatCell(row, 12, vo.getVtaz() != null ? vo.getVtaz() : "", style); + ExcelUtils.formatCell(row, 13, vo.getNof() != null ? vo.getNof() .toString(): "", style); + // 增加行号和全局序号 + rowIndex++; + globalIndex++; + } + } + return 0; + } +} diff --git a/swlscx/src/main/java/com/ruoyi/swlscx/basic/controller/BaseInfoController.java b/swlscx/src/main/java/com/ruoyi/swlscx/basic/controller/BaseInfoController.java index 600b966..aab6ee5 100644 --- a/swlscx/src/main/java/com/ruoyi/swlscx/basic/controller/BaseInfoController.java +++ b/swlscx/src/main/java/com/ruoyi/swlscx/basic/controller/BaseInfoController.java @@ -14,7 +14,9 @@ import com.ruoyi.swlscx.basic.domain.vo.HyStscAVo; import com.ruoyi.swlscx.basic.service.YcExportTaskService; import com.ruoyi.swlscx.common.PageParams; import com.ruoyi.swlscx.basic.service.HyStscAService; +import com.ruoyi.swlscx.synchronousData.service.YcResTableInfoService; import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpHeaders; import org.springframework.security.access.prepost.PreAuthorize; @@ -27,6 +29,7 @@ import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -62,7 +65,14 @@ public class BaseInfoController { public R getStationList(@RequestParam(value = "startTime",defaultValue = "") String startTime, @RequestParam(value = "endTime",defaultValue = "")String endTime, @RequestParam(value = "type",defaultValue = "") String type) { - return R.ok().put("data", hyStscAService.getList(startTime,endTime,type)); + HyStscASelectVo list = hyStscAService.getList(startTime, endTime, type); + + int size = list.getChildren().size(); + if (size == 0) { + return R.ok().put("data", list).put("count", 0); + }else { + return R.ok().put("data", list).put("count", size-1); + } } /** @@ -154,7 +164,14 @@ public class BaseInfoController { public R getStationListByType(@RequestParam(value = "type",defaultValue = "") String type, @RequestParam(value = "startTime",defaultValue = "") String startTime, @RequestParam(value = "endTime",defaultValue = "")String endTime) { - return R.ok().put("data", hyStscAService.getStationListByType(startTime,endTime,type)); + HyStscASelectVo list = hyStscAService.getStationListByType(startTime, endTime, type); + List children = list.getChildren(); + int size = children.size(); + if (size == 0) { + return R.ok().put("data", list).put("count", 0); + }else { + return R.ok().put("data", list).put("count", size-1); + } } @RequestMapping("/testConnection") @@ -195,4 +212,15 @@ public class BaseInfoController { } + @Autowired + private YcResTableInfoService ycResTableInfoService; + + @RequestMapping("/getStatInfo") + public R getStatInfo(@RequestParam(value = "stcd",defaultValue = "") String stcds, + @RequestParam(value = "startTime",defaultValue = "") String startTime, + @RequestParam(value = "endTime",defaultValue = "")String endTime, + @RequestParam(value = "page") Integer pageNum, + @RequestParam(value = "limit") Integer pageSize) { + return ycResTableInfoService.getStatInfo(stcds,startTime,endTime,pageNum,pageSize); + } } diff --git a/swlscx/src/main/java/com/ruoyi/swlscx/basic/mapper/HyStscAMapper.java b/swlscx/src/main/java/com/ruoyi/swlscx/basic/mapper/HyStscAMapper.java index 364d36c..2e26728 100644 --- a/swlscx/src/main/java/com/ruoyi/swlscx/basic/mapper/HyStscAMapper.java +++ b/swlscx/src/main/java/com/ruoyi/swlscx/basic/mapper/HyStscAMapper.java @@ -54,6 +54,10 @@ public interface HyStscAMapper extends BaseMapper { List listHyDzC(@Param("startTimeDay") String startTimeDay, @Param("endTimeDay") String endTimeDay); List listHyDpc(@Param("startTimeDay") String startTimeDay, @Param("endTimeDay") String endTimeDay); + + List getStatList(@Param("startTime") String startTime, @Param("endTime") String endTime); + + List getStatAllList(); } diff --git a/swlscx/src/main/java/com/ruoyi/swlscx/basic/service/impl/HyStscAServiceImpl.java b/swlscx/src/main/java/com/ruoyi/swlscx/basic/service/impl/HyStscAServiceImpl.java index 7c0510e..a182ba8 100644 --- a/swlscx/src/main/java/com/ruoyi/swlscx/basic/service/impl/HyStscAServiceImpl.java +++ b/swlscx/src/main/java/com/ruoyi/swlscx/basic/service/impl/HyStscAServiceImpl.java @@ -268,6 +268,8 @@ public class HyStscAServiceImpl extends ServiceImpl impl @Autowired private HyStscAService hyStscAService; + + @Override public HyStscASelectVo getList(String startTime, String endTime, String type) { List list = new ArrayList<>(); @@ -749,6 +751,16 @@ public class HyStscAServiceImpl extends ServiceImpl impl if (!stcds.isEmpty()) { list = this.list(Wrappers.lambdaQuery(HyStscA.class).in(HyStscA::getStcd, stcds)); } + }else if (type.equals("YcStat")){ + List stcds = new ArrayList<>(); + if (ObjectUtils.isNotEmpty(startTime) || ObjectUtils.isNotEmpty(endTime)){ + stcds =this.baseMapper.getStatList(startTime, endTime); + }else { + stcds =this.baseMapper.getStatAllList(); + } + if (!stcds.isEmpty()) { + list = this.list(Wrappers.lambdaQuery(HyStscA.class).in(HyStscA::getStcd, stcds)); + } } diff --git a/swlscx/src/main/java/com/ruoyi/swlscx/synchronousData/controller/TimeTasksController.java b/swlscx/src/main/java/com/ruoyi/swlscx/synchronousData/controller/TimeTasksController.java index 5fd74b3..75bffe9 100644 --- a/swlscx/src/main/java/com/ruoyi/swlscx/synchronousData/controller/TimeTasksController.java +++ b/swlscx/src/main/java/com/ruoyi/swlscx/synchronousData/controller/TimeTasksController.java @@ -4,6 +4,7 @@ import com.ruoyi.common.core.page.R; import com.ruoyi.swlscx.basic.service.YcExportTaskService; import com.ruoyi.swlscx.synchronousData.dto.JHDayData; import com.ruoyi.swlscx.synchronousData.service.TimeTasksService; +import com.ruoyi.swlscx.synchronousData.service.YcResTableInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestHeader; @@ -24,6 +25,9 @@ public class TimeTasksController { @Autowired private TimeTasksService timeTasksService; + @Autowired + private YcResTableInfoService ycResTableInfoService; + @RequestMapping("/importSqlserverToMysql") public R importSqlserverToMysql(@RequestBody List jhDayDataList, @RequestHeader("X-Type")String type) { @@ -268,4 +272,11 @@ public class TimeTasksController { } + + @RequestMapping("/test666") + public R getTest666(){ + return ycResTableInfoService.getYcResTableInfo(); + } + + } diff --git a/swlscx/src/main/java/com/ruoyi/swlscx/synchronousData/dto/YcResStatInfo.java b/swlscx/src/main/java/com/ruoyi/swlscx/synchronousData/dto/YcResStatInfo.java new file mode 100644 index 0000000..27dd998 --- /dev/null +++ b/swlscx/src/main/java/com/ruoyi/swlscx/synchronousData/dto/YcResStatInfo.java @@ -0,0 +1,35 @@ +package com.ruoyi.swlscx.synchronousData.dto; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import org.springframework.data.annotation.Id; + +/** + * @Author al + * @Date 2025/7/8 15:35 + * @Description: TODO + * @Version + */ +@Data +public class YcResStatInfo { + + private Long id; + + private String stcd; + + private String stnm; + + private String sType; + + private String resType; + + private Long resTableId; + + private String resTable; + + private String statYear; + + private String oldYear; + +} diff --git a/swlscx/src/main/java/com/ruoyi/swlscx/synchronousData/mapper/YcResTableInfoMapper.java b/swlscx/src/main/java/com/ruoyi/swlscx/synchronousData/mapper/YcResTableInfoMapper.java new file mode 100644 index 0000000..7c150d2 --- /dev/null +++ b/swlscx/src/main/java/com/ruoyi/swlscx/synchronousData/mapper/YcResTableInfoMapper.java @@ -0,0 +1,33 @@ +package com.ruoyi.swlscx.synchronousData.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.swlscx.basic.domain.vo.HyStscAVo; +import com.ruoyi.swlscx.synchronousData.dto.YcResStatInfo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * @Author al + * @Date 2025/7/8 15:18 + * @Description: TODO + * @Version + */ +@Mapper +public interface YcResTableInfoMapper { + + List getResTableByDay(@Param("tableName") String tableName); + + void saveBatch(List ycResStatInfoList); + + IPage getPageList(@Param("page") Page page, @Param("param")Map map); + + List getResTableRainXPList(@Param("tableName") String tableName); + + List getResTableRainrexBList(@Param("tableName") String tableName); + + List getResTableTMList(@Param("tableName") String tableName); +} diff --git a/swlscx/src/main/java/com/ruoyi/swlscx/synchronousData/service/YcResTableInfoService.java b/swlscx/src/main/java/com/ruoyi/swlscx/synchronousData/service/YcResTableInfoService.java new file mode 100644 index 0000000..908cba9 --- /dev/null +++ b/swlscx/src/main/java/com/ruoyi/swlscx/synchronousData/service/YcResTableInfoService.java @@ -0,0 +1,15 @@ +package com.ruoyi.swlscx.synchronousData.service; + +import com.ruoyi.common.core.page.R; + +/** + * @Author al + * @Date 2025/7/8 15:18 + * @Description: TODO + * @Version + */ +public interface YcResTableInfoService { + R getYcResTableInfo(); + + R getStatInfo(String stcds, String startTime, String endTime,Integer pageNum,Integer pageSize); +} diff --git a/swlscx/src/main/java/com/ruoyi/swlscx/synchronousData/service/impl/TimeTasksServiceImpl.java b/swlscx/src/main/java/com/ruoyi/swlscx/synchronousData/service/impl/TimeTasksServiceImpl.java index 07f65bd..406ed75 100644 --- a/swlscx/src/main/java/com/ruoyi/swlscx/synchronousData/service/impl/TimeTasksServiceImpl.java +++ b/swlscx/src/main/java/com/ruoyi/swlscx/synchronousData/service/impl/TimeTasksServiceImpl.java @@ -23,6 +23,7 @@ import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; +import java.time.LocalDate; import java.time.LocalDateTime; import java.time.Year; import java.time.format.DateTimeFormatter; @@ -60,7 +61,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { * 获取江河湖库日雨量数据 */ @Override - @Scheduled(cron = "0 10 0 18 * ?") + @Scheduled(cron = "0 10 0 13 * ?") @DataSource(DataSourceType.SLAVE) public void getDayRainData() { List ycStations = getYcStations(); @@ -97,7 +98,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { * 获取江河湖库日平均流量表 */ @DataSource(DataSourceType.SLAVE) - @Scheduled(cron = "0 20 0 18 * ?") + @Scheduled(cron = "0 20 0 13 * ?") @Override public void getDayQData() { List ycStations = getYcStations(); @@ -134,7 +135,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { * 获取江河湖库日平均输沙率表 */ @DataSource(DataSourceType.SLAVE) - @Scheduled(cron = "0 30 0 18 * ?") + @Scheduled(cron = "0 30 0 13 * ?") @Override public void getDayDqsData() { List ycStations = getYcStations(); @@ -173,7 +174,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { * 获取江河湖库日平均含沙量表 */ @DataSource(DataSourceType.SLAVE) - @Scheduled(cron = "0 40 0 18 * ?") + @Scheduled(cron = "0 40 0 13 * ?") @Override public void getDayDcsData() { List ycStations = getYcStations(); @@ -212,7 +213,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { * 获取江河湖库日时段最大降水表 */ @DataSource(DataSourceType.SLAVE) - @Scheduled(cron = "0 50 0 18 * ?") + @Scheduled(cron = "0 50 0 13 * ?") @Override public void getDayDmxpData() { List ycStations = getYcStations(); @@ -252,7 +253,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { * 获取江河湖库日水面蒸发量表 */ @DataSource(DataSourceType.SLAVE) - @Scheduled(cron = "0 0 1 18 * ?") // 每月19号01:00执行 + @Scheduled(cron = "0 0 1 13 * ?") // 每月19号01:00执行 @Override public void getDayDweData() { List ycStations = getYcStations(); @@ -291,7 +292,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { * 获取江河湖库日水温表 */ @DataSource(DataSourceType.SLAVE) - @Scheduled(cron = "0 10 1 18 * ?") + @Scheduled(cron = "0 10 1 13 * ?") @Override public void getDayDwtData() { List ycStations = getYcStations(); @@ -329,7 +330,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { * 获取江河湖库日平均水位表 */ @DataSource(DataSourceType.SLAVE) - @Scheduled(cron = "0 20 1 18 * ?") + @Scheduled(cron = "0 20 1 13 * ?") @Override public void getDayDzcData() { List ycStations = getYcStations(); @@ -367,7 +368,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { * 获取江河湖库时段最大洪量表 */ @DataSource(DataSourceType.SLAVE) - @Scheduled(cron = "0 30 1 18 * ?") + @Scheduled(cron = "0 30 1 13 * ?") @Override public void getDayImxfwData() { List ycStations = getYcStations(); @@ -401,7 +402,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { } getDateService.insertRainData(stcds, SWTableEnum.DAY_MXFW.value());} @DataSource(DataSourceType.SLAVE) - @Scheduled(cron = "0 40 1 18 * ?") + @Scheduled(cron = "0 40 1 13 * ?") @Override public void getFdheexData() { List ycStations = getYcStations(); @@ -435,7 +436,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { }getDateService.insertRainData(stcds, SWTableEnum.DP_FDHEEX.value());} @DataSource(DataSourceType.SLAVE) - @Scheduled(cron = "0 50 1 18 * ?") + @Scheduled(cron = "0 50 1 13 * ?") @Override public void getHltdzData() { List ycStations = getYcStations(); @@ -466,7 +467,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { TimeUnit.HOURS);stcds.add("HyHltdzB:"+ycStation.getStcd());} getDateService.insertRainData(stcds, SWTableEnum.DP_HLTDZ.value());} @DataSource(DataSourceType.SLAVE) - @Scheduled(cron = "0 0 2 18 * ?") @Override + @Scheduled(cron = "0 0 2 13 * ?") @Override public void getHmxpData() { List ycStations = getYcStations(); String[] startAndEndTime = getStartAndEndTime(); @@ -495,7 +496,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { getDateService.insertRainData(stcds, SWTableEnum.DP_HMXP.value());} @DataSource(DataSourceType.SLAVE) - @Scheduled(cron = "0 10 2 18 * ?") + @Scheduled(cron = "0 10 2 13 * ?") @Override public void getMmxpData() { List ycStations = getYcStations(); @@ -535,7 +536,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { * 获取江河湖库月含沙量表 */ @DataSource(DataSourceType.SLAVE) - @Scheduled(cron = "0 20 2 18 * ?") + @Scheduled(cron = "0 20 2 13 * ?") @Override public void getMtcsData() { List ycStations = getYcStations(); @@ -579,7 +580,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { * 获取江河湖库月降水表数据 */ @Override - @Scheduled(cron = "0 30 2 18 * ?") + @Scheduled(cron = "0 30 2 13 * ?") @DataSource(DataSourceType.SLAVE) public void getMonthRainData() { List ycStations = getYcStations(); @@ -620,7 +621,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { * 获取江河湖库月流量表数据 */ @Override - @Scheduled(cron = "0 40 2 18 * ?") + @Scheduled(cron = "0 40 2 13 * ?") @DataSource(DataSourceType.SLAVE) public void getMonthQData() { List ycStations = getYcStations(); @@ -663,7 +664,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { * 获取江河湖库月输沙率表 */ @Override - @Scheduled(cron = "0 50 2 18 * ?") + @Scheduled(cron = "0 50 2 13 * ?") @DataSource(DataSourceType.SLAVE) public void getMonthMtqsData() { List ycStations = getYcStations(); @@ -704,7 +705,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { * 获取江河湖库月潮位表 */ @Override - @Scheduled(cron = "0 0 3 18 * ?") + @Scheduled(cron = "0 0 3 13 * ?") @DataSource(DataSourceType.SLAVE) public void getMonthMttdzData() { List ycStations = getYcStations(); @@ -772,7 +773,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { * 获取江河湖库月水面蒸发量表 */ @Override - @Scheduled(cron = "0 10 3 18 * ?") + @Scheduled(cron = "0 10 3 13 * ?") @DataSource(DataSourceType.SLAVE) public void getMonthMtweData() { List ycStations = getYcStations(); @@ -815,7 +816,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { * 获取江河湖库月水温表 */ @Override - @Scheduled(cron = "0 20 3 18 * ?") + @Scheduled(cron = "0 20 3 13 * ?") @DataSource(DataSourceType.SLAVE) public void getMonthMtwtData() { List ycStations = getYcStations(); @@ -857,7 +858,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { * 获取江河湖库月河道水位表 */ @Override - @Scheduled(cron = "0 30 3 18 * ?") + @Scheduled(cron = "0 30 3 13 * ?") @DataSource(DataSourceType.SLAVE) public void getMonthRiverData() { List ycStations = getYcStations(); @@ -902,7 +903,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { * 获取江河湖库降水量摘录表 */ @Override - @Scheduled(cron = "0 40 3 18 * ?") + @Scheduled(cron = "0 40 3 13 * ?") @DataSource(DataSourceType.SLAVE) public void getHourRainData() { List ycStations = getYcStations(); @@ -941,7 +942,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { * 获取江河湖库水库洪水水位要素摘录表 */ @Override - @Scheduled(cron = "0 50 3 18 * ?") + @Scheduled(cron = "0 50 3 13 * ?") @DataSource(DataSourceType.SLAVE) public void getRvfhexData() { List ycStations = getYcStations(); @@ -978,7 +979,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { * 获取江河湖库水闸洪水水文要素摘录表 */ @Override - @Scheduled(cron = "0 0 4 18 * ?") + @Scheduled(cron = "0 0 4 13 * ?") @DataSource(DataSourceType.SLAVE) public void getWsfhexData() { List ycStations = getYcStations(); @@ -1017,7 +1018,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { * 获取江河湖库年含沙量表 */ @Override - @Scheduled(cron = "0 10 4 18 * ?") + @Scheduled(cron = "0 10 4 13 * ?") @DataSource(DataSourceType.SLAVE) public void getYrcsData() { List ycStations = getYcStations(); @@ -1053,7 +1054,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { * 获取江河湖库年流量表 */ @Override - @Scheduled(cron = "0 20 4 18 * ?") + @Scheduled(cron = "0 20 4 13 * ?") @DataSource(DataSourceType.SLAVE) public void getYearQData() { List ycStations = getYcStations(); @@ -1090,7 +1091,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { * 获取江河湖库年降水表 */ @Override - @Scheduled(cron = "0 30 4 18 * ?") + @Scheduled(cron = "0 30 4 13 * ?") @DataSource(DataSourceType.SLAVE) public void getYearRainData() { List ycStations = getYcStations(); @@ -1128,7 +1129,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { * 获取江河湖库年潮位表 */ @Override - @Scheduled(cron = "0 40 4 18 * ?") + @Scheduled(cron = "0 40 4 13 * ?") @DataSource(DataSourceType.SLAVE) public void getYearTideData() { List ycStations = getYcStations(); @@ -1195,7 +1196,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { * 获取江河湖库年水面蒸发量表 */ @Override - @Scheduled(cron = "0 50 4 18 * ?") + @Scheduled(cron = "0 50 4 13 * ?") @DataSource(DataSourceType.SLAVE) public void getYearMtweData() { List ycStations = getYcStations(); @@ -1236,7 +1237,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { * 获取江河湖库年水温表 */ @Override - @Scheduled(cron = "0 0 5 18 * ?") + @Scheduled(cron = "0 0 5 13 * ?") @DataSource(DataSourceType.SLAVE) public void getYearWtData() { List ycStations = getYcStations(); @@ -1274,7 +1275,7 @@ public class TimeTasksServiceImpl implements TimeTasksService { * 获取江河湖库河道年水位表 */ @Override - @Scheduled(cron = "0 10 5 18 * ?") + @Scheduled(cron = "0 10 5 13 * ?") @DataSource(DataSourceType.SLAVE) public void getYearYrzData() { List ycStations = getYcStations(); @@ -1331,15 +1332,19 @@ public class TimeTasksServiceImpl implements TimeTasksService { private static String[] getStartAndEndTime() { DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); - LocalDateTime endDate = LocalDateTime.now() - .withHour(0) - .withMinute(0) - .withSecond(0); - LocalDateTime startDate = endDate.minusMonths(6); + // 获取当前年份的1月1日 00:00:00(今年开始时刻) + LocalDateTime startDate = LocalDate.now() + .withMonth(1) // 设置为1月 + .withDayOfMonth(1) // 设置为1号 + .atStartOfDay(); // 转换为当天的00:00:00 [7,8](@ref) + + // 获取当前精确时间(至今) + LocalDateTime endDate = LocalDateTime.now(); + return new String[]{ - endDate.format(formatter), // endTime - startDate.format(formatter) // startTime + startDate.format(formatter), // 今年开始时间 + endDate.format(formatter) // 当前时间 }; } diff --git a/swlscx/src/main/java/com/ruoyi/swlscx/synchronousData/service/impl/YcResTableInfoServiceImpl.java b/swlscx/src/main/java/com/ruoyi/swlscx/synchronousData/service/impl/YcResTableInfoServiceImpl.java new file mode 100644 index 0000000..f75c703 --- /dev/null +++ b/swlscx/src/main/java/com/ruoyi/swlscx/synchronousData/service/impl/YcResTableInfoServiceImpl.java @@ -0,0 +1,224 @@ +package com.ruoyi.swlscx.synchronousData.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.ruoyi.common.core.page.R; +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.swlscx.basic.domain.vo.HyStscAVo; +import com.ruoyi.swlscx.common.utils.Query; +import com.ruoyi.swlscx.synchronousData.dto.YcResStatInfo; +import com.ruoyi.swlscx.synchronousData.enums.SWTableEnum; +import com.ruoyi.swlscx.synchronousData.mapper.YcResTableInfoMapper; +import com.ruoyi.swlscx.synchronousData.service.YcResTableInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Author al + * @Date 2025/7/8 15:18 + * @Description: TODO + * @Version + */ +@Service +public class YcResTableInfoServiceImpl implements YcResTableInfoService { + + @Autowired + private YcResTableInfoMapper ycResTableInfoMapper; + + @Override + @Transactional(rollbackFor = Exception.class) + public R getYcResTableInfo() { + //逐日降水 + List ycResStatInfoList = ycResTableInfoMapper.getResTableRainXPList(SWTableEnum.MONTH_RAIN.value()); + ycResStatInfoList.forEach(i -> { + i.setSType("P"); + i.setResType("雨量资料"); + i.setResTableId(1L); + String statYear = i.getStatYear(); + i.setStatYear(formatYears(statYear)); + i.setOldYear(statYear); + i.setResTable("逐日降水数据表"); + } + ); + ycResTableInfoMapper.saveBatch(ycResStatInfoList); + + //最大小时降水表(1) + List ycResStatInfoMMXPList = ycResTableInfoMapper.getResTableRainXPList(SWTableEnum.DP_MMXP.value()); + ycResStatInfoMMXPList.forEach(i -> { + i.setSType("P"); + i.setResType("雨量资料"); + i.setResTableId(2L); + String statYear = i.getStatYear(); + i.setStatYear(formatYears(statYear)); + i.setOldYear(statYear); + i.setResTable("各时段最大降水表(1)"); + } + ); + ycResTableInfoMapper.saveBatch(ycResStatInfoMMXPList); + + + //最大小时降水表(2) + List ycResStatInfoHMXPList = ycResTableInfoMapper.getResTableRainXPList(SWTableEnum.DP_HMXP.value()); + ycResStatInfoHMXPList.forEach(i -> { + i.setSType("P"); + i.setResType("雨量资料"); + i.setResTableId(3L); + String statYear = i.getStatYear(); + i.setStatYear(formatYears(statYear)); + i.setOldYear(statYear); + i.setResTable("各时段最大降水表(2)"); + } + ); + ycResTableInfoMapper.saveBatch(ycResStatInfoHMXPList); + + //降水量摘录表 + List ycResStatInfoPrexBList = ycResTableInfoMapper.getResTableRainrexBList(SWTableEnum.DP_HOUR.value()); + ycResStatInfoPrexBList.forEach(i -> { + i.setSType("P"); + i.setResType("雨量资料"); + i.setResTableId(4L); + String statYear = i.getStatYear(); + i.setStatYear(formatYears(statYear)); + i.setOldYear(statYear); + i.setResTable("降水量摘录表"); + } + ); + ycResTableInfoMapper.saveBatch(ycResStatInfoPrexBList); + + + //逐日平均水位表 + List ycResStatInfoZDayList = ycResTableInfoMapper.getResTableRainXPList(SWTableEnum.MONTH_RIVER.value()); + ycResStatInfoZDayList.forEach(i -> { + i.setSType("Z"); + i.setResType("水位资料"); + i.setResTableId(5L); + String statYear = i.getStatYear(); + i.setStatYear(formatYears(statYear)); + i.setOldYear(statYear); + i.setResTable("逐日平均水位表"); + } + ); + + ycResTableInfoMapper.saveBatch(ycResStatInfoZDayList); + + // 水闸洪水水文要素摘录表 + List ycResStatInfoSZList2 = ycResTableInfoMapper.getResTableTMList(SWTableEnum.DP_WSFHEX.value()); + ycResStatInfoSZList2.forEach(i -> { + i.setSType("Z"); + i.setResType("水位资料"); + i.setResTableId(6L); + String statYear = i.getStatYear(); + i.setStatYear(formatYears(statYear)); + i.setOldYear(statYear); + i.setResTable("水闸洪水水文要素摘录表"); + } + ); + ycResTableInfoMapper.saveBatch(ycResStatInfoSZList2); + + + // 逐潮高低潮位表 + List ycResStatInfoZCList2 = ycResTableInfoMapper.getResTableTMList(SWTableEnum.DP_HLTDZ.value()); + ycResStatInfoZCList2.forEach(i -> { + i.setSType("Z"); + i.setResType("水位资料"); + i.setResTableId(7L); + String statYear = i.getStatYear(); + i.setStatYear(formatYears(statYear)); + i.setOldYear(statYear); + i.setResTable("逐潮高低潮位表"); + } + ); + ycResTableInfoMapper.saveBatch(ycResStatInfoZCList2); + + + + // 潮位月年统计表 + List ycResStatInfoCWList2 = ycResTableInfoMapper.getResTableRainXPList(SWTableEnum.MONTH_MTTDZ.value()); + ycResStatInfoCWList2.forEach(i -> { + i.setSType("Z"); + i.setResType("水位资料"); + i.setResTableId(8L); + String statYear = i.getStatYear(); + i.setStatYear(formatYears(statYear)); + i.setOldYear(statYear); + i.setResTable("潮位月年统计表"); + } + ); + ycResTableInfoMapper.saveBatch(ycResStatInfoCWList2); + + + return R.ok().put("data", ycResStatInfoSZList2); + } + + public static String formatYears(String yearStr) { + if (yearStr == null || yearStr.isEmpty()) { + return ""; + } + + // 拆分年份并转换为整数集合 + String[] yearArray = yearStr.split(","); + List years = new ArrayList<>(); + for (String year : yearArray) { + try { + years.add(Integer.parseInt(year.trim())); + } catch (NumberFormatException ignored) { + } + } + if (years.isEmpty()) return ""; + + // 排序年份 + Collections.sort(years); + + // 合并连续年份 + List parts = new ArrayList<>(); + int start = years.get(0); + int prev = start; + + for (int i = 1; i < years.size(); i++) { + int current = years.get(i); + if (current == prev + 1) { // 连续年份 + prev = current; + } else { // 非连续年份 + addYearPart(parts, start, prev); + start = current; + prev = current; + } + } + addYearPart(parts, start, prev); // 处理最后一组 + + return String.join(",", parts); + } + + private static void addYearPart(List parts, int start, int end) { + if (start == end) { + parts.add(String.valueOf(start)); + } else { + parts.add(start + "-" + end); + } + } + + @Override + public R getStatInfo(String stcds, String startTime, String endTime, Integer pageNum, Integer pageSize) { + Map map = new HashMap<>(); + map.put("page", Convert.toStr(pageNum)); + map.put("limit", Convert.toStr(pageSize)); + List filteredList = Collections.emptyList(); + if (stcds != null) { + if (stcds.contains("all")) { + stcds = ""; + } + filteredList = Arrays.stream(stcds.split(",")) + .filter(s -> s != null && !s.trim().isEmpty()) + .map(String::trim) + .collect(Collectors.toList()); + } + System.out.println("stcds: "+stcds); + map.put("stcds", filteredList.isEmpty() ? null : filteredList); + IPage ycResStatInfoIPage = ycResTableInfoMapper.getPageList(new Query().getPage(map), map); + + return R.ok().put("data", ycResStatInfoIPage.getRecords()).put("count", ycResStatInfoIPage.getTotal()); + } +} diff --git a/swlscx/src/main/resources/mapper/actualSurvey/HyObqGMapper.xml b/swlscx/src/main/resources/mapper/actualSurvey/HyObqGMapper.xml new file mode 100644 index 0000000..02b1c3f --- /dev/null +++ b/swlscx/src/main/resources/mapper/actualSurvey/HyObqGMapper.xml @@ -0,0 +1,70 @@ + + + + + + + + diff --git a/swlscx/src/main/resources/mapper/actualSurvey/HyXsmsrsGMapper.xml b/swlscx/src/main/resources/mapper/actualSurvey/HyXsmsrsGMapper.xml new file mode 100644 index 0000000..4785bb7 --- /dev/null +++ b/swlscx/src/main/resources/mapper/actualSurvey/HyXsmsrsGMapper.xml @@ -0,0 +1,54 @@ + + + + + + + + + + \ No newline at end of file diff --git a/swlscx/src/main/resources/mapper/basic/HyStscAMapper.xml b/swlscx/src/main/resources/mapper/basic/HyStscAMapper.xml index 44eb228..e658f31 100644 --- a/swlscx/src/main/resources/mapper/basic/HyStscAMapper.xml +++ b/swlscx/src/main/resources/mapper/basic/HyStscAMapper.xml @@ -221,4 +221,36 @@ WITH select stcd,dt from hy_dq_c where dt >= #{startTimeDay} and dt <= #{endTimeDay} + + + + + diff --git a/swlscx/src/main/resources/mapper/synchronousData/YcResTableInfoMapper.xml b/swlscx/src/main/resources/mapper/synchronousData/YcResTableInfoMapper.xml new file mode 100644 index 0000000..53a2925 --- /dev/null +++ b/swlscx/src/main/resources/mapper/synchronousData/YcResTableInfoMapper.xml @@ -0,0 +1,84 @@ + + + + + + + + + INSERT INTO yc_res_stat_info + (stcd, s_type, res_table_id, res_type, res_table,stat_year,old_year) + VALUES + + (#{item.stcd}, #{item.sType}, #{item.resTableId}, #{item.resType}, #{item.resTable}, + #{item.statYear}, #{item.oldYear}) + + ON DUPLICATE KEY UPDATE + res_type = VALUES(res_type), + res_table = VALUES(res_table), + stat_year = VALUES(stat_year), + old_year = VALUES(old_year) + + + + + + + + + + + +