Browse Source

党员管理列表

master
zhaoqifeng 3 years ago
parent
commit
5a0f0eabd7
  1. 84
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/IcPartyMemberFromDTO.java
  2. 82
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/IcPartyMemberResultDTO.java
  3. 12
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberController.java
  4. 14
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberDao.java
  5. 9
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberService.java
  6. 72
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberServiceImpl.java
  7. 89
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberDao.xml
  8. 1
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

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

@ -0,0 +1,84 @@
package com.epmet.resi.partymember.dto.partymember.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/5/18 16:03
*/
@NoArgsConstructor
@Data
public class IcPartyMemberFromDTO extends PageFormDTO implements Serializable {
private static final long serialVersionUID = -5751720367897462952L;
private String customerId;
/**
* 所属党组织
*/
private String partyOrgId;
/**
* 姓名
*/
private String name;
/**
* 手机
*/
private String mobile;
/**
* 身份证号
*/
private String idCard;
/**
* 地址
*/
private String address;
/**
* 流动党员
*/
private String isLd;
/**
* 流动党员证号
*/
private String ldzh;
/**
* 职务
*/
private String partyZw;
/**
* 是否党员中心户
*/
private String isDyzxh;
/**
* 是否免学习
*/
private String isMxx;
/**
* 文化程度
*/
private String culture;
/**
* 是否缴费
*/
private String isPay;
/**
* 入党时间开始
*/
private String rdsjStartDate;
/**
* 入党时间结束
*/
private String rdsjEndDate;
/**
* 最后一次缴费时间开始
*/
private String payStatrDate;
/**
* 最后一次缴费时间结束
*/
private String payEndDate;
private String year;
}

82
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/IcPartyMemberResultDTO.java

@ -0,0 +1,82 @@
package com.epmet.resi.partymember.dto.partymember.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/5/18 16:33
*/
@NoArgsConstructor
@Data
public class IcPartyMemberResultDTO implements Serializable {
private static final long serialVersionUID = -4964061462850271428L;
/**
* 主键
*/
private String id;
/**
* 姓名
*/
private String name;
/**
* 身份证号
*/
private String idCard;
/**
* 手机号
*/
private String mobile;
/**
* 入党时间
*/
private String rdsj;
/**
* 所属党组织
*/
private String sszb;
/**
* 流动党员
*/
private String isLd;
/**
* 流动党员证号
*/
private String ldzh;
/**
* 职务
*/
private String partyZw;
/**
* 地址
*/
private String address;
/**
* 是否缴费
*/
private String isPay;
/**
* 最近一次缴纳党费时间
*/
private String payDate;
/**
* 文化程度
*/
private String culture;
/**
* 量化积分
*/
private String point;
/**
* 志愿者类别
*/
private String volunteerCategory;
/**
* 备注
*/
private String remark;
}

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

@ -1,7 +1,9 @@
package com.epmet.modules.partymember.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
@ -9,9 +11,11 @@ import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO;
import com.epmet.modules.partymember.excel.IcPartyMemberExcel;
import com.epmet.modules.partymember.service.IcPartyMemberService;
import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO;
import com.epmet.resi.partymember.dto.partymember.form.IcPartyMemberFromDTO;
import com.epmet.resi.partymember.dto.partymember.result.IcPartyMemberResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -34,9 +38,9 @@ public class IcPartyMemberController {
private IcPartyMemberService icPartyMemberService;
@RequestMapping("page")
public Result<PageData<IcPartyMemberDTO>> page(@RequestParam Map<String, Object> params){
PageData<IcPartyMemberDTO> page = icPartyMemberService.page(params);
return new Result<PageData<IcPartyMemberDTO>>().ok(page);
public Result<PageData<IcPartyMemberResultDTO>> page(@LoginUser TokenDto tokenDto, @RequestBody IcPartyMemberFromDTO formDTO){
PageData<IcPartyMemberResultDTO> page = icPartyMemberService.page(tokenDto, formDTO);
return new Result<PageData<IcPartyMemberResultDTO>>().ok(page);
}
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})

14
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberDao.java

@ -2,8 +2,12 @@ package com.epmet.modules.partymember.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.partymember.entity.IcPartyMemberEntity;
import com.epmet.resi.partymember.dto.partymember.form.IcPartyMemberFromDTO;
import com.epmet.resi.partymember.dto.partymember.result.IcPartyMemberResultDTO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 数字平台党员信息表
*
@ -12,5 +16,13 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface IcPartyMemberDao extends BaseDao<IcPartyMemberEntity> {
/**
* 党员列表
*
* @Param formDTO
* @Return {@link List< IcPartyMemberResultDTO>}
* @Author zhaoqifeng
* @Date 2022/5/18 17:01
*/
List<IcPartyMemberResultDTO> selectList(IcPartyMemberFromDTO formDTO);
}

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

@ -2,8 +2,11 @@ package com.epmet.modules.partymember.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.modules.partymember.entity.IcPartyMemberEntity;
import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO;
import com.epmet.resi.partymember.dto.partymember.form.IcPartyMemberFromDTO;
import com.epmet.resi.partymember.dto.partymember.result.IcPartyMemberResultDTO;
import java.util.List;
import java.util.Map;
@ -19,12 +22,12 @@ public interface IcPartyMemberService extends BaseService<IcPartyMemberEntity> {
/**
* 默认分页
*
* @param params
* @param formDTO
* @return PageData<IcPartyMemberDTO>
* @author generator
* @date 2022-05-17
*/
PageData<IcPartyMemberDTO> page(Map<String, Object> params);
PageData<IcPartyMemberResultDTO> page(TokenDto tokenDto, IcPartyMemberFromDTO formDTO);
/**
* 默认查询

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

@ -2,36 +2,44 @@ package com.epmet.modules.partymember.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.DictTypeEnum;
import com.epmet.commons.tools.enums.IcFormCodeEnum;
import com.epmet.commons.tools.enums.PartyPostEnum;
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.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.IcFormOptionsQueryFormDTO;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.OperCustomizeOpenFeignClient;
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.modules.partymember.service.IcPartyMemberService;
import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO;
import com.epmet.resi.partymember.dto.partymember.form.IcPartyMemberFromDTO;
import com.epmet.resi.partymember.dto.partymember.result.IcPartyMemberResultDTO;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -46,6 +54,8 @@ public class IcPartyMemberServiceImpl extends BaseServiceImpl<IcPartyMemberDao,
@Resource
private IcPartyOrgService icPartyOrgService;
@Resource
private IcPartyOrgDao icPartyOrgDao;
@Resource
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Resource
private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient;
@ -53,12 +63,53 @@ public class IcPartyMemberServiceImpl extends BaseServiceImpl<IcPartyMemberDao,
private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient;
@Override
public PageData<IcPartyMemberDTO> page(Map<String, Object> params) {
IPage<IcPartyMemberEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, IcPartyMemberDTO.class);
public PageData<IcPartyMemberResultDTO> page(TokenDto tokenDto, IcPartyMemberFromDTO formDTO) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
if (null == staffInfo) {
throw new EpmetException("获取工作人员信息失败");
}
if (StringUtils.isBlank(formDTO.getPartyOrgId())) {
//获取工作人员所属组织同级的党组织
LambdaQueryWrapper<IcPartyOrgEntity> orgWrapper = new LambdaQueryWrapper<>();
orgWrapper.eq(IcPartyOrgEntity::getCustomerId, formDTO.getCustomerId());
orgWrapper.eq(IcPartyOrgEntity::getAgencyId, staffInfo.getAgencyId());
IcPartyOrgEntity org = icPartyOrgDao.selectOne(orgWrapper);
if (null == org) {
return new PageData<>(Collections.emptyList(), 0);
}
formDTO.setPartyOrgId(org.getId());
}
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setYear(DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYY));
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage());
List<IcPartyMemberResultDTO> list = baseDao.selectList(formDTO);
PageInfo<IcPartyMemberResultDTO> pageInfo = new PageInfo<>(list);
//获取文化程度字典
Result<Map<String, String>> education = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.EDUCATION.getCode());
if (!education.success()) {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "获取文化程度信息失败", "获取文化程度信息失败");
}
if (CollectionUtils.isNotEmpty(list)) {
//获取志愿者类别
IcFormOptionsQueryFormDTO optionsForm = new IcFormOptionsQueryFormDTO();
optionsForm.setCustomerId(tokenDto.getCustomerId());
optionsForm.setFormCode(IcFormCodeEnum.RESI_BASE_INFO.getCode());
optionsForm.setColumnName("VOLUNTEER_CATEGORY");
Result<Map<String, String>> volunteerMap = operCustomizeOpenFeignClient.getOptionsMap(optionsForm);
//构造数据
list.forEach(item -> {
item.setIsLd(NumConstant.ONE_STR.equals(item.getIsLd()) ? "是" : "否");
item.setIsLd(NumConstant.ONE_STR.equals(item.getIsPay()) ? "是" : "否");
item.setPartyZw(PartyPostEnum.getName(item.getPartyZw()));
item.setCulture(education.getData().get(item.getCulture()));
item.setPoint(("0.00").equals(item.getPoint()) ? StrConstant.HYPHEN : item.getPoint());
List<String> category = Arrays.asList(item.getVolunteerCategory().split(StrConstant.COMMA));
List<String> categoryNames = category.stream().map(volunteerMap.getData()::get).collect(Collectors.toList());
item.setVolunteerCategory(String.join(String.valueOf((char) 10), categoryNames));
});
}
return new PageData<>(list, pageInfo.getTotal());
}
@Override
@ -200,6 +251,7 @@ public class IcPartyMemberServiceImpl extends BaseServiceImpl<IcPartyMemberDao,
* @Date 2022/5/18 10:16
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void icPartyMemberSync(IcPartyMemberDTO dto) {
//查询党员信息
LambdaQueryWrapper<IcPartyMemberEntity> wrapper = new LambdaQueryWrapper<>();

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

@ -36,6 +36,95 @@
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="selectList" resultType="com.epmet.resi.partymember.dto.partymember.result.IcPartyMemberResultDTO">
SELECT
*
FROM (
SELECT
a.`NAME`,
a.MOBILE,
a.ID_CARD,
a.RDSJ,
d.PARTY_ORG_NAME AS sszb,
a.IS_LD,
a.LDZH,
a.PARTY_ZW,
a.ADDRESS,
IF( b.PAY_DATE IS NULL, 0, 1 ) AS isPay,
b.PAY_DATE,
a.CULTURE,
convert(IFNULL(0,c.total)/IFNULL(1,c.count),decimal(10,2)) AS point,
a.VOLUNTEER_CATEGORY,
a.REMARK
FROM
ic_party_member a
LEFT JOIN ( SELECT * FROM ( SELECT * FROM ic_party_member_pay_record ORDER BY PAY_DATE DESC ) record GROUP BY record.PARTY_MEMBER_ID ) b ON a.ID = b.PARTY_MEMBER_ID
AND b.DEL_FLAG = 0 AND b.CUSTOMER_ID = #{customerId}
LEFT JOIN (
SELECT PARTY_MEMBER_ID, SUM(TOTAL_SCORE) AS "total", COUNT(ID) as "count"
FROM ic_party_member_point
WHERE
DEL_FLAG = 0
AND CUSTOMER_ID = #{customerId}
AND YEAR = #{year}
GROUP BY PARTY_MEMBER_ID) c ON a.ID = c.PARTY_MEMBER_ID
INNER JOIN ic_party_org d ON a.SSZB = d.ID
AND d.DEL_FLAG = 0
WHERE
a.DEL_FLAG = 0
AND a.CUSTOMER_ID = #{customerId}
AND (a.SSZB = #{partyOrgId} OR a.ORG_PIDS LIKE concat('%', #{partyOrgId}, '%'))
<if test='null != name and "" != name.trim()'>
AND a.NAME LIKE concat('%', #{name}, '%')
</if>
<if test='null != mobile and "" != mobile.trim()'>
AND a.MOBILE LIKE concat('%', #{mobile}, '%')
</if>
<if test='null != idCard and "" != idCard.trim()'>
AND a.ID_CARD LIKE concat('%', #{idCard}, '%')
</if>
<if test='null != address and "" != address.trim()'>
AND a.ADDRESS LIKE concat('%', #{address}, '%')
</if>
<if test='null != isLd and "" != isLd.trim()'>
AND a.IS_LD = #{address}
</if>
<if test='null != ldzh and "" != ldzh.trim()'>
AND a.LDZH LIKE concat('%', #{ldzh}, '%')
</if>
<if test='null != partyZw and "" != partyZw.trim()'>
AND a.PARTY_ZW = #{partyZw}
</if>
<if test='null != isDyzxh and "" != isDyzxh.trim()'>
AND a.IS_DYZXH = #{isDyzxh}
</if>
<if test='null != isMxx and "" != isMxx.trim()'>
AND a.IS_MXX = #{isMxx}
</if>
<if test='null != culture and "" != culture.trim()'>
AND a.CULTURE = #{culture}
</if>
<if test='null != rdsjStartDate and "" != rdsjStartDate.trim()'>
AND a.RDSJ &gt;= #{rdsjStartDate}
</if>
<if test='null != rdsjEndDate and "" != rdsjEndDate.trim()'>
AND a.RDSJ &lt;= #{rdsjEndDate}
</if>
<if test='null != payStatrDate and "" != payStatrDate.trim()'>
AND b.PAY_DATE &gt;= #{payStatrDate}
</if>
<if test='null != payEndDate and "" != payEndDate.trim()'>
AND b.PAY_DATE &lt;= #{payEndDate}
</if>
ORDER BY CONVERT(d.PARTY_ORG_NAME USING gbk), a.CREATED_TIME DESC
) t
WHERE
1=1
<if test='null != isPay and "" != isPay.trim()'>
AND isPay = #{isPay}
</if>
</select>
</mapper>

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

@ -2038,6 +2038,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
* @Date 2022/5/17 19:12
*/
@Override
@Transactional(rollbackFor = Exception.class)
public com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO icPartyMemberSync(com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO formDTO) {
com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO dto = new com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO();
if (StringUtils.isNotEmpty(formDTO.getIcResiUser())) {

Loading…
Cancel
Save