| | |
| | | //平台规则
|
| | | String platformRuleLink = configService.get(ConfigKeyEnum.platformRule.getKey());
|
| | | data.put("platformRule", platformRuleLink);
|
| | | |
| | | |
| | | } |
| | |
|
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion()) && uid != null) {
|
| | |
| | | @Map("money_tearcher_subsidy_recieved_msg")
|
| | | private String moneyTearcherSubsidyRecievedMsg;
|
| | |
|
| | | // 系统补齐
|
| | | @Map("money_system_compensate_title")
|
| | | private String moneySystemCompensateTitle;
|
| | | @Map("money_system_compensate_msg")
|
| | | private String moneySystemCompensateMsg;
|
| | |
|
| | | // 提现成功
|
| | | @Map("money_extract_success_title")
|
| | | private String moneyExtractSuccessTitle;
|
| | | @Map("money_extract_success_msg")
|
| | | private String moneyExtractSuccessMsg;
|
| | | |
| | | // 系统补齐
|
| | | @Map("money_system_compensate_title")
|
| | | private String moneySystemCompensateTitle;
|
| | | @Map("money_system_compensate_msg")
|
| | | private String moneySystemCompensateMsg;
|
| | |
|
| | |
|
| | | // 邀请队员成功
|
| | | @Map("invite_team_success_title")
|
| | | private String inviteTeamSuccessTitle;
|
| | | @Map("invite_team_success_msg")
|
| | | private String inviteTeamSuccessMsg;
|
| | | |
| | | //系统消息
|
| | | @Map("system_message_title")
|
| | | private String systemMessageTitle;
|
| | | @Map("system_message_msg")
|
| | | private String systemMessageMsg;
|
| | |
|
| | | public String getMoneyTeamDividentsRecievedTitle() {
|
| | | return moneyTeamDividentsRecievedTitle;
|
| | |
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | |
| | | PushContentDTO dto = PushMsgFactory.createMoneyExtractSuccess(new Date(extract.getExtractTime()),
|
| | | extract.getMoney(), extract.getAccount());
|
| | | try {
|
| | |
| | | package com.yeshi.fanli.service.impl.push;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.scheduling.annotation.Async;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dto.push.PushTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.AccountMessage;
|
| | | import com.yeshi.fanli.entity.push.DeviceTokenXM;
|
| | | import com.yeshi.fanli.entity.system.SystemZnx;
|
| | | import com.yeshi.fanli.entity.xinge.MessageInfo;
|
| | | import com.yeshi.fanli.entity.xinge.PushRecord;
|
| | | import com.yeshi.fanli.exception.push.PushException;
|
| | | import com.yeshi.fanli.log.PushLogHelper;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenXMService;
|
| | | import com.yeshi.fanli.service.inter.push.XMPushService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.push.PushUtils;
|
| | |
| | |
|
| | | @Service
|
| | | public class XMPushServiceImpl implements XMPushService {
|
| | |
|
| | | @Resource
|
| | | private DeviceTokenXMService deviceTokenXMService;
|
| | |
|
| | | private List<String> getRegIds(Long uid) {
|
| | | List<DeviceTokenXM> list = deviceTokenXMService.listByUid(uid);
|
| | |
|
| | | List<String> regIds = new ArrayList<>();
|
| | | if (list != null)
|
| | | for (DeviceTokenXM token : list)
|
| | | regIds.add(token.getRegisterId());
|
| | | return regIds;
|
| | | }
|
| | |
|
| | | @Async("pushExecutor")
|
| | | @Override
|
| | |
| | | } else {
|
| | | info.setAlias(uid + "");
|
| | | // 小米 单推
|
| | | PushUtils.singlePushXiaoMi(info, json, pushRecord);
|
| | | PushUtils.singlePushXiaoMi(info, json, getRegIds(uid), pushRecord);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | } else {
|
| | | info.setAlias(uid + "");
|
| | | PushUtils.singlePushXiaoMi(info, json, pushRecord);
|
| | | PushUtils.singlePushXiaoMi(info, json, getRegIds(uid), pushRecord);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | // 小米 单推
|
| | | try {
|
| | | PushUtils.singlePushXiaoMi(info, json, pushRecord);
|
| | | PushUtils.singlePushXiaoMi(info, json, getRegIds(uId), pushRecord);
|
| | | } catch (Exception e) {
|
| | | PushLogHelper.xmError(e);
|
| | | }
|
| | |
| | | }
|
| | | } else {
|
| | | info.setAlias(uid + "");
|
| | | PushUtils.singlePushXiaoMi(info, json, pushRecord);
|
| | | PushUtils.singlePushXiaoMi(info, json, getRegIds(uid), pushRecord);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | } else {
|
| | | info.setAlias(uid + "");
|
| | | PushUtils.singlePushXiaoMi(info, json, pushRecord);
|
| | | PushUtils.singlePushXiaoMi(info, json, getRegIds(uid), pushRecord);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | } else {
|
| | | info.setAlias(uid + "");
|
| | | PushUtils.singlePushXiaoMi(info, json, pushRecord);
|
| | | PushUtils.singlePushXiaoMi(info, json, getRegIds(uid), pushRecord);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | } else {
|
| | | info.setAlias(uid + "");
|
| | | PushUtils.singlePushXiaoMi(info, json, pushRecord);
|
| | | PushUtils.singlePushXiaoMi(info, json, getRegIds(uid), pushRecord);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | package com.yeshi.fanli.service.inter.user;
|
| | |
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpSession;
|
| | |
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.LoginResult;
|
| | |
| | | * @param json
|
| | | * @return
|
| | | */
|
| | | public static int singlePushXiaoMi(MessageInfo info, JSONObject json, PushRecord pushRecord) {
|
| | | if (Constant.IS_TEST)
|
| | | return 1;
|
| | | public static int singlePushXiaoMi(MessageInfo info, JSONObject json,List<String> regIds, PushRecord pushRecord) {
|
| | | // if (Constant.IS_TEST)
|
| | | // return 1;
|
| | |
|
| | | JSONObject mapXm = JSONObject.fromObject(json);
|
| | |
|
| | | String android = XiaoMiPushUtil.singlePushAndroidForXM(info, mapXm, null);
|
| | | String android = XiaoMiPushUtil.singlePushAndroidForXM(info, mapXm,regIds, null);
|
| | |
|
| | | LogHelper.userInfo("安卓推送测试:" + android);
|
| | | pushRecord.setAndroidPushId(android);
|
| | |
| | | * @param system
|
| | | * @return
|
| | | */
|
| | | public static String singlePushAndroidForXM(MessageInfo info, Map<String, Object> map, System system) {
|
| | | 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)) {
|
| | |
| | | }
|
| | | message = builder.build();
|
| | | try {
|
| | | Result result = sender.sendToAlias(message, uId, 3);
|
| | | Result result = sender.send(message, regIds, 3); // sender.sendToAlias(message,
|
| | | // uId, 3);
|
| | | PushLogHelper.xmInfo("推送结果:" + result.getReason());
|
| | | return result.getMessageId();
|
| | | } catch (IOException e) {
|
| | |
| | | * @author mawurui createTime 2018年3月8日 上午9:55:14
|
| | | * @param info
|
| | | */
|
| | | public static void pushByHongBao(String alias, System system) {
|
| | | public static void pushByHongBao(List<String> regIds, System system) {
|
| | | MessageInfo info = new MessageInfo();
|
| | | info.setAlias(alias);
|
| | | info.setTitle("新到红包");
|
| | | info.setDescription("红包到来了...");
|
| | | JSONObject jsonObject = new JSONObject();
|
| | | jsonObject.put("type", "hongbao");
|
| | | XiaoMiPushUtil.singlePushAndroidForXM(info, JsonUtil.parseData(jsonObject), system);
|
| | | XiaoMiPushUtil.singlePushAndroidForXM(info, JsonUtil.parseData(jsonObject), regIds, system);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | * @author mawurui createTime 2018年3月8日 上午10:00:16
|
| | | * @param info
|
| | | */
|
| | | public static void pushByApply(String alias, System system) {
|
| | | public static void pushByApply(List<String> regIds, System system) {
|
| | | MessageInfo info = new MessageInfo();
|
| | | info.setAlias(alias);
|
| | | info.setTitle("提现申请");
|
| | | info.setDescription("提现审核中...");
|
| | | JSONObject jsonObject = new JSONObject();
|
| | | jsonObject.put("type", "cash");
|
| | | XiaoMiPushUtil.singlePushAndroidForXM(info, JsonUtil.parseData(jsonObject), system);
|
| | | XiaoMiPushUtil.singlePushAndroidForXM(info, JsonUtil.parseData(jsonObject), regIds, system);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | * @param state
|
| | | * @param system
|
| | | */
|
| | | public static void pushByExtract(String alias, int state, System system) {
|
| | | public static void pushByExtract(List<String> regIds, int state, System system) {
|
| | | MessageInfo info = new MessageInfo();
|
| | | info.setAlias(alias);
|
| | | if (state == 0) {
|
| | | info.setTitle("提现成功");
|
| | | info.setDescription("您有一笔交易,已提现成功!");
|
| | |
| | | }
|
| | | JSONObject jsonObject = new JSONObject();
|
| | | jsonObject.put("type", "cash");
|
| | | XiaoMiPushUtil.singlePushAndroidForXM(info, JsonUtil.parseData(jsonObject), system);
|
| | | XiaoMiPushUtil.singlePushAndroidForXM(info, JsonUtil.parseData(jsonObject), regIds, system);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public static void pushZNX(Long uid, String title, String content, String msgId) {
|
| | | public static void pushZNX(List<String> regIds, String title, String content, String msgId) {
|
| | | // 小米开始推送
|
| | | MessageInfo info = new MessageInfo();
|
| | | info.setActivty(
|
| | | String.format("%s.ui.BrowserActivity", Constant.systemCommonConfig.getAndroidBaseactivityName()));
|
| | | info.setAlias(uid + "");
|
| | | info.setTitle(title);
|
| | | info.setContent(content);
|
| | | info.setPackageName(Constant.systemCommonConfig.getAndroidPackageName());
|
| | |
| | | contentJson.put("createTime", java.lang.System.currentTimeMillis());
|
| | | json.put("content", contentJson);
|
| | | JSONObject mapXm = JSONObject.fromObject(json);
|
| | | XiaoMiPushUtil.singlePushAndroidForXM(info, mapXm, null);
|
| | | XiaoMiPushUtil.singlePushAndroidForXM(info, mapXm,regIds, null);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | } catch (Exception e) {
|
| | |
|
| | | }
|
| | | } else {// 都有券
|
| | | long time = System.currentTimeMillis();
|
| | | // 券在有效期内并且还有剩余券
|
| | | if (time >= TimeUtil.convertToTimeTemp(v2.getCouponStartTime(), "yyyy-MM-dd HH:mm:ss")
|
| | | && time <= TimeUtil.convertToTimeTemp(v2.getCouponEndTime(), "yyyy-MM-dd HH:mm:ss")
|
| | | && (v2.getCouponTotalNum() - v2.getCouponReceiveNum()) > 0) {
|
| | | // 如果两个券的面额一样,淘宝原价比大淘客原价高,就以大淘客原价为准
|
| | | if (goods.getCouponAmount() != null && v2.getCouponPrice() != null
|
| | | && goods.getCouponAmount().compareTo(v2.getCouponPrice()) == 0) {
|
| | |
|
| | | if (goods.getZkPrice().compareTo(v2.getOriginalPrice()) > 0) {
|
| | | goods.setZkPrice(v2.getOriginalPrice());
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | return goods;
|
| | |
| | |
|
| | | #邀请奖金到账
|
| | | money_invite_recieved_title=恭喜,有新收入了!
|
| | | money_invite_recieved_msg=团队收益存入了账户余额
|
| | | money_invite_recieved_msg=团队奖金存入了账户余额
|
| | |
|
| | | #团队分红
|
| | | money_team_dividents_recieved_title=恭喜,有新收入了!
|
| | |
| | | #系统消息
|
| | | system_message_title=你有一条重要的消息未读
|
| | | system_message_msg=请到消息-系统消息中查看
|
| | |
|
| | |
|
| | | #----------------删除开始------------------
|
| | |
|
| | | #系统扣除
|
| | | money_system_sub_title=系统扣除
|
| | | money_system_sub_msg=因[原因],系统需从你账户中扣除[金额]元,敬请知晓,如有疑问联系人工客服。
|
| | |
|
| | | #系统奖励
|
| | | money_system_reward_title=系统奖励
|
| | | money_system_reward_msg=因[原因],奖励金额[金额]元,已存入到你的账户余额中,请注意查收。
|
| | |
|
| | | #维权扣除
|
| | | money_weiquan_title=维权扣除
|
| | | money_weiquan_msg=你的[订单类型]订单[订单号],[部分]维权成功,对应[金额]元已扣除,请到账户明细中查看。 |
| | |
|
| | |
|
| | | #提现失败
|
| | | money_extract_fail_title=提现失败
|
| | | money_extract_fail_msg=你于[提现时间]提现[金额]元,提现失败,如有疑问联系人工客服。
|
| | |
|
| | |
|
| | |
|
| | | #现金红包
|
| | | hongbao_recieved_title=现金红包
|
| | | hongbao_recieved_msg=因[原因],奖励你[金额]元红包一共,已存入到你的账户余额中,感谢你支持与信任。
|
| | |
|
| | |
|
| | | #支付宝账号验证
|
| | | alipay_account_valid_title=提现账号验证
|
| | | alipay_account_valid_msg=系统已向你提现[提现支付宝账号]成功转账[金额]元,即提现账号成功绑定,感谢使用和信任。
|
| | |
|
| | |
|
| | | #积分兑换成功
|
| | | score_exchange_success_title=兑换成功
|
| | | score_exchange_success_msg=你于[时间]发起的积分兑换已成功,本次兑换共消耗[积分数额][积分单位],感谢使用和信任。
|
| | |
|
| | |
|
| | | #积分兑换失败
|
| | | score_exchange_fail_title=兑换失败
|
| | | score_exchange_fail_msg=你于[时间]发起的积分兑换失败,失败原因:[原因],如有疑问请联系人工客服。
|
| | |
|
| | |
|
| | | #功能开通成功
|
| | | function_get_success_title=开通成功
|
| | | function_get_success_msg=你于成功开通[增值功能],感谢使用和信任。
|
| | |
|
| | |
|
| | | #功能开通失败
|
| | | function_get_fail_title=开通失败
|
| | | function_get_fail_msg=你未能开通[增值功能],如有疑问请联系人工客服。
|
| | |
|
| | |
|
| | | #客服唤起
|
| | | msg_kefu_title=客服信息
|
| | | msg_kefu_msg=人工客服发来了一条消息,请注意查阅(我的-人工客服),以便解决你的疑问。
|
| | |
|
| | | #----------------删除结束------------------
|