|
@@ -1,5 +1,6 @@
|
|
|
package thyyxxk.webserver.service.medicalinsurance;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import thyyxxk.webserver.config.exception.ExceptionEnum;
|
|
@@ -13,6 +14,8 @@ import thyyxxk.webserver.entity.inpatient.dismiss.ZyDisYbDiag;
|
|
|
import thyyxxk.webserver.entity.inpatient.dismiss.ZyDisYbSrgry;
|
|
|
import thyyxxk.webserver.entity.inpatient.patient.Patient;
|
|
|
import thyyxxk.webserver.entity.inpatient.patient.ZyInYbDiag;
|
|
|
+import thyyxxk.webserver.entity.socketmessage.ApiMessageBody;
|
|
|
+import thyyxxk.webserver.service.externalhttp.WebSocketService;
|
|
|
import thyyxxk.webserver.service.inpatient.casefrontsheet.CaseFrontSheetMainService;
|
|
|
import thyyxxk.webserver.service.redislike.RedisLikeService;
|
|
|
import thyyxxk.webserver.service.inpatient.PatientService;
|
|
@@ -37,15 +40,17 @@ public class SiSettleApplyService {
|
|
|
private final RedisLikeService redis;
|
|
|
private final PatientService ptntSrvc;
|
|
|
private final CaseFrontSheetMainService csfrntSrvc;
|
|
|
+ private final WebSocketService socketService;
|
|
|
private static final Integer APPROVED = 1;
|
|
|
private static final Integer REAL_SETTLE = 1;
|
|
|
private static final Integer MIDDLE_SETTLE = 2;
|
|
|
|
|
|
- public SiSettleApplyService(SiSettleApplyDao dao, RedisLikeService redis, PatientService ptntSrvc, CaseFrontSheetMainService csfrntSrvc) {
|
|
|
+ public SiSettleApplyService(SiSettleApplyDao dao, RedisLikeService redis, PatientService ptntSrvc, CaseFrontSheetMainService csfrntSrvc, WebSocketService socketService) {
|
|
|
this.dao = dao;
|
|
|
this.redis = redis;
|
|
|
this.ptntSrvc = ptntSrvc;
|
|
|
this.csfrntSrvc = csfrntSrvc;
|
|
|
+ this.socketService = socketService;
|
|
|
}
|
|
|
|
|
|
public ResultVo<SiSettleApply> selectSettleApply(Patient p) {
|
|
@@ -88,6 +93,18 @@ public class SiSettleApplyService {
|
|
|
apply.setSortNo(apply.getSortNo() + 1);
|
|
|
apply.setInputStaff(TokenUtil.getInstance().getTokenUserId());
|
|
|
dao.insertSettleApply(apply);
|
|
|
+
|
|
|
+ JSONObject messageWrapper = new JSONObject();
|
|
|
+ messageWrapper.put("name", "systemNotification");
|
|
|
+ JSONObject messageBody = new JSONObject();
|
|
|
+ messageBody.put("title", "提示");
|
|
|
+ messageBody.put("message", "【住院号:" + apply.getPatNo() + "】有新的出院申请。");
|
|
|
+ messageWrapper.put("message", messageBody);
|
|
|
+ ApiMessageBody body = new ApiMessageBody();
|
|
|
+ body.setGroupId("3020100");
|
|
|
+ body.setMessageContent(messageWrapper.toJSONString());
|
|
|
+ socketService.sendMessageByGroupId(body);
|
|
|
+
|
|
|
return ResultVoUtil.success("提交成功。");
|
|
|
}
|
|
|
|