Browse Source

消缺流程消息推送改为多个推送

zhongwei
tyty 1 year ago
parent
commit
288bbb91ab
  1. 23
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java

23
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java

@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hnac.hzims.common.logs.utils.StringUtils;
import com.hnac.hzims.fdp.feign.IFdpTaskClient;
import com.hnac.hzims.message.MessageConstants;
import com.hnac.hzims.message.dto.MessagePushRecordDto;
import com.hnac.hzims.message.dto.BusinessMessageDTO;
import com.hnac.hzims.message.fegin.IMessageClient;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.operational.access.dto.OperAccessPlanDTO;
@ -33,7 +33,6 @@ import com.hnac.hzims.ticket.repair.entity.RepairEntity;
import com.hnac.hzims.ticket.repair.fegin.IRepairClient;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.math.NumberUtils;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.utils.AuthUtil;
@ -322,15 +321,12 @@ public class DefectCheckServiceImpl extends BaseServiceImpl<OperPhenomenonMapper
private void sendMessage(ProcessWorkFlowResponse processWorkFlowResponse, OperPhenomenonEntity operPhenomenonEntity) {
//推送消息
if (processWorkFlowResponse.getTaskId() != null) {
MessagePushRecordDto message = new MessagePushRecordDto();
BusinessMessageDTO message = new BusinessMessageDTO();
message.setBusinessClassify("business");
message.setBusinessKey(MessageConstants.BusinessClassifyEnum.OPERATIONDEFECTMESSAGE.getKey());
message.setSubject(MessageConstants.BusinessClassifyEnum.OPERATIONDEFECTMESSAGE.getDescription());
message.setTaskId(operPhenomenonEntity.getId());
message.setTenantId("200000");
message.setTypes(Arrays.asList(MessageConstants.APP_PUSH, MessageConstants.WS_PUSH));
message.setPushType(MessageConstants.IMMEDIATELY);
String countent =
"您的消缺流程待审批!现象名称:".concat(operPhenomenonEntity.getFaultName())
.concat(",审批环节:")
@ -346,18 +342,9 @@ public class DefectCheckServiceImpl extends BaseServiceImpl<OperPhenomenonMapper
log.error("推送的消息不能为空哦,{}", userIds);
return;
}
String[] split = userIds.split(",");
for (String userId : split) {
message.setPusher(userId);
User user = UserCache.getUser(NumberUtils.toLong(userId));
if (ObjectUtils.isNotEmpty(user)) {
message.setPusherName(user.getName());
}
message.setAccount(userId);
message.setCreateDept(Long.valueOf(user.getDeptId()));
message.setCreateUser(NumberUtils.toLong(userId));
messageClient.sendMessage(message);
}
message.setUserIds(userIds);
message.setCreateUser(operPhenomenonEntity.getCreateUser());
messageClient.sendAppAndWsMsgByUsers(message);
}
}

Loading…
Cancel
Save