Browse Source

Merge branch 'dev_party_mange'

master
YUJT 3 years ago
parent
commit
f7795fc587
  1. 132
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IDCardUtil.java
  2. 33
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/GetParentOrgFormDTO.java
  3. 4
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberPointDTO.java
  4. 1
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/IcPartyMemberFromDTO.java
  5. 6
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberPointListFormDTO.java
  6. 22
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java
  7. 5
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java
  8. 29
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyOrgController.java
  9. 33
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java
  10. 19
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java
  11. 137
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java
  12. 6
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberController.java
  13. 1
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPayRecordDetailController.java
  14. 8
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPointController.java
  15. 2
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberPointDao.java
  16. 10
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberService.java
  17. 42
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPayRecordDetailServiceImpl.java
  18. 12
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPointServiceImpl.java
  19. 37
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberServiceImpl.java
  20. 49
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml
  21. 4
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberDao.xml
  22. 4
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPayRecordDetailDao.xml
  23. 33
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPointDao.xml
  24. 8
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserRoleResultDTO.java
  25. 49
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  26. 2
      epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml

132
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IDCardUtil.java

@ -0,0 +1,132 @@
package com.epmet.commons.tools.utils;
import com.epmet.commons.tools.enums.GenderEnum;
import org.apache.commons.lang3.StringUtils;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/6/13 17:53
*/
public class IDCardUtil {
/**
* 15位身份证号
*/
private static final Integer FIFTEEN_ID_CARD=15;
/**
* 18位身份证号
*/
private static final Integer EIGHTEEN_ID_CARD=18;
private static final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
/**
* 根据身份证号获取性别
* @param idCard
* @return
*/
public static String getSex(String idCard){
String sex ="";
if (StringUtils.isNotBlank(idCard)){
//15位身份证号
if (idCard.length() == FIFTEEN_ID_CARD){
if (Integer.parseInt(idCard.substring(14, 15)) % 2 == 0) {
sex = GenderEnum.WOMAN.getCode();
} else {
sex = GenderEnum.MAN.getCode();
}
//18位身份证号
}else if(idCard.length() == EIGHTEEN_ID_CARD){
// 判断性别
if (Integer.parseInt(idCard.substring(16).substring(0, 1)) % 2 == 0) {
sex = GenderEnum.WOMAN.getCode();
} else {
sex = GenderEnum.MAN.getCode();
}
}
}
return sex;
}
/**
* 根据身份证号获取年龄
* @param idCard
* @return
*/
public static Integer getAge(String idCard){
int age = 0;
Date date = new Date();
if (StringUtils.isNotBlank(idCard)){
//15位身份证号
if (idCard.length() == FIFTEEN_ID_CARD){
// 身份证上的年份(15位身份证为1980年前的)
String uyear = "19" + idCard.substring(6, 8);
// 身份证上的月份
String uyue = idCard.substring(8, 10);
// 当前年份
String fyear = format.format(date).substring(0, 4);
// 当前月份
String fyue = format.format(date).substring(5, 7);
if (Integer.parseInt(uyue) <= Integer.parseInt(fyue)) {
age = Integer.parseInt(fyear) - Integer.parseInt(uyear) + 1;
// 当前用户还没过生
} else {
age = Integer.parseInt(fyear) - Integer.parseInt(uyear);
}
//18位身份证号
}else if(idCard.length() == EIGHTEEN_ID_CARD){
// 身份证上的年份
String year = idCard.substring(6).substring(0, 4);
// 身份证上的月份
String yue = idCard.substring(10).substring(0, 2);
// 当前年份
String fyear = format.format(date).substring(0, 4);
// 当前月份
String fyue = format.format(date).substring(5, 7);
// 当前月份大于用户出身的月份表示已过生日
if (Integer.parseInt(yue) <= Integer.parseInt(fyue)) {
age = Integer.parseInt(fyear) - Integer.parseInt(year) + 1;
// 当前用户还没过生日
} else {
age = Integer.parseInt(fyear) - Integer.parseInt(year);
}
}
}
return age;
}
/**
* 获取出生日期 yyyy年MM月dd日
* @param idCard
* @return
*/
public static String getBirthday(String idCard){
String birthday="";
String year="";
String month="";
String day="";
if (StringUtils.isNotBlank(idCard)){
//15位身份证号
if (idCard.length() == FIFTEEN_ID_CARD){
// 身份证上的年份(15位身份证为1980年前的)
year = "19" + idCard.substring(6, 8);
//身份证上的月份
month = idCard.substring(8, 10);
//身份证上的日期
day= idCard.substring(10, 12);
//18位身份证号
}else if(idCard.length() == EIGHTEEN_ID_CARD){
// 身份证上的年份
year = idCard.substring(6).substring(0, 4);
// 身份证上的月份
month = idCard.substring(10).substring(0, 2);
//身份证上的日期
day=idCard.substring(12).substring(0,2);
}
birthday=year+"-"+month+"-"+day;
}
return birthday;
}
}

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;
}

4
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberPointDTO.java

@ -16,10 +16,6 @@ public class IcPartyMemberPointDTO implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/** /**
* 客户Id (customer.id) * 客户Id (customer.id)

1
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/IcPartyMemberFromDTO.java

@ -81,4 +81,5 @@ public class IcPartyMemberFromDTO extends PageFormDTO implements Serializable {
*/ */
private String payEndDate; private String payEndDate;
private String year; private String year;
private String month;
} }

6
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberPointListFormDTO.java

@ -10,10 +10,14 @@ import java.io.Serializable;
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class PartyMemberPointListFormDTO extends PageFormDTO implements Serializable { public class PartyMemberPointListFormDTO implements Serializable {
private static final long serialVersionUID = 5659445492756209830L; private static final long serialVersionUID = 5659445492756209830L;
private Integer page;
private Integer limit;
/** /**
* 所属党组织id * 所属党组织id
*/ */

22
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java

@ -52,18 +52,18 @@ public interface ResiPartyMemberOpenFeignClient {
Result<String> addPartyMemberBaseInfo(@RequestBody PartyMemberBaseInfoAddFormDTO formDTO); Result<String> addPartyMemberBaseInfo(@RequestBody PartyMemberBaseInfoAddFormDTO formDTO);
/** /**
* @return com.epmet.commons.tools.utils.Result<java.util.List<PartymemberBaseInfoResultDTO>>
* @param partyBranchId * @param partyBranchId
* @return com.epmet.commons.tools.utils.Result<java.util.List < PartymemberBaseInfoResultDTO>>
* @author yinzuomei * @author yinzuomei
* @description 根据党支部id,查询党员列表 * @description 根据党支部id, 查询党员列表
* @Date 2020/6/18 10:12 * @Date 2020/6/18 10:12
**/ **/
@GetMapping(value = "/resi/partymember/partymemberbaseinfo/listPartyMemberBaseInfo/{partyBranchId}") @GetMapping(value = "/resi/partymember/partymemberbaseinfo/listPartyMemberBaseInfo/{partyBranchId}")
Result<List<PartymemberBaseInfoResultDTO>> listPartyMemberBaseInfo(@PathVariable("partyBranchId") String partyBranchId); Result<List<PartymemberBaseInfoResultDTO>> listPartyMemberBaseInfo(@PathVariable("partyBranchId") String partyBranchId);
/** /**
* @return com.epmet.commons.tools.utils.Result
* @param partyMemberId 党员库id主键 * @param partyMemberId 党员库id主键
* @return com.epmet.commons.tools.utils.Result
* @author yinzuomei * @author yinzuomei
* @description 根据党员id查询党员信息 * @description 根据党员id查询党员信息
* @Date 2020/6/18 15:30 * @Date 2020/6/18 15:30
@ -72,8 +72,8 @@ public interface ResiPartyMemberOpenFeignClient {
Result<PartyMemberBaseInfoDetailResultDTO> queryPartyMemberBaseInfoById(@PathVariable("partyMemberId") String partyMemberId); Result<PartyMemberBaseInfoDetailResultDTO> queryPartyMemberBaseInfoById(@PathVariable("partyMemberId") String partyMemberId);
/** /**
* @return com.epmet.commons.tools.utils.Result
* @param formDTO * @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author yinzuomei * @author yinzuomei
* @description 删除党员 * @description 删除党员
* @Date 2020/6/18 17:57 * @Date 2020/6/18 17:57
@ -82,8 +82,8 @@ public interface ResiPartyMemberOpenFeignClient {
Result deltePartyMemberBaseInfo(@RequestBody DelPartyMemberBaseInfoFormDTO formDTO); Result deltePartyMemberBaseInfo(@RequestBody DelPartyMemberBaseInfoFormDTO formDTO);
/** /**
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO>>
* @param userIdList * @param userIdList
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO>>
* @author yinzuomei * @author yinzuomei
* @description 根据用户id查询认证通过的党员信息 * @description 根据用户id查询认证通过的党员信息
* @Date 2020/7/22 12:14 * @Date 2020/7/22 12:14
@ -92,8 +92,8 @@ public interface ResiPartyMemberOpenFeignClient {
Result<List<PartymemberInfoDTO>> queryPartymemberInfoByUserId(@RequestBody List<String> userIdList); Result<List<PartymemberInfoDTO>> queryPartymemberInfoByUserId(@RequestBody List<String> userIdList);
/** /**
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO>>
* @param gridIdList * @param gridIdList
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO>>
* @author zy * @author zy
* @description 根据网格id查询认证通过的党员信息 * @description 根据网格id查询认证通过的党员信息
* @Date 2020/7/22 12:14 * @Date 2020/7/22 12:14
@ -102,22 +102,23 @@ public interface ResiPartyMemberOpenFeignClient {
Result<List<PartymemberInfoDTO>> getPartymemberInfoByGridId(@RequestBody List<String> gridIdList); Result<List<PartymemberInfoDTO>> getPartymemberInfoByGridId(@RequestBody List<String> gridIdList);
/** /**
* @Description 根据客户ID查询党员 * @Description 根据客户ID查询党员
* @Param customerId * @Param customerId
* @author zxc * @author zxc
* @date 2021/9/6 3:54 下午 * @date 2021/9/6 3:54 下午
*/ */
@PostMapping(value = "/resi/partymember/partymemberinfo/getpartymemberinfobycustomerid") @PostMapping(value = "/resi/partymember/partymemberinfo/getpartymemberinfobycustomerid")
Result<List<PartymemberInfoDTO>> getPartyMemberInfoByCustomerId(@RequestParam("customerId")String customerId); Result<List<PartymemberInfoDTO>> getPartyMemberInfoByCustomerId(@RequestParam("customerId") String customerId);
/** /**
* Desc: 查询网格下是否存在党员审核 true存在false不存在 * Desc: 查询网格下是否存在党员审核 true存在false不存在
*
* @param gridId * @param gridId
* @author zxc * @author zxc
* @date 2022/3/15 4:19 下午 * @date 2022/3/15 4:19 下午
*/ */
@PostMapping("/resi/partymember/partymemberconfirmmanual/audit-reset") @PostMapping("/resi/partymember/partymemberconfirmmanual/audit-reset")
Result<WarnAndPartyAuditResultDTO> partyMemberAuditReset(@RequestParam("gridId")String gridId); Result<WarnAndPartyAuditResultDTO> partyMemberAuditReset(@RequestParam("gridId") String gridId);
/** /**
* @Description 同步党员信息 * @Description 同步党员信息
@ -129,6 +130,9 @@ public interface ResiPartyMemberOpenFeignClient {
@PostMapping("/resi/partymember/icPartyMember/icPartyMemberSync") @PostMapping("/resi/partymember/icPartyMember/icPartyMemberSync")
Result icPartyMemberSync(@RequestBody IcPartyMemberDTO dto); Result icPartyMemberSync(@RequestBody IcPartyMemberDTO dto);
@PostMapping("/resi/partymember/icPartyMember/getPartyMemberByIdCard")
Result<IcPartyMemberDTO> getPartyMemberByIdCard(@RequestBody IcPartyMemberDTO dto);
@PostMapping("/resi/partymember/icPartyOrg/branchlist") @PostMapping("/resi/partymember/icPartyOrg/branchlist")
public Result<List<OptionResultDTO>> branchlist(); public Result<List<OptionResultDTO>> branchlist();
} }

5
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java

@ -92,6 +92,11 @@ public class ResiPartyMemberOpenFeignClientFallback implements ResiPartyMemberOp
return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "icPartyMemberSync", dto); return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "icPartyMemberSync", dto);
} }
@Override
public Result<IcPartyMemberDTO> getPartyMemberByIdCard(IcPartyMemberDTO dto) {
return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "getPartyMemberByIdCard", dto);
}
@Override @Override
public Result<List<OptionResultDTO>> branchlist() { public Result<List<OptionResultDTO>> branchlist() {
return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "branchlist", null); return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "branchlist", null);

29
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.excel.IcPartyOrgExcel;
import com.epmet.modules.partyOrg.service.IcPartyOrgService; import com.epmet.modules.partyOrg.service.IcPartyOrgService;
import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO; 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.form.PartyOrgTreeListDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeDTO; import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO; import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO;
@ -96,6 +97,19 @@ public class IcPartyOrgController {
return icPartyOrgService.getTreelist(formDTO); return icPartyOrgService.getTreelist(formDTO);
} }
/**
* @describe: 列表搜索党组织树(不包含当前级组织)
* @author wangtong
* @date 2022/6/10 14:20
* @params [tokenDto, formDTO]
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO>>
*/
@GetMapping("getSearchTreelist")
public Result<List<IcPartyOrgTreeDTO>> getSearchTreelist(@LoginUser TokenDto tokenDto,PartyOrgTreeListDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
return icPartyOrgService.getSearchTreelist(formDTO);
}
/** /**
* @describe: 当前登录用户所属行政组织及下级的党组织只限支部 * @describe: 当前登录用户所属行政组织及下级的党组织只限支部
* @author wangtong * @author wangtong
@ -108,6 +122,19 @@ public class IcPartyOrgController {
return icPartyOrgService.branchlist(tokenDto); 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);
}
} }

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

@ -3,7 +3,6 @@ package com.epmet.modules.partyOrg.dao;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity; import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity;
import com.epmet.resi.partymember.dto.partyOrg.form.PartyOrgTreeListDTO; 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.BranchlistTreeSubDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO; import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -21,7 +20,7 @@ import java.util.List;
public interface IcPartyOrgDao extends BaseDao<IcPartyOrgEntity> { public interface IcPartyOrgDao extends BaseDao<IcPartyOrgEntity> {
/** /**
* @describe: 获取组织列表 * @describe: 获取当前及下级组织列表
* @author wangtong * @author wangtong
* @date 2022/5/17 19:00 * @date 2022/5/17 19:00
* @params [] * @params []
@ -75,4 +74,34 @@ public interface IcPartyOrgDao extends BaseDao<IcPartyOrgEntity> {
* @return java.util.List<com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO> * @return java.util.List<com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO>
*/ */
List<BranchlistTreeSubDTO> selectAllBranchByAgencyId(@Param("agencyId") String agencyId, @Param("customerId") String customerId); List<BranchlistTreeSubDTO> selectAllBranchByAgencyId(@Param("agencyId") String agencyId, @Param("customerId") String customerId);
/**
* @describe: 获取下级组织列表
* @author wangtong
* @date 2022/6/10 14:21
* @params [formDTO]
* @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("agencyId") String agencyId,
@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);
} }

19
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.commons.tools.utils.Result;
import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity; import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity;
import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO; 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.form.PartyOrgTreeListDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeDTO; import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO; import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO;
@ -98,4 +99,22 @@ public interface IcPartyOrgService extends BaseService<IcPartyOrgEntity> {
* @return com.epmet.commons.tools.utils.Result<com.epmet.resi.partymember.dto.partyOrg.result.BranchListResultDTO> * @return com.epmet.commons.tools.utils.Result<com.epmet.resi.partymember.dto.partyOrg.result.BranchListResultDTO>
*/ */
Result<List<BranchlistTreeDTO>> branchlist(TokenDto tokenDto); Result<List<BranchlistTreeDTO>> branchlist(TokenDto tokenDto);
/**
* @describe: 列表搜索党组织树(不包含当前级组织)
* @author wangtong
* @date 2022/6/10 14:20
* @params [formDTO]
* @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);
} }

137
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.constant.FieldConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.PartyOrgTypeEnum; 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.exception.EpmetException;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; 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.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.enums.OrgLevelEnums; import com.epmet.enums.OrgLevelEnums;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.modules.partyOrg.dao.IcPartyOrgDao; import com.epmet.modules.partyOrg.dao.IcPartyOrgDao;
import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity; import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity;
import com.epmet.modules.partyOrg.service.IcPartyOrgService; import com.epmet.modules.partyOrg.service.IcPartyOrgService;
import com.epmet.modules.partymember.dao.IcPartyMemberDao; import com.epmet.modules.partymember.dao.IcPartyMemberDao;
import com.epmet.modules.partymember.entity.IcPartyMemberEntity; import com.epmet.modules.partymember.entity.IcPartyMemberEntity;
import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO; 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.form.PartyOrgTreeListDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeDTO; 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.BranchlistTreeSubDTO;
@ -48,6 +52,9 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl<IcPartyOrgDao, IcPart
@Autowired @Autowired
private IcPartyMemberDao icPartyMemberDao; private IcPartyMemberDao icPartyMemberDao;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Override @Override
public PageData<IcPartyOrgDTO> page(Map<String, Object> params) { public PageData<IcPartyOrgDTO> page(Map<String, Object> params) {
@ -65,8 +72,8 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl<IcPartyOrgDao, IcPart
return ConvertUtils.sourceToTarget(entityList, IcPartyOrgDTO.class); return ConvertUtils.sourceToTarget(entityList, IcPartyOrgDTO.class);
} }
private QueryWrapper<IcPartyOrgEntity> getWrapper(Map<String, Object> params){ private QueryWrapper<IcPartyOrgEntity> getWrapper(Map<String, Object> params) {
String id = (String)params.get(FieldConstant.ID_HUMP); String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<IcPartyOrgEntity> wrapper = new QueryWrapper<>(); QueryWrapper<IcPartyOrgEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
@ -84,47 +91,47 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl<IcPartyOrgDao, IcPart
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Result save(IcPartyOrgDTO dto) { public Result save(IcPartyOrgDTO dto) {
//同一个客户下,名称和编码不可重复 //同一个客户下,名称和编码不可重复
IcPartyOrgEntity repeatName = baseDao.selectByCuIdAndNameOrCode(dto.getPartyOrgName(),null,dto.getCustomerId()); IcPartyOrgEntity repeatName = baseDao.selectByCuIdAndNameOrCode(dto.getPartyOrgName(), null, dto.getCustomerId());
if(null != repeatName){ if (null != repeatName) {
throw new EpmetException("行政组织名称不可重复!"); throw new EpmetException("行政组织名称不可重复!");
} }
if(StringUtils.isNotBlank(dto.getPartyOrgCode())){ if (StringUtils.isNotBlank(dto.getPartyOrgCode())) {
IcPartyOrgEntity repeatCode = baseDao.selectByCuIdAndNameOrCode(null,dto.getPartyOrgCode(),dto.getCustomerId()); IcPartyOrgEntity repeatCode = baseDao.selectByCuIdAndNameOrCode(null, dto.getPartyOrgCode(), dto.getCustomerId());
if(null != repeatCode){ if (null != repeatCode) {
throw new EpmetException("行政组织编码不可重复!"); throw new EpmetException("行政组织编码不可重复!");
} }
} }
IcPartyOrgEntity parentOrg = baseDao.selectById(dto.getOrgPid()); IcPartyOrgEntity parentOrg = baseDao.selectById(dto.getOrgPid());
//判断当前党组织的类型是否是所选上级党组织类型的直接下级 //判断当前党组织的类型是否是所选上级党组织类型的直接下级
if("0".equals(dto.getOrgPid())){ if ("0".equals(dto.getOrgPid())) {
if(PartyOrgTypeEnum.BRANCH.getCode().equals(dto.getPartyOrgType())){ if (PartyOrgTypeEnum.BRANCH.getCode().equals(dto.getPartyOrgType())) {
throw new EpmetException("支部不可设为一级组织!"); throw new EpmetException("支部不可设为一级组织!");
} }
//一个客户下只能有一个一级组织 //一个客户下只能有一个一级组织
IcPartyOrgEntity levelOneOrg = baseDao.selectLevelOneOrgByCustomerId(dto.getCustomerId()); IcPartyOrgEntity levelOneOrg = baseDao.selectLevelOneOrgByCustomerId(dto.getCustomerId());
if(null != levelOneOrg){ if (null != levelOneOrg) {
throw new EpmetException("当前客户下已存在一级组织,不可重复添加!"); throw new EpmetException("当前客户下已存在一级组织,不可重复添加!");
} }
}else{ } else {
checkOrgType(parentOrg.getPartyOrgType(),dto.getPartyOrgType()); checkOrgType(parentOrg.getPartyOrgType(), dto.getPartyOrgType());
} }
//如果不是支部,需要判断行政组织是否重复 //如果不是支部,需要判断行政组织是否重复
if(!PartyOrgTypeEnum.BRANCH.getCode().equals(dto.getPartyOrgType())){ if (!PartyOrgTypeEnum.BRANCH.getCode().equals(dto.getPartyOrgType())) {
IcPartyOrgEntity isAgency = baseDao.selectByAgencyId(dto.getAgencyId(),PartyOrgTypeEnum.BRANCH.getCode()); IcPartyOrgEntity isAgency = baseDao.selectByAgencyId(dto.getAgencyId(), PartyOrgTypeEnum.BRANCH.getCode());
if(null != isAgency){ if (null != isAgency) {
throw new EpmetException("该行政组织已被关联!"); throw new EpmetException("该行政组织已被关联!");
} }
AgencyInfoCache agency = CustomerOrgRedis.getAgencyInfo(dto.getAgencyId()); AgencyInfoCache agency = CustomerOrgRedis.getAgencyInfo(dto.getAgencyId());
//判断该所选的行政组织类型是否与当前党组织的类型一致 //判断该所选的行政组织类型是否与当前党组织的类型一致
checnAgencyLevel(agency.getLevel(),dto.getPartyOrgType()); checnAgencyLevel(agency.getLevel(), dto.getPartyOrgType());
dto.setAgencyPids(agency.getPids()); dto.setAgencyPids(agency.getPids());
}else{ } else {
//类型为支部时,行政组织信息与上级党组织一致 //类型为支部时,行政组织信息与上级党组织一致
dto.setAgencyId(parentOrg.getAgencyId()); dto.setAgencyId(parentOrg.getAgencyId());
dto.setAgencyPids(parentOrg.getAgencyPids()); dto.setAgencyPids(parentOrg.getAgencyPids());
} }
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(dto.getAgencyId()); AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(dto.getAgencyId());
if (null == agencyInfo){ if (null == agencyInfo) {
throw new EpmetException("组织信息获取失败"); throw new EpmetException("组织信息获取失败");
} }
IcPartyOrgEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyOrgEntity.class); IcPartyOrgEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyOrgEntity.class);
@ -133,43 +140,43 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl<IcPartyOrgDao, IcPart
} }
/** /**
* @describe: 判断当前党组织的类型是否是所选上级党组织类型的直接下级 * @return void
* @author wangtong * @describe: 判断当前党组织的类型是否是所选上级党组织类型的直接下级
* @date 2022/5/25 10:09 * @author wangtong
* @params [parentOrg, partyOrgType] * @date 2022/5/25 10:09
* @return void * @params [parentOrg, partyOrgType]
*/ */
private void checkOrgType(String parentOrgType, String partyOrgType) { private void checkOrgType(String parentOrgType, String partyOrgType) {
if(PartyOrgTypeEnum.BRANCH.getCode().equals(partyOrgType) && !PartyOrgTypeEnum.PARTY.getCode().equals(parentOrgType)){ if (PartyOrgTypeEnum.BRANCH.getCode().equals(partyOrgType) && !PartyOrgTypeEnum.PARTY.getCode().equals(parentOrgType)) {
throw new EpmetException("请保持上级党组织的类型与当前党组织类型为直接的上下级关系,选择党委作为上级组织!"); throw new EpmetException("请保持上级党组织的类型与当前党组织类型为直接的上下级关系,选择党委作为上级组织!");
}else if(PartyOrgTypeEnum.PARTY.getCode().equals(partyOrgType) && !PartyOrgTypeEnum.WORKING.getCode().equals(parentOrgType)){ } else if (PartyOrgTypeEnum.PARTY.getCode().equals(partyOrgType) && !PartyOrgTypeEnum.WORKING.getCode().equals(parentOrgType)) {
throw new EpmetException("请保持上级党组织的类型与当前党组织类型为直接的上下级关系,选择党工委作为上级组织!"); throw new EpmetException("请保持上级党组织的类型与当前党组织类型为直接的上下级关系,选择党工委作为上级组织!");
}else if(PartyOrgTypeEnum.WORKING.getCode().equals(partyOrgType) && !PartyOrgTypeEnum.DISTRICT.getCode().equals(parentOrgType)){ } else if (PartyOrgTypeEnum.WORKING.getCode().equals(partyOrgType) && !PartyOrgTypeEnum.DISTRICT.getCode().equals(parentOrgType)) {
throw new EpmetException("请保持上级党组织的类型与当前党组织类型为直接的上下级关系,选择区委作为上级组织!"); throw new EpmetException("请保持上级党组织的类型与当前党组织类型为直接的上下级关系,选择区委作为上级组织!");
}else if(PartyOrgTypeEnum.DISTRICT.getCode().equals(partyOrgType) && !PartyOrgTypeEnum.MUNICIPAL.getCode().equals(parentOrgType)){ } else if (PartyOrgTypeEnum.DISTRICT.getCode().equals(partyOrgType) && !PartyOrgTypeEnum.MUNICIPAL.getCode().equals(parentOrgType)) {
throw new EpmetException("请保持上级党组织的类型与当前党组织类型为直接的上下级关系,选择市委作为上级组织!"); throw new EpmetException("请保持上级党组织的类型与当前党组织类型为直接的上下级关系,选择市委作为上级组织!");
}else if(PartyOrgTypeEnum.MUNICIPAL.getCode().equals(partyOrgType) && !PartyOrgTypeEnum.PROVINCIAL.getCode().equals(parentOrgType)){ } else if (PartyOrgTypeEnum.MUNICIPAL.getCode().equals(partyOrgType) && !PartyOrgTypeEnum.PROVINCIAL.getCode().equals(parentOrgType)) {
throw new EpmetException("请保持上级党组织的类型与当前党组织类型为直接的上下级关系,选择省委作为上级组织!"); throw new EpmetException("请保持上级党组织的类型与当前党组织类型为直接的上下级关系,选择省委作为上级组织!");
} }
} }
/** /**
* @describe: 判断该所选的行政组织类型是否与当前党组织的类型一致 * @return void
* @author wangtong * @describe: 判断该所选的行政组织类型是否与当前党组织的类型一致
* @date 2022/5/25 9:45 * @author wangtong
* @params [agencyLevel, partyOrgType] * @date 2022/5/25 9:45
* @return void * @params [agencyLevel, partyOrgType]
*/ */
private void checnAgencyLevel(String agencyLevel, String partyOrgType) { private void checnAgencyLevel(String agencyLevel, String partyOrgType) {
if(PartyOrgTypeEnum.PROVINCIAL.getCode().equals(partyOrgType) && !OrgLevelEnums.PROVINCE.getLevel().equals(agencyLevel)){ if (PartyOrgTypeEnum.PROVINCIAL.getCode().equals(partyOrgType) && !OrgLevelEnums.PROVINCE.getLevel().equals(agencyLevel)) {
throw new EpmetException("请保持党组织类型与行政组织类型一致,选择省级的行政组织!"); throw new EpmetException("请保持党组织类型与行政组织类型一致,选择省级的行政组织!");
}else if(PartyOrgTypeEnum.MUNICIPAL.getCode().equals(partyOrgType) && !OrgLevelEnums.CITY.getLevel().equals(agencyLevel)){ } else if (PartyOrgTypeEnum.MUNICIPAL.getCode().equals(partyOrgType) && !OrgLevelEnums.CITY.getLevel().equals(agencyLevel)) {
throw new EpmetException("请保持党组织类型与行政组织类型一致,选择市级的行政组织!"); throw new EpmetException("请保持党组织类型与行政组织类型一致,选择市级的行政组织!");
}else if(PartyOrgTypeEnum.DISTRICT.getCode().equals(partyOrgType) && !OrgLevelEnums.DISTRICT.getLevel().equals(agencyLevel)){ } else if (PartyOrgTypeEnum.DISTRICT.getCode().equals(partyOrgType) && !OrgLevelEnums.DISTRICT.getLevel().equals(agencyLevel)) {
throw new EpmetException("请保持党组织类型与行政组织类型一致,选择区级的行政组织!"); throw new EpmetException("请保持党组织类型与行政组织类型一致,选择区级的行政组织!");
}else if(PartyOrgTypeEnum.WORKING.getCode().equals(partyOrgType) && !OrgLevelEnums.STREET.getLevel().equals(agencyLevel)){ } else if (PartyOrgTypeEnum.WORKING.getCode().equals(partyOrgType) && !OrgLevelEnums.STREET.getLevel().equals(agencyLevel)) {
throw new EpmetException("请保持党组织类型与行政组织类型一致,选择街道级的行政组织!"); throw new EpmetException("请保持党组织类型与行政组织类型一致,选择街道级的行政组织!");
}else if(PartyOrgTypeEnum.PARTY.getCode().equals(partyOrgType) && !OrgLevelEnums.COMMUNITY.getLevel().equals(agencyLevel)){ } else if (PartyOrgTypeEnum.PARTY.getCode().equals(partyOrgType) && !OrgLevelEnums.COMMUNITY.getLevel().equals(agencyLevel)) {
throw new EpmetException("请保持党组织类型与行政组织类型一致,选择社区级的行政组织!"); throw new EpmetException("请保持党组织类型与行政组织类型一致,选择社区级的行政组织!");
} }
} }
@ -192,15 +199,15 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl<IcPartyOrgDao, IcPart
public void delete(String[] ids) { public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解) // 逻辑删除(@TableLogic 注解)
// baseDao.deleteBatchIds(Arrays.asList(ids)); // baseDao.deleteBatchIds(Arrays.asList(ids));
for(String id : ids){ for (String id : ids) {
//判断该组织是否有下级党组织 //判断该组织是否有下级党组织
List<IcPartyOrgEntity> orgList = baseDao.selectAllByOrgId(id); List<IcPartyOrgEntity> orgList = baseDao.selectAllByOrgId(id);
if(!CollectionUtils.isEmpty(orgList)){ if (!CollectionUtils.isEmpty(orgList)) {
throw new EpmetException("请先删除下级党组织!"); throw new EpmetException("请先删除下级党组织!");
} }
//判断该组织下是否有党员 //判断该组织下是否有党员
List<IcPartyMemberEntity> memberList = icPartyMemberDao.selectAllByOrgId(id); List<IcPartyMemberEntity> memberList = icPartyMemberDao.selectAllByOrgId(id);
if(!CollectionUtils.isEmpty(memberList)){ if (!CollectionUtils.isEmpty(memberList)) {
throw new EpmetException("该组织下有党员信息暂时不可删除!"); throw new EpmetException("该组织下有党员信息暂时不可删除!");
} }
baseDao.deleteById(id); baseDao.deleteById(id);
@ -215,15 +222,15 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl<IcPartyOrgDao, IcPart
@Override @Override
public Result<List<BranchlistTreeDTO>> branchlist(TokenDto tokenDto) { public Result<List<BranchlistTreeDTO>> branchlist(TokenDto tokenDto) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(),tokenDto.getUserId()); CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
List<BranchlistTreeDTO> resultList = new ArrayList<>(); List<BranchlistTreeDTO> resultList = new ArrayList<>();
BranchlistTreeDTO result = new BranchlistTreeDTO(); BranchlistTreeDTO result = new BranchlistTreeDTO();
result.setValue(staffInfo.getAgencyId()); result.setValue(staffInfo.getAgencyId());
// result.setOrgPids(staffInfo.getAgencyPIds()); // result.setOrgPids(staffInfo.getAgencyPIds());
result.setLabel(staffInfo.getAgencyName()); result.setLabel(staffInfo.getAgencyName());
//该行政组织下的所有类型为支部的党组织 //该行政组织下的所有类型为支部的党组织
List<BranchlistTreeSubDTO> orgList = baseDao.selectAllBranchByAgencyId(staffInfo.getAgencyId(),tokenDto.getCustomerId()); List<BranchlistTreeSubDTO> orgList = baseDao.selectAllBranchByAgencyId(staffInfo.getAgencyId(), tokenDto.getCustomerId());
if(CollectionUtils.isEmpty(orgList)){ if (CollectionUtils.isEmpty(orgList)) {
return new Result<List<BranchlistTreeDTO>>().ok(resultList); return new Result<List<BranchlistTreeDTO>>().ok(resultList);
} }
result.setChildren(orgList); result.setChildren(orgList);
@ -231,6 +238,38 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl<IcPartyOrgDao, IcPart
return new Result<List<BranchlistTreeDTO>>().ok(resultList); return new Result<List<BranchlistTreeDTO>>().ok(resultList);
} }
@Override
public Result<List<IcPartyOrgTreeDTO>> getSearchTreelist(PartyOrgTreeListDTO formDTO) {
List<IcPartyOrgTreeDTO> list = baseDao.getSearchTreelist(formDTO);
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(formDTO.getAgencyId(),null,formDTO.getCustomerId(),PartyOrgTypeEnum.PARTY.getCode()));
}else{
//查询该行政组织对应上级所关联的党组织(单个实体类)
list.addAll(baseDao.selectParentOrgByAgencyPid(null,agencyPid,formDTO.getCustomerId(),null));
}
return new Result<List<IcPartyOrgTreeDTO>>().ok(list);
}
/** /**
* 构建树节点 * 构建树节点
*/ */
@ -239,13 +278,13 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl<IcPartyOrgDao, IcPart
//list转map //list转map
Map<String, IcPartyOrgTreeDTO> nodeMap = new LinkedHashMap<>(treeNodes.size()); Map<String, IcPartyOrgTreeDTO> nodeMap = new LinkedHashMap<>(treeNodes.size());
for(IcPartyOrgTreeDTO treeNode : treeNodes){ for (IcPartyOrgTreeDTO treeNode : treeNodes) {
nodeMap.put(treeNode.getId(), treeNode); nodeMap.put(treeNode.getId(), treeNode);
} }
for(IcPartyOrgTreeDTO node : nodeMap.values()) { for (IcPartyOrgTreeDTO node : nodeMap.values()) {
IcPartyOrgTreeDTO parent = nodeMap.get(node.getPid()); IcPartyOrgTreeDTO parent = nodeMap.get(node.getPid());
if(parent != null && !(node.getId().equals(parent.getId()))){ if (parent != null && !(node.getId().equals(parent.getId()))) {
parent.getChildren().add(node); parent.getChildren().add(node);
continue; continue;
} }

6
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberController.java

@ -112,6 +112,12 @@ public class IcPartyMemberController implements ResultDataResolver {
return new Result(); return new Result();
} }
@PostMapping("getPartyMemberByIdCard")
public Result<IcPartyMemberDTO> getPartyMemberByIdCard(@RequestBody IcPartyMemberDTO dto){
IcPartyMemberDTO result = icPartyMemberService.getPartyMemberByIdCard(dto);
return new Result<IcPartyMemberDTO>().ok(result);
}
@NoRepeatSubmit @NoRepeatSubmit
@PostMapping("export") @PostMapping("export")
public void export(@LoginUser TokenDto tokenDto, @RequestBody IcPartyMemberFromDTO formDTO, HttpServletResponse response) throws Exception { public void export(@LoginUser TokenDto tokenDto, @RequestBody IcPartyMemberFromDTO formDTO, HttpServletResponse response) throws Exception {

1
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPayRecordDetailController.java

@ -52,6 +52,7 @@ public class IcPartyMemberPayRecordDetailController {
@RequestMapping("page") @RequestMapping("page")
public Result<PageData<IcPartyMemberPayRecordDetailDTO>> page(@LoginUser TokenDto tokenDto, @RequestParam Map<String, Object> params){ public Result<PageData<IcPartyMemberPayRecordDetailDTO>> page(@LoginUser TokenDto tokenDto, @RequestParam Map<String, Object> params){
params.put("customerId",tokenDto.getCustomerId()); params.put("customerId",tokenDto.getCustomerId());
params.put("userId",tokenDto.getUserId());
// PageData<IcPartyMemberPayRecordDetailDTO> page = icPartyMemberPayRecordDetailService.page(params); // PageData<IcPartyMemberPayRecordDetailDTO> page = icPartyMemberPayRecordDetailService.page(params);
PageData<IcPartyMemberPayRecordDetailDTO> page = icPartyMemberPayRecordDetailService.getPhrasePage(params); PageData<IcPartyMemberPayRecordDetailDTO> page = icPartyMemberPayRecordDetailService.getPhrasePage(params);
return new Result<PageData<IcPartyMemberPayRecordDetailDTO>>().ok(page); return new Result<PageData<IcPartyMemberPayRecordDetailDTO>>().ok(page);

8
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPointController.java

@ -105,8 +105,8 @@ public class IcPartyMemberPointController {
@PostMapping("export") @PostMapping("export")
public void export(@RequestBody PartyMemberPointListFormDTO formDto, @LoginUser TokenDto tokenDto, HttpServletResponse response) throws Exception { public void export(@RequestBody PartyMemberPointListFormDTO formDto, @LoginUser TokenDto tokenDto, HttpServletResponse response) throws Exception {
formDto.setIsPage(false);
formDto.setPageSize(NumConstant.TEN_THOUSAND); formDto.setLimit(NumConstant.TEN_THOUSAND);
ExcelWriter excelWriter = null; ExcelWriter excelWriter = null;
AtomicInteger i = new AtomicInteger(1); AtomicInteger i = new AtomicInteger(1);
@ -123,8 +123,8 @@ public class IcPartyMemberPointController {
item.setIndex(i.getAndIncrement()); item.setIndex(i.getAndIncrement());
}); });
excelWriter.write(list, writeSheet); excelWriter.write(list, writeSheet);
formDto.setPageNo(formDto.getPageNo() + NumConstant.ONE); formDto.setPage(formDto.getPage() + NumConstant.ONE);
} while (CollectionUtils.isNotEmpty(page.getList()) && page.getList().size() == formDto.getPageSize()); } while (CollectionUtils.isNotEmpty(page.getList()) && page.getList().size() == formDto.getLimit());
} catch (EpmetException e) { } catch (EpmetException e) {
response.reset(); response.reset();
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");

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

@ -47,4 +47,6 @@ public interface IcPartyMemberPointDao extends BaseDao<IcPartyMemberPointEntity>
@Param("quarter") String quarter, @Param("quarter") String quarter,
@Param("customerId") String customerId, @Param("customerId") String customerId,
@Param("partyMemberId") String partyMemberId); @Param("partyMemberId") String partyMemberId);
void updateByPartyMemberId(@Param("entity") IcPartyMemberPointEntity entity);
} }

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

@ -85,6 +85,16 @@ public interface IcPartyMemberService extends BaseService<IcPartyMemberEntity> {
*/ */
void delete(String[] ids); void delete(String[] ids);
/**
* 根据身份证获取党员信息
*
* @Param dto
* @Return {@link IcPartyMemberDTO}
* @Author zhaoqifeng
* @Date 2022/6/9 10:07
*/
IcPartyMemberDTO getPartyMemberByIdCard(IcPartyMemberDTO dto);
/** /**
* 党员信息同步 * 党员信息同步
* *

42
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPayRecordDetailServiceImpl.java

@ -4,30 +4,29 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
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.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.modules.partyOrg.dao.IcPartyOrgDao;
import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity;
import com.epmet.modules.partymember.dao.IcPartyMemberPayRecordDetailDao; import com.epmet.modules.partymember.dao.IcPartyMemberPayRecordDetailDao;
import com.epmet.modules.partymember.entity.IcPartyMemberPayRecordDetailEntity; import com.epmet.modules.partymember.entity.IcPartyMemberPayRecordDetailEntity;
import com.epmet.modules.partymember.entity.IcPartymemberStyleCategoryDictEntity;
import com.epmet.modules.partymember.entity.IcPartymemberStyleEntity;
import com.epmet.modules.partymember.redis.IcPartyMemberPayRecordDetailRedis; import com.epmet.modules.partymember.redis.IcPartyMemberPayRecordDetailRedis;
import com.epmet.modules.partymember.service.IcPartyMemberPayRecordDetailService; import com.epmet.modules.partymember.service.IcPartyMemberPayRecordDetailService;
import com.epmet.resi.partymember.dto.partymember.IcPartyMemberPayRecordDetailDTO; import com.epmet.resi.partymember.dto.partymember.IcPartyMemberPayRecordDetailDTO;
import com.epmet.resi.partymember.dto.partymember.IcPartymemberStyleDTO;
import com.epmet.resi.partymember.dto.partymember.form.IcPartyMemberPayRecordDetailFormDTO;
import com.epmet.resi.partymember.dto.partymember.form.PartyMemberStyleFormDTO;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -42,6 +41,8 @@ public class IcPartyMemberPayRecordDetailServiceImpl extends BaseServiceImpl<IcP
@Autowired @Autowired
private IcPartyMemberPayRecordDetailRedis icPartyMemberPayRecordDetailRedis; private IcPartyMemberPayRecordDetailRedis icPartyMemberPayRecordDetailRedis;
@Resource
private IcPartyOrgDao icPartyOrgDao;
@Override @Override
public PageData<IcPartyMemberPayRecordDetailDTO> page(Map<String, Object> params) { public PageData<IcPartyMemberPayRecordDetailDTO> page(Map<String, Object> params) {
@ -59,6 +60,25 @@ public class IcPartyMemberPayRecordDetailServiceImpl extends BaseServiceImpl<IcP
*/ */
@Override @Override
public PageData<IcPartyMemberPayRecordDetailDTO> getPhrasePage(Map<String, Object> params) { public PageData<IcPartyMemberPayRecordDetailDTO> getPhrasePage(Map<String, Object> params) {
String customerId = (String) params.get("customerId");
String userId = (String) params.get("userId");
String orgId = (String) params.get("orgId");
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, userId);
if (null == staffInfo) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取工作人员信息失败", "获取工作人员信息失败");
}
if (StringUtils.isBlank(orgId)) {
//获取工作人员所属组织同级的党组织
LambdaQueryWrapper<IcPartyOrgEntity> orgWrapper = new LambdaQueryWrapper<>();
orgWrapper.eq(IcPartyOrgEntity::getCustomerId, customerId);
orgWrapper.eq(IcPartyOrgEntity::getAgencyId, staffInfo.getAgencyId());
orgWrapper.ne(IcPartyOrgEntity::getPartyOrgType, NumConstant.FIVE_STR);
IcPartyOrgEntity org = icPartyOrgDao.selectOne(orgWrapper);
if (null == org) {
return new PageData<>(Collections.emptyList(), 0);
}
params.put("orgId",org.getId());
}
IPage<IcPartyMemberPayRecordDetailDTO> page = getPage(params); IPage<IcPartyMemberPayRecordDetailDTO> page = getPage(params);
List<IcPartyMemberPayRecordDetailDTO> list = baseDao.selectListInfo(params); List<IcPartyMemberPayRecordDetailDTO> list = baseDao.selectListInfo(params);
return new PageData<>(list, page.getTotal()); return new PageData<>(list, page.getTotal());

12
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPointServiceImpl.java

@ -14,13 +14,9 @@ import com.epmet.modules.partymember.entity.IcPartyMemberPointEntity;
import com.epmet.modules.partymember.redis.IcPartyMemberPointRedis; import com.epmet.modules.partymember.redis.IcPartyMemberPointRedis;
import com.epmet.modules.partymember.service.IcPartyMemberPointService; import com.epmet.modules.partymember.service.IcPartyMemberPointService;
import com.epmet.resi.partymember.dto.partymember.IcPartyMemberPointDTO; import com.epmet.resi.partymember.dto.partymember.IcPartyMemberPointDTO;
import com.epmet.resi.partymember.dto.partymember.PartyMemberPointListCountDTO;
import com.epmet.resi.partymember.dto.partymember.form.PartyMemberExportFormDTO;
import com.epmet.resi.partymember.dto.partymember.form.PartyMemberPointEchoFormDTO; import com.epmet.resi.partymember.dto.partymember.form.PartyMemberPointEchoFormDTO;
import com.epmet.resi.partymember.dto.partymember.form.PartyMemberPointListFormDTO; import com.epmet.resi.partymember.dto.partymember.form.PartyMemberPointListFormDTO;
import com.epmet.resi.partymember.dto.partymember.result.IcPartyMemberResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointEchoResultDTO; import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointEchoResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointExportResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointListResultDTO; import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointListResultDTO;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
@ -29,10 +25,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.sql.Time;
import java.time.Year; import java.time.Year;
import java.util.Arrays; import java.util.Arrays;
import java.util.Calendar;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -135,7 +129,7 @@ public class IcPartyMemberPointServiceImpl extends BaseServiceImpl<IcPartyMember
if (dto.getYear().equals(Year.now().toString())) { if (dto.getYear().equals(Year.now().toString())) {
baseDao.updateMember(dto.getPartyMemberId(), dto.getTotalScore()); baseDao.updateMember(dto.getPartyMemberId(), dto.getTotalScore());
} }
updateById(entity); baseDao.updateByPartyMemberId(entity);
} else { } else {
save(dto); save(dto);
} }
@ -160,7 +154,7 @@ public class IcPartyMemberPointServiceImpl extends BaseServiceImpl<IcPartyMember
*/ */
@Override @Override
public PageData<PartyMemberPointListResultDTO> getList(PartyMemberPointListFormDTO form, TokenDto tokenDto) { public PageData<PartyMemberPointListResultDTO> getList(PartyMemberPointListFormDTO form, TokenDto tokenDto) {
PageHelper.startPage(form.getPageNo(), form.getPageSize(), form.getIsPage()); PageHelper.startPage(form.getPage(), form.getLimit());
List<PartyMemberPointListResultDTO> dto = baseDao.getList(form.getIdCard(), form.getMobile(), form.getName(), List<PartyMemberPointListResultDTO> dto = baseDao.getList(form.getIdCard(), form.getMobile(), form.getName(),
form.getOrgId(), form.getYear(), tokenDto.getCustomerId()); form.getOrgId(), form.getYear(), tokenDto.getCustomerId());
PageInfo<PartyMemberPointListResultDTO> pageInfo = new PageInfo<>(dto); PageInfo<PartyMemberPointListResultDTO> pageInfo = new PageInfo<>(dto);
@ -191,7 +185,7 @@ public class IcPartyMemberPointServiceImpl extends BaseServiceImpl<IcPartyMember
*/ */
@Override @Override
public PageData<PartyMemberPointListResultDTO> getExport(PartyMemberPointListFormDTO form, TokenDto tokenDto) { public PageData<PartyMemberPointListResultDTO> getExport(PartyMemberPointListFormDTO form, TokenDto tokenDto) {
PageHelper.startPage(form.getPageNo(), form.getPageSize(), form.getIsPage()); PageHelper.startPage(form.getPage(), form.getLimit());
List<PartyMemberPointListResultDTO> dto = baseDao.getList(form.getIdCard(), form.getMobile(), form.getName(), List<PartyMemberPointListResultDTO> dto = baseDao.getList(form.getIdCard(), form.getMobile(), form.getName(),
form.getOrgId(), form.getYear(), tokenDto.getCustomerId()); form.getOrgId(), form.getYear(), tokenDto.getCustomerId());
PageInfo<PartyMemberPointListResultDTO> pageInfo = new PageInfo<>(dto); PageInfo<PartyMemberPointListResultDTO> pageInfo = new PageInfo<>(dto);

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

@ -121,7 +121,9 @@ public class IcPartyMemberServiceImpl extends BaseServiceImpl<IcPartyMemberDao,
formDTO.setPartyOrgId(org.getId()); formDTO.setPartyOrgId(org.getId());
} }
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setYear(DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYY)); String date = DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMM);
formDTO.setYear(date.substring(0, 4));
formDTO.setMonth(date.substring(4, 6));
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage());
List<IcPartyMemberResultDTO> list = baseDao.selectList(formDTO); List<IcPartyMemberResultDTO> list = baseDao.selectList(formDTO);
@ -331,6 +333,24 @@ public class IcPartyMemberServiceImpl extends BaseServiceImpl<IcPartyMemberDao,
icPartyMemberPointDao.delete(pointWrapper); icPartyMemberPointDao.delete(pointWrapper);
} }
/**
* 根据身份证获取党员信息
*
* @param dto
* @Param dto
* @Return {@link IcPartyMemberDTO}
* @Author zhaoqifeng
* @Date 2022/6/9 10:07
*/
@Override
public IcPartyMemberDTO getPartyMemberByIdCard(IcPartyMemberDTO dto) {
LambdaQueryWrapper<IcPartyMemberEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcPartyMemberEntity::getCustomerId, dto.getCustomerId());
wrapper.eq(IcPartyMemberEntity::getIdCard, dto.getIdCard());
IcPartyMemberEntity partyMember = baseDao.selectOne(wrapper);
return ConvertUtils.sourceToTarget(partyMember, IcPartyMemberDTO.class);
}
/** /**
* 党员信息同步 * 党员信息同步
* *
@ -361,6 +381,21 @@ public class IcPartyMemberServiceImpl extends BaseServiceImpl<IcPartyMemberDao,
dto.setOrgPids(org.getOrgPids()); dto.setOrgPids(org.getOrgPids());
} }
IcPartyMemberEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyMemberEntity.class); IcPartyMemberEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyMemberEntity.class);
int age = IDCardUtil.getAge(entity.getIdCard());
if (age >= 70) {
entity.setIsMxx(NumConstant.ONE_STR);
} else {
entity.setIsMxx(NumConstant.ZERO_STR);
}
if (StringUtils.isBlank(entity.getIsLd())) {
entity.setIsLd(NumConstant.ZERO_STR);
}
if (StringUtils.isBlank(entity.getIsDyzxh())) {
entity.setIsDyzxh(NumConstant.ZERO_STR);
}
if (StringUtils.isBlank(entity.getIsTx())) {
entity.setIsTx(NumConstant.ZERO_STR);
}
//判断党员是否已存在,有则更新,没有则添加 //判断党员是否已存在,有则更新,没有则添加
if (null != partyMember) { if (null != partyMember) {

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

@ -96,6 +96,55 @@
AND (AGENCY_ID = #{agencyId} or AGENCY_PIDS LIKE concat('%',#{agencyId}, '%' )) AND (AGENCY_ID = #{agencyId} or AGENCY_PIDS LIKE concat('%',#{agencyId}, '%' ))
</if> </if>
</select> </select>
<select id="getSearchTreelist"
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}
<if test="agencyId != null and agencyId != ''">
AND( AGENCY_PIDS LIKE concat('%',#{agencyId}, '%' )
or
(PARTY_ORG_TYPE = '5' and AGENCY_ID=#{agencyId}))
</if>
</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}
<if test="agencyId != null and agencyId != ''">
AND (AGENCY_ID = #{agencyId} or AGENCY_PIDS LIKE concat('%',#{agencyId}, '%' ))
</if>
<if test="agencyPid != null and agencyPid != ''">
and AGENCY_ID=#{agencyPid}
</if>
<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>
</mapper> </mapper>

4
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberDao.xml

@ -51,7 +51,7 @@
a.LDZH, a.LDZH,
a.PARTY_ZW, a.PARTY_ZW,
a.ADDRESS, a.ADDRESS,
IF( b.PAY_DATE IS NULL, 0, 1 ) AS isPay, IF( e.MONEY IS NULL, 0, 1 ) AS isPay,
b.PAY_DATE, b.PAY_DATE,
a.CULTURE, a.CULTURE,
a.TOTAL_SCORE AS point, a.TOTAL_SCORE AS point,
@ -73,6 +73,8 @@
AND b.CUSTOMER_ID = #{customerId} AND b.CUSTOMER_ID = #{customerId}
INNER JOIN ic_party_org d ON a.SSZB = d.ID INNER JOIN ic_party_org d ON a.SSZB = d.ID
AND d.DEL_FLAG = 0 AND d.DEL_FLAG = 0
LEFT JOIN ic_party_member_pay_record_detail e ON a.ID = e.PARTY_MEMBER_ID
AND e.DEL_FLAG = 0 AND e.`YEAR` = #{year} AND e.`MONTH` = #{month}
WHERE WHERE
a.DEL_FLAG = 0 a.DEL_FLAG = 0
AND a.CUSTOMER_ID = #{customerId} AND a.CUSTOMER_ID = #{customerId}

4
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPayRecordDetailDao.xml

@ -33,6 +33,7 @@
left join ic_party_org org on org.ID = pm.SSZB and org.DEL_FLAG = 0 left join ic_party_org org on org.ID = pm.SSZB and org.DEL_FLAG = 0
where prd.DEL_FLAG = 0 where prd.DEL_FLAG = 0
and prd.CUSTOMER_ID = #{customerId} and prd.CUSTOMER_ID = #{customerId}
AND (pm.SSZB = #{orgId} OR pm.ORG_PIDS LIKE concat('%', #{orgId}, '%'))
<if test='name != "" and name != null'> <if test='name != "" and name != null'>
and pm.NAME like concat('%',#{name},'%') and pm.NAME like concat('%',#{name},'%')
</if> </if>
@ -42,9 +43,6 @@
<if test='idCard != "" and idCard != null'> <if test='idCard != "" and idCard != null'>
and pm.ID_CARD like concat('%',#{idCard},'%') and pm.ID_CARD like concat('%',#{idCard},'%')
</if> </if>
<if test='orgId != "" and orgId != null'>
and FIND_IN_SET(#{orgId},pm.ORG_PIDS)
</if>
<if test='year != "" and year != null'> <if test='year != "" and year != null'>
and prd.YEAR = #{year} and prd.YEAR = #{year}
</if> </if>

33
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPointDao.xml

@ -8,6 +8,23 @@
WHERE WHERE
id = #{partyMemberId} id = #{partyMemberId}
</update> </update>
<update id="updateByPartyMemberId">
UPDATE ic_party_member_point
SET BASE_POINT = #{entity.basePoint},
BASE_OPTIONS = #{entity.baseOptions},
REVIEW_POINT = #{entity.reviewPoint},
REVIEW_OPTIONS = #{entity.reviewOptions},
INSPIRE_POINT = #{entity.inspirePoint},
INSPIRE_OPTIONS = #{entity.inspireOptions},
WARN_POINT = #{entity.warnPoint},
WARN_OPTIONS = #{entity.warnOptions}
WHERE
DEL_FLAG = '0'
AND PARTY_MEMBER_ID = #{entity.partyMemberId}
AND YEAR = #{entity.year}
AND QUARTER = #{entity.quarter}
AND CUSTOMER_ID = #{entity.customerId}
</update>
<select id="getList" <select id="getList"
@ -21,18 +38,16 @@
u.MOBILE, u.MOBILE,
u.ID_CARD, u.ID_CARD,
u.REMARK, u.REMARK,
sum( a.BASE_POINT ) AS BasePoint, AVG( a.BASE_POINT ) AS BasePoint,
sum( a.REVIEW_POINT ) AS reviewPoint, AVG( a.REVIEW_POINT ) AS reviewPoint,
sum( a.INSPIRE_POINT ) AS inspirePoint, AVG( a.INSPIRE_POINT ) AS inspirePoint,
sum( a.WARN_POINT ) AS warnPoint AVG( a.WARN_POINT ) AS warnPoint
FROM FROM
ic_party_member_point a ic_party_member_point a
LEFT JOIN ic_party_member u ON a.PARTY_MEMBER_ID = u.id LEFT JOIN ic_party_member u ON a.PARTY_MEMBER_ID = u.id
AND a.DEL_FLAG = '0' LEFT JOIN ic_party_org c ON c.id = u.sszb
LEFT JOIN ic_party_org c ON c.id = u.sszb
AND c.DEL_FLAG = '0'
<where> <where>
u.DEL_FLAG = '0' u.DEL_FLAG = '0' AND a.DEL_FLAG = '0' AND c.DEL_FLAG = '0'
AND u.CUSTOMER_ID = #{customerId} AND u.CUSTOMER_ID = #{customerId}
<if test="name != null and name != ''"> <if test="name != null and name != ''">
AND u.NAME = #{name} AND u.NAME = #{name}

8
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserRoleResultDTO.java

@ -3,6 +3,8 @@ package com.epmet.dto.result;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.List;
import java.util.Map;
/** /**
* @Description * @Description
@ -16,4 +18,10 @@ public class IcUserRoleResultDTO implements Serializable {
* 是否是志愿者0否1是 * 是否是志愿者0否1是
*/ */
private String isVolunteer; private String isVolunteer;
/**
* 是否是党员0否1是
*/
private String isPartyMember;
private Map<String, List<Map<String, Object>>> detail;
} }

49
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -269,6 +269,18 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
//2022.04.19 end //2022.04.19 end
//2022.05.18 start zhaoqf 党员信息同步 //2022.05.18 start zhaoqf 党员信息同步
if (map.containsKey("IS_PARTY") && NumConstant.ONE_STR.equals(map.get("IS_PARTY"))) { if (map.containsKey("IS_PARTY") && NumConstant.ONE_STR.equals(map.get("IS_PARTY"))) {
if (formMap.containsKey("ic_party_member")) {
for (LinkedHashMap<String, String> hash : formMap.get("ic_party_member")) {
if (!hash.containsKey("SSZB")) {
String errorMsg = "党员信息所属支部不能为空";
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg);
}
}
} else {
String errorMsg = "党员信息所属支部不能为空";
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg);
}
partyMemberDTO.setCustomerId(tokenDto.getCustomerId()); partyMemberDTO.setCustomerId(tokenDto.getCustomerId());
partyMemberDTO.setAgencyId(agencyId); partyMemberDTO.setAgencyId(agencyId);
partyMemberDTO.setAgencyPids(result.getData().getPids()); partyMemberDTO.setAgencyPids(result.getData().getPids());
@ -291,6 +303,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
.concat(StrConstant.HYPHEN).concat(houseInfo.getNeighborHoodName()) .concat(StrConstant.HYPHEN).concat(houseInfo.getNeighborHoodName())
.concat(StrConstant.HYPHEN).concat(houseInfo.getHouseName()); .concat(StrConstant.HYPHEN).concat(houseInfo.getHouseName());
} }
partyMemberDTO.setAddress(address);
} }
} }
//2022.05.18 end zhaoqf //2022.05.18 end zhaoqf
@ -470,6 +483,19 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
resiUserId = map.get("ID"); resiUserId = map.get("ID");
//2022.05.18 start zhaoqf 党员信息同步 //2022.05.18 start zhaoqf 党员信息同步
IcResiUserEntity icResiUser = baseDao.selectById(resiUserId); IcResiUserEntity icResiUser = baseDao.selectById(resiUserId);
if ((map.containsKey("IS_PARTY") && NumConstant.ONE_STR.equals(map.get("IS_PARTY")))) {
if (formMap.containsKey("ic_party_member")) {
for (LinkedHashMap<String, String> hash : formMap.get("ic_party_member")) {
if (!hash.containsKey("ID") && !hash.containsKey("SSZB")) {
String errorMsg = "党员信息所属支部不能为空";
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg);
}
}
} else {
String errorMsg = "党员信息所属支部不能为空";
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg);
}
}
if ((map.containsKey("IS_PARTY") && NumConstant.ONE_STR.equals(map.get("IS_PARTY"))) if ((map.containsKey("IS_PARTY") && NumConstant.ONE_STR.equals(map.get("IS_PARTY")))
|| (!map.containsKey("IS_PARTY") && NumConstant.ONE_STR.equals(icResiUser.getIsParty()))) { || (!map.containsKey("IS_PARTY") && NumConstant.ONE_STR.equals(icResiUser.getIsParty()))) {
partyMemberDTO.setCustomerId(tokenDto.getCustomerId()); partyMemberDTO.setCustomerId(tokenDto.getCustomerId());
@ -2460,7 +2486,9 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
@Override @Override
public IcUserRoleResultDTO getUserRoleByIdCard(IcResiUserDTO formDTO) { public IcUserRoleResultDTO getUserRoleByIdCard(IcResiUserDTO formDTO) {
IcUserRoleResultDTO result = new IcUserRoleResultDTO(); IcUserRoleResultDTO result = new IcUserRoleResultDTO();
Map<String, List<Map<String, Object>>> detail = new HashMap<>();
result.setIsVolunteer(NumConstant.ZERO_STR); result.setIsVolunteer(NumConstant.ZERO_STR);
result.setIsPartyMember(NumConstant.ZERO_STR);
//根据身份证获取小程序端居民信息 //根据身份证获取小程序端居民信息
LambdaQueryWrapper<UserBaseInfoEntity> baseInfoWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<UserBaseInfoEntity> baseInfoWrapper = new LambdaQueryWrapper<>();
baseInfoWrapper.eq(UserBaseInfoEntity::getCustomerId, formDTO.getCustomerId()); baseInfoWrapper.eq(UserBaseInfoEntity::getCustomerId, formDTO.getCustomerId());
@ -2480,7 +2508,26 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
} }
} }
} }
//获取党员信息
com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO memberFormDTO = new com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO();
memberFormDTO.setCustomerId(formDTO.getCustomerId());
memberFormDTO.setIdCard(formDTO.getIdCard());
Result<com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO> memberInfoResult = resiPartyMemberOpenFeignClient.getPartyMemberByIdCard(memberFormDTO);
if (memberInfoResult.success() && null != memberInfoResult.getData()) {
List<Map<String, Object>> list = new ArrayList<>();
Map<String, Object> memberMap = new HashMap<>();
result.setIsPartyMember(NumConstant.ONE_STR);
com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO dto = memberInfoResult.getData();
memberMap.put("RDSJ", dto.getRdsj());
memberMap.put("SSZB", dto.getSszb());
memberMap.put("IS_LD", dto.getIsLd());
memberMap.put("LDZH", dto.getLdzh());
memberMap.put("PARTY_ZW", dto.getPartyZw());
memberMap.put("IS_DYZXH", dto.getIsDyzxh());
list.add(memberMap);
detail.put("ic_party_member", list);
}
result.setDetail(detail);
return result; return result;
} }

2
epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml

@ -97,7 +97,7 @@
p.CUSTOMER_ID = #{customerId} and c.VOLUNTEER_CATEGORY is not null p.CUSTOMER_ID = #{customerId} and c.VOLUNTEER_CATEGORY is not null
AND AND
c.VOLUNTEER_CATEGORY != '' c.VOLUNTEER_CATEGORY != ''
AND p.AGENCY_ID = #{agencyId} AND ( p.AGENCY_ID = #{agencyId} or p.AGENCY_PIDS like '%${agencyId}%' )
AND p.del_flag = '0' AND p.del_flag = '0'
GROUP BY GROUP BY
c.VOLUNTEER_CATEGORY c.VOLUNTEER_CATEGORY

Loading…
Cancel
Save