Commit f388d123 by Java-李昕颖

举报查看、跟踪

parent 3f339e50
...@@ -42,6 +42,7 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> { ...@@ -42,6 +42,7 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
*/ */
@Transactional(readOnly = false) @Transactional(readOnly = false)
public void save(ReportEntity reportEntity) { public void save(ReportEntity reportEntity) {
//保存举报信息
reportEntity.preInsert(); reportEntity.preInsert();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String reportTime = sdf.format(reportEntity.getCreateDate()); String reportTime = sdf.format(reportEntity.getCreateDate());
...@@ -51,6 +52,7 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> { ...@@ -51,6 +52,7 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
reportEntity.setExchangeAfterUser(reportEntity.getCreateBy().getId()); reportEntity.setExchangeAfterUser(reportEntity.getCreateBy().getId());
dao.addReport(reportEntity); dao.addReport(reportEntity);
//保存附件信息
ReportAttachmentEntity reportAttachmentEntity = reportEntity.getReportAttachmentEntity(); ReportAttachmentEntity reportAttachmentEntity = reportEntity.getReportAttachmentEntity();
reportAttachmentEntity.setId(IdGen.uuid()); reportAttachmentEntity.setId(IdGen.uuid());
reportAttachmentEntity.setReportId(reportEntity.getId()); reportAttachmentEntity.setReportId(reportEntity.getId());
......
...@@ -40,7 +40,15 @@ public class ReportController extends BaseController { ...@@ -40,7 +40,15 @@ public class ReportController extends BaseController {
} }
} }
// 举报列表 /**
* 举报列表
*
* @param reportEntity
* @param model
* @param request
* @param response
* @return
*/
@RequiresPermissions("report:view") @RequiresPermissions("report:view")
@RequestMapping(value = {"list", ""}) @RequestMapping(value = {"list", ""})
public String list(ReportEntity reportEntity, String flag,HttpServletRequest request, HttpServletResponse response, Model model) { public String list(ReportEntity reportEntity, String flag,HttpServletRequest request, HttpServletResponse response, Model model) {
...@@ -72,12 +80,26 @@ public class ReportController extends BaseController { ...@@ -72,12 +80,26 @@ public class ReportController extends BaseController {
return "modules/report/reportList"; return "modules/report/reportList";
} }
@RequestMapping(value = "/form") /**
* 举报添加
*
* @param reportEntity
* @param model
* @return
*/
@RequestMapping(value = "form")
public String form(ReportEntity reportEntity, Model model) { public String form(ReportEntity reportEntity, Model model) {
model.addAttribute("reportEntity", reportEntity); model.addAttribute("report", reportEntity);
return "modules/report/reportForm"; return "modules/report/reportForm";
} }
/**
* 举报保存
*
* @param reportEntity
* @param model
* @return
*/
@RequestMapping(value = "addReport") @RequestMapping(value = "addReport")
public String addReport(ReportEntity reportEntity, Model model, RedirectAttributes redirectAttributes) { public String addReport(ReportEntity reportEntity, Model model, RedirectAttributes redirectAttributes) {
if (!beanValidator(model, reportEntity)) { if (!beanValidator(model, reportEntity)) {
...@@ -88,10 +110,38 @@ public class ReportController extends BaseController { ...@@ -88,10 +110,38 @@ public class ReportController extends BaseController {
return "redirect:" + adminPath + "/report/list/?repage&flag=0"; return "redirect:" + adminPath + "/report/list/?repage&flag=0";
} }
/**
* 举报详情
*
* @param reportEntity
* @param model
* @return
*/
@RequestMapping(value = "view") @RequestMapping(value = "view")
public String view(ReportEntity reportEntity, Model model, RedirectAttributes redirectAttributes) { public String view(ReportEntity reportEntity, Model model, RedirectAttributes redirectAttributes) {
model.addAttribute("reportEntity", reportEntity); model.addAttribute("report", reportEntity);
return "modules/report/reportDetail"; return "modules/report/reportDetail";
} }
/**
* 举报跟踪
*
* @param reportEntity
* @param model
* @return
*/
@RequestMapping(value = "track")
public String track(ReportEntity reportEntity, Model model) {
User user = UserUtils.getUser();
String roleName = reportService.findRole(user);
String transferFlag = "0";
if (roleName.equals("系统管理员")){
transferFlag = "1";
}
model.addAttribute("currentUser", user.getName());
model.addAttribute("transferFlag", transferFlag);
model.addAttribute("report", reportEntity);
return "modules/report/reportTrack";
}
} }
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
<li class="active"><a href="${ctx}/report/form">举报录入</a></li> <li class="active"><a href="${ctx}/report/form">举报录入</a></li>
</ul> </ul>
<br/> <br/>
<form:form id="inputForm" modelAttribute="reportEntity" action="${ctx}/report/addReport" method="post" class="form-horizontal"> <form:form id="inputForm" modelAttribute="report" action="${ctx}/report/addReport" method="post" class="form-horizontal">
<sys:message content="${message}"/> <sys:message content="${message}"/>
<span class="title">举报内容</span> <span class="title">举报内容</span>
<div class="control-group"> <div class="control-group">
......
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