|
@ -6,6 +6,8 @@ import com.yihu.wlyy.service.BaseService;
|
|
|
import com.yihu.wlyy.util.CommonUtil;
|
|
|
import org.json.JSONObject;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@ -150,42 +152,61 @@ public class DoctorGuidanceTempService extends BaseService {
|
|
|
* @param type 模板类型
|
|
|
* @return
|
|
|
*/
|
|
|
public List<Map<String,Object>> list(String doctor, String type) throws Exception {
|
|
|
List<DoctorGuidanceTemp> temps = null;
|
|
|
public List<Map<String,Object>> list(String doctor, String type,int pageSize) throws Exception {
|
|
|
// List<DoctorGuidanceTemp> temps = null;
|
|
|
Page<List<DoctorGuidanceTemp>> temps = null;
|
|
|
PageRequest pageRequest = new PageRequest(0, pageSize);
|
|
|
|
|
|
List<Map<String,Object>> listMap = new ArrayList<>();
|
|
|
|
|
|
if (type.equals("1")) {
|
|
|
temps = guidanceTempDao.findByOwner("system");
|
|
|
for(DoctorGuidanceTemp temp : temps){
|
|
|
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",temp.getCode());
|
|
|
tem.put("owner",temp.getOwner());
|
|
|
tem.put("sendTimes",temp.getSendTimes());
|
|
|
tem.put("lastTime",temp.getLastTime());
|
|
|
tem.put("modelName",temp.getModelName());
|
|
|
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);
|
|
|
}
|
|
|
} else if (type.equals("2")) {
|
|
|
temps = guidanceTempDao.findByOwner(doctor);
|
|
|
for(DoctorGuidanceTemp temp : temps){
|
|
|
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);
|
|
|
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);
|
|
|
}
|
|
|
} else {
|
|
|
temps = guidanceTempDao.findByOwnerAndSystem(doctor);
|
|
|
for(DoctorGuidanceTemp temp : temps){
|
|
|
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);
|
|
|
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());
|
|
|
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);
|
|
|
}
|
|
|
}
|