Browse Source

预约挂号失败

hurugang 5 years ago
parent
commit
192ff9a1fb

+ 51 - 0
src/main/java/cn/hnthyy/thmz/config/PublishController.java

@@ -0,0 +1,51 @@
+package cn.hnthyy.thmz.config;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.jms.core.JmsMessagingTemplate;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.jms.Topic;
+
+/**
+ * @author: elvin
+ */
+@RestController
+@RequestMapping("/publish")
+public class PublishController {
+
+    @Autowired
+    private JmsMessagingTemplate jms;
+
+//    @Autowired
+//    private Queue queue;
+
+    @Autowired()
+    @Qualifier("sendOrderStatusChangeTopic")
+    private Topic topic;
+
+//    @RequestMapping("/queue")
+//    public String queue(){
+//
+//        for (int i = 0; i < 10 ; i++){
+//            jms.convertAndSend(queue, "queue"+i);
+//        }
+//
+//        return "queue 发送成功";
+//    }
+//
+//    @JmsListener(destination = "out.queue")
+//    public void consumerMsg(String msg){
+//        System.out.println(msg);
+//    }
+
+    @RequestMapping("/topic")
+    public String topic(){
+        for (int i = 0; i < 10 ; i++){
+            jms.convertAndSend(topic, "topic"+i);
+        }
+
+        return "topic 发送成功";
+    }
+}

+ 1 - 0
src/main/java/cn/hnthyy/thmz/controller/api/MedicalViewApiController.java

@@ -1283,6 +1283,7 @@ public class MedicalViewApiController {
             mzyReqrec.setUnitCode(mzyRequest.getUnitCode());
             mzyReqrec.setChargeType(mzyRequest.getChargeType());
             mzyReqrec.setDoctorCode(mzyRequest.getDoctorCode());
+            mzyReqrec.setRequestDay(mzyRequest.getRequestDay());
             MzZdWorkTime mzZdWorkTime = mzZdWorkTimeService.queryMzZdWorkTimeByCode(mzyReqrec.getAmpm());
             if (mzZdWorkTime == null) {
                 resultMap.put("code", -1);

+ 5 - 4
src/main/java/cn/hnthyy/thmz/service/impl/his/MzyReqrecServiceImpl.java

@@ -118,7 +118,7 @@ public class MzyReqrecServiceImpl implements MzyReqrecService {
         MzPatientMi updateMzPatientMi= new MzPatientMi();
         updateMzPatientMi.setPatientId(mzPatientMi.getPatientId());
         updateMzPatientMi.setTimes(times);
-        updateMzPatientMi.setLvDate(now);
+        updateMzPatientMi.setLvDate(mzyReqrec.getRequestDay()==null?now:mzyReqrec.getRequestDay());
         mzPatientMiMapper.updateMzPatientMi(updateMzPatientMi);
         ReqrecRequestRelation reqrecRequestRelation = new ReqrecRequestRelation(mzyRequest.getId(),serialNo);
         reqrecRequestRelationMapper.insertReqrecRequestRelation(reqrecRequestRelation);
@@ -194,7 +194,7 @@ public class MzyReqrecServiceImpl implements MzyReqrecService {
         mzfzPatientOrder.setDeptCode(mzyReqrec.getUnitCode());
         mzfzPatientOrder.setDoctorCode(mzyReqrec.getDoctorCode());
         mzfzPatientOrder.setGhNo(mzfzConfigService.getGhNo());
-        mzfzPatientOrder.setVisitDate(now);
+        mzfzPatientOrder.setVisitDate(mzyReqrec.getRequestDay()==null?now:mzyReqrec.getRequestDay());
         mzfzPatientOrder.setSlowFlag(YesNoEnum.NO.code);
         mzfzPatientOrder.setSerialNo(serialNo);
         mzfzPatientOrder.setReqType(mzyReqrec.getChargeType());
@@ -206,7 +206,6 @@ public class MzyReqrecServiceImpl implements MzyReqrecService {
     private void fomartReqrec( MzyReqrec mzyReqrec, MzPatientMi mzPatientMi, Windows windows, MzyZdChargeType mzyZdChargeType, int times, int serialNo, Date now,MzyRequest mzyRequest) throws MzException {
         mzyReqrec.setTimes(times);
         mzyReqrec.setName(mzPatientMi.getName());
-        mzyReqrec.setRequestDay(now);
         Integer reqOrder= mzyRequestService.getReqOrder(mzyRequest);
         mzyReqrec.setReqOrder(reqOrder);
         mzyReqrec.setReqFee(mzyZdChargeType.getReqFee());
@@ -218,7 +217,9 @@ public class MzyReqrecServiceImpl implements MzyReqrecService {
         mzyReqrec.setSerialNo(serialNo);
         mzyReqrec.setDoctorCode(mzyRequest.getDoctorCode()==null?"":mzyRequest.getDoctorCode());
         mzyReqrec.setReqType("0");
-        mzyReqrec.setRequestDay(now);
+        if(mzyReqrec.getRequestDay()==null){
+            mzyReqrec.setRequestDay(now);
+        }
         mzyReqrec.setOthFee(mzyRequest.getCheckFee());
         mzyReqrec.setPlusMark(YesNoEnum.NO.code);
         mzyReqrec.setPrintFlag(YesNoEnum.NO.code.toString());