|
|
|
@ -2,8 +2,6 @@ package com.hnac.hzims.message.fegin;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
import com.google.common.collect.Lists; |
|
|
|
|
import com.hnac.hzims.common.invalid.Create; |
|
|
|
|
import com.hnac.hzims.message.MessageConstants; |
|
|
|
|
import com.hnac.hzims.message.dto.*; |
|
|
|
@ -12,18 +10,17 @@ import com.hnac.hzims.message.entity.config.MessageTemplateEntity;
|
|
|
|
|
import com.hnac.hzims.message.service.IMessagePushRecordService; |
|
|
|
|
import com.hnac.hzims.message.service.IMessageService; |
|
|
|
|
import com.hnac.hzims.message.service.IMessageTemplateService; |
|
|
|
|
import com.hnac.hzims.message.service.impl.PushMessageServiceImpl; |
|
|
|
|
import com.hnac.hzims.message.service.impl.SmsMessageServiceImpl; |
|
|
|
|
import com.xxl.job.core.log.XxlJobLogger; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
|
import org.springblade.core.boot.ctrl.BladeController; |
|
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.core.tool.utils.*; |
|
|
|
|
import org.springblade.system.entity.Dept; |
|
|
|
|
import org.springblade.core.tool.utils.BeanUtil; |
|
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
|
import org.springblade.core.tool.utils.ObjectUtil; |
|
|
|
|
import org.springblade.core.tool.utils.SpringUtil; |
|
|
|
|
import org.springblade.system.feign.ISysClient; |
|
|
|
|
import org.springblade.system.user.cache.UserCache; |
|
|
|
|
import org.springblade.system.user.entity.User; |
|
|
|
@ -32,10 +29,10 @@ import org.springframework.validation.annotation.Validated;
|
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
import javax.validation.Valid; |
|
|
|
|
import javax.xml.ws.WebServiceException; |
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
import java.time.ZoneId; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.Optional; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -90,7 +87,7 @@ public class MessageClient extends BladeController implements IMessageClient{
|
|
|
|
|
entity.setDeptName(Func.isNotEmpty(entity.getDeptName()) ? entity.getDeptName() : this.getDeptNameById(entity.getDeptId())); |
|
|
|
|
entity.setMessageId(IdWorker.getId()); |
|
|
|
|
entity.setPusher(userId.toString()); |
|
|
|
|
//entity.setPusherName(Optional.ofNullable(UserCache.getUser(userId)).map(User::getName).orElse(null));
|
|
|
|
|
entity.setPusherName(Optional.ofNullable(UserCache.getUser(userId)).map(User::getName).orElse(null)); |
|
|
|
|
entity.setPushType(MessageConstants.IMMEDIATELY); |
|
|
|
|
entity.setAccount(userId.toString()); |
|
|
|
|
entity.setPlanTime(LocalDateTime.now()); |
|
|
|
@ -98,11 +95,11 @@ public class MessageClient extends BladeController implements IMessageClient{
|
|
|
|
|
entity.setCreateDept(entity.getDeptId()); |
|
|
|
|
return entity; |
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
/*boolean isSave = recordService.saveBatch(messages); |
|
|
|
|
boolean isSave = recordService.saveBatch(messages); |
|
|
|
|
if(isSave){ |
|
|
|
|
return R.data(recordService.sendWxMessageByUser(request,messages)); |
|
|
|
|
}*/ |
|
|
|
|
return R.data(recordService.sendWxMessageByUser(request,messages)); |
|
|
|
|
} |
|
|
|
|
return R.data(false); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@PostMapping(PLAN_SEND_MESSAGE) |
|
|
|
|