Commit 510d09db authored by tangwei's avatar tangwei

修改bug

parent d68bbb88
package com.yeejoin.amos.boot.module.hygf.api.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @description:
* @author: tw
* @createDate: 2023/9/7
*/
@Data
public class UserUnitInformationDto {
@ApiModelProperty(value = "所属区域公司id")
private Long regionalCompaniesSeq;
@ApiModelProperty(value = "所属区域公司名称")
private String regionalCompaniesName;
@ApiModelProperty(value = "所属区域公司code")
private String regionalCompaniesCode;
@ApiModelProperty(value = "所属单位id")
private Long amosUnitId;
@ApiModelProperty(value = "所属单位名称")
private String amosUnitName;
@ApiModelProperty(value = "所属单位orgcode")
private String amosUnitOrgCode;
@ApiModelProperty(value = "平台经销商单位id")
private Long amosDealerId;
@ApiModelProperty(value = "平台经销商单位名称")
private String amosDealerName;
@ApiModelProperty(value = "平台经销商单位orgcode")
private String amosDealerOrgCode;
}
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.hygf.api.mapper; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.hygf.api.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.module.hygf.api.dto.CompanyDto; import com.yeejoin.amos.boot.module.hygf.api.dto.CompanyDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.CompanyDtoUserDto; import com.yeejoin.amos.boot.module.hygf.api.dto.CompanyDtoUserDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.UserUnitInformationDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.PersonnelBusiness; import com.yeejoin.amos.boot.module.hygf.api.entity.PersonnelBusiness;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -19,4 +20,10 @@ public interface PersonnelBusinessMapper extends BaseMapper<PersonnelBusiness> { ...@@ -19,4 +20,10 @@ public interface PersonnelBusinessMapper extends BaseMapper<PersonnelBusiness> {
IPage<CompanyDtoUserDto> getCompanyDtoUserDtopage(@Param("dto") CompanyDtoUserDto dto); IPage<CompanyDtoUserDto> getCompanyDtoUserDtopage(@Param("dto") CompanyDtoUserDto dto);
Map<String,String> getorgcode(@Param("id")Long id); Map<String,String> getorgcode(@Param("id")Long id);
//根据平台userid 获取人员所属经销商
UserUnitInformationDto getUserUnitInformationDto(@Param("userId")String userId);
} }
...@@ -54,5 +54,30 @@ select ORG_CODE orgCode from privilege_company where privilege_company.SEQUEN ...@@ -54,5 +54,30 @@ select ORG_CODE orgCode from privilege_company where privilege_company.SEQUEN
</select> </select>
<select id="getCompanyDtoUserDtopage" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.UserUnitInformationDto">
SELECT
hygf_personnel_business.regional_companies_seq regionalCompaniesSeq ,
hygf_personnel_business.regional_companies_code regionalCompaniesName ,
hygf_personnel_business.regional_companies_name regionalCompaniesCode ,
hygf_personnel_business.amos_unit_id amosUnitId ,
hygf_personnel_business.amos_unit_name amosUnitName ,
hygf_personnel_business.amos_unit_org_code amosUnitOrgCode ,
hygf_personnel_business.amos_dealer_id amosDealerId ,
privilege_company.COMPANY_NAME amosDealerName ,
privilege_company.ORG_CODE amosDealerOrgCode
FROM std_user_biz LEFT JOIN hygf_personnel_business
ON std_user_biz.sequence_nbr=hygf_personnel_business.foundation_id
LEFT JOIN privilege_company on privilege_company.SEQUENCE_NBR=hygf_personnel_business.amos_dealer_id
WHERE std_user_biz.amos_user_id==#{id}
</select>
</mapper> </mapper>
...@@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSONArray; ...@@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSONArray;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; 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.Enum.PeasantHouseholdEnum;
import com.yeejoin.amos.boot.module.hygf.api.dto.SurveyInformationDto; import com.yeejoin.amos.boot.module.hygf.api.dto.SurveyInformationDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.UserUnitInformationDto;
import com.yeejoin.amos.boot.module.hygf.api.mapper.PersonnelBusinessMapper;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.SurveyInformationServiceImpl; import com.yeejoin.amos.boot.module.hygf.biz.service.impl.SurveyInformationServiceImpl;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
...@@ -54,7 +56,8 @@ public class PeasantHouseholdController extends BaseController { ...@@ -54,7 +56,8 @@ public class PeasantHouseholdController extends BaseController {
RedisUtils redisUtils; RedisUtils redisUtils;
private static final String regionRedis="app_region_redis"; private static final String regionRedis="app_region_redis";
@Autowired
PersonnelBusinessMapper personnelBusinessMapper;
/** /**
* 新增农户信息 * 新增农户信息
* *
...@@ -208,7 +211,13 @@ public class PeasantHouseholdController extends BaseController { ...@@ -208,7 +211,13 @@ public class PeasantHouseholdController extends BaseController {
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
AgencyUserModel userInfo = getUserInfo(); AgencyUserModel userInfo = getUserInfo();
String orgCode = userInfo.getCompanys().get(0).getOrgCode();
//获取用户所在经销商单位
UserUnitInformationDto userUnitInformationDto=personnelBusinessMapper.getUserUnitInformationDto(userInfo.getUserId());
String orgCode = userUnitInformationDto.getAmosDealerOrgCode();
Integer isCertified = PeasantHouseholdEnum.已认证.getCode(); Integer isCertified = PeasantHouseholdEnum.已认证.getCode();
return ResponseHelper.buildResponse(peasantHouseholdServiceImpl.queryForPeasantHouseholdPage(page,orgCode,ownersName,developerId,isCertified)); return ResponseHelper.buildResponse(peasantHouseholdServiceImpl.queryForPeasantHouseholdPage(page,orgCode,ownersName,developerId,isCertified));
} }
......
...@@ -442,8 +442,11 @@ public class UnitInfoController extends BaseController { ...@@ -442,8 +442,11 @@ public class UnitInfoController extends BaseController {
@GetMapping(value = "/getUnitDataDto") @GetMapping(value = "/getUnitDataDto")
@ApiOperation(httpMethod = "GET", value = "获取组织机构树", notes = "获取组织机构树") @ApiOperation(httpMethod = "GET", value = "获取组织机构树", notes = "获取组织机构树")
public ResponseModel<UnitDataDto> getUnitDataDto() { public ResponseModel<UnitDataDto> getUnitDataDto() {
CompanyModel companyM = getUserInfo().getCompanys().get(0);
UnitDataDto unitDataDto = unitInfoServiceImpl.getUnitDataDto(companyM.getSequenceNbr()); //获取用户所在经销商单位
UserUnitInformationDto userUnitInformationDto=personnelBusinessMapper.getUserUnitInformationDto( getUserInfo().getUserId());
UnitDataDto unitDataDto = unitInfoServiceImpl.getUnitDataDto(userUnitInformationDto.getAmosDealerId());
return ResponseHelper.buildResponse(unitDataDto); return ResponseHelper.buildResponse(unitDataDto);
} }
...@@ -459,12 +462,21 @@ public class UnitInfoController extends BaseController { ...@@ -459,12 +462,21 @@ public class UnitInfoController extends BaseController {
@GetMapping(value = "/getUnit/tree") @GetMapping(value = "/getUnit/tree")
@ApiOperation(httpMethod = "GET", value = "管辖机构树", notes = "管辖机构树") @ApiOperation(httpMethod = "GET", value = "管辖机构树", notes = "管辖机构树")
public ResponseModel<List<CompanyModel>> unitTree() { public ResponseModel<List<CompanyModel>> unitTree() {
CompanyModel companyM = getUserInfo().getCompanys().get(0);
//获取用户所在经销商单位
UserUnitInformationDto userUnitInformationDto=personnelBusinessMapper.getUserUnitInformationDto( getUserInfo().getUserId());
CompanyModel companyM= new CompanyModel();
companyM.setCompanyName(userUnitInformationDto.getAmosDealerName());
companyM.setSequenceNbr(userUnitInformationDto.getAmosDealerId());
companyM.setOrgCode(userUnitInformationDto.getAmosDealerOrgCode());
FeignClientResult<Collection<CompanyModel>> feignClientResult; FeignClientResult<Collection<CompanyModel>> feignClientResult;
Collection<CompanyModel> children=null; Collection<CompanyModel> children=null;
try { try {
feignClientResult = Privilege.companyClient.querySubAgencyTree(companyM.getSequenceNbr()); feignClientResult = Privilege.companyClient.querySubAgencyTree(userUnitInformationDto.getAmosDealerId());
children = feignClientResult.getResult(); children = feignClientResult.getResult();
} catch (InnerInvokException e) { } catch (InnerInvokException e) {
...@@ -502,12 +514,14 @@ public class UnitInfoController extends BaseController { ...@@ -502,12 +514,14 @@ public class UnitInfoController extends BaseController {
@GetMapping(value = "/getUnitTree") @GetMapping(value = "/getUnitTree")
@ApiOperation(httpMethod = "GET", value = "管辖机构树", notes = "管辖机构树") @ApiOperation(httpMethod = "GET", value = "管辖机构树", notes = "管辖机构树")
public ResponseModel<Collection<CompanyModel>> getUnitTree() { public ResponseModel<Collection<CompanyModel>> getUnitTree() {
CompanyModel companyM = getUserInfo().getCompanys().get(0);
//获取用户所在经销商单位
UserUnitInformationDto userUnitInformationDto=personnelBusinessMapper.getUserUnitInformationDto( getUserInfo().getUserId());
FeignClientResult<Collection<CompanyModel>> feignClientResult; FeignClientResult<Collection<CompanyModel>> feignClientResult;
Collection<CompanyModel> children=null; Collection<CompanyModel> children=null;
try { try {
feignClientResult = Privilege.companyClient.querySubAgencyTree(companyM.getSequenceNbr()); feignClientResult = Privilege.companyClient.querySubAgencyTree(userUnitInformationDto.getAmosDealerId());
children = feignClientResult.getResult(); children = feignClientResult.getResult();
} catch (InnerInvokException e) { } catch (InnerInvokException e) {
......
...@@ -6,9 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -6,9 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; 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.Enum.PeasantHouseholdEnum;
import com.yeejoin.amos.boot.module.hygf.api.Enum.PhoneRegisterTypeEum; import com.yeejoin.amos.boot.module.hygf.api.Enum.PhoneRegisterTypeEum;
import com.yeejoin.amos.boot.module.hygf.api.dto.MobileLoginParamDto; import com.yeejoin.amos.boot.module.hygf.api.dto.*;
import com.yeejoin.amos.boot.module.hygf.api.dto.PeasantHouseholdWxDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.SurveyInformationDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.Commercial; import com.yeejoin.amos.boot.module.hygf.api.entity.Commercial;
import com.yeejoin.amos.boot.module.hygf.api.entity.ExtendedInformation; import com.yeejoin.amos.boot.module.hygf.api.entity.ExtendedInformation;
import com.yeejoin.amos.boot.module.hygf.api.entity.HouseholdContract; import com.yeejoin.amos.boot.module.hygf.api.entity.HouseholdContract;
...@@ -17,8 +15,8 @@ import com.yeejoin.amos.boot.module.hygf.api.entity.PeasantHousehold; ...@@ -17,8 +15,8 @@ import com.yeejoin.amos.boot.module.hygf.api.entity.PeasantHousehold;
import com.yeejoin.amos.boot.module.hygf.api.entity.SurveyDetails; import com.yeejoin.amos.boot.module.hygf.api.entity.SurveyDetails;
import com.yeejoin.amos.boot.module.hygf.api.entity.UnitInfo; import com.yeejoin.amos.boot.module.hygf.api.entity.UnitInfo;
import com.yeejoin.amos.boot.module.hygf.api.mapper.PeasantHouseholdMapper; import com.yeejoin.amos.boot.module.hygf.api.mapper.PeasantHouseholdMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.PersonnelBusinessMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IPeasantHouseholdService; import com.yeejoin.amos.boot.module.hygf.api.service.IPeasantHouseholdService;
import com.yeejoin.amos.boot.module.hygf.api.dto.PeasantHouseholdDto;
import com.yeejoin.amos.boot.module.hygf.api.service.IUnitInfoService; import com.yeejoin.amos.boot.module.hygf.api.service.IUnitInfoService;
import com.yeejoin.amos.boot.module.hygf.api.service.IWxService; import com.yeejoin.amos.boot.module.hygf.api.service.IWxService;
import com.yeejoin.amos.boot.module.jxiop.api.util.HttpUtil; import com.yeejoin.amos.boot.module.jxiop.api.util.HttpUtil;
...@@ -144,7 +142,8 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto ...@@ -144,7 +142,8 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
@Autowired @Autowired
HouseholdContractServiceImpl householdContractServiceImpl; HouseholdContractServiceImpl householdContractServiceImpl;
@Autowired
PersonnelBusinessMapper personnelBusinessMapper;
@Autowired @Autowired
UnitInfoServiceImpl unitInfoServiceImpl; UnitInfoServiceImpl unitInfoServiceImpl;
@Autowired @Autowired
...@@ -483,16 +482,26 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto ...@@ -483,16 +482,26 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
* @throws * @throws
*/ */
public PeasantHouseholdDto buildDefaultPeasantHouseholdDto(String qrCodeType, AgencyUserModel userInfo) { public PeasantHouseholdDto buildDefaultPeasantHouseholdDto(String qrCodeType, AgencyUserModel userInfo) {
if (null == userInfo || CollectionUtils.isEmpty(userInfo.getCompanys())) {
if (null == userInfo) {
log.warn("userId:{} 查询不到经销商信息 或者 查询不到经销商单位信息"); log.warn("userId:{} 查询不到经销商信息 或者 查询不到经销商单位信息");
return null; return null;
} }
log.info("通过区域/个人二维码扫描组装信息, user => {}, user's companys => {}", userInfo.getUserId(), JSONObject.toJSONString(userInfo.getCompanys())); log.info("通过区域/个人二维码扫描组装信息, user => {}, user's companys => {}", userInfo.getUserId(), JSONObject.toJSONString(userInfo.getCompanys()));
Long sequenceNbr = userInfo.getCompanys().get(0).getSequenceNbr();
String companyOrgCode = userInfo.getCompanys().get(0).getOrgCode(); //获取用户所在经销商单位
String companyName = userInfo.getCompanys().get(0).getCompanyName(); UserUnitInformationDto userUnitInformationDto=personnelBusinessMapper.getUserUnitInformationDto(userInfo.getUserId());
// Long sequenceNbr = userInfo.getCompanys().get(0).getSequenceNbr();
// String companyOrgCode = userInfo.getCompanys().get(0).getOrgCode();
// String companyName = userInfo.getCompanys().get(0).getCompanyName();
Long sequenceNbr = userUnitInformationDto.getAmosDealerId();
String companyOrgCode = userUnitInformationDto.getAmosDealerOrgCode();
String companyName = userUnitInformationDto.getAmosDealerName();
// unitInfoServiceImpl.createCompanyAndUser 创建经销商的时候绑定的平台用户 // unitInfoServiceImpl.createCompanyAndUser 创建经销商的时候绑定的平台用户
List<UnitInfo> unitInfos = unitInfoServiceImpl.list(new LambdaQueryWrapper<UnitInfo>().eq(UnitInfo::getAmosCompanySeq, sequenceNbr)); // List<UnitInfo> unitInfos = unitInfoServiceImpl.list(new LambdaQueryWrapper<UnitInfo>().eq(UnitInfo::getAmosCompanySeq, sequenceNbr));
PeasantHouseholdDto dto = new PeasantHouseholdDto(); PeasantHouseholdDto dto = new PeasantHouseholdDto();
// 先在后台创建一个角色和公司,微信农户新建的用户使用统一的 // 先在后台创建一个角色和公司,微信农户新建的用户使用统一的
// 用户光伏-微信农户 // 用户光伏-微信农户
...@@ -501,17 +510,22 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto ...@@ -501,17 +510,22 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
dto.setDeveloperId(sequenceNbr);// 开发方id dto.setDeveloperId(sequenceNbr);// 开发方id
dto.setDeveloperName(companyName);// 开发方名称 dto.setDeveloperName(companyName);// 开发方名称
dto.setDeveloper(userInfo.getRealName());// 开发人 dto.setDeveloper(userInfo.getRealName());// 开发人
UnitInfo unitInfo; // UnitInfo unitInfo;
if (!CollectionUtils.isEmpty(unitInfos)) { // if (!CollectionUtils.isEmpty(unitInfos)) {
log.warn("userId:{} 查询不到经销商信息", userInfo.getUserId()); // log.warn("userId:{} 查询不到经销商信息", userInfo.getUserId());
unitInfo = unitInfos.get(0); // unitInfo = unitInfos.get(0);
// Long regionalCompaniesSeq = unitInfo.getRegionalCompaniesSeq(); // // Long regionalCompaniesSeq = unitInfo.getRegionalCompaniesSeq();
String regionalCompaniesCode = unitInfo.getRegionalCompaniesCode(); // String regionalCompaniesCode = unitInfo.getRegionalCompaniesCode();
String regionalCompaniesName = unitInfo.getRegionalCompaniesName(); // String regionalCompaniesName = unitInfo.getRegionalCompaniesName();
dto.setRegionalCompaniesSeq(null);//所属区域公司id // dto.setRegionalCompaniesSeq(null);//所属区域公司id
dto.setRegionalCompaniesCode(regionalCompaniesCode);//所属区域公司code // dto.setRegionalCompaniesCode(regionalCompaniesCode);//所属区域公司code
dto.setRegionalCompaniesName(regionalCompaniesName);//所属区域公司名称 // dto.setRegionalCompaniesName(regionalCompaniesName);//所属区域公司名称
} // }
dto.setRegionalCompaniesSeq(userUnitInformationDto.getRegionalCompaniesSeq());//所属区域公司id
dto.setRegionalCompaniesCode(userUnitInformationDto.getRegionalCompaniesCode());//所属区域公司code
dto.setRegionalCompaniesName(userUnitInformationDto.getRegionalCompaniesName());//所属区域公司名称
return dto; return dto;
} }
......
...@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.module.hygf.api.Enum.HouseholdContractEnum; ...@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.module.hygf.api.Enum.HouseholdContractEnum;
import com.yeejoin.amos.boot.module.hygf.api.Enum.PowerStationNodeEnum; import com.yeejoin.amos.boot.module.hygf.api.Enum.PowerStationNodeEnum;
import com.yeejoin.amos.boot.module.hygf.api.Enum.PowerStationProcessStateEnum; import com.yeejoin.amos.boot.module.hygf.api.Enum.PowerStationProcessStateEnum;
import com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationDto; import com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.UserUnitInformationDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.WorkDto; import com.yeejoin.amos.boot.module.hygf.api.dto.WorkDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.DesignInformation; import com.yeejoin.amos.boot.module.hygf.api.entity.DesignInformation;
import com.yeejoin.amos.boot.module.hygf.api.entity.HouseholdContract; import com.yeejoin.amos.boot.module.hygf.api.entity.HouseholdContract;
...@@ -16,6 +17,7 @@ import com.yeejoin.amos.boot.module.hygf.api.entity.PowerStation; ...@@ -16,6 +17,7 @@ import com.yeejoin.amos.boot.module.hygf.api.entity.PowerStation;
import com.yeejoin.amos.boot.module.hygf.api.fegin.IdxFeginService; import com.yeejoin.amos.boot.module.hygf.api.fegin.IdxFeginService;
import com.yeejoin.amos.boot.module.hygf.api.mapper.DesignInformationMapper; import com.yeejoin.amos.boot.module.hygf.api.mapper.DesignInformationMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.HouseholdContractMapper; import com.yeejoin.amos.boot.module.hygf.api.mapper.HouseholdContractMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.PersonnelBusinessMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.PowerStationMapper; import com.yeejoin.amos.boot.module.hygf.api.mapper.PowerStationMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IPowerStationService; import com.yeejoin.amos.boot.module.hygf.api.service.IPowerStationService;
import com.yeejoin.amos.boot.module.hygf.biz.feign.WorkflowFeignClient; import com.yeejoin.amos.boot.module.hygf.biz.feign.WorkflowFeignClient;
...@@ -71,23 +73,32 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS ...@@ -71,23 +73,32 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
WorkflowFeignClient workflowFeignClient; WorkflowFeignClient workflowFeignClient;
@Autowired @Autowired
HouseholdContractServiceImpl householdContractServiceImpl; HouseholdContractServiceImpl householdContractServiceImpl;
@Autowired
PersonnelBusinessMapper personnelBusinessMapper;
public Page<PowerStationDto> queryForPowerStationUserRoles(Page<PowerStationDto> page, String powerStationCode, String ownersName, AgencyUserModel userInfo){ public Page<PowerStationDto> queryForPowerStationUserRoles(Page<PowerStationDto> page, String powerStationCode, String ownersName, AgencyUserModel userInfo){
String serviceAgent = ""; String serviceAgent =null;
Map<Long, List<RoleModel>> orgRoles = userInfo.getOrgRoles(); // Map<Long, List<RoleModel>> orgRoles = userInfo.getOrgRoles();
Collection<List<RoleModel>> roleModels = orgRoles.values(); // Collection<List<RoleModel>> roleModels = orgRoles.values();
if(roleModels !=null){ // if(roleModels !=null){
List<String> roleTypes = new ArrayList<>(); // List<String> roleTypes = new ArrayList<>();
Iterator<List<RoleModel>> iterator = roleModels.iterator(); // Iterator<List<RoleModel>> iterator = roleModels.iterator();
while (iterator.hasNext()){ // while (iterator.hasNext()){
List<RoleModel> next = iterator.next(); // List<RoleModel> next = iterator.next();
roleTypes.addAll(next.stream().map(RoleModel::getRoleType).collect(Collectors.toList())); // roleTypes.addAll(next.stream().map(RoleModel::getRoleType).collect(Collectors.toList()));
} // }
if(roleTypes.size()>0){ // if(roleTypes.size()>0){
serviceAgent = !roleTypes.contains("HYGFGLY") ? roleTypes.contains("HYGFJXS") ? userInfo.getCompanys().get(0).getCompanyName() : null : null ; // serviceAgent = !roleTypes.contains("HYGFGLY") ? roleTypes.contains("HYGFJXS") ? userInfo.getCompanys().get(0).getCompanyName() : null : null ;
} // }
// }
//获取用户所在经销商单位
UserUnitInformationDto userUnitInformationDto=personnelBusinessMapper.getUserUnitInformationDto(userInfo.getUserId());
if(userUnitInformationDto!=null&&userUnitInformationDto.getAmosDealerName()!=null){
serviceAgent=userUnitInformationDto.getAmosDealerName();
} }
return this.queryForPowerStationPage(page,powerStationCode,ownersName,serviceAgent); return this.queryForPowerStationPage(page,powerStationCode,ownersName,serviceAgent);
} }
/** /**
......
...@@ -12,6 +12,7 @@ import com.yeejoin.amos.boot.module.hygf.api.Enum.PowerStationProcessStateEnum; ...@@ -12,6 +12,7 @@ import com.yeejoin.amos.boot.module.hygf.api.Enum.PowerStationProcessStateEnum;
import com.yeejoin.amos.boot.module.hygf.api.dto.*; 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.entity.*;
import com.yeejoin.amos.boot.module.hygf.api.fegin.IdxFeginService; import com.yeejoin.amos.boot.module.hygf.api.fegin.IdxFeginService;
import com.yeejoin.amos.boot.module.hygf.api.mapper.PersonnelBusinessMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.SurveyInformationMapper; import com.yeejoin.amos.boot.module.hygf.api.mapper.SurveyInformationMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IPowerStationService; import com.yeejoin.amos.boot.module.hygf.api.service.IPowerStationService;
import com.yeejoin.amos.boot.module.hygf.api.service.ISurveyInformationService; import com.yeejoin.amos.boot.module.hygf.api.service.ISurveyInformationService;
...@@ -89,7 +90,8 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -89,7 +90,8 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
private static final String OPERATION_TYPE_SUBMIT="submit"; private static final String OPERATION_TYPE_SUBMIT="submit";
private static final String OPERATION_TYPE_APPLY="apply"; private static final String OPERATION_TYPE_APPLY="apply";
private static final String IDX_REQUEST_STATE="200"; private static final String IDX_REQUEST_STATE="200";
@Autowired
PersonnelBusinessMapper personnelBusinessMapper;
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -260,10 +262,17 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -260,10 +262,17 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
SurveyInformation surveyInformation = this.baseMapper.selectOne(queryWrapper); SurveyInformation surveyInformation = this.baseMapper.selectOne(queryWrapper);
surveyInfoAllDto.setSurveyInformation(BeanDtoUtils.convert(surveyInformation, SurveyInformationDto.class)); surveyInfoAllDto.setSurveyInformation(BeanDtoUtils.convert(surveyInformation, SurveyInformationDto.class));
//农户信息 //农户信息
//获取用户所在经销商单位
UserUnitInformationDto userUnitInformationDto=personnelBusinessMapper.getUserUnitInformationDto(userInfo.getUserId());
BeanUtils.copyProperties(peasantHousehold, surveyInfoAllDto.getSurveyInformation()); BeanUtils.copyProperties(peasantHousehold, surveyInfoAllDto.getSurveyInformation());
surveyInfoAllDto.getSurveyInformation().setDeveloperName(userInfo.getCompanys().get(0).getCompanyName()); surveyInfoAllDto.getSurveyInformation().setDeveloperName(userUnitInformationDto.getAmosDealerName());
surveyInfoAllDto.getSurveyInformation().setDeveloperCode(userInfo.getCompanys().get(0).getOrgCode()); surveyInfoAllDto.getSurveyInformation().setDeveloperCode(userUnitInformationDto.getAmosDealerOrgCode());
surveyInfoAllDto.getSurveyInformation().setDeveloperId(userInfo.getCompanys().get(0).getSequenceNbr()); surveyInfoAllDto.getSurveyInformation().setDeveloperId(userUnitInformationDto.getAmosDealerId());
surveyInfoAllDto.getSurveyInformation().setSalesmanId(userInfo.getUserId()); surveyInfoAllDto.getSurveyInformation().setSalesmanId(userInfo.getUserId());
surveyInfoAllDto.getSurveyInformation().setSalesman(userInfo.getRealName()); surveyInfoAllDto.getSurveyInformation().setSalesman(userInfo.getRealName());
surveyInfoAllDto.getSurveyInformation().setCreator(userInfo.getRealName()); surveyInfoAllDto.getSurveyInformation().setCreator(userInfo.getRealName());
......
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