|
@@ -7,22 +7,39 @@ import com.diagbot.dto.GetUpdateInfoDTO;
|
|
import com.diagbot.dto.GetUpdateInfoDetialDTO;
|
|
import com.diagbot.dto.GetUpdateInfoDetialDTO;
|
|
import com.diagbot.dto.QcCasesEntryAllDTO;
|
|
import com.diagbot.dto.QcCasesEntryAllDTO;
|
|
import com.diagbot.dto.QcCasesEntrySimpleDTO;
|
|
import com.diagbot.dto.QcCasesEntrySimpleDTO;
|
|
|
|
+import com.diagbot.dto.QcEntryTypeDTO;
|
|
|
|
+import com.diagbot.dto.QcEntryTypeDetailDTO;
|
|
import com.diagbot.dto.QcHospitalInfoAllDTO;
|
|
import com.diagbot.dto.QcHospitalInfoAllDTO;
|
|
|
|
+import com.diagbot.dto.QcTypeByEntryDTO;
|
|
|
|
+import com.diagbot.dto.QcTypeSimpDTO;
|
|
import com.diagbot.entity.CasesEntryHospital;
|
|
import com.diagbot.entity.CasesEntryHospital;
|
|
import com.diagbot.entity.QcCasesEntry;
|
|
import com.diagbot.entity.QcCasesEntry;
|
|
import com.diagbot.entity.QcQuestionEntry;
|
|
import com.diagbot.entity.QcQuestionEntry;
|
|
import com.diagbot.entity.QcTypeCasesEntry;
|
|
import com.diagbot.entity.QcTypeCasesEntry;
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
|
+import com.diagbot.exception.CommonErrorCode;
|
|
|
|
+import com.diagbot.exception.CommonException;
|
|
|
|
+import com.diagbot.service.QcTypeCasesEntryService;
|
|
import com.diagbot.service.impl.QcCasesEntryServiceImpl;
|
|
import com.diagbot.service.impl.QcCasesEntryServiceImpl;
|
|
import com.diagbot.util.BeanUtil;
|
|
import com.diagbot.util.BeanUtil;
|
|
|
|
+import com.diagbot.util.DateUtil;
|
|
|
|
+import com.diagbot.util.ListUtil;
|
|
|
|
+import com.diagbot.util.UserUtils;
|
|
import com.diagbot.vo.GetUpdateInfoVO;
|
|
import com.diagbot.vo.GetUpdateInfoVO;
|
|
import com.diagbot.vo.QcCasesEntryAllVO;
|
|
import com.diagbot.vo.QcCasesEntryAllVO;
|
|
import com.diagbot.vo.QcCasesEntryIndexVO;
|
|
import com.diagbot.vo.QcCasesEntryIndexVO;
|
|
import com.diagbot.vo.QcEntryHospitalVO;
|
|
import com.diagbot.vo.QcEntryHospitalVO;
|
|
|
|
+import com.diagbot.vo.QcEntryTypeIndexVO;
|
|
|
|
+import com.diagbot.vo.QcEntryTypePageVO;
|
|
|
|
+import com.diagbot.vo.QcEntryTypeSaveVO;
|
|
|
|
+import com.diagbot.vo.QcEntryTypeVO;
|
|
|
|
+import com.diagbot.vo.QcTypeHospitalVO;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.beans.factory.annotation.Qualifier;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
+import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
@@ -44,6 +61,11 @@ public class QcCacesEntryFacade extends QcCasesEntryServiceImpl {
|
|
QcQuestionEntryFacade qcQuestionEntryFacade;
|
|
QcQuestionEntryFacade qcQuestionEntryFacade;
|
|
@Autowired
|
|
@Autowired
|
|
QcTypeCasesEntryFacade qcTypeCasesEntryFacade;
|
|
QcTypeCasesEntryFacade qcTypeCasesEntryFacade;
|
|
|
|
+ @Autowired
|
|
|
|
+ @Qualifier("qcTypeCasesEntryServiceImpl")
|
|
|
|
+ QcTypeCasesEntryService qcTypeCasesEntryService;
|
|
|
|
+ @Autowired
|
|
|
|
+ QcTypeFacade qcTypeFacade;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 分页获取病例条目
|
|
* 分页获取病例条目
|
|
@@ -51,7 +73,7 @@ public class QcCacesEntryFacade extends QcCasesEntryServiceImpl {
|
|
* @param qcCasesEntryAllVO
|
|
* @param qcCasesEntryAllVO
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public IPage<QcCasesEntryAllDTO> getAll(QcCasesEntryAllVO qcCasesEntryAllVO){
|
|
|
|
|
|
+ public IPage<QcCasesEntryAllDTO> getAll(QcCasesEntryAllVO qcCasesEntryAllVO) {
|
|
return this.getAllQcCasesEntry(qcCasesEntryAllVO);
|
|
return this.getAllQcCasesEntry(qcCasesEntryAllVO);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -61,7 +83,7 @@ public class QcCacesEntryFacade extends QcCasesEntryServiceImpl {
|
|
* @param qcCasesEntryIndexVO
|
|
* @param qcCasesEntryIndexVO
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public IPage<QcCasesEntryAllDTO> getAllQcCasesEntryIndexFac(QcCasesEntryIndexVO qcCasesEntryIndexVO){
|
|
|
|
|
|
+ public IPage<QcCasesEntryAllDTO> getAllQcCasesEntryIndexFac(QcCasesEntryIndexVO qcCasesEntryIndexVO) {
|
|
return this.getAllQcCasesEntryIndex(qcCasesEntryIndexVO);
|
|
return this.getAllQcCasesEntryIndex(qcCasesEntryIndexVO);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -71,25 +93,25 @@ public class QcCacesEntryFacade extends QcCasesEntryServiceImpl {
|
|
* @param getUpdateInfoVO
|
|
* @param getUpdateInfoVO
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public List<GetUpdateInfoDTO> getUpdateInfo(GetUpdateInfoVO getUpdateInfoVO){
|
|
|
|
|
|
+ public List<GetUpdateInfoDTO> getUpdateInfo(GetUpdateInfoVO getUpdateInfoVO) {
|
|
QueryWrapper<QcCasesEntry> qcCasesEntryQueryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<QcCasesEntry> qcCasesEntryQueryWrapper = new QueryWrapper<>();
|
|
qcCasesEntryQueryWrapper
|
|
qcCasesEntryQueryWrapper
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
- .eq("id",getUpdateInfoVO.getId());
|
|
|
|
|
|
+ .eq("id", getUpdateInfoVO.getId());
|
|
QcCasesEntry qcCasesEntry = qcCacesEntryFacade.getOne(qcCasesEntryQueryWrapper);
|
|
QcCasesEntry qcCasesEntry = qcCacesEntryFacade.getOne(qcCasesEntryQueryWrapper);
|
|
QueryWrapper<CasesEntryHospital> casesEntryHospitalQueryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<CasesEntryHospital> casesEntryHospitalQueryWrapper = new QueryWrapper<>();
|
|
casesEntryHospitalQueryWrapper
|
|
casesEntryHospitalQueryWrapper
|
|
- .eq("is_deleted",IsDeleteEnum.N.getKey())
|
|
|
|
- .eq("cases_entry_id",qcCasesEntry.getId())
|
|
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("cases_entry_id", qcCasesEntry.getId())
|
|
.groupBy("hospital_id");
|
|
.groupBy("hospital_id");
|
|
List<CasesEntryHospital> casesEntryHospitals = casesEntryHospitalFacade.list(casesEntryHospitalQueryWrapper);
|
|
List<CasesEntryHospital> casesEntryHospitals = casesEntryHospitalFacade.list(casesEntryHospitalQueryWrapper);
|
|
List<GetUpdateInfoDTO> getUpdateInfoDTOS = new ArrayList<>();
|
|
List<GetUpdateInfoDTO> getUpdateInfoDTOS = new ArrayList<>();
|
|
GetUpdateInfoDTO getUpdateInfoDTO = new GetUpdateInfoDTO();
|
|
GetUpdateInfoDTO getUpdateInfoDTO = new GetUpdateInfoDTO();
|
|
List<GetUpdateInfoDetialDTO> getUpdateInfoDetialDTOS = new ArrayList<>();
|
|
List<GetUpdateInfoDetialDTO> getUpdateInfoDetialDTOS = new ArrayList<>();
|
|
GetUpdateInfoDetialDTO getUpdateInfoDetialDTO = new GetUpdateInfoDetialDTO();
|
|
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) {
|
|
|
|
|
|
+ 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 = new GetUpdateInfoDetialDTO();
|
|
getUpdateInfoDetialDTO.setHospitalName(hospitalNameMap.get(casesEntryHospital.getHospitalId()));
|
|
getUpdateInfoDetialDTO.setHospitalName(hospitalNameMap.get(casesEntryHospital.getHospitalId()));
|
|
getUpdateInfoDetialDTO.setMsg(casesEntryHospital.getMsg());
|
|
getUpdateInfoDetialDTO.setMsg(casesEntryHospital.getMsg());
|
|
@@ -109,24 +131,24 @@ public class QcCacesEntryFacade extends QcCasesEntryServiceImpl {
|
|
* @param getUpdateInfoVO
|
|
* @param getUpdateInfoVO
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public Boolean deleteQcCasesEntry(GetUpdateInfoVO getUpdateInfoVO){
|
|
|
|
- //删除条目
|
|
|
|
|
|
+ public Boolean deleteQcCasesEntry(GetUpdateInfoVO getUpdateInfoVO) {
|
|
|
|
+ //删除条目
|
|
QueryWrapper<QcCasesEntry> qcCasesEntryQueryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<QcCasesEntry> qcCasesEntryQueryWrapper = new QueryWrapper<>();
|
|
- qcCasesEntryQueryWrapper.eq("id",getUpdateInfoVO.getId());
|
|
|
|
|
|
+ qcCasesEntryQueryWrapper.eq("id", getUpdateInfoVO.getId());
|
|
boolean res = this.remove(qcCasesEntryQueryWrapper);
|
|
boolean res = this.remove(qcCasesEntryQueryWrapper);
|
|
//删除明细
|
|
//删除明细
|
|
QueryWrapper<CasesEntryHospital> casesEntryHospitalQueryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<CasesEntryHospital> casesEntryHospitalQueryWrapper = new QueryWrapper<>();
|
|
- casesEntryHospitalQueryWrapper.eq("cases_entry_id",getUpdateInfoVO.getId());
|
|
|
|
|
|
+ casesEntryHospitalQueryWrapper.eq("cases_entry_id", getUpdateInfoVO.getId());
|
|
casesEntryHospitalFacade.remove(casesEntryHospitalQueryWrapper);
|
|
casesEntryHospitalFacade.remove(casesEntryHospitalQueryWrapper);
|
|
//删除模块
|
|
//删除模块
|
|
UpdateWrapper<QcQuestionEntry> qcQuescQuestionInfoUpdate = new UpdateWrapper<>();
|
|
UpdateWrapper<QcQuestionEntry> qcQuescQuestionInfoUpdate = new UpdateWrapper<>();
|
|
qcQuescQuestionInfoUpdate
|
|
qcQuescQuestionInfoUpdate
|
|
- .eq("cases_entry_id",getUpdateInfoVO.getId());
|
|
|
|
|
|
+ .eq("cases_entry_id", getUpdateInfoVO.getId());
|
|
qcQuestionEntryFacade.remove(qcQuescQuestionInfoUpdate);
|
|
qcQuestionEntryFacade.remove(qcQuescQuestionInfoUpdate);
|
|
//删除质控类型
|
|
//删除质控类型
|
|
UpdateWrapper<QcTypeCasesEntry> qcTypeCasesEntryUpdateWrapper = new UpdateWrapper<>();
|
|
UpdateWrapper<QcTypeCasesEntry> qcTypeCasesEntryUpdateWrapper = new UpdateWrapper<>();
|
|
qcTypeCasesEntryUpdateWrapper
|
|
qcTypeCasesEntryUpdateWrapper
|
|
- .eq("case_entry_id",getUpdateInfoVO.getId());
|
|
|
|
|
|
+ .eq("case_entry_id", getUpdateInfoVO.getId());
|
|
qcTypeCasesEntryFacade.remove(qcTypeCasesEntryUpdateWrapper);
|
|
qcTypeCasesEntryFacade.remove(qcTypeCasesEntryUpdateWrapper);
|
|
return res;
|
|
return res;
|
|
|
|
|
|
@@ -135,4 +157,100 @@ public class QcCacesEntryFacade extends QcCasesEntryServiceImpl {
|
|
public List<QcCasesEntrySimpleDTO> getEntryByHospitalFac(QcEntryHospitalVO qcEntryHospitalVO) {
|
|
public List<QcCasesEntrySimpleDTO> getEntryByHospitalFac(QcEntryHospitalVO qcEntryHospitalVO) {
|
|
return this.getEntryByHospital(qcEntryHospitalVO);
|
|
return this.getEntryByHospital(qcEntryHospitalVO);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /********************************质控条目和质控类型关系映射开始******************************************/
|
|
|
|
+ /**
|
|
|
|
+ * 质控条目和质控类型关系映射【分页】
|
|
|
|
+ *
|
|
|
|
+ * @param qcEntryTypePageVO
|
|
|
|
+ * @returnFac
|
|
|
|
+ */
|
|
|
|
+ public IPage<QcEntryTypeDTO> entryTypePageFac(QcEntryTypePageVO qcEntryTypePageVO) {
|
|
|
|
+ return this.entryTypePage(qcEntryTypePageVO);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 质控条目和质控类型关系映射【明细】
|
|
|
|
+ *
|
|
|
|
+ * @param qcEntryTypeVO
|
|
|
|
+ * @returnFac
|
|
|
|
+ */
|
|
|
|
+ public QcEntryTypeDetailDTO getByIdFac(QcEntryTypeVO qcEntryTypeVO) {
|
|
|
|
+ QcEntryTypeDetailDTO res = new QcEntryTypeDetailDTO();
|
|
|
|
+ List<QcTypeByEntryDTO> qcEntryTypeDTOList = entryTypeDetail(qcEntryTypeVO);
|
|
|
|
+ if (ListUtil.isNotEmpty(qcEntryTypeDTOList)) {
|
|
|
|
+ BeanUtil.copyProperties(qcEntryTypeDTOList.get(0), res);
|
|
|
|
+ List<QcTypeSimpDTO> qcTypeSimpDTOList = new ArrayList<>();
|
|
|
|
+ qcEntryTypeDTOList.forEach(r -> {
|
|
|
|
+ QcTypeSimpDTO qcTypeSimpDTO = new QcTypeSimpDTO();
|
|
|
|
+ qcTypeSimpDTO.setId(r.getTypeId());
|
|
|
|
+ qcTypeSimpDTO.setName(r.getTypeName());
|
|
|
|
+ qcTypeSimpDTOList.add(qcTypeSimpDTO);
|
|
|
|
+ });
|
|
|
|
+ res.setQcTypeSimpDTOList(qcTypeSimpDTOList);
|
|
|
|
+ } else {
|
|
|
|
+ QcCasesEntry qcCasesEntry = this.getOne(new QueryWrapper<QcCasesEntry>()
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("id", qcEntryTypeVO.getEntryId())
|
|
|
|
+ );
|
|
|
|
+ if (qcCasesEntry == null) {
|
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "当前质控条目不存在");
|
|
|
|
+ }
|
|
|
|
+ res.setEntryName(qcCasesEntry.getName());
|
|
|
|
+ res.setHospitalId(qcEntryTypeVO.getHospitalId());
|
|
|
|
+ res.setEntryId(qcEntryTypeVO.getEntryId());
|
|
|
|
+ res.setCasesName(qcCasesEntry.getCasesName());
|
|
|
|
+ }
|
|
|
|
+ return res;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 根据医院和条目检索未被选择的质控类型
|
|
|
|
+ *
|
|
|
|
+ * @param qcEntryTypeIndexVO
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public List<QcTypeSimpDTO> indexFac(QcEntryTypeIndexVO qcEntryTypeIndexVO){
|
|
|
|
+ return indexQcType(qcEntryTypeIndexVO);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 保存
|
|
|
|
+ * @param qcEntryTypeSaveVO
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public Boolean saveOrUpdate(QcEntryTypeSaveVO qcEntryTypeSaveVO) {
|
|
|
|
+ // 删除映射关系
|
|
|
|
+ this.deleteQcTypeEntry(qcEntryTypeSaveVO);
|
|
|
|
+ // 新增映射关系
|
|
|
|
+ if (ListUtil.isNotEmpty(qcEntryTypeSaveVO.getTypeIdList())) {
|
|
|
|
+ List<QcTypeCasesEntry> list = new ArrayList<>();
|
|
|
|
+ Date now = DateUtil.now();
|
|
|
|
+ String person = UserUtils.getCurrentPrincipleID();
|
|
|
|
+ for (Long id : qcEntryTypeSaveVO.getTypeIdList()) {
|
|
|
|
+ QcTypeCasesEntry qcTypeCasesEntry = new QcTypeCasesEntry();
|
|
|
|
+ qcTypeCasesEntry.setTypeId(id);
|
|
|
|
+ qcTypeCasesEntry.setCaseEntryId(qcEntryTypeSaveVO.getEntryId());
|
|
|
|
+ qcTypeCasesEntry.setGmtCreate(now);
|
|
|
|
+ qcTypeCasesEntry.setGmtModified(now);
|
|
|
|
+ qcTypeCasesEntry.setCreator(person);
|
|
|
|
+ qcTypeCasesEntry.setModifier(person);
|
|
|
|
+ list.add(qcTypeCasesEntry);
|
|
|
|
+ }
|
|
|
|
+ qcTypeCasesEntryService.saveBatch(list);
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 根据医院获取质控类型列表
|
|
|
|
+ *
|
|
|
|
+ * @param qcTypeHospitalVO
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public List<QcTypeSimpDTO> getTypeByHospitalFac(QcTypeHospitalVO qcTypeHospitalVO) {
|
|
|
|
+ return this.getTypeByHospital(qcTypeHospitalVO);
|
|
|
|
+ }
|
|
|
|
+ /********************************质控条目和质控类型关系映射结束******************************************/
|
|
}
|
|
}
|