Authored by wujiexiang

Merge branch 'master' of http://git.yoho.cn/ufo/yohoufo-fore into dev-coupon-recommend

... ... @@ -88,7 +88,7 @@ public class ChargeService {
//活动优惠
ActivityPrice activityPrice = chargeContext.getActivityPrice();
if (activityPrice.getCutPrice() == null) {
if (activityPrice.getCutPrice() == null || Objects.isNull(activityPrice.getActivityTypeEnum())) {
return;
}
... ...
... ... @@ -85,4 +85,18 @@ public class ExpressInfoController {
AppraiseAddressResp appraiseAddressResp = expressInfoService.queryAppraiseAddress(uid, orderCode, skup);
return new ApiResponse.ApiResponseBuilder().code(200).data(appraiseAddressResp).build();
}
/**
* 鉴定中心地址
* @param uid uid
* @return
*/
@RequestMapping(params = "method=ufo.order.noticeAppraiseAddressChanged")
public ApiResponse noticeAppraiseAddressChanged(@RequestParam("uid") Integer uid,
@RequestParam(value="orderCode")Long orderCode) {
LOG.info("method=ufo.order.noticeAppraiseAddressChanged in, uid {}, orderCode {}", uid, orderCode);
AppraiseAddressResp appraiseAddressResp = expressInfoService.noticeAppraiseAddressChanged(uid, orderCode);
return new ApiResponse.ApiResponseBuilder().code(200).data(appraiseAddressResp).build();
}
}
... ...
package com.yohoufo.order.model.response;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Getter;
import lombok.Setter;
/**
* Created by li.ma on 2018/9/27.
... ... @@ -19,6 +21,13 @@ public class AppraiseAddressResp {
@JSONField(name="id")
private Integer type;
/**
* 是否变更
*/
@Getter
@Setter
@JSONField(name="isChanged")
private boolean isChanged;
public Integer getType() {
return type;
... ...
... ... @@ -78,6 +78,9 @@ public interface IExpressInfoService {
AppraiseAddressResp queryAppraiseAddress(Integer uid, Long orderCode, Integer skup);
AppraiseAddressResp noticeAppraiseAddressChanged(Integer uid, Long orderCode);
/**
* 根据订单号获取快递类型
* 1:卖家到鉴定中心
... ...
... ... @@ -222,16 +222,15 @@ public abstract class AbsOrderListService extends AbsOrderViewService implements
*/
public String getErpStatusStr(Long orderCode, Integer status, Map<Long, QualityCheck> qualityCheckMap ){
if (MapUtils.isEmpty(qualityCheckMap)){
return "";
}
String erpStatusStr = StatusErpShow.convertOrderStatusStr(Objects.isNull(status)? null : status.byteValue());
QualityCheck qualityCheck = qualityCheckMap.get(orderCode);
if (Objects.isNull(qualityCheck)){
if (qualityCheckMap == null || Objects.isNull(qualityCheckMap.get(orderCode))){
return erpStatusStr;
}
QualityCheck qualityCheck = qualityCheckMap.get(orderCode);
if (status == StatusErpShow.BUYER_ORDER_STATUS_MINI_FAULT_WAITING.getByteVal()
&& EnumQualityCheckType.MINI_FAULT.getCode().equals(qualityCheck.getType())
&& EnumQualityCheckStatus.WAIT_CONFIRM.getCode().equals(qualityCheck.getStatus())){
... ...
... ... @@ -71,14 +71,18 @@ public class AppraiseAddressService {
return address;
}
private static final String DEFAULT_MOBILE = "13073457202";
private static final String DEFAULT_MOBILE = "18752002919",
addressName = "刘优福",
address = "南京市江宁区苏源大道87号有货仓储物流中心西四楼有货UFO实物鉴定中心";
// 根据默认鉴定中心地址
public AppraiseAddressResp queryInitAddress() {
List<AppraiseAddressResp> appraiseAddressResps = queryAddressInfoList();
if (CollectionUtils.isEmpty(appraiseAddressResps)) {
return new AppraiseAddressResp.builder().setMobile(DEFAULT_MOBILE).setType(0).setAddressName("宫布朗").setAddress("北京市朝阳区望京东园523号楼融科望京中心写字楼A座1208-UFO鉴定中心").build();
return new AppraiseAddressResp.builder().setMobile(DEFAULT_MOBILE).setType(0)
.setAddressName(addressName)
.setAddress(address).build();
}
return appraiseAddressResps.get(0);
}
... ...
... ... @@ -43,10 +43,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.*;
import java.util.stream.Collectors;
/**
... ... @@ -1046,4 +1043,45 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
// 匹配不了,给个娄底的
return resp==null ? appraiseAddressService.queryInitAddress() : resp;
}
/**
* 鉴定中心地址变更弹框通知
* @param uid
* @param orderCode
* @return
*/
@Override
public AppraiseAddressResp noticeAppraiseAddressChanged(Integer uid, Long orderCode) {
if (null == uid || orderCode == null) {
LOGGER.warn("in noticeAppraiseAddressChanged check in-param fail, uid {}, orderCode {}", uid, orderCode);
throw new ServiceException(ServiceError.ORDER_REQUEST_PARM_IS_EMPTY);
}
BuyerOrderGoods pbog = buyerOrderGoodsMapper.selectOnlyByOrderCode(orderCode);
if (Objects.isNull(pbog)){
LOGGER.warn("in noticeAppraiseAddressChanged BuyerOrderGoods not exist, uid {}, order code {}", uid, orderCode);
return null;
}
int skup = pbog.getSkup();
AddressInfo buyerAddress = findSellerAddressInfo(uid, skup);
LOGGER.info("in noticeAppraiseAddressChanged get Address {} orderCode {}, skup {}", buyerAddress, orderCode, skup);
// 根据用户id查询默认地址的省份
AppraiseAddressResp resp = null;
if (null != buyerAddress ) {
// 根据产品给的哪些用户的省份匹配到对应的鉴定中心地址
resp = appraiseAddressService.queryAddressByAreaCode(buyerAddress.getAreaCode());
}
// 匹配不了,给个娄底的
resp = resp==null ? appraiseAddressService.queryInitAddress() : resp;
if (resp.getType() == 1){
resp.setChanged(true);
}else{
resp = null;
}
return resp;
}
}
... ...
... ... @@ -17,7 +17,7 @@ public final class MsgHelper {
return "订单不存在";
}
if (ActionStatusHold.sellerCanCancelBuyerOrder(buyerOrder.getStatus())) {
confirmDesc = "您确定取消出售吗?取消后将根据《买家须知》" + FLAG_PRE + "扣除对应保证金" + FLAG_SUFFIX + "作为赔偿打入卖家账户";
confirmDesc = "您确定取消出售吗?取消后将根据《卖家须知》" + FLAG_PRE + "扣除对应保证金" + FLAG_SUFFIX + "作为赔偿打入买家账户";
}else {
confirmDesc = "无法取消,请刷新后查看订单最新状态";
}
... ...
... ... @@ -75,7 +75,7 @@ public class ResourcesServiceImpl implements IResourcesService {
List list = resourcesRedisCache.get(cacheKey, List.class);
if (Objects.nonNull(list)) {
log.info("Find all resource content data by content code is {},client type is {} success from cache.", request.getContentCode(), request.getClientType());
// return list;
return list;
}
//(4)查找所有资源数据
list = handlerCommonFloors(getResourcesMetadataFromDatabase(request.getContentCode()).orElse(null), request.getClientType(), Constant.EMPTY_STRING);
... ...
... ... @@ -27,11 +27,11 @@
</appender>
<appender name="RECOMMEND_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/recommend.log</file>
<file>/Data/logs/ufo-gateway/recommend.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- daily rollover -->
<fileNamePattern>
${yoho.logs.basedir}/${ufo.gateway.env.namespace}/archived/recommend.%d{yyyy-MM-dd}.%i.log.gz
/Data/logs/ufo-gateway/archived/recommend.%d{yyyy-MM-dd}.%i.log.gz
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 100MB -->
... ... @@ -46,10 +46,10 @@
</appender>
<appender name="LOGIN_LOW_CLIENT_TYPE_RECORD" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/login_low_clientType_record.log</file>
<file>/Data/logs/ufo-gateway/login_low_clientType_record.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- daily rollover -->
<fileNamePattern>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/archived/login_low_clientType_record.%d{yyyy-MM-dd}.%i.log.gz
<fileNamePattern>/Data/logs/ufo-gateway/archived/login_low_clientType_record.%d{yyyy-MM-dd}.%i.log.gz
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 100MB -->
... ... @@ -66,10 +66,10 @@
<appender name="GRAPH_VERIFY_SWITCH" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/graph_verify_switch.log</file>
<file>/Data/logs/ufo-gateway/graph_verify_switch.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- daily rollover -->
<fileNamePattern>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/archived/graph_verify_switch.%d{yyyy-MM-dd}.%i.log.gz
<fileNamePattern>/Data/logs/ufo-gateway/archived/graph_verify_switch.%d{yyyy-MM-dd}.%i.log.gz
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 100MB -->
... ... @@ -85,11 +85,11 @@
</appender>
<appender name="LOGIN_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/login.log</file>
<file>/Data/logs/ufo-gateway/login.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- daily rollover -->
<fileNamePattern>
${yoho.logs.basedir}/${ufo.gateway.env.namespace}/archived/login.%d{yyyy-MM-dd}.%i.log.gz
/Data/logs/ufo-gateway/archived/login.%d{yyyy-MM-dd}.%i.log.gz
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 100MB -->
... ... @@ -104,11 +104,11 @@
</appender>
<appender name="SESSION_LOGIN_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/session-login.log</file>
<file>/Data/logs/ufo-gateway/session-login.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- daily rollover -->
<fileNamePattern>
${yoho.logs.basedir}/${ufo.gateway.env.namespace}/archived/session-login.%d{yyyy-MM-dd}.%i.log.gz
/Data/logs/ufo-gateway/archived/session-login.%d{yyyy-MM-dd}.%i.log.gz
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 100MB -->
... ... @@ -124,11 +124,11 @@
<!-- DEBUG级别日志 appender -->
<appender name="ORDER_CLOSE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/order-close.log</file>
<file>/Data/logs/ufo-gateway/order-close.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- daily rollover -->
<fileNamePattern>
${yoho.logs.basedir}/${ufo.gateway.env.namespace}/archived/order-close.%d{yyyy-MM-dd}.%i.log.gz
/Data/logs/ufo-gateway/archived/order-close.%d{yyyy-MM-dd}.%i.log.gz
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 100MB -->
... ... @@ -143,10 +143,10 @@
</appender>
<appender name="MQ_CONSUMER" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/mq-consumer.log</file>
<file>/Data/logs/ufo-gateway/mq-consumer.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 按天回滚 daily -->
<fileNamePattern>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/archived/mq-consumer.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<fileNamePattern>/Data/logs/ufo-gateway/archived/mq-consumer.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>${yoho.logs.maxHistory}</maxHistory>
</rollingPolicy>
... ... @@ -159,10 +159,10 @@
</appender>
<appender name="MQ_PRODUCER" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/mq-producer.log</file>
<file>/Data/logs/ufo-gateway/mq-producer.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 按天回滚 daily -->
<fileNamePattern>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/archived/mq-producer.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<fileNamePattern>/Data/logs/ufo-gateway/archived/mq-producer.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>${yoho.logs.maxHistory}</maxHistory>
</rollingPolicy>
... ... @@ -176,10 +176,10 @@
<appender name="SELLER_ORDER" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/seller-order.log</file>
<file>/Data/logs/ufo-gateway/seller-order.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 按天回滚 daily -->
<fileNamePattern>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/archived/seller-order.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<fileNamePattern>/Data/logs/ufo-gateway/archived/seller-order.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>${yoho.logs.maxHistory}</maxHistory>
</rollingPolicy>
... ... @@ -193,10 +193,10 @@
<appender name="BUYER_ORDER" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/buyer-order.log</file>
<file>/Data/logs/ufo-gateway/buyer-order.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 按天回滚 daily -->
<fileNamePattern>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/archived/buyer-order.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<fileNamePattern>/Data/logs/ufo-gateway/archived/buyer-order.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>${yoho.logs.maxHistory}</maxHistory>
</rollingPolicy>
... ...