Merge remote-tracking branch 'origin/div' into div
Conflicts:
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/ScanHistoryV2ServiceImpl.java
1 文件已重命名
30个文件已修改
22个文件已添加
| | |
| | | HttpUtil.getAsInputStream(dto.getWx_qrcode_url()), 500, 500, 295, 908);
|
| | |
|
| | | if (elmeShareImg != null) {
|
| | | String filePath = FilePathEnum.banLiShopClass.getPath() + "-" + uid + "-"
|
| | | String filePath = FilePathEnum.elmeShare.getPath() + "-" + uid + "-"
|
| | | + UUID.randomUUID().toString().replace("-", "") + ".png";
|
| | | FileUploadResult uploadResult = COSManager.getInstance().uploadFile(elmeShareImg, filePath);
|
| | | if (uploadResult != null)
|
| | |
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | }
|
| | |
|
| | | |
| | | @RequestMapping(value = "getKouBeiLink")
|
| | | public void getKouBeiLink(AcceptData acceptData, Long uid, String activityId, boolean share, boolean shareImg,
|
| | | String callback, PrintWriter out) {
|
| | |
|
| | | UserExtraTaoBaoInfo userInfoExtra = userExtraTaoBaoInfoService.getByUid(uid);
|
| | | if (userInfoExtra == null || StringUtil.isNullOrEmpty(userInfoExtra.getRelationId())) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult(1001, "请绑定淘宝")));
|
| | | return;
|
| | | }
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.kouBeiLink, uid + "-" + activityId + "-" + share);
|
| | | String elmeResult = redisManager.getCommonString(key);
|
| | | JSONObject data = new JSONObject();
|
| | | TaoKeOfficialActivityConvertResultDTO dto = null;
|
| | | if (StringUtil.isNullOrEmpty(elmeResult)) {
|
| | | if (share) {
|
| | | dto = TaoKeApiUtil.officialActivityConvert(TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT.split("_")[3],
|
| | | activityId, userInfoExtra.getRelationId());
|
| | | } else {
|
| | | dto = TaoKeApiUtil.officialActivityConvert(TaoBaoConstant.TAOBAO_KOUBEI_PID.split("_")[3], activityId,
|
| | | userInfoExtra.getRelationId());
|
| | | }
|
| | |
|
| | | if (dto != null) {
|
| | | if (share) {// 生成口令
|
| | | String token = TaoKeApiUtil.getTKToken("http://", "口碑",dto.getClick_url() );
|
| | | dto.setToken(TaoBaoUtil.filterTaoToken(token));
|
| | | }
|
| | | redisManager.cacheCommonString(key, JsonUtil.getSimpleGson().toJson(dto), 60 * 60);// 缓存1个小时
|
| | | }
|
| | | } else {
|
| | | dto = JsonUtil.getSimpleGson().fromJson(elmeResult, TaoKeOfficialActivityConvertResultDTO.class);
|
| | |
|
| | | if (share && StringUtil.isNullOrEmpty(dto.getToken())) {
|
| | | // 保存口令
|
| | | String token = TaoKeApiUtil.getTKToken("http://", "口碑", dto.getClick_url());
|
| | | dto.setToken(TaoBaoUtil.filterTaoToken(token));
|
| | | redisManager.cacheCommonString(key, JsonUtil.getSimpleGson().toJson(dto), 60 * 60);// 缓存1个小时
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | ElemeConvertInfoResultVO info = new ElemeConvertInfoResultVO(null, dto.getToken(), dto.getClick_url());
|
| | | if (share && shareImg) {
|
| | | InputStream elmeShareImg = ImageUtil.drawSimpleImage(
|
| | | this.getClass().getClassLoader().getResourceAsStream("image/elme_bg.png"), 1080, 1646,
|
| | | HttpUtil.getAsInputStream(dto.getWx_qrcode_url()), 500, 500, 295, 908);
|
| | |
|
| | | if (elmeShareImg != null) {
|
| | | String filePath = FilePathEnum.elmeShare.getPath() + "-" + uid + "-"
|
| | | + UUID.randomUUID().toString().replace("-", "") + ".png";
|
| | | FileUploadResult uploadResult = COSManager.getInstance().uploadFile(elmeShareImg, filePath);
|
| | | if (uploadResult != null)
|
| | | info.setQrCodeImg(uploadResult.getUrl());
|
| | | }
|
| | |
|
| | | if (info.getQrCodeImg() == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("分享图生成失败"));
|
| | | return;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | data.put("info", info);
|
| | |
|
| | | ClientTBPid clientTBPid1 = new ClientTBPid(TaoBaoConstant.TAOBAO_AUTH_APPKEY,
|
| | | share ? TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT : TaoBaoConstant.TAOBAO_KOUBEI_PID, null,
|
| | | TaoBaoConstant.TAOBAO_KOUBEI_PID.split("_")[3]);
|
| | | clientTBPid1.setAdZoneId(clientTBPid1.getPid().split("_")[3]);
|
| | | data.put("taoKeParams", clientTBPid1);
|
| | | if (StringUtil.isNullOrEmpty(callback))
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | else
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取饿了么的推广链接
|
| | | *
|
| | |
| | | if (!StringUtil.isNullOrEmpty(special.getPicture())) { |
| | | imgs.add(special.getPicture()); |
| | | } |
| | | |
| | | title = special.getName(); |
| | | |
| | | desc = special.getRemark(); |
| | | startTime = special.getStartTime(); |
| | | endTime = special.getEndTime(); |
| | |
| | | if (!StringUtil.isNullOrEmpty(swiper.getSrc())) { |
| | | imgs.add(swiper.getSrc()); |
| | | } |
| | | |
| | | title = swiper.getTitle(); |
| | | desc = swiper.getDesc(); |
| | | startTime = swiper.getStartTime(); |
| | |
| | | import com.yeshi.fanli.dto.pdd.PDDPromotionUrl;
|
| | | import com.yeshi.fanli.dto.pdd.PDDSearchFilter;
|
| | | import com.yeshi.fanli.dto.taobao.DaTaoKeFilterResult;
|
| | | import com.yeshi.fanli.dto.vip.goods.VIPGoodsInfo;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.ShamUser;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | |
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.util.user.UserLevelUtil;
|
| | | import com.yeshi.fanli.util.vipshop.VipShopApiUtil;
|
| | | import com.yeshi.fanli.util.vipshop.VipShopUtil;
|
| | | import com.yeshi.fanli.vo.goods.CouponInfoVO;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailExtraVO;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 唯品会详情
|
| | | * |
| | | * @param acceptData
|
| | | * @param id
|
| | | * @param uid
|
| | | * @param from
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getDetailVIP", method = RequestMethod.POST)
|
| | | public void getDetialVIP(AcceptData acceptData, Long id, Long uid, String from, PrintWriter out) {
|
| | | // 系统验证
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | | VIPGoodsInfo vipGoodsInfo = VipShopApiUtil.getGoodsDetail(id + "");
|
| | | if (vipGoodsInfo == null) {
|
| | | out.print(JsonUtil.loadFalseResult(2, "商品不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | | ConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), uid);
|
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate());
|
| | |
|
| | | GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertVIPGoods(vipGoodsInfo, paramsDTO);
|
| | | if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
|
| | | goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney());
|
| | | goodsDetail.getMoneyInfo().setShareMoney("¥" + VipShopUtil.getGoodsFanLiMoney(vipGoodsInfo,
|
| | | hongBaoManageService.getShareRate(UserLevelEnum.superVIP)));
|
| | | goodsDetail.getMoneyInfo().setRateInfo(goodsDetail.getMoneyInfo().getMaxRateInfo());
|
| | | goodsDetail.getMoneyInfo().setCompositionInfo(goodsDetail.getMoneyInfo().getMaxCompositionInfo());
|
| | | }
|
| | | goodsDetail.getMoneyInfo()
|
| | | .setRateInfoHelpUrl(configService.get(ConfigKeyEnum.goodsDetailFanliRateHelpUrl.getKey()));
|
| | |
|
| | | // 附加信息
|
| | | OtherInfo otherInfo = new OtherInfo();
|
| | | RewardCouponVO rewardCoupon = new RewardCouponVO();
|
| | | rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
|
| | | JSONObject params1 = new JSONObject();
|
| | | if (!VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | params1.put("url", configService.get(ConfigKeyEnum.specialGuideRewardCouponLink.getKey()));
|
| | | else
|
| | | params1.put("url", userVipConfigService.getValueByKey("vip_link"));
|
| | |
|
| | | rewardCoupon.setMaxMoney(goodsDetail.getMoneyInfo().getMaxMoney());
|
| | | rewardCoupon.setDesc("返");
|
| | | params1.put("url", userVipConfigService.getValueByKey("vip_link"));
|
| | | rewardCoupon.getJumpDetail().setNeedLogin(true);
|
| | |
|
| | | rewardCoupon.setParams(params1.toString());
|
| | | otherInfo.setRewardCoupon(rewardCoupon);
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform())
|
| | | && configService.iosOnLining(Integer.parseInt(acceptData.getVersion())))
|
| | | otherInfo.setRewardCoupon(null);
|
| | | goodsDetail.setOtherInfo(otherInfo);
|
| | |
|
| | | ShopInfoVO shopInfo = goodsDetail.getShopInfo();
|
| | | if (shopInfo != null) {
|
| | | if (shopInfo.getId() == null || shopInfo.getScoreGoods() == null || shopInfo.getScoreLogistics() == null
|
| | | || shopInfo.getScoreSeller() == null) {
|
| | | goodsDetail.setShopInfo(null);
|
| | | }
|
| | | }
|
| | |
|
| | | GoodsDetailExtraVO extraVO = new GoodsDetailExtraVO();
|
| | | extraVO.setIsNative(false);
|
| | | // IOS是否正在上线
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform())) {
|
| | | String version = acceptData.getVersion();
|
| | | extraVO.setIosOnling(configService.iosOnLining(Integer.parseInt(version)));
|
| | | }
|
| | |
|
| | | // 图文详情
|
| | | extraVO.setDetailUrl("http://apph5.banliapp.com/apppage/goods_img_pdd.html?id=" + id);
|
| | |
|
| | | if (uid != null) {
|
| | | // 是否加入收藏
|
| | | CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, id,
|
| | | Constant.SOURCE_TYPE_VIP);
|
| | | extraVO.setCollected(collectionGoods != null ? true : false);
|
| | | // 是否加入选品库
|
| | | extraVO.setStorage(userGoodsStorageService.isExistStorage(uid, id, Constant.SOURCE_TYPE_VIP));
|
| | | }
|
| | |
|
| | | extraVO.setIsNative(true);
|
| | |
|
| | | // 分享路径
|
| | | String h5Url = String.format("http://%s%s?uid=%s&id=%s", configService.getH5Host(),
|
| | | Constant.systemCommonConfig.getShareGoodsPagePathPDD(), "", id + "");
|
| | | try {
|
| | | extraVO.setH5Url(HttpUtil.getShortLink(h5Url));
|
| | | } catch (Exception e) {
|
| | | extraVO.setH5Url(h5Url);
|
| | | }
|
| | |
|
| | | String helpLink = null;
|
| | | extraVO.setFanliValid(true);
|
| | | extraVO.setShareValid(true);
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(helpLink)) {
|
| | | helpLink = configService.get(ConfigKeyEnum.noRebateHelpLink.getKey());
|
| | | }
|
| | |
|
| | | ShareVO shareInfoVO = new ShareVO();
|
| | | shareInfoVO.setHelpLink(helpLink);
|
| | | extraVO.setShare(shareInfoVO);
|
| | |
|
| | | // if (convertUrl != null) {
|
| | | // extraVO.setCouponJumpLink(convertUrl.getUrl());
|
| | | // extraVO.setNativeCouponJumpLink(PinDuoDuoUtil.getAndroidNativeURI(convertUrl.getUrl()));
|
| | | // }
|
| | |
|
| | | JSONObject object = new JSONObject();
|
| | | object.put("extra", JsonUtil.getApiCommonGson().toJson(extraVO));
|
| | | object.put("goods", JsonUtil.getApiCommonGson().toJson(goodsDetail));
|
| | | out.print(JsonUtil.loadTrueResult(object.toString()));
|
| | |
|
| | | ThreadUtil.run(new Runnable() {
|
| | | public void run() {
|
| | | // 添加浏览记录
|
| | | try {
|
| | | scanHistoryV2Service.addVIPScanHistory(uid, acceptData.getDevice(), vipGoodsInfo);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | try {
|
| | | goodsEvaluateService.updateVIPGoods(vipGoodsInfo);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | /**
|
| | | * 商品详情推荐(猜你喜欢 + 推荐)
|
| | | *
|
| | | * @param acceptData
|
| | |
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(gson.toJson(voList)));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 京东转链
|
| | | * @Title: getJDLink
|
| | | * @Description: |
| | | * @param acceptData
|
| | | * @param link
|
| | | * @param uid
|
| | | * @param out |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | @RequestMapping(value = "convertJDLink")
|
| | | public void convertJDLink(AcceptData acceptData, String link, Long uid, String callback, PrintWriter out) {
|
| | | if (StringUtil.isNullOrEmpty(link)) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "链接为空"));
|
| | | return;
|
| | | }
|
| | |
|
| | | link = JDApiUtil.convertLinkWithSubUnionId(link, null, JDApiUtil.POSITION_FANLI + "", uid + "");
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("link", link);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsResult;
|
| | | import com.yeshi.fanli.dto.pdd.PDDSearchFilter;
|
| | | import com.yeshi.fanli.dto.vip.VIPSearchFilter;
|
| | | import com.yeshi.fanli.dto.vip.VIPSearchResult;
|
| | | import com.yeshi.fanli.dto.vip.goods.VIPGoodsInfo;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | |
| | | import com.yeshi.fanli.util.taobao.SearchFilterUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.util.vipshop.VipShopApiUtil;
|
| | | import com.yeshi.fanli.vo.brand.BrandInfoVO;
|
| | | import com.yeshi.fanli.vo.brand.TaoBaoShopVO;
|
| | | import com.yeshi.fanli.vo.common.JumpDetailContentVO;
|
| | |
| | |
|
| | | Gson gson = JsonUtil.getApiCommonGson();
|
| | | data.put("title", "智能搜索");
|
| | | |
| | | |
| | |
|
| | | int state = 0;
|
| | | if (result.getFirstGoods() != null && result.getFirstGoods().getGoodsId() != null) {
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | /*-------- 唯品会商品 ------*/
|
| | | if (goodsType.intValue() == Constant.SOURCE_TYPE_VIP) {
|
| | | searchVIPGoods(acceptData, searchkey, page, filter, order, out);
|
| | | return;
|
| | | }
|
| | |
|
| | | /*-------- 淘宝商品 -------*/
|
| | | searchTaoBaoGoods(acceptData, searchkey, page, filter, order, out);
|
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | data.put("count", count);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 搜索唯品会商品
|
| | | * @Title: searchVIPGoods
|
| | | * @Description: |
| | | * @param acceptData
|
| | | * @param key
|
| | | * @param page
|
| | | * @param filter
|
| | | * @param order
|
| | | * @param out |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | private void searchVIPGoods(AcceptData acceptData, String key, Integer page, String filter, Integer order,
|
| | | PrintWriter out) {
|
| | | VIPSearchFilter searchFilter = new VIPSearchFilter();
|
| | | searchFilter.setKeyword(key);
|
| | | searchFilter.setPage(page);
|
| | | searchFilter.setPageSize(Constant.PAGE_SIZE);
|
| | |
|
| | | if (order != null) {
|
| | | int sort = order.intValue();
|
| | | switch (sort) {
|
| | | case 2: // 价格—desc
|
| | | searchFilter.setFieldName("price");
|
| | | searchFilter.setOrder(1);
|
| | | break;
|
| | | case 3: // 价格—asc
|
| | | searchFilter.setFieldName("price");
|
| | | searchFilter.setOrder(0);
|
| | | break;
|
| | | case 4: // 折扣—desc
|
| | | searchFilter.setFieldName("discount");
|
| | | searchFilter.setOrder(1);
|
| | | break;
|
| | | case 5: // 折扣—aec
|
| | | searchFilter.setFieldName("discount");
|
| | | searchFilter.setOrder(0);
|
| | | break;
|
| | | default: // 综合排序
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(filter)) {
|
| | | JSONObject jsonfilter = JSONObject.fromObject(filter);
|
| | | String minPrice = jsonfilter.optString("minPrice");
|
| | | if (!StringUtil.isNullOrEmpty(minPrice)) {
|
| | | searchFilter.setPriceStart(minPrice);
|
| | | }
|
| | |
|
| | | String maxPrice = jsonfilter.optString("maxPrice");
|
| | | if (!StringUtil.isNullOrEmpty(maxPrice)) {
|
| | | searchFilter.setPriceEnd(maxPrice);
|
| | | }
|
| | | }
|
| | |
|
| | | int count = 0;
|
| | | JSONObject data = new JSONObject();
|
| | | JSONArray array = new JSONArray();
|
| | |
|
| | | VIPSearchResult result = VipShopApiUtil.search(searchFilter);
|
| | | if (result != null) {
|
| | | count = result.getTotal();
|
| | | Gson gson = JsonUtil.getApiCommonGson();
|
| | | List<VIPGoodsInfo> goodsList = result.getGoodsList();
|
| | | if (goodsList != null && goodsList.size() > 0) {
|
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | |
|
| | | for (VIPGoodsInfo goods : goodsList) {
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertVIPGoods(goods, paramsDTO);
|
| | | array.add(gson.toJson(goodsDetailVO));
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | data.put("result", array);
|
| | | data.put("count", count);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | }
|
| | |
| | | import com.yeshi.fanli.dto.jd.JDPingouInfo; |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail; |
| | | import com.yeshi.fanli.dto.share.ShareGoodsRecordDTO; |
| | | import com.yeshi.fanli.dto.vip.goods.VIPGoodsInfo; |
| | | import com.yeshi.fanli.entity.accept.AcceptData; |
| | | import com.yeshi.fanli.entity.bus.share.UserShareGoodsGroup; |
| | | import com.yeshi.fanli.entity.bus.share.UserShareGoodsHistory; |
| | |
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil; |
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil; |
| | | import com.yeshi.fanli.util.taobao.TaoLiJinUtil; |
| | | import com.yeshi.fanli.util.vipshop.VipShopApiUtil; |
| | | import com.yeshi.fanli.util.vipshop.VipShopUtil; |
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO; |
| | | import com.yeshi.fanli.vo.goods.ShareGoodsCommentChoiceInfo; |
| | | import com.yeshi.fanli.vo.goods.ShareInfoVO; |
| | |
| | | createPDDShare(acceptData, uid, goodsId, source, needGoods, out); |
| | | return; |
| | | } |
| | | |
| | | // 唯品会 |
| | | if (goodsType == Constant.SOURCE_TYPE_VIP) { |
| | | createPDDShare(acceptData, uid, goodsId, source, needGoods, out); |
| | | return; |
| | | } |
| | | |
| | | } |
| | | |
| | | public static String getERCodeContentNew(String template, TaoBaoGoodsBrief goods, String token) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 拼多多分享 |
| | | * |
| | | * @param acceptData |
| | | * @param uid |
| | | * @param goodsId |
| | | * @param source |
| | | * @param out |
| | | */ |
| | | public void createVIPShare(AcceptData acceptData, Long uid, Long goodsId, String source, boolean needGoods, |
| | | PrintWriter out) { |
| | | VIPGoodsInfo goods = VipShopApiUtil.getGoodsDetail(goodsId + ""); |
| | | if (goods == null) { |
| | | out.print(JsonUtil.loadFalseResult(1, "该商品已下架")); |
| | | return; |
| | | } |
| | | |
| | | String jumpLink = VipShopApiUtil.convertLink(goodsId + "", VipShopUtil.getShareChanTag(uid)); |
| | | |
| | | ShareInfoVO shareInfo = new ShareInfoVO(); |
| | | shareInfo.setClickUrl(jumpLink); |
| | | shareInfo.setWxErCode(jumpLink); |
| | | shareInfo.setCommentTexts(new ArrayList<>()); |
| | | shareInfo.setRule(configService.get(ConfigKeyEnum.shareRuleLinkVIP.getKey())); |
| | | shareInfo.setPictUrl(goods.getGoodsThumbUrl()); |
| | | if (needGoods) { |
| | | shareInfo |
| | | .setGoodsInfo(GoodsDetailVOFactory.convertVIPGoods(goods, |
| | | new ConfigParamsDTO(hongBaoManageService.getFanLiRate(), |
| | | hongBaoManageService.getShareRate(), Constant.MAX_REWARD_RATE, |
| | | hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP)))); |
| | | } |
| | | |
| | | String template = shareGoodsTextTemplateService.getTextTemplateByVIP(uid); |
| | | String shareText = shareGoodsTextTemplateService.createContentVIP(template, goods, jumpLink); |
| | | shareInfo.setShareText(shareText); |
| | | |
| | | String descText = shareText.replace(goods.getGoodsName(), "").trim(); |
| | | if (descText.startsWith("\\r\\n")) { |
| | | descText = descText.substring(0); |
| | | } |
| | | shareInfo.setDescText(descText); |
| | | |
| | | // |
| | | String imgs = configService.getByVersion(ConfigKeyEnum.goodsShareNotifyImgs.getKey(), acceptData.getPlatform(), |
| | | Integer.parseInt(acceptData.getVersion())); |
| | | JSONArray array = JSONArray.fromObject(imgs); |
| | | |
| | | shareInfo.setNotifyPicture(array.size() > 1 ? array.optString(1) : array.optString(0)); |
| | | |
| | | // 2.0.7版本后的提示图片 |
| | | imgs = configService.get(ConfigKeyEnum.goodsShareNotifyImgs207.getKey()); |
| | | array = JSONArray.fromObject(imgs); |
| | | shareInfo.setNotifyPictureNew(array.size() > 1 ? array.optString(1) : array.optString(0)); |
| | | |
| | | shareInfo.setNotifyDesc(configService.get(ConfigKeyEnum.goodsShareNotifyPDD.getKey())); |
| | | |
| | | // 添加分享记录 |
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(); |
| | | BigDecimal shareMoney = VipShopUtil.getGoodsFanLiMoney(goods, shareRate); |
| | | shareInfo.setShareMoney("¥" + shareMoney.toString()); |
| | | |
| | | try { |
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, goodsId, |
| | | Constant.SOURCE_TYPE_VIP, false); |
| | | shareInfo.setShareId(shareRecord.getRedisKey()); |
| | | } catch (Exception e) { |
| | | try { |
| | | LogHelper.errorDetailInfo(e); |
| | | } catch (Exception e1) { |
| | | e1.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | String inviteCode = userInfoExtraService.getInviteCodeByUid(uid); |
| | | |
| | | String commentText = ""; |
| | | String recommendText = ""; |
| | | String qtemplate = configService.get(ConfigKeyEnum.quickShareGoodsText.getKey()); |
| | | recommendText = qtemplate.replace("[商品标题]", goods.getGoodsName()); |
| | | |
| | | recommendText = recommendText.replace("推荐理由:[推荐语]", ""); |
| | | |
| | | String quickCommentText = configService.get(ConfigKeyEnum.quickSharePDDCommentText.getKey()); |
| | | commentText = quickCommentText.replace("[原价]", goods.getMarketPrice()); |
| | | commentText = commentText.replace("[链接]", jumpLink); |
| | | |
| | | commentText = commentText.replace("领券抢购", "抢购"); |
| | | commentText = commentText.replace("【券后价】[券后价]元", ""); |
| | | recommendText = recommendText.replace("优惠券:[券面额]元", ""); |
| | | |
| | | shareInfo.setRecommendText(deleteBlankLine(recommendText)); |
| | | shareInfo.setCommentText(deleteBlankLine(commentText)); |
| | | |
| | | // 设置评论文本选项 |
| | | shareInfo.setCommentTextChoiceList(getCommentChoiceList(null, shareInfo.getCommentText(), inviteCode, |
| | | VipShopUtil.getGoodsFanLiMoney(goods, hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP)))); |
| | | |
| | | out.print(JsonUtil.loadTrueResult( |
| | | JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo))); |
| | | |
| | | // 异步操作 |
| | | com.yeshi.fanli.util.ThreadUtil.run(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | // 异步操作 添加分享记录 |
| | | UserShareGoodsHistory history = new UserShareGoodsHistory(); |
| | | history.setUser(new UserInfo(uid)); |
| | | history.setHongbao(shareMoney); |
| | | history.setCreateTime(new Date()); |
| | | history.setGoodsType(Constant.SOURCE_TYPE_VIP); |
| | | history.setTkCode(null); |
| | | history.setLink(null); |
| | | history.setQuanLink(null); |
| | | history.setGoodsId(goodsId); |
| | | history.setPostPicture(goods.getGoodsThumbUrl()); |
| | | history.setShareImg(jumpLink); |
| | | List<String> imgList = goods.getGoodsDetailPictures(); |
| | | if (imgList == null) { |
| | | imgList = new ArrayList<>(); |
| | | } |
| | | history.setPictures(JsonUtil.getGson().toJson(imgList)); |
| | | shareGoodsService.addShareGoodsHistory(history); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 预览分享模板 |
| | | * |
| | | * @param acceptData |
| | |
| | | Query query = Query.query(Criteria.where("id").is(id));
|
| | | mongoTemplate.remove(query, getEntityClass());
|
| | | }
|
| | | |
| | | public void delete(Query query) {
|
| | | mongoTemplate.remove(query, getEntityClass());
|
| | | }
|
| | |
|
| | | @SuppressWarnings("unchecked")
|
| | | protected Class<T> getEntityClass() {
|
New file |
| | |
| | | package com.yeshi.fanli.dao.goods.taobao.haodanku;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import org.springframework.data.mongodb.core.query.Criteria;
|
| | | import org.springframework.data.mongodb.core.query.Query;
|
| | | import org.springframework.data.mongodb.core.query.Update;
|
| | | import org.springframework.stereotype.Repository;
|
| | |
|
| | | import com.yeshi.fanli.dao.MongodbBaseDao;
|
| | | import com.yeshi.fanli.entity.taobao.haodanku.HDKGoodsDetail;
|
| | |
|
| | | @Repository
|
| | | public class HDKGoodsDetailDao extends MongodbBaseDao<HDKGoodsDetail> {
|
| | |
|
| | | /**
|
| | | * 根据商品ID检索
|
| | | * @Title: selectByAuctionId
|
| | | * @Description: |
| | | * @param auctionId
|
| | | * @return |
| | | * DaTaoKeDetailV2 返回类型
|
| | | * @throws
|
| | | */
|
| | | public HDKGoodsDetail selectByAuctionId(Long auctionId) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("itemid").is(auctionId));
|
| | | query.limit(1);
|
| | | List<HDKGoodsDetail> list = mongoTemplate.find(query, HDKGoodsDetail.class);
|
| | | if (list != null && list.size() > 0) {
|
| | | return list.get(0);
|
| | | } else
|
| | | return null;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 选择更新
|
| | | * @Title: updateSelective
|
| | | * @Description: |
| | | * @param goods |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | |
|
| | | public void updateSelective(HDKGoodsDetail goods) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("product_id").is(goods.getProduct_id()));
|
| | |
|
| | | Update update = new Update();
|
| | | if (goods.getItemsale() != null)
|
| | | update.set("itemsale", goods.getItemsale());
|
| | | if (goods.getItemsale2() != null)
|
| | | update.set("itemsale2", goods.getItemsale2());
|
| | | if (goods.getTodaysale() != null)
|
| | | update.set("todaysale", goods.getTodaysale());
|
| | | if (goods.getGeneral_index() != null)
|
| | | update.set("general_index", goods.getGeneral_index());
|
| | | if (goods.getCouponurl() != null)
|
| | | update.set("couponurl", goods.getCouponurl());
|
| | | if (goods.getCouponreceive2() != null)
|
| | | update.set("couponreceive2", goods.getCouponreceive2());
|
| | | if (goods.getCouponsurplus() != null)
|
| | | update.set("couponsurplus", goods.getCouponsurplus());
|
| | | if (goods.getActivityid() != null)
|
| | | update.set("activityid", goods.getActivityid());
|
| | | if (goods.getCouponmoney() != null)
|
| | | update.set("couponmoney", goods.getCouponmoney());
|
| | |
|
| | | update.set("updateTime", new Date());
|
| | | update(query, update);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 批量删除
|
| | | * @Title: deleteByItemIds
|
| | | * @Description: |
| | | * @param itemIds |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | public void deleteByItemIds(List<Long> itemIds) {
|
| | | if (itemIds == null || itemIds.size() == 0)
|
| | | return;
|
| | | Criteria[] ids = new Criteria[itemIds.size()];
|
| | | for (int i = 0; i < itemIds.size(); i++)
|
| | | ids[i] = Criteria.where("itemid").is(itemIds.get(i));
|
| | |
|
| | | Query query = new Query();
|
| | | query.addCriteria(new Criteria().orOperator(ids));
|
| | | mongoTemplate.remove(query, HDKGoodsDetail.class);
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dto.taobao.haodanku;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.taobao.haodanku.HDKGoodsDetail;
|
| | |
|
| | | /**
|
| | | * 好单库微信发圈内容
|
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class HDKGoodsListResultDTO {
|
| | | private List<HDKGoodsDetail> goodsList;
|
| | | private Integer minId;
|
| | |
|
| | | public HDKGoodsListResultDTO(List<HDKGoodsDetail> goodsList, Integer minId) {
|
| | | super();
|
| | | this.goodsList = goodsList;
|
| | | this.minId = minId;
|
| | | }
|
| | |
|
| | | public List<HDKGoodsDetail> getGoodsList() {
|
| | | return goodsList;
|
| | | }
|
| | |
|
| | | public void setGoodsList(List<HDKGoodsDetail> goodsList) {
|
| | | this.goodsList = goodsList;
|
| | | }
|
| | |
|
| | | public Integer getMinId() {
|
| | | return minId;
|
| | | }
|
| | |
|
| | | public void setMinId(Integer minId) {
|
| | | this.minId = minId;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dto.taobao.haodanku;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | /**
|
| | | * 好单库微信发圈内容
|
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class HDKWXCircleContentDTO {
|
| | |
|
| | | private String edit_id;
|
| | | private String itemid;
|
| | | private List<String> itempic; // 多张宝贝图片,
|
| | | private String title;// itemtitle
|
| | | private String couponurl;// 优惠券链接
|
| | | private String copy_content;
|
| | | private String comment;// 朋友圈评论内容(表情未处理),多条评论用“|”做区分
|
| | | private String add_time;
|
| | | private String show_time;// 展示时间戳
|
| | | private String itemendprice;// 宝贝券后价
|
| | | private String couponmoney;// 优惠券金额
|
| | | private String sola_image;//
|
| | | private String dummy_click_statistics;// 该商品被分享次数
|
| | | private String tkrates;// 佣金比例
|
| | | private String itemprice;// 在售价
|
| | | private String content;// 单品导购内容(表情未处理)
|
| | | private String show_content;// 导购文案展示内容,含表情
|
| | | private String copy_comment;// 导购文案复制内容,含表情
|
| | | private String show_comment;// 朋友圈评论展示内容,含表情,多条评论用“|”做区分
|
| | | private String itemtitle;// 宝贝标题
|
| | | private String advise_time;//
|
| | |
|
| | | public String getEdit_id() {
|
| | | return edit_id;
|
| | | }
|
| | |
|
| | | public void setEdit_id(String edit_id) {
|
| | | this.edit_id = edit_id;
|
| | | }
|
| | |
|
| | | public String getItemid() {
|
| | | return itemid;
|
| | | }
|
| | |
|
| | | public void setItemid(String itemid) {
|
| | | this.itemid = itemid;
|
| | | }
|
| | |
|
| | | public List<String> getItempic() {
|
| | | return itempic;
|
| | | }
|
| | |
|
| | | public void setItempic(List<String> itempic) {
|
| | | this.itempic = itempic;
|
| | | }
|
| | |
|
| | | public String getTitle() {
|
| | | return title;
|
| | | }
|
| | |
|
| | | public void setTitle(String title) {
|
| | | this.title = title;
|
| | | }
|
| | |
|
| | | public String getCouponurl() {
|
| | | return couponurl;
|
| | | }
|
| | |
|
| | | public void setCouponurl(String couponurl) {
|
| | | this.couponurl = couponurl;
|
| | | }
|
| | |
|
| | | public String getCopy_content() {
|
| | | return copy_content;
|
| | | }
|
| | |
|
| | | public void setCopy_content(String copy_content) {
|
| | | this.copy_content = copy_content;
|
| | | }
|
| | |
|
| | | public String getComment() {
|
| | | return comment;
|
| | | }
|
| | |
|
| | | public void setComment(String comment) {
|
| | | this.comment = comment;
|
| | | }
|
| | |
|
| | | public String getAdd_time() {
|
| | | return add_time;
|
| | | }
|
| | |
|
| | | public void setAdd_time(String add_time) {
|
| | | this.add_time = add_time;
|
| | | }
|
| | |
|
| | | public String getShow_time() {
|
| | | return show_time;
|
| | | }
|
| | |
|
| | | public void setShow_time(String show_time) {
|
| | | this.show_time = show_time;
|
| | | }
|
| | |
|
| | | public String getItemendprice() {
|
| | | return itemendprice;
|
| | | }
|
| | |
|
| | | public void setItemendprice(String itemendprice) {
|
| | | this.itemendprice = itemendprice;
|
| | | }
|
| | |
|
| | | public String getCouponmoney() {
|
| | | return couponmoney;
|
| | | }
|
| | |
|
| | | public void setCouponmoney(String couponmoney) {
|
| | | this.couponmoney = couponmoney;
|
| | | }
|
| | |
|
| | | public String getSola_image() {
|
| | | return sola_image;
|
| | | }
|
| | |
|
| | | public void setSola_image(String sola_image) {
|
| | | this.sola_image = sola_image;
|
| | | }
|
| | |
|
| | | public String getDummy_click_statistics() {
|
| | | return dummy_click_statistics;
|
| | | }
|
| | |
|
| | | public void setDummy_click_statistics(String dummy_click_statistics) {
|
| | | this.dummy_click_statistics = dummy_click_statistics;
|
| | | }
|
| | |
|
| | | public String getTkrates() {
|
| | | return tkrates;
|
| | | }
|
| | |
|
| | | public void setTkrates(String tkrates) {
|
| | | this.tkrates = tkrates;
|
| | | }
|
| | |
|
| | | public String getItemprice() {
|
| | | return itemprice;
|
| | | }
|
| | |
|
| | | public void setItemprice(String itemprice) {
|
| | | this.itemprice = itemprice;
|
| | | }
|
| | |
|
| | | public String getContent() {
|
| | | return content;
|
| | | }
|
| | |
|
| | | public void setContent(String content) {
|
| | | this.content = content;
|
| | | }
|
| | |
|
| | | public String getShow_content() {
|
| | | return show_content;
|
| | | }
|
| | |
|
| | | public void setShow_content(String show_content) {
|
| | | this.show_content = show_content;
|
| | | }
|
| | |
|
| | | public String getCopy_comment() {
|
| | | return copy_comment;
|
| | | }
|
| | |
|
| | | public void setCopy_comment(String copy_comment) {
|
| | | this.copy_comment = copy_comment;
|
| | | }
|
| | |
|
| | | public String getShow_comment() {
|
| | | return show_comment;
|
| | | }
|
| | |
|
| | | public void setShow_comment(String show_comment) {
|
| | | this.show_comment = show_comment;
|
| | | }
|
| | |
|
| | | public String getItemtitle() {
|
| | | return itemtitle;
|
| | | }
|
| | |
|
| | | public void setItemtitle(String itemtitle) {
|
| | | this.itemtitle = itemtitle;
|
| | | }
|
| | |
|
| | | public String getAdvise_time() {
|
| | | return advise_time;
|
| | | }
|
| | |
|
| | | public void setAdvise_time(String advise_time) {
|
| | | this.advise_time = advise_time;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dto.vip;
|
| | |
|
| | | /**
|
| | | * 订单搜索
|
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class VIPSearchFilter {
|
| | | private String keyword;// 搜索关键词
|
| | | private String fieldName;// 排序字段: price-价格 discount-折扣
|
| | | private Integer order;// 0-正序 1-逆序
|
| | | private Integer page;// 页码
|
| | | private Integer pageSize;// 每页大小
|
| | | private String requestId;// 请求ID
|
| | | private String priceStart;// 起始价格
|
| | | private String priceEnd;// 结束价格
|
| | |
|
| | | public String getKeyword() {
|
| | | return keyword;
|
| | | }
|
| | |
|
| | | public void setKeyword(String keyword) {
|
| | | this.keyword = keyword;
|
| | | }
|
| | |
|
| | | public String getFieldName() {
|
| | | return fieldName;
|
| | | }
|
| | |
|
| | | public void setFieldName(String fieldName) {
|
| | | this.fieldName = fieldName;
|
| | | }
|
| | |
|
| | | public Integer getOrder() {
|
| | | return order;
|
| | | }
|
| | |
|
| | | public void setOrder(Integer order) {
|
| | | this.order = order;
|
| | | }
|
| | |
|
| | | public Integer getPage() {
|
| | | return page;
|
| | | }
|
| | |
|
| | | public void setPage(Integer page) {
|
| | | this.page = page;
|
| | | }
|
| | |
|
| | | public Integer getPageSize() {
|
| | | return pageSize;
|
| | | }
|
| | |
|
| | | public void setPageSize(Integer pageSize) {
|
| | | this.pageSize = pageSize;
|
| | | }
|
| | |
|
| | | public String getRequestId() {
|
| | | return requestId;
|
| | | }
|
| | |
|
| | | public void setRequestId(String requestId) {
|
| | | this.requestId = requestId;
|
| | | }
|
| | |
|
| | | public String getPriceStart() {
|
| | | return priceStart;
|
| | | }
|
| | |
|
| | | public void setPriceStart(String priceStart) {
|
| | | this.priceStart = priceStart;
|
| | | }
|
| | |
|
| | | public String getPriceEnd() {
|
| | | return priceEnd;
|
| | | }
|
| | |
|
| | | public void setPriceEnd(String priceEnd) {
|
| | | this.priceEnd = priceEnd;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | private VIPStoreServiceCapability storeServiceCapability;// 商品所属店铺服务能力评价:预留字段
|
| | | private Long brandId;// 商品所属档期(专场)id
|
| | | private Long schemeStartTime;// 商品所属推广方案开始时间:时间戳,单位:毫秒
|
| | | private Integer status;//状态 0-下架 1-上架
|
| | | |
| | | |
| | |
|
| | | public Integer getStatus() {
|
| | | return status;
|
| | | }
|
| | |
|
| | | public void setStatus(Integer status) {
|
| | | this.status = status;
|
| | | }
|
| | |
|
| | | public String getGoodsId() {
|
| | | return goodsId;
|
New file |
| | |
| | | package com.yeshi.fanli.dto.vipshop;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | public class VipShopOrderQueryModel {
|
| | | public final static int STATUS_NOT_VALID = 0;
|
| | | public final static int STATUS_UNKOWN = 1;
|
| | | public final static int STATUS_FINISH = 2;
|
| | |
|
| | | private Integer status;// 订单状态:0-不合格,1-待定,2-已完结,该参数不设置默认代表全部状态
|
| | | private Long orderTimeStart;// 订单时间起始 时间戳 单位毫秒
|
| | | private Long orderTimeEnd;// 订单时间结束 时间戳 单位毫秒
|
| | | private Integer page;// 页码:从1开始
|
| | | private Integer pageSize;// 页面大小:默认20
|
| | | private Long updateTimeStart;// 更新时间-起始 时间戳 单位毫秒
|
| | | private Long updateTimeEnd;// 更新时间-结束 时间戳 单位毫秒
|
| | | private List<String> orderSnList;// 订单号列表:当传入订单号列表时,订单时间和更新时间区间可不传入
|
| | | private String chanTag;// 筛选订单,渠道商方式下表示自定义渠道标识,工具商方式下表示用户pid
|
| | |
|
| | | public Integer getStatus() {
|
| | | return status;
|
| | | }
|
| | |
|
| | | public void setStatus(Integer status) {
|
| | | this.status = status;
|
| | | }
|
| | |
|
| | | public Long getOrderTimeStart() {
|
| | | return orderTimeStart;
|
| | | }
|
| | |
|
| | | public void setOrderTimeStart(Long orderTimeStart) {
|
| | | this.orderTimeStart = orderTimeStart;
|
| | | }
|
| | |
|
| | | public Long getOrderTimeEnd() {
|
| | | return orderTimeEnd;
|
| | | }
|
| | |
|
| | | public void setOrderTimeEnd(Long orderTimeEnd) {
|
| | | this.orderTimeEnd = orderTimeEnd;
|
| | | }
|
| | |
|
| | | public Integer getPage() {
|
| | | return page;
|
| | | }
|
| | |
|
| | | public void setPage(Integer page) {
|
| | | this.page = page;
|
| | | }
|
| | |
|
| | | public Integer getPageSize() {
|
| | | return pageSize;
|
| | | }
|
| | |
|
| | | public void setPageSize(Integer pageSize) {
|
| | | this.pageSize = pageSize;
|
| | | }
|
| | |
|
| | | public Long getUpdateTimeStart() {
|
| | | return updateTimeStart;
|
| | | }
|
| | |
|
| | | public void setUpdateTimeStart(Long updateTimeStart) {
|
| | | this.updateTimeStart = updateTimeStart;
|
| | | }
|
| | |
|
| | | public Long getUpdateTimeEnd() {
|
| | | return updateTimeEnd;
|
| | | }
|
| | |
|
| | | public void setUpdateTimeEnd(Long updateTimeEnd) {
|
| | | this.updateTimeEnd = updateTimeEnd;
|
| | | }
|
| | |
|
| | | public List<String> getOrderSnList() {
|
| | | return orderSnList;
|
| | | }
|
| | |
|
| | | public void setOrderSnList(List<String> orderSnList) {
|
| | | this.orderSnList = orderSnList;
|
| | | }
|
| | |
|
| | | public String getChanTag() {
|
| | | return chanTag;
|
| | | }
|
| | |
|
| | | public void setChanTag(String chanTag) {
|
| | | this.chanTag = chanTag;
|
| | | }
|
| | |
|
| | | public static VipShopOrderQueryModel createOrderTime(Long orderTimeStart, Long orderTimeEnd, Integer status,
|
| | | int page) {
|
| | | VipShopOrderQueryModel model = new VipShopOrderQueryModel();
|
| | | model.setOrderTimeStart(orderTimeStart);
|
| | | model.setOrderTimeEnd(orderTimeEnd);
|
| | | model.setStatus(status);
|
| | | model.setPage(page);
|
| | | return model;
|
| | | }
|
| | |
|
| | | public static VipShopOrderQueryModel createUpdateTime(Long updateTimeStart, Long updateTimeEnd, Integer status,
|
| | | int page) {
|
| | | VipShopOrderQueryModel model = new VipShopOrderQueryModel();
|
| | | model.setUpdateTimeStart(updateTimeStart);
|
| | | model.setUpdateTimeEnd(updateTimeEnd);
|
| | | model.setStatus(status);
|
| | | model.setPage(page);
|
| | | return model;
|
| | | }
|
| | |
|
| | | public static VipShopOrderQueryModel createOrderSn(List<String> orderSnList, int page) {
|
| | | VipShopOrderQueryModel model = new VipShopOrderQueryModel();
|
| | | model.setOrderSnList(orderSnList);
|
| | | model.setPage(page);
|
| | | return model;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dto.vipshop;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.vipshop.VipShopOrder;
|
| | |
|
| | | /**
|
| | | * 唯品会订单结果
|
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class VipShopQueryOrderResultDTO {
|
| | | private List<VipShopOrder> orderList;
|
| | | private Integer total;
|
| | |
|
| | | public VipShopQueryOrderResultDTO(List<VipShopOrder> orderList, Integer total) {
|
| | | super();
|
| | | this.orderList = orderList;
|
| | | this.total = total;
|
| | | }
|
| | |
|
| | | public List<VipShopOrder> getOrderList() {
|
| | | return orderList;
|
| | | }
|
| | |
|
| | | public void setOrderList(List<VipShopOrder> orderList) {
|
| | | this.orderList = orderList;
|
| | | }
|
| | |
|
| | | public Integer getTotal() {
|
| | | return total;
|
| | | }
|
| | |
|
| | | public void setTotal(Integer total) {
|
| | | this.total = total;
|
| | | }
|
| | | }
|
| | |
| | | public static int GOODS_TYPE_TB = 1;// 淘宝天猫
|
| | | public static int GOODS_TYPE_JD = 2;// 京东
|
| | | public static int GOODS_TYPE_PDD = 3;// 拼多多
|
| | | public static int GOODS_TYPE_VIP = 4;// 唯品会
|
| | | public static int GOODS_TYPE_SUNING = 5;// 苏宁
|
| | |
|
| | | public static int SHOP_TYPE_TB = 1;// 淘宝
|
| | | public static int SHOP_TYPE_TM = 2;// 天猫
|
| | | public static int SHOP_TYPE_JD = 20;// 京东
|
| | | public static int SHOP_TYPE_JD_SELF = 21;// 京东自营
|
| | | public static int SHOP_TYPE_PDD = 30;// 拼多多
|
| | | public static int SHOP_TYPE_VIP = 40;//唯品会自营
|
| | | |
| | |
|
| | | public static int STATE_NORMAL = 0;// 正常
|
| | | public static int STATE_OFFLINE = 1;// 下线
|
| | |
| | | private String sharePDDTextTemplate;// 拼多多无券分享模板
|
| | | @Column(name = "st_share_pdd_text_template_coupon")
|
| | | private String sharePDDTextTemplateCoupon;// 拼多多有券分享模板
|
| | | @Column(name = "st_share_vip_text_template")
|
| | | private String shareVIPTextTemplate;// 唯品会无券分享模板
|
| | | |
| | | |
| | | |
| | | |
| | | public String getShareVIPTextTemplate() {
|
| | | return shareVIPTextTemplate;
|
| | | }
|
| | |
|
| | | public void setShareVIPTextTemplate(String shareVIPTextTemplate) {
|
| | | this.shareVIPTextTemplate = shareVIPTextTemplate;
|
| | | }
|
| | |
|
| | | @Column(name = "st_create_time")
|
| | | private Date createTime;
|
| | | @Column(name = "st_update_time")
|
| | |
| | | shareSina("shareSina", "分享商品到新浪的前缀内容"), // 未找到对应Call |
| | | shareRuleLinkJD("share_rule_link_jd", "京东分享规则(帮助中心)"), |
| | | shareRuleLinkPDD("share_rule_link_pdd", "拼多多分享规则(帮助中心)"), |
| | | shareRuleLinkVIP("share_rule_link_vip", "唯品会分享规则(帮助中心)"), |
| | | shareSingleGoodsRule("share_single_goods_rule", "单品分享规则"), |
| | | shareGoodsTemplateRules("share_goods_template_rules", "分享模板规则"), // 存在2个相同 |
| | | // 内容不同、版本但一样 |
New file |
| | |
| | | package com.yeshi.fanli.entity.taobao.haodanku;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.springframework.data.annotation.Id;
|
| | | import org.springframework.data.mongodb.core.index.Indexed;
|
| | | import org.springframework.data.mongodb.core.mapping.Document;
|
| | | import org.springframework.data.mongodb.core.mapping.Field;
|
| | |
|
| | | /**
|
| | | * 好单库商品详情
|
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Document(collection = "haoDanKuGoods")
|
| | | public class HDKGoodsDetail {
|
| | | @Id
|
| | | private Integer product_id;// 自增ID
|
| | | @Field
|
| | | @Indexed
|
| | | private Long itemid;// 宝贝ID
|
| | | @Field
|
| | | private String itemtitle;// 宝贝标题
|
| | | @Field
|
| | | private String itemshorttitle;// 宝贝短标题
|
| | | @Field
|
| | | private String itemdesc;// 宝贝推荐语
|
| | | @Field
|
| | | private Double itemprice;// 在售价
|
| | | @Field
|
| | | private Integer itemsale;// 宝贝月销量
|
| | | @Field
|
| | | private Integer itemsale2;// 宝贝近2小时跑单
|
| | | @Field
|
| | | private Integer todaysale;// 当天销量
|
| | | @Field
|
| | | private String itempic;// 宝贝主图原始图像
|
| | | @Field
|
| | | private String itempic_copy;// 推广长图
|
| | | @Field
|
| | | private String taobao_image;// 轮播主图,用英文逗号分隔开来
|
| | | @Field
|
| | | private Integer fqcat;// 商品类目
|
| | | @Field
|
| | | private Double itemendprice;// 宝贝券后价
|
| | | @Field
|
| | | private String shoptype;// 店铺类型
|
| | | @Field
|
| | | private String couponurl;// 优惠券链接
|
| | | @Field
|
| | | private Double couponmoney;// 优惠券金额
|
| | | @Field
|
| | | private Integer is_brand;// 是否为品牌产品
|
| | | @Field
|
| | | private Integer is_live;// 是否为直播
|
| | | @Field
|
| | | private String guide_article;// 推广导购文案
|
| | | @Field
|
| | | private String videoid;// 商品视频ID
|
| | | @Field
|
| | | private String activity_type;// 活动类型
|
| | | @Field
|
| | | private String planlink;// 营销计划链接
|
| | | @Field
|
| | | private String userid;// 店主的userid
|
| | | @Field
|
| | | private String sellernick;// 店铺掌柜名
|
| | | @Field
|
| | | private String shopname;// 店铺名
|
| | | @Field
|
| | | private String tktype;// 佣金计划:隐藏 ,营销
|
| | | @Field
|
| | | private Double tkrates;// 佣金比例
|
| | | @Field
|
| | | private Integer cuntao;// 是否村淘(1是)
|
| | | @Field
|
| | | private Double tkmoney;// 预计可得(宝贝价格 * 佣金比例 / 100)
|
| | | @Field
|
| | | private Integer couponreceive2;// 当天优惠券领取量
|
| | | @Field
|
| | | private Integer couponsurplus;// 优惠券剩余量
|
| | | @Field
|
| | | private Integer couponnum;// 优惠券总数量
|
| | | @Field
|
| | | private String coupon_condition;// 优惠券使用条件
|
| | | @Field
|
| | | private String couponexplain;// 优惠券使用条件
|
| | | @Field
|
| | | private Integer couponstarttime;// 优惠券开始时间
|
| | | @Field
|
| | | private Integer couponendtime;// 优惠券结束时间
|
| | | @Field
|
| | | private Integer start_time;// 活动开始时间
|
| | | @Field
|
| | | private Integer end_time;// 活动结束时间
|
| | | @Field
|
| | | private Integer starttime;// 发布时间
|
| | | @Field
|
| | | private Integer report_status;// 举报处理条件 0未举报 1为待处理 2为忽略 3为下架
|
| | | @Field
|
| | | private Integer general_index;// 好单指数
|
| | | @Field
|
| | | private String seller_name;// 放单人名号
|
| | | @Field
|
| | | private Double discount;// 折扣力度
|
| | | @Field
|
| | | private Double deposit;// 双十一定金
|
| | | @Field
|
| | | private Double deposit_deduct;// 双十一定金抵扣金额
|
| | | @Field
|
| | | private Date createTime;// 创建时间
|
| | | @Field
|
| | | private Date updateTime;// 更新时间
|
| | | @Field
|
| | | private String activityid;
|
| | |
|
| | | public String getActivityid() {
|
| | | return activityid;
|
| | | }
|
| | |
|
| | | public void setActivityid(String activityid) {
|
| | | this.activityid = activityid;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | public Date getUpdateTime() {
|
| | | return updateTime;
|
| | | }
|
| | |
|
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | public Integer getProduct_id() {
|
| | | return product_id;
|
| | | }
|
| | |
|
| | | public void setProduct_id(Integer product_id) {
|
| | | this.product_id = product_id;
|
| | | }
|
| | |
|
| | | public Long getItemid() {
|
| | | return itemid;
|
| | | }
|
| | |
|
| | | public void setItemid(Long itemid) {
|
| | | this.itemid = itemid;
|
| | | }
|
| | |
|
| | | public String getItemtitle() {
|
| | | return itemtitle;
|
| | | }
|
| | |
|
| | | public void setItemtitle(String itemtitle) {
|
| | | this.itemtitle = itemtitle;
|
| | | }
|
| | |
|
| | | public String getItemshorttitle() {
|
| | | return itemshorttitle;
|
| | | }
|
| | |
|
| | | public void setItemshorttitle(String itemshorttitle) {
|
| | | this.itemshorttitle = itemshorttitle;
|
| | | }
|
| | |
|
| | | public String getItemdesc() {
|
| | | return itemdesc;
|
| | | }
|
| | |
|
| | | public void setItemdesc(String itemdesc) {
|
| | | this.itemdesc = itemdesc;
|
| | | }
|
| | |
|
| | | public Double getItemprice() {
|
| | | return itemprice;
|
| | | }
|
| | |
|
| | | public void setItemprice(Double itemprice) {
|
| | | this.itemprice = itemprice;
|
| | | }
|
| | |
|
| | | public Integer getItemsale() {
|
| | | return itemsale;
|
| | | }
|
| | |
|
| | | public void setItemsale(Integer itemsale) {
|
| | | this.itemsale = itemsale;
|
| | | }
|
| | |
|
| | | public Integer getItemsale2() {
|
| | | return itemsale2;
|
| | | }
|
| | |
|
| | | public void setItemsale2(Integer itemsale2) {
|
| | | this.itemsale2 = itemsale2;
|
| | | }
|
| | |
|
| | | public Integer getTodaysale() {
|
| | | return todaysale;
|
| | | }
|
| | |
|
| | | public void setTodaysale(Integer todaysale) {
|
| | | this.todaysale = todaysale;
|
| | | }
|
| | |
|
| | | public String getItempic() {
|
| | | return itempic;
|
| | | }
|
| | |
|
| | | public void setItempic(String itempic) {
|
| | | this.itempic = itempic;
|
| | | }
|
| | |
|
| | | public String getItempic_copy() {
|
| | | return itempic_copy;
|
| | | }
|
| | |
|
| | | public void setItempic_copy(String itempic_copy) {
|
| | | this.itempic_copy = itempic_copy;
|
| | | }
|
| | |
|
| | | public String getTaobao_image() {
|
| | | return taobao_image;
|
| | | }
|
| | |
|
| | | public void setTaobao_image(String taobao_image) {
|
| | | this.taobao_image = taobao_image;
|
| | | }
|
| | |
|
| | | public Integer getFqcat() {
|
| | | return fqcat;
|
| | | }
|
| | |
|
| | | public void setFqcat(Integer fqcat) {
|
| | | this.fqcat = fqcat;
|
| | | }
|
| | |
|
| | | public Double getItemendprice() {
|
| | | return itemendprice;
|
| | | }
|
| | |
|
| | | public void setItemendprice(Double itemendprice) {
|
| | | this.itemendprice = itemendprice;
|
| | | }
|
| | |
|
| | | public String getShoptype() {
|
| | | return shoptype;
|
| | | }
|
| | |
|
| | | public void setShoptype(String shoptype) {
|
| | | this.shoptype = shoptype;
|
| | | }
|
| | |
|
| | | public String getCouponurl() {
|
| | | return couponurl;
|
| | | }
|
| | |
|
| | | public void setCouponurl(String couponurl) {
|
| | | this.couponurl = couponurl;
|
| | | }
|
| | |
|
| | | public Double getCouponmoney() {
|
| | | return couponmoney;
|
| | | }
|
| | |
|
| | | public void setCouponmoney(Double couponmoney) {
|
| | | this.couponmoney = couponmoney;
|
| | | }
|
| | |
|
| | | public Integer getIs_brand() {
|
| | | return is_brand;
|
| | | }
|
| | |
|
| | | public void setIs_brand(Integer is_brand) {
|
| | | this.is_brand = is_brand;
|
| | | }
|
| | |
|
| | | public Integer getIs_live() {
|
| | | return is_live;
|
| | | }
|
| | |
|
| | | public void setIs_live(Integer is_live) {
|
| | | this.is_live = is_live;
|
| | | }
|
| | |
|
| | | public String getGuide_article() {
|
| | | return guide_article;
|
| | | }
|
| | |
|
| | | public void setGuide_article(String guide_article) {
|
| | | this.guide_article = guide_article;
|
| | | }
|
| | |
|
| | | public String getVideoid() {
|
| | | return videoid;
|
| | | }
|
| | |
|
| | | public void setVideoid(String videoid) {
|
| | | this.videoid = videoid;
|
| | | }
|
| | |
|
| | | public String getActivity_type() {
|
| | | return activity_type;
|
| | | }
|
| | |
|
| | | public void setActivity_type(String activity_type) {
|
| | | this.activity_type = activity_type;
|
| | | }
|
| | |
|
| | | public String getPlanlink() {
|
| | | return planlink;
|
| | | }
|
| | |
|
| | | public void setPlanlink(String planlink) {
|
| | | this.planlink = planlink;
|
| | | }
|
| | |
|
| | | public String getUserid() {
|
| | | return userid;
|
| | | }
|
| | |
|
| | | public void setUserid(String userid) {
|
| | | this.userid = userid;
|
| | | }
|
| | |
|
| | | public String getSellernick() {
|
| | | return sellernick;
|
| | | }
|
| | |
|
| | | public void setSellernick(String sellernick) {
|
| | | this.sellernick = sellernick;
|
| | | }
|
| | |
|
| | | public String getShopname() {
|
| | | return shopname;
|
| | | }
|
| | |
|
| | | public void setShopname(String shopname) {
|
| | | this.shopname = shopname;
|
| | | }
|
| | |
|
| | | public String getTktype() {
|
| | | return tktype;
|
| | | }
|
| | |
|
| | | public void setTktype(String tktype) {
|
| | | this.tktype = tktype;
|
| | | }
|
| | |
|
| | | public Double getTkrates() {
|
| | | return tkrates;
|
| | | }
|
| | |
|
| | | public void setTkrates(Double tkrates) {
|
| | | this.tkrates = tkrates;
|
| | | }
|
| | |
|
| | | public Integer getCuntao() {
|
| | | return cuntao;
|
| | | }
|
| | |
|
| | | public void setCuntao(Integer cuntao) {
|
| | | this.cuntao = cuntao;
|
| | | }
|
| | |
|
| | | public Double getTkmoney() {
|
| | | return tkmoney;
|
| | | }
|
| | |
|
| | | public void setTkmoney(Double tkmoney) {
|
| | | this.tkmoney = tkmoney;
|
| | | }
|
| | |
|
| | | public Integer getCouponreceive2() {
|
| | | return couponreceive2;
|
| | | }
|
| | |
|
| | | public void setCouponreceive2(Integer couponreceive2) {
|
| | | this.couponreceive2 = couponreceive2;
|
| | | }
|
| | |
|
| | | public Integer getCouponsurplus() {
|
| | | return couponsurplus;
|
| | | }
|
| | |
|
| | | public void setCouponsurplus(Integer couponsurplus) {
|
| | | this.couponsurplus = couponsurplus;
|
| | | }
|
| | |
|
| | | public Integer getCouponnum() {
|
| | | return couponnum;
|
| | | }
|
| | |
|
| | | public void setCouponnum(Integer couponnum) {
|
| | | this.couponnum = couponnum;
|
| | | }
|
| | |
|
| | | public String getCouponexplain() {
|
| | | return couponexplain;
|
| | | }
|
| | |
|
| | | public void setCouponexplain(String couponexplain) {
|
| | | this.couponexplain = couponexplain;
|
| | | }
|
| | |
|
| | | public Integer getCouponstarttime() {
|
| | | return couponstarttime;
|
| | | }
|
| | |
|
| | | public void setCouponstarttime(Integer couponstarttime) {
|
| | | this.couponstarttime = couponstarttime;
|
| | | }
|
| | |
|
| | | public Integer getCouponendtime() {
|
| | | return couponendtime;
|
| | | }
|
| | |
|
| | | public void setCouponendtime(Integer couponendtime) {
|
| | | this.couponendtime = couponendtime;
|
| | | }
|
| | |
|
| | | public Integer getStart_time() {
|
| | | return start_time;
|
| | | }
|
| | |
|
| | | public void setStart_time(Integer start_time) {
|
| | | this.start_time = start_time;
|
| | | }
|
| | |
|
| | | public Integer getEnd_time() {
|
| | | return end_time;
|
| | | }
|
| | |
|
| | | public void setEnd_time(Integer end_time) {
|
| | | this.end_time = end_time;
|
| | | }
|
| | |
|
| | | public Integer getStarttime() {
|
| | | return starttime;
|
| | | }
|
| | |
|
| | | public void setStarttime(Integer starttime) {
|
| | | this.starttime = starttime;
|
| | | }
|
| | |
|
| | | public Integer getReport_status() {
|
| | | return report_status;
|
| | | }
|
| | |
|
| | | public void setReport_status(Integer report_status) {
|
| | | this.report_status = report_status;
|
| | | }
|
| | |
|
| | | public Integer getGeneral_index() {
|
| | | return general_index;
|
| | | }
|
| | |
|
| | | public void setGeneral_index(Integer general_index) {
|
| | | this.general_index = general_index;
|
| | | }
|
| | |
|
| | | public String getSeller_name() {
|
| | | return seller_name;
|
| | | }
|
| | |
|
| | | public void setSeller_name(String seller_name) {
|
| | | this.seller_name = seller_name;
|
| | | }
|
| | |
|
| | | public Double getDiscount() {
|
| | | return discount;
|
| | | }
|
| | |
|
| | | public void setDiscount(Double discount) {
|
| | | this.discount = discount;
|
| | | }
|
| | |
|
| | | public Double getDeposit() {
|
| | | return deposit;
|
| | | }
|
| | |
|
| | | public void setDeposit(Double deposit) {
|
| | | this.deposit = deposit;
|
| | | }
|
| | |
|
| | | public Double getDeposit_deduct() {
|
| | | return deposit_deduct;
|
| | | }
|
| | |
|
| | | public void setDeposit_deduct(Double deposit_deduct) {
|
| | | this.deposit_deduct = deposit_deduct;
|
| | | }
|
| | |
|
| | | public String getCoupon_condition() {
|
| | | return coupon_condition;
|
| | | }
|
| | |
|
| | | public void setCoupon_condition(String coupon_condition) {
|
| | | this.coupon_condition = coupon_condition;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.vipshop;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | /**
|
| | | * 唯品会订单售后信息
|
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_vipshop_after_sale_detail_info")
|
| | | public class VipShopAfterSaleDetailInfo {
|
| | | @Column(name = "sdi_id")
|
| | | private Long id;// 主键ID
|
| | | @Column(name = "sdi_order_detail_id")
|
| | | private Long orderDetailId;// 订单详情
|
| | | @Column(name = "sdi_after_sale_changed_commission")
|
| | | private String afterSaleChangedCommission;// 商品佣金售后变动:仅在订单完结之后发生售后时返回,无售后时为空
|
| | | @Column(name = "sdi_after_sale_changed_goods_count")
|
| | | private String afterSaleChangedGoodsCount;// 商品数量售后变动:仅在订单完结之后发生售后时返回,无售后时为空
|
| | | @Column(name = "sdi_after_sale_sn")
|
| | | private String afterSaleSn;// 商品售后单号,无售后时为空
|
| | | @Column(name = "sdi_after_sale_status")
|
| | | private Integer afterSaleStatus;// 商品售后状态:1-售后中,2-售后完成,3-售后取消,无售后时为空
|
| | | @Column(name = "sdi_after_sale_type")
|
| | | private Integer afterSaleType;// 售后类型:1-退货,2-换货,无售后时为空
|
| | | @Column(name = "sdi_after_sale_finish_time")
|
| | | private String afterSaleFinishTime;// 售后完成时间,时间戳,单位:毫秒,无售后时为空
|
| | | @Column(name = "sdi_create_time")
|
| | | private Date createTime;// 创建时间
|
| | | @Column(name = "sdi_update_time")
|
| | | private Date updateTime;// 更新时间
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | public Date getUpdateTime() {
|
| | | return updateTime;
|
| | | }
|
| | |
|
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | public String getAfterSaleChangedCommission() {
|
| | | return afterSaleChangedCommission;
|
| | | }
|
| | |
|
| | | public void setAfterSaleChangedCommission(String afterSaleChangedCommission) {
|
| | | this.afterSaleChangedCommission = afterSaleChangedCommission;
|
| | | }
|
| | |
|
| | | public String getAfterSaleChangedGoodsCount() {
|
| | | return afterSaleChangedGoodsCount;
|
| | | }
|
| | |
|
| | | public void setAfterSaleChangedGoodsCount(String afterSaleChangedGoodsCount) {
|
| | | this.afterSaleChangedGoodsCount = afterSaleChangedGoodsCount;
|
| | | }
|
| | |
|
| | | public String getAfterSaleSn() {
|
| | | return afterSaleSn;
|
| | | }
|
| | |
|
| | | public void setAfterSaleSn(String afterSaleSn) {
|
| | | this.afterSaleSn = afterSaleSn;
|
| | | }
|
| | |
|
| | | public Integer getAfterSaleStatus() {
|
| | | return afterSaleStatus;
|
| | | }
|
| | |
|
| | | public void setAfterSaleStatus(Integer afterSaleStatus) {
|
| | | this.afterSaleStatus = afterSaleStatus;
|
| | | }
|
| | |
|
| | | public Integer getAfterSaleType() {
|
| | | return afterSaleType;
|
| | | }
|
| | |
|
| | | public void setAfterSaleType(Integer afterSaleType) {
|
| | | this.afterSaleType = afterSaleType;
|
| | | }
|
| | |
|
| | | public String getAfterSaleFinishTime() {
|
| | | return afterSaleFinishTime;
|
| | | }
|
| | |
|
| | | public void setAfterSaleFinishTime(String afterSaleFinishTime) {
|
| | | this.afterSaleFinishTime = afterSaleFinishTime;
|
| | | }
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Long getOrderDetailId() {
|
| | | return orderDetailId;
|
| | | }
|
| | |
|
| | | public void setOrderDetailId(Long orderDetailId) {
|
| | | this.orderDetailId = orderDetailId;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.vipshop;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | /**
|
| | | * 唯品会订单
|
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | |
|
| | | @Table("yeshi_ec_vipshop_order")
|
| | | public class VipShopOrder {
|
| | | @Column(name = "vo_id")
|
| | | private Long id;
|
| | | @Column(name = "vo_order_sn")
|
| | | private String orderSn;// 订单号
|
| | | @Column(name = "vo_order_status")
|
| | | private Integer status;// 订单状态:0-不合格,1-待定,2-已完结
|
| | | @Column(name = "vo_new_customer")
|
| | | private Integer newCustomer;// 新老客标识:2-老客,1-新客 , 0-待 定
|
| | | @Column(name = "vo_channel_tag")
|
| | | private String channelTag;// 渠道标识
|
| | | @Column(name = "vo_order_time")
|
| | | private Long orderTime;// 下单时间
|
| | | @Column(name = "vo_sign_time")
|
| | | private Long signTime;// 签收时间
|
| | | @Column(name = "vo_settled_time")
|
| | | private Long settledTime;// 结算时间
|
| | | @Column(name = "vo_last_update_time")
|
| | | private Long lastUpdateTime;// 订单上次更新时间 时间戳 单位毫秒
|
| | | @Column(name = "vo_settled")
|
| | | private Integer settled;// 订单结算状态 0-未结算,1-已结算
|
| | | @Column(name = "vo_self_buy")
|
| | | private Integer selfBuy;// 是否自推自买 0-否,1-是
|
| | | @Column(name = "vo_order_sub_status_name")
|
| | | private String orderSubStatusName;// 订单子状态:流转状态-支持状态:(已下单、已付款、已签收、待结算、已结算、已失效)
|
| | | @Column(name = "vo_commission")
|
| | | private BigDecimal commission;// 商品总佣金:单位元
|
| | | @Column(name = "vo_after_sale_change_commission")
|
| | | private String afterSaleChangeCommission;// 售后订单佣金变动:仅在订单完结之后发生售后行为时返回
|
| | | @Column(name = "vo_after_sale_change_goods_count")
|
| | | private Integer afterSaleChangeGoodsCount;// 售后订单总商品数量变动:仅在订单完结之后发生售后行为时返回
|
| | | @Column(name = "vo_commission_enter_time")
|
| | | private Long commissionEnterTime;// 入账时间,时间戳,单位毫秒
|
| | | @Column(name = "vo_order_source")
|
| | | private String orderSource;// 订单来源
|
| | | @Column(name = "vo_pid")
|
| | | private String pid;// 推广PID:目前等同于channelTag
|
| | | @Column(name = "vo_is_prepay")
|
| | | private Integer isPrepay;// 是否预付订单:0-否,1-是
|
| | | @Column(name = "vo_b2c_user_id")
|
| | | private Long b2cUserId;// 买家的b2c_user_id
|
| | | @Column(name = "vo_create_time")
|
| | | private Date createTime;
|
| | | @Column(name = "vo_update_time")
|
| | | private Date updateTime;
|
| | | private List<VipShopOrderDetail> detailList;
|
| | |
|
| | | public List<VipShopOrderDetail> getDetailList() {
|
| | | return detailList;
|
| | | }
|
| | |
|
| | | public void setDetailList(List<VipShopOrderDetail> detailList) {
|
| | | this.detailList = detailList;
|
| | | }
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public String getOrderSn() {
|
| | | return orderSn;
|
| | | }
|
| | |
|
| | | public void setOrderSn(String orderSn) {
|
| | | this.orderSn = orderSn;
|
| | | }
|
| | |
|
| | | public Integer getStatus() {
|
| | | return status;
|
| | | }
|
| | |
|
| | | public void setStatus(Integer status) {
|
| | | this.status = status;
|
| | | }
|
| | |
|
| | | public Integer getNewCustomer() {
|
| | | return newCustomer;
|
| | | }
|
| | |
|
| | | public void setNewCustomer(Integer newCustomer) {
|
| | | this.newCustomer = newCustomer;
|
| | | }
|
| | |
|
| | | public String getChannelTag() {
|
| | | return channelTag;
|
| | | }
|
| | |
|
| | | public void setChannelTag(String channelTag) {
|
| | | this.channelTag = channelTag;
|
| | | }
|
| | |
|
| | | public Long getOrderTime() {
|
| | | return orderTime;
|
| | | }
|
| | |
|
| | | public void setOrderTime(Long orderTime) {
|
| | | this.orderTime = orderTime;
|
| | | }
|
| | |
|
| | | public Long getSignTime() {
|
| | | return signTime;
|
| | | }
|
| | |
|
| | | public void setSignTime(Long signTime) {
|
| | | this.signTime = signTime;
|
| | | }
|
| | |
|
| | | public Long getSettledTime() {
|
| | | return settledTime;
|
| | | }
|
| | |
|
| | | public void setSettledTime(Long settledTime) {
|
| | | this.settledTime = settledTime;
|
| | | }
|
| | |
|
| | | public Long getLastUpdateTime() {
|
| | | return lastUpdateTime;
|
| | | }
|
| | |
|
| | | public void setLastUpdateTime(Long lastUpdateTime) {
|
| | | this.lastUpdateTime = lastUpdateTime;
|
| | | }
|
| | |
|
| | | public Integer getSettled() {
|
| | | return settled;
|
| | | }
|
| | |
|
| | | public void setSettled(Integer settled) {
|
| | | this.settled = settled;
|
| | | }
|
| | |
|
| | | public Integer getSelfBuy() {
|
| | | return selfBuy;
|
| | | }
|
| | |
|
| | | public void setSelfBuy(Integer selfBuy) {
|
| | | this.selfBuy = selfBuy;
|
| | | }
|
| | |
|
| | | public String getOrderSubStatusName() {
|
| | | return orderSubStatusName;
|
| | | }
|
| | |
|
| | | public void setOrderSubStatusName(String orderSubStatusName) {
|
| | | this.orderSubStatusName = orderSubStatusName;
|
| | | }
|
| | |
|
| | | public BigDecimal getCommission() {
|
| | | return commission;
|
| | | }
|
| | |
|
| | | public void setCommission(BigDecimal commission) {
|
| | | this.commission = commission;
|
| | | }
|
| | |
|
| | | public String getAfterSaleChangeCommission() {
|
| | | return afterSaleChangeCommission;
|
| | | }
|
| | |
|
| | | public void setAfterSaleChangeCommission(String afterSaleChangeCommission) {
|
| | | this.afterSaleChangeCommission = afterSaleChangeCommission;
|
| | | }
|
| | |
|
| | | public Integer getAfterSaleChangeGoodsCount() {
|
| | | return afterSaleChangeGoodsCount;
|
| | | }
|
| | |
|
| | | public void setAfterSaleChangeGoodsCount(Integer afterSaleChangeGoodsCount) {
|
| | | this.afterSaleChangeGoodsCount = afterSaleChangeGoodsCount;
|
| | | }
|
| | |
|
| | | public Long getCommissionEnterTime() {
|
| | | return commissionEnterTime;
|
| | | }
|
| | |
|
| | | public void setCommissionEnterTime(Long commissionEnterTime) {
|
| | | this.commissionEnterTime = commissionEnterTime;
|
| | | }
|
| | |
|
| | | public String getOrderSource() {
|
| | | return orderSource;
|
| | | }
|
| | |
|
| | | public void setOrderSource(String orderSource) {
|
| | | this.orderSource = orderSource;
|
| | | }
|
| | |
|
| | | public String getPid() {
|
| | | return pid;
|
| | | }
|
| | |
|
| | | public void setPid(String pid) {
|
| | | this.pid = pid;
|
| | | }
|
| | |
|
| | | public Integer getIsPrepay() {
|
| | | return isPrepay;
|
| | | }
|
| | |
|
| | | public void setIsPrepay(Integer isPrepay) {
|
| | | this.isPrepay = isPrepay;
|
| | | }
|
| | |
|
| | | public Long getB2cUserId() {
|
| | | return b2cUserId;
|
| | | }
|
| | |
|
| | | public void setB2cUserId(Long b2cUserId) {
|
| | | this.b2cUserId = b2cUserId;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | public Date getUpdateTime() {
|
| | | return updateTime;
|
| | | }
|
| | |
|
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.vipshop;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | /**
|
| | | * 唯品会订单详情
|
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_vipshop_order_detail")
|
| | | public class VipShopOrderDetail {
|
| | |
|
| | | public final static int STATUS_INVALID = 0;// 不合格
|
| | | public final static int STATUS_UNKOWN = 1;// 待定
|
| | | public final static int STATUS_FINISH = 2;// 已完结
|
| | |
|
| | | // 明细
|
| | | @Column(name = "vod_id")
|
| | | private Long id;
|
| | | @Column(name = "vod_identify_code")
|
| | | private String identifyCode;// 唯一标识
|
| | | @Column(name = "vod_goods_id")
|
| | | private String goodsId;// 商品id
|
| | | @Column(name = "vod_goods_name")
|
| | | private String goodsName;// 商品名称
|
| | | @Column(name = "vod_goods_thumb")
|
| | | private String goodsThumb;// 商品缩略图
|
| | | @Column(name = "vod_goods_count")
|
| | | private Integer goodsCount;// 商品数量
|
| | | @Column(name = "vod_commission_total_cost")
|
| | | private BigDecimal commissionTotalCost;// 商品计佣金额(元,保留两位小数)
|
| | | @Column(name = "vod_commission_rate")
|
| | | private BigDecimal commissionRate;// 商品佣金比例(%)
|
| | | @Column(name = "vod_commission")
|
| | | private BigDecimal commission;// 商品佣金金额(元,保留两位小数)
|
| | | @Column(name = "vod_comm_code")
|
| | | private String commCode;// 佣金编码:对应商品二级分类
|
| | | @Column(name = "vod_comm_name")
|
| | | private String commName;// 佣金方案名称
|
| | | @Column(name = "vod_order_source")
|
| | | private String orderSource;// 订单来源
|
| | | @Column(name = "vod_size_id")
|
| | | private String sizeId;// 商品尺码:2019.01.01之后可用
|
| | | @Column(name = "vod_status")
|
| | | private Integer status;// 商品状态:0-不合格,1-待定,2-已完结
|
| | | @Column(name = "vod_order_sn")
|
| | | private String orderSn;// 订单号
|
| | | @Column(name = "vod_create_time")
|
| | | private Date createTime;// 创建时间
|
| | | @Column(name = "vod_update_time")
|
| | | private Date updateTime;// 更新时间
|
| | |
|
| | | private List<VipShopAfterSaleDetailInfo> afterSaleInfo;// 售后信息
|
| | | |
| | | private VipShopOrder order;//订单
|
| | | |
| | |
|
| | | public VipShopOrder getOrder() {
|
| | | return order;
|
| | | }
|
| | |
|
| | | public void setOrder(VipShopOrder order) {
|
| | | this.order = order;
|
| | | }
|
| | |
|
| | | public List<VipShopAfterSaleDetailInfo> getAfterSaleInfo() {
|
| | | return afterSaleInfo;
|
| | | }
|
| | |
|
| | | public void setAfterSaleInfo(List<VipShopAfterSaleDetailInfo> afterSaleInfo) {
|
| | | this.afterSaleInfo = afterSaleInfo;
|
| | | }
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public String getIdentifyCode() {
|
| | | return identifyCode;
|
| | | }
|
| | |
|
| | | public void setIdentifyCode(String identifyCode) {
|
| | | this.identifyCode = identifyCode;
|
| | | }
|
| | |
|
| | | public String getGoodsId() {
|
| | | return goodsId;
|
| | | }
|
| | |
|
| | | public void setGoodsId(String goodsId) {
|
| | | this.goodsId = goodsId;
|
| | | }
|
| | |
|
| | | public String getGoodsName() {
|
| | | return goodsName;
|
| | | }
|
| | |
|
| | | public void setGoodsName(String goodsName) {
|
| | | this.goodsName = goodsName;
|
| | | }
|
| | |
|
| | | public String getGoodsThumb() {
|
| | | return goodsThumb;
|
| | | }
|
| | |
|
| | | public void setGoodsThumb(String goodsThumb) {
|
| | | this.goodsThumb = goodsThumb;
|
| | | }
|
| | |
|
| | | public Integer getGoodsCount() {
|
| | | return goodsCount;
|
| | | }
|
| | |
|
| | | public void setGoodsCount(Integer goodsCount) {
|
| | | this.goodsCount = goodsCount;
|
| | | }
|
| | |
|
| | | public BigDecimal getCommissionTotalCost() {
|
| | | return commissionTotalCost;
|
| | | }
|
| | |
|
| | | public void setCommissionTotalCost(BigDecimal commissionTotalCost) {
|
| | | this.commissionTotalCost = commissionTotalCost;
|
| | | }
|
| | |
|
| | | public BigDecimal getCommissionRate() {
|
| | | return commissionRate;
|
| | | }
|
| | |
|
| | | public void setCommissionRate(BigDecimal commissionRate) {
|
| | | this.commissionRate = commissionRate;
|
| | | }
|
| | |
|
| | | public BigDecimal getCommission() {
|
| | | return commission;
|
| | | }
|
| | |
|
| | | public void setCommission(BigDecimal commission) {
|
| | | this.commission = commission;
|
| | | }
|
| | |
|
| | | public String getCommCode() {
|
| | | return commCode;
|
| | | }
|
| | |
|
| | | public void setCommCode(String commCode) {
|
| | | this.commCode = commCode;
|
| | | }
|
| | |
|
| | | public String getCommName() {
|
| | | return commName;
|
| | | }
|
| | |
|
| | | public void setCommName(String commName) {
|
| | | this.commName = commName;
|
| | | }
|
| | |
|
| | | public String getOrderSource() {
|
| | | return orderSource;
|
| | | }
|
| | |
|
| | | public void setOrderSource(String orderSource) {
|
| | | this.orderSource = orderSource;
|
| | | }
|
| | |
|
| | | public String getSizeId() {
|
| | | return sizeId;
|
| | | }
|
| | |
|
| | | public void setSizeId(String sizeId) {
|
| | | this.sizeId = sizeId;
|
| | | }
|
| | |
|
| | | public Integer getStatus() {
|
| | | return status;
|
| | | }
|
| | |
|
| | | public void setStatus(Integer status) {
|
| | | this.status = status;
|
| | | }
|
| | |
|
| | | public String getOrderSn() {
|
| | | return orderSn;
|
| | | }
|
| | |
|
| | | public void setOrderSn(String orderSn) {
|
| | | this.orderSn = orderSn;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | public Date getUpdateTime() {
|
| | | return updateTime;
|
| | | }
|
| | |
|
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.exception.vipshop;
|
| | |
|
| | | import com.yeshi.fanli.exception.BaseException;
|
| | |
|
| | | public class VipShopOrderException extends BaseException {
|
| | | |
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | | public VipShopOrderException(int code, String msg) {
|
| | | super(code, msg);
|
| | | }
|
| | |
|
| | | public VipShopOrderException() {
|
| | | super();
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.job.goods;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.Calendar;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import com.xxl.job.core.biz.model.ReturnT;
|
| | | import com.xxl.job.core.handler.annotation.XxlJob;
|
| | | import com.yeshi.fanli.dto.taobao.haodanku.HDKGoodsListResultDTO;
|
| | | import com.yeshi.fanli.entity.taobao.haodanku.HDKGoodsDetail;
|
| | | import com.yeshi.fanli.service.inter.taobao.haodanku.HDKGoodsDetailService;
|
| | | import com.yeshi.fanli.util.taobao.HaoDanKuApiUtil;
|
| | |
|
| | | @Component
|
| | | public class HDKGoodsJob {
|
| | |
|
| | | @Resource
|
| | | private HDKGoodsDetailService hdkGoodsDetailService;
|
| | |
|
| | | /**
|
| | | * 同步所有商品
|
| | | * @Title: syncAll
|
| | | * @Description: |
| | | * @param param
|
| | | * @return
|
| | | * @throws Exception |
| | | * ReturnT<String> 返回类型
|
| | | * @throws
|
| | | */
|
| | | @XxlJob("goods-taobao-hdk-syncall")
|
| | | public ReturnT<String> syncAll(String param) throws Exception {
|
| | | Integer minId = 1;
|
| | | while (minId != null) {
|
| | | HDKGoodsListResultDTO dto = HaoDanKuApiUtil.getInstance().listGoods(minId, null, 200);
|
| | | if (dto != null) {
|
| | | minId = dto.getMinId();
|
| | | List<HDKGoodsDetail> goodsList = dto.getGoodsList();
|
| | | if (goodsList != null)
|
| | | for (HDKGoodsDetail goods : goodsList) {
|
| | | try {
|
| | | hdkGoodsDetailService.addGoods(goods);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | } else {
|
| | | minId = null;
|
| | | }
|
| | | }
|
| | |
|
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 新增
|
| | | * @Title: syncNewAdd
|
| | | * @Description: |
| | | * @param param
|
| | | * @return
|
| | | * @throws Exception |
| | | * ReturnT<String> 返回类型
|
| | | * @throws
|
| | | */
|
| | | @XxlJob("goods-taobao-hdk-newadd")
|
| | | public ReturnT<String> newAdd(String param) throws Exception {
|
| | | // 更新最近2小时的数据
|
| | | int endHour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
|
| | | int startHour = endHour - 2;
|
| | | if (startHour < 0)
|
| | | startHour = 0;
|
| | |
|
| | | Integer minId = 1;
|
| | | while (minId != null) {
|
| | | HDKGoodsListResultDTO dto = HaoDanKuApiUtil.getInstance().listAddGoods(minId, startHour, endHour, 200);
|
| | | if (dto != null) {
|
| | | minId = dto.getMinId();
|
| | | List<HDKGoodsDetail> goodsList = dto.getGoodsList();
|
| | | if (goodsList != null)
|
| | | for (HDKGoodsDetail goods : goodsList) {
|
| | | try {
|
| | | hdkGoodsDetailService.addGoods(goods);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | } else {
|
| | | minId = null;
|
| | | }
|
| | | }
|
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 更新最新的数据
|
| | | * @Title: update
|
| | | * @Description: |
| | | * @param param
|
| | | * @return
|
| | | * @throws Exception |
| | | * ReturnT<String> 返回类型
|
| | | * @throws
|
| | | */
|
| | | @XxlJob("goods-taobao-hdk-update")
|
| | | public ReturnT<String> update(String param) throws Exception {
|
| | | Integer minId = 1;
|
| | | while (minId != null) {
|
| | | HDKGoodsListResultDTO dto = HaoDanKuApiUtil.getInstance().listUpdateGoods(minId, 200);
|
| | | if (dto != null) {
|
| | | minId = dto.getMinId();
|
| | | List<HDKGoodsDetail> goodsList = dto.getGoodsList();
|
| | | if (goodsList != null)
|
| | | for (HDKGoodsDetail goods : goodsList) {
|
| | | try {
|
| | | hdkGoodsDetailService.updateGoods(goods);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | } else {
|
| | | minId = null;
|
| | | }
|
| | | }
|
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 下架失效的
|
| | | * @Title: offlineInvalid
|
| | | * @Description: |
| | | * @param param
|
| | | * @return
|
| | | * @throws Exception |
| | | * ReturnT<String> 返回类型
|
| | | * @throws
|
| | | */
|
| | | @XxlJob("goods-taobao-hdk-offline-invalid")
|
| | | public ReturnT<String> offlineInvalid(String param) throws Exception {
|
| | | int endHour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
|
| | | int startHour = endHour - 2;
|
| | | if (startHour < 0)
|
| | | startHour = 0;
|
| | | List<Long> ids = HaoDanKuApiUtil.getInstance().listInvalidGoods(startHour, endHour);
|
| | | // 分页删除
|
| | | int pageSize = 100;
|
| | | int page = ids.size() % pageSize == 0 ? ids.size() / pageSize : ids.size() / pageSize + 1;
|
| | | for (int i = 0; i < page; i++) {
|
| | | int start = i * pageSize;
|
| | | List<Long> tempList = ids.subList(start, start + pageSize > ids.size() ? ids.size() : start + pageSize);
|
| | | hdkGoodsDetailService.deleteByItemIds(tempList);
|
| | | }
|
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.jd.JDCouponInfo; |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail; |
| | | import com.yeshi.fanli.dto.vip.goods.VIPGoodsInfo; |
| | | import com.yeshi.fanli.entity.bus.activity.ActivityUser; |
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsClass; |
| | | import com.yeshi.fanli.entity.dynamic.CommentInfo; |
| | |
| | | @Resource |
| | | private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service; |
| | | |
| | | |
| | | @Override |
| | | public void switchState(String id) throws GoodsEvaluateException { |
| | | if (id == null) { |
| | |
| | | } |
| | | goodsEvaluateDao.updateSatate(id, state); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public String saveHead(MultipartFile file, GoodsEvaluate record) throws GoodsEvaluateException { |
| | |
| | | InputStream inputStream = file.getInputStream(); |
| | | String contentType = file.getContentType(); |
| | | String type = contentType.substring(contentType.indexOf("/") + 1); |
| | | String filePath = FilePathEnum.goodsEvaluate.getPath() + UUID.randomUUID().toString().replace("-", "") + "."+ type; |
| | | String filePath = FilePathEnum.goodsEvaluate.getPath() + UUID.randomUUID().toString().replace("-", "") + "." |
| | | + type; |
| | | |
| | | BufferedImage sourceImg = ImageIO.read(inputStream); |
| | | ImgInfo info = new ImgInfo(); |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | private String uploadPicture(File file, String contentType) throws Exception { |
| | | InputStream inputStream = new FileInputStream(file); |
| | |
| | | goodsEvaluateDao.save(resultObj); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void saveCurrencyCoupon(String pid, int kind, CommentInfo commentInfo) |
| | | throws GoodsEvaluateException, Exception { |
| | |
| | | throw new GoodsEvaluateException(1, "包含不可转链的口令与链接"); |
| | | } |
| | | } |
| | | |
| | | |
| | | List<CommentInfo> comments = new ArrayList<>(); |
| | | CommentInfo currencyCoupon = null; |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | List<ImgInfo> listImg = new ArrayList<ImgInfo>(); |
| | | if (imgVideo != null) { |
| | | if (!StringUtil.isNullOrEmpty(imgInfo.getVideoUrl())) { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | // 上传文件替换 |
| | | if (fileRequest != null) { |
| | | for (int i = 0; i < 9; i++) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | int lineNum = 0; |
| | | int totalImg = tempList.size(); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<GoodsEvaluate> query(int start, int count, String key, Integer state, int dynamicType, String typeEnum) { |
| | | public List<GoodsEvaluate> query(int start, int count, String key, Integer state, int dynamicType, |
| | | String typeEnum) { |
| | | return goodsEvaluateDao.query(start, count, key, state, dynamicType, typeEnum); |
| | | } |
| | | |
| | |
| | | if (!goodsVO.isHasCoupon()) { |
| | | commentText = commentText.replace("领券抢购", "抢购"); |
| | | commentText = commentText.replace("【券后价】[券后价]元", ""); |
| | | commentText = commentText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n","\r\n"); |
| | | commentText = commentText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", |
| | | "\r\n"); |
| | | } |
| | | commentInfo.setContent(commentText); |
| | | commentInfo.setType(CommentInfoEnum.goodsCoupon.getDesc()); |
| | |
| | | } |
| | | imgs.addAll(goodsimgs); |
| | | |
| | | |
| | | int i = 0; |
| | | List<ImgInfo> imgList = new ArrayList<>(); |
| | | for (String img : imgs) { |
| | |
| | | if (!goodsVO.isHasCoupon()) { |
| | | commentText = commentText.replace("领券抢购", "抢购"); |
| | | commentText = commentText.replace("【券后价】[券后价]元", ""); |
| | | commentText = commentText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n"); |
| | | commentText = commentText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n") |
| | | .replace("\r\n\r\n", "\r\n"); |
| | | } |
| | | |
| | | CommentInfo commentInfo = new CommentInfo(); |
| | |
| | | updateGoods(queryExist, goodsNew); |
| | | } |
| | | |
| | | @Override |
| | | public void updateVIPGoods(VIPGoodsInfo goods) { |
| | | if (goods == null) { |
| | | return; |
| | | } |
| | | List<GoodsEvaluate> queryExist = goodsEvaluateDao.queryExist(Constant.SOURCE_TYPE_VIP, |
| | | Long.parseLong(goods.getGoodsId())); |
| | | if (queryExist == null || queryExist.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55"); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate()); |
| | | GoodsDetailVO goodsNew = GoodsDetailVOFactory.convertVIPGoods(goods, paramsDTO); |
| | | updateGoods(queryExist, goodsNew); |
| | | } |
| | | |
| | | private void updateGoods(List<GoodsEvaluate> listExist, GoodsDetailVO goodsNew) { |
| | | long goodsId = goodsNew.getGoodsId(); |
| | | int goodsType = goodsNew.getGoodsType(); |
| | |
| | | goodsEvaluateDao.save(goodsEvaluate); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void offlineTaoBaoGoods(Long goodsId) { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除已过期时间 |
| | | */ |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.goods.ScanHistoryV2Mapper;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.dto.vip.goods.VIPGoodsInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.goods.ScanHistoryV2;
|
| | |
| | |
|
| | | @Resource
|
| | | private ScanHistoryV2Mapper scanHistoryV2Mapper;
|
| | |
|
| | | @Override
|
| | | public void addVIPScanHistory(Long uid, String device, VIPGoodsInfo goods)
|
| | | throws CommonGoodsException, ScanHistoryException {
|
| | |
|
| | | if (uid == null && StringUtil.isNullOrEmpty(device))
|
| | | throw new ScanHistoryException(1, "设备或用户信息缺失");
|
| | |
|
| | | CommonGoods commonGoods = CommonGoodsFactory.create(goods);
|
| | | commonGoods = commonGoodsService.addOrUpdateCommonGoods(commonGoods);
|
| | | if (commonGoods == null)
|
| | | throw new CommonGoodsException(2, "商品信息不完整");
|
| | |
|
| | | // 添加浏览记录
|
| | | ScanHistoryV2 scanHistoryV2 = new ScanHistoryV2();
|
| | | scanHistoryV2.setCommonGoods(commonGoods);
|
| | | scanHistoryV2.setCreateTime(new Date());
|
| | | scanHistoryV2.setDevice(device);
|
| | |
|
| | | if (uid != null)
|
| | | scanHistoryV2.setUserInfo(new UserInfo(uid));
|
| | |
|
| | | scanHistoryV2.setUpdateTime(new Date());
|
| | | scanHistoryV2Mapper.insertSelective(scanHistoryV2);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void addScanHistory(Long uid, String device, TaoBaoGoodsBrief goods)
|
| | |
| | | scanHistoryV2Mapper.insertSelective(scanHistoryV2);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public void addJDScanHistory(Long uid, String device, JDGoods goods) throws CommonGoodsException, ScanHistoryException {
|
| | | public void addJDScanHistory(Long uid, String device, JDGoods goods)
|
| | | throws CommonGoodsException, ScanHistoryException {
|
| | | if (uid == null && StringUtil.isNullOrEmpty(device))
|
| | | throw new ScanHistoryException(1, "设备或用户信息缺失");
|
| | |
|
| | |
| | | scanHistoryV2Mapper.insertSelective(scanHistoryV2);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public void addPDDScanHistory(Long uid, String device, PDDGoodsDetail pddGoods) throws CommonGoodsException, ScanHistoryException {
|
| | | public void addPDDScanHistory(Long uid, String device, PDDGoodsDetail pddGoods)
|
| | | throws CommonGoodsException, ScanHistoryException {
|
| | | if (uid == null && StringUtil.isNullOrEmpty(device))
|
| | | throw new ScanHistoryException(1, "设备或用户信息缺失");
|
| | |
|
| | |
| | | public void deleteByAuctionIdAndDeviceOrUid(Long uid, String device, Long auctionId) {
|
| | | if (uid == null && StringUtil.isNullOrEmpty(device))
|
| | | return;
|
| | | List<ScanHistoryV2> list = scanHistoryV2Mapper.selectByDeviceOrUidAndGoodsIdAndGoodsType(uid, device, auctionId);
|
| | | List<ScanHistoryV2> list = scanHistoryV2Mapper.selectByDeviceOrUidAndGoodsIdAndGoodsType(uid, device,
|
| | | auctionId);
|
| | | if (list != null)
|
| | | for (ScanHistoryV2 sv : list)
|
| | | scanHistoryV2Mapper.deleteByPrimaryKey(sv.getId());
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public void deleteByCommonIdAndDeviceOrUid(Long uid, String device, Long commonId) {
|
| | |
| | | import com.yeshi.fanli.dao.mybatis.goods.ShareGoodsTextTemplateMapper;
|
| | | import com.yeshi.fanli.dto.jd.JDPingouInfo;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.dto.vip.goods.VIPGoodsInfo;
|
| | | import com.yeshi.fanli.entity.goods.ShareGoodsTextTemplate;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | |
| | | ShareGoodsTextTemplate objct = shareGoodsTextTemplateMapper.selectByUid(uid);
|
| | | if (objct != null && !StringUtil.isNullOrEmpty(objct.getShareTextTemplate())) {
|
| | | template = objct.getShareTextTemplate();
|
| | | if (template.contains("{商品原价}")|| template.contains("{优惠券面额}") ||
|
| | | template.contains("{优惠券价}")|| template.contains("{月销量}")) {
|
| | | if (template.contains("{商品原价}") || template.contains("{优惠券面额}") || template.contains("{优惠券价}")
|
| | | || template.contains("{月销量}")) {
|
| | | template = ""; // 老板分享
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | @Override
|
| | | public String getTextTemplateByPDD(Long uid) {
|
| | | String template = "";
|
| | | ShareGoodsTextTemplate objct = shareGoodsTextTemplateMapper.selectByUid(uid);
|
| | | if (objct != null && !StringUtil.isNullOrEmpty(objct.getSharePDDTextTemplate())) {
|
| | | template = objct.getSharePDDTextTemplate();
|
| | | if (template.contains("{商品原价}") || template.contains("{总销量}") || template.contains("{短链接}")) {
|
| | | template = ""; // 老板分享
|
| | | }
|
| | | }
|
| | | if (StringUtil.isNullOrEmpty(template)) {
|
| | | template = configService.get(ConfigKeyEnum.shareCommentTextPDD.getKey());
|
| | | }
|
| | |
|
| | | return template;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public String getTextTemplateByVIP(Long uid) {
|
| | | String template = "";
|
| | | ShareGoodsTextTemplate objct = shareGoodsTextTemplateMapper.selectByUid(uid);
|
| | | if (objct != null && !StringUtil.isNullOrEmpty(objct.getSharePDDTextTemplate())) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | |
| | | @Override
|
| | | public void verifyRightTB(String template) throws ShareGoodsTextTemplateException {
|
| | | String[] keys = new String[] { "{原价}", "{券后价}","{淘口令}" };
|
| | |
| | | throw new ShareGoodsTextTemplateException(1, "模板格式有误");
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public void verifyRightPDD(String template) throws ShareGoodsTextTemplateException {
|
| | | String[] keys = new String[] { "{原价}", "{券后价}","{链接}" };
|
| | |
| | | throw new ShareGoodsTextTemplateException(1, "模板格式有误");
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public String createContentTB(String template, TaoBaoGoodsBrief goods, String token, boolean coupon) {
|
| | | String commentText = template.replace("{原价}", goods.getZkPrice().toString());
|
| | |
| | | commentText = commentText.replace("领券抢购", "抢购");
|
| | | commentText = commentText.replace("【券后价】{券后价}元", "");
|
| | | } else {
|
| | | commentText = commentText.replace("{券后价}",
|
| | | TaoBaoUtil.getAfterUseCouplePrice(goods) + "");
|
| | | commentText = commentText.replace("{券后价}", TaoBaoUtil.getAfterUseCouplePrice(goods) + "");
|
| | | }
|
| | | return deleteBlankLine(commentText);
|
| | | }
|
| | |
| | | return deleteBlankLine(commentText);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public String createContentVIP(String template, VIPGoodsInfo goods, String jumpLink) {
|
| | | String commentText = template.replace("{原价}", goods.getMarketPrice());
|
| | | commentText = commentText.replace("{链接}", jumpLink);
|
| | |
|
| | | commentText = commentText.replace("领券抢购", "抢购");
|
| | | commentText = commentText.replace("【券后价】{券后价}元", "");
|
| | |
|
| | | return deleteBlankLine(commentText);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void isCommonTemplateRight(String template) throws ShareGoodsTextTemplateException {
|
| | |
| | | return st.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n");
|
| | | }
|
| | |
|
| | | |
| | | |
| | | @Override
|
| | | public String createContentByTemplate(String template, Long uid, TaoBaoGoodsBrief goods, String token,
|
| | | String shortLink, boolean hasCoupon, Long tljId) {
|
| | |
| | | .replace("{淘礼金面额}", BigDecimalUtil.getWithNoZera(spreadMoney).toString())
|
| | | .replace("{优惠券价}",
|
| | | BigDecimalUtil.getWithNoZera(TaoBaoUtil.getAfterUseCouplePrice(goods)).toString())
|
| | | .replace("{店铺类型}", goods.getUserType() == 1 ? TaoBaoConstant.SHARE_PRICE_TM : TaoBaoConstant.SHARE_PRICE_TAOBAO);
|
| | | .replace("{店铺类型}", goods.getUserType() == 1 ? TaoBaoConstant.SHARE_PRICE_TM
|
| | | : TaoBaoConstant.SHARE_PRICE_TAOBAO);
|
| | | }
|
| | |
|
| | | if (!hasCoupon) {
|
| | |
| | | .replace("{优惠券面额}", BigDecimalUtil.getWithNoZera(goods.getCouponAmount()).toString())
|
| | | .replace("{优惠券价}",
|
| | | BigDecimalUtil.getWithNoZera(TaoBaoUtil.getAfterUseCouplePrice(goods)).toString())
|
| | | .replace("{店铺类型}", goods.getUserType() == 1 ? TaoBaoConstant.SHARE_PRICE_TM : TaoBaoConstant.SHARE_PRICE_TAOBAO);
|
| | | .replace("{店铺类型}", goods.getUserType() == 1 ? TaoBaoConstant.SHARE_PRICE_TM
|
| | | : TaoBaoConstant.SHARE_PRICE_TAOBAO);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | template = template.replace("{标题}", goods.getSkuName())
|
| | | .replace("{商品原价}", BigDecimalUtil.getWithNoZera(price).toString())
|
| | | .replace("{月销量}", JDUtil.getSaleCount(goods.getInOrderCount30Days())).replace("{短链接}", shortLink)
|
| | | .replace("{优惠券面额}", BigDecimalUtil.getWithNoZera(JDUtil.getShowCouponInfo( goods).getDiscount()).toString())
|
| | | .replace("{优惠券面额}",
|
| | | BigDecimalUtil.getWithNoZera(JDUtil.getShowCouponInfo(goods).getDiscount()).toString())
|
| | | .replace("{优惠券价}", BigDecimalUtil.getWithNoZera(JDUtil.getQuanPrice(goods)).toString());
|
| | | }
|
| | |
|
| | |
| | | import com.yeshi.fanli.dto.mq.order.body.OrderConfirmMQMsg; |
| | | import com.yeshi.fanli.dto.order.CommonOrderAddResultDTO; |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail; |
| | | import com.yeshi.fanli.dto.vip.goods.VIPGoodsInfo; |
| | | import com.yeshi.fanli.entity.accept.AcceptData; |
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2; |
| | | import com.yeshi.fanli.entity.bus.user.UserInfo; |
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrderGoods; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder; |
| | | import com.yeshi.fanli.entity.vipshop.VipShopOrder; |
| | | import com.yeshi.fanli.entity.vipshop.VipShopOrderDetail; |
| | | import com.yeshi.fanli.exception.order.CommonOrderException; |
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException; |
| | | import com.yeshi.fanli.log.LogHelper; |
| | |
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil; |
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil; |
| | | import com.yeshi.fanli.util.user.UserLevelUtil; |
| | | import com.yeshi.fanli.util.vipshop.VipShopApiUtil; |
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO; |
| | | import com.yeshi.fanli.vo.order.CommonOrderGoodsVO; |
| | | import com.yeshi.fanli.vo.order.CommonOrderVO; |
| | |
| | | } |
| | | |
| | | // 邀请 隐藏订单号 |
| | | if (HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType || HongBaoV2.TYPE_ERJI == hongBaoType |
| | | || HongBaoV2.TYPE_SHARE_YIJI == hongBaoType || HongBaoV2.TYPE_SHARE_ERJI == hongBaoType) { |
| | | if (HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType |
| | | || HongBaoV2.TYPE_ERJI == hongBaoType || HongBaoV2.TYPE_SHARE_YIJI == hongBaoType |
| | | || HongBaoV2.TYPE_SHARE_ERJI == hongBaoType) { |
| | | order.setOrderNo(UserUtil.filterOrderId(order.getOrderNo())); |
| | | } |
| | | } |
| | |
| | | goods.setSkuName(itemOrder.getSkuName()); |
| | | goods.setPrice(itemOrder.getPrice()); |
| | | goods.setSkuId(itemOrder.getSkuId()); |
| | | } |
| | | |
| | | if (goods != null) { |
| | | cog = CommonOrderGoodsFactory.create(goods); |
| | | } |
| | | |
| | | cog.setCreateTime(new Date()); |
| | | cog.setUpdateTime(new Date()); |
| | | commonOrderGoodsMapper.insertSelective(cog); |
| | | } else { |
| | | |
| | | } |
| | | newCommonOrder.setUserInfo(new UserInfo(uid)); |
| | | commonOrderList.add(addCommonOrder(newCommonOrder)); |
| | | } |
| | | addConfirmMQMsg(commonOrderList); |
| | | return commonOrderList; |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public List<CommonOrderAddResultDTO> addVipShopOrder(VipShopOrder vipShopOrder, Long uid) |
| | | throws CommonOrderException { |
| | | List<CommonOrderAddResultDTO> commonOrderList = new ArrayList<>(); |
| | | // 判断所有的订单状态 |
| | | int invalidCount = 0; |
| | | for (VipShopOrderDetail detail : vipShopOrder.getDetailList()) { |
| | | if (detail.getStatus() == VipShopOrderDetail.STATUS_INVALID) { |
| | | invalidCount++; |
| | | } |
| | | } |
| | | |
| | | // 获取整体订单的状态 |
| | | int wholeOrderState = 0; |
| | | if (vipShopOrder.getDetailList().size() == invalidCount) |
| | | wholeOrderState = CommonOrder.STATE_WHOLE_ORDER_SHIXIAO; |
| | | else if (invalidCount == 0) |
| | | wholeOrderState = CommonOrder.STATE_WHOLE_ORDER_YOUXIAO; |
| | | else |
| | | wholeOrderState = CommonOrder.STATE_WHOLE_ORDER_BUFENYOUXIAO; |
| | | |
| | | List<VipShopOrderDetail> orderItemList = vipShopOrder.getDetailList(); |
| | | vipShopOrder.setDetailList(null); |
| | | |
| | | for (VipShopOrderDetail itemOrder : orderItemList) { |
| | | itemOrder.setOrder(vipShopOrder); |
| | | CommonOrder newCommonOrder = CommonOrderFactory.create(itemOrder); |
| | | CommonOrderGoods cog = new CommonOrderGoods(); |
| | | cog.setGoodsId(itemOrder.getGoodsId()); |
| | | cog.setGoodsType(Constant.SOURCE_TYPE_VIP); |
| | | newCommonOrder.setCommonOrderGoods(cog); |
| | | newCommonOrder.setStateWholeOrder(wholeOrderState); |
| | | // 订单商品插入 |
| | | List<CommonOrderGoods> commonGoodsList = commonOrderGoodsMapper.listByGoodsIdAndGoodsType(cog.getGoodsId(), |
| | | cog.getGoodsType()); |
| | | if (commonGoodsList.size() <= 0)// 不存在就插入商品 |
| | | { |
| | | VIPGoodsInfo goods = VipShopApiUtil.getGoodsDetail(itemOrder.getGoodsId()); |
| | | if (goods == null) { |
| | | goods = new VIPGoodsInfo(); |
| | | goods.setGoodsName(itemOrder.getGoodsName()); |
| | | goods.setVipPrice(""); |
| | | goods.setGoodsId(itemOrder.getGoodsId()); |
| | | goods.setGoodsThumbUrl(itemOrder.getGoodsThumb()); |
| | | } |
| | | |
| | | if (goods != null) { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public long countOrderByUidAndSettled(Long uid, BigDecimal payment) { |
| | | Long count = commonOrderMapper.countOrderByUidAndSettled(uid, payment); |
| | |
| | | return count; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public String getNewestOrderNoByTaoBao() { |
| | | return commonOrderMapper.getNewestOrderNoByTaoBao(); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<CommonOrder> listByOrderNo(String orderNo) { |
| | |
| | | List<TaoBaoOrder> list = orders.get(orderId);
|
| | | String pid = String.format("mm_%s_%s_%s", configList.get(0).getAccountId(),
|
| | | list.get(0).getSourceMediaId(), list.get(0).getAdPositionId());
|
| | | if ("饿了么".equalsIgnoreCase(list.get(0).getOrderType())&&!pid.equalsIgnoreCase(TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT)) {
|
| | | if ("饿了么".equalsIgnoreCase(list.get(0).getOrderType())
|
| | | && !pid.equalsIgnoreCase(TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT)) {
|
| | | // 饿了么订单开始归入到淘宝订单
|
| | | if (TimeUtil.convertToTimeTemp(list.get(0).getCreateTime(),
|
| | | "yyyy-MM-dd HH:mm:ss") >= Constant.NEW_ORDER_FANLI_RULE_TIME) {
|
| | |
| | | } else {
|
| | | elmeOrderMap.put(orderId, list);
|
| | | }
|
| | | } else if ("口碑".equalsIgnoreCase(list.get(0).getOrderType())
|
| | | && pid.equalsIgnoreCase(TaoBaoConstant.TAOBAO_KOUBEI_PID)) {// 口碑自购
|
| | | fanliOrderMap.put(orderId, list);
|
| | | } else {
|
| | | if (!StringUtil.isNullOrEmpty(list.get(0).getSpecialId())
|
| | | || pid.equalsIgnoreCase(TaoBaoConstant.TAOBAO_RELATION_AS_SPECIAL_PID)) {// 设置渠道ID当做会员运营ID的位置ID
|
| | |
| | | && !StringUtil.isNullOrEmpty(orderList.get(0).getRelationId())) {// 处理非返利商品库的商品
|
| | | targetUid = taoBaoBuyRelationMapService.selectUidByRelationId(orderList.get(0).getRelationId());
|
| | |
|
| | | } else if (pid.equalsIgnoreCase(TaoBaoConstant.TAOBAO_ELEME_PID)
|
| | | && !StringUtil.isNullOrEmpty(orderList.get(0).getRelationId())) {// 处理饿了么的订单
|
| | | } else if ((pid.equalsIgnoreCase(TaoBaoConstant.TAOBAO_ELEME_PID)
|
| | | || pid.equalsIgnoreCase(TaoBaoConstant.TAOBAO_KOUBEI_PID))
|
| | | && !StringUtil.isNullOrEmpty(orderList.get(0).getRelationId())) {// 处理饿了么,口碑的订单
|
| | | UserExtraTaoBaoInfo extraInfo = userExtraTaoBaoInfoService
|
| | | .getByRelationId(orderList.get(0).getRelationId());
|
| | | if (extraInfo != null) {
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.taobao.haodanku;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.goods.taobao.haodanku.HDKGoodsDetailDao;
|
| | | import com.yeshi.fanli.entity.taobao.haodanku.HDKGoodsDetail;
|
| | | import com.yeshi.fanli.service.inter.taobao.haodanku.HDKGoodsDetailService;
|
| | |
|
| | | @Service
|
| | | public class HDKGoodsDetailServiceImpl implements HDKGoodsDetailService {
|
| | | @Resource
|
| | | private HDKGoodsDetailDao hdkGoodsDetailDao;
|
| | |
|
| | | @Override
|
| | | public void addGoods(HDKGoodsDetail goods) {
|
| | | if (goods.getCreateTime() != null)
|
| | | goods.setCreateTime(new Date());
|
| | | hdkGoodsDetailDao.save(goods);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void updateGoods(HDKGoodsDetail goods) {
|
| | | goods.setUpdateTime(new Date());
|
| | | hdkGoodsDetailDao.updateSelective(goods);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void deleteByItemIds(List<Long> itemIds) {
|
| | | hdkGoodsDetailDao.deleteByItemIds(itemIds);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import org.springframework.web.multipart.MultipartHttpServletRequest; |
| | | |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail; |
| | | import com.yeshi.fanli.dto.vip.goods.VIPGoodsInfo; |
| | | import com.yeshi.fanli.entity.bus.activity.ActivityUser; |
| | | import com.yeshi.fanli.entity.dynamic.CommentInfo; |
| | | import com.yeshi.fanli.entity.dynamic.GoodsEvaluate; |
| | |
| | | public void updatePDDGoods(PDDGoodsDetail pddGoods); |
| | | |
| | | |
| | | public void updateVIPGoods(VIPGoodsInfo goods); |
| | | |
| | | |
| | | public void addRanDomShareCount(); |
| | | |
| | | /** |
| | |
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.dto.vip.goods.VIPGoodsInfo;
|
| | | import com.yeshi.fanli.entity.goods.ScanHistoryV2;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | |
| | | public void addPDDScanHistory(Long uid, String device, PDDGoodsDetail pddGoods)
|
| | | throws CommonGoodsException, ScanHistoryException;
|
| | |
|
| | | |
| | | /**
|
| | | * 唯品会浏览记录
|
| | | * @Title: addVIPScanHistory
|
| | | * @Description: |
| | | * @param uid
|
| | | * @param device
|
| | | * @param pddGoods
|
| | | * @throws CommonGoodsException
|
| | | * @throws ScanHistoryException |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | public void addVIPScanHistory(Long uid, String device, VIPGoodsInfo pddGoods)
|
| | | throws CommonGoodsException, ScanHistoryException;
|
| | |
|
| | | /**
|
| | | * 根据简版商品ID删除
|
| | | * @param uid
|
| | |
| | | package com.yeshi.fanli.service.inter.goods;
|
| | |
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.dto.vip.goods.VIPGoodsInfo;
|
| | | import com.yeshi.fanli.entity.goods.ShareGoodsTextTemplate;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | |
| | |
|
| | | public String createContentPDD(String template, PDDGoodsDetail goods, String jumpLink, boolean coupon);
|
| | |
|
| | | public String createContentVIP(String template, VIPGoodsInfo goods, String jumpLink);
|
| | |
|
| | | public String getTextTemplateByJD(Long uid);
|
| | |
|
| | | public String getTextTemplateByTB(Long uid);
|
| | |
|
| | | public String getTextTemplateByPDD(Long uid);
|
| | |
|
| | | public String getTextTemplateByVIP(Long uid);
|
| | |
|
| | | public void saveTemplateTB(Long uid, String template) throws ShareGoodsTextTemplateException;
|
| | |
|
| | | public void saveTemplateJD(Long uid, String template) throws ShareGoodsTextTemplateException;
|
| | |
| | | import com.yeshi.fanli.entity.pdd.PDDOrder; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder; |
| | | import com.yeshi.fanli.entity.vipshop.VipShopOrder; |
| | | import com.yeshi.fanli.exception.order.CommonOrderException; |
| | | import com.yeshi.fanli.vo.order.CommonOrderVO; |
| | | import com.yeshi.fanli.vo.order.OrderCountVO; |
| | |
| | | */ |
| | | public List<CommonOrderAddResultDTO> addJDOrder(JDOrder jdOrder, Long uid) throws CommonOrderException; |
| | | |
| | | |
| | | /** |
| | | * 添加唯品会订单 |
| | | * @Title: addVipShopOrder |
| | | * @Description: |
| | | * @param order |
| | | * @param uid |
| | | * @return |
| | | * @throws CommonOrderException |
| | | * List<CommonOrderAddResultDTO> 返回类型 |
| | | * @throws |
| | | */ |
| | | public List<CommonOrderAddResultDTO> addVipShopOrder(VipShopOrder order, Long uid) throws CommonOrderException; |
| | | |
| | | /** |
| | | * 根据用户ID,订单状态,结算时间统计订单数量 |
| | | * |
New file |
| | |
| | | package com.yeshi.fanli.service.inter.order.vipshop;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.jd.JDOrder;
|
| | | import com.yeshi.fanli.entity.vipshop.VipShopOrderDetail;
|
| | | import com.yeshi.fanli.exception.jd.JDOrderException;
|
| | | import com.yeshi.fanli.exception.vipshop.VipShopOrderException;
|
| | |
|
| | | public interface VipShopOrderService {
|
| | |
|
| | | /**
|
| | | * 添加订单
|
| | | * |
| | | * @param order
|
| | | * @throws JDOrderException
|
| | | */
|
| | | public void addVipShopOrder(JDOrder order) throws VipShopOrderException;
|
| | |
|
| | | /**
|
| | | * 根据主键ID查询
|
| | | * |
| | | * @param orderId
|
| | | * @return
|
| | | */
|
| | | public JDOrder selectByPrimaryKey(Long orderId);
|
| | |
|
| | | /**
|
| | | * 根据主键查询(包含子订单)
|
| | | * @param orderId
|
| | | * @return
|
| | | */
|
| | | public JDOrder selectDetailByPrimaryKey(Long orderId);
|
| | |
|
| | | public Long countOrderByDay(String preDay);
|
| | |
|
| | | /**
|
| | | * 查询订单
|
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | | * @return
|
| | | */
|
| | | public List<VipShopOrderDetail> listDetailQuery(long start, int count, String key);
|
| | |
|
| | | public long countDetailQuery(String key);
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.taobao.haodanku;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.taobao.haodanku.HDKGoodsDetail;
|
| | |
|
| | | /**
|
| | | * 好单库商品服务
|
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public interface HDKGoodsDetailService {
|
| | |
|
| | | /**
|
| | | * 新增
|
| | | * @Title: addGoods
|
| | | * @Description: |
| | | * @param goods |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | public void addGoods(HDKGoodsDetail goods);
|
| | |
|
| | | /**
|
| | | * 更新
|
| | | * @Title: updateGoods
|
| | | * @Description: |
| | | * @param goods |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | public void updateGoods(HDKGoodsDetail goods);
|
| | |
|
| | | /**
|
| | | * 按商品ID批量删除
|
| | | * @Title: deleteByItemIds
|
| | | * @Description: |
| | | * @param itemIds |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | public void deleteByItemIds(List<Long> itemIds);
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.vipshop;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.jd.JDGoodsClass;
|
| | |
|
| | | public interface JDGoodsClassService {
|
| | |
|
| | | public void insertSelective(JDGoodsClass record);
|
| | | |
| | | public void updateByPrimaryKeySelective(JDGoodsClass record);
|
| | | |
| | | |
| | | /**
|
| | | * 查询各级分类
|
| | | * @param pid
|
| | | * @return
|
| | | */
|
| | | List<JDGoodsClass> getByLevel(Integer level);
|
| | | |
| | | |
| | | /**
|
| | | * 查询下级分类
|
| | | * @param pid
|
| | | * @return
|
| | | */
|
| | | List<JDGoodsClass> getByPid(Integer pid);
|
| | |
|
| | | /**
|
| | | * 更新分类
|
| | | */
|
| | | void insertClass();
|
| | |
|
| | | |
| | | /**
|
| | | * 查询三级分类信息
|
| | | * @param cid
|
| | | * @return
|
| | | */
|
| | | JDGoodsClass getThreeClassByCid(Integer cid);
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.vipshop;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.dto.jd.JDSearchResult;
|
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.exception.jd.JDGoodsException;
|
| | |
|
| | | public interface JDGoodsService {
|
| | |
|
| | | /**
|
| | | * 专题分类
|
| | | * @return
|
| | | */
|
| | | public List<GoodsClass> getSpecialClass();
|
| | |
|
| | | |
| | | /**
|
| | | * 专题商品搜索
|
| | | * @param page
|
| | | * @param cid
|
| | | * @return
|
| | | * @throws JDGoodsException
|
| | | */
|
| | | public List<JDGoods> specialSearch(Integer page, Long cid) throws JDGoodsException;
|
| | |
|
| | |
|
| | | /**
|
| | | * 首页底部商品搜索
|
| | | * @param page
|
| | | * @return
|
| | | */
|
| | | public JDSearchResult getIndexJDGoods(int page);
|
| | |
|
| | | |
| | | }
|
| | |
| | | link = urlList.get(0);
|
| | | else// 第一个口令在第一个链接前面
|
| | | token = tokenList.get(0);
|
| | |
|
| | | } else if (typeSet.contains(ClipboardContentType.link) && typeSet.contains(ClipboardContentType.text)) {// 链接+文本
|
| | | link = urlList.get(0);
|
| | |
|
| | |
| | | if (!StringUtil.isNullOrEmpty(link)) {
|
| | | CommonGoods goods = parseLink(urlList.get(0));
|
| | | if (goods == null || goods.getGoodsId() == null) {
|
| | | if (urlList.size() > 1)
|
| | | if (tokenList.size() == 0 && urlList.size() == 2
|
| | | && urlList.get(0).indexOf("://uland.taobao.com") > -1
|
| | | && urlList.get(1).indexOf("?id=") > -1) {// 有2个链接的文案,第一个是店铺券链接,其中二个是淘宝商品详情
|
| | | CommonGoods goods1 = parseLink(urlList.get(1));
|
| | | if (goods1 != null && goods1.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) {
|
| | | resultListener.onResult(goods1);
|
| | | } else {
|
| | | resultListener.onResult(new GoodsDocParseResultVO(text, urlList.get(0)));
|
| | | }
|
| | |
|
| | | } else if (urlList.size() > 1)
|
| | | resultListener.onResult(new GoodsDocParseResultVO(text, urlList.get(0)));
|
| | | else {// 单链接
|
| | | // 判断是否包含可转链的链接
|
| | |
| | | // 来源-拼多多
|
| | | public static final int SOURCE_TYPE_PDD = 3;
|
| | | // 来源-唯品会
|
| | | public static final int SOURCE_TYPE_WPH = 4;
|
| | | public static final int SOURCE_TYPE_VIP = 4;
|
| | | // 来源-苏宁
|
| | | public static final int SOURCE_TYPE_SUNING = 5;
|
| | | // 来源-饿了么
|
| | |
| | | return "京东";
|
| | | case SOURCE_TYPE_PDD:
|
| | | return "拼多多";
|
| | | case SOURCE_TYPE_WPH:
|
| | | case SOURCE_TYPE_VIP:
|
| | | return "唯品会";
|
| | | case SOURCE_TYPE_SUNING:
|
| | | return "苏宁";
|
| | |
| | | seacrhGoods("integral-seacrh-goods-", "商品搜索"),
|
| | | couponByClass("getCouponListByClass-", "通过分类获取券信息"),
|
| | | elmeLink("elme-link-", "饿了么链接"),
|
| | | kouBeiLink("koubei-link-", "口碑链接"),
|
| | | recommendGoodsUser("recommend-goods-user-", "用户推荐商品"),
|
| | |
|
| | | S11YuShou("s11-yushou-", "双11预售"),
|
| | |
| | | //饿了么PID
|
| | | public static final String TAOBAO_ELEME_PID = "mm_124933865_56750082_109491050276";
|
| | |
|
| | | //口碑PID
|
| | | public static final String TAOBAO_KOUBEI_PID = "mm_124933865_56750082_19511700026";
|
| | | |
| | | |
| | | // 淘礼金会员
|
| | | public static final String TAOBAO_TLJ_SPECIAL_PID_DEFAULT = "mm_124933865_56750082_19509300170";
|
| | | public static BigDecimal OWN_BUY_WITHOUT_FANLI_RATE = new BigDecimal(70);// 自购立减的比例
|
| | |
| | | import com.yeshi.fanli.dto.jd.JDCouponInfo;
|
| | | import com.yeshi.fanli.dto.jd.JDShopInfo;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.dto.vip.goods.VIPGoodsInfo;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | |
| | | cg.setState(goods.getState());
|
| | | cg.setMaterialLibType(goods.getMaterialLibType());
|
| | |
|
| | | |
| | | // 分类信息
|
| | | CategoryInfoDTO categoryInfo = new CategoryInfoDTO();
|
| | | Integer rootCatId = goods.getRootCatId();
|
| | |
| | |
|
| | | return cg;
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 淘宝商品构造
|
| | |
| | | other.setIsFreeShipping(goods.getIsFreeShipping()); // 是否包邮
|
| | | cg.setOtherInfo(JSONObject.toJSON(other).toString());
|
| | |
|
| | | |
| | | // 分类信息
|
| | | JDCategoryInfo categoryJD = goods.getCategoryInfo();
|
| | | if (categoryJD != null) {
|
| | |
| | | cg.setVideoUrl(null);
|
| | | return cg;
|
| | | }
|
| | |
|
| | |
|
| | | public static CommonGoods create(PDDGoodsDetail goods) {
|
| | | if (goods == null)
|
| | |
| | | categoryInfo.setCid1Name(goods.getCategoryName());
|
| | | cg.setCategoryInfo(JSONObject.toJSON(categoryInfo).toString());
|
| | |
|
| | | return cg;
|
| | | }
|
| | |
|
| | | public static CommonGoods create(VIPGoodsInfo goods) {
|
| | | if (goods == null)
|
| | | return null;
|
| | |
|
| | | CommonGoods cg = new CommonGoods();
|
| | |
|
| | | // 折扣信息
|
| | | cg.setCouponInfo(new BigDecimal(goods.getDiscount()) + "");
|
| | | cg.setCouponLeftCount(0);
|
| | | cg.setCouponStartPrice(new BigDecimal(0));
|
| | | cg.setCouponAmount(new BigDecimal(0));
|
| | |
|
| | | cg.setCouponTotalCount(0);
|
| | | cg.setGoodsId(Long.parseLong(goods.getGoodsId()));
|
| | | cg.setGoodsType(CommonGoods.GOODS_TYPE_PDD);
|
| | | cg.setPicture(goods.getGoodsThumbUrl());
|
| | | cg.setPictureWhite(null);
|
| | | cg.setPrice(new BigDecimal(goods.getMarketPrice()));
|
| | |
|
| | | int totalSales = 0;
|
| | | cg.setSales(totalSales);
|
| | | cg.setRate(new BigDecimal(goods.getCommissionRate()));
|
| | | cg.setSellerId(goods.getBrandId());
|
| | | cg.setSellerName(goods.getBrandName());
|
| | | cg.setShopType(CommonGoods.SHOP_TYPE_PDD);
|
| | | cg.setState(CommonGoods.STATE_NORMAL);
|
| | | cg.setTitle(goods.getGoodsName());
|
| | | // 保留字段
|
| | | cg.setVideoCover(null);
|
| | | cg.setVideoUrl(null);
|
| | | cg.setState(goods.getStatus() == 1 ? CommonGoods.STATE_NORMAL : CommonGoods.STATE_OFFLINE);
|
| | | cg.setMaterialLibType(1);
|
| | |
|
| | | // 分类信息
|
| | | CategoryInfoDTO categoryInfo = new CategoryInfoDTO();
|
| | | categoryInfo.setCid1(goods.getCategoryId());
|
| | | categoryInfo.setCid1Name(goods.getCategoryName());
|
| | | cg.setCategoryInfo(JSONObject.toJSON(categoryInfo).toString());
|
| | |
|
| | | return cg;
|
| | | }
|
| | |
| | | import java.util.Date;
|
| | |
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.dto.vip.goods.VIPGoodsInfo;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.order.CommonOrderGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | |
| | | return goods;
|
| | | }
|
| | |
|
| | | public static CommonOrderGoods create(VIPGoodsInfo vipGoods) {
|
| | | CommonOrderGoods goods = new CommonOrderGoods();
|
| | | goods.setGoodsId(vipGoods.getGoodsId() + "");
|
| | | goods.setCreateTime(new Date());
|
| | | goods.setGoodsType(Constant.SOURCE_TYPE_VIP);
|
| | | goods.setPicture(vipGoods.getGoodsMainPicture());
|
| | | goods.setPrice(new BigDecimal(vipGoods.getVipPrice()));
|
| | | if (vipGoods.getBrandId() != null) {
|
| | | goods.setShopId(vipGoods.getBrandId());
|
| | | goods.setShopName(vipGoods.getBrandName());
|
| | | }
|
| | | goods.setShopType("唯品会");
|
| | | goods.setState(0);
|
| | | goods.setTitle(vipGoods.getGoodsName());
|
| | | return goods;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.entity.pdd.PDDOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | | import com.yeshi.fanli.entity.vipshop.VipShopOrderDetail;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | |
|
| | | return commonOrder;
|
| | | }
|
| | |
|
| | | public static CommonOrder create(VipShopOrderDetail order) {
|
| | | if (order.getOrder() == null)
|
| | | return null;
|
| | | CommonOrder commonOrder = new CommonOrder();
|
| | | commonOrder.setCount(order.getGoodsCount());
|
| | | commonOrder.setCreateTime(new Date());
|
| | | if (order.getStatus() == VipShopOrderDetail.STATUS_FINISH) {
|
| | | commonOrder.seteIncome(order.getCommission());
|
| | | commonOrder.setSettlement(order.getCommissionTotalCost());
|
| | | commonOrder.setSettleTime(new Date(order.getOrder().getCommissionEnterTime()));
|
| | | }
|
| | | commonOrder.setOrderNo(order.getOrderSn() + "");
|
| | | commonOrder.setPayment(order.getCommissionTotalCost());
|
| | | commonOrder.setSourcePosition(order.getOrder().getChannelTag());
|
| | | commonOrder.setSourceType(Constant.SOURCE_TYPE_VIP);
|
| | | int state = 0;
|
| | | if (order.getStatus() == VipShopOrderDetail.STATUS_FINISH)
|
| | | state = CommonOrder.STATE_JS;
|
| | | else if (order.getStatus() == VipShopOrderDetail.STATUS_INVALID)
|
| | | state = CommonOrder.STATE_SX;
|
| | | else if (order.getStatus() == VipShopOrderDetail.STATUS_UNKOWN)
|
| | | state = CommonOrder.STATE_FK;
|
| | |
|
| | | commonOrder.setOrderBy(1);
|
| | | commonOrder.setState(state);
|
| | | commonOrder.setThirdCreateTime(new Date(order.getOrder().getOrderTime()));
|
| | | commonOrder.setUpdateTime(new Date());
|
| | | commonOrder.setTradeId(order.getIdentifyCode());
|
| | | commonOrder.setEstimate(order.getCommission());
|
| | | commonOrder.setChildSourceType("唯品会");
|
| | | return commonOrder;
|
| | | }
|
| | | }
|
| | |
| | | import com.yeshi.fanli.dto.jd.JDPingouInfo;
|
| | | import com.yeshi.fanli.dto.jd.JDShopInfo;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.dto.vip.goods.VIPGoodsInfo;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | |
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoCouponUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.vipshop.VipShopUtil;
|
| | | import com.yeshi.fanli.vo.goods.CouponInfoVO;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | | import com.yeshi.fanli.vo.goods.MoneyInfoVO;
|
| | |
| | | return goodsInfo;
|
| | | }
|
| | |
|
| | | public static GoodsDetailVO convertVIPGoods(VIPGoodsInfo goods, ConfigParamsDTO params) {
|
| | | GoodsDetailVO goodsInfo = new GoodsDetailVO();
|
| | | goodsInfo.setBaoyou(true);
|
| | | goodsInfo.setGoodsType(Constant.SOURCE_TYPE_VIP);
|
| | | goodsInfo.setGoodsId(Long.parseLong(goods.getGoodsId()));
|
| | | goodsInfo.setTitle(goods.getGoodsName());
|
| | | goodsInfo.setSalesType(5); // 无销量
|
| | | goodsInfo.setPriceName("拼团价");
|
| | | goodsInfo.setPicUrl(goods.getGoodsThumbUrl()); // 缩略图
|
| | | goodsInfo.setZkPrice(MoneyBigDecimalUtil.getWithNoZera(new BigDecimal(goods.getVipPrice())));
|
| | | goodsInfo.setShopType(CommonGoods.SHOP_TYPE_VIP);
|
| | |
|
| | | goodsInfo.setImgList(goods.getGoodsDetailPictures());
|
| | |
|
| | | Integer state = goods.getStatus();
|
| | | if (state == null) {
|
| | | goodsInfo.setState(0);
|
| | | } else {
|
| | | goodsInfo.setState(goods.getStatus() == 1 ? CommonGoods.STATE_OFFLINE : CommonGoods.STATE_NORMAL);
|
| | | }
|
| | |
|
| | | goodsInfo.setSalesCount("");
|
| | |
|
| | | // 资金信息
|
| | | MoneyInfoVO moneyInfoVO = new MoneyInfoVO();
|
| | | moneyInfoVO.setMoneyType(1); // 默认显示:返 ¥6.6
|
| | | BigDecimal commission = VipShopUtil.getGoodsFanLiMoney(goods, params.getFanLiRate());
|
| | | moneyInfoVO.setFanliMoney("¥" + commission);
|
| | | moneyInfoVO.setShareMoney("¥" + commission);
|
| | |
|
| | | BigDecimal baseCommisstion = null;
|
| | | if (params.getBaseFanliRate() != null)
|
| | | baseCommisstion = VipShopUtil.getGoodsFanLiMoney(goods, params.getBaseFanliRate());
|
| | |
|
| | | if (params.getMaxRewardRate() != null)
|
| | | moneyInfoVO
|
| | | .setMaxMoney("¥" + commission.add(MoneyBigDecimalUtil.mul(commission, params.getMaxRewardRate())));
|
| | | else {
|
| | | BigDecimal price = new BigDecimal(goods.getVipPrice());
|
| | | BigDecimal rate = MoneyBigDecimalUtil.div(commission.multiply(new BigDecimal(100)), price);
|
| | | moneyInfoVO.setRateInfo("返利比 " + rate + "%");
|
| | |
|
| | | BigDecimal maxCommission = VipShopUtil.getGoodsFanLiMoney(goods, params.getVipFanLiRate());
|
| | | BigDecimal maxRate = MoneyBigDecimalUtil.div(maxCommission.multiply(new BigDecimal(100)), price);
|
| | | moneyInfoVO.setMaxRateInfo("返利比 " + maxRate + "%");
|
| | |
|
| | | moneyInfoVO.setMaxMoney("¥" + maxCommission);
|
| | |
|
| | | if (baseCommisstion != null) {
|
| | | String desc = String.format("佣金¥ %s+平台补贴¥ %s", baseCommisstion.setScale(2).toString(),
|
| | | commission.subtract(baseCommisstion).setScale(2).toString());
|
| | | String maxDesc = String.format("佣金¥ %s+平台补贴¥ %s", baseCommisstion.setScale(2).toString(),
|
| | | maxCommission.subtract(baseCommisstion).setScale(2).toString());
|
| | | moneyInfoVO.setCompositionInfo(desc);
|
| | | moneyInfoVO.setMaxCompositionInfo(maxDesc);
|
| | | }
|
| | | }
|
| | | goodsInfo.setMoneyInfo(moneyInfoVO);
|
| | |
|
| | | // 店铺信息
|
| | | String mallName = goods.getBrandName();
|
| | | if (!StringUtil.isMobile(mallName)) {
|
| | | ShopInfoVO shop = new ShopInfoVO();
|
| | | shop.setShopName(mallName);
|
| | | if (goods.getBrandId() != null) {
|
| | | shop.setId(goods.getBrandId().toString());
|
| | | }
|
| | | shop.setUserType(30);
|
| | | goodsInfo.setShopInfo(shop);
|
| | | }
|
| | |
|
| | | return goodsInfo;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.util.taobao;
|
| | |
|
| | | import java.lang.reflect.Type;
|
| | | import java.util.ArrayList;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import org.yeshi.utils.HttpUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.dto.taobao.haodanku.HDKGoodsListResultDTO;
|
| | | import com.yeshi.fanli.entity.taobao.haodanku.HDKGoodsDetail;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | /**
|
| | | * 好单库API
|
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class HaoDanKuApiUtil {
|
| | |
|
| | | private final static String API_KEY = "blks";
|
| | |
|
| | | private static HaoDanKuApiUtil instance;
|
| | |
|
| | | public static HaoDanKuApiUtil getInstance() {
|
| | | if (instance == null)
|
| | | instance = new HaoDanKuApiUtil();
|
| | | return instance;
|
| | | }
|
| | |
|
| | | private String baseGetRequest(String path, List<ParamsKeyValue> params) {
|
| | | params.add(0, new HaoDanKuApiUtil.ParamsKeyValue("apikey", API_KEY));
|
| | | String url = "http://v2.api.haodanku.com/" + path;
|
| | | for (ParamsKeyValue keyValue : params) {
|
| | | url += ("/" + keyValue.key + "/" + keyValue.value);
|
| | | }
|
| | | return HttpUtil.get(url);
|
| | | }
|
| | |
|
| | | private String basePostRequest(String url, List<ParamsKeyValue> params) {
|
| | | params.add(0, new HaoDanKuApiUtil.ParamsKeyValue("apikey", API_KEY));
|
| | | Map<String, String> parmasMap = new HashMap<>();
|
| | | for (ParamsKeyValue keyValue : params) {
|
| | | parmasMap.put(keyValue.key, keyValue.value);
|
| | | }
|
| | | return HttpUtil.post(url, parmasMap, null);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取朋友圈API的内容
|
| | | * @Title: getSendWXCircleContent
|
| | | * @Description: |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | public void getSendWXCircleContent(Integer minId) {
|
| | | if (minId == null)
|
| | | minId = 1;
|
| | | List<ParamsKeyValue> params = new ArrayList<HaoDanKuApiUtil.ParamsKeyValue>();
|
| | | params.add(new ParamsKeyValue("min_id", minId + ""));
|
| | | String result = baseGetRequest("selected_item", params);
|
| | | System.out.println(result);
|
| | | }
|
| | |
|
| | | public void convertLink(Long auctionId, String pid, String activityId) {
|
| | | List<ParamsKeyValue> params = new ArrayList<HaoDanKuApiUtil.ParamsKeyValue>();
|
| | | params.add(new ParamsKeyValue("itemid", auctionId + ""));
|
| | | params.add(new ParamsKeyValue("pid", pid));
|
| | | if (activityId != null)
|
| | | params.add(new ParamsKeyValue("activityid", activityId));
|
| | | // params.add(new ParamsKeyValue("tb_name", "椰视科技"));
|
| | | String result = basePostRequest("http://v2.api.haodanku.com/ratesurl", params);
|
| | | System.out.println(result);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 商品列表
|
| | | * @Title: listGoods
|
| | | * @Description: |
| | | * @param minId
|
| | | * @param catIds
|
| | | * @param pageSize
|
| | | * @return |
| | | * HDKGoodsListResultDTO 返回类型
|
| | | * @throws
|
| | | */
|
| | | // 详情:https://www.haodanku.com/api/detail/show/1.html
|
| | | public HDKGoodsListResultDTO listGoods(Integer minId, List<Integer> catIds, int pageSize) {
|
| | | if (minId == null)
|
| | | minId = 1;
|
| | | List<ParamsKeyValue> params = new ArrayList<HaoDanKuApiUtil.ParamsKeyValue>();
|
| | | params.add(new ParamsKeyValue("nav", 3+ ""));
|
| | | params.add(new ParamsKeyValue("back", pageSize + ""));
|
| | | params.add(new ParamsKeyValue("min_id", minId + ""));
|
| | | params.add(new ParamsKeyValue("sort", 0 + ""));
|
| | | if (catIds != null && catIds.size() > 0) {
|
| | | params.add(new ParamsKeyValue("cid", StringUtil.concat(catIds, ",")));
|
| | | }
|
| | |
|
| | | String result = baseGetRequest("itemlist", params);
|
| | |
|
| | | JSONObject resultData = JSONObject.fromObject(result);
|
| | | if (resultData.optInt("code") == 1) {
|
| | | Integer newMinId = resultData.optInt("min_id");
|
| | | Type type = new TypeToken<ArrayList<HDKGoodsDetail>>() {
|
| | | }.getType();
|
| | | List<HDKGoodsDetail> list = new Gson().fromJson(resultData.optJSONArray("data").toString(), type);
|
| | | return new HDKGoodsListResultDTO(list, newMinId);
|
| | | }
|
| | |
|
| | | return null;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 增量更新的商品
|
| | | * @Title: listAddGoods
|
| | | * @Description: |
| | | * @param minId
|
| | | * @param startHour
|
| | | * @param endHour
|
| | | * @param pageSize
|
| | | * @return |
| | | * HDKGoodsListResultDTO 返回类型
|
| | | * @throws
|
| | | */
|
| | | public HDKGoodsListResultDTO listAddGoods(Integer minId, int startHour, int endHour, int pageSize) {
|
| | | if (minId == null)
|
| | | minId = 1;
|
| | | List<ParamsKeyValue> params = new ArrayList<HaoDanKuApiUtil.ParamsKeyValue>();
|
| | | params.add(new ParamsKeyValue("back", pageSize + ""));
|
| | | params.add(new ParamsKeyValue("min_id", minId + ""));
|
| | | params.add(new ParamsKeyValue("start", startHour + ""));
|
| | | params.add(new ParamsKeyValue("end", endHour + ""));
|
| | |
|
| | | String result = baseGetRequest("timing_items", params);
|
| | | JSONObject resultData = JSONObject.fromObject(result);
|
| | | if (resultData.optInt("code") == 1) {
|
| | | Integer newMinId = resultData.optInt("min_id");
|
| | | Type type = new TypeToken<ArrayList<HDKGoodsDetail>>() {
|
| | | }.getType();
|
| | | List<HDKGoodsDetail> list = new Gson().fromJson(resultData.optJSONArray("data").toString(), type);
|
| | | return new HDKGoodsListResultDTO(list, newMinId);
|
| | | }
|
| | |
|
| | | return null;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 更新商品信息
|
| | | * @Title: listUpdateGoods
|
| | | * @Description: |
| | | * @param minId
|
| | | * @param pageSize |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | public HDKGoodsListResultDTO listUpdateGoods(Integer minId, int pageSize) {
|
| | | List<ParamsKeyValue> params = new ArrayList<HaoDanKuApiUtil.ParamsKeyValue>();
|
| | | params.add(new ParamsKeyValue("back", pageSize + ""));
|
| | | params.add(new ParamsKeyValue("min_id", minId + ""));
|
| | | String result = baseGetRequest("update_item", params);
|
| | | JSONObject resultData = JSONObject.fromObject(result);
|
| | | if (resultData.optInt("code") == 1) {
|
| | | Integer newMinId = resultData.optInt("min_id");
|
| | | Type type = new TypeToken<ArrayList<HDKGoodsDetail>>() {
|
| | | }.getType();
|
| | | List<HDKGoodsDetail> list = new Gson().fromJson(resultData.optJSONArray("data").toString(), type);
|
| | | return new HDKGoodsListResultDTO(list, newMinId);
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 拉取失效商品
|
| | | * @Title: listInvalidGoods
|
| | | * @Description: |
| | | * @param startHour
|
| | | * @param endHour
|
| | | * @return |
| | | * List<Long> 返回类型
|
| | | * @throws
|
| | | */
|
| | | public List<Long> listInvalidGoods(int startHour, int endHour) {
|
| | | List<ParamsKeyValue> params = new ArrayList<HaoDanKuApiUtil.ParamsKeyValue>();
|
| | | params.add(new ParamsKeyValue("start", startHour + ""));
|
| | | params.add(new ParamsKeyValue("end", endHour + ""));
|
| | | String result = baseGetRequest("get_down_items", params);
|
| | | JSONObject resultData = JSONObject.fromObject(result);
|
| | | List<Long> goodsIdList = new ArrayList<>();
|
| | | if (resultData.optInt("code") == 1) {
|
| | |
|
| | | JSONArray array = resultData.optJSONArray("data");
|
| | | for (int i = 0; i < array.size(); i++) {
|
| | | goodsIdList.add(array.optJSONObject(i).optLong("itemid"));
|
| | | }
|
| | | }
|
| | | return goodsIdList;
|
| | | }
|
| | |
|
| | | class ParamsKeyValue {
|
| | | String key;
|
| | | String value;
|
| | |
|
| | | public ParamsKeyValue(String key, String value) {
|
| | | super();
|
| | | this.key = key;
|
| | | this.value = value;
|
| | | }
|
| | | }
|
| | |
|
| | | public void getGoodsDetail(Long auctionId) {
|
| | | List<ParamsKeyValue> params = new ArrayList<HaoDanKuApiUtil.ParamsKeyValue>();
|
| | | params.add(new ParamsKeyValue("itemid", auctionId + ""));
|
| | | String result = baseGetRequest("item_detail", params);
|
| | | JSONObject resultJSON = JSONObject.fromObject(result);
|
| | | System.out.println(resultJSON.optJSONObject("data").optString("coupon_share_url"));
|
| | | System.out.println(resultJSON.optJSONObject("data").optString("couponurl"));
|
| | | }
|
| | |
|
| | | }
|
File was renamed from fanli/src/main/java/com/yeshi/fanli/util/vip/VipApiUtil.java |
| | |
| | | package com.yeshi.fanli.util.vip;
|
| | | package com.yeshi.fanli.util.vipshop;
|
| | |
|
| | | import java.io.IOException;
|
| | | import java.io.UnsupportedEncodingException;
|
| | | import java.lang.reflect.Type;
|
| | | import java.net.URLEncoder;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Collections;
|
| | |
| | | import org.yeshi.utils.StringUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.JsonObject;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.dto.vip.VIPSearchFilter;
|
| | | import com.yeshi.fanli.dto.vip.VIPSearchResult;
|
| | | import com.yeshi.fanli.dto.vip.goods.VIPGoodsInfo;
|
| | | import com.yeshi.fanli.dto.vipshop.VipShopOrderQueryModel;
|
| | | import com.yeshi.fanli.dto.vipshop.VipShopQueryOrderResultDTO;
|
| | | import com.yeshi.fanli.entity.vipshop.VipShopOrder;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class VipApiUtil {
|
| | | public class VipShopApiUtil {
|
| | |
|
| | | private final static String appKey = "f9e7f22f";
|
| | | private final static String appSecret = "9B2291352497FAF42B2DF44BFCF62316";
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | public static VIPSearchResult search() {
|
| | | /**
|
| | | * 搜索
|
| | | * @Title: search
|
| | | * @Description: |
| | | * @param searchFilter
|
| | | * @return |
| | | * VIPSearchResult 返回类型
|
| | | * @throws
|
| | | */
|
| | | public static VIPSearchResult search(VIPSearchFilter searchFilter) {
|
| | | Map<String, String> taskParams = new HashMap<>();
|
| | | taskParams.put("keyword", "夹克 男士 带帽");
|
| | | taskParams.put("page", "1");
|
| | | taskParams.put("pageSize", "20");
|
| | | taskParams.put("requestId", UUID.randomUUID() + "");
|
| | | // taskParams.put("priceStart", "");
|
| | | // taskParams.put("priceEnd", "");
|
| | | taskParams.put("keyword", searchFilter.getKeyword());
|
| | | taskParams.put("page", searchFilter.getPage() + "");
|
| | | taskParams.put("pageSize", searchFilter.getPageSize() + "");
|
| | | taskParams.put("requestId", System.currentTimeMillis() + "_" + UUID.randomUUID());
|
| | | if (searchFilter.getPriceStart() != null)
|
| | | taskParams.put("priceStart", searchFilter.getPriceStart());
|
| | |
|
| | | if (searchFilter.getPriceEnd() != null)
|
| | | taskParams.put("priceEnd", searchFilter.getPriceEnd());
|
| | | if (searchFilter.getOrder() != null)
|
| | | taskParams.put("order", searchFilter.getOrder() + "");
|
| | | if (searchFilter.getFieldName() != null)
|
| | | taskParams.put("fieldName", searchFilter.getFieldName() + "");
|
| | |
|
| | | JSONObject root = new JSONObject();
|
| | | root.put("request", JSONObject.fromObject(taskParams));
|
| | | String result = baseRequest("com.vip.adp.api.open.service.UnionGoodsService", "query", root);
|
| | |
| | | *
|
| | | * @param goodsId
|
| | | */
|
| | | public static void convertLink(String goodsId, String tag) {
|
| | | public static String convertLink(String goodsId, String tag) {
|
| | | JSONObject taskParams = new JSONObject();
|
| | | JSONArray goodsIdArray = new JSONArray();
|
| | | goodsIdArray.add(goodsId);
|
| | | taskParams.put("goodsIdList", goodsIdArray);
|
| | | taskParams.put("chanTag", tag);
|
| | | taskParams.put("requestId", UUID.randomUUID() + "");
|
| | | taskParams.put("requestId", System.currentTimeMillis() + "_" + UUID.randomUUID());
|
| | | String result = baseRequest("com.vip.adp.api.open.service.UnionUrlService", "genByGoodsId",
|
| | | JSONObject.fromObject(taskParams));
|
| | | System.out.println(result);
|
| | | JSONObject resultJSON = JSONObject.fromObject(result);
|
| | | if (resultJSON.optInt("returnCode") == 0) {
|
| | | return resultJSON.optJSONObject("result").optJSONArray("urlInfoList").optJSONObject(0).optString("url");
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | return goodsList.get(0);
|
| | | }
|
| | |
|
| | | public static void getOrderList() {
|
| | | JSONObject params = new JSONObject();
|
| | | // params.put("status", 1);
|
| | | params.put("orderTimeStart", System.currentTimeMillis() - 1000 * 60 * 60L);
|
| | | params.put("orderTimeEnd", System.currentTimeMillis());
|
| | | params.put("page", 1);
|
| | | // params.put("pageSize", );
|
| | | // params.put("updateTimeStart", );
|
| | | // params.put("updateTimeEnd", );
|
| | | public static VipShopQueryOrderResultDTO getOrderList(VipShopOrderQueryModel query) {
|
| | | JSONObject params = JSONObject.fromObject(new Gson().toJson(query));
|
| | | params.put("requestId", UUID.randomUUID());
|
| | | JSONObject root = new JSONObject();
|
| | | root.put("queryModel", params);
|
| | | String result = baseRequest("com.vip.adp.api.open.service.UnionOrderService", "orderList", root);
|
| | | System.out.println(result);
|
| | | JSONObject json = JSONObject.fromObject(result);
|
| | | if (json.optInt("returnCode") == 0) {
|
| | | JSONObject resultJson = json.optJSONObject("result");
|
| | | int total = resultJson.optInt("total");
|
| | | JSONArray array = JSONArray.fromObject(resultJson.optJSONArray("orderInfoList"));
|
| | | if (array != null) {
|
| | | Type type = new TypeToken<ArrayList<VipShopOrder>>() {
|
| | | }.getType();
|
| | | List<VipShopOrder> orderList = new Gson().fromJson(array.toString(), type);
|
| | | return new VipShopQueryOrderResultDTO(orderList, total);
|
| | | }
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.util.vipshop;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | import org.yeshi.utils.BigDecimalUtil;
|
| | |
|
| | | import com.yeshi.fanli.dto.vip.goods.VIPGoodsInfo;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | public class VipShopUtil {
|
| | |
|
| | | private static String getBase64Str(String str) {
|
| | | try {
|
| | | return StringUtil.getBase64String(str);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | return null;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取分享的渠道标识
|
| | | * @Title: getShareChanTag
|
| | | * @Description: |
| | | * @param uid
|
| | | * @return |
| | | * String 返回类型
|
| | | * @throws
|
| | | */
|
| | | public static String getShareChanTag(Long uid) {
|
| | | return getBase64Str("share#" + uid);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取自购的渠道标识
|
| | | * @Title: getBuyChanTag
|
| | | * @Description: |
| | | * @param uid
|
| | | * @return |
| | | * String 返回类型
|
| | | * @throws
|
| | | */
|
| | | public static String getBuyChanTag(Long uid) {
|
| | | return getBase64Str("buy#" + uid);
|
| | |
|
| | | }
|
| | |
|
| | | public static String getUidFromChanTag(String tag) {
|
| | | String decodeTag = StringUtil.getFromBase64(tag);
|
| | | return decodeTag.split("#")[1];
|
| | | }
|
| | |
|
| | | public static String getTypeFromChanTag(String tag) {
|
| | | String decodeTag = StringUtil.getFromBase64(tag);
|
| | | return decodeTag.split("#")[1];
|
| | | }
|
| | |
|
| | | public static BigDecimal getGoodsFanLiMoney(VIPGoodsInfo goods, BigDecimal rate) {
|
| | | BigDecimal money = null;
|
| | | BigDecimal hundred = new BigDecimal(100);
|
| | | rate = MoneyBigDecimalUtil.div(rate, hundred);
|
| | | money = MoneyBigDecimalUtil.mul(new BigDecimal(goods.getCommission()), rate);
|
| | | return BigDecimalUtil.getWithNoZera(money).setScale(2);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取订单详情的唯一标识
|
| | | * @Title: getOrderDetailIdentifyCode
|
| | | * @Description: |
| | | * @param orderSn
|
| | | * @param goodsId
|
| | | * @param sizeId
|
| | | * @return |
| | | * String 返回类型
|
| | | * @throws
|
| | | */
|
| | | public static String getOrderDetailIdentifyCode(String orderSn, String goodsId, String sizeId) {
|
| | |
|
| | | return StringUtil.Md5(orderSn + "#" + goodsId + "#" + sizeId);
|
| | | }
|
| | | }
|
| | |
| | | mongo.dbname=flq
|
| | | mongo.port=27016
|
| | | mongo.port=27017
|
| | | #开发环境
|
| | | #mongo.host=192.168.1.253
|
| | | #mongo.username=admin
|
| | | #mongo.password=123456
|
| | | mongo.host=192.168.1.253
|
| | | mongo.username=admin
|
| | | mongo.password=123456
|
| | |
|
| | | mongo.host=193.112.35.168
|
| | | mongo.username=yeshi
|
| | | mongo.password=Yeshi2016@
|
| | | #mongo.host=193.112.35.168
|
| | | #mongo.username=yeshi
|
| | | #mongo.password=Yeshi2016@
|
| | |
|
| | | mongo.connectionsPerHost=8
|
| | | mongo.threadsAllowedToBlockForConnectionMultiplier=4
|
| | |
| | | import org.yeshi.utils.mybatis.ColumnParseUtil;
|
| | | import org.yeshi.utils.mybatis.MyBatisMapperUtil;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserVIPPreInfo;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.money.TeamEincomeRecord;
|
| | |
|
| | | //@Ignore
|
| | |
| | |
|
| | | @Test
|
| | | public void test1() {
|
| | | ColumnParseUtil.parseColumn(UserVIPPreInfo.class,
|
| | | "D:/workspace/fanli/fanli-server/fanli/src/main/java/com/yeshi/fanli/mapping/user/vip/UserVIPPreInfoMapper.xml");
|
| | | ColumnParseUtil.parseColumn(SwiperPicture.class,
|
| | | "D:/workspace/fanli/fanli-server/fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SwiperPictureMapper.xml");
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | // e.printStackTrace();
|
| | | // }
|
| | |
|
| | | List<TaoBaoOrder> list = TaoKeOrderApiUtil.getTaoBaoRelationOrderList(
|
| | | TimeUtil.convertToTimeTemp("2019-12-09 10:13:52", "yyyy-MM-dd HH:mm:ss"),
|
| | | TimeUtil.convertToTimeTemp("2019-12-09 10:14:53", "yyyy-MM-dd HH:mm:ss"), 1);
|
| | | System.out.println(list);
|
| | | // List<TaoBaoOrder> list = TaoKeOrderApiUtil.getTaoBaoRelationOrderList(
|
| | | // TimeUtil.convertToTimeTemp("2019-12-09 10:13:52", "yyyy-MM-dd HH:mm:ss"),
|
| | | // TimeUtil.convertToTimeTemp("2019-12-09 10:14:53", "yyyy-MM-dd HH:mm:ss"), 1);
|
| | | // System.out.println(list);
|
| | | |
| | | String result = TaoKeApiUtil.officialActivityConvert("19507100253",
|
| | | "1571715733668", "20211660").getShort_click_url();
|
| | | System.out.println(result);
|
| | | }
|
| | |
|
| | | @Test
|