| 
					
				 | 
			
			
				@@ -1,12 +1,19 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 package com.fs.medical.service.impl; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.fs.common.utils.DictUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.fs.common.utils.StringUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.fs.medical.domain.MedicalIndicator; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.fs.medical.domain.ReportIndicatorResult; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.fs.medical.dto.ReportAllIndicatorCateDTO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.fs.medical.mapper.MedicalIndicatorMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.fs.medical.mapper.ReportIndicatorResultMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.fs.medical.param.ReportIndicatorResultQueryDto; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.fs.medical.service.ReportIndicatorResultService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.springframework.beans.factory.annotation.Autowired; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.springframework.stereotype.Service; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.util.Collections; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.util.List; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 /** 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -18,6 +25,9 @@ public class ReportIndicatorResultServiceImpl implements ReportIndicatorResultSe 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private ReportIndicatorResultMapper reportIndicatorResultMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private MedicalIndicatorMapper medicalIndicatorMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public ReportIndicatorResult getById(Long resultId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return reportIndicatorResultMapper.getById(resultId); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -35,6 +45,14 @@ public class ReportIndicatorResultServiceImpl implements ReportIndicatorResultSe 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public boolean save(ReportIndicatorResult result) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        MedicalIndicator byId = medicalIndicatorMapper.getById(result.getIndicatorId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if(ObjectUtils.isNotNull(byId)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String indicatorCategory = byId.getIndicatorCategory(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if(StringUtils.isNotBlank(indicatorCategory)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                result.setIndicatorCateId(Long.valueOf(indicatorCategory)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return reportIndicatorResultMapper.insert(result) > 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -52,4 +70,13 @@ public class ReportIndicatorResultServiceImpl implements ReportIndicatorResultSe 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public List<ReportIndicatorResult> selectPageList(ReportIndicatorResultQueryDto queryDto) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return reportIndicatorResultMapper.selectPageList(queryDto); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public List<ReportAllIndicatorCateDTO> getAllIndicatorByReportId(Long reportId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<ReportAllIndicatorCateDTO> allIndicatorByReportId = reportIndicatorResultMapper.getAllIndicatorByReportId(reportId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        for (ReportAllIndicatorCateDTO item : allIndicatorByReportId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            item.setCateName(DictUtils.getDictLabel("user_custom_type", String.valueOf(item.getCateId()))); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return allIndicatorByReportId; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 |