ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/vo/OrderDetailVO.java
@@ -14,6 +14,9 @@ @ApiModelProperty(value = "订单id") private Long id; @ApiModelProperty(value = "订单状态") private Integer orderStatus; @ApiModelProperty(value = "订单商品") private List<OrderGoodsVO> goodsList; @@ -59,4 +62,7 @@ @ApiModelProperty(value = "实际支付价格") private BigDecimal paymentAmount; @ApiModelProperty(value = "配送方式(1=自提,2=快递)") private Integer distributionMode; } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserAddressController.java
@@ -101,6 +101,19 @@ } /** * 获取登录用户地址列表 * @return */ @ResponseBody @GetMapping("/getUserAddressList") @ApiOperation(value = "获取登录用户地址列表", tags = {"小程序-个人中心首页-我的地址"}) public R<List<UserAddress>> getUserAddressList(){ Long userId = tokenService.getLoginUserApplet().getUserid(); List<UserAddress> list = userAddressService.lambdaQuery().eq(UserAddress::getAppUserId, userId).list(); return R.ok(list); } /** * 根据id获取用户地址信息 * @param id * @return @@ -112,5 +125,7 @@ return R.ok(userAddress); } } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/WalletController.java
@@ -27,6 +27,7 @@ import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; @@ -115,18 +116,19 @@ return R.ok(list); } // /** // * 充值 // */ // @GetMapping("recharge") // @ApiOperation(value = "充值", notes = "钱包充值") // public AjaxResult recharge(@ApiParam(value = "充值金额", required = true) @RequestParam BigDecimal amount) { // Long userId = SecurityUtils.getUserId(); // String openId; // // 商户号 // String partnerTradeNo; // // TODO 充值 // return AjaxResult.success(); // } /** * 充值 */ @GetMapping("recharge") @ApiOperation(value = "充值", notes = "钱包充值") public R<Void> recharge(@ApiParam(value = "充值金额", required = true) @RequestParam BigDecimal amount) { LoginUser loginUserApplet = tokenService.getLoginUserApplet(); AppUser appUser = appUserService.getById(loginUserApplet.getUserid()); String wxOpenid = appUser.getWxOpenid(); // 商户号 String partnerTradeNo; // TODO 充值 return R.ok(); } } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java
@@ -1,5 +1,6 @@ package com.ruoyi.order.service.impl; import cn.hutool.core.collection.CollectionUtil; import com.alibaba.fastjson2.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -24,6 +25,7 @@ import com.ruoyi.other.api.domain.Goods; import com.ruoyi.other.api.domain.OrderActivityInfo; import com.ruoyi.other.api.domain.Technician; import com.ruoyi.other.api.feignClient.GoodsClient; import com.ruoyi.other.api.feignClient.TechnicianClient; import com.ruoyi.system.api.model.LoginUser; import org.springframework.stereotype.Service; @@ -54,6 +56,8 @@ private TokenService tokenService; @Resource private TechnicianClient technicianClient; @Resource private GoodsClient goodsClient; @Override @@ -70,6 +74,7 @@ if (order == null){ throw new ServiceException("订单不存在"); } // 商品 List<OrderGood> orderGoods = orderGoodMapper.selectList(new LambdaQueryWrapper<OrderGood>() .eq(OrderGood::getOrderId, orderId)); @@ -89,6 +94,7 @@ orderGoodsVO.setOriginalPrice(goods.getOriginalPrice()); goodsList.add(orderGoodsVO); } // 收货地址 @@ -114,7 +120,17 @@ } OrderDetailVO orderDetailVO = new OrderDetailVO(); if (CollectionUtil.isNotEmpty(orderGoods)){ String goodJson = orderGoods.get(0).getGoodJson(); Goods goods = JSONObject.parseObject(goodJson, Goods.class); orderDetailVO.setDistributionMode(goods.getDistributionMode()); } orderDetailVO.setId(order.getId()); orderDetailVO.setOrderStatus(order.getOrderStatus()); orderDetailVO.setPoint(order.getPoint()); orderDetailVO.setAddressId(userAddress.getId()); orderDetailVO.setRecieveName(userAddress.getRecieveName()); ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/enums/GoodsStatus.java
@@ -4,8 +4,8 @@ @Getter public enum GoodsStatus { DOWN(0, "下架"), UP(1, "上架"); DOWN(1, "下架"), UP(2, "上架"); private final Integer code; private final String desc; ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java
@@ -53,7 +53,7 @@ @Override public List<GoodsVO> goodsList(Goods search) { List<Goods> goodsList = this.list(new LambdaQueryWrapper<Goods>() .eq(Goods::getStatus, GoodsStatus.UP) .eq(Goods::getStatus, GoodsStatus.UP.getCode()) .eq(Objects.nonNull(search.getGoodsCategoryId()), Goods::getGoodsCategoryId, search.getGoodsCategoryId()) .like(StringUtils.isNotEmpty(search.getName()), Goods::getName, search.getName())); @@ -61,6 +61,8 @@ for (Goods goods : goodsList) { GoodsVO goodsVO = new GoodsVO(); BeanUtils.copyBeanProp(goodsVO, goods); goodsVO.setGoodsId(goods.getId()); goodsVO.setGoodsName(goods.getName()); result.add(goodsVO); } return result; ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/GoodsVO.java
@@ -12,7 +12,7 @@ public class GoodsVO { @ApiModelProperty(value = "商品id") private Long goodsId; private Integer goodsId; @ApiModelProperty(value = "商品名称") private String goodsName;