Authored by caoyan

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

... ... @@ -151,8 +151,8 @@ public class SecurityInterceptor implements HandlerInterceptor, ApplicationEvent
cacheKey = getSessionCacheKey(jSessionID, clientType, sessionType);
sessionInfo = valueOperations.get(cacheKey);
if(null == sessionInfo){ //如果REDIS主从延迟, 从主REDIS中获取SESSION
cacheKey = RedisKeyBuilder.newInstance().appendFixed(SESSION_CACHE_KEY_PRE).appendVar(jSessionID);
sessionInfo = valueOperations.get(cacheKey);
RedisKeyBuilder commonCacheKey = RedisKeyBuilder.newInstance().appendFixed(SESSION_CACHE_KEY_PRE).appendVar(jSessionID);
sessionInfo = valueOperations.get(commonCacheKey);
}
}catch (Exception redisException){
//如果redis异常,直接放通
... ... @@ -161,7 +161,8 @@ public class SecurityInterceptor implements HandlerInterceptor, ApplicationEvent
}
//8 session双云同步延迟时,获取用户session
if(null == sessionInfo){
//兼容处理session缓存值不为数字的情况
if(null == sessionInfo || (StringUtils.isNotEmpty(sessionInfo) && !StringUtils.isNumeric(sessionInfo))){
sessionInfo = this.getUserSesion(cacheKey,uid, jSessionID, clientType, sessionType);
}
... ...
... ... @@ -13,8 +13,18 @@ public class PriceTrendModel {
private BigDecimal skuPrice;
public Integer getEndTime() {
return endTime;
}
public void setEndTime(Integer endTime) {
this.endTime = endTime;
}
private Integer createTime;
private Integer endTime;
public Integer getId() {
return id;
}
... ...
... ... @@ -24,7 +24,7 @@ public class ActionStatusHold {
OrderStatus.SELLER_SEND_OUT.getCode(),
OrderStatus.PLATFORM_RECEIVE.getCode(),
OrderStatus.PLATFORM_CHECKING.getCode(),
OrderStatus.JUDGE_PASS.getCode(),
//OrderStatus.JUDGE_PASS.getCode(),
OrderStatus.WAITING_RECEIVE.getCode(),
OrderStatus.DONE.getCode(),
OrderStatus.CHECKING_FAKE.getCode(),
... ... @@ -58,7 +58,7 @@ public class ActionStatusHold {
OrderStatus.PLATFORM_CHECKING.getCode(),
OrderStatus.WAITING_RECEIVE.getCode(),
OrderStatus.PLATFORM_RECEIVE.getCode(),
OrderStatus.JUDGE_PASS.getCode(),
//OrderStatus.JUDGE_PASS.getCode(),
OrderStatus.BUYER_CANCEL_BEFORE_SELLER_DELIVER.getCode(),
OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode());
}
... ... @@ -89,7 +89,7 @@ public class ActionStatusHold {
final static List<Integer> View_Express_Status = Arrays.asList(OrderStatus.SELLER_SEND_OUT.getCode(),
OrderStatus.PLATFORM_RECEIVE.getCode(),
OrderStatus.PLATFORM_CHECKING.getCode(),
OrderStatus.JUDGE_PASS.getCode(),
//OrderStatus.JUDGE_PASS.getCode(),
OrderStatus.CHECKING_FAKE.getCode(),
OrderStatus.WAITING_RECEIVE.getCode(),OrderStatus.DONE.getCode(),
OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode());
... ...
... ... @@ -40,33 +40,6 @@ public class AppraiseController {
}
/**
* 鉴定中心鉴定通过后,发货
* 提供给运营平台使用
* @return
*/
@RequestMapping(value="/deliverGoods")
@IgnoreSession
@IgnoreSignature
public ApiResponse deliverGoods(@RequestBody AppraiseExpressInfoBo appraiseExpressInfoBo) {
logger.info("in deliverGoods , req {}", appraiseExpressInfoBo);
appraiseService.deliverGoods(appraiseExpressInfoBo);
return new ApiResponse();
}
/**
* 鉴定中心鉴定不通过后,寄回
* 提供给运营平台使用
* @return
*/
@RequestMapping(value="/returnBackOrderCauseOfJudgeFailure")
@IgnoreSession
@IgnoreSignature
public ApiResponse returnBackOrderCauseOfJudgeFailure(@RequestBody AppraiseExpressInfoBo appraiseExpressInfoBo) {
logger.info("in returnBackOrderCauseOfJudgeFailure , req {}", appraiseExpressInfoBo);
appraiseService.returnBackOrderCauseOfJudgeFailure(appraiseExpressInfoBo);
return new ApiResponse();
}
/**
* 卖家发货后,买家又取消了订单,鉴定中心寄回商品给卖家
* 提供给运营平台使用
* @return
... ... @@ -92,6 +65,21 @@ public class AppraiseController {
return appraiseService.appraiseFail(appraiseExpressInfoBo.getExpressCompanyId(), appraiseExpressInfoBo.getOrderCode(), appraiseExpressInfoBo.getWayBillCode(),appraiseExpressInfoBo.getDepotNum(),appraiseExpressInfoBo.getMobile());
}
/**
* 鉴定中心鉴定不通过后,寄回
* 提供给运营平台使用
* @return
*/
@RequestMapping(value="/returnBackOrderCauseOfJudgeFailure")
@IgnoreSession
@IgnoreSignature
public ApiResponse returnBackOrderCauseOfJudgeFailure(@RequestBody AppraiseExpressInfoBo appraiseExpressInfoBo) {
logger.info("in returnBackOrderCauseOfJudgeFailure , req {}", appraiseExpressInfoBo);
appraiseService.returnBackOrderCauseOfJudgeFailure(appraiseExpressInfoBo);
return new ApiResponse();
}
/**
* 鉴定通过,鉴定中心发货给买家
* @return
... ... @@ -104,4 +92,21 @@ public class AppraiseController {
return appraiseService.appraiseSuccess(appraiseExpressInfoBo.getExpressCompanyId(), appraiseExpressInfoBo.getOrderCode(), appraiseExpressInfoBo.getWayBillCode(),appraiseExpressInfoBo.getDepotNum(),appraiseExpressInfoBo.getMobile());
}
/*
* 鉴定中心鉴定通过后,发货
* 提供给运营平台使用
*
* 鉴定通过后直接发货
*
* @return
*/
/*@RequestMapping(value="/deliverGoods")
@IgnoreSession
@IgnoreSignature
public ApiResponse deliverGoods(@RequestBody AppraiseExpressInfoBo appraiseExpressInfoBo) {
logger.info("in deliverGoods , req {}", appraiseExpressInfoBo);
appraiseService.deliverGoods(appraiseExpressInfoBo);
return new ApiResponse();
}*/
}
... ...
... ... @@ -257,13 +257,13 @@ public class BuyerOrderController {
@IgnoreSession
@IgnoreSignature
@RequestMapping(value = "/erp/judgeBegin")
@RequestMapping(value = "/erp/qualityCheckPass")
@ResponseBody
public ApiResponse judgeBegin(@RequestBody OrderRequest request) {
LOG.info("method ufo.depot.judgeBegin in, req is {}", request);
buyerOrderService.judgeBegin(request.getOrderCode());
LOG.info("method ufo.depot.judgeBegin out, req is {}", request);
return new ApiResponse.ApiResponseBuilder().code(200).message("鉴定中心开始鉴定成功").build();
public ApiResponse qualityCheckPass(@RequestBody OrderRequest request) {
LOG.info("method ufo.depot.qualityCheckPass in, req is {}", request);
buyerOrderService.qualityCheckPass(request.getOrderCode());
LOG.info("method ufo.depot.qualityCheckPass out, req is {}", request);
return new ApiResponse.ApiResponseBuilder().code(200).message("鉴定中心质检通过成功").build();
}
@RequestMapping(params = "method=ufo.buyer.computeCompensate")
... ...
... ... @@ -54,7 +54,7 @@ public interface IBuyerOrderService extends IOrderListService, IOrderDetailServi
void confirmReceive(long orderCode);
void judgeBegin(long orderCode);
void qualityCheckPass(long orderCode);
OrderCntResp getOrderCnt(OrderRequest req, OrderListType listType);
}
... ...
... ... @@ -94,7 +94,7 @@ public interface IExpressInfoService {
ExpressInfoDetail getLastExpressInfoDetail(TabType actor,int status, Long orderCode);
List<Integer> status2OnlySellerExpressType = Arrays.asList(OrderStatus.PLATFORM_RECEIVE.getCode(),
OrderStatus.PLATFORM_CHECKING.getCode(),OrderStatus.JUDGE_PASS.getCode(), OrderStatus.WAITING_RECEIVE.getCode(),
OrderStatus.PLATFORM_CHECKING.getCode(), OrderStatus.WAITING_RECEIVE.getCode(),
OrderStatus.DONE.getCode());
/**
... ... @@ -117,7 +117,7 @@ public interface IExpressInfoService {
List<Integer> status2BuyerDeliverExpressStatusList = Arrays.asList(
OrderStatus.PLATFORM_RECEIVE.getCode(),
OrderStatus.PLATFORM_CHECKING.getCode(),
OrderStatus.JUDGE_PASS.getCode(),
//OrderStatus.JUDGE_PASS.getCode(),
OrderStatus.CHECKING_FAKE.getCode(),
OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode()
);
... ...
... ... @@ -108,7 +108,7 @@ public class AppraiseService {
throw new ServiceException(ServiceError.ORDER_NULL);
}
final OrderStatus expectOrderStatus = OrderStatus.PLATFORM_CHECKING;
final OrderStatus targetOrderStatus = OrderStatus.JUDGE_PASS;
final OrderStatus targetOrderStatus = OrderStatus.WAITING_RECEIVE;
if (expectOrderStatus.getCode() != buyerOrder.getStatus().intValue()){
LOGGER.warn("in appraiseSuccess, buyer Order orderCode {} pstatus {}, expect Order Status {}",
orderCode, buyerOrder.getStatus(), expectOrderStatus);
... ... @@ -196,8 +196,8 @@ public class AppraiseService {
BuyerConfirmEvent buyerConfirmEvent = BuyerConfirmEvent.builder().uid(buyerUid).orderCode(orderCode).build();
EventBusPublisher.publishEvent(buyerConfirmEvent);
//记录物流信息
//不发物流
//expressInfoService.appraiseSuccess(buyerUid, expressCompanyId, orderCode, wayBillCode, depotNum,mobile);
//发物流
expressInfoService.deliverGoods(buyerUid, expressCompanyId, orderCode, wayBillCode, depotNum,mobile);
//记录订单的状态变更信息
LOGGER.info("in appraiseSuccess record status change, orderCode {},uid {} ,sellerUid {}", orderCode,buyerUid,sellerUid);
... ... @@ -293,13 +293,13 @@ public class AppraiseService {
}
}
/**
/*
* 发货
* (1)更新订单状态
* (2)记录物流
* (3)消息
*/
public void deliverGoods(AppraiseExpressInfoBo appraiseExpressInfoBo){
/*public void deliverGoods(AppraiseExpressInfoBo appraiseExpressInfoBo){
Integer expressCompanyId = appraiseExpressInfoBo.getExpressCompanyId();
Long orderCode=appraiseExpressInfoBo.getOrderCode();
String wayBillCode=appraiseExpressInfoBo.getWayBillCode();
... ... @@ -362,7 +362,7 @@ public class AppraiseService {
buyerOrder.getStatus(), orderCode);
throw new UfoServiceException(400,"更新订单状态失败");
}
}
}*/
/**
* 鉴定不通过退回
... ... @@ -563,8 +563,9 @@ public class AppraiseService {
LOGGER.warn("in appraiseFail orderStatusFlowService or notice fail orderCode {}", orderCode, ex);
}finally {
//更新物流信息,写到最后
//鉴定不通过,不发物流
//expressInfoService.appraiseFail(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum,mobile);
//鉴定不通过,发物流
expressInfoService.returnBackOrderCauseOfJudgeFailure(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum,mobile);
//记录调拨信息(只保存卖家一条)
EnumExpressType expressType = EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER;
EnumExpressDataType expressDataType = EnumExpressDataType.operate_transfer;
... ...
... ... @@ -712,8 +712,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
}
@Override
public void judgeBegin(long orderCode){
logger.info("in judgeBegin, orderCode {}", orderCode);
public void qualityCheckPass(long orderCode){
logger.info("in qualityCheckPass, orderCode {}", orderCode);
OrderStatus expectStatus = OrderStatus.PLATFORM_RECEIVE;
OrderStatus targetStatus = OrderStatus.PLATFORM_CHECKING;
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode);
... ... @@ -721,16 +721,16 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
if (buyerOrder != null && buyerOrder.getStatus() == expectStatus.getCode()){
int uid = buyerOrder.getUid();
int sellerUid = buyerOrder.getSellerUid();
logger.info("in judgeBegin begin update status orderCode {},uid {} ,sellerUid {}", orderCode,uid,sellerUid);
logger.info("in qualityCheckPass begin update status orderCode {},uid {} ,sellerUid {}", orderCode,uid,sellerUid);
int num=buyerOrderMapper.updateStatusByOrderCode(orderCode, uid, expectStatus.getCode(),
targetStatus.getCode(), DateUtil.getCurrentTimeSecond());
//记录订单的状态变更信息
if(num>=1){
logger.info("in judgeBegin record status change, orderCode {},uid {} ,sellerUid {}", orderCode,uid,sellerUid);
logger.info("in qualityCheckPass record status change, orderCode {},uid {} ,sellerUid {}", orderCode,uid,sellerUid);
orderStatusFlowService.addAsy(buyerOrder.getOrderCode(),targetStatus.getCode());
}else{
logger.warn("in judgeBegin not record status change cause of update empty num , orderCode {},uid {} ,sellerUid {}", orderCode,uid,sellerUid);
logger.warn("in qualityCheckPass not record status change cause of update empty num , orderCode {},uid {} ,sellerUid {}", orderCode,uid,sellerUid);
}
//记录调拨信息(只保存卖家一条)
... ...
... ... @@ -385,7 +385,6 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
//6.根据状态重设expressType
if(Objects.equals(OrderStatus.PLATFORM_RECEIVE.getCode(),buyerOrder.getStatus())
||Objects.equals(OrderStatus.PLATFORM_CHECKING.getCode(),buyerOrder.getStatus())
||Objects.equals(OrderStatus.JUDGE_PASS.getCode(),buyerOrder.getStatus())
){
expressInfoRespBo.setExpressType(EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode().byteValue());
}
... ... @@ -404,7 +403,7 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
||OrderStatus.PLATFORM_CHECKING.getCode()==status){
seller_send_out_stage.setEnable(true);
judge_stage.setEnable(true);
}else if(OrderStatus.JUDGE_PASS.getCode()==status||OrderStatus.WAITING_RECEIVE.getCode()==status||OrderStatus.DONE.getCode()==status){
}else if(OrderStatus.WAITING_RECEIVE.getCode()==status||OrderStatus.DONE.getCode()==status){
seller_send_out_stage.setEnable(true);
judge_stage.setEnable(true);
platform_delivery_stage.setEnable(true);
... ... @@ -468,7 +467,7 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
if(OrderStatus.SELLER_SEND_OUT.getCode()==status
||OrderStatus.PLATFORM_RECEIVE.getCode()==status
||OrderStatus.PLATFORM_CHECKING.getCode()==status
||OrderStatus.JUDGE_PASS.getCode()==status){
){
return EnumExpressType.EXPRESS_TYPE_1.getCode();
}else if(OrderStatus.WAITING_RECEIVE.getCode()==status||OrderStatus.DONE.getCode()==status){
//4 和 5 状态有问题 ,买家查看物流是没问题的,卖家查看物流有问题啊.
... ...
... ... @@ -18,6 +18,16 @@ public class PriceTrendResp {
private String createTime;
private String endTime;
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public Integer getId() {
return id;
}
... ... @@ -81,6 +91,16 @@ public class PriceTrendResp {
private String createTime;
private String endTime;
public String getEndTime() {
return endTime;
}
public Builder setEndTime(String endTime) {
this.endTime = endTime;
return this;
}
public PriceTrendResp build() {
PriceTrendResp resp = new PriceTrendResp();
... ... @@ -89,6 +109,7 @@ public class PriceTrendResp {
resp.setSizeId(this.sizeId);
resp.setProductId(this.productId);
resp.setCreateTime(this.createTime);
resp.setEndTime(this.endTime);
return resp;
}
... ...
... ... @@ -60,6 +60,7 @@ public class ProductPriceService implements ApplicationContextAware{
.setSknPrice(item.getSknPrice())
.setSkuPrice(item.getSkuPrice())
.setCreateTime(DateUtil.getDateFormatEx(item.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS))
.setEndTime(DateUtil.getDateFormatEx(item.getEndTime(), DateUtil.yyyy_MM_dd_HH_mm_SS))
.build())
);
... ...
... ... @@ -29,7 +29,11 @@ public class PriceTrendDayService implements PriceTrendServiceInf{
LOG.info("method priceTrendDayMapper.selectByProductId in, productId:{},sizeId:{},currentSecond:{},tomorrowSecond:{}", productId, sizeId, currentSecond, tomorrowSecond);
return priceTrendDayMapper.selectByProductId(productId, sizeId, currentSecond, tomorrowSecond);
List<PriceTrendModel> priceTrendModels = priceTrendDayMapper.selectByProductId(productId, sizeId, currentSecond, tomorrowSecond);
priceTrendModels.stream().forEach(item -> item.setEndTime(null == item.getCreateTime() ? null : 7200 + item.getCreateTime()));
return priceTrendModels;
}
return Lists.newArrayList();
... ...
... ... @@ -19,7 +19,13 @@ public class PriceTrendHalfYearService implements PriceTrendServiceInf{
public List<PriceTrendModel> queryProductPriceTrend(Integer productId, Integer sizeId) {
if (null != productId) {
return priceTrendHalfYearMapper.selectByProductId(productId, sizeId, DateUtil.getTimeSecondOfDay(-180), DateUtil.getTimeSecondOfDay(0));
List<PriceTrendModel> priceTrendModels = priceTrendHalfYearMapper.selectByProductId(productId, sizeId, DateUtil.getTimeSecondOfDay(-180), DateUtil.getTimeSecondOfDay(0));
priceTrendModels.stream().forEach(item -> item.setEndTime(null == item.getCreateTime() ? null : 259200 + item.getCreateTime()));
return priceTrendModels;
}
return Lists.newArrayList();
... ...
... ... @@ -21,7 +21,11 @@ public class PriceTrendMonthService implements PriceTrendServiceInf{
public List<PriceTrendModel> queryProductPriceTrend(Integer productId, Integer sizeId) {
if (null != productId) {
return priceTrendMonthMapper.selectByProductId(productId, sizeId, DateUtil.getTimeSecondOfDay(-30), DateUtil.getTimeSecondOfDay(0));
List<PriceTrendModel> priceTrendModels = priceTrendMonthMapper.selectByProductId(productId, sizeId, DateUtil.getTimeSecondOfDay(-30), DateUtil.getTimeSecondOfDay(0));
priceTrendModels.stream().forEach(item -> item.setEndTime(null == item.getCreateTime() ? null : 43200 + item.getCreateTime()));
return priceTrendModels;
}
return Lists.newArrayList();
... ...
... ... @@ -19,7 +19,9 @@ public class PriceTrendSixtyDayService implements PriceTrendServiceInf{
public List<PriceTrendModel> queryProductPriceTrend(Integer productId, Integer sizeId) {
if (null != productId) {
return priceTrendSixtyDayMapper.selectByProductId(productId, sizeId, DateUtil.getTimeSecondOfDay(-30), DateUtil.getTimeSecondOfDay(0));
List<PriceTrendModel> priceTrendModels = priceTrendSixtyDayMapper.selectByProductId(productId, sizeId, DateUtil.getTimeSecondOfDay(-30), DateUtil.getTimeSecondOfDay(0));
priceTrendModels.stream().forEach(item -> item.setEndTime(null == item.getCreateTime() ? null : 86400 + item.getCreateTime()));
return priceTrendModels;
}
return Lists.newArrayList();
... ...