This commit is contained in:
2024-10-09 08:48:45 +08:00
parent 875a84cfb2
commit f95a5c0af2
5 changed files with 144 additions and 64 deletions
@@ -104,14 +104,16 @@ public class MsgNotifyTitleController {
@ViReturn
@RequiresAuthentication
public Object doSend(String id, String[] sendTypes, String content) {
MsgNotify msgNotify = baseService.dao().fetch(MsgNotify.class, id);
List<NutMap> msgNotifyUser = msgNotifyService.getMsgNotifyUser(id);
List<String> userData = msgNotifyService.userData(msgNotifyUser);
msgNotifyService.sendMsg(Arrays.asList(sendTypes), userData, content);
msgNotifyUser.forEach(v -> {
baseService.dao().update(MsgNotify.class, Chain.make("hold", true).add("sendTime", DateUtil.getDateTime()), Cnd.where("id", "=", v.getString("titleId")));
});
if (!msgNotify.isHold()){
baseService.dao().update(MsgNotify.class,
Chain.make("hold", true)
.add("sendTime", DateUtil.getDateTime()),
Cnd.where("id", "=", id));
}
return null;
}