Commit b72f92b3 authored by chenzhao's avatar chenzhao

权限修改 接口修改

parent feae5033
......@@ -22,10 +22,10 @@ public interface JpInverterMapper extends BaseMapper<JpInverter> {
List<Map<String,Object>> queryInverterCountStatus(@Param("dto") JpStationDto reviewDto);
@UserEmpower(field ={"sta.regional_companies_code"} ,fieldConditions ={"in"} ,relationship="and")
@UserEmpower(field ={"sta.regional_companies_code"} ,dealerField={"sta.amos_company_code","sta.regional_companies_code","php.developer_user_id"} ,fieldConditions ={"in","in","in"} ,relationship="and")
// @DealerRestrict(field ={"amos_company_code","regional_companies_code","developer_user_id"},fieldConditions ={"in","in","in"} ,relationship="and")
List<JpInverterDtoNew> selectPageData(@Param("dto") JpInverterDto reviewDto, int current, int size);
@UserEmpower(field ={"sta.regional_companies_code"} ,fieldConditions ={"in"} ,relationship="and")
@UserEmpower(field ={"sta.regional_companies_code"} ,dealerField={"sta.amos_company_code","sta.regional_companies_code","php.developer_user_id"} ,fieldConditions ={"in","in","in"} ,relationship="and")
int selectPageDataTotal(@Param("dto") JpInverterDto reviewDto);
}
......@@ -31,7 +31,7 @@ public interface JpStationMapper extends BaseMapper<JpStation> {
List<JpStation> getJpStationList(@Param("dto") JpStationDto reviewDto);
@UserEmpower(field ={"ORG_CODE"} ,fieldConditions ={"in"} ,relationship="and",specific=false)
@UserEmpower(field ={"ORG_CODE"} ,dealerField ={}, fieldConditions ={"in","in","in"} ,relationship="and",specific=false)
List<DropDown> getRegion();
@UserEmpower(field ={"hygf_regional_companies.regional_companies_code"} ,fieldConditions ={"in"} ,relationship="and")
......@@ -40,7 +40,7 @@ public interface JpStationMapper extends BaseMapper<JpStation> {
@UserEmpower(field ={"regional_companies_code"} ,fieldConditions ={"in"} ,relationship="and")
JpStationDto getCountJpStationdata(@Param("dto") JpStationDto reviewDto);
@UserEmpower(field ={"regional_companies_code"} ,fieldConditions ={"in"} ,relationship="and")
@UserEmpower(field ={"regional_companies_code"} ,dealerField={},fieldConditions ={"in"} ,relationship="and")
List<Map<String,Object>> getcountState(@Param("dto") JpStationDto reviewDto);
//投产电站数
@UserEmpower(field ={"regional_companies_code"} ,fieldConditions ={"in"} ,relationship="and")
......
package com.yeejoin.amos.boot.module.hygf.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower;
import com.yeejoin.amos.boot.module.hygf.api.dto.PeasantHouseholdDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.PeasantHousehold;
import org.apache.ibatis.annotations.Param;
......@@ -26,4 +29,7 @@ public interface PeasantHouseholdMapper extends BaseMapper<PeasantHousehold> {
@Param("ids")String ids
);
@UserEmpower(field={},dealerField={"developer_code","regional_companies_code","developer_user_id"} ,fieldConditions ={"in","in","in"} ,relationship="and")
Page<PeasantHouseholdDto> queryForPage(Page<PeasantHouseholdDto> page, String developerCode,String ownersName,Long developerId,Integer isCertified);
}
......@@ -16,7 +16,7 @@ import java.util.List;
* @date 2023-07-15
*/
public interface PowerStationMapper extends BaseMapper<PowerStation> {
@UserEmpower(field ={"regional_companies_code"} ,fieldConditions ={"in"} ,relationship="and")
@UserEmpower(field ={"regional_companies_code"} ,dealerField={"a.developer_code","a.regional_companies_code","a.developer_user_id"} ,fieldConditions ={"in","in","in"}, relationship="and")
List<PowerStationDto> queryPage(@Param("powerStationCode") String powerStationCode,
@Param("ownersName")String ownersName,
@Param("serviceAgent")String serviceAgent);
......
......@@ -22,7 +22,7 @@ public interface PreparationMoneyMapper extends BaseMapper<PreparationMoney> {
List<PeasantHousehold> getPeasantHouseholdData(@Param("sequenceNbr") Long sequenceNbr,@Param("ownersName") String ownersName);
@UserEmpower(field ={"regional_companies_code"} ,fieldConditions ={"in"} ,relationship="and")
@UserEmpower(field ={"regional_companies_code"} ,dealerField={"developer_code","regional_companies_code","developer_user_id"} ,fieldConditions ={"in","in","in"} ,relationship="and")
IPage<PreparationMoney> selectPage(IPage<PreparationMoney> page, @Param(Constants.WRAPPER) Wrapper<PreparationMoney> queryWrapper);
}
......@@ -98,6 +98,9 @@
from
hygf_jp_inverter hjc
left join hygf_jp_station sta on sta.third_station_id = hjc.third_station_id
LEFT JOIN
(select developer_user_id,developer_code FROM hygf_peasant_household ) php ON php.developer_code= sta.amos_company_code
<where>
<if test="dto.snCode != null and dto.snCode != ''">
AND hjc.sn_code like #{dto.snCode}
......
......@@ -51,5 +51,20 @@ and hygf_document_station.station_id is not null
</if>
</select>
<select id="queryForPage" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.PeasantHouseholdDto">
SELECT *
FROM hygf_peasant_household
WHERE IS_CERTIFIED = #{isCertified}
<if test="ownersName!=null and ownersName !=''">
and owners_name like #{ownersName}
</if>
<if test="developerId!=null and developerId !=''">
and developer_id = #{developerId}
</if>
<if test="developerCode!=null and developerCode !=''">
and developer_code = #{developerCode}
</if>
ORDER BY rec_date DESC
</select>
</mapper>
......@@ -6,7 +6,9 @@
hygf_power_station.*,
b.initiate_status,
b.contract_lock_id,
hygf_peasant_household.regional_companies_code
hygf_peasant_household.regional_companies_code,
hygf_peasant_household.developer_code,
hygf_peasant_household.developer_user_id
from hygf_power_station LEFT JOIN ( select peasant_household_id,initiate_status, contract_lock_id from hygf_household_contract where hygf_household_contract.status !='已作废'
) b on b.peasant_household_id=hygf_power_station.peasant_household_id
LEFT JOIN hygf_peasant_household on hygf_peasant_household.sequence_nbr=hygf_power_station.peasant_household_id
......
......@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.hygf.api.Enum.PeasantHouseholdEnum;
import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower;
import com.yeejoin.amos.boot.module.hygf.api.config.UserLimits;
import com.yeejoin.amos.boot.module.hygf.api.dto.PeasantHouseholdDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.SurveyInformationDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.UserUnitInformationDto;
......@@ -201,6 +203,7 @@ public class PeasantHouseholdController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "农户信息分页查询", notes = "农户信息分页查询")
@UserLimits()
public ResponseModel<Page<PeasantHouseholdDto>> queryForPage(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@RequestParam(value = "ownersName",required = false)String ownersName,
......@@ -211,13 +214,13 @@ public class PeasantHouseholdController extends BaseController {
AgencyUserModel userInfo = getUserInfo();
//获取用户所在经销商单位
UserUnitInformationDto userUnitInformationDto=personnelBusinessMapper.getUserUnitInformationDto(userInfo.getUserId());
String orgCode = userUnitInformationDto.getAmosDealerOrgCode();
// //获取用户所在经销商单位
// UserUnitInformationDto userUnitInformationDto=personnelBusinessMapper.getUserUnitInformationDto(userInfo.getUserId());
//
// String orgCode = userUnitInformationDto.getAmosDealerOrgCode();
Integer isCertified = PeasantHouseholdEnum.已认证.getCode();
return ResponseHelper.buildResponse(peasantHouseholdServiceImpl.queryForPeasantHouseholdPage(page,orgCode,ownersName,developerId,isCertified));
return ResponseHelper.buildResponse(peasantHouseholdServiceImpl.queryForPeasantHouseholdPage(page, null,ownersName,developerId,isCertified));
}
/**
......
......@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.hygf.api.Enum.CodeEnum;
import com.yeejoin.amos.boot.module.hygf.api.Enum.PhoneRegisterTypeEum;
import com.yeejoin.amos.boot.module.hygf.api.Enum.TaskTypeStationEnum;
import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower;
import com.yeejoin.amos.boot.module.hygf.api.dto.*;
import com.yeejoin.amos.boot.module.hygf.api.entity.*;
import com.yeejoin.amos.boot.module.hygf.api.mapper.PeasantHouseholdMapper;
......@@ -220,8 +221,9 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
/**
* 分页查询
*/
public Page<PeasantHouseholdDto> queryForPeasantHouseholdPage(Page<PeasantHouseholdDto> page,String developerCode,@Condition(Operator.like) String ownersName,Long developerId, @Condition(Operator.eq) Integer isCertified) {
Page<PeasantHouseholdDto> peasantHouseholdDtoPage = this.queryForPage(page, "rec_date", false,developerCode,ownersName,developerId, isCertified);
public Page<PeasantHouseholdDto> queryForPeasantHouseholdPage(Page<PeasantHouseholdDto> page,String developerCode, String ownersName,Long developerId, Integer isCertified) {
Page<PeasantHouseholdDto> peasantHouseholdDtoPage = this.getBaseMapper().queryForPage(page, developerCode,ownersName,developerId, isCertified);
List<PeasantHouseholdDto> records = peasantHouseholdDtoPage.getRecords();
List<PeasantHouseholdDto> newRecords = records.stream().map(item -> {
if(item.getSurveyOrNot() != null){
......
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.hygf.api.Enum.ArrivalStateeEnum;
import com.yeejoin.amos.boot.module.hygf.api.Enum.CodeEnum;
......
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