Browse Source

版本管理移到医学术语维护

gaodm 5 năm trước cách đây
mục cha
commit
82ab8ad743

+ 10 - 0
knowledgeman-service/src/main/java/com/diagbot/dto/VersionWrapperDTO.java

@@ -30,6 +30,16 @@ public class VersionWrapperDTO {
 	//private String creator;
 	
 	private String modifierid;
+	/**
+	 * 产品类型
+	 */
+	private Integer productType;
+
+	/**
+	 * 产品类型名称
+	 */
+	private String productTypeName;
+
 	/**
 	 * 名称
 	 */

+ 16 - 5
knowledgeman-service/src/main/java/com/diagbot/facade/VersionInfoFacade.java

@@ -13,6 +13,7 @@ import com.diagbot.dto.VersionWrapperDTO;
 import com.diagbot.entity.VersionDetail;
 import com.diagbot.entity.VersionInfo;
 import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.enums.ProductTypeEnum;
 import com.diagbot.enums.StatusEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
@@ -88,6 +89,8 @@ public class VersionInfoFacade extends VersionInfoServiceImpl {
             VersionWrapperDTO versionList = new VersionWrapperDTO();
             versionList.setId(versionInfo.getId());
             versionList.setGmtCreate(versionInfo.getGmtCreate());
+            versionList.setProductType(versionInfo.getProductType());
+            versionList.setProductTypeName(ProductTypeEnum.getName(versionInfo.getProductType()));
             versionList.setName(versionInfo.getName());
             versionList.setModifierid(userNames.get(versionInfo.getModifierid()));
             versionList.setRefreshTime(versionInfo.getRefreshTime());
@@ -127,18 +130,22 @@ public class VersionInfoFacade extends VersionInfoServiceImpl {
      * @return
      */
     public boolean saveVersionInfoAll(VersionInfoVO versionInfoVO) {
-        // 1.判断该版本号是否存在名字相同的数据
+        // 1.判断摸个产品该版本号是否存在名字相同的数据
         QueryWrapper<VersionInfo> templateInfoFand = new QueryWrapper<>();
-        templateInfoFand.eq("name", versionInfoVO.getName()).eq("is_deleted", IsDeleteEnum.N.getKey());
+        templateInfoFand.eq("product_type", versionInfoVO.getProductType())
+                .eq("name", versionInfoVO.getName())
+                .eq("is_deleted", IsDeleteEnum.N.getKey());
+
         VersionInfo dataInfo = getOne(templateInfoFand);
         if (dataInfo != null) {
-            throw new CommonException(CommonErrorCode.NOT_EXISTS, "该版本号已存在");
+            throw new CommonException(CommonErrorCode.NOT_EXISTS, "该产品该版本号已存在");
         }
 
         // 增加版本数据
         VersionInfo versionInfo = new VersionInfo();
         versionInfo.setCreator(UserUtils.getCurrentPrincipleID());
         versionInfo.setGmtCreate(DateUtil.now());
+        versionInfo.setProductType(versionInfo.getProductType());
         versionInfo.setName(versionInfoVO.getName());
         versionInfo.setGmtModified(DateUtil.now());
         versionInfo.setModifier(UserUtils.getCurrentPrincipleID());
@@ -188,14 +195,18 @@ public class VersionInfoFacade extends VersionInfoServiceImpl {
         checkExist(versionInfoVO.getId());
         // 2.判断该版本号是否存在名字相同的数据
         QueryWrapper<VersionInfo> templateInfoFand = new QueryWrapper<>();
-        templateInfoFand.eq("name", versionInfoVO.getName()).eq("is_deleted", IsDeleteEnum.N.getKey());
+        templateInfoFand.eq("product_type", versionInfoVO.getProductType())
+                .eq("name", versionInfoVO.getName())
+                .eq("is_deleted", IsDeleteEnum.N.getKey());
+
         VersionInfo dataInfo = getOne(templateInfoFand);
         if (dataInfo != null && !dataInfo.getId().equals(versionInfoVO.getId())) {
-            throw new CommonException(CommonErrorCode.NOT_EXISTS, "该版本号已存在");
+            throw new CommonException(CommonErrorCode.NOT_EXISTS, "该产品该版本号已存在");
         }
         // 3.修改版本信息
         VersionInfo versionInfo = new VersionInfo();
         versionInfo.setId(versionInfoVO.getId());// 模板id
+        versionInfo.setProductType(versionInfoVO.getProductType());
         versionInfo.setName(versionInfoVO.getName());// 模板名称
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
         if (versionInfoVO.getRefreshTime() != null) {

+ 3 - 1
knowledgeman-service/src/main/java/com/diagbot/service/impl/EnumsDataServiceImpl.java

@@ -3,6 +3,7 @@ package com.diagbot.service.impl;
 import java.util.List;
 import java.util.Map;
 
+import com.diagbot.enums.ProductTypeEnum;
 import org.springframework.stereotype.Service;
 
 import com.diagbot.enums.DisclaimerCodeEnum;
@@ -32,7 +33,8 @@ public class EnumsDataServiceImpl implements EnumsDataService {
                 .addEnums("positionTypeEnum", PositionTypeEnum.values())
                 .addEnums("lexiconRSTypeEnum", LexiconRSTypeEnum.INCLUDE_OF, LexiconRSTypeEnum.PUSH)
                 .addEnums("lexiconTypeEnum", LexiconTypeEnum.values())
-                .addEnums("concatLexiconTypeEnum", 
+                .addEnums("productTypeEnum", ProductTypeEnum.values())
+                .addEnums("concatLexiconTypeEnum",
                 		LexiconTypeEnum.SYMPTOM,LexiconTypeEnum.BODYPART,LexiconTypeEnum.LIS_PACKAGE,LexiconTypeEnum.PACS_PACKAGE,
                 		LexiconTypeEnum.PACS_ITEMS,LexiconTypeEnum.DIAGNOSIS,LexiconTypeEnum.PACS_CATEGORY_BIG,LexiconTypeEnum.PACS_CATEGORY_SMALL,
                 		LexiconTypeEnum.DEPARTMENT,LexiconTypeEnum.GAUGE,LexiconTypeEnum.SIDE_EFFECTS,LexiconTypeEnum.CORE_INDICATORS,

+ 9 - 5
knowledgeman-service/src/main/java/com/diagbot/vo/VersionInfoAllVO.java

@@ -1,13 +1,10 @@
 package com.diagbot.vo;
 
-import java.util.Date;
-
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.NotNull;
-
 import lombok.Getter;
 import lombok.Setter;
 
+import javax.validation.constraints.NotNull;
+
 /**
  * 更新版本信息
  * @author wangfeng
@@ -22,6 +19,13 @@ public class VersionInfoAllVO {
 	 */
 	@NotNull(message = "请输入id")
 	private Long id;
+
+	/**
+	 * 产品类型
+	 */
+	@NotNull(message = "产品类型不能为空")
+	private Integer productType;
+
 	/**
      * 名称
      */

+ 7 - 0
knowledgeman-service/src/main/java/com/diagbot/vo/VersionInfoVO.java

@@ -4,6 +4,7 @@ import java.util.Date;
 import java.util.List;
 
 import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
 
 import lombok.Getter;
 import lombok.Setter;
@@ -23,6 +24,12 @@ public class VersionInfoVO {
 	 * 用户id
 	 */
 	//private Long id;
+    /**
+     * 产品类型
+     */
+    @NotNull(message = "产品类型不能为空")
+    private Integer productType;
+
 	/**
      * 名称
      */

+ 6 - 0
knowledgeman-service/src/main/java/com/diagbot/vo/VersionWrapperNameVO.java

@@ -14,6 +14,12 @@ import lombok.Setter;
 @Getter
 @Setter
 public class VersionWrapperNameVO extends Page{
+
+    /**
+     * 产品类型
+     */
+    private Integer productType;
+
 	/**
      * 名称
      */

+ 5 - 1
knowledgeman-service/src/main/resources/mapper/VersionInfoMapper.xml

@@ -21,16 +21,20 @@
 	id as id,
 	gmt_create as gmtCreate,
 	modifier as modifierid,
+	product_type as productType,
 	name as name,
 	refresh_time as
 	refreshTime,
 	status as status,
 	remark as remark
-	FROM icss_version_info u
+	FROM kl_version_info u
 	WHERE u.is_deleted = 'N' AND u.status = 1
 	<if test="versionWrapperNameVO.name != null">
 		AND u.name LIKE CONCAT('%', #{versionWrapperNameVO.name}, '%')
 	</if>
+	<if test="versionWrapperNameVO.productType != null and versionWrapperNameVO.productType != ''">
+		AND u.product_type = #{versionWrapperNameVO.productType}
+	</if>
 	ORDER BY gmt_create DESC
 </select>
 </mapper>