| | |
| | | out.print(JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | |
| | | |
| | | try {
|
| | |
|
| | | UserGoodsStorage userGoodsStorage = userGoodsStorageService.getByUidAndAuctionId(uid, auctionId);
|
| | | UserGoodsStorage userGoodsStorage = userGoodsStorageService.getByUidAndAuctionId(uid, auctionId, Constant.SOURCE_TYPE_TAOBAO);
|
| | | boolean storageState = false;
|
| | | if (userGoodsStorage != null) {
|
| | | // 取消加入选品库
|
| | |
| | | // 加入选品库
|
| | | Set<Long> set = new HashSet<Long>();
|
| | | set.add(auctionId);
|
| | | userGoodsStorageService.save(uid, set);
|
| | | userGoodsStorageService.save(uid, set, Constant.SOURCE_TYPE_TAOBAO);
|
| | | storageState = true;
|
| | | }
|
| | |
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "addstorage", method = RequestMethod.POST)
|
| | | public void addStorage(AcceptData acceptData, Long uid, String auctionIds, PrintWriter out) {
|
| | | public void addStorage(AcceptData acceptData, Long uid, String auctionIds, Integer goodsType,PrintWriter out) {
|
| | | try {
|
| | | Gson gson = new Gson();
|
| | | Set<Long> set = gson.fromJson(auctionIds, new TypeToken<HashSet<Long>>() {}.getType());
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | userGoodsStorageService.save(uid, set);
|
| | | if (goodsType == null) {
|
| | | goodsType = Constant.SOURCE_TYPE_TAOBAO;
|
| | | }
|
| | | userGoodsStorageService.save(uid, set, goodsType);
|
| | | out.print(JsonUtil.loadTrueResult("添加成功"));
|
| | |
|
| | | } catch (UserGoodsStorageException e) {
|
| | |
| | | JSONObject data = new JSONObject();
|
| | | JSONArray array = new JSONArray();
|
| | |
|
| | | long count = userGoodsStorageService.countQueryByUid(uid);
|
| | | long count = userGoodsStorageService.countQueryByUid(uid, null);
|
| | | if (count > 0) {
|
| | | array = userGoodsStorageService.getMyStorage((page - 1) * pageSize, pageSize, uid);
|
| | | array = userGoodsStorageService.getMyStorage((page - 1) * pageSize, pageSize, uid, null);
|
| | | }
|
| | |
|
| | | data.put("count", count);
|
| | |
| | | }
|
| | |
|
| | | try {
|
| | | |
| | | Gson gson = new Gson();
|
| | | List<Long> listStorageID = gson.fromJson(storageIds, new TypeToken<ArrayList<Long>>() {}.getType());
|
| | | if (listStorageID == null || listStorageID.size() < 9) {
|
| | |
| | | out.print(JsonUtil.loadFalseResult("分享商品数量只能是9个"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | JSONObject data = userGoodsStorageService.shareGoods(uid, listStorageID);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|