Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/dev' into dev

pangqijun 3 mesi fa
parent
commit
1199b9810f
22 ha cambiato i file con 369 aggiunte e 59 eliminazioni
  1. 21 0
      src/main/java/org/springblade/common/enums/FacilityStatusEnum.java
  2. 45 2
      src/main/java/org/springblade/modules/api/controller/ApiFacilityController.java
  3. 27 0
      src/main/java/org/springblade/modules/api/controller/ApiMerchantUserController.java
  4. 47 0
      src/main/java/org/springblade/modules/api/controller/ApiShopController.java
  5. 2 2
      src/main/java/org/springblade/modules/api/mapper/VendingOrderMapper.java
  6. 37 0
      src/main/java/org/springblade/modules/api/request/AlertChildAccountRequest.java
  7. 1 1
      src/main/java/org/springblade/modules/api/service/impl/VendingOrderServiceImpl.java
  8. 90 0
      src/main/java/org/springblade/modules/api/vo/MerchantIncomeVO.java
  9. 24 7
      src/main/java/org/springblade/modules/business/entity/Facility.java
  10. 16 8
      src/main/java/org/springblade/modules/business/entity/Shop.java
  11. 2 21
      src/main/java/org/springblade/modules/business/mapper/FacilityMapper.xml
  12. 5 0
      src/main/java/org/springblade/modules/business/vo/FacilityVO.java
  13. 7 0
      src/main/java/org/springblade/modules/finance/entity/OrderGoods.java
  14. 1 1
      src/main/java/org/springblade/modules/finance/mapper/OrderGoodsMapper.java
  15. 3 0
      src/main/java/org/springblade/modules/system/mapper/UserMerchantMapper.java
  16. 3 0
      src/main/java/org/springblade/modules/system/mapper/UserMerchantMapper.xml
  17. 9 0
      src/main/java/org/springblade/modules/system/service/IUserMerchantService.java
  18. 16 4
      src/main/java/org/springblade/modules/system/service/impl/UserMerchantServiceImpl.java
  19. 3 3
      src/main/resources/application-dev.yml
  20. 3 3
      src/main/resources/application-prod.yml
  21. 6 6
      src/main/resources/application-test.yml
  22. 1 1
      src/main/resources/application.yml

+ 21 - 0
src/main/java/org/springblade/common/enums/FacilityStatusEnum.java

@@ -0,0 +1,21 @@
+package org.springblade.common.enums;
+
+import lombok.Getter;
+
+@Getter
+public enum FacilityStatusEnum {
+
+    ON_LINE("在线", 1),
+    OFF_LINE("离线", 2),
+    FAULT("故障", 3);
+
+    private String name;
+    private Integer value;
+
+    FacilityStatusEnum(String name, Integer value) {
+        this.name = name;
+        this.value = value;
+    }
+
+
+}

+ 45 - 2
src/main/java/org/springblade/modules/api/controller/ApiFacilityController.java

@@ -11,6 +11,7 @@ import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import lombok.AllArgsConstructor;
 import org.springblade.common.constant.CommonConstant;
+import org.springblade.common.utils.DistanceUtils;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.secure.utils.AuthUtil;
@@ -38,7 +39,7 @@ public class ApiFacilityController extends BaseController {
     private final IUserMerchantService iUserMerchantService;
 
     @PostMapping("/save")
-    @ApiOperationSupport(order = 4)
+    @ApiOperationSupport(order = 1)
     @ApiOperation(value = "添加设备", notes = "传入facility")
     public R<Void> save(@Valid @RequestBody Facility facility) {
         return R.status(iFacilityService.add(facility));
@@ -57,17 +58,59 @@ public class ApiFacilityController extends BaseController {
             wrapper.in(Facility::getShopId, merchantShopIds);
         } else {
             List<Long> authShopId = iUserMerchantService.getAuthShopId(AuthUtil.getUserId());
+            if (CollUtil.isEmpty(authShopId)) {
+                return R.data(new Page<>());
+            }
             wrapper.in(Facility::getShopId, authShopId);
         }
         IPage<Facility> pages = iFacilityService.page(Condition.getPage(query), wrapper);
         return R.data(FacilityWrapper.build().pageVO(pages));
     }
 
-    @PostMapping("/delete")
+    @PostMapping("/details")
     @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "设备详情", notes = "传入id")
+    public R<FacilityVO> details(@ApiParam(value = "主键集合", required = true) @RequestParam Long facilityId) {
+        Facility facility = iFacilityService.getById(facilityId);
+        return R.data(FacilityWrapper.build().entityVO(facility));
+    }
+
+    @PostMapping("/delete")
+    @ApiOperationSupport(order = 4)
     @ApiOperation(value = "删除设备", notes = "传入ids")
     public R<Void> remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
         return R.status(iFacilityService.removeByIds(Func.toLongList(ids)));
     }
 
+    /**
+     * 小程序查询所有设备,并返回距离
+     */
+    @GetMapping("/all")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "小程序查询所有设备,并返回距离", notes = "经度纬度")
+    public R<List<FacilityVO>> all(@ApiParam(value = "经度", required = true) @RequestParam Double longitude,
+                                   @ApiParam(value = "纬度", required = true) @RequestParam Double latitude) {
+        List<Facility> pages = iFacilityService.list(Wrappers.lambdaQuery(Facility.class).eq(Facility::getUseStatus, 1));
+        List<FacilityVO> facilityVOS = FacilityWrapper.build().listVO(pages);
+        for (FacilityVO facilityVO : facilityVOS) {
+            facilityVO.setDistance(DistanceUtils.getDistance(longitude, latitude, Double.parseDouble(facilityVO.getLongitude()), Double.parseDouble(facilityVO.getLatitude())));
+        }
+        return R.data(facilityVOS);
+    }
+
+    /**
+     * 获取商家所有未绑定设备
+     */
+    @GetMapping("/allMerchantFacility")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "获取商家所有未绑定设备", notes = "获取商家所有未绑定设备")
+    public R<List<FacilityVO>> allMerchantFacility() {
+        List<Facility> list = iFacilityService.lambdaQuery()
+                .eq(Facility::getMerchantId, AuthUtil.getUserId())
+                .eq(Facility::getShopId, null)
+                .eq(Facility::getIsDelete, 0)
+                .list();
+        return R.data(FacilityWrapper.build().listVO(list));
+    }
+
 }

+ 27 - 0
src/main/java/org/springblade/modules/api/controller/ApiMerchantUserController.java

@@ -17,6 +17,8 @@ import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.DigestUtil;
 import org.springblade.core.tool.utils.WebUtil;
 import org.springblade.modules.api.request.AddChildAccountRequest;
+import org.springblade.modules.api.request.AlertChildAccountRequest;
+import org.springblade.modules.api.vo.MerchantIncomeVO;
 import org.springblade.modules.auth.enums.UserEnum;
 import org.springblade.modules.auth.utils.TokenUtil;
 import org.springblade.modules.system.entity.User;
@@ -102,6 +104,19 @@ public class ApiMerchantUserController {
         return R.success("添加成功");
     }
 
+    @Transactional
+    @PostMapping("/updateChildAccount")
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "修改子账号", notes = "alertChildAccountRequest")
+    public R<Void> deleteChildAccount(@Valid @RequestBody AlertChildAccountRequest request) {
+        UserMerchantVO userMerchant = iUserMerchantService.getByUserId(request.getId());
+        userMerchant.setParentId(AuthUtil.getUserId());
+        userMerchant.setAuditStatus(AuditStatusEnum.PASS.getValue());
+        userMerchant.setAuthShop(request.getAuthShopIds());
+        iUserMerchantService.updateById(userMerchant);
+        return R.success("修改成功");
+    }
+
     @Transactional
     @PostMapping("/deleteChildAccount")
     @ApiOperationSupport(order = 3)
@@ -124,4 +139,16 @@ public class ApiMerchantUserController {
         IPage<UserMerchantVO> pages = iUserMerchantService.selectUserMerchantPage(Condition.getPage(query), userMerchant);
         return R.data(pages);
     }
+
+    /**
+     * 我的钱包收益记录
+     */
+    @GetMapping("/pageIncome")
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "我的钱包收益记录-分页", notes = "我的钱包收益记录-分页")
+    public R<IPage<MerchantIncomeVO>> pageIncome(Query query) {
+        IPage<MerchantIncomeVO> pages = iUserMerchantService.pageIncome(Condition.getPage(query), AuthUtil.getUserId());
+        return R.data(pages);
+    }
+
 }

+ 47 - 0
src/main/java/org/springblade/modules/api/controller/ApiShopController.java

@@ -1,5 +1,6 @@
 package org.springblade.modules.api.controller;
 
+import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.lang.Assert;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -27,6 +28,7 @@ import org.springblade.modules.system.service.IUserMerchantService;
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
+import java.util.ArrayList;
 import java.util.List;
 
 @RestController
@@ -44,6 +46,14 @@ public class ApiShopController extends BaseController {
     @ApiOperation(value = "添加门店", notes = "传入shop")
     public R<Void> save(@Valid @RequestBody Shop shop) {
         shop.setMerchantId(AuthUtil.getUserId());
+
+        //添加设备门店关联
+        List<Facility> facilityList = iFacilityService.lambdaQuery()
+                .in(Facility::getId, Func.toLongList(shop.getFacilityIds()))
+                .list();
+        facilityList.forEach((item)->item.setShopId(shop.getId()));
+        iFacilityService.updateBatchById(facilityList);
+
         return R.status(iShopService.save(shop));
     }
 
@@ -51,6 +61,20 @@ public class ApiShopController extends BaseController {
     @ApiOperationSupport(order = 2)
     @ApiOperation(value = "修改门店", notes = "传入shop")
     public R<Void> update(@Valid @RequestBody Shop shop) {
+
+        //删除门店关联设备
+        iFacilityService.lambdaUpdate()
+                .set(Facility::getShopId, null)
+                .eq(Facility::getShopId, shop.getId())
+                .update();
+
+        //添加设备门店关联
+        List<Facility> facilityList = iFacilityService.lambdaQuery()
+                .in(Facility::getId, Func.toLongList(shop.getFacilityIds()))
+                .list();
+        facilityList.forEach((item)->item.setShopId(shop.getId()));
+        iFacilityService.updateBatchById(facilityList);
+
         return R.status(iShopService.updateById(shop));
     }
 
@@ -114,4 +138,27 @@ public class ApiShopController extends BaseController {
         Shop shop = iShopService.getById(facility.getShopId());
         return R.data(ShopWrapper.build().entityVO(shop));
     }
+
+
+    @GetMapping("/getAllShop")
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "获取商家所有门店", notes = "获取商家所有门店")
+    public R<List<ShopVO>> getAllShop() {
+        LambdaQueryWrapper<Shop> wrapper = Wrappers.lambdaQuery(Shop.class);
+        if (isMerchant()) {
+            List<Long> merchantShopIds = iShopService.getMerchantShopIds(AuthUtil.getUserId());
+            if (CollUtil.isEmpty(merchantShopIds)) {
+                return R.data(new ArrayList<>());
+            }
+            wrapper.in(Shop::getId, merchantShopIds);
+        } else {
+            List<Long> authShopId = iUserMerchantService.getAuthShopId(AuthUtil.getUserId());
+            if (CollUtil.isEmpty(authShopId)) {
+                return R.data(new ArrayList<>());
+            }
+            wrapper.in(Shop::getId, authShopId);
+        }
+        return R.data(ShopWrapper.build().listVO(iShopService.list(wrapper)));
+    }
+
 }

+ 2 - 2
src/main/java/org/springblade/modules/api/mapper/VendingOrderMapper.java

@@ -1,14 +1,14 @@
 package org.springblade.modules.api.mapper;
 
+import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.springblade.modules.api.request.VendingOrderReq;
 import org.springblade.modules.finance.vo.OrderGoodsVO;
 import org.springblade.modules.finance.vo.OrderVO;
-import org.springframework.stereotype.Repository;
 
 import java.util.List;
 
-@Repository
+@Mapper
 public interface VendingOrderMapper {
 
     List<OrderGoodsVO> getVendingOrder(@Param("param") VendingOrderReq vendingOrderReq);

+ 37 - 0
src/main/java/org/springblade/modules/api/request/AlertChildAccountRequest.java

@@ -0,0 +1,37 @@
+package org.springblade.modules.api.request;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+@Data
+public class AlertChildAccountRequest {
+    @NotBlank(message = "子账号Id")
+    @ApiModelProperty(value = "子账号Id")
+    private Long id;
+    @NotBlank(message = "手机号不能为空")
+    @ApiModelProperty(value = "手机号")
+    private String phone;
+    @ApiModelProperty(value = "昵称")
+    private String nickname;
+    @ApiModelProperty(value = "姓名")
+    private String realName;
+    @ApiModelProperty(value = "头像")
+    private String cover;
+    @ApiModelProperty(value = "密码")
+    private String password;
+    @ApiModelProperty(value = "确认密码")
+    private String rePassword;
+    @NotBlank(message = "授权门店不能为空")
+    @ApiModelProperty(value = "授权门店id集合,以逗号分隔")
+    private String authShopIds;
+
+    public String getPassword() {
+        return password == null ? "123456" : password;
+    }
+
+    public String getRePassword() {
+        return rePassword == null ? "123456" : rePassword;
+    }
+}

+ 1 - 1
src/main/java/org/springblade/modules/api/service/impl/VendingOrderServiceImpl.java

@@ -14,7 +14,7 @@ import java.util.List;
 /**
  * 售货机调用服务(无实体)
  */
-@Service("vendingOrderServiceImpl")
+@Service
 public class VendingOrderServiceImpl implements VendingOrderService {
 
     @Autowired

+ 90 - 0
src/main/java/org/springblade/modules/api/vo/MerchantIncomeVO.java

@@ -0,0 +1,90 @@
+package org.springblade.modules.api.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+@Data
+@ApiModel("收益分页返回")
+public class MerchantIncomeVO  {
+
+    /**
+     * 订单id
+     */
+    @ApiModelProperty(value = "订单id")
+    private Long orderId;
+    /**
+     * 商品id
+     */
+    @ApiModelProperty(value = "商品id")
+    private Long goodsId;
+    /**
+     * 商品数量
+     */
+    @ApiModelProperty(value = "商品数量")
+    private Integer goodsNum;
+    /**
+     * 商品名称
+     */
+    @ApiModelProperty(value = "商品名称")
+    private String goodsName;
+    /**
+     * 商品价格
+     */
+    @ApiModelProperty(value = "商品价格")
+    private BigDecimal goodsPrice;
+    /**
+     * 商品图片
+     */
+    @ApiModelProperty(value = "商品图片")
+    private String goodsImage;
+    /**
+     * 商品编号
+     */
+    @ApiModelProperty(value = "商品编号")
+    private String goodsNo;
+    /**
+     * 门店id
+     */
+    @ApiModelProperty(value = "门店id")
+    private Long shopId;
+    /**
+     * 门店名称
+     */
+    @ApiModelProperty(value = "门店名称")
+    private String storeName;
+    /**
+     * 设备id
+     */
+    @ApiModelProperty(value = "设备id")
+    private Long deviceId;
+    /**
+     * 商家id
+     */
+    @ApiModelProperty(value = "商家id")
+    private Long merchantId;
+    /**
+     * 用户id
+     */
+    @ApiModelProperty(value = "用户id")
+    private Long userId;
+    /**
+     * 货道id
+     */
+    @ApiModelProperty(value = "货道id")
+    private Long cargoWayId;
+    /**
+     * 货道id
+     */
+    @ApiModelProperty(value = "货道编号")
+    private String cargoWayNo;
+    /**
+     * 出货时间
+     */
+    @ApiModelProperty(value = "出货时间")
+    private LocalDateTime shippingTime;
+
+}

+ 24 - 7
src/main/java/org/springblade/modules/business/entity/Facility.java

@@ -1,12 +1,14 @@
 package org.springblade.modules.business.entity;
 
-import org.springblade.common.base.BaseEntity;
 import com.baomidou.mybatisplus.annotation.TableName;
-import java.time.LocalDateTime;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.common.base.BaseEntity;
+
+import javax.validation.constraints.NotNull;
+import java.time.LocalDateTime;
 
 /**
  * 售货设备表实体类
@@ -28,8 +30,14 @@ public class Facility extends BaseEntity {
 	@ApiModelProperty(value = "设备编号")
 	private String facilityNo;
 	/**
-	* 门店id
+	* 商家id
 	*/
+	@ApiModelProperty(value = "商家id")
+	@NotNull(message = "请选择设备商家")
+	private Long merchantId;
+	/**
+	 * 门店id
+	 */
 	@ApiModelProperty(value = "门店id")
 	private Long shopId;
 	/**
@@ -42,6 +50,11 @@ public class Facility extends BaseEntity {
 	*/
 	@ApiModelProperty(value = "设备型号")
 	private String facilityType;
+	/**
+	 * 设备地址
+	 */
+	@ApiModelProperty(value = "设备地址")
+	private String address;
 	/**
 	* 设备经度
 	*/
@@ -52,10 +65,15 @@ public class Facility extends BaseEntity {
 	*/
 	@ApiModelProperty(value = "设备纬度")
 	private String latitude;
+	/**
+	 * 使用状态
+	 */
+	@ApiModelProperty(value = "使用状态StatusEnum,1启用,0禁用")
+	private Integer useStatus;
 	/**
 	* 设备状态
 	*/
-	@ApiModelProperty(value = "设备状态")
+	@ApiModelProperty(value = "设备状态FacilityStatusEnum,1在线,2离线,3故障")
 	private Integer facilityStatus;
 	/**
 	* 最新上传数据时间
@@ -68,5 +86,4 @@ public class Facility extends BaseEntity {
 	@ApiModelProperty(value = "添加时间")
 	private LocalDateTime addTime;
 
-
 }

+ 16 - 8
src/main/java/org/springblade/modules/business/entity/Shop.java

@@ -1,18 +1,20 @@
 package org.springblade.modules.business.entity;
 
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import org.springblade.common.base.BaseEntity;
-import com.baomidou.mybatisplus.annotation.TableName;
-import java.time.LocalTime;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.common.base.BaseEntity;
 import org.springblade.common.config.LocalTimeDeserializer;
 
 import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
+import java.time.LocalTime;
 
 /**
  * 门店表实体类
@@ -50,13 +52,13 @@ public class Shop extends BaseEntity {
 	* 经度
 	*/
 	@NotNull(message = "经度不能为空")
-	@ApiModelProperty(value = "经度")
+//	@ApiModelProperty(value = "经度")
 	private Double longitude;
 	/**
 	* 纬度
 	*/
 	@NotNull(message = "纬度不能为空")
-	@ApiModelProperty(value = "纬度")
+//	@ApiModelProperty(value = "纬度")
 	private Double latitude;
 	/**
 	* 所属商家id
@@ -97,6 +99,12 @@ public class Shop extends BaseEntity {
 	@JsonDeserialize(using = LocalTimeDeserializer.class)
 	@ApiModelProperty(value = "营业结束时间")
 	private LocalTime closingHours;
-
+	/**
+	 * 门店设备
+	 */
+	@NotEmpty(message = "请选择门店设备")
+	@TableField(exist = false)
+	@ApiModelProperty(value = "门店设备id集合,以逗号分隔")
+	private String facilityIds;
 
 }

+ 2 - 21
src/main/java/org/springblade/modules/business/mapper/FacilityMapper.xml

@@ -2,29 +2,10 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.springblade.modules.business.mapper.FacilityMapper">
 
-    <!-- 通用查询映射结果 -->
-    <resultMap id="facilityResultMap" type="org.springblade.modules.business.entity.Facility">
-        <result column="id" property="id"/>
-        <result column="is_delete" property="isDelete"/>
-        <result column="create_user_id" property="createUserId"/>
-        <result column="create_time" property="createTime"/>
-        <result column="update_user_id" property="updateUserId"/>
-        <result column="update_time" property="updateTime"/>
-        <result column="facility_no" property="facilityNo"/>
-        <result column="shop_id" property="shopId"/>
-        <result column="facility_name" property="facilityName"/>
-        <result column="facility_type" property="facilityType"/>
-        <result column="longitude" property="longitude"/>
-        <result column="latitude" property="latitude"/>
-        <result column="facility_status" property="facilityStatus"/>
-        <result column="heartbeat_time" property="heartbeatTime"/>
-        <result column="add_time" property="addTime"/>
-    </resultMap>
-
-
-    <select id="selectFacilityPage" resultMap="facilityResultMap">
+    <select id="selectFacilityPage" resultType="org.springblade.modules.business.vo.FacilityVO">
         select * from t_facility where is_delete = 0
     </select>
+
     <select id="selectGoods" resultType="org.springblade.modules.mall.vo.GoodsInfoVO">
         SELECT
             gi.id,

+ 5 - 0
src/main/java/org/springblade/modules/business/vo/FacilityVO.java

@@ -33,4 +33,9 @@ import org.springblade.modules.business.entity.Facility;
 public class FacilityVO extends Facility {
     private static final long serialVersionUID = 1L;
 
+    /**
+     * 距离
+     */
+    private double distance;
+
 }

+ 7 - 0
src/main/java/org/springblade/modules/finance/entity/OrderGoods.java

@@ -1,5 +1,6 @@
 package org.springblade.modules.finance.entity;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -29,6 +30,12 @@ public class OrderGoods extends BaseEntity {
 	*/
 	@ApiModelProperty(value = "订单id")
 	private Long orderId;
+	/**
+	 * 订单id
+	 */
+	@ApiModelProperty(value = "订单编号")
+	@TableField(exist = false)
+	private String orderNo;
 	/**
 	* 商品id
 	*/

+ 1 - 1
src/main/java/org/springblade/modules/finance/mapper/OrderGoodsMapper.java

@@ -49,6 +49,6 @@ public interface OrderGoodsMapper extends BaseMapper<OrderGoods> {
 	 */
     List<OrderGoodsVO> selectUserOrder(IPage<OrderGoodsVO> page, @Param("p") OrderGoodsVO orderGoods);
 
-    List<MerchantPageOrderVO> getMerchantOrder(IPage page, @Param("param") MerchantPageOrderVO merchantPageOrderVO);
+    List<MerchantPageOrderVO> getMerchantOrder(IPage<MerchantPageOrderVO> page, @Param("param") MerchantPageOrderVO merchantPageOrderVO);
 
 }

+ 3 - 0
src/main/java/org/springblade/modules/system/mapper/UserMerchantMapper.java

@@ -17,6 +17,7 @@
 package org.springblade.modules.system.mapper;
 
 import org.apache.ibatis.annotations.Param;
+import org.springblade.modules.api.vo.MerchantIncomeVO;
 import org.springblade.modules.system.entity.UserMerchant;
 import org.springblade.modules.system.vo.UserMerchantVO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -40,4 +41,6 @@ public interface UserMerchantMapper extends BaseMapper<UserMerchant> {
 	 */
 	List<UserMerchantVO> selectUserMerchantPage(IPage page, @Param("p") UserMerchantVO userMerchant);
 
+	List<MerchantIncomeVO> pageIncome(IPage<MerchantIncomeVO> page, Long userId);
+
 }

+ 3 - 0
src/main/java/org/springblade/modules/system/mapper/UserMerchantMapper.xml

@@ -38,5 +38,8 @@
         </if>
     </select>
 
+    <select id="pageIncome" resultType="org.springblade.modules.api.vo.MerchantIncomeVO">
+        select * from t_order_goods where 1=1
+    </select>
 
 </mapper>

+ 9 - 0
src/main/java/org/springblade/modules/system/service/IUserMerchantService.java

@@ -16,6 +16,7 @@
  */
 package org.springblade.modules.system.service;
 
+import org.springblade.modules.api.vo.MerchantIncomeVO;
 import org.springblade.modules.system.entity.UserMerchant;
 import org.springblade.modules.system.vo.UserMerchantVO;
 import com.baomidou.mybatisplus.extension.service.IService;
@@ -54,4 +55,12 @@ public interface IUserMerchantService extends IService<UserMerchant> {
 	 */
 	List<Long> getAuthShopId(Long userId);
 
+	/**
+	 * 商家收益记录
+	 * @param page
+	 * @param userId
+	 * @return
+	 */
+    IPage<MerchantIncomeVO> pageIncome(IPage<MerchantIncomeVO> page, Long userId);
+
 }

+ 16 - 4
src/main/java/org/springblade/modules/system/service/impl/UserMerchantServiceImpl.java

@@ -16,19 +16,20 @@
  */
 package org.springblade.modules.system.service.impl;
 
-import cn.hutool.core.collection.CollectionUtil;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.modules.api.vo.MerchantIncomeVO;
 import org.springblade.modules.system.entity.UserMerchant;
-import org.springblade.modules.system.vo.UserMerchantVO;
 import org.springblade.modules.system.mapper.UserMerchantMapper;
 import org.springblade.modules.system.service.IUserMerchantService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.modules.system.vo.UserMerchantVO;
 import org.springblade.modules.system.wrapper.UserMerchantWrapper;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.core.metadata.IPage;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Objects;
 
 /**
  * 商家用户表 服务实现类
@@ -53,6 +54,12 @@ public class UserMerchantServiceImpl extends ServiceImpl<UserMerchantMapper, Use
 	@Override
 	public List<Long> getAuthShopId(Long userId) {
 		UserMerchant one = getOne(Wrappers.lambdaQuery(UserMerchant.class).eq(UserMerchant::getUserId, userId));
+		if(Objects.isNull(one)){
+            return new ArrayList<>();
+		}
+		if(Objects.isNull(one.getAuthShop())){
+			return new ArrayList<>();
+		}
 		String[] split = one.getAuthShop().split(",");
 		List<Long> ids = new ArrayList<>();
 		for (String s : split) {
@@ -61,4 +68,9 @@ public class UserMerchantServiceImpl extends ServiceImpl<UserMerchantMapper, Use
 		return ids;
 	}
 
+	@Override
+	public IPage<MerchantIncomeVO> pageIncome(IPage<MerchantIncomeVO> page, Long userId) {
+		return page.setRecords(baseMapper.pageIncome(page, userId));
+	}
+
 }

+ 3 - 3
src/main/resources/application-dev.yml

@@ -60,9 +60,9 @@ oss:
 wxpay:
   fileRootPath: D:\workspace\groupon-api\src\main\resources\cert\
   v3:
-    appId: wxf6dd733a0a8f0619
-    appIdxcx: wx932f9873f2dc5655
-    appSecretxcx: 8bc0543ac511a111f0c02dc887bdb8e2
+    appId: wxb36cbb868a7d2d68
+    appIdxcx: wxb36cbb868a7d2d68
+    appSecretxcx: cf59d9b3f9030b9c601d29f2c957f70e
     keyPath: ${wxpay.fileRootPath}apiclient_key.pem
     certPath: ${wxpay.fileRootPath}apiclient_cert.pem
     certP12Path: ${wxpay.fileRootPath}cert/apiclient_cert.p12

+ 3 - 3
src/main/resources/application-prod.yml

@@ -42,9 +42,9 @@ blade:
 wxpay:
   fileRootPath: /usr/local/groupon/cert/
   v3:
-    appId: wxf6dd733a0a8f0619
-    appIdxcx: wxf6dd733a0a8f0619
-    appSecretxcx: cae93dde9b616dba74b8531f9d4cb7dc
+    appId: wxb36cbb868a7d2d68
+    appIdxcx: wxb36cbb868a7d2d68
+    appSecretxcx: cf59d9b3f9030b9c601d29f2c957f70e
     keyPath: ${wxpay.fileRootPath}apiclient_key.pem
     certPath: ${wxpay.fileRootPath}apiclient_cert.pem
     certP12Path: ${wxpay.fileRootPath}cert/apiclient_cert.p12

+ 6 - 6
src/main/resources/application-test.yml

@@ -1,13 +1,13 @@
 #数据源配置
 spring:
   redis:
-    host: 192.168.1.74
-    port: 6379
+    host: www.gzzzyd.com
+    port: 10896
     database: 10
     ssl: false
     password: 123456789
   datasource:
-    url: jdbc:mysql://192.168.1.74:3306/vend?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
+    url: jdbc:mysql://www.gzzzyd.com:10895/vend?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
     username: root
     password: root_123
 
@@ -45,9 +45,9 @@ blade:
 wxpay:
   fileRootPath: /data/cert/wx/
   v3:
-    appId: wxf6dd733a0a8f0619
-    appIdxcx: wxf6dd733a0a8f0619
-    appSecretxcx: cae93dde9b616dba74b8531f9d4cb7dc
+    appId: wxb36cbb868a7d2d68
+    appIdxcx: wxb36cbb868a7d2d68
+    appSecretxcx: cf59d9b3f9030b9c601d29f2c957f70e
     keyPath: ${wxpay.fileRootPath}apiclient_key.pem
     certPath: ${wxpay.fileRootPath}apiclient_cert.pem
     certP12Path: ${wxpay.fileRootPath}cert/apiclient_cert.p12

+ 1 - 1
src/main/resources/application.yml

@@ -270,7 +270,7 @@ blade:
       - /v1/groupon/detail
       - /v1/groupon/detail
       - /v1/article-detail
-      - /v1/shop/all
+      - /v1/facility/all
       - /groupon/groupon/gen
       - /v1/vending/**
     #授权认证配置