| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.fanli.entity.accept.AcceptData; |
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.yeshi.utils.JsonUtil; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.jd.JDFilter; |
| | | import com.yeshi.fanli.dto.jd.JDSearchResult; |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail; |
| | |
| | | } |
| | | |
| | | // 获取商品信息 |
| | | JSONObject data = userShareGoodsRecordService.getGoodsGroupDetail(shareId,acceptData.getSystem()); |
| | | JSONObject data = userShareGoodsRecordService.getGoodsGroupDetail(shareId, acceptData.getSystem()); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | } catch (Exception e) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("获取失败")); |
| | |
| | | * |
| | | * @param callback |
| | | * @param shareId 分享id |
| | | * @param source 来源 |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getList") |
| | |
| | | |
| | | List<UserShareGoodsGroup> list = userShareGoodsRecordService.listByRecordId(shareId); |
| | | if (list != null && list.size() > 0) { |
| | | List<Long> listIdTB = new ArrayList<Long>(); |
| | | List<Long> listIdJD = new ArrayList<Long>(); |
| | | List<String> listIdTB = new ArrayList<>(); |
| | | List<String> listIdJD = new ArrayList<>(); |
| | | List<Long> listIdPDD = new ArrayList<Long>(); |
| | | |
| | | for (int i = 0; i < list.size(); i++) { |
| | |
| | | } else if (Constant.SOURCE_TYPE_JD == goodsType) { |
| | | listIdJD.add(commonGoods.getGoodsId()); |
| | | } else if (Constant.SOURCE_TYPE_PDD == goodsType) { |
| | | listIdPDD.add(commonGoods.getGoodsId()); |
| | | listIdPDD.add(Long.parseLong(commonGoods.getGoodsId())); |
| | | } |
| | | } |
| | | |
| | |
| | | if (listIdJD.size() > 0) { |
| | | try { |
| | | JDFilter filter = new JDFilter(); |
| | | filter.setListId(listIdJD); |
| | | filter.setListItemId(listIdJD); |
| | | filter.setPageIndex(1); |
| | | filter.setPageSize(100); |
| | | JDSearchResult result = JDApiUtil.queryByKey(filter); |
| | |
| | | sf.setPage(1); |
| | | sf.setPageSize(100); |
| | | sf.setGoodsIdList(listIdPDD.toArray(ids)); |
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(sf,"437032"); |
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(sf, "437032"); |
| | | if (result != null) { |
| | | listPDD = result.getGoodsList(); |
| | | } |
| | |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create(); |
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate(acceptData.getSystem()); |
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(acceptData.getSystem()); |
| | | ConfigParamsDTO configParamsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, |
| | | GoodsMoneyConfigParamsDTO configParamsDTO = new GoodsMoneyConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, |
| | | hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP, acceptData.getSystem())); |
| | | |
| | | |
| | |
| | | if (goodsType == null) { |
| | | goodsType = Constant.SOURCE_TYPE_TAOBAO; |
| | | } |
| | | Long commonGid = commonGoods.getGoodsId(); |
| | | String commonGid = commonGoods.getGoodsId(); |
| | | |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO && listTB != null && listTB.size() > 0) { |
| | | int state = 1; // 默认停售 |
| | | for (TaoBaoGoodsBrief goodsDetail : listTB) { |
| | | Long goodsId = goodsDetail.getAuctionId(); |
| | | if (goodsId == commonGid || goodsId.equals(commonGid)) { |
| | | String goodsId = goodsDetail.getAuctionId(); |
| | | if (TaoBaoUtil.isEqual(goodsId, commonGid)) { |
| | | state = 0; // 在售 |
| | | break; |
| | | } |
| | |
| | | int state = 1; // 默认停售 |
| | | for (JDGoods goodsDetail : listJD) { |
| | | Long goodsId = goodsDetail.getSkuId(); |
| | | if (goodsId == commonGid || goodsId.equals(commonGid)) { |
| | | if (goodsId == Long.parseLong(commonGid)) { |
| | | state = 0; // 在售 |
| | | break; |
| | | } |
| | |
| | | int state = 1; // 默认停售 |
| | | for (PDDGoodsDetail goodsDetail : listPDD) { |
| | | Long goodsId = goodsDetail.getGoodsId(); |
| | | if (goodsId == commonGid || goodsId.equals(commonGid)) { |
| | | if (goodsId == Long.parseLong(commonGid)) { |
| | | state = 0; // 在售 |
| | | break; |
| | | } |