Commit 8c7f1b5e by Java-李昕颖

举报查看、跟踪各种改

parent 750c8c76
......@@ -33,4 +33,18 @@ public interface ReportDao extends CrudDao<ReportEntity> {
* @return
*/
public int addReportAttachment(ReportAttachmentEntity reportAttachmentEntity);
/**
* 举报信息补充
* @param reportEntity
* @return
*/
public int addTrack(ReportEntity reportEntity);
/**
* 更新举报状态
* @param reportEntity
* @return
*/
public int updateReportStatus(ReportEntity reportEntity);
}
......@@ -3,6 +3,8 @@ package com.ejweb.modules.report.entity;
import com.ejweb.core.persistence.DataEntity;
import java.util.List;
/**
* 举报Entity
* @author lixy
......@@ -36,7 +38,12 @@ public class ReportEntity extends DataEntity<ReportEntity> {
private String reportTimeFrom; //举报时间起
private String reportTimeTo; //举报时间止
private ReportAttachmentEntity reportAttachmentEntity;
private List<ReportAttachmentEntity> reportAttachmentEntityList;
private List<String> reportAttachmentList; //举报提交文件
private List<String> supplementAttachmentList; //补充提交文件
private List<String> dealAttachmentList; //处理成果文件
public String getReportProject() {
return reportProject;
......@@ -222,11 +229,35 @@ public class ReportEntity extends DataEntity<ReportEntity> {
this.reportTimeTo = reportTimeTo;
}
public ReportAttachmentEntity getReportAttachmentEntity() {
return reportAttachmentEntity;
public List<ReportAttachmentEntity> getReportAttachmentEntityList() {
return reportAttachmentEntityList;
}
public void setReportAttachmentEntityList(List<ReportAttachmentEntity> reportAttachmentEntityList) {
this.reportAttachmentEntityList = reportAttachmentEntityList;
}
public List<String> getReportAttachmentList() {
return reportAttachmentList;
}
public void setReportAttachmentList(List<String> reportAttachmentList) {
this.reportAttachmentList = reportAttachmentList;
}
public List<String> getSupplementAttachmentList() {
return supplementAttachmentList;
}
public void setSupplementAttachmentList(List<String> supplementAttachmentList) {
this.supplementAttachmentList = supplementAttachmentList;
}
public List<String> getDealAttachmentList() {
return dealAttachmentList;
}
public void setReportAttachmentEntity(ReportAttachmentEntity reportAttachmentEntity) {
this.reportAttachmentEntity = reportAttachmentEntity;
public void setDealAttachmentList(List<String> dealAttachmentList) {
this.dealAttachmentList = dealAttachmentList;
}
}
......@@ -2,10 +2,12 @@ package com.ejweb.modules.report.service;
import com.ejweb.core.service.CrudService;
import com.ejweb.core.utils.IdGen;
import com.ejweb.core.utils.StringUtils;
import com.ejweb.modules.report.dao.ReportDao;
import com.ejweb.modules.report.entity.ReportAttachmentEntity;
import com.ejweb.modules.report.entity.ReportEntity;
import com.ejweb.modules.sys.entity.User;
import com.ejweb.modules.sys.utils.UserUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -14,6 +16,7 @@ import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.text.SimpleDateFormat;
import java.util.List;
/**
* 举报Service
......@@ -41,7 +44,7 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
* @param reportEntity
*/
@Transactional(readOnly = false)
public void save(ReportEntity reportEntity) {
public void saveReport(ReportEntity reportEntity) {
//保存举报信息
reportEntity.preInsert();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
......@@ -52,25 +55,98 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
reportEntity.setExchangeAfterUser(reportEntity.getCreateBy().getId());
dao.addReport(reportEntity);
//保存附件信息
ReportAttachmentEntity reportAttachmentEntity = reportEntity.getReportAttachmentEntity();
reportAttachmentEntity.setId(IdGen.uuid());
reportAttachmentEntity.setReportId(reportEntity.getId());
//获取文件名
int beginIndex = reportAttachmentEntity.getAttachmentPath().indexOf("%");
int endIndex = reportAttachmentEntity.getAttachmentPath().lastIndexOf(".");
String fileNameUrlCode = reportAttachmentEntity.getAttachmentPath().substring(beginIndex,endIndex);
String prefixName = reportAttachmentEntity.getAttachmentPath().substring(endIndex,reportAttachmentEntity.getAttachmentPath().length());
List<String> reportAttachmentList = reportEntity.getReportAttachmentList();
if (reportAttachmentList != null && reportAttachmentList.size() > 0) {
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);
}
reportAttachmentEntity.setAttachmentPath(path);
File file = new File(reportAttachmentEntity.getAttachmentPath());
long length = file.length();
reportAttachmentEntity.setAttachmentType("0");
reportDao.addReportAttachment(reportAttachmentEntity);
}
}
}
/**
* 举报补充
* @param reportEntity
*/
@Transactional(readOnly = false)
public void saveTrack(ReportEntity reportEntity) {
//保存举报补充信息
reportEntity.preUpdate();
User user = UserUtils.getUser();
reportEntity.setDealPersonName(user.getName());
dao.addTrack(reportEntity);
List<String> supplementAttachmentList = reportEntity.getSupplementAttachmentList();
if (supplementAttachmentList != null && supplementAttachmentList.size() > 0) {
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);
}
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) {
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);
}
reportAttachmentEntity.setAttachmentPath(path);
File file = new File(reportAttachmentEntity.getAttachmentPath());
long length = file.length();
reportAttachmentEntity.setAttachmentType("2");
reportDao.addReportAttachment(reportAttachmentEntity);
}
}
//更新举报状态
reportEntity.setReportStatus("1");
if (StringUtils.isNotBlank(reportEntity.getDealResult())){
reportEntity.setReportStatus("2");
}
reportDao.updateReportStatus(reportEntity);
}
public String getFilename(String path){
int beginIndex = path.indexOf("%");
int endIndex = path.lastIndexOf(".");
String fileNameUrlCode = path.substring(beginIndex, endIndex);
String prefixName = path.substring(endIndex, path.length());
try {
String fileName = URLDecoder.decode(fileNameUrlCode,"UTF-8");
reportAttachmentEntity.setAttachmentName(fileName+prefixName);
String utlToName = URLDecoder.decode(fileNameUrlCode, "UTF-8");
String fileName = utlToName + prefixName;
return fileName;
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
return null;
}
File file = new File(reportAttachmentEntity.getAttachmentPath());
long length = file.length();
reportAttachmentEntity.setAttachmentType("0");
reportDao.addReportAttachment(reportAttachmentEntity);
}
}
......@@ -94,7 +94,7 @@ public class ReportController extends BaseController {
}
/**
* 举报保存
* 举报信息保存
*
* @param reportEntity
* @param model
......@@ -105,7 +105,7 @@ public class ReportController extends BaseController {
if (!beanValidator(model, reportEntity)) {
return form(reportEntity, model);
}
reportService.save(reportEntity);
reportService.saveReport(reportEntity);
addMessage(redirectAttributes, "添加举报"+ reportEntity.getReportProject() + "'成功");
return "redirect:" + adminPath + "/report/list/?repage&flag=0";
}
......@@ -144,4 +144,21 @@ public class ReportController extends BaseController {
return "modules/report/reportTrack";
}
/**
* 举报跟踪信息保存
*
* @param reportEntity
* @param model
* @return
*/
@RequestMapping(value = "addTrack")
public String addTrack(ReportEntity reportEntity, Model model, RedirectAttributes redirectAttributes) {
if (!beanValidator(model, reportEntity)) {
return form(reportEntity, model);
}
reportService.saveTrack(reportEntity);
addMessage(redirectAttributes, "补充举报"+ reportEntity.getSupplementTitle() + "'成功");
return "redirect:" + adminPath + "/report/list/?repage&flag=0";
}
}
......@@ -28,11 +28,7 @@
r.create_by AS "createBy",
r.create_date AS "createDate",
r.update_by AS "updateBy",
r.update_date AS "updateDate",
ra.attachment_name AS "reportAttachmentEntity.attachmentName",
ra.attachment_path AS "reportAttachmentEntity.attachmentPath",
ra.attachment_size AS "reportAttachmentEntity.attachmentSize",
ra.attachment_type AS "reportAttachmentEntity.attachmentType"
r.update_date AS "updateDate"
</sql>
......@@ -44,7 +40,6 @@
SELECT
<include refid="reportColumns"/>
FROM report r
<include refid="reportJoins"/>
WHERE r.id = #{id}
</select>
......@@ -52,7 +47,6 @@
SELECT
<include refid="reportColumns"/>
FROM report r
<include refid="reportJoins"/>
<where>
1 = 1
<if test="exchangeAfterUser != null and exchangeAfterUser != ''">
......@@ -105,7 +99,6 @@
SELECT
<include refid="reportColumns"/>
FROM report r
<include refid="reportJoins"/>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
......@@ -181,24 +174,26 @@
)
</insert>
<update id="update">
UPDATE sys_area SET
parent_id = #{parent.id},
parent_ids = #{parentIds},
code = #{code},
name = #{name},
sort = #{sort},
type = #{type},
update_by = #{updateBy.id},
update_date = #{updateDate},
remarks = #{remarks}
WHERE id = #{id}
</update>
<update id="addTrack">
UPDATE report SET
supplement_company = #{supplementCompany},
supplement_department = #{supplementDepartment},
supplement_informant = #{supplementInformant},
supplement_title = #{supplementTitle},
supplement_type = #{supplementType},
supplement_area = #{supplementArea},
supplement_project = #{supplementProject},
supplement_content = #{supplementContent},
deal_person_name = #{dealPersonName},
deal_result = #{dealResult},
update_by = #{updateBy.id},
update_date = #{updateDate}
WHERE id = #{id}
</update>
<update id="updateParentIds">
UPDATE sys_area SET
parent_id = #{parent.id},
parent_ids = #{parentIds}
<update id="updateReportStatus">
UPDATE report SET
report_status = #{reportStatus}
WHERE id = #{id}
</update>
......
......@@ -5,32 +5,15 @@
<title>举报管理</title>
<meta name="decorator" content="default"/>
<script type="text/javascript">
var submitCount = 0;
$(document).ready(function () {
$("#inputForm").validate({
submitHandler: function (form) {
if ($("#nameFile").val().length == 0) {
$("#checkFile").show();
} else {
submitCount += 1;
if(submitCount == 1){
$("#checkFile").hide();
loading('正在提交,请稍等...');
form.submit();
}else{
return false;
}
}
},
errorContainer: "#messageBox",
errorPlacement: function (error, element) {
$("#messageBox").text("输入有误,请先更正。");
if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
error.appendTo(element.parent().parent());
} else {
error.insertAfter(element);
}
}
$("input[type='text']").attr("disabled",true);
$("#btnTrack").click(function () {
window.location.href = "${ctx}/report/track?id=${report.id}";
});
$("#btnDocument").click(function () {
$("#inputForm").attr("action", "${ctx}/report/document");
$("#inputForm").submit();
});
});
</script>
......@@ -43,38 +26,41 @@
</head>
<body>
<ul class="nav nav-tabs">
<li class="active"><a href="${ctx}/report/form">举报录入</a></li>
<li class="active"><a href="${ctx}/report/form">举报详情</a></li>
</ul>
<br/>
<form:form id="inputForm" modelAttribute="report" action="${ctx}/report/addReport" method="post" class="form-horizontal">
<form:form id="inputForm" modelAttribute="report" action="${ctx}/report/track" method="post" class="form-horizontal">
<sys:message content="${message}"/>
<span class="title">举报内容</span>
<div class="control-group">
<label class="control-label">被举报项目:</label>
<div class="controls">
<form:input path="reportProject" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
<span class="help-inline"><font color="red">*</font> </span>
</div>
</div>
<div class="control-group">
<label class="control-label">被举报项目:</label>
<div class="controls">
<form:input path="reportTime" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
</div>
</div>
<div class="control-group">
<label class="control-label">所在城市:</label>
<div class="controls">
<form:input path="reportCity" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
<span class="help-inline"><font color="red">*</font> </span>
</div>
</div>
<div class="control-group">
<label class="control-label">内容:</label>
<div class="controls">
<form:textarea id="reportContent" htmlEscape="true" path="reportContent" rows="4" maxlength="500" class="input-xxlarge"/>
<span class="help-inline"><font color="red">*</font> </span>
<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="reportAttachmentEntity.attachmentPath" htmlEscape="false"
<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"/>
......@@ -86,35 +72,91 @@
<label class="control-label">姓名:</label>
<div class="controls">
<form:input path="reportPersonName" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
<span class="help-inline"><font color="red">*</font> </span>
</div>
</div>
<div class="control-group">
<label class="control-label">手机号:</label>
<div class="controls">
<form:input path="reportPersonTel" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
<span class="help-inline"><font color="red">*</font> </span>
</div>
</div>
<div class="control-group">
<label class="control-label">Email:</label>
<div class="controls">
<form:input path="reportPersonEmail" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
<span class="help-inline"><font color="red">*</font> </span>
</div>
</div>
<div class="control-group">
<label class="control-label">举报途径:</label>
<div class="controls">
<form:radiobutton path="reportSource" value="tel" checked="true"/>电话&emsp;
<form:radiobutton path="reportSource" value="email"/>邮件&emsp;
<form:radiobutton path="reportSource" value="visit"/>来访
<span class="help-inline"><font color="red">*</font> </span>
<form:radiobuttons path="reportSource" items="${fns:getDictList('report_source')}" itemLabel="label" itemValue="value"
htmlEscape="false" disabled="true"/>
</div>
</div>
<div class="form-actions">
<input id="btnSubmit" class="btn btn-primary" type="submit" value="提交"/>&nbsp;
<span class="title">举报信息补充</span>
<div class="control-group">
<label class="control-label">标题:</label>
<div class="controls">
<form:input path="supplementTitle" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
</div>
</div>
<div class="control-group">
<label class="control-label">被举报公司:</label>
<div class="controls">
<form:input path="supplementCompany" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
</div>
</div>
<div class="control-group">
<label class="control-label">被举报部门:</label>
<div class="controls">
<form:input path="supplementDepartment" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
</div>
</div>
<div class="control-group">
<label class="control-label">被举报人:</label>
<div class="controls">
<form:input path="supplementInformant" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
</div>
</div>
<div class="control-group">
<label class="control-label">业务类型:</label>
<div class="controls">
<form:input path="supplementType" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
</div>
</div>
<div class="control-group">
<label class="control-label">被举报区域:</label>
<div class="controls">
<form:input path="supplementArea" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
</div>
</div>
<div class="control-group">
<label class="control-label">被举报项目:</label>
<div class="controls">
<form:input path="supplementProject" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
</div>
</div>
<div class="control-group">
<label class="control-label">内容:</label>
<div class="controls">
<form:textarea id="reportContent" htmlEscape="true" path="supplementContent" rows="4" maxlength="500" class="input-xxlarge" disabled="true"/>
</div>
</div>
<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>
</div>
</div>
<li class="btns">
<label style="width:auto;"><input id="btnTrack" class="btn btn-primary" type="button" value="跟踪"/>&nbsp;&nbsp;
<input id="btnDocument" class="btn btn-primary" type="button" value="转为文档"/>&nbsp;&nbsp;
<input id="btnReturn" class="btn btn-primary" type="button" value="返回" onclick="history.go(-1)"/></label>
</li>
</form:form>
</body>
......
......@@ -11,7 +11,9 @@
submitHandler: function (form) {
if ($("#nameFile").val().length == 0) {
$("#checkFile").show();
} else {
} else if ($("#reportContent").val() == ""){
top.$.jBox.tip('请填写内容', 'warning');
}else {
submitCount += 1;
if(submitCount == 1){
$("#checkFile").hide();
......@@ -74,7 +76,7 @@
<div class="control-group">
<label class="control-label">附件:</label>
<div class="controls">
<form:hidden id="nameFile" path="reportAttachmentEntity.attachmentPath" htmlEscape="false"
<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"/>
......
......@@ -131,7 +131,7 @@
<c:if test="${report.dealResult eq '3'}">举报属实</c:if>
</td>
<td><c:if test="${report.dealResult eq null}">--</c:if>
<c:if test="${report.dealResult eq null}">${report.dealPersonName}</c:if>
<c:if test="${report.dealResult ne null}">${report.dealPersonName}</c:if>
</td>
<td>
<a href="${ctx}/report/view?id=${report.id}">查看</a>
......
......@@ -47,6 +47,7 @@
</ul>
<br/>
<form:form id="inputForm" modelAttribute="report" action="${ctx}/report/addTrack" method="post" class="form-horizontal">
<form:hidden path="id"/>
<sys:message content="${message}"/>
<span class="title">举报信息补充</span>
<div class="control-group">
......@@ -106,7 +107,7 @@
<div class="control-group">
<label class="control-label">内容:</label>
<div class="controls">
<form:textarea id="reportContent" htmlEscape="true" path="reportContent" rows="4" maxlength="500" class="input-xxlarge"/>
<form:textarea id="supplementContent" htmlEscape="true" path="supplementContent" rows="4" maxlength="500" class="input-xxlarge"/>
<span class="help-inline"><font color="red">*</font> </span>
</div>
</div>
......@@ -114,7 +115,7 @@
<div class="control-group">
<label class="control-label">附件:</label>
<div class="controls">
<form:hidden id="nameFile" path="reportAttachmentEntity.attachmentPath" htmlEscape="false"
<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"/>
......@@ -132,7 +133,7 @@
<div class="control-group">
<label class="control-label">处理成果文件:</label>
<div class="controls">
<form:hidden id="nameFile" path="reportAttachmentEntity.attachmentPath" htmlEscape="false"
<form:hidden id="nameFile" path="dealAttachmentList" htmlEscape="false"
maxlength="255" class="input-xlarge"/>
<sys:ckfinder input="nameFile" type="files" uploadPath="/file"
selectMultiple="false" maxWidth="100" maxHeight="100"/>
......
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