From 17a443d510a0aa4c545df0d11467ff17a24cfa6a Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期二, 16 七月 2024 14:37:39 +0800
Subject: [PATCH] 代码提交

---
 smartor/src/main/java/com/smartor/service/impl/SvyLibScriptServiceImpl.java             |    2 
 smartor/src/main/java/com/smartor/domain/ServiceSubtask.java                            |    7 
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/tools/WeChatController.java  |   10 
 smartor/src/main/java/com/smartor/service/impl/SvyLibTemplateServiceImpl.java           |   39 ---
 smartor/src/main/java/com/smartor/domain/IvrTaskTemplateVO.java                         |    2 
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/hanler/ChatWebSocketHandler.java     |    6 
 smartor/src/main/java/com/smartor/domain/ServiceTaskVO.java                             |    2 
 smartor/src/main/java/com/smartor/domain/IvrLibaScript.java                             |   13 +
 smartor/src/main/java/com/smartor/domain/IvrLibaTargetVO.java                           |    7 
 smartor/src/main/resources/mapper/smartor/IvrTaskTemplateScriptMapper.xml               |   32 ---
 smartor/src/main/java/com/smartor/domain/SvyLibScript.java                              |   15 -
 smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java           |   22 +-
 ruoyi-admin/src/main/java/com/ruoyi/web/task/PhoneTask.java                             |    8 
 smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml               |    2 
 smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml                |    6 
 smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java          |   18 
 smartor/src/main/resources/mapper/smartor/SvyLibScriptMapper.xml                        |   25 -
 smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java              |   10 
 smartor/src/main/java/com/smartor/domain/PatTaskRelevance.java                          |    7 
 smartor/src/main/resources/mapper/smartor/IvrTaskTemplateMapper.xml                     |   19 +
 smartor/src/main/java/com/smartor/common/SendService.java                               |    1 
 ruoyi-admin/src/main/java/com/ruoyi/web/test/WeChatService.java                         |    2 
 smartor/src/main/java/com/smartor/domain/IvrTaskTemplate.java                           |    2 
 smartor/src/main/java/com/smartor/domain/SendMagParam.java                              |    2 
 smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScript.java                     |   40 ----
 smartor/src/main/java/com/smartor/domain/SvyLibTemplateScript.java                      |    8 
 smartor/src/main/java/com/smartor/domain/IvrLibaTarget.java                             |    7 
 smartor/src/main/java/com/smartor/domain/WeChatSendVo.java                              |    6 
 smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScriptVO.java                   |   10 
 smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml                      |    8 
 smartor/src/main/java/com/smartor/domain/CommonTaskcallMQ.java                          |    2 
 smartor/src/main/java/com/smartor/domain/IvrLibaTemplateScriptVO.java                   |    2 
 ruoyi-admin/src/main/resources/application-druid.yml                                    |    2 
 smartor/src/main/resources/mapper/smartor/IvrLibaTargetMapper.xml                       |    8 
 ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java                  |  190 +++++++++---------
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrLibaScriptController.java |    3 
 smartor/src/main/java/com/smartor/domain/SendTaskVO.java                                |    2 
 smartor/src/main/java/com/smartor/service/impl/WeChatServiceImpl.java                   |   12 
 smartor/src/main/java/com/smartor/service/impl/CommonTaskServiceImpl.java               |   39 ++-
 39 files changed, 277 insertions(+), 321 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 ec3d344..4f60fee 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
@@ -4,7 +4,6 @@
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.ruoyi.common.core.redis.RedisCache;
 import com.ruoyi.common.enums.ServiceFromEnum;
-import com.ruoyi.common.utils.IPUtils;
 import com.ruoyi.common.utils.RSAPublicKeyExample;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.web.task.PhoneTask;
@@ -25,9 +24,14 @@
 import org.springframework.data.redis.connection.Message;
 import org.springframework.data.redis.listener.KeyExpirationEventMessageListener;
 import org.springframework.data.redis.listener.RedisMessageListenerContainer;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Component;
 
-import java.util.*;
+import javax.annotation.Syntax;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
@@ -42,20 +46,29 @@
     @Value("${pub_key}")
     private String pub_key;
 
+    @Value("${localIP}")
+    private String localIP;
+
     @Value("${req_path}")
     private String req_path;
 
-    private static IIvrTaskTemplateService ivrTaskTemplateService;
+    @Autowired
+    private IIvrTaskTemplateService ivrTaskTemplateService;
 
-    private static ServiceSubtaskMapper ivrTaskcallMapper;
+    @Autowired
+    private ServiceSubtaskMapper ivrTaskcallMapper;
 
-    private static ServiceTaskMapper ivrTaskMapper;
+    @Autowired
+    private ServiceTaskMapper ivrTaskMapper;
 
-    private static SendService sendService;
+    @Autowired
+    private SendService sendService;
 
-    private static RedisCache redisCache;
+    @Autowired
+    private RedisCache redisCache;
 
-    private static RobotPhoneUtils robotPhoneUtils;
+    @Autowired
+    private RobotPhoneUtils robotPhoneUtils;
 
     @Autowired
     private SvyTaskMapper svyTaskMapper;
@@ -79,83 +92,60 @@
         super(listenerContainer);
     }
 
-
-    @Autowired
-    public void setIIvrTaskTemplateService(IIvrTaskTemplateService ivrTaskTemplateService) {
-        RedisMqReceiver.ivrTaskTemplateService = ivrTaskTemplateService;
-    }
-
-    @Autowired
-    public void setRobotPhoneUtilsService(RobotPhoneUtils robotPhoneUtils) {
-        RedisMqReceiver.robotPhoneUtils = robotPhoneUtils;
-    }
-
-    @Autowired
-    public void setSendService(SendService sendService) {
-        RedisMqReceiver.sendService = sendService;
-    }
-
-    @Autowired
-    public void setIvrTaskcallMapper(ServiceSubtaskMapper ivrTaskcallMapper) {
-        RedisMqReceiver.ivrTaskcallMapper = ivrTaskcallMapper;
-    }
-
-    @Autowired
-    public void setIvrTaskMapper(ServiceTaskMapper ivrTaskMapper) {
-        RedisMqReceiver.ivrTaskMapper = ivrTaskMapper;
-    }
-
-    @Autowired
-    public void setRedisCache(RedisCache redisCache) {
-        RedisMqReceiver.redisCache = redisCache;
-    }
-
     @Override
     public void onMessage(Message message, byte[] pattern) {
         log.info("鐩戝惉Redis key杩囨湡锛宬ey锛歿}锛宑hannel锛歿}", message.toString(), new String(pattern));
-        String ip = "116.62.18.175";
-        log.error("鏈満鐨勭綉缁淚P涓�:{}", ip);
-        String content = message.toString();
-        //鍒ゆ柇鏄笉鏄换鍔′俊鎭紝濡傛灉涓嶆槸锛岀洿鎺ヨ繑鍥烇紝涓嶉渶瑕佹墽琛�
-        if (!content.contains("taskid")) {
-            log.info("涓嶆槸浠诲姟淇℃伅");
-            return;
+        synchronized (RedisMqReceiver.class) {
+            String ip = localIP;
+            log.error("鏈満鐨勭綉缁淚P涓�:{}", ip);
+            String content = message.toString();
+            //鍒ゆ柇鏄笉鏄换鍔′俊鎭紝濡傛灉涓嶆槸锛岀洿鎺ヨ繑鍥烇紝涓嶉渶瑕佹墽琛�
+            if (!content.contains("taskid")) {
+                log.info("涓嶆槸浠诲姟淇℃伅");
+                return;
+            }
+            CommonTaskcallMQ commonTaskcallMQ = null;
+            try {
+                ObjectMapper mapper = new ObjectMapper();
+                if (!content.startsWith("{")) {
+                    commonTaskcallMQ = mapper.readValue("{" + content + "}", CommonTaskcallMQ.class);
+                } else {
+                    commonTaskcallMQ = mapper.readValue(content, CommonTaskcallMQ.class);
+                }
+                //杩欓噷涔嬫墍浠ヨ繖鏍峰仛涓�涓嬶紝鏄悶涓嶆噦锛屼负鍟ヤ細杩涙潵涓ら亶
+                Boolean aBoolean = redisCache.hasKey(commonTaskcallMQ.getTaskid().toString());
+                if (aBoolean) {
+                    return;
+                } else {
+                    redisCache.setCacheObject(commonTaskcallMQ.getTaskid().toString(), commonTaskcallMQ.getTaskid().toString(), 60, TimeUnit.SECONDS);
+                }
+                if (commonTaskcallMQ.getTaskType() == 1) {
+                    //闅忚
+                    sfHandle(commonTaskcallMQ, ip);
+                } else if (commonTaskcallMQ.getTaskType() == 2) {
+                    //闂嵎
+                    wjHandle(commonTaskcallMQ, ip);
+                } else if (commonTaskcallMQ.getTaskType() == 3) {
+                    //瀹f暀
+                    xjHandle(commonTaskcallMQ, ip);
+                }
+                //澶勭悊瀹屾垚锛岀Щ闄edis
+                redisCache.deleteObject(message.toString());
+
+            } catch (Exception e) {
+                Integer integer = redisCache.getCacheObject(commonTaskcallMQ.getTaskid().toString());
+                if (integer != null && integer == 2) {
+                    //灏嗘秷鎭粠闃熷垪涓垹闄�
+                } else if (integer == null) {
+                    redisCache.setCacheObject(commonTaskcallMQ.getTaskid().toString(), 1, 120, TimeUnit.MINUTES);
+                } else {
+                    redisCache.setCacheObject(commonTaskcallMQ.getTaskid().toString(), integer + 1, 120, TimeUnit.MINUTES);
+                }
+
+                log.error("============娑堣垂澶辫触,灏濊瘯娑堟伅琛ュ彂鍐嶆娑堣垂!==============  {}", e.getMessage());
+                redisCache.setCacheObject(message.toString(), message.toString(), 60, TimeUnit.SECONDS);
+            }
         }
-        CommonTaskcallMQ commonTaskcallMQ = null;
-        try {
-            ObjectMapper mapper = new ObjectMapper();
-            if (!content.startsWith("{")) {
-                commonTaskcallMQ = mapper.readValue("{" + content + "}", CommonTaskcallMQ.class);
-            } else {
-                commonTaskcallMQ = mapper.readValue(content, CommonTaskcallMQ.class);
-            }
-
-            if (commonTaskcallMQ.getTaskType() == 1) {
-                //闅忚
-                sfHandle(commonTaskcallMQ, ip);
-            } else if (commonTaskcallMQ.getTaskType() == 2) {
-                //闂嵎
-                wjHandle(commonTaskcallMQ, ip);
-            } else if (commonTaskcallMQ.getTaskType() == 3) {
-                //瀹f暀
-                xjHandle(commonTaskcallMQ, ip);
-            }
-
-
-        } catch (Exception e) {
-            Integer integer = redisCache.getCacheObject(commonTaskcallMQ.getTaskid().toString());
-            if (integer != null && integer == 2) {
-                //灏嗘秷鎭粠闃熷垪涓垹闄�
-            } else if (integer == null) {
-                redisCache.setCacheObject(commonTaskcallMQ.getTaskid().toString(), 1, 120, TimeUnit.MINUTES);
-            } else {
-                redisCache.setCacheObject(commonTaskcallMQ.getTaskid().toString(), integer + 1, 120, TimeUnit.MINUTES);
-            }
-
-            log.error("============娑堣垂澶辫触,灏濊瘯娑堟伅琛ュ彂鍐嶆娑堣垂!==============  {}", e.getMessage());
-            redisCache.setCacheObject(message.toString(), message.toString(), 60, TimeUnit.SECONDS);
-        }
-
     }
 
     /**
@@ -181,16 +171,16 @@
 
                 //閫氳繃妯℃澘ID鑾峰彇妯℃澘闂
                 IvrTaskTemplateVO ivrTaskTemplateVO = new IvrTaskTemplateVO();
-                ivrTaskTemplateVO.setID(Long.valueOf(commonTaskcallMQ.getTemplateid()));
+                ivrTaskTemplateVO.setId(Long.valueOf(commonTaskcallMQ.getTemplateid()));
                 IvrTaskTemplateVO ivrTaskTemplateVO1 = ivrTaskTemplateService.selectInfoByCondition(ivrTaskTemplateVO);
 
                 //閫氳繃浠诲姟ID鎷垮埌鎮h�呬俊鎭�
                 ServiceSubtask ivrTaskcall = new ServiceSubtask();
                 ivrTaskcall.setTaskid(commonTaskcallMQ.getTaskid());
-                List<ServiceSubtask> ivrTaskcalls = ivrTaskcallMapper.selectServiceSubtaskList(ivrTaskcall);
+                List<ServiceSubtask> selectServiceSubtaskList = ivrTaskcallMapper.selectServiceSubtaskList(ivrTaskcall);
                 if (descByCode.equals("鐢佃瘽")) {
-                    for (ServiceSubtask ivrTaskcall1 : ivrTaskcalls) {
-                        ServiceTask ivrTask = ivrTaskMapper.selectServiceTaskByTaskid(ivrTaskcall1.getTaskid());
+                    for (ServiceSubtask serviceSubtask : selectServiceSubtaskList) {
+                        ServiceTask ivrTask = ivrTaskMapper.selectServiceTaskByTaskid(serviceSubtask.getTaskid());
                         if (ivrTask.getSendState() != null && ivrTask.getSendState() == 3 || ivrTask.getSendState() != null && ivrTask.getSendState() == 4) {
                             //濡備綍浠诲姟琚�滄殏鍋溾�濇垨鈥滅粓姝⑩��
                             break;
@@ -198,20 +188,22 @@
 
                         //浠诲姟鍙戦�佽褰曪紙杩欎釜浠g爜搴旇鍐欏湪phoneTask涓紝鍏堝啓鍦ㄨ繖锛屽悗闈㈠啀鏀癸級
                         ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord();
-                        serviceSubtaskRecord.setTaskid(ivrTaskcall1.getTaskid().toString());
+                        serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString());
                         serviceSubtaskRecord.setUuid(UUID.randomUUID().toString());
-                        serviceSubtaskRecord.setTasktype(ivrTaskcall1.getType());
+                        serviceSubtaskRecord.setTasktype(serviceSubtask.getType());
                         serviceSubtaskRecord.setPreachform("3");
                         serviceSubtaskRecord.setStartTime(System.currentTimeMillis());
                         serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord);
 
                         //閫氳繃澶氱嚎绋嬬殑鏂瑰紡鍘绘墦鐢佃瘽
-                        executorService.submit(new PhoneTask(ivrTaskcall1, ivrTaskTemplateVO1, redisCache, sendService, phonePath, robotPhoneUtils));
+                        executorService.submit(new PhoneTask(serviceSubtask, ivrTaskTemplateVO1, redisCache, sendService, phonePath, robotPhoneUtils));
                     }
                 } else if (descByCode.equals("澶氬獟浣�")) {
                     //澶氬獟浣�
+                    return;
                 } else if (descByCode.equals("绾歌川")) {
                     //绾歌川
+                    return;
                 } else if (descByCode.equals("鐭俊")) {
                     //鐭俊
 //                        http://localhost:8099/followvisit/particty?param1=3&param2=348
@@ -219,8 +211,8 @@
                     RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
                     String taskId = rsaPublicKeyExample.encryptedData(ivrTask1.getTaskid().toString(), pub_key);
 
-                    for (ServiceSubtask ivrTaskSingle : ivrTaskcalls) {
-                        String patid = rsaPublicKeyExample.encryptedData(ivrTaskSingle.getPatid().toString(), pub_key);
+                    for (ServiceSubtask serviceSubtask : selectServiceSubtaskList) {
+                        String patid = rsaPublicKeyExample.encryptedData(serviceSubtask.getPatid().toString(), pub_key);
                         SendMagParam sendMagParam = new SendMagParam();
                         sendMagParam.setType("4");
                         sendMagParam.setUrl(ip + ":" + req_path + "/followvisit/particty?param1=" + taskId + "&param2=" + patid);
@@ -229,9 +221,9 @@
 
                         //浠诲姟鍙戦�佽褰�
                         ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord();
-                        serviceSubtaskRecord.setTaskid(ivrTaskSingle.getTaskid().toString());
+                        serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString());
                         serviceSubtaskRecord.setUuid(UUID.randomUUID().toString());
-                        serviceSubtaskRecord.setTasktype(ivrTaskSingle.getType());
+                        serviceSubtaskRecord.setTasktype(serviceSubtask.getType());
                         serviceSubtaskRecord.setPreachform("4");
                         serviceSubtaskRecord.setStartTime(System.currentTimeMillis());
                         serviceSubtaskRecord.setResult(aBoolean == true ? "鎴愬姛" : "澶辫触");
@@ -242,24 +234,26 @@
                     //鍏紬鍙�
                     RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
                     String taskId = rsaPublicKeyExample.encryptedData(ivrTask1.getTaskid().toString(), pub_key);
-                    for (ServiceSubtask ivrTaskSingle : ivrTaskcalls) {
-                        String patid = rsaPublicKeyExample.encryptedData(ivrTaskSingle.getPatid().toString(), pub_key);
+                    for (ServiceSubtask serviceSubtask : selectServiceSubtaskList) {
+                        String patid = rsaPublicKeyExample.encryptedData(serviceSubtask.getPatid().toString(), pub_key);
                         SendMagParam sendMagParam = new SendMagParam();
                         sendMagParam.setType("5");
-                        sendMagParam.setUrl(ip + ":" + req_path + "/outsideChain?param1=" + ivrTask1.getTaskid().toString() + "&param2=" + ivrTaskSingle.getPatid().toString() + "&param3=" + ivrTask1.getTaskName());
+                        sendMagParam.setUrl(ip + ":" + req_path + "/outsideChain?param1=" + ivrTask1.getTaskid().toString() + "&param2=" + serviceSubtask.getPatid().toString() + "&param3=" + ivrTask1.getTaskName());
                         log.info("閾炬帴瀹屾暣璺緞锛歿}", req_path + "/outsideChain?param1=" + taskId + "&param2=" + patid + "&param3=" + ivrTask1.getTaskName());
                         //杩欎釜妯℃澘ID鍏堝啓姝伙紝鍚庨潰鍋氭垚鍙��
                         sendMagParam.setTmpCode("oG3pJHPVWpE81DmZsua_2tKwgJ97r0qz37z56ns7NB4");
                         Map map = new HashMap();
                         map.put("first", ivrTask1.getTaskName());
                         sendMagParam.setContent(JSON.toJSONString(map));
+                        sendMagParam.setOpenid(serviceSubtask.getOpenid());
+
                         Boolean aBoolean = sendService.sendMsg(sendMagParam);
 
                         //浠诲姟鍙戦�佽褰�
                         ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord();
-                        serviceSubtaskRecord.setTaskid(ivrTaskSingle.getTaskid().toString());
+                        serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString());
                         serviceSubtaskRecord.setUuid(UUID.randomUUID().toString());
-                        serviceSubtaskRecord.setTasktype(ivrTaskSingle.getType());
+                        serviceSubtaskRecord.setTasktype(serviceSubtask.getType());
                         serviceSubtaskRecord.setPreachform("4");
                         serviceSubtaskRecord.setStartTime(System.currentTimeMillis());
                         serviceSubtaskRecord.setResult(aBoolean == true ? "鎴愬姛" : "澶辫触");
@@ -294,7 +288,7 @@
 
                 //閫氳繃妯℃澘ID鑾峰彇妯℃澘闂
                 IvrTaskTemplateVO ivrTaskTemplateVO = new IvrTaskTemplateVO();
-                ivrTaskTemplateVO.setID(Long.valueOf(commonTaskcallMQ.getTemplateid()));
+                ivrTaskTemplateVO.setId(Long.valueOf(commonTaskcallMQ.getTemplateid()));
                 IvrTaskTemplateVO ivrTaskTemplateVO1 = ivrTaskTemplateService.selectInfoByCondition(ivrTaskTemplateVO);
 
                 //閫氳繃浠诲姟ID鎷垮埌鎮h�呬俊鎭�
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/hanler/ChatWebSocketHandler.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/hanler/ChatWebSocketHandler.java
index 380915e..a369af2 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/hanler/ChatWebSocketHandler.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/hanler/ChatWebSocketHandler.java
@@ -117,7 +117,7 @@
             if (socketMessage.getTemplateId() != null) {
                 //閫氳繃妯℃澘ID鑾峰彇妯℃澘闂
                 IvrTaskTemplateVO ivrTaskTemplateVO = new IvrTaskTemplateVO();
-                ivrTaskTemplateVO.setID(socketMessage.getTemplateId());
+                ivrTaskTemplateVO.setId(socketMessage.getTemplateId());
                 IvrTaskTemplateVO ivrTaskTemplateVO1 = ivrTaskTemplateService.selectInfoByCondition(ivrTaskTemplateVO);
                 redisCache.setCacheObject(userId + "ivrTaskTemplateVO1", ivrTaskTemplateVO1, 120, TimeUnit.MINUTES);
                 //灏嗘煡鍑烘潵鐨勯棶棰�,鏀惧埌鍏ㄥ眬鍙橀噺涓幓
@@ -352,8 +352,8 @@
                                 if (ivrLibaExtemplatescript.getIsEnd() == 1) {
                                     //灏嗛棶棰樼疆绌�
                                     IvrTaskTemplateScriptVO nowQuestion1 = returnQues.getNowQuestion();
-                                    nowQuestion1.setQuestionText(null);
-                                    nowQuestion1.setQuestionVoice(null);
+                                    nowQuestion1.setScriptContent(null);
+                                    nowQuestion1.setScriptVoice(null);
                                     returnQues.setNowQuestion(nowQuestion1);
                                     redisCache.setCacheObject(userId + "returnQues", returnQues, 120, TimeUnit.MINUTES);
 
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrLibaScriptController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrLibaScriptController.java
index bce7146..730bf03 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrLibaScriptController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrLibaScriptController.java
@@ -6,6 +6,7 @@
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.exception.base.BaseException;
+import com.ruoyi.common.utils.PageUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.smartor.domain.IvrLibaScript;
 import com.smartor.domain.IvrLibaScriptVO;
@@ -40,7 +41,7 @@
     @PreAuthorize("@ss.hasPermi('system:script:list')")
     @PostMapping("/list")
     public TableDataInfo list(@RequestBody IvrLibaScript ivrLibaScript) {
-        startPage();
+        PageUtils.startPageByPost(ivrLibaScript.getPageNum(),ivrLibaScript.getPageSize());
         List<IvrLibaScript> list = ivrLibaScriptService.selectIvrLibaScriptList(ivrLibaScript);
         return getDataTable(list);
     }
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/tools/WeChatController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/tools/WeChatController.java
index d476d32..60fb6be 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/tools/WeChatController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/tools/WeChatController.java
@@ -76,11 +76,11 @@
      * @param weChatSendVo
      * @return
      */
-    @ApiOperation("寰俊鍏紬鍙蜂俊鎭彂閫�")
-    @PostMapping("/sendMessageToFollowers")
-    public AjaxResult sendMessageToFollowers(@RequestBody WeChatSendVo weChatSendVo) {
-        return toAjax(weChatService.sendMessageToFollowers(weChatSendVo));
-    }
+//    @ApiOperation("寰俊鍏紬鍙蜂俊鎭彂閫�")
+//    @PostMapping("/sendMessageToFollowers")
+//    public AjaxResult sendMessageToFollowers(@RequestBody WeChatSendVo weChatSendVo) {
+//        return toAjax(weChatService.sendMessageToFollowers(weChatSendVo));
+//    }
 
 
     /**
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/task/PhoneTask.java b/ruoyi-admin/src/main/java/com/ruoyi/web/task/PhoneTask.java
index 686abe4..25be19e 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/task/PhoneTask.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/task/PhoneTask.java
@@ -57,7 +57,7 @@
                     for (IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO : ivrTaskTemplateScriptVO) {
                         for (Map<String, String> map : mapList) {
                             for (String key : map.keySet()) {
-                                ivrTaskTemplateScriptVO.setQuestionText(ivrTaskTemplateScriptVO.getQuestionText().replace(key, map.get(key)));
+                                ivrTaskTemplateScriptVO.setScriptContent(ivrTaskTemplateScriptVO.getScriptContent().replace(key, map.get(key)));
                             }
                         }
                     }
@@ -81,11 +81,11 @@
                 redisCache.setCacheObject(uuid + "returnQues", returnQues, 120, TimeUnit.MINUTES);
                 redisCache.setCacheObject(uuid + "ivrTaskTemplateVO", ivrTaskTemplateVO, 120, TimeUnit.MINUTES);
 
-                System.out.println("----------------uuID涓� 锛�" + uuid + "       " + ivrTaskSingle.getSendname() + "       " + returnQues.getNowQuestion().getQuestionText() + "     " + ivrTaskSingle.getPhone());
+                System.out.println("----------------uuID涓� 锛�" + uuid + "       " + ivrTaskSingle.getSendname() + "       " + returnQues.getNowQuestion().getScriptContent() + "     " + ivrTaskSingle.getPhone());
 
                 //鍏堝皢璇濇湳鏀惧埌ob_queue闃熷垪涓�
                 IvrTaskcallPhoneMQ ivrTaskcallPhoneMQ = new IvrTaskcallPhoneMQ();
-                ivrTaskcallPhoneMQ.setScript(ivrTaskTemplateVO.getRevisitBefore() + returnQues.getNowQuestion().getQuestionText());
+                ivrTaskcallPhoneMQ.setScript(ivrTaskTemplateVO.getRevisitBefore() + returnQues.getNowQuestion().getScriptContent());
                 ivrTaskcallPhoneMQ.setType("1");
                 ivrTaskcallPhoneMQ.setUuid(uuid);
                 String data = JSON.toJSONString(ivrTaskcallPhoneMQ);
@@ -93,7 +93,7 @@
 
                 //璋冪敤鏈哄櫒浜虹數璇濓紝寮�濮嬬數璇�
                 String ob = phoneUtils.ob("", "", "", "", "", "", "", ivrTaskSingle.getPhone(), uuid, true);
-                System.out.println("----------------uuID涓� 锛�" + uuid + "       " + ivrTaskSingle.getSendname() + "       " + returnQues.getNowQuestion().getQuestionText() + "     " + ivrTaskSingle.getPhone() + "----------宸茬粡鎷ㄦ墦");
+                System.out.println("----------------uuID涓� 锛�" + uuid + "       " + ivrTaskSingle.getSendname() + "       " + returnQues.getNowQuestion().getScriptContent() + "     " + ivrTaskSingle.getPhone() + "----------宸茬粡鎷ㄦ墦");
                 Map<String, String> obMap = objectMapper.readValue(ob, Map.class);
                 Thread.sleep(1000);
                 redisCache.setCacheObject(uuid + "state_id", "0", 10, TimeUnit.MINUTES);
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/test/WeChatService.java b/ruoyi-admin/src/main/java/com/ruoyi/web/test/WeChatService.java
index 5b05d38..f0e7b20 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/test/WeChatService.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/test/WeChatService.java
@@ -81,7 +81,7 @@
             map.put("keyword2", "12657698798797");
             map.put("remark", "鍟婂晩鎾掑晩鍟婂晩");
             weChatSendVo.setContent(map);
-            weChatController.sendMessageToFollowers(weChatSendVo);
+//            weChatController.sendMessageToFollowers(weChatSendVo);
         }
 
     }
diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml
index 954cd06..4975504 100644
--- a/ruoyi-admin/src/main/resources/application-druid.yml
+++ b/ruoyi-admin/src/main/resources/application-druid.yml
@@ -135,3 +135,5 @@
 
 #浜岀淮鐮佽矾寰�
 qrpath: D:\qrcode
+
+localIP: 192.168.2.8
diff --git a/smartor/src/main/java/com/smartor/common/SendService.java b/smartor/src/main/java/com/smartor/common/SendService.java
index 777f2ee..12e0f3b 100644
--- a/smartor/src/main/java/com/smartor/common/SendService.java
+++ b/smartor/src/main/java/com/smartor/common/SendService.java
@@ -74,6 +74,7 @@
                     e.printStackTrace();
                 }
                 weChatSendVo.setContent(map);
+                weChatSendVo.setOpenid(sendMagParam.getOpenid());
                 Boolean aBoolean1 = weChatService.sendMessageToFollowers(weChatSendVo);
                 return aBoolean1;
             case ("6"):
diff --git a/smartor/src/main/java/com/smartor/domain/CommonTaskcallMQ.java b/smartor/src/main/java/com/smartor/domain/CommonTaskcallMQ.java
index 21c872f..246375c 100644
--- a/smartor/src/main/java/com/smartor/domain/CommonTaskcallMQ.java
+++ b/smartor/src/main/java/com/smartor/domain/CommonTaskcallMQ.java
@@ -63,6 +63,6 @@
      * 鍙戦�佹椂闂存
      */
     @ApiModelProperty(value = "鍙戦�佹椂闂存 ")
-    private List<TaskSendTimeVO> sendTimeslot;
+    private TaskSendTimeVO sendTimeslot;
 
 }
diff --git a/smartor/src/main/java/com/smartor/domain/IvrLibaScript.java b/smartor/src/main/java/com/smartor/domain/IvrLibaScript.java
index cb743a1..36c60eb 100644
--- a/smartor/src/main/java/com/smartor/domain/IvrLibaScript.java
+++ b/smartor/src/main/java/com/smartor/domain/IvrLibaScript.java
@@ -316,5 +316,18 @@
     @ApiModelProperty(value = "鏍囩")
     private String tag;
 
+    /**
+     * pageNum
+     */
+    @ApiModelProperty(value = "pageNum")
+    @Excel(name = "pageNum")
+    private Integer pageNum;
+
+    /**
+     * pageSize
+     */
+    @ApiModelProperty(value = "pageSize")
+    @Excel(name = "pageSize")
+    private Integer pageSize;
 
 }
diff --git a/smartor/src/main/java/com/smartor/domain/IvrLibaTarget.java b/smartor/src/main/java/com/smartor/domain/IvrLibaTarget.java
index d9b1c39..cb97c61 100644
--- a/smartor/src/main/java/com/smartor/domain/IvrLibaTarget.java
+++ b/smartor/src/main/java/com/smartor/domain/IvrLibaTarget.java
@@ -34,6 +34,13 @@
     @Excel(name = "鍒嗙粍ID")
     @ApiModelProperty(value = "鍒嗙粍ID")
     private String groupid;
+    
+    /**
+     * 閫傜敤棰樺瀷(鍗曢�夈�佸閫夈�佸煷绌恒�佺粍鍚�)
+     */
+    @Excel(name = "閫傜敤棰樺瀷(鍗曢�夈�佸閫夈�佸煷绌恒�佺粍鍚�)")
+    @ApiModelProperty(value = "閫傜敤棰樺瀷(鍗曢�夈�佸閫夈�佸煷绌恒�佺粍鍚�)")
+    private String scriptType;
 
     /**
      * 鎸囨爣绫诲瀷
diff --git a/smartor/src/main/java/com/smartor/domain/IvrLibaTargetVO.java b/smartor/src/main/java/com/smartor/domain/IvrLibaTargetVO.java
index 7d65022..987bdc6 100644
--- a/smartor/src/main/java/com/smartor/domain/IvrLibaTargetVO.java
+++ b/smartor/src/main/java/com/smartor/domain/IvrLibaTargetVO.java
@@ -39,6 +39,13 @@
     private String groupid;
 
     /**
+     * 閫傜敤棰樺瀷(鍗曢�夈�佸閫夈�佸煷绌恒�佺粍鍚�)
+     */
+    @Excel(name = "閫傜敤棰樺瀷(鍗曢�夈�佸閫夈�佸煷绌恒�佺粍鍚�)")
+    @ApiModelProperty(value = "閫傜敤棰樺瀷(鍗曢�夈�佸閫夈�佸煷绌恒�佺粍鍚�)")
+    private String scriptType;
+
+    /**
      * 鎸囨爣绫诲瀷
      */
     @Excel(name = "鎸囨爣绫诲瀷")
diff --git a/smartor/src/main/java/com/smartor/domain/IvrLibaTemplateScriptVO.java b/smartor/src/main/java/com/smartor/domain/IvrLibaTemplateScriptVO.java
index 3644f02..ce50290 100644
--- a/smartor/src/main/java/com/smartor/domain/IvrLibaTemplateScriptVO.java
+++ b/smartor/src/main/java/com/smartor/domain/IvrLibaTemplateScriptVO.java
@@ -60,7 +60,7 @@
      */
     @Excel(name = "璇濇湳鍐呭")
     @ApiModelProperty(value = "璇濇湳鍐呭")
-    private String scriptConten;
+    private String scriptContent;
 
     /**
      * 璇濇湳鎻忚堪
diff --git a/smartor/src/main/java/com/smartor/domain/IvrTaskTemplate.java b/smartor/src/main/java/com/smartor/domain/IvrTaskTemplate.java
index 0ed0b41..9fa1c71 100644
--- a/smartor/src/main/java/com/smartor/domain/IvrTaskTemplate.java
+++ b/smartor/src/main/java/com/smartor/domain/IvrTaskTemplate.java
@@ -24,7 +24,7 @@
      * 涓婚敭
      */
     @ApiModelProperty(value = "涓婚敭")
-    private Long ID;
+    private Long id;
 
     /**
      * 浠诲姟id
diff --git a/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScript.java b/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScript.java
index 06d433b..388611e 100644
--- a/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScript.java
+++ b/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScript.java
@@ -34,12 +34,6 @@
     @ApiModelProperty(value = "浠诲姟id")
     private Long taskid;
 
-    /**
-     * 妯℃澘璇濇湳缂栧彿
-     */
-    @Excel(name = "妯℃澘璇濇湳缂栧彿")
-    @ApiModelProperty(value = "妯℃澘璇濇湳缂栧彿")
-    private Long templateQuestionNum;
 
     /**
      * 妯℃澘ID
@@ -48,12 +42,6 @@
     @ApiModelProperty(value = "妯℃澘ID")
     private Long templateID;
 
-    /**
-     * 璇濇湳ID
-     */
-    @Excel(name = "璇濇湳ID")
-    @ApiModelProperty(value = "璇濇湳ID")
-    private Long scriptID;
 
     /**
      * 闂鐐�
@@ -61,20 +49,6 @@
     @Excel(name = "闂鐐�")
     @ApiModelProperty(value = "闂鐐�")
     private String questionPoint;
-
-    /**
-     * 璇濇湳鍐呭
-     */
-    @Excel(name = "璇濇湳鍐呭")
-    @ApiModelProperty(value = "璇濇湳鍐呭")
-    private String questionText;
-
-    /**
-     * 璇濇湳璇煶
-     */
-    @Excel(name = "璇濇湳璇煶")
-    @ApiModelProperty(value = "璇濇湳璇煶")
-    private String questionVoice;
 
     /**
      * 鏃犲尮閰嶈瘽鏈�
@@ -229,20 +203,6 @@
     @Excel(name = "鍩虹鎸囨爣鍊�")
     @ApiModelProperty(value = "鍩虹鎸囨爣鍊�")
     private String targetvalue;
-
-    /**
-     * 鏍囬
-     */
-    @Excel(name = "鏍囬")
-    @ApiModelProperty(value = "鏍囬")
-    private String questiontitle;
-
-    /**
-     * 涓嬩竴棰�
-     */
-    @Excel(name = "涓嬩竴棰�")
-    @ApiModelProperty(value = "涓嬩竴棰�")
-    private Long nextQuestion;
 
     /**
      * 鍏跺畠鏁版嵁锛堝瓨鍌ㄥ彉閲忥級
diff --git a/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScriptVO.java b/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScriptVO.java
index f967a45..96781f9 100644
--- a/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScriptVO.java
+++ b/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScriptVO.java
@@ -41,7 +41,7 @@
      */
     @Excel(name = "妯℃澘璇濇湳缂栧彿")
     @ApiModelProperty(value = "妯℃澘璇濇湳缂栧彿")
-    private Long templateQuestionNum;
+    private Long scriptno;
 
     /**
      * 妯℃澘ID
@@ -69,14 +69,14 @@
      */
     @Excel(name = "璇濇湳鍐呭")
     @ApiModelProperty(value = "璇濇湳鍐呭")
-    private String questionText;
+    private String scriptContent;
 
     /**
      * 璇濇湳璇煶
      */
     @Excel(name = "璇濇湳璇煶")
     @ApiModelProperty(value = "璇濇湳璇煶")
-    private String questionVoice;
+    private String scriptVoice;
 
     /**
      * 鏃犲尮閰嶈瘽鏈�
@@ -237,14 +237,14 @@
      */
     @Excel(name = "鏍囬")
     @ApiModelProperty(value = "鏍囬")
-    private String questiontitle;
+    private String scriptTopic;
 
     /**
      * 涓嬩竴棰�
      */
     @Excel(name = "涓嬩竴棰�")
     @ApiModelProperty(value = "涓嬩竴棰�")
-    private Long nextQuestion;
+    private Long nextScriptno;
 
     /**
      * 鍏跺畠鏁版嵁锛堝瓨鍌ㄥ彉閲忥級
diff --git a/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateVO.java b/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateVO.java
index 66b9b8b..85b8180 100644
--- a/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateVO.java
+++ b/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateVO.java
@@ -26,7 +26,7 @@
      * 涓婚敭
      */
     @ApiModelProperty(value = "涓婚敭")
-    private Long ID;
+    private Long id;
 
     /**
      * 浠诲姟id
diff --git a/smartor/src/main/java/com/smartor/domain/PatTaskRelevance.java b/smartor/src/main/java/com/smartor/domain/PatTaskRelevance.java
index c7d45e2..5f00203 100644
--- a/smartor/src/main/java/com/smartor/domain/PatTaskRelevance.java
+++ b/smartor/src/main/java/com/smartor/domain/PatTaskRelevance.java
@@ -34,6 +34,13 @@
     private Long patid;
 
     /**
+     * 寰俊鍏紬鍙锋偅鑰匢D
+     */
+    @Excel(name = "寰俊鍏紬鍙锋偅鑰匢D")
+    @ApiModelProperty("寰俊鍏紬鍙锋偅鑰匢D")
+    private String openid;
+
+    /**
      * 瀹f暀浠诲姟ID
      */
     @Excel(name = "瀹f暀浠诲姟ID")
diff --git a/smartor/src/main/java/com/smartor/domain/SendMagParam.java b/smartor/src/main/java/com/smartor/domain/SendMagParam.java
index fd6fe37..60132b3 100644
--- a/smartor/src/main/java/com/smartor/domain/SendMagParam.java
+++ b/smartor/src/main/java/com/smartor/domain/SendMagParam.java
@@ -17,4 +17,6 @@
     private String tmpCode;
 
     private String url;
+
+    private String openid;
 }
diff --git a/smartor/src/main/java/com/smartor/domain/SendTaskVO.java b/smartor/src/main/java/com/smartor/domain/SendTaskVO.java
index 97ac3e8..5a85730 100644
--- a/smartor/src/main/java/com/smartor/domain/SendTaskVO.java
+++ b/smartor/src/main/java/com/smartor/domain/SendTaskVO.java
@@ -31,7 +31,7 @@
      */
     @Excel(name = " 浠诲姟绫诲瀷锛�  1  闅忚   2 闂嵎    3 瀹f暀 ")
     @ApiModelProperty(value = "浠诲姟绫诲瀷锛�  1  闅忚   2 闂嵎    3 瀹f暀 ")
-    private Integer taskType = 1;
+    private Integer taskType;
 
 
 }
diff --git a/smartor/src/main/java/com/smartor/domain/ServiceSubtask.java b/smartor/src/main/java/com/smartor/domain/ServiceSubtask.java
index da13128..f9b6605 100644
--- a/smartor/src/main/java/com/smartor/domain/ServiceSubtask.java
+++ b/smartor/src/main/java/com/smartor/domain/ServiceSubtask.java
@@ -47,6 +47,13 @@
     private String phone;
 
     /**
+     * 鎵嬫満鍙�
+     */
+    @Excel(name = " 鎵嬫満鍙� ")
+    @ApiModelProperty(value = "鎵嬫満鍙�")
+    private String openid;
+
+    /**
      * 鎬у埆
      */
     @Excel(name = "  鎬у埆")
diff --git a/smartor/src/main/java/com/smartor/domain/ServiceTaskVO.java b/smartor/src/main/java/com/smartor/domain/ServiceTaskVO.java
index c7dc32d..ec869a0 100644
--- a/smartor/src/main/java/com/smartor/domain/ServiceTaskVO.java
+++ b/smartor/src/main/java/com/smartor/domain/ServiceTaskVO.java
@@ -152,7 +152,7 @@
     /**
      *
      */
-    @Excel(name = "  ")
+    @Excel(name = "绫诲瀷鍚嶇О")
     private String typename;
 
     /**
diff --git a/smartor/src/main/java/com/smartor/domain/SvyLibScript.java b/smartor/src/main/java/com/smartor/domain/SvyLibScript.java
index 856e868..ac7e7f9 100644
--- a/smartor/src/main/java/com/smartor/domain/SvyLibScript.java
+++ b/smartor/src/main/java/com/smartor/domain/SvyLibScript.java
@@ -28,30 +28,17 @@
     private Long id;
 
     /**
-     * 鑰佺増鏈琁D
-     */
-    @ApiModelProperty("鑰佺増鏈琁D")
-    private Long oldid;
-
-    /**
      * 闂埜棰樼洰鍒嗙被ID
      */
     @ApiModelProperty("鍒嗙被ID")
     private Long categoryid;
 
     /**
-     * 闂嵎ID
-     */
-    @Excel(name = " 闂嵎ID ")
-    @ApiModelProperty("闂嵎ID")
-    private Long svyid;
-
-    /**
      * 棰樼洰绫诲瀷;鏋氫妇 1.鍗曢�� 2澶氶�� 3濉┖
      */
     @Excel(name = " 棰樼洰绫诲瀷;鏋氫妇 1.鍗曢�� 2澶氶�� 3濉┖ ")
     @ApiModelProperty("棰樼洰绫诲瀷;鏋氫妇 1.鍗曢�� 2澶氶�� 3濉┖")
-    private String scripttype = "";
+    private String scriptType = "";
 
     /**
      * 棰樼洰Code
diff --git a/smartor/src/main/java/com/smartor/domain/SvyLibTemplateScript.java b/smartor/src/main/java/com/smartor/domain/SvyLibTemplateScript.java
index e85a5b4..3f3bfce 100644
--- a/smartor/src/main/java/com/smartor/domain/SvyLibTemplateScript.java
+++ b/smartor/src/main/java/com/smartor/domain/SvyLibTemplateScript.java
@@ -29,6 +29,14 @@
     @ApiModelProperty("鑷ID")
     private Long id;
 
+    /**
+     * 闂嵎ID
+     */
+    @Excel(name = " 闂嵎妯℃澘ID ")
+    @ApiModelProperty("闂嵎妯℃澘ID")
+    private Long svyid;
+
+
 
     /**
      * 棰樼洰绫诲瀷;鏋氫妇 1.鍗曢�� 2澶氶�� 3濉┖ 4鍏跺畠
diff --git a/smartor/src/main/java/com/smartor/domain/WeChatSendVo.java b/smartor/src/main/java/com/smartor/domain/WeChatSendVo.java
index 4d8af6c..6514f5d 100644
--- a/smartor/src/main/java/com/smartor/domain/WeChatSendVo.java
+++ b/smartor/src/main/java/com/smartor/domain/WeChatSendVo.java
@@ -33,4 +33,10 @@
     @ApiModelProperty(value = "璺宠浆URL")
     String url;
 
+    /**
+     * 鐢ㄦ埛寰俊ID
+     */
+    @ApiModelProperty(value = "鐢ㄦ埛寰俊ID")
+    String openid;
+
 }
diff --git a/smartor/src/main/java/com/smartor/service/impl/CommonTaskServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/CommonTaskServiceImpl.java
index a51c4e9..12442f3 100644
--- a/smartor/src/main/java/com/smartor/service/impl/CommonTaskServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/CommonTaskServiceImpl.java
@@ -67,8 +67,8 @@
             serviceTask.setTaskid(sendTaskVO.getTaskId());
             serviceTask.setStopState(ivrTask.getStopState() + 1);
             serviceTask.setSendState(sendTaskVO.getSendState());
-            ivrTaskService.updateServiceTask(serviceTask);
-            return 0;
+            int i = ivrTaskService.updateServiceTask(serviceTask);
+            return i;
         }
 
         //鍒ゆ柇鍙戦�佺姸鎬佹槸鍚︿负绌�
@@ -86,6 +86,7 @@
             serviceTask.setTaskid(ivrTask.getTaskid());
             serviceTask.setSendState(2);
             ivrTaskService.updateServiceTask(serviceTask);
+            log.error("娑堟伅鍙戦�佹垚鍔�");
         } else if (StringUtils.isNotEmpty(sendTaskVO.getSendType()) && sendTaskVO.getSendType().equals("1") || StringUtils.isNotEmpty(sendTaskVO.getSendType()) && sendTaskVO.getSendType().equals("3")) {
             //鏃堕棿娈靛彂閫�
             ObjectMapper objectMapper = new ObjectMapper();
@@ -98,9 +99,9 @@
                     log.error("JsonProcessingException鎶ラ敊浜嗭細{}", e.getMessage());
                 }
                 for (TaskSendTimeVO taskSendTimeVO : taskSendTimeVOList) {
-                    //鍘籗endTimeslot涓紝鑾峰彇鎵�鏈夌殑鏃堕棿娈�
-                    List<TaskSendTimeVO> list = new ArrayList<>();
-                    list.add(taskSendTimeVO);
+//                    //鍘籗endTimeslot涓紝鑾峰彇鎵�鏈夌殑鏃堕棿娈�
+//                    List<TaskSendTimeVO> list = new ArrayList<>();
+//                    list.add(taskSendTimeVO);
 
                     //鑾峰彇寮�濮嬪彂閫佹椂闂�
                     String begantime = taskSendTimeVO.getBegantime();
@@ -111,14 +112,15 @@
                         Date date = sdf.parse(begantime);
                         milliseconds = date.getTime() - System.currentTimeMillis();
                         System.out.println("鏃ユ湡姣鏁帮細" + milliseconds);
+                        SendTaskVO sendTaskVO1 = DtoConversionUtils.sourceToTarget(sendTaskVO, SendTaskVO.class);
+                        sendTaskVO1.setSendType("1");
+                        String content = sendMQContent(sendTaskVO1, ivrTask.getTemplateid().toString(), ivrTask.getPreachform(), ivrTask.getStopState(), taskSendTimeVO);
+                        redisCache.setCacheObject(content, content, milliseconds / 1000, TimeUnit.SECONDS);
                     } catch (Exception e) {
                         e.printStackTrace();
+                        if (milliseconds < 0)
+                            throw new BaseException("璇锋鏌ヤ换鍔″紑濮嬫椂闂达紝涓嶈兘灏忎簬褰撳墠鏃堕棿");
                     }
-
-                    SendTaskVO sendTaskVO1 = DtoConversionUtils.sourceToTarget(sendTaskVO, SendTaskVO.class);
-                    sendTaskVO1.setSendType("1");
-                    String content = sendMQContent(sendTaskVO1, ivrTask.getTemplateid().toString(), ivrTask.getPreachform(), ivrTask.getStopState(), list);
-                    redisCache.setCacheObject(content, content, milliseconds / 1000, TimeUnit.SECONDS);
                 }
                 //灏嗕换鍔$姸鎬佷慨鏀规垚鎵ц涓�
                 ServiceTask serviceTask = new ServiceTask();
@@ -126,8 +128,7 @@
                 serviceTask.setSendState(2);
                 ivrTaskService.updateServiceTask(serviceTask);
             }
-        }
-        return 1;
+        } return 1;
     }
 
     public int wjSend(SendTaskVO sendTaskVO) {
@@ -171,8 +172,8 @@
                 }
                 for (TaskSendTimeVO taskSendTimeVO : taskSendTimeVOList) {
                     //鍘籗endTimeslot涓紝鑾峰彇鎵�鏈夌殑鏃堕棿娈�
-                    List<TaskSendTimeVO> list = new ArrayList<>();
-                    list.add(taskSendTimeVO);
+//                    List<TaskSendTimeVO> list = new ArrayList<>();
+//                    list.add(taskSendTimeVO);
 
                     //鑾峰彇寮�濮嬪彂閫佹椂闂�
                     String begantime = taskSendTimeVO.getBegantime();
@@ -189,7 +190,7 @@
 
                     SendTaskVO sendTaskVO1 = DtoConversionUtils.sourceToTarget(sendTaskVO, SendTaskVO.class);
                     sendTaskVO1.setSendType("1");
-                    String content = sendMQContent(sendTaskVO1, serviceTask1.getTemplateid().toString(), serviceTask1.getPreachform(), serviceTask1.getStopState(), list);
+                    String content = sendMQContent(sendTaskVO1, serviceTask1.getTemplateid().toString(), serviceTask1.getPreachform(), serviceTask1.getStopState(), taskSendTimeVO);
                     redisCache.setCacheObject(content, content, milliseconds / 1000, TimeUnit.SECONDS);
                 }
                 //灏嗕换鍔$姸鎬佷慨鏀规垚鎵ц涓�
@@ -243,8 +244,8 @@
                 }
                 for (TaskSendTimeVO taskSendTimeVO : taskSendTimeVOList) {
                     //鍘籗endTimeslot涓紝鑾峰彇鎵�鏈夌殑鏃堕棿娈�
-                    List<TaskSendTimeVO> list = new ArrayList<>();
-                    list.add(taskSendTimeVO);
+//                    List<TaskSendTimeVO> list = new ArrayList<>();
+//                    list.add(taskSendTimeVO);
 
                     //鑾峰彇寮�濮嬪彂閫佹椂闂�
                     String begantime = taskSendTimeVO.getBegantime();
@@ -261,7 +262,7 @@
 
                     SendTaskVO sendTaskVO1 = DtoConversionUtils.sourceToTarget(sendTaskVO, SendTaskVO.class);
                     sendTaskVO1.setSendType("1");
-                    String content = sendMQContent(sendTaskVO1, serviceTask1.getTemplateid().toString(), serviceTask1.getPreachform(), serviceTask1.getStopState(), list);
+                    String content = sendMQContent(sendTaskVO1, serviceTask1.getTemplateid().toString(), serviceTask1.getPreachform(), serviceTask1.getStopState(), taskSendTimeVO);
                     redisCache.setCacheObject(content, content, milliseconds / 1000, TimeUnit.SECONDS);
                 }
                 //灏嗕换鍔$姸鎬佷慨鏀规垚鎵ц涓�
@@ -284,7 +285,7 @@
      * @param sendTimeslot
      * @return
      */
-    private String sendMQContent(SendTaskVO sendTaskVO, String templateid, String preachform, Long stopState, List<TaskSendTimeVO> sendTimeslot) {
+    private String sendMQContent(SendTaskVO sendTaskVO, String templateid, String preachform, Long stopState, TaskSendTimeVO sendTimeslot) {
         CommonTaskcallMQ commonTaskcallMQ = new CommonTaskcallMQ();
         commonTaskcallMQ.setTaskid(sendTaskVO.getTaskId());
         commonTaskcallMQ.setSendType(sendTaskVO.getSendType());
diff --git a/smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java
index ef56751..cd8a0e8 100644
--- a/smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java
@@ -82,14 +82,14 @@
             //鏂板
             ivrTaskTemplate.setCreateTime(new Date());
             insertIvrTaskTemplate(ivrTaskTemplate);
-            i = ivrTaskTemplate.getID().intValue();
+            i = ivrTaskTemplate.getId().intValue();
         } else if (ivrTaskTemplateVO.getIsoperation() != null && ivrTaskTemplateVO.getIsoperation() == 2) {
             //淇敼
             ivrTaskTemplate.setUpdateTime(new Date());
             updateIvrTaskTemplate(ivrTaskTemplate);
-            i = ivrTaskTemplate.getID().intValue();
+            i = ivrTaskTemplate.getId().intValue();
         }
-        log.info("鏂板闅忚浠诲姟闅忚妯℃澘鐨刬d涓猴細{}", ivrTaskTemplate.getID());
+        log.info("鏂板闅忚浠诲姟闅忚妯℃澘鐨刬d涓猴細{}", ivrTaskTemplate.getId());
 
         //瀵规ā鏉胯瘽鏈拰閫夐」杩涜澶勭悊锛堣瘽鏈〃涓庢寚鏍囪〃杩涜鍚堝苟浜嗭紝锛�
         if (CollectionUtils.isNotEmpty(ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList())) {
@@ -97,14 +97,14 @@
             for (IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO : ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList()) {
                 if (ivrTaskTemplateScriptVO.getIsoperation() != null) {
                     IvrTaskTemplateScript ivrTaskTemplateScript = scriptHandle(ivrTaskTemplate, ivrTaskTemplateScriptVO, ivrTaskTemplateScriptVO.getIsoperation());
-                    dealOption(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList(), ivrTaskTemplateScript, ivrTaskTemplate.getID(), ivrTaskTemplateScriptVO.getIsoperation());
+                    dealOption(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList(), ivrTaskTemplateScript, ivrTaskTemplate.getId(), ivrTaskTemplateScriptVO.getIsoperation());
                 } else {
                     IvrTaskTemplateScript ivrTaskTemplateScript = scriptHandle(ivrTaskTemplate, ivrTaskTemplateScriptVO, ivrTaskTemplateVO.getIsoperation());
-                    dealOption(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList(), ivrTaskTemplateScript, ivrTaskTemplate.getID(), ivrTaskTemplateVO.getIsoperation());
+                    dealOption(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList(), ivrTaskTemplateScript, ivrTaskTemplate.getId(), ivrTaskTemplateVO.getIsoperation());
                 }
             }
         }
-        return ivrTaskTemplate.getID().intValue();
+        return ivrTaskTemplate.getId().intValue();
     }
 
 
@@ -168,7 +168,7 @@
 
         //鏌ヨ璇濇湳
         IvrTaskTemplateScript ivrTaskTemplateScript = new IvrTaskTemplateScript();
-        ivrTaskTemplateScript.setTemplateID(ivrTaskTemplates.get(0).getID());
+        ivrTaskTemplateScript.setTemplateID(ivrTaskTemplates.get(0).getId());
         List<IvrTaskTemplateScript> ivrTaskTemplateScripts = ivrTaskTemplateScriptMapper.selectIvrTaskTemplateScriptList(ivrTaskTemplateScript);
         List<IvrTaskTemplateScriptVO> ivrTaskTemplateScriptVOS = DtoConversionUtils.sourceToTarget(ivrTaskTemplateScripts, IvrTaskTemplateScriptVO.class);
 
@@ -211,13 +211,13 @@
 
         if (isoperation == 1) {
             //鏂板
-            ivrTaskTemplateScript.setTemplateID(ivrTaskTemplate.getID());
+            ivrTaskTemplateScript.setTemplateID(ivrTaskTemplate.getId());
             ivrTaskTemplateScript.setCreateTime(new Date());
             ivrTaskTemplateScriptMapper.insertIvrTaskTemplateScript(ivrTaskTemplateScript);
             ivrTaskTemplateScript.setIsoperation(1);
         } else if (isoperation == 2) {
             //淇敼
-            ivrTaskTemplateScript.setTemplateID(ivrTaskTemplate.getID());
+            ivrTaskTemplateScript.setTemplateID(ivrTaskTemplate.getId());
             ivrTaskTemplateScript.setUpdateTime(new Date());
             ivrTaskTemplateScriptMapper.updateIvrTaskTemplateScript(ivrTaskTemplateScript);
             ivrTaskTemplateScript.setIsoperation(2);
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 3a45920..7761bd3 100644
--- a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -245,6 +245,7 @@
                     serviceSubtask.setSendstate(1L);
                     serviceSubtask.setType(serviceTaskVO.getHospType());
                     serviceSubtask.setHospType(patTaskRelevance.getHospType());
+                    serviceSubtask.setOpenid(patTaskRelevance.getOpenid());
                     serviceSubtaskMapper.insertServiceSubtask(serviceSubtask);
                     integer = serviceSubtask.getId().intValue();
                 }
@@ -270,6 +271,7 @@
                     serviceSubtask.setPhone(patTaskRelevance.getPhone());
                     serviceSubtask.setAddr(patTaskRelevance.getAddr());
                     serviceSubtask.setPatid(patTaskRelevance.getPatid());
+                    serviceSubtask.setOpenid(patTaskRelevance.getOpenid());
                     serviceSubtask.setType(serviceTaskVO.getHospType());
                     serviceSubtask.setCreateTime(DateUtils.getNowDate());
                     serviceSubtask.setHospType(patTaskRelevance.getHospType());
@@ -349,7 +351,7 @@
                     // 闂锛�  鍘昏皟鐢ㄢ�渢ts鍚堟垚鍜屾挱鏀锯�濇帴鍙�
                     String date = simpleDateFormat1.format(new Date());
                     log.info("鍘昏皟鐢╰ts鍚堟垚鍜屾挱鏀炬帴鍙�: {},uuid涓猴細{}", date, phoneCallBackVO.getUuid());
-                    phoneUtils.ttsPlayback(nowQuestion.getQuestionText(), phoneCallBackVO.getUuid());
+                    phoneUtils.ttsPlayback(nowQuestion.getScriptContent(), phoneCallBackVO.getUuid());
                 }
             } else {
                 redisCache.setCacheObject(phoneCallBackVO.getUuid() + "noVoice", noVoice + 1, 120, TimeUnit.MINUTES);
@@ -358,7 +360,7 @@
                 //闈欓粯璇濇湳  + 闂锛�  鍘昏皟鐢ㄢ�渢ts鍚堟垚鍜屾挱鏀锯�濇帴鍙�
                 String date = simpleDateFormat1.format(new Date());
                 log.info("闈欓粯璇濇湳  + 闂,鍘昏皟鐢╰ts鍚堟垚鍜屾挱鏀炬帴鍙�: {},uuid涓猴細{}", date, phoneCallBackVO.getUuid());
-                phoneUtils.ttsPlayback(slienceText + nowQuestion.getQuestionText(), phoneCallBackVO.getUuid());
+                phoneUtils.ttsPlayback(slienceText + nowQuestion.getScriptContent(), phoneCallBackVO.getUuid());
                 return;
             }
 
@@ -379,7 +381,7 @@
                     Pattern pattern2 = Pattern.compile(nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2());
                     matcher2 = pattern2.matcher(phoneCallBackVO.getTextResult());
                 }
-                log.error("PCB--getQuestionText闂涓猴細{},UUID锛歿}", nowQuestion.getQuestionText(), phoneCallBackVO.getUuid());
+                log.error("PCB--getQuestionText闂涓猴細{},UUID锛歿}", nowQuestion.getScriptContent(), phoneCallBackVO.getUuid());
                 if (StringUtils.isNotEmpty(nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.matches() && StringUtils.isNotEmpty(nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches() || StringUtils.isEmpty(nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && StringUtils.isNotEmpty(nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.matches() || StringUtils.isEmpty(nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && StringUtils.isNotEmpty(nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches()) {
                     //璇存槑鍖归厤姝g‘浜�
                     //杩欓噷搴旇鍏堝垽鏂被鍨嬶紝鍘诲啀淇敼锛岃缃甀sUserOperation鏄崟閫夐鐨勬敼娉�
@@ -393,7 +395,7 @@
                     //灏嗘偅鑰呯殑鍥炵鍐欒繘琛ㄩ噷
                     IvrTaskVisitResult serviceTaskVisitResult = DtoConversionUtils.sourceToTarget(serviceSubtask, IvrTaskVisitResult.class);
                     serviceTaskVisitResult.setId(null);
-                    serviceTaskVisitResult.setQuestion(nowQuestion.getQuestionText());
+                    serviceTaskVisitResult.setQuestion(nowQuestion.getScriptContent());
                     serviceTaskVisitResult.setPatientAnswer(phoneCallBackVO.getTextResult());
                     serviceTaskVisitResult.setCreateTime(new Date());
                     serviceTaskVisitResult.setOptionResult(nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getTargetvalue());
@@ -410,7 +412,7 @@
                             questionMessage.setNowQuestion(script);
                             questionMessage.setQuestionList(IvrTaskTemplateScriptVOs);
                             redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES);
-                            phoneUtils.ttsPlayback(script.getQuestionText(), phoneCallBackVO.getUuid());
+                            phoneUtils.ttsPlayback(script.getScriptContent(), phoneCallBackVO.getUuid());
                             return;
                         } else if (nextQuestion > IvrTaskTemplateScriptVOs.size()) {
                             //娌℃湁涓嬩竴棰樹簡锛屽氨缁撴潫浜�
@@ -451,7 +453,7 @@
                         redisCache.setCacheObject(phoneCallBackVO.getUuid() + "mateNum", 0, 120, TimeUnit.MINUTES);
                         String date = simpleDateFormat1.format(new Date());
                         log.info("濡傛灉涓嬩竴棰樹负绌�.鍒欐柊鐨勬暟鎹繑鍥�,骞跺姞涓婃劅璋㈣: {},uuid涓猴細{}", date, phoneCallBackVO.getUuid());
-                        phoneUtils.ttsPlayback(nextQuestion.getQuestionText(), phoneCallBackVO.getUuid());
+                        phoneUtils.ttsPlayback(nextQuestion.getScriptContent(), phoneCallBackVO.getUuid());
                         return;
                     } else {
                         //灏卞彲浠ユ寕鏂數璇濅簡
@@ -505,8 +507,8 @@
                         if (ivrLibaExtemplatescript.getIsEnd() == 1) {
                             //灏嗛棶棰樼疆绌�
                             IvrTaskTemplateScriptVO nowQuestion1 = questionMessage.getNowQuestion();
-                            nowQuestion1.setQuestionText(null);
-                            nowQuestion1.setQuestionVoice(null);
+                            nowQuestion1.setScriptContent(null);
+                            nowQuestion1.setScriptVoice(null);
                             questionMessage.setNowQuestion(nowQuestion1);
                             redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES);
 
@@ -515,13 +517,13 @@
                         //璋冪敤鈥�15銆乼ts鍚堟垚鍜屾挱鏀撅紝 tts_playback鈥濆皢缁撴灉浼犲洖
                         String date = simpleDateFormat1.format(new Date());
                         log.info("璋冪敤鈥�15銆乼ts鍚堟垚鍜屾挱鏀�------: {},uuid涓猴細{}", date, phoneCallBackVO.getUuid());
-                        phoneUtils.ttsPlayback(nowQuestion.getQuestionText() + ivrTaskTemplateScriptVO.getSubmoduleText(), phoneCallBackVO.getUuid());
+                        phoneUtils.ttsPlayback(nowQuestion.getScriptContent() + ivrTaskTemplateScriptVO.getSubmoduleText(), phoneCallBackVO.getUuid());
                     }
                     break;
                 }
                 String date = simpleDateFormat1.format(new Date());
                 log.info("鏈�鍚庣殑淇℃伅鍥炲-: {},uuid涓猴細{}", date, phoneCallBackVO.getUuid());
-                phoneUtils.ttsPlayback(nowQuestion.getQuestionText(), phoneCallBackVO.getUuid());
+                phoneUtils.ttsPlayback(nowQuestion.getScriptContent(), phoneCallBackVO.getUuid());
             }
         }
     }
diff --git a/smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java
index 8329426..24d3709 100644
--- a/smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java
@@ -199,17 +199,17 @@
 
         //灏嗘ā鏉块棶棰樿瘽鏈噷鐨勯�氶厤绗︽浛鎹�
         for (IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO : ivrLibaTemplateScriptVOS) {
-            if (StringUtils.isNotEmpty(ivrLibaTemplateScriptVO.getScriptConten())) {
+            if (StringUtils.isNotEmpty(ivrLibaTemplateScriptVO.getScriptContent())) {
                 for (Map<String, String> map : mapList) {
                     for (String key : map.keySet()) {
 
-                        ivrLibaTemplateScriptVO.setScriptConten(ivrLibaTemplateScriptVO.getScriptConten().replace(key, StringUtils.isNotEmpty(map.get(key)) ? map.get(key) : ""));
+                        ivrLibaTemplateScriptVO.setScriptContent(ivrLibaTemplateScriptVO.getScriptContent().replace(key, StringUtils.isNotEmpty(map.get(key)) ? map.get(key) : ""));
                     }
                 }
                 //鏇挎崲鎮h�呬釜浜轰俊鎭暟鎹�
-                ivrLibaTemplateScriptVO.setScriptConten(ivrLibaTemplateScriptVO.getScriptConten().replace("${name}", StringUtils.isNotEmpty(patArchive.getName()) ? patArchive.getName() : ""));
-                ivrLibaTemplateScriptVO.setScriptConten(ivrLibaTemplateScriptVO.getScriptConten().replace("${dzz}", StringUtils.isNotEmpty(patArchive.getPlaceOfResidence()) ? patArchive.getPlaceOfResidence() : ""));
-                ivrLibaTemplateScriptVO.setScriptConten(ivrLibaTemplateScriptVO.getScriptConten().replace("${dhh}", StringUtils.isNotEmpty(patArchive.getTelcode()) ? patArchive.getTelcode() : ""));
+                ivrLibaTemplateScriptVO.setScriptContent(ivrLibaTemplateScriptVO.getScriptContent().replace("${name}", StringUtils.isNotEmpty(patArchive.getName()) ? patArchive.getName() : ""));
+                ivrLibaTemplateScriptVO.setScriptContent(ivrLibaTemplateScriptVO.getScriptContent().replace("${dzz}", StringUtils.isNotEmpty(patArchive.getPlaceOfResidence()) ? patArchive.getPlaceOfResidence() : ""));
+                ivrLibaTemplateScriptVO.setScriptContent(ivrLibaTemplateScriptVO.getScriptContent().replace("${dhh}", StringUtils.isNotEmpty(patArchive.getTelcode()) ? patArchive.getTelcode() : ""));
 
                 //鑾峰彇闂閫夐」
                 IvrLibaTemplateTargetoption ivrLibaTemplateTargetoption = new IvrLibaTemplateTargetoption();
diff --git a/smartor/src/main/java/com/smartor/service/impl/SvyLibScriptServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/SvyLibScriptServiceImpl.java
index c96e430..e8d3cea 100644
--- a/smartor/src/main/java/com/smartor/service/impl/SvyLibScriptServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/SvyLibScriptServiceImpl.java
@@ -61,7 +61,7 @@
             if (StringUtils.isNotEmpty(svyLibScripts.get(j).getIcd10Name()))
                 svyLibScripts.get(j).setIcd10NameList(JSONArray.parseArray(svyLibScripts.get(j).getIcd10Name(), String.class));
 
-            if (StringUtils.isNotEmpty(svyLibScripts.get(j).getScripttype()) && svyLibScripts.get(j).getScripttype().equals("3") || svyLibScripts.get(j).getId() == null) {
+            if (StringUtils.isNotEmpty(svyLibScripts.get(j).getScriptType()) && svyLibScripts.get(j).getScriptType().equals("3") || svyLibScripts.get(j).getId() == null) {
                 //浣滅瓟棰橈紝涓嶉渶瑕侀�夐」
                 continue;
             } else {
diff --git a/smartor/src/main/java/com/smartor/service/impl/SvyLibTemplateServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/SvyLibTemplateServiceImpl.java
index 089e67e..8dccacc 100644
--- a/smartor/src/main/java/com/smartor/service/impl/SvyLibTemplateServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/SvyLibTemplateServiceImpl.java
@@ -12,6 +12,7 @@
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.util.ArrayList;
 import java.util.Date;
@@ -60,11 +61,8 @@
         List<SvyLibTemplate> svyLibTemplates = svyLibTemplateMapper.selectSvyLibTemplateList(svyLibTemplateReq);
         //娣诲姞棰樼洰
         for (int i = 0; i < svyLibTemplates.size(); i++) {
-//            SvyLibScript svyLibScript = new SvyLibScript();
-//            svyLibScript.setSvyid(svyLibTemplates.get(i).getSvyid());
-//            List<SvyLibScript> svyLibTopics = svyLibScriptMapper.selectSvyLibScriptList(svyLibScript);
             SvyLibTemplateScript svyLibTemplateScript = new SvyLibTemplateScript();
-            svyLibTemplateScript.setId(svyLibTemplates.get(i).getSvyid());
+            svyLibTemplateScript.setSvyid(svyLibTemplates.get(i).getSvyid());
             List<SvyLibTemplateScript> svyLibTemplateScripts = svyLibTemplateScriptMapper.selectSvyLibTemplateScriptList(svyLibTemplateScript);
             //鑾峰彇棰樼洰閫夐」
             a:
@@ -109,40 +107,13 @@
         return libTemplates;
     }
 
-//    /**
-//     * 鏂板闂嵎
-//     *
-//     * @param svyLibTemplate 闂嵎
-//     * @return 缁撴灉
-//     */
-//    @Transactional
-//    @Override
-//    public int insertSvyLibTemplate(SvyLibTemplate svyLibTemplate) {
-//        svyLibTemplate.setCreateTime(DateUtils.getNowDate());
-//        svyLibTemplateMapper.insertSvyLibTemplate(svyLibTemplate);
-//        //鍏宠仈闂嵎鐤剧梾
-//        for (String icdId : svyLibTemplate.getIcdID()) {
-//            Icd10Association icd10Association = new Icd10Association();
-//            icd10Association.setIcd10code(icdId);
-//            icd10Association.setSvyid(svyLibTemplate.getSvyid());
-//            icd10AssociationMapper.insertIcd10Association(icd10Association);
-//        }
-//        //鏂板闂棰樼洰
-//        for (int i = 0; i < svyLibTemplate.getSvyLibScripts().size(); i++) {
-//            SvyLibScript svyLibScript = svyLibTemplate.getSvyLibScripts().get(i);
-//            svyLibScript.setSvyid(svyLibTemplate.getSvyid());
-//            //棰樼洰鐨勯�夐」鐩紝鐩存帴鐢╯vy_topicoption琛紝鐢╯vyTopicidf鍘诲叧鑱�
-//            svyLibScriptMapper.insertSvyLibScript(svyLibScript);
-//        }
-//        return 1;
-//    }
-
     /**
      * 鏂板鎴栦慨鏀归棶鍗锋ā鏉夸俊鎭�
      *
      * @param svyLibTemplate
      * @return
      */
+    @Transactional(rollbackFor = Exception.class)
     @Override
     public Integer saveOrUpdateTemplate(SvyLibTemplate svyLibTemplate) {
         Integer i = null;
@@ -242,14 +213,14 @@
     private void scriptHandle(Long svyid, SvyLibTemplateScript svyLibScript, Integer isoperation) {
         if (isoperation == 1) {
             //鏂板
-            svyLibScript.setId(svyid);
+            svyLibScript.setSvyid(svyid);
             svyLibScript.setId(null);
             svyLibScript.setCreateTime(new Date());
             svyLibTemplateScriptMapper.insertSvyLibTemplateScript(svyLibScript);
 
         } else if (isoperation == 2) {
             //淇敼
-            svyLibScript.setId(svyid);
+            svyLibScript.setSvyid(svyid);
             svyLibScript.setUpdateTime(new Date());
             svyLibTemplateScriptMapper.updateSvyLibTemplateScript(svyLibScript);
         } else if (isoperation == 3) {
diff --git a/smartor/src/main/java/com/smartor/service/impl/WeChatServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/WeChatServiceImpl.java
index e1ba366..d2445b8 100644
--- a/smartor/src/main/java/com/smartor/service/impl/WeChatServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/WeChatServiceImpl.java
@@ -32,13 +32,13 @@
         wxMpConfigStorage.setSecret(appSecret);
         try {
             List<String> openIdList = wxMpService.getUserService().userList(null).getOpenids();
-            for (String openId : openIdList) {
-                WxMpTemplateMessage templateMessage = WxMpTemplateMessage.builder().toUser(openId).templateId(weChatSendVo.getTemplateId()).url(weChatSendVo.getUrl()).build();
-                for (String key : weChatSendVo.getContent().keySet()) {
-                    templateMessage.addData(new WxMpTemplateData(key, weChatSendVo.getContent().get(key).toString()));
-                }
-                wxMpService.getTemplateMsgService().sendTemplateMsg(templateMessage);
+//            for (String openId : openIdList) {
+            WxMpTemplateMessage templateMessage = WxMpTemplateMessage.builder().toUser(weChatSendVo.getOpenid()).templateId(weChatSendVo.getTemplateId()).url(weChatSendVo.getUrl()).build();
+            for (String key : weChatSendVo.getContent().keySet()) {
+                templateMessage.addData(new WxMpTemplateData(key, weChatSendVo.getContent().get(key).toString()));
             }
+            wxMpService.getTemplateMsgService().sendTemplateMsg(templateMessage);
+//            }
         } catch (WxErrorException e) {
             e.printStackTrace();
         }
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibaTargetMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibaTargetMapper.xml
index 5cccc91..b6695b4 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibaTargetMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibaTargetMapper.xml
@@ -32,11 +32,13 @@
         <result property="suitWay" column="suitWay"/>
         <result property="parameter" column="parameter"/>
         <result property="reply" column="reply"/>
+        <result property="scriptType" column="script_type"/>
     </resultMap>
 
     <resultMap type="com.smartor.domain.IvrLibaTargetVO" id="IvrLibaTargetVOResult">
         <result property="id" column="id"/>
         <result property="groupid" column="groupid"/>
+        <result property="scriptType" column="script_type"/>
         <result property="targettype" column="targettype"/>
         <result property="targetname" column="targetname"/>
         <result property="targetdesc" column="targetdesc"/>
@@ -90,6 +92,7 @@
     <sql id="selectIvrLibaTargetVo">
         select id,
                groupid,
+               script_type,
                targettype,
                targetname,
                reply,
@@ -107,6 +110,7 @@
             <if test="groupid != null  and groupid != ''">and groupid = #{groupid}</if>
             <if test="targettype != null  and targettype != ''">and targettype = #{targettype}</if>
             <if test="targetname != null  and targetname != ''">and targetname like concat('%', #{targetname}, '%')</if>
+            <if test="scriptType != null  and scriptType != ''">and script_type like concat('%', #{scriptType}, '%')</if>
             <if test="targetdesc != null  and targetdesc != ''">and targetdesc = #{targetdesc}</if>
             <if test="language != null  and language != ''">and language = #{language}</if>
             <if test="version != null ">and version = #{version}</if>
@@ -133,6 +137,7 @@
         a.groupid,
         a.targettype,
         a.targetname,
+        a.script_type,
         a.targetdesc,
         a.language,
         a.version,
@@ -220,6 +225,7 @@
             <if test="suitWay != null and suitWay != ''">suitWay,</if>
             <if test="parameter != null and parameter != ''">parameter,</if>
             <if test="reply != null and reply != ''">reply,</if>
+            <if test="scriptType != null and scriptType != ''">script_type,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="groupid != null">#{groupid},</if>
@@ -250,6 +256,7 @@
             <if test="suitWay != null and suitWay != ''">#{suitWay},</if>
             <if test="parameter != null and parameter != ''">#{parameter},</if>
             <if test="reply != null and reply != ''">#{reply},</if>
+            <if test="scriptType != null and scriptType != ''">#{scriptType},</if>
         </trim>
     </insert>
 
@@ -282,6 +289,7 @@
             <if test="isAvailable != null and isAvailable != ''">isAvailable = #{isAvailable},</if>
             <if test="parameter != null and parameter != ''">parameter = #{parameter},</if>
             <if test="reply != null and reply != ''">reply = #{reply},</if>
+            <if test="scriptType != null and scriptType != ''">script_type = #{scriptType},</if>
         </trim>
         where id = #{id}
     </update>
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml
index 112a5c6..b0c8638 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml
@@ -49,7 +49,7 @@
                templateID,
                scriptID,
                script_point,
-               scrpt_content,
+               script_content,
                script_desc,
                script_voice,
                noMatchText,
diff --git a/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateMapper.xml
index acd0b89..0de43fd 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateMapper.xml
@@ -5,7 +5,7 @@
 <mapper namespace="com.smartor.mapper.IvrTaskTemplateMapper">
 
     <resultMap type="com.smartor.domain.IvrTaskTemplate" id="IvrTaskTemplateResult">
-        <result property="ID" column="ID"/>
+        <result property="id" column="id"/>
         <result property="taskid" column="taskid"/>
         <result property="taskname" column="taskname"/>
         <result property="targetid" column="targetid"/>
@@ -63,7 +63,7 @@
     </resultMap>
 
     <sql id="selectIvrTaskTemplateVo">
-        select ID,
+        select id,
                taskid,
                recallcount,
                instruction,
@@ -86,6 +86,7 @@
         <include refid="selectIvrTaskTemplateVo"/>
         <where>
             <if test="taskid != null ">and taskid = #{taskid}</if>
+            <if test="id != null ">and id = #{id}</if>
             <if test="taskname != null  and taskname != ''">and taskname like concat('%', #{taskname}, '%')</if>
             <if test="targetid != null ">and targetid = #{targetid}</if>
             <if test="targetname != null  and targetname != ''">and targetname like concat('%', #{targetname}, '%')</if>
@@ -143,11 +144,11 @@
 
     <select id="selectIvrTaskTemplateByID" parameterType="Long" resultMap="IvrTaskTemplateResult">
         <include refid="selectIvrTaskTemplateVo"/>
-        where ID = #{ID}
+        where id = #{id}
     </select>
 
     <insert id="insertIvrTaskTemplate" parameterType="com.smartor.domain.IvrTaskTemplate" useGeneratedKeys="true"
-            keyProperty="ID">
+            keyProperty="id">
         insert into ivr_task_template
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="taskid != null">taskid,</if>
@@ -321,19 +322,19 @@
             <if test="libtemplatename != null ">libtemplatename = #{libtemplatename},</if>
             <if test="instruction != null ">instruction = #{instruction},</if>
         </trim>
-        where ID = #{ID}
+        where id = #{id}
     </update>
 
     <delete id="deleteIvrTaskTemplateByID" parameterType="Long">
         delete
         from ivr_task_template
-        where ID = #{ID}
+        where id = #{id}
     </delete>
 
     <delete id="deleteIvrTaskTemplateByIDs" parameterType="String">
-        delete from ivr_task_template where ID in
-        <foreach item="ID" collection="array" open="(" separator="," close=")">
-            #{ID}
+        delete from ivr_task_template where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
         </foreach>
     </delete>
 </mapper>
diff --git a/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateScriptMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateScriptMapper.xml
index d29bd98..039463b 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateScriptMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateScriptMapper.xml
@@ -7,12 +7,8 @@
     <resultMap type="com.smartor.domain.IvrTaskTemplateScript" id="IvrTaskTemplateScriptResult">
         <result property="ID"    column="ID"    />
         <result property="taskid"    column="taskid"    />
-        <result property="templateQuestionNum"    column="templateQuestionNum"    />
         <result property="templateID"    column="templateID"    />
-        <result property="scriptID"    column="scriptID"    />
         <result property="questionPoint"    column="questionPoint"    />
-        <result property="questionText"    column="questionText"    />
-        <result property="questionVoice"    column="questionVoice"    />
         <result property="noMatchText"    column="noMatchText"    />
         <result property="noMatchVoice"    column="noMatchVoice"    />
         <result property="slienceText"    column="slienceText"    />
@@ -39,27 +35,21 @@
         <result property="targettype"    column="targettype"    />
         <result property="targetid"    column="targetid"    />
         <result property="targetvalue"    column="targetvalue"    />
-        <result property="questiontitle"    column="questiontitle"    />
-        <result property="nextQuestion"    column="next_question"    />
         <result property="otherdata"    column="otherdata"    />
         <result property="isMust"    column="is_must"    />
         <result property="questionResult"    column="question_result"    />
     </resultMap>
 
     <sql id="selectIvrTaskTemplateScriptVo">
-        select ID, taskid, templateQuestionNum, templateID, scriptID, questionPoint, questionText, questionVoice, noMatchText, noMatchVoice, slienceText, slienceVoice, submoduleText, submoduleVoice, noClearlyText, noClearlyVoice, categoryName, targetOptions, language, playWavOnly, value_type, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time, orgid, pid, guid, targettype, targetid, targetvalue, questiontitle, next_question, otherdata, is_must, question_result from ivr_task_template_script
+        select ID, taskid,  templateID, questionPoint,  noMatchText, noMatchVoice, slienceText, slienceVoice, submoduleText, submoduleVoice, noClearlyText, noClearlyVoice, categoryName, targetOptions, language, playWavOnly, value_type, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time, orgid, pid, guid, targettype, targetid, targetvalue,  otherdata, is_must, question_result from ivr_task_template_script
     </sql>
 
     <select id="selectIvrTaskTemplateScriptList" parameterType="com.smartor.domain.IvrTaskTemplateScript" resultMap="IvrTaskTemplateScriptResult">
         <include refid="selectIvrTaskTemplateScriptVo"/>
         <where>
             <if test="taskid != null "> and taskid = #{taskid}</if>
-            <if test="templateQuestionNum != null "> and templateQuestionNum = #{templateQuestionNum}</if>
             <if test="templateID != null "> and templateID = #{templateID}</if>
-            <if test="scriptID != null "> and scriptID = #{scriptID}</if>
             <if test="questionPoint != null  and questionPoint != ''"> and questionPoint = #{questionPoint}</if>
-            <if test="questionText != null  and questionText != ''"> and questionText = #{questionText}</if>
-            <if test="questionVoice != null  and questionVoice != ''"> and questionVoice = #{questionVoice}</if>
             <if test="noMatchText != null  and noMatchText != ''"> and noMatchText = #{noMatchText}</if>
             <if test="noMatchVoice != null  and noMatchVoice != ''"> and noMatchVoice = #{noMatchVoice}</if>
             <if test="slienceText != null  and slienceText != ''"> and slienceText = #{slienceText}</if>
@@ -81,8 +71,6 @@
             <if test="targettype != null  and targettype != ''"> and targettype = #{targettype}</if>
             <if test="targetid != null "> and targetid = #{targetid}</if>
             <if test="targetvalue != null  and targetvalue != ''"> and targetvalue = #{targetvalue}</if>
-            <if test="questiontitle != null  and questiontitle != ''"> and questiontitle = #{questiontitle}</if>
-            <if test="nextQuestion != null "> and next_question = #{nextQuestion}</if>
             <if test="otherdata != null  and otherdata != ''"> and otherdata = #{otherdata}</if>
             <if test="isMust != null  and isMust != ''"> and is_must = #{isMust}</if>
             <if test="questionResult != null  and questionResult != ''"> and question_result = #{questionResult}</if>
@@ -98,12 +86,8 @@
         insert into ivr_task_template_script
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="taskid != null">taskid,</if>
-            <if test="templateQuestionNum != null">templateQuestionNum,</if>
             <if test="templateID != null">templateID,</if>
-            <if test="scriptID != null">scriptID,</if>
             <if test="questionPoint != null">questionPoint,</if>
-            <if test="questionText != null">questionText,</if>
-            <if test="questionVoice != null">questionVoice,</if>
             <if test="noMatchText != null">noMatchText,</if>
             <if test="noMatchVoice != null">noMatchVoice,</if>
             <if test="slienceText != null">slienceText,</if>
@@ -130,20 +114,14 @@
             <if test="targettype != null">targettype,</if>
             <if test="targetid != null">targetid,</if>
             <if test="targetvalue != null">targetvalue,</if>
-            <if test="questiontitle != null">questiontitle,</if>
-            <if test="nextQuestion != null">next_question,</if>
             <if test="otherdata != null">otherdata,</if>
             <if test="isMust != null">is_must,</if>
             <if test="questionResult != null">question_result,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="taskid != null">#{taskid},</if>
-            <if test="templateQuestionNum != null">#{templateQuestionNum},</if>
             <if test="templateID != null">#{templateID},</if>
-            <if test="scriptID != null">#{scriptID},</if>
             <if test="questionPoint != null">#{questionPoint},</if>
-            <if test="questionText != null">#{questionText},</if>
-            <if test="questionVoice != null">#{questionVoice},</if>
             <if test="noMatchText != null">#{noMatchText},</if>
             <if test="noMatchVoice != null">#{noMatchVoice},</if>
             <if test="slienceText != null">#{slienceText},</if>
@@ -170,8 +148,6 @@
             <if test="targettype != null">#{targettype},</if>
             <if test="targetid != null">#{targetid},</if>
             <if test="targetvalue != null">#{targetvalue},</if>
-            <if test="questiontitle != null">#{questiontitle},</if>
-            <if test="nextQuestion != null">#{nextQuestion},</if>
             <if test="otherdata != null">#{otherdata},</if>
             <if test="isMust != null">#{isMust},</if>
             <if test="questionResult != null">#{questionResult},</if>
@@ -182,12 +158,8 @@
         update ivr_task_template_script
         <trim prefix="SET" suffixOverrides=",">
             <if test="taskid != null">taskid = #{taskid},</if>
-            <if test="templateQuestionNum != null">templateQuestionNum = #{templateQuestionNum},</if>
             <if test="templateID != null">templateID = #{templateID},</if>
-            <if test="scriptID != null">scriptID = #{scriptID},</if>
             <if test="questionPoint != null">questionPoint = #{questionPoint},</if>
-            <if test="questionText != null">questionText = #{questionText},</if>
-            <if test="questionVoice != null">questionVoice = #{questionVoice},</if>
             <if test="noMatchText != null">noMatchText = #{noMatchText},</if>
             <if test="noMatchVoice != null">noMatchVoice = #{noMatchVoice},</if>
             <if test="slienceText != null">slienceText = #{slienceText},</if>
@@ -214,8 +186,6 @@
             <if test="targettype != null">targettype = #{targettype},</if>
             <if test="targetid != null">targetid = #{targetid},</if>
             <if test="targetvalue != null">targetvalue = #{targetvalue},</if>
-            <if test="questiontitle != null">questiontitle = #{questiontitle},</if>
-            <if test="nextQuestion != null">next_question = #{nextQuestion},</if>
             <if test="otherdata != null">otherdata = #{otherdata},</if>
             <if test="isMust != null">is_must = #{isMust},</if>
             <if test="questionResult != null">question_result = #{questionResult},</if>
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
index cf647f6..2f42f00 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -54,11 +54,13 @@
         <result property="patid" column="patid"/>
         <result property="libtemplatename" column="libtemplatename"/>
         <result property="libtemplateid" column="libtemplateid"/>
+        <result property="openid" column="openid"/>
     </resultMap>
 
     <sql id="selectServiceSubtaskVo">
         select id,
                hosp_type,
+               openid,
                libtemplateid,
                libtemplatename,
                hospno,
@@ -152,6 +154,7 @@
             <if test="hospType != null  and hospType != ''">and hosp_type = #{hospType}</if>
             <if test="libtemplateid != null ">and libtemplateid = #{libtemplateid},</if>
             <if test="libtemplatename != null ">and libtemplatename = #{libtemplatename},</if>
+            <if test="openid != null ">and openid = #{openid},</if>
         </where>
         order by update_time desc,id desc
     </select>
@@ -213,6 +216,7 @@
             <if test="libtemplateid != null ">libtemplateid,</if>
             <if test="libtemplatename != null ">libtemplatename,</if>
             <if test="patid != null ">patid,</if>
+            <if test="openid != null ">openid,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="sendname != null">#{sendname},</if>
@@ -263,6 +267,7 @@
             <if test="libtemplateid != null ">#{libtemplateid},</if>
             <if test="libtemplatename != null ">#{libtemplatename},</if>
             <if test="patid != null ">#{patid},</if>
+            <if test="openid != null ">#{openid},</if>
         </trim>
     </insert>
 
@@ -317,6 +322,7 @@
             <if test="libtemplateid != null ">libtemplateid = #{libtemplateid},</if>
             <if test="libtemplatename != null ">libtemplatename = #{libtemplatename},</if>
             <if test="patid != null ">patid = #{patid},</if>
+            <if test="openid != null ">openid = #{openid},</if>
         </trim>
         where id = #{id}
     </update>
@@ -372,6 +378,7 @@
             <if test="libtemplateid != null ">libtemplateid = #{libtemplateid},</if>
             <if test="libtemplatename != null ">libtemplatename = #{libtemplatename},</if>
             <if test="patid != null ">patid = #{patid},</if>
+            <if test="openid != null ">openid = #{openid},</if>
         </trim>
         where patid = #{patid} and taskid = #{taskid}
     </update>
@@ -399,6 +406,7 @@
                phone,
                sex,
                age,
+               openid,
                sfzh,
                addr,
                senderdetail,
diff --git a/smartor/src/main/resources/mapper/smartor/SvyLibScriptMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyLibScriptMapper.xml
index e92b3f1..6ffa314 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyLibScriptMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyLibScriptMapper.xml
@@ -6,9 +6,7 @@
 
     <resultMap type="com.smartor.domain.SvyLibScript" id="SvyLibScriptResult">
         <result property="id" column="id"/>
-        <result property="oldid" column="oldid"/>
-        <result property="svyid" column="svyid"/>
-        <result property="scripttype" column="script_type"/>
+        <result property="scriptType" column="script_type"/>
         <result property="scriptcode" column="script_code"/>
         <result property="scriptDesc" column="script_desc"/>
         <result property="scriptPicture" column="script_picture"/>
@@ -40,12 +38,10 @@
 
     <sql id="selectSvyLibScriptVo">
         select id,
-               oldid,
                scoretype,
                score,
                value_type,
                reply,
-               svyid,
                script_type,
                script_code,
                script_desc,
@@ -78,16 +74,13 @@
         <where>
             del_flag=0
             <if test="id != null ">and id = #{id}</if>
-            <if test="oldid != null ">and oldid = #{oldid}</if>
-            <if test="scripttype != null and scripttype != ''">and script_type = #{scripttype}</if>
+            <if test="scriptType != null and scriptType != ''">and script_type = #{scriptType}</if>
             <if test="categoryid != null ">and categoryid = #{categoryid}</if>
-            <if test="script != null  and script != ''">and script like concat('%', #{script}, '%')</if>
+            <if test="scriptContent != null  and scriptContent != ''">and script_content like concat('%', #{scriptContent}, '%')</if>
             <if test="icd10Name != null  and icd10Name != ''">and icd10_name like concat('%', #{icd10Name}, '%')</if>
 
             <if test="ishide != null ">and ishide = #{ishide}</if>
             <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
-            <if test="svyid != null  and svyid != ''">and svyid = #{svyid}</if>
-            <if test="scriptContent != null  and scriptContent != ''">and script_content = #{scriptContent}</if>
             <if test="suitway != null  and suitway != ''">and suitway = #{suitway}</if>
             <if test="isavailable != null  and isavailable != ''">and isavailable = #{isavailable}</if>
             <if test="language != null  and language != ''">and language = #{language}</if>
@@ -107,9 +100,7 @@
             keyProperty="id">
         insert into svy_lib_script
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="oldid != null">oldid,</if>
-            <if test="svyid != null">svyid,</if>
-            <if test="scripttype != null">script_type,</if>
+            <if test="scriptType != null">script_type,</if>
             <if test="scriptcode != null">script_code,</if>
             <if test="scriptDesc != null">script_desc,</if>
             <if test="sort != null">sort,</if>
@@ -139,9 +130,7 @@
             <if test="scriptTopic != null  and scriptTopic != ''">script_topic,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="oldid != null">#{oldid},</if>
-            <if test="svyid != null">#{svyid},</if>
-            <if test="scripttype != null">#{scripttype},</if>
+            <if test="scriptType != null">#{scriptType},</if>
             <if test="scriptcode != null">#{scriptcode},</if>
             <if test="scriptDesc != null">#{scriptDesc},</if>
             <if test="sort != null">#{sort},</if>
@@ -175,9 +164,7 @@
     <update id="updateSvyLibScript" parameterType="com.smartor.domain.SvyLibScript">
         update svy_lib_script
         <trim prefix="SET" suffixOverrides=",">
-            <if test="oldid != null">oldid = #{oldid},</if>
-            <if test="svyid != null">svyid = #{svyid},</if>
-            <if test="scripttype != null">script_type = #{scripttype},</if>
+            <if test="scriptType != null">script_type = #{scriptType},</if>
             <if test="scriptcode != null">script_code = #{scriptcode},</if>
             <if test="scriptDesc != null">script_desc = #{scriptDesc},</if>
             <if test="sort != null">sort = #{sort},</if>
diff --git a/smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml
index 870473a..0cf2399 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml
@@ -10,6 +10,7 @@
         <result property="nextScriptno" column="next_scriptno"/>
         <result property="scriptno" column="scriptno"/>
         <result property="scriptDesc" column="script_desc"/>
+        <result property="svyid" column="svyid"/>
         <result property="tag" column="tag"/>
         <result property="sort" column="sort"/>
         <result property="ismandatory" column="ismandatory"/>
@@ -43,6 +44,7 @@
         select id,
                script_type,
                scriptid,
+               svyid,
                scriptno,
                next_scriptno,
                script_desc,
@@ -100,6 +102,7 @@
             <if test="scoretype != null  and scoretype != ''">and scoretype = #{scoretype}</if>
             <if test="score != null  and score != ''">and score = #{score}</if>
             <if test="scriptTopic != null  and scriptTopic != ''">and script_topic = #{scriptTopic}</if>
+            <if test="svyid != null  ">and svyid = #{svyid}</if>
         </where>
     </select>
 
@@ -143,6 +146,7 @@
             <if test="score != null">score,</if>
             <if test="scriptPicture != null">script_picture,</if>
             <if test="scriptTopic != null">script_topic,</if>
+            <if test="svyid != null">svyid,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="nextScriptno != null">#{nextScriptno},</if>
@@ -176,6 +180,7 @@
             <if test="score != null">#{score},</if>
             <if test="scriptPicture != null">#{scriptPicture},</if>
             <if test="scriptTopic != null">#{scriptTopic},</if>
+            <if test="svyid != null">#{svyid},</if>
         </trim>
     </insert>
 
@@ -213,6 +218,7 @@
             <if test="score != null">score = #{score},</if>
             <if test="scriptPicture != null">script_picture = #{scriptPicture},</if>
             <if test="scriptTopic != null">script_topic = #{scriptTopic},</if>
+            <if test="svyid != null">svyid = #{svyid},</if>
         </trim>
         where id = #{id}
     </update>

--
Gitblit v1.9.3