소스 검색

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

chenweida 8 년 전
부모
커밋
8c9ff72a17

+ 10 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java

@ -199,7 +199,7 @@ public class FamilyContractService extends BaseService {
     * @param level    医生类型:1专科医生,2全科医生,3健康管理师
     * @return
     */
    public Page<Doctor> findDoctors(String hospital, Integer level, Long id, Integer pagesize) {
    public Page<Doctor> findDoctors(String hospital, String city, String town, String name, Integer level, Long id, Integer pagesize) {
        if (pagesize == null || pagesize <= 0) {
            pagesize = 10;
        }
@ -212,6 +212,15 @@ public class FamilyContractService extends BaseService {
        if (StringUtils.isNoneEmpty(hospital)) {
            filters.put("hospital", new SearchFilter("hospital", Operator.EQ, hospital));
        }
        if (!org.springframework.util.StringUtils.isEmpty(city)) {
            filters.put("city", new SearchFilter("city", Operator.EQ, city));
        }
        if (!org.springframework.util.StringUtils.isEmpty(town)) {
            filters.put("town", new SearchFilter("town", Operator.EQ, town));
        }
        if (!org.springframework.util.StringUtils.isEmpty(name)) {
            filters.put("name", new SearchFilter("name", Operator.LIKE, "%" + name + "%"));
        }
        if (id != null && id > 0) {
            filters.put("id", new SearchFilter("id", Operator.GT, id));
        }

+ 6 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/account/DoctorController.java

@ -142,13 +142,16 @@ public class DoctorController extends BaseController {
    @RequestMapping(value = "getDoctorsByhospital")
    @ResponseBody
    public String getDoctorsByhospital(
            @RequestParam(required = false) String hospital,
            @RequestParam(required = false) String hospital, //医院code
            @RequestParam(required = false) String city, //市代码
            @RequestParam(required = false) String town, //区代码
            @RequestParam(required = false) Integer type,
            @RequestParam(required = true)  Long id,
            @RequestParam(required = false) String name, //名称
            @RequestParam(required = true) Long id,
            @RequestParam(required = true) Integer pagesize) {
        try {
            JSONArray array = new JSONArray();
            Page<Doctor> list = familyContractService.findDoctors(hospital, type, id, pagesize);
            Page<Doctor> list = familyContractService.findDoctors(hospital, city, town, name, type, id, pagesize);
            if (list != null) {
                for (Doctor doctor : list) {
                    if (doctor == null) {

+ 19 - 19
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/sign/FamilyContractController.java

@ -140,7 +140,7 @@ public class FamilyContractController extends BaseController {
    public String hospitalList(String hospital, long id, int pagesize) {
        try {
            JSONArray array = new JSONArray();
            Page<Doctor> list = familyContractService.findDoctors(hospital, 2, id, pagesize);
            Page<Doctor> list = familyContractService.findDoctors(hospital, "", "", "", 2, id, pagesize);
            if (list != null) {
                for (Doctor doctor : list) {
                    if (doctor == null) {
@ -582,18 +582,18 @@ public class FamilyContractController extends BaseController {
     * @param doctor
     * @return
     */
    @RequestMapping(value = "/doctor_sign_exist",method = {RequestMethod.GET,RequestMethod.POST})
    @RequestMapping(value = "/doctor_sign_exist", method = {RequestMethod.GET, RequestMethod.POST})
    @ResponseBody
    public String isPatientAndDoctorExistSign(@RequestParam(required = true) String doctor){
        try{
            if(StringUtils.isEmpty(doctor)){
                return error(-1,"医生不能为空");
    public String isPatientAndDoctorExistSign(@RequestParam(required = true) String doctor) {
        try {
            if (StringUtils.isEmpty(doctor)) {
                return error(-1, "医生不能为空");
            }
            JSONObject result = familyContractService.isPatientAndDoctorExistSign(getUID(),doctor);
            return write(200,"查询成功","data",result);
        }catch (Exception e){
            JSONObject result = familyContractService.isPatientAndDoctorExistSign(getUID(), doctor);
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1,"查询失败");
            return error(-1, "查询失败");
        }
    }
@ -603,17 +603,17 @@ public class FamilyContractController extends BaseController {
     * @param doctor
     * @return
     */
    @RequestMapping(value = "/doctor_can_sign",method = {RequestMethod.GET,RequestMethod.POST})
    @RequestMapping(value = "/doctor_can_sign", method = {RequestMethod.GET, RequestMethod.POST})
    @ResponseBody
    public String isPatientAndDoctorCanSign(@RequestParam(required = true) String doctor){
        try{
            if(StringUtils.isEmpty(doctor)){
                return error(-1,"医生不能为空");
    public String isPatientAndDoctorCanSign(@RequestParam(required = true) String doctor) {
        try {
            if (StringUtils.isEmpty(doctor)) {
                return error(-1, "医生不能为空");
            }
            JSONObject result = familyContractService.isPatientAndDoctorCanSign(getUID(),doctor);
            return write(200,"查询成功","data",result);
        }catch (Exception e){
            return error(-1,"查询失败");
            JSONObject result = familyContractService.isPatientAndDoctorCanSign(getUID(), doctor);
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
            return error(-1, "查询失败");
        }
    }
}