|
@@ -1,36 +1,35 @@
|
|
|
package thyyxxk.webserver.service.zhuyuanyisheng;
|
|
|
|
|
|
-import cn.hutool.extra.spring.SpringUtil;
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
-import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.aspectj.lang.annotation.Pointcut;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
import thyyxxk.webserver.config.exception.BizException;
|
|
|
import thyyxxk.webserver.config.exception.ExceptionEnum;
|
|
|
import thyyxxk.webserver.constants.Capacity;
|
|
|
+import thyyxxk.webserver.constants.Message;
|
|
|
+import thyyxxk.webserver.dao.his.zhuyuanyisheng.CheckTheCallbackDao;
|
|
|
import thyyxxk.webserver.dao.his.zhuyuanyisheng.JianYanJianChaDao;
|
|
|
import thyyxxk.webserver.dao.his.zhuyuanyisheng.YiZhuLuRuDao;
|
|
|
import thyyxxk.webserver.entity.ResultVo;
|
|
|
import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
|
|
|
import thyyxxk.webserver.entity.login.UserInfo;
|
|
|
+import thyyxxk.webserver.entity.socketmessage.ApiMessageBody;
|
|
|
import thyyxxk.webserver.entity.zhuyuanyisheng.jianyanjiancha.*;
|
|
|
import thyyxxk.webserver.entity.zhuyuanyisheng.query.ChaXunJianChaHeJianYan;
|
|
|
import thyyxxk.webserver.entity.zhuyuanyisheng.yizhuluru.PatientTemp;
|
|
|
import thyyxxk.webserver.entity.zhuyuanyisheng.yizhuluru.XinZhenYiZhu;
|
|
|
import thyyxxk.webserver.service.PublicServer;
|
|
|
+import thyyxxk.webserver.service.externalhttp.WebSocketService;
|
|
|
import thyyxxk.webserver.service.redislike.RedisLikeService;
|
|
|
import thyyxxk.webserver.utils.*;
|
|
|
|
|
|
import java.lang.reflect.Field;
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.nio.channels.NonWritableChannelException;
|
|
|
+import java.security.cert.TrustAnchor;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -49,12 +48,16 @@ public class JianYanJianChaShenQingService {
|
|
|
private final PublicServer publicServer;
|
|
|
private final YiZhuLuRuDao yiZhuLuRuDao;
|
|
|
private final RedisLikeService realtimeService;
|
|
|
+ private final CheckTheCallbackDao checkTheCallbackDao;
|
|
|
+ private final WebSocketService webSocketService;
|
|
|
|
|
|
- public JianYanJianChaShenQingService(JianYanJianChaDao dao, PublicServer publicServer, YiZhuLuRuDao yiZhuLuRuDao, RedisLikeService realtimeService) {
|
|
|
+ public JianYanJianChaShenQingService(JianYanJianChaDao dao, PublicServer publicServer, YiZhuLuRuDao yiZhuLuRuDao, RedisLikeService realtimeService, CheckTheCallbackDao checkTheCallbackDao, WebSocketService webSocketService) {
|
|
|
this.dao = dao;
|
|
|
this.publicServer = publicServer;
|
|
|
this.yiZhuLuRuDao = yiZhuLuRuDao;
|
|
|
this.realtimeService = realtimeService;
|
|
|
+ this.checkTheCallbackDao = checkTheCallbackDao;
|
|
|
+ this.webSocketService = webSocketService;
|
|
|
}
|
|
|
|
|
|
/*-------------------------------------------------------------- 下面是检查的逻辑 -----------------------------------------------------------------------------------------------------*/
|
|
@@ -688,6 +691,42 @@ public class JianYanJianChaShenQingService {
|
|
|
return ResultVoUtil.success(dao.getAncillaryInformation(patNo, times));
|
|
|
}
|
|
|
|
|
|
+ public ResultVo<String> checkTheCallbacks(CheckTheCallbacks param) {
|
|
|
+ QueryWrapper<CheckTheCallbacks> queryWrapper = new QueryWrapper<>();
|
|
|
+
|
|
|
+ queryWrapper.eq("req_no", param.getReqNo())
|
|
|
+ .eq("patient_from", param.getPatientFrom());
|
|
|
+
|
|
|
+ boolean exist = checkTheCallbackDao.selectCount(queryWrapper) > 0;
|
|
|
+
|
|
|
+ try {
|
|
|
+ if (exist) {
|
|
|
+ checkTheCallbackDao.update(param, queryWrapper);
|
|
|
+ } else {
|
|
|
+ checkTheCallbackDao.insert(param);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "数据库执行错误:" + e.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ final CheckTheCallbacks temp = new CheckTheCallbacks() {{
|
|
|
+ setPatientName(param.getPatientName());
|
|
|
+ setReportTime(param.getReportTime());
|
|
|
+ setReqNo(param.getReqNo());
|
|
|
+ setReqName(param.getReqName());
|
|
|
+ setCheckDoctorName(param.getCheckDoctorName());
|
|
|
+ }};
|
|
|
+
|
|
|
+ JSONObject js = new JSONObject() {{
|
|
|
+ put("data", temp);
|
|
|
+ put("isAdd", !exist);
|
|
|
+ }};
|
|
|
+
|
|
|
+ SocketMsg.sendMessageByUserCode(param.getReqDoctor().trim(), Message.CHECK_THE_CALLBACKS, js);
|
|
|
+
|
|
|
+ return ResultVoUtil.success(exist ? "更新成功。" : "回传成功。");
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|