Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div
# Conflicts:
# fanli/src/main/java/com/yeshi/fanli/service/impl/user/integral/IntegralTaskRecordServiceImpl.java
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.hibernate.engine.spi.VersionValue;
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.sun.accessibility.internal.resources.accessibility;
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.dto.jd.JDFilter;
|
| | | import com.yeshi.fanli.dto.jd.JDSearchResult;
|
| | |
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.user.UserShareGoodsRecordService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.util.jd.JDApiUtil;
|
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil;
|
| | |
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO configParamsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
|
| | | hongBaoManageService.getVIPFanLiRate());
|
| | | |
| | | |
| | | for (UserShareGoodsGroup goodsGroup : list) {
|
| | | CommonGoods commonGoods = goodsGroup.getCommonGoods();
|
| | | if (commonGoods == null) {
|
| | |
| | | }
|
| | | // 1.6.5 之后返回 微信号提示
|
| | | if (VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | userInfo.setWeiXinTip("添加微信号后,你的邀请人和一级队员可以通过微信与你建立联系。");
|
| | | userInfo.setWeiXinTip("添加微信号后,你的邀请人和直接粉丝可以通过微信与你建立联系。");
|
| | |
|
| | | // 查询是否为VIP
|
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | |
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserSystemCouponService userSystemCouponService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | | |
| | | @Resource
|
| | | private UserVIPInfoService userVIPInfoService;
|
| | |
|
| | | @RequestMapping("getMianDanGoodsList")
|
| | | public void getMianDanGoodsList(AcceptData acceptData, PrintWriter out, int page, int pageSize, String callback) {
|
| | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO configParamsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO configParamsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | | /* 遍历列表数据 */
|
| | | for (QualityFactory selectionGoods : listQuery) {
|
| | |
|
| | |
| | | }
|
| | | // 获取免单券数量
|
| | | long couponCount = userSystemCouponService.countUsableRewardCoupon(uid);
|
| | | UserInfoExtra extraInfo=userInfoExtraService.getUserInfoExtra(uid);
|
| | | long integralCount=extraInfo!=null?extraInfo.getGoldCoin():0L;
|
| | | UserInfoExtra extraInfo = userInfoExtraService.getUserInfoExtra(uid);
|
| | | long integralCount = extraInfo != null ? extraInfo.getGoldCoin() : 0L;
|
| | | JSONObject userJson = new JSONObject();
|
| | | userJson.put("nickName", user.getNickName());
|
| | | userJson.put("portrait", user.getPortrait());
|
| | | userJson.put("id", user.getId());
|
| | | userJson.put("vip", userVIPInfoService.isVIP(user.getId()));
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("user", userJson);
|
| | |
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoLiJinUtil;
|
| | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | |
|
| | | ConfigParamsDTO configParamsDTO = new ConfigParamsDTO(proportion, proportion, Constant.MAX_REWARD_RATE,
|
| | | hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO configParamsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | | for (TLJBuyGoods goods : goodsList) {
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = goods.getGoods();
|
| | | if (taoBaoGoodsBrief == null) {
|
| | |
| | | goodsList = goodsList.size() > 10 ? goodsList.subList(0, 10) : goodsList;
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | BigDecimal fanLiRate = hongBaoManageService.getTLJShareRate(System.currentTimeMillis());
|
| | | BigDecimal shareRate = hongBaoManageService.getTLJShareRate(System.currentTimeMillis());
|
| | | ConfigParamsDTO configParamsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
|
| | | hongBaoManageService.getVIPFanLiRate());
|
| | |
|
| | | ConfigParamsDTO configParamsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | | for (ShareHotGoods hotGoods : goodsList) {
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = hotGoods.getGoods();
|
| | | if (taoBaoGoodsBrief == null) {
|
| | |
| | | if (page == null || page < 1) {
|
| | | page = 1;
|
| | | }
|
| | | JSONObject data = brandClassShopService.listEffectiveCacheV2(page, cid);
|
| | | JSONObject data = brandClassShopService.listEffectiveCacheV2(page, cid,acceptData.getPlatform(),acceptData.getVersion());
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | | // 商品信息过滤
|
| | | listGoodsBrief = taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(listGoodsBrief);
|
| | |
|
| | |
| | |
|
| | | long count = brandInfoService.countBrandInfo(cid);
|
| | |
|
| | | List<BrandInfoVO> list = brandInfoService.listBrandInfoCache((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, cid);
|
| | | List<BrandInfoVO> list = brandInfoService.listBrandInfoCache((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, cid,acceptData.getPlatform(),acceptData.getVersion());
|
| | | if (list == null)
|
| | | list = new ArrayList<BrandInfoVO>();
|
| | |
|
| | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | | // 商品信息过滤
|
| | | listGoodsBrief = taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(listGoodsBrief);
|
| | |
|
| | |
| | |
|
| | | long count = brandInfoService.countValidByCidToApp(cid);
|
| | |
|
| | | List<BrandInfoVO> list = brandInfoService.listValidToApp((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, cid);
|
| | | List<BrandInfoVO> list = brandInfoService.listValidToApp((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, cid,acceptData.getPlatform(),acceptData.getVersion());
|
| | | if (list == null)
|
| | | list = new ArrayList<BrandInfoVO>();
|
| | |
|
| | |
| | | brandInfoRecordService.addRecord(id, uid, acceptData.getDevice());
|
| | | }
|
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | |
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | |
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | | JSONArray array = new JSONArray();
|
| | |
|
| | | List<BrandGoodsCahe> listGoods = brandGoodsCaheService.getByBrandId((page - 1) * 50, 50,id);
|
| | |
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
| | | JSONArray array = new JSONArray();
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create();
|
| | | List<TaoBaoGoodsBrief> goodsList = result.getGoodsList();
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, hongBaoManageService.getVIPFanLiRate());
|
| | |
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : goodsList) {
|
| | | GoodsDetailVO vo = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO);
|
| | | if (type == CommonContentTypeEnum.mianDan)// 免单商品
|
| | |
| | |
|
| | | List<JDGoods> goodsList = result.getGoodsList();
|
| | | if (goodsList != null && goodsList.size() > 0) {
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | | |
| | | for (JDGoods goods : goodsList) {
|
| | | array.add(gson.toJson(GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO)));
|
| | | }
|
| | |
| | |
|
| | | List<PDDGoodsDetail> goodsList = result.getGoodsList();
|
| | | if (goodsList != null && goodsList.size() > 0) {
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | | |
| | | for (PDDGoodsDetail goods : goodsList) {
|
| | | array.add(gson.toJson(GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO)));
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.entity.config.AppHomeFloatImg;
|
| | | import com.yeshi.fanli.entity.taobao.ClientTBPid;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.FloatADService;
|
| | |
| | | * @param acceptData
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getHomeConfigNew", method = RequestMethod.POST)
|
| | | public void getHomeConfigNew(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | @RequestMapping(value = "getHomeConfigNew")
|
| | | public void getHomeConfigNew(AcceptData acceptData, Long uid, String callback, PrintWriter out) {
|
| | | if (uid != null && uid == 0L)
|
| | | uid = null;
|
| | |
|
| | |
| | | String platform = acceptData.getPlatform();
|
| | | data.put("hotFuctionLink",
|
| | | configService.getByVersion("hot_function_url", platform, Integer.parseInt(acceptData.getVersion())));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | if (StringUtil.isNullOrEmpty(callback))
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | else
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取饿了么的推广链接
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "userProtocolListen")
|
| | | public void userProtocolListen(AcceptData acceptData, Long uid, int type, PrintWriter out) {
|
| | | LogHelper.userProtocolListen(String.format("%s#%s#%s", acceptData.getDevice(), uid, type));
|
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | | |
| | | |
| | | }
|
| | |
|
| | | }
|
| | |
| | | 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.cache.JDGoodsCacheUtil;
|
| | | import com.yeshi.fanli.util.cache.PinDuoDuoCacheUtil;
|
| | | import com.yeshi.fanli.util.cache.TaoBaoGoodsCacheUtil;
|
| | |
| | | @Resource
|
| | | private RedisManager redisManager;
|
| | |
|
| | | |
| | | /**
|
| | | * 收藏商品
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param id
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | | |
| | |
|
| | | for (CollectionGoodsV2 collectionGoodsV2 : collectionGoodsList) {
|
| | | CommonGoods commonGoods = collectionGoodsV2.getCommonGoods();
|
| | | if (commonGoods == null) {
|
| | |
| | | JSONArray array = new JSONArray();
|
| | | if (list != null && list.size() > 0) {
|
| | | Gson gson = gsonBuilder.create();
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | | for (ScanHistoryV2 sh : list) {
|
| | | CommonGoods commonGoods = sh.getCommonGoods();
|
| | | if (commonGoods == null) {
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.hibernate.id.enhanced.AccessCallback;
|
| | | import org.springframework.core.task.TaskExecutor;
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | |
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | |
| | | filter.setPageSize(pageSize);
|
| | | filter.setCateIds(taoBaoCatIds);
|
| | |
|
| | | JSONObject result = taoKeGoodsService.searchWuLiaoV2(filter);
|
| | | JSONObject result = taoKeGoodsService.searchWuLiaoV2(filter,acceptData.getPlatform(),acceptData.getVersion());
|
| | | out.print(JsonUtil.loadTrueResult(result));
|
| | | return;
|
| | | }
|
| | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | |
|
| | | // 精选库数据
|
| | | JSONArray array = new JSONArray();
|
| | |
| | |
|
| | | JSONArray array = new JSONArray();
|
| | | if (resultGoodsList != null) {
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | | for (TaoBaoGoodsBrief goods : resultGoodsList) {
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO);
|
| | | array.add(gson2.toJson(goodsDetailVO));
|
| | |
| | | taoKeGoodsService.setSearchFilter(searchfilter, filter, order, startprice, endprice, fastFilter,
|
| | | totalSales);
|
| | |
|
| | | JSONObject result = taoKeGoodsService.searchWuLiaoV2(searchfilter);
|
| | | JSONObject result = taoKeGoodsService.searchWuLiaoV2(searchfilter,acceptData.getPlatform(),acceptData.getVersion());
|
| | | out.print(JsonUtil.loadTrueResult(result));
|
| | | return;
|
| | | }
|
| | |
| | | for (String img : tb.getImgList()) {
|
| | | finalImgList.add(TbImgUtil.getTBSizeImg(img, 600));
|
| | | }
|
| | | |
| | |
|
| | | if (finalImgList.size() == 0) {
|
| | | finalImgList.add(tb.getPictUrl());
|
| | | }
|
| | | |
| | |
|
| | | if (!StringUtil.isNullOrEmpty(tb.getPictUrlWhite()))
|
| | | finalImgList.add(0, tb.getPictUrlWhite());
|
| | |
|
| | |
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
|
| | | hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | |
|
| | | GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO);
|
| | | if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
|
| | | goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney());
|
| | |
| | | params1.put("url", configService.get("special_guide_reward_coupon_link"));
|
| | | else
|
| | | params1.put("url", configService.get("vip_link"));
|
| | | rewardCoupon
|
| | | .setMaxMoney("¥" + TaoBaoUtil.getGoodsHongBaoMoney(goods, hongBaoManageService.getVIPFanLiRate()));
|
| | | rewardCoupon.setMaxMoney(goodsDetail.getMoneyInfo().getMaxMoney());
|
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | rewardCoupon.setDesc("返");
|
| | | params1.put("url", configService.get("vip_link"));
|
| | |
| | | // 保存缓存
|
| | | jdGoodsCacheUtil.saveGoodsInfo(jdGoods);
|
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
|
| | | hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | | GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertJDGoods(jdGoods, paramsDTO);
|
| | | if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
|
| | | goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney());
|
| | |
| | | if (commissionShare != null && commissionShare.compareTo(threeClass.getSelfComm()) > 0) {
|
| | | jdGoods.setCommissionPlus(threeClass.getSelfComm());
|
| | | // plus返利
|
| | | BigDecimal fanliMoneyPlus = JDUtil.getGoodsFanLiMoneyPlus(jdGoods, fanLiRate);
|
| | | BigDecimal fanliMoneyPlus = JDUtil.getGoodsFanLiMoneyPlus(jdGoods,
|
| | | hongBaoManageService.getFanLiRate());
|
| | | otherInfo.setFanliMoneyPlus("京东plus返¥" + fanliMoneyPlus);
|
| | | // 使用奖励券最高返
|
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | maxMoneyPlus = "(京东plus返¥"
|
| | | + fanliMoneyPlus.add(MoneyBigDecimalUtil.mul(fanliMoneyPlus, Constant.MAX_REWARD_RATE))
|
| | | + JDUtil.getGoodsFanLiMoneyPlus(jdGoods,
|
| | | hongBaoManageService.getVIPFanLiRate())
|
| | | + ")";
|
| | | } else
|
| | | maxMoneyPlus = "(京东plus最高返¥"
|
| | |
| | | else
|
| | | params1.put("url", configService.get("vip_link"));
|
| | |
|
| | | rewardCoupon.setMaxMoney("¥" + JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getVIPFanLiRate()));
|
| | | rewardCoupon.setMaxMoney(goodsDetail.getMoneyInfo().getMaxMoney());
|
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | rewardCoupon.setDesc("返");
|
| | | params1.put("url", configService.get("vip_link"));
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
|
| | | hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | | GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertPDDGoods(pddGoods, paramsDTO);
|
| | | if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
|
| | | goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney());
|
| | |
| | | else
|
| | | params1.put("url", configService.get("vip_link"));
|
| | |
|
| | | rewardCoupon
|
| | | .setMaxMoney("¥" + PinDuoDuoUtil.getGoodsFanLiMoney(pddGoods, hongBaoManageService.getVIPFanLiRate()));
|
| | | rewardCoupon.setMaxMoney(goodsDetail.getMoneyInfo().getMaxMoney());
|
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | rewardCoupon.setDesc("返");
|
| | | params1.put("url", configService.get("vip_link"));
|
| | |
| | | list = list.subList(0, 10);
|
| | | }
|
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
|
| | | hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | | List<GoodsDetailVO> listDetailVO = new ArrayList<GoodsDetailVO>();
|
| | |
|
| | | for (JDGoods goods : list) {
|
| | |
| | | goodsList = goodsList.subList(0, 10);
|
| | | }
|
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate,
|
| | | Constant.MAX_REWARD_RATE, hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService
|
| | | .getShowComputeRate(acceptData.getPlatform(), acceptData.getVersion());
|
| | | for (PDDGoodsDetail goods : goodsList) {
|
| | | listDetailVO.add(GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO));
|
| | | }
|
| | |
| | |
|
| | | if (goodsList != null && goodsList.size() > 0) {
|
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
|
| | | hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | |
|
| | | goodsList.parallelStream().forEach(goods -> {
|
| | | if (goods != null) {
|
| | |
| | |
|
| | | ConfigParamsDTO params = new ConfigParamsDTO(hongBaoManageService.getFanLiRate(),
|
| | | hongBaoManageService.getShareRate(), new BigDecimal(80), hongBaoManageService.getVIPFanLiRate());
|
| | | hongBaoManageService.getShowComputeRate(acceptData.getPlatform(), acceptData.getVersion());
|
| | |
|
| | | if (tbGoodsList.size() > 0) {
|
| | | List<TaoBaoGoodsBrief> goodsList = null;
|
| | |
| | |
|
| | | List<GoodsDetailVO> list = new ArrayList<GoodsDetailVO>();
|
| | | if (detailList != null) {
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | |
|
| | | for (DaTaoKeDetailV2 detail : detailList) {
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = TaoBaoUtil.convert(detail);
|
| | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("nickName", userInfo.getNickName());
|
| | | data.put("portrait", userInfo.getPortrait());
|
| | | data.put("tips", "确认要成为TA的一级队员吗?邀请关系一旦建立不可更改。");
|
| | | data.put("tips", "确认要成为TA的直接粉丝吗?邀请关系一旦建立不可更改。");
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (UserInfoExtraException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getMsg()));
|
| | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("nickName", userInfo.getNickName());
|
| | | data.put("portrait", userInfo.getPortrait());
|
| | | data.put("tips", "确认要成为TA的一级队员吗?邀请关系一旦建立不可更改。");
|
| | | data.put("tips", "确认要成为TA的直接粉丝吗?邀请关系一旦建立不可更改。");
|
| | | data.put("key", activeWX);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (UserInfoExtraException e) {
|
| | |
| | | @RequestMapping(value = "getMyTeam", method = RequestMethod.POST)
|
| | | public void getMyTeam(AcceptData acceptData, long page, long uid, int type, PrintWriter out) {
|
| | | if (type != 1 && type != 2) {
|
| | | out.print(JsonUtil.loadFalseResult("队员类型不正确"));
|
| | | out.print(JsonUtil.loadFalseResult("粉丝类型不正确"));
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | if (!hasCode) {
|
| | | List<String> tipCode = new ArrayList<String>();
|
| | | resultData.put("helpLinkActivate", configService.get("team_help_url"));
|
| | | tipCode.add("激活邀请功能后才可以邀请队员,一级队员是由你直接邀请,二级队员是由你的一级队员邀请。");
|
| | | tipCode.add("激活邀请功能后才可以邀请粉丝,直接粉丝是由你直接邀请,间接粉丝是由你的直接粉丝邀请。");
|
| | | tipCode.add("邀请激活功能,必须要有邀请码,邀请码可以通过金币兑换,也可以全网搜索。");
|
| | | resultData.put("tipCode", tipCode);
|
| | | }
|
| | |
| | | // 未添加微信号
|
| | | List<String> tipWeiXin = new ArrayList<String>();
|
| | | if (!bdWeiXin) {
|
| | | tipWeiXin.add("添加微信号后,你的邀请人和一级队员可通过微信号与你建立联系;");
|
| | | tipWeiXin.add("你也可以向邀请人学习或向一级队员教授赚钱技巧。");
|
| | | tipWeiXin.add("添加微信号后,你的邀请人和直接粉丝可通过微信号与你建立联系;");
|
| | | tipWeiXin.add("你也可以向邀请人学习或向直接粉丝教授赚钱技巧。");
|
| | | }
|
| | | resultData.put("tipWeiXin", tipWeiXin);
|
| | | resultData.put("tipWeiXinAdd", "添加微信号后,你的邀请人和一级队员可以通过微信与你建立联系。");
|
| | | resultData.put("tipWeiXinAdd", "添加微信号后,你的邀请人和直接粉丝可以通过微信与你建立联系。");
|
| | | resultData.put("bdWeiXin", bdWeiXin);
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(resultData));
|
| | |
| | |
|
| | | Long bossId = null;
|
| | | Long workerId = null;
|
| | | String title = "队员提醒消息";
|
| | | String title = "粉丝提醒消息";
|
| | | String content = "";
|
| | | if (remindBoss) {
|
| | | // 提示队长
|
| | | bossId = remindId;
|
| | | workerId = uid;
|
| | | content = "你的一级队员" + userInfo.getNickName()
|
| | | content = "你的直接粉丝" + userInfo.getNickName()
|
| | | + ",提醒你添加微信号,以便于和你取得联系和学习省钱技巧,赶快去添加吧;注:请升级到本软件最新版本在“我的-我的信息”中添加。";
|
| | | } else {
|
| | | // 提示队员
|
| | |
| | | List<JDGoods> goodsList = jdGoodsService.specialSearch(page, cid);
|
| | | JSONArray array = new JSONArray();
|
| | | if (goodsList != null && goodsList.size() > 0) {
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | |
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | |
| | | JSONArray array = new JSONArray();
|
| | | if (goodsList != null && goodsList.size() > 0) {
|
| | | Gson gson = JsonUtil.getApiCommonGson();
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | |
|
| | | for (PDDGoodsDetail goods : goodsList) {
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO);
|
| | |
| | | JSONObject root = specialService.listCacheSpecialToIndex(acceptData, deviceSex);
|
| | |
|
| | | // 2、顶部轮播图
|
| | | List<SwiperPicture> oldtopPicList = swiperPictureService.getByBannerCardAndVersion("index_top",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | |
| | | |
| | | List<SwiperPicture> oldtopPicList = swiperPictureService.getByBannerCardAndVersion("index_top",
|
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | |
|
| | | List<SwiperPicture> topPicList = new ArrayList<>();
|
| | | if (oldtopPicList != null && oldtopPicList.size() > 0)
|
| | | topPicList.addAll(oldtopPicList);
|
| | |
| | | && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()))) {
|
| | | // 如果IOS当前版本处于审核状态就不返回
|
| | | } else {
|
| | | invitePicList = swiperPictureService.getByBannerCardAndVersion("index_invite",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | invitePicList = swiperPictureService.getByBannerCardAndVersion("index_invite", acceptData.getPlatform(),
|
| | | Integer.parseInt(acceptData.getVersion()));
|
| | | }
|
| | |
|
| | | if (invitePicList == null) {
|
| | |
| | |
|
| | | long nextTime = nowTime + 1000 * 60 * 60L;// 默认为1小时
|
| | | if (nextPos < dtoList.size()) {
|
| | | nextTime = TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(nowTime, "yyyyMM") + dtoList.get(nextPos).getTime(),
|
| | | "yyyyMMddHH");
|
| | | nextTime = TimeUtil.convertToTimeTemp(
|
| | | TimeUtil.getGernalTime(nowTime, "yyyyMM") + dtoList.get(nextPos).getTime(), "yyyyMMddHH");
|
| | | }
|
| | |
|
| | | JSONArray array = null;
|
| | |
| | |
|
| | | /* 遍历列表数据 */
|
| | |
|
| | | ConfigParamsDTO configParamsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | |
|
| | | for (DaTaoKeDetailV2 detail : listGoods) {
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = TaoBaoUtil.convert(detail);
|
| | | if (taoBaoGoodsBrief == null) {
|
| | | continue;
|
| | | }
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief,
|
| | | new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate()));
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, configParamsDTO);
|
| | |
|
| | | JSONObject params = new JSONObject();
|
| | | params.put("url", configService.get("spike_goods_link") + "?id=" + taoBaoGoodsBrief.getAuctionId());
|
| | |
| | | List<SpikeTimeVO> list = new ArrayList<SpikeTimeVO>();
|
| | | for (int i = 0; i < timeList.size(); i++) {
|
| | | SpikeTimeVO spikeTime1 = new SpikeTimeVO();
|
| | | spikeTime1.setTime(
|
| | | timeList.get(i).getTime().subSequence(2, 4)+":00");
|
| | | spikeTime1.setTime(timeList.get(i).getTime().subSequence(2, 4) + ":00");
|
| | | if (timeList.get(i).getState() <= 0)
|
| | | spikeTime1.setState("进行中");
|
| | | else
|
| | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | if (detailList != null) {
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | |
|
| | | for (DaTaoKeDetailV2 detail : detailList) {
|
| | | array.add(gson.toJson(GoodsDetailVOFactory.convertTaoBao(TaoBaoUtil.convert(detail), paramsDTO)));
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | |
|
| | | for (TaoBaoGoodsBrief goods : goodsList) {
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO);
|
| | |
| | | List<TLJBuyGoods> list = homeRecommendGoodsService.getZiGouLiJianHotGoods(acceptData.getDevice());
|
| | | if (list != null && list.size() > 0) {
|
| | | BigDecimal rateBuy = TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE;
|
| | | ConfigParamsDTO paramsBuy = new ConfigParamsDTO(rateBuy, rateBuy, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsBuy = new ConfigParamsDTO(rateBuy, rateBuy, Constant.MAX_REWARD_RATE,
|
| | | hongBaoManageService.getVIPFanLiRate());
|
| | | for (int i = list.size() - 1; i >= 0; i--) {
|
| | | TLJBuyGoods goods = list.get(i);
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(goods.getGoods(), paramsBuy);
|
| | |
| | |
|
| | | // 设备推荐
|
| | | if (gList != null) {
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | | for (TaoBaoGoodsBrief goods : gList) {
|
| | | if (!StringUtil.isNullOrEmpty(goods.getCouponInfo()) && goods.getCouponAmount() != null
|
| | | && goods.getCouponAmount().compareTo(new BigDecimal("5")) >= 0
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | JSONArray localArray = qualityGoodsService.getRecommendToIndexV2((page - 1) * pageSize, pageSize);
|
| | | JSONArray localArray = qualityGoodsService.getRecommendToIndexV2((page - 1) * pageSize, pageSize,acceptData.getPlatform(),acceptData.getVersion());
|
| | | array.addAll(localArray);
|
| | | } else {// 从精选库来
|
| | | array = qualityGoodsService.getRecommendToIndexV2((page - 1) * pageSize, pageSize);
|
| | | array = qualityGoodsService.getRecommendToIndexV2((page - 1) * pageSize, pageSize,acceptData.getPlatform(),acceptData.getVersion());
|
| | | if (array == null) {
|
| | | out.print(JsonUtil.loadFalseResult("没有更多了"));
|
| | | return;
|
| | |
| | |
|
| | | List<JDGoods> goodsList = result.getGoodsList();
|
| | | if (goodsList != null && goodsList.size() > 0) {
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | |
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | |
| | | Gson gson = JsonUtil.getApiCommonGson();
|
| | | List<PDDGoodsDetail> goodsList = result.getGoodsList();
|
| | | if (goodsList != null && goodsList.size() > 0) {
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | |
|
| | | for (PDDGoodsDetail goods : goodsList) {
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO);
|
| | |
| | | JSONArray arrayKeys = JSONArray.fromObject(keys);
|
| | | if (arrayKeys != null && arrayKeys.size() > 0) {
|
| | | count = arrayKeys.size();
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | |
|
| | | int j = 1;
|
| | | for (int i = (page - 1) * 3; i < arrayKeys.size(); i++) {
|
| | |
| | | commonGoods = CommonGoodsFactory.create(goodsBrief);
|
| | | }
|
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | data.put("type", type);
|
| | | data.put("goods",
|
| | | gson.toJson(GoodsDetailVOFactory.convertCommonGoods(commonGoods, new ConfigParamsDTO(fanLiRate,
|
| | | shareRate, Constant.MAX_REWARD_RATE, hongBaoManageService.getVIPFanLiRate()))));
|
| | | gson.toJson(GoodsDetailVOFactory.convertCommonGoods(commonGoods,hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion()))));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | return;
|
| | | }
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | |
|
| | |
| | | data.put("type", 3);
|
| | | data.put("goods",
|
| | | gson.toJson(GoodsDetailVOFactory.convertTaoBao(goodsBrief,
|
| | | new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
|
| | | hongBaoManageService.getVIPFanLiRate()))));
|
| | | hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion()))));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | return true;
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | List<GoodsDetailVO> list = new ArrayList<GoodsDetailVO>();
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
|
| | | hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | |
|
| | | for (TaoBaoGoodsBrief goods : taoBaoGoodsBriefs) {
|
| | | list.add(GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO));
|
| | |
| | | || ("android".equalsIgnoreCase(platform) && VersionUtil.greaterThan_2_0_2(platform, version))) {
|
| | | BrandInfoVO brandInfoVO = null;
|
| | | try {
|
| | | brandInfoVO = brandInfoService.listByAlikeName(key);
|
| | | brandInfoVO = brandInfoService.listByAlikeName(key,acceptData.getPlatform(),acceptData.getVersion());
|
| | | } catch (Exception e) {
|
| | | }
|
| | | if (brandInfoVO != null)
|
| | | data.put("shop", JsonUtil.getApiCommonGson().toJson(brandInfoVO));
|
| | | } else {
|
| | | List<TaoBaoShopVO> listShop = taoBaoShopService.getShopByKeyV2(key);
|
| | | List<TaoBaoShopVO> listShop = taoBaoShopService.getShopByKeyV2(key,acceptData.getPlatform(),acceptData.getVersion());
|
| | | if (listShop != null && listShop.size() > 0 && listShop.get(0).getListGoodsVO() != null
|
| | | && listShop.get(0).getListGoodsVO().size() > 2) {
|
| | | TaoBaoShopVO taoBaoShop = listShop.get(0);
|
| | |
| | |
|
| | | List<JDGoods> goodsList = result.getGoodsList();
|
| | | if (goodsList != null && goodsList.size() > 0) {
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
|
| | | hongBaoManageService.getVIPFanLiRate());
|
| | |
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | | for (JDGoods goods : goodsList) {
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO);
|
| | | if (hasCoupon) {
|
| | |
| | | Gson gson = JsonUtil.getApiCommonGson();
|
| | | List<PDDGoodsDetail> goodsList = result.getGoodsList();
|
| | | if (goodsList != null && goodsList.size() > 0) {
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
|
| | | hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | |
|
| | | for (PDDGoodsDetail goods : goodsList) {
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO);
|
| | |
| | | TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(uid, goodsId, relationId);
|
| | |
|
| | | if (taoBaoLink != null && taoBaoLink.getGoods() != null && needGoods) {
|
| | | ConfigParamsDTO dto = new ConfigParamsDTO(hongBaoManageService.getFanLiRate(),
|
| | | hongBaoManageService.getShareRate(), Constant.MAX_REWARD_RATE,
|
| | | hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO dto = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | |
|
| | | GoodsDetailVO goodsInfo = GoodsDetailVOFactory.convertTaoBao(taoBaoLink.getGoods(), dto);
|
| | | shareInfo.setGoodsInfo(goodsInfo);
|
| | | }
|
| | |
| | | // 测试
|
| | | // 2.0.2之前
|
| | | if (!VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | shareInfo.setClickUrl(getERCodeContent(configService.get("taobao_share_qrcode_text"), taoBaoLink.getGoods(), shareInfo.getToken()));
|
| | | shareInfo.setClickUrl(getERCodeContent(configService.get("taobao_share_qrcode_text"),
|
| | | taoBaoLink.getGoods(), shareInfo.getToken()));
|
| | |
|
| | | shareInfo.setWxErCode(getERCodeContent(configService.get("taobao_share_qrcode_text"), taoBaoLink.getGoods(), shareInfo.getToken()));
|
| | | shareInfo.setWxErCode(getERCodeContent(configService.get("taobao_share_qrcode_text"), taoBaoLink.getGoods(),
|
| | | shareInfo.getToken()));
|
| | |
|
| | | // 提示图文内容
|
| | | String imgs = configService.get("goods_share_notify_imgs");
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo)));
|
| | | out.print(JsonUtil.loadTrueResult(
|
| | | JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo)));
|
| | |
|
| | | final TaoBaoLink taobaoLink = taoBaoLink;
|
| | | // 异步操作
|
| | |
| | | shareInfo.setCommentTexts(new ArrayList<>());
|
| | |
|
| | | if (needGoods)
|
| | | shareInfo
|
| | | .setGoodsInfo(GoodsDetailVOFactory.convertJDGoods(jdGoods,
|
| | | new ConfigParamsDTO(hongBaoManageService.getFanLiRate(),
|
| | | hongBaoManageService.getShareRate(), Constant.MAX_REWARD_RATE,
|
| | | hongBaoManageService.getVIPFanLiRate())));
|
| | | shareInfo.setGoodsInfo(GoodsDetailVOFactory.convertJDGoods(jdGoods,
|
| | | hongBaoManageService.getShowComputeRate(acceptData.getPlatform(), acceptData.getVersion())));
|
| | |
|
| | | String shareText = "";
|
| | | boolean hasCoupon = false;
|
| | |
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo)));
|
| | | out.print(JsonUtil.loadTrueResult(
|
| | | JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo)));
|
| | |
|
| | | // 异步操作
|
| | | final JDGoods goods = jdGoods;
|
| | |
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo)));
|
| | | out.print(JsonUtil.loadTrueResult(
|
| | | JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo)));
|
| | |
|
| | | // 异步操作
|
| | | com.yeshi.fanli.util.ThreadUtil.run(new Runnable() {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
|
| | | hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | |
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | |
|
| | | for (UserGoodsStorage userGoodsStorage : listStorage) {
|
| | | CommonGoods commonGoods = userGoodsStorage.getCommonGoods();
|
| | |
| | | isNewUser = false;
|
| | | }
|
| | | }
|
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getTLJShareRate(System.currentTimeMillis());
|
| | | BigDecimal shareRate = hongBaoManageService.getTLJShareRate(System.currentTimeMillis());
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate());
|
| | | |
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | |
|
| | | for (ShareHotGoods hotGoods : listHot) {
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = hotGoods.getGoods();
|
| | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, fanLiRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | |
|
| | | for (TLJFreeBuyGoods freeGoods : listFree) {
|
| | | TaoBaoGoodsBrief goods = freeGoods.getGoods();
|
| | | if (goods == null)
|
| | |
| | | // 分享比例
|
| | | private BigDecimal shareRate;
|
| | | // 奖励券最高返比例
|
| | | // private BigDecimal maxRewardRate;
|
| | | private BigDecimal maxRewardRate;
|
| | |
|
| | | // VIP返利比例
|
| | | private BigDecimal vipFanLiRate;// 会员返利比例
|
| | |
|
| | |
| | | public ConfigParamsDTO(BigDecimal fanLiRate, BigDecimal shareRate, BigDecimal maxRewardRate, BigDecimal vipRate) {
|
| | | this.fanLiRate = fanLiRate;
|
| | | this.shareRate = shareRate;
|
| | | // this.maxRewardRate = maxRewardRate;
|
| | | this.maxRewardRate = maxRewardRate;
|
| | | this.vipFanLiRate = vipRate;
|
| | | }
|
| | |
|
| | |
| | | this.shareRate = shareRate;
|
| | | }
|
| | |
|
| | | // public BigDecimal getMaxRewardRate() {
|
| | | // return maxRewardRate;
|
| | | // }
|
| | | //
|
| | | // public void setMaxRewardRate(BigDecimal maxRewardRate) {
|
| | | // this.maxRewardRate = maxRewardRate;
|
| | | // }
|
| | | public BigDecimal getMaxRewardRate() {
|
| | | return maxRewardRate;
|
| | | }
|
| | |
|
| | | public void setMaxRewardRate(BigDecimal maxRewardRate) {
|
| | | this.maxRewardRate = maxRewardRate;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | orderTaoBao("淘宝订单"),
|
| | | coollect("收藏"),
|
| | | scanHistory("足迹"),
|
| | | team("队员"),
|
| | | team("粉丝"),
|
| | | kefu("联系客服"),
|
| | | taoBaoShoppingCart("淘宝购物车"),
|
| | | orderFind("订单申诉"),
|
| | |
| | | give("赠送"),
|
| | | exchange("金币兑换"),
|
| | | couponActivate("免单券激活"),
|
| | | firstOrderReward("队员首单奖励邀请人金币"),
|
| | | firstOrderReward("粉丝首单奖励邀请人金币"),
|
| | | systemGive("系统赠送"),
|
| | | passVIPApply("超级会员"),
|
| | | rejectVIPApply("超级会员"),
|
| | |
| | | public class UserTaoLiJinOrigin {
|
| | |
|
| | | public enum TaoLiJinOriginEnum {
|
| | | newbiesWin("新人红包"), shareWin("推广红包福利"), rankWin("账户等级福利"), inviteWin("邀请队员奖励"), |
| | | newbiesWin("新人红包"), shareWin("推广红包福利"), rankWin("账户等级福利"), inviteWin("邀请粉丝奖励"), |
| | | refund("未领取退回"), exchange("金币兑换"), friendsGive("好友赠送"), giveSendBack("赠送退回");
|
| | |
|
| | | private final String desc;
|
| | |
| | | giveFreeCoupon("赠送免单券"),
|
| | | giveTaoLiJin("赠送推广红包"),
|
| | | inShop("浏览店铺"),
|
| | | inShopLevelOne("一级队员浏览店铺"),
|
| | | inShopLevelTwo("二级队员浏览店铺"),
|
| | | inShopLevelOne("直接粉丝浏览店铺"),
|
| | | inShopLevelTwo("简介粉丝浏览店铺"),
|
| | | scanPush("浏览推荐记录"),
|
| | | scanGoods("浏览商品详情页"),
|
| | | scanSearchResult("浏览搜索结果页"),
|
| | |
| | | couponRebateLevelOne("浏览购物车页"),
|
| | | couponRebateLevelTwo("浏览购物车页"),
|
| | | rebateOrder("完成返利订单"),
|
| | | inviteOrderLevelOne("一级队员邀请订单"),
|
| | | inviteOrderLevelTwo("二级队员邀请订单"),
|
| | | inviteOrderLevelOne("直接粉丝邀请订单"),
|
| | | inviteOrderLevelTwo("间接粉丝邀请订单"),
|
| | | shareOrder("分享订单"),
|
| | | bindWeiXin("微信授权"),
|
| | | bindPhone("绑定手机"),
|
| | |
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | public enum UniqueKeyEnum {
|
| | | dailySign("每日签到"), smartSearch("智能搜索"), buyReduce("自购立减"), inviteTeam("邀请队员"), shareReward("分享奖励"), |
| | | dailySign("每日签到"), smartSearch("智能搜索"), buyReduce("自购立减"), inviteTeam("邀请粉丝"), shareReward("分享奖励"), |
| | | giveReward("赠送奖励"), scanReward("浏览奖励") , orderReward("订单奖励"), accountMaintain("账号维护");
|
| | | private final String desc;
|
| | |
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.scheduling.annotation.Scheduled;
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import com.xxl.job.core.biz.model.ReturnT;
|
| | | import com.xxl.job.core.handler.annotation.XxlJob;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.brand.BrandInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
| | | /**
|
| | | * 每两个小时进行更新品牌商品信息
|
| | | */
|
| | | @Scheduled(cron = "0 0 1/2 * * ? ")
|
| | | // @Scheduled(cron = "0 0 1/2 * * ? ")
|
| | | @XxlJob("brandGoodsUpdateHandler")
|
| | | public ReturnT<String> demoJobHandler(String param) throws Exception {
|
| | | updateGoods();
|
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | |
|
| | | public void updateGoods() {
|
| | | System.out.println("品牌商品更新执行");
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | long startTime = java.lang.System.currentTimeMillis();
|
| | |
| | | long count = brandInfoService.countValidByCid(null);
|
| | | if (count == 0)
|
| | | return;
|
| | | |
| | |
|
| | | long totalPage = (count / 100) + 1;
|
| | | for (long page = 0; page < totalPage; page++) {
|
| | | try {
|
| | | brandInfoService.addShopAndGoods(page * 100, 100);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | long endTime = java.lang.System.currentTimeMillis();
|
| | | LogHelper.test("结束执行品牌更新---updateGoods" + endTime + ",总耗时:" +(endTime -startTime) / 1000);
|
| | | LogHelper.test("结束执行品牌更新---updateGoods" + endTime + ",总耗时:" + (endTime - startTime) / 1000);
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | |
| | | private static Logger mqLogger = Logger.getLogger("mqLog");
|
| | |
|
| | | private static Logger vipInfoLogger = Logger.getLogger("vipInfoLog");
|
| | | |
| | | private static Logger userProtocolListenLog = Logger.getLogger("userProtocolListenLog");
|
| | | |
| | | |
| | | public static void userProtocolListen(Object obj) {
|
| | | userProtocolListenLog.info(obj);
|
| | | }
|
| | |
|
| | | public static void userInfo(Object obj) {
|
| | | userLogger.info(obj);
|
| | |
| | | </update>
|
| | |
|
| | | <select id="listValid" resultMap="BaseResultVOMap">
|
| | | SELECT p.*,u.`nick_name`,u.`portrait`,e.`uie_invite_code` FROM
|
| | | SELECT p.*,u.`nick_name`,u.`portrait`,IF(e.uie_invite_code_vip is null, e.`uie_invite_code`,uie_invite_code_vip) as uie_invite_code FROM
|
| | | yeshi_ec_code_publish_record p
|
| | | LEFT JOIN `yeshi_ec_user` u ON u.`id` =
|
| | | p.`pr_uid`
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Cacheable(value = "brandCache", key = "'listEffectiveCacheV2-'+#page+'-'+#cid")
|
| | | public JSONObject listEffectiveCacheV2(int page, Long cid) {
|
| | | @Cacheable(value = "brandCache", key = "'listEffectiveCacheV2-'+#page+'-'+#cid+'-'+#platform+'-'+#version")
|
| | | public JSONObject listEffectiveCacheV2(int page, Long cid,String platform,String version) {
|
| | | long countShop = 0;
|
| | |
|
| | | if (cid != null && cid <= 0) {
|
| | |
| | | count = taoBaoShopService.countBrandShopinfo(cid);
|
| | | }
|
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(platform, version);
|
| | |
|
| | | // 淘宝商品信息过滤
|
| | | Map<Long, TaoBaoGoodsBrief> goodsMap = getFilterTaoBaoGoods(listInfo);
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | public List<TaoBaoShopVO> listEffectiveShop(long start, int count, Long cid) {
|
| | | public List<TaoBaoShopVO> listEffectiveShop(long start, int count, Long cid,String platform,String version) {
|
| | | if (cid != null && cid <= 0) {
|
| | | cid = null;
|
| | | }
|
| | |
| | | return listInfo;
|
| | |
|
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = |
| | | hongBaoManageService.getShowComputeRate(platform, version);
|
| | | // 淘宝商品信息过滤
|
| | | Map<Long, TaoBaoGoodsBrief> goodsMap = getFilterTaoBaoGoods(listInfo);
|
| | |
|
| | |
| | | package com.yeshi.fanli.service.impl.brand;
|
| | |
|
| | | import java.io.InputStream;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
| | |
|
| | | @Resource(name = "taskExecutor")
|
| | | private TaskExecutor executor;
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public void saveObject(MultipartFile file, BrandInfo record) throws BrandInfoException {
|
| | | String name = record.getName();
|
| | |
| | | throw new BrandInfoException(1, "名称不能为空");
|
| | |
|
| | | BrandClass brandClass = record.getBrandClass();
|
| | | if (brandClass ==null || brandClass.getId() == null)
|
| | | if (brandClass == null || brandClass.getId() == null)
|
| | | throw new BrandInfoException(1, "分类不能为空");
|
| | | |
| | |
|
| | | BrandInfo existBrand = brandInfoMapper.selectByUniqueName(name.trim(), brandClass.getId(), record.getId());
|
| | | if (existBrand != null)
|
| | | throw new BrandInfoException(1, "该分类中已存在:" + name.trim());
|
| | | |
| | |
|
| | | Integer state = record.getState();
|
| | | if (state == null) {
|
| | | state = 0;
|
| | | record.setState(state);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | String picture = null;
|
| | | if (file != null) {
|
| | | try { // 图片上传
|
| | |
| | | throw new BrandInfoException(1, "图片上传失败");
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | String searchKey = record.getSearchKey();
|
| | | if (!StringUtil.isNullOrEmpty(searchKey)) {
|
| | | if (StringUtil.isNullOrEmpty(record.getSearchKeyJD()))
|
| | | record.setSearchKeyJD(searchKey);
|
| | | |
| | |
|
| | | if (StringUtil.isNullOrEmpty(record.getSearchKeyPDD()))
|
| | | record.setSearchKeyPDD(searchKey);
|
| | | }
|
| | | |
| | |
|
| | | String shopKey = record.getShopKey();
|
| | | if (!StringUtil.isNullOrEmpty(shopKey)) {
|
| | | if (StringUtil.isNullOrEmpty(record.getShopKeyJD()))
|
| | | record.setShopKeyJD(shopKey);
|
| | | |
| | |
|
| | | if (StringUtil.isNullOrEmpty(record.getShopKeyPDD()))
|
| | | record.setShopKeyPDD(shopKey);
|
| | | }
|
| | | record.setName(name.trim());
|
| | | record.setUpdateTime(new Date());
|
| | | |
| | |
|
| | | Long id = record.getId();
|
| | | if (id == null) {
|
| | | record.setIcon(picture);
|
| | |
| | | record.setShopTotal(0);
|
| | | record.setCreateTime(new Date());
|
| | | brandInfoMapper.insert(record);
|
| | | |
| | |
|
| | | BrandInfo resultObj = new BrandInfo();
|
| | | resultObj.setId(record.getId());
|
| | | resultObj.setOrder(Integer.valueOf(record.getId().toString()));
|
| | |
| | | // 删除老图
|
| | | if (resultObj.getIcon() != null && resultObj.getIcon().trim().length() > 0 && !Constant.IS_TEST) {
|
| | | COSManager.getInstance().deleteFile(resultObj.getIcon());
|
| | | };
|
| | | }
|
| | | ;
|
| | | // 存储新图
|
| | | record.setIcon(picture);
|
| | | } else {
|
| | | record.setIcon(resultObj.getIcon());
|
| | | }
|
| | | |
| | | if (state == 0){
|
| | |
|
| | | if (state == 0) {
|
| | | record.setGoodsTotal(0);
|
| | | record.setShopTotal(0);
|
| | | } else {
|
| | |
| | | record.setWeight(resultObj.getWeight());
|
| | | record.setCreateTime(resultObj.getCreateTime());
|
| | | brandInfoMapper.updateByPrimaryKey(record);
|
| | | |
| | | if (state == 0){
|
| | |
|
| | | if (state == 0) {
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | |
| | | @Override
|
| | | public void run() {
|
| | | BrandInfo numInfo = brandGoodsCaheService.addBrandGoods(record);
|
| | | |
| | |
|
| | | BrandInfo update = new BrandInfo();
|
| | | update.setId(record.getId());
|
| | | update.setGoodsTotal(numInfo.getGoodsTotal());
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 上传图片
|
| | | * |
| | | * @param file
|
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | public String uploadPicture(MultipartFile file) throws Exception {
|
| | | |
| | | // 文件解析 |
| | |
|
| | | // 文件解析
|
| | | InputStream inputStream = file.getInputStream();
|
| | | String contentType = file.getContentType();
|
| | | String type = contentType.substring(contentType.indexOf("/") + 1);
|
| | | |
| | |
|
| | | // 文件路径
|
| | | String filePath="/img/brand/"+UUID.randomUUID().toString().replace("-", "") + "." + type;
|
| | | String filePath = "/img/brand/" + UUID.randomUUID().toString().replace("-", "") + "." + type;
|
| | | // 执行上传
|
| | | String fileLink= COSManager.getInstance().uploadFile(inputStream, filePath).getUrl();
|
| | | |
| | | String fileLink = COSManager.getInstance().uploadFile(inputStream, filePath).getUrl();
|
| | |
|
| | | return fileLink;
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public int deleteBatchByPrimaryKey(List<Long> list) {
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | for (Long id: list) {
|
| | | for (Long id : list) {
|
| | | brandGoodsCaheService.removeByBrandId(id);
|
| | | brandShopCaheService.removeByBrandId(id);
|
| | | }
|
| | | }
|
| | | });
|
| | | |
| | |
|
| | | return brandInfoMapper.deleteBatchByPrimaryKey(list);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public void updateOrder(Long id, Integer moveType) throws BrandInfoException {
|
| | | if (moveType == null || (!moveType.equals(1) && !moveType.equals(-1)))
|
| | | throw new BrandInfoException(1, "传递的类型不正确");
|
| | | |
| | |
|
| | | if (id == null)
|
| | | throw new BrandInfoException(1, "ID不能为空");
|
| | | |
| | |
|
| | | BrandInfo resultObj = brandInfoMapper.selectByPrimaryKey(id);
|
| | | if (resultObj == null) |
| | | if (resultObj == null)
|
| | | throw new BrandInfoException(1, "操作数据已不存在");
|
| | | |
| | |
|
| | | Integer oldOrder = resultObj.getOrder();
|
| | | BrandInfo changeObj = brandInfoMapper.getByAdjoinOrder(resultObj.getBrandClass().getId(),oldOrder, moveType);
|
| | | if (changeObj == null )
|
| | | BrandInfo changeObj = brandInfoMapper.getByAdjoinOrder(resultObj.getBrandClass().getId(), oldOrder, moveType);
|
| | | if (changeObj == null)
|
| | | throw new BrandInfoException(1, "已经在最边缘,无可交换的位置");
|
| | | |
| | |
|
| | | BrandInfo changeObj1 = new BrandInfo();
|
| | | changeObj1.setId(id);
|
| | | changeObj1.setOrder(changeObj.getOrder());
|
| | | |
| | |
|
| | | BrandInfo changeObj2 = new BrandInfo();
|
| | | changeObj2.setId(changeObj.getId());
|
| | | changeObj2.setOrder(oldOrder);
|
| | | |
| | |
|
| | | brandInfoMapper.updateByPrimaryKeySelective(changeObj1);
|
| | | brandInfoMapper.updateByPrimaryKeySelective(changeObj2);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public List<BrandInfo> listQuery(long start, int count, List<String> keys, Long cid, Integer state, Integer showState) {
|
| | | return brandInfoMapper.listQuery(start, count, keys, cid, state,showState);
|
| | | public List<BrandInfo> listQuery(long start, int count, List<String> keys, Long cid, Integer state,
|
| | | Integer showState) {
|
| | | return brandInfoMapper.listQuery(start, count, keys, cid, state, showState);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Cacheable(value = "brandCache", key = "'listBrandInfoCache-'+#start+'-'+#start +'-'+#cid")
|
| | | public List<BrandInfoVO> listBrandInfoCache(long start, int count, Long cid) {
|
| | | @Cacheable(value = "brandCache", key = "'listBrandInfoCache-'+#start+'-'+#start +'-'+#cid+'-'+#platform+'-'+#version")
|
| | | public List<BrandInfoVO> listBrandInfoCache(long start, int count, Long cid, String platform, String version) {
|
| | | List<BrandInfoVO> listInfo = new ArrayList<BrandInfoVO>();
|
| | |
|
| | | List<TaoBaoShopVO> listShop = brandClassShopService.listEffectiveShop(start, count, cid);
|
| | | List<TaoBaoShopVO> listShop = brandClassShopService.listEffectiveShop(start, count, cid, platform, version);
|
| | | if (listShop == null || listShop.size() == 0)
|
| | | return listInfo;
|
| | |
|
| | |
| | | return brandClassShopService.countBrandShopinfo(cid);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public void removeAgoByDate(Date date) {
|
| | | // 删除商品
|
| | | brandGoodsCaheService.removeAgoByDate(date);
|
| | | |
| | |
|
| | | // 删除店铺
|
| | | brandShopCaheService.removeAgoByDate(date);
|
| | | |
| | |
|
| | | long count = brandInfoMapper.countValidByCid(null);
|
| | | if (count == 0)
|
| | | return;
|
| | |
| | |
|
| | | /**
|
| | | * 更新商品数量
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | */
|
| | |
| | | List<BrandInfo> list = brandInfoMapper.listValidAll(start, count);
|
| | | if (list == null || list.size() == 0)
|
| | | return;
|
| | | |
| | |
|
| | | for (BrandInfo brandInfo : list) {
|
| | | long goodsTotal = brandGoodsCaheService.countByBrandId(brandInfo.getId());
|
| | | |
| | |
|
| | | BrandInfo updateInfo = new BrandInfo();
|
| | | updateInfo.setId(brandInfo.getId());
|
| | | updateInfo.setGoodsTotal((int)goodsTotal);
|
| | | updateInfo.setGoodsTotal((int) goodsTotal);
|
| | | List<BrandShopCahe> listshop = brandShopCaheService.getByBrandId(brandInfo.getId());
|
| | | if (listshop == null) {
|
| | | updateInfo.setShopTotal(0);
|
| | |
| | | brandInfoMapper.updateByPrimaryKeySelective(updateInfo);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public void addShopAndGoods(long start, int count) {
|
| | | List<BrandInfo> list = brandInfoMapper.listValidAll(start, count);
|
| | |
| | |
|
| | | long startTime = java.lang.System.currentTimeMillis();
|
| | | LogHelper.test(start + "品牌更新service---addShopAndGoods" + startTime);
|
| | | |
| | |
|
| | | for (BrandInfo brandInfo : list) {
|
| | | try {
|
| | | String name = brandInfo.getName();
|
| | |
| | | continue;
|
| | | // 添加商品
|
| | | BrandInfo numInfo = brandGoodsCaheService.addBrandGoods(brandInfo);
|
| | | |
| | | BrandInfo updateInfo = new BrandInfo(); |
| | |
|
| | | BrandInfo updateInfo = new BrandInfo();
|
| | | updateInfo.setId(brandInfo.getId());
|
| | | updateInfo.setWeight(Math.random() * 1000);
|
| | | updateInfo.setGoodsTotal(numInfo.getGoodsTotal());
|
| | |
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | long endTime = java.lang.System.currentTimeMillis();
|
| | | LogHelper.test(start + "品牌更新service---addShopAndGoods" + endTime + ",本次总耗时:" +(endTime -startTime) / 1000);
|
| | | LogHelper.test(start + "品牌更新service---addShopAndGoods" + endTime + ",本次总耗时:" + (endTime - startTime) / 1000);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | |
|
| | | @Cacheable(value = "brandCache", key = "'listValidToApp-'+#start+'-'+#cid")
|
| | | @Override
|
| | | public List<BrandInfoVO> listValidToApp(long start, int count, Long cid) {
|
| | | public List<BrandInfoVO> listValidToApp(long start, int count, Long cid, String platform, String version) {
|
| | | List<BrandInfoVO> list = brandInfoMapper.listBrandInfoVO(start, count, cid);
|
| | | if (list == null || list.size() == 0)
|
| | | return null;
|
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO configParamsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO configParamsDTO = hongBaoManageService.getShowComputeRate(platform, version);
|
| | |
|
| | | List<BrandInfoVO> listInfo = new ArrayList<BrandInfoVO>();
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | BrandInfoVO brand = list.get(i);
|
| | | if (brand == null)
|
| | | continue;
|
| | | |
| | |
|
| | | List<BrandGoodsCahe> listGoods = brandGoodsCaheService.getByBrandId(1, 3, brand.getId());
|
| | | if (listGoods == null || listGoods.size() < 3)
|
| | | continue;
|
| | |
| | | }
|
| | | return listInfo;
|
| | | }
|
| | | |
| | | |
| | | |
| | | |
| | |
|
| | | @Override
|
| | | @Cacheable(value = "brandCache", key = "'listByAlikeName-'+#key")
|
| | | public BrandInfoVO listByAlikeName(String key) {
|
| | | @Cacheable(value = "brandCache", key = "'listByAlikeName-'+#key+'-'+#platform+'-'+#version")
|
| | | public BrandInfoVO listByAlikeName(String key,String platform,String version) {
|
| | | if (StringUtil.isNullOrEmpty(key))
|
| | | return null;
|
| | | |
| | |
|
| | | List<BrandInfoVO> list = brandInfoMapper.listByAlikeName(key);
|
| | | if (list == null || list.size() == 0)
|
| | | return null;
|
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO configParamsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate());
|
| | | |
| | |
|
| | | ConfigParamsDTO configParamsDTO = hongBaoManageService.getShowComputeRate(platform, version);
|
| | |
|
| | | BrandInfoVO brand = list.get(0);
|
| | | List<BrandGoodsCahe> listGoods = brandGoodsCaheService.getByBrandId(1, 3, brand.getId());
|
| | | if (listGoods == null || listGoods.size() < 3)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | if (listGoodsVO.size() < 3) |
| | | if (listGoodsVO.size() < 3)
|
| | | return null;
|
| | | |
| | |
|
| | | brand.setListGoods(listGoodsVO);
|
| | | return brand;
|
| | | }
|
| | |
| | | } else {
|
| | | List<Integer> cidList = new ArrayList<>();
|
| | | cidList.add(Integer.parseInt(cid));
|
| | | result =
|
| | | DaTaoKeApiUtil.getGoodsList("", cidList, null, new BigDecimal("10"), null, page, pageSize,
|
| | | DaTaoKeApiUtil.SORT_DEFAULT);
|
| | | result = DaTaoKeApiUtil.getGoodsList("", cidList, null, new BigDecimal("10"), null, page, pageSize,
|
| | | DaTaoKeApiUtil.SORT_DEFAULT);
|
| | |
|
| | | if (result == null || result.getGoodsList() == null || result.getGoodsList().size() == 0) {
|
| | | result = new DaTaoKeGoodsResult();
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | Map<Long, TaoBaoGoodsBrief> goodsMap = new HashMap<>();
|
| | | for (TaoBaoGoodsBrief goods : listTaoKeGoods)
|
| | | goodsMap.put(goods.getAuctionId(), goods);
|
| | | if (listTaoKeGoods != null)
|
| | | for (TaoBaoGoodsBrief goods : listTaoKeGoods)
|
| | | goodsMap.put(goods.getAuctionId(), goods);
|
| | | for (int i = 0; i < goodsList.size(); i++) {
|
| | | if (goodsMap.get(goodsList.get(i).getAuctionId()) == null) {
|
| | | goodsList.remove(i--);
|
| | |
| | | * 首页最底部@商品信息流
|
| | | */
|
| | | @Override
|
| | | @Cacheable(value = "qualityCache", key = "'getRecommendToIndexV2-'+#start")
|
| | | public JSONArray getRecommendToIndexV2(long start, int count) {
|
| | | @Cacheable(value = "qualityCache", key = "'getRecommendToIndexV2-'+#start+'-'+#platform+'-'+#version")
|
| | | public JSONArray getRecommendToIndexV2(long start, int count,String platform,String version) {
|
| | |
|
| | | // 返利金额2元以上;
|
| | | Integer commision = 2;
|
| | |
| | | } catch (Exception e) {
|
| | | }
|
| | |
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO =hongBaoManageService.getShowComputeRate(platform, version);
|
| | |
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : goodsList) {
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief,paramsDTO);
|
| | |
| | | import com.yeshi.fanli.service.inter.lable.TaoKeGoodsService;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | @Cacheable(value = "searchWuLiaoCache", key = "'searchWuLiaoV2-'+#sf")
|
| | | public JSONObject searchWuLiaoV2(SearchFilter sf) {
|
| | | @Cacheable(value = "searchWuLiaoCache", key = "'searchWuLiaoV2-'+#sf+'-'+#platform+'-'+#version")
|
| | | public JSONObject searchWuLiaoV2(SearchFilter sf,String platform,String version) {
|
| | |
|
| | | // 淘宝物料接口查询
|
| | | TaoBaoSearchResult result = TaoKeApiUtil.searchWuLiao(sf);
|
| | |
| | | int fh = sf.getHongbao();
|
| | | boolean ft = sf.isTmall();
|
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(platform, version);
|
| | |
|
| | | if (fq == 0 && fh == 0 && !ft) {
|
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null)
|
| | |
| | | coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
|
| | | try {
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
|
| | | coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, "至少成功邀请1个队员后可激活"));
|
| | | coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, "至少成功邀请1个粉丝后可激活"));
|
| | | } catch (MsgOtherDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | if (coupon == null || coupon.getUid() == null)
|
| | | return;
|
| | | MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createWelfareCouponActive(getLeftDay(coupon),
|
| | | "成功邀请队员:" + worker.getNickName(), coupon.getStartTime(), coupon.getEndTime());
|
| | | "成功邀请粉丝:" + worker.getNickName(), coupon.getStartTime(), coupon.getEndTime());
|
| | | try {
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
|
| | | coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, "可在首页-免单商品-选择商品-使用"));
|
| | |
| | | .createWelfareCouponWillOutOfDate(getLeftDay(coupon), coupon.getStartTime(), coupon.getEndTime());
|
| | | try {
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
|
| | | coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, "至少成功邀请1个队员后可激活"));
|
| | | coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, "至少成功邀请1个粉丝后可激活"));
|
| | | } catch (MsgOtherDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | .createWelfareCouponWillOutOfDate(getLeftDay(coupon), coupon.getStartTime(), coupon.getEndTime());
|
| | | try {
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
|
| | | coupon.getId(), dto, MsgTypeOtherTypeEnum.couponMianDan, "至少成功邀请1个队员后可激活"));
|
| | | coupon.getId(), dto, MsgTypeOtherTypeEnum.couponMianDan, "至少成功邀请1个粉丝后可激活"));
|
| | | } catch (MsgOtherDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | private HongBaoOrderMapper hongBaoOrderMapper;
|
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void fanli(HongBaoV2 hb1) throws TaoBaoWeiQuanException {
|
| | | // 查询最新的红包数据
|
| | | hb1 = hongBaoV2Mapper.selectByPrimaryKeyForUpdate(hb1.getId());
|
| | |
| | | String key = mainUser.getId() + "-" + UUID.randomUUID().toString();
|
| | | msg.setKey(key);
|
| | | try {
|
| | | orderTransactionProducer.send(msg, new LocalTransactionExecuter() {
|
| | | @Override
|
| | | public TransactionStatus execute(Message arg0, Object arg1) {
|
| | | try {
|
| | | orderMoneySettleService.ziGouSettle(hongBaoOrder.getCommonOrder().getOrderNo(),
|
| | | hongBaoOrder.getCommonOrder().getSourceType(), key);
|
| | | return TransactionStatus.CommitTransaction;
|
| | | } catch (Exception e) {
|
| | | return TransactionStatus.RollbackTransaction;
|
| | | if (!Constant.IS_TEST)
|
| | | orderTransactionProducer.send(msg, new LocalTransactionExecuter() {
|
| | | @Override
|
| | | public TransactionStatus execute(Message arg0, Object arg1) {
|
| | | try {
|
| | | orderMoneySettleService.ziGouSettle(hongBaoOrder.getCommonOrder().getOrderNo(),
|
| | | hongBaoOrder.getCommonOrder().getSourceType(), key);
|
| | | return TransactionStatus.CommitTransaction;
|
| | | } catch (Exception e) {
|
| | | return TransactionStatus.RollbackTransaction;
|
| | | }
|
| | | }
|
| | | }, null);
|
| | | else{
|
| | | try {
|
| | | orderMoneySettleService.ziGouSettle(hongBaoOrder.getCommonOrder().getOrderNo(),
|
| | | hongBaoOrder.getCommonOrder().getSourceType(), key);
|
| | | } catch (Exception e) {
|
| | | }
|
| | | }, null);
|
| | | }
|
| | | } catch (Exception e) {
|
| | | LogHelper.mqError(e.getMessage(), msg.getTopic(), msg.getTag(), new Gson().toJson(mqMsg));
|
| | | }
|
| | |
| | | } catch (UserAccountException e) {
|
| | |
|
| | | }
|
| | | if (resultCode == 1) {// 只发送新增消息
|
| | | OrderMQMsg mqMsg = new OrderMQMsg(orderId, sourceType, uid, OrderMQMsg.HANDLE_TYPE_ADD,
|
| | | isCommonOrderValid(coList), 0, new Date());
|
| | | Message msg = MQMsgBodyFactory.create(MQTopicName.TOPIC_ORDER, OrderTopicTagEnum.orderStatistic, mqMsg);
|
| | | producer.send(msg);
|
| | | }
|
| | | if (!Constant.IS_TEST)
|
| | | if (resultCode == 1) {// 只发送新增消息
|
| | | OrderMQMsg mqMsg = new OrderMQMsg(orderId, sourceType, uid, OrderMQMsg.HANDLE_TYPE_ADD,
|
| | | isCommonOrderValid(coList), 0, new Date());
|
| | | Message msg = MQMsgBodyFactory.create(MQTopicName.TOPIC_ORDER, OrderTopicTagEnum.orderStatistic, mqMsg);
|
| | | producer.send(msg);
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.HongBaoManageMapper;
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.dto.order.OrderHongBaoRateParams;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoManage;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.exception.order.HongBaoException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | |
|
| | | @Service
|
| | | public class HongBaoManageServiceImpl implements HongBaoManageService {
|
| | |
| | | throw new HongBaoException(2, "未匹配到比例参数");
|
| | | }
|
| | |
|
| | | @Override
|
| | | public ConfigParamsDTO getShowComputeRate(String platform, String version) {
|
| | |
|
| | | BigDecimal fanLiRate = getFanLiRate();
|
| | | BigDecimal shareRate = getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
|
| | | getVIPFanLiRate());
|
| | | if (VersionUtil.greaterThan_2_1(platform, version)) {
|
| | | paramsDTO.setMaxRewardRate(null);
|
| | | }
|
| | | return paramsDTO;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | public void orderShareFirstLevelStatistic(Long uid, String orderId, int orderType, BigDecimal payMoney,
|
| | | BigDecimal money, int goodsCount, int orderState, String sourceUserName) {
|
| | | MsgOrderDetail detail = MsgOrderDetailFactory.createInviteOrder(uid, orderId, orderType, goodsCount, orderState,
|
| | | payMoney, money, String.format("由一级队员【%s】分享", getShortName(sourceUserName)));
|
| | | payMoney, money, String.format("由直接粉丝【%s】分享", getShortName(sourceUserName)));
|
| | | try {
|
| | | msgOrderDetailService.addMsgOrderDetail(detail,
|
| | | (money == null || money.compareTo(new BigDecimal(0)) <= 0) ? false : true);
|
| | |
| | | dto.setNickName(userInfo.getNickName());
|
| | | dto.setPortrait(userInfo.getPortrait());
|
| | | userMoneyMsgNotificationService.teamRedPackRewardMsg(bossId, MsgTypeMoneyTypeEnum.redPackOneStageReward, money,
|
| | | "队员(好友)完成第一阶段", new Gson().toJson(dto));
|
| | | "粉丝(好友)完成第一阶段", new Gson().toJson(dto));
|
| | | }
|
| | |
|
| | | @RequestSerializableByKeyService(key = "#uid")
|
| | |
| | | dto.setNickName(userInfo.getNickName());
|
| | | dto.setPortrait(userInfo.getPortrait());
|
| | | userMoneyMsgNotificationService.teamRedPackRewardMsg(bossId, MsgTypeMoneyTypeEnum.redPackTwoStageReward, money,
|
| | | "队员(好友)完成第二阶段", new Gson().toJson(dto));
|
| | | "粉丝(好友)完成第二阶段", new Gson().toJson(dto));
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | dto.setNickName(userInfo.getNickName());
|
| | | dto.setPortrait(userInfo.getPortrait());
|
| | | userMoneyMsgNotificationService.teamRedPackRewardMsg(bossId, MsgTypeMoneyTypeEnum.redPackThreeStageReward,
|
| | | money, "队员(好友)完成第三阶段连续[第" + monthSpace + "个月]", new Gson().toJson(dto));
|
| | | money, "粉丝(好友)完成第三阶段连续[第" + monthSpace + "个月]", new Gson().toJson(dto));
|
| | | }
|
| | |
|
| | |
|
| | |
| | | }
|
| | |
|
| | |
|
| | | //@Cacheable(value = "commonContentCache", key = "'tljFreeBuy-listByDay'+#day")
|
| | | @Cacheable(value = "commonContentCache", key = "'tljFreeBuy-listByDay'+#day")
|
| | | @Override
|
| | | public List<TLJFreeBuyGoods> listByDay(String day) {
|
| | | List<TLJFreeBuyGoods> list = listByDay(day, 10);
|
| | |
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.db.MongoDBManager;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | |
| | | }
|
| | | return list;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | @Cacheable(value = "brandCache", key = "'getShopByKeyV2-'+#key")
|
| | | public List<TaoBaoShopVO> getShopByKeyV2(String key) {
|
| | | @Cacheable(value = "brandCache", key = "'getShopByKeyV2-'+#key+'-'+#platform+'-'+#version")
|
| | | public List<TaoBaoShopVO> getShopByKeyV2(String key, String platform, String version) {
|
| | | List<TaoBaoShopVO> list = taoBaoShopMapper.getShopByKey(key);
|
| | | if (list == null || list.size() == 0) {
|
| | | return null;
|
| | | }
|
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(platform, version);
|
| | |
|
| | | for (TaoBaoShopVO taoBaoShopVO : list) {
|
| | | |
| | |
|
| | | Integer userType = taoBaoShopVO.getUserType();
|
| | | if (userType == null || userType == 0) {
|
| | | taoBaoShopVO.setUserType(10);
|
| | |
| | | state = true;
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra == null || StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
|
| | | tips.add("确认领取后,你将成为赠送人的一级队员;");
|
| | | tips.add("确认领取后,你将成为赠送人的直接粉丝;");
|
| | | tips.add("获赠的免单券,需要激活后才能使用,详情参见免单券激活规则;");
|
| | | tips.add("成功领取后,请到“我的-福利中心”查看。");
|
| | | } else {
|
| | |
| | | state = true;
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra == null || StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
|
| | | tips.add("确认领取后,你将成为赠送人的一级队员;");
|
| | | tips.add("确认领取后,你将成为赠送人的直接粉丝;");
|
| | | tips.add("板栗快省奖励券,可用于“已到账”的返利订单,在返利的基础上再获得一定比例的返利;");
|
| | | tips.add("成功领取后,请到“我的-福利中心”中查看。");
|
| | | } else {
|
| | |
| | | state = true;
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra == null || StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
|
| | | tips.add("确认领取后,你将成为赠送人的一级队员;");
|
| | | tips.add("确认领取后,你将成为赠送人的直接粉丝;");
|
| | | tips.add("红包可提现,可购买折扣商品;");
|
| | | tips.add("成功领取后,请到“我的-红包”中查看。");
|
| | | } else {
|
| | |
| | | boolean addTeam = addInviteTeam(uid, giveUid, userInfoExtra);
|
| | | String beiZhu = "无";
|
| | | if (addTeam)
|
| | | beiZhu = "领取人已经成为你的一级队员";
|
| | | beiZhu = "领取人已经成为你的直接粉丝";
|
| | |
|
| | | String userName = "无";
|
| | | UserInfo user = userInfoService.selectByPKey(uid);
|
| | |
| | | boolean addTeam = addInviteTeam(uid, giveUid, userInfoExtra);
|
| | | String beiZhu = "无";
|
| | | if (addTeam)
|
| | | beiZhu = "领取人已经成为你的一级队员";
|
| | | beiZhu = "领取人已经成为你的直接粉丝";
|
| | |
|
| | | String userName = "无";
|
| | | UserInfo user = userInfoService.selectByPKey(uid);
|
| | |
| | | String beiZhu = "无";
|
| | | String giveBeiZhu = "无";
|
| | | if (addTeam) {
|
| | | beiZhu = "你已成为赠送人的一级队员";
|
| | | giveBeiZhu = "领取人已成为你的一级队员";
|
| | | beiZhu = "你已成为赠送人的直接粉丝";
|
| | | giveBeiZhu = "领取人已成为你的直接粉丝";
|
| | | // 激活邀请信息
|
| | | addInviteMsg(uid, giveUid, giveRecord.getAmount().setScale(2) + "元红包");
|
| | | }
|
| | |
| | | if (ExchangeTypeEnum.freeCouponBuy == type) {
|
| | | exchangeTip.setTip("自购免单券仅能自己使用,且每个用户ID只能兑换一次。\r\n注:兑换成功后请到“我的-福利中心”中查看");
|
| | | } else if (ExchangeTypeEnum.freeCouponGive == type) {
|
| | | exchangeTip.setTip("赠送免单券兑换次数不限,赠送次数不限,受赠人若无“邀请人”成功领取后将成为你的一级队员。\r\n注:兑换成功后请到“我的-福利中心”中查看");
|
| | | exchangeTip.setTip("赠送免单券兑换次数不限,赠送次数不限,受赠人若无“邀请人”成功领取后将成为你的直接粉丝。\r\n注:兑换成功后请到“我的-福利中心”中查看");
|
| | | } else if (ExchangeTypeEnum.rebatePercentCoupon == type) {
|
| | | exchangeTip.setTip("返利奖励券兑换次数不限,赠送次数不限,受赠人若无“邀请人”成功领取后将成为你的一级队员。\r\n注:兑换成功后请到“我的-福利中心”中查看");
|
| | | exchangeTip.setTip("返利奖励券兑换次数不限,赠送次数不限,受赠人若无“邀请人”成功领取后将成为你的直接粉丝。\r\n注:兑换成功后请到“我的-福利中心”中查看");
|
| | | } else if (ExchangeTypeEnum.inviteCodePublish == type) {
|
| | | if (codePublishRecordService.countValidRecord(uid) > 0)
|
| | | throw new IntegralExchangeException(1, "三天之内不可重复兑换");
|
| | |
| | | return totalGoldCoin + (userInfoExtra.getGoldCoin() == null ? 0 : userInfoExtra.getGoldCoin());
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public boolean addDetail(Long uid, IntegralTaskRecord record) throws IntegralTaskRecordException {
|
| | | Long uid2 = record.getUid();
|
| | | if (uid2 == null || uid.longValue() != uid2.longValue())
|
| | |
| | | return integralTaskRecordMapper.countGetCountByTaskIdAndDay(taskId, uid, minTime, maxTime);
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public IntegralTaskRecord addRecord(IntegralTaskRecord record) throws IntegralTaskRecordException {
|
| | | if (record == null)
|
| | |
| | | // 设置有效期
|
| | | record.setEndTime(DateUtil.plusDayDate(Constant.GOLD_COIN_VALID_DAYS, date));
|
| | | integralTaskRecordMapper.insertSelective(record);
|
| | | |
| | | // long count = integralTaskRecordMapper.getTotalGoldCoinByUid(record.getUid());
|
| | | // if (count >= 200) {// 大于200发送消息
|
| | | // IntegralTaskMQMsg msg = new IntegralTaskMQMsg(record.getUid(), count, new Date());
|
| | | // Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.integralTaskFinish,
|
| | | // msg);
|
| | | // producer.send(message);
|
| | | // }
|
| | |
|
| | | return record;
|
| | | }
|
| | |
|
| | |
| | | msgOther.setSource("首笔分享订单,系统奖励金币 ");
|
| | | msgOther.setExplain("首笔分享订单得到的奖金不足0.01元时奖励 ");
|
| | | } else {
|
| | | msgOther.setSource(level + "级队员首次下单,系统奖励金币 ");
|
| | | msgOther.setExplain("仅新邀请队员首下单你得到的奖金不足0.01元时奖励 ");
|
| | | if (level.equalsIgnoreCase("一") || level.equalsIgnoreCase("1"))
|
| | | msgOther.setSource("直接粉丝首次下单,系统奖励金币 ");
|
| | | else
|
| | | msgOther.setSource("间接粉丝首次下单,系统奖励金币 ");
|
| | | msgOther.setExplain("仅新邀请粉丝首下单你得到的奖金不足0.01元时奖励 ");
|
| | | }
|
| | | userOtherMsgNotificationService.firstOrderRewardMsg(uid, null, msgOther);
|
| | | }
|
| | |
| | | update.setId(oldDetail.getId());
|
| | | if (!detail.getInviteUser().getState()) {
|
| | | if (detail.getInviteUser().getExpire() == ThreeSale.EXPIRE_NORMAL) {
|
| | | update.setDesc("恭喜你,有新队员加入你的队列,若对方60天内未激活将会与你脱离邀请关系");
|
| | | update.setDesc("恭喜你,有新粉丝加入你的队列,若对方60天内未激活将会与你脱离邀请关系");
|
| | | } else {
|
| | | update.setDesc("抱歉,该队员因60天内未激活,已脱离了你的队列,可以试着重新邀请");
|
| | | update.setDesc("抱歉,该粉丝因60天内未激活,已脱离了你的队列,可以试着重新邀请");
|
| | | }
|
| | | } else {
|
| | | update.setDesc("恭喜你,成功邀请一个队员");
|
| | | update.setDesc("恭喜你,成功邀请一个粉丝");
|
| | | }
|
| | | update.setUpdateTime(new Date());
|
| | | update.setRead(false);
|
| | |
| | | * @param cid
|
| | | * @return
|
| | | */
|
| | | public JSONObject listEffectiveCacheV2(int page, Long cid);
|
| | | public JSONObject listEffectiveCacheV2(int page, Long cid,String platform,String version);
|
| | |
|
| | |
|
| | | /**
|
| | |
| | | * @param cid
|
| | | * @return
|
| | | */
|
| | | public List<TaoBaoShopVO> listEffectiveShop(long start, int count, Long cid);
|
| | | public List<TaoBaoShopVO> listEffectiveShop(long start, int count, Long cid,String platform,String version);
|
| | |
|
| | |
|
| | |
|
| | |
| | | * @return
|
| | | * @throws BrandInfoException
|
| | | */
|
| | | public List<BrandInfoVO> listBrandInfoCache(long start, int count, Long cid);
|
| | | public List<BrandInfoVO> listBrandInfoCache(long start, int count, Long cid,String platform,String version);
|
| | |
|
| | |
|
| | | /**
|
| | |
| | | * @param cid
|
| | | * @return
|
| | | */
|
| | | public List<BrandInfoVO> listValidToApp(long start, int count, Long cid);
|
| | | public List<BrandInfoVO> listValidToApp(long start, int count, Long cid,String platform,String version);
|
| | |
|
| | |
|
| | | /**
|
| | |
| | | * @param key
|
| | | * @return
|
| | | */
|
| | | public BrandInfoVO listByAlikeName(String key);
|
| | | public BrandInfoVO listByAlikeName(String key,String platform,String version);
|
| | |
|
| | | }
|
| | |
| | | * @param proportion
|
| | | * @return
|
| | | */
|
| | | public JSONArray getRecommendToIndexV2(long start, int count);
|
| | | public JSONArray getRecommendToIndexV2(long start, int count,String platform,String version);
|
| | | }
|
| | |
| | | public List<QualityFactory> queryByQuality(long start, int count, String searchKey, Long systemCid, List<Long> listLabId);
|
| | |
|
| | |
|
| | | public JSONObject searchWuLiaoV2(SearchFilter sf);
|
| | |
|
| | | public JSONObject searchWuLiaoV2(SearchFilter sf,String platform,String version);
|
| | |
|
| | | }
|
| | |
| | |
|
| | | import org.springframework.cache.annotation.CacheEvict;
|
| | |
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.dto.order.OrderHongBaoRateParams;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoManage;
|
| | | import com.yeshi.fanli.exception.order.HongBaoException;
|
| | |
| | | */
|
| | | public BigDecimal getRate(OrderHongBaoRateParams params) throws HongBaoException;
|
| | |
|
| | | /**
|
| | | * 获取需要显示计算的比例实体
|
| | | * |
| | | * @param platform
|
| | | * @param version
|
| | | * @return
|
| | | */
|
| | | public ConfigParamsDTO getShowComputeRate(String platform, String version);
|
| | |
|
| | | }
|
| | |
| | | * @param key
|
| | | * @return
|
| | | */
|
| | | public List<TaoBaoShopVO> getShopByKeyV2(String key);
|
| | | public List<TaoBaoShopVO> getShopByKeyV2(String key,String platform,String version);
|
| | | }
|
| | |
| | | return CommonOrder.STATE_SX;
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | private boolean updateHongBao(HongBaoOrder hongBaoOrder, CommonOrder commonOrder, int type,
|
| | | Map<Integer, HongBaoOrder> notificationMap) throws HongBaoException, UserAccountException {
|
| | | System.out.println(commonOrder.getOrderNo());
|
| | |
| | | HongBaoV2.TYPE_YIJI, MoneyBigDecimalUtil.mul(hongBao.getMoney(),
|
| | | firstRate.divide(new BigDecimal(100))));
|
| | | if (firstHongbao != null)
|
| | | addInviteHongBao(firstHongbao, notificationMap, commonOrder);
|
| | | addInviteHongBao(firstHongbao, null, notificationMap, commonOrder);
|
| | | }
|
| | | boss = threeSaleSerivce.getBoss(boss.getId());
|
| | | if (boss != null) {
|
| | |
| | | HongBaoV2.TYPE_ERJI, MoneyBigDecimalUtil.mul(hongBao.getMoney(),
|
| | | secondRate.divide(new BigDecimal(100))));
|
| | | if (secondHongbao != null)
|
| | | addInviteHongBao(secondHongbao, notificationMap, commonOrder);
|
| | | addInviteHongBao(secondHongbao, null, notificationMap, commonOrder);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | HongBaoV2 firstHongbao = createInviteHongBao(boss.getId(), hongBao, commonOrder, HongBaoV2.TYPE_YIJI,
|
| | | MoneyBigDecimalUtil.mul(hongBao.getMoney(), firstRate.divide(new BigDecimal(100))));
|
| | |
|
| | | addInviteHongBao(firstHongbao, notificationMap, commonOrder);
|
| | | addInviteHongBao(firstHongbao, null, notificationMap, commonOrder);
|
| | |
|
| | | // 插入二级子红包
|
| | | boss = threeSaleSerivce.getBoss(boss.getId());
|
| | |
| | | HongBaoV2 secondHongbao = createInviteHongBao(boss.getId(), hongBao, commonOrder,
|
| | | HongBaoV2.TYPE_ERJI,
|
| | | MoneyBigDecimalUtil.mul(hongBao.getMoney(), secondRate.divide(new BigDecimal(100))));
|
| | | addInviteHongBao(secondHongbao, notificationMap, commonOrder);
|
| | | addInviteHongBao(secondHongbao, null, notificationMap, commonOrder);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | HongBaoV2.TYPE_SHARE_YIJI,
|
| | | MoneyBigDecimalUtil.mul(hongBao.getMoney(), firstLevelRate.divide(new BigDecimal(100))));
|
| | |
|
| | | addInviteHongBao(firstHongbao, notificationMap, commonOrder);
|
| | | addInviteHongBao(firstHongbao, hongBao.getUserInfo().getNickName(), notificationMap, commonOrder);
|
| | |
|
| | | // 二级分享赚
|
| | | boss = threeSaleSerivce.getBoss(boss.getId());
|
| | |
| | | HongBaoV2 secondChild = createInviteHongBao(boss.getId(), hongBao, commonOrder,
|
| | | HongBaoV2.TYPE_SHARE_ERJI, MoneyBigDecimalUtil.mul(hongBao.getMoney(),
|
| | | secondLevelRate.divide(new BigDecimal(100))));
|
| | | addInviteHongBao(secondChild, notificationMap, commonOrder);
|
| | | addInviteHongBao(secondChild, null, notificationMap, commonOrder);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | * @param notificationMap
|
| | | * @param commonOrder
|
| | | */
|
| | | private void addInviteHongBao(HongBaoV2 child, Map<Integer, HongBaoOrder> notificationMap,
|
| | | CommonOrder commonOrder) {
|
| | | private void addInviteHongBao(HongBaoV2 child, String parentHongBaoUserName,
|
| | | Map<Integer, HongBaoOrder> notificationMap, CommonOrder commonOrder) {
|
| | | if (child != null) {
|
| | | hongBaoV2Mapper.insertSelective(child);
|
| | | // 用户通知
|
| | |
| | | HongBaoV2 tempHongBao = new HongBaoV2(child.getId());
|
| | | tempHongBao.setUserInfo(child.getUserInfo());
|
| | | tempHongBao.setMoney(child.getMoney());
|
| | | if (child.getType() == HongBaoV2.TYPE_SHARE_YIJI)
|
| | | tempHongBao.setBeizhu(parentHongBaoUserName);
|
| | |
|
| | | CommonOrder tempCommonOrder = new CommonOrder(commonOrder.getId());
|
| | | tempCommonOrder.setPayment(commonOrder.getPayment());
|
| | | notificationMap.put(child.getType(), new HongBaoOrder(tempCommonOrder, tempHongBao));
|
| | |
| | | public static final String TAOBAO_SPECIAL_PID_DEFAULT = "mm_124933865_56750082_89555600043";
|
| | |
|
| | | // 奖励券最高比例
|
| | | public static final BigDecimal MAX_REWARD_RATE = new BigDecimal("0.35");
|
| | | public static final BigDecimal MAX_REWARD_RATE = new BigDecimal("0.31");
|
| | |
|
| | | // 返回给客户端的账号封禁提示语
|
| | | public static final String FORBIDDEN_USER_REASON_DESC = "你的账号或绑定的第三方账号已被封禁,封禁原因可在帮助中心的相关规则中参看,如有疑问或申诉解除封禁请联系客服";
|
| | |
| | | public static final int AUTO_EXTRACT_MIN_SURPLUS = 2;
|
| | |
|
| | | // vip、红包、奖励券倒计时 2.1上线时间
|
| | | public static final String VIP_ONLINE_TIME = "2019-12-20";
|
| | | public static final String VIP_ONLINE_TIME = "2019-12-22";
|
| | |
|
| | | // 红包邀请奖励
|
| | | public static final String RED_PACK_ONLINE_TIME = "2019-12-14";
|
| | |
| | |
|
| | | BigDecimal commission = CommonGoodsUtil.getCommission(goods, params.getFanLiRate());
|
| | | moneyInfoVO.setFanliMoney("¥" + commission);
|
| | | moneyInfoVO.setMaxMoney("¥" + 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.setShareMoney(CommonGoodsUtil.getCommissionInfo(goods, params.getShareRate()));
|
| | | goodsInfo.setMoneyInfo(moneyInfoVO);
|
| | |
|
| | |
| | | TaoBaoHongBaoInfo taoBaoHongBaoInfo = goods.getTaoBaoHongBaoInfo();
|
| | | moneyInfoVO.setFanliMoney("¥" + taoBaoHongBaoInfo.getHongbao());
|
| | | moneyInfoVO.setShareMoney("¥" + taoBaoHongBaoInfo.getHongbao());
|
| | | moneyInfoVO.setMaxMoney("¥" + TaoBaoUtil.getGoodsHongBaoMoney(goods, params.getVipFanLiRate()));
|
| | | if (params.getMaxRewardRate() != null)
|
| | | moneyInfoVO.setMaxMoney("¥" + taoBaoHongBaoInfo.getHongbao()
|
| | | .add(MoneyBigDecimalUtil.mul(taoBaoHongBaoInfo.getHongbao(), params.getMaxRewardRate())));
|
| | | else
|
| | | moneyInfoVO.setMaxMoney("¥" + TaoBaoUtil.getGoodsHongBaoMoney(goods, params.getVipFanLiRate()));
|
| | | } else {
|
| | | BigDecimal commission = TaoBaoUtil.getGoodsHongBaoMoney(goods, params.getFanLiRate());
|
| | | moneyInfoVO.setFanliMoney("¥" + commission);
|
| | | moneyInfoVO.setMaxMoney("¥" + TaoBaoUtil.getGoodsHongBaoMoney(goods, params.getVipFanLiRate()));
|
| | | if (params.getMaxRewardRate() != null)
|
| | | moneyInfoVO.setMaxMoney(
|
| | | "¥" + commission.add(MoneyBigDecimalUtil.mul(commission, params.getMaxRewardRate())));
|
| | | else
|
| | | moneyInfoVO.setMaxMoney("¥" + TaoBaoUtil.getGoodsHongBaoMoney(goods, params.getVipFanLiRate()));
|
| | | moneyInfoVO.setShareMoney(TaoBaoUtil.getGoodsHongBaoInfo(goods, params.getShareRate()));
|
| | | }
|
| | | goodsInfo.setMoneyInfo(moneyInfoVO);
|
| | |
| | | moneyInfoVO.setMoneyType(1); // 默认显示:返 ¥6.6
|
| | | BigDecimal commission = TaoBaoUtil.getGoodsHongBaoMoney(goods, params.getFanLiRate());
|
| | | moneyInfoVO.setFanliMoney("¥" + commission);
|
| | | moneyInfoVO.setMaxMoney("¥" + TaoBaoUtil.getGoodsHongBaoMoney(goods, params.getVipFanLiRate()));
|
| | | if (params.getMaxRewardRate() != null)
|
| | | moneyInfoVO
|
| | | .setMaxMoney("¥" + commission.add(MoneyBigDecimalUtil.mul(commission, params.getMaxRewardRate())));
|
| | | else
|
| | | moneyInfoVO.setMaxMoney("¥" + TaoBaoUtil.getGoodsHongBaoMoney(goods, params.getVipFanLiRate()));
|
| | | 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);
|
| | | moneyInfoVO.setMaxMoney("¥" + JDUtil.getGoodsFanLiMoney(goods, params.getVipFanLiRate()));
|
| | | if (params.getMaxRewardRate() != null)
|
| | | moneyInfoVO
|
| | | .setMaxMoney("¥" + commission.add(MoneyBigDecimalUtil.mul(commission, params.getMaxRewardRate())));
|
| | | else
|
| | | moneyInfoVO.setMaxMoney("¥" + JDUtil.getGoodsFanLiMoney(goods, params.getVipFanLiRate()));
|
| | | moneyInfoVO.setShareMoney("¥" + JDUtil.getGoodsFanLiMoney(goods, params.getShareRate()));
|
| | | goodsInfo.setMoneyInfo(moneyInfoVO);
|
| | |
|
| | |
| | | moneyInfoVO.setMoneyType(1); // 默认显示:返 ¥6.6
|
| | | BigDecimal commission = PinDuoDuoUtil.getGoodsFanLiMoney(goods, params.getFanLiRate());
|
| | | moneyInfoVO.setFanliMoney("¥" + commission);
|
| | | moneyInfoVO.setMaxMoney("¥" + PinDuoDuoUtil.getGoodsFanLiMoney(goods, params.getVipFanLiRate()));
|
| | | if (params.getMaxRewardRate() != null)
|
| | | moneyInfoVO
|
| | | .setMaxMoney("¥" + commission.add(MoneyBigDecimalUtil.mul(commission, params.getMaxRewardRate())));
|
| | | else
|
| | | moneyInfoVO.setMaxMoney("¥" + PinDuoDuoUtil.getGoodsFanLiMoney(goods, params.getVipFanLiRate()));
|
| | | moneyInfoVO.setShareMoney("¥" + PinDuoDuoUtil.getGoodsFanLiMoney(goods, params.getShareRate()));
|
| | | goodsInfo.setMoneyInfo(moneyInfoVO);
|
| | |
|
| | |
| | | else
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setDesc("恭喜你,成功邀请一个队员");
|
| | | detail.setDesc("恭喜你,成功邀请一个粉丝");
|
| | | detail.setInviteUser(threeSale);
|
| | | detail.setMsgType(MsgTypeInviteTypeEnum.invite);
|
| | | detail.setRead(false);
|
| | |
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setInviteUser(threeSale);
|
| | | detail.setMsgType(MsgTypeInviteTypeEnum.inviteSucceed);
|
| | | detail.setDesc("队员(好友)熟练使用App可获得红包");
|
| | | detail.setDesc("粉丝(好友)熟练使用App可获得红包");
|
| | | detail.setBeiZhu("满足获得红包条件后系统将自动下发到“我的-红包”中");
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setUpdateTime(new Date());
|
| | |
| | | else
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setDesc("恭喜你,有新队员加入你的队列,若对方60天内未激活将会与你脱离邀请关系");
|
| | | detail.setDesc("恭喜你,有新粉丝加入你的队列,若对方60天内未激活将会与你脱离邀请关系");
|
| | | detail.setInviteUser(threeSale);
|
| | | detail.setMsgType(MsgTypeInviteTypeEnum.invite);
|
| | | detail.setRead(false);
|
| | |
| | | else
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setDesc("抱歉,该队员因60天内未激活,已脱离了你的队列,可以试着重新邀请");
|
| | | detail.setDesc("抱歉,该粉丝因60天内未激活,已脱离了你的队列,可以试着重新邀请");
|
| | | detail.setInviteUser(threeSale);
|
| | | detail.setMsgType(MsgTypeInviteTypeEnum.invite);
|
| | | detail.setRead(false);
|
| | |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("被邀请人", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("邀请队员成功", COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("邀请粉丝成功", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("邀请状态", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
New file |
| | |
| | | package com.yeshi.fanli.util.goods.jd;
|
| | |
|
| | | import java.io.IOException;
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | |
|
| | | import org.jsoup.Jsoup;
|
| | | import org.jsoup.nodes.Document;
|
| | | import org.jsoup.nodes.Element;
|
| | | import org.jsoup.select.Elements;
|
| | |
|
| | | /**
|
| | | * 京东内优惠商品爬取 https://www.n-youhui.com
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class NYouHuiUtil {
|
| | | public static List<String> getClasses() {
|
| | | List<String> classList = new ArrayList<>();
|
| | | try {
|
| | | Document doc = Jsoup.connect("https://www.n-youhui.com").timeout(20000)
|
| | | .userAgent(
|
| | | "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36")
|
| | | .get();
|
| | | Element classesRoot = doc.getElementsByClass("widget_categories").get(0);
|
| | | Elements level0 = classesRoot.getElementsByClass("level-0");
|
| | | for (int i = 0; i < level0.size(); i++) {
|
| | | String name = level0.get(i).html().replace(" ", "").replaceAll("\\(([0-9]|,)*\\)", "").trim();
|
| | | classList.add(name);
|
| | | }
|
| | | } catch (IOException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return classList;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import java.io.InputStreamReader;
|
| | | import java.io.UnsupportedEncodingException;
|
| | | import java.math.BigDecimal;
|
| | | import java.net.URLDecoder;
|
| | | import java.net.URLEncoder;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Collections;
|
| | | import java.util.Comparator;
|
| | | import java.util.HashMap;
|
| | | import java.util.Iterator;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | |
| | | import org.jsoup.select.Elements;
|
| | | import org.yeshi.utils.BigDecimalUtil;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | | import org.yeshi.utils.NumberUtil;
|
| | |
|
| | | import com.yeshi.fanli.dto.GoodsClassDTO;
|
| | | import com.yeshi.fanli.dto.jd.JDCommissionInfo;
|
| | |
| | | import com.yeshi.fanli.dto.jd.JDSearchResult;
|
| | | import com.yeshi.fanli.dto.jd.JDShopInfo;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 通过链接id
|
| | | * |
| | | * @param url
|
| | | * @return
|
| | | */
|
| | | public static String getJDGoodsIdByWeiXin(String url) {
|
| | | if (StringUtil.isNullOrEmpty(url)) |
| | | if (StringUtil.isNullOrEmpty(url))
|
| | | return null;
|
| | | |
| | |
|
| | | try {
|
| | | String id = null;
|
| | | int indexOf = url.indexOf("?");
|
| | | url = url.substring(indexOf + 1, url.length()-1);
|
| | | url = url.substring(indexOf + 1, url.length() - 1);
|
| | | String[] temp = url.split("&");
|
| | | for (int i =0; i < temp.length; i ++) {
|
| | | String content = temp[i];
|
| | | for (int i = 0; i < temp.length; i++) {
|
| | | String content = temp[i];
|
| | | if (content.startsWith("sku")) {
|
| | | id = content.split("=")[content.split("=").length-1];
|
| | | id = content.split("=")[content.split("=").length - 1];
|
| | | break;
|
| | | } |
| | | }
|
| | | }
|
| | | return id;
|
| | | } catch (Exception e) {
|
| | |
| | | }
|
| | | return null;
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 根据 u.jd短连接获取真实的商品id
|
| | | * |
| | | * @param url
|
| | | * @return
|
| | | */
|
| | | public static String getJDGoodsIdByUJD(String url) {
|
| | | try {
|
| | | String body = HttpUtil.get(url);
|
| | | String body = HttpUtil.get(url);
|
| | | Document doc = Jsoup.parse(body);
|
| | | Elements els = doc.getElementsByTag("script");
|
| | | for (int i = 0; i < els.size(); i++) {
|
| | |
| | | if (content.indexOf("var hrl") > -1) {
|
| | | ScriptEngineManager manager = new ScriptEngineManager();
|
| | | ScriptEngine engine = manager.getEngineByName("javascript");
|
| | | |
| | |
|
| | | int indexOf = content.indexOf("var hrl");
|
| | | content = content.substring(indexOf, content.length());
|
| | | |
| | |
|
| | | int indexOf2 = content.indexOf(";");
|
| | | content = content.substring(0, indexOf2+1);
|
| | | |
| | | content = content.substring(0, indexOf2 + 1);
|
| | |
|
| | | String js = "function getData(){return JSON.stringify(hrl);}" + content;
|
| | | |
| | |
|
| | | engine.eval(js);
|
| | | if (engine instanceof Invocable) {
|
| | | Invocable in = (Invocable) engine;
|
| | | String data = in.invokeFunction("getData").toString();
|
| | | String link = data.substring(1, data.length()-1);
|
| | | |
| | | String link = data.substring(1, data.length() - 1);
|
| | | // 将链接中未encode的参数encode
|
| | | String param = link.split("\\?")[1];
|
| | | String host = link.split("\\?")[0];
|
| | | String[] params = param.split("&");
|
| | | String paramStr = "";
|
| | | for (String p : params) {
|
| | | String value = p.substring(p.indexOf("=") + 1);
|
| | | String key = p.substring(0, p.indexOf("="));
|
| | | if (URLDecoder.decode(value, "UTF-8").equalsIgnoreCase(value)) {
|
| | | value = URLEncoder.encode(value, "UTF-8");
|
| | | }
|
| | | paramStr += key + "=" + value + "&";
|
| | | }
|
| | | link = host + "?" + paramStr;
|
| | | String realLink = HttpUtil.getLocation(link);
|
| | | realLink = realLink.substring(realLink.indexOf("sku=") + 4, realLink.length());
|
| | | return realLink.substring(0, realLink.indexOf("&"));
|
| | | Map<String, String> paramsMap = new HashMap<>();
|
| | |
|
| | | param = realLink.split("\\?")[1];
|
| | | params = param.split("&");
|
| | | for (String p : params) {
|
| | | String value = p.substring(p.indexOf("=") + 1);
|
| | | String key = p.substring(0, p.indexOf("="));
|
| | | paramsMap.put(key, value);
|
| | | }
|
| | | if (!StringUtil.isNullOrEmpty(paramsMap.get("sku"))) {
|
| | | return paramsMap.get("sku");
|
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(paramsMap.get("wareId"))) {
|
| | | return paramsMap.get("wareId");
|
| | | }
|
| | |
|
| | | // 判断纯数字大于4位的返回
|
| | | for (Iterator<String> its = paramsMap.keySet().iterator(); its.hasNext();) {
|
| | | String key = its.next();
|
| | | String value = paramsMap.get(key);
|
| | | if (NumberUtil.isNumeric(value) && value.length() >= 4) {
|
| | | return value;
|
| | | }
|
| | | }
|
| | | String id = JDUtil.getJDGoodsId(realLink);
|
| | | if (!StringUtil.isNullOrEmpty(id)) {
|
| | | return id;
|
| | | }
|
| | | LogHelper.error("京东短接解析失败:" + url);
|
| | | return null;
|
| | | }
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | LogHelper.errorDetailInfo(e, "京东短链获取商品ID失败:", url);
|
| | | }
|
| | | return null;
|
| | | }
|
| | | |
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 查询天猫商品图片、标题
|
| | | *
|
| | |
| | | }
|
| | | return getShowCouponInfo(goods.getCouponInfoList(), price);
|
| | | }
|
| | | |
| | | |
| | | |
| | | |
| | |
|
| | | }
|
| | |
| | | try {// 邀请奖励
|
| | | redPackWinInviteService.inviteSucceedReward(orderMQMsg.getUid());
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | LogHelper.errorDetailInfo(e);
|
| | | return Action.ReconsumeLater;
|
| | | }
|
| | | }
|
| | | return Action.CommitMessage;
|
| | |
| | | UserInviteMQMsg.class);
|
| | | inviteSucceedReward = true;
|
| | | uid = userInviteMQMsg.getWorkerId();
|
| | | |
| | | redPackWinInviteService.initCreateRedPackWin(userInviteMQMsg.getBossId(),userInviteMQMsg.getWorkerId());
|
| | | |
| | |
|
| | | redPackWinInviteService.initCreateRedPackWin(userInviteMQMsg.getBossId(),
|
| | | userInviteMQMsg.getWorkerId());
|
| | |
|
| | | } else if (tag.equalsIgnoreCase(UserTopicTagEnum.redPackGiftDrawback.name())) {// 红包赠送
|
| | | UserRedPackGiftMQMsg userRedPackGiftMQMsg = new Gson().fromJson(new String(message.getBody()),
|
| | | UserRedPackGiftMQMsg.class);
|
| | |
| | | } catch (IOException e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | if (doc == null)
|
| | | return new ArrayList<>();
|
| | | Elements els = doc.getElementsByTag("script");
|
| | | for (int i = 0; i < els.size(); i++) {
|
| | | String content = els.get(i).html();
|
| | |
| | | ScriptEngineManager manager = new ScriptEngineManager();
|
| | | ScriptEngine engine = manager.getEngineByName("javascript");
|
| | | try {
|
| | | String js = "function getData(){return JSON.stringify(dataDef);} var test1='--';function test2(res){};" + content.replace("$(window).load", "test2").replace("window.location.search.", "test1.");
|
| | | String js = "function getData(){return JSON.stringify(dataDef);} var test1='--';function test2(res){};"
|
| | | + content.replace("$(window).load", "test2").replace("window.location.search.", "test1.");
|
| | | engine.eval(js);
|
| | | if (engine instanceof Invocable) {
|
| | | Invocable in = (Invocable) engine;
|
| | |
| | |
|
| | | List<DingDongTime> list = new ArrayList<>();
|
| | |
|
| | | //获取当前时间之前的5个数据
|
| | | // 获取当前时间之前的5个数据
|
| | | for (int i = 5; i >= 0; i--) {
|
| | | int p = pos - i < 0 ? (times.length + pos - i) : pos - i;
|
| | | DingDongTime itemData = new DingDongTime(times[p].getKey(), times[p].getValue(),-1);
|
| | | DingDongTime itemData = new DingDongTime(times[p].getKey(), times[p].getValue(), -1);
|
| | | if (pos - i < 0)
|
| | | itemData.setTime(
|
| | | preDay + "" + (itemData.getKey().length() < 2 ? ("0" + itemData.getKey()) : itemData.getKey()));
|
| | | else
|
| | | itemData.setTime(
|
| | | nowDay + "" + (itemData.getKey().length() < 2 ? ("0" + itemData.getKey()) : itemData.getKey()));
|
| | | |
| | | if(pos==p)
|
| | |
|
| | | if (pos == p)
|
| | | itemData.setState(0);
|
| | | list.add(itemData);
|
| | | }
|
| | |
|
| | | //向后添加剩下的
|
| | | // 向后添加剩下的
|
| | | if (pos + 1 < times.length)
|
| | | for (int i = pos + 1; i < times.length; i++) {
|
| | | DingDongTime itemData = new DingDongTime(times[i].getKey(), times[i].getValue(),1);
|
| | | DingDongTime itemData = new DingDongTime(times[i].getKey(), times[i].getValue(), 1);
|
| | | itemData.setTime(
|
| | | nowDay + "" + (itemData.getKey().length() < 2 ? ("0" + itemData.getKey()) : itemData.getKey()));
|
| | | list.add(itemData);
|
| | | }
|
| | |
|
| | | if (times.length - (pos + 1) < 2) {
|
| | | DingDongTime itemData = new DingDongTime(times[0].getKey(), times[0].getValue(),1);
|
| | | DingDongTime itemData = new DingDongTime(times[0].getKey(), times[0].getValue(), 1);
|
| | | itemData.setTime(
|
| | | nextDay + "" + (itemData.getKey().length() < 2 ? ("0" + itemData.getKey()) : itemData.getKey()));
|
| | | list.add(itemData);
|
| | |
| | | Matcher m = r.matcher(str);
|
| | | while (m.find()) {
|
| | | String group = m.group(0);
|
| | | if (!StringUtil.isNullOrEmpty(group))
|
| | | if (!StringUtil.isNullOrEmpty(group) && group.length() >= 10)
|
| | | return group;
|
| | | }
|
| | | return null;
|
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?>
|
| | | <beans xmlns="http://www.springframework.org/schema/beans"
|
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
|
| | | xsi:schemaLocation="http://www.springframework.org/schema/beans
|
| | | http://www.springframework.org/schema/beans/spring-beans.xsd
|
| | | http://www.springframework.org/schema/context
|
| | | http://www.springframework.org/schema/context/spring-context.xsd">
|
| | |
|
| | | <!-- 不执行任务 -->
|
| | |
|
| | |
|
| | | </beans> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?>
|
| | | <beans xmlns="http://www.springframework.org/schema/beans"
|
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
|
| | | xsi:schemaLocation="http://www.springframework.org/schema/beans
|
| | | http://www.springframework.org/schema/beans/spring-beans.xsd
|
| | | http://www.springframework.org/schema/context
|
| | | http://www.springframework.org/schema/context/spring-context.xsd">
|
| | |
|
| | | <!-- 不执行任务 -->
|
| | |
|
| | |
|
| | | </beans> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?>
|
| | | <beans xmlns="http://www.springframework.org/schema/beans"
|
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
| | | xmlns:context="http://www.springframework.org/schema/context"
|
| | | xsi:schemaLocation="http://www.springframework.org/schema/beans
|
| | | http://www.springframework.org/schema/beans/spring-beans.xsd
|
| | | http://www.springframework.org/schema/context
|
| | | http://www.springframework.org/schema/context/spring-context.xsd">
|
| | |
|
| | | <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
| | | <property name="fileEncoding" value="utf-8" />
|
| | | <property name="locations">
|
| | | <list>
|
| | | <value>classpath*:xxl-job-executor.properties</value>
|
| | | </list>
|
| | | </property>
|
| | | </bean>
|
| | |
|
| | | <!-- ********************************* 基础配置 ********************************* -->
|
| | |
|
| | | <!-- 配置01、JobHandler 扫描路径 -->
|
| | | <context:component-scan base-package="com.yeshi.fanli.job" />
|
| | |
|
| | | <!-- 配置02、执行器 -->
|
| | | <bean id="xxlJobSpringExecutor" class="com.xxl.job.core.executor.impl.XxlJobSpringExecutor" >
|
| | | <!-- 执行器注册中心地址[选填],为空则关闭自动注册 -->
|
| | | <property name="adminAddresses" value="${xxl.job.admin.addresses}" />
|
| | | <!-- 执行器AppName[选填],为空则关闭自动注册 -->
|
| | | <property name="appName" value="${xxl.job.executor.appname}" />
|
| | | <!-- 执行器IP[选填],为空则自动获取 -->
|
| | | <property name="ip" value="${xxl.job.executor.ip}" />
|
| | | <!-- 执行器端口号[选填],小于等于0则自动获取 -->
|
| | | <property name="port" value="${xxl.job.executor.port}" />
|
| | | <!-- 访问令牌[选填],非空则进行匹配校验 -->
|
| | | <property name="accessToken" value="${xxl.job.accessToken}" />
|
| | | <!-- 执行器日志路径[选填],为空则使用默认路径 -->
|
| | | <property name="logPath" value="${xxl.job.executor.logpath}" />
|
| | | <!-- 日志保存天数[选填],值大于3时生效 -->
|
| | | <property name="logRetentionDays" value="${xxl.job.executor.logretentiondays}" />
|
| | | </bean>
|
| | |
|
| | |
|
| | | </beans> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?>
|
| | | <beans xmlns="http://www.springframework.org/schema/beans"
|
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
|
| | | xsi:schemaLocation="http://www.springframework.org/schema/beans
|
| | | http://www.springframework.org/schema/beans/spring-beans.xsd
|
| | | http://www.springframework.org/schema/context
|
| | | http://www.springframework.org/schema/context/spring-context.xsd">
|
| | |
|
| | | <!-- 不执行任务 -->
|
| | |
|
| | |
|
| | | </beans> |
| | |
| | | log4j.appender.vipInfoLog.layout=org.apache.log4j.PatternLayout
|
| | | log4j.appender.vipInfoLog.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} [%c]-[%p] %m%n
|
| | |
|
| | | log4j.logger.userProtocolListenLog=info,userProtocolListenLog
|
| | | log4j.appender.userProtocolListenLog=org.apache.log4j.DailyRollingFileAppender
|
| | | log4j.appender.userProtocolListenLog.File=logs/user/userProtocolListenLog.log
|
| | | log4j.appender.userProtocolListenLog.MaxFileSize=20MB
|
| | | log4j.appender.userProtocolListenLog.MaxBackupIndex=100
|
| | | log4j.appender.userProtocolListenLog.layout=org.apache.log4j.PatternLayout
|
| | | log4j.appender.userProtocolListenLog.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} [%c]-[%p] %m%n |
| | |
|
| | | log4j.appender.mongodb=org.apache.log4j.ConsoleAppender
|
| | | log4j.appender.mongodb.Target=System.out
|
| | | log4j.appender.mongodb.Threshold=DEBUG
|
| | |
| | | <value>classpath:druid.properties</value>
|
| | | <value>classpath:mongo.properties</value>
|
| | | <value>classpath:rocketmq.properties</value>
|
| | | <value>classpath:xxl-job-executor.properties</value>
|
| | | </array>
|
| | | </property>
|
| | | </bean>
|
| | |
|
| | | <import resource="classpath:rocketmq.xml" />
|
| | | <import resource="classpath:xxl-job.xml" />
|
| | | |
| | | |
| | |
|
| | | <!--异步定义推荐方式 <task:executor id="executor" pool-size="15" /> <task:scheduler
|
| | | id="scheduler" pool-size="30" /> <task:annotation-driven executor="executor"
|
New file |
| | |
| | | ### 调度中心部署跟地址 [选填]:如调度中心集群部署存在多个地址则用逗号分隔。执行器将会使用该地址进行"执行器心跳注册"和"任务结果回调";为空则关闭自动注册;
|
| | | xxl.job.admin.addresses=http://111.231.250.166:8080/xxl-job-admin
|
| | | ### 执行器AppName [选填]:执行器心跳注册分组依据;为空则关闭自动注册
|
| | | xxl.job.executor.appname=pro-job
|
| | | ### 执行器IP [选填]:默认为空表示自动获取IP,多网卡时可手动设置指定IP,该IP不会绑定Host仅作为通讯实用;地址信息用于 "执行器注册" 和 "调度中心请求并触发任务";
|
| | | xxl.job.executor.ip=
|
| | | ### 执行器端口号 [选填]:小于等于0则自动获取;默认端口为9999,单机部署多个执行器时,注意要配置不同执行器端口;
|
| | | xxl.job.executor.port=9999
|
| | | ### 执行器通讯TOKEN [选填]:非空时启用;
|
| | | xxl.job.accessToken=BLKS-XXL-666666@
|
| | | ### 执行器运行日志文件存储磁盘路径 [选填] :需要对该路径拥有读写权限;为空则使用默认路径;
|
| | | xxl.job.executor.logpath=
|
| | | ### 执行器日志文件保存天数 [选填] : 过期日志自动清理, 限制值大于等于3时生效; 否则, 如-1, 关闭自动清理功能;
|
| | | xxl.job.executor.logretentiondays=30 |
| | |
| | | <dependency>
|
| | | <groupId>com.xuxueli</groupId>
|
| | | <artifactId>xxl-job-core</artifactId>
|
| | | <version>2.1.0</version>
|
| | | <version>2.1.2</version>
|
| | | </dependency>
|
| | |
|
| | | <dependency>
|