From d27f0e6de138c0d2fc795a59d8b72853207f2172 Mon Sep 17 00:00:00 2001 From: xhxu Date: Fri, 21 May 2021 16:44:11 +0800 Subject: [PATCH] tt --- .../com/iformall/service/tt/impl/TtCouponServiceImpl.java | 3 +++ mallinkService/src/main/resources/mapper/TtCouponMapper.xml | 2 +- .../java/com/iformall/controller/tt/TtCouponController.java | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mallinkService/src/main/java/com/iformall/service/tt/impl/TtCouponServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/tt/impl/TtCouponServiceImpl.java index e88ded4aa..2f0d9ca46 100644 --- a/mallinkService/src/main/java/com/iformall/service/tt/impl/TtCouponServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/tt/impl/TtCouponServiceImpl.java @@ -22,6 +22,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; import java.math.BigDecimal; import java.util.*; @@ -54,6 +56,7 @@ public class TtCouponServiceImpl implements TtCouponService { @Override + @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) public ResultData saveOrUpdate(TtCoupon record) { if (StringUtils.isNotEmpty(record.getSalePriceStr())) { diff --git a/mallinkService/src/main/resources/mapper/TtCouponMapper.xml b/mallinkService/src/main/resources/mapper/TtCouponMapper.xml index f042649a4..d22b3554e 100644 --- a/mallinkService/src/main/resources/mapper/TtCouponMapper.xml +++ b/mallinkService/src/main/resources/mapper/TtCouponMapper.xml @@ -57,7 +57,7 @@ - where c.`is_del` = 0 + where c.`is_del` = 0 and c.`type` != 3 and c.`id` = #{id} diff --git a/mallinkTTAdmin/src/main/java/com/iformall/controller/tt/TtCouponController.java b/mallinkTTAdmin/src/main/java/com/iformall/controller/tt/TtCouponController.java index 850bfc75b..dac463e2c 100644 --- a/mallinkTTAdmin/src/main/java/com/iformall/controller/tt/TtCouponController.java +++ b/mallinkTTAdmin/src/main/java/com/iformall/controller/tt/TtCouponController.java @@ -69,6 +69,11 @@ public class TtCouponController extends BaseController { logger.debug("[" + getIpAddr() + "] TtCouponController::list"); if (record == null) record = new TtCoupon(); record.updateTenantInfo(getTenantInfo()); +// if(record.getType() == null || record.getType().equals(EnumTtCouponType.COUPON_SINGLE.getCode())){ +// record.setType(EnumTtCouponType.COUPON_SINGLE.getCode()); +// }else{ +// record.setType(EnumTtCouponType.COUPON_COLUMN.getCode()); +// } return new ResultData(ttCouponService.listAsPage(record, pageNum, pageSize)); }