Explorar o código

新增咨询接口

chenweida %!s(int64=8) %!d(string=hai) anos
pai
achega
854e08e796

+ 15 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/consult/ConsultTeamDao.java

@ -253,4 +253,19 @@ public interface ConsultTeamDao extends PagingAndSortingRepository<ConsultTeam,
	@Query("FROM ConsultTeam a where a.type=?1 and a.adminTeamId is null")
	List<ConsultTeam> findByTypeAndAdminTeamIdIsNull(Integer s);
	//名医咨询 -我咨询的全部 带symptoms
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.from = ?1 and a.id < ?2 and a.symptoms like ?3 and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findMyFamousDoctorAllList(String uid, long id, String title, Pageable pageRequest);
	//名医咨询 -我咨询的全部 带symptoms
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.from = ?1 and a.symptoms like ?2 and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findMyFamousDoctorAllList(String uid, String title, Pageable pageRequest);
	//名医咨询 -我咨询的全部 带symptoms
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.from = ?1 and a.id < ?2 and  a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findMyFamousDoctorAllList(String uid, Long id, Pageable pageRequest);
	//名医咨询 -我咨询的全部 带symptoms
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.from = ?1  and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findMyFamousDoctorAllList(String uid, Pageable pageRequest);
}

+ 23 - 9
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java

@ -132,10 +132,32 @@ public class ConsultTeamService extends ConsultService {
                return findByDoctorType8(uid, id, pagesize, title);
            case 9:
                return findByDoctorType9(uid, id, pagesize);
            case 10:
                return findByDoctorType10(uid, id, pagesize, title);
        }
        return null;
    }
    private Page<ConsultTeam> findByDoctorType10(String uid, long id, int pagesize,String title) {
        Sort sort = new Sort(Direction.DESC, "id");
        // 分页信息
        PageRequest pageRequest = new PageRequest(0, pagesize, sort);
        if (StringUtils.isNoneEmpty(title)) {
            title = "%" + title + "%";
            if (id > 0) {
                return consultTeamDao.findMyFamousDoctorAllList(uid, id, title, pageRequest);
            } else {
                return consultTeamDao.findMyFamousDoctorAllList(uid, title, pageRequest);
            }
        } else {
            if (id > 0) {
                return consultTeamDao.findMyFamousDoctorAllList(uid, id, pageRequest);
            } else {
                return consultTeamDao.findMyFamousDoctorAllList(uid, pageRequest);
            }
        }
    }
    private Page<ConsultTeam> findByDoctorTypeSix(String uid, long id, int pagesize, String title) {
        Sort sort = new Sort(Direction.DESC, "id");
        // 分页信息
@ -335,15 +357,7 @@ public class ConsultTeamService extends ConsultService {
     * @return
     */
    public Page<ConsultTeam> findByDoctorType9(String uid, long id, int pagesize) {
        // 排序
        Sort sort = new Sort(Direction.DESC, "id");
        // 分页信息
        PageRequest pageRequest = new PageRequest(0, pagesize, sort);
        if (id > 0) {
            return consultTeamDao.findDoctorAllList(uid, id, pageRequest);
        } else {
            return consultTeamDao.findDoctorAllList(uid, pageRequest);
        }
        return null;
    }
    /**

+ 7 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/consult/DoctorConsultController.java

@ -57,14 +57,19 @@ public class DoctorConsultController extends WeixinBaseController {
    /**
     * 三师咨询列表查询
     *
     * @param type     咨询类型:0、全部,1、咨询我的,2、公共的, 3、参与过的,4、已结束的  5 名医咨询 全部  6 名医咨询 进行中 7 名医咨询 已结束 8名医咨询 待处理 9咨询我的三师 + 家庭 + 名医
     * @param type     咨询类型:0、全部,1、咨询我的,2、公共的, 3、参与过的,4、已结束的  5 名医咨询 全部
     *                 6 名医咨询 进行中 7 名医咨询 已结束 8名医咨询 待处理 9咨询我的三师 + 家庭 + 名医   10查询我咨询的
     * @param id
     * @param pagesize 每页显示数,默认为10
     * @return
     */
    @RequestMapping(value = "list")
    @ResponseBody
    public String list(int type, int id, int pagesize, @RequestParam(required = false) String patient, @RequestParam(required = false) String title) {
    public String list(int type,
                       int id,
                       int pagesize,
                       @RequestParam(required = false) String patient,
                       @RequestParam(required = false) String title) {
        try {
            Page<ConsultTeam> list = consultTeamService.findByDoctor(getUID(), type, id, pagesize, title);
            JSONArray jsonArray = new JSONArray();