From 5389773b2d1ae86daec68b00f67c3682dc907e01 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期五, 22 十一月 2024 14:35:48 +0800
Subject: [PATCH] 代码提交(长期任务电话完成)

---
 smartor/src/main/java/com/smartor/domain/PatArchiveImport.java                                 |   27 
 smartor/src/main/java/com/smartor/domain/ServiceTaskVO.java                                    |    1 
 smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskDetailServiceImpl.java            |  116 +++
 smartor/src/main/java/com/smartor/mapper/PatArchiveImportMapper.java                           |   30 
 smartor/pom.xml                                                                                |    5 
 smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java                 |   21 
 ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java                    |   15 
 smartor/src/main/java/com/smartor/domain/PatArchiveVO.java                                     |   43 +
 ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUserRole.java                |    6 
 ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java                          |    5 
 smartor/src/main/resources/mapper/smartor/IvrTaskTemplateMapper.xml                            |   24 
 smartor/src/main/java/com/smartor/common/SendService.java                                      |    7 
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedInhospController.java         |   20 
 ruoyi-admin/src/main/resources/application.yml                                                 |    2 
 smartor/src/main/resources/mapper/smartor/IvrLibaTemplateTargetoptionMapper.xml                |   11 
 smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml                                 |   67 ++
 ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java                         |   58 
 ruoyi-admin/src/main/java/com/ruoyi/web/test/MQTest.java                                       |   13 
 smartor/src/main/java/com/smartor/service/impl/PatArchiveImportServiceImpl.java                |   49 +
 smartor/src/main/resources/mapper/smartor/IvrLibaScriptTargetoptionMapper.xml                  |    9 
 smartor/src/main/java/com/smartor/mapper/IvrLibaTemplateTargetoptionMapper.java                |    2 
 smartor/src/main/resources/mapper/smartor/PatArchiveImportMapper.xml                           |   65 ++
 ruoyi-admin/src/main/resources/application-druid-linshi.yml                                    |  170 +++++
 ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml                                |   21 
 smartor/src/main/java/com/smartor/domain/IvrTaskTemplateVO.java                                |    6 
 smartor/src/main/java/com/smartor/service/IPatArchiveImportService.java                        |    3 
 smartor/src/main/java/com/smartor/service/impl/IvrLibaScriptServiceImpl.java                   |   10 
 smartor/src/main/java/com/smartor/domain/PatArchive.java                                       |   32 +
 smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java                    |  295 ++++++++
 smartor/src/main/java/com/smartor/mapper/IvrLibaScriptTargetoptionMapper.java                  |    1 
 smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java                  |  141 ++++
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatArchiveImportController.java     |   26 
 smartor/src/main/java/com/smartor/domain/PatTaskRelevance.java                                 |    6 
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskDetailController.java |   57 +
 smartor/src/main/java/com/smartor/service/IServiceSubtaskDetailService.java                    |    3 
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatArchiveOutController.java        |    3 
 smartor/src/main/java/com/smartor/domain/IvrTaskTemplate.java                                  |    7 
 ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java                      |    2 
 smartor/src/main/java/com/smartor/service/IServiceSubtaskService.java                          |    4 
 smartor/src/main/java/com/smartor/service/IPatMedInhospService.java                            |    9 
 ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java                                   |   99 +-
 ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java                       |   44 
 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java               |    6 
 smartor/src/main/java/com/smartor/service/impl/IvrLibaTemplateServiceImpl.java                 |   20 
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java       |    5 
 smartor/src/main/java/com/smartor/common/FtpService.java                                       |  119 +++
 smartor/src/main/java/com/smartor/domain/PatMedInhosp.java                                     |    7 
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java               |    6 
 ruoyi-admin/src/main/resources/application-druid.yml                                           |   36 
 ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml                         |   33 
 smartor/src/main/java/com/smartor/domain/PhoneCallBackYQVO.java                                |    2 
 smartor/src/main/java/com/smartor/service/impl/TemplateDeptServiceImpl.java                    |    2 
 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java               |   59 -
 53 files changed, 1,512 insertions(+), 318 deletions(-)

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 56581fc..816d44c 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
@@ -205,6 +205,7 @@
                                 String value = redisCache.getCacheObject("cache-0");
                                 ServiceSubtaskVO serviceSubtask1 = new ServiceSubtaskVO();
                                 serviceSubtask1.setTaskid(commonTaskcallMQ.getTaskid());
+                                log.error("缂撳瓨涓璼erviceSubtask1鐨勫�间负锛歿}", serviceSubtask1);
                                 List<ServiceSubtask> selectServiceSubtaskList1 = ivrTaskcallMapper.selectServiceSubtaskList(serviceSubtask1);
                                 for (ServiceSubtask serviceSubtask2 : selectServiceSubtaskList1) {
                                     if (StringUtils.isEmpty(value)) {
@@ -214,6 +215,7 @@
                                             value = value + "," + serviceSubtask2.getId().toString() + ",";
                                     }
                                 }
+                                log.error("缂撳瓨涓璫ache-0鐨勫�间负锛歿}", value);
                                 redisCache.setCacheObject("cache-0", value);
                             } else {
                                 //闈炵珛鍗冲彂閫�
@@ -250,7 +252,7 @@
                         serviceSubtask.setResult("success");
                         serviceSubtask.setRemark("鐢佃瘽鍙戦�佹垚鍔�");
                         serviceSubtask.setGuid(uuid);
-                        serviceSubtask.setSendstate(6L);
+                        serviceSubtask.setSendstate(3L);
                         serviceSubtask.setFinishtime(new Date());
                         serviceSubtaskMapper.updateServiceSubtask(serviceSubtask);
 
@@ -419,18 +421,18 @@
                     for (ServiceSubtask serviceSubtask : selectServiceSubtaskList) {
                         String patid = rsaPublicKeyExample.encryptedData(serviceSubtask.getPatid().toString(), pub_key);
                         try {
-                        SendMagParam sendMagParam = new SendMagParam();
-                        sendMagParam.setType("5");
-                        sendMagParam.setUrl(ip + ":" + req_path + "/outsideChain?param1=" + taskId + "&param2=" + patid + "&param3=" + ivrTask1.getTaskName() + "&param5=false");
-                        log.info("閾炬帴瀹屾暣璺緞锛歿}", ip + ":" + req_path + "/outsideChain?param1=" + taskId + "&param2=" + patid + "&param3=" + ivrTask1.getTaskName() + "&param5=false");
-                        //杩欎釜妯℃澘ID鍏堝啓姝伙紝鍚庨潰鍋氭垚鍙��
-                        sendMagParam.setTmpCode("oG3pJHPVWpE81DmZsua_2tKwgJ97r0qz37z56ns7NB4");
-                        Map map = new HashMap();
-                        map.put("first", ivrTask1.getTaskName());
-                        sendMagParam.setContent(JSON.toJSONString(map));
-                        sendMagParam.setOpenid(serviceSubtask.getOpenid());
-                        Boolean aBoolean = sendService.sendMsg(sendMagParam);
-                        String url = null;
+                            SendMagParam sendMagParam = new SendMagParam();
+                            sendMagParam.setType("5");
+                            sendMagParam.setUrl(ip + ":" + req_path + "/outsideChain?param1=" + taskId + "&param2=" + patid + "&param3=" + ivrTask1.getTaskName() + "&param5=false");
+                            log.info("閾炬帴瀹屾暣璺緞锛歿}", ip + ":" + req_path + "/outsideChain?param1=" + taskId + "&param2=" + patid + "&param3=" + ivrTask1.getTaskName() + "&param5=false");
+                            //杩欎釜妯℃澘ID鍏堝啓姝伙紝鍚庨潰鍋氭垚鍙��
+                            sendMagParam.setTmpCode("oG3pJHPVWpE81DmZsua_2tKwgJ97r0qz37z56ns7NB4");
+                            Map map = new HashMap();
+                            map.put("first", ivrTask1.getTaskName());
+                            sendMagParam.setContent(JSON.toJSONString(map));
+                            sendMagParam.setOpenid(serviceSubtask.getOpenid());
+                            Boolean aBoolean = sendService.sendMsg(sendMagParam);
+                            String url = null;
 
 ////                            if (type == 1) {
 ////                                url = ip + ":" + req_path + "/outsideChain?param1=" + taskId + "&param2=" + patid + "&param3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "&param5=false";
@@ -486,21 +488,21 @@
 //                            String wxCode = getWXCode(serviceSubtask.getSfzh(), url, serviceSubtask.getTaskName(), serviceSubtask.getTaskDesc(), "鏃�");
 //                            Map<String, Object> map = JSONObject.parseObject(wxCode, Map.class);
 //                            if (!map.isEmpty()) {
-                                serviceSubtask.setResult("success");
-                                serviceSubtask.setSendstate(3L);
-                                if (aBoolean == false) {
-                                    ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord();
-                                    serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString());
-                                    serviceSubtaskRecord.setSubtaskId(serviceSubtask.getId());
-                                    serviceSubtaskRecord.setUuid(UUID.randomUUID().toString());
-                                    serviceSubtaskRecord.setTasktype(serviceSubtask.getType());
-                                    serviceSubtaskRecord.setPreachform("5");
-                                    serviceSubtaskRecord.setStartTime(System.currentTimeMillis());
-                                    serviceSubtaskRecord.setRemark(map.get("msg").toString());
-                                    lssubIds.add(serviceSubtask.getId());
-                                    serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord);
-                                    continue;
-                                }
+                            serviceSubtask.setResult("success");
+                            serviceSubtask.setSendstate(3L);
+                            if (aBoolean == false) {
+                                ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord();
+                                serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString());
+                                serviceSubtaskRecord.setSubtaskId(serviceSubtask.getId());
+                                serviceSubtaskRecord.setUuid(UUID.randomUUID().toString());
+                                serviceSubtaskRecord.setTasktype(serviceSubtask.getType());
+                                serviceSubtaskRecord.setPreachform("5");
+                                serviceSubtaskRecord.setStartTime(System.currentTimeMillis());
+                                serviceSubtaskRecord.setRemark(map.get("msg").toString());
+                                lssubIds.add(serviceSubtask.getId());
+                                serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord);
+                                continue;
+                            }
 //                            }
                         } catch (Exception e) {
                             ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord();
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatArchiveImportController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatArchiveImportController.java
index c7c282c..9632c3b 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatArchiveImportController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatArchiveImportController.java
@@ -1,10 +1,14 @@
 package com.ruoyi.web.controller.smartor;
 
+import com.github.pagehelper.ISelect;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.core.domain.model.LoginUser;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.PageUtils;
 import com.ruoyi.common.utils.file.FileUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.smartor.domain.PatArchiveImport;
@@ -36,12 +40,20 @@
      * 鏌ヨExcel瀵煎叆鎮h�呮。妗堝垪琛�
      */
     @ApiOperation("鏌ヨExcel瀵煎叆鎮h�呮。妗堝垪琛�")
-    //@PreAuthorize("@ss.hasPermi('smartor:import:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(PatArchiveImport patArchiveImport) {
-        startPage();
+    @PostMapping("/list")
+    public TableDataInfo list(@RequestBody PatArchiveImport patArchiveImport) {
+        PageUtils.startPageByPost(patArchiveImport.getPageNum(), patArchiveImport.getPageSize());
         List<PatArchiveImport> list = patArchiveImportService.selectPatArchiveImportList(patArchiveImport);
-        return getDataTable(list);
+        //鑾峰彇total
+        long total = PageUtils.count(new ISelect() {
+            @Override
+            public void doSelect() {
+                patArchiveImport.setPageNum(null);
+                patArchiveImport.setPageSize(null);
+                patArchiveImportService.selectPatArchiveImportList(patArchiveImport);
+            }
+        });
+        return getDataTable2(total, list);
     }
 
     /**
@@ -115,6 +127,8 @@
     //@PreAuthorize("@ss.hasPermi('smartor:import:list')")
     @PostMapping("/importPatInfo")
     public TableDataInfo importPatInfo(MultipartFile file) {
-        return getDataTable(patArchiveImportService.importPatInfo(file));
+        LoginUser loginUser = getLoginUser();
+        SysUser user = loginUser.getUser();
+        return getDataTable(patArchiveImportService.importPatInfo(file, user));
     }
 }
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatArchiveOutController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatArchiveOutController.java
index bca2caf..e1d8e67 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatArchiveOutController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatArchiveOutController.java
@@ -1,17 +1,14 @@
 package com.ruoyi.web.controller.smartor;
 
-import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.page.TableDataInfo;
-import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.smartor.domain.PatArchiveOut;
 import com.smartor.service.IPatArchiveOutService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedInhospController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedInhospController.java
index 7b15428..e407fd3 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedInhospController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedInhospController.java
@@ -4,12 +4,9 @@
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
-import com.ruoyi.common.core.domain.entity.SysUser;
-import com.ruoyi.common.core.domain.model.LoginUser;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.utils.PageUtils;
-import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.smartor.domain.PatMedInhosp;
 import com.smartor.domain.PatMedInhospVO;
@@ -18,14 +15,11 @@
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
-import java.util.ArrayList;
 import java.util.List;
-import java.util.stream.Collectors;
 
 /**
  * 鎮h�呬綇闄㈣褰旵ontroller
@@ -110,7 +104,7 @@
      */
     @ApiOperation("鑾峰彇鎮h�呬綇闄㈣褰曡缁嗕俊鎭�")
     //@PreAuthorize("@ss.hasPermi('smartor:patinhosp:query')")
-    @GetMapping(value = "/{inhospid}")
+    @GetMapping(value = "/getInfo/{inhospid}")
     public AjaxResult getInfo(@PathVariable("inhospid") Long inhospid) {
         return success(patMedInhospService.selectPatMedInhospByInhospid(inhospid));
     }
@@ -159,4 +153,16 @@
         return getDataTable(patMedInhospService.getDeptRanking(patMedReq));
     }
 
+
+    /**
+     * 鍖绘姢涓庢偅鑰呭叧鑱斿叧绯�
+     *
+     * @return
+     */
+    @ApiOperation("鍖绘姢涓庢偅鑰呭叧鑱斿叧绯�")
+    @PostMapping("/getDocAndPat")
+    public TableDataInfo getDocAndPat(@RequestBody PatMedInhosp patMedInhosp) {
+        return getDataTable(patMedInhospService.getDocAndPat(patMedInhosp));
+    }
+
 }
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 14cda92..5b3aa1e 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
@@ -14,17 +14,13 @@
 import com.smartor.domain.*;
 import com.smartor.service.IServiceSubtaskRecordService;
 import com.smartor.service.IServiceSubtaskService;
-import com.sun.org.apache.bcel.internal.generic.NEW;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
-import java.time.LocalTime;
-import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -192,6 +188,7 @@
     public AjaxResult recordAccept(@RequestBody PhoneCallRecordVO phoneCallRecordVO) {
         log.error("閫氳瘽璁板綍鍥炶皟(闆ㄧ划):{}", phoneCallRecordVO);
 //        return toAjax(serviceSubtaskService.saveQuestionAnswerPhone(serviceSubTaskDetailReq));
+        serviceSubtaskService.recordAccept(phoneCallRecordVO);
         return success();
     }
 
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskDetailController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskDetailController.java
index e2f2dd1..f595faf 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskDetailController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskDetailController.java
@@ -3,18 +3,18 @@
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
-import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
-import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.utils.StringUtils;
 import com.smartor.domain.ServiceSubtaskDetail;
 import com.smartor.service.IServiceSubtaskDetailService;
+import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
-import javax.servlet.http.HttpServletResponse;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 璇煶浠诲姟缁撴灉鏄庣粏Controller
@@ -22,6 +22,7 @@
  * @author smartor
  * @date 2023-03-24
  */
+@Api(description = "璇煶浠诲姟缁撴灉鏄庣粏")
 @RestController
 @RequestMapping("/smartor/serviceSubtaskDetail")
 public class ServiceSubtaskDetailController extends BaseController {
@@ -29,28 +30,17 @@
     private IServiceSubtaskDetailService ServiceSubtaskDetailService;
 
     /**
-     * 鏌ヨ璇煶浠诲姟鍛煎彨鏄庣粏鍒楄〃
+     * 鏌ヨ鍗曚釜浜虹殑璇煶淇℃伅
      */
-    //@PreAuthorize("@ss.hasPermi('smartor:ServiceSubtaskDetail:list')")
-    @ApiOperation("鏌ヨ浠诲姟缁撴灉鏄庣粏鍒楄〃")
-    @PostMapping("/list")
-    public TableDataInfo list(@RequestBody ServiceSubtaskDetail serviceSubtaskDetail) {
-        startPage();
-        List<ServiceSubtaskDetail> list = ServiceSubtaskDetailService.selectServiceSubtaskDetailList(serviceSubtaskDetail);
-        return getDataTable(list);
-    }
-
-    /**
-     * 瀵煎嚭璇煶浠诲姟鍛煎彨鏄庣粏鍒楄〃
-     */
-    //@PreAuthorize("@ss.hasPermi('smartor:ServiceSubtaskDetail:export')")
-    @Log(title = "璇煶浠诲姟鍛煎彨鏄庣粏", businessType = BusinessType.EXPORT)
-    @ApiOperation("瀵煎嚭浠诲姟缁撴灉鏄庣粏鍒楄〃")
-    @PostMapping("/export")
-    public void export(HttpServletResponse response, ServiceSubtaskDetail serviceSubtaskDetail) {
-        List<ServiceSubtaskDetail> list = ServiceSubtaskDetailService.selectServiceSubtaskDetailList(serviceSubtaskDetail);
-        ExcelUtil<ServiceSubtaskDetail> util = new ExcelUtil<ServiceSubtaskDetail>(ServiceSubtaskDetail.class);
-        util.exportExcel(response, list, "璇煶浠诲姟鍛煎彨鏄庣粏鏁版嵁");
+    @ApiOperation("鏌ヨ鍗曚釜浜虹殑璇煶淇℃伅閫氳繃瀛愪换鍔D")
+    @PostMapping("/getPersonVoice")
+    public Map<String, Object> getPersonVoice(@RequestBody ServiceSubtaskDetail serviceSubtaskDetail) {
+        Map<String, Object> map = new HashMap<>();
+        if (serviceSubtaskDetail.getSubId() == null) {
+            map.put("code", 500);
+            map.put("msg", "鏌ヨ澶辫触,璇锋煡妫�鍏ュ弬");
+        } else map = ServiceSubtaskDetailService.selectServiceSubtaskDetailList(serviceSubtaskDetail);
+        return map;
     }
 
     /**
@@ -85,10 +75,25 @@
         return toAjax(ServiceSubtaskDetailService.updateServiceSubtaskDetail(serviceSubtaskDetail));
     }
 
+
+    /**
+     * 淇敼璇煶浠诲姟鍛煎彨鏄庣粏
+     */
+    //@PreAuthorize("@ss.hasPermi('smartor:ServiceSubtaskDetail:edit')")
+    @Log(title = "璇煶浠诲姟鍛煎彨鏄庣粏", businessType = BusinessType.UPDATE)
+    @ApiOperation("淇敼浠诲姟缁撴灉鏄庣粏")
+    @PostMapping("/batchEdit")
+    public AjaxResult edit(@RequestBody List<ServiceSubtaskDetail> serviceSubtaskDetails) {
+        for (ServiceSubtaskDetail serviceSubtaskDetail : serviceSubtaskDetails) {
+            ServiceSubtaskDetailService.updateServiceSubtaskDetail(serviceSubtaskDetail);
+        }
+        return toAjax(1);
+    }
+
     @ApiOperation("淇敼浠诲姟缁撴灉鏄庣粏閫氳繃鏉′欢")
     @PostMapping("/editByCondition")
     public AjaxResult updateSSDByCondition(@RequestBody ServiceSubtaskDetail serviceSubtaskDetail) {
-            return toAjax(ServiceSubtaskDetailService.updateSSDByCondition(serviceSubtaskDetail));
+        return toAjax(ServiceSubtaskDetailService.updateSSDByCondition(serviceSubtaskDetail));
     }
 
     /**
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java
index cf14cf6..f9b3d69 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java
@@ -2,14 +2,13 @@
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.common.core.domain.entity.SysUserRole;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -27,7 +26,6 @@
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.web.service.SysPermissionService;
 import com.ruoyi.framework.web.service.TokenService;
-import com.ruoyi.system.domain.SysUserRole;
 import com.ruoyi.system.service.ISysDeptService;
 import com.ruoyi.system.service.ISysRoleService;
 import com.ruoyi.system.service.ISysUserService;
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 42398c5..8971fd0 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
@@ -4,6 +4,7 @@
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.utils.file.FileUploadUtils;
 import com.ruoyi.common.utils.file.FileUtils;
+import com.smartor.domain.ServiceSubtaskDetail;
 import com.smartor.domain.ThiedInhospInfo;
 import io.swagger.models.auth.In;
 import org.junit.Test;
@@ -16,6 +17,9 @@
 import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.CompletableFuture;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
 
 import static org.eclipse.jetty.http.HttpGenerator.CHUNK_SIZE;
 
@@ -44,14 +48,7 @@
 
     @Test
     public void bb() {
-//        int number = 99999; // 绀轰緥鏁版嵁
-//        String format = String.format("%03X", number);
-//        System.out.println(format);
-//        for (int j = 0; j < 5; j++) {
-//            if(j==5-1){
-//                System.out.println("11111111111111111111");
-//            }
-//        }
+
     }
 
     public void aa(MultipartFile file) throws IOException {
diff --git a/ruoyi-admin/src/main/resources/application-druid-linshi.yml b/ruoyi-admin/src/main/resources/application-druid-linshi.yml
new file mode 100644
index 0000000..e2a71e7
--- /dev/null
+++ b/ruoyi-admin/src/main/resources/application-druid-linshi.yml
@@ -0,0 +1,170 @@
+# 鏁版嵁婧愰厤缃�
+spring:
+  datasource:
+    type: com.alibaba.druid.pool.DruidDataSource
+    #    driverClassName: com.mysql.cj.jdbc.Driver
+    druid:
+      # 涓诲簱鏁版嵁婧�
+      master:
+        #        涔変箤浜岄櫌
+        #        url: jdbc:mysql://127.0.0.1:3306/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        #        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.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://rm-ns02o037qh57kj7qu.mysql.rds.ops.zj.zjhealthcloud.cn:3306/smartor?characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true
+        username: ywgl
+        password: health@123
+        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://127.0.0.1:1433;DatabaseName=IntelligentVoice;encrypt=false;SelectMethod=cursor
+        username: sa
+        password: sfxt#2023
+        driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
+      # 鍒濆杩炴帴鏁�
+      initialSize: 5
+      # 鏈�灏忚繛鎺ユ睜鏁伴噺
+      minIdle: 10
+      # 鏈�澶ц繛鎺ユ睜鏁伴噺
+      maxActive: 20
+      # 閰嶇疆鑾峰彇杩炴帴绛夊緟瓒呮椂鐨勬椂闂�
+      maxWait: 60000
+      # 閰嶇疆闂撮殧澶氫箙鎵嶈繘琛屼竴娆℃娴嬶紝妫�娴嬮渶瑕佸叧闂殑绌洪棽杩炴帴锛屽崟浣嶆槸姣
+      timeBetweenEvictionRunsMillis: 60000
+      # 閰嶇疆涓�涓繛鎺ュ湪姹犱腑鏈�灏忕敓瀛樼殑鏃堕棿锛屽崟浣嶆槸姣
+      minEvictableIdleTimeMillis: 300000
+      # 閰嶇疆涓�涓繛鎺ュ湪姹犱腑鏈�澶х敓瀛樼殑鏃堕棿锛屽崟浣嶆槸姣
+      maxEvictableIdleTimeMillis: 900000
+      # 閰嶇疆妫�娴嬭繛鎺ユ槸鍚︽湁鏁�
+      #      validationQuery: SELECT 1 FROM DUAL
+      validationQuery: SELECT 1
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      webStatFilter:
+        enabled: true
+      statViewServlet:
+        enabled: false
+        # 璁剧疆鐧藉悕鍗曪紝涓嶅~鍒欏厑璁告墍鏈夎闂�
+        allow:
+        url-pattern: /druid/*
+        # 鎺у埗鍙扮鐞嗙敤鎴峰悕鍜屽瘑鐮�
+        login-username: lihu
+        login-password: Lihu@1363419#$
+      filter:
+        stat:
+          enabled: true
+          # 鎱QL璁板綍
+          log-slow-sql: true
+          slow-sql-millis: 1000
+          merge-sql: true
+        wall:
+          config:
+            multi-statement-allow: true
+
+magic-api:
+  web: /magic/web
+  resource:
+    type: database   # 閰嶇疆瀛樺偍鍦ㄦ暟鎹簱涓�
+    tableName: magic_config  # 鏁版嵁搴撲腑鐨勮〃鍚�
+    prefix: /api
+    readonly: false
+  sql-column-case: camel
+  show-sql: true #閰嶇疆鎵撳嵃SQL
+  page-config:
+    size: size
+    page: page
+    default-page: 1
+    default-size: 10
+
+  #寰俊鍏紬鍙风殑瀵嗛挜
+appid: wx1c5243d2337753f4
+appSecret: 84a2186a0d175e88345267c716516cd3
+#绗笁鏂瑰井淇″叕浼楀彿鍙戦�佸湴鍧�锛堟柊鍗庡尰闄級
+thirdWXUrl: http://192.16.4.220:8103/api
+
+#閽夐拤鐨勫瘑閽�
+dingAppid: dingn8iip5ubj7clrrsv
+dingAppSecret: qlEK8D3oOVwGPOTiBQIBYTqQVlAfy9S_qQizEQFjJdSScwemWFryg4gbneu-NqWD
+
+# websocket瓒呮椂鏃堕棿
+server:
+  websocket:
+    timeout=60000:
+
+
+accessKeyId: LTAI5tPfc1VJzz7VuhzcBwug
+accessKeySecret: gG1srKxPFDBNWe2oHfqmK1qsSQkf1e
+signName: 鏉窞鍒╂箹绉戞妧
+
+#鏅鸿兘鍛煎彨(涓婃捣)
+phoneIP: http://124.220.50.51
+phonePort: 8001
+#鏉窞
+hzphoneIP: http://121.43.112.160
+hzphonePort: 8088
+#鐢佃瘽绾胯矾锛�1 涓婃捣锛�2 鏉窞锛�
+phonePath: 2
+#鑷繁鐨勭數璇濆彿鐮�
+phoneMySelf: 83234089
+##鎺堟潈 id(鏉窞)
+#app_id: hzgs
+##鎺堟潈 key(宸插姞瀵嗚繃鐨� key)(鏉窞)
+#app_key: 605453540c4a0a692fe07e1cae1162f3
+#鎺堟潈 id(鏉窞)
+app_id: hz_ali
+#鎺堟潈 key(宸插姞瀵嗚繃鐨� key)(鏉窞)
+app_key: a2f3b5799d635216aa280362fafd8c35
+
+
+pub_key: MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALQzqW1EIXBKGMu+2oEYSB5gM7Ox/ihyYTeeoE0yPX1qtt4++5yNOeTBVd6EEM4iKzVEzWj6REIWVwaSNPn/SvUCAwEAAQ==
+#杩欎釜鏄悗绔殑绉侀挜锛岀敤涓嶅埌
+pri_key: MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEAtDOpbUQhcEoYy77agRhIHmAzs7H+KHJhN56gTTI9fWq23j77nI055MFV3oQQziIrNUTNaPpEQhZXBpI0+f9K9QIDAQABAkB3n0fcWfrcoMN/FU3VnrnZOEF6CzFNxkgU9P8y36QECWKZ9JhYQkNpKrMC9oXlN3VSaRigV7B+L/I/a0Rs1W+tAiEA4jx7xcXJ4y4BNwAmVHt6NNiEkzIwWnwC/0qsEu8NsOsCIQDL6MMn1D2uznC6OuOWpxDCkBh1JL1NzZTZeH2G+hj7nwIgKGAC9tjFnvWm4dn0/T7MIIJDpsFeP8fCAS2iZ/6hwuECIAS/eLvWr1EAsZNEh8QcQ8GkBU3E+ztyjAK8UX/xFt/VAiBf79/1tDErX4/DChecM8w3c3DhbBcjuE3fHZn7p6/UKg==
+#鍓嶇绉侀挜锛堢敤涓嶅埌浜嗭級
+#pri_key: MIIBVQIBADANBgkqhkiG9w0BAQEFAASCAT8wggE7AgEAAkEApHTIe/StslZAT5Jzv8XClbrqox32pfaTrP5IOCRJ3FaH/UZsGgA/tsNBBEXq9eagqwPbJrjYfpdEtINcChrK4wIDAQABAkEAilDujdKshGGmlUZHs/NQRT6AOdDpsYxBiC4V76IVvQpw0IW6c4HGEvH4T+xRufika7/48L0eu0f06H+YtL5lgQIhANUd0a6oSsVxWifAjtKwMZcXD3OaIxQIQSCN4NT4VFY3AiEAxYxYrIhkIyg+UVw3WOSvBpXKxM4/WL9HRzkxDLvp2rUCIQCK23P8tgCJ5xJT5l3onw6goFDcBKkoazxsBqVgfjENPwIgWbuTd+OIYPPhwsE5ntZZrosSDO2GlsBkFzUiU59z7VUCIA0LL+9IFb+FWCl3DGTwIQ9SZYbv61T83LKjebUcSOfe
+
+#浜岀淮鐮佽矾寰�
+qrpath: D:\qrcode
+
+#鍏徃鍐呭閾捐姹侷P鍜岀鍙e彿
+#req_path: 8095
+#localIP: 192.168.2.10
+
+#鏂板崕鍖婚櫌澶栭摼璇锋眰IP鍜岀鍙e彿
+req_path: 8093
+localIP: 218.108.11.22
+
+#鑾峰彇鎮h�呬俊鎭疷RL(鍗庡崜鎻愪緵)
+hosp_info_url: http://esb-core-rest.wowjoy.cn/esb/exchange
+
+# 0浠h〃璧伴粯璁ょ殑涓婁紶    1 浠g爜璧版柊鍗庡尰闄㈢殑涓婁紶
+uploadSwitch: 1
+
+#  鎸囧畾asr鍥炶皟鐨剈rl璺緞
+ASRCallBackPath: http://192.168.2.10:8095/smartor/serviceSubtask/phoneCallBackYQ
+#鎸傛柇IP
+hangup: http://192.168.2.10:8091/hangup
+
+
+#鏂板崕鐭俊璇锋眰鍦板潃(杩欎釜鏈嶅姟鏄垜浠嚜宸卞啓鐨�)
+xhsmsPath: http://192.16.4.220:8092/sendSms
+#甯愬彿
+xhsmsAccount: 911124
+#鎺ュ彛瀵嗙爜
+xhsmsPwd: zW5eXe
+#铏氭嫙鎺ュ叆鐮�
+xhsmsjrm: 1069055
diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml
index ff5289c..47d7673 100644
--- a/ruoyi-admin/src/main/resources/application-druid.yml
+++ b/ruoyi-admin/src/main/resources/application-druid.yml
@@ -11,12 +11,17 @@
         #        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://192.168.191.181:3308/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        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
       # 浠庡簱鏁版嵁婧�
       slave:
         # 浠庢暟鎹簮寮�鍏�/榛樿鍏抽棴(鍏徃)
@@ -150,10 +155,19 @@
 # 0浠h〃璧伴粯璁ょ殑涓婁紶    1 浠g爜璧版柊鍗庡尰闄㈢殑涓婁紶
 uploadSwitch: 1
 
-#  鎸囧畾asr鍥炶皟鐨剈rl璺緞
-ASRCallBackPath: http://192.168.2.10:8095/smartor/serviceSubtask/phoneCallBackYQ
-#鎸傛柇IP
-hangup: http://192.168.2.10:8091/hangup
+##  鎸囧畾asr鍥炶皟鐨剈rl璺緞(鏈湴)
+#ASRCallBackPath: http://192.168.2.13:8095/smartor/serviceSubtask/phoneCallBackYQ
+##鎸傛柇IP(鏈湴)
+#hangup: http://192.168.2.13:8091/hangup
+##fs鎵�浣跨敤鐨勯樋閲岀殑app_key(鏈湴)
+#app_key_yq: ZurNHpaQLq6P55YS
+
+#  鎸囧畾asr鍥炶皟鐨剈rl璺緞(鏂板崕)
+ASRCallBackPath: http://192.168.101.135:8095/smartor/serviceSubtask/phoneCallBackYQ
+#鎸傛柇IP(鏂板崕)
+hangup: http://192.16.4.220:8091/hangup
+#fs鎵�浣跨敤鐨勯樋閲岀殑app_key(鏂板崕)
+app_key_yq: ZurNHpaQLq6P55YS
 
 
 #鏂板崕鐭俊璇锋眰鍦板潃(杩欎釜鏈嶅姟鏄垜浠嚜宸卞啓鐨�)
@@ -164,3 +178,13 @@
 xhsmsPwd: zW5eXe
 #铏氭嫙鎺ュ叆鐮�
 xhsmsjrm: 1069055
+
+#鏂板崕FTP杩炴帴
+FTP_SERVER: "192.16.4.220"
+FTP_USERNAME: voice
+FTP_PASSWORD: xh@2023
+
+#璇煶鍦板潃璁块棶鍓嶇紑(鏂板崕)
+voicePathPrefix: http://192.168.191.181:8095/profile/upload/vadio/
+#璇煶鍦板潃璁块棶鍓嶇紑(鍏徃)
+#voicePathPrefix: http://192.168.2.13:8095/profile/upload/vadio/
diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml
index 9ce2569..be3e019 100644
--- a/ruoyi-admin/src/main/resources/application.yml
+++ b/ruoyi-admin/src/main/resources/application.yml
@@ -72,7 +72,7 @@
   # redis 閰嶇疆
   redis:
     #    # 鍦板潃锛堜箟涔屼簩闄級
-    host: 192.168.2.10
+    host: 127.0.0.1
     port: 6020
 
     # 鍦板潃锛堝叕鍙革級
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java
index 8b9b693..02a6b6c 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java
@@ -84,6 +84,13 @@
     private String phonenumber;
 
     /**
+     * 韬唤璇佸彿
+     */
+    @ApiModelProperty(value = "韬唤璇佸彿")
+    @Excel(name = "韬唤璇佸彿")
+    private String idCard;
+
+    /**
      * 鐢ㄦ埛鎬у埆
      */
     @ApiModelProperty(value = "鐢ㄦ埛鎬у埆")
@@ -434,6 +441,14 @@
         this.depts = depts;
     }
 
+    public String getIdCard() {
+        return idCard;
+    }
+
+    public void setIdCard(String idCard) {
+        this.idCard = idCard;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("userId", getUserId()).append("deptId", getDeptId()).append("userName", getUserName()).append("nickName", getNickName()).append("email", getEmail()).append("phonenumber", getPhonenumber()).append("sex", getSex()).append("avatar", getAvatar()).append("password", getPassword()).append("status", getStatus()).append("delFlag", getDelFlag()).append("loginIp", getLoginIp()).append("loginDate", getLoginDate()).append("createBy", getCreateBy()).append("createTime", getCreateTime()).append("updateBy", getUpdateBy()).append("updateTime", getUpdateTime()).append("remark", getRemark()).append("dept", getDept()).toString();
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserRole.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUserRole.java
similarity index 93%
rename from ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserRole.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUserRole.java
index 4d15810..444981a 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserRole.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUserRole.java
@@ -1,18 +1,18 @@
-package com.ruoyi.system.domain;
+package com.ruoyi.common.core.domain.entity;
 
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 
 /**
  * 鐢ㄦ埛鍜岃鑹插叧鑱� sys_user_role
- * 
+ *
  * @author ruoyi
  */
 public class SysUserRole
 {
     /** 鐢ㄦ埛ID */
     private Long userId;
-    
+
     /** 瑙掕壊ID */
     private Long roleId;
 
diff --git a/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml b/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml
index b605e90..c946c09 100644
--- a/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml
+++ b/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml
@@ -27,7 +27,7 @@
 		<result property="remark"         column="remark"            />
 		<collection  property="columns"  javaType="java.util.List"  resultMap="GenTableColumnResult" />
 	</resultMap>
-	
+
 	<resultMap type="GenTableColumn" id="GenTableColumnResult">
         <id     property="columnId"       column="column_id"      />
         <result property="tableId"        column="table_id"       />
@@ -52,14 +52,15 @@
         <result property="updateBy"       column="update_by"      />
         <result property="updateTime"     column="update_time"    />
     </resultMap>
-	
+
 	<sql id="selectGenTableVo">
         select table_id, table_name, table_comment, sub_table_name, sub_table_fk_name, class_name, tpl_category, package_name, module_name, business_name, function_name, function_author, gen_type, gen_path, options, create_by, create_time, update_by, update_time, remark from gen_table
     </sql>
-    
+
     <select id="selectGenTableList" parameterType="GenTable" resultMap="GenTableResult">
 		<include refid="selectGenTableVo"/>
 		<where>
+			del_flag= 0
 			<if test="tableName != null and tableName != ''">
 				AND lower(table_name) like lower(concat('%', #{tableName}, '%'))
 			</if>
@@ -94,30 +95,30 @@
 		</if>
         order by create_time desc
 	</select>
-	
+
 	<select id="selectDbTableListByNames" resultMap="GenTableResult">
 		select table_name, table_comment, create_time, update_time from information_schema.tables
 		where table_name NOT LIKE 'qrtz_%' and table_name NOT LIKE 'gen_%' and table_schema = (select database())
 		and table_name in
 	    <foreach collection="array" item="name" open="(" separator="," close=")">
  			#{name}
-        </foreach> 
+        </foreach>
 	</select>
-	
+
 	<select id="selectTableByName" parameterType="String" resultMap="GenTableResult">
 		select table_name, table_comment, create_time, update_time from information_schema.tables
 		where table_comment <![CDATA[ <> ]]> '' and table_schema = (select database())
 		and table_name = #{tableName}
 	</select>
-	
+
 	<select id="selectGenTableById" parameterType="Long" resultMap="GenTableResult">
 	    SELECT t.table_id, t.table_name, t.table_comment, t.sub_table_name, t.sub_table_fk_name, t.class_name, t.tpl_category, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.gen_type, t.gen_path, t.options, t.remark,
 			   c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
 		FROM gen_table t
 			 LEFT JOIN gen_table_column c ON t.table_id = c.table_id
-		where t.table_id = #{tableId} order by c.sort
+		where del_flag= 0 and t.table_id = #{tableId} order by c.sort
 	</select>
-	
+
 	<select id="selectGenTableByName" parameterType="String" resultMap="GenTableResult">
 	    SELECT t.table_id, t.table_name, t.table_comment, t.sub_table_name, t.sub_table_fk_name, t.class_name, t.tpl_category, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.gen_type, t.gen_path, t.options, t.remark,
 			   c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
@@ -125,7 +126,7 @@
 			 LEFT JOIN gen_table_column c ON t.table_id = c.table_id
 		where t.table_name = #{tableName} order by c.sort
 	</select>
-	
+
 	<select id="selectGenTableAll" parameterType="String" resultMap="GenTableResult">
 	    SELECT t.table_id, t.table_name, t.table_comment, t.sub_table_name, t.sub_table_fk_name, t.class_name, t.tpl_category, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.options, t.remark,
 			   c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
@@ -133,7 +134,7 @@
 			 LEFT JOIN gen_table_column c ON t.table_id = c.table_id
 		order by c.sort
 	</select>
-	
+
 	<insert id="insertGenTable" parameterType="GenTable" useGeneratedKeys="true" keyProperty="tableId">
         insert into gen_table (
 			<if test="tableName != null">table_name,</if>
@@ -167,7 +168,7 @@
 			sysdate()
          )
     </insert>
-    
+
     <update id="updateGenTable" parameterType="GenTable">
         update gen_table
         <set>
@@ -189,14 +190,14 @@
             <if test="remark != null">remark = #{remark},</if>
             update_time = sysdate()
         </set>
-        where table_id = #{tableId}
+        where table_id = #{tableId} and del_flag= 0
     </update>
-    
+
     <delete id="deleteGenTableByIds" parameterType="Long">
-        delete from gen_table where table_id in 
+        delete from gen_table where table_id in
         <foreach collection="array" item="tableId" open="(" separator="," close=")">
             #{tableId}
         </foreach>
     </delete>
 
-</mapper>
\ No newline at end of file
+</mapper>
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 0d260ff..e6ebece 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
@@ -18,6 +18,7 @@
 import com.ruoyi.common.utils.http.HttpUtils;
 import com.smartor.common.SendService;
 import com.smartor.domain.*;
+import com.smartor.mapper.ServiceSubtaskMapper;
 import com.smartor.mapper.ServiceTaskMapper;
 import com.smartor.mapper.SysUserImportMapper;
 import com.smartor.service.*;
@@ -94,7 +95,7 @@
     private ServiceTaskMapper serviceTaskMapper;
 
     @Autowired
-    private SendService sendService;
+    private ServiceSubtaskMapper serviceSubtaskMapper;
 
     @Autowired
     private RedisCache redisCache;
@@ -286,55 +287,69 @@
                 ivrTaskcall.setSendstate(2L);
                 List<ServiceSubtask> selectServiceSubtaskList = iServiceSubtaskService.selectServiceSubtaskList(ivrTaskcall);
                 if (descByCode.equals("鐢佃瘽")) {
+                    String value = "";
                     for (ServiceSubtask serviceSubtask : selectServiceSubtaskList) {
                         ServiceTask ivrTask = serviceTaskMapper.selectServiceTaskByTaskid(serviceSubtask.getTaskid());
                         if (ivrTask.getSendState() != null && ivrTask.getSendState() == 3 || ivrTask.getSendState() != null && ivrTask.getSendState() == 4) {
                             //濡備綍浠诲姟琚�滄殏鍋溾�濇垨鈥滅粓姝⑩��
                             break;
                         }
-                        //鑾峰彇鍒皏alue鍊兼渶灏戠殑key
-                        String key = getKey();
-                        if (commonTaskcallMQ.getSendType().equals("2")) {
-                            //璇存槑鏄珛鍗冲彂閫�
-                            String value = redisCache.getCacheObject("cache-0");
-                            ServiceSubtaskVO serviceSubtask1 = new ServiceSubtaskVO();
-                            serviceSubtask1.setTaskid(commonTaskcallMQ.getTaskid());
-                            List<ServiceSubtask> selectServiceSubtaskList1 = iServiceSubtaskService.selectServiceSubtaskList(serviceSubtask1);
-                            for (ServiceSubtask serviceSubtask2 : selectServiceSubtaskList1) {
-                                if (StringUtils.isEmpty(value)) {
-                                    value = "," + serviceSubtask2.getId().toString() + ",";
-                                } else {
-                                    value = value + "," + serviceSubtask2.getId().toString() + ",";
+                        boolean dateToday = isDateToday(serviceSubtask.getLongSendTime());
+                        //璇存槑鏄珛鍗冲彂閫�(鍏堟妸娑堟伅鏀惧埌cache-0涓紝   displayNo涓嶇煡閬撴�庝箞閰嶇疆)
+                        if (dateToday) {
+                            try {
+                                ServiceSubtaskVO serviceSubtask1 = new ServiceSubtaskVO();
+                                serviceSubtask1.setTaskid(ivrTask.getTaskid());
+                                List<ServiceSubtask> selectServiceSubtaskList1 = iServiceSubtaskService.selectServiceSubtaskList(serviceSubtask1);
+                                for (ServiceSubtask serviceSubtask2 : selectServiceSubtaskList1) {
+                                    if (StringUtils.isEmpty(value)) {
+                                        value = "," + serviceSubtask2.getId().toString() + ",";
+                                    } else {
+                                        if (!value.contains("," + serviceSubtask2.getId().toString()))
+                                            value = value + "," + serviceSubtask2.getId().toString() + ",";
+                                    }
                                 }
+                            } catch (Exception e) {
+                                String guid = UUID.randomUUID().toString();
+                                log.error("闀挎湡浠诲姟锛岀數璇濆彂閫佸け璐ュ師鍥狅細{},{}", e.getMessage(), guid);
+                                serviceSubtask.setResult("error");
+                                serviceSubtask.setRemark("绯荤粺閿欒");
+                                serviceSubtask.setSendstate(3L);
+                                serviceSubtask.setFinishtime(new Date());
+                                serviceSubtask.setGuid(guid);
+                                iServiceSubtaskService.updateServiceSubtask(serviceSubtask);
                             }
-                            redisCache.setCacheObject("cache-0", value);
-                        } else {
-                            //闈炵珛鍗冲彂閫�
-                            String value = redisCache.getCacheObject(key);
-                            ServiceSubtaskVO serviceSubtask1 = new ServiceSubtaskVO();
-                            serviceSubtask1.setTaskid(commonTaskcallMQ.getTaskid());
-                            List<ServiceSubtask> selectServiceSubtaskList1 = iServiceSubtaskService.selectServiceSubtaskList(serviceSubtask1);
-                            for (ServiceSubtask serviceSubtask2 : selectServiceSubtaskList1) {
-                                if (StringUtils.isEmpty(value)) {
-                                    value = "," + serviceSubtask2.getId().toString() + ",";
-                                } else {
-                                    value = value + "," + serviceSubtask2.getId().toString() + ",";
-                                }
-                            }
-                            redisCache.setCacheObject(key, value);
+
+                            //鍦ㄥ瓙浠诲姟琛ㄩ噷璁板綍涓�涓�
+                            String uuid = UUID.randomUUID().toString();
+                            serviceSubtask.setResult("success");
+                            serviceSubtask.setRemark("鐢佃瘽鍙戦�佹垚鍔�");
+                            serviceSubtask.setGuid(uuid);
+                            serviceSubtask.setSendstate(3L);
+                            serviceSubtask.setFinishtime(new Date());
+                            serviceSubtaskMapper.updateServiceSubtask(serviceSubtask);
+
+                            //浠诲姟鍙戦�佽褰�
+                            ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord();
+                            serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString());
+                            serviceSubtaskRecord.setSubtaskId(serviceSubtask.getId());
+                            serviceSubtaskRecord.setUuid(uuid);
+                            serviceSubtaskRecord.setTasktype(serviceSubtask.getType());
+                            serviceSubtaskRecord.setPreachform("3");
+                            serviceSubtaskRecord.setStartTime(System.currentTimeMillis());
+                            serviceSubtaskRecord.setRemark("鐢佃瘽鍙戦�佹垚鍔�");
+                            serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord);
+
                         }
-
-                        //浠诲姟鍙戦�佽褰曪紙杩欎釜浠g爜搴旇鍐欏湪phoneTask涓紝鍏堝啓鍦ㄨ繖锛屽悗闈㈠啀鏀癸級
-                        ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord();
-                        serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString());
-                        serviceSubtaskRecord.setUuid(UUID.randomUUID().toString());
-                        serviceSubtaskRecord.setTasktype(serviceSubtask.getType());
-                        serviceSubtaskRecord.setPreachform("3");
-                        serviceSubtaskRecord.setStartTime(System.currentTimeMillis());
-                        serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord);
-
-//                        //閫氳繃澶氱嚎绋嬬殑鏂瑰紡鍘绘墦鐢佃瘽
+//                        //閫氳繃澶氱嚎绋嬬殑鏂瑰紡鍘绘墦鐢佃瘽锛堣繖涓槸涓婃捣鐨勬柟娉曪級
 //                        executorService.submit(new PhoneTask(serviceSubtask, ivrTaskTemplateVO1, redisCache, sendService, phonePath, robotPhoneUtils));
+                    }
+                    //灏嗚鎵ц鐨勬斁鍒扮紦瀛樹腑
+                    String cache0 = redisCache.getCacheObject("cache-0");
+                    if (StringUtils.isNotEmpty(cache0)) {
+                        redisCache.setCacheObject("cache-0", cache0 + value);
+                    } else if (StringUtils.isEmpty(cache0) && StringUtils.isNotEmpty(value)) {
+                        redisCache.setCacheObject("cache-0", value);
                     }
                 } else if (descByCode.equals("澶氬獟浣�")) {
                     //澶氬獟浣�
@@ -403,7 +418,7 @@
                                 iServiceSubtaskService.updateServiceSubtask(serviceSubtask);
                             } catch (Exception e) {
                                 String guid = UUID.randomUUID().toString();
-                                log.error("闀挎湡浠诲姟锛屽彂閫佸け璐ュ師鍥狅細{},{}", e.getMessage(), guid);
+                                log.error("闀挎湡浠诲姟锛岀煭淇″彂閫佸け璐ュ師鍥狅細{},{}", e.getMessage(), guid);
                                 serviceSubtask.setResult("error");
                                 serviceSubtask.setRemark("绯荤粺閿欒");
                                 serviceSubtask.setSendstate(5L);
@@ -464,7 +479,7 @@
                                 iServiceSubtaskService.updateServiceSubtask(serviceSubtask);
                             } catch (Exception e) {
                                 String guid = UUID.randomUUID().toString();
-                                log.error("闀挎湡浠诲姟锛屽彂閫佸け璐ュ師鍥狅細{},{}", e.getMessage(), guid);
+                                log.error("闀挎湡浠诲姟锛屽叕浼楀彿鍙戦�佸け璐ュ師鍥狅細{},{}", e.getMessage(), guid);
                                 serviceSubtask.setResult("error");
                                 serviceSubtask.setRemark("绯荤粺閿欒");
                                 serviceSubtask.setSendstate(5L);
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java
index bfa7068..ea8115d 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java
@@ -12,8 +12,7 @@
  * @author ruoyi
  */
 @Mapper
-public interface SysUserMapper
-{
+public interface SysUserMapper {
     /**
      * 鏍规嵁鏉′欢鍒嗛〉鏌ヨ鐢ㄦ埛鍒楄〃
      *
@@ -74,7 +73,7 @@
      * 淇敼鐢ㄦ埛澶村儚
      *
      * @param userName 鐢ㄦ埛鍚�
-     * @param avatar 澶村儚鍦板潃
+     * @param avatar   澶村儚鍦板潃
      * @return 缁撴灉
      */
     public int updateUserAvatar(@Param("userName") String userName, @Param("avatar") String avatar);
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java
index 1fb8ba8..7b307d6 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java
@@ -2,9 +2,9 @@
 
 import java.util.List;
 
+import com.ruoyi.common.core.domain.entity.SysUserRole;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
-import com.ruoyi.system.domain.SysUserRole;
 
 /**
  * 鐢ㄦ埛涓庤鑹插叧鑱旇〃 鏁版嵁灞�
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java
index 28c73cc..e82f362 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java
@@ -3,18 +3,18 @@
 import java.util.List;
 import java.util.Set;
 import com.ruoyi.common.core.domain.entity.SysRole;
-import com.ruoyi.system.domain.SysUserRole;
+import com.ruoyi.common.core.domain.entity.SysUserRole;
 
 /**
  * 瑙掕壊涓氬姟灞�
- * 
+ *
  * @author ruoyi
  */
 public interface ISysRoleService
 {
     /**
      * 鏍规嵁鏉′欢鍒嗛〉鏌ヨ瑙掕壊鏁版嵁
-     * 
+     *
      * @param role 瑙掕壊淇℃伅
      * @return 瑙掕壊鏁版嵁闆嗗悎淇℃伅
      */
@@ -22,7 +22,7 @@
 
     /**
      * 鏍规嵁鐢ㄦ埛ID鏌ヨ瑙掕壊鍒楄〃
-     * 
+     *
      * @param userId 鐢ㄦ埛ID
      * @return 瑙掕壊鍒楄〃
      */
@@ -30,7 +30,7 @@
 
     /**
      * 鏍规嵁鐢ㄦ埛ID鏌ヨ瑙掕壊鏉冮檺
-     * 
+     *
      * @param userId 鐢ㄦ埛ID
      * @return 鏉冮檺鍒楄〃
      */
@@ -38,14 +38,14 @@
 
     /**
      * 鏌ヨ鎵�鏈夎鑹�
-     * 
+     *
      * @return 瑙掕壊鍒楄〃
      */
     public List<SysRole> selectRoleAll();
 
     /**
      * 鏍规嵁鐢ㄦ埛ID鑾峰彇瑙掕壊閫夋嫨妗嗗垪琛�
-     * 
+     *
      * @param userId 鐢ㄦ埛ID
      * @return 閫変腑瑙掕壊ID鍒楄〃
      */
@@ -53,7 +53,7 @@
 
     /**
      * 閫氳繃瑙掕壊ID鏌ヨ瑙掕壊
-     * 
+     *
      * @param roleId 瑙掕壊ID
      * @return 瑙掕壊瀵硅薄淇℃伅
      */
@@ -61,7 +61,7 @@
 
     /**
      * 鏍¢獙瑙掕壊鍚嶇О鏄惁鍞竴
-     * 
+     *
      * @param role 瑙掕壊淇℃伅
      * @return 缁撴灉
      */
@@ -69,7 +69,7 @@
 
     /**
      * 鏍¢獙瑙掕壊鏉冮檺鏄惁鍞竴
-     * 
+     *
      * @param role 瑙掕壊淇℃伅
      * @return 缁撴灉
      */
@@ -77,21 +77,21 @@
 
     /**
      * 鏍¢獙瑙掕壊鏄惁鍏佽鎿嶄綔
-     * 
+     *
      * @param role 瑙掕壊淇℃伅
      */
     public void checkRoleAllowed(SysRole role);
 
     /**
      * 鏍¢獙瑙掕壊鏄惁鏈夋暟鎹潈闄�
-     * 
+     *
      * @param roleId 瑙掕壊id
      */
     public void checkRoleDataScope(Long roleId);
 
     /**
      * 閫氳繃瑙掕壊ID鏌ヨ瑙掕壊浣跨敤鏁伴噺
-     * 
+     *
      * @param roleId 瑙掕壊ID
      * @return 缁撴灉
      */
@@ -99,7 +99,7 @@
 
     /**
      * 鏂板淇濆瓨瑙掕壊淇℃伅
-     * 
+     *
      * @param role 瑙掕壊淇℃伅
      * @return 缁撴灉
      */
@@ -107,7 +107,7 @@
 
     /**
      * 淇敼淇濆瓨瑙掕壊淇℃伅
-     * 
+     *
      * @param role 瑙掕壊淇℃伅
      * @return 缁撴灉
      */
@@ -115,7 +115,7 @@
 
     /**
      * 淇敼瑙掕壊鐘舵��
-     * 
+     *
      * @param role 瑙掕壊淇℃伅
      * @return 缁撴灉
      */
@@ -123,7 +123,7 @@
 
     /**
      * 淇敼鏁版嵁鏉冮檺淇℃伅
-     * 
+     *
      * @param role 瑙掕壊淇℃伅
      * @return 缁撴灉
      */
@@ -131,7 +131,7 @@
 
     /**
      * 閫氳繃瑙掕壊ID鍒犻櫎瑙掕壊
-     * 
+     *
      * @param roleId 瑙掕壊ID
      * @return 缁撴灉
      */
@@ -139,7 +139,7 @@
 
     /**
      * 鎵归噺鍒犻櫎瑙掕壊淇℃伅
-     * 
+     *
      * @param roleIds 闇�瑕佸垹闄ょ殑瑙掕壊ID
      * @return 缁撴灉
      */
@@ -147,7 +147,7 @@
 
     /**
      * 鍙栨秷鎺堟潈鐢ㄦ埛瑙掕壊
-     * 
+     *
      * @param userRole 鐢ㄦ埛鍜岃鑹插叧鑱斾俊鎭�
      * @return 缁撴灉
      */
@@ -155,7 +155,7 @@
 
     /**
      * 鎵归噺鍙栨秷鎺堟潈鐢ㄦ埛瑙掕壊
-     * 
+     *
      * @param roleId 瑙掕壊ID
      * @param userIds 闇�瑕佸彇娑堟巿鏉冪殑鐢ㄦ埛鏁版嵁ID
      * @return 缁撴灉
@@ -164,7 +164,7 @@
 
     /**
      * 鎵归噺閫夋嫨鎺堟潈鐢ㄦ埛瑙掕壊
-     * 
+     *
      * @param roleId 瑙掕壊ID
      * @param userIds 闇�瑕佸垹闄ょ殑鐢ㄦ埛鏁版嵁ID
      * @return 缁撴灉
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java
index b9b8f32..281e9e8 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java
@@ -1,33 +1,30 @@
 package com.ruoyi.system.service.impl;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
 import com.ruoyi.common.annotation.DataScope;
 import com.ruoyi.common.constant.UserConstants;
 import com.ruoyi.common.core.domain.entity.SysRole;
 import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.core.domain.entity.SysUserRole;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.spring.SpringUtils;
 import com.ruoyi.system.domain.SysRoleDept;
 import com.ruoyi.system.domain.SysRoleMenu;
-import com.ruoyi.system.domain.SysUserRole;
 import com.ruoyi.system.mapper.SysRoleDeptMapper;
 import com.ruoyi.system.mapper.SysRoleMapper;
 import com.ruoyi.system.mapper.SysRoleMenuMapper;
 import com.ruoyi.system.mapper.SysUserRoleMapper;
 import com.ruoyi.system.service.ISysRoleService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
 
 /**
  * 瑙掕壊 涓氬姟灞傚鐞�
- * 
+ *
  * @author ruoyi
  */
 @Service
@@ -47,7 +44,7 @@
 
     /**
      * 鏍规嵁鏉′欢鍒嗛〉鏌ヨ瑙掕壊鏁版嵁
-     * 
+     *
      * @param role 瑙掕壊淇℃伅
      * @return 瑙掕壊鏁版嵁闆嗗悎淇℃伅
      */
@@ -60,7 +57,7 @@
 
     /**
      * 鏍规嵁鐢ㄦ埛ID鏌ヨ瑙掕壊
-     * 
+     *
      * @param userId 鐢ㄦ埛ID
      * @return 瑙掕壊鍒楄〃
      */
@@ -85,7 +82,7 @@
 
     /**
      * 鏍规嵁鐢ㄦ埛ID鏌ヨ鏉冮檺
-     * 
+     *
      * @param userId 鐢ㄦ埛ID
      * @return 鏉冮檺鍒楄〃
      */
@@ -106,7 +103,7 @@
 
     /**
      * 鏌ヨ鎵�鏈夎鑹�
-     * 
+     *
      * @return 瑙掕壊鍒楄〃
      */
     @Override
@@ -117,7 +114,7 @@
 
     /**
      * 鏍规嵁鐢ㄦ埛ID鑾峰彇瑙掕壊閫夋嫨妗嗗垪琛�
-     * 
+     *
      * @param userId 鐢ㄦ埛ID
      * @return 閫変腑瑙掕壊ID鍒楄〃
      */
@@ -129,7 +126,7 @@
 
     /**
      * 閫氳繃瑙掕壊ID鏌ヨ瑙掕壊
-     * 
+     *
      * @param roleId 瑙掕壊ID
      * @return 瑙掕壊瀵硅薄淇℃伅
      */
@@ -141,7 +138,7 @@
 
     /**
      * 鏍¢獙瑙掕壊鍚嶇О鏄惁鍞竴
-     * 
+     *
      * @param role 瑙掕壊淇℃伅
      * @return 缁撴灉
      */
@@ -159,7 +156,7 @@
 
     /**
      * 鏍¢獙瑙掕壊鏉冮檺鏄惁鍞竴
-     * 
+     *
      * @param role 瑙掕壊淇℃伅
      * @return 缁撴灉
      */
@@ -177,7 +174,7 @@
 
     /**
      * 鏍¢獙瑙掕壊鏄惁鍏佽鎿嶄綔
-     * 
+     *
      * @param role 瑙掕壊淇℃伅
      */
     @Override
@@ -191,7 +188,7 @@
 
     /**
      * 鏍¢獙瑙掕壊鏄惁鏈夋暟鎹潈闄�
-     * 
+     *
      * @param roleId 瑙掕壊id
      */
     @Override
@@ -211,7 +208,7 @@
 
     /**
      * 閫氳繃瑙掕壊ID鏌ヨ瑙掕壊浣跨敤鏁伴噺
-     * 
+     *
      * @param roleId 瑙掕壊ID
      * @return 缁撴灉
      */
@@ -223,7 +220,7 @@
 
     /**
      * 鏂板淇濆瓨瑙掕壊淇℃伅
-     * 
+     *
      * @param role 瑙掕壊淇℃伅
      * @return 缁撴灉
      */
@@ -238,7 +235,7 @@
 
     /**
      * 淇敼淇濆瓨瑙掕壊淇℃伅
-     * 
+     *
      * @param role 瑙掕壊淇℃伅
      * @return 缁撴灉
      */
@@ -255,7 +252,7 @@
 
     /**
      * 淇敼瑙掕壊鐘舵��
-     * 
+     *
      * @param role 瑙掕壊淇℃伅
      * @return 缁撴灉
      */
@@ -267,7 +264,7 @@
 
     /**
      * 淇敼鏁版嵁鏉冮檺淇℃伅
-     * 
+     *
      * @param role 瑙掕壊淇℃伅
      * @return 缁撴灉
      */
@@ -285,7 +282,7 @@
 
     /**
      * 鏂板瑙掕壊鑿滃崟淇℃伅
-     * 
+     *
      * @param role 瑙掕壊瀵硅薄
      */
     public int insertRoleMenu(SysRole role)
@@ -333,7 +330,7 @@
 
     /**
      * 閫氳繃瑙掕壊ID鍒犻櫎瑙掕壊
-     * 
+     *
      * @param roleId 瑙掕壊ID
      * @return 缁撴灉
      */
@@ -350,7 +347,7 @@
 
     /**
      * 鎵归噺鍒犻櫎瑙掕壊淇℃伅
-     * 
+     *
      * @param roleIds 闇�瑕佸垹闄ょ殑瑙掕壊ID
      * @return 缁撴灉
      */
@@ -377,7 +374,7 @@
 
     /**
      * 鍙栨秷鎺堟潈鐢ㄦ埛瑙掕壊
-     * 
+     *
      * @param userRole 鐢ㄦ埛鍜岃鑹插叧鑱斾俊鎭�
      * @return 缁撴灉
      */
@@ -389,7 +386,7 @@
 
     /**
      * 鎵归噺鍙栨秷鎺堟潈鐢ㄦ埛瑙掕壊
-     * 
+     *
      * @param roleId 瑙掕壊ID
      * @param userIds 闇�瑕佸彇娑堟巿鏉冪殑鐢ㄦ埛鏁版嵁ID
      * @return 缁撴灉
@@ -402,7 +399,7 @@
 
     /**
      * 鎵归噺閫夋嫨鎺堟潈鐢ㄦ埛瑙掕壊
-     * 
+     *
      * @param roleId 瑙掕壊ID
      * @param userIds 闇�瑕佹巿鏉冪殑鐢ㄦ埛鏁版嵁ID
      * @return 缁撴灉
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
index 19080a2..595fcc1 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
@@ -2,10 +2,7 @@
 
 import com.ruoyi.common.annotation.DataScope;
 import com.ruoyi.common.constant.UserConstants;
-import com.ruoyi.common.core.domain.entity.SysDept;
-import com.ruoyi.common.core.domain.entity.SysRole;
-import com.ruoyi.common.core.domain.entity.SysUser;
-import com.ruoyi.common.core.domain.entity.SysUserDept;
+import com.ruoyi.common.core.domain.entity.*;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
@@ -13,7 +10,6 @@
 import com.ruoyi.common.utils.spring.SpringUtils;
 import com.ruoyi.system.domain.SysPost;
 import com.ruoyi.system.domain.SysUserPost;
-import com.ruoyi.system.domain.SysUserRole;
 import com.ruoyi.system.mapper.*;
 import com.ruoyi.system.service.ISysConfigService;
 import com.ruoyi.system.service.ISysUserService;
diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
index 89fc648..894d9f9 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
@@ -21,6 +21,7 @@
         <result property="loginIp" column="login_ip"/>
         <result property="loginDate" column="login_date"/>
         <result property="createBy" column="create_by"/>
+        <result property="idCard" column="id_card"/>
         <result property="createTime" column="create_time"/>
         <result property="updateBy" column="update_by"/>
         <result property="updateTime" column="update_time"/>
@@ -54,6 +55,7 @@
     <sql id="selectUserVo">
         select u.user_id,
                u.dept_id,
+               u.id_card,
                u.hosp_info,
                u.dept_info,
                u.searchscope,
@@ -92,7 +94,8 @@
     </sql>
 
     <select id="selectUserList" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserResult">
-        select u.user_id,u.hosp_info,u.dept_info, u.searchscope, u.dept_id, u.user_type, u.nick_name, u.user_name, u.email,
+        select u.user_id,u.hosp_info,u.dept_info, u.searchscope, u.dept_id, u.user_type, u.nick_name, u.user_name,
+        u.email,u.id_card,
         u.avatar,
         u.phonenumber, u.sex, u.status,
         u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user
@@ -110,6 +113,9 @@
         </if>
         <if test="status != null and status != ''">
             AND u.status = #{status}
+        </if>
+        <if test="idCard != null and idCard != ''">
+            AND u.id_card = #{idCard}
         </if>
         <if test="phonenumber != null and phonenumber != ''">
             AND u.phonenumber like concat('%', #{phonenumber}, '%')
@@ -130,9 +136,10 @@
 
     <select id="selectAllocatedList" parameterType="com.ruoyi.common.core.domain.entity.SysUser"
             resultMap="SysUserResult">
-        select distinct u.user_id,u.hosp_info,u.dept_info, u.searchscope, u.dept_id, u.user_name, u.user_type, u.nick_name,
+        select distinct u.user_id,u.hosp_info,u.dept_info, u.searchscope, u.dept_id, u.user_name, u.user_type,
+        u.nick_name,
         u.email,
-        u.phonenumber, u.status,
+        u.phonenumber, u.status,u.id_card,
         u.create_time
         from sys_user u
         left join sys_dept d on u.dept_id = d.dept_id
@@ -151,9 +158,10 @@
 
     <select id="selectUnallocatedList" parameterType="com.ruoyi.common.core.domain.entity.SysUser"
             resultMap="SysUserResult">
-        select distinct u.user_id, u.dept_id, u.hosp_info, u.dept_info,u.searchscope, u.user_name, u.user_type, u.nick_name,
+        select distinct u.user_id, u.dept_id, u.hosp_info, u.dept_info,u.searchscope, u.user_name, u.user_type,
+        u.nick_name,
         u.email,
-        u.phonenumber, u.status,
+        u.phonenumber, u.status,u.id_card,
         u.create_time
         from sys_user u
         left join sys_dept d on u.dept_id = d.dept_id
@@ -222,6 +230,7 @@
         <if test="deptInfo != null and deptInfo != ''">dept_info,</if>
         <if test="hospInfo != null and hospInfo != ''">hosp_info,</if>
         <if test="searchscope != null and searchscope != ''">searchscope,</if>
+        <if test="idCard != null and idCard != ''">id_card,</if>
         create_time
         )values(
         <if test="userId != null and userId != ''">#{userId},</if>
@@ -240,6 +249,7 @@
         <if test="deptInfo != null and deptInfo != ''">#{deptInfo},</if>
         <if test="hospInfo != null and hospInfo != ''">#{hospInfo},</if>
         <if test="searchscope != null and searchscope != ''">#{searchscope},</if>
+        <if test="idCard != null and idCard != ''">#{idCard},</if>
         sysdate()
         )
     </insert>
@@ -264,6 +274,7 @@
             <if test="searchscope != null">searchscope = #{searchscope},</if>
             <if test="deptInfo != null and deptInfo != ''">dept_info=#{deptInfo},</if>
             <if test="hospInfo != null and hospInfo != ''">hosp_info=#{hospInfo},</if>
+            <if test="idCard != null and idCard != ''">id_card=#{idCard},</if>
             update_time = sysdate()
         </set>
         where user_id = #{userId}
diff --git a/smartor/pom.xml b/smartor/pom.xml
index ba50b0b..2a8bfb2 100644
--- a/smartor/pom.xml
+++ b/smartor/pom.xml
@@ -130,6 +130,11 @@
             <artifactId>axis-jaxrpc</artifactId>
             <version>1.4</version>
         </dependency>
+        <dependency>
+            <groupId>com.jcraft</groupId>
+            <artifactId>jsch</artifactId>
+            <version>0.1.54</version>
+        </dependency>
     </dependencies>
 
 
diff --git a/smartor/src/main/java/com/smartor/common/FtpService.java b/smartor/src/main/java/com/smartor/common/FtpService.java
new file mode 100644
index 0000000..066814d
--- /dev/null
+++ b/smartor/src/main/java/com/smartor/common/FtpService.java
@@ -0,0 +1,119 @@
+package com.smartor.common;
+
+import com.jcraft.jsch.ChannelSftp;
+import com.jcraft.jsch.JSch;
+import com.jcraft.jsch.Session;
+import lombok.extern.slf4j.Slf4j;
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.util.Vector;
+
+@Slf4j
+@Component
+public class FtpService {
+
+    @Value("${FTP_SERVER}")
+    private String FTP_SERVER;
+
+    @Value("${FTP_USERNAME}")
+    private String FTP_USERNAME;
+
+    @Value("${FTP_PASSWORD}")
+    private String FTP_PASSWORD;
+
+
+    public void downloadFolder(String remoteDir, String localDir) {
+        Session session = null;
+        ChannelSftp channelSftp = null;
+
+        try {
+            // 1. 鍒涘缓 JSch 瀹炰緥骞惰缃細璇�
+            JSch jsch = new JSch();
+            session = jsch.getSession(FTP_USERNAME, FTP_SERVER, 8094);
+            session.setPassword(FTP_PASSWORD);
+
+            // 璺宠繃涓绘満瀵嗛挜妫�鏌�
+            session.setConfig("StrictHostKeyChecking", "no");
+
+            // 2. 杩炴帴鍒� SFTP 鏈嶅姟鍣�
+            session.connect();
+            channelSftp = (ChannelSftp) session.openChannel("sftp");
+            channelSftp.connect();
+
+            // 3. 寮�濮嬮�掑綊涓嬭浇
+            downloadDirectory(channelSftp, remoteDir, localDir);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            // 4. 鍏抽棴杩炴帴
+            if (channelSftp != null) {
+                channelSftp.disconnect();
+            }
+            if (session != null) {
+                session.disconnect();
+            }
+        }
+    }
+
+    /**
+     * 閫掑綊涓嬭浇杩滅▼鐩綍鍒版湰鍦�
+     *
+     * @param channelSftp SFTP 閫氶亾
+     * @param remoteDir   杩滅▼鐩綍璺緞
+     * @param localDir    鏈湴鐩綍璺緞
+     * @throws Exception 寮傚父
+     */
+    private static void downloadDirectory(ChannelSftp channelSftp, String remoteDir, String localDir) throws Exception {
+        // 纭繚鏈湴鐩綍瀛樺湪
+        File localDirectory = new File(localDir);
+        if (!localDirectory.exists()) {
+            localDirectory.mkdirs();
+        }
+
+        // 鍒楀嚭杩滅▼鐩綍涓殑鎵�鏈夋枃浠跺拰鏂囦欢澶�
+        Vector<ChannelSftp.LsEntry> entries = channelSftp.ls(remoteDir);
+
+        for (ChannelSftp.LsEntry entry : entries) {
+            String fileName = entry.getFilename();
+
+            // 璺宠繃 "." 鍜� ".."
+            if (".".equals(fileName) || "..".equals(fileName)) {
+                continue;
+            }
+
+            String remoteFilePath = remoteDir + "/" + fileName;
+            String localFilePath = localDir + File.separator + fileName;
+
+            if (entry.getAttrs().isDir()) {
+                // 濡傛灉鏄枃浠跺す锛岄�掑綊涓嬭浇
+                downloadDirectory(channelSftp, remoteFilePath, localFilePath);
+            } else {
+                // 濡傛灉鏄枃浠讹紝瑕嗙洊涓嬭浇
+                File localFile = new File(localFilePath);
+
+                // 濡傛灉鏈湴鏂囦欢宸插瓨鍦紝鍏堝垹闄�
+                if (localFile.exists()) {
+                    localFile.delete();
+                }
+
+                try (FileOutputStream fos = new FileOutputStream(localFile)) {
+                    channelSftp.get(remoteFilePath, fos);
+                    log.error("鏂囦欢涓嬭浇鎴愬姛锛歿}", remoteFilePath);
+                } catch (Exception e) {
+                    System.err.println("鏂囦欢涓嬭浇澶辫触: " + remoteFilePath);
+                    e.printStackTrace();
+                }
+            }
+        }
+    }
+//
+//    @Test
+//    public void aa() {
+//        downloadFolder("/", "D:\\ruoyi\\uploadPath\\upload\\vadio\\voice");
+//    }
+}
diff --git a/smartor/src/main/java/com/smartor/common/SendService.java b/smartor/src/main/java/com/smartor/common/SendService.java
index ee78315..4eef100 100644
--- a/smartor/src/main/java/com/smartor/common/SendService.java
+++ b/smartor/src/main/java/com/smartor/common/SendService.java
@@ -1,12 +1,8 @@
 package com.smartor.common;
 
-import com.alibaba.fastjson2.JSON;
-import com.alibaba.fastjson2.JSONObject;
-import com.aliyun.dysmsapi20170525.models.SendSmsResponseBody;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.gson.Gson;
 import com.ruoyi.common.utils.http.HttpUtils;
 import com.smartor.domain.*;
 import com.smartor.mapper.PatWildcardMapper;
@@ -23,12 +19,9 @@
 import java.io.UnsupportedEncodingException;
 import java.lang.reflect.Field;
 import java.net.URLEncoder;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.UUID;
 
 /**
  * 鍙戦�佹湇鍔″伐鍏风被
diff --git a/smartor/src/main/java/com/smartor/domain/IvrTaskTemplate.java b/smartor/src/main/java/com/smartor/domain/IvrTaskTemplate.java
index 50a6bfb..1760a1e 100644
--- a/smartor/src/main/java/com/smartor/domain/IvrTaskTemplate.java
+++ b/smartor/src/main/java/com/smartor/domain/IvrTaskTemplate.java
@@ -147,6 +147,12 @@
     private Date addTime;
 
     /**
+     * 鏄惁鏄暱鏈熸ā鏉匡細  0锛氫笉鏄�    1锛氭槸
+     */
+    @ApiModelProperty(value = "鏄惁鏄暱鏈熸ā鏉匡細  0锛氫笉鏄�    1锛氭槸")
+    private String longTemp;
+
+    /**
      * 淇敼鐢ㄦ埛ID
      */
     @Excel(name = "淇敼鐢ㄦ埛ID")
@@ -382,7 +388,6 @@
      */
     @ApiModelProperty(value = "閮ㄩ棬缂栫爜")
     private String deptCode;
-
 
 
     /**
diff --git a/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateVO.java b/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateVO.java
index 7260322..d9a48fe 100644
--- a/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateVO.java
+++ b/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateVO.java
@@ -397,6 +397,12 @@
     @ApiModelProperty(value = "閮ㄩ棬缂栫爜")
     private String deptCode;
 
+    /**
+     * 鏄惁鏄暱鏈熸ā鏉匡細  0锛氫笉鏄�    1锛氭槸
+     */
+    @ApiModelProperty(value = "鏄惁鏄暱鏈熸ā鏉匡細  0锛氫笉鏄�    1锛氭槸")
+    private String longTemp;
+
 
     /**
      * 鍏佽閲嶆嫧娆℃暟
diff --git a/smartor/src/main/java/com/smartor/domain/PatArchive.java b/smartor/src/main/java/com/smartor/domain/PatArchive.java
index ffbfaa9..afc2400 100644
--- a/smartor/src/main/java/com/smartor/domain/PatArchive.java
+++ b/smartor/src/main/java/com/smartor/domain/PatArchive.java
@@ -331,4 +331,36 @@
     @Excel(name = " 鍑洪櫌鏂瑰紡鍚嶇О ")
     private String outWayName;
 
+    @ApiModelProperty("鐓ф姢鍦烘墍锛�1瀹跺涵   2鍏昏�佹満鏋�")
+    @Excel(name = " 鐓ф姢鍦烘墍锛�1瀹跺涵   2鍏昏�佹満鏋� ")
+    private String careFacilities;
+
+    @ApiModelProperty("鐓ф姢鍦烘墍锛�1瀹跺涵   2鍏昏�佹満鏋�")
+    @Excel(name = " 鐓ф姢鍦烘墍锛�1瀹跺涵   2鍏昏�佹満鏋� ")
+    private String casePath;
+
+    @ApiModelProperty("鍙楁暀鑲茬▼搴�")
+    @Excel(name = "鍙楁暀鑲茬▼搴�")
+    private String degreeOfEducation;
+
+    @ApiModelProperty("濠氬Щ鐘跺喌")
+    @Excel(name = "濠氬Щ鐘跺喌")
+    private String maritalStatus;
+
+    @ApiModelProperty("瀹跺涵浜哄潎鏀跺叆")
+    @Excel(name = "瀹跺涵浜哄潎鏀跺叆")
+    private String income;
+
+    @ApiModelProperty("鍖讳繚绫诲瀷")
+    @Excel(name = "鍖讳繚绫诲瀷")
+    private String medicareType;
+
+    @ApiModelProperty("涓昏鐓ф姢浜�")
+    @Excel(name = "涓昏鐓ф姢浜�")
+    private String carePerson;
+
+    @ApiModelProperty("涓昏鐓ф姢浜哄勾榫�")
+    @Excel(name = "涓昏鐓ф姢浜哄勾榫�")
+    private String casePersonAge;
+
 }
diff --git a/smartor/src/main/java/com/smartor/domain/PatArchiveImport.java b/smartor/src/main/java/com/smartor/domain/PatArchiveImport.java
index 8c9203f..bd4f180 100644
--- a/smartor/src/main/java/com/smartor/domain/PatArchiveImport.java
+++ b/smartor/src/main/java/com/smartor/domain/PatArchiveImport.java
@@ -35,21 +35,21 @@
      * 璇佷欢鍙风爜
      */
     @ApiModelProperty("璇佷欢鍙风爜")
-    @Excel(name = "璇佷欢鍙风爜(蹇呭~)",cellType = Excel.ColumnType.STRING)
+    @Excel(name = "璇佷欢鍙风爜(蹇呭~)", cellType = Excel.ColumnType.STRING)
     private String idcardno;
 
     /**
      * 鎵嬫満鍙风爜
      */
     @ApiModelProperty("鎵嬫満鍙风爜")
-    @Excel(name = "鎵嬫満鍙风爜(蹇呭~)",cellType = Excel.ColumnType.STRING)
+    @Excel(name = "鎵嬫満鍙风爜(蹇呭~)", cellType = Excel.ColumnType.STRING)
     private String telcode;
 
     /**
      * 鎵规鍚嶇О
      */
     @ApiModelProperty("鎵规鍚嶇О")
-    @Excel(name = "鎵规鍚嶇О",cellType = Excel.ColumnType.STRING)
+    @Excel(name = "鎵规鍚嶇О", cellType = Excel.ColumnType.STRING)
     private String batchName;
 
 
@@ -57,7 +57,7 @@
      * 鎮h�呯紪鍙�
      */
     @ApiModelProperty("鎮h�呯紪鍙�")
-    @Excel(name = "鎮h�呯紪鍙�",cellType = Excel.ColumnType.STRING)
+    @Excel(name = "鎮h�呯紪鍙�", cellType = Excel.ColumnType.STRING)
     private String patientno;
 
     /**
@@ -83,6 +83,13 @@
     @Excel(name = "骞撮緞")
     private Long age;
 
+    /**
+     * 鏄惁鍒涘缓甯愬彿
+     */
+    @ApiModelProperty("鏄惁鍒涘缓甯愬彿")
+    @Excel(name = "鏄惁鍒涘缓甯愬彿锛�1 鍒涘缓锛堥粯璁わ級   2涓嶅垱寤�")
+    private Long account = 1L;
+
 
     /**
      * 寰俊openid
@@ -103,5 +110,17 @@
     @ApiModelProperty("鎵规鍙�")
     private String batchNo;
 
+    /**
+     * pageNum
+     */
+    @ApiModelProperty("pageNum")
+    private Integer pageNum;
+
+    /**
+     * pageSize
+     */
+    @ApiModelProperty("pageSize")
+    private Integer pageSize;
+
 }
 
diff --git a/smartor/src/main/java/com/smartor/domain/PatArchiveVO.java b/smartor/src/main/java/com/smartor/domain/PatArchiveVO.java
index acc4209..a6be5e7 100644
--- a/smartor/src/main/java/com/smartor/domain/PatArchiveVO.java
+++ b/smartor/src/main/java/com/smartor/domain/PatArchiveVO.java
@@ -19,7 +19,7 @@
  * @author smartor
  * @date 2023-03-04
  */
-@ApiModel(value = "PatArchiveVO" , description = "鎮h�呮。妗堝璞�")
+@ApiModel(value = "PatArchiveVO", description = "鎮h�呮。妗堝璞�")
 @Data
 public class PatArchiveVO extends BaseEntity {
 
@@ -87,7 +87,7 @@
      */
     @ApiModelProperty("鐢熸棩")
     @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = " 鐢熸棩 " , width = 30, dateFormat = "yyyy-MM-dd")
+    @Excel(name = " 鐢熸棩 ", width = 30, dateFormat = "yyyy-MM-dd")
     private Date birthdate;
 
     /**
@@ -95,7 +95,7 @@
      */
     @ApiModelProperty("鍏ラ櫌鏃堕棿")
     @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = " 鐢熸棩 " , width = 30, dateFormat = "yyyy-MM-dd")
+    @Excel(name = " 鐢熸棩 ", width = 30, dateFormat = "yyyy-MM-dd")
     private Date inhosptime;
 
     /**
@@ -185,14 +185,14 @@
      * 鏍囩
      */
     @ApiModelProperty("鏍囩")
-    @Excel(name = " 鏍囩 " , cellType = Excel.ColumnType.STRING)
+    @Excel(name = " 鏍囩 ", cellType = Excel.ColumnType.STRING)
     private String tag;
 
     /**
      * 鏍囩
      */
     @ApiModelProperty("鏍囩id")
-    @Excel(name = " 鏍囩id " , cellType = Excel.ColumnType.STRING)
+    @Excel(name = " 鏍囩id ", cellType = Excel.ColumnType.STRING)
     private Long tagid;
 
     @ApiModelProperty("鏍囩闆嗗悎")
@@ -202,7 +202,7 @@
      * 鏍囩
      */
     @ApiModelProperty("鎮h�呯被鍨�")
-    @Excel(name = " 鎮h�呯被鍨� " , cellType = Excel.ColumnType.STRING)
+    @Excel(name = " 鎮h�呯被鍨� ", cellType = Excel.ColumnType.STRING)
     private String pattype;
 
     /**
@@ -258,7 +258,6 @@
     @ApiModelProperty("鍑洪櫌鐥呭尯缂栧彿")
     private String leavehospitaldistrictcode;
 
-
     /**
      * 鍑洪櫌鏂瑰紡搴忓彿
      */
@@ -272,6 +271,36 @@
     @ApiModelProperty("鍑洪櫌鏂瑰紡鍚嶇О")
     @Excel(name = " 鍑洪櫌鏂瑰紡鍚嶇О ")
     private String outWayName;
+    @ApiModelProperty("鐓ф姢鍦烘墍锛�1瀹跺涵   2鍏昏�佹満鏋�")
+    @Excel(name = " 鐓ф姢鍦烘墍锛�1瀹跺涵   2鍏昏�佹満鏋� ")
+    private String careFacilities;
 
+    @ApiModelProperty("鐓ф姢鍦烘墍锛�1瀹跺涵   2鍏昏�佹満鏋�")
+    @Excel(name = " 鐓ф姢鍦烘墍锛�1瀹跺涵   2鍏昏�佹満鏋� ")
+    private String casePath;
+
+    @ApiModelProperty("鍙楁暀鑲茬▼搴�")
+    @Excel(name = "鍙楁暀鑲茬▼搴�")
+    private String degreeOfEducation;
+
+    @ApiModelProperty("濠氬Щ鐘跺喌")
+    @Excel(name = "濠氬Щ鐘跺喌")
+    private String maritalStatus;
+
+    @ApiModelProperty("瀹跺涵浜哄潎鏀跺叆")
+    @Excel(name = "瀹跺涵浜哄潎鏀跺叆")
+    private String income;
+
+    @ApiModelProperty("鍖讳繚绫诲瀷")
+    @Excel(name = "鍖讳繚绫诲瀷")
+    private String medicareType;
+
+    @ApiModelProperty("涓昏鐓ф姢浜�")
+    @Excel(name = "涓昏鐓ф姢浜�")
+    private String carePerson;
+
+    @ApiModelProperty("涓昏鐓ф姢浜哄勾榫�")
+    @Excel(name = "涓昏鐓ф姢浜哄勾榫�")
+    private String casePersonAge;
 
 }
diff --git a/smartor/src/main/java/com/smartor/domain/PatMedInhosp.java b/smartor/src/main/java/com/smartor/domain/PatMedInhosp.java
index 09472de..1c11978 100644
--- a/smartor/src/main/java/com/smartor/domain/PatMedInhosp.java
+++ b/smartor/src/main/java/com/smartor/domain/PatMedInhosp.java
@@ -370,4 +370,11 @@
      */
     @ApiModelProperty(value = "缁撴潫鍏ラ櫌鏃ユ湡")
     private Date endInHospTime;
+
+    @ApiModelProperty(value = "鏄惁澶栭儴瀵煎叆锛�0涓嶆槸    1鏄�")
+    private Integer outImport = 0;
+
+
+    @ApiModelProperty(value = "鏌ヨ绫诲瀷锛�1鍏ㄩ儴   2鍑洪櫌   3鍏ラ櫌   4闂ㄨ瘖   5澶栭儴鎮h�� ")
+    private Integer queryType = 1;
 }
diff --git a/smartor/src/main/java/com/smartor/domain/PatTaskRelevance.java b/smartor/src/main/java/com/smartor/domain/PatTaskRelevance.java
index f7d2351..571c1f7 100644
--- a/smartor/src/main/java/com/smartor/domain/PatTaskRelevance.java
+++ b/smartor/src/main/java/com/smartor/domain/PatTaskRelevance.java
@@ -299,4 +299,10 @@
     @ApiModelProperty(value = "瀹屾垚鏃堕棿")
     private Date finishtime;
 
+    /**
+     * 闀挎湡浠诲姟锛岀粰鎮h�呭彂閫佺殑鏃堕棿
+     */
+    @Excel(name = " 闀挎湡浠诲姟锛岀粰鎮h�呭彂閫佺殑鏃堕棿")
+    @ApiModelProperty(value = "闀挎湡浠诲姟锛岀粰鎮h�呭彂閫佺殑鏃堕棿")
+    private Date longSendTime;
 }
diff --git a/smartor/src/main/java/com/smartor/domain/PhoneCallBackYQVO.java b/smartor/src/main/java/com/smartor/domain/PhoneCallBackYQVO.java
index f295227..8acc519 100644
--- a/smartor/src/main/java/com/smartor/domain/PhoneCallBackYQVO.java
+++ b/smartor/src/main/java/com/smartor/domain/PhoneCallBackYQVO.java
@@ -16,7 +16,7 @@
      * 鍙互瀵瑰綋鍓嶉�氶亾鐨勯煶閲忚繘琛岄�傚綋璋冩暣,鍙栧�艰寖鍥淬��-4,4銆�
      */
     @ApiModelProperty(value = "鍙互瀵瑰綋鍓嶉�氶亾鐨勯煶閲忚繘琛岄�傚綋璋冩暣,鍙栧�艰寖鍥淬��-4,4銆�")
-    private Integer volume = 0;
+    private Integer volume;
 
     /**
      * 鍙互璋冩暣褰撳墠閫氳瘽鐨勯潤榛樺洖璋冮棿闅旀椂闂达紝鍗曚綅涓烘绉掞紝榛樿涓�3000
diff --git a/smartor/src/main/java/com/smartor/domain/ServiceTaskVO.java b/smartor/src/main/java/com/smartor/domain/ServiceTaskVO.java
index 451d9f8..9a406dd 100644
--- a/smartor/src/main/java/com/smartor/domain/ServiceTaskVO.java
+++ b/smartor/src/main/java/com/smartor/domain/ServiceTaskVO.java
@@ -339,4 +339,5 @@
     @ApiModelProperty(value = "琛ュ伩鏃堕棿锛堟湭棰嗗彇 锛屽彂璧疯ˉ鍋匡細浠庝换鍔″彂閫佹垚鍔熷紑濮嬶紝compensate_date鍒嗛挓鍚庯紝鎮h�呬粛鏈鍙栵級鍗曚綅锛氬垎閽� ")
     @Excel(name = " 琛ュ伩鏃堕棿锛堟湭棰嗗彇 锛屽彂璧疯ˉ鍋匡細浠庝换鍔″彂閫佹垚鍔熷紑濮嬶紝compensate_date鍒嗛挓鍚庯紝鎮h�呬粛鏈鍙栵級鍗曚綅锛氬垎閽� ")
     private String compensateDate;
+
 }
diff --git a/smartor/src/main/java/com/smartor/mapper/IvrLibaScriptTargetoptionMapper.java b/smartor/src/main/java/com/smartor/mapper/IvrLibaScriptTargetoptionMapper.java
index 9a72ba3..81e6f19 100644
--- a/smartor/src/main/java/com/smartor/mapper/IvrLibaScriptTargetoptionMapper.java
+++ b/smartor/src/main/java/com/smartor/mapper/IvrLibaScriptTargetoptionMapper.java
@@ -44,6 +44,7 @@
      * @return 缁撴灉
      */
     public int updateIvrLibaScriptTargetoption(IvrLibaScriptTargetoption ivrLibaScriptTargetoption);
+    public int updateDynam(IvrLibaScriptTargetoption ivrLibaScriptTargetoption);
 
     /**
      * 鍒犻櫎闂璇濇湳鎸囨爣閫夐」搴�
diff --git a/smartor/src/main/java/com/smartor/mapper/IvrLibaTemplateTargetoptionMapper.java b/smartor/src/main/java/com/smartor/mapper/IvrLibaTemplateTargetoptionMapper.java
index 626e634..8a744a6 100644
--- a/smartor/src/main/java/com/smartor/mapper/IvrLibaTemplateTargetoptionMapper.java
+++ b/smartor/src/main/java/com/smartor/mapper/IvrLibaTemplateTargetoptionMapper.java
@@ -45,6 +45,8 @@
      */
     public int updateIvrLibaTemplateTargetoption(IvrLibaTemplateTargetoption ivrLibaTemplateTargetoption);
 
+    public int updateDynamiccruxs(IvrLibaTemplateTargetoption ivrLibaTemplateTargetoption);
+
     /**
      * 鍒犻櫎妯℃澘鎸囨爣閫夐」搴�
      *
diff --git a/smartor/src/main/java/com/smartor/mapper/PatArchiveImportMapper.java b/smartor/src/main/java/com/smartor/mapper/PatArchiveImportMapper.java
index 66df000..41038ec 100644
--- a/smartor/src/main/java/com/smartor/mapper/PatArchiveImportMapper.java
+++ b/smartor/src/main/java/com/smartor/mapper/PatArchiveImportMapper.java
@@ -1,6 +1,9 @@
 package com.smartor.mapper;
 
 import java.util.List;
+
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.core.domain.entity.SysUserRole;
 import org.apache.ibatis.annotations.Mapper;
 import com.smartor.domain.PatArchiveImport;
 
@@ -11,8 +14,7 @@
  * @date 2024-09-05
  */
 @Mapper
-public interface PatArchiveImportMapper
-{
+public interface PatArchiveImportMapper {
     /**
      * 鏌ヨExcel瀵煎叆鎮h�呮。妗�
      *
@@ -60,4 +62,28 @@
      * @return 缁撴灉
      */
     public int deletePatArchiveImportByIds(Long[] ids);
+
+    /**
+     * 鏍¢獙鐢ㄦ埛鍚嶇О鏄惁鍞竴
+     *
+     * @param idCard 鐢ㄦ埛鍚嶇О
+     * @return 缁撴灉
+     */
+    public SysUser checkUserExist(String idCard);
+
+
+    /**
+     * 鏂板鐢ㄦ埛淇℃伅
+     *
+     * @param user 鐢ㄦ埛淇℃伅
+     * @return 缁撴灉
+     */
+    public int insertUser(SysUser user);
+
+    /**
+     * 瑙掕壊鏂板
+     * @param sysUserRole
+     * @return
+     */
+    public int insertUserRole(SysUserRole sysUserRole);
 }
diff --git a/smartor/src/main/java/com/smartor/service/IPatArchiveImportService.java b/smartor/src/main/java/com/smartor/service/IPatArchiveImportService.java
index e34fffd..567d664 100644
--- a/smartor/src/main/java/com/smartor/service/IPatArchiveImportService.java
+++ b/smartor/src/main/java/com/smartor/service/IPatArchiveImportService.java
@@ -2,6 +2,7 @@
 
 import java.util.List;
 
+import com.ruoyi.common.core.domain.entity.SysUser;
 import com.smartor.domain.PatArchiveImport;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -60,5 +61,5 @@
      */
     public int deletePatArchiveImportById(Long id);
 
-    public List<PatArchiveImport> importPatInfo(MultipartFile multipartFile);
+    public List<PatArchiveImport> importPatInfo(MultipartFile multipartFile,SysUser user);
 }
diff --git a/smartor/src/main/java/com/smartor/service/IPatMedInhospService.java b/smartor/src/main/java/com/smartor/service/IPatMedInhospService.java
index d4df031..1d7149c 100644
--- a/smartor/src/main/java/com/smartor/service/IPatMedInhospService.java
+++ b/smartor/src/main/java/com/smartor/service/IPatMedInhospService.java
@@ -1,10 +1,12 @@
 package com.smartor.service;
 
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
 import com.smartor.domain.PatMedInhosp;
 import com.smartor.domain.PatMedInhospVO;
 import com.smartor.domain.PatMedReq;
 import com.smartor.domain.PatMedRes;
+import org.springframework.web.bind.annotation.RequestBody;
 
 import java.util.List;
 import java.util.Map;
@@ -93,4 +95,11 @@
      * @return
      */
     public List<PatMedRes> getDeptRanking(PatMedReq patMedReq);
+
+    /**
+     * 鍖绘姢涓庢偅鑰呭叧鑱斿叧绯�
+     * @param patMedInhosp
+     * @return
+     */
+    public List<PatMedInhosp> getDocAndPat(PatMedInhosp patMedInhosp);
 }
diff --git a/smartor/src/main/java/com/smartor/service/IServiceSubtaskDetailService.java b/smartor/src/main/java/com/smartor/service/IServiceSubtaskDetailService.java
index 365c09b..f27826e 100644
--- a/smartor/src/main/java/com/smartor/service/IServiceSubtaskDetailService.java
+++ b/smartor/src/main/java/com/smartor/service/IServiceSubtaskDetailService.java
@@ -3,6 +3,7 @@
 import com.smartor.domain.ServiceSubtaskDetail;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 璇煶浠诲姟鍛煎彨鏄庣粏Service鎺ュ彛
@@ -25,7 +26,7 @@
      * @param serviceSubtaskDetail 璇煶浠诲姟鍛煎彨鏄庣粏
      * @return 璇煶浠诲姟鍛煎彨鏄庣粏闆嗗悎
      */
-    public List<ServiceSubtaskDetail> selectServiceSubtaskDetailList( ServiceSubtaskDetail serviceSubtaskDetail);
+    public Map<String, Object> selectServiceSubtaskDetailList(ServiceSubtaskDetail serviceSubtaskDetail);
 
     /**
      * 鏂板璇煶浠诲姟鍛煎彨鏄庣粏
diff --git a/smartor/src/main/java/com/smartor/service/IServiceSubtaskService.java b/smartor/src/main/java/com/smartor/service/IServiceSubtaskService.java
index 4641b5f..1b990c4 100644
--- a/smartor/src/main/java/com/smartor/service/IServiceSubtaskService.java
+++ b/smartor/src/main/java/com/smartor/service/IServiceSubtaskService.java
@@ -1,7 +1,9 @@
 package com.smartor.service;
 
+import com.ruoyi.common.core.domain.AjaxResult;
 import com.smartor.domain.*;
 import com.smartor.domain.ServiceSubtask;
+import org.springframework.web.bind.annotation.RequestBody;
 
 import java.util.List;
 import java.util.Map;
@@ -103,6 +105,8 @@
 
     public Integer saveQuestionAnswerPhone(ServiceSubTaskDetailReq serviceSubTaskDetailReq);
 
+    public Integer recordAccept(PhoneCallRecordVO phoneCallRecordVO);
+
     /**
      * 鑾峰彇闅忚銆佸璇婇噺
      *
diff --git a/smartor/src/main/java/com/smartor/service/impl/IvrLibaScriptServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/IvrLibaScriptServiceImpl.java
index 0dce115..1199649 100644
--- a/smartor/src/main/java/com/smartor/service/impl/IvrLibaScriptServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/IvrLibaScriptServiceImpl.java
@@ -156,6 +156,16 @@
                     //淇敼
                     ivrLibaScriptTargetoption.setScriptid(ivrLibaScript.getId());
                     ivrLibaScriptTargetoptionMapper.updateIvrLibaScriptTargetoption(ivrLibaScriptTargetoption);
+                    //濡傛灉瑕佺粰姝e垯缃┖锛屽垯闇�瑕佸崟鐙皟淇敼鏂规硶
+                    if (CollectionUtils.isEmpty(ivrLibaScriptTargetoption.getNodynamiccruxs())) {
+                        ivrLibaScriptTargetoption.setNodynamiccruxsJson(null);
+                        ivrLibaScriptTargetoptionMapper.updateDynam(ivrLibaScriptTargetoption);
+                    }
+                    if (CollectionUtils.isEmpty(ivrLibaScriptTargetoption.getDynamiccruxs())) {
+                        ivrLibaScriptTargetoption.setDynamiccruxsJson(null);
+                        ivrLibaScriptTargetoptionMapper.updateDynam(ivrLibaScriptTargetoption);
+                    }
+
                 }
                 if (ivrLibaScriptTargetoption.getIsoperation() != null && ivrLibaScriptTargetoption.getIsoperation() == 3) {
                     //鍒犻櫎
diff --git a/smartor/src/main/java/com/smartor/service/impl/IvrLibaTemplateServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/IvrLibaTemplateServiceImpl.java
index b88cb6e..7c1d89d 100644
--- a/smartor/src/main/java/com/smartor/service/impl/IvrLibaTemplateServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/IvrLibaTemplateServiceImpl.java
@@ -135,7 +135,7 @@
             ivrLibaTemplateMapper.updateIvrLibaTemplate(ivrLibaTemplate);
             i = ivrLibaTemplate.getId().intValue();
         }
-        log.info("鏂板鎴栦慨鏀规ā鏉胯鎯呯殑id涓猴細{}" , ivrLibaTemplate.getId());
+        log.info("鏂板鎴栦慨鏀规ā鏉胯鎯呯殑id涓猴細{}", ivrLibaTemplate.getId());
 
         //瀵规ā鏉挎爣绛捐繘琛屽鐞�
         if (CollectionUtils.isNotEmpty(ivrLibaTemplateVO.getIvrLibaTemplateTagList())) {
@@ -230,7 +230,7 @@
      * @param tmpID
      */
     private void dealOption(List<IvrLibaTemplateTargetoption> ivrLibaTemplateTargetoptionList, IvrLibaTemplateScript ivrLibaTemplateScript, Long tmpID, Integer isoperation) {
-        log.info("ivrLibaTemplateScript鐨勫�间负锛歿}" , ivrLibaTemplateScript);
+        log.info("ivrLibaTemplateScript鐨勫�间负锛歿}", ivrLibaTemplateScript);
         //瀵规ā鏉挎寚鏍囬�夐」杩涜澶勭悊
         Integer lsIsoperation = isoperation;
         if (CollectionUtils.isNotEmpty(ivrLibaTemplateTargetoptionList)) {
@@ -258,6 +258,16 @@
                     if (CollectionUtils.isNotEmpty(ivrLibaTemplateTargetoption.getNodynamiccruxs()))
                         ivrLibaTemplateTargetoption.setNodynamiccruxsJson(JSON.toJSONString(ivrLibaTemplateTargetoption.getNodynamiccruxs()));
                     ivrLibaTemplateTargetOptionMapper.updateIvrLibaTemplateTargetoption(ivrLibaTemplateTargetoption);
+
+
+                    if (CollectionUtils.isEmpty(ivrLibaTemplateTargetoption.getDynamiccruxs())) {
+                        ivrLibaTemplateTargetoption.setDynamiccruxsJson(null);
+                        ivrLibaTemplateTargetOptionMapper.updateDynamiccruxs(ivrLibaTemplateTargetoption);
+                    }
+                    if (CollectionUtils.isEmpty(ivrLibaTemplateTargetoption.getNodynamiccruxs())) {
+                        ivrLibaTemplateTargetoption.setNodynamiccruxsJson(null);
+                        ivrLibaTemplateTargetOptionMapper.updateDynamiccruxs(ivrLibaTemplateTargetoption);
+                    }
                 } else if (isoperation == 3) {
                     //鍒犻櫎
                     if (ivrLibaTemplateTargetoption.getId() == null) {
@@ -275,12 +285,12 @@
      */
     @Override
     public IvrLibaTemplateVO selectInfoByCondition(IvrLibaTemplateVO ivrLibaTemplateVO) {
-        log.info("鏌ヨ妯℃澘璇︽儏鏍规嵁鏉′欢鐨勫叆鍙備负 : {}" , ivrLibaTemplateVO);
+        log.info("鏌ヨ妯℃澘璇︽儏鏍规嵁鏉′欢鐨勫叆鍙備负 : {}", ivrLibaTemplateVO);
         //鍏堟牴鎹潯浠舵煡璇㈤棶棰樿〃淇℃伅
         IvrLibaTemplate ivrLibaTemplate = DtoConversionUtils.sourceToTarget(ivrLibaTemplateVO, IvrLibaTemplate.class);
         List<IvrLibaTemplate> ivrLibaTemplates = selectIvrLibaTemplateList(ivrLibaTemplate);
         if (CollectionUtils.isEmpty(ivrLibaTemplates)) {
-            log.info("鎻愪緵鐨勬潯浠�,鏌ヨ妯℃澘璇︽儏鏁版嵁涓虹┖锛歿}" , ivrLibaTemplates);
+            log.info("鎻愪緵鐨勬潯浠�,鏌ヨ妯℃澘璇︽儏鏁版嵁涓虹┖锛歿}", ivrLibaTemplates);
             throw new BaseException("鎻愪緵鐨勬潯浠�,鏌ヨ妯℃澘璇︽儏鏁版嵁涓虹┖");
         }
         //瀹氫箟IvrLibaTemplateVO 鐢ㄤ簬杩斿弬
@@ -299,7 +309,7 @@
 
         //閫氳繃璇濇湳ID鑾峰彇閫夐」
         for (IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO : ivrLibaTemplateScriptVOS) {
-            log.error("ivrLibaTemplateScriptVO鐨勪富閿甶d涓猴細{}" , ivrLibaTemplateScriptVO.getId());
+            log.error("ivrLibaTemplateScriptVO鐨勪富閿甶d涓猴細{}", ivrLibaTemplateScriptVO.getId());
             IvrLibaTemplateTargetoption ivrLibaTemplateTargetoption = new IvrLibaTemplateTargetoption();
             ivrLibaTemplateTargetoption.setScriptid(ivrLibaTemplateScriptVO.getId());
             List<IvrLibaTemplateTargetoption> ivrLibaTemplateTargetoptions = ivrLibaTemplateTargetOptionMapper.selectIvrLibaTemplateTargetoptionList(ivrLibaTemplateTargetoption);
diff --git a/smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java
index 0f56d06..598e7f9 100644
--- a/smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java
@@ -78,11 +78,12 @@
     public int saveOrUpdateTempScript(IvrTaskTemplateVO ivrTaskTemplateVO) {
         Integer i = null;
         IvrTaskTemplate ivrTaskTemplate = DtoConversionUtils.sourceToTarget(ivrTaskTemplateVO, IvrTaskTemplate.class);
-        //浼犺繃鏉ョ殑闈欓粯鏃堕棿鏄锛岄渶瑕佹敼鎴愭绉�
-        if (ivrTaskTemplate.getSilencetime() != null)
-            ivrTaskTemplate.setSilencetime(ivrTaskTemplate.getSilencetime() * 1000);
 
         if (ivrTaskTemplateVO.getIsoperation() != null && ivrTaskTemplateVO.getIsoperation() == 1) {
+            //浼犺繃鏉ョ殑闈欓粯鏃堕棿鏄锛岄渶瑕佹敼鎴愭绉�
+            if (ivrTaskTemplate.getSilencetime() != null)
+                ivrTaskTemplate.setSilencetime(ivrTaskTemplate.getSilencetime() * 1000);
+
             //鏂板
             ivrTaskTemplate.setCreateTime(new Date());
             insertIvrTaskTemplate(ivrTaskTemplate);
@@ -93,11 +94,11 @@
             updateIvrTaskTemplate(ivrTaskTemplate);
             i = ivrTaskTemplate.getId().intValue();
         }
-        log.info("鏂板闅忚浠诲姟闅忚妯℃澘鐨刬d涓猴細{}" , ivrTaskTemplate.getId());
+        log.info("鏂板闅忚浠诲姟闅忚妯℃澘鐨刬d涓猴細{}", ivrTaskTemplate.getId());
 
         //瀵规ā鏉胯瘽鏈拰閫夐」杩涜澶勭悊锛堣瘽鏈〃涓庢寚鏍囪〃杩涜鍚堝苟浜嗭紝锛�
         if (CollectionUtils.isNotEmpty(ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList())) {
-            log.error("ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList()鏄惁鏈夋暟鎹搱锛歿}" , ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList());
+            log.error("ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList()鏄惁鏈夋暟鎹搱锛歿}", ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList());
             for (IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO : ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList()) {
                 if (ivrTaskTemplateScriptVO.getIsoperation() != null) {
                     IvrTaskTemplateScript ivrTaskTemplateScript = scriptHandle(ivrTaskTemplate, ivrTaskTemplateScriptVO, ivrTaskTemplateScriptVO.getIsoperation());
@@ -152,16 +153,16 @@
      */
     @Override
     public IvrTaskTemplateVO selectInfoByCondition(IvrTaskTemplateVO ivrTaskTemplateVO) {
-        log.info("鏌ヨ妯℃澘璇︽儏鏍规嵁鏉′欢鐨勫叆鍙備负 : {}" , ivrTaskTemplateVO);
+        log.info("鏌ヨ妯℃澘璇︽儏鏍规嵁鏉′欢鐨勫叆鍙備负 : {}", ivrTaskTemplateVO);
         //鍏堟牴鎹潯浠舵煡璇㈤棶棰樿〃淇℃伅
         IvrTaskTemplate ivrTaskTemplate = DtoConversionUtils.sourceToTarget(ivrTaskTemplateVO, IvrTaskTemplate.class);
         List<IvrTaskTemplate> ivrTaskTemplates = selectIvrTaskTemplateList(ivrTaskTemplate);
         if (CollectionUtils.isEmpty(ivrTaskTemplates)) {
-            log.info("鎻愪緵鐨勬潯浠�,鏌ヨ妯℃澘璇︽儏鏁版嵁涓虹┖锛歿}" , ivrTaskTemplates);
+            log.info("鎻愪緵鐨勬潯浠�,鏌ヨ妯℃澘璇︽儏鏁版嵁涓虹┖锛歿}", ivrTaskTemplates);
             throw new BaseException("鎻愪緵鐨勬潯浠�,鏌ヨ妯℃澘璇︽儏鏁版嵁涓虹┖");
         }
 
-        log.info("ivrLibaTemplates鐨勬煡璇㈢粨鏋滀负:{},鏁伴噺涓� : {}" , ivrTaskTemplates.get(0), ivrTaskTemplates.size());
+        log.info("ivrLibaTemplates鐨勬煡璇㈢粨鏋滀负:{},鏁伴噺涓� : {}", ivrTaskTemplates.get(0), ivrTaskTemplates.size());
         //瀹氫箟IvrLibaTemplateVO 鐢ㄤ簬杩斿弬
         IvrTaskTemplateVO templateVO = DtoConversionUtils.sourceToTarget(ivrTaskTemplates.get(0), IvrTaskTemplateVO.class);
 //
@@ -178,7 +179,7 @@
 
         //閫氳繃璇濇湳ID鑾峰彇閫夐」
         for (IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO : ivrTaskTemplateScriptVOS) {
-            log.info("ivrLibaTemplateScriptVO鐨勪富閿甶d涓猴細{}" , ivrTaskTemplateScriptVO.getId());
+            log.info("ivrLibaTemplateScriptVO鐨勪富閿甶d涓猴細{}", ivrTaskTemplateScriptVO.getId());
             IvrTaskTemplateTargetoption ivrTaskTemplateTargetoption = new IvrTaskTemplateTargetoption();
             ivrTaskTemplateTargetoption.setScriptid(ivrTaskTemplateScriptVO.getId());
             List<IvrTaskTemplateTargetoption> ivrTaskTemplateTargetoptions = ivrTaskTemplateTargetoptionMapper.selectIvrTaskTemplateTargetoptionList(ivrTaskTemplateTargetoption);
@@ -239,7 +240,7 @@
     }
 
     private void dealOption(List<IvrTaskTemplateTargetoption> ivrTaskTemplateTargetoptionList, IvrTaskTemplateScript ivrTaskTemplateScript, Long tmpID, Integer isoperation) {
-        log.info("ivrLibaTemplateScript鐨勫�间负锛歿}" , ivrTaskTemplateScript);
+        log.info("ivrLibaTemplateScript鐨勫�间负锛歿}", ivrTaskTemplateScript);
         Integer lsisoperation = isoperation;
         //瀵规ā鏉挎寚鏍囬�夐」杩涜澶勭悊
         if (CollectionUtils.isNotEmpty(ivrTaskTemplateTargetoptionList)) {
diff --git a/smartor/src/main/java/com/smartor/service/impl/PatArchiveImportServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/PatArchiveImportServiceImpl.java
index 1a3a169..4307289 100644
--- a/smartor/src/main/java/com/smartor/service/impl/PatArchiveImportServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/PatArchiveImportServiceImpl.java
@@ -1,16 +1,21 @@
 package com.smartor.service.impl;
 
+import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.core.domain.entity.SysUserRole;
 import com.smartor.domain.PatArchiveImport;
 import com.smartor.mapper.PatArchiveImportMapper;
 import com.smartor.service.IPatArchiveImportService;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.ObjectUtils;
-import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
 
 import java.text.DecimalFormat;
@@ -30,6 +35,7 @@
 public class PatArchiveImportServiceImpl implements IPatArchiveImportService {
     @Autowired
     private PatArchiveImportMapper patArchiveImportMapper;
+
 
     /**
      * 鏌ヨExcel瀵煎叆鎮h�呮。妗�
@@ -100,7 +106,7 @@
     }
 
     @Override
-    public List<PatArchiveImport> importPatInfo(MultipartFile multipartFile) {
+    public List<PatArchiveImport> importPatInfo(MultipartFile multipartFile, SysUser user) {
         //鐢ㄤ簬杩斿洖
         List<PatArchiveImport> patArchiveImports = new ArrayList<>();
 
@@ -144,7 +150,11 @@
                     }
 
                     boolean contains = qc.contains(row.getCell(1).toString());
-                    if (contains) continue;
+                    PatArchiveImport pt = new PatArchiveImport();
+                    pt.setIdcardno(patArchiveImport.getIdcardno());
+                    pt.setDelFlag("0");
+                    List<PatArchiveImport> patArchiveImports1 = patArchiveImportMapper.selectPatArchiveImportList(pt);
+                    if (contains || CollectionUtils.isNotEmpty(patArchiveImports1)) continue;
                 }
 
                 if (ObjectUtils.isNotEmpty(row.getCell(2)) && StringUtils.isNotEmpty(row.getCell(2) + "")) {
@@ -171,11 +181,42 @@
                     patArchiveImport.setAge(Long.valueOf(row.getCell(7).toString()));
                 }
 
+
                 patArchiveImport.setCreateTime(new Date());
                 patArchiveImport.setUpdateTime(new Date());
                 //鎵归噺鍙凤紙褰撳墠鏃堕棿锛�
                 patArchiveImport.setBatchNo(new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()));
+                patArchiveImport.setCreateBy(user.getNickName());
                 insertPatArchiveImport(patArchiveImport);
+                //缁欏綋鍓嶅鍏ユ偅鑰咃紝娉ㄥ唽甯愬彿  sys_user  sys_user_role
+                if (patArchiveImport.getAccount() == 1) {
+                    //鏌ヨ涓�涓嬶紝璇ユ偅鑰呮槸鍚﹀凡缁忓湪琛ㄩ噷鍒涘缓浜嗗笎鍙�
+                    SysUser sysUser = patArchiveImportMapper.checkUserExist(patArchiveImport.getIdcardno());
+                    if (ObjectUtils.isEmpty(sysUser)) {
+                        sysUser = new SysUser();
+                        //濡傛灉涓虹┖锛屽垯杩涜鏂板sys_user   sys_role
+                        sysUser.setIdCard(patArchiveImport.getIdcardno());
+                        int start = patArchiveImport.getIdcardno().length() - 6;
+                        String lastSixDigits = patArchiveImport.getIdcardno().substring(start, start + 6);
+                        sysUser.setUserName(lastSixDigits);
+                        //瀵嗙爜锛歺h@123456
+                        sysUser.setPassword("$2a$10$zja67LEWTESHutljd8bqEeRy.VgWb./8iJPpFR6VjTUa7ZYNfRRrO");
+                        sysUser.setPhonenumber(patArchiveImport.getTelcode());
+                        sysUser.setUserType("鎮h��");
+                        sysUser.setDeptId(395L);
+                        sysUser.setNickName(patArchiveImport.getName());
+                        sysUser.setCreateTime(new Date());
+                        sysUser.setCreateBy(user.getNickName());
+                        sysUser.setUpdateTime(new Date());
+                        sysUser.setUpdateBy(user.getNickName());
+                        patArchiveImportMapper.insertUser(sysUser);
+                        //灏嗘偅鑰呬笌瑙掕壊缁戝畾
+                        SysUserRole sysUserRole = new SysUserRole();
+                        sysUserRole.setUserId(sysUser.getUserId());
+                        sysUserRole.setRoleId(6L);
+                        patArchiveImportMapper.insertUserRole(sysUserRole);
+                    }
+                }
 
                 patArchiveImports.add(patArchiveImport);
             }
diff --git a/smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java
index 8dd64c6..d4e6cfb 100644
--- a/smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java
@@ -41,13 +41,15 @@
     private TemplateDeptMapper templateDeptMapper;
 
     @Autowired
-    private IvrTaskTemplateMapper ivrTaskTemplateMapper;
+    private PatArchiveImportMapper patArchiveImportMapper;
 
     @Autowired
     private Icd10AssociationMapper icd10AssociationMapper;
 
     @Autowired
     private SvyTaskTemplateMapper svyTaskTemplateMapper;
+    @Autowired
+    private IvrTaskTemplateMapper ivrTaskTemplateMappte;
 
     @Autowired
     private ServiceTaskMapper serviceTaskMapper;
@@ -211,18 +213,18 @@
             TemplateDept templateDept = new TemplateDept();
             templateDept.setDeptCode(patMedInhosp1.getLeaveldeptcode());
             templateDept.setLongTemp(1);
-            templateDept.setType(11L);
+            templateDept.setType(21L);
             List<TemplateDept> templateDepts = templateDeptMapper.selectTemplateDeptList(templateDept);
             //鏍规嵁鑾峰彇鐨勯暱鏈熶换鍔℃ā鏉縄D锛岃幏鍙栦换鍔℃ā鏉胯鎯�
-            List<SvyTaskTemplate> svyTaskTemplates = new ArrayList<>();
+            List<IvrTaskTemplate> ivrTaskTemplates = new ArrayList<>();
             if (CollectionUtils.isNotEmpty(templateDepts)) {
                 for (TemplateDept templateDept1 : templateDepts) {
-                    SvyTaskTemplate svyTaskTemplate = svyTaskTemplateMapper.selectSvyTaskTemplateBySvyid(templateDept1.getTempid());
-                    if (ObjectUtils.isNotEmpty(svyTaskTemplate)) svyTaskTemplates.add(svyTaskTemplate);
+                    IvrTaskTemplate ivrTaskTemplate = ivrTaskTemplateMappte.selectIvrTaskTemplateByID(templateDept1.getTempid());
+                    if (ObjectUtils.isNotEmpty(ivrTaskTemplate)) ivrTaskTemplates.add(ivrTaskTemplate);
                 }
             }
             //濡傛灉閮ㄩ棬妯℃澘涓虹┖锛堟殏瀹氾紝灏嗗嚭鍏ラ櫌琛ㄧ殑check_flag璁剧疆涓�2  锛宭ong_task_reason 璁板綍鍘熷洜锛�
-            if (CollectionUtils.isEmpty(svyTaskTemplates) || svyTaskTemplates.size() == 0) {
+            if (CollectionUtils.isEmpty(ivrTaskTemplates) || ivrTaskTemplates.size() == 0) {
                 patMedInhosp1.setCheckFlag("2");
                 patMedInhosp1.setLongTaskReason("璇ユ偅鑰呮墍鍦ㄧ瀹わ紝鏈厤缃换鍔℃ā鏉�");
                 patMedInhospMapper.updatePatMedInhosp(patMedInhosp1);
@@ -234,31 +236,31 @@
             //缁欎釜remark(鐢ㄦ潵鍋氭槸鍚﹁缁欏彂閫佹椂闂存爣璇�)
             String remark = null;
             //瀹氫箟涓�涓ā鏉垮彉閲忥紝鐢ㄤ笌涓存椂淇濆瓨涓�涓嬫壘鍑烘潵鐨勬ā鏉�
-            SvyTaskTemplate stt = null;
-            if (CollectionUtils.isNotEmpty(svyTaskTemplates) && svyTaskTemplates.size() == 1) {
-                stt = svyTaskTemplates.get(0);
-                taskid = svyTaskTemplates.get(0).getTaskid();
+            IvrTaskTemplate stt = null;
+            if (CollectionUtils.isNotEmpty(ivrTaskTemplates) && ivrTaskTemplates.size() == 1) {
+                stt = ivrTaskTemplates.get(0);
+                taskid = ivrTaskTemplates.get(0).getTaskid();
 
-            } else if (CollectionUtils.isNotEmpty(svyTaskTemplates) && svyTaskTemplates.size() > 1) {
+            } else if (CollectionUtils.isNotEmpty(ivrTaskTemplates) && ivrTaskTemplates.size() > 1) {
                 //閫氳繃鎮h�呯殑鐤剧梾鍘绘壘妯℃澘
                 if (StringUtils.isNotEmpty(patMedInhosp1.getIcd10code())) {
                     aa:
-                    for (SvyTaskTemplate svyTaskTemplate1 : svyTaskTemplates) {
+                    for (IvrTaskTemplate ivrTaskTemplate1 : ivrTaskTemplates) {
                         //閫氳繃鍩虹妯℃澘ID鑾峰彇鍏宠仈鐨勭柧鐥卌ode
                         Icd10Association icd10Association = new Icd10Association();
                         icd10Association.setType(5L);
-                        icd10Association.setOutid(svyTaskTemplate1.getTemplateid());
+                        icd10Association.setOutid(ivrTaskTemplate1.getId());
                         List<Icd10Association> icd10Associations = icd10AssociationMapper.selectIcd10AssociationList(icd10Association);
                         if (CollectionUtils.isEmpty(icd10Associations)) {
                             //濡傝兘妯℃澘鐨勭柧鐥呬负绌猴紝鍒欐槸鏈瀹ょ殑閫氱敤榛樿妯℃澘
-                            stt = svyTaskTemplate1;
+                            stt = ivrTaskTemplate1;
                             taskid = stt.getTaskid();
                             continue;
                         } else {
                             //濡傝兘妯℃澘鐨勭柧鐥呬笉涓虹┖锛屽垯鏄敤鍖归厤鍒扮柧鐥呯殑妯℃澘锛堝鏋滃尮閰嶅嚭鏉ュ涓ā鏉匡紝鍙敤绗竴涓級
                             for (Icd10Association icd10Association1 : icd10Associations) {
                                 if (patMedInhosp1.getIcd10code().equals(icd10Association1.getIcd10code())) {
-                                    stt = svyTaskTemplate1;
+                                    stt = ivrTaskTemplate1;
                                     taskid = stt.getTaskid();
                                     break aa;
                                 }
@@ -275,15 +277,15 @@
                     }
                 } else {
                     //涓虹┖鐨勮瘽锛岀洿鎺ョ敤绉戝鐨勯�氱敤妯℃澘鐨勪换鍔D锛岃鎮h�呯洿鎺ュ線瀛愪换鍔¤〃閲屾彃鍏ワ紝浣嗕笉瑕佹墽琛岋紝闇�瑕佷汉宸ュ共锛堝皢涓嶈兘鎵ц鐨勫師鍥犲娉ㄥソ锛�
-                    for (SvyTaskTemplate svyTaskTemplate1 : svyTaskTemplates) {
+                    for (IvrTaskTemplate ivrTaskTemplate1 : ivrTaskTemplates) {
                         //閫氳繃鍩虹妯℃澘ID鑾峰彇鍏宠仈鐨勭柧鐥卌ode
                         Icd10Association icd10Association = new Icd10Association();
                         icd10Association.setType(5L);
-                        icd10Association.setOutid(svyTaskTemplate1.getTemplateid());
+                        icd10Association.setOutid(ivrTaskTemplate1.getId());
                         //鎵惧嚭璇ョ瀹ょ殑閫氱敤妯℃澘
                         List<Icd10Association> icd10Associations = icd10AssociationMapper.selectIcd10AssociationList(icd10Association);
                         if (CollectionUtils.isEmpty(icd10Associations)) {
-                            stt = svyTaskTemplate1;
+                            stt = ivrTaskTemplate1;
                             //涓嶉厤缃彂閫佹椂闂�
                             remark = "鎮h�呭叆闄㈢柧鐥呬负绌�";
                             //鍦ㄥ嚭鍏ラ櫌琛ㄨ褰曚竴涓嬭鎮h�呯姸鎬侊紙璇ョ瀹ゆ槸鏈夌柧鐥呬负绌虹殑妯℃澘锛屾墍浠ュ彲浠ュ湪瀛愪换鍔¢噷鐢熸垚浠诲姟锛屾墍浠ヤ换鍔℃槸鎴愬姛鐨勶紝chect_flag=1锛�
@@ -306,14 +308,15 @@
             ServiceTask serviceTask = serviceTaskMapper.selectServiceTaskByTaskid(taskid);
             ServiceSubtask serviceSubtask = DtoConversionUtils.sourceToTarget(serviceTask, ServiceSubtask.class);
             serviceSubtask.setTaskid(serviceTask.getTaskid());
-            serviceSubtask.setLibtemplateid(stt.getTemplateid());
+            if (StringUtils.isNotEmpty(stt.getLibtemplateid()))
+                serviceSubtask.setLibtemplateid(Long.valueOf(stt.getLibtemplateid()));
             serviceSubtask.setNurseId(patMedInhosp1.getNurseId());
             serviceSubtask.setNurseName(patMedInhosp1.getNurseName());
             serviceSubtask.setDrcode(patMedInhosp1.getDrcode());
             serviceSubtask.setDrname(patMedInhosp1.getDrname());
             serviceSubtask.setDeptname(patMedInhosp1.getLeaveldeptname());
             serviceSubtask.setTemplateid(stt.getId());
-            serviceSubtask.setTemplatename(stt.getSvyname());
+            serviceSubtask.setTemplatename(stt.getTemplateName());
             serviceSubtask.setPatid(patArchive.getId());
             serviceSubtask.setSendname(patArchive.getName());
             serviceSubtask.setSfzh(patArchive.getIdcardno());
@@ -417,6 +420,228 @@
 
         return 1;
     }
+//闂嵎
+//    @Override
+//    public int dealOutHospInfo() {
+//        PatMedInhosp patMedInhosp = new PatMedInhosp();
+//        //鑾峰彇鏈鐞嗙殑鏁版嵁
+//        patMedInhosp.setCheckFlag("0");
+//        patMedInhosp.setInhospstate("1");
+//        List<PatMedInhosp> patMedInhosps = patMedInhospMapper.selectPatMedInhospList(patMedInhosp);
+//
+//        for (PatMedInhosp patMedInhosp1 : patMedInhosps) {
+//            //鏍规嵁鎮h�呮墍鍦ㄧ瀹わ紝鑾峰彇璇ョ瀹ょ殑闀挎湡浠诲姟妯℃澘
+//            Long taskid = null;
+//            //閫氳繃deptCode鑾峰彇鍏宠仈鐨勯暱鏈熶换鍔℃ā鏉�
+//            TemplateDept templateDept = new TemplateDept();
+//            templateDept.setDeptCode(patMedInhosp1.getLeaveldeptcode());
+//            templateDept.setLongTemp(1);
+//            templateDept.setType(11L);
+//            List<TemplateDept> templateDepts = templateDeptMapper.selectTemplateDeptList(templateDept);
+//            //鏍规嵁鑾峰彇鐨勯暱鏈熶换鍔℃ā鏉縄D锛岃幏鍙栦换鍔℃ā鏉胯鎯�
+//            List<SvyTaskTemplate> svyTaskTemplates = new ArrayList<>();
+//            if (CollectionUtils.isNotEmpty(templateDepts)) {
+//                for (TemplateDept templateDept1 : templateDepts) {
+//                    SvyTaskTemplate svyTaskTemplate = svyTaskTemplateMapper.selectSvyTaskTemplateBySvyid(templateDept1.getTempid());
+//                    if (ObjectUtils.isNotEmpty(svyTaskTemplate)) svyTaskTemplates.add(svyTaskTemplate);
+//                }
+//            }
+//            //濡傛灉閮ㄩ棬妯℃澘涓虹┖锛堟殏瀹氾紝灏嗗嚭鍏ラ櫌琛ㄧ殑check_flag璁剧疆涓�2  锛宭ong_task_reason 璁板綍鍘熷洜锛�
+//            if (CollectionUtils.isEmpty(svyTaskTemplates) || svyTaskTemplates.size() == 0) {
+//                patMedInhosp1.setCheckFlag("2");
+//                patMedInhosp1.setLongTaskReason("璇ユ偅鑰呮墍鍦ㄧ瀹わ紝鏈厤缃换鍔℃ā鏉�");
+//                patMedInhospMapper.updatePatMedInhosp(patMedInhosp1);
+//                continue;
+//            }
+//
+//            //鑾峰彇鎮h�呬俊鎭�
+//            PatArchive patArchive = patArchiveMapper.selectPatArchiveByPatid(patMedInhosp1.getPatid());
+//            //缁欎釜remark(鐢ㄦ潵鍋氭槸鍚﹁缁欏彂閫佹椂闂存爣璇�)
+//            String remark = null;
+//            //瀹氫箟涓�涓ā鏉垮彉閲忥紝鐢ㄤ笌涓存椂淇濆瓨涓�涓嬫壘鍑烘潵鐨勬ā鏉�
+//            SvyTaskTemplate stt = null;
+//            if (CollectionUtils.isNotEmpty(svyTaskTemplates) && svyTaskTemplates.size() == 1) {
+//                stt = svyTaskTemplates.get(0);
+//                taskid = svyTaskTemplates.get(0).getTaskid();
+//
+//            } else if (CollectionUtils.isNotEmpty(svyTaskTemplates) && svyTaskTemplates.size() > 1) {
+//                //閫氳繃鎮h�呯殑鐤剧梾鍘绘壘妯℃澘
+//                if (StringUtils.isNotEmpty(patMedInhosp1.getIcd10code())) {
+//                    aa:
+//                    for (SvyTaskTemplate svyTaskTemplate1 : svyTaskTemplates) {
+//                        //閫氳繃鍩虹妯℃澘ID鑾峰彇鍏宠仈鐨勭柧鐥卌ode
+//                        Icd10Association icd10Association = new Icd10Association();
+//                        icd10Association.setType(5L);
+//                        icd10Association.setOutid(svyTaskTemplate1.getTemplateid());
+//                        List<Icd10Association> icd10Associations = icd10AssociationMapper.selectIcd10AssociationList(icd10Association);
+//                        if (CollectionUtils.isEmpty(icd10Associations)) {
+//                            //濡傝兘妯℃澘鐨勭柧鐥呬负绌猴紝鍒欐槸鏈瀹ょ殑閫氱敤榛樿妯℃澘
+//                            stt = svyTaskTemplate1;
+//                            taskid = stt.getTaskid();
+//                            continue;
+//                        } else {
+//                            //濡傝兘妯℃澘鐨勭柧鐥呬笉涓虹┖锛屽垯鏄敤鍖归厤鍒扮柧鐥呯殑妯℃澘锛堝鏋滃尮閰嶅嚭鏉ュ涓ā鏉匡紝鍙敤绗竴涓級
+//                            for (Icd10Association icd10Association1 : icd10Associations) {
+//                                if (patMedInhosp1.getIcd10code().equals(icd10Association1.getIcd10code())) {
+//                                    stt = svyTaskTemplate1;
+//                                    taskid = stt.getTaskid();
+//                                    break aa;
+//                                }
+//                            }
+//                        }
+//                    }
+//                    //濡傛灉寰幆瀹岋紝stt杩樻槸涓虹┖锛屽垯璇ョ瀹ゆ病鏈夐粯璁ゆā鏉�
+//                    if (Objects.isNull(stt)) {
+//                        //鍦ㄥ嚭鍏ラ櫌琛ㄨ褰曚竴涓嬭鎮h�呯姸鎬侊紙璇ョ瀹ゆ病鏈夋ā鏉匡紝鎵�浠ユ棤娉曞湪瀛愪换鍔¢噷鐢熸垚浠诲姟锛屾墍浠ヤ换鍔℃槸澶辫触鏄殑锛宑hect_flag=2锛�
+//                        patMedInhosp1.setCheckFlag("2");
+//                        patMedInhosp1.setLongTaskReason("鏃犳硶鍖归厤鍒拌绉戝妯℃澘锛岃绉戝涔熸棤榛樿妯℃澘");
+//                        patMedInhospMapper.updatePatMedInhosp(patMedInhosp1);
+//                        continue;
+//                    }
+//                } else {
+//                    //涓虹┖鐨勮瘽锛岀洿鎺ョ敤绉戝鐨勯�氱敤妯℃澘鐨勪换鍔D锛岃鎮h�呯洿鎺ュ線瀛愪换鍔¤〃閲屾彃鍏ワ紝浣嗕笉瑕佹墽琛岋紝闇�瑕佷汉宸ュ共锛堝皢涓嶈兘鎵ц鐨勫師鍥犲娉ㄥソ锛�
+//                    for (SvyTaskTemplate svyTaskTemplate1 : svyTaskTemplates) {
+//                        //閫氳繃鍩虹妯℃澘ID鑾峰彇鍏宠仈鐨勭柧鐥卌ode
+//                        Icd10Association icd10Association = new Icd10Association();
+//                        icd10Association.setType(5L);
+//                        icd10Association.setOutid(svyTaskTemplate1.getTemplateid());
+//                        //鎵惧嚭璇ョ瀹ょ殑閫氱敤妯℃澘
+//                        List<Icd10Association> icd10Associations = icd10AssociationMapper.selectIcd10AssociationList(icd10Association);
+//                        if (CollectionUtils.isEmpty(icd10Associations)) {
+//                            stt = svyTaskTemplate1;
+//                            //涓嶉厤缃彂閫佹椂闂�
+//                            remark = "鎮h�呭叆闄㈢柧鐥呬负绌�";
+//                            //鍦ㄥ嚭鍏ラ櫌琛ㄨ褰曚竴涓嬭鎮h�呯姸鎬侊紙璇ョ瀹ゆ槸鏈夌柧鐥呬负绌虹殑妯℃澘锛屾墍浠ュ彲浠ュ湪瀛愪换鍔¢噷鐢熸垚浠诲姟锛屾墍浠ヤ换鍔℃槸鎴愬姛鐨勶紝chect_flag=1锛�
+//                            patMedInhosp1.setCheckFlag("1");
+//                            patMedInhosp1.setLongTaskReason("鎮h�呭叆闄㈢柧鐥呬负绌猴紝宸叉壘鍒扮瀹ゆā鏉�");
+//                            patMedInhospMapper.updatePatMedInhosp(patMedInhosp1);
+//                            continue;
+//                        }
+//                    }
+//                    if (Objects.isNull(stt)) {
+//                        //鍦ㄥ嚭鍏ラ櫌琛ㄨ褰曚竴涓嬭鎮h�呯姸鎬侊紙璇ョ瀹ゆ病鏈夋ā鏉匡紝鎵�浠ユ棤娉曞湪瀛愪换鍔¢噷鐢熸垚浠诲姟锛屾墍浠ヤ换鍔℃槸澶辫触鏄殑锛宑hect_flag=2锛�
+//                        patMedInhosp1.setCheckFlag("2");
+//                        patMedInhosp1.setLongTaskReason("鎮h�呭叆闄㈢柧鐥呬负绌猴紝鏈壘鍒扮瀹ゆā鏉�");
+//                        patMedInhospMapper.updatePatMedInhosp(patMedInhosp1);
+//                        continue;
+//                    }
+//                }
+//            }
+//
+//            ServiceTask serviceTask = serviceTaskMapper.selectServiceTaskByTaskid(taskid);
+//            ServiceSubtask serviceSubtask = DtoConversionUtils.sourceToTarget(serviceTask, ServiceSubtask.class);
+//            serviceSubtask.setTaskid(serviceTask.getTaskid());
+//            serviceSubtask.setLibtemplateid(stt.getTemplateid());
+//            serviceSubtask.setNurseId(patMedInhosp1.getNurseId());
+//            serviceSubtask.setNurseName(patMedInhosp1.getNurseName());
+//            serviceSubtask.setDrcode(patMedInhosp1.getDrcode());
+//            serviceSubtask.setDrname(patMedInhosp1.getDrname());
+//            serviceSubtask.setDeptname(patMedInhosp1.getLeaveldeptname());
+//            serviceSubtask.setTemplateid(stt.getId());
+//            serviceSubtask.setTemplatename(stt.getSvyname());
+//            serviceSubtask.setPatid(patArchive.getId());
+//            serviceSubtask.setSendname(patArchive.getName());
+//            serviceSubtask.setSfzh(patArchive.getIdcardno());
+//            serviceSubtask.setPhone(patArchive.getTelcode());
+//            serviceSubtask.setSex(patArchive.getSex());
+//            serviceSubtask.setAge(patArchive.getAge());
+//            serviceSubtask.setSendstate(2L);
+//            serviceSubtask.setStarttime(patMedInhosp1.getStarttime());
+//            serviceSubtask.setEndtime(patMedInhosp1.getEndtime());
+//            serviceSubtask.setServiceType("2");
+//            serviceSubtask.setPreachform(serviceTask.getPreachform());
+//            serviceSubtask.setHospType("2");
+//            serviceSubtask.setCreateTime(new Date());
+//            serviceSubtask.setUpdateTime(new Date());
+//            serviceSubtask.setCreateBy(patMedInhosp1.getNurseName());
+//            serviceSubtask.setLeavehospitaldistrictcode(patMedInhosp1.getLeavehospitaldistrictcode());
+//            serviceSubtask.setLeavehospitaldistrictname(patMedInhosp1.getLeavehospitaldistrictname());
+//            //璁剧疆鍙戦�佹椂闂�
+//            Date newDate = addDays(patMedInhosp1.getEndtime(), stt.getSendDay());
+//            serviceSubtask.setLongSendTime(newDate);
+//            //鎮h�呭彂閫佹椂闂�
+//            if (StringUtils.isNotEmpty(patArchive.getNotrequiredFlag()) && patArchive.getNotrequiredFlag().equals("1")) {
+//                remark = patArchive.getNotrequiredreason();
+//                serviceSubtask.setRemark(remark);
+//                serviceSubtask.setResult("error");
+//                serviceSubtask.setFinishtime(new Date());
+//                //涓嶆墽琛�
+//                serviceSubtask.setSendstate(4L);
+//            }
+//
+//            //鍦ㄦ柊澧炰箣鍓嶏紝鍏堥�氳繃鎮h�匢D锛宻endstate=2鏌ヨ涓�涓嬶紝鍦ㄦ墍鏈夐暱鏈熶换鍔′腑锛屾槸涓嶆槸杩樻湁璇ユ偅鑰呭緟鎵ц鐨勪换鍔★紝鏈夌殑璇�,姣旇緝涔嬪墠鐨別ndtime鏄惁灏忎簬褰撳墠鐨別ndtaime,濡傛灉涔嬪墠鐨勫皬浜庣幇鍦ㄧ殑锛屽垯鐩存帴灏嗕箣鍓嶇殑鍋滄帀锛堝師鍥犲啀鍏ラ櫌锛�
+//            ServiceSubtaskVO subtask = new ServiceSubtaskVO();
+//            subtask.setPatid(patArchive.getId());
+//            subtask.setSendstate(2L);
+//            List<ServiceSubtask> selectServiceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(subtask);
+//            log.error("璇ユ偅鑰呭緟鎵ц鐨勪换鍔�:{}", selectServiceSubtaskList);
+//            if (CollectionUtils.isNotEmpty(selectServiceSubtaskList) && selectServiceSubtaskList.size() > 0) {
+//                for (ServiceSubtask serviceSubtask1 : selectServiceSubtaskList) {
+//                    if (Objects.isNull(serviceSubtask1.getLongSendTime())) {
+//                        //涓嶆槸闀挎湡浠诲姟锛屼笉澶勭悊
+//                        continue;
+//                    }
+//                    if (serviceSubtask1.getEndtime().before(serviceSubtask.getEndtime())) {
+//                        //濡傛灉褰撳墠寰幆鐨勫瓙浠诲姟鐨勫嚭闄㈡椂闂村湪鈥滃噯澶囨柊澧炵殑瀛愪换鍔♀�濈殑鍑洪櫌鏃堕棿涔嬪墠锛屽垯灏嗗惊鐜殑瀛愪换鍔″仠鎺�
+//                        serviceSubtask1.setSendstate(4L);
+//                        serviceSubtask1.setRemark("鎮h�呭啀鍏ラ櫌");
+//                        serviceSubtask1.setResult("error");
+//                        serviceSubtask1.setFinishtime(new Date());
+//                        serviceSubtaskMapper.updateServiceSubtask(serviceSubtask1);
+//                    } else {
+//                        //鐩稿弽,鍒欏皢褰撴湁鐨勬暟鎹仠鎺�
+//                        serviceSubtask.setResult("error");
+//                        serviceSubtask.setFinishtime(new Date());
+//                        serviceSubtask.setSendstate(4L);
+//                        serviceSubtask.setRemark("鎮h�呭啀鍏ラ櫌");
+//                    }
+//                }
+//            }
+//
+//            serviceSubtaskMapper.insertServiceSubtask(serviceSubtask);
+//            //灏哻heck_flag鏀规垚1锛堝凡澶勭悊锛�
+//            PatMedInhosp patMedInhosp2 = new PatMedInhosp();
+//            patMedInhosp2.setInhospid(patMedInhosp1.getInhospid());
+//            patMedInhosp2.setCheckFlag("1");
+//            patMedInhospMapper.updatePatMedInhosp(patMedInhosp2);
+//        }
+//
+//        //鑾峰彇鏈鐞嗗湪闄㈢殑鏁版嵁(濡傛灉鍒氬垰鍑洪櫌鐨勬偅鑰呮暟鎹殑鍑洪櫌鏃堕棿,鍦ㄤ笅闈㈡煡璇㈠嚭鐨勫叆闄㈡椂闂翠箣鍓�,閭d箣鍓嶇殑鍑洪櫌鎮h�呯殑鏁版嵁,涔熷緱鍋滄帀,鍥犱负鍙堝叆闄簡)
+//        patMedInhosp.setCheckFlag("0");
+//        patMedInhosp.setInhospstate("0");
+//        List<PatMedInhosp> patMedInhospList = patMedInhospMapper.selectPatMedInhospList(patMedInhosp);
+//        if (CollectionUtils.isNotEmpty(patMedInhospList) && patMedInhospList.size() > 0) {
+//            for (PatMedInhosp patMedInhosp1 : patMedInhospList) {
+//                //鑾峰彇褰撳墠鍏ラ櫌鎮h�呯殑寰呮墽琛岀殑鍑洪櫌瀛愪换鍔¢殢璁夸俊鎭�
+//                ServiceSubtaskVO subtask = new ServiceSubtaskVO();
+//                subtask.setPatid(patMedInhosp1.getPatid());
+//                subtask.setSendstate(2L);
+//                List<ServiceSubtask> selectServiceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(subtask);
+//                log.error("鍏ラ櫌鐨勬偅鑰呭緟鎵ц鐨勪换鍔�:{}", selectServiceSubtaskList);
+//                if (CollectionUtils.isNotEmpty(selectServiceSubtaskList) && selectServiceSubtaskList.size() > 0) {
+//                    for (ServiceSubtask serviceSubtask1 : selectServiceSubtaskList) {
+//                        if (Objects.isNull(serviceSubtask1.getLongSendTime())) {
+//                            //涓嶆槸闀挎湡浠诲姟锛屼笉澶勭悊
+//                            continue;
+//                        }
+//                        if (serviceSubtask1.getEndtime().before(patMedInhosp1.getStarttime())) {
+//                            //濡傛灉褰撳墠寰幆鐨勫瓙浠诲姟鐨勫嚭闄㈡椂闂村湪鈥滃噯澶囨柊澧炵殑瀛愪换鍔♀�濈殑鍑洪櫌鏃堕棿涔嬪墠锛屽垯灏嗗惊鐜殑瀛愪换鍔″仠鎺�
+//                            serviceSubtask1.setSendstate(4L);
+//                            serviceSubtask1.setRemark("鎮h�呭啀鍏ラ櫌");
+//                            serviceSubtask1.setResult("error");
+//                            serviceSubtask1.setFinishtime(new Date());
+//                            serviceSubtaskMapper.updateServiceSubtask(serviceSubtask1);
+//                        }
+//                    }
+//                }
+//                //灏嗘偅鍏ョ殑鍏ラ櫌鏁版嵁璁剧疆涓哄凡澶勭悊
+//                patMedInhosp1.setCheckFlag("1");
+//                patMedInhospMapper.updatePatMedInhosp(patMedInhosp1);
+//            }
+//        }
+//
+//        return 1;
+//    }
 
     /**
      * 鑾峰彇鍑洪櫌锛屼綇闄紝闂ㄨ瘖鏈嶅姟浜烘
@@ -430,6 +655,36 @@
         return patMedInhospMapper.getDeptRanking(patMedReq);
     }
 
+    @Override
+    public List<PatMedInhosp> getDocAndPat(PatMedInhosp patMedInhosp) {
+        List<PatMedInhosp> patMedInhospList = patMedInhospMapper.selectPatMedInhospList(patMedInhosp);
+        if (StringUtils.isNotEmpty(patMedInhosp.getPatname()) || StringUtils.isNotEmpty(patMedInhosp.getNurseName()) || StringUtils.isNotEmpty(patMedInhosp.getDrname())) {
+            //鑾峰彇澶栭儴瀵煎叆淇℃伅,骞跺皢澶栭儴鎮h�呮斁鍒皃atMedInhospList涓�
+            PatArchiveImport patArchiveImport = new PatArchiveImport();
+            if (StringUtils.isNotEmpty(patMedInhosp.getPatname())) {
+                patArchiveImport.setName(patMedInhosp.getPatname());
+            }
+            if (StringUtils.isNotEmpty(patMedInhosp.getNurseName()))
+                patArchiveImport.setCreateBy(patMedInhosp.getNurseName());
+            if (StringUtils.isNotEmpty(patMedInhosp.getDrname()))
+                patArchiveImport.setCreateBy(patMedInhosp.getDrname());
+            List<PatArchiveImport> patArchiveImports = patArchiveImportMapper.selectPatArchiveImportList(patArchiveImport);
+            if (CollectionUtils.isNotEmpty(patArchiveImports)) {
+                for (PatArchiveImport patArchiveImport1 : patArchiveImports) {
+                    PatMedInhosp patMedInhosp1 = new PatMedInhosp();
+                    patMedInhosp1.setPatname(patArchiveImport1.getName());
+                    patMedInhosp1.setSex(patArchiveImport1.getSex());
+                    patMedInhosp1.setNurseName(patArchiveImport1.getCreateBy());
+                    patMedInhosp1.setOutImport(1);
+                    patMedInhosp1.setTelcode(patArchiveImport1.getTelcode());
+                    patMedInhospList.add(patMedInhosp1);
+                }
+            }
+        }
+
+        return patMedInhospList;
+    }
+
     private Date addDays(Date date, Integer days) {
         if (days == null) {
             days = 1;
diff --git a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskDetailServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskDetailServiceImpl.java
index 7a2de80..31c6f03 100644
--- a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskDetailServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskDetailServiceImpl.java
@@ -1,16 +1,24 @@
 package com.smartor.service.impl;
 
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.smartor.domain.ServiceSubtask;
 import com.smartor.domain.ServiceSubtaskDetail;
 import com.smartor.domain.ServiceSubtaskDetail;
+import com.smartor.domain.ServiceTask;
 import com.smartor.mapper.ServiceSubtaskDetailMapper;
 import com.smartor.mapper.ServiceSubtaskMapper;
 import com.smartor.service.IServiceSubtaskDetailService;
+import com.smartor.service.IServiceTaskService;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.List;
+import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * 璇煶浠诲姟鍛煎彨鏄庣粏Service涓氬姟灞傚鐞�
@@ -25,8 +33,10 @@
     private ServiceSubtaskDetailMapper ServiceSubtaskDetailMapper;
 
     @Autowired
-    private ServiceSubtaskMapper ivrTaskSingleMapper;
+    private ServiceSubtaskMapper serviceSubtaskMapper;
 
+    @Autowired
+    private IServiceTaskService serviceTaskService;
 
 
     /**
@@ -47,8 +57,73 @@
      * @return 璇煶浠诲姟鍛煎彨鏄庣粏
      */
     @Override
-    public List<ServiceSubtaskDetail> selectServiceSubtaskDetailList(ServiceSubtaskDetail serviceSubtaskDetail) {
-        return ServiceSubtaskDetailMapper.selectServiceSubtaskDetailList(serviceSubtaskDetail);
+    public Map<String, Object> selectServiceSubtaskDetailList(ServiceSubtaskDetail serviceSubtaskDetail) {
+        List<ServiceSubtaskDetail> serviceSubtaskDetails = ServiceSubtaskDetailMapper.selectServiceSubtaskDetailList(serviceSubtaskDetail);
+        if (CollectionUtils.isNotEmpty(serviceSubtaskDetails)) {
+            //澶勭悊涓�涓嬮�氶厤绗�
+            for (ServiceSubtaskDetail serviceSubtaskDetail1 : serviceSubtaskDetails) {
+                ServiceSubtask serviceSubtask = serviceSubtaskMapper.selectServiceSubtaskById(serviceSubtaskDetail1.getSubId());
+                serviceSubtaskDetail1.setQuestiontext(getObject(serviceSubtask, serviceSubtaskDetail1.getQuestiontext()));
+            }
+        }
+        //鑾峰彇鏈�鍚庣殑鎬诲綍闊冲湴鍧�
+        Map<String, Object> map = new HashMap<>();
+        map.put("code", 200);
+        map.put("msg", "鏌ヨ鎴愬姛");
+        Map<String, Object> map1 = new HashMap<>();
+        map1.put("serviceSubtaskDetails", serviceSubtaskDetails);
+        map1.put("filteredDetails", null);
+        //鐢ㄤ簬瀛樺偍鍘婚噸鐨勬暟鎹�
+        List<ServiceSubtaskDetail> serviceSubtaskDetailSET = new ArrayList<>();
+        Boolean flag = false;
+        if (CollectionUtils.isNotEmpty(serviceSubtaskDetails)) {
+            for (ServiceSubtaskDetail serviceSubtaskDetail1 : serviceSubtaskDetails) {
+                if (serviceSubtaskDetailSET.size() == 0) {
+                    serviceSubtaskDetailSET.add(serviceSubtaskDetail1);
+                } else {
+//                    for (ServiceSubtaskDetail subtaskDetail : serviceSubtaskDetailSET)
+                    for (int i = 0; i < serviceSubtaskDetailSET.size(); i++) {
+                        ServiceSubtaskDetail subtaskDetail = serviceSubtaskDetailSET.get(i);
+                        if (subtaskDetail.getPatid().equals(serviceSubtaskDetail1.getPatid()) && subtaskDetail.getSubId().equals(serviceSubtaskDetail1.getSubId()) && subtaskDetail.getTaskid().equals(serviceSubtaskDetail1.getTaskid()) && subtaskDetail.getQuestiontext().equals(serviceSubtaskDetail1.getQuestiontext())) {
+                            if (StringUtils.isNotEmpty(serviceSubtaskDetail1.getMatchedtext())) {
+                                serviceSubtaskDetailSET.set(i, serviceSubtaskDetail1);
+                            }
+                            //鍖归厤鍒拌繖涓暟鎹�,灏唂lag鏀规垚false
+                            if (flag == true) flag = false;
+                        } else if ((subtaskDetail.getPatid().equals(serviceSubtaskDetail1.getPatid()) && subtaskDetail.getSubId().equals(serviceSubtaskDetail1.getSubId()) && subtaskDetail.getTaskid().equals(serviceSubtaskDetail1.getTaskid()) && !subtaskDetail.getQuestiontext().equals(serviceSubtaskDetail1.getQuestiontext()))) {
+                            //鏍囪瘑涓�涓嬶紝鏆傛椂娌℃湁鍖归厤鍒拌繖涓暟鎹�
+                            flag = true;
+                        } else if ((subtaskDetail.getPatid() == serviceSubtaskDetail1.getPatid() && subtaskDetail.getSubId() != serviceSubtaskDetail1.getSubId() && subtaskDetail.getTaskid() == serviceSubtaskDetail1.getTaskid())) {
+                            //鏍囪瘑涓�涓嬶紝鏆傛椂娌℃湁鍖归厤鍒拌繖涓暟鎹�
+                            flag = true;
+                        }
+                    }
+                    if (flag == true) {
+                        //濡傛灉鍘婚噸寰幆閮界粨鏉熶簡锛岃繕娌℃湁鍖归厤鍒拌繖涓暟鎹紝鍒欏線鍘婚噸瀵硅薄閲屾柊澧炰竴涓�
+                        serviceSubtaskDetailSET.add(serviceSubtaskDetail1);
+                        flag = false;
+                    }
+                }
+            }
+        }
+        Collections.sort(serviceSubtaskDetailSET, Comparator.comparingLong(ServiceSubtaskDetail::getTemplatequestionnum));
+        map1.put("filteredDetails", serviceSubtaskDetailSET);
+
+        map1.put("voice", "");
+        if (CollectionUtils.isNotEmpty(serviceSubtaskDetails) && StringUtils.isNotEmpty(serviceSubtaskDetails.get(0).getQuestionvoice())) {
+            //鑾峰彇瀹屾暣璇煶
+            String filePath = serviceSubtaskDetails.get(0).getQuestionvoice();
+            int lastIndex = filePath.lastIndexOf('.');
+            if (lastIndex != -1) {
+                int secondLastIndex = filePath.lastIndexOf('.', lastIndex - 1);
+                if (secondLastIndex != -1) {
+                    String voicePath = filePath.substring(0, secondLastIndex) + filePath.substring(lastIndex);
+                    map1.put("voice", voicePath);
+                }
+            }
+        }
+        map.put("data", map1);
+        return map;
     }
 
     /**
@@ -103,4 +178,37 @@
         return ServiceSubtaskDetailMapper.deleteServiceSubtaskDetailByCalldetailid(calldetailid);
     }
 
+    private String getObject(ServiceSubtask serviceSubtask, String scriptContent) {
+        Map<String, Map<String, String>> param = getParam(serviceSubtask.getTaskid());
+        for (Map<String, String> map : param.values()) {
+            for (String key : map.keySet()) {
+                scriptContent = scriptContent.replace(key, org.apache.commons.lang3.StringUtils.isNotEmpty(map.get(key)) ? map.get(key) : "");
+            }
+        }
+        scriptContent = scriptContent.replace("${name}", org.apache.commons.lang3.StringUtils.isNotEmpty(serviceSubtask.getSendname()) ? serviceSubtask.getSendname() : "");
+        scriptContent = scriptContent.replace("${dzz}", org.apache.commons.lang3.StringUtils.isNotEmpty(serviceSubtask.getAddr()) ? serviceSubtask.getAddr() : "");
+        scriptContent = scriptContent.replace("${phone}", org.apache.commons.lang3.StringUtils.isNotEmpty(serviceSubtask.getTelcode()) ? serviceSubtask.getTelcode() : "");
+
+        return scriptContent;
+    }
+
+
+    /**
+     * 鑾峰彇浠诲姟閲岀殑閫氶厤绗�
+     *
+     * @param taskId
+     * @return
+     */
+    private Map<String, Map<String, String>> getParam(Long taskId) {
+        ServiceTask serviceTask = serviceTaskService.selectServiceTaskByTaskid(taskId);
+        ObjectMapper objectMapper = new ObjectMapper();
+        Map<String, Map<String, String>> serviceTaskMap = null;
+        try {
+            serviceTaskMap = objectMapper.readValue(serviceTask.getTextParam(), Map.class);
+        } catch (JsonProcessingException e) {
+            e.printStackTrace();
+        }
+        return serviceTaskMap;
+    }
+
 }
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 d5c88ea..aca304e 100644
--- a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -1,6 +1,5 @@
 package com.smartor.service.impl;
 
-import afu.org.checkerframework.checker.oigj.qual.O;
 import com.alibaba.fastjson2.JSON;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
@@ -8,26 +7,21 @@
 import com.ruoyi.common.core.redis.RedisCache;
 import com.ruoyi.common.exception.base.BaseException;
 import com.ruoyi.common.utils.*;
-import com.ruoyi.common.utils.http.HttpUtils;
+import com.smartor.common.FtpService;
 import com.smartor.config.PhoneUtils;
 import com.smartor.domain.*;
 import com.smartor.mapper.*;
-import com.smartor.service.IIvrTaskTemplateScriptService;
-import com.smartor.service.IIvrTaskTemplateService;
-import com.smartor.service.IServiceSubtaskService;
-import com.smartor.service.IServiceTaskService;
+import com.smartor.service.*;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
-import java.sql.Time;
 import java.text.SimpleDateFormat;
 import java.time.LocalDate;
 import java.time.LocalTime;
@@ -71,8 +65,15 @@
 
     @Autowired
     private IIvrTaskTemplateService ivrTaskTemplateService;
+
+    @Autowired
+    private ISvyTaskTemplateService svyTaskTemplateService;
+
     @Autowired
     private IIvrTaskTemplateScriptService iIvrTaskTemplateScriptService;
+
+    @Autowired
+    private FtpService ftpService;
 
     @Value("${pri_key}")
     private String pri_key;
@@ -82,6 +83,15 @@
 
     @Value("${hangup}")
     private String hangup;
+
+    @Value("${app_key_yq}")
+    private String app_key_yq;
+
+    @Value("${ruoyi.profile}")
+    private String profile;
+
+    @Value("${voicePathPrefix}")
+    private String voicePathPrefix;
 
 
     /**
@@ -312,7 +322,19 @@
             serviceTask.setLeavehospitaldistrictcode(serviceTask.getLeavehospitaldistrictcode());
             serviceTaskService.insertServiceTask(serviceTask);
             if (serviceTaskVO.getLongTask() != null && serviceTaskVO.getLongTask() == 1) {
+                //杩欓噷闇�瑕佸皢浠诲姟id涓庝换鍔℃ā鏉縄D锛屽湪浠诲姟妯℃澘涓粦瀹�
                 Map<String, Integer> map = new HashMap<>();
+                if (StringUtils.isNotEmpty(serviceTaskVO.getType()) && serviceTaskVO.getType().equals("1")) {
+                    IvrTaskTemplate ivrTaskTemplate = new IvrTaskTemplate();
+                    ivrTaskTemplate.setTaskid(serviceTask.getTaskid());
+                    ivrTaskTemplate.setId(serviceTaskVO.getTemplateid());
+                    ivrTaskTemplateService.updateIvrTaskTemplate(ivrTaskTemplate);
+                } else if (StringUtils.isNotEmpty(serviceTaskVO.getType()) && serviceTaskVO.getType().equals("2")) {
+                    SvyTaskTemplate svyTaskTemplate = new SvyTaskTemplate();
+                    svyTaskTemplate.setTaskid(serviceTask.getTaskid());
+                    svyTaskTemplate.setId(serviceTaskVO.getTemplateid());
+                    svyTaskTemplateService.updateSvyTaskTemplate(svyTaskTemplate);
+                }
                 map.put("subTaskId", null);
                 map.put("taskId", serviceTask.getTaskid().intValue());
                 return map;
@@ -334,6 +356,7 @@
                     serviceSubtask.setPatid(patTaskRelevance.getPatid());
                     serviceSubtask.setCreateTime(DateUtils.getNowDate());
                     serviceSubtask.setSendstate(1L);
+                    if (serviceTaskVO.getLongTask() == 1) serviceSubtask.setSendstate(2L);
                     serviceSubtask.setDeptcode(patTaskRelevance.getDeptCode());
                     serviceSubtask.setDeptname(patTaskRelevance.getDeptName());
                     serviceSubtask.setLeavehospitaldistrictcode(patTaskRelevance.getLeavehospitaldistrictcode());
@@ -347,6 +370,8 @@
                     serviceSubtask.setEndtime(patTaskRelevance.getEndtime());
                     serviceSubtask.setNurseId(patTaskRelevance.getNurseId());
                     serviceSubtask.setNurseName(patTaskRelevance.getNurseName());
+                    if (serviceTaskVO.getLongTask() == 1)
+                        serviceSubtask.setLongSendTime(patTaskRelevance.getLongSendTime());
                     serviceSubtaskMapper.insertServiceSubtask(serviceSubtask);
                     integer = serviceSubtask.getId().intValue();
                 }
@@ -363,7 +388,26 @@
             if (serviceTaskVO.getLibtemplateid() != null)
                 serviceTask.setLibtemplateid(serviceTaskVO.getLibtemplateid().toString());
             serviceTask.setTemplateid(serviceTaskVO.getTemplateid());
+            serviceTask.setLongTask(serviceTaskVO.getLongTask());
             serviceTaskService.updateServiceTask(serviceTask);
+            if (serviceTaskVO.getLongTask() != null && serviceTaskVO.getLongTask() == 1) {
+                //杩欓噷闇�瑕佸皢浠诲姟id涓庝换鍔℃ā鏉縄D锛屽湪浠诲姟妯℃澘涓粦瀹�
+                Map<String, Integer> map = new HashMap<>();
+                if (StringUtils.isNotEmpty(serviceTaskVO.getType()) && serviceTaskVO.getType().equals("1")) {
+                    IvrTaskTemplate ivrTaskTemplate = new IvrTaskTemplate();
+                    ivrTaskTemplate.setTaskid(serviceTask.getTaskid());
+                    ivrTaskTemplate.setId(serviceTaskVO.getTemplateid());
+                    ivrTaskTemplateService.updateIvrTaskTemplate(ivrTaskTemplate);
+                } else if (StringUtils.isNotEmpty(serviceTaskVO.getType()) && serviceTaskVO.getType().equals("2")) {
+                    SvyTaskTemplate svyTaskTemplate = new SvyTaskTemplate();
+                    svyTaskTemplate.setTaskid(serviceTask.getTaskid());
+                    svyTaskTemplate.setId(serviceTaskVO.getTemplateid());
+                    svyTaskTemplateService.updateSvyTaskTemplate(svyTaskTemplate);
+                }
+                map.put("subTaskId", null);
+                map.put("taskId", serviceTask.getTaskid().intValue());
+                return map;
+            }
             if (CollectionUtils.isNotEmpty(serviceTaskVO.getPatTaskRelevances())) {
                 for (PatTaskRelevance patTaskRelevance : serviceTaskVO.getPatTaskRelevances()) {
                     ServiceSubtask serviceSubtask = DtoConversionUtils.sourceToTarget(serviceTaskVO, ServiceSubtask.class);
@@ -869,7 +913,17 @@
                         ServiceSubTaskDetailReq serviceSubTaskDetailReq = new ServiceSubTaskDetailReq();
                         List<ServiceSubtaskDetail> serviceSubtaskDetailList = new ArrayList<>();
                         ivrTaskTemplateScriptVO.setQuestionResult(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getOptiondesc());
-                        serviceSubtaskDetailList.add(getServiceSubtaskDetail(phoneCallReqYQVO, ivrTaskTemplateScriptVO, serviceSubtask, ivrTaskTemplate));
+                        ServiceSubtaskDetail serviceSubtaskDetail = getServiceSubtaskDetail(phoneCallReqYQVO, ivrTaskTemplateScriptVO, serviceSubtask, ivrTaskTemplate);
+                        //淇敼涓�涓嬭闊宠矾寰勶紙鏀规垚鍓嶇鍙互璁块棶鐨勶紝瀛樺埌鏁版嵁搴撲腑锛�
+                        if (StringUtils.isNotEmpty(serviceSubtaskDetail.getQuestionvoice())) {
+                            String questionvoice = serviceSubtaskDetail.getQuestionvoice();
+                            String[] split = questionvoice.split("\\\\");
+                            if (split.length > 0) {
+                                String lastPart = split[split.length - 1];
+                                serviceSubtaskDetail.setQuestionvoice(voicePathPrefix + lastPart);
+                            }
+                        }
+                        serviceSubtaskDetailList.add(serviceSubtaskDetail);
                         serviceSubTaskDetailReq.setServiceSubtaskDetailList(serviceSubtaskDetailList);
                         saveQuestionAnswerPhone(serviceSubTaskDetailReq);
                         //鍒ゆ柇涓�涓嬶紝杩欎釜閫夐」缁撴灉鏄笉鏄繕鏈夌户缁棶涓嬪幓鐨勫繀瑕侊紝渚嬪閫夐」缁撴灉鏄埆浜轰笉鎯崇户缁洖绛旈棶棰橈紝灏辫缁撴潫鎺�
@@ -954,11 +1008,23 @@
                         if (j == ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().size() - 1 && flag == 0) {
                             ServiceSubTaskDetailReq serviceSubTaskDetailReq = new ServiceSubTaskDetailReq();
                             List<ServiceSubtaskDetail> serviceSubtaskDetailList = new ArrayList<>();
-                            serviceSubtaskDetailList.add(getServiceSubtaskDetail(phoneCallReqYQVO, ivrTaskTemplateScriptVO, serviceSubtask, ivrTaskTemplate));
+                            ServiceSubtaskDetail serviceSubtaskDetail = getServiceSubtaskDetail(phoneCallReqYQVO, ivrTaskTemplateScriptVO, serviceSubtask, ivrTaskTemplate);
+                            //淇敼涓�涓嬭闊宠矾寰勶紙鏀规垚鍓嶇鍙互璁块棶鐨勶紝瀛樺埌鏁版嵁搴撲腑锛�
+                            if (StringUtils.isNotEmpty(serviceSubtaskDetail.getQuestionvoice())) {
+                                String questionvoice = serviceSubtaskDetail.getQuestionvoice();
+                                String[] split = questionvoice.split("\\\\");
+                                if (split.length > 0) {
+                                    String lastPart = split[split.length - 1];
+                                    serviceSubtaskDetail.setQuestionvoice(voicePathPrefix + lastPart);
+                                }
+                            }
+                            serviceSubtaskDetailList.add(serviceSubtaskDetail);
+                            //濡傛灉娌℃湁 鍖归厤涓婏紝杩欎釜蹇呴』涓簄ull
+                            serviceSubtaskDetailList.get(0).setMatchedtext("");
                             serviceSubTaskDetailReq.setServiceSubtaskDetailList(serviceSubtaskDetailList);
                             saveQuestionAnswerPhone(serviceSubTaskDetailReq);
-                            continue;
                         }
+                        continue;
                     }
                 }
                 //閮芥病鏈夊尮閰嶅埌
@@ -1031,7 +1097,17 @@
                 //涓嶆槸閫夋嫨棰�,鐩存帴璁板綍绛旀锛屽皢缁撴灉鍐欏埌detail涓�
                 ServiceSubTaskDetailReq serviceSubTaskDetailReq = new ServiceSubTaskDetailReq();
                 List<ServiceSubtaskDetail> serviceSubtaskDetailList = new ArrayList<>();
-                serviceSubtaskDetailList.add(getServiceSubtaskDetail(phoneCallReqYQVO, ivrTaskTemplateScriptVO, serviceSubtask, ivrTaskTemplate));
+                ServiceSubtaskDetail serviceSubtaskDetail = getServiceSubtaskDetail(phoneCallReqYQVO, ivrTaskTemplateScriptVO, serviceSubtask, ivrTaskTemplate);
+                //淇敼涓�涓嬭闊宠矾寰勶紙鏀规垚鍓嶇鍙互璁块棶鐨勶紝瀛樺埌鏁版嵁搴撲腑锛�
+                if (StringUtils.isNotEmpty(serviceSubtaskDetail.getQuestionvoice())) {
+                    String questionvoice = serviceSubtaskDetail.getQuestionvoice();
+                    String[] split = questionvoice.split("\\\\");
+                    if (split.length > 0) {
+                        String lastPart = split[split.length - 1];
+                        serviceSubtaskDetail.setQuestionvoice(voicePathPrefix + lastPart);
+                    }
+                }
+                serviceSubtaskDetailList.add(serviceSubtaskDetail);
                 serviceSubTaskDetailReq.setServiceSubtaskDetailList(serviceSubtaskDetailList);
                 saveQuestionAnswerPhone(serviceSubTaskDetailReq);
                 //    String xh = idSort.split("-")[1];
@@ -1163,6 +1239,7 @@
         //pullTaskVOList鐢ㄤ簬鏁版嵁杩斿洖
         List<PullTaskVO> pullTaskVOList = new ArrayList<>();
         String value0 = redisCache.getCacheObject("cache-0");
+        log.error("浠诲姟鎷夊彇value0鐨勫�兼槸澶氬皯锛歿}", value0);
         //  cache-0涓虹珛鍗冲彂璧风殑,鍏跺畠鐨勫厛鎺ㄨ繜
         if (!StringUtils.isEmpty(value0)) {
             pullTaskVOList = getPullTaskList(value0, "cache-0");
@@ -1200,6 +1277,7 @@
 
 
     private List<PullTaskVO> getPullTaskList(String subIds, String cacheName) {
+        log.error("浠诲姟鎷夊彇subIds鐨勫�兼槸澶氬皯锛歿}", subIds);
         //pullTaskVOList鐢ㄤ簬鏁版嵁杩斿洖
         List<PullTaskVO> pullTaskVOList = new ArrayList<>();
         //newValue0鐢ㄤ簬淇濆瓨娌℃湁澶勭悊鐨勫瓙 浠诲姟
@@ -1210,7 +1288,6 @@
             if (cacheName.equals("cache-0") && i < 5 || !cacheName.equals("cache-0") && i < 1) {
                 PullTaskVO pullTaskVO = new PullTaskVO();
                 String subId = split[i].trim().replace(",", "");
-
                 ServiceSubtask serviceSubtask = serviceSubtaskMapper.selectServiceSubtaskById(Long.valueOf(subId));
                 ServiceTask serviceTask = serviceTaskService.selectServiceTaskByTaskid(serviceSubtask.getTaskid());
                 IvrTaskTemplate ivrTaskTemplate = ivrTaskTemplateService.selectIvrTaskTemplateByID(serviceSubtask.getTemplateid());
@@ -1237,14 +1314,14 @@
                 //灏佽杩斿洖鏁版嵁
                 //taskId = 瀛愪换鍔D + 闂ID +闂搴忓彿
                 pullTaskVO.setTaskid(subId);
-                pullTaskVO.setAppkey("ZurNHpaQLq6P55YS");
+                pullTaskVO.setAppkey(app_key_yq);
                 pullTaskVO.setSections(LocalTime.now().format(DateTimeFormatter.ofPattern("hh:mm")) + "-" + LocalTime.now().plusMinutes(1).format(DateTimeFormatter.ofPattern("hh:mm")));
                 pullTaskVO.setPhones(serviceSubtask.getPhone());
                 pullTaskVO.setPrologue(kcb);
                 if (cacheName.equals("cache-0")) pullTaskVO.setDisplayNo("2");
                 else pullTaskVO.setDisplayNo("2");
                 pullTaskVOList.add(pullTaskVO);
-                redisCache.setCacheObject(subId.trim() + "-" + serviceSubtask.getPhone().trim(), ivrTaskTemplateScript.getId().toString());
+                redisCache.setCacheObject(subId.trim() + "-" + serviceSubtask.getPhone().trim(), ivrTaskTemplateScript.getId().toString(), 120, TimeUnit.MINUTES);
 //                redisCache.setCacheObject(subId.trim() + "-" + serviceSubtask.getPhone().trim() + "-firstSort", 1, 120, TimeUnit.MINUTES);
             } else {
                 if (StringUtils.isEmpty(newValue0)) {
@@ -1520,10 +1597,35 @@
         } else {
             for (ServiceSubtaskDetail serviceSubtaskDetail : serviceSubTaskDetailReq.getServiceSubtaskDetailList()) {
                 serviceSubtaskDetail.setCreateTime(new Date());
-                i = serviceSubtaskDetailMapper.insertServiceSubtaskDetail(serviceSubtaskDetail);
+                //鍏堟牴鎹瓙浠诲姟id,浠诲姟ID鍜岄棶棰樺簭鍙锋煡璇竴涓嬶紝璇ラ棶棰樻槸鍚﹀凡缁忔湁鍊硷紝濡傛灉鏈夊�硷紝鐩存帴淇敼锛屽鏋滀负绌猴紝鐩存帴鎻掑叆
+                ServiceSubtaskDetail ssd = new ServiceSubtaskDetail();
+                ssd.setSubId(serviceSubtaskDetail.getSubId());
+                ssd.setTaskid(serviceSubtaskDetail.getTaskid());
+                ssd.setTemplatequestionnum(serviceSubtaskDetail.getTemplatequestionnum());
+                List<ServiceSubtaskDetail> serviceSubtaskDetails = serviceSubtaskDetailMapper.selectServiceSubtaskDetailList(ssd);
+                if (CollectionUtils.isNotEmpty(serviceSubtaskDetails) && StringUtils.isNotEmpty(serviceSubtaskDetails.get(0).getMatchedtext())) {
+                    serviceSubtaskDetail.setId(serviceSubtaskDetails.get(0).getId());
+                    serviceSubtaskDetailMapper.updateServiceSubtaskDetail(serviceSubtaskDetail);
+                } else {
+                    i = serviceSubtaskDetailMapper.insertServiceSubtaskDetail(serviceSubtaskDetail);
+                }
             }
         }
         return i;
+    }
+
+    @Override
+    public Integer recordAccept(PhoneCallRecordVO phoneCallRecordVO) {
+        if (phoneCallRecordVO.getAnswered() != null && phoneCallRecordVO.getAnswered() == true) {
+            log.error("鏈変汉鎺ョ數璇濅簡锛屽苟涓斿畬浜�");
+            //璇存槑鏈変汉鎺ヤ簡
+            int startIndex = phoneCallRecordVO.getRecord_path().indexOf("voice") + "voice".length() + 1;  // 鍔�1鏄烦杩�/绗﹀彿
+            int endIndex = phoneCallRecordVO.getRecord_path().lastIndexOf("/");
+            String result = phoneCallRecordVO.getRecord_path().substring(startIndex, endIndex);
+            //涓嬭浇鏂囦欢
+            ftpService.downloadFolder("/" + LocalDate.now().toString(), profile + "/upload/vadio/voice/" + LocalDate.now().toString());
+        }
+        return 1;
     }
 
     @Override
@@ -1572,6 +1674,11 @@
     private ServiceSubtaskDetail getServiceSubtaskDetail(PhoneCallReqYQVO phoneCallReqYQVO, IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO, ServiceSubtask serviceSubtask, IvrTaskTemplate ivrTaskTemplate) {
         ServiceSubtaskDetail serviceSubtaskDetail = new ServiceSubtaskDetail();
         serviceSubtaskDetail.setSubId(Long.valueOf(phoneCallReqYQVO.getTaskid()));
+        ServiceSubtask serviceSubtask1 = serviceSubtaskMapper.selectServiceSubtaskById(Long.valueOf(phoneCallReqYQVO.getTaskid()));
+        if (serviceSubtask1 != null) {
+            serviceSubtaskDetail.setTaskid(serviceSubtask1.getTaskid());
+            serviceSubtaskDetail.setPatid(serviceSubtask1.getPatid());
+        }
         serviceSubtaskDetail.setUuid(phoneCallReqYQVO.getUuid());
         serviceSubtaskDetail.setPhone(phoneCallReqYQVO.getPhone());
         serviceSubtaskDetail.setOperate(serviceSubtask.getCreateBy());
@@ -1598,7 +1705,7 @@
             if (ivrTaskTemplateTargetoption.getIsUserOperation() == 1) {
                 serviceSubtaskDetail.setMatchedtext(ivrTaskTemplateTargetoption.getTargetvalue());
             }
-            serviceSubtaskDetail.setTargetvalue(StringUtils.isEmpty(serviceSubtaskDetail.getTargetvalue()) ? i + ivrTaskTemplateTargetoption.getTargetvalue() : serviceSubtaskDetail.getTargetvalue() + "  " + (i + 1) + ivrTaskTemplateTargetoption.getTargetvalue());
+            serviceSubtaskDetail.setTargetvalue(StringUtils.isEmpty(serviceSubtaskDetail.getTargetvalue()) ? ivrTaskTemplateTargetoption.getTargetvalue() : serviceSubtaskDetail.getTargetvalue() + "&" + ivrTaskTemplateTargetoption.getTargetvalue());
         }
 
         serviceSubtaskDetail.setAddtime(new Date());
diff --git a/smartor/src/main/java/com/smartor/service/impl/TemplateDeptServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/TemplateDeptServiceImpl.java
index 65f2f71..968ec84 100644
--- a/smartor/src/main/java/com/smartor/service/impl/TemplateDeptServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/TemplateDeptServiceImpl.java
@@ -45,7 +45,7 @@
     /**
      * 鏂板妯℃澘绉戝鍏宠仈
      *
-     * @param templateDept 妯℃澘绉戝鍏宠仈
+     * @param templateDepts 妯℃澘绉戝鍏宠仈
      * @return 缁撴灉
      */
     @Override
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibaScriptTargetoptionMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibaScriptTargetoptionMapper.xml
index ff7c3ee..ba14879 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibaScriptTargetoptionMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibaScriptTargetoptionMapper.xml
@@ -211,6 +211,15 @@
         where id = #{id}
     </update>
 
+    <update id="updateDynam" parameterType="com.smartor.domain.IvrLibaScriptTargetoption">
+        update ivr_liba_script_targetoption
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="nodynamiccruxsJson == null ">nodynamiccruxs = "",</if>
+            <if test="dynamiccruxsJson == null ">dynamiccruxs = "",</if>
+        </trim>
+        where id = #{id}
+    </update>
+
     <delete id="deleteIvrLibaScriptTargetoptionByTargetoptionid" parameterType="Long">
         update ivr_liba_script_targetoption
         <trim prefix="SET" suffixOverrides=",">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateTargetoptionMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateTargetoptionMapper.xml
index 214f8d0..a94d19a 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateTargetoptionMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateTargetoptionMapper.xml
@@ -219,6 +219,17 @@
         where id = #{id}
     </update>
 
+    <update id="updateDynamiccruxs" parameterType="com.smartor.domain.IvrLibaTemplateTargetoption">
+        update ivr_liba_template_targetoption
+        <trim prefix="SET" suffixOverrides=",">
+
+            <if test="nodynamiccruxsJson == null ">nodynamiccruxs = #{nodynamiccruxsJson},</if>
+            <if test="dynamiccruxsJson == null ">dynamiccruxs = #{dynamiccruxsJson},</if>
+
+        </trim>
+        where id = #{id}
+    </update>
+
     <update id="deleteIvrLibaTemplateTargetoptionById" parameterType="Long">
         update ivr_liba_template_targetoption
         <trim prefix="SET" suffixOverrides=",">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateMapper.xml
index 860682a..78560d3 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateMapper.xml
@@ -62,12 +62,14 @@
         <result property="instruction" column="instruction"/>
         <result property="sendDay" column="send_day"/>
         <result property="deptCode" column="dept_code"/>
+        <result property="longTemp" column="long_temp"/>
 
     </resultMap>
 
     <sql id="selectIvrTaskTemplateVo">
         select id,
                taskid,
+               long_temp,
                send_day,
                recallcount,
                instruction,
@@ -90,6 +92,7 @@
             resultMap="IvrTaskTemplateResult">
         <include refid="selectIvrTaskTemplateVo"/>
         <where>
+            del_flat=0
             <if test="taskid != null ">and taskid = #{taskid}</if>
             <if test="sendDay != null ">and send_day = #{sendDay}</if>
             <if test="id != null ">and id = #{id}</if>
@@ -146,12 +149,13 @@
             <if test="noVoiceNum != null ">and no_voice_num = #{noVoiceNum}</if>
             <if test="recallcount != null">and recallcount = #{prologrecallcountue}</if>
             <if test="deptCode != null">and dept_code = #{deptCode}</if>
+            <if test="longTemp != null">and long_temp = #{longTemp}</if>
         </where>
     </select>
 
     <select id="selectIvrTaskTemplateByID" parameterType="Long" resultMap="IvrTaskTemplateResult">
         <include refid="selectIvrTaskTemplateVo"/>
-        where id = #{id}
+        where id = #{id} and del_flag=0
     </select>
 
     <insert id="insertIvrTaskTemplate" parameterType="com.smartor.domain.IvrTaskTemplate" useGeneratedKeys="true"
@@ -214,6 +218,7 @@
             <if test="instruction != null ">instruction,</if>
             <if test="sendDay != null ">send_day,</if>
             <if test="deptCode != null">dept_code,</if>
+            <if test="longTemp != null">long_temp,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="taskid != null">#{taskid},</if>
@@ -272,6 +277,7 @@
             <if test="instruction != null ">#{instruction},</if>
             <if test="sendDay != null ">#{sendDay},</if>
             <if test="deptCode != null">#{deptCode},</if>
+            <if test="longTemp != null">#{longTemp},</if>
         </trim>
     </insert>
 
@@ -334,20 +340,22 @@
             <if test="instruction != null ">instruction = #{instruction},</if>
             <if test="sendDay != null ">send_day = #{sendDay},</if>
             <if test="deptCode != null">dept_code = #{deptCode},</if>
+            <if test="longTemp != null">long_temp = #{longTemp},</if>
         </trim>
         where id = #{id}
     </update>
 
-    <delete id="deleteIvrTaskTemplateByID" parameterType="Long">
-        delete
-        from ivr_task_template
+    <update id="deleteIvrTaskTemplateByID" parameterType="Long">
+        update ivr_task_template
+        set del_flag=1
         where id = #{id}
-    </delete>
+    </update>
 
-    <delete id="deleteIvrTaskTemplateByIDs" parameterType="String">
-        delete from ivr_task_template where id in
+    <update id="deleteIvrTaskTemplateByIDs" parameterType="String">
+        update ivr_task_template
+        set del_flag=1 where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>
-    </delete>
+    </update>
 </mapper>
diff --git a/smartor/src/main/resources/mapper/smartor/PatArchiveImportMapper.xml b/smartor/src/main/resources/mapper/smartor/PatArchiveImportMapper.xml
index df9a877..13392f0 100644
--- a/smartor/src/main/resources/mapper/smartor/PatArchiveImportMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatArchiveImportMapper.xml
@@ -22,6 +22,10 @@
         <result property="batchName" column="batch_name"/>
         <result property="batchNo" column="batch_no"/>
     </resultMap>
+    <resultMap type="com.ruoyi.common.core.domain.entity.SysUser" id="SysUserResult">
+        <id property="userId" column="user_id"/>
+        <result property="userName" column="user_name"/>
+    </resultMap>
 
     <sql id="selectPatArchiveImportVo">
         select id,
@@ -47,6 +51,7 @@
             resultMap="PatArchiveImportResult">
         <include refid="selectPatArchiveImportVo"/>
         <where>
+            del_flag=0
             <if test="patientno != null  and patientno != ''">
                 and patientno = #{patientno}
             </if>
@@ -78,6 +83,7 @@
                 and batch_no = #{batchNo}
             </if>
         </where>
+        ORDER BY create_time desc
     </select>
 
     <select id="selectPatArchiveImportById" parameterType="Long"
@@ -226,5 +232,64 @@
         </foreach>
     </update>
 
+    <select id="checkUserExist" parameterType="String" resultMap="SysUserResult">
+        select user_id, user_name
+        from sys_user
+        where id_card = #{idCard}
+          and del_flag = '0'
+    </select>
+
+    <insert id="insertUser" parameterType="com.ruoyi.common.core.domain.entity.SysUser" useGeneratedKeys="true"
+            keyProperty="userId">
+        insert into sys_user(
+        <if test="userId != null and userId != 0">user_id,</if>
+        <if test="deptId != null and deptId != 0">dept_id,</if>
+        <if test="userName != null and userName != ''">user_name,</if>
+        <if test="nickName != null and nickName != ''">nick_name,</if>
+        <if test="email != null and email != ''">email,</if>
+        <if test="avatar != null and avatar != ''">avatar,</if>
+        <if test="phonenumber != null and phonenumber != ''">phonenumber,</if>
+        <if test="sex != null and sex != ''">sex,</if>
+        <if test="password != null and password != ''">password,</if>
+        <if test="status != null and status != ''">status,</if>
+        <if test="createBy != null and createBy != ''">create_by,</if>
+        <if test="remark != null and remark != ''">remark,</if>
+        <if test="userType != null and userType != ''">user_type,</if>
+        <if test="deptInfo != null and deptInfo != ''">dept_info,</if>
+        <if test="hospInfo != null and hospInfo != ''">hosp_info,</if>
+        <if test="searchscope != null and searchscope != ''">searchscope,</if>
+        <if test="idCard != null and idCard != ''">id_card,</if>
+        create_time
+        )values(
+        <if test="userId != null and userId != ''">#{userId},</if>
+        <if test="deptId != null and deptId != ''">#{deptId},</if>
+        <if test="userName != null and userName != ''">#{userName},</if>
+        <if test="nickName != null and nickName != ''">#{nickName},</if>
+        <if test="email != null and email != ''">#{email},</if>
+        <if test="avatar != null and avatar != ''">#{avatar},</if>
+        <if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
+        <if test="sex != null and sex != ''">#{sex},</if>
+        <if test="password != null and password != ''">#{password},</if>
+        <if test="status != null and status != ''">#{status},</if>
+        <if test="createBy != null and createBy != ''">#{createBy},</if>
+        <if test="remark != null and remark != ''">#{remark},</if>
+        <if test="userType != null and userType != ''">#{userType},</if>
+        <if test="deptInfo != null and deptInfo != ''">#{deptInfo},</if>
+        <if test="hospInfo != null and hospInfo != ''">#{hospInfo},</if>
+        <if test="searchscope != null and searchscope != ''">#{searchscope},</if>
+        <if test="idCard != null and idCard != ''">#{idCard},</if>
+        sysdate()
+        )
+    </insert>
+
+    <insert id="insertUserRole" parameterType="com.ruoyi.common.core.domain.entity.SysUserRole">
+        insert into sys_user_role(
+        <if test="roleId != null ">role_id,</if>
+        <if test="userId != null ">user_id</if>
+        )values(
+        <if test="roleId != null ">#{roleId},</if>
+        <if test="userId != null">#{userId}</if>
+        )
+    </insert>
 
 </mapper>
diff --git a/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml b/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
index 1349cf4..a3e5189 100644
--- a/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
@@ -49,6 +49,14 @@
         <result property="ageUnit" column="age_unit"/>
         <result property="leavehospitaldistrictname" column="leavehospitaldistrictname"/>
         <result property="leavehospitaldistrictcode" column="leavehospitaldistrictcode"/>
+        <result property="careFacilities" column="care_facilities"/>
+        <result property="casePath" column="case_path"/>
+        <result property="degreeOfEducation" column="degree_of_education"/>
+        <result property="maritalStatus" column="marital_status"/>
+        <result property="income" column="income"/>
+        <result property="medicareType" column="medicare_type"/>
+        <result property="carePerson" column="care_person"/>
+        <result property="casePersonAge" column="case_person_age"/>
     </resultMap>
 
 
@@ -138,7 +146,15 @@
                isupload,
                pattype,
                viptype,
-               upload_time
+               upload_time,
+               care_facilities,
+               case_path,
+               degree_of_education,
+               marital_status,
+               income,
+               medicare_type,
+               care_person,
+               case_person_age
         from pat_archive
     </sql>
 
@@ -162,6 +178,14 @@
             <if test="ageUnit != null ">and age_unit = #{ageUnit}</if>
             <if test="notrequiredFlag != null ">and notrequired_flag = #{notrequiredFlag}</if>
             <if test="notrequiredreason != null ">and notrequiredreason = #{notrequiredreason}</if>
+            <if test="careFacilities != null ">and care_facilities = #{careFacilities}</if>
+            <if test="casePath != null ">and case_path = #{casePath}</if>
+            <if test="degreeOfEducation != null ">and degree_of_education = #{degreeOfEducation}</if>
+            <if test="maritalStatus != null ">and marital_status = #{maritalStatus}</if>
+            <if test="income != null ">and income = #{income}</if>
+            <if test="medicareType != null ">and medicare_type = #{medicareType}</if>
+            <if test="carePerson != null ">and care_person = #{carePerson}</if>
+            <if test="casePersonAge != null ">and case_person_age = #{casePersonAge}</if>
         </where>
     </select>
 
@@ -185,7 +209,15 @@
         a.create_time,
         a.update_time,
         a.viptype,
-        a.birthdate
+        a.birthdate,
+        a.care_facilities,
+        a.case_path,
+        a.degree_of_education,
+        a.marital_status,
+        a.income,
+        a.medicare_type,
+        a.care_person,
+        a.case_person_age
         from pat_archive a,pat_archivetag b ,base_tag c
         <where>
             a.del_flag=0 and
@@ -245,6 +277,14 @@
             <if test="ageUnit != null">age_unit,</if>
             <if test="notrequiredFlag != null ">notrequired_flag,</if>
             <if test="notrequiredreason != null ">notrequiredreason,</if>
+            <if test="careFacilities != null ">care_facilities,</if>
+            <if test="casePath != null ">case_path,</if>
+            <if test="degreeOfEducation != null ">degree_of_education,</if>
+            <if test="maritalStatus != null ">marital_status,</if>
+            <if test="income != null ">income,</if>
+            <if test="medicareType != null ">medicare_type,</if>
+            <if test="carePerson != null ">care_person,</if>
+            <if test="casePersonAge != null ">case_person_age,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="patientno != null">#{patientno},</if>
@@ -282,18 +322,29 @@
             <if test="ageUnit != null">#{ageUnit},</if>
             <if test="notrequiredFlag != null ">#{notrequiredFlag},</if>
             <if test="notrequiredreason != null ">#{notrequiredreason},</if>
+            <if test="careFacilities != null ">#{careFacilities},</if>
+            <if test="casePath != null ">#{casePath},</if>
+            <if test="degreeOfEducation != null ">#{degreeOfEducation},</if>
+            <if test="maritalStatus != null ">#{maritalStatus},</if>
+            <if test="income != null ">#{income},</if>
+            <if test="medicareType != null ">#{medicareType},</if>
+            <if test="carePerson != null ">#{carePerson},</if>
+            <if test="casePersonAge != null ">#{casePersonAge},</if>
         </trim>
     </insert>
 
     <insert id="insertPatArchive">
         insert into
         pat_archive(name,viptype,sex,idcardno,birthdate,place_of_residence,age,sourcefrom,archivetime,archiveby,telcode,relativetelcode,idcardtype,orgid,openid,dduserid,update_by,update_time
-        ,create_by,create_time,isupload,upload_time,pattype,nation,birthplace,native_place,patientno,patid_his,sd_flag,age_unit,notrequired_flag,notrequiredreason)
+        ,create_by,create_time,isupload,upload_time,pattype,nation,birthplace,native_place,patientno,patid_his,sd_flag,age_unit,notrequired_flag,notrequiredreason,care_facilities,case_path,
+        degree_of_education,marital_status,income,medicare_type,care_person,case_person_age)
         values
         <foreach item="item" index="index" collection="list" separator=",">
             (#{item.name},#{item.viptype},#{item.sex},#{item.idcardno},#{item.birthdate},#{item.placeOfResidence},#{item.age},#{item.sourcefrom},#{item.archivetime},#{item.archiveby}
             ,#{item.telcode},#{item.archiveby},#{item.idcardtype},#{item.orgid},#{item.openid},#{item.dduserid},#{item.updateBy},
-            #{item.updateTime},#{item.createBy},#{item.createTime},#{item.isupload},#{item.uploadTime},#{item.pattype},#{item.nation},#{item.birthplace},#{item.nativePlace},#{item.patientno},#{item.patidHis},#{item.sdFlag},#{item.ageUnit},#{item.notrequiredFlag},#{item.notrequiredreason}
+            #{item.updateTime},#{item.createBy},#{item.createTime},#{item.isupload},#{item.uploadTime},#{item.pattype},#{item.nation},#{item.birthplace},#{item.nativePlace},#{item.patientno},
+            #{item.patidHis},#{item.sdFlag},#{item.ageUnit},#{item.notrequiredFlag},#{item.notrequiredreason}
+            ,#{item.careFacilities},#{item.casePath},#{item.degreeOfEducation},#{item.maritalStatus},#{item.income},#{item.medicareType},#{item.carePerson},#{item.casePersonAge})
         </foreach>
     </insert>
 
@@ -329,6 +380,14 @@
             <if test="ageUnit != null">age_unit = #{ageUnit},</if>
             <if test="notrequiredFlag != null ">notrequired_flag = #{notrequiredFlag},</if>
             <if test="notrequiredreason != null ">notrequiredreason = #{notrequiredreason},</if>
+            <if test="careFacilities != null ">care_facilities = #{careFacilities},</if>
+            <if test="casePath != null ">case_path = #{casePath},</if>
+            <if test="degreeOfEducation != null ">degree_of_education = #{degreeOfEducation},</if>
+            <if test="maritalStatus != null ">marital_status = #{maritalStatus},</if>
+            <if test="income != null ">income = #{income},</if>
+            <if test="medicareType != null ">medicare_type = #{medicareType},</if>
+            <if test="carePerson != null ">care_person = #{carePerson},</if>
+            <if test="casePersonAge != null ">case_person_age = #{casePersonAge},</if>
         </trim>
         where id = #{id}
     </update>

--
Gitblit v1.9.3