From 657d75ff683ef35003bedd64a0fa420e7d294f85 Mon Sep 17 00:00:00 2001
From: jiaosong <jiaosong6760@dingtalk.com>
Date: 星期四, 07 十二月 2023 16:18:16 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 server/dmvisit_service/src/main/java/com/doumee/core/wx/WXConstant.java                                  |   19 +
 server/dmvisit_service/src/main/java/com/doumee/dao/business/model/Member.java                           |    4 
 server/dmvisit_web/src/main/java/com/doumee/api/ScheduleTool.java                                        |   72 ++++
 server/dmvisit_service/src/main/java/com/doumee/service/business/MemberService.java                      |   23 +
 server/dmvisit_service/src/main/java/com/doumee/service/business/ProblemLogService.java                  |    9 
 server/dmvisit_web/src/main/java/com/doumee/api/web/ApiController.java                                   |    2 
 server/dmvisit_service/src/main/java/com/doumee/biz/system/impl/SystemUserBizImpl.java                   |    2 
 server/dmvisit_service/src/main/java/com/doumee/core/utils/IdCardTool.java                               |    5 
 server/dmvisit_service/src/main/java/com/doumee/dao/business/model/ProblemLog.java                       |    2 
 server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncEventServiceImpl.java |    1 
 server/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java             |  186 ++++++++++
 server/dmvisit_web/src/main/java/com/doumee/api/web/UnitController.java                                  |   73 ++++
 server/dmvisit_service/src/main/java/com/doumee/dao/web/response/WxAuthorizeVO.java                      |   18 +
 server/dmvisit_web/src/main/java/com/doumee/api/web/VisitorController.java                               |   47 ++
 server/dmvisit_service/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java             |   52 ++
 server/dmvisit_service/src/main/java/com/doumee/core/utils/Constants.java                                |  373 ++++----------------
 server/dmvisit_service/src/main/java/com/doumee/service/business/ProblemsService.java                    |   10 
 server/dmvisit_service/src/main/java/com/doumee/dao/business/model/DeviceEvent.java                      |    4 
 server/dmvisit_service/src/main/java/com/doumee/dao/business/model/Visits.java                           |   14 
 server/dmvisit_service/src/main/java/com/doumee/dao/web/response/ProblemsVO.java                         |   43 ++
 server/dmvisit_service/src/main/java/com/doumee/service/business/impl/ProblemsServiceImpl.java           |   26 +
 server/dmvisit_service/src/main/java/com/doumee/service/business/VisitsService.java                      |    1 
 server/dmvisit_service/src/main/java/com/doumee/service/business/impl/ProblemLogServiceImpl.java         |   60 +++
 server/dmvisit_service/src/main/java/com/doumee/dao/web/reqeust/FinishAnswerDTO.java                     |   34 +
 24 files changed, 775 insertions(+), 305 deletions(-)

diff --git a/server/dmvisit_service/src/main/java/com/doumee/biz/system/impl/SystemUserBizImpl.java b/server/dmvisit_service/src/main/java/com/doumee/biz/system/impl/SystemUserBizImpl.java
index 8cf0d2d..c224704 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/biz/system/impl/SystemUserBizImpl.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/biz/system/impl/SystemUserBizImpl.java
@@ -136,7 +136,7 @@
         systemUser.setSalt(salt);
 
         // 鍒涘缓鐢ㄦ埛璁板綍
-        systemUser.setType(Constants.UserType.SYSTEM.getKey());
+        systemUser.setType(Constants.ZERO);
         Integer userId = systemUserService.create(systemUser);
         // 璁剧疆閮ㄩ棬
         if (systemUser.getDepartmentId() != null) {
diff --git a/server/dmvisit_service/src/main/java/com/doumee/core/utils/Constants.java b/server/dmvisit_service/src/main/java/com/doumee/core/utils/Constants.java
index 6ad128e..1fce4da 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/core/utils/Constants.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/core/utils/Constants.java
@@ -1,12 +1,12 @@
 package com.doumee.core.utils;
 
-import org.apache.commons.collections4.CollectionUtils;
+
+import org.apache.commons.lang3.StringUtils;
 
 import java.math.BigDecimal;
 import java.net.URLDecoder;
-import java.util.*;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
+import java.text.SimpleDateFormat;
+import  java.util.Date;
 
 public class Constants {
 
@@ -22,6 +22,55 @@
     public static final String HK_PUSH_URL = "HK_PUSH_URL";
     public static final String HK_ROOTORG_CODE ="HK_ROOTORG_CODE" ;
 
+    //琚嫓璁夸汉淇℃伅鏍¢獙鏂瑰紡锛�0鎵嬫満鍙峰崟鐙牎楠� 1鎵嬫満鍙峰拰濮撳悕缁勫悎鏍¢獙锛�
+    public static final String BEVISITED_USER_VALID = "BEVISITED_USER_VALID";
+    public static final String SELECT_DOORS_VISIT_REQUIRED = "SELECT_DOORS_VISIT_REQUIRED";
+    public static final String SELECT_DOORS_LW_REQUIRED = "SELECT_DOORS_LW_REQUIRED";
+    public static final String PROBLEM_LW_REQUIRED = "PROBLEM_LW_REQUIRED";
+    public static final String PROBLEM_VISIT_REQUIRED = "PROBLEM_VISIT_REQUIRED";
+    public static final String MDJ_LW_REQUIRED = "MDJ_LW_REQUIRED";
+    public static final String MDJ_VISIT_REQUIRED = "MDJ_VISIT_REQUIRED";
+    public static final String EDS_PWD ="!@#$%^&QWERTY" ;
+
+
+    public static  Date  getBirthdyByCardNo(String idCard){
+    if(idCard ==null || idCard.length()<14){
+        return null;
+    }
+    Date birthday = null; // 瑙f瀽涓烘棩鏈熷璞�
+    String birthdayString = idCard.substring(6, 14); // 鎴彇韬唤璇佸彿鐨勫墠鍏綅鏁板瓧浣滀负鍑虹敓鏃ユ湡
+    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
+    try {
+        birthday = dateFormat.parse(birthdayString);
+    } catch (Exception e) {
+        throw new RuntimeException(e);
+    }
+    return  birthday;
+}
+    public static  String  getTuominStr(String s){
+        if(StringUtils.isEmpty(s)){
+            return "";
+        }
+        int l = s.length();
+        if(l <= 2){
+            return s.substring(0,1)+"****";
+        }
+        if(l <= 5){
+            return s.substring(0,2)+"***";
+        }
+        if(l <= 10){
+            return s.substring(0,3)+"***"+s.substring(l-3,l);
+        }
+        if(l <= 11){
+            return s.substring(0,3)+"****"+s.substring(l-4,l);
+        }
+        if(l <= 15){
+            return s.substring(0,3)+"****"+s.substring(l-4,l);
+        }
+        return s.substring(0,5)+"*******"+s.substring(l-6,l);
+}
+
+
     /**
      * mq tag
      */
@@ -33,6 +82,11 @@
          String activity_looknum = "looknum";
          String activity_signup = "signup";
     }
+    public interface DeviceRoleType{
+         int lw = 0;//鍔冲姟璁垮
+         int fk = 1;//鏅�氳瀹�
+         int nb = 2;//鍐呴儴璁垮
+    }
     public interface DOOR_ROLE_TYPE{
          int lw = 0;
          int fk = 1;
@@ -41,9 +95,6 @@
     public static final String SUCCESS_STR = "SUCCESS" ;
 
     //寮�闂ㄦ椂闂存湁鏁堟湡锛堝垎閽燂級
-    public static final String QR_OPENBOOK_VALIDTIME="QR_OPENBOOK_VALIDTIME";
-    public static final String QR_OPENROOM_VALIDTIME="QR_OPENROOM_VALIDTIME";
-    public static final String ADVANCE_IN="ADVANCE_IN";
     public static final String ACCESS_ID="ACCESS_ID";
     public static final String BUCKETNAME = "BUCKETNAME";
     public static final String OSS = "OSS";
@@ -53,49 +104,21 @@
     public static final String ENDPOINT = "ENDPOINT";
     public static final String RESOURCE_PATH = "RESOURCE_PATH";
     //鍙戦�佷細璁紑濮�  瀹氭椂鎻愬墠澶氬皯鍒嗛挓鍙戦��
-    public static final String NOTICE_TIME = "NOTICE_TIME";
-
-    public static final String INITIAL_PASSWORD = "INITIAL_PASSWORD";
-    public static final String ACCESS_TOKEN = "ACCESS_TOKEN";
-
-    public static final String INITIAL_ROLE = "INITIAL_ROLE";
-
-    public static final String PLAT_ADDR="PLAT_ADDR";
-    public static final String ADDR_PHONE="ADDR_PHONE";
-    public static final String ADDR_NAME="ADDR_NAME";
-    public static final String ADDR_INFO="ADDR_INFO";
 
     public static final String SYSTEM ="SYSTEM";
-    public static final String DEFAULT_PASSWORD = "DEFAULT_PASSWORD" ;
-    public static final String CREATION_ROLE = "CREATION_ROLE";
-    public static final String ORG_ROLE = "ORG_ROLE";
-
-    public static final String USER_AGREEMENT = "USER_AGREEMENT";
-
-    public static final String ABOUT_USER = "ABOUT_USER";
-
-    public static final String RECHARGE_MONEY = "RECHARGE_MONEY";
-
-    public static final String PLATFORM_ADDRESS = "PLATFORM_ADDRESS";
-
-    public static final String PROJECT_HEAD_IMG = "PROJECT_HEAD_IMG";
 
     public static final String COFFEE_BEAN_TASK ="COFFEE_BEAN_TASK";
 
-    public static final String  SIGN_BOARD="SIGN_BOARD";//姣忔棩绛惧埌
-    public static final String  SHARE_INFO="SHARE_INFO";//鍒嗕韩璧勮
-    public static final String  SHARE_INVITE_BILL="SHARE_INVITE_BILL";//鍒嗕韩閭�璇锋捣鎶�
-    public static final String  INVITE_USER_LOGIN="INVITE_USER_LOGIN";///閭�璇锋柊鐢ㄦ埛娉ㄥ唽
-    public static final String  POST_COMMENTS="POST_COMMENTS";//鍙戝竷璇勮
-    public static final String  COFFEE_MAP_CONSUME="COFFEE_MAP_CONSUME";//鍜栧暋鍦板浘娑堣垂
 
-        // 鏈嶅姟椤圭洰
-    public static final String PROJECTS = "PROJECTS";
-    //鐢ㄦ埛澶村儚
-    public static final String SYSUSER = "SYSUSER";
 
-    public static final String  ROOT_PATH="ROOT_PATH";//鏈湴鏂囦欢涓婁紶鍦板潃閰嶇疆
-    public static final String  FILE_DIR="FILE_DIR";//鏈湴鏂囦欢璁块棶鍦板潃閰嶇疆
+
+
+    public static final String WX_PLATFORM = "WX_PLATFORM";
+    public static final String WX_PLATFORM_ACCESS_TOKEN = "WX_PLATFORM_ACCESS_TOKEN";
+    public static final String WX_PLATFORM_APPID = "WX_PLATFORM_APPID";
+    public static final String WX_PLATFORM_SECRET = "WX_PLATFORM_SECRET";
+
+
 
 
 
@@ -105,13 +128,7 @@
         public static final String ACTIVITY_SIGN_KEY = "actcode_";
         public static final String AFTERSALE_KEY = "salecode_";
     }
-    /**
-     * 浼佷笟鏁版嵁鏉ユ簮 0骞冲彴娉ㄥ唽 1鍚庡彴瀵煎叆
-     */
-    public interface ORIGIN{
-        public static final  int platformRegister  = 0;
-        public static final  int backstageImport  = 1;
-    }
+
 
     public static BigDecimal formatBigdecimal(BigDecimal d) {
         if (d == null) {
@@ -171,10 +188,17 @@
       int objTypeBook_in = 1;//鍙備細浜哄憳寮�闂�
       int objTypeBook_out = 2;//璁垮寮�闂�
 }
+public interface  memberType{
+    int visitor = 0;//鏅�氳瀹�
+    int lw_visitor = 1;//鍔冲姟璁垮
+    int internal = 2;//鍐呴儴浜哄憳
+}
     public static void main(String[] args) {
         String t = URLDecoder.decode("https://lsqw.gtja.com/qwcos/v-index.html#/loginforProperty?corpId=ww4b7aefafeb430e4b&corpId=ww4b7aefafeb430e4b&agentId=1000005&agentId=1000005&fromRoute=&userCode=013561&userCode=&userId=zz&userId=&encryptUserCode=&custQwId=wmIUuSDgAAR8MhtVY8w90EyKltvoK5fA&custCode=&openId=op1wZwD1dKuBQywmWWS5957zUOJI&name=%E8%B9%84%E8%B9%84&headUrl=http%3A%2F%2Fwx.qlogo.cn%2Fmmhead%2FQ3auHgzwzM4QlibSOAvYcvRMdsoyF3Ua7duLOYSJfB3dsGsYxIYonBw%2F0&dbHeadUrl=https%3A%2F%2Ftgf.gtja.com%2Ff%2F%2Fqwoms%2F2022512%2Fqwoms_1652332606613_8.jpg");
         System.out.println(t);
     }
+
+
     /**
      * 鐢ㄦ埛绫诲瀷
      */
@@ -803,253 +827,4 @@
 
 //        0璁㈠崟閫氱煡 1绯荤粺娑堟伅 2浜掑姩娑堟伅 3浼樻儬鍒告彁閱� 4瀹樻柟瀹㈡湇 5娲诲姩鎺ㄨ崘 6鎴戠殑鍏虫敞
 
-        NOTICE_ORDER(0,"0璁㈠崟閫氱煡","0璁㈠崟閫氱煡"),
-        NOTICE_SYSTEM(1,"1绯荤粺娑堟伅","1绯荤粺娑堟伅"),
-        NOTICE_INTERACTION(2,"浜掑姩娑堟伅","浜掑姩娑堟伅"),
-        NOTICE_MEMBER_COUPON(3,"浼樻儬鍒告彁閱�","浼樻儬鍒告彁閱�"),
-        NOTICE_ACTIVITY(5,"娲诲姩鎺ㄨ崘","娲诲姩鎺ㄨ崘"),
-        NOTICE_MEMBER_FOLLOW(6,"鎴戠殑鍏虫敞","鎴戠殑鍏虫敞")
-        ;
-
-        private Integer key;
-
-        private String type;
-
-        private String content;
-
-        NoticeType(Integer key, String type, String content) {
-            this.key = key;
-            this.type = type;
-            this.content = content;
-        }
-    }
-
-    /**
-     * 绉垎绫诲瀷
-     */
-    public  enum IntegralObjType {
-        REGISTER(0, "骞冲彴娉ㄥ唽", "骞冲彴娉ㄥ唽",0),
-        SIGNIN(1, "绛惧埌", "绛惧埌",0),
-        SHARE(2, "鍒嗕韩閭�璇�", "鍒嗕韩閭�璇�",0),
-        INVITENEWUSER(3, "閭�璇锋柊鐢ㄦ埛", "閭�璇锋柊鐢ㄦ埛",0),
-        EXCHANGEGOODS(4, "鍏戞崲鍟嗗搧", "鍏戞崲鍟嗗搧",1),
-        EXCHANGECOUPON(5, "鍏戞崲浼樻儬鍒�", "鍏戞崲浼樻儬鍒�",1),
-        SHARE_INFO(6,"鍒嗕韩璧勮","鍒嗕韩璧勮",0),
-        POST_COMMENTS(7,"鍙戝竷璇勮","鍙戝竷璇勮",0),
-        COFFEE_MAP_CONSUME(8,"鍜栧暋鍦板浘娑堣垂","鍜栧暋鍦板浘娑堣垂",0),
-        SHOP_ORDER(9,"浣欓鎶垫墸鍟嗗搧","浣欓鎶垫墸鍟嗗搧",1),
-        AFTERSALE_BACK(10,"鍞悗閫�娆�","鍞悗閫�娆�",1),
-        EXCHANGE_CARD(11,"鍗″厖鍊�","鍗″厖鍊�",0),
-        SYSTEM_RECHARGE(12,"骞冲彴鍏呭��","骞冲彴鍏呭��",0),
-        SYSTEM_DEDUCT(13,"骞冲彴鎵f","骞冲彴鎵f",0),
-        SHOP_ORDER_CANCEL(14,"浣欓鎶垫墸鍟嗗搧閫�杩�","浣欓鎶垫墸鍟嗗搧閫�杩�",0)
-        ;
-        // 鎴愬憳鍙橀噺
-        private String name;
-        private int key;
-        private String noteinfo;// 鎻忚堪
-        private Integer addTitle; // 0 = 鏂板锛�1 = 涓嶆柊澧�
-
-        // 鏋勯�犳柟娉�
-        IntegralObjType(int key, String name, String noteinfo ,Integer addTitle) {
-            this.name = name;
-            this.key = key;
-            this.noteinfo = noteinfo;
-            this.addTitle = addTitle;
-        }
-
-        // 鏅�氭柟娉�
-        public static String getName(int index) {
-            for (IntegralObjType c : IntegralObjType.values()) {
-                if (c.getKey() == index) {
-                    return c.name;
-                }
-            }
-            return null;
-        }
-
-        // 鏅�氭柟娉�
-        public static String getInfo(int index) {
-            for (IntegralObjType c : IntegralObjType.values()) {
-                if (c.getKey() == index) {
-                    return c.noteinfo;
-                }
-            }
-            return null;
-        }
-
-        // get set 鏂规硶
-        public String getName() {
-            return name;
-        }
-
-        public void setName(String name) {
-            this.name = name;
-        }
-
-        public int getKey() {
-            return key;
-        }
-
-        public void setKey(int key) {
-            this.key = key;
-        }
-
-        public String getNoteinfo() {
-            return noteinfo;
-        }
-
-
-        public int getAddTitle() {
-            return this.addTitle;
-        }
-
-        public void setAddTitle(Integer addTitle) {
-            this.addTitle = addTitle;
-        }
-
-
-    }
-
-
-    /**
-     * 鏍囩绫诲瀷
-     */
-    public  enum LabelsType {
-        GOODSTYPE(0, "鍟嗗搧鍒嗙被", "鍟嗗搧鍒嗙被"),
-        GOODSBRAND(1, "鍟嗗搧鍝佺墝", "鍟嗗搧鍝佺墝"),
-        BUSNESSLABEL(2, "鍟嗗鏍囩", "鍟嗗鏍囩"),
-        EXPRESSDELIVERY(3, "蹇��", "蹇��"),
-        RETURNOPTIONS(4, "閫�璐ч�夐」", "閫�璐ч�夐」"),
-        EXCHANGEOPTIONS(5, "鎹㈣揣閫夐」", "鎹㈣揣閫夐」"),
-        REFUNDOPTIONS(6, "閫�娆鹃�夐」", "閫�娆鹃�夐」"),
-        CANCELORDEROPTIONS(7, "鍙栨秷璁㈠崟閫夐」", "鍙栨秷璁㈠崟閫夐」"),
-        COFFERBEANTYPE(8, "鍜栧暋鐧剧鍒嗙被", "鍜栧暋鐧剧鍒嗙被"),
-        INFOTYPE(9, "鍜ㄨ鍒嗙被", "鍜ㄨ鍒嗙被"),
-        ACTIVITYMATCHTYPE(10, "娲诲姩璧涗簨鍒嗙被", "娲诲姩璧涗簨鍒嗙被"),
-        DARENTANDIANTYPE(11, "杈句汉鎺㈠簵鍒嗙被", "杈句汉鎺㈠簵鍒嗙被"),
-        HOMEZHUANQU(12, "棣栭〉涓撳尯", "棣栭〉涓撳尯"),
-
-        ;
-        // 鎴愬憳鍙橀噺
-        private String name;
-        private int key;
-        private String noteinfo;// 鎻忚堪
-
-        // 鏋勯�犳柟娉�
-        LabelsType(int key, String name, String noteinfo) {
-            this.name = name;
-            this.key = key;
-            this.noteinfo = noteinfo;
-        }
-
-        // 鏅�氭柟娉�
-        public static String getName(int index) {
-            for (LabelsType c : LabelsType.values()) {
-                if (c.getKey() == index) {
-                    return c.name;
-                }
-            }
-            return null;
-        }
-
-        // 鏅�氭柟娉�
-        public static String getInfo(int index) {
-            for (LabelsType c : LabelsType.values()) {
-                if (c.getKey() == index) {
-                    return c.noteinfo;
-                }
-            }
-            return null;
-        }
-
-        // get set 鏂规硶
-        public String getName() {
-            return name;
-        }
-
-        public void setName(String name) {
-            this.name = name;
-        }
-
-        public int getKey() {
-            return key;
-        }
-
-        public void setKey(int key) {
-            this.key = key;
-        }
-
-        public String getNoteinfo() {
-            return noteinfo;
-        }
-
-    }
-
-
-    /**
-     * 娲诲姩绫诲瀷
-     */
-    public  enum ActivityType {
-
-        SHOPACTIVITY(0, "鍟嗗娲诲姩", "鍟嗗娲诲姩"),
-        PLATACTIVITY(1, "骞冲彴娲诲姩", "骞冲彴娲诲姩"),
-        TANDIAN(2, "鎺㈠簵", "鎺㈠簵"),
-        CONSULT(3, "璧勮", "璧勮"),
-
-        ;
-        // 鎴愬憳鍙橀噺
-        private String name;
-        private int key;
-        private String noteinfo;// 鎻忚堪
-
-        // 鏋勯�犳柟娉�
-        ActivityType(int key, String name, String noteinfo) {
-            this.name = name;
-            this.key = key;
-            this.noteinfo = noteinfo;
-        }
-
-        // 鏅�氭柟娉�
-        public static String getName(int index) {
-            for (ActivityType c : ActivityType.values()) {
-                if (c.getKey() == index) {
-                    return c.name;
-                }
-            }
-            return null;
-        }
-
-        // 鏅�氭柟娉�
-        public static String getInfo(int index) {
-            for (ActivityType c : ActivityType.values()) {
-                if (c.getKey() == index) {
-                    return c.noteinfo;
-                }
-            }
-            return null;
-        }
-
-        // get set 鏂规硶
-        public String getName() {
-            return name;
-        }
-
-        public void setName(String name) {
-            this.name = name;
-        }
-
-        public int getKey() {
-            return key;
-        }
-
-        public void setKey(int key) {
-            this.key = key;
-        }
-
-        public String getNoteinfo() {
-            return noteinfo;
-        }
-
-    }
 }
diff --git a/server/dmvisit_service/src/main/java/com/doumee/core/utils/IdCardTool.java b/server/dmvisit_service/src/main/java/com/doumee/core/utils/IdCardTool.java
new file mode 100644
index 0000000..248a633
--- /dev/null
+++ b/server/dmvisit_service/src/main/java/com/doumee/core/utils/IdCardTool.java
@@ -0,0 +1,5 @@
+package com.doumee.core.utils;
+
+
+public class IdCardTool {
+}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/core/wx/WXConstant.java b/server/dmvisit_service/src/main/java/com/doumee/core/wx/WXConstant.java
new file mode 100644
index 0000000..d2e0d23
--- /dev/null
+++ b/server/dmvisit_service/src/main/java/com/doumee/core/wx/WXConstant.java
@@ -0,0 +1,19 @@
+package com.doumee.core.wx;
+
+/**
+ * 鍏紬鍙锋帴鍙e湴鍧�绫�
+ *
+ * @Author : Rk
+ * @create 2023/12/7 10:42
+ */
+public class WXConstant {
+
+    //鑾峰彇鍏紬鍙� access_token
+    public static final String GET_ACCESS_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET";
+
+    //鑾峰彇鐢ㄦ埛淇℃伅
+    public static final String GET_USER_INFO_URL = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code";
+
+
+
+}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/DeviceEvent.java b/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/DeviceEvent.java
index b42bf94..0a97010 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/DeviceEvent.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/DeviceEvent.java
@@ -218,6 +218,10 @@
     @ExcelColumn(name="韬唤璇乮d")
     private String idNum;
 
+    @ApiModelProperty(value = "璇佷欢鏄剧ず淇℃伅")
+    @ExcelColumn(name="璇佷欢鏄剧ず淇℃伅")
+    private String idcardDecode;
+
     @ApiModelProperty(value = "韬唤璇佺鍙戞満鍏�")
     @ExcelColumn(name="韬唤璇佺鍙戞満鍏�")
     private String issuingAuthority;
diff --git a/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/Member.java b/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/Member.java
index 9c7d069..d0e63a5 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/Member.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/Member.java
@@ -1,5 +1,6 @@
 package com.doumee.dao.business.model;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.doumee.core.annotation.excel.ExcelColumn;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -195,5 +196,8 @@
     @ApiModelProperty(value = "ERP缁勭粐缂栫爜")
     @ExcelColumn(name="ERP缁勭粐缂栫爜")
     private String erpOrgId;
+    @ApiModelProperty(value = "缁勭粐鍚嶇О")
+    @TableField(exist = false)
+    private String companyName;
 
 }
diff --git a/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/ProblemLog.java b/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/ProblemLog.java
index a7ef88d..d8b3069 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/ProblemLog.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/ProblemLog.java
@@ -65,7 +65,7 @@
 
     @ApiModelProperty(value = "缁戝畾鐢宠缂栫爜")
     @ExcelColumn(name="缁戝畾鐢宠缂栫爜")
-    private String logId;
+    private Integer logId;
 
     @ApiModelProperty(value = "寰楀垎", example = "1")
     @ExcelColumn(name="寰楀垎")
diff --git a/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/Visits.java b/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/Visits.java
index ae625de..e38623c 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/Visits.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/Visits.java
@@ -1,5 +1,6 @@
 package com.doumee.dao.business.model;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.doumee.core.annotation.excel.ExcelColumn;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -9,6 +10,7 @@
 import lombok.Data;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import java.util.Date;
+import java.util.List;
 
 /**
  * 璁垮鐢宠淇℃伅琛�
@@ -106,12 +108,10 @@
 
     @ApiModelProperty(value = "闂ㄧ鏈夋晥鏈熷紑濮�")
     @ExcelColumn(name="闂ㄧ鏈夋晥鏈熷紑濮�")
-    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date starttime;
 
     @ApiModelProperty(value = "闂ㄧ鏈夋晥鏈熸埅姝�")
     @ExcelColumn(name="闂ㄧ鏈夋晥鏈熸埅姝�")
-    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date endtime;
 
     @ApiModelProperty(value = "鏉ヨ浜嬬敱")
@@ -159,7 +159,9 @@
     @ApiModelProperty(value = "缁堝澶囨敞")
     @ExcelColumn(name="缁堝澶囨敞")
     private String endCheckInfo;
-
+    @ApiModelProperty(value = "璇佷欢鏄剧ず淇℃伅")
+    @ExcelColumn(name="璇佷欢鏄剧ず淇℃伅")
+    private String idcardDecode;
     @ApiModelProperty(value = "璇佷欢绫诲瀷 0韬唤璇� 1娓境璇佷欢 2鎶ょ収", example = "1")
     @ExcelColumn(name="璇佷欢绫诲瀷 0韬唤璇� 1娓境璇佷欢 2鎶ょ収")
     private Integer idcardType;
@@ -192,5 +194,11 @@
     @ApiModelProperty(value = "ERP鐢宠璁板綍缂栫爜")
     @ExcelColumn(name="ERP鐢宠璁板綍缂栫爜")
     private String erpId;
+    @ApiModelProperty(value = "鏅�氳瀹㈢敵璇烽殢璁夸汉鍛�")
+    @TableField(exist = false)
+    private List<Visits> withUserList;
+    @ApiModelProperty(value = "鍔冲姟璁垮鐢宠闅忚浜哄憳")
+    @TableField(exist = false)
+    private List<Integer> lwWithUserList;
 
 }
diff --git a/server/dmvisit_service/src/main/java/com/doumee/dao/web/reqeust/FinishAnswerDTO.java b/server/dmvisit_service/src/main/java/com/doumee/dao/web/reqeust/FinishAnswerDTO.java
new file mode 100644
index 0000000..a63e42d
--- /dev/null
+++ b/server/dmvisit_service/src/main/java/com/doumee/dao/web/reqeust/FinishAnswerDTO.java
@@ -0,0 +1,34 @@
+package com.doumee.dao.web.reqeust;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotEmpty;
+import javax.validation.constraints.NotNull;
+import java.math.BigDecimal;
+
+/**
+ * Created by IntelliJ IDEA.
+ *
+ * @Author : Rk
+ * @create 2023/12/7 11:19
+ */
+@Data
+public class FinishAnswerDTO {
+
+    @NotBlank(message = "绛旈鏄庣粏涓虹┖")
+    @ApiModelProperty(value = "绛旈鏄庣粏锛坖son锛�")
+    private String content;
+
+    @NotNull(message = "浣跨敤鍦烘櫙涓虹┖")
+    @ApiModelProperty(value = "浣跨敤鍦烘櫙 0鍔冲姟浜哄憳 1鏅�氳瀹�")
+    private Integer useType;
+
+    @ApiModelProperty(value = "璁垮缂栫爜")
+    private String userId;
+
+    @ApiModelProperty(value = "鐢ㄦ埛openId")
+    private String openId;
+
+}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/dao/web/response/ProblemsVO.java b/server/dmvisit_service/src/main/java/com/doumee/dao/web/response/ProblemsVO.java
new file mode 100644
index 0000000..28424f1
--- /dev/null
+++ b/server/dmvisit_service/src/main/java/com/doumee/dao/web/response/ProblemsVO.java
@@ -0,0 +1,43 @@
+package com.doumee.dao.web.response;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.doumee.core.annotation.excel.ExcelColumn;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * Created by IntelliJ IDEA.
+ *
+ * @Author : Rk
+ * @create 2023/12/7 11:19
+ */
+@Data
+public class ProblemsVO {
+
+    @ApiModelProperty(value = "涓婚敭", example = "1")
+    private Integer id;
+
+    @ApiModelProperty(value = "澶囨敞")
+    private String remark;
+
+    @ApiModelProperty(value = "棰樼洰")
+    private String title;
+
+    @ApiModelProperty(value = "閫夐」闆嗗悎")
+    private String options;
+
+    @ApiModelProperty(value = "姝g‘绛旀")
+    private String answer;
+
+    @ApiModelProperty(value = "绫诲瀷 0鍗曢�� 1澶氶�� ", example = "1")
+    private Integer type;
+
+    @ApiModelProperty(value = "鍒嗗��", example = "1")
+    private BigDecimal score;
+
+}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/dao/web/response/WxAuthorizeVO.java b/server/dmvisit_service/src/main/java/com/doumee/dao/web/response/WxAuthorizeVO.java
new file mode 100644
index 0000000..8126fb4
--- /dev/null
+++ b/server/dmvisit_service/src/main/java/com/doumee/dao/web/response/WxAuthorizeVO.java
@@ -0,0 +1,18 @@
+package com.doumee.dao.web.response;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * Created by IntelliJ IDEA.
+ *
+ * @Author : Rk
+ * @create 2023/12/7 11:19
+ */
+@Data
+public class WxAuthorizeVO {
+
+    @ApiModelProperty(value = "鎺堟潈OPENID")
+    private String openid;
+
+}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/service/business/MemberService.java b/server/dmvisit_service/src/main/java/com/doumee/service/business/MemberService.java
index eafa71a..8a281a4 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/service/business/MemberService.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/service/business/MemberService.java
@@ -7,6 +7,8 @@
 import com.doumee.dao.admin.request.LaborMemberDTO;
 import com.doumee.dao.admin.response.MemberInfoDTO;
 import com.doumee.dao.business.model.Member;
+import com.doumee.dao.web.response.WxAuthorizeVO;
+
 import java.util.List;
 
 /**
@@ -132,4 +134,25 @@
      * @return
      */
     void importMemberBatch(LaborEmpowerDTO laborEmpowerDTO);
+
+
+
+
+    /********************************************鍏紬鍙锋帴鍙�***********************************************************************/
+
+
+    /**
+     * 寰俊鎺堟潈鎺ュ彛
+     * @param code
+     * @return
+     */
+    WxAuthorizeVO wxAuthorize(String code);
+
+
+
+
+
+
+
+
 }
diff --git a/server/dmvisit_service/src/main/java/com/doumee/service/business/ProblemLogService.java b/server/dmvisit_service/src/main/java/com/doumee/service/business/ProblemLogService.java
index 2f41635..7604164 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/service/business/ProblemLogService.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/service/business/ProblemLogService.java
@@ -3,6 +3,8 @@
 import com.doumee.core.model.PageData;
 import com.doumee.core.model.PageWrap;
 import com.doumee.dao.business.model.ProblemLog;
+import com.doumee.dao.web.reqeust.FinishAnswerDTO;
+
 import java.util.List;
 
 /**
@@ -94,4 +96,11 @@
      * @return long
      */
     long count(ProblemLog problemLog);
+
+    /**
+     * 淇濆瓨绛旈璁板綍
+     * @param finishAnswerDTO
+     * @return
+     */
+    Integer finishAnswer(FinishAnswerDTO finishAnswerDTO);
 }
diff --git a/server/dmvisit_service/src/main/java/com/doumee/service/business/ProblemsService.java b/server/dmvisit_service/src/main/java/com/doumee/service/business/ProblemsService.java
index 40aa6f3..64367d5 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/service/business/ProblemsService.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/service/business/ProblemsService.java
@@ -4,6 +4,8 @@
 import com.doumee.core.model.PageWrap;
 import com.doumee.dao.admin.response.ProblemDTO;
 import com.doumee.dao.business.model.Problems;
+import com.doumee.dao.web.response.ProblemsVO;
+
 import java.util.List;
 
 /**
@@ -96,6 +98,14 @@
      */
     long count(Problems problems);
 
+
+    /**
+     * 鑾峰彇棰樼洰淇℃伅
+     * @param useType
+     * @return
+     */
+    List<ProblemsVO> getProblemsVO(Integer useType);
+
     /**
      * 鑾峰彇涓嶅悓鐢ㄦ埛绫诲瀷鐨勯鐩�
      * @param useType
diff --git a/server/dmvisit_service/src/main/java/com/doumee/service/business/VisitsService.java b/server/dmvisit_service/src/main/java/com/doumee/service/business/VisitsService.java
index 022820c..9ecbab1 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/service/business/VisitsService.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/service/business/VisitsService.java
@@ -19,6 +19,7 @@
      * @return Integer
      */
     Integer create(Visits visits);
+    Integer createFk(Visits visits);
 
     /**
      * 涓婚敭鍒犻櫎
diff --git a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java
index 8dca011..fd71f8c 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java
@@ -4,6 +4,10 @@
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.IdcardUtil;
 import cn.hutool.core.util.PhoneUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.doumee.biz.system.SystemDictDataBiz;
+import com.doumee.config.Jwt.JwtPayLoad;
+import com.doumee.config.Jwt.JwtTokenUtil;
 import com.doumee.core.annotation.excel.ExcelImporter;
 import com.doumee.core.constants.ResponseStatus;
 import com.doumee.core.exception.BusinessException;
@@ -11,7 +15,9 @@
 import com.doumee.core.model.PageData;
 import com.doumee.core.model.PageWrap;
 import com.doumee.core.utils.Constants;
+import com.doumee.core.utils.HttpsUtil;
 import com.doumee.core.utils.Utils;
+import com.doumee.core.wx.WXConstant;
 import com.doumee.dao.admin.request.LaborEmpowerDTO;
 import com.doumee.dao.admin.request.LaborMemberDTO;
 import com.doumee.dao.admin.response.MemberInfoDTO;
@@ -22,6 +28,7 @@
 import com.doumee.dao.business.model.Empower;
 import com.doumee.dao.business.model.Member;
 import com.doumee.dao.business.model.TrainTime;
+import com.doumee.dao.web.response.WxAuthorizeVO;
 import com.doumee.service.business.MemberService;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
@@ -54,6 +61,10 @@
 
     @Autowired
     private TrainTimeMapper trainTimeMapper;
+
+
+    @Autowired
+    private SystemDictDataBiz systemDictDataBiz;
 
     @Override
     public Integer create(Member member) {
@@ -371,4 +382,45 @@
 //
 
     }
+
+
+
+
+    /********************************************鍏紬鍙锋帴鍙�***********************************************************************/
+
+
+
+    /**
+     * 寰俊鎺堟潈鎺ュ彛
+     * @param code
+     * @return
+     */
+    @Override
+    public WxAuthorizeVO wxAuthorize(String code){
+        String appId = systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_APPID).getCode();
+        String appSecret = systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_SECRET).getCode();
+        String getTokenUrl = WXConstant.GET_USER_INFO_URL.replace("CODE", code)
+                .replace("APPID", appId).replace("SECRET", appSecret);
+        JSONObject tokenJson = JSONObject.parseObject(HttpsUtil.get(getTokenUrl,true));
+        String openId = null;
+        if(!Objects.isNull(tokenJson.get("access_token"))){
+            openId = tokenJson.getString("openid");
+        }
+        WxAuthorizeVO wxAuthorizeVO = new WxAuthorizeVO();
+        wxAuthorizeVO.setOpenid(openId);
+        return wxAuthorizeVO;
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
 }
diff --git a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/ProblemLogServiceImpl.java b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/ProblemLogServiceImpl.java
index ee1ecca..98888bc 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/ProblemLogServiceImpl.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/ProblemLogServiceImpl.java
@@ -1,20 +1,33 @@
 package com.doumee.service.business.impl;
 
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.doumee.core.constants.ResponseStatus;
+import com.doumee.core.exception.BusinessException;
 import com.doumee.core.model.PageData;
 import com.doumee.core.model.PageWrap;
+import com.doumee.core.utils.Constants;
 import com.doumee.core.utils.Utils;
+import com.doumee.dao.business.CompanyMapper;
+import com.doumee.dao.business.MemberMapper;
 import com.doumee.dao.business.ProblemLogMapper;
+import com.doumee.dao.business.model.Company;
+import com.doumee.dao.business.model.Member;
 import com.doumee.dao.business.model.ProblemLog;
+import com.doumee.dao.web.reqeust.FinishAnswerDTO;
 import com.doumee.service.business.ProblemLogService;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.checkerframework.checker.units.qual.A;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
+import java.util.Date;
 import java.util.List;
+import java.util.Objects;
 
 /**
  * 璁垮绛旈璁板綍琛⊿ervice瀹炵幇
@@ -26,6 +39,12 @@
 
     @Autowired
     private ProblemLogMapper problemLogMapper;
+
+    @Autowired
+    private MemberMapper memberMapper;
+
+    @Autowired
+    private CompanyMapper companyMapper;
 
     @Override
     public Integer create(ProblemLog problemLog) {
@@ -152,4 +171,45 @@
         QueryWrapper<ProblemLog> wrapper = new QueryWrapper<>(problemLog);
         return problemLogMapper.selectCount(wrapper);
     }
+
+
+    /**
+     * 淇濆瓨绛旈璁板綍
+     * @param finishAnswerDTO
+     * @return
+     */
+    @Override
+    public Integer finishAnswer(FinishAnswerDTO finishAnswerDTO){
+        ProblemLog problemLog = new ProblemLog();
+        BeanUtils.copyProperties(finishAnswerDTO,problemLog);
+        problemLog.setCreateDate(new Date());
+        problemLog.setIsdeleted(Constants.ZERO);
+        problemLog.setStatus(Constants.ZERO);
+        if(finishAnswerDTO.getUseType().equals(Constants.ZERO)&&StringUtils.isNotBlank(finishAnswerDTO.getUserId())){
+            Member member = memberMapper.selectById(finishAnswerDTO.getUserId());
+            if(Objects.isNull(member)){
+                throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈠埌鍔冲姟浜哄憳");
+            }
+            if(!member.getType().equals(Constants.memberType.lw_visitor)){
+                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"闈炲姵鍔′汉鍛樼被鍨嬶紝绛旈澶辫触");
+            }
+            if(!member.getStatus().equals(Constants.ZERO)){
+                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝璐﹀彿宸茬粡" + (member.getStatus().equals(Constants.ONE)?"绂佺敤":"鎷夐粦/鍒犻櫎") );
+            }
+            problemLog.setName(member.getName());
+            problemLog.setPhone(member.getPhone());
+            problemLog.setCompanyId(member.getCompanyId());
+            Company company = companyMapper.selectById(member.getCompanyId());
+            if(Objects.isNull(company)){
+                throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈠埌鍔冲姟浜哄憳鍏徃");
+            }
+            problemLog.setCompanyName(company.getName());
+        }
+        this.problemLogMapper.insert(problemLog);
+        return problemLog.getId();
+    }
+
+
+
+
 }
diff --git a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/ProblemsServiceImpl.java b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/ProblemsServiceImpl.java
index e409308..397f583 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/ProblemsServiceImpl.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/ProblemsServiceImpl.java
@@ -10,17 +10,20 @@
 import com.doumee.dao.admin.response.ProblemDTO;
 import com.doumee.dao.business.ProblemsMapper;
 import com.doumee.dao.business.model.Problems;
+import com.doumee.dao.web.response.ProblemsVO;
 import com.doumee.service.business.ProblemsService;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.springframework.beans.BeanUtils;
 import org.apache.shiro.SecurityUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -199,4 +202,27 @@
         return collect;
 
     }
+
+
+    /**
+     * 鑾峰彇棰樼洰淇℃伅
+     * @param useType
+     * @return
+     */
+    @Override
+    public List<ProblemsVO> getProblemsVO(Integer useType){
+        List<Problems> problemsList = problemsMapper.selectList(new QueryWrapper<Problems>().lambda().eq(Problems::getUseType,useType)
+                .eq(Problems::getIsdeleted, Constants.ZERO).orderByAsc(Problems::getSortnu));
+        List<ProblemsVO> problemsVOList = new ArrayList<>();
+        for (Problems problems:problemsList) {
+            ProblemsVO problemsVO = new ProblemsVO();
+            BeanUtils.copyProperties(problems,problemsVO);
+            problemsVOList.add(problemsVO);
+        }
+        return problemsVOList;
+    }
+
+
+
+
 }
diff --git a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java
index 8a2db93..041f876 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java
@@ -1,19 +1,35 @@
 package com.doumee.service.business.impl;
 
+import cn.hutool.core.util.IdcardUtil;
+import com.doumee.biz.system.SystemDictDataBiz;
+import com.doumee.core.constants.ResponseStatus;
+import com.doumee.core.exception.BusinessException;
 import com.doumee.core.model.PageData;
 import com.doumee.core.model.PageWrap;
+import com.doumee.core.utils.Constants;
+import com.doumee.core.utils.DESUtil;
 import com.doumee.core.utils.Utils;
+import com.doumee.dao.business.DeviceRoleMapper;
+import com.doumee.dao.business.MemberMapper;
+import com.doumee.dao.business.ProblemLogMapper;
 import com.doumee.dao.business.VisitsMapper;
+import com.doumee.dao.business.model.DeviceRole;
+import com.doumee.dao.business.model.Member;
+import com.doumee.dao.business.model.ProblemLog;
 import com.doumee.dao.business.model.Visits;
 import com.doumee.service.business.VisitsService;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
+import org.springframework.util.DigestUtils;
 
+import java.util.Arrays;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -26,13 +42,183 @@
 
     @Autowired
     private VisitsMapper visitsMapper;
+    @Autowired
+    private DeviceRoleMapper deviceRoleMapper;
+    @Autowired
+    private ProblemLogMapper problemLogMapper ;
+    @Autowired
+    private MemberMapper memberMapper ;
 
+    @Autowired
+    private SystemDictDataBiz systemDictDataBiz;
     @Override
     public Integer create(Visits visits) {
         visitsMapper.insert(visits);
         return visits.getId();
     }
 
+    /**
+     * 鏅�氳瀹㈢敵璇�
+     * @param visits
+     * @return
+     */
+    @Override
+    public Integer createFk(Visits visits) {
+        if(visits.getStarttime() == null
+                || visits.getEndtime() == null
+                ||  StringUtils.isBlank(visits.getReason())
+                ||  StringUtils.isBlank( visits.getName())
+                ||  StringUtils.isBlank( visits.getPhone())
+                ||  visits.getIdcardType() == null
+                ||  StringUtils.isBlank( visits.getFaceImg() )
+                ||  StringUtils.isBlank( visits.getIdcardNo() )
+                || visits.getReceptMemberId() == null){
+            throw  new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "瀵逛笉璧凤紝淇℃伅濉啓涓嶆纭紒");
+        }
+        //妫�鏌ユ槸鍚﹀繀椤荤瓟棰橈紝骞朵笖绗﹀悎绛旈瑕佹眰
+        ProblemLog problemLog = isValidProblemLog(visits);
+        //鑾峰彇鐢宠鐨勬捣搴疯闂棬绂佺粍淇℃伅
+        String[] hkIds = getHkDeviceRoles(visits);
+        //妫�楠屾嫓璁夸汉鏄惁鍚堟硶
+        isValideVisitedUser(visits.getReceptMemberId());
+        //妫�鏌ラ殢璁夸汉鍛樻槸鍚﹀悎娉�,鐢熸垚闅忚浜哄憳鏂板闆嗗悎
+        List<Member> withUsers = isValideWithUsers(visits.getWithUserList());
+
+        if(Constants.equalsInteger(Constants.ZERO, visits.getIdcardType()) &&!IdcardUtil.isValidCard(visits.getIdcardNo())){
+            throw  new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "瀵逛笉璧凤紝韬唤璇佸彿鐮佹湁璇紝璇锋牳瀹炲悗閲嶈瘯锛�");
+        }
+        Date date = new Date();
+
+        visits.setBirthday(Constants.getBirthdyByCardNo(visits.getIdcardNo()));
+        //韬唤璇佸彿瀛樺偍瀵嗘枃
+        visits.setIdcardNo(DESUtil.encrypt(Constants.EDS_PWD, visits.getIdcardNo()));//韬唤璇佸彿鍔犲瘑
+        visits.setIdcardDecode(Constants.getTuominStr(visits.getIdcardNo()));//鑴辨晱鎵嬫満鍙�
+        visits.setCreateDate(date);
+
+        //璁垮淇℃伅(浣跨敤韬唤璇佸彿鏌ヨ鏄惁宸插瓨鍦ㄦ敼鏅�氳瀹紝娌℃湁鍒欐柊澧烇紝瀛樺湪鍒欐洿鏂皁penid绛変俊鎭�)
+        Member member = getMemberByIdcardno(visits);
+        visitsMapper.insert(visits);
+
+
+        updateProblemLog(visits,problemLog,member);
+
+        return visits.getId();
+    }
+
+    private Member getMemberByIdcardno(Visits idcardNo) {
+        Member member = memberMapper.selectOne(new QueryWrapper<Member>().lambda()
+//                .eq(Member::getType,Constants.MEMBER_TYPE)
+                .eq(Member::getIdcardNo,idcardNo.getIdcardNo())
+        );
+        return  null;
+    }
+
+    private List<Member> isValideWithUsers(List<Visits> withUserList) {
+        if(withUserList!= null && withUserList .size()>0){
+            for(Visits model:withUserList){
+
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * 濡傛灉鏈夌瓟棰樿褰曪紝鏇存柊绛旈璁板綍鍏宠仈鏁版嵁
+     * @param visits
+     * @param problemLog
+     * @param member
+     */
+
+    private void updateProblemLog(Visits visits, ProblemLog problemLog,Member member) {
+        if(problemLog!=null){
+            problemLog.setEditDate(visits.getCreateDate());
+            problemLog.setName(visits.getName());
+            problemLog.setUserId(member.getId());
+            problemLog.setPhone(member.getPhone());
+            problemLog.setLogId(visits.getId());
+            problemLogMapper.updateById(problemLog);
+        }
+    }
+
+    /**
+     *   妫�鏌ヨ浜烘槸鍚﹀悎娉�
+     * @param receptMemberId
+     */
+    private Member isValideVisitedUser(Integer receptMemberId) {
+        Member member = memberMapper.selectById(receptMemberId);
+        if(member == null || Constants.equalsInteger(Constants.ZERO,member.getIsdeleted())){
+            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "瀵逛笉璧凤紝璇ユ嫓璁夸汉鏆傛椂涓嶈兘鎺ュ彈鎮ㄧ殑鎷滆鐢宠锛�");
+        }
+        if(!Constants.equalsInteger(member.getStatus(), Constants.ZERO)){
+            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "瀵逛笉璧凤紝璇ユ嫓璁夸汉鏆傛椂涓嶈兘鎺ュ彈鎮ㄧ殑鎷滆鐢宠.");
+        }
+        if(!Constants.equalsInteger(Constants.ONE, member.getCanVisit())){
+            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "瀵逛笉璧凤紝璇ユ嫓璁夸汉鏆傛椂涓嶈兘鎺ュ彈鎮ㄧ殑鎷滆鐢宠~");
+        }
+        return  member;
+    }
+
+    private ProblemLog isValidProblemLog(Visits visits) {
+        String required = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.PROBLEM_VISIT_REQUIRED).getCode();
+        if(StringUtils.equals(required,Constants.ONE+"")){
+            //濡傛灉蹇呴』绛旈锛屾煡鎵剧瓟棰樿褰�
+            if(visits.getUserAnswerId() == null){
+                throw  new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "瀵逛笉璧凤紝璇峰厛鎸夎姹傝繘琛屽畨鍏ㄧ煡璇嗙瓟棰橈紒");
+            }
+            ProblemLog log = problemLogMapper.selectById(visits.getUserAnswerId());
+            if(log == null){
+                throw  new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "瀵逛笉璧凤紝璇峰厛鎸夎姹傝繘琛屽畨鍏ㄧ煡璇嗙瓟棰�.");
+            }
+            if(log.getLogId() !=null){
+                throw  new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "瀵逛笉璧凤紝璇峰厛鎸夎姹傝繘琛屽畨鍏ㄧ煡璇嗙瓟棰榽");
+            }
+            return  log;
+        }
+        return null;
+    }
+
+    /**
+     * 鑾峰彇鐢宠鐨勬捣搴疯闂棬绂佺粍淇℃伅
+     * @param visits
+     * @return
+     */
+    private String[] getHkDeviceRoles(Visits visits) {
+        String mustSelectDoors = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.SELECT_DOORS_VISIT_REQUIRED).getCode();
+        List<DeviceRole> roles = null;
+        if(StringUtils.equals(mustSelectDoors,Constants.ZERO+"")){
+            //濡傛灉蹇呴』閫夋嫨闂ㄧ锛屼絾鏈�夋嫨
+            if(StringUtils.isBlank(visits.getDoors())){
+                throw  new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "瀵逛笉璧凤紝璇烽�夋嫨璁块棶闂ㄧ锛�");
+            }
+            //鏍¢獙闂ㄧ缁勪俊鎭槸鍚︽纭�
+            String[] dIds = visits.getDoors().split(",");
+            roles = deviceRoleMapper.selectList(new QueryWrapper<DeviceRole>().lambda()
+                    .eq(DeviceRole::getIsdeleted,Constants.ZERO)
+                    .eq(DeviceRole::getType,Constants.DeviceRoleType.fk)
+                    .in(DeviceRole::getId, Arrays.asList(dIds)));
+            if(roles == null || roles.size()==0 || roles.size() != dIds.length){
+                throw  new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "瀵逛笉璧凤紝璇烽�夋嫨鏈夋晥璁块棶闂ㄧ锛�");
+            }
+        }else{
+            //濡傛灉璁剧疆涓嶉�夋嫨闂ㄧ锛屽垯鎻愪緵榛樿闂ㄧ缁勪俊鎭�
+            String[] dIds = visits.getDoors().split(",");
+            roles = deviceRoleMapper.selectList(new QueryWrapper<DeviceRole>().lambda()
+                    .eq(DeviceRole::getIsdeleted,Constants.ZERO)
+                    .eq(DeviceRole::getIsDefault,Constants.ZERO)
+                    .eq(DeviceRole::getType,Constants.DeviceRoleType.fk));
+            if(roles.size() ==0){
+
+                throw  new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "瀵逛笉璧凤紝鏆備笉瀛樺湪鍙闂殑璁垮闂ㄧ锛屾棤娉曡繘琛岀敵璇锋搷浣滐紒");
+            }
+        }
+        String[] ids =new String[roles.size()];
+        for (int i = 0; i < roles.size(); i++) {
+            ids[i] = roles.get(i).getHkId();
+        }
+        return  ids;
+    }
+
     @Override
     public void deleteById(Integer id) {
         visitsMapper.deleteById(id);
diff --git a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncEventServiceImpl.java b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncEventServiceImpl.java
index e1db654..46d08ba 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncEventServiceImpl.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncEventServiceImpl.java
@@ -65,7 +65,6 @@
                 }
             }
         }
-
     }
 
     /**
diff --git a/server/dmvisit_web/src/main/java/com/doumee/api/ScheduleTool.java b/server/dmvisit_web/src/main/java/com/doumee/api/ScheduleTool.java
new file mode 100644
index 0000000..63d5a5a
--- /dev/null
+++ b/server/dmvisit_web/src/main/java/com/doumee/api/ScheduleTool.java
@@ -0,0 +1,72 @@
+package com.doumee.api;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.doumee.biz.system.SystemDictDataBiz;
+import com.doumee.core.utils.Constants;
+import com.doumee.core.utils.HttpsUtil;
+import com.doumee.core.wx.WXConstant;
+import com.doumee.dao.system.model.SystemDictData;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.utils.URIBuilder;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import java.io.IOException;
+import java.net.URI;
+import java.util.Date;
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * 瀹氭椂浠诲姟
+ * @author jiangping
+ * @date 2021-10-10 14:40:35
+ * https://www.bejson.com/othertools/cron/  cron 琛ㄨ揪寮忕敓鎴愬湴鍧�
+ */
+@Slf4j
+@Component
+@EnableScheduling
+public class ScheduleTool {
+
+    @Autowired
+    private SystemDictDataBiz systemDictDataBiz;
+
+    /**
+     * 鏄惁寮�鍙戣��
+     */
+    @Value("${timing}")
+    private Boolean timing;
+
+    /**
+     * 鏇存柊寰俊鍏紬鍙� ACCESS_TOKEN
+     * @throws Exception
+     */
+    @Scheduled(fixedDelay=1000 * 60 * 90)
+    public void updAccessToken(){
+        String appId = systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_APPID).getCode();
+        String appSecret = systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_SECRET).getCode();
+        //鐢熸垚寰俊token
+        String url = WXConstant.GET_ACCESS_TOKEN_URL.replace("APPID",appId).replace("APPSECRET",appSecret);
+        String response = HttpsUtil.get(url,false);
+        JSONObject json = JSONObject.parseObject(response);
+        SystemDictData systemDictData =  systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN);
+        if(!Objects.isNull(systemDictData)){
+            systemDictData.setCode(json.getString("access_token"));
+            systemDictData.setUpdateTime(new Date());
+            systemDictDataBiz.updateByIdNew(systemDictData);
+            log.info(" 鏇存柊寰俊鍏紬鍙� ACCESS_TOKEN =========> " + systemDictData.getCode() );
+        }
+    }
+
+
+
+}
diff --git a/server/dmvisit_web/src/main/java/com/doumee/api/web/ApiController.java b/server/dmvisit_web/src/main/java/com/doumee/api/web/ApiController.java
index e7703c9..6f33b73 100644
--- a/server/dmvisit_web/src/main/java/com/doumee/api/web/ApiController.java
+++ b/server/dmvisit_web/src/main/java/com/doumee/api/web/ApiController.java
@@ -1,6 +1,7 @@
 package com.doumee.api.web;
 
 import com.doumee.config.Jwt.JwtTokenUtil;
+import com.doumee.core.model.PageData;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.web.context.request.RequestContextHolder;
 import org.springframework.web.context.request.ServletRequestAttributes;
@@ -25,6 +26,7 @@
         HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
         return request;
     }
+
     /**
      * 鑾峰彇鐢ㄦ埛ID
      *
diff --git a/server/dmvisit_web/src/main/java/com/doumee/api/web/UnitController.java b/server/dmvisit_web/src/main/java/com/doumee/api/web/UnitController.java
new file mode 100644
index 0000000..70aca8c
--- /dev/null
+++ b/server/dmvisit_web/src/main/java/com/doumee/api/web/UnitController.java
@@ -0,0 +1,73 @@
+package com.doumee.api.web;
+
+import com.doumee.biz.system.SystemDictDataBiz;
+import com.doumee.core.annotation.trace.Trace;
+import com.doumee.core.model.ApiResponse;
+import com.doumee.dao.system.model.SystemDictData;
+import com.doumee.dao.web.reqeust.FinishAnswerDTO;
+import com.doumee.dao.web.response.ProblemsVO;
+import com.doumee.service.business.ProblemLogService;
+import com.doumee.service.business.ProblemsService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.checkerframework.checker.units.qual.A;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * Created by IntelliJ IDEA.
+ *
+ * @Author : Rk
+ * @create 2023/12/7 10:40
+ */
+
+@Api(tags = "99銆佸叾浠�")
+@Trace(exclude = true)
+@RestController
+@RequestMapping("/web/unit")
+@Slf4j
+public class UnitController {
+
+    @Autowired
+    private SystemDictDataBiz systemDictDataBiz;
+
+    @Autowired
+    private ProblemsService problemsService;
+
+    @Autowired
+    private ProblemLogService problemLogService;
+
+    @ApiOperation(value = "鏌ヨ瀛楀吀鍊兼暟鎹�", notes = "H5")
+    @GetMapping("/getSystemDictData")
+    @ApiImplicitParams({
+            @ApiImplicitParam(paramType = "query", dataType = "String", name = "label", value = "鏁版嵁瀛楀吀鍊�", required = true),
+            @ApiImplicitParam(paramType = "query", dataType = "String", name = "dictCode", value = "绯荤粺瀛楀吀鍊�", required = true)
+    })
+    public ApiResponse<SystemDictData> getSystemDictData(@RequestParam String dictCode, @RequestParam String label) {
+        return ApiResponse.success("鏌ヨ鎴愬姛",systemDictDataBiz.queryByCode(dictCode,label));
+    }
+
+
+    @ApiOperation(value = "鑾峰彇棰樼洰鏁版嵁", notes = "H5")
+    @GetMapping("/getProblemsVO")
+    @ApiImplicitParams({
+            @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "useType", value = "浣跨敤鍦烘櫙 0鍔冲姟浜哄憳 1鏅�氳瀹�", required = true)
+    })
+    public ApiResponse<List<ProblemsVO>> getProblemsVO(@RequestParam Integer useType) {
+        return ApiResponse.success("鏌ヨ鎴愬姛",problemsService.getProblemsVO(useType));
+    }
+
+
+    @ApiOperation(value = "淇濆瓨绛旈璁板綍", notes = "H5")
+    @PostMapping("/finishAnswer")
+    public ApiResponse<Integer> finishAnswer(@RequestBody FinishAnswerDTO finishAnswerDTO) {
+        return ApiResponse.success("鏌ヨ鎴愬姛",problemLogService.finishAnswer(finishAnswerDTO));
+    }
+
+
+}
diff --git a/server/dmvisit_web/src/main/java/com/doumee/api/web/VisitorController.java b/server/dmvisit_web/src/main/java/com/doumee/api/web/VisitorController.java
new file mode 100644
index 0000000..776f797
--- /dev/null
+++ b/server/dmvisit_web/src/main/java/com/doumee/api/web/VisitorController.java
@@ -0,0 +1,47 @@
+package com.doumee.api.web;
+
+import com.doumee.core.annotation.trace.Trace;
+import com.doumee.core.model.ApiResponse;
+import com.doumee.core.utils.Constants;
+import com.doumee.dao.web.response.WxAuthorizeVO;
+import com.doumee.service.business.MemberService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * Created by IntelliJ IDEA.
+ *
+ * @Author : Rk
+ * @create 2023/12/7 10:40
+ */
+
+@Api(tags = "1銆佽瀹笟鍔�")
+@Trace(exclude = true)
+@RestController
+@RequestMapping("/web/visitor")
+@Slf4j
+public class VisitorController {
+
+    @Autowired
+    private MemberService memberService;
+
+    @ApiOperation(value = "璁垮寰俊鎺堟潈", notes = "璁垮寰俊鎺堟潈鑾峰彇openId")
+    @GetMapping("/wxAuthorize")
+    @ApiImplicitParams({
+            @ApiImplicitParam(paramType = "query", dataType = "String", name = "code", value = "鎺堟潈鐮�", required = true)
+    })
+    public ApiResponse<WxAuthorizeVO> wxAuthorize(@RequestParam String code) {
+        WxAuthorizeVO wxAuthorizeVO =  memberService.wxAuthorize(code);
+        return ApiResponse.success("鏌ヨ鎴愬姛",wxAuthorizeVO);
+    }
+
+
+}

--
Gitblit v1.9.3