Commit 1e0acc0b by wuwenlong

Merge remote-tracking branch 'origin/dev' into dev

parents 139bb74a 14bf0e17
...@@ -64,4 +64,6 @@ public interface SCouponMapper ...@@ -64,4 +64,6 @@ public interface SCouponMapper
List<SCoupon> selectSCouponByIds(Long[] couponIds); List<SCoupon> selectSCouponByIds(Long[] couponIds);
List<SCoupon> listDuration(SCoupon sCoupon); List<SCoupon> listDuration(SCoupon sCoupon);
List<SCoupon> selectSCouponByDealgroupId(Long dealgroupId);
} }
...@@ -71,4 +71,6 @@ public interface ISCouponService ...@@ -71,4 +71,6 @@ public interface ISCouponService
List<SCoupon> queryShopDeal(); List<SCoupon> queryShopDeal();
List<SCoupon> listDuration(SCoupon sCoupon); List<SCoupon> listDuration(SCoupon sCoupon);
List<SCoupon> selectSCouponByDealgroupId(Long dealgroupId);
} }
...@@ -144,10 +144,10 @@ public class QPServiceImpl implements QPService { ...@@ -144,10 +144,10 @@ public class QPServiceImpl implements QPService {
} }
}); });
List<SCoupon> sCoupons = isCouponService.selectSCouponByName(prepare.getDeal_title()); List<SCoupon> sCoupons = isCouponService.selectSCouponByDealgroupId(prepare.getDealgroup_id());
SCoupon sCoupon = null; SCoupon sCoupon = null;
if (!CollectionUtils.isEmpty(sCoupons)) { if (!CollectionUtils.isEmpty(sCoupons)) {
sCoupon = isCouponService.selectSCouponByName(prepare.getDeal_title()).get(0); sCoupon = sCoupons.get(0);
} }
if (ObjectUtils.isEmpty(sCoupon)) { if (ObjectUtils.isEmpty(sCoupon)) {
sConsumerCoupon.setCouponType(CouponTypeEnum.CASH.getCode()); sConsumerCoupon.setCouponType(CouponTypeEnum.CASH.getCode());
......
...@@ -45,7 +45,7 @@ public class SCouponServiceImpl implements ISCouponService { ...@@ -45,7 +45,7 @@ public class SCouponServiceImpl implements ISCouponService {
//默认优惠开始(有效)时段 //默认优惠开始(有效)时段
private static final String DEFAULT_START_TIME = "00:00"; private static final String DEFAULT_START_TIME = "00:00";
//默认优惠结束(有效)时段 //默认优惠结束(有效)时段
private static final String DEFAULT_END_TIME = "24:00"; private static final String DEFAULT_END_TIME = "23:00";
/** /**
...@@ -202,4 +202,9 @@ public class SCouponServiceImpl implements ISCouponService { ...@@ -202,4 +202,9 @@ public class SCouponServiceImpl implements ISCouponService {
public List<SCoupon> listDuration(SCoupon sCoupon) { public List<SCoupon> listDuration(SCoupon sCoupon) {
return sCouponMapper.listDuration(sCoupon); return sCouponMapper.listDuration(sCoupon);
} }
@Override
public List<SCoupon> selectSCouponByDealgroupId(Long dealgroupId) {
return sCouponMapper.selectSCouponByDealgroupId(dealgroupId);
}
} }
...@@ -101,6 +101,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -101,6 +101,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="endDate != null">and end_date >= NOW()</if> <if test="endDate != null">and end_date >= NOW()</if>
</select> </select>
<select id="selectSCouponByDealgroupId" resultMap="SCouponResult">
<include refid="selectSCouponVo"/>
where dealgroup_id = #{dealgroupId}
</select>
<insert id="insertSCoupon" parameterType="SCoupon" useGeneratedKeys="true" keyProperty="id"> <insert id="insertSCoupon" parameterType="SCoupon" useGeneratedKeys="true" keyProperty="id">
insert into s_coupon insert into s_coupon
......
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