Commit f17b9e46 by 吕明尚

实付金额不为0的订单增加验卷校验

parent 7bb538d0
...@@ -131,7 +131,7 @@ public class QPServiceImplAspect { ...@@ -131,7 +131,7 @@ public class QPServiceImplAspect {
couponLog.setStatus(YesNoEnum.no.getDisplay_3()); couponLog.setStatus(YesNoEnum.no.getDisplay_3());
couponLog.setNumber(TRY_NUMBER); couponLog.setNumber(TRY_NUMBER);
couponLog.setCreateTime(new Date()); couponLog.setCreateTime(new Date());
couponLog.setMessage(stackTraceToString(e.getClass().getName(), e.getMessage(), e.getStackTrace())); couponLog.setMessage(e.getMessage());
} catch (Exception e2) { } catch (Exception e2) {
e2.printStackTrace(); e2.printStackTrace();
......
package share.web.controller.system;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import share.common.core.domain.AjaxResult;
import share.system.service.ISOrderService;
@RestController
@RequestMapping("/openInterface")
public class OpenInterfaceController {
@Autowired
private ISOrderService sOrderService;
@GetMapping("/order/info")
public AjaxResult orderInfo(String orderNo) {
return AjaxResult.success(sOrderService.orderInfo(orderNo));
}
}
package share.system.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
public class OrderVo {
/**
* 订单编号
*/
private String orderNo;
/**
* 支付类型(1:微信,2:支付宝)
*/
private Integer payType;
/**
* 支付时间
*/
private Date payTime;
/**
* 订单时长
*/
private String timeLong;
/**
* 预约开始时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private Date preStartDate;
/**
* 预约结束时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private Date preEndDate;
/**
* 开始时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private Date startDate;
/**
* 结束时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private Date endDate;
/**
* 门店名称
*/
private String storeName;
/**
* 房间名称
*/
private String roomName;
//房间图片
private String roomImages;
//房间类型
private String roomType;
//房间类型名称
private String roomTypeName;
/**
* 门店地址
*/
private String address;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
//是否可以申请退款
private Boolean isRefund;
//套餐名称
private String packName;
//优惠卷名称
private String couponName;
}
...@@ -5,6 +5,7 @@ import java.util.List; ...@@ -5,6 +5,7 @@ import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import share.system.domain.SOrder; import share.system.domain.SOrder;
import share.system.domain.vo.OrderVo;
import share.system.domain.vo.SOrderVo; import share.system.domain.vo.SOrderVo;
import share.system.request.CreateOrderRequest; import share.system.request.CreateOrderRequest;
import share.system.request.OrderComputedPriceRequest; import share.system.request.OrderComputedPriceRequest;
...@@ -171,4 +172,6 @@ public interface ISOrderService extends IService<SOrder> ...@@ -171,4 +172,6 @@ public interface ISOrderService extends IService<SOrder>
* @return * @return
*/ */
List<SOrder> payedUnrefundListByUserId(Long userId); List<SOrder> payedUnrefundListByUserId(Long userId);
OrderVo orderInfo(String orderNo);
} }
...@@ -91,7 +91,7 @@ public class QPServiceImpl implements QPService { ...@@ -91,7 +91,7 @@ public class QPServiceImpl implements QPService {
@Override @Override
public TuangouReceiptPrepareResponseEntityVo consumeByUser(String code, String openShopUuid, String status) { public TuangouReceiptPrepareResponseEntityVo consumeByUser(String code, String openShopUuid, String status) {
//验券准备 //验券准备
TuangouReceiptPrepareResponseEntity prepare = prepare(code, openShopUuid, status); TuangouReceiptPrepareResponseEntity prepare = prepare(code.trim(), openShopUuid, status);
//获取用户信息 //获取用户信息
SConsumer user = FrontTokenComponent.getWxSConsumerEntry(); SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
//查询领取记录表 //查询领取记录表
......
...@@ -309,6 +309,18 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme ...@@ -309,6 +309,18 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
checkOrderDate(request); checkOrderDate(request);
//校验订单套餐 //校验订单套餐
checkOrderPack(request,user); checkOrderPack(request,user);
if (Objects.nonNull(request.getCouponId()) && request.getCouponId() != 0) {
SConsumerCoupon byId = consumerCouponService.getById(request.getCouponId());
if (byId.getUseStatus().equals(UserStatusEnum.UNUSED.getCode())) {
if (Objects.nonNull(byId)) {
qpService.prepare(byId.getCouponCode(), sStore.getOpenShopUuid(), ConsumerCouponStatusEnum.ORDER.getCode());
} else {
throw new BaseException("优惠券不存在!");
}
} else {
throw new BaseException("优惠券已使用!");
}
}
OrderPayResultResponse response = new OrderPayResultResponse(); OrderPayResultResponse response = new OrderPayResultResponse();
if (request.getPayFee().compareTo(BigDecimal.ZERO) <= 0) { if (request.getPayFee().compareTo(BigDecimal.ZERO) <= 0) {
response.setPayType(PayTypeEnum.WECHAT.getValue()); response.setPayType(PayTypeEnum.WECHAT.getValue());
...@@ -851,6 +863,37 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme ...@@ -851,6 +863,37 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
return list(queryWrapper); return list(queryWrapper);
} }
@Override
public OrderVo orderInfo(String orderNo) {
SOrder en = getByOrderNo(orderNo);
OrderVo vo = new OrderVo();
BeanUtils.copyProperties(en, vo);
SStore store = storeService.getById(en.getStoreId());
SRoom room = roomService.getById(en.getRoomId());
vo.setStoreName(store.getName());
vo.setAddress(store.getAddress());
vo.setRoomImages(room.getImages());
vo.setRoomName(room.getName());
vo.setRoomType(room.getRoomType());
vo.setRoomTypeName(RoomType.getNameByCode(room.getRoomType()));
vo.setLongitude(store.getLongitude());
vo.setLatitude(store.getLatitude());
if (ObjectUtil.isNotEmpty(en.getCouponId())) {
SConsumerCoupon consumerCoupon = consumerCouponService.getById(en.getCouponId());
vo.setCouponName(consumerCoupon.getName());
// 判断是否可以退款
vo.setIsRefund(isRefund(en, consumerCoupon));
} else {
// 判断是否可以退款
vo.setIsRefund(isRefund(en, null));
}
if (ObjectUtil.isNotEmpty(en.getPackId())) {
SPack byId = packService.getById(en.getPackId());
vo.setPackName(byId.getName());
}
return vo;
}
/** /**
* 订单DO集合转换VO集合,按距离排序 * 订单DO集合转换VO集合,按距离排序
* *
......
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