|
@@ -66,7 +66,6 @@ public class CmVipCouponServiceImpl implements CmVipCouponService {
|
|
|
String formatTime = simpleDateFormat.format(times);
|
|
|
Date startDate = getMinDay(endTime);
|
|
|
Date endDate = getMaxDay(formatTime);
|
|
|
- CmCouponAssociatePo associatePo = new CmCouponAssociatePo();
|
|
|
List<CmCouponPo> cmCouponPoList = cmBehaviorRecordMapper.selCoupon();
|
|
|
for (CmCouponPo cmCouponPo : cmCouponPoList) {
|
|
|
|
|
@@ -82,11 +81,10 @@ public class CmVipCouponServiceImpl implements CmVipCouponService {
|
|
|
cmCouponPo.setDelFlag("0");
|
|
|
cmBehaviorRecordMapper.insertCoupon(cmCouponPo);
|
|
|
// 插入新优惠券商品
|
|
|
- Integer integer = cmBehaviorRecordMapper.selById();
|
|
|
List<CmCouponAssociatePo> associatePoList = cmBehaviorRecordMapper.selCouponPro(cmCouponPo.getId());
|
|
|
if (associatePoList.size() != 0) {
|
|
|
for (CmCouponAssociatePo couponAssociatePo : associatePoList) {
|
|
|
- couponAssociatePo.setCouponId(integer);
|
|
|
+ couponAssociatePo.setCouponId(cmCouponPo.getId());
|
|
|
cmBehaviorRecordMapper.insertCouponAssociate(couponAssociatePo);
|
|
|
}
|
|
|
}
|
|
@@ -98,7 +96,7 @@ public class CmVipCouponServiceImpl implements CmVipCouponService {
|
|
|
CmVipCouponRelation relation = new CmVipCouponRelation();
|
|
|
Integer cmVipCouponPoId = cmBehaviorRecordMapper.selSvipCouponById();
|
|
|
List<CmCouponPo> cmCouponPos = cmBehaviorRecordMapper.selCoupon();
|
|
|
- if (cmVipCouponPoId != 0 && cmVipCouponPoId != null) {
|
|
|
+ if (cmVipCouponPoId != 0 && null != cmVipCouponPoId ) {
|
|
|
for (int i = 0; i < cmCouponPos.size(); i++) {
|
|
|
relation.setCouponId(cmCouponPos.get(i).getId());
|
|
|
relation.setMontId(cmVipCouponPoId.toString());
|
|
@@ -111,8 +109,8 @@ public class CmVipCouponServiceImpl implements CmVipCouponService {
|
|
|
log.info("========vip优惠券月份关系创建========");
|
|
|
}
|
|
|
|
|
|
- /*
|
|
|
- 输入日期字符串比如201703,返回当月第一天的Date
|
|
|
+ /**
|
|
|
+ * 输入日期字符串比如201703,返回当月第一天的Date
|
|
|
*/
|
|
|
public static Date getMinDay(String month) {
|
|
|
try {
|
|
@@ -127,8 +125,8 @@ public class CmVipCouponServiceImpl implements CmVipCouponService {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- /*
|
|
|
- 输入日期字符串,返回下个月1号0点
|
|
|
+ /**
|
|
|
+ * 输入日期字符串,返回下个月1号0点
|
|
|
*/
|
|
|
public static Date getMaxDay(String month) {
|
|
|
try {
|