Commit 7c3fefce by 吕明尚

修改美团获取有效期为空的解决方法

parent a8e3bd0b
......@@ -111,6 +111,13 @@ public class SOrderVo
@ApiModelProperty(value = "结束时间")
private Date endDate;
/**
* 到店时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(name = "到店时间")
private Date arrivalTime;
/** 订单状态(0:待使用/已预约,1:使用中,2:已使用,3:已取消预约/退款中,4:审核中,5:已退费) */
@ApiModelProperty(value = "订单状态(0:待使用/已预约,1:使用中,2:已使用,3:已取消预约/申请退款,4:退款中,5:已退费)")
private Integer status;
......
......@@ -44,10 +44,7 @@ import share.system.service.QPService;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.UUID;
import java.util.*;
import java.util.concurrent.TimeUnit;
@Service
......@@ -134,14 +131,27 @@ public class QPServiceImpl implements QPService {
List<TuangouDealQueryShopDealResponseEntity> groupActivities = queryshopdeal(sStore.getOpenShopUuid());
groupActivities.forEach(o -> {
//套餐名称相同并且在售卖中
if (prepare.getDealgroup_id().equals(o.getDealgroup_id()) && saleStatusEnum.SELLING.getCode().equals(o.getSale_status())) {
if (prepare.getDealgroup_id().equals(o.getDealgroup_id())) {
Date receiptEndDate = DateUtil.parse(o.getReceipt_end_date(), DatePattern.NORM_DATETIME_MINUTE_PATTERN);
Date receiptBeginDate = DateUtil.parse(o.getReceipt_begin_date(), DatePattern.NORM_DATETIME_MINUTE_PATTERN);
sConsumerCoupon.setStartDate(receiptBeginDate);
sConsumerCoupon.setEndDate(receiptEndDate);
}
});
if (ObjectUtils.isEmpty(sConsumerCoupon.getStartDate())) {
//获取本日的00:00:00
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
Date startOfDay = calendar.getTime();
sConsumerCoupon.setStartDate(startOfDay);
}
if (ObjectUtils.isEmpty(sConsumerCoupon.getEndDate())) {
//当前时间加上一年
sConsumerCoupon.setEndDate(DateUtils.addYears(new Date(), 1));
}
List<SCoupon> sCoupons = isCouponService.selectSCouponByDealgroupId(prepare.getDealgroup_id());
SCoupon sCoupon = null;
if (!CollectionUtils.isEmpty(sCoupons)) {
......
......@@ -200,7 +200,7 @@ public class SCouponServiceImpl extends ServiceImpl<SCouponMapper, SCoupon> impl
List<TuangouDealQueryShopDealResponseEntity> queryshopdeal = qpService.queryshopdeal(openShopUuid);
if (!CollectionUtils.isEmpty(queryshopdeal)) {
queryshopdeal.stream().forEach(item -> {
if (TWO.equals(item.getSale_status())) {
// if (TWO.equals(item.getSale_status())) {
SCoupon sCoupon1 = sCouponList.get(item.getDealgroup_id());
if (ObjectUtils.isEmpty(sCoupon1)) {
SCoupon sCoupon = new SCoupon();
......@@ -234,7 +234,7 @@ public class SCouponServiceImpl extends ServiceImpl<SCouponMapper, SCoupon> impl
} else {
sCoupon1.setStoreIds(sCoupon1.getStoreIds() + "," + sStores.stream().filter(store -> store.getOpenShopUuid().equals(openShopUuid)).findFirst().get().getId());
}
}
// }
});
}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment