| | |
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | | import org.yeshi.utils.IPUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.NumberUtil;
|
| | |
| | | import com.yeshi.fanli.entity.bus.homemodule.Special;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SuperSpecial;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.bus.lable.QualityFactory;
|
| | | import com.yeshi.fanli.entity.bus.recommend.Honest;
|
| | | import com.yeshi.fanli.entity.bus.recommend.RecommendBanner;
|
| | | import com.yeshi.fanli.entity.bus.recommend.RecommendBannerV2;
|
| | | import com.yeshi.fanli.entity.bus.recommend.RecommendSection;
|
| | | import com.yeshi.fanli.entity.bus.recommend.RecommendSectionGoods;
|
| | | import com.yeshi.fanli.entity.bus.recommend.RecommendSpecial;
|
| | | import com.yeshi.fanli.entity.bus.su.recommend.SuperRecommendBanner;
|
| | | import com.yeshi.fanli.entity.bus.su.recommend.SuperRecommendBannerV2;
|
| | | import com.yeshi.fanli.entity.bus.su.recommend.SuperRecommendSection;
|
| | | import com.yeshi.fanli.entity.bus.su.recommend.SuperRecommendSpecial;
|
| | | import com.yeshi.fanli.entity.bus.user.Order;
|
| | | import com.yeshi.fanli.entity.bus.user.ShamUser;
|
| | |
| | | import com.yeshi.fanli.entity.goods.CollectionGoodsV2;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.goods.ScanHistoryV2;
|
| | | import com.yeshi.fanli.entity.system.System;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.entity.system.SystemClientParams;
|
| | | import com.yeshi.fanli.entity.taobao.ClientTBPid;
|
| | | import com.yeshi.fanli.entity.taobao.PidUser;
|
| | |
| | | import com.yeshi.fanli.exception.user.UserCustomSettingsException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.config.BusinessSystemService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.config.JumpDetailService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemClientParamsService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemConfigService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemService;
|
| | | import com.yeshi.fanli.service.inter.goods.CollectionGoodsV2Service;
|
| | | import com.yeshi.fanli.service.inter.goods.CommonGoodsService;
|
| | | import com.yeshi.fanli.service.inter.goods.RecommendBannerService;
|
| | | import com.yeshi.fanli.service.inter.goods.RecommendSectionGoodsService;
|
| | | import com.yeshi.fanli.service.inter.goods.ScanHistoryV2Service;
|
| | | import com.yeshi.fanli.service.inter.goods.SuperRecommendBannerService;
|
| | | import com.yeshi.fanli.service.inter.goods.SuperRecommendBannerV2Service;
|
| | | import com.yeshi.fanli.service.inter.goods.SuperRecommendSectionService;
|
| | | import com.yeshi.fanli.service.inter.goods.SuperRecommendSpecialService;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoCouponService;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
|
| | |
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.user.ShamUserService;
|
| | | import com.yeshi.fanli.service.inter.user.ShareManageService;
|
| | | import com.yeshi.fanli.service.inter.user.TBPidService;
|
| | | import com.yeshi.fanli.service.inter.user.UserCustomSettingsService;
|
| | | import com.yeshi.fanli.service.inter.user.UserGoodsStorageService;
|
| | |
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.Utils;
|
| | | import com.yeshi.fanli.util.factory.MonitorFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoCouponUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil;
|
| | |
| | | private RecommendBannerService recommendService;
|
| | |
|
| | | @Resource
|
| | | private SystemService systemService;
|
| | | private BusinessSystemService businessSystemService;
|
| | |
|
| | | @Resource
|
| | | private SuperRecommendBannerService superRecommendBannerService;
|
| | |
|
| | | @Resource
|
| | | private SuperRecommendSectionService superRecommendSectionService;
|
| | |
|
| | | @Resource
|
| | | private SuperRecommendSpecialService superRecommendSpecialService;
|
| | |
|
| | | @Resource
|
| | | private RecommendSectionGoodsService recommendSectionGoodsService;
|
| | |
|
| | | @Resource
|
| | | private OrderService orderService;
|
| | |
|
| | | @Resource
|
| | | private ScanHistoryV2Service scanHistoryV2Service;
|
| | |
|
| | | @Resource
|
| | | private ShareManageService shareManageService;
|
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | |
| | |
|
| | | @Resource
|
| | | private ShareGoodsActivityOrderService shareGoodsActivityOrderService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | |
|
| | | @RequestMapping(value = "getrecommendsection")
|
| | | public void getRecommendSection(AcceptData acceptData, int index, PrintWriter out) {
|
| | |
|
| | | if (index < 0) {
|
| | | index = 0;
|
| | | }
|
| | |
|
| | | System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
|
| | | return;
|
| | | }
|
| | | List<SuperRecommendSection> superRecommendSectionList = superRecommendSectionService
|
| | | .getSuperRecommendSectionBySystemId(system.getId());
|
| | | List<RecommendSection> recommendSectionList = null;
|
| | | for (SuperRecommendSection superRecommendSection : superRecommendSectionList) {
|
| | | if (recommendSectionList == null) {
|
| | | recommendSectionList = new ArrayList<RecommendSection>();
|
| | | }
|
| | | RecommendSection recommendSection = superRecommendSection.getRecommendSection();
|
| | |
|
| | | // 暂时改变淘特价的跳转地址
|
| | | if (system.getId() == 7) {
|
| | | recommendSection.setJumpUrl(recommendSection.getJumpUrl().replace("column.html", "column_ttj.html"));
|
| | | }
|
| | |
|
| | | recommendSectionList.add(recommendSection);
|
| | | }
|
| | | if (recommendSectionList == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "暂无数据"));
|
| | | return;
|
| | | }
|
| | | Utils.sort(recommendSectionList);
|
| | | int size = recommendSectionList.size();
|
| | |
|
| | | List<RecommendSectionGoods> recommendSectionGoodsList = null;
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", size);
|
| | | JSONArray dataArr = new JSONArray();
|
| | | JSONObject validData = null;
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | BigDecimal proportion = manageService.getFanLiRate();
|
| | | Map<Long, List<RecommendSectionGoods>> map = recommendSectionGoodsService.getAllSectionGoodsMap();
|
| | | for (int i = 0; i < size; i++) {
|
| | | validData = new JSONObject();
|
| | | RecommendSection recommendSection = recommendSectionList.get(i);
|
| | | recommendSectionGoodsList = map.get(recommendSection.getId());
|
| | | if (recommendSectionGoodsList == null) {
|
| | | continue;
|
| | | }
|
| | | Utils.sort(recommendSectionGoodsList);
|
| | | if (recommendSection.getCounts() < recommendSectionGoodsList.size()) {
|
| | | recommendSectionGoodsList = recommendSectionGoodsList.subList(0, recommendSection.getCounts());
|
| | | }
|
| | | validData.put("count", recommendSectionGoodsList.size());
|
| | | validData.put("recommendSection", gson.toJson(recommendSection));
|
| | |
|
| | | // 替换TaoBaoGoodsBrief
|
| | | JSONArray array = new JSONArray();
|
| | | Gson gson2 = new GsonBuilder().setDateFormat("yyyy-MM-dd").create();
|
| | | for (RecommendSectionGoods rss : recommendSectionGoodsList) {
|
| | | JSONObject obj = JSONObject.fromObject(gson2.toJson(rss));
|
| | | String json = gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(
|
| | | gson2.fromJson(obj.optJSONObject("taoBaoGoodsBrief").toString(), TaoBaoGoodsBrief.class),
|
| | | proportion.toString(), ""));
|
| | | obj.put("taoBaoGoodsBrief", json);
|
| | | array.add(obj);
|
| | | }
|
| | |
|
| | | validData.put("recommendSectionGoodsList", array);
|
| | | dataArr.add(validData);
|
| | | }
|
| | | data.put("data", dataArr);
|
| | |
|
| | | String result = JsonUtil.loadTrueResult(data);
|
| | | if (Constant.IS_OUTNET)
|
| | | redisManager.cacheCommonString("client-api-getRecommendSection", result, 3 * 60);
|
| | |
|
| | | out.print(result);
|
| | | return;
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "getHonestList")
|
| | | public void getHonestList(AcceptData acceptData, PrintWriter out) {
|
| | | System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | List<Honest> honestList = null;
|
| | | List<TaoBaoUnionConfig> configList = taoBaoUnionConfigService.getConfigByTypeCache(PidUser.TYPE_FANLI_ANDROID);
|
| | | if ((Integer.parseInt(acceptData.getVersion()) >= 20 && "android".equalsIgnoreCase(acceptData.getPlatform()))
|
| | |
| | | @RequestMapping(value = "getrecommendspecial")
|
| | | public void getRecommendSpecial(AcceptData acceptData, PrintWriter out) {
|
| | |
|
| | | System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | |
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
|
| | |
| | | if (!"1".equals(version) && "android".equalsIgnoreCase(acceptData.getPlatform())) {
|
| | | jumpDetail = jumpDetailService.getlastJumpDetailCache();
|
| | | }
|
| | | List<RecommendSpecial> recommendSpecialList = null;
|
| | |
|
| | | List<SuperRecommendSpecial> superRecommendSpecialList = superRecommendSpecialService
|
| | | .getSuperRecommendSpecialBySystemId(system.getId());
|
| | | if (superRecommendSpecialList != null && superRecommendSpecialList.size() > 0) {
|
| | |
|
| | | List<RecommendSpecial> recommendSpecialList = null;
|
| | | for (SuperRecommendSpecial superRecommendSpecial : superRecommendSpecialList) {
|
| | | if (recommendSpecialList == null) {
|
| | | recommendSpecialList = new ArrayList<RecommendSpecial>();
|
| | | recommendSpecialList = new ArrayList<RecommendSpecial>();
|
| | |
|
| | | for (SuperRecommendSpecial superRecommendSpecial : superRecommendSpecialList) {
|
| | | RecommendSpecial recommendSpecial = superRecommendSpecial.getRecommendSpecial();
|
| | | if (jumpDetail != null) {
|
| | | recommendSpecial.setJumpDetail(jumpDetail);
|
| | | }
|
| | | recommendSpecialList.add(recommendSpecial);
|
| | | }
|
| | | RecommendSpecial recommendSpecial = superRecommendSpecial.getRecommendSpecial();
|
| | | if (jumpDetail != null) {
|
| | | recommendSpecial.setJumpDetail(jumpDetail);
|
| | | }
|
| | | recommendSpecialList.add(recommendSpecial);
|
| | | }
|
| | |
|
| | | if (recommendSpecialList == null || recommendSpecialList.size() == 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "暂无数据"));
|
| | | return;
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", recommendSpecialList.size());
|
| | | Gson gson = new Gson();
|
| | |
| | | @RequestMapping(value = "guessLike", method = RequestMethod.POST)
|
| | | public void guessLike(AcceptData acceptData, PrintWriter out) {
|
| | |
|
| | | System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | |
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
|
| | |
| | | @RequestMapping(value = "getrecommendbanner")
|
| | | public void getRecommendBanner(AcceptData acceptData, PrintWriter out) {
|
| | |
|
| | | System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | JSONObject json = new JSONObject();
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
|
| | |
| | | out.print(JsonUtil.loadFalseResult(1, "请上传id"));
|
| | | return;
|
| | | }
|
| | | System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | // 淘特价
|
| | | if (system.getId() == 7) {
|
| | | system = systemService.getSystem("ANDROID", Constant.systemCommonConfig.getAndroidPackageName());
|
| | | }
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | |
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | | // 获取会员推广位或者默认推广位
|
| | |
|
| | | TaoBaoGoodsBrief simpleGoods = null;
|
| | | try {
|
| | | simpleGoods = redisManager.getTaoBaoGoodsBrief(Long.parseLong(id));
|
| | | } catch (NumberFormatException e2) {
|
| | | e2.printStackTrace();
|
| | | } catch (TaobaoGoodsDownException e2) {
|
| | | e2.printStackTrace();
|
| | | }
|
| | |
|
| | | if (simpleGoods == null) {
|
| | | out.print(JsonUtil.loadFalseResult(2, "商品已下架"));
|
| | | return;
|
| | | }
|
| | |
|
| | | // 获取淘客参数
|
| | | ClientTBPid clientTBPid = null;
|
| | | // 用户已经登录
|
| | | if (!StringUtil.isNullOrEmpty(uid) && Long.parseLong(uid) > 0) {
|
| | | TBPid tbPid = null;
|
| | | if (acceptData.getPlatform().equalsIgnoreCase("android")) {
|
| | | tbPid = tbPidService.getTBPid(Long.parseLong(uid), PidUser.TYPE_FANLI_ANDROID);
|
| | | if (tbPid != null) {
|
| | | String siteId = tbPid.getPid().split("_")[2];
|
| | | String adzoneId = tbPid.getPid().split("_")[3];
|
| | | TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppIdCache(siteId);
|
| | | clientTBPid = new ClientTBPid(config.getAppKey(), tbPid.getPid(), siteId, adzoneId);
|
| | | } else {
|
| | | clientTBPid = tbPidService.getAndroidDefault();
|
| | | }
|
| | |
|
| | | } else {
|
| | | tbPid = tbPidService.getTBPid(Long.parseLong(uid), PidUser.TYPE_FANLI_IOS);
|
| | | if (tbPid != null) {
|
| | | String siteId = tbPid.getPid().split("_")[2];
|
| | | String adzoneId = tbPid.getPid().split("_")[3];
|
| | | TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppIdCache(siteId);
|
| | | clientTBPid = new ClientTBPid(config.getAppKey(), tbPid.getPid(), siteId, adzoneId);
|
| | | } else {
|
| | | clientTBPid = tbPidService.getIOSDefault();
|
| | | }
|
| | | }
|
| | | if (simpleGoods.getMaterialLibType() != null && simpleGoods.getMaterialLibType() == 1) {
|
| | | String pid = TaoBaoConstant.TAOBAO_SPECIAL_PID_DEFAULT;
|
| | | clientTBPid = new ClientTBPid(TaoBaoConstant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET,
|
| | | pid.split("_")[2], pid.split("_")[3]);
|
| | | } else {
|
| | | if (acceptData.getPlatform().equalsIgnoreCase("android"))
|
| | | if (acceptData.getPlatform().equalsIgnoreCase("android")) {
|
| | | clientTBPid = tbPidService.getAndroidDefault();
|
| | | else
|
| | | } else {
|
| | | clientTBPid = tbPidService.getIOSDefault();
|
| | | }
|
| | | }
|
| | |
|
| | | TaoBaoGoodsBrief tb = null;
|
| | |
| | |
|
| | | } else {
|
| | | out.print(JsonUtil.loadFalseResult(2, "商品已下架"));
|
| | | ThreadUtil.run(new Runnable() {
|
| | | public void run() {
|
| | | recommendSectionGoodsService.deleteRecommendSectionGoodsByTbAuctionId(Long.parseLong(id));
|
| | | }
|
| | | });
|
| | | }
|
| | | long end = java.lang.System.currentTimeMillis();
|
| | | java.lang.System.out.println("耗时:" + (end - begin));
|
| | |
| | | out.print(JsonUtil.loadFalseResult(1, "请上传id"));
|
| | | return;
|
| | | }
|
| | | System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | |
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
|
| | |
| | | // 获取淘客参数
|
| | | ClientTBPid clientTBPid = null;
|
| | | // 用户已经登录
|
| | | if (!StringUtil.isNullOrEmpty(uid)) {
|
| | | TBPid tbPid = null;
|
| | | if (acceptData.getPlatform().equalsIgnoreCase("android")) {
|
| | | tbPid = tbPidService.getTBPid(Long.parseLong(uid), PidUser.TYPE_FANLI_ANDROID);
|
| | | if (tbPid != null) {
|
| | | String siteId = tbPid.getPid().split("_")[2];
|
| | | String adzoneId = tbPid.getPid().split("_")[3];
|
| | | TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppIdCache(siteId);
|
| | | clientTBPid = new ClientTBPid(config.getAppKey(), tbPid.getPid(), siteId, adzoneId);
|
| | | } else {
|
| | | clientTBPid = tbPidService.getAndroidDefault();
|
| | | }
|
| | |
|
| | | } else {
|
| | | tbPid = tbPidService.getTBPid(Long.parseLong(uid), PidUser.TYPE_FANLI_IOS);
|
| | | if (tbPid != null) {
|
| | |
|
| | | String siteId = tbPid.getPid().split("_")[2];
|
| | | String adzoneId = tbPid.getPid().split("_")[3];
|
| | | TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppIdCache(siteId);
|
| | | clientTBPid = new ClientTBPid(config.getAppKey(), tbPid.getPid(), siteId, adzoneId);
|
| | | } else {
|
| | | clientTBPid = tbPidService.getIOSDefault();
|
| | | }
|
| | | }
|
| | |
|
| | | } else {
|
| | | if (acceptData.getPlatform().equalsIgnoreCase("android"))
|
| | | clientTBPid = tbPidService.getAndroidDefault();
|
| | | else
|
| | | clientTBPid = tbPidService.getIOSDefault();
|
| | | }
|
| | | if (acceptData.getPlatform().equalsIgnoreCase("android"))
|
| | | clientTBPid = tbPidService.getAndroidDefault();
|
| | | else
|
| | | clientTBPid = tbPidService.getIOSDefault();
|
| | |
|
| | | LogHelper.test("获取PID耗时:" + (java.lang.System.currentTimeMillis() - startTime));
|
| | |
|
| | |
| | | if (!StringUtil.isNullOrEmpty(uid)) {
|
| | | TBPid tbPid = null;
|
| | | if (acceptData.getPlatform().equalsIgnoreCase("android")) {
|
| | | tbPid = tbPidService.getTBPid(Long.parseLong(uid), PidUser.TYPE_FANLI_ANDROID);
|
| | | if (tbPid != null) {
|
| | | String siteId = tbPid.getPid().split("_")[2];
|
| | | String adzoneId = tbPid.getPid().split("_")[3];
|
| | | TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppIdCache(siteId);
|
| | | clientTBPid = new ClientTBPid(config.getAppKey(), tbPid.getPid(), siteId, adzoneId);
|
| | | } else {
|
| | | clientTBPid = tbPidService.getAndroidDefault();
|
| | | }
|
| | | clientTBPid = tbPidService.getAndroidDefault();
|
| | | } else {
|
| | | tbPid = tbPidService.getTBPid(Long.parseLong(uid), PidUser.TYPE_FANLI_IOS);
|
| | | if (tbPid != null) {
|
| | | String siteId = tbPid.getPid().split("_")[2];
|
| | | String adzoneId = tbPid.getPid().split("_")[3];
|
| | | TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppIdCache(siteId);
|
| | | clientTBPid = new ClientTBPid(config.getAppKey(), tbPid.getPid(), siteId, adzoneId);
|
| | | } else {
|
| | | clientTBPid = tbPidService.getIOSDefault();
|
| | | }
|
| | | clientTBPid = tbPidService.getIOSDefault();
|
| | | }
|
| | |
|
| | | } else {
|
| | |
| | | // 根据商品获取推荐
|
| | | @RequestMapping(value = "getgoodsrecommend", method = RequestMethod.POST)
|
| | | public void getGoodsRecommend(final AcceptData acceptData, long id, PrintWriter out) {
|
| | | System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
|
| | | return;
|
| | |
| | | goodsList.add(gds);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | // 需要另做推荐
|
| | | if (goodsList.size() < 6) {
|
| | | List<RecommendSectionGoods> list = recommendSectionGoodsService.getSectionGoods(10);
|
| | | if (list != null)
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | if (goodsList.size() < 6)
|
| | | goodsList.add(list.get(i).getTaoBaoGoodsBrief());
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | String[] orderArr = order.split(",");
|
| | | for (String tbOrder : orderArr) {
|
| | | Order or = new Order();
|
| | | or.setBeizhu("系统添加");
|
| | | or.setBeizhu("接口添加");
|
| | | or.setCreatetime(java.lang.System.currentTimeMillis());
|
| | | or.setDrawbackTime(0L);
|
| | | or.setOrderId(tbOrder.trim());
|
| | |
| | | return;
|
| | | }
|
| | | page = page + 1;
|
| | | System sys = systemService.getSystem(acceptData.getPlatform(), acceptData.getPackages());
|
| | | BusinessSystem sys = businessSystemService.getBusinessSystem(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | if (sys == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "不存在该系统"));
|
| | | return;
|
| | |
| | |
|
| | | @RequestMapping(value = "deletescanhistory", method = RequestMethod.POST)
|
| | | public void deleteScanHistory(AcceptData acceptData, String type, String uid, String ids, PrintWriter out) {
|
| | | System sys = systemService.getSystem(acceptData.getPlatform(), acceptData.getPackages());
|
| | | BusinessSystem sys = businessSystemService.getBusinessSystem(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | |
|
| | | if (sys == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
|
| | |
| | | for (TaoBaoGoodsBrief goods : result.getTaoBaoGoodsBriefs()) {
|
| | | if (!StringUtil.isNullOrEmpty(goods.getCouponInfo()) && goods.getCouponAmount() != null
|
| | | && goods.getCouponAmount().compareTo(new BigDecimal("5")) >= 0
|
| | | && goods.getBiz30day() > 1000)
|
| | | && goods.getBiz30day() > 1000 && !StringUtil.isNullOrEmpty(goods.getPictUrlWhite()))
|
| | | goodsList.add(goods);
|
| | | }
|
| | | try {
|
| | |
| | | @RequestMapping(value = "getRecommendInfo")
|
| | | public void getRecommendHomeInfo(AcceptData acceptData, PrintWriter out) {
|
| | |
|
| | | System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | | // 首页Banner
|
| | | List<RecommendBannerV2> listBanner = null;
|
| | |
|
| | | List<SuperRecommendBannerV2> listRecommendBanner = superRecommendBannerV2Service
|
| | | .getSuperRecommendBannerV2sBySystem(system);
|
| | |
|
| | | if (listRecommendBanner != null && listRecommendBanner.size() > 0) {
|
| | |
|
| | | listBanner = new ArrayList<RecommendBannerV2>();
|
| | |
|
| | | for (SuperRecommendBannerV2 superRecommendBanner : listRecommendBanner) {
|
| | | RecommendBannerV2 recommendBanner = superRecommendBanner.getRecommendBanner();
|
| | | // 淘特价暂时修改
|
| | | if (system.getId() == 7) {
|
| | | recommendBanner.getJumpDetail().setActivity(recommendBanner.getJumpDetail().getActivity()
|
| | | .replace("com.yeshi.ec.rebate.myapplication", "com.yeshi.ec.taospecial"));
|
| | | }
|
| | |
|
| | | listBanner.add(recommendBanner);
|
| | | }
|
| | | }
|
| | | List<RecommendBannerV2> listBanner = superRecommendBannerV2Service
|
| | | .getSuperRecommendBannerV2sBySystem(system.getId());
|
| | |
|
| | | JSONObject root = new JSONObject();
|
| | | root.put("banner", listBanner);
|
| | |
| | | public void getNewRecommendInfo(AcceptData acceptData, Long uid, String specialCard, String swiperCard,
|
| | | PrintWriter out) {
|
| | |
|
| | | System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
|
| | | return;
|
| | |
| | |
|
| | | listswiper = swiperPictureService.getByBannerCard(swiperCard);
|
| | |
|
| | | if (listswiper != null && listswiper.size() > 0) {
|
| | | for (SwiperPicture swiperPicture : listswiper) {
|
| | | swiperPicture.setBannerId(null);
|
| | | swiperPicture.setCreatetime(null);
|
| | | swiperPicture.setUpdatetime(null);
|
| | | swiperPicture.setState(null);
|
| | | swiperPicture.setRemark(null);
|
| | | }
|
| | | if (listswiper == null) {
|
| | | listswiper = new ArrayList<SwiperPicture>();
|
| | | }
|
| | |
|
| | | } catch (Exception e) {
|
| | |
| | |
|
| | | if (listSpecial != null && listSpecial.size() > 0) {
|
| | | for (Special special : listSpecial) {
|
| | | special.setCreatetime(null);
|
| | | special.setUpdatetime(null);
|
| | | special.setState(null);
|
| | | special.setRemark(null);
|
| | | special.setCard(null);
|
| | | special.setCardId(null);
|
| | |
|
| | | if ("限时秒杀".equals(special.getName())) {
|
| | | miaoShaSpecial = special;
|
| | |
| | | // 其他专题
|
| | | specialList.add(special);
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | JSONObject root = new JSONObject();
|
| | | root.put("banner", listswiper);
|
| | | root.put("honest", honestList);
|
| | | root.put("special", specialList);
|
| | |
|
| | | root.put("banner", JsonUtil.getApiCommonGson().toJson(listswiper));
|
| | | root.put("honest", JsonUtil.getApiCommonGson().toJson(honestList));
|
| | | root.put("special", JsonUtil.getApiCommonGson().toJson(specialList));
|
| | | root.put("miaoSha", msJSON);
|
| | |
|
| | | // 增加邀请有奖
|
| | | JSONObject invite = new JSONObject();
|
| | | JumpDetailV2 jumpDetail = jumpDetailV2Service.getByTypeCache("invite");
|
| | | invite.put("jumpDetail", jumpDetail);
|
| | | invite.put("picture", "http://ec-1255749512.file.myqcloud.com/resource/weex/img/invite_input_img.png");
|
| | | invite.put("picture", configService.get("home_invite_banner"));
|
| | |
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform())
|
| | | && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()))) {
|
| | |
| | | * @param acceptData
|
| | | * @param id
|
| | | * @param uid
|
| | | * @param pageSource
|
| | | * 页面来源
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getgoodsinfo", method = RequestMethod.POST)
|
| | | public void getGoodsInfo(AcceptData acceptData, String id, String uid, PrintWriter out) {
|
| | | public void getGoodsInfo(AcceptData acceptData, String id, String uid, String from, PrintWriter out) {
|
| | |
|
| | | if ("0".equalsIgnoreCase(uid)) {
|
| | | uid = "";
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
|
| | | return;
|
| | |
| | | // 获取淘客参数
|
| | | ClientTBPid clientTBPid = null;
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(uid)) {
|
| | | // 用户未登录
|
| | | if (acceptData.getPlatform().equalsIgnoreCase("android")) {
|
| | | clientTBPid = tbPidService.getAndroidDefault();
|
| | | } else {
|
| | | clientTBPid = tbPidService.getIOSDefault();
|
| | | }
|
| | |
|
| | | // 用户未登录
|
| | | if (acceptData.getPlatform().equalsIgnoreCase("android")) {
|
| | | clientTBPid = tbPidService.getAndroidDefault();
|
| | | } else {
|
| | |
|
| | | // 用户已经登录
|
| | | TBPid tbPid = null;
|
| | | if (acceptData.getPlatform().equalsIgnoreCase("android")) {
|
| | |
|
| | | tbPid = tbPidService.getTBPid(Long.parseLong(uid), PidUser.TYPE_FANLI_ANDROID);
|
| | |
|
| | | if (tbPid == null) {
|
| | | clientTBPid = tbPidService.getAndroidDefault();
|
| | | } else {
|
| | | String siteId = tbPid.getPid().split("_")[2];
|
| | | String adzoneId = tbPid.getPid().split("_")[3];
|
| | | TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppIdCache(siteId);
|
| | | clientTBPid = new ClientTBPid(config.getAppKey(), tbPid.getPid(), siteId, adzoneId);
|
| | | }
|
| | |
|
| | | } else {
|
| | |
|
| | | tbPid = tbPidService.getTBPid(Long.parseLong(uid), PidUser.TYPE_FANLI_IOS);
|
| | |
|
| | | if (tbPid == null) {
|
| | | clientTBPid = tbPidService.getIOSDefault();
|
| | | } else {
|
| | | String siteId = tbPid.getPid().split("_")[2];
|
| | | String adzoneId = tbPid.getPid().split("_")[3];
|
| | | TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppIdCache(siteId);
|
| | | clientTBPid = new ClientTBPid(config.getAppKey(), tbPid.getPid(), siteId, adzoneId);
|
| | | }
|
| | | }
|
| | | clientTBPid = tbPidService.getIOSDefault();
|
| | | }
|
| | |
|
| | | LogHelper.test("获取PID耗时:" + (java.lang.System.currentTimeMillis() - startTime));
|
| | |
| | |
|
| | | try {
|
| | | goods = redisManager.getTaoBaoGoodsBrief(Long.parseLong(id));
|
| | | if (goods.getTkRate() == null || new BigDecimal(0).compareTo(goods.getTkRate()) == 0) {
|
| | | String appId = clientPid.split("_")[2];
|
| | | TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppIdCache(appId);
|
| | | TaoKeAppInfo app = new TaoKeAppInfo();
|
| | | app.setAdzoneId(clientPid.split("_")[3]);
|
| | | app.setAppKey(config.getAppKey());
|
| | | app.setAppSecret(config.getAppSecret());
|
| | | app.setPid(clientPid);
|
| | | TaoBaoGoodsBrief linkInfo = TaoKeApiUtil.specialConvertCoupon(goods.getAuctionId(), app);
|
| | | if (linkInfo != null) {
|
| | | goods.setAuctionUrl(linkInfo.getAuctionUrl());
|
| | | goods.setCouponLink(linkInfo.getCouponLink());
|
| | | goods.setTkRate(linkInfo.getTkRate());
|
| | | }
|
| | | }
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | // 商品下架
|
| | | ThreadUtil.run(new Runnable() {
|
| | |
| | | // 测试使用
|
| | | ticket.put("couponUrl", goods.getCouponLink());
|
| | | data.put("ticket", ticket);
|
| | | }
|
| | |
|
| | | if (goods.getTkRate() == null || new BigDecimal(0).compareTo(goods.getTkRate()) == 0) {
|
| | | TaoBaoGoodsBrief linkInfo = TaoKeApiUtil.specialConvertCoupon(goods.getAuctionId(), app);
|
| | | if (linkInfo != null) {
|
| | | goods.setAuctionUrl(linkInfo.getAuctionUrl());
|
| | | goods.setCouponLink(linkInfo.getCouponLink());
|
| | | goods.setTkRate(linkInfo.getTkRate());
|
| | | }
|
| | | }
|
| | |
|
| | | } catch (NumberFormatException e) {
|
| | |
| | | TaoBaoGoodsBrief tb = null;
|
| | | if (goodsList.size() > 0) {
|
| | | tb = goodsList.get(0);
|
| | |
|
| | | }
|
| | |
|
| | | if (tb == null) {
|
| | |
| | | goods.put("price", tb.getReservePrice().toString());
|
| | | goods.put("zkPrice", tb.getZkPrice().toString());
|
| | |
|
| | | // 红包
|
| | | BigDecimal proportion = manageService.getFanLiRate();
|
| | | String hongBao = TaoBaoUtil.getGoodsHongBaoInfo(tb, proportion);
|
| | | goods.put("hongBao", hongBao);
|
| | | // 30天销量
|
| | | goods.put("saleCount", TaoBaoUtil.getSaleCount(tb.getBiz30day()));
|
| | |
|
| | |
| | | // 领券人列表
|
| | | List<ShamUser> listCouponUser = new ArrayList<ShamUser>();
|
| | |
|
| | | String hongBao = null;
|
| | |
|
| | | // 获取券信息
|
| | | if (!StringUtil.isNullOrEmpty(tb.getCouponInfo())) {
|
| | | BigDecimal quanPrice = TaoBaoUtil.getAfterUseCouplePrice(tb);
|
| | | JSONObject couponInfo = new JSONObject();
|
| | | couponInfo.put("couponPrice", quanPrice.toString());
|
| | |
|
| | | // 服务端转链
|
| | | if (convertInServer && !StringUtil.isNullOrEmpty(tb.getCouponLink())) {
|
| | | couponInfo.put("couponUrl", tb.getCouponLink());
|
| | | } else {
|
| | | couponInfo.put("couponUrl",
|
| | | TaoBaoCouponUtil.getCoupleUrl(tb.getCouponActivityId() + "", pid, tb.getAuctionId() + ""));
|
| | | if (from != null && from.equals("miandan")) {
|
| | | // 免单商品
|
| | | hongBao = "¥" + quanPrice.toString();
|
| | | }
|
| | |
|
| | | String token = "";
|
| | | if (!StringUtil.isNullOrEmpty(tb.getCouponLink())) {
|
| | | token = redisManager.getCommonTaoToken(tb.getAuctionId());
|
| | | if (StringUtil.isNullOrEmpty(token)) {
|
| | | token = TaoKeApiUtil.getTKToken(tb.getPictUrl(), tb.getTitle(), tb.getCouponLink());
|
| | | redisManager.saveCommonTaoToken(tb.getAuctionId(), token);
|
| | | }
|
| | | }
|
| | | tb.setCouponLinkTaoToken(token);
|
| | |
|
| | | // 服务端转链
|
| | | // if (convertInServer && !StringUtil.isNullOrEmpty(tb.getCouponLink())) {
|
| | | couponInfo.put("couponUrl", tb.getCouponLink());
|
| | | // } else {
|
| | | // couponInfo.put("couponUrl",
|
| | | // TaoBaoCouponUtil.getCoupleUrl(tb.getCouponActivityId() + "", pid, tb.getAuctionId() + ""));
|
| | | // }
|
| | |
|
| | | couponInfo.put("couponAmount", NumberUtil.subZeroAndDot(tb.getCouponAmount().toString()));
|
| | | couponInfo.put("couponTime", "使用期限:" + tb.getCouponEffectiveStartTime().replace("-", ".") + "-"
|
| | | + tb.getCouponEffectiveEndTime().replace("-", "."));
|
| | | // 券的口令
|
| | | couponInfo.put("couponToken", token);
|
| | | goods.put("couponInfo", couponInfo);
|
| | |
|
| | | if (tb.getBiz30day() >= 1000) {
|
| | |
| | | listCouponUser = shamUserService.listRandCouponUser(5, 1, 300);
|
| | | }
|
| | | }
|
| | |
|
| | | // 红包
|
| | | if (hongBao == null) {
|
| | | BigDecimal proportion = manageService.getFanLiRate();
|
| | | hongBao = TaoBaoUtil.getGoodsHongBaoInfo(tb, proportion);
|
| | | }
|
| | | goods.put("hongBao", hongBao);
|
| | |
|
| | | data.put("tbPidInfo", clientTBPid);
|
| | |
|
| | |
| | |
|
| | | data.put("storageState", storageState);
|
| | | data.put("shareUrl", shareUrl);
|
| | |
|
| | | data.put("goods", goods);
|
| | | data.put("shareUsers", listShareUser);
|
| | | data.put("couponUsers", listCouponUser);
|
| | | data.put("detailWebUrl", "http://apph5.yeshitv.com/apppage/goods_img.html?id=" + id);
|
| | | // 商品链接
|
| | | String h5Url = String.format("http://%s%s?id=%s&appType=flq", configService.getH5Host(),
|
| | | Constant.systemCommonConfig.getShareGoodsPagePath(), tb.getAuctionId() + "");
|
| | | try {
|
| | | data.put("h5Url", HttpUtil.getShortLink(h5Url));
|
| | | } catch (Exception e) {
|
| | | data.put("h5Url", h5Url);
|
| | | }
|
| | |
|
| | | JSONObject shareActivity = new JSONObject();
|
| | | shareActivity.put("moneyDesc", "春节狂欢奖金:¥" + TaoBaoUtil.getGoodsHongBaoMoney(tb,
|
| | | new BigDecimal(hongBaoManageService.get("share_activity_proportion"))));
|
| | | shareActivity.put("ruleDescPicture", "http://img.flqapp.com/resource/share_activity_img.png");
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(uid)
|
| | | && shareGoodsActivityOrderService.countShareGoodsActivityOrder(Long.parseLong(uid)) > 0) {
|
| | | } else
|
| | | data.put("shareActivity", shareActivity);
|
| | | // 取消分享活动
|
| | | // if (!StringUtil.isNullOrEmpty(uid)
|
| | | // &&
|
| | | // shareGoodsActivityOrderService.countShareGoodsActivityOrder(Long.parseLong(uid))
|
| | | // > 0) {
|
| | | // } else if(!"miandan".equals(from)) {
|
| | | // // 非免单商品
|
| | | // JSONObject shareActivity = new JSONObject();
|
| | | // shareActivity.put("moneyDesc", "春节狂欢奖金:¥" +
|
| | | // TaoBaoUtil.getGoodsHongBaoMoney(tb,
|
| | | // new
|
| | | // BigDecimal(hongBaoManageService.get("share_activity_proportion"))));
|
| | | // shareActivity.put("ruleDescPicture",
|
| | | // "http://img.flqapp.com/resource/share_activity_img.png");
|
| | | //
|
| | | // data.put("shareActivity", shareActivity);
|
| | | // }
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
|
| | |
| | | @RequestMapping(value = "getgoodsderivation", method = RequestMethod.POST)
|
| | | public void getRecommendGoods(AcceptData acceptData, long id, PrintWriter out) {
|
| | |
|
| | | System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
|
| | | return;
|
| | |
| | | });
|
| | |
|
| | | List<TaoBaoGoodsBrief> listQuality = new ArrayList<TaoBaoGoodsBrief>();
|
| | |
|
| | | try {
|
| | | List<QualityFactory> listRecommend = qualityGoodsService.recommendByAuctionId(id);
|
| | |
|
| | | if (listRecommend != null && listRecommend.size() > 1) {
|
| | | for (QualityFactory quality : listRecommend) {
|
| | |
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = quality.getTaoBaoGoodsBrief();
|
| | | if (taoBaoGoodsBrief == null) {
|
| | | continue;
|
| | | }
|
| | |
|
| | | int biz30day = taoBaoGoodsBrief.getBiz30day();
|
| | | if (biz30day >= 10000) {
|
| | | double sales = biz30day;
|
| | | String salesCountMidea = String.format("%.1f", sales / 10000);
|
| | | taoBaoGoodsBrief.setSalesCount(salesCountMidea + "万");
|
| | | } else {
|
| | | taoBaoGoodsBrief.setSalesCount(biz30day + "");
|
| | | }
|
| | |
|
| | | // 改变图片尺寸
|
| | | String pictUrl = taoBaoGoodsBrief.getPictUrl();
|
| | | if (!StringUtil.isNullOrEmpty(pictUrl) && !pictUrl.contains("320x320")) {
|
| | | taoBaoGoodsBrief.setPictUrl(TbImgUtil.getTBSize320Img(pictUrl));
|
| | | }
|
| | |
|
| | | listQuality.add(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null));
|
| | | }
|
| | | }
|
| | | } catch (Exception e2) {
|
| | | e2.printStackTrace();
|
| | | }
|
| | | // 删除推荐
|
| | | //
|
| | | // try {
|
| | | // List<QualityFactory> listRecommend =
|
| | | // qualityGoodsService.recommendByAuctionId(id);
|
| | | //
|
| | | // if (listRecommend != null && listRecommend.size() > 1) {
|
| | | // for (QualityFactory quality : listRecommend) {
|
| | | //
|
| | | // TaoBaoGoodsBrief taoBaoGoodsBrief = quality.getTaoBaoGoodsBrief();
|
| | | // if (taoBaoGoodsBrief == null) {
|
| | | // continue;
|
| | | // }
|
| | | //
|
| | | // int biz30day = taoBaoGoodsBrief.getBiz30day();
|
| | | // if (biz30day >= 10000) {
|
| | | // double sales = biz30day;
|
| | | // String salesCountMidea = String.format("%.1f", sales / 10000);
|
| | | // taoBaoGoodsBrief.setSalesCount(salesCountMidea + "万");
|
| | | // } else {
|
| | | // taoBaoGoodsBrief.setSalesCount(biz30day + "");
|
| | | // }
|
| | | //
|
| | | // // 改变图片尺寸
|
| | | // String pictUrl = taoBaoGoodsBrief.getPictUrl();
|
| | | // if (!StringUtil.isNullOrEmpty(pictUrl) &&
|
| | | // !pictUrl.contains("320x320")) {
|
| | | // taoBaoGoodsBrief.setPictUrl(TbImgUtil.getTBSize320Img(pictUrl));
|
| | | // }
|
| | | //
|
| | | // listQuality.add(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief,
|
| | | // proportion.toString(), null));
|
| | | // }
|
| | | // }
|
| | | // } catch (Exception e2) {
|
| | | // e2.printStackTrace();
|
| | | // }
|
| | |
|
| | | // 取偶数个数据
|
| | | if (listExtra.size() % 2 != 0) {
|
| | |
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("listGuess", JsonUtil.getApiCommonGson().toJson(listExtra));
|
| | | data.put("listQuality", JsonUtil.getApiCommonGson().toJson(listQuality));
|
| | | data.put("listQuality", JsonUtil.getApiCommonGson().toJson(listExtra));
|
| | | data.put("listGuess", JsonUtil.getApiCommonGson().toJson(listQuality));
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getSpecialActivities")
|
| | | public void getSpecialActivities(AcceptData acceptData, PrintWriter out) {
|
| | | public void getSpecialActivities(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | |
|
| | | System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
|
| | | return;
|
| | |
| | | List<Special> listSpecial = specialService.listPageBySystemAndCard(0, Integer.MAX_VALUE, specialCard,
|
| | | system.getId());
|
| | |
|
| | | if (listSpecial != null && listSpecial.size() > 0) {
|
| | | for (Special special : listSpecial) {
|
| | | special.setCreatetime(null);
|
| | | special.setUpdatetime(null);
|
| | | special.setState(null);
|
| | | special.setRemark(null);
|
| | | special.setCard(null);
|
| | | special.setCardId(null);
|
| | |
|
| | | // 手动替换参数
|
| | | if (special.getName() != null && special.getName().contains("邀请")) {
|
| | | // userInfoExtraService
|
| | |
|
| | | }
|
| | |
|
| | | JumpDetailV2 jumpDetail = special.getJumpDetail();
|
| | | if (jumpDetail != null) {
|
| | | jumpDetail.setId(null);
|
| | | jumpDetail.setName(null);
|
| | | }
|
| | |
|
| | | }
|
| | | if (listSpecial == null) {
|
| | | listSpecial = new ArrayList<Special>();
|
| | | }
|
| | |
|
| | | JSONObject root = new JSONObject();
|
| | | root.put("special", listSpecial);
|
| | |
|
| | | root.put("special", JsonUtil.getApiCommonGson().toJson(listSpecial));
|
| | | out.print(JsonUtil.loadTrueResult(root));
|
| | |
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|