Commit aed2e6ae by java-lixy

消息中心 即时提醒

parent e2602e49
......@@ -12,6 +12,7 @@ import com.ejweb.modules.sys.entity.Office;
import com.ejweb.modules.sys.entity.Position;
import com.ejweb.modules.sys.entity.User;
import com.ejweb.modules.sys.utils.UserUtils;
import com.ejweb.modules.workbench.service.NoticeService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
......@@ -39,6 +40,8 @@ public class ReportController extends BaseController {
@Autowired
private ReportService reportService;
@Autowired
private NoticeService noticeService;
@ModelAttribute
public ReportEntity get(@RequestParam(required = false) String id) {
......@@ -178,6 +181,15 @@ public class ReportController extends BaseController {
supplementType = supplementType.substring(0, supplementType.length() - 1);
reportEntity.setSupplementType(supplementType);
}
String isSendEmail = reportEntity.getIsSendEmail();
if (StringUtils.isNotBlank(isSendEmail)){
if (isSendEmail.equals("1")){
isSendEmail = "是";
}
}else {
isSendEmail = "否";
}
reportEntity.setIsSendEmail(isSendEmail);
List<ReportAttachmentEntity> reportAttachmentList = reportService.getAttachmentInfo(reportAttachment);
//获取补充提交文件列表
ReportAttachmentEntity supplementAttachment = new ReportAttachmentEntity();
......@@ -189,11 +201,18 @@ public class ReportController extends BaseController {
dealAttachment.setReportId(reportEntity.getId());
dealAttachment.setAttachmentType("2");
List<ReportAttachmentEntity> dealAttachmentList = reportService.getAttachmentInfo(dealAttachment);
//修改消息中心的未读消息提醒
User user = UserUtils.getUser();
Integer count = noticeService.getMessageCount(user.getId());
String result = "";
if (count != 0){
result = count.toString();
}
model.addAttribute("report", reportEntity);
model.addAttribute("reportAttachmentList", reportAttachmentList);
model.addAttribute("supplementAttachmentList", supplementAttachmentList);
model.addAttribute("dealAttachmentList", dealAttachmentList);
model.addAttribute("result", result);
return "modules/report/reportDetail";
}
......@@ -243,6 +262,15 @@ public class ReportController extends BaseController {
if (StringUtils.isBlank(reportEntity.getDealPersonName())){
reportEntity.setDealPersonName(user.getName());
}
String isSendEmail = reportEntity.getIsSendEmail();
if (StringUtils.isNotBlank(isSendEmail)){
if (isSendEmail.equals("1")){
isSendEmail = "是";
}
}else {
isSendEmail = "否";
}
reportEntity.setIsSendEmail(isSendEmail);
model.addAttribute("page", page);
model.addAttribute("user", userEntity);
model.addAttribute("userName", user.getName());
......
......@@ -151,7 +151,7 @@ public class ReportToWordController {
}
}
if (list.size() > 1) {
mergeCellsVertically(basicInfoTable, 0, 6, 6 + list.size() - 1);
mergeCellsVertically(basicInfoTable, 0, 9, 9 + list.size() - 1);
}
this.setCellWidth(basicInfoTable);
......
......@@ -6,7 +6,8 @@
<meta name="decorator" content="default"/>
<script type="text/javascript">
$(document).ready(function () {
alert($("#prompt"));
var count = "${result}";
parent.refreshPromt(count);
$("input[type='text']").attr("disabled",true);
$("#btnTrack").click(function () {
......@@ -44,7 +45,6 @@
dealResult = "举报受理";
}
$("#dealResult").val(dealResult);
alert($('#default', window.parent.document).html());
});
var requestFlag = true;
function openDownloadDialog(id){
......
......@@ -157,6 +157,15 @@
}).loadData(refresh);
return false;
}// </c:if>
function refreshPromt(result) {
if (result != "") {
$("#prompt").text(result);
$("#promptMessage").text(result);
}else {
$("#message").hide();
$("#messageDiv").hide();
}
}
</script>
</head>
<body>
......
......@@ -23,7 +23,23 @@
$("#refresh").click(function () {
window.location.href = "${ctx}/notice/list";
});
//序号连续
var i = 1;
var pageNo = $("#pageNo").val();
var pageSize = $("#pageSize").val();
$(".reportList").each(function(){
var num = (pageNo-1)*pageSize + i;
i += 1;
$(this).children("td:first-child").html(num);
});
});
function page(n,s){
$("#pageNo").val(n);
$("#pageSize").val(s);
$("#searchForm").attr("action", "${ctx}/notice/list");
$("#searchForm").submit();
return false;
}
</script>
</head>
<body>
......@@ -51,8 +67,8 @@
<tbody>
<c:if test="${noticePage.list.size()>0}">
<c:forEach items="${noticePage.list}" var="notice" varStatus="vs">
<tr>
<td>${vs.count}</td>
<tr class="reportList">
<td></td>
<td><a href="${ctx}/notice/view?id=${notice.id}&reportId=${notice.reportId}"><span <c:if test="${notice.status eq '1'}">style="color: #6f4086"</c:if>>${notice.title}。</span></a></td>
<td>${notice.sendTime}</td>
<td>${notice.sendFromId}</td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment