|
|
|
@ -2,6 +2,9 @@ package com.bweb.controller; |
|
|
|
|
|
|
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
|
import com.hai.common.exception.ErrorCode; |
|
|
|
|
import com.hai.common.exception.ErrorHelp; |
|
|
|
|
import com.hai.common.exception.SysCode; |
|
|
|
|
import com.hai.common.security.SessionObject; |
|
|
|
|
import com.hai.common.security.UserCenter; |
|
|
|
|
import com.hai.common.utils.ResponseMsgUtil; |
|
|
|
@ -19,6 +22,7 @@ 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; |
|
|
|
@ -86,7 +90,11 @@ public class BsMsgController { |
|
|
|
|
bsMsg.setCompanyId(userInfoModel.getBsCompany().getId()); |
|
|
|
|
bsMsg.setOpId(userInfoModel.getSecUser().getId()); |
|
|
|
|
bsMsg.setOpName(userInfoModel.getSecUser().getUserName()); |
|
|
|
|
bsMsgService.insertMsg(bsMsg); |
|
|
|
|
bsMsg.setMsgType(2); |
|
|
|
|
bsMsg.setStatus(1); |
|
|
|
|
bsMsg.setCreateTime(new Date()); |
|
|
|
|
bsMsg.setUpdateTime(new Date()); |
|
|
|
|
bsMsgService.insertMsg(bsMsg , null); |
|
|
|
|
return ResponseMsgUtil.success("新增成功"); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
@ -94,4 +102,29 @@ public class BsMsgController { |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/pushMsg", method = RequestMethod.GET) |
|
|
|
|
@ApiOperation(value = "发布站内信") |
|
|
|
|
@ResponseBody |
|
|
|
|
public ResponseData pushMsg(@RequestParam(value = "id", required = true) Long id) { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
BsMsg bsMsg = bsMsgService.findMsg(id); |
|
|
|
|
if (bsMsg == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR, "为查询到相关内容!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (bsMsg.getStatus() !=1) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "当前状态错误"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bsMsg.setStatus(2); |
|
|
|
|
bsMsg.setUpdateTime(new Date()); |
|
|
|
|
bsMsgService.updateMsg(bsMsg); |
|
|
|
|
return ResponseMsgUtil.success("发布成功"); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("CmsContentController --> delContent() error!", e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|