| | |
| | | return;
|
| | | }
|
| | | UserMsgUnReadNum num = userMsgReadStateService.getReadStateByUid(uid);
|
| | | JSONObject data = JSONObject.fromObject(JsonUtil.getApiCommonGson().toJson(num));
|
| | | data.put("totalCount", num.getTypeAccount() + num.getTypeInvite() + num.getTypeMoney() + num.getTypeOrder()
|
| | | + num.getTypeScore() + num.getTypeSystem() + num.getTypeOther());
|
| | |
|
| | | GsonBuilder androidBuilder = new GsonBuilder().registerTypeAdapter(Integer.class,
|
| | | new JsonSerializer<Integer>() {
|
| | | @Override
|
| | | public JsonElement serialize(Integer value, Type theType, JsonSerializationContext context) {
|
| | | if (value == null) {
|
| | | return new JsonPrimitive("0");
|
| | | } else {
|
| | | if (value >= 100)
|
| | | return new JsonPrimitive("99+");
|
| | | else
|
| | | return new JsonPrimitive(value);
|
| | | }
|
| | | }
|
| | | });
|
| | | int totalCount = num.getTypeAccount() + num.getTypeInvite() + num.getTypeMoney() + num.getTypeOrder()
|
| | | + num.getTypeScore() + num.getTypeSystem() + num.getTypeOther();
|
| | | JSONObject data = null;
|
| | | if ("android".equalsIgnoreCase(acceptData.getPlatform())) {
|
| | | data = JSONObject.fromObject(androidBuilder.excludeFieldsWithoutExposeAnnotation().create().toJson(num));
|
| | | data.put("totalCount", totalCount > 99 ? "99+" : totalCount);
|
| | | } else {
|
| | | data = JSONObject.fromObject(JsonUtil.getApiCommonGson().toJson(num));
|
| | | data.put("totalCount", totalCount);
|
| | | }
|
| | |
|
| | | try {
|
| | | UserSettingsVO vo = userCustomSettingsService.getMySettings(uid);
|
| | |
| | | coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
|
| | | try {
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
|
| | | coupon.getId(), dto, MsgTypeOtherTypeEnum.couponReward, "返利已到账后再奖励返利" + percent + "%"));
|
| | | coupon.getId(), dto, MsgTypeOtherTypeEnum.couponReward, "返利已到账后再奖励返利的" + percent + "%"));
|
| | | } catch (MsgOtherDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | getLeftDay(coupon), coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
|
| | | try {
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
|
| | | coupon.getId(), dto, MsgTypeOtherTypeEnum.couponReward, "返利已到账后再奖励返利" + percent + "%"));
|
| | | coupon.getId(), dto, MsgTypeOtherTypeEnum.couponReward, "返利已到账后再奖励返利的" + percent + "%"));
|
| | | } catch (MsgOtherDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | |
|
| | | @Override
|
| | | public void pushBaiChuanUrl(Long uid, String title, String content, String url) throws PushException {
|
| | | // iosPushService.pushBaiChuanUrl(uid, title, content, url);
|
| | | iosPushService.pushBaiChuanUrl(uid, title, content, url);
|
| | | xmPushService.pushBaiChuanUrl(uid, title, content, url);
|
| | | }
|
| | |
|
| | |
| | |
|
| | | JSONObject aps = new JSONObject();
|
| | | aps.put("alert", alert);
|
| | | aps.put("badge", 1);
|
| | | JSONObject json = new JSONObject();
|
| | | json.put("aps", aps);
|
| | | return filterPushContent(json);
|
| | |
| | | alert.put("type", PushController.ZNX);
|
| | | JSONObject aps = new JSONObject();
|
| | | aps.put("alert", alert);
|
| | | aps.put("badge", 1);
|
| | | JSONObject json = new JSONObject();
|
| | | json.put("aps", aps);
|
| | | return filterPushContent(json);
|
| | |
| | |
|
| | | JSONObject aps = new JSONObject();
|
| | | aps.put("alert", alert);
|
| | | aps.put("badge", 1);
|
| | | JSONObject json = new JSONObject();
|
| | | json.put("aps", aps);
|
| | | return filterPushContent(json);
|
| | |
| | |
|
| | | JSONObject aps = new JSONObject();
|
| | | aps.put("alert", alert);
|
| | | aps.put("badge", 1);
|
| | | JSONObject json = new JSONObject();
|
| | | json.put("aps", aps);
|
| | | return filterPushContent(json);
|
| | |
| | |
|
| | | JSONObject aps = new JSONObject();
|
| | | aps.put("alert", alert);
|
| | | aps.put("badge", 1);
|
| | | JSONObject json = new JSONObject();
|
| | | json.put("aps", aps);
|
| | | return filterPushContent(json);
|