FzxzSchedule.java 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853
  1. package com.onemap.analyse.task;
  2. import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  3. import com.google.common.base.Joiner;
  4. import com.onemap.analyse.domain.*;
  5. import com.onemap.analyse.mapper.*;
  6. import com.onemap.analyse.mapper.base.FzxzResMapper;
  7. import com.onemap.analyse.utils.NpoiHelper;
  8. import com.onemap.analyse.utils.NumberUtil;
  9. import com.onemap.common.core.utils.StringUtils;
  10. import net.lingala.zip4j.core.ZipFile;
  11. import net.lingala.zip4j.exception.ZipException;
  12. import net.lingala.zip4j.model.ZipParameters;
  13. import net.lingala.zip4j.util.Zip4jConstants;
  14. import org.apache.commons.io.FileUtils;
  15. import org.apache.poi.xwpf.usermodel.*;
  16. import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblWidth;
  17. import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTcPr;
  18. import org.openxmlformats.schemas.wordprocessingml.x2006.main.STTblWidth;
  19. import org.springframework.beans.factory.annotation.Value;
  20. import org.springframework.stereotype.Component;
  21. import org.springframework.stereotype.Service;
  22. import javax.annotation.Resource;
  23. import java.io.*;
  24. import java.math.BigInteger;
  25. import java.text.SimpleDateFormat;
  26. import java.util.*;
  27. import java.util.stream.Collectors;
  28. /**
  29. * 辅助选址模块定时刷新任务
  30. */
  31. @Component
  32. @Service
  33. public class FzxzSchedule {
  34. // 间隔时间 单位ms
  35. public static final long TIME_INTERVAL = 1 * 15000;
  36. // 任务状态标识码
  37. private RwztDTO Rwzt = new RwztDTO();
  38. @Resource
  39. private FzxzMapper fzxzMapper;
  40. @Resource
  41. private FxrwrzMapper fxrwrzMapper;
  42. @Resource
  43. private FzxzXzyzMapper fzxzXzyzMapper;
  44. @Resource
  45. private FzxzTbMapper fzxzTbMapper;
  46. @Resource
  47. private FzxzXzyzDTO fzxzXzyzDTO;
  48. @Resource
  49. private FzxzResMapper fzxzResMapper;
  50. // 辅助选址python方法名标识
  51. @Value("${Fzxz.functionId}")
  52. private String functionId;
  53. @Value("${Fzxz.mapFunctionId}")
  54. private String mapFunctionId;
  55. @Value("${Fzxz.fzxzShp}")
  56. private String fzxzShp;
  57. @Value("${Hgxfx.temp}")
  58. private String temp;
  59. ///**
  60. // * Scheduled 定时器参数
  61. // * cron表达式:指定任务在特定时间执行
  62. // * fixedDelay:表示上一次任务执行完成后多久再执行,参数类型long,单位:ms
  63. // * fixedDelayString:与fixedDelay一样,只是参数类型是String
  64. // * fixedRate:表示按一定的频率执行任务,参数类型long,单位:ms 如: fixedRate(5000),表示这个定时器任务每5秒执行一次
  65. // * fixedRateString:与fixedRate一样,只是参数类型变为String
  66. // * initialDelay:表示延迟多久再第一次执行任务,参数类型为long ,单位:ms
  67. // * initialDelayString:与initialDelay一样,只是参数类型String
  68. // */
  69. /**
  70. * @Async("name") 开启多线程
  71. */
  72. /**
  73. * 辅助选址执行入口
  74. */
  75. // @Async("taskExecutor")
  76. // @Scheduled(fixedDelay = TIME_INTERVAL)
  77. // public void FzxzStatus() {
  78. // try {
  79. // QueryWrapper<FzxzDTO> wrapper = new QueryWrapper<FzxzDTO>();
  80. // wrapper.eq("rwzt", Rwzt.getCreate());
  81. // //以创建时间正序排列
  82. // wrapper.orderByAsc("cjsj");
  83. // //每次只操作一条记录
  84. // List<FzxzDTO> ress = fzxzMapper.selectList(wrapper);
  85. // if (ress.size() > 0) {
  86. // FzxzDTO res = ress.get(0);
  87. // //插入执行状态
  88. // res.setRwzt(Rwzt.getRun());
  89. // res.setRwkssj(new Date());
  90. // QueryWrapper<FzxzDTO> query = new QueryWrapper<FzxzDTO>();
  91. // query.eq("bsm", res.getBsm());
  92. // fzxzMapper.update(res, query);
  93. // //插入任务日志
  94. // FxrwrzDTO rzDto = new FxrwrzDTO();
  95. // rzDto.setRwbsm(res.getBsm());
  96. // rzDto.setRwlx("辅助选址");
  97. // rzDto.setRzlr("开始分析");
  98. // rzDto.setRzlx("info");
  99. // rzDto.setRzsj(new Date());
  100. // fxrwrzMapper.insert(rzDto);
  101. // //执行python
  102. // Map<String, String> params = new HashMap<>();
  103. // params.put("bsm", res.getBsm());
  104. // String result = PythonExecute.Run(functionId, params);
  105. // if (!StringUtils.isEmpty(result) && result.contains("OK")) {//成功
  106. // res.setRwjssj(new Date());
  107. // res.setRwzt(Rwzt.getComplete());
  108. // //TODO 生成辅助选址结果报告 返回 FxReport实体
  109. // FzxzReport report = createReport(res.getBsm(), null);
  110. // if (report != null) {
  111. // res.setFxbg(report.getReportfile().replace(".docx", ".pdf"));
  112. // res.setZip(report.getZipfile());
  113. // }
  114. // fzxzMapper.update(res, query);
  115. // //插入成功日志
  116. // FxrwrzDTO successDto = new FxrwrzDTO();
  117. // successDto.setRwbsm(res.getBsm());
  118. // successDto.setRwlx("辅助选址");
  119. // successDto.setRzlr("计算完成");
  120. // successDto.setRzlx("info");
  121. // successDto.setRzsj(new Date());
  122. // fxrwrzMapper.insert(successDto);
  123. // } else {//失败
  124. // res.setRwjssj(new Date());
  125. // res.setRwzt(Rwzt.getError());
  126. // fzxzMapper.update(res, query);
  127. // //插入任务日志
  128. // FxrwrzDTO errorDto = new FxrwrzDTO();
  129. // errorDto.setRwbsm(res.getBsm());
  130. // errorDto.setRwlx("辅助选址");
  131. // errorDto.setRzlr("计算错误");
  132. // errorDto.setRzsj(new Date());
  133. // errorDto.setRzlx("error");
  134. // errorDto.setFxjg(result);
  135. // fxrwrzMapper.insert(errorDto);
  136. // }
  137. // System.out.println("辅助选址模块:" + res.getBsm() + "完成!!!!!!!! " + new Date().toString());
  138. // }
  139. // } catch (Exception e) {
  140. // e.printStackTrace();
  141. // }
  142. // }
  143. // 根据选址任务生成报告
  144. // public FzxzReport createReport(String bsm, List<String> xzbsmList) {
  145. // FzxzEntityDTO res = fzxzMapper.GetFzxzByBsm(bsm);
  146. // FzxzReport fzxzReport = new FzxzReport();
  147. // if (res != null) {
  148. // // 文件硬盘真实路径
  149. // String timeStamp = new Date().getTime() + "";
  150. // String rootPath = temp + File.separator + "辅助选址报告" + File.separator + res.getBsm();
  151. // File f = new File(rootPath);
  152. // if (!f.exists()) {
  153. // f.mkdirs();
  154. // }
  155. // String reportPath = res.getXmmc() + "(选址报告)_" + timeStamp + ".docx";
  156. // String simplePath = res.getXmmc() + "(选址简报)_" + timeStamp + ".docx";
  157. // String zipPath = res.getXmmc() + "_" + timeStamp + ".zip";
  158. // // 选址报告
  159. // createReport(res, rootPath + File.separator + reportPath, xzbsmList);
  160. // // 选址简报
  161. // createSimpleReport(res, rootPath + File.separator + simplePath, xzbsmList);
  162. // // zip打包
  163. // createZipReport(res, rootPath + File.separator + zipPath, rootPath + File.separator + reportPath, rootPath + File.separator + simplePath);
  164. // // 生成返回结果
  165. // fzxzReport.setRootPath(StringUtils.getFileStaticPath(rootPath));
  166. // fzxzReport.setReportfile(StringUtils.getFileStaticPath(rootPath + File.separator + reportPath));
  167. // // fzxzReport.setSimplefile(StringUtils.getFileStaticPath(rootPath + File.separator + simplePath));
  168. // // fzxzReport.setZipfile(StringUtils.getFileStaticPath(rootPath + File.separator + zipPath));
  169. // fzxzReport.setBsm(bsm);
  170. // fzxzReport.setFxbg(fzxzReport.getReportfile());
  171. // fzxzReport.setJsdw(res.getJsdw());
  172. // fzxzReport.setXmmc(res.getXmmc());
  173. // // 查询分析结果图斑信息
  174. // QueryWrapper<FzxzResDTO> giswrapper = new QueryWrapper<>();
  175. // giswrapper.eq("rwbsm", res.getBsm());
  176. // List<FzxzResDTO> gisinfo = fzxzResMapper.selectList(giswrapper);
  177. // fzxzReport.setItems(gisinfo);
  178. // }
  179. // // 插入开始生成报告日志
  180. // FxrwrzDTO successDto2 = new FxrwrzDTO();
  181. // successDto2.setRwbsm(bsm);
  182. // successDto2.setRwlx("辅助选址");
  183. // successDto2.setRzlr("选址报告生成结束");
  184. // successDto2.setRzlx("info");
  185. // successDto2.setRzsj(new Date());
  186. // fxrwrzMapper.insert(successDto2);
  187. // return fzxzReport;
  188. // }
  189. /**
  190. * 选址报告
  191. *
  192. * @param res
  193. * @param reportPath
  194. * @param xzbsmList 没有导出全部地块
  195. */
  196. // private void createReport(FzxzEntityDTO res, String reportPath, List<String> xzbsmList) {
  197. // List<String> imgList = ReportImg(res, xzbsmList);
  198. // // 创建document文档对象对象实例
  199. // XWPFDocument document = null;
  200. // OutputStream outputStream = null;// 把doc输出到输出流
  201. // try {
  202. // document = new XWPFDocument();
  203. // int pos = 0;
  204. // // 文本标题
  205. // NpoiHelper.title(document, res.getXmmc() + "选址报告", pos++);
  206. // SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
  207. // NpoiHelper.Option optionCENTER = new NpoiHelper.Option();
  208. // optionCENTER.setAlign(ParagraphAlignment.CENTER);
  209. // document.setParagraph(NpoiHelper.newParagraph(document, sdf.format(new Date()), optionCENTER), pos++);
  210. // NpoiHelper.catalog(document, "一、项目选址信息", pos++);
  211. // String ydmj = res.getYdmjbegin() + " - " + res.getYdmjend();
  212. // if (StringUtils.isEmpty(res.getYdmjbegin()) || Double.parseDouble(res.getYdmjbegin()) == 0)
  213. // ydmj = "≤" + res.getYdmjend();
  214. // else if (StringUtils.isEmpty(res.getYdmjend()) || Double.parseDouble(res.getYdmjend()) == 0)
  215. // ydmj = "≥" + res.getYdmjbegin();
  216. // List<String> listTemp = new ArrayList<String>();
  217. // listTemp.add("\t项目名称:" + res.getXmmc());
  218. // listTemp.add("\t建设单位:" + res.getJsdw());
  219. // listTemp.add("\t用地面积:" + ydmj + "平方米");
  220. // listTemp.add("\t用地性质:" + res.getYdmc());
  221. // listTemp.add("\t影响因子:");
  222. // NpoiHelper.content(document, listTemp, pos++);
  223. // List tabYzTitles = new ArrayList<NpoiHelper.TableTitle>();
  224. // NpoiHelper.TableTitle tableTitle = new NpoiHelper.TableTitle();
  225. // tableTitle.setKey("YXYZMC");
  226. // tableTitle.setName("因子名称");
  227. // tableTitle.setWidth(2880);
  228. // tabYzTitles.add(tableTitle);
  229. // tableTitle = new NpoiHelper.TableTitle();
  230. // tableTitle.setKey("YZTJ_TEXT");
  231. // tableTitle.setName("影响条件");
  232. // tableTitle.setAlign(ParagraphAlignment.CENTER);
  233. // tableTitle.setWidth(2880);
  234. // tabYzTitles.add(tableTitle);
  235. // tableTitle = new NpoiHelper.TableTitle();
  236. // tableTitle.setKey("YXZ");
  237. // tableTitle.setName("约束范围值(M)");
  238. // tableTitle.setAlign(ParagraphAlignment.CENTER);
  239. // tableTitle.setWidth(2880);
  240. // tabYzTitles.add(tableTitle);
  241. // // 查询选址因子,并且转换为List<Map> 因子条件(包含:C、不包含:N、分析:A)
  242. // QueryWrapper<FzxzXzyzDTO> wrapper = new QueryWrapper<FzxzXzyzDTO>();
  243. // wrapper.eq("rwbsm", res.getBsm());
  244. // List<FzxzXzyzDTO> fzxzXzyzDTOList = fzxzXzyzMapper.selectList(wrapper);
  245. // List<Map<String, Object>> dataTablelist = new ArrayList<>();
  246. // for (int i = 0; i < fzxzXzyzDTOList.size(); i++) {
  247. // Map<String, Object> map = new HashMap<>();
  248. // FzxzXzyzDTO fzxzXzyzDTO = fzxzXzyzDTOList.get(i);
  249. // map.put("YXYZMC", fzxzXzyzDTO.getYxyzmc());
  250. // String yztj = "";
  251. // // if (fzxzXzyzDTO.getYztj() != null) {
  252. // // if ("C".equals(fzxzXzyzDTO.getYztj().toUpperCase())) {
  253. // // yztj = "包含";
  254. // // }
  255. // // if ("N".equals(fzxzXzyzDTO.getYztj().toUpperCase())) {
  256. // // yztj = "不包含";
  257. // // }
  258. // // if ("A".equals(fzxzXzyzDTO.getYztj().toUpperCase()) || "F".equals(fzxzXzyzDTO.getYztj().toUpperCase())) {
  259. // // yztj = "分析";
  260. // // }
  261. // // }
  262. //
  263. // map.put("YZTJ_TEXT", yztj);
  264. // Float yxz = (float) 0;
  265. // if (fzxzXzyzDTO.getYxz() != null) {
  266. // yxz = fzxzXzyzDTO.getYxz();
  267. // }
  268. // map.put("YXZ", yxz);
  269. // dataTablelist.add(map);
  270. // }
  271. // XWPFTable tableYz = NpoiHelper.setComTable(document, tabYzTitles, dataTablelist, "表1:选址影响因子", pos++);
  272. // NpoiHelper.catalog(document, "二、选址范围分析", pos++);
  273. // // 查询辅助选址分析图斑
  274. // QueryWrapper<FzxzTbEntityDTO> wrapperTb = new QueryWrapper<FzxzTbEntityDTO>();
  275. // wrapperTb.eq("rwbsm", res.getBsm());
  276. // wrapperTb.groupBy("objectid", "rwbsm", "ydyhfldm", "ydyhflmc", "frequency", "sum_mj");
  277. // List<FzxzTbEntityDTO> fzxzTbEntityDTOList = fzxzTbMapper.selectList(wrapperTb);
  278. // // 计算面积总和
  279. // double sumcount = 0;
  280. // for (int i = 0; i < fzxzTbEntityDTOList.size(); i++) {
  281. // sumcount = sumcount + fzxzTbEntityDTOList.get(i).getSumMj();
  282. // }
  283. //
  284. // List<FzxzTbEntityDTO> list = fzxzTbEntityDTOList.stream().sorted(Comparator.comparing(FzxzTbEntityDTO::getSumMj).reversed()).collect(Collectors.toList());
  285. // String fwfx = "\t根据指定选址分析得出,所选范围共" + Math.round(sumcount) + "平方米,其中";
  286. // List<Map<String, Object>> fztable = new ArrayList<>();
  287. // // 生成地类分析统计表
  288. // for (int i = 0; i < list.size(); i++) {
  289. // FzxzTbEntityDTO item = list.get(i);
  290. // String zb = String.format("%.1f", item.getSumMj() / sumcount * 100);
  291. // if (i < 5) {
  292. // // 面积前五的占比地类计算
  293. // fwfx += item.getYdyhflmc() + Math.round(item.getSumMj()) + "平方米,占比" + zb + "%;";
  294. // }
  295. // // List<FzxzTbEntityDTO>转List<Map<String, Object>> 地类编码 地类名称 面积(平方千米) 占比(%)
  296. // Map map = new HashMap();
  297. // map.put("ZB", zb);
  298. // map.put("YDYHFLDM", item.getYdyhfldm());
  299. // map.put("YDYHFLMC", item.getYdyhflmc());
  300. // map.put("SUM_MJ", Math.round(item.getSumMj()));
  301. // fztable.add(map);
  302. // }
  303. // fwfx = fwfx.substring(0, fwfx.length() - 1) + "。详情如下:";
  304. // NpoiHelper.content(document, fwfx, pos++);
  305. // // 地类编码 地类名称 面积(平方千米) 占比(%)
  306. // List<NpoiHelper.TableTitle> tabYztbTitles = new ArrayList();
  307. // NpoiHelper.TableTitle tableTitleTb = new NpoiHelper.TableTitle();
  308. // tableTitleTb.setKey("YDYHFLDM");
  309. // tableTitleTb.setName("地类编码");
  310. // tableTitleTb.setAlign(ParagraphAlignment.CENTER);
  311. // tableTitleTb.setWidth(2010);
  312. // tabYztbTitles.add(tableTitleTb);
  313. // tableTitleTb = new NpoiHelper.TableTitle();
  314. // tableTitleTb.setKey("YDYHFLMC");
  315. // tableTitleTb.setName("地类名称");
  316. // tableTitleTb.setWidth(2910);
  317. // tabYztbTitles.add(tableTitleTb);
  318. // tableTitleTb = new NpoiHelper.TableTitle();
  319. // tableTitleTb.setKey("SUM_MJ");
  320. // tableTitleTb.setName("面积(平方千米)");
  321. // tableTitleTb.setAlign(ParagraphAlignment.CENTER);
  322. // tableTitleTb.setWidth(1870);
  323. // tabYztbTitles.add(tableTitleTb);
  324. // tableTitleTb = new NpoiHelper.TableTitle();
  325. // tableTitleTb.setKey("ZB");
  326. // tableTitleTb.setName("占比(%)");
  327. // tableTitleTb.setAlign(ParagraphAlignment.CENTER);
  328. // tableTitleTb.setWidth(1700);
  329. // tabYztbTitles.add(tableTitleTb);
  330. // XWPFTable tableYztb = NpoiHelper.setComTable(document, tabYztbTitles, fztable, "表2:地类分析统计表", pos++);
  331. // // 查询结果
  332. // QueryWrapper<FzxzResDTO> giswrapper = new QueryWrapper<>();
  333. // giswrapper.eq("rwbsm", res.getBsm());
  334. // // 筛选方案,根据传参或者预选方案
  335. // // giswrapper.ne("yxfa", "0");
  336. // if (xzbsmList != null) {
  337. // giswrapper.in("bsm", xzbsmList);
  338. // }
  339. // List<FzxzResDTO> fzxzJgGisDTOList = fzxzResMapper.selectList(giswrapper);
  340. // NpoiHelper.catalog(document, "三、选址分析", pos++);
  341. // String ydmc = res.getYdmc();
  342. // if (!StringUtils.isEmpty(ydmc)) {
  343. // if (ydmc.lastIndexOf("用地") == ydmc.length() - 2) {
  344. // ydmc = res.getYdmc().substring(0, ydmc.length() - 2);
  345. // }
  346. // NpoiHelper.content(document, "\t按照项目选址要求和影响因子,经对所选范围内的所有" + ydmc + "用地进行分析,筛选出符合要求的方案共" + fzxzJgGisDTOList.size() + "个。", pos++);
  347. // } else {
  348. // NpoiHelper.content(document, "\t按照项目选址要求和影响因子,经对所选范围内的所有用地进行分析,筛选出符合要求的方案共" + fzxzJgGisDTOList.size() + "个。", pos++);
  349. // }
  350. //
  351. // int index = 1;
  352. // NpoiHelper.Option optionIsBold = new NpoiHelper.Option();
  353. // optionIsBold.setBold(true);
  354. // for (int i = 0; i < fzxzJgGisDTOList.size(); i++) {
  355. // FzxzResDTO item = fzxzJgGisDTOList.get(i);
  356. // document.setParagraph(NpoiHelper.newParagraph(document, index + "、方案" + NumberUtil.int2chineseNum(index), optionIsBold), pos++);
  357. // XWPFTable table = document.createTable(7, 4);
  358. // table.setWidth(9000);// 总宽度
  359. // for (int k = 0; k < 4; k++) {
  360. // XWPFTableCell cell = table.getRow(0).getCell(k);
  361. // CTTcPr ctTcPr = cell.getCTTc().isSetTcPr() ? cell.getCTTc().getTcPr() : cell.getCTTc().addNewTcPr();
  362. // CTTblWidth ctTblWidth = ctTcPr.addNewTcW();
  363. // ctTblWidth.setW(BigInteger.valueOf(2250));
  364. // ctTblWidth.setType(STTblWidth.DXA);
  365. // }
  366. // // Table 表格第一行
  367. // table.getRow(0).getCell(0).setColor("DBE5F1");
  368. // NpoiHelper.mergeHorizontal(table, 0, 0, 3);
  369. // table.getRow(0).getCell(0).setParagraph(NpoiHelper.setCellText(table, "符合用地情况", optionIsBold));
  370. // // Table 表格第二行
  371. // table.getRow(1).getCell(0).setParagraph(NpoiHelper.setCellText(table, "地类编码", optionIsBold));
  372. // // table.getRow(1).getCell(1).setParagraph(NpoiHelper.setCellText(table, item.getDlbm(), null));
  373. // table.getRow(1).getCell(2).setParagraph(NpoiHelper.setCellText(table, "地类名称", optionIsBold));
  374. // // table.getRow(1).getCell(3).setParagraph(NpoiHelper.setCellText(table, item.getDlmc(), null));
  375. // // Table 表格第三行
  376. // table.getRow(2).getCell(0).setParagraph(NpoiHelper.setCellText(table, "地块面积", optionIsBold));
  377. // // table.getRow(2).getCell(1).setParagraph(NpoiHelper.setCellText(table, Math.round(item.getTbmj()) + "平方米", null));
  378. // table.getRow(2).getCell(2).setParagraph(NpoiHelper.setCellText(table, "土地位置", optionIsBold));
  379. // // table.getRow(2).getCell(3).setParagraph(NpoiHelper.setCellText(table, item.getXzqmc(), null));
  380. // // Table 表格第四行
  381. // table.getRow(3).getCell(0).setColor("DBE5F1");
  382. // NpoiHelper.mergeHorizontal(table, 3, 0, 3);
  383. // table.getRow(3).getCell(0).setParagraph(NpoiHelper.setCellText(table, "地块位置信息", optionIsBold));
  384. // // Table 表格第五行 -专题图
  385. // NpoiHelper.mergeHorizontal(table, 4, 0, 1);
  386. // NpoiHelper.mergeHorizontal(table, 4, 2, 3);
  387. // String mapF = "";
  388. // String mapM = "";
  389. // if (imgList != null && imgList.size() > 0) {
  390. // for (int j = 0; j < imgList.size(); j++) {
  391. // String s = imgList.get(j);
  392. // if (s.indexOf(item.getBsm() + "_F") >= 0) {
  393. // mapF = s;// 全局
  394. // }
  395. // if (s.indexOf(item.getBsm() + "_M") >= 0) {
  396. // mapM = s;// 局部
  397. // }
  398. // }
  399. // }
  400. // if (StringUtils.isNotEmpty(mapF)) {
  401. // FileInputStream fis = null;
  402. // try {
  403. // fis = new FileInputStream(new File(mapF));
  404. // XWPFParagraph paragraph = table.getRow(4).getCell(0).addParagraph();
  405. // paragraph.setAlignment(ParagraphAlignment.CENTER);
  406. // XWPFRun run = paragraph.createRun();
  407. // run.addPicture(fis, // 条形码图片的位置
  408. // Document.PICTURE_TYPE_JPEG, // 图片类型
  409. // item.getBsm() + "_F.jpeg", // 图片名称
  410. // 2200000, // 图片的长
  411. // 1700000 // 图片的宽
  412. // );
  413. // run.addBreak(BreakType.TEXT_WRAPPING);
  414. // run.setText("(宏观位置)");
  415. // } catch (Exception e) {
  416. // System.out.println(e.toString());
  417. // } finally {
  418. // if (fis != null) {
  419. // try {
  420. // fis.close();
  421. // } catch (IOException e) {
  422. // throw e;
  423. // }
  424. // }
  425. // }
  426. // }
  427. // if (StringUtils.isNotEmpty(mapM)) {
  428. // FileInputStream fis = null;
  429. // try {
  430. // fis = new FileInputStream(new File(mapM));
  431. // XWPFParagraph paragraph = table.getRow(4).getCell(2).addParagraph();
  432. // paragraph.setAlignment(ParagraphAlignment.CENTER);
  433. // XWPFRun run = paragraph.createRun();
  434. // run.addPicture(fis, // 条形码图片的位置
  435. // Document.PICTURE_TYPE_JPEG, // 图片类型
  436. // item.getBsm() + "_M.jpeg", // 图片名称
  437. // 2200000, // 图片的长
  438. // 1700000 // 图片的宽
  439. // );
  440. // run.addBreak(BreakType.TEXT_WRAPPING);
  441. // run.setText("(具体位置)");
  442. // } catch (Exception e) {
  443. // System.out.println(e.toString());
  444. // throw e;
  445. // } finally {
  446. // if (fis != null) {
  447. // try {
  448. // fis.close();
  449. // } catch (IOException e) {
  450. // throw e;
  451. // }
  452. // }
  453. // }
  454. // }
  455. // // Table 表格第六行
  456. // table.getRow(5).getCell(0).setColor("DBE5F1");
  457. // NpoiHelper.mergeHorizontal(table, 5, 0, 3);
  458. // table.getRow(5).getCell(0).setParagraph(NpoiHelper.setCellText(table, "分析结论", optionIsBold));
  459. // // Table 表格第七行
  460. // NpoiHelper.mergeHorizontal(table, 6, 0, 3);
  461. // XWPFParagraph para6 = table.getRow(6).getCell(0).addParagraph();
  462. // para6.setAlignment(ParagraphAlignment.LEFT);
  463. //
  464. // // 查询辅助选址因子
  465. // // QueryWrapper<FzxzResDTO> jgyzWrapper = new QueryWrapper<>();
  466. // // jgyzWrapper.eq("jbbsm", item.getBsm());
  467. // // jgyzWrapper.ne("yztj", "F");
  468. // // List<FzxzXzyzDTO> jgyzList = fzxzJgyzMapper.selectList(jgyzWrapper);
  469. //
  470. // int jgyzid = 1;
  471. // for (int j = 0; j < fzxzXzyzDTOList.size(); j++) {
  472. // FzxzXzyzDTO fzxzJgyzDTO = fzxzXzyzDTOList.get(j);
  473. // XWPFRun run = para6.createRun();
  474. // // TODO
  475. // // run.setText(jgyzid + "、" + fzxzJgyzDTO.getFxjg());
  476. // run.addBreak(BreakType.TEXT_WRAPPING);
  477. // jgyzid++;
  478. // }
  479. // // 查询辅助选址因子
  480. // // jgyzWrapper = new QueryWrapper<FzxzJgyzDTO>();
  481. // // jgyzWrapper.eq("jbbsm", item.getBsm());
  482. // // jgyzWrapper.eq("yztj", "F");
  483. // // jgyzList = fzxzJgyzMapper.selectList(jgyzWrapper);
  484. //
  485. // for (int j = 0; j < fzxzXzyzDTOList.size(); j++) {
  486. // FzxzXzyzDTO jgyz = fzxzXzyzDTOList.get(j);
  487. // XWPFRun run = para6.createRun();
  488. // // String jg = jgyz.getFxjg();
  489. // // TODO
  490. // String jg = "";
  491. // Double jgDouble = 0.0;
  492. // try {
  493. // // jgDouble = Double.parseDouble(jg);
  494. // // TODO
  495. // run.setText(jgyzid + "、压占" + jgyz.getYxyzmc() + "面积" + jg + "平方米");
  496. // } catch (Exception e) {
  497. // run.setText(jg);
  498. // }
  499. // run.addBreak(BreakType.TEXT_WRAPPING);
  500. // jgyzid++;
  501. // }
  502. // index++;
  503. // }
  504. // File fileDoc = new File(reportPath);
  505. // if (fileDoc.exists()) {
  506. // FileUtils.forceDelete(fileDoc);
  507. // }
  508. // // word文件输出流
  509. // outputStream = new FileOutputStream(reportPath);
  510. // document.write(outputStream);
  511. // } catch (Exception e) {
  512. // e.printStackTrace();
  513. // // 插入任务日志
  514. // FxrwrzDTO errorDto = new FxrwrzDTO();
  515. // errorDto.setRwbsm(res.getBsm());
  516. // errorDto.setRwlx("辅助选址");
  517. // errorDto.setRzlr("生成选址报告错误:" + e.getMessage());
  518. // errorDto.setRzsj(new Date());
  519. // errorDto.setRzlx("error");
  520. // fxrwrzMapper.insert(errorDto);
  521. // } finally {
  522. // if (document != null) {
  523. // try {
  524. // document.close();
  525. // } catch (Exception ex) {
  526. // System.out.println(ex.toString());
  527. // }
  528. // }
  529. // if (outputStream != null) {
  530. // try {
  531. // outputStream.close();
  532. // } catch (IOException e) {
  533. // e.printStackTrace();
  534. // }
  535. // }
  536. // }
  537. // // 转PDF
  538. // String outfilepath = reportPath.replace(".docx", ".pdf");
  539. // NpoiHelper.doc2pdf(reportPath, outfilepath);
  540. // System.out.println(outfilepath);
  541. // }
  542. // /**
  543. // * 选址简报
  544. // */
  545. // private void createSimpleReport(FzxzEntityDTO res, String reportPath, List<String> xzbsmList) {
  546. // // 创建document文档对象对象实例
  547. // XWPFDocument document = null;
  548. // OutputStream outputStream = null;// 把doc输出到输出流
  549. // try {
  550. // // 创建document文档对象对象实例
  551. // document = new XWPFDocument();
  552. // int pos = 0;
  553. // NpoiHelper.Option optionCENTER = new NpoiHelper.Option();
  554. // optionCENTER.setAlign(ParagraphAlignment.CENTER);
  555. // // 文本标题
  556. // NpoiHelper.title(document, res.getXmmc() + "选址简报", pos++);
  557. // SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
  558. // document.setParagraph(NpoiHelper.newParagraph(document, sdf.format(new Date()), optionCENTER), pos++);
  559. //
  560. // NpoiHelper.catalog(document, "一、项目选址信息", pos++);
  561. // XWPFTable table = document.createTable(4, 4);
  562. // table.setWidth(8500);// 总宽度
  563. // for (int k = 0; k < 4; k++) {
  564. // XWPFTableCell cell = table.getRow(0).getCell(k);
  565. // CTTcPr ctTcPr = cell.getCTTc().isSetTcPr() ? cell.getCTTc().getTcPr() : cell.getCTTc().addNewTcPr();
  566. // CTTblWidth ctTblWidth = ctTcPr.addNewTcW();
  567. // ctTblWidth.setW(BigInteger.valueOf(2125));
  568. // ctTblWidth.setType(STTblWidth.DXA);
  569. // }
  570. // // Table 表格第一行
  571. // NpoiHelper.Option optionIsBoldCENTER = new NpoiHelper.Option();
  572. // optionIsBoldCENTER.setAlign(ParagraphAlignment.CENTER);
  573. // optionIsBoldCENTER.setBold(true);
  574. // table.getRow(0).getCell(0).setColor("DBE5F1");
  575. // table.getRow(0).getCell(0).setParagraph(NpoiHelper.setCellText(table, "项目名称", optionIsBoldCENTER));
  576. // NpoiHelper.mergeHorizontal(table, 0, 1, 3);
  577. // table.getRow(0).getCell(1).setParagraph(NpoiHelper.setCellText(table, res.getXmmc(), null));
  578. // // Table 表格第二行
  579. // table.getRow(1).getCell(0).setColor("DBE5F1");
  580. // table.getRow(1).getCell(0).setParagraph(NpoiHelper.setCellText(table, "建设单位", optionIsBoldCENTER));
  581. // NpoiHelper.mergeHorizontal(table, 1, 1, 3);
  582. // table.getRow(1).getCell(1).setParagraph(NpoiHelper.setCellText(table, res.getJsdw(), null));
  583. // // Table 表格第三行
  584. // String ydmj = res.getYdmjbegin() + " - " + res.getYdmjend();
  585. // if (StringUtils.isEmpty(res.getYdmjbegin()) || Double.parseDouble(res.getYdmjbegin()) == 0)
  586. // ydmj = "≤" + res.getYdmjend();
  587. // else if (StringUtils.isEmpty(res.getYdmjend()) || Double.parseDouble(res.getYdmjend()) == 0)
  588. // ydmj = "≥" + res.getYdmjbegin();
  589. // table.getRow(2).getCell(0).setColor("DBE5F1");
  590. // table.getRow(2).getCell(0).setParagraph(NpoiHelper.setCellText(table, "用地面积", optionIsBoldCENTER));
  591. // table.getRow(2).getCell(1).setParagraph(NpoiHelper.setCellText(table, ydmj + "平方米", null));
  592. // table.getRow(2).getCell(2).setColor("DBE5F1");
  593. // table.getRow(2).getCell(2).setParagraph(NpoiHelper.setCellText(table, "用地性质", optionIsBoldCENTER));
  594. // table.getRow(2).getCell(3).setParagraph(NpoiHelper.setCellText(table, res.getYdmc(), null));
  595. // // Table 表格第四行
  596. // table.getRow(3).getCell(1).setColor("DBE5F1");
  597. // table.getRow(3).getCell(2).setColor("DBE5F1");
  598. // table.getRow(3).getCell(3).setColor("DBE5F1");
  599. // table.getRow(3).getCell(0).setParagraph(NpoiHelper.setCellText(table, "选址因子", optionIsBoldCENTER));
  600. // table.getRow(3).getCell(1).setParagraph(NpoiHelper.setCellText(table, "因子名称", optionIsBoldCENTER));
  601. // table.getRow(3).getCell(2).setParagraph(NpoiHelper.setCellText(table, "影响条件", optionIsBoldCENTER));
  602. // table.getRow(3).getCell(3).setParagraph(NpoiHelper.setCellText(table, "约束范围值(M)", optionIsBoldCENTER));
  603. // // 查询选址因子,并且转换为List<Map> 因子条件(包含:C、不包含:N、分析:A)
  604. // QueryWrapper<FzxzXzyzDTO> wrapper = new QueryWrapper<FzxzXzyzDTO>();
  605. // wrapper.eq("rwbsm", res.getBsm());
  606. // List<FzxzXzyzDTO> fzxzXzyzDTOList = fzxzXzyzMapper.selectList(wrapper);
  607. // for (int i = 0; i < fzxzXzyzDTOList.size(); i++) {
  608. // FzxzXzyzDTO fzxzXzyzDTO = fzxzXzyzDTOList.get(i);
  609. // String yztj = "";
  610. // // if (fzxzXzyzDTO.getYztj() != null) {
  611. // // if ("C".equals(fzxzXzyzDTO.getYztj().toUpperCase())) {
  612. // // yztj = "包含";
  613. // // }
  614. // // if ("N".equals(fzxzXzyzDTO.getYztj().toUpperCase())) {
  615. // // yztj = "不包含";
  616. // // }
  617. // // if ("A".equals(fzxzXzyzDTO.getYztj().toUpperCase()) || "F".equals(fzxzXzyzDTO.getYztj().toUpperCase())) {
  618. // // yztj = "分析";
  619. // // }
  620. // // }
  621. // String yxz = "";
  622. // // if (StringUtils.isNotEmpty(fzxzXzyzDTO.getYxz())) {
  623. // // yxz = fzxzXzyzDTO.getYxz();
  624. // // }
  625. // XWPFTableRow mr = table.createRow();
  626. //
  627. // mr.getCell(1).setParagraph(NpoiHelper.setCellText(table, fzxzXzyzDTO.getYxyzmc(), optionCENTER));
  628. // mr.getCell(2).setParagraph(NpoiHelper.setCellText(table, yztj, optionCENTER));
  629. // mr.getCell(3).setParagraph(NpoiHelper.setCellText(table, yxz, optionCENTER));
  630. // }
  631. // NpoiHelper.mergeCellsVertically(table, 0, 3, 3 + fzxzXzyzDTOList.size());
  632. // table.getRow(3).getCell(0).setColor("DBE5F1");
  633. // // 选址分析
  634. // NpoiHelper.catalog(document, "二、选址分析", pos++);
  635. // XWPFTable tableFx = document.createTable(1, 4);
  636. // tableFx.setWidth(8500);// 总宽度
  637. // for (int k = 0; k < 4; k++) {
  638. // XWPFTableCell cell = tableFx.getRow(0).getCell(k);
  639. // CTTcPr ctTcPr = cell.getCTTc().isSetTcPr() ? cell.getCTTc().getTcPr() : cell.getCTTc().addNewTcPr();
  640. // CTTblWidth ctTblWidth = ctTcPr.addNewTcW();
  641. // ctTblWidth.setW(BigInteger.valueOf(2125));
  642. // ctTblWidth.setType(STTblWidth.DXA);
  643. // }
  644. // // 查询结果GIS FzxzJgGisDTO
  645. // QueryWrapper<FzxzResDTO> giswrapper = new QueryWrapper<>();
  646. // giswrapper.eq("rwbsm", res.getBsm());
  647. // // 筛选方案,根据传参或者预选方案
  648. // // giswrapper.ne("yxfa", "0");
  649. // if (xzbsmList != null) {
  650. // giswrapper.in("bsm", xzbsmList);
  651. // }
  652. // List<FzxzResDTO> fzxzJgGisDTOList = fzxzResMapper.selectList(giswrapper);
  653. // int index = 1;
  654. // NpoiHelper.Option optionIsBold = new NpoiHelper.Option();
  655. // optionIsBold.setBold(true);
  656. // int rowIndex = 0;
  657. // for (int i = 0; i < fzxzJgGisDTOList.size(); i++) {
  658. // FzxzResDTO item = fzxzJgGisDTOList.get(i);
  659. // XWPFTableRow mr = tableFx.createRow();
  660. // rowIndex++;
  661. // mr.getCell(0).setColor("DBE5F1");
  662. // NpoiHelper.mergeHorizontal(tableFx, rowIndex, 0, 1);
  663. // mr.getCell(0).setParagraph(NpoiHelper.setCellText(tableFx, "方案" + NumberUtil.int2chineseNum(index), optionIsBold));
  664. // // tableFx 表格第二行
  665. // mr = tableFx.createRow();
  666. // rowIndex++;
  667. // mr.getCell(0).setParagraph(NpoiHelper.setCellText(tableFx, "地类编码", optionIsBoldCENTER));
  668. // // mr.getCell(1).setParagraph(NpoiHelper.setCellText(tableFx, item.getDlbm(), null));
  669. // mr.getCell(2).setParagraph(NpoiHelper.setCellText(tableFx, "地类名称", optionIsBoldCENTER));
  670. // // mr.getCell(3).setParagraph(NpoiHelper.setCellText(tableFx, item.getDlmc(), null));
  671. // // tableFx 表格第三行
  672. // mr = tableFx.createRow();
  673. // rowIndex++;
  674. // mr.getCell(0).setParagraph(NpoiHelper.setCellText(tableFx, "地块面积", optionIsBoldCENTER));
  675. // // mr.getCell(1).setParagraph(NpoiHelper.setCellText(tableFx, Math.round(item.getTbmj()) + "平方米", null));
  676. // mr.getCell(2).setParagraph(NpoiHelper.setCellText(tableFx, "土地位置", optionIsBoldCENTER));
  677. // // mr.getCell(3).setParagraph(NpoiHelper.setCellText(tableFx, item.getXzqmc(), null));
  678. // // tableFx 表格第四行
  679. // mr = tableFx.createRow();
  680. // rowIndex++;
  681. // mr.getCell(0).setParagraph(NpoiHelper.setCellText(tableFx, "压占分析", optionIsBoldCENTER));
  682. // NpoiHelper.mergeHorizontal(tableFx, rowIndex, 1, 3);
  683. //
  684. // XWPFParagraph para6 = mr.getCell(1).addParagraph();
  685. // para6.setAlignment(ParagraphAlignment.LEFT);
  686. // // 查询选址因子 因子条件(包含:C、不包含:N、分析:A)
  687. // // QueryWrapper<fzxzXzyzDTO> fzxzJgyzDTOQueryWrapper = new QueryWrapper<>();
  688. // // fzxzJgyzDTOQueryWrapper.eq("jbbsm", item.getBsm());
  689. // // fzxzJgyzDTOQueryWrapper.eq("yztj", "F");
  690. // // List<fzxzXzyzDTO> fzxzJgyzDTOList = fzxzXzyzMapper.selectList(fzxzJgyzDTOQueryWrapper);
  691. // // int jgyzid = 1;
  692. // // for (int j = 0; j < fzxzJgyzDTOList.size(); j++) {
  693. // // FzxzXzyzDTO jgyz = fzxzJgyzDTOList.get(j);
  694. // // XWPFRun run = para6.createRun();
  695. // // String jg = jgyz.getFxjg();
  696. // // Double jgDouble = 0.0;
  697. // // try {
  698. // // jgDouble = Double.parseDouble(jg);
  699. // // run.setText(jgyzid + "、压占" + jgyz.getYxyzmc() + "面积" + jg + "平方米");
  700. // // } catch (Exception e) {
  701. // // run.setText(jgyzid + "、" + jg);
  702. // // }
  703. // //
  704. // // if (jgyzid < fzxzJgyzDTOList.size())
  705. // // run.addBreak(BreakType.TEXT_WRAPPING);
  706. // // jgyzid++;
  707. // // }
  708. // index++;
  709. // }
  710. // tableFx.removeRow(0);
  711. // File fileDoc = new File(reportPath);
  712. // if (fileDoc.exists()) {
  713. // FileUtils.forceDelete(fileDoc);
  714. // }
  715. // // word文件输出流
  716. // outputStream = new FileOutputStream(reportPath);
  717. // document.write(outputStream);
  718. // } catch (Exception e) {
  719. // e.printStackTrace();
  720. // System.out.println(e.toString());
  721. // // 插入任务日志
  722. // FxrwrzDTO errorDto = new FxrwrzDTO();
  723. // errorDto.setRwbsm(res.getBsm());
  724. // errorDto.setRwlx("辅助选址");
  725. // errorDto.setRzlr("生成选址简报错误:" + e.getMessage());
  726. // errorDto.setRzsj(new Date());
  727. // errorDto.setRzlx("error");
  728. // fxrwrzMapper.insert(errorDto);
  729. // } finally {
  730. // if (document != null) {
  731. // try {
  732. // document.close();
  733. // } catch (Exception ex) {
  734. // System.out.println(ex.toString());
  735. // }
  736. // }
  737. // if (outputStream != null) {
  738. // try {
  739. // outputStream.close();
  740. // } catch (IOException e) {
  741. // e.printStackTrace();
  742. // }
  743. // }
  744. // }
  745. // // 转PDF
  746. // String outfilepath = reportPath.replace(".docx", ".pdf");
  747. // NpoiHelper.doc2pdf(reportPath, outfilepath);
  748. // System.out.println(outfilepath);
  749. // }
  750. // /**
  751. // * zip打包
  752. // */
  753. // private void createZipReport(FzxzEntityDTO res, String reportZip, String reportPath, String simplePath) {
  754. // File f = new File(fzxzShp);
  755. // System.out.println("选址分析报告打包zip:" + reportPath);
  756. // System.out.println("选址分析报告打包shp:" + fzxzShp);
  757. // if (StringUtils.isNotEmpty(fzxzShp)) {
  758. // String filePath = fzxzShp.substring(0, fzxzShp.lastIndexOf("."));
  759. // String docReportPath = reportPath.substring(0, reportPath.lastIndexOf("."));
  760. // String docSimplePath = reportPath.substring(0, reportPath.lastIndexOf("."));
  761. // // 生成的压缩文件
  762. // ZipFile zipFile = null;
  763. // try {
  764. // zipFile = new ZipFile(reportZip);
  765. // ZipParameters parameters = new ZipParameters();
  766. // // 压缩方式
  767. // parameters.setCompressionMethod(Zip4jConstants.COMP_DEFLATE);
  768. // // 压缩级别
  769. // parameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_NORMAL);
  770. // zipFile.addFile(new File(simplePath), parameters);
  771. // zipFile.addFile(new File(reportPath), parameters);
  772. // zipFile.addFile(new File(filePath + ".shp"), parameters);
  773. // zipFile.addFile(new File(filePath + ".shx"), parameters);
  774. // zipFile.addFile(new File(filePath + ".dbf"), parameters);
  775. // zipFile.addFile(new File(filePath + ".cpg"), parameters);
  776. // zipFile.addFile(new File(filePath + ".prj"), parameters);
  777. // } catch (ZipException e) {
  778. // System.out.println(e.toString());
  779. // // 插入任务日志
  780. // FxrwrzDTO errorDto = new FxrwrzDTO();
  781. // errorDto.setRwbsm(res.getBsm());
  782. // errorDto.setRwlx("辅助选址");
  783. // errorDto.setRzlr("生成选址报告zip打包错误:" + e.getMessage());
  784. // errorDto.setRzsj(new Date());
  785. // errorDto.setRzlx("error");
  786. // fxrwrzMapper.insert(errorDto);
  787. // }
  788. // }
  789. // }
  790. //
  791. // /**
  792. // * 导出报告图片
  793. // *
  794. // * @param res
  795. // * @param xzbsmList 没有导出全部的地块
  796. // * @return
  797. // */
  798. // private List<String> ReportImg(FzxzEntityDTO res, List<String> xzbsmList) {
  799. // // 查询分析结果图斑信息
  800. // QueryWrapper<FzxzResDTO> giswrapper = new QueryWrapper<>();
  801. // giswrapper.eq("rwbsm", res.getBsm());
  802. // // 筛选方案,根据传参或者预选方案
  803. // // giswrapper.ne("yxfa", "0");
  804. // if (xzbsmList != null) {
  805. // giswrapper.in("bsm", xzbsmList);
  806. // }
  807. // List<FzxzResDTO> fzxzJgGisDTOList = fzxzResMapper.selectList(giswrapper);
  808. // // SDE转SHP
  809. // String inShp = fzxzShp;
  810. // List objidlist = new ArrayList<>();
  811. // for (FzxzResDTO cur : fzxzJgGisDTOList) {
  812. // // objidlist.add(cur.getObjectid());
  813. // }
  814. // String objids = Joiner.on(",").join(objidlist);
  815. // sde2Shp("KJGH.T_FZSS_FZXZ_JG_GIS", inShp, "\"OBJECTID\" IN (" + objids + ")");
  816. // // 执行python
  817. // Map<String, String> params = new HashMap<>();
  818. // List<String> result = PythonExecute.RunFzxzMap(mapFunctionId, params);
  819. // return result;
  820. // }
  821. //
  822. // /**
  823. // * SDE转SHP
  824. // *
  825. // * @param table SDE表
  826. // * @param shpfile shp文件
  827. // * @param where 追加字段
  828. // * @return
  829. // */
  830. // public static String sde2Shp(String table, String shpfile, String where) {
  831. // if (StringUtils.isNotEmpty(where)) {
  832. // Map<String, String> params = new HashMap<>();
  833. // params.put("table", table);
  834. // params.put("shpfile", shpfile);
  835. // params.put("where", where);
  836. // return PythonExecute.RunGisHelper("sde2shp", params);
  837. // } else {
  838. // Map<String, String> params = new HashMap<>();
  839. // params.put("table", table);
  840. // params.put("shpfile", shpfile);
  841. // return PythonExecute.RunGisHelper("sde2shp", params);
  842. // }
  843. // }
  844. }