| | |
| | | import javax.servlet.http.HttpSession; |
| | | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.entity.config.SystemConfigKeyEnum; |
| | | import com.yeshi.fanli.util.wx.MyWXLoginUtil; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | |
| | | * 客户端网页接口与微信网页接口 |
| | | * |
| | | * @author Administrator |
| | | * |
| | | */ |
| | | |
| | | @Controller |
| | | @RequestMapping("/client") |
| | | public class ClientJspController { |
| | | |
| | | @Resource |
| | | private GoodsSecondClassService goodsSecondClassService; |
| | | |
| | | @Resource |
| | | private ConfigService configService; |
| | | |
| | | @Resource |
| | | private HongBaoManageService hongBaoManageService; |
| | | |
| | | @Resource |
| | | private ShamUserService shamUserService; |
| | | |
| | | @Resource |
| | | private TaoBaoCouponService taoBaoCouponService; |
| | | |
| | | @Resource |
| | | private ThreeSaleSerivce threeSaleSerivce; |
| | | |
| | | @Resource |
| | | private UserInfoService userInfoService; |
| | | |
| | | @Resource |
| | | private BusinessSystemService businessSystemService; |
| | | |
| | | @Resource |
| | | private SystemConfigService systemConfigService; |
| | | |
| | | @Resource |
| | | private SystemClientParamsService systemClientParamsService; |
| | |
| | | @Resource |
| | | private ShareGoodsService shareGoodsService; |
| | | |
| | | @Resource |
| | | private TaoBaoGoodsBriefService taoBaoGoodsBriefService; |
| | | |
| | | @Resource |
| | | private UserInviteRecordService userInviteRecordService; |
| | |
| | | @Resource |
| | | private RedisManager redisManager; |
| | | |
| | | @Resource |
| | | private TaoBaoUnionConfigService taoBaoUnionConfigService; |
| | | |
| | | @Resource |
| | | private CustomerNameService customerNameService; |
| | |
| | | @Resource |
| | | private CustomerContentService customerContentService; |
| | | |
| | | private static final String DOWNURL = "http://sj.qq.com/myapp/detail.htm?apkName=" |
| | | + Constant.systemCommonConfig.getAndroidPackageName(); |
| | | @Resource |
| | | private SystemConfigService systemConfigService; |
| | | |
| | | private static final String DOWNURL2 = "http://121.42.200.138/apk/fanliquan20180124.apk"; |
| | | |
| | |
| | | } |
| | | String redirect_uri = "http://" + Constant.wxGZConfig.getLoginHost() + "/" |
| | | + Constant.systemCommonConfig.getProjectName() + "/client/new/" + uid + "?packages=" |
| | | + Constant.systemCommonConfig.getAndroidPackageName() + "&platform=ANDROID&" + ios; |
| | | + systemConfigService.getValueCache(SystemConfigKeyEnum.androidPackageNames, userInfo.getSystem()) + "&platform=ANDROID&" + ios; |
| | | redirect_uri = URLEncoder.encode(redirect_uri, "utf-8"); |
| | | |
| | | long currentTimeMillis = java.lang.System.currentTimeMillis(); |
| | | String md5 = StringUtil.Md5(currentTimeMillis + ""); |
| | | session.setAttribute("wxState", md5); |
| | | String baseUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + MyWXLoginUtil.WEXIN_APPID |
| | | String baseUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + systemConfigService.getValueCache(SystemConfigKeyEnum.wxGZAppId, userInfo.getSystem()) |
| | | + "&redirect_uri=" + redirect_uri + "&response_type=code&scope=snsapi_userinfo&state=" + md5 |
| | | + "#wechat_redirect"; |
| | | response.sendRedirect(baseUrl); |
| | |
| | | public void pushOppo(String registerId, PrintWriter out) { |
| | | List<String> registerIds = new ArrayList<>(); |
| | | registerIds.add(registerId); |
| | | String androidBaseActivity=""; |
| | | try { |
| | | OPPOPushUtil.pushUrl(registerIds, "测试网页推送", "测试网页推送内容", "http://www.baidu.com"); |
| | | OPPOPushUtil.pushUrl(registerIds, "测试网页推送", "测试网页推送内容", "http://www.baidu.com",androidBaseActivity); |
| | | } catch (PushException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | try { |
| | | OPPOPushUtil.pushGoods(registerIds, "测试商品网页推送", "测试商品推送内容", 1, 577628549116L); |
| | | OPPOPushUtil.pushGoods(registerIds, "测试商品网页推送", "测试商品推送内容", 1, 577628549116L,androidBaseActivity); |
| | | } catch (PushException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | try { |
| | | OPPOPushUtil.pushUserSignInNotification(registerIds, "测试签到推送", "测试签到推送"); |
| | | OPPOPushUtil.pushUserSignInNotification(registerIds, "测试签到推送", "测试签到推送",androidBaseActivity); |
| | | } catch (PushException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | try { |
| | | OPPOPushUtil.pushWelfareCenter(registerIds, "测试福利中心推送", "测试福利中心推送"); |
| | | OPPOPushUtil.pushWelfareCenter(registerIds, "测试福利中心推送", "测试福利中心推送",androidBaseActivity); |
| | | } catch (PushException e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | @Resource |
| | | private PIDManager pidManager; |
| | | |
| | | |
| | | @RequestMapping(value = "getHonestList") |
| | | public void getHonestList(AcceptData acceptData, PrintWriter out) { |
| | | List<Honest> honestList = null; |
| | |
| | | honestList = new ArrayList<>(); |
| | | JumpDetail detail = new JumpDetail(); |
| | | detail.setActivity(String.format("%s.ui.invite.ShareBrowserActivity", |
| | | Constant.systemCommonConfig.getAndroidBaseactivityName())); |
| | | systemConfigService.getValueCache(SystemConfigKeyEnum.androidBaseActivityName,acceptData.getSystem()))); |
| | | detail.setName("网页"); |
| | | detail.setController("ShonpingShareViewController"); |
| | | |
| | |
| | | honestList = new ArrayList<>(); |
| | | JumpDetail detail = new JumpDetail(); |
| | | detail.setActivity( |
| | | String.format("%s.ui.BrowserActivity", Constant.systemCommonConfig.getAndroidBaseactivityName())); |
| | | String.format("%s.ui.BrowserActivity", systemConfigService.getValueCache(SystemConfigKeyEnum.androidBaseActivityName,acceptData.getSystem()))); |
| | | detail.setName("网页"); |
| | | // GoodsDetailController |
| | | detail.setController("BrowserController"); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 设备是否允许一键登录 |
| | | * |
| | | * @param acceptData |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "allowOneKeyLogin", method = RequestMethod.POST) |
| | | public void allowOneKeyLogin(AcceptData acceptData, PrintWriter out) { |
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.oneKeyLoginCount, StringUtil.Md5(StringUtil.isNullOrEmpty(acceptData.getUtdid()) ? acceptData.getDevice() : acceptData.getUtdid())); |
| | | //每天只能用10次 |
| | | String value = redisManager.getCommonString(key); |
| | | if (!StringUtil.isNullOrEmpty(value) && Integer.parseInt(value) >= 10) { |
| | | out.print(JsonUtil.loadFalseResult("一键登录每日只能用10次")); |
| | | return; |
| | | } |
| | | out.print(JsonUtil.loadTrueResult("")); |
| | | } |
| | | |
| | | } |
| | |
| | | list.add(ssp); |
| | | } |
| | | |
| | | |
| | | SystemClientParams ssp = new SystemClientParams(); |
| | | ssp.setKey(ConfigKeyEnum.homePageBgColors.getKey()); |
| | | ssp.setValue(configService.getValue(ConfigKeyEnum.homePageBgColors,acceptData.getSystem())); |
| | | list.add(ssp); |
| | | |
| | | |
| | | |
| | | Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create(); |
| | | JSONObject data = new JSONObject(); |
| | | data.put("count", list.size()); |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.yeshi.utils.JsonUtil; |
| | | import org.yeshi.utils.TimeUtil; |
| | | import org.yeshi.utils.encrypt.DESUtil; |
| | | import org.yeshi.utils.entity.ProxyIP; |
| | | import org.yeshi.utils.entity.wx.WeiXinUser; |
| | |
| | | return; |
| | | } |
| | | |
| | | if (!StringUtil.isNullOrEmpty(aliAccessToken)) { |
| | | long now = System.currentTimeMillis(); |
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.oneKeyLoginCount,StringUtil.Md5( StringUtil.isNullOrEmpty(acceptData.getUtdid()) ? acceptData.getDevice() : acceptData.getUtdid())); |
| | | redisManager.increase(key); |
| | | int expire = (int) ((TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(now + 1000 * 60 * 60 * 24L, "yyyyMMdd"), "yyyyMMdd") - now) / 1000); |
| | | redisManager.expire(key, expire); |
| | | } |
| | | |
| | | try { |
| | | BusinessSystem system = getSystem(acceptData); |
| | | if (system == null) { |
| | |
| | | out.print(JsonUtil.loadFalseResult("系统不存在")); |
| | | return; |
| | | } |
| | | |
| | | if (!StringUtil.isNullOrEmpty(aliAccessToken)) { |
| | | long now = System.currentTimeMillis(); |
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.oneKeyLoginCount,StringUtil.Md5( StringUtil.isNullOrEmpty(acceptData.getUtdid()) ? acceptData.getDevice() : acceptData.getUtdid())); |
| | | redisManager.increase(key); |
| | | int expire = (int) ((TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(now + 1000 * 60 * 60 * 24L, "yyyyMMdd"), "yyyyMMdd") - now) / 1000); |
| | | redisManager.expire(key, expire); |
| | | } |
| | | |
| | | String mobile = null; |
| | | try { |
| | | mobile = userAccountService.getMobile(vcode, phone, aliAccessToken, acceptData.getSystem(), SMSHistory.TYPE_BIND); |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.fanli.lijin.manager.GoodsLijinMnager; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | * 通用模板 |
| | | * |
| | | * @author Administrator |
| | | * |
| | | */ |
| | | @Controller |
| | | @RequestMapping("api/v2/commoncontent") |
| | |
| | | |
| | | @Resource |
| | | private PDDCommonTemplateContentService pddCommonTemplateContentService; |
| | | |
| | | @Resource |
| | | private GoodsLijinMnager goodsLijinMnager; |
| | | |
| | | /** |
| | | * 通用模板导航 |
| | |
| | | * 获取内容 |
| | | * |
| | | * @param acceptData |
| | | * @param uid |
| | | * @param key |
| | | * @param page-页码 |
| | | * @param navId-导航ID |
| | | * @param type |
| | | * @param page |
| | | * @param cid |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getNavGoodsList", method = RequestMethod.POST) |
| | | public void getNavContent(AcceptData acceptData, String key, Integer type, Integer page, String cid, |
| | | public void getNavContent(AcceptData acceptData, Long uid, String key, Integer type, Integer page, String cid, |
| | | PrintWriter out) { |
| | | if (StringUtil.isNullOrEmpty(key)) { |
| | | out.print(JsonUtil.loadFalseResult(1, "请传入Key")); |
| | |
| | | } |
| | | |
| | | if (type == null || type == Constant.SOURCE_TYPE_TAOBAO) { |
| | | getListTB(acceptData, key, page, cid, out); |
| | | getListTB(acceptData, uid, key, page, cid, out); |
| | | return; |
| | | } |
| | | |
| | | if (type == Constant.SOURCE_TYPE_JD) { |
| | | getListJD(acceptData, key, page, cid, out); |
| | | getListJD(acceptData, uid, key, page, cid, out); |
| | | return; |
| | | } |
| | | |
| | | if (type == Constant.SOURCE_TYPE_PDD) { |
| | | getListPDD(acceptData, key, page, cid, out); |
| | | getListPDD(acceptData, uid, key, page, cid, out); |
| | | return; |
| | | } |
| | | out.print(JsonUtil.loadFalseResult("goodsType参数不正确")); |
| | | } |
| | | |
| | | private void getListTB(AcceptData acceptData, String key, Integer page, String cid, PrintWriter out) { |
| | | private void getListTB(AcceptData acceptData, Long uid, String key, Integer page, String cid, PrintWriter out) { |
| | | CommonContentResult result = null; |
| | | CommonContentTypeEnum type = CommonContentTypeEnum.valueOf(key); |
| | | if (type == CommonContentTypeEnum.guessLikeDevice) { |
| | |
| | | |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : goodsList) { |
| | | GoodsDetailVO vo = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO); |
| | | |
| | | List<GoodsDetailVO> goodsDetailVOList = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, goodsList, paramsDTO); |
| | | int p = 0; |
| | | for (GoodsDetailVO vo : goodsDetailVOList) { |
| | | if (type == CommonContentTypeEnum.mianDan)// 免单商品 |
| | | { |
| | | vo.getMoneyInfo().setFanliMoney("¥" + TaoBaoUtil.getCouponPrice(taoBaoGoodsBrief)); |
| | | vo.getMoneyInfo().setShareMoney("¥" + TaoBaoUtil.getCouponPrice(taoBaoGoodsBrief)); |
| | | vo.getMoneyInfo().setFanliMoney("¥" + TaoBaoUtil.getCouponPrice(goodsList.get(p))); |
| | | vo.getMoneyInfo().setShareMoney("¥" + TaoBaoUtil.getCouponPrice(goodsList.get(p))); |
| | | vo.getMoneyInfo().setMaxMoney(null); |
| | | } |
| | | array.add(gson.toJson(vo)); |
| | | p++; |
| | | } |
| | | |
| | | root.put("list", array); |
| | |
| | | * @param cid |
| | | * @param out |
| | | */ |
| | | public void getListJD(AcceptData acceptData, String key, Integer page, String cid, PrintWriter out) { |
| | | public void getListJD(AcceptData acceptData, Long uid, String key, Integer page, String cid, PrintWriter out) { |
| | | JSONObject data = new JSONObject(); |
| | | if (page == 1) { |
| | | List<SwiperPicture> bannerList = new ArrayList<>(); |
| | |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | |
| | | for (JDGoods goods : goodsList) { |
| | | array.add(gson.toJson(GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO))); |
| | | List<GoodsDetailVO> voList = goodsLijinMnager.loadOtherMoneyInfo(acceptData.getSystem(), uid, goodsList, paramsDTO); |
| | | for (GoodsDetailVO goods : voList) { |
| | | array.add(gson.toJson(goods)); |
| | | } |
| | | } |
| | | } |
| | |
| | | * @param cid |
| | | * @param out |
| | | */ |
| | | public void getListPDD(AcceptData acceptData, String key, Integer page, String cid, PrintWriter out) { |
| | | public void getListPDD(AcceptData acceptData, Long uid, String key, Integer page, String cid, PrintWriter out) { |
| | | JSONObject data = new JSONObject(); |
| | | if (page == 1) { |
| | | // 2、顶部轮播图 |
| | |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | |
| | | for (PDDGoodsDetail goods : goodsList) { |
| | | array.add(gson.toJson(GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO))); |
| | | List<GoodsDetailVO> voList = goodsLijinMnager.loadOtherMoneyInfo(acceptData.getSystem(), uid, goodsList, paramsDTO); |
| | | for (GoodsDetailVO goods : voList) { |
| | | array.add(gson.toJson(goods)); |
| | | } |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 猜你喜欢-淘宝设备推荐 |
| | | * |
| | | * @param acceptData |
| | | * @param idfa |
| | | * @param imei |
| | | * @param utdid |
| | | * @param page |
| | | * @return |
| | | */ |
| | | @Cacheable(value = "commonContentCache", key = "#idfa+'-'+#imei+'-'+#page") |
| | | private CommonContentResult guessLikeDeviceTB(String idfa, String imei, String utdid, Integer page) { |
| | | TaoBaoSearchResult searchResult = TaoKeApiUtil.guessDeviceLike(page, Constant.PAGE_SIZE, imei, idfa, utdid); |
| | | if (searchResult != null && searchResult.getTaoBaoGoodsBriefs() != null |
| | |
| | | switch (loginType) { |
| | | //电话号码登录 |
| | | case 1: { |
| | | if (!StringUtil.isNullOrEmpty(aliAccessToken)) { |
| | | long now = System.currentTimeMillis(); |
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.oneKeyLoginCount,StringUtil.Md5( StringUtil.isNullOrEmpty(acceptData.getUtdid()) ? acceptData.getDevice() : acceptData.getUtdid()));; |
| | | redisManager.increase(key); |
| | | int expire = (int) ((TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(now + 1000 * 60 * 60 * 24L, "yyyyMMdd"), "yyyyMMdd") - now) / 1000); |
| | | redisManager.expire(key, expire); |
| | | } |
| | | userInfo = userAccountService.loginPhone(new ProxyIP(request.getRemoteHost(), request.getRemotePort()), loginType, vcode, phone, aliAccessToken, system); |
| | | } |
| | | break; |
| | |
| | | return; |
| | | } |
| | | |
| | | if (!StringUtil.isNullOrEmpty(aliAccessToken)) { |
| | | long now = System.currentTimeMillis(); |
| | | String redisKey = RedisKeyEnum.getRedisKey(RedisKeyEnum.oneKeyLoginCount,StringUtil.Md5( StringUtil.isNullOrEmpty(acceptData.getUtdid()) ? acceptData.getDevice() : acceptData.getUtdid()));; |
| | | redisManager.increase(redisKey); |
| | | int expire = (int) ((TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(now + 1000 * 60 * 60 * 24L, "yyyyMMdd"), "yyyyMMdd") - now) / 1000); |
| | | redisManager.expire(redisKey, expire); |
| | | } |
| | | |
| | | String mobile = null; |
| | | try { |
| | | mobile = userAccountService.getMobile(vcode, phone, aliAccessToken, acceptData.getSystem(), SMSHistory.TYPE_BIND); |
| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.fanli.entity.SystemPIDInfo; |
| | | import com.yeshi.fanli.entity.config.SystemConfigKeyEnum; |
| | | import com.yeshi.fanli.service.manger.PIDManager; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | public void getRecommendBanner(AcceptData acceptData, String callback, PrintWriter out) { |
| | | |
| | | BusinessSystem system = businessSystemService.getBusinessSystem("WEB", |
| | | Constant.systemCommonConfig.getH5PackageName(), acceptData.getSystem()); |
| | | systemConfigService.getValueCache(SystemConfigKeyEnum.h5PackageName,acceptData.getSystem()), acceptData.getSystem()); |
| | | JSONObject json = new JSONObject(); |
| | | if (system == null) { |
| | | out.print(JsonUtil.loadFalseResult(1, H5ControllerUtil.NOSYSTEM)); |
| | |
| | | private TaoBaoUnionConfigService taoBaoUnionConfigService; |
| | | |
| | | /** |
| | | * |
| | | * 方法说明: 推荐轮播商品信息 |
| | | * |
| | | * @author mawurui createTime 2018年5月11日 上午11:13:47 |
| | | * @param acceptData |
| | | * @param out |
| | | * @author mawurui createTime 2018年5月11日 上午11:13:47 |
| | | */ |
| | | @RequestMapping(value = "getRecommenBanner", method = RequestMethod.GET) |
| | | public void getRecommendBanner(AcceptData acceptData, String callback, PrintWriter out) { |
| | | |
| | | BusinessSystem system = businessSystemService.getBusinessSystem("WEB", |
| | | Constant.systemCommonConfig.getH5PackageName(),acceptData.getSystem()); |
| | | systemConfigService.getValueCache(SystemConfigKeyEnum.h5PackageName, acceptData.getSystem()), acceptData.getSystem()); |
| | | JSONObject json = new JSONObject(); |
| | | if (system == null) { |
| | | out.print(JsonUtil.loadFalseResult(1, WebControllerUtil.NOSYSTEM)); |
| | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * 方法说明: 获取商品详情 |
| | | * |
| | | * @author mawurui createTime 2018年5月11日 上午11:37:02 |
| | | * @param acceptData |
| | | * @param id |
| | | * @param uid |
| | | * @param out |
| | | * @author mawurui createTime 2018年5月11日 上午11:37:02 |
| | | */ |
| | | |
| | | @RequestMapping(value = "getGoodsDetail", method = RequestMethod.GET) |
| | |
| | | package com.yeshi.fanli.dto.push; |
| | | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | |
| | | //推送内容 |
| | | public class PushContentDetailDTO { |
| | | private PushTypeEnum type; |
| | |
| | | public void setContent(PushBaseContent content) { |
| | | this.content = content; |
| | | } |
| | | |
| | | } |
| | |
| | | SystemFunction.bindPhone, SystemFunction.threeSale, SystemFunction.cloudOrder, SystemFunction.godenCorn, SystemFunction.redPack,SystemFunction.faQuan,SystemFunction.fanli,SystemFunction.vip,SystemFunction.inviteCode |
| | | }, 1, "板栗快省","板栗快省"), |
| | | flq("com.fanliunion.android", "com.xyj.ec.flq-ios", new String[]{}, new SystemFunction[]{SystemFunction.faQuan,SystemFunction.fanli}, 11, "返利联盟","淘拼团"), |
| | | yhqjx("com.youhuiquan.android","com.youhuiquanjx.ios",new String[]{}, new SystemFunction[]{SystemFunction.faQuan,SystemFunction.fanli,SystemFunction.lijinSub,SystemFunction.bindPhone}, 12, "优惠券精选","淘拼团"); |
| | | yhqjx("com.youhuiquan.android","com.youhuiquanjx.ios",new String[]{}, new SystemFunction[]{SystemFunction.faQuan,SystemFunction.fanli,SystemFunction.lijinSub,SystemFunction.bindPhone}, 12, "优惠券精选","特价App"); |
| | | private String packageName; |
| | | private String bundleId; |
| | | private int systemId; |
| | |
| | | @Column(name = "b_sub_picture") |
| | | private String subPicture; |
| | | |
| | | //背景颜色 |
| | | @Expose |
| | | @Column(name = "b_bg_color") |
| | | private String bgColor; |
| | | |
| | | // 跳转详情 |
| | | @Expose |
| | | @Column(name = "b_jumpid") |
| | |
| | | this.timeTask = timeTask; |
| | | } |
| | | |
| | | |
| | | public String getBgColor() { |
| | | return bgColor; |
| | | } |
| | | |
| | | public void setBgColor(String bgColor) { |
| | | this.bgColor = bgColor; |
| | | } |
| | | } |
| | |
| | | // 项目域名 |
| | | @Map("project_host") |
| | | private String projectHost; |
| | | @Map("default_nick_name") |
| | | private String defaultNickName; |
| | | @Map("default_portrait") |
| | | private String defaultPortrait; |
| | | |
| | | // 公众平台appid |
| | | @Map("wxgz_appid") |
| | | private String wxGZAppId; |
| | | // 公众平台Appsecret |
| | | @Map("wxgz_appsecret") |
| | | private String wxGZAppSecret; |
| | | |
| | | // 开放平台appId |
| | | @Map("wx_open_appid") |
| | | private String wxOpenAppId; |
| | | // 开放平台appSecret |
| | | @Map("wx_open_appsecret") |
| | | private String wxOpenAppSecret; |
| | | // 默认的提成订单图片 |
| | | @Map("default_order_picture") |
| | | private String defaultOrderPicture; |
| | | |
| | | @Map("android_package_name") |
| | | private String androidPackageName; |
| | | |
| | | @Map("ios_bundle_id") |
| | | private String iosBundleId; |
| | | |
| | | @Map("h5_package_name") |
| | | private String h5PackageName; |
| | | |
| | | @Map("sign_key") |
| | | private String signKey; |
| | | |
| | | @Map("android_baseactivity_name") |
| | | private String androidBaseactivityName; |
| | | |
| | | @Map("share_goods_page_path") |
| | | private String shareGoodsPagePath; |
| | |
| | | @Map("base_user_rank_icon_url") |
| | | private String baseUserRankIconUrl; |
| | | |
| | | @Map("ios_push_certificate_pwd") |
| | | private String iosPushCertificatePwd; |
| | | |
| | | @Map("extract_notify_url") |
| | | private String extractNotifyUrl; |
| | |
| | | |
| | | public void setExtractNotifyUrl(String extractNotifyUrl) { |
| | | this.extractNotifyUrl = extractNotifyUrl; |
| | | } |
| | | |
| | | public String getIosPushCertificatePwd() { |
| | | return iosPushCertificatePwd; |
| | | } |
| | | |
| | | public void setIosPushCertificatePwd(String iosPushCertificatePwd) { |
| | | this.iosPushCertificatePwd = iosPushCertificatePwd; |
| | | } |
| | | |
| | | public String getBaseUserRankIconUrl() { |
| | |
| | | this.shareGoodsPagePath = shareGoodsPagePath; |
| | | } |
| | | |
| | | public String getAndroidBaseactivityName() { |
| | | return androidBaseactivityName; |
| | | } |
| | | |
| | | public void setAndroidBaseactivityName(String androidBaseactivityName) { |
| | | this.androidBaseactivityName = androidBaseactivityName; |
| | | } |
| | | |
| | | public String getSignKey() { |
| | | return signKey; |
| | |
| | | this.projectChineseName = projectChineseName; |
| | | } |
| | | |
| | | public String getH5PackageName() { |
| | | return h5PackageName; |
| | | } |
| | | |
| | | public void setH5PackageName(String h5PackageName) { |
| | | this.h5PackageName = h5PackageName; |
| | | } |
| | | |
| | | public String getAndroidPackageName() { |
| | | return androidPackageName; |
| | | } |
| | | |
| | | public void setAndroidPackageName(String androidPackageName) { |
| | | this.androidPackageName = androidPackageName; |
| | | } |
| | | |
| | | public String getIosBundleId() { |
| | | return iosBundleId; |
| | | } |
| | | |
| | | public void setIosBundleId(String iosBundleId) { |
| | | this.iosBundleId = iosBundleId; |
| | | } |
| | | |
| | | public String getDefaultOrderPicture() { |
| | | return defaultOrderPicture; |
| | | } |
| | | |
| | | public void setDefaultOrderPicture(String defaultOrderPicture) { |
| | | this.defaultOrderPicture = defaultOrderPicture; |
| | | } |
| | | |
| | | public String getWxGZAppId() { |
| | | return wxGZAppId; |
| | | } |
| | | |
| | | public void setWxGZAppId(String wxGZAppId) { |
| | | this.wxGZAppId = wxGZAppId; |
| | | } |
| | | |
| | | public String getWxGZAppSecret() { |
| | | return wxGZAppSecret; |
| | | } |
| | | |
| | | public void setWxGZAppSecret(String wxGZAppSecret) { |
| | | this.wxGZAppSecret = wxGZAppSecret; |
| | | } |
| | | |
| | | public String getWxOpenAppId() { |
| | | return wxOpenAppId; |
| | | } |
| | | |
| | | public void setWxOpenAppId(String wxOpenAppId) { |
| | | this.wxOpenAppId = wxOpenAppId; |
| | | } |
| | | |
| | | public String getWxOpenAppSecret() { |
| | | return wxOpenAppSecret; |
| | | } |
| | | |
| | | public void setWxOpenAppSecret(String wxOpenAppSecret) { |
| | | this.wxOpenAppSecret = wxOpenAppSecret; |
| | | } |
| | | |
| | | public String getProjectName() { |
| | |
| | | |
| | | public void setProjectHost(String projectHost) { |
| | | this.projectHost = projectHost; |
| | | } |
| | | |
| | | public String getDefaultNickName() { |
| | | return defaultNickName; |
| | | } |
| | | |
| | | public void setDefaultNickName(String defaultNickName) { |
| | | this.defaultNickName = defaultNickName; |
| | | } |
| | | |
| | | public String getDefaultPortrait() { |
| | | return defaultPortrait; |
| | | } |
| | | |
| | | public void setDefaultPortrait(String defaultPortrait) { |
| | | this.defaultPortrait = defaultPortrait; |
| | | } |
| | | |
| | | public String getShareGoodsPagePathJD() { |
| | |
| | | public enum SystemConfigKeyEnum { |
| | | appName("应用名称"), |
| | | wxAppId("微信开放平台的appId"), |
| | | androidPackageNames("Android包名"), |
| | | androidBaseActivityName("Android activity的基础路径"), |
| | | h5PackageName("网页的packageName"), |
| | | iosPushCertPwd("ios推送密码"), |
| | | iosBundleIds("IOS的BundleId"), |
| | | wxAppSecret("微信开放平台的appSecret"), |
| | | wxGZAppId("微信公众平台的appId"), |
| | | wxGZAppSecret("微信公众平台的appSecret"), |
| | | defaultNickNamePrefix("默认昵称前缀"), |
| | | defaultPortrait("默认头像") |
| | | ; |
| | | defaultPortrait("默认头像"); |
| | | |
| | | private String name; |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | private SystemConfigKeyEnum(String name) { |
| | | |
| | | this.name = name; |
| | | } |
| | | |
| | | |
| | |
| | | package com.yeshi.fanli.entity.push; |
| | | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | |
| | | import java.util.Date; |
| | | |
| | | |
| | |
| | | /* 结束时间 */ |
| | | @org.yeshi.utils.mybatis.Column(name = "qe_endtime") |
| | | private Date endtime; |
| | | |
| | | |
| | | @org.yeshi.utils.mybatis.Column(name = "qe_system") |
| | | private SystemEnum system; |
| | | |
| | | |
| | | public Long getId() { |
| | |
| | | this.versions = versions; |
| | | } |
| | | |
| | | public SystemEnum getSystem() { |
| | | return system; |
| | | } |
| | | |
| | | public void setSystem(SystemEnum system) { |
| | | this.system = system; |
| | | } |
| | | } |
| | |
| | | guanXuan("官宣任务"), |
| | | specialHelper("小助手"), |
| | | article("学院相关"), |
| | | extract("提现相关"); |
| | | extract("提现相关"), |
| | | homeUI("首页UI"); |
| | | |
| | | private final String desc; |
| | | |
| | |
| | | this.id = id; |
| | | } |
| | | |
| | | public SystemConfig(String key, String value, String name, SystemEnum system) { |
| | | this.key = key; |
| | | this.value = value; |
| | | this.name = name; |
| | | this.system = system; |
| | | } |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | |
| | | @Service |
| | | public class WXGZServiceImpl implements WXGZService { |
| | | @Override |
| | | public void initMenu() { |
| | | String appId = Constant.systemCommonConfig.getWxGZAppId(); |
| | | String appSecret = Constant.systemCommonConfig.getWxGZAppSecret(); |
| | | public void initMenu(String wxGZAppId,String wxGZAppsecret) { |
| | | String appId = wxGZAppId; |
| | | String appSecret = wxGZAppsecret; |
| | | String accessToken = WXUtil.getAcessToken(appId, appSecret); |
| | | JSONObject root = new JSONObject(); |
| | | JSONArray items = new JSONArray(); |
| | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.entity.bus.user.UserCustomSettings; |
| | | import com.yeshi.fanli.entity.bus.user.UserCustomSettings.UserSettingTypeEnum; |
| | | import com.yeshi.fanli.entity.config.SystemConfigKeyEnum; |
| | | import com.yeshi.fanli.entity.push.DeviceTokenHW; |
| | | import com.yeshi.fanli.exception.push.PushException; |
| | | import com.yeshi.fanli.log.LogHelper; |
| | | import com.yeshi.fanli.log.LogManager; |
| | | import com.yeshi.fanli.log.PushLogHelper; |
| | | import com.yeshi.fanli.service.inter.config.AppVersionService; |
| | | import com.yeshi.fanli.service.inter.config.SystemConfigService; |
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenHWService; |
| | | import com.yeshi.fanli.service.inter.push.HWPushService; |
| | | import com.yeshi.fanli.service.inter.user.UserCustomSettingsService; |
| | |
| | | |
| | | @Resource |
| | | private UserCustomSettingsService userCustomSettingsService; |
| | | |
| | | @Resource |
| | | private SystemConfigService systemConfigService; |
| | | |
| | | private List<Integer> getVersionCodeList(List<Integer> versionCodeList, SystemEnum system) { |
| | | List<Integer> versionList = new ArrayList<>(); |
| | |
| | | if (dto.getType() == PushTypeEnum.goodsdetail) {// 商品详情 |
| | | if (dto.getGoodsId() == null) |
| | | throw new PushException(2, "参数不完整"); |
| | | HWPushUtil.pushGoods(tokenList, dto.getContent().getTitle(), dto.getContent().getContent(), 1, dto.getGoodsId()); |
| | | HWPushUtil.pushGoods(tokenList, dto.getContent().getTitle(), dto.getContent().getContent(), 1, dto.getGoodsId(),getAndroidBaseActivity( dto.getContent().getSystem())); |
| | | } else if (dto.getType() == PushTypeEnum.url) {// 链接 |
| | | if (StringUtil.isNullOrEmpty(dto.getWebUrl())) |
| | | throw new PushException(2, "参数不完整"); |
| | | HWPushUtil.pushUrl(tokenList, dto.getContent().getTitle(), dto.getContent().getContent(), dto.getWebUrl()); |
| | | HWPushUtil.pushUrl(tokenList, dto.getContent().getTitle(), dto.getContent().getContent(), dto.getWebUrl(),getAndroidBaseActivity(dto.getContent().getSystem())); |
| | | } else if (dto.getType() == PushTypeEnum.ZNX) {// 站内信 |
| | | HWPushUtil.pushZNX(tokenList, dto.getContent().getTitle(), dto.getContent().getContent()); |
| | | } else if (dto.getType() == PushTypeEnum.weex) {// weex |
| | | if (StringUtil.isNullOrEmpty(dto.getUrl())) |
| | | throw new PushException(2, "参数不完整"); |
| | | HWPushUtil.pushWEEX(tokenList, dto.getContent().getTitle(), dto.getContent().getContent(), dto.getUrl()); |
| | | HWPushUtil.pushWEEX(tokenList, dto.getContent().getTitle(), dto.getContent().getContent(), dto.getUrl(),getAndroidBaseActivity(dto.getContent().getSystem())); |
| | | } else if (dto.getType() == PushTypeEnum.baichuan) {// 百川链接 |
| | | if (StringUtil.isNullOrEmpty(dto.getWebUrl())) |
| | | throw new PushException(2, "参数不完整"); |
| | | HWPushUtil.pushBaiChuanUrl(tokenList, dto.getContent().getTitle(), dto.getContent().getContent(), dto.getWebUrl()); |
| | | } else if (dto.getType() == PushTypeEnum.welfare) {// 福利中心 |
| | | HWPushUtil.pushWelfareCenter(tokenList, dto.getContent().getTitle(), dto.getContent().getContent()); |
| | | HWPushUtil.pushWelfareCenter(tokenList, dto.getContent().getTitle(), dto.getContent().getContent(),getAndroidBaseActivity(dto.getContent().getSystem())); |
| | | } else if (dto.getType() == PushTypeEnum.signin) {// 签到 |
| | | HWPushUtil.pushUserSignInNotification(tokenList, dto.getContent().getTitle(), dto.getContent().getContent()); |
| | | HWPushUtil.pushUserSignInNotification(tokenList, dto.getContent().getTitle(), dto.getContent().getContent(),getAndroidBaseActivity(dto.getContent().getSystem())); |
| | | } |
| | | } catch (Exception e) { |
| | | PushLogHelper.hwError(e); |
| | |
| | | if (dto.getType() == PushTypeEnum.goodsdetail) {// 商品详情 |
| | | if (dto.getGoodsId() == null) |
| | | throw new PushException(2, "参数不完整"); |
| | | HWPushUtil.pushGoods(tokenList, dto.getContent().getTitle(), dto.getContent().getContent(), 1, dto.getGoodsId()); |
| | | HWPushUtil.pushGoods(tokenList, dto.getContent().getTitle(), dto.getContent().getContent(), 1, dto.getGoodsId(),getAndroidBaseActivity(dto.getContent().getSystem())); |
| | | } else if (dto.getType() == PushTypeEnum.url) {// 链接 |
| | | if (StringUtil.isNullOrEmpty(dto.getWebUrl())) |
| | | throw new PushException(2, "参数不完整"); |
| | | HWPushUtil.pushUrl(tokenList, dto.getContent().getTitle(), dto.getContent().getContent(), dto.getWebUrl()); |
| | | HWPushUtil.pushUrl(tokenList, dto.getContent().getTitle(), dto.getContent().getContent(), dto.getWebUrl(),getAndroidBaseActivity(dto.getContent().getSystem())); |
| | | } else if (dto.getType() == PushTypeEnum.ZNX) {// 站内信 |
| | | HWPushUtil.pushZNX(tokenList, dto.getContent().getTitle(), dto.getContent().getContent()); |
| | | } else if (dto.getType() == PushTypeEnum.weex) {// weex |
| | | if (StringUtil.isNullOrEmpty(dto.getUrl())) |
| | | throw new PushException(2, "参数不完整"); |
| | | HWPushUtil.pushWEEX(tokenList, dto.getContent().getTitle(), dto.getContent().getContent(), dto.getUrl()); |
| | | HWPushUtil.pushWEEX(tokenList, dto.getContent().getTitle(), dto.getContent().getContent(), dto.getUrl(),getAndroidBaseActivity(dto.getContent().getSystem())); |
| | | } else if (dto.getType() == PushTypeEnum.baichuan) {// 百川链接 |
| | | if (StringUtil.isNullOrEmpty(dto.getWebUrl())) |
| | | throw new PushException(2, "参数不完整"); |
| | | HWPushUtil.pushBaiChuanUrl(tokenList, dto.getContent().getTitle(), dto.getContent().getContent(), dto.getWebUrl()); |
| | | } else if (dto.getType() == PushTypeEnum.welfare) {// 福利中心 |
| | | HWPushUtil.pushWelfareCenter(tokenList, dto.getContent().getTitle(), dto.getContent().getContent()); |
| | | HWPushUtil.pushWelfareCenter(tokenList, dto.getContent().getTitle(), dto.getContent().getContent(),getAndroidBaseActivity(dto.getContent().getSystem())); |
| | | } else if (dto.getType() == PushTypeEnum.signin) {// 签到 |
| | | HWPushUtil.pushUserSignInNotification(tokenList, dto.getContent().getTitle(), dto.getContent().getContent()); |
| | | HWPushUtil.pushUserSignInNotification(tokenList, dto.getContent().getTitle(), dto.getContent().getContent(),getAndroidBaseActivity(dto.getContent().getSystem())); |
| | | } |
| | | } catch (Exception e) { |
| | | PushLogHelper.hwError(e); |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | private String getAndroidBaseActivity(SystemEnum system) { |
| | | |
| | | return systemConfigService.getValueCache(SystemConfigKeyEnum.androidBaseActivityName, system); |
| | | |
| | | } |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.entity.config.SystemConfigKeyEnum; |
| | | import com.yeshi.fanli.service.inter.config.SystemConfigService; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | @Resource |
| | | private UserCustomSettingsService userCustomSettingsService; |
| | | |
| | | @Resource |
| | | private SystemConfigService systemConfigService; |
| | | |
| | | |
| | | @Async("pushExecutor") |
| | | @Override |
| | | public void pushGoods(Long uid, Long auctionId, String title, String content, String versionCodes) |
| | | public void pushGoods(Long uid, Long auctionId, String title, String content, String versionCodes, SystemEnum system) |
| | | throws PushException { |
| | | |
| | | String url = "https://item.taobao.com/item.htm?id=" + auctionId; |
| | |
| | | json.put("id", auctionId); |
| | | json.put("type", "goodsdetail"); |
| | | json.put("miPushUrl", String.format("%s.ui.recommend.GoodsBrowserActivity", |
| | | Constant.systemCommonConfig.getAndroidBaseactivityName())); |
| | | systemConfigService.getValueCache(SystemConfigKeyEnum.androidBaseActivityName,system))); |
| | | |
| | | MessageInfo info = new MessageInfo(); |
| | | info.setTitle(title); |
| | | info.setContent(content); |
| | | info.setDescription(content); |
| | | info.setPackageName(Constant.systemCommonConfig.getAndroidPackageName()); |
| | | info.setPackageName(systemConfigService.getValueCache(SystemConfigKeyEnum.androidPackageNames,system)); |
| | | info.setActivty(String.format("%s.ui.recommend.GoodsBrowserActivity", |
| | | Constant.systemCommonConfig.getAndroidBaseactivityName())); |
| | | systemConfigService.getValueCache(SystemConfigKeyEnum.androidBaseActivityName,system))); |
| | | |
| | | PushRecord pushRecord = new PushRecord(); |
| | | pushRecord.setState(1); |
| | |
| | | |
| | | if (uid == null || uid == 0) { |
| | | |
| | | addPushIOSQueue(info, url, PushTypeEnum.goodsdetail.getCode(), versionCodes); |
| | | addPushIOSQueue(info, url, PushTypeEnum.goodsdetail.getCode(), versionCodes,system); |
| | | |
| | | /* |
| | | * // 查询IOS所有设备号 // TODO 需要全推 List<String> deviceTokenList = |
| | |
| | | } |
| | | |
| | | try { |
| | | IOSPushUtil.allPushIOS(deviceTokenList, info, url, PushTypeEnum.goodsdetail.getCode()); |
| | | IOSPushUtil.allPushIOS(deviceTokenList, info, url, PushTypeEnum.goodsdetail.getCode(),systemConfigService.getValueCache(SystemConfigKeyEnum.iosPushCertPwd,system)); |
| | | } catch (Exception e) { |
| | | PushLogHelper.iosError(e); |
| | | } |
| | |
| | | |
| | | @Async("pushExecutor") |
| | | @Override |
| | | public void pushUrl(Long uid, String url, String title, String content, String versionCodes) throws PushException { |
| | | public void pushUrl(Long uid, String url, String title, String content, String versionCodes, SystemEnum system) throws PushException { |
| | | JSONObject json = new JSONObject(); |
| | | json.put("url", url); |
| | | json.put("type", "url"); |
| | | json.put("webUrl", url); |
| | | json.put("miPushUrl", |
| | | String.format("%s.ui.BrowserActivity", Constant.systemCommonConfig.getAndroidBaseactivityName())); |
| | | String.format("%s.ui.BrowserActivity",systemConfigService.getValueCache(SystemConfigKeyEnum.androidBaseActivityName,system))); |
| | | |
| | | MessageInfo info = new MessageInfo(); |
| | | info.setTitle(title); |
| | | info.setContent(content); |
| | | info.setDescription(content); |
| | | // 小米推送网页 |
| | | info.setPackageName(Constant.systemCommonConfig.getAndroidPackageName()); |
| | | info.setPackageName(systemConfigService.getValueCache(SystemConfigKeyEnum.androidPackageNames,system)); |
| | | info.setActivty( |
| | | String.format("%s.ui.BrowserActivity", Constant.systemCommonConfig.getAndroidBaseactivityName())); |
| | | String.format("%s.ui.BrowserActivity", systemConfigService.getValueCache(SystemConfigKeyEnum.androidBaseActivityName,system))); |
| | | |
| | | PushRecord pushRecord = new PushRecord(); |
| | | // IOS 全推 |
| | | if (uid == null || uid == 0) { |
| | | // TODO 需要全推 |
| | | |
| | | addPushIOSQueue(info, url, PushTypeEnum.url.getCode(), versionCodes); |
| | | addPushIOSQueue(info, url, PushTypeEnum.url.getCode(), versionCodes,system); |
| | | |
| | | /* |
| | | * List<String> deviceTokenList = getDeviceTokenList(1, 1000); |
| | |
| | | deviceTokenList.add(ios.getDeviceToken()); |
| | | } |
| | | try { |
| | | IOSPushUtil.allPushIOS(deviceTokenList, info, url, PushTypeEnum.url.getCode()); |
| | | IOSPushUtil.allPushIOS(deviceTokenList, info, url, PushTypeEnum.url.getCode(),systemConfigService.getValueCache(SystemConfigKeyEnum.iosPushCertPwd,system)); |
| | | } catch (Exception e) { |
| | | PushLogHelper.iosError(e); |
| | | } |
| | |
| | | |
| | | @Async("pushExecutor") |
| | | @Override |
| | | public void pushZNX(Long uId, AccountMessage msg, SystemZnx systemZNX, String versionCodes) throws PushException { |
| | | public void pushZNX(Long uId, AccountMessage msg, SystemZnx systemZNX, String versionCodes, SystemEnum system) throws PushException { |
| | | MessageInfo info = new MessageInfo(); |
| | | info.setPackageName(Constant.systemCommonConfig.getAndroidPackageName()); |
| | | info.setPackageName(systemConfigService.getValueCache(SystemConfigKeyEnum.androidPackageNames,system)); |
| | | |
| | | JSONObject contentJson = new JSONObject(); |
| | | contentJson.put("isOpen", 0); |
| | |
| | | json.put("type", "ZNX"); |
| | | json.put("content", contentJson); |
| | | json.put("miPushUrl", String.format("%s.ui.mine.AppMailDetailActivity", |
| | | Constant.systemCommonConfig.getAndroidBaseactivityName())); |
| | | systemConfigService.getValueCache(SystemConfigKeyEnum.androidBaseActivityName,system))); |
| | | |
| | | PushRecord pushRecord = new PushRecord(); |
| | | |
| | | // TODO 需要全推 |
| | | |
| | | addPushIOSQueue(info, id + "", PushTypeEnum.ZNX.getCode(), versionCodes); |
| | | addPushIOSQueue(info, id + "", PushTypeEnum.ZNX.getCode(), versionCodes,system); |
| | | |
| | | /* |
| | | * List<String> deviceTokenList = getDeviceTokenList(1, 1000); |
| | |
| | | info.setDescription(msg.getContent()); |
| | | |
| | | info.setAlias(uId + ""); |
| | | info.setPackageName(Constant.systemCommonConfig.getAndroidPackageName()); |
| | | info.setPackageName(systemConfigService.getValueCache(SystemConfigKeyEnum.androidPackageNames,system)); |
| | | info.setActivty( |
| | | String.format("%s.ui.BrowserActivity", Constant.systemCommonConfig.getAndroidBaseactivityName())); |
| | | String.format("%s.ui.BrowserActivity",systemConfigService.getValueCache(SystemConfigKeyEnum.androidBaseActivityName,system))); |
| | | |
| | | contentJson.put("id", msg.getId() + ""); |
| | | |
| | |
| | | json.put("type", "ZNX"); |
| | | json.put("content", contentJson); |
| | | json.put("miPushUrl", String.format("%s.ui.mine.AppMailDetailActivity", |
| | | Constant.systemCommonConfig.getAndroidBaseactivityName())); |
| | | systemConfigService.getValueCache(SystemConfigKeyEnum.androidBaseActivityName,system))); |
| | | |
| | | List<DeviceTokenIOS> deviceTokenIosList = getDeviceTokenListByUid(msg.getUserInfo().getId(), versionCodes); |
| | | List<String> deviceTokenList = new ArrayList<>(); |
| | |
| | | |
| | | // IOS 单推 |
| | | try { |
| | | IOSPushUtil.allPushIOS(deviceTokenList, info, "0", PushTypeEnum.ZNX.getCode()); |
| | | IOSPushUtil.allPushIOS(deviceTokenList, info, "0", PushTypeEnum.ZNX.getCode(),systemConfigService.getValueCache(SystemConfigKeyEnum.iosPushCertPwd,system)); |
| | | } catch (Exception e) { |
| | | PushLogHelper.iosError(e); |
| | | } |
| | |
| | | * @param json |
| | | */ |
| | | @Transactional(rollbackFor=Exception.class) |
| | | public void addPushIOSQueue(MessageInfo info, String url, int type, String versionCodes) throws PushException { |
| | | public void addPushIOSQueue(MessageInfo info, String url, int type, String versionCodes,SystemEnum system) throws PushException { |
| | | |
| | | if (Constant.IS_TEST) |
| | | return; |
| | |
| | | for (long i = 0; i < tokenCount + totalCount;) { |
| | | |
| | | PushQueueRecord pushQueueRecord = new PushQueueRecord(); |
| | | pushQueueRecord.setSystem(system); |
| | | // 初始状态 |
| | | pushQueueRecord.setState(0); |
| | | // 发送内容 |
| | |
| | | recordCursor = endCursor; |
| | | |
| | | if (list != null) { |
| | | executePushIOS(list, pushQueueRecord, recordCursor); |
| | | executePushIOS(list, pushQueueRecord, recordCursor,pushQueueRecord.getSystem()); |
| | | PushLogHelper.iosInfo("推送游标:" + startCursor + "," + moveNum); |
| | | } |
| | | |
| | |
| | | // System.out.println(moveNum); |
| | | List<DeviceTokenIOS> list = deviceTokenIOSMapper.selectList(recordCursor, moveNum, listCode); |
| | | if (list != null) { |
| | | executePushIOS(list, pushQueueRecord, endCursor); |
| | | executePushIOS(list, pushQueueRecord, endCursor,pushQueueRecord.getSystem()); |
| | | PushLogHelper.iosInfo("推送游标:" + recordCursor + "," + moveNum); |
| | | } |
| | | recordCursor = endCursor; |
| | |
| | | recordCursor = recordCursor + 50; |
| | | |
| | | if (list != null) { |
| | | executePushIOS(list, pushQueueRecord, recordCursor - 1); |
| | | executePushIOS(list, pushQueueRecord, recordCursor - 1,pushQueueRecord.getSystem()); |
| | | PushLogHelper.iosInfo("推送游标:" + recordCursor + "," + moveNum); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | public void executePushIOS(List<DeviceTokenIOS> list, PushQueueRecord pushQueueRecord, long recordCursor) { |
| | | public void executePushIOS(List<DeviceTokenIOS> list, PushQueueRecord pushQueueRecord, long recordCursor,SystemEnum system) { |
| | | |
| | | String jsonContent = pushQueueRecord.getJsonContent(); |
| | | JSONObject json = JSONObject.fromObject(jsonContent); |
| | |
| | | if (tokenList.size() > 0) { |
| | | // 执行推送 |
| | | try { |
| | | IOSPushUtil.executePushIOS(tokenList, json); |
| | | IOSPushUtil.executePushIOS(tokenList, json,systemConfigService.getValueCache(SystemConfigKeyEnum.iosPushCertPwd,system)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | |
| | | @Async("pushExecutor") |
| | | @Override |
| | | public void pushWEEX(Long uid, String title, String content, String weexUrl, String versionCodes) |
| | | public void pushWEEX(Long uid, String title, String content, String weexUrl, String versionCodes, SystemEnum system) |
| | | throws PushException { |
| | | MessageInfo info = new MessageInfo(); |
| | | info.setTitle(title); |
| | |
| | | info.setDescription(content); |
| | | // IOS 全推 |
| | | if (uid == null || uid == 0) { |
| | | addPushIOSQueue(info, weexUrl, PushTypeEnum.weex.getCode(), versionCodes); |
| | | addPushIOSQueue(info, weexUrl, PushTypeEnum.weex.getCode(), versionCodes,system); |
| | | } else { |
| | | List<DeviceTokenIOS> deviceTokenIosList = getDeviceTokenListByUid(uid, versionCodes); |
| | | List<String> deviceTokenList = new ArrayList<>(); |
| | |
| | | deviceTokenList.add(ios.getDeviceToken()); |
| | | } |
| | | try { |
| | | IOSPushUtil.allPushIOS(deviceTokenList, info, weexUrl, PushTypeEnum.weex.getCode()); |
| | | IOSPushUtil.allPushIOS(deviceTokenList, info, weexUrl, PushTypeEnum.weex.getCode(),systemConfigService.getValueCache(SystemConfigKeyEnum.iosPushCertPwd,system)); |
| | | } catch (Exception e) { |
| | | PushLogHelper.iosError(e); |
| | | } |
| | |
| | | |
| | | @Async("pushExecutor") |
| | | @Override |
| | | public void pushBaiChuanUrl(Long uid, String title, String content, String url, String versionCodes) |
| | | public void pushBaiChuanUrl(Long uid, String title, String content, String url, String versionCodes, SystemEnum system) |
| | | throws PushException { |
| | | MessageInfo info = new MessageInfo(); |
| | | info.setTitle(title); |
| | |
| | | info.setDescription(content); |
| | | // IOS 全推 |
| | | if (uid == null || uid == 0) { |
| | | addPushIOSQueue(info, url, PushTypeEnum.baichuan.getCode(), versionCodes); |
| | | addPushIOSQueue(info, url, PushTypeEnum.baichuan.getCode(), versionCodes,system); |
| | | } else { |
| | | List<DeviceTokenIOS> deviceTokenIosList = getDeviceTokenListByUid(uid, versionCodes); |
| | | List<String> deviceTokenList = new ArrayList<>(); |
| | |
| | | deviceTokenList.add(ios.getDeviceToken()); |
| | | } |
| | | try { |
| | | IOSPushUtil.allPushIOS(deviceTokenList, info, url, PushTypeEnum.baichuan.getCode()); |
| | | IOSPushUtil.allPushIOS(deviceTokenList, info, url, PushTypeEnum.baichuan.getCode(),systemConfigService.getValueCache(SystemConfigKeyEnum.iosPushCertPwd,system)); |
| | | } catch (Exception e) { |
| | | PushLogHelper.iosError(e); |
| | | } |
| | |
| | | |
| | | @Async("pushExecutor") |
| | | @Override |
| | | public void pushWelfareCenter(Long uid, String title, String content, String versionCodes) throws PushException { |
| | | public void pushWelfareCenter(Long uid, String title, String content, String versionCodes, SystemEnum system) throws PushException { |
| | | MessageInfo info = new MessageInfo(); |
| | | info.setTitle(title); |
| | | info.setContent(content); |
| | | info.setDescription(content); |
| | | // IOS 全推 |
| | | if (uid == null || uid == 0) { |
| | | addPushIOSQueue(info, "", PushTypeEnum.welfare.getCode(), versionCodes); |
| | | addPushIOSQueue(info, "", PushTypeEnum.welfare.getCode(), versionCodes,system); |
| | | } else { |
| | | if (!validateNotDisturbSingle(uid)) { |
| | | return; |
| | |
| | | deviceTokenList.add(ios.getDeviceToken()); |
| | | } |
| | | try { |
| | | IOSPushUtil.allPushIOS(deviceTokenList, info, "", PushTypeEnum.welfare.getCode()); |
| | | IOSPushUtil.allPushIOS(deviceTokenList, info, "", PushTypeEnum.welfare.getCode(),systemConfigService.getValueCache(SystemConfigKeyEnum.iosPushCertPwd,system)); |
| | | } catch (Exception e) { |
| | | PushLogHelper.iosError(e); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void pushUserSignInNotification(Long uid, String title, String content, String versions) |
| | | public void pushUserSignInNotification(Long uid, String title, String content, String versions, SystemEnum system) |
| | | throws PushException { |
| | | MessageInfo info = new MessageInfo(); |
| | | info.setTitle(title); |
| | |
| | | info.setDescription(content); |
| | | // IOS 全推 |
| | | if (uid == null || uid == 0) { |
| | | addPushIOSQueue(info, "", PushTypeEnum.signin.getCode(), versions); |
| | | addPushIOSQueue(info, "", PushTypeEnum.signin.getCode(), versions,system); |
| | | } else { |
| | | List<DeviceTokenIOS> deviceTokenIosList = getDeviceTokenListByUid(uid, versions); |
| | | List<String> deviceTokenList = new ArrayList<>(); |
| | |
| | | deviceTokenList.add(ios.getDeviceToken()); |
| | | } |
| | | try { |
| | | IOSPushUtil.allPushIOS(deviceTokenList, info, "", PushTypeEnum.signin.getCode()); |
| | | IOSPushUtil.allPushIOS(deviceTokenList, info, "", PushTypeEnum.signin.getCode(),systemConfigService.getValueCache(SystemConfigKeyEnum.iosPushCertPwd,system)); |
| | | } catch (Exception e) { |
| | | PushLogHelper.iosError(e); |
| | | } |
| | |
| | | |
| | | import com.yeshi.fanli.dto.push.PushBaseContent; |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.entity.config.SystemConfigKeyEnum; |
| | | import com.yeshi.fanli.service.inter.config.SystemConfigService; |
| | | import com.yeshi.fanli.util.Constant; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | @Resource |
| | | private UserCustomSettingsService userCustomSettingsService; |
| | | |
| | | @Resource |
| | | private SystemConfigService systemConfigService; |
| | | |
| | | private List<Integer> getVersionCodeList(List<Integer> versionCodeList,SystemEnum system) { |
| | | List<Integer> versionList = new ArrayList<>(); |
| | |
| | | newVersionList.remove(i--); |
| | | } |
| | | |
| | | String androidBaseActivity = systemConfigService.getValueCache(SystemConfigKeyEnum.androidBaseActivityName, content.getSystem()); |
| | | |
| | | if (uid == null || uid == 0) { |
| | | Date minUpdatetime=new Date(System.currentTimeMillis()- Constant.PUSH_MIN_TIME); |
| | | int pageSize = 200; |
| | |
| | | if (type == PushTypeEnum.goodsdetail) {// 商品详情 |
| | | if (goodsId == null) |
| | | throw new PushException(2, "参数不完整"); |
| | | OPPOPushUtil.pushGoods(tokenList, content.getTitle(), content.getContent(), 1, goodsId); |
| | | OPPOPushUtil.pushGoods(tokenList, content.getTitle(), content.getContent(), 1, goodsId,androidBaseActivity); |
| | | } else if (type == PushTypeEnum.url) {// 链接 |
| | | if (StringUtil.isNullOrEmpty(webUrl)) |
| | | throw new PushException(2, "参数不完整"); |
| | | OPPOPushUtil.pushUrl(tokenList, content.getTitle(), content.getContent(), webUrl); |
| | | OPPOPushUtil.pushUrl(tokenList, content.getTitle(), content.getContent(), webUrl,androidBaseActivity); |
| | | } else if (type == PushTypeEnum.ZNX) {// 站内信 |
| | | OPPOPushUtil.pushZNX(tokenList, content.getTitle(), content.getContent()); |
| | | } else if (type == PushTypeEnum.weex) {// weex |
| | | if (StringUtil.isNullOrEmpty(url)) |
| | | throw new PushException(2, "参数不完整"); |
| | | OPPOPushUtil.pushWEEX(tokenList,content.getTitle(), content.getContent(), url); |
| | | OPPOPushUtil.pushWEEX(tokenList, content.getTitle(), content.getContent(), url,androidBaseActivity); |
| | | } else if (type == PushTypeEnum.baichuan) {// 百川链接 |
| | | if (StringUtil.isNullOrEmpty(webUrl)) |
| | | throw new PushException(2, "参数不完整"); |
| | | OPPOPushUtil.pushBaiChuanUrl(tokenList,content.getTitle(), content.getContent(), webUrl); |
| | | } else if (type == PushTypeEnum.welfare) {// 福利中心 |
| | | OPPOPushUtil.pushWelfareCenter(tokenList,content.getTitle(), content.getContent()); |
| | | OPPOPushUtil.pushWelfareCenter(tokenList, content.getTitle(), content.getContent(),androidBaseActivity); |
| | | } else if (type == PushTypeEnum.signin) {// 签到 |
| | | OPPOPushUtil.pushUserSignInNotification(tokenList, content.getTitle(), content.getContent()); |
| | | OPPOPushUtil.pushUserSignInNotification(tokenList, content.getTitle(), content.getContent(),androidBaseActivity); |
| | | } |
| | | } catch (Exception e) { |
| | | PushLogHelper.hwError(e); |
| | |
| | | if (type == PushTypeEnum.goodsdetail) {// 商品详情 |
| | | if (goodsId == null) |
| | | throw new PushException(2, "参数不完整"); |
| | | OPPOPushUtil.pushGoods(tokenList, content.getTitle(), content.getContent(), 1, goodsId); |
| | | OPPOPushUtil.pushGoods(tokenList, content.getTitle(), content.getContent(), 1, goodsId,androidBaseActivity); |
| | | } else if (type == PushTypeEnum.url) {// 链接 |
| | | if (StringUtil.isNullOrEmpty(webUrl)) |
| | | throw new PushException(2, "参数不完整"); |
| | | OPPOPushUtil.pushUrl(tokenList, content.getTitle(), content.getContent(), webUrl); |
| | | OPPOPushUtil.pushUrl(tokenList, content.getTitle(), content.getContent(), webUrl,androidBaseActivity); |
| | | } else if (type == PushTypeEnum.ZNX) {// 站内信 |
| | | OPPOPushUtil.pushZNX(tokenList, content.getTitle(), content.getContent()); |
| | | } else if (type == PushTypeEnum.weex) {// weex |
| | | if (StringUtil.isNullOrEmpty(url)) |
| | | throw new PushException(2, "参数不完整"); |
| | | OPPOPushUtil.pushWEEX(tokenList, content.getTitle(), content.getContent(), url); |
| | | OPPOPushUtil.pushWEEX(tokenList, content.getTitle(), content.getContent(), url,androidBaseActivity); |
| | | } else if (type == PushTypeEnum.baichuan) {// 百川链接 |
| | | if (StringUtil.isNullOrEmpty(webUrl)) |
| | | throw new PushException(2, "参数不完整"); |
| | | OPPOPushUtil.pushBaiChuanUrl(tokenList, content.getTitle(), content.getContent(), webUrl); |
| | | } else if (type == PushTypeEnum.welfare) {// 福利中心 |
| | | OPPOPushUtil.pushWelfareCenter(tokenList, content.getTitle(), content.getContent()); |
| | | OPPOPushUtil.pushWelfareCenter(tokenList, content.getTitle(), content.getContent(),androidBaseActivity); |
| | | } else if (type == PushTypeEnum.signin) {// 签到 |
| | | OPPOPushUtil.pushUserSignInNotification(tokenList, content.getTitle(), content.getContent()); |
| | | OPPOPushUtil.pushUserSignInNotification(tokenList, content.getTitle(), content.getContent(),androidBaseActivity); |
| | | } |
| | | } catch (Exception e) { |
| | | PushLogHelper.oppoError(e); |
| | |
| | | import com.yeshi.fanli.entity.xinge.PushRecord; |
| | | import com.yeshi.fanli.exception.push.PushException; |
| | | import com.yeshi.fanli.service.inter.config.AppVersionService; |
| | | import com.yeshi.fanli.service.inter.config.SystemConfigService; |
| | | import com.yeshi.fanli.service.inter.push.*; |
| | | import com.yeshi.fanli.service.inter.user.SystemZnxService; |
| | | import com.yeshi.fanli.util.Constant; |
| | |
| | | @Service |
| | | public class PushServiceImpl implements PushService { |
| | | |
| | | static String IOSBundleId = ""; |
| | | static String PROJECT_NAME = ""; |
| | | |
| | | static { |
| | | IOSBundleId = Constant.systemCommonConfig.getIosBundleId(); |
| | | PROJECT_NAME = Constant.systemCommonConfig.getProjectChineseName(); |
| | | } |
| | | |
| | | @Resource |
| | | private PushRecordService pushRecordService; |
| | | |
| | | @Resource |
| | | private SystemZnxService systemZnxService; |
| | | |
| | | @Resource |
| | | private DeviceTokenHWService deviceTokenHWService; |
| | | |
| | | @Resource |
| | | private IOSPushService iosPushService; |
| | |
| | | @Resource |
| | | private AppVersionService appVersionService; |
| | | |
| | | |
| | | @Resource |
| | | private SystemConfigService systemConfigService; |
| | | |
| | | @Override |
| | | public void pushGoods(Long uid, String title, String content, String url, List<String> listIOS, |
| | | List<String> listAndroid, SystemEnum system) throws PushException { |
| | |
| | | // 限制推送版本号:0 |
| | | String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS, system); |
| | | if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) { |
| | | iosPushService.pushGoods(uid, Long.parseLong(gid), title, content, codes); |
| | | iosPushService.pushGoods(uid, Long.parseLong(gid), title, content, codes, system); |
| | | } |
| | | } |
| | | |
| | |
| | | // 限制推送版本号:0 |
| | | String versions = getEffectiveVersions(0, AppVersionInfo.PLATFORM_ANDROID, listAndroid, system); |
| | | if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) { |
| | | xmPushService.pushGoods(uid, Long.parseLong(gid), title, content, versions); |
| | | xmPushService.pushGoods(uid, Long.parseLong(gid), title, content, versions, system); |
| | | } |
| | | // 华为推送 |
| | | if (listAndroid == null || listAndroid.size() > 0) { |
| | |
| | | // 限制推送版本号:0 |
| | | String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS, system); |
| | | if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) { |
| | | iosPushService.pushUrl(uid, url, title, content, codes); |
| | | iosPushService.pushUrl(uid, url, title, content, codes,system); |
| | | } |
| | | } |
| | | |
| | |
| | | // 限制推送版本号:0 |
| | | String versions = getEffectiveVersions(0, AppVersionInfo.PLATFORM_ANDROID, listAndroid, system); |
| | | if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) { |
| | | xmPushService.pushUrl(uid, url, title, content, versions); |
| | | xmPushService.pushUrl(uid, url, title, content, versions,system); |
| | | } |
| | | |
| | | // 华为推送 |
| | |
| | | // 限制推送版本号:0 |
| | | String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS, system); |
| | | if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) { |
| | | iosPushService.pushZNX(uId, accountMessage, systemZnx, codes); |
| | | iosPushService.pushZNX(uId, accountMessage, systemZnx, codes,system); |
| | | } |
| | | } |
| | | |
| | |
| | | // 限制推送版本号:0 |
| | | String versions = getEffectiveVersions(0, AppVersionInfo.PLATFORM_ANDROID, listAndroid, system); |
| | | if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) { |
| | | xmPushService.pushZNX(uId, accountMessage, systemZnx, versions); |
| | | xmPushService.pushZNX(uId, accountMessage, systemZnx, versions,system); |
| | | } |
| | | |
| | | // 华为推送 |
| | |
| | | // 限制推送版本号:0 |
| | | String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS, system); |
| | | if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) { |
| | | iosPushService.pushWEEX(uid, title, content, weexUrl, codes); |
| | | iosPushService.pushWEEX(uid, title, content, weexUrl, codes,system); |
| | | } |
| | | } |
| | | |
| | |
| | | // 限制推送版本号:31 |
| | | String versions = getEffectiveVersions(0, AppVersionInfo.PLATFORM_ANDROID, listAndroid, system); |
| | | if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) { |
| | | xmPushService.pushWEEX(uid, title, content, weexUrl, versions); |
| | | xmPushService.pushWEEX(uid, title, content, weexUrl, versions,system); |
| | | } |
| | | } |
| | | |
| | |
| | | // 限制推送版本号:0 |
| | | String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS, system); |
| | | if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) { |
| | | iosPushService.pushBaiChuanUrl(uid, title, content, url, codes); |
| | | iosPushService.pushBaiChuanUrl(uid, title, content, url, codes,system); |
| | | } |
| | | } |
| | | |
| | |
| | | // 限制推送版本号:31 |
| | | String versions = getEffectiveVersions(31, AppVersionInfo.PLATFORM_ANDROID, listAndroid, system); |
| | | if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) { |
| | | xmPushService.pushBaiChuanUrl(uid, title, content, url, versions); |
| | | xmPushService.pushBaiChuanUrl(uid, title, content, url, versions,system); |
| | | } |
| | | } |
| | | |
| | |
| | | // 限制推送版本号:0 |
| | | String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS, system); |
| | | if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) { |
| | | iosPushService.pushWelfareCenter(uid, title, content, codes); |
| | | iosPushService.pushWelfareCenter(uid, title, content, codes,system); |
| | | } |
| | | } |
| | | |
| | |
| | | // 限制推送版本号:36 |
| | | String versions = getEffectiveVersions(36, AppVersionInfo.PLATFORM_ANDROID, listAndroid, system); |
| | | if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) { |
| | | xmPushService.pushWelfareCenter(uid, title, content, versions); |
| | | xmPushService.pushWelfareCenter(uid, title, content, versions,system); |
| | | } |
| | | } |
| | | |
| | |
| | | // 限制推送版本号:1.6.5以后 |
| | | String codes = getEffectiveVersionCodes(60, AppVersionInfo.PLATFORM_IOS, listIOS, system); |
| | | if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) { |
| | | iosPushService.pushUserSignInNotification(uid, title, content, codes); |
| | | iosPushService.pushUserSignInNotification(uid, title, content, codes,system); |
| | | } |
| | | } |
| | | |
| | |
| | | // 限制推送版本号:1.6.5以后 |
| | | String versions = getEffectiveVersions(47, AppVersionInfo.PLATFORM_ANDROID, listAndroid, system); |
| | | if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) { |
| | | xmPushService.pushUserSignInNotification(uid, title, content, versions); |
| | | xmPushService.pushUserSignInNotification(uid, title, content, versions,system); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | import com.yeshi.fanli.dto.push.PushBaseContent; |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.entity.config.SystemConfigKeyEnum; |
| | | import com.yeshi.fanli.service.inter.config.SystemConfigService; |
| | | import com.yeshi.fanli.util.Constant; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | @Resource |
| | | private UserCustomSettingsService userCustomSettingsService; |
| | | |
| | | @Resource |
| | | private SystemConfigService systemConfigService; |
| | | |
| | | private List<Integer> getVersionCodeList(List<Integer> versionCodeList, SystemEnum system) { |
| | | List<Integer> versionList = new ArrayList<>(); |
| | |
| | | */ |
| | | private void push(PushTypeEnum type, Long uid, String url, String webUrl, |
| | | Long goodsId, PushBaseContent content) throws PushException { |
| | | |
| | | String androidBaseActivity=getAndroidBaseActivity(content.getSystem()); |
| | | int hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY); |
| | | List<Integer> newVersionList = getVersionCodeList(content.getVersionCodeList(),content.getSystem()); |
| | | // 2.0.1后开始推送 |
| | |
| | | if (type == PushTypeEnum.goodsdetail) {// 商品详情 |
| | | if (goodsId == null) |
| | | throw new PushException(2, "参数不完整"); |
| | | VIVOPushUtil.pushGoods(tokenList, content.getTitle(),content.getContent(), 1, goodsId); |
| | | VIVOPushUtil.pushGoods(tokenList, content.getTitle(),content.getContent(), 1, goodsId,androidBaseActivity); |
| | | } else if (type == PushTypeEnum.url) {// 链接 |
| | | if (StringUtil.isNullOrEmpty(webUrl)) |
| | | throw new PushException(2, "参数不完整"); |
| | | VIVOPushUtil.pushUrl(tokenList, content.getTitle(),content.getContent(), webUrl); |
| | | VIVOPushUtil.pushUrl(tokenList, content.getTitle(),content.getContent(), webUrl,androidBaseActivity); |
| | | } else if (type == PushTypeEnum.ZNX) {// 站内信 |
| | | VIVOPushUtil.pushZNX(tokenList, content.getTitle(),content.getContent()); |
| | | } else if (type == PushTypeEnum.weex) {// weex |
| | | if (StringUtil.isNullOrEmpty(url)) |
| | | throw new PushException(2, "参数不完整"); |
| | | VIVOPushUtil.pushWEEX(tokenList, content.getTitle(),content.getContent(), url); |
| | | VIVOPushUtil.pushWEEX(tokenList, content.getTitle(),content.getContent(), url,androidBaseActivity); |
| | | } else if (type == PushTypeEnum.baichuan) {// 百川链接 |
| | | if (StringUtil.isNullOrEmpty(webUrl)) |
| | | throw new PushException(2, "参数不完整"); |
| | | VIVOPushUtil.pushBaiChuanUrl(tokenList, content.getTitle(),content.getContent(), webUrl); |
| | | } else if (type == PushTypeEnum.welfare) {// 福利中心 |
| | | VIVOPushUtil.pushWelfareCenter(tokenList, content.getTitle(),content.getContent()); |
| | | VIVOPushUtil.pushWelfareCenter(tokenList, content.getTitle(),content.getContent(),androidBaseActivity); |
| | | } else if (type == PushTypeEnum.signin) {// 签到 |
| | | VIVOPushUtil.pushUserSignInNotification(tokenList, content.getTitle(),content.getContent()); |
| | | VIVOPushUtil.pushUserSignInNotification(tokenList, content.getTitle(),content.getContent(),androidBaseActivity); |
| | | } |
| | | } catch (Exception e) { |
| | | PushLogHelper.hwError(e); |
| | |
| | | if (type == PushTypeEnum.goodsdetail) {// 商品详情 |
| | | if (goodsId == null) |
| | | throw new PushException(2, "参数不完整"); |
| | | VIVOPushUtil.pushGoods(tokenList, content.getTitle(), content.getContent(), 1, goodsId); |
| | | VIVOPushUtil.pushGoods(tokenList, content.getTitle(), content.getContent(), 1, goodsId,androidBaseActivity); |
| | | } else if (type == PushTypeEnum.url) {// 链接 |
| | | if (StringUtil.isNullOrEmpty(webUrl)) |
| | | throw new PushException(2, "参数不完整"); |
| | | VIVOPushUtil.pushUrl(tokenList, content.getTitle(), content.getContent(), webUrl); |
| | | VIVOPushUtil.pushUrl(tokenList, content.getTitle(), content.getContent(), webUrl,androidBaseActivity); |
| | | } else if (type == PushTypeEnum.ZNX) {// 站内信 |
| | | VIVOPushUtil.pushZNX(tokenList, content.getTitle(), content.getContent()); |
| | | } else if (type == PushTypeEnum.weex) {// weex |
| | | if (StringUtil.isNullOrEmpty(url)) |
| | | throw new PushException(2, "参数不完整"); |
| | | VIVOPushUtil.pushWEEX(tokenList, content.getTitle(), content.getContent(), url); |
| | | VIVOPushUtil.pushWEEX(tokenList, content.getTitle(), content.getContent(), url,androidBaseActivity); |
| | | } else if (type == PushTypeEnum.baichuan) {// 百川链接 |
| | | if (StringUtil.isNullOrEmpty(webUrl)) |
| | | throw new PushException(2, "参数不完整"); |
| | | VIVOPushUtil.pushBaiChuanUrl(tokenList, content.getTitle(), content.getContent(), webUrl); |
| | | } else if (type == PushTypeEnum.welfare) {// 福利中心 |
| | | VIVOPushUtil.pushWelfareCenter(tokenList, content.getTitle(), content.getContent()); |
| | | VIVOPushUtil.pushWelfareCenter(tokenList, content.getTitle(), content.getContent(),androidBaseActivity); |
| | | } else if (type == PushTypeEnum.signin) {// 签到 |
| | | VIVOPushUtil.pushUserSignInNotification(tokenList,content.getTitle(), content.getContent()); |
| | | VIVOPushUtil.pushUserSignInNotification(tokenList,content.getTitle(), content.getContent(),androidBaseActivity); |
| | | } |
| | | } catch (Exception e) { |
| | | PushLogHelper.vivoError(e); |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | private String getAndroidBaseActivity(SystemEnum system) { |
| | | |
| | | return systemConfigService.getValueCache(SystemConfigKeyEnum.androidBaseActivityName, system); |
| | | |
| | | } |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.entity.config.SystemConfigKeyEnum; |
| | | import com.yeshi.fanli.service.inter.config.SystemConfigService; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | @Resource |
| | | private DeviceTokenXMService deviceTokenXMService; |
| | | |
| | | @Resource |
| | | private SystemConfigService systemConfigService; |
| | | |
| | | private List<String> getRegIds(Long uid) { |
| | | List<DeviceTokenXM> list = deviceTokenXMService.listByUid(uid); |
| | | |
| | |
| | | |
| | | @Async("pushExecutor") |
| | | @Override |
| | | public void pushGoods(Long uid, Long auctionId, String title, String content, String versions) |
| | | public void pushGoods(Long uid, Long auctionId, String title, String content, String versions, SystemEnum system) |
| | | throws PushException { |
| | | |
| | | String gid = auctionId + ""; |
| | |
| | | json.put("id", gid); |
| | | json.put("type", PushTypeEnum.goodsdetail.name()); |
| | | json.put("miPushUrl", String.format("%s.ui.recommend.GoodsBrowserActivity", |
| | | Constant.systemCommonConfig.getAndroidBaseactivityName())); |
| | | getAndroidPackageName(system))); |
| | | |
| | | // 版本推送 |
| | | if (versions != null && versions.trim().length() > 0) { |
| | |
| | | info.setTitle(title); |
| | | info.setContent(content); |
| | | info.setDescription(content); |
| | | info.setPackageName(Constant.systemCommonConfig.getAndroidPackageName()); |
| | | info.setPackageName(getAndroidBaseactivityName(system)); |
| | | info.setActivty(String.format("%s.ui.recommend.GoodsBrowserActivity", |
| | | Constant.systemCommonConfig.getAndroidBaseactivityName())); |
| | | getAndroidPackageName(system))); |
| | | |
| | | PushRecord pushRecord = new PushRecord(); |
| | | if (uid == null || uid == 0) { |
| | |
| | | |
| | | @Async("pushExecutor") |
| | | @Override |
| | | public void pushUrl(Long uid, String url, String title, String content, String versions) throws PushException { |
| | | public void pushUrl(Long uid, String url, String title, String content, String versions, SystemEnum system) throws PushException { |
| | | |
| | | JSONObject json = new JSONObject(); |
| | | json.put("url", url); |
| | | json.put("type", PushTypeEnum.url.name()); |
| | | json.put("webUrl", url); |
| | | json.put("miPushUrl", String.format("%s.ui.invite.ShareBrowserActivity", |
| | | Constant.systemCommonConfig.getAndroidBaseactivityName())); |
| | | getAndroidPackageName(system))); |
| | | |
| | | // 版本推送 |
| | | if (versions != null && versions.trim().length() > 0) { |
| | |
| | | info.setContent(content); |
| | | info.setDescription(content); |
| | | // 小米推送网页 |
| | | info.setPackageName(Constant.systemCommonConfig.getAndroidPackageName()); |
| | | info.setPackageName(getAndroidBaseactivityName(system)); |
| | | info.setActivty(String.format("%s.ui.invite.ShareBrowserActivity", |
| | | Constant.systemCommonConfig.getAndroidBaseactivityName())); |
| | | getAndroidPackageName(system))); |
| | | |
| | | PushRecord pushRecord = new PushRecord(); |
| | | |
| | |
| | | |
| | | @Async("pushExecutor") |
| | | @Override |
| | | public void pushZNX(Long uId, AccountMessage msg, SystemZnx systemZNX, String versions) throws PushException { |
| | | public void pushZNX(Long uId, AccountMessage msg, SystemZnx systemZNX, String versions, SystemEnum system) throws PushException { |
| | | |
| | | MessageInfo info = new MessageInfo(); |
| | | info.setPackageName(Constant.systemCommonConfig.getAndroidPackageName()); |
| | | info.setPackageName(getAndroidBaseactivityName(system)); |
| | | |
| | | JSONObject contentJson = new JSONObject(); |
| | | contentJson.put("isOpen", 0); |
| | |
| | | json.put("type", PushTypeEnum.ZNX.name()); |
| | | json.put("content", contentJson); |
| | | json.put("miPushUrl", |
| | | String.format("%s.ui.main.MainActivity", Constant.systemCommonConfig.getAndroidBaseactivityName())); |
| | | String.format("%s.ui.main.MainActivity", getAndroidPackageName(system))); |
| | | |
| | | // 版本推送 |
| | | if (versions != null && versions.trim().length() > 0) { |
| | |
| | | // 插入推送记录 |
| | | PushRecord pushRecord = new PushRecord(); |
| | | info.setAlias(uId + ""); |
| | | info.setPackageName(Constant.systemCommonConfig.getAndroidPackageName()); |
| | | info.setPackageName(getAndroidBaseactivityName(system)); |
| | | info.setActivty( |
| | | String.format("%s.ui.BrowserActivity", Constant.systemCommonConfig.getAndroidBaseactivityName())); |
| | | String.format("%s.ui.BrowserActivity", getAndroidPackageName(system))); |
| | | contentJson.put("id", msg.getId() + ""); |
| | | |
| | | JSONObject json = new JSONObject(); |
| | | json.put("type", PushTypeEnum.ZNX.name()); |
| | | json.put("content", contentJson); |
| | | json.put("miPushUrl", |
| | | String.format("%s.ui.main.MainActivity", Constant.systemCommonConfig.getAndroidBaseactivityName())); |
| | | String.format("%s.ui.main.MainActivity", getAndroidPackageName(system))); |
| | | |
| | | // 版本推送 |
| | | if (versions != null && versions.trim().length() > 0) { |
| | |
| | | |
| | | @Async("pushExecutor") |
| | | @Override |
| | | public void pushWEEX(Long uid, String title, String content, String weexUrl, String versions) throws PushException { |
| | | public void pushWEEX(Long uid, String title, String content, String weexUrl, String versions, SystemEnum system) throws PushException { |
| | | |
| | | JSONObject json = new JSONObject(); |
| | | json.put("url", weexUrl); |
| | |
| | | info.setContent(content); |
| | | info.setDescription(content); |
| | | // 小米推送网页 |
| | | info.setPackageName(Constant.systemCommonConfig.getAndroidPackageName()); |
| | | info.setPackageName(getAndroidBaseactivityName(system)); |
| | | info.setActivty(String.format("%s.ui.mine.weex.WeexApplicationActivity", |
| | | Constant.systemCommonConfig.getAndroidBaseactivityName())); |
| | | getAndroidPackageName(system))); |
| | | |
| | | PushRecord pushRecord = new PushRecord(); |
| | | |
| | |
| | | |
| | | @Async("pushExecutor") |
| | | @Override |
| | | public void pushBaiChuanUrl(Long uid, String title, String content, String url, String versions) |
| | | public void pushBaiChuanUrl(Long uid, String title, String content, String url, String versions, SystemEnum system) |
| | | throws PushException { |
| | | |
| | | JSONObject json = new JSONObject(); |
| | |
| | | info.setContent(content); |
| | | info.setDescription(content); |
| | | // 小米推送网页 |
| | | info.setPackageName(Constant.systemCommonConfig.getAndroidPackageName()); |
| | | info.setPackageName(getAndroidBaseactivityName(system)); |
| | | |
| | | PushRecord pushRecord = new PushRecord(); |
| | | |
| | |
| | | |
| | | @Async("pushExecutor") |
| | | @Override |
| | | public void pushWelfareCenter(Long uid, String title, String content, String versions) throws PushException { |
| | | public void pushWelfareCenter(Long uid, String title, String content, String versions, SystemEnum system) throws PushException { |
| | | |
| | | JSONObject json = new JSONObject(); |
| | | json.put("type", PushTypeEnum.welfare.name()); |
| | | json.put("miPushUrl", String.format("%s.ui.mine.WelfareCenterActivity", |
| | | Constant.systemCommonConfig.getAndroidBaseactivityName())); |
| | | getAndroidPackageName(system))); |
| | | // 版本推送 |
| | | if (versions != null && versions.trim().length() > 0) { |
| | | json.put("app_version", versions); |
| | |
| | | info.setContent(content); |
| | | info.setDescription(content); |
| | | // 小米推送网页 |
| | | info.setPackageName(Constant.systemCommonConfig.getAndroidPackageName()); |
| | | info.setPackageName(getAndroidBaseactivityName(system)); |
| | | info.setActivty(String.format("%s.ui.mine.WelfareCenterActivity", |
| | | Constant.systemCommonConfig.getAndroidBaseactivityName())); |
| | | getAndroidPackageName(system))); |
| | | |
| | | PushRecord pushRecord = new PushRecord(); |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void pushUserSignInNotification(Long uid, String title, String content, String versions) |
| | | public void pushUserSignInNotification(Long uid, String title, String content, String versions, SystemEnum system) |
| | | throws PushException { |
| | | JSONObject json = new JSONObject(); |
| | | json.put("type", PushTypeEnum.signin.name()); |
| | | json.put("miPushUrl", String.format("%s.ui.goldtask.GoldTaskActivity", |
| | | Constant.systemCommonConfig.getAndroidBaseactivityName())); |
| | | getAndroidPackageName(system))); |
| | | // 版本推送 |
| | | if (versions != null && versions.trim().length() > 0) { |
| | | json.put("app_version", versions); |
| | |
| | | info.setContent(content); |
| | | info.setDescription(content); |
| | | // 小米推送网页 |
| | | info.setPackageName(Constant.systemCommonConfig.getAndroidPackageName()); |
| | | info.setPackageName(getAndroidBaseactivityName(system)); |
| | | info.setActivty(String.format("%s.ui.goldtask.GoldTaskActivity", |
| | | Constant.systemCommonConfig.getAndroidBaseactivityName())); |
| | | getAndroidPackageName(system))); |
| | | |
| | | PushRecord pushRecord = new PushRecord(); |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | private String getAndroidBaseactivityName(SystemEnum system) { |
| | | return systemConfigService.getValueCache(SystemConfigKeyEnum.androidBaseActivityName, system); |
| | | } |
| | | |
| | | private String getAndroidPackageName(SystemEnum system) { |
| | | return systemConfigService.getValueCache(SystemConfigKeyEnum.androidPackageNames, system); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.entity.SystemPIDInfo; |
| | | import com.yeshi.fanli.service.inter.config.SystemConfigService; |
| | | import com.yeshi.fanli.service.manger.PIDManager; |
| | | import org.springframework.core.task.TaskExecutor; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private UserInfoExtraService userInfoExtraService; |
| | | |
| | | @Resource |
| | | private UserMoneyMsgNotificationService userMoneyMsgNotificationService; |
| | | |
| | | @Resource |
| | | private DeviceActiveService deviceActiveService; |
| | | |
| | | @Resource |
| | |
| | | |
| | | @Resource |
| | | private PIDManager pidManager; |
| | | |
| | | |
| | | |
| | | @Override |
| | |
| | | winDetailVO.setTips(configTaoLiJinService.getValueByKey("new_user_win_tips")); |
| | | winDetailVO.setParams(json.toString()); |
| | | winDetailVO.setJumpDetail(jumpDetailV2Service.getByTypeCache("web")); |
| | | winDetailVO.setLogo(Constant.systemCommonConfig.getDefaultPortrait()); |
| | | winDetailVO.setLogo(userInfoService.getDefaultPortrait(userInfo.getSystem())); |
| | | winDetailVO.setLogoLight(userInfo.getPortrait()); |
| | | return winDetailVO; |
| | | } |
| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import com.yeshi.fanli.service.inter.config.SystemConfigService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.yeshi.utils.HttpUtil; |
| | | import org.yeshi.utils.ListUtil; |
| | |
| | | |
| | | @Resource |
| | | private SpreadImgService spreadImgService; |
| | | |
| | | @Resource |
| | | private SystemConfigService systemConfigService; |
| | | |
| | | @Override |
| | | public void addUserInviteImg(Long uid, String imgUrl) { |
| | |
| | | if (!f.exists()) |
| | | f.mkdirs(); |
| | | |
| | | String defaultPortrait = userInfoService.getDefaultPortrait(uid); |
| | | |
| | | |
| | | // 添加原来没有的 |
| | | for (String md5 : dlist) { |
| | | for (SpreadImg img : spreadImgList) |
| | |
| | | try { |
| | | String portrait = user.getPortrait(); |
| | | if (StringUtil.isNullOrEmpty(portrait)) { |
| | | portrait = Constant.systemCommonConfig.getDefaultPortrait(); |
| | | portrait = defaultPortrait; |
| | | } |
| | | |
| | | // 背景图片缓存 |
| | |
| | | |
| | | // 用户头像 |
| | | UserInfo user = userInfoService.selectByPKey(uid); |
| | | String defaultPortrait = userInfoService.getDefaultPortrait(user.getSystem()); |
| | | String portrait = user.getPortrait(); |
| | | if (StringUtil.isNullOrEmpty(portrait)) { |
| | | portrait = Constant.systemCommonConfig.getDefaultPortrait(); |
| | | portrait = defaultPortrait; |
| | | } |
| | | |
| | | // 邀请码 |
| | |
| | | |
| | | /** |
| | | * 邀请图画图 |
| | | * |
| | | * @param uid |
| | | * @param portrait |
| | | * @param inviteCode |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.entity.config.SystemConfigKeyEnum; |
| | | import com.yeshi.fanli.service.inter.config.SystemConfigService; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.core.task.TaskExecutor; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private SystemCouponService systemCouponService; |
| | | |
| | | @Resource |
| | | private UserInviteMsgNotificationService userInviteMsgNotificationService; |
| | | |
| | | @Resource |
| | | private RedPackGiveRecordService redPackGiveRecordService; |
| | | |
| | | @Resource |
| | | private UserMoneyMsgNotificationService userMoneyMsgNotificationService; |
| | | private SystemConfigService systemConfigService; |
| | | |
| | | @Override |
| | | public void insertSelective(TokenRecord record) { |
| | |
| | | } |
| | | } |
| | | |
| | | SystemEnum system = userInfoService.getUserSystem(rokenRecord.getUid()); |
| | | |
| | | if (StringUtil.isNullOrEmpty(nickName)) |
| | | nickName = Constant.systemCommonConfig.getDefaultNickName() + inviteId; |
| | | nickName = systemConfigService.getValueCache(SystemConfigKeyEnum.defaultNickNamePrefix, system) + inviteId; |
| | | |
| | | if (StringUtil.isNullOrEmpty(portrait)) |
| | | portrait = Constant.systemCommonConfig.getDefaultPortrait(); |
| | | portrait = systemConfigService.getValueCache(SystemConfigKeyEnum.defaultPortrait, system); |
| | | |
| | | if (nickName.length() > 6) { |
| | | nickName = nickName.substring(0, 6) + "..."; |
| | |
| | | import com.yeshi.fanli.entity.system.BusinessSystem; |
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum; |
| | | import com.yeshi.fanli.service.inter.config.ConfigService; |
| | | import com.yeshi.fanli.service.inter.config.SystemConfigService; |
| | | import com.yeshi.fanli.util.*; |
| | | import com.yeshi.fanli.vo.taobao.TaoBaoUser; |
| | | import com.yeshi.fanli.vo.user.QQUserInfoVO; |
| | |
| | | @Resource |
| | | private UserInfoModifyRecordService userInfoModifyRecordService; |
| | | |
| | | |
| | | @Resource |
| | | private SystemConfigService systemConfigService; |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public LoginResult login(HttpServletRequest request, AcceptData acceptData, Boolean first, String appId, |
| | |
| | | if (first != null && first == true) { |
| | | session.removeAttribute("LAST_LOGIN_USER"); |
| | | } |
| | | |
| | | String defaultPortrait = userInfoService.getDefaultPortrait(acceptData.getSystem()); |
| | | |
| | | // 会话中上次登录的用户 |
| | | if (wxinstall) {// 安装了微信的状态 |
| | | UserInfo lastUser = (UserInfo) session.getAttribute("LAST_LOGIN_USER"); |
| | |
| | | if (userInfo == null) {// 原先的账号不存在 |
| | | userInfo = new UserInfo(); |
| | | userInfo.setAppId(appId); |
| | | userInfo.setNickName(Constant.systemCommonConfig.getDefaultNickName()); |
| | | userInfo.setPortrait(Constant.systemCommonConfig.getDefaultPortrait()); |
| | | userInfo.setNickName(null); |
| | | userInfo.setPortrait(defaultPortrait); |
| | | userInfo.setPhone(phone); |
| | | userInfo.setLoginType(loginType); |
| | | userInfo.setSystem(SystemInfoUtil.getSystem(acceptData)); |
| | |
| | | logInfo.put("tbUserInfo", tbUserInfo.getId()); |
| | | logInfo.put("loginType", loginType); |
| | | LogHelper.lgoinInfo(logInfo.toString()); |
| | | |
| | | String defaultPortrait = userInfoService.getDefaultPortrait(acceptData.getSystem()); |
| | | |
| | | UserInfo userInfo = null; |
| | | WeiXinUser weiXinUser = null; |
| | |
| | | break; |
| | | case 3:// 手机号码 |
| | | // 默认头像与昵称 |
| | | userInfo.setPortrait(Constant.systemCommonConfig.getDefaultPortrait()); |
| | | userInfo.setNickName(Constant.systemCommonConfig.getDefaultNickName()); |
| | | userInfo.setPortrait(defaultPortrait); |
| | | userInfo.setNickName(null); |
| | | userInfo.setPhone(phone); |
| | | break; |
| | | } |
| | |
| | | public void addUser(UserInfo user) { |
| | | user.setCreatetime(System.currentTimeMillis()); |
| | | user.setRank(0); |
| | | if (StringUtil.isNullOrEmpty(user.getPortrait())) |
| | | user.setPortrait(Constant.systemCommonConfig.getDefaultPortrait()); |
| | | if (StringUtil.isNullOrEmpty(user.getPortrait())) { |
| | | String defaultPortrait = userInfoService.getDefaultPortrait(user.getSystem()); |
| | | user.setPortrait(defaultPortrait); |
| | | } |
| | | userInfoService.createUser(user, user.getSystem()); |
| | | // 昵称为空时 默认昵称 |
| | | if (StringUtil.isNullOrEmpty(user.getNickName())) { |
| | | UserInfo updateUserInfo = new UserInfo(user.getId()); |
| | | updateUserInfo.setNickName(Constant.systemCommonConfig.getDefaultNickName() + user.getId()); |
| | | String defaultNickName = userInfoService.getDefaultNickName(user.getSystem(), user.getId()); |
| | | updateUserInfo.setNickName(defaultNickName); |
| | | userInfoService.updateByPrimaryKeySelective(updateUserInfo); |
| | | } |
| | | |
| | |
| | | update.setTbPic(""); |
| | | // 判断是否有微信绑定 |
| | | if (StringUtil.isNullOrEmpty(user.getWxUnionId())) { |
| | | update.setNickName(Constant.systemCommonConfig.getDefaultNickName() + user.getId()); |
| | | update.setPortrait(Constant.systemCommonConfig.getDefaultPortrait()); |
| | | update.setNickName(userInfoService.getDefaultNickName(user.getSystem(), user.getId())); |
| | | update.setPortrait(userInfoService.getDefaultPortrait(user.getSystem())); |
| | | } |
| | | |
| | | userInfoService.updateByPrimaryKeySelective(update); |
| | |
| | | updateUserInfo.setWxUnionId(weiXinUser.getUnionid()); |
| | | |
| | | // 将默认昵称替换成微信昵称 |
| | | String defaultNickName = Constant.systemCommonConfig.getDefaultNickName(); |
| | | if (!StringUtil.isNullOrEmpty(defaultNickName) && !StringUtil.isNullOrEmpty(weiXinUser.getNickname())) { |
| | | defaultNickName = defaultNickName + uid; |
| | | if (!StringUtil.isNullOrEmpty(weiXinUser.getNickname())) { |
| | | String defaultNickName = userInfoService.getDefaultNickName(user.getSystem(), uid); |
| | | if ((defaultNickName.equals(user.getNickName()) || "板栗快省".equals(user.getNickName()))) { |
| | | updateUserInfo.setNickName(weiXinUser.getNickname()); |
| | | } |
| | | } |
| | | |
| | | // 将默认头像替换成微信头像 |
| | | String defaultPortrait = Constant.systemCommonConfig.getDefaultPortrait(); |
| | | String defaultPortrait = userInfoService.getDefaultPortrait(user.getSystem()); |
| | | if (!StringUtil.isNullOrEmpty(weiXinUser.getHeadimgurl()) && !StringUtil.isNullOrEmpty(defaultPortrait) |
| | | && defaultPortrait.equals(user.getPortrait())) { |
| | | updateUserInfo.setPortrait(weiXinUser.getHeadimgurl()); |
| | |
| | | @Override |
| | | public String getMobile(String vcode, String phone, String aliAccessToken, SystemEnum system, int vcodeType) throws UserAccountException { |
| | | if (!StringUtil.isNullOrEmpty(aliAccessToken)) { |
| | | |
| | | |
| | | String mobile = AliyunOneKeyLoginUtil.getMobile(aliAccessToken, ""); |
| | | if (StringUtil.isNullOrEmpty(mobile)) { |
| | | throw new UserAccountException(1, "手机号获取失败"); |
| | |
| | | } else { |
| | | userInfo = new UserInfo(); |
| | | userInfo.setAppId(businessSystem.getAppid()); |
| | | userInfo.setPortrait(Constant.systemCommonConfig.getDefaultPortrait()); |
| | | userInfo.setPortrait(null); |
| | | userInfo.setPhone(mobile); |
| | | userInfo.setLoginType(loginType); |
| | | userInfo.setState(UserInfo.STATE_NORMAL); |
| | |
| | | } |
| | | |
| | | if (StringUtil.isNullOrEmpty(portrait)) |
| | | portrait = Constant.systemCommonConfig.getDefaultPortrait(); |
| | | portrait = userInfoService.getDefaultPortrait(businessSystem.getSystem()); |
| | | |
| | | // 创建新账户 |
| | | userInfo = new UserInfo(); |
| | |
| | | updateUserInfo.setWxUnionId(weiXinUser.getUnionid()); |
| | | |
| | | // 将默认昵称替换成微信昵称 |
| | | String defaultNickName = Constant.systemCommonConfig.getDefaultNickName(); |
| | | String defaultNickName = userInfoService.getDefaultNickName(user.getSystem(), user.getId()); |
| | | if (!StringUtil.isNullOrEmpty(defaultNickName) && !StringUtil.isNullOrEmpty(weiXinUser.getNickname())) { |
| | | defaultNickName = defaultNickName + uid; |
| | | if ((defaultNickName.equals(user.getNickName()) || "板栗快省".equals(user.getNickName()))) { |
| | |
| | | } |
| | | |
| | | // 将默认头像替换成微信头像 |
| | | String defaultPortrait = Constant.systemCommonConfig.getDefaultPortrait(); |
| | | String defaultPortrait = userInfoService.getDefaultPortrait(user.getSystem()); |
| | | if (!StringUtil.isNullOrEmpty(weiXinUser.getHeadimgurl()) && !StringUtil.isNullOrEmpty(defaultPortrait) |
| | | && defaultPortrait.equals(user.getPortrait())) { |
| | | String headimgurl = weiXinUser.getHeadimgurl(); |
| | |
| | | updateUserInfo.setQqOpenId(qqUser.getOpenid()); |
| | | |
| | | // 将默认昵称替换成微信昵称 |
| | | String defaultNickName = Constant.systemCommonConfig.getDefaultNickName(); |
| | | String defaultNickName = userInfoService.getDefaultNickName(user.getSystem(), user.getId()); |
| | | if (!StringUtil.isNullOrEmpty(defaultNickName) && !StringUtil.isNullOrEmpty(qqUser.getNickname())) { |
| | | defaultNickName = defaultNickName + uid; |
| | | if ((defaultNickName.equals(user.getNickName()) || "板栗快省".equals(user.getNickName()))) { |
| | |
| | | } |
| | | |
| | | // 将默认头像替换成QQ头像 |
| | | String defaultPortrait = Constant.systemCommonConfig.getDefaultPortrait(); |
| | | String defaultPortrait = userInfoService.getDefaultPortrait(user.getSystem()); |
| | | if (!StringUtil.isNullOrEmpty(qqUser.getFigureurl_2()) && !StringUtil.isNullOrEmpty(defaultPortrait) |
| | | && defaultPortrait.equals(user.getPortrait())) { |
| | | String headimgurl = qqUser.getFigureurl_2(); |
| | |
| | | } |
| | | } |
| | | |
| | | if (StringUtil.isNullOrEmpty(portrait)) |
| | | portrait = Constant.systemCommonConfig.getDefaultPortrait(); |
| | | |
| | | if (StringUtil.isNullOrEmpty(portrait)) { |
| | | portrait = userInfoService.getDefaultPortrait(system); |
| | | } |
| | | // 是否需要创建新账户 |
| | | UserInfo phoneUser = userInfoService.getEffectiveUserInfoByPhone(phone, system); |
| | | UserInfo userInfo = null; |
| | |
| | | } |
| | | } |
| | | |
| | | if (StringUtil.isNullOrEmpty(portrait)) |
| | | portrait = Constant.systemCommonConfig.getDefaultPortrait(); |
| | | |
| | | if (StringUtil.isNullOrEmpty(portrait)) { |
| | | portrait = userInfoService.getDefaultPortrait(system); |
| | | } |
| | | // 创建新账户 |
| | | userInfo = new UserInfo(); |
| | | userInfo.setPhone(phone); |
| | |
| | | |
| | | import com.yeshi.fanli.dao.user.UserGoodsChannelConfigDao; |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.entity.config.SystemConfigKeyEnum; |
| | | import com.yeshi.fanli.entity.goods.UserGoodsChannelConfig; |
| | | import com.yeshi.fanli.service.inter.config.SystemConfigService; |
| | | import com.yeshi.fanli.util.*; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private UserInfoService userInfoService; |
| | | |
| | | @Resource |
| | | private UserAccountService userAccountService; |
| | | |
| | | @Resource |
| | | private ForbiddenUserIdentifyCodeService forbiddenUserIdentifyCodeService; |
| | | |
| | | @Resource |
| | | private UserInviteRecordService userInviteRecordService; |
| | | |
| | | @Resource |
| | |
| | | |
| | | @Resource |
| | | private RocketMQManager rocketMQManager; |
| | | |
| | | @Resource |
| | | private SystemConfigService systemConfigService; |
| | | |
| | | @Override |
| | | public UserInfoExtraVO getRankInfo(Long uid) throws UserInfoExtraException, Exception { |
| | |
| | | updateUserInfo.setWxPic(weiXinUser.getHeadimgurl()); |
| | | |
| | | // 将默认昵称替换成微信昵称 |
| | | String defaultNickName = Constant.systemCommonConfig.getDefaultNickName(); |
| | | String defaultNickName = systemConfigService.getValueCache(SystemConfigKeyEnum.defaultNickNamePrefix, invitee.getSystem()); |
| | | if (!StringUtil.isNullOrEmpty(defaultNickName) && !StringUtil.isNullOrEmpty(weiXinUser.getNickname())) { |
| | | defaultNickName = defaultNickName + uid; |
| | | if ((defaultNickName.equals(invitee.getNickName()) || "返利券".equals(invitee.getNickName()) |
| | | || invitee.getNickName().startsWith(Constant.systemCommonConfig.getDefaultNickName()))) { |
| | | || invitee.getNickName().startsWith(defaultNickName))) { |
| | | updateUserInfo.setNickName(weiXinUser.getNickname()); |
| | | } |
| | | } |
| | | |
| | | // 将默认头像替换成微信头像 |
| | | String defaultPortrait = Constant.systemCommonConfig.getDefaultPortrait(); |
| | | String defaultPortrait = systemConfigService.getValueCache(SystemConfigKeyEnum.defaultPortrait, invitee.getSystem()); |
| | | if (!StringUtil.isNullOrEmpty(weiXinUser.getHeadimgurl()) && !StringUtil.isNullOrEmpty(defaultPortrait) |
| | | && defaultPortrait.equals(invitee.getPortrait())) { |
| | | String headimgurl = weiXinUser.getHeadimgurl(); |
| | |
| | | updateUserInfo.setWxPic(weiXinUser.getHeadimgurl()); |
| | | |
| | | // 将默认昵称替换成微信昵称 |
| | | String defaultNickName = Constant.systemCommonConfig.getDefaultNickName(); |
| | | String defaultNickName = systemConfigService.getValueCache(SystemConfigKeyEnum.defaultNickNamePrefix, invitee.getSystem()); |
| | | if (!StringUtil.isNullOrEmpty(defaultNickName) && !StringUtil.isNullOrEmpty(weiXinUser.getNickname())) { |
| | | defaultNickName = defaultNickName + uid; |
| | | if ((defaultNickName.equals(invitee.getNickName()) || "返利券".equals(invitee.getNickName()) |
| | | || invitee.getNickName().startsWith(Constant.systemCommonConfig.getDefaultNickName()))) { |
| | | || invitee.getNickName().startsWith(defaultNickName))) { |
| | | updateUserInfo.setNickName(weiXinUser.getNickname()); |
| | | } |
| | | } |
| | | |
| | | // 将默认头像替换成微信头像 |
| | | String defaultPortrait = Constant.systemCommonConfig.getDefaultPortrait(); |
| | | String defaultPortrait = systemConfigService.getValueCache(SystemConfigKeyEnum.defaultPortrait, invitee.getSystem()); |
| | | if (!StringUtil.isNullOrEmpty(weiXinUser.getHeadimgurl()) && !StringUtil.isNullOrEmpty(defaultPortrait) |
| | | && defaultPortrait.equals(invitee.getPortrait())) { |
| | | String headimgurl = weiXinUser.getHeadimgurl(); |
| | |
| | | addModifyRecord(uid, ModifyTypeEnum.bindWeiXin, user.getWxUnionId()); |
| | | } |
| | | |
| | | String defaultNickName = userInfoService.getDefaultNickName(user.getSystem(), uid); |
| | | |
| | | if (user.getNickName() != null && !user.getNickName().startsWith("返利券") |
| | | && !user.getNickName().startsWith(Constant.systemCommonConfig.getDefaultNickName())) { |
| | | && !user.getNickName().startsWith(defaultNickName)) { |
| | | addModifyRecord(uid, ModifyTypeEnum.nickName, user.getNickName() + ""); |
| | | } |
| | | |
| | | if (!Constant.systemCommonConfig.getDefaultPortrait().equalsIgnoreCase(user.getPortrait())) { |
| | | String defaultPortrait = userInfoService.getDefaultPortrait(user.getSystem()); |
| | | if (!defaultPortrait.equalsIgnoreCase(user.getPortrait())) { |
| | | addModifyRecord(uid, ModifyTypeEnum.portrait, user.getPortrait()); |
| | | } |
| | | |
| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.entity.config.SystemConfigKeyEnum; |
| | | import com.yeshi.fanli.service.inter.config.SystemConfigService; |
| | | import com.yeshi.fanli.util.*; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.core.task.TaskExecutor; |
| | |
| | | |
| | | @Resource |
| | | private RedisManager redisManager; |
| | | |
| | | @Resource |
| | | private SystemConfigService systemConfigService; |
| | | |
| | | |
| | | public UserInfo getUserByLoginTypeAndOpenId(int loginType, String openid, SystemEnum sysetm) { |
| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public String getDefaultNickName(SystemEnum system, Long uid) { |
| | | return systemConfigService.getValueCache(SystemConfigKeyEnum.defaultNickNamePrefix, system) + uid; |
| | | } |
| | | |
| | | @Override |
| | | public String getDefaultNickName(Long uid) { |
| | | SystemEnum system = getUserSystem(uid); |
| | | return getDefaultNickName(system, uid); |
| | | } |
| | | |
| | | @Override |
| | | public String getDefaultPortrait(SystemEnum system) { |
| | | return systemConfigService.getValueCache(SystemConfigKeyEnum.defaultPortrait, system); |
| | | } |
| | | |
| | | @Override |
| | | public String getDefaultPortrait(Long uid) { |
| | | SystemEnum system = getUserSystem(uid); |
| | | return getDefaultPortrait(system); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.fanli.entity.config.SystemConfigKeyEnum; |
| | | import com.yeshi.fanli.service.inter.config.SystemConfigService; |
| | | import com.yeshi.fanli.util.wx.MyWXLoginUtil; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Resource |
| | | private UserInfoService userInfoService; |
| | | |
| | | @Resource |
| | | private SystemConfigService systemConfigService; |
| | | |
| | | @Async("pushExecutor") |
| | | @Override |
| | | public void saveInviteRecord(String code, String uid) { |
| | |
| | | } |
| | | |
| | | // 获取微信信息 |
| | | WeiXinUser weiXinUser = MyWXLoginUtil.getWeiXinWYUser(code); |
| | | String wxGZAppId = systemConfigService.getValueCache(SystemConfigKeyEnum.wxGZAppId, inviter.getSystem()); |
| | | String wxGZSecretId = systemConfigService.getValueCache(SystemConfigKeyEnum.wxGZAppSecret, inviter.getSystem()); |
| | | |
| | | WeiXinUser weiXinUser = MyWXLoginUtil.getWeiXinWYUser(code, wxGZAppId, wxGZSecretId); |
| | | if (weiXinUser == null) { |
| | | return; |
| | | } |
| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.service.inter.config.SystemConfigService; |
| | | import com.yeshi.fanli.util.SystemInfoUtil; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | @Resource |
| | | private ForbiddenUserIdentifyCodeService forbiddenUserIdentifyCodeService; |
| | | |
| | | @Resource |
| | | private SystemConfigService systemConfigService; |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public WXMPLoginResult wxmpLogin(WXMPLoginData loginData) throws UserAccountException { |
| | |
| | | } else { |
| | | UserInfo userInfo = new UserInfo(); |
| | | userInfo.setAppId(loginData.getAppId()); |
| | | userInfo.setNickName(Constant.systemCommonConfig.getDefaultNickName()); |
| | | userInfo.setPortrait(Constant.systemCommonConfig.getDefaultPortrait()); |
| | | userInfo.setNickName(null); |
| | | userInfo.setPortrait(userInfoService.getDefaultPortrait(system)); |
| | | userInfo.setPhone(loginData.getPhone()); |
| | | |
| | | if (!StringUtil.isNullOrEmpty(loginData.getLastUser().getNickName())) |
| | |
| | | } else {// 新用户 |
| | | userInfo = new UserInfo(); |
| | | userInfo.setAppId(loginData.getAppId()); |
| | | userInfo.setNickName(Constant.systemCommonConfig.getDefaultNickName()); |
| | | userInfo.setPortrait(Constant.systemCommonConfig.getDefaultPortrait()); |
| | | userInfo.setNickName(null); |
| | | userInfo.setPortrait(null); |
| | | userInfo.setPhone(loginData.getPhone()); |
| | | userInfo.setPlatform("wxmp"); |
| | | |
| | |
| | | /** |
| | | * 初始化自定义菜单 |
| | | */ |
| | | public void initMenu(); |
| | | public void initMenu(String wxGZAppId,String wxGZAppsecret); |
| | | |
| | | } |
| | |
| | | package com.yeshi.fanli.service.inter.push; |
| | | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.entity.bus.user.AccountMessage; |
| | | import com.yeshi.fanli.entity.system.SystemZnx; |
| | | import com.yeshi.fanli.exception.push.PushException; |
| | |
| | | * @param content |
| | | * @throws PushException |
| | | */ |
| | | void pushGoods(Long uid, Long auctionId, String title, String content, String versions) throws PushException; |
| | | void pushGoods(Long uid, Long auctionId, String title, String content, String versions, SystemEnum system) throws PushException; |
| | | |
| | | /** |
| | | * 推送链接 |
| | |
| | | * @param content |
| | | * @throws PushException |
| | | */ |
| | | void pushUrl(Long uid, String url, String title, String content, String versions) throws PushException; |
| | | void pushUrl(Long uid, String url, String title, String content, String versions, SystemEnum system) throws PushException; |
| | | |
| | | /** |
| | | * 推送站内信 |
| | |
| | | * @param content |
| | | * @throws PushException |
| | | */ |
| | | void pushZNX(Long uId, AccountMessage msg, SystemZnx systemZNX, String versions) throws PushException; |
| | | void pushZNX(Long uId, AccountMessage msg, SystemZnx systemZNX, String versions, SystemEnum system) throws PushException; |
| | | |
| | | /** |
| | | * 适用版本 1.4.8及以后 推送weex页面 |
| | |
| | | * @param weexUrl |
| | | * @throws PushException |
| | | */ |
| | | void pushWEEX(Long uid, String title, String content, String weexUrl, String versions) throws PushException; |
| | | void pushWEEX(Long uid, String title, String content, String weexUrl, String versions, SystemEnum system) throws PushException; |
| | | |
| | | /** |
| | | * 适用版本 1.4.8及以后 推送百川网页 |
| | |
| | | * @param url |
| | | * @throws PushException |
| | | */ |
| | | void pushBaiChuanUrl(Long uid, String title, String content, String url, String versions) throws PushException; |
| | | void pushBaiChuanUrl(Long uid, String title, String content, String url, String versions, SystemEnum system) throws PushException; |
| | | |
| | | /** |
| | | * 推送福利中心(版本号:1.5.1后) |
| | |
| | | * @param content |
| | | * @throws PushException |
| | | */ |
| | | void pushWelfareCenter(Long uid, String title, String content, String versions) throws PushException; |
| | | void pushWelfareCenter(Long uid, String title, String content, String versions, SystemEnum system) throws PushException; |
| | | |
| | | /** |
| | | * 推送用户签到 |
| | |
| | | * @param versions |
| | | * @throws PushException |
| | | */ |
| | | void pushUserSignInNotification(Long uid, String title, String content, String versions) throws PushException; |
| | | void pushUserSignInNotification(Long uid, String title, String content, String versions, SystemEnum system) throws PushException; |
| | | } |
| | |
| | | |
| | | import com.yeshi.fanli.dto.push.PushBaseContent; |
| | | import com.yeshi.fanli.dto.push.PushContentDetailDTO; |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.exception.push.PushException; |
| | | |
| | | import java.util.List; |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.entity.push.DeviceTokenIOS; |
| | | import com.yeshi.fanli.entity.push.PushQueueRecord; |
| | | import com.yeshi.fanli.exception.push.PushException; |
| | |
| | | * @param pushQueueRecord |
| | | * @throws Exception |
| | | */ |
| | | public void executePushIOS(List<DeviceTokenIOS> list, PushQueueRecord pushQueueRecord, long recordCursor) |
| | | public void executePushIOS(List<DeviceTokenIOS> list, PushQueueRecord pushQueueRecord, long recordCursor,SystemEnum system) |
| | | throws Exception; |
| | | |
| | | /** |
| | |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.fanli.dto.push.PushBaseContent; |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.exception.push.PushException; |
| | | |
| | | /** |
| | |
| | | * @return 用户,如果不存在返回null |
| | | */ |
| | | /** |
| | | * |
| | | * @param loginType |
| | | * @param openid |
| | | * @param sysetm |
| | |
| | | |
| | | /** |
| | | * 根据QQ获取有效用户 |
| | | * |
| | | * @param opneId |
| | | * @param sysetm |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取有效用户(根据淘宝OpenId) |
| | | * |
| | | * @param openId |
| | | * @param sysetm |
| | | * @return |
| | |
| | | |
| | | |
| | | List<UserInfo> listBySystemAndWXUnionId(SystemEnum system, String unionId); |
| | | |
| | | List<UserInfo> listBySystemAndTaoBaoOpenId(SystemEnum system, String openId); |
| | | |
| | | List<UserInfo> listBySystemAndPhone(SystemEnum system, String phone); |
| | | |
| | | /** |
| | | * 根据用户ID获取所在系统 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | public SystemEnum getUserSystem(Long uid); |
| | | |
| | | |
| | | /** |
| | | * 获取默认昵称 |
| | | * @param system |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | public String getDefaultNickName(SystemEnum system, Long uid); |
| | | |
| | | public String getDefaultNickName(Long uid); |
| | | |
| | | /** |
| | | * 获取默认头像 |
| | | * @param system |
| | | * @return |
| | | */ |
| | | public String getDefaultPortrait(SystemEnum system); |
| | | |
| | | public String getDefaultPortrait(Long uid); |
| | | |
| | | } |
| | |
| | | public final static String ADMINH5_AESKEY = "WW782Ss@0*px/,2v"; |
| | | |
| | | public final static String RANDKEY = "user_randkey"; |
| | | public final static String RANDPWDKEY = "user_pwd_randkey"; |
| | | |
| | | public final static String MAIL_SENDER_ACCOUNT = "he15901227708@163.com";// 发送账号 |
| | | public final static String MAIL_SENDER_PWD = "hexiaohui1011";// 发送密码 |
| | | |
| | | public final static String TAOBAO_APP_ID = "23595652"; |
| | | public final static String TAOBAO_APP_SECRET = "a4b2098670284a929a3f5930644ac26d"; |
| | | public final static String TAOBAO_BASEURL = "http://gw.api.taobao.com/router/rest"; |
| | | public final static long TAOBAO_AdzoneId = 70076496L; |
| | | |
| | | public final static int HB_NOTIME = 1; |
| | | public final static int HB_GET = 2; |
| | | public final static int HB_GOT = 3; |
| | | public final static int HB_DISABLE = 4; |
| | | public final static String HB_STATEEXCEPTION = "红包状态异常"; |
| | | public final static String HB_NOEXIST = "红包不存在"; |
| | | public static final int MR_COUNT = 2; |
| | | |
| | | public final static String BA_EXIST = "该类型账户已存在"; |
| | | public final static String BA_SUCCESS = "创建成功"; |
| | |
| | | public final static int WEIXIN = 2; |
| | | public static final String NOTYPE = "不存在该类型"; |
| | | public static final String NOACCOUNT = "不存在该类型账户"; |
| | | public static final String HB_TIMEEXCEPTION = "红包解锁时间未到,还不能打开红包"; |
| | | public static final String DEL = "delete"; |
| | | public static final int EXTRACT_DEFUALT = 0; |
| | | public static final int EXTRACT_PASS = 1; |
| | |
| | | public static final String SESSION_ADMIN = "ADMIN";// 管理员用户的session key |
| | | public static final String SESSION_EXTRACT_CODE = "ADMIN_EXTRACT_CODE"; // 提现码 |
| | | public static final String SESSION_EXTRACT_VERIFY_RESULT = "SESSION_EXTRACT_VERIFY_RESULT"; // 提现码验证结果 |
| | | public static final int NOWHOTSIZE = 10; |
| | | public static final int DAYMS = 86400000; |
| | | public static final int DEFAULT_DAYMS = 1296000000; |
| | | public static final int HOURMS = 3600000; |
| | | public static String Extract_Activty; |
| | | public static String HB_Activity; |
| | | |
| | | public static final String MYLIKE = "mylike"; |
| | | public static final String MYDYNAMIC = "mydynamic"; |
| | | |
| | | |
| | | public static final String TAOBAO_AUTH_APPKEY = "24980167"; |
| | | public static final String TAOBAO_AUTH_APPSECRET = "e0a2e05deabf5ce039b52e5b492d5382"; |
| | | public static final String TAOBAO_RELATION_PID_DEFAULT = "mm_124933865_56750082_87140050199"; |
| | | public static final String TAOBAO_SPECIAL_PID_DEFAULT = "mm_124933865_56750082_89555600043"; |
| | | |
| | | |
| | | public static final long PUSH_MIN_TIME=1000*60*60L*24*30*2; |
| | |
| | | System.out.println("IS_TEST:" + IS_TEST); |
| | | } |
| | | |
| | | Extract_Activty = String.format("%s.ui.mine.MyRedPacketsActivity", |
| | | Constant.systemCommonConfig.getAndroidBaseactivityName()); |
| | | HB_Activity = String.format("%s.ui.main.MainActivity", |
| | | Constant.systemCommonConfig.getAndroidBaseactivityName()); |
| | | } |
| | | |
| | | public static String getSourceName(int sourceType) { |
| | |
| | | SMSLoginCount("sendMSNLoginCount", "登录发送短信次数统计"), |
| | | SMSBindCount("sendMSNBindCount", "绑定手机号发送短信次数统计"), |
| | | SMSBindRemove("sendMSNRemoveCount", "注销手机号发送短信次数统计"), |
| | | oneKeyLoginCount("oneKeyLoginCount-", "一键登录次数"), |
| | | wxmpUserLogin("wxmp-user-login-", "小程序登录"), |
| | | frequencyLimit("frequency-", "频率限制"), |
| | | inviteShortLink("invite-shortlink-", "短连接"), |
| | |
| | | /** |
| | | * 推送商品 |
| | | * |
| | | * @param deviceTokens |
| | | * -最大值1000 |
| | | * @param deviceTokens -最大值1000 |
| | | * @param title |
| | | * @param content |
| | | * @param goodsType |
| | | * @param goodsId |
| | | * @throws PushException |
| | | */ |
| | | public static void pushGoods(List<String> deviceTokens, String title, String content, int goodsType, Long goodsId) |
| | | public static void pushGoods(List<String> deviceTokens, String title, String content, int goodsType, Long goodsId, String androidBaseActivityName) |
| | | throws PushException { |
| | | if (deviceTokens != null && deviceTokens.size() > 100) |
| | | throw new PushException(1, "设备数不能超过100个"); |
| | | |
| | | String activity = Constant.systemCommonConfig.getAndroidBaseactivityName() |
| | | String activity = androidBaseActivityName |
| | | + ".ui.recommend.GoodsBrowserActivity"; |
| | | String intent = getIntent("goodsdetail", activity, null, null, goodsId); |
| | | |
| | |
| | | /** |
| | | * 网页推送 |
| | | * |
| | | * @param deviceTokens |
| | | * 最大值1000 |
| | | * @param deviceTokens 最大值1000 |
| | | * @param title |
| | | * @param content |
| | | * @param url |
| | | * -网页链接 |
| | | * @param url -网页链接 |
| | | * @throws PushException |
| | | */ |
| | | public static void pushUrl(List<String> deviceTokens, String title, String content, String url) |
| | | public static void pushUrl(List<String> deviceTokens, String title, String content, String url, String androidBaseActivityName) |
| | | throws PushException { |
| | | if (deviceTokens != null && deviceTokens.size() > 100) |
| | | throw new PushException(1, "设备数不能超过1000个"); |
| | | |
| | | String activity = Constant.systemCommonConfig.getAndroidBaseactivityName() + ".ui.invite.ShareBrowserActivity"; |
| | | String activity = androidBaseActivityName + ".ui.invite.ShareBrowserActivity"; |
| | | String intent = getIntent("url", activity, null, url, null); |
| | | try { |
| | | String result = sendPushHWMessageForIntent(deviceTokens, title, content, intent); |
| | |
| | | /** |
| | | * 站内信推送 |
| | | * |
| | | * @param deviceTokens |
| | | * 最大值1000 |
| | | * @param deviceTokens 最大值1000 |
| | | * @param title |
| | | * @param content |
| | | * @param url |
| | | * -网页链接 |
| | | * @param url -网页链接 |
| | | * @throws PushException |
| | | */ |
| | | public static void pushZNX(List<String> deviceTokens, String title, String content) throws PushException { |
| | |
| | | } |
| | | } |
| | | |
| | | public static void pushWEEX(List<String> deviceTokens, String title, String content, String weexUrl) |
| | | public static void pushWEEX(List<String> deviceTokens, String title, String content, String weexUrl, String androidBaseActivityName) |
| | | throws PushException { |
| | | String activity = Constant.systemCommonConfig.getAndroidBaseactivityName() + ".ui.mine.weex.WeexApplicationActivity"; |
| | | String activity = androidBaseActivityName + ".ui.mine.weex.WeexApplicationActivity"; |
| | | String intent = getIntent("weex", activity, weexUrl, weexUrl, null); |
| | | if (intent == null) |
| | | return; |
| | |
| | | } |
| | | } |
| | | |
| | | public static void pushWelfareCenter(List<String> deviceTokens, String title, String content) throws PushException { |
| | | String activity = Constant.systemCommonConfig.getAndroidBaseactivityName() + ".ui.mine.WelfareCenterActivity"; |
| | | public static void pushWelfareCenter(List<String> deviceTokens, String title, String content, String androidBaseActivityName) throws PushException { |
| | | String activity = androidBaseActivityName + ".ui.mine.WelfareCenterActivity"; |
| | | String intent = getIntent("welfare", activity, null, null, null); |
| | | if (intent == null) |
| | | return; |
| | |
| | | } |
| | | |
| | | |
| | | public static void pushUserSignInNotification(List<String> deviceTokens, String title, String content) throws PushException { |
| | | String activity = Constant.systemCommonConfig.getAndroidBaseactivityName() + ".ui.goldtask.GoldTaskActivity"; |
| | | public static void pushUserSignInNotification(List<String> deviceTokens, String title, String content, String androidBaseActivityName) throws PushException { |
| | | String activity = androidBaseActivityName + ".ui.goldtask.GoldTaskActivity"; |
| | | String intent = getIntent("signin", activity, null, null, null); |
| | | if (intent == null) |
| | | return; |
| | |
| | | /** |
| | | * 推送设备消息 |
| | | * |
| | | * @param deviceTokens |
| | | * -最大1000条 |
| | | * @param title |
| | | * -标题 |
| | | * @param content |
| | | * -内容 |
| | | * @param intent |
| | | * 如:intent:#Intent;component=com.yeshi.ec.rebate/.myapplication. |
| | | * @param deviceTokens -最大1000条 |
| | | * @param title -标题 |
| | | * @param content -内容 |
| | | * @param intent 如:intent:#Intent;component=com.yeshi.ec.rebate/.myapplication. |
| | | * ui.invite.ShareBrowserActivity;S.url="+URLEncoder.encode("http |
| | | * ://www.baidu.com")+";end |
| | | * @return |
| | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * 方法说明: 获取下发通知消息的认证Token |
| | | * |
| | | * @author mawurui createTime 2018年5月14日 下午4:47:26 |
| | | * @throws IOException |
| | | * @author mawurui createTime 2018年5月14日 下午4:47:26 |
| | | */ |
| | | private static void refreshToken() throws IOException { |
| | | String msgBody = MessageFormat.format("grant_type=client_credentials&client_secret={0}&client_id={1}", |
| | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * 方法说明: IOS 多推 |
| | | * |
| | | * @author mawurui createTime 2018年5月8日 上午10:19:57 |
| | | * @param deviceToken |
| | | * @param packages |
| | | * @param alert |
| | | * @return |
| | | * @throws Exception |
| | | * @author mawurui createTime 2018年5月8日 上午10:19:57 |
| | | */ |
| | | public static String allPushIOS(List<String> deviceTokenList, MessageInfo info, String url, int type) |
| | | public static String allPushIOS(List<String> deviceTokenList, MessageInfo info, String url, int type, String pwd) |
| | | throws Exception { |
| | | |
| | | // if (Constant.IS_TEST) |
| | |
| | | |
| | | InputStream certificate = IOSPushUtil.class.getClassLoader() |
| | | .getResourceAsStream("certificate/pushCertificate.p12"); // 读取.p12文件 |
| | | String certificatePassword = Constant.systemCommonConfig.getIosPushCertificatePwd(); |
| | | String certificatePassword = pwd; |
| | | if (tokenList != null && tokenList.size() > 0) { |
| | | int pageSize = 50; |
| | | int page = tokenList.size() % pageSize == 0 ? tokenList.size() / pageSize : tokenList.size() / pageSize + 1; |
| | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @author mawurui createTime 2018年5月8日 下午12:12:19 |
| | | * @param info |
| | | * @param json |
| | | * @param pushRecord |
| | | * @return |
| | | * @throws Exception |
| | | * @author mawurui createTime 2018年5月8日 下午12:12:19 |
| | | */ |
| | | public static int allFanLiQuanDevice(System b_IOS, List<String> deviceTokenList, String PACKAGES, String title, |
| | | String content, String url, PushRecord pushRecord, int type) throws Exception { |
| | | String content, String url, PushRecord pushRecord, int type,String pwd) throws Exception { |
| | | |
| | | return pushApp(deviceTokenList, PACKAGES, title, content, b_IOS, url, pushRecord, type); |
| | | return pushApp(deviceTokenList, PACKAGES, title, content, b_IOS, url, pushRecord, type,pwd); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param info |
| | | * @param params |
| | | * @param pushRecord |
| | |
| | | * @throws Exception |
| | | */ |
| | | private static int pushApp(List<String> deviceTokenList, String PACKAGES, String title, String content, |
| | | System b_IOS, String url, PushRecord pushRecord, int type) throws Exception { |
| | | System b_IOS, String url, PushRecord pushRecord, int type, String pwd) throws Exception { |
| | | MessageInfo info = new MessageInfo(); |
| | | info.setTitle(title); |
| | | info.setContent(content); |
| | | String IOS = allPushIOS(deviceTokenList, info, url, type); |
| | | String IOS = allPushIOS(deviceTokenList, info, url, type, pwd); |
| | | LogHelper.userInfo("IOS的推送日志:" + IOS); |
| | | pushRecord.setIosPushId(IOS); |
| | | if (IOS != null) { |
| | |
| | | * @param json |
| | | * @throws Exception |
| | | */ |
| | | public static void executePushIOS(List<String> tokenList, JSONObject json) throws Exception { |
| | | public static void executePushIOS(List<String> tokenList, JSONObject json, String pwd) throws Exception { |
| | | InputStream certificate = IOSPushUtil.class.getClassLoader() |
| | | .getResourceAsStream("certificate/pushCertificate.p12"); // 读取.p12文件 |
| | | String certificatePassword = Constant.systemCommonConfig.getIosPushCertificatePwd(); |
| | | String certificatePassword = pwd; |
| | | pushIOS(tokenList, json, certificate, certificatePassword); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * 方法说明: IOS 多推 |
| | | * |
| | | * @author mawurui createTime 2018年5月8日 上午10:19:57 |
| | | * @param deviceToken |
| | | * @param packages |
| | | * @param alert |
| | | * @return |
| | | * @throws Exception |
| | | * @author mawurui createTime 2018年5月8日 上午10:19:57 |
| | | */ |
| | | public static JSONObject getJSONObject(MessageInfo info, String url, int type) throws Exception { |
| | | |
| | |
| | | * @param goodsId |
| | | * @throws PushException |
| | | */ |
| | | public static void pushGoods(List<String> registerIds, String title, String content, int goodsType, Long goodsId) |
| | | public static void pushGoods(List<String> registerIds, String title, String content, int goodsType, Long goodsId,String androidBaseActivity) |
| | | throws PushException { |
| | | if (registerIds != null && registerIds.size() > 100) |
| | | throw new PushException(1, "设备数不能超过100个"); |
| | | |
| | | String activity = Constant.systemCommonConfig.getAndroidBaseactivityName() |
| | | String activity =androidBaseActivity |
| | | + ".ui.recommend.GoodsBrowserActivity"; |
| | | Map<String, String> params = getParams("goodsdetail", activity, null, null, goodsId); |
| | | |
| | |
| | | * -网页链接 |
| | | * @throws PushException |
| | | */ |
| | | public static void pushUrl(List<String> registerIds, String title, String content, String url) |
| | | public static void pushUrl(List<String> registerIds, String title, String content, String url,String androidBaseActivity) |
| | | throws PushException { |
| | | if (registerIds != null && registerIds.size() > 100) |
| | | throw new PushException(1, "设备数不能超过1000个"); |
| | | |
| | | String activity = Constant.systemCommonConfig.getAndroidBaseactivityName() + ".ui.invite.ShareBrowserActivity"; |
| | | String activity =androidBaseActivity + ".ui.invite.ShareBrowserActivity"; |
| | | Map<String, String> params = getParams("url", activity, null, url, null); |
| | | try { |
| | | boolean success = push(registerIds, title, content, params); |
| | |
| | | } |
| | | } |
| | | |
| | | public static void pushWEEX(List<String> registerIds, String title, String content, String weexUrl) |
| | | public static void pushWEEX(List<String> registerIds, String title, String content, String weexUrl,String androidBaseActivity) |
| | | throws PushException { |
| | | String activity = Constant.systemCommonConfig.getAndroidBaseactivityName() |
| | | String activity =androidBaseActivity |
| | | + ".ui.mine.weex.WeexApplicationActivity"; |
| | | Map<String, String> params = getParams("weex", activity, weexUrl, weexUrl, null); |
| | | if (params == null) |
| | |
| | | } |
| | | } |
| | | |
| | | public static void pushWelfareCenter(List<String> registerIds, String title, String content) throws PushException { |
| | | String activity = Constant.systemCommonConfig.getAndroidBaseactivityName() + ".ui.mine.WelfareCenterActivity"; |
| | | public static void pushWelfareCenter(List<String> registerIds, String title, String content,String androidBaseActivity) throws PushException { |
| | | String activity =androidBaseActivity + ".ui.mine.WelfareCenterActivity"; |
| | | Map<String, String> params = getParams("welfare", activity, null, null, null); |
| | | if (params == null) |
| | | return; |
| | |
| | | } |
| | | } |
| | | |
| | | public static void pushUserSignInNotification(List<String> registerIds, String title, String content) |
| | | public static void pushUserSignInNotification(List<String> registerIds, String title, String content,String androidBaseActivity) |
| | | throws PushException { |
| | | String activity = Constant.systemCommonConfig.getAndroidBaseactivityName() + ".ui.goldtask.GoldTaskActivity"; |
| | | String activity =androidBaseActivity + ".ui.goldtask.GoldTaskActivity"; |
| | | Map<String, String> params = getParams("signin", activity, null, null, null); |
| | | if (params == null) |
| | | return; |
| | |
| | | * @throws Exception |
| | | */ |
| | | public static int allPushIOS(MessageInfo info, PushRecord pushRecord, String url, int type, |
| | | List<String> deviceTokenList) throws Exception { |
| | | List<String> deviceTokenList,String pwd) throws Exception { |
| | | |
| | | /* |
| | | * com.yeshi.fanli.entity.system.System b_IOS = |
| | |
| | | if (Constant.IS_TEST) |
| | | return 1; |
| | | |
| | | String IOS = IOSPushUtil.allPushIOS(deviceTokenList, info, url, type); |
| | | String IOS = IOSPushUtil.allPushIOS(deviceTokenList, info, url, type,pwd); |
| | | LogHelper.userInfo("IOS的推送日志:" + IOS); |
| | | pushRecord.setIosPushId(IOS); |
| | | |
| | |
| | | * @return |
| | | */ |
| | | public static String singlePushIOS(MessageInfo info, PushRecord pushRecord, String url, int type, |
| | | List<String> deviceTokenList) { |
| | | List<String> deviceTokenList, String pwd) { |
| | | if (Constant.IS_TEST) |
| | | return null; |
| | | if (deviceTokenList != null && deviceTokenList.size() > 0) { |
| | |
| | | try { |
| | | List<String> deviceList = new ArrayList<>(); |
| | | deviceList.add(deviceToken); |
| | | String IOS = IOSPushUtil.allPushIOS(deviceList, info, url, type); |
| | | String IOS = IOSPushUtil.allPushIOS(deviceList, info, url, type,pwd); |
| | | pushRecord.setIosPushId(IOS); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | * @param goodsId |
| | | * @throws PushException |
| | | */ |
| | | public static void pushGoods(List<String> registerIds, String title, String content, int goodsType, Long goodsId) |
| | | public static void pushGoods(List<String> registerIds, String title, String content, int goodsType, Long goodsId,String androidBaseActivity) |
| | | throws PushException { |
| | | if (registerIds != null && registerIds.size() > 500) |
| | | throw new PushException(1, "设备数不能超过500个"); |
| | | |
| | | String activity = Constant.systemCommonConfig.getAndroidBaseactivityName() |
| | | String activity = androidBaseActivity |
| | | + ".ui.recommend.GoodsBrowserActivity"; |
| | | Message.Builder builder = getMessageBuidler(PushTypeEnum.goodsdetail, title, content, activity, null, null, |
| | | goodsId); |
| | |
| | | * -网页链接 |
| | | * @throws PushException |
| | | */ |
| | | public static void pushUrl(List<String> registerIds, String title, String content, String url) |
| | | public static void pushUrl(List<String> registerIds, String title, String content, String url,String androidBaseActivity) |
| | | throws PushException { |
| | | if (registerIds != null && registerIds.size() > 500) |
| | | throw new PushException(1, "设备数不能超过500个"); |
| | | String activity = Constant.systemCommonConfig.getAndroidBaseactivityName() + ".ui.invite.ShareBrowserActivity"; |
| | | String activity = androidBaseActivity + ".ui.invite.ShareBrowserActivity"; |
| | | Message.Builder builder = getMessageBuidler(PushTypeEnum.url, title, content, activity, null, url, null); |
| | | try { |
| | | boolean success = push(registerIds, builder); |
| | |
| | | } |
| | | } |
| | | |
| | | public static void pushWEEX(List<String> registerIds, String title, String content, String weexUrl) |
| | | public static void pushWEEX(List<String> registerIds, String title, String content, String weexUrl,String androidBaseActivity) |
| | | throws PushException { |
| | | String activity = Constant.systemCommonConfig.getAndroidBaseactivityName() |
| | | String activity = androidBaseActivity |
| | | + ".ui.mine.weex.WeexApplicationActivity"; |
| | | Message.Builder builder = getMessageBuidler(PushTypeEnum.weex, title, content, activity, weexUrl, weexUrl, |
| | | null); |
| | |
| | | } |
| | | } |
| | | |
| | | public static void pushWelfareCenter(List<String> registerIds, String title, String content) throws PushException { |
| | | String activity = Constant.systemCommonConfig.getAndroidBaseactivityName() + ".ui.mine.WelfareCenterActivity"; |
| | | public static void pushWelfareCenter(List<String> registerIds, String title, String content,String androidBaseActivity) throws PushException { |
| | | String activity = androidBaseActivity + ".ui.mine.WelfareCenterActivity"; |
| | | Message.Builder builder = getMessageBuidler(PushTypeEnum.welfare, title, content, activity, null, null, null); |
| | | try { |
| | | boolean success = push(registerIds, builder); |
| | |
| | | } |
| | | } |
| | | |
| | | public static void pushUserSignInNotification(List<String> registerIds, String title, String content) |
| | | public static void pushUserSignInNotification(List<String> registerIds, String title, String content,String androidBaseActivity) |
| | | throws PushException { |
| | | String activity = Constant.systemCommonConfig.getAndroidBaseactivityName() + ".ui.goldtask.GoldTaskActivity"; |
| | | String activity = androidBaseActivity + ".ui.goldtask.GoldTaskActivity"; |
| | | Message.Builder builder = getMessageBuidler(PushTypeEnum.signin, title, content, activity, null, null, null); |
| | | try { |
| | | boolean success = push(registerIds, builder); |
| | |
| | | private static String XIAOMI_F_ANDROID_APP_SECERT = PropertiesUtil.getMap().get("xiaomi_f_android_app_secert"); |
| | | |
| | | /** |
| | | * |
| | | * 方法说明: 小米推送安卓(全推) |
| | | * |
| | | * @author mawurui createTime 2018年3月7日 上午9:57:56 |
| | | * @param info |
| | | * @param params |
| | | * @param system |
| | | * @return |
| | | * @author mawurui createTime 2018年3月7日 上午9:57:56 |
| | | */ |
| | | public static String allPushAndroidForXM(MessageInfo info, Map<String, Object> map) { |
| | | if (Constant.IS_TEST) |
| | | return null; |
| | | |
| | | String name = info.getPackageName(); |
| | | if (!Constant.systemCommonConfig.getAndroidPackageName().equalsIgnoreCase(name) |
| | | && !Constant.systemCommonConfig.getIosBundleId().equalsIgnoreCase(name)) { |
| | | return null; |
| | | } |
| | | |
| | | // 从info中取页面传来的值 |
| | | Constants.useOfficial(); // 启动推送方法 |
| | | String PackageName = info.getPackageName(); |
| | |
| | | * |
| | | * @param info |
| | | * @param map |
| | | * @param regList |
| | | * 最大个数为1000 |
| | | * @param regList 最大个数为1000 |
| | | * @return |
| | | */ |
| | | public static String pushBatchAndroidForXM(MessageInfo info, Map<String, Object> map, List<String> regList) { |
| | |
| | | return ""; |
| | | |
| | | String name = info.getPackageName(); |
| | | if (!Constant.systemCommonConfig.getAndroidPackageName().equalsIgnoreCase(name) |
| | | && !Constant.systemCommonConfig.getIosBundleId().equalsIgnoreCase(name)) { |
| | | return null; |
| | | } |
| | | |
| | | // 从info中取页面传来的值 |
| | | Constants.useOfficial(); // 启动推送方法 |
| | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * 方法说明: 小米推送安卓(单推) |
| | | * |
| | | * @author mawurui createTime 2018年3月7日 下午5:09:18 |
| | | * @param info |
| | | * @param params |
| | | * @param system |
| | | * @return |
| | | * @author mawurui createTime 2018年3月7日 下午5:09:18 |
| | | */ |
| | | public static String singlePushAndroidForXM(MessageInfo info, Map<String, Object> map, List<String> regIds, |
| | | System system) { |
| | | String name = info.getPackageName(); |
| | | if (!Constant.systemCommonConfig.getAndroidPackageName().equalsIgnoreCase(name) |
| | | && !Constant.systemCommonConfig.getIosBundleId().equalsIgnoreCase(name)) { |
| | | return null; |
| | | } |
| | | |
| | | Constants.useOfficial(); // 启动推送方法 |
| | | String PackageName = info.getPackageName(); |
| | | Sender sender = new Sender(XIAOMI_F_ANDROID_APP_SECERT); |
| | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * 方法说明: 小米推送红包 |
| | | * |
| | | * @author mawurui createTime 2018年3月8日 上午9:55:14 |
| | | * @param info |
| | | * @author mawurui createTime 2018年3月8日 上午9:55:14 |
| | | */ |
| | | public static void pushByHongBao(List<String> regIds, System system) { |
| | | MessageInfo info = new MessageInfo(); |
| | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * 方法说明: 小米推送提现申请 |
| | | * |
| | | * @author mawurui createTime 2018年3月8日 上午10:00:16 |
| | | * @param info |
| | | * @author mawurui createTime 2018年3月8日 上午10:00:16 |
| | | */ |
| | | public static void pushByApply(List<String> regIds, System system) { |
| | | MessageInfo info = new MessageInfo(); |
| | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * 方法说明: 推送提现状态 |
| | | * |
| | | * @author mawurui createTime 2018年3月8日 上午10:26:34 |
| | | * @param alias |
| | | * @param state |
| | | * @param system |
| | | * @author mawurui createTime 2018年3月8日 上午10:26:34 |
| | | */ |
| | | public static void pushByExtract(List<String> regIds, int state, System system) { |
| | | MessageInfo info = new MessageInfo(); |
| | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param info |
| | | * @param params |
| | | * @param pushRecord |
| | |
| | | } |
| | | } |
| | | |
| | | public static void pushZNX(List<String> regIds, String title, String content, String msgId) { |
| | | public static void pushZNX(List<String> regIds, String title, String content, String msgId, String androidPackageName, String androidBaseActivityName) { |
| | | // 小米开始推送 |
| | | MessageInfo info = new MessageInfo(); |
| | | info.setActivty( |
| | | String.format("%s.ui.BrowserActivity", Constant.systemCommonConfig.getAndroidBaseactivityName())); |
| | | String.format("%s.ui.BrowserActivity", androidBaseActivityName)); |
| | | info.setTitle(title); |
| | | info.setContent(content); |
| | | info.setPackageName(Constant.systemCommonConfig.getAndroidPackageName()); |
| | | info.setPackageName(androidPackageName); |
| | | JSONObject json = new JSONObject(); |
| | | json.put("type", "ZNX"); |
| | | json.put("miPushUrl", String.format("%s.ui.mine.AppMailDetailActivity", |
| | | Constant.systemCommonConfig.getAndroidBaseactivityName())); |
| | | androidBaseActivityName)); |
| | | |
| | | JSONObject contentJson = new JSONObject(); |
| | | contentJson.put("id", msgId); |
| | |
| | | |
| | | public class MyWXLoginUtil { |
| | | |
| | | public static String WEXIN_APPID = "wx43617e2ed82c5b28"; |
| | | public static String WEXIN_SECRET = "f8a65908fb4681bdd181de70f6ab9a3b"; |
| | | |
| | | static { |
| | | WEXIN_APPID = Constant.systemCommonConfig.getWxGZAppId(); |
| | | WEXIN_SECRET = Constant.systemCommonConfig.getWxGZAppSecret(); |
| | | } |
| | | |
| | | |
| | | public static WeiXinUserParam getWxWYParam(String code) { |
| | | |
| | | WeiXinUserParam weiXinUserParam = WXAppLoginUtil.getWxParam(code, WEXIN_APPID, WEXIN_SECRET); |
| | | public static WeiXinUserParam getWxWYParam(String code, String wxGZAppId, String wxGZAppSecret) { |
| | | WeiXinUserParam weiXinUserParam = WXAppLoginUtil.getWxParam(code, wxGZAppId, wxGZAppSecret); |
| | | return weiXinUserParam; |
| | | } |
| | | |
| | |
| | | return user; |
| | | } |
| | | |
| | | public static WeiXinUser getWeiXinWYUser(String code) { |
| | | WeiXinUserParam param = getWxWYParam(code); |
| | | public static WeiXinUser getWeiXinWYUser(String code, String wxGZAppId, String wxGZAppSecret) { |
| | | WeiXinUserParam param = getWxWYParam(code,wxGZAppId,wxGZAppSecret); |
| | | if (param == null) { |
| | | return null; |
| | | } |
| | |
| | | <result column="value" property="value" jdbcType="VARCHAR"/> |
| | | <result column="name" property="name" jdbcType="VARCHAR"/> |
| | | <result column="updatetime" property="updatetime" jdbcType="BIGINT"/> |
| | | <result column="system" property="system" jdbcType="VARCHAR"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">id,`key`,`value`,`name`,updatetime</sql> |
| | | <sql id="Base_Column_List">id,`key`,`value`,`name`,updatetime,system</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_system_config where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_system_config where id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.system.SystemConfig" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_system_config (id,`key`,`value`,`name`,updatetime) values (#{id,jdbcType=BIGINT},#{key,jdbcType=VARCHAR},#{value,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},#{updatetime,jdbcType=BIGINT})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.system.SystemConfig" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_system_config |
| | | <delete id="deleteByPrimaryKey" |
| | | parameterType="java.lang.Long">delete from yeshi_ec_system_config where id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.system.SystemConfig" useGeneratedKeys="true" |
| | | keyProperty="id">insert into yeshi_ec_system_config (id,`key`,`value`,`name`,updatetime,system) values (#{id,jdbcType=BIGINT},#{key,jdbcType=VARCHAR},#{value,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},#{updatetime,jdbcType=BIGINT},#{system,jdbcType=VARCHAR})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.system.SystemConfig" useGeneratedKeys="true" |
| | | keyProperty="id">insert into yeshi_ec_system_config |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="key != null">`key`,</if> |
| | | <if test="value != null">`value`,</if> |
| | | <if test="name != null">`name`,</if> |
| | | <if test="updatetime != null">updatetime,</if> |
| | | </trim>values |
| | | <if test="system != null">system,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="key != null">#{key,jdbcType=VARCHAR},</if> |
| | | <if test="value != null">#{value,jdbcType=VARCHAR},</if> |
| | | <if test="name != null">#{name,jdbcType=VARCHAR},</if> |
| | | <if test="updatetime != null">#{updatetime,jdbcType=BIGINT},</if> |
| | | <if test="system != null">#{system,jdbcType=VARCHAR},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.system.SystemConfig">update yeshi_ec_system_config set `key` = #{key,jdbcType=VARCHAR},`value` = #{value,jdbcType=VARCHAR},`name` = #{name,jdbcType=VARCHAR},updatetime = #{updatetime,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.system.SystemConfig">update yeshi_ec_system_config |
| | | <update id="updateByPrimaryKey" |
| | | parameterType="com.yeshi.fanli.entity.system.SystemConfig">update yeshi_ec_system_config set `key` = #{key,jdbcType=VARCHAR},`value` = #{value,jdbcType=VARCHAR},`name` = #{name,jdbcType=VARCHAR},updatetime = #{updatetime,jdbcType=BIGINT},`system` = #{system,jdbcType=VARCHAR} where id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.system.SystemConfig">update |
| | | yeshi_ec_system_config |
| | | <set> |
| | | <if test="key != null">`key`=#{key,jdbcType=VARCHAR},</if> |
| | | <if test="value != null">`value`=#{value,jdbcType=VARCHAR},</if> |
| | | <if test="name != null">`name`=#{name,jdbcType=VARCHAR},</if> |
| | | <if test="updatetime != null">updatetime=#{updatetime,jdbcType=BIGINT},</if> |
| | | </set> where id = #{id,jdbcType=BIGINT} |
| | | <if test="system !=null">system =#{system,jdbcType=VARCHAR},</if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <select id="getByKey" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_system_config t |
| | | WHERE t.`key` = #{key} |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <select id="getByKeyAndSystemId" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_system_config t |
| | | LEFT JOIN `yeshi_ec_system_systemconfig` g ON g.`scid` = t.`id` |
| | | WHERE t.`key` = #{key} AND g.`sid` = #{systemId} |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <select id="selectByKeyAndSystem" |
| | | resultMap="BaseResultMap">SELECT * FROM yeshi_ec_system_config t where t.key=#{key} and t.system=#{system}</select> |
| | | </mapper> |
| | |
| | | <result column="b_main_picture" property="picture" jdbcType="VARCHAR" /> |
| | | <result column="b_icon" property="icon" jdbcType="VARCHAR" /> |
| | | <result column="b_sub_picture" property="subPicture" jdbcType="VARCHAR" /> |
| | | <result column="b_bg_color" property="bgColor" jdbcType="VARCHAR" /> |
| | | <result column="b_params" property="params" jdbcType="VARCHAR" /> |
| | | <result column="b_jump_login" property="jumpLogin" jdbcType="VARCHAR" /> |
| | | <result column="b_orderby" property="orderby" jdbcType="INTEGER" /> |
| | |
| | | <result column="b_main_picture" property="picture" jdbcType="VARCHAR" /> |
| | | <result column="b_icon" property="icon" jdbcType="VARCHAR" /> |
| | | <result column="b_sub_picture" property="subPicture" jdbcType="VARCHAR" /> |
| | | <result column="b_bg_color" property="bgColor" jdbcType="VARCHAR" /> |
| | | <result column="b_params" property="params" jdbcType="VARCHAR" /> |
| | | <result column="b_jump_login" property="jumpLogin" jdbcType="VARCHAR" /> |
| | | <result column="b_orderby" property="orderby" jdbcType="INTEGER" /> |
| | |
| | | </resultMap> |
| | | |
| | | |
| | | <sql id="Base_Column_List">b_id,b_name,b_card,b_card_id,b_main_picture,b_icon,b_sub_picture,b_jumpid,b_params,b_jump_login,b_orderby,b_order_man,b_order_woman,b_state,b_sex,b_show_type,b_remark,b_min_android_version_code,b_min_ios_version_code,b_start_time,b_end_time,b_createtime,b_updatetime,b_system</sql> |
| | | <sql id="Base_Column_List">b_id,b_name,b_card,b_card_id,b_main_picture,b_icon,b_sub_picture,b_jumpid,b_params,b_jump_login,b_orderby,b_order_man,b_order_woman,b_state,b_sex,b_show_type,b_remark,b_min_android_version_code,b_min_ios_version_code,b_start_time,b_end_time,b_createtime,b_updatetime,b_system,b_bg_color</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | |
| | | yeshi_ec_special where b_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special" |
| | | useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_special |
| | | (b_id,b_name,b_card,b_card_id,b_main_picture,b_icon,b_sub_picture,b_jumpid,b_params,b_jump_login,b_orderby,b_order_man,b_order_woman,b_state,b_sex,b_show_type,b_remark,b_min_android_version_code,b_min_ios_version_code,b_start_time,b_end_time,b_createtime,b_updatetime,b_system) |
| | | (b_id,b_name,b_card,b_card_id,b_main_picture,b_icon,b_sub_picture,b_jumpid,b_params,b_jump_login,b_orderby,b_order_man,b_order_woman,b_state,b_sex,b_show_type,b_remark,b_min_android_version_code,b_min_ios_version_code,b_start_time,b_end_time,b_createtime,b_updatetime,b_system,b_bg_color) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{card,jdbcType=VARCHAR},#{cardId,jdbcType=BIGINT},#{picture,jdbcType=VARCHAR},#{icon,jdbcType=VARCHAR},#{subPicture,jdbcType=VARCHAR},#{jumpDetail.id,jdbcType=BIGINT},#{params,jdbcType=VARCHAR},#{jumpLogin,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{orderMan,jdbcType=INTEGER},#{orderWoman,jdbcType=INTEGER},#{state,jdbcType=BIGINT},#{sex,jdbcType=INTEGER},#{showType,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{minAndroidVersionCode,jdbcType=INTEGER},#{minIOSVersionCode,jdbcType=INTEGER},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP},#{system,jdbcType=VARCHAR})</insert> |
| | | (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{card,jdbcType=VARCHAR},#{cardId,jdbcType=BIGINT},#{picture,jdbcType=VARCHAR},#{icon,jdbcType=VARCHAR},#{subPicture,jdbcType=VARCHAR},#{jumpDetail.id,jdbcType=BIGINT},#{params,jdbcType=VARCHAR},#{jumpLogin,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{orderMan,jdbcType=INTEGER},#{orderWoman,jdbcType=INTEGER},#{state,jdbcType=BIGINT},#{sex,jdbcType=INTEGER},#{showType,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{minAndroidVersionCode,jdbcType=INTEGER},#{minIOSVersionCode,jdbcType=INTEGER},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP},#{system,jdbcType=VARCHAR},#{bgColor,jdbcType=VARCHAR})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | | insert into yeshi_ec_special |
| | |
| | | <if test="picture != null">b_main_picture,</if> |
| | | <if test="icon != null">b_icon,</if> |
| | | <if test="subPicture != null">b_sub_picture,</if> |
| | | <if test="bgColor != null">b_bg_color,</if> |
| | | <if test="jumpDetail != null">b_jumpid,</if> |
| | | <if test="params != null">b_params,</if> |
| | | <if test="jumpLogin != null">b_jump_login,</if> |
| | |
| | | <if test="picture != null">#{picture,jdbcType=VARCHAR},</if> |
| | | <if test="icon != null">#{icon,jdbcType=VARCHAR},</if> |
| | | <if test="subPicture != null">#{subPicture,jdbcType=VARCHAR},</if> |
| | | <if test="bgColor != null">#{bgColor,jdbcType=VARCHAR},</if> |
| | | <if test="jumpDetail != null">#{jumpDetail.id,jdbcType=BIGINT},</if> |
| | | <if test="params != null">#{params,jdbcType=VARCHAR},</if> |
| | | <if test="jumpLogin != null">#{jumpLogin,jdbcType=VARCHAR},</if> |
| | |
| | | #{remark,jdbcType=VARCHAR},b_min_android_version_code = #{minAndroidVersionCode,jdbcType=INTEGER},b_min_ios_version_code = #{minIOSVersionCode,jdbcType=INTEGER}, |
| | | b_start_time = #{startTime,jdbcType=TIMESTAMP},b_end_time = #{endTime,jdbcType=TIMESTAMP},b_createtime = |
| | | #{createtime,jdbcType=TIMESTAMP},b_updatetime = |
| | | #{updatetime,jdbcType=TIMESTAMP},b_sex=#{sex,jdbcType=INTEGER},b_system=#{system,jdbcType=VARCHAR} where |
| | | #{updatetime,jdbcType=TIMESTAMP},b_sex=#{sex,jdbcType=INTEGER},b_system=#{system,jdbcType=VARCHAR},b_bg_color=#{bgColor,jdbcType=VARCHAR} |
| | | |
| | | where |
| | | b_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special"> |
| | | update yeshi_ec_special |
| | |
| | | <if test="picture != null">b_main_picture=#{picture,jdbcType=VARCHAR},</if> |
| | | <if test="icon != null">b_icon=#{icon,jdbcType=VARCHAR},</if> |
| | | <if test="subPicture != null">b_sub_picture=#{subPicture,jdbcType=VARCHAR},</if> |
| | | <if test="bgColor != null">b_bg_color=#{bgColor,jdbcType=VARCHAR},</if> |
| | | <if test="jumpDetail != null">b_jumpid=#{jumpDetail.id,jdbcType=BIGINT},</if> |
| | | <if test="params != null">b_params=#{params,jdbcType=VARCHAR},</if> |
| | | <if test="jumpLogin != null">b_jump_login=#{jumpLogin,jdbcType=VARCHAR},</if> |
| | |
| | | <result column="qe_state" property="state" jdbcType="INTEGER"/> |
| | | <result column="qe_createtime" property="createtime" jdbcType="TIMESTAMP"/> |
| | | <result column="qe_endtime" property="endtime" jdbcType="TIMESTAMP"/> |
| | | <result column="qe_versions" property="versions" jdbcType="VARCHAR"/> |
| | | <result column="qe_system" property="system" jdbcType="VARCHAR"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">qe_id,qe_type,qe_content,qe_start_cursor,qe_end_cursor,qe_record_cursor,qe_push_num,qe_state,qe_createtime,qe_endtime</sql> |
| | | <sql id="Base_Column_List">qe_id,qe_type,qe_content,qe_start_cursor,qe_end_cursor,qe_record_cursor,qe_push_num,qe_state,qe_createtime,qe_endtime,qe_versions,qe_system</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_push_queue where qe_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_push_queue where qe_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.push.PushQueueRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_push_queue (qe_id,qe_type,qe_content,qe_start_cursor,qe_end_cursor,qe_record_cursor,qe_push_num,qe_state,qe_createtime,qe_endtime) values (#{id,jdbcType=BIGINT},#{type,jdbcType=INTEGER},#{jsonContent,jdbcType=VARCHAR},#{startCursor,jdbcType=BIGINT},#{endCursor,jdbcType=BIGINT},#{recordCursor,jdbcType=BIGINT},#{pushNum,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createtime,jdbcType=TIMESTAMP},#{endtime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.push.PushQueueRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_push_queue |
| | | <delete id="deleteByPrimaryKey" |
| | | parameterType="java.lang.Long">delete from yeshi_ec_push_queue where qe_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.push.PushQueueRecord" useGeneratedKeys="true" |
| | | keyProperty="id">insert into yeshi_ec_push_queue (qe_id,qe_type,qe_content,qe_start_cursor,qe_end_cursor,qe_record_cursor,qe_push_num,qe_state,qe_createtime,qe_endtime,qe_id,qe_versions,qe_system) values (#{id,jdbcType=BIGINT},#{type,jdbcType=INTEGER},#{jsonContent,jdbcType=VARCHAR},#{startCursor,jdbcType=BIGINT},#{endCursor,jdbcType=BIGINT},#{recordCursor,jdbcType=BIGINT},#{pushNum,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createtime,jdbcType=TIMESTAMP},#{endtime,jdbcType=TIMESTAMP},#{id,jdbcType=BIGINT},#{versions,jdbcType=VARCHAR},#{system,jdbcType=VARCHAR})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.push.PushQueueRecord" useGeneratedKeys="true" |
| | | keyProperty="id">insert into yeshi_ec_push_queue |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">qe_id,</if> |
| | | <if test="type != null">qe_type,</if> |
| | |
| | | <if test="state != null">qe_state,</if> |
| | | <if test="createtime != null">qe_createtime,</if> |
| | | <if test="endtime != null">qe_endtime,</if> |
| | | </trim>values |
| | | <if test="versions != null">qe_versions,</if> |
| | | <if test="system != null">qe_system,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="type != null">#{type,jdbcType=INTEGER},</if> |
| | |
| | | <if test="state != null">#{state,jdbcType=INTEGER},</if> |
| | | <if test="createtime != null">#{createtime,jdbcType=TIMESTAMP},</if> |
| | | <if test="endtime != null">#{endtime,jdbcType=TIMESTAMP},</if> |
| | | <if test="versions != null">#{versions,jdbcType=VARCHAR},</if> |
| | | <if test="system != null">#{system,jdbcType=VARCHAR},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.push.PushQueueRecord">update yeshi_ec_push_queue set qe_type = #{type,jdbcType=INTEGER},qe_content = #{jsonContent,jdbcType=VARCHAR},qe_start_cursor = #{startCursor,jdbcType=BIGINT},qe_end_cursor = #{endCursor,jdbcType=BIGINT},qe_record_cursor = #{recordCursor,jdbcType=BIGINT},qe_push_num = #{pushNum,jdbcType=INTEGER},qe_state = #{state,jdbcType=INTEGER},qe_createtime = #{createtime,jdbcType=TIMESTAMP},qe_endtime = #{endtime,jdbcType=TIMESTAMP} where qe_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.push.PushQueueRecord">update yeshi_ec_push_queue |
| | | <update id="updateByPrimaryKey" |
| | | parameterType="com.yeshi.fanli.entity.push.PushQueueRecord">update yeshi_ec_push_queue set qe_type = #{type,jdbcType=INTEGER},qe_content = #{jsonContent,jdbcType=VARCHAR},qe_start_cursor = #{startCursor,jdbcType=BIGINT},qe_end_cursor = #{endCursor,jdbcType=BIGINT},qe_record_cursor = #{recordCursor,jdbcType=BIGINT},qe_push_num = #{pushNum,jdbcType=INTEGER},qe_state = #{state,jdbcType=INTEGER},qe_createtime = #{createtime,jdbcType=TIMESTAMP},qe_endtime = #{endtime,jdbcType=TIMESTAMP} ,qe_versions =#{versions,jdbcType=VARCHAR} ,qe_system =#{system,jdbcType=VARCHAR} where qe_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.push.PushQueueRecord">update |
| | | yeshi_ec_push_queue |
| | | <set> |
| | | <if test="type != null">qe_type=#{type,jdbcType=INTEGER},</if> |
| | | <if test="jsonContent != null">qe_content=#{jsonContent,jdbcType=VARCHAR},</if> |
| | |
| | | <if test="state != null">qe_state=#{state,jdbcType=INTEGER},</if> |
| | | <if test="createtime != null">qe_createtime=#{createtime,jdbcType=TIMESTAMP},</if> |
| | | <if test="endtime != null">qe_endtime=#{endtime,jdbcType=TIMESTAMP},</if> |
| | | </set> where qe_id = #{id,jdbcType=BIGINT} |
| | | <if test="versions !=null">qe_versions =#{versions,jdbcType=VARCHAR},</if> |
| | | <if test="system !=null">qe_system =#{system,jdbcType=VARCHAR},</if> |
| | | </set> |
| | | where qe_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |