Browse Source

更改报告路径

gushoubang 1 năm trước cách đây
mục cha
commit
4fee2b29e9
16 tập tin đã thay đổi với 1741 bổ sung1733 xóa
  1. 14 1
      README.md
  2. 77 77
      onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/controller/ChscController.java
  3. 11 11
      onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/controller/FzssController.java
  4. 16 16
      onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/controller/ToolController.java
  5. 1 1
      onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/service/IFzssService.java
  6. 205 204
      onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/service/impl/ChscServiceImpl.java
  7. 41 51
      onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/service/impl/FzssServiceImpl.java
  8. 6 2
      onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/service/impl/ReportServiceImpl.java
  9. 40 39
      onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/service/impl/ToolServiceImpl.java
  10. 135 136
      onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/task/ChscSchedule.java
  11. 79 79
      onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/task/CtfxSchedule.java
  12. 460 460
      onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/task/HgxfxSchedule.java
  13. 228 228
      onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/task/PythonExecute.java
  14. 112 112
      onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/task/ZbmxMxjsSchedule.java
  15. 92 92
      onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/task/ZttSchedule.java
  16. 224 224
      onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/utils/Fxfw2SdeUtils.java

+ 14 - 1
README.md

@@ -7,12 +7,25 @@
 ## 1.污水厂数据
 1.污水处理厂的数据,需要提供空间字段,缓冲区字段
 2.通过缓冲区字段生成缓冲区导入到数据库
+3.4326数据导入库中,执行
+```angular2html
+CREATE TABLE "TB_WSC" AS SELECT ID
+,
+PUBLIC.ST_Buffer ( geom :: PUBLIC.geography, wsfhjl ) :: PUBLIC.geometry AS geom,
+mc,
+yjjsgm,
+wsfhjl
+FROM
+"TB_WSC1"
+WHERE
+geom IS NOT NULL;
+```
 
 ## 2.插入表格数据
 ```sql
 INSERT INTO "base"."t_table" ( "id", "table_name", "table_describe", "table_type", "is_exist", "create_time", "delete_time", "create_user_id", "delete_user_id", "version" )
 VALUES
-( replace(uuid_generate_v4()::text, '-', ''), 'TB_TYYDCS', '体育运动场所', 0, 0, now(), NULL, '1', NULL, '20240711172001' );
+( replace(uuid_generate_v4()::text, '-', ''), 'TB_WSC', '污水处理场', 0, 0, now(), NULL, '1', NULL, '20240716172001' );
 ```
 
 INSERT INTO "base"."t_fzss_fzxz_factor" ("id", "bsm", "level", "parent_id", "status", "condition_info", "name", "order_index") VALUES ('5e008c32506b47ffb1ea83009aba1ed2', '', 0, '', 2, '""', '防控因子', '1');

+ 77 - 77
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/controller/ChscController.java

@@ -2,7 +2,7 @@ package com.onemap.analyse.controller;
 
 import com.onemap.analyse.domain.FzssChscXmgxDTO;
 import com.onemap.analyse.domain.FzxzChscDTO;
-import com.onemap.analyse.service.IChscService;
+// import com.onemap.analyse.service.IChscService;
 import com.onemap.common.core.domain.R;
 import com.onemap.common.core.web.controller.BaseController;
 import com.onemap.common.core.web.domain.WebResult;
@@ -20,81 +20,81 @@ import javax.servlet.http.HttpServletResponse;
 @RequestMapping("/chsc")
 public class ChscController extends BaseController {
 
-    @Autowired
-    private IChscService chscService;
-
-    /**
-     * 安全认证:根据授权码登录获取身份安全认证Token
-     *
-     * @param appid
-     * @return
-     */
-    @PostMapping("/authorize")
-    public R<?> authorize(String appid, HttpServletRequest request, HttpServletResponse response) {
-        R<?> res = chscService.authorize(appid, request, response);
-        return res;
-    }
-
-    /**
-     * 下载选址报告
-     *
-     * @param bsm
-     * @return
-     */
-    @GetMapping("/download")
-    public WebResult download(String bsm, HttpServletRequest request, HttpServletResponse response) {
-        WebResult res = chscService.download(bsm, request, response);
-        return res;
-    }
-
-    /**
-     * 查询项目选址进度
-     *
-     * @param bsm
-     * @return
-     */
-    @GetMapping("/getProgress")
-    public WebResult getProgress(String bsm, HttpServletRequest request, HttpServletResponse response) {
-        WebResult res = chscService.getProgress(bsm, request, response);
-        return res;
-    }
-
-    /**
-     * 更新项目选址结果:项目策划完成,更新选址审批结果
-     *
-     * @param fzssChscXmgxDTO
-     * @return
-     */
-    @PostMapping("/xmjg")
-    public WebResult xmjg(FzssChscXmgxDTO fzssChscXmgxDTO) {
-        WebResult res = chscService.xmjg(fzssChscXmgxDTO);
-        return res;
-    }
-
-    /**
-     * 创建项目选址:根据项目信息,创建选址项目
-     *
-     * @param fzxzChscDTO
-     * @return
-     */
-    @PostMapping("/create")
-    public WebResult create(FzxzChscDTO fzxzChscDTO) {
-        WebResult res = chscService.create(fzxzChscDTO);
-        return res;
-    }
-
-    /**
-     * 文本转SHP文件
-     *
-     * @param file
-     * @param request
-     * @param response
-     * @return
-     */
-    @PostMapping("/txt2shp")
-    public WebResult txt2shp(MultipartFile file, HttpServletRequest request, HttpServletResponse response) {
-        WebResult res = chscService.txt2shp(file, request, response);
-        return res;
-    }
+    // @Autowired
+    // private IChscService chscService;
+    //
+    // /**
+    //  * 安全认证:根据授权码登录获取身份安全认证Token
+    //  *
+    //  * @param appid
+    //  * @return
+    //  */
+    // @PostMapping("/authorize")
+    // public R<?> authorize(String appid, HttpServletRequest request, HttpServletResponse response) {
+    //     R<?> res = chscService.authorize(appid, request, response);
+    //     return res;
+    // }
+    //
+    // /**
+    //  * 下载选址报告
+    //  *
+    //  * @param bsm
+    //  * @return
+    //  */
+    // @GetMapping("/download")
+    // public WebResult download(String bsm, HttpServletRequest request, HttpServletResponse response) {
+    //     WebResult res = chscService.download(bsm, request, response);
+    //     return res;
+    // }
+    //
+    // /**
+    //  * 查询项目选址进度
+    //  *
+    //  * @param bsm
+    //  * @return
+    //  */
+    // @GetMapping("/getProgress")
+    // public WebResult getProgress(String bsm, HttpServletRequest request, HttpServletResponse response) {
+    //     WebResult res = chscService.getProgress(bsm, request, response);
+    //     return res;
+    // }
+    //
+    // /**
+    //  * 更新项目选址结果:项目策划完成,更新选址审批结果
+    //  *
+    //  * @param fzssChscXmgxDTO
+    //  * @return
+    //  */
+    // @PostMapping("/xmjg")
+    // public WebResult xmjg(FzssChscXmgxDTO fzssChscXmgxDTO) {
+    //     WebResult res = chscService.xmjg(fzssChscXmgxDTO);
+    //     return res;
+    // }
+    //
+    // /**
+    //  * 创建项目选址:根据项目信息,创建选址项目
+    //  *
+    //  * @param fzxzChscDTO
+    //  * @return
+    //  */
+    // @PostMapping("/create")
+    // public WebResult create(FzxzChscDTO fzxzChscDTO) {
+    //     WebResult res = chscService.create(fzxzChscDTO);
+    //     return res;
+    // }
+    //
+    // /**
+    //  * 文本转SHP文件
+    //  *
+    //  * @param file
+    //  * @param request
+    //  * @param response
+    //  * @return
+    //  */
+    // @PostMapping("/txt2shp")
+    // public WebResult txt2shp(MultipartFile file, HttpServletRequest request, HttpServletResponse response) {
+    //     WebResult res = chscService.txt2shp(file, request, response);
+    //     return res;
+    // }
 
 }

+ 11 - 11
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/controller/FzssController.java

@@ -21,17 +21,17 @@ public class FzssController extends BaseController {
     @Autowired
     private IFzssService fzssService;
 
-    /**
-     * 新建合规性分析
-     *
-     * @param hgxfxEntityDTO
-     * @return
-     */
-    @PostMapping("/AddHgxfx")
-    public RequestResult AddHgxfx(@RequestBody HgxfxEntityDTO hgxfxEntityDTO) throws IOException {
-        RequestResult res = fzssService.AddHgxfx(hgxfxEntityDTO);
-        return res;
-    }
+    // /**
+    //  * 新建合规性分析
+    //  *
+    //  * @param hgxfxEntityDTO
+    //  * @return
+    //  */
+    // @PostMapping("/AddHgxfx")
+    // public RequestResult AddHgxfx(@RequestBody HgxfxEntityDTO hgxfxEntityDTO) throws IOException {
+    //     RequestResult res = fzssService.AddHgxfx(hgxfxEntityDTO);
+    //     return res;
+    // }
 
     /**
      * 新建辅助选址

+ 16 - 16
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/controller/ToolController.java

@@ -1,6 +1,6 @@
 package com.onemap.analyse.controller;
 
-import com.onemap.analyse.service.IToolService;
+// import com.onemap.analyse.service.IToolService;
 import com.onemap.common.core.web.controller.BaseController;
 import com.onemap.common.core.web.domain.WebResult;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -13,20 +13,20 @@ import org.springframework.web.bind.annotation.RestController;
 @RequestMapping("/tool")
 public class ToolController extends BaseController {
 
-    @Autowired
-    private IToolService toolService;
-
-
-    /**
-     * esrijson转shp
-     *
-     * @param esrijson
-     * @return
-     */
-    @PostMapping("/jsonToShp")
-    public WebResult jsonToShp(String esrijson) {
-        WebResult res = toolService.jsonToShp(esrijson);
-        return res;
-    }
+    // @Autowired
+    // private IToolService toolService;
+    //
+    //
+    // /**
+    //  * esrijson转shp
+    //  *
+    //  * @param esrijson
+    //  * @return
+    //  */
+    // @PostMapping("/jsonToShp")
+    // public WebResult jsonToShp(String esrijson) {
+    //     WebResult res = toolService.jsonToShp(esrijson);
+    //     return res;
+    // }
 
 }

+ 1 - 1
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/service/IFzssService.java

@@ -9,7 +9,7 @@ import java.io.IOException;
 import java.util.Map;
 
 public interface IFzssService {
-    RequestResult AddHgxfx(HgxfxEntityDTO hgxfxEntityDTO) throws IOException;
+    // RequestResult AddHgxfx(HgxfxEntityDTO hgxfxEntityDTO) throws IOException;
 
     FzxzCalc saveScheduleParam(SelectPilotVo selectPilotVo);
 

+ 205 - 204
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/service/impl/ChscServiceImpl.java

@@ -28,209 +28,210 @@ import java.io.*;
 import java.nio.file.Paths;
 import java.util.*;
 
-@Service
-public class ChscServiceImpl implements IChscService {
+// @Service
+// public class ChscServiceImpl implements IChscService {
+public class ChscServiceImpl  {
 
-    @Autowired
-    private RemoteAuthService remoteAuthService;
-    @Autowired
-    private FzssSystemMapper fzssSystemMapper;
-    @Resource
-    private FzssChscMapper fzssChscMapper;
-    @Resource
-    private HgxfxMapper hgxfxMapper;
-    @Resource
-    private FzxzMapper fzxzMapper;
-    @Resource
-    private FzssChscFileMapper fzssChscFileMapper;
-    private RwztDTO rwztDTO = new RwztDTO();
-    private XzlbDTO xzlbDTO = new XzlbDTO();
-    private FxfwDictDTO fxfwDictDTO = new FxfwDictDTO();
-    @Value("${Hgxfx.temp}")
-    private String temp;
-
-    @Override
-    public R<?> authorize(String appid, HttpServletRequest request, HttpServletResponse response) {
-        QueryWrapper<FzssSystemDTO> wrapper = new QueryWrapper<>();
-        wrapper.eq("id", appid);
-        FzssSystemDTO system = fzssSystemMapper.selectOne(wrapper);
-        if (system != null) {
-            String requestIp = HttpUtil.getRequestIp(request);
-            if (!system.getIp().contains(requestIp)) {
-                return R.fail(500, "访问ip与申请ip不一致");
-            }
-            R<?> r = remoteAuthService.empoweruser(system.getUsername());
-            return r;
-        }
-        return R.fail(500, "未检索到appid相关信息");
-    }
-
-    @Override
-    public WebResult download(String bsm, HttpServletRequest request, HttpServletResponse response) {
-        QueryWrapper<FzxzChscDTO> wrapper = new QueryWrapper<>();
-        wrapper.eq("bsm", bsm);
-        FzxzChscDTO chsc = fzssChscMapper.selectOne(wrapper);
-        if (chsc != null && rwztDTO.getComplete().equals(chsc.getRwzt())) {
-            //选址类别(0意向范围筛选,1指定空间位置)
-            if (xzlbDTO.getHgxfx() == chsc.getXzlb()) {
-                HgxfxDTO hgxfx = hgxfxMapper.selectOne(new QueryWrapper<HgxfxDTO>().eq("bsm", bsm));
-                if (hgxfx != null) {
-                    DownloadUtils.download(response, hgxfx.getFxbg().replace(".docx", ".pdf"), "选址报告");
-                    return null;
-                } else {
-                    return WebResult.error("查询报告为空");
-                }
-            } else if (xzlbDTO.getXmxz() == chsc.getXzlb()) {
-                FzxzDTO fzxz = fzxzMapper.selectOne(new QueryWrapper<FzxzDTO>().eq("bsm", bsm));
-                if (fzxz != null) {
-                    DownloadUtils.download(response, fzxz.getFxbg(), "选址报告");
-                    return null;
-                } else {
-                    return WebResult.error("查询报告为空");
-                }
-            }
-            return WebResult.error("查询报告为空");
-        }
-        return WebResult.error("项目不存在或分析未完成");
-    }
-
-    @Override
-    public WebResult getProgress(String bsm, HttpServletRequest request, HttpServletResponse response) {
-        QueryWrapper<FzxzChscDTO> wrapper = new QueryWrapper<>();
-        wrapper.eq("bsm", bsm);
-        FzxzChscDTO chsc = fzssChscMapper.selectOne(wrapper);
-        if (chsc != null) {
-            FzxzChscProgressDTO res = new FzxzChscProgressDTO();
-            res.setBsm(chsc.getBsm());
-            res.setJd(chsc.getRwjd());
-            res.setMsg(chsc.getRwzt() == rwztDTO.getNoJX() ? "未解析" : chsc.getRwjg());
-            res.setState(chsc.getRwzt());
-            return WebResult.success("操作成功", res);
-        } else {
-            return WebResult.error("项目不存在");
-        }
-    }
-
-    @Override
-    public WebResult xmjg(FzssChscXmgxDTO fzssChscXmgxDTO) {
-        QueryWrapper<FzxzChscDTO> wrapper = new QueryWrapper<>();
-        wrapper.eq("bsm", fzssChscXmgxDTO.getBsm());
-        FzxzChscDTO chsc = fzssChscMapper.selectOne(wrapper);
-        if (chsc != null) {
-            chsc.setChzt(String.valueOf(fzssChscXmgxDTO.getChzt()));
-            chsc.setChjg(fzssChscXmgxDTO.getChjg());
-            chsc.setChbz(fzssChscXmgxDTO.getChjg());
-            try {
-                fzssChscMapper.update(chsc, wrapper);
-                return WebResult.success("操作成功", true);
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-            return WebResult.error("数据更新失败");
-        }
-        return WebResult.error("项目编码错误");
-    }
-
-    @Override
-    public WebResult create(FzxzChscDTO fzxzChscDTO) {
-        if (!fzxzChscDTO.paramsChecked()) {
-            return WebResult.error("必输入参数不能为空");
-        }
-        if (fzxzChscDTO.getFwlx() == fxfwDictDTO.getShp()) {
-            FzssChscFileDTO fileDTO = fzssChscFileMapper.selectOne(new QueryWrapper<FzssChscFileDTO>().eq("bsm", fzxzChscDTO.getXzfw()));
-            if (fileDTO == null) {
-                return WebResult.error("选址范围错误,请检查参数是否正确");
-            }
-            if (!FileUtils.check(fileDTO.getWj())) {
-                return WebResult.error("选址范围未找到,请重新上传范围文件");
-            }
-        } else {
-            return WebResult.error("FWLX暂不支持" + fzxzChscDTO.getFwlx());
-        }
-        //插入策划生成数据库表
-        String uuid = StringUtils.getUUID();
-        fzxzChscDTO.setBsm(uuid);
-        fzxzChscDTO.setRwzt(rwztDTO.getNoJX());
-        fzxzChscDTO.setCjsj(new Date());
-        fzssChscMapper.insert(fzxzChscDTO);
-        return WebResult.success("操作成功", uuid);
-    }
-
-    @Override
-    public WebResult txt2shp(MultipartFile file, HttpServletRequest request, HttpServletResponse response) {
-        //将txt文件保存到本地
-        long timeMillis = System.currentTimeMillis();
-        String targetfolder = temp + "\\" + timeMillis + "\\";
-        String targetfile = targetfolder + file.getOriginalFilename();
-        String jsonpath = targetfolder + "esrijson.json";
-        String shppath = targetfolder + "shape.shp";
-        try {
-            FileUtils.makedir(targetfolder);
-            file.transferTo(Paths.get(targetfile));
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-        List<String> strlist = new ArrayList<>();
-        BufferedReader br = null;
-        try {
-            br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(targetfile)), "UTF-8"));//GBK
-            String str = null;
-            int i = 0;
-            while ((str = br.readLine()) != null) {
-                if (!StringUtils.isEmpty(str) && !str.startsWith("#")) {
-                    strlist.add(str);
-                }
-                i++;
-            }
-        } catch (IOException e) {
-            e.printStackTrace();
-        } finally {
-            try {
-                br.close();
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-        //将文本字符串进行转换,生成esrijson并保存到本地
-        String esrijson = EsriJsonUtils.arrayToJson(strlist);
-        //写入文件
-        FileOutputStream fos = null;
-        try {
-            fos = new FileOutputStream(jsonpath, true);
-            //true表示在文件末尾追加
-            fos.write(esrijson.toString().getBytes());
-            fos.close();
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-        try {
-            //调用Python执行esrijson转shp
-            String msg = PythonExecute.EsriJson2shp(jsonpath, shppath);
-            if (!StringUtils.isEmpty(msg) && msg.contains("OK")) {
-                //将shp相关文件进行压缩并输入
-                List<Map> fileList = new ArrayList<>();
-                Map map = new HashMap();
-                map.put("fileName", FileStreamUtils.getFileName(shppath));
-                map.put("outByte", FileStreamUtils.getByteArrayOutputStream(shppath).toByteArray());
-                fileList.add(map);
-                String[] kzm = {".sbn",".shx", ".dbf", ".cpg", ".prj"};
-                String curkzm = ".shp";
-                for (int i = 0; i < kzm.length; i++) {
-                    String curpath = shppath.replaceAll(curkzm, kzm[i]);
-                    Map cur = new HashMap();
-                    cur.put("fileName", FileStreamUtils.getFileName(curpath));
-                    cur.put("outByte", FileStreamUtils.getByteArrayOutputStream(curpath).toByteArray());
-                    fileList.add(cur);
-                }
-                ZipUtils.zipFiles(fileList,response);
-            } else {
-                WebResult.error("json转shape失败", false);
-            }
-        }catch (Exception e){
-            e.printStackTrace();
-        }
-        //当初当前临时文件夹
-        FileUtils.deldir(targetfolder);
-        return null;
-    }
+    // @Autowired
+    // private RemoteAuthService remoteAuthService;
+    // @Autowired
+    // private FzssSystemMapper fzssSystemMapper;
+    // @Resource
+    // private FzssChscMapper fzssChscMapper;
+    // @Resource
+    // private HgxfxMapper hgxfxMapper;
+    // @Resource
+    // private FzxzMapper fzxzMapper;
+    // @Resource
+    // private FzssChscFileMapper fzssChscFileMapper;
+    // private RwztDTO rwztDTO = new RwztDTO();
+    // private XzlbDTO xzlbDTO = new XzlbDTO();
+    // private FxfwDictDTO fxfwDictDTO = new FxfwDictDTO();
+    // @Value("${Hgxfx.temp}")
+    // private String temp;
+    //
+    // @Override
+    // public R<?> authorize(String appid, HttpServletRequest request, HttpServletResponse response) {
+    //     QueryWrapper<FzssSystemDTO> wrapper = new QueryWrapper<>();
+    //     wrapper.eq("id", appid);
+    //     FzssSystemDTO system = fzssSystemMapper.selectOne(wrapper);
+    //     if (system != null) {
+    //         String requestIp = HttpUtil.getRequestIp(request);
+    //         if (!system.getIp().contains(requestIp)) {
+    //             return R.fail(500, "访问ip与申请ip不一致");
+    //         }
+    //         R<?> r = remoteAuthService.empoweruser(system.getUsername());
+    //         return r;
+    //     }
+    //     return R.fail(500, "未检索到appid相关信息");
+    // }
+    //
+    // @Override
+    // public WebResult download(String bsm, HttpServletRequest request, HttpServletResponse response) {
+    //     QueryWrapper<FzxzChscDTO> wrapper = new QueryWrapper<>();
+    //     wrapper.eq("bsm", bsm);
+    //     FzxzChscDTO chsc = fzssChscMapper.selectOne(wrapper);
+    //     if (chsc != null && rwztDTO.getComplete().equals(chsc.getRwzt())) {
+    //         //选址类别(0意向范围筛选,1指定空间位置)
+    //         if (xzlbDTO.getHgxfx() == chsc.getXzlb()) {
+    //             HgxfxDTO hgxfx = hgxfxMapper.selectOne(new QueryWrapper<HgxfxDTO>().eq("bsm", bsm));
+    //             if (hgxfx != null) {
+    //                 DownloadUtils.download(response, hgxfx.getFxbg().replace(".docx", ".pdf"), "选址报告");
+    //                 return null;
+    //             } else {
+    //                 return WebResult.error("查询报告为空");
+    //             }
+    //         } else if (xzlbDTO.getXmxz() == chsc.getXzlb()) {
+    //             FzxzDTO fzxz = fzxzMapper.selectOne(new QueryWrapper<FzxzDTO>().eq("bsm", bsm));
+    //             if (fzxz != null) {
+    //                 DownloadUtils.download(response, fzxz.getFxbg(), "选址报告");
+    //                 return null;
+    //             } else {
+    //                 return WebResult.error("查询报告为空");
+    //             }
+    //         }
+    //         return WebResult.error("查询报告为空");
+    //     }
+    //     return WebResult.error("项目不存在或分析未完成");
+    // }
+    //
+    // @Override
+    // public WebResult getProgress(String bsm, HttpServletRequest request, HttpServletResponse response) {
+    //     QueryWrapper<FzxzChscDTO> wrapper = new QueryWrapper<>();
+    //     wrapper.eq("bsm", bsm);
+    //     FzxzChscDTO chsc = fzssChscMapper.selectOne(wrapper);
+    //     if (chsc != null) {
+    //         FzxzChscProgressDTO res = new FzxzChscProgressDTO();
+    //         res.setBsm(chsc.getBsm());
+    //         res.setJd(chsc.getRwjd());
+    //         res.setMsg(chsc.getRwzt() == rwztDTO.getNoJX() ? "未解析" : chsc.getRwjg());
+    //         res.setState(chsc.getRwzt());
+    //         return WebResult.success("操作成功", res);
+    //     } else {
+    //         return WebResult.error("项目不存在");
+    //     }
+    // }
+    //
+    // @Override
+    // public WebResult xmjg(FzssChscXmgxDTO fzssChscXmgxDTO) {
+    //     QueryWrapper<FzxzChscDTO> wrapper = new QueryWrapper<>();
+    //     wrapper.eq("bsm", fzssChscXmgxDTO.getBsm());
+    //     FzxzChscDTO chsc = fzssChscMapper.selectOne(wrapper);
+    //     if (chsc != null) {
+    //         chsc.setChzt(String.valueOf(fzssChscXmgxDTO.getChzt()));
+    //         chsc.setChjg(fzssChscXmgxDTO.getChjg());
+    //         chsc.setChbz(fzssChscXmgxDTO.getChjg());
+    //         try {
+    //             fzssChscMapper.update(chsc, wrapper);
+    //             return WebResult.success("操作成功", true);
+    //         } catch (Exception e) {
+    //             e.printStackTrace();
+    //         }
+    //         return WebResult.error("数据更新失败");
+    //     }
+    //     return WebResult.error("项目编码错误");
+    // }
+    //
+    // @Override
+    // public WebResult create(FzxzChscDTO fzxzChscDTO) {
+    //     if (!fzxzChscDTO.paramsChecked()) {
+    //         return WebResult.error("必输入参数不能为空");
+    //     }
+    //     if (fzxzChscDTO.getFwlx() == fxfwDictDTO.getShp()) {
+    //         FzssChscFileDTO fileDTO = fzssChscFileMapper.selectOne(new QueryWrapper<FzssChscFileDTO>().eq("bsm", fzxzChscDTO.getXzfw()));
+    //         if (fileDTO == null) {
+    //             return WebResult.error("选址范围错误,请检查参数是否正确");
+    //         }
+    //         if (!FileUtils.check(fileDTO.getWj())) {
+    //             return WebResult.error("选址范围未找到,请重新上传范围文件");
+    //         }
+    //     } else {
+    //         return WebResult.error("FWLX暂不支持" + fzxzChscDTO.getFwlx());
+    //     }
+    //     //插入策划生成数据库表
+    //     String uuid = StringUtils.getUUID();
+    //     fzxzChscDTO.setBsm(uuid);
+    //     fzxzChscDTO.setRwzt(rwztDTO.getNoJX());
+    //     fzxzChscDTO.setCjsj(new Date());
+    //     fzssChscMapper.insert(fzxzChscDTO);
+    //     return WebResult.success("操作成功", uuid);
+    // }
+    //
+    // @Override
+    // public WebResult txt2shp(MultipartFile file, HttpServletRequest request, HttpServletResponse response) {
+    //     //将txt文件保存到本地
+    //     long timeMillis = System.currentTimeMillis();
+    //     String targetfolder = temp + "\\" + timeMillis + "\\";
+    //     String targetfile = targetfolder + file.getOriginalFilename();
+    //     String jsonpath = targetfolder + "esrijson.json";
+    //     String shppath = targetfolder + "shape.shp";
+    //     try {
+    //         FileUtils.makedir(targetfolder);
+    //         file.transferTo(Paths.get(targetfile));
+    //     } catch (IOException e) {
+    //         e.printStackTrace();
+    //     }
+    //     List<String> strlist = new ArrayList<>();
+    //     BufferedReader br = null;
+    //     try {
+    //         br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(targetfile)), "UTF-8"));//GBK
+    //         String str = null;
+    //         int i = 0;
+    //         while ((str = br.readLine()) != null) {
+    //             if (!StringUtils.isEmpty(str) && !str.startsWith("#")) {
+    //                 strlist.add(str);
+    //             }
+    //             i++;
+    //         }
+    //     } catch (IOException e) {
+    //         e.printStackTrace();
+    //     } finally {
+    //         try {
+    //             br.close();
+    //         } catch (IOException e) {
+    //             e.printStackTrace();
+    //         }
+    //     }
+    //     //将文本字符串进行转换,生成esrijson并保存到本地
+    //     String esrijson = EsriJsonUtils.arrayToJson(strlist);
+    //     //写入文件
+    //     FileOutputStream fos = null;
+    //     try {
+    //         fos = new FileOutputStream(jsonpath, true);
+    //         //true表示在文件末尾追加
+    //         fos.write(esrijson.toString().getBytes());
+    //         fos.close();
+    //     } catch (IOException e) {
+    //         e.printStackTrace();
+    //     }
+    //     try {
+    //         //调用Python执行esrijson转shp
+    //         String msg = PythonExecute.EsriJson2shp(jsonpath, shppath);
+    //         if (!StringUtils.isEmpty(msg) && msg.contains("OK")) {
+    //             //将shp相关文件进行压缩并输入
+    //             List<Map> fileList = new ArrayList<>();
+    //             Map map = new HashMap();
+    //             map.put("fileName", FileStreamUtils.getFileName(shppath));
+    //             map.put("outByte", FileStreamUtils.getByteArrayOutputStream(shppath).toByteArray());
+    //             fileList.add(map);
+    //             String[] kzm = {".sbn",".shx", ".dbf", ".cpg", ".prj"};
+    //             String curkzm = ".shp";
+    //             for (int i = 0; i < kzm.length; i++) {
+    //                 String curpath = shppath.replaceAll(curkzm, kzm[i]);
+    //                 Map cur = new HashMap();
+    //                 cur.put("fileName", FileStreamUtils.getFileName(curpath));
+    //                 cur.put("outByte", FileStreamUtils.getByteArrayOutputStream(curpath).toByteArray());
+    //                 fileList.add(cur);
+    //             }
+    //             ZipUtils.zipFiles(fileList,response);
+    //         } else {
+    //             WebResult.error("json转shape失败", false);
+    //         }
+    //     }catch (Exception e){
+    //         e.printStackTrace();
+    //     }
+    //     //当初当前临时文件夹
+    //     FileUtils.deldir(targetfolder);
+    //     return null;
+    // }
 }

+ 41 - 51
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/service/impl/FzssServiceImpl.java

@@ -30,8 +30,9 @@ import javax.annotation.Resource;
 import java.io.IOException;
 import java.util.*;
 
-import static com.onemap.analyse.utils.Fxfw2SdeUtils.vector2Sde;
-
+/**
+ * 辅助选址服务
+ */
 @Service
 public class FzssServiceImpl implements IFzssService {
     @Value("${Hgxfx.temp}")
@@ -76,40 +77,40 @@ public class FzssServiceImpl implements IFzssService {
     private ITableDateService tableDateService;
     //**需要拿出来的逻辑**//
 
-    @Transactional(rollbackFor = Exception.class)
-    @Override
-    public RequestResult AddHgxfx(HgxfxEntityDTO hgxfxEntityDTO) throws IOException {
-        HgxfxDTO requestHgxfxDTO = DozerUtils.map(hgxfxEntityDTO, HgxfxDTO.class);
-        requestHgxfxDTO.setFxmj(hgxfxEntityDTO.getXzmj());
-        requestHgxfxDTO.setRwly("Web");
-        requestHgxfxDTO.setRwzt(0);
-        requestHgxfxDTO.setCjsj(new Date());
-        requestHgxfxDTO.setBsm(StringUtils.getUUID());
-        requestHgxfxDTO.setCjyh(SecurityUtils.getUsername());
-        // 将分析范围矢量数据插入到KJGH.T_FZSS_FXRW_GIS
-        RequestResult info = vector2Sde(hgxfxEntityDTO, requestHgxfxDTO);
-        if (info != null) {
-            return info;
-        }
-        // 查询审查项 默认把控制线级别等于0的也添加进去
-        QueryWrapper<HgxfxScxDTO> wrapper = new QueryWrapper<HgxfxScxDTO>();
-        wrapper.eq("kzxjb", 0).or().in("bsm", hgxfxEntityDTO.getScxs().split(",")).orderByAsc("xssx");
-        List<HgxfxScxDTO> res = hgxfxScxMapper.selectList(wrapper);
-        if (res.size() > 0) {
-            // 插入审查项列表
-            for (HgxfxScxDTO cur : res) {
-                HgxfxHgscxDTO scx = new HgxfxHgscxDTO();
-                scx.setBsm(StringUtils.getUUID());
-                scx.setRwbsm(requestHgxfxDTO.getBsm());
-                scx.setScxbsm(cur.getBsm());
-                scx.setYsmc(cur.getYsmc());
-                hgxfxHgscxMapper.insert(scx);
-            }
-        }
-        // 插入合规性检查表 并返回任务标识码
-        hgxfxMapper.insert(requestHgxfxDTO);
-        return RequestResult.success("保存成功!", requestHgxfxDTO.getBsm());
-    }
+    // @Transactional(rollbackFor = Exception.class)
+    // @Override
+    // public RequestResult AddHgxfx(HgxfxEntityDTO hgxfxEntityDTO) throws IOException {
+    //     HgxfxDTO requestHgxfxDTO = DozerUtils.map(hgxfxEntityDTO, HgxfxDTO.class);
+    //     requestHgxfxDTO.setFxmj(hgxfxEntityDTO.getXzmj());
+    //     requestHgxfxDTO.setRwly("Web");
+    //     requestHgxfxDTO.setRwzt(0);
+    //     requestHgxfxDTO.setCjsj(new Date());
+    //     requestHgxfxDTO.setBsm(StringUtils.getUUID());
+    //     requestHgxfxDTO.setCjyh(SecurityUtils.getUsername());
+    //     // 将分析范围矢量数据插入到KJGH.T_FZSS_FXRW_GIS
+    //     RequestResult info = vector2Sde(hgxfxEntityDTO, requestHgxfxDTO);
+    //     if (info != null) {
+    //         return info;
+    //     }
+    //     // 查询审查项 默认把控制线级别等于0的也添加进去
+    //     QueryWrapper<HgxfxScxDTO> wrapper = new QueryWrapper<HgxfxScxDTO>();
+    //     wrapper.eq("kzxjb", 0).or().in("bsm", hgxfxEntityDTO.getScxs().split(",")).orderByAsc("xssx");
+    //     List<HgxfxScxDTO> res = hgxfxScxMapper.selectList(wrapper);
+    //     if (res.size() > 0) {
+    //         // 插入审查项列表
+    //         for (HgxfxScxDTO cur : res) {
+    //             HgxfxHgscxDTO scx = new HgxfxHgscxDTO();
+    //             scx.setBsm(StringUtils.getUUID());
+    //             scx.setRwbsm(requestHgxfxDTO.getBsm());
+    //             scx.setScxbsm(cur.getBsm());
+    //             scx.setYsmc(cur.getYsmc());
+    //             hgxfxHgscxMapper.insert(scx);
+    //         }
+    //     }
+    //     // 插入合规性检查表 并返回任务标识码
+    //     hgxfxMapper.insert(requestHgxfxDTO);
+    //     return RequestResult.success("保存成功!", requestHgxfxDTO.getBsm());
+    // }
 
 
     /**
@@ -207,7 +208,7 @@ public class FzssServiceImpl implements IFzssService {
         GeomRes geomRes = shpFileMapper.getOne(fzxzDTO.getGeomId());
         iLogService.saveLog(taskId, "辅助选址", "载入选址范围完成", "info");
 
-        // 地块切割
+        // 2.地块切割
         String ewkt = geomRes.getGeom();
         TableWktVo intersectionTableWktVo = new TableWktVo();
         intersectionTableWktVo.setTableName(fzxzDTO.getSjy());
@@ -222,20 +223,6 @@ public class FzssServiceImpl implements IFzssService {
         }
 
         iLogService.saveLog(taskId, "辅助选址", "相交裁剪" + sjyName, "info");
-        // TODO 2.面积筛选
-        // Map<String, Object> areaMap = new HashMap<>();
-        // areaMap.put("sjy", fzxzDTO.getSjy());
-        // areaMap.put("beginArea", fzxzDTO.getYdmjbegin());
-        // areaMap.put("endArea", fzxzDTO.getYdmjend());
-        // areaMap.put("idList", ids);
-        // ids = ghdkaMapper.getIdByArea(areaMap);
-        // if (ids.size() == 0) {
-        //     iLogService.saveLog(taskId, "辅助选址", "计算完成,未找到符合条件数据", "info");
-        //     updateFzxzStatus(taskId, Rwzt.getNoJX());
-        //     return RequestResult.error("面积筛选条件筛选未找到符合条件数据!", null);
-        // }
-        //
-        // iLogService.saveLog(taskId, "辅助选址", "地块面积分析完成", "info");
 
         //  3.用地类型(性质)筛选
         if (fzxzDTO.getUseLandType()) {
@@ -252,9 +239,12 @@ public class FzssServiceImpl implements IFzssService {
         // 4.根据因子切割地块
         String rawTable = factorClip(taskId, temporaryTable, fzxzCalc.getFactorUseList(), ewkt);
         if (rawTable.equals("")) return RequestResult.error("区域筛选条件筛选未找到符合条件数据!", null);
+
         // 5.切割地块,面积筛选
         if (fzxzDTO.getUseMultiple()) {
             // 允许多地块
+            int multDistanc = fzxzDTO.getMultipleDistance();
+
         } else {
             // 不允许多地块,删除面积不符合要求的地块
             tableDateService.delByArea(rawTable, fzxzDTO.getYdmjbegin(), fzxzDTO.getYdmjend());

+ 6 - 2
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/service/impl/ReportServiceImpl.java

@@ -41,11 +41,15 @@ public class ReportServiceImpl implements IReportService {
     @Resource
     private FactorUseMapper fzxzXzyzMapper;
 
-    @Value("${Hgxfx.temp}")
-    private String temp;
+    @Value("${Hgxfx.tempWin}")
+    private String tempWin;
+    @Value("${Hgxfx.tempLinux}")
+    private String tempLinux;
 
     // 根据选址任务生成报告
     public FzxzReport createReport(String bsm, List<String> xzbsmList) {
+        String temp=tempLinux;
+
         // 保存生成报告日志
         iLogService.saveLog(bsm, "智能选址", "开始生成选址报告", "info");
 

+ 40 - 39
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/service/impl/ToolServiceImpl.java

@@ -13,44 +13,45 @@ import java.io.IOException;
 import java.nio.file.Paths;
 
 
-@Service
-public class ToolServiceImpl implements IToolService {
+// @Service
+// public class ToolServiceImpl implements IToolService {
+public class ToolServiceImpl {
 
-    @Value("${Hgxfx.temp}")
-    private String temp;
-
-
-    @Override
-    public WebResult jsonToShp(String esrijson) {
-        if(StringUtils.isEmpty(esrijson)){
-            return WebResult.error("esrijson参数未传递!");
-        }
-        //将esrijson文件保存到本地
-        long timeMillis = System.currentTimeMillis();
-        String targetfolder = temp + "\\" + timeMillis + "\\";
-        String jsonpath = targetfolder + "esrijson.json";
-        String shppath = targetfolder + "shape.shp";
-        try {
-            FileUtils.makedir(targetfolder);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        //写入文件
-        FileOutputStream fos = null;
-        try {
-            fos = new FileOutputStream(jsonpath, true);
-            //true表示在文件末尾追加
-            fos.write(esrijson.toString().getBytes());
-            fos.close();
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-        //调用Python执行esrijson转shp
-        String msg = PythonExecute.EsriJson2shp(jsonpath, shppath);
-        if (!StringUtils.isEmpty(msg) && msg.contains("OK")) {
-            return WebResult.success("转换成功!", shppath);
-        } else {
-            return WebResult.error("转换失败!");
-        }
-    }
+    // @Value("${Hgxfx.temp}")
+    // private String temp;
+    //
+    //
+    // @Override
+    // public WebResult jsonToShp(String esrijson) {
+    //     if(StringUtils.isEmpty(esrijson)){
+    //         return WebResult.error("esrijson参数未传递!");
+    //     }
+    //     //将esrijson文件保存到本地
+    //     long timeMillis = System.currentTimeMillis();
+    //     String targetfolder = temp + "\\" + timeMillis + "\\";
+    //     String jsonpath = targetfolder + "esrijson.json";
+    //     String shppath = targetfolder + "shape.shp";
+    //     try {
+    //         FileUtils.makedir(targetfolder);
+    //     } catch (Exception e) {
+    //         e.printStackTrace();
+    //     }
+    //     //写入文件
+    //     FileOutputStream fos = null;
+    //     try {
+    //         fos = new FileOutputStream(jsonpath, true);
+    //         //true表示在文件末尾追加
+    //         fos.write(esrijson.toString().getBytes());
+    //         fos.close();
+    //     } catch (IOException e) {
+    //         e.printStackTrace();
+    //     }
+    //     //调用Python执行esrijson转shp
+    //     String msg = PythonExecute.EsriJson2shp(jsonpath, shppath);
+    //     if (!StringUtils.isEmpty(msg) && msg.contains("OK")) {
+    //         return WebResult.success("转换成功!", shppath);
+    //     } else {
+    //         return WebResult.error("转换失败!");
+    //     }
+    // }
 }

+ 135 - 136
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/task/ChscSchedule.java

@@ -28,145 +28,144 @@ import java.math.BigInteger;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
-import static com.onemap.analyse.utils.Fxfw2SdeUtils.fzxzvector2Sde;
 
 /**
  * 策划生成模块定时刷新任务
  */
-@Component
+// @Component
 public class ChscSchedule {
-    //间隔时间 单位ms
-    public static final long TIME_INTERVAL = 1 * 15000;
-    //任务状态标识码
-    private RwztDTO Rwzt = new RwztDTO();
-    private XzlbDTO xzlbDTO = new XzlbDTO();
-    private FxfwDictDTO fxfwDictDTO = new FxfwDictDTO();
-    @Resource
-    private HgxfxMapper hgxfxMapper;
-    @Resource
-    HgxfxHgscxMapper hgxfxHgscxMapper;
-    @Resource
-    HgxfxScxMapper hgxfxScxMapper;
-    @Resource
-    private FxrwrzMapper fxrwrzMapper;
-    @Resource
-    private FzssChscMapper fzssChscMapper;
-    @Resource
-    private FzssChscFileMapper fzssChscFileMapper;
-    @Resource
-    private HgxfxTemplateMapper hgxfxTemplateMapper;
-    //合规性分析python方法名标识
-    @Value("${Hgxfx.functionId}")
-    private String functionId;
-    @Value("${Hgxfx.temp}")
-    private String temp;
-    private static final Logger log = LoggerFactory.getLogger(ChscSchedule.class);
-
-    @Async("taskExecutor")
-    //@Scheduled(fixedDelay = TIME_INTERVAL)
-    public void ChscStatus() {
-        try {
-            QueryWrapper<FzxzChscDTO> wrapper = new QueryWrapper<FzxzChscDTO>();
-            wrapper.eq("rwzt", Rwzt.getNoJX());
-            //以创建时间正序排列
-            wrapper.orderByAsc("cjsj");
-            //每次只操作一条记录
-            List<FzxzChscDTO> ress = fzssChscMapper.selectList(wrapper);
-            if (ress.size() > 0) {
-                FzxzChscDTO zhxzChsc = ress.get(0);
-                //更新策划生成任务状态
-                QueryWrapper<FzxzChscDTO> chscwrapper = new QueryWrapper<FzxzChscDTO>();
-                chscwrapper.eq("bsm", zhxzChsc.getBsm());
-                zhxzChsc.setRwjd(1);
-                zhxzChsc.setRwzt(Rwzt.getCreate());
-                fzssChscMapper.update(zhxzChsc, chscwrapper);
-                //获取分析范围
-                String curfxfw = "";
-                if (zhxzChsc.getFwlx() == fxfwDictDTO.getShp()) {
-                    FzssChscFileDTO fileDto = fzssChscFileMapper.selectOne(new QueryWrapper<FzssChscFileDTO>().eq("bsm", zhxzChsc.getXzfw()));
-                    curfxfw = fileDto.getWj();
-                }
-                //插入任务日志
-                FxrwrzDTO rzDto = new FxrwrzDTO();
-                rzDto.setRwbsm(zhxzChsc.getBsm());
-                rzDto.setRwlx("策划生成");
-                rzDto.setRzlr("项目策划生成解析");
-                rzDto.setRzlx("info");
-                rzDto.setRzsj(new Date());
-                fxrwrzMapper.insert(rzDto);
-                //根据选址类别区分进行任务分配执行
-                String rwlx = "辅助选址";
-                if (zhxzChsc.getXzlb() == xzlbDTO.getXmxz()) {//项目选址
-                    //TODO 后续对接智慧选址
-                    System.out.println("XZLB暂不支持" + zhxzChsc.getXzlb());
-                    return;
-                } else if (zhxzChsc.getXzlb() == xzlbDTO.getHgxfx()) {
-                    rwlx = "合规性分析";
-                    //插入合规性分析主表
-                    HgxfxDTO fzssHgxfx = DozerUtils.map(zhxzChsc, HgxfxDTO.class);
-                    fzssHgxfx.setCjyh(SecurityUtils.getUsername());
-                    fzssHgxfx.setFxmj(zhxzChsc.getNydmj());
-                    fzssHgxfx.setJsdw(zhxzChsc.getSbdw());
-                    fzssHgxfx.setRwly("OpenAPI");
-                    fzssHgxfx.setBsm(zhxzChsc.getBsm());
-                    fzssHgxfx.setRwzt(Rwzt.getCreate());
-                    //TODO 确认下是否需要任务进度字段
-                    //fzssHgxfx.setRwjd(0);
-                    hgxfxMapper.insert(fzssHgxfx);
-                    //插入合规性分析分析因子表
-                    //默认把基础分析写入到分析因子里面
-                    QueryWrapper<HgxfxScxDTO> basefxyzwrapper = new QueryWrapper<HgxfxScxDTO>();
-                    basefxyzwrapper.eq("kzxjb", 0);
-                    List<HgxfxScxDTO> basefxyz = hgxfxScxMapper.selectList(basefxyzwrapper);
-                    //查询看是否已配置分析因子模板,如果没有全部查询插入分析因子表
-                    HgxfxTemplateDTO template = hgxfxTemplateMapper.selectOne(new QueryWrapper<HgxfxTemplateDTO>().eq("mbmc", zhxzChsc.getYwlx()));
-                    if (template != null) {
-                        QueryWrapper<HgxfxScxDTO> fxyzwrapper = new QueryWrapper<HgxfxScxDTO>();
-                        fxyzwrapper.in("bsm", template.getFxyz().split(",")).orderByAsc("xssx");
-                        List<HgxfxScxDTO> res = hgxfxScxMapper.selectList(fxyzwrapper);
-                        if (res.size() > 0) {
-                            basefxyz.addAll(res);
-                        }
-                    } else {
-                        //查询审查项 默认把控制线级别等于0的也添加进去
-//                        QueryWrapper<HgxfxScxDTO> fxyzwrapper = new QueryWrapper<HgxfxScxDTO>();
-//                        fxyzwrapper.gt("kzxjb", 0).eq("status",1);
-//                        List<HgxfxScxDTO> res = hgxfxScxMapper.selectList(fxyzwrapper);
-//                        if (res.size() > 0) {
-//                            basefxyz.addAll(res);
-//                        }
-                    }
-                    for (HgxfxScxDTO cur : basefxyz) {
-                        HgxfxHgscxDTO scx = new HgxfxHgscxDTO();
-                        scx.setBsm(StringUtils.getUUID());
-                        scx.setRwbsm(zhxzChsc.getBsm());
-                        scx.setScxbsm(cur.getBsm());
-                        scx.setYsmc(cur.getYsmc());
-                        hgxfxHgscxMapper.insert(scx);
-                    }
-                    //TODO 入储备库
-//                    FzssZhxzCbk cbk = zhxzChsc.MapTo<FzssZhxzCbk>();
-//                    cbk.BSM = zhxzChsc.BSM;
-//                    var listFields = EsriClassField.ToFields<FzssZhxzCbk>(cbk);
-//                    PyUtils.Shp2Sde(shpfile, "KJGH.T_FZSS_ZHXZ_CBK", listFields);
-                }
-                FzxzDTO fzxzDTO = new FzxzDTO();
-                fzxzDTO.setBsm(zhxzChsc.getBsm());
-                // fzxzDTO.setFwlx(zhxzChsc.getFwlx());
-                // fzxzDTO.setXzfw(curfxfw);
-                RequestResult info = fzxzvector2Sde(fzxzDTO, rwlx);
-                if (info != null) {
-                    System.out.println("策划生成分析范围数据入库失败");
-                } else {
-                    System.out.println("策划生成分析模块:" + zhxzChsc.getBsm() + "完成!!!!!!!! " + new Date().toString());
-                }
-                //进度更新
-                zhxzChsc.setRwzt(Rwzt.getCreate());
-                zhxzChsc.setRwjd(3);
-                fzssChscMapper.update(zhxzChsc, chscwrapper);
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
+//     //间隔时间 单位ms
+//     public static final long TIME_INTERVAL = 1 * 15000;
+//     //任务状态标识码
+//     private RwztDTO Rwzt = new RwztDTO();
+//     private XzlbDTO xzlbDTO = new XzlbDTO();
+//     private FxfwDictDTO fxfwDictDTO = new FxfwDictDTO();
+//     @Resource
+//     private HgxfxMapper hgxfxMapper;
+//     @Resource
+//     HgxfxHgscxMapper hgxfxHgscxMapper;
+//     @Resource
+//     HgxfxScxMapper hgxfxScxMapper;
+//     @Resource
+//     private FxrwrzMapper fxrwrzMapper;
+//     @Resource
+//     private FzssChscMapper fzssChscMapper;
+//     @Resource
+//     private FzssChscFileMapper fzssChscFileMapper;
+//     @Resource
+//     private HgxfxTemplateMapper hgxfxTemplateMapper;
+//     //合规性分析python方法名标识
+//     @Value("${Hgxfx.functionId}")
+//     private String functionId;
+//     @Value("${Hgxfx.temp}")
+//     private String temp;
+//     private static final Logger log = LoggerFactory.getLogger(ChscSchedule.class);
+//
+//     @Async("taskExecutor")
+//     //@Scheduled(fixedDelay = TIME_INTERVAL)
+//     public void ChscStatus() {
+//         try {
+//             QueryWrapper<FzxzChscDTO> wrapper = new QueryWrapper<FzxzChscDTO>();
+//             wrapper.eq("rwzt", Rwzt.getNoJX());
+//             //以创建时间正序排列
+//             wrapper.orderByAsc("cjsj");
+//             //每次只操作一条记录
+//             List<FzxzChscDTO> ress = fzssChscMapper.selectList(wrapper);
+//             if (ress.size() > 0) {
+//                 FzxzChscDTO zhxzChsc = ress.get(0);
+//                 //更新策划生成任务状态
+//                 QueryWrapper<FzxzChscDTO> chscwrapper = new QueryWrapper<FzxzChscDTO>();
+//                 chscwrapper.eq("bsm", zhxzChsc.getBsm());
+//                 zhxzChsc.setRwjd(1);
+//                 zhxzChsc.setRwzt(Rwzt.getCreate());
+//                 fzssChscMapper.update(zhxzChsc, chscwrapper);
+//                 //获取分析范围
+//                 String curfxfw = "";
+//                 if (zhxzChsc.getFwlx() == fxfwDictDTO.getShp()) {
+//                     FzssChscFileDTO fileDto = fzssChscFileMapper.selectOne(new QueryWrapper<FzssChscFileDTO>().eq("bsm", zhxzChsc.getXzfw()));
+//                     curfxfw = fileDto.getWj();
+//                 }
+//                 //插入任务日志
+//                 FxrwrzDTO rzDto = new FxrwrzDTO();
+//                 rzDto.setRwbsm(zhxzChsc.getBsm());
+//                 rzDto.setRwlx("策划生成");
+//                 rzDto.setRzlr("项目策划生成解析");
+//                 rzDto.setRzlx("info");
+//                 rzDto.setRzsj(new Date());
+//                 fxrwrzMapper.insert(rzDto);
+//                 //根据选址类别区分进行任务分配执行
+//                 String rwlx = "辅助选址";
+//                 if (zhxzChsc.getXzlb() == xzlbDTO.getXmxz()) {//项目选址
+//                     //TODO 后续对接智慧选址
+//                     System.out.println("XZLB暂不支持" + zhxzChsc.getXzlb());
+//                     return;
+//                 } else if (zhxzChsc.getXzlb() == xzlbDTO.getHgxfx()) {
+//                     rwlx = "合规性分析";
+//                     //插入合规性分析主表
+//                     HgxfxDTO fzssHgxfx = DozerUtils.map(zhxzChsc, HgxfxDTO.class);
+//                     fzssHgxfx.setCjyh(SecurityUtils.getUsername());
+//                     fzssHgxfx.setFxmj(zhxzChsc.getNydmj());
+//                     fzssHgxfx.setJsdw(zhxzChsc.getSbdw());
+//                     fzssHgxfx.setRwly("OpenAPI");
+//                     fzssHgxfx.setBsm(zhxzChsc.getBsm());
+//                     fzssHgxfx.setRwzt(Rwzt.getCreate());
+//                     //TODO 确认下是否需要任务进度字段
+//                     //fzssHgxfx.setRwjd(0);
+//                     hgxfxMapper.insert(fzssHgxfx);
+//                     //插入合规性分析分析因子表
+//                     //默认把基础分析写入到分析因子里面
+//                     QueryWrapper<HgxfxScxDTO> basefxyzwrapper = new QueryWrapper<HgxfxScxDTO>();
+//                     basefxyzwrapper.eq("kzxjb", 0);
+//                     List<HgxfxScxDTO> basefxyz = hgxfxScxMapper.selectList(basefxyzwrapper);
+//                     //查询看是否已配置分析因子模板,如果没有全部查询插入分析因子表
+//                     HgxfxTemplateDTO template = hgxfxTemplateMapper.selectOne(new QueryWrapper<HgxfxTemplateDTO>().eq("mbmc", zhxzChsc.getYwlx()));
+//                     if (template != null) {
+//                         QueryWrapper<HgxfxScxDTO> fxyzwrapper = new QueryWrapper<HgxfxScxDTO>();
+//                         fxyzwrapper.in("bsm", template.getFxyz().split(",")).orderByAsc("xssx");
+//                         List<HgxfxScxDTO> res = hgxfxScxMapper.selectList(fxyzwrapper);
+//                         if (res.size() > 0) {
+//                             basefxyz.addAll(res);
+//                         }
+//                     } else {
+//                         //查询审查项 默认把控制线级别等于0的也添加进去
+// //                        QueryWrapper<HgxfxScxDTO> fxyzwrapper = new QueryWrapper<HgxfxScxDTO>();
+// //                        fxyzwrapper.gt("kzxjb", 0).eq("status",1);
+// //                        List<HgxfxScxDTO> res = hgxfxScxMapper.selectList(fxyzwrapper);
+// //                        if (res.size() > 0) {
+// //                            basefxyz.addAll(res);
+// //                        }
+//                     }
+//                     for (HgxfxScxDTO cur : basefxyz) {
+//                         HgxfxHgscxDTO scx = new HgxfxHgscxDTO();
+//                         scx.setBsm(StringUtils.getUUID());
+//                         scx.setRwbsm(zhxzChsc.getBsm());
+//                         scx.setScxbsm(cur.getBsm());
+//                         scx.setYsmc(cur.getYsmc());
+//                         hgxfxHgscxMapper.insert(scx);
+//                     }
+//                     //TODO 入储备库
+// //                    FzssZhxzCbk cbk = zhxzChsc.MapTo<FzssZhxzCbk>();
+// //                    cbk.BSM = zhxzChsc.BSM;
+// //                    var listFields = EsriClassField.ToFields<FzssZhxzCbk>(cbk);
+// //                    PyUtils.Shp2Sde(shpfile, "KJGH.T_FZSS_ZHXZ_CBK", listFields);
+//                 }
+//                 FzxzDTO fzxzDTO = new FzxzDTO();
+//                 fzxzDTO.setBsm(zhxzChsc.getBsm());
+//                 // fzxzDTO.setFwlx(zhxzChsc.getFwlx());
+//                 // fzxzDTO.setXzfw(curfxfw);
+//                 RequestResult info = fzxzvector2Sde(fzxzDTO, rwlx);
+//                 if (info != null) {
+//                     System.out.println("策划生成分析范围数据入库失败");
+//                 } else {
+//                     System.out.println("策划生成分析模块:" + zhxzChsc.getBsm() + "完成!!!!!!!! " + new Date().toString());
+//                 }
+//                 //进度更新
+//                 zhxzChsc.setRwzt(Rwzt.getCreate());
+//                 zhxzChsc.setRwjd(3);
+//                 fzssChscMapper.update(zhxzChsc, chscwrapper);
+//             }
+//         } catch (Exception e) {
+//             e.printStackTrace();
+//         }
+//     }
 }

+ 79 - 79
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/task/CtfxSchedule.java

@@ -20,84 +20,84 @@ import java.util.*;
 /**
  * 冲突分析模块定时刷新任务
  */
-@Component
+// @Component
 public class CtfxSchedule {
-    //间隔时间 单位ms
-    public static final long TIME_INTERVAL = 1 * 15000;
-    //任务状态标识码
-    private RwztDTO Rwzt = new RwztDTO();
-    @Resource
-    private CtfxMapper ctfxMapper;
-    //冲突分析python方法名标识
-    @Value("${Fxpj.Ctfx.functionId}")
-    private String functionId;
-    //冲突分析python方法名标识
-    @Value("${Fxpj.Xmydsyx.functionId}")
-    private String xmydsyxFunctionId;
-    private static final Logger log = LoggerFactory.getLogger(CtfxSchedule.class);
-
-    @Async("taskExecutor")
-    //@Scheduled(fixedDelay = TIME_INTERVAL)
-    public void CtfxStatus() {
-        try {
-            QueryWrapper<TCtfxMainDTO> wrapper = new QueryWrapper<>();
-            wrapper.eq("rwzt", Rwzt.getCreate());
-            //以创建时间正序排列
-            wrapper.orderByAsc("cjsj");
-            //每次只操作一条记录
-            List<TCtfxMainDTO> ress = ctfxMapper.selectList(wrapper);
-            if (ress.size() > 0) {
-                TCtfxMainDTO ctfxMainDTO = ress.get(0);
-                String id = ctfxMainDTO.getId();
-                ctfxMainDTO.setRwzt("1");
-                ctfxMainDTO.setRwkssj(new Date());
-                QueryWrapper<TCtfxMainDTO> update = new QueryWrapper<>();
-                update.eq("id", id);
-                ctfxMapper.update(ctfxMainDTO, update);
-                FixedThreadUtil.FIXED_THREAD_POOL.execute(() -> {
-                    String result = "";
-                    if ("5".equals(ctfxMainDTO.getSsmk())) {//土地开发利用强度分析
-                        try {
-                            String xzqdm = ctfxMainDTO.getXzqdm();
-                            List<TCtfxTdkfqdDTO> data = ctfxMapper.Tdkfqd("SDE." + ctfxMainDTO.getFxtable(), xzqdm, xzqdm.length(), StringUtils.subxzqdmlevel(xzqdm));
-                            List<TCtfxTdkfqdDTO> results = new ArrayList<>();
-                            String msg = "";
-                            for (TCtfxTdkfqdDTO u : data) {
-                                String curxzqdm = u.getXzqdm();
-                                if (curxzqdm.equals(xzqdm)) {
-                                    msg = u.getXzqmc() + "建设用地约有" + u.getTbmj() + "平方千米,土地开发利用强度为" + u.getProportion() + "%," + (u.getProportion() > 30 ? "已达到" : "尚未达到") + "警戒线。";
-                                } else {
-                                    results.add(u);
-                                }
-                            }
-                            ctfxMainDTO.setFxjg(msg);
-                            ctfxMainDTO.setStatist(JSON.toJSONString(results));
-                            ctfxMainDTO.setRwzt("2");
-                            ctfxMainDTO.setRwjssj(new Date());
-                            ctfxMapper.update(ctfxMainDTO, update);
-                        } catch (Exception e) {
-                            e.printStackTrace();
-                            ctfxMainDTO.setFxjg(e.getMessage());
-                            ctfxMainDTO.setRwzt("3");
-                            ctfxMainDTO.setRwjssj(new Date());
-                            ctfxMapper.update(ctfxMainDTO, update);
-                        }
-                    } else if ("6".equals(ctfxMainDTO.getSsmk())) {//项目用地适宜性分析
-                        //执行python
-                        Map<String, String> params = new HashMap<>();
-                        params.put("bsm", id);
-                        result = PythonExecute.Run(xmydsyxFunctionId, params);
-                    } else {
-                        //执行python
-                        Map<String, String> params = new HashMap<>();
-                        params.put("bsm", id);
-                        result = PythonExecute.Run(functionId, params);
-                    }
-                    System.out.println("冲突分析:BSM:" + ctfxMainDTO.getId() + ",结果:" + result);
-                });
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
+    // //间隔时间 单位ms
+    // public static final long TIME_INTERVAL = 1 * 15000;
+    // //任务状态标识码
+    // private RwztDTO Rwzt = new RwztDTO();
+    // @Resource
+    // private CtfxMapper ctfxMapper;
+    // //冲突分析python方法名标识
+    // @Value("${Fxpj.Ctfx.functionId}")
+    // private String functionId;
+    // //冲突分析python方法名标识
+    // @Value("${Fxpj.Xmydsyx.functionId}")
+    // private String xmydsyxFunctionId;
+    // private static final Logger log = LoggerFactory.getLogger(CtfxSchedule.class);
+    //
+    // @Async("taskExecutor")
+    // //@Scheduled(fixedDelay = TIME_INTERVAL)
+    // public void CtfxStatus() {
+    //     try {
+    //         QueryWrapper<TCtfxMainDTO> wrapper = new QueryWrapper<>();
+    //         wrapper.eq("rwzt", Rwzt.getCreate());
+    //         //以创建时间正序排列
+    //         wrapper.orderByAsc("cjsj");
+    //         //每次只操作一条记录
+    //         List<TCtfxMainDTO> ress = ctfxMapper.selectList(wrapper);
+    //         if (ress.size() > 0) {
+    //             TCtfxMainDTO ctfxMainDTO = ress.get(0);
+    //             String id = ctfxMainDTO.getId();
+    //             ctfxMainDTO.setRwzt("1");
+    //             ctfxMainDTO.setRwkssj(new Date());
+    //             QueryWrapper<TCtfxMainDTO> update = new QueryWrapper<>();
+    //             update.eq("id", id);
+    //             ctfxMapper.update(ctfxMainDTO, update);
+    //             FixedThreadUtil.FIXED_THREAD_POOL.execute(() -> {
+    //                 String result = "";
+    //                 if ("5".equals(ctfxMainDTO.getSsmk())) {//土地开发利用强度分析
+    //                     try {
+    //                         String xzqdm = ctfxMainDTO.getXzqdm();
+    //                         List<TCtfxTdkfqdDTO> data = ctfxMapper.Tdkfqd("SDE." + ctfxMainDTO.getFxtable(), xzqdm, xzqdm.length(), StringUtils.subxzqdmlevel(xzqdm));
+    //                         List<TCtfxTdkfqdDTO> results = new ArrayList<>();
+    //                         String msg = "";
+    //                         for (TCtfxTdkfqdDTO u : data) {
+    //                             String curxzqdm = u.getXzqdm();
+    //                             if (curxzqdm.equals(xzqdm)) {
+    //                                 msg = u.getXzqmc() + "建设用地约有" + u.getTbmj() + "平方千米,土地开发利用强度为" + u.getProportion() + "%," + (u.getProportion() > 30 ? "已达到" : "尚未达到") + "警戒线。";
+    //                             } else {
+    //                                 results.add(u);
+    //                             }
+    //                         }
+    //                         ctfxMainDTO.setFxjg(msg);
+    //                         ctfxMainDTO.setStatist(JSON.toJSONString(results));
+    //                         ctfxMainDTO.setRwzt("2");
+    //                         ctfxMainDTO.setRwjssj(new Date());
+    //                         ctfxMapper.update(ctfxMainDTO, update);
+    //                     } catch (Exception e) {
+    //                         e.printStackTrace();
+    //                         ctfxMainDTO.setFxjg(e.getMessage());
+    //                         ctfxMainDTO.setRwzt("3");
+    //                         ctfxMainDTO.setRwjssj(new Date());
+    //                         ctfxMapper.update(ctfxMainDTO, update);
+    //                     }
+    //                 } else if ("6".equals(ctfxMainDTO.getSsmk())) {//项目用地适宜性分析
+    //                     //执行python
+    //                     Map<String, String> params = new HashMap<>();
+    //                     params.put("bsm", id);
+    //                     result = PythonExecute.Run(xmydsyxFunctionId, params);
+    //                 } else {
+    //                     //执行python
+    //                     Map<String, String> params = new HashMap<>();
+    //                     params.put("bsm", id);
+    //                     result = PythonExecute.Run(functionId, params);
+    //                 }
+    //                 System.out.println("冲突分析:BSM:" + ctfxMainDTO.getId() + ",结果:" + result);
+    //             });
+    //         }
+    //     } catch (Exception e) {
+    //         e.printStackTrace();
+    //     }
+    // }
 }

+ 460 - 460
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/task/HgxfxSchedule.java

@@ -28,465 +28,465 @@ import java.util.*;
 /**
  * 合规性分析模块定时刷新任务
  */
-@Component
+// @Component
 public class HgxfxSchedule {
-    //间隔时间 单位ms
-    public static final long TIME_INTERVAL = 1 * 15000;
-    //任务状态标识码
-    private RwztDTO Rwzt = new RwztDTO();
-    @Resource
-    private HgxfxMapper hgxfxMapper;
-    @Resource
-    HgxfxHgscxMapper hgxfxHgscxMapper;
-    @Resource
-    HgxfxScxMapper hgxfxScxMapper;
-    @Resource
-    private FxrwrzMapper fxrwrzMapper;
-    @Resource
-    private FzssChscMapper fzssChscMapper;
-    //合规性分析python方法名标识
-    @Value("${Hgxfx.functionId}")
-    private String functionId;
-    @Value("${Hgxfx.temp}")
-    private String temp;
-    @Value("${Hgxfx.ftpOut}")
-    private String ftpOut;
-    private static final Logger log = LoggerFactory.getLogger(HgxfxSchedule.class);
-    /**
-     * Scheduled 定时器参数
-     * cron表达式:指定任务在特定时间执行
-     * fixedDelay:表示上一次任务执行完成后多久再执行,参数类型long,单位:ms
-     * fixedDelayString:与fixedDelay一样,只是参数类型是String
-     * fixedRate:表示按一定的频率执行任务,参数类型long,单位:ms 如: fixedRate(5000),表示这个定时器任务每5秒执行一次
-     * fixedRateString:与fixedRate一样,只是参数类型变为String
-     * initialDelay:表示延迟多久再第一次执行任务,参数类型为long ,单位:ms
-     * initialDelayString:与initialDelay一样,只是参数类型String
-     */
-    /**
-     * @Async("name") 开启多线程
-     */
-    /**
-     * 合规性分析执行入口
-     */
-    @Async("taskExecutor")
-    //@Scheduled(fixedDelay = TIME_INTERVAL)
-    public void HgxfxStatus() {
-        try {
-            QueryWrapper<HgxfxDTO> wrapper = new QueryWrapper<HgxfxDTO>();
-            wrapper.eq("rwzt", Rwzt.getCreate());
-            //以创建时间正序排列
-            wrapper.orderByAsc("cjsj");
-            //每次只操作一条记录
-            List<HgxfxDTO> ress = hgxfxMapper.selectList(wrapper);
-            if (ress.size() > 0) {
-                HgxfxDTO res = ress.get(0);
-                //插入执行状态
-                res.setRwzt(Rwzt.getRun());
-                res.setRwkssj(new Date());
-                QueryWrapper<HgxfxDTO> query = new QueryWrapper<HgxfxDTO>();
-                query.eq("bsm", res.getBsm());
-                hgxfxMapper.update(res, query);
-                //插入任务日志
-                FxrwrzDTO rzDto = new FxrwrzDTO();
-                rzDto.setRwbsm(res.getBsm());
-                rzDto.setRwlx("合规性检查");
-                rzDto.setRzlr("开始分析");
-                rzDto.setRzlx("info");
-                rzDto.setRzsj(new Date());
-                fxrwrzMapper.insert(rzDto);
-                //执行python
-                Map<String, String> params = new HashMap<>();
-                params.put("bsm", res.getBsm());
-                String result = PythonExecute.Run(functionId, params);
-                if (!StringUtils.isEmpty(result) && result.contains("OK")) {//成功
-                    res.setRwjssj(new Date());
-                    res.setRwzt(Rwzt.getComplete());
-                    //捕获报告生成异常
-                    try {
-                        //TODO 生成合规性分析结果报告 返回 FxReport实体
-                        FxReport report = createReport(res.getBsm());
-                        res.setFxbg(report.getReportfile());
-                        hgxfxMapper.update(res, query);
-                        //TODO 策划生成 项目
-                        if ("OpenAPI".equals(res.getRwly())) {
-                            QueryWrapper<FzxzChscDTO> chscwrapper = new QueryWrapper<FzxzChscDTO>();
-                            chscwrapper.eq("bsm", res.getBsm());
-                            FzxzChscDTO chscDto = fzssChscMapper.selectOne(chscwrapper);
-                            chscDto.setRwzt(Rwzt.getComplete());
-                            chscDto.setRwjg("分析完成");
-                            chscDto.setRwjd(100);
-                            fzssChscMapper.update(chscDto, chscwrapper);
-                            //拷贝合规性分析报告
-                            com.onemap.common.core.utils.file.FileUtils.copyNewFileAndRename(ftpOut, report.getPdffile(), chscDto.getXmmc() + ".pdf");
-                        }
-                        //插入任务日志
-                        FxrwrzDTO rzDto2 = new FxrwrzDTO();
-                        rzDto2.setRwbsm(res.getBsm());
-                        rzDto2.setRwlx("合规性检查");
-                        rzDto2.setRzlr("生成分析报告完成");
-                        rzDto2.setRzlx("info");
-                        rzDto2.setRzsj(new Date());
-                        fxrwrzMapper.insert(rzDto2);
-                        //休眠1S,避免日志插入时间相同
-                        Thread.sleep(1000 * 1);
-                        //插入成功日志
-                        FxrwrzDTO successDto = new FxrwrzDTO();
-                        successDto.setRwbsm(res.getBsm());
-                        successDto.setRwlx("合规性检查");
-                        successDto.setRzlr("分析完成");
-                        successDto.setRzlx("info");
-                        successDto.setRzsj(new Date());
-                        fxrwrzMapper.insert(successDto);
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                        res.setRwzt(Rwzt.getError());
-                        hgxfxMapper.update(res, query);
-                        if ("OpenAPI".equals(res.getRwly())) {
-                            QueryWrapper<FzxzChscDTO> chscwrapper = new QueryWrapper<FzxzChscDTO>();
-                            chscwrapper.eq("bsm", res.getBsm());
-                            FzxzChscDTO chscDto = fzssChscMapper.selectOne(chscwrapper);
-                            chscDto.setRwzt(Rwzt.getError());
-                            chscDto.setRwjg("报告生成异常");
-                            fzssChscMapper.update(chscDto, chscwrapper);
-                        }
-                        //插入任务日志
-                        FxrwrzDTO errorDto = new FxrwrzDTO();
-                        errorDto.setRwbsm(res.getBsm());
-                        errorDto.setRwlx("合规性检查");
-                        errorDto.setRzlr("报告生成异常");
-                        errorDto.setRzlx("error");
-                        errorDto.setRzsj(new Date());
-                        fxrwrzMapper.insert(errorDto);
-                    }
-                } else {//失败
-                    res.setRwjssj(new Date());
-                    res.setRwzt(Rwzt.getError());
-                    hgxfxMapper.update(res, query);
-                    if ("OpenAPI".equals(res.getRwly())) {
-                        QueryWrapper<FzxzChscDTO> chscwrapper = new QueryWrapper<FzxzChscDTO>();
-                        chscwrapper.eq("bsm", res.getBsm());
-                        FzxzChscDTO chscDto = fzssChscMapper.selectOne(chscwrapper);
-                        chscDto.setRwzt(Rwzt.getError());
-                        chscDto.setRwjg("分析错误");
-                        fzssChscMapper.update(chscDto, chscwrapper);
-                    }
-                    //插入任务日志
-                    FxrwrzDTO errorDto = new FxrwrzDTO();
-                    errorDto.setRwbsm(res.getBsm());
-                    errorDto.setRwlx("合规性检查");
-                    errorDto.setRzlr("分析范围内无基础数据");
-                    errorDto.setRzlx("error");
-                    errorDto.setFxjg(result);
-                    errorDto.setRzsj(new Date());
-                    fxrwrzMapper.insert(errorDto);
-                }
-                System.out.println("合规性分析模块:" + res.getBsm() + "完成!!!!!!!! " + new Date().toString());
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * 根据任务标识码生成报告
-     *
-     * @return
-     */
-    public FxReport createReport(String bsm) {
-        //插入任务日志
-//        FxrwrzDTO rzDto = new FxrwrzDTO();
-//        rzDto.setRwbsm(bsm);
-//        rzDto.setRwlx("合规性检查");
-//        rzDto.setRzlr("开始生成分析报告");
-//        rzDto.setRzlx("info");
-//        rzDto.setRzsj(new Date());
-//        fxrwrzMapper.insert(rzDto);
-        FxReport fxReport = new FxReport();
-        QueryWrapper<HgxfxDTO> wrapper = new QueryWrapper<HgxfxDTO>();
-        wrapper.eq("bsm", bsm);
-        HgxfxDTO res = hgxfxMapper.selectOne(wrapper);
-        //文件硬盘真实路径
-        String timeStamp = new Date().getTime() + "";
-        String rootPath = temp + File.separator + "合规性检查报告"
-                + File.separator + res.getBsm();
-        File rootFile = new File(rootPath);
-        if (!rootFile.exists()) {
-            rootFile.mkdirs();
-        }
-        String reportPath = rootPath
-                + File.separator + res.getXmmc() + "(合规性检查报告)_" + timeStamp + ".docx";
-        //解析文件路径为web路径
-        String webFilePath = StringUtils.getFileStaticPath(reportPath);
-        double mj = 0;
-        if (res != null) {
-            XWPFDocument document = null;
-            OutputStream outputStream = null;//把doc输出到输出流
-            try {
-                //前端映射路径
-                System.out.println(reportPath);
-                //创建poi XWPFDocument doc文件
-                document = new XWPFDocument();
-                int pos = 0;
-                //文本标题
-                String title = res.getXmmc() + "合规性检查报告";
-                NpoiHelper.title(document, title, pos++);
-                NpoiHelper.Option option = new NpoiHelper.Option();
-                option.setFontSize(19);
-                option.setAlign(ParagraphAlignment.CENTER);
-                option.setBold(true);
-                List<String> list = new ArrayList<>();
-                list.add("");
-                document.setParagraph(NpoiHelper.newParagraph(document, list, option), pos++);
-                SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
-                option = new NpoiHelper.Option();
-                option.setAlign(ParagraphAlignment.CENTER);
-                document.setParagraph(NpoiHelper.newParagraph(document, sdf.format(new Date())
-                        , option), pos++);
-                NpoiHelper.catalog(document, "一、项目合规性审查", pos++);
-                XWPFTable table = document.createTable(1, 4);
-                int tableIndex = 0;
-                table.setWidth(9000);//总宽度
-                table.setCellMargins(100, 0, 200, 0);
-                for (int i = 0; i < 4; i++) {
-                    XWPFTableCell cell = table.getRow(0).getCell(i);
-                    CTTcPr ctTcPr = cell.getCTTc().isSetTcPr() ? cell.getCTTc().getTcPr() : cell.getCTTc().addNewTcPr();
-                    CTTblWidth ctTblWidth = ctTcPr.addNewTcW();
-                    ctTblWidth.setW(BigInteger.valueOf(2250));
-                    ctTblWidth.setType(STTblWidth.DXA);
-                }
-                //Table 表格第1行
-                NpoiHelper.Option optionCenterAndBold = new NpoiHelper.Option();
-                optionCenterAndBold.setBold(true);
-                optionCenterAndBold.setAlign(ParagraphAlignment.CENTER);
-                NpoiHelper.Option optionCenter = new NpoiHelper.Option();
-                optionCenter.setAlign(ParagraphAlignment.CENTER);
-                table.getRow(0).getCell(0).setParagraph(NpoiHelper.setCellText(table, "项目名称", optionCenterAndBold));
-                table.getRow(0).getCell(1).setParagraph(NpoiHelper.setCellText(table, res.getXmmc(), null));
-                table.getRow(0).getCell(2).setParagraph(NpoiHelper.setCellText(table, "项目类型", optionCenterAndBold));
-                table.getRow(0).getCell(3).setParagraph(NpoiHelper.setCellText(table, res.getXmlx(), null));
-                XWPFTableRow row = table.createRow();
-                tableIndex++;
-                row.getCell(0).setParagraph(NpoiHelper.setCellText(table, "用地面积", optionCenterAndBold));
-                row.getCell(1).setParagraph(NpoiHelper.setCellText(table, res.getFxmj() + "㎡", null));
-                row.getCell(2).setParagraph(NpoiHelper.setCellText(table, "建设单位", optionCenterAndBold));
-                row.getCell(3).setParagraph(NpoiHelper.setCellText(table, res.getJsdw(), null));
-                row = table.createRow();
-                tableIndex++;
-                row.getCell(0).setParagraph(NpoiHelper.setCellText(table, "管控要素分类", optionCenterAndBold));
-                row.getCell(1).setParagraph(NpoiHelper.setCellText(table, "检查要素", optionCenterAndBold));
-                row.getCell(2).setParagraph(NpoiHelper.setCellText(table, "涉及面积", optionCenterAndBold));
-                row.getCell(3).setParagraph(NpoiHelper.setCellText(table, "结论", optionCenterAndBold));
-                //先查询FzssHgxfxHgscx,再查询FzssHgxfxScx
-                QueryWrapper<HgxfxHgscxDTO> wrapperHgxfxHgscxDTO = new QueryWrapper<HgxfxHgscxDTO>();
-                wrapperHgxfxHgscxDTO.eq("rwbsm", res.getBsm());
-                List<HgxfxHgscxExportDTO> hgxfxHgscxDTOList = hgxfxHgscxMapper.queryScxList(res.getBsm());
-
-                //一级控制线
-                Map[] mapArray = new Map[hgxfxHgscxDTOList.size()];
-                //审查项数组排序序号
-                int index = 0;
-                for (int i = 0; i < hgxfxHgscxDTOList.size(); i++) {
-                    HgxfxHgscxExportDTO hgxfxHgscxDTO = hgxfxHgscxDTOList.get(i);
-                    if (hgxfxHgscxDTO.getKzxjb() == 1) {
-                        Map<String, Object> map = new HashMap<>();
-                        map.put("scx", hgxfxHgscxDTO);
-                        map.put("hgscx", hgxfxHgscxDTO);
-                        mapArray[index] = map;
-                        index++;
-                    }
-                }
-                int startRowIndex = tableIndex;
-                for (int i = 0; i < mapArray.length; i++) {
-                    if (mapArray[i] != null) {
-                        HgxfxHgscxExportDTO hgxfxHgscxDTO = (HgxfxHgscxExportDTO) mapArray[i].get("hgscx");
-                        if (hgxfxHgscxDTO != null) {
-                            hgxfxHgscxDTO.setZdmj(hgxfxHgscxDTO.getZdmj() == null ? 0 : hgxfxHgscxDTO.getZdmj());
-                            row = table.createRow();
-                            tableIndex++;
-                            row.getCell(0).setParagraph(NpoiHelper.setCellText(table, "一级控制线", optionCenterAndBold));
-                            row.getCell(1).setParagraph(NpoiHelper.setCellText(table, hgxfxHgscxDTO.getYsmc(), null));
-                            row.getCell(2).setParagraph(NpoiHelper.setCellText(table, Math.round(hgxfxHgscxDTO.getZdmj()) + "m²", optionCenter));
-                            row.getCell(3).setParagraph(NpoiHelper.setCellText(table, hgxfxHgscxDTO.getJcjg(), null));
-                            mj = mj + hgxfxHgscxDTO.getZdmj();
-                        }
-                    }
-                }
-                //合并列
-                NpoiHelper.mergeCellsVertically(table, 0, startRowIndex + 1, tableIndex);
-
-                //二级控制线
-                mapArray = new Map[hgxfxHgscxDTOList.size()];
-                //审查项数组排序序号
-                index = 0;
-                for (int i = 0; i < hgxfxHgscxDTOList.size(); i++) {
-                    //二级控制线
-                    HgxfxHgscxExportDTO hgxfxHgscxDTO = hgxfxHgscxDTOList.get(i);
-                    if (hgxfxHgscxDTO != null) {
-                        if (hgxfxHgscxDTO.getKzxjb() == 2) {
-                            Map<String, Object> map = new HashMap<>();
-                            map.put("scx", hgxfxHgscxDTO);
-                            map.put("hgscx", hgxfxHgscxDTO);
-                            mapArray[index] = map;
-                            index++;
-                        }
-                    }
-                }
-                startRowIndex = tableIndex;
-                for (int i = 0; i < mapArray.length; i++) {
-                    if (mapArray[i] != null) {
-                        HgxfxHgscxExportDTO hgxfxHgscxDTO = (HgxfxHgscxExportDTO) mapArray[i].get("hgscx");
-                        if (hgxfxHgscxDTO != null) {
-                            row = table.createRow();
-                            tableIndex++;
-                            row.getCell(0).setParagraph(NpoiHelper.setCellText(table, "二级控制线", optionCenterAndBold));
-                            row.getCell(1).setParagraph(NpoiHelper.setCellText(table, hgxfxHgscxDTO.getYsmc(), null));
-                            row.getCell(2).setParagraph(NpoiHelper.setCellText(table, Math.round(hgxfxHgscxDTO.getZdmj()) + "m²", optionCenter));
-                            row.getCell(3).setParagraph(NpoiHelper.setCellText(table, hgxfxHgscxDTO.getJcjg(), null));
-                            mj = mj + hgxfxHgscxDTO.getZdmj();
-                        }
-                    }
-                }
-                //设置用地面积
-                table.getRow(1).getCell(1).setParagraph(NpoiHelper.setCellText(table, res.getFxmj() + "㎡", null));
-                NpoiHelper.mergeCellsVertically(table, 0, startRowIndex + 1, tableIndex);
-                //TODO wanger 将其他审查项插入到表
-                Map<String, List<HgxfxHgscxExportDTO>> scxMap = new HashMap<>();
-                //组织数据
-                for (int i = 0; i < hgxfxHgscxDTOList.size(); i++) {
-                    HgxfxHgscxExportDTO hgxfxHgscxDTO = hgxfxHgscxDTOList.get(i);
-                    if (hgxfxHgscxDTO.getKzxjb() > 2) {
-                        String classify = hgxfxHgscxDTO.getTjzd();
-                        if (scxMap.get(classify) == null) {
-                            scxMap.put(classify, new ArrayList<>());
-                        }
-                        scxMap.get(classify).add(hgxfxHgscxDTO);
-                    }
-                }
-                //循环添加
-                Iterator<Map.Entry<String, List<HgxfxHgscxExportDTO>>> iterator = scxMap.entrySet().iterator();
-                while (iterator.hasNext()) {
-                    Map.Entry<String, List<HgxfxHgscxExportDTO>> entry = iterator.next();
-                    String key = entry.getKey();
-                    List<HgxfxHgscxExportDTO> value = entry.getValue();
-
-                    mapArray = new Map[value.size()];
-                    //审查项数组排序序号
-                    index = 0;
-                    for (int i = 0; i < value.size(); i++) {
-                        //二级控制线
-                        HgxfxHgscxExportDTO hgxfxHgscxDTO = value.get(i);
-                        Map<String, HgxfxHgscxExportDTO> map = new HashMap<>();
-                        map.put("scx", hgxfxHgscxDTO);
-                        map.put("hgscx", hgxfxHgscxDTO);
-                        mapArray[index] = map;
-                        index++;
-                    }
-                    startRowIndex = tableIndex;
-                    for (int i = 0; i < mapArray.length; i++) {
-                        if (mapArray[i] != null) {
-                            HgxfxHgscxExportDTO hgxfxHgscxDTO = (HgxfxHgscxExportDTO) mapArray[i].get("hgscx");
-                            if (hgxfxHgscxDTO != null) {
-                                row = table.createRow();
-                                tableIndex++;
-                                row.getCell(0).setParagraph(NpoiHelper.setCellText(table, key, optionCenterAndBold));
-                                row.getCell(1).setParagraph(NpoiHelper.setCellText(table, hgxfxHgscxDTO.getYsmc(), null));
-                                row.getCell(2).setParagraph(NpoiHelper.setCellText(table, Math.round(hgxfxHgscxDTO.getZdmj()) + "m²", optionCenter));
-                                row.getCell(3).setParagraph(NpoiHelper.setCellText(table, hgxfxHgscxDTO.getJcjg(), null));
-                                mj = mj + hgxfxHgscxDTO.getZdmj();
-                            }
-                        }
-                    }
-                    //设置用地面积
-                    table.getRow(1).getCell(1).setParagraph(NpoiHelper.setCellText(table, res.getFxmj() + "㎡", null));
-                    NpoiHelper.mergeCellsVertically(table, 0, startRowIndex + 1, tableIndex);
-                }
-
-
-                //第二章节
-                NpoiHelper.catalog(document, "二、项目用地明细", pos++);
-                XWPFTable tableSecond = document.createTable(1, 5);
-                tableSecond.setCellMargins(100, 0, 200, 0);
-                tableSecond.setWidth(9000);//总宽度
-                //Table 表格第0行
-                tableSecond.getRow(0).getCell(0).setParagraph(NpoiHelper.setCellText(tableSecond, "一级地类", optionCenterAndBold));
-                tableSecond.getRow(0).getCell(2).setParagraph(NpoiHelper.setCellText(tableSecond, "二级地类", optionCenterAndBold));
-                tableSecond.getRow(0).getCell(4).setParagraph(NpoiHelper.setCellText(tableSecond, "占地面积", optionCenterAndBold));
-                //合并列
-                NpoiHelper.mergeHorizontal(tableSecond, 0, 0, 1);
-                NpoiHelper.mergeHorizontal(tableSecond, 0, 2, 3);
-                //查询HgxfxFxtbDTO
-                List<HgxfxFxtbDTO> hgxfxFxtbDTOList = hgxfxMapper.getFxtb(res.getBsm());
-                NpoiHelper.Option optionFontSizeAlign = new NpoiHelper.Option();
-                optionFontSizeAlign.setAlign(ParagraphAlignment.CENTER);
-                optionFontSizeAlign.setFontSize(10);
-                NpoiHelper.Option optionFontSize = new NpoiHelper.Option();
-                optionFontSize.setFontSize(10);
-                for (int i = 0; i < hgxfxFxtbDTOList.size(); i++) {
-                    HgxfxFxtbDTO hgxfxFxtbDTO = hgxfxFxtbDTOList.get(i);
-                    XWPFTableRow row1 = tableSecond.createRow();
-                    tableIndex++;
-                    row1.getCell(0).setParagraph(NpoiHelper.setCellText(tableSecond, hgxfxFxtbDTO.getDldm1(), optionFontSizeAlign));
-                    row1.getCell(1).setParagraph(NpoiHelper.setCellText(tableSecond, hgxfxFxtbDTO.getDlmc1(), optionFontSize));
-                    row1.getCell(2).setParagraph(NpoiHelper.setCellText(tableSecond, hgxfxFxtbDTO.getDldm2(), optionFontSizeAlign));
-                    row1.getCell(3).setParagraph(NpoiHelper.setCellText(tableSecond, hgxfxFxtbDTO.getDlmc2(), optionFontSize));
-                    if (hgxfxFxtbDTO.getMj() == null) {
-                        hgxfxFxtbDTO.setMj(0.0);
-                    }
-                    row1.getCell(4).setParagraph(NpoiHelper.setCellText(tableSecond, Math.round(hgxfxFxtbDTO.getMj()) + "㎡", optionFontSizeAlign));
-                }
-                if (tableSecond.getRow(1) != null) {
-                    for (int i = 0; i < 5; i++) {
-                        XWPFTableCell cell = tableSecond.getRow(1).getCell(i);
-                        CTTcPr ctTcPr = cell.getCTTc().isSetTcPr() ? cell.getCTTc().getTcPr() : cell.getCTTc().addNewTcPr();
-                        CTTblWidth ctTblWidth = ctTcPr.addNewTcW();
-                        ctTblWidth.setW(BigInteger.valueOf(1800));
-                        ctTblWidth.setType(STTblWidth.DXA);
-                    }
-                }
-                File fileDoc = new File(reportPath);
-                if (fileDoc.exists()) {
-                    FileUtils.delete(fileDoc);
-                }
-                //word文件输出流
-                outputStream = new FileOutputStream(reportPath);
-                document.write(outputStream);
-            } catch (Exception e) {
-                log.error(e.toString());
-                //插入任务日志
-                FxrwrzDTO errorDto = new FxrwrzDTO();
-                errorDto.setRwbsm(res.getBsm());
-                errorDto.setRwlx("合规性检查");
-                errorDto.setRzlr("报告生成异常:" + e.getMessage());
-                errorDto.setRzlx("error");
-                errorDto.setRzsj(new Date());
-                fxrwrzMapper.insert(errorDto);
-//                e.printStackTrace();
-            } finally {
-                if (outputStream != null) {
-                    try {
-                        outputStream.close();
-                    } catch (Exception ex) {
-                        log.error(ex.toString());
-                    }
-                }
-                if (document != null) {
-                    try {
-                        document.close();
-                    } catch (Exception ex) {
-                        log.error(ex.toString());
-                    }
-                }
-            }
-            //转PDF
-            String outfilepath = reportPath.replace(".docx", ".pdf");
-            if (new File(reportPath).exists()) {
-                NpoiHelper.doc2pdf(reportPath, outfilepath);
-                //更新报告对象
-                fxReport.setReportfile(webFilePath);
-                fxReport.setMj(mj);
-                fxReport.setPdffile(outfilepath);
-            }
-        }
-        return fxReport;
-    }
+//     //间隔时间 单位ms
+//     public static final long TIME_INTERVAL = 1 * 15000;
+//     //任务状态标识码
+//     private RwztDTO Rwzt = new RwztDTO();
+//     @Resource
+//     private HgxfxMapper hgxfxMapper;
+//     @Resource
+//     HgxfxHgscxMapper hgxfxHgscxMapper;
+//     @Resource
+//     HgxfxScxMapper hgxfxScxMapper;
+//     @Resource
+//     private FxrwrzMapper fxrwrzMapper;
+//     @Resource
+//     private FzssChscMapper fzssChscMapper;
+//     //合规性分析python方法名标识
+//     @Value("${Hgxfx.functionId}")
+//     private String functionId;
+//     @Value("${Hgxfx.temp}")
+//     private String temp;
+//     @Value("${Hgxfx.ftpOut}")
+//     private String ftpOut;
+//     private static final Logger log = LoggerFactory.getLogger(HgxfxSchedule.class);
+//     /**
+//      * Scheduled 定时器参数
+//      * cron表达式:指定任务在特定时间执行
+//      * fixedDelay:表示上一次任务执行完成后多久再执行,参数类型long,单位:ms
+//      * fixedDelayString:与fixedDelay一样,只是参数类型是String
+//      * fixedRate:表示按一定的频率执行任务,参数类型long,单位:ms 如: fixedRate(5000),表示这个定时器任务每5秒执行一次
+//      * fixedRateString:与fixedRate一样,只是参数类型变为String
+//      * initialDelay:表示延迟多久再第一次执行任务,参数类型为long ,单位:ms
+//      * initialDelayString:与initialDelay一样,只是参数类型String
+//      */
+//     /**
+//      * @Async("name") 开启多线程
+//      */
+//     /**
+//      * 合规性分析执行入口
+//      */
+//     @Async("taskExecutor")
+//     //@Scheduled(fixedDelay = TIME_INTERVAL)
+//     public void HgxfxStatus() {
+//         try {
+//             QueryWrapper<HgxfxDTO> wrapper = new QueryWrapper<HgxfxDTO>();
+//             wrapper.eq("rwzt", Rwzt.getCreate());
+//             //以创建时间正序排列
+//             wrapper.orderByAsc("cjsj");
+//             //每次只操作一条记录
+//             List<HgxfxDTO> ress = hgxfxMapper.selectList(wrapper);
+//             if (ress.size() > 0) {
+//                 HgxfxDTO res = ress.get(0);
+//                 //插入执行状态
+//                 res.setRwzt(Rwzt.getRun());
+//                 res.setRwkssj(new Date());
+//                 QueryWrapper<HgxfxDTO> query = new QueryWrapper<HgxfxDTO>();
+//                 query.eq("bsm", res.getBsm());
+//                 hgxfxMapper.update(res, query);
+//                 //插入任务日志
+//                 FxrwrzDTO rzDto = new FxrwrzDTO();
+//                 rzDto.setRwbsm(res.getBsm());
+//                 rzDto.setRwlx("合规性检查");
+//                 rzDto.setRzlr("开始分析");
+//                 rzDto.setRzlx("info");
+//                 rzDto.setRzsj(new Date());
+//                 fxrwrzMapper.insert(rzDto);
+//                 //执行python
+//                 Map<String, String> params = new HashMap<>();
+//                 params.put("bsm", res.getBsm());
+//                 String result = PythonExecute.Run(functionId, params);
+//                 if (!StringUtils.isEmpty(result) && result.contains("OK")) {//成功
+//                     res.setRwjssj(new Date());
+//                     res.setRwzt(Rwzt.getComplete());
+//                     //捕获报告生成异常
+//                     try {
+//                         //TODO 生成合规性分析结果报告 返回 FxReport实体
+//                         FxReport report = createReport(res.getBsm());
+//                         res.setFxbg(report.getReportfile());
+//                         hgxfxMapper.update(res, query);
+//                         //TODO 策划生成 项目
+//                         if ("OpenAPI".equals(res.getRwly())) {
+//                             QueryWrapper<FzxzChscDTO> chscwrapper = new QueryWrapper<FzxzChscDTO>();
+//                             chscwrapper.eq("bsm", res.getBsm());
+//                             FzxzChscDTO chscDto = fzssChscMapper.selectOne(chscwrapper);
+//                             chscDto.setRwzt(Rwzt.getComplete());
+//                             chscDto.setRwjg("分析完成");
+//                             chscDto.setRwjd(100);
+//                             fzssChscMapper.update(chscDto, chscwrapper);
+//                             //拷贝合规性分析报告
+//                             com.onemap.common.core.utils.file.FileUtils.copyNewFileAndRename(ftpOut, report.getPdffile(), chscDto.getXmmc() + ".pdf");
+//                         }
+//                         //插入任务日志
+//                         FxrwrzDTO rzDto2 = new FxrwrzDTO();
+//                         rzDto2.setRwbsm(res.getBsm());
+//                         rzDto2.setRwlx("合规性检查");
+//                         rzDto2.setRzlr("生成分析报告完成");
+//                         rzDto2.setRzlx("info");
+//                         rzDto2.setRzsj(new Date());
+//                         fxrwrzMapper.insert(rzDto2);
+//                         //休眠1S,避免日志插入时间相同
+//                         Thread.sleep(1000 * 1);
+//                         //插入成功日志
+//                         FxrwrzDTO successDto = new FxrwrzDTO();
+//                         successDto.setRwbsm(res.getBsm());
+//                         successDto.setRwlx("合规性检查");
+//                         successDto.setRzlr("分析完成");
+//                         successDto.setRzlx("info");
+//                         successDto.setRzsj(new Date());
+//                         fxrwrzMapper.insert(successDto);
+//                     } catch (Exception e) {
+//                         e.printStackTrace();
+//                         res.setRwzt(Rwzt.getError());
+//                         hgxfxMapper.update(res, query);
+//                         if ("OpenAPI".equals(res.getRwly())) {
+//                             QueryWrapper<FzxzChscDTO> chscwrapper = new QueryWrapper<FzxzChscDTO>();
+//                             chscwrapper.eq("bsm", res.getBsm());
+//                             FzxzChscDTO chscDto = fzssChscMapper.selectOne(chscwrapper);
+//                             chscDto.setRwzt(Rwzt.getError());
+//                             chscDto.setRwjg("报告生成异常");
+//                             fzssChscMapper.update(chscDto, chscwrapper);
+//                         }
+//                         //插入任务日志
+//                         FxrwrzDTO errorDto = new FxrwrzDTO();
+//                         errorDto.setRwbsm(res.getBsm());
+//                         errorDto.setRwlx("合规性检查");
+//                         errorDto.setRzlr("报告生成异常");
+//                         errorDto.setRzlx("error");
+//                         errorDto.setRzsj(new Date());
+//                         fxrwrzMapper.insert(errorDto);
+//                     }
+//                 } else {//失败
+//                     res.setRwjssj(new Date());
+//                     res.setRwzt(Rwzt.getError());
+//                     hgxfxMapper.update(res, query);
+//                     if ("OpenAPI".equals(res.getRwly())) {
+//                         QueryWrapper<FzxzChscDTO> chscwrapper = new QueryWrapper<FzxzChscDTO>();
+//                         chscwrapper.eq("bsm", res.getBsm());
+//                         FzxzChscDTO chscDto = fzssChscMapper.selectOne(chscwrapper);
+//                         chscDto.setRwzt(Rwzt.getError());
+//                         chscDto.setRwjg("分析错误");
+//                         fzssChscMapper.update(chscDto, chscwrapper);
+//                     }
+//                     //插入任务日志
+//                     FxrwrzDTO errorDto = new FxrwrzDTO();
+//                     errorDto.setRwbsm(res.getBsm());
+//                     errorDto.setRwlx("合规性检查");
+//                     errorDto.setRzlr("分析范围内无基础数据");
+//                     errorDto.setRzlx("error");
+//                     errorDto.setFxjg(result);
+//                     errorDto.setRzsj(new Date());
+//                     fxrwrzMapper.insert(errorDto);
+//                 }
+//                 System.out.println("合规性分析模块:" + res.getBsm() + "完成!!!!!!!! " + new Date().toString());
+//             }
+//         } catch (Exception e) {
+//             e.printStackTrace();
+//         }
+//     }
+//
+//     /**
+//      * 根据任务标识码生成报告
+//      *
+//      * @return
+//      */
+//     public FxReport createReport(String bsm) {
+//         //插入任务日志
+// //        FxrwrzDTO rzDto = new FxrwrzDTO();
+// //        rzDto.setRwbsm(bsm);
+// //        rzDto.setRwlx("合规性检查");
+// //        rzDto.setRzlr("开始生成分析报告");
+// //        rzDto.setRzlx("info");
+// //        rzDto.setRzsj(new Date());
+// //        fxrwrzMapper.insert(rzDto);
+//         FxReport fxReport = new FxReport();
+//         QueryWrapper<HgxfxDTO> wrapper = new QueryWrapper<HgxfxDTO>();
+//         wrapper.eq("bsm", bsm);
+//         HgxfxDTO res = hgxfxMapper.selectOne(wrapper);
+//         //文件硬盘真实路径
+//         String timeStamp = new Date().getTime() + "";
+//         String rootPath = temp + File.separator + "合规性检查报告"
+//                 + File.separator + res.getBsm();
+//         File rootFile = new File(rootPath);
+//         if (!rootFile.exists()) {
+//             rootFile.mkdirs();
+//         }
+//         String reportPath = rootPath
+//                 + File.separator + res.getXmmc() + "(合规性检查报告)_" + timeStamp + ".docx";
+//         //解析文件路径为web路径
+//         String webFilePath = StringUtils.getFileStaticPath(reportPath);
+//         double mj = 0;
+//         if (res != null) {
+//             XWPFDocument document = null;
+//             OutputStream outputStream = null;//把doc输出到输出流
+//             try {
+//                 //前端映射路径
+//                 System.out.println(reportPath);
+//                 //创建poi XWPFDocument doc文件
+//                 document = new XWPFDocument();
+//                 int pos = 0;
+//                 //文本标题
+//                 String title = res.getXmmc() + "合规性检查报告";
+//                 NpoiHelper.title(document, title, pos++);
+//                 NpoiHelper.Option option = new NpoiHelper.Option();
+//                 option.setFontSize(19);
+//                 option.setAlign(ParagraphAlignment.CENTER);
+//                 option.setBold(true);
+//                 List<String> list = new ArrayList<>();
+//                 list.add("");
+//                 document.setParagraph(NpoiHelper.newParagraph(document, list, option), pos++);
+//                 SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
+//                 option = new NpoiHelper.Option();
+//                 option.setAlign(ParagraphAlignment.CENTER);
+//                 document.setParagraph(NpoiHelper.newParagraph(document, sdf.format(new Date())
+//                         , option), pos++);
+//                 NpoiHelper.catalog(document, "一、项目合规性审查", pos++);
+//                 XWPFTable table = document.createTable(1, 4);
+//                 int tableIndex = 0;
+//                 table.setWidth(9000);//总宽度
+//                 table.setCellMargins(100, 0, 200, 0);
+//                 for (int i = 0; i < 4; i++) {
+//                     XWPFTableCell cell = table.getRow(0).getCell(i);
+//                     CTTcPr ctTcPr = cell.getCTTc().isSetTcPr() ? cell.getCTTc().getTcPr() : cell.getCTTc().addNewTcPr();
+//                     CTTblWidth ctTblWidth = ctTcPr.addNewTcW();
+//                     ctTblWidth.setW(BigInteger.valueOf(2250));
+//                     ctTblWidth.setType(STTblWidth.DXA);
+//                 }
+//                 //Table 表格第1行
+//                 NpoiHelper.Option optionCenterAndBold = new NpoiHelper.Option();
+//                 optionCenterAndBold.setBold(true);
+//                 optionCenterAndBold.setAlign(ParagraphAlignment.CENTER);
+//                 NpoiHelper.Option optionCenter = new NpoiHelper.Option();
+//                 optionCenter.setAlign(ParagraphAlignment.CENTER);
+//                 table.getRow(0).getCell(0).setParagraph(NpoiHelper.setCellText(table, "项目名称", optionCenterAndBold));
+//                 table.getRow(0).getCell(1).setParagraph(NpoiHelper.setCellText(table, res.getXmmc(), null));
+//                 table.getRow(0).getCell(2).setParagraph(NpoiHelper.setCellText(table, "项目类型", optionCenterAndBold));
+//                 table.getRow(0).getCell(3).setParagraph(NpoiHelper.setCellText(table, res.getXmlx(), null));
+//                 XWPFTableRow row = table.createRow();
+//                 tableIndex++;
+//                 row.getCell(0).setParagraph(NpoiHelper.setCellText(table, "用地面积", optionCenterAndBold));
+//                 row.getCell(1).setParagraph(NpoiHelper.setCellText(table, res.getFxmj() + "㎡", null));
+//                 row.getCell(2).setParagraph(NpoiHelper.setCellText(table, "建设单位", optionCenterAndBold));
+//                 row.getCell(3).setParagraph(NpoiHelper.setCellText(table, res.getJsdw(), null));
+//                 row = table.createRow();
+//                 tableIndex++;
+//                 row.getCell(0).setParagraph(NpoiHelper.setCellText(table, "管控要素分类", optionCenterAndBold));
+//                 row.getCell(1).setParagraph(NpoiHelper.setCellText(table, "检查要素", optionCenterAndBold));
+//                 row.getCell(2).setParagraph(NpoiHelper.setCellText(table, "涉及面积", optionCenterAndBold));
+//                 row.getCell(3).setParagraph(NpoiHelper.setCellText(table, "结论", optionCenterAndBold));
+//                 //先查询FzssHgxfxHgscx,再查询FzssHgxfxScx
+//                 QueryWrapper<HgxfxHgscxDTO> wrapperHgxfxHgscxDTO = new QueryWrapper<HgxfxHgscxDTO>();
+//                 wrapperHgxfxHgscxDTO.eq("rwbsm", res.getBsm());
+//                 List<HgxfxHgscxExportDTO> hgxfxHgscxDTOList = hgxfxHgscxMapper.queryScxList(res.getBsm());
+//
+//                 //一级控制线
+//                 Map[] mapArray = new Map[hgxfxHgscxDTOList.size()];
+//                 //审查项数组排序序号
+//                 int index = 0;
+//                 for (int i = 0; i < hgxfxHgscxDTOList.size(); i++) {
+//                     HgxfxHgscxExportDTO hgxfxHgscxDTO = hgxfxHgscxDTOList.get(i);
+//                     if (hgxfxHgscxDTO.getKzxjb() == 1) {
+//                         Map<String, Object> map = new HashMap<>();
+//                         map.put("scx", hgxfxHgscxDTO);
+//                         map.put("hgscx", hgxfxHgscxDTO);
+//                         mapArray[index] = map;
+//                         index++;
+//                     }
+//                 }
+//                 int startRowIndex = tableIndex;
+//                 for (int i = 0; i < mapArray.length; i++) {
+//                     if (mapArray[i] != null) {
+//                         HgxfxHgscxExportDTO hgxfxHgscxDTO = (HgxfxHgscxExportDTO) mapArray[i].get("hgscx");
+//                         if (hgxfxHgscxDTO != null) {
+//                             hgxfxHgscxDTO.setZdmj(hgxfxHgscxDTO.getZdmj() == null ? 0 : hgxfxHgscxDTO.getZdmj());
+//                             row = table.createRow();
+//                             tableIndex++;
+//                             row.getCell(0).setParagraph(NpoiHelper.setCellText(table, "一级控制线", optionCenterAndBold));
+//                             row.getCell(1).setParagraph(NpoiHelper.setCellText(table, hgxfxHgscxDTO.getYsmc(), null));
+//                             row.getCell(2).setParagraph(NpoiHelper.setCellText(table, Math.round(hgxfxHgscxDTO.getZdmj()) + "m²", optionCenter));
+//                             row.getCell(3).setParagraph(NpoiHelper.setCellText(table, hgxfxHgscxDTO.getJcjg(), null));
+//                             mj = mj + hgxfxHgscxDTO.getZdmj();
+//                         }
+//                     }
+//                 }
+//                 //合并列
+//                 NpoiHelper.mergeCellsVertically(table, 0, startRowIndex + 1, tableIndex);
+//
+//                 //二级控制线
+//                 mapArray = new Map[hgxfxHgscxDTOList.size()];
+//                 //审查项数组排序序号
+//                 index = 0;
+//                 for (int i = 0; i < hgxfxHgscxDTOList.size(); i++) {
+//                     //二级控制线
+//                     HgxfxHgscxExportDTO hgxfxHgscxDTO = hgxfxHgscxDTOList.get(i);
+//                     if (hgxfxHgscxDTO != null) {
+//                         if (hgxfxHgscxDTO.getKzxjb() == 2) {
+//                             Map<String, Object> map = new HashMap<>();
+//                             map.put("scx", hgxfxHgscxDTO);
+//                             map.put("hgscx", hgxfxHgscxDTO);
+//                             mapArray[index] = map;
+//                             index++;
+//                         }
+//                     }
+//                 }
+//                 startRowIndex = tableIndex;
+//                 for (int i = 0; i < mapArray.length; i++) {
+//                     if (mapArray[i] != null) {
+//                         HgxfxHgscxExportDTO hgxfxHgscxDTO = (HgxfxHgscxExportDTO) mapArray[i].get("hgscx");
+//                         if (hgxfxHgscxDTO != null) {
+//                             row = table.createRow();
+//                             tableIndex++;
+//                             row.getCell(0).setParagraph(NpoiHelper.setCellText(table, "二级控制线", optionCenterAndBold));
+//                             row.getCell(1).setParagraph(NpoiHelper.setCellText(table, hgxfxHgscxDTO.getYsmc(), null));
+//                             row.getCell(2).setParagraph(NpoiHelper.setCellText(table, Math.round(hgxfxHgscxDTO.getZdmj()) + "m²", optionCenter));
+//                             row.getCell(3).setParagraph(NpoiHelper.setCellText(table, hgxfxHgscxDTO.getJcjg(), null));
+//                             mj = mj + hgxfxHgscxDTO.getZdmj();
+//                         }
+//                     }
+//                 }
+//                 //设置用地面积
+//                 table.getRow(1).getCell(1).setParagraph(NpoiHelper.setCellText(table, res.getFxmj() + "㎡", null));
+//                 NpoiHelper.mergeCellsVertically(table, 0, startRowIndex + 1, tableIndex);
+//                 //TODO wanger 将其他审查项插入到表
+//                 Map<String, List<HgxfxHgscxExportDTO>> scxMap = new HashMap<>();
+//                 //组织数据
+//                 for (int i = 0; i < hgxfxHgscxDTOList.size(); i++) {
+//                     HgxfxHgscxExportDTO hgxfxHgscxDTO = hgxfxHgscxDTOList.get(i);
+//                     if (hgxfxHgscxDTO.getKzxjb() > 2) {
+//                         String classify = hgxfxHgscxDTO.getTjzd();
+//                         if (scxMap.get(classify) == null) {
+//                             scxMap.put(classify, new ArrayList<>());
+//                         }
+//                         scxMap.get(classify).add(hgxfxHgscxDTO);
+//                     }
+//                 }
+//                 //循环添加
+//                 Iterator<Map.Entry<String, List<HgxfxHgscxExportDTO>>> iterator = scxMap.entrySet().iterator();
+//                 while (iterator.hasNext()) {
+//                     Map.Entry<String, List<HgxfxHgscxExportDTO>> entry = iterator.next();
+//                     String key = entry.getKey();
+//                     List<HgxfxHgscxExportDTO> value = entry.getValue();
+//
+//                     mapArray = new Map[value.size()];
+//                     //审查项数组排序序号
+//                     index = 0;
+//                     for (int i = 0; i < value.size(); i++) {
+//                         //二级控制线
+//                         HgxfxHgscxExportDTO hgxfxHgscxDTO = value.get(i);
+//                         Map<String, HgxfxHgscxExportDTO> map = new HashMap<>();
+//                         map.put("scx", hgxfxHgscxDTO);
+//                         map.put("hgscx", hgxfxHgscxDTO);
+//                         mapArray[index] = map;
+//                         index++;
+//                     }
+//                     startRowIndex = tableIndex;
+//                     for (int i = 0; i < mapArray.length; i++) {
+//                         if (mapArray[i] != null) {
+//                             HgxfxHgscxExportDTO hgxfxHgscxDTO = (HgxfxHgscxExportDTO) mapArray[i].get("hgscx");
+//                             if (hgxfxHgscxDTO != null) {
+//                                 row = table.createRow();
+//                                 tableIndex++;
+//                                 row.getCell(0).setParagraph(NpoiHelper.setCellText(table, key, optionCenterAndBold));
+//                                 row.getCell(1).setParagraph(NpoiHelper.setCellText(table, hgxfxHgscxDTO.getYsmc(), null));
+//                                 row.getCell(2).setParagraph(NpoiHelper.setCellText(table, Math.round(hgxfxHgscxDTO.getZdmj()) + "m²", optionCenter));
+//                                 row.getCell(3).setParagraph(NpoiHelper.setCellText(table, hgxfxHgscxDTO.getJcjg(), null));
+//                                 mj = mj + hgxfxHgscxDTO.getZdmj();
+//                             }
+//                         }
+//                     }
+//                     //设置用地面积
+//                     table.getRow(1).getCell(1).setParagraph(NpoiHelper.setCellText(table, res.getFxmj() + "㎡", null));
+//                     NpoiHelper.mergeCellsVertically(table, 0, startRowIndex + 1, tableIndex);
+//                 }
+//
+//
+//                 //第二章节
+//                 NpoiHelper.catalog(document, "二、项目用地明细", pos++);
+//                 XWPFTable tableSecond = document.createTable(1, 5);
+//                 tableSecond.setCellMargins(100, 0, 200, 0);
+//                 tableSecond.setWidth(9000);//总宽度
+//                 //Table 表格第0行
+//                 tableSecond.getRow(0).getCell(0).setParagraph(NpoiHelper.setCellText(tableSecond, "一级地类", optionCenterAndBold));
+//                 tableSecond.getRow(0).getCell(2).setParagraph(NpoiHelper.setCellText(tableSecond, "二级地类", optionCenterAndBold));
+//                 tableSecond.getRow(0).getCell(4).setParagraph(NpoiHelper.setCellText(tableSecond, "占地面积", optionCenterAndBold));
+//                 //合并列
+//                 NpoiHelper.mergeHorizontal(tableSecond, 0, 0, 1);
+//                 NpoiHelper.mergeHorizontal(tableSecond, 0, 2, 3);
+//                 //查询HgxfxFxtbDTO
+//                 List<HgxfxFxtbDTO> hgxfxFxtbDTOList = hgxfxMapper.getFxtb(res.getBsm());
+//                 NpoiHelper.Option optionFontSizeAlign = new NpoiHelper.Option();
+//                 optionFontSizeAlign.setAlign(ParagraphAlignment.CENTER);
+//                 optionFontSizeAlign.setFontSize(10);
+//                 NpoiHelper.Option optionFontSize = new NpoiHelper.Option();
+//                 optionFontSize.setFontSize(10);
+//                 for (int i = 0; i < hgxfxFxtbDTOList.size(); i++) {
+//                     HgxfxFxtbDTO hgxfxFxtbDTO = hgxfxFxtbDTOList.get(i);
+//                     XWPFTableRow row1 = tableSecond.createRow();
+//                     tableIndex++;
+//                     row1.getCell(0).setParagraph(NpoiHelper.setCellText(tableSecond, hgxfxFxtbDTO.getDldm1(), optionFontSizeAlign));
+//                     row1.getCell(1).setParagraph(NpoiHelper.setCellText(tableSecond, hgxfxFxtbDTO.getDlmc1(), optionFontSize));
+//                     row1.getCell(2).setParagraph(NpoiHelper.setCellText(tableSecond, hgxfxFxtbDTO.getDldm2(), optionFontSizeAlign));
+//                     row1.getCell(3).setParagraph(NpoiHelper.setCellText(tableSecond, hgxfxFxtbDTO.getDlmc2(), optionFontSize));
+//                     if (hgxfxFxtbDTO.getMj() == null) {
+//                         hgxfxFxtbDTO.setMj(0.0);
+//                     }
+//                     row1.getCell(4).setParagraph(NpoiHelper.setCellText(tableSecond, Math.round(hgxfxFxtbDTO.getMj()) + "㎡", optionFontSizeAlign));
+//                 }
+//                 if (tableSecond.getRow(1) != null) {
+//                     for (int i = 0; i < 5; i++) {
+//                         XWPFTableCell cell = tableSecond.getRow(1).getCell(i);
+//                         CTTcPr ctTcPr = cell.getCTTc().isSetTcPr() ? cell.getCTTc().getTcPr() : cell.getCTTc().addNewTcPr();
+//                         CTTblWidth ctTblWidth = ctTcPr.addNewTcW();
+//                         ctTblWidth.setW(BigInteger.valueOf(1800));
+//                         ctTblWidth.setType(STTblWidth.DXA);
+//                     }
+//                 }
+//                 File fileDoc = new File(reportPath);
+//                 if (fileDoc.exists()) {
+//                     FileUtils.delete(fileDoc);
+//                 }
+//                 //word文件输出流
+//                 outputStream = new FileOutputStream(reportPath);
+//                 document.write(outputStream);
+//             } catch (Exception e) {
+//                 log.error(e.toString());
+//                 //插入任务日志
+//                 FxrwrzDTO errorDto = new FxrwrzDTO();
+//                 errorDto.setRwbsm(res.getBsm());
+//                 errorDto.setRwlx("合规性检查");
+//                 errorDto.setRzlr("报告生成异常:" + e.getMessage());
+//                 errorDto.setRzlx("error");
+//                 errorDto.setRzsj(new Date());
+//                 fxrwrzMapper.insert(errorDto);
+// //                e.printStackTrace();
+//             } finally {
+//                 if (outputStream != null) {
+//                     try {
+//                         outputStream.close();
+//                     } catch (Exception ex) {
+//                         log.error(ex.toString());
+//                     }
+//                 }
+//                 if (document != null) {
+//                     try {
+//                         document.close();
+//                     } catch (Exception ex) {
+//                         log.error(ex.toString());
+//                     }
+//                 }
+//             }
+//             //转PDF
+//             String outfilepath = reportPath.replace(".docx", ".pdf");
+//             if (new File(reportPath).exists()) {
+//                 NpoiHelper.doc2pdf(reportPath, outfilepath);
+//                 //更新报告对象
+//                 fxReport.setReportfile(webFilePath);
+//                 fxReport.setMj(mj);
+//                 fxReport.setPdffile(outfilepath);
+//             }
+//         }
+//         return fxReport;
+//     }
 }

+ 228 - 228
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/task/PythonExecute.java

@@ -18,234 +18,234 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-@Component
+// @Component
 public class PythonExecute {
 
-    /**
-     * python.exe位置
-     */
-    private static String pythonexe;
-    /**
-     * main.py位置
-     */
-    private static String pythonfile;
-    /**
-     * gishelper.py位置
-     */
-    private static String gisfile;
-
-    @Value("${Python.exeLocation}")
-    public void setPythonexe(String pythonexe) {
-        PythonExecute.pythonexe = pythonexe;
-    }
-
-    @Value("${Python.fileLocation}")
-    public void setPythonfile(String pythonfile) {
-        PythonExecute.pythonfile = pythonfile;
-    }
-
-    @Value("${Python.gisLocation}")
-    public void setGisfile(String gisfile) {
-        PythonExecute.gisfile = gisfile;
-    }
-
-    /**
-     * 执行python方法 公共类
-     *
-     * @param functionName 方法名标识
-     * @param params       参数
-     * @return 执行结果 ####OK####<->####ERROR####
-     */
-    public static String Run(String functionName, Map params) {
-        String msg = "";//返回数据
-        //PythonInterpreter方式
-//        PythonInterpreter interpreter = new PythonInterpreter();
-//        interpreter.execfile(pythonfile);
-//        PyFunction function = interpreter.get(functionName, PyFunction.class);
-//        params.toString();
-//        try {
-//            PyObject obj = function.__call__(new PyObject((PyType) params));
-////            return obj;
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//        }
-        //Runtime方式
-        JSONObject json = new JSONObject(params);
-        String[] arguments = new String[]{pythonexe, pythonfile, functionName, Base64Utils.base64Encode(json.toJSONString())};
-        try {
-            Process process = Runtime.getRuntime().exec(arguments);
-            BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream()));
-            String line = null;
-            while ((line = in.readLine()) != null) {
-                msg = line;
-            }
-            in.close();
-            process.destroy();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return msg;
-    }
-
-    /**
-     * 执行python方法 公共类 生成辅助选址图片
-     *
-     * @param functionName 方法名标识
-     * @param params       参数
-     * @return 执行结果 ####OK####<->####ERROR####
-     */
-    public static List<String> RunFzxzMap(String functionName, Map params) {
-        List<String> res = new ArrayList<>();
-        JSONObject json = new JSONObject(params);
-        String[] arguments = new String[]{pythonexe, pythonfile, functionName, Base64Utils.base64Encode(json.toJSONString())};
-        try {
-            Process process = Runtime.getRuntime().exec(arguments);
-            BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream()));
-            String line = null;
-            while ((line = in.readLine()) != null) {
-                if(line.contains(".jpg")){
-                    res.add(line);
-                }
-            }
-            in.close();
-            process.destroy();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return res;
-    }
-
-    /**
-     * 执行gishelper python方法 公共类
-     *
-     * @param functionName 方法名标识
-     * @param params       参数
-     * @return 执行结果 ####OK####<->####ERROR####
-     */
-    public static String RunGisHelper(String functionName, Map params) {
-        String msg = "";//返回数据
-        JSONObject json = new JSONObject(params);
-        String[] arguments = new String[]{pythonexe, gisfile, functionName, Base64Utils.base64Encode(json.toJSONString())};
-        try {
-            Process process = Runtime.getRuntime().exec(arguments);
-            BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream()));
-            String line = null;
-            while ((line = in.readLine()) != null) {
-                msg = line;
-            }
-            in.close();
-            process.destroy();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return msg;
-    }
-
-    /**
-     * EsriJson转SHP文件
-     *
-     * @param json    EsriJson
-     * @param shpfile SHP文件
-     * @return
-     */
-    public static String EsriJson2shp(String json, String shpfile) {
-        Map<String, String> map = new HashMap<>();
-        map.put("json", json);
-        map.put("shpfile", shpfile);
-        return RunGisHelper("esriJson2shp", map);
-    }
-
-    /**
-     * SHP文件转GeoJson
-     *
-     * @param shpfile SHP文件
-     * @param geojson GeoJson文件
-     * @return
-     */
-    public static String Shp2GeoJson(String shpfile, String geojson) {
-        Map<String, String> map = new HashMap<>();
-        map.put("shpfile", shpfile);
-        map.put("geojson", geojson);
-        return RunGisHelper("shp2geojson", map);
-    }
-
-    /**
-     * EsriJson转SDE
-     *
-     * @param json  SHP文件
-     * @param table SDE表
-     * @return
-     */
-    public static String EsriJson2sde(String json, String table) {
-        Map<String, String> map = new HashMap<>();
-        map.put("json", json);
-        map.put("table", table);
-        return RunGisHelper("esriJson2sde", map);
-    }
-
-    /**
-     * SHP文件转SDE
-     *
-     * @param shpfile SHP文件
-     * @param table   SDE表
-     * @param list    追加字段
-     * @return
-     */
-    public static String Shp2Sde(String shpfile, String table, List<Field> list) {
-        Map<String, Object> map = new HashMap<>();
-        map.put("shpfile", shpfile);
-        map.put("table", table);
-        if (list != null && list.size() > 0) {
-            map.put("fields", list);
-        }
-        return RunGisHelper("shp2sde", map);
-    }
-
-    /**
-     * SDE转SHP
-     *
-     * @param table   SDE表
-     * @param shpfile shp文件
-     * @param where   追加字段
-     * @return
-     */
-    public static String Sde2Shp(String table, String shpfile, String where) {
-        Map<String, String> map = new HashMap<>();
-        map.put("shpfile", shpfile);
-        map.put("table", table);
-        if (!StringUtils.isEmpty(where)) {
-            map.put("where", where);
-        }
-        return RunGisHelper("sde2shp", map);
-    }
-
-    public class Field {
-        private String name;/// 名称
-        private String type = "TEXT";/// 类型
-        private Object value;/// 值
-
-        public String getName() {
-            return name;
-        }
-
-        public void setName(String name) {
-            this.name = name;
-        }
-
-        public String getType() {
-            return type;
-        }
-
-        public void setType(String type) {
-            this.type = type;
-        }
-
-        public Object getValue() {
-            return value;
-        }
-
-        public void setValue(Object value) {
-            this.value = value;
-        }
-    }
+//     /**
+//      * python.exe位置
+//      */
+//     private static String pythonexe;
+//     /**
+//      * main.py位置
+//      */
+//     private static String pythonfile;
+//     /**
+//      * gishelper.py位置
+//      */
+//     private static String gisfile;
+//
+//     @Value("${Python.exeLocation}")
+//     public void setPythonexe(String pythonexe) {
+//         PythonExecute.pythonexe = pythonexe;
+//     }
+//
+//     @Value("${Python.fileLocation}")
+//     public void setPythonfile(String pythonfile) {
+//         PythonExecute.pythonfile = pythonfile;
+//     }
+//
+//     @Value("${Python.gisLocation}")
+//     public void setGisfile(String gisfile) {
+//         PythonExecute.gisfile = gisfile;
+//     }
+//
+//     /**
+//      * 执行python方法 公共类
+//      *
+//      * @param functionName 方法名标识
+//      * @param params       参数
+//      * @return 执行结果 ####OK####<->####ERROR####
+//      */
+//     public static String Run(String functionName, Map params) {
+//         String msg = "";//返回数据
+//         //PythonInterpreter方式
+// //        PythonInterpreter interpreter = new PythonInterpreter();
+// //        interpreter.execfile(pythonfile);
+// //        PyFunction function = interpreter.get(functionName, PyFunction.class);
+// //        params.toString();
+// //        try {
+// //            PyObject obj = function.__call__(new PyObject((PyType) params));
+// ////            return obj;
+// //        } catch (Exception e) {
+// //            e.printStackTrace();
+// //        }
+//         //Runtime方式
+//         JSONObject json = new JSONObject(params);
+//         String[] arguments = new String[]{pythonexe, pythonfile, functionName, Base64Utils.base64Encode(json.toJSONString())};
+//         try {
+//             Process process = Runtime.getRuntime().exec(arguments);
+//             BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream()));
+//             String line = null;
+//             while ((line = in.readLine()) != null) {
+//                 msg = line;
+//             }
+//             in.close();
+//             process.destroy();
+//         } catch (Exception e) {
+//             e.printStackTrace();
+//         }
+//         return msg;
+//     }
+//
+//     /**
+//      * 执行python方法 公共类 生成辅助选址图片
+//      *
+//      * @param functionName 方法名标识
+//      * @param params       参数
+//      * @return 执行结果 ####OK####<->####ERROR####
+//      */
+//     public static List<String> RunFzxzMap(String functionName, Map params) {
+//         List<String> res = new ArrayList<>();
+//         JSONObject json = new JSONObject(params);
+//         String[] arguments = new String[]{pythonexe, pythonfile, functionName, Base64Utils.base64Encode(json.toJSONString())};
+//         try {
+//             Process process = Runtime.getRuntime().exec(arguments);
+//             BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream()));
+//             String line = null;
+//             while ((line = in.readLine()) != null) {
+//                 if(line.contains(".jpg")){
+//                     res.add(line);
+//                 }
+//             }
+//             in.close();
+//             process.destroy();
+//         } catch (Exception e) {
+//             e.printStackTrace();
+//         }
+//         return res;
+//     }
+//
+//     /**
+//      * 执行gishelper python方法 公共类
+//      *
+//      * @param functionName 方法名标识
+//      * @param params       参数
+//      * @return 执行结果 ####OK####<->####ERROR####
+//      */
+//     public static String RunGisHelper(String functionName, Map params) {
+//         String msg = "";//返回数据
+//         JSONObject json = new JSONObject(params);
+//         String[] arguments = new String[]{pythonexe, gisfile, functionName, Base64Utils.base64Encode(json.toJSONString())};
+//         try {
+//             Process process = Runtime.getRuntime().exec(arguments);
+//             BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream()));
+//             String line = null;
+//             while ((line = in.readLine()) != null) {
+//                 msg = line;
+//             }
+//             in.close();
+//             process.destroy();
+//         } catch (Exception e) {
+//             e.printStackTrace();
+//         }
+//         return msg;
+//     }
+//
+//     /**
+//      * EsriJson转SHP文件
+//      *
+//      * @param json    EsriJson
+//      * @param shpfile SHP文件
+//      * @return
+//      */
+//     public static String EsriJson2shp(String json, String shpfile) {
+//         Map<String, String> map = new HashMap<>();
+//         map.put("json", json);
+//         map.put("shpfile", shpfile);
+//         return RunGisHelper("esriJson2shp", map);
+//     }
+//
+//     /**
+//      * SHP文件转GeoJson
+//      *
+//      * @param shpfile SHP文件
+//      * @param geojson GeoJson文件
+//      * @return
+//      */
+//     public static String Shp2GeoJson(String shpfile, String geojson) {
+//         Map<String, String> map = new HashMap<>();
+//         map.put("shpfile", shpfile);
+//         map.put("geojson", geojson);
+//         return RunGisHelper("shp2geojson", map);
+//     }
+//
+//     /**
+//      * EsriJson转SDE
+//      *
+//      * @param json  SHP文件
+//      * @param table SDE表
+//      * @return
+//      */
+//     public static String EsriJson2sde(String json, String table) {
+//         Map<String, String> map = new HashMap<>();
+//         map.put("json", json);
+//         map.put("table", table);
+//         return RunGisHelper("esriJson2sde", map);
+//     }
+//
+//     /**
+//      * SHP文件转SDE
+//      *
+//      * @param shpfile SHP文件
+//      * @param table   SDE表
+//      * @param list    追加字段
+//      * @return
+//      */
+//     public static String Shp2Sde(String shpfile, String table, List<Field> list) {
+//         Map<String, Object> map = new HashMap<>();
+//         map.put("shpfile", shpfile);
+//         map.put("table", table);
+//         if (list != null && list.size() > 0) {
+//             map.put("fields", list);
+//         }
+//         return RunGisHelper("shp2sde", map);
+//     }
+//
+//     /**
+//      * SDE转SHP
+//      *
+//      * @param table   SDE表
+//      * @param shpfile shp文件
+//      * @param where   追加字段
+//      * @return
+//      */
+//     public static String Sde2Shp(String table, String shpfile, String where) {
+//         Map<String, String> map = new HashMap<>();
+//         map.put("shpfile", shpfile);
+//         map.put("table", table);
+//         if (!StringUtils.isEmpty(where)) {
+//             map.put("where", where);
+//         }
+//         return RunGisHelper("sde2shp", map);
+//     }
+//
+//     public class Field {
+//         private String name;/// 名称
+//         private String type = "TEXT";/// 类型
+//         private Object value;/// 值
+//
+//         public String getName() {
+//             return name;
+//         }
+//
+//         public void setName(String name) {
+//             this.name = name;
+//         }
+//
+//         public String getType() {
+//             return type;
+//         }
+//
+//         public void setType(String type) {
+//             this.type = type;
+//         }
+//
+//         public Object getValue() {
+//             return value;
+//         }
+//
+//         public void setValue(Object value) {
+//             this.value = value;
+//         }
+//     }
 }

+ 112 - 112
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/task/ZbmxMxjsSchedule.java

@@ -18,117 +18,117 @@ import java.util.*;
 /**
  * 模型计算定时刷新任务
  */
-@Component
+// @Component
 public class ZbmxMxjsSchedule {
-    //间隔时间 单位ms
-    public static final long TIME_INTERVAL = 1 * 15000;
-    //模型计算python方法名标识
-    @Value("${ZbmxMxjs.functionId}")
-    private String functionId;
-    @Resource
-    ZbmxMxjsrwMapper zbmxMxjsrwMapper;
-    @Resource
-    ZbmxMxjsrwrzMapper zbmxMxjsrwrzMapper;
-    /**
-     * Scheduled 定时器参数
-     * cron表达式:指定任务在特定时间执行
-     * fixedDelay:表示上一次任务执行完成后多久再执行,参数类型long,单位:ms
-     * fixedDelayString:与fixedDelay一样,只是参数类型是String
-     * fixedRate:表示按一定的频率执行任务,参数类型long,单位:ms 如: fixedRate(5000),表示这个定时器任务每5秒执行一次
-     * fixedRateString:与fixedRate一样,只是参数类型变为String
-     * initialDelay:表示延迟多久再第一次执行任务,参数类型为long ,单位:ms
-     * initialDelayString:与initialDelay一样,只是参数类型String
-     */
-    /**
-     * @Async("name") 开启多线程
-     */
-    /**
-     * 辅助选址执行入口
-     */
-//    @Async("taskExecutor")
-//    @Scheduled(fixedDelay = TIME_INTERVAL)
-    public void zbmxMxjsStatus() {
-        try {
-            //获取状态为0的计算任务
-            List<ZbmxMxjsDTO> zbmxMxjsDTOList = zbmxMxjsrwMapper.selectNewTask();
-            for (int i = 0; i < zbmxMxjsDTOList.size(); i++) {
-                ZbmxMxjsDTO task = zbmxMxjsDTOList.get(i);
-                if (task != null) {
-                    //查询任务实体
-                    QueryWrapper<ZbmxMxjsrwDO> zbmxMxjsrwDOQueryWrapper = new QueryWrapper<ZbmxMxjsrwDO>();
-                    zbmxMxjsrwDOQueryWrapper.eq("bsm", task.getBsm());
-                    ZbmxMxjsrwDO zbmxMxjsrwDO = zbmxMxjsrwMapper.selectOne(zbmxMxjsrwDOQueryWrapper);
-                    try {
-                        //更新任务状态和任务开始时间
-                        zbmxMxjsrwDO.setRwkssj(new Date());
-                        zbmxMxjsrwDO.setRwzt(1);
-                        if (zbmxMxjsrwDO.getJgz() == null) {
-                            zbmxMxjsrwDO.setJgz(0.0);
-                        }
-                        zbmxMxjsrwMapper.updateZbmxMxjsrwById(zbmxMxjsrwDO);
-                        ZbmxMxjsrwrzDO zbmxMxjsrwrzDO = new ZbmxMxjsrwrzDO();
-                        zbmxMxjsrwrzDO.setMxbsm(task.getMxbsm());
-                        zbmxMxjsrwrzDO.setMxmc(task.getMxmc());
-                        zbmxMxjsrwrzDO.setRwbsm(task.getBsm());
-                        zbmxMxjsrwrzDO.setRzsj(new Date());
-                        zbmxMxjsrwrzDO.setRzlx("info");
-                        zbmxMxjsrwrzDO.setRzlr("开始计算");
-                        zbmxMxjsrwrzMapper.insert(zbmxMxjsrwrzDO);
-                        Map<String, String> params = new HashMap<>();
-                        params.put("bsm", task.getBsm());
-                        params.put("MXBSM", task.getMxbsm());
-                        params.put("MXMC", task.getMxmc());
-                        params.put("mxcs", task.getMxcs());
-                        params.put("ZBBH", task.getZbbh());
-                        String result = PythonExecute.Run(functionId, params);
-                        System.out.println("执行结果:" + result);
-                        if (StringUtils.isNotEmpty(result)) {
-                            result = result.replace("\r\n", "");
-                            if (!StringUtils.isEmpty(result) && result.contains("OK")) {
-                                //成功
-
-                            } else {
-                                throw new Exception(result.replace("####ERROR####", ""));
-                            }
-                            String file = result.replace("####OK####", "");
-                            zbmxMxjsrwDO.setRwzt(2);
-                            zbmxMxjsrwDO.setRwjssj(new Date());
-                            zbmxMxjsrwDO.setJgz(0.0);
-                            zbmxMxjsrwDO.setJgsj(file);
-                            zbmxMxjsrwMapper.updateZbmxMxjsrwById(zbmxMxjsrwDO);
-                            //写入任务日志
-                            zbmxMxjsrwrzDO = new ZbmxMxjsrwrzDO();
-                            zbmxMxjsrwrzDO.setMxbsm(task.getMxbsm());
-                            zbmxMxjsrwrzDO.setMxmc(task.getMxmc());
-                            zbmxMxjsrwrzDO.setRwbsm(task.getBsm());
-                            zbmxMxjsrwrzDO.setRzsj(new Date());
-                            zbmxMxjsrwrzDO.setRzlx("info");
-                            zbmxMxjsrwrzDO.setRzlr("计算完成");
-                            zbmxMxjsrwrzMapper.insert(zbmxMxjsrwrzDO);
-                        } else {
-                            throw new Exception("Python返回值为空!");
-                        }
-                    } catch (Exception ex) {
-                        //更新计算任务
-                        zbmxMxjsrwDO.setRwzt(3);
-                        zbmxMxjsrwDO.setRwjssj(new Date());
-                        zbmxMxjsrwDO.setJgsj(ex.getMessage());
-                        zbmxMxjsrwMapper.updateZbmxMxjsrwById(zbmxMxjsrwDO);
-                        //写入计算日志
-                        ZbmxMxjsrwrzDO zbmxMxjsrwrzDO = new ZbmxMxjsrwrzDO();
-                        zbmxMxjsrwrzDO.setMxbsm(task.getMxbsm());
-                        zbmxMxjsrwrzDO.setMxmc(task.getMxmc());
-                        zbmxMxjsrwrzDO.setRwbsm(task.getBsm());
-                        zbmxMxjsrwrzDO.setRzsj(new Date());
-                        zbmxMxjsrwrzDO.setRzlx("error");
-                        zbmxMxjsrwrzDO.setRzlr("计算异常:" + ex.getMessage());
-                        zbmxMxjsrwrzMapper.insert(zbmxMxjsrwrzDO);
-                    }
-                }
-                System.out.println("指标模型计算:" + task.getBsm() + "完成!!!!!!!! " + new Date().toString());
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
+//     //间隔时间 单位ms
+//     public static final long TIME_INTERVAL = 1 * 15000;
+//     //模型计算python方法名标识
+//     @Value("${ZbmxMxjs.functionId}")
+//     private String functionId;
+//     @Resource
+//     ZbmxMxjsrwMapper zbmxMxjsrwMapper;
+//     @Resource
+//     ZbmxMxjsrwrzMapper zbmxMxjsrwrzMapper;
+//     /**
+//      * Scheduled 定时器参数
+//      * cron表达式:指定任务在特定时间执行
+//      * fixedDelay:表示上一次任务执行完成后多久再执行,参数类型long,单位:ms
+//      * fixedDelayString:与fixedDelay一样,只是参数类型是String
+//      * fixedRate:表示按一定的频率执行任务,参数类型long,单位:ms 如: fixedRate(5000),表示这个定时器任务每5秒执行一次
+//      * fixedRateString:与fixedRate一样,只是参数类型变为String
+//      * initialDelay:表示延迟多久再第一次执行任务,参数类型为long ,单位:ms
+//      * initialDelayString:与initialDelay一样,只是参数类型String
+//      */
+//     /**
+//      * @Async("name") 开启多线程
+//      */
+//     /**
+//      * 辅助选址执行入口
+//      */
+// //    @Async("taskExecutor")
+// //    @Scheduled(fixedDelay = TIME_INTERVAL)
+//     public void zbmxMxjsStatus() {
+//         try {
+//             //获取状态为0的计算任务
+//             List<ZbmxMxjsDTO> zbmxMxjsDTOList = zbmxMxjsrwMapper.selectNewTask();
+//             for (int i = 0; i < zbmxMxjsDTOList.size(); i++) {
+//                 ZbmxMxjsDTO task = zbmxMxjsDTOList.get(i);
+//                 if (task != null) {
+//                     //查询任务实体
+//                     QueryWrapper<ZbmxMxjsrwDO> zbmxMxjsrwDOQueryWrapper = new QueryWrapper<ZbmxMxjsrwDO>();
+//                     zbmxMxjsrwDOQueryWrapper.eq("bsm", task.getBsm());
+//                     ZbmxMxjsrwDO zbmxMxjsrwDO = zbmxMxjsrwMapper.selectOne(zbmxMxjsrwDOQueryWrapper);
+//                     try {
+//                         //更新任务状态和任务开始时间
+//                         zbmxMxjsrwDO.setRwkssj(new Date());
+//                         zbmxMxjsrwDO.setRwzt(1);
+//                         if (zbmxMxjsrwDO.getJgz() == null) {
+//                             zbmxMxjsrwDO.setJgz(0.0);
+//                         }
+//                         zbmxMxjsrwMapper.updateZbmxMxjsrwById(zbmxMxjsrwDO);
+//                         ZbmxMxjsrwrzDO zbmxMxjsrwrzDO = new ZbmxMxjsrwrzDO();
+//                         zbmxMxjsrwrzDO.setMxbsm(task.getMxbsm());
+//                         zbmxMxjsrwrzDO.setMxmc(task.getMxmc());
+//                         zbmxMxjsrwrzDO.setRwbsm(task.getBsm());
+//                         zbmxMxjsrwrzDO.setRzsj(new Date());
+//                         zbmxMxjsrwrzDO.setRzlx("info");
+//                         zbmxMxjsrwrzDO.setRzlr("开始计算");
+//                         zbmxMxjsrwrzMapper.insert(zbmxMxjsrwrzDO);
+//                         Map<String, String> params = new HashMap<>();
+//                         params.put("bsm", task.getBsm());
+//                         params.put("MXBSM", task.getMxbsm());
+//                         params.put("MXMC", task.getMxmc());
+//                         params.put("mxcs", task.getMxcs());
+//                         params.put("ZBBH", task.getZbbh());
+//                         String result = PythonExecute.Run(functionId, params);
+//                         System.out.println("执行结果:" + result);
+//                         if (StringUtils.isNotEmpty(result)) {
+//                             result = result.replace("\r\n", "");
+//                             if (!StringUtils.isEmpty(result) && result.contains("OK")) {
+//                                 //成功
+//
+//                             } else {
+//                                 throw new Exception(result.replace("####ERROR####", ""));
+//                             }
+//                             String file = result.replace("####OK####", "");
+//                             zbmxMxjsrwDO.setRwzt(2);
+//                             zbmxMxjsrwDO.setRwjssj(new Date());
+//                             zbmxMxjsrwDO.setJgz(0.0);
+//                             zbmxMxjsrwDO.setJgsj(file);
+//                             zbmxMxjsrwMapper.updateZbmxMxjsrwById(zbmxMxjsrwDO);
+//                             //写入任务日志
+//                             zbmxMxjsrwrzDO = new ZbmxMxjsrwrzDO();
+//                             zbmxMxjsrwrzDO.setMxbsm(task.getMxbsm());
+//                             zbmxMxjsrwrzDO.setMxmc(task.getMxmc());
+//                             zbmxMxjsrwrzDO.setRwbsm(task.getBsm());
+//                             zbmxMxjsrwrzDO.setRzsj(new Date());
+//                             zbmxMxjsrwrzDO.setRzlx("info");
+//                             zbmxMxjsrwrzDO.setRzlr("计算完成");
+//                             zbmxMxjsrwrzMapper.insert(zbmxMxjsrwrzDO);
+//                         } else {
+//                             throw new Exception("Python返回值为空!");
+//                         }
+//                     } catch (Exception ex) {
+//                         //更新计算任务
+//                         zbmxMxjsrwDO.setRwzt(3);
+//                         zbmxMxjsrwDO.setRwjssj(new Date());
+//                         zbmxMxjsrwDO.setJgsj(ex.getMessage());
+//                         zbmxMxjsrwMapper.updateZbmxMxjsrwById(zbmxMxjsrwDO);
+//                         //写入计算日志
+//                         ZbmxMxjsrwrzDO zbmxMxjsrwrzDO = new ZbmxMxjsrwrzDO();
+//                         zbmxMxjsrwrzDO.setMxbsm(task.getMxbsm());
+//                         zbmxMxjsrwrzDO.setMxmc(task.getMxmc());
+//                         zbmxMxjsrwrzDO.setRwbsm(task.getBsm());
+//                         zbmxMxjsrwrzDO.setRzsj(new Date());
+//                         zbmxMxjsrwrzDO.setRzlx("error");
+//                         zbmxMxjsrwrzDO.setRzlr("计算异常:" + ex.getMessage());
+//                         zbmxMxjsrwrzMapper.insert(zbmxMxjsrwrzDO);
+//                     }
+//                 }
+//                 System.out.println("指标模型计算:" + task.getBsm() + "完成!!!!!!!! " + new Date().toString());
+//             }
+//         } catch (Exception e) {
+//             e.printStackTrace();
+//         }
+//     }
 }

+ 92 - 92
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/task/ZttSchedule.java

@@ -24,97 +24,97 @@ import java.util.Map;
 /**
  * 专题图制图模块定时刷新任务
  */
-@Component
+// @Component
 public class ZttSchedule {
-    //间隔时间 单位ms
-    public static final long TIME_INTERVAL = 1 * 15000;
-    //制图图片拼接时间戳格式
-    private SimpleDateFormat timeFormat = new SimpleDateFormat("yyyyMMddHHmmss");
-    //专题图出图文件夹 需要已创建好的 后面会拼接编制时间文件夹加主标题文件名
-    @Value("${Ztt.exportLocation}")
-    private String exportLocation;
-    //专题图制图python方法名标识
-    @Value("${Ztt.functionId}")
-    private String functionId;
-    @Resource
-    private ZttMapper zttMapper;
-    @Resource
-    private ZttMbMapper zttmbMapper;
-    //任务状态标识码
-    private RwztDTO Rwzt = new RwztDTO();
-    /**
-     * Scheduled 定时器参数
-     * cron表达式:指定任务在特定时间执行
-     * fixedDelay:表示上一次任务执行完成后多久再执行,参数类型long,单位:ms
-     * fixedDelayString:与fixedDelay一样,只是参数类型是String
-     * fixedRate:表示按一定的频率执行任务,参数类型long,单位:ms 如: fixedRate(5000),表示这个定时器任务每5秒执行一次
-     * fixedRateString:与fixedRate一样,只是参数类型变为String
-     * initialDelay:表示延迟多久再第一次执行任务,参数类型为long ,单位:ms
-     * initialDelayString:与initialDelay一样,只是参数类型String
-     */
-    /**
-     * @Async("name") 开启多线程
-     */
-    @Async("taskExecutor")
-//    @Transactional(rollbackFor = Exception.class)
-//    @Scheduled(fixedDelay = TIME_INTERVAL)
-    public void ZttStatus() {
-        try {
-            QueryWrapper<ZttDTO> wrapper = new QueryWrapper<ZttDTO>();
-            wrapper.eq("ztzt", Rwzt.getCreate());
-            //以创建时间正序排列
-            wrapper.orderByAsc("cjsj");
-            //每次只操作一条记录
-            List<ZttDTO> ress = zttMapper.selectList(wrapper);
-            if (ress.size() > 0)
-            {
-                ZttDTO res = ress.get(0);
-                //更新数据库信息 开始时间 制图状态
-                res.setKssj(new Date());
-                res.setZtzt(Rwzt.getRun());
-                QueryWrapper<ZttDTO> update = new QueryWrapper<ZttDTO>();
-                update.eq("bsm", res.getBsm());
-                zttMapper.update(res, update);
-                //查询模板位置
-                QueryWrapper<ZttMbDTO> mb = new QueryWrapper<ZttMbDTO>();
-                mb.eq("bsm", res.getMbbsm());
-                ZttMbDTO mbDto = zttmbMapper.selectOne(mb);
-                String mbposition = mbDto.getMbwj();
-                //执行python脚本
-                String curTime = timeFormat.format(new Date());
-                Map<String, String> params = new HashMap<>();
-                params.put("bsm", res.getBsm());
-                params.put("mxd", mbposition);
-                //判断目标文件夹是否存在,不存在则创建
-                String newfile = res.getBzsj() + "\\" + res.getZbt() + curTime + ".jpg";
-                String jpgpath = exportLocation + "\\" + newfile;
-                File file = new File(jpgpath);
-                if (!file.getParentFile().exists()) {
-                    file.getParentFile().mkdirs();
-                }
-                params.put("jpg", jpgpath.replaceAll("\\\\", "/"));
-//                params.put("xzqdm", res.getXzqdm()); //市級四位 dzz
-                String result = PythonExecute.Run(functionId, params);
-                if (!StringUtils.isEmpty(result) && result.contains("OK")) {//成功
-                    //更新数据库信息 结束时间 制图状态 专题图位置
-                    res.setJssj(new Date());
-                    res.setZtzt(Rwzt.getComplete());
-                    res.setZttwj("/file/statics/专题图/产品/" + newfile.replaceAll("\\\\", "/"));
-                    QueryWrapper<ZttDTO> ztzt = new QueryWrapper<ZttDTO>();
-                    ztzt.eq("bsm", res.getBsm());
-                    zttMapper.update(res, ztzt);
-                } else {//失败
-                    //更新数据库信息 结束时间 制图状态
-                    res.setJssj(new Date());
-                    res.setZtzt(Rwzt.getError());
-                    QueryWrapper<ZttDTO> ztzt = new QueryWrapper<ZttDTO>();
-                    ztzt.eq("bsm", res.getBsm());
-                    zttMapper.update(res, ztzt);
-                }
-                System.out.println("专题图制图模块:" + res.getBsm() + "制图完成!!!!!!!! " + new Date().toString());
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
+//     //间隔时间 单位ms
+//     public static final long TIME_INTERVAL = 1 * 15000;
+//     //制图图片拼接时间戳格式
+//     private SimpleDateFormat timeFormat = new SimpleDateFormat("yyyyMMddHHmmss");
+//     //专题图出图文件夹 需要已创建好的 后面会拼接编制时间文件夹加主标题文件名
+//     @Value("${Ztt.exportLocation}")
+//     private String exportLocation;
+//     //专题图制图python方法名标识
+//     @Value("${Ztt.functionId}")
+//     private String functionId;
+//     @Resource
+//     private ZttMapper zttMapper;
+//     @Resource
+//     private ZttMbMapper zttmbMapper;
+//     //任务状态标识码
+//     private RwztDTO Rwzt = new RwztDTO();
+//     /**
+//      * Scheduled 定时器参数
+//      * cron表达式:指定任务在特定时间执行
+//      * fixedDelay:表示上一次任务执行完成后多久再执行,参数类型long,单位:ms
+//      * fixedDelayString:与fixedDelay一样,只是参数类型是String
+//      * fixedRate:表示按一定的频率执行任务,参数类型long,单位:ms 如: fixedRate(5000),表示这个定时器任务每5秒执行一次
+//      * fixedRateString:与fixedRate一样,只是参数类型变为String
+//      * initialDelay:表示延迟多久再第一次执行任务,参数类型为long ,单位:ms
+//      * initialDelayString:与initialDelay一样,只是参数类型String
+//      */
+//     /**
+//      * @Async("name") 开启多线程
+//      */
+//     @Async("taskExecutor")
+// //    @Transactional(rollbackFor = Exception.class)
+// //    @Scheduled(fixedDelay = TIME_INTERVAL)
+//     public void ZttStatus() {
+//         try {
+//             QueryWrapper<ZttDTO> wrapper = new QueryWrapper<ZttDTO>();
+//             wrapper.eq("ztzt", Rwzt.getCreate());
+//             //以创建时间正序排列
+//             wrapper.orderByAsc("cjsj");
+//             //每次只操作一条记录
+//             List<ZttDTO> ress = zttMapper.selectList(wrapper);
+//             if (ress.size() > 0)
+//             {
+//                 ZttDTO res = ress.get(0);
+//                 //更新数据库信息 开始时间 制图状态
+//                 res.setKssj(new Date());
+//                 res.setZtzt(Rwzt.getRun());
+//                 QueryWrapper<ZttDTO> update = new QueryWrapper<ZttDTO>();
+//                 update.eq("bsm", res.getBsm());
+//                 zttMapper.update(res, update);
+//                 //查询模板位置
+//                 QueryWrapper<ZttMbDTO> mb = new QueryWrapper<ZttMbDTO>();
+//                 mb.eq("bsm", res.getMbbsm());
+//                 ZttMbDTO mbDto = zttmbMapper.selectOne(mb);
+//                 String mbposition = mbDto.getMbwj();
+//                 //执行python脚本
+//                 String curTime = timeFormat.format(new Date());
+//                 Map<String, String> params = new HashMap<>();
+//                 params.put("bsm", res.getBsm());
+//                 params.put("mxd", mbposition);
+//                 //判断目标文件夹是否存在,不存在则创建
+//                 String newfile = res.getBzsj() + "\\" + res.getZbt() + curTime + ".jpg";
+//                 String jpgpath = exportLocation + "\\" + newfile;
+//                 File file = new File(jpgpath);
+//                 if (!file.getParentFile().exists()) {
+//                     file.getParentFile().mkdirs();
+//                 }
+//                 params.put("jpg", jpgpath.replaceAll("\\\\", "/"));
+// //                params.put("xzqdm", res.getXzqdm()); //市級四位 dzz
+//                 String result = PythonExecute.Run(functionId, params);
+//                 if (!StringUtils.isEmpty(result) && result.contains("OK")) {//成功
+//                     //更新数据库信息 结束时间 制图状态 专题图位置
+//                     res.setJssj(new Date());
+//                     res.setZtzt(Rwzt.getComplete());
+//                     res.setZttwj("/file/statics/专题图/产品/" + newfile.replaceAll("\\\\", "/"));
+//                     QueryWrapper<ZttDTO> ztzt = new QueryWrapper<ZttDTO>();
+//                     ztzt.eq("bsm", res.getBsm());
+//                     zttMapper.update(res, ztzt);
+//                 } else {//失败
+//                     //更新数据库信息 结束时间 制图状态
+//                     res.setJssj(new Date());
+//                     res.setZtzt(Rwzt.getError());
+//                     QueryWrapper<ZttDTO> ztzt = new QueryWrapper<ZttDTO>();
+//                     ztzt.eq("bsm", res.getBsm());
+//                     zttMapper.update(res, ztzt);
+//                 }
+//                 System.out.println("专题图制图模块:" + res.getBsm() + "制图完成!!!!!!!! " + new Date().toString());
+//             }
+//         } catch (Exception e) {
+//             e.printStackTrace();
+//         }
+//     }
 }

+ 224 - 224
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/utils/Fxfw2SdeUtils.java

@@ -22,229 +22,229 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-@Component
+// @Component
 public class Fxfw2SdeUtils {
-    public static String temp;
-
-    public String getTemp() {
-        return temp;
-    }
-
-    @Value("${Hgxfx.temp}")
-    public void setTemp(String temp) {
-        Fxfw2SdeUtils.temp = temp;
-    }
-
-    static FxfwDictDTO fxfwDictDTO = new FxfwDictDTO();
-    //shp入库的方法标识码
-    static String shpPyFun = "shp2sde";
-    //esrijson入库的方法标识码
-    static String esrijsonPyFun = "esriJson2sde";
-
-    /**
-     * 合规性分析范围数据入库
-     *
-     * @param hgxfxEntityDTO
-     * @param requestHgxfxDTO
-     * @return
-     * @throws IOException
-     */
-    public static RequestResult vector2Sde(HgxfxEntityDTO hgxfxEntityDTO, HgxfxDTO requestHgxfxDTO) throws IOException {
-        Integer fwlx = hgxfxEntityDTO.getFwlx();
-        String vectorFilePath = "";
-        String pyResult = "";
-        if (fxfwDictDTO.getDraw().equals(fwlx)) {//自定义绘制范围
-            EsriJsonModel esriModel = new EsriJsonModel();
-            //字段汉化
-            Map<String, String> fieldAliases = new HashMap<>();
-            fieldAliases.put("RWBSM", "RWBSM");
-            fieldAliases.put("RWLX", "RWLX");
-            esriModel.setFieldAliases(fieldAliases);
-            //geojson绘制范围转换
-            String xzfw = hgxfxEntityDTO.getXzfw();
-            if (xzfw.contains(";")) {//多个分析范围
-                String[] xzfws = xzfw.split(";");
-                //要素
-                List<EsriFeature> features = new ArrayList<>();
-                for (int i = 0; i < xzfws.length; i++) {
-                    if (StringUtils.isEmpty(xzfws[i])) {
-                        continue;
-                    }
-                    JSONObject geojson = new JSONObject(JSON.parseObject(xzfws[i]));
-                    Geometry geom = (Geometry) JSONObject.toJavaObject(geojson, Geometry.class);
-                    //字段信息
-                    List<EsriField> fields = new ArrayList<EsriField>();
-                    fields.add(new EsriField().init("RWBSM", "RWBSM"));
-                    fields.add(new EsriField().init("RWLX", "RWLX"));
-                    esriModel.setFields(fields);
-                    EsriFeature feature = new EsriFeature();
-                    Map<String, Object> attributes = new HashMap<>();
-                    attributes.put("RWBSM", requestHgxfxDTO.getBsm());
-                    attributes.put("RWLX", "合规性分析");
-                    feature.setAttributes(attributes);
-                    EsriGeometry geometry = new EsriGeometry();
-                    geometry.setRings(geom.getCoordinates());
-                    feature.setGeometry(geometry);
-                    features.add(feature);
-                }
-                esriModel.setFeatures(features);
-            } else {//单个分析范围
-                JSONObject geojson = new JSONObject(JSON.parseObject(hgxfxEntityDTO.getXzfw()));
-                Geometry geom = (Geometry) JSONObject.toJavaObject(geojson, Geometry.class);
-                //字段信息
-                List<EsriField> fields = new ArrayList<EsriField>();
-                fields.add(new EsriField().init("RWBSM", "RWBSM"));
-                fields.add(new EsriField().init("RWLX", "RWLX"));
-                esriModel.setFields(fields);
-                //要素
-                List<EsriFeature> features = new ArrayList<>();
-                EsriFeature feature = new EsriFeature();
-                Map<String, Object> attributes = new HashMap<>();
-                attributes.put("RWBSM", requestHgxfxDTO.getBsm());
-                attributes.put("RWLX", "合规性分析");
-                feature.setAttributes(attributes);
-                EsriGeometry geometry = new EsriGeometry();
-                geometry.setRings(geom.getCoordinates());
-                feature.setGeometry(geometry);
-                features.add(feature);
-                esriModel.setFeatures(features);
-            }
-
-
-
-            vectorFilePath = temp + "\\" + System.currentTimeMillis() + ".json";
-
-            //写入文件
-            FileOutputStream fos = null;
-            String fileinput = JSON.toJSONString(esriModel);
-            Boolean writeStatus = true;
-            try {
-                fos = new FileOutputStream(vectorFilePath, false);
-                //true表示在文件末尾追加
-                fos.write(fileinput.toString().getBytes());
-                fos.close();
-            } catch (FileNotFoundException e) {
-                fos.close();
-                e.printStackTrace();
-                writeStatus = false;
-            }
-            if (!writeStatus) {
-                return RequestResult.error("自定义范围数据转换失败", null);
-            }
-            Map<String, String> params = new HashMap<>();
-            params.put("json", vectorFilePath);
-            params.put("table", "KJGH.T_FZSS_FXRW_GIS");
-            pyResult = PythonExecute.RunGisHelper(esrijsonPyFun, params);
-        } else if (fxfwDictDTO.getShp().equals(fwlx)) {//shp文件
-            vectorFilePath = hgxfxEntityDTO.getXzfw();
-            List<Field> listField = new ArrayList<Field>();
-            listField.add(new Field().init("RWBSM", requestHgxfxDTO.getBsm()));
-            listField.add(new Field().init("RWLX", "合规性分析"));
-            Map<String, Object> params = new HashMap<>();
-            params.put("shpfile", vectorFilePath);
-            params.put("table", "KJGH.T_FZSS_FXRW_GIS");
-            params.put("fields", listField);
-            pyResult = PythonExecute.RunGisHelper(shpPyFun, params);
-        } else {
-            return RequestResult.error("分析类型未定义", null);
-        }
-        if (pyResult.contains("####OK####")) {
-            //return RequestResult.success("分析范围数据入库成功",1);
-        } else if (pyResult.contains("####ERROR####")) {
-            return RequestResult.error("分析范围数据入库失败", 0);
-        }
-        System.out.println("合规性分析范围要素插入成功!! RWBSM = " + requestHgxfxDTO.getBsm());
-        return null;
-    }
-
-    /**
-     * 辅助选址分析范围数据入库
-     *
-     * @param fzxzDTO
-     * @return
-     * @throws IOException
-     */
-    public static RequestResult fzxzvector2Sde(FzxzDTO fzxzDTO, String rwlx) throws IOException {
-        // Integer fwlx = fzxzDTO.getFwlx();
-        // rwlx = StringUtils.isEmpty(rwlx) ? "辅助选址" : rwlx;
-        // String vectorFilePath = "";
-        // String pyResult = "";
-        // if (fxfwDictDTO.getRegion().equals(fwlx)) {
-        //
-        // } else if (fxfwDictDTO.getDraw().equals(fwlx)) {//自定义绘制范围
-        //     EsriJsonModel esriModel = new EsriJsonModel();
-        //     //字段汉化
-        //     Map<String, String> fieldAliases = new HashMap<>();
-        //     fieldAliases.put("RWBSM", "RWBSM");
-        //     fieldAliases.put("RWLX", "RWLX");
-        //     esriModel.setFieldAliases(fieldAliases);
-        //     //geojson绘制范围转换
-        //     JSONObject geojson = new JSONObject(JSON.parseObject(fzxzDTO.getXzfw()));
-        //     Geometry geom = (Geometry) JSONObject.toJavaObject(geojson, Geometry.class);
-        //     //字段信息
-        //     List<EsriField> fields = new ArrayList<EsriField>();
-        //     fields.add(new EsriField().init("RWBSM", "RWBSM"));
-        //     fields.add(new EsriField().init("RWLX", "RWLX"));
-        //     esriModel.setFields(fields);
-        //     //要素
-        //     List<EsriFeature> features = new ArrayList<>();
-        //     EsriFeature feature = new EsriFeature();
-        //     Map<String, Object> attributes = new HashMap<>();
-        //     attributes.put("RWBSM", fzxzDTO.getBsm());
-        //     attributes.put("RWLX", rwlx);
-        //     feature.setAttributes(attributes);
-        //     EsriGeometry geometry = new EsriGeometry();
-        //     geometry.setRings(geom.getCoordinates());
-        //     feature.setGeometry(geometry);
-        //     features.add(feature);
-        //     esriModel.setFeatures(features);
-        //
-        //     // 获取系统的根目录
-        //     temp = System.getProperty("user.dir")+"\\data";
-        //
-        //     vectorFilePath = temp + "\\" + System.currentTimeMillis() + ".json";
-        //     //写入文件
-        //     FileOutputStream fos = null;
-        //     String fileinput = JSON.toJSONString(esriModel);
-        //     Boolean writeStatus = true;
-        //     try {
-        //         fos = new FileOutputStream(vectorFilePath, false);
-        //         //true表示在文件末尾追加
-        //         fos.write(fileinput.toString().getBytes());
-        //         fos.close();
-        //     } catch (FileNotFoundException e) {
-        //         fos.close();
-        //         e.printStackTrace();
-        //         writeStatus = false;
-        //     }
-        //     if (!writeStatus) {
-        //         return RequestResult.error("自定义范围数据转换失败", null);
-        //     }
-        //     Map<String, String> params = new HashMap<>();
-        //     params.put("json", vectorFilePath);
-        //     params.put("table", "KJGH.T_FZSS_FXRW_GIS");
-        //     pyResult = PythonExecute.RunGisHelper(esrijsonPyFun, params);
-        //     fzxzDTO.setXzfw("");
-        // } else if (fxfwDictDTO.getShp().equals(fwlx)) {//shp文件
-        //     vectorFilePath = fzxzDTO.getXzfw();
-        //     List<Field> listField = new ArrayList<Field>();
-        //     listField.add(new Field().init("RWBSM", fzxzDTO.getBsm()));
-        //     listField.add(new Field().init("RWLX", rwlx));
-        //     Map<String, Object> params = new HashMap<>();
-        //     params.put("shpfile", vectorFilePath);
-        //     params.put("table", "KJGH.T_FZSS_FXRW_GIS");
-        //     params.put("fields", listField);
-        //     pyResult = PythonExecute.RunGisHelper(shpPyFun, params);
-        //     fzxzDTO.setXzfw("");
-        // } else {
-        //     return RequestResult.error("分析类型未定义", null);
-        // }
-        // if (pyResult.contains("####OK####")) {
-        //
-        // } else if (pyResult.contains("####ERROR####")) {
-        //     return RequestResult.error("分析范围数据入库失败", 0);
-        // }
-        // System.out.println("辅助选址分析范围要素插入成功!! RWBSM = " + fzxzDTO.getBsm());
-        return null;
-    }
+    // public static String temp;
+    //
+    // public String getTemp() {
+    //     return temp;
+    // }
+    //
+    // @Value("${Hgxfx.temp}")
+    // public void setTemp(String temp) {
+    //     Fxfw2SdeUtils.temp = temp;
+    // }
+    //
+    // static FxfwDictDTO fxfwDictDTO = new FxfwDictDTO();
+    // //shp入库的方法标识码
+    // static String shpPyFun = "shp2sde";
+    // //esrijson入库的方法标识码
+    // static String esrijsonPyFun = "esriJson2sde";
+    //
+    // /**
+    //  * 合规性分析范围数据入库
+    //  *
+    //  * @param hgxfxEntityDTO
+    //  * @param requestHgxfxDTO
+    //  * @return
+    //  * @throws IOException
+    //  */
+    // public static RequestResult vector2Sde(HgxfxEntityDTO hgxfxEntityDTO, HgxfxDTO requestHgxfxDTO) throws IOException {
+    //     Integer fwlx = hgxfxEntityDTO.getFwlx();
+    //     String vectorFilePath = "";
+    //     String pyResult = "";
+    //     if (fxfwDictDTO.getDraw().equals(fwlx)) {//自定义绘制范围
+    //         EsriJsonModel esriModel = new EsriJsonModel();
+    //         //字段汉化
+    //         Map<String, String> fieldAliases = new HashMap<>();
+    //         fieldAliases.put("RWBSM", "RWBSM");
+    //         fieldAliases.put("RWLX", "RWLX");
+    //         esriModel.setFieldAliases(fieldAliases);
+    //         //geojson绘制范围转换
+    //         String xzfw = hgxfxEntityDTO.getXzfw();
+    //         if (xzfw.contains(";")) {//多个分析范围
+    //             String[] xzfws = xzfw.split(";");
+    //             //要素
+    //             List<EsriFeature> features = new ArrayList<>();
+    //             for (int i = 0; i < xzfws.length; i++) {
+    //                 if (StringUtils.isEmpty(xzfws[i])) {
+    //                     continue;
+    //                 }
+    //                 JSONObject geojson = new JSONObject(JSON.parseObject(xzfws[i]));
+    //                 Geometry geom = (Geometry) JSONObject.toJavaObject(geojson, Geometry.class);
+    //                 //字段信息
+    //                 List<EsriField> fields = new ArrayList<EsriField>();
+    //                 fields.add(new EsriField().init("RWBSM", "RWBSM"));
+    //                 fields.add(new EsriField().init("RWLX", "RWLX"));
+    //                 esriModel.setFields(fields);
+    //                 EsriFeature feature = new EsriFeature();
+    //                 Map<String, Object> attributes = new HashMap<>();
+    //                 attributes.put("RWBSM", requestHgxfxDTO.getBsm());
+    //                 attributes.put("RWLX", "合规性分析");
+    //                 feature.setAttributes(attributes);
+    //                 EsriGeometry geometry = new EsriGeometry();
+    //                 geometry.setRings(geom.getCoordinates());
+    //                 feature.setGeometry(geometry);
+    //                 features.add(feature);
+    //             }
+    //             esriModel.setFeatures(features);
+    //         } else {//单个分析范围
+    //             JSONObject geojson = new JSONObject(JSON.parseObject(hgxfxEntityDTO.getXzfw()));
+    //             Geometry geom = (Geometry) JSONObject.toJavaObject(geojson, Geometry.class);
+    //             //字段信息
+    //             List<EsriField> fields = new ArrayList<EsriField>();
+    //             fields.add(new EsriField().init("RWBSM", "RWBSM"));
+    //             fields.add(new EsriField().init("RWLX", "RWLX"));
+    //             esriModel.setFields(fields);
+    //             //要素
+    //             List<EsriFeature> features = new ArrayList<>();
+    //             EsriFeature feature = new EsriFeature();
+    //             Map<String, Object> attributes = new HashMap<>();
+    //             attributes.put("RWBSM", requestHgxfxDTO.getBsm());
+    //             attributes.put("RWLX", "合规性分析");
+    //             feature.setAttributes(attributes);
+    //             EsriGeometry geometry = new EsriGeometry();
+    //             geometry.setRings(geom.getCoordinates());
+    //             feature.setGeometry(geometry);
+    //             features.add(feature);
+    //             esriModel.setFeatures(features);
+    //         }
+    //
+    //
+    //
+    //         vectorFilePath = temp + "\\" + System.currentTimeMillis() + ".json";
+    //
+    //         //写入文件
+    //         FileOutputStream fos = null;
+    //         String fileinput = JSON.toJSONString(esriModel);
+    //         Boolean writeStatus = true;
+    //         try {
+    //             fos = new FileOutputStream(vectorFilePath, false);
+    //             //true表示在文件末尾追加
+    //             fos.write(fileinput.toString().getBytes());
+    //             fos.close();
+    //         } catch (FileNotFoundException e) {
+    //             fos.close();
+    //             e.printStackTrace();
+    //             writeStatus = false;
+    //         }
+    //         if (!writeStatus) {
+    //             return RequestResult.error("自定义范围数据转换失败", null);
+    //         }
+    //         Map<String, String> params = new HashMap<>();
+    //         params.put("json", vectorFilePath);
+    //         params.put("table", "KJGH.T_FZSS_FXRW_GIS");
+    //         pyResult = PythonExecute.RunGisHelper(esrijsonPyFun, params);
+    //     } else if (fxfwDictDTO.getShp().equals(fwlx)) {//shp文件
+    //         vectorFilePath = hgxfxEntityDTO.getXzfw();
+    //         List<Field> listField = new ArrayList<Field>();
+    //         listField.add(new Field().init("RWBSM", requestHgxfxDTO.getBsm()));
+    //         listField.add(new Field().init("RWLX", "合规性分析"));
+    //         Map<String, Object> params = new HashMap<>();
+    //         params.put("shpfile", vectorFilePath);
+    //         params.put("table", "KJGH.T_FZSS_FXRW_GIS");
+    //         params.put("fields", listField);
+    //         pyResult = PythonExecute.RunGisHelper(shpPyFun, params);
+    //     } else {
+    //         return RequestResult.error("分析类型未定义", null);
+    //     }
+    //     if (pyResult.contains("####OK####")) {
+    //         //return RequestResult.success("分析范围数据入库成功",1);
+    //     } else if (pyResult.contains("####ERROR####")) {
+    //         return RequestResult.error("分析范围数据入库失败", 0);
+    //     }
+    //     System.out.println("合规性分析范围要素插入成功!! RWBSM = " + requestHgxfxDTO.getBsm());
+    //     return null;
+    // }
+    //
+    // /**
+    //  * 辅助选址分析范围数据入库
+    //  *
+    //  * @param fzxzDTO
+    //  * @return
+    //  * @throws IOException
+    //  */
+    // public static RequestResult fzxzvector2Sde(FzxzDTO fzxzDTO, String rwlx) throws IOException {
+    //     // Integer fwlx = fzxzDTO.getFwlx();
+    //     // rwlx = StringUtils.isEmpty(rwlx) ? "辅助选址" : rwlx;
+    //     // String vectorFilePath = "";
+    //     // String pyResult = "";
+    //     // if (fxfwDictDTO.getRegion().equals(fwlx)) {
+    //     //
+    //     // } else if (fxfwDictDTO.getDraw().equals(fwlx)) {//自定义绘制范围
+    //     //     EsriJsonModel esriModel = new EsriJsonModel();
+    //     //     //字段汉化
+    //     //     Map<String, String> fieldAliases = new HashMap<>();
+    //     //     fieldAliases.put("RWBSM", "RWBSM");
+    //     //     fieldAliases.put("RWLX", "RWLX");
+    //     //     esriModel.setFieldAliases(fieldAliases);
+    //     //     //geojson绘制范围转换
+    //     //     JSONObject geojson = new JSONObject(JSON.parseObject(fzxzDTO.getXzfw()));
+    //     //     Geometry geom = (Geometry) JSONObject.toJavaObject(geojson, Geometry.class);
+    //     //     //字段信息
+    //     //     List<EsriField> fields = new ArrayList<EsriField>();
+    //     //     fields.add(new EsriField().init("RWBSM", "RWBSM"));
+    //     //     fields.add(new EsriField().init("RWLX", "RWLX"));
+    //     //     esriModel.setFields(fields);
+    //     //     //要素
+    //     //     List<EsriFeature> features = new ArrayList<>();
+    //     //     EsriFeature feature = new EsriFeature();
+    //     //     Map<String, Object> attributes = new HashMap<>();
+    //     //     attributes.put("RWBSM", fzxzDTO.getBsm());
+    //     //     attributes.put("RWLX", rwlx);
+    //     //     feature.setAttributes(attributes);
+    //     //     EsriGeometry geometry = new EsriGeometry();
+    //     //     geometry.setRings(geom.getCoordinates());
+    //     //     feature.setGeometry(geometry);
+    //     //     features.add(feature);
+    //     //     esriModel.setFeatures(features);
+    //     //
+    //     //     // 获取系统的根目录
+    //     //     temp = System.getProperty("user.dir")+"\\data";
+    //     //
+    //     //     vectorFilePath = temp + "\\" + System.currentTimeMillis() + ".json";
+    //     //     //写入文件
+    //     //     FileOutputStream fos = null;
+    //     //     String fileinput = JSON.toJSONString(esriModel);
+    //     //     Boolean writeStatus = true;
+    //     //     try {
+    //     //         fos = new FileOutputStream(vectorFilePath, false);
+    //     //         //true表示在文件末尾追加
+    //     //         fos.write(fileinput.toString().getBytes());
+    //     //         fos.close();
+    //     //     } catch (FileNotFoundException e) {
+    //     //         fos.close();
+    //     //         e.printStackTrace();
+    //     //         writeStatus = false;
+    //     //     }
+    //     //     if (!writeStatus) {
+    //     //         return RequestResult.error("自定义范围数据转换失败", null);
+    //     //     }
+    //     //     Map<String, String> params = new HashMap<>();
+    //     //     params.put("json", vectorFilePath);
+    //     //     params.put("table", "KJGH.T_FZSS_FXRW_GIS");
+    //     //     pyResult = PythonExecute.RunGisHelper(esrijsonPyFun, params);
+    //     //     fzxzDTO.setXzfw("");
+    //     // } else if (fxfwDictDTO.getShp().equals(fwlx)) {//shp文件
+    //     //     vectorFilePath = fzxzDTO.getXzfw();
+    //     //     List<Field> listField = new ArrayList<Field>();
+    //     //     listField.add(new Field().init("RWBSM", fzxzDTO.getBsm()));
+    //     //     listField.add(new Field().init("RWLX", rwlx));
+    //     //     Map<String, Object> params = new HashMap<>();
+    //     //     params.put("shpfile", vectorFilePath);
+    //     //     params.put("table", "KJGH.T_FZSS_FXRW_GIS");
+    //     //     params.put("fields", listField);
+    //     //     pyResult = PythonExecute.RunGisHelper(shpPyFun, params);
+    //     //     fzxzDTO.setXzfw("");
+    //     // } else {
+    //     //     return RequestResult.error("分析类型未定义", null);
+    //     // }
+    //     // if (pyResult.contains("####OK####")) {
+    //     //
+    //     // } else if (pyResult.contains("####ERROR####")) {
+    //     //     return RequestResult.error("分析范围数据入库失败", 0);
+    //     // }
+    //     // System.out.println("辅助选址分析范围要素插入成功!! RWBSM = " + fzxzDTO.getBsm());
+    //     return null;
+    // }
 }