bug
This commit is contained in:
@ -32,18 +32,18 @@ import java.util.List;
|
|||||||
import static org.apache.poi.ss.usermodel.CellType.STRING;
|
import static org.apache.poi.ss.usermodel.CellType.STRING;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class SewageService implements CommService<Sewage>{
|
public class SewageService implements CommService<Sewage> {
|
||||||
@Resource
|
@Resource
|
||||||
private SewageDao SewageDao;
|
private SewageDao SewageDao;
|
||||||
@Resource
|
@Resource
|
||||||
private UnitService unitService;
|
private UnitService unitService;
|
||||||
@Resource
|
@Resource
|
||||||
private CompanyService companyService;
|
private CompanyService companyService;
|
||||||
@Resource
|
@Resource
|
||||||
private ProcessSectionService processSectionService;
|
private ProcessSectionService processSectionService;
|
||||||
@Resource
|
@Resource
|
||||||
private SewageInputService sewageInputService;
|
private SewageInputService sewageInputService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private JsywPointService jsywPointService;
|
private JsywPointService jsywPointService;
|
||||||
|
|
||||||
@ -62,84 +62,86 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Sewage selectById(String id) {
|
public Sewage selectById(String id) {
|
||||||
Sewage sewage = SewageDao.selectByPrimaryKey(id);
|
Sewage sewage = SewageDao.selectByPrimaryKey(id);
|
||||||
sewage.setCompany(this.unitService.getCompById(sewage.getUnitId()));
|
sewage.setCompany(this.unitService.getCompById(sewage.getUnitId()));
|
||||||
ProcessSection processSection = this.getProcessSectionByStoredValue(sewage.getProcessSectionId());
|
ProcessSection processSection = this.getProcessSectionByStoredValue(sewage.getProcessSectionId());
|
||||||
if (processSection != null) {
|
if (processSection != null) {
|
||||||
sewage.setProcessSection(processSection);
|
sewage.setProcessSection(processSection);
|
||||||
}
|
}
|
||||||
List<SewageInput> sewageInputList = this.sewageInputService.selectListByWhere("where sewage_id='"+sewage.getContractNumber()+"' order by insdt");
|
List<SewageInput> sewageInputList = this.sewageInputService.selectListByWhere("where sewage_id='" + sewage.getContractNumber() + "' order by insdt");
|
||||||
if(sewageInputList!=null && sewageInputList.size()>0){
|
if (sewageInputList != null && sewageInputList.size() > 0) {
|
||||||
sewage.set_input(true);
|
sewage.set_input(true);
|
||||||
}else{
|
} else {
|
||||||
sewage.set_input(false);
|
sewage.set_input(false);
|
||||||
}
|
}
|
||||||
List<JsywPoint> jsywPointList = this.jsywPointService.selectListByWhere("where psname='"+sewage.getName()+"' order by update_date");
|
List<JsywPoint> jsywPointList = this.jsywPointService.selectListByWhere("where psname='" + sewage.getName() + "' order by update_date");
|
||||||
if(jsywPointList!=null && jsywPointList.size()>0){
|
if (jsywPointList != null && jsywPointList.size() > 0) {
|
||||||
sewage.set_point(true);
|
sewage.set_point(true);
|
||||||
}else{
|
} else {
|
||||||
sewage.set_point(false);
|
sewage.set_point(false);
|
||||||
}
|
}
|
||||||
return sewage;
|
return sewage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int deleteById(String id) {
|
|
||||||
return SewageDao.deleteByPrimaryKey(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int save(Sewage sewage) {
|
|
||||||
return SewageDao.insert(sewage);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int update(Sewage sewage) {
|
|
||||||
return SewageDao.updateByPrimaryKeySelective(sewage);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Sewage> selectListByWhere(String wherestr) {
|
public int deleteById(String id) {
|
||||||
Sewage sewage = new Sewage();
|
return SewageDao.deleteByPrimaryKey(id);
|
||||||
sewage.setWhere(wherestr);
|
}
|
||||||
List<Sewage> list = SewageDao.selectListByWhere(sewage);
|
|
||||||
for (Sewage item : list) {
|
@Override
|
||||||
item.setCompany(this.unitService.getCompById(item.getUnitId()));
|
public int save(Sewage sewage) {
|
||||||
ProcessSection processSection = this.getProcessSectionByStoredValue(item.getProcessSectionId());
|
return SewageDao.insert(sewage);
|
||||||
if (processSection != null) {
|
}
|
||||||
item.setProcessSection(processSection);
|
|
||||||
}
|
@Override
|
||||||
List<SewageInput> sewageInputList = this.sewageInputService.selectListByWhere4Pure("where sewage_id='"+item.getContractNumber()+"' order by insdt");
|
public int update(Sewage sewage) {
|
||||||
if(sewageInputList!=null && sewageInputList.size()>0){
|
return SewageDao.updateByPrimaryKeySelective(sewage);
|
||||||
item.set_input(true);
|
}
|
||||||
}else{
|
|
||||||
|
@Override
|
||||||
|
public List<Sewage> selectListByWhere(String wherestr) {
|
||||||
|
Sewage sewage = new Sewage();
|
||||||
|
sewage.setWhere(wherestr);
|
||||||
|
List<Sewage> list = SewageDao.selectListByWhere(sewage);
|
||||||
|
for (Sewage item : list) {
|
||||||
|
item.setCompany(this.unitService.getCompById(item.getUnitId()));
|
||||||
|
ProcessSection processSection = this.getProcessSectionByStoredValue(item.getProcessSectionId());
|
||||||
|
if (processSection != null) {
|
||||||
|
item.setProcessSection(processSection);
|
||||||
|
}
|
||||||
|
List<SewageInput> sewageInputList = this.sewageInputService.selectListByWhere4Pure("where sewage_id='" + item.getContractNumber() + "' order by insdt");
|
||||||
|
if (sewageInputList != null && sewageInputList.size() > 0) {
|
||||||
|
item.set_input(true);
|
||||||
|
} else {
|
||||||
item.set_input(false);
|
item.set_input(false);
|
||||||
}
|
}
|
||||||
List<JsywPoint> jsywPointList = this.jsywPointService.selectListByWhere("where psname='"+item.getName()+"' order by update_date");
|
List<JsywPoint> jsywPointList = this.jsywPointService.selectListByWhere("where psname='" + item.getName() + "' order by update_date");
|
||||||
if(jsywPointList!=null && jsywPointList.size()>0){
|
if (jsywPointList != null && jsywPointList.size() > 0) {
|
||||||
item.set_point(true);
|
item.set_point(true);
|
||||||
}else{
|
} else {
|
||||||
item.set_point(false);
|
item.set_point(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
@Override
|
|
||||||
public int deleteByWhere(String wherestr) {
|
@Override
|
||||||
Sewage sewage = new Sewage();
|
public int deleteByWhere(String wherestr) {
|
||||||
sewage.setWhere(wherestr);
|
Sewage sewage = new Sewage();
|
||||||
return SewageDao.deleteByWhere(sewage);
|
sewage.setWhere(wherestr);
|
||||||
}
|
return SewageDao.deleteByWhere(sewage);
|
||||||
|
}
|
||||||
|
|
||||||
public List<Sewage> selectDistinctCityByWhere(String wherestr) {
|
public List<Sewage> selectDistinctCityByWhere(String wherestr) {
|
||||||
Sewage sewage = new Sewage();
|
Sewage sewage = new Sewage();
|
||||||
sewage.setWhere(wherestr);
|
sewage.setWhere(wherestr);
|
||||||
List<Sewage> list = SewageDao.selectDistinctCityByWhere(sewage);
|
List<Sewage> list = SewageDao.selectDistinctCityByWhere(sewage);
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xls文件数据转换
|
* xls文件数据转换
|
||||||
*
|
*
|
||||||
@ -154,24 +156,26 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
return cell.getCellFormula();
|
return cell.getCellFormula();
|
||||||
case NUMERIC:
|
case NUMERIC:
|
||||||
|
|
||||||
//判断是否为日期类型
|
//判断是否为日期类型
|
||||||
if (DateUtil.isCellDateFormatted(cell)) {
|
if (DateUtil.isCellDateFormatted(cell)) {
|
||||||
//用于转化为日期格式
|
//用于转化为日期格式
|
||||||
Date d = cell.getDateCellValue();
|
Date d = cell.getDateCellValue();
|
||||||
SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
String cellDate = formater.format(d);
|
String cellDate = formater.format(d);
|
||||||
return cellDate;
|
return cellDate;
|
||||||
} else {
|
} else {
|
||||||
cell.setCellType(STRING);
|
cell.setCellType(STRING);
|
||||||
return cell.getStringCellValue();
|
return cell.getStringCellValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
case STRING:
|
case STRING:
|
||||||
return cell.getStringCellValue();
|
return cell.getStringCellValue();
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} private String getBizId(String bizName) {
|
}
|
||||||
|
|
||||||
|
private String getBizId(String bizName) {
|
||||||
String bizId = "";
|
String bizId = "";
|
||||||
List<Company> CompanyList = this.companyService.selectListByWhere("where sname = '" + bizName + "' or name = '" + bizName + "' ");
|
List<Company> CompanyList = this.companyService.selectListByWhere("where sname = '" + bizName + "' or name = '" + bizName + "' ");
|
||||||
if (CompanyList != null && CompanyList.size() > 0) {
|
if (CompanyList != null && CompanyList.size() > 0) {
|
||||||
@ -201,20 +205,20 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
int maxCellNum = row.getLastCellNum();//最后一列
|
int maxCellNum = row.getLastCellNum();//最后一列
|
||||||
|
|
||||||
Sewage sewage = new Sewage();
|
Sewage sewage = new Sewage();
|
||||||
|
|
||||||
HSSFCell cell = row.getCell(1);
|
HSSFCell cell = row.getCell(1);
|
||||||
if (getStringVal(cell)==null) {
|
if (getStringVal(cell) == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
sewage.setContractNumber(getStringVal(cell));
|
sewage.setContractNumber(getStringVal(cell));
|
||||||
|
|
||||||
cell = row.getCell(2);
|
cell = row.getCell(2);
|
||||||
System.out.println(getStringVal(cell));
|
System.out.println(getStringVal(cell));
|
||||||
sewage.setContractOrder(Integer.parseInt(getStringVal(cell)));
|
sewage.setContractOrder(Integer.parseInt(getStringVal(cell)));
|
||||||
|
|
||||||
cell = row.getCell(3);
|
cell = row.getCell(3);
|
||||||
sewage.setName(getStringVal(cell));
|
sewage.setName(getStringVal(cell));
|
||||||
|
|
||||||
cell = row.getCell(4);
|
cell = row.getCell(4);
|
||||||
sewage.setAddress(getStringVal(cell));
|
sewage.setAddress(getStringVal(cell));
|
||||||
cell = row.getCell(5);
|
cell = row.getCell(5);
|
||||||
@ -224,10 +228,10 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
cell = row.getCell(7);
|
cell = row.getCell(7);
|
||||||
sewage.setPhone(getStringVal(cell));
|
sewage.setPhone(getStringVal(cell));
|
||||||
cell = row.getCell(8);
|
cell = row.getCell(8);
|
||||||
List<ProcessSection> processSectionList = this.processSectionService.selectListByWhere("where name = '"+getStringVal(cell)+"' and unit_id = 'JSBZ'");
|
List<ProcessSection> processSectionList = this.processSectionService.selectListByWhere("where name = '" + getStringVal(cell) + "' and unit_id = 'JSBZ'");
|
||||||
if (processSectionList.size()>0) {
|
if (processSectionList.size() > 0) {
|
||||||
sewage.setProcessSectionId(processSectionList.get(0)==null?"":processSectionList.get(0).getCode());
|
sewage.setProcessSectionId(processSectionList.get(0) == null ? "" : processSectionList.get(0).getCode());
|
||||||
}
|
}
|
||||||
cell = row.getCell(9);
|
cell = row.getCell(9);
|
||||||
sewage.setUnitId(this.getBizId(getStringVal(cell)));
|
sewage.setUnitId(this.getBizId(getStringVal(cell)));
|
||||||
cell = row.getCell(10);
|
cell = row.getCell(10);
|
||||||
@ -241,7 +245,7 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
cell = row.getCell(14);
|
cell = row.getCell(14);
|
||||||
sewage.setPermit(getStringVal(cell));
|
sewage.setPermit(getStringVal(cell));
|
||||||
cell = row.getCell(15);
|
cell = row.getCell(15);
|
||||||
sewage.setDisplacement(Integer.parseInt((getStringVal(cell)==null?"0":getStringVal(cell))));
|
sewage.setDisplacement(Integer.parseInt((getStringVal(cell) == null ? "0" : getStringVal(cell))));
|
||||||
cell = row.getCell(16);
|
cell = row.getCell(16);
|
||||||
sewage.setStandard(getStringVal(cell));
|
sewage.setStandard(getStringVal(cell));
|
||||||
cell = row.getCell(17);
|
cell = row.getCell(17);
|
||||||
@ -254,30 +258,30 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
sewage.setAttribute(getStringVal(cell));
|
sewage.setAttribute(getStringVal(cell));
|
||||||
cell = row.getCell(27);
|
cell = row.getCell(27);
|
||||||
sewage.setRemark(getStringVal(cell));
|
sewage.setRemark(getStringVal(cell));
|
||||||
|
|
||||||
// sewage.setVentNum(ventNum);
|
// sewage.setVentNum(ventNum);
|
||||||
|
|
||||||
sewage.setId(CommUtil.getUUID());
|
sewage.setId(CommUtil.getUUID());
|
||||||
|
|
||||||
List<Sewage> selectListByWhere = this.selectListByWhere("where contract_number = '"+sewage.getContractNumber()+"'");
|
List<Sewage> selectListByWhere = this.selectListByWhere("where contract_number = '" + sewage.getContractNumber() + "'");
|
||||||
if (selectListByWhere!=null&&selectListByWhere.size()>0) {
|
if (selectListByWhere != null && selectListByWhere.size() > 0) {
|
||||||
sewage.setId(selectListByWhere.get(0).getId());
|
sewage.setId(selectListByWhere.get(0).getId());
|
||||||
|
|
||||||
int result = this.update(sewage);
|
int result = this.update(sewage);
|
||||||
if (result == 1) {
|
if (result == 1) {
|
||||||
sumNum++;
|
sumNum++;
|
||||||
} else {
|
} else {
|
||||||
failNum++;
|
failNum++;
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
|
|
||||||
int result = this.save(sewage);
|
int result = this.save(sewage);
|
||||||
if (result == 1) {
|
if (result == 1) {
|
||||||
sumNum++;
|
sumNum++;
|
||||||
} else {
|
} else {
|
||||||
failNum++;
|
failNum++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -293,8 +297,8 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void outExcelFun(HttpServletResponse response) throws IOException {
|
public void outExcelFun(HttpServletResponse response) throws IOException {
|
||||||
String fileName = "金山排海工程有限公司纳管企业表.xls";
|
String fileName = "金山卫污水厂纳管企业表.xls";
|
||||||
String title = "纳管企业";
|
String title = "纳管企业";
|
||||||
// 声明一个工作薄
|
// 声明一个工作薄
|
||||||
HSSFWorkbook workbook = new HSSFWorkbook();
|
HSSFWorkbook workbook = new HSSFWorkbook();
|
||||||
@ -372,7 +376,7 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
|
|
||||||
//产生表格表头
|
//产生表格表头
|
||||||
String excelTitleStr = "序号,合同编号,合同顺序,单位名称,单位地址,合同到期日,联系人,联系电话,*所属泵站,*所属车间,排污许可证编号,雨、污水管平面图,环评报告/登记表/批复,所属行业,排水许可证(编号)复印件/申请表,实际日排量(吨/天),排放标准(排水许可证),管网所有权单位,统一社会信用代码,地址位置(经纬度),接入管网坐标-经度(度),接入管网坐标-经度(分),接入管网坐标-经度(秒),接入管网坐标-纬度(度),接入管网坐标-纬度(分),接入管网坐标-纬度(秒),管网属性(分流/合流),备注";
|
String excelTitleStr = "序号,合同编号,合同顺序,单位名称,单位地址,合同到期日,联系人,联系电话,*所属泵站,*所属车间,排污许可证编号,雨、污水管平面图,环评报告/登记表/批复,所属行业,排水许可证(编号)复印件/申请表,实际日排量(吨/天),排放标准(排水许可证),管网所有权单位,统一社会信用代码,地址位置(经纬度),接入管网坐标-经度(度),接入管网坐标-经度(分),接入管网坐标-经度(秒),接入管网坐标-纬度(度),接入管网坐标-纬度(分),接入管网坐标-纬度(秒),管网属性(分流/合流),备注";
|
||||||
|
|
||||||
String[] excelTitle = excelTitleStr.split(",");
|
String[] excelTitle = excelTitleStr.split(",");
|
||||||
HSSFRow row = sheet.createRow(1);
|
HSSFRow row = sheet.createRow(1);
|
||||||
row.setHeight((short) 800);
|
row.setHeight((short) 800);
|
||||||
@ -418,17 +422,17 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
handRow.setHeight((short) 500);
|
handRow.setHeight((short) 500);
|
||||||
HSSFCell cell = handRow.createCell(0);
|
HSSFCell cell = handRow.createCell(0);
|
||||||
cell.setCellStyle(headStyle);
|
cell.setCellStyle(headStyle);
|
||||||
cell.setCellValue("金山排海工程有限公司纳管企业表");
|
cell.setCellValue("金山卫污水厂纳管企业表");
|
||||||
// 说明
|
// 说明
|
||||||
// HSSFCell smcell = handRow.createCell(5);
|
// HSSFCell smcell = handRow.createCell(5);
|
||||||
// smcell.setCellStyle(tipStyle);
|
// smcell.setCellStyle(tipStyle);
|
||||||
// smcell.setCellValue("注:日期格式(xxxx-xx-xx或xxxx/xx/xx), 班组类型,班组, 班次(根据系统配置名称填写),模式(填写巡检菜单里面的巡检模式) 排版日期,班组类型,班组,班次,模式都为必填项(集控班组可不填模式)。");
|
// smcell.setCellValue("注:日期格式(xxxx-xx-xx或xxxx/xx/xx), 班组类型,班组, 班次(根据系统配置名称填写),模式(填写巡检菜单里面的巡检模式) 排版日期,班组类型,班组,班次,模式都为必填项(集控班组可不填模式)。");
|
||||||
|
|
||||||
List<Sewage> list = this.selectListByWhere("where 1=1 order by contract_order asc");
|
List<Sewage> list = this.selectListByWhere("where 1=1 order by contract_order asc");
|
||||||
int n = 1;
|
int n = 1;
|
||||||
if (list != null && list.size() > 0) {
|
if (list != null && list.size() > 0) {
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
Sewage sewage = list.get(i);
|
Sewage sewage = list.get(i);
|
||||||
HSSFRow listrow1 = sheet.createRow(i + 2);
|
HSSFRow listrow1 = sheet.createRow(i + 2);
|
||||||
listrow1.setHeight((short) 400);
|
listrow1.setHeight((short) 400);
|
||||||
HSSFCell listcell0 = listrow1.createCell(0);
|
HSSFCell listcell0 = listrow1.createCell(0);
|
||||||
@ -441,7 +445,7 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
|
|
||||||
HSSFCell listcell2 = listrow1.createCell(2);
|
HSSFCell listcell2 = listrow1.createCell(2);
|
||||||
listcell2.setCellStyle(listStyle);
|
listcell2.setCellStyle(listStyle);
|
||||||
listcell2.setCellValue(sewage.getContractOrder());
|
listcell2.setCellValue(sewage.getContractOrder() == null ? 1 : sewage.getContractOrder());
|
||||||
|
|
||||||
HSSFCell listcell3 = listrow1.createCell(3);
|
HSSFCell listcell3 = listrow1.createCell(3);
|
||||||
listcell3.setCellStyle(listStyle);
|
listcell3.setCellStyle(listStyle);
|
||||||
@ -501,7 +505,7 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
|
|
||||||
HSSFCell listcell15 = listrow1.createCell(15);
|
HSSFCell listcell15 = listrow1.createCell(15);
|
||||||
listcell15.setCellStyle(listStyle);
|
listcell15.setCellStyle(listStyle);
|
||||||
listcell15.setCellValue((sewage.getDisplacement()==null?0:sewage.getDisplacement()));
|
listcell15.setCellValue((sewage.getDisplacement() == null ? 0 : sewage.getDisplacement()));
|
||||||
|
|
||||||
HSSFCell listcell16 = listrow1.createCell(16);
|
HSSFCell listcell16 = listrow1.createCell(16);
|
||||||
listcell16.setCellStyle(listStyle);
|
listcell16.setCellStyle(listStyle);
|
||||||
@ -572,31 +576,33 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
workbook.close();
|
workbook.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
|
/**
|
||||||
* 获取树,三层结构,processSection为根节点,sewage为子节点
|
* 获取树,三层结构,processSection为根节点,sewage为子节点
|
||||||
* @方法名:getTreeList
|
*
|
||||||
* @参数 @param
|
* @方法名:getTreeList
|
||||||
* @参数 @return
|
* @参数 @param
|
||||||
|
* @参数 @return
|
||||||
* @返回类型 String
|
* @返回类型 String
|
||||||
*/
|
*/
|
||||||
public String getTreeList(List<Sewage> list) {
|
public String getTreeList(List<Sewage> list) {
|
||||||
JSONArray list_result = new JSONArray();
|
JSONArray list_result = new JSONArray();
|
||||||
if(list!=null && list.size()>0){
|
if (list != null && list.size() > 0) {
|
||||||
String processSectionId = null;
|
String processSectionId = null;
|
||||||
String unitId = null;
|
String unitId = null;
|
||||||
JSONObject root_childs = new JSONObject();
|
JSONObject root_childs = new JSONObject();
|
||||||
JSONArray root_childlist = new JSONArray();
|
JSONArray root_childlist = new JSONArray();
|
||||||
JSONObject childs = new JSONObject();
|
JSONObject childs = new JSONObject();
|
||||||
JSONArray childlist = new JSONArray();
|
JSONArray childlist = new JSONArray();
|
||||||
for(int i=0;i<list.size();i++){
|
for (int i = 0; i < list.size(); i++) {
|
||||||
Sewage sewage = list.get(i);
|
Sewage sewage = list.get(i);
|
||||||
if(unitId==null || unitId.isEmpty()){
|
if (unitId == null || unitId.isEmpty()) {
|
||||||
unitId = sewage.getUnitId();
|
unitId = sewage.getUnitId();
|
||||||
Company company = sewage.getCompany();
|
Company company = sewage.getCompany();
|
||||||
if(company != null){
|
if (company != null) {
|
||||||
root_childs.put("id", company.getId());
|
root_childs.put("id", company.getId());
|
||||||
root_childs.put("text", company.getName());
|
root_childs.put("text", company.getName());
|
||||||
}else{
|
} else {
|
||||||
root_childs.put("id", unitId);
|
root_childs.put("id", unitId);
|
||||||
//没有关联Company或者unitId不存在
|
//没有关联Company或者unitId不存在
|
||||||
root_childs.put("text", "无区域数据");
|
root_childs.put("text", "无区域数据");
|
||||||
@ -604,8 +610,8 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
root_childs.put("pid", "-1");
|
root_childs.put("pid", "-1");
|
||||||
root_childs.put("type", "unit");
|
root_childs.put("type", "unit");
|
||||||
}
|
}
|
||||||
if(!unitId.equals(sewage.getUnitId())){
|
if (!unitId.equals(sewage.getUnitId())) {
|
||||||
//向当前根节点添加所有子节点
|
//向当前根节点添加所有子节点
|
||||||
childs.put("nodes", childlist);
|
childs.put("nodes", childlist);
|
||||||
root_childlist.add(childs);
|
root_childlist.add(childs);
|
||||||
root_childs.put("nodes", root_childlist);
|
root_childs.put("nodes", root_childlist);
|
||||||
@ -618,10 +624,10 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
//初始设置根节点
|
//初始设置根节点
|
||||||
unitId = sewage.getUnitId();
|
unitId = sewage.getUnitId();
|
||||||
Company company = sewage.getCompany();
|
Company company = sewage.getCompany();
|
||||||
if(company != null){
|
if (company != null) {
|
||||||
root_childs.put("id", company.getId());
|
root_childs.put("id", company.getId());
|
||||||
root_childs.put("text", company.getName());
|
root_childs.put("text", company.getName());
|
||||||
}else{
|
} else {
|
||||||
root_childs.put("id", unitId);
|
root_childs.put("id", unitId);
|
||||||
//没有关联Company或者unitId不存在
|
//没有关联Company或者unitId不存在
|
||||||
root_childs.put("text", "无区域数据");
|
root_childs.put("text", "无区域数据");
|
||||||
@ -631,15 +637,15 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
//初始设置根节点
|
//初始设置根节点
|
||||||
processSectionId = null;
|
processSectionId = null;
|
||||||
}
|
}
|
||||||
if(processSectionId==null || processSectionId.isEmpty()){
|
if (processSectionId == null || processSectionId.isEmpty()) {
|
||||||
//初始设置根节点
|
//初始设置根节点
|
||||||
processSectionId = sewage.getProcessSectionId();
|
processSectionId = sewage.getProcessSectionId();
|
||||||
ProcessSection processSection = sewage.getProcessSection();
|
ProcessSection processSection = sewage.getProcessSection();
|
||||||
if(processSection != null){
|
if (processSection != null) {
|
||||||
childs.put("id", processSection.getCode());
|
childs.put("id", processSection.getCode());
|
||||||
childs.put("text", processSection.getName());
|
childs.put("text", processSection.getName());
|
||||||
}else{
|
} else {
|
||||||
if(processSectionId.isEmpty()){
|
if (processSectionId.isEmpty()) {
|
||||||
processSectionId = "error";
|
processSectionId = "error";
|
||||||
}
|
}
|
||||||
childs.put("id", processSectionId);
|
childs.put("id", processSectionId);
|
||||||
@ -648,9 +654,9 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
}
|
}
|
||||||
childs.put("pid", unitId);
|
childs.put("pid", unitId);
|
||||||
childs.put("type", "processSection");
|
childs.put("type", "processSection");
|
||||||
|
|
||||||
}
|
}
|
||||||
if(processSectionId.equals(sewage.getProcessSectionId())){
|
if (processSectionId.equals(sewage.getProcessSectionId())) {
|
||||||
//设置子节点sewage
|
//设置子节点sewage
|
||||||
JSONObject child = new JSONObject();
|
JSONObject child = new JSONObject();
|
||||||
child.put("id", sewage.getId());
|
child.put("id", sewage.getId());
|
||||||
@ -658,7 +664,7 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
child.put("pid", processSectionId);
|
child.put("pid", processSectionId);
|
||||||
child.put("type", "sewage");
|
child.put("type", "sewage");
|
||||||
childlist.add(child);
|
childlist.add(child);
|
||||||
}else{
|
} else {
|
||||||
//向当前根节点添加所有子节点
|
//向当前根节点添加所有子节点
|
||||||
childs.put("nodes", childlist);
|
childs.put("nodes", childlist);
|
||||||
root_childlist.add(childs);
|
root_childlist.add(childs);
|
||||||
@ -668,11 +674,11 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
//初始设置根节点
|
//初始设置根节点
|
||||||
processSectionId = sewage.getProcessSectionId();
|
processSectionId = sewage.getProcessSectionId();
|
||||||
ProcessSection processSection = sewage.getProcessSection();
|
ProcessSection processSection = sewage.getProcessSection();
|
||||||
if(processSection != null){
|
if (processSection != null) {
|
||||||
childs.put("id", processSection.getCode());
|
childs.put("id", processSection.getCode());
|
||||||
childs.put("text", processSection.getName());
|
childs.put("text", processSection.getName());
|
||||||
}else{
|
} else {
|
||||||
if(processSectionId.isEmpty()){
|
if (processSectionId.isEmpty()) {
|
||||||
processSectionId = "error";
|
processSectionId = "error";
|
||||||
}
|
}
|
||||||
childs.put("id", processSectionId);
|
childs.put("id", processSectionId);
|
||||||
@ -688,7 +694,7 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
child.put("type", "sewage");
|
child.put("type", "sewage");
|
||||||
childlist.add(child);
|
childlist.add(child);
|
||||||
}
|
}
|
||||||
if((i+1)==list.size()){
|
if ((i + 1) == list.size()) {
|
||||||
//最后子节点结束时,向当前根节点添加所有子节点
|
//最后子节点结束时,向当前根节点添加所有子节点
|
||||||
childs.put("nodes", childlist);
|
childs.put("nodes", childlist);
|
||||||
root_childlist.add(childs);
|
root_childlist.add(childs);
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -534,7 +534,7 @@
|
|||||||
<img src="/images/大屏/企业简介.png" style="height:60px;width:420px;"/>
|
<img src="/images/大屏/企业简介.png" style="height:60px;width:420px;"/>
|
||||||
</div>
|
</div>
|
||||||
<div style="float: left;width: 100%;height: 137px;padding-top: 10px;padding-left: 20px;color: #ffffff;line-height: 30px;font-size: 20px;font-weight: 400;letter-spacing:2px;">
|
<div style="float: left;width: 100%;height: 137px;padding-top: 10px;padding-left: 20px;color: #ffffff;line-height: 30px;font-size: 20px;font-weight: 400;letter-spacing:2px;">
|
||||||
上海金山排海工程有限公司成立于1993年,主要承担金山东部地区生活污水和工业废水的收集处理任务,服务范围包括金山东部亭林、张堰、山阳、漕泾四镇及金山工业区、金山新城区、金山卫钱圩地区,服务区域约155平方公里。
|
上海金山卫污水厂成立于1993年,主要承担金山东部地区生活污水和工业废水的收集处理任务,服务范围包括金山东部亭林、张堰、山阳、漕泾四镇及金山工业区、金山新城区、金山卫钱圩地区,服务区域约155平方公里。
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style='position: absolute;width: 440px;height: 470px;left: 21px;
|
<div style='position: absolute;width: 440px;height: 470px;left: 21px;
|
||||||
|
|||||||
Reference in New Issue
Block a user