diff --git a/pom.xml b/pom.xml
index bcb3b36..b1f04e4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,35 +1,35 @@
- 4.0.0
-
- org.springframework.boot
- spring-boot-starter-parent
- 2.6.7
-
-
- com.zh
- project0512
- 0.0.1-SNAPSHOT
- project0512
- Demo project for Spring Boot
-
- 8
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+ 4.0.0
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 2.6.7
+
+
+ com.zh
+ project0512
+ 0.0.1-SNAPSHOT
+ project0512
+ Demo project for Spring Boot
+
+ 8
true
2.2.2.RELEASE
2.12.4
-
-
-
- org.springframework.boot
- spring-boot-starter
-
+
+
+
+ org.springframework.boot
+ spring-boot-starter
+
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
org.springframework.boot
@@ -190,12 +190,12 @@
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
org.apache.maven.plugins
maven-compiler-plugin
@@ -205,6 +205,6 @@
-
+
jar
diff --git a/src/main/java/com/zh/project0512/conf/GeneratorCodeConfig.java b/src/main/java/com/zh/project0512/conf/GeneratorCodeConfig.java
index 70ca728..55fe450 100644
--- a/src/main/java/com/zh/project0512/conf/GeneratorCodeConfig.java
+++ b/src/main/java/com/zh/project0512/conf/GeneratorCodeConfig.java
@@ -51,7 +51,7 @@ public class GeneratorCodeConfig {
dsc.setUrl(
"jdbc:mysql://121.41.171.43:3306/project0512?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true");
dsc.setDriverName("com.mysql.cj.jdbc.Driver");
- dsc.setUsername("project0512");
+ dsc.setUsername("root");
dsc.setPassword("zhang123.");
mpg.setDataSource(dsc);
diff --git a/src/main/java/com/zh/project0512/controller/UtilsController.java b/src/main/java/com/zh/project0512/controller/UtilsController.java
index 1d7385a..5db0416 100644
--- a/src/main/java/com/zh/project0512/controller/UtilsController.java
+++ b/src/main/java/com/zh/project0512/controller/UtilsController.java
@@ -198,6 +198,13 @@ public class UtilsController {
public static void main(String[] args) {
+ String session_key = "sNlwYEz92LwCKnsYclHknQ==";
+ String encryptedData = "x7OocajZ2wHJA/HpmUpcgSQYR05QbIgoBwUz5llUVY1kB1gminmcQWDziRQ4DZUV9Km68plV/vvq1bggM9To37k8fGjWYX4jXi56h8Fqi2sE74fYfnE9K6ccTVtB5m2EMs2ePUA6qkR4+qLBPOoocMlU7fI+vWuY/l70/FVqh0YPgNJsewaN2MyPE/7xjh9HY9IjDCY/FuZbzWiwDBDz+6CK/XNZvQvlzgfrEyRE1mVdEso/fHifmJoIR7iwq67pfMtp1Fovwc3/dPvdXM9IqChaQc46dGwz4VeuW6NmjnndVfIfDHn0jQQktA/NmC85";
+ String iv ="ITNHB91+Pfgm9wt2eSh6HA==";
+ String info = CoderUtil.decrypt(session_key, iv, encryptedData);
+ System.out.println(info);
+
+
// String a = m.find() ? m.group(1) : url;
// System.out.println(a);
// int b = StringUtils.countOccurrencesOf(a, "https://v.douyin");
diff --git a/src/main/java/com/zh/project0512/controller/manage/CommonWordsController.java b/src/main/java/com/zh/project0512/controller/manage/CommonWordsController.java
new file mode 100644
index 0000000..1892569
--- /dev/null
+++ b/src/main/java/com/zh/project0512/controller/manage/CommonWordsController.java
@@ -0,0 +1,134 @@
+package com.zh.project0512.controller.manage;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.zh.project0512.annotation.AdminCheckAuthorityAnnotation;
+import com.zh.project0512.annotation.AdminTokenValid;
+import com.zh.project0512.model.CommonWords;
+import com.zh.project0512.service.ICommonWordsService;
+import com.zh.project0512.utils.MybatisPlusUtil;
+import com.zh.project0512.utils.result.HttpStatusEnum;
+import com.zh.project0512.utils.result.Result;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import lombok.Data;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+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 javax.validation.constraints.Min;
+import javax.validation.constraints.NotNull;
+import java.time.LocalDateTime;
+
+/**
+ *
+ * 前端控制器
+ *
+ *
+ * @author zh
+ * @since 2023-02-16
+ */
+@RestController
+@RequestMapping("/commonWords")
+@Tag(name = "话术词条")
+public class CommonWordsController {
+ @Autowired
+ private ICommonWordsService commonWordsService;
+
+ @Data
+ static class AddWordParam {
+ @NotNull(message = "title不能为空")
+ @Schema(title = "词条")
+ private String title;
+ }
+
+ @Operation(summary = "创建词条")
+ @PostMapping("/add")
+ @AdminTokenValid
+ @AdminCheckAuthorityAnnotation(jurisdictionId = "120")
+ public Result add(@Validated @RequestBody AddWordParam param) {
+ commonWordsService.addWords(new CommonWords().setTitle(param.getTitle()).setCreatAt(LocalDateTime.now()));
+ return Result.success("添加完成");
+ }
+
+ @Data
+ static class DelWordsParam {
+ @NotNull(message = "id不能为空")
+ @Min(value = 1, message = "id最小值为1")
+ @Schema(title = "词条id")
+ private Integer id;
+ }
+
+ @Operation(summary = "删除词条(软删除)")
+ @PostMapping("/del")
+ @AdminTokenValid
+ @AdminCheckAuthorityAnnotation(jurisdictionId = "121")
+ public Result del(@Validated @RequestBody DelWordsParam param) {
+ return MybatisPlusUtil.sqlResult(commonWordsService.update(new UpdateWrapper().eq("id", param.getId()).set("sortWeight",0).set("isDeleted", 1)), "删除");
+ }
+
+ @Data
+ static class UpdWordsParam {
+ @NotNull(message = "id不能为空")
+ @Min(value = 1, message = "id最小值为1")
+ @Schema(title = "词条id")
+ private Integer id;
+ @NotNull(message = "词条不能为空")
+ @Schema(title = "词条")
+ private String title;
+ }
+
+ @Operation(summary = "更新标签名称")
+ @PostMapping("/upd")
+ @AdminTokenValid
+ @AdminCheckAuthorityAnnotation(jurisdictionId = "131")
+ public Result upd(@Validated @RequestBody UpdWordsParam param) {
+ return MybatisPlusUtil.sqlResult(commonWordsService.updateById(new CommonWords().setId(param.getId()).setTitle(param.getTitle()).setUpdateAt(LocalDateTime.now())), "修改");
+ }
+
+ @Operation(summary = "词条列表")
+ @PostMapping("/list")
+ @AdminTokenValid
+ public Result list(@RequestBody(required = false) JSONObject obj) {
+ QueryWrapper qw = new QueryWrapper<>();
+ qw.eq("isDeleted",0).orderByAsc("sortWeight").orderByDesc("updateAt", "creatAt");
+ return Result.success(commonWordsService.pageMaps(MybatisPlusUtil.SetPage(obj), qw));
+ }
+
+ @Data
+ static class UpdWSParam {
+ @NotNull(message = "id不能为空")
+ @Min(value = 1, message = "id最小值为1")
+ @Schema(title = "词条id")
+ private Integer id;
+ @NotNull(message = "排序权重不能为空")
+ @Min(value = 1, message = "排序权重最小值为1")
+ @Schema(title = "排序权重:数字越小排序靠前")
+ private Integer sortWeight;
+ }
+
+ @Operation(summary = "修改词条排序")
+ @PostMapping("/updSort")
+ @AdminTokenValid
+ @AdminCheckAuthorityAnnotation(jurisdictionId = "132")
+ public Result updSort(@Validated @RequestBody UpdWSParam param) {
+ CommonWords words = commonWordsService.getById(param.getId());
+ if(words.getIsDeleted() == 1){
+ return Result.fail(HttpStatusEnum.CUSTOM_EXCEPTION,"该标签已被删除");
+ }
+ int origin = words.getSortWeight();
+ int current = param.getSortWeight();
+ if (origin == current) {
+ return Result.fail(HttpStatusEnum.CUSTOM_EXCEPTION, "权重无变化");
+ }
+ commonWordsService.updSort(origin, current, origin > current);
+ return Result.success("修改完成");
+ }
+}
diff --git a/src/main/java/com/zh/project0512/controller/wxApp/TaskUController.java b/src/main/java/com/zh/project0512/controller/wxApp/TaskUController.java
index b498464..df8b5a0 100644
--- a/src/main/java/com/zh/project0512/controller/wxApp/TaskUController.java
+++ b/src/main/java/com/zh/project0512/controller/wxApp/TaskUController.java
@@ -19,6 +19,7 @@ import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
+import lombok.experimental.Accessors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
@@ -69,6 +70,27 @@ public class TaskUController {
@Autowired
private IVideoEffectSettingService videoEffectSettingService;
+ @Data
+ @Accessors(chain = true)
+ static class CountTask{
+ private int all;
+ private int progressing;
+ private int completed;
+ }
+
+ @Operation(summary = "统计")
+ @PostMapping("/count")
+ @TokenValid
+ public Result count(@RequestHeader String token) {
+ String openid = new JwtUtil().parseOpenid(token);
+ int all = taskService.count( new QueryWrapper().eq("(SELECT count(*)!=0 from userTask as t4,user as t5 WHERE task.id = t4.taskId and t4.userId = t5.id and t5.openid = +'" + openid + "' )", 1));
+ int progressing = taskService.count( new QueryWrapper().eq("status",1).eq("(SELECT count(*)!=0 from userTask as t4,user as t5 WHERE task.id = t4.taskId and t4.userId = t5.id and t5.openid = +'" + openid + "' )", 1));
+ int completed = taskService.count( new QueryWrapper().between("status", 2,3).eq("(SELECT count(*)!=0 from userTask as t4,user as t5 WHERE task.id = t4.taskId and t4.userId = t5.id and t5.openid = +'" + openid + "' )", 1));
+ CountTask countTask = new CountTask();
+ countTask.setAll(all).setProgressing(progressing).setCompleted(completed);
+ return Result.success(countTask);
+ }
+
@Data
static class ListTParam {
private int pageNum;
@@ -233,7 +255,8 @@ public class TaskUController {
.or().like("t1.area", keywords).or().like("t1.remarks", keywords).or().like("t1.brandList", keywords)
);
}
- IPage