Commit 8d5947c6 by sunxin

区域列表sql语句修改、转文档controller修改

parent 6738b3d4
......@@ -71,6 +71,16 @@ public class ReportEntity extends DataEntity<ReportEntity> {
private CtBbtcBusType supplementTypeNew;//业务类型
private Date transTime; //转为线索的时间
private List regionList; //区域列表
public List getRegionList() {
return regionList;
}
public void setRegionList(List regionList) {
this.regionList = regionList;
}
public Date getTransTime() {
return transTime;
}
......
......@@ -10,6 +10,7 @@ import com.ejweb.modules.front.report.entity.IP2Regions;
import com.ejweb.modules.front.report.utils.IpUtils;
import com.ejweb.modules.report.dao.CtBbtcBusCategoryDao;
import com.ejweb.modules.report.dao.CtBbtcBusTypeDao;
import com.ejweb.modules.report.dao.CtBbtcRegionDao;
import com.ejweb.modules.report.dao.ReportDao;
import com.ejweb.modules.report.entity.*;
import com.ejweb.modules.sys.dao.RoleDao;
......@@ -56,6 +57,9 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
@Autowired
private CtBbtcBusCategoryDao ctBbtcBusCategoryDao;
@Autowired
private CtBbtcRegionDao ctBbtcRegionDao;
protected static Logger logger = LoggerFactory.getLogger(ReportService.class);
/**
......@@ -1030,6 +1034,12 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
*/
public Page<ReportEntity> findQyList(Page<ReportEntity> page, ReportEntity reportEntity) {
reportEntity.setPage(page);
/*
* *//*查询出区域列表所有集团 id 封装到reportEntity实体内*//*
List<CtBbtcRegion> allList = ctBbtcRegionDao.findAllList();
System.out.println("区域总数:=========="+allList.size());
reportEntity.setRegionList(allList);
*/
page.setList(reportDao.findQyList(reportEntity));
return page;
}
......
......@@ -3,8 +3,10 @@ package com.ejweb.modules.report.web;
import com.ejweb.conf.GConstants;
import com.ejweb.core.base.BaseController;
import com.ejweb.core.utils.StringUtils;
import com.ejweb.modules.report.entity.CtBbtcBusType;
import com.ejweb.modules.report.entity.ReportAttachmentEntity;
import com.ejweb.modules.report.entity.ReportEntity;
import com.ejweb.modules.report.service.CtBbtcBusTypeService;
import com.ejweb.modules.report.service.ReportService;
import com.itextpdf.text.*;
import com.itextpdf.text.pdf.BaseFont;
......@@ -37,6 +39,9 @@ public class ReportToPdfController extends BaseController {
@Autowired
private ReportService reportService;
@Autowired
protected CtBbtcBusTypeService CtBbtcBusTypeService;
@ModelAttribute
public ReportEntity get(@RequestParam(required = false) String id) {
if (StringUtils.isNotBlank(id)) {
......@@ -206,11 +211,13 @@ public class ReportToPdfController extends BaseController {
PdfPCell supplementDepartment1 = new PdfPCell(new Paragraph(reportEntity.getSupplementDepartment() == null ? "" : reportEntity.getSupplementDepartment(), textfont));
supplementDepartment1.setBorderWidth(0);
table3.addCell(supplementDepartment1);
PdfPCell supplementType = new PdfPCell(new Paragraph("业务类型:", textfont));
supplementType.setBorderWidth(0);
table3.addCell(supplementType);
String supplement_type = reportEntity.getSupplementType();
if (StringUtils.isNotBlank(supplement_type)) {
/* if (StringUtils.isNotBlank(supplement_type)) {
if (supplement_type.equals("1")) {
supplement_type = "营销";
} else if (supplement_type.equals("2")) {
......@@ -228,15 +235,34 @@ public class ReportToPdfController extends BaseController {
}
} else {
supplement_type = "";
}*/
if (StringUtils.isNotBlank(supplement_type)) {
String[] types = supplement_type.split(",");
String typeStr = "";
for (String str:types) {
CtBbtcBusType ctBbtcBusType = CtBbtcBusTypeService.get(str);
if(ctBbtcBusType!=null){
typeStr = typeStr + ctBbtcBusType.getName() + ",";
}else{
typeStr = typeStr + "--";
}
}
supplement_type = typeStr.substring(0, typeStr.length() - 1);
} else {
supplement_type = "";
}
PdfPCell supplementType1 = new PdfPCell(new Paragraph(supplement_type, textfont));
supplementType1.setBorderWidth(0);
table3.addCell(supplementType1);
PdfPCell supplementArea = new PdfPCell(new Paragraph("被举报区域:", textfont));
supplementArea.setBorderWidth(0);
table3.addCell(supplementArea);
String supplement_area = reportEntity.getSupplementArea();
if (StringUtils.isNotBlank(supplement_area)) {
/* if (StringUtils.isNotBlank(supplement_area)) {
if (supplement_area.equals("North China")) {
supplement_area = "华北区域公司";
} else if (supplement_area.equals("BeiJing")) {
......@@ -258,7 +284,8 @@ public class ReportToPdfController extends BaseController {
}
} else {
supplement_area = "";
}
}*/
PdfPCell supplementArea1 = new PdfPCell(new Paragraph(supplement_area, textfont));
supplementArea1.setBorderWidth(0);
table3.addCell(supplementArea1);
......
......@@ -2,8 +2,10 @@ package com.ejweb.modules.report.web;
import com.ejweb.conf.GConstants;
import com.ejweb.core.utils.StringUtils;
import com.ejweb.modules.report.entity.CtBbtcBusType;
import com.ejweb.modules.report.entity.ReportAttachmentEntity;
import com.ejweb.modules.report.entity.ReportEntity;
import com.ejweb.modules.report.service.CtBbtcBusTypeService;
import com.ejweb.modules.report.service.ReportService;
import org.apache.poi.xwpf.usermodel.*;
import org.apache.poi.xwpf.model.XWPFHeaderFooterPolicy;
......@@ -37,6 +39,9 @@ public class ReportToWordController {
@Autowired
private ReportService reportService;
@Autowired
protected CtBbtcBusTypeService CtBbtcBusTypeService;
@ModelAttribute
public ReportEntity get(@RequestParam(required = false) String id) {
if (StringUtils.isNotBlank(id)) {
......@@ -258,10 +263,13 @@ public class ReportToWordController {
XWPFTableRow supplementType = supplementInfoTable.createRow();
supplementType.getCell(0).setText("业务类型:");
String supplement_type = reportEntity.getSupplementType();
String[] types = supplement_type.split(",");
if (StringUtils.isNotBlank(supplement_type)) {
String typeStr = "";
for (String value : types) {
String[] types = supplement_type.split(",");
String typeStr = "";
/* for (String value : types) {
if (value.equals("1")) {
value = "营销";
} else if (value.equals("2")) {
......@@ -295,7 +303,17 @@ public class ReportToWordController {
}
typeStr = typeStr + value + ",";
supplement_type = typeStr.substring(0, typeStr.length() - 1);
}*/
for (String str:types) {
CtBbtcBusType ctBbtcBusType = CtBbtcBusTypeService.get(str);
if(ctBbtcBusType!=null){
typeStr = typeStr + ctBbtcBusType.getName() + ",";
}else{
typeStr = typeStr + "--";
}
}
supplement_type = typeStr.substring(0, typeStr.length() - 1);
} else {
supplement_type = "";
}
......@@ -304,7 +322,8 @@ public class ReportToWordController {
XWPFTableRow supplementArea = supplementInfoTable.createRow();
supplementArea.getCell(0).setText("被举报区域:");
String supplement_area = reportEntity.getSupplementArea();
if (StringUtils.isNotBlank(supplement_area)) {
/* if (StringUtils.isNotBlank(supplement_area)) {
if (supplement_area.equals("North China")) {
supplement_area = "华北区域公司";
} else if (supplement_area.equals("BeiJing")) {
......@@ -326,7 +345,8 @@ public class ReportToWordController {
}
} else {
supplement_area = "";
}
}*/
supplementArea.addNewTableCell().setText(supplement_area);
//表格第六行
XWPFTableRow supplementContent = supplementInfoTable.createRow();
......
......@@ -281,6 +281,7 @@
AND r.exchange_after_user = #{exchangeAfterUser} AND r.create_by = #{exchangeAfterUser}
</if>
<if test="isAdmin != null">
/*
AND su.area IN ('North China',
'BeiJing',
'ShangHai',
......@@ -291,11 +292,14 @@
'Hainan',
'Group',
'PropertyGroup')
*/
AND su.area IS NOT NULL
</if>
<if test="isFzAdmin != null">
AND r.Exchange_After_User = #{exchangeBeforeUser}
AND r.create_by != #{exchangeBeforeUser}
AND su.area IN ('North China',
/*
AND su.area IN ('North China',
'BeiJing',
'ShangHai',
'SouthWest',
......@@ -305,6 +309,8 @@
'Hainan',
'Group',
'PropertyGroup')
*/
AND su.area IS NOT NULL
</if>
<if test="reportStatus != null and reportStatus != ''">
AND r.report_status = #{reportStatus}
......
......@@ -6,6 +6,9 @@
<meta name="decorator" content="default"/>
<script type="text/javascript">
$(document).ready(function() {
getRegion();
//$("#name").focus();
$("#inputForm").validate({
submitHandler: function(form){
......@@ -24,11 +27,13 @@
});
});
function getRegion(ts_describe){
function getRegion(){
var selectNode = $("#supplementType");
selectNode.empty();//每次需要将上一次的数据进行清空
selectNode.append("<option value=''>请选择</option>");
console.log(ts_describe);
var ts_describe= $("#ctBbtcGroup").val();
if(ts_describe != null && ts_describe != ''){
$.ajax({
type: "POST",
......@@ -52,7 +57,7 @@
}
});
}else{
top.$.jBox.tip('请选择所属集团', 'warning');
/*top.$.jBox.tip('请选择所属集团', 'warning');*/
}
}
......@@ -83,7 +88,7 @@
<div class="control-group">
<label class="control-label">所属集团:</label>
<div class="controls">
<form:select onchange="getRegion(value)" path="ctBbtcGroup" class="input-xlarge required">
<form:select onchange="getRegion()" path="ctBbtcGroup" class="input-xlarge required" id="ctBbtcGroup" cssStyle="width: 285px">
<form:option value="">请选择</form:option>
<form:options items="${fns:getDictList('supplement_group')}" itemLabel="label" itemValue="id"
htmlEscape="false"/>
......@@ -95,7 +100,7 @@
<div class="control-group">
<label class="control-label">所属业务类型:</label>
<div class="controls">
<form:select onchange="resetPageNo();" path="type.id" class="input-xlarge required" id="supplementType" >
<form:select onchange="resetPageNo();" path="type.id" class="input-xlarge required" id="supplementType" cssStyle="width: 285px" >
<form:option value="">请选择</form:option>
</form:select>
<%--<form:input path="type" htmlEscape="false" maxlength="64" class="input-xlarge "/>--%>
......
......@@ -50,7 +50,7 @@
<div class="control-group">
<label class="control-label">所属集团:</label>
<div class="controls">
<form:select onchange="resetPageNo();" path="group" class="input-xlarge required">
<form:select onchange="resetPageNo();" path="group" class="input-xlarge required" cssStyle="width: 285px">
<form:option value="">请选择</form:option>
<form:options items="${fns:getDictList('supplement_group')}" itemLabel="label" itemValue="id"
htmlEscape="false"/></form:select>
......
......@@ -50,7 +50,7 @@
<div class="control-group">
<label class="control-label">所属集团:</label>
<div class="controls">
<form:select onchange="resetPageNo();" path="group" class="input-xlarge required">
<form:select onchange="resetPageNo();" path="group" class="input-xlarge required" cssStyle="width: 285px">
<form:option value="">请选择</form:option>
<form:options items="${fns:getDictList('supplement_group')}" itemLabel="label" itemValue="id"
htmlEscape="false"/></form:select>
......
......@@ -547,18 +547,17 @@
}
});
}else{
top.$.jBox.tip('请选择被举报集团', 'warning');
/*top.$.jBox.tip('请选择被举报集团', 'warning');*/
}
}
/*跟据集团 获取对应的业务类型 和业务类别 */
function getDepartment(ts_describe){
function getDepartment(){
var selectNode = $("#transferDepartment");
selectNode.empty();//每次需要将上一次的数据进行清空
selectNode.append("<option value=''>请选择</option>");
if($("#transferGroup").val() !=null && $("#transferGroup").val() != ''){
ts_describe= $("#transferGroup").val();
}
var ts_describe= $("#transferGroupSelect").val();
if(ts_describe != null && ts_describe != ''){
$.ajax({
type: "POST",
......@@ -576,13 +575,9 @@
if (data1 != '') {
var slsb=document.getElementById("transferDepartment");
for (var i = 0;i < data1.length;i++){
/* if(i==0){
slsb.options[i] = new Option("请选择","");
}*/
slsb.append(new Option(data1[i].name,data1[i].id));
}
}
$("#transferDepartment").val("");
},error:function(data){
alert("系统错误");
}
......@@ -943,7 +938,7 @@
<br>
<label class="control-label">处理结论:</label>
<div class="controls">
<form:select path="dealResult" id="dealResult" class="input-small required" onchange="showDone();" cssStyle="width: 280px">
<form:select path="dealResult" id="dealResult" class="input-small required" onchange="showDone();" cssStyle="width: 285px">
<form:option value=" ">请选择</form:option>
<form:options items="${fns:getDictList('deal_result')}" itemLabel="label" itemValue="value"
htmlEscape="false"/>
......@@ -953,7 +948,7 @@
<div id="transferGroup" class="control-group" style="display:none">
<label class="control-label">移交集团:</label>
<div class="controls">
<form:select id="" path="transferGroup" class="input-small required" onchange="getDepartment(value)" cssStyle="width: 280px">
<form:select id="transferGroupSelect" path="transferGroup" class="input-small required" onchange="getDepartment()" cssStyle="width: 280px">
<form:option value="">请选择</form:option>
<form:options items="${fns:getDictList('supplement_group')}" itemLabel="label" itemValue="id"
htmlEscape="false"/></form:select>
......
......@@ -6,6 +6,7 @@
<meta name="decorator" content="default"/>
<script type="text/javascript">
$(document).ready(function () {
getRegion();
$("#no").focus();
$("#inputForm").validate({
rules: {
......@@ -31,8 +32,12 @@
});
});
function getRegion(ts_describe){
function getRegion(){
var selectNode = $("#supplementArea");
selectNode.empty();//每次需要将上一次的数据进行清空
selectNode.append("<option value=''>请选择</option>");
var ts_describe= $("#supplementGroup").val();
if(ts_describe != null && ts_describe != ''){
$.ajax({
type: "POST",
......@@ -41,36 +46,21 @@
success: function(returnedData) {
console.log(returnedData);
var data1 = returnedData.ctBbtcRegionList;
var data2 = returnedData.ctBbtcBusTypeList;
// console.log(data1[0].name);
// console.log(data2[0].name);
var selectNode = $("#supplementArea");
selectNode.empty();//每次需要将上一次的数据进行清空
/* $("#supplementArea").append("<option value=''>请选择</option>");*/
/* slsb.option("请选择","");*/
if (data1 != '') {
if (data1 != '') {
var slsb=document.getElementById("supplementArea");
for (var i = 0;i < data1.length;i++){
/* if(i==0){
slsb.options[i] = new Option("请选择","");
}*/
slsb.options[i] = new Option(data1[i].name,data1[i].id);
slsb.append(new Option(data1[i].name,data1[i].id));
}
}
/*每次更新选项 ================================*/
$("#supplementArea").prepend("<option value=''>请选择</option>");
/* $("#supplementArea option[text='请选择']").attr("selected", true);
$("#supplementArea").val("");*/
$("#supplementArea option").eq(0).attr("selected",true);
$("#supplementArea option[text='请选择']").attr("selected", "selected");
},error:function(data){
alert("系统错误");
}
});
}else{
top.$.jBox.tip('请选择被举报集团', 'warning');
/* top.$.jBox.tip('请选择被举报集团', 'warning');*/
}
}
......@@ -134,7 +124,7 @@
<div class="control-group">
<label class="control-label">所属集团:</label>
<div class="controls">
<form:select id="supplementGroup" path="supplementGroup" class="input-small required" onchange="getRegion(value)">
<form:select id="supplementGroup" path="supplementGroup" class="input-small " onchange="getRegion()" cssStyle="width: 220px">
<form:option value="">请选择</form:option>
<form:options items="${fns:getDictList('supplement_group')}" itemLabel="label" itemValue="id"
htmlEscape="false"/>
......@@ -146,12 +136,12 @@
<div class="control-group">
<label class="control-label">所属区域:</label>
<div class="controls">
<form:select id="supplementArea" path="area" class="input-small required">
<form:select id="supplementArea" path="area" class="input-small " cssStyle="width: 220px">
<form:option value="">请选择</form:option>
<%-- <form:options items="${fns:getDictList('supplement_area')}" itemLabel="label" itemValue="value"
htmlEscape="false"/>--%>
</form:select>
<span class="help-inline"><font color="red">*</font> </span>
<%-- <span class="help-inline"><font color="red">*</font> </span>--%>
</div>
</div>
<%--<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