|
@ -29,6 +29,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 医生端:健康指导控制类
|
|
* 医生端:健康指导控制类
|
|
*
|
|
*
|
|
@ -187,13 +190,15 @@ public class DoctorHealthGuidanceController extends WeixinBaseController {
|
|
guidance.setImages(images);
|
|
guidance.setImages(images);
|
|
|
|
|
|
// 保存到居民端健康指导
|
|
// 保存到居民端健康指导
|
|
if (patientHealthGuidanceService.add(guidance, getAccessToken(),tzCode) != null) {
|
|
|
|
|
|
PatientHealthGuidance pp = patientHealthGuidanceService.add(guidance, getAccessToken(),tzCode) ;
|
|
|
|
if (pp != null) {
|
|
Patient p = patientService.findByCode(patient);
|
|
Patient p = patientService.findByCode(patient);
|
|
String imcotent = "{\"title\":\"健康指导\",\"type\":2,\"id\":\"" + guidance.getId() + "\",\"img\":\"" + guidance.getImages() + "\",\"content\":\"" + CommonUtil.getSubString(guidance.getContent(), 0, 30) + "\"}";
|
|
String imcotent = "{\"title\":\"健康指导\",\"type\":2,\"id\":\"" + guidance.getId() + "\",\"img\":\"" + guidance.getImages() + "\",\"content\":\"" + CommonUtil.getSubString(guidance.getContent(), 0, 30) + "\"}";
|
|
consultService.sendMucMessageBySingnType(getUID(), doctor.getName(), patient, imcotent, "4", p.getName());
|
|
consultService.sendMucMessageBySingnType(getUID(), doctor.getName(), patient, imcotent, "4", p.getName());
|
|
BusinessLogs.info(BusinessLogs.BusinessType.guidance, getUID(), patient, new JSONObject(guidance));
|
|
BusinessLogs.info(BusinessLogs.BusinessType.guidance, getUID(), patient, new JSONObject(guidance));
|
|
|
|
|
|
return success("保存成功!");
|
|
|
|
|
|
JSONObject resultMap = new JSONObject();
|
|
|
|
resultMap.put("id",pp.getId());
|
|
|
|
return write(200,"保存成功!","data",resultMap);
|
|
} else {
|
|
} else {
|
|
return error(-1, "居民签约已到期,请使用文字回复。");
|
|
return error(-1, "居民签约已到期,请使用文字回复。");
|
|
}
|
|
}
|
|
@ -235,7 +240,8 @@ public class DoctorHealthGuidanceController extends WeixinBaseController {
|
|
guidance.setImages(images);
|
|
guidance.setImages(images);
|
|
|
|
|
|
// 保存
|
|
// 保存
|
|
if (patientHealthGuidanceService.add(guidance, getAccessToken(),tzCode) != null) {
|
|
|
|
|
|
PatientHealthGuidance pp = patientHealthGuidanceService.add(guidance, getAccessToken(),tzCode) ;
|
|
|
|
if (pp != null) {
|
|
String sendImgs = "";
|
|
String sendImgs = "";
|
|
if (StringUtils.isNotBlank(images)) {
|
|
if (StringUtils.isNotBlank(images)) {
|
|
sendImgs = images;
|
|
sendImgs = images;
|
|
@ -246,7 +252,9 @@ public class DoctorHealthGuidanceController extends WeixinBaseController {
|
|
BusinessLogs.info(BusinessLogs.BusinessType.guidance, getUID(), patient, new JSONObject(guidance));
|
|
BusinessLogs.info(BusinessLogs.BusinessType.guidance, getUID(), patient, new JSONObject(guidance));
|
|
//发送成功记录模板发送次数
|
|
//发送成功记录模板发送次数
|
|
doctorGuidanceTempService.countSend(modelCode);
|
|
doctorGuidanceTempService.countSend(modelCode);
|
|
return success("保存成功!");
|
|
|
|
|
|
JSONObject resultMap = new JSONObject();
|
|
|
|
resultMap.put("id",pp.getId());
|
|
|
|
return write(200,"保存成功!","data",resultMap);
|
|
} else {
|
|
} else {
|
|
return error(-1, "居民签约已到期,请使用文字回复。");
|
|
return error(-1, "居民签约已到期,请使用文字回复。");
|
|
}
|
|
}
|