10 changed files with 334 additions and 4 deletions
@ -0,0 +1,67 @@ |
|||||
|
package com.ccsens.carbasics.api; |
||||
|
|
||||
|
|
||||
|
import com.ccsens.carbasics.bean.dto.AccountDto; |
||||
|
import com.ccsens.carbasics.bean.dto.ManagementDto; |
||||
|
import com.ccsens.carbasics.bean.vo.ManagementVo; |
||||
|
import com.ccsens.carbasics.service.IManagementService; |
||||
|
import com.ccsens.cloudutil.annotation.MustLogin; |
||||
|
import com.ccsens.util.JsonResponse; |
||||
|
import com.ccsens.util.bean.dto.QueryDto; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import io.swagger.annotations.ApiParam; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.validation.annotation.Validated; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMethod; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author AUSU |
||||
|
*/ |
||||
|
@Api(tags = "机构管理相关" , description = "") |
||||
|
@RestController |
||||
|
@RequestMapping("/management") |
||||
|
@Slf4j |
||||
|
public class ManagementController { |
||||
|
|
||||
|
@Resource |
||||
|
private IManagementService managementService; |
||||
|
|
||||
|
@MustLogin |
||||
|
@ApiOperation(value = "查询医院等级列表", notes = "") |
||||
|
@RequestMapping(value = "/queryLevel", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
||||
|
public JsonResponse<List<ManagementVo.LevelInfo>> queryLevel(@ApiParam @Validated @RequestBody QueryDto params) throws Exception{ |
||||
|
log.info("查询医院等级列表开始{}",params); |
||||
|
List<ManagementVo.LevelInfo> levelInfoList = managementService.queryLevel(params.getUserId()); |
||||
|
log.info("查询医院等级列表结束:{}",levelInfoList); |
||||
|
return JsonResponse.newInstance().ok(levelInfoList); |
||||
|
} |
||||
|
|
||||
|
@MustLogin |
||||
|
@ApiOperation(value = "查询医院列表", notes = "") |
||||
|
@RequestMapping(value = "/queryHospitalList", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
||||
|
public JsonResponse<List<ManagementVo.HospitalInfo>> queryHospitalList(@ApiParam @Validated @RequestBody QueryDto<ManagementDto.QueryHospitalList> params) throws Exception{ |
||||
|
log.info("查询医院等级列表开始{}",params); |
||||
|
List<ManagementVo.HospitalInfo> hospitalInfoList = managementService.queryHospitalList(params.getParam(),params.getUserId()); |
||||
|
log.info("查询医院等级列表结束:{}",hospitalInfoList); |
||||
|
return JsonResponse.newInstance().ok(hospitalInfoList); |
||||
|
} |
||||
|
|
||||
|
@MustLogin |
||||
|
@ApiOperation(value = "查询医院的具体信息", notes = "") |
||||
|
@RequestMapping(value = "/queryHospitalInfo", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
||||
|
public JsonResponse<List<ManagementVo.HospitalData>> queryHospitalInfo(@ApiParam @Validated @RequestBody QueryDto<ManagementDto.QueryHospitalInfo> params) throws Exception{ |
||||
|
log.info("查询医院等级列表开始{}",params); |
||||
|
List<ManagementVo.HospitalData> hospitalData = managementService.queryHospitalInfo(params.getParam(),params.getUserId()); |
||||
|
log.info("查询医院等级列表结束:{}",hospitalData); |
||||
|
return JsonResponse.newInstance().ok(hospitalData); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,37 @@ |
|||||
|
package com.ccsens.carbasics.bean.dto; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
|
||||
|
/** |
||||
|
* @author AUSU |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ManagementDto { |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("查询医院列表-入参") |
||||
|
public static class QueryHospitalList { |
||||
|
@ApiModelProperty("等级id") |
||||
|
private Long levelId; |
||||
|
@ApiModelProperty("医院名称") |
||||
|
private String name; |
||||
|
@ApiModelProperty("省id") |
||||
|
private Long provinceId; |
||||
|
@ApiModelProperty("市id") |
||||
|
private Long cityId; |
||||
|
@ApiModelProperty("县id") |
||||
|
private Long countyId; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("查询医院具体信息-入参") |
||||
|
public static class QueryHospitalInfo { |
||||
|
@ApiModelProperty("医院id") |
||||
|
private Long id; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,76 @@ |
|||||
|
package com.ccsens.carbasics.bean.vo; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author AUSU |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ManagementVo { |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("查询医院等级列表-返参") |
||||
|
public static class LevelInfo { |
||||
|
@ApiModelProperty("等级id") |
||||
|
private Long levelId; |
||||
|
@ApiModelProperty("等级名称") |
||||
|
private String name; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("查询医院列表-返参") |
||||
|
public static class HospitalInfo { |
||||
|
@ApiModelProperty("医院id") |
||||
|
private Long id; |
||||
|
@ApiModelProperty("医院名称") |
||||
|
private String name; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("医院具体信息-返参") |
||||
|
public static class HospitalData { |
||||
|
@ApiModelProperty("部门id") |
||||
|
private Long did; |
||||
|
@ApiModelProperty("部门名称") |
||||
|
private String departmentName; |
||||
|
@ApiModelProperty("部门下的职位列表") |
||||
|
List<PositionInfo> positionInfoList; |
||||
|
@ApiModelProperty("下级部门列表") |
||||
|
List<HospitalData> sonDepartment; |
||||
|
} |
||||
|
@Data |
||||
|
@ApiModel("部门下的职位") |
||||
|
public static class PositionInfo { |
||||
|
@ApiModelProperty("职位Id") |
||||
|
private Long pid; |
||||
|
@ApiModelProperty("职位名称") |
||||
|
private String name; |
||||
|
@ApiModelProperty("职位关联的角色") |
||||
|
List<RoleInfo> roleList; |
||||
|
@ApiModelProperty("职位下的角色列表") |
||||
|
List<MemberInfo> memberInfoList; |
||||
|
} |
||||
|
@Data |
||||
|
@ApiModel("职位下的成员") |
||||
|
public static class MemberInfo { |
||||
|
@ApiModelProperty("成员id") |
||||
|
private Long mid; |
||||
|
@ApiModelProperty("成员名称") |
||||
|
private String name; |
||||
|
@ApiModelProperty("手机号") |
||||
|
private String phone; |
||||
|
} |
||||
|
@Data |
||||
|
@ApiModel("职位关联的角色") |
||||
|
public static class RoleInfo { |
||||
|
@ApiModelProperty("角色id") |
||||
|
private Long rid; |
||||
|
@ApiModelProperty("角色名称") |
||||
|
private String name; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,16 @@ |
|||||
|
package com.ccsens.carbasics.persist.dao; |
||||
|
|
||||
|
import com.ccsens.carbasics.bean.vo.ManagementVo; |
||||
|
import com.ccsens.carbasics.persist.mapper.OrganizationLevelMapper; |
||||
|
import org.springframework.stereotype.Repository; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Repository |
||||
|
public interface OrganizationLevelDao extends OrganizationLevelMapper { |
||||
|
/** |
||||
|
* 查询医院等级列表 |
||||
|
* @return 医院等级列表 |
||||
|
*/ |
||||
|
List<ManagementVo.LevelInfo> queryLevelList(); |
||||
|
} |
@ -0,0 +1,31 @@ |
|||||
|
package com.ccsens.carbasics.service; |
||||
|
|
||||
|
import com.ccsens.carbasics.bean.dto.ManagementDto; |
||||
|
import com.ccsens.carbasics.bean.vo.ManagementVo; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
public interface IManagementService { |
||||
|
/** |
||||
|
* 查询医院等级列表 |
||||
|
* @param userId 用户id |
||||
|
* @return 等级列表 |
||||
|
*/ |
||||
|
List<ManagementVo.LevelInfo> queryLevel(Long userId); |
||||
|
|
||||
|
/** |
||||
|
* 查询医院列表 |
||||
|
* @param param 筛选参数 |
||||
|
* @param userId 用户id |
||||
|
* @return 医院列表 |
||||
|
*/ |
||||
|
List<ManagementVo.HospitalInfo> queryHospitalList(ManagementDto.QueryHospitalList param, Long userId); |
||||
|
|
||||
|
/** |
||||
|
* 查询医院的具体信息 |
||||
|
* @param param 医院id |
||||
|
* @param userId 用户id |
||||
|
* @return 医院的具体信息 |
||||
|
*/ |
||||
|
List<ManagementVo.HospitalData> queryHospitalInfo(ManagementDto.QueryHospitalInfo param, Long userId); |
||||
|
} |
@ -0,0 +1,50 @@ |
|||||
|
package com.ccsens.carbasics.service; |
||||
|
|
||||
|
import com.ccsens.carbasics.bean.dto.ManagementDto; |
||||
|
import com.ccsens.carbasics.bean.po.OrganizationDepartment; |
||||
|
import com.ccsens.carbasics.bean.po.OrganizationLevel; |
||||
|
import com.ccsens.carbasics.bean.po.OrganizationLevelExample; |
||||
|
import com.ccsens.carbasics.bean.vo.ManagementVo; |
||||
|
import com.ccsens.carbasics.persist.dao.OrganizationDao; |
||||
|
import com.ccsens.carbasics.persist.dao.OrganizationDepartmentDao; |
||||
|
import com.ccsens.carbasics.persist.dao.OrganizationLevelDao; |
||||
|
import com.ccsens.carbasics.persist.mapper.OrganizationLevelMapper; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Repository; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Propagation; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
@Slf4j |
||||
|
@Service |
||||
|
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) |
||||
|
public class ManagementService implements IManagementService { |
||||
|
|
||||
|
@Resource |
||||
|
private OrganizationLevelDao organizationLevelDao; |
||||
|
@Resource |
||||
|
private OrganizationDao organizationDao; |
||||
|
@Resource |
||||
|
private OrganizationDepartmentDao departmentDao; |
||||
|
|
||||
|
@Override |
||||
|
public List<ManagementVo.LevelInfo> queryLevel(Long userId) { |
||||
|
return organizationLevelDao.queryLevelList(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<ManagementVo.HospitalInfo> queryHospitalList(ManagementDto.QueryHospitalList param, Long userId) { |
||||
|
return organizationDao.queryHospitalList(param); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<ManagementVo.HospitalData> queryHospitalInfo(ManagementDto.QueryHospitalInfo param, Long userId) { |
||||
|
|
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,16 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.ccsens.carbasics.persist.dao.OrganizationLevelDao"> |
||||
|
|
||||
|
<select id="queryLevelList" resultType="com.ccsens.carbasics.bean.vo.ManagementVo$LevelInfo"> |
||||
|
SELECT |
||||
|
id AS levelId, |
||||
|
`name` |
||||
|
FROM |
||||
|
t_organization_level |
||||
|
WHERE |
||||
|
rec_status = 0 |
||||
|
AND parent_id != 0 |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
Loading…
Reference in new issue