From 74bfaf2f3a8c2661e2c8a512f61f40bfd43b48f3 Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期一, 17 二月 2025 18:54:19 +0800
Subject: [PATCH] Merge branch 'master' of http://116.62.18.175:6699/r/smartor

---
 smartor/src/main/java/com/smartor/domain/ServiceSubtask.java                                 |   12 
 ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java                       |   34 ++
 ruoyi-admin/src/main/resources/application.yml                                               |    2 
 smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml                           |   91 +++++++
 ruoyi-common/src/main/java/com/ruoyi/common/enums/HospTypeEnum.java                          |   45 +++
 smartor/src/main/java/com/smartor/domain/ServiceTaskInfo.java                                |    2 
 ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java                                 |   14 
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java     |   14 
 smartor/src/main/java/com/smartor/service/impl/SvyTaskSingleServiceImpl.java                 |   86 +-----
 smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java                |   44 +++
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceExternalController.java    |    7 
 .idea/workspace.xml                                                                          |  202 +++++++++++-----
 ruoyi-admin/src/main/resources/application-druid.yml                                         |   50 ++--
 ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java                       |    4 
 ruoyi-common/src/main/java/com/ruoyi/common/enums/TaskTypeEnum.java                          |   45 +++
 ruoyi-admin/src/main/java/com/ruoyi/web/test/MQTest.java                                     |    3 
 ruoyi-common/src/main/java/com/ruoyi/common/enums/ServiceTaskTypeEnum.java                   |   45 +++
 smartor/src/main/java/com/smartor/mapper/ServiceSubtaskMapper.java                           |    2 
 ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/HospitalFilterInterceptor.java |    2 
 smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java          |    4 
 smartor/src/main/java/com/smartor/domain/ServiceSubtaskVO.java                               |    7 
 21 files changed, 525 insertions(+), 190 deletions(-)

diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 98587bd..b2ec3c1 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,7 +4,26 @@
     <option name="autoReloadType" value="SELECTIVE" />
   </component>
   <component name="ChangeListManager">
-    <list default="true" id="d7325e97-ef1a-4946-a53e-fea72f2992f8" name="Changes" comment="浠g爜鎻愪氦" />
+    <list default="true" id="d7325e97-ef1a-4946-a53e-fea72f2992f8" name="Changes" comment="">
+      <change afterPath="$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/enums/HospTypeEnum.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/enums/ServiceTaskTypeEnum.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/enums/TaskTypeEnum.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceExternalController.java" beforeDir="false" afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceExternalController.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java" beforeDir="false" afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/web/test/MQTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/web/test/MQTest.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/ruoyi-admin/src/main/resources/application-druid.yml" beforeDir="false" afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/resources/application-druid.yml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/ruoyi-admin/src/main/resources/application.yml" beforeDir="false" afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/resources/application.yml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/HospitalFilterInterceptor.java" beforeDir="false" afterPath="$PROJECT_DIR$/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/HospitalFilterInterceptor.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java" beforeDir="false" afterPath="$PROJECT_DIR$/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/smartor/src/main/java/com/smartor/domain/ServiceSubtask.java" beforeDir="false" afterPath="$PROJECT_DIR$/smartor/src/main/java/com/smartor/domain/ServiceSubtask.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/smartor/src/main/java/com/smartor/domain/ServiceSubtaskVO.java" beforeDir="false" afterPath="$PROJECT_DIR$/smartor/src/main/java/com/smartor/domain/ServiceSubtaskVO.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/smartor/src/main/java/com/smartor/domain/ServiceTaskInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/smartor/src/main/java/com/smartor/domain/ServiceTaskInfo.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/smartor/src/main/java/com/smartor/mapper/ServiceSubtaskMapper.java" beforeDir="false" afterPath="$PROJECT_DIR$/smartor/src/main/java/com/smartor/mapper/ServiceSubtaskMapper.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/smartor/src/main/java/com/smartor/service/impl/SvyTaskSingleServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/smartor/src/main/java/com/smartor/service/impl/SvyTaskSingleServiceImpl.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml" beforeDir="false" afterPath="$PROJECT_DIR$/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml" afterDir="false" />
+    </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
     <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@@ -37,7 +56,6 @@
     <option name="generalSettings">
       <MavenGeneralSettings>
         <option name="useMavenConfig" value="true" />
-        <option name="userSettingsFile" value="D:\apache-maven-3.6.1\conf\settings.xml" />
       </MavenGeneralSettings>
     </option>
   </component>
@@ -49,24 +67,32 @@
     <option name="hideEmptyMiddlePackages" value="true" />
     <option name="showLibraryContents" value="true" />
   </component>
-  <component name="PropertiesComponent"><![CDATA[{
-  "keyToString": {
-    "RequestMappingsPanelOrder0": "0",
-    "RequestMappingsPanelOrder1": "1",
-    "RequestMappingsPanelWidth0": "75",
-    "RequestMappingsPanelWidth1": "75",
-    "RunOnceActivity.ShowReadmeOnStart": "true",
-    "WebServerToolWindowFactoryState": "false",
-    "node.js.detected.package.eslint": "true",
-    "node.js.detected.package.tslint": "true",
-    "node.js.selected.package.eslint": "(autodetect)",
-    "node.js.selected.package.tslint": "(autodetect)",
-    "nodejs_package_manager_path": "npm",
-    "settings.editor.selected.configurable": "MavenSettings",
-    "spring.configuration.checksum": "ed7879021ad915c81cd04d3c0132bd07",
-    "vue.rearranger.settings.migration": "true"
-  }
-}]]></component>
+  <component name="PropertiesComponent">
+    <property name="RequestMappingsPanelOrder0" value="0" />
+    <property name="RequestMappingsPanelOrder1" value="1" />
+    <property name="RequestMappingsPanelOrder2" value="2" />
+    <property name="RequestMappingsPanelWidth0" value="75" />
+    <property name="RequestMappingsPanelWidth1" value="75" />
+    <property name="RequestMappingsPanelWidth2" value="75" />
+    <property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
+    <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
+    <property name="ToolWindow闂.ShowToolbar" value="false" />
+    <property name="WebServerToolWindowFactoryState" value="false" />
+    <property name="aspect.path.notification.shown" value="true" />
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/../smartor-wuxi" />
+    <property name="node.js.detected.package.eslint" value="true" />
+    <property name="node.js.detected.package.tslint" value="true" />
+    <property name="node.js.path.for.package.eslint" value="project" />
+    <property name="node.js.path.for.package.tslint" value="project" />
+    <property name="node.js.selected.package.eslint" value="(autodetect)" />
+    <property name="node.js.selected.package.tslint" value="(autodetect)" />
+    <property name="nodejs_package_manager_path" value="npm" />
+    <property name="project.structure.last.edited" value="SDKs" />
+    <property name="project.structure.proportion" value="0.0" />
+    <property name="project.structure.side.proportion" value="0.2" />
+    <property name="settings.editor.selected.configurable" value="preferences.pluginManager" />
+    <property name="vue.rearranger.settings.migration" value="true" />
+  </component>
   <component name="ReactorSettings">
     <option name="notificationShown" value="true" />
   </component>
@@ -79,11 +105,11 @@
       <recent name="D:\daima\smartor\smartor-lisui\smartor\src\main\java\com\smartor\mapper" />
     </key>
     <key name="CopyClassDialog.RECENTS_KEY">
+      <recent name="com.ruoyi.common.enums" />
       <recent name="com.smartor.domain" />
       <recent name="com.ruoyi.web.controller.smartor" />
       <recent name="com.smartor.service" />
       <recent name="com.smartor.service.impl" />
-      <recent name="com.smartor.mapper" />
     </key>
   </component>
   <component name="RedisHelper">
@@ -112,6 +138,14 @@
           <option name="password" value="Smartor" />
           <option name="port" value="6020" />
           <option name="url" value="192.168.191.181" />
+        </ConnectionInfo>
+        <ConnectionInfo>
+          <option name="global" value="false" />
+          <option name="id" value="58aa81a0-3273-4f33-8973-55a6deb8702e" />
+          <option name="name" value="116.62.18.175" />
+          <option name="password" value="Smartor" />
+          <option name="port" value="6020" />
+          <option name="url" value="116.62.18.175" />
         </ConnectionInfo>
       </list>
     </option>
@@ -206,9 +240,9 @@
     </configuration>
     <recent_temporary>
       <list>
+        <item itemvalue="JUnit.MQTest.bb" />
         <item itemvalue="JUnit.FtpService.aa" />
         <item itemvalue="JUnit.FtpService" />
-        <item itemvalue="JUnit.MQTest.bb" />
         <item itemvalue="JUnit.MQTest" />
       </list>
     </recent_temporary>
@@ -309,7 +343,8 @@
       <workItem from="1739323404849" duration="23795000" />
       <workItem from="1739411538383" duration="21710000" />
       <workItem from="1739501318573" duration="2373000" />
-      <workItem from="1739506814738" duration="2148000" />
+      <workItem from="1739507523684" duration="15221000" />
+      <workItem from="1739766088739" duration="19190000" />
     </task>
     <task id="LOCAL-00001" summary="浠g爜鎻愪氦">
       <created>1730948127775</created>
@@ -360,35 +395,14 @@
       <option name="project" value="LOCAL" />
       <updated>1734406665810</updated>
     </task>
-    <task id="LOCAL-00008" summary="浠g爜鎻愪氦">
-      <created>1739507205045</created>
+    <task id="LOCAL-00008" summary="寰�闃熷垪鏂板鏄紝鍒ゆ柇鏄線澶撮儴鏂板杩樻槸寰�灏鹃儴鏂板">
+      <created>1739766619501</created>
       <option name="number" value="00008" />
       <option name="presentableId" value="LOCAL-00008" />
       <option name="project" value="LOCAL" />
-      <updated>1739507205045</updated>
+      <updated>1739766619501</updated>
     </task>
-    <task id="LOCAL-00009" summary="浠g爜鎻愪氦">
-      <created>1739507308567</created>
-      <option name="number" value="00009" />
-      <option name="presentableId" value="LOCAL-00009" />
-      <option name="project" value="LOCAL" />
-      <updated>1739507308567</updated>
-    </task>
-    <task id="LOCAL-00010" summary="浠g爜鎻愪氦">
-      <created>1739513977819</created>
-      <option name="number" value="00010" />
-      <option name="presentableId" value="LOCAL-00010" />
-      <option name="project" value="LOCAL" />
-      <updated>1739513977819</updated>
-    </task>
-    <task id="LOCAL-00011" summary="浠g爜鎻愪氦">
-      <created>1739514859952</created>
-      <option name="number" value="00011" />
-      <option name="presentableId" value="LOCAL-00011" />
-      <option name="project" value="LOCAL" />
-      <updated>1739514859952</updated>
-    </task>
-    <option name="localTasksCounter" value="12" />
+    <option name="localTasksCounter" value="9" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
@@ -408,7 +422,8 @@
   <component name="VcsManagerConfiguration">
     <MESSAGE value="浠g爜鎻愪氦(闀挎湡浠诲姟鐢佃瘽瀹屾垚)" />
     <MESSAGE value="浠g爜鎻愪氦" />
-    <option name="LAST_COMMIT_MESSAGE" value="浠g爜鎻愪氦" />
+    <MESSAGE value="寰�闃熷垪鏂板鏄紝鍒ゆ柇鏄線澶撮儴鏂板杩樻槸寰�灏鹃儴鏂板" />
+    <option name="LAST_COMMIT_MESSAGE" value="寰�闃熷垪鏂板鏄紝鍒ゆ柇鏄線澶撮儴鏂板杩樻槸寰�灏鹃儴鏂板" />
   </component>
   <component name="XDebuggerManager">
     <breakpoint-manager>
@@ -430,12 +445,12 @@
         </line-breakpoint>
         <line-breakpoint type="java-line">
           <url>file://$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceExternalController.java</url>
-          <line>116</line>
+          <line>115</line>
           <option name="timeStamp" value="281" />
         </line-breakpoint>
         <line-breakpoint type="java-line">
           <url>file://$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceExternalController.java</url>
-          <line>133</line>
+          <line>132</line>
           <option name="timeStamp" value="285" />
         </line-breakpoint>
         <line-breakpoint type="java-line">
@@ -530,7 +545,7 @@
         </line-breakpoint>
         <line-breakpoint type="java-line">
           <url>file://$PROJECT_DIR$/smartor/src/main/java/com/smartor/service/impl/SvyTaskSingleServiceImpl.java</url>
-          <line>206</line>
+          <line>209</line>
           <option name="timeStamp" value="349" />
         </line-breakpoint>
         <line-breakpoint type="java-line">
@@ -540,7 +555,7 @@
         </line-breakpoint>
         <line-breakpoint type="java-line">
           <url>file://$PROJECT_DIR$/smartor/src/main/java/com/smartor/service/impl/SvyTaskSingleServiceImpl.java</url>
-          <line>311</line>
+          <line>266</line>
           <option name="timeStamp" value="352" />
         </line-breakpoint>
         <line-breakpoint type="java-line">
@@ -645,48 +660,108 @@
         </line-breakpoint>
         <line-breakpoint type="java-line">
           <url>file://$PROJECT_DIR$/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java</url>
-          <line>522</line>
+          <line>530</line>
           <option name="timeStamp" value="383" />
         </line-breakpoint>
         <line-breakpoint type="java-line">
           <url>file://$PROJECT_DIR$/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java</url>
-          <line>661</line>
+          <line>669</line>
           <option name="timeStamp" value="384" />
         </line-breakpoint>
         <line-breakpoint type="java-line">
           <url>file://$PROJECT_DIR$/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java</url>
-          <line>633</line>
+          <line>641</line>
           <option name="timeStamp" value="385" />
         </line-breakpoint>
         <line-breakpoint type="java-line">
           <url>file://$PROJECT_DIR$/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java</url>
-          <line>1965</line>
+          <line>1991</line>
           <option name="timeStamp" value="386" />
         </line-breakpoint>
         <line-breakpoint type="java-line">
           <url>file://$PROJECT_DIR$/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java</url>
-          <line>1961</line>
+          <line>1987</line>
           <option name="timeStamp" value="387" />
         </line-breakpoint>
-        <line-breakpoint enabled="true" type="java-line">
+        <line-breakpoint type="java-line">
           <url>file://$PROJECT_DIR$/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java</url>
           <line>249</line>
           <option name="timeStamp" value="390" />
         </line-breakpoint>
-        <line-breakpoint enabled="true" type="java-line">
+        <line-breakpoint type="java-line">
           <url>file://$PROJECT_DIR$/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java</url>
           <line>248</line>
           <option name="timeStamp" value="393" />
         </line-breakpoint>
-        <line-breakpoint enabled="true" type="java-line">
+        <line-breakpoint type="java-line">
           <url>file://$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java</url>
           <line>107</line>
           <option name="timeStamp" value="395" />
         </line-breakpoint>
+        <line-breakpoint type="java-line">
+          <url>file://$PROJECT_DIR$/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java</url>
+          <line>320</line>
+          <option name="timeStamp" value="405" />
+        </line-breakpoint>
+        <line-breakpoint type="java-line">
+          <url>file://$PROJECT_DIR$/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java</url>
+          <line>256</line>
+          <option name="timeStamp" value="412" />
+        </line-breakpoint>
+        <line-breakpoint type="java-line">
+          <url>file://$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java</url>
+          <line>205</line>
+          <option name="timeStamp" value="415" />
+        </line-breakpoint>
+        <line-breakpoint type="java-line">
+          <url>file://$PROJECT_DIR$/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java</url>
+          <line>1442</line>
+          <option name="timeStamp" value="416" />
+        </line-breakpoint>
+        <line-breakpoint type="java-line">
+          <url>file://$PROJECT_DIR$/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java</url>
+          <line>1493</line>
+          <option name="timeStamp" value="417" />
+        </line-breakpoint>
+        <line-breakpoint type="java-line">
+          <url>file://$PROJECT_DIR$/smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java</url>
+          <line>339</line>
+          <option name="timeStamp" value="420" />
+        </line-breakpoint>
+        <line-breakpoint type="java-line">
+          <url>file://$PROJECT_DIR$/smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java</url>
+          <line>206</line>
+          <option name="timeStamp" value="421" />
+        </line-breakpoint>
+        <line-breakpoint type="java-line">
+          <url>file://$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/web/test/MQTest.java</url>
+          <line>51</line>
+          <option name="timeStamp" value="425" />
+        </line-breakpoint>
+        <line-breakpoint type="java-line">
+          <url>file://$PROJECT_DIR$/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java</url>
+          <line>2093</line>
+          <option name="timeStamp" value="426" />
+        </line-breakpoint>
+        <line-breakpoint type="java-line">
+          <url>file://$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java</url>
+          <line>204</line>
+          <option name="timeStamp" value="427" />
+        </line-breakpoint>
+        <line-breakpoint type="java-line">
+          <url>file://$PROJECT_DIR$/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java</url>
+          <line>2102</line>
+          <option name="timeStamp" value="428" />
+        </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java</url>
-          <line>1447</line>
-          <option name="timeStamp" value="397" />
+          <line>1510</line>
+          <option name="timeStamp" value="429" />
+        </line-breakpoint>
+        <line-breakpoint enabled="true" type="java-line">
+          <url>file://$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java</url>
+          <line>107</line>
+          <option name="timeStamp" value="431" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-method">
           <url>file://$PROJECT_DIR$/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java</url>
@@ -702,7 +777,6 @@
     <pin-to-top-manager>
       <pinned-members>
         <PinnedItemInfo />
-        <PinnedItemInfo parentTag="com.smartor.domain.IvrLibaTemplateScriptVO" memberName="ivrLibaScriptTargetoptionList" />
       </pinned-members>
     </pin-to-top-manager>
   </component>
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java b/ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java
index 25ed5af..5f3b6cd 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java
@@ -211,7 +211,7 @@
                                     list.add(serviceSubtask2.getId().toString());
                                 }
                                 log.error("缂撳瓨涓璫ache-0鐨勫�间负锛歿}", list);
-                                redisCache.setCacheList("cache-0", list);
+                                redisCache.setCacheListLeft("cache-0", list);
                             } else {
                                 //闈炵珛鍗冲彂閫�
                                 ServiceSubtaskVO serviceSubtask1 = new ServiceSubtaskVO();
@@ -221,7 +221,7 @@
                                 for (ServiceSubtask serviceSubtask2 : selectServiceSubtaskList1) {
                                     list.add(serviceSubtask2.getId().toString());
                                 }
-                                redisCache.setCacheList(key, list);
+                                redisCache.setCacheListLeft(key, list);
                             }
                         } catch (Exception exception) {
                             ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord();
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceExternalController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceExternalController.java
index 3b425c3..d5508dd 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceExternalController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceExternalController.java
@@ -61,12 +61,11 @@
      */
     @ApiOperation("鏂板浠诲姟")
     @PostMapping("/generalInterfaceAddTask")
-    public AjaxResult generalInterfaceAddTask(@RequestBody ServiceTaskInfo serviceSubtask) {
-        ServiceTaskInfo serviceTaskVO = null;
+    public AjaxResult generalInterfaceAddTask(@RequestBody ServiceTaskInfo serviceTaskInfo) {
+        log.error("------serviceTaskInfo鐨勫�间负锛歿}", serviceTaskInfo);
         Integer res = 0;
         try {
-            serviceTaskVO = DtoConversionUtils.sourceToTarget(serviceSubtask, ServiceTaskInfo.class);
-            res = svyTaskSingleService.insertTaskInfo(serviceTaskVO);
+            res = svyTaskSingleService.insertTaskInfo(serviceTaskInfo);
         } catch (Exception e) {
             e.printStackTrace();
             log.error("serviceExternal---generalInterfaceAddTask鍑哄紓甯镐簡锛歿}", e.getMessage());
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java
index be6aa8b..68fb69b 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java
@@ -190,8 +190,8 @@
     @PostMapping("/phoneCallBackYQ")
     public PhoneCallBackYQVO phoneCallBackYQ(@RequestBody PhoneCallReqYQVO phoneCallReqYQVO) {
         log.error("鐢佃瘽ASR閫氳瘽鍥炶皟(闆ㄧ划) 锛焮}", phoneCallReqYQVO);
-        SysUser user = getLoginUser().getUser();
-        phoneCallReqYQVO.setOrgid(user.getOrgid());
+//        SysUser user = getLoginUser().getUser();
+//        phoneCallReqYQVO.setOrgid(user.getOrgid());
         PhoneCallBackYQVO phoneCallBackYQVO = serviceSubtaskService.phoneCallBackYQ(phoneCallReqYQVO);
         return phoneCallBackYQVO;
     }
@@ -204,6 +204,8 @@
     public List<PullTaskVO> taskPull() {
         log.error("鐢佃瘽浠诲姟鎷夊彇(闆ㄧ划)");
         List<PullTaskVO> pullTaskVOList = serviceSubtaskService.taskPull();
+//        List<PullTaskVO> pullTaskVOList = new ArrayList<>();
+
         log.error("鐢佃瘽浠诲姟鎷夊彇(闆ㄧ划):{}", pullTaskVOList);
         return pullTaskVOList;
     }
@@ -214,8 +216,8 @@
     @ApiOperation("鎮h�呴棶棰樼粨鏋滆褰曪紙鐢佃瘽锛�")
     @PostMapping("/saveQuestionAnswerPhone")
     public AjaxResult saveQuestionAnswerPhone(@RequestBody ServiceSubTaskDetailReq serviceSubTaskDetailReq) {
-        SysUser user = getLoginUser().getUser();
-        serviceSubTaskDetailReq.setOrgid(user.getOrgid());
+//        SysUser user = getLoginUser().getUser();
+//        serviceSubTaskDetailReq.setOrgid(user.getOrgid());
         return toAjax(serviceSubtaskService.saveQuestionAnswerPhone(serviceSubTaskDetailReq));
     }
 
@@ -236,8 +238,8 @@
     public AjaxResult recordAccept(@RequestBody PhoneCallRecordVO phoneCallRecordVO) {
         log.error("閫氳瘽璁板綍鍥炶皟(闆ㄧ划):{}", phoneCallRecordVO);
 //        return toAjax(serviceSubtaskService.saveQuestionAnswerPhone(serviceSubTaskDetailReq));
-        SysUser user = getLoginUser().getUser();
-        phoneCallRecordVO.setOrgid(user.getOrgid());
+//        SysUser user = getLoginUser().getUser();
+//        phoneCallRecordVO.setOrgid(user.getOrgid());
         serviceSubtaskService.recordAccept(phoneCallRecordVO);
         return success();
     }
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/test/MQTest.java b/ruoyi-admin/src/main/java/com/ruoyi/web/test/MQTest.java
index 8971fd0..49171a6 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/test/MQTest.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/test/MQTest.java
@@ -48,7 +48,8 @@
 
     @Test
     public void bb() {
-
+        int i = 61 /60;
+        System.out.println(i);
     }
 
     public void aa(MultipartFile file) throws IOException {
diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml
index 91d9bc9..0ee8d3a 100644
--- a/ruoyi-admin/src/main/resources/application-druid.yml
+++ b/ruoyi-admin/src/main/resources/application-druid.yml
@@ -11,39 +11,39 @@
         #        username: root
         #        password: 123456
         #        鍏徃
-        # url: jdbc:mysql://192.168.2.9:3308/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        url: jdbc:mysql://192.168.2.9:3308/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
         #        涓芥按
         #        url: jdbc:mysql://127.0.0.1:3308/smartor-lisui?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        username: smartor
+        password: Smartor.2023
+        driverClassName: com.mysql.cj.jdbc.Driver
+        # 鏂板崕
+        #        url: jdbc:mysql://192.168.191.181:3308/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
         #        username: smartor
         #        password: Smartor.2023
         #        driverClassName: com.mysql.cj.jdbc.Driver
-        # 鏂板崕
-        # url: jdbc:mysql://192.168.191.181:3308/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-        # username: smartor
-        # password: Smartor.2023
-        # driverClassName: com.mysql.cj.jdbc.Driver
 
         #        鍏徃浜�
-        url: jdbc:mysql://116.62.18.175:6002/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-        username: hxsoft
-        password: Hxerp2000
-        driverClassName: com.mysql.cj.jdbc.Driver
+      #        url: jdbc:mysql://116.62.18.175:6002/smartor_lisui?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+      #        username: hxsoft
+      #        password: Hxerp2000
+      #        driverClassName: com.mysql.cj.jdbc.Driver
 
       # 浠庡簱鏁版嵁婧�
       slave:
-        # 浠庢暟鎹簮寮�鍏�/榛樿鍏抽棴(鍏徃)
-        # enabled: true
-        # url: jdbc:sqlserver://116.62.18.175:6001;DatabaseName=iv-ywey;encrypt=false;SelectMethod=cursor
-        # username: sa
-        # password: Hxerp2000
-        # driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
+      # 浠庢暟鎹簮寮�鍏�/榛樿鍏抽棴(鍏徃)
+      # enabled: true
+      # url: jdbc:sqlserver://116.62.18.175:6001;DatabaseName=iv-ywey;encrypt=false;SelectMethod=cursor
+      # username: sa
+      # password: Hxerp2000
+      # driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
 
-        # 浠庢暟鎹簮寮�鍏�/榛樿鍏抽棴(涔変箤浜岄櫌)
-        # enabled: true
-        # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=IntelligentVoice;encrypt=false;SelectMethod=cursor
-        # username: sa
-        # password: sfxt#2023
-        # driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
+      # 浠庢暟鎹簮寮�鍏�/榛樿鍏抽棴(涔変箤浜岄櫌)
+      # enabled: true
+      # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=IntelligentVoice;encrypt=false;SelectMethod=cursor
+      # username: sa
+      # password: sfxt#2023
+      # driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
 
       # 鍒濆杩炴帴鏁�
       initialSize: 5
@@ -207,5 +207,7 @@
 #鍏佽鑷姩鐢熸垚浠诲姟
 createTaskServiceType: 2
 
-#姣忓ぉ鐢佃瘽绔嬪嵆鎵ц鐨勪笂闄�
-phoneUpEveryHour: 120
+#绗釜灏忔椂鐢佃瘽鎷ㄦ墦鐨勪笂闄�
+phoneUpEveryHour: 12
+#鐢佃瘽姣忓ぉ缁撴潫鏃堕棿
+phoneEndHour: 20
diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml
index 097c8ae..79a3570 100644
--- a/ruoyi-admin/src/main/resources/application.yml
+++ b/ruoyi-admin/src/main/resources/application.yml
@@ -72,7 +72,7 @@
   # redis 閰嶇疆
   redis:
     #    # 鍦板潃锛堜附姘达級
-    # host: 127.0.0.1
+    #    host: 127.0.0.1
     # 鍦板潃锛堝叕鍙革級
     host: 116.62.18.175
     port: 6020
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java
index 13210c8..8665654 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java
@@ -8,10 +8,7 @@
 import java.util.concurrent.TimeUnit;
 
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.redis.core.BoundSetOperations;
-import org.springframework.data.redis.core.HashOperations;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.data.redis.core.ValueOperations;
+import org.springframework.data.redis.core.*;
 import org.springframework.stereotype.Component;
 
 /**
@@ -19,7 +16,7 @@
  *
  * @author ruoyi
  **/
-@SuppressWarnings(value = {"unchecked" , "rawtypes"})
+@SuppressWarnings(value = {"unchecked", "rawtypes"})
 @Component
 public class RedisCache {
     @Autowired
@@ -127,8 +124,20 @@
      * @param dataList 寰呯紦瀛樼殑List鏁版嵁
      * @return 缂撳瓨鐨勫璞�
      */
-    public <T> long setCacheList(final String key, final List<T> dataList) {
+    public <T> long setCacheListRight(final String key, final List<T> dataList) {
         Long count = redisTemplate.opsForList().rightPushAll(key, dataList);
+        return count == null ? 0 : count;
+    }
+
+    /**
+     * 缂撳瓨List鏁版嵁
+     *
+     * @param key      缂撳瓨鐨勯敭鍊�
+     * @param dataList 寰呯紦瀛樼殑List鏁版嵁(杩欓噷濡傛灉鏂板鐨勮瘽锛屾槸寰�澶撮儴鏂板)
+     * @return 缂撳瓨鐨勫璞�
+     */
+    public <T> long setCacheListLeft(final String key, final List<T> dataList) {
+        Long count = redisTemplate.opsForList().leftPushAll(key, dataList);
         return count == null ? 0 : count;
     }
 
@@ -245,6 +254,19 @@
     }
 
     /**
+     * 鍒犻櫎缂撳瓨LIST涓殑鏌愪釜鏁版嵁
+     *
+     * @param key           Redis閿�
+     * @param valueToRemove 闇�瑕佸垹闄ょ殑鍊�
+     * @return Long 澶т簬0琛ㄧず鍒犻櫎浜嗗嚑涓紝绛変簬0琛ㄧず娌℃湁鍒犻櫎锛屽皬浜�0琛ㄧず鍦ㄦ墽琛屽垹闄ゆ搷浣滄椂鍙戠敓浜嗛敊璇�
+     */
+    public Long removeElementFromList(String key, String valueToRemove) {
+        ListOperations<String, String> listOps = redisTemplate.opsForList();
+        Long remove = listOps.remove(key, 0, valueToRemove);
+        return remove;
+    }
+
+    /**
      * 鑾峰緱缂撳瓨鐨勫熀鏈璞″垪琛�
      *
      * @param pattern 瀛楃涓插墠缂�
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/HospTypeEnum.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/HospTypeEnum.java
new file mode 100644
index 0000000..c699f3c
--- /dev/null
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/HospTypeEnum.java
@@ -0,0 +1,45 @@
+package com.ruoyi.common.enums;
+
+/**
+ * 鍙戦�佺被鍨嬫灇涓�
+ */
+public enum HospTypeEnum {
+    闂ㄨ瘖("1", "闂ㄨ瘖"), 鍑洪櫌("2", "銆佸嚭闄�"), 涓撶梾("3", "涓撶梾"), 澶栭儴瀵煎叆("4", "澶栭儴瀵煎叆"), 鎬ヨ瘖("5", "銆佹�ヨ瘖"), 浣忛櫌("6", "浣忛櫌"), 浣撴("7", "浣撴");
+
+
+    private String code;
+    private String desc;
+
+    HospTypeEnum(String code, String desc) {
+        this.code = code;
+        this.desc = desc;
+    }
+
+    public static String getDescByCode(String desc) {
+        HospTypeEnum[] organEnums = values();
+        for (int i = 0; i < organEnums.length; i++) {
+            HospTypeEnum organEnum = organEnums[i];
+            if (organEnum.getDesc().equals(desc)) {
+                return organEnum.getCode();
+            }
+        }
+        return "0";
+    }
+
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    public void setDesc(String desc) {
+        this.desc = desc;
+    }
+}
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/ServiceTaskTypeEnum.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/ServiceTaskTypeEnum.java
new file mode 100644
index 0000000..7648a86
--- /dev/null
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/ServiceTaskTypeEnum.java
@@ -0,0 +1,45 @@
+package com.ruoyi.common.enums;
+
+/**
+ * 鍙戦�佺被鍨嬫灇涓�
+ */
+public enum ServiceTaskTypeEnum {
+    浣撴闅忚("9", "浣撴闅忚 "), 鍖绘妧闅忚("10", "鍖绘妧闅忚");
+
+
+    private String code;
+    private String desc;
+
+    ServiceTaskTypeEnum(String code, String desc) {
+        this.code = code;
+        this.desc = desc;
+    }
+
+    public static String getDescByCode(String desc) {
+        ServiceTaskTypeEnum[] organEnums = values();
+        for (int i = 0; i < organEnums.length; i++) {
+            ServiceTaskTypeEnum organEnum = organEnums[i];
+            if (organEnum.getDesc().equals(desc)) {
+                return organEnum.getCode();
+            }
+        }
+        return "0";
+    }
+
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    public void setDesc(String desc) {
+        this.desc = desc;
+    }
+}
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/TaskTypeEnum.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/TaskTypeEnum.java
new file mode 100644
index 0000000..28f1cd7
--- /dev/null
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/TaskTypeEnum.java
@@ -0,0 +1,45 @@
+package com.ruoyi.common.enums;
+
+/**
+ * 鍙戦�佺被鍨嬫灇涓�
+ */
+public enum TaskTypeEnum {
+    浣撴闅忚("8", "浣撴闅忚"),  蹇冪數涓撶闅忚("9", "銆佸績鐢典笓绉戦殢璁�"), 褰卞儚涓撶闅忚("10", "褰卞儚涓撶闅忚");
+
+
+    private String code;
+    private String desc;
+
+    TaskTypeEnum(String code, String desc) {
+        this.code = code;
+        this.desc = desc;
+    }
+
+    public static String getDescByCode(String desc) {
+        TaskTypeEnum[] organEnums = values();
+        for (int i = 0; i < organEnums.length; i++) {
+            TaskTypeEnum organEnum = organEnums[i];
+            if (organEnum.getDesc().equals(desc)) {
+                return organEnum.getCode();
+            }
+        }
+        return "0";
+    }
+
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    public void setDesc(String desc) {
+        this.desc = desc;
+    }
+}
diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/HospitalFilterInterceptor.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/HospitalFilterInterceptor.java
index 11bf7c5..6f28271 100644
--- a/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/HospitalFilterInterceptor.java
+++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/HospitalFilterInterceptor.java
@@ -72,7 +72,7 @@
      * @return 淇敼鍚庣殑 SQL
      */
     private String modifySqlWithorgidId(String originalSql, String orgid) {
-        if (originalSql.contains("insert into") || originalSql.contains("INSERT INTO") || originalSql.contains("from sys_menu"))
+        if (originalSql.contains("insert into") || originalSql.contains("INSERT INTO") || originalSql.contains("from sys_menu") || originalSql.contains("update sys_menu"))
             return originalSql;
         // 鎻愬彇 orgid 鐨� WHERE 瀛愬彞
         String whereClause = " orgid = '" + orgid + "'";
diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
index 801c238..eaec792 100644
--- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
+++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
@@ -48,6 +48,7 @@
 import java.time.ZoneId;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * 瀹氭椂浠诲姟璋冨害娴嬭瘯
@@ -308,7 +309,13 @@
                 ServiceSubtaskVO ivrTaskcall = new ServiceSubtaskVO();
                 ivrTaskcall.setTaskid(commonTaskcallMQ.getTaskid());
                 ivrTaskcall.setSendstate(2L);
-                List<ServiceSubtask> selectServiceSubtaskList = iServiceSubtaskService.selectServiceSubtaskList(ivrTaskcall);
+                List<ServiceSubtask> subtaskList = iServiceSubtaskService.selectServiceSubtaskList(ivrTaskcall);
+
+                // 鎸夌収 endtime 绂诲綋鍓嶆椂闂存渶杩戠殑鎺掑簭
+                List<ServiceSubtask> selectServiceSubtaskList = subtaskList.stream()
+                        .sorted(Comparator.comparing(subtask -> Math.abs(subtask.getEndtime().getTime() - new Date().getTime())))
+                        .collect(Collectors.toList());
+
                 if (descByCode.equals("鐢佃瘽")) {
                     String value = "";
                     List<String> list = new ArrayList<>();
@@ -343,8 +350,9 @@
                         }
                     }
                     //灏嗚鎵ц鐨勬斁鍒扮紦瀛樹腑
-                    redisCache.setCacheList("cache-0", list);
-
+                    if (list.size() > 0) {
+                        redisCache.setCacheListLeft("cache-0", list);
+                    }
                 } else if (descByCode.equals("澶氬獟浣�")) {
                     //澶氬獟浣�
                 } else if (descByCode.equals("绾歌川")) {
diff --git a/smartor/src/main/java/com/smartor/domain/ServiceSubtask.java b/smartor/src/main/java/com/smartor/domain/ServiceSubtask.java
index 4fbea28..7a4e6c6 100644
--- a/smartor/src/main/java/com/smartor/domain/ServiceSubtask.java
+++ b/smartor/src/main/java/com/smartor/domain/ServiceSubtask.java
@@ -35,6 +35,12 @@
     private Long taskid;
 
     /**
+     * 绗笁鏂逛换鍔D
+     */
+    @ApiModelProperty(value = "绗笁鏂逛换鍔D")
+    private String taskGuid;
+
+    /**
      * 鍑洪櫌鐥呬汉璁板綍ID
      */
     @ApiModelProperty(value = "鍑洪櫌鐥呬汉璁板綍ID")
@@ -144,14 +150,14 @@
      * 浠诲姟绫诲瀷(闂ㄨ瘖锛屼綇闄紝澶嶈瘖鈥�)
      */
     @Excel(name = "浠诲姟绫诲瀷(0閫氱煡銆�1瀹f暀銆�2闂ㄨ瘖銆�3鍑洪櫌銆�4澶嶈瘖銆�5浣撴銆�6闂嵎銆�7鍖绘妧鈥︹��)")
-    @ApiModelProperty(value = "浠诲姟绫诲瀷(0閫氱煡銆�1瀹f暀銆�2闂ㄨ瘖銆�3鍑洪櫌銆�4澶嶈瘖銆�5浣撴銆�6闂嵎銆�7鍖绘妧鈥︹��)")
+    @ApiModelProperty(value = "浠诲姟绫诲瀷(0閫氱煡銆�1瀹f暀銆�2闂ㄨ瘖銆�3鍑洪櫌銆�4澶嶈瘖銆�5浣撴銆�6闂嵎銆�7鍖绘妧銆�8浣撴闅忚銆�9褰卞儚涓撶闅忚銆�10蹇冪數涓撶闅忚鈥︹��)")
     private String type;
 
     /**
      * 鏈嶅姟绫诲瀷(1銆佺洃娴嬭瘎浼帮紱2銆佸嚭闄㈤殢璁匡紱3銆侀棬璇婇殢璁匡紱4銆佸鏁欏叧鎬�锛�5銆佸璇婇�氱煡锛�6銆佹弧鎰忓害璋冩煡锛�7銆佹偅鑰呮姤鍛婏紱 8銆佸叾浠栭�氱煡)
      */
     @Excel(name = "鏈嶅姟绫诲瀷(1銆佺洃娴嬭瘎浼帮紱2銆佸嚭闄㈤殢璁匡紱3銆侀棬璇婇殢璁匡紱4銆佸鏁欏叧鎬�锛�5銆佸璇婇�氱煡锛�6銆佹弧鎰忓害璋冩煡锛�7銆佹偅鑰呮姤鍛婏紱 8銆佸叾浠栭�氱煡)")
-    @ApiModelProperty(value = "鏈嶅姟绫诲瀷(1銆佺洃娴嬭瘎浼帮紱2銆佸嚭闄㈤殢璁匡紱3銆侀棬璇婇殢璁匡紱4銆佸鏁欏叧鎬�锛�5銆佸璇婇�氱煡锛�6銆佹弧鎰忓害璋冩煡锛�7銆佹偅鑰呮姤鍛婏紱 8銆佸叾浠栭�氱煡)")
+    @ApiModelProperty(value = "鏈嶅姟绫诲瀷(1銆佺洃娴嬭瘎浼帮紱2銆佸嚭闄㈤殢璁匡紱3銆侀棬璇婇殢璁匡紱4銆佸鏁欏叧鎬�锛�5銆佸璇婇�氱煡锛�6銆佹弧鎰忓害璋冩煡锛�7銆佹偅鑰呮姤鍛婏紱 8銆佸叾浠栭�氱煡 9浣撴闅忚 10鍖绘妧闅忚")
     private String serviceType;
 
     /**
@@ -420,7 +426,7 @@
      * 灏辫瘖绫诲瀷锛�1闂ㄨ瘖  2鍑洪櫌锛�
      */
     @Excel(name = "  灏辫瘖绫诲瀷锛�1闂ㄨ瘖  2鍑洪櫌锛�")
-    @ApiModelProperty(value = "灏辫瘖绫诲瀷锛�1闂ㄨ瘖  2鍑洪櫌 3.涓撶梾 4.澶栭儴瀵煎叆锛�")
+    @ApiModelProperty(value = "灏辫瘖绫诲瀷锛�1闂ㄨ瘖  2鍑洪櫌 3.涓撶梾 4.澶栭儴瀵煎叆 5鎬ヨ瘖銆�5浣忛櫌銆�7浣撴锛�")
     private String hospType;
 
 
diff --git a/smartor/src/main/java/com/smartor/domain/ServiceSubtaskVO.java b/smartor/src/main/java/com/smartor/domain/ServiceSubtaskVO.java
index 4d095a9..7085ac1 100644
--- a/smartor/src/main/java/com/smartor/domain/ServiceSubtaskVO.java
+++ b/smartor/src/main/java/com/smartor/domain/ServiceSubtaskVO.java
@@ -28,6 +28,13 @@
     @ApiModelProperty(value = "涓婚敭id")
     private Long subId;
 
+
+    /**
+     * 绗笁鏂逛换鍔D
+     */
+    @ApiModelProperty(value = "绗笁鏂逛换鍔D")
+    private String taskGuid;
+
     /**
      * 鍙戦�佷汉
      */
diff --git a/smartor/src/main/java/com/smartor/domain/ServiceTaskInfo.java b/smartor/src/main/java/com/smartor/domain/ServiceTaskInfo.java
index 96d0c7f..6edf903 100644
--- a/smartor/src/main/java/com/smartor/domain/ServiceTaskInfo.java
+++ b/smartor/src/main/java/com/smartor/domain/ServiceTaskInfo.java
@@ -33,7 +33,7 @@
     private long taskstate;
 
     @ApiModelProperty(value = "浠诲姟ID")
-    private long taskguid;
+    private String taskguid;
 
     @ApiModelProperty(value = "浠诲姟鍚嶇О")
     private String taskname;
diff --git a/smartor/src/main/java/com/smartor/mapper/ServiceSubtaskMapper.java b/smartor/src/main/java/com/smartor/mapper/ServiceSubtaskMapper.java
index 6bc5372..19d77f1 100644
--- a/smartor/src/main/java/com/smartor/mapper/ServiceSubtaskMapper.java
+++ b/smartor/src/main/java/com/smartor/mapper/ServiceSubtaskMapper.java
@@ -51,6 +51,8 @@
     public Boolean updateServiceSubtaskByPatId(ServiceSubtask ServiceSubtask);
 
     public Boolean updateServiceSubtaskByCondition(ServiceSubtask ServiceSubtask);
+    
+    public Boolean updateServiceSubtaskByTaskGuid(ServiceSubtask ServiceSubtask);
 
     /**
      * 鍒犻櫎鍗曚竴浠诲姟锛堥殢璁匡級
diff --git a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java
index 75515fe..5c13879 100644
--- a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java
@@ -276,7 +276,7 @@
             if (serviceSubTaskCacheReq.getType() != null && serviceSubTaskCacheReq.getType() == 2) {
                 //闂嵎
                 redisCache.deleteObject(pid + "-" + tid + "-WJscriptCache");
-                redisCache.setCacheList(pid + "-" + tid + "-WJscriptCache", serviceSubTaskCacheReq.getSvyLibTemplateScriptVOS());
+                redisCache.setCacheListRight(pid + "-" + tid + "-WJscriptCache", serviceSubTaskCacheReq.getSvyLibTemplateScriptVOS());
                 //璁剧疆杩囨湡鏃堕棿 3澶�
                 Long tims = Long.valueOf(3 * 24 * 3600);
                 boolean expire = redisCache.expire(pid + "-" + tid + "-WJscriptCache", tims);
@@ -284,7 +284,7 @@
             } else if (serviceSubTaskCacheReq.getType() != null && serviceSubTaskCacheReq.getType() == 1) {
                 //闂嵎
                 redisCache.deleteObject(pid + "-" + tid + "-SFscriptCache");
-                redisCache.setCacheList(pid + "-" + tid + "-SFscriptCache", serviceSubTaskCacheReq.getIvrLibaTemplateScriptVOList());
+                redisCache.setCacheListRight(pid + "-" + tid + "-SFscriptCache", serviceSubTaskCacheReq.getIvrLibaTemplateScriptVOList());
                 //璁剧疆杩囨湡鏃堕棿 3澶�
                 Long tims = Long.valueOf(3 * 24 * 3600);
                 redisCache.expire(pid + "-" + tid + "-SFscriptCache", tims);
diff --git a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
index 56f5de4..32b93ec 100644
--- a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -124,6 +124,8 @@
 
     @Value("${phoneUpEveryHour}")
     private Integer phoneUpEveryHour;
+    @Value("${phoneEndHour}")
+    private Integer phoneEndHour;
 
     /**
      * 鏌ヨ鍗曚竴浠诲姟锛堥殢璁匡級
@@ -819,6 +821,9 @@
      */
     @Override
     public PhoneCallBackYQVO phoneCallBackYQ(PhoneCallReqYQVO phoneCallReqYQVO) {
+        //鍏堟妸璇ubId浠巆ache_exist涓墧闄わ紝鍙鏈夊洖璋冨氨鍓旈櫎锛堢洰鐨勬槸锛屽敖蹇cache-exist涓虹┖锛屽幓缂撳瓨涓嬩竴鎵硅鎵撶殑鐢佃瘽;杩欓噷鍓旈櫎涓嶅奖鍝嶇數璇濈殑姝e父涓氬姟锛�
+        redisCache.removeElementFromList("cache-exist", phoneCallReqYQVO.getTaskid());
+
         //鍒ゆ柇鏄惁鎸傛満
         String hangupState = redisCache.getCacheObject(phoneCallReqYQVO.getUuid() + "- hangup");
         Object cacheObject1 = redisCache.getCacheObject(phoneCallReqYQVO.getTaskid() + "recordAccept-hungup");
@@ -833,6 +838,12 @@
                 if (ObjectUtils.isNotEmpty(cacheObject) && String.valueOf(cacheObject).equals("1")) {
                     return new PhoneCallBackYQVO();
                 }
+                //濡傛灉鍙戦�佺姸鎬佷负6锛屽氨璇存槑宸茬粡鎵撳畬浜嗭紝涔熸病鏈夊繀瑕佺户缁線涓嬭蛋浜�
+                if (StringUtils.isNotEmpty(phoneCallReqYQVO.getTaskid())) {
+                    ServiceSubtask serviceSubtask = serviceSubtaskMapper.selectServiceSubtaskById(Long.valueOf(phoneCallReqYQVO.getTaskid()));
+                    if (serviceSubtask.getSendstate() == 6L) return new PhoneCallBackYQVO();
+                }
+
                 ServiceSubtask serviceSubtask2 = new ServiceSubtask();
                 serviceSubtask2.setRemark("鐢佃瘽鍙戦�佹垚鍔燂紙鎮h�呮寕鏂級");
                 serviceSubtask2.setSenduuid(phoneCallReqYQVO.getUuid());
@@ -1429,9 +1440,13 @@
     @Override
     public List<PullTaskVO> taskPull() {
         //pullTaskVOList鐢ㄤ簬鏁版嵁杩斿洖
-        List<PullTaskVO> pullTaskVOList = null;
+        List<PullTaskVO> pullTaskVOList = new ArrayList<>();
         List<String> cacheList = new ArrayList<>();
         ListOperations<String, String> listOps = redisTemplate.opsForList();
+        //蹇呴』绛塧che-exist鍏ㄩ儴鎵撳畬鎵嶈兘鎷夊彇涓嬩竴鎵癸紙涓昏鏄�曟墍鏈夌殑鏁版嵁閮藉爢鍦ㄧ數璇濈殑缂撳瓨閲岋紝鍦ㄨ瀹氱殑鏃堕棿鎵撲笉瀹岋級
+        long existSize = listOps.size("cache-exist");
+        if (existSize > 0) return pullTaskVOList;
+
         long size = listOps.size("cache-0");
         log.error("---------鎵撶數璇濅箣鍓嶇紦瀛樹腑鐨勬暟鎹噺锛歿}", size);
         int count = 0;
@@ -1439,7 +1454,9 @@
             //phoneCount()  閫氳繃缁欏嚭鐨勬瘡涓皬鏃堕渶瑕佹墦鍑虹殑鐢佃瘽閲忥紝绠楀嚭鍒版櫄涓�8鐐逛竴鐐硅兘鎵撳嚭澶氬皯涓數璇濓紝鑾峰彇鍒版�婚噺
             //濡傛灉闇�瑕佺珛鍗虫墽琛岀殑鏁版嵁閲忓ぇ浜庝竴澶╄鎵ц鐨勪笂闄愶紝鍒欏彧鍙栦笂闄愮殑鏁伴噺锛屽叾瀹冪殑鍒欐斁鍥瀝edis涓�
             count = Math.min(phoneCount(), (int) size);
-            cacheList = listOps.range("cache-0", 0, count - 1);
+            if (count != 0) {
+                cacheList = listOps.range("cache-0", 0, count - 1);
+            }
         }
 
         log.error("浠诲姟鎷夊彇cache-0鐨勫�兼槸澶氬皯锛歿}", cacheList);
@@ -1465,12 +1482,16 @@
                 listOps.trim("cache-0" + i, count1, -1);
             }
         }
+        //existList鐢ㄦ潵璁板綍鎺ヤ笅鏉ラ渶瑕佹墽琛岀殑瀛愪换鍔D
+        List<String> existList = new ArrayList<>();
         if (CollectionUtils.isNotEmpty(pullTaskVOList)) {
             //缁欏洖璋冨弬鏁拌祴鍊�
             for (PullTaskVO pullTaskVO : pullTaskVOList) {
+                existList.add(pullTaskVO.getTaskid());
                 pullTaskVO.setAsrcallback(ASRCallBackPath);
             }
         }
+        if (existList.size() != 0) redisCache.setCacheListRight("cache-exist", existList);
         log.error("-----------瀹為檯鎷夊彇鐨勭數璇濇暟鎹噺锛歿}", pullTaskVOList.size());
         return pullTaskVOList;
     }
@@ -1490,6 +1511,10 @@
                 PullTaskVO pullTaskVO = new PullTaskVO();
                 String subId = subIds.get(i).trim();
                 ServiceSubtask serviceSubtask = serviceSubtaskMapper.selectServiceSubtaskById(Long.valueOf(subId));
+                if (ObjectUtils.isEmpty(serviceSubtask)) {
+                    log.error("璇ubId鏈夐棶棰橈紝鍦ㄨ〃涓煡璇笉鍒帮細{}", subId);
+                    continue;
+                }
                 ServiceTask serviceTask = serviceTaskService.selectServiceTaskByTaskid(serviceSubtask.getTaskid());
                 IvrTaskTemplate ivrTaskTemplate = ivrTaskTemplateService.selectIvrTaskTemplateByID(serviceSubtask.getTemplateid());
                 if (ObjectUtils.isEmpty(ivrTaskTemplate)) continue;
@@ -1524,7 +1549,7 @@
                 redisCache.setCacheObject(subId.trim() + "-" + serviceSubtask.getPhone().trim(), ivrTaskTemplateScript.getId().toString(), 120, TimeUnit.MINUTES);
             } else {
                 newValue0.add(subIds.get(i));
-                redisCache.setCacheList(cacheName, newValue0);
+                redisCache.setCacheListRight(cacheName, newValue0);
             }
         }
 
@@ -1853,6 +1878,7 @@
             ServiceSubtask serviceSubtask = new ServiceSubtask();
             serviceSubtask.setRemark("鐢佃瘽鎺ラ�氭垚鍔燂紝鎮h�呮嫆缁濋殢璁�");
             serviceSubtask.setId(Long.valueOf(phoneCallRecordVO.getTaskid()));
+            serviceSubtask.setSendstate(6L);
             serviceSubtaskMapper.updateServiceSubtask(serviceSubtask);
             int startIndex = phoneCallRecordVO.getRecord_path().indexOf("voice") + "voice".length() + 1;  // 鍔�1鏄烦杩�/绗﹀彿
             int endIndex = phoneCallRecordVO.getRecord_path().lastIndexOf("/");
@@ -2051,7 +2077,9 @@
         redisCache.setCacheObject(subTaskId + "recordAccept-hungup", "1", 10, TimeUnit.MINUTES);
         if (StringUtils.isNotEmpty(serviceSubtask.getRemark())) serviceSubtask.setRemark("鐢佃瘽鍙戦�佹嫆鎺�,鐭俊琛ュ伩鍙戦�佹垚鍔�");
         else serviceSubtask.setRemark("鐭俊琛ュ伩鍙戦�佹垚鍔�");
+        serviceSubtask.setSendstate(3L);
         serviceSubtaskMapper.updateServiceSubtask(serviceSubtask);
+
     }
 
     //閫氳繃褰撳墠鏃堕棿锛屾媺鍙栫數璇濇�绘暟
@@ -2059,13 +2087,17 @@
         // 褰撳墠鏃堕棿
         LocalTime currentTime = LocalTime.now();
         // 鐩爣鏃堕棿锛堟櫄涓� 8 鐐癸級
-        LocalTime targetTime = LocalTime.of(20, 0);
+        LocalTime targetTime = LocalTime.of(phoneEndHour, 0);
         // 璁$畻褰撳墠鏃堕棿鍒扮洰鏍囨椂闂寸殑鏃堕暱
         Duration duration = Duration.between(currentTime, targetTime);
         // 鑾峰彇鍓╀綑鏃堕棿鐨勫皬鏃舵暟
-        long remainingHours = duration.toHours();
+        long remainingHours = 0;
+        long remainingMinutes = duration.toMinutes();
         //濡傛灉瓒呰繃8鐐�,灏辫缃负0
-        if (remainingHours < 0) remainingHours = 0;
+        //璺濈缁撴潫鏃堕棿灏忎簬20鍒嗛挓锛屽氨涓嶆媺鍙栦簡
+        if (remainingMinutes < 20) remainingHours = 0;
+        else if (remainingMinutes < 60 && remainingMinutes > 20) remainingHours = 1;
+        else if (remainingMinutes > 60) remainingHours = remainingMinutes / 60;
         // 璁$畻鍓╀綑鍙互鎵撶殑鐢佃瘽鏁�
         int remainingCalls = (int) (remainingHours * phoneUpEveryHour);
         return remainingCalls;
diff --git a/smartor/src/main/java/com/smartor/service/impl/SvyTaskSingleServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/SvyTaskSingleServiceImpl.java
index 4fba862..305e581 100644
--- a/smartor/src/main/java/com/smartor/service/impl/SvyTaskSingleServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/SvyTaskSingleServiceImpl.java
@@ -6,6 +6,9 @@
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.gson.Gson;
+import com.ruoyi.common.enums.HospTypeEnum;
+import com.ruoyi.common.enums.ServiceTaskTypeEnum;
+import com.ruoyi.common.enums.TaskTypeEnum;
 import com.ruoyi.common.exception.base.BaseException;
 import com.ruoyi.common.utils.*;
 import com.ruoyi.common.utils.http.HttpEntity;
@@ -16,6 +19,7 @@
 import com.smartor.mapper.ServiceSubtaskMapper;
 import com.smartor.service.IServiceTaskService;
 import com.smartor.service.ISvyTaskSingleService;
+import com.sun.org.apache.bcel.internal.generic.NEW;
 import lombok.extern.slf4j.Slf4j;
 import okhttp3.OkHttpClient;
 import okhttp3.Request;
@@ -201,69 +205,27 @@
         else if (isoperation == 3) serviceSubtaskMapper.deleteServiceSubtaskByCondition(taskId, patid);
     }
 
-
     @Override
     public int insertTaskInfo(ServiceTaskInfo serviceTaskVO) {
         if (ObjectUtils.isEmpty(serviceTaskVO)) {
             log.info("鏂板浠诲姟鍏ュ弬涓虹┖锛岃妫�鏌ュ叆鍙�");
             throw new BaseException("鏂板浠诲姟鍏ュ弬涓虹┖锛岃妫�鏌ュ叆鍙�");
         }
-        Integer integer = 1;
-        //ServiceSubtask serviceTask = DtoConversionUtils.sourceToTarget(serviceTaskVO, ServiceSubtask.class);
-        //serviceTask.setTextParam(JSON.toJSONString(serviceTaskVO.getTextParam()));
         //灏嗕换鍔′俊鎭斁鍒版湇鍔¤〃涓�
-        ServiceSubtask serviceSubtask = DtoConversionUtils.sourceToTarget(serviceTaskVO, ServiceSubtask.class);
-        serviceSubtask.setTaskid(serviceTaskVO.getTaskguid());
+        ServiceSubtask serviceSubtask = new ServiceSubtask();
+        serviceSubtask.setTaskGuid(serviceTaskVO.getTaskguid());
         String type = "0";
-        if (serviceTaskVO.getServicetype().equals("鐩戞祴璇勪及")) {
-            type = "1";
-        } else if (serviceTaskVO.getServicetype().equals("鍑洪櫌闅忚")) {
-            type = "2";
-        } else if (serviceTaskVO.getServicetype().equals("闂ㄨ瘖闅忚")) {
-            type = "3";
-        } else if (serviceTaskVO.getServicetype().equals("瀹f暀鍏虫��")) {
-            type = "4";
-        } else if (serviceTaskVO.getServicetype().equals("澶嶈瘖閫氱煡")) {
-            type = "5";
-        } else if (serviceTaskVO.getServicetype().equals("婊℃剰搴﹁皟鏌�")) {
-            type = "6";
-        } else if (serviceTaskVO.getServicetype().equals("鎮h�呮姤鍛�")) {
-            type = "7";
-        } else if (serviceTaskVO.getServicetype().equals("鍏朵粬閫氱煡")) {
-            type = "8";
-        }
-        if (type.equals("0")) {
-            type = serviceTaskVO.getServicetype();
-        }
+        if (StringUtils.isNotEmpty(serviceTaskVO.getServicetype()))
+            type = ServiceTaskTypeEnum.getDescByCode(serviceTaskVO.getServicetype());
         serviceSubtask.setServiceType(type);
-        //0銆�1瀹f暀銆�2闂ㄨ瘖銆�3鍑洪櫌銆�4澶嶈瘖銆�5浣撴銆�6闂嵎銆�7鍖绘妧
         String tasktype = "-1";
-        if (serviceTaskVO.getTasktype().equals("閫氱煡")) {
-            tasktype = "0";
-        } else if (serviceTaskVO.getTasktype().equals("瀹f暀")) {
-            tasktype = "1";
-        } else if (serviceTaskVO.getTasktype().equals("闂ㄨ瘖")) {
-            tasktype = "2";
-        } else if (serviceTaskVO.getTasktype().equals("鍑洪櫌")) {
-            tasktype = "3";
-        } else if (serviceTaskVO.getTasktype().equals("澶嶈瘖")) {
-            tasktype = "4";
-        } else if (serviceTaskVO.getTasktype().equals("浣撴")) {
-            tasktype = "5";
-        } else if (serviceTaskVO.getTasktype().equals("闂嵎")) {
-            tasktype = "6";
-        } else if (serviceTaskVO.getTasktype().equals("鍖绘妧")) {
-            tasktype = "7";
-        }
-        if (tasktype.equals("-1")) {
-            tasktype = serviceTaskVO.getTasktype();
-        }
+        if (StringUtils.isNotEmpty(serviceTaskVO.getTasktype()))
+            tasktype = TaskTypeEnum.getDescByCode(serviceTaskVO.getTasktype());
         serviceSubtask.setType(tasktype);
         serviceSubtask.setLabelstatus(serviceTaskVO.getTaskstate());
         serviceSubtask.setTaskName(serviceTaskVO.getTaskname());
         serviceSubtask.setTaskDesc(serviceTaskVO.getTaskdesc());
         serviceSubtask.setPreachform(serviceTaskVO.getExemode());
-        //serviceSubtask.setUploadTime(serviceTaskVO.setUploadTime());
         serviceSubtask.setCreateBy(serviceTaskVO.getCreateBy());
         serviceSubtask.setCreateTime(serviceTaskVO.getCreateTime());
         serviceSubtask.setOperatorNo(serviceTaskVO.getOperatorno());
@@ -286,31 +248,25 @@
         serviceSubtask.setWechat(serviceTaskVO.getPatopenid());
         serviceSubtask.setInhospno(serviceTaskVO.getInhosno());
         String hosptype = "-1";
-        if (serviceTaskVO.getVisittype().equals("闂ㄨ瘖")) {
-            hosptype = "1";
-        } else if (serviceTaskVO.getVisittype().equals("鍑洪櫌")) {
-            hosptype = "2";
-        } else if (serviceTaskVO.getVisittype().equals("涓撶梾")) {
-            hosptype = "3";
-        } else if (serviceTaskVO.getVisittype().equals("澶栭儴瀵煎叆")) {
-            hosptype = "4";
-        }
-        if (hosptype.equals("-1")) {
-            hosptype = serviceTaskVO.getVisittype();
-        }
+        hosptype = HospTypeEnum.getDescByCode(serviceTaskVO.getVisittype());
         serviceSubtask.setHospType(hosptype);
         serviceSubtask.setHospno(serviceTaskVO.getVisitno());
         serviceSubtask.setAdmindate(serviceTaskVO.getVisittime());
         serviceSubtask.setRoomno(serviceTaskVO.getRoomno());
         serviceSubtask.setBedNo(serviceTaskVO.getBedno());
         serviceSubtask.setDeptname(serviceTaskVO.getDeptname());
-        //serviceSubtask.setSendname(serviceTaskVO.gets());
-        //serviceSubtask.setPatid(serviceTaskVO.getPid());
         serviceSubtask.setSendstate(1L);
-        //serviceSubtask.setHospType(serviceTask.getHospType());
         serviceSubtask.setCreateTime(new Date());
-        serviceSubtaskMapper.insertServiceSubtask(serviceSubtask);
-        integer = serviceSubtask.getId().intValue();
+        //鍏堟煡璇竴閬嶏紝璇askGuid鏄惁瀛樺湪
+        ServiceSubtaskVO serviceSubtaskVO = new ServiceSubtaskVO();
+        serviceSubtaskVO.setTaskGuid(serviceTaskVO.getGuid());
+        List<ServiceSubtask> serviceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtaskVO);
+        if (CollectionUtils.isNotEmpty(serviceSubtaskList)) {
+            serviceSubtaskMapper.updateServiceSubtaskByTaskGuid(serviceSubtask);
+        } else {
+            serviceSubtaskMapper.insertServiceSubtask(serviceSubtask);
+        }
+        Integer integer = serviceSubtask.getId().intValue();
         log.error("鎻掑叆鐨処D鏄細{}", integer);
         return integer;
     }
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
index f636f09..4d04ed1 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -38,6 +38,7 @@
         <result property="orgid" column="orgid"/>
         <result property="pid" column="pid"/>
         <result property="guid" column="guid"/>
+        <result property="taskGuid" column="task_guid"/>
         <result property="textParam" column="text_param"/>
         <result property="preachform" column="preachform"/>
         <result property="bedNo" column="bed_no"/>
@@ -85,6 +86,7 @@
     <sql id="selectServiceSubtaskVo">
         select id,
                hosp_type,
+               task_guid,
                patfrom,
                inhospid,
                suggest,
@@ -248,13 +250,14 @@
             <if test="remark != null">and remark = #{remark}</if>
             <if test="suggest != null">and suggest = #{suggest}</if>
             <if test="createBy != null">and create_by = #{createBy}</if>
+            <if test="taskGuid != null">and task_guid = #{taskGuid}</if>
         </where>
         <if test="serviceType != null  and serviceType != ''and serviceType != '2'and serviceType != '3'">order by
             long_send_time desc
         </if>
         <if test="serviceType != null  and serviceType != ''and serviceType == '2'">order by endtime desc</if>
         <if test="serviceType != null  and serviceType != ''and serviceType == '3'">order by admindate desc</if>
-        -- order by update_time desc,id desc
+        <!-- order by update_time desc,id desc -->
     </select>
 
     <select id="selectServiceSubtaskById" parameterType="Long" resultMap="ServiceSubtaskResult">
@@ -336,6 +339,7 @@
             <if test="sendstate != null ">sendstate,</if>
             <if test="inhospid != null ">inhospid,</if>
             <if test="patfrom != null ">patfrom,</if>
+            <if test="taskGuid != null ">task_guid,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="sendname != null">#{sendname},</if>
@@ -408,6 +412,7 @@
             <if test="sendstate != null ">#{sendstate},</if>
             <if test="inhospid != null ">#{inhospid},</if>
             <if test="patfrom != null ">#{patfrom},</if>
+            <if test="taskGuid != null ">#{taskGuid},</if>
         </trim>
     </insert>
 
@@ -484,6 +489,7 @@
             <if test="suggest != null ">suggest=#{suggest},</if>
             <if test="inhospid != null ">inhospid=#{inhospid},</if>
             <if test="patfrom != null ">patfrom=#{patfrom},</if>
+            <if test="taskGuid != null ">task_guid=#{taskGuid},</if>
         </trim>
         where id = #{id}
     </update>
@@ -561,6 +567,7 @@
             <if test="suggest != null ">suggest=#{suggest},</if>
             <if test="inhospid != null ">inhospid=#{inhospid},</if>
             <if test="patfrom != null ">patfrom=#{patfrom},</if>
+            <if test="taskGuid != null ">taskGuid=#{taskGuid},</if>
         </trim>
         where patid = #{patid} and taskid = #{taskid}
     </update>
@@ -638,9 +645,90 @@
             <if test="suggest != null ">suggest=#{suggest},</if>
             <if test="inhospid != null ">inhospid=#{inhospid},</if>
             <if test="patfrom != null ">patfrom=#{patfrom},</if>
+            <if test="taskGuid != null ">task_guid=#{taskGuid},</if>
         </trim>
         where patid = #{patid} and taskid = #{taskid}
     </update>
+
+    <update id="updateServiceSubtaskByTaskGuid" parameterType="com.smartor.domain.ServiceSubtask">
+        update service_subtask
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="sendname != null">sendname = #{sendname},</if>
+            <if test="phone != null">phone = #{phone},</if>
+            <if test="sex != null">sex = #{sex},</if>
+            <if test="sendstate != null ">sendstate = #{sendstate},</if>
+            <if test="age != null">age = #{age},</if>
+            <if test="sfzh != null">sfzh = #{sfzh},</if>
+            <if test="addr != null">addr = #{addr},</if>
+            <if test="senderdetail != null">senderdetail = #{senderdetail},</if>
+            <if test="type != null">type = #{type},</if>
+            <if test="taskid != null">taskid = #{taskid},</if>
+            <if test="templateid != null">templateid = #{templateid},</if>
+            <if test="templatename != null">templatename = #{templatename},</if>
+            <if test="senddate != null">senddate = #{senddate},</if>
+            <if test="senduuid != null">senduuid = #{senduuid},</if>
+            <if test="result != null">result = #{result},</if>
+            <if test="finishtime != null">finishtime = #{finishtime},</if>
+            <if test="recordid != null">recordid = #{recordid},</if>
+            <if test="exrecallcount != null">exrecallcount = #{exrecallcount},</if>
+            <if test="pulltime != null">pulltime = #{pulltime},</if>
+            <if test="deptcode != null">deptcode = #{deptcode},</if>
+            <if test="labelstatus != null">labelstatus = #{labelstatus},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="isupload != null">isupload = #{isupload},</if>
+            <if test="uploadTime != null">upload_time = #{uploadTime},</if>
+            <if test="orgid != null">orgid = #{orgid},</if>
+            <if test="pid != null">pid = #{pid},</if>
+            <if test="guid != null">guid = #{guid},</if>
+            <if test="textParam != null">text_param = #{textParam},</if>
+            <if test="preachform != null">preachform = #{preachform},</if>
+            <if test="bedNo != null">bed_no = #{bedNo},</if>
+            <if test="sendType != null  and sendType != ''">send_type = #{sendType},</if>
+            <if test="taskName != null  and taskName != ''">task_name = #{taskName},</if>
+            <if test="taskDesc != null  and taskDesc != ''">task_desc = #{taskDesc},</if>
+            <if test="operatorNo != null  and operatorNo != ''">operator_no = #{operatorNo},</if>
+            <if test="operator != null  and operator != ''">operator = #{operator},</if>
+            <if test="hospType != null  and hospType != ''">hosp_type = #{hospType},</if>
+            <if test="hospno != null  and hospno != ''">hospno = #{hospno},</if>
+            <if test="wechat != null  and wechat != ''">wechat = #{wechat},</if>
+            <if test="roomno != null  and roomno != ''">roomno = #{roomno},</if>
+            <if test="admindate != null  and admindate != ''">admindate = #{admindate},</if>
+            <if test="deptname != null  and deptname != ''">deptname = #{deptname},</if>
+            <if test="diagname != null  and diagname != ''">diagname = #{diagname},</if>
+            <if test="libtemplateid != null ">libtemplateid = #{libtemplateid},</if>
+            <if test="libtemplatename != null ">libtemplatename = #{libtemplatename},</if>
+            <if test="patid != null ">patid = #{patid},</if>
+            <if test="openid != null ">openid = #{openid},</if>
+            <if test="longSendTime != null ">long_send_time = #{longSendTime},</if>
+            <if test="serviceType != null ">service_type = #{serviceType},</if>
+            <if test="score != null ">score = #{score},</if>
+            <if test="submit != null ">submit = #{submit},</if>
+            <if test="leavehospitaldistrictcode != null  and leavehospitaldistrictcode != ''">leavehospitaldistrictcode
+                = #{leavehospitaldistrictcode},
+            </if>
+            <if test="leavehospitaldistrictname != null  and leavehospitaldistrictname != ''">leavehospitaldistrictname
+                = #{leavehospitaldistrictname},
+            </if>
+            <if test="drname != null ">drname = #{drname},</if>
+            <if test="drcode != null ">drcode = #{drcode},</if>
+            <if test="endtime != null ">endtime = #{endtime},</if>
+            <if test="starttime != null ">starttime = #{starttime},</if>
+            <if test="excep != null ">excep = #{excep},</if>
+            <if test="nurseName != null ">nurse_name=#{nurseName},</if>
+            <if test="nurseId != null ">nurse_id=#{nurseId},</if>
+            <if test="remark != null ">remark=#{remark},</if>
+            <if test="suggest != null ">suggest=#{suggest},</if>
+            <if test="inhospid != null ">inhospid=#{inhospid},</if>
+            <if test="patfrom != null ">patfrom=#{patfrom},</if>
+            <if test="taskGuid != null ">task_guid=#{taskGuid},</if>
+        </trim>
+        where task_guid = #{taskGuid}
+    </update>
+
+
 
     <update id="deleteServiceSubtaskById" parameterType="Long">
         update service_subtask
@@ -749,6 +837,7 @@
                remark,
                inhospid,
                patfrom,
+               task_guid,
                diagname
         FROM service_subtask,
              JSON_TABLE(send_time_slot, '$[*]' COLUMNS (

--
Gitblit v1.9.3