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;
import com.alibaba.fastjson.JSONObject;
import com.yohoufo.common.constant.InfluxdbFieldEnum;
import com.yohoufo.common.constant.InfluxdbMeasurementEnum;
import com.yohoufo.common.constant.InfluxdbTagEnum;
import java.util.HashMap;
import java.util.Map;
... ... @@ -77,6 +78,11 @@ public class UfoInfluxdbVo {
return this;
}
public Builder addTag(InfluxdbTagEnum tagEnum, Integer value) {
this.tags.put(tagEnum.getTagName(), String.valueOf(value));
return this;
}
public Builder setFields(Map<String, Object> fields) {
this.fields = fields;
... ...
package com.yohoufo.common.constant;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import java.util.Map;
/**
* Created by li.ma on 2019/2/26.
*/
... ... @@ -11,6 +16,7 @@ public enum InfluxdbMeasurementEnum {
String measurement;
InfluxdbMeasurementEnum(String measurement) {
this.measurement = measurement;
}
... ... @@ -18,4 +24,5 @@ public enum InfluxdbMeasurementEnum {
public String getMeasurement() {
return measurement;
}
}
... ...
package com.yohoufo.common.constant;
/**
* Created by li.ma on 2019/3/19.
*/
public enum InfluxdbTagEnum {
TAG_TYPE("type");
String tagName;
InfluxdbTagEnum(String tagName) {
this.tagName = tagName;
}
public String getTagName() {
return tagName;
}
}
... ...
... ... @@ -88,5 +88,8 @@ public interface AbsSellerOrderViewService {
return "该尺码最低售价¥" + BigDecimalHelper.formatNumber(leastPrice, BigDecimalHelper.FORMAT_NOPOINT);
}
default String buildOtherLowerPriceTips(BigDecimal leastPrice){
return "有更低出售价¥" + BigDecimalHelper.formatNumber(leastPrice, BigDecimalHelper.FORMAT_NOPOINT)+",建议下调价格,以便尽快售出。";
}
}
... ...
... ... @@ -12,6 +12,7 @@ import com.yohoufo.common.alarm.UfoInfluxdbEvent;
import com.yohoufo.common.alarm.UfoInfluxdbVo;
import com.yohoufo.common.constant.InfluxdbFieldEnum;
import com.yohoufo.common.constant.InfluxdbMeasurementEnum;
import com.yohoufo.common.constant.InfluxdbTagEnum;
import com.yohoufo.common.exception.UfoServiceException;
import com.yohoufo.common.utils.DateUtil;
import com.yohoufo.dal.order.SellerEnterApplyMapper;
... ... @@ -278,8 +279,10 @@ public class SellerEnterApplyService {
SellerLevelFuncBo slfb = sellerFuncService.getSellerLevelFunc(targetEst.getCode(), level);
storedSellerService.addUserAsStoredSeller(uid, targetEst, slfb);
EventBusPublisher.publishEvent(new UfoInfluxdbEvent(new UfoInfluxdbVo.Builder().setMeasurement(InfluxdbMeasurementEnum.MEASUREMENT_SELLER_ENTER)
.addInitField(InfluxdbFieldEnum.FIELD_COUNT).build())); // 统计入驻商家的记录
EventBusPublisher.publishEvent(new UfoInfluxdbEvent(new UfoInfluxdbVo.Builder()
.setMeasurement(InfluxdbMeasurementEnum.MEASUREMENT_SELLER_ENTER)
.addTag(InfluxdbTagEnum.TAG_TYPE, targetEst.getCode() == EntrySellerType.COMMON.getCode() ? 2 : 3)
.addInitField(InfluxdbFieldEnum.FIELD_COUNT).build())); // 统计入驻商家的记录 2代表普通入驻 3 代表超级卖家入驻
}else{
logger.warn("in upgradeLevel add StoredSeller fail, uid {} orderCode {}",
uid, orderCode);
... ... @@ -298,8 +301,10 @@ public class SellerEnterApplyService {
merchantOrderPaymentService.changeWalletToSuperSeller(uid);
}
EventBusPublisher.publishEvent(new UfoInfluxdbEvent(new UfoInfluxdbVo.Builder().setMeasurement(InfluxdbMeasurementEnum.MEASUREMENT_SELLER_ENTER)
.addInitField(InfluxdbFieldEnum.FIELD_COUNT).build())); // 统计入驻商家的记录
EventBusPublisher.publishEvent(new UfoInfluxdbEvent(new UfoInfluxdbVo.Builder()
.setMeasurement(InfluxdbMeasurementEnum.MEASUREMENT_SELLER_ENTER)
.addTag(InfluxdbTagEnum.TAG_TYPE, 1)
.addInitField(InfluxdbFieldEnum.FIELD_COUNT).build())); // 统计入驻商家的记录 1 代表升级
}else{
logger.warn("in upgradeLevel update StoredSeller fail, uid {} orderCode {}",
uid, orderCode);
... ...
... ... @@ -384,10 +384,12 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
OrderDetailInfo.StatusDetail statusDetail = getStatusDetail(order, skupStatus);
Integer soga = sellerOrderGoods.getAttributes();
boolean isAdvance = OrderAssist.skupIsAdvance(soga);
boolean existOverFlowPrice = false;
if(!isAdvance && SHOW_OVER_FLOW_PRICE_STATUS.contains(skupStatus.getCode())) {
String tips = buildOverPriceTips(sellerOrderGoods.getStorageId(), sellerOrderGoods.getGoodsPrice());
if (StringUtils.isNotBlank(tips)) {
statusDetail.setDetailDesc(tips);
existOverFlowPrice = true;
}
}
orderDetailInfo.setStatusDetail(statusDetail);
... ... @@ -405,6 +407,15 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
}
orderDetailInfo.setGoodsInfo(goodsInfo);
if(!existOverFlowPrice
&&!isAdvance && SHOW_OVER_FLOW_PRICE_STATUS.contains(skupStatus.getCode())) {
//其它卖家的售价更低的tip
BigDecimal leastPrice = goodsInfo.getLeastPrice();
if(leastPrice!=null&&leastPrice.compareTo(sellerOrderGoods.getGoodsPrice())<0){
statusDetail.setDetailDesc(buildOtherLowerPriceTips(leastPrice));
}
}
// 支付状态
setPayment(orderDetailInfo, order.getPayment());
//
... ...
... ... @@ -33,6 +33,7 @@ import com.yohoufo.order.utils.LoggerUtils;
import com.yohoufo.order.utils.OrderAssist;
import com.yohoufo.order.utils.TimeUtils;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
... ... @@ -344,7 +345,17 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde
orderListInfo.setSecendLevelCreateTime(sellerOrder.getCreateTime());
orderListInfo.setCreateTime(DateUtil.formatDate(sellerOrder.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS));
if (!isAdvance && SHOW_OVER_FLOW_PRICE_STATUS.contains(skupStatus.getCode())){
orderListInfo.setTips(overPriceTipsMap.get(OrderAssist.overFlowPriceKey(sellerOrderGoods.getStorageId(), sellerOrderGoods.getGoodsPrice())));
String tips = overPriceTipsMap.get(OrderAssist.overFlowPriceKey(sellerOrderGoods.getStorageId(), sellerOrderGoods.getGoodsPrice()));
//若用户当前价格大于建议售价,仅显示价格隐藏提示
//若用户当前价格在建议售价内,仅显示有更低出售价提示
//其它卖家的售价更低的tip
BigDecimal leastPrice = goodsInfo.getLeastPrice();
if(StringUtils.isBlank(tips)&&leastPrice!=null&&leastPrice.compareTo(sellerOrderGoods.getGoodsPrice())<0){
tips = buildOtherLowerPriceTips(leastPrice);
}
orderListInfo.setTips(tips);
}
orderListInfo.setIsAdvance(OrderAssist.getSkupIsAdvance(soga));
return orderListInfo;
... ...
... ... @@ -548,7 +548,17 @@ public class SkupListService {
orderListInfo.setGoodsInfo(productInfo);
//tips
if (!isAdvance){
orderListInfo.setTips(overPriceTipsMap.get(OrderAssist.overFlowPriceKey(sellerOrderGoods.getStorageId(), sellerOrderGoods.getGoodsPrice())));
String tips = overPriceTipsMap.get(OrderAssist.overFlowPriceKey(sellerOrderGoods.getStorageId(), sellerOrderGoods.getGoodsPrice()));
//若用户当前价格大于建议售价,仅显示价格隐藏提示
//若用户当前价格在建议售价内,仅显示有更低出售价提示
//其它卖家的售价更低的tip
BigDecimal leastPrice = productInfo.getLeastPrice();
if(StringUtils.isBlank(tips)&&leastPrice!=null&&leastPrice.compareTo(sellerOrderGoods.getGoodsPrice())<0){
tips = sellerOrderListService.buildOtherLowerPriceTips(leastPrice);
}
orderListInfo.setTips(tips);
}
orderListInfo.setIsAdvance(OrderAssist.getSkupIsAdvance(soga));
return orderListInfo;
... ...