From 57a2020223e33def0a22c42307871ef2a765af25 Mon Sep 17 00:00:00 2001
From: nidapeng <jp@doumee.com>
Date: 星期五, 08 三月 2024 14:22:01 +0800
Subject: [PATCH] 整理

---
 server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncVisitServiceImpl.java |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncVisitServiceImpl.java b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncVisitServiceImpl.java
index 95c71f3..91ef13b 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncVisitServiceImpl.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncVisitServiceImpl.java
@@ -1,5 +1,6 @@
 package com.doumee.service.business.impl.hksync;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.doumee.biz.system.SystemDictDataBiz;
@@ -204,8 +205,8 @@
         List<DeviceRole> roleList = deviceRoleMapper.selectList(new QueryWrapper<DeviceRole>().lambda()
                 .eq(DeviceRole::getType, Constants.ONE));
         //鏍囪鏄惁璧板厤鐧昏棰勭害
-        String applyType =systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.MDJ_VISIT_REQUIRED).getCode();
-        String applyLwType =systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.MDJ_LW_REQUIRED).getCode();
+//        String applyType =systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.MDJ_VISIT_REQUIRED).getCode();
+//        String applyLwType =systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.MDJ_LW_REQUIRED).getCode();
         try {
             //鏌ヨ鎵�鏈夐渶瑕佸悓姝ョ殑鏁版嵁
             List<Visits> list = getVisitList();
@@ -217,8 +218,7 @@
             Date date = new Date();
             for(Visits c : list) {
                 //鍙戣捣娴峰悍棰勭害鎺ュ彛锛堥渶瑕佺櫥璁帮級锛屾牴鎹绾﹁繑鍥炴帴鍙e皝瑁呯敵璇疯褰曟洿鏂板瓧娈�
-                String type = Constants.equalsInteger(c.getType(),Constants.ONE)?applyType:applyLwType;
-                getUpdateModelByResponse(c,date,type,roleList,path);
+                getUpdateModelByResponse(c,date,roleList,path);
                 visitsMapper.updateById(c);
                 if(Objects.isNull(c.getParentId())){
                     wxPlatNotice.sendVisitAuditTemplateNotice(c,
@@ -267,13 +267,15 @@
      * @param date
      * @param type 0闇�瑕佺櫥璁� 1鍏嶇櫥璁�
      */
-    private void getUpdateModelByResponse(  Visits c,Date date,String type,List<DeviceRole> roleList,String path ) {
+    private void getUpdateModelByResponse(  Visits c,Date date, List<DeviceRole> roleList,String path ) {
         String code = null;
         String id = null;
         String qrcode = null;
+        String reson = "";
         //鍙戣捣娴峰悍棰勭害鎺ュ彛
-        if(StringUtils.equals(type,"0")){
+        if(Constants.equalsInteger(c.getVisitType(),Constants.ZERO)){
             //锛堥渶瑕佺櫥璁帮級
+            c.setVisitType(Constants.ZERO);
             VisitAppointmentRequest request =  getHkRequestPara(c,roleList,path);
             if(request == null){
                 //娴峰悍涓嬪彂鎴愬姛
@@ -291,8 +293,10 @@
                 id =response.getData().getAppointmentInfoList().get(0).getOrderId();
                 qrcode =response.getData().getAppointmentInfoList().get(0).getQRCode();
             }
+            reson = response!=null?JSONObject.toJSONString(response):"";
         }else{
             //鍏嶇櫥璁�
+            c.setVisitType(Constants.ONE);
             VisitAppointmentMDJRequest request =getHkMDJRequestPara(c,roleList,path);
             if(request == null){
                 //娴峰悍涓嬪彂鎴愬姛
@@ -308,17 +312,18 @@
                 id = response.getData().getOrderId();
                 qrcode =response.getData().getQRCode();
             }
+            reson = response!=null?JSONObject.toJSONString(response):"";
         }
 
         if (code!= null && id!=null) {
             //娴峰悍涓嬪彂鎴愬姛
             c.setHkId( id);//棰勭害鏍囪瘑
             c.setQrcode(qrcode);
-            c.setRemark("涓嬪彂娴峰悍鎴愬姛锛併��"+type+"銆�");
+            c.setRemark("涓嬪彂娴峰悍鎴愬姛锛�");
             c.setStatus(Constants.VisitStatus.xfSuccess);//涓嬪彂娴峰悍鎴愬姛
         } else {
             //娴峰悍涓嬪彂澶辫触
-            c.setRemark("涓嬪彂娴峰悍澶辫触锛併��"+type+"銆�");
+            c.setRemark("涓嬪彂娴峰悍澶辫触,鍘熷洜锛�"+ reson);
             c.setStatus(Constants.VisitStatus.xfFail);//涓嬪彂娴峰悍澶辫触
         }
         c.setHkStatus(Constants.ONE);

--
Gitblit v1.9.3