admin
2019-02-28 4e938ce8cf18ebb12c102e7c18c1ca16fe1b15a8
消息返回修改
4个文件已修改
39 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/UserMsgController.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOtherMsgNotificationServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/push/PushServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/IOSPushFactory.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/UserMsgController.java
@@ -219,9 +219,31 @@
            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);
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOtherMsgNotificationServiceImpl.java
@@ -226,7 +226,7 @@
                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();
        }
@@ -255,7 +255,7 @@
                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();
        }
fanli/src/main/java/com/yeshi/fanli/service/impl/push/PushServiceImpl.java
@@ -181,7 +181,7 @@
    @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);
    }
fanli/src/main/java/com/yeshi/fanli/util/factory/IOSPushFactory.java
@@ -63,6 +63,7 @@
        JSONObject aps = new JSONObject();
        aps.put("alert", alert);
        aps.put("badge", 1);
        JSONObject json = new JSONObject();
        json.put("aps", aps);
        return filterPushContent(json);
@@ -84,6 +85,7 @@
        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);
@@ -109,6 +111,7 @@
        JSONObject aps = new JSONObject();
        aps.put("alert", alert);
        aps.put("badge", 1);
        JSONObject json = new JSONObject();
        json.put("aps", aps);
        return filterPushContent(json);
@@ -133,6 +136,7 @@
        JSONObject aps = new JSONObject();
        aps.put("alert", alert);
        aps.put("badge", 1);
        JSONObject json = new JSONObject();
        json.put("aps", aps);
        return filterPushContent(json);
@@ -157,6 +161,7 @@
        JSONObject aps = new JSONObject();
        aps.put("alert", alert);
        aps.put("badge", 1);
        JSONObject json = new JSONObject();
        json.put("aps", aps);
        return filterPushContent(json);