张涛 1 year ago
parent
commit
7a6149c928
27 changed files with 218 additions and 219 deletions
  1. 1
    1
      application/src/main/java/com/lyg/application/controller/TaAttachController.java
  2. 5
    2
      application/src/main/java/com/lyg/application/controller/TaPostController.java
  3. 1
    1
      application/src/main/java/com/lyg/application/controller/TaSourceAttachController.java
  4. 26
    28
      application/src/main/java/com/lyg/application/controller/TdCategoryController.java
  5. 1
    1
      application/src/main/java/com/lyg/application/entity/TaAttach.java
  6. 0
    64
      application/src/main/java/com/lyg/application/entity/TaCategory.java
  7. 3
    0
      application/src/main/java/com/lyg/application/entity/TaPost.java
  8. 62
    0
      application/src/main/java/com/lyg/application/entity/TdCategory.java
  9. 2
    3
      application/src/main/java/com/lyg/application/mapper/TdCategoryMapper.java
  10. 0
    14
      application/src/main/java/com/lyg/application/service/TaCategoryService.java
  11. 14
    0
      application/src/main/java/com/lyg/application/service/TdCategoryService.java
  12. 0
    18
      application/src/main/java/com/lyg/application/service/impl/TaCategoryServiceImpl.java
  13. 13
    8
      application/src/main/java/com/lyg/application/service/impl/TaPostServiceImpl.java
  14. 18
    0
      application/src/main/java/com/lyg/application/service/impl/TdCategoryServiceImpl.java
  15. 1
    0
      application/src/main/resources/application.yml
  16. 1
    1
      application/src/main/resources/mapper/TaAttachMapper.xml
  17. 1
    1
      application/src/main/resources/mapper/TdCategoryMapper.xml
  18. 0
    8
      framework/pom.xml
  19. 4
    4
      framework/src/main/java/com/lyg/framework/mybatisplus/MyMetaObjectHandler.java
  20. 1
    1
      framework/src/main/java/com/lyg/framework/mybatisplus/MybatisPlusConfig.java
  21. 7
    7
      framework/src/main/java/com/lyg/framework/satoken/SaServletFilter2.java
  22. 9
    9
      framework/src/main/java/com/lyg/framework/satoken/SaTokenConfigure.java
  23. 19
    19
      framework/src/main/resources/framework.yml
  24. 3
    3
      system/src/main/java/com/lyg/system/controller/BaseController.java
  25. 2
    2
      system/src/main/java/com/lyg/system/controller/SysLogController.java
  26. 1
    1
      system/src/main/java/com/lyg/system/controller/SysPositionController.java
  27. 23
    23
      system/src/main/java/com/lyg/system/controller/SysUserController.java

+ 1
- 1
application/src/main/java/com/lyg/application/controller/TaAttachController.java View File

@@ -58,7 +58,7 @@ public class TaAttachController extends BaseController {
58 58
     public SaResult list(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
59 59
                             @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
60 60
                             @ApiParam("正序排列") @RequestParam(value ="sortAsc", required = false) String sortAsc,
61
-                         @ApiParam("倒序排列") @RequestParam(value ="sortDesc", defaultValue = "create_date") String sortDesc) throws Exception {
61
+                         @ApiParam("倒序排列") @RequestParam(value ="sortDesc", defaultValue = "created_time") String sortDesc) throws Exception {
62 62
         
63 63
         IPage<TaAttach> pg = new Page<>(pageNum, pageSize);
64 64
         QueryWrapper<TaAttach> queryWrapper = new QueryWrapper<>();

+ 5
- 2
application/src/main/java/com/lyg/application/controller/TaPostController.java View File

@@ -61,11 +61,15 @@ public class TaPostController extends BaseController {
61 61
     @GetMapping("/taPost")
62 62
     public SaResult list(@ApiParam("页码") @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
63 63
                          @ApiParam("单页数据量") @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
64
+                         @ApiParam("标题") @RequestParam(value = "title", required = false) String title,
65
+                         @ApiParam("作者") @RequestParam(value = "author", required = false) String author,
64 66
                          @ApiParam("正序排列") @RequestParam(value = "sortAsc", required = false) String sortAsc,
65
-                         @ApiParam("倒序排列") @RequestParam(value = "sortDesc", defaultValue = "create_date") String sortDesc) throws Exception {
67
+                         @ApiParam("倒序排列") @RequestParam(value = "sortDesc", defaultValue = "created_time") String sortDesc) throws Exception {
66 68
 
67 69
         IPage<TaPost> pg = new Page<>(pageNum, pageSize);
68 70
         QueryWrapper<TaPost> queryWrapper = new QueryWrapper<>();
71
+        queryWrapper.like(StringUtil.isNotEmpty(title),"title", title);
72
+        queryWrapper.like(StringUtil.isNotEmpty(author), "author", author);
69 73
         queryWrapper.orderByAsc(StringUtil.isNotEmpty(sortAsc), StringUtil.humpToLine(sortAsc));
70 74
         queryWrapper.orderByDesc(StringUtil.isNotEmpty(sortDesc), StringUtil.humpToLine(sortDesc));
71 75
         IPage<TaPost> result = taPostService.page(pg, queryWrapper);
@@ -89,7 +93,6 @@ public class TaPostController extends BaseController {
89 93
             throw new Exception("数据不为空");
90 94
         }
91 95
         taPostService.savePost(taPost);
92
-        taPostService.save(taPost);
93 96
         return SaResult.data(taPost);
94 97
     }
95 98
 

+ 1
- 1
application/src/main/java/com/lyg/application/controller/TaSourceAttachController.java View File

@@ -59,7 +59,7 @@ public class TaSourceAttachController extends BaseController {
59 59
     public SaResult list(@ApiParam("页码") @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
60 60
                          @ApiParam("单页数据量") @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
61 61
                          @ApiParam("正序排列") @RequestParam(value = "sortAsc", required = false) String sortAsc,
62
-                         @ApiParam("倒序排列") @RequestParam(value = "sortDesc", defaultValue = "create_date") String sortDesc) throws Exception {
62
+                         @ApiParam("倒序排列") @RequestParam(value = "sortDesc", defaultValue = "created_time") String sortDesc) throws Exception {
63 63
 
64 64
         IPage<TaSourceAttach> pg = new Page<>(pageNum, pageSize);
65 65
         QueryWrapper<TaSourceAttach> queryWrapper = new QueryWrapper<>();

application/src/main/java/com/lyg/application/controller/TaCategoryController.java → application/src/main/java/com/lyg/application/controller/TdCategoryController.java View File

@@ -4,8 +4,6 @@ import cn.dev33.satoken.util.SaResult;
4 4
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5 5
 import com.baomidou.mybatisplus.core.metadata.IPage;
6 6
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7
-import java.util.List;
8
-import com.lyg.common.Constants;
9 7
 import com.lyg.common.util.StringUtil;
10 8
 import com.lyg.framework.log.OpLog;
11 9
 import com.lyg.system.controller.BaseController;
@@ -16,8 +14,8 @@ import io.swagger.annotations.ApiParam;
16 14
 import org.springframework.beans.factory.annotation.Autowired;
17 15
 import org.springframework.validation.annotation.Validated;
18 16
 import org.springframework.web.bind.annotation.*;
19
-import com.lyg.application.entity.TaCategory;
20
-import com.lyg.application.service.TaCategoryService;
17
+import com.lyg.application.entity.TdCategory;
18
+import com.lyg.application.service.TdCategoryService;
21 19
 
22 20
  /**
23 21
  * 分类;(ta_category)表控制层
@@ -27,10 +25,10 @@ import com.lyg.application.service.TaCategoryService;
27 25
 @Api(tags = "分类对象功能接口")
28 26
 @RestController
29 27
 @RequestMapping("/")
30
-public class TaCategoryController extends BaseController {
28
+public class TdCategoryController extends BaseController {
31 29
     
32 30
     @Autowired
33
-    private TaCategoryService taCategoryService;
31
+    private TdCategoryService tdCategoryService;
34 32
     
35 33
     /** 
36 34
      * 通过ID查询单条数据 
@@ -41,9 +39,9 @@ public class TaCategoryController extends BaseController {
41 39
     @OpLog(module = "分类", action = "查询单条数据", desc = "ID:{{#id}}")
42 40
     @AccessLimit()
43 41
     @ApiOperation("通过ID查询单条数据")
44
-    @GetMapping("/taCategory/{id}")
42
+    @GetMapping("/tdCategory/{id}")
45 43
     public SaResult queryById(@ApiParam("对象ID") @PathVariable String id) throws Exception {
46
-        return SaResult.data(taCategoryService.getById(id));
44
+        return SaResult.data(tdCategoryService.getById(id));
47 45
     }
48 46
     
49 47
     /** 
@@ -56,17 +54,17 @@ public class TaCategoryController extends BaseController {
56 54
     @OpLog(module = "分类", action = "分页列表查询")
57 55
     @AccessLimit()
58 56
     @ApiOperation("分页查询")
59
-    @GetMapping("/taCategory")
57
+    @GetMapping("/tdCategory")
60 58
     public SaResult list(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
61 59
                             @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
62 60
                             @ApiParam("正序排列") @RequestParam(value ="sortAsc", required = false) String sortAsc,
63
-                         @ApiParam("倒序排列") @RequestParam(value ="sortDesc", defaultValue = "create_date") String sortDesc) throws Exception {
61
+                         @ApiParam("倒序排列") @RequestParam(value ="sortDesc", defaultValue = "created_time") String sortDesc) throws Exception {
64 62
         
65
-        IPage<TaCategory> pg = new Page<>(pageNum, pageSize);
66
-        QueryWrapper<TaCategory> queryWrapper = new QueryWrapper<>();
67
-        queryWrapper.orderByAsc(StringUtil.isNotEmpty(sortAsc), StringUtil.humpToLine(sortAsc));
68
-        queryWrapper.orderByDesc(StringUtil.isNotEmpty(sortDesc), StringUtil.humpToLine(sortDesc));
69
-        IPage<TaCategory> result = taCategoryService.page(pg, queryWrapper);
63
+        IPage<TdCategory> pg = new Page<>(pageNum, pageSize);
64
+        QueryWrapper<TdCategory> queryWrapper = new QueryWrapper<>();
65
+//        queryWrapper.orderByAsc(StringUtil.isNotEmpty(sortAsc), StringUtil.humpToLine(sortAsc));
66
+//        queryWrapper.orderByDesc(StringUtil.isNotEmpty(sortDesc), StringUtil.humpToLine(sortDesc));
67
+        IPage<TdCategory> result = tdCategoryService.page(pg, queryWrapper);
70 68
         
71 69
         return SaResult.data(result);
72 70
     }
@@ -74,33 +72,33 @@ public class TaCategoryController extends BaseController {
74 72
     /** 
75 73
      * 新增数据
76 74
      *
77
-     * @param taCategory 实例对象
75
+     * @param tdCategory 实例对象
78 76
      * @return 实例对象
79 77
      */
80 78
     @OpLog(module = "分类", action = "新增数据")
81 79
     @AccessLimit()
82 80
     @ApiOperation("新增数据")
83
-    @PostMapping("/taCategory")
84
-    public SaResult add(@ApiParam("对象实体") @Validated @RequestBody TaCategory taCategory) throws Exception {
85
-        taCategoryService.save(taCategory);
86
-        return SaResult.data(taCategory);
81
+    @PostMapping("/tdCategory")
82
+    public SaResult add(@ApiParam("对象实体") @Validated @RequestBody TdCategory tdCategory) throws Exception {
83
+        tdCategoryService.save(tdCategory);
84
+        return SaResult.data(tdCategory);
87 85
     }
88 86
     
89 87
     /** 
90 88
      * 更新数据
91 89
      *
92
-     * @param taCategory 实例对象
90
+     * @param tdCategory 实例对象
93 91
      * @return 实例对象
94 92
      */
95 93
     @OpLog(module = "分类", action = "更新数据")
96 94
     @AccessLimit()
97 95
     @ApiOperation("更新数据")
98
-    @PutMapping("/taCategory/{id}")
99
-    public SaResult edit(@ApiParam("对象实体") @Validated @RequestBody TaCategory taCategory,
96
+    @PutMapping("/tdCategory/{id}")
97
+    public SaResult edit(@ApiParam("对象实体") @Validated @RequestBody TdCategory tdCategory,
100 98
                             @ApiParam("对象ID") @PathVariable String id ) throws Exception {
101
-        taCategory.setCategoryId(id);
102
-        taCategoryService.updateById(taCategory);
103
-        return SaResult.data(taCategory);
99
+        tdCategory.setCategoryId(id);
100
+        tdCategoryService.updateById(tdCategory);
101
+        return SaResult.data(tdCategory);
104 102
     }
105 103
     
106 104
     /** 
@@ -112,9 +110,9 @@ public class TaCategoryController extends BaseController {
112 110
     @OpLog(module = "分类", action = "删除数据", desc = "ID:{{#id}}")
113 111
     @AccessLimit()
114 112
     @ApiOperation("通过主键删除数据")
115
-    @DeleteMapping("/taCategory/{id}")
113
+    @DeleteMapping("/tdCategory/{id}")
116 114
     public SaResult deleteById(@ApiParam("对象ID") @PathVariable String id){
117
-        taCategoryService.removeById(id);
115
+        tdCategoryService.removeById(id);
118 116
         return SaResult.data("success");
119 117
     }
120 118
 }

+ 1
- 1
application/src/main/java/com/lyg/application/entity/TaAttach.java View File

@@ -23,7 +23,7 @@ import javax.validation.constraints.NotBlank;
23 23
 public class TaAttach implements Serializable,Cloneable{
24 24
 
25 25
     @ApiModelProperty(name = "附件Id",notes = "")
26
-    @TableId(value = "attach_id", type = IdType.ASSIGN_UUID)
26
+//    @TableId(value = "attach_id", type = IdType.ASSIGN_UUID)
27 27
     private String attachId ;
28 28
 
29 29
     @NotBlank(message = "附件名不能为空")

+ 0
- 64
application/src/main/java/com/lyg/application/entity/TaCategory.java View File

@@ -1,64 +0,0 @@
1
-package com.lyg.application.entity;
2
-
3
-import com.baomidou.mybatisplus.annotation.*;
4
-import io.swagger.annotations.ApiModel;
5
-import io.swagger.annotations.ApiModelProperty;
6
-import lombok.Data;
7
-import lombok.EqualsAndHashCode;
8
-import lombok.experimental.Accessors;
9
-
10
-import javax.validation.constraints.NotBlank;
11
-import java.io.Serializable;
12
-import java.time.LocalDateTime;
13
-
14
-/**
15
- * 分类;
16
- *
17
- * @author : http://www.chiner.pro
18
- * @date : 2024-3-22
19
- */
20
-@Data
21
-@EqualsAndHashCode(callSuper = false)
22
-@Accessors(chain = true)
23
-@ApiModel(value = "分类", description = "")
24
-@TableName("td_category")
25
-public class TaCategory implements Serializable, Cloneable {
26
-
27
-    @ApiModelProperty(name = "分类Id", notes = "")
28
-    @TableId(value = "category_id", type = IdType.ASSIGN_UUID)
29
-    private String categoryId;
30
-
31
-    @NotBlank(message = "分类名不能为空")
32
-    @ApiModelProperty(name = "分类名", notes = "")
33
-    private String categoryName;
34
-
35
-    @ApiModelProperty(name = "上级单位;-1为根级目录", notes = "")
36
-    private String parentId;
37
-
38
-    @ApiModelProperty(name = "序号", notes = "")
39
-    private Integer sort;
40
-
41
-    @ApiModelProperty(name = "状态", notes = "0 正常 1不正常")
42
-    private Integer status;
43
-
44
-    @ApiModelProperty(name = "", notes = "")
45
-    @TableField(fill = FieldFill.INSERT)
46
-    private LocalDateTime createdTime;
47
-
48
-    @ApiModelProperty(name = "", notes = "")
49
-    @TableField(fill = FieldFill.INSERT)
50
-    private String createdBy;
51
-
52
-    @ApiModelProperty(name = "", notes = "")
53
-    @TableField(fill = FieldFill.INSERT_UPDATE)
54
-    private LocalDateTime updatedTime;
55
-
56
-    @ApiModelProperty(name = "", notes = "")
57
-    @TableField(fill = FieldFill.INSERT_UPDATE)
58
-    private String updatedBy;
59
-
60
-    @ApiModelProperty(name = "", notes = "0 存在 1 删除")
61
-    @TableField(fill = FieldFill.INSERT)
62
-    private Integer deleted;
63
-
64
-}

+ 3
- 0
application/src/main/java/com/lyg/application/entity/TaPost.java View File

@@ -1,5 +1,6 @@
1 1
 package com.lyg.application.entity;
2 2
 
3
+import cn.hutool.json.JSON;
3 4
 import com.baomidou.mybatisplus.annotation.*;
4 5
 import io.swagger.annotations.ApiModel;
5 6
 import io.swagger.annotations.ApiModelProperty;
@@ -34,6 +35,8 @@ public class TaPost implements Serializable, Cloneable {
34 35
     @ApiModelProperty(name = "文章标题", notes = "")
35 36
     private String title;
36 37
 
38
+
39
+    @TableField("`describe`") // 假设select是关键字
37 40
     @ApiModelProperty(name = "描述", notes = "")
38 41
     private String describe;
39 42
 

+ 62
- 0
application/src/main/java/com/lyg/application/entity/TdCategory.java View File

@@ -0,0 +1,62 @@
1
+package com.lyg.application.entity;
2
+
3
+import io.swagger.annotations.ApiModel;
4
+import io.swagger.annotations.ApiModelProperty;
5
+import com.baomidou.mybatisplus.annotation.*;
6
+import java.io.Serializable;
7
+import java.time.LocalDateTime;
8
+import lombok.Data;
9
+import lombok.EqualsAndHashCode;
10
+import lombok.experimental.Accessors;
11
+import javax.validation.constraints.NotBlank;
12
+
13
+/**
14
+ * 分类;
15
+ * @author : http://www.chiner.pro
16
+ * @date : 2024-3-25
17
+ */
18
+@Data
19
+@EqualsAndHashCode(callSuper = false)
20
+@Accessors(chain = true)
21
+@ApiModel(value = "分类",description = "")
22
+@TableName("td_category")
23
+public class TdCategory implements Serializable,Cloneable{
24
+
25
+    @ApiModelProperty(name = "分类Id",notes = "")
26
+    @TableId(value = "category_id", type = IdType.ASSIGN_UUID)
27
+    private String categoryId ;
28
+
29
+    @NotBlank(message = "分类名不能为空")
30
+    @ApiModelProperty(name = "分类名",notes = "")
31
+    private String categoryName ;
32
+
33
+    @ApiModelProperty(name = "上级单位;-1为根级目录",notes = "")
34
+    private String parentId ;
35
+
36
+    @ApiModelProperty(name = "序号",notes = "")
37
+    private Integer sortNo ;
38
+
39
+    @ApiModelProperty(name = "状态",notes = "0 不正常 1正常")
40
+    private Integer status ;
41
+
42
+    @ApiModelProperty(name = "",notes = "")
43
+    @TableField(fill = FieldFill.INSERT)
44
+    private LocalDateTime createdTime ;
45
+
46
+    @ApiModelProperty(name = "",notes = "")
47
+    @TableField(fill = FieldFill.INSERT)
48
+    private String createdBy ;
49
+
50
+    @ApiModelProperty(name = "",notes = "")
51
+    @TableField(fill = FieldFill.INSERT_UPDATE)
52
+    private LocalDateTime updatedTime ;
53
+
54
+    @ApiModelProperty(name = "",notes = "")
55
+    @TableField(fill = FieldFill.INSERT_UPDATE)
56
+    private String updatedBy ;
57
+
58
+    @ApiModelProperty(name = "",notes = "0 存在 1 删除")
59
+    @TableField(fill = FieldFill.INSERT)
60
+    private Integer deleted ;
61
+
62
+}

application/src/main/java/com/lyg/application/mapper/TaCategoryMapper.java → application/src/main/java/com/lyg/application/mapper/TdCategoryMapper.java View File

@@ -2,8 +2,7 @@ package com.lyg.application.mapper;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4
 import org.apache.ibatis.annotations.Mapper;
5
-import org.apache.ibatis.annotations.Param;
6
-import com.lyg.application.entity.TaCategory;
5
+import com.lyg.application.entity.TdCategory;
7 6
 
8 7
  /**
9 8
  * 分类;(ta_category)表数据库访问层
@@ -11,6 +10,6 @@ import com.lyg.application.entity.TaCategory;
11 10
  * @date : 2024-3-22
12 11
  */
13 12
 @Mapper
14
-public interface TaCategoryMapper  extends BaseMapper<TaCategory>{
13
+public interface TdCategoryMapper extends BaseMapper<TdCategory>{
15 14
     
16 15
 }

+ 0
- 14
application/src/main/java/com/lyg/application/service/TaCategoryService.java View File

@@ -1,14 +0,0 @@
1
-package com.lyg.application.service;
2
-
3
-import com.baomidou.mybatisplus.extension.service.IService;
4
-import com.lyg.application.entity.TaCategory;
5
-import com.lyg.system.service.IBaseService;
6
-
7
- /**
8
- * 分类;(ta_category)表服务接口
9
- * @author : http://njyunzhi.com
10
- * @date : 2024-3-22
11
- */
12
-public interface TaCategoryService extends IBaseService<TaCategory> {
13
-    
14
-}

+ 14
- 0
application/src/main/java/com/lyg/application/service/TdCategoryService.java View File

@@ -0,0 +1,14 @@
1
+package com.lyg.application.service;
2
+
3
+import com.lyg.application.entity.TdCategory;
4
+import com.lyg.system.service.IBaseService;
5
+
6
+/**
7
+ * 分类;(td_category)表服务接口
8
+ *
9
+ * @author : http://njyunzhi.com
10
+ * @date : 2024-3-25
11
+ */
12
+public interface TdCategoryService extends IBaseService<TdCategory> {
13
+
14
+}

+ 0
- 18
application/src/main/java/com/lyg/application/service/impl/TaCategoryServiceImpl.java View File

@@ -1,18 +0,0 @@
1
-package com.lyg.application.service.impl;
2
-
3
-import com.lyg.system.service.impl.BaseServiceImpl;
4
-import org.springframework.beans.factory.annotation.Autowired;
5
-import org.springframework.stereotype.Service;
6
-import com.lyg.application.entity.TaCategory;
7
-import com.lyg.application.mapper.TaCategoryMapper;
8
-import com.lyg.application.service.TaCategoryService;
9
-
10
- /**
11
- * 分类;(ta_category)表服务实现类
12
- * @author : http://www.chiner.pro
13
- * @date : 2024-3-22
14
- */
15
-@Service
16
-public class TaCategoryServiceImpl extends BaseServiceImpl<TaCategoryMapper, TaCategory> implements TaCategoryService {
17
-    
18
-}

+ 13
- 8
application/src/main/java/com/lyg/application/service/impl/TaPostServiceImpl.java View File

@@ -13,7 +13,6 @@ import com.lyg.system.service.impl.BaseServiceImpl;
13 13
 import org.springframework.beans.factory.annotation.Autowired;
14 14
 import org.springframework.stereotype.Service;
15 15
 
16
-import java.util.ArrayList;
17 16
 import java.util.List;
18 17
 
19 18
 /**
@@ -46,16 +45,22 @@ public class TaPostServiceImpl extends BaseServiceImpl<TaPostMapper, TaPost> imp
46 45
         taSourceAttach.setAttachId(attachId);
47 46
         taSourceAttachMapper.insert(taSourceAttach);
48 47
 
49
-
50
-        //保存所有的附件
51
-        List<TaAttach> taAttachList = new ArrayList<>();
52
-        for (TaAttach item : taPost.getTaAttachList()) {
53
-            item.setAttachId(attachId);
54
-            taAttachList.add(item);
48
+        if (taPost.getTaAttachList() != null) {
49
+
50
+            //保存所有的附件
51
+            for (TaAttach item : taPost.getTaAttachList()) {
52
+                if (item.getAttachId() == null) {
53
+                    item.setAttachId(attachId);
54
+                    taAttachMapper.insert(item);
55
+                } else {
56
+                    taAttachMapper.updateById(item);
57
+                }
58
+            }
55 59
         }
56 60
 
57
-        taAttachService.saveBatch(taAttachList);
58 61
 
62
+        taPost.setPostId(postId);
63
+        baseMapper.insert(taPost);
59 64
 
60 65
     }
61 66
 

+ 18
- 0
application/src/main/java/com/lyg/application/service/impl/TdCategoryServiceImpl.java View File

@@ -0,0 +1,18 @@
1
+package com.lyg.application.service.impl;
2
+
3
+import com.lyg.application.entity.TdCategory;
4
+import com.lyg.application.mapper.TdCategoryMapper;
5
+import com.lyg.application.service.TdCategoryService;
6
+import com.lyg.system.service.impl.BaseServiceImpl;
7
+import org.springframework.stereotype.Service;
8
+
9
+/**
10
+ * 分类;(td_category)表服务实现类
11
+ *
12
+ * @author : http://www.chiner.pro
13
+ * @date : 2024-3-25
14
+ */
15
+@Service
16
+public class TdCategoryServiceImpl extends BaseServiceImpl<TdCategoryMapper, TdCategory> implements TdCategoryService {
17
+
18
+}

+ 1
- 0
application/src/main/resources/application.yml View File

@@ -64,5 +64,6 @@ yz:
64 64
       - "/static/**"
65 65
       - "/h5/**"
66 66
       - "/sysUser/current"
67
+      - "/login/**"
67 68
 #  excel-tpl-path: E:\work\Java+web\17填报系统\performance-reporting-service\application\src\main\resources\
68 69
 

+ 1
- 1
application/src/main/resources/mapper/TaAttachMapper.xml View File

@@ -6,7 +6,7 @@
6 6
     <select id="getAttachList" resultType="com.lyg.application.entity.TaAttach">
7 7
         select * FROM ta_attach  a
8 8
         WHERE
9
-        a.source_id = #{attachId}
9
+        a.attach_id = #{attachId}
10 10
         AND a.`status` = 1
11 11
         AND a.deleted = 0
12 12
     </select>

application/src/main/resources/mapper/TaCategoryMapper.xml → application/src/main/resources/mapper/TdCategoryMapper.xml View File

@@ -1,6 +1,6 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 
4
-<mapper namespace="com.lyg.application.mapper.TaCategoryMapper">
4
+<mapper namespace="com.lyg.application.mapper.TdCategoryMapper">
5 5
     
6 6
 </mapper>

+ 0
- 8
framework/pom.xml View File

@@ -40,14 +40,6 @@
40 40
             <scope>runtime</scope>
41 41
         </dependency>
42 42
 
43
-        <!-- https://mvnrepository.com/artifact/com.oracle.database.nls/orai18n -->
44
-        <!-- gbk 字符支持 -->
45
-<!--        <dependency>-->
46
-<!--            <groupId>com.oracle.database.nls</groupId>-->
47
-<!--            <artifactId>orai18n</artifactId>-->
48
-<!--            <version>${orai18n.version}</version>-->
49
-<!--        </dependency>-->
50
-
51 43
 
52 44
         <!-- Sa-Token 权限认证, 在线文档:https://sa-token.cc/ -->
53 45
         <dependency>

+ 4
- 4
framework/src/main/java/com/lyg/framework/mybatisplus/MyMetaObjectHandler.java View File

@@ -30,8 +30,8 @@ public class MyMetaObjectHandler implements MetaObjectHandler {
30 30
             String tenantId = (String) request.getAttribute("tenantId");
31 31
             String userId = userService.getUserIdBy(user);
32 32
 
33
-            this.strictInsertFill(metaObject, "createAt", LocalDateTime::now, LocalDateTime.class);
34
-            this.strictInsertFill(metaObject, "updateAt", LocalDateTime::now, LocalDateTime.class);
33
+            this.strictInsertFill(metaObject, "createdTime", LocalDateTime::now, LocalDateTime.class);
34
+            this.strictInsertFill(metaObject, "updatedTime", LocalDateTime::now, LocalDateTime.class);
35 35
 
36 36
             if (user != null) {
37 37
                 this.strictInsertFill(metaObject, "createBy", () -> userId, String.class);
@@ -58,9 +58,9 @@ public class MyMetaObjectHandler implements MetaObjectHandler {
58 58
             String userId = userService.getUserIdBy(user);
59 59
             String userName = userService.getUserNameBy(user);
60 60
 
61
-            this.strictInsertFill(metaObject, "updateDate", LocalDateTime::now, LocalDateTime.class);
61
+            this.strictInsertFill(metaObject, "updatedTime", LocalDateTime::now, LocalDateTime.class);
62 62
             if (user != null) {
63
-                this.strictInsertFill(metaObject, "updateUser", () -> userId, String.class);
63
+                this.strictInsertFill(metaObject, "updateBy", () -> userId, String.class);
64 64
             }
65 65
         } catch (Exception e) {
66 66
             e.printStackTrace();

+ 1
- 1
framework/src/main/java/com/lyg/framework/mybatisplus/MybatisPlusConfig.java View File

@@ -30,7 +30,7 @@ public class MybatisPlusConfig {
30 30
         MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
31 31
 
32 32
         // 分页插件
33
-        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.ORACLE));
33
+        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
34 34
 
35 35
         if (tenantConfig.getEnabled()) {
36 36
             // 多租户插件

+ 7
- 7
framework/src/main/java/com/lyg/framework/satoken/SaServletFilter2.java View File

@@ -24,19 +24,19 @@ public class SaServletFilter2 implements Filter {
24 24
     @Override
25 25
     public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
26 26
         // 只有登录之后才行
27
-        if (StpUtil.isLogin()) {
27
+//        if (StpUtil.isLogin()) {
28 28
             appendUser(servletRequest);
29
-        }
29
+//        }
30 30
 
31 31
         //
32 32
         filterChain.doFilter(servletRequest, servletResponse);
33 33
     }
34 34
 
35 35
     private void appendUser(ServletRequest request) {
36
-        Object user = userService.getUserBy(StpUtil.getLoginId());
37
-        if (null != user) {
38
-            request.setAttribute("user", user);
39
-        }
40
-        request.setAttribute("tenantId", userService.getTenantIdBy(user));
36
+//        Object user = userService.getUserBy(StpUtil.getLoginId());
37
+//        if (null != user) {
38
+//            request.setAttribute("user", user);
39
+//        }
40
+//        request.setAttribute("tenantId", userService.getTenantIdBy(user));
41 41
     }
42 42
 }

+ 9
- 9
framework/src/main/java/com/lyg/framework/satoken/SaTokenConfigure.java View File

@@ -24,15 +24,15 @@ public class SaTokenConfigure {
24 24
         SaServletFilter saServletFilter = new SaServletFilter();
25 25
         saServletFilter.addInclude("/**");
26 26
         saServletFilter.addExclude(filterConfig.getAnnList().toArray(new String[0]));
27
-        saServletFilter.setAuth(auth -> {
28
-            // OPTIONS 请求不校验, 主要是为了解决跨域问题
29
-            SaRouter.notMatch(SaHttpMethod.OPTIONS).check(r -> {
30
-                // 平台账户或者租户必须登录一个
31
-                if (!StpUtil.isLogin()) {
32
-                    throw new SaTokenException("请登录后再访问接口");
33
-                }
34
-            });
35
-        });
27
+//        saServletFilter.setAuth(auth -> {
28
+//            // OPTIONS 请求不校验, 主要是为了解决跨域问题
29
+//            SaRouter.notMatch(SaHttpMethod.OPTIONS).check(r -> {
30
+//                // 平台账户或者租户必须登录一个
31
+//                if (!StpUtil.isLogin()) {
32
+//                    throw new SaTokenException("请登录后再访问接口");
33
+//                }
34
+//            });
35
+//        });
36 36
 
37 37
         saServletFilter.setError(err -> {
38 38
             SaHolder.getResponse().setHeader("Content-Type", "application/json;charset=UTF-8");

+ 19
- 19
framework/src/main/resources/framework.yml View File

@@ -46,22 +46,22 @@ tenant:
46 46
 access-limit:
47 47
   enabled: false
48 48
 
49
-sa-token:
50
-  # jwt秘钥
51
-  jwt-secret-key: d4d778d279cf11ed9b1d525400e8554f
52
-  # token名称 (同时也是cookie名称)
53
-  token-name: Authorization
54
-  # token有效期,单位s 默认30天, -1代表永不过期
55
-  timeout: 2592000
56
-  # token临时有效期 (指定时间内无操作就视为token过期) 单位: 秒
57
-  activity-timeout: -1
58
-  # 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)
59
-  is-concurrent: true
60
-  # 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token)
61
-  is-share: true
62
-  # token风格
63
-  token-style: uuid
64
-  # 是否输出操作日志
65
-  is-log: false
66
-  # 是否尝试从 cookie 里读取 Token
67
-  is-read-cookie: false
49
+#sa-token:
50
+#  # jwt秘钥
51
+#  jwt-secret-key: d4d778d279cf11ed9b1d525400e8554f
52
+#  # token名称 (同时也是cookie名称)
53
+#  token-name: Authorization
54
+#  # token有效期,单位s 默认30天, -1代表永不过期
55
+#  timeout: 2592000
56
+#  # token临时有效期 (指定时间内无操作就视为token过期) 单位: 秒
57
+#  activity-timeout: -1
58
+#  # 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)
59
+#  is-concurrent: true
60
+#  # 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token)
61
+#  is-share: true
62
+#  # token风格
63
+#  token-style: uuid
64
+#  # 是否输出操作日志
65
+#  is-log: false
66
+#  # 是否尝试从 cookie 里读取 Token
67
+#  is-read-cookie: false

+ 3
- 3
system/src/main/java/com/lyg/system/controller/BaseController.java View File

@@ -48,9 +48,9 @@ public class BaseController {
48 48
      */
49 49
     public SysUser currentUser() throws Exception {
50 50
         String loginId = StpUtil.getLoginIdAsString();
51
-        if (StringUtil.isEmpty(loginId)) {
52
-            throw new Exception("请先登录");
53
-        }
51
+//        if (StringUtil.isEmpty(loginId)) {
52
+//            throw new Exception("请先登录");
53
+//        }
54 54
         sysUserService.getById(loginId);
55 55
 
56 56
         SysUser user = sysUserService.getById(loginId);

+ 2
- 2
system/src/main/java/com/lyg/system/controller/SysLogController.java View File

@@ -60,8 +60,8 @@ public class SysLogController extends BaseController {
60 60
         QueryWrapper<SysLog> queryWrapper = new QueryWrapper<>();
61 61
         queryWrapper.like(StringUtil.isNotEmpty(moduleName), "module_name", moduleName);
62 62
         queryWrapper.like(StringUtil.isNotEmpty(userName), "user_name", userName);
63
-        queryWrapper.between(null != start, "create_date", start, end);
64
-        queryWrapper.orderByDesc("create_date");
63
+        queryWrapper.between(null != start, "created_time", start, end);
64
+        queryWrapper.orderByDesc("created_time");
65 65
         IPage<SysLog> result = sysLogService.page(pg, queryWrapper);
66 66
 
67 67
         return SaResult.data(result);

+ 1
- 1
system/src/main/java/com/lyg/system/controller/SysPositionController.java View File

@@ -61,7 +61,7 @@ public class SysPositionController extends BaseController {
61 61
                             @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
62 62
                          @ApiParam("岗位名字") @RequestParam(value ="name", required = false) String name,
63 63
                          @ApiParam("正序排列") @RequestParam(value ="sortAsc", required = false) String sortAsc,
64
-                         @ApiParam("倒序排列") @RequestParam(value ="sortDesc", defaultValue = "create_date") String sortDesc) throws Exception {
64
+                         @ApiParam("倒序排列") @RequestParam(value ="sortDesc", defaultValue = "created_time") String sortDesc) throws Exception {
65 65
         
66 66
         IPage<SysPosition> pg = new Page<>(pageNum, pageSize);
67 67
         QueryWrapper<SysPosition> queryWrapper = new QueryWrapper<>();

+ 23
- 23
system/src/main/java/com/lyg/system/controller/SysUserController.java View File

@@ -76,28 +76,28 @@ public class SysUserController extends BaseController {
76 76
                             @ApiParam("sso ticket") @RequestParam(value = "appid", required = false) String appid) throws Exception {
77 77
         Map<String, Object> res = new HashMap<>();
78 78
         Boolean isLogin= StpUtil.isLogin();
79
-        if (!isLogin) {
80
-
81
-            if (!StringUtil.isEmpty(ticket)) {
82
-                // 如果是 SSO 登录
83
-                Object loginId = SaSsoProcessor.instance.checkTicket(ticket, "/sysUser/current");
84
-                if(loginId != null) {
85
-                    StpUtil.login(loginId, appid);
86
-                    res.put("token", StpUtil.getTokenValue());
87
-                } else {
88
-                    return SaResult.error("无效 Ticket").setCode(401);
89
-                }
90
-            } else {
91
-                return SaResult.error("请先登录").setCode(401);
92
-            }
93
-        }
94
-
95
-        SysUser sysUser = currentUser();
96
-
97
-        sysUser.setRolesList(sysRoleService.getByUser(sysUser.getUserId()));
98
-        sysUser.setMenuList(sysMenuService.getByUser(sysUser.getUserId()));
99
-
100
-        res.put("user", sysUser);
79
+//        if (!isLogin) {
80
+//
81
+//            if (!StringUtil.isEmpty(ticket)) {
82
+//                // 如果是 SSO 登录
83
+//                Object loginId = SaSsoProcessor.instance.checkTicket(ticket, "/sysUser/current");
84
+//                if(loginId != null) {
85
+//                    StpUtil.login(loginId, appid);
86
+//                    res.put("token", StpUtil.getTokenValue());
87
+//                } else {
88
+//                    return SaResult.error("无效 Ticket").setCode(401);
89
+//                }
90
+//            } else {
91
+//                return SaResult.error("请先登录").setCode(401);
92
+//            }
93
+//        }
94
+
95
+//        SysUser sysUser = currentUser();
96
+
97
+//        sysUser.setRolesList(sysRoleService.getByUser(sysUser.getUserId()));
98
+//        sysUser.setMenuList(sysMenuService.getByUser(sysUser.getUserId()));
99
+//
100
+//        res.put("user", sysUser);
101 101
         return SaResult.data(res);
102 102
     }
103 103
 
@@ -142,7 +142,7 @@ public class SysUserController extends BaseController {
142 142
         queryWrapper.like(!StringUtil.isEmpty(phone), "phone", phone);
143 143
         queryWrapper.gt("status", Constants.STATUS_DELETE);
144 144
         queryWrapper.ne("user_id", Constants.ROOT_ID);
145
-        queryWrapper.orderByDesc("create_date");
145
+        queryWrapper.orderByDesc("created_time");
146 146
         IPage<SysUser> result = sysUserService.page(pg, queryWrapper);
147 147
 
148 148
         return SaResult.data(result);