Commit 93afde3c by Java-李昕颖

消息中心相关修改

parent 4904df27
...@@ -3,11 +3,13 @@ package com.ejweb.modules.report.service; ...@@ -3,11 +3,13 @@ package com.ejweb.modules.report.service;
import com.ejweb.core.persistence.Page; import com.ejweb.core.persistence.Page;
import com.ejweb.core.service.CrudService; import com.ejweb.core.service.CrudService;
import com.ejweb.core.utils.IdGen; import com.ejweb.core.utils.IdGen;
import com.ejweb.core.utils.SpringContextHolder;
import com.ejweb.core.utils.StringUtils; import com.ejweb.core.utils.StringUtils;
import com.ejweb.modules.report.dao.ReportDao; import com.ejweb.modules.report.dao.ReportDao;
import com.ejweb.modules.report.entity.ReportAttachmentEntity; import com.ejweb.modules.report.entity.ReportAttachmentEntity;
import com.ejweb.modules.report.entity.ReportEntity; import com.ejweb.modules.report.entity.ReportEntity;
import com.ejweb.modules.report.entity.ReportExchangeHistory; import com.ejweb.modules.report.entity.ReportExchangeHistory;
import com.ejweb.modules.sys.dao.RoleDao;
import com.ejweb.modules.sys.entity.Office; import com.ejweb.modules.sys.entity.Office;
import com.ejweb.modules.sys.entity.Position; import com.ejweb.modules.sys.entity.Position;
import com.ejweb.modules.sys.entity.Role; import com.ejweb.modules.sys.entity.Role;
...@@ -39,6 +41,9 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> { ...@@ -39,6 +41,9 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
@Autowired @Autowired
private ReportDao reportDao; private ReportDao reportDao;
@Autowired
private RoleDao roleDao;
/** /**
* 查询附件 * 查询附件
* @param reportAttachmentEntity * @param reportAttachmentEntity
...@@ -244,6 +249,12 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> { ...@@ -244,6 +249,12 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
reportNotice.setSendFromId(user.getId()); reportNotice.setSendFromId(user.getId());
reportNotice.setSendToId(reportEntity.getExchangeAfterUser()); reportNotice.setSendToId(reportEntity.getExchangeAfterUser());
reportNotice.setStatus("0"); reportNotice.setStatus("0");
if (StringUtils.isNotBlank(reportEntity.getDealResult())){
reportNotice.setSendToId(reportDao.findAdmin());
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日");
String dateStr = sdf1.format(date);
reportNotice.setTitle("“"+reportEntity.getSupplementTitle()+"”已由"+user.getName()+"于"+dateStr+"处理完成");
}
reportDao.updateReportNotice(reportNotice); reportDao.updateReportNotice(reportNotice);
}else{ }else{
//消息表中不存在该条举报的信息,新增记录 //消息表中不存在该条举报的信息,新增记录
...@@ -391,7 +402,9 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> { ...@@ -391,7 +402,9 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
*/ */
public boolean checkRole(User user) { public boolean checkRole(User user) {
boolean isAdmin = false; boolean isAdmin = false;
List<Role> roleList = UserUtils.getRoleList(); Role roleEntity = new Role();
roleEntity.setUser(user);
List<Role> roleList = roleDao.findList(roleEntity);
if (roleList != null && roleList.size() != 0){ if (roleList != null && roleList.size() != 0){
for (Role role : roleList){ for (Role role : roleList){
if (role.getName().equals("系统管理员")){ if (role.getName().equals("系统管理员")){
......
...@@ -176,12 +176,13 @@ public class ReportController extends BaseController { ...@@ -176,12 +176,13 @@ public class ReportController extends BaseController {
* @return * @return
*/ */
@RequestMapping(value = "addTrack") @RequestMapping(value = "addTrack")
public String addTrack(ReportEntity reportEntity, Model model, RedirectAttributes redirectAttributes) { public String addTrack(ReportEntity reportEntity,HttpServletRequest request, Model model, RedirectAttributes redirectAttributes) {
if (!beanValidator(model, reportEntity)) { if (!beanValidator(model, reportEntity)) {
return form(reportEntity, model); return form(reportEntity, model);
} }
reportService.saveTrack(reportEntity); reportService.saveTrack(reportEntity);
if (StringUtils.isNotBlank(reportEntity.getExchangeAfterUser())){ String exchangeAfterUser = request.getParameter("exchangeAfterUser");
if (StringUtils.isNotBlank(exchangeAfterUser)){
reportService.addNotice(reportEntity,"transfer"); reportService.addNotice(reportEntity,"transfer");
reportService.addRecord(reportEntity,"1"); reportService.addRecord(reportEntity,"1");
} }
......
...@@ -203,7 +203,7 @@ ...@@ -203,7 +203,7 @@
<div class="control-group"> <div class="control-group">
<label class="control-label">移交:</label> <label class="control-label">移交:</label>
<div class="controls"> <div class="controls">
<form:hidden id="userId" path="exchangeAfterUser" value=""/> <input type="text" id="userId" name="exchangeAfterUser" value="" style="display:none;"/>
<input id="chooseUser" type="text" value="选择移交人员" <c:if test="${isAdmin eq false}">disabled="true"</c:if> htmlEscape="false" maxlength="200" class="input-xlarge"/> <input id="chooseUser" type="text" value="选择移交人员" <c:if test="${isAdmin eq false}">disabled="true"</c:if> htmlEscape="false" maxlength="200" class="input-xlarge"/>
</div> </div>
</div> </div>
......
...@@ -54,8 +54,8 @@ ...@@ -54,8 +54,8 @@
<tr> <tr>
<td>${vs.count}</td> <td>${vs.count}</td>
<td> <td>
<c:if test="${isAdmin eq 'Y'}"><a href="${ctx}/notice/view?id=${notice.id}&reportId=${notice.reportId}">"${notice.title}"-已由${notice.sendFromId}于${notice.sendTime}处理完成</a></c:if> <c:if test="${isAdmin eq 'Y'}"><a href="${ctx}/notice/view?id=${notice.id}&reportId=${notice.reportId}">${notice.title}</a></c:if>
<c:if test="${isAdmin eq 'N'}"><a href="${ctx}/notice/view?id=${notice.id}&reportId=${notice.reportId}">请处理-"${notice.title}"</a></c:if> <c:if test="${isAdmin eq 'N'}"><a href="${ctx}/notice/view?id=${notice.id}&reportId=${notice.reportId}">${notice.title}</a></c:if>
</td> </td>
<td>${notice.sendTime}</td> <td>${notice.sendTime}</td>
<td>${notice.sendFromId}</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