phpcjl
2024-11-28 e81d5ff655e0c5efc85d2e4b3803bc604baf59f1
1.完成部分接口开发
12个文件已修改
184 ■■■■■ 已修改文件
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Goods.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/GoodsArea.java 101 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Region.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/ShoppingCartController.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/ShoppingCartService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/GoodsAreaMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/GoodsMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/GoodsAreaService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsAreaServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/GoodsMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Goods.java
@@ -104,7 +104,7 @@
    @ApiModelProperty(value = "商品权限JSON(0=全部,1=游客,2=普通会员,3=黄金会员,4=钻石会员,5=准代理,6=代理,7=总代,8=合伙人)")
    @TableField("commodity_authority")
    private Integer commodityAuthority;
    private String commodityAuthority;
    @ApiModelProperty(value = "删除(0=否,1=是)")
    @TableField("del_flag")
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/GoodsArea.java
@@ -1,7 +1,5 @@
package com.ruoyi.other.api.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
@@ -12,117 +10,60 @@
import java.io.Serializable;
import java.math.BigDecimal;
/**
 * <p>
 *
 * </p>
 *
 * @author luodangjia
 * @since 2024-11-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("t_goods_area")
@ApiModel(value="GoodsArea对象", description="")
@ApiModel(value = "GoodsArea对象", description = "")
public class GoodsArea implements Serializable {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.NONE)
    @TableId
    private Long id;
    @ApiModelProperty(value = "商品id")
    @TableField("goods_id")
    private Integer goodsId;
    private Long goodsPd;
    @ApiModelProperty(value = "省")
    @TableField("province")
    private String province;
    @ApiModelProperty(value = "省编号")
    @TableField("province_code")
    private String provinceCode;
    private String provincePode;
    @ApiModelProperty(value = "市")
    @TableField("city")
    private String city;
    @ApiModelProperty(value = "市编号")
    @TableField("city_code")
    private String cityCode;
    private String cityPode;
    @ApiModelProperty(value = "区")
    @TableField("districts")
    private String districts;
    @ApiModelProperty(value = "区编号")
    @TableField("districts_code")
    private String districtsCode;
    private String districtsPode;
    @ApiModelProperty(value = "会员级别(1=普通会员,2=黄金会员,3=钻石会员,4=准代理,5=代理,6=总代,7=合伙人)")
    @TableField("vip")
    private Integer vip;
    private Long vip;
    @ApiModelProperty(value = "现金支付(0=否,1=是)")
    @TableField("cash_payment")
    private Integer cashPayment;
    private Long cashPayment;
    @ApiModelProperty(value = "积分支付(0=否,1=是)")
    @TableField("point_payment")
    private Integer pointPayment;
    private Long pointPayment;
    @ApiModelProperty(value = "基础售价")
    @TableField("selling_price")
    private BigDecimal sellingPrice;
    @ApiModelProperty(value = "基础积分")
    @TableField("integral")
    private Integer integral;
    private Long integral;
    @ApiModelProperty(value = "可获得消费积分")
    @TableField("earn_spending_points")
    private Integer earnSpendingPoints;
    private Long earnPpendingPoints;
    @ApiModelProperty(value = "上级获得分佣金额")
    @TableField("superior_subcommission")
    private BigDecimal superiorSubcommission;
    private BigDecimal superiorPubcommission;
    @ApiModelProperty(value = "上级获得返佣积分")
    @TableField("superior_rebate_points")
    private Integer superiorRebatePoints;
    private Long superiorPebatePoints;
    @ApiModelProperty(value = "获取返佣积分上级类型(1=直推上级,2=直帮上级)")
    @TableField("superior_type")
    private Integer superiorType;
    private Long superiorPype;
    @ApiModelProperty(value = "核销门店可获得服务费")
    @TableField("servuce_shop_charges")
    private BigDecimal servuceShopCharges;
    private BigDecimal servucePhopPharges;
    @ApiModelProperty(value = "核销门店可获得服务积分")
    @TableField("servuce_shop_points")
    private Integer servuceShopPoints;
    private Long servucePhopPoints;
    @ApiModelProperty(value = "技师可获得服务积分")
    @TableField("technician_points")
    private Integer technicianPoints;
    private Long technicianPoints;
    @ApiModelProperty(value = "绑定门店可获得分佣金额")
    @TableField("bound_shop_charges")
    private BigDecimal boundShopCharges;
    private BigDecimal boundPhopPharges;
    @ApiModelProperty(value = "绑定门店可获得返佣积分")
    @TableField("bound_shop_points")
    private Integer boundShopPoints;
    private Long boundPhopPoints;
    @ApiModelProperty(value = "绑定门店上级门店可获得分佣金额")
    @TableField("bound_shop_superiors_charges")
    private BigDecimal boundShopSuperiorsCharges;
    private BigDecimal boundPhopPuperiorsPharges;
    @ApiModelProperty(value = "绑定门店上级门店可获得返佣积分")
    @TableField("bound_shop_superiors_points")
    private Integer boundShopSuperiorsPoints;
    private Long boundPhopPuperiorsPoints;
}
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Region.java
@@ -14,6 +14,8 @@
@TableName("t_region")
@ApiModel(value="Region对象", description="")
public class Region implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/ShoppingCartController.java
@@ -1,8 +1,7 @@
package com.ruoyi.order.controller;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.BaseTable;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.order.service.ShoppingCartService;
import com.ruoyi.order.vo.*;
@@ -10,6 +9,7 @@
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import model.ShoppingCart;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -18,10 +18,10 @@
@RequestMapping("/shopping-cart")
@Api(tags = "购物车")
public class ShoppingCartController extends BaseController {
    @Resource
    private ShoppingCartService shoppingCartService;
    
    @ResponseBody
    @GetMapping("/getMyShoppingCart/{type}/{shopId}")
@@ -34,14 +34,21 @@
        startPage();
        return getDataTable(shoppingCartService.getMyShoppingCart(type, shopId));
    }
    @PostMapping("/addGoods")
    @ApiOperation(value = "添加购物车", tags = {"商城-购物车-小程序"})
    public R<Void> addGoods(@RequestBody ShoppingCart shoppingCart) {
        shoppingCartService.addGoods(shoppingCart);
        return R.ok();
    }
    
    
    @ResponseBody
    @PostMapping("/setGoodsNumber")
    @ApiOperation(value = "修改购物车数量", tags = {"商城-购物车-小程序"})
    public AjaxResult setGoodsNumber(@RequestBody SetGoodsNumber setGoodsNumber){
    public R<Void> setGoodsNumber(@RequestBody SetGoodsNumber setGoodsNumber){
        // todo 待完善 pu
        return AjaxResult.success();
        return R.ok();
    }
    
    
@@ -49,18 +56,18 @@
    @ResponseBody
    @PostMapping("/confirmOrder")
    @ApiOperation(value = "确定购物车订单", tags = {"商城-购物车-小程序"})
    public AjaxResult<ConfirmOrderVo> confirmOrder(@RequestBody ConfirmOrder confirmOrder){
    public R<ConfirmOrderVo> confirmOrder(@RequestBody ConfirmOrder confirmOrder){
        // todo 待完善 pu
        return AjaxResult.success();
        return R.ok();
    }
    
    
    @ResponseBody
    @PostMapping("/shoppingCartPayment")
    @ApiOperation(value = "购物车订单支付", tags = {"商城-购物车-小程序"})
    public AjaxResult shoppingCartPayment(@RequestBody ShoppingCartPayment shoppingCartPayment){
    public R<Void> shoppingCartPayment(@RequestBody ShoppingCartPayment shoppingCartPayment){
        // todo 待完善 pu
        return AjaxResult.success();
        return R.ok();
    }
    
    
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/ShoppingCartService.java
@@ -16,4 +16,10 @@
     * @return
     */
    List<MyShoppingCartVo> getMyShoppingCart(Integer type, Integer shopId);
    /**
     * 添加商品
     * @param shoppingCart
     */
    void addGoods(ShoppingCart shoppingCart);
}
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java
@@ -101,4 +101,11 @@
        }
        return page;
    }
    @Override
    public void addGoods(ShoppingCart shoppingCart) {
        Long userid = tokenService.getLoginUserApplet().getUserid();
        shoppingCart.setAppUserId(userid);
        this.save(shoppingCart);
    }
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/GoodsAreaMapper.java
@@ -3,9 +3,5 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.other.api.domain.GoodsArea;
/**
 * @author zhibing.pu
 * @Date 2024/11/28 9:34
 */
public interface GoodsAreaMapper extends BaseMapper<GoodsArea> {
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/GoodsMapper.java
@@ -14,5 +14,5 @@
 * @since 2024-11-20
 */
public interface GoodsMapper extends BaseMapper<Goods> {
    List<Goods> selectListByShopId(Integer shopId);
    List<Goods> selectListByShopId(Integer shopId, String vip);
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/GoodsAreaService.java
@@ -3,9 +3,5 @@
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.other.api.domain.GoodsArea;
/**
 * @author zhibing.pu
 * @Date 2024/11/28 9:33
 */
public interface GoodsAreaService extends IService<GoodsArea> {
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsAreaServiceImpl.java
@@ -6,10 +6,11 @@
import com.ruoyi.other.service.GoodsAreaService;
import org.springframework.stereotype.Service;
/**
 * @author zhibing.pu
 * @Date 2024/11/28 9:33
 */
import javax.annotation.Resource;
@Service
public class GoodsAreaServiceImpl extends ServiceImpl<GoodsAreaMapper, GoodsArea> implements GoodsAreaService {
    @Resource
    private GoodsAreaMapper goodsAreaMapper;
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java
@@ -1,5 +1,6 @@
package com.ruoyi.other.service.impl;
import cn.hutool.json.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.utils.StringUtils;
@@ -8,8 +9,10 @@
import com.ruoyi.other.api.domain.Goods;
import com.ruoyi.other.api.domain.VipSetting;
import com.ruoyi.other.enums.GoodsStatus;
import com.ruoyi.other.mapper.GoodsAreaMapper;
import com.ruoyi.other.mapper.GoodsMapper;
import com.ruoyi.other.service.GoodsService;
import com.ruoyi.other.service.GoodsVipService;
import com.ruoyi.other.service.VipSettingService;
import com.ruoyi.other.vo.GoodsVO;
import com.ruoyi.system.api.model.LoginUser;
@@ -36,6 +39,10 @@
    private TokenService tokenService;
    @Resource
    private VipSettingService vipSettingService;
    @Resource
    private GoodsAreaMapper goodsAreaMapper;
    @Resource
    private GoodsVipService goodsVipService;
    @Override
    public List<GoodsVO> goodsList(Goods search) {
@@ -55,10 +62,11 @@
    @Override
    public GoodsVO goodsDetail(Long goodsId) {
        // TODO 根据会员等级计算价格、积分
        LoginUser loginUserApplet = tokenService.getLoginUserApplet();
        VipSetting vipSetting = vipSettingService.getVipSettingByUserId(loginUserApplet.getUserid());
        // ...
        // TODO 根据会员等级计算价格、积分
        Goods goods = this.getById(goodsId);
        if (Objects.nonNull(goods)){
            GoodsVO goodsVO = new GoodsVO();
@@ -70,6 +78,11 @@
    @Override
    public List<Goods> getGoodsListByShopId(Integer shopId) {
        return goodsMapper.selectListByShopId(shopId);
        LoginUser loginUserApplet = tokenService.getLoginUserApplet();
        VipSetting vipSetting = vipSettingService.getVipSettingByUserId(loginUserApplet.getUserid());
        JSONArray array = new JSONArray();
        array.add(vipSetting.getId());
        return goodsMapper.selectListByShopId(shopId,array.toString());
    }
}
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/GoodsMapper.xml
@@ -17,6 +17,9 @@
                LEFT JOIN t_goods_shop tgs ON ts.id = tgs.shop_id
                LEFT JOIN t_goods tg ON tg.id = tgs.goods_id
        where ts.id = #{shopId}
        <if test="vip != null">
            and JSON_CONTAINS(commodity_authority, #{vip})
        </if>
        ORDER BY tg.sale_num DESC
    </select>
</mapper>