| | |
| | | import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail;
|
| | | import com.yeshi.fanli.entity.bus.msg.UserMsgUnReadNum;
|
| | | import com.yeshi.fanli.entity.bus.msg.UserSystemMsg;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.goods.RecommendUserGoods;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
|
| | | import com.yeshi.fanli.exception.goods.CommonGoodsException;
|
| | |
| | | @RequestMapping(value = "getHomeMsgListNew", method = RequestMethod.POST)
|
| | | public void getHomeMsgListNew(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | |
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | List<UserMsgCenter> listCenter = new ArrayList<>();
|
| | | |
| | | // 1、活动区域
|
| | | List<Special> listSpecial = specialService.listByPlaceKey("msg_activities");
|
| | | if (listSpecial != null && listSpecial.size() > 0) {
|
| | | for (Special special: listSpecial) {
|
| | | |
| | | boolean needLogin = special.isJumpLogin();
|
| | | JumpDetailV2 jumpDetail = special.getJumpDetail();
|
| | | if (jumpDetail != null) {
|
| | | jumpDetail.setNeedLogin(needLogin);
|
| | | special.setJumpDetail(jumpDetail);
|
| | | }
|
| | |
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
|
| | | return;
|
| | | UserMsgCenter msgCenter = new UserMsgCenter();
|
| | | msgCenter.setSpecial(special);
|
| | | listCenter.add(msgCenter);
|
| | | }
|
| | | }
|
| | |
|
| | | // 2、消息区域
|
| | | if (uid != null && uid > 0) {
|
| | | int page = 1;
|
| | | List<UserMsgVO> list = new ArrayList<>();
|
| | | List<MsgOrderDetail> detailList = msgOrderDetailService.listMsgOrderDetail(uid, page);
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | List<UserMsgCenter> listCenter = new ArrayList<>();
|
| | | |
| | | List<Special> listSpecial = specialService.listByPlaceKey("msg_activities");
|
| | | if (listSpecial != null && listSpecial.size() > 0) {
|
| | | for (Special special: listSpecial) {
|
| | | UserMsgCenter msgCenter = new UserMsgCenter();
|
| | | msgCenter.setSpecial(special);
|
| | | listCenter.add(msgCenter);
|
| | | }
|
| | | }
|
| | | |
| | | if (list.size() > 0 ) {
|
| | | // 时间排序
|
| | | listSort(list);
|
| | |
| | | listCenter.add(userMsgCenter);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | // 添加欢迎语
|
| | | // 3、添加欢迎语
|
| | | Long time = (uid == null ? System.currentTimeMillis() : userInfoService.selectByPKey(uid).getCreatetime());
|
| | | // 创建时间在28号后的才有新人欢迎
|
| | | if ((time > TimeUtil.convertToTimeTemp("2019-01-28", "yyyy-MM-dd") || uid == null)) {
|
| | |
| | |
|
| | | GsonBuilder builder = new GsonBuilder();
|
| | | builder = getTimeDescJsonBuilder(builder);
|
| | | |
| | | JSONObject root = new JSONObject();
|
| | |
|
| | | if (uid != null && uid > 0) {
|
| | | UserMsgUnReadNum num = userMsgReadStateService.getReadStateByUid(uid);
|
| | | UserSystemMsg usm = userSystemMsgService.getLatestUserSystemMsg(uid);
|
| | | if (usm != null) {
|
| | | root.put("systemMsg", new UserSystemMsgVO(usm.getId(), usm.getType().name(), usm.getSolved(), "系统消息", usm.getTitle(),
|
| | | usm.getTimeTag() == 1 ? "http://img.flqapp.com/resource/msg/icon_emergent.png" : "", "http://img.flqapp.com/resource/msg/icon_msg_system.png",getTimeDesc(new Date(), usm.getCreateTime()), num.getTypeSystem()));
|
| | | }
|
| | | }
|
| | |
|
| | | root.put("list", builder.create().toJson(listCenter));
|
| | | root.put("count", listCenter.size());
|