|
@ -1,11 +1,18 @@
|
|
|
package com.yihu.jw.healthUpload.service;
|
|
|
|
|
|
import com.yihu.jw.dict.dao.DictHospitalDeptDao;
|
|
|
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
|
|
|
import com.yihu.jw.entity.healthUpload.DeptVO;
|
|
|
import com.yihu.jw.entity.healthUpload.HealthReportingFrequencyDO;
|
|
|
import com.yihu.jw.healthUpload.dao.HealthReportingFrequencyDao;
|
|
|
import com.yihu.jw.mysql.query.BaseJpaService;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* Created by yeshijie on 2022/11/17.
|
|
@ -15,11 +22,35 @@ public class HealthReportingFrequencyService extends BaseJpaService<HealthReport
|
|
|
|
|
|
@Resource
|
|
|
private HealthReportingFrequencyDao healthReportingFrequencyDao;
|
|
|
@Autowired
|
|
|
private DictHospitalDeptDao hospitalDeptDao;
|
|
|
|
|
|
public void deleteById(String id){
|
|
|
healthReportingFrequencyDao.deleteById(id);
|
|
|
}
|
|
|
|
|
|
public HealthReportingFrequencyDO findDetail(String id){
|
|
|
HealthReportingFrequencyDO frequencyDO = healthReportingFrequencyDao.findById(id).orElse(null);
|
|
|
if(frequencyDO!=null){
|
|
|
frequencyDO.setTypeName(getTypeName(frequencyDO.getType()));
|
|
|
if(StringUtils.isNotBlank(frequencyDO.getDeptJson())){
|
|
|
List<DeptVO> deptVOList = new ArrayList<>();
|
|
|
String depts[] = frequencyDO.getDeptJson().split(",");
|
|
|
for (String dep:depts){
|
|
|
DictHospitalDeptDO deptDO = hospitalDeptDao.findByCode(dep);
|
|
|
if(deptDO!=null){
|
|
|
DeptVO deptVO = new DeptVO();
|
|
|
deptVO.setCode(dep);
|
|
|
deptVO.setName(deptDO.getName());
|
|
|
deptVOList.add(deptVO);
|
|
|
}
|
|
|
}
|
|
|
frequencyDO.setDeptList(deptVOList);
|
|
|
}
|
|
|
}
|
|
|
return frequencyDO;
|
|
|
}
|
|
|
|
|
|
public String getTypeName(Integer type){
|
|
|
String name = "院内科室";
|
|
|
switch (type){
|