浏览代码

Merge branch 'develop' of http://39.106.8.246:3003/BDTP/digital-delivery into develop

lijie 2 年之前
父节点
当前提交
6f4582da58

+ 11 - 0
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/controller/DiagramController.java

@@ -303,4 +303,15 @@ public class DiagramController {
     public CommonResult<Map<String, Boolean>> querySystemInstanceDiagramList() {
         return ResultHelper.single(dataStrategy.querySystemInstanceDiagramList());
     }
+
+    /**
+     * 判断系统图名称是否重复  true:重复,false:不重复
+     *
+     * @return 是否成功
+     */
+    @ApiOperation("判断系统图名称是否重复")
+    @PostMapping("/judge/name/duplicate")
+    public CommonResult<Boolean> judgeNameDuplicate(@RequestBody Map<String, String> params) {
+        return ResultHelper.single(dataStrategy.judgeNameDuplicate(params.get("name")));
+    }
 }

+ 8 - 0
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/DataStrategy.java

@@ -248,4 +248,12 @@ public interface DataStrategy {
      * @return 是否成功
      */
     boolean updateName(String name, String id);
+
+    /**
+     * 判断系统图名称是否重复
+     *
+     * @param name 系统图名称
+     * @return 是否重复
+     */
+    boolean judgeNameDuplicate(String name);
 }

+ 17 - 0
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/impl/DataStrategyImpl.java

@@ -715,4 +715,21 @@ public class DataStrategyImpl implements DataStrategy {
         diagramMapper.updateById(entity);
         return true;
     }
+
+    /**
+     * 判断系统图名称是否重复
+     *
+     * @param name 系统图名称
+     * @return 是否重复
+     */
+    @Override
+    public boolean judgeNameDuplicate(String name) {
+        if (StrUtil.isBlank(name)) {
+            throw new BusinessException(ResponseCode.A0400.getCode(), "名称参数为空");
+        }
+        BdtpRequest req = BdtpRequest.getCurrent();
+        String projectId = req.getProjectId();
+        List<DiagramEntity> diagramEntities = diagramMapper.selectByName(projectId, name);
+        return CollectionUtil.isNotEmpty(diagramEntities);
+    }
 }

+ 29 - 1
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/style/BaseStyle.java

@@ -18,7 +18,7 @@ public class BaseStyle {
 	 * 字体大小
 	 */
 	@Expose
-	protected int fontSize = 10;
+	protected int fontSize = 16;
 
 	/**
 	 * 字体颜色
@@ -27,6 +27,18 @@ public class BaseStyle {
 	protected String fontColor = "#000000";
 
 	/**
+	 * 字体粗细
+	 */
+	@Expose
+	protected int fontWeight = 500;
+
+	/**
+	 * 字体名称
+	 */
+	@Expose
+	protected String fontName;
+
+	/**
 	 * 预定义好的样式类Id
 	 */
 	@Expose
@@ -64,6 +76,22 @@ public class BaseStyle {
 		this.fontColor = fontColor;
 	}
 
+	public int getFontWeight() {
+		return fontWeight;
+	}
+
+	public void setFontWeight(int fontWeight) {
+		this.fontWeight = fontWeight;
+	}
+
+	public String getFontName() {
+		return fontName;
+	}
+
+	public void setFontName(String fontName) {
+		this.fontName = fontName;
+	}
+
 	public String getClassId() {
 		return classId;
 	}

+ 8 - 0
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/dao/DiagramMapper.java

@@ -64,4 +64,12 @@ public interface DiagramMapper extends BaseMapper<DiagramEntity> {
      */
     DiagramEntity getDiagram(String diagramId);
 
+    /**
+     * 判断系统图名称是否重复
+     *
+     * @param projectId 项目id
+     * @param name      系统图名称
+     * @return 是否重复
+     */
+    List<DiagramEntity> selectByName( String projectId, String name);
 }

+ 5 - 0
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/demo/DemoDataStrategy.java

@@ -423,4 +423,9 @@ public class DemoDataStrategy implements DataStrategy {
     public boolean updateName(String name, String id) {
         return false;
     }
+
+    @Override
+    public boolean judgeNameDuplicate(String name) {
+        return false;
+    }
 }

+ 7 - 0
adm-business/adm-diagram/src/main/resources/mapper/Diagram.xml

@@ -87,6 +87,13 @@
         </if>
     </select>
 
+    <select id="selectByName" resultMap="diagramBaseMap">
+        SELECT
+        <include refid="baseSql"/>
+        FROM diagram
+        WHERE project_id=#{projectId} AND name=#{name} AND valid = 1
+    </select>
+
 </mapper>