Browse Source

添加商户入驻

Yangzw 9 months ago
parent
commit
250055dbca

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

@@ -15,4 +15,5 @@ public interface ErrorCodeConstants {
     //店铺表相关错误,表编号是1
     ErrorCode SHOP_NOT_EXISTS = new ErrorCode(1_101_001_001, "店铺不存在");
 
+    ErrorCode MERCHANT_APPLY_NOT_EXISTS = new ErrorCode(1_002_029_003, "商户申请不存在");
 }

+ 70 - 0
feifan-module-mall/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/module/sale/controller/admin/merchantapply/MerchantApplyController.java

@@ -0,0 +1,70 @@
+package cn.newfeifan.mall.module.sale.controller.admin.merchantapply;
+
+import cn.newfeifan.mall.framework.security.core.annotations.PreAuthenticated;
+import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+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 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.module.sale.controller.admin.merchantapply.vo.*;
+import cn.newfeifan.mall.module.sale.dal.dataobject.merchantapply.MerchantApplyDO;
+import cn.newfeifan.mall.module.sale.service.merchantapply.MerchantApplyService;
+
+@Tag(name = "管理后台 - 商户申请")
+@RestController
+@RequestMapping("/sale/merchant-apply")
+@Validated
+public class MerchantApplyController {
+
+    @Resource
+    private MerchantApplyService merchantApplyService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建商户申请")
+    @PreAuthenticated
+    public CommonResult<Long> createMerchantApply(@Valid @RequestBody MerchantApplySaveReqVO createReqVO) {
+        return success(merchantApplyService.createMerchantApply(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新商户申请")
+    @PreAuthenticated
+    public CommonResult<Boolean> updateMerchantApply(@Valid @RequestBody MerchantApplySaveReqVO updateReqVO) {
+        merchantApplyService.updateMerchantApply(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除商户申请")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthenticated
+    public CommonResult<Boolean> deleteMerchantApply(@RequestParam("id") Long id) {
+        merchantApplyService.deleteMerchantApply(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得商户申请")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthenticated
+    public CommonResult<MerchantApplyRespVO> getMerchantApply(@RequestParam("id") Long id) {
+        MerchantApplyDO merchantApply = merchantApplyService.getMerchantApply(id);
+        return success(BeanUtils.toBean(merchantApply, MerchantApplyRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得商户申请分页")
+    @PreAuthenticated
+    public CommonResult<PageResult<MerchantApplyRespVO>> getMerchantApplyPage(@Valid MerchantApplyPageReqVO pageReqVO) {
+        PageResult<MerchantApplyDO> pageResult = merchantApplyService.getMerchantApplyPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, MerchantApplyRespVO.class));
+    }
+}

+ 92 - 0
feifan-module-mall/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/module/sale/controller/admin/merchantapply/vo/MerchantApplyPageReqVO.java

@@ -0,0 +1,92 @@
+package cn.newfeifan.mall.module.sale.controller.admin.merchantapply.vo;
+
+import lombok.*;
+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 MerchantApplyPageReqVO extends PageParam {
+
+    @Schema(description = "logo地址", example = "https://www.zhongxing.cn")
+    private String logoUrl;
+
+    @Schema(description = "商户名称", example = "非繁人")
+    private String name;
+
+    @Schema(description = "商户状态,关联商户状态表", example = "1")
+    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 = "商户官网", example = "https://www.zhongxing.cn")
+    private String businessUrl;
+
+    @Schema(description = "维权电话")
+    private String complaintsHotline;
+
+    @Schema(description = "客服电话")
+    private String customerServiceHotline;
+
+    @Schema(description = "邮箱")
+    private String email;
+
+    @Schema(description = "营业执照图片路径")
+    private String businessLicensePicture;
+
+    @Schema(description = "服务套餐", example = "18036")
+    private Integer packageId;
+
+    @Schema(description = "店铺数量", example = "31320")
+    private Integer shopCount;
+
+    @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;
+
+    @Schema(description = "区域id,对应文件系统 src/main/resources/area.csv 中的id一列", example = "28982")
+    private Long areaId;
+
+    @Schema(description = "申请用户id", example = "7189")
+    private Long applyMemberUserId;
+
+    @Schema(description = "审核系统用户id", example = "29612")
+    private Long checkSystemUserId;
+
+    @Schema(description = "审核时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] checkTime;
+
+    @Schema(description = "审核意见")
+    private String checkComment;
+
+    @Schema(description = "申请备注")
+    private String applyComment;
+
+    @Schema(description = "审核状态:默认0表示未审核,1审核通过,2审核不通过", example = "1")
+    private Integer checkStatus;
+
+}

+ 113 - 0
feifan-module-mall/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/module/sale/controller/admin/merchantapply/vo/MerchantApplyRespVO.java

@@ -0,0 +1,113 @@
+package cn.newfeifan.mall.module.sale.controller.admin.merchantapply.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.time.LocalDateTime;
+import com.alibaba.excel.annotation.*;
+
+@Schema(description = "管理后台 - 商户申请 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class MerchantApplyRespVO {
+
+    @Schema(description = "商户id", requiredMode = Schema.RequiredMode.REQUIRED, example = "32267")
+    @ExcelProperty("商户id")
+    private Long id;
+
+    @Schema(description = "logo地址", example = "https://www.zhongxing.cn")
+    @ExcelProperty("logo地址")
+    private String logoUrl;
+
+    @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 = "简介", 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 = "商户官网", example = "https://www.zhongxing.cn")
+    @ExcelProperty("商户官网")
+    private String businessUrl;
+
+    @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 = "服务套餐", example = "18036")
+    @ExcelProperty("服务套餐")
+    private Integer packageId;
+
+    @Schema(description = "店铺数量", example = "31320")
+    @ExcelProperty("店铺数量")
+    private Integer shopCount;
+
+    @Schema(description = "服务到期时间")
+    @ExcelProperty("服务到期时间")
+    private LocalDateTime expireTime;
+
+    @Schema(description = "申请时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("申请时间")
+    private LocalDateTime createTime;
+
+    @Schema(description = "区域id,对应文件系统 src/main/resources/area.csv 中的id一列", example = "28982")
+    @ExcelProperty("区域id,对应文件系统 src/main/resources/area.csv 中的id一列")
+    private Long areaId;
+
+    @Schema(description = "申请用户id", requiredMode = Schema.RequiredMode.REQUIRED, example = "7189")
+    @ExcelProperty("申请用户id")
+    private Long applyMemberUserId;
+
+    @Schema(description = "审核系统用户id", example = "29612")
+    @ExcelProperty("审核系统用户id")
+    private Long checkSystemUserId;
+
+    @Schema(description = "审核时间")
+    @ExcelProperty("审核时间")
+    private LocalDateTime checkTime;
+
+    @Schema(description = "审核意见")
+    @ExcelProperty("审核意见")
+    private String checkComment;
+
+    @Schema(description = "申请备注")
+    @ExcelProperty("申请备注")
+    private String applyComment;
+
+    @Schema(description = "审核状态:默认0表示未审核,1审核通过,2审核不通过", example = "1")
+    @ExcelProperty("审核状态:默认0表示未审核,1审核通过,2审核不通过")
+    private Integer checkStatus;
+
+}

+ 87 - 0
feifan-module-mall/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/module/sale/controller/admin/merchantapply/vo/MerchantApplySaveReqVO.java

@@ -0,0 +1,87 @@
+package cn.newfeifan.mall.module.sale.controller.admin.merchantapply.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import javax.validation.constraints.*;
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - 商户申请新增/修改 Request VO")
+@Data
+public class MerchantApplySaveReqVO {
+
+    @Schema(description = "商户id", requiredMode = Schema.RequiredMode.REQUIRED, example = "32267")
+    private Long id;
+
+    @Schema(description = "logo地址", example = "https://www.zhongxing.cn")
+    private String logoUrl;
+
+    @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 = "简介", 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 = "商户官网", example = "https://www.zhongxing.cn")
+    private String businessUrl;
+
+    @Schema(description = "维权电话")
+    private String complaintsHotline;
+
+    @Schema(description = "客服电话")
+    private String customerServiceHotline;
+
+    @Schema(description = "邮箱")
+    private String email;
+
+    @Schema(description = "营业执照图片路径")
+    private String businessLicensePicture;
+
+    @Schema(description = "服务套餐", example = "18036")
+    private Integer packageId;
+
+    @Schema(description = "店铺数量", example = "31320")
+    private Integer shopCount;
+
+    @Schema(description = "服务到期时间")
+    private LocalDateTime expireTime;
+
+    @Schema(description = "区域id,对应文件系统 src/main/resources/area.csv 中的id一列", example = "28982")
+    private Long areaId;
+
+    @Schema(description = "申请用户id", requiredMode = Schema.RequiredMode.REQUIRED, example = "7189")
+    @NotNull(message = "申请用户id不能为空")
+    private Long applyMemberUserId;
+
+    @Schema(description = "审核系统用户id", example = "29612")
+    private Long checkSystemUserId;
+
+    @Schema(description = "审核时间")
+    private LocalDateTime checkTime;
+
+    @Schema(description = "审核意见")
+    private String checkComment;
+
+    @Schema(description = "申请备注")
+    private String applyComment;
+
+    @Schema(description = "审核状态:默认0表示未审核,1审核通过,2审核不通过", example = "1")
+    private Integer checkStatus;
+
+}

+ 121 - 0
feifan-module-mall/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/module/sale/dal/dataobject/merchantapply/MerchantApplyDO.java

@@ -0,0 +1,121 @@
+package cn.newfeifan.mall.module.sale.dal.dataobject.merchantapply;
+
+import lombok.*;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.*;
+import cn.newfeifan.mall.framework.mybatis.core.dataobject.BaseDO;
+
+/**
+ * 商户申请 DO
+ *
+ * @author 非繁人
+ */
+@TableName("sale_merchant_apply")
+@KeySequence("sale_merchant_apply_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class MerchantApplyDO extends BaseDO {
+
+    /**
+     * 商户id
+     */
+    @TableId
+    private Long id;
+    /**
+     * logo地址
+     */
+    private String logoUrl;
+    /**
+     * 商户名称
+     */
+    private String name;
+    /**
+     * 商户状态,关联商户状态表
+     */
+    private Integer status;
+    /**
+     * 简介
+     */
+    private String description;
+    /**
+     * 商户负责人
+     */
+    private String contact;
+    /**
+     * 所在地
+     */
+    private String address;
+    /**
+     * 负责人电话
+     */
+    private String contactNumber;
+    /**
+     * 域名
+     */
+    private String website;
+    /**
+     * 商户官网
+     */
+    private String businessUrl;
+    /**
+     * 维权电话
+     */
+    private String complaintsHotline;
+    /**
+     * 客服电话
+     */
+    private String customerServiceHotline;
+    /**
+     * 邮箱
+     */
+    private String email;
+    /**
+     * 营业执照图片路径
+     */
+    private String businessLicensePicture;
+    /**
+     * 服务套餐
+     */
+    private Integer packageId;
+    /**
+     * 店铺数量
+     */
+    private Integer shopCount;
+    /**
+     * 服务到期时间
+     */
+    private LocalDateTime expireTime;
+    /**
+     * 区域id,对应文件系统 src/main/resources/area.csv 中的id一列
+     */
+    private Long areaId;
+    /**
+     * 申请用户id
+     */
+    private Long applyMemberUserId;
+    /**
+     * 审核系统用户id
+     */
+    private Long checkSystemUserId;
+    /**
+     * 审核时间
+     */
+    private LocalDateTime checkTime;
+    /**
+     * 审核意见
+     */
+    private String checkComment;
+    /**
+     * 申请备注
+     */
+    private String applyComment;
+    /**
+     * 审核状态:默认0表示未审核,1审核通过,2审核不通过
+     */
+    private Integer checkStatus;
+
+}

+ 48 - 0
feifan-module-mall/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/module/sale/dal/mysql/merchantapply/MerchantApplyMapper.java

@@ -0,0 +1,48 @@
+package cn.newfeifan.mall.module.sale.dal.mysql.merchantapply;
+
+
+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.mall.module.sale.dal.dataobject.merchantapply.MerchantApplyDO;
+import org.apache.ibatis.annotations.Mapper;
+import cn.newfeifan.mall.module.sale.controller.admin.merchantapply.vo.*;
+
+/**
+ * 商户申请 Mapper
+ *
+ * @author 非繁人
+ */
+@Mapper
+public interface MerchantApplyMapper extends BaseMapperX<MerchantApplyDO> {
+
+    default PageResult<MerchantApplyDO> selectPage(MerchantApplyPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<MerchantApplyDO>()
+                .eqIfPresent(MerchantApplyDO::getLogoUrl, reqVO.getLogoUrl())
+                .likeIfPresent(MerchantApplyDO::getName, reqVO.getName())
+                .eqIfPresent(MerchantApplyDO::getStatus, reqVO.getStatus())
+                .eqIfPresent(MerchantApplyDO::getDescription, reqVO.getDescription())
+                .eqIfPresent(MerchantApplyDO::getContact, reqVO.getContact())
+                .eqIfPresent(MerchantApplyDO::getAddress, reqVO.getAddress())
+                .eqIfPresent(MerchantApplyDO::getContactNumber, reqVO.getContactNumber())
+                .eqIfPresent(MerchantApplyDO::getWebsite, reqVO.getWebsite())
+                .eqIfPresent(MerchantApplyDO::getBusinessUrl, reqVO.getBusinessUrl())
+                .eqIfPresent(MerchantApplyDO::getComplaintsHotline, reqVO.getComplaintsHotline())
+                .eqIfPresent(MerchantApplyDO::getCustomerServiceHotline, reqVO.getCustomerServiceHotline())
+                .eqIfPresent(MerchantApplyDO::getEmail, reqVO.getEmail())
+                .eqIfPresent(MerchantApplyDO::getBusinessLicensePicture, reqVO.getBusinessLicensePicture())
+                .eqIfPresent(MerchantApplyDO::getPackageId, reqVO.getPackageId())
+                .eqIfPresent(MerchantApplyDO::getShopCount, reqVO.getShopCount())
+                .betweenIfPresent(MerchantApplyDO::getExpireTime, reqVO.getExpireTime())
+                .betweenIfPresent(MerchantApplyDO::getCreateTime, reqVO.getCreateTime())
+                .eqIfPresent(MerchantApplyDO::getAreaId, reqVO.getAreaId())
+                .eqIfPresent(MerchantApplyDO::getApplyMemberUserId, reqVO.getApplyMemberUserId())
+                .eqIfPresent(MerchantApplyDO::getCheckSystemUserId, reqVO.getCheckSystemUserId())
+                .betweenIfPresent(MerchantApplyDO::getCheckTime, reqVO.getCheckTime())
+                .eqIfPresent(MerchantApplyDO::getCheckComment, reqVO.getCheckComment())
+                .eqIfPresent(MerchantApplyDO::getApplyComment, reqVO.getApplyComment())
+                .eqIfPresent(MerchantApplyDO::getCheckStatus, reqVO.getCheckStatus())
+                .orderByDesc(MerchantApplyDO::getId));
+    }
+
+}

+ 53 - 0
feifan-module-mall/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/module/sale/service/merchantapply/MerchantApplyService.java

@@ -0,0 +1,53 @@
+package cn.newfeifan.mall.module.sale.service.merchantapply;
+
+import javax.validation.*;
+import cn.newfeifan.mall.module.sale.controller.admin.merchantapply.vo.*;
+import cn.newfeifan.mall.module.sale.dal.dataobject.merchantapply.MerchantApplyDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+
+/**
+ * 商户申请 Service 接口
+ *
+ * @author 非繁人
+ */
+public interface MerchantApplyService {
+
+    /**
+     * 创建商户申请
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createMerchantApply(@Valid MerchantApplySaveReqVO createReqVO);
+
+    /**
+     * 更新商户申请
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateMerchantApply(@Valid MerchantApplySaveReqVO updateReqVO);
+
+    /**
+     * 删除商户申请
+     *
+     * @param id 编号
+     */
+    void deleteMerchantApply(Long id);
+
+    /**
+     * 获得商户申请
+     *
+     * @param id 编号
+     * @return 商户申请
+     */
+    MerchantApplyDO getMerchantApply(Long id);
+
+    /**
+     * 获得商户申请分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 商户申请分页
+     */
+    PageResult<MerchantApplyDO> getMerchantApplyPage(MerchantApplyPageReqVO pageReqVO);
+
+}

+ 71 - 0
feifan-module-mall/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/module/sale/service/merchantapply/MerchantApplyServiceImpl.java

@@ -0,0 +1,71 @@
+package cn.newfeifan.mall.module.sale.service.merchantapply;
+
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+
+import cn.newfeifan.mall.module.sale.controller.admin.merchantapply.vo.*;
+import cn.newfeifan.mall.module.sale.dal.dataobject.merchantapply.MerchantApplyDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
+
+import cn.newfeifan.mall.module.sale.dal.mysql.merchantapply.MerchantApplyMapper;
+
+import static cn.newfeifan.mall.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.newfeifan.mall.module.sale.enums.ErrorCodeConstants.*;
+
+/**
+ * 商户申请 Service 实现类
+ *
+ * @author 非繁人
+ */
+@Service
+@Validated
+public class MerchantApplyServiceImpl implements MerchantApplyService {
+
+    @Resource
+    private MerchantApplyMapper merchantApplyMapper;
+
+    @Override
+    public Long createMerchantApply(MerchantApplySaveReqVO createReqVO) {
+        // 插入
+        MerchantApplyDO merchantApply = BeanUtils.toBean(createReqVO, MerchantApplyDO.class);
+        merchantApplyMapper.insert(merchantApply);
+        // 返回
+        return merchantApply.getId();
+    }
+
+    @Override
+    public void updateMerchantApply(MerchantApplySaveReqVO updateReqVO) {
+        // 校验存在
+        validateMerchantApplyExists(updateReqVO.getId());
+        // 更新
+        MerchantApplyDO updateObj = BeanUtils.toBean(updateReqVO, MerchantApplyDO.class);
+        merchantApplyMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteMerchantApply(Long id) {
+        // 校验存在
+        validateMerchantApplyExists(id);
+        // 删除
+        merchantApplyMapper.deleteById(id);
+    }
+
+    private void validateMerchantApplyExists(Long id) {
+        if (merchantApplyMapper.selectById(id) == null) {
+            throw exception(MERCHANT_APPLY_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public MerchantApplyDO getMerchantApply(Long id) {
+        return merchantApplyMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<MerchantApplyDO> getMerchantApplyPage(MerchantApplyPageReqVO pageReqVO) {
+        return merchantApplyMapper.selectPage(pageReqVO);
+    }
+
+}