Quellcode durchsuchen

Merge remote-tracking branch 'origin/develop' into develop

lijie vor 2 Jahren
Ursprung
Commit
bcf6dd8a6a

+ 6 - 4
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/util/GsonUtil.java

@@ -1,6 +1,7 @@
 package com.persagy.adm.diagram.core.util;
 
 import com.google.gson.*;
+import com.persagy.adm.diagram.core.model.DiagramNode;
 import com.persagy.adm.diagram.core.model.EquipmentNode;
 import com.persagy.adm.diagram.core.model.Label;
 import com.persagy.adm.diagram.core.model.base.Container;
@@ -29,6 +30,7 @@ public class GsonUtil {
 		GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
 		gsonBuilder.registerTypeAdapter(IComponent.class, new CompAdapter());
 		gsonBuilder.registerTypeAdapter(DataFilter.class, new FilterAdapter());
+		gsonBuilder.registerTypeAdapter(DiagramNode.class, new CompAdapter());
 		gson = gsonBuilder.create();
 
 		formattedGson = new GsonBuilder().setPrettyPrinting().create();
@@ -48,13 +50,13 @@ public class GsonUtil {
 		@Override
 		public IComponent deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException {
 			Class<? extends IComponent> target = Container.class;
-			if(Container.TYPE.equals(jsonElement.getAsJsonObject().get("compType")))
+			if(Container.TYPE.equals(jsonElement.getAsJsonObject().get("compType").getAsString()))
 				target = Container.class;
-			else if(EquipmentNode.TYPE.equals(jsonElement.getAsJsonObject().get("compType")))
+			else if(EquipmentNode.TYPE.equals(jsonElement.getAsJsonObject().get("compType").getAsString()))
 				target = EquipmentNode.class;
-			else if(PackNode.TYPE.equals(jsonElement.getAsJsonObject().get("compType")))
+			else if(PackNode.TYPE.equals(jsonElement.getAsJsonObject().get("compType").getAsString()))
 				target = PackNode.class;
-			else if(Label.TYPE.equals(jsonElement.getAsJsonObject().get("compType")))
+			else if(Label.TYPE.equals(jsonElement.getAsJsonObject().get("compType").getAsString()))
 				target = Label.class;
 			else {
 				//TODO 其他类型

+ 2 - 2
adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/controller/DataMigrationController.java

@@ -182,12 +182,12 @@ public class DataMigrationController {
             buff.flush();
             buff.close();
         } catch (Exception e) {
-            log.error("导出文件文件出错:{}",e);
+            log.error(String.format("导出文件文件出错:{}",e));
         } finally {try {
             buff.close();
             outStr.close();
         } catch (Exception e) {
-            log.error("关闭流对象出错 e:{}",e);
+            log.error(String.format("关闭流对象出错 e:{}",e));
         }
         }
     }

+ 19 - 3
adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/DefineInfoMigration.java

@@ -155,27 +155,37 @@ public class DefineInfoMigration extends MigrationAbstractServiceImpl<ObjectInfo
             sqls.append("'").append(infoDefine.getProjectId()).append("',");
             sqls.append("'").append(infoDefine.getCategory()).append("',");
             sqls.append("'").append(infoDefine.getFirstTag()).append("',");
-            sqls.append("'").append(infoDefine.getSecondTag()).append("',");
+            if (infoDefine.getSecondTag() == null) {
+                infoDefine.getSecondTag();
+            } else {
+                sqls.append("'").append(infoDefine.getSecondTag()).append("',");
+            }
+
             sqls.append("'").append(infoDefine.getPriority()).append("',");
             sqls.append("'").append(infoDefine.getInputMode()).append("',");
+
             if (infoDefine.getUnit() == null) {
                 sqls.append(infoDefine.getUnit()).append(",");
             } else {
                 sqls.append("'").append(infoDefine.getUnit()).append("',");
             }
+
             sqls.append("'").append(infoDefine.getDataType()).append("',");
             sqls.append(infoDefine.getIsMultiple()?1:0).append(",");
             sqls.append(infoDefine.getIsRegion()?1:0).append(",");
+
             if (infoDefine.getFormater() == null) {
                 sqls.append(infoDefine.getFormater()).append(",");
             } else {
                 sqls.append("'").append(infoDefine.getFormater()).append("',");
             }
+
             if (infoDefine.getDataSource() == null) {
                 sqls.append(infoDefine.getDataSource()).append(",");
             } else {
                 sqls.append("'").append(infoDefine.getDataSource()).append("',");
             }
+
             if (infoDefine.getRemark() == null) {
                 sqls.append(infoDefine.getRemark()).append(",");
             } else {
@@ -184,7 +194,13 @@ public class DefineInfoMigration extends MigrationAbstractServiceImpl<ObjectInfo
             sqls.append(infoDefine.getSubFlag()?1:0).append(",");
             sqls.append(infoDefine.getWeakPoint()?1:0).append(",");
             sqls.append(infoDefine.getShowOrder()).append(",");
-            sqls.append("'").append(infoDefine.getVersion()).append("',");
+
+            if (infoDefine.getVersion() == null) {
+                infoDefine.getVersion();
+            } else {
+                sqls.append("'").append(infoDefine.getVersion()).append("',");
+            }
+
             sqls.append(infoDefine.getSourceFrom()).append(",");
             sqls.append("'").append(infoDefine.getCreator()).append("',");
             sqls.append("'").append(infoDefine.getCreationTime()).append("',");
@@ -197,7 +213,7 @@ public class DefineInfoMigration extends MigrationAbstractServiceImpl<ObjectInfo
             if (infoDefine.getModifiedTime() == null) {
                 sqls.append(infoDefine.getModifiedTime()).append(",");
             } else {
-                sqls.append("'").append(infoDefine.getModifiedTime()).append(",");
+                sqls.append("'").append(infoDefine.getModifiedTime()).append("',");
             }
             sqls.append(infoDefine.getValid());
             sqls.append(")\n ,");

+ 15 - 18
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/controller/AdmFileController.java

@@ -5,9 +5,9 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.persagy.bdtp.adm.common.AdmResult;
 import com.persagy.bdtp.adm.dao.AdmFileMapper;
+import com.persagy.bdtp.adm.entity.AdmCad;
 import com.persagy.bdtp.adm.entity.CadFileQueryParam;
-import com.persagy.bdtp.adm.entity.db.AdmFile;
-import com.persagy.bdtp.adm.service.IAdmFileService;
+import com.persagy.bdtp.adm.service.IAdmCadService;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -15,10 +15,7 @@ import org.springframework.web.bind.annotation.*;
 import java.util.List;
 
 /**
- * <p>
- * 文件附件 前端控制器
- * </p>
- *
+ * ADM文件服务
  * @author yanguofeng
  * @since 2022-01-10
  */
@@ -27,7 +24,7 @@ import java.util.List;
 public class AdmFileController {
 
     @Autowired
-    IAdmFileService iAdmFileService;
+    IAdmCadService iAdmCadService;
     @Autowired
     AdmFileMapper admFileMapper;
 
@@ -36,22 +33,22 @@ public class AdmFileController {
      */
 
     @PostMapping("/queryCadFiles")
-    public AdmResult<List<AdmFile>> queryCadFiles(@RequestBody CadFileQueryParam queryParam){
-        Wrapper<AdmFile> eq = new LambdaQueryWrapper<AdmFile>()
-                .eq(StringUtils.isNotBlank(queryParam.getProjectId()), AdmFile::getProjectId, queryParam.getProjectId())
-                .eq(StringUtils.isNotBlank(queryParam.getBuildingId()),AdmFile::getBuildingId,queryParam.getBuildingId())
-                .eq(StringUtils.isNotBlank(queryParam.getFloorId()),AdmFile::getFloorId,queryParam.getFloorId())
-                .eq(StringUtils.isNotBlank(queryParam.getFileId()),AdmFile::getFileId,queryParam.getFileId())
-                .eq(StringUtils.isNotBlank(queryParam.getBizType()),AdmFile::getBizType,queryParam.getBizType());
-        return AdmResult.success(iAdmFileService.list(eq));
+    public AdmResult<List<AdmCad>> queryCadFiles(@RequestBody CadFileQueryParam queryParam){
+        Wrapper<AdmCad> eq = new LambdaQueryWrapper<AdmCad>()
+                .eq(StringUtils.isNotBlank(queryParam.getProjectId()), AdmCad::getProjectId, queryParam.getProjectId())
+                .eq(StringUtils.isNotBlank(queryParam.getBuildingId()),AdmCad::getBuildingId,queryParam.getBuildingId())
+                .eq(StringUtils.isNotBlank(queryParam.getFloorId()),AdmCad::getFloorId,queryParam.getFloorId())
+                .eq(StringUtils.isNotBlank(queryParam.getFileKey()),AdmCad::getFileKey,queryParam.getFileKey())
+                .eq(StringUtils.isNotBlank(queryParam.getMajorCode()),AdmCad::getMajorCode,queryParam.getMajorCode());
+        return AdmResult.success(iAdmCadService.list(eq));
     }
 
     /**
      * 保存CAD文件信息
      */
     @PostMapping("/saveCadFileInfo")
-    public AdmResult<Void> saveCadFileInfo(@RequestBody List<AdmFile> admFiles){
-        iAdmFileService.saveOrUpdateBatch(admFiles);
+    public AdmResult<Void> saveCadFileInfo(@RequestBody List<AdmCad> admFiles){
+        iAdmCadService.saveOrUpdateBatch(admFiles);
         return AdmResult.success(null);
     }
 
@@ -61,7 +58,7 @@ public class AdmFileController {
      */
     @PostMapping("/delete")
     public AdmResult<Void> delete(@RequestParam("id") String id){
-        iAdmFileService.removeById(id);
+        iAdmCadService.removeById(id);
         return AdmResult.success(null);
     }
 }

+ 16 - 0
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmCadMapper.java

@@ -0,0 +1,16 @@
+package com.persagy.bdtp.adm.dao;
+
+import com.persagy.bdtp.adm.entity.AdmCad;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * CAD图纸信息表 Mapper 接口
+ * </p>
+ *
+ * @author yanguofeng
+ * @since 2022-01-12
+ */
+public interface AdmCadMapper extends BaseMapper<AdmCad> {
+
+}

+ 72 - 0
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/AdmCad.java

@@ -0,0 +1,72 @@
+package com.persagy.bdtp.adm.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+import com.persagy.bdtp.adm.entity.db.BaseAdmDataEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * CAD图纸信息表
+ * </p>
+ *
+ * @author yanguofeng
+ * @since 2022-01-12
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class AdmCad extends BaseAdmDataEntity implements Serializable {
+
+    /**
+     * 存储系统的key
+     */
+    @TableField("file_key")
+    private String fileKey;
+
+    /**
+     * 文件名称
+     */
+    @TableField("file_name")
+    private String fileName;
+
+    /**
+     * 所属专业编码 土建精装-CF|空调-AC|给排水-WS|消防-FF
+     */
+    @TableField("major_code")
+    private String majorCode;
+
+    /**
+     * 所属专业名称
+     */
+    @TableField("major_name")
+    private String majorName;
+
+    /**
+     * 核查状态 0-未完成 1-已完成
+     */
+    @TableField("check_status")
+    private Boolean checkStatus;
+
+    /**
+     * 楼层ID
+     */
+    @TableField("floor_id")
+    private String floorId;
+
+    /**
+     * 建筑ID
+     */
+    @TableField("building_id")
+    private String buildingId;
+
+    /**
+     * 项目ID
+     */
+    @TableField("project_id")
+    private String projectId;
+
+
+}

+ 14 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/CadFileQueryParam.java

@@ -7,12 +7,24 @@ import lombok.Data;
  */
 @Data
 public class CadFileQueryParam {
+    /**
+     * 项目ID
+     */
     private String projectId;
+    /**
+     * 建筑ID
+     */
     private String buildingId;
+    /**
+     * 楼层ID
+     */
     private String floorId;
-    private String fileId;
+    /**
+     * CAD图纸文件的key
+     */
+    private String fileKey;
     /**
      * 土建精装-CF,空调-AC,给排水-WS,消防-FF
      */
-    private String bizType;
+    private String majorCode;
 }

+ 16 - 0
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/service/IAdmCadService.java

@@ -0,0 +1,16 @@
+package com.persagy.bdtp.adm.service;
+
+import com.persagy.bdtp.adm.entity.AdmCad;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * CAD图纸信息表 服务类
+ * </p>
+ *
+ * @author yanguofeng
+ * @since 2022-01-12
+ */
+public interface IAdmCadService extends IService<AdmCad> {
+
+}

+ 20 - 0
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/service/impl/AdmCadServiceImpl.java

@@ -0,0 +1,20 @@
+package com.persagy.bdtp.adm.service.impl;
+
+import com.persagy.bdtp.adm.entity.AdmCad;
+import com.persagy.bdtp.adm.dao.AdmCadMapper;
+import com.persagy.bdtp.adm.service.IAdmCadService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * CAD图纸信息表 服务实现类
+ * </p>
+ *
+ * @author yanguofeng
+ * @since 2022-01-12
+ */
+@Service
+public class AdmCadServiceImpl extends ServiceImpl<AdmCadMapper, AdmCad> implements IAdmCadService {
+
+}

+ 5 - 0
adm-business/adm-server/src/main/resources/mapper/AdmCadMapper.xml

@@ -0,0 +1,5 @@
+<?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.persagy.bdtp.adm.dao.AdmCadMapper">
+
+</mapper>