From 24166f2d9ae0bb72f061a38b96a113b1b6e44fbc Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期一, 02 二月 2026 17:17:52 +0800
Subject: [PATCH] 代码提交

---
 smartor/src/main/java/com/smartor/domain/PatArchiveReq.java                                  |    4 
 smartor/src/main/java/com/smartor/domain/ServiceSubtask.java                                 |    7 
 smartor/src/main/java/com/smartor/domain/IvrTaskTemplateVO.java                              |    3 
 smartor/src/main/resources/mapper/smartor/IvrLibaTemplateMapper.xml                          |    8 
 smartor/src/main/java/com/smartor/domain/PatServiceContract.java                             |  143 +++++
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatServiceContractController.java |  113 ++++
 smartor/src/main/java/com/smartor/domain/IvrLibaTemplate.java                                |    3 
 smartor/src/main/java/com/smartor/domain/PatArchive.java                                     |    4 
 smartor/src/main/java/com/smartor/domain/PatArchiveOthreInfo.java                            |    3 
 smartor/src/main/java/com/smartor/service/IPatServiceContractService.java                    |   61 ++
 smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java                  |  102 +++
 smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java                |  237 ++++++++
 smartor/src/main/java/com/smartor/common/RandomStringGenerator.java                          |    2 
 smartor/src/main/resources/mapper/smartor/PatServiceContractMapper.xml                       |  357 ++++++++++++
 smartor/src/main/java/com/smartor/domain/PatArchiveVO.java                                   |    4 
 smartor/src/main/resources/mapper/smartor/IvrTaskTemplateMapper.xml                          |    8 
 smartor/src/main/java/com/smartor/domain/ServiceSubtaskVO.java                               |   32 +
 smartor/src/main/java/com/smartor/service/impl/PatServiceContractServiceImpl.java            |   95 +++
 smartor/src/main/java/com/smartor/domain/SvyTaskTemplate.java                                |    3 
 smartor/src/main/java/com/smartor/domain/IvrTaskTemplate.java                                |    3 
 smartor/src/main/java/com/smartor/domain/ServiceSubtaskStatistic.java                        |    7 
 smartor/src/main/java/com/smartor/domain/SvyTaskTemplateVO.java                              |    3 
 smartor/src/main/java/com/smartor/domain/ServiceOutPath.java                                 |    3 
 ruoyi-admin/src/main/resources/application.yml                                               |    2 
 smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml                           |   28 
 smartor/src/main/resources/mapper/smartor/SvyTaskTemplateMapper.xml                          |   11 
 smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml                               |   19 
 ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java                                 |   35 -
 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java             |   36 +
 smartor/src/main/java/com/smartor/domain/PatArchiveOut.java                                  |    4 
 smartor/src/main/java/com/smartor/mapper/PatServiceContractMapper.java                       |   63 ++
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java     |    6 
 smartor/src/main/java/com/smartor/service/impl/IvrLibaTargetAssortServiceImpl.java           |    3 
 ruoyi-admin/src/main/resources/application-druid.yml                                         |   50 -
 ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java                       |  167 -----
 ruoyi-admin/src/main/java/com/ruoyi/web/test/MQTest.java                                     |    6 
 smartor/src/main/java/com/smartor/domain/ServiceSubtaskRecord.java                           |    7 
 smartor/src/main/java/com/smartor/domain/IvrLibaTemplateVO.java                              |    3 
 38 files changed, 1,387 insertions(+), 258 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 6e2e9fe..376be54 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
@@ -11,7 +11,7 @@
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.http.HttpUtils;
 import com.ruoyi.common.utils.sign.Md5Utils;
-import com.ruoyi.quartz.util.RandomStringGenerator;
+import com.smartor.common.RandomStringGenerator;
 import com.smartor.common.SendService;
 import com.smartor.config.RobotPhoneUtils;
 import com.smartor.domain.*;
@@ -73,16 +73,10 @@
     private RedisCache redisCache;
 
     @Autowired
-    private RobotPhoneUtils robotPhoneUtils;
-
-    @Autowired
     private ServiceTaskMapper svyTaskMapper;
 
     @Autowired
     private ServiceSubtaskMapper serviceSubtaskMapper;
-
-    @Autowired
-    private ISvyTaskTemplateService iSvyTaskTemplateService;
 
     @Autowired
     private IServiceSubtaskRecordService serviceSubtaskRecordService;
@@ -194,7 +188,6 @@
                             //濡傛灉contains涓嶄负true,璇存槑褰撳墠鐨勬偅鑰呭凡缁忓彂閫佹垚鍔燂紝鐩存帴寰幆涓嬩竴涓汉灏辫
                             if (!contains) continue;
                         }
-
                         try {
                             ServiceTask ivrTask = ivrTaskMapper.selectServiceTaskByTaskid(serviceSubtask.getTaskid());
                             if (ivrTask.getSendState() != null && ivrTask.getSendState() == 3 || ivrTask.getSendState() != null && ivrTask.getSendState() == 4) {
@@ -291,7 +284,6 @@
                     //鐭俊
                     //瀵箄rl涓袱涓弬鏁板姞瀵�
                     RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
-                    String taskId = rsaPublicKeyExample.encryptedData(ivrTask1.getTaskid().toString(), pub_key);
 
                     for (ServiceSubtask serviceSubtask : selectServiceSubtaskList) {
                         //鍏堝垽鏂竴涓嬶紝subIds鏄惁涓虹┖锛屽鏋滀笉涓虹┖锛屽彧鎵цsubIds閲岀殑鎮h��
@@ -303,74 +295,23 @@
                         }
 
                         try {
-                            String patid = rsaPublicKeyExample.encryptedData(serviceSubtask.getPatid().toString(), pub_key);
                             SendMagParam sendMagParam = new SendMagParam();
                             sendMagParam.setType("4");
                             if (type == 1) {
                                 //闅忚
-                                ServiceOutPath serviceOutPath = new ServiceOutPath();
-                                serviceOutPath.setParam1(taskId);
-                                serviceOutPath.setParam2(patid);
-                                serviceOutPath.setCreateTime(new Date());
-                                iServiceOutPathService.insertServiceOutPath(serviceOutPath);
-//                                sendMagParam.setUrl(ip + ":" + req_path + "/followvisit/particty?param1=" + taskId + "&param2=" + patid + "&param5=false");
-                                //杞垚16杩涘埗
-                                String format = String.format("%03X", serviceOutPath.getId()) + RandomStringGenerator.generateRandomString();
-                                serviceOutPath.setRadix(format);
-                                serviceOutPath.setUpdateTime(new Date());
-                                iServiceOutPathService.updateServiceOutPath(serviceOutPath);
-                                sendMagParam.setPhone(serviceSubtask.getPhone());
-                                sendMagParam.setUrl(ip + ":" + req_path + "/sf?p=" + format);
-                                sendMagParam.setContent("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌闅忚璋冩煡琛紝璇风偣鍑�" + sendMagParam.getUrl() + "   濉啓銆傛劅璋㈡偍閰嶅悎锛�");
-                                log.info("888888888888:{}", sendMagParam);
+                                sendMagParam.setContent("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌闅忚璋冩煡琛紝璇风偣鍑�" + serviceSubtask.getOutPath() + "   濉啓銆傛劅璋㈡偍閰嶅悎锛�");
                             } else if (type == 2) {
                                 //闂埜锛堥棶棰橈級
-                                ServiceOutPath serviceOutPath = new ServiceOutPath();
-                                serviceOutPath.setParam1(taskId);
-                                serviceOutPath.setParam2(patid);
-//                                serviceOutPath.setParam3(URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()));
-                                serviceOutPath.setParam3(ivrTask1.getTaskName());
-                                serviceOutPath.setCreateTime(new Date());
-                                iServiceOutPathService.insertServiceOutPath(serviceOutPath);
-                                String format = String.format("%03X", serviceOutPath.getId()) + RandomStringGenerator.generateRandomString();
-                                serviceOutPath.setRadix(format);
-                                serviceOutPath.setUpdateTime(new Date());
-                                iServiceOutPathService.updateServiceOutPath(serviceOutPath);
-
-//                                sendMagParam.setUrl(ip + ":" + req_path + "/outsideChainwt?param1=" + taskId + "&param2=" + patid + "&param3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "&param5=false");
-                                sendMagParam.setPhone(serviceSubtask.getPhone());
-                                sendMagParam.setUrl(ip + ":" + req_path + "/wt?p=" + format);
-                                sendMagParam.setContent("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌璋冩煡琛紝璇风偣鍑�" + sendMagParam.getUrl() + "   濉啓銆傛劅璋㈡偍閰嶅悎锛�");
-                                log.info("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌璋冩煡琛紝璇风偣鍑�,{}", sendMagParam.getUrl());
+                                sendMagParam.setContent("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌璋冩煡琛紝璇风偣鍑�" + serviceSubtask.getOutPath() + "   濉啓銆傛劅璋㈡偍閰嶅悎锛�");
                             } else if (type == 3) {
                                 //瀹f暀
-                                ServiceOutPath serviceOutPath = new ServiceOutPath();
-                                serviceOutPath.setParam1(taskId);
-                                serviceOutPath.setParam2(patid);
-//                                serviceOutPath.setParam3(URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()));
-                                serviceOutPath.setParam3(ivrTask1.getTaskName());
-                                serviceOutPath.setCreateTime(new Date());
-                                iServiceOutPathService.insertServiceOutPath(serviceOutPath);
-                                String format = String.format("%03X", serviceOutPath.getId()) + RandomStringGenerator.generateRandomString();
-                                serviceOutPath.setRadix(format);
-                                serviceOutPath.setUpdateTime(new Date());
-                                iServiceOutPathService.updateServiceOutPath(serviceOutPath);
-//                                sendMagParam.setUrl(ip + ":" + req_path + "/outsideChainxj?param1=" + taskId + "&param2=" + patid + "&param3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "&param5=false");
-                                sendMagParam.setPhone(serviceSubtask.getPhone());
-                                sendMagParam.setUrl(ip + ":" + req_path + "/xj?p=" + format);
-                                sendMagParam.setContent("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌瀹f暀璋冩煡琛紝璇风偣鍑�" + sendMagParam.getUrl() + "鏌ョ湅銆傛劅璋㈡偍閰嶅悎锛�");
-                                log.info("-----------sendMagParam鐨勫�间负锛歿}", sendMagParam);
+                                sendMagParam.setContent("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌瀹f暀璋冩煡琛紝璇风偣鍑�" + serviceSubtask.getOutPath() + "鏌ョ湅銆傛劅璋㈡偍閰嶅悎锛�");
                             }
-                            //鐭俊杩橀渶瑕佹ā鏉�
-//                            Map<String, String> req = new HashMap<>();
-//                            req.put("phone", sendMagParam.getPhone());
-//                            req.put("content", sendMagParam.getContent());
-//                            String s = HttpUtil.postJsonRequest(xhsmsPath, new Gson().toJson(req));
-                            //send_mac锛氱鍚嶅�硷紝=md5(send_source+send_to_mobiles+send_text+绛惧悕缂栫爜)锛�32浣嶅皬鍐�
-                            String mac = "shuifang" + sendMagParam.getPhone() + sendMagParam.getContent() + "ShuiFang_jjty_20250106";
+
+                            String mac = "shuifang" + serviceSubtask.getPhone() + sendMagParam.getContent() + "ShuiFang_jjty_20250106";
 
                             StringBuilder strb = new StringBuilder();
-                            strb.append("send_source=shuifang&send_to_mobiles=" + sendMagParam.getPhone());
+                            strb.append("send_source=shuifang&send_to_mobiles=" + serviceSubtask.getPhone());
                             strb.append("&send_text=" + sendMagParam.getContent());
                             strb.append("&send_mac=" + Md5Utils.hash(mac));
                             SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddhhmmsszzz"); // 杈撳嚭鏃ユ湡鏍煎紡
@@ -414,7 +355,6 @@
                         serviceSubtask.setRemark("鐭俊鍙戦�佹垚鍔�");
                         serviceSubtask.setGuid(uuid);
                         serviceSubtask.setSendstate(3L);
-//                        serviceSubtask.setFinishtime(new Date());
                         serviceSubtaskMapper.updateServiceSubtask(serviceSubtask);
 
                         //浠诲姟鍙戦�佽褰�
@@ -455,62 +395,6 @@
                             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";
-////                            } else if (type == 2) {
-////                                url = ip + ":" + req_path + "/outsideChainwt?param1=" + taskId + "&param2=" + patid + "&param3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "&param5=false";
-////                            } else if (type == 3) {
-////                                url = ip + ":" + req_path + "/outsideChainxj?param1=" + taskId + "&param2=" + patid + "&param3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "&param5=false";
-////                            }
-//                            if (type == 1) {
-//                                //闅忚
-//                                ServiceOutPath serviceOutPath = new ServiceOutPath();
-//                                serviceOutPath.setParam1(taskId);
-//                                serviceOutPath.setParam2(patid);
-//                                serviceOutPath.setCreateTime(new Date());
-//                                iServiceOutPathService.insertServiceOutPath(serviceOutPath);
-//                                String format = String.format("%03X", serviceOutPath.getId());
-//                                serviceOutPath.setRadix(format);
-//                                serviceOutPath.setUpdateTime(new Date());
-//                                iServiceOutPathService.updateServiceOutPath(serviceOutPath);
-////                                sendMagParam.setUrl(ip + ":" + req_path + "/followvisit/particty?param1=" + taskId + "&param2=" + patid + "&param5=false");
-//                                url = ip + ":" + req_path + "/sf?p=" + format;
-//                            } else if (type == 2) {
-//                                //闂埜
-//                                ServiceOutPath serviceOutPath = new ServiceOutPath();
-//                                serviceOutPath.setParam1(taskId);
-//                                serviceOutPath.setParam2(patid);
-////                                serviceOutPath.setParam3(URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()));
-//                                serviceOutPath.setParam3(ivrTask1.getTaskName());
-//                                serviceOutPath.setCreateTime(new Date());
-//                                iServiceOutPathService.insertServiceOutPath(serviceOutPath);
-//                                String format = String.format("%03X", serviceOutPath.getId());
-//                                serviceOutPath.setRadix(format);
-//                                serviceOutPath.setUpdateTime(new Date());
-//                                iServiceOutPathService.updateServiceOutPath(serviceOutPath);
-////                                sendMagParam.setUrl(ip + ":" + req_path + "/outsideChainwt?param1=" + taskId + "&param2=" + patid + "&param3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "&param5=false");
-//                                url = ip + ":" + req_path + "/wt?p=" + format;
-//                            } else if (type == 3) {
-//                                //瀹f暀
-//                                ServiceOutPath serviceOutPath = new ServiceOutPath();
-//                                serviceOutPath.setParam1(taskId);
-//                                serviceOutPath.setParam2(patid);
-////                                serviceOutPath.setParam3(URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()));
-//                                serviceOutPath.setParam3(ivrTask1.getTaskName());
-//                                serviceOutPath.setCreateTime(new Date());
-//                                iServiceOutPathService.insertServiceOutPath(serviceOutPath);
-//                                String format = String.format("%03X", serviceOutPath.getId());
-//                                serviceOutPath.setRadix(format);
-//                                serviceOutPath.setUpdateTime(new Date());
-//                                iServiceOutPathService.updateServiceOutPath(serviceOutPath);
-//                                url = ip + ":" + req_path + "/xj?p=" + format;
-//                            }
-//
-//                            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) {
@@ -526,7 +410,6 @@
                                 serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord);
                                 continue;
                             }
-//                            }
                         } catch (Exception e) {
                             ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord();
                             serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString());
@@ -581,7 +464,6 @@
                     serviceSubtask.setRemark("鍙戦�佸け璐�");
                     serviceSubtask.setSendstate(5L);
                     serviceSubtask.setId(id);
-//                    serviceSubtask.setFinishtime(new Date());
                     serviceSubtaskMapper.updateServiceSubtask(serviceSubtask);
                 }
             }
@@ -589,41 +471,6 @@
 
     }
 
-    //    /**
-//     * 鏈哄櫒浜虹涓�鍙ヨ瘽璇煶
-//     * concurrency = "50"  骞跺彂鏁颁负50
-//     */
-//    @RabbitListener(queues = "ob_queue", concurrency = "50")
-//    public void obVisit(String content, Message message, Channel channel) throws IOException {
-//        try {
-//            IvrTaskcallPhoneMQ commonTaskcallMQ = null;
-//            ObjectMapper mapper = new ObjectMapper();
-//            commonTaskcallMQ = mapper.readValue(content, IvrTaskcallPhoneMQ.class);
-//            //鍒ゆ柇鎮h�呮槸鍚﹀凡缁忔帴鐢佃瘽
-//            String str = redisCache.getCacheObject(commonTaskcallMQ.getUuid() + "state_id");
-//            System.out.println("-----------------" + str);
-//            if (StringUtils.isNotEmpty(str) && str.equals("0")) {
-//                //鎮h�呭凡缁忔帴鍚簡鐢佃瘽
-//                new PhoneUtils().ttsPlayback(commonTaskcallMQ.getScript(), commonTaskcallMQ.getUuid());
-//            } else if (StringUtils.isNotEmpty(str) && str.equals("-10")) {
-//                //杩欎釜璇存槑,宸茬粡鎵撲簡鎸囧畾閬嶆暟杩樻槸娌℃湁浜烘帴锛屽彲浠ュ皢娑堟伅浠庨槦鍒椾腑绉婚櫎浜�
-//                channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
-//                return;
-//            } else {
-//                //杩涜闃熷垪灏鹃儴锛岃繘琛屼笅涓�娆℃牎楠�
-////                channel.basicRecover(false);
-//                channel.basicReject(message.getMessageProperties().getDeliveryTag(), true);
-//                System.out.println("++++++++++++++++++++++" + str);
-//                return;
-//            }
-//            //閫氱煡 MQ 娑堟伅宸茶鎺ユ敹,鍙互ACK(浠庨槦鍒椾腑鍒犻櫎)浜�   锛堣繖涓渶瑕佹牴鎹笟鍔″啀鍘诲鐞咥CK锛�
-//            channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
-//        } catch (Exception e) {
-//            log.error("============娑堣垂澶辫触,灏濊瘯娑堟伅琛ュ彂鍐嶆娑堣垂!==============");
-//            log.error(e.getMessage());
-//            channel.basicReject(message.getMessageProperties().getDeliveryTag(), true);
-//        }
-//    }
     private String getKey() {
         Map<String, String> map = new HashMap<>();
         for (int i = 0; i < 6; i++) {
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatServiceContractController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatServiceContractController.java
new file mode 100644
index 0000000..8707469
--- /dev/null
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatServiceContractController.java
@@ -0,0 +1,113 @@
+package com.ruoyi.web.controller.smartor;
+
+import java.util.List;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.smartor.domain.PatServiceContract;
+import com.smartor.service.IPatServiceContractService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 銆愭偅鑰呮湇鍔$绾︺�慍ontroller
+ *
+ * @author lihu
+ * @date 2025-12-08
+ */
+@Api("鎮h�呮湇鍔$绾�")
+@RestController
+@RequestMapping("/smartor/contract")
+public class PatServiceContractController extends BaseController
+{
+    @Autowired
+    private IPatServiceContractService patServiceContractService;
+
+    /**
+     * 鏌ヨ銆愭偅鑰呮湇鍔$绾︺�戝垪琛�
+     */
+    @ApiOperation("鏌ヨ銆愭偅鑰呮湇鍔$绾︺�戝垪琛�")
+    //@PreAuthorize("@ss.hasPermi('smartor:contract:list')")
+    @PostMapping("/list")
+    public TableDataInfo list(@RequestBody PatServiceContract patServiceContract)
+    {
+        startPage();
+        List<PatServiceContract> list = patServiceContractService.selectPatServiceContractList(patServiceContract);
+        return getDataTable(list);
+    }
+
+    /**
+     * 瀵煎嚭銆愭偅鑰呮湇鍔$绾︺�戝垪琛�
+     */
+    @ApiOperation("瀵煎嚭銆愭偅鑰呮湇鍔$绾︺�戝垪琛�")
+    //@PreAuthorize("@ss.hasPermi('smartor:contract:export')")
+    @Log(title = "銆愯濉啓鍔熻兘鍚嶇О銆�", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, PatServiceContract patServiceContract)
+    {
+        List<PatServiceContract> list = patServiceContractService.selectPatServiceContractList(patServiceContract);
+        ExcelUtil<PatServiceContract> util = new ExcelUtil<PatServiceContract>(PatServiceContract.class);
+        util.exportExcel(response, list, "銆愯濉啓鍔熻兘鍚嶇О銆戞暟鎹�");
+    }
+
+    /**
+     * 鑾峰彇銆愭偅鑰呮湇鍔$绾︺�戣缁嗕俊鎭�
+     */
+    @ApiOperation("鑾峰彇銆愭偅鑰呮湇鍔$绾︺�戣缁嗕俊鎭�")
+    //@PreAuthorize("@ss.hasPermi('smartor:contract:query')")
+    @GetMapping(value = "/getInfo/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(patServiceContractService.selectPatServiceContractById(id));
+    }
+
+    /**
+     * 鏂板銆愭偅鑰呮湇鍔$绾︺��
+     */
+    @ApiOperation("鏂板銆愭偅鑰呮湇鍔$绾︺��")
+    //@PreAuthorize("@ss.hasPermi('smartor:contract:add')")
+    @Log(title = "銆愭偅鑰呮湇鍔$绾︺��", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    public AjaxResult add(@RequestBody PatServiceContract patServiceContract)
+    {
+        return toAjax(patServiceContractService.insertPatServiceContract(patServiceContract));
+    }
+
+    /**
+     * 淇敼銆愭偅鑰呮湇鍔$绾︺��
+     */
+    @ApiOperation("淇敼銆愭偅鑰呮湇鍔$绾︺��")
+    //@PreAuthorize("@ss.hasPermi('smartor:contract:edit')")
+    @Log(title = "銆愭偅鑰呮湇鍔$绾︺��", businessType = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    public AjaxResult edit(@RequestBody PatServiceContract patServiceContract)
+    {
+        return toAjax(patServiceContractService.updatePatServiceContract(patServiceContract));
+    }
+
+    /**
+     * 鍒犻櫎銆愭偅鑰呮湇鍔$绾︺��
+     */
+    @ApiOperation("鍒犻櫎銆愭偅鑰呮湇鍔$绾︺��")
+    //@PreAuthorize("@ss.hasPermi('smartor:contract:remove')")
+    @Log(title = "銆愯濉啓鍔熻兘鍚嶇О銆�", businessType = BusinessType.DELETE)
+	@GetMapping("/remove/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(patServiceContractService.deletePatServiceContractByIds(ids));
+    }
+}
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 63bf27b..1bdbc7a 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
@@ -13,8 +13,8 @@
 import com.ruoyi.common.utils.PageUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.smartor.domain.*;
-import com.smartor.service.IServiceSubtaskRecordService;
-import com.smartor.service.IServiceSubtaskService;
+import com.smartor.service.*;
+import com.smartor.service.impl.IvrTaskTemplateServiceImpl;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
@@ -23,6 +23,7 @@
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
+import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -78,7 +79,6 @@
         return getDataTable2(total, list);
 //        return getDataTable(serviceSubtaskService.patItem(ivrTaskcall));
     }
-
 
     /**
      * 鏌ヨ鎮h�呴殢璁夸俊鎭�
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 7c40ee1..4e07259 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
@@ -50,10 +50,10 @@
     @Test
     public void bb() {
         RSAPublicKeyExample rsaPublicKeyExample=new RSAPublicKeyExample();
-//        String s1 = rsaPublicKeyExample.encryptedData("123456", "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALQzqW1EIXBKGMu+2oEYSB5gM7Ox/ihyYTeeoE0yPX1qtt4++5yNOeTBVd6EEM4iKzVEzWj6REIWVwaSNPn/SvUCAwEAAQ==");
+        String s1 = rsaPublicKeyExample.encryptedData("123456", "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALQzqW1EIXBKGMu+2oEYSB5gM7Ox/ihyYTeeoE0yPX1qtt4++5yNOeTBVd6EEM4iKzVEzWj6REIWVwaSNPn/SvUCAwEAAQ==");
 
-        String s = rsaPublicKeyExample.decryptedData("J7V6yb5WHW63bQMbMyzxeT07HGesIXJwy9w77zBa6KG4PnWe7uaZh00vX21w%2Bn5FW8%2BjUAAU1HatqRWzFp7fvA%3D%3D", "MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEAtDOpbUQhcEoYy77agRhIHmAzs7H+KHJhN56gTTI9fWq23j77nI055MFV3oQQziIrNUTNaPpEQhZXBpI0+f9K9QIDAQABAkB3n0fcWfrcoMN/FU3VnrnZOEF6CzFNxkgU9P8y36QECWKZ9JhYQkNpKrMC9oXlN3VSaRigV7B+L/I/a0Rs1W+tAiEA4jx7xcXJ4y4BNwAmVHt6NNiEkzIwWnwC/0qsEu8NsOsCIQDL6MMn1D2uznC6OuOWpxDCkBh1JL1NzZTZeH2G+hj7nwIgKGAC9tjFnvWm4dn0/T7MIIJDpsFeP8fCAS2iZ/6hwuECIAS/eLvWr1EAsZNEh8QcQ8GkBU3E+ztyjAK8UX/xFt/VAiBf79/1tDErX4/DChecM8w3c3DhbBcjuE3fHZn7p6/UKg==");
-    System.out.println(s);
+//        String s = rsaPublicKeyExample.decryptedData("J7V6yb5WHW63bQMbMyzxeT07HGesIXJwy9w77zBa6KG4PnWe7uaZh00vX21w%2Bn5FW8%2BjUAAU1HatqRWzFp7fvA%3D%3D", "MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEAtDOpbUQhcEoYy77agRhIHmAzs7H+KHJhN56gTTI9fWq23j77nI055MFV3oQQziIrNUTNaPpEQhZXBpI0+f9K9QIDAQABAkB3n0fcWfrcoMN/FU3VnrnZOEF6CzFNxkgU9P8y36QECWKZ9JhYQkNpKrMC9oXlN3VSaRigV7B+L/I/a0Rs1W+tAiEA4jx7xcXJ4y4BNwAmVHt6NNiEkzIwWnwC/0qsEu8NsOsCIQDL6MMn1D2uznC6OuOWpxDCkBh1JL1NzZTZeH2G+hj7nwIgKGAC9tjFnvWm4dn0/T7MIIJDpsFeP8fCAS2iZ/6hwuECIAS/eLvWr1EAsZNEh8QcQ8GkBU3E+ztyjAK8UX/xFt/VAiBf79/1tDErX4/DChecM8w3c3DhbBcjuE3fHZn7p6/UKg==");
+    System.out.println(s1);
     }
 
     public void aa(MultipartFile file) throws IOException {
diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml
index 0f9e91a..2634768 100644
--- a/ruoyi-admin/src/main/resources/application-druid.yml
+++ b/ruoyi-admin/src/main/resources/application-druid.yml
@@ -6,28 +6,21 @@
     druid:
       # 涓诲簱鏁版嵁婧�
       master:
-        #        鍏徃
-        #        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:postgresql://192.168.2.202:15400/smartorwx2
-        #        username: csbsbxt
-        #        password: csbsbxt@123
-        #        driver-class-name: org.postgresql.Driver
         #      鏈湴楂樻柉
-        #        url: jdbc:postgresql://127.0.0.1:5432/postgres
-        #        username: gaussdb
-        #        password: Ls@123456
-        #        driver-class-name: org.postgresql.Driver
-        #      楂樻柉鏁版嵁搴撻摼鎺�
-        url: jdbc:postgresql://127.0.0.1:15400/smartorwx?prepareThreshold=0
-        username: shuifang
-        password: Shuifang@51868
+#        url: jdbc:postgresql://192.168.100.132:5432/postgres
+#        username: gaussdb
+#        password: Ls@123456
+#        driver-class-name: org.postgresql.Driver
+        #      鍏徃鏈嶅姟鍣ㄩ珮鏂�
+        url: jdbc:postgresql://haiershi.a1.luyouxia.net:26155/postgres
+        username: gaussdb
+        password: Gauss@123
         driver-class-name: org.postgresql.Driver
+        #      楂樻柉鏁版嵁搴撻摼鎺�
+      #        url: jdbc:postgresql://172.20.32.115:15400/smartorwx?prepareThreshold=0
+      #        username: shuifang
+      #        password: Shuifang@51868
+      #        driver-class-name: org.postgresql.Driver
 
       #        鍏徃浜�
       #        url: jdbc:mysql://116.62.18.175:6002/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
@@ -79,20 +72,19 @@
           # 鎱QL璁板綍
           log-slow-sql: true
           slow-sql-millis: 1000
-          merge-sql: false
+          merge-sql: true
         wall:
           config:
             multi-statement-allow: true
   # redis 閰嶇疆
   redis:
     #    # 鍦板潃锛堟棤閿′汉姘戝尰闄級
-    host: 127.0.0.1
-    port: 6020
+    #    host: 127.0.0.1
+    #    port: 6020
 
     # 鍦板潃锛堝叕鍙革級
-    #    host: 116.62.18.175
-    #    host: 192.168.1.10
-    #    port: 6020
+    host: 127.0.0.1
+    port: 6020
     # 鏁版嵁搴撶储寮�
     database: 0
     # 瀵嗙爜
@@ -125,7 +117,7 @@
     prefix: /api
     readonly: false
   sql-column-case: camel
-  show-sql: false #閰嶇疆鎵撳嵃SQL
+  show-sql: true #閰嶇疆鎵撳嵃SQL
   page-config:
     size: size
     page: page
@@ -182,8 +174,8 @@
 qrpath: D:\qrcode
 
 #鏃犻敗鍐呭閾捐姹侷P鍜岀鍙e彿
-req_path: 8092/wxsf
-localIP: http://www.wxchildren.com
+req_path: 8093
+localIP: 127.0.0.1
 #req_path: 8092
 #localIP: http://61.160.111.174
 
diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml
index ab6c255..f657b6a 100644
--- a/ruoyi-admin/src/main/resources/application.yml
+++ b/ruoyi-admin/src/main/resources/application.yml
@@ -75,7 +75,7 @@
     # 鍥介檯鍖栬祫婧愭枃浠惰矾寰�
     basename: i18n/messages
   profiles:
-    active: local
+    active: druid
   # 鏂囦欢涓婁紶
   servlet:
     multipart:
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 3cd0be3..add9d91 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
@@ -1,8 +1,6 @@
 package com.ruoyi.quartz.task;
 
-import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
-import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.common.reflect.TypeToken;
@@ -11,14 +9,12 @@
 import com.google.gson.JsonObject;
 import com.ruoyi.common.core.redis.RedisCache;
 import com.ruoyi.common.enums.ServiceFromEnum;
-import com.ruoyi.common.utils.DtoConversionUtils;
 import com.ruoyi.common.utils.HttpUtil;
 import com.ruoyi.common.utils.RSAPublicKeyExample;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.http.HttpUtils;
 import com.ruoyi.common.utils.sign.Md5Utils;
-import com.ruoyi.quartz.util.RandomStringGenerator;
-import com.smartor.common.SendService;
+import com.smartor.common.RandomStringGenerator;
 import com.smartor.domain.*;
 import com.smartor.mapper.ServiceSubtaskMapper;
 import com.smartor.mapper.ServiceTaskMapper;
@@ -26,7 +22,6 @@
 import com.smartor.service.*;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
@@ -36,7 +31,6 @@
 import java.io.File;
 import java.io.FileWriter;
 import java.io.IOException;
-import java.io.UnsupportedEncodingException;
 import java.lang.reflect.Type;
 import java.net.URLEncoder;
 import java.nio.charset.StandardCharsets;
@@ -44,9 +38,7 @@
 import java.nio.file.Paths;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.time.LocalDate;
 import java.time.LocalDateTime;
-import java.time.LocalTime;
 import java.time.ZoneId;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
@@ -387,8 +379,7 @@
                     }
 
                 } else if (descByCode.equals("鐭俊")) {
-                    RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
-                    String taskId = rsaPublicKeyExample.encryptedData(ivrTask1.getTaskid().toString(), pub_key);
+
                     for (ServiceSubtask serviceSubtask : selectServiceSubtaskList) {
                         log.error("鐭俊闀挎湡浠诲姟鍙戦��---------杩涙潵浜嗗悧锛焮}", serviceSubtask);
                         boolean dateToday = isDateToday(serviceSubtask.getLongSendTime());
@@ -401,33 +392,19 @@
                                     serviceSubtask.setResult("error");
                                     serviceSubtask.setRemark(patArchive.getNotrequiredreason());
                                     serviceSubtask.setSendstate(4L);
-//                                    serviceSubtask.setFinishtime(new Date());
                                     iServiceSubtaskService.insertServiceSubtask(serviceSubtask);
                                     continue;
                                 }
-                                String patid = rsaPublicKeyExample.encryptedData(serviceSubtask.getPatid().toString(), pub_key);
+
                                 SendMagParam sendMagParam = new SendMagParam();
                                 sendMagParam.setType("4");
-                                ServiceOutPath serviceOutPath = new ServiceOutPath();
-                                serviceOutPath.setParam1(taskId);
-                                serviceOutPath.setParam2(patid);
-                                serviceOutPath.setParam3(ivrTask1.getTaskName());
-                                serviceOutPath.setCreateTime(new Date());
-                                iServiceOutPathService.insertServiceOutPath(serviceOutPath);
-                                //鍗佸叚杩涘埗锛屽啀鍔犲皬鏃舵暟
-                                String format = String.format("%03X", serviceOutPath.getId()) + RandomStringGenerator.generateRandomString();
-                                serviceOutPath.setRadix(format);
-                                serviceOutPath.setUpdateTime(new Date());
-                                iServiceOutPathService.updateServiceOutPath(serviceOutPath);
-                                sendMagParam.setPhone(serviceSubtask.getPhone());
-                                sendMagParam.setUrl(ip + ":" + req_path + "/wt?p=" + format);
-                                sendMagParam.setContent("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌璋冩煡琛紝璇风偣鍑�" + sendMagParam.getUrl() + "   濉啓銆傛劅璋㈡偍閰嶅悎锛�");
+                                sendMagParam.setContent("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌璋冩煡琛紝璇风偣鍑�" + serviceSubtask.getOutPath() + "   濉啓銆傛劅璋㈡偍閰嶅悎锛�");
 
                                 //send_mac锛氱鍚嶅�硷紝=md5(send_source+send_to_mobiles+send_text+绛惧悕缂栫爜)锛�32浣嶅皬鍐�
-                                String mac = "shuifang" + sendMagParam.getPhone() + sendMagParam.getContent() + "ShuiFang_jjty_20250106";
+                                String mac = "shuifang" + serviceSubtask.getPhone() + sendMagParam.getContent() + "ShuiFang_jjty_20250106";
 
                                 StringBuilder strb = new StringBuilder();
-                                strb.append("send_source=shuifang&send_to_mobiles=" + sendMagParam.getPhone());
+                                strb.append("send_source=shuifang&send_to_mobiles=" + serviceSubtask.getPhone());
                                 strb.append("&send_text=" + sendMagParam.getContent());
                                 strb.append("&send_mac=" + Md5Utils.hash(mac));
                                 SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddhhmmsszzz"); // 杈撳嚭鏃ユ湡鏍煎紡
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 bb0465a..3edc1fc 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
@@ -4,6 +4,7 @@
 import com.ruoyi.common.constant.UserConstants;
 import com.ruoyi.common.core.domain.entity.*;
 import com.ruoyi.common.exception.ServiceException;
+import com.ruoyi.common.utils.DtoConversionUtils;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.bean.BeanValidators;
@@ -100,7 +101,7 @@
     /**
      * 閫氳繃鐢ㄦ埛鍚嶆煡璇㈢敤鎴�
      *
-     * @param userName 鐢ㄦ埛鍚�
+     * @param phone 鐢ㄦ埛鍚�
      * @return 鐢ㄦ埛瀵硅薄淇℃伅
      */
     @Override
@@ -133,6 +134,39 @@
             sysUserDept.setDeptType("2");
             sysUserDeptBQs = sysUserDeptMapper.selectSysUserDeptList(sysUserDept);
         }
+        if (StringUtils.isNotEmpty(userName) && userName.equals("admin")) {
+            //濡傛灉鏄痑dmin锛屽彧鑳藉幓sys_dept鍘诲彇鏁版嵁
+            SysDept dept = new SysDept();
+            dept.setDeptType("1");
+            sysDepts = sysDeptMapper.selectDeptList(dept);
+            sysUserDeptKSs = DtoConversionUtils.sourceToTarget(sysDepts, SysUserDept.class);
+
+            dept.setDeptType("2");
+            sysDepts = sysDeptMapper.selectDeptList(dept);
+            sysUserDeptBQs = DtoConversionUtils.sourceToTarget(sysDepts, SysUserDept.class);
+
+            List<SysUserDept> distinctUserDepts = new ArrayList<>();
+            Set<String> uniqueDeptCodes = new HashSet<>();
+            for (SysUserDept userDept : sysUserDeptKSs) {
+                String deptCode = userDept.getDeptCode();
+                if (StringUtils.isNotEmpty(deptCode) && !uniqueDeptCodes.contains(deptCode)) {
+                    distinctUserDepts.add(userDept);
+                    uniqueDeptCodes.add(deptCode);
+                }
+            }
+
+            List<SysUserDept> distinctUserBQs = new ArrayList<>();
+            Set<String> uniqueBQCodes = new HashSet<>();
+            for (SysUserDept userDept : sysUserDeptBQs) {
+                String deptCode = userDept.getDeptCode();
+                if (StringUtils.isNotEmpty(deptCode) && !uniqueBQCodes.contains(deptCode)) {
+                    distinctUserBQs.add(userDept);
+                    uniqueBQCodes.add(deptCode);
+                }
+            }
+            sysUserDeptKSs = distinctUserDepts;
+            sysUserDeptBQs = distinctUserBQs;
+        }
 
         sysUser.setDepts(deptIds);
         if (!CollectionUtils.isEmpty(sysUserDeptBQs)) {
diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/RandomStringGenerator.java b/smartor/src/main/java/com/smartor/common/RandomStringGenerator.java
similarity index 93%
rename from ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/RandomStringGenerator.java
rename to smartor/src/main/java/com/smartor/common/RandomStringGenerator.java
index 6ad863b..e9947dc 100644
--- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/RandomStringGenerator.java
+++ b/smartor/src/main/java/com/smartor/common/RandomStringGenerator.java
@@ -1,4 +1,4 @@
-package com.ruoyi.quartz.util;
+package com.smartor.common;
 
 import java.util.Random;
 
diff --git a/smartor/src/main/java/com/smartor/domain/IvrLibaTemplate.java b/smartor/src/main/java/com/smartor/domain/IvrLibaTemplate.java
index 574bd8a..c49b2ba 100644
--- a/smartor/src/main/java/com/smartor/domain/IvrLibaTemplate.java
+++ b/smartor/src/main/java/com/smartor/domain/IvrLibaTemplate.java
@@ -44,6 +44,9 @@
 //    @ApiModelProperty(value = "鎸囨爣鍚�")
 //    private String targetname;
 
+    @ApiModelProperty(value = "鍒嗗�肩被鍨嬶細1锛氭暟瀛楋紝2锛氱瓑绾�")
+    private String scoreType;
+
     /**
      * 妯℃澘鍚�
      */
diff --git a/smartor/src/main/java/com/smartor/domain/IvrLibaTemplateVO.java b/smartor/src/main/java/com/smartor/domain/IvrLibaTemplateVO.java
index 520c14b..6f1c668 100644
--- a/smartor/src/main/java/com/smartor/domain/IvrLibaTemplateVO.java
+++ b/smartor/src/main/java/com/smartor/domain/IvrLibaTemplateVO.java
@@ -29,6 +29,9 @@
     @ApiModelProperty(value = "涓婚敭")
     private Long id;
 
+    @ApiModelProperty(value = "鍒嗗�肩被鍨嬶細1锛氭暟瀛楋紝2锛氱瓑绾�")
+    private String scoreType;
+
     /**
      * 妯℃澘ID
      */
diff --git a/smartor/src/main/java/com/smartor/domain/IvrTaskTemplate.java b/smartor/src/main/java/com/smartor/domain/IvrTaskTemplate.java
index 1760a1e..c628a6a 100644
--- a/smartor/src/main/java/com/smartor/domain/IvrTaskTemplate.java
+++ b/smartor/src/main/java/com/smartor/domain/IvrTaskTemplate.java
@@ -396,5 +396,6 @@
     @ApiModelProperty(value = "鍑洪櫌澶╂暟锛堥暱鏈熶换鍔★紝鍑哄畨闄㈠悗锛岀鍑犲ぉ鍙戦�佷俊鎭級")
     private Integer sendDay;
 
-
+    @ApiModelProperty(value = "鍒嗗�肩被鍨嬶細1锛氭暟瀛楋紝2锛氱瓑绾�")
+    private String scoreType;
 }
diff --git a/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateVO.java b/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateVO.java
index d9a48fe..f558330 100644
--- a/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateVO.java
+++ b/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateVO.java
@@ -28,6 +28,9 @@
     @ApiModelProperty(value = "涓婚敭")
     private Long id;
 
+    @ApiModelProperty(value = "鍒嗗�肩被鍨嬶細1锛氭暟瀛楋紝2锛氱瓑绾�")
+    private String scoreType;
+
     /**
      * 浠诲姟id
      */
diff --git a/smartor/src/main/java/com/smartor/domain/PatArchive.java b/smartor/src/main/java/com/smartor/domain/PatArchive.java
index 0c117d8..3beb06b 100644
--- a/smartor/src/main/java/com/smartor/domain/PatArchive.java
+++ b/smartor/src/main/java/com/smartor/domain/PatArchive.java
@@ -383,6 +383,10 @@
     @ApiModelProperty("涓昏鐓ф姢浜哄勾榫�")
     @Excel(name = "涓昏鐓ф姢浜哄勾榫�")
     private String casePersonAge;
+
+    @ApiModelProperty("鐥呬汉鎽樿")
+    @Excel(name = "鐥呬汉鎽樿")
+    private String patientOverview;
     /**
      * pageNum
      */
diff --git a/smartor/src/main/java/com/smartor/domain/PatArchiveOthreInfo.java b/smartor/src/main/java/com/smartor/domain/PatArchiveOthreInfo.java
index 89c7696..47e663b 100644
--- a/smartor/src/main/java/com/smartor/domain/PatArchiveOthreInfo.java
+++ b/smartor/src/main/java/com/smartor/domain/PatArchiveOthreInfo.java
@@ -27,6 +27,9 @@
     @ApiModelProperty("鑷ID")
     private Long id;
 
+    @ApiModelProperty("鐥呬汉鎽樿")
+    @Excel(name = "鐥呬汉鎽樿")
+    private String patientOverview;
 
     /**
      * 鏈嶅姟鏍囪瘑锛�1锛岄渶瑕侊紝0锛屼笉闇�瑕�
diff --git a/smartor/src/main/java/com/smartor/domain/PatArchiveOut.java b/smartor/src/main/java/com/smartor/domain/PatArchiveOut.java
index 259cdea..ed51c36 100644
--- a/smartor/src/main/java/com/smartor/domain/PatArchiveOut.java
+++ b/smartor/src/main/java/com/smartor/domain/PatArchiveOut.java
@@ -29,6 +29,10 @@
     @ApiModelProperty("闂璇濇湳id锛堜富閿級")
     private Long patid;
 
+    @ApiModelProperty("鐥呬汉鎽樿")
+    @Excel(name = "鐥呬汉鎽樿")
+    private String patientOverview;
+
     /**
      * 鎮h�呯紪鍙�
      */
diff --git a/smartor/src/main/java/com/smartor/domain/PatArchiveReq.java b/smartor/src/main/java/com/smartor/domain/PatArchiveReq.java
index 3d748a6..498c144 100644
--- a/smartor/src/main/java/com/smartor/domain/PatArchiveReq.java
+++ b/smartor/src/main/java/com/smartor/domain/PatArchiveReq.java
@@ -28,6 +28,10 @@
     @Excel(name = " 鎮h�卛d ")
     private String patid;
 
+    @ApiModelProperty("鐥呬汉鎽樿")
+    @Excel(name = "鐥呬汉鎽樿")
+    private String patientOverview;
+
     /**
      * 濮撳悕
      */
diff --git a/smartor/src/main/java/com/smartor/domain/PatArchiveVO.java b/smartor/src/main/java/com/smartor/domain/PatArchiveVO.java
index 0e2e82d..14b9a99 100644
--- a/smartor/src/main/java/com/smartor/domain/PatArchiveVO.java
+++ b/smartor/src/main/java/com/smartor/domain/PatArchiveVO.java
@@ -29,6 +29,10 @@
     @ApiModelProperty("鑷ID")
     private Long id;
 
+    @ApiModelProperty("鐥呬汉鎽樿")
+    @Excel(name = "鐥呬汉鎽樿")
+    private String patientOverview;
+
     /**
      * 濮撳悕
      */
diff --git a/smartor/src/main/java/com/smartor/domain/PatServiceContract.java b/smartor/src/main/java/com/smartor/domain/PatServiceContract.java
new file mode 100644
index 0000000..c037109
--- /dev/null
+++ b/smartor/src/main/java/com/smartor/domain/PatServiceContract.java
@@ -0,0 +1,143 @@
+package com.smartor.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 銆愯濉啓鍔熻兘鍚嶇О銆戝璞� pat_service_contract
+ *
+ * @author lihu
+ * @date 2025-12-08
+ */
+@Data
+@ApiModel("銆愯濉啓鍔熻兘鍚嶇О銆�")
+public class PatServiceContract extends BaseEntity
+        {
+private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    @ApiModelProperty("$column.columnComment")
+    private Long id;
+
+    /** 鍚堝悓缂栧彿锛堣鍒欙細HSP-YYYYMMDD-搴忓彿锛� */
+    @ApiModelProperty("鍚堝悓缂栧彿锛堣鍒欙細HSP-YYYYMMDD-搴忓彿锛�")
+            @Excel(name = "鍚堝悓缂栧彿", readConverterExp = "瑙�=鍒欙細HSP-YYYYMMDD-搴忓彿")
+    private String contractNo;
+
+    /** $column.columnComment */
+    @ApiModelProperty("$column.columnComment")
+            @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private Long patId;
+
+    /** 鍚堝悓鍒嗙被 */
+    @ApiModelProperty("鍚堝悓鍒嗙被")
+            @Excel(name = "鍚堝悓鍒嗙被")
+    private String contractType;
+
+    /** 閿�鍞笭閬擄紙绾夸笅銆佸畼缃戙�丄PP銆佸尰鐢熸帹鑽愶級 */
+    @ApiModelProperty("閿�鍞笭閬擄紙绾夸笅銆佸畼缃戙�丄PP銆佸尰鐢熸帹鑽愶級")
+            @Excel(name = "閿�鍞笭閬�", readConverterExp = "绾�=涓嬨�佸畼缃戙�丄PP銆佸尰鐢熸帹鑽�")
+    private String salesChannel;
+
+    /** 绛剧害閲戦 */
+    @ApiModelProperty("绛剧害閲戦")
+            @Excel(name = "绛剧害閲戦")
+    private String contractAmount;
+
+    /** 鏀粯鐘舵�侊紙1:鏈敮浠�, 2:閮ㄥ垎鏀粯, 3:宸叉敮浠�, 4:閫�娆句腑, 5:宸查��娆撅級 */
+    @ApiModelProperty("鏀粯鐘舵�侊紙1:鏈敮浠�, 2:閮ㄥ垎鏀粯, 3:宸叉敮浠�, 4:閫�娆句腑, 5:宸查��娆撅級")
+            @Excel(name = "鏀粯鐘舵��", readConverterExp = "1=:鏈敮浠�,,2=:閮ㄥ垎鏀粯,,3=:宸叉敮浠�,,4=:閫�娆句腑,,5=:宸查��娆�")
+    private String paymentStatus;
+
+    /** 鍚堝悓鐘舵�侊紙1:寰呯敓鏁�, 2:鐢熸晥涓�, 3:宸叉殏鍋�, 4:宸插埌鏈�, 5:鎻愬墠缁堟锛� */
+    @ApiModelProperty("鍚堝悓鐘舵�侊紙1:寰呯敓鏁�, 2:鐢熸晥涓�, 3:宸叉殏鍋�, 4:宸插埌鏈�, 5:鎻愬墠缁堟锛�")
+            @Excel(name = "鍚堝悓鐘舵��", readConverterExp = "1=:寰呯敓鏁�,,2=:鐢熸晥涓�,,3=:宸叉殏鍋�,,4=:宸插埌鏈�,,5=:鎻愬墠缁堟")
+    private String contractStatus;
+
+    /** 鏈嶅姟寮�濮嬫棩鏈� */
+    @ApiModelProperty("鏈嶅姟寮�濮嬫棩鏈�")
+            @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+            @Excel(name = "鏈嶅姟寮�濮嬫棩鏈�", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date startDate;
+
+    /** 鏈嶅姟缁撴潫鏃ユ湡 */
+    @ApiModelProperty("鏈嶅姟缁撴潫鏃ユ湡")
+            @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+            @Excel(name = "鏈嶅姟缁撴潫鏃ユ湡", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date endDate;
+
+    /** 瀹為檯缁堟鏃ユ湡 */
+    @ApiModelProperty("瀹為檯缁堟鏃ユ湡")
+            @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+            @Excel(name = "瀹為檯缁堟鏃ユ湡", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date actualEndDate;
+
+    /** 鐖禝D */
+    @ApiModelProperty("鐖禝D")
+            @Excel(name = "鐖禝D")
+    private Long pid;
+
+    /** guid */
+    @ApiModelProperty("guid")
+            @Excel(name = "guid")
+    private String guid;
+
+    /** 鍒犻櫎鏍囧織锛�0锛氭湭鍒犻櫎 1锛氬凡鍒犻櫎锛� */
+    @ApiModelProperty("鍒犻櫎鏍囧織锛�0锛氭湭鍒犻櫎 1锛氬凡鍒犻櫎锛�")
+    private Long delFlag;
+
+    /** 鍖婚櫌鏈烘瀯id */
+    @ApiModelProperty("鍖婚櫌鏈烘瀯id")
+            @Excel(name = "鍖婚櫌鏈烘瀯id")
+    private String orgid;
+
+    /** 鏄惁鑷姩缁害 */
+    @ApiModelProperty("鏄惁鑷姩缁害")
+            @Excel(name = "鏄惁鑷姩缁害")
+    private String autoRenew;
+
+    /** 缁害鎻愰啋鎻愬墠澶╂暟 */
+    @ApiModelProperty("缁害鎻愰啋鎻愬墠澶╂暟")
+            @Excel(name = "缁害鎻愰啋鎻愬墠澶╂暟")
+    private Long renewalReminderDays;
+
+    /** 鐗规畩鏉℃澶囨敞 */
+    @ApiModelProperty("鐗规畩鏉℃澶囨敞")
+            @Excel(name = "鐗规畩鏉℃澶囨敞")
+    private String specialTerms;
+
+    /** 绛剧害鏃堕棿 */
+    @ApiModelProperty("绛剧害鏃堕棿")
+            @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+            @Excel(name = "绛剧害鏃堕棿", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date signedAt;
+
+    /** 鎮h�呮槸鍚﹀凡鐢靛瓙绛剧害 */
+    @ApiModelProperty("鎮h�呮槸鍚﹀凡鐢靛瓙绛剧害")
+            @Excel(name = "鎮h�呮槸鍚﹀凡鐢靛瓙绛剧害")
+    private String signedByPatient;
+
+    /** 鍖婚櫌鏄惁宸茬‘璁� */
+    @ApiModelProperty("鍖婚櫌鏄惁宸茬‘璁�")
+            @Excel(name = "鍖婚櫌鏄惁宸茬‘璁�")
+    private String signedByHospital;
+
+    /** 鎻愬墠缁堟鍘熷洜 */
+    @ApiModelProperty("鎻愬墠缁堟鍘熷洜")
+            @Excel(name = "鎻愬墠缁堟鍘熷洜")
+    private String cancellationReason;
+
+    /** 缁堟鏃堕棿 */
+    @ApiModelProperty("缁堟鏃堕棿")
+            @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+            @Excel(name = "缁堟鏃堕棿", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date cancelledAt;
+
+        }
+
diff --git a/smartor/src/main/java/com/smartor/domain/ServiceOutPath.java b/smartor/src/main/java/com/smartor/domain/ServiceOutPath.java
index 0415bc0..89fbaf4 100644
--- a/smartor/src/main/java/com/smartor/domain/ServiceOutPath.java
+++ b/smartor/src/main/java/com/smartor/domain/ServiceOutPath.java
@@ -61,6 +61,9 @@
     @ApiModelProperty(value = "杩涘埗")
     private String radix;
 
+    @ApiModelProperty(value = "  ivr   杩樻槸   svy鐨勯棶鍗烽殢璁�,   1锛歩vr     2:svy     3:瀹f暀")
+    private Integer type;
+
 
 }
 
diff --git a/smartor/src/main/java/com/smartor/domain/ServiceSubtask.java b/smartor/src/main/java/com/smartor/domain/ServiceSubtask.java
index f8bf4ce..06a718c 100644
--- a/smartor/src/main/java/com/smartor/domain/ServiceSubtask.java
+++ b/smartor/src/main/java/com/smartor/domain/ServiceSubtask.java
@@ -520,6 +520,13 @@
     private String tagname;
 
     /**
+     * 澶栭摼鍦板潃
+     */
+    @ApiModelProperty(value = "澶栭摼鍦板潃")
+    @Excel(name = " 澶栭摼鍦板潃 ")
+    private String outPath;
+
+    /**
      * 鍑洪櫌鐥呭尯缂栧彿
      */
     @ApiModelProperty(value = "鍑洪櫌鐥呭尯缂栧彿闆嗗悎")
diff --git a/smartor/src/main/java/com/smartor/domain/ServiceSubtaskRecord.java b/smartor/src/main/java/com/smartor/domain/ServiceSubtaskRecord.java
index fa5104e..eac7072 100644
--- a/smartor/src/main/java/com/smartor/domain/ServiceSubtaskRecord.java
+++ b/smartor/src/main/java/com/smartor/domain/ServiceSubtaskRecord.java
@@ -138,5 +138,12 @@
     @ApiModelProperty(value = "澶囨敞")
     private String remark;
 
+    /**
+     * 澶栭摼鍦板潃
+     */
+    @ApiModelProperty(value = "澶栭摼鍦板潃")
+    @Excel(name = " 澶栭摼鍦板潃 ")
+    private String outPath;
+
 
 }
diff --git a/smartor/src/main/java/com/smartor/domain/ServiceSubtaskStatistic.java b/smartor/src/main/java/com/smartor/domain/ServiceSubtaskStatistic.java
index df4df67..cdab8f0 100644
--- a/smartor/src/main/java/com/smartor/domain/ServiceSubtaskStatistic.java
+++ b/smartor/src/main/java/com/smartor/domain/ServiceSubtaskStatistic.java
@@ -92,4 +92,11 @@
     @ApiModelProperty(value = "鍥炲寮傚父鏁�")
     private Long hfycs = 0L;
 
+    /**
+     * 澶栭摼鍦板潃
+     */
+    @ApiModelProperty(value = "澶栭摼鍦板潃")
+    @Excel(name = " 澶栭摼鍦板潃 ")
+    private String outPath;
+
 }
diff --git a/smartor/src/main/java/com/smartor/domain/ServiceSubtaskVO.java b/smartor/src/main/java/com/smartor/domain/ServiceSubtaskVO.java
index edb7f5f..87591aa 100644
--- a/smartor/src/main/java/com/smartor/domain/ServiceSubtaskVO.java
+++ b/smartor/src/main/java/com/smartor/domain/ServiceSubtaskVO.java
@@ -25,7 +25,15 @@
      *
      */
     @ApiModelProperty(value = "涓婚敭id")
-    private Long subId;
+    private Long subid;
+
+
+    /**
+     * 澶栭摼鍦板潃
+     */
+    @ApiModelProperty(value = "澶栭摼鍦板潃")
+    @Excel(name = " 澶栭摼鍦板潃 ")
+    private String outPath;
 
 
     /**
@@ -271,6 +279,14 @@
     @Excel(name = " 鍙戦�佺姸鎬� ")
     @ApiModelProperty(value = "鍙戦�佺姸鎬� : 1鏂板缓 2鎵ц涓� 3鏆傚仠 4缁堟 5瀹屾垚")
     private Long sendstate;
+
+
+    /**
+     * 璇︽儏缁撴灉锛堟祴璇曠敤锛屽悗闈㈠垹闄わ級
+     */
+    @Excel(name = " 璇︽儏缁撴灉锛堟祴璇曠敤锛屽悗闈㈠垹闄わ級 ")
+    @ApiModelProperty(value = "璇︽儏缁撴灉锛堟祴璇曠敤锛屽悗闈㈠垹闄わ級")
+    private String detailResult;
 
 
     /**
@@ -545,6 +561,20 @@
     @ApiModelProperty(value = "鎬诲垎")
     private Long score;
 
+    /**
+     * 寮�濮嬪垎
+     */
+    @Excel(name = "寮�濮嬪垎")
+    @ApiModelProperty(value = "寮�濮嬪垎")
+    private Long scoreStart;
+
+    /**
+     * 缁撴潫鍒�
+     */
+    @Excel(name = "缁撴潫鍒�")
+    @ApiModelProperty(value = "缁撴潫鍒�")
+    private Long scoreEnd;
+
 
     /**
      * 鏄惁鎻愪氦
diff --git a/smartor/src/main/java/com/smartor/domain/SvyTaskTemplate.java b/smartor/src/main/java/com/smartor/domain/SvyTaskTemplate.java
index c0b0550..7c59665 100644
--- a/smartor/src/main/java/com/smartor/domain/SvyTaskTemplate.java
+++ b/smartor/src/main/java/com/smartor/domain/SvyTaskTemplate.java
@@ -240,4 +240,7 @@
 
     @ApiModelProperty(value = "閮ㄩ棬缂栫爜")
     private String deptCode;
+
+    @ApiModelProperty(value = "鍒嗗�肩被鍨嬶細1锛氭暟瀛楋紝2锛氱瓑绾�")
+    private String scoreType;
 }
diff --git a/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateVO.java b/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateVO.java
index 10d0a75..eb7ba2f 100644
--- a/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateVO.java
+++ b/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateVO.java
@@ -32,6 +32,9 @@
     @ApiModelProperty(value = "鏄惁鏄暱鏈熸ā鏉匡細  0锛氫笉鏄�    1锛氭槸")
     private Integer longTemp;
 
+    @ApiModelProperty(value = "鍒嗗�肩被鍨嬶細1锛氭暟瀛楋紝2锛氱瓑绾�")
+    private String scoreType;
+    
     /**
      * 妯℃澘闂嵎ID
      */
diff --git a/smartor/src/main/java/com/smartor/mapper/PatServiceContractMapper.java b/smartor/src/main/java/com/smartor/mapper/PatServiceContractMapper.java
new file mode 100644
index 0000000..2786c9d
--- /dev/null
+++ b/smartor/src/main/java/com/smartor/mapper/PatServiceContractMapper.java
@@ -0,0 +1,63 @@
+package com.smartor.mapper;
+
+import java.util.List;
+import org.apache.ibatis.annotations.Mapper;
+import com.smartor.domain.PatServiceContract;
+
+/**
+ * 銆愯濉啓鍔熻兘鍚嶇О銆慚apper鎺ュ彛
+ *
+ * @author lihu
+ * @date 2025-12-08
+ */
+@Mapper
+public interface PatServiceContractMapper
+{
+    /**
+     * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆�
+     *
+     * @param id 銆愯濉啓鍔熻兘鍚嶇О銆戜富閿�
+     * @return 銆愯濉啓鍔熻兘鍚嶇О銆�
+     */
+    public PatServiceContract selectPatServiceContractById(Long id);
+
+    /**
+     * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛�
+     *
+     * @param patServiceContract 銆愯濉啓鍔熻兘鍚嶇О銆�
+     * @return 銆愯濉啓鍔熻兘鍚嶇О銆戦泦鍚�
+     */
+    public List<PatServiceContract> selectPatServiceContractList(PatServiceContract patServiceContract);
+
+    /**
+     * 鏂板銆愯濉啓鍔熻兘鍚嶇О銆�
+     *
+     * @param patServiceContract 銆愯濉啓鍔熻兘鍚嶇О銆�
+     * @return 缁撴灉
+     */
+    public int insertPatServiceContract(PatServiceContract patServiceContract);
+
+    /**
+     * 淇敼銆愯濉啓鍔熻兘鍚嶇О銆�
+     *
+     * @param patServiceContract 銆愯濉啓鍔熻兘鍚嶇О銆�
+     * @return 缁撴灉
+     */
+    public int updatePatServiceContract(PatServiceContract patServiceContract);
+
+    /**
+     * 鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆�
+     *
+     * @param id 銆愯濉啓鍔熻兘鍚嶇О銆戜富閿�
+     * @return 缁撴灉
+     */
+    public int deletePatServiceContractById(Long id);
+
+    /**
+     * 鎵归噺鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆�
+     *
+     * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁涓婚敭闆嗗悎
+     * @return 缁撴灉
+     */
+    public int deletePatServiceContractByIds(Long[] ids);
+}
diff --git a/smartor/src/main/java/com/smartor/service/IPatServiceContractService.java b/smartor/src/main/java/com/smartor/service/IPatServiceContractService.java
new file mode 100644
index 0000000..f83f495
--- /dev/null
+++ b/smartor/src/main/java/com/smartor/service/IPatServiceContractService.java
@@ -0,0 +1,61 @@
+package com.smartor.service;
+
+import java.util.List;
+import com.smartor.domain.PatServiceContract;
+
+/**
+ * 銆愯濉啓鍔熻兘鍚嶇О銆慡ervice鎺ュ彛
+ * 
+ * @author lihu
+ * @date 2025-12-08
+ */
+public interface IPatServiceContractService 
+{
+    /**
+     * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆�
+     * 
+     * @param id 銆愯濉啓鍔熻兘鍚嶇О銆戜富閿�
+     * @return 銆愯濉啓鍔熻兘鍚嶇О銆�
+     */
+    public PatServiceContract selectPatServiceContractById(Long id);
+
+    /**
+     * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛�
+     * 
+     * @param patServiceContract 銆愯濉啓鍔熻兘鍚嶇О銆�
+     * @return 銆愯濉啓鍔熻兘鍚嶇О銆戦泦鍚�
+     */
+    public List<PatServiceContract> selectPatServiceContractList(PatServiceContract patServiceContract);
+
+    /**
+     * 鏂板銆愯濉啓鍔熻兘鍚嶇О銆�
+     * 
+     * @param patServiceContract 銆愯濉啓鍔熻兘鍚嶇О銆�
+     * @return 缁撴灉
+     */
+    public int insertPatServiceContract(PatServiceContract patServiceContract);
+
+    /**
+     * 淇敼銆愯濉啓鍔熻兘鍚嶇О銆�
+     * 
+     * @param patServiceContract 銆愯濉啓鍔熻兘鍚嶇О銆�
+     * @return 缁撴灉
+     */
+    public int updatePatServiceContract(PatServiceContract patServiceContract);
+
+    /**
+     * 鎵归噺鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆�
+     * 
+     * @param ids 闇�瑕佸垹闄ょ殑銆愯濉啓鍔熻兘鍚嶇О銆戜富閿泦鍚�
+     * @return 缁撴灉
+     */
+    public int deletePatServiceContractByIds(Long[] ids);
+
+    /**
+     * 鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆戜俊鎭�
+     * 
+     * @param id 銆愯濉啓鍔熻兘鍚嶇О銆戜富閿�
+     * @return 缁撴灉
+     */
+    public int deletePatServiceContractById(Long id);
+}
diff --git a/smartor/src/main/java/com/smartor/service/impl/IvrLibaTargetAssortServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/IvrLibaTargetAssortServiceImpl.java
index ee28ec1..c245df5 100644
--- a/smartor/src/main/java/com/smartor/service/impl/IvrLibaTargetAssortServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/IvrLibaTargetAssortServiceImpl.java
@@ -99,7 +99,7 @@
             ivrLibaTargetAssort.setSeqno(seqMax + 1);
         }
         //-1浠h〃涓绘爲
-        if (ivrLibaTargetAssort.getPid() == null) ivrLibaTargetAssort.setPid((long) -1);
+//        if (ivrLibaTargetAssort.getPid() == null) ivrLibaTargetAssort.setPid((long) -1);
         i = ivrLibaTargetAssortMapper.insertIvrLibaTargetAssort(ivrLibaTargetAssort);
         log.info("鎸囨爣鍒嗙被涓�绾ф爲鐨勪富閿�:{}", ivrLibaTargetAssort.getId());
 
@@ -114,6 +114,7 @@
                     seqMax1 = 0;
                 }
                 ivrLibaTargetAssort1.setPid(ivrLibaTargetAssort.getId());
+                if (ivrLibaTargetAssort.getId() == null) ivrLibaTargetAssort1.setPid((long) -1);
                 ivrLibaTargetAssort1.setSeqno(1);
                 if (seqMax != null) {
                     ivrLibaTargetAssort1.setSeqno(seqMax1 + 1);
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 79115c7..ff4bd37 100644
--- a/smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java
@@ -8,12 +8,11 @@
 import com.ruoyi.common.core.domain.entity.SysDept;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.core.domain.model.LoginUser;
-import com.ruoyi.common.utils.DateUtils;
-import com.ruoyi.common.utils.DtoConversionUtils;
-import com.ruoyi.common.utils.SecurityUtils;
-import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.*;
+import com.smartor.common.RandomStringGenerator;
 import com.smartor.domain.*;
 import com.smartor.mapper.*;
+import com.smartor.service.IServiceOutPathService;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.ObjectUtils;
@@ -49,11 +48,21 @@
 
     @Autowired
     private ServiceSubtaskMapper serviceSubtaskMapper;
+
     @Autowired
-    private SysUserDeptMapper sysUserDeptMapper;
+    private IServiceOutPathService iServiceOutPathService;
 
     @Value("${createTaskServiceType}")
     private List<String> createTaskServiceType;
+
+    @Value("${localIP}")
+    private String localIP;
+
+    @Value("${req_path}")
+    private String req_path;
+
+    @Value("${pub_key}")
+    private String pub_key;
 
     //璁板綍闀挎湡浠诲姟鍩虹淇℃伅
     List<IvrLibaTemplate> libaTemplates = new ArrayList<>();
@@ -352,7 +361,6 @@
                         serviceSubtask1.setSendstate(4L);
                         serviceSubtask1.setRemark("鎮h�呭啀鍏ラ櫌");
                         serviceSubtask1.setResult("error");
-//                        serviceSubtask1.setFinishtime(new Date());
                         Boolean aBoolean = serviceSubtaskMapper.updateServiceSubtask(serviceSubtask1);
                         if (aBoolean) i = 1;
                     } else {
@@ -364,6 +372,16 @@
                     }
                 }
             }
+            //鐢熸垚澶栭摼鍦板潃
+            String outPath = null;
+            if (serviceTask.getType().equals("1"))
+                outPath = getOutPath(serviceSubtask.getPhone(), serviceSubtask.getTaskid(), serviceSubtask.getTaskName(), serviceSubtask.getPatid(), 1);
+            else if (serviceTask.getType().equals("2"))
+                outPath = getOutPath(serviceSubtask.getPhone(), serviceSubtask.getTaskid(), serviceSubtask.getTaskName(), serviceSubtask.getPatid(), 2);
+            else if (serviceTask.getType().equals("3"))
+                outPath = getOutPath(serviceSubtask.getPhone(), serviceSubtask.getTaskid(), serviceSubtask.getTaskName(), serviceSubtask.getPatid(), 3);
+            serviceSubtask.setOutPath(outPath);
+
             i = serviceSubtaskMapper.insertServiceSubtask(serviceSubtask);
             if (i == 1) {
                 //灏哻heck_flag鏀规垚1锛堝凡澶勭悊锛�
@@ -479,4 +497,76 @@
         return calendar.getTime();
     }
 
+
+    private String getOutPath(String phone, Long tid, String taskName, Long pId, Integer type) {
+        //瀵箄rl涓袱涓弬鏁板姞瀵�
+        RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
+        String taskId = rsaPublicKeyExample.encryptedData(tid.toString(), pub_key);
+        String outpath = null;
+        try {
+            String patid = rsaPublicKeyExample.encryptedData(pId.toString(), pub_key);
+            SendMagParam sendMagParam = new SendMagParam();
+            sendMagParam.setType("4");
+            if (type == 1) {
+                //闅忚
+                ServiceOutPath serviceOutPath = new ServiceOutPath();
+                serviceOutPath.setParam1(taskId);
+                serviceOutPath.setParam2(patid);
+                serviceOutPath.setCreateTime(new Date());
+                serviceOutPath.setType(1);
+                iServiceOutPathService.insertServiceOutPath(serviceOutPath);
+                //杞垚16杩涘埗
+                String format = String.format("%03X", serviceOutPath.getId()) + RandomStringGenerator.generateRandomString();
+                serviceOutPath.setRadix(format);
+                outpath = localIP + ":" + req_path + "/sf?p=" + format;
+                serviceOutPath.setUpdateTime(new Date());
+                iServiceOutPathService.updateServiceOutPath(serviceOutPath);
+                sendMagParam.setPhone(phone);
+                sendMagParam.setUrl(outpath);
+                sendMagParam.setContent("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌闅忚璋冩煡琛紝璇风偣鍑�" + sendMagParam.getUrl() + "   濉啓銆傛劅璋㈡偍閰嶅悎锛�");
+            } else if (type == 2) {
+                //闂埜锛堥棶棰橈級
+                ServiceOutPath serviceOutPath = new ServiceOutPath();
+                serviceOutPath.setParam1(taskId);
+                serviceOutPath.setParam2(patid);
+                serviceOutPath.setParam3(taskName);
+                serviceOutPath.setCreateTime(new Date());
+                serviceOutPath.setType(2);
+                iServiceOutPathService.insertServiceOutPath(serviceOutPath);
+                String format = String.format("%03X", serviceOutPath.getId()) + RandomStringGenerator.generateRandomString();
+                serviceOutPath.setRadix(format);
+                serviceOutPath.setUpdateTime(new Date());
+                outpath = localIP + ":" + req_path + "/wt?p=" + format;
+                iServiceOutPathService.updateServiceOutPath(serviceOutPath);
+
+//                                sendMagParam.setUrl(ip + ":" + req_path + "/outsideChainwt?param1=" + taskId + "&param2=" + patid + "&param3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "&param5=false");
+                sendMagParam.setPhone(phone);
+                sendMagParam.setUrl(outpath);
+                sendMagParam.setContent("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌璋冩煡琛紝璇风偣鍑�" + sendMagParam.getUrl() + "   濉啓銆傛劅璋㈡偍閰嶅悎锛�");
+                log.info("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌璋冩煡琛紝璇风偣鍑�,{}", sendMagParam.getUrl());
+            } else if (type == 3) {
+                //瀹f暀
+                ServiceOutPath serviceOutPath = new ServiceOutPath();
+                serviceOutPath.setParam1(taskId);
+                serviceOutPath.setParam2(patid);
+                serviceOutPath.setParam3(taskName);
+                serviceOutPath.setCreateTime(new Date());
+                serviceOutPath.setType(3);
+                iServiceOutPathService.insertServiceOutPath(serviceOutPath);
+                String format = String.format("%03X", serviceOutPath.getId()) + RandomStringGenerator.generateRandomString();
+                serviceOutPath.setRadix(format);
+                serviceOutPath.setUpdateTime(new Date());
+                outpath = localIP + ":" + req_path + "/xj?p=" + format;
+                iServiceOutPathService.updateServiceOutPath(serviceOutPath);
+                sendMagParam.setPhone(phone);
+                sendMagParam.setUrl(outpath);
+                sendMagParam.setContent("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌瀹f暀璋冩煡琛紝璇风偣鍑�" + sendMagParam.getUrl() + "鏌ョ湅銆傛劅璋㈡偍閰嶅悎锛�");
+                log.info("-----------sendMagParam鐨勫�间负锛歿}", sendMagParam);
+            }
+        } catch (Exception e) {
+            log.error("鐢熸垚澶辫触浜嗭細{}", e.getMessage());
+        }
+        return outpath;
+    }
+
 }
diff --git a/smartor/src/main/java/com/smartor/service/impl/PatServiceContractServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/PatServiceContractServiceImpl.java
new file mode 100644
index 0000000..2d73641
--- /dev/null
+++ b/smartor/src/main/java/com/smartor/service/impl/PatServiceContractServiceImpl.java
@@ -0,0 +1,95 @@
+package com.smartor.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.smartor.mapper.PatServiceContractMapper;
+import com.smartor.domain.PatServiceContract;
+import com.smartor.service.IPatServiceContractService;
+
+/**
+ * 銆愯濉啓鍔熻兘鍚嶇О銆慡ervice涓氬姟灞傚鐞�
+ * 
+ * @author lihu
+ * @date 2025-12-08
+ */
+@Service
+public class PatServiceContractServiceImpl implements IPatServiceContractService 
+{
+    @Autowired
+    private PatServiceContractMapper patServiceContractMapper;
+
+    /**
+     * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆�
+     * 
+     * @param id 銆愯濉啓鍔熻兘鍚嶇О銆戜富閿�
+     * @return 銆愯濉啓鍔熻兘鍚嶇О銆�
+     */
+    @Override
+    public PatServiceContract selectPatServiceContractById(Long id)
+    {
+        return patServiceContractMapper.selectPatServiceContractById(id);
+    }
+
+    /**
+     * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛�
+     * 
+     * @param patServiceContract 銆愯濉啓鍔熻兘鍚嶇О銆�
+     * @return 銆愯濉啓鍔熻兘鍚嶇О銆�
+     */
+    @Override
+    public List<PatServiceContract> selectPatServiceContractList(PatServiceContract patServiceContract)
+    {
+        return patServiceContractMapper.selectPatServiceContractList(patServiceContract);
+    }
+
+    /**
+     * 鏂板銆愯濉啓鍔熻兘鍚嶇О銆�
+     * 
+     * @param patServiceContract 銆愯濉啓鍔熻兘鍚嶇О銆�
+     * @return 缁撴灉
+     */
+    @Override
+    public int insertPatServiceContract(PatServiceContract patServiceContract)
+    {
+        return patServiceContractMapper.insertPatServiceContract(patServiceContract);
+    }
+
+    /**
+     * 淇敼銆愯濉啓鍔熻兘鍚嶇О銆�
+     * 
+     * @param patServiceContract 銆愯濉啓鍔熻兘鍚嶇О銆�
+     * @return 缁撴灉
+     */
+    @Override
+    public int updatePatServiceContract(PatServiceContract patServiceContract)
+    {
+        patServiceContract.setUpdateTime(DateUtils.getNowDate());
+        return patServiceContractMapper.updatePatServiceContract(patServiceContract);
+    }
+
+    /**
+     * 鎵归噺鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆�
+     * 
+     * @param ids 闇�瑕佸垹闄ょ殑銆愯濉啓鍔熻兘鍚嶇О銆戜富閿�
+     * @return 缁撴灉
+     */
+    @Override
+    public int deletePatServiceContractByIds(Long[] ids)
+    {
+        return patServiceContractMapper.deletePatServiceContractByIds(ids);
+    }
+
+    /**
+     * 鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆戜俊鎭�
+     * 
+     * @param id 銆愯濉啓鍔熻兘鍚嶇О銆戜富閿�
+     * @return 缁撴灉
+     */
+    @Override
+    public int deletePatServiceContractById(Long id)
+    {
+        return patServiceContractMapper.deletePatServiceContractById(id);
+    }
+}
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 c82b7cf..e1a9e99 100644
--- a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -9,6 +9,7 @@
 import com.ruoyi.common.exception.base.BaseException;
 import com.ruoyi.common.utils.*;
 import com.smartor.common.FtpService;
+import com.smartor.common.RandomStringGenerator;
 import com.smartor.common.SendService;
 import com.smartor.config.PhoneUtils;
 import com.smartor.domain.*;
@@ -58,9 +59,6 @@
     private IServiceTaskService serviceTaskService;
 
     @Autowired
-    private IvrTaskTemplateTargetoptionMapper serviceTaskScriptTargetoptionMapper;
-
-    @Autowired
     private IvrTaskVisitResultMapper serviceTaskVisitResultMapper;
 
     @Autowired
@@ -74,12 +72,18 @@
 
     @Autowired
     private IIvrTaskTemplateService ivrTaskTemplateService;
+    @Autowired
+    private IIvrTaskTemplateScriptService iIvrTaskTemplateScriptService;
+    @Autowired
+    private IvrTaskTemplateTargetoptionMapper serviceTaskScriptTargetoptionMapper;
 
     @Autowired
     private ISvyTaskTemplateService svyTaskTemplateService;
-
     @Autowired
-    private IIvrTaskTemplateScriptService iIvrTaskTemplateScriptService;
+    private ISvyLibTemplateScriptService svyLibTemplateScriptService;
+    @Autowired
+    private ISvyLibTemplateTargetoptionService svyLibTemplateTargetoptionService;
+
 
     @Autowired
     private IServiceOutPathService iServiceOutPathService;
@@ -98,9 +102,6 @@
 
     @Value("${ASRCallBackPath}")
     private String ASRCallBackPath;
-
-    @Autowired
-    private SendService sendService;
 
     @Value("${hangup}")
     private String hangup;
@@ -125,6 +126,7 @@
 
     @Value("${phoneUpEveryHour}")
     private Integer phoneUpEveryHour;
+
     @Value("${phoneEndHour}")
     private Integer phoneEndHour;
 
@@ -251,7 +253,36 @@
     @Override
     public List<ServiceSubtask> patItem(ServiceSubtaskVO serviceSubtaskVO) {
         List<ServiceSubtask> selectServiceSubtaskList = this.selectServiceSubtaskList(serviceSubtaskVO);
-        return selectServiceSubtaskList;
+        List<ServiceSubtask> serviceSubtaskList = new ArrayList<>();
+        //鑾峰彇鍒嗘暟
+        for (ServiceSubtask serviceSubtask : selectServiceSubtaskList) {
+            //璁$畻鎮h�呯殑鍒嗘暟
+            if (serviceSubtask.getScore() == null || BigDecimal.ZERO.equals(serviceSubtask.getScore())) {
+                //濡傛灉涓虹┖鐨勮瘽锛屽幓detail閲屾嬁鍒版瘡涓鐨勯�夐」鍒嗭紝濡傛灉鏄綔绛旈锛岀洿鎺ユ嬁棰樼洰鍒嗭紙鍓嶉锛岃妯℃澘鏄垎鏁扮被鍨嬶級
+                Map<String, Object> map = getScore(serviceSubtask, serviceSubtaskVO.getDetailResult());
+                serviceSubtask.setScore((BigDecimal) map.get("score"));
+                serviceSubtaskMapper.updateServiceSubtask(serviceSubtask);
+                if ((Boolean) map.get("isExist") == true) {
+                    //娴嬭瘯瀹屽垹闄わ紙搴斾粯娴嬭瘯鐢ㄧ殑锛�
+                    serviceSubtaskList.add(serviceSubtask);
+                }
+            } else {
+                //娴嬭瘯瀹屽垹闄わ紙搴斾粯娴嬭瘯鐢ㄧ殑锛�
+                if (!StringUtils.isEmpty(serviceSubtaskVO.getDetailResult())) {
+                    ServiceSubtaskDetail serviceSubtaskDetail = new ServiceSubtaskDetail();
+                    serviceSubtaskDetail.setSubId(serviceSubtask.getId());
+                    List<ServiceSubtaskDetail> serviceSubtaskDetails = serviceSubtaskDetailMapper.selectServiceSubtaskDetailList(serviceSubtaskDetail);
+                    for (ServiceSubtaskDetail ssd : serviceSubtaskDetails) {
+                        if (ssd.getAsrtext().equals(serviceSubtaskVO.getDetailResult())) {
+                            serviceSubtaskList.add(serviceSubtask);
+                        }
+                    }
+                }else {
+                    serviceSubtaskList.add(serviceSubtask);
+                }
+            }
+        }
+        return serviceSubtaskList;
     }
 
     @Override
@@ -490,6 +521,16 @@
                     }
                     if (serviceTaskVO.getLongTask() != null && serviceTaskVO.getLongTask() == 1)
                         serviceSubtask.setLongSendTime(patTaskRelevance.getLongSendTime());
+
+                    //鐢熸垚澶栭摼鍦板潃
+                    String outPath = null;
+                    if (serviceTaskVO.getType().equals("1"))
+                        outPath = getOutPath(serviceSubtask.getPhone(), serviceSubtask.getTaskid(), serviceSubtask.getTaskName(), serviceSubtask.getPatid(), 1);
+                    else if (serviceTaskVO.getType().equals("2"))
+                        outPath = getOutPath(serviceSubtask.getPhone(), serviceSubtask.getTaskid(), serviceSubtask.getTaskName(), serviceSubtask.getPatid(), 2);
+                    else if (serviceTaskVO.getType().equals("3"))
+                        outPath = getOutPath(serviceSubtask.getPhone(), serviceSubtask.getTaskid(), serviceSubtask.getTaskName(), serviceSubtask.getPatid(), 3);
+                    serviceSubtask.setOutPath(outPath);
                     serviceSubtaskMapper.insertServiceSubtask(serviceSubtask);
                     serviceSubtask.getId().intValue();
                 }
@@ -604,6 +645,15 @@
                     serviceSubtask.setNurseName(patTaskRelevance.getNurseName());
                     serviceSubtask.setVisitTime(patTaskRelevance.getVisitTime());
                     serviceSubtask.setTextParam(new Gson().toJson(serviceTaskVO.getTextParam()));
+                    //鐢熸垚澶栭摼鍦板潃
+                    String outPath = null;
+                    if (serviceTaskVO.getType().equals("1"))
+                        outPath = getOutPath(serviceSubtask.getPhone(), serviceSubtask.getTaskid(), serviceSubtask.getTaskName(), serviceSubtask.getPatid(), 1);
+                    else if (serviceTaskVO.getType().equals("2"))
+                        outPath = getOutPath(serviceSubtask.getPhone(), serviceSubtask.getTaskid(), serviceSubtask.getTaskName(), serviceSubtask.getPatid(), 2);
+                    else if (serviceTaskVO.getType().equals("3"))
+                        outPath = getOutPath(serviceSubtask.getPhone(), serviceSubtask.getTaskid(), serviceSubtask.getTaskName(), serviceSubtask.getPatid(), 3);
+
                     if (patTaskRelevance.getIsoperation() != null) {
                         if (patTaskRelevance.getIsoperation() == 2) serviceSubtask.setUpdateTime(new Date());
                         serviceSubtaskMapper.updateServiceSubtaskByCondition(serviceSubtask);
@@ -2009,7 +2059,6 @@
     }
 
 
-
     private ServiceSubtaskStatistic getStatistic(List<ServiceSubtask> serviceSubtaskList) {
         log.error("-------------serviceSubtaskList鐨勫�间负锛歿}", serviceSubtaskList);
         ServiceSubtaskStatistic serviceSubtaskStatistic = new ServiceSubtaskStatistic();
@@ -2173,4 +2222,172 @@
         int remainingCalls = (int) (remainingHours * phoneUpEveryHour);
         return remainingCalls;
     }
+
+    private String getOutPath(String phone, Long tid, String taskName, Long pId, Integer type) {
+        //瀵箄rl涓袱涓弬鏁板姞瀵�
+        RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
+        String taskId = rsaPublicKeyExample.encryptedData(tid.toString(), pub_key);
+        String outpath = null;
+        try {
+            String patid = rsaPublicKeyExample.encryptedData(pId.toString(), pub_key);
+            SendMagParam sendMagParam = new SendMagParam();
+            sendMagParam.setType("4");
+            if (type == 1) {
+                //闅忚
+                ServiceOutPath serviceOutPath = new ServiceOutPath();
+                serviceOutPath.setParam1(taskId);
+                serviceOutPath.setParam2(patid);
+                serviceOutPath.setCreateTime(new Date());
+                serviceOutPath.setType(1);
+                iServiceOutPathService.insertServiceOutPath(serviceOutPath);
+                //杞垚16杩涘埗
+                String format = String.format("%03X", serviceOutPath.getId()) + RandomStringGenerator.generateRandomString();
+                serviceOutPath.setRadix(format);
+                outpath = localIP + ":" + req_path + "/sf?p=" + format;
+                serviceOutPath.setUpdateTime(new Date());
+                iServiceOutPathService.updateServiceOutPath(serviceOutPath);
+                sendMagParam.setPhone(phone);
+                sendMagParam.setUrl(outpath);
+                sendMagParam.setContent("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌闅忚璋冩煡琛紝璇风偣鍑�" + sendMagParam.getUrl() + "   濉啓銆傛劅璋㈡偍閰嶅悎锛�");
+            } else if (type == 2) {
+                //闂埜锛堥棶棰橈級
+                ServiceOutPath serviceOutPath = new ServiceOutPath();
+                serviceOutPath.setParam1(taskId);
+                serviceOutPath.setParam2(patid);
+                serviceOutPath.setParam3(taskName);
+                serviceOutPath.setCreateTime(new Date());
+                serviceOutPath.setType(2);
+                iServiceOutPathService.insertServiceOutPath(serviceOutPath);
+                String format = String.format("%03X", serviceOutPath.getId()) + RandomStringGenerator.generateRandomString();
+                serviceOutPath.setRadix(format);
+                serviceOutPath.setUpdateTime(new Date());
+                outpath = localIP + ":" + req_path + "/wt?p=" + format;
+                iServiceOutPathService.updateServiceOutPath(serviceOutPath);
+
+//                                sendMagParam.setUrl(ip + ":" + req_path + "/outsideChainwt?param1=" + taskId + "&param2=" + patid + "&param3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "&param5=false");
+                sendMagParam.setPhone(phone);
+                sendMagParam.setUrl(outpath);
+                sendMagParam.setContent("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌璋冩煡琛紝璇风偣鍑�" + sendMagParam.getUrl() + "   濉啓銆傛劅璋㈡偍閰嶅悎锛�");
+                log.info("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌璋冩煡琛紝璇风偣鍑�,{}", sendMagParam.getUrl());
+            } else if (type == 3) {
+                //瀹f暀
+                ServiceOutPath serviceOutPath = new ServiceOutPath();
+                serviceOutPath.setParam1(taskId);
+                serviceOutPath.setParam2(patid);
+                serviceOutPath.setParam3(taskName);
+                serviceOutPath.setCreateTime(new Date());
+                serviceOutPath.setType(3);
+                iServiceOutPathService.insertServiceOutPath(serviceOutPath);
+                String format = String.format("%03X", serviceOutPath.getId()) + RandomStringGenerator.generateRandomString();
+                serviceOutPath.setRadix(format);
+                serviceOutPath.setUpdateTime(new Date());
+                outpath = localIP + ":" + req_path + "/xj?p=" + format;
+                iServiceOutPathService.updateServiceOutPath(serviceOutPath);
+                sendMagParam.setPhone(phone);
+                sendMagParam.setUrl(outpath);
+                sendMagParam.setContent("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌瀹f暀璋冩煡琛紝璇风偣鍑�" + sendMagParam.getUrl() + "鏌ョ湅銆傛劅璋㈡偍閰嶅悎锛�");
+                log.info("-----------sendMagParam鐨勫�间负锛歿}", sendMagParam);
+            }
+        } catch (Exception e) {
+            log.error("鐢熸垚澶辫触浜嗭細{}", e.getMessage());
+        }
+        return outpath;
+    }
+
+    private Map<String, Object> getScore(ServiceSubtask serviceSubtask, String detailResult) {
+        Map<String, Object> map = new HashMap<>();
+        Boolean isExist = false;
+        //缁熻鎬诲垎
+        BigDecimal bigDecimal = BigDecimal.ZERO;
+        if (serviceSubtask.getScore() != null && !BigDecimal.ZERO.equals(serviceSubtask.getScore())) {
+            //濡傛灉鏈夊垎鏁帮紝鐩存帴杩斿洖
+            map.put("score", serviceSubtask.getScore());
+            //isExist搴斾粯娴嬭瘯鐢ㄧ殑锛屾祴璇曞畬鍚庡垹闄�
+            map.put("isExist", true);
+            return map;
+        }
+
+        if (serviceSubtask.getScore() == null || BigDecimal.ZERO.equals(serviceSubtask.getScore())) {
+            //濡傛灉涓虹┖鐨勮瘽锛屽幓detail閲屾嬁鍒版瘡涓鐨勯�夐」鍒嗭紝濡傛灉鏄綔绛旈锛岀洿鎺ユ嬁棰樼洰鍒嗭紙鍓嶉锛岃妯℃澘鏄垎鏁扮被鍨嬶級
+            ServiceTask serviceTask = serviceTaskService.selectServiceTaskByTaskid(serviceSubtask.getTaskid());
+            if (serviceTask.getType().equals("1")) {
+                //濡傛灉鏄満鍣ㄤ汉璇煶
+                IvrTaskTemplate ivrTaskTemplate = ivrTaskTemplateService.selectIvrTaskTemplateByID(serviceTask.getTemplateid());
+                //鍒ゆ柇鏄笉鏄瘎鍒�
+                if (StringUtils.isNotEmpty(ivrTaskTemplate.getScoreType()) && ivrTaskTemplate.getScoreType().equals("1")) {
+                    ServiceSubtaskDetail serviceSubtaskDetail = new ServiceSubtaskDetail();
+                    serviceSubtaskDetail.setSubId(serviceSubtask.getId());
+                    List<ServiceSubtaskDetail> serviceSubtaskDetailList = serviceSubtaskDetailMapper.selectServiceSubtaskDetailList(serviceSubtaskDetail);
+                    for (ServiceSubtaskDetail serviceSubtaskDetail1 : serviceSubtaskDetailList) {
+                        Long scriptid = serviceSubtaskDetail1.getScriptid();
+                        IvrTaskTemplateScript ivrTaskTemplateScript = iIvrTaskTemplateScriptService.selectIvrTaskTemplateScriptByID(scriptid);
+                        if (StringUtils.isNotEmpty(ivrTaskTemplateScript.getScriptType())) {
+                            if (ivrTaskTemplateScript.getScriptType().equals("3") || ivrTaskTemplateScript.getScriptType().equals("4")) {
+                                if (StringUtils.isNotEmpty(serviceSubtaskDetail1.getAsrtext())) {
+                                    //涓嶆槸閫夋嫨棰橈紝鐩存帴鎷块鐩垎
+                                    bigDecimal = bigDecimal.add(ivrTaskTemplateScript.getScore());
+                                }
+                            } else if (ivrTaskTemplateScript.getScriptType().equals("1") || ivrTaskTemplateScript.getScriptType().equals("2")) {
+                                IvrTaskTemplateTargetoption ivrTaskTemplateTargetoption = new IvrTaskTemplateTargetoption();
+                                ivrTaskTemplateTargetoption.setScriptid(scriptid);
+                                List<IvrTaskTemplateTargetoption> ivrTaskTemplateTargetoptions = serviceTaskScriptTargetoptionMapper.selectIvrTaskTemplateTargetoptionList(ivrTaskTemplateTargetoption);
+                                //鑾峰彇閫夐」锛岀敤閫変腑鐨勫�煎幓閫夐」閲屽尮閰嶏紝鎷垮埌閫夐」鍒�
+                                for (IvrTaskTemplateTargetoption ivrTaskTemplateTargetoption1 : ivrTaskTemplateTargetoptions) {
+                                    if (ivrTaskTemplateTargetoption1.getTargetvalue().equals(serviceSubtaskDetail1.getMatchedtext())) {
+                                        bigDecimal = bigDecimal.add(ivrTaskTemplateTargetoption1.getScore());
+                                        //娴嬭瘯瀹屽垹闄�
+                                        if (StringUtils.isEmpty(detailResult) || ivrTaskTemplateTargetoption1.getTargetvalue().equals(detailResult)) {
+                                            isExist = true;
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            if (serviceTask.getType().equals("2")) {
+                //濡傛灉鏄棶鍗�
+                SvyTaskTemplate svyTaskTemplate = svyTaskTemplateService.selectSvyTaskTemplateBySvyid(serviceTask.getTemplateid());
+                //鍒ゆ柇鏄笉鏄瘎鍒�
+                if (StringUtils.isNotEmpty(svyTaskTemplate.getScoreType()) && svyTaskTemplate.getScoreType().equals("1")) {
+                    ServiceSubtaskDetail serviceSubtaskDetail = new ServiceSubtaskDetail();
+                    serviceSubtaskDetail.setSubId(serviceSubtask.getId());
+                    List<ServiceSubtaskDetail> serviceSubtaskDetailList = serviceSubtaskDetailMapper.selectServiceSubtaskDetailList(serviceSubtaskDetail);
+                    for (ServiceSubtaskDetail serviceSubtaskDetail1 : serviceSubtaskDetailList) {
+                        Long scriptid = serviceSubtaskDetail1.getScriptid();
+                        SvyLibTemplateScript svyLibTemplateScript = svyLibTemplateScriptService.selectSvyLibTemplateScriptByTopicid(scriptid);
+                        if (StringUtils.isNotEmpty(svyLibTemplateScript.getScriptType())) {
+                            if (svyLibTemplateScript.getScriptType().equals("3") || svyLibTemplateScript.getScriptType().equals("4")) {
+                                if (StringUtils.isNotEmpty(serviceSubtaskDetail1.getAsrtext())) {
+                                    //涓嶆槸閫夋嫨棰橈紝鐩存帴鎷块鐩垎
+                                    bigDecimal = bigDecimal.add(svyLibTemplateScript.getScore());
+                                }
+                            } else if (svyLibTemplateScript.getScriptType().equals("1") || svyLibTemplateScript.getScriptType().equals("2")) {
+                                SvyLibTemplateTargetoption svyLibTemplateTargetoption = new SvyLibTemplateTargetoption();
+                                svyLibTemplateTargetoption.setScriptid(scriptid);
+                                List<SvyLibTemplateTargetoption> svyLibTemplateTargetoptions = svyLibTemplateTargetoptionService.selectSvyLibTemplateTargetoptionList(svyLibTemplateTargetoption);
+                                //鑾峰彇閫夐」锛岀敤閫変腑鐨勫�煎幓閫夐」閲屽尮閰嶏紝鎷垮埌閫夐」鍒�
+                                for (SvyLibTemplateTargetoption svyLibTemplateTargetoption1 : svyLibTemplateTargetoptions) {
+                                    if (svyLibTemplateTargetoption1.getOptioncontent().equals(serviceSubtaskDetail1.getAsrtext())) {
+                                        bigDecimal = bigDecimal.add(svyLibTemplateTargetoption1.getScore());
+                                        //娴嬭瘯瀹屽垹闄�
+                                        if (StringUtils.isEmpty(detailResult) || svyLibTemplateTargetoption1.getOptioncontent().equals(detailResult)) {
+                                            isExist = true;
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+
+            }
+
+        }
+        map.put("score", bigDecimal);
+        map.put("isExist", isExist);
+        return map;
+    }
+
 }
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateMapper.xml
index 47ccb85..f708bc1 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateMapper.xml
@@ -44,12 +44,14 @@
         <result property="sendDay" column="send_day"/>
         <result property="longTemp" column="long_temp"/>
         <result property="deptCode" column="dept_code"/>
+        <result property="scoreType" column="score_type"/>
     </resultMap>
 
     <sql id="selectIvrLibaTemplateVo">
         select id,
                revisit_before,
                revisit_after,
+               score_type,
                send_day,
                dept_code,
                long_temp,
@@ -74,6 +76,7 @@
         a.revisit_before,
         a.revisit_after,
         a.send_day,
+        a.score_type,
         a.dept_code,
         a.long_temp,
         a.templateName,
@@ -104,6 +107,7 @@
                 '%')
             </if>
             <if test="id != null ">and a.id = #{id}</if>
+            <if test="scoreType != null ">and a.score_type = #{scoreType}</if>
             <if test="tag != null ">and b.tag_name = #{tag}</if>
             <if test="sendDay != null ">and a.send_day = #{sendDay}</if>
             <if test="longTemp != null ">and a.long_temp = #{longTemp}</if>
@@ -153,6 +157,7 @@
         a.isenable,
         a.campus,
         a.suitway,
+        a.score_type,
         a.mate_num,
         a.no_voice_num,
         a.submodule, a.language, a.note,
@@ -209,6 +214,7 @@
             <if test="sendDay != null ">send_day,</if>
             <if test="longTemp != null ">long_temp,</if>
             <if test="deptCode != null">dept_code,</if>
+            <if test="scoreType != null">score_type,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="templateName != null and templateName != ''">#{templateName},</if>
@@ -249,6 +255,7 @@
             <if test="sendDay != null ">#{sendDay},</if>
             <if test="longTemp != null ">#{longTemp},</if>
             <if test="deptCode != null">#{deptCode},</if>
+            <if test="scoreType != null">#{scoreType},</if>
         </trim>
     </insert>
 
@@ -294,6 +301,7 @@
             <if test="sendDay != null ">send_day = #{sendDay},</if>
             <if test="longTemp != null ">long_temp = #{longTemp},</if>
             <if test="deptCode != null">dept_code = #{deptCode},</if>
+            <if test="scoreType != null">score_type = #{scoreType},</if>
         </trim>
         where id = #{id}
     </update>
diff --git a/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateMapper.xml
index 78560d3..6c7bd7c 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateMapper.xml
@@ -63,12 +63,14 @@
         <result property="sendDay" column="send_day"/>
         <result property="deptCode" column="dept_code"/>
         <result property="longTemp" column="long_temp"/>
+        <result property="scoreType" column="score_type"/>
 
     </resultMap>
 
     <sql id="selectIvrTaskTemplateVo">
         select id,
                taskid,
+               score_type,
                long_temp,
                send_day,
                recallcount,
@@ -150,6 +152,7 @@
             <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>
+            <if test="scoreType != null ">and score_type = #{scoreType}</if>
         </where>
     </select>
 
@@ -219,6 +222,7 @@
             <if test="sendDay != null ">send_day,</if>
             <if test="deptCode != null">dept_code,</if>
             <if test="longTemp != null">long_temp,</if>
+            <if test="scoreType != null ">score_type,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="taskid != null">#{taskid},</if>
@@ -278,6 +282,8 @@
             <if test="sendDay != null ">#{sendDay},</if>
             <if test="deptCode != null">#{deptCode},</if>
             <if test="longTemp != null">#{longTemp},</if>
+            <if test="scoreType != null ">#{scoreType},</if>
+
         </trim>
     </insert>
 
@@ -341,6 +347,8 @@
             <if test="sendDay != null ">send_day = #{sendDay},</if>
             <if test="deptCode != null">dept_code = #{deptCode},</if>
             <if test="longTemp != null">long_temp = #{longTemp},</if>
+            <if test="scoreType != null ">score_type = #{scoreType},</if>
+
         </trim>
         where id = #{id}
     </update>
diff --git a/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml b/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
index c75a219..f1e294b 100644
--- a/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
@@ -60,6 +60,7 @@
         <result property="carePerson" column="care_person"/>
         <result property="casePersonAge" column="case_person_age"/>
         <result property="reservedPhone" column="reserved_phone"/>
+        <result property="patientOverview" column="patient_overview"/>
     </resultMap>
 
 
@@ -119,12 +120,14 @@
         <result property="leavehospitaldistrictcode" column="leavehospitaldistrictcode"/>
         <result property="admitdate" column="admitdate"/>
         <result property="reservedPhone" column="reserved_phone"/>
+        <result property="patientOverview" column="patient_overview"/>
     </resultMap>
 
     <sql id="selectPatArchiveVo">
         select id,
                notrequired_flag,
                notrequiredreason,
+               patientOverview,
                patientno,
                patid_his,
                age_unit,
@@ -177,6 +180,7 @@
             <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
             <if test="idcardno != null  and idcardno != ''">and idcardno = #{idcardno}</if>
             <if test="sourcefrom != null ">and sourcefrom = #{sourcefrom}</if>
+            <if test="patientOverview != null ">and patient_overview = #{patientOverview}</if>
             <if test="telcode != null  and telcode != ''">and telcode = #{telcode}</if>
             <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
             <if test="id != null  and id != ''">and id = #{id}</if>
@@ -210,6 +214,7 @@
         select
         a.id,
         a.age_unit,
+        a.patient_overview,
         a.notrequired_flag,
         a.notrequiredreason,
         a.patientno,
@@ -309,6 +314,7 @@
             <if test="carePerson != null ">care_person,</if>
             <if test="casePersonAge != null ">case_person_age,</if>
             <if test="reservedPhone != null ">reserved_phone,</if>
+            <if test="patientOverview != null ">patient_overview,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="patientno != null">#{patientno},</if>
@@ -357,6 +363,7 @@
             <if test="carePerson != null ">#{carePerson},</if>
             <if test="casePersonAge != null ">#{casePersonAge},</if>
             <if test="reservedPhone != null ">#{reservedPhone},</if>
+            <if test="patientOverview != null ">#{patientOverview},</if>
         </trim>
     </insert>
 
@@ -364,14 +371,14 @@
         insert into
         pat_archive(name,viptype,sex,idcardno,birthdate,place_of_residence,age,age2,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,age_unit2,notrequired_flag,notrequiredreason,care_facilities,case_path,
-        degree_of_education,marital_status,income,medicare_type,care_person,case_person_age,reserved_phone)
+        degree_of_education,marital_status,income,medicare_type,care_person,case_person_age,reserved_phone,patient_overview)
         values
         <foreach item="item" index="index" collection="list" separator=",">
             (#{item.name},#{item.viptype},#{item.sex},#{item.idcardno},#{item.birthdate},#{item.placeOfResidence},#{item.age},#{item.age2},#{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.ageUnit2},#{item.notrequiredFlag},#{item.notrequiredreason}
-            ,#{item.careFacilities},#{item.casePath},#{item.degreeOfEducation},#{item.maritalStatus},#{item.income},#{item.medicareType},#{item.carePerson},#{item.casePersonAge},#{item.reservedPhone})
+            ,#{item.careFacilities},#{item.casePath},#{item.degreeOfEducation},#{item.maritalStatus},#{item.income},#{item.medicareType},#{item.carePerson},#{item.casePersonAge},#{item.reservedPhone},#{item.patientOverview})
         </foreach>
     </insert>
 
@@ -418,6 +425,7 @@
             <if test="carePerson != null ">care_person = #{carePerson},</if>
             <if test="casePersonAge != null ">case_person_age = #{casePersonAge},</if>
             <if test="reservedPhone != null ">reserved_phone = #{reservedPhone},</if>
+            <if test="patientOverview != null ">patient_overview = #{patientOverview},</if>
         </trim>
         where id = #{id}
     </update>
@@ -476,6 +484,7 @@
         a.viptype,
         a.pattype,
         a.reserved_phone,
+        a.patient_overview,
         COALESCE((
         SELECT string_agg(d.tagname, ', ')
         FROM pat_archivetag d
@@ -553,6 +562,7 @@
         a.reserved_phone,
         a.upload_time,
         a.pattype,
+        a.patient_overview,
         d.bed_no,
         d.starttime,
         d.endtime,
@@ -712,6 +722,7 @@
         a.create_time,
         a.isupload,
         a.upload_time,
+        a.patient_overview,
         a.reserved_phone,
         COALESCE((
         SELECT string_agg(dd.tagname, ', ')
@@ -780,6 +791,7 @@
         a.notrequired_flag,
         a.notrequiredreason,
         a.patid_his,
+        a.patient_overview,
         a.sd_flag,
         a.patientno,
         a.sex,
@@ -908,6 +920,7 @@
         a.create_time,
         a.isupload,
         a.upload_time,
+        a.patient_overview,
         a.pattype,
         a.reserved_phone,
         d.bed_no,
@@ -1058,6 +1071,7 @@
         a.isupload,
         a.reserved_phone,
         a.upload_time,
+        a.patient_overview,
         rt.tagname,
         ROW_NUMBER() OVER (PARTITION BY a.idcardno ORDER BY a.update_time DESC) AS rn,
         a.pattype
@@ -1170,6 +1184,7 @@
         a.isupload,
         a.upload_time,
         a.reserved_phone,
+        a.patient_overview,
         COALESCE((
         SELECT string_agg(dd.tagname, ', ')
         FROM pat_archivetag dd
diff --git a/smartor/src/main/resources/mapper/smartor/PatServiceContractMapper.xml b/smartor/src/main/resources/mapper/smartor/PatServiceContractMapper.xml
new file mode 100644
index 0000000..e4205a2
--- /dev/null
+++ b/smartor/src/main/resources/mapper/smartor/PatServiceContractMapper.xml
@@ -0,0 +1,357 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.smartor.mapper.PatServiceContractMapper">
+
+    <resultMap type="com.smartor.domain.PatServiceContract" id="PatServiceContractResult">
+        <result property="id" column="id"/>
+        <result property="contractNo" column="contract_no"/>
+        <result property="patId" column="pat_id"/>
+        <result property="contractType" column="contract_type"/>
+        <result property="salesChannel" column="sales_channel"/>
+        <result property="contractAmount" column="contract_amount"/>
+        <result property="paymentStatus" column="payment_status"/>
+        <result property="contractStatus" column="contract_status"/>
+        <result property="startDate" column="start_date"/>
+        <result property="endDate" column="end_date"/>
+        <result property="actualEndDate" column="actual_end_date"/>
+        <result property="pid" column="pid"/>
+        <result property="guid" column="guid"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="createBy" column="create_by"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="orgid" column="orgid"/>
+        <result property="autoRenew" column="auto_renew"/>
+        <result property="renewalReminderDays" column="renewal_reminder_days"/>
+        <result property="specialTerms" column="special_terms"/>
+        <result property="signedAt" column="signed_at"/>
+        <result property="signedByPatient" column="signed_by_patient"/>
+        <result property="signedByHospital" column="signed_by_hospital"/>
+        <result property="cancellationReason" column="cancellation_reason"/>
+        <result property="cancelledAt" column="cancelled_at"/>
+    </resultMap>
+
+    <sql id="selectPatServiceContractVo">
+        select id,
+               contract_no,
+               pat_id,
+               contract_type,
+               sales_channel,
+               contract_amount,
+               payment_status,
+               contract_status,
+               start_date,
+               end_date,
+               actual_end_date,
+               pid,
+               guid,
+               del_flag,
+               create_by,
+               update_by,
+               update_time,
+               orgid,
+               auto_renew,
+               renewal_reminder_days,
+               special_terms,
+               signed_at,
+               signed_by_patient,
+               signed_by_hospital,
+               cancellation_reason,
+               cancelled_at
+        from pat_service_contract
+    </sql>
+
+    <select id="selectPatServiceContractList" parameterType="com.smartor.domain.PatServiceContract"
+            resultMap="PatServiceContractResult">
+        <include refid="selectPatServiceContractVo"/>
+        <where>
+            del_flag=0
+            <if test="contractNo != null  and contractNo != ''">
+                and contract_no = #{contractNo}
+            </if>
+            <if test="patId != null ">
+                and pat_id = #{patId}
+            </if>
+            <if test="contractType != null  and contractType != ''">
+                and contract_type = #{contractType}
+            </if>
+            <if test="salesChannel != null  and salesChannel != ''">
+                and sales_channel = #{salesChannel}
+            </if>
+            <if test="contractAmount != null  and contractAmount != ''">
+                and contract_amount = #{contractAmount}
+            </if>
+            <if test="paymentStatus != null  and paymentStatus != ''">
+                and payment_status = #{paymentStatus}
+            </if>
+            <if test="contractStatus != null  and contractStatus != ''">
+                and contract_status = #{contractStatus}
+            </if>
+            <if test="startDate != null ">
+                and start_date = #{startDate}
+            </if>
+            <if test="endDate != null ">
+                and end_date = #{endDate}
+            </if>
+            <if test="actualEndDate != null ">
+                and actual_end_date = #{actualEndDate}
+            </if>
+            <if test="pid != null ">
+                and pid = #{pid}
+            </if>
+            <if test="guid != null  and guid != ''">
+                and guid = #{guid}
+            </if>
+            <if test="orgid != null  and orgid != ''">
+                and orgid = #{orgid}
+            </if>
+            <if test="autoRenew != null  and autoRenew != ''">
+                and auto_renew = #{autoRenew}
+            </if>
+            <if test="renewalReminderDays != null ">
+                and renewal_reminder_days = #{renewalReminderDays}
+            </if>
+            <if test="specialTerms != null  and specialTerms != ''">
+                and special_terms = #{specialTerms}
+            </if>
+            <if test="signedAt != null ">
+                and signed_at = #{signedAt}
+            </if>
+            <if test="signedByPatient != null  and signedByPatient != ''">
+                and signed_by_patient = #{signedByPatient}
+            </if>
+            <if test="signedByHospital != null  and signedByHospital != ''">
+                and signed_by_hospital = #{signedByHospital}
+            </if>
+            <if test="cancellationReason != null  and cancellationReason != ''">
+                and cancellation_reason = #{cancellationReason}
+            </if>
+            <if test="cancelledAt != null ">
+                and cancelled_at = #{cancelledAt}
+            </if>
+        </where>
+    </select>
+
+    <select id="selectPatServiceContractById" parameterType="Long"
+            resultMap="PatServiceContractResult">
+        <include refid="selectPatServiceContractVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertPatServiceContract" parameterType="com.smartor.domain.PatServiceContract">
+        insert into pat_service_contract
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,
+            </if>
+            <if test="contractNo != null">contract_no,
+            </if>
+            <if test="patId != null">pat_id,
+            </if>
+            <if test="contractType != null">contract_type,
+            </if>
+            <if test="salesChannel != null">sales_channel,
+            </if>
+            <if test="contractAmount != null">contract_amount,
+            </if>
+            <if test="paymentStatus != null">payment_status,
+            </if>
+            <if test="contractStatus != null">contract_status,
+            </if>
+            <if test="startDate != null">start_date,
+            </if>
+            <if test="endDate != null">end_date,
+            </if>
+            <if test="actualEndDate != null">actual_end_date,
+            </if>
+            <if test="pid != null">pid,
+            </if>
+            <if test="guid != null">guid,
+            </if>
+            <if test="delFlag != null">del_flag,
+            </if>
+            <if test="createBy != null">create_by,
+            </if>
+            <if test="updateBy != null">update_by,
+            </if>
+            <if test="updateTime != null">update_time,
+            </if>
+            <if test="orgid != null">orgid,
+            </if>
+            <if test="autoRenew != null">auto_renew,
+            </if>
+            <if test="renewalReminderDays != null">renewal_reminder_days,
+            </if>
+            <if test="specialTerms != null">special_terms,
+            </if>
+            <if test="signedAt != null">signed_at,
+            </if>
+            <if test="signedByPatient != null">signed_by_patient,
+            </if>
+            <if test="signedByHospital != null">signed_by_hospital,
+            </if>
+            <if test="cancellationReason != null">cancellation_reason,
+            </if>
+            <if test="cancelledAt != null">cancelled_at,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},
+            </if>
+            <if test="contractNo != null">#{contractNo},
+            </if>
+            <if test="patId != null">#{patId},
+            </if>
+            <if test="contractType != null">#{contractType},
+            </if>
+            <if test="salesChannel != null">#{salesChannel},
+            </if>
+            <if test="contractAmount != null">#{contractAmount},
+            </if>
+            <if test="paymentStatus != null">#{paymentStatus},
+            </if>
+            <if test="contractStatus != null">#{contractStatus},
+            </if>
+            <if test="startDate != null">#{startDate},
+            </if>
+            <if test="endDate != null">#{endDate},
+            </if>
+            <if test="actualEndDate != null">#{actualEndDate},
+            </if>
+            <if test="pid != null">#{pid},
+            </if>
+            <if test="guid != null">#{guid},
+            </if>
+            <if test="delFlag != null">#{delFlag},
+            </if>
+            <if test="createBy != null">#{createBy},
+            </if>
+            <if test="updateBy != null">#{updateBy},
+            </if>
+            <if test="updateTime != null">#{updateTime},
+            </if>
+            <if test="orgid != null">#{orgid},
+            </if>
+            <if test="autoRenew != null">#{autoRenew},
+            </if>
+            <if test="renewalReminderDays != null">#{renewalReminderDays},
+            </if>
+            <if test="specialTerms != null">#{specialTerms},
+            </if>
+            <if test="signedAt != null">#{signedAt},
+            </if>
+            <if test="signedByPatient != null">#{signedByPatient},
+            </if>
+            <if test="signedByHospital != null">#{signedByHospital},
+            </if>
+            <if test="cancellationReason != null">#{cancellationReason},
+            </if>
+            <if test="cancelledAt != null">#{cancelledAt},
+            </if>
+        </trim>
+    </insert>
+
+    <update id="updatePatServiceContract" parameterType="com.smartor.domain.PatServiceContract">
+        update pat_service_contract
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="contractNo != null">contract_no =
+                #{contractNo},
+            </if>
+            <if test="patId != null">pat_id =
+                #{patId},
+            </if>
+            <if test="contractType != null">contract_type =
+                #{contractType},
+            </if>
+            <if test="salesChannel != null">sales_channel =
+                #{salesChannel},
+            </if>
+            <if test="contractAmount != null">contract_amount =
+                #{contractAmount},
+            </if>
+            <if test="paymentStatus != null">payment_status =
+                #{paymentStatus},
+            </if>
+            <if test="contractStatus != null">contract_status =
+                #{contractStatus},
+            </if>
+            <if test="startDate != null">start_date =
+                #{startDate},
+            </if>
+            <if test="endDate != null">end_date =
+                #{endDate},
+            </if>
+            <if test="actualEndDate != null">actual_end_date =
+                #{actualEndDate},
+            </if>
+            <if test="pid != null">pid =
+                #{pid},
+            </if>
+            <if test="guid != null">guid =
+                #{guid},
+            </if>
+            <if test="delFlag != null">del_flag =
+                #{delFlag},
+            </if>
+            <if test="createBy != null">create_by =
+                #{createBy},
+            </if>
+            <if test="updateBy != null">update_by =
+                #{updateBy},
+            </if>
+            <if test="updateTime != null">update_time =
+                #{updateTime},
+            </if>
+            <if test="orgid != null">orgid =
+                #{orgid},
+            </if>
+            <if test="autoRenew != null">auto_renew =
+                #{autoRenew},
+            </if>
+            <if test="renewalReminderDays != null">renewal_reminder_days =
+                #{renewalReminderDays},
+            </if>
+            <if test="specialTerms != null">special_terms =
+                #{specialTerms},
+            </if>
+            <if test="signedAt != null">signed_at =
+                #{signedAt},
+            </if>
+            <if test="signedByPatient != null">signed_by_patient =
+                #{signedByPatient},
+            </if>
+            <if test="signedByHospital != null">signed_by_hospital =
+                #{signedByHospital},
+            </if>
+            <if test="cancellationReason != null">cancellation_reason =
+                #{cancellationReason},
+            </if>
+            <if test="cancelledAt != null">cancelled_at =
+                #{cancelledAt},
+            </if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <update id="deletePatServiceContractById" parameterType="Long">
+        update pat_service_contract
+        <trim prefix="SET" suffixOverrides=",">
+            del_flag =1
+        </trim>
+        where id = #{id}
+    </update>
+
+    <update id="deletePatServiceContractByIds" parameterType="String">
+        update pat_service_contract
+        <trim prefix="SET" suffixOverrides=",">
+            del_flag =1
+        </trim>
+        where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </update>
+
+
+</mapper>
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
index 24ea5d6..0ec55c8 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -75,6 +75,7 @@
         <result property="tagname" column="tagname"/>
         <result property="visitTime" column="visit_time"/>
         <result property="leavediagname" column="leavediagname"/>
+        <result property="outPath" column="out_path"/>
     </resultMap>
 
     <resultMap type="com.smartor.domain.ServiceSubtaskCount" id="ServiceSubtaskResult2">
@@ -87,6 +88,7 @@
     <sql id="selectServiceSubtaskVo">
         select id,
                hosp_type,
+               out_path,
                suggest,
                sendstate,
                endtime,
@@ -165,6 +167,7 @@
             del_flag=0
             <if test="sendname != null  and sendname != ''">and sendname like concat('%', #{sendname}, '%')</if>
             <if test="phone != null  and phone != ''">and phone = #{phone}</if>
+            <if test="outPath != null  and outPath != ''">and out_path = #{outPath}</if>
             <if test="leavehospitaldistrictcode != null  and leavehospitaldistrictcode != ''">and
                 leavehospitaldistrictcode = #{leavehospitaldistrictcode}
             </if>
@@ -177,7 +180,7 @@
             <if test="sex != null  and sex != ''">and sex = #{sex}</if>
             <if test="age != null ">and age = #{age}</if>
             <if test="patguid != null ">and patguid = #{patguid}</if>
-            <if test="subId != null ">and id = #{subId}</if>
+            <if test="subid != null ">and id = #{subid}</if>
             <if test="inhospid != null ">and inhospid = #{inhospid}</if>
             <if test="submit != null ">and submit = #{submit}</if>
             <if test="upid != null ">and upid = #{upid}</if>
@@ -279,7 +282,8 @@
             <if test="endtime != null ">and endtime = #{endtime}</if>
             <if test="excep != null ">and excep = #{excep}</if>
             <if test="nurseName != null ">and nurse_name = #{nurseName}</if>
-            <if test="score != null">and score = #{score}</if>
+            <if test="scoreStart != null">and score &gt;= #{scoreStart}</if>
+            <if test="scoreEnd != null">and score &lt;= #{scoreEnd}</if>
             <!--            <if test="visitCount != null">and visit_count = #{visitCount}</if>-->
             <if test="visitCount != null and visitCount == 1">
                 AND visit_count = 1
@@ -293,8 +297,6 @@
             <if test="taskGuid != null">and task_guid = #{taskGuid}</if>
             <if test="isVisitAgain != null">and is_visit_again = #{isVisitAgain}</if>
             <if test="visitTime != null">and visit_time = #{visitTime}</if>
-            <!--<if test="visitDeptCode != null">and visit_dept_code = #{visitDeptCode}</if>
-            <if test="visitDeptName != null">and visit_dept_name = #{visitDeptName}</if>-->
             <if test="visitCount != null and visitCount > 1 and visitDeptCodes != null and visitDeptCodes.size() > 0">
                 AND visit_dept_code IN
                 <foreach collection="visitDeptCodes" item="visitDeptCodes" open="("
@@ -404,6 +406,8 @@
             <if test="inhospid != null ">inhospid,</if>
             <if test="visitTime != null ">visit_time,</if>
             <if test="leavediagname != null ">leavediagname,</if>
+            <if test="outPath != null">out_path,</if>
+
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="sendname != null">#{sendname},</if>
@@ -477,6 +481,8 @@
             <if test="inhospid != null ">#{inhospid},</if>
             <if test="visitTime != null ">#{visitTime},</if>
             <if test="leavediagname != null ">#{leavediagname},</if>
+            <if test="outPath != null">#{outPath},</if>
+
         </trim>
     </insert>
 
@@ -554,6 +560,7 @@
             <if test="inhospid != null ">inhospid=#{inhospid},</if>
             <if test="visitTime != null ">visit_time=#{visitTime},</if>
             <if test="leavediagname != null ">leavediagname=#{leavediagname},</if>
+            <if test="outPath != null">out_path = #{outPath},</if>
         </trim>
         where id = #{id}
     </update>
@@ -632,11 +639,13 @@
             <if test="inhospid != null ">inhospid=#{inhospid},</if>
             <if test="visitTime != null ">visitTime=#{visitTime},</if>
             <if test="delFlag != null ">del_flag=#{delFlag},</if>
+            <if test="outPath != null ">out_path = #{outPath},</if>
         </trim>
         <where>
             <if test="patid != null ">patid=#{patid}</if>
             <if test="taskid != null ">and taskid=#{taskid}</if>
             <if test="leavediagname != null ">and leavediagname=#{leavediagname}</if>
+            <if test="outPath != null  and outPath != ''">and out_path = #{outPath}</if>
         </where>
     </update>
 
@@ -714,6 +723,7 @@
             <if test="inhospid != null ">inhospid=#{inhospid},</if>
             <if test="visitTime != null ">visit_time=#{visitTime},</if>
             <if test="leavediagname != null ">leavediagname=#{leavediagname},</if>
+            <if test="outPath != null">out_path = #{outPath},</if>
         </trim>
         where patid = #{patid} and taskid = #{taskid}
     </update>
@@ -826,6 +836,7 @@
                remark,
                visit_time,
                leavediagname,
+               out_path,
                diagname
         FROM service_subtask,
              JSON_TABLE(send_time_slot, '$[*]' COLUMNS (
@@ -900,8 +911,8 @@
         WHERE
         del_flag = '0'
         <if test="startDate != null and endDate != null">
-            AND  visit_time  &gt;=  #{startDate}
-            AND  visit_time  &lt;=  #{endDate}
+            AND visit_time &gt;= #{startDate}
+            AND visit_time &lt;= #{endDate}
         </if>
 
         <if test="orgid != null">
@@ -976,8 +987,8 @@
         FROM pat_med_inhosp
         WHERE del_flag = '0'
         <if test="startDate != null and endDate != null">
-            AND endtime  &gt;=  #{startDate}
-            AND  endtime  &lt;=  #{endDate}
+            AND endtime &gt;= #{startDate}
+            AND endtime &lt;= #{endDate}
         </if>
 
         AND inhospstate=1
@@ -1082,6 +1093,5 @@
         GROUP BY timePeriod
         ORDER BY timePeriod DESC
     </select>
-
 
 </mapper>
diff --git a/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateMapper.xml
index 2dfc0ba..48ee233 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateMapper.xml
@@ -44,12 +44,14 @@
         <result property="deptCode" column="dept_code"/>
         <result property="longTemp" column="long_temp"/>
         <result property="sendDay" column="send_day"/>
+        <result property="scoreType" column="score_type"/>
     </resultMap>
 
     <sql id="selectSvyTaskTemplateVo">
         select id,
                templateid,
                prologue,
+               score_type,
                dept_code,
                long_temp,
                send_day,
@@ -95,6 +97,7 @@
         <where>
             del_flag=0
             <if test="templateid != null ">and templateid = #{templateid}</if>
+            <if test="scoreType != null ">and score_type = #{scoreType}</if>
             <if test="categoryid != null ">and categoryid = #{categoryid}</if>
             <if test="svycode != null  and svycode != ''">and svycode = #{svycode}</if>
             <if test="svyname != null  and svyname != ''">and svyname like concat('%', #{svyname}, '%')</if>
@@ -131,7 +134,7 @@
 
     <select id="selectSvyTaskTemplateBySvyid" parameterType="Long" resultMap="SvyTaskTemplateResult">
         <include refid="selectSvyTaskTemplateVo"/>
-        where del_flag=0 and  id = #{id}
+        where del_flag=0 and id = #{id}
     </select>
 
     <insert id="insertSvyTaskTemplate" parameterType="com.smartor.domain.SvyTaskTemplate" useGeneratedKeys="true"
@@ -176,6 +179,8 @@
             <if test="deptCode != null ">dept_code,</if>
             <if test="longTemp != null ">long_temp,</if>
             <if test="sendDay != null ">send_day,</if>
+            <if test="scoreType != null ">score_type,</if>
+
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="templateid != null">#{templateid},</if>
@@ -216,6 +221,8 @@
             <if test="deptCode != null ">#{deptCode},</if>
             <if test="longTemp != null ">#{longTemp},</if>
             <if test="sendDay != null ">#{sendDay},</if>
+            <if test="scoreType != null ">#{scoreType},</if>
+
         </trim>
     </insert>
 
@@ -260,6 +267,8 @@
             <if test="deptCode != null ">dept_code = #{deptCode},</if>
             <if test="longTemp != null ">long_temp = #{longTemp},</if>
             <if test="sendDay != null ">send_day = #{sendDay},</if>
+            <if test="scoreType != null ">,score_type = #{scoreType},</if>
+
         </trim>
         where id = #{id}
     </update>

--
Gitblit v1.9.3