Commit e5c7911d by lijinqi

流程:创建订单+提交订单生成微信二维码

sku新增费用描述、有效期、鉴权信息字段
parent edcce9cb
......@@ -27,6 +27,17 @@ public class ProductSkuRespVO {
@Schema(description = "图片地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn/xx.png")
private String picUrl;
@Schema(description = "费用描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "元/年")
private String feeInfo;
@Schema(description = "", requiredMode = Schema.RequiredMode.REQUIRED, example = "365")
private Integer expDuration;
@Schema(description = "库存", requiredMode = Schema.RequiredMode.REQUIRED, example = "365")
private Integer stock;
@Schema(description = "属性数组")
private List<ProductSkuSaveReqVO.Property> properties;
......
......@@ -82,10 +82,10 @@ public class ProductSpuRespVO {
@Schema(description = "成本价,单位使用:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "19")
@ExcelProperty(value = "成本价", converter = MoneyConvert.class)
private Integer costPrice;
/*
@Schema(description = "商品库存", requiredMode = Schema.RequiredMode.REQUIRED, example = "10000")
@ExcelProperty("库存")
private Integer stock;
private Integer stock;*/
@Schema(description = "SKU 数组")
private List<ProductSkuRespVO> skus;
......
......@@ -60,7 +60,7 @@ public class ProductSpuSaveReqVO {
// ========== 物流相关字段 =========
@Schema(description = "配送方式数组", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotEmpty(message = "配送方式不能为空")
//@NotEmpty(message = "配送方式不能为空")
private List<Integer> deliveryTypes;
@Schema(description = "物流配置模板编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "111")
......
......@@ -61,6 +61,7 @@ public class AppCategoryController {
@GetMapping("/list-computility")
@Operation(summary = "获取计算资源分类列表")
@PermitAll
public CommonResult<List<AppCategoryRespVO>> getComputilityCategoryList() {
Long parentId = Long.parseLong(configApi.getConfigValueByKey(COMPUTILITY_CATEGORY));
List<ProductCategoryDO> list = categoryService.getProductCategoryListByParentId(parentId);
......
......@@ -95,6 +95,22 @@ public class ProductSkuDO extends BaseDO {
private Integer salesCount;
/**
* 费用描述 如 元/年、/卡时
*/
private String feeInfo;
/**
* 有效时长 单位:天
*/
private Integer expDuration;
/**
* 鉴权信息
*/
private String auth;
/**
* 商品属性
*/
@Data
......
......@@ -5,6 +5,7 @@ import com.luhu.computility.framework.common.pojo.CommonResult;
import com.luhu.computility.framework.common.pojo.PageResult;
import com.luhu.computility.module.member.api.user.MemberUserApi;
import com.luhu.computility.module.member.api.user.dto.MemberUserRespDTO;
import com.luhu.computility.module.pay.api.notify.dto.PayOrderNotifyReqDTO;
import com.luhu.computility.module.trade.controller.admin.order.vo.*;
import com.luhu.computility.module.trade.convert.order.TradeOrderConvert;
import com.luhu.computility.module.trade.dal.dataobject.order.TradeOrderDO;
......@@ -22,6 +23,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.annotation.security.PermitAll;
import java.util.List;
import java.util.Map;
import java.util.Objects;
......@@ -166,4 +168,16 @@ public class TradeOrderController {
return success(TradeOrderConvert.INSTANCE.convert2(tradeOrder, null));
}
/**
* 内部支付任务回调
*/
@PostMapping("/update-paid")
@PermitAll
public CommonResult<Boolean> updateOrderPaid(@RequestBody PayOrderNotifyReqDTO notifyReqDTO) {
tradeOrderUpdateService.updateOrderPaid(Long.valueOf(notifyReqDTO.getMerchantOrderId()),
notifyReqDTO.getPayOrderId());
log.error("内部支付任务回调 ");
return success(true);
}
}
......@@ -13,7 +13,7 @@ public class AppTradeOrderCreateReqVO extends AppTradeOrderSettlementReqVO {
@Schema(description = "备注", example = "这个是我的订单哟")
private String remark;
@AssertTrue(message = "配送方式不能为空")
//@AssertTrue(message = "配送方式不能为空")
@JsonIgnore
public boolean isDeliveryTypeNotNull() {
return getDeliveryType() != null;
......
......@@ -28,7 +28,7 @@ public class AppTradeOrderSettlementReqVO {
private Long couponId;
@Schema(description = "是否使用积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
@NotNull(message = "是否使用积分不能为空")
//@NotNull(message = "是否使用积分不能为空")
private Boolean pointStatus;
// ========== 配送相关相关字段 ==========
......
......@@ -4,6 +4,7 @@ import com.luhu.computility.module.trade.controller.app.base.property.AppProduct
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.List;
@Schema(description = "用户 App - 订单交易项 Response VO")
......@@ -48,7 +49,6 @@ public class AppTradeOrderItemRespVO {
// ========== 营销基本信息 ==========
// TODO 芋艿:在捉摸一下
// ========== 售后基本信息 ==========
......@@ -58,4 +58,8 @@ public class AppTradeOrderItemRespVO {
@Schema(description = "售后状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer afterSaleStatus;
@Schema(description = "到期时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
private LocalDateTime expTime;
}
package com.luhu.computility.module.trade.dal.dataobject.order;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.luhu.computility.framework.mybatis.core.dataobject.BaseDO;
import com.luhu.computility.module.trade.dal.dataobject.aftersale.AfterSaleDO;
import com.luhu.computility.module.trade.dal.dataobject.cart.CartDO;
......@@ -13,6 +14,7 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
/**
......@@ -131,6 +133,12 @@ public class TradeOrderItemDO extends BaseDO {
*/
private Integer payPrice;
/**
* 有效时间
*/
@TableField(fill = FieldFill.INSERT)
private LocalDateTime expTime;
// ========== 营销基本信息 ==========
/**
......
......@@ -33,7 +33,7 @@ public class TradePriceCalculateReqBO {
/**
* 是否使用积分
*/
@NotNull(message = "是否使用积分不能为空")
//@NotNull(message = "是否使用积分不能为空")
private Boolean pointStatus;
/**
......
......@@ -248,12 +248,15 @@ public class PayNotifyServiceImpl implements PayNotifyService {
// 拼接 header 参数
Map<String, String> headers = new HashMap<>();
TenantUtils.addTenantHeader(headers, task.getTenantId());
log.error("请求参数--------------------------------------------" + JsonUtils.toJsonString(request));
// 发起请求
log.error("发起请求--------------------------------------------");
try (HttpResponse response = HttpUtil.createPost(task.getNotifyUrl())
.body(JsonUtils.toJsonString(request)).addHeaders(headers)
.timeout((int) NOTIFY_TIMEOUT_MILLIS).execute()) {
// 解析结果
log.error("解析结果--------------------------------------------" +response.body());
return JsonUtils.parseObject(response.body(), CommonResult.class);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment