From 3153009257c97b0f0099f787e951dd15472d077e Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期一, 24 六月 2024 14:12:42 +0800
Subject: [PATCH] 代码提交
---
smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScriptVO.java | 7
smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScript.java | 14 +
smartor/src/main/java/com/smartor/service/impl/SvyLibTemplateServiceImpl.java | 19 +
smartor/src/main/resources/mapper/smartor/SvyTaskMapper.xml | 12
smartor/src/main/java/com/smartor/domain/SvyLibTemplateScript.java | 7
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/CommonTaskController.java | 54 +++++
smartor/src/main/java/com/smartor/domain/CommonTaskcallMQ.java | 16
/dev/null | 38 ---
smartor/src/main/java/com/smartor/service/IIvrTaskService.java | 7
smartor/src/main/java/com/smartor/service/impl/IvrTaskServiceImpl.java | 94 ---------
smartor/src/main/resources/mapper/smartor/SvyLibTemplateTargetoptionMapper.xml | 1
smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml | 7
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskController.java | 9
smartor/src/main/java/com/smartor/service/CommonTaskService.java | 23 ++
ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java | 6
smartor/src/main/resources/mapper/smartor/SvyTaskTemplateScriptMapper.xml | 11 +
smartor/src/main/java/com/smartor/domain/SendTaskVO.java | 7
smartor/src/main/java/com/smartor/service/impl/CommonTaskServiceImpl.java | 229 ++++++++++++++++++++++
smartor/src/main/java/com/smartor/domain/SvyTask.java | 2
19 files changed, 389 insertions(+), 174 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 6429cb2..2907091 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
@@ -102,14 +102,14 @@
log.info("涓嶆槸浠诲姟淇℃伅");
return;
}
- IvrTaskcallMQ ivrTaskcallMQ = null;
+ CommonTaskcallMQ ivrTaskcallMQ = null;
try {
ObjectMapper mapper = new ObjectMapper();
try {
if (!content.startsWith("{")) {
- ivrTaskcallMQ = mapper.readValue("{" + content + "}", IvrTaskcallMQ.class);
+ ivrTaskcallMQ = mapper.readValue("{" + content + "}", CommonTaskcallMQ.class);
} else {
- ivrTaskcallMQ = mapper.readValue(content, IvrTaskcallMQ.class);
+ ivrTaskcallMQ = mapper.readValue(content, CommonTaskcallMQ.class);
}
} catch (JsonProcessingException e) {
e.printStackTrace();
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/CommonTaskController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/CommonTaskController.java
new file mode 100644
index 0000000..aa0a338
--- /dev/null
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/CommonTaskController.java
@@ -0,0 +1,54 @@
+package com.ruoyi.web.controller.smartor;
+
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.smartor.domain.SendTaskVO;
+import com.smartor.domain.ServiceThirdData;
+import com.smartor.service.CommonTaskService;
+import com.smartor.service.IServiceThirdDataService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 閫氱敤浠诲姟Controller
+ *
+ * @author ruoyi
+ * @date 2023-06-26
+ */
+@Api(description = "CommonTaskController")
+@RestController
+@RequestMapping("/commonTask")
+public class CommonTaskController extends BaseController {
+ @Autowired
+ private IServiceThirdDataService iServiceThirdDataService;
+
+ @Autowired
+ private CommonTaskService commonTaskService;
+
+ /**
+ * 鏌ヨ棰樼洰鍒楄〃锛堜箟涔岀殑his鏁版嵁鑾峰彇鎯呭喌锛�
+ */
+ @PostMapping("/list")
+ public TableDataInfo list(@RequestBody ServiceThirdData serviceThirdData) {
+ List<ServiceThirdData> list = iServiceThirdDataService.queryList(serviceThirdData);
+ return getDataTable(list);
+ }
+
+ /**
+ * 浠诲姟鐨勫彂閫佹墽琛屻�佹殏鍋溿�佺粓姝�
+ */
+ @ApiOperation("浠诲姟鐨勫彂閫佹墽琛屻�佹殏鍋溿�佺粓姝�")
+ @PostMapping("/taskSend")
+ public AjaxResult taskSend(@RequestBody SendTaskVO sendTaskVO) {
+ return toAjax(commonTaskService.taskSend(sendTaskVO));
+ }
+
+}
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskController.java
index 550f14d..4ec3a5e 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskController.java
@@ -173,13 +173,4 @@
return getDataTable(ivrTaskService.getScriptInfoByCondition(tid, pid));
}
- /**
- * 浠诲姟鐨勫彂閫佹墽琛屻�佹殏鍋溿�佺粓姝�
- */
- @ApiOperation("浠诲姟鐨勫彂閫佹墽琛屻�佹殏鍋溿�佺粓姝�")
- @PostMapping("/taskSend")
- public AjaxResult taskSend(@RequestBody SendTaskVO sendTaskVO) {
- return toAjax(ivrTaskService.taskSend(sendTaskVO));
- }
-
}
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/TestLsController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/TestLsController.java
deleted file mode 100644
index 455b3f7..0000000
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/TestLsController.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package com.ruoyi.web.controller.smartor;
-
-import com.ruoyi.common.core.controller.BaseController;
-import com.ruoyi.common.core.page.TableDataInfo;
-import com.smartor.domain.ServiceThirdData;
-import com.smartor.service.IServiceThirdDataService;
-import io.swagger.annotations.Api;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
-
-/**
- * 棰樼洰Controller
- *
- * @author ruoyi
- * @date 2023-06-26
- */
-@Api(description = "testController")
-@RestController
-@RequestMapping("/tc")
-public class TestLsController extends BaseController {
- @Autowired
- private IServiceThirdDataService iServiceThirdDataService;
-
- /**
- * 鏌ヨ棰樼洰鍒楄〃
- */
- @PostMapping("/list")
- public TableDataInfo list(@RequestBody ServiceThirdData serviceThirdData) {
- List<ServiceThirdData> list = iServiceThirdDataService.queryList(serviceThirdData);
- return getDataTable(list);
- }
-
-}
diff --git a/smartor/src/main/java/com/smartor/domain/IvrTaskcallMQ.java b/smartor/src/main/java/com/smartor/domain/CommonTaskcallMQ.java
similarity index 80%
rename from smartor/src/main/java/com/smartor/domain/IvrTaskcallMQ.java
rename to smartor/src/main/java/com/smartor/domain/CommonTaskcallMQ.java
index 30e0e8a..85ff2b7 100644
--- a/smartor/src/main/java/com/smartor/domain/IvrTaskcallMQ.java
+++ b/smartor/src/main/java/com/smartor/domain/CommonTaskcallMQ.java
@@ -1,17 +1,11 @@
package com.smartor.domain;
-import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
-import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
-import java.util.Date;
import java.util.List;
-import java.util.Map;
/**
* MQ浠诲姟
@@ -19,9 +13,9 @@
* @author ruoyi
* @date 2024-02-02
*/
-@ApiModel(value = "IvrTaskcallMQ", description = "MQ浠诲姟")
+@ApiModel(value = "CommonTaskcallMQ", description = "MQ浠诲姟")
@Data
-public class IvrTaskcallMQ {
+public class CommonTaskcallMQ {
private static final long serialVersionUID = 1L;
/**
@@ -58,6 +52,12 @@
@ApiModelProperty(value = "鏆傚仠鐘舵�� 锛� 鐘舵�佸鏋滃彂鐢熶慨鏀癸紝鍊煎氨鍔�1")
private Long stopState;
+ /**
+ * 鏆傚仠鐘舵�� 锛� 鐘舵�佸鏋滃彂鐢熶慨鏀癸紝鍊煎氨鍔�1
+ */
+ @ApiModelProperty(value = "鏆傚仠鐘舵�� 锛� 鐘舵�佸鏋滃彂鐢熶慨鏀癸紝鍊煎氨鍔�1")
+ private Integer taskType;
+
/**
* 鍙戦�佹椂闂存
diff --git a/smartor/src/main/java/com/smartor/domain/SendTaskVO.java b/smartor/src/main/java/com/smartor/domain/SendTaskVO.java
index 4e6000a..5a85730 100644
--- a/smartor/src/main/java/com/smartor/domain/SendTaskVO.java
+++ b/smartor/src/main/java/com/smartor/domain/SendTaskVO.java
@@ -26,5 +26,12 @@
@ApiModelProperty(value = "鍙戦�佺姸鎬侊細 1鍒涘缓 2鎵ц涓� 3 鏆傚仠 4缁堟 5瀹屾垚 ")
private Integer sendState;
+ /**
+ * 浠诲姟绫诲瀷锛� 1 闅忚 2 闂嵎 3 瀹f暀
+ */
+ @Excel(name = " 浠诲姟绫诲瀷锛� 1 闅忚 2 闂嵎 3 瀹f暀 ")
+ @ApiModelProperty(value = "浠诲姟绫诲瀷锛� 1 闅忚 2 闂嵎 3 瀹f暀 ")
+ private Integer taskType;
+
}
diff --git a/smartor/src/main/java/com/smartor/domain/SvyLibTemplateScript.java b/smartor/src/main/java/com/smartor/domain/SvyLibTemplateScript.java
index 3d20348..7ccc877 100644
--- a/smartor/src/main/java/com/smartor/domain/SvyLibTemplateScript.java
+++ b/smartor/src/main/java/com/smartor/domain/SvyLibTemplateScript.java
@@ -230,4 +230,11 @@
@ApiModelProperty("棰樼洰鍒嗗�硷細鏁板瓧1,2绛夛紱瀛楁瘝A銆丅锛孋锛孌绛夛紱")
private String score;
+ /**
+ * 棰樼洰涓婚
+ */
+ @Excel(name = "棰樼洰涓婚")
+ @ApiModelProperty("棰樼洰涓婚")
+ private String topic;
+
}
diff --git a/smartor/src/main/java/com/smartor/domain/SvyTask.java b/smartor/src/main/java/com/smartor/domain/SvyTask.java
index 8d47243..e2c8858 100644
--- a/smartor/src/main/java/com/smartor/domain/SvyTask.java
+++ b/smartor/src/main/java/com/smartor/domain/SvyTask.java
@@ -236,7 +236,7 @@
*/
@Excel(name = "鏄惁鍙戦�� 锛� 0 鏆傚仠鍙戦�� 1 瀹氭椂鍙戦�� 2 绔嬪嵆鍙戦�� ")
@ApiModelProperty(value = "鏄惁鍙戦�� 锛� 0 鏆傚仠鍙戦�� 1 瀹氭椂鍙戦�� 2 绔嬪嵆鍙戦��")
- private Long isSend;
+ private Long sendType;
/**
* 鍙戦�佺姸鎬侊細 0 澶辫触 1鎴愬姛
diff --git a/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScript.java b/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScript.java
index cd24d8b..2b1d14b 100644
--- a/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScript.java
+++ b/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScript.java
@@ -152,6 +152,12 @@
private Long playWavOnly;
/**
+ * 鎺掑簭
+ */
+ @ApiModelProperty(value = "鎺掑簭")
+ private Long sort;
+
+ /**
* 鍒犻櫎鏍囪
*/
private String delFlag;
@@ -241,4 +247,12 @@
@ApiModelProperty(value = "闂鍥剧墖璺緞")
private String picturePath;
+
+ /**
+ * 棰樼洰涓婚
+ */
+ @Excel(name = "棰樼洰涓婚")
+ @ApiModelProperty("棰樼洰涓婚")
+ private String topic;
+
}
diff --git a/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScriptVO.java b/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScriptVO.java
index 73e8591..9d2161d 100644
--- a/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScriptVO.java
+++ b/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScriptVO.java
@@ -28,6 +28,13 @@
private Long ID;
/**
+ * 棰樼洰涓婚
+ */
+ @Excel(name = "棰樼洰涓婚")
+ @ApiModelProperty("棰樼洰涓婚")
+ private String topic;
+
+ /**
* 浠诲姟id
*/
@ApiModelProperty(value = "浠诲姟id")
diff --git a/smartor/src/main/java/com/smartor/service/CommonTaskService.java b/smartor/src/main/java/com/smartor/service/CommonTaskService.java
new file mode 100644
index 0000000..f4b026d
--- /dev/null
+++ b/smartor/src/main/java/com/smartor/service/CommonTaskService.java
@@ -0,0 +1,23 @@
+package com.smartor.service;
+
+import com.smartor.domain.SendTaskVO;
+import com.smartor.domain.ServiceThirdData;
+
+import java.util.List;
+
+/**
+ * 绗笁鏂瑰巶鍟嗘暟鎹甋ervice鎺ュ彛
+ *
+ * @author ruoyi
+ * @date 2023-10-10
+ */
+public interface CommonTaskService {
+
+ /**
+ * 浠诲姟鍙戦�佹墽琛�
+ *
+ * @param sendTaskVO
+ * @return 缁撴灉
+ */
+ public Integer taskSend(SendTaskVO sendTaskVO);
+}
diff --git a/smartor/src/main/java/com/smartor/service/IIvrTaskService.java b/smartor/src/main/java/com/smartor/service/IIvrTaskService.java
index 8b21e37..85319fe 100644
--- a/smartor/src/main/java/com/smartor/service/IIvrTaskService.java
+++ b/smartor/src/main/java/com/smartor/service/IIvrTaskService.java
@@ -65,11 +65,4 @@
public List<IvrLibaTemplateScriptVO> getScriptInfoByCondition(Long taskid, Long patid);
- /**
- * 浠诲姟鍙戦�佹墽琛�
- *
- * @param sendTaskVO
- * @return 缁撴灉
- */
- public int taskSend(SendTaskVO sendTaskVO);
}
diff --git a/smartor/src/main/java/com/smartor/service/impl/CommonTaskServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/CommonTaskServiceImpl.java
new file mode 100644
index 0000000..34d0dc1
--- /dev/null
+++ b/smartor/src/main/java/com/smartor/service/impl/CommonTaskServiceImpl.java
@@ -0,0 +1,229 @@
+package com.smartor.service.impl;
+
+import com.alibaba.fastjson2.JSON;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.ruoyi.common.core.redis.RedisCache;
+import com.ruoyi.common.exception.base.BaseException;
+import com.ruoyi.common.utils.DtoConversionUtils;
+import com.smartor.domain.*;
+import com.smartor.service.CommonTaskService;
+import com.smartor.service.IIvrTaskService;
+import com.smartor.service.ISvyTaskService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+
+/**
+ * 绗笁鏂瑰巶鍟嗘暟鎹甋ervice涓氬姟灞傚鐞�
+ *
+ * @author ruoyi
+ * @date 2023-10-10
+ */
+@Slf4j
+@Service
+public class CommonTaskServiceImpl implements CommonTaskService {
+ @Autowired
+ private IIvrTaskService ivrTaskService;
+
+ @Autowired
+ private ISvyTaskService iSvyTaskService;
+
+ @Autowired
+ private RedisCache redisCache;
+
+
+ @Override
+ public Integer taskSend(SendTaskVO sendTaskVO) {
+ if (sendTaskVO.getTaskId() == null || sendTaskVO.getTaskType() == null)
+ throw new BaseException("浠诲姟ID鎴栬�呬换鍔$被鍨嬩笉鑳戒负绌猴紝璇锋鏌ュ悗锛屽啀杩涜鎵ц");
+ if (sendTaskVO.getTaskType() == 1) {
+ //闅忚
+ return sfSend(sendTaskVO);
+ } else if (sendTaskVO.getTaskType() == 2) {
+ //闂嵎
+ return wjSend(sendTaskVO);
+ } else if (sendTaskVO.getTaskType() == 3) {
+ //瀹f暀
+
+ }
+ return null;
+ }
+
+ public int sfSend(SendTaskVO sendTaskVO) {
+ IvrTask ivrTask = ivrTaskService.selectIvrTaskByTaskid(sendTaskVO.getTaskId());
+ if (sendTaskVO.getSendState() != null && sendTaskVO.getSendState() == 3 || sendTaskVO.getSendState() != null && sendTaskVO.getSendState() == 4) {
+ //浠诲姟鏆傚仠鎴栫粓姝�
+ IvrTask ivrTask3 = new IvrTask();
+ ivrTask3.setTaskid(sendTaskVO.getTaskId());
+ ivrTask3.setStopState(ivrTask.getStopState() + 1);
+ ivrTask3.setSendState(sendTaskVO.getSendState());
+ ivrTaskService.updateIvrTask(ivrTask3);
+ return 0;
+ }
+
+ //鍒ゆ柇鍙戦�佺姸鎬佹槸鍚︿负绌�
+ if (StringUtils.isEmpty(sendTaskVO.getSendType())) {
+ sendTaskVO.setSendType(ivrTask.getSendType().toString());
+ }
+ //鍒ゆ柇浠诲姟鏄惁鏄珛鍗冲彂閫�
+ if (StringUtils.isNotEmpty(sendTaskVO.getSendType()) && sendTaskVO.getSendType().equals("2")) {
+ String content = sendMQContent(sendTaskVO, ivrTask.getTemplateid().toString(), ivrTask.getPreachform(), ivrTask.getStopState(), null);
+ //绔嬪嵆鍙戦��
+ redisCache.setCacheObject(content, content, 1, TimeUnit.SECONDS);
+
+ //灏嗕换鍔$姸鎬佷慨鏀规垚鎵ц涓�
+ IvrTask ivrTask2 = new IvrTask();
+ ivrTask2.setTaskid(ivrTask.getTaskid());
+ ivrTask2.setSendState(2);
+ ivrTaskService.updateIvrTask(ivrTask2);
+ } else if (StringUtils.isNotEmpty(sendTaskVO.getSendType()) && sendTaskVO.getSendType().equals("1") || StringUtils.isNotEmpty(sendTaskVO.getSendType()) && sendTaskVO.getSendType().equals("3")) {
+ //鏃堕棿娈靛彂閫�
+ ObjectMapper objectMapper = new ObjectMapper();
+ if (org.apache.commons.lang3.StringUtils.isNotEmpty(ivrTask.getSendTimeSlot())) {
+ List<TaskSendTimeVO> taskSendTimeVOList = null;
+ try {
+ taskSendTimeVOList = objectMapper.readValue(ivrTask.getSendTimeSlot(), new TypeReference<List<TaskSendTimeVO>>() {
+ });
+ } catch (JsonProcessingException e) {
+ log.error("JsonProcessingException鎶ラ敊浜嗭細{}", e.getMessage());
+ }
+ for (TaskSendTimeVO taskSendTimeVO : taskSendTimeVOList) {
+ //鍘籗endTimeslot涓紝鑾峰彇鎵�鏈夌殑鏃堕棿娈�
+ List<TaskSendTimeVO> list = new ArrayList<>();
+ list.add(taskSendTimeVO);
+
+ //鑾峰彇寮�濮嬪彂閫佹椂闂�
+ String begantime = taskSendTimeVO.getBegantime();
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ //璁板綍鐩墠鍒板彂閫佹椂闂寸殑姣鍊� 锛堝彂閫佹椂闂寸殑姣鍊� - 褰撳墠鏃堕棿鐨勬绉掑�硷級
+ Long milliseconds = 1000L;
+ try {
+ Date date = sdf.parse(begantime);
+ milliseconds = date.getTime() - System.currentTimeMillis();
+ System.out.println("鏃ユ湡姣鏁帮細" + milliseconds);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ 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);
+ }
+ //灏嗕换鍔$姸鎬佷慨鏀规垚鎵ц涓�
+ IvrTask ivrTask2 = new IvrTask();
+ ivrTask2.setTaskid(ivrTask.getTaskid());
+ ivrTask2.setSendState(2);
+ ivrTaskService.updateIvrTask(ivrTask2);
+ }
+ }
+ return 1;
+ }
+
+ public int wjSend(SendTaskVO sendTaskVO) {
+ SvyTask svyTask = iSvyTaskService.selectSvyTaskByTaskid(sendTaskVO.getTaskId());
+ if (sendTaskVO.getSendState() != null && sendTaskVO.getSendState() == 3 || sendTaskVO.getSendState() != null && sendTaskVO.getSendState() == 4) {
+ //浠诲姟鏆傚仠鎴栫粓姝�
+ SvyTask svyTask1 = new SvyTask();
+ svyTask1.setTaskid(sendTaskVO.getTaskId());
+ svyTask1.setStopState(svyTask.getStopState() + 1);
+ svyTask1.setSendState(sendTaskVO.getSendState().toString());
+ iSvyTaskService.updateSvyTask(svyTask1);
+ return 0;
+ }
+
+ //鍒ゆ柇鍙戦�佺姸鎬佹槸鍚︿负绌�
+ if (StringUtils.isEmpty(sendTaskVO.getSendType())) {
+ sendTaskVO.setSendType(svyTask.getSendType().toString());
+ }
+ //鍒ゆ柇浠诲姟鏄惁鏄珛鍗冲彂閫�
+ if (StringUtils.isNotEmpty(sendTaskVO.getSendType()) && sendTaskVO.getSendType().equals("2")) {
+
+ String content = sendMQContent(sendTaskVO, svyTask.getTemplateid(), svyTask.getPreachform(), svyTask.getStopState(), null);
+ //绔嬪嵆鍙戦��
+ redisCache.setCacheObject(content, content, 1, TimeUnit.SECONDS);
+
+ //灏嗕换鍔$姸鎬佷慨鏀规垚鎵ц涓�
+ SvyTask svyTask2 = new SvyTask();
+ svyTask2.setTaskid(svyTask.getTaskid());
+ svyTask2.setSendState("2");
+ iSvyTaskService.updateSvyTask(svyTask2);
+ } else if (StringUtils.isNotEmpty(sendTaskVO.getSendType()) && sendTaskVO.getSendType().equals("1") || StringUtils.isNotEmpty(sendTaskVO.getSendType()) && sendTaskVO.getSendType().equals("3")) {
+ //鏃堕棿娈靛彂閫�
+ ObjectMapper objectMapper = new ObjectMapper();
+ if (StringUtils.isNotEmpty(svyTask.getSendTimeSlot())) {
+ List<TaskSendTimeVO> taskSendTimeVOList = null;
+ try {
+ taskSendTimeVOList = objectMapper.readValue(svyTask.getSendTimeSlot(), new TypeReference<List<TaskSendTimeVO>>() {
+ });
+ } catch (JsonProcessingException e) {
+ log.error("JsonProcessingException鎶ラ敊浜嗭細{}", e.getMessage());
+ }
+ for (TaskSendTimeVO taskSendTimeVO : taskSendTimeVOList) {
+ //鍘籗endTimeslot涓紝鑾峰彇鎵�鏈夌殑鏃堕棿娈�
+ List<TaskSendTimeVO> list = new ArrayList<>();
+ list.add(taskSendTimeVO);
+
+ //鑾峰彇寮�濮嬪彂閫佹椂闂�
+ String begantime = taskSendTimeVO.getBegantime();
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ //璁板綍鐩墠鍒板彂閫佹椂闂寸殑姣鍊� 锛堝彂閫佹椂闂寸殑姣鍊� - 褰撳墠鏃堕棿鐨勬绉掑�硷級
+ Long milliseconds = 1000L;
+ try {
+ Date date = sdf.parse(begantime);
+ milliseconds = date.getTime() - System.currentTimeMillis();
+ System.out.println("鏃ユ湡姣鏁帮細" + milliseconds);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ SendTaskVO sendTaskVO1 = DtoConversionUtils.sourceToTarget(sendTaskVO, SendTaskVO.class);
+ sendTaskVO1.setSendType("1");
+ String content = sendMQContent(sendTaskVO1, svyTask.getTemplateid(), svyTask.getPreachform(), svyTask.getStopState(), list);
+ redisCache.setCacheObject(content, content, milliseconds / 1000, TimeUnit.SECONDS);
+ }
+ //灏嗕换鍔$姸鎬佷慨鏀规垚鎵ц涓�
+ SvyTask svyTask3 = new SvyTask();
+ svyTask3.setTaskid(svyTask.getTaskid());
+ svyTask3.setSendState("2");
+ iSvyTaskService.updateSvyTask(svyTask3);
+ }
+ }
+ return 1;
+ }
+
+ /**
+ * MQ浠诲姟鍒涘缓鍐呭
+ *
+ * @param sendTaskVO
+ * @param templateid
+ * @param preachform
+ * @param stopState
+ * @param sendTimeslot
+ * @return
+ */
+ private String sendMQContent(SendTaskVO sendTaskVO, String templateid, String preachform, Long stopState, List<TaskSendTimeVO> sendTimeslot) {
+ CommonTaskcallMQ commonTaskcallMQ = new CommonTaskcallMQ();
+ commonTaskcallMQ.setTaskid(sendTaskVO.getTaskId());
+ commonTaskcallMQ.setSendType(sendTaskVO.getSendType());
+ commonTaskcallMQ.setTemplateid(templateid);
+ commonTaskcallMQ.setPreachform(preachform);
+ commonTaskcallMQ.setStopState(stopState);
+ commonTaskcallMQ.setTaskType(sendTaskVO.getTaskType());
+ commonTaskcallMQ.setSendTimeslot(sendTimeslot);
+
+ String commonTaskcallMQJson = JSON.toJSONString(commonTaskcallMQ);
+ commonTaskcallMQJson = commonTaskcallMQJson.substring(1, commonTaskcallMQJson.length() - 1);
+ return commonTaskcallMQJson;
+ }
+}
diff --git a/smartor/src/main/java/com/smartor/service/impl/IvrTaskServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/IvrTaskServiceImpl.java
index 5764701..cb2053c 100644
--- a/smartor/src/main/java/com/smartor/service/impl/IvrTaskServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/IvrTaskServiceImpl.java
@@ -186,99 +186,5 @@
return ivrLibaTemplateScriptVOS;
}
- /**
- * 浠诲姟鍙戦��
- *
- * @return
- */
- @Override
- public int taskSend(SendTaskVO sendTaskVO) {
- if (sendTaskVO.getTaskId() == null) throw new BaseException("浠诲姟ID涓嶈兘涓虹┖锛岃妫�鏌ュ悗锛屽啀杩涜鎵ц");
- IvrTask ivrTask = selectIvrTaskByTaskid(sendTaskVO.getTaskId());
- if (sendTaskVO.getSendState() != null && sendTaskVO.getSendState() == 3 || sendTaskVO.getSendState() != null && sendTaskVO.getSendState() == 4) {
- //浠诲姟鏆傚仠鎴栫粓姝�
- IvrTask ivrTask3 = new IvrTask();
- ivrTask3.setTaskid(sendTaskVO.getTaskId());
- ivrTask3.setStopState(ivrTask.getStopState() + 1);
- ivrTask3.setSendState(sendTaskVO.getSendState());
- updateIvrTask(ivrTask3);
- return 0;
- }
- //鍒ゆ柇鍙戦�佺姸鎬佹槸鍚︿负绌�
- if (org.apache.commons.lang3.StringUtils.isEmpty(sendTaskVO.getSendType())) {
- sendTaskVO.setSendType(ivrTask.getSendType().toString());
- }
- //鍒ゆ柇浠诲姟鏄惁鏄珛鍗冲彂閫�
- if (StringUtils.isNotEmpty(sendTaskVO.getSendType()) && sendTaskVO.getSendType().equals("2")) {
- IvrTaskcallMQ ivrTaskcallMQ = new IvrTaskcallMQ();
- ivrTaskcallMQ.setTaskid(sendTaskVO.getTaskId());
- ivrTaskcallMQ.setSendType(sendTaskVO.getSendType());
- ivrTaskcallMQ.setTemplateid(ivrTask.getTemplateid().toString());
- ivrTaskcallMQ.setPreachform(ivrTask.getPreachform());
- ivrTaskcallMQ.setStopState(ivrTask.getStopState());
-
- String ivrTaskcallMQJson = JSON.toJSONString(ivrTaskcallMQ);
- ivrTaskcallMQJson = ivrTaskcallMQJson.substring(1, ivrTaskcallMQJson.length() - 1);
-
- //绔嬪嵆鍙戦��
-// rabbitMqCallPhoneConfig.sendMessage("phone_exchange", "phone.123", ivrTaskcallMQJson, 0L);
- redisCache.setCacheObject(ivrTaskcallMQJson, ivrTaskcallMQJson, 1, TimeUnit.SECONDS);
-
- //灏嗕换鍔$姸鎬佷慨鏀规垚鎵ц涓�
- IvrTask ivrTask2 = new IvrTask();
- ivrTask2.setTaskid(ivrTask.getTaskid());
- ivrTask2.setSendState(2);
- updateIvrTask(ivrTask2);
- } else if (StringUtils.isNotEmpty(sendTaskVO.getSendType()) && sendTaskVO.getSendType().equals("1") || StringUtils.isNotEmpty(sendTaskVO.getSendType()) && sendTaskVO.getSendType().equals("3")) {
- //鏃堕棿娈靛彂閫�
- ObjectMapper objectMapper = new ObjectMapper();
- if (org.apache.commons.lang3.StringUtils.isNotEmpty(ivrTask.getSendTimeSlot())) {
- List<TaskSendTimeVO> taskSendTimeVOList = null;
- try {
- taskSendTimeVOList = objectMapper.readValue(ivrTask.getSendTimeSlot(), new TypeReference<List<TaskSendTimeVO>>() {
- });
- } catch (JsonProcessingException e) {
- log.error("JsonProcessingException鎶ラ敊浜嗭細{}", e.getMessage());
- }
- for (TaskSendTimeVO taskSendTimeVO : taskSendTimeVOList) {
- //鍘籗endTimeslot涓紝鑾峰彇鎵�鏈夌殑鏃堕棿娈�
- List<TaskSendTimeVO> list = new ArrayList<>();
- list.add(taskSendTimeVO);
-
- //鑾峰彇寮�濮嬪彂閫佹椂闂�
- String begantime = taskSendTimeVO.getBegantime();
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- //璁板綍鐩墠鍒板彂閫佹椂闂寸殑姣鍊� 锛堝彂閫佹椂闂寸殑姣鍊� - 褰撳墠鏃堕棿鐨勬绉掑�硷級
- Long milliseconds = 1000L;
- try {
- Date date = sdf.parse(begantime);
- milliseconds = date.getTime() - System.currentTimeMillis();
- System.out.println("鏃ユ湡姣鏁帮細" + milliseconds);
- } catch (Exception e) {
- e.printStackTrace();
- }
- IvrTaskcallMQ ivrTaskcallMQ = new IvrTaskcallMQ();
- ivrTaskcallMQ.setTaskid(sendTaskVO.getTaskId());
- ivrTaskcallMQ.setSendType("1");
- ivrTaskcallMQ.setTemplateid(ivrTask.getTemplateid().toString());
- ivrTaskcallMQ.setSendTimeslot(list);
- ivrTaskcallMQ.setStopState(ivrTask.getStopState());
- ivrTaskcallMQ.setPreachform(ivrTask.getPreachform());
-
- Long finalMilliseconds = milliseconds;
- String ivrTaskcallMQJson = JSON.toJSONString(ivrTaskcallMQ);
- ivrTaskcallMQJson = ivrTaskcallMQJson.substring(1, ivrTaskcallMQJson.length() - 1);
-// rabbitMqCallPhoneConfig.sendMessage("phone_exchange", "phone.123", ivrTaskcallMQJson, milliseconds);
- redisCache.setCacheObject(ivrTaskcallMQJson, ivrTaskcallMQJson, milliseconds / 1000, TimeUnit.SECONDS);
- }
- //灏嗕换鍔$姸鎬佷慨鏀规垚鎵ц涓�
- IvrTask ivrTask2 = new IvrTask();
- ivrTask2.setTaskid(ivrTask.getTaskid());
- ivrTask2.setSendState(2);
- updateIvrTask(ivrTask2);
- }
- }
- return 1;
- }
}
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 ffe451c..55c43c6 100644
--- a/smartor/src/main/java/com/smartor/service/impl/SvyLibTemplateServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/SvyLibTemplateServiceImpl.java
@@ -14,6 +14,7 @@
import org.springframework.stereotype.Service;
import java.util.ArrayList;
+import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@@ -162,20 +163,22 @@
//澶勭悊棰樼洰
if (CollectionUtils.isNotEmpty(svyLibTemplate.getSvyLibScripts())) {
for (SvyLibTemplateScript svyLibScript : svyLibTemplate.getSvyLibScripts()) {
- SvyLibTemplateScript svyLibTemplateScript = DtoConversionUtils.sourceToTarget(svyLibScript, SvyLibTemplateScript.class);
+// SvyLibTemplateScript svyLibTemplateScript = DtoConversionUtils.sourceToTarget(svyLibScript, SvyLibTemplateScript.class);
//瀵归鐩繘琛屽鐞�
if (svyLibScript.getIsoperation() != null && svyLibScript.getIsoperation() == 1) {
//鏂板
- svyLibTemplateScript.setSvyid(svyLibTemplate.getSvyid());
- svyLibTemplateScript.setId(null);
- svyLibTemplateScriptMapper.insertSvyLibTemplateScript(svyLibTemplateScript);
+ svyLibScript.setSvyid(svyLibTemplate.getSvyid());
+ svyLibScript.setId(null);
+ svyLibScript.setCreateTime(new Date());
+ svyLibTemplateScriptMapper.insertSvyLibTemplateScript(svyLibScript);
} else if (svyLibScript.getIsoperation() != null && svyLibScript.getIsoperation() == 2) {
//淇敼
- svyLibTemplateScript.setSvyid(svyLibTemplate.getSvyid());
- svyLibTemplateScriptMapper.updateSvyLibTemplateScript(svyLibTemplateScript);
+ svyLibScript.setSvyid(svyLibTemplate.getSvyid());
+ svyLibScript.setUpdateTime(new Date());
+ svyLibTemplateScriptMapper.updateSvyLibTemplateScript(svyLibScript);
} else if (svyLibScript.getIsoperation() != null && svyLibScript.getIsoperation() == 3) {
- svyLibTemplateScriptMapper.deleteSvyLibTemplateScriptByTopicid(svyLibTemplateScript.getId());
+ svyLibTemplateScriptMapper.deleteSvyLibTemplateScriptByTopicid(svyLibScript.getId());
}
//瀵归鐩�夐」杩涜澶勭悊
@@ -184,10 +187,12 @@
if (svyLibTemplateTargetoption.getIsoperation() != null && svyLibTemplateTargetoption.getIsoperation() == 1) {
//鏂板
svyLibTemplateTargetoption.setScriptid(svyLibScript.getId());
+ svyLibTemplateTargetoption.setCreateTime(new Date());
svyLibTemplateTargetoptionMapper.insertSvyLibTemplateTargetoption(svyLibTemplateTargetoption);
} else if (svyLibTemplateTargetoption.getIsoperation() != null && svyLibTemplateTargetoption.getIsoperation() == 2) {
//淇敼
svyLibTemplateTargetoption.setScriptid(svyLibScript.getId());
+ svyLibTemplateTargetoption.setUpdateTime(new Date());
svyLibTemplateTargetoptionMapper.updateSvyLibTemplateTargetoption(svyLibTemplateTargetoption);
} else if (svyLibTemplateTargetoption.getIsoperation() != null && svyLibTemplateTargetoption.getIsoperation() == 3) {
//鍒犻櫎
diff --git a/smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml
index 8ec9dfc..3e134ad 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml
@@ -37,6 +37,7 @@
<result property="scoretype" column="scoretype"/>
<result property="score" column="score"/>
<result property="scriptPicture" column="script_picture"/>
+ <result property="topic" column="topic"/>
</resultMap>
<sql id="selectSvyLibTemplateScriptVo">
@@ -65,6 +66,7 @@
script_content,
suitway,
script_picture,
+ topic,
isavailable, language, otherdata, value_type, reply, scoretype, score
from svy_lib_template_script
</sql>
@@ -73,6 +75,7 @@
resultMap="SvyLibTemplateScriptResult">
<include refid="selectSvyLibTemplateScriptVo"/>
<where>
+ del_flag=0
<if test="oldid != null ">and oldid = #{oldid}</if>
<if test="svyid != null ">and svyid = #{svyid}</if>
<if test="scriptType != null and scriptType != ''">and script_type = #{scriptType}</if>
@@ -98,6 +101,7 @@
<if test="reply != null and reply != ''">and reply = #{reply}</if>
<if test="scoretype != null and scoretype != ''">and scoretype = #{scoretype}</if>
<if test="score != null and score != ''">and score = #{score}</if>
+ <if test="topic != null and topic != ''">and topic = #{topic}</if>
</where>
</select>
@@ -141,6 +145,7 @@
<if test="scoretype != null">scoretype,</if>
<if test="score != null">score,</if>
<if test="scriptPicture != null">script_picture,</if>
+ <if test="topic != null">topic,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="oldid != null">#{oldid},</if>
@@ -174,6 +179,7 @@
<if test="scoretype != null">#{scoretype},</if>
<if test="score != null">#{score},</if>
<if test="scriptPicture != null">#{scriptPicture},</if>
+ <if test="topic != null">#{topic},</if>
</trim>
</insert>
@@ -211,6 +217,7 @@
<if test="scoretype != null">scoretype = #{scoretype},</if>
<if test="score != null">score = #{score},</if>
<if test="scriptPicture != null">script_picture = #{scriptPicture},</if>
+ <if test="topic != null">topic = #{topic},</if>
</trim>
where id = #{id}
</update>
diff --git a/smartor/src/main/resources/mapper/smartor/SvyLibTemplateTargetoptionMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyLibTemplateTargetoptionMapper.xml
index 8f45203..717664c 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyLibTemplateTargetoptionMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyLibTemplateTargetoptionMapper.xml
@@ -64,6 +64,7 @@
resultMap="SvyLibTemplateTargetoptionResult">
<include refid="selectSvyLibTemplateTargetoptionVo"/>
<where>
+ del_flag=0
<if test="groupid != null and groupid != ''">and groupid = #{groupid}</if>
<if test="categoryName != null and categoryName != ''">and categoryName like concat('%', #{categoryName},
'%')
diff --git a/smartor/src/main/resources/mapper/smartor/SvyTaskMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyTaskMapper.xml
index c093388..63918a0 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyTaskMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyTaskMapper.xml
@@ -39,7 +39,7 @@
<result property="pid" column="pid"/>
<result property="guid" column="guid"/>
<result property="preachform" column="preachform"/>
- <result property="isSend" column="is_send"/>
+ <result property="sendType" column="send_type"/>
<result property="sendState" column="send_state"/>
<result property="param" column="param"/>
<result property="textParam" column="text_param"/>
@@ -97,7 +97,7 @@
pid,
guid,
preachform,
- is_send,
+ send_type,
send_state,
param
from svy_task
@@ -140,7 +140,7 @@
<if test="pid != null ">and pid = #{pid}</if>
<if test="guid != null and guid != ''">and guid = #{guid}</if>
<if test="preachform != null and preachform != ''">and preachform = #{preachform}</if>
- <if test="isSend != null ">and is_send = #{isSend}</if>
+ <if test="sendType != null ">and send_type = #{sendType}</if>
<if test="sendState != null and sendState != ''">and send_state = #{sendState}</if>
<if test="param != null and param != ''">and param = #{param}</if>
<if test="sendTimeSlot != null and sendTimeSlot != ''">and send_time_slot like concat('%', #{sendTimeSlot},
@@ -192,7 +192,7 @@
<if test="pid != null">pid,</if>
<if test="guid != null">guid,</if>
<if test="preachform != null">preachform,</if>
- <if test="isSend != null">is_send,</if>
+ <if test="sendType != null">send_type,</if>
<if test="sendState != null">send_state,</if>
<if test="param != null">param,</if>
<if test="textParam != null">text_param,</if>
@@ -239,7 +239,7 @@
<if test="pid != null">#{pid},</if>
<if test="guid != null">#{guid},</if>
<if test="preachform != null">#{preachform},</if>
- <if test="isSend != null">#{isSend},</if>
+ <if test="sendType != null">#{sendType},</if>
<if test="sendState != null">#{sendState},</if>
<if test="param != null">#{param},</if>
<if test="textParam != null">#{textParam},</if>
@@ -290,7 +290,7 @@
<if test="pid != null">pid = #{pid},</if>
<if test="guid != null">guid = #{guid},</if>
<if test="preachform != null">preachform = #{preachform},</if>
- <if test="isSend != null">is_send = #{isSend},</if>
+ <if test="sendType != null">send_type = #{sendType},</if>
<if test="sendState != null">send_state = #{sendState},</if>
<if test="param != null">param = #{param},</if>
<if test="textParam != null">text_param = #{textParam},</if>
diff --git a/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateScriptMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateScriptMapper.xml
index f62b28e..7167789 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateScriptMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateScriptMapper.xml
@@ -45,10 +45,12 @@
<result property="questionResult" column="question_result" />
<result property="otherdata" column="otherdata" />
<result property="picturePath" column="picture_path" />
+ <result property="sort" column="sort" />
+ <result property="topic" column="topic" />
</resultMap>
<sql id="selectSvyTaskTemplateScriptVo">
- select ID, taskid, templateQuestionNum, templateID, scriptID, questiontitle, language, categoryName, questionPoint, questionText, questionVoice, noMatchText, noMatchVoice, slienceText, slienceVoice, submoduleText, submoduleVoice, noClearlyText, noClearlyVoice, is_must, playWavOnly, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time, orgid, pid, guid, value_type, targetOptions, targettype, targetid, targetvalue, next_question, question_result, otherdata, picture_path from svy_task_template_script
+ select ID,sort,topic, taskid, templateQuestionNum, templateID, scriptID, questiontitle, language, categoryName, questionPoint, questionText, questionVoice, noMatchText, noMatchVoice, slienceText, slienceVoice, submoduleText, submoduleVoice, noClearlyText, noClearlyVoice, is_must, playWavOnly, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time, orgid, pid, guid, value_type, targetOptions, targettype, targetid, targetvalue, next_question, question_result, otherdata, picture_path from svy_task_template_script
</sql>
<select id="selectSvyTaskTemplateScriptList" parameterType="com.smartor.domain.SvyTaskTemplateScript" resultMap="SvyTaskTemplateScriptResult">
@@ -88,6 +90,7 @@
<if test="questionResult != null and questionResult != ''"> and question_result = #{questionResult}</if>
<if test="otherdata != null and otherdata != ''"> and otherdata = #{otherdata}</if>
<if test="picturePath != null and picturePath != ''"> and picture_path = #{picturePath}</if>
+ <if test="topic != null and topic != ''"> and topic = #{topic}</if>
</where>
</select>
@@ -138,6 +141,8 @@
<if test="questionResult != null">question_result,</if>
<if test="otherdata != null">otherdata,</if>
<if test="picturePath != null">picture_path,</if>
+ <if test="sort != null">sort,</if>
+ <if test="topic != null">topic,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="taskid != null">#{taskid},</if>
@@ -179,6 +184,8 @@
<if test="questionResult != null">#{questionResult},</if>
<if test="otherdata != null">#{otherdata},</if>
<if test="picturePath != null">#{picturePath},</if>
+ <if test="sort != null">#{sort},</if>
+ <if test="topic != null">#{topic},</if>
</trim>
</insert>
@@ -224,6 +231,8 @@
<if test="questionResult != null">question_result = #{questionResult},</if>
<if test="otherdata != null">otherdata = #{otherdata},</if>
<if test="picturePath != null">picture_path = #{picturePath},</if>
+ <if test="sort != null">sort = #{sort},</if>
+ <if test="topic != null">topic = #{topic},</if>
</trim>
where ID = #{ID}
</update>
--
Gitblit v1.9.3