Commit 47b18e62 authored by 朱晨阳's avatar 朱晨阳

经销商统计数据接口改造

parent 31068ee1
......@@ -42,7 +42,7 @@ public interface JpStationMapper extends BaseMapper<JpStation> {
List<DropDown> getRegionAll();
@UserEmpower(field ={"hygf_regional_companies.regional_companies_code"} ,dealerField ={"hygf_unit_info.amos_company_code","hygf_regional_companies.regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<DropDown> getDealer(@Param("regionalCompaniesCode") String regionalCompaniesCode);
List<DropDown> getDealer(@Param("regionalCompaniesCode") String regionalCompaniesCode, String dealerName);
List<DropDown> getDealerAll(@Param("regionalCompaniesCode") String regionalCompaniesCode);
......
......@@ -267,6 +267,9 @@
<if test="regionalCompaniesCode!=null">
and hygf_regional_companies.regional_companies_code =#{regionalCompaniesCode}
</if>
<if test="dealerName!=null and dealerName!=''">
and hygf_unit_info.`name` like concat("%",#{dealerName}, "%")
</if>
and hygf_unit_info.amos_company_code is not null
GROUP BY hygf_unit_info.amos_company_code,hygf_unit_info.`name`
</select>
......
......@@ -444,8 +444,8 @@ public class JpStationController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "查询当前登录人权限经销商", notes = "查询当前登录人权限经销商")
@GetMapping(value = "/getDealer")
@UserLimits
public ResponseModel<List<Map<String, String>>> getDealer(String regionalCompaniesCode) {
List<DropDown> list = jpStationMapper.getDealer(regionalCompaniesCode);
public ResponseModel<List<Map<String, String>>> getDealer(String regionalCompaniesCode, String dealerName) {
List<DropDown> list = jpStationMapper.getDealer(regionalCompaniesCode, dealerName);
List<Map<String, String>> result = new ArrayList<>();
list.forEach(dropDown -> {
Map<String, String> item = new HashMap<>();
......@@ -873,11 +873,41 @@ public class JpStationController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "查询经销商统计数据", notes = "查询经销商统计数据")
@GetMapping(value = "/getDealerStatistics")
@UserLimits
public ResponseModel<Page<PowerStationStatistics>> getDealerStatistics(@RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "10") Integer size, String regionalCompaniesCode, @RequestParam(required = false) String dealerName) {
public ResponseModel<List<Map<String, Object>>> getDealerStatistics(String regionalCompaniesCode, String dealerName) {
Page<PowerStationStatistics> poserStatisticsData = jpStationServiceImpl.getDealerStatistics(current, size, regionalCompaniesCode, dealerName);
// Page<PowerStationStatistics> poserStatisticsData = jpStationServiceImpl.getDealerStatistics(current, size, regionalCompaniesCode, dealerName);
// 根据区域公司code获取经销商
List<DropDown> dealerlist = jpStationMapper.getDealer(regionalCompaniesCode, dealerName);
return ResponseHelper.buildResponse(poserStatisticsData);
List<Map<String, Object>> result = new ArrayList<>();
dealerlist.stream().forEach(dealer -> {
Map<String, Object> item = new HashMap<>();
JpStationDto reviewDto = new JpStationDto();
reviewDto.setAmosCompanyCode(dealer.getOrgCode());
// 根据区域公司code获取场站个数
Map<String, Object> zs = jpStationServiceImpl.getcount(reviewDto);
// 获取统计数据
JpStationDto jpStation = jpStationMapper.getCountJpStationdata(reviewDto);
if(jpStation==null){
jpStation = new JpStationDto();
}
item.put("code", dealer.getOrgCode());
item.put("name", dealer.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);
});
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