Browse Source

党员相关bug修改

dev
zhaoqifeng 3 years ago
parent
commit
63e25776e8
  1. 11
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
  2. 15
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java
  3. 21
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java
  4. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java
  5. 27
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java
  6. 12
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberDao.xml
  7. 35
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java

11
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java

@ -9,6 +9,7 @@ import com.epmet.dto.VolunteerInfoDTO;
import com.epmet.dto.form.AutoEvaluateDemandFormDTO;
import com.epmet.dto.form.CommonCustomerFormDTO;
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO;
import com.epmet.dto.form.resi.VolunteerCommonFormDTO;
import com.epmet.dto.result.demand.IcResiDemandDictDTO;
import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO;
@ -119,4 +120,14 @@ public interface EpmetHeartOpenFeignClient {
*/
@PostMapping("/heart/resi/volunteer/getVolunteerList/{customerId}")
Result<List<IcVolunteerPolyDTO>> getVolunteerList(@PathVariable("customerId") String customerId);
/**
* 添加志愿者
* @Param formDTO
* @Return {@link Result}
* @Author zhaoqifeng
* @Date 2022/5/30 11:10
*/
@PostMapping("/heart/resi/volunteer/addVolunteer")
Result addVolunteer(@RequestBody ResiVolunteerAuthenticateFormDTO formDTO);
}

15
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java

@ -10,6 +10,7 @@ import com.epmet.dto.VolunteerInfoDTO;
import com.epmet.dto.form.AutoEvaluateDemandFormDTO;
import com.epmet.dto.form.CommonCustomerFormDTO;
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO;
import com.epmet.dto.form.resi.VolunteerCommonFormDTO;
import com.epmet.dto.result.demand.IcResiDemandDictDTO;
import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO;
@ -123,4 +124,18 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli
public Result<List<IcVolunteerPolyDTO>> getVolunteerList(String customerId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "getVolunteerList", customerId);
}
/**
* 添加志愿者
*
* @param formDTO
* @Param formDTO
* @Return {@link Result}
* @Author zhaoqifeng
* @Date 2022/5/30 11:10
*/
@Override
public Result addVolunteer(ResiVolunteerAuthenticateFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "addVolunteer", formDTO);
}
}

21
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java

@ -18,9 +18,13 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.dto.form.mq.MqBaseFormDTO;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.SystemMessageType;
import com.epmet.dto.IcVolunteerPolyDTO;
import com.epmet.dto.VolunteerInfoDTO;
import com.epmet.dto.form.CommonCustomerFormDTO;
@ -31,6 +35,8 @@ import com.epmet.dto.form.resi.VolunteerCommonFormDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO;
import com.epmet.dto.result.resi.ResiVolunteerInfoResultDTO;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.send.SendMqMsgUtil;
import com.epmet.service.VolunteerInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -50,6 +56,8 @@ public class ResiVolunteerController {
@Autowired
private VolunteerInfoService volunteerInfoService;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
/**
* 志愿者认证
@ -65,6 +73,19 @@ public class ResiVolunteerController {
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO, ResiVolunteerAuthenticateFormDTO.AddUserShowGroup.class, ResiVolunteerAuthenticateFormDTO.AddUserInternalGroup.class);
volunteerInfoService.authenticate(formDTO);
//发送志愿者人员消息变动
boolean flag = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendRocketMqMsg(SystemMessageType.VOLUNTEER_CHANGED, new MqBaseFormDTO(tokenDto.getCustomerId(), tokenDto.getUserId()));
if (!flag){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"发送志愿者变动消息失败","发送志愿者变动消息失败");
}
return new Result();
}
@PostMapping("addVolunteer")
public Result addVolunteer(@RequestBody ResiVolunteerAuthenticateFormDTO formDTO) {
volunteerInfoService.addVolunteer(formDTO);
return new Result();
}

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java

@ -49,7 +49,7 @@ public interface VolunteerInfoService extends BaseService<VolunteerInfoEntity> {
* @Date 10:09 2020-07-23
**/
void authenticate(ResiVolunteerAuthenticateFormDTO formDTO);
void addVolunteer(ResiVolunteerAuthenticateFormDTO formDTO);
/**
* 志愿者认证界面获取用户基础信息+志愿者信息
*

27
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java

@ -186,6 +186,33 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao,
}
}
@Override
public void addVolunteer(ResiVolunteerAuthenticateFormDTO formDTO) {
// 检查是否是志愿者
VolunteerInfoDTO originVolunteer = baseDao.selectVolunteerInfoByUserId(formDTO.getUserId());
if (null == originVolunteer) {
//不是志愿者:插入志愿者信息表
VolunteerInfoEntity insertVolunteer = ConvertUtils.sourceToTarget(formDTO, VolunteerInfoEntity.class);
// 赋值gridName,pid,pids
CustomerGridFormDTO customerGridFormDTO = new CustomerGridFormDTO();
customerGridFormDTO.setGridId(formDTO.getGridId());
Result<CustomerGridDTO> gridInfoRes = govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO);
if (!gridInfoRes.success() || null == gridInfoRes.getData()) {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询网格信息失败");
}
insertVolunteer.setGridName(gridInfoRes.getData().getGridName());
insertVolunteer.setPid(gridInfoRes.getData().getPid());
insertVolunteer.setPids(gridInfoRes.getData().getPids());
baseDao.insert(insertVolunteer);
//更新用户信息表的 是否是志愿者标识
HeartUserInfoDTO userInfoDTO = new HeartUserInfoDTO();
userInfoDTO.setUserId(formDTO.getUserId());
userInfoDTO.setVolunteerFlag(true);
heartUserInfoService.updateHeartUserInfoByUserId(userInfoDTO);
}
}
private void grantActPoints(ResiVolunteerAuthenticateFormDTO formDTO){
//MqBaseMsgDTO mqBaseMsgDTO=new MqBaseMsgDTO();
//mq的事件类型

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

@ -59,7 +59,17 @@
a.REMARK
FROM
ic_party_member a
LEFT JOIN ( SELECT CUSTOMER_ID,PARTY_MEMBER_ID,PAY_DATE FROM ( SELECT CUSTOMER_ID,PARTY_MEMBER_ID,PAY_DATE FROM ic_party_member_pay_record WHERE DEL_FLAG = 0 ORDER BY PAY_DATE DESC LIMIT 1) record GROUP BY record.PARTY_MEMBER_ID ) b ON a.ID = b.PARTY_MEMBER_ID
LEFT JOIN (
SELECT
CUSTOMER_ID,
PARTY_MEMBER_ID,
MAX(PAY_DATE) AS PAY_DATE
FROM
ic_party_member_pay_record
WHERE
DEL_FLAG = 0
GROUP BY
PARTY_MEMBER_ID ) b ON a.ID = b.PARTY_MEMBER_ID
AND b.CUSTOMER_ID = #{customerId}
INNER JOIN ic_party_org d ON a.SSZB = d.ID
AND d.DEL_FLAG = 0

35
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java

@ -23,15 +23,12 @@ import com.epmet.dao.*;
import com.epmet.dto.IcVolunteerPolyDTO;
import com.epmet.dto.VolunteerInfoDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO;
import com.epmet.dto.result.ResiUserBaseInfoResultDTO;
import com.epmet.dto.result.VolunteerPolyListResultDTO;
import com.epmet.dto.result.VolunteerPolyMapDataResultDTO;
import com.epmet.dto.result.VolunteerPolyPieResultDTO;
import com.epmet.entity.*;
import com.epmet.entity.IcResiUserEntity;
import com.epmet.entity.IcVolunteerPolyCategoryEntity;
import com.epmet.entity.IcVolunteerPolyEntity;
import com.epmet.entity.UserBaseInfoEntity;
import com.epmet.enums.CustomizeEnum;
import com.epmet.feign.EpmetHeartOpenFeignClient;
import com.epmet.feign.OperCustomizeOpenFeignClient;
@ -49,7 +46,10 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
@ -356,6 +356,19 @@ public class IcVolunteerPolyServiceImpl extends BaseServiceImpl<IcVolunteerPolyD
icVolunteerPolyCategoryDao.delete(categoryWrapper);
icVolunteerPolyCategoryService.insertBatch(entityList);
}
//小程序端设为志愿者
//根据身份证获取小程序端居民信息
LambdaQueryWrapper<UserBaseInfoEntity> baseInfoWrapper = new LambdaQueryWrapper<>();
baseInfoWrapper.eq(UserBaseInfoEntity::getCustomerId, customerId);
baseInfoWrapper.eq(UserBaseInfoEntity::getIdNum, icUser.getIdCard());
UserBaseInfoEntity baseInfo = userBaseInfoDao.selectOne(baseInfoWrapper);
if (null != baseInfo) {
ResiVolunteerAuthenticateFormDTO formDTO = new ResiVolunteerAuthenticateFormDTO();
formDTO.setCustomerId(customerId);
formDTO.setUserId(baseInfo.getUserId());
formDTO.setGridId(icUser.getGridId());
epmetHeartOpenFeignClient.addVolunteer(formDTO);
}
} else {
if (!isDyzxh) {
//删除志愿者信息
@ -438,12 +451,24 @@ public class IcVolunteerPolyServiceImpl extends BaseServiceImpl<IcVolunteerPolyD
entity.setId(volunteer.getId());
if (null != icResiUser) {
entity.setIcResiUser(icResiUser.getId());
if (!NumConstant.ONE_STR.equals(icResiUser.getIsVolunteer())) {
IcResiUserEntity icUserEntity = new IcResiUserEntity();
icUserEntity.setId(icResiUser.getId());
icUserEntity.setIsVolunteer(NumConstant.ONE_STR);
icResiUserDao.updateById(icUserEntity);
}
}
baseDao.updateById(entity);
} else if (null == volunteer) {
if (null != icResiUser) {
entity.setIcResiUser(icResiUser.getId());
if (!NumConstant.ONE_STR.equals(icResiUser.getIsVolunteer())) {
IcResiUserEntity icUserEntity = new IcResiUserEntity();
icUserEntity.setId(icResiUser.getId());
icUserEntity.setIsVolunteer(NumConstant.ONE_STR);
icResiUserDao.updateById(icUserEntity);
}
}
baseDao.insert(entity);
IcVolunteerPolyCategoryEntity category = new IcVolunteerPolyCategoryEntity();

Loading…
Cancel
Save