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

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

测试订单 修改 sku价格,取消订单,修改收货地址,修改快递价格

parent b10c44bf
...@@ -104,8 +104,21 @@ public class GoblinStoreOrderVo implements Serializable, Cloneable { ...@@ -104,8 +104,21 @@ public class GoblinStoreOrderVo implements Serializable, Cloneable {
@ApiModelProperty(value = "orderSkuId") @ApiModelProperty(value = "orderSkuId")
private List<String> orderSkuVoIds; private List<String> orderSkuVoIds;
private static final GoblinStoreOrderVo obj = new GoblinStoreOrderVo(); public BigDecimal getPriceModify() {
if(priceModify==null){
return BigDecimal.ZERO;
}
return priceModify;
}
public BigDecimal getPriceVoucher() {
if(priceVoucher==null){
return BigDecimal.ZERO;
}
return priceVoucher;
}
private static final GoblinStoreOrderVo obj = new GoblinStoreOrderVo();
public static GoblinStoreOrderVo getNew() { public static GoblinStoreOrderVo getNew() {
try { try {
return (GoblinStoreOrderVo) obj.clone(); return (GoblinStoreOrderVo) obj.clone();
......
...@@ -338,10 +338,8 @@ public class KylinDamaiServiceImpl extends ServiceImpl<KylinRoadShowsMapper, Kyl ...@@ -338,10 +338,8 @@ public class KylinDamaiServiceImpl extends ServiceImpl<KylinRoadShowsMapper, Kyl
} }
public static void main(String[] args) { public static void main(String[] args) {
Long a=IDGenerator.getDamaiCode("385930697698099233332997"); Long a=IDGenerator.getDamaiCode("665200880499752964622815");
Long b=IDGenerator.getDamaiCode("385931515691868195803932");
System.out.println(a); System.out.println(a);
System.out.println(b);
} }
} }
...@@ -77,7 +77,7 @@ public class GoblinStoreOrderController { ...@@ -77,7 +77,7 @@ public class GoblinStoreOrderController {
}) })
@GetMapping(value = "change/expressPrice") @GetMapping(value = "change/expressPrice")
public ResponseDto<Boolean> changeExpressPrice(@RequestParam(value = "orderId", required = true) @Valid String orderId, public ResponseDto<Boolean> changeExpressPrice(@RequestParam(value = "orderId", required = true) @Valid String orderId,
@RequestParam(value = "orderId", required = true) @Valid BigDecimal price) { @RequestParam(value = "price", required = true) @Valid BigDecimal price) {
return goblinStoreOrderService.changeExpressPrice(orderId, price); return goblinStoreOrderService.changeExpressPrice(orderId, price);
} }
...@@ -85,12 +85,12 @@ public class GoblinStoreOrderController { ...@@ -85,12 +85,12 @@ public class GoblinStoreOrderController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "orderId", value = "订单id"), @ApiImplicitParam(type = "form", required = false, dataType = "String", name = "orderId", value = "订单id"),
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "orderSkuId", value = "orderSkuId"), @ApiImplicitParam(type = "form", required = false, dataType = "String", name = "orderSkuId", value = "orderSkuId"),
@ApiImplicitParam(type = "form", required = false, dataType = "BigDecimal", name = "price", value = "退款金额"), @ApiImplicitParam(type = "form", required = false, dataType = "BigDecimal", name = "price", value = "修改金额"),
}) })
@GetMapping(value = "change/skuPrice") @GetMapping(value = "change/skuPrice")
public ResponseDto<Boolean> changeSkuPrice(@RequestParam(value = "orderId", required = true) @Valid String orderId, public ResponseDto<Boolean> changeSkuPrice(@RequestParam(value = "orderId", required = true) @Valid String orderId,
@RequestParam(value = "orderSkuId", required = true) @Valid String orderSkuId, @RequestParam(value = "orderSkuId", required = true) @Valid String orderSkuId,
@RequestParam(value = "orderId", required = true) @Valid BigDecimal price) { @RequestParam(value = "price", required = true) @Valid BigDecimal price) {
return goblinStoreOrderService.changeSkuPrice(orderId, orderSkuId, price); return goblinStoreOrderService.changeSkuPrice(orderId, orderSkuId, price);
} }
......
...@@ -222,8 +222,8 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -222,8 +222,8 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
} }
} }
//获得活动优惠价格 //获得活动优惠价格
priceBase = priceBase.multiply(BigDecimal.valueOf(skuParam.getNumber())); priceBase = priceBase.subtract(BigDecimal.valueOf(skuParam.getNumber()));
price = price.multiply(BigDecimal.valueOf(skuParam.getNumber())); price = price.subtract(BigDecimal.valueOf(skuParam.getNumber()));
voucherMarket = voucherMarket.add(priceBase.subtract(price)); voucherMarket = voucherMarket.add(priceBase.subtract(price));
storeTotalPrice = storeTotalPrice.add(price); storeTotalPrice = storeTotalPrice.add(price);
//订单sku //订单sku
...@@ -266,7 +266,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -266,7 +266,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
storeOrder.setUserName(StringUtils.defaultString(((String) token.get("nickname")), "")); storeOrder.setUserName(StringUtils.defaultString(((String) token.get("nickname")), ""));
storeOrder.setUserMobile(StringUtils.defaultString(((String) token.get("mobile")), "")); storeOrder.setUserMobile(StringUtils.defaultString(((String) token.get("mobile")), ""));
storeOrder.setPriceTotal(storeTotalPrice); storeOrder.setPriceTotal(storeTotalPrice);
storeOrder.setPriceActual(storeOrder.getPriceTotal().subtract(voucherMarket).subtract(voucherPrice)); storeOrder.setPriceActual(storeOrder.getPriceTotal().add(storeOrder.getPriceExpress()).subtract(voucherMarket).subtract(voucherPrice));
storeOrder.setPriceRefund(BigDecimal.ZERO); storeOrder.setPriceRefund(BigDecimal.ZERO);
storeOrder.setPriceExpress(BigDecimal.TEN);//todo 快递费 暂时写死 storeOrder.setPriceExpress(BigDecimal.TEN);//todo 快递费 暂时写死
storeOrder.setPriceCoupon(voucherPrice); storeOrder.setPriceCoupon(voucherPrice);
......
...@@ -188,9 +188,11 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService { ...@@ -188,9 +188,11 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
if (orderVo.getStatus() == GoblinStatusConst.Status.ORDER_STATUS_3.getValue()) { if (orderVo.getStatus() == GoblinStatusConst.Status.ORDER_STATUS_3.getValue()) {
return ResponseDto.failure("已发货"); return ResponseDto.failure("已发货");
} }
orderVo.setPriceModify(orderVo.getPriceModify().add(price)); BigDecimal voucherExpress = orderVo.getPriceExpress().subtract(price);
orderVo.setPriceVoucher(orderVo.getPriceVoucher().add(price)); orderVo.setPriceTotal(orderVo.getPriceModify().add(voucherExpress));
orderVo.setPriceActual(orderVo.getPriceActual().multiply(price)); orderVo.setPriceModify(orderVo.getPriceModify().add(voucherExpress));
orderVo.setPriceVoucher(orderVo.getPriceVoucher().add(voucherExpress));
orderVo.setPriceActual(orderVo.getPriceActual().add(voucherExpress));
orderVo.setPriceExpress(price); orderVo.setPriceExpress(price);
GoblinOrderOperationLog log = initLog(orderId, uid, now); GoblinOrderOperationLog log = initLog(orderId, uid, now);
log.setType(GoblinStatusConst.Status.ORDER_LOG_STATUS_17.getValue()); log.setType(GoblinStatusConst.Status.ORDER_LOG_STATUS_17.getValue());
...@@ -203,7 +205,7 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService { ...@@ -203,7 +205,7 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
queueUtils.sendMsgByRedis( queueUtils.sendMsgByRedis(
MQConst.GoblinQueue.GOBLIN_STORE_ORDER_OPERA.getKey(), MQConst.GoblinQueue.GOBLIN_STORE_ORDER_OPERA.getKey(),
SqlMapping.get("goblin_order.store.orderExpressPrice", SqlMapping.get("goblin_order.store.orderExpressPrice",
orderVo.getPriceModify(), orderVo.getPriceVoucher(), orderVo.getPriceActual(), orderVo.getPriceExpress(), now, orderVo.getPriceTotal(),orderVo.getPriceModify(), orderVo.getPriceVoucher(), orderVo.getPriceActual(), orderVo.getPriceExpress(), now,
orderId, now, now orderId, now, now
) )
); );
...@@ -278,12 +280,14 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService { ...@@ -278,12 +280,14 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
if (orderSkuVo == null) { if (orderSkuVo == null) {
return ResponseDto.failure("不存在"); return ResponseDto.failure("不存在");
} }
BigDecimal voucherPrice = orderSkuVo.getSkuPriceActual().subtract(price);
orderSkuVo.setPriceModify(price); orderSkuVo.setPriceModify(price);
orderSkuVo.setPriceVoucher(orderSkuVo.getPriceVoucher().add(price)); orderSkuVo.setPriceVoucher(orderSkuVo.getPriceVoucher().add(voucherPrice));
orderSkuVo.setSkuPriceActual(orderSkuVo.getSkuPriceActual().multiply(price)); orderSkuVo.setSkuPriceActual(orderSkuVo.getSkuPriceActual().subtract(voucherPrice));
orderVo.setPriceModify(orderVo.getPriceModify().add(price)); orderVo.setPriceTotal(orderVo.getPriceTotal().subtract(voucherPrice));
orderVo.setPriceVoucher(orderVo.getPriceVoucher().add(price)); orderVo.setPriceModify(orderVo.getPriceModify().add(voucherPrice));
orderVo.setPriceActual(orderVo.getPriceActual().multiply(price)); orderVo.setPriceVoucher(orderVo.getPriceVoucher().add(voucherPrice));
orderVo.setPriceActual(orderVo.getPriceActual().subtract(voucherPrice));
GoblinOrderOperationLog log = initLog(orderId, uid, now); GoblinOrderOperationLog log = initLog(orderId, uid, now);
log.setType(GoblinStatusConst.Status.ORDER_LOG_STATUS_12.getValue()); log.setType(GoblinStatusConst.Status.ORDER_LOG_STATUS_12.getValue());
log.setRemark("orderSkuId=[" + orderSkuId + "],price=[" + price + "]"); log.setRemark("orderSkuId=[" + orderSkuId + "],price=[" + price + "]");
......
...@@ -448,7 +448,7 @@ public class GoblinMongoUtils { ...@@ -448,7 +448,7 @@ public class GoblinMongoUtils {
public UpdateResult updateGoblinOrderSkuVo(String orderSkuId, GoblinOrderSkuVo data) { public UpdateResult updateGoblinOrderSkuVo(String orderSkuId, GoblinOrderSkuVo data) {
BasicDBObject object = ObjectUtil.cloneBasicDBObject().append("$set", mongoConverter.convertToMongoType(data)); BasicDBObject object = ObjectUtil.cloneBasicDBObject().append("$set", mongoConverter.convertToMongoType(data));
return mongoTemplate.getCollection(GoblinStoreMarketVo.class.getSimpleName()).updateOne( return mongoTemplate.getCollection(GoblinOrderSkuVo.class.getSimpleName()).updateOne(
Query.query(Criteria.where("orderSkuId").is(orderSkuId)).getQueryObject(), Query.query(Criteria.where("orderSkuId").is(orderSkuId)).getQueryObject(),
object); object);
} }
......
...@@ -6,7 +6,7 @@ liquidnet: ...@@ -6,7 +6,7 @@ liquidnet:
username: user username: user
password: user123 password: user123
eureka: eureka:
host: 39.107.71.112:7001 host: 127.0.0.1:7001
# end-dev-这里是配置信息基本值 # end-dev-这里是配置信息基本值
spring: spring:
......
...@@ -58,7 +58,7 @@ goblin_order.store.orderPrice=UPDATE goblin_store_order SET price_modify = ? ,pr ...@@ -58,7 +58,7 @@ goblin_order.store.orderPrice=UPDATE goblin_store_order SET price_modify = ? ,pr
goblin_order.store.orderSkuPrice=UPDATE goblin_order_sku SET price_modify = ? ,price_voucher = ? , sku_price_actual = ? , updated_at = ? WHERE order_sku_id = ? and (updated_at <= ? or created_at = ? or updated_at is null) goblin_order.store.orderSkuPrice=UPDATE goblin_order_sku SET price_modify = ? ,price_voucher = ? , sku_price_actual = ? , updated_at = ? WHERE order_sku_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
goblin_order.store.log = INSERT INTO goblin_order_operation_log (`order_log_id`,`order_id`,`type`,`remark`,`operation_name`,`created_at`) VALUES(?,?,?,?,?,?) goblin_order.store.log = INSERT INTO goblin_order_operation_log (`order_log_id`,`order_id`,`type`,`remark`,`operation_name`,`created_at`) VALUES(?,?,?,?,?,?)
goblin_order.store.refundLog = INSERT INTO goblin_back_order_log (`back_order_log_id`,`back_order_id`,`operation_type`,`message`,`operation_name`,`status`,`created_at`) VALUES(?,?,?,?,?,?,?) goblin_order.store.refundLog = INSERT INTO goblin_back_order_log (`back_order_log_id`,`back_order_id`,`operation_type`,`message`,`operation_name`,`status`,`created_at`) VALUES(?,?,?,?,?,?,?)
goblin_order.store.orderExpressPrice=UPDATE goblin_store_order SET price_modify = ? ,price_voucher = ? , price_actual = ? ,price_express = ? , updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null) goblin_order.store.orderExpressPrice=UPDATE goblin_store_order SET price_total =? , price_modify = ? ,price_voucher = ? , price_actual = ? ,price_express = ? , updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
goblin_order.store.backOrder=INSERT INTO goblin_back_order (`back_order_id`,`back_code`,`order_id`,`order_code`,`store_id`,`user_id`,`sku_id_nums`,`type`,`reason`,`describes`,`real_back_price`,`status`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,) goblin_order.store.backOrder=INSERT INTO goblin_back_order (`back_order_id`,`back_code`,`order_id`,`order_code`,`store_id`,`user_id`,`sku_id_nums`,`type`,`reason`,`describes`,`real_back_price`,`status`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,)
goblin_order.store.refundPrice=UPDATE goblin_store_order SET price_refund = ? ,status = ? , updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null) goblin_order.store.refundPrice=UPDATE goblin_store_order SET price_refund = ? ,status = ? , updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
goblin_order.store.refundSkuPrice=UPDATE goblin_order_sku SET price_refund = ? ,status = ? , updated_at = ? WHERE order_sku_id = ? and (updated_at <= ? or created_at = ? or updated_at is null) goblin_order.store.refundSkuPrice=UPDATE goblin_order_sku SET price_refund = ? ,status = ? , updated_at = ? WHERE order_sku_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
......
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