|
@@ -0,0 +1,484 @@
|
|
|
|
+package com.bosshand.virgo.bim.controller;
|
|
|
|
+
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.bosshand.virgo.bim.model.*;
|
|
|
|
+import com.bosshand.virgo.bim.service.BimAttributeService;
|
|
|
|
+import com.bosshand.virgo.bim.service.BimModelService;
|
|
|
|
+import com.bosshand.virgo.bim.service.FileClient;
|
|
|
|
+import com.bosshand.virgo.core.response.Response;
|
|
|
|
+import com.bosshand.virgo.core.utils.FileUtil;
|
|
|
|
+import com.bosshand.virgo.exception.BadRequestException;
|
|
|
|
+import com.bosshand.virgo.exception.Constant;
|
|
|
|
+import com.bosshand.virgo.exception.ServiceException;
|
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
|
+import io.swagger.annotations.ApiParam;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
|
+
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
|
+import java.io.IOException;
|
|
|
|
+import java.io.OutputStream;
|
|
|
|
+import java.io.UnsupportedEncodingException;
|
|
|
|
+import java.net.URLEncoder;
|
|
|
|
+import java.util.HashMap;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
+
|
|
|
|
+@RestController
|
|
|
|
+@RequestMapping("bim")
|
|
|
|
+public class BimModelController {
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ BimModelService bimModelService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ BimAttributeService bimAttributeService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ FileClient fileClient;
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/test/{artifactsId}", method = RequestMethod.GET)
|
|
|
|
+ public Response getArtifactsId(@PathVariable long artifactsId) {
|
|
|
|
+ return Response.ok(bimModelService.getArtifactsId(artifactsId));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/uploadFile/{type}", method = RequestMethod.POST)
|
|
|
|
+ public Response uploadFile(@ApiParam(name = "uploadFile", required = true) MultipartFile uploadFile, @PathVariable int type) {
|
|
|
|
+ Response rp = fileClient.uploadFile(uploadFile, 1);
|
|
|
|
+ String str = rp.getData().toString();
|
|
|
|
+ String fileLocation = str.substring(str.lastIndexOf("http"), str.indexOf(",", str.lastIndexOf("http")));
|
|
|
|
+ return Response.ok(bimModelService.save(uploadFile.getOriginalFilename(), fileLocation, type));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/uploadFile/{type}/{id}", method = RequestMethod.POST)
|
|
|
|
+ public Response reUploadFile(@ApiParam(name = "uploadFile", required = true) MultipartFile uploadFile, @PathVariable int type, @PathVariable String id) {
|
|
|
|
+ Response rp = fileClient.uploadFile(uploadFile, 1);
|
|
|
|
+ String str = rp.getData().toString();
|
|
|
|
+ String fileLocation = str.substring(str.lastIndexOf("http"), str.indexOf(",", str.lastIndexOf("http")));
|
|
|
|
+ return Response.ok(bimModelService.updateFile(uploadFile.getOriginalFilename(), fileLocation, type, id));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/download/{id}", method = RequestMethod.GET)
|
|
|
|
+ public void downloadFile(@PathVariable String id, final HttpServletResponse response) throws Exception {
|
|
|
|
+
|
|
|
|
+ byte[] data = null;
|
|
|
|
+ OutputStream outputStream = null;
|
|
|
|
+ try {
|
|
|
|
+ BimModel model = bimModelService.get(id);
|
|
|
|
+ data = FileUtil.readFromUrl(model.getLocation());
|
|
|
|
+ response.setCharacterEncoding("UTF-8");
|
|
|
|
+ response.setContentType("application/x-msdownload");
|
|
|
|
+ response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode(model.getName(), "UTF-8"));
|
|
|
|
+ OutputStream outputSream = response.getOutputStream();
|
|
|
|
+ outputSream.write(data);
|
|
|
|
+ outputSream.flush();
|
|
|
|
+ } catch (IOException e) {
|
|
|
|
+ throw new BadRequestException("Fail to write stream", Constant.RET_DOCUMENT_ERROR, e);
|
|
|
|
+ } finally {
|
|
|
|
+ if (outputStream != null) {
|
|
|
|
+ try {
|
|
|
|
+ outputStream.close();
|
|
|
|
+ } catch (IOException e) {
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/{id}/{type}", method = RequestMethod.PUT)
|
|
|
|
+ public Response updateType(@PathVariable String id, @PathVariable int type) {
|
|
|
|
+ bimModelService.updateType(id, type);
|
|
|
|
+ return Response.ok();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
|
|
|
+ public Response uploadToBim(@PathVariable String id) {
|
|
|
|
+ try {
|
|
|
|
+ bimModelService.uploadToBim(id);
|
|
|
|
+ return Response.ok();
|
|
|
|
+ } catch (ServiceException | UnsupportedEncodingException e) {
|
|
|
|
+ return Response.fail(Constant.CODE_BAD_REQUEST, Constant.RET_INPUT_ERROR);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/{id}/{fileId}", method = RequestMethod.GET)
|
|
|
|
+ public Response downloadFromBim(@PathVariable String id, @PathVariable String fileId) {
|
|
|
|
+ bimModelService.downloadFromBim(id, fileId);
|
|
|
|
+ return Response.ok();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/translate/{id}", method = RequestMethod.GET)
|
|
|
|
+ public Response translate(@PathVariable String id) {
|
|
|
|
+ try {
|
|
|
|
+ bimModelService.translate(id);
|
|
|
|
+ } catch (ServiceException e) {
|
|
|
|
+ return Response.fail(Constant.CODE_BAD_REQUEST, Constant.RET_INPUT_ERROR);
|
|
|
|
+ }
|
|
|
|
+ return Response.ok();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/viewToken/{fileId}", method = RequestMethod.GET)
|
|
|
|
+ public Response viewToken(@PathVariable String fileId) {
|
|
|
|
+ try {
|
|
|
|
+ return Response.ok(bimModelService.viewToken(fileId));
|
|
|
|
+ } catch (ServiceException e) {
|
|
|
|
+ return Response.fail(Constant.CODE_BAD_REQUEST, Constant.RET_INPUT_ERROR);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/viewToken/scene/{sceneId}", method = RequestMethod.GET)
|
|
|
|
+ public Response viewTokenBySceneId(@PathVariable String sceneId) {
|
|
|
|
+ try {
|
|
|
|
+ return Response.ok(bimModelService.viewTokenBySceneId(sceneId));
|
|
|
|
+ } catch (ServiceException e) {
|
|
|
|
+ return Response.fail(Constant.CODE_BAD_REQUEST, Constant.RET_INPUT_ERROR);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/elements/{id}", method = RequestMethod.GET)
|
|
|
|
+ public Response elements(@PathVariable String id) {
|
|
|
|
+ try {
|
|
|
|
+ return Response.ok(bimModelService.elements(id));
|
|
|
|
+ } catch (ServiceException e) {
|
|
|
|
+ return Response.fail(Constant.CODE_BAD_REQUEST, Constant.RET_INPUT_ERROR);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/elements/values/{id}", method = RequestMethod.GET)
|
|
|
|
+ public Response elementPropertyValues(@PathVariable String id) {
|
|
|
|
+ try {
|
|
|
|
+ return Response.ok(bimModelService.elements(id));
|
|
|
|
+ } catch (ServiceException e) {
|
|
|
|
+ return Response.fail(Constant.CODE_BAD_REQUEST, Constant.RET_INPUT_ERROR);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/elements/{fileId}/{familyType}", method = RequestMethod.GET)
|
|
|
|
+ public Response elementsByFileId(@PathVariable String fileId, @PathVariable String familyType) {
|
|
|
|
+ try {
|
|
|
|
+ return Response.ok(bimModelService.elementsByFileId(fileId, familyType));
|
|
|
|
+ } catch (ServiceException e) {
|
|
|
|
+ return Response.fail(Constant.CODE_BAD_REQUEST, Constant.RET_INPUT_ERROR);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/tree/{id}", method = RequestMethod.GET)
|
|
|
|
+ public Response tree(@PathVariable String id) {
|
|
|
|
+ try {
|
|
|
|
+ return Response.ok(bimModelService.tree(id));
|
|
|
|
+ } catch (ServiceException e) {
|
|
|
|
+ return Response.fail(Constant.CODE_BAD_REQUEST, Constant.RET_INPUT_ERROR);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/treeByFileId/{id}", method = RequestMethod.GET)
|
|
|
|
+ public Response treeByFileId(@PathVariable String id) {
|
|
|
|
+ try {
|
|
|
|
+ return Response.ok(bimModelService.treeByFileId(id));
|
|
|
|
+ } catch (ServiceException e) {
|
|
|
|
+ return Response.fail(Constant.CODE_BAD_REQUEST, Constant.RET_INPUT_ERROR);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/floors/{id}", method = RequestMethod.GET)
|
|
|
|
+ public Response floors(@PathVariable String id) {
|
|
|
|
+ try {
|
|
|
|
+ return Response.ok(bimModelService.floors(id));
|
|
|
|
+ } catch (ServiceException e) {
|
|
|
|
+ return Response.fail(Constant.CODE_BAD_REQUEST, Constant.RET_INPUT_ERROR);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/areas/{fileId}", method = RequestMethod.GET)
|
|
|
|
+ public Response areas(@PathVariable String fileId) {
|
|
|
|
+ try {
|
|
|
|
+ return Response.ok(bimModelService.areas(fileId));
|
|
|
|
+ } catch (ServiceException e) {
|
|
|
|
+ return Response.fail(Constant.CODE_BAD_REQUEST, Constant.RET_INPUT_ERROR);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/rooms/{fileId}", method = RequestMethod.GET)
|
|
|
|
+ public Response rooms(@PathVariable String fileId) {
|
|
|
|
+ try {
|
|
|
|
+ return Response.ok(bimModelService.rooms(fileId));
|
|
|
|
+ } catch (ServiceException e) {
|
|
|
|
+ return Response.fail(Constant.CODE_BAD_REQUEST, Constant.RET_INPUT_ERROR);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
|
|
+ public Response list() {
|
|
|
|
+ return Response.ok(bimModelService.getList());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/list/info", method = RequestMethod.GET)
|
|
|
|
+ public String listInfo() {
|
|
|
|
+ return bimModelService.listInfo().toJSONString();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/list/type/{type}", method = RequestMethod.GET)
|
|
|
|
+ public Response getListByType(@PathVariable int type) {
|
|
|
|
+ return Response.ok(bimModelService.getListByType(type));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/list/{ids}", method = RequestMethod.GET)
|
|
|
|
+ public Response getListByIds(@PathVariable String ids) {
|
|
|
|
+ return Response.ok(bimModelService.getListByIds(ids));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/list/bims/{ids}", method = RequestMethod.GET)
|
|
|
|
+ public String getBimIds(@PathVariable String ids) {
|
|
|
|
+ List<BimModel> listByIds = bimModelService.getListByIds(ids);
|
|
|
|
+ return JSON.toJSONString(listByIds);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/integrate", method = RequestMethod.PUT)
|
|
|
|
+ public Response modelIntegrate(@RequestBody String[] fileIds) {
|
|
|
|
+ return Response.ok(bimModelService.modelIntegrate(fileIds));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/integrate/{integrateId}", method = RequestMethod.PUT)
|
|
|
|
+ public Response modelIntegrateTree(@PathVariable String integrateId) {
|
|
|
|
+ return Response.ok(bimModelService.modelIntegrateTree(integrateId));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/integrateId/{integrateId}", method = RequestMethod.GET)
|
|
|
|
+ public String integrateTree(@PathVariable String integrateId){
|
|
|
|
+ return bimModelService.modelIntegrateTree(integrateId).toJSONString();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/integrate/files/{integrateId}", method = RequestMethod.GET)
|
|
|
|
+ public Response modelIntegrateFiles(@PathVariable String integrateId) {
|
|
|
|
+ return Response.ok(bimModelService.modelIntegrateFiles(integrateId));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/viewToken/integrate/{integrateId}", method = RequestMethod.GET)
|
|
|
|
+ public Response viewTokenByIntegrateId(@PathVariable String integrateId) {
|
|
|
|
+ try {
|
|
|
|
+ return Response.ok(bimModelService.viewTokenByIntegrateId(integrateId));
|
|
|
|
+ } catch (ServiceException e) {
|
|
|
|
+ return Response.fail(Constant.CODE_BAD_REQUEST, Constant.RET_INPUT_ERROR);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /*@RequestMapping(value = "/family/matching/{integrateId}/{isMatching}", method = RequestMethod.GET)
|
|
|
|
+ public Response getByBimIntegrateId(@PathVariable String integrateId, @PathVariable int isMatching) {
|
|
|
|
+ return Response.ok(bimModelService.getByBimIntegrateId(integrateId, isMatching));
|
|
|
|
+ }*/
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/family/matching/{integrateId}/{isMatching}/{currPage}/{pageSize}", method = RequestMethod.GET)
|
|
|
|
+ public Response getByBimIntegrateIdByPage(@PathVariable String integrateId,
|
|
|
|
+ @PathVariable int isMatching,
|
|
|
|
+ @PathVariable int currPage,
|
|
|
|
+ @PathVariable int pageSize) {
|
|
|
|
+ if (bimModelService.modelIntegrateState(integrateId)) {
|
|
|
|
+ return Response.fail(20001, "模型还在集成中。。。。。");
|
|
|
|
+ }
|
|
|
|
+ int totalCount = bimModelService.getByBimIntegrateId(integrateId, isMatching);
|
|
|
|
+ List<BimFamilyPartItem> dataList = bimModelService.getByBimIntegrateId(integrateId, isMatching, currPage, pageSize);
|
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
|
+ result.put("dataList", dataList);
|
|
|
|
+ result.put("totalCount", totalCount);
|
|
|
|
+ return Response.ok(result);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation("查询绑定数据")
|
|
|
|
+ @RequestMapping(value = "/family/matching/query", method = RequestMethod.POST)
|
|
|
|
+ public Response queryBimFamilyPartItem(@RequestBody BimFamilyPartItem bimFamilyPartItem) {
|
|
|
|
+ return Response.ok(bimModelService.queryBimFamilyPartItem(bimFamilyPartItem));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/family/again/{integrateId}", method = RequestMethod.GET)
|
|
|
|
+ public Response getAgainByBimIntegrateId(@PathVariable String integrateId) {
|
|
|
|
+ //return Response.ok(bimModelService.getAgainByBimIntegrateId(integrateId));
|
|
|
|
+ bimModelService.getAgainByBimIntegrateId(integrateId);
|
|
|
|
+ return Response.ok();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/family/{integrateId}/{partItemId}", method = RequestMethod.GET)
|
|
|
|
+ public Response getByBimIntegrate(@PathVariable String integrateId, @PathVariable long partItemId) {
|
|
|
|
+ return Response.ok(bimModelService.getByBimIntegrateId(integrateId, partItemId));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/family/integrateId/{integrateId}", method = RequestMethod.GET)
|
|
|
|
+ public String getByBimIntegrateId(@PathVariable String integrateId) {
|
|
|
|
+ return bimModelService.getByBimIntegrateId(integrateId).toJSONString();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/family/elementId/{elementId}", method = RequestMethod.GET)
|
|
|
|
+ public Response getByElementId(@PathVariable String elementId) {
|
|
|
|
+ return Response.ok(bimModelService.getByElementId(elementId));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/family", method = RequestMethod.POST)
|
|
|
|
+ public Response updatePartItem(@RequestBody BimFamilyPartItem bimFamilyPartItem) {
|
|
|
|
+ bimModelService.updatePartItem(bimFamilyPartItem);
|
|
|
|
+ return Response.ok();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/family/list", method = RequestMethod.POST)
|
|
|
|
+ public Response updatePartItemList(@RequestBody List<BimFamilyPartItem> list) {
|
|
|
|
+ bimModelService.updatePartItemList(list);
|
|
|
|
+ return Response.ok();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/regular", method = RequestMethod.POST)
|
|
|
|
+ public Response saveRegular(@RequestBody BimPartItemRegular bimPartItemRegular) {
|
|
|
|
+ bimModelService.saveRegular(bimPartItemRegular);
|
|
|
|
+ return Response.ok();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/regular", method = RequestMethod.PUT)
|
|
|
|
+ public Response updateRegular(@RequestBody BimPartItemRegular bimPartItemRegular) {
|
|
|
|
+ bimModelService.updateRegular(bimPartItemRegular);
|
|
|
|
+ return Response.ok();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/regular/{partItemId}", method = RequestMethod.POST)
|
|
|
|
+ public Response getRegularByPartItemId(@PathVariable long partItemId) {
|
|
|
|
+ return Response.ok(bimModelService.getRegularByPartItemId(partItemId));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "批量获取构件属性", notes = "批量获取构件属性")
|
|
|
|
+ @RequestMapping(value = "/batch/integrate/{integrateId}", method = RequestMethod.POST)
|
|
|
|
+ public Response batchObtainAttribute(@PathVariable String integrateId, @RequestBody JSONObject json) {
|
|
|
|
+ List<BimAttribute> list = bimAttributeService.getIntegrateId(integrateId, json);
|
|
|
|
+ if (list != null && list.size() > 0) {
|
|
|
|
+ return Response.ok(list);
|
|
|
|
+ }
|
|
|
|
+ return Response.ok(bimModelService.batchObtainAttribute(integrateId, json));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 前台传入的参数
|
|
|
|
+ * [
|
|
|
|
+ * {
|
|
|
|
+ * "familyNameList": [
|
|
|
|
+ * "建筑面层-30mm",
|
|
|
|
+ * "建筑面层-250mm",
|
|
|
|
+ * "楼板-75mm"
|
|
|
|
+ * ],
|
|
|
|
+ * "partItemId": "1284",
|
|
|
|
+ * "partItemName": "地基与基础(GB50202-2018)"
|
|
|
|
+ * },
|
|
|
|
+ * {
|
|
|
|
+ * "familyNameList": [
|
|
|
|
+ * "PM-L型构造柱-直槎-通用左-90°",
|
|
|
|
+ * "PM-L型构造柱-直槎-基础",
|
|
|
|
+ * "PM-一字型构造柱-直槎-基础"
|
|
|
|
+ * ],
|
|
|
|
+ * "partItemId": "1529",
|
|
|
|
+ * "partItemName": "地基与基础(GB50202-2018)"
|
|
|
|
+ * }
|
|
|
|
+ * ]
|
|
|
|
+ *
|
|
|
|
+ * @param list
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation(value = "用户根据族类型批量绑定分部分项", notes = "用户根据族类型批量绑定分部分项")
|
|
|
|
+ @RequestMapping(value = "/bimfamilyregular", method = RequestMethod.POST)
|
|
|
|
+ public Response bimFamilyRegular(@RequestBody List<BimFamilyRegular> list) {
|
|
|
|
+ bimModelService.bimFamilyRegular(list);
|
|
|
|
+ return Response.ok();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "获取全部族类型列表", notes = "获取全部族类型列表")
|
|
|
|
+ @RequestMapping(value = "/family/list/{integrateId}", method = RequestMethod.GET)
|
|
|
|
+ public Response getFamilyTypeList(@PathVariable String integrateId) {
|
|
|
|
+ return Response.ok(bimModelService.getListByBimIntegrateId(integrateId));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //------------------------------------------------------------------------------
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "获取构件属性", notes = "获取构件属性")
|
|
|
|
+ @RequestMapping(value = "/getElementPropertyValues/{fileId}/{elementId}", method = RequestMethod.GET)
|
|
|
|
+ public Response getElementPropertyValues(@PathVariable String fileId, @PathVariable String elementId) {
|
|
|
|
+ return Response.ok(bimModelService.getElementPropertyValues(fileId, elementId));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @param fileId
|
|
|
|
+ * @param elementId
|
|
|
|
+ * @param array [
|
|
|
|
+ * {
|
|
|
|
+ * "group": "dimension",
|
|
|
|
+ * "items": [
|
|
|
|
+ * {
|
|
|
|
+ * "code": "perimeter",
|
|
|
|
+ * "extension": "object",
|
|
|
|
+ * "key": "perimeter",
|
|
|
|
+ * "orderNumber": 0,
|
|
|
|
+ * "unit": "mm",
|
|
|
|
+ * "value": 17200,
|
|
|
|
+ * "valueType": 2
|
|
|
|
+ * }
|
|
|
|
+ * ]
|
|
|
|
+ * }
|
|
|
|
+ * ]
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation(value = "修改单模型指定构件属性", notes = "修改单模型指定构件属性")
|
|
|
|
+ @RequestMapping(value = "/modifyElements/{fileId}/{elementId}", method = RequestMethod.PUT)
|
|
|
|
+ public Response modifyElements(@PathVariable String fileId, @PathVariable String elementId, @RequestBody JSONArray array) {
|
|
|
|
+ int cont = bimModelService.modifyElements(fileId, elementId, array);
|
|
|
|
+ if (cont == 1) {
|
|
|
|
+ return Response.ok();
|
|
|
|
+ }
|
|
|
|
+ return Response.fail(200000, "失败");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "修改集成模型指定构件属性", notes = "修改集成模型指定构件属性")
|
|
|
|
+ @RequestMapping(value = "/modifyIntegrateElements/{integrateId}/{fileId}/{elementId}", method = RequestMethod.PUT)
|
|
|
|
+ public Response modifyIntegrateElements(@PathVariable String integrateId, @PathVariable String fileId, @PathVariable String elementId, @RequestBody JSONArray array) {
|
|
|
|
+ int cont = bimModelService.modifyIntegrateElements(integrateId, fileId, elementId, array);
|
|
|
|
+ if (cont == 1) {
|
|
|
|
+ return Response.ok();
|
|
|
|
+ }
|
|
|
|
+ return Response.fail(200000, "失败");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "删除单模型指定构件属性", notes = "删除单模型指定构件属性")
|
|
|
|
+ @RequestMapping(value = "/deleteElements/{fileId}/{elementId}", method = RequestMethod.DELETE)
|
|
|
|
+ public Response deleteElements(@PathVariable String fileId, @PathVariable String elementId, @RequestBody JSONArray array) {
|
|
|
|
+ int cont = bimModelService.deleteElements(fileId, elementId, array);
|
|
|
|
+ if (cont == 1) {
|
|
|
|
+ return Response.ok();
|
|
|
|
+ }
|
|
|
|
+ return Response.fail(200000, "失败");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "删除集成模型指定构件属性", notes = "删除集成模型指定构件属性")
|
|
|
|
+ @RequestMapping(value = "/deleteIntegrateElements/{integrateId}/{fileId}/{elementId}", method = RequestMethod.DELETE)
|
|
|
|
+ public Response deleteIntegrateElements(@PathVariable String integrateId, @PathVariable String fileId, @PathVariable String elementId, @RequestBody JSONArray array) {
|
|
|
|
+ int cont = bimModelService.deleteIntegrateElements(integrateId, fileId, elementId, array);
|
|
|
|
+ if (cont == 1) {
|
|
|
|
+ return Response.ok();
|
|
|
|
+ }
|
|
|
|
+ return Response.fail(200000, "失败");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "获取构件", notes = "获取构件")
|
|
|
|
+ @RequestMapping(value = "/getModelElements", method = RequestMethod.POST)
|
|
|
|
+ public Response getModelElements(@RequestBody JSONObject json) {
|
|
|
|
+ return Response.ok(bimModelService.getModelElements(json));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "按条件查询构件列表", notes = "按条件查询构件列表")
|
|
|
|
+ @RequestMapping(value = "/queryModelElements", method = RequestMethod.POST)
|
|
|
|
+ public Response queryModelElements(@RequestBody BimElement bimElement) {
|
|
|
|
+ return Response.ok(bimModelService.getModelElements(bimElement));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取分区
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation(value = "获取分区", notes = "获取分区")
|
|
|
|
+ @RequestMapping(value = "/partition/{integrateId}", method = RequestMethod.GET)
|
|
|
|
+ public Response partition(@PathVariable String integrateId) {
|
|
|
|
+ return Response.ok(bimModelService.partition(integrateId));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|