Browse Source

Merge remote-tracking branch 'origin/dev_party_helper' into dev_party_helper

master
yinzuomei 3 years ago
parent
commit
f5ea78db4f
  1. 9
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java
  2. 6
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java
  3. 12
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/controller/ResiGroupMemberController.java
  4. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/dao/ResiGroupMemberDao.java
  5. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/ResiGroupMemberService.java
  6. 5
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java
  7. 15
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/member/ResiGroupMemberDao.xml
  8. 2
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/ActAndScheduleListResultDTO.java
  9. 4
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyActService.java
  10. 107
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java
  11. 12
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcScheduleServiceImpl.java
  12. 3
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/mq/listener/PartyMeetingMessageListener.java
  13. 10
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyActDao.xml
  14. 15
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcScheduleDao.xml

9
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java

@ -6,6 +6,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.resi.group.dto.group.ResiGroupDTO; import com.epmet.resi.group.dto.group.ResiGroupDTO;
import com.epmet.resi.group.dto.group.form.*; import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.*; import com.epmet.resi.group.dto.group.result.*;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import com.epmet.resi.group.dto.topic.MyCreateTopicsFormDTO; import com.epmet.resi.group.dto.topic.MyCreateTopicsFormDTO;
import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.resi.group.dto.topic.ResiTopicDTO;
import com.epmet.resi.group.dto.topic.form.*; import com.epmet.resi.group.dto.topic.form.*;
@ -333,4 +334,12 @@ public interface ResiGroupOpenFeignClient {
*/ */
@PostMapping("/resi/group/group/getBranchGroupList") @PostMapping("/resi/group/group/getBranchGroupList")
Result<Map<String, List<IcPartyOrgTreeDTO>>> getBranchGroupList(); Result<Map<String, List<IcPartyOrgTreeDTO>>> getBranchGroupList();
/**
* @Author sun
* @Description 查询小组成员列表
**/
@PostMapping("/resi/group/member/getmemberlist")
Result<List<ResiGroupMemberDTO>> getMemberList(@RequestBody List<String> groupIdList);
} }

6
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java

@ -6,6 +6,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.resi.group.dto.group.ResiGroupDTO; import com.epmet.resi.group.dto.group.ResiGroupDTO;
import com.epmet.resi.group.dto.group.form.*; import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.*; import com.epmet.resi.group.dto.group.result.*;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import com.epmet.resi.group.dto.topic.MyCreateTopicsFormDTO; import com.epmet.resi.group.dto.topic.MyCreateTopicsFormDTO;
import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.resi.group.dto.topic.ResiTopicDTO;
import com.epmet.resi.group.dto.topic.form.*; import com.epmet.resi.group.dto.topic.form.*;
@ -241,4 +242,9 @@ public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClien
public Result<Map<String, List<IcPartyOrgTreeDTO>>> getBranchGroupList() { public Result<Map<String, List<IcPartyOrgTreeDTO>>> getBranchGroupList() {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getBranchGroupList", null); return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getBranchGroupList", null);
} }
@Override
public Result<List<ResiGroupMemberDTO>> getMemberList(String groupId) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getMemberList", groupId);
}
} }

12
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/controller/ResiGroupMemberController.java

@ -24,16 +24,14 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.modules.member.service.GroupMemeberOperationService; import com.epmet.modules.member.service.GroupMemeberOperationService;
import com.epmet.modules.member.service.ResiGroupMemberService; import com.epmet.modules.member.service.ResiGroupMemberService;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import com.epmet.resi.group.dto.member.form.*; import com.epmet.resi.group.dto.member.form.*;
import com.epmet.resi.group.dto.member.result.ApplyingMemberResultDTO; import com.epmet.resi.group.dto.member.result.ApplyingMemberResultDTO;
import com.epmet.resi.group.dto.member.result.GridVotableCountResultDTO; import com.epmet.resi.group.dto.member.result.GridVotableCountResultDTO;
import com.epmet.resi.group.dto.member.result.GroupMemberListResultDTO; import com.epmet.resi.group.dto.member.result.GroupMemberListResultDTO;
import com.epmet.resi.group.dto.member.result.JoinGroupApplyRealTimeResultDTO; import com.epmet.resi.group.dto.member.result.JoinGroupApplyRealTimeResultDTO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
@ -206,4 +204,10 @@ public class ResiGroupMemberController {
ValidatorUtils.validateEntity(param); ValidatorUtils.validateEntity(param);
return new Result<JoinGroupApplyRealTimeResultDTO>().ok(operationService.applyEnterByLink(param)); return new Result<JoinGroupApplyRealTimeResultDTO>().ok(operationService.applyEnterByLink(param));
} }
@PostMapping("getmemberlist")
public Result<List<ResiGroupMemberDTO>> groupMemberList(@RequestBody List<String> groupIdList){
return new Result<List<ResiGroupMemberDTO>>().ok(resiGroupMemberService.groupMemberList(groupIdList));
}
} }

2
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/dao/ResiGroupMemberDao.java

@ -181,4 +181,6 @@ public interface ResiGroupMemberDao extends BaseDao<ResiGroupMemberEntity> {
int countAllMembers(@Param("customerId") String customerId, @Param("groupId") String groupId); int countAllMembers(@Param("customerId") String customerId, @Param("groupId") String groupId);
int exitGroupById(@Param("id") String id, @Param("updatedBy") String updatedBy); int exitGroupById(@Param("id") String id, @Param("updatedBy") String updatedBy);
List<ResiGroupMemberDTO> groupMemberList(@Param("groupIdList") List<String> groupIdList);
} }

2
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/ResiGroupMemberService.java

@ -262,4 +262,6 @@ public interface ResiGroupMemberService extends BaseService<ResiGroupMemberEntit
* @return com.epmet.resi.group.dto.member.ResiGroupMemberDTO * @return com.epmet.resi.group.dto.member.ResiGroupMemberDTO
*/ */
ResiGroupMemberDTO getMemberInfo(String groupId, String userId); ResiGroupMemberDTO getMemberInfo(String groupId, String userId);
List<ResiGroupMemberDTO> groupMemberList(List<String> groupIdList);
} }

5
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java

@ -1036,4 +1036,9 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl<ResiGroupMemberD
return targetObject; return targetObject;
} }
@Override
public List<ResiGroupMemberDTO> groupMemberList(List<String> groupIdList) {
return baseDao.groupMemberList(groupIdList);
}
} }

15
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/member/ResiGroupMemberDao.xml

@ -250,4 +250,19 @@
WHERE WHERE
id = #{id} id = #{id}
</update> </update>
<select id="groupMemberList" resultType="com.epmet.resi.group.dto.member.ResiGroupMemberDTO">
SELECT
*
FROM
resi_group_member
WHERE
del_flag = '0'
AND `status` IN ( 'approved', 'silent' )
<foreach collection="groupIdList" item="groupId" open="AND resi_group_id IN (" separator="," close=")">
#{groupId}
</foreach>
ORDER BY
group_leader_flag ASC, created_time ASC
</select>
</mapper> </mapper>

2
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/ActAndScheduleListResultDTO.java

@ -33,6 +33,7 @@ public class ActAndScheduleListResultDTO implements Serializable {
private String activityId; private String activityId;
private String staffId; private String staffId;
private String dateId;
private String topic; private String topic;
private String address; private String address;
private String holdTime; private String holdTime;
@ -58,6 +59,7 @@ public class ActAndScheduleListResultDTO implements Serializable {
private String remark; private String remark;
private Boolean isMe = false; private Boolean isMe = false;
private String staffId; private String staffId;
private String dateId;
} }
@Data @Data

4
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyActService.java

@ -1,6 +1,8 @@
package com.epmet.modules.partyOrg.service; package com.epmet.modules.partyOrg.service;
import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.rocketmq.messages.PartyMeetingMessageMQMsg;
import com.epmet.commons.tools.dto.form.mq.MqBaseFormDTO;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.modules.partyOrg.entity.IcPartyActEntity; import com.epmet.modules.partyOrg.entity.IcPartyActEntity;
import com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActAddOrUpdateFormDTO; import com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActAddOrUpdateFormDTO;
@ -62,6 +64,8 @@ public interface IcPartyActService extends BaseService<IcPartyActEntity> {
*/ */
IcPartyActDetailResDTO queryActDetail(String customerId, String userId, String icPartyActId); IcPartyActDetailResDTO queryActDetail(String customerId, String userId, String icPartyActId);
void partyMeetingMessage(PartyMeetingMessageMQMsg dto);
/** /**
* Desc: 党建日历活动日程列表 * Desc: 党建日历活动日程列表
* @param formDTO * @param formDTO

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

@ -1,15 +1,19 @@
package com.epmet.modules.partyOrg.service.impl; package com.epmet.modules.partyOrg.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.rocketmq.messages.PartyMeetingMessageMQMsg;
import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode; 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.exception.RenException;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.modules.partyOrg.dao.*; import com.epmet.modules.partyOrg.dao.*;
import com.epmet.modules.partyOrg.entity.IcPartyActEntity; import com.epmet.modules.partyOrg.entity.IcPartyActEntity;
@ -19,6 +23,8 @@ import com.epmet.modules.partyOrg.service.IcPartyActOrgService;
import com.epmet.modules.partyOrg.service.IcPartyActService; import com.epmet.modules.partyOrg.service.IcPartyActService;
import com.epmet.modules.partyOrg.service.IcPartyOrgService; import com.epmet.modules.partyOrg.service.IcPartyOrgService;
import com.epmet.modules.partyOrg.service.ResiPartymemberAttachmentService; import com.epmet.modules.partyOrg.service.ResiPartymemberAttachmentService;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient;
import com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActAddOrUpdateFormDTO; import com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActAddOrUpdateFormDTO;
import com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActPageFormDTO; import com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActPageFormDTO;
import com.epmet.resi.partymember.dto.icpartyact.result.IcPartActTypeDTO; import com.epmet.resi.partymember.dto.icpartyact.result.IcPartActTypeDTO;
@ -47,7 +53,8 @@ import java.util.stream.Collectors;
*/ */
@Service @Service
public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPartyActEntity> implements IcPartyActService { public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPartyActEntity> implements IcPartyActService {
@Autowired
private ResiGroupOpenFeignClient resiGroupOpenFeignClient;
@Autowired @Autowired
private IcScheduleDao scheduleDao; private IcScheduleDao scheduleDao;
@Autowired @Autowired
@ -262,6 +269,102 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart
*/ */
@Override @Override
public List<ActAndScheduleListResultDTO> homeSearch(ActAndScheduleListFormDTO formDTO) { public List<ActAndScheduleListResultDTO> homeSearch(ActAndScheduleListFormDTO formDTO) {
return null; CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if (null == staffInfo){
throw new EpmetException("查询工作人员失败:"+formDTO.getStaffId());
}
formDTO.setAgencyId(staffInfo.getAgencyId());
IcPartyOrgDTO icPartyOrgDTO = partyOrgService.get(formDTO.getOrgId());
if (null == icPartyOrgDTO){
throw new EpmetException("未查询到党组织信息:"+formDTO.getOrgId());
}
formDTO.setPath(icPartyOrgDTO.getOrgPids().equals("") || icPartyOrgDTO.getOrgPids().equals(NumConstant.ZERO_STR) ? icPartyOrgDTO.getId() : icPartyOrgDTO.getOrgPids().concat(":").concat(icPartyOrgDTO.getId()));
List<ActAndScheduleListResultDTO> result = constructHomeSearchData(formDTO.getStartDate(), formDTO.getEndDate());
List<ActAndScheduleListResultDTO.ActivityListDTO> activityList = baseDao.getActivityList(formDTO);
if (CollectionUtils.isNotEmpty(activityList)){
activityList.forEach(a -> {
a.setIsMe(formDTO.getStaffId().equals(a.getStaffId()));
});
Map<String, List<ActAndScheduleListResultDTO.ActivityListDTO>> groupByDateId = activityList.stream().collect(Collectors.groupingBy(ActAndScheduleListResultDTO.ActivityListDTO::getDateId));
result.forEach(r -> {
groupByDateId.forEach((dateId,list) -> {
if (r.getDateId().equals(dateId)){
r.setActivityList(list);
r.setActivityTotal(list.size());
}
});
});
}
List<ActAndScheduleListResultDTO.ScheduleListDTO> scheduleList = scheduleDao.getScheduleList(formDTO);
if (CollectionUtils.isNotEmpty(scheduleList)){
scheduleList.forEach(s -> {
s.setIsMe(formDTO.getStaffId().equals(s.getStaffId()));
});
Map<String, List<ActAndScheduleListResultDTO.ScheduleListDTO>> groupByDateId = scheduleList.stream().collect(Collectors.groupingBy(ActAndScheduleListResultDTO.ScheduleListDTO::getDateId));
result.forEach(r -> {
groupByDateId.forEach((dateId,list) -> {
if (r.getDateId().equals(dateId)){
r.setScheduleList(list);
r.setScheduleTotal(list.size());
}
});
});
}
return result;
} }
public static List<ActAndScheduleListResultDTO> constructHomeSearchData(String startDate,String endDate){
List<ActAndScheduleListResultDTO> result = new ArrayList<>();
if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)){
List<String> days = DateUtils.getDaysBetween(startDate, endDate);
days.forEach(d -> {
ActAndScheduleListResultDTO dto = new ActAndScheduleListResultDTO();
dto.setDateId(d);
result.add(dto);
});
}
return result;
}
/**
* 党建小助手活动触发为用户推送消息
*/
@Override
public void partyMeetingMessage(PartyMeetingMessageMQMsg formDTO) {
//1.校验活动数据是否存在
IcPartyActEntity entity = baseDao.selectById(formDTO.getIcPartyActId());
if(null==entity){
String msg = "活动信息不存在,活动Id:" + formDTO.getIcPartyActId();
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), msg, msg);
}
//2.根据不同类型消息触发不同处理逻辑
//2-1.发布活动给居民端涉及党员已经工作端活动发布站推送党建活动消息
if("publish".equals(formDTO.getType())){
//查询活动对应的发布范围信息
LambdaQueryWrapper<IcPartyActOrgEntity> orgWrapper = new LambdaQueryWrapper<>();
orgWrapper.eq(IcPartyActOrgEntity::getDelFlag, NumConstant.ZERO_STR);
orgWrapper.eq(IcPartyActOrgEntity::getIcPartyActId, formDTO.getIcPartyActId());
List<IcPartyActOrgEntity> list = icPartyActOrgDao.selectList(orgWrapper);
List<String> groupIdList = list.stream().filter(ca -> ca.getOrgType().equals("6")).map(m -> m.getJoinOrgId()).collect(Collectors.toList());
List<String> partyOrgIdList = list.stream().filter(ca -> !ca.getOrgType().equals("6")).map(m -> m.getJoinOrgId()).collect(Collectors.toList());
//分别查询党组织、党小组下的人
List<String> userIdList = new ArrayList<>();
if(!CollectionUtils.isEmpty(groupIdList)){
Result<List<ResiGroupMemberDTO>> result = resiGroupOpenFeignClient.getMemberList(groupIdList);
if (!result.success()) {
throw new RenException("调用common service查询secret失败");
}
userIdList = result.getData().stream().map(ResiGroupMemberDTO::getCustomerUserId).collect(Collectors.toList());
}
if(!CollectionUtils.isEmpty(groupIdList)){
//TODO
}
//组装消息
}
}
} }

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

@ -3,6 +3,7 @@ package com.epmet.modules.partyOrg.service.impl;
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.rocketmq.messages.PartyMeetingMessageMQMsg;
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.exception.EpmetException; import com.epmet.commons.tools.exception.EpmetException;
@ -11,11 +12,15 @@ import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.constant.SystemMessageType;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.modules.partyOrg.dao.IcScheduleDao; import com.epmet.modules.partyOrg.dao.IcScheduleDao;
import com.epmet.modules.partyOrg.entity.IcScheduleEntity; import com.epmet.modules.partyOrg.entity.IcScheduleEntity;
import com.epmet.modules.partyOrg.service.IcScheduleService; import com.epmet.modules.partyOrg.service.IcScheduleService;
import com.epmet.resi.partymember.dto.IcScheduleDTO; import com.epmet.resi.partymember.dto.IcScheduleDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.AddOrEditScheduleFormDTO; import com.epmet.resi.partymember.dto.partyOrg.form.AddOrEditScheduleFormDTO;
import com.epmet.send.SendMqMsgUtil;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -112,6 +117,13 @@ public class IcScheduleServiceImpl extends BaseServiceImpl<IcScheduleDao, IcSche
e.setPid(agencyInfo.getPid()); e.setPid(agencyInfo.getPid());
e.setOrgIdPath("".equals(agencyInfo.getPids()) ? "" : agencyInfo.getPids().concat(":").concat(agencyInfo.getId())); e.setOrgIdPath("".equals(agencyInfo.getPids()) ? "" : agencyInfo.getPids().concat(":").concat(agencyInfo.getId()));
baseDao.insert(e); baseDao.insert(e);
PartyMeetingMessageMQMsg msg = new PartyMeetingMessageMQMsg();
msg.setCustomerId(formDTO.getCustomerId());
msg.setIcPartyActId(e.getId());
msg.setType("notify");
SendMqMsgUtil.build()
.openFeignClient(SpringContextUtils.getBean(EpmetMessageOpenFeignClient.class))
.sendRocketMqMsg(SystemMessageType.PARTY_MEETING_MESSAGE, msg);
} }
/** /**

3
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/mq/listener/PartyMeetingMessageListener.java

@ -9,6 +9,7 @@ import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.modules.partyOrg.service.IcPartyActService;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
@ -69,7 +70,7 @@ public class PartyMeetingMessageListener implements MessageListenerConcurrently
lock = distributedLock.getLock(String.format("lock:ic_warn_stats:%s", obj.getCustomerId()), lock = distributedLock.getLock(String.format("lock:ic_warn_stats:%s", obj.getCustomerId()),
30L, 30L, TimeUnit.SECONDS); 30L, 30L, TimeUnit.SECONDS);
//待执行方法 //待执行方法
//SpringContextUtils.getBean(IcVolunteerPolyService.class).volunteerChanged(obj); SpringContextUtils.getBean(IcPartyActService.class).partyMeetingMessage(obj);
} catch (EpmetException e) { } catch (EpmetException e) {
// 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试

10
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyActDao.xml

@ -21,6 +21,7 @@
<resultMap id="getActivityListMap" type="com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO$ActivityListDTO"> <resultMap id="getActivityListMap" type="com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO$ActivityListDTO">
<result property="activityId" column="activityId"/> <result property="activityId" column="activityId"/>
<result property="topic" column="topic"/> <result property="topic" column="topic"/>
<result property="dateId" column="dateId"/>
<result property="address" column="address"/> <result property="address" column="address"/>
<result property="holdTime" column="holdTime"/> <result property="holdTime" column="holdTime"/>
<result property="joinTypeValue" column="joinTypeValue"/> <result property="joinTypeValue" column="joinTypeValue"/>
@ -39,6 +40,7 @@
pa.TOPIC, pa.TOPIC,
pa.ADDRESS, pa.ADDRESS,
DATE_FORMAT(pa.HOLD_TIME,'%Y-%m-%d %H:%i:%s') AS holdTime, DATE_FORMAT(pa.HOLD_TIME,'%Y-%m-%d %H:%i:%s') AS holdTime,
DATE_FORMAT(pa.HOLD_TIME,'%Y%m%d') AS dateId,
pa.ACT_TYPE AS type, pa.ACT_TYPE AS type,
(CASE WHEN pa.JOIN_USER_TYPE = '1' THEN '支部委员' (CASE WHEN pa.JOIN_USER_TYPE = '1' THEN '支部委员'
WHEN pa.JOIN_USER_TYPE = '0' THEN '全体党员' WHEN pa.JOIN_USER_TYPE = '0' THEN '全体党员'
@ -54,10 +56,18 @@
LEFT JOIN ic_party_act_org ao ON (ao.IC_PARTY_ACT_ID = pa.ID AND ao.DEL_FLAG = 0) LEFT JOIN ic_party_act_org ao ON (ao.IC_PARTY_ACT_ID = pa.ID AND ao.DEL_FLAG = 0)
WHERE pa.DEL_FLAG = 0 WHERE pa.DEL_FLAG = 0
AND pa.CUSTOMER_ID = #{customerId} AND pa.CUSTOMER_ID = #{customerId}
<if test='null != dateId and dateId != "" '>
AND DATE_FORMAT(pa.HOLD_TIME,'%Y%m%d') = #{dateId} AND DATE_FORMAT(pa.HOLD_TIME,'%Y%m%d') = #{dateId}
</if>
<if test=' isSelf == "1" '> <if test=' isSelf == "1" '>
AND pa.PUBLISH_STAFF_ID = #{staffId} AND pa.PUBLISH_STAFF_ID = #{staffId}
</if> </if>
<if test='null != startDate and startDate != ""'>
AND DATE_FORMAT(pa.HOLD_TIME,'%Y%m%d') >= #{startDate}
</if>
<if test='null != endDate and endDate != ""'>
AND DATE_FORMAT(pa.HOLD_TIME,'%Y%m%d') <![CDATA[ <= ]]> #{endDate}
</if>
AND pa.PUBLISH_ORG_PATH LIKE CONCAT(#{path},'%') AND pa.PUBLISH_ORG_PATH LIKE CONCAT(#{path},'%')
</select> </select>
</mapper> </mapper>

15
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcScheduleDao.xml

@ -25,10 +25,10 @@
FROM ic_schedule FROM ic_schedule
WHERE DEL_FLAG = 0 WHERE DEL_FLAG = 0
AND CUSTOMER_ID = #{customerId} AND CUSTOMER_ID = #{customerId}
AND DATE_FORMAT(CREATED_TIME,'%Y') = #{yearId} AND DATE_FORMAT(REMIND_TIME,'%Y') = #{yearId}
AND ORG_ID_PATH LIKE CONCAT('%',#{agencyId},'%') AND ORG_ID_PATH LIKE CONCAT('%',#{agencyId},'%')
AND IS_PUBLIC = '1' OR (STAFF_ID = #{staffId} AND IS_PUBLIC = '0') AND IS_PUBLIC = '1' OR (STAFF_ID = #{staffId} AND IS_PUBLIC = '0')
GROUP BY DATE_FORMAT(CREATED_TIME,'%Y%m') GROUP BY DATE_FORMAT(REMIND_TIME,'%Y%m')
UNION ALL UNION ALL
SELECT SELECT
COUNT(id) as count, COUNT(id) as count,
@ -49,12 +49,21 @@
ID AS scheduleId, ID AS scheduleId,
TITLE, TITLE,
DATE_FORMAT(REMIND_TIME,'%Y-%m-%d %H:%i:%s') AS remindTime, DATE_FORMAT(REMIND_TIME,'%Y-%m-%d %H:%i:%s') AS remindTime,
DATE_FORMAT(REMIND_TIME,'%Y%m%d') AS dateId,
REMARK, REMARK,
STAFF_ID STAFF_ID
FROM ic_schedule FROM ic_schedule
WHERE DEL_FLAG = 0 WHERE DEL_FLAG = 0
AND CUSTOMER_ID = #{customerId} AND CUSTOMER_ID = #{customerId}
AND DATE_FORMAT(CREATED_TIME,'%Y%m%d') = #{dateId} <if test='null != dateId and dateId != "" '>
AND DATE_FORMAT(REMIND_TIME,'%Y%m%d') = #{dateId}
</if>
<if test='null != startDate and startDate != ""'>
AND DATE_FORMAT(REMIND_TIME,'%Y%m%d') >= #{startDate}
</if>
<if test='null != endDate and endDate != ""'>
AND DATE_FORMAT(REMIND_TIME,'%Y%m%d') <![CDATA[ <= ]]> #{endDate}
</if>
AND ORG_ID_PATH LIKE CONCAT('%',#{agencyId},'%') AND ORG_ID_PATH LIKE CONCAT('%',#{agencyId},'%')
AND IS_PUBLIC = '1' OR (STAFF_ID = #{staffId} AND IS_PUBLIC = '0') AND IS_PUBLIC = '1' OR (STAFF_ID = #{staffId} AND IS_PUBLIC = '0')
</select> </select>

Loading…
Cancel
Save