|
@ -7,6 +7,7 @@ import com.yihu.wlyy.repository.template.DoctorTeamGuidanceTemplateDao;
|
|
|
import com.yihu.wlyy.service.BaseService;
|
|
|
import com.yihu.wlyy.util.CodeFomat;
|
|
|
import com.yihu.wlyy.util.CommonUtil;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.json.JSONObject;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
@ -201,53 +202,40 @@ public class DoctorGuidanceTempService extends BaseService {
|
|
|
* @param type 模板类型
|
|
|
* @return
|
|
|
*/
|
|
|
public List<Map<String, Object>> list(String doctor, String type, int pageSize, int pageNo) throws Exception {
|
|
|
public List<Map<String, Object>> list(String doctor,String filter, String type, int pageSize, int pageNo) throws Exception {
|
|
|
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);
|
|
|
|
|
|
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<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);
|
|
|
if (StringUtils.isEmpty(filter)){
|
|
|
if (type.equals("1")) {
|
|
|
temps = guidanceTempDao.findByOwner("system", pageRequest);
|
|
|
} else if (type.equals("2")) {
|
|
|
temps = guidanceTempDao.findByOwner(doctor, pageRequest);
|
|
|
} else {
|
|
|
temps = guidanceTempDao.findByOwnerAndSystem(doctor, pageRequest);
|
|
|
}
|
|
|
} else {
|
|
|
temps = guidanceTempDao.findByOwnerAndSystem(doctor, pageRequest);
|
|
|
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("1")) {
|
|
|
temps = guidanceTempDao.listByTileSystem("%"+filter+"%", pageRequest);
|
|
|
} else if (type.equals("2")) {
|
|
|
temps = guidanceTempDao.listOwnerByTile(doctor,"%"+filter+"%", pageRequest);
|
|
|
} else {
|
|
|
temps = guidanceTempDao.listByTileAll(doctor,"%"+filter+"%", pageRequest);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
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);
|
|
|
}
|
|
|
return listMap;
|
|
|
}
|
|
|
|