Commit 0374dd492b99d587c7ab1dcd5a3a909483425972

Authored by Jiang
1 parent 5f11717c

更新订单sdk依赖,订单项商品数量支持单位为斤的时候填写小数

mobsite-getway-domain/pom.xml
... ... @@ -66,7 +66,7 @@
66 66 <dependency>
67 67 <groupId>com.b2c.orders</groupId>
68 68 <artifactId>b2c-orders-client</artifactId>
69   - <version>0.0.2-SNAPSHOT</version>
  69 + <version>0.0.4-SNAPSHOT</version>
70 70 <scope>provided</scope>
71 71 </dependency>
72 72  
... ...
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/Order.java
1 1 package com.diligrp.mobsite.getway.domain.protocol;
2 2  
3 3 import java.io.Serializable;
  4 +import java.math.BigDecimal;
4 5  
5 6 /**
6 7 * <B>Description</B> 订单 <br />
... ... @@ -45,7 +46,7 @@ public class Order implements Serializable {
45 46 /** 支付类型 */
46 47 private Integer payType;
47 48 /** 总金额 */
48   - private Long totalPrice;
  49 + private BigDecimal totalPrice;
49 50 /**
50 51 * 接单后修改的价格
51 52 */
... ... @@ -139,11 +140,11 @@ public class Order implements Serializable {
139 140 this.payType = payType;
140 141 }
141 142  
142   - public Long getTotalPrice() {
  143 + public BigDecimal getTotalPrice() {
143 144 return totalPrice;
144 145 }
145 146  
146   - public void setTotalPrice(Long totalPrice) {
  147 + public void setTotalPrice(BigDecimal totalPrice) {
147 148 this.totalPrice = totalPrice;
148 149 }
149 150  
... ...
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/OrderItem.java
1 1 package com.diligrp.mobsite.getway.domain.protocol;
2 2  
  3 +import java.math.BigDecimal;
  4 +
3 5 import javax.validation.constraints.NotNull;
4 6  
  7 +import io.swagger.annotations.ApiModelProperty;
5 8 import io.swagger.annotations.ApiParam;
6 9  
7 10 /**
... ... @@ -21,7 +24,9 @@ public class OrderItem {
21 24 private String sku;
22 25 @ApiParam("购买数量")
23 26 @NotNull(message = "购买数量不能为空")
24   - private Integer amount;
  27 + private BigDecimal amount;
  28 + @ApiModelProperty("sku价格")
  29 + private Long skuPrice;
25 30  
26 31 public String getSku() {
27 32 return sku;
... ... @@ -31,11 +36,20 @@ public class OrderItem {
31 36 this.sku = sku;
32 37 }
33 38  
34   - public Integer getAmount() {
  39 + public BigDecimal getAmount() {
35 40 return amount;
36 41 }
37 42  
38   - public void setAmount(Integer amount) {
  43 + public void setAmount(BigDecimal amount) {
39 44 this.amount = amount;
40 45 }
  46 +
  47 + public Long getSkuPrice() {
  48 + return skuPrice;
  49 + }
  50 +
  51 + public void setSkuPrice(Long skuPrice) {
  52 + this.skuPrice = skuPrice;
  53 + }
  54 +
41 55 }
... ...
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/cart/ModifyAmountReq.java
1 1 package com.diligrp.mobsite.getway.domain.protocol.cart;
2 2  
  3 +import java.math.BigDecimal;
  4 +
3 5 import com.diligrp.mobsite.getway.domain.protocol.BaseReq;
4 6 import io.swagger.annotations.ApiModelProperty;
5 7  
... ... @@ -25,7 +27,7 @@ public class ModifyAmountReq extends BaseReq {
25 27 * 数量
26 28 */
27 29 @ApiModelProperty(value = "数量",required = true)
28   - private Integer amount;
  30 + private BigDecimal amount;
29 31  
30 32  
31 33 /**
... ... @@ -34,7 +36,7 @@ public class ModifyAmountReq extends BaseReq {
34 36 * @createTime 2014年10月28日 下午6:33:55
35 37 * @author zhangshirui
36 38 */
37   - public Integer getAmount() {
  39 + public BigDecimal getAmount() {
38 40 return amount;
39 41 }
40 42  
... ... @@ -45,7 +47,7 @@ public class ModifyAmountReq extends BaseReq {
45 47 * @createTime 2014年10月28日 下午6:33:55
46 48 * @author zhangshirui
47 49 */
48   - public void setAmount(Integer amount) {
  50 + public void setAmount(BigDecimal amount) {
49 51 this.amount = amount;
50 52 }
51 53  
... ...
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/impl/ShoppingCartRPCImpl.java
... ... @@ -115,7 +115,7 @@ public class ShoppingCartRPCImpl implements ShoppingCartRPC {
115 115 @Override
116 116 public ModifyAmountResp modifyAmount(ModifyAmountReq req) {
117 117 ShoppingCartUpdateInput input = new ShoppingCartUpdateInput();
118   - input.setQuantity(req.getAmount().longValue());
  118 + input.setQuantity(req.getAmount());
119 119 input.setShopBuyerId(req.getUserId());
120 120 input.setSku(req.getSku());
121 121 BaseOutput<Boolean> response = this.cartService.modifyCart(input);
... ... @@ -134,7 +134,6 @@ public class ShoppingCartRPCImpl implements ShoppingCartRPC {
134 134  
135 135 @Override
136 136 public ConfirmCartResp confirmCartInfo(ConfirmCartReq req) {
137   - GetCartByUserReq cartReq = new GetCartByUserReq();
138 137 ShoppingCartListInput input = new ShoppingCartListInput();
139 138 input.setShopBuyerId(req.getShopBuyerId());
140 139 input.setSkus(req.getSkus().toArray(new String[req.getSkus().size()]));
... ...
... ... @@ -356,7 +356,7 @@
356 356 <dependency>
357 357 <groupId>com.b2c.orders</groupId>
358 358 <artifactId>b2c-orders-client</artifactId>
359   - <version>0.0.3-SNAPSHOT</version>
  359 + <version>0.0.4-SNAPSHOT</version>
360 360 </dependency>
361 361  
362 362 <!--商品库sdk-->
... ...