Authored by LUOXC

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

Showing 32 changed files with 347 additions and 64 deletions
@@ -4,7 +4,8 @@ @@ -4,7 +4,8 @@
4 # path: /gateway/common/ok.jsp 4 # path: /gateway/common/ok.jsp
5 ############################################################ 5 ############################################################
6 6
7 -FROM ccr.ccs.tencentyun.com/yoho-base/tomcat:8.5.4 7 +# FROM ccr.ccs.tencentyun.com/yoho-base/tomcat:8.5.4
  8 +FROM ccr.ccs.tencentyun.com/yoho-base/tomcat:8.5.42-jdk8-openjdk-slim-fix
8 9
9 MAINTAINER jimi <jimi.ji@yoho.cn> 10 MAINTAINER jimi <jimi.ji@yoho.cn>
10 11
@@ -51,7 +51,7 @@ public interface StorageDepositMapper { @@ -51,7 +51,7 @@ public interface StorageDepositMapper {
51 StorageDeposit selectByDepositCode(@Param("uid") int uid, @Param("depositCode")String depositCode, @Param("statusList")List<Integer> statusList); 51 StorageDeposit selectByDepositCode(@Param("uid") int uid, @Param("depositCode")String depositCode, @Param("statusList")List<Integer> statusList);
52 52
53 List<StorageDeposit> getDepositOffs(@Param("uid") Integer uid, @Param("storageId") Integer storageId, @Param("count") Integer count); 53 List<StorageDeposit> getDepositOffs(@Param("uid") Integer uid, @Param("storageId") Integer storageId, @Param("count") Integer count);
54 - int updateStorageStatus(@Param("depositCode")String depositCode, @Param("status")int status, @Param("orderStatus")int orderStatus); 54 + int updateStorageStatus(@Param("depositCode")String depositCode, @Param("status")int status, @Param("orderStatus")int orderStatus,@Param("outType")Integer outType);
55 55
56 int getUserDepositCount(@Param("uid") Integer uid); 56 int getUserDepositCount(@Param("uid") Integer uid);
57 57
@@ -347,6 +347,9 @@ @@ -347,6 +347,9 @@
347 <update id="updateStorageStatus"> 347 <update id="updateStorageStatus">
348 update storage_deposit 348 update storage_deposit
349 set status = #{status,jdbcType=INTEGER} ,update_time = unix_timestamp(now()) 349 set status = #{status,jdbcType=INTEGER} ,update_time = unix_timestamp(now())
  350 + <if test="outType != null" >
  351 + , out_type = #{outType}
  352 + </if>
350 where deposit_code = #{depositCode,jdbcType=VARCHAR} AND del_status = 0 AND order_status = #{orderStatus,jdbcType=INTEGER} 353 where deposit_code = #{depositCode,jdbcType=VARCHAR} AND del_status = 0 AND order_status = #{orderStatus,jdbcType=INTEGER}
351 </update> 354 </update>
352 355
@@ -205,7 +205,7 @@ @@ -205,7 +205,7 @@
205 storage_id in 205 storage_id in
206 <foreach item="storageId" index="index" collection="skuList" open="(" separator="," close=")"> 206 <foreach item="storageId" index="index" collection="skuList" open="(" separator="," close=")">
207 #{storageId, jdbcType=INTEGER} 207 #{storageId, jdbcType=INTEGER}
208 - </foreach> and status = 1 and is_hide = 0 and pre_sale_flag=3 and region=1 208 + </foreach> and status = 1 and is_hide = 0 and pre_sale_flag=3 and region=0
209 group by storage_id 209 group by storage_id
210 </select> 210 </select>
211 211
@@ -131,4 +131,14 @@ public class DepositController { @@ -131,4 +131,14 @@ public class DepositController {
131 depositService.clearCache(uid, productId, storageId); 131 depositService.clearCache(uid, productId, storageId);
132 return new ApiResponse(200, "缓存清除成功!", Boolean.TRUE); 132 return new ApiResponse(200, "缓存清除成功!", Boolean.TRUE);
133 } 133 }
  134 +
  135 + @RequestMapping(params = "method=ufo.deposit.clearUserDeposit")
  136 + @IgnoreSignature
  137 + @IgnoreSession
  138 + public ApiResponse clearUserDeposit(@RequestParam("uid") Integer uid,
  139 + @RequestParam("depositCode") String depositCode) {
  140 + LOG.info("in clearUserDeposit uid={}, depositCode is {}", uid, depositCode);
  141 + depositService.clearCacheByDepositCode(uid, depositCode);
  142 + return new ApiResponse(200, "缓存清除成功!", Boolean.TRUE);
  143 + }
134 } 144 }
1 package com.yohoufo.order.controller; 1 package com.yohoufo.order.controller;
2 2
3 import com.yohobuy.ufo.model.order.bo.SoldPrdComputeBo; 3 import com.yohobuy.ufo.model.order.bo.SoldPrdComputeBo;
  4 +import com.yohobuy.ufo.model.order.common.SkupListType;
4 import com.yohobuy.ufo.model.order.req.SingleGoodsChangePriceReq; 5 import com.yohobuy.ufo.model.order.req.SingleGoodsChangePriceReq;
5 import com.yohobuy.ufo.model.order.req.SellerGoodsRequest; 6 import com.yohobuy.ufo.model.order.req.SellerGoodsRequest;
6 import com.yohobuy.ufo.model.order.resp.OrderListInfo; 7 import com.yohobuy.ufo.model.order.resp.OrderListInfo;
@@ -98,6 +99,7 @@ public class SellerGoodsController { @@ -98,6 +99,7 @@ public class SellerGoodsController {
98 } 99 }
99 100
100 101
  102 +
101 /** 103 /**
102 * 入驻商家单个skn(skc)刷新 104 * 入驻商家单个skn(skc)刷新
103 * @param productId 105 * @param productId
@@ -107,10 +109,15 @@ public class SellerGoodsController { @@ -107,10 +109,15 @@ public class SellerGoodsController {
107 @RequestMapping(params = "method=ufo.sellerGoods.refresh") 109 @RequestMapping(params = "method=ufo.sellerGoods.refresh")
108 @ResponseBody 110 @ResponseBody
109 public ApiResponse refresh(@RequestParam("productId") int productId, 111 public ApiResponse refresh(@RequestParam("productId") int productId,
110 - @RequestParam("uid") int uid) {  
111 - 112 + @RequestParam("uid") int uid,
  113 + @RequestParam(value = "skupListType", required = false,
  114 + defaultValue = "1") int skupListTypeCode
  115 + ) {
  116 + SkupListType skupListType = SkupListType.getByType(skupListTypeCode);
112 SellerGoodsRequest orderRequest = SellerGoodsRequest.builder() 117 SellerGoodsRequest orderRequest = SellerGoodsRequest.builder()
113 .uid(uid).productId(productId) 118 .uid(uid).productId(productId)
  119 + .skupListType(skupListType)
  120 + .skupListTypeCode(skupListTypeCode)
114 .build(); 121 .build();
115 logger.info("in ufo.sellerGoods.refresh, req {}", orderRequest); 122 logger.info("in ufo.sellerGoods.refresh, req {}", orderRequest);
116 OrderListInfo orderListInfo = skupListService.getOrderListInfo(orderRequest); 123 OrderListInfo orderListInfo = skupListService.getOrderListInfo(orderRequest);
@@ -53,4 +53,5 @@ public class AmountDetailBo { @@ -53,4 +53,5 @@ public class AmountDetailBo {
53 53
54 private double depositAmount; 54 private double depositAmount;
55 55
  56 + private double quickDeliveServiceAmount;
56 } 57 }
@@ -200,6 +200,14 @@ public class OrderDetailInfo { @@ -200,6 +200,14 @@ public class OrderDetailInfo {
200 * 实付金额 200 * 实付金额
201 */ 201 */
202 String realPayPrice; 202 String realPayPrice;
  203 + /**
  204 + * 仓储费
  205 + */
  206 + String depositPrice;
  207 + /**
  208 + * 闪购服务费
  209 + */
  210 + String quickDeliveServicePrice;
203 } 211 }
204 212
205 213
@@ -44,7 +44,7 @@ public class DepositFinishDeliveryDelayMsgConsumer implements YhConsumer { @@ -44,7 +44,7 @@ public class DepositFinishDeliveryDelayMsgConsumer implements YhConsumer {
44 } 44 }
45 45
46 //更新寄存状态为已完成 46 //更新寄存状态为已完成
47 - storageDepositMapper.updateStorageStatus(deposit.getDepositCode(), StorageDepositStatusEnum.HAS_END.getCode(), OrderStatus.WAITING_PAY.getCode()); 47 + storageDepositMapper.updateStorageStatus(deposit.getDepositCode(), StorageDepositStatusEnum.HAS_END.getCode(), OrderStatus.WAITING_PAY.getCode(), null);
48 48
49 } 49 }
50 } 50 }
@@ -37,6 +37,7 @@ import com.yohoufo.order.service.proxy.DeliveryMinutesService; @@ -37,6 +37,7 @@ import com.yohoufo.order.service.proxy.DeliveryMinutesService;
37 import com.yohoufo.order.service.proxy.InBoxFacade; 37 import com.yohoufo.order.service.proxy.InBoxFacade;
38 import com.yohoufo.order.service.proxy.OrderStatusFlowService; 38 import com.yohoufo.order.service.proxy.OrderStatusFlowService;
39 import com.yohoufo.order.utils.BuyerOrderUtils; 39 import com.yohoufo.order.utils.BuyerOrderUtils;
  40 +import com.yohoufo.order.utils.SellerGoodsHelper;
40 import com.yohoufo.order.utils.TimeUtils; 41 import com.yohoufo.order.utils.TimeUtils;
41 import org.apache.commons.lang3.StringUtils; 42 import org.apache.commons.lang3.StringUtils;
42 import org.slf4j.Logger; 43 import org.slf4j.Logger;
@@ -96,6 +97,17 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService { @@ -96,6 +97,17 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
96 97
97 @Autowired 98 @Autowired
98 private AppraiseService appraiseService; 99 private AppraiseService appraiseService;
  100 +
  101 + private boolean isDepositWithQuickDeliverGoods(int uid, long orderCode, Integer oa){
  102 + BuyerOrderGoods pbog = buyerOrderGoodsMapper.selectOnlyByOrderCode(orderCode);
  103 + SellerOrderGoods psog = sellerOrderGoodsMapper.selectByPrimaryKey(pbog.getSkup());
  104 + Integer goodsAttr=null ;
  105 + boolean result = BuyerOrderUtils.isDeposit(oa)
  106 + && SellerGoodsHelper.isQuickDeliver(SkupType.getSkupType(goodsAttr=psog.getAttributes()));
  107 + logger.info("after paid isDepositWithQuickDeliverGoods, uid {} ordercode {} orderAttr {} goodsAttr {}",
  108 + uid, orderCode, oa, goodsAttr);
  109 + return result;
  110 + }
99 /** 111 /**
100 * 更新订单状态 112 * 更新订单状态
101 * @param orderInfo 113 * @param orderInfo
@@ -108,12 +120,19 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService { @@ -108,12 +120,19 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
108 buyerOrder.setUid(uid); 120 buyerOrder.setUid(uid);
109 OrderStatus targetOrderStatus = OrderStatus.HAS_PAYED; 121 OrderStatus targetOrderStatus = OrderStatus.HAS_PAYED;
110 boolean isQuickDeliver = false; 122 boolean isQuickDeliver = false;
  123 + boolean isDepositWithQuickDeliverGoods = false;
  124 + boolean isDerectPass = false;
  125 +
111 //门店订单支付后直接完成 126 //门店订单支付后直接完成
112 if(BuyerOrderUtils.isOffline(orderInfo) ) { 127 if(BuyerOrderUtils.isOffline(orderInfo) ) {
113 targetOrderStatus = OrderStatus.DONE; 128 targetOrderStatus = OrderStatus.DONE;
114 - }else if(isQuickDeliver=BuyerOrderUtils.isQuickDeliver(orderInfo.getAttributes())){ 129 + }else if((isQuickDeliver=BuyerOrderUtils.isQuickDeliver(orderInfo.getAttributes()))
  130 + || (isDepositWithQuickDeliverGoods = isDepositWithQuickDeliverGoods(uid, orderCode, orderInfo.getAttributes()))){
115 targetOrderStatus = OrderStatus.WAITING_RECEIVE; 131 targetOrderStatus = OrderStatus.WAITING_RECEIVE;
  132 + isDerectPass = true;
116 } 133 }
  134 + logger.info("after paid updateOrderStatusPaid uid {} orderCode {} isQuickDeliver {} isDepositWithQuickDeliverGoods {} ",
  135 + uid, orderCode, isQuickDeliver, isDepositWithQuickDeliverGoods);
117 int orderStatusCode = targetOrderStatus.getCode(); 136 int orderStatusCode = targetOrderStatus.getCode();
118 buyerOrder.setStatus(orderStatusCode); 137 buyerOrder.setStatus(orderStatusCode);
119 138
@@ -128,32 +147,45 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService { @@ -128,32 +147,45 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
128 logger.info("in updateOrderStatusPaid record status change, orderCode {}, status: {}", 147 logger.info("in updateOrderStatusPaid record status change, orderCode {}, status: {}",
129 orderCode, orderStatusCode); 148 orderCode, orderStatusCode);
130 orderStatusFlowService.addAsy(orderCode, orderStatusCode); 149 orderStatusFlowService.addAsy(orderCode, orderStatusCode);
131 - if (isQuickDeliver){  
132 - appraiseService.processQuickDeliverOrderAfterPaid(orderCode, uid); 150 + if (isDerectPass){
  151 + boolean isDepositRequired = isDepositWithQuickDeliverGoods;
  152 + appraiseService.processQuickDeliverOrderAfterPaid(orderCode, uid, isDepositRequired);
133 } 153 }
134 } 154 }
135 orderInfo.setStatus(orderStatusCode); 155 orderInfo.setStatus(orderStatusCode);
136 return result; 156 return result;
137 } 157 }
138 158
139 - private void processDepositOrder(BuyerOrder buyerOrder, SellerOrderGoods sellerOrderGoods){  
140 - //寄存订单 & 闪购商品  
141 - if (SkupType.QUICK_DELIVER.getCode() == sellerOrderGoods.getAttributes()){  
142 - Integer sellerUid = null;  
143 - Integer buyerUid = null;  
144 - Long orderCode = null;  
145 - Integer skup = null;  
146 - try {  
147 - depositService.changeOwner(sellerUid = buyerOrder.getSellerUid(), skup = sellerOrderGoods.getId(),  
148 - orderCode = buyerOrder.getOrderCode(), buyerUid = buyerOrder.getUid(), true);  
149 - }catch (Exception ex){  
150 - logger.warn("pay successful, processDepositOrder invoke depositService.changeOwner fail, sellerUid {}, buyerUid {},orderCode {},skup {}",  
151 - sellerUid, buyerUid, orderCode, skup);  
152 - }  
153 - 159 + private void processDepositOrderOfQuickDeliverGoods(BuyerOrder buyerOrder, SellerOrderGoods sellerOrderGoods){
  160 + Integer sellerUid = null;
  161 + Integer buyerUid = null;
  162 + Long orderCode = null;
  163 + Integer skup = null;
  164 + try {
  165 + depositService.changeOwner(sellerUid = buyerOrder.getSellerUid(), skup = sellerOrderGoods.getId(),
  166 + orderCode = buyerOrder.getOrderCode(), buyerUid = buyerOrder.getUid(), true);
  167 + }catch (Exception ex){
  168 + logger.warn("pay successful, processDepositOrder invoke depositService.changeOwner fail, sellerUid {}, buyerUid {},orderCode {},skup {}",
  169 + sellerUid, buyerUid, orderCode, skup);
154 } 170 }
  171 + }
  172 +
  173 + private void processDepositOrderOfInstockGoods(BuyerOrder buyerOrder, SellerOrderGoods sellerOrderGoods){
155 processInStockOrder(buyerOrder, sellerOrderGoods); 174 processInStockOrder(buyerOrder, sellerOrderGoods);
  175 + }
  176 +
156 177
  178 + private void processDepositOrder(BuyerOrder buyerOrder, SellerOrderGoods sellerOrderGoods){
  179 + SkupType skupType = SkupType.getSkupType(sellerOrderGoods.getAttributes());
  180 + //寄存订单 & 闪购商品
  181 + switch (skupType){
  182 + case QUICK_DELIVER:
  183 + processDepositOrderOfQuickDeliverGoods(buyerOrder, sellerOrderGoods);
  184 + break;
  185 + case IN_STOCK:
  186 + processDepositOrderOfInstockGoods(buyerOrder, sellerOrderGoods);
  187 + break;
  188 + }
157 } 189 }
158 190
159 private void processInStockOrder(BuyerOrder orderInfo, SellerOrderGoods sellerOrderGoods){ 191 private void processInStockOrder(BuyerOrder orderInfo, SellerOrderGoods sellerOrderGoods){
@@ -53,4 +53,18 @@ public interface DepositService { @@ -53,4 +53,18 @@ public interface DepositService {
53 DepositDetailBo convert(StorageDeposit storageDeposit); 53 DepositDetailBo convert(StorageDeposit storageDeposit);
54 54
55 List<StorageDeposit> getStorageDeposit4Publish(Integer uid, Integer storageId, int num); 55 List<StorageDeposit> getStorageDeposit4Publish(Integer uid, Integer storageId, int num);
  56 +
  57 + /**
  58 + * 通过库存码清理相关库存列表缓存
  59 + * @param uid
  60 + * @param depositCode
  61 + */
  62 + void clearCacheByDepositCode(Integer uid, String depositCode);
  63 +
  64 + /**
  65 + * 根据货号查询库存
  66 + * @param depositCode
  67 + * @return
  68 + */
  69 + StorageDeposit selectStorageDeposit(Integer uid, String depositCode);
56 } 70 }
@@ -104,6 +104,7 @@ public class BuyerPenaltyRuleSelector { @@ -104,6 +104,7 @@ public class BuyerPenaltyRuleSelector {
104 case COMMON_IN_STOCK: 104 case COMMON_IN_STOCK:
105 case FLAW: 105 case FLAW:
106 case SECOND_HAND: 106 case SECOND_HAND:
  107 + case DEPOSITE:
107 stockCaseName = "goodsInStock"; 108 stockCaseName = "goodsInStock";
108 break; 109 break;
109 case ADVANCE_SALE: 110 case ADVANCE_SALE:
@@ -40,6 +40,7 @@ import org.springframework.beans.factory.annotation.Autowired; @@ -40,6 +40,7 @@ import org.springframework.beans.factory.annotation.Autowired;
40 40
41 import java.util.ArrayList; 41 import java.util.ArrayList;
42 import java.util.List; 42 import java.util.List;
  43 +import java.util.Objects;
43 import java.util.Optional; 44 import java.util.Optional;
44 45
45 /** 46 /**
@@ -225,7 +226,7 @@ public abstract class AbsOrderDetailService extends AbsOrderViewService implemen @@ -225,7 +226,7 @@ public abstract class AbsOrderDetailService extends AbsOrderViewService implemen
225 GoodsInfo goodsInfo = getGoodsInfo(sellerOrderGoods); 226 GoodsInfo goodsInfo = getGoodsInfo(sellerOrderGoods);
226 SkupType skupType = SkupType.getSkupType(sellerOrderGoods.getAttributes()); 227 SkupType skupType = SkupType.getSkupType(sellerOrderGoods.getAttributes());
227 goodsInfo.setProductName(goodsInfo.getProductName()); 228 goodsInfo.setProductName(goodsInfo.getProductName());
228 - goodsInfo.setTypeTag(SellerGoodsHelper.buildGoodsTypeTag(skupType)); 229 + goodsInfo.setTypeTag(buildOrderTypeTag(buyerOrder.getAttributes(), skupType));
229 if(isOffline) { 230 if(isOffline) {
230 goodsInfo.setTypeTag("门店订单"); 231 goodsInfo.setTypeTag("门店订单");
231 } 232 }
@@ -267,8 +268,19 @@ public abstract class AbsOrderDetailService extends AbsOrderViewService implemen @@ -267,8 +268,19 @@ public abstract class AbsOrderDetailService extends AbsOrderViewService implemen
267 .activityCutPrice(MathUtils.formatStr(amountDetailBo.getActivityCutAmount())) 268 .activityCutPrice(MathUtils.formatStr(amountDetailBo.getActivityCutAmount()))
268 .couponCutPrice(MathUtils.formatStr(amountDetailBo.getCouponCutAmount())) 269 .couponCutPrice(MathUtils.formatStr(amountDetailBo.getCouponCutAmount()))
269 .shippingCouponCutPrice(MathUtils.formatStr(amountDetailBo.getShippingCouponCutAmount())) 270 .shippingCouponCutPrice(MathUtils.formatStr(amountDetailBo.getShippingCouponCutAmount()))
  271 +
270 .realPayPrice(buyerOrder.getAmount() == null ? "0" : buyerOrder.getAmount().toPlainString()) 272 .realPayPrice(buyerOrder.getAmount() == null ? "0" : buyerOrder.getAmount().toPlainString())
271 .build(); 273 .build();
  274 + OrderAttributes oa = OrderAttributes.getOrderAttributes(buyerOrder.getAttributes());
  275 +
  276 + if (Objects.equals(OrderAttributes.QUICK_DELIVER, oa)){
  277 + priceInfo.setQuickDeliveServicePrice(MathUtils.formatStr(amountDetailBo.getDepositAmount()));
  278 + }
  279 +
  280 + if (Objects.equals(OrderAttributes.DEPOSITE, oa)){
  281 + priceInfo.setDepositPrice(MathUtils.formatStr(amountDetailBo.getDepositAmount()));
  282 + }
  283 +
272 SkupTypeCodeSupport.CodeNode codeNode = SkupTypeCodeSupport.explain(buyerOrder.getAttributes()); 284 SkupTypeCodeSupport.CodeNode codeNode = SkupTypeCodeSupport.explain(buyerOrder.getAttributes());
273 if (codeNode.getRegion() == RegionEnum.HONGKONG.getCode()){ 285 if (codeNode.getRegion() == RegionEnum.HONGKONG.getCode()){
274 //tariff 286 //tariff
@@ -281,6 +293,7 @@ public abstract class AbsOrderDetailService extends AbsOrderViewService implemen @@ -281,6 +293,7 @@ public abstract class AbsOrderDetailService extends AbsOrderViewService implemen
281 double cutShipPrice = amountDetailBo.getShippingActivityCutAmount(); 293 double cutShipPrice = amountDetailBo.getShippingActivityCutAmount();
282 priceInfo.setShippingActivityCutPrice(MathUtils.formatStr(cutShipPrice)); 294 priceInfo.setShippingActivityCutPrice(MathUtils.formatStr(cutShipPrice));
283 } 295 }
  296 +
284 } else { 297 } else {
285 //priceInfo 298 //priceInfo
286 priceInfo = OrderDetailInfo.PriceInfo.builder() 299 priceInfo = OrderDetailInfo.PriceInfo.builder()
@@ -364,11 +364,12 @@ public abstract class AbsOrderListService extends AbsOrderViewService implements @@ -364,11 +364,12 @@ public abstract class AbsOrderListService extends AbsOrderViewService implements
364 SkupType skupType = SkupType.getSkupType(sellerOrderGoods.getAttributes()); 364 SkupType skupType = SkupType.getSkupType(sellerOrderGoods.getAttributes());
365 String goodsName = sellerOrderGoods.getProductName(); 365 String goodsName = sellerOrderGoods.getProductName();
366 goodsInfo.setProductName(goodsName); 366 goodsInfo.setProductName(goodsName);
  367 + //
367 String typeTag; 368 String typeTag;
368 if (isOffline){ 369 if (isOffline){
369 typeTag = "门店订单"; 370 typeTag = "门店订单";
370 }else{ 371 }else{
371 - typeTag = SellerGoodsHelper.buildGoodsTypeTag(skupType); 372 + typeTag = SellerGoodsHelper.buildGoodsTypeTag(BuyerOrderUtils.convertSkupTypeIfNeed(buyerOrder.getAttributes(), skupType));
372 } 373 }
373 goodsInfo.setTypeTag(typeTag); 374 goodsInfo.setTypeTag(typeTag);
374 375
@@ -7,6 +7,7 @@ import com.yohobuy.ufo.model.order.common.OrderAttributes; @@ -7,6 +7,7 @@ import com.yohobuy.ufo.model.order.common.OrderAttributes;
7 import com.yohobuy.ufo.model.order.common.OrderStatus; 7 import com.yohobuy.ufo.model.order.common.OrderStatus;
8 import com.yohobuy.ufo.model.order.common.TabType; 8 import com.yohobuy.ufo.model.order.common.TabType;
9 import com.yohobuy.ufo.model.order.constants.RegionEnum; 9 import com.yohobuy.ufo.model.order.constants.RegionEnum;
  10 +import com.yohobuy.ufo.model.order.constants.SkupType;
10 import com.yohoufo.dal.order.model.BuyerOrder; 11 import com.yohoufo.dal.order.model.BuyerOrder;
11 import com.yohobuy.ufo.model.order.common.Payment; 12 import com.yohobuy.ufo.model.order.common.Payment;
12 import com.yohoufo.dal.order.model.BuyerOrderGoods; 13 import com.yohoufo.dal.order.model.BuyerOrderGoods;
@@ -175,4 +176,6 @@ public abstract class AbsOrderViewService { @@ -175,4 +176,6 @@ public abstract class AbsOrderViewService {
175 } 176 }
176 } 177 }
177 178
  179 + protected abstract String buildOrderTypeTag(Integer orderAttr, SkupType skupType);
  180 +
178 } 181 }
@@ -15,6 +15,7 @@ import java.util.stream.Collectors; @@ -15,6 +15,7 @@ import java.util.stream.Collectors;
15 15
16 import javax.annotation.Resource; 16 import javax.annotation.Resource;
17 17
  18 +import com.yohoufo.order.service.DepositService;
18 import org.apache.commons.collections.CollectionUtils; 19 import org.apache.commons.collections.CollectionUtils;
19 import org.apache.commons.lang3.StringUtils; 20 import org.apache.commons.lang3.StringUtils;
20 import org.slf4j.Logger; 21 import org.slf4j.Logger;
@@ -266,7 +267,7 @@ public class AppraiseService { @@ -266,7 +267,7 @@ public class AppraiseService {
266 return; 267 return;
267 } 268 }
268 269
269 - int num = storageDepositMapper.updateStorageStatus(deposit.getDepositCode(), StorageDepositStatusEnum.HAS_OUT.getCode(), OrderStatus.WAITING_PAY.getCode()); 270 + int num = storageDepositMapper.updateStorageStatus(deposit.getDepositCode(), StorageDepositStatusEnum.HAS_OUT.getCode(), OrderStatus.WAITING_PAY.getCode(), null);
270 if(num > 0) { 271 if(num > 0) {
271 //发mq,延迟30天设置状态为已完成 272 //发mq,延迟30天设置状态为已完成
272 LOGGER.info("start send storageDeposit mq,topic is {}, depositCode is {}", TopicConstants.DEPOSIT_FINISH_DELIVERY, deposit.getDepositCode()); 273 LOGGER.info("start send storageDeposit mq,topic is {}, depositCode is {}", TopicConstants.DEPOSIT_FINISH_DELIVERY, deposit.getDepositCode());
@@ -1565,8 +1566,9 @@ public class AppraiseService { @@ -1565,8 +1566,9 @@ public class AppraiseService {
1565 } 1566 }
1566 } 1567 }
1567 } 1568 }
1568 -  
1569 - public void processQuickDeliverOrderAfterPaid(long orderCode,int uid){ 1569 + @Autowired
  1570 + private DepositService depositService;
  1571 + public void processQuickDeliverOrderAfterPaid(long orderCode,int uid, boolean isDeposit){
1570 BuyerOrderGoods pbog = buyerOrderGoodsMapper.selectOnlyByOrderCode(orderCode); 1572 BuyerOrderGoods pbog = buyerOrderGoodsMapper.selectOnlyByOrderCode(orderCode);
1571 BuyerOrder pbo = buyerOrderMapper.selectOnlyByOrderCode(orderCode); 1573 BuyerOrder pbo = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
1572 try { 1574 try {
@@ -1575,6 +1577,6 @@ public class AppraiseService { @@ -1575,6 +1577,6 @@ public class AppraiseService {
1575 LOGGER.warn("in processQuickDeliverOrderAfterPaid transferGoodsMoneyWhenPass fail orderCode {} uid {}", 1577 LOGGER.warn("in processQuickDeliverOrderAfterPaid transferGoodsMoneyWhenPass fail orderCode {} uid {}",
1576 orderCode, uid, ex); 1578 orderCode, uid, ex);
1577 } 1579 }
1578 - 1580 + depositService.changeOwner(pbo.getSellerUid(), pbog.getSkup(), orderCode,uid, isDeposit);
1579 } 1581 }
1580 } 1582 }
@@ -6,6 +6,7 @@ import com.yohobuy.ufo.model.order.common.OrderAttributes; @@ -6,6 +6,7 @@ import com.yohobuy.ufo.model.order.common.OrderAttributes;
6 import com.yohobuy.ufo.model.order.common.OrderStatus; 6 import com.yohobuy.ufo.model.order.common.OrderStatus;
7 import com.yohobuy.ufo.model.order.common.TabType; 7 import com.yohobuy.ufo.model.order.common.TabType;
8 import com.yohobuy.ufo.model.order.constants.OrderConstant; 8 import com.yohobuy.ufo.model.order.constants.OrderConstant;
  9 +import com.yohobuy.ufo.model.order.constants.SkupType;
9 import com.yohobuy.ufo.model.order.resp.ExpressInfoDetail; 10 import com.yohobuy.ufo.model.order.resp.ExpressInfoDetail;
10 import com.yohobuy.ufo.model.order.vo.AddressInfo; 11 import com.yohobuy.ufo.model.order.vo.AddressInfo;
11 import com.yohoufo.common.helper.ImageUrlAssist; 12 import com.yohoufo.common.helper.ImageUrlAssist;
@@ -23,7 +24,9 @@ import com.yohoufo.order.model.response.OrderDetailInfo; @@ -23,7 +24,9 @@ import com.yohoufo.order.model.response.OrderDetailInfo;
23 import com.yohoufo.order.service.IOrderDetailService; 24 import com.yohoufo.order.service.IOrderDetailService;
24 import com.yohoufo.order.service.cache.OrderCacheService; 25 import com.yohoufo.order.service.cache.OrderCacheService;
25 import com.yohoufo.order.service.handler.BuyerOrderButtonsHandler; 26 import com.yohoufo.order.service.handler.BuyerOrderButtonsHandler;
  27 +import com.yohoufo.order.utils.BuyerOrderUtils;
26 import com.yohoufo.order.utils.LoggerUtils; 28 import com.yohoufo.order.utils.LoggerUtils;
  29 +import com.yohoufo.order.utils.SellerGoodsHelper;
27 import org.apache.commons.lang3.StringUtils; 30 import org.apache.commons.lang3.StringUtils;
28 import org.slf4j.Logger; 31 import org.slf4j.Logger;
29 import org.slf4j.helpers.MessageFormatter; 32 import org.slf4j.helpers.MessageFormatter;
@@ -231,6 +234,11 @@ public class BuyerOrderDetailService extends AbsOrderDetailService implements IO @@ -231,6 +234,11 @@ public class BuyerOrderDetailService extends AbsOrderDetailService implements IO
231 return logger; 234 return logger;
232 } 235 }
233 236
  237 + @Override
  238 + protected String buildOrderTypeTag(Integer orderAttr, SkupType skupType) {
  239 + return SellerGoodsHelper.buildGoodsTypeTag(BuyerOrderUtils.convertSkupTypeIfNeed(orderAttr, skupType));
  240 + }
  241 +
234 /** 242 /**
235 * 门店订单收货人设置 243 * 门店订单收货人设置
236 * @param userAddress 244 * @param userAddress
@@ -8,6 +8,7 @@ import com.yohobuy.ufo.model.order.common.OrderAttributes; @@ -8,6 +8,7 @@ import com.yohobuy.ufo.model.order.common.OrderAttributes;
8 import com.yohobuy.ufo.model.order.common.OrderListType; 8 import com.yohobuy.ufo.model.order.common.OrderListType;
9 import com.yohobuy.ufo.model.order.common.TabType; 9 import com.yohobuy.ufo.model.order.common.TabType;
10 import com.yohobuy.ufo.model.order.constants.OrderConstant; 10 import com.yohobuy.ufo.model.order.constants.OrderConstant;
  11 +import com.yohobuy.ufo.model.order.constants.SkupType;
11 import com.yohobuy.ufo.model.order.resp.OrderListInfo; 12 import com.yohobuy.ufo.model.order.resp.OrderListInfo;
12 import com.yohobuy.ufo.model.order.resp.PageResp; 13 import com.yohobuy.ufo.model.order.resp.PageResp;
13 import com.yohobuy.ufo.model.order.vo.AddressInfo; 14 import com.yohobuy.ufo.model.order.vo.AddressInfo;
@@ -23,7 +24,9 @@ import com.yohoufo.order.model.request.OrderListRequest; @@ -23,7 +24,9 @@ import com.yohoufo.order.model.request.OrderListRequest;
23 import com.yohoufo.order.service.IBuyerOrderMetaService; 24 import com.yohoufo.order.service.IBuyerOrderMetaService;
24 import com.yohoufo.order.service.IOrderListService; 25 import com.yohoufo.order.service.IOrderListService;
25 import com.yohoufo.order.service.handler.BuyerOrderButtonsHandler; 26 import com.yohoufo.order.service.handler.BuyerOrderButtonsHandler;
  27 +import com.yohoufo.order.utils.BuyerOrderUtils;
26 import com.yohoufo.order.utils.LoggerUtils; 28 import com.yohoufo.order.utils.LoggerUtils;
  29 +import com.yohoufo.order.utils.SellerGoodsHelper;
27 import org.apache.commons.collections.CollectionUtils; 30 import org.apache.commons.collections.CollectionUtils;
28 import org.slf4j.Logger; 31 import org.slf4j.Logger;
29 import org.springframework.beans.factory.annotation.Autowired; 32 import org.springframework.beans.factory.annotation.Autowired;
@@ -170,6 +173,11 @@ public class BuyerOrderListServiceImpl extends AbsOrderListService implements IO @@ -170,6 +173,11 @@ public class BuyerOrderListServiceImpl extends AbsOrderListService implements IO
170 return logger; 173 return logger;
171 } 174 }
172 175
  176 + @Override
  177 + protected String buildOrderTypeTag(Integer orderAttr, SkupType skupType) {
  178 + return SellerGoodsHelper.buildGoodsTypeTag(BuyerOrderUtils.convertSkupTypeIfNeed(orderAttr, skupType));
  179 + }
  180 +
173 private AddressInfo getAddressInfo(int uid, long orderCode, Integer orderStauts){ 181 private AddressInfo getAddressInfo(int uid, long orderCode, Integer orderStauts){
174 if (!ActionStatusHold.buyerCanModifyAddress(orderStauts)){ 182 if (!ActionStatusHold.buyerCanModifyAddress(orderStauts)){
175 return null; 183 return null;
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject; @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
5 import com.yoho.error.ServiceError; 5 import com.yoho.error.ServiceError;
6 import com.yoho.error.exception.ServiceException; 6 import com.yoho.error.exception.ServiceException;
7 import com.yohobuy.ufo.model.order.common.*; 7 import com.yohobuy.ufo.model.order.common.*;
  8 +import com.yohobuy.ufo.model.order.constants.SkupType;
8 import com.yohobuy.ufo.model.order.req.BuyerOrderMetaUpdateReq; 9 import com.yohobuy.ufo.model.order.req.BuyerOrderMetaUpdateReq;
9 import com.yohobuy.ufo.model.order.resp.BuyerOrderNums; 10 import com.yohobuy.ufo.model.order.resp.BuyerOrderNums;
10 import com.yohobuy.ufo.model.order.resp.OrderCntResp; 11 import com.yohobuy.ufo.model.order.resp.OrderCntResp;
@@ -42,6 +43,7 @@ import com.yohoufo.order.service.proxy.ProductProxyService; @@ -42,6 +43,7 @@ import com.yohoufo.order.service.proxy.ProductProxyService;
42 import com.yohoufo.order.service.proxy.UserProxyService; 43 import com.yohoufo.order.service.proxy.UserProxyService;
43 import com.yohoufo.order.utils.BuyerOrderUtils; 44 import com.yohoufo.order.utils.BuyerOrderUtils;
44 import com.yohoufo.order.utils.LoggerUtils; 45 import com.yohoufo.order.utils.LoggerUtils;
  46 +import com.yohoufo.order.utils.SellerGoodsHelper;
45 import org.apache.commons.collections.CollectionUtils; 47 import org.apache.commons.collections.CollectionUtils;
46 import org.apache.commons.lang3.StringUtils; 48 import org.apache.commons.lang3.StringUtils;
47 import org.slf4j.Logger; 49 import org.slf4j.Logger;
@@ -351,6 +353,23 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -351,6 +353,23 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
351 orderStatusFlowService.addAsy(orderRequest.getOrderCode(),targetStatus.getCode()); 353 orderStatusFlowService.addAsy(orderRequest.getOrderCode(),targetStatus.getCode());
352 } 354 }
353 355
  356 + /**
  357 + * protect hack action
  358 + * @param buyerOrder
  359 + * @param pbog
  360 + */
  361 + private void checkCancelable(BuyerOrder buyerOrder, BuyerOrderGoods pbog){
  362 + boolean isDepositOrder = BuyerOrderUtils.isDeposit(buyerOrder);
  363 + SellerOrderGoods psog = sellerOrderGoodsMapper.selectByPrimaryKey(pbog.getSkup());
  364 + SkupType skupType = SkupType.getSkupType(psog.getAttributes());
  365 + boolean isQuickDeliverGoods = SellerGoodsHelper.isQuickDeliver(skupType);
  366 +
  367 + if (isDepositOrder && isQuickDeliverGoods){
  368 + logger.warn("checkCancelable find illegal action, uid {} orderCode {}", buyerOrder.getUid(), buyerOrder.getOrderCode());
  369 + throw new UfoServiceException(400, "闪购商品订单不允许取消");
  370 + }
  371 + }
  372 +
354 private void doCancel(OrderRequest orderRequest){ 373 private void doCancel(OrderRequest orderRequest){
355 DataNode node = checkBase(orderRequest); 374 DataNode node = checkBase(orderRequest);
356 BuyerOrder buyerOrder = node.buyerOrderInDB; 375 BuyerOrder buyerOrder = node.buyerOrderInDB;
@@ -379,6 +398,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -379,6 +398,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
379 case HAS_PAYED: 398 case HAS_PAYED:
380 BuyerOrderGoods bog = buyerOrderGoodsMapper.selectByOrderCode(orderRequest.getUid(), 399 BuyerOrderGoods bog = buyerOrderGoodsMapper.selectByOrderCode(orderRequest.getUid(),
381 orderRequest.getOrderCode()); 400 orderRequest.getOrderCode());
  401 + checkCancelable(buyerOrder, bog);
382 int skup = bog.getSkup(); 402 int skup = bog.getSkup();
383 targetStatus = OrderStatus.BUYER_CANCEL_BEFORE_SELLER_DELIVER; 403 targetStatus = OrderStatus.BUYER_CANCEL_BEFORE_SELLER_DELIVER;
384 BeforeSellerDeliverEvent bsde = BeforeSellerDeliverEvent.builder() 404 BeforeSellerDeliverEvent bsde = BeforeSellerDeliverEvent.builder()
@@ -7,20 +7,25 @@ import com.yohobuy.ufo.model.order.bo.OrderInfo; @@ -7,20 +7,25 @@ import com.yohobuy.ufo.model.order.bo.OrderInfo;
7 import com.yohobuy.ufo.model.order.common.OrderCodeType; 7 import com.yohobuy.ufo.model.order.common.OrderCodeType;
8 import com.yohobuy.ufo.model.order.common.OrderStatus; 8 import com.yohobuy.ufo.model.order.common.OrderStatus;
9 import com.yohobuy.ufo.model.order.constants.StorageDepositStatusEnum; 9 import com.yohobuy.ufo.model.order.constants.StorageDepositStatusEnum;
  10 +import com.yohoufo.dal.order.SellerOrderGoodsMapper;
10 import com.yohoufo.dal.order.model.DepositOrder; 11 import com.yohoufo.dal.order.model.DepositOrder;
11 import com.yohoufo.dal.order.model.EntrySellerRechargeOrder; 12 import com.yohoufo.dal.order.model.EntrySellerRechargeOrder;
  13 +import com.yohoufo.dal.order.model.SellerOrderGoods;
12 import com.yohoufo.dal.order.model.StorageDeposit; 14 import com.yohoufo.dal.order.model.StorageDeposit;
13 import com.yohoufo.order.model.request.PaymentRequest; 15 import com.yohoufo.order.model.request.PaymentRequest;
14 import com.yohoufo.order.model.response.PrepayResponse; 16 import com.yohoufo.order.model.response.PrepayResponse;
15 import com.yohoufo.order.service.AbstractOrderPaymentService; 17 import com.yohoufo.order.service.AbstractOrderPaymentService;
16 import com.yohoufo.order.service.DepositService; 18 import com.yohoufo.order.service.DepositService;
17 import com.yohoufo.order.service.deposit.DepositOrderService; 19 import com.yohoufo.order.service.deposit.DepositOrderService;
  20 +import com.yohoufo.order.service.proxy.InBoxFacade;
18 import org.slf4j.Logger; 21 import org.slf4j.Logger;
19 import org.slf4j.LoggerFactory; 22 import org.slf4j.LoggerFactory;
20 import org.springframework.beans.factory.annotation.Autowired; 23 import org.springframework.beans.factory.annotation.Autowired;
21 import org.springframework.stereotype.Service; 24 import org.springframework.stereotype.Service;
22 25
  26 +import javax.swing.text.html.Option;
23 import java.util.Objects; 27 import java.util.Objects;
  28 +import java.util.Optional;
24 29
25 @Service 30 @Service
26 public class DepositOrderPaymentService extends AbstractOrderPaymentService { 31 public class DepositOrderPaymentService extends AbstractOrderPaymentService {
@@ -32,6 +37,12 @@ public class DepositOrderPaymentService extends AbstractOrderPaymentService { @@ -32,6 +37,12 @@ public class DepositOrderPaymentService extends AbstractOrderPaymentService {
32 @Autowired 37 @Autowired
33 private DepositService depositService; 38 private DepositService depositService;
34 39
  40 + @Autowired
  41 + protected InBoxFacade inBoxFacade;
  42 +
  43 + @Autowired
  44 + private SellerOrderGoodsMapper sellerOrderGoodsMapper;
  45 +
35 @Override 46 @Override
36 public boolean isTimeoutCancelStatus(OrderInfo orderInfo) { 47 public boolean isTimeoutCancelStatus(OrderInfo orderInfo) {
37 return false; 48 return false;
@@ -39,6 +50,8 @@ public class DepositOrderPaymentService extends AbstractOrderPaymentService { @@ -39,6 +50,8 @@ public class DepositOrderPaymentService extends AbstractOrderPaymentService {
39 50
40 @Override 51 @Override
41 public OrderInfo getOrderInfo(long orderCode, int uid) { 52 public OrderInfo getOrderInfo(long orderCode, int uid) {
  53 + logger.info("【{}】DepositOrderPaymentService.getOrderInfo execute, uid is {}", orderCode, uid);
  54 +
42 DepositOrder order = depositOrderService.selectByOrderCodeUid(orderCode, uid); 55 DepositOrder order = depositOrderService.selectByOrderCodeUid(orderCode, uid);
43 56
44 if (order == null){ 57 if (order == null){
@@ -68,6 +81,8 @@ public class DepositOrderPaymentService extends AbstractOrderPaymentService { @@ -68,6 +81,8 @@ public class DepositOrderPaymentService extends AbstractOrderPaymentService {
68 81
69 @Override 82 @Override
70 public void checkOrderStatus(OrderInfo orderInfo) { 83 public void checkOrderStatus(OrderInfo orderInfo) {
  84 + logger.info("【{}】DepositOrderPaymentService.checkOrderStatus execute, orderInfo is {}", orderInfo.getOrderCode(), orderInfo);
  85 +
71 // 订单不是未付款的状态 86 // 订单不是未付款的状态
72 if (orderInfo.getStatus() == null || orderInfo.getStatus().intValue() != OrderStatus.WAITING_PAY.getCode()){ 87 if (orderInfo.getStatus() == null || orderInfo.getStatus().intValue() != OrderStatus.WAITING_PAY.getCode()){
73 logger.warn("payment status not allow {}, orderCode is {}, uid is {}", orderInfo.getStatus(), 88 logger.warn("payment status not allow {}, orderCode is {}, uid is {}", orderInfo.getStatus(),
@@ -78,6 +93,8 @@ public class DepositOrderPaymentService extends AbstractOrderPaymentService { @@ -78,6 +93,8 @@ public class DepositOrderPaymentService extends AbstractOrderPaymentService {
78 93
79 @Override 94 @Override
80 public void updatePayment(OrderInfo orderInfo, int payment) { 95 public void updatePayment(OrderInfo orderInfo, int payment) {
  96 + logger.info("【{}】DepositOrderPaymentService.updatePayment execute, orderInfo is {}, payment is {}", orderInfo.getOrderCode(), orderInfo, payment);
  97 +
81 DepositOrder order = DepositOrder.builder().orderCode(orderInfo.getOrderCode()).uid(orderInfo.getUid()) 98 DepositOrder order = DepositOrder.builder().orderCode(orderInfo.getOrderCode()).uid(orderInfo.getUid())
82 .payment(payment).updateTime(DateUtil.getCurrentTimeSecond()).build(); 99 .payment(payment).updateTime(DateUtil.getCurrentTimeSecond()).build();
83 depositOrderService.updateByOrderCode(order); 100 depositOrderService.updateByOrderCode(order);
@@ -115,6 +132,8 @@ public class DepositOrderPaymentService extends AbstractOrderPaymentService { @@ -115,6 +132,8 @@ public class DepositOrderPaymentService extends AbstractOrderPaymentService {
115 132
116 @Override 133 @Override
117 public int updateOrderStatusPaid(OrderInfo orderInfo) { 134 public int updateOrderStatusPaid(OrderInfo orderInfo) {
  135 + logger.info("【{}】DepositOrderPaymentService.updateOrderStatusPaid execute, orderInfo is {}", orderInfo.getOrderCode(), orderInfo);
  136 +
118 DepositOrder order = DepositOrder.builder().orderCode(orderInfo.getOrderCode()).initStatus(OrderStatus.WAITING_PAY.getCode()) 137 DepositOrder order = DepositOrder.builder().orderCode(orderInfo.getOrderCode()).initStatus(OrderStatus.WAITING_PAY.getCode())
119 .status(OrderStatus.HAS_PAYED.getCode()).updateTime(DateUtil.getCurrentTimeSecond()).build(); 138 .status(OrderStatus.HAS_PAYED.getCode()).updateTime(DateUtil.getCurrentTimeSecond()).build();
120 139
@@ -129,6 +148,8 @@ public class DepositOrderPaymentService extends AbstractOrderPaymentService { @@ -129,6 +148,8 @@ public class DepositOrderPaymentService extends AbstractOrderPaymentService {
129 */ 148 */
130 @Override 149 @Override
131 public void processAfterPay(OrderInfo orderInfo) { 150 public void processAfterPay(OrderInfo orderInfo) {
  151 + logger.info("【{}】DepositOrderPaymentService.processAfterPay execute, orderInfo is {}", orderInfo.getOrderCode(), orderInfo);
  152 +
132 DepositOrder depositOrder = depositOrderService.selectByOrderCode(orderInfo.getOrderCode()); 153 DepositOrder depositOrder = depositOrderService.selectByOrderCode(orderInfo.getOrderCode());
133 154
134 if (Objects.isNull(depositOrder)) { 155 if (Objects.isNull(depositOrder)) {
@@ -141,6 +162,19 @@ public class DepositOrderPaymentService extends AbstractOrderPaymentService { @@ -141,6 +162,19 @@ public class DepositOrderPaymentService extends AbstractOrderPaymentService {
141 if (result != 1) { 162 if (result != 1) {
142 logger.error("depositService.changeStorageStatus find wrong, depositCode is {}, result is {}", depositOrder.getDepositCode(), result); 163 logger.error("depositService.changeStorageStatus find wrong, depositCode is {}, result is {}", depositOrder.getDepositCode(), result);
143 return; 164 return;
  165 + } else {
  166 + try {
  167 + logger.info("depositService.notify begin, orderInfo is {}", orderInfo);
  168 +
  169 + StorageDeposit deposit = depositService.selectStorageDeposit(depositOrder.getUid(), depositOrder.getDepositCode());
  170 +
  171 + SellerOrderGoods psog = Optional.ofNullable(deposit).map(StorageDeposit::getSkup)
  172 + .map(sellerOrderGoodsMapper::selectByPrimaryKey).orElse(null);
  173 +
  174 + inBoxFacade.recallDepositnotify(deposit.getOwnerUid(), psog); // 更新待拣货状态成功后,发通知
  175 + } catch (Exception e) {
  176 + logger.error("depositService.notify find wrong, orderInfo is {}", orderInfo);
  177 + }
144 } 178 }
145 } 179 }
146 180
@@ -5,6 +5,7 @@ import com.yohobuy.ufo.model.order.bo.ButtonShowBo; @@ -5,6 +5,7 @@ import com.yohobuy.ufo.model.order.bo.ButtonShowBo;
5 import com.yohobuy.ufo.model.order.bo.DepositDetailBo; 5 import com.yohobuy.ufo.model.order.bo.DepositDetailBo;
6 import com.yohobuy.ufo.model.order.bo.DepositProductBo; 6 import com.yohobuy.ufo.model.order.bo.DepositProductBo;
7 import com.yohobuy.ufo.model.order.constants.DepositOrderStatusEnum; 7 import com.yohobuy.ufo.model.order.constants.DepositOrderStatusEnum;
  8 +import com.yohobuy.ufo.model.order.constants.DepositOutTypeEnum;
8 import com.yohobuy.ufo.model.order.constants.StorageDepositStatusEnum; 9 import com.yohobuy.ufo.model.order.constants.StorageDepositStatusEnum;
9 import com.yohobuy.ufo.model.order.resp.PageResp; 10 import com.yohobuy.ufo.model.order.resp.PageResp;
10 import com.yohoufo.common.ApiResponse; 11 import com.yohoufo.common.ApiResponse;
@@ -12,8 +13,10 @@ import com.yohoufo.common.cache.ControllerCacheAop; @@ -12,8 +13,10 @@ import com.yohoufo.common.cache.ControllerCacheAop;
12 import com.yohoufo.common.caller.UfoServiceCaller; 13 import com.yohoufo.common.caller.UfoServiceCaller;
13 import com.yohoufo.common.exception.UfoServiceException; 14 import com.yohoufo.common.exception.UfoServiceException;
14 import com.yohoufo.common.helper.ImageUrlAssist; 15 import com.yohoufo.common.helper.ImageUrlAssist;
  16 +import com.yohoufo.dal.order.BuyerOrderMapper;
15 import com.yohoufo.dal.order.SellerOrderGoodsMapper; 17 import com.yohoufo.dal.order.SellerOrderGoodsMapper;
16 import com.yohoufo.dal.order.StorageDepositMapper; 18 import com.yohoufo.dal.order.StorageDepositMapper;
  19 +import com.yohoufo.dal.order.model.BuyerOrder;
17 import com.yohoufo.dal.order.model.SellerOrderGoods; 20 import com.yohoufo.dal.order.model.SellerOrderGoods;
18 import com.yohoufo.dal.order.model.StorageDeposit; 21 import com.yohoufo.dal.order.model.StorageDeposit;
19 import com.yohoufo.dal.order.model.StorageDepositCount; 22 import com.yohoufo.dal.order.model.StorageDepositCount;
@@ -51,6 +54,9 @@ public class DepositServiceImpl implements DepositService { @@ -51,6 +54,9 @@ public class DepositServiceImpl implements DepositService {
51 private SellerOrderGoodsMapper sellerOrderGoodsMapper; 54 private SellerOrderGoodsMapper sellerOrderGoodsMapper;
52 55
53 @Autowired 56 @Autowired
  57 + private BuyerOrderMapper buyerOrderMapper;
  58 +
  59 + @Autowired
54 private UfoServiceCaller ufoServiceCaller; 60 private UfoServiceCaller ufoServiceCaller;
55 61
56 private static final int DEPOSIT_MAX_TIME = 45 * 24 * 60 * 60; 62 private static final int DEPOSIT_MAX_TIME = 45 * 24 * 60 * 60;
@@ -85,7 +91,7 @@ public class DepositServiceImpl implements DepositService { @@ -85,7 +91,7 @@ public class DepositServiceImpl implements DepositService {
85 if (countInfo != null) { 91 if (countInfo != null) {
86 bo.setSizeCount(countInfo.getStorageIdCount()); 92 bo.setSizeCount(countInfo.getStorageIdCount());
87 bo.setStorageCount(countInfo.getStorageCount()); 93 bo.setStorageCount(countInfo.getStorageCount());
88 - bo.setShelfStatus(countInfo.getStorageIdCount() == 0 ? "全部已上架" : ("有" + countInfo.getStorageIdCount() + "件未上架")); 94 + bo.setShelfStatus(countInfo.getUnShelfStorageCount() == 0 ? "全部已上架" : ("有" + countInfo.getUnShelfStorageCount() + "件未上架"));
89 } 95 }
90 result.add(bo); 96 result.add(bo);
91 } 97 }
@@ -106,6 +112,8 @@ public class DepositServiceImpl implements DepositService { @@ -106,6 +112,8 @@ public class DepositServiceImpl implements DepositService {
106 } 112 }
107 // 召回或者到期退回的 113 // 召回或者到期退回的
108 List<StorageDeposit> depositList = storageDepositMapper.queryUserDopositBack(uid, (page - 1) * limit, limit); 114 List<StorageDeposit> depositList = storageDepositMapper.queryUserDopositBack(uid, (page - 1) * limit, limit);
  115 + List<BuyerOrder> buyerGoodsList = buyerOrderMapper.selectByOrderCodes(depositList.stream().map(StorageDeposit::getOrderCode).collect(Collectors.toList()), null);
  116 + Map<Long, BuyerOrder> buyerGoodsMap = buyerGoodsList.stream().map(Function.identity()).collect(Collectors.toMap(BuyerOrder::getOrderCode, Function.identity()));
109 List<Integer> skupList = depositList.stream().map(StorageDeposit::getSkup).collect(Collectors.toList()); 117 List<Integer> skupList = depositList.stream().map(StorageDeposit::getSkup).collect(Collectors.toList());
110 List<SellerOrderGoods> goodsList = sellerOrderGoodsMapper.selectBySkups(skupList); 118 List<SellerOrderGoods> goodsList = sellerOrderGoodsMapper.selectBySkups(skupList);
111 Map<Integer, SellerOrderGoods> goodsMap = goodsList.stream().map(Function.identity()).collect(Collectors.toMap(SellerOrderGoods::getId, Function.identity())); 119 Map<Integer, SellerOrderGoods> goodsMap = goodsList.stream().map(Function.identity()).collect(Collectors.toMap(SellerOrderGoods::getId, Function.identity()));
@@ -119,7 +127,10 @@ public class DepositServiceImpl implements DepositService { @@ -119,7 +127,10 @@ public class DepositServiceImpl implements DepositService {
119 bo.setColorName(goods.getColorName()); 127 bo.setColorName(goods.getColorName());
120 bo.setSizeName(goods.getSizeName()); 128 bo.setSizeName(goods.getSizeName());
121 bo.setPic(ImageUrlAssist.getAllProductPicUrl(goods.getImageUrl(), "goodsimg", "center", "d2hpdGU=")); 129 bo.setPic(ImageUrlAssist.getAllProductPicUrl(goods.getImageUrl(), "goodsimg", "center", "d2hpdGU="));
122 - bo.setPrice(goods.getGoodsPrice().toString()); 130 + BuyerOrder buyerOrder = buyerGoodsMap.get(buyerGoodsMap.get(depo.getOrderCode()));
  131 + if (buyerOrder != null) {
  132 + bo.setPrice(buyerOrder.getAmount().toString());
  133 + }
123 bo.setDepositStatusName(getBackStatusName(depo.getStatus())); 134 bo.setDepositStatusName(getBackStatusName(depo.getStatus()));
124 bo.setDepositCode(depo.getDepositCode()); 135 bo.setDepositCode(depo.getDepositCode());
125 } 136 }
@@ -166,7 +177,11 @@ public class DepositServiceImpl implements DepositService { @@ -166,7 +177,11 @@ public class DepositServiceImpl implements DepositService {
166 bo.setFlashMinPrice(least == null ? "" : least.toString()); 177 bo.setFlashMinPrice(least == null ? "" : least.toString());
167 bo.setDepositCode(depo.getDepositCode()); 178 bo.setDepositCode(depo.getDepositCode());
168 } 179 }
169 - bo.setButtons(Arrays.asList(ButtonShowBo.back(), /*ButtonShowBo.addDepositDays(),*/ depo.getOrderStatus() == 0 ? ButtonShowBo.grounding() : ButtonShowBo.detail("详情"))); 180 + if(depo.getOrderStatus() == 0) {
  181 + bo.setButtons(Arrays.asList(ButtonShowBo.back(), /*ButtonShowBo.addDepositDays(),*/ depo.getOrderStatus() == 0 ? ButtonShowBo.grounding() : ButtonShowBo.detail("详情")));
  182 + } else {
  183 + bo.setButtons(Arrays.asList(/*ButtonShowBo.addDepositDays(),*/ depo.getOrderStatus() == 0 ? ButtonShowBo.grounding() : ButtonShowBo.detail("详情")));
  184 + }
170 result.add(bo); 185 result.add(bo);
171 } 186 }
172 PageResp resp = new PageResp(); 187 PageResp resp = new PageResp();
@@ -312,11 +327,13 @@ public class DepositServiceImpl implements DepositService { @@ -312,11 +327,13 @@ public class DepositServiceImpl implements DepositService {
312 public int changeStorageStatus(String depositCode, int status, int orderStatus, int uid) { 327 public int changeStorageStatus(String depositCode, int status, int orderStatus, int uid) {
313 try { 328 try {
314 ufoServiceCaller.call("ufo.deposit.clearOrderCache", uid, depositCode); // 清理库存详情缓存 329 ufoServiceCaller.call("ufo.deposit.clearOrderCache", uid, depositCode); // 清理库存详情缓存
  330 +
  331 + ufoServiceCaller.call("ufo.deposit.clearUserDeposit", uid, depositCode); // 清理库存列表缓存
315 } catch (Exception e) { 332 } catch (Exception e) {
316 LOGGER.warn("clearOrderCache execute wrong, depositCode is {}", depositCode); 333 LOGGER.warn("clearOrderCache execute wrong, depositCode is {}", depositCode);
317 } 334 }
318 335
319 - return storageDepositMapper.updateStorageStatus(depositCode, status, orderStatus); 336 + return storageDepositMapper.updateStorageStatus(depositCode, status, orderStatus, DepositOutTypeEnum.OUTTYPE_FLASH_PURCHASE.getCode());
320 } 337 }
321 338
322 public void clearCache(Integer uid, Integer productId, Integer storageId) { 339 public void clearCache(Integer uid, Integer productId, Integer storageId) {
@@ -347,6 +364,28 @@ public class DepositServiceImpl implements DepositService { @@ -347,6 +364,28 @@ public class DepositServiceImpl implements DepositService {
347 } 364 }
348 } 365 }
349 366
  367 + public void clearCacheByDepositCode(Integer uid, String depositCode) {
  368 + if (uid == null) {
  369 + return;
  370 + }
  371 +
  372 + StorageDeposit storageDeposit = storageDepositMapper.queryByDepositCode(uid, depositCode);
  373 + if (null == storageDeposit) {
  374 + return;
  375 + }
  376 +
  377 + clearCache(uid, storageDeposit.getProductId(), storageDeposit.getStorageId());
  378 + }
  379 +
  380 + /**
  381 + * 根据货号查询库存
  382 + * @param depositCode
  383 + * @return
  384 + */
  385 + public StorageDeposit selectStorageDeposit(Integer uid, String depositCode) {
  386 + return storageDepositMapper.queryByDepositCode(uid, depositCode);
  387 + }
  388 +
350 /** 389 /**
351 * Do 转 Vo 390 * Do 转 Vo
352 * @param storageDeposit 391 * @param storageDeposit
@@ -533,5 +533,10 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I @@ -533,5 +533,10 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
533 return logger; 533 return logger;
534 } 534 }
535 535
  536 + @Override
  537 + protected String buildOrderTypeTag(Integer orderAttr, SkupType skupType) {
  538 + return SellerGoodsHelper.buildGoodsTypeTag(skupType);
  539 + }
  540 +
536 541
537 } 542 }
@@ -380,4 +380,9 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde @@ -380,4 +380,9 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde
380 return log; 380 return log;
381 } 381 }
382 382
  383 + @Override
  384 + protected String buildOrderTypeTag(Integer orderAttr, SkupType skupType) {
  385 + return SellerGoodsHelper.buildGoodsTypeTag(skupType);
  386 + }
  387 +
383 } 388 }
@@ -283,7 +283,7 @@ public class ShoppingServiceImpl implements IShoppingService { @@ -283,7 +283,7 @@ public class ShoppingServiceImpl implements IShoppingService {
283 //急速商品 非寄存 283 //急速商品 非寄存
284 if (!depositChoose && SkupType.QUICK_DELIVER.equals(skupType)){ 284 if (!depositChoose && SkupType.QUICK_DELIVER.equals(skupType)){
285 FeeNRate feeNRate = feeNRateFunc.apply(skupType); 285 FeeNRate feeNRate = feeNRateFunc.apply(skupType);
286 - quickDeliverServiceFee = feeNRate.getStorageManagementFee(); 286 + quickDeliverServiceFee = feeNRate.getQuickDeliverServiceFee();
287 } 287 }
288 288
289 //现货 or 闪购 商品,且选择了寄存 289 //现货 or 闪购 商品,且选择了寄存
@@ -497,6 +497,7 @@ public class ShoppingServiceImpl implements IShoppingService { @@ -497,6 +497,7 @@ public class ShoppingServiceImpl implements IShoppingService {
497 .activityBo(buildOrderActivityBo(chargeResult)) 497 .activityBo(buildOrderActivityBo(chargeResult))
498 .amountDetailBo(buildOrderAmountDetailBo(chargeResult)) 498 .amountDetailBo(buildOrderAmountDetailBo(chargeResult))
499 .tariffFee(chargeResult.getTariffFee()) 499 .tariffFee(chargeResult.getTariffFee())
  500 + .depositFee(buildDepositFee(chargeGoods))
500 .build(); 501 .build();
501 502
502 BuyerOrderSubmitResult submitResult = ordeCreationService.doSubmitOrder(orderBuilder); 503 BuyerOrderSubmitResult submitResult = ordeCreationService.doSubmitOrder(orderBuilder);
@@ -545,6 +546,20 @@ public class ShoppingServiceImpl implements IShoppingService { @@ -545,6 +546,20 @@ public class ShoppingServiceImpl implements IShoppingService {
545 546
546 } 547 }
547 548
  549 + private SingleFeeDetail buildDepositFee(ChargeGoods chargeGoods){
  550 + BigDecimal qdsf = chargeGoods.getQuickDeliverServiceFee();
  551 + BigDecimal smf = chargeGoods.getStorageManagementFee();
  552 + double amount = 0D;
  553 + if (Objects.nonNull(qdsf)){
  554 + amount = qdsf.doubleValue();
  555 + }
  556 + if (Objects.nonNull(smf)){
  557 + amount = smf.doubleValue();
  558 + }
  559 + SingleFeeDetail sfd = SingleFeeDetail.builder().amount(amount).build();
  560 + return sfd;
  561 + }
  562 +
548 public static final String KEY_AREA_STR = "区"; 563 public static final String KEY_AREA_STR = "区";
549 564
550 public static final String[] REPLACE_STR = {"鉴定中心", "UFO"}; 565 public static final String[] REPLACE_STR = {"鉴定中心", "UFO"};
@@ -680,6 +695,10 @@ public class ShoppingServiceImpl implements IShoppingService { @@ -680,6 +695,10 @@ public class ShoppingServiceImpl implements IShoppingService {
680 amountDetailBo.setDepositAmount(depositFee.getAmount()); 695 amountDetailBo.setDepositAmount(depositFee.getAmount());
681 } 696 }
682 697
  698 + SingleFeeDetail quickDeliveFee = chargeResult.getQuickDeliverServiceFee();
  699 + if (Objects.nonNull(quickDeliveFee)){
  700 + amountDetailBo.setQuickDeliveServiceAmount(quickDeliveFee.getAmount());
  701 + }
683 //活动券减免金额 702 //活动券减免金额
684 chargeResult.getCouponPayResultList().getCouponPayResultByCouponType(CouponTypeEnum.ACTIVITY_COUPON.getCode()). 703 chargeResult.getCouponPayResultList().getCouponPayResultByCouponType(CouponTypeEnum.ACTIVITY_COUPON.getCode()).
685 ifPresent(tempPayResult -> amountDetailBo.setCouponCutAmount(tempPayResult.getCouponAmount())); 704 ifPresent(tempPayResult -> amountDetailBo.setCouponCutAmount(tempPayResult.getCouponAmount()));
@@ -55,14 +55,6 @@ public class SkupListService { @@ -55,14 +55,6 @@ public class SkupListService {
55 55
56 private final Logger logger = LoggerUtils.getSellerOrderLogger(); 56 private final Logger logger = LoggerUtils.getSellerOrderLogger();
57 57
58 - final static List<Integer> NORMAL_SKUPTYPES = Lists.newArrayList(SkupType.IN_STOCK.prdAttributes().getCode(),  
59 - SkupType.ADVANCE.prdAttributes().getCode()),  
60 -  
61 - ENTRY_SKUP_TYPES = Lists.newArrayList(SkupType.IN_STOCK.prdAttributes().getCode(),  
62 - SkupType.ADVANCE.prdAttributes().getCode(),SkupType.HK_IN_STOCK.prdAttributes().getCode())  
63 - ;  
64 -  
65 -  
66 58
67 final static List<Integer> IMPERFECT_SKUPTYPES = Lists.newArrayList(SkupType.FLAW.getCode(), SkupType.SECOND_HAND.getCode()); 59 final static List<Integer> IMPERFECT_SKUPTYPES = Lists.newArrayList(SkupType.FLAW.getCode(), SkupType.SECOND_HAND.getCode());
68 60
@@ -156,11 +148,12 @@ public class SkupListService { @@ -156,11 +148,12 @@ public class SkupListService {
156 logger.warn("getEntryGoodsList user is not entry, req {}", request); 148 logger.warn("getEntryGoodsList user is not entry, req {}", request);
157 return respBuilder.build(); 149 return respBuilder.build();
158 } 150 }
  151 + SkupListType skupListType = SkupListType.ENTIRELY_NEW;
159 int type; 152 int type;
160 if ((type=request.getType()) == SellerOrderListType.IN_SALE.getType()) { 153 if ((type=request.getType()) == SellerOrderListType.IN_SALE.getType()) {
161 SkupStatus viewableStatus = SkupStatus.CAN_SELL; 154 SkupStatus viewableStatus = SkupStatus.CAN_SELL;
162 List<Integer> statusList = Arrays.asList(viewableStatus.getCode()); 155 List<Integer> statusList = Arrays.asList(viewableStatus.getCode());
163 - final List<Integer> skupTypeCodes = ENTRY_SKUP_TYPES; 156 + final List<Integer> skupTypeCodes = skupListType.getSkupTypeCodes(isEntry);
164 int total = sellerOrderGoodsViewMapper.selectEntryCntByUidStatusGBSkc(uid, statusList, skupTypeCodes); 157 int total = sellerOrderGoodsViewMapper.selectEntryCntByUidStatusGBSkc(uid, statusList, skupTypeCodes);
165 respBuilder.total(total) 158 respBuilder.total(total)
166 .pagetotal((total % limit == 0) ? (total / limit) : (total / limit + 1)); 159 .pagetotal((total % limit == 0) ? (total / limit) : (total / limit + 1));
@@ -196,8 +189,9 @@ public class SkupListService { @@ -196,8 +189,9 @@ public class SkupListService {
196 .pageSize(limit); 189 .pageSize(limit);
197 int type; 190 int type;
198 if ((type=request.getType()) == SellerOrderListType.IN_SALE.getType()){ 191 if ((type=request.getType()) == SellerOrderListType.IN_SALE.getType()){
  192 + SkupListType skupListType = SkupListType.ENTIRELY_NEW;
199 List<Integer> statusList = sellerOrderListService.initOrderListRequest(request); 193 List<Integer> statusList = sellerOrderListService.initOrderListRequest(request);
200 - List<Integer> skupTypesCondition = NORMAL_SKUPTYPES; 194 + List<Integer> skupTypesCondition = skupListType.getSkupTypeCodes(false);
201 int total = sellerOrderGoodsViewMapper.selectNotEntryCntByUidStatus(request.getUid(), statusList, skupTypesCondition); 195 int total = sellerOrderGoodsViewMapper.selectNotEntryCntByUidStatus(request.getUid(), statusList, skupTypesCondition);
202 respBuilder = PageResp.builder() 196 respBuilder = PageResp.builder()
203 .page(request.getPage()) 197 .page(request.getPage())
@@ -243,13 +237,13 @@ public class SkupListService { @@ -243,13 +237,13 @@ public class SkupListService {
243 logger.warn("getQuickDeliverGoodsSizeList not entry seller, req {}", request); 237 logger.warn("getQuickDeliverGoodsSizeList not entry seller, req {}", request);
244 return respBuilder.build(); 238 return respBuilder.build();
245 } 239 }
246 - 240 + final SkupListType skupListType = SkupListType.ENTIRELY_NEW;
247 Integer productId; 241 Integer productId;
248 SellerOrderGoods sogCondition = new SellerOrderGoods(); 242 SellerOrderGoods sogCondition = new SellerOrderGoods();
249 sogCondition.setProductId(productId=request.getProductId()); 243 sogCondition.setProductId(productId=request.getProductId());
250 sogCondition.setUid(uid); 244 sogCondition.setUid(uid);
251 sogCondition.setStatus(status); 245 sogCondition.setStatus(status);
252 - final List<Integer> skupTypeCodes = ENTRY_SKUP_TYPES; 246 + final List<Integer> skupTypeCodes = skupListType.getSkupTypeCodes(isEntry);
253 // 247 //
254 int total = sellerOrderGoodsViewMapper.selectEntryCntByUidStatusGBSku(sogCondition, skupTypeCodes, isEntry); 248 int total = sellerOrderGoodsViewMapper.selectEntryCntByUidStatusGBSku(sogCondition, skupTypeCodes, isEntry);
255 respBuilder.total(total); 249 respBuilder.total(total);
@@ -334,6 +328,7 @@ public class SkupListService { @@ -334,6 +328,7 @@ public class SkupListService {
334 328
335 private PrdOverPriceDTO getPrdOverPriceDTO(Integer uid, 329 private PrdOverPriceDTO getPrdOverPriceDTO(Integer uid,
336 Integer productId, SkupStatus skupStatus){ 330 Integer productId, SkupStatus skupStatus){
  331 + SkupListType skupListType = SkupListType.ENTIRELY_NEW;
337 PrdOverPriceDTO popDTO = new PrdOverPriceDTO(); 332 PrdOverPriceDTO popDTO = new PrdOverPriceDTO();
338 popDTO.setProductId(productId); 333 popDTO.setProductId(productId);
339 Integer status = skupStatus.getCode(); 334 Integer status = skupStatus.getCode();
@@ -343,7 +338,7 @@ public class SkupListService { @@ -343,7 +338,7 @@ public class SkupListService {
343 sogCondition.setProductId(productId); 338 sogCondition.setProductId(productId);
344 sogCondition.setUid(uid); 339 sogCondition.setUid(uid);
345 sogCondition.setStatus(status); 340 sogCondition.setStatus(status);
346 - List<Integer> skupTypesCondition = NORMAL_SKUPTYPES; 341 + List<Integer> skupTypesCondition = skupListType.getSkupTypeCodes(false);
347 // 342 //
348 int total = sellerOrderGoodsViewMapper.selectEntryCntByUidStatusGBSku(sogCondition, skupTypesCondition, true); 343 int total = sellerOrderGoodsViewMapper.selectEntryCntByUidStatusGBSku(sogCondition, skupTypesCondition, true);
349 if (total == 0){ 344 if (total == 0){
@@ -490,7 +485,8 @@ public class SkupListService { @@ -490,7 +485,8 @@ public class SkupListService {
490 * @return 485 * @return
491 */ 486 */
492 public OrderListInfo getOrderListInfo(SellerGoodsRequest req){ 487 public OrderListInfo getOrderListInfo(SellerGoodsRequest req){
493 - List<Integer> skupTypeCodes = ENTRY_SKUP_TYPES; 488 + SkupListType skupListType = SkupListType.ENTIRELY_NEW;
  489 + List<Integer> skupTypeCodes = skupListType.getSkupTypeCodes(true);
494 SkupStatus ss = SkupStatus.CAN_SELL; 490 SkupStatus ss = SkupStatus.CAN_SELL;
495 Integer status = ss.getCode(); 491 Integer status = ss.getCode();
496 Integer uid = req.getUid(); 492 Integer uid = req.getUid();
@@ -1789,6 +1789,41 @@ public class InBoxFacade { @@ -1789,6 +1789,41 @@ public class InBoxFacade {
1789 } 1789 }
1790 } 1790 }
1791 1791
  1792 + // 召回的
  1793 + public void recallDepositnotify(int uid, SellerOrderGoods sog) {
  1794 + if (null == sog) {
  1795 + logger.warn("InBoxFacade recallDepositnotify error SellerOrderGoods is null, uid {}", uid);
  1796 + return;
  1797 + }
  1798 + String prdName = sog.getProductName();
  1799 + String sizeName = sog.getSizeName();
  1800 + try {
  1801 + executorService.execute(()->{
  1802 + Product product = productMapper.selectByPrimaryKey(sog.getProductId());
  1803 + String productCode = product.getProductCode();
  1804 +
  1805 + InboxBusinessTypeEnum ibtOfSeller = InboxBusinessTypeEnum.NOTICE_SELLER_DEPOSIT_RECALL;
  1806 + String paramsOfSeller = buildParams(prdName, sizeName,productCode);
  1807 + InboxReqVO reqOfSeller = buildInboxReqVO(uid, paramsOfSeller, ibtOfSeller);
  1808 + InBoxResponse respOfSeller = inBoxSDK.addInbox(reqOfSeller);
  1809 + logger.info("record recallDepositnotify to seller inbox msg, uid {}, sog {} resp {}",
  1810 + uid, sog, respOfSeller);
  1811 +
  1812 + String phone = userProxyService.getMobile(uid);
  1813 + if (StringUtils.isBlank(phone)){
  1814 + logger.warn("in recallDepositnotify sms fail, uid {} sog {}", uid, sog);
  1815 + return;
  1816 + }
  1817 + List<String> mobileList = Arrays.asList(phone);
  1818 + String content= getReplacedContent(InboxBusinessTypeEnum.SMS_NOTIFY_SELLER_DEPOSIT_RECALL.getContent(),prdName, sizeName, productCode);
  1819 + sendSmsService.smsSendByMobile(content,mobileList);
  1820 + logger.info("record recallDepositnotify inbox sms msg, uid {}, sog {}", uid, sog);
  1821 + });
  1822 + } catch (Exception e) {
  1823 + logger.warn("InBoxFacade recallDepositnotify error inbox msg, uid {}, sog {}", uid, sog, e);
  1824 + }
  1825 + }
  1826 +
1792 public InboxReqVO buildInboxReqVO(int uid, String params, InboxBusinessTypeEnum ibt) { 1827 public InboxReqVO buildInboxReqVO(int uid, String params, InboxBusinessTypeEnum ibt) {
1793 InboxReqVO req = new InboxReqVO(); 1828 InboxReqVO req = new InboxReqVO();
1794 req.setType(ibt.getType()); 1829 req.setType(ibt.getType());
@@ -143,7 +143,7 @@ public class ProductProxyService extends AbsProxyService{ @@ -143,7 +143,7 @@ public class ProductProxyService extends AbsProxyService{
143 public Map<Integer, BigDecimal> getFlashLeastPrice(Integer productId) { 143 public Map<Integer, BigDecimal> getFlashLeastPrice(Integer productId) {
144 ProductDetailResp prdResp = null; 144 ProductDetailResp prdResp = null;
145 try { 145 try {
146 - Map<Integer, BigDecimal> result = ufoServiceCaller.call(FLASH_LEAST_PRICE, productId, null); 146 + Map<Integer, BigDecimal> result = ufoServiceCaller.call(FLASH_LEAST_PRICE, Map.class, productId);
147 return result; 147 return result;
148 } catch (Exception ex) { 148 } catch (Exception ex) {
149 logger.warn("getFlashLeastPrice err"); 149 logger.warn("getFlashLeastPrice err");
@@ -332,13 +332,13 @@ public class ProductProxyService extends AbsProxyService{ @@ -332,13 +332,13 @@ public class ProductProxyService extends AbsProxyService{
332 332
333 public static Integer buildPresaleFlag(Integer skupa){ 333 public static Integer buildPresaleFlag(Integer skupa){
334 Integer presaleFlag = null; 334 Integer presaleFlag = null;
335 - if(Objects.nonNull(skupa)) {  
336 - if (SkupType.ADVANCE.getCode() == skupa) {  
337 - presaleFlag = isAdvace;  
338 - }else{  
339 - presaleFlag = skupa;  
340 - }  
341 - 335 + if (Objects.isNull(skupa) || SkupType.IN_STOCK.getCode() == skupa){
  336 + return presaleFlag;
  337 + }
  338 + if (SkupType.ADVANCE.getCode() == skupa) {
  339 + presaleFlag = isAdvace;
  340 + }else{
  341 + presaleFlag = skupa;
342 } 342 }
343 return presaleFlag; 343 return presaleFlag;
344 } 344 }
@@ -24,6 +24,7 @@ import com.yohoufo.order.service.seller.OrderComputeHandler; @@ -24,6 +24,7 @@ import com.yohoufo.order.service.seller.OrderComputeHandler;
24 import com.yohoufo.order.service.seller.OrderComputeProvider; 24 import com.yohoufo.order.service.seller.OrderComputeProvider;
25 import com.yohoufo.order.utils.LoggerUtils; 25 import com.yohoufo.order.utils.LoggerUtils;
26 import com.yohoufo.order.utils.OrderAssist; 26 import com.yohoufo.order.utils.OrderAssist;
  27 +import com.yohoufo.order.utils.SellerGoodsHelper;
27 import org.apache.commons.collections.CollectionUtils; 28 import org.apache.commons.collections.CollectionUtils;
28 import org.slf4j.Logger; 29 import org.slf4j.Logger;
29 import org.springframework.beans.factory.annotation.Autowired; 30 import org.springframework.beans.factory.annotation.Autowired;
@@ -76,15 +77,17 @@ public abstract class AbsEntryChangePricePrepareProcessor<T extends SellerBaseCh @@ -76,15 +77,17 @@ public abstract class AbsEntryChangePricePrepareProcessor<T extends SellerBaseCh
76 logger.warn("ChangePrice checkAndAcquire uid illegal , req {}", req); 77 logger.warn("ChangePrice checkAndAcquire uid illegal , req {}", req);
77 throw new UfoServiceException(400, "参数[uid]错误"); 78 throw new UfoServiceException(400, "参数[uid]错误");
78 } 79 }
79 -  
80 - if(!sellerOrderPrepareProcessor.checkIsEntry(uid)){ 80 + SkupType skupType = SkupType.getSkupType(req.getSkupType());
  81 + boolean isQuickDeliver = SellerGoodsHelper.isQuickDeliver(skupType);
  82 + //非闪购商品需要入驻身份 =》 非入驻 时抛异常
  83 + if(!isQuickDeliver && !sellerOrderPrepareProcessor.checkIsEntry(uid)){
81 logger.warn("ChangePrice checkAndAcquire uid is not entry shop , req {}", req); 84 logger.warn("ChangePrice checkAndAcquire uid is not entry shop , req {}", req);
82 throw new UfoServiceException(400, "您不是入驻商家"); 85 throw new UfoServiceException(400, "您不是入驻商家");
83 } 86 }
84 87
85 //检查是否有买家下单,返回的是可售 待买家付款的skup 88 //检查是否有买家下单,返回的是可售 待买家付款的skup
86 Map<Integer, SkupDto> skupOfSalingMap = checkExistWaitingBuyerPay(req); 89 Map<Integer, SkupDto> skupOfSalingMap = checkExistWaitingBuyerPay(req);
87 - SkupType skupType = SkupType.getSkupType(req.getSkupType()); 90 +
88 BigDecimal salePrice = priceComputePrepareProcessor.checkAndAcquireSalePrice(req.getPrice(), skupType); 91 BigDecimal salePrice = priceComputePrepareProcessor.checkAndAcquireSalePrice(req.getPrice(), skupType);
89 //若needChangePriceSkupList中有skup出现不存在于skupOfSalingMap keys中,说明该skup走到了其他状态中 92 //若needChangePriceSkupList中有skup出现不存在于skupOfSalingMap keys中,说明该skup走到了其他状态中
90 Map<Integer, SkupDto> skupMap = checkNeedProcessSkups(getExpectedSkups(req), req.getOldPrice(), salePrice, skupOfSalingMap); 93 Map<Integer, SkupDto> skupMap = checkNeedProcessSkups(getExpectedSkups(req), req.getOldPrice(), salePrice, skupOfSalingMap);
1 package com.yohoufo.order.service.seller.processor; 1 package com.yohoufo.order.service.seller.processor;
2 2
3 import com.yohobuy.ufo.model.order.common.SkupStatus; 3 import com.yohobuy.ufo.model.order.common.SkupStatus;
  4 +import com.yohobuy.ufo.model.order.constants.OrderDetailDesc;
4 import com.yohobuy.ufo.model.order.constants.SkupType; 5 import com.yohobuy.ufo.model.order.constants.SkupType;
5 import com.yohobuy.ufo.model.order.req.SellerBatchChangeReq; 6 import com.yohobuy.ufo.model.order.req.SellerBatchChangeReq;
6 import com.yohoufo.common.exception.UfoServiceException; 7 import com.yohoufo.common.exception.UfoServiceException;
@@ -56,8 +57,8 @@ public class SellerDownShelfPrepareProcessor { @@ -56,8 +57,8 @@ public class SellerDownShelfPrepareProcessor {
56 logger.warn("batch off shelve checkAndAcquire num is illegal, req {}", req); 57 logger.warn("batch off shelve checkAndAcquire num is illegal, req {}", req);
57 throw new UfoServiceException(400, "数量不合法"); 58 throw new UfoServiceException(400, "数量不合法");
58 } 59 }
59 -  
60 - if (!sellerOrderPrepareProcessor.checkIsEntry(uid)) { 60 + boolean isQuickDeliver = SellerGoodsHelper.isQuickDeliver(skupType);
  61 + if (!isQuickDeliver && !sellerOrderPrepareProcessor.checkIsEntry(uid)) {
61 logger.warn("batch off shelve checkAndAcquire uid is not entry shop , req {}", req); 62 logger.warn("batch off shelve checkAndAcquire uid is not entry shop , req {}", req);
62 throw new UfoServiceException(400, "您不是入驻商家"); 63 throw new UfoServiceException(400, "您不是入驻商家");
63 } 64 }
@@ -3,6 +3,7 @@ package com.yohoufo.order.utils; @@ -3,6 +3,7 @@ package com.yohoufo.order.utils;
3 import com.yohobuy.ufo.model.order.bo.OrderInfo; 3 import com.yohobuy.ufo.model.order.bo.OrderInfo;
4 import com.yohobuy.ufo.model.order.common.OrderAttributes; 4 import com.yohobuy.ufo.model.order.common.OrderAttributes;
5 import com.yohobuy.ufo.model.order.common.OrderStatus; 5 import com.yohobuy.ufo.model.order.common.OrderStatus;
  6 +import com.yohobuy.ufo.model.order.constants.SkupType;
6 import com.yohoufo.dal.order.model.BuyerOrder; 7 import com.yohoufo.dal.order.model.BuyerOrder;
7 8
8 import java.util.Objects; 9 import java.util.Objects;
@@ -64,4 +65,10 @@ public class BuyerOrderUtils { @@ -64,4 +65,10 @@ public class BuyerOrderUtils {
64 public static boolean isQuickDeliver(Integer orderAttrCode){ 65 public static boolean isQuickDeliver(Integer orderAttrCode){
65 return Objects.nonNull(orderAttrCode) && Objects.equals(OrderAttributes.QUICK_DELIVER.getCode(), orderAttrCode); 66 return Objects.nonNull(orderAttrCode) && Objects.equals(OrderAttributes.QUICK_DELIVER.getCode(), orderAttrCode);
66 } 67 }
  68 +
  69 +
  70 + public static SkupType convertSkupTypeIfNeed(Integer orderAttrCode, SkupType skupType){
  71 + boolean isDeposit = isDeposit(orderAttrCode);
  72 + return isDeposit ? SkupType.DEPOSIT : skupType;
  73 + }
67 } 74 }
@@ -35,6 +35,7 @@ import org.springframework.web.bind.annotation.RequestParam; @@ -35,6 +35,7 @@ import org.springframework.web.bind.annotation.RequestParam;
35 import org.springframework.web.bind.annotation.RestController; 35 import org.springframework.web.bind.annotation.RestController;
36 import org.springframework.web.servlet.ModelAndView; 36 import org.springframework.web.servlet.ModelAndView;
37 37
  38 +import java.lang.reflect.Method;
38 import java.math.BigDecimal; 39 import java.math.BigDecimal;
39 import java.util.Collection; 40 import java.util.Collection;
40 import java.util.List; 41 import java.util.List;
@@ -451,6 +452,8 @@ public class ProductController { @@ -451,6 +452,8 @@ public class ProductController {
451 cacheAop.clearCache( 452 cacheAop.clearCache(
452 ProductController.class.getMethod("queryProductDetailById", new Class[]{Integer.class}), 453 ProductController.class.getMethod("queryProductDetailById", new Class[]{Integer.class}),
453 new Object[]{productId}); 454 new Object[]{productId});
  455 + Method queryLeastFlashSalePrice = ProductController.class.getMethod("queryLeastFlashSalePrice", new Class[]{Integer.class});
  456 + cacheAop.clearCache(queryLeastFlashSalePrice, new Object[]{productId});
454 Integer storageId = sp.getStorageId(); 457 Integer storageId = sp.getStorageId();
455 // sku最低价 458 // sku最低价
456 LOG.info("clearCache queryStorageLeastprice skup = {}, ", skup); 459 LOG.info("clearCache queryStorageLeastprice skup = {}, ", skup);
@@ -506,6 +509,8 @@ public class ProductController { @@ -506,6 +509,8 @@ public class ProductController {
506 cacheAop.clearCache( 509 cacheAop.clearCache(
507 ProductController.class.getMethod("queryProductInStockNewBriefById", new Class[]{Integer.class}), 510 ProductController.class.getMethod("queryProductInStockNewBriefById", new Class[]{Integer.class}),
508 new Object[]{productId}); 511 new Object[]{productId});
  512 + Method queryLeastFlashSalePrice = ProductController.class.getMethod("queryLeastFlashSalePrice", new Class[]{Integer.class});
  513 + cacheAop.clearCache(queryLeastFlashSalePrice, new Object[]{productId});
509 } catch (Exception e) { 514 } catch (Exception e) {
510 LOG.error("删除商品详情缓存失败!", e); 515 LOG.error("删除商品详情缓存失败!", e);
511 } 516 }
@@ -528,6 +533,8 @@ public class ProductController { @@ -528,6 +533,8 @@ public class ProductController {
528 cacheAop.clearCache( 533 cacheAop.clearCache(
529 ProductController.class.getMethod("queryProductInStockNewBriefById", new Class[]{Integer.class}), 534 ProductController.class.getMethod("queryProductInStockNewBriefById", new Class[]{Integer.class}),
530 new Object[]{productId}); 535 new Object[]{productId});
  536 + Method queryLeastFlashSalePrice = ProductController.class.getMethod("queryLeastFlashSalePrice", new Class[]{Integer.class});
  537 + cacheAop.clearCache(queryLeastFlashSalePrice, new Object[]{productId});
531 } 538 }
532 } 539 }
533 if (CollectionUtils.isNotEmpty(storageIdList)) { 540 if (CollectionUtils.isNotEmpty(storageIdList)) {
@@ -787,7 +787,7 @@ public class ProductServiceImpl implements ProductService { @@ -787,7 +787,7 @@ public class ProductServiceImpl implements ProductService {
787 } 787 }
788 788
789 private void addStorageNum(Integer skup, Integer storageId, Integer num) { 789 private void addStorageNum(Integer skup, Integer storageId, Integer num) {
790 - LOGGER.info("修改库存:skup={}, storageId={}, num={}", skup, storageId, num); 790 + /* LOGGER.info("修改库存:skup={}, storageId={}, num={}", skup, storageId, num);
791 if (storageId == null) { 791 if (storageId == null) {
792 StoragePrice sp = storagePriceMapper.selectBySkup(skup); 792 StoragePrice sp = storagePriceMapper.selectBySkup(skup);
793 storageId = sp.getStorageId(); 793 storageId = sp.getStorageId();
@@ -801,7 +801,7 @@ public class ProductServiceImpl implements ProductService { @@ -801,7 +801,7 @@ public class ProductServiceImpl implements ProductService {
801 storageMapper.addStorageNum(storageId, num); 801 storageMapper.addStorageNum(storageId, num);
802 } catch (Exception e) { 802 } catch (Exception e) {
803 LOGGER.error("修改库存出错: skup=" + skup + ", storageId=" + storageId + ", num=" + num + ", find storageId is null", e); 803 LOGGER.error("修改库存出错: skup=" + skup + ", storageId=" + storageId + ", num=" + num + ", find storageId is null", e);
804 - } 804 + }*/
805 } 805 }
806 806
807 private StoragePrice checkSkupCanSale(Integer skup) { 807 private StoragePrice checkSkupCanSale(Integer skup) {