| | |
| | | package cn.gistack.job.executor.jobhandler; |
| | | |
| | | import cn.gistack.alerts.sms.feign.ISmsRecordClient; |
| | | import cn.gistack.sm.sjztmd.feign.ISjztMdClient; |
| | | import cn.gistack.sm.sjztods.feign.ISkxsQkTjClient; |
| | | import cn.gistack.sm.sjztods.feign.IXsfsQktjClient; |
| | | import cn.gistack.sm.sjztods.vo.SkxsQkTjVO; |
| | | import cn.gistack.sm.sjztods.vo.XsfsQktjVO; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.handler.annotation.XxlJob; |
| | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @PROJECT_NAME: skjcmanager |
| | |
| | | |
| | | @Autowired |
| | | private ISkxsQkTjClient skxsQkTjClient; |
| | | |
| | | @Autowired |
| | | private ISjztMdClient sjztMdClient; |
| | | |
| | | /** |
| | | * 大中型水库蓄水量日报 |
| | |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 水库降雨量预报 |
| | | */ |
| | | @XxlJob("reservoirRainfallForecastJobHandler") |
| | | public ReturnT<String> reservoirRainfallForecastJobHandler(String param) throws Exception { |
| | | XxlJobLogger.log("开始执行水库降雨量预报..."); |
| | | JSONObject jsonParam = JSON.parseObject(param); |
| | | // 获取 dayIndexList 数组 |
| | | JSONArray dayIndexArray = jsonParam.getJSONArray("dayIndexList"); |
| | | List<String> dayIndexList = new ArrayList<>(); |
| | | if (null != dayIndexArray && !dayIndexArray.isEmpty()) { |
| | | for (int i = 0; i < dayIndexArray.size(); i++) { |
| | | dayIndexList.add(dayIndexArray.getString(i)); |
| | | } |
| | | } |
| | | if (dayIndexList.isEmpty()) { |
| | | // dayIndex默认值为0 |
| | | dayIndexList.add("0"); |
| | | } |
| | | XxlJobLogger.log("dayIndex: " + dayIndexList); |
| | | sjztMdClient.getReservoirRainfallForecast(dayIndexList); |
| | | XxlJobLogger.log("结束执行水库降雨量预报任务..."); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | } |