| | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.entity.accept.AcceptData; |
| | | import com.yeshi.fanli.entity.bus.user.UserGoodsStorage; |
| | | import com.yeshi.fanli.entity.goods.CommonGoods; |
| | |
| | | |
| | | /** |
| | | * 单个商品加入选品库 |
| | | * |
| | | * @param callback |
| | | * @param storageIds |
| | | * id数组 |
| | | * |
| | | * id数组 |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "accordtorage", method = RequestMethod.POST) |
| | | public void accordtorage(AcceptData acceptData, Long uid, long id, Integer goodsType, PrintWriter out) { |
| | | public void accordtorage(AcceptData acceptData, Long uid, String id, Integer goodsType, PrintWriter out) { |
| | | |
| | | if (uid == null) { |
| | | out.print(JsonUtil.loadFalseResult("用户未登录")); |
| | |
| | | userGoodsStorageService.deleteByPrimaryKey(userGoodsStorage.getId()); |
| | | } else { |
| | | // 加入选品库 |
| | | Set<Long> set = new HashSet<Long>(); |
| | | Set<String> set = new HashSet<>(); |
| | | set.add(id); |
| | | userGoodsStorageService.save(uid, set, goodsType); |
| | | storageState = true; |
| | |
| | | // API网络接口验证是否在售 |
| | | List<TaoBaoGoodsBrief> listTaoKeGoods = null; |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | List<Long> listGid = new ArrayList<Long>(); |
| | | List<String> listGid = new ArrayList<>(); |
| | | for (UserGoodsStorage userGoodsStorage : listStorage) { |
| | | CommonGoods commonGoods = userGoodsStorage.getCommonGoods(); |
| | | if (commonGoods == null) { |
| | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create(); |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | |
| | | for (UserGoodsStorage userGoodsStorage : listStorage) { |
| | |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | if (listTaoKeGoods != null && listTaoKeGoods.size() > 0) { |
| | | 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; |
| | |
| | | |
| | | /** |
| | | * 分享商品返回二维码图片 |
| | | * |
| | | * @param callback |
| | | * |
| | | * @param storageIds |
| | | * id数组 |
| | | * @param out |