From d6ce66cdef982dfe6f1af7d6d69aa1154b4fa454 Mon Sep 17 00:00:00 2001 From: hexiaohui <hexiaohui@LAPTOP-03V48RSB> Date: 星期一, 28 一月 2019 22:19:08 +0800 Subject: [PATCH] 订单BUG修改 --- fanli/src/main/java/com/yeshi/fanli/controller/client/UserMsgController.java | 31 +++++++++++++++++++++++-------- 1 files changed, 23 insertions(+), 8 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/UserMsgController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/UserMsgController.java index b449b32..ff7fb65 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/UserMsgController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/UserMsgController.java @@ -363,7 +363,7 @@ List<UserHomeMsgVO> volist = new ArrayList<>(); List<RecommendUserGoods> list = recommendUserGoodsService.listRecommend(uid, page, Constant.PAGE_SIZE); - long count = recommendUserGoodsService.countRecommend(uid) + 1;// 璁$畻娆㈣繋璇殑鏁伴噺 + long count = recommendUserGoodsService.countRecommend(uid);// Date now = new Date(); for (RecommendUserGoods goods : list) { @@ -406,14 +406,21 @@ volist.add(vo); } + Long time = userInfoService.getUserById(uid).getCreatetime(); + if (time > TimeUtil.convertToTimeTemp("2019-01-28", "yyyy-MM-dd")) + count++;// 璁$畻娆㈣繋璇殑鏁伴噺 + if (volist.size() > 0 && volist.size() < Constant.PAGE_SIZE) { // 娣诲姞娆㈣繋璇� - UserHomeMsgVO vo = new UserHomeMsgVO(); - vo.setContent("鎭枩浣狅紝鎴愪负杩斿埄鍒哥殑鐢ㄦ埛\n鐙浼樻儬鍒稿府浣犵渷閽憋紱\n鍙備笌濂栭噾娲诲姩甯綘璧氶挶锛沑n璁╄繑鍒╁埜鎴愪负浣犵殑鐪侀挶鍔╂墜鍚э紒"); - vo.setTitle("鏂颁汉娆㈣繋"); - vo.setCreateTime(getTimeDesc(now, new Date(userInfoService.getUserById(uid).getCreatetime()))); - vo.setType(UserHomeMsgVO.TYPE_WELCOME); - volist.add(vo); + // 鍒涘缓鏃堕棿鍦�28鍙峰悗鐨勬墠鏈夋柊浜烘杩� + if (time > TimeUtil.convertToTimeTemp("2019-01-28", "yyyy-MM-dd")) { + UserHomeMsgVO vo = new UserHomeMsgVO(); + vo.setContent("鎭枩浣狅紝鎴愪负杩斿埄鍒哥殑鐢ㄦ埛\n鐙浼樻儬鍒稿府浣犵渷閽憋紱\n鍙備笌濂栭噾娲诲姩甯綘璧氶挶锛沑n璁╄繑鍒╁埜鎴愪负浣犵殑鐪侀挶鍔╂墜鍚э紒"); + vo.setTitle("鏂颁汉娆㈣繋"); + vo.setCreateTime(getTimeDesc(now, new Date(time))); + vo.setType(UserHomeMsgVO.TYPE_WELCOME); + volist.add(vo); + } } JSONObject root = new JSONObject(); @@ -500,7 +507,15 @@ out.print(JsonUtil.loadFalseResult(1, "鐢ㄦ埛鏈櫥褰�")); return; } - userMsgReadStateService.setAllMsgRead(uid); + + UserMsgUnReadNum num = userMsgReadStateService.getReadStateByUid(uid); + int totalNum = num.getTypeAccount() + num.getTypeInvite() + num.getTypeMoney() + num.getTypeOrder() + + num.getTypeScore() + num.getTypeSystem(); + if (totalNum == 0) { + out.print(JsonUtil.loadFalseResult(1, "娌℃湁鏈娑堟伅")); + return; + } else + userMsgReadStateService.setAllMsgRead(uid); out.print(JsonUtil.loadTrueResult("")); } -- Gitblit v1.8.0