|
@ -1,7 +1,9 @@
|
|
|
package com.yihu.wlyy.service.template;
|
|
|
|
|
|
import com.yihu.wlyy.entity.template.DoctorGuidanceTemp;
|
|
|
import com.yihu.wlyy.entity.template.DoctorTeamGuidanceTemplate;
|
|
|
import com.yihu.wlyy.repository.template.DoctorGuidanceTempDao;
|
|
|
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;
|
|
@ -29,6 +31,8 @@ public class DoctorGuidanceTempService extends BaseService {
|
|
|
DoctorGuidanceTempDao guidanceTempDao;
|
|
|
@Autowired
|
|
|
JdbcTemplate jdbcTemplate;
|
|
|
@Autowired
|
|
|
private DoctorTeamGuidanceTemplateDao doctorTeamGuidanceTemplateDao;
|
|
|
|
|
|
@Autowired
|
|
|
private CommonUtil CommonUtil;
|
|
@ -247,4 +251,65 @@ public class DoctorGuidanceTempService extends BaseService {
|
|
|
return listMap;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 根据模板类型、文章标题模糊搜索指导模板
|
|
|
*
|
|
|
* @param filter 搜索关键字
|
|
|
* @param type 1:系统 2:个人 3:团队摸版
|
|
|
* @param pageSize
|
|
|
* @param pageNo
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public List<Map<String, Object>> listByTitle(String filter,String type, Integer teamId, int pageSize, int pageNo) throws Exception {
|
|
|
PageRequest pageRequest = new PageRequest(pageNo, pageSize);
|
|
|
List<Map<String, Object>> listMap = new ArrayList<>();
|
|
|
|
|
|
if ("1".equals(type)) {
|
|
|
Page<DoctorGuidanceTemp> temps = guidanceTempDao.listByTileSystem("%"+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);
|
|
|
}
|
|
|
} else if ("2".equals(type)) {
|
|
|
Page<DoctorGuidanceTemp> temps = guidanceTempDao.listByTile("%"+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);
|
|
|
}
|
|
|
} else if("3".equals(type) && teamId!=null){
|
|
|
Page<DoctorTeamGuidanceTemplate> temps = doctorTeamGuidanceTemplateDao.listByTile(teamId,"%"+filter+"%", pageRequest);
|
|
|
|
|
|
List<DoctorTeamGuidanceTemplate> list = temps.getContent();
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
DoctorTeamGuidanceTemplate dgt = list.get(i);
|
|
|
Map<String, Object> tem = new HashMap<>();
|
|
|
tem.put("code", dgt.getTeamTemplateCode());
|
|
|
tem.put("owner", dgt.getCreater());
|
|
|
tem.put("sendTimes", dgt.getUseTimes());
|
|
|
tem.put("lastTime", dgt.getCzrq());
|
|
|
tem.put("modelName", dgt.getTitle());
|
|
|
listMap.add(tem);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return listMap;
|
|
|
}
|
|
|
|
|
|
}
|