|
@ -81,7 +81,7 @@ public class DoctorGuidanceTempService extends BaseService {
|
|
|
*/
|
|
|
public DoctorGuidanceTemp add(String doctor, String content,String modelName,String imagesUrl) {
|
|
|
DoctorGuidanceTemp guidanceTemp = new DoctorGuidanceTemp();
|
|
|
String imgsUrl = null;
|
|
|
String imgsUrl = "";
|
|
|
|
|
|
guidanceTemp.setCode(getCode());
|
|
|
guidanceTemp.setOwner(doctor);
|
|
@ -91,10 +91,22 @@ public class DoctorGuidanceTempService extends BaseService {
|
|
|
|
|
|
guidanceTemp.setModelName(modelName);
|
|
|
|
|
|
try {
|
|
|
imgsUrl = CommonUtil.copyTempImage(imagesUrl);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
String[] images = imagesUrl.split(",");
|
|
|
for (String image: images) {
|
|
|
if (image.contains("http://")){
|
|
|
imgsUrl += image+",";
|
|
|
}else {
|
|
|
try {
|
|
|
imgsUrl += CommonUtil.copyTempImage(image);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (imgsUrl.endsWith(",")){
|
|
|
imgsUrl = imgsUrl.substring(0,imgsUrl.length()-1);
|
|
|
}
|
|
|
guidanceTemp.setImagesUrl(imgsUrl);
|
|
|
|
|
@ -153,60 +165,48 @@ public class DoctorGuidanceTempService extends BaseService {
|
|
|
* @return
|
|
|
*/
|
|
|
public List<Map<String,Object>> list(String doctor, String type,int pageSize,int pageNo) throws Exception {
|
|
|
// List<DoctorGuidanceTemp> temps = null;
|
|
|
Page<List<DoctorGuidanceTemp>> temps = null;
|
|
|
Page<DoctorGuidanceTemp> temps = null;
|
|
|
PageRequest pageRequest = new PageRequest(pageNo, pageSize);
|
|
|
|
|
|
List<Map<String,Object>> listMap = new ArrayList<>();
|
|
|
|
|
|
if (type.equals("1")) {
|
|
|
temps = guidanceTempDao.findByOwner("system",pageRequest);
|
|
|
/*for(List<DoctorGuidanceTemp> te : temps){
|
|
|
for (DoctorGuidanceTemp temp : te){
|
|
|
Map<String,Object> tem = new HashMap<>();
|
|
|
tem.put("code",temp.getCode());
|
|
|
tem.put("owner",temp.getOwner());
|
|
|
tem.put("sendTimes",temp.getSendTimes());
|
|
|
tem.put("lastTime",temp.getLastTime());
|
|
|
tem.put("modelName",temp.getModelName());
|
|
|
listMap.add(tem);
|
|
|
}
|
|
|
}*/
|
|
|
List<List<DoctorGuidanceTemp>> temd = temps.getContent();
|
|
|
for (int i=0;i<temd.size();i++){
|
|
|
DoctorGuidanceTemp doctorGuidanceTemp = (DoctorGuidanceTemp)temd.get(i);
|
|
|
Map<String,Object> tem = new HashMap<>();
|
|
|
tem.put("code",doctorGuidanceTemp.getCode());
|
|
|
tem.put("owner",doctorGuidanceTemp.getOwner());
|
|
|
tem.put("sendTimes",doctorGuidanceTemp.getSendTimes());
|
|
|
tem.put("lastTime",doctorGuidanceTemp.getLastTime());
|
|
|
tem.put("modelName",doctorGuidanceTemp.getModelName());
|
|
|
listMap.add(tem);
|
|
|
}
|
|
|
|
|
|
List<DoctorGuidanceTemp> list = temps.getContent();
|
|
|
for (int i=0;i<list.size();i++){
|
|
|
DoctorGuidanceTemp dgt = list.get(i);
|
|
|
Map<String,Object> tem = new HashMap<>();
|
|
|
tem.put("code",dgt.getCode());
|
|
|
tem.put("owner",dgt.getOwner());
|
|
|
tem.put("sendTimes",dgt.getSendTimes());
|
|
|
tem.put("lastTime",dgt.getLastTime());
|
|
|
tem.put("modelName",dgt.getModelName());
|
|
|
listMap.add(tem);
|
|
|
}
|
|
|
} else if (type.equals("2")) {
|
|
|
temps = guidanceTempDao.findByOwner(doctor,pageRequest);
|
|
|
List<List<DoctorGuidanceTemp>> temd = temps.getContent();
|
|
|
for (int i=0;i<temd.size();i++){
|
|
|
DoctorGuidanceTemp doctorGuidanceTemp = (DoctorGuidanceTemp)temd.get(i);
|
|
|
Map<String,Object> tem = new HashMap<>();
|
|
|
tem.put("code",doctorGuidanceTemp.getCode());
|
|
|
tem.put("owner",doctorGuidanceTemp.getOwner());
|
|
|
tem.put("sendTimes",doctorGuidanceTemp.getSendTimes());
|
|
|
tem.put("lastTime",doctorGuidanceTemp.getLastTime());
|
|
|
tem.put("modelName",doctorGuidanceTemp.getModelName());
|
|
|
listMap.add(tem);
|
|
|
List<DoctorGuidanceTemp> list = temps.getContent();
|
|
|
for (int i=0;i<list.size();i++){
|
|
|
DoctorGuidanceTemp dgt = list.get(i);
|
|
|
Map<String,Object> tem = new HashMap<>();
|
|
|
tem.put("code",dgt.getCode());
|
|
|
tem.put("owner",dgt.getOwner());
|
|
|
tem.put("sendTimes",dgt.getSendTimes());
|
|
|
tem.put("lastTime",dgt.getLastTime());
|
|
|
tem.put("modelName",dgt.getModelName());
|
|
|
listMap.add(tem);
|
|
|
}
|
|
|
} else {
|
|
|
temps = guidanceTempDao.findByOwnerAndSystem(doctor,pageRequest);
|
|
|
List<List<DoctorGuidanceTemp>> temd = temps.getContent();
|
|
|
for (int i=0;i<temd.size();i++){
|
|
|
DoctorGuidanceTemp doctorGuidanceTemp = (DoctorGuidanceTemp)temd.get(i);
|
|
|
List<DoctorGuidanceTemp> list = temps.getContent();
|
|
|
for (int i=0;i<list.size();i++){
|
|
|
DoctorGuidanceTemp dgt = list.get(i);
|
|
|
Map<String,Object> tem = new HashMap<>();
|
|
|
tem.put("code",doctorGuidanceTemp.getCode());
|
|
|
tem.put("owner",doctorGuidanceTemp.getOwner());
|
|
|
tem.put("sendTimes",doctorGuidanceTemp.getSendTimes());
|
|
|
tem.put("lastTime",doctorGuidanceTemp.getLastTime());
|
|
|
tem.put("modelName",doctorGuidanceTemp.getModelName());
|
|
|
tem.put("code",dgt.getCode());
|
|
|
tem.put("owner",dgt.getOwner());
|
|
|
tem.put("sendTimes",dgt.getSendTimes());
|
|
|
tem.put("lastTime",dgt.getLastTime());
|
|
|
tem.put("modelName",dgt.getModelName());
|
|
|
listMap.add(tem);
|
|
|
}
|
|
|
}
|