Browse Source

默认发布党组织

master
yinzuomei 3 years ago
parent
commit
822744f373
  1. 37
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/DefaultPartyOrgResDTO.java
  2. 11
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyOrgController.java
  3. 2
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java
  4. 9
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java
  5. 27
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java
  6. 27
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml

37
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/DefaultPartyOrgResDTO.java

@ -0,0 +1,37 @@
package com.epmet.resi.partymember.dto.partyOrg.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @Author yzm
* @Date 2022/8/22 10:25
*/
@Data
public class DefaultPartyOrgResDTO implements Serializable {
private static final long serialVersionUID = -7563161453372080189L;
/**
* 当前登录用户所属的组织
*/
private String staffAgencyId;
/**
* 当前登录用户所属的组织名称
*/
private String staffAgencyName;
/**
* 当前登录用户所属的行政组织下默认的党组织名称
*/
private String defaultPartyOrgId;
private String defaultPartyOrgPid;
/**
* 党组织名称
*/
private String defaultPartyOrgName;
/**
* 党组织路径
*/
private String defaultPartyOrgPath;
}

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

@ -17,6 +17,7 @@ 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.DefaultPartyOrgResDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -155,4 +156,14 @@ public class IcPartyOrgController {
return new Result<Map<String, IcPartyOrgDTO>>().ok(icPartyOrgService.getPartyOrgList(tokenDto));
}
/**
* 党组织活动发布时
* 查询当前登录用户所属行政组织下默认的党组织取第一个
* @param tokenDto
* @return
*/
@PostMapping("defaultpartyorg")
public Result<DefaultPartyOrgResDTO> defaultPartyOrg(@LoginUser TokenDto tokenDto){
return new Result<DefaultPartyOrgResDTO>().ok(icPartyOrgService.defaultPartyOrg(tokenDto.getCustomerId(), tokenDto.getUserId()));
}
}

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

@ -107,4 +107,6 @@ public interface IcPartyOrgDao extends BaseDao<IcPartyOrgEntity> {
IcPartyOrgEntity selectByCustomerIdAndFirstOrg(@Param("customerId") String customerId);
List<ActAndScheduleListResultDTO.JoinOrgDTO> getPartyOrg(@Param("orgIds")List<String> orgIds);
IcPartyOrgEntity selectDefaultPartyOrg(@Param("agencyId") String agencyId, @Param("level") String level);
}

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

@ -9,6 +9,7 @@ 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.DefaultPartyOrgResDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO;
import java.util.List;
@ -127,4 +128,12 @@ public interface IcPartyOrgService extends BaseService<IcPartyOrgEntity> {
* @Date 2022/8/15 15:52
*/
Map<String, IcPartyOrgDTO> getPartyOrgList(TokenDto tokenDto);
/**
* 党组织活动发布时
* 查询当前登录用户所属行政组织下默认的党组织取第一个
* @param tokenDto
* @return
*/
DefaultPartyOrgResDTO defaultPartyOrg(String customerId, String userId);
}

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

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.PartyOrgTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
@ -31,6 +32,7 @@ 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;
import com.epmet.resi.partymember.dto.partyOrg.result.DefaultPartyOrgResDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -361,4 +363,29 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl<IcPartyOrgDao, IcPart
return result;
}
/**
* 党组织活动发布时
* 查询当前登录用户所属行政组织下默认的党组织取第一个
*
* @param customerId
* @param userId
* @return
*/
@Override
public DefaultPartyOrgResDTO defaultPartyOrg(String customerId, String userId) {
CustomerStaffInfoCacheResult staffInfoCacheResult=CustomerStaffRedis.getStaffInfo(customerId,userId);
if(null==staffInfoCacheResult){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"查询工作人员所属组织异常","查询工作人员所属组织异常");
}
DefaultPartyOrgResDTO resDto=new DefaultPartyOrgResDTO();
resDto.setStaffAgencyId(staffInfoCacheResult.getAgencyId());
resDto.setStaffAgencyName(staffInfoCacheResult.getAgencyName());
IcPartyOrgEntity entity=baseDao.selectDefaultPartyOrg(staffInfoCacheResult.getAgencyId(),staffInfoCacheResult.getLevel());
resDto.setDefaultPartyOrgId(entity.getId());
resDto.setDefaultPartyOrgPid(entity.getOrgPid());
resDto.setDefaultPartyOrgName(entity.getPartyOrgName());
resDto.setDefaultPartyOrgPath(StringUtils.isNotBlank(entity.getOrgPids()) ? entity.getOrgPids().concat(StrConstant.COLON).concat(entity.getId()) : entity.getId());
return resDto;
}
}

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

@ -159,5 +159,30 @@
</if>
</select>
<select id="selectDefaultPartyOrg" parameterType="map" resultType="IcPartyOrgEntity">
SELECT
o.*
FROM
ic_party_org o
WHERE
o.DEL_FLAG = '0'
AND o.AGENCY_ID = #{agencyId}
<if test="level!= null and level == 'province' ">
AND o.PARTY_ORG_TYPE = '0'
</if>
<if test="level!= null and level == 'city' ">
AND o.PARTY_ORG_TYPE = '1'
</if>
<if test="level!= null and level == 'district' ">
AND o.PARTY_ORG_TYPE = '2'
</if>
<if test="level!= null and level == 'street' ">
AND o.PARTY_ORG_TYPE = '3'
</if>
<if test="level!= null and level == 'community' ">
AND o.PARTY_ORG_TYPE = '4'
</if>
order by CREATED_TIME asc
limit 1
</select>
</mapper>

Loading…
Cancel
Save