Ver código fonte

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

lyr 8 anos atrás
pai
commit
bbdc44900f

+ 10 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/team/AdminTeamService.java

@ -355,4 +355,14 @@ public class AdminTeamService extends BaseService {
        return result;
    }
    /**
     * 查询机构下团队
     *
     * @param hospital
     * @return
     */
    public List<AdminTeam> findHospitalTeams(String hospital){
        return teamDao.findByOrgCode(hospital);
    }
}

+ 30 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/area/AreaService.java

@ -0,0 +1,30 @@
package com.yihu.wlyy.service.common.area;
import com.yihu.wlyy.entity.address.Town;
import com.yihu.wlyy.repository.address.TownDao;
import com.yihu.wlyy.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * Created by lyr-pc on 2016/11/22.
 */
@Service
public class AreaService extends BaseService {
    @Autowired
    TownDao townDao;
    /**
     * 查询城市城镇
     *
     * @param city
     * @return
     */
    public List<Town> getCityTowns(String city){
        return townDao.findByCityCode(city);
    }
}

+ 44 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/area/AreaController.java

@ -0,0 +1,44 @@
package com.yihu.wlyy.web.common.area;
import com.yihu.wlyy.entity.address.Town;
import com.yihu.wlyy.service.app.label.SignPatientLabelInfoService;
import com.yihu.wlyy.service.common.area.AreaService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
/**
 * Created by lyr-pc on 2016/11/22.
 */
@RestController
@RequestMapping(value = "/area")
@Api(description = "城市、城镇管理")
public class AreaController extends BaseController {
    @Autowired
    AreaService areaService;
    /**
     * 查询城市下的城镇
     *
     * @param city 城市
     * @return
     */
    @RequestMapping(value = "/{city}/towns", method = RequestMethod.GET)
    public String getCityTowns(@PathVariable String city) {
        try {
            List<Town> towns = areaService.getCityTowns(city);
            return write(200, "查询成功", "data", towns == null ? new ArrayList<Town>() : towns);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
}

+ 36 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/hospital/HospitalController.java

@ -0,0 +1,36 @@
package com.yihu.wlyy.web.common.hospital;
import com.yihu.wlyy.entity.organization.Hospital;
import com.yihu.wlyy.service.app.hospital.HospitalService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
/**
 * Created by lyr-pc on 2016/11/22.
 */
@RestController
@RequestMapping(value = "/hospitals")
@Api(description = "医院管理")
public class HospitalController extends BaseController {
    @Autowired
    HospitalService hospitalService;
    @RequestMapping(value = "/{town}/community_hospitals",method = RequestMethod.GET)
    @ApiOperation(value = "查询城镇下社区")
    public String getTownHospitals(@PathVariable String town) {
        try {
            List<Hospital> hospitals = hospitalService.getHositalByTownCode(town);
            return write(200, "查询成功", "data", hospitals == null ? new ArrayList<Hospital>() : hospitals);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
}

+ 12 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/team/AdminTeamController.java

@ -313,4 +313,16 @@ public class AdminTeamController extends BaseController {
            return error(-1, "查询失败");
        }
    }
    @RequestMapping(value = "/teams/{hospital}", method = RequestMethod.GET)
    @ApiOperation(value = "查询机构下的团队")
    public String getHospitalTeams(@PathVariable  String hospital){
        try{
            List<AdminTeam> teams =  teamService.findHospitalTeams(hospital);
            return write(200,"查询成功","data",teams);
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"查询失败");
        }
    }
}