Authored by chenchao

add api and in/out param 4 appraise order

package com.yohoufo.order.controller;
import com.yohobuy.ufo.model.order.req.AppraiseOrderComputeReq;
import com.yohobuy.ufo.model.order.req.AppraiseOrderDetailReq;
import com.yohobuy.ufo.model.order.req.AppraiseOrderListReq;
import com.yohobuy.ufo.model.order.req.AppraiseOrderSubmitReq;
import com.yohoufo.common.ApiResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class AppraiseOrderController {
private final Logger logger = LoggerFactory.getLogger(getClass());
/**
* 商品付费鉴定费用计算
* @param uid
* @param productId
* @return
*/
@RequestMapping(params = "method=ufo.appriseOrder.compute")
public ApiResponse compute(@RequestParam(name = "uid")int uid,
@RequestParam(name = "productId")int productId){
AppraiseOrderComputeReq req = AppraiseOrderComputeReq.builder()
.uid(uid)
.productId(productId)
.build();
logger.info("in ufo.appriseOrder.compute req {}", req);
return new ApiResponse.ApiResponseBuilder()
.code(200)
.data(null)
.message("鉴定计算成功")
.build();
}
@RequestMapping(params = "method=ufo.appriseOrder.submit")
public ApiResponse submit(@RequestParam(name = "uid")int uid,
@RequestParam(name = "productId")int productId,
@RequestParam(name = "addressId") String addressId){
AppraiseOrderSubmitReq req = AppraiseOrderSubmitReq.builder()
.uid(uid).productId(productId).addressId(addressId).build();
logger.info("in ufo.appriseOrder.submit req {}", req);
return new ApiResponse.ApiResponseBuilder()
.code(200)
.data(null)
.message("鉴定订单提交成功")
.build();
}
/**
* 商品付费鉴定列表
* @param uid
* @return
*/
@RequestMapping(params = "method=ufo.appriseOrder.list")
public ApiResponse list(@RequestParam(name = "uid")int uid,
@RequestParam(value = "page", required = false, defaultValue = "1") int page,
@RequestParam(value = "limit", required = false, defaultValue = "10") int limit){
AppraiseOrderListReq req = AppraiseOrderListReq.builder()
.uid(uid).limit(limit).page(page).build();
logger.info("in ufo.appriseOrder.list req {}", req);
return new ApiResponse.ApiResponseBuilder()
.code(200)
.data(null)
.message("鉴定订单列表查询成功")
.build();
}
@RequestMapping(params = "method=ufo.appriseOrder.detail")
public ApiResponse detail(@RequestParam(name = "uid")int uid,
@RequestParam(name = "orderCode")long orderCode){
AppraiseOrderDetailReq req = AppraiseOrderDetailReq.builder().uid(uid).orderCode(orderCode).build();
logger.info("in ufo.appriseOrder.detail req {}", req);
return new ApiResponse.ApiResponseBuilder()
.code(200)
.data(null)
.message("鉴定订单详情查询成功")
.build();
}
}
... ...
... ... @@ -11,7 +11,7 @@ import com.yohobuy.ufo.model.order.vo.AddressInfo;
import com.yohoufo.common.ApiResponse;
import com.yohoufo.order.model.request.OrderListRequest;
import com.yohoufo.order.model.request.OrderRequest;
import com.yohoufo.order.model.response.OrderDetailInfo;
import com.yohobuy.ufo.model.order.resp.OrderDetailInfo;
import com.yohoufo.order.service.IBuyerOrderService;
import com.yohoufo.order.service.impl.AppraiseService;
import com.yohoufo.order.service.impl.BuyerOrderViewService;
... ...
package com.yohoufo.order.model.response;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.Builder;
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AppraiseAddressInfo {
String addressName;
String mobile;
String address;
}
package com.yohoufo.order.model.response;
import com.yohobuy.ufo.model.order.bo.ButtonShowBo;
import com.yohobuy.ufo.model.order.bo.PlatformFee;
import com.yohobuy.ufo.model.order.resp.ExpressInfoDetail;
import com.yohobuy.ufo.model.order.vo.AddressInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.Builder;
import com.yohobuy.ufo.model.order.bo.GoodsInfo;
import java.util.List;
@Data
public class OrderDetailInfo {
int uid;
Long orderCode;
/**
* 商品信息
*/
GoodsInfo goodsInfo;
/**
* 状态详细
*/
StatusDetail statusDetail;
/**
* 价格详细
*/
PriceInfo priceInfo;
/**
* 买家: 用户收货情报
* 卖家:寄回地址
*/
private AddressInfo userAddress;
/**
* 卖家指定的鉴定中心地址
*/
AppraiseAddressInfo appraiseAddress;
/**
* 按钮显示
*/
List<ButtonShowBo> buttons;
int payment;
String paymentStr;
/**
* 提交订单时间
*/
String submitOrderTimeStr;
/**
* 卖家的实际收入
*/
private String income;
private Double earnestMoney;
private String earnestMoneyStr;
private PlatformFee platformFee;
private String bankTransferFee;
private Integer secendLevelCreateTime;
private String createTime;
/**
* 最新物流
*/
private ExpressInfoDetail lastExpressInfo;
/**
* 是否支付
* 1:已支付,0:未支付
*/
private Integer isPaid;
/**
* 鉴定视频链接
*/
private String appraiseVideoUrl;
/**
* 是否门店订单:Y/N
*/
private String isOffline;
/**
* 是否预售 是 :Y, 否 :N
*/
private String isAdvance;
private Integer attributes;
private String depositTips;
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public static class StatusDetail{
int status;
/**
* 列表中状态显示
*/
String statuStr;
/**
* 详情页的线上
*/
String detailDesc;
/**
* 剩余价格
*/
Integer leftTime;
/**
* 是否显示 物流箭头信息
*/
boolean expressShow;
/**
* 物流信息
*/
String express;
/**
* 发货时间点
*/
String sendOutTimeStr;
/**
* 支付提示
*/
String paymentTips;
}
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public static class PriceInfo{
/**
* 商品金额
*/
String goodPrice;
/**
* 没有任何优惠的原始运费
*/
String feePrice;
/**
* 活动优惠金额
*/
String activityCutPrice;
/**
* 优惠券金额
*/
String couponCutPrice;
/**
* 运费券金额
*/
String shippingCouponCutPrice;
/**
* 活动减免
*/
String shippingActivityCutPrice;
/**
* 活动减免的税费
*/
String tariffActivityCutPrice;
/**
* 原始税费
*/
String tariffPrice;
/**
* 实付金额
*/
String realPayPrice;
/**
* 仓储费
*/
String depositPrice;
/**
* 闪购服务费
*/
String quickDeliveServicePrice;
}
}
package com.yohoufo.order.service;
import com.yohoufo.order.model.request.OrderRequest;
import com.yohoufo.order.model.response.OrderDetailInfo;
import com.yohobuy.ufo.model.order.resp.OrderDetailInfo;
/**
* Created by chenchao on 2018/9/20.
... ...
... ... @@ -7,10 +7,9 @@ import com.yohobuy.ufo.model.order.resp.BuyerOrderNums;
import com.yohobuy.ufo.model.order.vo.OrderListVo;
import com.yohoufo.common.cache.CacheClient;
import com.yohoufo.common.cache.SnappyZipUtils;
import com.yohoufo.dal.order.model.BuyOrderNums;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.order.model.request.OrderListRequest;
import com.yohoufo.order.model.response.OrderDetailInfo;
import com.yohobuy.ufo.model.order.resp.OrderDetailInfo;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ...
... ... @@ -7,9 +7,8 @@ import com.yohobuy.ufo.model.order.resp.OrderListInfo;
import com.yohoufo.dal.order.model.BuyerOrder;
import com.yohoufo.dal.order.model.BuyerOrderGoods;
import com.yohoufo.order.constants.ViewType;
import com.yohoufo.order.model.response.OrderDetailInfo;
import com.yohobuy.ufo.model.order.resp.OrderDetailInfo;
import com.yohoufo.order.service.support.BuyerOrderButtonFormatFunction;
import com.yohoufo.order.service.support.ThreeFunction;
import com.yohoufo.order.utils.LoggerUtils;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
... ...
package com.yohoufo.order.service.impl;
import com.google.common.collect.Lists;
import com.yoho.core.common.utils.YHMath;
import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
import com.yohobuy.ufo.model.order.bo.ButtonShowBo;
... ... @@ -26,7 +25,7 @@ import com.yohoufo.order.constants.ViewType;
import com.yohoufo.order.convert.GoodsInfoConvertor;
import com.yohoufo.order.model.bo.AmountDetailBo;
import com.yohoufo.order.model.request.OrderRequest;
import com.yohoufo.order.model.response.OrderDetailInfo;
import com.yohobuy.ufo.model.order.resp.OrderDetailInfo;
import com.yohoufo.order.service.IBuyerOrderMetaService;
import com.yohoufo.order.service.IExpressInfoService;
import com.yohoufo.order.service.IOrderDetailService;
... ...
... ... @@ -14,7 +14,7 @@ import com.yohoufo.dal.order.model.BuyerOrderGoods;
import com.yohoufo.order.common.ActionStatusHold;
import com.yohoufo.order.constants.ViewType;
import com.yohoufo.order.model.dto.BuyerPenaltyCalResult;
import com.yohoufo.order.model.response.OrderDetailInfo;
import com.yohobuy.ufo.model.order.resp.OrderDetailInfo;
import com.yohoufo.order.service.handler.BuyerCancelCompensateComputeHandler;
import com.yohoufo.order.service.seller.support.SkupTypeCodeSupport;
import com.yohoufo.order.service.support.BuyerOrderButtonFormatFunction;
... ... @@ -30,7 +30,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.function.Predicate;
/**
* Created by chao.chen on 2018/11/26.
... ...
... ... @@ -6,7 +6,7 @@ import com.yoho.core.cache.LocalCacheCallback;
import com.yohobuy.ufo.model.order.constants.DepotType;
import com.yohoufo.dal.order.AppraiseAddressMapper;
import com.yohoufo.dal.order.model.AppraiseAddress;
import com.yohoufo.order.model.response.AppraiseAddressInfo;
import com.yohobuy.ufo.model.order.resp.AppraiseAddressInfo;
import com.yohoufo.order.model.response.AppraiseAddressResp;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
... ...
package com.yohoufo.order.service.impl;
import com.yohoufo.order.utils.LoggerUtils;
import org.slf4j.Logger;
import org.springframework.stereotype.Service;
@Service
public class AppraiseOrderService {
private final Logger logger = LoggerUtils.getBuyerOrderLogger();
}
... ...
... ... @@ -19,11 +19,10 @@ import com.yohoufo.dal.order.model.BuyerOrderMeta;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.order.common.ActionStatusHold;
import com.yohoufo.order.model.request.OrderRequest;
import com.yohoufo.order.model.response.OrderDetailInfo;
import com.yohobuy.ufo.model.order.resp.OrderDetailInfo;
import com.yohoufo.order.service.IOrderDetailService;
import com.yohoufo.order.service.cache.OrderCacheService;
import com.yohoufo.order.service.handler.BuyerOrderButtonsHandler;
import com.yohoufo.order.utils.BuyerOrderUtils;
import com.yohoufo.order.utils.LoggerUtils;
import com.yohoufo.order.utils.OrderDetailDescHelper;
import com.yohoufo.order.utils.SellerGoodsHelper;
... ...
... ... @@ -12,7 +12,7 @@ import com.yohoufo.dal.order.model.BuyerOrder;
import com.yohoufo.order.model.dto.BuyerPenaltyCalResult;
import com.yohoufo.order.model.request.OrderListRequest;
import com.yohoufo.order.model.request.OrderRequest;
import com.yohoufo.order.model.response.OrderDetailInfo;
import com.yohobuy.ufo.model.order.resp.OrderDetailInfo;
import com.yohoufo.order.service.IOrderDetailService;
import com.yohoufo.order.service.IOrderListService;
import com.yohoufo.order.service.cache.OrderCacheService;
... ...
... ... @@ -23,9 +23,9 @@ import com.yohoufo.order.convert.GoodsInfoConvertor;
import com.yohoufo.order.convert.SellerOrderConvertor;
import com.yohoufo.order.model.dto.SellerOrderComputeResult;
import com.yohoufo.order.model.request.OrderRequest;
import com.yohoufo.order.model.response.AppraiseAddressInfo;
import com.yohobuy.ufo.model.order.resp.AppraiseAddressInfo;
import com.yohoufo.order.model.response.AppraiseAddressResp;
import com.yohoufo.order.model.response.OrderDetailInfo;
import com.yohobuy.ufo.model.order.resp.OrderDetailInfo;
import com.yohoufo.order.mq.DelayTime;
import com.yohoufo.order.service.IOrderDetailService;
import com.yohoufo.order.service.cache.OrderCacheService;
... ...
... ... @@ -28,7 +28,7 @@ import com.yohoufo.order.model.SellerOrderContext;
import com.yohoufo.order.model.dto.*;
import com.yohoufo.order.model.request.OrderListRequest;
import com.yohoufo.order.model.request.OrderRequest;
import com.yohoufo.order.model.response.OrderDetailInfo;
import com.yohobuy.ufo.model.order.resp.OrderDetailInfo;
import com.yohoufo.order.model.response.OrderSubmitResp;
import com.yohoufo.order.mq.DelayTime;
import com.yohoufo.order.service.IOrderDetailService;
... ...