| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.fanli.lijin.manager.GoodsLijinMnager; |
| | | import com.yeshi.fanli.util.goods.douyin.CSJCPSApiUtil; |
| | | import com.yeshi.fanli.util.goods.douyin.vo.DYGoodsDetail; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | |
| | | if (type != 1) { |
| | | if (goodsType == Constant.SOURCE_TYPE_SUNING) { |
| | | String[] sts = SuningUtil.getGoodsIdDetail(id); |
| | | collectionGoodsV2Service.cancelCollectionByAuctionId(uid, Long.parseLong(sts[1]), goodsType); |
| | | collectionGoodsV2Service.cancelCollectionByAuctionId(uid, sts[1], goodsType); |
| | | } else |
| | | collectionGoodsV2Service.cancelCollectionByAuctionId(uid, Long.parseLong(id), goodsType); |
| | | collectionGoodsV2Service.cancelCollectionByAuctionId(uid, id, goodsType); |
| | | out.print(JsonUtil.loadTrueResult("取消收藏成功")); |
| | | return; |
| | | } |
| | | Long goodsId = null; |
| | | String goodsId = null; |
| | | if (goodsType == Constant.SOURCE_TYPE_SUNING) { |
| | | String[] sts = SuningUtil.getGoodsIdDetail(id); |
| | | goodsId = Long.parseLong(sts[1]); |
| | | goodsId =sts[1]; |
| | | } else |
| | | goodsId = Long.parseLong(id); |
| | | goodsId = id; |
| | | CollectionGoodsV2 find = collectionGoodsV2Service.findByUidAndAuctionId(uid, goodsId, goodsType); |
| | | if (find != null) { |
| | | out.print(JsonUtil.loadFalseResult("")); |
| | |
| | | return; |
| | | } |
| | | collectionGoodsV2Service.addSuningCollection(uid, suningGoods); |
| | | }else if (goodsType == Constant.SOURCE_TYPE_DY) { |
| | | DYGoodsDetail goods = CSJCPSApiUtil.goodsDetail(Long.parseLong(id)); |
| | | if (goods == null) { |
| | | out.print(JsonUtil.loadFalseResult(1, "商品已下架")); |
| | | return; |
| | | } |
| | | collectionGoodsV2Service.addDYCollection(uid, goods); |
| | | } else { |
| | | try { |
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = redisManager.getTaoBaoGoodsBrief(goodsId); |
| | |
| | | long count = collectionGoodsV2Service.getCollectionGoodsCount(uid, goodsType, notBackSuVip); |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | List<GoodsDetailVO> list = new ArrayList<GoodsDetailVO>(); |
| | | List<GoodsDetailVO> list = new ArrayList<>(); |
| | | |
| | | if (collectionGoodsList != null && collectionGoodsList.size() > 0) { |
| | | List<Long> listGid = new ArrayList<Long>(); |
| | | List<String> listGid = new ArrayList<>(); |
| | | for (CollectionGoodsV2 collectionGoodsV2 : collectionGoodsList) { |
| | | CommonGoods commonGoods = collectionGoodsV2.getCommonGoods(); |
| | | if (commonGoods == null || commonGoods.getGoodsType() != Constant.SOURCE_TYPE_TAOBAO) { |
| | |
| | | if (listTaoKeGoods != null && listTaoKeGoods.size() > 0 |
| | | && commonGoods.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) { |
| | | int state = 1; // 默认停售 |
| | | Long goodsId = commonGoods.getGoodsId(); |
| | | String goodsId = commonGoods.getGoodsId(); |
| | | for (TaoBaoGoodsBrief taoKeGoods : listTaoKeGoods) { |
| | | Long auctionId = taoKeGoods.getAuctionId(); |
| | | String auctionId = taoKeGoods.getAuctionId(); |
| | | if (goodsId == auctionId || goodsId.equals(auctionId)) { |
| | | state = 0; // 在售 |
| | | break; |