| | |
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.brand.BrandClass;
|
| | | import com.yeshi.fanli.entity.brand.TaoBaoShopHistory;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoShop;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | | import com.yeshi.fanli.exception.taobao.TaoKeApiException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.service.inter.brand.BrandClassService;
|
| | | import com.yeshi.fanli.service.inter.brand.BrandClassShopService;
|
| | | import com.yeshi.fanli.service.inter.brand.BrandInfoRecordService;
|
| | | import com.yeshi.fanli.service.inter.brand.TaoBaoShopHistoryService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | |
| | | @Resource
|
| | | private HongBaoManageService manageService;
|
| | |
|
| | | |
| | | @Resource
|
| | | private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsService daTaoKeGoodsService;
|
| | | |
| | | private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
|
| | |
|
| | | @Resource
|
| | | private BrandInfoRecordService brandInfoRecordService;
|
| | | |
| | | |
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | |
|
| | | /**
|
| | | * 获取品牌分类
|
| | | *
|
| | |
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("bgPicture", configService.get(ConfigKeyEnum.brandBackgroundPicture.getKey()));
|
| | | data.put("count", list.size());
|
| | | data.put("list", JsonUtil.getApiCommonGson().toJson(list));
|
| | |
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | /**
|
| | | * 添加足迹
|
| | |
| | | out.print(JsonUtil.loadFalseResult("未选择数据"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | // 新版删除
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform())) {
|
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | if (VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | brandInfoRecordService.deleteRecord(Arrays.asList(ids.split(",")), uid, acceptData.getDevice());
|
| | | out.print(JsonUtil.loadTrueResult("删除成功"));
|
| | | return;
|
| | |
| | | return;
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | taoBaoShopHistoryService.deleteHistory(Arrays.asList(ids.split(",")), uid, acceptData.getDevice());
|
| | | out.print(JsonUtil.loadTrueResult("删除成功"));
|
| | | } catch (Exception e) {
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 店铺足迹
|
| | | *
|
| | | * @param acceptData
|
| | | * @param type 精选1, 足迹列表2
|
| | | * @param type
|
| | | * 精选1, 足迹列表2
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getHistory", method = RequestMethod.POST)
|
| | |
| | | if (page == null || page < 1) {
|
| | | page = 1;
|
| | | }
|
| | | |
| | |
|
| | | int pageSize;
|
| | | if (type == 1) {
|
| | | pageSize = 4;
|
| | |
| | | for (TaoBaoShopHistory history : listHistory) {
|
| | | TaoBaoShop taoBaoShop = history.getTaoBaoShop();
|
| | | if (taoBaoShop != null) {
|
| | | |
| | |
|
| | | String shopLink = taoBaoShop.getShopLink();
|
| | | if (StringUtil.isNullOrEmpty(shopLink)) {
|
| | | taoBaoShop.setShopLink(TaoBaoUtil.getShopLink(taoBaoShop.getId()));
|
| | | }
|
| | | |
| | |
|
| | | String shopNameCustom = taoBaoShop.getShopNameCustom();
|
| | | if (!StringUtil.isNullOrEmpty(shopNameCustom)) {
|
| | | taoBaoShop.setShopName(shopNameCustom);
|
| | | }
|
| | | |
| | |
|
| | | String shopIconCustom = taoBaoShop.getShopIconCustom();
|
| | | if (!StringUtil.isNullOrEmpty(shopIconCustom)) {
|
| | | taoBaoShop.setShopIcon(shopIconCustom);
|
| | | }
|
| | | |
| | |
|
| | | list.add(taoBaoShop);
|
| | | }
|
| | | }
|
| | |
| | | out.print(JsonUtil.loadFalseResult("缺失店铺id"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if (page == 1) {
|
| | | TaoBaoShop taoBaoShop = taoBaoShopService.selectByPrimaryKey(sid);
|
| | |
| | | if (StringUtil.isNullOrEmpty(shopLink)) {
|
| | | taoBaoShop.setShopLink(TaoBaoUtil.getShopLink(taoBaoShop.getId()));
|
| | | }
|
| | | |
| | |
|
| | | String shopNameCustom = taoBaoShop.getShopNameCustom();
|
| | | if (!StringUtil.isNullOrEmpty(shopNameCustom)) {
|
| | | taoBaoShop.setShopName(shopNameCustom);
|
| | | }
|
| | | |
| | |
|
| | | String shopIconCustom = taoBaoShop.getShopIconCustom();
|
| | | if (!StringUtil.isNullOrEmpty(shopIconCustom)) {
|
| | | taoBaoShop.setShopIcon(shopIconCustom);
|
| | | }
|
| | | data.put("shop", JsonUtil.getApiCommonGson().toJson(taoBaoShop));
|
| | | |
| | | |
| | |
|
| | | ThreadUtil.run(new Runnable() {
|
| | | public void run() {
|
| | | // 添加足迹
|
| | |
| | | });
|
| | | }
|
| | |
|
| | | |
| | | // 商品列表信息
|
| | | int pageSize = 50;
|
| | | List<TaoBaoGoodsBrief> listGoodsBrief = new ArrayList<TaoBaoGoodsBrief>();
|
| | | |
| | |
|
| | | // 先查询大淘客数据
|
| | | List<DaTaoKeDetail> listDaTaoKe = daTaoKeGoodsService.listBySellerId(0, pageSize, sid);
|
| | | List<DaTaoKeDetailV2> listDaTaoKe = daTaoKeGoodsDetailV2Service.listBySellerId(0, pageSize, sid);
|
| | | if (listDaTaoKe != null && listDaTaoKe.size() > 0) {
|
| | | for (DaTaoKeDetail daTaoKe: listDaTaoKe) {
|
| | | for (DaTaoKeDetailV2 daTaoKe : listDaTaoKe) {
|
| | | listGoodsBrief.add(TaoBaoUtil.convert(daTaoKe));
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | // 不足50条数据、查询精选库
|
| | | if (listGoodsBrief.size() < pageSize) {
|
| | | int needCount = pageSize- listGoodsBrief.size();
|
| | | int needCount = pageSize - listGoodsBrief.size();
|
| | | List<TaoBaoGoodsBrief> listGoods = taoBaoGoodsBriefService.listByShopId(0, needCount, sid);
|
| | | if (listGoods != null && listGoods.size() > 0) {
|
| | | |
| | |
|
| | | if (listGoodsBrief.size() > 0) {
|
| | | for (int i = 0; i< listGoods.size(); i ++) {
|
| | | for (int i = 0; i < listGoods.size(); i++) {
|
| | | long id = listGoods.get(i).getAuctionId();
|
| | | boolean isRepeat = false;
|
| | | for (TaoBaoGoodsBrief goodsBrief: listGoodsBrief) {
|
| | | for (TaoBaoGoodsBrief goodsBrief : listGoodsBrief) {
|
| | | long auctionId = goodsBrief.getAuctionId();
|
| | | if (auctionId == id) {
|
| | | isRepeat = true;
|
| | | break;
|
| | | }
|
| | | }
|
| | | if(isRepeat) {
|
| | | if (isRepeat) {
|
| | | listGoods.remove(i);
|
| | | i--;
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | listGoodsBrief.addAll(listGoods);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | JSONArray array = new JSONArray();
|
| | | if (listGoodsBrief.size() > 0) {
|
| | |
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | |
| | |
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | BigDecimal proportion = manageService.getFanLiRate();
|
| | | |
| | | BigDecimal proportion = manageService.getFanLiRate(UserLevelEnum.daRen);
|
| | |
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) {
|
| | | if (listTaoKeGoods != null && listTaoKeGoods.size() > 0) {
|
| | | boolean stateSale = false; // 默认停售
|
| | |
| | | continue;
|
| | | }
|
| | | }
|
| | | array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null)));
|
| | | array.add(gson.toJson(
|
| | | TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null)));
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | data.put("count", array.size());
|
| | | data.put("list", array);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|