Authored by chenchao

add api and in/out param 4 appraise order

  1 +package com.yohoufo.order.controller;
  2 +
  3 +import com.yohobuy.ufo.model.order.req.AppraiseOrderComputeReq;
  4 +import com.yohobuy.ufo.model.order.req.AppraiseOrderDetailReq;
  5 +import com.yohobuy.ufo.model.order.req.AppraiseOrderListReq;
  6 +import com.yohobuy.ufo.model.order.req.AppraiseOrderSubmitReq;
  7 +import com.yohoufo.common.ApiResponse;
  8 +import org.slf4j.Logger;
  9 +import org.slf4j.LoggerFactory;
  10 +import org.springframework.web.bind.annotation.RequestMapping;
  11 +import org.springframework.web.bind.annotation.RequestParam;
  12 +import org.springframework.web.bind.annotation.RestController;
  13 +
  14 +@RestController
  15 +public class AppraiseOrderController {
  16 +
  17 + private final Logger logger = LoggerFactory.getLogger(getClass());
  18 +
  19 + /**
  20 + * 商品付费鉴定费用计算
  21 + * @param uid
  22 + * @param productId
  23 + * @return
  24 + */
  25 + @RequestMapping(params = "method=ufo.appriseOrder.compute")
  26 + public ApiResponse compute(@RequestParam(name = "uid")int uid,
  27 + @RequestParam(name = "productId")int productId){
  28 + AppraiseOrderComputeReq req = AppraiseOrderComputeReq.builder()
  29 + .uid(uid)
  30 + .productId(productId)
  31 + .build();
  32 + logger.info("in ufo.appriseOrder.compute req {}", req);
  33 +
  34 +
  35 + return new ApiResponse.ApiResponseBuilder()
  36 + .code(200)
  37 + .data(null)
  38 + .message("鉴定计算成功")
  39 + .build();
  40 + }
  41 +
  42 +
  43 + @RequestMapping(params = "method=ufo.appriseOrder.submit")
  44 + public ApiResponse submit(@RequestParam(name = "uid")int uid,
  45 + @RequestParam(name = "productId")int productId,
  46 + @RequestParam(name = "addressId") String addressId){
  47 + AppraiseOrderSubmitReq req = AppraiseOrderSubmitReq.builder()
  48 + .uid(uid).productId(productId).addressId(addressId).build();
  49 + logger.info("in ufo.appriseOrder.submit req {}", req);
  50 +
  51 + return new ApiResponse.ApiResponseBuilder()
  52 + .code(200)
  53 + .data(null)
  54 + .message("鉴定订单提交成功")
  55 + .build();
  56 + }
  57 +
  58 +
  59 + /**
  60 + * 商品付费鉴定列表
  61 + * @param uid
  62 + * @return
  63 + */
  64 + @RequestMapping(params = "method=ufo.appriseOrder.list")
  65 + public ApiResponse list(@RequestParam(name = "uid")int uid,
  66 + @RequestParam(value = "page", required = false, defaultValue = "1") int page,
  67 + @RequestParam(value = "limit", required = false, defaultValue = "10") int limit){
  68 +
  69 + AppraiseOrderListReq req = AppraiseOrderListReq.builder()
  70 + .uid(uid).limit(limit).page(page).build();
  71 +
  72 + logger.info("in ufo.appriseOrder.list req {}", req);
  73 +
  74 + return new ApiResponse.ApiResponseBuilder()
  75 + .code(200)
  76 + .data(null)
  77 + .message("鉴定订单列表查询成功")
  78 + .build();
  79 + }
  80 +
  81 +
  82 + @RequestMapping(params = "method=ufo.appriseOrder.detail")
  83 + public ApiResponse detail(@RequestParam(name = "uid")int uid,
  84 + @RequestParam(name = "orderCode")long orderCode){
  85 + AppraiseOrderDetailReq req = AppraiseOrderDetailReq.builder().uid(uid).orderCode(orderCode).build();
  86 + logger.info("in ufo.appriseOrder.detail req {}", req);
  87 +
  88 + return new ApiResponse.ApiResponseBuilder()
  89 + .code(200)
  90 + .data(null)
  91 + .message("鉴定订单详情查询成功")
  92 + .build();
  93 + }
  94 +}
@@ -11,7 +11,7 @@ import com.yohobuy.ufo.model.order.vo.AddressInfo; @@ -11,7 +11,7 @@ import com.yohobuy.ufo.model.order.vo.AddressInfo;
11 import com.yohoufo.common.ApiResponse; 11 import com.yohoufo.common.ApiResponse;
12 import com.yohoufo.order.model.request.OrderListRequest; 12 import com.yohoufo.order.model.request.OrderListRequest;
13 import com.yohoufo.order.model.request.OrderRequest; 13 import com.yohoufo.order.model.request.OrderRequest;
14 -import com.yohoufo.order.model.response.OrderDetailInfo; 14 +import com.yohobuy.ufo.model.order.resp.OrderDetailInfo;
15 import com.yohoufo.order.service.IBuyerOrderService; 15 import com.yohoufo.order.service.IBuyerOrderService;
16 import com.yohoufo.order.service.impl.AppraiseService; 16 import com.yohoufo.order.service.impl.AppraiseService;
17 import com.yohoufo.order.service.impl.BuyerOrderViewService; 17 import com.yohoufo.order.service.impl.BuyerOrderViewService;
1 -package com.yohoufo.order.model.response;  
2 -  
3 -import lombok.AllArgsConstructor;  
4 -import lombok.Data;  
5 -import lombok.NoArgsConstructor;  
6 -import lombok.Builder;  
7 -  
8 -@Builder  
9 -@Data  
10 -@AllArgsConstructor  
11 -@NoArgsConstructor  
12 -public class AppraiseAddressInfo {  
13 -  
14 - String addressName;  
15 -  
16 - String mobile;  
17 -  
18 - String address;  
19 -  
20 -}  
1 -package com.yohoufo.order.model.response;  
2 -  
3 -  
4 -import com.yohobuy.ufo.model.order.bo.ButtonShowBo;  
5 -import com.yohobuy.ufo.model.order.bo.PlatformFee;  
6 -import com.yohobuy.ufo.model.order.resp.ExpressInfoDetail;  
7 -import com.yohobuy.ufo.model.order.vo.AddressInfo;  
8 -import lombok.AllArgsConstructor;  
9 -import lombok.Data;  
10 -import lombok.NoArgsConstructor;  
11 -import lombok.Builder;  
12 -import com.yohobuy.ufo.model.order.bo.GoodsInfo;  
13 -  
14 -import java.util.List;  
15 -  
16 -@Data  
17 -public class OrderDetailInfo {  
18 -  
19 -  
20 - int uid;  
21 -  
22 - Long orderCode;  
23 -  
24 - /**  
25 - * 商品信息  
26 - */  
27 - GoodsInfo goodsInfo;  
28 -  
29 - /**  
30 - * 状态详细  
31 - */  
32 - StatusDetail statusDetail;  
33 -  
34 - /**  
35 - * 价格详细  
36 - */  
37 - PriceInfo priceInfo;  
38 -  
39 -  
40 - /**  
41 - * 买家: 用户收货情报  
42 - * 卖家:寄回地址  
43 - */  
44 - private AddressInfo userAddress;  
45 -  
46 - /**  
47 - * 卖家指定的鉴定中心地址  
48 - */  
49 - AppraiseAddressInfo appraiseAddress;  
50 - /**  
51 - * 按钮显示  
52 - */  
53 - List<ButtonShowBo> buttons;  
54 -  
55 -  
56 - int payment;  
57 -  
58 - String paymentStr;  
59 -  
60 - /**  
61 - * 提交订单时间  
62 - */  
63 - String submitOrderTimeStr;  
64 - /**  
65 - * 卖家的实际收入  
66 - */  
67 - private String income;  
68 -  
69 - private Double earnestMoney;  
70 -  
71 - private String earnestMoneyStr;  
72 -  
73 - private PlatformFee platformFee;  
74 -  
75 - private String bankTransferFee;  
76 -  
77 - private Integer secendLevelCreateTime;  
78 -  
79 - private String createTime;  
80 -  
81 - /**  
82 - * 最新物流  
83 - */  
84 - private ExpressInfoDetail lastExpressInfo;  
85 -  
86 - /**  
87 - * 是否支付  
88 - * 1:已支付,0:未支付  
89 - */  
90 - private Integer isPaid;  
91 -  
92 -  
93 - /**  
94 - * 鉴定视频链接  
95 - */  
96 - private String appraiseVideoUrl;  
97 -  
98 - /**  
99 - * 是否门店订单:Y/N  
100 - */  
101 - private String isOffline;  
102 -  
103 - /**  
104 - * 是否预售 是 :Y, 否 :N  
105 - */  
106 - private String isAdvance;  
107 -  
108 - private Integer attributes;  
109 -  
110 - private String depositTips;  
111 -  
112 -  
113 - @Builder  
114 - @Data  
115 - @AllArgsConstructor  
116 - @NoArgsConstructor  
117 - public static class StatusDetail{  
118 -  
119 - int status;  
120 -  
121 - /**  
122 - * 列表中状态显示  
123 - */  
124 - String statuStr;  
125 -  
126 - /**  
127 - * 详情页的线上  
128 - */  
129 - String detailDesc;  
130 -  
131 - /**  
132 - * 剩余价格  
133 - */  
134 - Integer leftTime;  
135 -  
136 - /**  
137 - * 是否显示 物流箭头信息  
138 - */  
139 - boolean expressShow;  
140 -  
141 - /**  
142 - * 物流信息  
143 - */  
144 - String express;  
145 -  
146 - /**  
147 - * 发货时间点  
148 - */  
149 - String sendOutTimeStr;  
150 - /**  
151 - * 支付提示  
152 - */  
153 - String paymentTips;  
154 - }  
155 -  
156 - @Data  
157 - @Builder  
158 - @AllArgsConstructor  
159 - @NoArgsConstructor  
160 - public static class PriceInfo{  
161 - /**  
162 - * 商品金额  
163 - */  
164 - String goodPrice;  
165 -  
166 - /**  
167 - * 没有任何优惠的原始运费  
168 - */  
169 - String feePrice;  
170 -  
171 - /**  
172 - * 活动优惠金额  
173 - */  
174 - String activityCutPrice;  
175 -  
176 - /**  
177 - * 优惠券金额  
178 - */  
179 - String couponCutPrice;  
180 -  
181 - /**  
182 - * 运费券金额  
183 - */  
184 - String shippingCouponCutPrice;  
185 -  
186 - /**  
187 - * 活动减免  
188 - */  
189 - String shippingActivityCutPrice;  
190 - /**  
191 - * 活动减免的税费  
192 - */  
193 - String tariffActivityCutPrice;  
194 - /**  
195 - * 原始税费  
196 - */  
197 - String tariffPrice;  
198 -  
199 - /**  
200 - * 实付金额  
201 - */  
202 - String realPayPrice;  
203 - /**  
204 - * 仓储费  
205 - */  
206 - String depositPrice;  
207 - /**  
208 - * 闪购服务费  
209 - */  
210 - String quickDeliveServicePrice;  
211 - }  
212 -  
213 -  
214 -}  
1 package com.yohoufo.order.service; 1 package com.yohoufo.order.service;
2 2
3 import com.yohoufo.order.model.request.OrderRequest; 3 import com.yohoufo.order.model.request.OrderRequest;
4 -import com.yohoufo.order.model.response.OrderDetailInfo; 4 +import com.yohobuy.ufo.model.order.resp.OrderDetailInfo;
5 5
6 /** 6 /**
7 * Created by chenchao on 2018/9/20. 7 * Created by chenchao on 2018/9/20.
@@ -7,10 +7,9 @@ import com.yohobuy.ufo.model.order.resp.BuyerOrderNums; @@ -7,10 +7,9 @@ import com.yohobuy.ufo.model.order.resp.BuyerOrderNums;
7 import com.yohobuy.ufo.model.order.vo.OrderListVo; 7 import com.yohobuy.ufo.model.order.vo.OrderListVo;
8 import com.yohoufo.common.cache.CacheClient; 8 import com.yohoufo.common.cache.CacheClient;
9 import com.yohoufo.common.cache.SnappyZipUtils; 9 import com.yohoufo.common.cache.SnappyZipUtils;
10 -import com.yohoufo.dal.order.model.BuyOrderNums;  
11 import com.yohoufo.dal.order.model.SellerOrderGoods; 10 import com.yohoufo.dal.order.model.SellerOrderGoods;
12 import com.yohoufo.order.model.request.OrderListRequest; 11 import com.yohoufo.order.model.request.OrderListRequest;
13 -import com.yohoufo.order.model.response.OrderDetailInfo; 12 +import com.yohobuy.ufo.model.order.resp.OrderDetailInfo;
14 import org.apache.commons.lang3.StringUtils; 13 import org.apache.commons.lang3.StringUtils;
15 import org.slf4j.Logger; 14 import org.slf4j.Logger;
16 import org.slf4j.LoggerFactory; 15 import org.slf4j.LoggerFactory;
@@ -7,9 +7,8 @@ import com.yohobuy.ufo.model.order.resp.OrderListInfo; @@ -7,9 +7,8 @@ import com.yohobuy.ufo.model.order.resp.OrderListInfo;
7 import com.yohoufo.dal.order.model.BuyerOrder; 7 import com.yohoufo.dal.order.model.BuyerOrder;
8 import com.yohoufo.dal.order.model.BuyerOrderGoods; 8 import com.yohoufo.dal.order.model.BuyerOrderGoods;
9 import com.yohoufo.order.constants.ViewType; 9 import com.yohoufo.order.constants.ViewType;
10 -import com.yohoufo.order.model.response.OrderDetailInfo; 10 +import com.yohobuy.ufo.model.order.resp.OrderDetailInfo;
11 import com.yohoufo.order.service.support.BuyerOrderButtonFormatFunction; 11 import com.yohoufo.order.service.support.BuyerOrderButtonFormatFunction;
12 -import com.yohoufo.order.service.support.ThreeFunction;  
13 import com.yohoufo.order.utils.LoggerUtils; 12 import com.yohoufo.order.utils.LoggerUtils;
14 import org.apache.commons.collections.CollectionUtils; 13 import org.apache.commons.collections.CollectionUtils;
15 import org.slf4j.Logger; 14 import org.slf4j.Logger;
1 package com.yohoufo.order.service.impl; 1 package com.yohoufo.order.service.impl;
2 2
3 import com.google.common.collect.Lists; 3 import com.google.common.collect.Lists;
4 -import com.yoho.core.common.utils.YHMath;  
5 import com.yoho.error.ServiceError; 4 import com.yoho.error.ServiceError;
6 import com.yoho.error.exception.ServiceException; 5 import com.yoho.error.exception.ServiceException;
7 import com.yohobuy.ufo.model.order.bo.ButtonShowBo; 6 import com.yohobuy.ufo.model.order.bo.ButtonShowBo;
@@ -26,7 +25,7 @@ import com.yohoufo.order.constants.ViewType; @@ -26,7 +25,7 @@ import com.yohoufo.order.constants.ViewType;
26 import com.yohoufo.order.convert.GoodsInfoConvertor; 25 import com.yohoufo.order.convert.GoodsInfoConvertor;
27 import com.yohoufo.order.model.bo.AmountDetailBo; 26 import com.yohoufo.order.model.bo.AmountDetailBo;
28 import com.yohoufo.order.model.request.OrderRequest; 27 import com.yohoufo.order.model.request.OrderRequest;
29 -import com.yohoufo.order.model.response.OrderDetailInfo; 28 +import com.yohobuy.ufo.model.order.resp.OrderDetailInfo;
30 import com.yohoufo.order.service.IBuyerOrderMetaService; 29 import com.yohoufo.order.service.IBuyerOrderMetaService;
31 import com.yohoufo.order.service.IExpressInfoService; 30 import com.yohoufo.order.service.IExpressInfoService;
32 import com.yohoufo.order.service.IOrderDetailService; 31 import com.yohoufo.order.service.IOrderDetailService;
@@ -14,7 +14,7 @@ import com.yohoufo.dal.order.model.BuyerOrderGoods; @@ -14,7 +14,7 @@ import com.yohoufo.dal.order.model.BuyerOrderGoods;
14 import com.yohoufo.order.common.ActionStatusHold; 14 import com.yohoufo.order.common.ActionStatusHold;
15 import com.yohoufo.order.constants.ViewType; 15 import com.yohoufo.order.constants.ViewType;
16 import com.yohoufo.order.model.dto.BuyerPenaltyCalResult; 16 import com.yohoufo.order.model.dto.BuyerPenaltyCalResult;
17 -import com.yohoufo.order.model.response.OrderDetailInfo; 17 +import com.yohobuy.ufo.model.order.resp.OrderDetailInfo;
18 import com.yohoufo.order.service.handler.BuyerCancelCompensateComputeHandler; 18 import com.yohoufo.order.service.handler.BuyerCancelCompensateComputeHandler;
19 import com.yohoufo.order.service.seller.support.SkupTypeCodeSupport; 19 import com.yohoufo.order.service.seller.support.SkupTypeCodeSupport;
20 import com.yohoufo.order.service.support.BuyerOrderButtonFormatFunction; 20 import com.yohoufo.order.service.support.BuyerOrderButtonFormatFunction;
@@ -30,7 +30,6 @@ import org.springframework.beans.factory.annotation.Autowired; @@ -30,7 +30,6 @@ import org.springframework.beans.factory.annotation.Autowired;
30 import java.util.ArrayList; 30 import java.util.ArrayList;
31 import java.util.List; 31 import java.util.List;
32 import java.util.Objects; 32 import java.util.Objects;
33 -import java.util.function.Predicate;  
34 33
35 /** 34 /**
36 * Created by chao.chen on 2018/11/26. 35 * Created by chao.chen on 2018/11/26.
@@ -6,7 +6,7 @@ import com.yoho.core.cache.LocalCacheCallback; @@ -6,7 +6,7 @@ import com.yoho.core.cache.LocalCacheCallback;
6 import com.yohobuy.ufo.model.order.constants.DepotType; 6 import com.yohobuy.ufo.model.order.constants.DepotType;
7 import com.yohoufo.dal.order.AppraiseAddressMapper; 7 import com.yohoufo.dal.order.AppraiseAddressMapper;
8 import com.yohoufo.dal.order.model.AppraiseAddress; 8 import com.yohoufo.dal.order.model.AppraiseAddress;
9 -import com.yohoufo.order.model.response.AppraiseAddressInfo; 9 +import com.yohobuy.ufo.model.order.resp.AppraiseAddressInfo;
10 import com.yohoufo.order.model.response.AppraiseAddressResp; 10 import com.yohoufo.order.model.response.AppraiseAddressResp;
11 import org.apache.commons.collections.CollectionUtils; 11 import org.apache.commons.collections.CollectionUtils;
12 import org.apache.commons.lang3.StringUtils; 12 import org.apache.commons.lang3.StringUtils;
  1 +package com.yohoufo.order.service.impl;
  2 +
  3 +import com.yohoufo.order.utils.LoggerUtils;
  4 +import org.slf4j.Logger;
  5 +import org.springframework.stereotype.Service;
  6 +
  7 +@Service
  8 +public class AppraiseOrderService {
  9 +
  10 +
  11 + private final Logger logger = LoggerUtils.getBuyerOrderLogger();
  12 +
  13 +
  14 +
  15 +
  16 +
  17 +}
@@ -19,11 +19,10 @@ import com.yohoufo.dal.order.model.BuyerOrderMeta; @@ -19,11 +19,10 @@ import com.yohoufo.dal.order.model.BuyerOrderMeta;
19 import com.yohoufo.dal.order.model.SellerOrderGoods; 19 import com.yohoufo.dal.order.model.SellerOrderGoods;
20 import com.yohoufo.order.common.ActionStatusHold; 20 import com.yohoufo.order.common.ActionStatusHold;
21 import com.yohoufo.order.model.request.OrderRequest; 21 import com.yohoufo.order.model.request.OrderRequest;
22 -import com.yohoufo.order.model.response.OrderDetailInfo; 22 +import com.yohobuy.ufo.model.order.resp.OrderDetailInfo;
23 import com.yohoufo.order.service.IOrderDetailService; 23 import com.yohoufo.order.service.IOrderDetailService;
24 import com.yohoufo.order.service.cache.OrderCacheService; 24 import com.yohoufo.order.service.cache.OrderCacheService;
25 import com.yohoufo.order.service.handler.BuyerOrderButtonsHandler; 25 import com.yohoufo.order.service.handler.BuyerOrderButtonsHandler;
26 -import com.yohoufo.order.utils.BuyerOrderUtils;  
27 import com.yohoufo.order.utils.LoggerUtils; 26 import com.yohoufo.order.utils.LoggerUtils;
28 import com.yohoufo.order.utils.OrderDetailDescHelper; 27 import com.yohoufo.order.utils.OrderDetailDescHelper;
29 import com.yohoufo.order.utils.SellerGoodsHelper; 28 import com.yohoufo.order.utils.SellerGoodsHelper;
@@ -12,7 +12,7 @@ import com.yohoufo.dal.order.model.BuyerOrder; @@ -12,7 +12,7 @@ import com.yohoufo.dal.order.model.BuyerOrder;
12 import com.yohoufo.order.model.dto.BuyerPenaltyCalResult; 12 import com.yohoufo.order.model.dto.BuyerPenaltyCalResult;
13 import com.yohoufo.order.model.request.OrderListRequest; 13 import com.yohoufo.order.model.request.OrderListRequest;
14 import com.yohoufo.order.model.request.OrderRequest; 14 import com.yohoufo.order.model.request.OrderRequest;
15 -import com.yohoufo.order.model.response.OrderDetailInfo; 15 +import com.yohobuy.ufo.model.order.resp.OrderDetailInfo;
16 import com.yohoufo.order.service.IOrderDetailService; 16 import com.yohoufo.order.service.IOrderDetailService;
17 import com.yohoufo.order.service.IOrderListService; 17 import com.yohoufo.order.service.IOrderListService;
18 import com.yohoufo.order.service.cache.OrderCacheService; 18 import com.yohoufo.order.service.cache.OrderCacheService;
@@ -23,9 +23,9 @@ import com.yohoufo.order.convert.GoodsInfoConvertor; @@ -23,9 +23,9 @@ import com.yohoufo.order.convert.GoodsInfoConvertor;
23 import com.yohoufo.order.convert.SellerOrderConvertor; 23 import com.yohoufo.order.convert.SellerOrderConvertor;
24 import com.yohoufo.order.model.dto.SellerOrderComputeResult; 24 import com.yohoufo.order.model.dto.SellerOrderComputeResult;
25 import com.yohoufo.order.model.request.OrderRequest; 25 import com.yohoufo.order.model.request.OrderRequest;
26 -import com.yohoufo.order.model.response.AppraiseAddressInfo; 26 +import com.yohobuy.ufo.model.order.resp.AppraiseAddressInfo;
27 import com.yohoufo.order.model.response.AppraiseAddressResp; 27 import com.yohoufo.order.model.response.AppraiseAddressResp;
28 -import com.yohoufo.order.model.response.OrderDetailInfo; 28 +import com.yohobuy.ufo.model.order.resp.OrderDetailInfo;
29 import com.yohoufo.order.mq.DelayTime; 29 import com.yohoufo.order.mq.DelayTime;
30 import com.yohoufo.order.service.IOrderDetailService; 30 import com.yohoufo.order.service.IOrderDetailService;
31 import com.yohoufo.order.service.cache.OrderCacheService; 31 import com.yohoufo.order.service.cache.OrderCacheService;
@@ -28,7 +28,7 @@ import com.yohoufo.order.model.SellerOrderContext; @@ -28,7 +28,7 @@ import com.yohoufo.order.model.SellerOrderContext;
28 import com.yohoufo.order.model.dto.*; 28 import com.yohoufo.order.model.dto.*;
29 import com.yohoufo.order.model.request.OrderListRequest; 29 import com.yohoufo.order.model.request.OrderListRequest;
30 import com.yohoufo.order.model.request.OrderRequest; 30 import com.yohoufo.order.model.request.OrderRequest;
31 -import com.yohoufo.order.model.response.OrderDetailInfo; 31 +import com.yohobuy.ufo.model.order.resp.OrderDetailInfo;
32 import com.yohoufo.order.model.response.OrderSubmitResp; 32 import com.yohoufo.order.model.response.OrderSubmitResp;
33 import com.yohoufo.order.mq.DelayTime; 33 import com.yohoufo.order.mq.DelayTime;
34 import com.yohoufo.order.service.IOrderDetailService; 34 import com.yohoufo.order.service.IOrderDetailService;