Browse Source

agencydetail-multic

dev
yinzuomei 4 years ago
parent
commit
3baf2d910b
  1. 3
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/AgencyDetailMulticResultDTO.java
  2. 20
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java

3
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/AgencyDetailMulticResultDTO.java

@ -1,5 +1,6 @@
package com.epmet.dto.result; package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
@ -96,4 +97,6 @@ public class AgencyDetailMulticResultDTO implements Serializable {
*/ */
private List<String> subCustomerIds; private List<String> subCustomerIds;
@JsonIgnore
private String agencyCustomerId;
} }

20
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java

@ -391,6 +391,8 @@ public class AgencyServiceImpl implements AgencyService {
return agencysResultDTO; return agencysResultDTO;
} }
agencysResultDTO = ConvertUtils.sourceToTarget(customerAgencyDTO, AgencyDetailMulticResultDTO.class); agencysResultDTO = ConvertUtils.sourceToTarget(customerAgencyDTO, AgencyDetailMulticResultDTO.class);
agencysResultDTO.setAgencyCustomerId(customerAgencyDTO.getCustomerId());
//2、当前登录用户所属客户,的跟级组织 //2、当前登录用户所属客户,的跟级组织
ScreenCustomerAgencyDTO rootAgency=screenCustomerAgencyDao.selectCustomerRootAgency(formDTO.getCustomerId()); ScreenCustomerAgencyDTO rootAgency=screenCustomerAgencyDao.selectCustomerRootAgency(formDTO.getCustomerId());
agencysResultDTO.setRootlevel(rootAgency.getLevel()); agencysResultDTO.setRootlevel(rootAgency.getLevel());
@ -421,21 +423,27 @@ public class AgencyServiceImpl implements AgencyService {
} }
if(agencysResultDTO.getHaveSubCustomer()){ if(agencysResultDTO.getHaveSubCustomer()){
if (StringUtils.isBlank(customerAgencyDTO.getPids())||NumConstant.ZERO_STR.equals(customerAgencyDTO.getPid())) { if (formDTO.getCustomerId().equals(agencysResultDTO.getAgencyCustomerId())
&& (StringUtils.isBlank(customerAgencyDTO.getPids())
||NumConstant.ZERO_STR.equals(customerAgencyDTO.getPid()))) {
log.info(String.format("1)当前组织agencyId=%s,为根基组织,不需要查询parentList",formDTO.getAgencyId())); log.info(String.format("1)当前组织agencyId=%s,为根基组织,不需要查询parentList",formDTO.getAgencyId()));
agencysResultDTO.setParentList(parentList); agencysResultDTO.setParentList(parentList);
}else{ }else{
// 5、多客户时根据area_code查询上级,自下向上,查询到当前客户的跟组织即可stop // 5、多客户时根据area_code查询上级,自下向上,查询到当前客户的跟组织即可stop
log.info("多客户版本parentList、level要重新赋值"); log.info("多客户版本parentList、level要重新赋值;agencysResultDTO.getParentAreaCode()="+agencysResultDTO.getParentAreaCode());
ScreenCustomerAgencyDTO parentAgency=screenCustomerAgencyDao.selectByAreaCode(agencysResultDTO.getParentAreaCode()); ScreenCustomerAgencyDTO parentAgency=screenCustomerAgencyDao.selectByAreaCode(agencysResultDTO.getParentAreaCode());
agencysResultDTO.setLevel(getAgencyLevelMultiC(parentAgency)); if (null != parentAgency) {
List<ParentListResultDTO> temp = getParentListMultic(parentList,parentAgency,formDTO.getCustomerId(),agencysResultDTO.getRootAgencyId()); agencysResultDTO.setLevel(getAgencyLevelMultiC(parentAgency));
agencysResultDTO.setParentList(temp); List<ParentListResultDTO> temp = getParentListMultic(parentList, parentAgency, formDTO.getCustomerId(), agencysResultDTO.getRootAgencyId());
agencysResultDTO.setParentList(temp);
}
} }
}else{ }else{
//单客户 //单客户
//6:查询当前组织的所有上级组织,按自上而下层级顺序 //6:查询当前组织的所有上级组织,按自上而下层级顺序
if (StringUtils.isBlank(customerAgencyDTO.getPids())||NumConstant.ZERO_STR.equals(customerAgencyDTO.getPid())) { if (formDTO.getCustomerId().equals(agencysResultDTO.getAgencyCustomerId())
&& (StringUtils.isBlank(customerAgencyDTO.getPids())
||NumConstant.ZERO_STR.equals(customerAgencyDTO.getPid()))) {
log.info(String.format("2)当前组织agencyId=%s,为根基组织,不需要查询parentList",formDTO.getAgencyId())); log.info(String.format("2)当前组织agencyId=%s,为根基组织,不需要查询parentList",formDTO.getAgencyId()));
agencysResultDTO.setParentList(parentList); agencysResultDTO.setParentList(parentList);
}else{ }else{

Loading…
Cancel
Save