Commit dadf708f by yjh

业务类型改成多选框

parent a83eed6f
...@@ -45,6 +45,8 @@ public class ReportEntity extends DataEntity<ReportEntity> { ...@@ -45,6 +45,8 @@ public class ReportEntity extends DataEntity<ReportEntity> {
private String supplementAttachment; //补充提交文件 private String supplementAttachment; //补充提交文件
private String dealAttachment; //处理成果文件 private String dealAttachment; //处理成果文件
private String[] types;//新业务类型
@ExcelField(title="被举报项目", align=2, sort=24) @ExcelField(title="被举报项目", align=2, sort=24)
public String getReportProject() { public String getReportProject() {
return reportProject; return reportProject;
...@@ -279,4 +281,12 @@ public class ReportEntity extends DataEntity<ReportEntity> { ...@@ -279,4 +281,12 @@ public class ReportEntity extends DataEntity<ReportEntity> {
public void setDealAttachment(String dealAttachment) { public void setDealAttachment(String dealAttachment) {
this.dealAttachment = dealAttachment; this.dealAttachment = dealAttachment;
} }
public String[] getTypes() {
return types;
}
public void setTypes(String[] types) {
this.types = types;
}
} }
...@@ -327,27 +327,47 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> { ...@@ -327,27 +327,47 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
public List<ReportEntity> getReportList(ReportEntity reportEntity){ public List<ReportEntity> getReportList(ReportEntity reportEntity){
List<ReportEntity> reportList = dao.findList(reportEntity); List<ReportEntity> reportList = dao.findList(reportEntity);
for (ReportEntity report : reportList) { for (ReportEntity report : reportList) {
String supplementType = report.getSupplementType(); String typeStr="";
if (StringUtils.isNotBlank(supplementType)) { String[] types = report.getSupplementType().split(",");
if (supplementType.equals("1")) { for (String value : types) {
supplementType = "营销"; if (value.equals("1")) {
} else if (supplementType.equals("2")) { value = "营销";
supplementType = "工程"; } else if (value.equals("2")) {
} else if (supplementType.equals("3")) { value = "工程";
supplementType = "成本"; } else if (value.equals("3")) {
} else if (supplementType.equals("4")) { value = "成本";
supplementType = "招采"; } else if (value.equals("4")) {
} else if (supplementType.equals("5")) { value = "招采";
supplementType = "人力"; } else if (value.equals("5")) {
} else if (supplementType.equals("6")) { value = "人力";
supplementType = "物业"; } else if (value.equals("6")) {
} else if (supplementType.equals("7")) { value = "物业";
supplementType = "投诉"; } else if (value.equals("7")) {
value = "投诉";
} }
}else{ typeStr =typeStr+value+",";
supplementType = "";
} }
report.setSupplementType(supplementType); report.setSupplementType(typeStr.substring(0,typeStr.length()-1));
// if (StringUtils.isNotBlank(supplementType)) {
// if (supplementType.equals("1")) {
// supplementType = "营销";
// } else if (supplementType.equals("2")) {
// supplementType = "工程";
// } else if (supplementType.equals("3")) {
// supplementType = "成本";
// } else if (supplementType.equals("4")) {
// supplementType = "招采";
// } else if (supplementType.equals("5")) {
// supplementType = "人力";
// } else if (supplementType.equals("6")) {
// supplementType = "物业";
// } else if (supplementType.equals("7")) {
// supplementType = "投诉";
// }
// }else{
// supplementType = "";
// }
// report.setSupplementType(supplementType);
String reportStatus = report.getReportStatus(); String reportStatus = report.getReportStatus();
if (StringUtils.isNotBlank(reportStatus)) { if (StringUtils.isNotBlank(reportStatus)) {
if (reportStatus.equals("0")) { if (reportStatus.equals("0")) {
......
...@@ -80,6 +80,43 @@ public class ReportController extends BaseController { ...@@ -80,6 +80,43 @@ public class ReportController extends BaseController {
} }
Page<ReportEntity> page = reportService.findPage(new Page<ReportEntity>(request, response), reportEntity); Page<ReportEntity> page = reportService.findPage(new Page<ReportEntity>(request, response), reportEntity);
List<ReportEntity> reportlist = page.getList();
for (ReportEntity report : reportlist){
String typeStr="";
if (StringUtils.isNoneBlank(report.getSupplementType())) {
String[] types = report.getSupplementType().split(",");
for (String value : types) {
if (value.equals("1")) {
value = "营销";
} else if (value.equals("2")) {
value = "工程";
} else if (value.equals("3")) {
value = "成本";
} else if (value.equals("4")) {
value = "招采";
} else if (value.equals("5")) {
value = "人力";
} else if (value.equals("6")) {
value = "物业";
} else if (value.equals("7")) {
value = "投诉";
} else if (value.equals("8")) {
value = "行政";
} else if (value.equals("9")) {
value = "财务";
} else if (value.equals("10")) {
value = "商业管理";
} else if (value.equals("11")) {
value = "研发";
} else if(value.equals("12")) {
value ="投资开发";
}
typeStr =typeStr+value+",";
}
report.setSupplementType(typeStr.substring(0,typeStr.length()-1));
}
}
page.setList(reportlist);
model.addAttribute("page", page); model.addAttribute("page", page);
model.addAttribute("report", reportEntity); model.addAttribute("report", reportEntity);
model.addAttribute("flag", flag); model.addAttribute("flag", flag);
...@@ -129,6 +166,17 @@ public class ReportController extends BaseController { ...@@ -129,6 +166,17 @@ public class ReportController extends BaseController {
ReportAttachmentEntity reportAttachment = new ReportAttachmentEntity(); ReportAttachmentEntity reportAttachment = new ReportAttachmentEntity();
reportAttachment.setReportId(reportEntity.getId()); reportAttachment.setReportId(reportEntity.getId());
reportAttachment.setAttachmentType("0"); reportAttachment.setAttachmentType("0");
String supplementType="";
String[] supplementTypes={"营销","工程","成本","招采","人力","物业","投诉","行政","财务","商业管理","研发","投资开发"};
String typeNumber[]=reportEntity.getSupplementType().split(",");
for(int i=0;i<typeNumber.length;i++)
{
supplementType+=supplementTypes[Integer.valueOf(typeNumber[i])-1]+",";
}
supplementType=supplementType.substring(0,supplementType.length()-1);
reportEntity.setSupplementType(supplementType);
List<ReportAttachmentEntity> reportAttachmentList = reportService.getAttachmentInfo(reportAttachment); List<ReportAttachmentEntity> reportAttachmentList = reportService.getAttachmentInfo(reportAttachment);
//获取补充提交文件列表 //获取补充提交文件列表
ReportAttachmentEntity supplementAttachment = new ReportAttachmentEntity(); ReportAttachmentEntity supplementAttachment = new ReportAttachmentEntity();
...@@ -144,6 +192,7 @@ public class ReportController extends BaseController { ...@@ -144,6 +192,7 @@ public class ReportController extends BaseController {
model.addAttribute("reportAttachmentList", reportAttachmentList); model.addAttribute("reportAttachmentList", reportAttachmentList);
model.addAttribute("supplementAttachmentList", supplementAttachmentList); model.addAttribute("supplementAttachmentList", supplementAttachmentList);
model.addAttribute("dealAttachmentList", dealAttachmentList); model.addAttribute("dealAttachmentList", dealAttachmentList);
return "modules/report/reportDetail"; return "modules/report/reportDetail";
} }
......
...@@ -59,6 +59,7 @@ public class ReportToWordController { ...@@ -59,6 +59,7 @@ public class ReportToWordController {
} }
FileOutputStream out = new FileOutputStream(GConstants.FILE_UPLOAD_DIR+"pdf/"+reportProjectTitle+"_"+reportEntity.getId()+".docx"); FileOutputStream out = new FileOutputStream(GConstants.FILE_UPLOAD_DIR+"pdf/"+reportProjectTitle+"_"+reportEntity.getId()+".docx");
// FileOutputStream out = new FileOutputStream("D:/1.docx"); // FileOutputStream out = new FileOutputStream("D:/1.docx");
// FileOutputStream out = new FileOutputStream("C:/1.docx");
//添加标题 //添加标题
XWPFParagraph titleParagraph = document.createParagraph(); XWPFParagraph titleParagraph = document.createParagraph();
//设置段落居中 //设置段落居中
...@@ -243,25 +244,49 @@ public class ReportToWordController { ...@@ -243,25 +244,49 @@ public class ReportToWordController {
XWPFTableRow supplementType = supplementInfoTable.createRow(); XWPFTableRow supplementType = supplementInfoTable.createRow();
supplementType.getCell(0).setText("业务类型:"); supplementType.getCell(0).setText("业务类型:");
String supplement_type = reportEntity.getSupplementType(); String supplement_type = reportEntity.getSupplementType();
String[] types = supplement_type.split(",");
if (StringUtils.isNotBlank(supplement_type)) { if (StringUtils.isNotBlank(supplement_type)) {
if (supplement_type.equals("1")) { String typeStr="";
supplement_type = "营销"; for(String value : types)
} else if (supplement_type.equals("2")) { {
supplement_type = "工程"; if (value.equals("1")) {
} else if (supplement_type.equals("3")) { value = "营销";
supplement_type = "成本"; } else if (value.equals("2")) {
} else if (supplement_type.equals("4")) { value = "工程";
supplement_type = "招采"; } else if (value.equals("3")) {
} else if (supplement_type.equals("5")) { value = "成本";
supplement_type = "人力"; } else if (value.equals("4")) {
} else if (supplement_type.equals("6")) { value = "招采";
supplement_type = "物业"; } else if (value.equals("5")) {
} else if (supplement_type.equals("7")) { value = "人力";
supplement_type = "投诉"; } else if (value.equals("6")) {
value = "物业";
} else if (value.equals("7")) {
value = "投诉";
}
typeStr =typeStr+value+",";
supplement_type=typeStr.substring(0,typeStr.length()-1);
} }
} else {
supplement_type = ""; // if (supplement_type.equals("1")) {
// supplement_type = "营销";
// } else if (supplement_type.equals("2")) {
// supplement_type = "工程";
// } else if (supplement_type.equals("3")) {
// supplement_type = "成本";
// } else if (supplement_type.equals("4")) {
// supplement_type = "招采";
// } else if (supplement_type.equals("5")) {
// supplement_type = "人力";
// } else if (supplement_type.equals("6")) {
// supplement_type = "物业";
// } else if (supplement_type.equals("7")) {
// supplement_type = "投诉";
// }
// } else {
// supplement_type = "";
} }
supplementType.getCell(1).setText(supplement_type); supplementType.getCell(1).setText(supplement_type);
//表格第五行 //表格第五行
XWPFTableRow supplementArea = supplementInfoTable.createRow(); XWPFTableRow supplementArea = supplementInfoTable.createRow();
......
#MySQL Database Config(The All Config Is Must) #MySQL Database Config(The All Config Is Must)
db.table.prefix=sunac_ db.table.prefix=sunac_
#jdbc.type=mysql jdbc.type=mysql
#jdbc.driver.class=com.mysql.jdbc.Driver jdbc.driver.class=com.mysql.jdbc.Driver
#jdbc.url=jdbc:mysql://123.56.146.7:3306/sunac_report?useUnicode=true&characterEncoding=utf-8 jdbc.url=jdbc:mysql://123.56.146.7:3306/sunac_report?useUnicode=true&characterEncoding=utf-8
#jdbc.username=reportuser jdbc.username=reportuser
#jdbc.password=$R@20$7 jdbc.password=$R@20$7
jdbc.type=oracle #jdbc.type=oracle
jdbc.driver.class=oracle.jdbc.driver.OracleDriver #jdbc.driver.class=oracle.jdbc.driver.OracleDriver
jdbc.url=jdbc:oracle:thin:@192.168.2.53:1521:eas #jdbc.url=jdbc:oracle:thin:@192.168.2.53:1521:eas
jdbc.username=eas7531 #jdbc.username=eas7531
jdbc.password=sunac #jdbc.password=sunac
#初始化连接 #初始化连接
jdbc.initialSize=0 jdbc.initialSize=0
......
...@@ -87,7 +87,10 @@ ...@@ -87,7 +87,10 @@
<if test="dbName == 'mysql'">CONCAT('%', #{reportPersonTel}, '%')</if> <if test="dbName == 'mysql'">CONCAT('%', #{reportPersonTel}, '%')</if>
</if> </if>
<if test="supplementType != null and supplementType != ''"> <if test="supplementType != null and supplementType != ''">
AND r.supplement_type = #{supplementType} AND r.supplement_type LIKE
<if test="dbName == 'oracle'">'%'||#{supplementType}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{supplementType}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{supplementType}, '%')</if>
</if> </if>
<if test="dealResult != null and dealResult != ''"> <if test="dealResult != null and dealResult != ''">
AND r.deal_result = #{dealResult} AND r.deal_result = #{dealResult}
......
...@@ -190,7 +190,14 @@ ...@@ -190,7 +190,14 @@
<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:input id="supplementType" path="supplementType" htmlEscape="false" maxlength="200" class="input-xlarge required"/> <%--<form:input id="supplementType" items="split(${report.supplementType},',')" path="supplementType"--%>
<%--htmlEscape="false" maxlength="200" class="input-xlarge required"/>--%>
<c:forEach items="${report.supplementType}" var="Type" >
<form:input id="supplementType"
path="supplementType"
htmlEscape="false" maxlength="200" class="input-xlarge required"/>
</c:forEach>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
......
...@@ -138,15 +138,7 @@ ...@@ -138,15 +138,7 @@
<tr> <tr>
<td>${vs.count}</td> <td>${vs.count}</td>
<td>${report.supplementTitle}</td> <td>${report.supplementTitle}</td>
<td> <td>${report.supplementType}</td>
<c:if test="${report.supplementType eq '1'}">营销</c:if>
<c:if test="${report.supplementType eq '2'}">工程</c:if>
<c:if test="${report.supplementType eq '3'}">成本</c:if>
<c:if test="${report.supplementType eq '4'}">招采</c:if>
<c:if test="${report.supplementType eq '5'}">人力</c:if>
<c:if test="${report.supplementType eq '6'}">物业</c:if>
<c:if test="${report.supplementType eq '7'}">投诉</c:if>
</td>
<td>${report.reportProject}</td> <td>${report.reportProject}</td>
<td>${report.reportPersonName}</td> <td>${report.reportPersonName}</td>
<td>${report.reportPersonTel}</td> <td>${report.reportPersonTel}</td>
......
<%@ taglib prefix="from" uri="http://www.springframework.org/tags/form" %>
<%@ page contentType="text/html;charset=UTF-8" %> <%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %> <%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html> <html>
...@@ -105,23 +106,24 @@ ...@@ -105,23 +106,24 @@
path += "标题:${report.supplementTitle}</br>"; path += "标题:${report.supplementTitle}</br>";
path += "被举报公司:${report.supplementCompany}</br>"; path += "被举报公司:${report.supplementCompany}</br>";
path += "被举报部门:${report.supplementDepartment}</br>"; path += "被举报部门:${report.supplementDepartment}</br>";
var supplementType = "${report.supplementType}"; //12:01注
if (supplementType == "1"){ <%--var supplementType = "${report.supplementType}";--%>
supplementType = "营销"; <%--if (supplementType == "1"){--%>
}else if (supplementType == "2"){ <%--supplementType = "营销";--%>
supplementType = "工程"; <%--}else if (supplementType == "2"){--%>
}else if (supplementType == "3"){ <%--supplementType = "工程";--%>
supplementType = "成本"; <%--}else if (supplementType == "3"){--%>
}else if (supplementType == "4"){ <%--supplementType = "成本";--%>
supplementType = "招采"; <%--}else if (supplementType == "4"){--%>
}else if (supplementType == "5"){ <%--supplementType = "招采";--%>
supplementType = "人力"; <%--}else if (supplementType == "5"){--%>
}else if (supplementType == "6"){ <%--supplementType = "人力";--%>
supplementType = "物业"; <%--}else if (supplementType == "6"){--%>
}else if (supplementType == "7"){ <%--supplementType = "物业";--%>
supplementType = "投诉"; <%--}else if (supplementType == "7"){--%>
} <%--supplementType = "投诉";--%>
path += "业务类型:"+supplementType+"</br>"; <%--}--%>
// path += "业务类型:"+supplementType+"</br>";
var supplementArea = "${report.supplementArea}"; var supplementArea = "${report.supplementArea}";
if (supplementArea == "North China"){ if (supplementArea == "North China"){
supplementArea = "华北区域公司"; supplementArea = "华北区域公司";
...@@ -154,8 +156,16 @@ ...@@ -154,8 +156,16 @@
console.log(path); console.log(path);
window.location.href = path; window.location.href = path;
}); });
var checkedNumber = "${report.supplementType}";
var number=checkedNumber.split(",");
var ck=document.getElementsByName("supplementType");
for (var i = 0; i < number.length; i++) {
ck[number[i]-1].checked=true;
}
}); });
</script> </script>
<style type="text/css"> <style type="text/css">
.title{ .title{
...@@ -232,11 +242,14 @@ ...@@ -232,11 +242,14 @@
<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:select id="supplementType" path="supplementType" class="input-small required"> <span class="supplementType">
<form:option value=" ">请选择</form:option> <form:checkboxes path="supplementType" items="${fns:getDictList('supplement_type')}" itemLabel="label" itemValue="value"/>
<form:options items="${fns:getDictList('supplement_type')}" itemLabel="label" itemValue="value" </span>
htmlEscape="false"/></form:select> <%--<form:select id="supplementType" path="supplementType" class="input-small required">--%>
<span class="help-inline"><font color="red">*</font> </span> <%--<form:option value=" ">请选择</form:option>--%>
<%--<form:options items="${fns:getDictList('supplement_type')}" itemLabel="label" itemValue="value"--%>
<%--htmlEscape="false"/></form:select>--%>
<%--<span class="help-inline"><font color="red">*</font> </span>--%>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
......
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