|
@ -5,6 +5,7 @@ import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
import com.yihu.wlyy.entity.patient.PatientHealthGuidance;
|
|
import com.yihu.wlyy.entity.patient.PatientHealthGuidance;
|
|
import com.yihu.wlyy.entity.template.DoctorGuidanceTemp;
|
|
import com.yihu.wlyy.entity.template.DoctorGuidanceTemp;
|
|
|
|
import com.yihu.wlyy.entity.template.DoctorGuidanceTempLabel;
|
|
import com.yihu.wlyy.entity.template.DoctorTeamGuidanceDetail;
|
|
import com.yihu.wlyy.entity.template.DoctorTeamGuidanceDetail;
|
|
import com.yihu.wlyy.entity.template.DoctorTeamGuidanceTemplate;
|
|
import com.yihu.wlyy.entity.template.DoctorTeamGuidanceTemplate;
|
|
import com.yihu.wlyy.logs.BusinessLogs;
|
|
import com.yihu.wlyy.logs.BusinessLogs;
|
|
@ -12,13 +13,13 @@ import com.yihu.wlyy.repository.doctor.DoctorAdminTeamMemberDao;
|
|
import com.yihu.wlyy.repository.doctor.DoctorDao;
|
|
import com.yihu.wlyy.repository.doctor.DoctorDao;
|
|
import com.yihu.wlyy.repository.patient.PatientDao;
|
|
import com.yihu.wlyy.repository.patient.PatientDao;
|
|
import com.yihu.wlyy.repository.template.DoctorGuidanceTempDao;
|
|
import com.yihu.wlyy.repository.template.DoctorGuidanceTempDao;
|
|
|
|
import com.yihu.wlyy.repository.template.DoctorGuidanceTempLabelDao;
|
|
import com.yihu.wlyy.repository.template.DoctorTeamGuidanceDetailDao;
|
|
import com.yihu.wlyy.repository.template.DoctorTeamGuidanceDetailDao;
|
|
import com.yihu.wlyy.repository.template.DoctorTeamGuidanceTemplateDao;
|
|
import com.yihu.wlyy.repository.template.DoctorTeamGuidanceTemplateDao;
|
|
import com.yihu.wlyy.service.BaseService;
|
|
import com.yihu.wlyy.service.BaseService;
|
|
import com.yihu.wlyy.service.app.consult.ConsultService;
|
|
import com.yihu.wlyy.service.app.consult.ConsultService;
|
|
import com.yihu.wlyy.service.app.health.PatientHealthGuidanceService;
|
|
import com.yihu.wlyy.service.app.health.PatientHealthGuidanceService;
|
|
import com.yihu.wlyy.util.CommonUtil;
|
|
import com.yihu.wlyy.util.CommonUtil;
|
|
import io.swagger.models.auth.In;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.json.JSONArray;
|
|
import org.json.JSONArray;
|
|
import org.json.JSONObject;
|
|
import org.json.JSONObject;
|
|
@ -57,6 +58,8 @@ public class DoctorTeamGuidanceService extends BaseService {
|
|
DoctorGuidanceTempDao guidanceTempDao;
|
|
DoctorGuidanceTempDao guidanceTempDao;
|
|
@Autowired
|
|
@Autowired
|
|
private CommonUtil CommonUtil;
|
|
private CommonUtil CommonUtil;
|
|
|
|
@Autowired
|
|
|
|
private DoctorGuidanceTempLabelDao doctorGuidanceTempLableDao;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 新增团队指导模板
|
|
* 新增团队指导模板
|
|
@ -66,7 +69,7 @@ public class DoctorTeamGuidanceService extends BaseService {
|
|
* @param content
|
|
* @param content
|
|
* @param images
|
|
* @param images
|
|
*/
|
|
*/
|
|
public String saveTeamGuidance(String doctor, String title, JSONArray teams, String content, String images) throws Exception {
|
|
|
|
|
|
public String saveTeamGuidance(String doctor, String title, JSONArray teams, String content, String images,String labelCode) throws Exception {
|
|
String templateCode = getCode();
|
|
String templateCode = getCode();
|
|
Date nowDate = new Date();
|
|
Date nowDate = new Date();
|
|
String image = "";
|
|
String image = "";
|
|
@ -75,7 +78,12 @@ public class DoctorTeamGuidanceService extends BaseService {
|
|
image = CommonUtil.copyTempImage(images);
|
|
image = CommonUtil.copyTempImage(images);
|
|
System.out.println("images =====>" + image);
|
|
System.out.println("images =====>" + image);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//指导标签
|
|
|
|
DoctorGuidanceTempLabel doctorGuidanceTempLable = doctorGuidanceTempLableDao.findByCode(labelCode);
|
|
|
|
String labelName = "未分组";
|
|
|
|
if(doctorGuidanceTempLable!=null){
|
|
|
|
labelName = doctorGuidanceTempLable.getName();
|
|
|
|
}
|
|
for (Object team : teams) {
|
|
for (Object team : teams) {
|
|
JSONObject teamJson = new JSONObject(team.toString());
|
|
JSONObject teamJson = new JSONObject(team.toString());
|
|
int teamId = teamJson.getInt("teamId");
|
|
int teamId = teamJson.getInt("teamId");
|
|
@ -93,7 +101,8 @@ public class DoctorTeamGuidanceService extends BaseService {
|
|
doctorTeamGuidanceTemplate.setTitle(title);
|
|
doctorTeamGuidanceTemplate.setTitle(title);
|
|
doctorTeamGuidanceTemplate.setTeamTemplateCode(templateCode);
|
|
doctorTeamGuidanceTemplate.setTeamTemplateCode(templateCode);
|
|
doctorTeamGuidanceTemplate.setUseTimes(0);
|
|
doctorTeamGuidanceTemplate.setUseTimes(0);
|
|
|
|
|
|
|
|
doctorTeamGuidanceTemplate.setLabelCode(labelCode);
|
|
|
|
doctorTeamGuidanceTemplate.setLabelName(labelName);
|
|
doctorTeamGuidanceTemplateDao.save(doctorTeamGuidanceTemplate);
|
|
doctorTeamGuidanceTemplateDao.save(doctorTeamGuidanceTemplate);
|
|
} else {
|
|
} else {
|
|
throw new Exception(teamName + ":团队标题重复!");
|
|
throw new Exception(teamName + ":团队标题重复!");
|
|
@ -468,4 +477,27 @@ public class DoctorTeamGuidanceService extends BaseService {
|
|
return imagePath;
|
|
return imagePath;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public List<DoctorTeamGuidanceTemplate> getGuidanceByTeamIdAndLabelCode( Integer teamId,String labelCode, int pageNo, int pageSize) throws Exception {
|
|
|
|
Sort sort = new Sort(Sort.Direction.DESC, "useTimes","createTime");
|
|
|
|
pageNo = pageNo -1;
|
|
|
|
PageRequest request = new PageRequest(pageNo, pageSize, sort);
|
|
|
|
List<DoctorTeamGuidanceTemplate> list = doctorTeamGuidanceTemplateDao.findGuidanceByTeamIdAndLabelCode(teamId,labelCode,request);
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Map<String,List<DoctorTeamGuidanceTemplate>> getTeamGuidanceListByLabelWithFilter(Integer teamId ,String filter) throws Exception {
|
|
|
|
|
|
|
|
List<DoctorTeamGuidanceTemplate> listGuidances = doctorTeamGuidanceTemplateDao.getListByTile(teamId,"%"+filter+"%");
|
|
|
|
Map<String,List<DoctorTeamGuidanceTemplate>> map= new HashMap<>();
|
|
|
|
for(DoctorTeamGuidanceTemplate one:listGuidances){
|
|
|
|
if(map.containsKey(one.getLabelName()!=null?one.getLabelName():"未分组")){
|
|
|
|
List<DoctorTeamGuidanceTemplate> temp = map.get(one.getLabelName()!=null?one.getLabelName():"未分组");
|
|
|
|
temp.add(one);
|
|
|
|
}else{
|
|
|
|
map.put(one.getLabelName()!=null?one.getLabelName():"未分组",new ArrayList<>(Arrays.asList(one)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return map;
|
|
|
|
}
|
|
|
|
|
|
}
|
|
}
|