| | |
| | | import com.yeshi.fanli.service.inter.user.UserGoodsStorageService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | |
| | | @Resource
|
| | | private UserGoodsStorageService userGoodsStorageService;
|
| | |
|
| | | |
| | |
|
| | | /**
|
| | | * 单个商品加入选品库
|
| | | * 单个商品加入选品库
|
| | | *
|
| | | * @param callback
|
| | | * @param storageIds
|
| | |
| | | out.print(JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | if (goodsType == null) {
|
| | | goodsType = Constant.SOURCE_TYPE_TAOBAO;
|
| | | }
|
| | | |
| | |
|
| | | try {
|
| | | UserGoodsStorage userGoodsStorage = userGoodsStorageService.getByUidAndAuctionId(uid, id, goodsType);
|
| | | boolean storageState = false;
|
| | |
| | | userGoodsStorageService.save(uid, set, goodsType);
|
| | | storageState = true;
|
| | | }
|
| | | |
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("storageState", storageState);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 批量添加选品库
|
| | | *
|
| | | * @param acceptData
|
| | | * @param uid 用户id
|
| | | * @param ids 简版商品id
|
| | | * @param uid
|
| | | * 用户id
|
| | | * @param ids
|
| | | * 简版商品id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "addStorage", method = RequestMethod.POST)
|
| | |
| | | * 查询用户选品库数据
|
| | | *
|
| | | * @param acceptData
|
| | | * @param page 页码 初始值 1
|
| | | * @param uid 用户id
|
| | | * @param page
|
| | | * 页码 初始值 1
|
| | | * @param uid
|
| | | * 用户id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getlist", method = RequestMethod.POST)
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate());
|
| | |
|
| | | for (UserGoodsStorage userGoodsStorage : listStorage) {
|
| | | CommonGoods commonGoods = userGoodsStorage.getCommonGoods();
|
| | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 分享商品返回二维码图片
|
| | | *
|
| | |
| | | out.print(JsonUtil.loadFalseResult("分享商品不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | |
| | |
|
| | | 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("分享商品数量不足"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (listStorageID.size() != 9) {
|
| | | out.print(JsonUtil.loadFalseResult("分享商品数量只能是9个"));
|
| | | return;
|
| | | List<Long> listStorageID = gson.fromJson(storageIds, new TypeToken<ArrayList<Long>>() {
|
| | | }.getType());
|
| | |
|
| | | if (!VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | |
|
| | | if (listStorageID == null || listStorageID.size() < 9) {
|
| | | out.print(JsonUtil.loadFalseResult("分享商品数量不足"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (listStorageID.size() != 9) {
|
| | | out.print(JsonUtil.loadFalseResult("分享商品数量只能是9个"));
|
| | | return;
|
| | | }
|
| | |
|
| | | JSONObject data = userGoodsStorageService.createShareV2(uid, listStorageID, true);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } else {
|
| | | JSONObject data = userGoodsStorageService.createShareV2(uid, listStorageID, false);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | JSONObject data = userGoodsStorageService.createShareV2(uid, listStorageID);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (UserGoodsStorageException e) {
|
| | | out.print(JsonUtil.loadFalseResult("分享失败"));
|
| | | e.printStackTrace();
|