Commit 0374dd492b99d587c7ab1dcd5a3a909483425972

Authored by Jiang
1 parent 5f11717c

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

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