修复评测异常及单独处理拼团订单未支付时间
This commit is contained in:
@@ -270,7 +270,7 @@ dubbo:
|
|||||||
bxg:
|
bxg:
|
||||||
shop:
|
shop:
|
||||||
# API_URL: http://192.168.10.113:48080/bxgApp
|
# API_URL: http://192.168.10.113:48080/bxgApp
|
||||||
API_URL: http://1cbbf622.r5.cpolar.top
|
API_URL: http://16a9b0c.r5.cpolar.top
|
||||||
SITE_URL: http://192.168.10.113:48080/bxgApp
|
SITE_URL: http://192.168.10.113:48080/bxgApp
|
||||||
UNI_SITE_URL: http://192.168.10.113:48080/bxgApp
|
UNI_SITE_URL: http://192.168.10.113:48080/bxgApp
|
||||||
ADMIN_API_URL: http://192.168.10.113:48080/bxg
|
ADMIN_API_URL: http://192.168.10.113:48080/bxg
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public enum OrderInfoEnum {
|
|||||||
STATUS_1(1,"待收货"),
|
STATUS_1(1,"待收货"),
|
||||||
STATUS_2(2,"已收货"),
|
STATUS_2(2,"已收货"),
|
||||||
STATUS_3(3,"已完成"),
|
STATUS_3(3,"已完成"),
|
||||||
STATUS_8(3,"已取消"),
|
STATUS_8(8,"已取消"),
|
||||||
PAY_STATUS_0(0,"未支付"),
|
PAY_STATUS_0(0,"未支付"),
|
||||||
PAY_STATUS_1(1,"已支付"),
|
PAY_STATUS_1(1,"已支付"),
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -177,7 +177,8 @@ public class YxEvaluationServiceImpl extends BaseServiceImpl<YxEvaluationMapper,
|
|||||||
})
|
})
|
||||||
public EvaluationDTO getEvaluationById(Long uid,int id) {
|
public EvaluationDTO getEvaluationById(Long uid,int id) {
|
||||||
EvaluationDTO evaluationDTO=generator.convert(this.baseMapper.selectById(id), EvaluationDTO.class);
|
EvaluationDTO evaluationDTO=generator.convert(this.baseMapper.selectById(id), EvaluationDTO.class);
|
||||||
YxStoreProduct yxStoreProduct = yxStoreProductService.getProductInfo(Long.valueOf(evaluationDTO.getProduct()));
|
// YxStoreProduct yxStoreProduct = yxStoreProductService.getProductInfo(Long.valueOf(evaluationDTO.getProduct()));
|
||||||
|
YxStoreProduct yxStoreProduct=yxStoreProductService.getById(evaluationDTO.getProduct());
|
||||||
evaluationDTO.setProductInfo(yxStoreProduct);
|
evaluationDTO.setProductInfo(yxStoreProduct);
|
||||||
//是否收藏
|
//是否收藏
|
||||||
boolean isCollect = yxEvaluationRelationService.isEvaluationRelation(id, uid);
|
boolean isCollect = yxEvaluationRelationService.isEvaluationRelation(id, uid);
|
||||||
|
|||||||
+45
-11
@@ -29,12 +29,10 @@ import co.yixiang.event.TemplateListenEnum;
|
|||||||
import co.yixiang.exception.BadRequestException;
|
import co.yixiang.exception.BadRequestException;
|
||||||
import co.yixiang.exception.EntityExistException;
|
import co.yixiang.exception.EntityExistException;
|
||||||
import co.yixiang.exception.ErrorRequestException;
|
import co.yixiang.exception.ErrorRequestException;
|
||||||
|
import co.yixiang.modules.activity.domain.YxStoreCombination;
|
||||||
import co.yixiang.modules.activity.domain.YxStoreCouponUser;
|
import co.yixiang.modules.activity.domain.YxStoreCouponUser;
|
||||||
import co.yixiang.modules.activity.domain.YxStorePink;
|
import co.yixiang.modules.activity.domain.YxStorePink;
|
||||||
import co.yixiang.modules.activity.service.YxStoreBargainService;
|
import co.yixiang.modules.activity.service.*;
|
||||||
import co.yixiang.modules.activity.service.YxStoreBargainUserService;
|
|
||||||
import co.yixiang.modules.activity.service.YxStoreCouponUserService;
|
|
||||||
import co.yixiang.modules.activity.service.YxStorePinkService;
|
|
||||||
import co.yixiang.modules.activity.vo.StoreCouponUserVo;
|
import co.yixiang.modules.activity.vo.StoreCouponUserVo;
|
||||||
import co.yixiang.modules.cart.domain.YxStoreBrandCart;
|
import co.yixiang.modules.cart.domain.YxStoreBrandCart;
|
||||||
import co.yixiang.modules.cart.domain.YxStoreCart;
|
import co.yixiang.modules.cart.domain.YxStoreCart;
|
||||||
@@ -180,6 +178,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
|||||||
private StoreOrderMapper yxStoreOrderMapper;
|
private StoreOrderMapper yxStoreOrderMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private StoreCartMapper storeCartMapper;
|
private StoreCartMapper storeCartMapper;
|
||||||
|
@Autowired
|
||||||
|
private YxStoreCombinationService yxStoreCombinationService;
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -579,9 +579,27 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
|||||||
// 加入redis,30分钟自动取消
|
// 加入redis,30分钟自动取消
|
||||||
String redisKey = String.valueOf(StrUtil.format("{}{}",
|
String redisKey = String.valueOf(StrUtil.format("{}{}",
|
||||||
ShopConstants.REDIS_ORDER_OUTTIME_UNPAY, storeOrder.getId()));
|
ShopConstants.REDIS_ORDER_OUTTIME_UNPAY, storeOrder.getId()));
|
||||||
|
// 这里对拼团订单进行特殊处理(拼团订单不固定为30分钟)
|
||||||
|
if (combinationId != null && combinationId > 0){ //判断为拼团订单
|
||||||
|
YxStoreCombination yxStoreCombination=yxStoreCombinationService.getById(combinationId);
|
||||||
|
// long nd = 1000 * 24 * 60 * 60;
|
||||||
|
// long nh = 1000 * 60 * 60;
|
||||||
|
long nm = 1000 * 60;
|
||||||
|
long outTime=ShopConstants.ORDER_OUTTIME_UNPAY*2*yxStoreCombination.getEffectiveTime();//拼团订单时间
|
||||||
|
long endTime=yxStoreCombination.getStopTime().getTime()-new Date().getTime();
|
||||||
|
long endTimeMin=endTime % nm;
|
||||||
|
if (outTime<endTimeMin){ //开团的时效小于拼团的截至时间
|
||||||
|
stringRedisTemplate.opsForValue().set(redisKey, storeOrder.getOrderId(),
|
||||||
|
outTime,TimeUnit.MINUTES);
|
||||||
|
}else {
|
||||||
|
stringRedisTemplate.opsForValue().set(redisKey, storeOrder.getOrderId(),
|
||||||
|
endTimeMin,TimeUnit.MINUTES);
|
||||||
|
}
|
||||||
|
|
||||||
|
}else {
|
||||||
stringRedisTemplate.opsForValue().set(redisKey, storeOrder.getOrderId(),
|
stringRedisTemplate.opsForValue().set(redisKey, storeOrder.getOrderId(),
|
||||||
ShopConstants.ORDER_OUTTIME_UNPAY, TimeUnit.MINUTES);
|
ShopConstants.ORDER_OUTTIME_UNPAY, TimeUnit.MINUTES);
|
||||||
|
}
|
||||||
//使用MQ延时消息
|
//使用MQ延时消息
|
||||||
// TemplateBean templateBean = TemplateBean.builder()
|
// TemplateBean templateBean = TemplateBean.builder()
|
||||||
// .orderId(storeOrder.getId()+"")
|
// .orderId(storeOrder.getId()+"")
|
||||||
@@ -1179,7 +1197,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
|||||||
.eq(YxStoreOrder::getRefundStatus, OrderInfoEnum.REFUND_STATUS_0.getValue())
|
.eq(YxStoreOrder::getRefundStatus, OrderInfoEnum.REFUND_STATUS_0.getValue())
|
||||||
.eq(YxStoreOrder::getStatus, OrderInfoEnum.STATUS_0.getValue());
|
.eq(YxStoreOrder::getStatus, OrderInfoEnum.STATUS_0.getValue());
|
||||||
break;
|
break;
|
||||||
case STATUS_8:
|
case STATUS_8://已取消订单
|
||||||
wrapper.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_0.getValue())
|
wrapper.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_0.getValue())
|
||||||
.eq(YxStoreOrder::getRefundStatus, OrderInfoEnum.REFUND_STATUS_0.getValue())
|
.eq(YxStoreOrder::getRefundStatus, OrderInfoEnum.REFUND_STATUS_0.getValue())
|
||||||
.eq(YxStoreOrder::getStatus, OrderInfoEnum.STATUS_8.getValue());
|
.eq(YxStoreOrder::getStatus, OrderInfoEnum.STATUS_8.getValue());
|
||||||
@@ -1188,7 +1206,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
|||||||
case STATUS_1:
|
case STATUS_1:
|
||||||
wrapper.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue())
|
wrapper.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue())
|
||||||
.eq(YxStoreOrder::getRefundStatus, OrderInfoEnum.REFUND_STATUS_0.getValue())
|
.eq(YxStoreOrder::getRefundStatus, OrderInfoEnum.REFUND_STATUS_0.getValue())
|
||||||
.eq(YxStoreOrder::getStatus, OrderInfoEnum.STATUS_0.getValue());
|
.between(YxStoreOrder::getStatus, OrderInfoEnum.STATUS_0.getValue(),OrderInfoEnum.STATUS_5.getValue()); //待审核/代发货都为代发货
|
||||||
break;
|
break;
|
||||||
//待收货
|
//待收货
|
||||||
case STATUS_2:
|
case STATUS_2:
|
||||||
@@ -1402,7 +1420,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
|||||||
}
|
}
|
||||||
wrapperThree.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue())
|
wrapperThree.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue())
|
||||||
.eq(YxStoreOrder::getRefundStatus, OrderInfoEnum.REFUND_STATUS_0.getValue())
|
.eq(YxStoreOrder::getRefundStatus, OrderInfoEnum.REFUND_STATUS_0.getValue())
|
||||||
.eq(YxStoreOrder::getStatus, OrderInfoEnum.STATUS_0.getValue());
|
.between(YxStoreOrder::getStatus, OrderInfoEnum.STATUS_0.getValue(),OrderInfoEnum.STATUS_5.getValue());
|
||||||
|
// .eq(YxStoreOrder::getStatus, OrderInfoEnum.STATUS_0.getValue());
|
||||||
Long unshippedCount = yxStoreOrderMapper.selectCount(wrapperThree);
|
Long unshippedCount = yxStoreOrderMapper.selectCount(wrapperThree);
|
||||||
|
|
||||||
//订单待收货 数量
|
//订单待收货 数量
|
||||||
@@ -1483,8 +1502,23 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
|||||||
|
|
||||||
StatusDto statusDTO = new StatusDto();
|
StatusDto statusDTO = new StatusDto();
|
||||||
if (OrderStatusEnum.STATUS_0.getValue().equals(order.getPaid())) {
|
if (OrderStatusEnum.STATUS_0.getValue().equals(order.getPaid())) {
|
||||||
//计算未支付到自动取消订 时间
|
//计算未支付到自动取消订单时间
|
||||||
int offset = Integer.valueOf(String.valueOf(ShopConstants.ORDER_OUTTIME_UNPAY));
|
int offset;
|
||||||
|
if (order.getCombinationId() != null && order.getCombinationId() > 0){ //判断为拼团订单
|
||||||
|
YxStoreCombination yxStoreCombination=yxStoreCombinationService.getById(order.getCombinationId());
|
||||||
|
long nm = 1000 * 60;
|
||||||
|
long outTime=ShopConstants.ORDER_OUTTIME_UNPAY*2*yxStoreCombination.getEffectiveTime();//拼团的团的成团时效
|
||||||
|
long endTime=yxStoreCombination.getStopTime().getTime()-order.getCreateTime().getTime();
|
||||||
|
long endTimeMin=endTime % nm;
|
||||||
|
if (outTime<endTimeMin){ //开团的时效小于拼团的截至时间
|
||||||
|
offset=Integer.valueOf(String.valueOf(outTime));
|
||||||
|
}else {
|
||||||
|
offset=Integer.valueOf(String.valueOf(endTimeMin));
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
offset = Integer.valueOf(String.valueOf(ShopConstants.ORDER_OUTTIME_UNPAY));//普通订单30分钟
|
||||||
|
}
|
||||||
|
// int offset = Integer.valueOf(String.valueOf(ShopConstants.ORDER_OUTTIME_UNPAY));
|
||||||
Date time = DateUtil.offsetMinute(order.getCreateTime(), offset);
|
Date time = DateUtil.offsetMinute(order.getCreateTime(), offset);
|
||||||
statusDTO.set_class("nobuy");
|
statusDTO.set_class("nobuy");
|
||||||
statusDTO.set_msg(StrUtil.format("请在{}前完成支付", DateUtil.formatDateTime(time)));
|
statusDTO.set_msg(StrUtil.format("请在{}前完成支付", DateUtil.formatDateTime(time)));
|
||||||
@@ -1500,7 +1534,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
|||||||
statusDTO.set_msg("已为您退款,感谢您的支持");
|
statusDTO.set_msg("已为您退款,感谢您的支持");
|
||||||
statusDTO.set_type("-2");
|
statusDTO.set_type("-2");
|
||||||
statusDTO.set_title("已退款");
|
statusDTO.set_title("已退款");
|
||||||
} else if (OrderInfoEnum.STATUS_0.getValue().equals(order.getStatus())) {
|
} else if (OrderInfoEnum.STATUS_0.getValue().equals(order.getStatus())|OrderInfoEnum.STATUS_5.getValue().equals(order.getStatus())) {
|
||||||
// 拼团
|
// 拼团
|
||||||
if (order.getPinkId() > 0) {
|
if (order.getPinkId() > 0) {
|
||||||
if (pinkService.pinkIngCount(order.getPinkId()) > 0) {
|
if (pinkService.pinkIngCount(order.getPinkId()) > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user