|
|
@@ -1,7 +1,13 @@
|
|
|
package com.nb.app.msg.service;
|
|
|
|
|
|
+import cn.hutool.extra.spring.SpringUtil;
|
|
|
+import com.nb.app.msg.bean.MsgBean;
|
|
|
import com.nb.app.msg.entity.AppConsultEntity;
|
|
|
+import com.nb.app.msg.enums.MsgEnum;
|
|
|
+import com.nb.app.msg.event.SaveMsgEvent;
|
|
|
import com.nb.app.msg.mapper.AppConsultMapper;
|
|
|
+import com.nb.auth.bean.LoginUser;
|
|
|
+import com.nb.auth.utils.SecurityUtil;
|
|
|
import com.nb.common.crud.BaseService;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -30,4 +36,24 @@ public class LocalAppConsultService extends BaseService<AppConsultMapper, AppCon
|
|
|
public void validateBeforeDelete(String id) {
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void postSave(AppConsultEntity entity) {
|
|
|
+ LoginUser loginUser = SecurityUtil.getLoginUser();
|
|
|
+ SpringUtil.publishEvent(new SaveMsgEvent(
|
|
|
+ this,
|
|
|
+ MsgBean.builder()
|
|
|
+ .msgType(MsgEnum.CONSUL)
|
|
|
+ .senderId(String.valueOf(loginUser.getId()))
|
|
|
+ .senderNickname(loginUser.getUsername())
|
|
|
+ .patientId(entity.getPatientId())
|
|
|
+ .patientName(entity.getPatientName())
|
|
|
+ .patientCode(entity.getPatientCode())
|
|
|
+ .patientAge(entity.getPatientAge())
|
|
|
+ .receiverId(entity.getDoctorId())
|
|
|
+ .payload(entity.getId())
|
|
|
+ .extend(entity.getId())
|
|
|
+ .build()
|
|
|
+ ));
|
|
|
+ }
|
|
|
}
|