Browse Source

已经发布的编辑需要发送消息

master
yinzuomei 3 years ago
parent
commit
9e64429aea
  1. 22
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java

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

@ -17,6 +17,7 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.SystemMessageType;
import com.epmet.dto.form.UserMessageFormDTO;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.modules.partyOrg.dao.*;
@ -37,6 +38,7 @@ import com.epmet.resi.partymember.dto.partyOrg.form.ActAndScheduleListFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.HomeMonthTotalFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO;
import com.epmet.send.SendMqMsgUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
@ -157,13 +159,23 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart
icPartyActEntity.setOrgId(staffInfo.getAgencyId());
icPartyActEntity.setPid(staffInfo.getParentAgency().getId());
icPartyActEntity.setOrgIdPath(staffInfo.getAgencyPIds());
Boolean sendMsg=false;
if(StringUtils.isNotBlank(formDTO.getIcPartyActId())){
icPartyActEntity.setId(formDTO.getIcPartyActId());
//删除附件、删除参加组织
SpringContextUtils.getBean(ResiPartymemberAttachmentService.class).deleteByBusinessId(formDTO.getCustomerId(), Arrays.asList(formDTO.getIcPartyActId()));
SpringContextUtils.getBean(IcPartyActOrgService.class).deleteByPartyActId(formDTO.getCustomerId(), Arrays.asList(formDTO.getIcPartyActId()));
//保留原来的发布状态
IcPartyActEntity origin=baseDao.selectById(formDTO.getIcPartyActId());
icPartyActEntity.setIsPublish(origin.getIsPublish());
baseDao.updateById(icPartyActEntity);
//已发布,在编辑的时候,需要发送消息
if(NumConstant.ONE_STR.equals(icPartyActEntity.getIsPublish())){
sendMsg=true;
}
}else{
//默认是未发布
icPartyActEntity.setIsPublish(NumConstant.ZERO_STR);
baseDao.insert(icPartyActEntity);
}
//新增参加参加活动党组织
@ -186,6 +198,16 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart
}
Map<String, String> map=new HashMap<>();
map.put("icPartyActId",icPartyActEntity.getId());
//已经发布的,编辑需要发消息
if(sendMsg){
PartyMeetingMessageMQMsg msg = new PartyMeetingMessageMQMsg();
msg.setCustomerId(formDTO.getCustomerId());
msg.setIcPartyActId(icPartyActEntity.getId());
msg.setType("publish");
SendMqMsgUtil.build()
.openFeignClient(SpringContextUtils.getBean(EpmetMessageOpenFeignClient.class))
.sendRocketMqMsg(SystemMessageType.PARTY_MEETING_MESSAGE, msg);
}
return map;
}

Loading…
Cancel
Save