| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.json.JSONArray;
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | |
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.FloatAD;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.FloatAD.FloatADTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgDeviceReadState;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.UserActiveLog;
|
| | |
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.vo.homemodule.BannerVO;
|
| | | import com.yeshi.fanli.vo.user.UserDialogBtnVO;
|
| | | import com.yeshi.fanli.vo.user.UserDialogVO;
|
| | | import com.yeshi.fanli.vo.user.VIPUpgradedNotifyVO;
|
| | |
| | | private TBPidService tbPidService;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoUnionConfigService taoBaoUnionConfigService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | |
|
| | | @Resource
|
| | | private FloatADService floatADService;
|
| | |
|
| | | @Resource
|
| | |
| | |
|
| | | @Resource
|
| | | private MsgDeviceReadStateService msgDeviceReadStateService;
|
| | |
|
| | | @Resource
|
| | | private UserTaoLiJinOriginService uerTaoLiJinOriginService;
|
| | |
|
| | | @Resource
|
| | | private UserActiveLogService userActiveLogService;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | | |
| | | |
| | |
|
| | | @Resource
|
| | | private UserVIPInfoService userVIPInfoService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserVIPPreInfoService userVIPPreInfoService;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserVipConfigService userVipConfigService;
|
| | | |
| | |
|
| | | /**
|
| | | * s 首页配置信息
|
| | |
| | | if (uid != null && uid == 0L)
|
| | | uid = null;
|
| | |
|
| | | AppHomeFloatImg appHomeFloatImg = configService.getAppHomeFloatImg();
|
| | | AppHomeFloatImg appHomeFloatImg = configService.getAppHomeFloatImg(acceptData.getSystem());
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform()) && !Constant.IS_TEST) {
|
| | | appHomeFloatImg = null;
|
| | | }
|
| | |
| | | data.put("floatImg", appHomeFloatImg);
|
| | | }
|
| | |
|
| | | String notifyImg = configService.getAppHomeFloatNotifyImg();
|
| | | String notifyImg = configService.getAppHomeFloatNotifyImg(acceptData.getSystem());
|
| | | if (!StringUtil.isNullOrEmpty(notifyImg)) {
|
| | | data.put("floatNotifyImg", notifyImg);
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | // 领券帮助链接,1.5.2后生效
|
| | | String couponHelp = configService.get(ConfigKeyEnum.taobaoCouponHelp.getKey());
|
| | | String couponHelp = configService.getValue(ConfigKeyEnum.taobaoCouponHelp.getKey(),acceptData.getSystem());
|
| | | data.put("couponHelpUrl", couponHelp);
|
| | |
|
| | | // 底部网页链接
|
| | | String platform = acceptData.getPlatform();
|
| | | if ("android".equalsIgnoreCase(platform)) {
|
| | | data.put("htmlLink", configService.get(ConfigKeyEnum.indexHtmlLinkAndroid.getKey()));
|
| | | data.put("htmlLink", configService.getValue(ConfigKeyEnum.indexHtmlLinkAndroid.getKey(),acceptData.getSystem()));
|
| | | }
|
| | |
|
| | | // 判断新老用户
|
| | |
| | | data.put("userTimeType", 1);
|
| | | }
|
| | | data.put("hotFuctionLink", configService.getByVersion(ConfigKeyEnum.hotFunctionUrl.getKey(), platform,
|
| | | Integer.parseInt(acceptData.getVersion())));//
|
| | | Integer.parseInt(acceptData.getVersion()),acceptData.getSystem()));//
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | // 是否需要购物城转链
|
| | | boolean convert = "0".equalsIgnoreCase(configService.get(ConfigKeyEnum.showTaobaoCartConvert.getKey())) ? false
|
| | | boolean convert = "0".equalsIgnoreCase(configService.getValue(ConfigKeyEnum.showTaobaoCartConvert.getKey(),acceptData.getSystem())) ? false
|
| | | : true;
|
| | |
|
| | | if (!"cart".equalsIgnoreCase(position) && !convert) {
|
| | |
| | | clientTBPid = tbPidService.getAndroidDefault();
|
| | | }
|
| | |
|
| | | String cartJS = configService.get(ConfigKeyEnum.taobaoCartJS.getKey());
|
| | | String cartUrl = configService.get(ConfigKeyEnum.taobaoCartLink.getKey());
|
| | | String cartJS = configService.getValue(ConfigKeyEnum.taobaoCartJS.getKey(),acceptData.getSystem());
|
| | | String cartUrl = configService.getValue(ConfigKeyEnum.taobaoCartLink.getKey(),acceptData.getSystem());
|
| | | if (!convert)// 不转链
|
| | | {
|
| | | cartUrl = "http://";
|
| | |
| | |
|
| | | @RequestMapping(value = "getBindAccountConfig", method = RequestMethod.POST)
|
| | | public void getBindAccountConfig(AcceptData acceptData, PrintWriter out) {
|
| | | String alipayHelpUrl = configService.get(ConfigKeyEnum.alipayHelp.getKey());// 支付宝帮助
|
| | | String alipayBindFailUrl = configService.get(ConfigKeyEnum.alipayBindFailReason.getKey());// 支付宝绑定失败原因
|
| | | String alipayHelpUrl = configService.getValue(ConfigKeyEnum.alipayHelp.getKey(),acceptData.getSystem());// 支付宝帮助
|
| | | String alipayBindFailUrl = configService.getValue(ConfigKeyEnum.alipayBindFailReason.getKey(),acceptData.getSystem());// 支付宝绑定失败原因
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("alipayHelp", alipayHelpUrl);
|
| | | data.put("alipayBindFailReason", alipayBindFailUrl);
|
| | |
| | | public void getUserConfig(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | try {
|
| | | // 用户协议链接
|
| | | String serviceProtocol = configService.get(ConfigKeyEnum.serviceProtocolLink.getKey());
|
| | | String serviceProtocol = configService.getValue(ConfigKeyEnum.serviceProtocolLink.getKey(),acceptData.getSystem());
|
| | | // 隐私条款链接
|
| | | String privacyProtocol = configService.get(ConfigKeyEnum.privacyProtocolLink.getKey());
|
| | | String privacyProtocol = configService.getValue(ConfigKeyEnum.privacyProtocolLink.getKey(),acceptData.getSystem());
|
| | | JSONObject data = new JSONObject();
|
| | | 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())));
|
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()),acceptData.getSystem()));
|
| | | 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()));
|
| | | if (banner == null)
|
| | | banner = new ArrayList<SwiperPicture>();
|
| | | data.put("banner", JsonUtil.getApiCommonGson().toJson(banner));
|
| | | // IOS正在上线版本
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform())
|
| | | && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()),acceptData.getSystem())) {
|
| | | data.put("banner", new JSONArray());
|
| | | } else {
|
| | | // 我的界面banner
|
| | | List<BannerVO> banner = swiperPictureService.getByBannerCardAndVersion("my_interface_banner",
|
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()),acceptData.getSystem());
|
| | | if (banner == null)
|
| | | banner = new ArrayList<BannerVO>();
|
| | | data.put("banner", JsonUtil.getApiCommonGson().toJson(banner));
|
| | | }
|
| | | }
|
| | |
|
| | | if (VersionUtil.greaterThan_2_0_7(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | // 转链的网页链接
|
| | | String convertLinkUrl = configService.get(ConfigKeyEnum.convertDocWebLink.getKey());
|
| | | String convertLinkUrl = configService.getValue(ConfigKeyEnum.convertDocWebLink.getKey(),acceptData.getSystem());
|
| | | data.put("convertLinkUrl", convertLinkUrl);
|
| | | if (uid != null) {
|
| | |
|
| | | String tearcherLink = configService.getByVersion(ConfigKeyEnum.tearcherLink.getKey(),
|
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()),acceptData.getSystem());
|
| | | if (userActivedRecordService.canNotifyAddTearcher(uid) && !StringUtil.isNullOrEmpty(tearcherLink)) {
|
| | | UserInfo userInfo = userInfoService.selectAvailableByPrimaryKey(uid);
|
| | | if (userInfo != null) {
|
| | |
| | |
|
| | | JSONObject negativeParams = new JSONObject();
|
| | | negativeParams.put("url", configService.getByVersion(ConfigKeyEnum.newerGonglue.getKey(),
|
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion())));
|
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()),acceptData.getSystem()));
|
| | |
|
| | | JSONObject positiveParams = new JSONObject();
|
| | | positiveParams.put("url", tearcherLink);
|
| | |
| | | data.put("tearcherLink", tearcherLink);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | // TODO 验证是否是导师
|
| | | |
| | | UserVIPPreInfo info = userVIPPreInfoService.getLatestProcessInfo(uid);
|
| | | JSONObject inner = new JSONObject();
|
| | | inner.put("link", userVipConfigService.getValueByKey("vip_link"));
|
| | | inner.put("ion", "http://img.flqapp.com/resource/vip/icon_vip.png");
|
| | | inner.put("title", "免费升级 享会员权益");
|
| | | inner.put("btnName", "升级会员");
|
| | |
|
| | | if (uid != null) {
|
| | | // 是否导师 TODO
|
| | | if (userVIPInfoService.isVIP(uid)) {
|
| | | if (info != null && info.getProcess() >= UserVIPPreInfo.PROCESS_3) {
|
| | | inner.put("link", userVipConfigService.getValueByKey("vip_link"));
|
| | | inner.put("ion", "http://img.flqapp.com/resource/vip/icon_tearcher.png");
|
| | | inner.put("title", "拿五险与津贴 享导师权益");
|
| | | inner.put("btnName", "升级会员");
|
| | | if (info.getProcess() == UserVIPPreInfo.PROCESS_4)
|
| | | inner.put("btnName", "板栗快省");
|
| | | else
|
| | | inner.put("btnName", "升级导师");
|
| | | } else {
|
| | | UserVIPPreInfo userVIPPreInfo = userVIPPreInfoService.getLatestProcessInfo(uid);
|
| | | if (userVIPPreInfo != null) {
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | data.put("vip", inner);
|
| | | } |
| | | // IOS正在上线
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform())
|
| | | && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()),acceptData.getSystem())) {
|
| | | } else
|
| | | data.put("vip", inner);
|
| | | // 平台规则
|
| | | String platformRuleLink = configService.getValue(ConfigKeyEnum.platformRule.getKey(),acceptData.getSystem());
|
| | | data.put("platformRule", platformRuleLink);
|
| | | }
|
| | |
|
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion()) && uid != null) {
|
| | | UserLevelUpgradedNotify notify = userLevelUpgradedNotifyService.getNeedNotifyByUid(uid);
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | // 云发单链接
|
| | | if (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | boolean cloudOpen = configService.isRobotCloudOpen(ConfigKeyEnum.robotCloudOpen.getKey(),acceptData.getPlatform(), acceptData.getVersion(),acceptData.getSystem());
|
| | | if (!cloudOpen && uid != null) {
|
| | | List<String> testUsers = configService.getTestUsers(acceptData.getSystem());
|
| | | if (testUsers != null && testUsers.contains(uid+"")) {
|
| | | cloudOpen = true;
|
| | | }
|
| | | }
|
| | | |
| | | if (cloudOpen) {
|
| | | data.put("cloudLink", configService.getValue(ConfigKeyEnum.robotCloudLink.getKey(),acceptData.getSystem()));
|
| | | }
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("获取失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | |
| | |
|
| | | // 获取升级时间
|
| | | private Date getUpgradedTime(Long uid, UserLevelEnum level) {
|
| | |
| | | @RequestMapping(value = "getOrderParseConfig", method = RequestMethod.POST)
|
| | | public void getOrderParseConfig(AcceptData acceptData, PrintWriter out) {
|
| | |
|
| | | if ("0".equalsIgnoreCase(configService.get(ConfigKeyEnum.autoFindTaobaoOrder.getKey())))
|
| | | if ("0".equalsIgnoreCase(configService.getValue(ConfigKeyEnum.autoFindTaobaoOrder.getKey(),acceptData.getSystem())))
|
| | | out.print(JsonUtil.loadFalseResult(1, "暂不支持"));
|
| | | else {
|
| | | String orderJS = configService.get(ConfigKeyEnum.taobaoOrderParseJS.getKey());
|
| | | String orderJS = configService.getValue(ConfigKeyEnum.taobaoOrderParseJS.getKey(),acceptData.getSystem());
|
| | | JSONObject data = new JSONObject();
|
| | | try {
|
| | | data.put("orderJS", DESUtil.encode(orderJS, StringUtil.getBase64String("YeShiFANLI889*+"),
|
| | |
| | | JSONObject data = new JSONObject();
|
| | | // 测试
|
| | | data.put("showTaoBaoOrder",
|
| | | "0".equalsIgnoreCase(configService.get(ConfigKeyEnum.showTaobaoOrder.getKey()).trim()) ? false : true);
|
| | | "0".equalsIgnoreCase(configService.getValue(ConfigKeyEnum.showTaobaoOrder.getKey(),acceptData.getSystem()).trim()) ? false : true);
|
| | | data.put("taoBaoOrderUrl", "https://main.m.taobao.com/olist/index.html");
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
| | | @RequestMapping(value = "getKeFuConfig", method = RequestMethod.POST)
|
| | | public void getKeFuConfig(AcceptData acceptData, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("meiqia", "1".equalsIgnoreCase(configService.get(ConfigKeyEnum.kefuMeiqia.getKey())) ? true : false);// 是否跳转美洽,不跳转美洽就用原来的
|
| | | data.put("meiqia", "1".equalsIgnoreCase(configService.getValue(ConfigKeyEnum.kefuMeiqia.getKey(),acceptData.getSystem())) ? true : false);// 是否跳转美洽,不跳转美洽就用原来的
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | // 设置消息已读
|
| | | ThreadUtil.run(new Runnable() {
|
| | |
| | | @RequestMapping(value = "getInviteCodeInputHelp", method = RequestMethod.POST)
|
| | | public void getInviteCodeInputHelp(AcceptData acceptData, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("helpUrl", configService.get(ConfigKeyEnum.inviteCodeInputHelp.getKey()));
|
| | | data.put("helpUrl", configService.getValue(ConfigKeyEnum.inviteCodeInputHelp.getKey(),acceptData.getSystem()));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|