Browse Source

add: 添加sale模块

gaohp 1 year ago
parent
commit
d93b037993
34 changed files with 1473 additions and 2 deletions
  1. 28 0
      feifan-module-sale/feifan-module-sale-api/pom.xml
  2. 16 0
      feifan-module-sale/feifan-module-sale-api/src/main/java/cn/newfeifan/sale/enums/ErrorCodeConstants.java
  3. 96 0
      feifan-module-sale/feifan-module-sale-biz/pom.xml
  4. 96 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/controller/admin/merchant/MerchantController.java
  5. 59 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/controller/admin/merchant/vo/MerchantPageReqVO.java
  6. 72 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/controller/admin/merchant/vo/MerchantRespVO.java
  7. 55 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/controller/admin/merchant/vo/MerchantSaveReqVO.java
  8. 96 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/controller/admin/shop/ShopController.java
  9. 31 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/controller/admin/shop/vo/ShopPageReqVO.java
  10. 36 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/controller/admin/shop/vo/ShopRespVO.java
  11. 27 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/controller/admin/shop/vo/ShopSaveReqVO.java
  12. 96 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/controller/admin/shopstatus/ShopStatusController.java
  13. 25 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/controller/admin/shopstatus/vo/ShopStatusPageReqVO.java
  14. 28 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/controller/admin/shopstatus/vo/ShopStatusRespVO.java
  15. 19 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/controller/admin/shopstatus/vo/ShopStatusSaveReqVO.java
  16. 80 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/dal/dataobject/merchant/MerchantDO.java
  17. 43 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/dal/dataobject/shop/ShopDO.java
  18. 35 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/dal/dataobject/shopstatus/ShopStatusDO.java
  19. 36 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/dal/mysql/merchant/MerchantMapper.java
  20. 27 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/dal/mysql/shop/ShopMapper.java
  21. 25 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/dal/mysql/shopstatus/ShopStatusMapper.java
  22. 54 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/service/merchant/MerchantService.java
  23. 72 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/service/merchant/MerchantServiceImpl.java
  24. 54 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/service/shop/ShopService.java
  25. 72 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/service/shop/ShopServiceImpl.java
  26. 54 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/service/shopstatus/ShopStatusService.java
  27. 71 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/service/shopstatus/ShopStatusServiceImpl.java
  28. 12 0
      feifan-module-sale/feifan-module-sale-biz/src/main/resources/mapper/merchant/MerchantMapper.xml
  29. 12 0
      feifan-module-sale/feifan-module-sale-biz/src/main/resources/mapper/shop/ShopMapper.xml
  30. 12 0
      feifan-module-sale/feifan-module-sale-biz/src/main/resources/mapper/shopstatus/ShopStatusMapper.xml
  31. 26 0
      feifan-module-sale/pom.xml
  32. 5 0
      feifan-server/pom.xml
  33. 1 1
      feifan-server/src/main/resources/application-local.yaml
  34. 2 1
      pom.xml

+ 28 - 0
feifan-module-sale/feifan-module-sale-api/pom.xml

@@ -0,0 +1,28 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>cn.newfeifan.sale</groupId>
+        <artifactId>feifan-module-sale</artifactId>
+        <version>${revision}</version> <!-- 1. 修改 version 为 ${revision} -->
+    </parent>
+
+    <artifactId>feifan-module-sale-api</artifactId>
+    <packaging>jar</packaging>
+
+    <name>${project.artifactId}</name> <!-- 3. 新增 name 为 ${project.artifactId} -->
+    <url>http://maven.apache.org</url>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+    <description> <!-- 4. 新增 description 为该模块的描述 -->
+        sale 模块,主要实现  商户 店铺 等功能。
+    </description>
+    <dependencies>  <!-- 5. 新增 yudao-common 依赖 -->
+        <dependency>
+            <groupId>cn.newfeifan.zx</groupId>
+            <artifactId>feifan-common</artifactId>
+        </dependency>
+    </dependencies>
+</project>

+ 16 - 0
feifan-module-sale/feifan-module-sale-api/src/main/java/cn/newfeifan/sale/enums/ErrorCodeConstants.java

@@ -0,0 +1,16 @@
+package cn.newfeifan.sale.enums;
+
+import cn.newfeifan.mall.framework.common.exception.ErrorCode;
+
+/**
+ * System 错误码枚举类
+ *
+ * system 系统,使用 1-002-000-000 段
+ */
+public interface ErrorCodeConstants {
+    // ========== 店铺商户信息 1-002-029-000 ==========
+    ErrorCode SHOP_STATUS_NOT_EXISTS = new ErrorCode(1_002_029_000 , "店铺状态不存在");
+    ErrorCode MERCHANT_NOT_EXISTS = new ErrorCode(1_002_029_001, "商户不存在");
+    ErrorCode SHOP_NOT_EXISTS = new ErrorCode(1_002_029_002, "店铺不存在不存在");
+
+}

+ 96 - 0
feifan-module-sale/feifan-module-sale-biz/pom.xml

@@ -0,0 +1,96 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>cn.newfeifan.sale</groupId>
+        <artifactId>feifan-module-sale</artifactId>
+        <version>${revision}</version>
+    </parent>
+
+    <artifactId>feifan-module-sale-biz</artifactId>
+    <packaging>jar</packaging>
+
+    <name>${project.artifactId}</name>
+    <url>http://maven.apache.org</url>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+    <description> <!-- 4. 新增 description 为该模块的描述 -->
+        sale 模块,主要实现  商户 店铺 等功能。
+    </description>
+
+    <dependencies>
+        <dependency>
+            <groupId>cn.newfeifan.sale</groupId>
+            <artifactId>feifan-module-sale-api</artifactId>
+            <version>${revision}</version>
+        </dependency>
+        <dependency>
+            <groupId>cn.newfeifan.zx</groupId>
+            <artifactId>feifan-module-system-api</artifactId>
+            <version>${revision}</version>
+        </dependency>
+        <dependency>
+            <groupId>cn.newfeifan.zx</groupId>
+            <artifactId>feifan-module-infra-api</artifactId>
+            <version>${revision}</version>
+        </dependency>
+
+        <!-- 业务组件 -->
+        <dependency>
+            <groupId>cn.newfeifan.zx</groupId>
+            <artifactId>feifan-spring-boot-starter-biz-operatelog</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>cn.newfeifan.zx</groupId>
+            <artifactId>feifan-spring-boot-starter-biz-tenant</artifactId>
+        </dependency>
+
+        <!-- Web 相关 -->
+        <dependency>
+            <groupId>cn.newfeifan.zx</groupId>
+            <artifactId>feifan-spring-boot-starter-security</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-validation</artifactId>
+        </dependency>
+
+        <!-- DB 相关 -->
+        <dependency>
+            <groupId>cn.newfeifan.zx</groupId>
+            <artifactId>feifan-spring-boot-starter-mybatis</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>cn.newfeifan.zx</groupId>
+            <artifactId>feifan-spring-boot-starter-redis</artifactId>
+        </dependency>
+
+        <!-- 消息队列相关 -->
+        <dependency>
+            <groupId>cn.newfeifan.zx</groupId>
+            <artifactId>feifan-spring-boot-starter-mq</artifactId>
+        </dependency>
+
+        <!-- Test 测试相关 -->
+        <dependency>
+            <groupId>cn.newfeifan.zx</groupId>
+            <artifactId>feifan-spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <!-- 工具类相关 -->
+        <dependency>
+            <groupId>cn.newfeifan.zx</groupId>
+            <artifactId>feifan-spring-boot-starter-excel</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>cn.newfeifan.zx</groupId>
+            <artifactId>feifan-spring-boot-starter-biz-ip</artifactId>
+        </dependency>
+    </dependencies>
+</project>

+ 96 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/controller/admin/merchant/MerchantController.java

@@ -0,0 +1,96 @@
+package cn.newfeifan.sale.controller.admin.merchant;
+
+import cn.newfeifan.sale.controller.admin.merchant.vo.MerchantPageReqVO;
+import cn.newfeifan.sale.controller.admin.merchant.vo.MerchantRespVO;
+import cn.newfeifan.sale.controller.admin.merchant.vo.MerchantSaveReqVO;
+import cn.newfeifan.sale.dal.dataobject.merchant.MerchantDO;
+import cn.newfeifan.sale.service.merchant.MerchantService;
+import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.security.access.prepost.PreAuthorize;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Operation;
+
+import javax.validation.*;
+import javax.servlet.http.*;
+import java.util.*;
+import java.io.IOException;
+
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.pojo.CommonResult;
+import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
+import static cn.newfeifan.mall.framework.common.pojo.CommonResult.success;
+
+import cn.newfeifan.mall.framework.excel.core.util.ExcelUtils;
+
+import cn.newfeifan.mall.framework.operatelog.core.annotations.OperateLog;
+import static cn.newfeifan.mall.framework.operatelog.core.enums.OperateTypeEnum.*;
+
+
+@Tag(name = "管理后台 - 商户")
+@RestController
+@RequestMapping("/sale/merchant")
+@Validated
+public class MerchantController {
+
+    @Resource
+    private MerchantService merchantService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建商户")
+    @PreAuthorize("@ss.hasPermission('sale:merchant:create')")
+    public CommonResult<Long> createMerchant(@Valid @RequestBody MerchantSaveReqVO createReqVO) {
+        return success(merchantService.createMerchant(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新商户")
+    @PreAuthorize("@ss.hasPermission('sale:merchant:update')")
+    public CommonResult<Boolean> updateMerchant(@Valid @RequestBody MerchantSaveReqVO updateReqVO) {
+        merchantService.updateMerchant(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除商户")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('sale:merchant:delete')")
+    public CommonResult<Boolean> deleteMerchant(@RequestParam("id") Long id) {
+        merchantService.deleteMerchant(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得商户")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('sale:merchant:query')")
+    public CommonResult<MerchantRespVO> getMerchant(@RequestParam("id") Long id) {
+        MerchantDO merchant = merchantService.getMerchant(id);
+        return success(BeanUtils.toBean(merchant, MerchantRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得商户分页")
+    @PreAuthorize("@ss.hasPermission('sale:merchant:query')")
+    public CommonResult<PageResult<MerchantRespVO>> getMerchantPage(@Valid MerchantPageReqVO pageReqVO) {
+        PageResult<MerchantDO> pageResult = merchantService.getMerchantPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, MerchantRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出商户 Excel")
+    @PreAuthorize("@ss.hasPermission('sale:merchant:export')")
+    @OperateLog(type = EXPORT)
+    public void exportMerchantExcel(@Valid MerchantPageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<MerchantDO> list = merchantService.getMerchantPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "商户.xls", "数据", MerchantRespVO.class,
+                        BeanUtils.toBean(list, MerchantRespVO.class));
+    }
+
+}

+ 59 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/controller/admin/merchant/vo/MerchantPageReqVO.java

@@ -0,0 +1,59 @@
+package cn.newfeifan.sale.controller.admin.merchant.vo;
+
+import lombok.*;
+import java.util.*;
+import io.swagger.v3.oas.annotations.media.Schema;
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
+import static cn.newfeifan.mall.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 商户分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class MerchantPageReqVO extends PageParam {
+
+    @Schema(description = "商户名称", example = "李四")
+    private String name;
+
+    @Schema(description = "商户状态,关联商户状态表", example = "2")
+    private Integer status;
+
+    @Schema(description = "简介", example = "随便")
+    private String description;
+
+    @Schema(description = "负责人")
+    private String contact;
+
+    @Schema(description = "所在地")
+    private String address;
+
+    @Schema(description = "负责人电话")
+    private String contactNumber;
+
+    @Schema(description = "官网")
+    private String website;
+
+    @Schema(description = "维权电话")
+    private String complaintsHotline;
+
+    @Schema(description = "客服电话")
+    private String customerServiceHotline;
+
+    @Schema(description = "邮箱")
+    private String email;
+
+    @Schema(description = "营业执照图片路径")
+    private String businessLicensePicture;
+
+    @Schema(description = "服务到期时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] expireTime;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}

+ 72 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/controller/admin/merchant/vo/MerchantRespVO.java

@@ -0,0 +1,72 @@
+package cn.newfeifan.sale.controller.admin.merchant.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import java.util.*;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+import com.alibaba.excel.annotation.*;
+
+@Schema(description = "管理后台 - 商户 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class MerchantRespVO {
+
+    @Schema(description = "商户id", requiredMode = Schema.RequiredMode.REQUIRED, example = "24252")
+    @ExcelProperty("商户id")
+    private Long id;
+
+    @Schema(description = "商户名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
+    @ExcelProperty("商户名称")
+    private String name;
+
+    @Schema(description = "商户状态,关联商户状态表", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
+    @ExcelProperty("商户状态,关联商户状态表")
+    private Integer status;
+
+    @Schema(description = "简介", example = "随便")
+    @ExcelProperty("简介")
+    private String description;
+
+    @Schema(description = "负责人")
+    @ExcelProperty("负责人")
+    private String contact;
+
+    @Schema(description = "所在地")
+    @ExcelProperty("所在地")
+    private String address;
+
+    @Schema(description = "负责人电话")
+    @ExcelProperty("负责人电话")
+    private String contactNumber;
+
+    @Schema(description = "官网")
+    @ExcelProperty("官网")
+    private String website;
+
+    @Schema(description = "维权电话")
+    @ExcelProperty("维权电话")
+    private String complaintsHotline;
+
+    @Schema(description = "客服电话")
+    @ExcelProperty("客服电话")
+    private String customerServiceHotline;
+
+    @Schema(description = "邮箱")
+    @ExcelProperty("邮箱")
+    private String email;
+
+    @Schema(description = "营业执照图片路径")
+    @ExcelProperty("营业执照图片路径")
+    private String businessLicensePicture;
+
+    @Schema(description = "服务到期时间")
+    @ExcelProperty("服务到期时间")
+    private LocalDateTime expireTime;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+}

+ 55 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/controller/admin/merchant/vo/MerchantSaveReqVO.java

@@ -0,0 +1,55 @@
+package cn.newfeifan.sale.controller.admin.merchant.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import javax.validation.constraints.*;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - 商户新增/修改 Request VO")
+@Data
+public class MerchantSaveReqVO {
+
+    @Schema(description = "商户id", requiredMode = Schema.RequiredMode.REQUIRED, example = "24252")
+    private Long id;
+
+    @Schema(description = "商户名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
+    @NotEmpty(message = "商户名称不能为空")
+    private String name;
+
+    @Schema(description = "商户状态,关联商户状态表", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
+    @NotNull(message = "商户状态,关联商户状态表不能为空")
+    private Integer status;
+
+    @Schema(description = "简介", example = "随便")
+    private String description;
+
+    @Schema(description = "负责人")
+    private String contact;
+
+    @Schema(description = "所在地")
+    private String address;
+
+    @Schema(description = "负责人电话")
+    private String contactNumber;
+
+    @Schema(description = "官网")
+    private String website;
+
+    @Schema(description = "维权电话")
+    private String complaintsHotline;
+
+    @Schema(description = "客服电话")
+    private String customerServiceHotline;
+
+    @Schema(description = "邮箱")
+    private String email;
+
+    @Schema(description = "营业执照图片路径")
+    private String businessLicensePicture;
+
+    @Schema(description = "服务到期时间")
+    private LocalDateTime expireTime;
+
+}

+ 96 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/controller/admin/shop/ShopController.java

@@ -0,0 +1,96 @@
+package cn.newfeifan.sale.controller.admin.shop;
+
+import cn.newfeifan.sale.controller.admin.shop.vo.ShopPageReqVO;
+import cn.newfeifan.sale.controller.admin.shop.vo.ShopRespVO;
+import cn.newfeifan.sale.controller.admin.shop.vo.ShopSaveReqVO;
+import cn.newfeifan.sale.dal.dataobject.shop.ShopDO;
+import cn.newfeifan.sale.service.shop.ShopService;
+import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.security.access.prepost.PreAuthorize;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Operation;
+
+import javax.validation.*;
+import javax.servlet.http.*;
+import java.util.*;
+import java.io.IOException;
+
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.pojo.CommonResult;
+import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
+import static cn.newfeifan.mall.framework.common.pojo.CommonResult.success;
+
+import cn.newfeifan.mall.framework.excel.core.util.ExcelUtils;
+
+import cn.newfeifan.mall.framework.operatelog.core.annotations.OperateLog;
+import static cn.newfeifan.mall.framework.operatelog.core.enums.OperateTypeEnum.*;
+
+
+@Tag(name = "管理后台 - 店铺")
+@RestController
+@RequestMapping("/sale/shop")
+@Validated
+public class ShopController {
+
+    @Resource
+    private ShopService shopService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建店铺")
+    @PreAuthorize("@ss.hasPermission('sale:shop:create')")
+    public CommonResult<Long> createShop(@Valid @RequestBody ShopSaveReqVO createReqVO) {
+        return success(shopService.createShop(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新店铺")
+    @PreAuthorize("@ss.hasPermission('sale:shop:update')")
+    public CommonResult<Boolean> updateShop(@Valid @RequestBody ShopSaveReqVO updateReqVO) {
+        shopService.updateShop(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除店铺")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('sale:shop:delete')")
+    public CommonResult<Boolean> deleteShop(@RequestParam("id") Long id) {
+        shopService.deleteShop(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得店铺")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('sale:shop:query')")
+    public CommonResult<ShopRespVO> getShop(@RequestParam("id") Long id) {
+        ShopDO shop = shopService.getShop(id);
+        return success(BeanUtils.toBean(shop, ShopRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得店铺分页")
+    @PreAuthorize("@ss.hasPermission('sale:shop:query')")
+    public CommonResult<PageResult<ShopRespVO>> getShopPage(@Valid ShopPageReqVO pageReqVO) {
+        PageResult<ShopDO> pageResult = shopService.getShopPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, ShopRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出店铺 Excel")
+    @PreAuthorize("@ss.hasPermission('sale:shop:export')")
+    @OperateLog(type = EXPORT)
+    public void exportShopExcel(@Valid ShopPageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<ShopDO> list = shopService.getShopPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "店铺.xls", "数据", ShopRespVO.class,
+                        BeanUtils.toBean(list, ShopRespVO.class));
+    }
+
+}

+ 31 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/controller/admin/shop/vo/ShopPageReqVO.java

@@ -0,0 +1,31 @@
+package cn.newfeifan.sale.controller.admin.shop.vo;
+
+import lombok.*;
+import java.util.*;
+import io.swagger.v3.oas.annotations.media.Schema;
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
+import static cn.newfeifan.mall.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 店铺分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class ShopPageReqVO extends PageParam {
+
+    @Schema(description = "店铺名称", example = "李四")
+    private String name;
+
+    @Schema(description = "店铺状态", example = "1")
+    private Integer status;
+
+    @Schema(description = "商户id", example = "3447")
+    private Long merchantId;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}

+ 36 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/controller/admin/shop/vo/ShopRespVO.java

@@ -0,0 +1,36 @@
+package cn.newfeifan.sale.controller.admin.shop.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import java.util.*;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+import com.alibaba.excel.annotation.*;
+
+@Schema(description = "管理后台 - 店铺 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class ShopRespVO {
+
+    @Schema(description = "店铺id", requiredMode = Schema.RequiredMode.REQUIRED, example = "15084")
+    @ExcelProperty("店铺id")
+    private Long id;
+
+    @Schema(description = "店铺名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
+    @ExcelProperty("店铺名称")
+    private String name;
+
+    @Schema(description = "店铺状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+    @ExcelProperty("店铺状态")
+    private Integer status;
+
+    @Schema(description = "商户id", requiredMode = Schema.RequiredMode.REQUIRED, example = "3447")
+    @ExcelProperty("商户id")
+    private Long merchantId;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+}

+ 27 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/controller/admin/shop/vo/ShopSaveReqVO.java

@@ -0,0 +1,27 @@
+package cn.newfeifan.sale.controller.admin.shop.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import javax.validation.constraints.*;
+
+@Schema(description = "管理后台 - 店铺新增/修改 Request VO")
+@Data
+public class ShopSaveReqVO {
+
+    @Schema(description = "店铺id", requiredMode = Schema.RequiredMode.REQUIRED, example = "15084")
+    private Long id;
+
+    @Schema(description = "店铺名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
+    @NotEmpty(message = "店铺名称不能为空")
+    private String name;
+
+    @Schema(description = "店铺状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+    @NotNull(message = "店铺状态不能为空")
+    private Integer status;
+
+    @Schema(description = "商户id", requiredMode = Schema.RequiredMode.REQUIRED, example = "3447")
+    @NotNull(message = "商户id不能为空")
+    private Long merchantId;
+
+}

+ 96 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/controller/admin/shopstatus/ShopStatusController.java

@@ -0,0 +1,96 @@
+package cn.newfeifan.sale.controller.admin.shopstatus;
+
+import cn.newfeifan.sale.controller.admin.shopstatus.vo.ShopStatusPageReqVO;
+import cn.newfeifan.sale.controller.admin.shopstatus.vo.ShopStatusRespVO;
+import cn.newfeifan.sale.controller.admin.shopstatus.vo.ShopStatusSaveReqVO;
+import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.security.access.prepost.PreAuthorize;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Operation;
+
+import javax.validation.*;
+import javax.servlet.http.*;
+import java.util.*;
+import java.io.IOException;
+
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.pojo.CommonResult;
+import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
+import static cn.newfeifan.mall.framework.common.pojo.CommonResult.success;
+
+import cn.newfeifan.mall.framework.excel.core.util.ExcelUtils;
+
+import cn.newfeifan.mall.framework.operatelog.core.annotations.OperateLog;
+import static cn.newfeifan.mall.framework.operatelog.core.enums.OperateTypeEnum.*;
+
+import cn.newfeifan.sale.dal.dataobject.shopstatus.ShopStatusDO;
+import cn.newfeifan.sale.service.shopstatus.ShopStatusService;
+
+@Tag(name = "管理后台 - 店铺状态")
+@RestController
+@RequestMapping("/sale/shop-status")
+@Validated
+public class ShopStatusController {
+
+    @Resource
+    private ShopStatusService shopStatusService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建店铺状态")
+    @PreAuthorize("@ss.hasPermission('sale:shop-status:create')")
+    public CommonResult<Long> createShopStatus(@Valid @RequestBody ShopStatusSaveReqVO createReqVO) {
+        return success(shopStatusService.createShopStatus(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新店铺状态")
+    @PreAuthorize("@ss.hasPermission('sale:shop-status:update')")
+    public CommonResult<Boolean> updateShopStatus(@Valid @RequestBody ShopStatusSaveReqVO updateReqVO) {
+        shopStatusService.updateShopStatus(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除店铺状态")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('sale:shop-status:delete')")
+    public CommonResult<Boolean> deleteShopStatus(@RequestParam("id") Long id) {
+        shopStatusService.deleteShopStatus(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得店铺状态")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('sale:shop-status:query')")
+    public CommonResult<ShopStatusRespVO> getShopStatus(@RequestParam("id") Long id) {
+        ShopStatusDO shopStatus = shopStatusService.getShopStatus(id);
+        return success(BeanUtils.toBean(shopStatus, ShopStatusRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得店铺状态分页")
+    @PreAuthorize("@ss.hasPermission('sale:shop-status:query')")
+    public CommonResult<PageResult<ShopStatusRespVO>> getShopStatusPage(@Valid ShopStatusPageReqVO pageReqVO) {
+        PageResult<ShopStatusDO> pageResult = shopStatusService.getShopStatusPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, ShopStatusRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出店铺状态 Excel")
+    @PreAuthorize("@ss.hasPermission('sale:shop-status:export')")
+    @OperateLog(type = EXPORT)
+    public void exportShopStatusExcel(@Valid ShopStatusPageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<ShopStatusDO> list = shopStatusService.getShopStatusPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "店铺状态.xls", "数据", ShopStatusRespVO.class,
+                        BeanUtils.toBean(list, ShopStatusRespVO.class));
+    }
+
+}

+ 25 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/controller/admin/shopstatus/vo/ShopStatusPageReqVO.java

@@ -0,0 +1,25 @@
+package cn.newfeifan.sale.controller.admin.shopstatus.vo;
+
+import lombok.*;
+import java.util.*;
+import io.swagger.v3.oas.annotations.media.Schema;
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
+import static cn.newfeifan.mall.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 店铺状态分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class ShopStatusPageReqVO extends PageParam {
+
+    @Schema(description = "名称", example = "王五")
+    private String name;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}

+ 28 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/controller/admin/shopstatus/vo/ShopStatusRespVO.java

@@ -0,0 +1,28 @@
+package cn.newfeifan.sale.controller.admin.shopstatus.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import java.util.*;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+import com.alibaba.excel.annotation.*;
+
+@Schema(description = "管理后台 - 店铺状态 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class ShopStatusRespVO {
+
+    @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "31352")
+    @ExcelProperty("id")
+    private Long id;
+
+    @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
+    @ExcelProperty("名称")
+    private String name;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+}

+ 19 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/controller/admin/shopstatus/vo/ShopStatusSaveReqVO.java

@@ -0,0 +1,19 @@
+package cn.newfeifan.sale.controller.admin.shopstatus.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import javax.validation.constraints.*;
+
+@Schema(description = "管理后台 - 店铺状态新增/修改 Request VO")
+@Data
+public class ShopStatusSaveReqVO {
+
+    @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "31352")
+    private Long id;
+
+    @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
+    @NotEmpty(message = "名称不能为空")
+    private String name;
+
+}

+ 80 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/dal/dataobject/merchant/MerchantDO.java

@@ -0,0 +1,80 @@
+package cn.newfeifan.sale.dal.dataobject.merchant;
+
+import lombok.*;
+import java.util.*;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.*;
+import cn.newfeifan.mall.framework.mybatis.core.dataobject.BaseDO;
+
+/**
+ * 商户 DO
+ *
+ * @author 非繁人
+ */
+@TableName("sale_merchant")
+@KeySequence("sale_merchant_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class MerchantDO extends BaseDO {
+
+    /**
+     * 商户id
+     */
+    @TableId
+    private Long id;
+    /**
+     * 商户名称
+     */
+    private String name;
+    /**
+     * 商户状态,关联商户状态表
+     */
+    private Integer status;
+    /**
+     * 简介
+     */
+    private String description;
+    /**
+     * 负责人
+     */
+    private String contact;
+    /**
+     * 所在地
+     */
+    private String address;
+    /**
+     * 负责人电话
+     */
+    private String contactNumber;
+    /**
+     * 官网
+     */
+    private String website;
+    /**
+     * 维权电话
+     */
+    private String complaintsHotline;
+    /**
+     * 客服电话
+     */
+    private String customerServiceHotline;
+    /**
+     * 邮箱
+     */
+    private String email;
+    /**
+     * 营业执照图片路径
+     */
+    private String businessLicensePicture;
+    /**
+     * 服务到期时间
+     */
+    private LocalDateTime expireTime;
+
+}

+ 43 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/dal/dataobject/shop/ShopDO.java

@@ -0,0 +1,43 @@
+package cn.newfeifan.sale.dal.dataobject.shop;
+
+import lombok.*;
+import java.util.*;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.*;
+import cn.newfeifan.mall.framework.mybatis.core.dataobject.BaseDO;
+
+/**
+ * 店铺 DO
+ *
+ * @author 非繁人
+ */
+@TableName("sale_shop")
+@KeySequence("sale_shop_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class ShopDO extends BaseDO {
+
+    /**
+     * 店铺id
+     */
+    @TableId
+    private Long id;
+    /**
+     * 店铺名称
+     */
+    private String name;
+    /**
+     * 店铺状态
+     */
+    private Integer status;
+    /**
+     * 商户id
+     */
+    private Long merchantId;
+
+}

+ 35 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/dal/dataobject/shopstatus/ShopStatusDO.java

@@ -0,0 +1,35 @@
+package cn.newfeifan.sale.dal.dataobject.shopstatus;
+
+import lombok.*;
+import java.util.*;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.*;
+import cn.newfeifan.mall.framework.mybatis.core.dataobject.BaseDO;
+
+/**
+ * 店铺状态 DO
+ *
+ * @author 非繁人
+ */
+@TableName("sale_shop_status")
+@KeySequence("sale_shop_status_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class ShopStatusDO extends BaseDO {
+
+    /**
+     * id
+     */
+    @TableId
+    private Long id;
+    /**
+     * 名称
+     */
+    private String name;
+
+}

+ 36 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/dal/mysql/merchant/MerchantMapper.java

@@ -0,0 +1,36 @@
+package cn.newfeifan.sale.dal.mysql.merchant;
+
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.newfeifan.mall.framework.mybatis.core.mapper.BaseMapperX;
+import cn.newfeifan.sale.controller.admin.merchant.vo.MerchantPageReqVO;
+import cn.newfeifan.sale.dal.dataobject.merchant.MerchantDO;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 商户 Mapper
+ *
+ * @author 非繁人
+ */
+@Mapper
+public interface MerchantMapper extends BaseMapperX<MerchantDO> {
+
+    default PageResult<MerchantDO> selectPage(MerchantPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<MerchantDO>()
+                .likeIfPresent(MerchantDO::getName, reqVO.getName())
+                .eqIfPresent(MerchantDO::getStatus, reqVO.getStatus())
+                .eqIfPresent(MerchantDO::getDescription, reqVO.getDescription())
+                .eqIfPresent(MerchantDO::getContact, reqVO.getContact())
+                .eqIfPresent(MerchantDO::getAddress, reqVO.getAddress())
+                .eqIfPresent(MerchantDO::getContactNumber, reqVO.getContactNumber())
+                .eqIfPresent(MerchantDO::getWebsite, reqVO.getWebsite())
+                .eqIfPresent(MerchantDO::getComplaintsHotline, reqVO.getComplaintsHotline())
+                .eqIfPresent(MerchantDO::getCustomerServiceHotline, reqVO.getCustomerServiceHotline())
+                .eqIfPresent(MerchantDO::getEmail, reqVO.getEmail())
+                .eqIfPresent(MerchantDO::getBusinessLicensePicture, reqVO.getBusinessLicensePicture())
+                .betweenIfPresent(MerchantDO::getExpireTime, reqVO.getExpireTime())
+                .betweenIfPresent(MerchantDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(MerchantDO::getId));
+    }
+
+}

+ 27 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/dal/mysql/shop/ShopMapper.java

@@ -0,0 +1,27 @@
+package cn.newfeifan.sale.dal.mysql.shop;
+
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.newfeifan.mall.framework.mybatis.core.mapper.BaseMapperX;
+import cn.newfeifan.sale.dal.dataobject.shop.ShopDO;
+import cn.newfeifan.sale.controller.admin.shop.vo.ShopPageReqVO;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 店铺 Mapper
+ *
+ * @author 非繁人
+ */
+@Mapper
+public interface ShopMapper extends BaseMapperX<ShopDO> {
+
+    default PageResult<ShopDO> selectPage(ShopPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<ShopDO>()
+                .likeIfPresent(ShopDO::getName, reqVO.getName())
+                .eqIfPresent(ShopDO::getStatus, reqVO.getStatus())
+                .eqIfPresent(ShopDO::getMerchantId, reqVO.getMerchantId())
+                .betweenIfPresent(ShopDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(ShopDO::getId));
+    }
+
+}

+ 25 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/dal/mysql/shopstatus/ShopStatusMapper.java

@@ -0,0 +1,25 @@
+package cn.newfeifan.sale.dal.mysql.shopstatus;
+
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.newfeifan.mall.framework.mybatis.core.mapper.BaseMapperX;
+import cn.newfeifan.sale.controller.admin.shopstatus.vo.ShopStatusPageReqVO;
+import cn.newfeifan.sale.dal.dataobject.shopstatus.ShopStatusDO;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 店铺状态 Mapper
+ *
+ * @author 非繁人
+ */
+@Mapper
+public interface ShopStatusMapper extends BaseMapperX<ShopStatusDO> {
+
+    default PageResult<ShopStatusDO> selectPage(ShopStatusPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<ShopStatusDO>()
+                .likeIfPresent(ShopStatusDO::getName, reqVO.getName())
+                .betweenIfPresent(ShopStatusDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(ShopStatusDO::getId));
+    }
+
+}

+ 54 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/service/merchant/MerchantService.java

@@ -0,0 +1,54 @@
+package cn.newfeifan.sale.service.merchant;
+
+import javax.validation.*;
+import cn.newfeifan.sale.controller.admin.merchant.vo.MerchantPageReqVO;
+import cn.newfeifan.sale.controller.admin.merchant.vo.MerchantSaveReqVO;
+import cn.newfeifan.sale.dal.dataobject.merchant.MerchantDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+
+/**
+ * 商户 Service 接口
+ *
+ * @author 非繁人
+ */
+public interface MerchantService {
+
+    /**
+     * 创建商户
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createMerchant(@Valid MerchantSaveReqVO createReqVO);
+
+    /**
+     * 更新商户
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateMerchant(@Valid MerchantSaveReqVO updateReqVO);
+
+    /**
+     * 删除商户
+     *
+     * @param id 编号
+     */
+    void deleteMerchant(Long id);
+
+    /**
+     * 获得商户
+     *
+     * @param id 编号
+     * @return 商户
+     */
+    MerchantDO getMerchant(Long id);
+
+    /**
+     * 获得商户分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 商户分页
+     */
+    PageResult<MerchantDO> getMerchantPage(MerchantPageReqVO pageReqVO);
+
+}

+ 72 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/service/merchant/MerchantServiceImpl.java

@@ -0,0 +1,72 @@
+package cn.newfeifan.sale.service.merchant;
+
+import cn.newfeifan.sale.controller.admin.merchant.vo.MerchantPageReqVO;
+import cn.newfeifan.sale.controller.admin.merchant.vo.MerchantSaveReqVO;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+
+import cn.newfeifan.sale.dal.dataobject.merchant.MerchantDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
+
+import cn.newfeifan.sale.dal.mysql.merchant.MerchantMapper;
+
+import static cn.newfeifan.mall.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.newfeifan.sale.enums.ErrorCodeConstants.MERCHANT_NOT_EXISTS;
+
+/**
+ * 商户 Service 实现类
+ *
+ * @author 非繁人
+ */
+@Service
+@Validated
+public class MerchantServiceImpl implements MerchantService {
+
+    @Resource
+    private MerchantMapper merchantMapper;
+
+    @Override
+    public Long createMerchant(MerchantSaveReqVO createReqVO) {
+        // 插入
+        MerchantDO merchant = BeanUtils.toBean(createReqVO, MerchantDO.class);
+        merchantMapper.insert(merchant);
+        // 返回
+        return merchant.getId();
+    }
+
+    @Override
+    public void updateMerchant(MerchantSaveReqVO updateReqVO) {
+        // 校验存在
+        validateMerchantExists(updateReqVO.getId());
+        // 更新
+        MerchantDO updateObj = BeanUtils.toBean(updateReqVO, MerchantDO.class);
+        merchantMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteMerchant(Long id) {
+        // 校验存在
+        validateMerchantExists(id);
+        // 删除
+        merchantMapper.deleteById(id);
+    }
+
+    private void validateMerchantExists(Long id) {
+        if (merchantMapper.selectById(id) == null) {
+            throw exception(MERCHANT_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public MerchantDO getMerchant(Long id) {
+        return merchantMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<MerchantDO> getMerchantPage(MerchantPageReqVO pageReqVO) {
+        return merchantMapper.selectPage(pageReqVO);
+    }
+
+}

+ 54 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/service/shop/ShopService.java

@@ -0,0 +1,54 @@
+package cn.newfeifan.sale.service.shop;
+
+import javax.validation.*;
+import cn.newfeifan.sale.controller.admin.shop.vo.ShopPageReqVO;
+import cn.newfeifan.sale.controller.admin.shop.vo.ShopSaveReqVO;
+import cn.newfeifan.sale.dal.dataobject.shop.ShopDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+
+/**
+ * 店铺 Service 接口
+ *
+ * @author 非繁人
+ */
+public interface ShopService {
+
+    /**
+     * 创建店铺
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createShop(@Valid ShopSaveReqVO createReqVO);
+
+    /**
+     * 更新店铺
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateShop(@Valid ShopSaveReqVO updateReqVO);
+
+    /**
+     * 删除店铺
+     *
+     * @param id 编号
+     */
+    void deleteShop(Long id);
+
+    /**
+     * 获得店铺
+     *
+     * @param id 编号
+     * @return 店铺
+     */
+    ShopDO getShop(Long id);
+
+    /**
+     * 获得店铺分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 店铺分页
+     */
+    PageResult<ShopDO> getShopPage(ShopPageReqVO pageReqVO);
+
+}

+ 72 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/service/shop/ShopServiceImpl.java

@@ -0,0 +1,72 @@
+package cn.newfeifan.sale.service.shop;
+
+import cn.newfeifan.sale.controller.admin.shop.vo.ShopPageReqVO;
+import cn.newfeifan.sale.controller.admin.shop.vo.ShopSaveReqVO;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+
+import cn.newfeifan.sale.dal.dataobject.shop.ShopDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
+
+import cn.newfeifan.sale.dal.mysql.shop.ShopMapper;
+
+import static cn.newfeifan.mall.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.newfeifan.sale.enums.ErrorCodeConstants.SHOP_NOT_EXISTS;
+
+/**
+ * 店铺 Service 实现类
+ *
+ * @author 非繁人
+ */
+@Service
+@Validated
+public class ShopServiceImpl implements ShopService {
+
+    @Resource
+    private ShopMapper shopMapper;
+
+    @Override
+    public Long createShop(ShopSaveReqVO createReqVO) {
+        // 插入
+        ShopDO shop = BeanUtils.toBean(createReqVO, ShopDO.class);
+        shopMapper.insert(shop);
+        // 返回
+        return shop.getId();
+    }
+
+    @Override
+    public void updateShop(ShopSaveReqVO updateReqVO) {
+        // 校验存在
+        validateShopExists(updateReqVO.getId());
+        // 更新
+        ShopDO updateObj = BeanUtils.toBean(updateReqVO, ShopDO.class);
+        shopMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteShop(Long id) {
+        // 校验存在
+        validateShopExists(id);
+        // 删除
+        shopMapper.deleteById(id);
+    }
+
+    private void validateShopExists(Long id) {
+        if (shopMapper.selectById(id) == null) {
+            throw exception(SHOP_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public ShopDO getShop(Long id) {
+        return shopMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<ShopDO> getShopPage(ShopPageReqVO pageReqVO) {
+        return shopMapper.selectPage(pageReqVO);
+    }
+
+}

+ 54 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/service/shopstatus/ShopStatusService.java

@@ -0,0 +1,54 @@
+package cn.newfeifan.sale.service.shopstatus;
+
+import javax.validation.*;
+import cn.newfeifan.sale.dal.dataobject.shopstatus.ShopStatusDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.sale.controller.admin.shopstatus.vo.ShopStatusPageReqVO;
+import cn.newfeifan.sale.controller.admin.shopstatus.vo.ShopStatusSaveReqVO;
+
+/**
+ * 店铺状态 Service 接口
+ *
+ * @author 非繁人
+ */
+public interface ShopStatusService {
+
+    /**
+     * 创建店铺状态
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createShopStatus(@Valid ShopStatusSaveReqVO createReqVO);
+
+    /**
+     * 更新店铺状态
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateShopStatus(@Valid ShopStatusSaveReqVO updateReqVO);
+
+    /**
+     * 删除店铺状态
+     *
+     * @param id 编号
+     */
+    void deleteShopStatus(Long id);
+
+    /**
+     * 获得店铺状态
+     *
+     * @param id 编号
+     * @return 店铺状态
+     */
+    ShopStatusDO getShopStatus(Long id);
+
+    /**
+     * 获得店铺状态分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 店铺状态分页
+     */
+    PageResult<ShopStatusDO> getShopStatusPage(ShopStatusPageReqVO pageReqVO);
+
+}

+ 71 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/sale/service/shopstatus/ShopStatusServiceImpl.java

@@ -0,0 +1,71 @@
+package cn.newfeifan.sale.service.shopstatus;
+
+import cn.newfeifan.mall.framework.common.exception.util.ServiceExceptionUtil;
+import cn.newfeifan.sale.controller.admin.shopstatus.vo.ShopStatusPageReqVO;
+import cn.newfeifan.sale.controller.admin.shopstatus.vo.ShopStatusSaveReqVO;
+import cn.newfeifan.sale.dal.dataobject.shopstatus.ShopStatusDO;
+import cn.newfeifan.sale.dal.mysql.shopstatus.ShopStatusMapper;
+import cn.newfeifan.sale.enums.ErrorCodeConstants;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
+
+
+/**
+ * 店铺状态 Service 实现类
+ *
+ * @author 非繁人
+ */
+@Service
+@Validated
+public class ShopStatusServiceImpl implements ShopStatusService {
+
+    @Resource
+    private ShopStatusMapper shopStatusMapper;
+
+    @Override
+    public Long createShopStatus(ShopStatusSaveReqVO createReqVO) {
+        // 插入
+        ShopStatusDO shopStatus = BeanUtils.toBean(createReqVO, ShopStatusDO.class);
+        shopStatusMapper.insert(shopStatus);
+        // 返回
+        return shopStatus.getId();
+    }
+
+    @Override
+    public void updateShopStatus(ShopStatusSaveReqVO updateReqVO) {
+        // 校验存在
+        validateShopStatusExists(updateReqVO.getId());
+        // 更新
+        ShopStatusDO updateObj = BeanUtils.toBean(updateReqVO, ShopStatusDO.class);
+        shopStatusMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteShopStatus(Long id) {
+        // 校验存在
+        validateShopStatusExists(id);
+        // 删除
+        shopStatusMapper.deleteById(id);
+    }
+
+    private void validateShopStatusExists(Long id) {
+        if (shopStatusMapper.selectById(id) == null) {
+            throw ServiceExceptionUtil.exception(ErrorCodeConstants.SHOP_STATUS_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public ShopStatusDO getShopStatus(Long id) {
+        return shopStatusMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<ShopStatusDO> getShopStatusPage(ShopStatusPageReqVO pageReqVO) {
+        return shopStatusMapper.selectPage(pageReqVO);
+    }
+
+}

+ 12 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/resources/mapper/merchant/MerchantMapper.xml

@@ -0,0 +1,12 @@
+<?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="cn.newfeifan.sale.dal.mysql.merchant.MerchantMapper">
+
+    <!--
+        一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
+        无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
+        代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
+        文档可见:https://www.zhongxing.cn/MyBatis/x-plugins/
+     -->
+
+</mapper>

+ 12 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/resources/mapper/shop/ShopMapper.xml

@@ -0,0 +1,12 @@
+<?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="cn.newfeifan.sale.dal.mysql.shop.ShopMapper">
+
+    <!--
+        一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
+        无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
+        代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
+        文档可见:https://www.zhongxing.cn/MyBatis/x-plugins/
+     -->
+
+</mapper>

+ 12 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/resources/mapper/shopstatus/ShopStatusMapper.xml

@@ -0,0 +1,12 @@
+<?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="cn.newfeifan.sale.dal.mysql.shopstatus.ShopStatusMapper">
+
+    <!--
+        一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
+        无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
+        代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
+        文档可见:https://www.zhongxing.cn/MyBatis/x-plugins/
+     -->
+
+</mapper>

+ 26 - 0
feifan-module-sale/pom.xml

@@ -0,0 +1,26 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>cn.newfeifan.zx</groupId>
+        <artifactId>feifan</artifactId>
+        <version>${revision}</version>
+    </parent>
+
+    <groupId>cn.newfeifan.sale</groupId>
+    <artifactId>feifan-module-sale</artifactId>
+    <packaging>pom</packaging>
+
+    <name>${project.artifactId}</name> <!-- 3. 新增 name 为 ${project.artifactId} -->
+    <modules>
+        <module>feifan-module-sale-api</module>
+        <module>feifan-module-sale-biz</module>
+    </modules>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+    <description> <!-- 4. 新增 description 为该模块的描述 -->
+        demo 模块,主要实现 XXX、YYY、ZZZ 等功能。
+    </description>
+</project>

+ 5 - 0
feifan-server/pom.xml

@@ -21,6 +21,11 @@
     <url>https://github.com/YunaiV/ruoyi-vue-pro</url>
 
     <dependencies>
+        <dependency>
+            <groupId>cn.newfeifan.sale</groupId>
+            <artifactId>feifan-module-sale-biz</artifactId>
+            <version>${revision}</version>
+        </dependency>
         <dependency>
             <groupId>cn.newfeifan.zx</groupId>
             <artifactId>feifan-module-system-biz</artifactId>

+ 1 - 1
feifan-server/src/main/resources/application-local.yaml

@@ -47,7 +47,7 @@ spring:
       primary: master
       datasource:
         master:
-          name: mall-feifan
+          name: mall-feifan-dev
           url: jdbc:mysql://10.0.5.229:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
           username: wendao9t
           password: PA55W0RD

+ 2 - 1
pom.xml

@@ -21,7 +21,8 @@
         <module>feifan-module-mp</module>
         <module>feifan-module-pay</module>
         <module>feifan-module-mall</module>
-<!--        <module>feifan-module-crm</module>-->
+        <module>feifan-module-sale</module>
+        <!--        <module>feifan-module-crm</module>-->
         <!-- 示例项目 -->
 <!--        <module>feifan-example</module>-->
     </modules>