| | |
| | | import com.lf.server.entity.data.VerEntity; |
| | | import com.lf.server.entity.sys.DepEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.service.all.BaseUploadService; |
| | | import com.lf.server.service.data.DirService; |
| | | import com.lf.server.service.data.FmeService; |
| | | import com.lf.server.service.data.MetaService; |
| | | import com.lf.server.service.data.VerService; |
| | | import com.lf.server.service.sys.DepService; |
| | |
| | | |
| | | @Autowired |
| | | MetaService metaService; |
| | | |
| | | @Autowired |
| | | FmeService fmeService; |
| | | |
| | | @Autowired |
| | | protected TokenService tokenService; |
| | |
| | | return fail(ex.getMessage(), -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询数据有效性") |
| | | @GetMapping(value = "/selectDataValid") |
| | | public ResponseMsg<Object> selectDataValid(HttpServletRequest req) { |
| | | try { |
| | | String taskGuid = StringHelper.getGuid(); |
| | | String xmmc = "西气东输四线天然气管道工程(吐鲁番-中卫)(00116BT02)"; |
| | | // 测量专业|勘察专业|地灾专业|洞库专业 |
| | | String sjzy = "测量专业"; |
| | | String filePath = "D:\\Project\\Data\\LF\\temp\\20230106135746\\数学基础检查.zip"; |
| | | |
| | | String rs = fmeService.checkMath(taskGuid, xmmc, sjzy, filePath, req); |
| | | if (StringHelper.isEmpty(rs)) { |
| | | return fail("检查失败"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.lf.server.helper; |
| | | |
| | | import com.lf.server.entity.all.StaticData; |
| | | import com.lf.server.entity.ctrl.NameValueEntity; |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | | import org.apache.http.HttpEntity; |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Post请求-RestTemplate |
| | | * |
| | | * @param uri Uri地址 |
| | | * @param postData 待发送数据 |
| | | * @return 响应字符串 |
| | | */ |
| | | public static String postForRest(String uri, List<NameValuePair> postData) { |
| | | public static String postForRest(String uri, Map<String, Object> map) { |
| | | try { |
| | | RestTemplate rest = getRestTemplate(); |
| | | UrlEncodedFormEntity entity = new UrlEncodedFormEntity(postData, StaticData.TEXT_ENCODER); |
| | | |
| | | return rest.postForObject(uri, entity, String.class); |
| | | return rest.postForObject(uri, map, String.class); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | public static String postForRest(String uri, Map<String, Object> map) { |
| | | public static <T> String postForRest(String uri, List<T> list) { |
| | | try { |
| | | RestTemplate rest = getRestTemplate(); |
| | | |
| | | return rest.postForObject(uri, map, String.class); |
| | | return rest.postForObject(uri, list, String.class); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | |
| | |
| | | package com.lf.server.service.data; |
| | | |
| | | 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; |
| | | |
| | |
| | | /** |
| | | * 数学基础检查:.shp, .gdb, *元数据*.xls/.xlsx |
| | | */ |
| | | public void checkMath(String taskGuid, String xmmc, String sjzy, String filePath) { |
| | | String url = getUrl("datax/task/run/B1入库质检_数学基础检查"); |
| | | 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("SJZY", sjzy)); |
| | | list.add(new NameValueEntity("GCXMYSB", filePath)); |
| | | |
| | | //String rs = |
| | | return RestHelper.postForRest(url, list); |
| | | } |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 获取Url |
| | | */ |
| | | public String getUrl(String subUrl) { |
| | | String token = WebHelper.getToken(WebHelper.getRequest()); |
| | | public String getUrl(String subUrl, HttpServletRequest req) { |
| | | String token = WebHelper.getToken(req); |
| | | |
| | | return fmeUrl + subUrl + "?token=" + token; |
| | | } |
| | |
| | | # redis |
| | | redis: |
| | | database: 0 |
| | | host: pipe.cppe.com |
| | | port: 6369 |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | password: rediS_5L#F4_Server |
| | | timeout: 6000 # 连接超时时长(毫秒) |
| | | pool: |