Merge remote-tracking branch 'origin/div' into div
Conflicts:
fanli/src/main/webapp/client/gonglue/index.html
| | |
| | | desc.append("180天安全订单数:" + record.getExtraInfo().getSafeOrderCount()); |
| | | } |
| | | |
| | | Integer countOrder = commonOrderCountService.countOderByUidAndLess10(extract.getUserInfo().getId()); |
| | | if (countOrder != null && countOrder > 10) { |
| | | if (record.getExtraInfo().getLess10OrderCount() != null && record.getExtraInfo().getLess10OrderCount() > 10) { |
| | | desc.append("刷单嫌疑\n#"); |
| | | } |
| | | |
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("更新失败")); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 订单跟踪准确率(板栗快省用户订单/淘宝联盟订单) |
| | | * |
| | | * @param callback |
| | | * @param dateType |
| | | * @param year |
| | | * @param startTime |
| | | * @param endTime |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getTrackAccuracyRate") |
| | | public void getTrackAccuracyRate(String callback, Integer dateType, String year, String startTime, String endTime, |
| | | int sourceType, PrintWriter out) { |
| | | |
| | | if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) { |
| | | startTime = null; |
| | | endTime = null; |
| | | } |
| | | |
| | | if (dateType == 1 && year != null) { |
| | | year = null; // 设置为空 |
| | | } else if (dateType == 2) { |
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | |
| | | } else if (dateType == 3) { |
| | | if (year != null) |
| | | year = null; |
| | | |
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | } |
| | | |
| | | try { |
| | | |
| | | Gson gson = new Gson(); |
| | | Object objectDate = null; |
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year); |
| | | |
| | | JSONArray line_list = new JSONArray(); |
| | | |
| | | List<ChartTDO> list = commonOrderCountService.getTrackAccuracyRate(dateType, year, startTime, endTime, |
| | | sourceType); |
| | | |
| | | JSONObject innerList = new JSONObject(); |
| | | innerList.put("name", "总计"); |
| | | |
| | | if (dateType != 3) { |
| | | innerList.put("data", gson.toJson(AdminUtils.dayOrMonthDataFactory(dateType, dateList, list))); |
| | | } else { |
| | | // 年视图 |
| | | Map<String, Object> map = AdminUtils.yearsDataFactory(list); |
| | | |
| | | if (objectDate == null) { |
| | | objectDate = map.get("date"); |
| | | } |
| | | innerList.put("data", gson.toJson(map.get("value"))); |
| | | } |
| | | |
| | | line_list.add(innerList); |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | if (objectDate != null) { |
| | | data.put("xAxis_list", gson.toJson(objectDate)); |
| | | } else { |
| | | data.put("xAxis_list", gson.toJson(dateList)); |
| | | } |
| | | |
| | | data.put("line_list", line_list); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | |
| | | } catch (Exception e) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常")); |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | |
|
| | | String tearcherLink = configService.getByVersion(ConfigKeyEnum.tearcherLink.getKey(),
|
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | if (userActivedRecordService.canNotifyAddTearcher(uid)) {
|
| | | if (userActivedRecordService.canNotifyAddTearcher(uid) && !StringUtil.isNullOrEmpty(tearcherLink)) {
|
| | | UserInfo userInfo = userInfoService.selectAvailableByPrimaryKey(uid);
|
| | | if (userInfo != null) {
|
| | | JumpDetailV2 jumpDetail = jumpDetailV2Service.getByTypeCache("web",
|
| | |
| | | }
|
| | | });
|
| | | Gson gson = gsonBuilder.create();
|
| | | |
| | |
|
| | | data.put("count", count);
|
| | | data.put("result_list", gson.toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
| | | TaoBaoGoodsBrief goods = taoBaoLink.getGoods();
|
| | | if (!com.yeshi.fanli.util.VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(),
|
| | | acceptData.getVersion()))
|
| | | data.put("clickUrl", ShareControllerV2.getERCodeContentNew(configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()), goods, taoBaoLink.getTaoToken()));
|
| | | data.put("clickUrl",
|
| | | ShareControllerV2.getERCodeContentNew(
|
| | | configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()), goods,
|
| | | taoBaoLink.getTaoToken()));
|
| | |
|
| | | data.put("token", TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken()));
|
| | |
|
| | | String inviteCode = userInfoExtraService.getInviteCodeByUid(uid);
|
| | | String inviteCode = userInfoExtraService.getInviteCodeByUid(uid);
|
| | | // 测试
|
| | | List<String> commentTexts = new ArrayList<>();
|
| | | String commentTextStr = configService.get(ConfigKeyEnum.shareSingleGoodsCommentText.getKey());
|
| | |
| | | }
|
| | | }
|
| | | data.put("commentTexts", commentTexts);
|
| | | data.put("wxErCode", ShareControllerV2.getERCodeContentNew(configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()), goods, taoBaoLink.getTaoToken()));
|
| | | data.put("wxErCode",
|
| | | ShareControllerV2.getERCodeContentNew(
|
| | | configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()), goods,
|
| | | taoBaoLink.getTaoToken()));
|
| | | }
|
| | |
|
| | | } else if (cid == 4) { // 邀请分享
|
| | |
| | | String valueBr = valueN.replace("\n", "<br><br>");
|
| | | data.put("inviteRules", valueBr);
|
| | |
|
| | | // 邀请链接
|
| | | String shortLink = HttpUtil.getShortLink("http://" + Constant.wxGZConfig.getLoginHost() + "/"
|
| | | + Constant.systemCommonConfig.getProjectName() + "/client/threeShareNew?uid=" + uid);
|
| | | data.put("inviteLink", shortLink);
|
| | | data.put("inviteLink", Constant.YINGYONGBAO_LINK);
|
| | | data.put("inviteCode", inviteCode);
|
| | | data.put("helpLink", configService.get(ConfigKeyEnum.inviteHelpLink.getKey()));
|
| | | }
|
| | |
| | | list.add(map.get(TYPE_FAQUAN)); |
| | | list.add(map.get(TYPE_HUODONG)); |
| | | // list.add(map.get(TYPE_XUEYUAN)); |
| | | list.add(map.get(TYPE_SUCAI)); |
| | | |
| | | // list.add(map.get(TYPE_SUCAI)); |
| | | } else if (VersionUtil.greaterThan_2_0_6(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | // 2.0.6返回热销+活动+推荐+学院+邀请 |
| | | list.add(map.get(TYPE_REXIAO)); |
| | |
| | | } |
| | | } |
| | | |
| | | String newText = text; |
| | | String newText = text; |
| | | try { |
| | | newText = convertLinkManager.convertLinkFromText(text, uid, true); |
| | | } catch (ConvertLinkExceptionException e) { |
| | |
| | | "下载链接:" + Constant.YINGYONGBAO_LINK, false, true)); |
| | | |
| | | list.add(new ShareGoodsCommentChoiceInfo(ShareGoodsCommentChoiceInfo.TYPE_FANLI_MONEY, "返利金额", |
| | | "返利金额:¥ " + fanliMoney, false, true)); |
| | | String.format("【联系我下载APP】最高可返还%s元", fanliMoney + ""), false, true)); |
| | | |
| | | return list; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | public static String getERCodeContentNew(String template, TaoBaoGoodsBrief goods, String token) { |
| | | String commentText = template.replace("[原价]", goods.getZkPrice().toString()); |
| | | commentText = commentText.replace("[淘口令]", token); |
| | |
| | | } else { |
| | | commentText = commentText.replace("[券后价]", TaoBaoUtil.getAfterUseCouplePrice(goods) + ""); |
| | | } |
| | | |
| | | 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"); |
| | | return commentText; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 创建淘宝分享信息 |
| | | * |
| | |
| | | shareInfo.setCommentTexts(commentTexts); |
| | | |
| | | TaoBaoGoodsBrief goods = taoBaoLink.getGoods(); |
| | | |
| | | |
| | | boolean coupon = false; |
| | | if (!StringUtil.isNullOrEmpty(taoBaoLink.getGoods().getCouponInfo())) { |
| | | coupon = true; |
| | | } |
| | | |
| | | |
| | | String template = shareGoodsTextTemplateService.getTextTemplateByTB(uid); |
| | | String shareText = shareGoodsTextTemplateService.createContentTB(template, goods, taoBaoLink.getTaoToken(), coupon); |
| | | String shareText = shareGoodsTextTemplateService.createContentTB(template, goods, taoBaoLink.getTaoToken(), |
| | | coupon); |
| | | shareInfo.setShareText(shareText); |
| | | |
| | | |
| | | String descText = shareText.replace(taoBaoLink.getGoods().getTitle(), "").trim(); |
| | | if (descText.startsWith("\\r\\n")) { |
| | | descText = descText.substring(0); |
| | | } |
| | | shareInfo.setDescText(deleteBlankLine(descText)); |
| | | |
| | | |
| | | // 测试 |
| | | // 2.0.2之前 |
| | | if (VersionUtil.greaterThan_2_0_7(platform, version)) { |
| | | shareInfo.setClickUrl(getERCodeContentNew(configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()), |
| | | taoBaoLink.getGoods(), shareInfo.getToken())); |
| | | shareInfo.setClickUrl( |
| | | getERCodeContentNew(configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()), |
| | | taoBaoLink.getGoods(), shareInfo.getToken())); |
| | | } else if (!VersionUtil.greaterThan_2_0_2(platform, version)) { |
| | | shareInfo.setClickUrl(getERCodeContentNew(configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()), |
| | | taoBaoLink.getGoods(), shareInfo.getToken())); |
| | | shareInfo.setClickUrl( |
| | | getERCodeContentNew(configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()), |
| | | taoBaoLink.getGoods(), shareInfo.getToken())); |
| | | } |
| | | |
| | | if (VersionUtil.greaterThan_2_0_7(platform, version)) { |
| | | shareInfo.setWxErCode(getERCodeContentNew(configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()), |
| | | taoBaoLink.getGoods(), shareInfo.getToken())); |
| | | shareInfo.setWxErCode( |
| | | getERCodeContentNew(configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()), |
| | | taoBaoLink.getGoods(), shareInfo.getToken())); |
| | | } else { |
| | | shareInfo.setWxErCode(getERCodeContentNew(configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()), |
| | | taoBaoLink.getGoods(), shareInfo.getToken())); |
| | | shareInfo.setWxErCode( |
| | | getERCodeContentNew(configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()), |
| | | taoBaoLink.getGoods(), shareInfo.getToken())); |
| | | } |
| | | |
| | | |
| | | |
| | | // 提示图文内容 |
| | | String imgs = configService.getByVersion(ConfigKeyEnum.goodsShareNotifyImgs.getKey(), platform, |
| | | Integer.parseInt(version)); |
| | |
| | | e1.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | String commentText = ""; |
| | | String recommendText = ""; |
| | | if (VersionUtil.greaterThan_2_0_7(platform, version)) { |
| | |
| | | } else { |
| | | recommendText = recommendText.replace("[推荐语]", goods.getDescription()); |
| | | } |
| | | |
| | | |
| | | String sales = TaoBaoUtil.getSaleCount(taoBaoLink.getGoods().getBiz30day()); |
| | | if (sales.equals("0")) { |
| | | recommendText = recommendText.replace("销量:[销量]", ""); |
| | |
| | | commentText = commentText.replace("[券后价]", |
| | | TaoBaoUtil.getAfterUseCouplePrice(taoBaoLink.getGoods()) + ""); |
| | | } |
| | | |
| | | |
| | | |
| | | if (StringUtil.isNullOrEmpty(taoBaoLink.getGoods().getCouponInfo())) { |
| | | recommendText = recommendText.replace("优惠券:[券面额]元", ""); |
| | | } else { |
| | |
| | | |
| | | // 设置评论文本选项 |
| | | shareInfo.setCommentTextChoiceList(getCommentChoiceList(shareInfo.getCommentText(), null, inviteCode, |
| | | TaoBaoUtil.getGoodsHongBaoMoney(taoBaoLink.getGoods(), hongBaoManageService.getFanLiRate()))); |
| | | TaoBaoUtil.getGoodsHongBaoMoney(taoBaoLink.getGoods(), hongBaoManageService.getVIPFanLiRate()))); |
| | | |
| | | out.print(JsonUtil.loadTrueResult( |
| | | JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo))); |
| | |
| | | if (couponInfo != null) { |
| | | hasCoupon = true; |
| | | } |
| | | |
| | | |
| | | String template = shareGoodsTextTemplateService.getTextTemplateByJD(uid); |
| | | String shareText = shareGoodsTextTemplateService.createContentJD(template, jdGoods, jumpLink, hasCoupon); |
| | | shareInfo.setShareText(shareText); |
| | |
| | | } else { |
| | | recommendText = recommendText.replace("[销量]", sales.replace("万", "w")); |
| | | } |
| | | |
| | | |
| | | BigDecimal price = jdGoods.getPrice(); |
| | | JDPingouInfo pinGouInfo = jdGoods.getPinGouInfo(); |
| | | if (pinGouInfo != null) { |
| | | price = pinGouInfo.getPingouPrice(); |
| | | } |
| | | |
| | | |
| | | String template3 = configService.get(ConfigKeyEnum.quickShareJDCommentText.getKey()); |
| | | commentText = template3.replace("[原价]", BigDecimalUtil.getWithNoZera(price).toString()); |
| | | if (!hasCoupon) { |
| | |
| | | commentText = commentText.replace("【券后价】[券后价]元", ""); |
| | | commentText = commentText.replace("领券抢购", "抢购"); |
| | | } else { |
| | | recommendText = recommendText.replace("[券面额]", BigDecimalUtil.getWithNoZera(couponInfo.getDiscount()).toString()); |
| | | commentText = commentText.replace("[券后价]", BigDecimalUtil.getWithNoZera(JDUtil.getQuanPrice(jdGoods)).toString()); |
| | | recommendText = recommendText.replace("[券面额]", |
| | | BigDecimalUtil.getWithNoZera(couponInfo.getDiscount()).toString()); |
| | | commentText = commentText.replace("[券后价]", |
| | | BigDecimalUtil.getWithNoZera(JDUtil.getQuanPrice(jdGoods)).toString()); |
| | | } |
| | | commentText = commentText.replace("[链接]", jumpLink); |
| | | } else { |
| | |
| | | |
| | | // 设置评论文本选项 |
| | | shareInfo.setCommentTextChoiceList(getCommentChoiceList(null, shareInfo.getCommentText(), inviteCode, |
| | | JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getFanLiRate()))); |
| | | JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getVIPFanLiRate()))); |
| | | |
| | | out.print(JsonUtil.loadTrueResult( |
| | | JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo))); |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | private String deleteBlankLine(String st){ |
| | | |
| | | private String deleteBlankLine(String st) { |
| | | return st.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 拼多多分享 |
| | |
| | | } |
| | | |
| | | // 创建口令 |
| | | // String token = PinDuoDuoApiUtil.createGenerate(goodsId); |
| | | |
| | | // String token = PinDuoDuoApiUtil.createGenerate(goodsId); |
| | | |
| | | boolean hasCoupon = true; |
| | | if (goods.getHasCoupon() == null || !goods.getHasCoupon()) { |
| | | hasCoupon = false; |
| | | } |
| | | } |
| | | String template = shareGoodsTextTemplateService.getTextTemplateByPDD(uid); |
| | | String shareText = shareGoodsTextTemplateService.createContentPDD(template, goods, jumpLink, hasCoupon); |
| | | shareInfo.setShareText(shareText); |
| | |
| | | shareInfo.setCommentText(deleteBlankLine(commentText)); |
| | | |
| | | // 设置评论文本选项 |
| | | shareInfo.setCommentTextChoiceList(getCommentChoiceList(null,shareInfo.getCommentText(), inviteCode, |
| | | PinDuoDuoUtil.getGoodsFanLiMoney(goods, hongBaoManageService.getFanLiRate()))); |
| | | shareInfo.setCommentTextChoiceList(getCommentChoiceList(null, shareInfo.getCommentText(), inviteCode, |
| | | PinDuoDuoUtil.getGoodsFanLiMoney(goods, hongBaoManageService.getVIPFanLiRate()))); |
| | | |
| | | out.print(JsonUtil.loadTrueResult( |
| | | JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo))); |
| | |
| | | out.print(JsonUtil.loadFalseResult(5, e.getMsg())); |
| | | return; |
| | | } |
| | | |
| | | |
| | | // 查询是否有分享 |
| | | UserShareGoodsHistory userShareHistory = shareGoodsService.getShareGoodsHistory(uid, goods.getAuctionId()); |
| | | String token = ""; |
| | |
| | | StringUtil.isNullOrEmpty(goodsLink.getCouponLink()) ? goodsLink.getAuctionUrl() |
| | | : goodsLink.getCouponLink()); |
| | | } |
| | | String content = shareGoodsTextTemplateService.createContentTB(template, goods, token, hasCoupon); |
| | | String content = shareGoodsTextTemplateService.createContentTB(template, goods, token, hasCoupon); |
| | | JSONObject data = new JSONObject(); |
| | | data.put("content", content); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | |
| | | |
| | | String shortLink = PinDuoDuoApiUtil.getPromotionUrl(goodsId, PinDuoDuoApiUtil.PID_SHARE + "", uid + ""); |
| | | |
| | | // // 创建口令 |
| | | // String token = PinDuoDuoApiUtil.createGenerate(goodsId); |
| | | // // 创建口令 |
| | | // String token = PinDuoDuoApiUtil.createGenerate(goodsId); |
| | | |
| | | // 生成分享内容 |
| | | String content = shareGoodsTextTemplateService.createContentPDD(template, goods, shortLink, hasCoupon); |
New file |
| | |
| | | package com.yeshi.fanli.controller.devops;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.exception.order.TaoBaoWeiQuanException;
|
| | | import com.yeshi.fanli.service.inter.order.OrderProcessService;
|
| | |
|
| | | /**
|
| | | * 运维订单接口
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Controller
|
| | | @RequestMapping("devops/order")
|
| | | public class OrderDevOpsController {
|
| | |
|
| | | @Resource
|
| | | private OrderProcessService orderProcessService;
|
| | |
|
| | | /**
|
| | | * 返利
|
| | | * @param hongBaoId
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping("fanliByHongBaoId")
|
| | | public void fanli(Long hongBaoId, PrintWriter out) {
|
| | | try {
|
| | | orderProcessService.fanli(new HongBaoV2(hongBaoId));
|
| | | out.print("success");
|
| | | } catch (TaoBaoWeiQuanException e) {
|
| | | e.printStackTrace();
|
| | | out.print(e.getMessage());
|
| | | } catch (Exception e) {
|
| | | out.print(e.getMessage());
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | * @return
|
| | | */
|
| | | Long countOrderByDay(@Param("preDay") String preDay);
|
| | | |
| | | /**
|
| | | * 统计所有订单
|
| | | * |
| | | * @param channel
|
| | | * @return
|
| | | */
|
| | | List<ChartTDO> countOrderNumber(@Param("dateType") Integer dateType, @Param("year") String year,
|
| | | @Param("startTime") String startTime, @Param("endTime") String endTime);
|
| | |
|
| | |
|
| | | } |
| | |
| | | Long countOrderBySourceTypeAndDay(@Param("preDay") String preDay, @Param("sourceType") int sourceType); |
| | | |
| | | |
| | | /** |
| | | * 统计所有订单 |
| | | * |
| | | * @param channel |
| | | * @return |
| | | */ |
| | | List<ChartTDO> countOrderNumber(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime, |
| | | @Param("sourceType") int sourceType); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 奖金统计 |
| | |
| | | * @return
|
| | | */
|
| | | PDDOrder selectByOrderSN(String orderSn);
|
| | | |
| | | /**
|
| | | * 数量统计
|
| | | * |
| | | * @param dateType
|
| | | * @param year
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | List<ChartTDO> countOrderNumber(@Param("dateType") Integer dateType, @Param("year") String year,
|
| | | @Param("startTime") String startTime, @Param("endTime") String endTime);
|
| | |
|
| | |
|
| | | /**
|
| | | * 数量统计
|
| | |
| | |
|
| | | // 根据订单号删除数据
|
| | | int deleteByOrderId(String orderId);
|
| | | |
| | | /**
|
| | | * 统计所有订单
|
| | | * |
| | | * @param channel
|
| | | * @return
|
| | | */
|
| | | List<ChartTDO> countOrderNumber(@Param("dateType") Integer dateType, @Param("year") String year,
|
| | | @Param("startTime") String startTime, @Param("endTime") String endTime);
|
| | |
|
| | |
|
| | | /**
|
| | | * 统计--订单类型区分
|
| | |
| | | private BigDecimal weiQuanOrderFanAmount;// 维权订单返还的金额
|
| | |
|
| | | private int safeOrderCount;// 安全订单数量
|
| | | |
| | | private Integer less10OrderCount;//付款金额少于10块的订单数量
|
| | |
|
| | | public Integer getLess10OrderCount() {
|
| | | return less10OrderCount;
|
| | | }
|
| | |
|
| | | public void setLess10OrderCount(Integer less10OrderCount) {
|
| | | this.less10OrderCount = less10OrderCount;
|
| | | }
|
| | |
|
| | | public ExtractOrderStatisticDTO(int orderCount50More, int weiQuanOrderCount, BigDecimal weiQuanOrderFanAmount,
|
| | | int safeOrderCount) {
|
| | | int safeOrderCount,Integer less10OrderCount) {
|
| | | this.orderCount50More = orderCount50More;
|
| | | this.weiQuanOrderCount = weiQuanOrderCount;
|
| | | this.weiQuanOrderFanAmount = weiQuanOrderFanAmount;
|
| | | this.safeOrderCount = safeOrderCount;
|
| | | this.less10OrderCount=less10OrderCount;
|
| | | }
|
| | |
|
| | | public ExtractOrderStatisticDTO() {
|
| | |
| | | public final static int STATE_SX = 4;// 未付款/已退款
|
| | |
|
| | | public enum MsgTypeOrderTypeEnum {
|
| | | fanli("返利订单"), share("分享订单"), invite("邀请订单"), found("订单找回"), elme("饿了么订单");
|
| | | fanli("返利订单"), share("分享订单"), invite("团队订单"), found("订单找回"), elme("饿了么订单");
|
| | | private final String desc;
|
| | |
|
| | | private MsgTypeOrderTypeEnum(String desc) {
|
| | |
| | |
|
| | | @Resource
|
| | | private GoodsEvaluateService goodsEvaluateService;
|
| | | |
| | |
|
| | | /**
|
| | | * 每10分钟 晚上00:00~06:00不下发任何一个商品
|
| | | * 每10分钟 晚上00:00~06:00不下发任何一个商品
|
| | | */
|
| | | @Scheduled(cron = "0 0/10 6-23 * * ?")
|
| | | public void insetDynamicInfo() {
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 后台编辑动态: 每3分钟检索
|
| | | * 后台编辑动态: 每3分钟检索
|
| | | */
|
| | | @Scheduled(cron = "0 0/3 * * * ?")
|
| | | public void activityNeedPublish() {
|
| | |
| | |
|
| | | /**
|
| | | *
|
| | | * @Title: demoJobHandler
|
| | | * @Description: 更新小程序动态商品
|
| | | * @param param
|
| | | * @return
|
| | | * @throws Exception |
| | | * ReturnT<String> 返回类型
|
| | | * @throws
|
| | | * @Title: demoJobHandler @Description: 更新小程序动态商品 @param
|
| | | * param @return @throws Exception ReturnT<String> 返回类型 @throws
|
| | | */
|
| | | @XxlJob("dynamic-updateWXMPDynamicInfo")
|
| | | public ReturnT<String> updateWXMPDynamicInfoHandler(String param) throws Exception {
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 添加内优惠相关商品
|
| | | * @Title: addJDNYHInfo
|
| | | * @Description: |
| | | * void 返回类型
|
| | | * @throws
|
| | | * 添加内优惠相关商品 @Title: addJDNYHInfo @Description: void 返回类型 @throws
|
| | | */
|
| | | private void addJDNYHInfo() throws Exception {
|
| | |
|
| | |
| | | wxmpDynamicInfoService.addWXMPDynamicInfo(info);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 自动生成发圈
|
| | | * 早上6,7,15,16,21,22,23点更新1次
|
| | | */
|
| | | @Scheduled(cron = "0 0 6,7,15,16,21,22,23 * * ? ")
|
| | | public void insetEvaluate() {
|
| | | if (!Constant.IS_TASK) {
|
| | | return;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 动态发圈
|
| | | * |
| | | * @param param
|
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | // @Scheduled(cron = "0 0 6,7,15,16,21,22,23 * * ? ")
|
| | | @XxlJob("dynamic-insertEvaluate")
|
| | | public ReturnT<String> insertEvaluate(String param) throws Exception {
|
| | | try {
|
| | | goodsEvaluateService.addGoodsEvaluateByDaTaoKe();
|
| | | } catch (Exception e) {
|
| | |
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | |
|
| | |
|
| | |
| | | WHERE joi_valid_code!=2 AND FROM_UNIXTIME(jo_order_time/1000,'%Y-%m-%d')=#{preDay}
|
| | | </select>
|
| | |
|
| | | |
| | | <select id="countOrderNumber" resultMap="ChartMap">
|
| | | SELECT IFNULL(COUNT(`joi_id`),0) AS showValue,
|
| | | <include refid="Column_DateType" />
|
| | | FROM `yeshi_ec_jd_order_item` left join yeshi_ec_jd_order on jo_order_id=joi_order_id WHERE jo_order_time IS NOT NULL and joi_valid_code!=2
|
| | | <include refid="Count_Select_DateType" />
|
| | | <include refid="Count_Group_DateType" />
|
| | | ORDER BY jo_order_time
|
| | | </select>
|
| | | |
| | | </mapper>
|
| | |
| | | WHERE t.co_source_type=#{sourceType} AND DATE_FORMAT(t.`co_third_create_time`,'%Y-%m-%d') = #{preDay} |
| | | </select> |
| | | |
| | | <select id="countOrderNumber" resultMap="ChartMap"> |
| | | SELECT IFNULL(COUNT(t.`co_id`),0) AS showValue,<include refid="Column_DateType"/> |
| | | FROM `yeshi_ec_common_order` t |
| | | WHERE t.co_source_type=#{sourceType} and t.`co_third_create_time` IS NOT NULL <include refid="Count_Select_DateType"/> |
| | | <include refid="Count_Group_DateType"/> |
| | | ORDER BY t.`co_third_create_time` |
| | | </select> |
| | | |
| | | |
| | | <select id="countOrderNumberBySettleTime" resultType="java.util.HashMap"> |
| | | <!-- 统计历史订单数量 根据结算时间 --> |
| | |
| | | WHERE FROM_UNIXTIME(po_order_create_time,'%Y-%m-%d') = #{preDay}
|
| | | </select>
|
| | |
|
| | | <select id="countOrderNumber" resultMap="ChartMap">
|
| | | SELECT IFNULL(COUNT(`po_id`),0) AS showValue,
|
| | | <include refid="Column_DateType" />
|
| | | FROM `yeshi_ec_pdd_order` t WHERE po_order_create_time IS NOT NULL
|
| | | <include refid="Count_Select_DateType" />
|
| | | <include refid="Count_Group_DateType" />
|
| | | ORDER BY po_order_create_time
|
| | | </select>
|
| | |
|
| | |
|
| | | <select id="listByStatus" resultMap="BaseResultMap">
|
| | |
| | | SELECT COUNT(t.`to_id`) FROM `yeshi_ec_taobao_order` t
|
| | | WHERE DATE_FORMAT(t.`to_create_time`,'%Y-%m-%d') = #{preDay}
|
| | | </select>
|
| | | |
| | | <select id="countOrderNumber" resultMap="ChartMap">
|
| | | SELECT IFNULL(COUNT(t.`to_id`),0) AS showValue,
|
| | | <include refid="Column_DateType" />
|
| | | FROM `yeshi_ec_taobao_order` t WHERE t.`to_create_time` IS NOT NULL
|
| | | <include refid="Count_Select_DateType" />
|
| | | <include refid="Count_Group_DateType" />
|
| | | ORDER BY t.`to_create_time`
|
| | | </select>
|
| | | </mapper>
|
| | |
| | | package com.yeshi.fanli.service.impl.count; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.DecimalFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | record.setId(StringUtil.Md5(preDay + trackRateEnum.name())); |
| | | countOrderTrackRateDao.save(record); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<ChartTDO> getTrackAccuracyRate(Integer dateType, String year, String startTime, String endTime, |
| | | int sourceType) throws Exception { |
| | | |
| | | List<ChartTDO> result_list = null; |
| | | |
| | | // 用户订单 |
| | | List<ChartTDO> listTotal = commonOrderCountMapper.countOrderNumber(dateType, year, startTime, endTime, |
| | | sourceType); |
| | | if (listTotal == null || listTotal.size() == 0) { |
| | | return result_list; |
| | | } |
| | | |
| | | // 淘宝联盟 |
| | | List<ChartTDO> type_list = null; |
| | | switch (sourceType) { |
| | | case Constant.SOURCE_TYPE_TAOBAO: |
| | | type_list = taoBaoOrderMapper.countOrderNumber(dateType, year, startTime, endTime); |
| | | break; |
| | | case Constant.SOURCE_TYPE_JD: |
| | | type_list = jdOrderItemMapper.countOrderNumber(dateType, year, startTime, endTime); |
| | | break; |
| | | case Constant.SOURCE_TYPE_PDD: |
| | | type_list = pddOrderMapper.countOrderNumber(dateType, year, startTime, endTime); |
| | | break; |
| | | } |
| | | if (type_list == null || type_list.size() == 0) { |
| | | return null; |
| | | } |
| | | |
| | | switch (dateType) { |
| | | case 1: // 按天处理 |
| | | result_list = dayFactory(startTime, endTime, type_list); |
| | | break; |
| | | case 2: // 按月处理 |
| | | result_list = monthFactory(type_list); |
| | | break; |
| | | case 3: |
| | | result_list = yearFactory(type_list); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | DecimalFormat df = new DecimalFormat("#.00"); |
| | | |
| | | for (int i = 0; i < result_list.size(); i++) { |
| | | double proportion = 0; |
| | | ChartTDO chartTDO = result_list.get(i); |
| | | String showDate = chartTDO.getShowDate(); |
| | | for (int j = 0; j < listTotal.size(); j++) { |
| | | ChartTDO innerChartTDO = listTotal.get(j); |
| | | String innerDate = innerChartTDO.getShowDate(); |
| | | if (innerDate != null && innerDate.toString().equals(showDate.toString())) { |
| | | String innerValue = innerChartTDO.getShowValue(); |
| | | long innerData = Long.parseLong(innerValue); |
| | | |
| | | String showValue = chartTDO.getShowValue(); |
| | | long showData = Long.parseLong(showValue); |
| | | |
| | | if (showData > 0) { |
| | | proportion = innerData / (double) showData; |
| | | } |
| | | break; // 结束内部循环 |
| | | } |
| | | } |
| | | chartTDO.setShowValue(Double.parseDouble(df.format(proportion * 100)) + ""); |
| | | } |
| | | |
| | | return result_list; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.yeshi.fanli.dao.dynamic.WXMPDynamicInfoDao;
|
| | | import com.yeshi.fanli.entity.dynamic.WXMPDynamicInfo;
|
| | | import com.yeshi.fanli.exception.dynamic.WXMPDynamicInfoException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.dynamic.WXMPDynamicInfoService;
|
| | | import com.yeshi.fanli.service.manger.goods.ConvertLinkManager;
|
| | |
|
| | |
| | | convertContent = convertLinkManager.convertLinkFromText(info.getContent(), uid, true);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | LogHelper.errorDetailInfo(e);
|
| | | throw new WXMPDynamicInfoException(2, "转链出错");
|
| | | }
|
| | | wxmpDynamicInfoDao.addShareCount(id);
|
| | |
| | | }
|
| | |
|
| | | // 数据处理
|
| | | handlelist(listArc);
|
| | | // handlelist(listArc);
|
| | | arcMap.put("list", JsonUtil.getApiCommonGson().toJson(listArc));
|
| | |
|
| | | // 首页-活动区域(女王节)
|
| | |
| | | import com.yeshi.fanli.service.inter.money.extract.ExtractService;
|
| | | import com.yeshi.fanli.service.inter.money.extract.ExtractWeiXinRecordService;
|
| | | import com.yeshi.fanli.service.inter.money.msg.UserMoneyMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderCountService;
|
| | | import com.yeshi.fanli.service.inter.order.HongBaoV2Service;
|
| | | import com.yeshi.fanli.service.inter.order.OrderUserStatisticService;
|
| | | import com.yeshi.fanli.service.inter.push.PushService;
|
| | |
| | | import com.yeshi.fanli.util.GsonUtil;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.factory.UserMoneyDetailFactory;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private ExtractWeiXinRecordService extractWeiXinRecordService;
|
| | |
|
| | | @Resource
|
| | | private CommonOrderCountService commonOrderCountService;
|
| | |
|
| | | @Transactional
|
| | | public Integer addExtract(Extract extract) {
|
| | |
| | |
|
| | | extractMapper.insertSelective(extract);
|
| | |
|
| | | ExtractAuditRecord auditRecord = new ExtractAuditRecord();
|
| | | final ExtractAuditRecord auditRecord = new ExtractAuditRecord();
|
| | | auditRecord.setBeforeMoney(user.getMyHongBao());
|
| | | auditRecord.setExtract(extract);
|
| | |
|
| | | Date minTime = new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24 * 180L);
|
| | | // 统计数据
|
| | | int orderCount50More = orderUserStatisticService.countOrderCount100MoreByUidAndMinTime(user.getId(), minTime);
|
| | |
|
| | | BigDecimal weiQuanOrderFanAmount = orderUserStatisticService.sumWeiQuanOrderFanAmountByUid(user.getId(),
|
| | | minTime);
|
| | | int weiQuanOrderCount = orderUserStatisticService.countWeiQuanOrderByUid(user.getId(), minTime);
|
| | | auditRecord.setExtraInfoStr(new Gson()
|
| | | .toJson(new ExtractOrderStatisticDTO(orderCount50More, weiQuanOrderCount, weiQuanOrderFanAmount, 0)));
|
| | | |
| | | extractAuditRecordMapper.insertSelective(auditRecord);
|
| | |
|
| | | ThreadUtil.run(new Runnable() {
|
| | |
|
| | | @Override
|
| | | public void run() {
|
| | | // 统计数据
|
| | | int less10Count = commonOrderCountService.countOderByUidAndLess10(user.getId());
|
| | | ExtractAuditRecord update=new ExtractAuditRecord();
|
| | | update.setId(auditRecord.getId());
|
| | | int orderCount50More = orderUserStatisticService.countOrderCount100MoreByUidAndMinTime(user.getId(), minTime);
|
| | | BigDecimal weiQuanOrderFanAmount = orderUserStatisticService.sumWeiQuanOrderFanAmountByUid(user.getId(),
|
| | | minTime);
|
| | | int weiQuanOrderCount = orderUserStatisticService.countWeiQuanOrderByUid(user.getId(), minTime);
|
| | | update.setExtraInfoStr(new Gson().toJson(
|
| | | new ExtractOrderStatisticDTO(orderCount50More, weiQuanOrderCount, weiQuanOrderFanAmount, 0, less10Count)));
|
| | | extractAuditRecordMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | | });
|
| | |
|
| | | // 新版资金详情
|
| | | UserMoneyDetail userMoneyDetail = null;
|
| | | try {
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | PushContentDTO dto = PushMsgFactory.createFanLiOrderStatisticed(orderType, orderId, money);
|
| | | PushContentDTO dto = PushMsgFactory.createShareOrderStatisticed(orderType, orderId, money);
|
| | | try {
|
| | | pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null, null);
|
| | | } catch (NumberFormatException e) {
|
| | |
| | | * @return |
| | | */ |
| | | public Integer countOderByUidAndLess10(Long uid); |
| | | |
| | | |
| | | /** |
| | | * 统计所有订单 |
| | | * |
| | | * @param channel |
| | | * @return |
| | | */ |
| | | public List<ChartTDO> getTrackAccuracyRate(Integer dateType, String year, String startTime, String endTime, |
| | | int sourceType) throws Exception; |
| | | } |
| | |
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.exception.taobao.TaoBaoTokenParseException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.exception.user.TokenRecordException;
|
| | | import com.yeshi.fanli.service.inter.user.TokenRecordService;
|
| | | import com.yeshi.fanli.service.manger.goods.jd.JDGoodsLinkParseManager;
|
| | | import com.yeshi.fanli.service.manger.goods.tb.TaoBaoTokenAuctionIdMapManager;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.DouYinUtil;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TokenUtil;
|
| | | import com.yeshi.fanli.util.Utils;
|
| | |
| | |
|
| | | @Resource
|
| | | private TaoBaoTokenAuctionIdMapManager taoBaoTokenAuctionIdMapManager;
|
| | |
|
| | | @Resource
|
| | | private RedisManager redisManager;
|
| | |
|
| | | /**
|
| | | * @Title: parseContentType @Description: 解析文本的类型 @param text @return Set
|
| | |
| | | */
|
| | | public CommonGoods parseLink(String link) {
|
| | |
|
| | | SimpleCommonGoods simpleGoods = parseGoodsIdFromLink(link);
|
| | | if (simpleGoods == null) {
|
| | | return null;
|
| | | }
|
| | |
|
| | | CommonGoods commonGoods = null;
|
| | | if (simpleGoods.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) {
|
| | | TaoBaoGoodsBrief goods = null;
|
| | | try {
|
| | | goods = redisManager.getTaoBaoGoodsBrief(Long.parseLong(simpleGoods.getGoodsId()));
|
| | | } catch (NumberFormatException e) {
|
| | | e.printStackTrace();
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | if (goods != null) {
|
| | | commonGoods = CommonGoodsFactory.create(goods);
|
| | | } else {
|
| | | goods = TaoBaoUtil.getTmallGoodsInfo(simpleGoods.getGoodsId());
|
| | | if (goods != null) {
|
| | | commonGoods = new CommonGoods();
|
| | | commonGoods.setTitle(goods.getTitle());
|
| | | commonGoods.setPicture(goods.getPictUrl());
|
| | | } else {
|
| | | // TODO 根据淘宝商品ID解析标题与图片
|
| | | }
|
| | | }
|
| | |
|
| | | } else if (simpleGoods.getGoodsType() == Constant.SOURCE_TYPE_JD) {
|
| | | // 优先采用高级接口请求数据
|
| | | JDGoods jdGoods = null;
|
| | | try {
|
| | | // 防止高级接口被收回
|
| | | jdGoods = JDApiUtil.queryGoodsDetail(Long.parseLong(simpleGoods.getGoodsId()));
|
| | | } catch (Exception e) {
|
| | | }
|
| | | if (jdGoods == null) {
|
| | | jdGoods = JDApiUtil.getGoodsDetail(Long.parseLong(simpleGoods.getGoodsId()));
|
| | | }
|
| | | if (jdGoods != null) {
|
| | | commonGoods = CommonGoodsFactory.create(jdGoods);
|
| | | } else {// 商品并未参与推广
|
| | | jdGoods = JDUtil.getSimpleGoodsInfo(simpleGoods.getGoodsId());
|
| | | if (jdGoods != null) {
|
| | | commonGoods = new CommonGoods();
|
| | | commonGoods.setTitle(jdGoods.getSkuName());
|
| | | commonGoods.setPicture(jdGoods.getPicUrl());
|
| | | }
|
| | | }
|
| | | } else if (simpleGoods.getGoodsType() == Constant.SOURCE_TYPE_PDD) {
|
| | | PDDGoodsDetail goods = PinDuoDuoApiUtil.getGoodsDetail(Long.parseLong(simpleGoods.getGoodsId()));
|
| | | if (goods != null) {
|
| | | commonGoods = CommonGoodsFactory.create(goods);
|
| | | } else {
|
| | | goods = PinDuoDuoUtil.getPDDGoodsInfo(simpleGoods.getGoodsId());
|
| | | if (goods != null) {
|
| | | commonGoods = new CommonGoods();
|
| | | commonGoods.setTitle(goods.getGoodsName());
|
| | | commonGoods.setPicture(goods.getGoodsThumbnailUrl());
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | return commonGoods;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 从链接中解析商品ID
|
| | | * |
| | | * @return
|
| | | */
|
| | | public SimpleCommonGoods parseGoodsIdFromLink(String link) {
|
| | |
|
| | | String jdId = parseJDSkuIdFromLink(link);
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(jdId)) {
|
| | | return new SimpleCommonGoods(jdId, Constant.SOURCE_TYPE_JD);
|
| | | }
|
| | |
|
| | | // 解析拼多多
|
| | | String pddId = PinDuoDuoUtil.getPDDGoodsId(link);
|
| | | if (!StringUtil.isNullOrEmpty(pddId)) {
|
| | | return new SimpleCommonGoods(pddId, Constant.SOURCE_TYPE_PDD);
|
| | | }
|
| | | // 解析淘宝
|
| | | String auctionId = parseTBAuctionIdFromLink(link);
|
| | | if (!StringUtil.isNullOrEmpty(auctionId)) {
|
| | | return new SimpleCommonGoods(auctionId, Constant.SOURCE_TYPE_TAOBAO);
|
| | | }
|
| | |
|
| | | return null;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 从链接中解析京东商品的SKUID
|
| | | * |
| | | * @param link
|
| | | * @return
|
| | | */
|
| | | public String parseJDSkuIdFromLink(String link) {
|
| | | // 解析其他商品
|
| | | String jdId = JDUtil.getJDGoodsId(link);
|
| | |
|
| | | // 微信链接
|
| | | if (StringUtil.isNullOrEmpty(jdId)) {
|
| | | jdId = JDUtil.getJDGoodsIdByWeiXin(link);
|
| | | }
|
| | |
|
| | | // 领券短连接
|
| | | if (StringUtil.isNullOrEmpty(jdId) && link.contains("u.jd.com")) {
|
| | | jdId = jdGoodsLinkParseManager.parseGoodsIdByJDShortUrl(link);
|
| | | }
|
| | |
|
| | | return jdId;
|
| | | }
|
| | |
|
| | | public String parseTBAuctionIdFromLink(String link) {
|
| | | TaoBaoGoodsBrief tb = null;
|
| | | String auctionId = null;
|
| | | if (link.startsWith("https://a.m.taobao.com/i"))// 淘宝账号未登录状态
|
| | | {
|
| | | link = link.substring("https://a.m.taobao.com/i".length(), link.indexOf(".htm"));
|
| | | if (NumberUtil.isNumeric(link)) {
|
| | | tb = TaoBaoUtil.isAlimama(link);
|
| | | auctionId = link + "";
|
| | | }
|
| | | } else if (link.contains("ju.taobao.com") || link.contains(".juhuasuan.com")) {// 聚划算
|
| | | int index = link.indexOf("item_id");
|
| | |
| | | else {
|
| | | id = link.substring(link.indexOf("=" + 1));
|
| | | }
|
| | | tb = TaoBaoUtil.isAlimama(id);
|
| | | if (tb == null) {
|
| | | tb = new TaoBaoGoodsBrief(Long.parseLong(id));
|
| | | }
|
| | | auctionId = id;
|
| | | }
|
| | | } else if (link.contains("http://zmnxbc.com")) { // 手机端天猫APP分享
|
| | | tb = TaoBaoUtil.parsePhoneShareUrlByTM(link);
|
| | | if (tb != null)
|
| | | auctionId = tb.getAuctionId() + "";
|
| | | } else if (link.contains("h5.m.taobao") || link.contains("detail.m.tmall") || link.contains("item.taobao")
|
| | | || link.contains("detail.tmall")) { // 手机页面和电脑页面
|
| | | Map<String, String> map = Utils.parseURL(link);
|
| | | String id = "";
|
| | | id = map.get("id").replace("}", "");
|
| | | tb = TaoBaoUtil.isAlimama(id);
|
| | | if (tb == null) {
|
| | | tb = new TaoBaoGoodsBrief(Long.parseLong(id));
|
| | | }
|
| | | auctionId = id;
|
| | | } else if (link.contains("v.douyin.com")) { // 抖音
|
| | | tb = analysisDouYin(link);
|
| | | if (tb != null) {
|
| | | if (!StringUtil.isNullOrEmpty(tb.getAuctionUrl())) {// 抖音解析到淘宝商品链接
|
| | | return parseLink(tb.getAuctionUrl());
|
| | | CommonGoods goods = parseLink(tb.getAuctionUrl());
|
| | | if (goods != null) {
|
| | | auctionId = goods.getGoodsId() + "";
|
| | | }
|
| | | }
|
| | | }
|
| | | } else {
|
| | | tb = TaoBaoUtil.parsePhoneShareUrlByTB(link);
|
| | | if (tb != null)
|
| | | auctionId = tb.getAuctionId() + "";
|
| | | }
|
| | |
|
| | | // 没解析到淘宝相关商品
|
| | | if (tb == null) {
|
| | | String goodsId = TaoBaoUtil.getGoodsIdByPhoneShareUrl(link);
|
| | | if (!StringUtil.isNullOrEmpty(goodsId)) {
|
| | | tb = TaoBaoUtil.isAlimama(goodsId);
|
| | | if (tb == null) {
|
| | | tb = new TaoBaoGoodsBrief(Long.parseLong(goodsId));
|
| | | }
|
| | | }
|
| | | }
|
| | | return auctionId;
|
| | |
|
| | | CommonGoods commonGoods = null;
|
| | |
|
| | | // 淘宝商品解析结束
|
| | | if (tb != null) {
|
| | | if (StringUtil.isNullOrEmpty(tb.getTitle())) {
|
| | | tb = TaoBaoUtil.getTaoBaoGoodsBriefNotInPub(tb.getId());
|
| | | if (tb != null) {
|
| | | commonGoods = new CommonGoods();
|
| | | commonGoods.setPicture(tb.getPictUrl());
|
| | | commonGoods.setTitle(tb.getTitle());
|
| | | }
|
| | | } else {
|
| | | commonGoods = CommonGoodsFactory.create(tb);
|
| | | }
|
| | | } else {
|
| | | // 解析其他商品
|
| | | String jdId = JDUtil.getJDGoodsId(link);
|
| | |
|
| | | // 微信链接
|
| | | if (StringUtil.isNullOrEmpty(jdId)) {
|
| | | jdId = JDUtil.getJDGoodsIdByWeiXin(link);
|
| | | }
|
| | |
|
| | | // 领券短连接
|
| | | if (StringUtil.isNullOrEmpty(jdId) && link.contains("u.jd.com")) {
|
| | | jdId = jdGoodsLinkParseManager.parseGoodsIdByJDShortUrl(link);
|
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(jdId)) {
|
| | | JDGoods goods = JDApiUtil.getGoodsDetail(Long.parseLong(jdId));
|
| | | if (goods != null) {
|
| | | // 高级接口 -- 信息更完整
|
| | | JDGoods jdGoods = JDApiUtil.queryGoodsDetail(Long.parseLong(jdId));
|
| | | if (jdGoods != null) {
|
| | | commonGoods = CommonGoodsFactory.create(jdGoods);
|
| | | } else {
|
| | | commonGoods = CommonGoodsFactory.create(goods);
|
| | | }
|
| | | } else {
|
| | | goods = JDUtil.getSimpleGoodsInfo(jdId);
|
| | | if (goods != null) {
|
| | | commonGoods = new CommonGoods();
|
| | | commonGoods.setTitle(goods.getSkuName());
|
| | | commonGoods.setPicture(goods.getPicUrl());
|
| | | }
|
| | | }
|
| | | } else {
|
| | | String pddId = PinDuoDuoUtil.getPDDGoodsId(link);
|
| | | if (!StringUtil.isNullOrEmpty(pddId)) {
|
| | | PDDGoodsDetail goods = PinDuoDuoApiUtil.getGoodsDetail(Long.parseLong(pddId));
|
| | | if (goods != null) {
|
| | | commonGoods = CommonGoodsFactory.create(goods);
|
| | | } else {
|
| | | goods = PinDuoDuoUtil.getPDDGoodsInfo(pddId);
|
| | | if (goods != null) {
|
| | | commonGoods = new CommonGoods();
|
| | | commonGoods.setTitle(goods.getGoodsName());
|
| | | commonGoods.setPicture(goods.getGoodsThumbnailUrl());
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | return commonGoods;
|
| | | }
|
| | |
|
| | | private CommonGoods parseTaoBaoToken(String token) throws TaoBaoTokenParseException {
|
| | |
| | | return true;
|
| | | return false;
|
| | | }
|
| | |
|
| | | class SimpleCommonGoods {
|
| | | private String goodsId;
|
| | | private int goodsType;
|
| | |
|
| | | public SimpleCommonGoods(String goodsId, int goodsType) {
|
| | | this.goodsId = goodsId;
|
| | | this.goodsType = goodsType;
|
| | | }
|
| | |
|
| | | public String getGoodsId() {
|
| | | return goodsId;
|
| | | }
|
| | |
|
| | | public void setGoodsId(String goodsId) {
|
| | | this.goodsId = goodsId;
|
| | | }
|
| | |
|
| | | public int getGoodsType() {
|
| | | return goodsType;
|
| | | }
|
| | |
|
| | | public void setGoodsType(int goodsType) {
|
| | | this.goodsType = goodsType;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | public String convertLinkFromText(String text, Long uid, boolean share)
|
| | | throws ConvertLinkExceptionException, Exception {
|
| | | String newText = convertJDLinkFromText(text, uid, share);
|
| | | newText = convertPDDLinkFromText(text, uid, share);
|
| | | newText = convertPDDLinkFromText(newText, uid, share);
|
| | | newText = convertTBLinkFromText(newText, uid, share);
|
| | | if (text.equalsIgnoreCase(newText))
|
| | | throw new ConvertLinkExceptionException(ConvertLinkExceptionException.CODE_NONE, "不包含可转链的口令与链接");
|
| | |
| | | import com.aliyun.openservices.ons.api.Message;
|
| | | import com.aliyun.openservices.ons.api.MessageListener;
|
| | | import com.aliyun.openservices.ons.api.Producer;
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dto.mq.order.OrderTopicTagEnum;
|
| | | import com.yeshi.fanli.dto.mq.order.body.OrderMoneyRecievedMQMsg;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | |
| | | mainHongBaoId = v2.getParent().getId();
|
| | | HongBaoOrder hongBaoOrder = hongBaoOrderService.selectDetailByHongBaoId(mainHongBaoId);
|
| | | if (hongBaoOrder != null && hongBaoOrder.getCommonOrder() != null) {
|
| | | // 按订单号与用户统计资金
|
| | | String mapKey = String.format("%s#%s#%s#%s", hongBaoOrder.getCommonOrder().getOrderNo(),
|
| | | hongBaoOrder.getCommonOrder().getSourceType(), v2.getUserInfo().getId(),
|
| | | getHongBaoType(v2.getType()));
|
| | |
| | | OrderMoneyRecievedMQMsg msg = new OrderMoneyRecievedMQMsg(Integer.parseInt(type),
|
| | | Long.parseLong(uid), Integer.parseInt(sourceType), orderNo, moneyMap.get(mapKey),
|
| | | new Date(), 0);
|
| | | LogHelper.test(String.format("批量返利到账订单分发:\n key值:%s \n 内容:", key, new Gson().toJson(msg)));
|
| | | producer.send(MQMsgBodyFactory.create(MQTopicName.TOPIC_ORDER,
|
| | | OrderTopicTagEnum.orderFanLiSeparateByOrderNo, msg));
|
| | | }
|
| | |
| | | import org.jsoup.nodes.Document;
|
| | | import org.jsoup.nodes.Element;
|
| | | import org.jsoup.select.Elements;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | |
|
| | | import com.yeshi.fanli.dto.dataoke.DingDongQiangDTO;
|
| | | import com.yeshi.fanli.dto.dataoke.DingDongTime;
|
| | |
| | | String desc = detail.getDtitle();
|
| | | desc += "\n";
|
| | | desc += String.format("券后价%s【%s元】包邮秒杀 ", Math.random() > 0.5 ? "💰" : "",
|
| | | MoneyBigDecimalUtil.getWithNoZera(detail.getActualPrice() ).toString())
|
| | | MoneyBigDecimalUtil.getWithNoZera(detail.getActualPrice()).toString())
|
| | | + (Math.random() > 0.5 ? getRandomCommonEmoji() : "");
|
| | | desc += "\n";
|
| | | // desc += detail.getIntroduce();
|
| | | String introduce = detail.getDesc().replace(",", ",").replace("。", ",").replace("!", ",").replace(",",
|
| | | ",");
|
| | | String introduce = detail.getDesc().replace(",", ",").replace("。", ",").replace("!", ",").replace(",", ",");
|
| | | introduce = introduce.replace(",,,", ",").replace(",,", ",");
|
| | |
|
| | | String[] sts = introduce.split(",");
|
| | |
| | | desc += introduce;
|
| | | return desc;
|
| | | }
|
| | |
|
| | |
|
| | | public static TaoBaoGoodsBrief filterTaoBaoGoods(TaoBaoGoodsBrief goods, DaTaoKeDetailV2 detail) {
|
| | | if (detail != null && goods != null) {
|
| | |
| | | return list;
|
| | | }
|
| | |
|
| | | // 获取推广文案
|
| | | public static void getPublishDoc(String id) {
|
| | | String url = String.format("http://www.dataoke.com/detailtpl?gid=%s&type=1", id);
|
| | | String response = HttpUtil.get(url);
|
| | | try {
|
| | | JSONObject json = JSONObject.fromObject(new String(response.getBytes("ISO-8859-1"), "UTF-8"));
|
| | | JSONObject data = json.optJSONObject("data");
|
| | | String tpl2 = data.optString("tpl2");
|
| | | tpl2 = tpl2.substring(0, tpl2.indexOf("---------"));
|
| | | System.out.println(tpl2.replace("</br>", "\n").trim());
|
| | | } catch (Exception e) {
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | try {
|
| | | setOrderBy(map.get(orderId));
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e, "订单号:" + orderId, "订单排序值灰度测试");
|
| | | // LogHelper.errorDetailInfo(e, "订单号:" + orderId, "订单排序值灰度测试");
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | |
| | | if (elements.size() >= 0) {
|
| | | for (int i = 0; i < elements.size(); i++) {
|
| | | String content = elements.get(i).toString();
|
| | | if (content.contains("var _DATA_Mdskip")) {
|
| | | if (content.contains("var _DATA_Detail")) {
|
| | | content = content.replace("<script>", "");
|
| | | content = content.replace("</script>", "");
|
| | |
|
| | | if (content.contains("videoDetail")) {
|
| | | content += ";function getData(){ var json={title:_DATA_Mdskip.item.title,pictUrl:_DATA_Mdskip.item.videoDetail.videoThumbnailURL}; return JSON.stringify(json);}";
|
| | | content += ";function getData(){ var json={title:_DATA_Detail.item.title,pictUrl:_DATA_Detail.item.images[0]}; return JSON.stringify(json);}";
|
| | | } else {
|
| | | content += ";function getData(){ var json={title:_DATA_Mdskip.item.title,pictUrl:_DATA_Mdskip.item.videos[0].videoThumbnailURL}; return JSON.stringify(json);}";
|
| | | content += ";function getData(){ var json={title:_DATA_Detail.item.title,pictUrl:_DATA_Detail.item.images[0]}; return JSON.stringify(json);}";
|
| | | }
|
| | |
|
| | | ScriptEngineManager manager = new ScriptEngineManager();
|
| | |
| | | taoBaoGoodsBrief = new TaoBaoGoodsBrief();
|
| | | taoBaoGoodsBrief.setTitle(title.toString());
|
| | | taoBaoGoodsBrief.setPictUrl(pictUrl.toString());
|
| | | if (!pictUrl.toString().startsWith("http")) {
|
| | | taoBaoGoodsBrief.setPictUrl(TbImgUtil.getTBSize220Img("http:" + pictUrl.toString()));
|
| | | }
|
| | | }
|
| | |
|
| | | break;
|