|
|
|
@ -1,8 +1,9 @@
|
|
|
|
|
package com.ruoyi.gysl.service.impl;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.io.resource.ClassPathResource;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
import com.ruoyi.common.annotation.Excel;
|
|
|
|
|
import com.ruoyi.common.core.domain.entity.SysDictData;
|
|
|
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
|
|
import com.ruoyi.docking.entity.SmartDeclaration;
|
|
|
|
@ -14,21 +15,22 @@ import com.ruoyi.gysl.entity.request.BasicInformationPageReq;
|
|
|
|
|
import com.ruoyi.gysl.entity.request.RemarkPageReq;
|
|
|
|
|
import com.ruoyi.gysl.entity.request.ZwIdPageReq;
|
|
|
|
|
import com.ruoyi.gysl.entity.response.BasicInformationResponse;
|
|
|
|
|
import com.ruoyi.gysl.entity.response.ProjectBuildingExcel;
|
|
|
|
|
import com.ruoyi.gysl.entity.response.ProjectExcelInfo;
|
|
|
|
|
import com.ruoyi.gysl.mapper.BasicInformationMapper;
|
|
|
|
|
import com.ruoyi.gysl.service.*;
|
|
|
|
|
import org.apache.poi.xssf.usermodel.XSSFCell;
|
|
|
|
|
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
|
|
|
|
|
import org.apache.poi.xssf.usermodel.XSSFRow;
|
|
|
|
|
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
|
|
|
|
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
|
|
|
|
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
|
|
|
|
|
import org.apache.poi.xwpf.usermodel.XWPFRun;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.io.InputStream;
|
|
|
|
|
import java.io.OutputStream;
|
|
|
|
|
import java.io.Serializable;
|
|
|
|
|
import java.lang.reflect.Field;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
@ -122,7 +124,6 @@ public class BasicInformationServiceImpl extends ServiceImpl<BasicInformationMap
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 导出项目数据
|
|
|
|
|
*/
|
|
|
|
@ -132,125 +133,6 @@ public class BasicInformationServiceImpl extends ServiceImpl<BasicInformationMap
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// /**
|
|
|
|
|
// * 填充数据
|
|
|
|
|
// */
|
|
|
|
|
// @Override
|
|
|
|
|
// public void approvalMethodfillInData(XSSFSheet sheet, XSSFCellStyle contentStyle, int rowNum, List<ProjectExcelInfo> info, List<String> sc, List<String> ec, int num) {
|
|
|
|
|
// Class<?> classBuilding = ProjectBuildingExcel.class;
|
|
|
|
|
// for (ProjectExcelInfo projectExcelInfo : info) {
|
|
|
|
|
// XSSFRow tempRow = sheet.createRow(rowNum++);
|
|
|
|
|
// tempRow.setHeight((short) 1400);
|
|
|
|
|
// int i1;
|
|
|
|
|
// for (i1 = 0; i1 < sc.size(); i1++) {
|
|
|
|
|
// XSSFCell tempCell = tempRow.createCell(i1);
|
|
|
|
|
// tempCell.setCellStyle(contentStyle);
|
|
|
|
|
// if (!ec.get(i1).endsWith("厂房")) {
|
|
|
|
|
// if (Objects.equals(sc.get(i1), "")) {
|
|
|
|
|
// tempCell.setCellValue(projectExcelInfo.getId());
|
|
|
|
|
// } else {
|
|
|
|
|
// tempCell.setCellValue(getExcelData(projectExcelInfo, sc.get(i1)));
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//// XSSFCell tempCell = tempRow.createCell(8);
|
|
|
|
|
//// tempCell.setCellStyle(contentStyle);
|
|
|
|
|
//// tempCell.setCellValue("12312321");
|
|
|
|
|
//
|
|
|
|
|
// for (int i2 = 0; i2 < projectExcelInfo.getXmjzxx().size(); i2++) {
|
|
|
|
|
// switch (projectExcelInfo.getXmjzxx().get(i2).getFloor()) {
|
|
|
|
|
// case 1:
|
|
|
|
|
// i1 = ec.indexOf("一层厂房");
|
|
|
|
|
// break;
|
|
|
|
|
// case 2:
|
|
|
|
|
// i1 = ec.indexOf("双层厂房");
|
|
|
|
|
// break;
|
|
|
|
|
// case 3:
|
|
|
|
|
// i1 = ec.indexOf("三层厂房");
|
|
|
|
|
// break;
|
|
|
|
|
// case 4:
|
|
|
|
|
// i1 = ec.indexOf("四层厂房");
|
|
|
|
|
// break;
|
|
|
|
|
// case 5:
|
|
|
|
|
// i1 = ec.indexOf("五层厂房");
|
|
|
|
|
// break;
|
|
|
|
|
// default:
|
|
|
|
|
// i1 = ec.indexOf("六层及以上厂房");
|
|
|
|
|
// }
|
|
|
|
|
// for (Field field : classBuilding.getDeclaredFields()) {
|
|
|
|
|
// XSSFCell tempCell = tempRow.createCell(i1);
|
|
|
|
|
// tempCell.setCellStyle(contentStyle);
|
|
|
|
|
// Excel excelColumn = field.getAnnotation(Excel.class);
|
|
|
|
|
// if (excelColumn != null) {
|
|
|
|
|
// tempCell.setCellValue(getBuildingData(projectExcelInfo.getXmjzxx().get(i2), sc.get(i1)));
|
|
|
|
|
// i1++;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// /**
|
|
|
|
|
// * 填充数据-项目基础信息获取
|
|
|
|
|
// */
|
|
|
|
|
// @Override
|
|
|
|
|
// public String getExcelData(ProjectExcelInfo item, String str) {
|
|
|
|
|
// String a = null;
|
|
|
|
|
// switch (str) {
|
|
|
|
|
// case "":
|
|
|
|
|
// a = item.getId() == null ? "-" : item.getId();
|
|
|
|
|
// break;
|
|
|
|
|
// case "项目名称":
|
|
|
|
|
// a = item.getName() == null ? "-" : item.getName();
|
|
|
|
|
// break;
|
|
|
|
|
// case "项目法人单位":
|
|
|
|
|
// a = item.getXmfrdwxz() == null ? "-" : item.getXmfrdwxz();
|
|
|
|
|
// break;
|
|
|
|
|
// case "项目法人单位性质":
|
|
|
|
|
// a = String.valueOf(item.getNature() == null ? "-" : item.getNature());
|
|
|
|
|
// break;
|
|
|
|
|
// case "总用地面积":
|
|
|
|
|
// a = String.valueOf(item.getZydmj() == null ? "-" : item.getZydmj());
|
|
|
|
|
// break;
|
|
|
|
|
// case "容积率":
|
|
|
|
|
// a = String.valueOf(item.getRjl() == null ? "-" : item.getRjl());
|
|
|
|
|
// break;
|
|
|
|
|
// case "总建筑面积":
|
|
|
|
|
// a = String.valueOf(item.getZjzmj() == null ? "-" : item.getZjzmj());
|
|
|
|
|
// break;
|
|
|
|
|
// case "标准层建筑面积":
|
|
|
|
|
// a = String.valueOf(item.getBzcjzmj() == null ? "-" : item.getBzcjzmj());
|
|
|
|
|
// break;
|
|
|
|
|
// }
|
|
|
|
|
// return a;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// /**
|
|
|
|
|
// * 填充数据-项目建筑信息获取
|
|
|
|
|
// */
|
|
|
|
|
// @Override
|
|
|
|
|
// public String getBuildingData(ProjectBuildingExcel item, String str) {
|
|
|
|
|
// String a = null;
|
|
|
|
|
// switch (str) {
|
|
|
|
|
// case "层数":
|
|
|
|
|
// a = item.getFloor() == null ? "-" : String.valueOf(item.getFloor());
|
|
|
|
|
// break;
|
|
|
|
|
// case "总建筑高度":
|
|
|
|
|
// a = item.getTotalBuildingHeight() == null ? "-" : String.valueOf(item.getTotalBuildingHeight());
|
|
|
|
|
// break;
|
|
|
|
|
// case "首层高度":
|
|
|
|
|
// a = String.valueOf(item.getScgd() == null ? "-" : item.getScgd());
|
|
|
|
|
// break;
|
|
|
|
|
// case "2至4层高":
|
|
|
|
|
// a = String.valueOf(item.getTwoAndFourCg() == null ? "-" : item.getTwoAndFourCg());
|
|
|
|
|
// break;
|
|
|
|
|
// case "4层以上层高":
|
|
|
|
|
// a = String.valueOf(item.getFourYscg() == null ? "-" : item.getFourYscg());
|
|
|
|
|
// break;
|
|
|
|
|
// }
|
|
|
|
|
// return a;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 有经纬度的项目列表
|
|
|
|
|
*/
|
|
|
|
@ -282,25 +164,14 @@ public class BasicInformationServiceImpl extends ServiceImpl<BasicInformationMap
|
|
|
|
|
*/
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
@Override
|
|
|
|
|
public Long audit(AuditRequest req, int status,int oldStatus) {
|
|
|
|
|
public Long audit(AuditRequest req, int status, int oldStatus) {
|
|
|
|
|
//企业端提交审核直接修改,不需要挂起等待审批
|
|
|
|
|
//修改项目基本信息,和是否是负面清单
|
|
|
|
|
List<WysmxInformation> collect1 = req.getWysmxInformations().stream().filter(x ->
|
|
|
|
|
"危化品等级".equals(x.getZdname())
|
|
|
|
|
)
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
List<WysmxInformation> collect2 = req.getWysmxInformations().stream().filter(x ->
|
|
|
|
|
"生产火灾危险等级".equals(x.getZdname())
|
|
|
|
|
)
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
List<WysmxInformation> collect3 = req.getWysmxInformations().stream().filter(x ->
|
|
|
|
|
"环境保护".equals(x.getZdname()))
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
List<WysmxInformation> collect1 = req.getWysmxInformations().stream().filter(x -> "危化品等级".equals(x.getZdname())).collect(Collectors.toList());
|
|
|
|
|
List<WysmxInformation> collect2 = req.getWysmxInformations().stream().filter(x -> "生产火灾危险等级".equals(x.getZdname())).collect(Collectors.toList());
|
|
|
|
|
List<WysmxInformation> collect3 = req.getWysmxInformations().stream().filter(x -> "环境保护".equals(x.getZdname())).collect(Collectors.toList());
|
|
|
|
|
if (!collect1.isEmpty() && !collect2.isEmpty() && !collect3.isEmpty()) {
|
|
|
|
|
req.getBasicInformation().setIsFmqd(wysmxInformationService.canGoUpstairs(
|
|
|
|
|
collect1.get(0).getZdinfor(),
|
|
|
|
|
collect2.get(0).getZdinfor(),
|
|
|
|
|
collect3.get(0).getZdinfor()) ? 1 : 0);
|
|
|
|
|
req.getBasicInformation().setIsFmqd(wysmxInformationService.canGoUpstairs(collect1.get(0).getZdinfor(), collect2.get(0).getZdinfor(), collect3.get(0).getZdinfor()) ? 1 : 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//修改项目规划信息
|
|
|
|
@ -315,12 +186,12 @@ public class BasicInformationServiceImpl extends ServiceImpl<BasicInformationMap
|
|
|
|
|
otherInfoService.saveBatch(req.getProjectOtherInfos());
|
|
|
|
|
|
|
|
|
|
if (status == 2) {
|
|
|
|
|
if(oldStatus==1){
|
|
|
|
|
if (oldStatus == 1) {
|
|
|
|
|
userService.getAllZwUser("关于" + req.getBasicInformation().getName() + "项目,待审核的通知", req.getBasicInformation().getId(), null, null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (status == 3) {
|
|
|
|
|
if(oldStatus==2) {
|
|
|
|
|
if (oldStatus == 2) {
|
|
|
|
|
SmartDeclaration sd = new SmartDeclaration();
|
|
|
|
|
sd.setTyshxydm((req.getBasicInformation().getTyshxydm()));
|
|
|
|
|
sd.setProjectId(req.getBasicInformation().getId());
|
|
|
|
@ -344,9 +215,11 @@ public class BasicInformationServiceImpl extends ServiceImpl<BasicInformationMap
|
|
|
|
|
|
|
|
|
|
BasicInformationResponse basicInformationResponse = new BasicInformationResponse();
|
|
|
|
|
//项目基本信息
|
|
|
|
|
basicInformationResponse.setBasicInformation(getById(id));
|
|
|
|
|
BasicInformation byId = getById(id);
|
|
|
|
|
basicInformationResponse.setBasicInformation(byId == null ? new BasicInformation() : byId);
|
|
|
|
|
//项目规划信息
|
|
|
|
|
basicInformationResponse.setPlanInformation(planInformationService.lambdaQuery().eq(PlanInformation::getXmId, id).one());
|
|
|
|
|
PlanInformation one = planInformationService.lambdaQuery().eq(PlanInformation::getXmId, id).one();
|
|
|
|
|
basicInformationResponse.setPlanInformation(one == null ? new PlanInformation() : one);
|
|
|
|
|
//项目建筑信息
|
|
|
|
|
basicInformationResponse.setBuildingInformation(buildingInformationService.lambdaQuery().eq(BuildingInformation::getXmId, id).list());
|
|
|
|
|
//五要素模型信息
|
|
|
|
@ -354,7 +227,8 @@ public class BasicInformationServiceImpl extends ServiceImpl<BasicInformationMap
|
|
|
|
|
zwIdPageReq.setXmId(id);
|
|
|
|
|
basicInformationResponse.setWysmxResponses(wysmxInformationService.list(zwIdPageReq));
|
|
|
|
|
//企业入驻信息
|
|
|
|
|
basicInformationResponse.setQyrzInformation(qyrzInformationService.selectAll(zwIdPageReq));
|
|
|
|
|
QyrzInformation qyrzInformation = qyrzInformationService.selectAll(zwIdPageReq);
|
|
|
|
|
basicInformationResponse.setQyrzInformation(qyrzInformation == null ? new QyrzInformation() : qyrzInformation);
|
|
|
|
|
//项目图例
|
|
|
|
|
basicInformationResponse.setProjectLegendResponses(projectLegendService.page(zwIdPageReq));
|
|
|
|
|
//项目巡礼
|
|
|
|
@ -434,14 +308,16 @@ public class BasicInformationServiceImpl extends ServiceImpl<BasicInformationMap
|
|
|
|
|
if (bs != null) {
|
|
|
|
|
basicInformationResponse.setBasicInformation(bs);
|
|
|
|
|
} else {
|
|
|
|
|
basicInformationResponse.setBasicInformation(getById(id));
|
|
|
|
|
BasicInformation byId = getById(id);
|
|
|
|
|
basicInformationResponse.setBasicInformation(byId == null ? new BasicInformation() : byId);
|
|
|
|
|
}
|
|
|
|
|
//项目规划信息
|
|
|
|
|
PlanInformation pl = baseMapper.select2(id);
|
|
|
|
|
if (pl != null) {
|
|
|
|
|
basicInformationResponse.setPlanInformation(pl);
|
|
|
|
|
} else {
|
|
|
|
|
basicInformationResponse.setPlanInformation(planInformationService.lambdaQuery().eq(PlanInformation::getXmId, id).one());
|
|
|
|
|
PlanInformation one = planInformationService.lambdaQuery().eq(PlanInformation::getXmId, id).one();
|
|
|
|
|
basicInformationResponse.setPlanInformation(one == null ? new PlanInformation() : one);
|
|
|
|
|
}
|
|
|
|
|
//项目建筑信息
|
|
|
|
|
basicInformationResponse.setBuildingInformation(buildingInformationService.lambdaQuery().eq(BuildingInformation::getXmId, id).list());
|
|
|
|
@ -459,7 +335,8 @@ public class BasicInformationServiceImpl extends ServiceImpl<BasicInformationMap
|
|
|
|
|
if (qi != null) {
|
|
|
|
|
basicInformationResponse.setQyrzInformation(qi);
|
|
|
|
|
} else {
|
|
|
|
|
basicInformationResponse.setQyrzInformation(qyrzInformationService.selectAll(zwIdPageReq));
|
|
|
|
|
QyrzInformation qyrzInformation = qyrzInformationService.selectAll(zwIdPageReq);
|
|
|
|
|
basicInformationResponse.setQyrzInformation(qyrzInformation == null ? new QyrzInformation() : qyrzInformation);
|
|
|
|
|
}
|
|
|
|
|
//项目图例
|
|
|
|
|
basicInformationResponse.setProjectLegendResponses(projectLegendService.page(zwIdPageReq));
|
|
|
|
@ -478,4 +355,51 @@ public class BasicInformationServiceImpl extends ServiceImpl<BasicInformationMap
|
|
|
|
|
}
|
|
|
|
|
return basicInformationResponse;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据材料返回输chu流
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public void generateDocument(Map<String, Object> map, String docx, OutputStream sr) throws IOException {
|
|
|
|
|
ClassPathResource resource = new ClassPathResource(docx);
|
|
|
|
|
try (InputStream is = resource.getStream();
|
|
|
|
|
XWPFDocument doc = new XWPFDocument(is);
|
|
|
|
|
) {
|
|
|
|
|
// 处理段落
|
|
|
|
|
for (XWPFParagraph paragraph : doc.getParagraphs()) {
|
|
|
|
|
List<XWPFRun> runs = paragraph.getRuns();
|
|
|
|
|
if (runs == null) continue;
|
|
|
|
|
for (XWPFRun run : runs) {
|
|
|
|
|
String text = run.getText(0);
|
|
|
|
|
if (text == null) continue;
|
|
|
|
|
// 动态替换所有模板变量
|
|
|
|
|
for (Map.Entry<String, Object> entry : map.entrySet()) {
|
|
|
|
|
if (text.contains(entry.getKey())) {
|
|
|
|
|
text = text.replace(entry.getKey(), entry.getValue() != null ? entry.getValue().toString() : "");
|
|
|
|
|
run.setText(text, 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
doc.write(sr);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
throw new IOException("文档生成失败", e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据dict_type和dict_value返回
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public String getDictLabel(String dictType, String dictValue,List<SysDictData> sysDictData) {
|
|
|
|
|
List<SysDictData> collect = sysDictData.stream().filter(x ->
|
|
|
|
|
x.getDictType().equals(dictType) && x.getDictValue().equals(dictValue))
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
if (collect.isEmpty()){
|
|
|
|
|
return "/";
|
|
|
|
|
}else {
|
|
|
|
|
return collect.get(0).getDictLabel();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|