|
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.diagbot.client.UserServiceClient;
|
|
|
import com.diagbot.dto.GetModuleInfoOneDTO;
|
|
|
import com.diagbot.dto.ModuleInfoListDTO;
|
|
|
+import com.diagbot.dto.QcModuleDetailDTO;
|
|
|
import com.diagbot.dto.QuestionDTO;
|
|
|
import com.diagbot.entity.QcModuleDetail;
|
|
|
import com.diagbot.entity.QcModuleInfo;
|
|
@@ -15,6 +16,7 @@ import com.diagbot.exception.CommonException;
|
|
|
import com.diagbot.service.impl.QcModuleInfoServiceImpl;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.DateUtil;
|
|
|
+import com.diagbot.util.EntityUtil;
|
|
|
import com.diagbot.util.UserUtils;
|
|
|
import com.diagbot.vo.AddModuleInfoVO;
|
|
|
import com.diagbot.vo.GetModuleInfoOneVO;
|
|
@@ -23,7 +25,6 @@ import com.diagbot.vo.QuestionIdsVO;
|
|
|
import com.diagbot.vo.UpdateModuleInfoVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
-
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
@@ -62,10 +63,8 @@ public class QcModuleInfoFacade extends QcModuleInfoServiceImpl {
|
|
|
paramMap.put("ids", Arrays.asList(ids.split(",")));
|
|
|
paramMap.put("gmtModified", date);
|
|
|
paramMap.put("modifier", userId);
|
|
|
-
|
|
|
//删除模板
|
|
|
this.deleteByIds(paramMap);
|
|
|
-
|
|
|
//删除明细表
|
|
|
qcModuleDetailFacade.deleteByModuleIdFac(paramMap);
|
|
|
return true;
|
|
@@ -135,12 +134,12 @@ public class QcModuleInfoFacade extends QcModuleInfoServiceImpl {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 模板维护页面获取模板列表
|
|
|
+ * 根据id获取模板信息
|
|
|
*
|
|
|
* @param getModuleInfoOneVO
|
|
|
* @return
|
|
|
*/
|
|
|
- public GetModuleInfoOneDTO getModuleInfoOne(GetModuleInfoOneVO getModuleInfoOneVO) {
|
|
|
+ public GetModuleInfoOneDTO getById(GetModuleInfoOneVO getModuleInfoOneVO) {
|
|
|
GetModuleInfoOneDTO getModuleInfoOneDTO = new GetModuleInfoOneDTO();
|
|
|
//获取模板信息
|
|
|
QueryWrapper<QcModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
|
|
@@ -157,14 +156,21 @@ public class QcModuleInfoFacade extends QcModuleInfoServiceImpl {
|
|
|
.eq("module_id", getModuleInfoOneDTO.getId())
|
|
|
.orderByDesc("order_no")
|
|
|
);
|
|
|
+ List<QcModuleDetailDTO> qcModuleDetailDTOList = BeanUtil.listCopyTo(qcModuleDetailList, QcModuleDetailDTO.class);
|
|
|
+
|
|
|
+ // 根据questionId获取所有的标签
|
|
|
List<String> questionIds = qcModuleDetailList.stream().map(r -> r.getQuestionId().toString()).collect(Collectors.toList());
|
|
|
QuestionIdsVO questionIdsVO = new QuestionIdsVO();
|
|
|
questionIdsVO.setIds(String.join(",", questionIds));
|
|
|
Map<Long, QuestionDTO> questionDTOMap = qcQuestionFacade.getByIds(questionIdsVO);
|
|
|
-
|
|
|
-
|
|
|
-// Map<Integer, List<QcModuleDetail>> map = EntityUtil.makeEntityListMap(qcModuleDetailList, "groupId");
|
|
|
-// getModuleInfoOneDTO.setModuleDetail(map);
|
|
|
+ for (QcModuleDetailDTO bean : qcModuleDetailDTOList) {
|
|
|
+ QuestionDTO questionDTO = questionDTOMap.get(bean.getQuestionId());
|
|
|
+ if (questionDTO != null) {
|
|
|
+ bean.setQuestionDTO(questionDTO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Map<Integer, List<QcModuleDetailDTO>> map = EntityUtil.makeEntityListMap(qcModuleDetailDTOList, "groupId");
|
|
|
+ getModuleInfoOneDTO.setModuleDetail(map);
|
|
|
return getModuleInfoOneDTO;
|
|
|
}
|
|
|
|