|
@@ -2,13 +2,13 @@ package com.diagbot.facade;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.diagbot.biz.push.entity.Lis;
|
|
|
import com.diagbot.dto.AnalyzeDTO;
|
|
|
import com.diagbot.dto.GetDefectDeptDTO;
|
|
|
import com.diagbot.dto.GetDefectModeDTO;
|
|
|
import com.diagbot.dto.GetMedDefectFeedbackPageDTO;
|
|
|
import com.diagbot.entity.BehospitalInfo;
|
|
|
import com.diagbot.entity.MedDefectFeedback;
|
|
|
-import com.diagbot.entity.MedQcresultInfo;
|
|
|
import com.diagbot.entity.QcresultDetail;
|
|
|
import com.diagbot.entity.QcresultInfo;
|
|
|
import com.diagbot.entity.SysUser;
|
|
@@ -17,7 +17,6 @@ import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
|
import com.diagbot.facade.his.FeedbackHosFacade;
|
|
|
import com.diagbot.service.impl.MedDefectFeedbackServiceImpl;
|
|
|
-import com.diagbot.service.impl.MedQcresultInfoServiceImpl;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.DateUtil;
|
|
|
import com.diagbot.util.ListUtil;
|
|
@@ -31,7 +30,9 @@ import com.diagbot.vo.his.FeedbackHosVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
+import java.util.Optional;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -51,6 +52,9 @@ public class MedDefectFeedbackFacade extends MedDefectFeedbackServiceImpl {
|
|
|
private QcresultDetailFacade qcresultDetailFacade;
|
|
|
@Autowired
|
|
|
private FeedbackHosFacade feedbackHosFacade;
|
|
|
+ @Autowired
|
|
|
+ private MedDefectFeedbackServiceImpl medDefectFeedbackServiceImpl;
|
|
|
+
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -244,7 +248,53 @@ public class MedDefectFeedbackFacade extends MedDefectFeedbackServiceImpl {
|
|
|
* @return:
|
|
|
*/
|
|
|
public Page<GetMedDefectFeedbackPageDTO> getMedDefectFeedbackPage(GetMedDefectFeedbackPageVO getMedDefectFeedbackPageVO) {
|
|
|
+ //更新待确认状态
|
|
|
+ updateStatus();
|
|
|
Page<GetMedDefectFeedbackPageDTO> medDefectFeedbackPage = this.baseMapper.getMedDefectFeedbackPage(getMedDefectFeedbackPageVO);
|
|
|
return medDefectFeedbackPage;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 更新待确认状态
|
|
|
+ *
|
|
|
+ * @param
|
|
|
+ * @Return void
|
|
|
+ */
|
|
|
+ private void updateStatus() {
|
|
|
+ try {
|
|
|
+ //1.获取待确认的反馈缺陷id
|
|
|
+ List<Long> ids = this.list(new QueryWrapper<MedDefectFeedback>()
|
|
|
+ .eq("hospital_id",SysUserUtils.getCurrentHospitalID())
|
|
|
+ .eq("status","0")
|
|
|
+ .eq("is_deleted",IsDeleteEnum.N.getKey())).stream()
|
|
|
+ .map(MedDefectFeedback::getId).collect(Collectors.toList());
|
|
|
+
|
|
|
+ if(ListUtil.isNotEmpty(ids)){
|
|
|
+ String strIds = Optional.of(ids).orElseGet(ArrayList::new).stream().map(String::valueOf).collect(Collectors.joining(","));
|
|
|
+ FeedbackHosVO search = new FeedbackHosVO();
|
|
|
+ search.setIds(strIds);
|
|
|
+ //2.查his对应反馈缺陷的最新状态
|
|
|
+ List<FeedbackHosVO> out = feedbackHosFacade.statusQuery(search).data;
|
|
|
+ if(ListUtil.isNotEmpty(out)){
|
|
|
+ List<MedDefectFeedback> updates = new ArrayList<>();
|
|
|
+ out.stream().forEach(feedbackHosVO -> {
|
|
|
+ //获取his已确认的
|
|
|
+ if("1".equals(feedbackHosVO.getMsgStatus())){
|
|
|
+ MedDefectFeedback entity = new MedDefectFeedback();
|
|
|
+ entity.setId(feedbackHosVO.getId());
|
|
|
+ entity.setStatus(feedbackHosVO.getMsgStatus());
|
|
|
+ updates.add(entity);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //3.更新自己库中状态
|
|
|
+ if(ListUtil.isNotEmpty(updates)){
|
|
|
+ medDefectFeedbackServiceImpl.updateBatchById(updates);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|