管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-01-06 5c3482e853299bcc786a244ca22a05a3a8d380fe
src/main/java/com/lf/server/service/data/FmeService.java
@@ -1,8 +1,14 @@
package com.lf.server.service.data;
import com.lf.server.config.PropertiesConfig;
import org.springframework.beans.factory.annotation.Autowired;
import com.lf.server.entity.ctrl.NameValueEntity;
import com.lf.server.helper.RestHelper;
import com.lf.server.helper.WebHelper;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
/**
 * FME服务类
@@ -10,32 +16,32 @@
 */
@Service
public class FmeService {
    @Autowired
    PropertiesConfig propertiesConfig;
    @Value("${sys.fmeUrl}")
    private String fmeUrl;
    /**
     * OSGB检查:.osgb + .xls/.xlsx
     * OSGB检查:.osgb + *倾斜摄影*.xls/.xlsx
     */
    public void checkOsgb() {
    public void checkOsgb(String path) {
    }
    /**
     * 表格数据检查:.xls/.xlsx
     * 表格数据检查:.xls/.xlsx(排除元数据)
     */
    public void checkXls() {
    }
    /**
     * 点云检查:.laz + .xls/.xlsx
     * 点云检查:.laz + *激光点云*.xls/.xlsx
     */
    public void checkLaz() {
    }
    /**
     * 高程检查:.tif/.prj/.tfw/.tif.ovr + .dwg
     * 高程检查:.tif/.prj/.tfw/.tif.ovr + *地形图*.dwg
     */
    public void checkDem() {
@@ -77,10 +83,18 @@
    }
    /**
     * 数学基础检查:.shp, .gdb, .xls/.xlsx
     * 数学基础检查:.shp, .gdb, *元数据*.xls/.xlsx
     */
    public void checkMath() {
    public String checkMath(String taskGuid, String xmmc, String sjzy, String filePath, HttpServletRequest req) {
        String url = getUrl("datax/task/run/B1入库质检_数学基础检查", req);
        List<NameValueEntity> list = getKeyVals();
        list.add(new NameValueEntity("_name", taskGuid));
        list.add(new NameValueEntity("XMMC", xmmc));
        list.add(new NameValueEntity("SJZY", sjzy));
        list.add(new NameValueEntity("GCXMYSB", filePath));
        return RestHelper.postForRest(url, list);
    }
    /**
@@ -89,4 +103,26 @@
    public void checkMeta() {
    }
    /**
     * 获取Url
     */
    public String getUrl(String subUrl, HttpServletRequest req) {
        String token = WebHelper.getToken(req);
        return fmeUrl + subUrl + "?token=" + token;
    }
    /**
     * 获取名称值对集合
     *
     * @return 名称值对集合
     */
    public List<NameValueEntity> getKeyVals() {
        List<NameValueEntity> list = new ArrayList<>();
        list.add(new NameValueEntity("_priority", 100));
        list.add(new NameValueEntity("_terminate_on_error", true));
        return list;
    }
}