记得上下班打卡 | git大法好,push需谨慎

Commit f69d27f6 authored by 胡佳晨's avatar 胡佳晨

提交下单接口(待测试)

parent 293994bc
......@@ -31,6 +31,6 @@ public class GoblinOrderParam {
private String returnUrl;
@ApiModelProperty(value = "商品相关参数集合")
private List<GoblinOrderSpuParam> goblinOrderSpuParamList;
private List<GoblinOrderStoreParam> goblinOrderStoreParamList;
}
......@@ -11,7 +11,9 @@ import java.util.ArrayList;
@Data
public class GoblinOrderSkuParam {
@ApiModelProperty(required = true, value = "skuId")
private String skuIds;
private String skuId;
@ApiModelProperty(required = true, value = "spuId")
private String spuId;
@ApiModelProperty(required = true, value = "数量")
private Integer number;
}
......@@ -10,10 +10,10 @@ import java.util.ArrayList;
@ApiModel(value = "GoblinOrderParam")
@Data
public class GoblinOrderSpuParam {
public class GoblinOrderStoreParam {
@ApiModelProperty(required = true, value = "spuId")
private String spuId;
@ApiModelProperty(value = "商铺id")
private String storeId;
@ApiModelProperty(value = "平台券码")
private String platVoucherCode;
@ApiModelProperty(value = "商品券码")
......
package com.liquidnet.service.goblin.dto.manage.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class SyncOrderParam implements Cloneable {
@ApiModelProperty(value = "status")
private Integer status;
@ApiModelProperty(value = "type")
private String type;
@ApiModelProperty(value = "code")
private String code;
@ApiModelProperty(value = "paymentId")
private String paymentId;
@ApiModelProperty(value = "orderCode")
private String orderCode;
@ApiModelProperty(value = "price")
private BigDecimal price;
@ApiModelProperty(value = "paymentType")
private String paymentType;
@ApiModelProperty(value = "paymentAt")
private String paymentAt;
private static final SyncOrderParam obj = new SyncOrderParam();
public static SyncOrderParam getNew() {
try {
return (SyncOrderParam) obj.clone();
} catch (CloneNotSupportedException e) {
return new SyncOrderParam();
}
}
}
......@@ -68,6 +68,10 @@ public class IDGenerator {
return ticketOrderCode(orderId);
}
public static String getWriteOffCode(){
return "";
}
/**
* 根据订单id生成总订单号
*
......
......@@ -90,6 +90,7 @@ liquidnet:
pay: http://devdragon.zhengzai.tv/dragon/pay/dragonPay
check: http://devdragon.zhengzai.tv/dragon/pay/checkOrder
localUrl: http://devorder.zhengzai.tv/order/order/syncOrder
goblinUrl: http://devorder.zhengzai.tv/order/goblin/syncOrder
candy:
url: http://devcandy.zhengzai.tv/candy
goblin:
......
......@@ -17,7 +17,7 @@ import lombok.EqualsAndHashCode;
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class GoblinOrderAttr implements Serializable {
public class GoblinOrderAttr implements Serializable,Cloneable {
private static final long serialVersionUID = 1L;
......@@ -130,5 +130,13 @@ public class GoblinOrderAttr implements Serializable {
private String comment;
private static final GoblinOrderAttr obj = new GoblinOrderAttr();
public static GoblinOrderAttr getNew() {
try {
return (GoblinOrderAttr) obj.clone();
} catch (CloneNotSupportedException e) {
return new GoblinOrderAttr();
}
}
}
......@@ -18,7 +18,7 @@ import lombok.EqualsAndHashCode;
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class GoblinOrderSku implements Serializable {
public class GoblinOrderSku implements Serializable,Cloneable {
private static final long serialVersionUID = 1L;
......@@ -116,5 +116,13 @@ public class GoblinOrderSku implements Serializable {
private String comment;
private static final GoblinOrderSku obj = new GoblinOrderSku();
public static GoblinOrderSku getNew() {
try {
return (GoblinOrderSku) obj.clone();
} catch (CloneNotSupportedException e) {
return new GoblinOrderSku();
}
}
}
......@@ -170,6 +170,11 @@ public class GoblinStoreOrder implements Serializable,Cloneable {
*/
private String version;
/**
* 是否会员
*/
private Integer isMember;
/**
* 订单类型[0-普通订单|1-定金预售订单|2-全款预售订单|3-拼团订单|4-众筹全款|5-众筹1元|6-众筹无回报|7-虚拟商品订单|8-社区团购订单|9-正在下单]
*/
......
package com.liquidnet.service.goblin.controller;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.base.codec.vo.EncryptedReq;
import com.liquidnet.service.goblin.dto.manage.GoblinOrderParam;
import com.liquidnet.service.goblin.dto.manage.vo.GoblinPayInnerResultVo;
import com.liquidnet.service.goblin.dto.vo.GoblinSelfMarketingVo;
import com.liquidnet.service.goblin.service.IGoblinAppOrderService;
import com.liquidnet.service.goblin.service.IGoblinAppZhengzaiService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Slf4j
@Api(tags = "订单相关")
......@@ -16,4 +23,17 @@ public class GoblinAppOrderController {
@Autowired
IGoblinAppOrderService goblinAppOrderService;
@PostMapping("pre")
@ApiOperation("下单")
public ResponseDto<GoblinPayInnerResultVo> getZhengzaiMarketList(@RequestBody EncryptedReq<GoblinOrderParam> param) {
GoblinOrderParam payOrderParam = param.getData();
return goblinAppOrderService.checkOrder(payOrderParam);
}
@PostMapping("fc7bce6d6c2213b866f76493f92224b7")
@ApiOperation("fc7bce6d6c2213b866f76493f92224b7")
public ResponseDto<GoblinPayInnerResultVo> getZhengzaiMarketList(@RequestBody GoblinOrderParam param) {
return goblinAppOrderService.checkOrder(param);
}
}
......@@ -32,7 +32,7 @@ public class GoblinRedisUtils {
public int getSkuStock(String marketPre, String skuId) {
String rk = GoblinRedisConst.REAL_STOCK_SKU;
if (marketPre != null) {
if (marketPre != null && !marketPre.equals("null")) {
rk = rk.concat(marketPre + ":");
}
rk = rk.concat(skuId);
......@@ -46,7 +46,7 @@ public class GoblinRedisUtils {
public int incrSkuStock(String marketPre, String skuId, Integer stock) {
String rk = GoblinRedisConst.REAL_STOCK_SKU;
if (marketPre != null) {
if (marketPre != null && !marketPre.equals("null")) {
rk = rk.concat(marketPre + ":");
}
rk = rk.concat(skuId);
......@@ -55,7 +55,7 @@ public class GoblinRedisUtils {
public int decrSkuStock(String marketPre, String skuId, Integer stock) {
String rk = GoblinRedisConst.REAL_STOCK_SKU;
if (marketPre != null) {
if (marketPre != null && !marketPre.equals("null")) {
rk = rk.concat(marketPre + ":");
}
rk = rk.concat(skuId);
......
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 to comment