mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-08-21 21:52:19 +08:00
Merge remote-tracking branch 'yudao/feature/mall_product' into feature/mall_product
# Conflicts: # yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderServiceTest.java
This commit is contained in:
@@ -15,6 +15,7 @@ import java.util.Arrays;
|
||||
@AllArgsConstructor
|
||||
public enum DeliveryTypeEnum implements IntArrayValuable {
|
||||
|
||||
NULL(0, "无需物流"),
|
||||
EXPRESS(1, "快递发货"),
|
||||
PICK_UP(2, "用户自提"),;
|
||||
|
||||
|
@@ -93,6 +93,10 @@
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-excel</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-biz-dict</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
@@ -4,6 +4,7 @@ import cn.hutool.core.util.RandomUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.trade.controller.app.delivery.vo.pickup.AppDeliveryPickUpStoreRespVO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -17,7 +18,7 @@ import java.util.Random;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "用户 App - 门店自提")
|
||||
@Tag(name = "用户 App - 自提门店")
|
||||
@RestController
|
||||
@RequestMapping("/trade/delivery/pick-up-store")
|
||||
@Validated
|
||||
@@ -37,8 +38,8 @@ public class AppDeliverPickUpStoreController {
|
||||
store.setLogo("https://www.iocoder.cn/" + (i + 1) + ".png");
|
||||
store.setPhone("15601691300");
|
||||
store.setAreaId(random.nextInt(100000));
|
||||
store.setAreaName(RandomUtil.randomString(10));
|
||||
store.setDetailAddress(RandomUtil.randomString(10));
|
||||
store.setAreaName("上海-" + RandomUtil.randomString(10));
|
||||
store.setDetailAddress("普陀区-" + RandomUtil.randomString(10));
|
||||
store.setLatitude(random.nextDouble() * 10);
|
||||
store.setLongitude(random.nextDouble() * 10);
|
||||
store.setDistance(random.nextInt(1000));
|
||||
@@ -49,4 +50,23 @@ public class AppDeliverPickUpStoreController {
|
||||
return success(list);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得自提门店")
|
||||
@Parameter(name = "id", description = "门店编号")
|
||||
public CommonResult<AppDeliveryPickUpStoreRespVO> getOrder(@RequestParam("id") Long id) {
|
||||
AppDeliveryPickUpStoreRespVO store = new AppDeliveryPickUpStoreRespVO();
|
||||
Random random = new Random();
|
||||
store.setId(random.nextLong());
|
||||
store.setName(RandomUtil.randomString(10));
|
||||
store.setLogo("https://www.iocoder.cn/" + (1) + ".png");
|
||||
store.setPhone("15601691300");
|
||||
store.setAreaId(random.nextInt(100000));
|
||||
store.setAreaName("上海-" + RandomUtil.randomString(10));
|
||||
store.setDetailAddress("普陀区-" + RandomUtil.randomString(10));
|
||||
store.setLatitude(random.nextDouble() * 10);
|
||||
store.setLongitude(random.nextDouble() * 10);
|
||||
store.setDistance(random.nextInt(1000));
|
||||
return success(store);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -127,6 +127,14 @@ public class AppTradeOrderController {
|
||||
return success(orderCount);
|
||||
}
|
||||
|
||||
@PutMapping("/take")
|
||||
@Operation(summary = "确认交易订单收货")
|
||||
@Parameter(name = "id", description = "交易订单编号")
|
||||
public CommonResult<Boolean> takeOrder(@RequestParam("id") Long id) {
|
||||
// TODO @芋艿:未实现,mock 用
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/cancel")
|
||||
@Operation(summary = "取消交易订单")
|
||||
@Parameter(name = "id", description = "交易订单编号")
|
||||
|
@@ -55,8 +55,10 @@ public class AppTradeOrderDetailRespVO {
|
||||
@Schema(description = "付款超时时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime payExpireTime;
|
||||
|
||||
@Schema(description = "支付渠道", requiredMode = Schema.RequiredMode.REQUIRED, example = "wx_lite_pay")
|
||||
@Schema(description = "支付渠道", example = "wx_lite_pay")
|
||||
private String payChannelCode;
|
||||
@Schema(description = "支付渠道名", example = "微信小程序支付")
|
||||
private String payChannelName;
|
||||
|
||||
@Schema(description = "商品原价(总)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1000")
|
||||
private Integer totalPrice;
|
||||
@@ -102,6 +104,9 @@ public class AppTradeOrderDetailRespVO {
|
||||
@Schema(description = "收件人详细地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "中关村大街 1 号")
|
||||
private String receiverDetailAddress;
|
||||
|
||||
@Schema(description = "自提门店编号", example = "1088")
|
||||
private Long pickUpStoreId;
|
||||
|
||||
// ========== 售后基本信息 ==========
|
||||
|
||||
// ========== 营销基本信息 ==========
|
||||
|
@@ -44,7 +44,7 @@ public class AppTradeOrderSettlementReqVO {
|
||||
private Long addressId;
|
||||
|
||||
@Schema(description = "自提门店编号", example = "1088")
|
||||
private Long pickupStoreId;
|
||||
private Long pickUpStoreId;
|
||||
@Schema(description = "收件人名称", example = "芋艿") // 选择门店自提时,该字段为联系人名
|
||||
private String receiverName;
|
||||
@Schema(description = "收件人手机", example = "15601691300") // 选择门店自提时,该字段为联系人手机
|
||||
|
@@ -1,12 +1,15 @@
|
||||
package cn.iocoder.yudao.module.trade.convert.order;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||
import cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils;
|
||||
import cn.iocoder.yudao.framework.ip.core.utils.AreaUtils;
|
||||
import cn.iocoder.yudao.module.member.api.address.dto.AddressRespDTO;
|
||||
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
|
||||
import cn.iocoder.yudao.module.pay.api.order.dto.PayOrderCreateReqDTO;
|
||||
import cn.iocoder.yudao.module.pay.enums.DictTypeConstants;
|
||||
import cn.iocoder.yudao.module.product.api.comment.dto.ProductCommentCreateReqDTO;
|
||||
import cn.iocoder.yudao.module.product.api.property.dto.ProductPropertyValueDetailRespDTO;
|
||||
import cn.iocoder.yudao.module.product.api.sku.dto.ProductSkuUpdateStockReqDTO;
|
||||
@@ -234,6 +237,9 @@ public interface TradeOrderConvert {
|
||||
List<ProductPropertyValueDetailRespDTO> propertyValueDetails, TradeOrderProperties tradeOrderProperties) {
|
||||
AppTradeOrderDetailRespVO orderVO = convert3(order, orderItems);
|
||||
orderVO.setPayExpireTime(addTime(tradeOrderProperties.getExpireTime()));
|
||||
if (StrUtil.isNotEmpty(order.getPayChannelCode())) {
|
||||
orderVO.setPayChannelName(DictFrameworkUtils.getDictDataLabel(DictTypeConstants.CHANNEL_CODE_TYPE, order.getPayChannelCode()));
|
||||
}
|
||||
// 处理商品属性
|
||||
Map<Long, ProductPropertyValueDetailRespDTO> propertyValueDetailMap = convertMap(propertyValueDetails, ProductPropertyValueDetailRespDTO::getValueId);
|
||||
for (int i = 0; i < orderItems.size(); i++) {
|
||||
|
@@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.trade.dal.dataobject.order;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.enums.TerminalEnum;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.module.trade.dal.dataobject.delivery.DeliveryPickUpStoreDO;
|
||||
import cn.iocoder.yudao.module.trade.enums.delivery.DeliveryTypeEnum;
|
||||
import cn.iocoder.yudao.module.trade.enums.order.*;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
@@ -171,13 +172,6 @@ public class TradeOrderDO extends BaseDO {
|
||||
* 枚举 {@link DeliveryTypeEnum}
|
||||
*/
|
||||
private Integer deliveryType;
|
||||
/**
|
||||
* 配置模板的编号
|
||||
*
|
||||
* 关联 DeliveryTemplateDO 的 id 编号
|
||||
*/
|
||||
// TODO 芋艿:需要删除
|
||||
private Long deliveryTemplateId;
|
||||
/**
|
||||
* 发货物流公司编号
|
||||
*/
|
||||
@@ -197,7 +191,6 @@ public class TradeOrderDO extends BaseDO {
|
||||
*/
|
||||
private LocalDateTime deliveryTime;
|
||||
|
||||
// TODO @芋艿:pickUpStoreId;
|
||||
/**
|
||||
* 收货时间
|
||||
*/
|
||||
@@ -219,6 +212,13 @@ public class TradeOrderDO extends BaseDO {
|
||||
*/
|
||||
private String receiverDetailAddress;
|
||||
|
||||
/**
|
||||
* 自提门店编号
|
||||
*
|
||||
* 关联 {@link DeliveryPickUpStoreDO#getId()}
|
||||
*/
|
||||
private Long pickUpStoreId;
|
||||
|
||||
// ========== 售后基本信息 ==========
|
||||
/**
|
||||
* 售后状态
|
||||
|
@@ -115,7 +115,6 @@ public class TradeOrderServiceTest extends BaseDbUnitTest {
|
||||
when(productSpuApi.getSpuList(eq(asSet(11L, 21L)))).thenReturn(Arrays.asList(spu01, spu02));
|
||||
// mock 方法(用户收件地址的校验)
|
||||
AddressRespDTO addressRespDTO = new AddressRespDTO().setId(10L).setUserId(userId).setName("芋艿")
|
||||
//.setMobile("15601691300").setAreaId(3306).setPostCode("85757").setDetailAddress("土豆村");
|
||||
.setMobile("15601691300").setAreaId(3306).setDetailAddress("土豆村");
|
||||
when(addressApi.getAddress(eq(10L), eq(userId))).thenReturn(addressRespDTO);
|
||||
// mock 方法(价格计算)
|
||||
@@ -177,7 +176,6 @@ public class TradeOrderServiceTest extends BaseDbUnitTest {
|
||||
assertEquals(tradeOrderDO.getPayPrice(), 80);
|
||||
assertEquals(tradeOrderDO.getPayOrderId(), 1000L);
|
||||
assertNull(tradeOrderDO.getPayChannelCode());
|
||||
assertNull(tradeOrderDO.getDeliveryTemplateId());
|
||||
assertNull(tradeOrderDO.getLogisticsId());
|
||||
assertEquals(tradeOrderDO.getDeliveryStatus(), TradeOrderDeliveryStatusEnum.UNDELIVERED.getStatus());
|
||||
assertNull(tradeOrderDO.getDeliveryTime());
|
||||
|
Reference in New Issue
Block a user