|
@@ -1,11 +1,26 @@
|
|
package com.diagbot.facade;
|
|
package com.diagbot.facade;
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
+import com.diagbot.dto.GetUpdateInfoDTO;
|
|
|
|
+import com.diagbot.dto.GetUpdateInfoDetialDTO;
|
|
import com.diagbot.dto.QcCasesEntryAllDTO;
|
|
import com.diagbot.dto.QcCasesEntryAllDTO;
|
|
|
|
+import com.diagbot.dto.QcHospitalInfoAllDTO;
|
|
|
|
+import com.diagbot.entity.CasesEntryHospital;
|
|
|
|
+import com.diagbot.entity.QcCasesEntry;
|
|
|
|
+import com.diagbot.enums.IsDeleteEnum;
|
|
import com.diagbot.service.impl.QcCasesEntryServiceImpl;
|
|
import com.diagbot.service.impl.QcCasesEntryServiceImpl;
|
|
|
|
+import com.diagbot.util.BeanUtil;
|
|
|
|
+import com.diagbot.vo.GetUpdateInfoVO;
|
|
import com.diagbot.vo.QcCasesEntryAllVO;
|
|
import com.diagbot.vo.QcCasesEntryAllVO;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @Description:
|
|
* @Description:
|
|
* @author: wangyu
|
|
* @author: wangyu
|
|
@@ -13,7 +28,12 @@ import org.springframework.stereotype.Component;
|
|
*/
|
|
*/
|
|
@Component
|
|
@Component
|
|
public class QcCacesEntryFacade extends QcCasesEntryServiceImpl {
|
|
public class QcCacesEntryFacade extends QcCasesEntryServiceImpl {
|
|
-
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private QcCacesEntryFacade qcCacesEntryFacade;
|
|
|
|
+ @Autowired
|
|
|
|
+ private CasesEntryHospitalFacade casesEntryHospitalFacade;
|
|
|
|
+ @Autowired
|
|
|
|
+ private QcHospitalInfoFacade qcHospitalInfoFacade;
|
|
/**
|
|
/**
|
|
* 分页获取病例条目
|
|
* 分页获取病例条目
|
|
*
|
|
*
|
|
@@ -23,4 +43,58 @@ public class QcCacesEntryFacade extends QcCasesEntryServiceImpl {
|
|
public IPage<QcCasesEntryAllDTO> getAll(QcCasesEntryAllVO qcCasesEntryAllVO){
|
|
public IPage<QcCasesEntryAllDTO> getAll(QcCasesEntryAllVO qcCasesEntryAllVO){
|
|
return this.getAllQcCasesEntry(qcCasesEntryAllVO);
|
|
return this.getAllQcCasesEntry(qcCasesEntryAllVO);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 修改时获取病例条目信息
|
|
|
|
+ *
|
|
|
|
+ * @param getUpdateInfoVO
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public List<GetUpdateInfoDTO> getUpdateInfo(GetUpdateInfoVO getUpdateInfoVO){
|
|
|
|
+ QueryWrapper<QcCasesEntry> qcCasesEntryQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ qcCasesEntryQueryWrapper
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("id",getUpdateInfoVO.getId());
|
|
|
|
+ QcCasesEntry qcCasesEntry = qcCacesEntryFacade.getOne(qcCasesEntryQueryWrapper);
|
|
|
|
+ QueryWrapper<CasesEntryHospital> casesEntryHospitalQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ casesEntryHospitalQueryWrapper
|
|
|
|
+ .eq("is_deleted",IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("cases_entry_id",qcCasesEntry.getId())
|
|
|
|
+ .groupBy("hospital_id");
|
|
|
|
+ List<CasesEntryHospital> casesEntryHospitals = casesEntryHospitalFacade.list(casesEntryHospitalQueryWrapper);
|
|
|
|
+ List<GetUpdateInfoDTO> getUpdateInfoDTOS = new ArrayList<>();
|
|
|
|
+ GetUpdateInfoDTO getUpdateInfoDTO = new GetUpdateInfoDTO();
|
|
|
|
+ List<GetUpdateInfoDetialDTO> getUpdateInfoDetialDTOS = new ArrayList<>();
|
|
|
|
+ GetUpdateInfoDetialDTO getUpdateInfoDetialDTO = new GetUpdateInfoDetialDTO();
|
|
|
|
+ BeanUtil.copyProperties(qcCasesEntry,getUpdateInfoDTO);
|
|
|
|
+ Map<Long,String> hospitalNameMap = qcHospitalInfoFacade.getHospitalInfoAll().stream().collect(Collectors.toMap(QcHospitalInfoAllDTO::getId,qcHospitalInfoAllDTO -> qcHospitalInfoAllDTO.getName()));
|
|
|
|
+ for (CasesEntryHospital casesEntryHospital: casesEntryHospitals) {
|
|
|
|
+ getUpdateInfoDetialDTO = new GetUpdateInfoDetialDTO();
|
|
|
|
+ getUpdateInfoDetialDTO.setHospitalName(hospitalNameMap.get(Long.parseLong(casesEntryHospital.getHospitalId())));
|
|
|
|
+ getUpdateInfoDetialDTO.setMsg(casesEntryHospital.getMsg());
|
|
|
|
+ getUpdateInfoDetialDTO.setScore(casesEntryHospital.getScore());
|
|
|
|
+ getUpdateInfoDetialDTOS.add(getUpdateInfoDetialDTO);
|
|
|
|
+ getUpdateInfoDTO.setGetUpdateInfoDetialDTOS(getUpdateInfoDetialDTOS);
|
|
|
|
+ }
|
|
|
|
+ getUpdateInfoDTOS.add(getUpdateInfoDTO);
|
|
|
|
+ return getUpdateInfoDTOS;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 条目删除
|
|
|
|
+ *
|
|
|
|
+ * @param getUpdateInfoVO
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public Boolean deleteQcCasesEntry(GetUpdateInfoVO getUpdateInfoVO){
|
|
|
|
+ //删除条目
|
|
|
|
+ QueryWrapper<QcCasesEntry> qcCasesEntryQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ qcCasesEntryQueryWrapper.eq("id",getUpdateInfoVO.getId());
|
|
|
|
+ this.remove(qcCasesEntryQueryWrapper);
|
|
|
|
+ //删除明细
|
|
|
|
+ QueryWrapper<CasesEntryHospital> casesEntryHospitalQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ qcCasesEntryQueryWrapper.eq("cases_entry_id",getUpdateInfoVO.getId());
|
|
|
|
+ casesEntryHospitalFacade.remove(casesEntryHospitalQueryWrapper);
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
}
|
|
}
|