Authored by tanling

Merge branch 'master' into dev

# Conflicts:
#	order/src/main/java/com/yohoufo/order/controller/SellerOrderController.java
#	order/src/main/java/com/yohoufo/order/service/SellerOrderService.java
... ... @@ -30,13 +30,12 @@ public enum SellerOrderListType {
Arrays.asList(OrderStatus.DONE.getCode()),
Collections.<Integer>emptyList()),
ORDER_FAILED(6, "交易失败", Arrays.asList(OrderStatus.SELLER_CANCEL_BEFORE_PAY.getCode(),
ORDER_FAILED(6, "交易失败", Arrays.asList(
OrderStatus.SELLER_CANCEL_AFTER_PAY.getCode(),
OrderStatus.SEND_OUT_TIMEOUT.getCode(),
OrderStatus.CHECKING_FAKE.getCode(),
OrderStatus.BUYER_CANCEL_BEFORE_PAY.getCode(),
OrderStatus.BUYER_CANCEL_TIMEOUT.getCode(),
OrderStatus.CUSTOMER_SERVICE.getCode()),
OrderStatus.BUYER_CANCEL_TIMEOUT.getCode()),
Collections.<Integer>emptyList());
int type;
... ...
... ... @@ -7,6 +7,7 @@ import com.yohobuy.ufo.model.order.req.SellerOrderSubmitReq;
import com.yohoufo.common.ApiResponse;
import com.yohoufo.common.exception.GatewayException;
import com.yohoufo.order.response.OrderListInfo;
import com.yohoufo.order.response.OrderListInfoRsp;
import com.yohoufo.order.service.SellerOrderService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -85,7 +86,7 @@ public class SellerOrderController {
.page(page).limit(limit)
.build();
logger.info("in ufo.sellerOrder.getOrderList, req {}", req);
OrderListInfo resp = sellerOrderService.getOrderList(req);
OrderListInfoRsp resp = sellerOrderService.getOrderList(req);
return new ApiResponse.ApiResponseBuilder().data(resp).code(200).message("查询列表成功").build();
}
... ...
... ... @@ -2,10 +2,9 @@ package com.yohoufo.order.controller;
import com.yohoufo.common.ApiResponse;
import com.yohoufo.order.request.OrderListRequest;
import com.yohoufo.order.request.ShoppingRequest;
import com.yohoufo.order.response.OrderSubmitResponse;
import com.yohoufo.order.response.ShoppingPaymentResponse;
import com.yohoufo.order.response.PaymentResponse;
import com.yohoufo.order.service.IShoppingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
... ... @@ -27,7 +26,7 @@ public class ShoppingController {
public ApiResponse payment(@RequestParam(name = "uid") int uid,
@RequestParam(name = "skup") int skup){
ShoppingPaymentResponse paymentResponse = buyerOrderService.payment(ShoppingRequest.builder().uid(uid).skup(skup).build());
PaymentResponse paymentResponse = buyerOrderService.payment(ShoppingRequest.builder().uid(uid).skup(skup).build());
return new ApiResponse.ApiResponseBuilder().code(200).data(paymentResponse).message("结算成功").build();
}
... ...
... ... @@ -16,12 +16,16 @@ public class GoodsInfo {
/**
* 商品图片
*/
String imageUrl;
String goodImg;
String colorName;
int colorId;
String sizeName;
int sizeId;
/**
* 商品价格
*/
... ...
... ... @@ -8,7 +8,7 @@ import java.util.List;
@Data
@ToString
public class ShoppingPaymentResponse {
public class PaymentResponse {
/**
* 支付方式:在线支付
... ... @@ -23,7 +23,7 @@ public class ShoppingPaymentResponse {
/**
* 商品情报
*/
List<Goods> goodsList;
GoodsInfo good;
/**
* 费用列表
... ... @@ -59,25 +59,7 @@ public class ShoppingPaymentResponse {
private int deliveryWayCost;
}
@Data
@ToString
public static class Goods{
// 封面图
private String goodsImg;
private String productName;
private int colorId;
private String color;
private int sizeId;
private String sizeName;
private int buyNumber;
private BigDecimal salePrice;
}
@Data
@ToString
... ...
... ... @@ -3,7 +3,7 @@ package com.yohoufo.order.service;
import com.yohoufo.order.request.ShoppingRequest;
import com.yohoufo.order.response.OrderSubmitResponse;
import com.yohoufo.order.response.ShoppingPaymentResponse;
import com.yohoufo.order.response.PaymentResponse;
public interface IShoppingService {
... ... @@ -12,7 +12,7 @@ public interface IShoppingService {
* @param request
* @return
*/
public ShoppingPaymentResponse payment(ShoppingRequest request);
public PaymentResponse payment(ShoppingRequest request);
/**
... ...
... ... @@ -18,6 +18,7 @@ import com.yohoufo.order.model.SellerOrderContext;
import com.yohoufo.order.model.dto.PlatformFeeDto;
import com.yohoufo.order.model.dto.SellerOrderComputeResult;
import com.yohoufo.order.response.OrderListInfo;
import com.yohoufo.order.response.OrderListInfoRsp;
import com.yohoufo.order.service.handler.SellerOrderComputeHandler;
import com.yohoufo.order.service.handler.SellerOrderSubmitHandler;
import com.yohoufo.order.service.proxy.UserProxyService;
... ... @@ -150,7 +151,7 @@ public class SellerOrderService {
}
public OrderListInfo getOrderList(SellerOrderListReq req){
public OrderListInfoRsp getOrderList(SellerOrderListReq req){
return null;
}
... ...
... ... @@ -147,7 +147,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
goodsInfo.setProductName(sellerOrderGoods.getProductName());
goodsInfo.setColorName(sellerOrderGoods.getColorName());
goodsInfo.setSizeName(sellerOrderGoods.getSizeName());
goodsInfo.setImageUrl(sellerOrderGoods.getImageUrl());
goodsInfo.setGoodImg(sellerOrderGoods.getImageUrl());
goodsInfo.setGoodPrice(sellerOrderGoods.getGoodsPrice().toPlainString());
return goodsInfo;
}
... ... @@ -287,7 +287,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
GoodsInfo goodsInfo = new GoodsInfo();
goodsInfo.setColorName(sellerOrderGoods.getColorName());
goodsInfo.setProductName(sellerOrderGoods.getProductName());
goodsInfo.setImageUrl(sellerOrderGoods.getImageUrl());
goodsInfo.setGoodImg(sellerOrderGoods.getImageUrl());
goodsInfo.setSizeName(sellerOrderGoods.getSizeName());
goodsInfo.setGoodPrice(buyerOrderGoods.getGoodsPrice() == null ? "" :buyerOrderGoods.getGoodsPrice().toPlainString());
... ...
... ... @@ -4,8 +4,8 @@ import com.yoho.core.dal.datasource.annotation.Database;
import com.yohoufo.common.utils.DateUtil;
import com.yohoufo.dal.order.SellerOrderMapper;
import com.yohoufo.dal.order.model.SellerOrder;
import com.yohoufo.order.constants.SellerOrderCancelStatus;
import com.yohoufo.order.common.SellerOrderStatus;
import com.yohoufo.order.constants.SellerOrderCancelStatus;
import com.yohoufo.order.model.SellerOrderContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
... ...
... ... @@ -3,7 +3,6 @@ package com.yohoufo.order.service.impl;
import com.yoho.core.rest.client.ServiceCaller;
import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
import com.yoho.service.model.request.UserAddressReqBO;
import com.yoho.service.model.response.UserAddressRspBO;
import com.yohoufo.common.utils.AddressUtil;
import com.yohoufo.dal.order.SellerOrderGoodsMapper;
... ... @@ -14,7 +13,7 @@ import com.yohoufo.order.constants.OrderConstant;
import com.yohoufo.order.model.dto.OrderBuilder;
import com.yohoufo.order.request.ShoppingRequest;
import com.yohoufo.order.response.OrderSubmitResponse;
import com.yohoufo.order.response.ShoppingPaymentResponse;
import com.yohoufo.order.response.PaymentResponse;
import com.yohoufo.order.service.IOrdeCreationService;
import com.yohoufo.order.service.IShoppingService;
import com.yohoufo.order.service.proxy.UserProxyService;
... ... @@ -26,7 +25,6 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.concurrent.TimeUnit;
import org.springframework.stereotype.Service;
... ... @@ -59,7 +57,7 @@ public class ShoppingServiceImpl implements IShoppingService {
* @param request
* @return
*/
public ShoppingPaymentResponse payment(ShoppingRequest request){
public PaymentResponse payment(ShoppingRequest request){
// 入口参数检查
if (request.getSkup() < 0 || request.getUid() <0){
... ... @@ -70,10 +68,10 @@ public class ShoppingServiceImpl implements IShoppingService {
// 检查 商品sku是否可售
SellerOrderGoods skupGood = checkSkupSellOrNot(request.getSkup());
ShoppingPaymentResponse response = new ShoppingPaymentResponse();
PaymentResponse response = new PaymentResponse();
response.setPaymentWay(shoppingSupport.getPaymentWay());
response.setDeliveryWay(shoppingSupport.getDeliverWay());
response.setGoodsList(Arrays.asList(shoppingSupport.getGoodsInfo(skupGood)));
response.setGood(shoppingSupport.getGoodsInfo(skupGood));
response.setPromotionFormulaList(shoppingSupport.getPromotionFormula(skupGood));
// TODO 赔偿金计算
... ...
... ... @@ -2,7 +2,8 @@ package com.yohoufo.order.service.support;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.order.constants.OrderConstant;
import com.yohoufo.order.response.ShoppingPaymentResponse;
import com.yohoufo.order.response.GoodsInfo;
import com.yohoufo.order.response.PaymentResponse;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
... ... @@ -17,9 +18,9 @@ public class ShoppingSupport {
* 支付方式
* @return
*/
public ShoppingPaymentResponse.PaymentWay getPaymentWay() {
public PaymentResponse.PaymentWay getPaymentWay() {
// 支付方式: 在线支付
ShoppingPaymentResponse.PaymentWay paymentWay = new ShoppingPaymentResponse.PaymentWay();
PaymentResponse.PaymentWay paymentWay = new PaymentResponse.PaymentWay();
paymentWay.setPaymentType(OrderConstant.PAYMENT_ONLINE);
paymentWay.setPaymentTypeName(OrderConstant.PAYMENT_ONLINE_NAME);
return paymentWay;
... ... @@ -30,9 +31,9 @@ public class ShoppingSupport {
* 配送方式
* @return
*/
public ShoppingPaymentResponse.DeliveryWay getDeliverWay() {
public PaymentResponse.DeliveryWay getDeliverWay() {
// 快递方式
ShoppingPaymentResponse.DeliveryWay deliveryWay = new ShoppingPaymentResponse.DeliveryWay();
PaymentResponse.DeliveryWay deliveryWay = new PaymentResponse.DeliveryWay();
deliveryWay.setDeliveryWayId(OrderConstant.DELIVERY_WAY_SF);
deliveryWay.setDeliveryWayCost(OrderConstant.DELIVERY_WAY_SF_COST);
deliveryWay.setDeliveryWayName(OrderConstant.DELIVERY_WAY_SF_NAME);
... ... @@ -45,15 +46,15 @@ public class ShoppingSupport {
* @param skup
* @return
*/
public ShoppingPaymentResponse.Goods getGoodsInfo(SellerOrderGoods skup) {
ShoppingPaymentResponse.Goods goods = new ShoppingPaymentResponse.Goods();
public GoodsInfo getGoodsInfo(SellerOrderGoods skup) {
GoodsInfo goods = new GoodsInfo();
goods.setProductName(skup.getProductName());
goods.setColorId(skup.getColorId() == null ? 0 : skup.getColorId());
goods.setColor(skup.getColorName());
goods.setColorName(skup.getColorName());
goods.setSizeId(skup.getSizeId() == null ? 0:skup.getSizeId());
goods.setSizeName(skup.getSizeName());
goods.setSalePrice(skup.getGoodsPrice());
goods.setGoodsImg(skup.getImageUrl());
goods.setGoodPrice(skup.getGoodsPrice() == null ? "0" : skup.getGoodsPrice().toPlainString());
goods.setGoodImg(skup.getImageUrl());
return goods;
}
... ... @@ -62,16 +63,16 @@ public class ShoppingSupport {
* @param skup
* @return
*/
public List<ShoppingPaymentResponse.PromotionFormula> getPromotionFormula(SellerOrderGoods skup) {
ShoppingPaymentResponse.PromotionFormula formula1 = new ShoppingPaymentResponse.PromotionFormula();
public List<PaymentResponse.PromotionFormula> getPromotionFormula(SellerOrderGoods skup) {
PaymentResponse.PromotionFormula formula1 = new PaymentResponse.PromotionFormula();
formula1.setPromotion(OrderConstant.GOODS_PRICE);
formula1.setPromotionAmount(OrderConstant.MONEY_SIGN + skup.getGoodsPrice());
ShoppingPaymentResponse.PromotionFormula formula2 = new ShoppingPaymentResponse.PromotionFormula();
PaymentResponse.PromotionFormula formula2 = new PaymentResponse.PromotionFormula();
formula2.setPromotion(OrderConstant.DELIVERY_DESC);
formula2.setPromotionAmount(OrderConstant.PLUS_SIGN + OrderConstant.MONEY_SIGN + OrderConstant.DELIVERY_WAY_SF_COST);
ShoppingPaymentResponse.PromotionFormula formula3 = new ShoppingPaymentResponse.PromotionFormula();
PaymentResponse.PromotionFormula formula3 = new PaymentResponse.PromotionFormula();
formula3.setPromotion(OrderConstant.GOODS_REAL_PRICE);
formula3.setPromotionAmount(OrderConstant.MONEY_SIGN + skup.getGoodsPrice().add(new BigDecimal(OrderConstant.DELIVERY_WAY_SF_COST)));
... ...