Browse Source

党组织列表调整为只看显示本组织及下级党组织,不展示同级及上级;一级组织选项规则调整

feature/teamB_zz_wgh
Jackwang 3 years ago
parent
commit
49791964ff
  1. 33
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/GetParentOrgFormDTO.java
  2. 16
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyOrgController.java
  3. 20
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java
  4. 10
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java
  5. 37
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java
  6. 38
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml

33
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/GetParentOrgFormDTO.java

@ -0,0 +1,33 @@
package com.epmet.resi.partymember.dto.partyOrg.form;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @program: epmet-cloud
* @description:
* @author: wangtong
* @create: 2022-06-10 16:02
**/
@Data
public class GetParentOrgFormDTO implements Serializable {
/**
* 党组织类型
*/
@NotNull(message = "党组织类型不可为空")
private String partyOrgType;
/**
* 行政组织 机关ID
*/
@NotNull(message = "行政组织id不可为空")
private String agencyId;
/**
* 客户Id (customer.id)
*/
private String customerId;
}

16
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyOrgController.java

@ -14,6 +14,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.modules.partyOrg.excel.IcPartyOrgExcel;
import com.epmet.modules.partyOrg.service.IcPartyOrgService;
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.IcPartyOrgTreeDTO;
@ -121,6 +122,19 @@ public class IcPartyOrgController {
return icPartyOrgService.branchlist(tokenDto);
}
/**
* @describe: 上级党组织列表
* @author wangtong
* @date 2022/6/10 15:59
* @params [tokenDto, formDTO]
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO>>
*/
@GetMapping("getParentOrgList")
public Result<List<IcPartyOrgTreeDTO>> getParentOrgList(@LoginUser TokenDto tokenDto, GetParentOrgFormDTO formDTO){
//效验数据
ValidatorUtils.validateEntity(formDTO);
formDTO.setCustomerId(tokenDto.getCustomerId());
return icPartyOrgService.getParentOrgList(formDTO);
}
}

20
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java

@ -83,4 +83,24 @@ public interface IcPartyOrgDao extends BaseDao<IcPartyOrgEntity> {
* @return java.util.List<com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO>
*/
List<IcPartyOrgTreeDTO> getSearchTreelist(PartyOrgTreeListDTO formDTO);
/**
* @describe: 获取上级党组织
* @author wangtong
* @date 2022/6/10 16:48
* @params [agencyPid, customerId, code]
* @return java.util.List<com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO>
*/
List<IcPartyOrgTreeDTO> selectParentOrgByAgencyPid(@Param("agencyPid") String agencyPid,
@Param("customerId") String customerId,
@Param("partyOrgType") String partyOrgType);
/**
* @describe: 查询该客户下的一级组织
* @author wangtong
* @date 2022/6/10 17:29
* @params [customerId]
* @return com.epmet.modules.partyOrg.entity.IcPartyOrgEntity
*/
IcPartyOrgEntity selectByCustomerIdAndFirstOrg(@Param("customerId") String customerId);
}

10
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java

@ -6,6 +6,7 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity;
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.IcPartyOrgTreeDTO;
@ -107,4 +108,13 @@ public interface IcPartyOrgService extends BaseService<IcPartyOrgEntity> {
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO>>
*/
Result<List<IcPartyOrgTreeDTO>> getSearchTreelist(PartyOrgTreeListDTO formDTO);
/**
* @describe: 上级党组织列表
* @author wangtong
* @date 2022/6/10 16:01
* @params [formDTO]
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO>>
*/
Result<List<IcPartyOrgTreeDTO>> getParentOrgList(GetParentOrgFormDTO formDTO);
}

37
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java

@ -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);
}
/**
* 构建树节点
*/

38
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml

@ -98,7 +98,6 @@
</select>
<select id="getSearchTreelist"
resultType="com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO">
select ID,
CUSTOMER_ID,
ORG_PID as pid,
@ -110,19 +109,36 @@
from ic_party_org
where DEL_FLAG=0
and CUSTOMER_ID=#{customerId}
<choose>
<when test="orgPid != '' and orgPid != null and agencyId != null and agencyId != ''">
<if test="agencyId != null and agencyId != ''">
AND( AGENCY_PIDS LIKE concat('%',#{agencyId}, '%' )
or
id =#{orgPid})
</when>
<otherwise>
<if test="agencyId != null and agencyId != ''">
AND AGENCY_PIDS LIKE concat('%',#{agencyId}, '%' )
(PARTY_ORG_TYPE = '5' and AGENCY_ID=#{agencyId}))
</if>
</otherwise>
</choose>
</select>
<select id="selectParentOrgByAgencyPid"
resultType="com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO">
select ID,
CUSTOMER_ID,
ORG_PID as pid,
ORG_PIDS,
AGENCY_ID,
AGENCY_PIDS,
PARTY_ORG_TYPE,
PARTY_ORG_NAME
from ic_party_org
where DEL_FLAG = 0
and CUSTOMER_ID=#{customerId}
and AGENCY_ID=#{agencyPid}
<if test="partyOrgType != null and partyOrgType != ''">
and PARTY_ORG_TYPE = #{partyOrgType}
</if>
</select>
<select id="selectByCustomerIdAndFirstOrg" resultType="com.epmet.modules.partyOrg.entity.IcPartyOrgEntity">
select *
from ic_party_org
where DEL_FLAG = 0
and CUSTOMER_ID=#{customerId}
and ORG_PID = '0'
</select>

Loading…
Cancel
Save