From 71fd3964aacb88c150bec97b90452989fb2b380b Mon Sep 17 00:00:00 2001
From: rentaiming <806181062@qq.com>
Date: 星期四, 06 六月 2024 11:46:49 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/MemberLevelServiceImpl.java              |   31 ++
 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/SupplierDTO.java                           |   29 ++
 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/SupplierQuery.java                         |   19 +
 ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java                               |    6 
 ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/management/MgtMemberController.java        |   39 +++
 ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/IMemberLevelService.java                      |    8 
 ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionSalesroomServiceImpl.java       |   14 
 ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/management/dto/MgtMemberQuery.java         |   26 ++
 ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/IMemberService.java                           |   16 +
 ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/GoodsGroupPurchaseServiceImpl.java         |   10 
 ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/management/MgtMemberAddressController.java |   58 +++++
 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java                     |   41 +++
 ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/management/vo/MgtMemberLevelVO.java        |   27 ++
 ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/management/vo/MgtMemberVO.java             |   47 ++++
 ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/management/MgtMemberLevelController.java   |   39 +++
 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java                          |   30 ++
 ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/MemberServiceImpl.java                   |   42 +++
 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java                  |  106 +++++++--
 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/SupplierVO.java                             |   25 ++
 19 files changed, 570 insertions(+), 43 deletions(-)

diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java
index 9119408..476d8c1 100644
--- a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java
+++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java
@@ -66,6 +66,12 @@
     /** 用户头像 */
     private String avatar;
     /** 密码 */
+
+    private String userType;
+
+    /**
+     * 密码
+     */
     @NotBlank(message = "密码不能为空")
     private String password;
 
diff --git a/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionSalesroomServiceImpl.java b/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionSalesroomServiceImpl.java
index 193d5cf..b1379ab 100644
--- a/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionSalesroomServiceImpl.java
+++ b/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionSalesroomServiceImpl.java
@@ -20,12 +20,6 @@
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.google.common.collect.Lists;
-import com.ruoyi.system.api.domain.dto.AuctionSalesroomGoodsDTO;
-import com.ruoyi.system.api.domain.dto.ForepartAuctionBidRecordDTO;
-import com.ruoyi.system.api.domain.vo.ForepartAuctionSalesroomGoodsVO;
-import com.ruoyi.system.api.domain.vo.ForepartAuctionSalesroomVO;
-import com.ruoyi.system.api.domain.vo.MemberAuctionSalesroomInfoVO;
-import com.ruoyi.system.api.domain.vo.MemberAuctionSalesroomVO;
 import com.ruoyi.auction.controller.management.dto.MgtAuctionSaleroomBidRecordQuery;
 import com.ruoyi.auction.controller.management.dto.MgtAuctionSalesroomDTO;
 import com.ruoyi.auction.controller.management.dto.MgtAuctionSalesroomGoodsDTO;
@@ -75,12 +69,18 @@
 import com.ruoyi.system.api.domain.PromotionVideo;
 import com.ruoyi.system.api.domain.SysUser;
 import com.ruoyi.system.api.domain.dto.AppMiniLoginDTO;
+import com.ruoyi.system.api.domain.dto.AuctionSalesroomGoodsDTO;
 import com.ruoyi.system.api.domain.dto.BidDTO;
+import com.ruoyi.system.api.domain.dto.ForepartAuctionBidRecordDTO;
 import com.ruoyi.system.api.domain.dto.GoodsStockUpdDTO;
 import com.ruoyi.system.api.domain.dto.MemberAuctionSalesroomBondDTO;
 import com.ruoyi.system.api.domain.dto.MemberAuctionSalesroomDTO;
 import com.ruoyi.system.api.domain.dto.MemberAuctionSalesroomWdDTO;
 import com.ruoyi.system.api.domain.dto.RefundDTO;
+import com.ruoyi.system.api.domain.vo.ForepartAuctionSalesroomGoodsVO;
+import com.ruoyi.system.api.domain.vo.ForepartAuctionSalesroomVO;
+import com.ruoyi.system.api.domain.vo.MemberAuctionSalesroomInfoVO;
+import com.ruoyi.system.api.domain.vo.MemberAuctionSalesroomVO;
 import com.ruoyi.system.api.domain.vo.PayInfoVO;
 import com.ruoyi.system.api.domain.vo.WdMemberAuctionSalesroomVO;
 import com.ruoyi.system.api.feignClient.GoodsSkuClient;
@@ -1063,7 +1063,7 @@
                 mgtScreenBidPage.getId(), Boolean.TRUE);
         List<MgtAuctionSalesroomGoodsVO> auctionSalesroomGoodsVOS = mgtAuctionSalesroomVO.getAuctionSalesroomGoodsVOS();
         if (StringUtils.isEmpty(auctionSalesroomGoodsVOS)) {
-            throw new ServiceException("该拍卖会暂无拍卖商品");
+            return PageDTO.empty(0L, 0L);
         }
         AtomicReference<Long> currentAuctionGoodsId = new AtomicReference<>();
         auctionSalesroomGoodsVOS.stream()
diff --git a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/GoodsGroupPurchaseServiceImpl.java b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/GoodsGroupPurchaseServiceImpl.java
index 0fc5baa..b5c3e66 100644
--- a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/GoodsGroupPurchaseServiceImpl.java
+++ b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/GoodsGroupPurchaseServiceImpl.java
@@ -94,6 +94,16 @@
             if (StringUtils.isNull(dto.getGoodsSkuId())) {
                 throw new ServiceException("商品id不能为空");
             }
+            LambdaQueryWrapper<GoodsGroupPurchase> queryWrapper = Wrappers.lambdaQuery();
+            queryWrapper.eq(GoodsGroupPurchase::getGoodsSkuId, dto.getGoodsSkuId());
+            queryWrapper.eq(GoodsGroupPurchase::getListingStatus,
+                    ListingStatusEnum.ON_SHELVES.getCode());
+            queryWrapper.between(GoodsGroupPurchase::getStartTime, dto.getStartTime(),
+                    dto.getEndTime());
+            List<GoodsGroupPurchase> list = this.list(queryWrapper);
+            if (StringUtils.isNotEmpty(list)) {
+                throw new ServiceException("添加失败,当前商品在该时间段内有其他团购活动");
+            }
             this.save(goodsGroupPurchase);
             GoodsSku goodsSku = goodsSkuService.getById(dto.getGoodsSkuId());
             if (StringUtils.isNull(goodsSku)) {
diff --git a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/management/MgtMemberAddressController.java b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/management/MgtMemberAddressController.java
new file mode 100644
index 0000000..bea778f
--- /dev/null
+++ b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/management/MgtMemberAddressController.java
@@ -0,0 +1,58 @@
+package com.ruoyi.member.controller.management;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.security.annotation.InnerAuth;
+import com.ruoyi.member.service.IMemberAddressService;
+import com.ruoyi.system.api.domain.MemberAddress;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 会员地址表 前端控制器
+ * </p>
+ *
+ * @author mitao
+ * @since 2024-05-16
+ */
+@RestController
+@RequestMapping("/mgt/member-address")
+public class MgtMemberAddressController {
+
+    /**
+     * 获取当前商品信息
+     */
+
+    @ApiModelProperty
+    private IMemberAddressService iMemberAddressService;
+
+
+    @PostMapping("/getMemberAddressOne")
+    @ResponseBody
+    @InnerAuth
+    public R<MemberAddress> getMemberAddressOne(@RequestBody Integer userId) {
+        LambdaQueryWrapper<MemberAddress> wrapper2 = Wrappers.lambdaQuery();
+        wrapper2.eq(MemberAddress::getMemberId, userId);
+        wrapper2.eq(MemberAddress::getDelFlag, 0);
+        wrapper2.eq(MemberAddress::getIsDefault, 2);
+        MemberAddress memberAddress = iMemberAddressService.getOne(wrapper2);
+        if (memberAddress == null) {
+            LambdaQueryWrapper<MemberAddress> wrapper = Wrappers.lambdaQuery();
+            wrapper.eq(MemberAddress::getMemberId, userId);
+            wrapper.eq(MemberAddress::getDelFlag, 0);
+            wrapper.last("limit 1");
+            memberAddress = iMemberAddressService.getOne(wrapper2);
+        }
+        return R.ok(memberAddress);
+
+    }
+
+
+}
diff --git a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/management/MgtMemberController.java b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/management/MgtMemberController.java
new file mode 100644
index 0000000..a08404f
--- /dev/null
+++ b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/management/MgtMemberController.java
@@ -0,0 +1,39 @@
+package com.ruoyi.member.controller.management;
+
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.core.utils.page.PageDTO;
+import com.ruoyi.member.controller.management.dto.MgtMemberQuery;
+import com.ruoyi.member.controller.management.vo.MgtMemberVO;
+import com.ruoyi.member.service.IMemberService;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author mitao
+ * @date 2024/5/27
+ */
+@RestController
+@RequestMapping("/mgt/member")
+@RequiredArgsConstructor
+public class MgtMemberController {
+
+    private final IMemberService memberService;
+
+    /**
+     * 获取会员管理分页列表
+     *
+     * @param query 会员列表查询对象
+     * @return PageDTO<MgtMemberVO>
+     */
+    @ApiOperation(value = "获取会员管理分页列表", notes = "获取会员管理分页列表")
+    @PostMapping("/page")
+    public R<PageDTO<MgtMemberVO>> getMemberPage(@Validated @RequestBody MgtMemberQuery query) {
+        return R.ok(memberService.getMemberPage(query));
+    }
+
+}
diff --git a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/management/MgtMemberLevelController.java b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/management/MgtMemberLevelController.java
new file mode 100644
index 0000000..330f13c
--- /dev/null
+++ b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/management/MgtMemberLevelController.java
@@ -0,0 +1,39 @@
+package com.ruoyi.member.controller.management;
+
+
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.member.controller.management.vo.MgtMemberLevelVO;
+import com.ruoyi.member.service.IMemberLevelService;
+import io.swagger.annotations.ApiOperation;
+import java.util.List;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 会员等级表 前端控制器
+ * </p>
+ *
+ * @author mitao
+ * @since 2024-05-16
+ */
+@RestController
+@RequestMapping("/mgt/member-level")
+@RequiredArgsConstructor
+public class MgtMemberLevelController {
+
+    private final IMemberLevelService memberLevelService;
+
+    /**
+     * 获取会员等级管理列表
+     *
+     * @return List<MgtMemberLevelVO>
+     */
+    @GetMapping("/list")
+    @ApiOperation(value = "获取会员等级管理列表", notes = "获取会员等级管理列表")
+    public R<List<MgtMemberLevelVO>> getMemberLevelList() {
+        return R.ok(memberLevelService.getMemberLevelList());
+    }
+}
diff --git a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/management/dto/MgtMemberQuery.java b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/management/dto/MgtMemberQuery.java
new file mode 100644
index 0000000..b83c8ce
--- /dev/null
+++ b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/management/dto/MgtMemberQuery.java
@@ -0,0 +1,26 @@
+package com.ruoyi.member.controller.management.dto;
+
+import com.ruoyi.common.core.web.page.BasePage;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * @author mitao
+ * @date 2024/6/5
+ */
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "会员列表查询对象", description = "会员列表查询对象")
+public class MgtMemberQuery extends BasePage {
+
+    private static final long serialVersionUID = -5584030212572003337L;
+
+    @ApiModelProperty(value = "会员姓名")
+    private String realName;
+
+    @ApiModelProperty(value = "联系电话")
+    private String phone;
+}
diff --git a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/management/vo/MgtMemberLevelVO.java b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/management/vo/MgtMemberLevelVO.java
new file mode 100644
index 0000000..139710c
--- /dev/null
+++ b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/management/vo/MgtMemberLevelVO.java
@@ -0,0 +1,27 @@
+package com.ruoyi.member.controller.management.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.math.BigDecimal;
+import lombok.Data;
+
+/**
+ * @author mitao
+ * @date 2024/6/5
+ */
+@Data
+@ApiModel("会员等级视图对象")
+public class MgtMemberLevelVO {
+
+    @ApiModelProperty(value = "会员等级id")
+    private Long id;
+
+    @ApiModelProperty(value = "会员等级")
+    private Integer level;
+
+    @ApiModelProperty(value = "累计消费")
+    private BigDecimal cumulativeConsumption;
+
+    @ApiModelProperty(value = "当前人数")
+    private Integer currentNumber;
+}
diff --git a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/management/vo/MgtMemberVO.java b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/management/vo/MgtMemberVO.java
new file mode 100644
index 0000000..421900c
--- /dev/null
+++ b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/management/vo/MgtMemberVO.java
@@ -0,0 +1,47 @@
+package com.ruoyi.member.controller.management.vo;
+
+import com.ruoyi.common.core.enums.GenderEnum;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import lombok.Data;
+
+@Data
+@ApiModel(value = "会员视图对象", description = "会员视图对象")
+public class MgtMemberVO implements Serializable {
+
+    private static final long serialVersionUID = 4977665063990741285L;
+
+    @ApiModelProperty(value = "1未认证,2已认证")
+    private Integer isAuthentication;
+
+    @ApiModelProperty(value = "会员id")
+    private Long memberid;
+
+    @ApiModelProperty(value = "会员昵称")
+    private String nickname;
+
+    @ApiModelProperty(value = "头像")
+    private String avatar;
+
+    @ApiModelProperty(value = "会员姓名")
+    private String realName;
+
+    @ApiModelProperty(value = "身份证号")
+    private String idNumber;
+
+    @ApiModelProperty(value = "联系电话")
+    private String phone;
+
+    @ApiModelProperty(value = "性别 0=女,1=男,2=未知")
+    private GenderEnum gender;
+
+    @ApiModelProperty(value = "等级")
+    private Integer level;
+
+    @ApiModelProperty(value = "会员积分")
+    private Integer totalPoints;
+
+    @ApiModelProperty(value = "已用积分")
+    private Integer usedPoints;
+}
diff --git a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/IMemberLevelService.java b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/IMemberLevelService.java
index 8d16bab..e75c4ea 100644
--- a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/IMemberLevelService.java
+++ b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/IMemberLevelService.java
@@ -1,7 +1,9 @@
 package com.ruoyi.member.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.member.controller.management.vo.MgtMemberLevelVO;
 import com.ruoyi.member.domain.MemberLevel;
+import java.util.List;
 
 /**
  * <p>
@@ -13,4 +15,10 @@
  */
 public interface IMemberLevelService extends IService<MemberLevel> {
 
+    /**
+     * 获取会员等级管理列表
+     *
+     * @return List<MgtMemberLevelVO>
+     */
+    List<MgtMemberLevelVO> getMemberLevelList();
 }
diff --git a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/IMemberService.java b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/IMemberService.java
index a6857fd..96584eb 100644
--- a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/IMemberService.java
+++ b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/IMemberService.java
@@ -1,15 +1,17 @@
 package com.ruoyi.member.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.ruoyi.system.api.domain.dto.MemberDTO;
+import com.ruoyi.common.core.utils.page.PageDTO;
+import com.ruoyi.member.controller.management.dto.MgtMemberQuery;
+import com.ruoyi.member.controller.management.vo.MgtMemberVO;
 import com.ruoyi.system.api.domain.AppMiniLoginVO;
 import com.ruoyi.system.api.domain.Member;
 import com.ruoyi.system.api.domain.dto.AppMiniLoginDTO;
 import com.ruoyi.system.api.domain.dto.AppMiniRegisterDTO;
-import org.springframework.web.bind.annotation.RequestBody;
-
+import com.ruoyi.system.api.domain.dto.MemberDTO;
 import java.util.List;
 import java.util.Set;
+import org.springframework.web.bind.annotation.RequestBody;
 
 /**
  * <p>
@@ -32,4 +34,12 @@
     List<Member> getMemberListByIds(Set<Long> memberIdList);
 
     AppMiniLoginVO miniRegister(@RequestBody AppMiniRegisterDTO appMiniRegisterDTO);
+
+    /**
+     * 获取会员管理分页列表
+     *
+     * @param query 会员列表查询对象
+     * @return PageDTO<MgtMemberVO>
+     */
+    PageDTO<MgtMemberVO> getMemberPage(MgtMemberQuery query);
 }
diff --git a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/MemberLevelServiceImpl.java b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/MemberLevelServiceImpl.java
index 1a57b50..7ebc575 100644
--- a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/MemberLevelServiceImpl.java
+++ b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/MemberLevelServiceImpl.java
@@ -1,9 +1,18 @@
 package com.ruoyi.member.service.impl;
 
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.core.utils.StringUtils;
+import com.ruoyi.common.core.utils.page.BeanUtils;
+import com.ruoyi.member.controller.management.vo.MgtMemberLevelVO;
 import com.ruoyi.member.domain.MemberLevel;
 import com.ruoyi.member.mapper.MemberLevelMapper;
 import com.ruoyi.member.service.IMemberLevelService;
+import com.ruoyi.member.service.IMemberService;
+import com.ruoyi.system.api.domain.Member;
+import java.util.List;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
 /**
@@ -14,7 +23,29 @@
  * @author mitao
  * @since 2024-05-16
  */
+@Slf4j
 @Service
+@RequiredArgsConstructor
 public class MemberLevelServiceImpl extends ServiceImpl<MemberLevelMapper, MemberLevel> implements IMemberLevelService {
 
+    private final IMemberService memberService;
+
+    /**
+     * 获取会员等级管理列表
+     *
+     * @return List<MgtMemberLevelVO>
+     */
+    @Override
+    public List<MgtMemberLevelVO> getMemberLevelList() {
+        List<MemberLevel> list = this.lambdaQuery().orderByAsc(MemberLevel::getLevel).list();
+        List<MgtMemberLevelVO> mgtMemberLevelVOS = BeanUtils.copyList(list, MgtMemberLevelVO.class);
+        if (StringUtils.isNotEmpty(mgtMemberLevelVOS)) {
+            for (MgtMemberLevelVO vo : mgtMemberLevelVOS) {
+                long count = memberService.count(
+                        Wrappers.<Member>lambdaQuery().eq(Member::getLevel, vo.getLevel()));
+                vo.setCurrentNumber((int) count);
+            }
+        }
+        return mgtMemberLevelVOS;
+    }
 }
diff --git a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/MemberServiceImpl.java b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/MemberServiceImpl.java
index c2a3dc1..8a47337 100644
--- a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/MemberServiceImpl.java
+++ b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/MemberServiceImpl.java
@@ -12,14 +12,17 @@
 import com.alipay.api.response.AlipaySystemOauthTokenResponse;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ruoyi.common.core.enums.GenderEnum;
 import com.ruoyi.common.core.exception.ServiceException;
 import com.ruoyi.common.core.utils.StringUtils;
+import com.ruoyi.common.core.utils.page.PageDTO;
 import com.ruoyi.common.core.utils.uuid.IdUtils;
 import com.ruoyi.common.redis.service.RedisService;
 import com.ruoyi.common.security.utils.SecurityUtils;
-import com.ruoyi.system.api.domain.dto.MemberDTO;
+import com.ruoyi.member.controller.management.dto.MgtMemberQuery;
+import com.ruoyi.member.controller.management.vo.MgtMemberVO;
 import com.ruoyi.member.mapper.MemberMapper;
 import com.ruoyi.member.service.IMemberService;
 import com.ruoyi.member.util.HttpUtils;
@@ -27,16 +30,19 @@
 import com.ruoyi.system.api.constants.SecurityConstant;
 import com.ruoyi.system.api.domain.AppMiniLoginVO;
 import com.ruoyi.system.api.domain.Member;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.util.*;
-import java.util.concurrent.TimeUnit;
-import javax.annotation.Resource;
-
 import com.ruoyi.system.api.domain.SysUser;
 import com.ruoyi.system.api.domain.dto.AppMiniLoginDTO;
 import com.ruoyi.system.api.domain.dto.AppMiniRegisterDTO;
+import com.ruoyi.system.api.domain.dto.MemberDTO;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Resource;
 import org.apache.commons.io.IOUtils;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
@@ -472,6 +478,26 @@
         return EntityUtils.toString(response.getEntity());
     }
 
+    /**
+     * 获取会员管理分页列表
+     *
+     * @param query 会员列表查询对象
+     * @return PageDTO<MgtMemberVO>
+     */
+    @Override
+    public PageDTO<MgtMemberVO> getMemberPage(MgtMemberQuery query) {
+        Page<Member> page = this.lambdaQuery()
+                .select(Member::getId, Member::getNickname, Member::getRealName, Member::getPhone,
+                        Member::getIdNumber)
+                .like(StringUtils.isNotBlank(query.getRealName()), Member::getRealName,
+                        query.getRealName())
+                .like(StringUtils.isNotBlank(query.getPhone()), Member::getPhone, query.getPhone())
+                .page(new Page<>(query.getPageCurr(), query.getPageSize()));
+        if (StringUtils.isEmpty(page.getRecords())) {
+            return PageDTO.empty(page.getTotal(), page.getPages());
+        }
+        return PageDTO.of(page, MgtMemberVO.class);
+    }
 }
 
 
diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java
index 9be7c62..02fb8fc 100644
--- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java
@@ -4,6 +4,7 @@
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.core.utils.StringUtils;
+import com.ruoyi.common.core.utils.page.PageDTO;
 import com.ruoyi.common.core.utils.poi.ExcelUtil;
 import com.ruoyi.common.core.web.controller.BaseController;
 import com.ruoyi.common.core.web.domain.AjaxResult;
@@ -18,6 +19,9 @@
 import com.ruoyi.system.api.domain.SysUser;
 import com.ruoyi.system.api.model.LoginUser;
 import com.ruoyi.system.domain.SysUserRole;
+import com.ruoyi.system.domain.dto.SupplierDTO;
+import com.ruoyi.system.domain.dto.SupplierQuery;
+import com.ruoyi.system.domain.vo.SupplierVO;
 import com.ruoyi.system.service.ISysConfigService;
 import com.ruoyi.system.service.ISysDeptService;
 import com.ruoyi.system.service.ISysPermissionService;
@@ -497,4 +501,41 @@
         return R.ok(user);
     }
 
+    /**
+     * 获取供应商分页列表
+     *
+     * @param query 供应商列表查询数据传输对象
+     * @return PageDTO<SupplyUserVO>
+     */
+    @ApiOperation(value = "获取供应商分页列表", notes = "获取供应商分页列表")
+    @PostMapping("/supplier-page")
+    public R<PageDTO<SupplierVO>> getSupplierPage(@Validated @RequestBody SupplierQuery query) {
+        return R.ok(userService.getSupplierPage(query));
+    }
+
+    /**
+     * 添加/编辑供应商
+     *
+     * @param dto 供应商数据传输对象
+     */
+    @Log(title = "供应商管理", businessType = BusinessType.UPDATE)
+    @ApiOperation(value = "添加/编辑供应商", notes = "添加/编辑供应商")
+    @PostMapping("/save-supplier")
+    public R<?> saveSupplier(@Validated @RequestBody SupplierDTO dto) {
+        userService.saveSupplier(dto);
+        return R.ok();
+    }
+
+    /**
+     * 删除供应商
+     *
+     * @param id 供应商id
+     */
+    @ApiOperation(value = "删除供应商", notes = "删除供应商")
+    @DeleteMapping("/delete-supplier/{id}")
+    public R<?> deleteSupplier(@PathVariable("id") Long id) {
+        userService.deleteSupplier(id);
+        return R.ok();
+    }
+    
 }
diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/SupplierDTO.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/SupplierDTO.java
new file mode 100644
index 0000000..3c6c941
--- /dev/null
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/SupplierDTO.java
@@ -0,0 +1,29 @@
+package com.ruoyi.system.domain.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.validation.constraints.NotBlank;
+import lombok.Data;
+
+@Data
+@ApiModel("供应商数据传输对象")
+public class SupplierDTO implements Serializable {
+
+    private static final long serialVersionUID = -5026529248548952066L;
+
+    @ApiModelProperty(value = "供应商id", notes = "更新必传")
+    private Long userId;
+
+    @ApiModelProperty("供应商名称")
+    @NotBlank(message = "供应商名称不能为空")
+    private String nickName;
+
+    @ApiModelProperty("联系电话")
+    @NotBlank(message = "联系电话不能为空")
+    private String phonenumber;
+
+    @ApiModelProperty("登录密码")
+    @NotBlank(message = "登录密码不能为空")
+    private String password;
+}
\ No newline at end of file
diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/SupplierQuery.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/SupplierQuery.java
new file mode 100644
index 0000000..39ea365
--- /dev/null
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/SupplierQuery.java
@@ -0,0 +1,19 @@
+package com.ruoyi.system.domain.dto;
+
+import com.ruoyi.common.core.web.page.BasePage;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel("供应商列表查询数据传输对象")
+public class SupplierQuery extends BasePage {
+
+    private static final long serialVersionUID = -5026529248548952066L;
+
+    @ApiModelProperty("供应商名称")
+    private String nickName;
+
+}
\ No newline at end of file
diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/SupplierVO.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/SupplierVO.java
new file mode 100644
index 0000000..70030e2
--- /dev/null
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/SupplierVO.java
@@ -0,0 +1,25 @@
+package com.ruoyi.system.domain.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import lombok.Data;
+
+/**
+ * @author mitao
+ * @date 2024/6/5
+ */
+@Data
+@ApiModel("供应商视图对象")
+public class SupplierVO implements Serializable {
+
+    private static final long serialVersionUID = -5026529248548952066L;
+    @ApiModelProperty("供应商id")
+    private Long userId;
+
+    @ApiModelProperty("供应商名称")
+    private String nickName;
+
+    @ApiModelProperty("联系电话")
+    private String phonenumber;
+}
diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java
index 7dfeb89..b2656af 100644
--- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java
@@ -1,11 +1,14 @@
 package com.ruoyi.system.service;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.common.core.utils.page.PageDTO;
 import com.ruoyi.common.core.web.page.PageInfo;
 import com.ruoyi.system.api.domain.SysUser;
+import com.ruoyi.system.domain.dto.SupplierDTO;
+import com.ruoyi.system.domain.dto.SupplierQuery;
+import com.ruoyi.system.domain.vo.SupplierVO;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * 用户 业务层
@@ -217,4 +220,25 @@
 
     void deleteSysUser(ArrayList<Integer> userIds);
 
+    /**
+     * 获取供应商分页列表
+     *
+     * @param query 供应商列表查询数据传输对象
+     * @return PageDTO<SupplyUserVO>
+     */
+    PageDTO<SupplierVO> getSupplierPage(SupplierQuery query);
+
+    /**
+     * 添加/编辑供应商
+     *
+     * @param dto 供应商数据传输对象
+     */
+    void saveSupplier(SupplierDTO dto);
+
+    /**
+     * 删除供应商
+     *
+     * @param id 供应商id
+     */
+    void deleteSupplier(Long id);
 }
diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
index a7abbca..7aa59f0 100644
--- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
@@ -1,37 +1,42 @@
 package com.ruoyi.system.service.impl;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.core.constant.UserConstants;
+import com.ruoyi.common.core.exception.ServiceException;
+import com.ruoyi.common.core.utils.SpringUtils;
+import com.ruoyi.common.core.utils.StringUtils;
+import com.ruoyi.common.core.utils.bean.BeanValidators;
+import com.ruoyi.common.core.utils.page.BeanUtils;
+import com.ruoyi.common.core.utils.page.PageDTO;
+import com.ruoyi.common.core.web.page.PageInfo;
+import com.ruoyi.common.datascope.annotation.DataScope;
+import com.ruoyi.common.security.utils.SecurityUtils;
+import com.ruoyi.system.api.domain.SysRole;
+import com.ruoyi.system.api.domain.SysUser;
+import com.ruoyi.system.domain.SysPost;
+import com.ruoyi.system.domain.SysUserPost;
+import com.ruoyi.system.domain.SysUserRole;
+import com.ruoyi.system.domain.dto.SupplierDTO;
+import com.ruoyi.system.domain.dto.SupplierQuery;
+import com.ruoyi.system.domain.vo.SupplierVO;
+import com.ruoyi.system.mapper.SysPostMapper;
+import com.ruoyi.system.mapper.SysRoleMapper;
+import com.ruoyi.system.mapper.SysUserMapper;
+import com.ruoyi.system.mapper.SysUserPostMapper;
+import com.ruoyi.system.mapper.SysUserRoleMapper;
+import com.ruoyi.system.service.ISysConfigService;
+import com.ruoyi.system.service.ISysUserService;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.stream.Collectors;
 import javax.validation.Validator;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.ruoyi.common.core.web.page.PageInfo;
-import com.ruoyi.system.domain.SysPost;
-import com.ruoyi.system.domain.SysUserPost;
-import com.ruoyi.system.domain.SysUserRole;
-import com.ruoyi.system.service.ISysConfigService;
-import com.ruoyi.system.service.ISysUserService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
-import com.ruoyi.common.core.constant.UserConstants;
-import com.ruoyi.common.core.exception.ServiceException;
-import com.ruoyi.common.core.utils.SpringUtils;
-import com.ruoyi.common.core.utils.StringUtils;
-import com.ruoyi.common.core.utils.bean.BeanValidators;
-import com.ruoyi.common.datascope.annotation.DataScope;
-import com.ruoyi.common.security.utils.SecurityUtils;
-import com.ruoyi.system.api.domain.SysRole;
-import com.ruoyi.system.api.domain.SysUser;
-import com.ruoyi.system.mapper.SysPostMapper;
-import com.ruoyi.system.mapper.SysRoleMapper;
-import com.ruoyi.system.mapper.SysUserMapper;
-import com.ruoyi.system.mapper.SysUserPostMapper;
-import com.ruoyi.system.mapper.SysUserRoleMapper;
 
 /**
  * 用户 业务层处理
@@ -567,4 +572,61 @@
         this.baseMapper.deleteSysUser(userIds);
     }
 
+    /**
+     * 获取供应商分页列表
+     *
+     * @param query 供应商列表查询数据传输对象
+     * @return PageDTO<SupplyUserVO>
+     */
+    @Override
+    public PageDTO<SupplierVO> getSupplierPage(SupplierQuery query) {
+        Page<SysUser> page = this.lambdaQuery()
+                .select(SysUser::getUserId, SysUser::getNickName, SysUser::getPhonenumber)
+                .like(StringUtils.isNotBlank(query.getNickName()
+                ), SysUser::getNickName, query.getNickName()).eq(SysUser::getUserType, "03")
+                .eq(SysUser::getDelFlag, "0")
+                .page(new Page<>(query.getPageCurr(), query.getPageSize()));
+        if (StringUtils.isEmpty(page.getRecords())) {
+            return PageDTO.empty(page);
+        }
+        return PageDTO.of(page, SupplierVO.class);
+    }
+
+    /**
+     * 添加/编辑供应商
+     *
+     * @param dto 供应商数据传输对象
+     */
+    @Override
+    public void saveSupplier(SupplierDTO dto) {
+        // 添加
+        if (StringUtils.isNull(dto.getUserId())) {
+            SysUser user = BeanUtils.copyBean(dto, SysUser.class);
+            user.setUserName(dto.getPhonenumber());
+            user.setPassword(SecurityUtils.encryptPassword(dto.getPassword()));
+            user.setUserType("03");
+            this.save(user);
+        } else {
+            // 编辑
+            SysUser user = this.getById(dto.getUserId());
+            if (StringUtils.isNull(user)) {
+                throw new ServiceException("供应商不存在");
+            }
+            user.setNickName(dto.getNickName());
+            user.setPhonenumber(dto.getPhonenumber());
+            user.setUserName(dto.getPhonenumber());
+            user.setPassword(SecurityUtils.encryptPassword(dto.getPassword()));
+            this.updateById(user);
+        }
+    }
+
+    /**
+     * 删除供应商
+     *
+     * @param id 供应商id
+     */
+    @Override
+    public void deleteSupplier(Long id) {
+        this.lambdaUpdate().set(SysUser::getDelFlag, "2").eq(SysUser::getUserId, id).update();
+    }
 }

--
Gitblit v1.7.1