| | |
| | | import com.alibaba.fastjson.parser.Feature; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.tool.utils.ObjectUtil; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Service |
| | | @AllArgsConstructor |
| | | @DS("zt") |
| | | @Slf4j |
| | | public class SjztmdServiceImpl implements ISjztmdService { |
| | | |
| | | //总计 |
| | | private final String RIBAO_SHEET1_TOTAL_URL = "/services/1234567890ABCDEFGHIJKLMN/ribao_sheet1/api?small_start_stag=0&small_end_stag=2&mid_start_stag=0&mid_end_stag=2&big_start_stag=0&big_end_stag=2"; |
| | | // private final String RIBAO_SHEET1_TOTAL_URL = "/services/1234567890ABCDEFGHIJKLMN/ribao_sheet1/api?small_start_stag=0&small_end_stag=2&mid_start_stag=0&mid_end_stag=2&big_start_stag=0&big_end_stag=2"; |
| | | private final String RIBAO_SHEET1_TOTAL_URL = "/services/1234567890ABCDEFGHIJKLMN/ribao_sheet1/api?small_start_stag=0&mid_start_stag=0&big_start_stag=0"; |
| | | private final String RIBAO_SHEET1_OVER_NORM_POOL_STAG = "/services/1234567890ABCDEFGHIJKLMN/ribao/sheet1_over_norm_pool_stag/api?"; |
| | | //中大型水库 |
| | | private final String RIBAO_SHEET2_ZDX_URL = "/services/1234567890ABCDEFGHIJKLMN/ribao/sheet2_zdx/api?mid_start_stag=0&mid_end_stag=2&big_start_stag=0&big_end_stag=2"; |
| | | // private final String RIBAO_SHEET2_ZDX_URL = "/services/1234567890ABCDEFGHIJKLMN/ribao/sheet2_zdx/api?mid_start_stag=0&mid_end_stag=2&big_start_stag=0&big_end_stag=2"; |
| | | private final String RIBAO_SHEET2_ZDX_URL = "/services/1234567890ABCDEFGHIJKLMN/ribao/sheet2_zdx/api?mid_start_stag=0&big_start_stag=0"; |
| | | //超汛明细 |
| | | private final String RIBAO_SHEET3_OVER_STAG_LIST_URL = "/services/1234567890ABCDEFGHIJKLMN/ribao/sheet3_over_stag_list/api?small_start_stag=0&small_end_stag=2&mid_start_stag=0&mid_end_stag=2&big_start_stag=0&big_end_stag=2"; |
| | | // private final String RIBAO_SHEET3_OVER_STAG_LIST_URL = "/services/1234567890ABCDEFGHIJKLMN/ribao/sheet3_over_stag_list/api?small_start_stag=0&small_end_stag=2&mid_start_stag=0&mid_end_stag=2&big_start_stag=0&big_end_stag=2"; |
| | | private final String RIBAO_SHEET3_OVER_STAG_LIST_URL = "/services/1234567890ABCDEFGHIJKLMN/ribao/sheet3_over_stag_list/api?small_start_stag=0&mid_start_stag=0&big_start_stag=0"; |
| | | //省直管 |
| | | private final String SZ_INFO = "/services/1234567890ABCDEFGHIJKLMN/ribao/shengzh_new_rz/api"; |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<TotalInfo> getTotalOverInfo(String isShow, HashMap<String, String> map) { |
| | | |
| | | String params = "&is_show=" + isShow; |
| | | if (map != null){ |
| | | for (Map.Entry<String, String> entry : map.entrySet()){ |
| | | String key=entry.getKey(); |
| | | String vlaue = entry.getValue(); |
| | | |
| | | String p = StringUtil.format("&{}={}",key,vlaue); |
| | | params +=p; |
| | | } |
| | | } |
| | | |
| | | JSONObject ztData = this.getZtData(params, RIBAO_SHEET1_OVER_NORM_POOL_STAG); |
| | | JSONArray data = ztData.getJSONArray("data"); |
| | | List<TotalInfo> list = data.toJavaList(TotalInfo.class); |
| | | return list; |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<DzkInfo> getDzkInfo(String isShow) { |
| | | JSONObject ztData = this.getZtData("&is_show="+isShow, RIBAO_SHEET2_ZDX_URL); |
| | | JSONArray data = ztData.getJSONArray("data"); |
| | |
| | | if (activeProfile.equals("test")) { |
| | | url = ZtApiUrlConstant.url_prefix_test + url + params; |
| | | } |
| | | |
| | | log.info("请求url地址:{}", url); |
| | | //设置请求头 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.add(ZtConfigConstant.header_key, ZtConfigConstant.header_value); |