dcs 2 månader sedan
förälder
incheckning
d1de20027d

+ 3 - 3
virgo.api/src/main/java/com/bosshand/virgo/api/workark/model/ProductCouponModel.java

@@ -41,7 +41,7 @@ public class ProductCouponModel {
     /**
      * 有效期 (小时)
      */
-    private Integer lifespan;
+    private Long lifespan;
 
     /**
      * 商品目录id (可以使用优惠券的范围)
@@ -126,11 +126,11 @@ public class ProductCouponModel {
         this.createTime = createTime;
     }
 
-    public Integer getLifespan() {
+    public Long getLifespan() {
         return lifespan;
     }
 
-    public void setLifespan(Integer lifespan) {
+    public void setLifespan(Long lifespan) {
         this.lifespan = lifespan;
     }
 

+ 2 - 0
virgo.api/src/main/java/com/bosshand/virgo/api/workark/service/ProductCouponService.java

@@ -7,6 +7,7 @@ import com.bosshand.virgo.api.workark.model.ProductCouponModel;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.time.LocalDateTime;
 import java.time.ZoneId;
@@ -66,6 +67,7 @@ public class ProductCouponService {
         return productCouponModelDao.nowReceive(ids);
     }
 
+    @Transactional
     public void receive(long userId, long productCouponModelId) {
         ProductCouponModel productCouponModel = productCouponModelDao.get(productCouponModelId);
         ProductCoupon productCoupon = new ProductCoupon();