|
|
|
|
@@ -11,6 +11,7 @@ import com.ruoyi.health.domain.vo.HealthStaticAnalysisVo;
|
|
|
|
|
import com.ruoyi.health.domain.vo.HealthTemperatureRecordVo;
|
|
|
|
|
import com.ruoyi.health.mapper.HealthMarRecordMapper;
|
|
|
|
|
import com.ruoyi.health.mapper.HealthTemperatureRecordMapper;
|
|
|
|
|
import com.ruoyi.health.mapper.StatisticAnalysisMapper;
|
|
|
|
|
import com.ruoyi.health.service.IStatisticAnalysisService;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
@@ -28,6 +29,9 @@ public class StatisticAnalysisImpl implements IStatisticAnalysisService {
|
|
|
|
|
@Resource
|
|
|
|
|
private HealthTemperatureRecordMapper temperatureRecordMapper;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private StatisticAnalysisMapper statisticAnalysisMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> getMarAnalysis(AnalysisDto analysisDto) {
|
|
|
|
|
@@ -78,14 +82,63 @@ public class StatisticAnalysisImpl implements IStatisticAnalysisService {
|
|
|
|
|
//获取数据
|
|
|
|
|
dto.setEndTime(analysisDto.getEndTime());
|
|
|
|
|
dto.setStartTime(analysisDto.getStartTime());
|
|
|
|
|
|
|
|
|
|
dto.setPersonId(analysisDto.getId());
|
|
|
|
|
dto.setHealthRecordId(analysisDto.getRecordId());
|
|
|
|
|
List<HealthMarRecordVo> marRecordVoList=marRecordMapper.selectHealthMarRecordList(dto);
|
|
|
|
|
//用药总次数
|
|
|
|
|
map.put("marCount",marRecordVoList.size());
|
|
|
|
|
//退烧用药
|
|
|
|
|
map.put("tuishao",marRecordVoList.stream().filter(mar -> mar.getType().equals("1")).count());
|
|
|
|
|
//抗菌消炎
|
|
|
|
|
map.put("kangjun",marRecordVoList.stream().filter(mar -> mar.getType().equals("2")).count());
|
|
|
|
|
//止咳平喘化痰
|
|
|
|
|
map.put("zhike",marRecordVoList.stream().filter(mar -> mar.getType().equals("3")).count());
|
|
|
|
|
//抗病毒
|
|
|
|
|
map.put("kangbingdu",marRecordVoList.stream().filter(mar -> mar.getType().equals("4")).count());
|
|
|
|
|
//抗过敏
|
|
|
|
|
map.put("kangguomin",marRecordVoList.stream().filter(mar -> mar.getType().equals("6")).count());
|
|
|
|
|
//雾化消炎
|
|
|
|
|
map.put("wuhua",marRecordVoList.stream().filter(mar -> mar.getType().equals("9")).count());
|
|
|
|
|
//清热解毒
|
|
|
|
|
map.put("qingre",marRecordVoList.stream().filter(mar -> mar.getType().equals("10")).count());
|
|
|
|
|
//肠道消化
|
|
|
|
|
map.put("changdao",marRecordVoList.stream().filter(mar -> mar.getType().equals("7")).count());
|
|
|
|
|
//鼻炎腺样体
|
|
|
|
|
map.put("biyan",marRecordVoList.stream().filter(mar -> mar.getType().equals("12")).count());
|
|
|
|
|
//增强体质调节免疫力
|
|
|
|
|
map.put("mianyili",marRecordVoList.stream().filter(mar -> mar.getType().equals("13")).count());
|
|
|
|
|
|
|
|
|
|
//按药品统计
|
|
|
|
|
List<HealthMarRecordVo> marClassList=statisticAnalysisMapper.selectMarRecordList(dto);
|
|
|
|
|
//药品用药单位统计
|
|
|
|
|
for (HealthMarRecordVo vo:marClassList
|
|
|
|
|
) {
|
|
|
|
|
if (null != vo.getUnit()) {
|
|
|
|
|
vo.setUnitName(DictUtils.getDictLabel("medical_unit", vo.getUnit().toString()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//用药种类
|
|
|
|
|
map.put("marCategoryCount",marClassList.size());
|
|
|
|
|
|
|
|
|
|
ArrayList<Map<String, Object>> marMapList = new ArrayList<>();
|
|
|
|
|
for (HealthMarRecordVo vo:marClassList
|
|
|
|
|
) {
|
|
|
|
|
Map<String, Object> datamap = new HashMap<>();
|
|
|
|
|
datamap.put("time", vo.getName());
|
|
|
|
|
datamap.put("value", vo.getCount());
|
|
|
|
|
datamap.put("unit", vo.getUnitName());
|
|
|
|
|
datamap.put("dosage", vo.getDosage());
|
|
|
|
|
marMapList.add(datamap);
|
|
|
|
|
}
|
|
|
|
|
//列表
|
|
|
|
|
map.put("marMapList",marMapList);
|
|
|
|
|
|
|
|
|
|
List<HealthMarRecordVo> queryList =new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
if("1".equals(analysisDto.getType())){
|
|
|
|
|
//日列表
|
|
|
|
|
List <String> staticsTimeList=new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
for (HealthMarRecordVo vo:marRecordVoList
|
|
|
|
|
) {
|
|
|
|
|
if (null != vo.getUnit()) {
|
|
|
|
|
|