Browse Source

批量发送通知bug修改

dev
zhaoqifeng 3 years ago
parent
commit
5f9c9d8009
  1. 12
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SendNoticeFormDTO.java
  2. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java

12
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SendNoticeFormDTO.java

@ -4,7 +4,8 @@ import com.epmet.commons.tools.validator.group.DefaultGroup;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;
@ -22,22 +23,23 @@ public class SendNoticeFormDTO implements Serializable {
/**
* 用户列表
*/
@NotNull(message = "用户列表不能为空", groups = DefaultGroup.class)
@NotEmpty(message = "用户列表不能为空", groups = DefaultGroup.class)
private List<UserListBean> userList;
/**
* 通知渠道通知渠道 0小程序通知1短信通知
*/
@NotNull(message = "通知渠道不能为空", groups = DefaultGroup.class)
@NotEmpty(message = "请选择通知渠道", groups = DefaultGroup.class)
private List<String> channel;
/**
* 通知来源 0 行程上报1 疫苗接种2 核酸检测
*/
@NotNull(message = "通知来源不能为空", groups = DefaultGroup.class)
@NotEmpty(message = "通知来源不能为空", groups = DefaultGroup.class)
private String origin;
/**
* 通知内容
*/
@NotNull(message = "通知内容不能为空", groups = DefaultGroup.class)
@NotEmpty(message = "通知内容不能为空", groups = DefaultGroup.class)
@Size(max = 500, message = "通知内容不超过500字")
private String content;
/**
* 组织名

5
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java

@ -137,7 +137,10 @@ public class IcNoticeServiceImpl extends BaseServiceImpl<IcNoticeDao, IcNoticeEn
//保存消息
String channel = StringUtils.join(formDTO.getChannel(), StrConstant.COMMA);
String finalOrgName = orgName;
List<IcNoticeEntity> entityList = formDTO.getUserList().stream().map(item -> {
List<SendNoticeFormDTO.UserListBean> userBeanList = formDTO.getUserList().stream().collect(Collectors.collectingAndThen(
Collectors.toCollection(() -> new TreeSet<>(
Comparator.comparing( SendNoticeFormDTO.UserListBean::getIdCard))), ArrayList::new));
List<IcNoticeEntity> entityList = userBeanList.stream().map(item -> {
IcNoticeEntity entity = new IcNoticeEntity();
entity.setCustomerId(formDTO.getCustomerId());
entity.setChannel(channel);

Loading…
Cancel
Save