大大的豆芽 пре 6 месеци
родитељ
комит
914240e504
49 измењених фајлова са 4715 додато и 133 уклоњено
  1. 12 0
      yiqi-admin/pom.xml
  2. 1 1
      yiqi-admin/src/main/java/com/yiqi/YiQiServletInitializer.java
  3. 2 3
      yiqi-admin/src/main/java/com/yiqi/YiQiWebApplication.java
  4. 59 0
      yiqi-admin/src/main/java/com/yiqi/web/controller/common/CommonController.java
  5. 4 0
      yiqi-admin/src/main/java/com/yiqi/web/controller/system/SysConfigController.java
  6. 134 0
      yiqi-admin/src/main/java/com/yiqi/web/controller/system/SysConfigRecordController.java
  7. 524 0
      yiqi-admin/src/main/java/com/yiqi/web/controller/system/SysConfigTabController.java
  8. 208 16
      yiqi-admin/src/main/java/com/yiqi/web/controller/system/SysDataGroupController.java
  9. 11 0
      yiqi-admin/src/main/java/com/yiqi/web/controller/system/SysDocumentController.java
  10. 126 0
      yiqi-admin/src/main/java/com/yiqi/web/controller/system/SysMessageConfigController.java
  11. 129 0
      yiqi-admin/src/main/resources/1.json
  12. 117 0
      yiqi-api/src/main/java/com/yiqi/api/controller/system/WeAppCommonController.java
  13. 2 2
      yiqi-api/src/main/java/com/yiqi/api/controller/system/WeAppDocumentController.java
  14. 0 1
      yiqi-api/src/main/java/com/yiqi/interceptor/AuthInterceptor.java
  15. 24 0
      yiqi-common/src/main/java/com/yiqi/common/annotation/GmLog.java
  16. 5 0
      yiqi-common/src/main/java/com/yiqi/common/constant/CacheConstants.java
  17. 65 0
      yiqi-common/src/main/java/com/yiqi/msg/dto/MessageKeywordMappingDto.java
  18. 45 0
      yiqi-common/src/main/java/com/yiqi/msg/dto/MessagePushDto.java
  19. 19 0
      yiqi-common/src/main/java/com/yiqi/msg/service/UnifiedPushService.java
  20. 151 0
      yiqi-common/src/main/java/com/yiqi/msg/service/impl/UnifiedPushServiceImpl.java
  21. 70 23
      yiqi-common/src/main/java/com/yiqi/system/domain/ManageFactory.java
  22. 155 0
      yiqi-common/src/main/java/com/yiqi/system/domain/SysConfigRecord.java
  23. 99 0
      yiqi-common/src/main/java/com/yiqi/system/domain/SysConfigTab.java
  24. 30 19
      yiqi-common/src/main/java/com/yiqi/system/domain/SysDataGroup.java
  25. 31 22
      yiqi-common/src/main/java/com/yiqi/system/domain/SysDataGroupInfo.java
  26. 189 0
      yiqi-common/src/main/java/com/yiqi/system/domain/SysMessageConfig.java
  27. 24 0
      yiqi-common/src/main/java/com/yiqi/system/domain/dto/DataGroupFiled.java
  28. 71 0
      yiqi-common/src/main/java/com/yiqi/system/domain/dto/DataGroupHeader.java
  29. 336 0
      yiqi-common/src/main/java/com/yiqi/system/domain/dto/DataGroupRules.java
  30. 94 0
      yiqi-common/src/main/java/com/yiqi/system/domain/dto/SysConfigTabDto.java
  31. 117 0
      yiqi-common/src/main/java/com/yiqi/system/service/ISysConfigRecordService.java
  32. 84 0
      yiqi-common/src/main/java/com/yiqi/system/service/ISysConfigTabService.java
  33. 12 7
      yiqi-common/src/main/java/com/yiqi/system/service/ISysDataGroupInfoService.java
  34. 7 2
      yiqi-common/src/main/java/com/yiqi/system/service/ISysDataGroupService.java
  35. 80 0
      yiqi-common/src/main/java/com/yiqi/system/service/ISysMessageConfigService.java
  36. 252 0
      yiqi-framework/src/main/java/com/yiqi/framework/aspectj/GmLogAspect.java
  37. 3 4
      yiqi-generator/src/main/resources/vm/vue/index.vue.vm
  38. 65 0
      yiqi-system/src/main/java/com/yiqi/system/mapper/SysConfigRecordMapper.java
  39. 65 0
      yiqi-system/src/main/java/com/yiqi/system/mapper/SysConfigTabMapper.java
  40. 64 0
      yiqi-system/src/main/java/com/yiqi/system/mapper/SysMessageConfigMapper.java
  41. 193 0
      yiqi-system/src/main/java/com/yiqi/system/service/impl/SysConfigRecordServiceImpl.java
  42. 117 0
      yiqi-system/src/main/java/com/yiqi/system/service/impl/SysConfigTabServiceImpl.java
  43. 27 21
      yiqi-system/src/main/java/com/yiqi/system/service/impl/SysDataGroupInfoServiceImpl.java
  44. 13 4
      yiqi-system/src/main/java/com/yiqi/system/service/impl/SysDataGroupServiceImpl.java
  45. 115 0
      yiqi-system/src/main/java/com/yiqi/system/service/impl/SysMessageConfigServiceImpl.java
  46. 244 0
      yiqi-system/src/main/resources/mapper/system/SysConfigRecordMapper.xml
  47. 157 0
      yiqi-system/src/main/resources/mapper/system/SysConfigTabMapper.xml
  48. 8 8
      yiqi-system/src/main/resources/mapper/system/SysDataGroupInfoMapper.xml
  49. 355 0
      yiqi-system/src/main/resources/mapper/system/SysMessageConfigMapper.xml

+ 12 - 0
yiqi-admin/pom.xml

@@ -38,6 +38,18 @@
             <version>1.2.78</version>
         </dependency>
 
+        <dependency>
+            <groupId>org.jeecgframework.jimureport</groupId>
+            <artifactId>jimureport-spring-boot-starter</artifactId>
+            <version>1.9.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.jeecgframework.jimureport</groupId>
+            <artifactId>jimureport-dashboard-spring-boot-starter</artifactId>
+            <version>1.9.0</version>
+        </dependency>
+
         <!--        &lt;!&ndash; swagger3&ndash;&gt;-->
         <!--        <dependency>-->
         <!--            <groupId>io.springfox</groupId>-->

+ 1 - 1
yiqi-admin/src/main/java/com/yiqi/YiQiServletInitializer.java

@@ -11,6 +11,6 @@ import org.springframework.boot.web.servlet.support.SpringBootServletInitializer
 public class YiQiServletInitializer extends SpringBootServletInitializer {
     @Override
     protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
-        return application.sources(YiQiApplication.class);
+        return application.sources(YiQiWebApplication.class);
     }
 }

+ 2 - 3
yiqi-admin/src/main/java/com/yiqi/YiQiApplication.java → yiqi-admin/src/main/java/com/yiqi/YiQiWebApplication.java

@@ -7,7 +7,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.domain.EntityScan;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
 import org.springframework.boot.web.servlet.ServletComponentScan;
-import org.springframework.context.annotation.ComponentScan;
 import org.springframework.scheduling.annotation.EnableScheduling;
 
 /**
@@ -21,9 +20,9 @@ import org.springframework.scheduling.annotation.EnableScheduling;
 @MapperScan("com.yiqi.**.mapper")
 @EnableScheduling
 @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
-public class YiQiApplication {
+public class YiQiWebApplication {
     public static void main(String[] args) {
-        SpringApplication.run(YiQiApplication.class, args);
+        SpringApplication.run(YiQiWebApplication.class, args);
         System.out.println("(♥◠‿◠)ノ゙  一七生活启动成功   ლ(´ڡ`ლ)゙  \n" +
                 " .-------.       ____     __        \n" +
                 " |  _ _   \\      \\   \\   /  /    \n" +

+ 59 - 0
yiqi-admin/src/main/java/com/yiqi/web/controller/common/CommonController.java

@@ -196,6 +196,65 @@ public class CommonController {
         return R.fail();
     }
 
+    @Anonymous
+    @ApiOperation("wangEditor上传文件到腾讯云OSS")
+    @PostMapping(value = "uploadWangOSS")
+    public Object uploadWangOSS(HttpServletRequest request) throws Exception {
+        List items = ((MultipartRequest) request).getFiles("file");
+        System.out.println("itemsSize:" + items.size());
+        Map res = new HashMap();
+        List<Map> uploadOSSVOS = new ArrayList<>();
+        Iterator itr = items.iterator();
+        while (itr.hasNext()) {
+            MultipartFile item = (MultipartFile) itr.next();
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
+            String date = sdf.format(new Date());
+            String key = "image/" + date + "/";
+            if (!"image".equals(item.getContentType().split("/")[0])) {
+                key = "file/" + date + "/";
+            }
+            String fileName = java.util.UUID.randomUUID().toString().replaceAll("-", "") + "."
+                    + item.getOriginalFilename().substring(item.getOriginalFilename().lastIndexOf(".") + 1);
+            //上传文件
+            String suffix = item.getOriginalFilename().substring(item.getOriginalFilename().lastIndexOf("."));
+            String url = OSSFactory.build(cloudStorageConfig).uploadSuffix(item.getBytes(), suffix);
+            Map<String, String> map = new HashMap<>();
+            map.put("url", url);
+            map.put("alt", fileName);
+            map.put("href", "");
+            uploadOSSVOS.add(map);
+        }
+        res.put("errno", 0);
+        res.put("data", uploadOSSVOS);
+        return res;
+    }
+
+
+    @Anonymous
+    @ApiOperation("wangEditor上传视频文件到腾讯云OSS")
+    @PostMapping(value = "uploadWangVideoOSS")
+    public Object uploadWangVideoOSS(HttpServletRequest request) throws Exception {
+        List items = ((MultipartRequest) request).getFiles("video");
+        System.out.println("videoSize:" + items.size());
+        Map res = new HashMap();
+        Map<String, String> map = new HashMap<>();
+        Iterator itr = items.iterator();
+        while (itr.hasNext()) {
+            MultipartFile item = (MultipartFile) itr.next();
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
+            String date = sdf.format(new Date());
+            String fileName = java.util.UUID.randomUUID().toString().replaceAll("-", "") + "."
+                    + item.getOriginalFilename().substring(item.getOriginalFilename().lastIndexOf(".") + 1);
+            //上传文件
+            String suffix = item.getOriginalFilename().substring(item.getOriginalFilename().lastIndexOf("."));
+            String url = OSSFactory.build(cloudStorageConfig).uploadSuffix(item.getBytes(), suffix);
+            map.put("url", url);
+        }
+        res.put("errno", 0);
+        res.put("data", map);
+        return res;
+    }
+
 //    @Anonymous
 //    @ApiOperation("上传文件到腾讯云OSS")
 //    @PostMapping(value = "uploadOSS")

+ 4 - 0
yiqi-admin/src/main/java/com/yiqi/web/controller/system/SysConfigController.java

@@ -3,6 +3,7 @@ package com.yiqi.web.controller.system;
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
+import com.yiqi.system.service.ISysConfigRecordService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
@@ -34,6 +35,8 @@ import com.yiqi.system.service.ISysConfigService;
 public class SysConfigController extends BaseController {
     @Autowired
     private ISysConfigService configService;
+    @Autowired
+    private ISysConfigRecordService configRecordService;
 
     /**
      * 获取参数配置列表
@@ -119,6 +122,7 @@ public class SysConfigController extends BaseController {
     @DeleteMapping("/refreshCache")
     public AjaxResult refreshCache() {
         configService.resetConfigCache();
+        configRecordService.resetConfigCache();
         return success();
     }
 }

+ 134 - 0
yiqi-admin/src/main/java/com/yiqi/web/controller/system/SysConfigRecordController.java

@@ -0,0 +1,134 @@
+package com.yiqi.web.controller.system;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.yiqi.common.constant.UrlConstants;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.yiqi.common.annotation.Log;
+import com.yiqi.common.core.controller.BaseController;
+import com.yiqi.common.core.domain.AjaxResult;
+import com.yiqi.common.enums.BusinessType;
+import com.yiqi.system.domain.SysConfigRecord;
+import com.yiqi.system.service.ISysConfigRecordService;
+import com.yiqi.common.utils.poi.ExcelUtil;
+import com.yiqi.common.core.page.TableDataInfo;
+
+/**
+ * 配置Controller
+ *
+ * @author douya
+ * @date 2024-11-01
+ */
+@Api(tags = "管理后台 - 配置")
+@RestController
+@RequestMapping(UrlConstants.managerApi + "/system/configRecord")
+public class SysConfigRecordController extends BaseController {
+    @Autowired
+    private ISysConfigRecordService sysConfigRecordService;
+
+
+    //<editor-folder desc="基础函数">
+
+    /**
+     * 查询配置列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:configRecord:list')")
+    @GetMapping("/list")
+    @ApiOperation(value = "查询配置列表")
+    public TableDataInfo list(SysConfigRecord sysConfigRecord) {
+        startPage();
+        List<SysConfigRecord> list = sysConfigRecordService.selectSysConfigRecordList(sysConfigRecord);
+        return getDataTable(list);
+    }
+
+
+    /**
+     * 导出配置列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:configRecord:export')")
+    @Log(title = "配置", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    @ApiOperation(value = "导出配置列表")
+    public void export(HttpServletResponse response, SysConfigRecord sysConfigRecord) {
+        List<SysConfigRecord> list = sysConfigRecordService.selectSysConfigRecordList(sysConfigRecord);
+        ExcelUtil<SysConfigRecord> util = new ExcelUtil<SysConfigRecord>(SysConfigRecord.class);
+        util.exportExcel(response, list, "配置数据");
+    }
+
+    /**
+     * 获取配置详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:configRecord:query')")
+    @GetMapping(value = "/{id}")
+    @ApiOperation(value = "获取配置详细信息")
+    public AjaxResult getInfo(@PathVariable("id") Integer id) {
+        return success(sysConfigRecordService.selectSysConfigRecordById(id));
+    }
+
+    /**
+     * 新增配置
+     */
+    @PreAuthorize("@ss.hasPermi('system:configRecord:add')")
+    @Log(title = "配置", businessType = BusinessType.INSERT)
+    @PostMapping
+    @ApiOperation(value = "新增配置")
+    public AjaxResult add(@RequestBody SysConfigRecord sysConfigRecord) {
+        return toAjax(sysConfigRecordService.insertSysConfigRecord(sysConfigRecord));
+    }
+
+    /**
+     * 修改配置
+     */
+    @PreAuthorize("@ss.hasPermi('system:configRecord:edit')")
+    @Log(title = "配置", businessType = BusinessType.UPDATE)
+    @PutMapping
+    @ApiOperation(value = "修改配置")
+    public AjaxResult edit(@RequestBody SysConfigRecord sysConfigRecord) {
+        return toAjax(sysConfigRecordService.updateSysConfigRecord(sysConfigRecord));
+    }
+
+    /**
+     * 删除配置
+     */
+    @PreAuthorize("@ss.hasPermi('system:configRecord:remove')")
+    @Log(title = "配置", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    @ApiOperation(value = "删除配置")
+    public AjaxResult remove(@PathVariable Integer[] ids) {
+        return toAjax(sysConfigRecordService.deleteSysConfigRecordByIds(ids));
+    }
+
+    /**
+     * 修改配置状态
+     */
+    @PreAuthorize("@ss.hasPermi('system:configRecord:edit')")
+    @Log(title = "配置", businessType = BusinessType.UPDATE)
+    @PostMapping(value = "updateStatus")
+    @ApiOperation(value = "修改配置状态")
+    public AjaxResult updateSysConfigRecordStatus(@RequestBody SysConfigRecord sysConfigRecord) {
+        return toAjax(sysConfigRecordService.updateSysConfigRecordStatus(sysConfigRecord));
+    }
+
+    /**
+     * 删除配置分类
+     */
+    @DeleteMapping("/setting/{id}")
+    @ApiOperation(value = "删除配置分类")
+    public AjaxResult remove(@PathVariable Integer id) {
+        return toAjax(sysConfigRecordService.deleteSysConfigRecordById(id));
+    }
+
+
+}

+ 524 - 0
yiqi-admin/src/main/java/com/yiqi/web/controller/system/SysConfigTabController.java

@@ -0,0 +1,524 @@
+package com.yiqi.web.controller.system;
+
+import java.util.*;
+import javax.servlet.http.HttpServletResponse;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.json.JSONArray;
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.github.pagehelper.PageInfo;
+import com.yiqi.common.constant.UrlConstants;
+import com.yiqi.system.domain.SysConfig;
+import com.yiqi.system.domain.SysConfigRecord;
+import com.yiqi.system.domain.SysDataGroupInfo;
+import com.yiqi.system.domain.dto.DataGroupRules;
+import com.yiqi.system.domain.dto.SysConfigTabDto;
+import com.yiqi.system.service.ISysConfigRecordService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.yiqi.common.annotation.Log;
+import com.yiqi.common.core.controller.BaseController;
+import com.yiqi.common.core.domain.AjaxResult;
+import com.yiqi.common.enums.BusinessType;
+import com.yiqi.system.domain.SysConfigTab;
+import com.yiqi.system.service.ISysConfigTabService;
+import com.yiqi.common.utils.poi.ExcelUtil;
+import com.yiqi.common.core.page.TableDataInfo;
+
+/**
+ * 配置分类Controller
+ *
+ * @author douya
+ * @date 2024-11-01
+ */
+@Api(tags = "管理后台 - 配置分类")
+@RestController
+@RequestMapping(UrlConstants.managerApi + "/system/configTab")
+public class SysConfigTabController extends BaseController {
+    @Autowired
+    private ISysConfigTabService sysConfigTabService;
+
+    @Autowired
+    private ISysConfigRecordService sysConfigRecordService;
+
+    /**
+     * 查询配置分类列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:configTab:list')")
+    @GetMapping("/list")
+    @ApiOperation(value = "查询配置分类列表")
+    public TableDataInfo list(SysConfigTab sysConfigTab) {
+        startPage();
+        List<SysConfigTab> list = sysConfigTabService.selectSysConfigTabList(sysConfigTab);
+        return getDataTable(list);
+    }
+
+    /**
+     * 查询配置分类列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:configTab:list')")
+    @GetMapping("/config_class")
+    @ApiOperation(value = "查询配置分类列表")
+    public TableDataInfo configClass(String title, Integer status) {
+        startPage();
+        SysConfigTab sysConfigTab = new SysConfigTab();
+        sysConfigTab.setTitle(title);
+        sysConfigTab.setStatus(status);
+        List<SysConfigTab> list = sysConfigTabService.selectSysConfigTabList(sysConfigTab);
+        List<SysConfigTabDto> listDto = new ArrayList<>();
+        for (SysConfigTab tab : list) {
+            SysConfigTabDto dto = new SysConfigTabDto();
+            BeanUtil.copyProperties(tab, dto);
+            List<SysConfigTab> children = sysConfigTabService.selectSysConfigTabListByPid(tab.getId());
+            dto.setChildren(children);
+            listDto.add(dto);
+        }
+        return getDataTable(listDto, new PageInfo(list).getTotal());
+    }
+
+    /**
+     * 查询组合数据列表
+     */
+    @PostMapping("/config_class/set_status/{id}/{status}")
+    @ApiOperation(value = "数据状态更新")
+    public AjaxResult dataDelete(@PathVariable Integer id, @PathVariable Integer status) {
+        sysConfigTabService.update(new UpdateWrapper<SysConfigTab>().eq("id", id).set("status", status));
+        return success();
+    }
+
+    /**
+     * 导出配置分类列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:configTab:export')")
+    @Log(title = "配置分类", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    @ApiOperation(value = "导出配置分类列表")
+    public void export(HttpServletResponse response, SysConfigTab sysConfigTab) {
+        List<SysConfigTab> list = sysConfigTabService.selectSysConfigTabList(sysConfigTab);
+        ExcelUtil<SysConfigTab> util = new ExcelUtil<SysConfigTab>(SysConfigTab.class);
+        util.exportExcel(response, list, "配置分类数据");
+    }
+
+    /**
+     * 获取配置分类详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:configTab:query')")
+    @GetMapping(value = "/{id}")
+    @ApiOperation(value = "获取配置分类详细信息")
+    public AjaxResult getInfo(@PathVariable("id") Integer id) {
+        return success(sysConfigTabService.selectSysConfigTabById(id));
+    }
+
+    /**
+     * 新增配置分类
+     */
+    @PreAuthorize("@ss.hasPermi('system:configTab:add')")
+    @Log(title = "配置分类", businessType = BusinessType.INSERT)
+    @PostMapping
+    @ApiOperation(value = "新增配置分类")
+    public AjaxResult add(@RequestBody SysConfigTab sysConfigTab) {
+        return toAjax(sysConfigTabService.insertSysConfigTab(sysConfigTab));
+    }
+
+    /**
+     * 修改配置分类
+     */
+    @PreAuthorize("@ss.hasPermi('system:configTab:edit')")
+    @Log(title = "配置分类", businessType = BusinessType.UPDATE)
+    @PutMapping
+    @ApiOperation(value = "修改配置分类")
+    public AjaxResult edit(@RequestBody SysConfigTab sysConfigTab) {
+        return toAjax(sysConfigTabService.updateSysConfigTab(sysConfigTab));
+    }
+
+    /**
+     * 删除配置分类
+     */
+    @PreAuthorize("@ss.hasPermi('system:configTab:remove')")
+    @Log(title = "配置分类", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    @ApiOperation(value = "删除配置分类")
+    public AjaxResult remove(@PathVariable Integer[] ids) {
+        return toAjax(sysConfigTabService.deleteSysConfigTabByIds(ids));
+    }
+
+    /**
+     * 修改配置分类状态
+     */
+    @PreAuthorize("@ss.hasPermi('system:configTab:edit')")
+    @Log(title = "配置分类", businessType = BusinessType.UPDATE)
+    @PostMapping(value = "updateStatus")
+    @ApiOperation(value = "修改配置分类状态")
+    public AjaxResult updateSysConfigTabStatus(@RequestBody SysConfigTab sysConfigTab) {
+        return toAjax(sysConfigTabService.updateSysConfigTabStatus(sysConfigTab));
+    }
+
+    /**
+     * 获取组合数据详细信息
+     */
+    @GetMapping(value = "/setting/config")
+    @ApiOperation(value = "获取参数配置字段列表")
+    public AjaxResult settingConfig(Integer tab_id) {
+        List<SysConfigRecord> sysConfigRecordList = sysConfigRecordService.list(new QueryWrapper<SysConfigRecord>().eq("config_tab_id", tab_id).orderByDesc("sort"));
+        List list = new ArrayList();
+        for (SysConfigRecord sysConfigRecord : sysConfigRecordList) {
+            Map<String, Object> map = new HashMap<>();
+            BeanUtil.copyProperties(sysConfigRecord, map);
+            if (sysConfigRecord.getType().equals("upload") && sysConfigRecord.getValue() != null) {
+                map.put("value", Arrays.asList(sysConfigRecord.getValue().toString()));
+            }
+            list.add(map);
+        }
+        return success(list);
+    }
+
+    /**
+     * 查询组合数据列表
+     */
+    @PostMapping("/setting/set_status/{id}/{status}")
+    @ApiOperation(value = "数据状态更新")
+    public AjaxResult updateSysConfigRecordStatus(@PathVariable Integer id, @PathVariable Integer status) {
+        sysConfigRecordService.update(new UpdateWrapper<SysConfigRecord>().eq("id", id).set("status", status));
+        return success();
+    }
+
+    /**
+     * 获取组合数据详细信息
+     */
+    @PostMapping(value = "/saveForm/{tabId}")
+    @ApiOperation(value = "保存数据表单")
+    public AjaxResult saveForm(@PathVariable Integer tabId, @RequestBody String body) {
+        JSONObject jsonObject = JSONUtil.parseObj(body);
+        SysConfigRecord sysConfigRecord = new SysConfigRecord();
+        sysConfigRecord.setInfo(jsonObject.getStr("info"));
+        sysConfigRecord.setDescition(jsonObject.getStr("descition"));
+        sysConfigRecord.setHigh(jsonObject.getInt("high", 0));
+        sysConfigRecord.setWidth(jsonObject.getInt("width", 0));
+        sysConfigRecord.setType(jsonObject.getStr("type"));
+        sysConfigRecord.setValue(jsonObject.getStr("value", ""));
+        sysConfigRecord.setInputType(jsonObject.getStr("input_type"));
+        sysConfigRecord.setMenuName(jsonObject.getStr("menu_name"));
+        sysConfigRecord.setConfigTabId(tabId);
+        sysConfigRecord.setParameter(jsonObject.getStr("parameter"));
+        sysConfigRecord.setUploadType(jsonObject.getInt("upload_type", 1));
+        sysConfigRecord.setRequired(jsonObject.getStr("required"));
+        sysConfigRecord.setSort(jsonObject.getInt("sort", 0));
+        sysConfigRecord.setStatus(jsonObject.getInt("status", 1));
+        sysConfigRecordService.insertSysConfigRecord(sysConfigRecord);
+        return success();
+    }
+
+    /**
+     * 获取组合数据详细信息
+     */
+    @PostMapping(value = "/editForm/{id}")
+    @ApiOperation(value = "保存数据表单")
+    public AjaxResult editForm(@PathVariable Integer id, @RequestBody String body) {
+        JSONObject jsonObject = JSONUtil.parseObj(body);
+        SysConfigRecord sysConfigRecord = new SysConfigRecord();
+        sysConfigRecord.setId(id);
+        sysConfigRecord.setInfo(jsonObject.getStr("info"));
+        sysConfigRecord.setDescition(jsonObject.getStr("descition"));
+        sysConfigRecord.setHigh(jsonObject.getInt("high", 0));
+        sysConfigRecord.setWidth(jsonObject.getInt("width", 0));
+        sysConfigRecord.setType(jsonObject.getStr("type"));
+        sysConfigRecord.setValue(jsonObject.getStr("value", ""));
+        sysConfigRecord.setInputType(jsonObject.getStr("input_type"));
+        sysConfigRecord.setMenuName(jsonObject.getStr("menu_name"));
+        sysConfigRecord.setParameter(jsonObject.getStr("parameter"));
+        sysConfigRecord.setUploadType(jsonObject.getInt("upload_type", 1));
+        sysConfigRecord.setRequired(jsonObject.getStr("required"));
+        sysConfigRecord.setSort(jsonObject.getInt("sort", 0));
+        sysConfigRecord.setStatus(jsonObject.getInt("status", 1));
+        sysConfigRecordService.updateSysConfigRecord(sysConfigRecord);
+        return success();
+    }
+
+    /**
+     * 查询配置分类列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:configTab:list')")
+    @GetMapping("/create")
+    @ApiOperation(value = "查询配置分类列表")
+    public AjaxResult configCreate(Integer type, Integer tabId) {
+        Map map = new HashMap();
+        map.put("title", "添加字段");
+        map.put("status", true);
+        map.put("method", "POST");
+        map.put("info", "");
+        map.put("action", "/mapi/system/configTab/saveForm/" + tabId);
+        List<DataGroupRules> rulesList = new ArrayList<>();
+        DataGroupRules info = DataGroupRules.create("input", "info", "配置名称", null, null);
+        DataGroupRules menuName = DataGroupRules.create("input", "menu_name", "字段变量", "例如:site_url", null);
+        DataGroupRules desc = DataGroupRules.create("input", "descition", "表单说明", null, null);
+        DataGroupRules parameter = DataGroupRules.create("textarea", "parameter", "配置参数", "参数方式例如:\n1=男\n2=女\n3=保密", null);
+        DataGroupRules value = DataGroupRules.create("input", "value", "默认值", null, null);
+        DataGroupRules required = DataGroupRules.create("input", "required", "验证规则", "多个请用,隔开例如:required:true,url:true", null);
+        DataGroupRules sort = DataGroupRules.createSortHeader(0);
+        DataGroupRules status = DataGroupRules.createStatusHeader(1);
+        if (type.equals(0)) {
+            //单行文本框
+            DataGroupRules hidden = DataGroupRules.create("hidden", "type", null, null, "text");
+            DataGroupRules types = DataGroupRules.create("select", "input_type", "类型", "input=文本框\ndateTime=日期时间\ndate=日期\ntime=时间\ncolor=颜色\nnumber=数字", "");
+            DataGroupRules width = DataGroupRules.create("inputNumber", "width", "文本框宽", "", 100);
+            rulesList.add(hidden);
+            rulesList.add(types);
+            rulesList.add(info);
+            rulesList.add(menuName);
+            rulesList.add(desc);
+            rulesList.add(value);
+            rulesList.add(width);
+            rulesList.add(required);
+            rulesList.add(sort);
+            rulesList.add(status);
+        } else if (type.equals(1)) {
+            //多行文本框
+            DataGroupRules hidden = DataGroupRules.create("hidden", "type", null, null, "textarea");
+            DataGroupRules width = DataGroupRules.create("inputNumber", "width", "文本框宽", "", 100);
+            DataGroupRules high = DataGroupRules.create("inputNumber", "high", "多行文本框高", "", 5);
+            rulesList.add(hidden);
+            rulesList.add(info);
+            rulesList.add(menuName);
+            rulesList.add(desc);
+            rulesList.add(value);
+            rulesList.add(width);
+            rulesList.add(high);
+            rulesList.add(sort);
+            rulesList.add(status);
+        } else if (type.equals(2)) {
+            //单选框
+            DataGroupRules hidden = DataGroupRules.create("hidden", "type", null, null, "radio");
+            rulesList.add(hidden);
+            rulesList.add(info);
+            rulesList.add(menuName);
+            rulesList.add(desc);
+            rulesList.add(parameter);
+            rulesList.add(value);
+            rulesList.add(sort);
+            rulesList.add(status);
+        } else if (type.equals(3)) {
+            //文件上传
+            DataGroupRules hidden = DataGroupRules.create("hidden", "type", null, null, "upload");
+            DataGroupRules uploadType = DataGroupRules.create("radio", "upload_type", "上传类型", "1=单图\n2=多图\n3=文件", "1");
+            rulesList.add(hidden);
+            rulesList.add(info);
+            rulesList.add(menuName);
+            rulesList.add(desc);
+            rulesList.add(uploadType);
+            rulesList.add(sort);
+            rulesList.add(status);
+        } else if (type.equals(4)) {
+            //多选框
+            DataGroupRules hidden = DataGroupRules.create("hidden", "type", null, null, "checkbox");
+            rulesList.add(hidden);
+            rulesList.add(info);
+            rulesList.add(menuName);
+            rulesList.add(desc);
+            rulesList.add(parameter);
+            rulesList.add(sort);
+            rulesList.add(status);
+        } else if (type.equals(5)) {
+            //下拉框
+            DataGroupRules hidden = DataGroupRules.create("hidden", "type", null, null, "select");
+            rulesList.add(hidden);
+            rulesList.add(info);
+            rulesList.add(menuName);
+            rulesList.add(desc);
+            rulesList.add(parameter);
+            rulesList.add(sort);
+            rulesList.add(status);
+        } else if (type.equals(6)) {
+            //开关
+            DataGroupRules hidden = DataGroupRules.create("hidden", "type", null, null, "switch");
+            rulesList.add(hidden);
+            rulesList.add(info);
+            rulesList.add(menuName);
+            rulesList.add(desc);
+            rulesList.add(value);
+            rulesList.add(sort);
+            rulesList.add(status);
+        }
+        map.put("rules", rulesList);
+        return success(map);
+    }
+
+    /**
+     * 查询配置分类列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:configTab:list')")
+    @GetMapping("/update/{id}")
+    @ApiOperation(value = "編輯表单")
+    public AjaxResult configEdit(@PathVariable Integer id) {
+        SysConfigRecord sysConfigRecord = sysConfigRecordService.getById(id);
+        String type = sysConfigRecord.getType();
+        Map map = new HashMap();
+        map.put("title", "更新字段");
+        map.put("status", true);
+        map.put("method", "POST");
+        map.put("info", "");
+        map.put("action", "/mapi/system/configTab/editForm/" + id);
+        List<DataGroupRules> rulesList = new ArrayList<>();
+        DataGroupRules info = DataGroupRules.create("input", "info", "配置名称", null, sysConfigRecord.getInfo());
+        DataGroupRules menuName = DataGroupRules.create("input", "menu_name", "字段变量", "例如:site_url", sysConfigRecord.getMenuName());
+        DataGroupRules desc = DataGroupRules.create("input", "descition", "表单说明", null, sysConfigRecord.getDescition());
+        DataGroupRules parameter = DataGroupRules.create("textarea", "parameter", "配置参数", "参数方式例如:\n1=男\n2=女\n3=保密", sysConfigRecord.getParameter());
+        DataGroupRules value = DataGroupRules.create("input", "value", "默认值", null, sysConfigRecord.getValue());
+        DataGroupRules required = DataGroupRules.create("input", "required", "验证规则", "多个请用,隔开例如:required:true,url:true", sysConfigRecord.getRequired());
+        DataGroupRules sort = DataGroupRules.createSortHeader(0);
+        DataGroupRules status = DataGroupRules.createStatusHeader(1);
+        if (type.equals("text")) {
+            //单行文本框
+            DataGroupRules hidden = DataGroupRules.create("hidden", "type", null, null, "text");
+            DataGroupRules types = DataGroupRules.create("select", "input_type", "类型", "input=文本框\ndateTime=日期时间\ndate=日期\ntime=时间\ncolor=颜色\nnumber=数字", sysConfigRecord.getInputType());
+            DataGroupRules width = DataGroupRules.create("inputNumber", "width", "文本框宽", "", sysConfigRecord.getWidth());
+            rulesList.add(hidden);
+            rulesList.add(types);
+            rulesList.add(info);
+            rulesList.add(menuName);
+            rulesList.add(desc);
+            rulesList.add(value);
+            rulesList.add(width);
+            rulesList.add(required);
+            rulesList.add(sort);
+            rulesList.add(status);
+        } else if (type.equals("textarea")) {
+            //多行文本框
+            DataGroupRules hidden = DataGroupRules.create("hidden", "type", null, null, "textarea");
+            DataGroupRules width = DataGroupRules.create("inputNumber", "width", "文本框宽", "", sysConfigRecord.getWidth());
+            DataGroupRules high = DataGroupRules.create("inputNumber", "high", "多行文本框高", "", sysConfigRecord.getHigh());
+            rulesList.add(hidden);
+            rulesList.add(info);
+            rulesList.add(menuName);
+            rulesList.add(desc);
+            rulesList.add(value);
+            rulesList.add(width);
+            rulesList.add(high);
+            rulesList.add(sort);
+            rulesList.add(status);
+        } else if (type.equals("radio")) {
+            //单选框
+            DataGroupRules hidden = DataGroupRules.create("hidden", "type", null, null, "radio");
+            rulesList.add(hidden);
+            rulesList.add(info);
+            rulesList.add(menuName);
+            rulesList.add(desc);
+            rulesList.add(parameter);
+            rulesList.add(value);
+            rulesList.add(sort);
+            rulesList.add(status);
+        } else if (type.equals("upload")) {
+            //文件上传
+            DataGroupRules hidden = DataGroupRules.create("hidden", "type", null, null, "upload");
+            DataGroupRules uploadType = DataGroupRules.create("radio", "upload_type", "上传类型", "1=单图\n2=多图\n3=文件", sysConfigRecord.getUploadType());
+            rulesList.add(hidden);
+            rulesList.add(info);
+            rulesList.add(menuName);
+            rulesList.add(desc);
+            rulesList.add(uploadType);
+            rulesList.add(sort);
+            rulesList.add(status);
+        } else if (type.equals("checkbox")) {
+            //多选框
+            DataGroupRules hidden = DataGroupRules.create("hidden", "type", null, null, "checkbox");
+            rulesList.add(hidden);
+            rulesList.add(info);
+            rulesList.add(menuName);
+            rulesList.add(desc);
+            rulesList.add(parameter);
+            rulesList.add(sort);
+            rulesList.add(status);
+        } else if (type.equals("select")) {
+            //下拉框
+            DataGroupRules hidden = DataGroupRules.create("hidden", "type", null, null, "select");
+            rulesList.add(hidden);
+            rulesList.add(info);
+            rulesList.add(menuName);
+            rulesList.add(desc);
+            rulesList.add(parameter);
+            rulesList.add(sort);
+            rulesList.add(status);
+        } else if (type.equals("switch")) {
+            //开关
+            DataGroupRules hidden = DataGroupRules.create("hidden", "type", null, null, "switch");
+            rulesList.add(hidden);
+            rulesList.add(info);
+            rulesList.add(menuName);
+            rulesList.add(desc);
+            rulesList.add(value);
+            rulesList.add(sort);
+            rulesList.add(status);
+        }
+        map.put("rules", rulesList);
+        return success(map);
+    }
+
+    /**
+     * 删除配置分类
+     */
+    @GetMapping("/config/header_basics")
+    @ApiOperation(value = "基本信息")
+    public AjaxResult header_basics(Integer tabId) {
+        List<SysConfigTab> list = sysConfigTabService.selectSysConfigTabListByPid(tabId);
+        if (list.size() > 0) {
+            return success(list);
+        }
+        SysConfigTab sysConfigTab = sysConfigTabService.selectSysConfigTabById(tabId);
+        return success(Arrays.asList(sysConfigTab));
+    }
+
+    /**
+     * 删除配置分类
+     */
+    @GetMapping("/config/edit_basics")
+    @ApiOperation(value = "基本信息")
+    public AjaxResult edit_basics(Integer tabId) {
+        List<SysConfigRecord> sysConfigRecordList = sysConfigRecordService.list(new QueryWrapper<SysConfigRecord>().eq("config_tab_id", tabId).eq("status", 1).orderByDesc("sort"));
+        List<DataGroupRules> rulesList = new ArrayList<>();
+        for (SysConfigRecord sysConfigRecord : sysConfigRecordList) {
+            DataGroupRules dataGroupRules = DataGroupRules.createConfigForm(sysConfigRecord);
+            rulesList.add(dataGroupRules);
+        }
+        Map map = new HashMap();
+        map.put("method", "POST");
+        map.put("info", "");
+        map.put("action", "/mapi/system/configTab/save_basics/" + tabId);
+        map.put("rules", rulesList);
+        return success(map);
+    }
+
+
+    /**
+     * 获取组合数据详细信息
+     */
+    @PostMapping(value = "/save_basics/{tabId}")
+    @ApiOperation(value = "保存数据表单")
+    public AjaxResult saveBasics(@PathVariable Integer tabId, @RequestBody String body) {
+        Map<String, Object> map = JSONUtil.toBean(body, Map.class);
+        for (String key : map.keySet()) {
+            SysConfigRecord sysConfigRecord = sysConfigRecordService.getConfigRecordByKey(key, tabId);
+            if (sysConfigRecord != null) {
+                SysConfigRecord record = new SysConfigRecord();
+                record.setId(sysConfigRecord.getId());
+                record.setValue(map.get(key).toString());
+                sysConfigRecordService.clearConfigCache(key);
+                sysConfigRecordService.updateSysConfigRecord(record);
+            }
+        }
+        return success();
+    }
+
+}

+ 208 - 16
yiqi-admin/src/main/java/com/yiqi/web/controller/system/SysDataGroupController.java

@@ -1,8 +1,18 @@
 package com.yiqi.web.controller.system;
 
-import java.util.List;
+import java.util.*;
 import javax.servlet.http.HttpServletResponse;
+
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.github.pagehelper.PageInfo;
 import com.yiqi.common.constant.UrlConstants;
+import com.yiqi.system.domain.SysDataGroupInfo;
+import com.yiqi.system.domain.dto.DataGroupFiled;
+import com.yiqi.system.domain.dto.DataGroupHeader;
+import com.yiqi.system.domain.dto.DataGroupRules;
+import com.yiqi.system.service.ISysDataGroupInfoService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -34,16 +44,21 @@ import com.yiqi.common.core.page.TableDataInfo;
 @RestController
 @RequestMapping(UrlConstants.managerApi + "/system/group")
 public class SysDataGroupController extends BaseController {
+
     @Autowired
     private ISysDataGroupService sysDataGroupService;
 
+    @Autowired
+    private ISysDataGroupInfoService sysDataGroupInfoService;
+
 
     //<editor-folder desc="基础函数">
-/**
- * 查询组合数据列表
- */
-@PreAuthorize("@ss.hasPermi('system:group:list')")
-@GetMapping("/list")
+
+    /**
+     * 查询组合数据列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:group:list')")
+    @GetMapping("/list")
     @ApiOperation(value = "查询组合数据列表")
     public TableDataInfo list(SysDataGroup sysDataGroup) {
         startPage();
@@ -60,7 +75,7 @@ public class SysDataGroupController extends BaseController {
     @ApiOperation(value = "导出组合数据列表")
     public void export(HttpServletResponse response, SysDataGroup sysDataGroup) {
         List<SysDataGroup> list = sysDataGroupService.selectSysDataGroupList(sysDataGroup);
-        ExcelUtil<SysDataGroup> util = new ExcelUtil<SysDataGroup>(SysDataGroup. class);
+        ExcelUtil<SysDataGroup> util = new ExcelUtil<SysDataGroup>(SysDataGroup.class);
         util.exportExcel(response, list, "组合数据数据");
     }
 
@@ -74,16 +89,197 @@ public class SysDataGroupController extends BaseController {
         return success(sysDataGroupService.selectSysDataGroupById(id));
     }
 
+    /**
+     * 获取组合数据详细信息
+     */
+    @GetMapping(value = "/header/info")
+    @ApiOperation(value = "获取组合数据头信息")
+    public AjaxResult getHeaderInfo(Integer gid) {
+        SysDataGroup sysDataGroup = sysDataGroupService.selectSysDataGroupById(gid);
+        List<DataGroupFiled> dataGroupFileds = JSONUtil.toList(sysDataGroup.getFields(), DataGroupFiled.class);
+        DataGroupHeader id = DataGroupHeader.createIdHeader();
+        DataGroupHeader status = DataGroupHeader.createStatusHeader();
+        DataGroupHeader action = DataGroupHeader.createActionHeader();
+        DataGroupHeader sort = DataGroupHeader.createSortHeader();
+        List<DataGroupHeader> headers = new ArrayList<>();
+        headers.add(id);
+        for (DataGroupFiled dataGroupFiled : dataGroupFileds) {
+            DataGroupHeader dataGroupHeader = DataGroupHeader.create(dataGroupFiled.getTitle(), dataGroupFiled.getName(), dataGroupFiled.getType());
+            headers.add(dataGroupHeader);
+        }
+        headers.add(status);
+        headers.add(sort);
+        headers.add(action);
+        Map<String, List<DataGroupHeader>> map = new HashMap<>();
+        map.put("header", headers);
+        return success(map);
+    }
+
+    /**
+     * 查询组合数据列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:group:list')")
+    @GetMapping("/data/list")
+    @ApiOperation(value = "查询组合数据结果列表")
+    public TableDataInfo dataList(Integer gid, Integer status) {
+        SysDataGroup sysDataGroup = sysDataGroupService.selectSysDataGroupById(gid);
+        startPage();
+        List<SysDataGroupInfo> list = sysDataGroupInfoService.getDataList(gid, status);
+        List<DataGroupFiled> dataGroupFileds = JSONUtil.toList(sysDataGroup.getFields(), DataGroupFiled.class);
+        Map<String, DataGroupRules> rulesMap = new HashMap<>();
+        for (DataGroupFiled dataGroupFiled : dataGroupFileds) {
+            DataGroupRules dataGroupHeader = DataGroupRules.create(dataGroupFiled.getType(), dataGroupFiled.getTitle(), dataGroupFiled.getName(), dataGroupFiled.getParam(), null);
+            rulesMap.put(dataGroupHeader.getField(), dataGroupHeader);
+        }
+        List<Map<String, Object>> objectList = new ArrayList<>();
+        for (SysDataGroupInfo sysDataGroupInfo : list) {
+            JSONObject jsonObject = JSONUtil.parseObj(sysDataGroupInfo.getValue());
+            Map<String, Object> map = new HashMap<>();
+            for (DataGroupFiled dataGroupFiled : dataGroupFileds) {
+                if (jsonObject.get(dataGroupFiled.getTitle()) != null) {
+                    if (dataGroupFiled.getType().equals("input") || dataGroupFiled.getType().equals("textarea")) {
+                        map.put(dataGroupFiled.getTitle(), jsonObject.get(dataGroupFiled.getTitle()));
+                    } else if (dataGroupFiled.getType().equals("radio") || dataGroupFiled.getType().equals("select")) {
+                        map.put(dataGroupFiled.getTitle(), DataGroupRules.getSigleOptionValue(jsonObject.get(dataGroupFiled.getTitle()).toString(), dataGroupFiled.getParam()));
+                    } else if (dataGroupFiled.getType().equals("checkbox")) {
+                        map.put(dataGroupFiled.getTitle(), DataGroupRules.getMuliteOptionValue(jsonObject.get(dataGroupFiled.getTitle()).toString(), dataGroupFiled.getParam()));
+                    } else if (dataGroupFiled.getType().equals("upload")) {
+                        map.put(dataGroupFiled.getTitle(), jsonObject.get(dataGroupFiled.getTitle()));
+                    }
+                }
+            }
+            map.put("sort", sysDataGroupInfo.getSort());
+            map.put("id", sysDataGroupInfo.getId());
+            map.put("status", sysDataGroupInfo.getStatus());
+            map.put("createTime", sysDataGroupInfo.getCreateTime());
+            objectList.add(map);
+        }
+        return getDataTable(objectList, new PageInfo(list).getTotal());
+    }
+
+    /**
+     * 查询组合数据列表
+     */
+    @DeleteMapping("/data/delete/{id}")
+    @ApiOperation(value = "数据删除")
+    public AjaxResult dataDelete(@PathVariable Integer id) {
+        sysDataGroupInfoService.removeById(id);
+        return success();
+    }
+
+    /**
+     * 查询组合数据列表
+     */
+    @PostMapping("/data/set_status/{id}/{status}")
+    @ApiOperation(value = "数据状态更新")
+    public AjaxResult dataDelete(@PathVariable Integer id, @PathVariable Integer status) {
+        sysDataGroupInfoService.update(new UpdateWrapper<SysDataGroupInfo>().eq("id", id).set("status", status));
+        return success();
+    }
+
+    /**
+     * 获取组合数据详细信息
+     */
+    @PostMapping(value = "/data/saveForm")
+    @ApiOperation(value = "保存数据表单")
+    public AjaxResult saveForm(@RequestBody String body) {
+        JSONObject jsonObject = JSONUtil.parseObj(body);
+        Integer gid = jsonObject.getInt("gid");
+        SysDataGroupInfo sysDataGroupInfo = new SysDataGroupInfo();
+        sysDataGroupInfo.setGid(gid);
+        sysDataGroupInfo.setStatus(jsonObject.getInt("status", 1));
+        sysDataGroupInfo.setSort(jsonObject.getInt("sort", 0));
+        sysDataGroupInfo.setCreateTime(new Date());
+        sysDataGroupInfo.setValue(body);
+        sysDataGroupInfoService.save(sysDataGroupInfo);
+        return success();
+    }
+
+    /**
+     * 获取组合数据详细信息
+     */
+    @PostMapping(value = "/data/updateForm/{id}")
+    @ApiOperation(value = "保存数据表单")
+    public AjaxResult updateForm(@PathVariable Integer id, @RequestBody String body) {
+        JSONObject jsonObject = JSONUtil.parseObj(body);
+        Integer gid = jsonObject.getInt("gid");
+        SysDataGroupInfo sysDataGroupInfo = sysDataGroupInfoService.getById(id);
+        sysDataGroupInfo.setGid(gid);
+        sysDataGroupInfo.setStatus(jsonObject.getInt("status", 1));
+        sysDataGroupInfo.setSort(jsonObject.getInt("sort", 0));
+        sysDataGroupInfo.setCreateTime(new Date());
+        sysDataGroupInfo.setValue(body);
+        sysDataGroupInfoService.updateById(sysDataGroupInfo);
+        return success();
+    }
+
+    /**
+     * 获取组合数据详细信息
+     */
+    @GetMapping(value = "/data/createForm")
+    @ApiOperation(value = "创建数据表单")
+    public AjaxResult createForm(Integer gid) {
+        SysDataGroup sysDataGroup = sysDataGroupService.selectSysDataGroupById(gid);
+        List<DataGroupFiled> dataGroupFileds = JSONUtil.toList(sysDataGroup.getFields(), DataGroupFiled.class);
+        Map map = new HashMap();
+        map.put("title", "添加数据");
+        map.put("status", true);
+        map.put("method", "POST");
+        map.put("info", "");
+        map.put("action", "/mapi/system/group/data/saveForm");
+        List<DataGroupRules> rulesList = new ArrayList<>();
+        DataGroupRules status = DataGroupRules.createStatusHeader(1);
+        DataGroupRules sort = DataGroupRules.createSortHeader(1);
+        DataGroupRules gidRules = DataGroupRules.createGidHeader(gid);
+        for (DataGroupFiled dataGroupFiled : dataGroupFileds) {
+            DataGroupRules dataGroupHeader = DataGroupRules.create(dataGroupFiled.getType(), dataGroupFiled.getTitle(), dataGroupFiled.getName(), dataGroupFiled.getParam(), null);
+            rulesList.add(dataGroupHeader);
+        }
+        rulesList.add(gidRules);
+        rulesList.add(sort);
+        rulesList.add(status);
+        map.put("rules", rulesList);
+        return success(map);
+    }
+
+    /**
+     * 获取组合数据详细信息
+     */
+    @GetMapping(value = "/data/editForm")
+    @ApiOperation(value = "创建数据表单")
+    public AjaxResult editForm(Integer id) {
+        SysDataGroupInfo sysDataGroupInfo = sysDataGroupInfoService.getById(id);
+        SysDataGroup sysDataGroup = sysDataGroupService.selectSysDataGroupById(sysDataGroupInfo.getGid());
+        List<DataGroupFiled> dataGroupFileds = JSONUtil.toList(sysDataGroup.getFields(), DataGroupFiled.class);
+        Map map = new HashMap();
+        map.put("title", "添加数据");
+        map.put("status", true);
+        map.put("method", "POST");
+        map.put("info", "");
+        map.put("action", "/mapi/system/group/data/updateForm/" + id);
+        JSONObject jsonObject = JSONUtil.parseObj(sysDataGroupInfo.getValue());
+        List<DataGroupRules> rulesList = new ArrayList<>();
+        DataGroupRules status = DataGroupRules.createStatusHeader(sysDataGroupInfo.getStatus());
+        DataGroupRules sort = DataGroupRules.createSortHeader(sysDataGroupInfo.getSort());
+        DataGroupRules gidRules = DataGroupRules.createGidHeader(sysDataGroupInfo.getGid());
+        for (DataGroupFiled dataGroupFiled : dataGroupFileds) {
+            DataGroupRules dataGroupHeader = DataGroupRules.create(dataGroupFiled.getType(), dataGroupFiled.getTitle(), dataGroupFiled.getName(), dataGroupFiled.getParam(), jsonObject.get(dataGroupFiled.getTitle()));
+            rulesList.add(dataGroupHeader);
+        }
+        rulesList.add(gidRules);
+        rulesList.add(sort);
+        rulesList.add(status);
+        map.put("rules", rulesList);
+        return success(map);
+    }
+
     /**
      * 新增组合数据
      */
     @PreAuthorize("@ss.hasPermi('system:group:add')")
-    @Log(title = "组合数据", businessType = BusinessType.INSERT)
     @PostMapping
     @ApiOperation(value = "新增组合数据")
     public AjaxResult add(@RequestBody SysDataGroup sysDataGroup) {
-        sysDataGroup.setCreateById(getUserId());
-        sysDataGroup.setCreateBy(getUsername());
         return toAjax(sysDataGroupService.insertSysDataGroup(sysDataGroup));
     }
 
@@ -91,12 +287,10 @@ public class SysDataGroupController extends BaseController {
      * 修改组合数据
      */
     @PreAuthorize("@ss.hasPermi('system:group:edit')")
-    @Log(title = "组合数据", businessType = BusinessType.UPDATE)
     @PostMapping(value = "/{id}")
     @ApiOperation(value = "修改组合数据")
-    public AjaxResult edit(@RequestBody SysDataGroup sysDataGroup) {
-        sysDataGroup.setUpdateById(getUserId());
-        sysDataGroup.setUpdateBy(getUsername());
+    public AjaxResult edit(@PathVariable Integer id, @RequestBody SysDataGroup sysDataGroup) {
+        sysDataGroup.setId(id);
         return toAjax(sysDataGroupService.updateSysDataGroup(sysDataGroup));
     }
 
@@ -111,6 +305,4 @@ public class SysDataGroupController extends BaseController {
         return toAjax(sysDataGroupService.deleteSysDataGroupByIds(ids));
     }
 
-
-    //</editor-folder>
 }

+ 11 - 0
yiqi-admin/src/main/java/com/yiqi/web/controller/system/SysDocumentController.java

@@ -2,6 +2,8 @@ package com.yiqi.web.controller.system;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.yiqi.common.constant.UrlConstants;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -72,6 +74,15 @@ public class SysDocumentController extends BaseController {
         return success(sysDocumentService.selectSysDocumentById(id));
     }
 
+    /**
+     * 获取系统文档详细信息
+     */
+    @GetMapping(value = "/getInfoByCode")
+    @ApiOperation(value = "获取系统文档详细信息")
+    public AjaxResult getInfoByCode(String code) {
+        return success(sysDocumentService.getOne(new QueryWrapper<SysDocument>().lambda().eq(SysDocument::getCode, code), false));
+    }
+
     /**
      * 新增系统文档
      */

+ 126 - 0
yiqi-admin/src/main/java/com/yiqi/web/controller/system/SysMessageConfigController.java

@@ -0,0 +1,126 @@
+package com.yiqi.web.controller.system;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import com.yiqi.common.constant.UrlConstants;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.yiqi.common.annotation.Log;
+import com.yiqi.common.core.controller.BaseController;
+import com.yiqi.common.core.domain.AjaxResult;
+import com.yiqi.common.enums.BusinessType;
+import com.yiqi.system.domain.SysMessageConfig;
+import com.yiqi.system.service.ISysMessageConfigService;
+import com.yiqi.common.utils.poi.ExcelUtil;
+import com.yiqi.common.core.page.TableDataInfo;
+
+/**
+ * 消息配置Controller
+ *
+ * @author douya
+ * @date 2024-11-22
+ */
+@Api(tags = "管理后台 - 消息配置")
+@RestController
+@RequestMapping(UrlConstants.managerApi + "/system/messageConfig")
+public class SysMessageConfigController extends BaseController {
+    @Autowired
+    private ISysMessageConfigService sysMessageConfigService;
+
+
+    //<editor-folder desc="基础函数">
+/**
+ * 查询消息配置列表
+ */
+@PreAuthorize("@ss.hasPermi('system:messageConfig:list')")
+@GetMapping("/list")
+    @ApiOperation(value = "查询消息配置列表")
+    public TableDataInfo list(SysMessageConfig sysMessageConfig) {
+        startPage();
+        List<SysMessageConfig> list = sysMessageConfigService.selectSysMessageConfigList(sysMessageConfig);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出消息配置列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:messageConfig:export')")
+    @Log(title = "消息配置", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    @ApiOperation(value = "导出消息配置列表")
+    public void export(HttpServletResponse response, SysMessageConfig sysMessageConfig) {
+        List<SysMessageConfig> list = sysMessageConfigService.selectSysMessageConfigList(sysMessageConfig);
+        ExcelUtil<SysMessageConfig> util = new ExcelUtil<SysMessageConfig>(SysMessageConfig. class);
+        util.exportExcel(response, list, "消息配置数据");
+    }
+
+    /**
+     * 获取消息配置详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:messageConfig:query')")
+    @GetMapping(value = "/{id}")
+    @ApiOperation(value = "获取消息配置详细信息")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return success(sysMessageConfigService.selectSysMessageConfigById(id));
+    }
+
+    /**
+     * 新增消息配置
+     */
+    @PreAuthorize("@ss.hasPermi('system:messageConfig:add')")
+    @Log(title = "消息配置", businessType = BusinessType.INSERT)
+    @PostMapping
+    @ApiOperation(value = "新增消息配置")
+    public AjaxResult add(@RequestBody SysMessageConfig sysMessageConfig) {
+        sysMessageConfig.setCreateById(getUserId());
+        sysMessageConfig.setCreateBy(getUsername());
+        return toAjax(sysMessageConfigService.insertSysMessageConfig(sysMessageConfig));
+    }
+
+    /**
+     * 修改消息配置
+     */
+    @PreAuthorize("@ss.hasPermi('system:messageConfig:edit')")
+    @Log(title = "消息配置", businessType = BusinessType.UPDATE)
+    @PutMapping
+    @ApiOperation(value = "修改消息配置")
+    public AjaxResult edit(@RequestBody SysMessageConfig sysMessageConfig) {
+        sysMessageConfig.setUpdateById(getUserId());
+        sysMessageConfig.setUpdateBy(getUsername());
+        return toAjax(sysMessageConfigService.updateSysMessageConfig(sysMessageConfig));
+    }
+
+    /**
+     * 删除消息配置
+     */
+    @PreAuthorize("@ss.hasPermi('system:messageConfig:remove')")
+    @Log(title = "消息配置", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    @ApiOperation(value = "删除消息配置")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(sysMessageConfigService.deleteSysMessageConfigByIds(ids));
+    }
+
+            /**
+             * 修改消息配置状态
+             */
+            @PreAuthorize("@ss.hasPermi('system:messageConfig:edit')")
+            @Log(title = "消息配置", businessType = BusinessType.UPDATE)
+            @PostMapping(value = "updateStatus")
+            @ApiOperation(value = "修改消息配置状态")
+            public AjaxResult updateSysMessageConfigStatus(@RequestBody SysMessageConfig sysMessageConfig) {
+                return toAjax(sysMessageConfigService.updateSysMessageConfigStatus(sysMessageConfig));
+            }
+
+    //</editor-folder>
+}

+ 129 - 0
yiqi-admin/src/main/resources/1.json

@@ -0,0 +1,129 @@
+[
+  {
+    "type": "hidden",
+    "field": "type",
+    "value": "text"
+  },
+  {
+    "type": "select",
+    "field": "input_type",
+    "value": "",
+    "title": "类型",
+    "props": {
+      "multiple": false,
+      "placeholder": "请选择类型"
+    },
+    "options": [
+      {
+        "value": "input",
+        "label": "文本框"
+      },
+      {
+        "value": "dateTime",
+        "label": "日期时间"
+      },
+      {
+        "value": "date",
+        "label": "日期"
+      },
+      {
+        "value": "time",
+        "label": "时间"
+      },
+      {
+        "value": "color",
+        "label": "颜色"
+      },
+      {
+        "value": "number",
+        "label": "数字"
+      }
+    ]
+  },
+  {
+    "type": "input",
+    "field": "info",
+    "value": "",
+    "title": "配置名称",
+    "props": {
+      "type": "text",
+      "placeholder": "请输入配置名称",
+      "autofocus": true
+    }
+  },
+  {
+    "type": "input",
+    "field": "menu_name",
+    "value": "",
+    "title": "字段变量",
+    "props": {
+      "type": "text",
+      "placeholder": "例如:site_url"
+    }
+  },
+  {
+    "type": "input",
+    "field": "desc",
+    "value": "",
+    "title": "表单说明",
+    "props": {
+      "type": "text",
+      "placeholder": "请输入表单说明"
+    }
+  },
+  {
+    "type": "input",
+    "field": "value",
+    "value": "",
+    "title": "默认值",
+    "props": {
+      "type": "text",
+      "placeholder": "请输入默认值"
+    }
+  },
+  {
+    "type": "inputNumber",
+    "field": "width",
+    "value": 100,
+    "title": "文本框宽",
+    "props": {
+      "placeholder": "请输入文本框宽"
+    }
+  },
+  {
+    "type": "input",
+    "field": "required",
+    "value": "",
+    "title": "验证规则",
+    "props": {
+      "type": "text",
+      "placeholder": "多个请用,隔开例如:required:true,url:true"
+    }
+  },
+  {
+    "type": "inputNumber",
+    "field": "sort",
+    "value": 0,
+    "title": "排序",
+    "props": {
+      "placeholder": "请输入排序"
+    }
+  },
+  {
+    "type": "radio",
+    "field": "status",
+    "value": 1,
+    "title": "状态",
+    "props": {},
+    "options": [
+      {
+        "value": 1,
+        "label": "显示"
+      },
+      {
+        "value": 0,
+        "label": "隐藏"
+      }
+    ]
+  }
+]

+ 117 - 0
yiqi-api/src/main/java/com/yiqi/api/controller/system/WeAppCommonController.java

@@ -0,0 +1,117 @@
+package com.yiqi.api.controller.system;
+
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.github.pagehelper.PageInfo;
+import com.yiqi.common.constant.UrlConstants;
+import com.yiqi.common.core.controller.BaseController;
+import com.yiqi.common.core.domain.R;
+import com.yiqi.system.domain.*;
+import com.yiqi.system.domain.dto.DataGroupFiled;
+import com.yiqi.system.domain.dto.DataGroupRules;
+import com.yiqi.system.service.*;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Api(tags = "基础通用接口")
+@RestController
+@RequestMapping(value = UrlConstants.wxappApi + "/common")
+public class WeAppCommonController extends BaseController {
+
+    @Autowired
+    private ISysConfigRecordService sysConfigRecordService;
+
+    @Autowired
+    private ISysConfigTabService sysConfigTabService;
+
+    @Autowired
+    private ISysDataGroupService sysDataGroupService;
+
+    @Autowired
+    private ISysDataGroupInfoService sysDataGroupInfoService;
+
+
+    @ApiOperation("通过参数获取参数配置,多个参数用英文逗号隔开")
+    @GetMapping(value = "getConfigValueByKey")
+    public R getConfigValueByKey(@RequestParam String configKeys) {
+        String[] keys = configKeys.split(",");
+        List<SysConfigRecord> sysConfigRecordList = sysConfigRecordService.getConfigRecordByKey(keys);
+        List<Map> list = new ArrayList<>();
+        for (SysConfigRecord record : sysConfigRecordList) {
+            Map<String, Object> map = new HashMap<>();
+            map.put("key", record.getMenuName());
+            map.put("value", record.getValue());
+            map.put("info", record.getInfo());
+            map.put("desc", record.getDescition());
+            list.add(map);
+        }
+        return R.ok(list);
+    }
+
+    @ApiOperation("通过分组关键词获取参数配置")
+    @GetMapping(value = "getConfigValueByTabKey")
+    public R getConfigValueByTabKey(@RequestParam String tabKey) {
+        SysConfigTab sysConfigTab = sysConfigTabService.selectSysConfigTabByTabKey(tabKey);
+        if (sysConfigTab == null) {
+            return R.fail("分组不存在");
+        }
+        List<SysConfigRecord> sysConfigRecordList = sysConfigRecordService.list(new QueryWrapper<SysConfigRecord>().eq("config_tab_id", sysConfigTab.getId()).eq("status", 1).orderByDesc("sort"));
+        List<Map> list = new ArrayList<>();
+        for (SysConfigRecord record : sysConfigRecordList) {
+            Map<String, Object> map = new HashMap<>();
+            map.put("key", record.getMenuName());
+            map.put("value", record.getValue());
+            map.put("info", record.getInfo());
+            map.put("desc", record.getDescition());
+            list.add(map);
+        }
+        return R.ok(list);
+    }
+
+    @ApiOperation("通过分组关键词获取组合列表数据")
+    @GetMapping(value = "getGroupDataByGroupKey")
+    public R getGroupDataByGroupKey(@RequestParam String groupKey) {
+        SysDataGroup sysDataGroup = sysDataGroupService.selectSysDataGroupByKey(groupKey);
+        if (sysDataGroup == null) {
+            return R.fail("分组不存在");
+        }
+        List<SysDataGroupInfo> list = sysDataGroupInfoService.getDataList(sysDataGroup.getId(), 1);
+        List<DataGroupFiled> dataGroupFileds = JSONUtil.toList(JSONUtil.parseArray(sysDataGroup.getFields()), DataGroupFiled.class);
+        List<Map<String, Object>> objectList = new ArrayList<>();
+        for (SysDataGroupInfo sysDataGroupInfo : list) {
+            JSONObject jsonObject = JSONUtil.parseObj(sysDataGroupInfo.getValue());
+            Map<String, Object> map = new HashMap<>();
+            for (DataGroupFiled dataGroupFiled : dataGroupFileds) {
+                if (jsonObject.get(dataGroupFiled.getTitle()) != null) {
+                    if (dataGroupFiled.getType().equals("input") || dataGroupFiled.getType().equals("textarea")) {
+                        map.put(dataGroupFiled.getTitle(), jsonObject.get(dataGroupFiled.getTitle()));
+                    } else if (dataGroupFiled.getType().equals("radio") || dataGroupFiled.getType().equals("select")) {
+                        map.put(dataGroupFiled.getTitle(), DataGroupRules.getSigleOptionValue(jsonObject.get(dataGroupFiled.getTitle()).toString(), dataGroupFiled.getParam()));
+                    } else if (dataGroupFiled.getType().equals("checkbox")) {
+                        map.put(dataGroupFiled.getTitle(), DataGroupRules.getMuliteOptionValue(jsonObject.get(dataGroupFiled.getTitle()).toString(), dataGroupFiled.getParam()));
+                    } else if (dataGroupFiled.getType().equals("upload")) {
+                        map.put(dataGroupFiled.getTitle(), jsonObject.get(dataGroupFiled.getTitle()));
+                    }
+                }
+            }
+            map.put("sort", sysDataGroupInfo.getSort());
+            map.put("id", sysDataGroupInfo.getId());
+            map.put("status", sysDataGroupInfo.getStatus());
+            map.put("createTime", sysDataGroupInfo.getCreateTime());
+            objectList.add(map);
+        }
+        return R.ok(objectList);
+    }
+}

+ 2 - 2
yiqi-api/src/main/java/com/yiqi/api/controller/system/WeAppDocumentController.java

@@ -25,7 +25,7 @@ public class WeAppDocumentController extends BaseController {
 
     @ApiOperation("获取文档内容")
     @GetMapping(value = "info")
-    public R<SysDocument> info(@RequestParam @ApiParam("0:用户协议,1:隐私政策,2:服务约定") String code) throws Exception{
-        return R.ok(sysDocumentService.getOne(new QueryWrapper<SysDocument>().lambda().eq(SysDocument::getCode,code),false));
+    public R<SysDocument> info(@RequestParam @ApiParam("0:用户协议,1:隐私政策,2:服务约定 3:积分协议 9:注销约定") String code) throws Exception {
+        return R.ok(sysDocumentService.getOne(new QueryWrapper<SysDocument>().lambda().eq(SysDocument::getCode, code), false));
     }
 }

+ 0 - 1
yiqi-api/src/main/java/com/yiqi/interceptor/AuthInterceptor.java

@@ -61,7 +61,6 @@ public class AuthInterceptor extends HandlerInterceptorAdapter {
         AuthInfoDO authInfoDO = weAppTokenService.getLoginUser(request);
         if (StringUtils.isNull(authInfoDO))
         {
-
             //先判断库里是否有这个token
             SysSessionRecord sysSessionRecord = sysSessionRecordService
                     .getOne(new QueryWrapper<SysSessionRecord>().lambda().eq(SysSessionRecord::getToken,weAppTokenService.getToken(request)));

+ 24 - 0
yiqi-common/src/main/java/com/yiqi/common/annotation/GmLog.java

@@ -0,0 +1,24 @@
+package com.yiqi.common.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * 自定义日志注解
+ *
+ * @author douya
+ * @dateTime 2020/7/23 10:29
+ * 1.运行时 使用使用注解
+ * 2.注解作用于方法上
+ * 3.注解是否将包含在 JavaDoc 中
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.METHOD})
+@Documented
+public @interface GmLog {
+
+    // 打印日志描述信息
+    String value() default "";
+
+    // TODO 是否保存到数据库
+    boolean isSave() default false;
+}

+ 5 - 0
yiqi-common/src/main/java/com/yiqi/common/constant/CacheConstants.java

@@ -23,6 +23,11 @@ public class CacheConstants {
      */
     public static final String SYS_CONFIG_KEY = "sys_config:";
 
+    /**
+     * 参数管理 cache key
+     */
+    public static final String SYS_CONFIG_RECORD_KEY = "sys_config_record:";
+
     /**
      * 字典管理 cache key
      */

+ 65 - 0
yiqi-common/src/main/java/com/yiqi/msg/dto/MessageKeywordMappingDto.java

@@ -0,0 +1,65 @@
+package com.yiqi.msg.dto;
+
+import java.io.Serializable;
+
+/**
+ * 消息的关键词映射对象
+ * <p>
+ *
+ * @Desc
+ * @Author douya
+ */
+public class MessageKeywordMappingDto implements Serializable {
+
+    /**
+     * 系统关键词
+     */
+    private String fromKeyword;
+
+    /**
+     * 微信模板关键词 (仅微信使用该隐射字段)
+     */
+    private String toKeyword;
+
+    /**
+     * 推送关键词的样式
+     */
+    private String color;
+
+    /**
+     * 模板内容
+     */
+    private String tplContent;
+
+    public String getFromKeyword() {
+        return fromKeyword;
+    }
+
+    public void setFromKeyword(String fromKeyword) {
+        this.fromKeyword = fromKeyword;
+    }
+
+    public String getToKeyword() {
+        return toKeyword;
+    }
+
+    public void setToKeyword(String toKeyword) {
+        this.toKeyword = toKeyword;
+    }
+
+    public String getTplContent() {
+        return tplContent;
+    }
+
+    public void setTplContent(String tplContent) {
+        this.tplContent = tplContent;
+    }
+
+    public String getColor() {
+        return color;
+    }
+
+    public void setColor(String color) {
+        this.color = color;
+    }
+}

+ 45 - 0
yiqi-common/src/main/java/com/yiqi/msg/dto/MessagePushDto.java

@@ -0,0 +1,45 @@
+package com.yiqi.msg.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author douya
+ * @description
+ * @date 2024/11/28
+ */
+@Data
+public class MessagePushDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 推送人员id
+     */
+    private Long pushUserId;
+
+    /**
+     * 推送关键字
+     */
+    private String pushKey;
+
+    /**
+     * 推送内容
+     */
+    private String pushContent;
+
+
+    /**
+     * 拼装订单推送消息
+     *
+     * @param pushKey
+     * @param pushContent
+     * @return
+     */
+    public static MessagePushDto buildOrderPushDto(String pushKey, String pushContent) {
+        MessagePushDto messagePushDto = new MessagePushDto();
+        return messagePushDto;
+    }
+
+}

+ 19 - 0
yiqi-common/src/main/java/com/yiqi/msg/service/UnifiedPushService.java

@@ -0,0 +1,19 @@
+package com.yiqi.msg.service;
+
+import com.yiqi.msg.dto.MessagePushDto;
+
+/**
+ * @author douya
+ * @version 1.0
+ * @date 2020/3/18 15:31
+ * @desc 统一推送入口
+ */
+public interface UnifiedPushService {
+
+    /**
+     * 推送消息
+     */
+    void pushMessage(MessagePushDto pushDto);
+
+
+}

+ 151 - 0
yiqi-common/src/main/java/com/yiqi/msg/service/impl/UnifiedPushServiceImpl.java

@@ -0,0 +1,151 @@
+package com.yiqi.msg.service.impl;
+
+import cn.binarywang.wx.miniapp.bean.WxMaSubscribeMessage;
+import cn.binarywang.wx.miniapp.bean.WxMaTemplateData;
+import cn.binarywang.wx.miniapp.bean.WxMaUniformMessage;
+import cn.hutool.json.JSONUtil;
+import com.yiqi.app.domain.AppUser;
+import com.yiqi.app.service.IAppUserService;
+import com.yiqi.common.config.CompositeWxMaService;
+import com.yiqi.common.config.WxMaProperties;
+import com.yiqi.common.core.domain.entity.SysUser;
+import com.yiqi.msg.dto.MessageKeywordMappingDto;
+import com.yiqi.msg.dto.MessagePushDto;
+import com.yiqi.msg.service.UnifiedPushService;
+import com.yiqi.system.domain.SysMessageConfig;
+import com.yiqi.system.service.ISysMessageConfigService;
+import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.common.error.WxErrorException;
+import me.chanjar.weixin.mp.bean.template.WxMpTemplateData;
+import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.stereotype.Service;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author douya
+ * @description
+ * @date 2024/11/28
+ */
+@Slf4j
+@Service
+public class UnifiedPushServiceImpl implements UnifiedPushService {
+
+    @Autowired
+    private ISysMessageConfigService sysMessageConfigService;
+    @Autowired
+    private CompositeWxMaService compositeWxMaService;
+    @Autowired
+    private WxMaProperties wxMaProperties;
+    @Autowired
+    private IAppUserService appUserService;
+
+
+    @Override
+    @Async
+    public void pushMessage(MessagePushDto pushDto) {
+        SysMessageConfig sysMessageConfig = sysMessageConfigService.selectSysMessageConfigByCode(pushDto.getPushKey());
+        if (sysMessageConfig == null) {
+            return;
+        }
+        //小程序推送开启
+        if (sysMessageConfig.getIsRoutine().equals(1)) {
+            pushXcxMessage(sysMessageConfig, pushDto);
+        }
+        //公众号推送开启
+        if (sysMessageConfig.getIsWechat().equals(1)) {
+            pushGzhMessage(sysMessageConfig, pushDto);
+        }
+        //短信推送开启
+        if (sysMessageConfig.getIsSms().equals(1)) {
+            pushSmsMessage(sysMessageConfig, pushDto);
+        }
+        //app开启
+        if (sysMessageConfig.getIsApp().equals(1)) {
+            pushAppMessage(sysMessageConfig, pushDto);
+        }
+    }
+
+    /**
+     * 小程序推送
+     * <p>
+     * [{"fromKeyword":"refundAmount","toKeyword":"amount1","tplContent":"{refundAmount}"},{"fromKeyword":"orderSn","toKeyword":"character_string3","tplContent":"{orderSn}"},{"fromKeyword":"consumeAmount","toKeyword":"amount5","tplContent":"{consumeAmount}"},{"fromKeyword":"shopName","toKeyword":"thing12","tplContent":"{shopName}"}]
+     *
+     * @param sysMessageConfig
+     * @param pushDto
+     */
+    private void pushXcxMessage(SysMessageConfig sysMessageConfig, MessagePushDto pushDto) {
+        String templateContent = sysMessageConfig.getRoutineContent();
+        List<MessageKeywordMappingDto> keywordMappings = JSONUtil.toList(JSONUtil.parseArray(templateContent), MessageKeywordMappingDto.class);
+        if (null == keywordMappings) {
+            log.error("消息关键词映射内容为空【{}】", sysMessageConfig.getCode());
+        }
+        Map<String, String> pushContentMap = JSONUtil.toBean(pushDto.getPushContent(), Map.class);
+        //2,设置模版信息(keyword1:类型,keyword2:内容)
+        List<WxMaSubscribeMessage.MsgData> templateDataList = new ArrayList<>(2);
+        for (MessageKeywordMappingDto km : keywordMappings) {
+            //匹配映射字段
+            String value = km.getTplContent();
+            if (StringUtils.isNotBlank(km.getFromKeyword())) {
+                String[] array = km.getFromKeyword().split(",");
+                for (String key : array) {
+                    String replace = pushContentMap.get(key);
+                    value = value.replaceAll("\\{" + key + "\\}", replace);
+                }
+            } else {
+                //模板关键字为空,则不需要动态替换
+                value = km.getTplContent();
+            }
+            WxMaSubscribeMessage.MsgData templateData = new WxMaSubscribeMessage.MsgData(km.getToKeyword(), value);
+            templateDataList.add(templateData);
+        }
+        //3,设置推送消息
+        AppUser appUser = appUserService.selectAppUserById(pushDto.getPushUserId());
+
+        WxMaSubscribeMessage templateMessage = new WxMaSubscribeMessage();
+        templateMessage.setTemplateId(sysMessageConfig.getRoutineTempid());
+        templateMessage.setToUser(appUser.getWxOpenId());
+        templateMessage.setData(templateDataList);
+        //4,发起推送
+        try {
+            compositeWxMaService.getWxapp().getSubscribeService().sendSubscribeMsg(templateMessage);
+        } catch (WxErrorException e) {
+            e.printStackTrace();
+            System.out.println("小程序推送失败:" + e.getMessage());
+        }
+    }
+
+    /**
+     * app推送
+     *
+     * @param sysMessageConfig
+     * @param pushDto
+     */
+    private void pushAppMessage(SysMessageConfig sysMessageConfig, MessagePushDto pushDto) {
+    }
+
+    /**
+     * 短信推送
+     *
+     * @param sysMessageConfig
+     * @param pushDto
+     */
+    private void pushSmsMessage(SysMessageConfig sysMessageConfig, MessagePushDto pushDto) {
+    }
+
+    /**
+     * 公众号推送
+     *
+     * @param sysMessageConfig
+     * @param pushDto
+     */
+    private void pushGzhMessage(SysMessageConfig sysMessageConfig, MessagePushDto pushDto) {
+    }
+}

+ 70 - 23
yiqi-common/src/main/java/com/yiqi/system/domain/ManageFactory.java

@@ -3,6 +3,7 @@ package com.yiqi.system.domain;
 import java.math.BigDecimal;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.yiqi.common.annotation.Excel;
@@ -22,74 +23,120 @@ import com.yiqi.common.core.domain.BaseEntity;
 @Data
 @ApiModel("工厂 基本信息")
 @TableName("manage_factory")
-public class ManageFactory extends BaseEntity{
+public class ManageFactory extends BaseEntity {
 
-private static final long serialVersionUID=1L;
+    private static final long serialVersionUID = 1L;
 
-    /** 工厂id */
+    /**
+     * 工厂id
+     */
     @TableId(type = IdType.AUTO)
     private Long id;
 
     private Long bindAreaId;
 
-    /** 工厂名称 */
+
+    @TableField(exist = false)
+    private String bindAreaName;
+
+    /**
+     * 工厂名称
+     */
     private String factoryName;
 
-    /** 负责人名称 */
+    /**
+     * 负责人名称
+     */
     private String applyName;
 
-    /** 负责人-身份证号码 */
+    /**
+     * 负责人-身份证号码
+     */
     private String applyIdCard;
 
-    /** 负责人-联系方式 */
+    /**
+     * 负责人-联系方式
+     */
     private String applyPhone;
 
-    /** 地址 */
+    /**
+     * 地址
+     */
     private String address;
 
-    /** 详细地址 */
+    /**
+     * 详细地址
+     */
     private String detailAddress;
 
-    /** 经度 */
+    /**
+     * 经度
+     */
     private BigDecimal orgLon;
 
-    /** 纬度 */
+    /**
+     * 纬度
+     */
     private BigDecimal orgLat;
 
-    /** 所属省份 */
+    /**
+     * 所属省份
+     */
     private String province;
 
-    /** 所属省份id */
+    /**
+     * 所属省份id
+     */
     private Integer provinceId;
 
-    /** 所属城市 */
+    /**
+     * 所属城市
+     */
     private String city;
 
-    /** 所属城市id */
+    /**
+     * 所属城市id
+     */
     private Integer cityId;
 
-    /** 所属地区 */
+    /**
+     * 所属地区
+     */
     private String area;
 
-    /** 所属地区id */
+    /**
+     * 所属地区id
+     */
     private Integer areaId;
 
-    /** 工厂简介 */
+    /**
+     * 工厂简介
+     */
     private String content;
 
-    /** 营业执照图片 */
+    /**
+     * 营业执照图片
+     */
     private String businessLicensePic;
 
-    /** 工厂照片 */
+    /**
+     * 工厂照片
+     */
     private String factoryPic;
 
-    /** 帐号状态(0正常 1停用) */
+    /**
+     * 帐号状态(0正常 1停用)
+     */
     private String status;
 
-    /** 删除标志(0代表存在 2代表删除) */
+    /**
+     * 删除标志(0代表存在 2代表删除)
+     */
     private String delFlag;
 
-    /** 余额 */
+    /**
+     * 余额
+     */
     @Excel(name = "余额")
     @ApiModelProperty("余额")
     private BigDecimal balance;

+ 155 - 0
yiqi-common/src/main/java/com/yiqi/system/domain/SysConfigRecord.java

@@ -0,0 +1,155 @@
+package com.yiqi.system.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.yiqi.common.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.yiqi.common.core.domain.BaseEntity;
+import lombok.Data;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+
+import java.io.Serializable;
+
+/**
+ * 配置对象 sys_config_record
+ *
+ * @author douya
+ * @date 2024-11-01
+ */
+@ApiModel("配置")
+@TableName("sys_config_record")
+@Data
+public class SysConfigRecord implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 配置id
+     */
+    @ApiModelProperty("配置id")
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 字段名称
+     */
+    @Excel(name = "字段名称")
+    @ApiModelProperty("字段名称")
+    private String menuName;
+
+    /**
+     * 类型(文本框,单选按钮...)
+     */
+    @Excel(name = "类型(文本框,单选按钮...)")
+    @ApiModelProperty("类型(文本框,单选按钮...)")
+    private String type;
+
+    /**
+     * 表单类型
+     */
+    @Excel(name = "表单类型")
+    @ApiModelProperty("表单类型")
+    private String inputType;
+
+    /**
+     * 配置分类id
+     */
+    @Excel(name = "配置分类id")
+    @ApiModelProperty("配置分类id")
+    private Integer configTabId;
+
+    /**
+     * 规则 单选框和多选框
+     */
+    @Excel(name = "规则 单选框和多选框")
+    @ApiModelProperty("规则 单选框和多选框")
+    private String parameter;
+
+    /**
+     * 上传文件格式1单图2多图3文件
+     */
+    @Excel(name = "上传文件格式1单图2多图3文件")
+    @ApiModelProperty("上传文件格式1单图2多图3文件")
+    private Integer uploadType;
+
+    /**
+     * 规则
+     */
+    @Excel(name = "规则")
+    @ApiModelProperty("规则")
+    private String required;
+
+    /**
+     * 多行文本框的宽度
+     */
+    @Excel(name = "多行文本框的宽度")
+    @ApiModelProperty("多行文本框的宽度")
+    private Integer width;
+
+    /**
+     * 多行文框的高度
+     */
+    @Excel(name = "多行文框的高度")
+    @ApiModelProperty("多行文框的高度")
+    private Integer high;
+
+    /**
+     * 默认值
+     */
+    @Excel(name = "默认值")
+    @ApiModelProperty("默认值")
+    private String value;
+
+    /**
+     * 配置名称
+     */
+    @Excel(name = "配置名称")
+    @ApiModelProperty("配置名称")
+    private String info;
+
+    /**
+     * 配置简介
+     */
+    @Excel(name = "配置简介")
+    @ApiModelProperty("配置简介")
+    private String descition;
+
+    /**
+     * 排序
+     */
+    @Excel(name = "排序")
+    @ApiModelProperty("排序")
+    private Integer sort;
+
+    /**
+     * 是否隐藏
+     */
+    @Excel(name = "是否隐藏")
+    @ApiModelProperty("是否隐藏")
+    private Integer status;
+
+    /**
+     * 配置层级0顶级1次级
+     */
+    @Excel(name = "配置层级0顶级1次级")
+    @ApiModelProperty("配置层级0顶级1次级")
+    private Integer level;
+
+    /**
+     * 关联上级配置id
+     */
+    @Excel(name = "关联上级配置id")
+    @ApiModelProperty("关联上级配置id")
+    private Integer linkId;
+
+    /**
+     * 关联上级配置的值
+     */
+    @Excel(name = "关联上级配置的值")
+    @ApiModelProperty("关联上级配置的值")
+    private Integer linkValue;
+
+
+}

+ 99 - 0
yiqi-common/src/main/java/com/yiqi/system/domain/SysConfigTab.java

@@ -0,0 +1,99 @@
+package com.yiqi.system.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.yiqi.common.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.yiqi.common.core.domain.BaseEntity;
+import lombok.Data;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+
+import java.io.Serializable;
+
+/**
+ * 配置分类对象 sys_config_tab
+ *
+ * @author douya
+ * @date 2024-11-01
+ */
+@ApiModel("配置分类")
+@TableName("sys_config_tab")
+@Data
+public class SysConfigTab implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 配置分类id
+     */
+    @ApiModelProperty("配置分类id")
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 上级分类id
+     */
+    @Excel(name = "上级分类id")
+    @ApiModelProperty("上级分类id")
+    private Integer pid;
+
+    /**
+     * 配置分类名称
+     */
+    @Excel(name = "配置分类名称")
+    @ApiModelProperty("配置分类名称")
+    private String title;
+
+    /**
+     * 配置分类英文名称
+     */
+    @Excel(name = "配置分类英文名称")
+    @ApiModelProperty("配置分类英文名称")
+    private String engTitle;
+
+    /**
+     * 配置分类状态
+     */
+    @Excel(name = "配置分类状态")
+    @ApiModelProperty("配置分类状态")
+    private Integer status;
+
+    /**
+     * 配置分类是否显示
+     */
+    @Excel(name = "配置分类是否显示")
+    @ApiModelProperty("配置分类是否显示")
+    private Integer info;
+
+    /**
+     * 图标
+     */
+    @Excel(name = "图标")
+    @ApiModelProperty("图标")
+    private String icon;
+
+    /**
+     * 配置类型
+     */
+    @Excel(name = "配置类型")
+    @ApiModelProperty("配置类型")
+    private Integer type;
+
+    /**
+     * 排序
+     */
+    @Excel(name = "排序")
+    @ApiModelProperty("排序")
+    private Integer sort;
+
+    /**
+     * 菜单ID
+     */
+    @Excel(name = "菜单ID")
+    @ApiModelProperty("菜单ID")
+    private Integer menusId;
+
+
+}

+ 30 - 19
yiqi-common/src/main/java/com/yiqi/system/domain/SysDataGroup.java

@@ -11,6 +11,8 @@ import lombok.Data;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 
+import java.io.Serializable;
+
 /**
  * 组合数据对象 sys_data_group
  *
@@ -20,34 +22,43 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 @ApiModel("组合数据")
 @TableName("sys_data_group")
 @Data
-public class SysDataGroup extends BaseEntity
-        {
-private static final long serialVersionUID=1L;
+public class SysDataGroup implements Serializable {
+    private static final long serialVersionUID = 1L;
 
-    /** 组合数据ID */
-        @ApiModelProperty("组合数据ID")
-        @TableId(type = IdType.AUTO)
+    /**
+     * 组合数据ID
+     */
+    @ApiModelProperty("组合数据ID")
+    @TableId(type = IdType.AUTO)
     private Integer id;
 
-    /** 数据组名称 */
-            @Excel(name = "数据组名称")
-        @ApiModelProperty("数据组名称")
+    /**
+     * 数据组名称
+     */
+    @Excel(name = "数据组名称")
+    @ApiModelProperty("数据组名称")
     private String name;
 
-    /** 数据提示 */
-            @Excel(name = "数据提示")
-        @ApiModelProperty("数据提示")
+    /**
+     * 数据提示
+     */
+    @Excel(name = "数据提示")
+    @ApiModelProperty("数据提示")
     private String info;
 
-    /** 关键字 */
-            @Excel(name = "关键字")
-        @ApiModelProperty("关键字")
+    /**
+     * 关键字
+     */
+    @Excel(name = "关键字")
+    @ApiModelProperty("关键字")
     private String configName;
 
-    /** 数据组字段以及类型(json数据) */
-            @Excel(name = "数据组字段以及类型", readConverterExp = "j=son数据")
-        @ApiModelProperty("数据组字段以及类型(json数据)")
+    /**
+     * 数据组字段以及类型(json数据)
+     */
+    @Excel(name = "数据组字段以及类型", readConverterExp = "j=son数据")
+    @ApiModelProperty("数据组字段以及类型(json数据)")
     private String fields;
 
 
-        }
+}

+ 31 - 22
yiqi-common/src/main/java/com/yiqi/system/domain/SysDataGroupInfo.java

@@ -20,34 +20,43 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 @ApiModel("组合数据详情")
 @TableName("sys_data_group_info")
 @Data
-public class SysDataGroupInfo extends BaseEntity
-        {
-private static final long serialVersionUID=1L;
-
-    /** 组合数据详情ID */
-        @ApiModelProperty("组合数据详情ID")
-        @TableId(type = IdType.AUTO)
+public class SysDataGroupInfo extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 组合数据详情ID
+     */
+    @ApiModelProperty("组合数据详情ID")
+    @TableId(type = IdType.AUTO)
     private Integer id;
 
-    /** 对应的数据组id */
-            @Excel(name = "对应的数据组id")
-        @ApiModelProperty("对应的数据组id")
-    private Integer groupId;
-
-    /** 数据组对应的数据值(json数据) */
-            @Excel(name = "数据组对应的数据值", readConverterExp = "j=son数据")
-        @ApiModelProperty("数据组对应的数据值(json数据)")
+    /**
+     * 对应的数据组id
+     */
+    @Excel(name = "对应的数据组id")
+    @ApiModelProperty("对应的数据组id")
+    private Integer gid;
+
+    /**
+     * 数据组对应的数据值(json数据)
+     */
+    @Excel(name = "数据组对应的数据值", readConverterExp = "j=son数据")
+    @ApiModelProperty("数据组对应的数据值(json数据)")
     private String value;
 
-    /** 数据排序 */
-            @Excel(name = "数据排序")
-        @ApiModelProperty("数据排序")
+    /**
+     * 数据排序
+     */
+    @Excel(name = "数据排序")
+    @ApiModelProperty("数据排序")
     private Integer sort;
 
-    /** 状态(1:开启;2:关闭;) */
-            @Excel(name = "状态", readConverterExp = "1=:开启;2:关闭;")
-        @ApiModelProperty("状态(1:开启;2:关闭;)")
+    /**
+     * 状态(1:开启;2:关闭;)
+     */
+    @Excel(name = "状态", readConverterExp = "1=:开启;2:关闭;")
+    @ApiModelProperty("状态(1:开启;2:关闭;)")
     private Integer status;
 
 
-        }
+}

+ 189 - 0
yiqi-common/src/main/java/com/yiqi/system/domain/SysMessageConfig.java

@@ -0,0 +1,189 @@
+package com.yiqi.system.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.yiqi.common.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.yiqi.common.core.domain.BaseEntity;
+import lombok.Data;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+
+/**
+ * 消息配置对象 sys_message_config
+ *
+ * @author douya
+ * @date 2024-11-22
+ */
+@ApiModel("消息配置")
+@TableName("sys_message_config")
+@Data
+public class SysMessageConfig extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键ID
+     */
+    @ApiModelProperty("主键ID")
+    @TableId(type = IdType.AUTO)
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long id;
+
+    /**
+     * 标识
+     */
+    @Excel(name = "标识")
+    @ApiModelProperty("标识")
+    private String code;
+
+    /**
+     * 通知场景说明
+     */
+    @Excel(name = "通知场景说明")
+    @ApiModelProperty("通知场景说明")
+    private String title;
+
+    /**
+     * 公众号模板消息(0:不存在,1:开启,2:关闭)
+     */
+    @Excel(name = "公众号模板消息", readConverterExp = "0=:不存在,1:开启,2:关闭")
+    @ApiModelProperty("公众号模板消息(0:不存在,1:开启,2:关闭)")
+    private Integer isWechat;
+
+    /**
+     * 模版消息tempkey
+     */
+    @Excel(name = "模版消息tempkey")
+    @ApiModelProperty("模版消息tempkey")
+    private String wechatTempkey;
+
+    /**
+     * 模版消息内容
+     */
+    @Excel(name = "模版消息内容")
+    @ApiModelProperty("模版消息内容")
+    private String wechatContent;
+
+    /**
+     * 模版消息tempid
+     */
+    @Excel(name = "模版消息tempid")
+    @ApiModelProperty("模版消息tempid")
+    private String wechatTempid;
+
+    /**
+     * 模版消息参数
+     */
+    @Excel(name = "模版消息参数")
+    @ApiModelProperty("模版消息参数")
+    private String wechatData;
+
+    /**
+     * 模版消息链接
+     */
+    @Excel(name = "模版消息链接")
+    @ApiModelProperty("模版消息链接")
+    private String wechatLink;
+
+    /**
+     * 模版消息跳转小程序
+     */
+    @Excel(name = "模版消息跳转小程序")
+    @ApiModelProperty("模版消息跳转小程序")
+    private Integer wechatToRoutine;
+
+    /**
+     * 小程序订阅消息(0:不存在,1:开启,2:关闭)
+     */
+    @Excel(name = "小程序订阅消息", readConverterExp = "0=:不存在,1:开启,2:关闭")
+    @ApiModelProperty("小程序订阅消息(0:不存在,1:开启,2:关闭)")
+    private Integer isRoutine;
+
+    /**
+     * 订阅消息id
+     */
+    @Excel(name = "订阅消息id")
+    @ApiModelProperty("订阅消息id")
+    private String routineTempkey;
+
+    /**
+     * 订阅消息内容
+     */
+    @Excel(name = "订阅消息内容")
+    @ApiModelProperty("订阅消息内容")
+    private String routineContent;
+
+    /**
+     * 订阅消息tempid
+     */
+    @Excel(name = "订阅消息tempid")
+    @ApiModelProperty("订阅消息tempid")
+    private String routineTempid;
+
+    /**
+     * 订阅消息参数
+     */
+    @Excel(name = "订阅消息参数")
+    @ApiModelProperty("订阅消息参数")
+    private String routineData;
+
+    /**
+     * 订阅消息链接
+     */
+    @Excel(name = "订阅消息链接")
+    @ApiModelProperty("订阅消息链接")
+    private String routineLink;
+
+    /**
+     * 发送短信(0:不存在,1:开启,2:关闭)
+     */
+    @Excel(name = "发送短信", readConverterExp = "0=:不存在,1:开启,2:关闭")
+    @ApiModelProperty("发送短信(0:不存在,1:开启,2:关闭)")
+    private Integer isSms;
+
+    /**
+     * 短信id
+     */
+    @Excel(name = "短信id")
+    @ApiModelProperty("短信id")
+    private String smsId;
+
+    /**
+     * 短信模版内容
+     */
+    @Excel(name = "短信模版内容")
+    @ApiModelProperty("短信模版内容")
+    private String smsText;
+
+    /**
+     * APP推送(0:不存在,1:开启,2:关闭)
+     */
+    @Excel(name = "APP推送", readConverterExp = "0=:不存在,1:开启,2:关闭")
+    @ApiModelProperty("APP推送(0:不存在,1:开启,2:关闭)")
+    private Integer isApp;
+
+    /**
+     * app推送id
+     */
+    @Excel(name = "app推送id")
+    @ApiModelProperty("app推送id")
+    private Integer appId;
+
+    /**
+     * 变量
+     */
+    @Excel(name = "变量")
+    @ApiModelProperty("变量")
+    private String variable;
+
+    /**
+     * 状态(0=禁用,1=启用)
+     */
+    @Excel(name = "状态", readConverterExp = "0==禁用,1=启用")
+    @ApiModelProperty("状态(0=禁用,1=启用)")
+    private String status;
+
+
+}

+ 24 - 0
yiqi-common/src/main/java/com/yiqi/system/domain/dto/DataGroupFiled.java

@@ -0,0 +1,24 @@
+package com.yiqi.system.domain.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author douya
+ * @description
+ * @date 2024/10/30
+ */
+@Data
+public class DataGroupFiled implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private String name;
+
+    private String title;
+
+    private String type;
+
+    private String param;
+}

+ 71 - 0
yiqi-common/src/main/java/com/yiqi/system/domain/dto/DataGroupHeader.java

@@ -0,0 +1,71 @@
+package com.yiqi.system.domain.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author douya
+ * @description
+ * @date 2024/10/30
+ */
+@Data
+public class DataGroupHeader implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private String key;
+
+    private String slot;
+
+    private String title;
+
+    private String type;
+
+    private String fixed;
+
+    private Integer minWidth = 100;
+
+    public static DataGroupHeader create(String key, String title, String type) {
+        DataGroupHeader dataGroupHeader = new DataGroupHeader();
+        dataGroupHeader.setKey(key);
+        dataGroupHeader.setTitle(title);
+        if(type.equals("upload")){
+            dataGroupHeader.setType("img");
+        }
+        return dataGroupHeader;
+    }
+
+    public static DataGroupHeader createIdHeader() {
+        DataGroupHeader dataGroupHeader = new DataGroupHeader();
+        dataGroupHeader.setTitle("ID");
+        dataGroupHeader.setKey("id");
+        dataGroupHeader.setMinWidth(80);
+        return dataGroupHeader;
+    }
+
+    public static DataGroupHeader createStatusHeader() {
+        DataGroupHeader dataGroupHeader = new DataGroupHeader();
+        dataGroupHeader.setSlot("status");
+        dataGroupHeader.setTitle("是否可用");
+        dataGroupHeader.setMinWidth(80);
+        return dataGroupHeader;
+    }
+
+    public static DataGroupHeader createActionHeader() {
+        DataGroupHeader dataGroupHeader = new DataGroupHeader();
+        dataGroupHeader.setSlot("action");
+        dataGroupHeader.setTitle("操作");
+        dataGroupHeader.setMinWidth(120);
+        dataGroupHeader.setFixed("right");
+        return dataGroupHeader;
+    }
+
+    public static DataGroupHeader createSortHeader() {
+        DataGroupHeader dataGroupHeader = new DataGroupHeader();
+        dataGroupHeader.setKey("sort");
+        dataGroupHeader.setTitle("排序");
+        dataGroupHeader.setMinWidth(80);
+        return dataGroupHeader;
+    }
+}

+ 336 - 0
yiqi-common/src/main/java/com/yiqi/system/domain/dto/DataGroupRules.java

@@ -0,0 +1,336 @@
+package com.yiqi.system.domain.dto;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.json.JSONArray;
+import cn.hutool.json.JSONUtil;
+import com.yiqi.system.domain.SysConfig;
+import com.yiqi.system.domain.SysConfigRecord;
+import io.swagger.models.auth.In;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author douya
+ * @description
+ * @date 2024/10/30
+ */
+@Data
+public class DataGroupRules implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private String field;
+
+    private String type;
+
+    private Object value;
+
+    private String title;
+
+    private String fixed;
+
+    private Props props;
+
+    private Map suffix;
+
+    private Map col;
+
+    private List<Option> options;
+
+    public static DataGroupRules create(String type, String field, String title, String params, Object value) {
+        DataGroupRules dataGroupHeader = new DataGroupRules();
+        dataGroupHeader.setTitle(title);
+        dataGroupHeader.setType(type);
+        dataGroupHeader.setField(field);
+        if (value != null) {
+            dataGroupHeader.setValue(value);
+        }
+        if (type.equals("input")) {
+            Props props = new Props();
+            props.setType("text");
+            props.setPlaceholder("请输入" + title);
+            if (params != null) {
+                props.setPlaceholder(params);
+            }
+            dataGroupHeader.setProps(props);
+        }
+        if (type.equals("inputNumber")) {
+            Props props = new Props();
+            props.setType("inputNumber");
+            props.setPlaceholder("请输入" + title);
+            dataGroupHeader.setProps(props);
+        }
+        if (type.equals("textarea")) {
+            dataGroupHeader.setType("input");
+            Props props = new Props();
+            props.setType("textarea");
+            props.setPlaceholder("请输入" + title);
+            if (params != null) {
+                props.setPlaceholder(params);
+            }
+            props.setRows(4);
+            dataGroupHeader.setProps(props);
+        }
+        if (type.equals("radio")) {
+            dataGroupHeader.setOptions(transform(params));
+        }
+        if (type.equals("checkbox")) {
+            dataGroupHeader.setOptions(transform(params));
+        }
+        if (type.equals("select")) {
+            dataGroupHeader.setOptions(transform(params));
+            Props props = new Props();
+            props.setMultiple(false);
+            props.setPlaceholder("请选择" + title);
+            dataGroupHeader.setProps(props);
+        }
+        if (type.equals("upload")) {
+            dataGroupHeader.setType("image-upload");
+        }
+        return dataGroupHeader;
+    }
+
+    /**
+     * 创建配置表单
+     */
+    public static DataGroupRules createConfigForm(SysConfigRecord sysConfigRecord) {
+        DataGroupRules dataGroupHeader = new DataGroupRules();
+        dataGroupHeader.setTitle(sysConfigRecord.getInfo());
+        dataGroupHeader.setType(sysConfigRecord.getType());
+        dataGroupHeader.setField(sysConfigRecord.getMenuName());
+        if (sysConfigRecord.getValue() != null) {
+            if (isNumeric(sysConfigRecord.getValue())) {
+                dataGroupHeader.setValue(Integer.parseInt(sysConfigRecord.getValue()));
+            } else {
+                dataGroupHeader.setValue(sysConfigRecord.getValue());
+            }
+        }
+        String type = sysConfigRecord.getType();
+        String title = sysConfigRecord.getInfo();
+        String params = sysConfigRecord.getParameter();
+        String placeholder = sysConfigRecord.getDescition();
+        String inputType = sysConfigRecord.getInputType();
+        if (type.equals("text")) {
+            dataGroupHeader.setType("input");
+            if (inputType.equals("input")) {
+                Props props = new Props();
+                props.setType("text");
+                props.setPlaceholder("请输入" + title);
+                if (placeholder != null) {
+                    props.setPlaceholder(placeholder);
+                }
+                dataGroupHeader.setProps(props);
+            } else if (inputType.equals("number")) {
+                Props props = new Props();
+                props.setType("inputNumber");
+                props.setPlaceholder("请输入" + title);
+                if (placeholder != null) {
+                    props.setPlaceholder(placeholder);
+                }
+                dataGroupHeader.setProps(props);
+            } else {
+                Props props = new Props();
+                props.setType("text");
+                props.setPlaceholder("请输入" + title);
+                if (placeholder != null) {
+                    props.setPlaceholder(placeholder);
+                }
+                dataGroupHeader.setProps(props);
+            }
+        }
+        if (type.equals("inputNumber")) {
+            Props props = new Props();
+            props.setType("inputNumber");
+            props.setPlaceholder("请输入" + title);
+            if (placeholder != null) {
+                props.setPlaceholder(placeholder);
+            }
+            dataGroupHeader.setProps(props);
+        }
+        if (type.equals("textarea")) {
+            dataGroupHeader.setType("input");
+            Props props = new Props();
+            props.setType("textarea");
+            props.setPlaceholder("请输入" + title);
+            props.setRows(6);
+            if (placeholder != null) {
+                props.setPlaceholder(placeholder);
+            }
+            dataGroupHeader.setProps(props);
+        }
+        if (type.equals("radio")) {
+            dataGroupHeader.setOptions(transform(params));
+        }
+        if (type.equals("checkbox")) {
+            dataGroupHeader.setOptions(transform(params));
+            if (sysConfigRecord.getValue() != null) {
+                dataGroupHeader.setValue(JSONUtil.parseArray(sysConfigRecord.getValue()));
+            }
+        }
+        if (type.equals("select")) {
+            dataGroupHeader.setOptions(transform(params));
+            Props props = new Props();
+            props.setMultiple(false);
+            props.setPlaceholder("请选择" + title);
+            if (placeholder != null) {
+                props.setPlaceholder(placeholder);
+            }
+            dataGroupHeader.setProps(props);
+        }
+        if (type.equals("upload")) {
+            dataGroupHeader.setType("image-upload");
+            if (sysConfigRecord.getValue() != null) {
+                dataGroupHeader.setValue(sysConfigRecord.getValue());
+            }
+        }
+        if (placeholder != null) {
+            Map<String, Object> suffix = new HashMap<>();
+            suffix.put("class", "tips-info");
+            suffix.put("type", "div");
+            Map<String, String> innerHTML = new HashMap<>();
+            innerHTML.put("innerHTML", placeholder);
+            suffix.put("domProps", innerHTML);
+            dataGroupHeader.setSuffix(suffix);
+        }
+        Map col = new HashMap();
+        col.put("span", 13);
+        dataGroupHeader.setCol(col);
+        return dataGroupHeader;
+    }
+
+
+    public static DataGroupRules createGidHeader(Integer gid) {
+        DataGroupRules dataGroupHeader = new DataGroupRules();
+        dataGroupHeader.setType("hidden");
+        dataGroupHeader.setField("gid");
+        dataGroupHeader.setValue(gid);
+        return dataGroupHeader;
+    }
+
+    public static DataGroupRules createIdHeader(Integer id) {
+        DataGroupRules dataGroupHeader = new DataGroupRules();
+        dataGroupHeader.setType("hidden");
+        dataGroupHeader.setField("id");
+        dataGroupHeader.setValue(id);
+        return dataGroupHeader;
+    }
+
+    public static DataGroupRules createStatusHeader(Integer defaultValue) {
+        DataGroupRules dataGroupHeader = new DataGroupRules();
+        dataGroupHeader.setType("radio");
+        dataGroupHeader.setTitle("状态");
+        dataGroupHeader.setField("status");
+        dataGroupHeader.setValue(defaultValue);
+        Option option1 = new Option();
+        option1.setValue(1);
+        option1.setLabel("显示");
+        Option option2 = new Option();
+        option2.setValue(0);
+        option2.setLabel("隐藏");
+        dataGroupHeader.setOptions(CollUtil.list(false, option1, option2));
+        return dataGroupHeader;
+    }
+
+    public static DataGroupRules createSortHeader(Integer defaultValue) {
+        DataGroupRules dataGroupHeader = new DataGroupRules();
+        dataGroupHeader.setType("inputNumber");
+        dataGroupHeader.setTitle("排序");
+        dataGroupHeader.setField("sort");
+        dataGroupHeader.setValue(defaultValue);
+        return dataGroupHeader;
+    }
+
+    @Data
+    public static class Props {
+
+        private String type;
+
+        private Boolean multiple;
+
+        private String placeholder;
+
+        private Integer precision = 0;
+
+        private Integer rows;
+
+    }
+
+    @Data
+    public static class Option {
+
+        private Object value;
+
+        private String label;
+    }
+
+    public static List<Option> transform(String params) {
+        String[] lines = params.split("\n");
+        // 遍历每一行,并按'='分割为键和值
+        List<Option> options = CollUtil.newArrayList();
+        for (String line : lines) {
+            Option map = new Option();
+            String[] parts = line.split("=");
+            if (parts.length == 2) {
+                map.setLabel(parts[1]);
+                if (isNumeric(parts[0])) {
+                    map.setValue(Integer.parseInt(parts[0]));
+                } else {
+                    map.setValue(parts[0]);
+                }
+                options.add(map);
+            }
+        }
+        return options;
+    }
+
+    /**
+     * 获取单选的值
+     *
+     * @param params
+     * @return
+     */
+    public static String getSigleOptionValue(String value, String params) {
+        String[] lines = params.split("\n");
+        // 遍历每一行,并按'='分割为键和值
+        for (String line : lines) {
+            String[] parts = line.split("=");
+            if (parts.length == 2 && parts[0].equals(value)) {
+                return parts[1];
+            }
+        }
+        return "";
+    }
+
+    /**
+     * 获取多选的值  用逗号隔开
+     *
+     * @param value  ["1","4"]
+     * @param params
+     * @return
+     */
+    public static String getMuliteOptionValue(String value, String params) {
+        String[] lines = params.split("\n");
+        // 遍历每一行,并按'='分割为键和值
+        JSONArray jsonArray = JSONUtil.parseArray(value);
+        List<String> arrVal = CollUtil.newArrayList();
+        for (String line : lines) {
+            String[] parts = line.split("=");
+            for (int i = 0; i < jsonArray.size(); i++) {
+                String val = jsonArray.getStr(i);
+                if (parts.length == 2 && parts[0].equals(val)) {
+                    arrVal.add(parts[1]);
+                }
+            }
+        }
+        return CollUtil.join(arrVal, ",");
+    }
+
+    public static boolean isNumeric(String str) {
+        return str.matches("\\d+");
+    }
+}

+ 94 - 0
yiqi-common/src/main/java/com/yiqi/system/domain/dto/SysConfigTabDto.java

@@ -0,0 +1,94 @@
+package com.yiqi.system.domain.dto;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.yiqi.common.annotation.Excel;
+import com.yiqi.system.domain.SysConfigTab;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author douya
+ * @description
+ * @date 2024/11/3
+ */
+@Data
+public class SysConfigTabDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 配置分类id
+     */
+    @ApiModelProperty("配置分类id")
+    private Integer id;
+
+    /**
+     * 上级分类id
+     */
+    @Excel(name = "上级分类id")
+    @ApiModelProperty("上级分类id")
+    private Integer pid;
+
+    /**
+     * 配置分类名称
+     */
+    @Excel(name = "配置分类名称")
+    @ApiModelProperty("配置分类名称")
+    private String title;
+
+    /**
+     * 配置分类英文名称
+     */
+    @Excel(name = "配置分类英文名称")
+    @ApiModelProperty("配置分类英文名称")
+    private String engTitle;
+
+    /**
+     * 配置分类状态
+     */
+    @Excel(name = "配置分类状态")
+    @ApiModelProperty("配置分类状态")
+    private Integer status;
+
+    /**
+     * 配置分类是否显示
+     */
+    @Excel(name = "配置分类是否显示")
+    @ApiModelProperty("配置分类是否显示")
+    private Integer info;
+
+    /**
+     * 图标
+     */
+    @Excel(name = "图标")
+    @ApiModelProperty("图标")
+    private String icon;
+
+    /**
+     * 配置类型
+     */
+    @Excel(name = "配置类型")
+    @ApiModelProperty("配置类型")
+    private Integer type;
+
+    /**
+     * 排序
+     */
+    @Excel(name = "排序")
+    @ApiModelProperty("排序")
+    private Integer sort;
+
+    /**
+     * 菜单ID
+     */
+    @Excel(name = "菜单ID")
+    @ApiModelProperty("菜单ID")
+    private Integer menusId;
+
+
+    private List<SysConfigTab> children;
+}

+ 117 - 0
yiqi-common/src/main/java/com/yiqi/system/service/ISysConfigRecordService.java

@@ -0,0 +1,117 @@
+package com.yiqi.system.service;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yiqi.system.domain.SysConfigRecord;
+
+/**
+ * 配置Service接口
+ *
+ * @author douya
+ * @date 2024-11-01
+ */
+public interface ISysConfigRecordService extends IService<SysConfigRecord> {
+
+    //<editor-folder desc="基础函数">
+
+    /**
+     * 查询配置
+     *
+     * @param id 配置主键
+     * @return 配置
+     */
+    public SysConfigRecord selectSysConfigRecordById(Integer id);
+
+    /**
+     * 查询配置列表
+     *
+     * @param sysConfigRecord 配置
+     * @return 配置集合
+     */
+    public List<SysConfigRecord> selectSysConfigRecordList(SysConfigRecord sysConfigRecord);
+
+    /**
+     * 新增配置
+     *
+     * @param sysConfigRecord 配置
+     * @return 结果
+     */
+    public int insertSysConfigRecord(SysConfigRecord sysConfigRecord);
+
+    /**
+     * 修改配置
+     *
+     * @param sysConfigRecord 配置
+     * @return 结果
+     */
+    public int updateSysConfigRecord(SysConfigRecord sysConfigRecord);
+
+    /**
+     * 批量删除配置
+     *
+     * @param ids 需要删除的配置主键集合
+     * @return 结果
+     */
+    public int deleteSysConfigRecordByIds(Integer[] ids);
+
+    /**
+     * 删除配置信息
+     *
+     * @param id 配置主键
+     * @return 结果
+     */
+    public int deleteSysConfigRecordById(Integer id);
+
+
+    /**
+     * 修改配置状态
+     *
+     * @param sysConfigRecord 配置
+     * @return 结果
+     */
+    public int updateSysConfigRecordStatus(SysConfigRecord sysConfigRecord);
+
+    /**
+     * 加载参数缓存数据
+     */
+    public void loadingConfigCache();
+
+    /**
+     * 清空参数缓存数据
+     */
+    public void clearConfigCache();
+
+    /**
+     * 重置参数缓存数据
+     */
+    public void resetConfigCache();
+
+    /**
+     * 根据key获取配置
+     * @param key
+     * @param tabId
+     * @return
+     */
+    SysConfigRecord getConfigRecordByKey(String key, Integer tabId);
+
+    /**
+     * 根据key获取配置
+     * @return
+     */
+    List<SysConfigRecord> getConfigRecordByKey(String[] keys);
+
+    /**
+     * 根据key获取配置
+     * @param key
+     * @return
+     */
+    String getCacheConfigRecordByKey(String key);
+
+    /**
+     * 重置配置缓存
+     * @param key
+     */
+    void clearConfigCache(String key);
+
+}

+ 84 - 0
yiqi-common/src/main/java/com/yiqi/system/service/ISysConfigTabService.java

@@ -0,0 +1,84 @@
+package com.yiqi.system.service;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yiqi.system.domain.SysConfigTab;
+
+/**
+ * 配置分类Service接口
+ *
+ * @author douya
+ * @date 2024-11-01
+ */
+public interface ISysConfigTabService extends IService<SysConfigTab> {
+
+    //<editor-folder desc="基础函数">
+
+    /**
+     * 查询配置分类
+     *
+     * @param id 配置分类主键
+     * @return 配置分类
+     */
+    public SysConfigTab selectSysConfigTabById(Integer id);
+
+    /**
+     * 查询配置分类列表
+     *
+     * @param sysConfigTab 配置分类
+     * @return 配置分类集合
+     */
+    public List<SysConfigTab> selectSysConfigTabList(SysConfigTab sysConfigTab);
+
+    /**
+     * 新增配置分类
+     *
+     * @param sysConfigTab 配置分类
+     * @return 结果
+     */
+    public int insertSysConfigTab(SysConfigTab sysConfigTab);
+
+    /**
+     * 修改配置分类
+     *
+     * @param sysConfigTab 配置分类
+     * @return 结果
+     */
+    public int updateSysConfigTab(SysConfigTab sysConfigTab);
+
+    /**
+     * 批量删除配置分类
+     *
+     * @param ids 需要删除的配置分类主键集合
+     * @return 结果
+     */
+    public int deleteSysConfigTabByIds(Integer[] ids);
+
+    /**
+     * 删除配置分类信息
+     *
+     * @param id 配置分类主键
+     * @return 结果
+     */
+    public int deleteSysConfigTabById(Integer id);
+
+
+    /**
+     * 修改配置分类状态
+     *
+     * @param sysConfigTab 配置分类
+     * @return 结果
+     */
+    public int updateSysConfigTabStatus(SysConfigTab sysConfigTab);
+
+
+    List<SysConfigTab> selectSysConfigTabListByPid(Integer id);
+
+    /**
+     * 根据tabKey查询配置分类
+     * @param tabKey
+     * @return
+     */
+    SysConfigTab selectSysConfigTabByTabKey(String tabKey);
+}

+ 12 - 7
yiqi-common/src/main/java/com/yiqi/system/service/ISysDataGroupInfoService.java

@@ -1,6 +1,7 @@
 package com.yiqi.system.service;
 
 import java.util.List;
+
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.yiqi.system.domain.SysDataGroupInfo;
 
@@ -13,6 +14,7 @@ import com.yiqi.system.domain.SysDataGroupInfo;
 public interface ISysDataGroupInfoService extends IService<SysDataGroupInfo> {
 
     //<editor-folder desc="基础函数">
+
     /**
      * 查询组合数据详情
      *
@@ -62,12 +64,15 @@ public interface ISysDataGroupInfoService extends IService<SysDataGroupInfo> {
     public int deleteSysDataGroupInfoById(Integer id);
 
 
-            /**
-             * 修改组合数据详情状态
-             *
-             * @param sysDataGroupInfo 组合数据详情
-             * @return 结果
-             */
-            public int updateSysDataGroupInfoStatus(SysDataGroupInfo sysDataGroupInfo);
+    /**
+     * 修改组合数据详情状态
+     *
+     * @param sysDataGroupInfo 组合数据详情
+     * @return 结果
+     */
+    public int updateSysDataGroupInfoStatus(SysDataGroupInfo sysDataGroupInfo);
+
+
+    List<SysDataGroupInfo> getDataList(Integer gid, Integer status);
     //</editor-folder>
 }

+ 7 - 2
yiqi-common/src/main/java/com/yiqi/system/service/ISysDataGroupService.java

@@ -2,6 +2,7 @@ package com.yiqi.system.service;
 
 import java.util.List;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.yiqi.system.domain.SysConfigTab;
 import com.yiqi.system.domain.SysDataGroup;
 
 /**
@@ -61,6 +62,10 @@ public interface ISysDataGroupService extends IService<SysDataGroup> {
      */
     public int deleteSysDataGroupById(Integer id);
 
-
-    //</editor-folder>
+    /**
+     * 根据分组关键词查询分组信息
+     * @param groupKey
+     * @return
+     */
+    SysDataGroup selectSysDataGroupByKey(String groupKey);
 }

+ 80 - 0
yiqi-common/src/main/java/com/yiqi/system/service/ISysMessageConfigService.java

@@ -0,0 +1,80 @@
+package com.yiqi.system.service;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yiqi.system.domain.SysMessageConfig;
+
+/**
+ * 消息配置Service接口
+ *
+ * @author douya
+ * @date 2024-11-22
+ */
+public interface ISysMessageConfigService extends IService<SysMessageConfig> {
+
+    /**
+     * 查询消息配置
+     *
+     * @param id 消息配置主键
+     * @return 消息配置
+     */
+    public SysMessageConfig selectSysMessageConfigById(Long id);
+
+    /**
+     * 查询消息配置列表
+     *
+     * @param sysMessageConfig 消息配置
+     * @return 消息配置集合
+     */
+    public List<SysMessageConfig> selectSysMessageConfigList(SysMessageConfig sysMessageConfig);
+
+    /**
+     * 新增消息配置
+     *
+     * @param sysMessageConfig 消息配置
+     * @return 结果
+     */
+    public int insertSysMessageConfig(SysMessageConfig sysMessageConfig);
+
+    /**
+     * 修改消息配置
+     *
+     * @param sysMessageConfig 消息配置
+     * @return 结果
+     */
+    public int updateSysMessageConfig(SysMessageConfig sysMessageConfig);
+
+    /**
+     * 批量删除消息配置
+     *
+     * @param ids 需要删除的消息配置主键集合
+     * @return 结果
+     */
+    public int deleteSysMessageConfigByIds(Long[] ids);
+
+    /**
+     * 删除消息配置信息
+     *
+     * @param id 消息配置主键
+     * @return 结果
+     */
+    public int deleteSysMessageConfigById(Long id);
+
+
+    /**
+     * 修改消息配置状态
+     *
+     * @param sysMessageConfig 消息配置
+     * @return 结果
+     */
+    public int updateSysMessageConfigStatus(SysMessageConfig sysMessageConfig);
+
+    /**
+     * 根据code查询消息配置
+     *
+     * @param code
+     * @return
+     */
+    public SysMessageConfig selectSysMessageConfigByCode(String code);
+}

+ 252 - 0
yiqi-framework/src/main/java/com/yiqi/framework/aspectj/GmLogAspect.java

@@ -0,0 +1,252 @@
+package com.yiqi.framework.aspectj;
+
+import cn.hutool.json.JSONUtil;
+import com.alibaba.fastjson2.JSON;
+import com.yiqi.common.annotation.GmLog;
+import com.yiqi.common.annotation.Log;
+import com.yiqi.common.core.domain.AuthHolder;
+import com.yiqi.common.core.domain.model.LoginUser;
+import com.yiqi.common.enums.*;
+import com.yiqi.common.filter.PropertyPreExcludeFilter;
+import com.yiqi.common.utils.SecurityUtils;
+import com.yiqi.common.utils.ServletUtils;
+import com.yiqi.common.utils.StringUtils;
+import com.yiqi.common.utils.ip.IpUtils;
+import com.yiqi.framework.manager.AsyncManager;
+import com.yiqi.framework.manager.factory.AsyncFactory;
+import com.yiqi.system.domain.SysOperLog;
+import lombok.extern.slf4j.Slf4j;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.Signature;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.reflect.MethodSignature;
+import org.springframework.stereotype.Component;
+import org.springframework.validation.BindingResult;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.lang.reflect.Method;
+import java.util.Collection;
+import java.util.Map;
+
+/**
+ * 用于记录注解上接口的入参出参,统一规范。
+ */
+@Aspect
+@Component
+@Slf4j
+public class GmLogAspect {
+
+    /**
+     * 排除敏感属性字段
+     */
+    public static final String[] EXCLUDE_PROPERTIES = {"password", "oldPassword", "newPassword", "confirmPassword"};
+
+
+    /**
+     * 方法二:拦截该注解标识的方法
+     */
+    @Pointcut("@annotation(com.yiqi.common.annotation.GmLog)")
+    public void logPointCut() {
+    }
+
+    /**
+     * 环绕通知
+     *
+     * @param pjd
+     * @return
+     * @throws Throwable
+     */
+    //    @Around("privilege()") // 第一种方式
+    @Around("logPointCut()") // 第二种方式
+    public Object arount(ProceedingJoinPoint pjd) throws Throwable {
+        long startTime = System.currentTimeMillis();
+        // 类名
+        String className = pjd.getTarget().getClass().getName();
+        // 获取执行的方法名称
+        String methodName = pjd.getSignature().getName();
+
+        // 1. 如果是使用的第二种方式,则判断该方法是否使用了改注解
+        // 2. 如果是使用的第一种方式,直接注释即可。
+        GmLog gmLog = this.getAnnotationLog(pjd);
+        if (gmLog != null) {
+            String value = gmLog.value();
+            log.info("{}.{}()【{}】:===================", className, methodName, value);
+        }
+
+        Object[] args = pjd.getArgs();
+        try {
+            String params = JSONUtil.toJsonStr(args[0]);
+            //打印请求参数参数
+            log.info("{}.{}()【方法请求参数为】:{}", className, methodName, params);
+            Map<?, ?> paramsMap = ServletUtils.getParamMap(ServletUtils.getRequest());
+            if (!paramsMap.isEmpty()) {
+                log.info("{}.{}()【GET方法请求参数为】:{}", JSONUtil.toJsonStr(paramsMap));
+            }
+        } catch (Exception e) {
+            log.info("{}.{}()【方法请求参数打印失败】:{}", className, methodName, e);
+        }
+        // 执行目标方法
+        Object result = pjd.proceed();
+        // 打印返回结果
+        try {
+            String s = JSONUtil.toJsonStr(result);
+            log.info("{}.{}()【方法返回结果为】:{}", className, methodName, s);
+        } catch (Exception e) {
+            log.info("{}.{}()【方法返回结果打印失败】:{}", className, methodName, e);
+        }
+        // 获取执行完的时间
+        long time = System.currentTimeMillis() - startTime;
+        log.info("{}.{}()【方法执行时长为】:{}{}", className, methodName, time, " ms");
+        // TODO 这里可以考虑新加一个异步方法,保存信息到数据库,入参,出参,请求人,请求时间,ip信息等,如果有异常,还有异常信息。
+        if (gmLog != null) {
+            boolean save = gmLog.isSave();
+            if (save) {
+                String val = gmLog.value();
+                // 调用异步保存数据库方法
+                this.saveLog(pjd, gmLog, val);
+            }
+        }
+        return result;
+    }
+
+    private void saveLog(ProceedingJoinPoint joinPoint, GmLog gmLog, String val) {
+
+        if (PlatformType.USER.getCode().equals(AuthHolder.platform())) {
+            return;
+        }
+        // 获取当前的用户
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+
+        // *========数据库日志=========*//
+        SysOperLog operLog = new SysOperLog();
+        operLog.setStatus(BusinessStatus.SUCCESS.ordinal());
+        // 请求的地址
+        String ip = IpUtils.getIpAddr(ServletUtils.getRequest());
+        operLog.setOperIp(ip);
+        operLog.setOperUrl(StringUtils.substring(ServletUtils.getRequest().getRequestURI(), 0, 255));
+        if (loginUser != null) {
+            operLog.setOperName(loginUser.getUsername());
+        }
+        // 设置方法名称
+        String className = joinPoint.getTarget().getClass().getName();
+        String methodName = joinPoint.getSignature().getName();
+        operLog.setMethod(className + "." + methodName + "()");
+        // 设置请求方式
+        operLog.setRequestMethod(ServletUtils.getRequest().getMethod());
+        // 处理设置注解上的参数
+        getControllerMethodDescription(joinPoint, gmLog, operLog, null);
+        // 保存数据库
+        AsyncManager.me().execute(AsyncFactory.recordOper(operLog));
+
+    }
+
+    /**
+     * 获取注解中对方法的描述信息 用于Controller层注解
+     *
+     * @param log     日志
+     * @param operLog 操作日志
+     * @throws Exception
+     */
+    public void getControllerMethodDescription(JoinPoint joinPoint, GmLog log, SysOperLog operLog, Object jsonResult) {
+        // 设置action动作
+        operLog.setBusinessType(BusinessType.OTHER.ordinal());
+        // 设置标题
+        operLog.setTitle(log.value());
+        // 设置操作人类别
+        operLog.setOperatorType(OperatorType.MANAGE.ordinal());
+        // 是否需要保存request,参数和值
+        setRequestValue(joinPoint, operLog);
+    }
+
+    /**
+     * 获取请求的参数,放到log中
+     *
+     * @param operLog 操作日志
+     * @throws Exception 异常
+     */
+    private void setRequestValue(JoinPoint joinPoint, SysOperLog operLog) {
+        String requestMethod = operLog.getRequestMethod();
+        if (HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod)) {
+            String params = argsArrayToString(joinPoint.getArgs());
+            operLog.setOperParam(StringUtils.substring(params, 0, 2000));
+        } else {
+            Map<?, ?> paramsMap = ServletUtils.getParamMap(ServletUtils.getRequest());
+            operLog.setOperParam(StringUtils.substring(JSON.toJSONString(paramsMap, excludePropertyPreFilter()), 0, 2000));
+        }
+    }
+
+    /**
+     * 参数拼装
+     */
+    private String argsArrayToString(Object[] paramsArray) {
+        String params = "";
+        if (paramsArray != null && paramsArray.length > 0) {
+            for (Object o : paramsArray) {
+                if (StringUtils.isNotNull(o) && !isFilterObject(o)) {
+                    try {
+                        String jsonObj = JSON.toJSONString(o, excludePropertyPreFilter());
+                        params += jsonObj.toString() + " ";
+                    } catch (Exception e) {
+                    }
+                }
+            }
+        }
+        return params.trim();
+    }
+
+    /**
+     * 忽略敏感属性
+     */
+    public PropertyPreExcludeFilter excludePropertyPreFilter() {
+        return new PropertyPreExcludeFilter().addExcludes(EXCLUDE_PROPERTIES);
+    }
+
+    /**
+     * 判断是否需要过滤的对象。
+     *
+     * @param o 对象信息。
+     * @return 如果是需要过滤的对象,则返回true;否则返回false。
+     */
+    @SuppressWarnings("rawtypes")
+    public boolean isFilterObject(final Object o) {
+        Class<?> clazz = o.getClass();
+        if (clazz.isArray()) {
+            return clazz.getComponentType().isAssignableFrom(MultipartFile.class);
+        } else if (Collection.class.isAssignableFrom(clazz)) {
+            Collection collection = (Collection) o;
+            for (Object value : collection) {
+                return value instanceof MultipartFile;
+            }
+        } else if (Map.class.isAssignableFrom(clazz)) {
+            Map map = (Map) o;
+            for (Object value : map.entrySet()) {
+                Map.Entry entry = (Map.Entry) value;
+                return entry.getValue() instanceof MultipartFile;
+            }
+        }
+        return o instanceof MultipartFile || o instanceof HttpServletRequest || o instanceof HttpServletResponse
+                || o instanceof BindingResult;
+    }
+
+    /**
+     * 是否存在注解,如果存在就获取
+     *
+     * @param joinPoint
+     * @return
+     */
+    private GmLog getAnnotationLog(JoinPoint joinPoint) {
+        Signature signature = joinPoint.getSignature();
+        MethodSignature methodSignature = (MethodSignature) signature;
+        Method method = methodSignature.getMethod();
+        if (method != null) {
+            return method.getAnnotation(GmLog.class);
+        }
+        return null;
+    }
+
+}

+ 3 - 4
yiqi-generator/src/main/resources/vm/vue/index.vue.vm

@@ -113,8 +113,7 @@
             <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
         </el-row>
 
-        <Page v-loading="loading" :data="${businessName}List" @selection-change="handleSelectionChange">
-          <Page uri="/mapi/goods/goodsComment/list" :request-params="queryParams" ref="pagination" @selection-change="handleSelectionChange">
+        <Page uri="/mapi/goods/goodsComment/list" :request-params="queryParams" ref="pagination" @selection-change="handleSelectionChange">
             <el-table-column type="selection" width="55" align="center" fixed="left"/>
             #foreach($column in $columns)
                 #set($javaField=$column.javaField)
@@ -180,7 +179,7 @@
         </Page>
 
         <!-- 添加或修改${functionName}对话框 -->
-        <el-drawer :title="title" :visible.sync="open" size="30%" append-to-body :before-close="checkClose">
+        <el-dialog :title="title" :visible.sync="open" size="30%" append-to-body :before-close="checkClose">
             <el-row :gutter="15" style="margin-bottom: 80px">
                 <el-form ref="form" :model="form" :rules="rules" label-width="100px">
                     <el-col :span="24">
@@ -358,7 +357,7 @@
                 <el-button type="primary" @click="submitForm" style="margin-left: 5%">提交</el-button>
                 <el-button @click="cancel">取 消</el-button>
             </div>
-        </el-drawer>
+        </el-dialog>
     </div>
 </template>
 

+ 65 - 0
yiqi-system/src/main/java/com/yiqi/system/mapper/SysConfigRecordMapper.java

@@ -0,0 +1,65 @@
+package com.yiqi.system.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import com.yiqi.system.domain.SysConfigRecord;
+
+/**
+ * 配置Mapper接口
+ *
+ * @author douya
+ * @date 2024-11-01
+ */
+@Mapper
+public interface SysConfigRecordMapper extends BaseMapper<SysConfigRecord> {
+    //<editor-folder desc="基础韩素">
+    /**
+     * 查询配置
+     *
+     * @param id 配置主键
+     * @return 配置
+     */
+    public SysConfigRecord selectSysConfigRecordById(Integer id);
+
+    /**
+     * 查询配置列表
+     *
+     * @param sysConfigRecord 配置
+     * @return 配置集合
+     */
+    public List<SysConfigRecord> selectSysConfigRecordList(SysConfigRecord sysConfigRecord);
+
+    /**
+     * 新增配置
+     *
+     * @param sysConfigRecord 配置
+     * @return 结果
+     */
+    public int insertSysConfigRecord(SysConfigRecord sysConfigRecord);
+
+    /**
+     * 修改配置
+     *
+     * @param sysConfigRecord 配置
+     * @return 结果
+     */
+    public int updateSysConfigRecord(SysConfigRecord sysConfigRecord);
+
+    /**
+     * 删除配置
+     *
+     * @param id 配置主键
+     * @return 结果
+     */
+    public int deleteSysConfigRecordById(Integer id);
+
+    /**
+     * 批量删除配置
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteSysConfigRecordByIds(Integer[] ids);
+    //</editor-folder>
+}

+ 65 - 0
yiqi-system/src/main/java/com/yiqi/system/mapper/SysConfigTabMapper.java

@@ -0,0 +1,65 @@
+package com.yiqi.system.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import com.yiqi.system.domain.SysConfigTab;
+
+/**
+ * 配置分类Mapper接口
+ *
+ * @author douya
+ * @date 2024-11-01
+ */
+@Mapper
+public interface SysConfigTabMapper extends BaseMapper<SysConfigTab> {
+    //<editor-folder desc="基础韩素">
+    /**
+     * 查询配置分类
+     *
+     * @param id 配置分类主键
+     * @return 配置分类
+     */
+    public SysConfigTab selectSysConfigTabById(Integer id);
+
+    /**
+     * 查询配置分类列表
+     *
+     * @param sysConfigTab 配置分类
+     * @return 配置分类集合
+     */
+    public List<SysConfigTab> selectSysConfigTabList(SysConfigTab sysConfigTab);
+
+    /**
+     * 新增配置分类
+     *
+     * @param sysConfigTab 配置分类
+     * @return 结果
+     */
+    public int insertSysConfigTab(SysConfigTab sysConfigTab);
+
+    /**
+     * 修改配置分类
+     *
+     * @param sysConfigTab 配置分类
+     * @return 结果
+     */
+    public int updateSysConfigTab(SysConfigTab sysConfigTab);
+
+    /**
+     * 删除配置分类
+     *
+     * @param id 配置分类主键
+     * @return 结果
+     */
+    public int deleteSysConfigTabById(Integer id);
+
+    /**
+     * 批量删除配置分类
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteSysConfigTabByIds(Integer[] ids);
+    //</editor-folder>
+}

+ 64 - 0
yiqi-system/src/main/java/com/yiqi/system/mapper/SysMessageConfigMapper.java

@@ -0,0 +1,64 @@
+package com.yiqi.system.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import com.yiqi.system.domain.SysMessageConfig;
+
+/**
+ * 消息配置Mapper接口
+ *
+ * @author douya
+ * @date 2024-11-22
+ */
+@Mapper
+public interface SysMessageConfigMapper extends BaseMapper<SysMessageConfig> {
+    /**
+     * 查询消息配置
+     *
+     * @param id 消息配置主键
+     * @return 消息配置
+     */
+    public SysMessageConfig selectSysMessageConfigById(Long id);
+
+    /**
+     * 查询消息配置列表
+     *
+     * @param sysMessageConfig 消息配置
+     * @return 消息配置集合
+     */
+    public List<SysMessageConfig> selectSysMessageConfigList(SysMessageConfig sysMessageConfig);
+
+    /**
+     * 新增消息配置
+     *
+     * @param sysMessageConfig 消息配置
+     * @return 结果
+     */
+    public int insertSysMessageConfig(SysMessageConfig sysMessageConfig);
+
+    /**
+     * 修改消息配置
+     *
+     * @param sysMessageConfig 消息配置
+     * @return 结果
+     */
+    public int updateSysMessageConfig(SysMessageConfig sysMessageConfig);
+
+    /**
+     * 删除消息配置
+     *
+     * @param id 消息配置主键
+     * @return 结果
+     */
+    public int deleteSysMessageConfigById(Long id);
+
+    /**
+     * 批量删除消息配置
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteSysMessageConfigByIds(Long[] ids);
+    //</editor-folder>
+}

+ 193 - 0
yiqi-system/src/main/java/com/yiqi/system/service/impl/SysConfigRecordServiceImpl.java

@@ -0,0 +1,193 @@
+package com.yiqi.system.service.impl;
+
+import java.util.Collection;
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.yiqi.common.constant.CacheConstants;
+import com.yiqi.common.core.redis.RedisCache;
+import com.yiqi.common.core.text.Convert;
+import com.yiqi.common.utils.SecurityUtils;
+import com.yiqi.common.utils.StringUtils;
+import com.yiqi.system.domain.SysConfig;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.yiqi.system.mapper.SysConfigRecordMapper;
+import com.yiqi.system.domain.SysConfigRecord;
+import com.yiqi.system.service.ISysConfigRecordService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+import javax.annotation.PostConstruct;
+
+/**
+ * 配置Service业务层处理
+ *
+ * @author douya
+ * @date 2024-11-01
+ */
+@Service
+public class SysConfigRecordServiceImpl extends ServiceImpl<SysConfigRecordMapper, SysConfigRecord> implements ISysConfigRecordService {
+
+    @Autowired
+    private RedisCache redisCache;
+
+    /**
+     * 项目启动时,初始化参数到缓存
+     */
+    @PostConstruct
+    public void init() {
+        loadingConfigCache();
+    }
+
+    /**
+     * 查询配置
+     *
+     * @param id 配置主键
+     * @return 配置
+     */
+    @Override
+    public SysConfigRecord selectSysConfigRecordById(Integer id) {
+        return baseMapper.selectSysConfigRecordById(id);
+    }
+
+    /**
+     * 查询配置列表
+     *
+     * @param sysConfigRecord 配置
+     * @return 配置
+     */
+    @Override
+    public List<SysConfigRecord> selectSysConfigRecordList(SysConfigRecord sysConfigRecord) {
+        return baseMapper.selectSysConfigRecordList(sysConfigRecord);
+    }
+
+    /**
+     * 新增配置
+     *
+     * @param sysConfigRecord 配置
+     * @return 结果
+     */
+    @Override
+    public int insertSysConfigRecord(SysConfigRecord sysConfigRecord) {
+        return baseMapper.insert(sysConfigRecord);
+    }
+
+    /**
+     * 修改配置
+     *
+     * @param sysConfigRecord 配置
+     * @return 结果
+     */
+    @Override
+    public int updateSysConfigRecord(SysConfigRecord sysConfigRecord) {
+        return baseMapper.updateById(sysConfigRecord);
+    }
+
+    /**
+     * 批量删除配置
+     *
+     * @param ids 需要删除的配置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysConfigRecordByIds(Integer[] ids) {
+        return baseMapper.deleteSysConfigRecordByIds(ids);
+    }
+
+    /**
+     * 删除配置信息
+     *
+     * @param id 配置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysConfigRecordById(Integer id) {
+        return baseMapper.deleteSysConfigRecordById(id);
+    }
+
+    /**
+     * 修改配置状态
+     *
+     * @param sysConfigRecord 配置
+     * @return 结果
+     */
+    @Override
+    public int updateSysConfigRecordStatus(SysConfigRecord sysConfigRecord) {
+        return baseMapper.updateSysConfigRecord(sysConfigRecord);
+    }
+
+    @Override
+    public SysConfigRecord getConfigRecordByKey(String key, Integer tabId) {
+        QueryWrapper<SysConfigRecord> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("menu_name", key).eq("config_tab_id", tabId);
+        return baseMapper.selectOne(queryWrapper);
+    }
+
+    @Override
+    public List<SysConfigRecord> getConfigRecordByKey(String[] keys) {
+        QueryWrapper<SysConfigRecord> queryWrapper = new QueryWrapper<>();
+        queryWrapper.in("menu_name", keys);
+        return baseMapper.selectList(queryWrapper);
+    }
+
+    @Override
+    public String getCacheConfigRecordByKey(String key) {
+        String configValue = Convert.toStr(redisCache.getCacheObject(getCacheKey(key)));
+        if (StringUtils.isNotEmpty(configValue)) {
+            return configValue;
+        }
+        QueryWrapper<SysConfigRecord> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("menu_name", key);
+        SysConfigRecord sysConfigRecord = baseMapper.selectOne(queryWrapper);
+
+        if (StringUtils.isNotNull(sysConfigRecord)) {
+            redisCache.setCacheObject(getCacheKey(key), sysConfigRecord.getValue());
+            return sysConfigRecord.getValue();
+        }
+        return StringUtils.EMPTY;
+    }
+
+    @Override
+    public void clearConfigCache(String key) {
+        redisCache.deleteObject(getCacheKey(key));
+    }
+
+    /**
+     * 加载参数缓存数据
+     */
+    @Override
+    public void loadingConfigCache() {
+        List<SysConfigRecord> configsList = baseMapper.selectList(new QueryWrapper<>());
+        for (SysConfigRecord config : configsList) {
+            redisCache.setCacheObject(getCacheKey(config.getMenuName()), config.getValue());
+        }
+    }
+
+    /**
+     * 清空参数缓存数据
+     */
+    @Override
+    public void clearConfigCache() {
+        Collection<String> keys = redisCache.keys(CacheConstants.SYS_CONFIG_RECORD_KEY + "*");
+        redisCache.deleteObject(keys);
+    }
+
+    /**
+     * 重置参数缓存数据
+     */
+    @Override
+    public void resetConfigCache() {
+        clearConfigCache();
+        loadingConfigCache();
+    }
+
+    /**
+     * 设置cache key
+     *
+     * @param configKey 参数键
+     * @return 缓存键key
+     */
+    private String getCacheKey(String configKey) {
+        return CacheConstants.SYS_CONFIG_RECORD_KEY + configKey;
+    }
+}

+ 117 - 0
yiqi-system/src/main/java/com/yiqi/system/service/impl/SysConfigTabServiceImpl.java

@@ -0,0 +1,117 @@
+package com.yiqi.system.service.impl;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.yiqi.common.utils.SecurityUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.yiqi.system.mapper.SysConfigTabMapper;
+import com.yiqi.system.domain.SysConfigTab;
+import com.yiqi.system.service.ISysConfigTabService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * 配置分类Service业务层处理
+ *
+ * @author douya
+ * @date 2024-11-01
+ */
+@Service
+public class SysConfigTabServiceImpl extends ServiceImpl<SysConfigTabMapper, SysConfigTab> implements ISysConfigTabService {
+
+    //<editor-folder desc="基础韩素">
+
+    /**
+     * 查询配置分类
+     *
+     * @param id 配置分类主键
+     * @return 配置分类
+     */
+    @Override
+    public SysConfigTab selectSysConfigTabById(Integer id) {
+        return baseMapper.selectSysConfigTabById(id);
+    }
+
+    /**
+     * 查询配置分类列表
+     *
+     * @param sysConfigTab 配置分类
+     * @return 配置分类
+     */
+    @Override
+    public List<SysConfigTab> selectSysConfigTabList(SysConfigTab sysConfigTab) {
+        return baseMapper.selectSysConfigTabList(sysConfigTab);
+    }
+
+    /**
+     * 新增配置分类
+     *
+     * @param sysConfigTab 配置分类
+     * @return 结果
+     */
+    @Override
+    public int insertSysConfigTab(SysConfigTab sysConfigTab) {
+        return baseMapper.insertSysConfigTab(sysConfigTab);
+    }
+
+    /**
+     * 修改配置分类
+     *
+     * @param sysConfigTab 配置分类
+     * @return 结果
+     */
+    @Override
+    public int updateSysConfigTab(SysConfigTab sysConfigTab) {
+        return baseMapper.updateSysConfigTab(sysConfigTab);
+    }
+
+    /**
+     * 批量删除配置分类
+     *
+     * @param ids 需要删除的配置分类主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysConfigTabByIds(Integer[] ids) {
+        return baseMapper.deleteSysConfigTabByIds(ids);
+    }
+
+    /**
+     * 删除配置分类信息
+     *
+     * @param id 配置分类主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysConfigTabById(Integer id) {
+        return baseMapper.deleteSysConfigTabById(id);
+    }
+
+    /**
+     * 修改配置分类状态
+     *
+     * @param sysConfigTab 配置分类
+     * @return 结果
+     */
+    @Override
+    public int updateSysConfigTabStatus(SysConfigTab sysConfigTab) {
+        return baseMapper.updateSysConfigTab(sysConfigTab);
+    }
+
+    @Override
+    public List<SysConfigTab> selectSysConfigTabListByPid(Integer id) {
+        QueryWrapper<SysConfigTab> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("pid", id);
+        queryWrapper.eq("status", 1);
+        return baseMapper.selectList(queryWrapper);
+    }
+
+    @Override
+    public SysConfigTab selectSysConfigTabByTabKey(String tabKey) {
+        QueryWrapper<SysConfigTab> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("eng_title", tabKey);
+        queryWrapper.last("limit 1");
+        return baseMapper.selectOne(queryWrapper);
+    }
+}

+ 27 - 21
yiqi-system/src/main/java/com/yiqi/system/service/impl/SysDataGroupInfoServiceImpl.java

@@ -1,7 +1,9 @@
 package com.yiqi.system.service.impl;
 
 import java.util.List;
-        import com.yiqi.common.utils.DateUtils;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.yiqi.common.utils.DateUtils;
 import com.yiqi.common.utils.SecurityUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -17,9 +19,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  * @date 2024-10-29
  */
 @Service
-public class SysDataGroupInfoServiceImpl extends ServiceImpl<SysDataGroupInfoMapper,SysDataGroupInfo> implements ISysDataGroupInfoService {
+public class SysDataGroupInfoServiceImpl extends ServiceImpl<SysDataGroupInfoMapper, SysDataGroupInfo> implements ISysDataGroupInfoService {
 
     //<editor-folder desc="基础韩素">
+
     /**
      * 查询组合数据详情
      *
@@ -50,8 +53,7 @@ public class SysDataGroupInfoServiceImpl extends ServiceImpl<SysDataGroupInfoMap
      */
     @Override
     public int insertSysDataGroupInfo(SysDataGroupInfo sysDataGroupInfo) {
-                sysDataGroupInfo.setCreateTime(DateUtils.getNowDate());
-            return baseMapper.insertSysDataGroupInfo(sysDataGroupInfo);
+        return baseMapper.insert(sysDataGroupInfo);
     }
 
     /**
@@ -62,8 +64,7 @@ public class SysDataGroupInfoServiceImpl extends ServiceImpl<SysDataGroupInfoMap
      */
     @Override
     public int updateSysDataGroupInfo(SysDataGroupInfo sysDataGroupInfo) {
-                sysDataGroupInfo.setUpdateTime(DateUtils.getNowDate());
-        return baseMapper.updateSysDataGroupInfo(sysDataGroupInfo);
+        return baseMapper.updateById(sysDataGroupInfo);
     }
 
     /**
@@ -88,20 +89,25 @@ public class SysDataGroupInfoServiceImpl extends ServiceImpl<SysDataGroupInfoMap
         return baseMapper.deleteSysDataGroupInfoById(id);
     }
 
-            /**
-             * 修改组合数据详情状态
-             *
-             * @param sysDataGroupInfo 组合数据详情
-             * @return 结果
-             */
-            @Override
-            public int updateSysDataGroupInfoStatus(SysDataGroupInfo sysDataGroupInfo) {
-                        sysDataGroupInfo.setUpdateById(SecurityUtils.getUserId());
-                        sysDataGroupInfo.setUpdateBy(SecurityUtils.getUsername());
-                        sysDataGroupInfo.setUpdateTime(DateUtils.getNowDate());
-                return baseMapper.updateSysDataGroupInfo(sysDataGroupInfo);
-            }
-
-    //</editor-folder>
+    /**
+     * 修改组合数据详情状态
+     *
+     * @param sysDataGroupInfo 组合数据详情
+     * @return 结果
+     */
+    @Override
+    public int updateSysDataGroupInfoStatus(SysDataGroupInfo sysDataGroupInfo) {
+        return baseMapper.updateSysDataGroupInfo(sysDataGroupInfo);
+    }
 
+    @Override
+    public List<SysDataGroupInfo> getDataList(Integer gid, Integer status) {
+        QueryWrapper<SysDataGroupInfo> wrapper = new QueryWrapper<>();
+        wrapper.eq("gid", gid);
+        if (status != null) {
+            wrapper.eq("status", status);
+        }
+        wrapper.orderByDesc("sort");
+        return baseMapper.selectList(wrapper);
+    }
 }

+ 13 - 4
yiqi-system/src/main/java/com/yiqi/system/service/impl/SysDataGroupServiceImpl.java

@@ -1,7 +1,11 @@
 package com.yiqi.system.service.impl;
 
 import java.util.List;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.yiqi.common.utils.SecurityUtils;
+import com.yiqi.system.domain.SysConfigRecord;
+import com.yiqi.system.domain.SysConfigTab;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.yiqi.system.mapper.SysDataGroupMapper;
@@ -16,9 +20,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  * @date 2024-10-29
  */
 @Service
-public class SysDataGroupServiceImpl extends ServiceImpl<SysDataGroupMapper,SysDataGroup> implements ISysDataGroupService {
+public class SysDataGroupServiceImpl extends ServiceImpl<SysDataGroupMapper, SysDataGroup> implements ISysDataGroupService {
 
     //<editor-folder desc="基础韩素">
+
     /**
      * 查询组合数据
      *
@@ -49,7 +54,7 @@ public class SysDataGroupServiceImpl extends ServiceImpl<SysDataGroupMapper,SysD
      */
     @Override
     public int insertSysDataGroup(SysDataGroup sysDataGroup) {
-            return baseMapper.insertSysDataGroup(sysDataGroup);
+        return baseMapper.insertSysDataGroup(sysDataGroup);
     }
 
     /**
@@ -86,6 +91,10 @@ public class SysDataGroupServiceImpl extends ServiceImpl<SysDataGroupMapper,SysD
     }
 
 
-    //</editor-folder>
-
+    @Override
+    public SysDataGroup selectSysDataGroupByKey(String groupKey) {
+        QueryWrapper<SysDataGroup> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("config_name", groupKey);
+        return baseMapper.selectOne(queryWrapper);
+    }
 }

+ 115 - 0
yiqi-system/src/main/java/com/yiqi/system/service/impl/SysMessageConfigServiceImpl.java

@@ -0,0 +1,115 @@
+package com.yiqi.system.service.impl;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.yiqi.common.utils.DateUtils;
+import com.yiqi.common.utils.SecurityUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.yiqi.system.mapper.SysMessageConfigMapper;
+import com.yiqi.system.domain.SysMessageConfig;
+import com.yiqi.system.service.ISysMessageConfigService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * 消息配置Service业务层处理
+ *
+ * @author douya
+ * @date 2024-11-22
+ */
+@Service
+public class SysMessageConfigServiceImpl extends ServiceImpl<SysMessageConfigMapper, SysMessageConfig> implements ISysMessageConfigService {
+
+    //<editor-folder desc="基础韩素">
+
+    /**
+     * 查询消息配置
+     *
+     * @param id 消息配置主键
+     * @return 消息配置
+     */
+    @Override
+    public SysMessageConfig selectSysMessageConfigById(Long id) {
+        return baseMapper.selectSysMessageConfigById(id);
+    }
+
+    /**
+     * 查询消息配置列表
+     *
+     * @param sysMessageConfig 消息配置
+     * @return 消息配置
+     */
+    @Override
+    public List<SysMessageConfig> selectSysMessageConfigList(SysMessageConfig sysMessageConfig) {
+        return baseMapper.selectSysMessageConfigList(sysMessageConfig);
+    }
+
+    /**
+     * 新增消息配置
+     *
+     * @param sysMessageConfig 消息配置
+     * @return 结果
+     */
+    @Override
+    public int insertSysMessageConfig(SysMessageConfig sysMessageConfig) {
+        sysMessageConfig.setCreateTime(DateUtils.getNowDate());
+        return baseMapper.insertSysMessageConfig(sysMessageConfig);
+    }
+
+    /**
+     * 修改消息配置
+     *
+     * @param sysMessageConfig 消息配置
+     * @return 结果
+     */
+    @Override
+    public int updateSysMessageConfig(SysMessageConfig sysMessageConfig) {
+        sysMessageConfig.setUpdateTime(DateUtils.getNowDate());
+        return baseMapper.updateSysMessageConfig(sysMessageConfig);
+    }
+
+    /**
+     * 批量删除消息配置
+     *
+     * @param ids 需要删除的消息配置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysMessageConfigByIds(Long[] ids) {
+        return baseMapper.deleteSysMessageConfigByIds(ids);
+    }
+
+    /**
+     * 删除消息配置信息
+     *
+     * @param id 消息配置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysMessageConfigById(Long id) {
+        return baseMapper.deleteSysMessageConfigById(id);
+    }
+
+    /**
+     * 修改消息配置状态
+     *
+     * @param sysMessageConfig 消息配置
+     * @return 结果
+     */
+    @Override
+    public int updateSysMessageConfigStatus(SysMessageConfig sysMessageConfig) {
+        sysMessageConfig.setUpdateById(SecurityUtils.getUserId());
+        sysMessageConfig.setUpdateBy(SecurityUtils.getUsername());
+        sysMessageConfig.setUpdateTime(DateUtils.getNowDate());
+        return baseMapper.updateSysMessageConfig(sysMessageConfig);
+    }
+
+    @Override
+    public SysMessageConfig selectSysMessageConfigByCode(String code) {
+        QueryWrapper<SysMessageConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.lambda().eq(SysMessageConfig::getCode, code);
+        queryWrapper.lambda().eq(SysMessageConfig::getStatus, 1);
+        return baseMapper.selectOne(queryWrapper);
+    }
+}

+ 244 - 0
yiqi-system/src/main/resources/mapper/system/SysConfigRecordMapper.xml

@@ -0,0 +1,244 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.yiqi.system.mapper.SysConfigRecordMapper">
+
+    <resultMap type="SysConfigRecord" id="SysConfigRecordResult">
+        <result property="id" column="id"/>
+        <result property="menuName" column="menu_name"/>
+        <result property="type" column="type"/>
+        <result property="inputType" column="input_type"/>
+        <result property="configTabId" column="config_tab_id"/>
+        <result property="parameter" column="parameter"/>
+        <result property="uploadType" column="upload_type"/>
+        <result property="required" column="required"/>
+        <result property="width" column="width"/>
+        <result property="high" column="high"/>
+        <result property="value" column="value"/>
+        <result property="info" column="info"/>
+        <result property="desc" column="desc"/>
+        <result property="sort" column="sort"/>
+        <result property="status" column="status"/>
+        <result property="level" column="level"/>
+        <result property="linkId" column="link_id"/>
+        <result property="linkValue" column="link_value"/>
+    </resultMap>
+
+    <sql id="selectSysConfigRecordVo">
+        select id, menu_name, type, input_type, config_tab_id, parameter, upload_type, required, width, high, value, info, desc, sort, status, level, link_id, link_value
+        from sys_config_record
+    </sql>
+
+    <select id="selectSysConfigRecordList" parameterType="SysConfigRecord" resultMap="SysConfigRecordResult">
+        <include refid="selectSysConfigRecordVo"/>
+        <where>
+            <if test="menuName != null  and menuName != ''">
+                and menu_name like concat('%', #{menuName}, '%')
+            </if>
+            <if test="type != null  and type != ''">
+                and type = #{type}
+            </if>
+            <if test="inputType != null  and inputType != ''">
+                and input_type = #{inputType}
+            </if>
+            <if test="configTabId != null ">
+                and config_tab_id = #{configTabId}
+            </if>
+            <if test="parameter != null  and parameter != ''">
+                and parameter = #{parameter}
+            </if>
+            <if test="uploadType != null ">
+                and upload_type = #{uploadType}
+            </if>
+            <if test="required != null  and required != ''">
+                and required = #{required}
+            </if>
+            <if test="width != null ">
+                and width = #{width}
+            </if>
+            <if test="high != null ">
+                and high = #{high}
+            </if>
+            <if test="value != null  and value != ''">
+                and value = #{value}
+            </if>
+            <if test="info != null  and info != ''">
+                and info = #{info}
+            </if>
+            <if test="desc != null  and desc != ''">
+                and desc = #{desc}
+            </if>
+            <if test="sort != null ">
+                and sort = #{sort}
+            </if>
+            <if test="status != null ">
+                and status = #{status}
+            </if>
+            <if test="level != null ">
+                and level = #{level}
+            </if>
+            <if test="linkId != null ">
+                and link_id = #{linkId}
+            </if>
+            <if test="linkValue != null ">
+                and link_value = #{linkValue}
+            </if>
+        </where>
+    </select>
+
+    <select id="selectSysConfigRecordById" parameterType="Integer"
+            resultMap="SysConfigRecordResult">
+        <include refid="selectSysConfigRecordVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertSysConfigRecord" parameterType="SysConfigRecord" useGeneratedKeys="true"
+            keyProperty="id">
+        insert into sys_config_record
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="menuName != null and menuName != ''">menu_name,
+            </if>
+            <if test="type != null and type != ''">type,
+            </if>
+            <if test="inputType != null and inputType != ''">input_type,
+            </if>
+            <if test="configTabId != null">config_tab_id,
+            </if>
+            <if test="parameter != null and parameter != ''">parameter,
+            </if>
+            <if test="uploadType != null">upload_type,
+            </if>
+            <if test="required != null and required != ''">required,
+            </if>
+            <if test="width != null">width,
+            </if>
+            <if test="high != null">high,
+            </if>
+            <if test="value != null and value != ''">value,
+            </if>
+            <if test="info != null and info != ''">info,
+            </if>
+            <if test="desc != null and desc != ''">desc,
+            </if>
+            <if test="sort != null">sort,
+            </if>
+            <if test="status != null">status,
+            </if>
+            <if test="level != null">level,
+            </if>
+            <if test="linkId != null">link_id,
+            </if>
+            <if test="linkValue != null">link_value,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="menuName != null and menuName != ''">#{menuName},
+            </if>
+            <if test="type != null and type != ''">#{type},
+            </if>
+            <if test="inputType != null and inputType != ''">#{inputType},
+            </if>
+            <if test="configTabId != null">#{configTabId},
+            </if>
+            <if test="parameter != null and parameter != ''">#{parameter},
+            </if>
+            <if test="uploadType != null">#{uploadType},
+            </if>
+            <if test="required != null and required != ''">#{required},
+            </if>
+            <if test="width != null">#{width},
+            </if>
+            <if test="high != null">#{high},
+            </if>
+            <if test="value != null and value != ''">#{value},
+            </if>
+            <if test="info != null and info != ''">#{info},
+            </if>
+            <if test="desc != null and desc != ''">#{desc},
+            </if>
+            <if test="sort != null">#{sort},
+            </if>
+            <if test="status != null">#{status},
+            </if>
+            <if test="level != null">#{level},
+            </if>
+            <if test="linkId != null">#{linkId},
+            </if>
+            <if test="linkValue != null">#{linkValue},
+            </if>
+        </trim>
+    </insert>
+
+    <update id="updateSysConfigRecord" parameterType="SysConfigRecord">
+        update sys_config_record
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="menuName != null and menuName != ''">menu_name =
+                #{menuName},
+            </if>
+            <if test="type != null and type != ''">type =
+                #{type},
+            </if>
+            <if test="inputType != null and inputType != ''">input_type =
+                #{inputType},
+            </if>
+            <if test="configTabId != null">config_tab_id =
+                #{configTabId},
+            </if>
+            <if test="parameter != null and parameter != ''">parameter =
+                #{parameter},
+            </if>
+            <if test="uploadType != null">upload_type =
+                #{uploadType},
+            </if>
+            <if test="required != null and required != ''">required =
+                #{required},
+            </if>
+            <if test="width != null">width =
+                #{width},
+            </if>
+            <if test="high != null">high =
+                #{high},
+            </if>
+            <if test="value != null and value != ''">value =
+                #{value},
+            </if>
+            <if test="info != null and info != ''">info =
+                #{info},
+            </if>
+            <if test="desc != null and desc != ''">desc =
+                #{desc},
+            </if>
+            <if test="sort != null">sort =
+                #{sort},
+            </if>
+            <if test="status != null">status =
+                #{status},
+            </if>
+            <if test="level != null">level =
+                #{level},
+            </if>
+            <if test="linkId != null">link_id =
+                #{linkId},
+            </if>
+            <if test="linkValue != null">link_value =
+                #{linkValue},
+            </if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteSysConfigRecordById" parameterType="Integer">
+        delete from sys_config_record where id = #{id}
+    </delete>
+
+    <delete id="deleteSysConfigRecordByIds" parameterType="String">
+        delete from sys_config_record where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+
+
+</mapper>

+ 157 - 0
yiqi-system/src/main/resources/mapper/system/SysConfigTabMapper.xml

@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.yiqi.system.mapper.SysConfigTabMapper">
+
+    <resultMap type="SysConfigTab" id="SysConfigTabResult">
+        <result property="id" column="id"/>
+        <result property="pid" column="pid"/>
+        <result property="title" column="title"/>
+        <result property="engTitle" column="eng_title"/>
+        <result property="status" column="status"/>
+        <result property="info" column="info"/>
+        <result property="icon" column="icon"/>
+        <result property="type" column="type"/>
+        <result property="sort" column="sort"/>
+        <result property="menusId" column="menus_id"/>
+    </resultMap>
+
+    <sql id="selectSysConfigTabVo">
+        select id, pid, title, eng_title, status, info, icon, type, sort, menus_id
+        from sys_config_tab
+    </sql>
+
+    <select id="selectSysConfigTabList" parameterType="SysConfigTab" resultMap="SysConfigTabResult">
+        <include refid="selectSysConfigTabVo"/>
+        <where>
+            <if test="pid != null ">
+                and pid = #{pid}
+            </if>
+            <if test="title != null  and title != ''">
+                and title = #{title}
+            </if>
+            <if test="engTitle != null  and engTitle != ''">
+                and eng_title = #{engTitle}
+            </if>
+            <if test="status != null ">
+                and status = #{status}
+            </if>
+            <if test="info != null ">
+                and info = #{info}
+            </if>
+            <if test="icon != null  and icon != ''">
+                and icon = #{icon}
+            </if>
+            <if test="type != null ">
+                and type = #{type}
+            </if>
+            <if test="sort != null ">
+                and sort = #{sort}
+            </if>
+            <if test="menusId != null ">
+                and menus_id = #{menusId}
+            </if>
+            and pid = 0
+        </where>
+    </select>
+
+    <select id="selectSysConfigTabById" parameterType="Integer"
+            resultMap="SysConfigTabResult">
+        <include refid="selectSysConfigTabVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertSysConfigTab" parameterType="SysConfigTab" useGeneratedKeys="true"
+            keyProperty="id">
+        insert into sys_config_tab
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="pid != null">pid,
+            </if>
+            <if test="title != null and title != ''">title,
+            </if>
+            <if test="engTitle != null and engTitle != ''">eng_title,
+            </if>
+            <if test="status != null">status,
+            </if>
+            <if test="info != null">info,
+            </if>
+            <if test="icon != null and icon != ''">icon,
+            </if>
+            <if test="type != null">type,
+            </if>
+            <if test="sort != null">sort,
+            </if>
+            <if test="menusId != null">menus_id,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="pid != null">#{pid},
+            </if>
+            <if test="title != null and title != ''">#{title},
+            </if>
+            <if test="engTitle != null and engTitle != ''">#{engTitle},
+            </if>
+            <if test="status != null">#{status},
+            </if>
+            <if test="info != null">#{info},
+            </if>
+            <if test="icon != null and icon != ''">#{icon},
+            </if>
+            <if test="type != null">#{type},
+            </if>
+            <if test="sort != null">#{sort},
+            </if>
+            <if test="menusId != null">#{menusId},
+            </if>
+        </trim>
+    </insert>
+
+    <update id="updateSysConfigTab" parameterType="SysConfigTab">
+        update sys_config_tab
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="pid != null">pid =
+                #{pid},
+            </if>
+            <if test="title != null and title != ''">title =
+                #{title},
+            </if>
+            <if test="engTitle != null and engTitle != ''">eng_title =
+                #{engTitle},
+            </if>
+            <if test="status != null">status =
+                #{status},
+            </if>
+            <if test="info != null">info =
+                #{info},
+            </if>
+            <if test="icon != null and icon != ''">icon =
+                #{icon},
+            </if>
+            <if test="type != null">type =
+                #{type},
+            </if>
+            <if test="sort != null">sort =
+                #{sort},
+            </if>
+            <if test="menusId != null">menus_id =
+                #{menusId},
+            </if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteSysConfigTabById" parameterType="Integer">
+        delete from sys_config_tab where id = #{id}
+    </delete>
+
+    <delete id="deleteSysConfigTabByIds" parameterType="String">
+        delete from sys_config_tab where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+
+
+</mapper>

+ 8 - 8
yiqi-system/src/main/resources/mapper/system/SysDataGroupInfoMapper.xml

@@ -6,7 +6,7 @@
 
     <resultMap type="SysDataGroupInfo" id="SysDataGroupInfoResult">
         <result property="id" column="id"/>
-        <result property="groupId" column="group_id"/>
+        <result property="gid" column="gid"/>
         <result property="value" column="value"/>
         <result property="sort" column="sort"/>
         <result property="status" column="status"/>
@@ -20,15 +20,15 @@
     </resultMap>
 
     <sql id="selectSysDataGroupInfoVo">
-        select id, group_id, value, sort, status, create_by_id, create_by, create_time, update_by_id, update_by, update_time, remark
+        select id, gid, value, sort, status, create_by_id, create_by, create_time, update_by_id, update_by, update_time, remark
         from sys_data_group_info
     </sql>
 
     <select id="selectSysDataGroupInfoList" parameterType="SysDataGroupInfo" resultMap="SysDataGroupInfoResult">
         <include refid="selectSysDataGroupInfoVo"/>
         <where>
-            <if test="groupId != null ">
-                and group_id = #{groupId}
+            <if test="gid != null ">
+                and gid = #{gid}
             </if>
             <if test="value != null  and value != ''">
                 and value = #{value}
@@ -52,7 +52,7 @@
             keyProperty="id">
         insert into sys_data_group_info
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="groupId != null">group_id,
+            <if test="gid != null">gid,
             </if>
             <if test="value != null">value,
             </if>
@@ -76,7 +76,7 @@
             </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="groupId != null">#{groupId},
+            <if test="gid != null">#{gid},
             </if>
             <if test="value != null">#{value},
             </if>
@@ -104,8 +104,8 @@
     <update id="updateSysDataGroupInfo" parameterType="SysDataGroupInfo">
         update sys_data_group_info
         <trim prefix="SET" suffixOverrides=",">
-            <if test="groupId != null">group_id =
-                #{groupId},
+            <if test="gid != null">gid =
+                #{gid},
             </if>
             <if test="value != null">value =
                 #{value},

+ 355 - 0
yiqi-system/src/main/resources/mapper/system/SysMessageConfigMapper.xml

@@ -0,0 +1,355 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.yiqi.system.mapper.SysMessageConfigMapper">
+
+    <resultMap type="SysMessageConfig" id="SysMessageConfigResult">
+        <result property="id" column="id"/>
+        <result property="code" column="code"/>
+        <result property="title" column="title"/>
+        <result property="isWechat" column="is_wechat"/>
+        <result property="wechatTempkey" column="wechat_tempkey"/>
+        <result property="wechatContent" column="wechat_content"/>
+        <result property="wechatTempid" column="wechat_tempid"/>
+        <result property="wechatData" column="wechat_data"/>
+        <result property="wechatLink" column="wechat_link"/>
+        <result property="wechatToRoutine" column="wechat_to_routine"/>
+        <result property="isRoutine" column="is_routine"/>
+        <result property="routineTempkey" column="routine_tempkey"/>
+        <result property="routineContent" column="routine_content"/>
+        <result property="routineTempid" column="routine_tempid"/>
+        <result property="routineData" column="routine_data"/>
+        <result property="routineLink" column="routine_link"/>
+        <result property="isSms" column="is_sms"/>
+        <result property="smsId" column="sms_id"/>
+        <result property="smsText" column="sms_text"/>
+        <result property="isApp" column="is_app"/>
+        <result property="appId" column="app_id"/>
+        <result property="variable" column="variable"/>
+        <result property="status" column="status"/>
+        <result property="createById" column="create_by_id"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateById" column="update_by_id"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="remark" column="remark"/>
+    </resultMap>
+
+    <sql id="selectSysMessageConfigVo">
+        select id, code, title, is_wechat, wechat_tempkey, wechat_content, wechat_tempid, wechat_data, wechat_link, wechat_to_routine, is_routine, routine_tempkey, routine_content, routine_tempid, routine_data, routine_link, is_sms, sms_id, sms_text, is_app, app_id, variable, status, create_by_id, create_by, create_time, update_by_id, update_by, update_time, remark
+        from sys_message_config
+    </sql>
+
+    <select id="selectSysMessageConfigList" parameterType="SysMessageConfig" resultMap="SysMessageConfigResult">
+        <include refid="selectSysMessageConfigVo"/>
+        <where>
+            <if test="code != null  and code != ''">
+                and code = #{code}
+            </if>
+            <if test="title != null  and title != ''">
+                and title = #{title}
+            </if>
+            <if test="isWechat != null ">
+                and is_wechat = #{isWechat}
+            </if>
+            <if test="wechatTempkey != null  and wechatTempkey != ''">
+                and wechat_tempkey = #{wechatTempkey}
+            </if>
+            <if test="wechatContent != null  and wechatContent != ''">
+                and wechat_content = #{wechatContent}
+            </if>
+            <if test="wechatTempid != null  and wechatTempid != ''">
+                and wechat_tempid = #{wechatTempid}
+            </if>
+            <if test="wechatData != null  and wechatData != ''">
+                and wechat_data = #{wechatData}
+            </if>
+            <if test="wechatLink != null  and wechatLink != ''">
+                and wechat_link = #{wechatLink}
+            </if>
+            <if test="wechatToRoutine != null ">
+                and wechat_to_routine = #{wechatToRoutine}
+            </if>
+            <if test="isRoutine != null ">
+                and is_routine = #{isRoutine}
+            </if>
+            <if test="routineTempkey != null  and routineTempkey != ''">
+                and routine_tempkey = #{routineTempkey}
+            </if>
+            <if test="routineContent != null  and routineContent != ''">
+                and routine_content = #{routineContent}
+            </if>
+            <if test="routineTempid != null  and routineTempid != ''">
+                and routine_tempid = #{routineTempid}
+            </if>
+            <if test="routineData != null  and routineData != ''">
+                and routine_data = #{routineData}
+            </if>
+            <if test="routineLink != null  and routineLink != ''">
+                and routine_link = #{routineLink}
+            </if>
+            <if test="isSms != null ">
+                and is_sms = #{isSms}
+            </if>
+            <if test="smsId != null  and smsId != ''">
+                and sms_id = #{smsId}
+            </if>
+            <if test="smsText != null  and smsText != ''">
+                and sms_text = #{smsText}
+            </if>
+            <if test="isApp != null ">
+                and is_app = #{isApp}
+            </if>
+            <if test="appId != null ">
+                and app_id = #{appId}
+            </if>
+            <if test="variable != null  and variable != ''">
+                and variable = #{variable}
+            </if>
+            <if test="status != null  and status != ''">
+                and status = #{status}
+            </if>
+        </where>
+    </select>
+
+    <select id="selectSysMessageConfigById" parameterType="Long"
+            resultMap="SysMessageConfigResult">
+        <include refid="selectSysMessageConfigVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertSysMessageConfig" parameterType="SysMessageConfig" useGeneratedKeys="true"
+            keyProperty="id">
+        insert into sys_message_config
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="code != null and code != ''">code,
+            </if>
+            <if test="title != null and title != ''">title,
+            </if>
+            <if test="isWechat != null">is_wechat,
+            </if>
+            <if test="wechatTempkey != null and wechatTempkey != ''">wechat_tempkey,
+            </if>
+            <if test="wechatContent != null and wechatContent != ''">wechat_content,
+            </if>
+            <if test="wechatTempid != null and wechatTempid != ''">wechat_tempid,
+            </if>
+            <if test="wechatData != null and wechatData != ''">wechat_data,
+            </if>
+            <if test="wechatLink != null and wechatLink != ''">wechat_link,
+            </if>
+            <if test="wechatToRoutine != null">wechat_to_routine,
+            </if>
+            <if test="isRoutine != null">is_routine,
+            </if>
+            <if test="routineTempkey != null and routineTempkey != ''">routine_tempkey,
+            </if>
+            <if test="routineContent != null and routineContent != ''">routine_content,
+            </if>
+            <if test="routineTempid != null and routineTempid != ''">routine_tempid,
+            </if>
+            <if test="routineData != null and routineData != ''">routine_data,
+            </if>
+            <if test="routineLink != null and routineLink != ''">routine_link,
+            </if>
+            <if test="isSms != null">is_sms,
+            </if>
+            <if test="smsId != null and smsId != ''">sms_id,
+            </if>
+            <if test="smsText != null and smsText != ''">sms_text,
+            </if>
+            <if test="isApp != null">is_app,
+            </if>
+            <if test="appId != null">app_id,
+            </if>
+            <if test="variable != null and variable != ''">variable,
+            </if>
+            <if test="status != null">status,
+            </if>
+            <if test="createById != null">create_by_id,
+            </if>
+            <if test="createBy != null">create_by,
+            </if>
+            <if test="createTime != null">create_time,
+            </if>
+            <if test="updateById != null">update_by_id,
+            </if>
+            <if test="updateBy != null">update_by,
+            </if>
+            <if test="updateTime != null">update_time,
+            </if>
+            <if test="remark != null">remark,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="code != null and code != ''">#{code},
+            </if>
+            <if test="title != null and title != ''">#{title},
+            </if>
+            <if test="isWechat != null">#{isWechat},
+            </if>
+            <if test="wechatTempkey != null and wechatTempkey != ''">#{wechatTempkey},
+            </if>
+            <if test="wechatContent != null and wechatContent != ''">#{wechatContent},
+            </if>
+            <if test="wechatTempid != null and wechatTempid != ''">#{wechatTempid},
+            </if>
+            <if test="wechatData != null and wechatData != ''">#{wechatData},
+            </if>
+            <if test="wechatLink != null and wechatLink != ''">#{wechatLink},
+            </if>
+            <if test="wechatToRoutine != null">#{wechatToRoutine},
+            </if>
+            <if test="isRoutine != null">#{isRoutine},
+            </if>
+            <if test="routineTempkey != null and routineTempkey != ''">#{routineTempkey},
+            </if>
+            <if test="routineContent != null and routineContent != ''">#{routineContent},
+            </if>
+            <if test="routineTempid != null and routineTempid != ''">#{routineTempid},
+            </if>
+            <if test="routineData != null and routineData != ''">#{routineData},
+            </if>
+            <if test="routineLink != null and routineLink != ''">#{routineLink},
+            </if>
+            <if test="isSms != null">#{isSms},
+            </if>
+            <if test="smsId != null and smsId != ''">#{smsId},
+            </if>
+            <if test="smsText != null and smsText != ''">#{smsText},
+            </if>
+            <if test="isApp != null">#{isApp},
+            </if>
+            <if test="appId != null">#{appId},
+            </if>
+            <if test="variable != null and variable != ''">#{variable},
+            </if>
+            <if test="status != null">#{status},
+            </if>
+            <if test="createById != null">#{createById},
+            </if>
+            <if test="createBy != null">#{createBy},
+            </if>
+            <if test="createTime != null">#{createTime},
+            </if>
+            <if test="updateById != null">#{updateById},
+            </if>
+            <if test="updateBy != null">#{updateBy},
+            </if>
+            <if test="updateTime != null">#{updateTime},
+            </if>
+            <if test="remark != null">#{remark},
+            </if>
+        </trim>
+    </insert>
+
+    <update id="updateSysMessageConfig" parameterType="SysMessageConfig">
+        update sys_message_config
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="code != null and code != ''">code =
+                #{code},
+            </if>
+            <if test="title != null and title != ''">title =
+                #{title},
+            </if>
+            <if test="isWechat != null">is_wechat =
+                #{isWechat},
+            </if>
+            <if test="wechatTempkey != null and wechatTempkey != ''">wechat_tempkey =
+                #{wechatTempkey},
+            </if>
+            <if test="wechatContent != null and wechatContent != ''">wechat_content =
+                #{wechatContent},
+            </if>
+            <if test="wechatTempid != null and wechatTempid != ''">wechat_tempid =
+                #{wechatTempid},
+            </if>
+            <if test="wechatData != null and wechatData != ''">wechat_data =
+                #{wechatData},
+            </if>
+            <if test="wechatLink != null and wechatLink != ''">wechat_link =
+                #{wechatLink},
+            </if>
+            <if test="wechatToRoutine != null">wechat_to_routine =
+                #{wechatToRoutine},
+            </if>
+            <if test="isRoutine != null">is_routine =
+                #{isRoutine},
+            </if>
+            <if test="routineTempkey != null and routineTempkey != ''">routine_tempkey =
+                #{routineTempkey},
+            </if>
+            <if test="routineContent != null and routineContent != ''">routine_content =
+                #{routineContent},
+            </if>
+            <if test="routineTempid != null and routineTempid != ''">routine_tempid =
+                #{routineTempid},
+            </if>
+            <if test="routineData != null and routineData != ''">routine_data =
+                #{routineData},
+            </if>
+            <if test="routineLink != null and routineLink != ''">routine_link =
+                #{routineLink},
+            </if>
+            <if test="isSms != null">is_sms =
+                #{isSms},
+            </if>
+            <if test="smsId != null and smsId != ''">sms_id =
+                #{smsId},
+            </if>
+            <if test="smsText != null and smsText != ''">sms_text =
+                #{smsText},
+            </if>
+            <if test="isApp != null">is_app =
+                #{isApp},
+            </if>
+            <if test="appId != null">app_id =
+                #{appId},
+            </if>
+            <if test="variable != null and variable != ''">variable =
+                #{variable},
+            </if>
+            <if test="status != null">status =
+                #{status},
+            </if>
+            <if test="createById != null">create_by_id =
+                #{createById},
+            </if>
+            <if test="createBy != null">create_by =
+                #{createBy},
+            </if>
+            <if test="createTime != null">create_time =
+                #{createTime},
+            </if>
+            <if test="updateById != null">update_by_id =
+                #{updateById},
+            </if>
+            <if test="updateBy != null">update_by =
+                #{updateBy},
+            </if>
+            <if test="updateTime != null">update_time =
+                #{updateTime},
+            </if>
+            <if test="remark != null">remark =
+                #{remark},
+            </if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteSysMessageConfigById" parameterType="Long">
+        delete from sys_message_config where id = #{id}
+    </delete>
+
+    <delete id="deleteSysMessageConfigByIds" parameterType="String">
+        delete from sys_message_config where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+
+
+</mapper>