|
|
@ -23,10 +23,8 @@ import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import javax.annotation.Resource; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.*; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @author sum1dream |
|
|
|
* @author sum1dream |
|
|
@ -49,9 +47,6 @@ public class BsMsgController { |
|
|
|
@ApiOperation(value = "查询站内信列表") |
|
|
|
@ApiOperation(value = "查询站内信列表") |
|
|
|
public ResponseData getMsgByList( |
|
|
|
public ResponseData getMsgByList( |
|
|
|
@RequestParam(value = "type", required = false) Integer type, |
|
|
|
@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(value = "companyId", required = true) String companyId, |
|
|
|
@RequestParam(name = "pageNum", required = true) Integer pageNum, |
|
|
|
@RequestParam(name = "pageNum", required = true) Integer pageNum, |
|
|
|
@RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request |
|
|
|
@RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request |
|
|
@ -61,17 +56,30 @@ public class BsMsgController { |
|
|
|
SessionObject sessionObject = userCenter.getSessionObject(request); |
|
|
|
SessionObject sessionObject = userCenter.getSessionObject(request); |
|
|
|
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); |
|
|
|
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); |
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> map = new HashMap<>(5); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
map.put("type", type); |
|
|
|
// 查询个人信息
|
|
|
|
map.put("jumpType", jumpType); |
|
|
|
Map<String, Object> mapUser = new HashMap<>(); |
|
|
|
map.put("msgType", msgType); |
|
|
|
mapUser.put("companyId" , companyId); |
|
|
|
map.put("title", title); |
|
|
|
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("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 = list.stream().sorted(Comparator.comparing(BsMsg::getCreateTime).reversed()) |
|
|
|
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
List<BsMsg> list = bsMsgService.getMsgByList(map); |
|
|
|
PageHelper.startPage(pageNum,pageSize); |
|
|
|
return ResponseMsgUtil.success(new PageInfo<>(list)); |
|
|
|
return ResponseMsgUtil.success(new PageInfo<>(list)); |
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} 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); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|