From cc816055746ae0ffa870734e5a411b2a2aabb96a Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期一, 22 四月 2024 16:16:26 +0800 Subject: [PATCH] 添加附件dwg的转换 --- src/main/java/com/lf/server/controller/data/MetaController.java | 63 ++++++++++++++++++++++++++----- 1 files changed, 52 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/lf/server/controller/data/MetaController.java b/src/main/java/com/lf/server/controller/data/MetaController.java index cd1fe4b..4120909 100644 --- a/src/main/java/com/lf/server/controller/data/MetaController.java +++ b/src/main/java/com/lf/server/controller/data/MetaController.java @@ -22,13 +22,14 @@ import com.lf.server.service.data.DownloadService; import com.lf.server.service.data.MetaService; import com.lf.server.service.data.VerService; +import com.lf.server.service.show.CadService; import com.lf.server.service.sys.DepService; import com.lf.server.service.sys.DownlogService; import com.lf.server.service.sys.TokenService; import io.swagger.annotations.*; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.File; @@ -45,26 +46,29 @@ @RestController @RequestMapping("/meta") public class MetaController extends BaseController { - @Autowired + @Resource MetaService metaService; - @Autowired + @Resource TokenService tokenService; - @Autowired + @Resource BaseQueryService baseQueryService; - @Autowired + @Resource DownlogService downlogService; - @Autowired + @Resource DownloadService downloadService; - @Autowired + @Resource VerService verService; - @Autowired + @Resource DepService depService; + + @Resource + CadService cadService; @SysLog() @ApiOperation(value = "鍒嗛〉鏌ヨ骞惰繑鍥炶褰曟暟") @@ -91,6 +95,26 @@ List<MetaEntity> rs = metaService.selectByPage(depcode, dircode, verid, name, pageSize, pageSize * (pageIndex - 1)); return success(count, rs); + } catch (Exception ex) { + return fail(ex, null); + } + } + + @SysLog() + @ApiOperation(value = "鏍规嵁GUID鏌ヨGDB") + @ApiImplicitParams({ + @ApiImplicitParam(name = "guid", value = "GUID", dataType = "String", paramType = "query", example = "d58e66d9606a4b85e7c8ab43b3db0b55") + }) + @GetMapping(value = "/selectGdbByGuid") + public ResponseMsg<Object> selectGdbByGuid(String guid) { + try { + if (StringHelper.isEmpty(guid)) { + return fail("鏂囦欢GUID鍊间笉鑳戒负绌�", null); + } + + List<MetaEntity> rs = metaService.selectGdbByGuid(guid); + + return success(null == rs ? 0 : rs.size(), rs); } catch (Exception ex) { return fail(ex, null); } @@ -227,6 +251,23 @@ } @SysLog() + @ApiOperation(value = "鏌ヨDwg杞崲") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id", value = "鍏冩暟鎹甀D", dataType = "int", paramType = "query", example = "7715"), + @ApiImplicitParam(name = "isAttach", value = "鏄惁涓洪檮浠�", dataType = "Boolean", paramType = "query", example = "false") + }) + @GetMapping(value = "/selectConvertToDwg") + public ResponseMsg<Object> selectConvertToDwg(int id, Boolean isAttach) { + try { + String rs = cadService.convert(id, isAttach); + + return success(rs); + } catch (Exception ex) { + return fail(ex, null); + } + } + + @SysLog() @ApiOperation(value = "鎻掑叆涓�鏉�") @ApiImplicitParams({ @ApiImplicitParam(name = "entity", value = "瀹炰綋绫�", dataType = "MetaEntity", paramType = "body") @@ -356,11 +397,11 @@ return fail("鐢ㄦ埛鏈櫥褰�", null); } - int count = downloadService.selectCountForUser(ue.getId(), 3, name); + int count = downloadService.selectCountForUser(ue.getId(), "3,4", name); if (count == 0) { return success(0, null); } - List<DownloadEntity> rs = downloadService.selectByPageForUser(ue.getId(), 3, name, pageSize, pageSize * (pageIndex - 1)); + List<DownloadEntity> rs = downloadService.selectByPageForUser(ue.getId(), "3,4", name, pageSize, pageSize * (pageIndex - 1)); return success(count, rs); } catch (Exception ex) { @@ -415,7 +456,7 @@ } @SysLog() - @ApiOperation(value = "璇锋眰涓嬭浇") + @ApiOperation(value = "璇锋眰鍏冩暟鎹笅杞�") @ApiImplicitParams({ @ApiImplicitParam(name = "dr", value = "璇锋眰涓嬭浇瀹炰綋绫�", dataType = "DownloadReqEntity", paramType = "body") }) -- Gitblit v1.9.3