| | |
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgDeviceReadState;
|
| | | import com.yeshi.fanli.entity.bus.user.UserActiveLog;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.entity.config.AppHomeFloatImg;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.entity.taobao.ClientTBPid;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.TBPidService;
|
| | | import com.yeshi.fanli.service.inter.user.UserActiveLogService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.notify.UserActivedRecordService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.vo.user.UserDialogBtnVO;
|
| | | import com.yeshi.fanli.vo.user.UserDialogVO;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private UserActiveLogService userActiveLogService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private SwiperPictureService swiperPictureService;
|
| | |
|
| | | @Resource
|
| | | private UserActivedRecordService userActivedRecordService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | |
|
| | | /**
|
| | | * s 首页配置信息
|
| | |
| | | if (!StringUtil.isNullOrEmpty(notifyImg)) {
|
| | | data.put("floatNotifyImg", notifyImg);
|
| | | }
|
| | |
|
| | |
|
| | | // 无新人弹框 则查询默认
|
| | | FloatAD floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_INDEX, 0);
|
| | |
| | | } else {// 老人
|
| | | data.put("userTimeType", 1);
|
| | | }
|
| | | data.put("hotFuctionLink",
|
| | | configService.getByVersion(ConfigKeyEnum.hotFunctionUrl.getKey(), platform, Integer.parseInt(acceptData.getVersion())));//
|
| | | data.put("hotFuctionLink", configService.getByVersion(ConfigKeyEnum.hotFunctionUrl.getKey(), platform,
|
| | | Integer.parseInt(acceptData.getVersion())));//
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | // 是否需要购物城转链
|
| | | boolean convert = "0".equalsIgnoreCase(configService.get(ConfigKeyEnum.showTaobaoCartConvert.getKey())) ? false : true;
|
| | | boolean convert = "0".equalsIgnoreCase(configService.get(ConfigKeyEnum.showTaobaoCartConvert.getKey())) ? false
|
| | | : true;
|
| | |
|
| | | if (!"cart".equalsIgnoreCase(position) && !convert) {
|
| | | out.print(JsonUtil.loadFalseResult(""));
|
| | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 关闭提醒
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param id
|
| | | * @param type
|
| | | * 0-关闭 1-点击右边按钮 2-点击左边按钮
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "closeDialogNotify", method = RequestMethod.POST)
|
| | | public void closeDialogNotify(AcceptData acceptData, Long uid, String id, int type, PrintWriter out) {
|
| | |
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | | }
|
| | | if (StringUtil.isNullOrEmpty(id)) {
|
| | | out.print(JsonUtil.loadFalseResult("id为空"));
|
| | | return;
|
| | | }
|
| | | if (id.equalsIgnoreCase("tearcherNotify")) {
|
| | | userActivedRecordService.setTearcherNotified(uid);
|
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | | } else {
|
| | | out.print(JsonUtil.loadFalseResult("id不存在"));
|
| | | }
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "getUserConfig", method = RequestMethod.POST)
|
| | | public void getUserConfig(AcceptData acceptData, PrintWriter out) {
|
| | | public void getUserConfig(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | try {
|
| | | // 用户协议链接
|
| | | String serviceProtocol = configService.get(ConfigKeyEnum.serviceProtocolLink.getKey());
|
| | |
| | | data.put("serviceProtocolLink", serviceProtocol);
|
| | | data.put("privacyProtocolLink", privacyProtocol);
|
| | | // 购物车跳转方式(包含jumpDetail与params)
|
| | | JSONObject source = JSONObject.fromObject(configService.getByVersion(ConfigKeyEnum.taobaoCartJumpDetail.getKey(),
|
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion())));
|
| | | JSONObject source = JSONObject
|
| | | .fromObject(configService.getByVersion(ConfigKeyEnum.taobaoCartJumpDetail.getKey(),
|
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion())));
|
| | | data.put("taoBaoCart", source);
|
| | | |
| | |
|
| | | if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | // 我的界面banner
|
| | | List<SwiperPicture> banner = swiperPictureService.getByBannerCardAndVersion("my_interface_banner",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | List<SwiperPicture> banner = swiperPictureService.getByBannerCardAndVersion("my_interface_banner",
|
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | if (banner == null)
|
| | | banner = new ArrayList<SwiperPicture>();
|
| | | data.put("banner", JsonUtil.getApiCommonGson().toJson(banner));
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | if (VersionUtil.greaterThan_2_0_7(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | // 转链的网页链接
|
| | | String convertLinkUrl = configService.get(ConfigKeyEnum.convertDocWebLink.getKey());
|
| | | data.put("convertLinkUrl", convertLinkUrl);
|
| | | if (uid != null) {
|
| | |
|
| | | String tearcherLink = configService.getByVersion(ConfigKeyEnum.tearcherLink.getKey(),
|
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | if (userActivedRecordService.canNotifyAddTearcher(uid)) {
|
| | | UserInfo userInfo = userInfoService.selectAvailableByPrimaryKey(uid);
|
| | | if (userInfo != null) {
|
| | | JumpDetailV2 jumpDetail = jumpDetailV2Service.getByTypeCache("web",
|
| | | Constant.getPlatformCode(acceptData.getPlatform()),
|
| | | Integer.parseInt(acceptData.getVersion()));
|
| | |
|
| | | JSONObject negativeParams = new JSONObject();
|
| | | negativeParams.put("url", configService.getByVersion(ConfigKeyEnum.newerGonglue.getKey(),
|
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion())));
|
| | |
|
| | | JSONObject positiveParams = new JSONObject();
|
| | | positiveParams.put("url", tearcherLink);
|
| | |
|
| | | UserDialogVO dialog = new UserDialogVO("tearcherNotify", true,
|
| | | "HI," + userInfo.getNickName(),
|
| | | "我是你的导师,为你在省赚过程中解难答疑,对你一对一辅导,倾听你的需求总结并反馈给板栗快省官方运营团队,快来添加我吧。",
|
| | | new UserDialogBtnVO("复制导师微信", jumpDetail, positiveParams),
|
| | | new UserDialogBtnVO("去新手攻略", jumpDetail, negativeParams));
|
| | | data.put("dialog", dialog);
|
| | | }
|
| | | }
|
| | |
|
| | | data.put("tearcherLink", tearcherLink);
|
| | | }
|
| | |
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | |
| | | public void getOrderConfig(AcceptData acceptData, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | // 测试
|
| | | data.put("showTaoBaoOrder", "0".equalsIgnoreCase(configService.get(ConfigKeyEnum.showTaobaoOrder.getKey()).trim()) ? false : true);
|
| | | data.put("showTaoBaoOrder",
|
| | | "0".equalsIgnoreCase(configService.get(ConfigKeyEnum.showTaobaoOrder.getKey()).trim()) ? false : true);
|
| | | data.put("taoBaoOrderUrl", "https://main.m.taobao.com/olist/index.html");
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestSerializableByKey;
|
| | |
|
| | |
| | | data.put("activityRules", valueBr);
|
| | | data.put("inviteList", String.format("http://%s/%s/client/share/friends_new.html",
|
| | | Constant.systemCommonConfig.getProjectHost(), Constant.systemCommonConfig.getProjectName()));
|
| | | List<SwiperPicture> pictureList = swiperPictureService.getByBannerCardAndVersion("invite_top_banner",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | List<SwiperPicture> pictureList = swiperPictureService.getByBannerCardAndVersion("invite_top_banner",
|
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | if (pictureList != null && pictureList.size() > 0) {
|
| | | SwiperPicture picture = pictureList.get(0);
|
| | | com.alibaba.fastjson.JSONObject pictureJson = new com.alibaba.fastjson.JSONObject();
|
| | |
| | | }
|
| | |
|
| | | // 邀请链接
|
| | | // String shortLink = HttpUtil.getShortLink("http://" + Constant.wxGZConfig.getLoginHost() + "/"
|
| | | // + Constant.systemCommonConfig.getProjectName() + "/client/threeShareNew?uid=" + uid);
|
| | | // String shortLink = HttpUtil.getShortLink("http://" +
|
| | | // Constant.wxGZConfig.getLoginHost() + "/"
|
| | | // + Constant.systemCommonConfig.getProjectName() +
|
| | | // "/client/threeShareNew?uid=" + uid);
|
| | | data.put("inviteLink", "http://a.app.qq.com/o/simple.jsp?pkgname=com.yeshi.ec.rebate");
|
| | |
|
| | | String inviteCode = userInfoExtraService.getInviteCodeByUid(uid);
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("激活失败"));
|
| | | return;
|
| | | }
|
| | | if (VersionUtil.greaterThan_2_0_7(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | String myInviteCode = userInfoExtraService.getInviteCodeByUid(uid);
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("inviteCode", myInviteCode);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("邀请码激活成功"));
|
| | | } else
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("邀请码激活成功"));
|
| | |
|
| | | } catch (UserInfoExtraException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | |
| | | try {
|
| | | userInfoExtraService.activationInviteWX(
|
| | | Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion()), uid, code);
|
| | | out.print(JsonUtil.loadTrueResult("邀请码激活成功"));
|
| | |
|
| | | if (VersionUtil.greaterThan_2_0_7(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | String myInviteCode = userInfoExtraService.getInviteCodeByUid(uid);
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("inviteCode", myInviteCode);
|
| | | JsonUtil.printMode(out, "", JsonUtil.loadTrueResult(data));
|
| | | } else
|
| | | out.print(JsonUtil.loadTrueResult("邀请码激活成功"));
|
| | | } catch (UserInfoExtraException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (Exception e) {
|
| | |
| | | import com.yeshi.fanli.dto.HongBaoDTO;
|
| | | import com.yeshi.fanli.dto.money.AccountDetails;
|
| | | import com.yeshi.fanli.dto.order.OrderItem;
|
| | | import com.yeshi.fanli.dto.user.UserInviteLevelEnum;
|
| | | import com.yeshi.fanli.dto.wx.WXAccountInfoDTO;
|
| | | import com.yeshi.fanli.entity.AppVersionInfo;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.UserShareGoodsRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleExtraInfoSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.invite.UserInviteService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVipConfigService;
|
| | | import com.yeshi.fanli.util.AESUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserVIPInfoService userVIPInfoService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserVipConfigService userVipConfigService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private RedPackForbidService redPackForbidService;
|
| | |
|
| | | private static final String EXTRACT_MIN_MONEY = ConfigKeyEnum.extractMoneyMin.getKey(); |
| | | @Resource
|
| | | private UserInviteService userInviteService;
|
| | |
|
| | | private static final String EXTRACT_MIN_MONEY = ConfigKeyEnum.extractMoneyMin.getKey();
|
| | | private static final String EXTRACT_MAX_MONEY = ConfigKeyEnum.extractMoneyMAX.getKey();
|
| | |
|
| | | /**
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | |
| | | if (!Constant.IS_TEST) {
|
| | | // 判断手机验证码的正确性
|
| | | String oldCode = redisManager.getSMSVCode(user.getPhone(), SMSHistory.TYPE_LOGIN);
|
| | |
| | | tailor = true;
|
| | | invitCode = userInfoExtra.getInviteCode();
|
| | | }
|
| | | |
| | |
|
| | | if (userInfoExtra.getUserRank() != null) {
|
| | | String picture = userInfoExtra.getUserRank().getPicture();
|
| | | String icon = userInfoExtra.getUserRank().getIcon();
|
| | |
| | | if (!StringUtil.isNullOrEmpty(userInfoExtra.getWeiXin()))
|
| | | userInfo.setWeiXin(userInfoExtra.getWeiXin());
|
| | | }
|
| | | |
| | |
|
| | | // 二维码
|
| | | userInfo.setErCode(userInfoExtra.getErCode());
|
| | | }
|
| | | // 显示邀请码特制入口
|
| | | data.put("tailor", tailor);
|
| | | |
| | |
|
| | | // 1.6.5 之后返回 微信号提示
|
| | | if (VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | userInfo.setWeiXinTip("添加微信号后,你的邀请人和直接粉丝可以通过微信与你建立联系。");
|
| | |
| | | // 查询是否为VIP
|
| | | if (VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | userInfo.setVip(userVIPInfoService.isVIP(uid));
|
| | | |
| | |
|
| | | boolean verifyForbid = redPackForbidService.verifyForbid(uid);
|
| | | data.put("redPackLock", verifyForbid);
|
| | | }
|
| | |
| | | bindPhone = bindRemindService.bindRemind(uid, BindRemind.TYPE_PHONE);
|
| | | data.put("bindPhone", bindPhone);
|
| | | }
|
| | | |
| | | if (!StringUtil.isNullOrEmpty(invitCode)) {
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(invitCode)) {
|
| | | // 2.0.6 返回邀请人
|
| | | if (VersionUtil.greaterThan_2_0_6(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | String bossName = "";
|
| | |
| | | data.put("bossName", bossName);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | if (VersionUtil.greaterThan_2_0_7(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | JSONObject inviteLevel = new JSONObject();
|
| | | UserInviteLevelEnum level = userInviteService.getUserInviteLevel(uid);
|
| | | inviteLevel.put("level", level.name());
|
| | | inviteLevel.put("link", level.getLink());
|
| | | data.put("inviteLevel", inviteLevel);
|
| | | }
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
|
| | | final UserInfo uuser = userInfo;
|
| | |
| | | return;
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | // 二维码
|
| | | if (qrCodeFile != null) {
|
| | | userInfoExtraService.uploadERCode(qrCodeFile, uid);
|
| | | }
|
| | | |
| | | |
| | | |
| | |
|
| | | out.print(JsonUtil.loadTrueResult("保存成功"));
|
| | | } catch (UserInfoException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getMsg()));
|
| | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "getUserConfig", method = RequestMethod.POST)
|
| | | public void getUserConfig(AcceptData acceptData, PrintWriter out) {
|
| | | try {
|
| | | // 用户协议链接
|
| | | String serviceProtocol = configService.get(ConfigKeyEnum.serviceProtocolLink.getKey());
|
| | | // 隐私条款链接
|
| | | String privacyProtocol = configService.get(ConfigKeyEnum.privacyProtocolLink.getKey());
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("serviceProtocolLink", serviceProtocol);
|
| | | data.put("privacyProtocolLink", privacyProtocol);
|
| | | // 购物车跳转方式(包含jumpDetail与params)
|
| | | JSONObject source = JSONObject.fromObject(configService.get(ConfigKeyEnum.taobaoCartJumpDetail.getKey()));
|
| | | data.put("taoBaoCart", source);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("获取失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | | * 订单解析配置
|
| | | * |
| | | * @param acceptData
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getOrderParseConfig", method = RequestMethod.POST)
|
| | | public void getOrderParseConfig(AcceptData acceptData, int type, PrintWriter out) {
|
| | |
|
| | | switch (type) {
|
| | | case Constant.SOURCE_TYPE_TAOBAO:
|
| | | if ("0".equalsIgnoreCase(configService.get(ConfigKeyEnum.autoFindTaobaoOrder.getKey())))
|
| | | out.print(JsonUtil.loadFalseResult(1, "暂不支持"));
|
| | | else {
|
| | | String orderJS = configService.get(ConfigKeyEnum.taobaoOrderParseJS.getKey());
|
| | | JSONObject data = new JSONObject();
|
| | | try {
|
| | | data.put("orderJS", DESUtil.encode(orderJS, StringUtil.getBase64String("YeShiFANLI889*+"),
|
| | | StringUtil.getBase64String("*M#34f?,")));
|
| | | data.put("orderUrl",
|
| | | DESUtil.encode("https://buyertrade.taobao.com/trade/itemlist/list_bought_items.htm",
|
| | | StringUtil.getBase64String("YeShiFANLI889*+"),
|
| | | StringUtil.getBase64String("*M#34f?,")));
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | break;
|
| | |
|
| | | case Constant.SOURCE_TYPE_JD: {
|
| | |
|
| | | }
|
| | | break;
|
| | |
|
| | | case Constant.SOURCE_TYPE_PDD: {
|
| | |
|
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取订单配置
|
| | | *
|
| | |
| | | data.put("words", configService.get(ConfigKeyEnum.articleHotWords.getKey()));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | //发圈测试
|
| | | @RequestMapping(value = "evaluate", method = RequestMethod.POST)
|
| | | public void evaluate(AcceptData acceptData, PrintWriter out) {
|
| | | out.print(configService.get("test"));
|
| | |
|
| | | // //发圈测试
|
| | | public void evaluateTest(AcceptData acceptData, PrintWriter out) {
|
| | | JSONObject data = JSONObject.fromObject(configService.get("test"));
|
| | | out.print(data.toString());
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | */
|
| | | @RequestMapping(value = "evaluate", method = RequestMethod.POST)
|
| | | public void evaluate(AcceptData acceptData, Integer page, PrintWriter out) {
|
| | | if ("1".equalsIgnoreCase(configService.get("test-open"))) {
|
| | | evaluateTest(acceptData, out);
|
| | | return;
|
| | | }
|
| | |
|
| | | long cid = 1;
|
| | | long subId = 1;
|
| | | List<DynamicInfo> listd = dynamicInfoService.queryV2(2, 74, (page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE,
|
| | |
| | |
|
| | | List<GoodsEvaluate> list = new ArrayList<>();
|
| | |
|
| | | int p = 0;
|
| | | for (DynamicInfo info : listd) {
|
| | | p++;
|
| | |
|
| | | GoodsEvaluate goodsEvaluate = new GoodsEvaluate();
|
| | | goodsEvaluate.setId(info.getId());
|
| | | ActivityUser user = info.getUser();
|
| | |
| | |
|
| | | List<ImgInfo> imgList = new ArrayList<>();
|
| | | int i = 0;
|
| | |
|
| | | for (GoodsPicture goodsPicture : imgs) {
|
| | | ImgInfo imgInfo = new ImgInfo();
|
| | | GoodsDetailVO goodsVO = goodsPicture.getGoodsVO();
|
| | |
| | |
|
| | | imgInfo.setLarge(false);
|
| | | imgInfo.setUrl(goodsPicture.getUrl());
|
| | | imgInfo.setUrlHD(goodsPicture.getUrl());
|
| | | imgInfo.setUrlHD(goodsPicture.getUrl());
|
| | |
|
| | | // if (i == 0) {
|
| | | // imgInfo.setUrl(goodsPicture.getUrl());
|
| | | // imgInfo.setType(ImgEnum.video);
|
| | | // imgInfo.setLarge(true);
|
| | | // imgInfo.setVideoUrl(
|
| | | // "http://pgcvideo.cdn.xiaodutv.com/754825344_367171606_2020010816001720200108174342.mp4?Cache-Control=max-age%3D8640000&responseExpires=Fri%2C+17+Apr+2020+18%3A11%3A55+GMT&xcode=0b0f3962eddaf66837d4af61a22c57bae3a5055540c75232&time=1579077845&_=1578992502888");
|
| | | // } else {
|
| | | // imgInfo.setType(ImgEnum.img);
|
| | | // imgInfo.setLarge(true);
|
| | | // imgInfo.setUrl(goodsPicture.getUrl());
|
| | | // }
|
| | | // i++;
|
| | | // if (i == 0) {
|
| | | // imgInfo.setUrl(goodsPicture.getUrl());
|
| | | // imgInfo.setType(ImgEnum.video);
|
| | | // imgInfo.setLarge(true);
|
| | | // imgInfo.setVideoUrl(
|
| | | // "http://pgcvideo.cdn.xiaodutv.com/754825344_367171606_2020010816001720200108174342.mp4?Cache-Control=max-age%3D8640000&responseExpires=Fri%2C+17+Apr+2020+18%3A11%3A55+GMT&xcode=0b0f3962eddaf66837d4af61a22c57bae3a5055540c75232&time=1579077845&_=1578992502888");
|
| | | // } else {
|
| | | // imgInfo.setType(ImgEnum.img);
|
| | | // imgInfo.setLarge(true);
|
| | | // imgInfo.setUrl(goodsPicture.getUrl());
|
| | | // }
|
| | | // i++;
|
| | |
|
| | | imgList.add(imgInfo);
|
| | | }
|
| | |
|
| | | if (p == 1) {
|
| | | ImgInfo imgInfo = new ImgInfo();
|
| | | imgInfo.setLarge(true);
|
| | | imgInfo.setType(ImgEnum.img);
|
| | | imgInfo.setUrl(
|
| | | "http://ec-1255749512.file.myqcloud.com/img/invite/new/10ea86eb8db94f7cbb5e68864480d5fe.jpg");
|
| | | imgInfo.setH(1334);
|
| | | imgInfo.setW(750);
|
| | | imgList.add(0, imgInfo);
|
| | |
|
| | | imgInfo = new ImgInfo();
|
| | | imgInfo.setType(ImgEnum.video);
|
| | | imgInfo.setLarge(true);
|
| | | imgInfo.setUrl(
|
| | | "http://ec-1255749512.file.myqcloud.com/img/invite/new/10ea86eb8db94f7cbb5e68864480d5fe.jpg");
|
| | | imgInfo.setH(315);
|
| | | imgInfo.setW(560);
|
| | | imgInfo.setUrl("https://zzya.beva.cn/img/Fr56bczo_F8NvroeG54jLH5ey0aC.jpg");
|
| | | imgInfo.setVideoUrl("http://img.flqapp.com/resource/video.mp4");
|
| | | imgList.add(0, imgInfo);
|
| | |
|
| | | }
|
| | |
|
| | | goodsEvaluate.setImgList(imgList);
|
| | |
| | | commentInfo.setContent("😆7.9元🉐1只儿童牙刷!!安妮贝拉卡通版儿童牙⭕PBT材质,毛刷细腻柔⭕外观卡通人物造型设计");
|
| | | commentInfo.setType(CommentInfoEnum.goodsCoupon);
|
| | |
|
| | | // ClientTextStyleVO text1 = new ClientTextStyleVO();
|
| | | // text1.setContent("猫超");
|
| | | // text1.setColor("#1D9B31");
|
| | | // |
| | | // ClientTextStyleVO text2 = new ClientTextStyleVO();
|
| | | // text2.setContent("满150减15");
|
| | | // text2.setColor("#E5005C");
|
| | | // List<ClientTextStyleVO> tagList = new ArrayList<>(); |
| | | // tagList.add(text1);
|
| | | // tagList.add(text2);
|
| | | // commentInfo.setTagList(tagList);
|
| | | // commentInfo.setTagDesc("除生鲜及部分酒水除生鲜及除生鲜及");
|
| | | // ClientTextStyleVO text1 = new ClientTextStyleVO();
|
| | | // text1.setContent("猫超");
|
| | | // text1.setColor("#1D9B31");
|
| | | //
|
| | | // ClientTextStyleVO text2 = new ClientTextStyleVO();
|
| | | // text2.setContent("满150减15");
|
| | | // text2.setColor("#E5005C");
|
| | | // List<ClientTextStyleVO> tagList = new ArrayList<>();
|
| | | // tagList.add(text1);
|
| | | // tagList.add(text2);
|
| | | // commentInfo.setTagList(tagList);
|
| | | // commentInfo.setTagDesc("除生鲜及部分酒水除生鲜及除生鲜及");
|
| | |
|
| | | CommentInfo commentInfo2 = new CommentInfo();
|
| | | commentInfo2.setContent("😆7.9元🉐1只儿童牙刷!!安妮贝拉卡通版儿童牙⭕PBT材质,毛刷细腻柔⭕外观卡通人物造型设计");
|
| | |
| | | list.add(goodsEvaluate);
|
| | | }
|
| | |
|
| | | // List<GoodsEvaluate> list = goodsEvaluateService.queryValidEvaluateCache((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE);
|
| | | // if (list == null) {
|
| | | // list = new ArrayList<>();
|
| | | // }
|
| | | // List<GoodsEvaluate> list =
|
| | | // goodsEvaluateService.queryValidEvaluateCache((page - 1) *
|
| | | // Constant.PAGE_SIZE, Constant.PAGE_SIZE);
|
| | | // if (list == null) {
|
| | | // list = new ArrayList<>();
|
| | | // }
|
| | |
|
| | | GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
|
| | | gsonBuilder.registerTypeAdapter(CommentInfoEnum.class, new JsonSerializer<CommentInfoEnum>() {
|
| | |
| | | }
|
| | |
|
| | | @RequestMapping(value = "evaluateShare", method = RequestMethod.POST)
|
| | | public void evaluateShare(AcceptData acceptData, Long uid, String id, Integer type, Long goodsId, Integer goodsType, PrintWriter out) {
|
| | | public void evaluateShare(AcceptData acceptData, Long uid, String id, Integer type, Long goodsId, Integer goodsType,
|
| | | PrintWriter out) {
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | if (StringUtil.isNullOrEmpty(id) || type == null) {
|
| | | out.print(JsonUtil.loadFalseResult("传递参数不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | if (type == 1 && (goodsId == null || goodsType == null)) {
|
| | | out.print(JsonUtil.loadFalseResult("商品参数不能为空"));
|
| | | return;
|
| | |
| | | out.print(JsonUtil.loadFalseResult("该图片内容已不存在"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | int total = 0;
|
| | | for (GoodsPicture goodsPicture : imgs) {
|
| | | GoodsDetailVO goodsVO = goodsPicture.getGoodsVO();
|
| | | if (goodsVO != null) {
|
| | | total ++;
|
| | | total++;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | list.add(goodsPicture.getUrl());
|
| | | continue;
|
| | | }
|
| | | |
| | |
|
| | | if (type == 1) {
|
| | | if (goodsVO.getGoodsId().longValue() == goodsId.longValue() && goodsVO.getGoodsType() == goodsType.intValue()) {
|
| | | if (goodsVO.getGoodsId().longValue() == goodsId.longValue()
|
| | | && goodsVO.getGoodsType() == goodsType.intValue()) {
|
| | | String jumpLink = getJumpLink(goodsVO, user);
|
| | | if (!StringUtil.isNullOrEmpty(jumpLink)) {
|
| | | list.add(jumpLink);
|
| | |
| | | out.print(JsonUtil.loadFalseResult("该信息已下架"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", shareCount);
|
| | | data.put("list", list);
|
| | |
| | | }
|
| | | } else if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_JD) {
|
| | | JDGoods jdGoods = jdGoodsCacheUtil.getGoodsInfo(goodsVO.getGoodsId());
|
| | | if (jdGoods == null ) {
|
| | | if (jdGoods == null) {
|
| | | return null;
|
| | | }
|
| | | |
| | |
|
| | | String couponUrl = null;
|
| | | JDCouponInfo couponInfo = JDUtil.getShowCouponInfo(jdGoods);
|
| | | if (couponInfo != null) {
|
| | |
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "",
|
| | | user.getId() + "");
|
| | | } else if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_PDD) {
|
| | | jumpLink = PinDuoDuoApiUtil.getPromotionUrl(goodsVO.getGoodsId(), PinDuoDuoApiUtil.PID_SHARE + "", user.getId() + "");
|
| | | jumpLink = PinDuoDuoApiUtil.getPromotionUrl(goodsVO.getGoodsId(), PinDuoDuoApiUtil.PID_SHARE + "",
|
| | | user.getId() + "");
|
| | | }
|
| | | FileUploadResult uploadResult = qrCodeService.drawGoodsPoster(jumpLink, user.getPortrait(), goodsVO);
|
| | | if (uploadResult != null) {
|
| | |
| | | }
|
| | | return null;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 评论复制
|
| | | * 评论复制
|
| | | * |
| | | * @param acceptData
|
| | | * @param id
|
| | | * @param cid 评论id
|
| | | * @param cid
|
| | | * 评论id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "evaluateComment", method = RequestMethod.POST)
|
| | |
| | | out.print(JsonUtil.loadFalseResult("id不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | DynamicInfo dynamicInfo = dynamicInfoService.getById(id);
|
| | | if (dynamicInfo == null) {
|
| | | out.print(JsonUtil.loadFalseResult("该内容已不存在"));
|
| | |
| | | out.print(JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | UserExtraTaoBaoInfo taoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid);
|
| | | String relationId = null;
|
| | | if (taoBaoInfo != null && taoBaoInfo.getRelationId() != null && taoBaoInfo.getRelationValid() != null
|
| | |
| | | out.print(JsonUtil.loadFalseResult(2, "淘宝未授权,请前往\"我的\"绑定淘宝账号"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("text", "安妮贝拉卡通版儿拉卡通版拉卡通版拉卡通版拉卡通版拉卡通版拉卡通版拉卡通版");
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
| | |
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate());
|
| | |
|
| | | GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO);
|
| | | if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
|
| | |
| | | goodsDetail.getMoneyInfo().setShareMoney(
|
| | | "¥" + TaoBaoUtil.getGoodsHongBaoMoney(goods, hongBaoManageService.getVIPShareRate()));
|
| | | goodsDetail.getMoneyInfo().setRateInfo(goodsDetail.getMoneyInfo().getMaxRateInfo());
|
| | | goodsDetail.getMoneyInfo().setCompositionInfo(goodsDetail.getMoneyInfo().getMaxCompositionInfo());
|
| | | }
|
| | | goodsDetail.getMoneyInfo()
|
| | | .setRateInfoHelpUrl(configService.get(ConfigKeyEnum.goodsDetailFanliRateHelpUrl.getKey()));
|
| | |
| | | * @param from
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getDetailJD", method = RequestMethod.POST)
|
| | | @RequestMapping(value = "getDetailJD")
|
| | | public void getDetialJD(AcceptData acceptData, Long id, Long uid, String from, PrintWriter out) {
|
| | | // uid=2255993L;
|
| | | // 系统验证
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | |
| | |
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate());
|
| | | GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertJDGoods(jdGoods, paramsDTO);
|
| | | if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
|
| | | goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney());
|
| | | goodsDetail.getMoneyInfo()
|
| | | .setShareMoney("¥" + JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getVIPShareRate()));
|
| | | goodsDetail.getMoneyInfo().setRateInfo(goodsDetail.getMoneyInfo().getMaxRateInfo());
|
| | | goodsDetail.getMoneyInfo().setCompositionInfo(goodsDetail.getMoneyInfo().getMaxCompositionInfo());
|
| | | }
|
| | | goodsDetail.getMoneyInfo()
|
| | | .setRateInfoHelpUrl(configService.get(ConfigKeyEnum.goodsDetailFanliRateHelpUrl.getKey()));
|
| | |
| | | rewardCoupon.setDesc("用返利奖励券最高返");
|
| | | }
|
| | | rewardCoupon.setParams(params1.toString());
|
| | | |
| | |
|
| | | otherInfo.setRewardCoupon(rewardCoupon);
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform())
|
| | | && configService.iosOnLining(Integer.parseInt(acceptData.getVersion())))
|
| | | otherInfo.setRewardCoupon(null);
|
| | | |
| | |
|
| | | goodsDetail.setOtherInfo(otherInfo);
|
| | |
|
| | | CouponInfoVO couponInfo = goodsDetail.getCouponInfo();
|
| | |
| | | out.print(JsonUtil.loadTrueResult(object.toString()));
|
| | |
|
| | | final JDGoods goods = jdGoods;
|
| | | final Long fuid=uid;
|
| | | ThreadUtil.run(new Runnable() {
|
| | | public void run() {
|
| | | // 添加浏览记录
|
| | | try {
|
| | | scanHistoryV2Service.addJDScanHistory(uid, acceptData.getDevice(), goods);
|
| | | scanHistoryV2Service.addJDScanHistory(fuid, acceptData.getDevice(), goods);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | |
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate());
|
| | |
|
| | | GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertPDDGoods(pddGoods, paramsDTO);
|
| | | if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
|
| | | goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney());
|
| | | goodsDetail.getMoneyInfo().setShareMoney(
|
| | | "¥" + PinDuoDuoUtil.getGoodsFanLiMoney(pddGoods, hongBaoManageService.getVIPShareRate()));
|
| | | goodsDetail.getMoneyInfo().setRateInfo(goodsDetail.getMoneyInfo().getMaxRateInfo());
|
| | | goodsDetail.getMoneyInfo().setCompositionInfo(goodsDetail.getMoneyInfo().getMaxCompositionInfo());
|
| | | }
|
| | | goodsDetail.getMoneyInfo()
|
| | | .setRateInfoHelpUrl(configService.get(ConfigKeyEnum.goodsDetailFanliRateHelpUrl.getKey()));
|
| | |
| | | data.put("helpLink", configService.get(ConfigKeyEnum.inviteHelpLink.getKey()));
|
| | | data.put("inviteRules", values.getValue().replace("\n", "<br><br>"));
|
| | | data.put("imgUrlList", JsonUtil.getSimpleGsonWithDate().toJson(imgList));
|
| | | data.put("inviteLink", "http://a.app.qq.com/o/simple.jsp?pkgname=com.yeshi.ec.rebate");
|
| | | data.put("inviteLink", Constant.YINGYONGBAO_LINK);
|
| | | out.print(JsonUtil.loadTrue(0, JsonUtil.getSimpleGson().toJson(data), "成功"));
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | |
| | | BigDecimal fanliMoney) {
|
| | | List<ShareGoodsCommentChoiceInfo> list = new ArrayList<>();
|
| | | if (!StringUtil.isNullOrEmpty(token))
|
| | | list.add(new ShareGoodsCommentChoiceInfo(ShareGoodsCommentChoiceInfo.TYPE_TOKEN, "淘口令", token, true, false));
|
| | | list.add(
|
| | | new ShareGoodsCommentChoiceInfo(ShareGoodsCommentChoiceInfo.TYPE_TOKEN, "淘口令", token, true, false));
|
| | | if (!StringUtil.isNullOrEmpty(link)) {
|
| | | list.add(new ShareGoodsCommentChoiceInfo(ShareGoodsCommentChoiceInfo.TYPE_LINK, "链接",link, true, false));
|
| | | list.add(new ShareGoodsCommentChoiceInfo(ShareGoodsCommentChoiceInfo.TYPE_LINK, "链接", link, true, false));
|
| | | }
|
| | | if (!StringUtil.isNullOrEmpty(inviteCode)) {
|
| | | list.add(new ShareGoodsCommentChoiceInfo(ShareGoodsCommentChoiceInfo.TYPE_INVITE_CODE, "邀请码", inviteCode, false,
|
| | | true));
|
| | | list.add(new ShareGoodsCommentChoiceInfo(ShareGoodsCommentChoiceInfo.TYPE_INVITE_CODE, "邀请码", inviteCode,
|
| | | false, true));
|
| | | }
|
| | |
|
| | | list.add(new ShareGoodsCommentChoiceInfo(ShareGoodsCommentChoiceInfo.TYPE_DOWNLOAD_LINK, "下载链接", "http://www.baidu.com", false,
|
| | | true));
|
| | | list.add(new ShareGoodsCommentChoiceInfo(ShareGoodsCommentChoiceInfo.TYPE_DOWNLOAD_LINK, "下载链接",
|
| | | "http://www.baidu.com", false, true));
|
| | |
|
| | | list.add(
|
| | | new ShareGoodsCommentChoiceInfo(ShareGoodsCommentChoiceInfo.TYPE_FANLI_MONEY, "返利金额", "¥ "+fanliMoney, false, true));
|
| | | list.add(new ShareGoodsCommentChoiceInfo(ShareGoodsCommentChoiceInfo.TYPE_FANLI_MONEY, "返利金额",
|
| | | "¥ " + fanliMoney, false, true));
|
| | |
|
| | | return list;
|
| | | }
|
| | |
| | | taoBaoLink.getGoods(), shareInfo.getToken()));
|
| | |
|
| | | // 提示图文内容
|
| | | String imgs = configService.get(ConfigKeyEnum.goodsShareNotifyImgs.getKey());
|
| | | String imgs = configService.getByVersion(ConfigKeyEnum.goodsShareNotifyImgs.getKey(), platform,
|
| | | Integer.parseInt(version));
|
| | | JSONArray array = JSONArray.fromObject(imgs);
|
| | | int p = (int) (array.size() * Math.random());
|
| | | if (p < array.size()) {
|
| | |
| | | }
|
| | | shareInfo.setDescText(descText);
|
| | |
|
| | | String imgs = configService.get(ConfigKeyEnum.goodsShareNotifyImgs.getKey());
|
| | | String imgs = configService.getByVersion(ConfigKeyEnum.goodsShareNotifyImgs.getKey(), acceptData.getPlatform(),
|
| | | Integer.parseInt(acceptData.getVersion()));
|
| | | JSONArray array = JSONArray.fromObject(imgs);
|
| | | int p = (int) (array.size() * Math.random());
|
| | | if (p < array.size()) {
|
| | |
| | | // 设置评论文本选项
|
| | | shareInfo.setCommentTextChoiceList(getCommentChoiceList(null, shareInfo.getClickUrl(), inviteCode,
|
| | | JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getFanLiRate())));
|
| | | |
| | |
|
| | | shareInfo.setCommentText(shareInfo.getShareText());
|
| | | shareInfo.setRecommendText(shareInfo.getDescText());
|
| | |
|
| | |
| | | shareInfo.setDescText(descText);
|
| | |
|
| | | //
|
| | | String imgs = configService.get(ConfigKeyEnum.goodsShareNotifyImgs.getKey());
|
| | | String imgs = configService.getByVersion(ConfigKeyEnum.goodsShareNotifyImgs.getKey(), acceptData.getPlatform(),
|
| | | Integer.parseInt(acceptData.getVersion()));
|
| | | JSONArray array = JSONArray.fromObject(imgs);
|
| | | int p = (int) (array.size() * Math.random());
|
| | | if (p < array.size()) {
|
| | |
| | | // 设置评论文本选项
|
| | | shareInfo.setCommentTextChoiceList(getCommentChoiceList(null, shareInfo.getClickUrl(), inviteCode,
|
| | | PinDuoDuoUtil.getGoodsFanLiMoney(goods, hongBaoManageService.getFanLiRate())));
|
| | | |
| | |
|
| | | shareInfo.setCommentText(shareInfo.getShareText());
|
| | | shareInfo.setRecommendText(shareInfo.getDescText());
|
| | |
|
| | |
| | | } else {
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("userInfo", UserUtil.filterForClientUser(userInfo));
|
| | | data.put("inviteCode", userInfoExtraService.getInviteCodeByUid(userInfo.getId()));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
|
| | | final UserInfo uuser = userInfo;
|
| | |
| | | }
|
| | | vo.setFinishMoney(hongBaoV2CountService.getRewardMoneyBySelf(uid));
|
| | |
|
| | | |
| | | List<Integer> list = new ArrayList<Integer>();
|
| | | list.add(BanLiShopOrder.STATE_SUCCESS);
|
| | | BigDecimal payMoney = new BigDecimal(userVipConfigService.getValueByKey("require_order_pay"));
|
| | |
|
| | | vo.setFinishGoldCoin(Long.parseLong(integralDetailService.getCumulativeMoney(uid).setScale(0).toString()));
|
| | | vo.setFinishTeam(hongBaoV2CountService.countValidOrderTeamUserByUid(uid, TimeUtil.convertDateToTemp(Constant.VIP_ONLINE_TIME), payMoney));
|
| | | vo.setFinishTeam(hongBaoV2CountService.countValidOrderTeamUserByUid(uid,
|
| | | TimeUtil.convertDateToTemp(Constant.VIP_ONLINE_TIME), payMoney));
|
| | | vo.setFinishHongBao(banLiShopOrderService.countByUidAndState(uid, list));
|
| | |
|
| | | |
| | | // 区分老用户和新用户
|
| | | String limtDate = userVipConfigService.getValueByKey("vip_execute_time");
|
| | | Date executeDate = null;
|
| | |
| | | BigDecimal payMoney = new BigDecimal(userVipConfigService.getValueByKey("require_order_pay"));
|
| | |
|
| | | BigDecimal finishGoldCoin = integralDetailService.getCumulativeMoney(uid);
|
| | | long finishTeam = hongBaoV2CountService.countValidOrderTeamUserByUid(uid, TimeUtil.convertDateToTemp(Constant.VIP_ONLINE_TIME), payMoney);
|
| | | long finishTeam = hongBaoV2CountService.countValidOrderTeamUserByUid(uid,
|
| | | TimeUtil.convertDateToTemp(Constant.VIP_ONLINE_TIME), payMoney);
|
| | | long finishHongBao = banLiShopOrderService.countByUidAndState(uid, list);
|
| | | BigDecimal finishMoney = hongBaoV2CountService.getRewardMoneyBySelf(uid);
|
| | |
|
| | |
| | | } catch (ParseException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | |
| | |
|
| | | UserInfoExtra extra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (extra != null
|
| | | && (extra.getFirstLoginTime() == null || extra.getFirstLoginTime().getTime() < executeDate.getTime())) {
|
New file |
| | |
| | | package com.yeshi.fanli.dao.user.notify;
|
| | |
|
| | | import org.springframework.stereotype.Repository;
|
| | |
|
| | | import com.yeshi.fanli.dao.MongodbBaseDao;
|
| | | import com.yeshi.fanli.entity.bus.user.notify.UserActivedRecord;
|
| | |
|
| | | @Repository
|
| | | public class UserActivedRecordDao extends MongodbBaseDao<UserActivedRecord> {
|
| | |
|
| | | }
|
| | |
| | | private BigDecimal shareRate;
|
| | | // 奖励券最高返比例
|
| | | private BigDecimal maxRewardRate;
|
| | |
|
| | | // 基础返利比例信息
|
| | | private BigDecimal baseFanliRate;
|
| | | // VIP返利比例
|
| | | private BigDecimal vipFanLiRate;// 会员返利比例
|
| | |
|
| | | public BigDecimal getBaseFanliRate() {
|
| | | return baseFanliRate;
|
| | | }
|
| | |
|
| | | public void setBaseFanliRate(BigDecimal baseFanliRate) {
|
| | | this.baseFanliRate = baseFanliRate;
|
| | | }
|
| | |
|
| | | public BigDecimal getVipFanLiRate() {
|
| | | return vipFanLiRate;
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dto.user;
|
| | |
|
| | | public enum UserInviteLevelEnum {
|
| | | noActive("未激活", ""), actived("已经激活", ""), vipApply("超级会员申请中", ""), vip("超级会员", ""), tearcherApply("导师申请中",
|
| | | ""), tearcher("导师", "");
|
| | | private String name;
|
| | | private String link;
|
| | |
|
| | | private UserInviteLevelEnum(String name, String link) {
|
| | | this.name = name;
|
| | | this.link = link;
|
| | | }
|
| | |
|
| | | public String getName() {
|
| | | return this.name;
|
| | | }
|
| | |
|
| | | public String getLink() {
|
| | | return this.link;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.bus.user.notify;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.springframework.data.annotation.Id;
|
| | | import org.springframework.data.mongodb.core.mapping.Document;
|
| | | import org.springframework.data.mongodb.core.mapping.Field;
|
| | |
|
| | | /**
|
| | | * 用户激活记录表
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Document(collection = "userActivedRecord")
|
| | | public class UserActivedRecord {
|
| | | @Id
|
| | | private Long uid;
|
| | | @Field
|
| | | private Boolean addTearcherNotify;// 添加导师提醒
|
| | | @Field
|
| | | private Date addTearchNotifyTime;
|
| | | @Field
|
| | | private Date createTime;
|
| | | @Field
|
| | | private Date updateTime;
|
| | |
|
| | | public UserActivedRecord(Long uid) {
|
| | | this.uid = uid;
|
| | | }
|
| | |
|
| | | public UserActivedRecord() {
|
| | | }
|
| | |
|
| | | public Long getUid() {
|
| | | return uid;
|
| | | }
|
| | |
|
| | | public void setUid(Long uid) {
|
| | | this.uid = uid;
|
| | | }
|
| | |
|
| | | public Boolean getAddTearcherNotify() {
|
| | | return addTearcherNotify;
|
| | | }
|
| | |
|
| | | public void setAddTearcherNotify(Boolean addTearcherNotify) {
|
| | | this.addTearcherNotify = addTearcherNotify;
|
| | | }
|
| | |
|
| | | public Date getAddTearchNotifyTime() {
|
| | | return addTearchNotifyTime;
|
| | | }
|
| | |
|
| | | public void setAddTearchNotifyTime(Date addTearchNotifyTime) {
|
| | | this.addTearchNotifyTime = addTearchNotifyTime;
|
| | | }
|
| | |
|
| | | 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;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | convertDocWebLink("convert_doc_web_link","文案转链网页"),
|
| | | convertDocHelpLink("convert_doc_help_link","文案转链帮助网页"),
|
| | | convertDocTip("convert_doc_tip","文案转链温馨提示"),
|
| | | newerGonglue("newer_gonglue_url","新手攻略链接")
|
| | | newerGonglue("newer_gonglue_url","新手攻略链接"),
|
| | | tearcherLink("tearcher_link","导师链接")
|
| | | ;
|
| | |
|
| | | private final String key;
|
| | |
| | | try {
|
| | | convertContent = convertLinkManager.convertLinkFromText(info.getContent(), uid, true);
|
| | | } catch (Exception e) {
|
| | | throw new WXMPDynamicInfoException(2, e.getMessage());
|
| | | e.printStackTrace();
|
| | | throw new WXMPDynamicInfoException(2, "转链出错");
|
| | | }
|
| | | wxmpDynamicInfoDao.addShareCount(id);
|
| | | return convertContent;
|
| | |
| | | String type = contentType.substring(contentType.indexOf("/") + 1);
|
| | |
|
| | | // 文件路径
|
| | | String filePath =FilePathEnum.special.getPath() + UUID.randomUUID().toString().replace("-", "") + "." + type;
|
| | | String filePath = FilePathEnum.special.getPath() + UUID.randomUUID().toString().replace("-", "") + "." + type;
|
| | | // 执行上传
|
| | | String fileLink = COSManager.getInstance().uploadFile(inputStream, filePath).getUrl();
|
| | |
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void updateOrder(Long id, Integer moveType, Integer sex) throws SpecialException {
|
| | |
|
| | | if (id == null || moveType == null || (!moveType.equals(1) && !moveType.equals(-1)) || sex == null) {
|
| | |
| | | COSManager.getInstance().deleteFile(subPicture);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | if (listSpecial != null)
|
| | | for (Special special : listSpecial) {
|
| | | List<AdActivityVersionControl> versionList = adActivityVersionControlService
|
| | |
| | | s.setParams(special.getParams());
|
| | | }
|
| | | }
|
| | |
|
| | | if (s.getJumpDetail() != null) {
|
| | | s.getJumpDetail().setNeedLogin(s.isJumpLogin()
|
| | | | (s.getJumpDetail().getNeedLogin() != null && s.getJumpDetail().getNeedLogin()));
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | // 数据处理
|
| | |
| | | return paramsDTO;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public BigDecimal getBaseFanliRate(long time) {
|
| | | String key = "base_fanli_rate";
|
| | | HongBaoManage hongBaoManage = hongBaoManageMapper.selectByKeyAndMaxValidTime(key, time);
|
| | | if (hongBaoManage == null)
|
| | | hongBaoManage = hongBaoManageMapper.selectByKey(key);
|
| | | if (hongBaoManage != null)
|
| | | return new BigDecimal(hongBaoManage.getValue());
|
| | | LogHelper.error("获取基础返利比例出错");
|
| | | return null;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public BigDecimal getBaseFanliRate() {
|
| | | return getBaseFanliRate(System.currentTimeMillis());
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.context.annotation.Lazy;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.UserRank;
|
| | | import com.yeshi.fanli.entity.bus.user.UserRankRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.WeiXinUser;
|
| | | import com.yeshi.fanli.entity.bus.user.notify.UserActivedRecord;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.exception.user.ThreeSaleException;
|
| | | import com.yeshi.fanli.exception.user.UserInfoExtraException;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.UserInviteRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserRankService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.notify.UserActivedRecordService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.FilePathEnum;
|
| | | import com.yeshi.fanli.util.InviteCodeFilterUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserInviteRecordService userInviteRecordService;
|
| | |
|
| | | @Resource
|
| | | @Lazy
|
| | | private UserActivedRecordService userActivedRecordService;
|
| | |
|
| | | @Resource(name = "producer")
|
| | | private Producer producer;
|
| | |
| | | userInfoExtra.setCreateTime(new Date());
|
| | | userInfoExtraMapper.insertSelective(userInfoExtra);
|
| | | }
|
| | | userActivedRecordService.add(new UserActivedRecord(uid));
|
| | |
|
| | | if (!Constant.IS_TEST) { // 发送激活成功消息
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.inviteCodeActive,
|
| | |
| | | if (asInputStream == null) {
|
| | | LogHelper.test("微信头像下载失败: " + weiXinUser.getUnionid() + " " + headimgurl);
|
| | | } else {
|
| | | FileUploadResult result = COSManager.getInstance().uploadFile(asInputStream, String.format(
|
| | | FilePathEnum.userWXPortrait.getPath() + "%s_%s.jpg", weiXinUser.getUnionid(), System.currentTimeMillis() + ""));
|
| | | FileUploadResult result = COSManager.getInstance().uploadFile(asInputStream,
|
| | | String.format(FilePathEnum.userWXPortrait.getPath() + "%s_%s.jpg", weiXinUser.getUnionid(),
|
| | | System.currentTimeMillis() + ""));
|
| | | if (result != null && !StringUtil.isNullOrEmpty(result.getUrl())) {
|
| | | headimgurl = result.getUrl();
|
| | | } else {
|
| | |
| | | userInfoExtra.setCreateTime(new Date());
|
| | | userInfoExtraMapper.insertSelective(userInfoExtra);
|
| | | }
|
| | | userActivedRecordService.add(new UserActivedRecord(uid));
|
| | |
|
| | |
|
| | | if (!Constant.IS_TEST) { // 发送激活成功消息
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.inviteCodeActive,
|
| | | new Gson().toJson(new InviteCodeActiveMQMsg(uid, new Date())));
|
| | |
| | | if (asInputStream == null) {
|
| | | LogHelper.test("微信头像下载失败: " + weiXinUser.getUnionid() + " " + headimgurl);
|
| | | } else {
|
| | | FileUploadResult result = COSManager.getInstance().uploadFile(asInputStream, String.format(
|
| | | FilePathEnum.userWXPortrait.getPath() + "%s_%s.jpg", weiXinUser.getUnionid(), System.currentTimeMillis() + ""));
|
| | | FileUploadResult result = COSManager.getInstance().uploadFile(asInputStream,
|
| | | String.format(FilePathEnum.userWXPortrait.getPath() + "%s_%s.jpg", weiXinUser.getUnionid(),
|
| | | System.currentTimeMillis() + ""));
|
| | | if (result != null && !StringUtil.isNullOrEmpty(result.getUrl())) {
|
| | | headimgurl = result.getUrl();
|
| | | } else {
|
| | |
| | | userInfoExtraMapper.insertSelective(userInfoExtra);
|
| | | }
|
| | |
|
| | | userActivedRecordService.add(new UserActivedRecord(uid));
|
| | |
|
| | | if (!Constant.IS_TEST) { // 发送激活成功消息
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.inviteCodeActive,
|
| | | new Gson().toJson(new InviteCodeActiveMQMsg(uid, new Date())));
|
| | |
| | | userInfoExtraMapper.updateAutoExtract(days);
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void updateInviteCodeVip(String inviteCodeVip, Long uid) throws UserInfoExtraException {
|
| | | if (inviteCodeVip == null || inviteCodeVip.length() < 4 || inviteCodeVip.length() > 12)
|
| | |
| | | update.setInviteCodeVip(inviteCodeVip);
|
| | | update.setUpdateTime(new Date());
|
| | | userInfoExtraMapper.updateByPrimaryKeySelective(update);
|
| | | |
| | | if(!Constant.IS_TEST) { //发送邀请码更改成功的消息
|
| | |
|
| | | if (!Constant.IS_TEST) { // 发送邀请码更改成功的消息
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.userInfoUpdate,
|
| | | new Gson().toJson(new UserInfoUpdateMQMsg(uid, UserInfoUpdateTypeEnum.inviteCode, inviteCodeVip, new Date())));
|
| | | new Gson().toJson(new UserInfoUpdateMQMsg(uid, UserInfoUpdateTypeEnum.inviteCode, inviteCodeVip,
|
| | | new Date())));
|
| | | producer.send(message);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public void uploadERCode(MultipartFile file, Long uid) {
|
| | | UserInfoExtra extra = userInfoExtraMapper.getInfoExtraByUid(uid);
|
| | | if (extra == null)
|
| | | return;
|
| | | |
| | |
|
| | | // 压缩
|
| | | String targetPath = FileUtil.getCacheDir() + "/erCode_" + uid + "_" + System.currentTimeMillis()+ ".jpg";
|
| | | String targetPath = FileUtil.getCacheDir() + "/erCode_" + uid + "_" + System.currentTimeMillis() + ".jpg";
|
| | | try {
|
| | | Thumbnails.of(file.getInputStream()).size(200, 200).toFile(targetPath);
|
| | | } catch (IOException e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | // 执行上传
|
| | | String filePath = FilePathEnum.userERcode.getPath() + UUID.randomUUID().toString().replace("-", "") + ".jpg";
|
| | | String fileLink = COSManager.getInstance().uploadFile(new File(targetPath), filePath).getUrl();
|
| | | |
| | |
|
| | | // 删除本地图片
|
| | | if (new File(targetPath).exists()) {
|
| | | new File(targetPath).delete();
|
| | |
| | |
|
| | | // 原二维码
|
| | | String erCode = extra.getErCode();
|
| | | |
| | |
|
| | | UserInfoExtra update = new UserInfoExtra();
|
| | | update.setId(extra.getId());
|
| | | update.setErCode(fileLink);
|
| | |
| | | COSManager.getInstance().deleteFile(erCode);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.dao.mybatis.UserInfoMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.UserShareGoodsHistoryMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.share.ShareMapper;
|
| | | import com.yeshi.fanli.dto.user.UserInviteLevelEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.BindingAccount;
|
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | |
| | | return userInfoMapper.selectAvailableByPrimaryKey(uid);
|
| | | }
|
| | |
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.user.invite;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dto.user.UserInviteLevelEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserVIPInfo;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.UserInviteService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | @Service
|
| | | public class UserInviteServiceImpl implements UserInviteService {
|
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | |
|
| | | @Resource
|
| | | private UserVIPInfoService userVIPInfoService;
|
| | |
|
| | | @Override
|
| | | public UserInviteLevelEnum getUserInviteLevel(Long uid) {
|
| | | String inviteCode = userInfoExtraService.getInviteCodeByUid(uid);
|
| | | if (StringUtil.isNullOrEmpty(inviteCode)) {
|
| | | return UserInviteLevelEnum.noActive;
|
| | | }
|
| | | UserVIPInfo info = userVIPInfoService.selectByUid(uid);
|
| | | if (info == null || info.getState() == UserVIPInfo.STATE_INVALID)
|
| | | return UserInviteLevelEnum.actived;
|
| | | if (info.getState() == UserVIPInfo.STATE_VERIFING)
|
| | | return UserInviteLevelEnum.vipApply;
|
| | |
|
| | | // TODO 没有判断导师
|
| | |
|
| | | return UserInviteLevelEnum.vip;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.user.notify;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.user.notify.UserActivedRecordDao;
|
| | | import com.yeshi.fanli.entity.bus.user.notify.UserActivedRecord;
|
| | | import com.yeshi.fanli.service.inter.user.notify.UserActivedRecordService;
|
| | |
|
| | | @Service
|
| | | public class UserActivedRecordServiceImpl implements UserActivedRecordService {
|
| | |
|
| | | @Resource
|
| | | private UserActivedRecordDao userActivedRecordDao;
|
| | |
|
| | | @Override
|
| | | public boolean canNotifyAddTearcher(Long uid) {
|
| | | UserActivedRecord record = userActivedRecordDao.get(uid);
|
| | | if (record == null)
|
| | | return false;
|
| | | if (record.getAddTearcherNotify() == null || record.getAddTearcherNotify() == false)
|
| | | return true;
|
| | | else
|
| | | return false;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void setTearcherNotified(Long uid) {
|
| | | UserActivedRecord record = userActivedRecordDao.get(uid);
|
| | | if (record == null)
|
| | | return;
|
| | | if (record.getAddTearcherNotify() == null || !record.getAddTearcherNotify()) {
|
| | | record.setAddTearchNotifyTime(new Date());
|
| | | record.setUpdateTime(new Date());
|
| | | record.setAddTearcherNotify(true);
|
| | | userActivedRecordDao.save(record);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void add(UserActivedRecord record) {
|
| | | UserActivedRecord old = userActivedRecordDao.get(record.getUid());
|
| | | if (old != null)
|
| | | return;
|
| | | if (record.getCreateTime() == null)
|
| | | record.setCreateTime(new Date());
|
| | | userActivedRecordDao.save(record);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | @Resource
|
| | | private UserVIPInfoMapper userVIPInfoMapper;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserVipConfigService userVipConfigService;
|
| | | |
| | |
|
| | | @Lazy
|
| | | @Resource
|
| | | private HongBaoV2CountService hongBaoV2CountService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private IntegralDetailService integralDetailService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private BanLiShopOrderService banLiShopOrderService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserOtherMsgNotificationService userOtherMsgNotificationService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserInviteSeparateService userInviteSeparateService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | | |
| | |
|
| | | @Lazy
|
| | | @Resource
|
| | | private UserSystemCouponService userSystemCouponService;
|
| | |
|
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | |
| | | if (userVIPInfo.getState() != UserVIPInfo.STATE_VERIFING) {
|
| | | throw new UserVIPInfoException(2, "申请未处于审核状态");
|
| | | }
|
| | | |
| | |
|
| | | if (!verifyConform(uid))
|
| | | throw new UserVIPInfoException(1, "系统验证:不满足升级条件");
|
| | | |
| | |
|
| | | UserVIPInfo info = new UserVIPInfo();
|
| | | info.setId(userVIPInfo.getId());
|
| | | info.setSuccessTime(new Date());
|
| | | info.setState(UserVIPInfo.STATE_SUCCESS);
|
| | | info.setUpdateTime(new Date());
|
| | | userVIPInfoMapper.updateByPrimaryKeySelective(info);
|
| | | |
| | |
|
| | | // 下级的超级会员 不脱离
|
| | | userInviteSeparateService.updateInvalidByBossId(uid);
|
| | | |
| | |
|
| | | // 额外信息
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getByUidForUpdate(uid);
|
| | | if (userInfoExtra == null)
|
| | | throw new UserVIPInfoException(1, "用户信息不存在");
|
| | | |
| | |
|
| | | // 添加金币
|
| | | IntegralDetail detail = new IntegralDetail();
|
| | | detail.setTitle("升级VIP福利");
|
| | |
| | | detail.setUniqueKey("VIP-" + uid);
|
| | | integralDetailService.insertSelective(detail);
|
| | | userInfoExtraService.addGoldCoinByUid(uid, Constant.VIP_COLDCOIN_NUM);
|
| | | |
| | |
|
| | | try {
|
| | | // 奖励券
|
| | | BigDecimal percent = new BigDecimal(configService.get(ConfigKeyEnum.exchangeRebatePercent.getKey()));
|
| | | for (int i = 0; i < Constant.VIP_COUPON_REWARD_NUM; i++) {
|
| | | userSystemCouponService.insertUserCoupon(uid, CouponTypeEnum.rebatePercentCoupon.name(), |
| | | userSystemCouponService.insertUserCoupon(uid, CouponTypeEnum.rebatePercentCoupon.name(),
|
| | | UserSystemCoupon.SOURCE_SYSTEM_PUSH, percent, false);
|
| | | }
|
| | | |
| | |
|
| | | // 赠送免单券
|
| | | for (int i = 0; i < Constant.VIP_COUPON_GIVEFREE_NUM; i++) {
|
| | | userSystemCouponService.insertUserCoupon(uid, CouponTypeEnum.freeCouponGive.name(), |
| | | userSystemCouponService.insertUserCoupon(uid, CouponTypeEnum.freeCouponGive.name(),
|
| | | UserSystemCoupon.SOURCE_SYSTEM_PUSH, null, false);
|
| | | }
|
| | | } catch (Exception e) {
|
| | | throw new UserVIPInfoException(1, "券赠送失败");
|
| | | }
|
| | | |
| | |
|
| | | // 消息
|
| | | MsgOtherVIPDTO msgOther = new MsgOtherVIPDTO();
|
| | | msgOther.setContent1("恭喜你,已成为超级会员");
|
| | | msgOther.setContent2("满足升级条件");
|
| | | msgOther.setContent3(TimeUtil.formatDateDot(new Date()));
|
| | | userOtherMsgNotificationService.passVIPApplyMsg(uid, "返利奖励券和、赠送免单券和金币请到我的-福利中心中查看", msgOther);
|
| | | |
| | |
|
| | | // 通知上级
|
| | | callBoss(uid);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 通知上级脱离关系
|
| | | * |
| | | * @param uid
|
| | | */
|
| | | @Transactional
|
| | | private void callBoss(Long uid) {
|
| | | // 是否存在上级
|
| | | ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid);
|
| | | if (threeSale == null) |
| | | if (threeSale == null)
|
| | | return;
|
| | | // 上级是否为会员
|
| | | Long bossId = threeSale.getBoss().getId();
|
| | | UserVIPInfo bossVIP = userVIPInfoMapper.selectByPrimaryKeyForUpdate(bossId);
|
| | | if (bossVIP != null && bossVIP.getState() != null && bossVIP.getState() == UserVIPInfo.STATE_SUCCESS)
|
| | | return;
|
| | | |
| | |
|
| | | // 之前插入记录失效
|
| | | userInviteSeparateService.updateStateByWorkerIdAndBossId(uid, bossId, UserInviteSeparate.STATE_INVALID);
|
| | | |
| | |
|
| | | // 限制时间
|
| | | int limitDays = Integer.parseInt(configService.get(ConfigKeyEnum.inviteSeparateLimitDays.getKey()));
|
| | | UserInviteSeparate inviteSeparate = new UserInviteSeparate();
|
| | |
| | | inviteSeparate.setCreateTime(new Date());
|
| | | inviteSeparate.setUpdateTime(new Date());
|
| | | userInviteSeparateService.insertSelective(inviteSeparate);
|
| | | |
| | |
|
| | | UserInfo userInfo = userInfoService.selectByPKey(uid);
|
| | | // 消息
|
| | | MsgOtherVIPDTO msgboss = new MsgOtherVIPDTO();
|
| | | msgboss.setContent1(userInfo.getNickName() +" "+ uid);
|
| | | msgboss.setContent1(userInfo.getNickName() + " " + uid);
|
| | | msgboss.setContent2("于" + TimeUtil.formatDateDot(new Date()) + "成功升级成为超级会员");
|
| | | msgboss.setContent3("今日起"+limitDays+"天内,你未能成为超级会员将会与其脱离邀请关系 ");
|
| | | msgboss.setContent3("今日起" + limitDays + "天内,你未能成为超级会员将会与其脱离邀请关系 ");
|
| | | userOtherMsgNotificationService.teamVIPCallBoss(bossId, "如有疑问请联系我的-人工客服", msgboss);
|
| | | }
|
| | | |
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void rejectVIPApply(Long uid, String reason) throws UserVIPInfoException {
|
| | |
| | | info.setState(UserVIPInfo.STATE_INVALID);
|
| | | info.setUpdateTime(new Date());
|
| | | userVIPInfoMapper.updateByPrimaryKeySelective(info);
|
| | | |
| | |
|
| | | // 消息
|
| | | MsgOtherVIPDTO msgOther = new MsgOtherVIPDTO();
|
| | | msgOther.setContent1("很抱歉,未通过超级会员申请");
|
| | |
| | | return map;
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public boolean verifyConform(Long uid) {
|
| | | if (uid == null || uid <= 0)
|
| | | return false;
|
| | | |
| | |
|
| | | UserInfoExtra extra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (extra == null) |
| | | if (extra == null)
|
| | | return false;
|
| | | |
| | |
|
| | | // 1、直接粉丝(从 2020 年 1 月 1 日起直接粉丝产生有效订单)
|
| | | BigDecimal payMoney = new BigDecimal(userVipConfigService.getValueByKey("require_order_pay"));
|
| | | long teamNum = hongBaoV2CountService.countValidOrderTeamUserByUid(uid, TimeUtil.convertDateToTemp(Constant.VIP_ONLINE_TIME), payMoney);
|
| | | |
| | | long teamNum = hongBaoV2CountService.countValidOrderTeamUserByUid(uid,
|
| | | TimeUtil.convertDateToTemp(Constant.VIP_ONLINE_TIME), payMoney);
|
| | |
|
| | | // 区分老用户和新用户
|
| | | String limtDate = userVipConfigService.getValueByKey("vip_execute_time");
|
| | |
| | | }
|
| | | if (executeDate == null)
|
| | | return false;
|
| | | |
| | |
|
| | | if (extra.getFirstLoginTime() == null || extra.getFirstLoginTime().getTime() < executeDate.getTime()) {
|
| | | long limitNum = Long.parseLong(userVipConfigService.getValueByKey("require_invite_num_old_user"));
|
| | | if (teamNum < limitNum)
|
| | |
| | | if (teamNum < limitNum)
|
| | | return false;
|
| | | }
|
| | | |
| | |
|
| | | // 2、累计自购返利≥100 元(从注册板栗快省起);
|
| | | BigDecimal fanMoney = new BigDecimal(userVipConfigService.getValueByKey("require_fan_money"));
|
| | | BigDecimal purchase = hongBaoV2CountService.getRewardMoneyBySelf(uid);
|
| | | if (purchase.compareTo(fanMoney) < 0)
|
| | | return false;
|
| | | |
| | |
|
| | | // 3、累计金币≥10000 枚(从注册板栗快省起);
|
| | | BigDecimal goldCoin = integralDetailService.getCumulativeMoney(uid);
|
| | | BigDecimal limitGoldCoin = new BigDecimal(userVipConfigService.getValueByKey("require_gold_coin"));
|
| | | if (goldCoin.compareTo(limitGoldCoin) < 0)
|
| | | return false;
|
| | | |
| | |
|
| | | // 4、使用红包≥1 次
|
| | | List<Integer> list = new ArrayList<Integer>();
|
| | | list.add(BanLiShopOrder.STATE_SUCCESS);
|
| | |
| | | long limitHongBao = Long.parseLong(userVipConfigService.getValueByKey("require_shop_buy"));
|
| | | if (useHongBao < limitHongBao)
|
| | | return false;
|
| | | |
| | |
|
| | | // 符合条件
|
| | | return true;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public List<UserVIPInfo> listQuery(int page, int count, String key, Integer state){
|
| | | return userVIPInfoMapper.listQuery((page-1) * count, count, key, state);
|
| | | public List<UserVIPInfo> listQuery(int page, int count, String key, Integer state) {
|
| | | return userVIPInfoMapper.listQuery((page - 1) * count, count, key, state);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public long countQuery(String key, Integer state){
|
| | | public long countQuery(String key, Integer state) {
|
| | | return userVIPInfoMapper.countQuery(key, state);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void inviteSeparate(Long workerId, Long bossId) {
|
| | | if (workerId == null || bossId == null)
|
| | | return;
|
| | | |
| | |
|
| | | // 查询记录
|
| | | UserInviteSeparate userInviteSeparate = userInviteSeparateService.selectByWorkerIdAndBossId(workerId, bossId);
|
| | | if (userInviteSeparate == null)
|
| | | return;
|
| | | |
| | |
|
| | | // 是否存在邀请关系
|
| | | ThreeSale threeSale = threeSaleSerivce.getMyBoss(workerId);
|
| | | if (threeSale == null) |
| | | if (threeSale == null)
|
| | | return;
|
| | | Long bossIdExist = threeSale.getBoss().getId();
|
| | | if (bossIdExist == null || bossId.longValue() != bossIdExist.longValue())
|
| | | return;
|
| | | |
| | |
|
| | | // 上级会员情况
|
| | | boolean separate = false;
|
| | | UserVIPInfo userVIPInfo = userVIPInfoMapper.selectByPrimaryKey(bossId);
|
| | | if (userVIPInfo != null && userVIPInfo.getState() != null && userVIPInfo.getState() == UserVIPInfo.STATE_SUCCESS) {
|
| | | if (userVIPInfo != null && userVIPInfo.getState() != null
|
| | | && userVIPInfo.getState() == UserVIPInfo.STATE_SUCCESS) {
|
| | | if (userInviteSeparate.getEndTime().getTime() < userVIPInfo.getSuccessTime().getTime()) {
|
| | | separate = true; // 结束时间已经超过
|
| | | }
|
| | | } else {
|
| | | separate = true; // 上级非会员 |
| | | separate = true; // 上级非会员
|
| | | }
|
| | | |
| | |
|
| | | if (!separate) {
|
| | | // 未脱离
|
| | | userInviteSeparateService.updateStateByWorkerIdAndBossId(workerId, bossId, UserInviteSeparate.STATE_INVALID);
|
| | | userInviteSeparateService.updateStateByWorkerIdAndBossId(workerId, bossId,
|
| | | UserInviteSeparate.STATE_INVALID);
|
| | | } else {
|
| | | // 脱离关系
|
| | | userInviteSeparateService.updateStateByWorkerIdAndBossId(workerId, bossId, UserInviteSeparate.STATE_SUCCESS);
|
| | | |
| | | userInviteSeparateService.updateStateByWorkerIdAndBossId(workerId, bossId,
|
| | | UserInviteSeparate.STATE_SUCCESS);
|
| | |
|
| | | // 脱离邀请关系
|
| | | threeSaleSerivce.inviteSeparate(workerId, bossId);
|
| | | |
| | |
|
| | | int limitDays = Integer.parseInt(configService.get(ConfigKeyEnum.inviteSeparateLimitDays.getKey()));
|
| | | // 消息
|
| | | UserInfo userInfo = userInfoService.selectByPKey(workerId);
|
| | | MsgOtherVIPDTO msgboss = new MsgOtherVIPDTO();
|
| | | msgboss.setContent1(userInfo.getNickName() + workerId + "于" +TimeUtil.formatDateDot(userInviteSeparate.getCreateTime())+"成功升级成为超级会员 ");
|
| | | msgboss.setContent2("很遗憾,你未能在"+limitDays+"天升级为超级会员 ");
|
| | | msgboss.setContent1(userInfo.getNickName() + workerId + "于"
|
| | | + TimeUtil.formatDateDot(userInviteSeparate.getCreateTime()) + "成功升级成为超级会员 ");
|
| | | msgboss.setContent2("很遗憾,你未能在" + limitDays + "天升级为超级会员 ");
|
| | | msgboss.setContent3("已与其脱离邀请关系");
|
| | | userOtherMsgNotificationService.teamSplitCallBoss(bossId, "如有疑问请联系我的-人工客服", msgboss);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | }
|
| | |
| | | */
|
| | | public ConfigParamsDTO getShowComputeRate(String platform, String version);
|
| | |
|
| | | /**
|
| | | * 获取基础的返利比例
|
| | | * |
| | | * @param time
|
| | | * @return
|
| | | */
|
| | | public BigDecimal getBaseFanliRate(long time);
|
| | |
|
| | | /**
|
| | | * 获取基础的返利比例
|
| | | * |
| | | * @return
|
| | | */
|
| | | public BigDecimal getBaseFanliRate();
|
| | |
|
| | | }
|
| | |
| | | import org.apache.ibatis.annotations.Param;
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | |
|
| | | import com.yeshi.fanli.dto.user.UserInviteLevelEnum;
|
| | | import com.yeshi.fanli.dto.wx.WXAccountInfoDTO;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | |
| | | * @param uid
|
| | | */
|
| | | public void uploadERCode(MultipartFile file, Long uid);
|
| | |
|
| | | |
| | | }
|
| | |
| | |
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | |
|
| | | import com.yeshi.fanli.dto.user.UserInviteLevelEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.exception.user.UserInfoException;
|
| | | import com.yeshi.fanli.vo.user.UserInfoVO;
|
| | |
| | | * @return
|
| | | */
|
| | | public List<UserInfoVO> query(long start, int count, Integer userState, String key, Integer keyType,
|
| | | String userRank, Integer days, String startTime, String endTime, Integer orderField, Integer orderMode,Integer userType);
|
| | | String userRank, Integer days, String startTime, String endTime, Integer orderField, Integer orderMode,
|
| | | Integer userType);
|
| | |
|
| | | public long queryCount(Integer userState, String key, Integer keyType, String userRank, Integer days,
|
| | | String startTime, String endTime,Integer userType);
|
| | | String startTime, String endTime, Integer userType);
|
| | |
|
| | | public double querySumMoney(String key, Integer userType, Integer days, String startTime, String endTime);
|
| | |
|
| | |
| | | */
|
| | | public UserInfo selectAvailableByPrimaryKey(Long uid);
|
| | |
|
| | |
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.user.invite;
|
| | |
|
| | | import com.yeshi.fanli.dto.user.UserInviteLevelEnum;
|
| | |
|
| | | public interface UserInviteService {
|
| | | /**
|
| | | * 获取邀请等级
|
| | | * |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public UserInviteLevelEnum getUserInviteLevel(Long uid);
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.user.notify;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.notify.UserActivedRecord;
|
| | |
|
| | | public interface UserActivedRecordService {
|
| | |
|
| | | /**
|
| | | * 是否可以提醒用户添加导师
|
| | | * |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public boolean canNotifyAddTearcher(Long uid);
|
| | |
|
| | | /**
|
| | | * 设置添加导师为已经提醒
|
| | | * |
| | | * @param uid
|
| | | */
|
| | | public void setTearcherNotified(Long uid);
|
| | | |
| | | |
| | | /**
|
| | | * 添加数据
|
| | | * @param record
|
| | | */
|
| | | public void add(UserActivedRecord record);
|
| | |
|
| | | }
|
| | |
| | |
|
| | | public static int PAGE_SIZE = 20;
|
| | |
|
| | | public static String YINGYONGBAO_LINK = "https://a.app.qq.com/o/simple.jsp?pkgname=com.yeshi.ec.rebate";
|
| | | public static String YINGYONGBAO_LINK = "https://w.url.cn/s/AHUuT7i";
|
| | |
|
| | | public final static String UIDAESKEY = "WW782ss@8*px/%2v";
|
| | |
|
| | |
| | | BigDecimal commission = CommonGoodsUtil.getCommission(goods, params.getFanLiRate());
|
| | | moneyInfoVO.setFanliMoney("¥" + commission);
|
| | |
|
| | | BigDecimal maxCommission = CommonGoodsUtil.getCommission(goods, params.getVipFanLiRate());
|
| | | if (params.getMaxRewardRate() != null)
|
| | | moneyInfoVO
|
| | | .setMaxMoney("¥" + commission.add(MoneyBigDecimalUtil.mul(commission, params.getMaxRewardRate())));
|
| | | else
|
| | | moneyInfoVO.setMaxMoney("¥" + CommonGoodsUtil.getCommission(goods, params.getVipFanLiRate()));
|
| | | moneyInfoVO.setMaxMoney("¥" + maxCommission);
|
| | |
|
| | | moneyInfoVO.setShareMoney(CommonGoodsUtil.getCommissionInfo(goods, params.getShareRate()));
|
| | |
|
| | | moneyInfoVO.setRateInfo("返利比 " + MoneyBigDecimalUtil.div(commission.multiply(new BigDecimal(100)),
|
| | | CommonGoodsUtil.getAfterUseCouplePrice(goods)) + "%");
|
| | | |
| | | moneyInfoVO.setMaxRateInfo("返利比 " + MoneyBigDecimalUtil.div(maxCommission.multiply(new BigDecimal(100)),
|
| | | CommonGoodsUtil.getAfterUseCouplePrice(goods)) + "%");
|
| | |
|
| | | goodsInfo.setMoneyInfo(moneyInfoVO);
|
| | |
|
| | | // 券信息
|
| | |
| | | moneyInfoVO.setMoneyType(1); // 默认显示:返 ¥6.6
|
| | |
|
| | | BigDecimal commission = TaoBaoUtil.getGoodsHongBaoMoney(goods, params.getFanLiRate());
|
| | |
|
| | | BigDecimal baseCommisstion = null;
|
| | | if (params.getBaseFanliRate() != null)
|
| | | baseCommisstion = TaoBaoUtil.getGoodsHongBaoMoney(goods, params.getBaseFanliRate());
|
| | | moneyInfoVO.setFanliMoney("¥" + commission);
|
| | | if (params.getMaxRewardRate() != null)
|
| | | moneyInfoVO
|
| | |
| | | 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);
|
| | | }
|
| | | }
|
| | |
|
| | | moneyInfoVO.setShareMoney(TaoBaoUtil.getGoodsHongBaoInfo(goods, params.getShareRate()));
|
| | |
|
| | | goodsInfo.setMoneyInfo(moneyInfoVO);
|
| | |
|
| | | // 券信息
|
| | |
| | | moneyInfoVO.setMoneyType(1); // 默认显示:返 ¥6.6
|
| | | BigDecimal commission = JDUtil.getGoodsFanLiMoney(goods, params.getFanLiRate());
|
| | | moneyInfoVO.setFanliMoney("¥" + commission);
|
| | | BigDecimal baseCommisstion = null;
|
| | | if (params.getBaseFanliRate() != null)
|
| | | baseCommisstion = JDUtil.getGoodsFanLiMoney(goods, params.getBaseFanliRate());
|
| | |
|
| | | if (params.getMaxRewardRate() != null)
|
| | | moneyInfoVO
|
| | | .setMaxMoney("¥" + commission.add(MoneyBigDecimalUtil.mul(commission, params.getMaxRewardRate())));
|
| | |
| | | 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);
|
| | | }
|
| | | }
|
| | | moneyInfoVO.setShareMoney("¥" + JDUtil.getGoodsFanLiMoney(goods, params.getShareRate()));
|
| | | goodsInfo.setMoneyInfo(moneyInfoVO);
|
| | |
| | | goodsInfo.setCouponInfo(coupon);
|
| | | }
|
| | |
|
| | | BigDecimal baseCommisstion = null;
|
| | | if (params.getBaseFanliRate() != null)
|
| | | baseCommisstion = PinDuoDuoUtil.getGoodsFanLiMoney(goods, params.getBaseFanliRate());
|
| | |
|
| | | if (params.getMaxRewardRate() != null)
|
| | | moneyInfoVO
|
| | | .setMaxMoney("¥" + commission.add(MoneyBigDecimalUtil.mul(commission, params.getMaxRewardRate())));
|
| | |
| | | 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);
|
| | |
|
| | |
| | | return goodsInfo;
|
| | | }
|
| | |
|
| | | |
| | | }
|
| | |
| | |
|
| | | public static String convertLinkWithSubUnionId(String materialId, String couponUrl, String positionId,
|
| | | String subUnionId) {
|
| | | JSONObject json = new JSONObject();
|
| | | json.put("materialId", materialId);
|
| | | json.put("siteId", APP_ID);
|
| | | json.put("positionId", positionId);
|
| | | String log = "京东转链出错:";
|
| | | try {
|
| | | JSONObject json = new JSONObject();
|
| | | json.put("materialId", materialId);
|
| | | json.put("siteId", APP_ID);
|
| | | json.put("positionId", positionId);
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(couponUrl))
|
| | | json.put("couponUrl", couponUrl);
|
| | | if (!StringUtil.isNullOrEmpty(couponUrl))
|
| | | json.put("couponUrl", couponUrl);
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(subUnionId))
|
| | | json.put("subUnionId", subUnionId);
|
| | | if (!StringUtil.isNullOrEmpty(subUnionId))
|
| | | json.put("subUnionId", subUnionId);
|
| | |
|
| | | // 1:长链, 2 :短链 ,3: 长链+短链
|
| | | json.put("chainType", 3);
|
| | | JSONObject root = new JSONObject();
|
| | | root.put("promotionCodeReq", json);
|
| | | // 1:长链, 2 :短链 ,3: 长链+短链
|
| | | json.put("chainType", 3);
|
| | | JSONObject root = new JSONObject();
|
| | | root.put("promotionCodeReq", json);
|
| | |
|
| | | String result = baseRequest2("jd.union.open.promotion.bysubunionid.get", null, root);
|
| | | String result = baseRequest2("jd.union.open.promotion.bysubunionid.get", null, root);
|
| | |
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | result = resultJson.optJSONObject("jd_union_open_promotion_bysubunionid_get_response").optString("result");
|
| | | System.out.println(result);
|
| | | if (result == null) {
|
| | | return null;
|
| | | log += json.toString() + "####" + result;
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | result = resultJson.optJSONObject("jd_union_open_promotion_bysubunionid_get_response").optString("result");
|
| | | System.out.println(result);
|
| | | if (result == null) {
|
| | | return null;
|
| | | }
|
| | |
|
| | | resultJson = JSONObject.fromObject(result);
|
| | | return resultJson.optJSONObject("data").optString("shortURL");
|
| | | } catch (Exception e) {
|
| | | LogHelper.error(log);
|
| | | }
|
| | |
|
| | | resultJson = JSONObject.fromObject(result);
|
| | | return resultJson.optJSONObject("data").optString("shortURL");
|
| | | return null;
|
| | | }
|
| | |
|
| | | public static JDGoods queryGoodsDetail(Long skuId) {
|
| | |
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | |
|
| | | public class MoneyInfoVO implements Serializable{
|
| | | public class MoneyInfoVO implements Serializable {
|
| | | /**
|
| | | *
|
| | | */
|
| | |
| | | @Expose
|
| | | private String maxMoney;// 最高返回
|
| | | @Expose
|
| | | private String rateInfo;//比例信息
|
| | | private String rateInfo;// 比例信息
|
| | | @Expose
|
| | | private String rateInfoHelpUrl;//比例帮助链接
|
| | | private String rateInfoHelpUrl;// 比例帮助链接
|
| | | @Expose
|
| | | private String compositionInfo;// 构成信息
|
| | |
|
| | | private String maxRateInfo;// 最大比例信息
|
| | |
|
| | | private String maxRateInfo;//最大比例信息
|
| | | |
| | | private String maxCompositionInfo;//最大构成信息
|
| | |
|
| | | public String getMaxCompositionInfo() {
|
| | | return maxCompositionInfo;
|
| | | }
|
| | |
|
| | | public void setMaxCompositionInfo(String maxCompositionInfo) {
|
| | | this.maxCompositionInfo = maxCompositionInfo;
|
| | | }
|
| | |
|
| | | public String getCompositionInfo() {
|
| | | return compositionInfo;
|
| | | }
|
| | |
|
| | | public void setCompositionInfo(String compositionInfo) {
|
| | | this.compositionInfo = compositionInfo;
|
| | | }
|
| | |
|
| | | public String getMaxRateInfo() {
|
| | | return maxRateInfo;
|
| | |
| | | public void setMaxMoney(String maxMoney) {
|
| | | this.maxMoney = maxMoney;
|
| | | }
|
| | | |
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.vo.user;
|
| | |
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | public class UserDialogBtnVO {
|
| | | private String name;
|
| | | private JumpDetailV2 jumpDetail;
|
| | | private JSONObject params;
|
| | |
|
| | | public UserDialogBtnVO(String name, JumpDetailV2 jumpDetail, JSONObject params) {
|
| | | super();
|
| | | this.name = name;
|
| | | this.jumpDetail = jumpDetail;
|
| | | this.params = params;
|
| | | }
|
| | |
|
| | | public String getName() {
|
| | | return name;
|
| | | }
|
| | |
|
| | | public void setName(String name) {
|
| | | this.name = name;
|
| | | }
|
| | |
|
| | | public JumpDetailV2 getJumpDetail() {
|
| | | return jumpDetail;
|
| | | }
|
| | |
|
| | | public void setJumpDetail(JumpDetailV2 jumpDetail) {
|
| | | this.jumpDetail = jumpDetail;
|
| | | }
|
| | |
|
| | | public JSONObject getParams() {
|
| | | return params;
|
| | | }
|
| | |
|
| | | public void setParams(JSONObject params) {
|
| | | this.params = params;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.vo.user;
|
| | |
|
| | | public class UserDialogVO {
|
| | | private String id;
|
| | | private boolean close;
|
| | | private String title;
|
| | | private String content;
|
| | | private UserDialogBtnVO positive;
|
| | | private UserDialogBtnVO negative;
|
| | |
|
| | | public UserDialogVO(String id, boolean close, String title, String content, UserDialogBtnVO positive,
|
| | | UserDialogBtnVO negative) {
|
| | | super();
|
| | | this.id = id;
|
| | | this.close = close;
|
| | | this.title = title;
|
| | | this.content = content;
|
| | | this.positive = positive;
|
| | | this.negative = negative;
|
| | | }
|
| | |
|
| | | public String getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(String id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public boolean isClose() {
|
| | | return close;
|
| | | }
|
| | |
|
| | | public void setClose(boolean close) {
|
| | | this.close = close;
|
| | | }
|
| | |
|
| | | public String getTitle() {
|
| | | return title;
|
| | | }
|
| | |
|
| | | public void setTitle(String title) {
|
| | | this.title = title;
|
| | | }
|
| | |
|
| | | public String getContent() {
|
| | | return content;
|
| | | }
|
| | |
|
| | | public void setContent(String content) {
|
| | | this.content = content;
|
| | | }
|
| | |
|
| | | public UserDialogBtnVO getPositive() {
|
| | | return positive;
|
| | | }
|
| | |
|
| | | public void setPositive(UserDialogBtnVO positive) {
|
| | | this.positive = positive;
|
| | | }
|
| | |
|
| | | public UserDialogBtnVO getNegative() {
|
| | | return negative;
|
| | | }
|
| | |
|
| | | public void setNegative(UserDialogBtnVO negative) {
|
| | | this.negative = negative;
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | /**
|
| | | * 获取post返回location
|
| | | * |
| | | * @param url
|
| | | * @return
|
| | | */
|
| | |
| | | String result = HttpUtil.post(url, root.toString());
|
| | | }
|
| | |
|
| | | public static String getShortUrl(String accessToken, String url) {
|
| | |
|
| | | String requestUrl = "https://api.weixin.qq.com/cgi-bin/shorturl?access_token=" + accessToken;
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("action", "long2short");
|
| | | data.put("long_url", url);
|
| | | String result = HttpUtil.post(requestUrl, data.toString());
|
| | | System.out.println(result);
|
| | | return "";
|
| | | }
|
| | |
|
| | | }
|