|
|
|
@@ -99,6 +99,16 @@ public class TtCouponServiceImpl implements TtCouponService { |
|
|
|
} |
|
|
|
|
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
if (record.getId() == null) { |
|
|
|
record.setId(idWorker.nextId()); |
|
|
|
record.setCreateDate(new Date()); |
|
|
|
record.setUpdateDate(new Date()); |
|
|
|
ttCouponMapper.insert(record); |
|
|
|
|
|
|
|
} else { |
|
|
|
record.setUpdateDate(new Date()); |
|
|
|
ttCouponMapper.updateById(record); |
|
|
|
} |
|
|
|
|
|
|
|
if(record.getType().equals(EnumTtCouponType.COUPON_COLUMN.getCode()) |
|
|
|
&& record.getColumnCoupons() != null && record.getColumnCoupons().size() > 0){ |
|
|
|
@@ -122,17 +132,8 @@ public class TtCouponServiceImpl implements TtCouponService { |
|
|
|
ttCouponMapper.insert(ttc); |
|
|
|
} |
|
|
|
} |
|
|
|
ttCouponMapper.updateById(record); |
|
|
|
|
|
|
|
if (record.getId() == null) { |
|
|
|
record.setId(idWorker.nextId()); |
|
|
|
record.setCreateDate(new Date()); |
|
|
|
record.setUpdateDate(new Date()); |
|
|
|
ttCouponMapper.insert(record); |
|
|
|
|
|
|
|
} else { |
|
|
|
record.setUpdateDate(new Date()); |
|
|
|
ttCouponMapper.updateById(record); |
|
|
|
} |
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
|
|
|
|
|
|