|
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.xy.dto.MsgSysMonitorNoticeDto;
|
|
|
+import com.xy.dto.MsgUserMessageDto;
|
|
|
import com.xy.entity.MsgSysMonitorNotice;
|
|
|
import com.xy.mapper.MsgSysMonitorNoticeMapper;
|
|
|
import com.xy.utils.Emptys;
|
|
@@ -13,6 +14,7 @@ import com.xy.utils.R;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
+import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
@@ -33,10 +35,12 @@ import static com.xy.utils.PlusBeans.toPageBean;
|
|
|
* @since 2023-03-13
|
|
|
*/
|
|
|
@Service
|
|
|
-@AllArgsConstructor
|
|
|
+@AllArgsConstructor(onConstructor_ = @Lazy)
|
|
|
@Api(tags = "系统消息")
|
|
|
public class MsgSysMonitorNoticeServiceImpl extends ServiceImpl<MsgSysMonitorNoticeMapper, MsgSysMonitorNotice> implements MsgSysMonitorNoticeService {
|
|
|
|
|
|
+ private MsgUserMessageServiceImpl msgUserMessageService;
|
|
|
+
|
|
|
@Override
|
|
|
@ApiOperation("对象查询")
|
|
|
public R<MsgSysMonitorNoticeDto.Vo> obj(@RequestBody MsgSysMonitorNoticeDto.Vo vo) {
|
|
@@ -70,6 +74,15 @@ public class MsgSysMonitorNoticeServiceImpl extends ServiceImpl<MsgSysMonitorNot
|
|
|
public R save(@RequestBody @Validated MsgSysMonitorNoticeDto.Save save) {
|
|
|
MsgSysMonitorNotice saveInfo = copy(MsgSysMonitorNotice.class, save);
|
|
|
save(saveInfo);
|
|
|
+ Long userId = save.getUserId();
|
|
|
+ if (userId != null) {
|
|
|
+ MsgUserMessageDto.Save mum = new MsgUserMessageDto.Save();
|
|
|
+ mum.setMsgId(saveInfo.getMsgId());
|
|
|
+ mum.setMsgType(saveInfo.getMsgType());
|
|
|
+ mum.setPriority(saveInfo.getPriority());
|
|
|
+ mum.setUserId(userId);
|
|
|
+ msgUserMessageService.save(mum);
|
|
|
+ }
|
|
|
return R.ok();
|
|
|
}
|
|
|
|