Browse Source

Merge branch 'dev' of chenweida/patient-co-management into dev

chenweida 8 years ago
parent
commit
f8bd0945df

+ 6 - 3
src/main/java/com/yihu/wlyy/service/app/account/DoctorInfoService.java

@ -609,7 +609,7 @@ public class DoctorInfoService extends BaseService {
        return doctorDao.findAll(spec, pageRequest);
    }
    public Page<Doctor> findFamousDoctor(String key, int page, int pageSize) {
    public Page<Doctor> findFamousDoctor(String key,Integer type, int page, int pageSize) {
        if (pageSize <= 0) {
            pageSize = 10;
        }
@ -623,9 +623,12 @@ public class DoctorInfoService extends BaseService {
        // 查询全部
        Map<String, SearchFilter> filters = new HashMap<String, SearchFilter>();
        if (StringUtils.isNotEmpty(key)) {
            filters.put("name", new SearchFilter("name", SearchFilter.Operator.LIKE, key));
                filters.put("name", new SearchFilter("name", SearchFilter.Operator.LIKE, key));
        }
        filters.put("isFamous", new SearchFilter("isFamous", SearchFilter.Operator.EQ, 1));
        filters.put("isFamous", new SearchFilter("isFamous", SearchFilter.Operator.EQ, type));
        filters.put("level", new SearchFilter("level", SearchFilter.Operator.EQ, 1));
        Specification<Doctor> spec = DynamicSpecifications.bySearchFilter(filters.values(), Doctor.class);
        return doctorDao.findAll(spec, pageRequest);

+ 3 - 1
src/main/java/com/yihu/wlyy/web/doctor/account/DoctorController.java

@ -326,6 +326,7 @@ public class DoctorController extends BaseController {
    /**
     * 名医列表
     * @param key 医生名称
     * @param type 是否是名医 1是  0不是
     * @param page 当前页
     * @param pagesize 每页显示条数
     * @return
@ -334,11 +335,12 @@ public class DoctorController extends BaseController {
    @ResponseBody
    public String findFamousDoctor(
            @RequestParam(required = false) String key,
            Integer type,
            int page,
            int pagesize) {
        try {
            JSONArray array = new JSONArray();
            Page<Doctor> list = doctorInfoService.findFamousDoctor(key, page, pagesize);
            Page<Doctor> list = doctorInfoService.findFamousDoctor(key,type, page, pagesize);
            if (list != null) {
                for (Doctor doctor : list) {
                    JSONObject json = new JSONObject();