|
|
@ -6,6 +6,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
|
|
|
import com.epmet.commons.tools.enums.PartyOrgTypeEnum; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; |
|
|
@ -14,13 +15,16 @@ import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; |
|
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.dto.CustomerAgencyDTO; |
|
|
|
import com.epmet.enums.OrgLevelEnums; |
|
|
|
import com.epmet.feign.GovOrgOpenFeignClient; |
|
|
|
import com.epmet.modules.partyOrg.dao.IcPartyOrgDao; |
|
|
|
import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity; |
|
|
|
import com.epmet.modules.partyOrg.service.IcPartyOrgService; |
|
|
|
import com.epmet.modules.partymember.dao.IcPartyMemberDao; |
|
|
|
import com.epmet.modules.partymember.entity.IcPartyMemberEntity; |
|
|
|
import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO; |
|
|
|
import com.epmet.resi.partymember.dto.partyOrg.form.GetParentOrgFormDTO; |
|
|
|
import com.epmet.resi.partymember.dto.partyOrg.form.PartyOrgTreeListDTO; |
|
|
|
import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeDTO; |
|
|
|
import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeSubDTO; |
|
|
@ -48,6 +52,9 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl<IcPartyOrgDao, IcPart |
|
|
|
@Autowired |
|
|
|
private IcPartyMemberDao icPartyMemberDao; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private GovOrgOpenFeignClient govOrgOpenFeignClient; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<IcPartyOrgDTO> page(Map<String, Object> params) { |
|
|
@ -133,11 +140,11 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl<IcPartyOrgDao, IcPart |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return void |
|
|
|
* @describe: 判断当前党组织的类型是否是所选上级党组织类型的直接下级 |
|
|
|
* @author wangtong |
|
|
|
* @date 2022/5/25 10:09 |
|
|
|
* @params [parentOrg, partyOrgType] |
|
|
|
* @return void |
|
|
|
*/ |
|
|
|
private void checkOrgType(String parentOrgType, String partyOrgType) { |
|
|
|
if (PartyOrgTypeEnum.BRANCH.getCode().equals(partyOrgType) && !PartyOrgTypeEnum.PARTY.getCode().equals(parentOrgType)) { |
|
|
@ -154,11 +161,11 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl<IcPartyOrgDao, IcPart |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return void |
|
|
|
* @describe: 判断该所选的行政组织类型是否与当前党组织的类型一致 |
|
|
|
* @author wangtong |
|
|
|
* @date 2022/5/25 9:45 |
|
|
|
* @params [agencyLevel, partyOrgType] |
|
|
|
* @return void |
|
|
|
*/ |
|
|
|
private void checnAgencyLevel(String agencyLevel, String partyOrgType) { |
|
|
|
if (PartyOrgTypeEnum.PROVINCIAL.getCode().equals(partyOrgType) && !OrgLevelEnums.PROVINCE.getLevel().equals(agencyLevel)) { |
|
|
@ -237,6 +244,32 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl<IcPartyOrgDao, IcPart |
|
|
|
return new Result<List<IcPartyOrgTreeDTO>>().ok(build(list)); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Result<List<IcPartyOrgTreeDTO>> getParentOrgList(GetParentOrgFormDTO formDTO) { |
|
|
|
Result<CustomerAgencyDTO> agencyDTOResult = govOrgOpenFeignClient.getAgencyById(formDTO.getAgencyId()); |
|
|
|
if (!agencyDTOResult.success() || null == agencyDTOResult || null == agencyDTOResult.getData()) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询行政组织信息错误", "查询行政组织信息错误"); |
|
|
|
} |
|
|
|
String agencyPid = agencyDTOResult.getData().getPid(); |
|
|
|
List<IcPartyOrgTreeDTO> list = new ArrayList<>(); |
|
|
|
//如果本工作人员的级别是该客户下的最高级别,并且没有一级组织时,添加一级组织选项
|
|
|
|
IcPartyOrgEntity entity = baseDao.selectByCustomerIdAndFirstOrg(formDTO.getCustomerId()); |
|
|
|
if("0".equals(agencyPid) && null == entity){ |
|
|
|
IcPartyOrgTreeDTO firstOrg = new IcPartyOrgTreeDTO(); |
|
|
|
firstOrg.setId("0"); |
|
|
|
firstOrg.setPartyOrgName("一级组织"); |
|
|
|
list.add(firstOrg); |
|
|
|
} |
|
|
|
//如果类型为支部,则查询该行政组织下的所有党委(列表)
|
|
|
|
if(PartyOrgTypeEnum.BRANCH.getCode().equals(formDTO.getPartyOrgType())){ |
|
|
|
list.addAll(baseDao.selectParentOrgByAgencyPid(agencyPid,formDTO.getCustomerId(),PartyOrgTypeEnum.PARTY.getCode())); |
|
|
|
}else{ |
|
|
|
//查询该行政组织对应上级所关联的党组织(单个实体类)
|
|
|
|
list.addAll(baseDao.selectParentOrgByAgencyPid(agencyPid,formDTO.getCustomerId(),null)); |
|
|
|
} |
|
|
|
return new Result<List<IcPartyOrgTreeDTO>>().ok(list); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 构建树节点 |
|
|
|
*/ |
|
|
|