Authored by tanling

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

@@ -3,6 +3,7 @@ package com.yohoufo.common.alarm; @@ -3,6 +3,7 @@ package com.yohoufo.common.alarm;
3 import com.alibaba.fastjson.JSONObject; 3 import com.alibaba.fastjson.JSONObject;
4 import com.yohoufo.common.constant.InfluxdbFieldEnum; 4 import com.yohoufo.common.constant.InfluxdbFieldEnum;
5 import com.yohoufo.common.constant.InfluxdbMeasurementEnum; 5 import com.yohoufo.common.constant.InfluxdbMeasurementEnum;
  6 +import com.yohoufo.common.constant.InfluxdbTagEnum;
6 7
7 import java.util.HashMap; 8 import java.util.HashMap;
8 import java.util.Map; 9 import java.util.Map;
@@ -77,6 +78,11 @@ public class UfoInfluxdbVo { @@ -77,6 +78,11 @@ public class UfoInfluxdbVo {
77 return this; 78 return this;
78 } 79 }
79 80
  81 + public Builder addTag(InfluxdbTagEnum tagEnum, Integer value) {
  82 + this.tags.put(tagEnum.getTagName(), String.valueOf(value));
  83 + return this;
  84 + }
  85 +
80 86
81 public Builder setFields(Map<String, Object> fields) { 87 public Builder setFields(Map<String, Object> fields) {
82 this.fields = fields; 88 this.fields = fields;
1 package com.yohoufo.common.constant; 1 package com.yohoufo.common.constant;
2 2
  3 +import com.google.common.collect.ImmutableMap;
  4 +import com.google.common.collect.Maps;
  5 +
  6 +import java.util.Map;
  7 +
3 /** 8 /**
4 * Created by li.ma on 2019/2/26. 9 * Created by li.ma on 2019/2/26.
5 */ 10 */
@@ -11,6 +16,7 @@ public enum InfluxdbMeasurementEnum { @@ -11,6 +16,7 @@ public enum InfluxdbMeasurementEnum {
11 16
12 String measurement; 17 String measurement;
13 18
  19 +
14 InfluxdbMeasurementEnum(String measurement) { 20 InfluxdbMeasurementEnum(String measurement) {
15 this.measurement = measurement; 21 this.measurement = measurement;
16 } 22 }
@@ -18,4 +24,5 @@ public enum InfluxdbMeasurementEnum { @@ -18,4 +24,5 @@ public enum InfluxdbMeasurementEnum {
18 public String getMeasurement() { 24 public String getMeasurement() {
19 return measurement; 25 return measurement;
20 } 26 }
  27 +
21 } 28 }
  1 +package com.yohoufo.common.constant;
  2 +
  3 +/**
  4 + * Created by li.ma on 2019/3/19.
  5 + */
  6 +public enum InfluxdbTagEnum {
  7 + TAG_TYPE("type");
  8 +
  9 + String tagName;
  10 +
  11 + InfluxdbTagEnum(String tagName) {
  12 + this.tagName = tagName;
  13 + }
  14 +
  15 + public String getTagName() {
  16 + return tagName;
  17 + }
  18 +}
@@ -88,5 +88,8 @@ public interface AbsSellerOrderViewService { @@ -88,5 +88,8 @@ public interface AbsSellerOrderViewService {
88 return "该尺码最低售价¥" + BigDecimalHelper.formatNumber(leastPrice, BigDecimalHelper.FORMAT_NOPOINT); 88 return "该尺码最低售价¥" + BigDecimalHelper.formatNumber(leastPrice, BigDecimalHelper.FORMAT_NOPOINT);
89 } 89 }
90 90
  91 + default String buildOtherLowerPriceTips(BigDecimal leastPrice){
  92 + return "有更低出售价¥" + BigDecimalHelper.formatNumber(leastPrice, BigDecimalHelper.FORMAT_NOPOINT)+",建议下调价格,以便尽快售出。";
  93 + }
91 94
92 } 95 }
@@ -12,6 +12,7 @@ import com.yohoufo.common.alarm.UfoInfluxdbEvent; @@ -12,6 +12,7 @@ import com.yohoufo.common.alarm.UfoInfluxdbEvent;
12 import com.yohoufo.common.alarm.UfoInfluxdbVo; 12 import com.yohoufo.common.alarm.UfoInfluxdbVo;
13 import com.yohoufo.common.constant.InfluxdbFieldEnum; 13 import com.yohoufo.common.constant.InfluxdbFieldEnum;
14 import com.yohoufo.common.constant.InfluxdbMeasurementEnum; 14 import com.yohoufo.common.constant.InfluxdbMeasurementEnum;
  15 +import com.yohoufo.common.constant.InfluxdbTagEnum;
15 import com.yohoufo.common.exception.UfoServiceException; 16 import com.yohoufo.common.exception.UfoServiceException;
16 import com.yohoufo.common.utils.DateUtil; 17 import com.yohoufo.common.utils.DateUtil;
17 import com.yohoufo.dal.order.SellerEnterApplyMapper; 18 import com.yohoufo.dal.order.SellerEnterApplyMapper;
@@ -278,8 +279,10 @@ public class SellerEnterApplyService { @@ -278,8 +279,10 @@ public class SellerEnterApplyService {
278 SellerLevelFuncBo slfb = sellerFuncService.getSellerLevelFunc(targetEst.getCode(), level); 279 SellerLevelFuncBo slfb = sellerFuncService.getSellerLevelFunc(targetEst.getCode(), level);
279 storedSellerService.addUserAsStoredSeller(uid, targetEst, slfb); 280 storedSellerService.addUserAsStoredSeller(uid, targetEst, slfb);
280 281
281 - EventBusPublisher.publishEvent(new UfoInfluxdbEvent(new UfoInfluxdbVo.Builder().setMeasurement(InfluxdbMeasurementEnum.MEASUREMENT_SELLER_ENTER)  
282 - .addInitField(InfluxdbFieldEnum.FIELD_COUNT).build())); // 统计入驻商家的记录 282 + EventBusPublisher.publishEvent(new UfoInfluxdbEvent(new UfoInfluxdbVo.Builder()
  283 + .setMeasurement(InfluxdbMeasurementEnum.MEASUREMENT_SELLER_ENTER)
  284 + .addTag(InfluxdbTagEnum.TAG_TYPE, targetEst.getCode() == EntrySellerType.COMMON.getCode() ? 2 : 3)
  285 + .addInitField(InfluxdbFieldEnum.FIELD_COUNT).build())); // 统计入驻商家的记录 2代表普通入驻 3 代表超级卖家入驻
283 }else{ 286 }else{
284 logger.warn("in upgradeLevel add StoredSeller fail, uid {} orderCode {}", 287 logger.warn("in upgradeLevel add StoredSeller fail, uid {} orderCode {}",
285 uid, orderCode); 288 uid, orderCode);
@@ -298,8 +301,10 @@ public class SellerEnterApplyService { @@ -298,8 +301,10 @@ public class SellerEnterApplyService {
298 merchantOrderPaymentService.changeWalletToSuperSeller(uid); 301 merchantOrderPaymentService.changeWalletToSuperSeller(uid);
299 } 302 }
300 303
301 - EventBusPublisher.publishEvent(new UfoInfluxdbEvent(new UfoInfluxdbVo.Builder().setMeasurement(InfluxdbMeasurementEnum.MEASUREMENT_SELLER_ENTER)  
302 - .addInitField(InfluxdbFieldEnum.FIELD_COUNT).build())); // 统计入驻商家的记录 304 + EventBusPublisher.publishEvent(new UfoInfluxdbEvent(new UfoInfluxdbVo.Builder()
  305 + .setMeasurement(InfluxdbMeasurementEnum.MEASUREMENT_SELLER_ENTER)
  306 + .addTag(InfluxdbTagEnum.TAG_TYPE, 1)
  307 + .addInitField(InfluxdbFieldEnum.FIELD_COUNT).build())); // 统计入驻商家的记录 1 代表升级
303 }else{ 308 }else{
304 logger.warn("in upgradeLevel update StoredSeller fail, uid {} orderCode {}", 309 logger.warn("in upgradeLevel update StoredSeller fail, uid {} orderCode {}",
305 uid, orderCode); 310 uid, orderCode);
@@ -384,10 +384,12 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I @@ -384,10 +384,12 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
384 OrderDetailInfo.StatusDetail statusDetail = getStatusDetail(order, skupStatus); 384 OrderDetailInfo.StatusDetail statusDetail = getStatusDetail(order, skupStatus);
385 Integer soga = sellerOrderGoods.getAttributes(); 385 Integer soga = sellerOrderGoods.getAttributes();
386 boolean isAdvance = OrderAssist.skupIsAdvance(soga); 386 boolean isAdvance = OrderAssist.skupIsAdvance(soga);
  387 + boolean existOverFlowPrice = false;
387 if(!isAdvance && SHOW_OVER_FLOW_PRICE_STATUS.contains(skupStatus.getCode())) { 388 if(!isAdvance && SHOW_OVER_FLOW_PRICE_STATUS.contains(skupStatus.getCode())) {
388 String tips = buildOverPriceTips(sellerOrderGoods.getStorageId(), sellerOrderGoods.getGoodsPrice()); 389 String tips = buildOverPriceTips(sellerOrderGoods.getStorageId(), sellerOrderGoods.getGoodsPrice());
389 if (StringUtils.isNotBlank(tips)) { 390 if (StringUtils.isNotBlank(tips)) {
390 statusDetail.setDetailDesc(tips); 391 statusDetail.setDetailDesc(tips);
  392 + existOverFlowPrice = true;
391 } 393 }
392 } 394 }
393 orderDetailInfo.setStatusDetail(statusDetail); 395 orderDetailInfo.setStatusDetail(statusDetail);
@@ -405,6 +407,15 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I @@ -405,6 +407,15 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
405 } 407 }
406 orderDetailInfo.setGoodsInfo(goodsInfo); 408 orderDetailInfo.setGoodsInfo(goodsInfo);
407 409
  410 + if(!existOverFlowPrice
  411 + &&!isAdvance && SHOW_OVER_FLOW_PRICE_STATUS.contains(skupStatus.getCode())) {
  412 + //其它卖家的售价更低的tip
  413 + BigDecimal leastPrice = goodsInfo.getLeastPrice();
  414 + if(leastPrice!=null&&leastPrice.compareTo(sellerOrderGoods.getGoodsPrice())<0){
  415 + statusDetail.setDetailDesc(buildOtherLowerPriceTips(leastPrice));
  416 + }
  417 + }
  418 +
408 // 支付状态 419 // 支付状态
409 setPayment(orderDetailInfo, order.getPayment()); 420 setPayment(orderDetailInfo, order.getPayment());
410 // 421 //
@@ -33,6 +33,7 @@ import com.yohoufo.order.utils.LoggerUtils; @@ -33,6 +33,7 @@ import com.yohoufo.order.utils.LoggerUtils;
33 import com.yohoufo.order.utils.OrderAssist; 33 import com.yohoufo.order.utils.OrderAssist;
34 import com.yohoufo.order.utils.TimeUtils; 34 import com.yohoufo.order.utils.TimeUtils;
35 import org.apache.commons.collections.CollectionUtils; 35 import org.apache.commons.collections.CollectionUtils;
  36 +import org.apache.commons.lang3.StringUtils;
36 import org.slf4j.Logger; 37 import org.slf4j.Logger;
37 import org.springframework.beans.factory.annotation.Autowired; 38 import org.springframework.beans.factory.annotation.Autowired;
38 import org.springframework.stereotype.Service; 39 import org.springframework.stereotype.Service;
@@ -344,7 +345,17 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde @@ -344,7 +345,17 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde
344 orderListInfo.setSecendLevelCreateTime(sellerOrder.getCreateTime()); 345 orderListInfo.setSecendLevelCreateTime(sellerOrder.getCreateTime());
345 orderListInfo.setCreateTime(DateUtil.formatDate(sellerOrder.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS)); 346 orderListInfo.setCreateTime(DateUtil.formatDate(sellerOrder.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS));
346 if (!isAdvance && SHOW_OVER_FLOW_PRICE_STATUS.contains(skupStatus.getCode())){ 347 if (!isAdvance && SHOW_OVER_FLOW_PRICE_STATUS.contains(skupStatus.getCode())){
347 - orderListInfo.setTips(overPriceTipsMap.get(OrderAssist.overFlowPriceKey(sellerOrderGoods.getStorageId(), sellerOrderGoods.getGoodsPrice()))); 348 + String tips = overPriceTipsMap.get(OrderAssist.overFlowPriceKey(sellerOrderGoods.getStorageId(), sellerOrderGoods.getGoodsPrice()));
  349 +
  350 + //若用户当前价格大于建议售价,仅显示价格隐藏提示
  351 + //若用户当前价格在建议售价内,仅显示有更低出售价提示
  352 + //其它卖家的售价更低的tip
  353 + BigDecimal leastPrice = goodsInfo.getLeastPrice();
  354 + if(StringUtils.isBlank(tips)&&leastPrice!=null&&leastPrice.compareTo(sellerOrderGoods.getGoodsPrice())<0){
  355 + tips = buildOtherLowerPriceTips(leastPrice);
  356 + }
  357 +
  358 + orderListInfo.setTips(tips);
348 } 359 }
349 orderListInfo.setIsAdvance(OrderAssist.getSkupIsAdvance(soga)); 360 orderListInfo.setIsAdvance(OrderAssist.getSkupIsAdvance(soga));
350 return orderListInfo; 361 return orderListInfo;
@@ -548,7 +548,17 @@ public class SkupListService { @@ -548,7 +548,17 @@ public class SkupListService {
548 orderListInfo.setGoodsInfo(productInfo); 548 orderListInfo.setGoodsInfo(productInfo);
549 //tips 549 //tips
550 if (!isAdvance){ 550 if (!isAdvance){
551 - orderListInfo.setTips(overPriceTipsMap.get(OrderAssist.overFlowPriceKey(sellerOrderGoods.getStorageId(), sellerOrderGoods.getGoodsPrice()))); 551 + String tips = overPriceTipsMap.get(OrderAssist.overFlowPriceKey(sellerOrderGoods.getStorageId(), sellerOrderGoods.getGoodsPrice()));
  552 +
  553 + //若用户当前价格大于建议售价,仅显示价格隐藏提示
  554 + //若用户当前价格在建议售价内,仅显示有更低出售价提示
  555 + //其它卖家的售价更低的tip
  556 + BigDecimal leastPrice = productInfo.getLeastPrice();
  557 + if(StringUtils.isBlank(tips)&&leastPrice!=null&&leastPrice.compareTo(sellerOrderGoods.getGoodsPrice())<0){
  558 + tips = sellerOrderListService.buildOtherLowerPriceTips(leastPrice);
  559 + }
  560 +
  561 + orderListInfo.setTips(tips);
552 } 562 }
553 orderListInfo.setIsAdvance(OrderAssist.getSkupIsAdvance(soga)); 563 orderListInfo.setIsAdvance(OrderAssist.getSkupIsAdvance(soga));
554 return orderListInfo; 564 return orderListInfo;