Administrator
6 days ago b51f6f0d5564b843aeb11f088873faa5aa2116ce
src/main/java/cc/mrbird/febs/mall/controller/AdminSystemController.java
@@ -33,6 +33,7 @@
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;
@@ -41,6 +42,7 @@
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -134,6 +136,51 @@
        return new FebsResponse().success().message("保存成功");
    }
    @GetMapping(value = "/moneyChangeList")
    public FebsResponse moneyChangeList() {
        List<DataDictionaryCustom> list = dataDictionaryCustomMapper.selectDicByType("MONEY_CHANGE");
        Map<String, Object> data = new HashMap<>();
        data.put("rows", list);
        data.put("total", list.size());
        return new FebsResponse().success().data(data);
    }
    @PostMapping(value = "/moneyChangeSave")
    @ControllerEndpoint(operation = "保存汇率配置")
    public FebsResponse moneyChangeSave(@RequestParam Map<String, String> params) {
        String id = params.get("id");
        String code = params.get("code");
        String value = params.get("value");
        String description = params.get("description");
        if (StrUtil.isBlank(code)) return new FebsResponse().fail().message("货币编码不能为空");
        if (StrUtil.isBlank(value)) return new FebsResponse().fail().message("汇率不能为空");
        if (StrUtil.isBlank(description)) return new FebsResponse().fail().message("符号不能为空");
        code = code.toUpperCase();
        // 编辑模式:先删旧记录
        if (StrUtil.isNotBlank(id)) {
            dataDictionaryCustomMapper.deleteById(Long.valueOf(id));
        }
        // 检查编码是否已存在(避免重复)
        DataDictionaryCustom exist = dataDictionaryCustomMapper.selectDicDataByTypeAndCode("MONEY_CHANGE", code);
        if (exist != null) {
            return new FebsResponse().fail().message("货币编码 " + code + " 已存在");
        }
        commonService.addDataDic("MONEY_CHANGE", code, value, description, false);
        return new FebsResponse().success().message("保存成功");
    }
    @GetMapping(value = "/moneyChangeDelete/{id}")
    @ControllerEndpoint(operation = "删除汇率配置")
    public FebsResponse moneyChangeDelete(@PathVariable Long id) {
        dataDictionaryCustomMapper.deleteById(id);
        return new FebsResponse().success().message("删除成功");
    }
    @GetMapping("countryDeliveryList")
    public FebsResponse countryDeliveryList(MallCountryDelivery dto, QueryRequest request) {
        Map<String, Object> data = getDataTable(countryDeliveryService.countryDeliveryList(dto, request));