|
@ -3,6 +3,7 @@ package com.yihu.wlyy.service.template;
|
|
import com.yihu.wlyy.entity.template.DoctorGuidanceTemp;
|
|
import com.yihu.wlyy.entity.template.DoctorGuidanceTemp;
|
|
import com.yihu.wlyy.repository.template.DoctorGuidanceTempDao;
|
|
import com.yihu.wlyy.repository.template.DoctorGuidanceTempDao;
|
|
import com.yihu.wlyy.service.BaseService;
|
|
import com.yihu.wlyy.service.BaseService;
|
|
|
|
import com.yihu.wlyy.util.CommonUtil;
|
|
import org.json.JSONObject;
|
|
import org.json.JSONObject;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
@ -56,10 +57,6 @@ public class DoctorGuidanceTempService extends BaseService {
|
|
String [] imagesArray = null;
|
|
String [] imagesArray = null;
|
|
if(imagesUrl != null){
|
|
if(imagesUrl != null){
|
|
imagesArray = imagesUrl.split(",");
|
|
imagesArray = imagesUrl.split(",");
|
|
String head = "htttp://";
|
|
|
|
for (int i=0;i<imagesArray.length;i++) {
|
|
|
|
imagesArray[i]=head +imagesArray[i];
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
|
|
String createTime = (String)temp.get("create_time").toString();
|
|
String createTime = (String)temp.get("create_time").toString();
|
|
@ -82,6 +79,7 @@ public class DoctorGuidanceTempService extends BaseService {
|
|
*/
|
|
*/
|
|
public DoctorGuidanceTemp add(String doctor, String content,String modelName,String imagesUrl) {
|
|
public DoctorGuidanceTemp add(String doctor, String content,String modelName,String imagesUrl) {
|
|
DoctorGuidanceTemp guidanceTemp = new DoctorGuidanceTemp();
|
|
DoctorGuidanceTemp guidanceTemp = new DoctorGuidanceTemp();
|
|
|
|
String imgsUrl = null;
|
|
|
|
|
|
guidanceTemp.setCode(getCode());
|
|
guidanceTemp.setCode(getCode());
|
|
guidanceTemp.setOwner(doctor);
|
|
guidanceTemp.setOwner(doctor);
|
|
@ -90,7 +88,13 @@ public class DoctorGuidanceTempService extends BaseService {
|
|
guidanceTemp.setCreateTime(new Date());
|
|
guidanceTemp.setCreateTime(new Date());
|
|
|
|
|
|
guidanceTemp.setModelName(modelName);
|
|
guidanceTemp.setModelName(modelName);
|
|
guidanceTemp.setImagesUrl(imagesUrl);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
imgsUrl = CommonUtil.copyTempImage(imagesUrl);
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
guidanceTemp.setImagesUrl(imgsUrl);
|
|
|
|
|
|
return guidanceTempDao.save(guidanceTemp);
|
|
return guidanceTempDao.save(guidanceTemp);
|
|
}
|
|
}
|
|
@ -155,8 +159,8 @@ public class DoctorGuidanceTempService extends BaseService {
|
|
temps = guidanceTempDao.findByOwner("system");
|
|
temps = guidanceTempDao.findByOwner("system");
|
|
for(DoctorGuidanceTemp temp : temps){
|
|
for(DoctorGuidanceTemp temp : temps){
|
|
Map<String,Object> tem = new HashMap<>();
|
|
Map<String,Object> tem = new HashMap<>();
|
|
tem.put("code:",temp.getCode());
|
|
|
|
tem.put("owner:",temp.getOwner());
|
|
|
|
|
|
tem.put("code",temp.getCode());
|
|
|
|
tem.put("owner",temp.getOwner());
|
|
tem.put("sendTimes",temp.getSendTimes());
|
|
tem.put("sendTimes",temp.getSendTimes());
|
|
tem.put("lastTime",temp.getLastTime());
|
|
tem.put("lastTime",temp.getLastTime());
|
|
tem.put("modelName",temp.getModelName());
|
|
tem.put("modelName",temp.getModelName());
|
|
@ -166,8 +170,8 @@ public class DoctorGuidanceTempService extends BaseService {
|
|
temps = guidanceTempDao.findByOwner(doctor);
|
|
temps = guidanceTempDao.findByOwner(doctor);
|
|
for(DoctorGuidanceTemp temp : temps){
|
|
for(DoctorGuidanceTemp temp : temps){
|
|
Map<String,Object> tem = new HashMap<>();
|
|
Map<String,Object> tem = new HashMap<>();
|
|
tem.put("code:",temp.getCode());
|
|
|
|
tem.put("owner:",temp.getOwner());
|
|
|
|
|
|
tem.put("code",temp.getCode());
|
|
|
|
tem.put("owner",temp.getOwner());
|
|
tem.put("sendTimes",temp.getSendTimes());
|
|
tem.put("sendTimes",temp.getSendTimes());
|
|
tem.put("lastTime",temp.getLastTime());
|
|
tem.put("lastTime",temp.getLastTime());
|
|
tem.put("modelName",temp.getModelName());
|
|
tem.put("modelName",temp.getModelName());
|
|
@ -177,8 +181,8 @@ public class DoctorGuidanceTempService extends BaseService {
|
|
temps = guidanceTempDao.findByOwnerAndSystem(doctor);
|
|
temps = guidanceTempDao.findByOwnerAndSystem(doctor);
|
|
for(DoctorGuidanceTemp temp : temps){
|
|
for(DoctorGuidanceTemp temp : temps){
|
|
Map<String,Object> tem = new HashMap<>();
|
|
Map<String,Object> tem = new HashMap<>();
|
|
tem.put("code:",temp.getCode());
|
|
|
|
tem.put("owner:",temp.getOwner());
|
|
|
|
|
|
tem.put("code",temp.getCode());
|
|
|
|
tem.put("owner",temp.getOwner());
|
|
tem.put("sendTimes",temp.getSendTimes());
|
|
tem.put("sendTimes",temp.getSendTimes());
|
|
tem.put("lastTime",temp.getLastTime());
|
|
tem.put("lastTime",temp.getLastTime());
|
|
tem.put("modelName",temp.getModelName());
|
|
tem.put("modelName",temp.getModelName());
|