From 289dd88443b08fbdada0724d032f75c7fec0a6cf Mon Sep 17 00:00:00 2001
From: phpcjl <phpcjl@gmail.com>
Date: 星期三, 11 十二月 2024 19:31:34 +0800
Subject: [PATCH] 1.后台管理-评论 2.后台管理-门店特殊价

---
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/SystemConfigController.java |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/SystemConfigController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/SystemConfigController.java
index 7f4830b..362d01f 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/SystemConfigController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/SystemConfigController.java
@@ -6,6 +6,7 @@
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.other.api.domain.SystemConfig;
 import com.ruoyi.other.api.dto.IndexConfigSetDto;
+import com.ruoyi.other.api.dto.LogisticsSetDto;
 import com.ruoyi.other.api.dto.StartPageSetDto;
 import com.ruoyi.other.service.SystemConfigService;
 import org.springframework.web.bind.annotation.*;
@@ -89,6 +90,35 @@
         return R.ok();
     }
 
+    /**
+     * 订单包邮设置
+     */
+    @PostMapping("/logistics/add")
+    @ApiOperation(value = "添加", tags = {"后台管理-商品管理-订单包邮设置"})
+    public R add(@RequestBody LogisticsSetDto logisticsSetDto){
+        List<SystemConfig> list = systemConfigService.lambdaQuery().eq(SystemConfig::getType, 3).list();
+        systemConfigService.removeBatchByIds(list);
+        SystemConfig  systemConfig = new SystemConfig();
+        systemConfig.setType(3);
+        systemConfig.setContent(JSON.toJSONString(logisticsSetDto));
+        systemConfigService.save(systemConfig);
+        return R.ok();
+    }
+
+    /**
+     * 获取订单包邮设置
+     */
+    @GetMapping("/logistics/detail")
+    @ApiOperation(value = "订单包邮设置", tags = {"后台管理-商品管理-订单包邮设置"})
+    public R<LogisticsSetDto> logisticsDetail(){
+        SystemConfig one = systemConfigService.lambdaQuery().eq(SystemConfig::getType, 3).one();
+        if (one==null){
+            return R.ok();
+        }
+        LogisticsSetDto logisticsSetDto = JSONObject.parseObject(one.getContent(), LogisticsSetDto.class);
+        return R.ok(logisticsSetDto);
+    }
+
 
 }
 

--
Gitblit v1.7.1