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) ; } 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> 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); 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 = "一个作物一周内的蒸腾量(BaseResponse.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); } } 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) ; } }