| @@ -97,7 +97,7 @@ public class WxCouponOrderBVo extends WxCouponOrder { | |||||
| @io.swagger.annotations.ApiModelProperty(value="面额",name="price") | @io.swagger.annotations.ApiModelProperty(value="面额",name="price") | ||||
| private Integer price; | private Integer price; | ||||
| @Excel(name = "所属业态", width = 50, orderNum = "11", replace = {"餐饮_1", "娱乐_2", "服饰_3", "亲子_4", "超市_5", "其它_6", "美妆_7", "珠宝_8", "服务_9", "家居_10", "_null"}) | |||||
| // @Excel(name = "所属业态", width = 50, orderNum = "11", replace = {"餐饮_1", "娱乐_2", "服饰_3", "亲子_4", "超市_5", "其它_6", "美妆_7", "珠宝_8", "服务_9", "家居_10", "_null"}) | |||||
| @io.swagger.annotations.ApiModelProperty(value = "业态", name = "business") | @io.swagger.annotations.ApiModelProperty(value = "业态", name = "business") | ||||
| private Integer business; | private Integer business; | ||||
| @@ -235,7 +235,7 @@ public class WxCouponOrderBVo extends WxCouponOrder { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private Date verifyEndDate; | private Date verifyEndDate; | ||||
| @Excel(name = "类型", width = 50, orderNum = "16", replace = {"满减券_1", "代金券_2", "团购券_3", "礼品券_4", "停车券_5", "通用券_6", "砍价券_8", "团购券_9", "预购商品_10", "可配送商品_11", "券礼包_12", "积分券_50", "积分停车券_51","抖音券_66","抖音平台券_67","抖音品牌券_68", "消费卡_100"}) | |||||
| @Excel(name = "类型", width = 50, orderNum = "16", replace = {"满减券_1", "代金券_2", "团购券_3", "礼品券_4", "停车券_5", "通用券_6", "砍价券_8", "团购券_9", "预购商品_10", "可配送商品_11", "券礼包_12", "积分券_50", "积分停车券_51","抖音团购券_66","抖音平台券_67","抖音品牌券_68","抖音到家券_69","抖音代金券_70", "消费卡_100"}) | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private Integer couponType; | private Integer couponType; | ||||
| @@ -19,6 +19,7 @@ import com.iformall.mapper.*; | |||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import com.iformall.service.pay.PayServiceFactory; | import com.iformall.service.pay.PayServiceFactory; | ||||
| import com.iformall.service.pay.service.fee.ServiceFeeAdapterService; | import com.iformall.service.pay.service.fee.ServiceFeeAdapterService; | ||||
| import com.iformall.service.util.CouponCacheUtils; | |||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import me.chanjar.weixin.common.error.WxErrorException; | import me.chanjar.weixin.common.error.WxErrorException; | ||||
| @@ -27,7 +28,9 @@ import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.beans.factory.annotation.Qualifier; | |||||
| import org.springframework.context.annotation.Lazy; | import org.springframework.context.annotation.Lazy; | ||||
| import org.springframework.data.redis.core.RedisTemplate; | |||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Isolation; | import org.springframework.transaction.annotation.Isolation; | ||||
| import org.springframework.transaction.annotation.Propagation; | import org.springframework.transaction.annotation.Propagation; | ||||
| @@ -98,6 +101,10 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { | |||||
| @Autowired | @Autowired | ||||
| PayServiceFactory payServiceFactory; | PayServiceFactory payServiceFactory; | ||||
| @Autowired | |||||
| @Qualifier("objectCommonRedisTemplate") | |||||
| RedisTemplate<String, Object> redisTemplate; | |||||
| // @Override | // @Override | ||||
| // public ResultData couponList(TtCouponVo ttCouponVo, Integer pageNum, Integer pageSize) { | // public ResultData couponList(TtCouponVo ttCouponVo, Integer pageNum, Integer pageSize) { | ||||
| // PageInfo<TtCouponVo> pageInfo = PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> wxCouponMapper.ttCouponList(ttCouponVo)); | // PageInfo<TtCouponVo> pageInfo = PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> wxCouponMapper.ttCouponList(ttCouponVo)); | ||||
| @@ -552,11 +559,10 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { | |||||
| wxCouponMerchantMapper.insert(cmt); | wxCouponMerchantMapper.insert(cmt); | ||||
| } | } | ||||
| } | } | ||||
| //审核通过即上架 | |||||
| handlePullOn(ttCouponChannelPoi,now); | |||||
| } | } | ||||
| } | } | ||||
| //审核通过即上架 | |||||
| handlePullOn(ttCouponChannelPoi,now); | |||||
| return new ResultData(product); | return new ResultData(product); | ||||
| }else{ | }else{ | ||||
| @@ -650,6 +656,9 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { | |||||
| wxCouponChannelMapper.insert(addCouponChannel); | wxCouponChannelMapper.insert(addCouponChannel); | ||||
| } | } | ||||
| CouponCacheUtils.removeCouponCache(redisTemplate, wxCoupon.getId()); | |||||
| CouponCacheUtils.removeCouponMerchantCache(redisTemplate, wxCoupon.getId(),null); | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -1833,6 +1833,20 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| @Override | @Override | ||||
| @Transactional(isolation=Isolation.SERIALIZABLE, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) | @Transactional(isolation=Isolation.SERIALIZABLE, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) | ||||
| public ResultData disable(TenantEntity tenantInfo, Long couponId, MallUserInfo user) { | public ResultData disable(TenantEntity tenantInfo, Long couponId, MallUserInfo user) { | ||||
| TtCouponChannelPoi onlineStatus = ttCouponChannelPoiMapper.selectById(tenantInfo.getTenantId(), couponId); | |||||
| if(onlineStatus != null){ | |||||
| if(EnumSpuSyncStatus.sync_auditing.getCode().equals(onlineStatus.getStatus())){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"此券审核中"); | |||||
| } | |||||
| Long draftId = wxCouponMapper.selectDraftId(couponId,tenantInfo.getTenantId()); | |||||
| if(draftId != null){ | |||||
| TtCouponChannelPoi draftStatus = ttCouponChannelPoiMapper.selectById(tenantInfo.getTenantId(), couponId); | |||||
| if(draftStatus != null && EnumSpuSyncStatus.sync_auditing.getCode().equals(draftStatus.getStatus())){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"此券草稿审核中"); | |||||
| } | |||||
| } | |||||
| } | |||||
| WxCoupon couponUpd = new WxCoupon(); | WxCoupon couponUpd = new WxCoupon(); | ||||
| couponUpd.updateTenantInfo(tenantInfo); | couponUpd.updateTenantInfo(tenantInfo); | ||||
| couponUpd.setId(couponId); | couponUpd.setId(couponId); | ||||
| @@ -455,8 +455,8 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| return false; | return false; | ||||
| } | } | ||||
| @Transactional(rollbackFor = {Exception.class}) | |||||
| @Override | @Override | ||||
| @Transactional(rollbackFor = {Exception.class}) | |||||
| public void disable(Long id) { | public void disable(Long id) { | ||||
| WxMerchant wxMerchant = wxMerchantMapper.selectById(id); | WxMerchant wxMerchant = wxMerchantMapper.selectById(id); | ||||
| if (wxMerchant == null) { | if (wxMerchant == null) { | ||||