|
|
|
@@ -15,6 +15,7 @@ import com.iformall.domain.po.tt.TtCoupon; |
|
|
|
import com.iformall.domain.po.tt.TtUserCollect; |
|
|
|
import com.iformall.enums.EnumTtCouponStatus; |
|
|
|
import com.iformall.enums.EnumTtCouponType; |
|
|
|
import com.iformall.enums.EnumYesOrNo; |
|
|
|
import com.iformall.mapper.*; |
|
|
|
import com.iformall.service.WxMerchantService; |
|
|
|
import com.iformall.service.tt.TtCouponService; |
|
|
|
@@ -63,6 +64,13 @@ public class TtCouponServiceImpl implements TtCouponService { |
|
|
|
if (StringUtils.isNotEmpty(record.getOrigPriceStr())) { |
|
|
|
record.setOrigPrice(new BigDecimal(record.getOrigPriceStr()).multiply(new BigDecimal(100)).intValue()); |
|
|
|
} |
|
|
|
if(record.getSalePrice() == null || record.getSalePrice().intValue() == 0){ |
|
|
|
record.setSalePrice(0); |
|
|
|
record.setIsPayment(EnumYesOrNo.NO.getCode()); |
|
|
|
record.setPreviewDuration(0); |
|
|
|
}else{ |
|
|
|
record.setIsPayment(EnumYesOrNo.YES.getCode()); |
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtils.isBlank(record.getCoverPicture())) { |
|
|
|
List<String> strList = new ArrayList<String>(); |
|
|
|
@@ -74,7 +82,10 @@ public class TtCouponServiceImpl implements TtCouponService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
record.setStatus(EnumTtCouponStatus.TTCOUPON_STATUS_DRAFT.getCode()); |
|
|
|
if(record.getStatus() == null){ |
|
|
|
record.setStatus(EnumTtCouponStatus.TTCOUPON_STATUS_DRAFT.getCode()); |
|
|
|
} |
|
|
|
|
|
|
|
if (record.getId() == null) { |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
record.setId(idWorker.nextId()); |
|
|
|
|