|
|
|
@ -23,10 +23,8 @@ import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @author sum1dream |
|
|
|
@ -49,9 +47,6 @@ public class BsMsgController { |
|
|
|
|
@ApiOperation(value = "查询站内信列表") |
|
|
|
|
public ResponseData getMsgByList( |
|
|
|
|
@RequestParam(value = "type", required = false) Integer type, |
|
|
|
|
@RequestParam(value = "jumpType", required = false) Integer jumpType, |
|
|
|
|
@RequestParam(value = "msgType", required = false) Integer msgType, |
|
|
|
|
@RequestParam(value = "title", required = false) String title, |
|
|
|
|
@RequestParam(value = "companyId", required = true) String companyId, |
|
|
|
|
@RequestParam(name = "pageNum", required = true) Integer pageNum, |
|
|
|
|
@RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request |
|
|
|
@ -61,17 +56,30 @@ public class BsMsgController { |
|
|
|
|
SessionObject sessionObject = userCenter.getSessionObject(request); |
|
|
|
|
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); |
|
|
|
|
|
|
|
|
|
Map<String, Object> map = new HashMap<>(5); |
|
|
|
|
|
|
|
|
|
map.put("type", type); |
|
|
|
|
map.put("jumpType", jumpType); |
|
|
|
|
map.put("msgType", msgType); |
|
|
|
|
map.put("title", title); |
|
|
|
|
// 查询个人信息
|
|
|
|
|
Map<String, Object> mapUser = new HashMap<>(); |
|
|
|
|
mapUser.put("companyId" , companyId); |
|
|
|
|
mapUser.put("msgType" , 1); |
|
|
|
|
mapUser.put("type" , type); |
|
|
|
|
mapUser.put("userId" , userInfoModel.getHighUser().getId()); |
|
|
|
|
mapUser.put("num" , 1000); |
|
|
|
|
List<BsMsg> listUser = bsMsgService.queryMsgByList(mapUser); |
|
|
|
|
|
|
|
|
|
// 查询全局信息
|
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
map.put("companyId" , companyId); |
|
|
|
|
map.put("type" , type); |
|
|
|
|
map.put("msgType" , 2); |
|
|
|
|
map.put("num" , 1000); |
|
|
|
|
List<BsMsg> list = bsMsgService.queryMsgByList(map); |
|
|
|
|
|
|
|
|
|
PageHelper.startPage(pageNum,pageSize); |
|
|
|
|
list.addAll(listUser); |
|
|
|
|
|
|
|
|
|
List<BsMsg> list = bsMsgService.getMsgByList(map); |
|
|
|
|
list = list.stream().sorted(Comparator.comparing(BsMsg::getCreateTime).reversed()) |
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
PageHelper.startPage(pageNum,pageSize); |
|
|
|
|
return ResponseMsgUtil.success(new PageInfo<>(list)); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
@ -100,47 +108,4 @@ public class BsMsgController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/queryMsgByList", method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "查询站内信列表") |
|
|
|
|
public ResponseData queryMsgByList( |
|
|
|
|
@RequestParam(value = "companyId", required = false) Long companyId, |
|
|
|
|
@RequestParam(value = "type", required = false) Long type, |
|
|
|
|
HttpServletRequest request) { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
// 用户
|
|
|
|
|
SessionObject sessionObject = userCenter.getSessionObject(request); |
|
|
|
|
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); |
|
|
|
|
|
|
|
|
|
Map<String, Object> mapUser = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
mapUser.put("companyId" , companyId); |
|
|
|
|
mapUser.put("type" , type); |
|
|
|
|
mapUser.put("userId" , userInfoModel.getHighUser().getId()); |
|
|
|
|
mapUser.put("msgType" , 1); |
|
|
|
|
|
|
|
|
|
// 查询个人站内信
|
|
|
|
|
List<BsMsg> userMsg = bsMsgService.queryMsgByList(mapUser); |
|
|
|
|
|
|
|
|
|
// 查询全局站内信
|
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
map.put("companyId" , companyId); |
|
|
|
|
map.put("type" , type); |
|
|
|
|
map.put("msgType" , 2); |
|
|
|
|
|
|
|
|
|
// 查询个人站内信
|
|
|
|
|
List<BsMsg> msgList = bsMsgService.queryMsgByList(map); |
|
|
|
|
|
|
|
|
|
msgList.addAll(userMsg); |
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(msgList); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("HighOrderController -> addOrder() error!", e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|