¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.config; |
| | | |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.web.multipart.MultipartResolver; |
| | | import org.springframework.web.multipart.support.StandardServletMultipartResolver; |
| | | |
| | | /** |
| | | * 夿件ä¸ä¼ é
ç½® |
| | | * @author WWW |
| | | */ |
| | | @Configuration |
| | | public class MultipartFileUploadConfig { |
| | | @Bean |
| | | public MultipartResolver multipartResolver() { |
| | | return new StandardServletMultipartResolver(); |
| | | } |
| | | } |
| | |
| | | // @Value("${spring.datasource.druid.stat-view-servlet.login-password}") |
| | | private String druidPwd; |
| | | |
| | | public String getDruidUser() { |
| | | return druidUser; |
| | | } |
| | | |
| | | public void setDruidUser(String druidUser) { |
| | | this.druidUser = druidUser; |
| | | } |
| | | |
| | | public String getDruidPwd() { |
| | | return druidPwd; |
| | | } |
| | | |
| | | public void setDruidPwd(String druidPwd) { |
| | | this.druidPwd = druidPwd; |
| | | } |
| | | |
| | | public String getDownloadPath() { |
| | | return downloadPath; |
| | | } |
| | |
| | | public void setTempPath(String tempPath) { |
| | | this.tempPath = tempPath; |
| | | } |
| | | |
| | | public String getDruidUser() { |
| | | return druidUser; |
| | | } |
| | | |
| | | public void setDruidUser(String druidUser) { |
| | | this.druidUser = druidUser; |
| | | } |
| | | |
| | | public String getDruidPwd() { |
| | | return druidPwd; |
| | | } |
| | | |
| | | public void setDruidPwd(String druidPwd) { |
| | | this.druidPwd = druidPwd; |
| | | } |
| | | } |
| | |
| | | if (!DownloadService.decryptPwd(reqEntity)) { |
| | | return fail("å¯ç è§£å¯å¤±è´¥", null); |
| | | } |
| | | if (!StringHelper.checkPwdValid(reqEntity.getPwd())) { |
| | | if (StringHelper.isPwdInvalid(reqEntity.getPwd())) { |
| | | return fail("å¯ç ä¸ç¬¦åè¦æ±"); |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.controller.all; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.lf.server.controller.all.BaseController; |
| | | import com.lf.server.entity.other.FloatServerResponse; |
| | | import com.lf.server.entity.other.ReqParamFloatServer; |
| | | import com.lf.server.helper.HttpHelper; |
| | | import com.lf.server.helper.LicHelper; |
| | | import io.swagger.annotations.Api; |
| | | import org.apache.http.HttpEntity; |
| | | import org.apache.http.entity.InputStreamEntity; |
| | | import org.apache.http.util.EntityUtils; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * FloatServer |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "FloatServer") |
| | | @RestController |
| | | @RequestMapping("/floatserver") |
| | | public class FloatServerController extends BaseController { |
| | | private static LicHelper licHelper; |
| | | |
| | | private static boolean isRedirect = false; |
| | | |
| | | @PostMapping({"/checkout/license"}) |
| | | public void license(HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | if (isRedirect) { |
| | | HttpHelper httpHelper = new HttpHelper(); |
| | | httpHelper.service(req, res, "http://192.168.20.43:38080/floatserver/checkout/license", null); |
| | | return; |
| | | } |
| | | |
| | | HttpEntity entity = new InputStreamEntity(req.getInputStream(), getContentLength(req)); |
| | | String str = EntityUtils.toString(entity, "UTF-8"); |
| | | |
| | | LicHelper helper = getHelper(); |
| | | String reqJson = helper.b(str); |
| | | |
| | | ReqParamFloatServer rfs = JSON.parseObject(reqJson, ReqParamFloatServer.class); |
| | | FloatServerResponse fsr = new FloatServerResponse(rfs); |
| | | |
| | | String resJson = JSON.toJSONString(fsr); |
| | | String strRes = helper.a(resJson); |
| | | |
| | | res.getWriter().write(strRes); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | |
| | | private Integer getContentLength(HttpServletRequest request) { |
| | | String contentLengthHeader = request.getHeader("Content-Length"); |
| | | if (contentLengthHeader != null) { |
| | | return Integer.parseInt(contentLengthHeader); |
| | | } |
| | | |
| | | return -1; |
| | | } |
| | | |
| | | private static LicHelper getHelper() { |
| | | if (licHelper == null) { |
| | | licHelper = new LicHelper(); |
| | | licHelper.d("&kdaow$IEW.##%5-"); |
| | | licHelper.c("*y91z72a;pclfleoqc20161v$DSP&%3+"); |
| | | } |
| | | |
| | | return licHelper; |
| | | } |
| | | |
| | | @SuppressWarnings("AlibabaUndefineMagicConstant") |
| | | private static String getClientIpAddr(HttpServletRequest req) { |
| | | String ip; |
| | | if ((ip = req.getHeader("x-forwarded-for")) == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = req.getHeader("Proxy-Client-IP"); |
| | | } |
| | | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = req.getHeader("WL-Proxy-Client-IP"); |
| | | } |
| | | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = req.getRemoteAddr(); |
| | | } |
| | | |
| | | return ip; |
| | | } |
| | | |
| | | public static void test() { |
| | | try { |
| | | ReqParamFloatServer reqParam = new ReqParamFloatServer("192.168.20.106", "12316"); |
| | | String json = JSON.toJSONString(reqParam); |
| | | |
| | | String licCode = "78a82f0920de0f557f8177bec1e48601c4dc25e4054a00728e4314b56528d3a1632de5298edee38a65412277977a174fea5d91c452b19ef138dbc2ba089ba632"; |
| | | |
| | | LicHelper helper = getHelper(); |
| | | String str = helper.a(json); |
| | | System.out.println("ReqParamFloatServer: " + str); |
| | | |
| | | String data = "8dfb75298185cbcc4b2d485fdb4f25627f7aeb4dd41329076b5015586e4d56cfe2c56f12cd9852c447904210117b41fe2672b24d7e82fd581ad5a0983b501b5bcbe97d65dbbe770dbdc4a98e80d2966a71ecd0041a5282283bff853d70caf7aed671bc9c9d4bedf6d1d0294394861af40f195d68a965d957d53c78aa50ada3afc65d1a526c54648e6e081e8f7f7ab1c31b9f75916170e638b0b9216d30204864afe3a7a1bc8a6563bf44daf6a29e27c19f798c4f82dbb904ea4aa4fcc87a82226d9bf3e891ecb97b94263064fec025e3aa7c440d7c0e8ed559b84ae2438ec0fc438444a03c992883170ecdde20e08552efcf9d584de469930b27c81f946548d5c6e63e815671182b03b5e6e622ddb10a3f6a35ad3f44ec247a3b2dee0e936020d48efb7abc2d2abfb555f61d54c85eca"; |
| | | String rs = helper.b(data); |
| | | System.out.println("Lic: " + rs); |
| | | } catch (Exception ex) { |
| | | System.out.println(ex.getStackTrace()); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.controller.all; |
| | | |
| | | import com.lf.server.annotation.SysLog; |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.sys.RoleEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.service.sys.RoleService; |
| | | import com.lf.server.service.sys.TokenService; |
| | | import com.lf.server.service.sys.UserService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * FMEæ¥å£æ§å¶å¨ |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "è¿ç»´ç®¡ç\\FMEæ¥å£è°ç¨") |
| | | @RestController |
| | | @RequestMapping("/fmeIt") |
| | | public class FmeItController extends BaseController { |
| | | @Autowired |
| | | UserService userService; |
| | | |
| | | @Autowired |
| | | RoleService roleService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢æ¯/å¦ä¸ºç®¡çå") |
| | | @GetMapping(value = "/selectForIsAdmin") |
| | | public ResponseMsg<Boolean> selectForIsAdmin(HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | | return fail("ç¨æ·æªç»å½", false); |
| | | } |
| | | |
| | | Integer rows = userService.selectForIsAdmin(ue.getId()); |
| | | |
| | | return success("æå", rows > 0); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), false); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®IDæ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectUser") |
| | | public ResponseMsg<UserEntity> selectUser(int id) { |
| | | try { |
| | | UserEntity userEntity = userService.selectUser(id); |
| | | |
| | | return success(userEntity); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®ç¨æ·IDæ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "uid", value = "ç¨æ·ID", dataType = "String", paramType = "query", example = "admin") |
| | | }) |
| | | @GetMapping(value = "/selectByUid") |
| | | public ResponseMsg<UserEntity> selectByUid(String uid) { |
| | | try { |
| | | if (StringHelper.isEmpty(uid)) { |
| | | fail("ç¨æ·IDä¸è½ä¸ºç©º", null); |
| | | } |
| | | |
| | | UserEntity userEntity = userService.selectByUid(uid); |
| | | |
| | | return success(userEntity); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢ç¨æ·å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "uname", value = "ç¨æ·å", dataType = "String", paramType = "query", example = "室"), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯é¡µæ¡æ°", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "å页æ°ï¼ä»1å¼å§ï¼", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPageForUser") |
| | | public ResponseMsg<List<UserEntity>> selectByPageForUser(String uname, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | int count = userService.selectCount(uname); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | List<UserEntity> rs = userService.selectByPage(uname, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢æ¯/å¦ä¸ºç®¡çå") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ç¨æ·ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectIsAdmin") |
| | | public ResponseMsg<Boolean> selectIsAdmin(Integer id) { |
| | | try { |
| | | UserEntity ue = userService.selectUser(id); |
| | | if (ue == null) { |
| | | return fail("ç¨æ·ä¸åå¨", false); |
| | | } |
| | | |
| | | Integer rows = userService.selectForIsAdmin(ue.getId()); |
| | | |
| | | return success("æå", rows > 0); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), false); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ç®¡çåç¨æ·") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "type", value = "管çåç±»å«", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectAdminUsers") |
| | | public ResponseMsg<Object> selectAdminUsers(Integer type) { |
| | | try { |
| | | if (null == type || type < 1) { |
| | | return fail("管çåç±»å«ä¸è½ä¸ºç©ºæå°äº1", false); |
| | | } |
| | | |
| | | List<UserEntity> rs = userService.selectAdminUsers(type); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), false); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®ç¨æ·IDæ¥è¯¢è§è²") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ç¨æ·ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectRoleByUserId") |
| | | public ResponseMsg<Object> selectRoleByUserId(Integer id) { |
| | | try { |
| | | if (null == id || id < 1) { |
| | | return fail("ç¨æ·IDä¸è½ä¸ºç©ºæå°äº1", false); |
| | | } |
| | | |
| | | List<RoleEntity> rs = userService.selectRoleByUserId(id); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), false); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®è§è²æ¥è¯¢ç¨æ·") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "è§è²ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectUserByRoleId") |
| | | public ResponseMsg<Object> selectUserByRoleId(Integer id) { |
| | | try { |
| | | if (null == id || id < 1) { |
| | | return fail("ç¨æ·IDä¸è½ä¸ºç©ºæå°äº1", false); |
| | | } |
| | | |
| | | List<UserEntity> rs = userService.selectUserByRoleId(id); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), false); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®IDæ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectRole") |
| | | public ResponseMsg<RoleEntity> selectRole(int id) { |
| | | try { |
| | | RoleEntity roleEntity = roleService.selectRole(id); |
| | | |
| | | return success(roleEntity); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢è§è²å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "åç§°", dataType = "String", paramType = "query", example = "Admin"), |
| | | @ApiImplicitParam(name = "depid", value = "åä½ID", dataType = "Integer", paramType = "query", example = "1"), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯é¡µæ¡æ°", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "å页æ°ï¼ä»1å¼å§ï¼", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPageForRole") |
| | | public ResponseMsg<List<RoleEntity>> selectByPageForRole(String name, Integer depid, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = roleService.selectCount(name, depid); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<RoleEntity> rs = roleService.selectByPage(name, depid, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.lf.server.entity.all.PermsAuthEntity; |
| | | import com.lf.server.entity.all.ResAuthEntity; |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.data.DirEntity; |
| | | import com.lf.server.entity.sys.MenuEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.service.all.PermsService; |
| | | import com.lf.server.service.sys.MenuService; |
| | | import com.lf.server.service.sys.TokenService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | MenuService menuService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢å½åç¨æ·çèµæºææ") |
| | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ç¨æ·è§è²") |
| | | @GetMapping("/selectRoles") |
| | | public ResponseMsg<Object> selectRoles(HttpServletRequest req, HttpServletResponse res) { |
| | | public ResponseMsg<Object> selectRoles(HttpServletRequest req) { |
| | | try { |
| | | // |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | | return fail("ç¨æ·æªç»å½", null); |
| | | } |
| | | |
| | | return success(null); |
| | | List<Integer> list = permsService.selectRoles(ue.getUid()); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "é彿¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "èåID", dataType = "Integer", paramType = "query", example = "14") |
| | | }) |
| | | @GetMapping(value = "/selectMenuRecursive") |
| | | public ResponseMsg<Object> selectMenuRecursive(int id, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | | return fail("ç¨æ·æªç»å½", null); |
| | | } |
| | | |
| | | List<MenuEntity> list = permsService.selectMenuRecursive(id, ue.getUid()); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | |
| | | import com.lf.server.entity.data.DictEntity; |
| | | import com.lf.server.entity.data.DownloadEntity; |
| | | import com.lf.server.entity.data.MetaEntity; |
| | | import com.lf.server.entity.data.MetaFileEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.ClassHelper; |
| | | import com.lf.server.helper.Md5Helper; |
| | |
| | | @GetMapping(value = "/delete") |
| | | public ResponseMsg<Integer> delete(int id) { |
| | | try { |
| | | // int count = metaService.delete(id) |
| | | int count = metaService.deleteCascade(String.valueOf(id)); |
| | | int count = metaService.delete(id); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | return fail("idæ°ç»ä¸è½ä¸ºç©º", -1); |
| | | } |
| | | |
| | | // int count = metaService.deletes(ids) |
| | | String idStr = StringHelper.join(ids, ","); |
| | | int count = metaService.deleteCascade(idStr); |
| | | int count = metaService.deletes(ids); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | if (!DownloadService.decryptPwd(reqEntity)) { |
| | | return fail("å¯ç è§£å¯å¤±è´¥", null); |
| | | } |
| | | if (!StringHelper.checkPwdValid(reqEntity.getPwd())) { |
| | | if (StringHelper.isPwdInvalid(reqEntity.getPwd())) { |
| | | return fail("å¯ç ä¸ç¬¦åè¦æ±"); |
| | | } |
| | | |
| | | List<MetaFileEntity> list = metaService.selectMetaFiles(reqEntity.getIds()); |
| | | List<MetaEntity> list = metaService.selectMetaFiles(reqEntity.getIds()); |
| | | if (null == list || list.isEmpty()) { |
| | | return fail("æ²¡ææ¾å°å
æ°æ®"); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.controller.data.upload; |
| | | |
| | | import com.lf.server.annotation.SysLog; |
| | | import com.lf.server.controller.all.BaseController; |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.all.StaticData; |
| | | import com.lf.server.entity.ctrl.FmeReqEntity; |
| | | import com.lf.server.helper.HttpHelper; |
| | | import com.lf.server.helper.PathHelper; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.service.data.FmeService; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ£æ¥æ§å¶å¨ |
| | | * @author WWW |
| | | */ |
| | | public class CheckController extends BaseController { |
| | | @Autowired |
| | | protected PathHelper pathHelper; |
| | | |
| | | @Autowired |
| | | protected FmeService fmeService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ä»»å¡ç¶æ") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ä»»å¡ID", dataType = "String", paramType = "query", example = "29db09ee-2aae-4c62-bec0-0b5c5d8084e4") |
| | | }) |
| | | @GetMapping(value = "/selectTaskStatus") |
| | | public Object selectTaskStatus(String id, HttpServletRequest req) { |
| | | try { |
| | | if (StringHelper.isEmpty(id)) { |
| | | return fail("idä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | return fmeService.getTaskStatus(id, req); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ä¸è½½è´¨æ£éè¯¯ç»æ") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ä»»å¡ID", dataType = "String", paramType = "query", example = "29db09ee-2aae-4c62-bec0-0b5c5d8084e4") |
| | | }) |
| | | @GetMapping(value = "/downloadResult") |
| | | public void downloadResult(String id, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | if (!StringHelper.isEmpty(id)) { |
| | | String url = fmeService.getDownloadUrl(id, req); |
| | | |
| | | HttpHelper httpHelper = new HttpHelper(); |
| | | // res.sendRedirect(url) |
| | | httpHelper.service(req, res, url, null); |
| | | } |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æäº¤æ°æ®è´¨æ£") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "FME请æ±å®ä½ç±»", dataType = "FmeReqEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/uploadChecks") |
| | | public ResponseMsg<Object> uploadChecks(@RequestBody FmeReqEntity entity, HttpServletRequest req) { |
| | | try { |
| | | if (StringHelper.isEmpty(entity.names)) { |
| | | return fail("ä»»å¡åç§°ä¸è½ä¸ºç©º"); |
| | | } |
| | | if (StringHelper.isEmpty(entity.zipPath)) { |
| | | return fail("è¯·éæ©å¾
è´¨æ£çzipæä»¶"); |
| | | } |
| | | |
| | | entity.zipPath = getFullPath(entity.zipPath); |
| | | if (!isZipFile(entity.zipPath)) { |
| | | return fail("å¾
è´¨æ£çzipæä»¶ä¸åå¨"); |
| | | } |
| | | if (entity.names.contains(StaticData.CHECK_MAIN)) { |
| | | entity.wbsPath = getFullPath(entity.wbsPath); |
| | | if (!isXlsFile(entity.wbsPath)) { |
| | | return fail("å¾
è´¨æ£çWBSæä»¶ä¸åå¨"); |
| | | } |
| | | } |
| | | |
| | | List<String> list = new ArrayList<>(); |
| | | for (String name : entity.names.split(StaticData.COMMA)) { |
| | | String guid = invoke(name, entity, req); |
| | | list.add(guid); |
| | | } |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·åæä»¶è·¯å¾ |
| | | */ |
| | | private String getFullPath(String filePath) { |
| | | return null == filePath ? null : pathHelper.getConfig().getTempPath() + File.separator + filePath; |
| | | } |
| | | |
| | | /** |
| | | * æ¯/å¦ä¸ºZipæä»¶ |
| | | */ |
| | | private boolean isZipFile(String filePath) { |
| | | if (null == filePath || !filePath.toLowerCase().endsWith(StaticData.ZIP)) { |
| | | return false; |
| | | } |
| | | |
| | | File zipFile = new File(filePath); |
| | | |
| | | return zipFile.exists() && !zipFile.isDirectory(); |
| | | } |
| | | |
| | | /** |
| | | * æ¯/å¦ä¸ºExcelæä»¶ |
| | | */ |
| | | private boolean isXlsFile(String filePath) { |
| | | if (null == filePath) { |
| | | return false; |
| | | } |
| | | if (!(filePath.toLowerCase().endsWith(StaticData.XLS) || filePath.toLowerCase().endsWith(StaticData.XLSX))) { |
| | | return false; |
| | | } |
| | | |
| | | File zipFile = new File(filePath); |
| | | |
| | | return zipFile.exists() && !zipFile.isDirectory(); |
| | | } |
| | | |
| | | /** |
| | | * æ¹æ³è°ç¨ |
| | | */ |
| | | private String invoke(String name, FmeReqEntity entity, HttpServletRequest req) throws Exception { |
| | | Method method; |
| | | try { |
| | | method = FmeService.class.getDeclaredMethod(name, FmeReqEntity.class, HttpServletRequest.class); |
| | | } catch (Exception ex) { |
| | | throw new Exception(name + "ï¼è¯¥æ£æ¥æ¹æ³ä¸åå¨"); |
| | | } |
| | | |
| | | Object obj = method.invoke(fmeService, entity, req); |
| | | |
| | | return null == obj ? null : obj.toString(); |
| | | } |
| | | |
| | | /*@SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢OSGBæ£æ¥") |
| | | @GetMapping(value = "/selectCheckOsgb") |
| | | public ResponseMsg<Object> selectCheckOsgb(HttpServletRequest req) { |
| | | try { |
| | | FmeReqEntity fme = new FmeReqEntity(); |
| | | fme.name = StringHelper.getGuid(); |
| | | fme.xmmc = "西æ°ä¸è¾åçº¿å¤©ç¶æ°ç®¡éå·¥ç¨ï¼åé²çª-ä¸å«ï¼ï¼00116BT02ï¼"; |
| | | fme.zipPath = "D:\\Project\\Data\\LF\\temp\\20230107010101\\OSGBæ£æ¥.zip"; |
| | | fme.imgResolution = 0.2; |
| | | |
| | | String rs = fmeService.checkOsgb(fme, req); |
| | | if (StringHelper.isEmpty(rs)) { |
| | | return fail("æ£æ¥å¤±è´¥"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è¡¨æ ¼æ°æ®æ£æ¥") |
| | | @GetMapping(value = "/selectCheckXls") |
| | | public ResponseMsg<Object> selectCheckXls(HttpServletRequest req) { |
| | | try { |
| | | FmeReqEntity fme = new FmeReqEntity(); |
| | | fme.name = StringHelper.getGuid(); |
| | | fme.xmmc = "西æ°ä¸è¾åçº¿å¤©ç¶æ°ç®¡éå·¥ç¨ï¼åé²çª-ä¸å«ï¼ï¼00116BT02ï¼"; |
| | | fme.sjzy = "æµéä¸ä¸"; |
| | | fme.zipPath = "D:\\Project\\Data\\LF\\temp\\20230107010101\\è¡¨æ ¼æ°æ®æ£æ¥.zip"; |
| | | |
| | | String rs = fmeService.checkXls(fme, req); |
| | | if (StringHelper.isEmpty(rs)) { |
| | | return fail("æ£æ¥å¤±è´¥"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ç¹äºæ£æ¥") |
| | | @GetMapping(value = "/selectCheckLaz") |
| | | public ResponseMsg<Object> selectCheckLaz(HttpServletRequest req) { |
| | | try { |
| | | FmeReqEntity fme = new FmeReqEntity(); |
| | | fme.name = StringHelper.getGuid(); |
| | | fme.xmmc = "西æ°ä¸è¾åçº¿å¤©ç¶æ°ç®¡éå·¥ç¨ï¼åé²çª-ä¸å«ï¼ï¼00116BT02ï¼"; |
| | | fme.zipPath = "D:\\Project\\Data\\LF\\temp\\20230107010101\\ç¹äºæ£æ¥.zip"; |
| | | fme.lazDensity = 1; |
| | | |
| | | String rs = fmeService.checkLaz(fme, req); |
| | | if (StringHelper.isEmpty(rs)) { |
| | | return fail("æ£æ¥å¤±è´¥"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢é«ç¨æ£æ¥") |
| | | @GetMapping(value = "/selectCheckDem") |
| | | public ResponseMsg<Object> selectCheckDem(HttpServletRequest req) { |
| | | try { |
| | | FmeReqEntity fme = new FmeReqEntity(); |
| | | fme.name = StringHelper.getGuid(); |
| | | fme.xmmc = "西æ°ä¸è¾åçº¿å¤©ç¶æ°ç®¡éå·¥ç¨ï¼åé²çª-ä¸å«ï¼ï¼00116BT02ï¼"; |
| | | fme.zipPath = "D:\\Project\\Data\\LF\\temp\\20230107010101\\é«ç¨æ£æ¥.zip"; |
| | | fme.demTolerance = 5; |
| | | fme.demChangeRate = 200; |
| | | |
| | | String rs = fmeService.checkDem(fme, req); |
| | | if (StringHelper.isEmpty(rs)) { |
| | | return fail("æ£æ¥å¤±è´¥"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢å±æ§æ£æ¥") |
| | | @GetMapping(value = "/selectCheckAttrs") |
| | | public ResponseMsg<Object> selectCheckAttrs(HttpServletRequest req) { |
| | | try { |
| | | FmeReqEntity fme = new FmeReqEntity(); |
| | | fme.name = StringHelper.getGuid(); |
| | | fme.xmmc = "西æ°ä¸è¾åçº¿å¤©ç¶æ°ç®¡éå·¥ç¨ï¼åé²çª-ä¸å«ï¼ï¼00116BT02ï¼"; |
| | | fme.sjzy = "æµéä¸ä¸"; |
| | | fme.zipPath = "D:\\Project\\Data\\LF\\temp\\20230107010101\\屿§æ£æ¥.zip"; |
| | | |
| | | String rs = fmeService.checkAttrs(fme, req); |
| | | if (StringHelper.isEmpty(rs)) { |
| | | return fail("æ£æ¥å¤±è´¥"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢æææ£æ¥") |
| | | @GetMapping(value = "/selectCheckTopology") |
| | | public ResponseMsg<Object> selectCheckTopology(HttpServletRequest req) { |
| | | try { |
| | | FmeReqEntity fme = new FmeReqEntity(); |
| | | fme.name = StringHelper.getGuid(); |
| | | fme.xmmc = "西æ°ä¸è¾åçº¿å¤©ç¶æ°ç®¡éå·¥ç¨ï¼åé²çª-ä¸å«ï¼ï¼00116BT02ï¼"; |
| | | fme.zipPath = "D:\\Project\\Data\\LF\\temp\\20230107010101\\æææ£æ¥.zip"; |
| | | fme.polyTolerance = 0.001; |
| | | fme.lineTolerance = 0.001; |
| | | fme.pointTolerance = 0.001; |
| | | fme.gcdOffset = 20; |
| | | fme.kzdOffset = 100; |
| | | fme.rangeOffset = 200; |
| | | fme.xgMax = 0.005; |
| | | |
| | | String rs = fmeService.checkTopology(fme, req); |
| | | if (StringHelper.isEmpty(rs)) { |
| | | return fail("æ£æ¥å¤±è´¥"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢å¾é¢æ´é¥°æ£æ¥") |
| | | @GetMapping(value = "/selectCheckDecorate") |
| | | public ResponseMsg<Object> selectCheckDecorate(HttpServletRequest req) { |
| | | try { |
| | | FmeReqEntity fme = new FmeReqEntity(); |
| | | fme.name = StringHelper.getGuid(); |
| | | fme.xmmc = "西æ°ä¸è¾åçº¿å¤©ç¶æ°ç®¡éå·¥ç¨ï¼åé²çª-ä¸å«ï¼ï¼00116BT02ï¼"; |
| | | fme.zipPath = "D:\\Project\\Data\\LF\\temp\\20230107010101\\å¾é¢æ´é¥°æ£æ¥.zip"; |
| | | fme.xlsList = "D:\\Project\\Data\\LF\\temp\\20230107010101\\æä»¶æ¸
å.xlsx"; |
| | | |
| | | String rs = fmeService.checkDecorate(fme, req); |
| | | if (StringHelper.isEmpty(rs)) { |
| | | return fail("æ£æ¥å¤±è´¥"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢åç¹æ£æ¥") |
| | | @GetMapping(value = "/selectCheckOrigin") |
| | | public ResponseMsg<Object> selectCheckOrigin(HttpServletRequest req) { |
| | | try { |
| | | FmeReqEntity fme = new FmeReqEntity(); |
| | | fme.name = StringHelper.getGuid(); |
| | | fme.xmmc = "西æ°ä¸è¾åçº¿å¤©ç¶æ°ç®¡éå·¥ç¨ï¼åé²çª-ä¸å«ï¼ï¼00116BT02ï¼"; |
| | | fme.zipPath = "D:\\Project\\Data\\LF\\temp\\20230107010101\\åç¹æ£æ¥.zip"; |
| | | |
| | | String rs = fmeService.checkOrigin(fme, req); |
| | | if (StringHelper.isEmpty(rs)) { |
| | | return fail("æ£æ¥å¤±è´¥"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢æ
æ ¼æ£æ¥") |
| | | @GetMapping(value = "/selectCheckDom") |
| | | public ResponseMsg<Object> selectCheckDom(HttpServletRequest req) { |
| | | try { |
| | | FmeReqEntity fme = new FmeReqEntity(); |
| | | fme.name = StringHelper.getGuid(); |
| | | fme.xmmc = "西æ°ä¸è¾åçº¿å¤©ç¶æ°ç®¡éå·¥ç¨ï¼åé²çª-ä¸å«ï¼ï¼00116BT02ï¼"; |
| | | fme.sjzy = "æµéä¸ä¸"; |
| | | fme.zipPath = "D:\\Project\\Data\\LF\\temp\\20230107010101\\æ
æ ¼æ£æ¥.zip"; |
| | | fme.coordinateSystem = "CGCS2000/GK3d-93E_FME"; |
| | | fme.imgResolution = 0.2; |
| | | |
| | | String rs = fmeService.checkDom(fme, req); |
| | | if (StringHelper.isEmpty(rs)) { |
| | | return fail("æ£æ¥å¤±è´¥"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢æ°å¦åºç¡æ£æ¥") |
| | | @GetMapping(value = "/selectCheckMath") |
| | | public ResponseMsg<Object> selectCheckMath(HttpServletRequest req) { |
| | | try { |
| | | FmeReqEntity fme = new FmeReqEntity(); |
| | | fme.name = StringHelper.getGuid(); |
| | | fme.xmmc = "西æ°ä¸è¾åçº¿å¤©ç¶æ°ç®¡éå·¥ç¨ï¼åé²çª-ä¸å«ï¼ï¼00116BT02ï¼"; |
| | | fme.sjzy = "æµéä¸ä¸"; |
| | | fme.zipPath = "D:\\Project\\Data\\LF\\temp\\20230107010101\\æ°å¦åºç¡æ£æ¥.zip"; |
| | | |
| | | String rs = fmeService.checkMath(fme, req); |
| | | if (StringHelper.isEmpty(rs)) { |
| | | return fail("æ£æ¥å¤±è´¥"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢å
æ°æ®æ£æ¥") |
| | | @GetMapping(value = "/selectCheckMeta") |
| | | public ResponseMsg<Object> selectCheckMeta(HttpServletRequest req) { |
| | | try { |
| | | FmeReqEntity fme = new FmeReqEntity(); |
| | | fme.name = StringHelper.getGuid(); |
| | | fme.xmmc = "西æ°ä¸è¾åçº¿å¤©ç¶æ°ç®¡éå·¥ç¨ï¼åé²çª-ä¸å«ï¼ï¼00116BT02ï¼"; |
| | | fme.sjzy = "æµéä¸ä¸"; |
| | | fme.zipPath = "D:\\Project\\Data\\LF\\temp\\20230107010101\\å
æ°æ®æ£æ¥.zip"; |
| | | |
| | | String rs = fmeService.checkMeta(fme, req); |
| | | if (StringHelper.isEmpty(rs)) { |
| | | return fail("æ£æ¥å¤±è´¥"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢æ»è´¨æ£") |
| | | @GetMapping(value = "/selectCheckMain") |
| | | public ResponseMsg<Object> selectCheckMain(HttpServletRequest req) { |
| | | try { |
| | | FmeReqEntity fme = new FmeReqEntity(); |
| | | fme.name = StringHelper.getGuid(); |
| | | fme.xmmc = "西æ°ä¸è¾åçº¿å¤©ç¶æ°ç®¡éå·¥ç¨ï¼åé²çª-ä¸å«ï¼ï¼00116BT02ï¼"; |
| | | fme.sjzy = "æµéä¸ä¸"; |
| | | fme.zipPath = "D:\\Project\\Data\\LF\\temp\\20230107010101\\西æ°ä¸è¾åçº¿å¤©ç¶æ°ç®¡éå·¥ç¨ï¼åé²çª-ä¸å«ï¼ï¼00116BT02ï¼.7z"; |
| | | fme.wbsPath = "D:\\Project\\Data\\LF\\temp\\20230107010101\\项ç®WBS导åº.xlsx"; |
| | | fme.isDiZai = "NO"; |
| | | fme.diZaiType = "NO"; |
| | | |
| | | String rs = fmeService.checkMain(fme, req); |
| | | if (StringHelper.isEmpty(rs)) { |
| | | return fail("æ£æ¥å¤±è´¥"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | }*/ |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.controller.data.upload; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.metadata.OrderItem; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.lf.server.annotation.SysLog; |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.all.StaticData; |
| | | import com.lf.server.entity.ctrl.TabEntity; |
| | | import com.lf.server.entity.data.*; |
| | | import com.lf.server.entity.sys.DepEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.ClassHelper; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.mapper.all.BasicMapper; |
| | | import com.lf.server.service.all.BaseQueryService; |
| | | import com.lf.server.service.data.*; |
| | | import com.lf.server.service.sys.DepService; |
| | | import com.lf.server.service.sys.TokenService; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ§å¶å¨ |
| | | * @author WWW |
| | | */ |
| | | public class QueryController extends CheckController { |
| | | @Autowired |
| | | protected DepService depService; |
| | | |
| | | @Autowired |
| | | protected DirService dirService; |
| | | |
| | | @Autowired |
| | | protected VerService verService; |
| | | |
| | | @Autowired |
| | | protected MetaService metaService; |
| | | |
| | | @Autowired |
| | | protected TokenService tokenService; |
| | | |
| | | @Autowired |
| | | protected UploadService uploadService; |
| | | |
| | | @Autowired |
| | | protected BaseQueryService baseQueryService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææåä½") |
| | | @GetMapping(value = "/selectDepAll") |
| | | public ResponseMsg<List<DepEntity>> selectDepAll() { |
| | | try { |
| | | List<DepEntity> list = depService.selectDepAll(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææç®å½") |
| | | @GetMapping(value = "/selectDirAll") |
| | | public ResponseMsg<List<DirEntity>> selectDirAll() { |
| | | try { |
| | | List<DirEntity> list = dirService.selectDirAll(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®ç®å½IDæ¥è¯¢çæ¬å表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "dirid", value = "ç®å½ID", dataType = "Integer", paramType = "query") |
| | | }) |
| | | @GetMapping(value = "/selectVerByDirid") |
| | | public ResponseMsg<List<VerEntity>> selectVerByDirid(Integer dirid) { |
| | | try { |
| | | if (null == dirid || dirid < 0) { |
| | | dirid = 0; |
| | | } |
| | | |
| | | List<VerEntity> list = verService.selectByDirid(dirid); |
| | | if (null == list || list.isEmpty()) { |
| | | list = verService.selectByDirid(0); |
| | | } |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢åæ ç³»") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "zoning", value = "带å·", dataType = "String", paramType = "query", example = "6度æå¸¦å·") |
| | | }) |
| | | @GetMapping(value = "/selectCoords") |
| | | public ResponseMsg<Object> selectCoords(String zoning) { |
| | | try { |
| | | List<CoordEntity> list = uploadService.selectCoords(zoning); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢é¡¹ç®åç§°") |
| | | @GetMapping(value = "/selectProject") |
| | | public ResponseMsg<Object> selectProject() { |
| | | try { |
| | | List<DirEntity> list = uploadService.selectProject(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææè¡¨") |
| | | @GetMapping(value = "/selectTabs") |
| | | public ResponseMsg<List<TabEntity>> selectTabs() { |
| | | try { |
| | | List<TabEntity> list = baseQueryService.selectTabs(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢å段信æ¯") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ns", value = "å称空é´", dataType = "String", paramType = "query", example = "bd"), |
| | | @ApiImplicitParam(name = "tab", value = "表å", dataType = "String", paramType = "query", example = "dlg25wAanp") |
| | | }) |
| | | @GetMapping(value = "/selectFields") |
| | | public ResponseMsg<List<DictEntity>> selectFields(String ns, String tab) { |
| | | try { |
| | | if (StringHelper.isEmpty(ns) || StringHelper.isEmpty(tab)) { |
| | | return fail("å称空é´å表åä¸è½ä¸ºç©º", null); |
| | | } |
| | | |
| | | List<DictEntity> list = baseQueryService.selectFields(ns, tab); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è¡¨ä¸æ°æ®") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "å
æ°æ®ID", dataType = "Integer", paramType = "query", example = "115"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "å页æ°ï¼ä»1å¼å§ï¼", dataType = "Integer", paramType = "query", example = "1"), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯é¡µæ¡æ°", dataType = "Integer", paramType = "query", example = "10") |
| | | }) |
| | | @GetMapping(value = "/selectDbData") |
| | | public ResponseMsg<Object> selectDbData(Integer id, Integer pageIndex, Integer pageSize) { |
| | | // noinspection AlibabaRemoveCommentedCode |
| | | try { |
| | | if (null == id || id < 0) { |
| | | return fail("å
æ°æ®IDä¸è½ä¸ºç©ºæå°äº0", null); |
| | | } |
| | | |
| | | MetaEntity meta = metaService.selectById(id); |
| | | if (null == meta || null == meta.getTab() || !meta.getTab().contains(StaticData.POINT)) { |
| | | return fail("æ¾ä¸å°å
æ°æ®ä¿¡æ¯", null); |
| | | } |
| | | |
| | | String entity = meta.getTab().substring(meta.getTab().indexOf(".") + 1).replace("_", "").toLowerCase(); |
| | | BasicMapper baseMapper = ClassHelper.getBasicMapper(entity); |
| | | if (null == baseMapper) { |
| | | return null; |
| | | } |
| | | |
| | | QueryWrapper wrapper = new QueryWrapper(); |
| | | wrapper.eq("parentid", meta.getEventid()); |
| | | |
| | | Page<Object> page = new Page<>(pageIndex, pageSize); |
| | | page.addOrder(OrderItem.asc("gid")); |
| | | IPage<Object> paged = baseMapper.selectPage(page, wrapper); |
| | | |
| | | return success(paged.getTotal(), paged.getRecords()); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢ä¸ä¼ æ°æ®å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "åç§°", dataType = "String", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯é¡µæ¡æ°", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "å页æ°ï¼ä»1å¼å§ï¼", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPageForUpload") |
| | | public ResponseMsg<Object> selectByPageForUpload(String name, Integer pageSize, Integer pageIndex, HttpServletRequest req) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | |
| | | int count = metaService.selectCountForUpload(name, ue.getId(), null); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<MetaEntity> list = metaService.selectByPageForUpload(name, ue.getId(), null, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.controller.data.upload; |
| | | |
| | | import com.lf.server.annotation.SysLog; |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.all.StaticData; |
| | | import com.lf.server.entity.data.DirEntity; |
| | | import com.lf.server.entity.data.MetaEntity; |
| | | import com.lf.server.entity.data.MetaFileEntity; |
| | | import com.lf.server.entity.data.VerEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.service.data.UploadService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ°æ®å
¥åº |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "æ°æ®ç®¡ç\\æ°æ®ä¸ä¼ ") |
| | | @RestController |
| | | @RequestMapping("/dataUpload") |
| | | public class UploadController extends QueryController { |
| | | @Autowired |
| | | UploadService uploadService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è·¯å¾") |
| | | @GetMapping(value = "/selectPath") |
| | | public ResponseMsg<String> selectPath() { |
| | | try { |
| | | String pathName = uploadService.selectPath(); |
| | | |
| | | return success(pathName); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ä¸ä¼ æä»¶") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "path", value = "è·¯å¾", dataType = "String", paramType = "query") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/uploadFiles") |
| | | public ResponseMsg<Object> uploadFiles(String path, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | List<MetaFileEntity> list = uploadService.uploadData(null, path, req, res); |
| | | if (null == list || list.isEmpty()) { |
| | | return fail("æ²¡ææ¾å°ä¸ä¼ æä»¶", null); |
| | | } |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢æä»¶") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "path", value = "è·¯å¾", dataType = "String", paramType = "query") |
| | | }) |
| | | @GetMapping(value = "/selectFiles") |
| | | public ResponseMsg<List<MetaFileEntity>> selectFiles(String path) { |
| | | try { |
| | | List<MetaFileEntity> list = uploadService.selectFiles(path, StaticData.ALL_EXTENSION); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å 餿件") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "MetaEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/deleteFiles") |
| | | public ResponseMsg<Object> deleteFiles(@RequestBody List<MetaFileEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | | return fail("ç¨æ·æªç»å½", null); |
| | | } |
| | | if (null == list || list.isEmpty()) { |
| | | return fail("æ²¡ææ¾å°æä»¶", null); |
| | | } |
| | | |
| | | int rows = uploadService.deleteFiles(list); |
| | | |
| | | return success("æå", rows); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢æ å°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "path", value = "è·¯å¾", dataType = "String", paramType = "query", example = "20230110010101"), |
| | | @ApiImplicitParam(name = "dirid", value = "ç®å½ID", dataType = "Integer", paramType = "query", example = "163"), |
| | | @ApiImplicitParam(name = "verid", value = "çæ¬ID", dataType = "Integer", paramType = "query", example = "0"), |
| | | @ApiImplicitParam(name = "epsgCode", value = "åæ ç¼ç ", dataType = "String", paramType = "query", example = "EPSG:4490") |
| | | }) |
| | | @GetMapping(value = "/selectMappers") |
| | | public ResponseMsg<Object> selectMappers(String path, Integer dirid, Integer verid, String epsgCode, HttpServletRequest req) { |
| | | try { |
| | | if (StringHelper.isEmpty(path) || StringHelper.isEmpty(epsgCode) || null == dirid || null == verid) { |
| | | return fail("è·¯å¾ãç®å½IDãçæ¬IDååæ ç¼ç ä¸è½ä¸ºç©º"); |
| | | } |
| | | if (1 > uploadService.selectCount4Coord(epsgCode)) { |
| | | return fail("åæ ç¼ç " + epsgCode + "ä¸åå¨"); |
| | | } |
| | | DirEntity dir = dirService.selectDir(dirid); |
| | | if (null == dir) { |
| | | return fail("ç®å½ID=" + dirid + "ä¸åå¨"); |
| | | } |
| | | VerEntity ver = verService.selectVersion(verid); |
| | | if (null == ver) { |
| | | return fail("çæ¬ID=" + verid + "ä¸åå¨"); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | List<MetaFileEntity> list = uploadService.selectMappers(ue, path, dir, ver, epsgCode); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥æä»¶") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å
æ°æ®æä»¶éå", dataType = "MetaFileEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/insertFiles") |
| | | public ResponseMsg<Object> insertFiles(@RequestBody List<MetaFileEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (null == ue) { |
| | | return fail("ç¨æ·æªç»å½", null); |
| | | } |
| | | if (null == list || list.isEmpty()) { |
| | | return fail("å
æ°æ®æä»¶éå为空", null); |
| | | } |
| | | |
| | | List<MetaEntity> metas = uploadService.insertFiles(ue, list, req); |
| | | |
| | | return success("æå", metas); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å é¤å
æ°æ®") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "IDæ°ç»", dataType = "Integer", paramType = "query", example = "1,2") |
| | | }) |
| | | @GetMapping(value = "/deleteMetas") |
| | | public ResponseMsg<Integer> deleteMetas(@RequestParam List<Integer> ids) { |
| | | try { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return fail("idæ°ç»ä¸è½ä¸ºç©º", -1); |
| | | } |
| | | |
| | | int count = metaService.deletes(ids); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | reqEntity.setPwd(AesHelper.decrypt(reqEntity.getPwd())); |
| | | if (!StringHelper.checkPwdValid(reqEntity.getPwd())) { |
| | | if (StringHelper.isPwdInvalid(reqEntity.getPwd())) { |
| | | return fail("å¯ç ä¸ç¬¦åè¦æ±"); |
| | | } |
| | | |
| | |
| | | import com.lf.server.entity.ctrl.DownloadReqEntity; |
| | | import com.lf.server.entity.data.DownloadEntity; |
| | | import com.lf.server.entity.data.MetaEntity; |
| | | import com.lf.server.entity.data.MetaFileEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.*; |
| | | import com.lf.server.mapper.all.BasicMapper; |
| | |
| | | if (!DownloadService.decryptPwd(reqEntity)) { |
| | | return fail("å¯ç è§£å¯å¤±è´¥", null); |
| | | } |
| | | if (!StringHelper.checkPwdValid(reqEntity.getPwd())) { |
| | | if (StringHelper.isPwdInvalid(reqEntity.getPwd())) { |
| | | return fail("å¯ç ä¸ç¬¦åè¦æ±"); |
| | | } |
| | | |
| | | List<MetaFileEntity> list = metaService.selectMetaFiles(reqEntity.getIds()); |
| | | List<MetaEntity> list = metaService.selectMetaFiles(reqEntity.getIds()); |
| | | if (null == list || list.isEmpty()) { |
| | | return fail("æ²¡ææ¾å°å
æ°æ®"); |
| | | } |
| | |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.AesHelper; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.service.data.UploaderService; |
| | | import com.lf.server.service.all.BaseUploadService; |
| | | import com.lf.server.service.show.InquiryService; |
| | | import com.lf.server.service.sys.TokenService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | UploaderService uploaderService; |
| | | BaseUploadService baseUploadService; |
| | | |
| | | @Autowired |
| | | InquiryService inquiryService; |
| | |
| | | return fail("ç¨æ·æªç»å½", null); |
| | | } |
| | | |
| | | List<MetaFileEntity> list = uploaderService.uploadData(null, null, req, res); |
| | | List<MetaFileEntity> list = baseUploadService.uploadData(null, null, req, res); |
| | | if (list == null || list.size() < StaticData.FOUR) { |
| | | return fail("æ²¡ææ¾å°å·²ä¸ä¼ çæ°æ®æä¸å®æ´", null); |
| | | } |
| | |
| | | import com.lf.server.controller.all.BaseController; |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.bd.DlgagnpEntity; |
| | | import com.lf.server.service.data.UploaderService; |
| | | import com.lf.server.service.data.UploadService; |
| | | import com.lf.server.service.show.LocateService; |
| | | import com.lf.server.service.sys.TokenService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | UploaderService uploaderService; |
| | | UploadService uploaderService; |
| | | |
| | | @Autowired |
| | | LocateService locateService; |
| | |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.helper.WebHelper; |
| | | import com.lf.server.service.all.BaseUploadService; |
| | | import com.lf.server.service.data.DownloadService; |
| | | import com.lf.server.service.data.UploaderService; |
| | | import com.lf.server.service.show.MarkService; |
| | | import com.lf.server.service.sys.DownlogService; |
| | | import com.lf.server.service.sys.TokenService; |
| | |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | UploaderService uploaderService; |
| | | BaseUploadService baseUploadService; |
| | | |
| | | @Autowired |
| | | DownlogService downlogService; |
| | |
| | | @ApiOperation(value = "ä¸ä¼ ShapeFileæä»¶") |
| | | @ResponseBody |
| | | @PostMapping(value = "/uploadShp", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<List<MarkJsonEntity>> uploadShp(HttpServletRequest req, HttpServletResponse res) { |
| | | public ResponseMsg<Object> uploadShp(HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | | return fail("ç¨æ·æªç»å½", null); |
| | | } |
| | | |
| | | List<MetaFileEntity> meList = uploaderService.uploadData(null, null, req, res); |
| | | List<MetaFileEntity> meList = baseUploadService.uploadData(null, null, req, res); |
| | | if (meList == null || meList.size() < StaticData.FOUR) { |
| | | return fail("æ²¡ææ¾å°å·²ä¸ä¼ çæ°æ®æä¸å®æ´", null); |
| | | } |
| | |
| | | if (!DownloadService.decryptPwd(pe)) { |
| | | return fail("å¯ç è§£å¯å¤±è´¥", null); |
| | | } |
| | | if (!StringHelper.checkPwdValid(pe.getPwd())) { |
| | | if (StringHelper.isPwdInvalid(pe.getPwd())) { |
| | | return fail("å¯ç ä¸ç¬¦åè¦æ±"); |
| | | } |
| | | |
| | |
| | | @ApiImplicitParam(name = "name", value = "èååç§°", dataType = "String", paramType = "query", required = false, example = "管éåºç¡å¤§æ°æ®å¹³å°") |
| | | }) |
| | | @GetMapping(value = "/selectMenuRecursive") |
| | | public ResponseMsg<List<DirEntity>> selectMenuRecursive(String name) { |
| | | public ResponseMsg<Object> selectMenuRecursive(String name) { |
| | | try { |
| | | if (StringHelper.isEmpty(name)) { |
| | | name = "管éåºç¡å¤§æ°æ®å¹³å°"; |
| | | } |
| | | List<DirEntity> list = menuService.selectMenuRecursive(name); |
| | | List<MenuEntity> list = menuService.selectMenuRecursive(name); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | |
| | | |
| | | private String eventid; |
| | | |
| | | private String parentid; |
| | | |
| | | private Integer dirid; |
| | | |
| | | private Integer depid; |
| | |
| | | this.eventid = eventid; |
| | | } |
| | | |
| | | public String getParentid() { |
| | | return parentid; |
| | | } |
| | | |
| | | public void setParentid(String parentid) { |
| | | this.parentid = parentid; |
| | | } |
| | | |
| | | public Integer getDirid() { |
| | | return dirid; |
| | | } |
| | |
| | | public static int CACHE_EXPIRE = 240; |
| | | |
| | | /** |
| | | * æå¤§æä»¶æ° |
| | | * æå¤§æä»¶æ°ï¼2000 |
| | | */ |
| | | public static int MAX_FILES = 2000; |
| | | public static int MAX_FILES = 2001; |
| | | |
| | | /** |
| | | * Cookieæææï¼s |
| | |
| | | */ |
| | | public class StaticData { |
| | | /** |
| | | * æéæé¤è·¯å¾ï¼/proxy |
| | | * æéæé¤è·¯å¾ï¼/proxyï¼è¦æ±å
¨é¨å°å |
| | | */ |
| | | public static String[] EXCLUDE_PATH = new String[]{"/swagger", "/sign/", "/error", "/floatserver"}; |
| | | public static String[] EXCLUDE_PATH = new String[]{"/swagger", "/sign/", "/fmeit/", "/perms/", "/floatserver/", "/error"}; |
| | | |
| | | /** |
| | | * æ°å¼ï¼4 |
| | |
| | | public static final double D1050 = 1050.0; |
| | | |
| | | /** |
| | | * 16è¿å¶ |
| | | * çå· |
| | | */ |
| | | public static final char[] HEX_DIGITS = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; |
| | | public final static String EQ = "="; |
| | | |
| | | /** |
| | | * åç¬¦ç¹ |
| | |
| | | public final static String POINT = "."; |
| | | |
| | | /** |
| | | * çå· |
| | | * éå· |
| | | */ |
| | | public final static String EQ = "="; |
| | | public final static String COMMA = ","; |
| | | |
| | | /** |
| | | * æ£ææ |
| | | */ |
| | | public final static String SLASH = "/"; |
| | | |
| | | /** |
| | | * zipæä»¶ |
| | | */ |
| | | public final static String ZIP = ".zip"; |
| | | |
| | | /** |
| | | * xlsæä»¶ |
| | | */ |
| | | public final static String XLS = ".xls"; |
| | | |
| | | /** |
| | | * xlsxæä»¶ |
| | | */ |
| | | public final static String XLSX = ".xlsx"; |
| | | |
| | | /** |
| | | * MDBæä»¶ |
| | | */ |
| | | public final static String MDB = ".mdb"; |
| | | |
| | | /** |
| | | * SHPæä»¶ |
| | | */ |
| | | public final static String SHP = ".shp"; |
| | | |
| | | /** |
| | | * GDBæä»¶ |
| | | */ |
| | | public final static String GDB = ".gdb"; |
| | | |
| | | /** |
| | | * IMGæä»¶ |
| | | */ |
| | | public final static String IMG = ".img"; |
| | | |
| | | /** |
| | | * MPTæä»¶ |
| | | */ |
| | | public final static String MPT = ".mpt"; |
| | | |
| | | /** |
| | | * TIFæä»¶ |
| | | */ |
| | | public final static String TIF = ".tif"; |
| | | |
| | | /** |
| | | * TIFFæä»¶ |
| | | */ |
| | | public final static String TIFF = ".tiff"; |
| | | |
| | | /** |
| | | * çæ¬å· |
| | |
| | | public final static String TOKEN_COOKIE_KEY = "token"; |
| | | |
| | | /** |
| | | * ææ¬ç¼ç æ¹å¼ |
| | | */ |
| | | public final static String TEXT_ENCODER = "UTF-8"; |
| | | |
| | | /** |
| | | * æ»è´¨æ£ |
| | | */ |
| | | public final static String CHECK_MAIN = "checkMain"; |
| | | |
| | | /** |
| | | * Object对象 |
| | | */ |
| | | public final static String OBJECT = "java.lang.Object"; |
| | | |
| | | /** |
| | | * Cookieä¸druidé® |
| | | */ |
| | | public final static String DRUID_COOKIE_KEY = "JSESSIONID"; |
| | | |
| | | /** |
| | | * ææ¬ç¼ç æ¹å¼ |
| | | * ä¸ä¼ æä»¶ç±»å * |
| | | */ |
| | | public final static String TEXT_ENCODER = "UTF-8"; |
| | | public final static String FILE_TYPES = "'xls','shp','gdb','mdb'"; |
| | | |
| | | /** |
| | | * 16è¿å¶ |
| | | */ |
| | | public static final char[] HEX_DIGITS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; |
| | | |
| | | /** |
| | | * å¯ç æ£åè¡¨è¾¾å¼ |
| | |
| | | public final static String PWD_REG = "^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![a-z0-9]+$)(?![a-z\\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![0-9\\W!@#$%^&*`~()\\-_+=,.?;<>]+$)[a-zA-Z0-9\\W!@#$%^&*`~()\\-_+=,.?;<>]{12,20}$"; |
| | | |
| | | /** |
| | | * ä¸ä¼ æä»¶ç±»å |
| | | * MPTæä»¶æ©å±å |
| | | */ |
| | | public final static String FILE_TYPES = "'xls','shp','gdb','mdb'"; |
| | | public final static List<String> MPT_EXT = new ArrayList<>(Arrays.asList(".midx", ".strmi")); |
| | | |
| | | /** |
| | | * Object对象 |
| | | * IMGæä»¶æ©å±å |
| | | */ |
| | | public final static String OBJECT = "java.lang.Object"; |
| | | public final static List<String> IMG_EXT = new ArrayList<>(Arrays.asList(".rrd", ".img.aux.xml", ".hdr", ".img.enp", ".img.xml")); |
| | | |
| | | /** |
| | | * TIFæä»¶æ©å±å |
| | | */ |
| | | public final static List<String> TIF_EXT = new ArrayList<>(Arrays.asList(".prj", ".tfw", ".tif.ovr", ".tif.aux.xml", ".tif.enp", ".tif.xml")); |
| | | |
| | | /** |
| | | * TIFFæä»¶æ©å±å |
| | | */ |
| | | public final static List<String> TIFF_EXT = new ArrayList<>(Arrays.asList(".prj", ".tfw", ".tiff.ovr", ".tiff.aux.xml", ".tiff.enp", ".tiff.xml")); |
| | | |
| | | /** |
| | | * SHPæä»¶æ©å±å |
| | | */ |
| | | public final static List<String> SHP_EXT = new ArrayList<>(Arrays.asList(".shx", ".dbf", ".prj", ".cpg")); |
| | | |
| | | /** |
| | | * æææä»¶æ©å±å |
| | | */ |
| | | public final static List<String> ALL_EXTENSION = new ArrayList<>(Arrays.asList(".txt", ".xml", ".pdf", ".xls", ".xlsx", ".doc", ".docx", ".ppt", ".pptx", ".shp", ".gdb", ".mdb", ".dwg", ".las", ".laz", ".cpt", ".mpt", ".fly", ".efb", ".g3d", ".fbx", ".obj", ".3dm", ".3dml", ".osgb", ".rvt", ".ifc", ".jpg", ".png", ".img", ".tif", ".tiff", ".bmp", ".gif", ".rmvb", ".rm", ".mp3", ".mp4", ".avi", ".wma", ".wmv", ".7z", ".rar", ".zip")); |
| | | |
| | | /** |
| | | * æå
¥æé¤å段 |
| | |
| | | this.path = path; |
| | | } |
| | | |
| | | public BigDecimal getx() { |
| | | public BigDecimal getX() { |
| | | return x; |
| | | } |
| | | |
| | | public void setx(BigDecimal x) { |
| | | public void setX(BigDecimal x) { |
| | | this.x = x; |
| | | } |
| | | |
| | | public BigDecimal gety() { |
| | | public BigDecimal getY() { |
| | | return y; |
| | | } |
| | | |
| | | public void sety(BigDecimal y) { |
| | | public void setY(BigDecimal y) { |
| | | this.y = y; |
| | | } |
| | | |
| | |
| | | this.pipename = pipename; |
| | | } |
| | | |
| | | public BigDecimal getx() { |
| | | public BigDecimal getX() { |
| | | return x; |
| | | } |
| | | |
| | | public void setx(BigDecimal x) { |
| | | public void setX(BigDecimal x) { |
| | | this.x = x; |
| | | } |
| | | |
| | | public BigDecimal gety() { |
| | | public BigDecimal getY() { |
| | | return y; |
| | | } |
| | | |
| | | public void sety(BigDecimal y) { |
| | | public void setY(BigDecimal y) { |
| | | this.y = y; |
| | | } |
| | | |
| | |
| | | this.surveydate = surveydate; |
| | | } |
| | | |
| | | public BigDecimal getx() { |
| | | public BigDecimal getX() { |
| | | return x; |
| | | } |
| | | |
| | | public void setx(BigDecimal x) { |
| | | public void setX(BigDecimal x) { |
| | | this.x = x; |
| | | } |
| | | |
| | | public BigDecimal gety() { |
| | | public BigDecimal getY() { |
| | | return y; |
| | | } |
| | | |
| | | public void sety(BigDecimal y) { |
| | | public void setY(BigDecimal y) { |
| | | this.y = y; |
| | | } |
| | | |
| | |
| | | this.pipename = pipename; |
| | | } |
| | | |
| | | public BigDecimal getx() { |
| | | public BigDecimal getX() { |
| | | return x; |
| | | } |
| | | |
| | | public void setx(BigDecimal x) { |
| | | public void setX(BigDecimal x) { |
| | | this.x = x; |
| | | } |
| | | |
| | | public BigDecimal gety() { |
| | | public BigDecimal getY() { |
| | | return y; |
| | | } |
| | | |
| | | public void sety(BigDecimal y) { |
| | | public void setY(BigDecimal y) { |
| | | this.y = y; |
| | | } |
| | | |
| | |
| | | this.pipename = pipename; |
| | | } |
| | | |
| | | public BigDecimal getx() { |
| | | public BigDecimal getX() { |
| | | return x; |
| | | } |
| | | |
| | | public void setx(BigDecimal x) { |
| | | public void setX(BigDecimal x) { |
| | | this.x = x; |
| | | } |
| | | |
| | | public BigDecimal gety() { |
| | | public BigDecimal getY() { |
| | | return y; |
| | | } |
| | | |
| | | public void sety(BigDecimal y) { |
| | | public void setY(BigDecimal y) { |
| | | this.y = y; |
| | | } |
| | | |
| | |
| | | this.pipename = pipename; |
| | | } |
| | | |
| | | public BigDecimal getx() { |
| | | public BigDecimal getX() { |
| | | return x; |
| | | } |
| | | |
| | | public void setx(BigDecimal x) { |
| | | public void setX(BigDecimal x) { |
| | | this.x = x; |
| | | } |
| | | |
| | | public BigDecimal gety() { |
| | | public BigDecimal getY() { |
| | | return y; |
| | | } |
| | | |
| | | public void sety(BigDecimal y) { |
| | | public void setY(BigDecimal y) { |
| | | this.y = y; |
| | | } |
| | | |
| | |
| | | this.meadate = meadate; |
| | | } |
| | | |
| | | public BigDecimal getx() { |
| | | public BigDecimal getX() { |
| | | return x; |
| | | } |
| | | |
| | | public void setx(BigDecimal x) { |
| | | public void setX(BigDecimal x) { |
| | | this.x = x; |
| | | } |
| | | |
| | | public BigDecimal gety() { |
| | | public BigDecimal getY() { |
| | | return y; |
| | | } |
| | | |
| | | public void sety(BigDecimal y) { |
| | | public void setY(BigDecimal y) { |
| | | this.y = y; |
| | | } |
| | | |
| | |
| | | this.stavalue = stavalue; |
| | | } |
| | | |
| | | public BigDecimal getx() { |
| | | public BigDecimal getX() { |
| | | return x; |
| | | } |
| | | |
| | | public void setx(BigDecimal x) { |
| | | public void setX(BigDecimal x) { |
| | | this.x = x; |
| | | } |
| | | |
| | | public BigDecimal gety() { |
| | | public BigDecimal getY() { |
| | | return y; |
| | | } |
| | | |
| | | public void sety(BigDecimal y) { |
| | | public void setY(BigDecimal y) { |
| | | this.y = y; |
| | | } |
| | | |
| | |
| | | this.pointnum = pointnum; |
| | | } |
| | | |
| | | public BigDecimal getx() { |
| | | public BigDecimal getX() { |
| | | return x; |
| | | } |
| | | |
| | | public void setx(BigDecimal x) { |
| | | public void setX(BigDecimal x) { |
| | | this.x = x; |
| | | } |
| | | |
| | | public BigDecimal gety() { |
| | | public BigDecimal getY() { |
| | | return y; |
| | | } |
| | | |
| | | public void sety(BigDecimal y) { |
| | | public void setY(BigDecimal y) { |
| | | this.y = y; |
| | | } |
| | | |
| | |
| | | this.pipename = pipename; |
| | | } |
| | | |
| | | public BigDecimal getx() { |
| | | public BigDecimal getX() { |
| | | return x; |
| | | } |
| | | |
| | | public void setx(BigDecimal x) { |
| | | public void setX(BigDecimal x) { |
| | | this.x = x; |
| | | } |
| | | |
| | | public BigDecimal gety() { |
| | | public BigDecimal getY() { |
| | | return y; |
| | | } |
| | | |
| | | public void sety(BigDecimal y) { |
| | | public void setY(BigDecimal y) { |
| | | this.y = y; |
| | | } |
| | | |
| | |
| | | this.projname = projname; |
| | | } |
| | | |
| | | public BigDecimal getx() { |
| | | public BigDecimal getX() { |
| | | return x; |
| | | } |
| | | |
| | | public void setx(BigDecimal x) { |
| | | public void setX(BigDecimal x) { |
| | | this.x = x; |
| | | } |
| | | |
| | | public BigDecimal gety() { |
| | | public BigDecimal getY() { |
| | | return y; |
| | | } |
| | | |
| | | public void sety(BigDecimal y) { |
| | | public void setY(BigDecimal y) { |
| | | this.y = y; |
| | | } |
| | | |
| | |
| | | this.exppointid = exppointid; |
| | | } |
| | | |
| | | public BigDecimal getx() { |
| | | public BigDecimal getX() { |
| | | return x; |
| | | } |
| | | |
| | | public void setx(BigDecimal x) { |
| | | public void setX(BigDecimal x) { |
| | | this.x = x; |
| | | } |
| | | |
| | | public BigDecimal gety() { |
| | | public BigDecimal getY() { |
| | | return y; |
| | | } |
| | | |
| | | public void sety(BigDecimal y) { |
| | | public void setY(BigDecimal y) { |
| | | this.y = y; |
| | | } |
| | | |
| | |
| | | this.projname = projname; |
| | | } |
| | | |
| | | public BigDecimal getx() { |
| | | public BigDecimal getX() { |
| | | return x; |
| | | } |
| | | |
| | | public void setx(BigDecimal x) { |
| | | public void setX(BigDecimal x) { |
| | | this.x = x; |
| | | } |
| | | |
| | | public BigDecimal gety() { |
| | | public BigDecimal getY() { |
| | | return y; |
| | | } |
| | | |
| | | public void sety(BigDecimal y) { |
| | | public void setY(BigDecimal y) { |
| | | this.y = y; |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.entity.ctrl; |
| | | |
| | | /** |
| | | * FME请æ±å®ä½ç±» |
| | | * @author WWW |
| | | */ |
| | | public class FmeReqEntity { |
| | | public FmeReqEntity() { |
| | | } |
| | | |
| | | /** |
| | | * ä»»å¡åç§° |
| | | */ |
| | | public String names; |
| | | |
| | | /** |
| | | * 项ç®åç§° |
| | | */ |
| | | public String xmmc; |
| | | |
| | | /** |
| | | * æ°æ®ä¸ä¸ï¼æµéä¸ä¸ | åå¯ä¸ä¸ | å°ç¾ä¸ä¸ | æ´åºä¸ä¸ |
| | | */ |
| | | public String sjzy; |
| | | |
| | | /** |
| | | * å¾
æ£å缩å
|
| | | */ |
| | | public String zipPath; |
| | | |
| | | /** |
| | | * WBSè¡¨æ ¼ |
| | | */ |
| | | public String wbsPath; |
| | | |
| | | /** |
| | | * æ¯/å¦ä¸ºå°ç¾æ°æ®ï¼YES | NO |
| | | */ |
| | | public String isDiZai; |
| | | |
| | | /** |
| | | * å°ç¾æ°æ®ç±»åï¼ï¼å´©å¡æ²»ç | ä¸ç¨³å®æå¡æ²»ç | å°é¢å¡é·æ²»ç | é«é¡è¾¹å¡æ²»ç | æ³¥ç³æµæ²»ç | æ°´æ¯æ²»ç | æ»å¡æ²»çï¼ | NO |
| | | */ |
| | | public String diZaiType; |
| | | |
| | | /** |
| | | * åæ ç³»ï¼EPSG:4326 |
| | | */ |
| | | public String coordinateSystem; |
| | | |
| | | /** |
| | | * å½±åå辨çï¼é»è®¤0.2mï¼ |
| | | */ |
| | | public double imgResolution = 0.2; |
| | | |
| | | /** |
| | | * é¢/线/ç¹éå 容差 |
| | | */ |
| | | public double tolerance = 0.001; |
| | | |
| | | /** |
| | | * é«ç¨ç¹é´è·ä¸é |
| | | */ |
| | | public double gcdOffset = 20; |
| | | |
| | | /** |
| | | * æ§å¶ç¹é´è·ä¸é |
| | | */ |
| | | public double kzdOffset = 100; |
| | | |
| | | /** |
| | | * æµåºèå´ï¼ç±³ï¼ |
| | | */ |
| | | public double rangeOffset = 200; |
| | | |
| | | /** |
| | | * æ¬æçº¿æå¤§è·ç¦» |
| | | */ |
| | | public double xgMax = 0.005; |
| | | |
| | | /** |
| | | * é«ç¨ä¸è¯¯å·®ï¼mï¼ |
| | | */ |
| | | public double demTolerance = 5; |
| | | |
| | | /** |
| | | * é«ç¨å¼çªåç(é»è®¤å¼200) |
| | | */ |
| | | public double demChangeRate = 200; |
| | | |
| | | /** |
| | | * ç¹äºå¯åº¦ï¼é»è®¤1/m3ï¼ |
| | | */ |
| | | public double lazDensity = 1; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.entity.ctrl; |
| | | |
| | | /** |
| | | * åç§°å¼å¯¹å®ä½ç±» |
| | | * @author WWW |
| | | */ |
| | | public class NameValueEntity { |
| | | private String name; |
| | | |
| | | private Object value; |
| | | |
| | | public NameValueEntity() { |
| | | } |
| | | |
| | | public NameValueEntity(String name, Object value) { |
| | | this.name = name; |
| | | this.value = value; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public Object getValue() { |
| | | return value; |
| | | } |
| | | |
| | | public void setValue(Object value) { |
| | | this.value = value; |
| | | } |
| | | } |
| | |
| | | this.subPath = subPath; |
| | | } |
| | | |
| | | private String eventid; |
| | | |
| | | private int dirid; |
| | | |
| | | private int depid; |
| | | |
| | | private int verid; |
| | | |
| | | private String fileName; |
| | | |
| | | private String extName; |
| | | |
| | | private String type; |
| | | |
| | | private String tab; |
| | | |
| | | private String subPath; |
| | | |
| | | private String tab; |
| | | |
| | | private String entity; |
| | | |
| | | private Integer rows; |
| | | |
| | | public String getFileName() { |
| | | return fileName; |
| | | } |
| | | |
| | | public void setFileName(String fileName) { |
| | | this.fileName = fileName; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getTab() { |
| | | return tab; |
| | | } |
| | | |
| | | public void setTab(String tab) { |
| | | this.tab = tab; |
| | | } |
| | | |
| | | public String getSubPath() { |
| | | return subPath; |
| | | } |
| | | |
| | | public void setSubPath(String subPath) { |
| | | this.subPath = subPath; |
| | | } |
| | | |
| | | public String getEntity() { |
| | | return entity; |
| | | } |
| | | |
| | | public void setEntity(String entity) { |
| | | this.entity = entity; |
| | | } |
| | | |
| | | public Integer getRows() { |
| | | return rows; |
| | | } |
| | | |
| | | public void setRows(Integer rows) { |
| | | this.rows = rows; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.entity.data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * åæ ç³» |
| | | * @author WWW |
| | | */ |
| | | public class CoordEntity implements Serializable { |
| | | private static final long serialVersionUID = 5660360983928368364L; |
| | | |
| | | private Integer id; |
| | | |
| | | private String epsgcode; |
| | | |
| | | private String coordinate; |
| | | |
| | | private String zoning; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getEpsgcode() { |
| | | return epsgcode; |
| | | } |
| | | |
| | | public void setEpsgcode(String epsgcode) { |
| | | this.epsgcode = epsgcode; |
| | | } |
| | | |
| | | public String getCoordinate() { |
| | | return coordinate; |
| | | } |
| | | |
| | | public void setCoordinate(String coordinate) { |
| | | this.coordinate = coordinate; |
| | | } |
| | | |
| | | public String getZoning() { |
| | | return zoning; |
| | | } |
| | | |
| | | public void setZoning(String zoning) { |
| | | this.zoning = zoning; |
| | | } |
| | | } |
| | |
| | | |
| | | private String bak; |
| | | |
| | | private String fullName; |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | |
| | | public void setBak(String bak) { |
| | | this.bak = bak; |
| | | } |
| | | |
| | | public String getFullName() { |
| | | return fullName; |
| | | } |
| | | |
| | | public void setFullName(String fullName) { |
| | | this.fullName = fullName; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.entity.data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * FMEæ¥å¿è¡¨ |
| | | * @author WWW |
| | | */ |
| | | public class FmeLogEntity implements Serializable { |
| | | private static final long serialVersionUID = -1304153743551710249L; |
| | | |
| | | public FmeLogEntity() { |
| | | } |
| | | |
| | | private Integer id; |
| | | |
| | | private String parentid; |
| | | |
| | | private String dirpath; |
| | | |
| | | private String pgNs; |
| | | |
| | | private String tcmc; |
| | | |
| | | private String tcdm; |
| | | |
| | | private Integer count; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getParentid() { |
| | | return parentid; |
| | | } |
| | | |
| | | public void setParentid(String parentid) { |
| | | this.parentid = parentid; |
| | | } |
| | | |
| | | public String getDirpath() { |
| | | return dirpath; |
| | | } |
| | | |
| | | public void setDirpath(String dirpath) { |
| | | this.dirpath = dirpath; |
| | | } |
| | | |
| | | public String getPgNs() { |
| | | return pgNs; |
| | | } |
| | | |
| | | public void setPgNs(String pgNs) { |
| | | this.pgNs = pgNs; |
| | | } |
| | | |
| | | public String getTcmc() { |
| | | return tcmc; |
| | | } |
| | | |
| | | public void setTcmc(String tcmc) { |
| | | this.tcmc = tcmc; |
| | | } |
| | | |
| | | public String getTcdm() { |
| | | return tcdm; |
| | | } |
| | | |
| | | public void setTcdm(String tcdm) { |
| | | this.tcdm = tcdm; |
| | | } |
| | | |
| | | public Integer getCount() { |
| | | return count; |
| | | } |
| | | |
| | | public void setCount(Integer count) { |
| | | this.count = count; |
| | | } |
| | | } |
| | |
| | | * @author WWW |
| | | */ |
| | | public class MetaEntity implements Serializable { |
| | | private static final long serialVersionUID = -351865749970015936L; |
| | | private static final long serialVersionUID = -984838663593325184L; |
| | | |
| | | private int id; |
| | | |
| | | private String name; |
| | | private String eventid; |
| | | |
| | | private int metaid; |
| | | |
| | | private int dirid; |
| | | |
| | |
| | | |
| | | private int verid; |
| | | |
| | | private String name; |
| | | |
| | | private String type; |
| | | |
| | | private String guid; |
| | | |
| | | private String path; |
| | | |
| | | private double sizes; |
| | | |
| | | private String tab; |
| | | |
| | | private int rows; |
| | | |
| | | private String cs; |
| | | |
| | | private String scale; |
| | | |
| | | private String resolution; |
| | | |
| | | private Timestamp gather; |
| | | |
| | | private String batch; |
| | | |
| | | private String descr; |
| | | |
| | | private int createUser; |
| | | |
| | |
| | | private int updateUser; |
| | | |
| | | private Timestamp updateTime; |
| | | |
| | | private String bak; |
| | | |
| | | private String geom; |
| | | |
| | |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | public String getEventid() { |
| | | return eventid; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | public void setEventid(String eventid) { |
| | | this.eventid = eventid; |
| | | } |
| | | |
| | | public int getMetaid() { |
| | | return metaid; |
| | | } |
| | | |
| | | public void setMetaid(int metaid) { |
| | | this.metaid = metaid; |
| | | } |
| | | |
| | | public int getDirid() { |
| | |
| | | this.verid = verid; |
| | | } |
| | | |
| | | 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 String getGuid() { |
| | | return guid; |
| | | } |
| | | |
| | | public void setGuid(String guid) { |
| | | this.guid = guid; |
| | | } |
| | | |
| | | public String getPath() { |
| | | return path; |
| | | } |
| | | |
| | | public void setPath(String path) { |
| | | this.path = path; |
| | | } |
| | | |
| | | public double getSizes() { |
| | |
| | | |
| | | public void setRows(int rows) { |
| | | this.rows = rows; |
| | | } |
| | | |
| | | public String getCs() { |
| | | return cs; |
| | | } |
| | | |
| | | public void setCs(String cs) { |
| | | this.cs = cs; |
| | | } |
| | | |
| | | public String getScale() { |
| | | return scale; |
| | | } |
| | | |
| | | public void setScale(String scale) { |
| | | this.scale = scale; |
| | | } |
| | | |
| | | public String getResolution() { |
| | | return resolution; |
| | | } |
| | | |
| | | public void setResolution(String resolution) { |
| | | this.resolution = resolution; |
| | | } |
| | | |
| | | public Timestamp getGather() { |
| | | return gather; |
| | | } |
| | | |
| | | public void setGather(Timestamp gather) { |
| | | this.gather = gather; |
| | | } |
| | | |
| | | public String getBatch() { |
| | | return batch; |
| | | } |
| | | |
| | | public void setBatch(String batch) { |
| | | this.batch = batch; |
| | | } |
| | | |
| | | public String getDescr() { |
| | | return descr; |
| | | } |
| | | |
| | | public void setDescr(String descr) { |
| | | this.descr = descr; |
| | | } |
| | | |
| | | public int getCreateUser() { |
| | |
| | | this.updateTime = updateTime; |
| | | } |
| | | |
| | | public String getBak() { |
| | | return bak; |
| | | } |
| | | |
| | | public void setBak(String bak) { |
| | | this.bak = bak; |
| | | } |
| | | |
| | | public String getGeom() { |
| | | return geom; |
| | | } |
| | |
| | | * @author WWW |
| | | */ |
| | | public class MetaFileEntity implements Serializable { |
| | | private static final long serialVersionUID = -859236217038350336L; |
| | | private static final long serialVersionUID = -3688958480700165163L; |
| | | |
| | | private int id; |
| | | private String eventid; |
| | | |
| | | private int dirid; |
| | | |
| | | private int depid; |
| | | |
| | | private int verid; |
| | | |
| | | private String name; |
| | | |
| | | private int metaid; |
| | | |
| | | private int fileid; |
| | | private String type; |
| | | |
| | | private String guid; |
| | | |
| | |
| | | |
| | | private Timestamp createTime; |
| | | |
| | | private int updateUser; |
| | | private String extName; |
| | | |
| | | private Timestamp updateTime; |
| | | private String epsgCode; |
| | | |
| | | public MetaFileEntity() { |
| | | private String tab; |
| | | |
| | | private String entity; |
| | | |
| | | private int rows; |
| | | |
| | | private String msg; |
| | | |
| | | public String getEventid() { |
| | | return eventid; |
| | | } |
| | | |
| | | public int getId() { |
| | | return id; |
| | | public void setEventid(String eventid) { |
| | | this.eventid = eventid; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | public int getDirid() { |
| | | return dirid; |
| | | } |
| | | |
| | | public void setDirid(int dirid) { |
| | | this.dirid = dirid; |
| | | } |
| | | |
| | | public int getDepid() { |
| | | return depid; |
| | | } |
| | | |
| | | public void setDepid(int depid) { |
| | | this.depid = depid; |
| | | } |
| | | |
| | | public int getVerid() { |
| | | return verid; |
| | | } |
| | | |
| | | public void setVerid(int verid) { |
| | | this.verid = verid; |
| | | } |
| | | |
| | | public String getName() { |
| | |
| | | this.name = name; |
| | | } |
| | | |
| | | public int getMetaid() { |
| | | return metaid; |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setMetaid(int metaid) { |
| | | this.metaid = metaid; |
| | | } |
| | | |
| | | public int getFileid() { |
| | | return fileid; |
| | | } |
| | | |
| | | public void setFileid(int fileid) { |
| | | this.fileid = fileid; |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getGuid() { |
| | |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public int getUpdateUser() { |
| | | return updateUser; |
| | | public String getExtName() { |
| | | return extName; |
| | | } |
| | | |
| | | public void setUpdateUser(int updateUser) { |
| | | this.updateUser = updateUser; |
| | | public void setExtName(String extName) { |
| | | this.extName = extName; |
| | | } |
| | | |
| | | public Timestamp getUpdateTime() { |
| | | return updateTime; |
| | | public String getEpsgCode() { |
| | | return epsgCode; |
| | | } |
| | | |
| | | public void setUpdateTime(Timestamp updateTime) { |
| | | this.updateTime = updateTime; |
| | | public void setEpsgCode(String epsgCode) { |
| | | this.epsgCode = epsgCode; |
| | | } |
| | | |
| | | public String getTab() { |
| | | return tab; |
| | | } |
| | | |
| | | public void setTab(String tab) { |
| | | this.tab = tab; |
| | | } |
| | | |
| | | public String getEntity() { |
| | | return entity; |
| | | } |
| | | |
| | | public void setEntity(String entity) { |
| | | this.entity = entity; |
| | | } |
| | | |
| | | public int getRows() { |
| | | return rows; |
| | | } |
| | | |
| | | public void setRows(int rows) { |
| | | this.rows = rows; |
| | | } |
| | | |
| | | public String getMsg() { |
| | | return msg; |
| | | } |
| | | |
| | | public void setMsg(String msg) { |
| | | this.msg = msg; |
| | | } |
| | | } |
| | |
| | | import java.io.IOException; |
| | | import java.nio.ByteBuffer; |
| | | import java.nio.channels.FileChannel; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.security.MessageDigest; |
| | | import java.text.DecimalFormat; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * æä»¶å¸®å©ç±» |
| | |
| | | } |
| | | |
| | | /** |
| | | * è·åæä»¶MD5ç ï¼JDKï¼ |
| | | * 3.è·åæä»¶MD5ç ï¼JDKï¼ |
| | | */ |
| | | public static String getMd5ByJdk(String filePath) throws IOException { |
| | | FileInputStream fileStream = new FileInputStream(filePath); |
| | |
| | | } |
| | | |
| | | /** |
| | | * è·åå¿«é MD5 ç |
| | | * 2.è·åå¿«é MD5 ç |
| | | */ |
| | | public static String getFastMd5(String filePath) throws IOException { |
| | | String hash = MD5.asHex(MD5.getHash(new File(filePath))); |
| | |
| | | * @param file æä»¶ |
| | | */ |
| | | public static void deleteFiles(File file) { |
| | | if (file == null || !file.exists()) { |
| | | if (null == file || !file.exists()) { |
| | | return; |
| | | } |
| | | |
| | | if (file.isDirectory()) { |
| | | File[] files = file.listFiles(); |
| | | for (File f : files) { |
| | | if (f.isDirectory()) { |
| | | deleteFiles(f); |
| | | } else { |
| | | f.delete(); |
| | | if (null != files && files.length > 0) { |
| | | for (File f : files) { |
| | | if (f.isDirectory()) { |
| | | deleteFiles(f); |
| | | } else { |
| | | f.delete(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * è·åæä»¶çMD5 |
| | | * @param filePath |
| | | * @return |
| | | * 1.è·åæä»¶çMD5 |
| | | */ |
| | | @SuppressWarnings("unused") |
| | | public static String getFileMd5(String filePath) { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * åèç 转16è¿å¶ |
| | | */ |
| | | public static String byteToHexString(byte[] tmp) { |
| | | // æ¯ä¸ªåèç¨ 16 è¿å¶è¡¨ç¤ºçè¯ï¼ä½¿ç¨ä¸¤ä¸ªåç¬¦ï¼ |
| | | char[] str = new char[16 * 2]; |
| | |
| | | // æ¢åçç»æè½¬æ¢ä¸ºå符串 |
| | | return new String(str); |
| | | } |
| | | |
| | | /** |
| | | * è·åå符串çMD5ç |
| | | */ |
| | | public static String getStringMd5(String text) { |
| | | StringBuilder builder = new StringBuilder(); |
| | | try { |
| | | MessageDigest md5 = MessageDigest.getInstance("MD5"); |
| | | |
| | | byte[] bytes = md5.digest(text.getBytes(StandardCharsets.UTF_8)); |
| | | for (byte aByte : bytes) { |
| | | builder.append(Integer.toHexString((0x000000FF & aByte) | 0xFFFFFF00).substring(6)); |
| | | } |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | |
| | | return builder.toString(); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®è·¯å¾è·åæä»¶ |
| | | */ |
| | | public static void getFilesByPath(List<File> list, String path) { |
| | | File file = new File(path); |
| | | if (file.isDirectory()) { |
| | | File[] files = file.listFiles(); |
| | | if (null == files) { |
| | | return; |
| | | } |
| | | |
| | | for (File f : files) { |
| | | if (f.isDirectory()) { |
| | | getFilesByPath(list, f.getPath()); |
| | | } else { |
| | | list.add(f); |
| | | } |
| | | } |
| | | } else { |
| | | list.add(file); |
| | | } |
| | | } |
| | | } |
| | |
| | | // é
ç½®GDAL_DATAè·¯å¾ï¼gdalæ ¹ç®å½ä¸çbin\gdal-dataï¼ |
| | | // gdal.SetConfigOption("GDAL_DATA", "E:\\terrait\\TianJin\\Zip\\release-1928-x64-dev\\release-1928-x64\\bin\\gdal-data"); |
| | | // gdal.SetConfigOption("PROJ_LIB", "E:\\terrait\\TianJin\\Zip\\release-1928-x64-dev\\release-1928-x64\\bin\\proj7\\share"); |
| | | gdal.SetConfigOption("PROJ_LIB", "E:\\terrait\\TianJin\\Zip\\release-1928-x64-dev\\release-1928-x64\\bin\\proj7\\share"); |
| | | |
| | | // 为äºä½¿å±æ§è¡¨åæ®µæ¯æä¸æï¼è¯·æ·»å ä¸é¢è¿å¥ï¼CP936 |
| | | gdal.SetConfigOption("SHAPE_ENCODING", ""); |
| | |
| | | StringBuilder sb = new StringBuilder(pass); |
| | | |
| | | return sb.reverse().toString(); |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * Get请æ±-RestTemplate |
| | | * |
| | | * @param uri Uriå°å |
| | | * @return ååºå符串 |
| | | */ |
| | | public static String getForRest(String uri) { |
| | | try { |
| | | RestTemplate rest = getRestTemplate(); |
| | | |
| | | return rest.getForObject(uri, String.class); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | |
| | | return getErrorInfo(uri, ex); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Post请æ±-RestTemplate |
| | | * |
| | | * @param uri Uriå°å |
| | | * @param postData å¾
åéæ°æ® |
| | | * @return ååºå符串 |
| | | */ |
| | | public static String postForRest(String uri, List<NameValuePair> postData) { |
| | | try { |
| | | RestTemplate rest = getRestTemplate(); |
| | | UrlEncodedFormEntity entity = new UrlEncodedFormEntity(postData, StaticData.TEXT_ENCODER); |
| | | |
| | | return rest.postForObject(uri, entity, String.class); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | |
| | | return getErrorInfo(uri, ex); |
| | | } |
| | | } |
| | | |
| | | public static String postForRest(String uri, Map<String, Object> map) { |
| | | try { |
| | | RestTemplate rest = getRestTemplate(); |
| | | |
| | | return rest.postForObject(uri, map, String.class); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | |
| | | return getErrorInfo(uri, ex); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·åéè¯¯ä¿¡æ¯ |
| | | * |
| | | * @param uri Uriå°å |
| | |
| | | |
| | | return map.toString(); |
| | | } |
| | | |
| | | /** |
| | | * GET请æ±ï¼RESTï¼ |
| | | */ |
| | | public static String getForRest(String uri) { |
| | | RestTemplate rest = getRestTemplate(); |
| | | |
| | | return rest.getForObject(uri, String.class); |
| | | } |
| | | |
| | | /** |
| | | * GET请æ±ï¼RESTï¼ |
| | | */ |
| | | public static <T> T getForRest(String uri, Class<T> clazz) { |
| | | RestTemplate rest = getRestTemplate(); |
| | | |
| | | return rest.getForObject(uri, clazz); |
| | | } |
| | | |
| | | /** |
| | | * POST请æ±ï¼RESTï¼ |
| | | */ |
| | | public static String postForRest(String uri, Map<String, Object> map) { |
| | | RestTemplate rest = getRestTemplate(); |
| | | |
| | | return rest.postForObject(uri, map, String.class); |
| | | } |
| | | |
| | | /** |
| | | * POST请æ±ï¼RESTï¼ |
| | | */ |
| | | public static <T> String postForRest(String uri, List<T> list) { |
| | | RestTemplate rest = getRestTemplate(); |
| | | |
| | | return rest.postForObject(uri, list, String.class); |
| | | } |
| | | } |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | |
| | |
| | | * æ ¡éªå¯ç æ¯/å¦åæ³ |
| | | * |
| | | * @param pwd å¯ç |
| | | * @return æ¯/å¦åæ³ |
| | | * @return æ¯/å¦ä¸ºæ æç |
| | | */ |
| | | public static boolean checkPwdValid(String pwd) { |
| | | return Pattern.matches(StaticData.PWD_REG, pwd); |
| | | public static boolean isPwdInvalid(String pwd) { |
| | | return !Pattern.matches(StaticData.PWD_REG, pwd); |
| | | } |
| | | |
| | | /** |
| | | * è·åGUID |
| | | * @return |
| | | */ |
| | | public static String getGuid() { |
| | | return UUID.randomUUID().toString(); |
| | | } |
| | | |
| | | /** |
| | |
| | | import org.apache.commons.logging.LogFactory; |
| | | |
| | | import java.io.*; |
| | | import java.nio.charset.Charset; |
| | | import java.util.Enumeration; |
| | | import java.util.zip.ZipEntry; |
| | | import java.util.zip.ZipFile; |
| | |
| | | } |
| | | |
| | | int count; |
| | | zipFile = new ZipFile(filePath); |
| | | zipFile = new ZipFile(filePath, Charset.forName("GBK")); |
| | | Enumeration e = zipFile.entries(); |
| | | while (e.hasMoreElements()) { |
| | | ZipEntry entry = (ZipEntry) e.nextElement(); |
| | |
| | | */ |
| | | @Configuration |
| | | public class AuthInterceptor implements HandlerInterceptor { |
| | | private SysService sysService; |
| | | private final SysService sysService; |
| | | |
| | | private static final Log log = LogFactory.getLog(AuthInterceptor.class); |
| | | |
| | |
| | | private boolean checkWhiteList(String ip, HttpServletRequest request) { |
| | | List<String> whiteList = sysService.blacklistService.selectIpList(2); |
| | | if (whiteList == null || whiteList.isEmpty()) { |
| | | return true; |
| | | return false; |
| | | } |
| | | |
| | | return whiteList.contains(ip); |
| | |
| | | import com.lf.server.entity.all.MenusAuthEntity; |
| | | import com.lf.server.entity.all.PermsAuthEntity; |
| | | import com.lf.server.entity.all.ResAuthEntity; |
| | | import com.lf.server.entity.sys.MenuEntity; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | public List<PermsAuthEntity> selectPermsEntity(String uid); |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·Uidæ¥è¯¢è§è²ID |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | public List<Integer> selectRoles(String uid); |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·Uidé彿¥è¯¢èåéå |
| | | * |
| | | * @param id |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | public List<MenuEntity> selectMenuRecursive(int id, String uid); |
| | | } |
| | |
| | | package com.lf.server.mapper.data; |
| | | |
| | | import com.lf.server.entity.data.MetaEntity; |
| | | import com.lf.server.entity.data.MetaFileEntity; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | public MetaEntity selectById(int id); |
| | | |
| | | /** |
| | | * æ ¹æ®GUIDæ¥è¯¢ |
| | | * |
| | | * @param guid æä»¶GUID |
| | | * @return |
| | | */ |
| | | public MetaEntity selectByGuid(String guid); |
| | | |
| | | /** |
| | | * æ¥è¯¢å
æ°æ®æä»¶ |
| | | * |
| | | * @param ids å
æ°æ®IDéå |
| | | * @return å
æ°æ®æä»¶éå |
| | | */ |
| | | public List<MetaFileEntity> selectMetaFiles(List<Integer> ids); |
| | | public List<MetaEntity> selectMetaFiles(List<Integer> ids); |
| | | |
| | | /** |
| | | * æå
¥ä¸æ¡ |
| | |
| | | * @return |
| | | */ |
| | | public Integer deletes(List<Integer> ids); |
| | | |
| | | /** |
| | | * 级èå é¤ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | public Integer deleteCascade(String ids); |
| | | |
| | | /** |
| | | * æ´æ°ä¸æ¡ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.mapper.data; |
| | | |
| | | import com.lf.server.entity.data.CoordEntity; |
| | | import com.lf.server.entity.data.DirEntity; |
| | | import com.lf.server.entity.data.FmeLogEntity; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ°æ®ä¸ä¼ |
| | | * @author WWW |
| | | */ |
| | | @Mapper |
| | | @ResponseBody |
| | | public interface UploadMapper { |
| | | /** |
| | | * æ¥è¯¢åæ ç³» |
| | | * |
| | | * @param zoning |
| | | * @return |
| | | */ |
| | | public List<CoordEntity> selectCoords(String zoning); |
| | | |
| | | /** |
| | | * æ ¹æ®EPSGç¼ç ç»è®¡ |
| | | * |
| | | * @param epsgCode |
| | | * @return |
| | | */ |
| | | public Integer selectCount4Coord(String epsgCode); |
| | | |
| | | /** |
| | | * æ¥è¯¢é¡¹ç®åç§° |
| | | * |
| | | * @return |
| | | */ |
| | | public List<DirEntity> selectProject(); |
| | | |
| | | /** |
| | | * æ¥è¯¢FMEæ¥å¿ |
| | | * |
| | | * @param parentid |
| | | * @return |
| | | */ |
| | | public List<FmeLogEntity> selectFmeLog(String parentid); |
| | | } |
| | |
| | | package com.lf.server.mapper.sys; |
| | | |
| | | import com.lf.server.entity.data.DirEntity; |
| | | import com.lf.server.entity.sys.MenuEntity; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | * @param name |
| | | * @return |
| | | */ |
| | | public List<DirEntity> selectMenuRecursive(String name); |
| | | public List<MenuEntity> selectMenuRecursive(String name); |
| | | } |
| | |
| | | package com.lf.server.service.all; |
| | | |
| | | import com.lf.server.entity.all.StaticData; |
| | | import com.lf.server.entity.data.DirEntity; |
| | | import com.lf.server.entity.data.MetaFileEntity; |
| | | import com.lf.server.helper.FileHelper; |
| | | import com.lf.server.helper.PathHelper; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.entity.data.VerEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.*; |
| | | import com.lf.server.service.data.DirService; |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.lang.reflect.Field; |
| | | import java.sql.Timestamp; |
| | | import java.util.*; |
| | |
| | | @Service |
| | | public class BaseUploadService { |
| | | @Autowired |
| | | public PathHelper pathHelper; |
| | | protected DirService dirService; |
| | | |
| | | @Autowired |
| | | protected PathHelper pathHelper; |
| | | |
| | | public final Log log = LogFactory.getLog(getClass()); |
| | | |
| | | /** |
| | | * æ¥è¯¢æä»¶ |
| | | */ |
| | | public List<MetaFileEntity> selectFiles(String subPath, List<String> extList) throws IOException { |
| | | String root = pathHelper.getConfig().getTempPath() + File.separator + subPath; |
| | | |
| | | File file = new File(root); |
| | | if (!file.exists() && !file.isDirectory()) { |
| | | return null; |
| | | } |
| | | File[] files = file.listFiles(); |
| | | if (null == files || files.length == 0) { |
| | | return null; |
| | | } |
| | | |
| | | List<MetaFileEntity> list = new ArrayList<MetaFileEntity>(); |
| | | for (File f : files) { |
| | | String fileName = FileHelper.getFileName(f.getPath()); |
| | | if (null != extList) { |
| | | String extName = FileHelper.getExtension(fileName); |
| | | if (!extList.contains(extName)) { |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | double sizes = FileHelper.sizeToMb(f.length()); |
| | | String filePath = subPath + File.separator + fileName; |
| | | |
| | | MetaFileEntity mf = new MetaFileEntity(); |
| | | mf.setName(fileName); |
| | | mf.setSizes(sizes); |
| | | mf.setPath(filePath); |
| | | mf.setGuid(FileHelper.getFileMd5(f.getPath())); |
| | | |
| | | list.add(mf); |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ç®å½ |
| | |
| | | if (t != null) { |
| | | setEntity(t, request); |
| | | } |
| | | List<MetaFileEntity> list = getFiles(path, request); |
| | | |
| | | return list; |
| | | return getFiles(path, request); |
| | | } |
| | | |
| | | /** |
| | |
| | | * è·åæä»¶ |
| | | */ |
| | | public List<MetaFileEntity> getFiles(String subPath, StandardMultipartHttpServletRequest req) throws Exception { |
| | | List<MetaFileEntity> list = new ArrayList<MetaFileEntity>(); |
| | | List<MetaFileEntity> list = new ArrayList<>(); |
| | | |
| | | String path = pathHelper.getTempPath(subPath); |
| | | Iterator<String> iterator = req.getFileNames(); |
| | | while (iterator.hasNext()) { |
| | | MultipartFile file = req.getFile(iterator.next()); |
| | | if (StringHelper.isEmpty(file.getOriginalFilename())) { |
| | | if (null == file || StringHelper.isEmpty(file.getOriginalFilename())) { |
| | | continue; |
| | | } |
| | | |
| | | double sizes = FileHelper.sizeToMb(file.getSize()); |
| | | MetaFileEntity mf = new MetaFileEntity(); |
| | | mf.setName(file.getOriginalFilename()); |
| | | |
| | | double sizes = FileHelper.sizeToMb(file.getSize()); |
| | | mf.setSizes(sizes); |
| | | mf.setPath(path + File.separator + mf.getName()); |
| | | |
| | | file.transferTo(new File(mf.getPath())); |
| | | mf.setGuid(FileHelper.getFileMd5(mf.getPath())); |
| | | |
| | | list.add(mf); |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æä»¶ |
| | | */ |
| | | public List<MetaFileEntity> selectFiles(String subPath, List<String> extList) { |
| | | String root = pathHelper.getConfig().getTempPath() + File.separator + subPath; |
| | | |
| | | File file = new File(root); |
| | | if (!file.exists() && !file.isDirectory()) { |
| | | return null; |
| | | } |
| | | File[] files = file.listFiles(); |
| | | if (null == files || files.length == 0) { |
| | | return null; |
| | | } |
| | | |
| | | List<MetaFileEntity> list = new ArrayList<>(); |
| | | for (File f : files) { |
| | | String fileName = FileHelper.getFileName(f.getPath()); |
| | | String extName = FileHelper.getExtension(fileName); |
| | | if (null != extList && !extList.contains(extName)) { |
| | | continue; |
| | | } |
| | | |
| | | MetaFileEntity mf = new MetaFileEntity(); |
| | | mf.setName(fileName); |
| | | mf.setExtName(extName); |
| | | mf.setSizes(FileHelper.sizeToMb(f.length())); |
| | | mf.setPath(subPath + File.separator + fileName); |
| | | if (!StaticData.ZIP.equals(extName)) { |
| | | mf.setGuid(FileHelper.getFileMd5(f.getPath())); |
| | | } |
| | | |
| | | list.add(mf); |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * è·ååæ° |
| | | * æ¥è¯¢æ å° |
| | | */ |
| | | public List<MetaFileEntity> selectMappers(UserEntity ue, String path, DirEntity dir, VerEntity ver, String epsgCode) { |
| | | List<MetaFileEntity> metas = selectFiles(path, StaticData.ALL_EXTENSION); |
| | | if (null == metas || metas.isEmpty()) { |
| | | return null; |
| | | } |
| | | |
| | | List<MetaFileEntity> list = new ArrayList<>(); |
| | | List<DirEntity> dirs = dirService.selectDirRecursive(dir.getName()); |
| | | for (MetaFileEntity meta : metas) { |
| | | meta.setEventid(StringHelper.getGuid()); |
| | | meta.setDirid(dir.getId()); |
| | | meta.setDepid(ue.getDepid()); |
| | | meta.setVerid(ver.getId()); |
| | | meta.setCreateUser(ue.getId()); |
| | | meta.setEpsgCode(epsgCode); |
| | | |
| | | if (StaticData.ZIP.equals(meta.getExtName())) { |
| | | List<MetaFileEntity> subs = getMapperFiles(path, dir, dirs, meta); |
| | | if (null != subs && subs.size() > 0) { |
| | | list.addAll(subs); |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | list.add(meta); |
| | | } |
| | | setMetaType(list); |
| | | |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * è·åæ å°æä»¶ |
| | | */ |
| | | private List<MetaFileEntity> getMapperFiles(String path, DirEntity dir, List<DirEntity> dirs, MetaFileEntity meta) { |
| | | String tempPath = pathHelper.getConfig().getTempPath(); |
| | | String zipFile = tempPath + File.separator + meta.getPath(); |
| | | File file = new File(zipFile); |
| | | if (!file.exists() || file.isDirectory()) { |
| | | return null; |
| | | } |
| | | |
| | | File zipFolder = new File(pathHelper.getConfig().getTempPath() + File.separator + path + "_zip"); |
| | | if (!zipFolder.exists() || !zipFolder.isDirectory()) { |
| | | zipFolder.mkdirs(); |
| | | } |
| | | |
| | | String subPath = zipFolder + File.separator + meta.getName().toLowerCase().replace(".zip", ""); |
| | | ZipHelper.unzip(zipFile, subPath); |
| | | |
| | | List<File> files = new ArrayList<>(); |
| | | getFilesByPath(files, subPath); |
| | | |
| | | return getMapperFiles(files, dir, dirs, meta, tempPath.length() + 1); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®è·¯å¾è·åæä»¶ |
| | | */ |
| | | private void getFilesByPath(List<File> list, String path) { |
| | | File file = new File(path); |
| | | if (!file.isDirectory()) { |
| | | String extName = FileHelper.getExtension(file); |
| | | if (StaticData.ALL_EXTENSION.contains(extName)) { |
| | | list.add(file); |
| | | } |
| | | return; |
| | | } |
| | | |
| | | if (isGdbFile(file)) { |
| | | list.add(file); |
| | | return; |
| | | } |
| | | |
| | | File[] files = file.listFiles(); |
| | | if (null == files) { |
| | | return; |
| | | } |
| | | for (File f : files) { |
| | | if (f.isDirectory()) { |
| | | getFilesByPath(list, f.getPath()); |
| | | } else { |
| | | String extName = FileHelper.getExtension(f); |
| | | if (StaticData.ALL_EXTENSION.contains(extName)) { |
| | | list.add(f); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·åæ å°æä»¶ |
| | | */ |
| | | private List<MetaFileEntity> getMapperFiles(List<File> files, DirEntity dir, List<DirEntity> dirs, MetaFileEntity meta, int start) { |
| | | List<MetaFileEntity> list = new ArrayList<>(); |
| | | for (File f : files) { |
| | | boolean isGdb = isGdbFile(f); |
| | | if (!isGdb && f.isDirectory()) { |
| | | continue; |
| | | } |
| | | |
| | | String fileName = FileHelper.getFileName(f.getPath()); |
| | | String extName = FileHelper.getExtension(fileName); |
| | | if (!StaticData.ALL_EXTENSION.contains(extName) || fileName.startsWith("~")) { |
| | | continue; |
| | | } |
| | | |
| | | int dirid = getDirByPath(f.getPath(), fileName, dir, dirs); |
| | | boolean isShp = StaticData.SHP.equals(extName); |
| | | if (isGdb) { |
| | | List<MetaFileEntity> rs = getGdbMappers(f, meta, dirid, start); |
| | | if (null != rs && rs.size() > 0) { |
| | | list.addAll(rs); |
| | | } |
| | | continue; |
| | | } |
| | | |
| | | MetaFileEntity mf = createMetaFileEntity(meta); |
| | | mf.setDirid(dirid); |
| | | mf.setEventid(StringHelper.getGuid()); |
| | | mf.setName(fileName); |
| | | mf.setExtName(extName); |
| | | mf.setPath(f.getPath().substring(start)); |
| | | |
| | | if (isShp) { |
| | | List<String> shpFiles = getShpFiles(f.getPath()); |
| | | mf.setTab(fileName); |
| | | mf.setSizes(getFilesSize(shpFiles)); |
| | | mf.setGuid(getFilesMd5(shpFiles)); |
| | | } else { |
| | | mf.setSizes(FileHelper.sizeToMb(f.length())); |
| | | mf.setGuid(FileHelper.getFileMd5(f.getPath())); |
| | | } |
| | | list.add(mf); |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * å建å
æ°æ®æä»¶å®ä½ç±» |
| | | */ |
| | | private MetaFileEntity createMetaFileEntity(MetaFileEntity meta) { |
| | | MetaFileEntity mf = new MetaFileEntity(); |
| | | mf.setDirid(meta.getDirid()); |
| | | mf.setDepid(meta.getDepid()); |
| | | mf.setVerid(meta.getVerid()); |
| | | mf.setCreateUser(meta.getCreateUser()); |
| | | mf.setEpsgCode(meta.getEpsgCode()); |
| | | |
| | | return mf; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æä»¶è·¯å¾è·åç®å½ID |
| | | */ |
| | | private int getDirByPath(String filePath,String fileName, DirEntity dir, List<DirEntity> dirs) { |
| | | if (0 != dir.getPid() || null == dirs || dirs.isEmpty()) { |
| | | return dir.getId(); |
| | | } |
| | | if (StaticData.SLASH.equals(File.separator)) { |
| | | filePath = filePath.replace("/", "\\"); |
| | | } |
| | | |
| | | for (DirEntity entity : dirs) { |
| | | if (filePath.contains(entity.getFullName() + "\\" + fileName)) { |
| | | return entity.getId(); |
| | | } |
| | | } |
| | | |
| | | return dir.getId(); |
| | | } |
| | | |
| | | /** |
| | | * è·åSHPæä»¶éå |
| | | */ |
| | | private List<String> getShpFiles(String shpPath) { |
| | | List<String> list = new ArrayList<>(); |
| | | list.add(shpPath); |
| | | |
| | | for (int i = 0, c = StaticData.SHP_EXT.size(); i < c; i++) { |
| | | String path = shpPath.replace(".shp", StaticData.SHP_EXT.get(i)); |
| | | |
| | | File f = new File(path); |
| | | if (f.exists() && !f.isDirectory()) { |
| | | list.add(path); |
| | | } |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * è·åGDBæä»¶éå |
| | | */ |
| | | private List<String> getGdbFiles(String path) { |
| | | List<String> list = new ArrayList<>(); |
| | | |
| | | File[] files = new File(path).listFiles(); |
| | | if (null == files || files.length == 0) { |
| | | return list; |
| | | } |
| | | for (File f : files) { |
| | | list.add(f.getPath()); |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * è·å夿件çMD5 |
| | | */ |
| | | private String getFilesMd5(List<String> files) { |
| | | List<String> list = new ArrayList<>(); |
| | | for (String file : files) { |
| | | String md5 = FileHelper.getFileMd5(file); |
| | | if (null != md5) { |
| | | list.add(md5); |
| | | } |
| | | } |
| | | |
| | | if (list.size() > 0) { |
| | | String str = StringHelper.join(list, ","); |
| | | return FileHelper.getStringMd5(str); |
| | | } |
| | | |
| | | return StringHelper.getGuid(); |
| | | } |
| | | |
| | | /** |
| | | * è·å夿件çå¤§å° |
| | | */ |
| | | private double getFilesSize(List<String> files) { |
| | | long size = 0L; |
| | | for (String file : files) { |
| | | File f = new File(file); |
| | | if (f.exists() && !f.isDirectory()) { |
| | | size += f.length(); |
| | | } |
| | | } |
| | | |
| | | return FileHelper.sizeToMb(size); |
| | | } |
| | | |
| | | /** |
| | | * è·åGDBæä»¶æ å° |
| | | */ |
| | | private List<MetaFileEntity> getGdbMappers(File f, MetaFileEntity meta, int dirid, int start) { |
| | | List<String> tabs = GdbHelper.getTabNames(f.getPath()); |
| | | if (null == tabs || tabs.size() == 0) { |
| | | return null; |
| | | } |
| | | |
| | | String fileName = FileHelper.getFileName(f.getPath()); |
| | | String extName = FileHelper.getExtension(fileName); |
| | | |
| | | List<String> gdbFiles = getGdbFiles(f.getPath()); |
| | | String md5 = getFilesMd5(gdbFiles); |
| | | double sizes = getFilesSize(gdbFiles); |
| | | |
| | | List<MetaFileEntity> list = new ArrayList<>(); |
| | | for (String tab : tabs) { |
| | | MetaFileEntity mf = createMetaFileEntity(meta); |
| | | mf.setDirid(dirid); |
| | | mf.setEventid(StringHelper.getGuid()); |
| | | mf.setName(fileName); |
| | | mf.setExtName(extName); |
| | | mf.setSizes(FileHelper.sizeToMb(f.length())); |
| | | mf.setPath(f.getPath().substring(start)); |
| | | mf.setTab(tab); |
| | | mf.setSizes(sizes); |
| | | mf.setGuid(md5); |
| | | list.add(mf); |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * æ¯/å¦ä¸ºGDBæä»¶ |
| | | */ |
| | | private boolean isGdbFile(File f) { |
| | | if (f.isDirectory() && f.getName().toLowerCase().endsWith(StaticData.GDB)) { |
| | | File[] files = f.listFiles(); |
| | | if (null == files || files.length == 0) { |
| | | return false; |
| | | } |
| | | |
| | | for (File file : files) { |
| | | if ("gdb".equals(file.getName())) { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 设置å
æ°æ®æä»¶çç±»å |
| | | */ |
| | | private void setMetaType(List<MetaFileEntity> list) { |
| | | for (MetaFileEntity mf : list) { |
| | | if (null != mf.getExtName()) { |
| | | mf.setType(mf.getExtName().replace(".", "")); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·ååæ° * |
| | | * Enumeration<String> headers = req.getHeaderNames(); |
| | | * Enumeration<String> attributes = req.getAttributeNames(); |
| | | */ |
| | |
| | | package com.lf.server.service.all; |
| | | |
| | | import com.lf.server.entity.all.*; |
| | | import com.lf.server.entity.sys.MenuEntity; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.mapper.all.PermsMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<Integer> selectRoles(String uid) { |
| | | return permsMapper.selectRoles(uid); |
| | | } |
| | | |
| | | @Override |
| | | public List<MenuEntity> selectMenuRecursive(int id, String uid) { |
| | | return permsMapper.selectMenuRecursive(id, uid); |
| | | } |
| | | |
| | | public void clearResCache() { |
| | | redisService.clearKeys(RedisCacheKey.permsResKey("")); |
| | | } |
| | |
| | | package com.lf.server.service.data; |
| | | |
| | | import com.lf.server.entity.all.StaticData; |
| | | import com.lf.server.entity.ctrl.DownloadReqEntity; |
| | | import com.lf.server.entity.data.DownloadEntity; |
| | | import com.lf.server.entity.data.MetaFileEntity; |
| | | import com.lf.server.entity.data.MetaEntity; |
| | | import com.lf.server.entity.show.PipelineEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.*; |
| | |
| | | * @param pwd å¯ç |
| | | * @return ä¸è½½æä»¶GUID |
| | | */ |
| | | public String zipFiles(UserEntity ue, List<MetaFileEntity> list, String pwd) throws Exception { |
| | | public String zipFiles(UserEntity ue, List<MetaEntity> list, String pwd) throws Exception { |
| | | rmRepeatMetaFiles(list); |
| | | |
| | | String downloadPath = pathHelper.getDownloadFullPath(); |
| | |
| | | /** |
| | | * ç§»é¤éå¤çå
æ°æ®æä»¶ |
| | | */ |
| | | private void rmRepeatMetaFiles(List<MetaFileEntity> list) { |
| | | private void rmRepeatMetaFiles(List<MetaEntity> list) { |
| | | List<String> guidList = new ArrayList<>(); |
| | | |
| | | int i = 0; |
| | | while (i < list.size()) { |
| | | MetaFileEntity entity = list.get(i); |
| | | MetaEntity entity = list.get(i); |
| | | if (guidList.contains(entity.getGuid())) { |
| | | list.remove(i); |
| | | continue; |
| | |
| | | /** |
| | | * æ·»å å
æ°æ®æä»¶è³Zipå
|
| | | */ |
| | | private void addMetaFiles(ZipFile zip, ZipParameters params, List<MetaFileEntity> list) { |
| | | String uploadPath = pathHelper.getConfig().getUploadPath(); |
| | | |
| | | private void addMetaFiles(ZipFile zip, ZipParameters params, List<MetaEntity> list) { |
| | | int i = 1; |
| | | for (MetaFileEntity entity : list) { |
| | | String uploadPath = pathHelper.getConfig().getUploadPath(); |
| | | for (MetaEntity mf : list) { |
| | | try { |
| | | File file = new File(uploadPath + File.separator + entity.getPath()); |
| | | zip.addFile(file, params); |
| | | |
| | | FileHeader header = zip.getFileHeader(entity.getGuid()); |
| | | if (null != header) { |
| | | zip.renameFile(header, i++ + "_" + entity.getName()); |
| | | switch ("." + mf.getType()) { |
| | | case StaticData.MPT: |
| | | addMultiFile(i++, uploadPath, mf, zip, params, StaticData.MPT_EXT); |
| | | break; |
| | | case StaticData.IMG: |
| | | addMultiFile(i++, uploadPath, mf, zip, params, StaticData.IMG_EXT); |
| | | break; |
| | | case StaticData.TIF: |
| | | addMultiFile(i++, uploadPath, mf, zip, params, StaticData.TIF_EXT); |
| | | break; |
| | | case StaticData.TIFF: |
| | | addMultiFile(i++, uploadPath, mf, zip, params, StaticData.TIFF_EXT); |
| | | break; |
| | | case StaticData.SHP: |
| | | addMultiFile(i++, uploadPath, mf, zip, params, StaticData.SHP_EXT); |
| | | break; |
| | | case StaticData.GDB: |
| | | addFolderFile(i++, uploadPath, mf, zip, params); |
| | | break; |
| | | default: |
| | | addSingleFile(i++, uploadPath, mf, zip, params); |
| | | break; |
| | | } |
| | | |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ·»å ç®å½æä»¶ |
| | | */ |
| | | private void addFolderFile(int i, String uploadPath, MetaEntity mf, ZipFile zip, ZipParameters params) throws Exception { |
| | | File file = new File(uploadPath + File.separator + mf.getPath()); |
| | | if (!file.exists() || !file.isDirectory()) { |
| | | return; |
| | | } |
| | | zip.addFolder(file, params); |
| | | |
| | | String fileName = FileHelper.getFileName(file.getPath()); |
| | | FileHeader header = zip.getFileHeader(fileName); |
| | | if (null != header) { |
| | | zip.renameFile(header, i + "_" + mf.getName()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ·»å 夿件 |
| | | */ |
| | | private void addMultiFile(int i, String uploadPath, MetaEntity mf, ZipFile zip, ZipParameters params, List<String> extList) throws Exception { |
| | | addSingleFile(i, uploadPath, mf, zip, params); |
| | | |
| | | for (String ext : extList) { |
| | | File file = new File(uploadPath + File.separator + mf.getPath().replace("." + mf.getType(), ext)); |
| | | if (!file.exists() || file.isDirectory()) { |
| | | continue; |
| | | } |
| | | zip.addFile(file, params); |
| | | |
| | | String fileName = FileHelper.getFileName(file.getPath()); |
| | | FileHeader header = zip.getFileHeader(fileName); |
| | | if (null != header) { |
| | | zip.renameFile(header, i + "_" + mf.getName().replace("." + mf.getType(), ext)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ·»å åæä»¶ |
| | | */ |
| | | private void addSingleFile(int i, String uploadPath, MetaEntity mf, ZipFile zip, ZipParameters params) throws Exception { |
| | | File file = new File(uploadPath + File.separator + mf.getPath()); |
| | | zip.addFile(file, params); |
| | | |
| | | String fileName = FileHelper.getFileName(file.getPath()); |
| | | FileHeader header = zip.getFileHeader(fileName); |
| | | if (null != header) { |
| | | zip.renameFile(header, i + "_" + mf.getName()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·åä¸è½½å®ä½ç±» |
| | | */ |
| | | private DownloadEntity getDownloadEntity(UserEntity ue, String file, String pwd) throws Exception { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.service.data; |
| | | |
| | | import com.lf.server.entity.ctrl.FmeReqEntity; |
| | | import com.lf.server.entity.ctrl.NameValueEntity; |
| | | import com.lf.server.entity.data.MetaFileEntity; |
| | | import com.lf.server.helper.RestHelper; |
| | | import com.lf.server.helper.StringHelper; |
| | | 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.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * FMEæå¡ç±» |
| | | * @author WWW |
| | | */ |
| | | @Service |
| | | public class FmeService { |
| | | @Value("${sys.fmeUrl}") |
| | | private String fmeUrl; |
| | | |
| | | /** |
| | | * è·åä»»å¡ç¶æ |
| | | */ |
| | | public Object getTaskStatus(String id, HttpServletRequest req) { |
| | | String url = getUrl("datax/task/get", req) + "&id=" + id; |
| | | |
| | | return RestHelper.getForRest(url, Object.class); |
| | | } |
| | | |
| | | /** |
| | | * ä¸è½½è´¨æ£éè¯¯ç»æ |
| | | */ |
| | | public String getDownloadUrl(String id, HttpServletRequest req) { |
| | | return getUrl("datax/task/downloadResult", req) + "&id=" + id; |
| | | } |
| | | |
| | | /** |
| | | * 1.OSGBæ£æ¥ï¼.osgb + *徿æå½±*.xls/.xlsx |
| | | */ |
| | | public String checkOsgb(FmeReqEntity fme, HttpServletRequest req) { |
| | | String url = getUrl("datax/task/run/A8ææè´¨æ£_OSGBæ£æ¥", req); |
| | | |
| | | List<NameValueEntity> list = getKeyValues("OSGBæ£æ¥"); |
| | | list.add(new NameValueEntity("XMMC", fme.xmmc)); |
| | | list.add(new NameValueEntity("GCXMYSB", fme.zipPath)); |
| | | list.add(new NameValueEntity("DMYX_FBL", fme.imgResolution)); |
| | | |
| | | return RestHelper.postForRest(url, list); |
| | | } |
| | | |
| | | /** |
| | | * 2.è¡¨æ ¼æ°æ®æ£æ¥ï¼.xls/.xlsxï¼æé¤å
æ°æ®ï¼ |
| | | */ |
| | | public String checkXls(FmeReqEntity fme, HttpServletRequest req) { |
| | | String url = getUrl("datax/task/run/A3ææè´¨æ£_è¡¨æ ¼æ°æ®æ£æ¥", req); |
| | | |
| | | List<NameValueEntity> list = getKeyValues("è¡¨æ ¼æ°æ®æ£æ¥"); |
| | | list.add(new NameValueEntity("XMMC", fme.xmmc)); |
| | | list.add(new NameValueEntity("SJZY", fme.sjzy)); |
| | | list.add(new NameValueEntity("GCXMYSB", fme.zipPath)); |
| | | |
| | | return RestHelper.postForRest(url, list); |
| | | } |
| | | |
| | | /** |
| | | * 3.ç¹äºæ£æ¥ï¼.laz + *æ¿å
ç¹äº*.xls/.xlsx |
| | | */ |
| | | public String checkLaz(FmeReqEntity fme, HttpServletRequest req) { |
| | | String url = getUrl("datax/task/run/A9ææè´¨æ£_ç¹äºæ£æ¥", req); |
| | | |
| | | List<NameValueEntity> list = getKeyValues("ç¹äºæ£æ¥"); |
| | | list.add(new NameValueEntity("XMMC", fme.xmmc)); |
| | | list.add(new NameValueEntity("GCXMYSB", fme.zipPath)); |
| | | list.add(new NameValueEntity("LAZ_MD", fme.lazDensity)); |
| | | |
| | | return RestHelper.postForRest(url, list); |
| | | } |
| | | |
| | | /** |
| | | * 4.é«ç¨æ£æ¥ï¼.tif/.prj/.tfw/.tif.ovr + *å°å½¢å¾*.dwg |
| | | */ |
| | | public String checkDem(FmeReqEntity fme, HttpServletRequest req) { |
| | | String url = getUrl("datax/task/run/A6ææè´¨æ£_é«ç¨æ£æ¥", req); |
| | | |
| | | List<NameValueEntity> list = getKeyValues("é«ç¨æ£æ¥"); |
| | | list.add(new NameValueEntity("XMMC", fme.xmmc)); |
| | | list.add(new NameValueEntity("GCXMYSB", fme.zipPath)); |
| | | list.add(new NameValueEntity("GCZWC", fme.demTolerance)); |
| | | list.add(new NameValueEntity("ChangeRate", fme.demChangeRate)); |
| | | |
| | | return RestHelper.postForRest(url, list); |
| | | } |
| | | |
| | | /** |
| | | * 5.屿§æ£æ¥ï¼*dlg*.gdb + *å°å½¢å¾*.dwg |
| | | */ |
| | | public String checkAttrs(FmeReqEntity fme, HttpServletRequest req) { |
| | | String url = getUrl("datax/task/run/A5ææè´¨æ£_屿§æ£æ¥", req); |
| | | |
| | | List<NameValueEntity> list = getKeyValues("屿§æ£æ¥"); |
| | | list.add(new NameValueEntity("XMMC", fme.xmmc)); |
| | | list.add(new NameValueEntity("SJZY", fme.sjzy)); |
| | | list.add(new NameValueEntity("GCXMYSB", fme.zipPath)); |
| | | |
| | | return RestHelper.postForRest(url, list); |
| | | } |
| | | |
| | | /** |
| | | * 6.æææ£æ¥ï¼*å°å½¢å¾*.dwg |
| | | */ |
| | | public String checkTopology(FmeReqEntity fme, HttpServletRequest req) { |
| | | String url = getUrl("datax/task/run/A4ææè´¨æ£_æææ£æ¥", req); |
| | | |
| | | List<NameValueEntity> list = getKeyValues("æææ£æ¥"); |
| | | list.add(new NameValueEntity("XMMC", fme.xmmc)); |
| | | list.add(new NameValueEntity("GCXMYSB", fme.zipPath)); |
| | | list.add(new NameValueEntity("S_MCDRC", fme.tolerance)); |
| | | list.add(new NameValueEntity("S_XCDRC", fme.tolerance)); |
| | | list.add(new NameValueEntity("S_DCDRC", fme.tolerance)); |
| | | list.add(new NameValueEntity("OFFSET_GCD", fme.gcdOffset)); |
| | | list.add(new NameValueEntity("OFFSET_KZD", fme.kzdOffset)); |
| | | list.add(new NameValueEntity("Range_OFFSET", fme.rangeOffset)); |
| | | list.add(new NameValueEntity("XG_MAX", fme.xgMax)); |
| | | |
| | | return RestHelper.postForRest(url, list); |
| | | } |
| | | |
| | | /** |
| | | * 7.å¾é¢æ´é¥°æ£æ¥ï¼.dwg |
| | | */ |
| | | public String checkDecorate(FmeReqEntity fme, HttpServletRequest req) { |
| | | String url = getUrl("datax/task/run/A10ææè´¨æ£_å¾é¢æ´é¥°æ£æ¥", req); |
| | | |
| | | List<NameValueEntity> list = getKeyValues("å¾é¢æ´é¥°æ£æ¥"); |
| | | list.add(new NameValueEntity("XMMC", fme.xmmc)); |
| | | list.add(new NameValueEntity("GCXMYSB", fme.zipPath)); |
| | | list.add(new NameValueEntity("S_XLS", "$(ZJPZWJ)\\è´¨æ£é
置表æ».xlsx")); |
| | | list.add(new NameValueEntity("S_XLS2", "D:\\Project\\Data\\LF\\temp\\20230107010101\\æä»¶æ¸
å.xlsx")); |
| | | |
| | | return RestHelper.postForRest(url, list); |
| | | } |
| | | |
| | | /** |
| | | * 8.åç¹æ£æ¥ï¼*åé¢å¾*.dwg |
| | | */ |
| | | public String checkOrigin(FmeReqEntity fme, HttpServletRequest req) { |
| | | String url = getUrl("datax/task/run/A11ææè´¨æ£_åç¹æ£æ¥", req); |
| | | |
| | | List<NameValueEntity> list = getKeyValues("åç¹æ£æ¥"); |
| | | list.add(new NameValueEntity("XMMC", fme.xmmc)); |
| | | list.add(new NameValueEntity("GCXMYSB", fme.zipPath)); |
| | | |
| | | return RestHelper.postForRest(url, list); |
| | | } |
| | | |
| | | /** |
| | | * 9.æ
æ ¼æ£æ¥ï¼.tif/.prj/.tfw/.tif.ovr + .xls/.xlsx |
| | | */ |
| | | public String checkDom(FmeReqEntity fme, HttpServletRequest req) { |
| | | String url = getUrl("datax/task/run/A7ææè´¨æ£_æ
æ ¼æ£æ¥", req); |
| | | |
| | | List<NameValueEntity> list = getKeyValues("æ
æ ¼æ£æ¥"); |
| | | list.add(new NameValueEntity("XMMC", fme.xmmc)); |
| | | list.add(new NameValueEntity("SJZY", fme.sjzy)); |
| | | list.add(new NameValueEntity("GCXMYSB", fme.zipPath)); |
| | | list.add(new NameValueEntity("S_CoordinateSystem", fme.coordinateSystem)); |
| | | list.add(new NameValueEntity("DMYX_FBL", fme.imgResolution)); |
| | | |
| | | return RestHelper.postForRest(url, list); |
| | | } |
| | | |
| | | /** |
| | | * 10.æ°å¦åºç¡æ£æ¥ï¼.shp, .gdb, *å
æ°æ®*.xls/.xlsx |
| | | */ |
| | | public String checkMath(FmeReqEntity fme, HttpServletRequest req) { |
| | | String url = getUrl("datax/task/run/B1å
¥åºè´¨æ£_æ°å¦åºç¡æ£æ¥", req); |
| | | |
| | | List<NameValueEntity> list = getKeyValues("æ°å¦åºç¡æ£æ¥"); |
| | | list.add(new NameValueEntity("XMMC", fme.xmmc)); |
| | | list.add(new NameValueEntity("SJZY", fme.sjzy)); |
| | | list.add(new NameValueEntity("GCXMYSB", fme.zipPath)); |
| | | |
| | | return RestHelper.postForRest(url, list); |
| | | } |
| | | |
| | | /** |
| | | * 11.å
æ°æ®æ£æ¥ï¼*å
æ°æ®*.xls/.xlsx |
| | | */ |
| | | public String checkMeta(FmeReqEntity fme, HttpServletRequest req) { |
| | | String url = getUrl("datax/task/run/B5å
¥åºè´¨æ£_å
æ°æ®æ£æ¥", req); |
| | | |
| | | List<NameValueEntity> list = getKeyValues("å
æ°æ®æ£æ¥"); |
| | | list.add(new NameValueEntity("XMMC", fme.xmmc)); |
| | | list.add(new NameValueEntity("SJZY", fme.sjzy)); |
| | | list.add(new NameValueEntity("GCXMYSB", fme.zipPath)); |
| | | |
| | | return RestHelper.postForRest(url, list); |
| | | } |
| | | |
| | | /** |
| | | * 12.æ»è´¨æ£ï¼.zip/.7z + .xls/.xlsx |
| | | */ |
| | | public String checkMain(FmeReqEntity fme, HttpServletRequest req) { |
| | | String url = getUrl("datax/task/run/B0å
¥åºè´¨æ£__æ»", req); |
| | | |
| | | List<NameValueEntity> list = getKeyValues("æ»è´¨æ£"); |
| | | list.add(new NameValueEntity("XMMC", fme.xmmc)); |
| | | list.add(new NameValueEntity("SJZY", fme.sjzy)); |
| | | list.add(new NameValueEntity("GCXMYSB", fme.zipPath)); |
| | | list.add(new NameValueEntity("S_WBSBG", fme.wbsPath)); |
| | | list.add(new NameValueEntity("S_DZDK", fme.isDiZai)); |
| | | list.add(new NameValueEntity("DZ_ZLLX", fme.diZaiType)); |
| | | |
| | | return RestHelper.postForRest(url, list); |
| | | } |
| | | |
| | | /** |
| | | * 13.è¡¨æ ¼å
¥åºï¼S_RKBGãdiridãparentidï¼å¤ä¸ªä»¥è±æéå·éå¼ |
| | | */ |
| | | public String excelLoader(MetaFileEntity meta, HttpServletRequest req) { |
| | | String url = getUrl("datax/task/run/è¡¨æ ¼å
¥åº", req); |
| | | |
| | | List<NameValueEntity> list = getKeyValues("è¡¨æ ¼å
¥åº"); |
| | | list.add(new NameValueEntity("S_RKBG", meta.getPath())); |
| | | list.add(new NameValueEntity("COORDSYS", meta.getEpsgCode())); |
| | | list.add(new NameValueEntity("dirid", meta.getName())); |
| | | list.add(new NameValueEntity("depid", meta.getDepid())); |
| | | list.add(new NameValueEntity("verid", meta.getVerid())); |
| | | list.add(new NameValueEntity("createuser", meta.getCreateUser())); |
| | | list.add(new NameValueEntity("parentid", meta.getEventid())); |
| | | |
| | | return RestHelper.postForRest(url, list); |
| | | } |
| | | |
| | | /** |
| | | * è·åUrl |
| | | */ |
| | | public String getUrl(String subUrl, HttpServletRequest req) { |
| | | String token = WebHelper.getToken(req); |
| | | |
| | | return fmeUrl + subUrl + "?token=" + token; |
| | | } |
| | | |
| | | /** |
| | | * è·ååç§°å¼å¯¹éå |
| | | */ |
| | | public List<NameValueEntity> getKeyValues(String name) { |
| | | List<NameValueEntity> list = new ArrayList<>(); |
| | | list.add(new NameValueEntity("_name", String.format("%s_%s", name, StringHelper.YMDHMS2_FORMAT.format(new Date())))); |
| | | list.add(new NameValueEntity("_priority", 100)); |
| | | list.add(new NameValueEntity("_terminate_on_error", false)); |
| | | list.add(new NameValueEntity("IID", "")); |
| | | list.add(new NameValueEntity("FANOUT_DIR", "$(OrgResultStorage)")); |
| | | list.add(new NameValueEntity("IID_JL", "$(ZJPZWJ)\\IIDè®°å½è¡¨.xlsx")); |
| | | list.add(new NameValueEntity("S_ZJXZ", "$(ZJPZWJ)\\è´¨æ£ç»åæ».xlsx")); |
| | | list.add(new NameValueEntity("S_BZPZB", "$(ZJPZWJ)\\è´¨æ£é
置表æ».xlsx")); |
| | | |
| | | return list; |
| | | } |
| | | } |
| | |
| | | package com.lf.server.service.data; |
| | | |
| | | import com.lf.server.entity.data.MetaEntity; |
| | | import com.lf.server.entity.data.MetaFileEntity; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.mapper.data.MetaMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<MetaFileEntity> selectMetaFiles(List<Integer> ids) { |
| | | public MetaEntity selectByGuid(String guid) { |
| | | return metaMapper.selectByGuid(guid); |
| | | } |
| | | |
| | | @Override |
| | | public List<MetaEntity> selectMetaFiles(List<Integer> ids) { |
| | | return metaMapper.selectMetaFiles(ids); |
| | | } |
| | | |
| | |
| | | @Override |
| | | public Integer deletes(List<Integer> ids) { |
| | | return metaMapper.deletes(ids); |
| | | } |
| | | |
| | | @Override |
| | | public Integer deleteCascade(String ids) { |
| | | return metaMapper.deleteCascade(ids); |
| | | } |
| | | |
| | | @Override |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.service.data; |
| | | |
| | | import com.lf.server.entity.all.BaseEntity; |
| | | import com.lf.server.entity.all.StaticData; |
| | | import com.lf.server.entity.data.*; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.*; |
| | | import com.lf.server.mapper.all.BasicMapper; |
| | | import com.lf.server.mapper.data.UploadMapper; |
| | | import com.lf.server.service.all.BaseQueryService; |
| | | import com.lf.server.service.all.BaseUploadService; |
| | | import org.apache.commons.io.FileUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.File; |
| | | import java.sql.Timestamp; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ°æ®ä¸ä¼ æå¡ç±» |
| | | * @author WWW |
| | | */ |
| | | @Service |
| | | public class UploadService extends BaseUploadService implements UploadMapper { |
| | | @Autowired |
| | | UploadMapper uploadMapper; |
| | | |
| | | @Autowired |
| | | FmeService fmeService; |
| | | |
| | | @Autowired |
| | | MetaService metaService; |
| | | |
| | | @Override |
| | | public List<CoordEntity> selectCoords(String zoning) { |
| | | return uploadMapper.selectCoords(zoning); |
| | | } |
| | | |
| | | @Override |
| | | public Integer selectCount4Coord(String epsgCode) { |
| | | return uploadMapper.selectCount4Coord(epsgCode); |
| | | } |
| | | |
| | | @Override |
| | | public List<DirEntity> selectProject() { |
| | | return uploadMapper.selectProject(); |
| | | } |
| | | |
| | | @Override |
| | | public List<FmeLogEntity> selectFmeLog(String parentid) { |
| | | return uploadMapper.selectFmeLog(parentid); |
| | | } |
| | | |
| | | /** |
| | | * æå
¥æä»¶ |
| | | */ |
| | | public List<MetaEntity> insertFiles(UserEntity ue, List<MetaFileEntity> list, HttpServletRequest req) { |
| | | checkMetaFiles(ue, list); |
| | | excelLoader(list, req); |
| | | |
| | | return dataLoader(list); |
| | | } |
| | | |
| | | /** |
| | | * æ£æ¥å
æ°æ®æä»¶ |
| | | */ |
| | | private void checkMetaFiles(UserEntity ue, List<MetaFileEntity> list) { |
| | | Timestamp createTime = WebHelper.getCurrentTimestamp(); |
| | | String tempPath = pathHelper.getConfig().getTempPath(); |
| | | |
| | | for (MetaFileEntity mf : list) { |
| | | mf.setCreateUser(ue.getId()); |
| | | mf.setCreateTime(createTime); |
| | | mf.setDepid(ue.getDepid()); |
| | | mf.setPath(tempPath + File.separator + mf.getPath()); |
| | | |
| | | File f = new File(mf.getPath()); |
| | | if (!f.exists()) { |
| | | mf.setMsg("æä»¶ä¸¢å¤±"); |
| | | mf.setRows(-1); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å è½½æ°æ® |
| | | */ |
| | | private List<MetaEntity> dataLoader(List<MetaFileEntity> list) { |
| | | loadData(list); |
| | | copyFiles(list); |
| | | |
| | | return insertMetas(list); |
| | | } |
| | | |
| | | /** |
| | | * å è½½æ°æ® |
| | | */ |
| | | private void loadData(List<MetaFileEntity> list) { |
| | | for (MetaFileEntity mf : list) { |
| | | if (StringHelper.isEmpty(mf.getEntity())) { |
| | | continue; |
| | | } |
| | | if (StaticData.SHP.equals(mf.getExtName()) || StaticData.GDB.equals(mf.getExtName())) { |
| | | loadSpatialData(mf); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å è½½ç©ºé´æ°æ® |
| | | */ |
| | | private void loadSpatialData(MetaFileEntity mf) { |
| | | BasicMapper basicMapper = ClassHelper.getBasicMapper(mf.getEntity()); |
| | | if (null == basicMapper) { |
| | | return; |
| | | } |
| | | |
| | | String tabName = BaseQueryService.getTabName(basicMapper); |
| | | String className = ClassHelper.getClassName(basicMapper); |
| | | Class clazz = ClassHelper.getEntityClass(className); |
| | | if (null == clazz || null == tabName) { |
| | | return; |
| | | } |
| | | |
| | | List<?> list = null; |
| | | if (StaticData.SHP.equals(mf.getExtName())) { |
| | | list = ShpHelper.readData(clazz, mf.getPath()); |
| | | } else { |
| | | list = GdbHelper.readData(clazz, mf.getPath(), mf.getTab()); |
| | | } |
| | | if (null == list || list.isEmpty()) { |
| | | return; |
| | | } |
| | | setCreateInfo(list, mf); |
| | | |
| | | int rows = basicMapper.insertBatch(list); |
| | | if (rows > 0) { |
| | | mf.setTab(tabName); |
| | | mf.setRows(rows); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 设置åå»ºä¿¡æ¯ |
| | | */ |
| | | private <T> void setCreateInfo(List<T> list, MetaFileEntity mf) { |
| | | try { |
| | | if (!(list.get(0) instanceof BaseEntity)) { |
| | | return; |
| | | } |
| | | |
| | | for (T t : list) { |
| | | BaseEntity be = (BaseEntity) t; |
| | | be.setEventid(StringHelper.getGuid()); |
| | | be.setParentid(mf.getEventid()); |
| | | be.setDirid(mf.getDirid()); |
| | | be.setDepid(mf.getDepid()); |
| | | be.setVerid(mf.getVerid()); |
| | | be.setCreateuser(mf.getCreateUser()); |
| | | be.setCreatetime(mf.getCreateTime()); |
| | | } |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å¤å¶æä»¶ |
| | | */ |
| | | private void copyFiles(List<MetaFileEntity> list) { |
| | | List<String> gdbList = new ArrayList<>(); |
| | | for (MetaFileEntity mf : list) { |
| | | switch (mf.getExtName()) { |
| | | case StaticData.MPT: |
| | | copyMultiFile(mf, StaticData.MPT_EXT); |
| | | break; |
| | | case StaticData.IMG: |
| | | copyMultiFile(mf, StaticData.IMG_EXT); |
| | | break; |
| | | case StaticData.TIF: |
| | | copyMultiFile(mf, StaticData.TIF_EXT); |
| | | break; |
| | | case StaticData.TIFF: |
| | | copyMultiFile(mf, StaticData.TIFF_EXT); |
| | | break; |
| | | case StaticData.SHP: |
| | | copyMultiFile(mf, StaticData.SHP_EXT); |
| | | break; |
| | | case StaticData.GDB: |
| | | if (gdbList.contains(mf.getPath())) { |
| | | String path = findPathByGuid(list, mf); |
| | | if (null != path) { |
| | | mf.setPath(path); |
| | | } |
| | | continue; |
| | | } |
| | | |
| | | gdbList.add(mf.getPath()); |
| | | copyFolderFile(mf); |
| | | break; |
| | | default: |
| | | copySingleFile(mf); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å¤å¶å个æä»¶ |
| | | */ |
| | | private int copySingleFile(MetaFileEntity mf) { |
| | | File file = new File(mf.getPath()); |
| | | if (!file.exists()) { |
| | | mf.setMsg("æä»¶ä¸¢å¤±"); |
| | | return -1; |
| | | } |
| | | |
| | | MetaEntity old = metaService.selectByGuid(mf.getGuid()); |
| | | if (null != old) { |
| | | mf.setPath(old.getPath()); |
| | | mf.setTab(old.getTab()); |
| | | mf.setRows(old.getRows()); |
| | | file.delete(); |
| | | return 0; |
| | | } |
| | | |
| | | String uploadPath = pathHelper.getUploadFullPath(); |
| | | String targetPath = uploadPath + File.separator + mf.getGuid() + mf.getExtName(); |
| | | String subPath = FileHelper.getRelativePath(targetPath); |
| | | |
| | | File newFile = new File(targetPath); |
| | | if (newFile.exists()) { |
| | | mf.setPath(subPath); |
| | | file.delete(); |
| | | return 0; |
| | | } |
| | | |
| | | file.renameTo(newFile); |
| | | mf.setPath(subPath); |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | /** |
| | | * å¤å¶å¤ä¸ªæä»¶ |
| | | */ |
| | | private void copyMultiFile(MetaFileEntity mf, List<String> extList) { |
| | | String path = mf.getPath(); |
| | | |
| | | int status = copySingleFile(mf); |
| | | if (status < 1) { |
| | | for (int i = 0, c = extList.size(); i < c; i++) { |
| | | String subPath = path.replace(mf.getExtName(), extList.get(i)); |
| | | File file = new File(subPath); |
| | | if (file.exists()) { |
| | | file.delete(); |
| | | } |
| | | } |
| | | return; |
| | | } |
| | | |
| | | String uploadPath = pathHelper.getConfig().getUploadPath(); |
| | | for (int i = 0, c = extList.size(); i < c; i++) { |
| | | String sourcePath = path.replace(mf.getExtName(), extList.get(i)); |
| | | File file = new File(sourcePath); |
| | | if (!file.exists()) { |
| | | continue; |
| | | } |
| | | |
| | | String targetPath = uploadPath + File.separator + mf.getPath().replace(mf.getExtName(), extList.get(i)); |
| | | File newFile = new File(targetPath); |
| | | if (newFile.exists()) { |
| | | continue; |
| | | } |
| | | |
| | | file.renameTo(newFile); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å¤å¶æä»¶å¤¹æä»¶ |
| | | */ |
| | | private void copyFolderFile(MetaFileEntity mf) { |
| | | File file = new File(mf.getPath()); |
| | | if (!file.exists()) { |
| | | mf.setMsg("æä»¶ä¸¢å¤±"); |
| | | return; |
| | | } |
| | | |
| | | MetaEntity old = metaService.selectByGuid(mf.getGuid()); |
| | | if (null != old) { |
| | | mf.setPath(old.getPath()); |
| | | mf.setTab(old.getTab()); |
| | | mf.setRows(old.getRows()); |
| | | FileHelper.deleteFiles(file); |
| | | return; |
| | | } |
| | | |
| | | String uploadPath = pathHelper.getUploadFullPath(); |
| | | String targetPath = uploadPath + File.separator + mf.getGuid() + mf.getExtName(); |
| | | String subPath = FileHelper.getRelativePath(targetPath); |
| | | |
| | | File newFile = new File(targetPath); |
| | | if (newFile.exists() && newFile.isDirectory()) { |
| | | mf.setPath(subPath); |
| | | FileHelper.deleteFiles(file); |
| | | return; |
| | | } |
| | | |
| | | newFile.mkdirs(); |
| | | File[] files = file.listFiles(); |
| | | if (null == files || files.length == 0) { |
| | | return; |
| | | } |
| | | |
| | | for (File f : files) { |
| | | String subFile = targetPath + File.separator + FileHelper.getFileName(f.getPath()); |
| | | f.renameTo(new File(subFile)); |
| | | } |
| | | mf.setPath(subPath); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®GUIDæ¥æ¾è·¯å¾ |
| | | */ |
| | | private String findPathByGuid(List<MetaFileEntity> list, MetaFileEntity mf) { |
| | | for (MetaFileEntity meta : list) { |
| | | if (meta.getGuid().equals(mf.getGuid()) && !meta.getPath().equals(mf.getPath())) { |
| | | return meta.getPath(); |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * æå
¥å
æ°æ® |
| | | */ |
| | | private List<MetaEntity> insertMetas(List<MetaFileEntity> list) { |
| | | List<MetaEntity> metas = new ArrayList<>(); |
| | | for (MetaFileEntity mf : list) { |
| | | if (StringHelper.isEmpty(mf.getMsg())) { |
| | | metas.add(createMeta(mf)); |
| | | } |
| | | } |
| | | if (metas.isEmpty()) { |
| | | return null; |
| | | } |
| | | |
| | | int rows = metaService.inserts(metas); |
| | | |
| | | return rows > 0 ? metas : null; |
| | | } |
| | | |
| | | /** |
| | | * å建å
æ°æ® |
| | | */ |
| | | private MetaEntity createMeta(MetaFileEntity mf) { |
| | | MetaEntity me = new MetaEntity(); |
| | | me.setEventid(mf.getEventid()); |
| | | me.setDirid(mf.getDirid()); |
| | | me.setDepid(mf.getDepid()); |
| | | me.setVerid(mf.getVerid()); |
| | | me.setName(mf.getName()); |
| | | me.setType(mf.getType()); |
| | | me.setGuid(mf.getGuid()); |
| | | me.setPath(mf.getPath()); |
| | | me.setSizes(mf.getSizes()); |
| | | if (mf.getRows() > 0) { |
| | | me.setTab(mf.getTab()); |
| | | } |
| | | me.setRows(mf.getRows()); |
| | | me.setCreateUser(mf.getCreateUser()); |
| | | me.setCreateTime(mf.getCreateTime()); |
| | | |
| | | return me; |
| | | } |
| | | |
| | | /** |
| | | * Excelå
¥åº |
| | | */ |
| | | private String excelLoader(List<MetaFileEntity> list, HttpServletRequest req) { |
| | | List<MetaFileEntity> xlsList = getExcelFiles(list); |
| | | if (xlsList.isEmpty()) { |
| | | return ""; |
| | | } |
| | | |
| | | String guid = null; |
| | | try { |
| | | MetaFileEntity meta = getExcelMeta(xlsList); |
| | | guid = fmeService.excelLoader(meta, req); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | |
| | | return guid; |
| | | } |
| | | |
| | | /** |
| | | * è·åExcelå
æ°æ®æä»¶ |
| | | */ |
| | | private List<MetaFileEntity> getExcelFiles(List<MetaFileEntity> list) { |
| | | List<MetaFileEntity> xlsList = new ArrayList<>(); |
| | | for (MetaFileEntity mf : list) { |
| | | boolean isXls = StaticData.XLS.equals(mf.getExtName()) || StaticData.XLSX.equals(mf.getExtName()); |
| | | if (mf.getRows() > -1 && isXls) { |
| | | MetaEntity old = metaService.selectByGuid(mf.getGuid()); |
| | | if (null == old) { |
| | | xlsList.add(mf); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return xlsList; |
| | | } |
| | | |
| | | /** |
| | | * è·åExcelçå
æ°æ® |
| | | */ |
| | | private MetaFileEntity getExcelMeta(List<MetaFileEntity> xlsList) { |
| | | List<String> pathList = new ArrayList<>(); |
| | | List<String> dirList = new ArrayList<>(); |
| | | List<String> pidList = new ArrayList<>(); |
| | | |
| | | String xlsBasePath = getXlsPath(xlsList.get(0).getPath()); |
| | | for (int i = 0, c = xlsList.size(); i < c; i++) { |
| | | MetaFileEntity mf = xlsList.get(i); |
| | | |
| | | String path = copyXlsFile(xlsBasePath, i, mf); |
| | | if (null != path) { |
| | | pathList.add(path); |
| | | dirList.add(mf.getDirid() + ""); |
| | | pidList.add(mf.getEventid()); |
| | | } |
| | | } |
| | | |
| | | MetaFileEntity meta = new MetaFileEntity(); |
| | | meta.setPath(StringHelper.join(pathList, ",")); |
| | | meta.setEpsgCode(xlsList.get(0).getEpsgCode()); |
| | | meta.setName(StringHelper.join(dirList, ";")); |
| | | meta.setDepid(xlsList.get(0).getDepid()); |
| | | meta.setVerid(xlsList.get(0).getVerid()); |
| | | meta.setCreateUser(xlsList.get(0).getCreateUser()); |
| | | meta.setEventid(StringHelper.join(pidList, ";")); |
| | | |
| | | return meta; |
| | | } |
| | | |
| | | /** |
| | | * è·åXlsç®å½ |
| | | */ |
| | | private String getXlsPath(String filePath) { |
| | | String tempPath = pathHelper.getConfig().getTempPath() + File.separator; |
| | | String subPath = filePath.substring(tempPath.length()); |
| | | subPath = tempPath + subPath.substring(0, subPath.indexOf(File.separator)).replace("_zip", "") + "_xls"; |
| | | |
| | | File f = new File(subPath); |
| | | if (!f.exists() || !f.isDirectory()) { |
| | | f.mkdirs(); |
| | | } |
| | | |
| | | return subPath; |
| | | } |
| | | |
| | | /** |
| | | * å¤å¶Xlsæä»¶ |
| | | */ |
| | | private String copyXlsFile(String xlsBasePath, int i, MetaFileEntity mf) { |
| | | try { |
| | | String xlsPath = xlsBasePath + File.separator + i; |
| | | |
| | | File file = new File(xlsPath); |
| | | if (!file.exists() || !file.isDirectory()) { |
| | | file.mkdirs(); |
| | | } |
| | | file = new File(mf.getPath()); |
| | | |
| | | File newFile = new File(xlsPath + File.separator + FileHelper.getFileName(file.getPath())); |
| | | FileUtils.copyFile(file, newFile); |
| | | |
| | | return newFile.getPath(); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | |
| | | */ |
| | | @Service |
| | | public class ExportService { |
| | | @Value("${sys.path.exportServer}") |
| | | @Value("${sys.exportServer}") |
| | | private String exportServer; |
| | | |
| | | @Autowired |
| | |
| | | package com.lf.server.service.show; |
| | | |
| | | import com.lf.server.entity.ctrl.ShpRecordEntity; |
| | | import com.lf.server.entity.data.MetaEntity; |
| | | import com.lf.server.entity.data.MetaFileEntity; |
| | | import com.lf.server.helper.FileHelper; |
| | | import com.lf.server.helper.ShpHelper; |
| | |
| | | |
| | | import com.lf.server.entity.ctrl.MarkJsonEntity; |
| | | import com.lf.server.entity.data.DownloadEntity; |
| | | import com.lf.server.entity.data.MetaEntity; |
| | | import com.lf.server.entity.data.MetaFileEntity; |
| | | import com.lf.server.entity.show.MarkEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | |
| | | public List<MarkJsonEntity> readShpForMarks(List<MetaFileEntity> list) { |
| | | String fileName = null; |
| | | for (MetaFileEntity mf : list) { |
| | | if (mf.getName().toLowerCase().indexOf(".shp") > -1) { |
| | | if (mf.getName().toLowerCase().contains(".shp")) { |
| | | fileName = mf.getPath(); |
| | | break; |
| | | } |
| | |
| | | package com.lf.server.service.show; |
| | | |
| | | import com.lf.server.entity.all.BaseGeoEntity; |
| | | import com.lf.server.entity.all.StaticData; |
| | | import com.lf.server.entity.data.DownloadEntity; |
| | | import com.lf.server.entity.data.MetaFileEntity; |
| | | import com.lf.server.entity.show.PipelineEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.*; |
| | | import com.lf.server.mapper.all.GeomBaseMapper; |
| | | import com.lf.server.mapper.data.DownloadMapper; |
| | | import com.lf.server.mapper.show.PipelineMapper; |
| | | import com.lf.server.service.all.BaseQueryService; |
| | | import net.lingala.zip4j.ZipFile; |
| | | import net.lingala.zip4j.model.FileHeader; |
| | | import net.lingala.zip4j.model.ZipParameters; |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | |
| | | |
| | | import java.io.File; |
| | | import java.lang.reflect.Field; |
| | | import java.math.BigDecimal; |
| | | import java.sql.Timestamp; |
| | | import java.time.LocalDate; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | Layer layer = null; |
| | | try { |
| | | List<PipelineEntity> list = map.get(key); |
| | | layer = createLayer(dataSource, key, list.get(0)); |
| | | layer = createLayer(dataSource, key.replace(".", "_"), list.get(0)); |
| | | |
| | | List<Field> fields = new ArrayList<>(); |
| | | getFields(PipelineEntity.class, fields); |
| | |
| | | package com.lf.server.service.sys; |
| | | |
| | | import com.lf.server.entity.data.DirEntity; |
| | | import com.lf.server.entity.sys.MenuEntity; |
| | | import com.lf.server.mapper.sys.MenuMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<DirEntity> selectMenuRecursive(String name) { |
| | | public List<MenuEntity> selectMenuRecursive(String name) { |
| | | return menuMapper.selectMenuRecursive(name); |
| | | } |
| | | } |
| | |
| | | import com.lf.server.helper.RsaHelper; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.mapper.sys.UserMapper; |
| | | import com.lf.server.service.all.CommonsFileuploadService; |
| | | import com.lf.server.service.all.RedisService; |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | |
| | | // è§£å¯ |
| | | String uid = RsaHelper.decrypt(entity.getUid()); |
| | | /*String pwd = RsaHelper.decrypt(entity.getPwd()); |
| | | if (!StringHelper.checkPwdValid(pwd)) { |
| | | if (!StringHelper.isPwdValid(pwd)) { |
| | | return "å¯ç ä¸ç¬¦åè¦æ±"; |
| | | } |
| | | |
| | |
| | | tokenService.setPwdErrCache(ue); |
| | | return "æ§å¯ç 䏿£ç¡®"; |
| | | } |
| | | if (!StringHelper.checkPwdValid(salt)) { |
| | | if (StringHelper.isPwdInvalid(salt)) { |
| | | return "å¯ç ä¸ç¬¦åè¦æ±"; |
| | | } |
| | | |
| | |
| | | |
| | | try { |
| | | String pwd = RsaHelper.decrypt(newPwd); |
| | | if (!StringHelper.checkPwdValid(pwd)) { |
| | | if (StringHelper.isPwdInvalid(pwd)) { |
| | | return "å¯ç ä¸ç¬¦åè¦æ±"; |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.lf.server.mapper.data.UploadMapper"> |
| | | <select id="selectCoords" resultType="com.lf.server.entity.data.CoordEntity"> |
| | | select * from lf.sys_coord |
| | | <where> |
| | | 1 = 1 |
| | | <if test="zoning != null"> |
| | | and zoning = #{zoning} |
| | | </if> |
| | | </where> |
| | | order by id |
| | | </select> |
| | | |
| | | <select id="selectCount4Coord" resultType="java.lang.Integer"> |
| | | select count(*) from lf.sys_coord where epsgcode = #{epsgCode} |
| | | </select> |
| | | |
| | | <select id="selectProject" resultType="com.lf.server.entity.data.DirEntity"> |
| | | select * from lf.sys_dir where pid = 0 and id > 1 |
| | | </select> |
| | | |
| | | <select id="selectFmeLog" resultType="com.lf.server.entity.data.FmeLogEntity"> |
| | | select * from lf.sys_fme_log where parentid = #{parentid}; |
| | | </select> |
| | | </mapper> |