Commit 31068ee1 authored by 朱晨阳's avatar 朱晨阳

区域公司统计数据接口改造

parent 3c102c2b
......@@ -37,7 +37,7 @@ public interface JpStationMapper extends BaseMapper<JpStation> {
List<JpStation> getJpStationList(@Param("dto") JpStationDto reviewDto);
@UserEmpower(field ={"ORG_CODE"} ,dealerField ={"ORG_CODE"}, fieldConditions ={"in","in"} ,relationship="and",specific=false)
List<DropDown> getRegion();
List<DropDown> getRegion(String regionName);
List<DropDown> getRegionAll();
......
......@@ -246,6 +246,10 @@
FROM privilege_company
WHERE IS_DELETED = 0
and privilege_company.COMPANY_TYPE = 'region'
<if test="regionName!=null and regionName!=''">
and privilege_company.COMPANY_NAME like concat("%",#{regionName}, "%")
</if>
</select>
<select id="getRegionAll" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.DropDown">
SELECT privilege_company.ORG_CODE orgCode,
......
......@@ -408,9 +408,9 @@ public class JpStationController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "查询当前登录人权限区域公司", notes = "查询当前登录人权限区域公司")
@GetMapping(value = "/getRegion")
@UserLimits
public ResponseModel<List<Map<String, String>>> getRegion() {
public ResponseModel<List<Map<String, String>>> getRegion(String regionName) {
List<DropDown> list = jpStationMapper.getRegion();
List<DropDown> list = jpStationMapper.getRegion(regionName);
List<Map<String, String>> result = new ArrayList<>();
list.forEach(dropDown -> {
Map<String, String> item = new HashMap<>();
......@@ -832,11 +832,40 @@ public class JpStationController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "查询当前登录人权限区域公司统计数据", notes = "查询当前登录人权限区域公司统计数据")
@GetMapping(value = "/getRegionStatistics")
@UserLimits
public ResponseModel<Page<PowerStationStatistics>> getRegionStatistics(@RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "10") Integer size, @RequestParam(required = false) String regionName) {
public ResponseModel<List<Map<String, Object>>> getRegionStatistics(@RequestParam(required = false) String regionName) {
// 获取区域公司列表
List<DropDown> regionlist = jpStationMapper.getRegion(regionName);
Page<PowerStationStatistics> poserStatisticsData = jpStationServiceImpl.getRegionStatistics(current, size, regionName);
List<Map<String, Object>> result = new ArrayList<>();
return ResponseHelper.buildResponse(poserStatisticsData);
regionlist.stream().forEach(region -> {
Map<String, Object> item = new HashMap<>();
JpStationDto reviewDto = new JpStationDto();
reviewDto.setRegionalCompaniesCode(region.getOrgCode());
// 根据区域公司code获取场站个数
Map<String, Object> zs = jpStationServiceImpl.getcount(reviewDto);
// 获取统计数据
JpStationDto jpStation = jpStationMapper.getCountJpStationdata(reviewDto);
if(jpStation==null){
jpStation = new JpStationDto();
}
item.put("code", region.getOrgCode());
item.put("name", region.getName());
item.put("stationNumber", zs.get("num"));
item.put("capacity", jpStation.getCapacity());
item.put("realTimePower", jpStation.getRealTimePower());
item.put("dayIncome", jpStation.getDayIncome());
item.put("dayGenerate", jpStation.getDayGenerate());
result.add(item);
});
// Page<PowerStationStatistics> poserStatisticsData = jpStationServiceImpl.getRegionStatistics(current, size, regionName);
return ResponseHelper.buildResponse(result);
}
//查询经销商统计数据(根据区域公司orgCode)
......
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