Authored by Lixiaodi

Merge branch 'dev' of http://git.yoho.cn/ufo/yohoufo-fore into dev

Showing 34 changed files with 101 additions and 104 deletions
... ... @@ -2,10 +2,10 @@ package com.yohoufo.order.controller;
import com.yohoufo.common.ApiResponse;
import com.yohoufo.order.common.TabType;
import com.yohoufo.order.request.OrderListRequest;
import com.yohoufo.order.request.OrderRequest;
import com.yohoufo.order.response.OrderDetailInfo;
import com.yohoufo.order.response.OrderListInfoRsp;
import com.yohoufo.order.model.request.OrderListRequest;
import com.yohoufo.order.model.request.OrderRequest;
import com.yohoufo.order.model.response.OrderDetailInfo;
import com.yohoufo.order.model.response.OrderListInfoRsp;
import com.yohoufo.order.service.IBuyerOrderService;
import com.yohoufo.order.service.impl.SellerOrderService;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -35,7 +35,7 @@ public class BuyerOrderController {
* 5:交易成功
* 7:交易失败
*/
@RequestMapping(params = "method=app.buyer.list")
@RequestMapping(params = "method=ufo.order.list")
@ResponseBody
public ApiResponse getOrderList(@RequestParam("type") int type,
@RequestParam("uid") int uid,
... ... @@ -79,12 +79,16 @@ public class BuyerOrderController {
* @param uid
* @return
*/
@RequestMapping(params = "method=app.buyer.detail")
@RequestMapping(params = "method=ufo.order.detail")
@ResponseBody
public ApiResponse getOrderDetail(@RequestParam("orderCode") long orderCode,
@RequestParam("uid") int uid,
@RequestParam("tabType") String tabType) {
TabType actor = TabType.getTabType(tabType);
if (Objects.isNull(actor)){
return new ApiResponse.ApiResponseBuilder().code(400).message("非法的tab").build();
}
OrderRequest orderRequest = OrderRequest.builder()
.uid(uid)
.orderCode(orderCode)
... ... @@ -100,7 +104,7 @@ public class BuyerOrderController {
* 取消订单
*/
@RequestMapping(params = "method=app.buyer.cancel")
@RequestMapping(params = "method=ufo.buyer.cancel")
@ResponseBody
public ApiResponse cancel(@RequestParam("orderCode") long orderCode,
@RequestParam("uid") int uid) {
... ... @@ -120,7 +124,7 @@ public class BuyerOrderController {
* @param uid
* @return
*/
@RequestMapping(params = "method=app.buyer.confirm")
@RequestMapping(params = "method=ufo.buyer.confirm")
@ResponseBody
public ApiResponse confirm(@RequestParam("orderCode") long orderCode,
@RequestParam("uid") int uid) {
... ...
... ... @@ -6,9 +6,9 @@ import com.yohoufo.common.ApiResponse;
import com.yohoufo.order.common.Payment;
import com.yohoufo.order.model.NotifyResponse;
import com.yohoufo.order.model.PaymentData;
import com.yohoufo.order.request.PaymentRequest;
import com.yohoufo.order.response.PaymentConfirmRsp;
import com.yohoufo.order.response.PrepayResponse;
import com.yohoufo.order.model.request.PaymentRequest;
import com.yohoufo.order.model.response.PaymentConfirmRsp;
import com.yohoufo.order.model.response.PrepayResponse;
import com.yohoufo.order.service.IPaymentService;
import com.yohoufo.order.service.pay.alipay.AlipayService;
import com.yohoufo.order.service.pay.weixin.WeixinPayAppService;
... ...
... ... @@ -2,9 +2,9 @@ package com.yohoufo.order.controller;
import com.yohoufo.common.ApiResponse;
import com.yohoufo.order.request.ShoppingRequest;
import com.yohoufo.order.response.OrderSubmitResponse;
import com.yohoufo.order.response.PaymentResponse;
import com.yohoufo.order.model.request.ShoppingRequest;
import com.yohoufo.order.model.response.OrderSubmitResponse;
import com.yohoufo.order.model.response.PaymentResponse;
import com.yohoufo.order.service.IShoppingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
... ...
package com.yohoufo.order.request;
package com.yohoufo.order.model.request;
import com.yohoufo.order.common.TabType;
import lombok.AllArgsConstructor;
... ...
package com.yohoufo.order.request;
package com.yohoufo.order.model.request;
import lombok.AllArgsConstructor;
import lombok.Data;
... ...
package com.yohoufo.order.request;
package com.yohoufo.order.model.request;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Builder;
import java.math.BigDecimal;
@Data
@Builder
@AllArgsConstructor
... ...
package com.yohoufo.order.request;
package com.yohoufo.order.model.request;
import lombok.AllArgsConstructor;
import lombok.Data;
... ...
package com.yohoufo.order.response;
package com.yohoufo.order.model.response;
import lombok.Data;
... ...
package com.yohoufo.order.response;
package com.yohoufo.order.model.response;
import com.yohoufo.order.common.ButtonShow;
... ...
package com.yohoufo.order.response;
package com.yohoufo.order.model.response;
import com.yohoufo.order.common.ButtonShow;
import lombok.Data;
... ...
package com.yohoufo.order.response;
package com.yohoufo.order.model.response;
import lombok.AllArgsConstructor;
import lombok.Data;
... ...
package com.yohoufo.order.response;
package com.yohoufo.order.model.response;
import lombok.Data;
import lombok.ToString;
... ...
package com.yohoufo.order.response;
package com.yohoufo.order.model.response;
import lombok.Data;
import lombok.ToString;
import java.math.BigDecimal;
import java.util.List;
@Data
... ...
package com.yohoufo.order.response;
package com.yohoufo.order.model.response;
import com.alibaba.fastjson.JSONObject;
import lombok.ToString;
... ...
... ... @@ -3,8 +3,8 @@ package com.yohoufo.order.service;
import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
import com.yohoufo.order.model.OrderInfo;
import com.yohoufo.order.request.PaymentRequest;
import com.yohoufo.order.response.PrepayResponse;
import com.yohoufo.order.model.request.PaymentRequest;
import com.yohoufo.order.model.response.PrepayResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.math.BigDecimal;
... ...
... ... @@ -11,12 +11,11 @@ import com.yohoufo.dal.order.model.BuyerOrder;
import com.yohoufo.dal.order.model.BuyerOrderMeta;
import com.yohoufo.order.common.OrderCodeType;
import com.yohoufo.order.common.OrderStatus;
import com.yohoufo.order.common.SellerOrderStatus;
import com.yohoufo.order.constants.MetaKey;
import com.yohoufo.order.constants.OrderConstant;
import com.yohoufo.order.model.OrderInfo;
import com.yohoufo.order.request.PaymentRequest;
import com.yohoufo.order.response.PrepayResponse;
import com.yohoufo.order.model.request.PaymentRequest;
import com.yohoufo.order.model.response.PrepayResponse;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ...
package com.yohoufo.order.service;
import com.yohoufo.order.request.OrderRequest;
import com.yohoufo.order.response.OrderDetailInfo;
import com.yohoufo.order.model.request.OrderRequest;
import com.yohoufo.order.model.response.OrderDetailInfo;
public interface IBuyerOrderService extends IOrderListService{
... ...
package com.yohoufo.order.service;
import com.yohoufo.order.request.OrderListRequest;
import com.yohoufo.order.response.OrderListInfoRsp;
import com.yohoufo.order.model.request.OrderListRequest;
import com.yohoufo.order.model.response.OrderListInfoRsp;
/**
* Created by chenchao on 2018/9/19.
... ...
package com.yohoufo.order.service;
import com.yohoufo.order.request.PaymentRequest;
import com.yohoufo.order.response.PaymentConfirmRsp;
import com.yohoufo.order.response.PrepayResponse;
import com.yohoufo.order.model.request.PaymentRequest;
import com.yohoufo.order.model.response.PaymentConfirmRsp;
import com.yohoufo.order.model.response.PrepayResponse;
public interface IPaymentService {
... ...
package com.yohoufo.order.service;
import com.yohoufo.order.request.ShoppingRequest;
import com.yohoufo.order.response.OrderSubmitResponse;
import com.yohoufo.order.response.PaymentResponse;
import com.yohoufo.order.model.request.ShoppingRequest;
import com.yohoufo.order.model.response.OrderSubmitResponse;
import com.yohoufo.order.model.response.PaymentResponse;
public interface IShoppingService {
... ...
... ... @@ -7,18 +7,16 @@ import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
import com.yohoufo.dal.order.SellerOrderMapper;
import com.yohoufo.dal.order.SellerOrderMetaMapper;
import com.yohoufo.dal.order.model.BuyerOrder;
import com.yohoufo.dal.order.model.BuyerOrderMeta;
import com.yohoufo.dal.order.model.SellerOrder;
import com.yohoufo.dal.order.model.SellerOrderMeta;
import com.yohoufo.order.common.OrderCodeType;
import com.yohoufo.order.common.OrderStatus;
import com.yohoufo.order.common.SellerOrderStatus;
import com.yohoufo.order.constants.MetaKey;
import com.yohoufo.order.constants.OrderConstant;
import com.yohoufo.order.model.OrderInfo;
import com.yohoufo.order.request.PaymentRequest;
import com.yohoufo.order.response.PrepayResponse;
import com.yohoufo.order.model.request.PaymentRequest;
import com.yohoufo.order.model.response.PrepayResponse;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ...
... ... @@ -7,10 +7,10 @@ import com.yohoufo.dal.order.model.BuyerOrderGoods;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.order.common.OrderStatus;
import com.yohoufo.order.common.TabType;
import com.yohoufo.order.request.OrderListRequest;
import com.yohoufo.order.response.GoodsInfo;
import com.yohoufo.order.response.OrderListInfo;
import com.yohoufo.order.response.OrderListInfoRsp;
import com.yohoufo.order.model.request.OrderListRequest;
import com.yohoufo.order.model.response.GoodsInfo;
import com.yohoufo.order.model.response.OrderListInfo;
import com.yohoufo.order.model.response.OrderListInfoRsp;
import com.yohoufo.order.service.IOrderListService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ...
... ... @@ -17,10 +17,10 @@ import com.yohoufo.order.common.Payment;
import com.yohoufo.order.common.TabType;
import com.yohoufo.order.constants.MetaKey;
import com.yohoufo.order.constants.OrderConstant;
import com.yohoufo.order.request.OrderListRequest;
import com.yohoufo.order.request.OrderRequest;
import com.yohoufo.order.response.GoodsInfo;
import com.yohoufo.order.response.OrderDetailInfo;
import com.yohoufo.order.model.request.OrderListRequest;
import com.yohoufo.order.model.request.OrderRequest;
import com.yohoufo.order.model.response.GoodsInfo;
import com.yohoufo.order.model.response.OrderDetailInfo;
import com.yohoufo.order.service.IBuyerOrderService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ...
package com.yohoufo.order.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yoho.core.common.utils.DateUtil;
import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
import com.yohoufo.common.utils.SignUtils;
import com.yohoufo.common.utils.TimeUtils;
import com.yohoufo.dal.order.BuyerOrderMapper;
import com.yohoufo.dal.order.BuyerOrderMetaMapper;
import com.yohoufo.dal.order.OrdersPayMapper;
import com.yohoufo.dal.order.SellerOrderMapper;
import com.yohoufo.dal.order.model.BuyerOrder;
import com.yohoufo.dal.order.model.BuyerOrderMeta;
import com.yohoufo.dal.order.model.OrdersPay;
import com.yohoufo.dal.order.model.SellerOrder;
import com.yohoufo.order.common.*;
import com.yohoufo.order.constants.MetaKey;
import com.yohoufo.order.constants.OrderConstant;
import com.yohoufo.order.model.OrderInfo;
import com.yohoufo.order.model.PayQueryBo;
import com.yohoufo.order.model.PaymentData;
import com.yohoufo.order.request.PaymentRequest;
import com.yohoufo.order.response.PaymentConfirmRsp;
import com.yohoufo.order.response.PrepayResponse;
import com.yohoufo.order.model.request.PaymentRequest;
import com.yohoufo.order.model.response.PaymentConfirmRsp;
import com.yohoufo.order.model.response.PrepayResponse;
import com.yohoufo.order.service.AbstractOrderPaymentService;
import com.yohoufo.order.service.BuyerOrderPaymentService;
import com.yohoufo.order.service.IPaymentService;
... ... @@ -33,14 +23,11 @@ import com.yohoufo.order.service.pay.alipay.AlipayService;
import com.yohoufo.order.service.pay.weixin.WeixinPayAppService;
import com.yohoufo.order.service.support.codegenerator.OrderCodeGenerator;
import com.yohoufo.order.service.support.codegenerator.bean.CodeMeta;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.Date;
@Service
... ...
package com.yohoufo.order.service.impl;
import com.google.common.collect.Lists;
import com.sun.corba.se.spi.ior.IOR;
import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
import com.yoho.service.model.response.UserAddressRspBO;
import com.yohobuy.ufo.model.order.bo.PlatformFee;
import com.yohobuy.ufo.model.order.bo.SoldPrdComputeBo;
import com.yohobuy.ufo.model.order.req.SellerOrderComputeReq;
import com.yohobuy.ufo.model.order.req.SellerOrderListReq;
import com.yohobuy.ufo.model.order.req.SellerOrderSubmitReq;
import com.yohoufo.common.caller.UfoServiceCaller;
import com.yohoufo.common.exception.GatewayException;
... ... @@ -29,13 +26,12 @@ import com.yohoufo.order.model.GoodsInfo;
import com.yohoufo.order.model.SellerOrderContext;
import com.yohoufo.order.model.dto.PlatformFeeDto;
import com.yohoufo.order.model.dto.SellerOrderComputeResult;
import com.yohoufo.order.request.OrderListRequest;
import com.yohoufo.order.response.OrderListInfo;
import com.yohoufo.order.response.OrderListInfoRsp;
import com.yohoufo.order.model.request.OrderListRequest;
import com.yohoufo.order.model.response.OrderListInfo;
import com.yohoufo.order.model.response.OrderListInfoRsp;
import com.yohoufo.order.service.IOrderListService;
import com.yohoufo.order.service.handler.SellerOrderComputeHandler;
import com.yohoufo.order.service.handler.SellerOrderSubmitHandler;
import com.yohoufo.order.service.impl.AbsOrderListService;
import com.yohoufo.order.service.proxy.UserProxyService;
import com.yohoufo.order.service.support.codegenerator.OrderCodeGenerator;
import com.yohoufo.product.model.GoodsSize;
... ... @@ -392,7 +388,7 @@ public class SellerOrderService extends AbsOrderListService implements IOrderLis
orderListInfo.setSkup(sellerOrderGoods.getId());
//
com.yohoufo.order.response.GoodsInfo goodsInfo = new com.yohoufo.order.response.GoodsInfo();
com.yohoufo.order.model.response.GoodsInfo goodsInfo = new com.yohoufo.order.model.response.GoodsInfo();
goodsInfo.setColorName(sellerOrderGoods.getColorName());
goodsInfo.setProductName(sellerOrderGoods.getProductName());
goodsInfo.setGoodImg(sellerOrderGoods.getImageUrl());
... ...
... ... @@ -11,9 +11,9 @@ import com.yohoufo.order.common.OrderCodeType;
import com.yohoufo.order.common.SkupStatus;
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.PaymentResponse;
import com.yohoufo.order.model.request.ShoppingRequest;
import com.yohoufo.order.model.response.OrderSubmitResponse;
import com.yohoufo.order.model.response.PaymentResponse;
import com.yohoufo.order.service.ISubmitOrderService;
import com.yohoufo.order.service.IShoppingService;
import com.yohoufo.order.service.proxy.UserProxyService;
... ...
... ... @@ -2,8 +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.GoodsInfo;
import com.yohoufo.order.response.PaymentResponse;
import com.yohoufo.order.model.response.GoodsInfo;
import com.yohoufo.order.model.response.PaymentResponse;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
... ...
... ... @@ -103,12 +103,6 @@ public class ProductSearchController {
return new ApiResponse.ApiResponseBuilder().code(200).message("product.search.list.filter").data(resp).build();
}
private SearchProductListFilterResp mockSearchProductListFilter(){
String mockJson = "{\"filter\":[{\"filterId\":\"brand\",\"filterName\":\"品牌\",\"itemList\":[{\"itemId\":\"591\",\"itemName\":\"F.L.Y.D\"},{\"itemId\":\"232\",\"itemName\":\"HIPANDA\"},{\"itemId\":\"3640\",\"itemName\":\"PSO BRAND\"}],\"multiSelect\":false},{\"filterId\":\"sort\",\"filterName\":\"品类\",\"itemList\":[{\"itemId\":\"114\",\"itemName\":\"T恤\"}],\"multiSelect\":false},{\"filterId\":\"gender\",\"filterName\":\"性别\",\"itemList\":[{\"itemId\":\"1,3\",\"itemName\":\"MEN\"}],\"multiSelect\":false},{\"filterId\":\"size\",\"filterName\":\"尺码\",\"itemList\":[{\"itemId\":\"207\",\"itemName\":\"S\"},{\"itemId\":\"208\",\"itemName\":\"S/M\"},{\"itemId\":\"203\",\"itemName\":\"M\"},{\"itemId\":\"201\",\"itemName\":\"L\"},{\"itemId\":\"211\",\"itemName\":\"XL\"},{\"itemId\":\"216\",\"itemName\":\"XXL\"},{\"itemId\":\"218\",\"itemName\":\"XXXL\"},{\"itemId\":\"348\",\"itemName\":\"XXXXL\"}],\"multiSelect\":false}]}";
SearchProductListFilterResp data = UfoJsonUtil.safelyParseObject(mockJson, SearchProductListFilterResp.class);
return data;
}
@IgnoreSignature
@ApiOperation(name = "ufo.product.search.brandList", desc="品牌列表")
@RequestMapping(params = "method=ufo.product.search.brandList")
... ... @@ -116,12 +110,8 @@ public class ProductSearchController {
@Cachable(expire = 300)
public ApiResponse searchBrandList() {
return new ApiResponse.ApiResponseBuilder().code(200).message("product.search.list.filter").data(mocksearchBrandList()).build();
}
SearchBrandListResp resp = productSearchService.searchBrandList();
private SearchBrandListResp mocksearchBrandList(){
String mockJson = "{\"brand_list\":[{\"brand_id\":76,\"brand_name\":\"乔丹达斯123\",\"brand_logo\":\"http://flv01.static.yhbimg.com/goodsimg/2018/09/12/19/03202a396af0a030516ff40c0289f0b1e5.png\"},{\"brand_id\":78,\"brand_name\":\"阿迪达斯\",\"brand_logo\":\"http://flv01.static.yhbimg.com/goodsimg/2018/09/12/20/03cf82ff042cb4057ba5dfbedb6fb623d2.jpg\"}]}";
SearchBrandListResp data = UfoJsonUtil.safelyParseObject(mockJson, SearchBrandListResp.class);
return data;
return new ApiResponse.ApiResponseBuilder().code(200).message("product.search.brandList").data(resp).build();
}
}
\ No newline at end of file
... ...
... ... @@ -54,7 +54,7 @@ public class SearchParam {
setOrder(req.getOrder()).setBrand(req.getBrand()).setSize(req.getSize())
.setMaxSort(req.getMaxSort()).setMidSort(req.getMidSort())
.setQuery(req.getQuery()).setSoonSale(req.getIsSoonSale())
.setProductPool(req.getPool()).setBrandSeries(req.getSeries());
.setProductPool(req.getPool()).setBrandSeries(req.getSeries()).setGender(req.getGender());
return this;
}
... ...
... ... @@ -15,6 +15,7 @@ public class ProductSearchReq {
private String pool;
private String order;
private String isSoonSale; //Y saletime查了大于now的
private Integer not_id;
public Integer getId() {
... ... @@ -133,4 +134,13 @@ public class ProductSearchReq {
this.isSoonSale = isSoonSale;
return this;
}
public Integer getNot_id() {
return not_id;
}
public void setNot_id(Integer not_id) {
this.not_id = not_id;
}
}
... ...
... ... @@ -19,8 +19,8 @@ public class SearchBrandListResp {
}
public static class BrandIntro {
@JSONField(name = "brand_id")
private Integer brandId;
@JSONField(name = "id")
private Integer id;
@JSONField(name = "brand_name")
private String brandName;
... ... @@ -29,12 +29,12 @@ public class SearchBrandListResp {
private String brandLogo;
public Integer getBrandId() {
return brandId;
public Integer getId() {
return id;
}
public void setBrandId(Integer brandId) {
this.brandId = brandId;
public void setId(Integer id) {
this.id = id;
}
public String getBrandName() {
... ...
... ... @@ -4,6 +4,7 @@ package com.yohoufo.product.service;
import com.alibaba.fastjson.JSONObject;
import com.yohoufo.product.request.ProductSearchReq;
import com.yohoufo.product.request.SortIdLevel;
import com.yohoufo.product.response.SearchBrandListResp;
import com.yohoufo.product.response.SearchProductListFilterResp;
public interface ProductSearchService {
... ... @@ -14,4 +15,6 @@ public interface ProductSearchService {
SearchProductListFilterResp searchProductListFilter(ProductSearchReq req);
SearchBrandListResp searchBrandList();
}
... ...
... ... @@ -5,6 +5,7 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.yohoufo.common.utils.UfoStringUtils;
import com.yohoufo.dal.product.ProductSortMapper;
... ... @@ -13,6 +14,7 @@ import com.yohoufo.product.helper.SearchParam;
import com.yohoufo.product.model.FilterItem;
import com.yohoufo.product.request.ProductSearchReq;
import com.yohoufo.product.request.SortIdLevel;
import com.yohoufo.product.response.SearchBrandListResp;
import com.yohoufo.product.response.SearchProductListFilterResp;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
... ... @@ -185,6 +187,17 @@ public class ProductSearchServiceImpl implements ProductSearchService {
}
@Override
public SearchBrandListResp searchBrandList() {
SearchBrandListResp resp = new SearchBrandListResp();
SearchParam searchParam = new SearchParam();
JSONObject data = search(searchParam.getParam(), BRAND_LIST_URL);
if(data != null && !CollectionUtils.isEmpty(data.getJSONArray("brand_list"))) {
resp = JSON.toJavaObject(data, SearchBrandListResp.class);
}
return resp;
}
@Override
public SortIdLevel getSortLevelById(String sortId) {
SortIdLevel sortIdLevel = new SortIdLevel();
if (StringUtils.isNotBlank(sortId)) {
... ...