Commit 3ccddc38 by 吕明尚

优惠卷和优惠卷领取记录表增加订单类型,指定套餐id,订单表新增到店时间,修改用户开门判断

parent 3a137006
......@@ -96,6 +96,18 @@ public class SConsumerCoupon extends BaseEntity
@Excel(name = "优惠券来源(1:领取,2:赠送,3:验券)")
private String sourceType;
/**
* 订单类型(0:订房订单,1:续房订单,2:充值订单)
*/
@Excel(name = "订单类型(1:订房订单,2:续房订单,3:充值订单)")
private Integer orderType;
/**
* 绑定套餐ID
*/
@Excel(name = "绑定套餐ID")
private Long packageId;
/** 平台类型(1:自营,2:美团) */
@Excel(name = "平台类型(1:自营,2:美团)")
private String platformType;
......
......@@ -83,6 +83,18 @@ public class SCoupon extends BaseEntity
@Excel(name = "减去金额(满减券单位:元,折扣为系数)")
private BigDecimal subPrice;
/**
* 订单类型(0:订房订单,1:续房订单,2:充值订单)
*/
@Excel(name = "订单类型(1:订房订单,2:续房订单,3:充值订单)")
private Integer orderType;
/**
* 绑定套餐ID
*/
@Excel(name = "绑定套餐ID")
private Long packageId;
/** 是否可叠加使用(0:不可叠加,1:可叠加) */
@Excel(name = "是否可叠加使用(0:不可叠加,1:可叠加)")
private Integer isOverlay;
......
......@@ -112,6 +112,13 @@ public class SOrder extends BaseEntity
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm")
private Date endDate;
/**
* 到店时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "到店时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date arrivalTime;
/** 订单状态(0:待使用/已预约,1:使用中,2:已使用,3:已取消预约/退款中,4:审核中,5:已退费) */
@Excel(name = "订单状态(0:待使用/已预约,1:使用中,2:已使用,3:已取消预约/申请退款,4:退款中,5:已退费)")
private Integer status;
......
......@@ -59,5 +59,5 @@ public interface SCouponMapper
*/
public int deleteSCouponByIds(Long[] ids);
SCoupon selectSCouponByName(String dealTitle);
List<SCoupon> selectSCouponByName(String dealTitle);
}
......@@ -64,5 +64,5 @@ public interface ISCouponService
* @param dealTitle 优惠券名称
* @return 结果
*/
SCoupon selectSCouponByName(String dealTitle);
List<SCoupon> selectSCouponByName(String dealTitle);
}
......@@ -101,8 +101,8 @@ public class QPServiceImpl implements QPService {
return null;
}
}
//根据优惠卷名称查询优惠劵配置
SCoupon sCoupon = isCouponService.selectSCouponByName(prepare.getDeal_title());
//根据优惠卷名称查询优惠劵配置 查询list,取第一个
SCoupon sCoupon = isCouponService.selectSCouponByName(prepare.getDeal_title()).get(0);
TuangouReceiptPrepareResponseEntityVo response = new TuangouReceiptPrepareResponseEntityVo();
SConsumerCoupon sConsumerCoupon = new SConsumerCoupon();
sConsumerCoupon.setConsumerId(user.getId());
......
......@@ -20,7 +20,7 @@ import share.system.service.ISCouponService;
* @date 2023-09-27
*/
@Service
public class SCouponServiceImpl implements ISCouponService
public class SCouponServiceImpl implements ISCouponService
{
@Autowired
private SCouponMapper sCouponMapper;
......@@ -124,7 +124,7 @@ public class SCouponServiceImpl implements ISCouponService
* @return
*/
@Override
public SCoupon selectSCouponByName(String dealTitle) {
public List<SCoupon> selectSCouponByName(String dealTitle) {
return sCouponMapper.selectSCouponByName(dealTitle);
}
}
......@@ -933,7 +933,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
).collect(Collectors.toList()).isEmpty()) {
throw new BaseException("房间取电设备不存在!");
}
if (sOrder.getStatus().equals(OrderStatusEnum.UNUSED.getCode())) {
if (ObjectUtil.isNotEmpty(sOrder.getArrivalTime())) {
if (RoomStatusEnum.HOLD.getValue().compareTo(sRoomVo.getStatus())==0
||!checkOrderOpenDoor(sOrder)) {
throw new BaseException("房间当前时段已被占用不可开门!");
......@@ -954,6 +954,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
map.put("expirationTime", sOrder.getEndDate().toString());
JSONObject jsonObject = new JSONObject(map);
redisUtils.set(ReceiptRdeisEnum.ORDER_NO_KEY.getValue() + sOrder.getOrderNo(), jsonObject.toString());
sOrder.setArrivalTime(new Date());
baseMapper.updateById(sOrder);
//更改房间状态
SRoom sRoom = new SRoom();
......
......@@ -22,6 +22,8 @@
<result property="sourceType" column="source_type" />
<result property="roomType" column="room_type" />
<result property="storeType" column="store_type" />
<result property="orderType" column="order_type"/>
<result property="packageId" column="package_id"/>
<result property="platformType" column="platform_type" />
<result property="startDate" column="start_date" />
<result property="endDate" column="end_date" />
......@@ -67,7 +69,9 @@
delete_time,
remark,
room_type,
store_type
store_type,
order_type,
package_id
from s_consumer_coupon
</sql>
......@@ -89,6 +93,8 @@
<if test="subPrice != null "> and sub_price = #{subPrice}</if>
<if test="sourceType != null and sourceType != ''"> and source_type = #{sourceType}</if>
<if test="platformType != null and platformType != ''"> and platform_type = #{platformType}</if>
<if test="orderType != null and orderType != ''">and order_type = #{orderType}</if>
<if test="packageId != null ">and package_id = #{packageId}</if>
<if test="startDate != null "> and start_date = #{startDate}</if>
<if test="endDate != null "> and end_date = #{endDate}</if>
<if test="useDate != null "> and use_date = #{useDate}</if>
......@@ -150,6 +156,8 @@
<if test="remark != null">remark,</if>
<if test="roomType != null">room_type,</if>
<if test="storeType != null">store_type,</if>
<if test="orderType != null">order_type,</if>
<if test="packageId != null">package_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="consumerId != null">#{consumerId},</if>
......@@ -181,6 +189,8 @@
<if test="remark != null">#{remark},</if>
<if test="roomType != null">#{roomType},</if>
<if test="storeType != null">#{storeType},</if>
<if test="orderType != null">#{orderType},</if>
<if test="packageId != null">#{packageId},</if>
</trim>
</insert>
......@@ -216,6 +226,8 @@
<if test="remark != null">remark = #{remark},</if>
<if test="roomType != null">room_type = #{roomType},</if>
<if test="storeType != null">store_type = #{storeType},</if>
<if test="orderType != null">order_type = #{orderType},</if>
<if test="packageId != null">package_id = #{packageId},</if>
</trim>
where id = #{id}
</update>
......
......@@ -14,6 +14,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="storeType" column="store_type" />
<result property="roomType" column="room_type" />
<result property="couponType" column="coupon_type" />
<result property="orderType" column="order_type"/>
<result property="packageId" column="package_id"/>
<result property="duration" column="duration" />
<result property="minDuration" column="min_duration" />
<result property="maxDuration" column="max_duration" />
......@@ -32,7 +34,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectSCouponVo">
select id,name,start_date,
end_date,valid_start_time,valid_end_time,
store_type,room_type,coupon_type,
store_type,
room_type,
coupon_type,
order_type,
package_id,
duration,min_duration,max_duration,
min_price,sub_price,is_overlay,
platform_type,number,create_by,
......@@ -51,6 +57,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="storeType != null"> and store_type = #{storeType}</if>
<if test="roomType != null"> and room_type = #{roomType}</if>
<if test="couponType != null"> and coupon_type = #{couponType}</if>
<if test="orderType != null">and order_type = #{orderType}</if>
<if test="packageId != null">and package_id = #{packageId}</if>
<if test="duration != null and duration != ''"> and duration = #{duration}</if>
<if test="minDuration != null and minDuration != ''"> and min_duration = #{minDuration}</if>
<if test="maxDuration != null and maxDuration != ''"> and max_duration = #{maxDuration}</if>
......@@ -97,6 +105,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="remark != null">remark,</if>
<if test="orderType != null">order_type,</if>
<if test="packageId != null">package_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">#{name},</if>
......@@ -118,6 +128,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="remark != null">#{remark},</if>
<if test="orderType != null">#{orderType},</if>
<if test="packageId != null">#{packageId},</if>
</trim>
</insert>
......@@ -132,6 +144,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="storeType != null">store_type = #{storeType},</if>
<if test="roomType != null">room_type = #{roomType},</if>
<if test="couponType != null">coupon_type = #{couponType},</if>
<if test="orderType != null">order_type = #{orderType},</if>
<if test="packageId != null">package_id = #{packageId},</if>
<if test="duration != null and duration != ''">duration = #{duration},</if>
<if test="minDuration != null and minDuration != ''">min_duration = #{minDuration},</if>
<if test="maxDuration != null and maxDuration != ''">max_duration = #{maxDuration},</if>
......
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