|
@ -6,16 +6,13 @@ import com.yihu.jw.hospital.module.common.BaseController;
|
|
|
import com.yihu.jw.hospital.module.health.service.MedicinesService;
|
|
|
import com.yihu.jw.hospital.module.health.service.PatientHealthRecordService;
|
|
|
import com.yihu.jw.hospital.module.health.service.SportsService;
|
|
|
import com.yihu.jw.im.service.ImService;
|
|
|
import com.yihu.jw.util.date.DateUtil;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.json.JSONArray;
|
|
|
import org.json.JSONObject;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
@ -44,13 +41,6 @@ public class PatientHealthRecordController extends BaseController {
|
|
|
@Autowired
|
|
|
private PatientHealthRecordService patientHealthRecordService;
|
|
|
|
|
|
@Autowired
|
|
|
private com.yihu.jw.util.common.CommonUtil CommonUtil;
|
|
|
@Autowired
|
|
|
private ImService imService;
|
|
|
@Value("$wechat.id")
|
|
|
private String wechatId;
|
|
|
|
|
|
/**
|
|
|
* 保健记录更改接口(包括手动记录的修改和所有的删除)
|
|
|
*
|
|
@ -71,28 +61,6 @@ public class PatientHealthRecordController extends BaseController {
|
|
|
@RequestParam(required = false) String value3,
|
|
|
@RequestParam(required = false) String value4) {
|
|
|
try {
|
|
|
if(type==1&&StringUtils.isNotBlank(value3)){
|
|
|
String images = "";
|
|
|
String[] imgs = value3.split(",");
|
|
|
for (String img:imgs){
|
|
|
if(img.contains("group1/")){
|
|
|
images+=img+",";
|
|
|
}
|
|
|
}
|
|
|
if(StringUtils.isNotEmpty(images)&&images.lastIndexOf(",")==images.length()-1){
|
|
|
images = images.substring(0,images.length()-1);
|
|
|
}
|
|
|
// 从微信服务器获取图片
|
|
|
value3 = imService.fetchWxImages(wechatId);
|
|
|
if(StringUtils.isNotEmpty(value3)){
|
|
|
value3 = CommonUtil.copyTempImage(value3);
|
|
|
}
|
|
|
if(StringUtils.isNotEmpty(value3)){
|
|
|
value3=value3+","+images.trim();
|
|
|
}else {
|
|
|
value3=images;
|
|
|
}
|
|
|
}
|
|
|
patientHealthRecordService.modifyHealthCare(id, type, value1, value2, value3, value4);
|
|
|
return write(200, "更改成功!");
|
|
|
} catch (Exception e) {
|
|
@ -267,13 +235,6 @@ public class PatientHealthRecordController extends BaseController {
|
|
|
record.setRecordDate(DateUtil.strToDateShort(record_date));
|
|
|
record.setSortDate(DateUtil.strToDateAppendNowTime(record_date, DateUtil.YYYY_MM_DD_HH_MM_SS));
|
|
|
record.setContent(content);
|
|
|
// 从微信服务器获取图片
|
|
|
if (StringUtils.isEmpty(images)) {
|
|
|
images = imService.fetchWxImages(wechatId);
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(images)) {
|
|
|
images = CommonUtil.copyTempImage(images);
|
|
|
}
|
|
|
record.setImages(images);
|
|
|
if (patientHealthRecordService.addDiet(record) != null) {
|
|
|
return success("保存成功");
|