Commit c35b4ebe authored by lilongyang's avatar lilongyang

1、新增获取并网容量,获取片区指标完成情况接口添加日志

parent 41516a31
...@@ -2,9 +2,12 @@ package com.yeejoin.amos.boot.module.jxiop.biz.controller; ...@@ -2,9 +2,12 @@ package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.interceptors.PermissionInterceptor;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.EnergyAccessServiceImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.EnergyAccessServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
...@@ -20,10 +23,13 @@ public class EnergyAccessController extends BaseController { ...@@ -20,10 +23,13 @@ public class EnergyAccessController extends BaseController {
@Autowired @Autowired
EnergyAccessServiceImpl energyAccessServiceImpl; EnergyAccessServiceImpl energyAccessServiceImpl;
private final Logger logger = LoggerFactory.getLogger(EnergyAccessController.class);
@RequestMapping(value = "/getInstalledCapacity", method = RequestMethod.GET) @RequestMapping(value = "/getInstalledCapacity", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "获取并网容量", notes = "获取并网容量") @ApiOperation(httpMethod = "GET", value = "获取并网容量", notes = "获取并网容量")
public Page<Map<String, Object>> getInstalledCapacity(String current, String pageSize, String code,String sourceStationId,String tp) { public Page<Map<String, Object>> getInstalledCapacity(String current, String pageSize, String code,String sourceStationId,String tp) {
logger.info("获取并网容量接口入参:current ={},pageSize ={},code = {},sourceStationId = {},tp = {}",current,pageSize,code,sourceStationId,tp);
return energyAccessServiceImpl.getInstalledCapacity(current, pageSize, code,sourceStationId,tp); return energyAccessServiceImpl.getInstalledCapacity(current, pageSize, code,sourceStationId,tp);
} }
...@@ -31,6 +37,7 @@ public class EnergyAccessController extends BaseController { ...@@ -31,6 +37,7 @@ public class EnergyAccessController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "获取片区指标完成情况", notes = "获取片区指标完成情况") @ApiOperation(httpMethod = "GET", value = "获取片区指标完成情况", notes = "获取片区指标完成情况")
public Page<Map<String, Object>> getQuotaCompleteInfo(String current, String pageSize, String code,String sourceStationId,String tp) { public Page<Map<String, Object>> getQuotaCompleteInfo(String current, String pageSize, String code,String sourceStationId,String tp) {
logger.info("获取片区指标完成情况入参:current ={},pageSize ={},code = {},sourceStationId = {},tp = {}",current,pageSize,code,sourceStationId,tp);
return energyAccessServiceImpl.getQuotaCompleteInfo(current, pageSize, code,sourceStationId,tp); return energyAccessServiceImpl.getQuotaCompleteInfo(current, pageSize, code,sourceStationId,tp);
} }
} }
......
package com.yeejoin.amos.boot.module.jxiop.biz.service.impl; package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jxiop.api.util.Constants; import com.yeejoin.amos.boot.module.jxiop.api.util.Constants;
import com.yeejoin.amos.boot.module.jxiop.api.util.HttpRequestUtil; import com.yeejoin.amos.boot.module.jxiop.api.util.HttpRequestUtil;
import com.yeejoin.amos.boot.module.jxiop.biz.service.EnergyAccessService; import com.yeejoin.amos.boot.module.jxiop.biz.service.EnergyAccessService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -23,6 +23,8 @@ public class EnergyAccessServiceImpl implements EnergyAccessService { ...@@ -23,6 +23,8 @@ public class EnergyAccessServiceImpl implements EnergyAccessService {
@Autowired @Autowired
private HttpRequestUtil httpRequestUtil; private HttpRequestUtil httpRequestUtil;
private final Logger logger = LoggerFactory.getLogger(EnergyAccessServiceImpl.class);
@Override @Override
public Page<Map<String, Object>> getInstalledCapacity(String current, String pageSize, String code, String sourceStationId, String tp) { public Page<Map<String, Object>> getInstalledCapacity(String current, String pageSize, String code, String sourceStationId, String tp) {
//改为部盾接口 //改为部盾接口
...@@ -42,6 +44,7 @@ public class EnergyAccessServiceImpl implements EnergyAccessService { ...@@ -42,6 +44,7 @@ public class EnergyAccessServiceImpl implements EnergyAccessService {
Constants.resovleRule_data); Constants.resovleRule_data);
List returnList = data.getJSONArray("data"); List returnList = data.getJSONArray("data");
logger.info("获取并网容量接口调用对端返回结果:{}",returnList.toString());
Page<Map<String, Object>> pageIPage; Page<Map<String, Object>> pageIPage;
int newCurrent = Integer.parseInt(current); int newCurrent = Integer.parseInt(current);
...@@ -63,6 +66,7 @@ public class EnergyAccessServiceImpl implements EnergyAccessService { ...@@ -63,6 +66,7 @@ public class EnergyAccessServiceImpl implements EnergyAccessService {
} else { } else {
pageIPage.setRecords(returnList.subList(((newCurrent - 1) * newPageSize), returnList.size())); pageIPage.setRecords(returnList.subList(((newCurrent - 1) * newPageSize), returnList.size()));
} }
logger.info("获取并网容量接口最终返回结果:{}",pageIPage.getRecords());
return pageIPage; return pageIPage;
} }
...@@ -89,6 +93,7 @@ public class EnergyAccessServiceImpl implements EnergyAccessService { ...@@ -89,6 +93,7 @@ public class EnergyAccessServiceImpl implements EnergyAccessService {
Constants.resovleRule_data); Constants.resovleRule_data);
List returnList = data.getJSONArray("data"); List returnList = data.getJSONArray("data");
logger.info("获取片区指标完成情况调用对端返回结果:{}",returnList.toString());
//rate的值去掉百分号,名称字段名统一用name代替 //rate的值去掉百分号,名称字段名统一用name代替
Page<Map<String, Object>> pageIPage; Page<Map<String, Object>> pageIPage;
int newCurrent = Integer.parseInt(current); int newCurrent = Integer.parseInt(current);
...@@ -125,6 +130,7 @@ public class EnergyAccessServiceImpl implements EnergyAccessService { ...@@ -125,6 +130,7 @@ public class EnergyAccessServiceImpl implements EnergyAccessService {
} else { } else {
pageIPage.setRecords(returnList.subList(((newCurrent - 1) * newPageSize), returnList.size())); pageIPage.setRecords(returnList.subList(((newCurrent - 1) * newPageSize), returnList.size()));
} }
logger.info("获取片区指标完成情况最终返回结果:{}",pageIPage.getRecords());
return pageIPage; return pageIPage;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment