Commit c5b54072 by Java-张振楠

修改几个小bug

parent 70eed284
...@@ -39,8 +39,6 @@ public class FrontReportService extends CrudService<FrontReportDao,FrontReportEn ...@@ -39,8 +39,6 @@ public class FrontReportService extends CrudService<FrontReportDao,FrontReportEn
Date date = new Date(); Date date = new Date();
bean.setReportTime(DateUtils.formatDate(date,"yyyy-MM-dd HH:mm:ss")); bean.setReportTime(DateUtils.formatDate(date,"yyyy-MM-dd HH:mm:ss"));
// 现在写的是微信公众号,可能不是这个
// bean.setReportSource("wechat");
bean.setReportStatus("0"); bean.setReportStatus("0");
// 查询管理员 // 查询管理员
......
package com.ejweb.modules.report.web; package com.ejweb.modules.report.web;
import com.ejweb.conf.GConstants;
import com.ejweb.core.base.BaseController; import com.ejweb.core.base.BaseController;
import com.ejweb.core.utils.StringUtils; import com.ejweb.core.utils.StringUtils;
import com.ejweb.modules.report.entity.ReportEntity; import com.ejweb.modules.report.entity.ReportEntity;
...@@ -49,7 +50,7 @@ public class ReportToPdfController extends BaseController { ...@@ -49,7 +50,7 @@ public class ReportToPdfController extends BaseController {
Font title = new Font(bfChinese,16,Font.BOLD);//文字加粗 Font title = new Font(bfChinese,16,Font.BOLD);//文字加粗
Font textfont = new Font(bfChinese,14,Font.NORMAL);//正常文字 Font textfont = new Font(bfChinese,14,Font.NORMAL);//正常文字
//document是创建的文档,FileOutputStream是向文档中输入 //document是创建的文档,FileOutputStream是向文档中输入
PdfWriter.getInstance(document, new FileOutputStream("C:/举报详情.pdf")); PdfWriter.getInstance(document, new FileOutputStream(GConstants.FILE_UPLOAD_DIR+"pdf/"+reportEntity.getReportProject()+"_"+reportEntity.getId()+".pdf"));
//打开文档 //打开文档
document.open(); document.open();
Paragraph pt1 = new Paragraph("举报内容",title); Paragraph pt1 = new Paragraph("举报内容",title);
...@@ -234,8 +235,7 @@ public class ReportToPdfController extends BaseController { ...@@ -234,8 +235,7 @@ public class ReportToPdfController extends BaseController {
document.close(); document.close();
PrintWriter out = response.getWriter(); PrintWriter out = response.getWriter();
response.setContentType("application/json;charset=utf-8"); response.setContentType("application/json;charset=utf-8");
out.write("C:/举报详情.pdf"); out.write(GConstants.FILE_PREFIX_URL+"pdf/"+reportEntity.getReportProject()+"_"+reportEntity.getId()+".pdf");
out.close(); out.close();
// return "redirect:" + adminPath + "/report/list/?repage&flag="+flag;
} }
} }
...@@ -73,7 +73,7 @@ userfiles.prefix=static ...@@ -73,7 +73,7 @@ userfiles.prefix=static
#projectPath=D\:\\workspace\\jeesite #projectPath=D\:\\workspace\\jeesite
# The Upload File DIR, Must End With File Separator # The Upload File DIR, Must End With File Separator
## file.upload.dir=/mnt/yunbbc/ #file.upload.dir=/mnt/sunac/
## file.upload.dir=D:\\WorkSapce\\JEESpace\\ejweb-api-1.0\\files\\ ## file.upload.dir=D:\\WorkSapce\\JEESpace\\ejweb-api-1.0\\files\\
file.upload.dir=/D:/uploads/ file.upload.dir=/D:/uploads/
# Max Upload File Size: (default 30M=30*1024*1024(B)=31457280 bytes) # Max Upload File Size: (default 30M=30*1024*1024(B)=31457280 bytes)
...@@ -94,7 +94,7 @@ file.image.thumb.is.allow=true ...@@ -94,7 +94,7 @@ file.image.thumb.is.allow=true
file.image.thumb.width=640 file.image.thumb.width=640
file.image.thumb.height=640 file.image.thumb.height=640
# The Prefix Url # The Prefix Url
file.prefix.url=http://127.0.0.1:8080/static/ file.prefix.url=http://123.56.146.81:8808/
# The Prefix separator # The Prefix separator
file.upload.path.separator = / file.upload.path.separator = /
......
...@@ -38,10 +38,10 @@ ...@@ -38,10 +38,10 @@
function resetPageNo() { function resetPageNo() {
$("#pageNo").val(0); $("#pageNo").val(0);
} }
function openDownloadDialog(){ function openDownloadDialog(id){
if (requestFlag == true){ if (requestFlag == true){
$.ajax({ $.ajax({
url: "${ctx}/report/document?id=${report.id}", url: "${ctx}/report/document?id="+id,
dataType: "text", dataType: "text",
traditional: true,//这里设置为true traditional: true,//这里设置为true
cache: false, cache: false,
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
requestFlag = false; requestFlag = false;
}, },
success: function(url) { //登录成功后返回的数据 success: function(url) { //登录成功后返回的数据
window.location.href = url; window.open(url, "_blank");
}, },
error:function(){ error:function(){
alert("数据错误!"); alert("数据错误!");
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
<td> <td>
<a href="${ctx}/report/view?id=${report.id}">查看</a> <a href="${ctx}/report/view?id=${report.id}">查看</a>
<c:if test="${report.reportStatus ne '2'}"><a href="${ctx}/report/track?id=${report.id}">跟踪</a></c:if> <c:if test="${report.reportStatus ne '2'}"><a href="${ctx}/report/track?id=${report.id}">跟踪</a></c:if>
<a href="#" onclick="openDownloadDialog()">转为文档</a> <a href="#" onclick="openDownloadDialog('${report.id}')">转为文档</a>
</td> </td>
</tr> </tr>
</c:forEach> </c:forEach>
......
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