Browse Source

【后台BUG修改】-【党员管理相关bug】-(王童)-2020/07/28

feature/dangjian
Jackwang 5 years ago
parent
commit
2bc619ed66
  1. 7
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PartyMembersDTO.java
  2. 2
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/PartyMembersController.java
  3. 4
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PartyMembersDao.java
  4. 22
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/PartyMembersExcel.java
  5. 3
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PartyMembersService.java
  6. 44
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PartyMembersServiceImpl.java
  7. 6
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/PartyAuthenticationFailedDao.xml
  8. 64
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/PartyMembersDao.xml

7
esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PartyMembersDTO.java

@ -17,11 +17,10 @@
package com.elink.esua.epdc.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import lombok.Data;
/**
@ -56,6 +55,8 @@ public class PartyMembersDTO implements Serializable {
private String registFlag;
private String registName;
private Date registTime;
private String streetName;

2
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/PartyMembersController.java

@ -160,7 +160,7 @@ public class PartyMembersController {
@GetMapping("hasAuthenticationexport")
// @DataFilter(tableAlias = "eu", prefix = "AND", isPendingCreator = false)
public void hasAuthenticationexport(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
ExcelUtils.exportExcelToTarget(response, "已认证党员", partyMembersService.optimizeHasAuthenticationPartyExport(params), PartyMembersExcel.class);
ExcelUtils.exportExcelToTarget(response, "已认证党员", partyMembersService.optimizeHasAuthenticationPartyExportNew(params), PartyMembersExcel.class);
}
/***

4
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PartyMembersDao.java

@ -22,9 +22,7 @@ import com.elink.esua.epdc.dto.PartyMembersDTO;
import com.elink.esua.epdc.entity.PartyMembersEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PathVariable;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
@ -85,6 +83,8 @@ public interface PartyMembersDao extends BaseDao<PartyMembersEntity> {
List<PartyMembersDTO> optimizeHasAuthenticationPartyPageInfo(@Param("userIdList") List<String> userIdList);
List<PartyMembersDTO> optimizeHasAuthenticationPartyPageInfoNew(@Param("userIdList") List<String> userIdList);
/***
* 删除时校验党员是否被认证
* @param IdentityNo

22
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/PartyMembersExcel.java

@ -34,20 +34,14 @@ public class PartyMembersExcel {
@Excel(name = "姓名")
private String realName;
@Excel(name = "联系电话")
@Excel(name = "手机号")
private String mobile;
@Excel(name = "身份证号")
private String identityNo;
@Excel(name = "职务")
private String post;
@Excel(name = "干部下沉", replace = {"下沉_1", "不下沉_0"})
private String cadreFlag;
@Excel(name = "是否注册", replace = {"是_1", "否_0"})
private String registFlag;
@Excel(name = "注册状态")
private String registName;
@Excel(name = "认证时间", format = "yyyy-MM-dd HH:mm:ss")
private Date registTime;
@ -57,4 +51,14 @@ public class PartyMembersExcel {
@Excel(name = "街道-社区-网格")
private String allDeptNames;
@Excel(name = "职务")
private String post;
@Excel(name = "干部下沉", replace = {"下沉_1", "不下沉_0"})
private String cadreFlag;
@Excel(name = "是否注册", replace = {"是_1", "否_0"})
private String registFlag;
}

3
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PartyMembersService.java

@ -23,7 +23,6 @@ import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.PartyMembersDTO;
import com.elink.esua.epdc.entity.PartyMembersEntity;
import com.elink.esua.epdc.entity.UserEntity;
import com.elink.esua.epdc.excel.PartyMembersExcel;
import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO;
import org.springframework.web.multipart.MultipartFile;
@ -123,6 +122,8 @@ public interface PartyMembersService extends BaseService<PartyMembersEntity> {
List<PartyMembersDTO> optimizeHasAuthenticationPartyExport(Map<String, Object> params);
List<PartyMembersDTO> optimizeHasAuthenticationPartyExportNew(Map<String, Object> params);
/***
* 通过身份证校验此党员是否被认证
* @param IdentityNo

44
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PartyMembersServiceImpl.java

@ -181,6 +181,15 @@ public class PartyMembersServiceImpl extends BaseServiceImpl<PartyMembersDao, Pa
@Override
@Transactional(rollbackFor = Exception.class)
public void save(PartyMembersDTO dto) {
List<PartyMembersEntity> partyMembersEntityList = baseDao.selectList(new QueryWrapper<PartyMembersEntity>());
// 去空格
List<PartyMembersExcel> partyList = new ArrayList<>();
// 校验数据
String message = this.checkExcelNew(dto, partyMembersEntityList);
if (StringUtils.isNotBlank(message)) {
throw new RenException(message);
}
PartyMembersEntity entity = new PartyMembersEntity();
entity.setCadreFlag(dto.getCadreFlag());
entity.setRealName(dto.getRealName());
@ -216,6 +225,27 @@ public class PartyMembersServiceImpl extends BaseServiceImpl<PartyMembersDao, Pa
}
}
private String checkExcelNew(PartyMembersDTO dto, List<PartyMembersEntity> partyMembersEntityList) {
// 不匹配信息
String result = null;
EpdcPartyErroyResultDTO errorLineinfoDto;
if (StringUtils.isBlank(dto.getRealName())) {
result = "姓名为空";
}
if (StringUtils.isBlank(dto.getIdentityNo())) {
result = "身份证号为空";
}
for (PartyMembersEntity item : partyMembersEntityList) {
if (StringUtils.isNotBlank(item.getMobile()) && item.getMobile().equals(dto.getMobile())) {
result = "手机号已存在";
}
if (item.getIdentityNo().equals(dto.getIdentityNo())) {
result = "身份证号已存在";
}
}
return result;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(PartyMembersDTO dto) {
@ -533,6 +563,20 @@ public class PartyMembersServiceImpl extends BaseServiceImpl<PartyMembersDao, Pa
}
@Override
public List<PartyMembersDTO> optimizeHasAuthenticationPartyExportNew(Map<String, Object> params) {
params.put("deptIdList", SecurityUser.getUser().getDeptIdList());
// IPage<String> page = getPage(params);
List<String> userIds = baseDao.optimizeHasAuthenticationPartyPage(params);
if (userIds.size() > 0) {
List<PartyMembersDTO> partyMembersDTOList = baseDao.optimizeHasAuthenticationPartyPageInfoNew(userIds);
return partyMembersDTOList;
} else {
return new ArrayList<PartyMembersDTO>();
}
}
@Override
public Integer checkCertificationByIdentityNo(String IdentityNo) {
return baseDao.selectCountByIdentity(IdentityNo);

6
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/PartyAuthenticationFailedDao.xml

@ -48,9 +48,9 @@
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
and DATE_FORMAT( epaf.created_time, '%Y-%m-%d' ) between #{startTime} and #{endTime}
</if>
<if test="identityNo != '' and identityNo != null"> and epaf.IDENTITY_NO = #{identityNo}</if>
<if test="realName != '' and realName != null"> and epaf.real_name = #{realName}</if>
<if test="mobile != '' and mobile != null"> and epaf.mobile = #{mobile}</if>
<if test="identityNo != '' and identityNo != null"> and epaf.IDENTITY_NO like '%${identityNo}%'</if>
<if test="realName != '' and realName != null"> and epaf.real_name like '%${realName}%'</if>
<if test="mobile != '' and mobile != null"> and epaf.mobile like '%${mobile}%'</if>
ORDER BY
epaf.CREATED_TIME desc
</select>

64
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/PartyMembersDao.xml

@ -100,13 +100,13 @@
AND ut.DEL_FLAG = '0'
WHERE
eu.PARTY_FLAG = '1' and eu.DEL_FLAG = '0'
<if test="realName != null and realName != '' ">and pm.REAL_NAME = #{realName}</if>
<if test="mobile != null and mobile != '' ">and pm.MOBILE = #{mobile}</if>
<if test="identityNo != null and identityNo != '' ">and pm.IDENTITY_NO = #{identityNo}</if>
<if test="realName != null and realName != '' ">and pm.REAL_NAME like '%${realName}%'</if>
<if test="mobile != null and mobile != '' ">and pm.MOBILE like '%${mobile}%'</if>
<if test="identityNo != null and identityNo != '' ">and pm.IDENTITY_NO like '%${identityNo}%'</if>
<if test="registFlag != null and registFlag != '' ">and pm.REGIST_FLAG = #{registFlag}</if>
<if test="postId != null and postId != '' ">and pm.POST_ID = #{postId}</if>
<if test="startTime != null and startTime != '' ">and pm.REGIST_TIME >= #{startTime}</if>
<if test="endTime != null and endTime != '' "> <![CDATA[ and pm.REGIST_TIME <= ]]> #{endTime}</if>
<if test="startTime != null and startTime != '' ">and DATE_FORMAT(pm.REGIST_TIME,'%Y-%m-%d') >= #{startTime}</if>
<if test="endTime != null and endTime != '' "> <![CDATA[ and DATE_FORMAT(pm.REGIST_TIME,'%Y-%m-%d') <= ]]> #{endTime}</if>
<if test="streetId != '' and streetId != null">
AND (find_in_set(#{streetId},eu.PARENT_DEPT_IDS) OR find_in_set(#{streetId},eu.ALL_DEPT_IDS))
</if>
@ -326,6 +326,60 @@
ORDER BY
allu.registTime DESC
</select>
<select id="optimizeHasAuthenticationPartyPageInfoNew" resultType="com.elink.esua.epdc.dto.PartyMembersDTO">
SELECT
pm.CADRE_FLAG,
pm.CREATED_BY,
pm.DEPT_ID,
pm.ID,
pm.POST,
pm.POST_VALUE,
pm.REGIST_FLAG,
CASE pm.REGIST_FLAG
WHEN '0' THEN
'未认证'
WHEN '1' THEN
'自动认证'
WHEN '2' THEN
'手动认证'
ELSE
'未认证'
END REGIST_NAME,
GROUP_CONCAT(ut.TAG_NAME) TAG_NAME,
allu.CREATED_TIME,
allu.IDENTITY_NO,
allu.MOBILE,
allu.REAL_NAME,
allu.registTime,
allu.ALL_DEPT_NAMES
FROM
(
SELECT
eu.ID,
eu.CREATED_TIME,
eu.IDENTITY_NO,
eu.MOBILE,
eu.REAL_NAME,
eu.REGISTER_TIME as registTime,
eu.ALL_DEPT_NAMES
FROM
epdc_user eu
WHERE
eu.ID IN
<foreach collection="userIdList" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
) allu
LEFT JOIN epdc_party_members pm ON pm.IDENTITY_NO = allu.IDENTITY_NO
AND pm.REAL_NAME = allu.REAL_NAME
LEFT JOIN epdc_party_tag_relation pt ON pm.ID = pt.PARTY_ID
LEFT JOIN epdc_user_tag ut ON pt.TAG_ID = ut.ID
AND ut.DEL_FLAG = '0'
GROUP BY
allu.ID
ORDER BY
allu.registTime DESC
</select>
<!--删除党员时候校验是否被认证-->
<select id="selectCountByIdentity" resultType="Integer">
SELECT

Loading…
Cancel
Save