|
|
|
@@ -6,9 +6,12 @@ import com.iformall.common.ResultData; |
|
|
|
import com.iformall.controller.base.BaseController; |
|
|
|
import com.iformall.domain.po.TtCouponChannelPoi; |
|
|
|
import com.iformall.domain.po.WxAppinfo; |
|
|
|
import com.iformall.domain.po.WxCoupon; |
|
|
|
import com.iformall.enums.EnumCouponVersion; |
|
|
|
import com.iformall.service.MailService; |
|
|
|
import com.iformall.service.TtCouponGoodsService; |
|
|
|
import com.iformall.service.WxAppinfoService; |
|
|
|
import com.iformall.service.WxCouponService; |
|
|
|
import com.iformall.utils.DateUtils; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
@@ -42,6 +45,9 @@ public class TtGoodsController extends BaseController { |
|
|
|
@Autowired |
|
|
|
private TtCouponGoodsService ttCouponGoodsService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private WxCouponService wxCouponService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
@Qualifier("openRedisTemplate") |
|
|
|
RedisTemplate<String, String> openRedisTemplate; |
|
|
|
@@ -70,7 +76,7 @@ public class TtGoodsController extends BaseController { |
|
|
|
Map resultMap = new HashMap<>(); |
|
|
|
if(!product_audit_notify.equals(identifyName)){ |
|
|
|
resultMap.put("err_code",1000); |
|
|
|
resultMap.put("err_tips","error"); |
|
|
|
resultMap.put("err_tips","error1"); |
|
|
|
return resultMap; |
|
|
|
} |
|
|
|
try{ |
|
|
|
@@ -78,20 +84,26 @@ public class TtGoodsController extends BaseController { |
|
|
|
String status = (String) parameterMap.get("status"); |
|
|
|
|
|
|
|
TtCouponChannelPoi couponChannelPoi = ttCouponGoodsService.getCouponChannelBySpuId(product_id.toString()); |
|
|
|
ResultData resultData = ttCouponGoodsService.productDraftGet(couponChannelPoi, couponChannelPoi.getId(), false); |
|
|
|
|
|
|
|
if(resultData.code == 200){ |
|
|
|
resultMap.put("err_code",0); |
|
|
|
resultMap.put("err_tips","success"); |
|
|
|
}else{ |
|
|
|
resultMap.put("err_code",resultData.code); |
|
|
|
resultMap.put("err_tips",resultData.message); |
|
|
|
if(couponChannelPoi != null){ |
|
|
|
WxCoupon coupon = wxCouponService.getById(couponChannelPoi.getId(), couponChannelPoi.getTenantId()); |
|
|
|
ResultData resultData = ttCouponGoodsService.productDraftGet(coupon, coupon.getCouponId(), true); |
|
|
|
if(resultData.code == 200){ |
|
|
|
resultMap.put("err_code",0); |
|
|
|
resultMap.put("err_tips","success"); |
|
|
|
}else{ |
|
|
|
resultMap.put("err_code",resultData.code); |
|
|
|
resultMap.put("err_tips",resultData.message); |
|
|
|
} |
|
|
|
return resultMap; |
|
|
|
} |
|
|
|
|
|
|
|
resultMap.put("err_code",1000); |
|
|
|
resultMap.put("err_tips","error2"); |
|
|
|
return resultMap; |
|
|
|
|
|
|
|
}catch(Exception e){ |
|
|
|
resultMap.put("err_code",1000); |
|
|
|
resultMap.put("err_tips","error"); |
|
|
|
resultMap.put("err_tips","error3"); |
|
|
|
return resultMap; |
|
|
|
} |
|
|
|
|
|
|
|
|