| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "accordtorage", method = RequestMethod.POST)
|
| | | public void accordtorage(AcceptData acceptData, Long uid, Long auctionId, Integer goodsType, PrintWriter out) {
|
| | | public void accordtorage(AcceptData acceptData, Long uid, Long auctionId, PrintWriter out) {
|
| | |
|
| | | if (auctionId == null) {
|
| | | out.print(JsonUtil.loadFalseResult("未选择商品"));
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (goodsType == null) {
|
| | | goodsType = Constant.SOURCE_TYPE_TAOBAO;
|
| | | }
|
| | |
|
| | | try {
|
| | | UserGoodsStorage userGoodsStorage = userGoodsStorageService.getByUidAndAuctionId(uid, auctionId, goodsType);
|
| | | 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, goodsType);
|
| | | userGoodsStorageService.save(uid, set, Constant.SOURCE_TYPE_TAOBAO);
|
| | | storageState = true;
|
| | | }
|
| | |
|
| | |
| | | @Resource
|
| | | private UserGoodsStorageService userGoodsStorageService;
|
| | |
|
| | | |
| | |
|
| | | /**
|
| | | * 单个商品加入选品库
|
| | | * |
| | | * @param callback
|
| | | * @param storageIds
|
| | | * id数组
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "accordtorage", method = RequestMethod.POST)
|
| | | public void accordtorage(AcceptData acceptData, Long uid, Long id, Integer goodsType, PrintWriter out) {
|
| | |
|
| | | if (id == null) {
|
| | | out.print(JsonUtil.loadFalseResult("未选择商品"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (goodsType == null) {
|
| | | goodsType = Constant.SOURCE_TYPE_TAOBAO;
|
| | | }
|
| | | |
| | | try {
|
| | | UserGoodsStorage userGoodsStorage = userGoodsStorageService.getByUidAndAuctionId(uid, id, goodsType);
|
| | | boolean storageState = false;
|
| | | if (userGoodsStorage != null) {
|
| | | // 取消加入选品库
|
| | | userGoodsStorageService.deleteByPrimaryKey(userGoodsStorage.getId());
|
| | | } else {
|
| | | // 加入选品库
|
| | | Set<Long> set = new HashSet<Long>();
|
| | | set.add(id);
|
| | | userGoodsStorageService.save(uid, set, goodsType);
|
| | | storageState = true;
|
| | | }
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("storageState", storageState);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("操作失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 批量添加选品库
|
| | | *
|