From 38238bbebad273dfb7ea76024addaac8c8be7635 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期四, 21 八月 2025 10:14:40 +0800
Subject: [PATCH] 大屏展示模块,增加查询并显示作物蒸腾量的内容
---
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/largeScreen/Ls4StatisticsCtrl.java | 43 +++++++++++++++++++++
pipIrr-platform/pipIrr-global/src/main/resources/mapper/Ls4StatisticsMapper.xml | 20 ++++++++++
pipIrr-platform/pipIrr-web/pipIrr-web-model/src/main/java/com/dy/pipIrrModel/modelCalculate/Hargreaves.java | 6 +-
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/largeScreen/Ls4StatisticsSv.java | 21 ++++++++++
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoLargeScreen/Ls4StatisticsMapper.java | 17 ++++++++
5 files changed, 104 insertions(+), 3 deletions(-)
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoLargeScreen/Ls4StatisticsMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoLargeScreen/Ls4StatisticsMapper.java
index 450fd42..764a699 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoLargeScreen/Ls4StatisticsMapper.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoLargeScreen/Ls4StatisticsMapper.java
@@ -1,6 +1,8 @@
package com.dy.pipIrrGlobal.daoLargeScreen;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.dy.pipIrrGlobal.pojoMd.MdEt0;
+import com.dy.pipIrrGlobal.voMd.VoCrops;
import com.dy.pipIrrGlobal.voSpecial.VoTopXClient;
import com.dy.pipIrrGlobal.voSpecial.VoTopXIntake;
import org.apache.ibatis.annotations.Mapper;
@@ -143,4 +145,19 @@
List<VoTopXIntake> topXIntakeAtCertainDay(@Param("idStart") Long idStart, @Param("idEnd") Long idEnd, @Param("count") int count) ;
+ /**
+ * 鎵�鏈変綔鐗�
+ * @return 瀹炰綋闆嗗悎
+ */
+ List<VoCrops> allCropts() ;
+
+
+ /**
+ * 鎵�鏈変綔鐗�
+ * @return 瀹炰綋闆嗗悎
+ */
+ List<MdEt0> et0InWeek(@Param("cropId") Long cropId, @Param("startDate")String startDate, @Param("endDate")String endDate) ;
+
+
+
}
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/Ls4StatisticsMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/Ls4StatisticsMapper.xml
index f3678df..8aa9b5d 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/Ls4StatisticsMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/Ls4StatisticsMapper.xml
@@ -321,4 +321,24 @@
</trim>
</select>
+ <select id="allCropts" resultType="com.dy.pipIrrGlobal.voMd.VoCrops">
+ select mTb.id as id, mTb.name as name
+ from md_crops mTb
+ where mTb.deleted != 1
+ order by mTb.id DESC
+ </select>
+
+ <select id="et0InWeek" resultType="com.dy.pipIrrGlobal.pojoMd.MdEt0">
+ select mTb.id as id, mTb.dt as dt, mTb.et0 as et0
+ from md_et0 mTb
+ <where>
+ <if test="cropId != null">
+ AND mTb.crop_id = #{cropId}
+ </if>
+ <if test = "startDate != null and startDate !='' and endDate != null and endDate != ''">
+ AND mTb.dt BETWEEN #{startDate} AND #{endDate}
+ </if>
+ </where>
+ order by mTb.id ASC
+ </select>
</mapper>
\ No newline at end of file
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-model/src/main/java/com/dy/pipIrrModel/modelCalculate/Hargreaves.java b/pipIrr-platform/pipIrr-web/pipIrr-web-model/src/main/java/com/dy/pipIrrModel/modelCalculate/Hargreaves.java
index 08defd7..f5b31a8 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-model/src/main/java/com/dy/pipIrrModel/modelCalculate/Hargreaves.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-model/src/main/java/com/dy/pipIrrModel/modelCalculate/Hargreaves.java
@@ -121,11 +121,11 @@
}
public static void main(String[] args) {
- Double lat = 38.561976140977116 ;
- Integer dayIndex = 180 ;
+ Double lat = 38.561976140977116 ;//绾害
+ Integer dayIndex = 180 ;//骞村唴鏃ュ簭鏁帮紙姣斿1鏈�1鏃ヤ负1锛�12鏈�31鏃ヤ负365鎴�366锛�
Double kc = 0.41 ;//浣滅墿绯绘暟
Double maxT = 40.1 ;//涓�鏃ュ唴鏈�楂樻俯搴�
- Double minT = 40.1 ;//涓�鏃ュ唴鏈�浣庢俯搴�
+ Double minT = 28.1 ;//涓�鏃ュ唴鏈�浣庢俯搴�
Double fai = rad(lat);
System.out.println(fai);
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/largeScreen/Ls4StatisticsCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/largeScreen/Ls4StatisticsCtrl.java
index 7d6c964..03dd99c 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/largeScreen/Ls4StatisticsCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/largeScreen/Ls4StatisticsCtrl.java
@@ -5,9 +5,11 @@
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.common.webUtil.ResultCodeMsg;
+import com.dy.pipIrrGlobal.pojoMd.MdEt0;
import com.dy.pipIrrGlobal.voLargeScreen.VoBaseInfo;
import com.dy.pipIrrGlobal.voLargeScreen.VoCurrentInfo;
import com.dy.pipIrrGlobal.voLargeScreen.VoMonitorInfo;
+import com.dy.pipIrrGlobal.voMd.VoCrops;
import com.dy.pipIrrGlobal.voSpecial.VoTopXClient;
import com.dy.pipIrrGlobal.voSpecial.VoTopXIntake;
import io.swagger.v3.oas.annotations.Operation;
@@ -175,4 +177,45 @@
}
+ /**
+ * 寰楀埌鎵�鏈変綔鐗�
+ * @return 鏁版嵁闆嗗悎
+ */
+ @Operation(summary = "寰楀埌鎵�鏈変綔鐗�", description = "寰楀埌鎵�鏈変綔鐗�")
+ @ApiResponses(value = {
+ @ApiResponse(
+ responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
+ description = "寰楀埌鎵�鏈変綔鐗╋紙BaseResponse.content:[VoTopXIntake{}]锛�",
+ content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
+ schema = @Schema(implementation = VoCrops.class))}
+ )
+ })
+ @GetMapping(path = "allCropts")
+ @SsoAop()
+ public BaseResponse<List<VoCrops>> allCropts(){
+ List<VoCrops> res = this.sv.allCropts();
+ return BaseResponseUtils.buildSuccess(res);
+ }
+
+
+ /**
+ * 寰楀埌涓�涓綔鐗╀竴鍛ㄥ唴鐨勮捀鑵鹃噺
+ * @return 鏁版嵁闆嗗悎
+ */
+ @Operation(summary = "涓�涓綔鐗╀竴鍛ㄥ唴鐨勮捀鑵鹃噺", description = "涓�涓綔鐗╀竴鍛ㄥ唴鐨勮捀鑵鹃噺")
+ @ApiResponses(value = {
+ @ApiResponse(
+ responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
+ description = "涓�涓綔鐗╀竴鍛ㄥ唴鐨勮捀鑵鹃噺锛圔aseResponse.content:[VoTopXIntake{}]锛�",
+ content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
+ schema = @Schema(implementation = MdEt0.class))}
+ )
+ })
+ @GetMapping(path = "et0InWeek")
+ @SsoAop()
+ public BaseResponse<List<MdEt0>> et0InWeek(Long cropId){
+ List<MdEt0> res = this.sv.et0InWeek(cropId);
+ return BaseResponseUtils.buildSuccess(res);
+ }
+
}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/largeScreen/Ls4StatisticsSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/largeScreen/Ls4StatisticsSv.java
index e1a279a..857cb42 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/largeScreen/Ls4StatisticsSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/largeScreen/Ls4StatisticsSv.java
@@ -8,14 +8,17 @@
import com.dy.common.util.IDLongGenerator;
import com.dy.common.webUtil.BaseResponse;
import com.dy.pipIrrGlobal.daoLargeScreen.Ls4StatisticsMapper;
+import com.dy.pipIrrGlobal.pojoMd.MdEt0;
import com.dy.pipIrrGlobal.rtuMw.CodeLocal;
import com.dy.pipIrrGlobal.rtuMw.Web2RtuMw;
import com.dy.pipIrrGlobal.voLargeScreen.VoBaseInfo;
import com.dy.pipIrrGlobal.voLargeScreen.VoCurrentInfo;
import com.dy.pipIrrGlobal.voLargeScreen.VoMonitorInfo;
+import com.dy.pipIrrGlobal.voMd.VoCrops;
import com.dy.pipIrrGlobal.voSpecial.VoTopXClient;
import com.dy.pipIrrGlobal.voSpecial.VoTopXIntake;
import lombok.extern.slf4j.Slf4j;
+import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;
@@ -170,4 +173,22 @@
return this.dao.topXIntakeAtCertainDay(idStart, idEnd, 5) ;
}
+
+ /**
+ * 鎵�鏈変綔鐗�
+ * @return 瀹炰綋闆嗗悎
+ */
+ public List<VoCrops> allCropts(){
+ return this.dao.allCropts() ;
+ }
+ /**
+ * 鎵�鏈変綔鐗�
+ * @return 瀹炰綋闆嗗悎
+ */
+ public List<MdEt0> et0InWeek(Long cropId){
+ String startDate = DateTime.lastXDay_yyyy_MM_dd(1) ;//鏄ㄥぉ
+ String endDate = DateTime.lastXDay_yyyy_MM_dd(8) ;//8澶╁墠
+ return this.dao.et0InWeek(cropId, startDate, endDate) ;
+ }
+
}
--
Gitblit v1.8.0