Sfoglia il codice sorgente

新增门、窗、虚拟墙相关接口

xujiaheng 3 anni fa
parent
commit
de5100ee99

+ 129 - 0
src/main/java/com/persagy/proxy/adm/controller/AdmDoorController.java

@@ -0,0 +1,129 @@
+package com.persagy.proxy.adm.controller;
+
+import cn.hutool.core.collection.CollUtil;
+import com.persagy.proxy.adm.constant.AdmCommonConstant;
+import com.persagy.proxy.adm.model.AdmDoor;
+import com.persagy.proxy.adm.request.AdmCreateRequest;
+import com.persagy.proxy.adm.request.AdmQueryCriteria;
+import com.persagy.proxy.adm.request.AdmResponse;
+import com.persagy.proxy.adm.service.IAdmDoorService;
+import com.persagy.proxy.adm.service.IAdmDoorService;
+import com.persagy.proxy.common.entity.InstanceUrlParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.ws.rs.QueryParam;
+import java.util.List;
+
+/**
+ * ADM 门 API
+ * @author xujiaheng
+ * @date 2021-09-06
+ */
+@RestController
+@RequestMapping("/object/door")
+public class AdmDoorController {
+
+    @Autowired
+    private IAdmDoorService service;
+    @Value("${middleware.group.code}")
+    private String groupCode;
+
+    /**
+     * 创建
+     * @param createRequest
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/create")
+    public AdmResponse create(@RequestBody AdmCreateRequest<AdmDoor> createRequest, @QueryParam("projectId") String projectId) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        List<AdmDoor> vos = CollUtil.newArrayList(createRequest.getContent());
+        vos = service.doInsert(context, AdmDoor.class, vos);
+        return AdmResponse.success(vos);
+    }
+
+    /**
+     * 创建(主键重复则忽略)
+     * @param createRequest
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/create_ignore")
+    public AdmResponse createIgnore(@RequestBody AdmCreateRequest<AdmDoor> createRequest, @QueryParam("projectId") String projectId) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        createRequest.getContent().forEach(request->{
+            //TODO
+        });
+        return AdmResponse.success();
+    }
+
+    /**
+     * 根据ID删除
+     * @param vos
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/delete")
+    public AdmResponse delete(@RequestBody List<AdmDoor> vos) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, null, AdmCommonConstant.APP_ID);
+        service.doDelete(context, vos);
+        return AdmResponse.success();
+    }
+
+    /**
+     * 更新
+     * @param createRequest
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/update")
+    public AdmResponse update(@RequestBody AdmCreateRequest<AdmDoor> createRequest, @QueryParam("projectId") String projectId) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        List<AdmDoor> vos = CollUtil.newArrayList(createRequest.getContent());
+        vos = service.doUpdate(context, AdmDoor.class, vos);
+        return AdmResponse.success(vos);
+    }
+
+    /**
+     * 查询
+     * @param projectId
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/query")
+    public AdmResponse query(@QueryParam("projectId") String projectId,
+                             @RequestBody AdmQueryCriteria request) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        request.setName("equipment");
+        request.setFilters("classCode = 'CFBEDR'");
+        return service.doQuery(context, request, AdmDoor.class);
+    }
+
+    /**
+     * 统计
+     * @param projectId
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/count")
+    public AdmResponse count(@QueryParam("projectId") String projectId,
+                             @RequestBody AdmQueryCriteria request) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        request.setName("equipment");
+        request.setOnlyCount(true);
+        return service.doQuery(context, request, AdmDoor.class);
+    }
+}

+ 128 - 0
src/main/java/com/persagy/proxy/adm/controller/AdmVirtualWallController.java

@@ -0,0 +1,128 @@
+package com.persagy.proxy.adm.controller;
+
+import cn.hutool.core.collection.CollUtil;
+import com.persagy.proxy.adm.constant.AdmCommonConstant;
+import com.persagy.proxy.adm.model.AdmVirtualWall;
+import com.persagy.proxy.adm.request.AdmCreateRequest;
+import com.persagy.proxy.adm.request.AdmQueryCriteria;
+import com.persagy.proxy.adm.request.AdmResponse;
+import com.persagy.proxy.adm.service.IAdmVirtualWallService;
+import com.persagy.proxy.common.entity.InstanceUrlParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.ws.rs.QueryParam;
+import java.util.List;
+
+/**
+ * ADM 窗户 API
+ * @author xujiaheng
+ * @date 2021-09-3
+ */
+@RestController
+@RequestMapping("/object/virtualWall")
+public class AdmVirtualWallController {
+
+    @Autowired
+    private IAdmVirtualWallService service;
+    @Value("${middleware.group.code}")
+    private String groupCode;
+
+    /**
+     * 创建
+     * @param createRequest
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/create")
+    public AdmResponse create(@RequestBody AdmCreateRequest<AdmVirtualWall> createRequest, @QueryParam("projectId") String projectId) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        List<AdmVirtualWall> vos = CollUtil.newArrayList(createRequest.getContent());
+        vos = service.doInsert(context, AdmVirtualWall.class, vos);
+        return AdmResponse.success(vos);
+    }
+
+    /**
+     * 创建(主键重复则忽略)
+     * @param createRequest
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/create_ignore")
+    public AdmResponse createIgnore(@RequestBody AdmCreateRequest<AdmVirtualWall> createRequest, @QueryParam("projectId") String projectId) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        createRequest.getContent().forEach(it->{
+            //TODO
+        });
+        return AdmResponse.success();
+    }
+
+    /**
+     * 根据ID删除
+     * @param vos
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/delete")
+    public AdmResponse delete(@RequestBody List<AdmVirtualWall> vos) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, null, AdmCommonConstant.APP_ID);
+        service.doDelete(context, vos);
+        return AdmResponse.success();
+    }
+
+    /**
+     * 更新
+     * @param createRequest
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/update")
+    public AdmResponse update(@RequestBody AdmCreateRequest<AdmVirtualWall> createRequest, @QueryParam("projectId") String projectId) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        List<AdmVirtualWall> vos = CollUtil.newArrayList(createRequest.getContent());
+        vos = service.doUpdate(context, AdmVirtualWall.class, vos);
+        return AdmResponse.success(vos);
+    }
+
+    /**
+     * 查询
+     * @param projectId
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/query")
+    public AdmResponse query(@QueryParam("projectId") String projectId,
+                             @RequestBody AdmQueryCriteria request) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        request.setName("equipment");
+        request.setFilters("classCode = 'VIRTUALWALL'");
+        return service.doQuery(context, request, AdmVirtualWall.class);
+    }
+
+    /**
+     * 统计
+     * @param projectId
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/count")
+    public AdmResponse count(@QueryParam("projectId") String projectId,
+                             @RequestBody AdmQueryCriteria request) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        request.setName("equipment");
+        request.setOnlyCount(true);
+        return service.doQuery(context, request, AdmVirtualWall.class);
+    }
+}

+ 128 - 0
src/main/java/com/persagy/proxy/adm/controller/AdmWindowController.java

@@ -0,0 +1,128 @@
+package com.persagy.proxy.adm.controller;
+
+import cn.hutool.core.collection.CollUtil;
+import com.persagy.proxy.adm.constant.AdmCommonConstant;
+import com.persagy.proxy.adm.model.AdmWindow;
+import com.persagy.proxy.adm.request.AdmCreateRequest;
+import com.persagy.proxy.adm.request.AdmQueryCriteria;
+import com.persagy.proxy.adm.request.AdmResponse;
+import com.persagy.proxy.adm.service.IAdmWindowService;
+import com.persagy.proxy.common.entity.InstanceUrlParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.ws.rs.QueryParam;
+import java.util.List;
+
+/**
+ * ADM 窗户 API
+ * @author xujiaheng
+ * @date 2021-09-3
+ */
+@RestController
+@RequestMapping("/object/window")
+public class AdmWindowController {
+
+    @Autowired
+    private IAdmWindowService service;
+    @Value("${middleware.group.code}")
+    private String groupCode;
+
+    /**
+     * 创建
+     * @param createRequest
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/create")
+    public AdmResponse create(@RequestBody AdmCreateRequest<AdmWindow> createRequest, @QueryParam("projectId") String projectId) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        List<AdmWindow> vos = CollUtil.newArrayList(createRequest.getContent());
+        vos = service.doInsert(context, AdmWindow.class, vos);
+        return AdmResponse.success(vos);
+    }
+
+    /**
+     * 创建(主键重复则忽略)
+     * @param createRequest
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/create_ignore")
+    public AdmResponse createIgnore(@RequestBody AdmCreateRequest<AdmWindow> createRequest, @QueryParam("projectId") String projectId) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        createRequest.getContent().forEach(request->{
+            //TODO
+        });
+        return AdmResponse.success();
+    }
+
+    /**
+     * 根据ID删除
+     * @param vos
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/delete")
+    public AdmResponse delete(@RequestBody List<AdmWindow> vos) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, null, AdmCommonConstant.APP_ID);
+        service.doDelete(context, vos);
+        return AdmResponse.success();
+    }
+
+    /**
+     * 更新
+     * @param createRequest
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/update")
+    public AdmResponse update(@RequestBody AdmCreateRequest<AdmWindow> createRequest, @QueryParam("projectId") String projectId) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        List<AdmWindow> vos = CollUtil.newArrayList(createRequest.getContent());
+        vos = service.doUpdate(context, AdmWindow.class, vos);
+        return AdmResponse.success(vos);
+    }
+
+    /**
+     * 查询
+     * @param projectId
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/query")
+    public AdmResponse query(@QueryParam("projectId") String projectId,
+                             @RequestBody AdmQueryCriteria request) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        request.setName("equipment");
+        request.setFilters("classCode = 'CFBEWN'");
+        return service.doQuery(context, request, AdmWindow.class);
+    }
+
+    /**
+     * 统计
+     * @param projectId
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/count")
+    public AdmResponse count(@QueryParam("projectId") String projectId,
+                             @RequestBody AdmQueryCriteria request) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        request.setName("equipment");
+        request.setOnlyCount(true);
+        return service.doQuery(context, request, AdmWindow.class);
+    }
+}

+ 51 - 0
src/main/java/com/persagy/proxy/adm/model/AdmDoor.java

@@ -0,0 +1,51 @@
+package com.persagy.proxy.adm.model;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * ADM 建筑 实体
+ * @author Charlie Yu
+ * @date 2021-08-16
+ */
+@Data
+public class AdmDoor {
+
+    /** 模型ID */
+    private String id;
+    /** 名称 */
+    private String name;
+    /** 模型所属楼层的id */
+    private String modelFloorId;
+    /** 定位点 */
+    private AdmLocation location;
+    /** 轮廓线 */
+    private List<List<AdmPoint>> outline;
+    /** 面方向 */
+    private AdmPoint faceDirection;
+    /** Hand方向 */
+    private AdmPoint handDirection;
+    /** 类型中文名称 */
+    private String familyName;
+    /** 族符号 */
+    private String familySymbol;
+    /** 厚度 */
+    private String thick;
+    /** 所属墙 */
+    private String wallId;
+    /** 拥有者的RevitId */
+    private String owner;
+    /** 模型id(外键) */
+    private String modelId;
+    /** 类型 */
+    private String elementType;
+    /** revit模型中的id */
+    private String revitId;
+    /** 对应Revit模型id */
+    private String sourceId;
+
+    private String classCode = "CFBEDR";
+    private String objectType = "equipment";
+
+}

+ 9 - 0
src/main/java/com/persagy/proxy/adm/model/AdmLocation.java

@@ -0,0 +1,9 @@
+package com.persagy.proxy.adm.model;
+
+import java.util.List;
+
+public class AdmLocation {
+
+    private String type;
+    private List<AdmPoint> points;
+}

+ 9 - 0
src/main/java/com/persagy/proxy/adm/model/AdmPoint.java

@@ -0,0 +1,9 @@
+package com.persagy.proxy.adm.model;
+
+import lombok.Data;
+
+public class AdmPoint {
+    private Double x;
+    private Double y;
+    private Double z;
+}

+ 37 - 0
src/main/java/com/persagy/proxy/adm/model/AdmVirtualWall.java

@@ -0,0 +1,37 @@
+package com.persagy.proxy.adm.model;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * ADM 虚拟墙 实体
+ * @author xujiaheng
+ * @date 2021-09-06
+ */
+@Data
+public class AdmVirtualWall {
+
+    /** 模型ID */
+    private String id;
+    /** 名称 */
+    private String name;
+    /** 模型所属楼层的id */
+    private String modelFloorId;
+    /** 定位点 */
+    private AdmLocation location;
+    /** 轮廓线 */
+    private List<List<AdmPoint>> outline;
+    /** 模型id(外键) */
+    private String modelId;
+    /** 类型 */
+    private String elementType;
+    /** revit模型中的id */
+    private String revitId;
+    /** 对应Revit模型id */
+    private String sourceId;
+
+    private String classCode = "VIRTUALWALL";
+    private String objectType = "equipment";
+
+}

+ 53 - 0
src/main/java/com/persagy/proxy/adm/model/AdmWindow.java

@@ -0,0 +1,53 @@
+package com.persagy.proxy.adm.model;
+
+import com.persagy.proxy.adm.annotations.CascadeColumn;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * ADM 建筑 实体
+ * @author Charlie Yu
+ * @date 2021-08-16
+ */
+@Data
+public class AdmWindow {
+
+    /** ID */
+    private String id;
+    /** 模型所属楼层的id */
+    private String modelFloorId;
+    /** 模型id(外键) */
+    private String modelId;
+    /** 类型 */
+    private String elementType;
+    /** revit模型中的id */
+    private String revitId;
+    /** 对应Revit模型id */
+    private String sourceId;
+    /** 所属墙 */
+    private String wallId;
+    /** 拥有者的RevitId */
+    private String owner;
+    /** 名称 */
+    private String name;
+    /** 宽度 */
+    private Double width;
+    /** 定位点 */
+    private AdmLocation location;
+    /** 轮廓线 */
+    private List<List<AdmPoint>> outline;
+    /** 类型中文名称 */
+    private String familyName;
+    /** 族符号 */
+    private String familySymbol;
+    /** 厚度 */
+    private Double thick;
+
+    private String classCode = "CFBEWN";
+
+    private String objectType = "equipment";
+
+}

+ 10 - 0
src/main/java/com/persagy/proxy/adm/service/IAdmDoorService.java

@@ -0,0 +1,10 @@
+package com.persagy.proxy.adm.service;
+
+import com.persagy.proxy.adm.model.AdmDoor;
+/**
+ * ADM 门接口类
+ * @author xujiaheng
+ * @date 2021-09-16
+ */
+public interface IAdmDoorService extends IAdmBaseService<AdmDoor> {
+}

+ 11 - 0
src/main/java/com/persagy/proxy/adm/service/IAdmVirtualWallService.java

@@ -0,0 +1,11 @@
+package com.persagy.proxy.adm.service;
+
+import com.persagy.proxy.adm.model.AdmVirtualWall;
+
+/**
+ * ADM 建筑 接口类
+ * @author Charlie Yu
+ * @date 2021-08-16
+ */
+public interface IAdmVirtualWallService extends IAdmBaseService<AdmVirtualWall> {
+}

+ 11 - 0
src/main/java/com/persagy/proxy/adm/service/IAdmWindowService.java

@@ -0,0 +1,11 @@
+package com.persagy.proxy.adm.service;
+
+import com.persagy.proxy.adm.model.AdmWindow;
+
+/**
+ * ADM 建筑 接口类
+ * @author Charlie Yu
+ * @date 2021-08-16
+ */
+public interface IAdmWindowService extends IAdmBaseService<AdmWindow> {
+}

+ 16 - 0
src/main/java/com/persagy/proxy/adm/service/impl/AdmDoorServiceImpl.java

@@ -0,0 +1,16 @@
+package com.persagy.proxy.adm.service.impl;
+
+import com.persagy.proxy.adm.model.AdmDoor;
+import com.persagy.proxy.adm.service.IAdmDoorService;
+import org.springframework.stereotype.Service;
+
+/**
+ * ADM 建筑 实现类
+ * @author Charlie Yu
+ * @date 2021-08-16
+ */
+@Service
+public class AdmDoorServiceImpl extends AbstractAdmBaseServiceImpl<AdmDoor> implements IAdmDoorService {
+
+
+}

+ 16 - 0
src/main/java/com/persagy/proxy/adm/service/impl/AdmVirtualWallServiceImpl.java

@@ -0,0 +1,16 @@
+package com.persagy.proxy.adm.service.impl;
+
+import com.persagy.proxy.adm.model.AdmVirtualWall;
+import com.persagy.proxy.adm.service.IAdmVirtualWallService;
+import org.springframework.stereotype.Service;
+
+/**
+ * ADM 建筑 实现类
+ * @author Charlie Yu
+ * @date 2021-08-16
+ */
+@Service
+public class AdmVirtualWallServiceImpl extends AbstractAdmBaseServiceImpl<AdmVirtualWall> implements IAdmVirtualWallService {
+
+
+}

+ 16 - 0
src/main/java/com/persagy/proxy/adm/service/impl/AdmWindowServiceImpl.java

@@ -0,0 +1,16 @@
+package com.persagy.proxy.adm.service.impl;
+
+import com.persagy.proxy.adm.model.AdmWindow;
+import com.persagy.proxy.adm.service.IAdmWindowService;
+import org.springframework.stereotype.Service;
+
+/**
+ * ADM 建筑 实现类
+ * @author Charlie Yu
+ * @date 2021-08-16
+ */
+@Service
+public class AdmWindowServiceImpl extends AbstractAdmBaseServiceImpl<AdmWindow> implements IAdmWindowService {
+
+
+}