| @@ -185,10 +185,10 @@ public class WxOrderController extends BaseController { | |||||
| try{ | try{ | ||||
| JSONArray jsonArray = JSONObject.parseArray(cp_extra); | JSONArray jsonArray = JSONObject.parseArray(cp_extra); | ||||
| for(int i=0;i<jsonArray.size();i++){ | for(int i=0;i<jsonArray.size();i++){ | ||||
| String couponId = jsonArray.getJSONObject(i).getString("couponId"); | |||||
| String goodsId = jsonArray.getJSONObject(i).getString("goodsId"); | |||||
| Long couponChannelId = jsonArray.getJSONObject(i).getLongValue("couponChannelId"); | Long couponChannelId = jsonArray.getJSONObject(i).getLongValue("couponChannelId"); | ||||
| if(StringUtils.isNotBlank(couponId) && couponChannelId != null){ | |||||
| couponMap.put(couponId,couponChannelId); | |||||
| if(StringUtils.isNotBlank(goodsId) && couponChannelId != null){ | |||||
| couponMap.put(goodsId,couponChannelId); | |||||
| } | } | ||||
| } | } | ||||
| }catch(Exception e){ | }catch(Exception e){ | ||||
| @@ -198,7 +198,19 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { | |||||
| product.setSku(skuStruct); | product.setSku(skuStruct); | ||||
| String productId = ttWebService.getGoodsService().productSave(product); | String productId = ttWebService.getGoodsService().productSave(product); | ||||
| if(StringUtils.isBlank(productId)){ | |||||
| throw new Exception("未获取到抖音商品product_id"); | |||||
| } | |||||
| WxCouponChannel updCC = new WxCouponChannel(); | |||||
| updCC.setId(wxCouponChannel.getId()); | |||||
| updCC.updateTenantInfo(wxCouponChannel); | |||||
| wxCouponChannel.setTtSpuId(productId); | |||||
| wxCouponChannelMapper.updateById(wxCouponChannel); | |||||
| syncCouponChannelPoi(coupon,wxCouponChannel.getId(),productId); | syncCouponChannelPoi(coupon,wxCouponChannel.getId(),productId); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } catch (WxErrorException e) { | } catch (WxErrorException e) { | ||||
| @@ -774,7 +774,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||||
| @Override | @Override | ||||
| public ResultData getCouponChannelPoi(TenantEntity tenantInfo, Long id) { | public ResultData getCouponChannelPoi(TenantEntity tenantInfo, Long id) { | ||||
| TtCouponChannelPoi ttCouponChannelPoi = ttCouponChannelPoiMapper.selectById(tenantInfo.getTenantId(),id); | |||||
| TtCouponChannelPoi ttCouponChannelPoi = ttCouponChannelPoiMapper.selectByChannelId(tenantInfo.getTenantId(),id); | |||||
| if(ttCouponChannelPoi != null && ttCouponChannelPoi.getStatus() != null && ttCouponChannelPoi.getStatus().intValue() > 0){ | if(ttCouponChannelPoi != null && ttCouponChannelPoi.getStatus() != null && ttCouponChannelPoi.getStatus().intValue() > 0){ | ||||
| return new ResultData(ttCouponChannelPoi); | return new ResultData(ttCouponChannelPoi); | ||||
| } | } | ||||
| @@ -811,9 +811,10 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||||
| updChannel.setId(wxCouponChannel.getId()); | updChannel.setId(wxCouponChannel.getId()); | ||||
| updChannel.updateTenantInfo(wxCouponChannel); | updChannel.updateTenantInfo(wxCouponChannel); | ||||
| updChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | updChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | ||||
| wxCouponChannel.setShowBeginTime(date); | |||||
| wxCouponChannel.setBeginTime(date); | |||||
| wxCouponChannel.setUpdateDate(date); | |||||
| updChannel.setTtSpuId(ttCouponChannelPoi.getSpuId()); | |||||
| updChannel.setShowBeginTime(date); | |||||
| updChannel.setBeginTime(date); | |||||
| updChannel.setUpdateDate(date); | |||||
| wxCouponChannelMapper.updateById(updChannel); | wxCouponChannelMapper.updateById(updChannel); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||