Commit 85b8d07d by java-lixy

小改动

parent d6a8df9b
...@@ -238,7 +238,7 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> { ...@@ -238,7 +238,7 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
* @return * @return
*/ */
@Transactional(readOnly = false) @Transactional(readOnly = false)
public void addNotice(ReportEntity reportEntity,String flag){ public int addNotice(ReportEntity reportEntity,String flag){
User user = UserUtils.getUser(); User user = UserUtils.getUser();
Date date = new Date(); Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
...@@ -254,27 +254,28 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> { ...@@ -254,27 +254,28 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
reportNotice.setSendFromId(user.getId()); reportNotice.setSendFromId(user.getId());
reportNotice.setSendToId(reportEntity.getExchangeAfterUser()); reportNotice.setSendToId(reportEntity.getExchangeAfterUser());
reportNotice.setStatus("0"); reportNotice.setStatus("0");
if (StringUtils.isNotBlank(reportEntity.getDealResult())){ if (flag.equals("answer")){
reportNotice.setSendToId(reportDao.findAdmin(new Office())); reportNotice.setSendToId(reportDao.findAdmin(new Office()));
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日"); SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日");
String dateStr = sdf1.format(date); String dateStr = sdf1.format(date);
reportNotice.setTitle("“"+reportEntity.getSupplementTitle()+"”已由"+user.getName()+"于"+dateStr+"处理完成"); reportNotice.setTitle("“"+reportEntity.getSupplementTitle()+"”已由"+user.getName()+"于"+dateStr+"处理完成");
} }
reportDao.updateReportNotice(reportNotice); reportDao.updateReportNotice(reportNotice);
return 1;
}else{ }else{
//消息表中不存在该条举报的信息,新增记录 //消息表中不存在该条举报的信息,新增记录
reportNotice = new ReportNotice(); reportNotice = new ReportNotice();
reportNotice.setId(IdGen.uuid()); reportNotice.setId(IdGen.uuid());
reportNotice.setReportId(reportEntity.getId()); reportNotice.setReportId(reportEntity.getId());
if (flag.equals("answer")){ if (flag.equals("answer")){
//一般用户处理完成,消息标题为“已由xxx完成” return 0;
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日");
String dateStr = sdf1.format(date);
reportNotice.setTitle("“"+reportEntity.getSupplementTitle()+"”已由"+user.getName()+"于"+dateStr+"处理完成");
reportNotice.setSendToId(reportDao.findAdmin(new Office()));
}else{ }else{
//管理员转交或移交,消息标题为“请处理xxx” //管理员转交或移交,消息标题为“请处理xxx”
reportNotice.setTitle("请处理-“"+reportEntity.getSupplementTitle()+"”"); String title = reportEntity.getSupplementTitle();
if (StringUtils.isBlank(reportEntity.getSupplementTitle())){
title = reportEntity.getReportProject();
}
reportNotice.setTitle("请处理-“"+title+"”");
reportNotice.setSendToId(reportEntity.getExchangeAfterUser()); reportNotice.setSendToId(reportEntity.getExchangeAfterUser());
} }
reportNotice.setCreateDate(date); reportNotice.setCreateDate(date);
...@@ -286,6 +287,7 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> { ...@@ -286,6 +287,7 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
reportNotice.setCreateBy(user.getId()); reportNotice.setCreateBy(user.getId());
reportNotice.setUpdateBy(user.getId()); reportNotice.setUpdateBy(user.getId());
reportDao.addReportNotice(reportNotice); reportDao.addReportNotice(reportNotice);
return 1;
} }
} }
......
...@@ -54,8 +54,15 @@ public class ReportToPdfController extends BaseController { ...@@ -54,8 +54,15 @@ public class ReportToPdfController extends BaseController {
Font textfont = new Font(bfChinese,14,Font.NORMAL);//正常文字 Font textfont = new Font(bfChinese,14,Font.NORMAL);//正常文字
Font urlfont = new Font(bfChinese,12,Font.NORMAL);//路径文字 Font urlfont = new Font(bfChinese,12,Font.NORMAL);//路径文字
//document是创建的文档,FileOutputStream是向文档中输入 //document是创建的文档,FileOutputStream是向文档中输入
PdfWriter.getInstance(document, new FileOutputStream(GConstants.FILE_UPLOAD_DIR+"pdf/"+reportEntity.getReportProject()+"_"+reportEntity.getId()+".pdf")); String reportProjectTitle = reportEntity.getReportProject();
// PdfWriter.getInstance(document, new FileOutputStream("E:/1.pdf")); if (reportProjectTitle.contains("/")){
reportProjectTitle = reportProjectTitle.replace("/","|");
}
if (reportProjectTitle.contains("\\")){
reportProjectTitle = reportProjectTitle.replace("\\","|");
}
PdfWriter.getInstance(document, new FileOutputStream(GConstants.FILE_UPLOAD_DIR+"pdf/"+reportProjectTitle+"_"+reportEntity.getId()+".pdf"));
// PdfWriter.getInstance(document, new FileOutputStream("D:/1.pdf"));
//打开文档 //打开文档
document.open(); document.open();
Paragraph pt1 = new Paragraph("举报内容",title); Paragraph pt1 = new Paragraph("举报内容",title);
...@@ -348,7 +355,7 @@ public class ReportToPdfController extends BaseController { ...@@ -348,7 +355,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(GConstants.FILE_PREFIX_URL+"pdf/"+reportEntity.getReportProject()+"_"+reportEntity.getId()+".pdf"); out.write(GConstants.FILE_PREFIX_URL+"pdf/"+reportProjectTitle+"_"+reportEntity.getId()+".pdf");
out.close(); out.close();
} }
} }
...@@ -148,24 +148,6 @@ ...@@ -148,24 +148,6 @@
path += url; path += url;
}); });
} }
if (reportStatus == "2"){
path += "处理结果</br>";
path += "处理人:${report.dealPersonName}</br>";
path += "处理成果文件:</br>";
$("#attachment3").find("[class='attachmentClass']").each(function(){
var url = $(this).text();
path += url;
});
var dealResult = "${report.dealResult}";
if (dealResult == "North China"){
dealResult = "华北区域公司";
}else if (dealResult == "BeiJing"){
dealResult = "北京区域公司";
}else if (dealResult == "ShangHai"){
dealResult = "上海区域公司";
}
path += "处理结论:"+ dealResult +"</br>";
}
console.log(path); console.log(path);
window.location.href = path; window.location.href = path;
}); });
...@@ -192,7 +174,7 @@ ...@@ -192,7 +174,7 @@
.white_content { .white_content {
display: none; display: none;
position: absolute; position: absolute;
top: 10%; top: 85%;
left: 10%; left: 10%;
width: 80%; width: 80%;
height: 80%; height: 80%;
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<c:forEach items="${noticePage.list}" var="notice" varStatus="vs"> <c:forEach items="${noticePage.list}" var="notice" varStatus="vs">
<tr> <tr>
<td>${vs.count}</td> <td>${vs.count}</td>
<td><a href="${ctx}/notice/view?id=${notice.id}&reportId=${notice.reportId}">${notice.title}。</a></td> <td><a href="${ctx}/notice/view?id=${notice.id}&reportId=${notice.reportId}"><span <c:if test="${notice.status eq '1'}">style="color: #6f4086"</c:if>>${notice.title}。</span></a></td>
<td>${notice.sendTime}</td> <td>${notice.sendTime}</td>
<td>${notice.sendFromId}</td> <td>${notice.sendFromId}</td>
<td> <td>
......
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