Commit 5663def1 by Java-李昕颖

举报查看、跟踪各种改

parent b6e87205
...@@ -6,6 +6,8 @@ import com.ejweb.modules.report.entity.ReportAttachmentEntity; ...@@ -6,6 +6,8 @@ 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.sys.entity.User; import com.ejweb.modules.sys.entity.User;
import java.util.List;
/** /**
* 举报DAO接口 * 举报DAO接口
* @author lixy * @author lixy
...@@ -21,6 +23,13 @@ public interface ReportDao extends CrudDao<ReportEntity> { ...@@ -21,6 +23,13 @@ public interface ReportDao extends CrudDao<ReportEntity> {
public String findRole(User user); public String findRole(User user);
/** /**
* 查询附件
* @param reportAttachmentEntity
* @return
*/
public List<ReportAttachmentEntity> getAttachmentInfo(ReportAttachmentEntity reportAttachmentEntity);
/**
* 新增举报 * 新增举报
* @param reportEntity * @param reportEntity
* @return * @return
......
...@@ -40,9 +40,9 @@ public class ReportEntity extends DataEntity<ReportEntity> { ...@@ -40,9 +40,9 @@ public class ReportEntity extends DataEntity<ReportEntity> {
private List<ReportAttachmentEntity> reportAttachmentEntityList; private List<ReportAttachmentEntity> reportAttachmentEntityList;
private List<String> reportAttachmentList; //举报提交文件 private String reportAttachment; //举报提交文件
private List<String> supplementAttachmentList; //补充提交文件 private String supplementAttachment; //补充提交文件
private List<String> dealAttachmentList; //处理成果文件 private String dealAttachment; //处理成果文件
public String getReportProject() { public String getReportProject() {
...@@ -237,27 +237,27 @@ public class ReportEntity extends DataEntity<ReportEntity> { ...@@ -237,27 +237,27 @@ public class ReportEntity extends DataEntity<ReportEntity> {
this.reportAttachmentEntityList = reportAttachmentEntityList; this.reportAttachmentEntityList = reportAttachmentEntityList;
} }
public List<String> getReportAttachmentList() { public String getReportAttachment() {
return reportAttachmentList; return reportAttachment;
} }
public void setReportAttachmentList(List<String> reportAttachmentList) { public void setReportAttachment(String reportAttachment) {
this.reportAttachmentList = reportAttachmentList; this.reportAttachment = reportAttachment;
} }
public List<String> getSupplementAttachmentList() { public String getSupplementAttachment() {
return supplementAttachmentList; return supplementAttachment;
} }
public void setSupplementAttachmentList(List<String> supplementAttachmentList) { public void setSupplementAttachment(String supplementAttachment) {
this.supplementAttachmentList = supplementAttachmentList; this.supplementAttachment = supplementAttachment;
} }
public List<String> getDealAttachmentList() { public String getDealAttachment() {
return dealAttachmentList; return dealAttachment;
} }
public void setDealAttachmentList(List<String> dealAttachmentList) { public void setDealAttachment(String dealAttachment) {
this.dealAttachmentList = dealAttachmentList; this.dealAttachment = dealAttachment;
} }
} }
...@@ -31,6 +31,15 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> { ...@@ -31,6 +31,15 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
private ReportDao reportDao; private ReportDao reportDao;
/** /**
* 查询附件
* @param reportAttachmentEntity
* @return
*/
public List<ReportAttachmentEntity> getAttachmentInfo(ReportAttachmentEntity reportAttachmentEntity) {
return reportDao.getAttachmentInfo(reportAttachmentEntity);
}
/**
* 查询用户角色 * 查询用户角色
* @param user * @param user
* @return * @return
...@@ -55,23 +64,28 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> { ...@@ -55,23 +64,28 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
reportEntity.setExchangeAfterUser(reportEntity.getCreateBy().getId()); reportEntity.setExchangeAfterUser(reportEntity.getCreateBy().getId());
dao.addReport(reportEntity); dao.addReport(reportEntity);
List<String> reportAttachmentList = reportEntity.getReportAttachmentList(); if (StringUtils.isNotBlank(reportEntity.getReportAttachment())) {
if (reportAttachmentList != null && reportAttachmentList.size() > 0) { String[] reportAttachmentList = new String[]{reportEntity.getReportAttachment()};
if (reportEntity.getReportAttachment().contains("|")){
reportAttachmentList = reportEntity.getReportAttachment().split("\\|");
}
for (String path : reportAttachmentList) { for (String path : reportAttachmentList) {
//保存举报提交附件信息 if (StringUtils.isNotBlank(path)) {
ReportAttachmentEntity reportAttachmentEntity = new ReportAttachmentEntity(); //保存举报提交附件信息
reportAttachmentEntity.setId(IdGen.uuid()); ReportAttachmentEntity reportAttachmentEntity = new ReportAttachmentEntity();
reportAttachmentEntity.setReportId(reportEntity.getId()); reportAttachmentEntity.setId(IdGen.uuid());
//获取文件名 reportAttachmentEntity.setReportId(reportEntity.getId());
String fileName = this.getFilename(path); //获取文件名
if (StringUtils.isNotBlank(fileName)) { String fileName = this.getFilename(path);
reportAttachmentEntity.setAttachmentName(fileName); if (StringUtils.isNotBlank(fileName)) {
reportAttachmentEntity.setAttachmentName(fileName);
}
reportAttachmentEntity.setAttachmentPath(path);
File file = new File(reportAttachmentEntity.getAttachmentPath());
long length = file.length();
reportAttachmentEntity.setAttachmentType("0");
reportDao.addReportAttachment(reportAttachmentEntity);
} }
reportAttachmentEntity.setAttachmentPath(path);
File file = new File(reportAttachmentEntity.getAttachmentPath());
long length = file.length();
reportAttachmentEntity.setAttachmentType("0");
reportDao.addReportAttachment(reportAttachmentEntity);
} }
} }
} }
...@@ -88,43 +102,53 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> { ...@@ -88,43 +102,53 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
reportEntity.setDealPersonName(user.getName()); reportEntity.setDealPersonName(user.getName());
dao.addTrack(reportEntity); dao.addTrack(reportEntity);
List<String> supplementAttachmentList = reportEntity.getSupplementAttachmentList(); if (StringUtils.isNotBlank(reportEntity.getSupplementAttachment())) {
if (supplementAttachmentList != null && supplementAttachmentList.size() > 0) { String[] supplementAttachmentList = new String[]{reportEntity.getSupplementAttachment()};
if (reportEntity.getSupplementAttachment().contains("|")){
supplementAttachmentList = reportEntity.getSupplementAttachment().split("\\|");
}
for (String path : supplementAttachmentList) { for (String path : supplementAttachmentList) {
//保存补充提交附件信息 if (StringUtils.isNotBlank(path)) {
ReportAttachmentEntity reportAttachmentEntity = reportAttachmentEntity = new ReportAttachmentEntity(); //保存补充提交附件信息
reportAttachmentEntity.setId(IdGen.uuid()); ReportAttachmentEntity reportAttachmentEntity = reportAttachmentEntity = new ReportAttachmentEntity();
reportAttachmentEntity.setReportId(reportEntity.getId()); reportAttachmentEntity.setId(IdGen.uuid());
//获取文件名 reportAttachmentEntity.setReportId(reportEntity.getId());
String fileName = this.getFilename(path); //获取文件名
if (StringUtils.isNotBlank(fileName)) { String fileName = this.getFilename(path);
reportAttachmentEntity.setAttachmentName(fileName); if (StringUtils.isNotBlank(fileName)) {
reportAttachmentEntity.setAttachmentName(fileName);
}
reportAttachmentEntity.setAttachmentPath(path);
File file = new File(reportAttachmentEntity.getAttachmentPath());
long length = file.length();
reportAttachmentEntity.setAttachmentType("1");
reportDao.addReportAttachment(reportAttachmentEntity);
} }
reportAttachmentEntity.setAttachmentPath(path);
File file = new File(reportAttachmentEntity.getAttachmentPath());
long length = file.length();
reportAttachmentEntity.setAttachmentType("1");
reportDao.addReportAttachment(reportAttachmentEntity);
} }
} }
List<String> dealAttachmentList = reportEntity.getDealAttachmentList(); if (StringUtils.isNotBlank(reportEntity.getDealAttachment())) {
if (dealAttachmentList != null && dealAttachmentList.size() > 0) { String[] dealAttachmentList = new String[]{reportEntity.getDealAttachment()};
if (reportEntity.getDealAttachment().contains("|")){
dealAttachmentList = reportEntity.getDealAttachment().split("\\|");
}
for (String path : dealAttachmentList) { for (String path : dealAttachmentList) {
//保存处理结果附件信息 if (StringUtils.isNotBlank(path)) {
ReportAttachmentEntity reportAttachmentEntity = reportAttachmentEntity = new ReportAttachmentEntity(); //保存处理结果附件信息
reportAttachmentEntity.setId(IdGen.uuid()); ReportAttachmentEntity reportAttachmentEntity = reportAttachmentEntity = new ReportAttachmentEntity();
reportAttachmentEntity.setReportId(reportEntity.getId()); reportAttachmentEntity.setId(IdGen.uuid());
//获取文件名 reportAttachmentEntity.setReportId(reportEntity.getId());
String fileName = this.getFilename(path); //获取文件名
if (StringUtils.isNotBlank(fileName)) { String fileName = this.getFilename(path);
reportAttachmentEntity.setAttachmentName(fileName); if (StringUtils.isNotBlank(fileName)) {
reportAttachmentEntity.setAttachmentName(fileName);
}
reportAttachmentEntity.setAttachmentPath(path);
File file = new File(reportAttachmentEntity.getAttachmentPath());
long length = file.length();
reportAttachmentEntity.setAttachmentType("2");
reportDao.addReportAttachment(reportAttachmentEntity);
} }
reportAttachmentEntity.setAttachmentPath(path);
File file = new File(reportAttachmentEntity.getAttachmentPath());
long length = file.length();
reportAttachmentEntity.setAttachmentType("2");
reportDao.addReportAttachment(reportAttachmentEntity);
} }
} }
//更新举报状态 //更新举报状态
......
...@@ -3,6 +3,7 @@ package com.ejweb.modules.report.web; ...@@ -3,6 +3,7 @@ package com.ejweb.modules.report.web;
import com.ejweb.core.base.BaseController; import com.ejweb.core.base.BaseController;
import com.ejweb.core.persistence.Page; import com.ejweb.core.persistence.Page;
import com.ejweb.core.utils.StringUtils; import com.ejweb.core.utils.StringUtils;
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.service.ReportService; import com.ejweb.modules.report.service.ReportService;
import com.ejweb.modules.sys.entity.User; import com.ejweb.modules.sys.entity.User;
...@@ -18,6 +19,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes; ...@@ -18,6 +19,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.List;
/** /**
* 举报Controller * 举报Controller
...@@ -119,7 +121,17 @@ public class ReportController extends BaseController { ...@@ -119,7 +121,17 @@ public class ReportController extends BaseController {
*/ */
@RequestMapping(value = "view") @RequestMapping(value = "view")
public String view(ReportEntity reportEntity, Model model, RedirectAttributes redirectAttributes) { public String view(ReportEntity reportEntity, Model model, RedirectAttributes redirectAttributes) {
ReportAttachmentEntity reportAttachment = new ReportAttachmentEntity();
reportAttachment.setReportId(reportEntity.getId());
reportAttachment.setAttachmentType("0");
List<ReportAttachmentEntity> reportAttachmentList = reportService.getAttachmentInfo(reportAttachment);
ReportAttachmentEntity supplementAttachment = new ReportAttachmentEntity();
supplementAttachment.setReportId(reportEntity.getId());
supplementAttachment.setAttachmentType("1");
List<ReportAttachmentEntity> supplementAttachmentList = reportService.getAttachmentInfo(supplementAttachment);
model.addAttribute("report", reportEntity); model.addAttribute("report", reportEntity);
model.addAttribute("reportAttachmentList", reportAttachmentList);
model.addAttribute("supplementAttachmentList", supplementAttachmentList);
return "modules/report/reportDetail"; return "modules/report/reportDetail";
} }
......
...@@ -118,6 +118,15 @@ ...@@ -118,6 +118,15 @@
WHERE su.id = #{id} WHERE su.id = #{id}
</select> </select>
<select id="getAttachmentInfo" resultType="ReportAttachmentEntity">
SELECT
ra.attachment_name,
ra.attachment_path
FROM report_attachment ra
WHERE ra.report_id = #{reportId}
AND ra.attachment_type = #{attachmentType}
</select>
<insert id="addReport"> <insert id="addReport">
INSERT INTO report( INSERT INTO report(
id, id,
......
...@@ -56,15 +56,12 @@ ...@@ -56,15 +56,12 @@
<form:textarea id="reportContent" htmlEscape="true" path="reportContent" rows="4" maxlength="500" class="input-xxlarge" disabled="true"/> <form:textarea id="reportContent" htmlEscape="true" path="reportContent" rows="4" maxlength="500" class="input-xxlarge" disabled="true"/>
</div> </div>
</div> </div>
</div>
<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="nameFile" path="reportAttachmentList" htmlEscape="false" <c:forEach items="${reportAttachmentList}" var="reportAttachment" varStatus="vs">
maxlength="255" class="input-xlarge"/> ${vs.count}.<a href="${reportAttachment.attachmentPath}" target="_blank">${reportAttachment.attachmentName}</a><br>
<sys:ckfinder input="nameFile" type="files" uploadPath="/file" </c:forEach>
selectMultiple="false" maxWidth="100" maxHeight="100"/>
<label id="checkFile" class="error" style="display: none;">必填信息</label>
</div> </div>
</div> </div>
<span class="title">举报人信息</span> <span class="title">举报人信息</span>
...@@ -145,11 +142,9 @@ ...@@ -145,11 +142,9 @@
<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="nameFile" path="supplementAttachmentList" htmlEscape="false" <c:forEach items="${supplementAttachmentList}" var="supplementAttachment" varStatus="vs">
maxlength="255" class="input-xlarge"/> ${vs.count}.<a href="${supplementAttachment.attachmentPath}" target="_blank">${supplementAttachment.attachmentName}</a><br>
<sys:ckfinder input="nameFile" type="files" uploadPath="/file" </c:forEach>
selectMultiple="false" maxWidth="100" maxHeight="100"/>
<label id="checkFile" class="error" style="display: none;">必填信息</label>
</div> </div>
</div> </div>
<li class="btns"> <li class="btns">
......
...@@ -76,10 +76,10 @@ ...@@ -76,10 +76,10 @@
<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="nameFile" path="reportAttachmentList" htmlEscape="false" <form:hidden id="nameFile" path="reportAttachment" htmlEscape="false"
maxlength="255" class="input-xlarge"/> maxlength="255" class="input-xlarge"/>
<sys:ckfinder input="nameFile" type="files" uploadPath="/file" <sys:ckfinder input="nameFile" type="files" uploadPath="/file"
selectMultiple="false" maxWidth="100" maxHeight="100"/> selectMultiple="true" maxWidth="100" maxHeight="100"/>
<label id="checkFile" class="error" style="display: none;">必填信息</label> <label id="checkFile" class="error" style="display: none;">必填信息</label>
</div> </div>
</div> </div>
......
...@@ -115,10 +115,10 @@ ...@@ -115,10 +115,10 @@
<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="nameFile" path="supplementAttachmentList" htmlEscape="false" <form:hidden id="nameFile" path="supplementAttachment" htmlEscape="false"
maxlength="255" class="input-xlarge"/> maxlength="255" class="input-xlarge"/>
<sys:ckfinder input="nameFile" type="files" uploadPath="/file" <sys:ckfinder input="nameFile" type="files" uploadPath="/file"
selectMultiple="false" maxWidth="100" maxHeight="100"/> selectMultiple="true" maxWidth="100" maxHeight="100"/>
<label id="checkFile" class="error" style="display: none;">必填信息</label> <label id="checkFile" class="error" style="display: none;">必填信息</label>
</div> </div>
</div> </div>
...@@ -133,10 +133,10 @@ ...@@ -133,10 +133,10 @@
<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="nameFile" path="dealAttachmentList" htmlEscape="false" <form:hidden id="nameFile" path="dealAttachment" htmlEscape="false"
maxlength="255" class="input-xlarge"/> maxlength="255" class="input-xlarge"/>
<sys:ckfinder input="nameFile" type="files" uploadPath="/file" <sys:ckfinder input="nameFile" type="files" uploadPath="/file"
selectMultiple="false" maxWidth="100" maxHeight="100"/> selectMultiple="true" maxWidth="100" maxHeight="100"/>
<label id="checkFile" class="error" style="display: none;">必填信息</label> <label id="checkFile" class="error" style="display: none;">必填信息</label>
</div> </div>
</div> </div>
......
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