Commit 1427045f by wuwenlong

Merge branch 'dev' into test

parents 5b6126fe c79a080c
......@@ -123,8 +123,8 @@ public class SConsumerCoupon extends BaseEntity
/**
* 绑定套餐ID
*/
@Excel(name = "绑定套餐ID")
private Long packageId;
@Excel(name = "适用套餐列表")
private String packIds;
/** 平台类型(1:自营,2:美团) */
@Excel(name = "平台类型(1:自营,2:美团)")
......
......@@ -90,10 +90,10 @@ public class SCoupon extends BaseEntity
private Integer orderType;
/**
* 绑定套餐ID
* 适用套餐列表
*/
@Excel(name = "绑定套餐ID")
private Long packageId;
@Excel(name = "适用套餐列表")
private String packIds;
/**
* 团购ID
......
......@@ -181,7 +181,7 @@ public class QPServiceImpl implements QPService {
sConsumerCoupon.setOrderType(sCoupon.getOrderType());
sConsumerCoupon.setDealgroupId(sCoupon.getDealgroupId());
sConsumerCoupon.setStoreIds(sCoupon.getStoreIds());
sConsumerCoupon.setPackageId(sCoupon.getPackageId());
sConsumerCoupon.setPackIds(sCoupon.getPackIds());
sConsumerCoupon.setWeeks(sCoupon.getWeeks());
sConsumerCoupon.setRemark(sCoupon.getRemark());
}
......
......@@ -257,10 +257,17 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
}
private Boolean checkPack(SConsumerCoupon item, CouponRequest couponRequest, List<SPack> sPacks){
if(Objects.nonNull(item.getPackageId())&&item.getPackageId().compareTo(couponRequest.getPackageId())!=0){
SPack pack = sPacks.stream().filter(obj -> obj.getId().compareTo(item.getPackageId())==0).findFirst().orElse(null);
item.setIsAvailable(AvailableEnum.UNAVAILABLE.getCode());
item.setReason("优惠卷当前套餐不可用,【"+pack.getName()+"】套餐可用");
if(couponRequest.getOrderMode().compareTo(BuyTypeEnum.PACK.getCode())==0
&&StringUtils.isNotBlank(item.getPackIds())&&Objects.nonNull(couponRequest.getPackageId())){
List<Long> confPackIds = Arrays.stream(item.getPackIds().split(",")).map(Long::parseLong).collect(Collectors.toList());
if(!confPackIds.contains(couponRequest.getPackageId())){
List<SPack> packs = sPacks.stream().filter(obj -> confPackIds.contains(obj.getId())).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(packs)){
List<String> packNames = packs.stream().map(SPack::getName).distinct().collect(Collectors.toList());
item.setIsAvailable(AvailableEnum.UNAVAILABLE.getCode());
item.setReason("优惠卷当前套餐不可用,【"+packNames.toString()+"】套餐可用");
}
}
}
return item.getIsAvailable()==0;
}
......@@ -392,7 +399,7 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
newSConsumerCoupon.setMaxDuration(sCoupon.getMaxDuration());
newSConsumerCoupon.setDuration(sCoupon.getDuration());
newSConsumerCoupon.setOrderType(sCoupon.getOrderType());
newSConsumerCoupon.setPackageId(sCoupon.getPackageId());
newSConsumerCoupon.setPackIds(sCoupon.getPackIds());
newSConsumerCoupon.setSourceType(SourceTypeEnum.GIVE.getCode());
newSConsumerCoupon.setPlatformType(String.valueOf(sCoupon.getPlatformType()));
newSConsumerCoupon.setStartDate(sCoupon.getStartDate());
......
......@@ -26,7 +26,7 @@
<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="packIds" column="pack_ids"/>
<result property="platformType" column="platform_type" />
<result property="startDate" column="start_date" />
<result property="endDate" column="end_date" />
......@@ -79,7 +79,7 @@
room_type,
store_type,
order_type,
package_id
pack_ids
from s_consumer_coupon
</sql>
......@@ -103,7 +103,7 @@
<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="packIds != null ">and pack_ids = #{packIds}</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>
......@@ -169,7 +169,7 @@
<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>
<if test="packIds != null">pack_ids,</if>
<if test="dealgroupId != null">dealgroup_id,</if>
<if test="storeIds != null">store_ids,</if>
</trim>
......@@ -206,7 +206,7 @@
<if test="roomType != null">#{roomType},</if>
<if test="storeType != null">#{storeType},</if>
<if test="orderType != null">#{orderType},</if>
<if test="packageId != null">#{packageId},</if>
<if test="packIds != null">#{packIds},</if>
<if test="dealgroupId != null">#{dealgroupId},</if>
<if test="storeIds != null">#{storeIds},</if>
</trim>
......@@ -247,7 +247,7 @@
<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>
<if test="packIds != null">pack_ids = #{packIds},</if>
<if test="dealgroupId != null">dealgroup_id = #{dealgroupId},</if>
<if test="storeIds != null">store_ids = #{storeIds},</if>
</trim>
......
......@@ -15,7 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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="packIds" column="pack_ids"/>
<result property="dealgroupId" column="dealgroup_id"/>
<result property="storeIds" column="store_ids"/>
<result property="duration" column="duration" />
......@@ -41,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
room_type,
coupon_type,
order_type,
package_id,
pack_ids,
dealgroup_id,
weeks,
store_ids,
......@@ -64,7 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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="packIds != null">and pack_ids = #{packIds}</if>
<if test="dealgroupId != null">and dealgroup_id = #{dealgroupId}</if>
<if test="storeIds != null">and store_ids = #{storeIds}</if>
<if test="duration != null and duration != ''"> and duration = #{duration}</if>
......@@ -103,7 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where 1=1 and coupon_type = #{couponType}
<if test="endDate != null">and end_date >= NOW()</if>
<if test="orderType != null">and order_type = #{orderType}</if>
<if test="packageId != null">and package_id = #{packageId}</if>
<if test="packids != null">and packids = #{packids}</if>
</select>
<select id="selectSCouponByDealgroupId" resultMap="SCouponResult">
<include refid="selectSCouponVo"/>
......@@ -138,7 +138,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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>
<if test="packIds != null">pack_ids,</if>
<if test="dealgroupId != null">dealgroup_id,</if>
<if test="storeIds != null">store_ids,</if>
</trim>
......@@ -164,7 +164,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">#{createTime},</if>
<if test="remark != null">#{remark},</if>
<if test="orderType != null">#{orderType},</if>
<if test="packageId != null">#{packageId},</if>
<if test="packIds != null">#{packIds},</if>
<if test="dealgroupId != null">#{dealgroupId},</if>
<if test="storeIds != null">#{storeIds},</if>
</trim>
......@@ -182,7 +182,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="roomType != null">room_type = #{roomType},</if>
<if test="couponType != null">coupon_type = #{couponType},</if>
<if test="orderType != ''">order_type = #{orderType},</if>
<if test="packageId != ''">package_id = #{packageId},</if>
<if test="packIds != ''">pack_ids = #{packIds},</if>
<if test="storeIds != null">store_ids = #{storeIds},</if>
<if test="dealgroupId != null">dealgroup_id = #{dealgroupId},</if>
<if test="duration != null and duration != ''">duration = #{duration},</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