Commit 5663def1 by Java-李昕颖

举报查看、跟踪各种改

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