Browse Source

Merge branch 'dev/2024/0531/update-admin-Y' of feifan/mall-backend-admin into master

修改发送微信消息及同手机号多绑定
Yangzw 5 months ago
parent
commit
e7ab864dc7
13 changed files with 707 additions and 13 deletions
  1. 0 7
      feifan-module-mall/feifan-module-trade-biz/src/main/java/cn/newfeifan/mall/module/trade/service/order/TradeOrderQueryServiceImpl.java
  2. 3 0
      feifan-module-member/feifan-module-member-biz/src/main/java/cn/newfeifan/mall/module/member/dal/mysql/user/MemberUserMapper.java
  3. 8 6
      feifan-module-member/feifan-module-member-biz/src/main/java/cn/newfeifan/mall/module/member/service/user/MemberUserServiceImpl.java
  4. 1 0
      feifan-module-sale/feifan-module-sale-api/src/main/java/cn/newfeifan/mall/module/enums/ErrorCodeConstants.java
  5. 96 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/sale/controller/admin/merchantapply/MerchantApplyController.java
  6. 92 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/sale/controller/admin/merchantapply/vo/MerchantApplyPageReqVO.java
  7. 113 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/sale/controller/admin/merchantapply/vo/MerchantApplyRespVO.java
  8. 87 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/sale/controller/admin/merchantapply/vo/MerchantApplySaveReqVO.java
  9. 121 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/sale/dal/dataobject/merchantapply/MerchantApplyDO.java
  10. 47 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/sale/dal/mysql/merchantapply/MerchantApplyMapper.java
  11. 55 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/sale/service/merchantapply/MerchantApplyService.java
  12. 72 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/sale/service/merchantapply/MerchantApplyServiceImpl.java
  13. 12 0
      feifan-module-sale/feifan-module-sale-biz/src/main/resources/mapper/merchantapply/MerchantApplyMapper.xml

+ 0 - 7
feifan-module-mall/feifan-module-trade-biz/src/main/java/cn/newfeifan/mall/module/trade/service/order/TradeOrderQueryServiceImpl.java

@@ -133,13 +133,6 @@ public class TradeOrderQueryServiceImpl implements TradeOrderQueryService {
     private Set<Long> buildQueryConditionUserIds(TradeOrderPageReqVO reqVO) {
         // 获得 userId 相关的查询
         Set<Long> userIds = new HashSet<>();
-        if (StrUtil.isNotEmpty(reqVO.getUserMobile())) {
-            MemberUserRespDTO user = memberUserApi.getUserByMobile(reqVO.getUserMobile());
-            if (user == null) { // 没查询到用户,说明肯定也没他的订单
-                return null;
-            }
-            userIds.add(user.getId());
-        }
         if (StrUtil.isNotEmpty(reqVO.getUserNickname())) {
             List<MemberUserRespDTO> users = memberUserApi.getUserListByNickname(reqVO.getUserNickname());
             if (CollUtil.isEmpty(users)) { // 没查询到用户,说明肯定也没他的订单

+ 3 - 0
feifan-module-member/feifan-module-member-biz/src/main/java/cn/newfeifan/mall/module/member/dal/mysql/user/MemberUserMapper.java

@@ -95,4 +95,7 @@ public interface MemberUserMapper extends BaseMapperX<MemberUserDO> {
         return update(null, lambdaUpdateWrapper);
     }
 
+    default List<MemberUserDO> selectListByMobile(String mobile){
+        return selectList(MemberUserDO::getMobile,mobile);
+    }
 }

+ 8 - 6
feifan-module-member/feifan-module-member-biz/src/main/java/cn/newfeifan/mall/module/member/service/user/MemberUserServiceImpl.java

@@ -237,7 +237,7 @@ public class MemberUserServiceImpl implements MemberUserService {
         // 校验存在
         validateUserExists(updateReqVO.getId());
         // 校验手机唯一
-        validateMobileUnique(updateReqVO.getId(), updateReqVO.getMobile());
+//        validateMobileUnique(updateReqVO.getId(), updateReqVO.getMobile());
 
         // 更新
         MemberUserDO updateObj = MemberUserConvert.INSTANCE.convert(updateReqVO);
@@ -321,14 +321,16 @@ public class MemberUserServiceImpl implements MemberUserService {
 
     @Override
     public void updateUserByMobile(Long systemUserId, String mobile) {
-        if(StrUtil.isEmpty(mobile)){
+        if (StrUtil.isEmpty(mobile)) {
             return;
         }
 
-        MemberUserDO memberUserDO = memberUserMapper.selectByMobile(mobile);
-        if(memberUserDO!=null){
-            memberUserDO.setSystemUsersId(systemUserId);
-            memberUserMapper.updateById(memberUserDO);
+        List<MemberUserDO> memberUserDOS = memberUserMapper.selectListByMobile(mobile);
+        if (!memberUserDOS.isEmpty()) {
+            for (MemberUserDO memberUserDO : memberUserDOS) {
+                memberUserDO.setSystemUsersId(systemUserId);
+                memberUserMapper.updateById(memberUserDO);
+            }
         }
     }
 

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

@@ -13,5 +13,6 @@ public interface ErrorCodeConstants {
     ErrorCode MERCHANT_NOT_EXISTS = new ErrorCode(1_002_029_001, "商户不存在");
     ErrorCode SHOP_NOT_EXISTS = new ErrorCode(1_002_029_002, "店铺不存在不存在");
     ErrorCode NO_BANDING = new ErrorCode(1_002_029_002, "未绑定");
+    ErrorCode MERCHANT_APPLY_NOT_EXISTS = new ErrorCode(1_002_029_003, "商户申请不存在");
 
 }

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

@@ -0,0 +1,96 @@
+package cn.newfeifan.mall.sale.controller.admin.merchantapply;
+
+import cn.newfeifan.mall.sale.controller.admin.merchantapply.vo.MerchantApplyPageReqVO;
+import cn.newfeifan.mall.sale.controller.admin.merchantapply.vo.MerchantApplyRespVO;
+import cn.newfeifan.mall.sale.controller.admin.merchantapply.vo.MerchantApplySaveReqVO;
+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.mall.sale.dal.dataobject.merchantapply.MerchantApplyDO;
+import cn.newfeifan.mall.sale.service.merchantapply.MerchantApplyService;
+
+@Tag(name = "管理后台 - 商户申请")
+@RestController
+@RequestMapping("/sale/merchant-apply")
+@Validated
+public class MerchantApplyController {
+
+    @Resource
+    private MerchantApplyService merchantApplyService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建商户申请")
+    @PreAuthorize("@ss.hasPermission('sale:merchant-apply:create')")
+    public CommonResult<Long> createMerchantApply(@Valid @RequestBody MerchantApplySaveReqVO createReqVO) {
+        return success(merchantApplyService.createMerchantApply(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新商户申请")
+    @PreAuthorize("@ss.hasPermission('sale:merchant-apply:update')")
+    public CommonResult<Boolean> updateMerchantApply(@Valid @RequestBody MerchantApplySaveReqVO updateReqVO) {
+        merchantApplyService.updateMerchantApply(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除商户申请")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('sale:merchant-apply:delete')")
+    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")
+    @PreAuthorize("@ss.hasPermission('sale:merchant-apply:query')")
+    public CommonResult<MerchantApplyRespVO> getMerchantApply(@RequestParam("id") Long id) {
+        MerchantApplyDO merchantApply = merchantApplyService.getMerchantApply(id);
+        return success(BeanUtils.toBean(merchantApply, MerchantApplyRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得商户申请分页")
+    @PreAuthorize("@ss.hasPermission('sale:merchant-apply:query')")
+    public CommonResult<PageResult<MerchantApplyRespVO>> getMerchantApplyPage(@Valid MerchantApplyPageReqVO pageReqVO) {
+        PageResult<MerchantApplyDO> pageResult = merchantApplyService.getMerchantApplyPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, MerchantApplyRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出商户申请 Excel")
+    @PreAuthorize("@ss.hasPermission('sale:merchant-apply:export')")
+    @OperateLog(type = EXPORT)
+    public void exportMerchantApplyExcel(@Valid MerchantApplyPageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<MerchantApplyDO> list = merchantApplyService.getMerchantApplyPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "商户申请.xls", "数据", MerchantApplyRespVO.class,
+                        BeanUtils.toBean(list, MerchantApplyRespVO.class));
+    }
+
+}

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

@@ -0,0 +1,92 @@
+package cn.newfeifan.mall.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-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/sale/controller/admin/merchantapply/vo/MerchantApplyRespVO.java

@@ -0,0 +1,113 @@
+package cn.newfeifan.mall.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-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/sale/controller/admin/merchantapply/vo/MerchantApplySaveReqVO.java

@@ -0,0 +1,87 @@
+package cn.newfeifan.mall.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-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/sale/dal/dataobject/merchantapply/MerchantApplyDO.java

@@ -0,0 +1,121 @@
+package cn.newfeifan.mall.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;
+
+}

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

@@ -0,0 +1,47 @@
+package cn.newfeifan.mall.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.sale.dal.dataobject.merchantapply.MerchantApplyDO;
+import cn.newfeifan.mall.sale.controller.admin.merchantapply.vo.MerchantApplyPageReqVO;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 商户申请 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));
+    }
+
+}

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

@@ -0,0 +1,55 @@
+package cn.newfeifan.mall.sale.service.merchantapply;
+
+import javax.validation.*;
+
+import cn.newfeifan.mall.sale.dal.dataobject.merchantapply.MerchantApplyDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.sale.controller.admin.merchantapply.vo.MerchantApplyPageReqVO;
+import cn.newfeifan.mall.sale.controller.admin.merchantapply.vo.MerchantApplySaveReqVO;
+
+/**
+ * 商户申请 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);
+
+}

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

@@ -0,0 +1,72 @@
+package cn.newfeifan.mall.sale.service.merchantapply;
+
+import cn.newfeifan.mall.sale.controller.admin.merchantapply.vo.MerchantApplyPageReqVO;
+import cn.newfeifan.mall.sale.controller.admin.merchantapply.vo.MerchantApplySaveReqVO;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+
+import cn.newfeifan.mall.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.sale.dal.mysql.merchantapply.MerchantApplyMapper;
+
+import static cn.newfeifan.mall.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.newfeifan.mall.module.enums.ErrorCodeConstants.MERCHANT_APPLY_NOT_EXISTS;
+
+/**
+ * 商户申请 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);
+    }
+
+}

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