|
@ -119,6 +119,7 @@ public class DoctorHealthGuidanceController extends WeixinBaseController {
|
|
* @param content 指导内容
|
|
* @param content 指导内容
|
|
* @param modelCode 指导模板编码
|
|
* @param modelCode 指导模板编码
|
|
* @param images 指导图片
|
|
* @param images 指导图片
|
|
|
|
* @param voice 指导语音
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@RequestMapping(value = "add")
|
|
@RequestMapping(value = "add")
|
|
@ -128,6 +129,9 @@ public class DoctorHealthGuidanceController extends WeixinBaseController {
|
|
@RequestParam(required = false) String modelCode,
|
|
@RequestParam(required = false) String modelCode,
|
|
@RequestParam(required = false) String images,
|
|
@RequestParam(required = false) String images,
|
|
@RequestParam(required = false) String voice) {
|
|
@RequestParam(required = false) String voice) {
|
|
|
|
// patient = "9aa5c557e06a4324911487a035195545";
|
|
|
|
String imageUrls = "";
|
|
|
|
String imageRow = "";
|
|
|
|
|
|
if(StringUtils.isBlank(modelCode)) {
|
|
if(StringUtils.isBlank(modelCode)) {
|
|
// 不使用模板指导,旧版手工指导
|
|
// 不使用模板指导,旧版手工指导
|
|
@ -136,13 +140,32 @@ public class DoctorHealthGuidanceController extends WeixinBaseController {
|
|
guidance.setContent(content);
|
|
guidance.setContent(content);
|
|
guidance.setDoctor(getUID());
|
|
guidance.setDoctor(getUID());
|
|
guidance.setPatient(patient);
|
|
guidance.setPatient(patient);
|
|
|
|
// 找到当前医生
|
|
Doctor doctor = doctorService.findDoctorByCode(getUID());
|
|
Doctor doctor = doctorService.findDoctorByCode(getUID());
|
|
if (StringUtils.isNotEmpty(images)) {
|
|
|
|
images = CommonUtil.copyTempImage(images);
|
|
|
|
|
|
if (images==null) {
|
|
|
|
}else {
|
|
|
|
String[] imgs = images.split(",");
|
|
|
|
for (String image : imgs) {
|
|
|
|
if (image.contains("http://")) {
|
|
|
|
imageUrls += image + ",";
|
|
|
|
} else {
|
|
|
|
try {
|
|
|
|
imageRow += CommonUtil.copyTempImage(image)+",";
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
images = imageUrls + imageRow;
|
|
|
|
images = images.substring(0,images.length()-1);
|
|
}
|
|
}
|
|
|
|
/*if (StringUtils.isNotEmpty(images)) {
|
|
|
|
images = CommonUtil.copyTempImage(images);
|
|
|
|
}*/
|
|
guidance.setImages(images);
|
|
guidance.setImages(images);
|
|
|
|
|
|
// 保存
|
|
|
|
|
|
// 保存到居民端健康指导
|
|
if (patientHealthGuidanceService.add(guidance, getAccessToken()) != null) {
|
|
if (patientHealthGuidanceService.add(guidance, getAccessToken()) != 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)+"\"}";
|
|
@ -163,6 +186,24 @@ public class DoctorHealthGuidanceController extends WeixinBaseController {
|
|
guidance.setDoctor(getUID());
|
|
guidance.setDoctor(getUID());
|
|
guidance.setPatient(patient);
|
|
guidance.setPatient(patient);
|
|
Doctor doctor = doctorService.findDoctorByCode(getUID());
|
|
Doctor doctor = doctorService.findDoctorByCode(getUID());
|
|
|
|
if (images==null) {
|
|
|
|
}else {
|
|
|
|
String[] imgs = images.split(",");
|
|
|
|
for (String image : imgs) {
|
|
|
|
if (image.contains("http://")) {
|
|
|
|
imageUrls += image + ",";
|
|
|
|
} else {
|
|
|
|
try {
|
|
|
|
imageRow += CommonUtil.copyTempImage(image)+",";
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
images = imageUrls + imageRow;
|
|
|
|
images = images.substring(0,images.length()-1);
|
|
|
|
}
|
|
guidance.setImages(images);
|
|
guidance.setImages(images);
|
|
|
|
|
|
// 保存
|
|
// 保存
|