|
@@ -46,19 +46,15 @@ public class CmVipCouponServiceImpl implements CmVipCouponService {
|
|
String endTime = simpleDateFormat.format(time);
|
|
String endTime = simpleDateFormat.format(time);
|
|
CmVipCouponPo vipCouponPo = new CmVipCouponPo();
|
|
CmVipCouponPo vipCouponPo = new CmVipCouponPo();
|
|
|
|
|
|
- List<CmVipCouponPo> cmVipCouponPoList = cmBehaviorRecordMapper.selSvipCoupon(startTime, endTime);
|
|
|
|
|
|
+ CmVipCouponPo cmVipCouponPo = cmBehaviorRecordMapper.selSvipCoupon(startTime, endTime);
|
|
// 将本季度优惠券开放
|
|
// 将本季度优惠券开放
|
|
- if (cmVipCouponPoList.size() != 0) {
|
|
|
|
- for (CmVipCouponPo cmVipCouponPo : cmVipCouponPoList) {
|
|
|
|
- cmBehaviorRecordMapper.updateSvipCoupon(cmVipCouponPo);
|
|
|
|
- // 生成下一季度优惠券
|
|
|
|
- vipCouponPo.setUseTime(endTime);
|
|
|
|
- vipCouponPo.setStatus("1");
|
|
|
|
- vipCouponPo.setUpdateTime(date);
|
|
|
|
- vipCouponPo.setDelFlag("1");
|
|
|
|
- cmBehaviorRecordMapper.insertVipCouponMonth(vipCouponPo);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ cmBehaviorRecordMapper.updateSvipCoupon(cmVipCouponPo);
|
|
|
|
+ // 生成下一季度优惠券
|
|
|
|
+ vipCouponPo.setUseTime(endTime);
|
|
|
|
+ vipCouponPo.setStatus("1");
|
|
|
|
+ vipCouponPo.setUpdateTime(date);
|
|
|
|
+ vipCouponPo.setDelFlag("1");
|
|
|
|
+ cmBehaviorRecordMapper.insertVipCouponMonth(vipCouponPo);
|
|
// 修改专属优惠券配置中优惠券的有效时间
|
|
// 修改专属优惠券配置中优惠券的有效时间
|
|
calendar.setTime(time);
|
|
calendar.setTime(time);
|
|
calendar.add(Calendar.MONTH, 2);
|
|
calendar.add(Calendar.MONTH, 2);
|
|
@@ -80,6 +76,17 @@ public class CmVipCouponServiceImpl implements CmVipCouponService {
|
|
cmCouponPo.setCreateDate(new Date());
|
|
cmCouponPo.setCreateDate(new Date());
|
|
cmCouponPo.setDelFlag("0");
|
|
cmCouponPo.setDelFlag("0");
|
|
cmBehaviorRecordMapper.insertCoupon(cmCouponPo);
|
|
cmBehaviorRecordMapper.insertCoupon(cmCouponPo);
|
|
|
|
+
|
|
|
|
+ /*
|
|
|
|
+ * vip优惠券月份关系
|
|
|
|
+ */
|
|
|
|
+ CmVipCouponRelation relation = new CmVipCouponRelation();
|
|
|
|
+ relation.setCouponId(cmCouponPo.getId());
|
|
|
|
+ relation.setMontId(vipCouponPo.getId());
|
|
|
|
+ relation.setDelFlag("0");
|
|
|
|
+ relation.setUpdateTime(date);
|
|
|
|
+ cmBehaviorRecordMapper.insertRelation(relation);
|
|
|
|
+
|
|
// 插入新优惠券商品
|
|
// 插入新优惠券商品
|
|
List<CmCouponAssociatePo> associatePoList = cmBehaviorRecordMapper.selCouponPro(cmCouponPo.getId());
|
|
List<CmCouponAssociatePo> associatePoList = cmBehaviorRecordMapper.selCouponPro(cmCouponPo.getId());
|
|
if (associatePoList.size() != 0) {
|
|
if (associatePoList.size() != 0) {
|
|
@@ -90,23 +97,6 @@ public class CmVipCouponServiceImpl implements CmVipCouponService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
log.info("========优惠券创建成功========");
|
|
log.info("========优惠券创建成功========");
|
|
- /*
|
|
|
|
- * vip优惠券月份关系
|
|
|
|
- */
|
|
|
|
- CmVipCouponRelation relation = new CmVipCouponRelation();
|
|
|
|
- Integer cmVipCouponPoId = cmBehaviorRecordMapper.selSvipCouponById();
|
|
|
|
- List<CmCouponPo> cmCouponPos = cmBehaviorRecordMapper.selCoupon();
|
|
|
|
- if (cmVipCouponPoId != 0 && null != cmVipCouponPoId ) {
|
|
|
|
- for (int i = 0; i < cmCouponPos.size(); i++) {
|
|
|
|
- relation.setCouponId(cmCouponPos.get(i).getId());
|
|
|
|
- relation.setMontId(cmVipCouponPoId.toString());
|
|
|
|
- relation.setDelFlag("0");
|
|
|
|
- relation.setUpdateTime(date);
|
|
|
|
- cmBehaviorRecordMapper.insertRelation(relation);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- log.info("========vip优惠券月份关系创建========");
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|