|
@ -136,13 +136,18 @@ public class DoctorTeamGuidanceService extends BaseService {
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public void modifyTeamGuidance(String doctor, String isLeader,int saveAsGuidance,Boolean isRepeat , String guidanceCode, String title,
|
|
|
JSONArray teams, String content, String images) throws Exception {
|
|
|
JSONArray teams, String content, String images,String labelCode) throws Exception {
|
|
|
|
|
|
// 首先身份验证
|
|
|
DoctorTeamGuidanceDetail guidanceDetail = doctorTeamGuidanceDetailDao.findGuidanceDetail(guidanceCode);
|
|
|
String creater = guidanceDetail.getCreater();
|
|
|
Date nowDate = new Date();
|
|
|
|
|
|
DoctorGuidanceTempLabel doctorGuidanceTempLable = doctorGuidanceTempLableDao.findByCode(labelCode);
|
|
|
String labelName = "未分组";
|
|
|
if(doctorGuidanceTempLable!=null){
|
|
|
labelName = doctorGuidanceTempLable.getName();
|
|
|
}
|
|
|
// 图片地址需要处理
|
|
|
String image = "";
|
|
|
if (StringUtils.isNotEmpty(images)) {
|
|
@ -154,6 +159,7 @@ public class DoctorTeamGuidanceService extends BaseService {
|
|
|
List<DoctorGuidanceTemp> templates = guidanceTempDao.findByTitle(doctor, title);
|
|
|
DoctorGuidanceTemp doctorGuidanceTemp = new DoctorGuidanceTemp();
|
|
|
if (!isRepeat) {
|
|
|
|
|
|
doctorGuidanceTemp.setCode(getCode());
|
|
|
doctorGuidanceTemp.setImagesUrl(image);
|
|
|
doctorGuidanceTemp.setCreateTime(nowDate);
|
|
@ -186,7 +192,7 @@ public class DoctorTeamGuidanceService extends BaseService {
|
|
|
// 直接失效原有团队模板对应关系 在重新新增以前没有的团队关系 发送次数要归0
|
|
|
if (teamList.contains(teamId)) {
|
|
|
// 数据库有
|
|
|
doctorTeamGuidanceTemplateDao.modifyTeamGuidance(teamId, guidanceCode, title);
|
|
|
doctorTeamGuidanceTemplateDao.modifyTeamGuidance(teamId, guidanceCode, title,labelCode,labelName);
|
|
|
} else if (!teamList.contains(teamId)) {
|
|
|
// 现在有,而数据库没有 要新增
|
|
|
DoctorTeamGuidanceTemplate doctorTeamGuidanceTemplate = new DoctorTeamGuidanceTemplate();
|
|
@ -199,6 +205,8 @@ public class DoctorTeamGuidanceService extends BaseService {
|
|
|
doctorTeamGuidanceTemplate.setTitle(title);
|
|
|
doctorTeamGuidanceTemplate.setTeamTemplateCode(guidanceCode);
|
|
|
doctorTeamGuidanceTemplate.setUseTimes(0);
|
|
|
doctorTeamGuidanceTemplate.setLabelCode(labelCode);
|
|
|
doctorTeamGuidanceTemplate.setLabelName(labelName);
|
|
|
doctorTeamGuidanceTemplateDao.save(doctorTeamGuidanceTemplate);
|
|
|
}
|
|
|
} else {
|
|
@ -237,7 +245,7 @@ public class DoctorTeamGuidanceService extends BaseService {
|
|
|
// 直接失效原有团队模板对应关系 在重新新增以前没有的团队关系 发送次数要归0
|
|
|
if (teamList.contains(teamId)) {
|
|
|
// 数据库有
|
|
|
doctorTeamGuidanceTemplateDao.modifyTeamGuidance(teamId, guidanceCode, title);
|
|
|
doctorTeamGuidanceTemplateDao.modifyTeamGuidance(teamId, guidanceCode, title,labelCode,labelName);
|
|
|
} else if (!teamList.contains(teamId)) {
|
|
|
// 现在有,而数据库没有 要新增
|
|
|
DoctorTeamGuidanceTemplate doctorTeamGuidanceTemplate = new DoctorTeamGuidanceTemplate();
|
|
@ -250,6 +258,8 @@ public class DoctorTeamGuidanceService extends BaseService {
|
|
|
doctorTeamGuidanceTemplate.setTitle(title);
|
|
|
doctorTeamGuidanceTemplate.setTeamTemplateCode(guidanceCode);
|
|
|
doctorTeamGuidanceTemplate.setUseTimes(0);
|
|
|
doctorTeamGuidanceTemplate.setLabelCode(labelCode);
|
|
|
doctorTeamGuidanceTemplate.setLabelName(labelName);
|
|
|
doctorTeamGuidanceTemplateDao.save(doctorTeamGuidanceTemplate);
|
|
|
}
|
|
|
} else {
|