Commit e92867f6 authored by 朱晨阳's avatar 朱晨阳

添加权限

parent 9688067c
......@@ -69,14 +69,13 @@ public interface JpStationMapper extends BaseMapper<JpStation> {
List<DropDown> getDealerNew(@Param("regionalCompaniesSeq") String regionalCompaniesSeq);
// @UserEmpower(field ={"ORG_CODE"} ,dealerField ={"ORG_CODE"}, fieldConditions ={"in","in"} ,relationship="and",specific=false)
@UserEmpower(field ={"ORG_CODE"} ,dealerField ={"ORG_CODE"}, fieldConditions ={"in","in"} ,relationship="and",specific=false)
List<PowerStationStatistics> getRegionPage(String regionName);
PowerStationStatistics getRegionStatistics(String code);
List<PowerStationStatistics> getDealerPage(String regionCompanyOrgCode, String dealerName);
List<PowerStationStatistics> getDealerPage(String regionalCompaniesCode, String dealerName);
}
......@@ -38,7 +38,7 @@ public interface IJpStationService {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<PowerStationStatistics> getRegionStatistics(Integer current, Integer size, String regionName);
com.baomidou.mybatisplus.extension.plugins.pagination.Page<PowerStationStatistics> getDealerStatistics(Integer current, Integer size, String regionCompanyOrgCode, String dealerName);
com.baomidou.mybatisplus.extension.plugins.pagination.Page<PowerStationStatistics> getDealerStatistics(Integer current, Integer size, String regionalCompaniesCode, String dealerName);
......
......@@ -645,19 +645,16 @@
<!-- 根据区域orgCode查询经销商-->
<select id="getDealerPage" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationStatistics">
select hui.name as name, hui.amos_company_code as code
from hygf_regional_companies hrc
RIGHT JOIN hygf_unit_info hui
ON hrc.unit_info_id = hui.sequence_nbr
<where>
hui.blacklist=0 and hui.is_delete=0
<if test="regionCompanyOrgCode != null and regionCompanyOrgCode!=''">
and hrc.regional_companies_code = #{regionCompanyOrgCode}
</if>
<if test="dealerName != null and dealerName!=''">
and hui.name like concat("%",#{dealerName},"%")
</if>
</where>
SELECT hygf_unit_info.`name` name, hygf_unit_info.amos_company_code code, hygf_regional_companies.regional_companies_code FROM hygf_regional_companies LEFT JOIN hygf_unit_info
ON hygf_unit_info.sequence_nbr=hygf_regional_companies.unit_info_id WHERE hygf_unit_info.audit_status='2'
AND hygf_unit_info.blacklist='0' AND hygf_unit_info.is_delete='0'
<if test="regionalCompaniesCode!=null and regionalCompaniesCode!=''">
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
</select>
......
......@@ -825,7 +825,7 @@ public class JpStationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "查询当前登录人权限区域公司统计数据", notes = "查询当前登录人权限区域公司统计数据")
@GetMapping(value = "/getRegionStatistics")
// @UserLimits
@UserLimits
public ResponseModel<Page<PowerStationStatistics>> getRegionStatistics(@RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "10") Integer size, @RequestParam(required = false) String regionName) {
Page<PowerStationStatistics> poserStatisticsData = jpStationServiceImpl.getRegionStatistics(current, size, regionName);
......@@ -837,10 +837,10 @@ public class JpStationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@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 regionCompanyOrgCode, @RequestParam(required = false) String dealerName) {
@UserLimits
public ResponseModel<Page<PowerStationStatistics>> getDealerStatistics(@RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "10") Integer size, String regionalCompaniesCode, @RequestParam(required = false) String dealerName) {
Page<PowerStationStatistics> poserStatisticsData = jpStationServiceImpl.getDealerStatistics(current, size, regionCompanyOrgCode, dealerName);
Page<PowerStationStatistics> poserStatisticsData = jpStationServiceImpl.getDealerStatistics(current, size, regionalCompaniesCode, dealerName);
return ResponseHelper.buildResponse(poserStatisticsData);
}
......
......@@ -940,10 +940,10 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS
}
@Override
public Page<PowerStationStatistics> getDealerStatistics(Integer current, Integer size, String regionCompanyOrgCode, String dealerName) {
public Page<PowerStationStatistics> getDealerStatistics(Integer current, Integer size, String regionalCompaniesCode, String dealerName) {
PageHelper.startPage(current, size);
// 根据区域公司orgCode查询区域公司下所有的经销商
List<PowerStationStatistics> dealerPage = jpStationMapper.getDealerPage(regionCompanyOrgCode, dealerName);
List<PowerStationStatistics> dealerPage = jpStationMapper.getDealerPage(regionalCompaniesCode, dealerName);
PageInfo<PowerStationStatistics> page = new PageInfo(dealerPage);
Page<PowerStationStatistics> pagenew = new Page<PowerStationStatistics>();
......
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