From 2080ad54d51b969eb8718e7a642eea7b34c7262c Mon Sep 17 00:00:00 2001 From: liuqingkun Date: Mon, 21 Aug 2023 16:06:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=9B=B8=E5=85=B3=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/constant/BusinessConstant.java | 9 + .../common/constant/CommonConstant.java | 4 - .../common/constant/DictConstant.java | 10 + .../common/enums/OrderStatusEnum.java | 54 +++++ .../desk/controller/OrderController.java | 190 ++++++++++++++++++ .../modules/desk/entity/CustomMadeInfo.java | 8 +- .../modules/desk/entity/Order.java | 126 ++++++++++++ .../modules/desk/mapper/OrderMapper.java | 33 +++ .../modules/desk/mapper/OrderMapper.xml | 32 +++ .../modules/desk/service/IOrderService.java | 32 +++ .../desk/service/impl/OrderServiceImpl.java | 39 ++++ .../modules/desk/vo/OrderExcelVO.java | 115 +++++++++++ .../system/controller/DictBizController.java | 23 +++ src/main/resources/application.yml | 4 +- 14 files changed, 673 insertions(+), 6 deletions(-) create mode 100644 src/main/java/org/springblade/common/constant/BusinessConstant.java create mode 100644 src/main/java/org/springblade/common/enums/OrderStatusEnum.java create mode 100644 src/main/java/org/springblade/modules/desk/controller/OrderController.java create mode 100644 src/main/java/org/springblade/modules/desk/entity/Order.java create mode 100644 src/main/java/org/springblade/modules/desk/mapper/OrderMapper.java create mode 100644 src/main/java/org/springblade/modules/desk/mapper/OrderMapper.xml create mode 100644 src/main/java/org/springblade/modules/desk/service/IOrderService.java create mode 100644 src/main/java/org/springblade/modules/desk/service/impl/OrderServiceImpl.java create mode 100644 src/main/java/org/springblade/modules/desk/vo/OrderExcelVO.java diff --git a/src/main/java/org/springblade/common/constant/BusinessConstant.java b/src/main/java/org/springblade/common/constant/BusinessConstant.java new file mode 100644 index 0000000..4a68a05 --- /dev/null +++ b/src/main/java/org/springblade/common/constant/BusinessConstant.java @@ -0,0 +1,9 @@ +package org.springblade.common.constant; + +/** + * @author liuqk + * @version 1.0 + * @date 2023-08-21 13:16 + */ +public interface BusinessConstant { +} diff --git a/src/main/java/org/springblade/common/constant/CommonConstant.java b/src/main/java/org/springblade/common/constant/CommonConstant.java index c9e3644..7756bd1 100644 --- a/src/main/java/org/springblade/common/constant/CommonConstant.java +++ b/src/main/java/org/springblade/common/constant/CommonConstant.java @@ -79,8 +79,4 @@ public interface CommonConstant { * 接口权限类型 */ Integer API_SCOPE_CATEGORY = 2; - - Integer CODE_TRUE = 1; - Integer CODE_FALSE = 0; - } diff --git a/src/main/java/org/springblade/common/constant/DictConstant.java b/src/main/java/org/springblade/common/constant/DictConstant.java index 6d11fd3..af32437 100644 --- a/src/main/java/org/springblade/common/constant/DictConstant.java +++ b/src/main/java/org/springblade/common/constant/DictConstant.java @@ -35,4 +35,14 @@ public interface DictConstant { String FLOW_CATEGORY_CODE = "flow_category"; + /** + * 物流公司 + */ + String LOGISTICS_COMPANY_CODE = "logistics_company"; + + /** + * 购买渠道 + */ + String PURCHASE_CHANNEL_CODE = "purchase_channel"; + } diff --git a/src/main/java/org/springblade/common/enums/OrderStatusEnum.java b/src/main/java/org/springblade/common/enums/OrderStatusEnum.java new file mode 100644 index 0000000..5ba8b75 --- /dev/null +++ b/src/main/java/org/springblade/common/enums/OrderStatusEnum.java @@ -0,0 +1,54 @@ +package org.springblade.common.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author liuqk + * @version 1.0 + * @date 2023-08-21 13:16 + */ +@Getter +@AllArgsConstructor +public enum OrderStatusEnum { + /** + * 订单状态 + * 0: 取消, 1: 待付款, 2: 待发货, 3: 待收货, 4: 已完成 + */ + ORDER_STATUS_CANCEL(0, "已取消"), + ORDER_STATUS_UNPAID(1, "待付款"), + ORDER_STATUS_UNSEND(2, "待发货"), + ORDER_STATUS_UNRECEIVED(3, "待收货"), + ORDER_STATUS_FINISHED(4, "已完成"), + ; + + final Integer code; + final String name; + + /** + * 匹配枚举值 + * + * @param name 名称 + * @return PillowHardnessEnum + */ + public static SleepingPostureEnum of(String name) { + if (name == null) { + return null; + } + for (SleepingPostureEnum smsEnum : SleepingPostureEnum.values()) { + if (smsEnum.name.equals(name)) { + return smsEnum; + } + } + return null; + } + + public static String getName(Integer code) { + for (SleepingPostureEnum value : SleepingPostureEnum.values()) { + if (value.getCode() == code) { + return value.getName(); + } + } + return ""; + } +} diff --git a/src/main/java/org/springblade/modules/desk/controller/OrderController.java b/src/main/java/org/springblade/modules/desk/controller/OrderController.java new file mode 100644 index 0000000..ff45bbd --- /dev/null +++ b/src/main/java/org/springblade/modules/desk/controller/OrderController.java @@ -0,0 +1,190 @@ +package org.springblade.modules.desk.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.common.enums.*; +import org.springblade.core.excel.util.ExcelUtil; +import org.springblade.core.launch.constant.AppConstant; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.*; +import org.springblade.modules.desk.entity.Order; +import org.springblade.modules.desk.service.IOrderService; +import org.springblade.modules.desk.vo.OrderExcelVO; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; +import java.util.List; + +/** + * @author liuqk + * @version 1.0 + * @date 2023-08-21 12:02 + */ +@RestController +@RequestMapping(AppConstant.APPLICATION_DESK_NAME + "/order") +@AllArgsConstructor +@CrossOrigin +@Slf4j +public class OrderController { + + private final IOrderService orderService; + + /** + * 详情 + */ + @GetMapping("/detail") + public R detail(@RequestParam String id) { + Order detail = orderService.getById(id); + return R.data(detail); + } + + /** + * 分页 + */ + @GetMapping("/page") + public R> page(Query query, String buyerName, String buyerPhone, String orderNo) { + LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(); + if (Func.isNotEmpty(buyerName)) { + wrapper.like(Order::getBuyerName, buyerName); + } + if (Func.isNotEmpty(buyerPhone)) { + wrapper.like(Order::getBuyerPhone, buyerPhone); + } + if (Func.isNotEmpty(orderNo)) { + wrapper.like(Order::getOrderNo, orderNo); + } + + IPage pages = orderService.page(Condition.getPage(query), wrapper); + return R.data(pages); + } + + /** + * 导出 + */ + @GetMapping("/export") + public void export(HttpServletResponse response, String buyerName, String buyerPhone, String orderNo) { + LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(); + if (Func.isNotEmpty(buyerName)) { + wrapper.like(Order::getBuyerName, buyerName); + } + if (Func.isNotEmpty(buyerPhone)) { + wrapper.like(Order::getBuyerPhone, buyerPhone); + } + if (Func.isNotEmpty(orderNo)) { + wrapper.like(Order::getOrderNo, orderNo); + } + + List dataList = orderService.list(wrapper); + + List vos = new ArrayList<>(); + dataList.forEach(item -> { + OrderExcelVO vo = BeanUtil.copy(item, OrderExcelVO.class); + vo.setStatusName(OrderStatusEnum.getName(item.getStatus())); + vos.add(vo); + }); + ExcelUtil.export(response, "订单" + DateUtil.time(), "订单表", vos, OrderExcelVO.class); + } + + /** + * 新增 + */ + @PostMapping("/save") + public R save(@RequestBody Order info) { + // 添加前, 若有未付款的, 不允许继续添加 + Order orderCheck = orderService.getOne(Wrappers.lambdaQuery() + .eq(Order::getBuyerPhone, info.getBuyerPhone()) + .eq(Order::getStatus, OrderStatusEnum.ORDER_STATUS_UNPAID.getCode())); + if (Func.isNotEmpty(orderCheck)) { + return R.fail("您当前有未付款的清单, 请支付."); + } + + return R.status(orderService.save(info)); + } + + /** + * 修改订单地址 + * + * @param consignee 收货人 + * @param consigneePhone 收货人电话 + * @param address 收货地址 + */ + @PostMapping("/updateAddress") + public R updateAddress(@RequestParam String id, @RequestParam String consignee, @RequestParam String consigneePhone, @RequestParam String address) { + // 只允许修改待发货之前的状态 + Order orderCheck = orderService.getById(id); + if (orderCheck.getStatus() == OrderStatusEnum.ORDER_STATUS_UNPAID.getCode() || orderCheck.getStatus() == OrderStatusEnum.ORDER_STATUS_UNSEND.getCode()) { + LambdaUpdateWrapper lambdaUpdateWrapper = new LambdaUpdateWrapper<>(); + lambdaUpdateWrapper + .eq(Order::getId, id) + .set(Order::getConsignee, consignee) + .set(Order::getConsigneePhone, consigneePhone) + .set(Order::getAddress, address) + ; + + return R.status(orderService.update(null, lambdaUpdateWrapper)); + } else { + return R.fail("只允许未付款和未发货状态的订单进行地址修改"); + } + } + + /** + * 支付成功回调 + */ + @PostMapping("/paySuccessCallback") + public R paySuccessCallback(@RequestParam String id) { + LambdaUpdateWrapper lambdaUpdateWrapper = new LambdaUpdateWrapper<>(); + lambdaUpdateWrapper + .eq(Order::getId, id) + .set(Order::getStatus, OrderStatusEnum.ORDER_STATUS_UNSEND.getCode()) + .set(Order::getPaymentTime, DateUtil.now()) + ; + + return R.status(orderService.update(null, lambdaUpdateWrapper)); + } + + /** + * 修改订单物流单号 + * + * @param id + * @param logisticsCompany 物流公司 + * @param logisticsCompanyCode 物流公司编码 + * @param logisticsNo 物流单号 + * @return + */ + @PostMapping("/updateLogistics") + public R updateLogistics(@RequestParam String id, @RequestParam String logisticsCompany, @RequestParam String logisticsCompanyCode, @RequestParam String logisticsNo) { + LambdaUpdateWrapper lambdaUpdateWrapper = new LambdaUpdateWrapper<>(); + lambdaUpdateWrapper + .eq(Order::getId, id) + .set(Order::getLogisticsCompany, logisticsCompany) + .set(Order::getLogisticsCompanyCode, logisticsCompanyCode) + .set(Order::getLogisticsNo, logisticsNo) + .set(Order::getStatus, OrderStatusEnum.ORDER_STATUS_UNRECEIVED.getCode()) + .set(Order::getDeliveryTime, DateUtil.now()) + ; + return R.status(orderService.update(null, lambdaUpdateWrapper)); + } + + + /** + * 确认收货 + */ + @PostMapping("/confirmReceive") + public R confirmReceive(@RequestParam String id) { + LambdaUpdateWrapper lambdaUpdateWrapper = new LambdaUpdateWrapper<>(); + lambdaUpdateWrapper + .eq(Order::getId, id) + .set(Order::getStatus, OrderStatusEnum.ORDER_STATUS_FINISHED.getCode()) + .set(Order::getTransactionTime, DateUtil.now()) + ; + + return R.status(orderService.update(null, lambdaUpdateWrapper)); + } +} diff --git a/src/main/java/org/springblade/modules/desk/entity/CustomMadeInfo.java b/src/main/java/org/springblade/modules/desk/entity/CustomMadeInfo.java index a4ca442..8dbd25c 100644 --- a/src/main/java/org/springblade/modules/desk/entity/CustomMadeInfo.java +++ b/src/main/java/org/springblade/modules/desk/entity/CustomMadeInfo.java @@ -12,7 +12,7 @@ import javax.validation.constraints.NotEmpty; * * @author liuqk * @version 1.0 - * @date 2023-07-25 17:47 + * @date 2023-08-21 11:35 */ @Data @EqualsAndHashCode(callSuper = true) @@ -20,6 +20,12 @@ import javax.validation.constraints.NotEmpty; public class CustomMadeInfo extends BaseEntity { private static final long serialVersionUID = 1L; + /** + * 购买渠道 + */ + @NotEmpty(message = "purchaseChannel should not be empty.") + private String purchaseChannel; + /** * 姓名 */ diff --git a/src/main/java/org/springblade/modules/desk/entity/Order.java b/src/main/java/org/springblade/modules/desk/entity/Order.java new file mode 100644 index 0000000..5546c2e --- /dev/null +++ b/src/main/java/org/springblade/modules/desk/entity/Order.java @@ -0,0 +1,126 @@ +package org.springblade.modules.desk.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * @author liuqk + * @version 1.0 + * @date 2023-08-21 9:35 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("eh_order") +public class Order extends BaseEntity { + private static final long serialVersionUID = 1L; + /** + * 订单编号 + */ + private String orderNo; + + /** + * 商品名称 + */ + private String goodsName; + + /** + * 购买件数 + */ + private Integer goodsNum; + + /** + * 商品价格 + */ + private Double goodsPrice; + + /** + * 购买人 + */ + private Long buyerId; + + /** + * 购买人名称 + */ + private String buyerName; + + /** + * 购买人电话 + */ + private String buyerPhone; + + /** + * 收获详细地址 + */ + private String address; + + /** + * 收货人 + */ + private String consignee; + + /** + * 收货人电话 + */ + private String consigneePhone; + + /** + * 物流公司 + */ + private String logisticsCompany; + + /** + * 物流公司编码 + */ + private String logisticsCompanyCode; + + /** + * 物流单号 + */ + private String logisticsNo; + + /** + * 付款时间 + */ + @DateTimeFormat( + pattern = "yyyy-MM-dd HH:mm:ss" + ) + @JsonFormat( + pattern = "yyyy-MM-dd HH:mm:ss" + ) + private Date paymentTime; + + /** + * 发货时间 + */ + @DateTimeFormat( + pattern = "yyyy-MM-dd HH:mm:ss" + ) + @JsonFormat( + pattern = "yyyy-MM-dd HH:mm:ss" + ) + private Date deliveryTime; + + /** + * 成交时间, 点击确认收货时更新此状态 + */ + @DateTimeFormat( + pattern = "yyyy-MM-dd HH:mm:ss" + ) + @JsonFormat( + pattern = "yyyy-MM-dd HH:mm:ss" + ) + private Date transactionTime; + + /** + * 订单状态 + * 待付款, 待发货, 待收货, 已完成 + */ + private Integer status; + +} diff --git a/src/main/java/org/springblade/modules/desk/mapper/OrderMapper.java b/src/main/java/org/springblade/modules/desk/mapper/OrderMapper.java new file mode 100644 index 0000000..069830d --- /dev/null +++ b/src/main/java/org/springblade/modules/desk/mapper/OrderMapper.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.springblade.modules.desk.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springblade.modules.desk.entity.CustomMadeInfo; +import org.springblade.modules.desk.entity.Order; + +/** + * Mapper 接口 + * + * @author liuqk + * @version 1.0 + * @date 2023-07-25 17:47 + */ +public interface OrderMapper extends BaseMapper { + + +} diff --git a/src/main/java/org/springblade/modules/desk/mapper/OrderMapper.xml b/src/main/java/org/springblade/modules/desk/mapper/OrderMapper.xml new file mode 100644 index 0000000..dd274db --- /dev/null +++ b/src/main/java/org/springblade/modules/desk/mapper/OrderMapper.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/org/springblade/modules/desk/service/IOrderService.java b/src/main/java/org/springblade/modules/desk/service/IOrderService.java new file mode 100644 index 0000000..3e8791e --- /dev/null +++ b/src/main/java/org/springblade/modules/desk/service/IOrderService.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.springblade.modules.desk.service; + +import org.springblade.core.mp.base.BaseService; +import org.springblade.modules.desk.entity.CustomMadeInfo; +import org.springblade.modules.desk.entity.Order; + +/** + * 服务类 + * + * @author liuqk + * @version 1.0 + * @date 2023-08-21 11:35 + */ +public interface IOrderService extends BaseService { + +} diff --git a/src/main/java/org/springblade/modules/desk/service/impl/OrderServiceImpl.java b/src/main/java/org/springblade/modules/desk/service/impl/OrderServiceImpl.java new file mode 100644 index 0000000..9703c83 --- /dev/null +++ b/src/main/java/org/springblade/modules/desk/service/impl/OrderServiceImpl.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.springblade.modules.desk.service.impl; + +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.modules.desk.entity.CustomMadeInfo; +import org.springblade.modules.desk.entity.Order; +import org.springblade.modules.desk.mapper.CustomMadeInfoMapper; +import org.springblade.modules.desk.mapper.OrderMapper; +import org.springblade.modules.desk.service.ICustomMadeInfoService; +import org.springblade.modules.desk.service.IOrderService; +import org.springframework.stereotype.Service; + +/** + * 服务实现类 + * + * @author liuqk + * @version 1.0 + * @date 2023-08-21 11:35 + */ +@Service +public class OrderServiceImpl extends BaseServiceImpl implements IOrderService { + + +} diff --git a/src/main/java/org/springblade/modules/desk/vo/OrderExcelVO.java b/src/main/java/org/springblade/modules/desk/vo/OrderExcelVO.java new file mode 100644 index 0000000..3e96f78 --- /dev/null +++ b/src/main/java/org/springblade/modules/desk/vo/OrderExcelVO.java @@ -0,0 +1,115 @@ +package org.springblade.modules.desk.vo; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.alibaba.excel.annotation.write.style.ContentRowHeight; +import com.alibaba.excel.annotation.write.style.HeadRowHeight; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * 定制信息表 + * + * @author liuqk + * @version 1.0 + * @date 2023-08-21 12:02 + */ +@Data +@ColumnWidth(25) +@HeadRowHeight(20) +@ContentRowHeight(18) +public class OrderExcelVO { + private static final long serialVersionUID = 1L; + /** + * 购买人名称 + */ + @ExcelProperty("姓名") + private String buyerName; + + /** + * 购买人电话 + */ + @ExcelProperty("手机") + private String buyerPhone; + + /** + * 订单编号 + */ + @ExcelProperty("订单编号") + private String orderNo; + /** + * 收获详细地址 + */ + @ExcelProperty("地址") + private String address; + + /** + * 收货人 + */ + @ExcelProperty("收货人") + private String consignee; + + /** + * 收货人电话 + */ + @ExcelProperty("收货人电话") + private String consigneePhone; + + /** + * 物流公司 + */ + @ExcelProperty("物流公司") + private String logisticsCompany; + + /** + * 物流单号 + */ + @ExcelProperty("物流单号") + private String logisticsNo; + + /** + * 付款时间 + */ + @DateTimeFormat( + pattern = "yyyy-MM-dd HH:mm:ss" + ) + @JsonFormat( + pattern = "yyyy-MM-dd HH:mm:ss" + ) + @ExcelProperty("付款时间") + private Date paymentTime; + + /** + * 发货时间 + */ + @DateTimeFormat( + pattern = "yyyy-MM-dd HH:mm:ss" + ) + @JsonFormat( + pattern = "yyyy-MM-dd HH:mm:ss" + ) + @ExcelProperty("发货时间") + private Date deliveryTime; + + /** + * 成交时间, 点击确认收货时更新此状态 + */ + @DateTimeFormat( + pattern = "yyyy-MM-dd HH:mm:ss" + ) + @JsonFormat( + pattern = "yyyy-MM-dd HH:mm:ss" + ) + @ExcelProperty("成交时间") + private Date transactionTime; + + /** + * 订单状态 + * 待付款, 待发货, 待收货, 已完成 + */ + @ExcelProperty("订单状态") + private String statusName; +} diff --git a/src/main/java/org/springblade/modules/system/controller/DictBizController.java b/src/main/java/org/springblade/modules/system/controller/DictBizController.java index f3b7b59..7ba5783 100644 --- a/src/main/java/org/springblade/modules/system/controller/DictBizController.java +++ b/src/main/java/org/springblade/modules/system/controller/DictBizController.java @@ -22,6 +22,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import io.swagger.annotations.*; import lombok.AllArgsConstructor; import org.springblade.common.constant.CommonConstant; +import org.springblade.common.constant.DictConstant; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.cache.utils.CacheUtil; import org.springblade.core.launch.constant.AppConstant; @@ -203,5 +204,27 @@ public class DictBizController extends BladeController { return R.data(list); } + /** + * 物流公司列表 + */ + @GetMapping("/get-logistics-companies") + @ApiOperation(value = "物流公司列表", notes = "物流公司列表") + public R> getLogisticsCompanies() { + List list = dictService.list(Wrappers.query().lambda() + .ne(DictBiz::getParentId, 0) + .eq(DictBiz::getCode, DictConstant.LOGISTICS_COMPANY_CODE)); + return R.data(list); + } + /** + * 购买渠道列表 + */ + @GetMapping("/get-purchase-channel") + @ApiOperation(value = "购买渠道列表", notes = "购买渠道列表") + public R> getPurchaseChannel() { + List list = dictService.list(Wrappers.query().lambda() + .ne(DictBiz::getParentId, 0) + .eq(DictBiz::getCode, DictConstant.PURCHASE_CHANNEL_CODE)); + return R.data(list); + } } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index b753d7c..7cd6cf4 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -183,8 +183,10 @@ blade: secure: #接口放行 skip-url: - - /blade-test/** + - /blade-desk/** - /blade-desk/custom-made-info/** + - /blade-system/dict-biz/get-logistics-companies + - /blade-system/dict-biz/get-purchase-channel #授权认证配置 auth: - method: ALL