Browse Source

返回诊断类型

zhoutg 6 years ago
parent
commit
edad5ba59d

+ 1 - 0
icssman-service/src/main/java/com/diagbot/dto/QuestionDTO.java

@@ -41,5 +41,6 @@ public class QuestionDTO {
     private String formulaCode; //公式编码
     private List<QuestionDetail> questionDetailList = new ArrayList<>(); //标签明细表
     private List<QuestionDTO> questionMapping = new ArrayList<>();     //下级标签
+    private Integer disType;//诊断类型
     private String remark;//备注
 }

+ 8 - 1
icssman-service/src/main/java/com/diagbot/facade/QuestionFacade.java

@@ -24,6 +24,7 @@ import com.diagbot.entity.VitalOrder;
 import com.diagbot.entity.wrapper.QuestionInfoWrapper;
 import com.diagbot.entity.wrapper.QuestionMappingWrapper;
 import com.diagbot.entity.wrapper.QuestionWrapper;
+import com.diagbot.enums.DisTypeEnum;
 import com.diagbot.enums.InsertOrUpdateEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.QuestionTypeEnum;
@@ -528,7 +529,7 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
                         .set("is_deleted", IsDeleteEnum.Y.getKey()));
             }
             //如果是量表
-            if(deleteQuestionVO.getType() == QuestionTypeEnum.Scale.getKey()){
+            if (deleteQuestionVO.getType() == QuestionTypeEnum.Scale.getKey()) {
                 //删除诊断和量表的映射关系
                 disScaleFacade.update(new DisScale(), new UpdateWrapper<DisScale>()
                         .eq("scale_id", id)
@@ -683,6 +684,12 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
         }
         QuestionDTO res = new QuestionDTO();
         BeanUtil.copyProperties(questionInfo, res);
+        if (questionInfo.getType() == QuestionTypeEnum.Disease.getKey()) {
+            DisType disType = disTypeFacade.getOne(new QueryWrapper<DisType>()
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .eq("dis_id", questionInfo.getId()));
+            res.setDisType(disType == null ? DisTypeEnum.COMMON.getKey() : disType.getType());
+        }
 
         //获取明细项
         List<QuestionDetail> questionDetailList = questionDetailFacade.getByQuestionId(questionVO.getId());

+ 59 - 59
icssman-service/src/main/java/com/diagbot/facade/ScaleContentFacade.java

@@ -37,66 +37,66 @@ import java.util.stream.Collectors;
 @Component
 public class ScaleContentFacade extends ScaleContentServiceImpl {
 
-	@Autowired
-	@Qualifier("scaleContentServiceImpl")
-	ScaleContentService scaleContentService;
-	@Autowired
-	UserServiceClient userServiceClient;
+    @Autowired
+    @Qualifier("scaleContentServiceImpl")
+    ScaleContentService scaleContentService;
+    @Autowired
+    UserServiceClient userServiceClient;
 
-	/**
-	 * 量表内容新增或更新
-	 *
-	 * @param scaleContentSaveVO
-	 */
-	public void  insertOrUpdate(ScaleContentSaveVO scaleContentSaveVO) {
-		Long scaleId = scaleContentSaveVO.getScaleId();
-		Date now = DateUtil.now();
-		String userId = "ddd";
-		//删除原关联内容
-		if(scaleId != null) {
-			this.update(new ScaleContent(), new UpdateWrapper<ScaleContent>()
-					.eq("scale_id", scaleId)
-					.eq("is_deleted", IsDeleteEnum.N.getKey())
-					.set("gmt_modified", now)
-					.set("modifier", userId)
-					.set("is_deleted", IsDeleteEnum.Y.getKey()));
-		}
-		//新增关联内容
-		List<ScaleContent> list = new ArrayList<>();
-		List<ScaleContentVO> scaleContentVOS = scaleContentSaveVO.getContent();
-		for(ScaleContentVO scaleContentVO : scaleContentVOS) {
-			ScaleContent bean = new ScaleContent();
-			BeanUtil.copyProperties(scaleContentVO, bean);
-			bean.setScaleId(scaleId);
-			bean.setModifier(userId);
-			bean.setCreator(userId);
-			bean.setGmtCreate(now);
-			bean.setGmtModified(now);
-			list.add(bean);
-		}
-		scaleContentService.saveBatch(list);
-	}
+    /**
+     * 量表内容新增或更新
+     *
+     * @param scaleContentSaveVO
+     */
+    public void insertOrUpdate(ScaleContentSaveVO scaleContentSaveVO) {
+        Long scaleId = scaleContentSaveVO.getScaleId();
+        Date now = DateUtil.now();
+        String userId = "ddd";
+        //删除原关联内容
+        if (scaleId != null) {
+            this.update(new ScaleContent(), new UpdateWrapper<ScaleContent>()
+                    .eq("scale_id", scaleId)
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .set("gmt_modified", now)
+                    .set("modifier", userId)
+                    .set("is_deleted", IsDeleteEnum.Y.getKey()));
+        }
+        //新增关联内容
+        List<ScaleContent> list = new ArrayList<>();
+        List<ScaleContentVO> scaleContentVOS = scaleContentSaveVO.getContent();
+        for (ScaleContentVO scaleContentVO : scaleContentVOS) {
+            ScaleContent bean = new ScaleContent();
+            BeanUtil.copyProperties(scaleContentVO, bean);
+            bean.setScaleId(scaleId);
+            bean.setModifier(userId);
+            bean.setCreator(userId);
+            bean.setGmtCreate(now);
+            bean.setGmtModified(now);
+            list.add(bean);
+        }
+        scaleContentService.saveBatch(list);
+    }
 
 
-	/**
-	 * 量表列表
-	 *
-	 * @param questionPageVO
-	 * @return
-	 */
-	public IPage<QuestionPageDTO> getListFac(QuestionPageVO questionPageVO) {
-		IPage<QuestionPageDTO> res = this.getList(questionPageVO);
-		if (res.getTotal() <= 0) {
-			return res;
-		}
-		List<String> personIds = res.getRecords().stream().map(row -> row.getModifier()).collect(Collectors.toList());
-		RespDTO<Map<String, String>> mapRespDTO = userServiceClient.getUserInfoByIds(personIds);
-		if (mapRespDTO == null || !CommonErrorCode.OK.getCode().equals(mapRespDTO.code)) {
-			throw new CommonException(CommonErrorCode.RPC_ERROR, "获取操作人失败");
-		}
-		for (QuestionPageDTO bean : res.getRecords()) {
-			bean.setModifier(mapRespDTO.data.get(bean.getModifier()));
-		}
-		return res;
-	}
+    /**
+     * 量表列表
+     *
+     * @param questionPageVO
+     * @return
+     */
+    public IPage<QuestionPageDTO> getListFac(QuestionPageVO questionPageVO) {
+        IPage<QuestionPageDTO> res = this.getList(questionPageVO);
+        if (res.getTotal() <= 0) {
+            return res;
+        }
+        List<String> personIds = res.getRecords().stream().map(row -> row.getModifier()).collect(Collectors.toList());
+        RespDTO<Map<String, String>> mapRespDTO = userServiceClient.getUserInfoByIds(personIds);
+        if (mapRespDTO == null || !CommonErrorCode.OK.getCode().equals(mapRespDTO.code)) {
+            throw new CommonException(CommonErrorCode.RPC_ERROR, "获取操作人失败");
+        }
+        for (QuestionPageDTO bean : res.getRecords()) {
+            bean.setModifier(mapRespDTO.data.get(bean.getModifier()));
+        }
+        return res;
+    }
 }