|
|
@ -174,9 +174,15 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart |
|
|
|
public Map<String, String> addOrUpdate(IcPartyActAddOrUpdateFormDTO formDTO) { |
|
|
|
CustomerStaffInfoCacheResult staffInfo=queryStaffInfo(formDTO.getCustomerId(),formDTO.getPublishStaffId()); |
|
|
|
IcPartyActEntity icPartyActEntity= ConvertUtils.sourceToTarget(formDTO,IcPartyActEntity.class); |
|
|
|
//计算好自动发布的时间
|
|
|
|
icPartyActEntity.setAutoPublicTime(DateUtils.calDateBaseDay(formDTO.getHoldTime(),formDTO.getAutoPublicType())); |
|
|
|
icPartyActEntity.setPublishStaffName(staffInfo.getRealName()); |
|
|
|
icPartyActEntity.setOrgId(staffInfo.getAgencyId()); |
|
|
|
|
|
|
|
//!!!!!!!不用前端传的了。 我自己查询吧
|
|
|
|
IcPartyOrgInfo icPartyOrgInfo=SpringContextUtils.getBean(IcPartyOrgService.class).queryIcPartyOrgInfo(formDTO.getPublishPartyOrgId()); |
|
|
|
icPartyActEntity.setPublishOrgPath(icPartyOrgInfo.getPartyOrgIdPath()); |
|
|
|
|
|
|
|
AgencyInfoCache agencyInfoCache= CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId()); |
|
|
|
icPartyActEntity.setPid(agencyInfoCache.getPid()); |
|
|
|
if(StringUtils.isBlank(agencyInfoCache.getPid())||NumConstant.ZERO_STR.equals(agencyInfoCache.getPid())){ |
|
|
@ -194,7 +200,9 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart |
|
|
|
//保留原来的发布状态
|
|
|
|
IcPartyActEntity origin=baseDao.selectById(formDTO.getIcPartyActId()); |
|
|
|
icPartyActEntity.setIsPublish(origin.getIsPublish()); |
|
|
|
//修改活动
|
|
|
|
baseDao.updateById(icPartyActEntity); |
|
|
|
|
|
|
|
//已发布,在编辑的时候,需要发送消息
|
|
|
|
if(NumConstant.ONE_STR.equals(icPartyActEntity.getIsPublish())&&NumConstant.ONE_STR.equals(icPartyActEntity.getIsAutoInform())){ |
|
|
|
sendMsg=true; |
|
|
@ -207,6 +215,7 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart |
|
|
|
}else{ |
|
|
|
icPartyActEntity.setIsPublish(NumConstant.ZERO_STR); |
|
|
|
} |
|
|
|
//新增活动
|
|
|
|
baseDao.insert(icPartyActEntity); |
|
|
|
} |
|
|
|
//新增参加参加活动党组织
|
|
|
@ -214,8 +223,12 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart |
|
|
|
orgList.forEach(joinOrg->{ |
|
|
|
joinOrg.setCustomerId(formDTO.getCustomerId()); |
|
|
|
joinOrg.setIcPartyActId(icPartyActEntity.getId()); |
|
|
|
//!!!!!!!不用前端传的了。 我自己查询吧
|
|
|
|
IcPartyOrgInfo joinPartyOrgInfo=SpringContextUtils.getBean(IcPartyOrgService.class).queryIcPartyOrgInfo(joinOrg.getId()); |
|
|
|
joinOrg.setJoinOrgPath(joinPartyOrgInfo.getPartyOrgIdPath()); |
|
|
|
icPartyActOrgDao.insert(joinOrg); |
|
|
|
}); |
|
|
|
|
|
|
|
//批量新增附件
|
|
|
|
List<ResiPartymemberAttachmentEntity> attachmentEntityList=ConvertUtils.sourceToTarget(formDTO.getAttachmentList(),ResiPartymemberAttachmentEntity.class); |
|
|
|
int attSort = 1; |
|
|
@ -227,10 +240,9 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart |
|
|
|
attSort++; |
|
|
|
resiPartymemberAttachmentDao.insert(att); |
|
|
|
} |
|
|
|
Map<String, String> map=new HashMap<>(); |
|
|
|
map.put("icPartyActId",icPartyActEntity.getId()); |
|
|
|
//已经发布的,编辑需要发消息
|
|
|
|
if(sendMsg){ |
|
|
|
|
|
|
|
//已经发布的活动+且活动未开始的,编辑后需要发消息
|
|
|
|
if (sendMsg && icPartyActEntity.getHoldTime().compareTo(new Date()) < 1) { |
|
|
|
PartyMeetingMessageMQMsg msg = new PartyMeetingMessageMQMsg(); |
|
|
|
msg.setCustomerId(formDTO.getCustomerId()); |
|
|
|
msg.setIcPartyActId(icPartyActEntity.getId()); |
|
|
@ -239,6 +251,9 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart |
|
|
|
.openFeignClient(SpringContextUtils.getBean(EpmetMessageOpenFeignClient.class)) |
|
|
|
.sendRocketMqMsg(SystemMessageType.PARTY_MEETING_MESSAGE, msg); |
|
|
|
} |
|
|
|
|
|
|
|
Map<String, String> map=new HashMap<>(); |
|
|
|
map.put("icPartyActId",icPartyActEntity.getId()); |
|
|
|
return map; |
|
|
|
} |
|
|
|
|
|
|
@ -446,7 +461,7 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart |
|
|
|
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())); |
|
|
|
formDTO.setPath(StringUtils.isBlank(icPartyOrgDTO.getOrgPid()) || icPartyOrgDTO.getOrgPid().equals(NumConstant.ZERO_STR) ? icPartyOrgDTO.getId() : icPartyOrgDTO.getOrgPids().concat(":").concat(icPartyOrgDTO.getId())); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
@ -626,8 +641,8 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart |
|
|
|
icPartyActEntity.setIsPublish(NumConstant.ONE_STR); |
|
|
|
icPartyActEntity.setUpdatedBy(userId); |
|
|
|
baseDao.updateById(icPartyActEntity); |
|
|
|
//发送消息
|
|
|
|
if(NumConstant.ONE_STR.equals(icPartyActEntity.getIsAutoInform())){ |
|
|
|
//发送消息:自动通知参加人员+活动未开始的
|
|
|
|
if (NumConstant.ONE_STR.equals(icPartyActEntity.getIsAutoInform()) && icPartyActEntity.getHoldTime().compareTo(new Date()) < 1) { |
|
|
|
PartyMeetingMessageMQMsg msg = new PartyMeetingMessageMQMsg(); |
|
|
|
msg.setCustomerId(icPartyActEntity.getCustomerId()); |
|
|
|
msg.setIcPartyActId(icPartyActEntity.getId()); |
|
|
@ -712,13 +727,16 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart |
|
|
|
//置为已发布
|
|
|
|
act.setIsPublish(NumConstant.ONE_STR); |
|
|
|
baseDao.updateById(act); |
|
|
|
PartyMeetingMessageMQMsg msg = new PartyMeetingMessageMQMsg(); |
|
|
|
msg.setCustomerId(act.getCustomerId()); |
|
|
|
msg.setIcPartyActId(act.getId()); |
|
|
|
msg.setType("publish"); |
|
|
|
SendMqMsgUtil.build() |
|
|
|
.openFeignClient(SpringContextUtils.getBean(EpmetMessageOpenFeignClient.class)) |
|
|
|
.sendRocketMqMsg(SystemMessageType.PARTY_MEETING_MESSAGE, msg); |
|
|
|
//选择了自动通知参加人员的,需要发送消息
|
|
|
|
if(NumConstant.ONE_STR.equals(act.getIsAutoInform())){ |
|
|
|
PartyMeetingMessageMQMsg msg = new PartyMeetingMessageMQMsg(); |
|
|
|
msg.setCustomerId(act.getCustomerId()); |
|
|
|
msg.setIcPartyActId(act.getId()); |
|
|
|
msg.setType("publish"); |
|
|
|
SendMqMsgUtil.build() |
|
|
|
.openFeignClient(SpringContextUtils.getBean(EpmetMessageOpenFeignClient.class)) |
|
|
|
.sendRocketMqMsg(SystemMessageType.PARTY_MEETING_MESSAGE, msg); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |