63 changed files with 1581 additions and 1909 deletions
@ -0,0 +1,53 @@
@@ -0,0 +1,53 @@
|
||||
package com.cloud.kicc.commonbiz.api.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.cloud.kicc.common.data.entity.CommonEntity; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
import java.math.BigDecimal; |
||||
|
||||
/** |
||||
*<p> |
||||
* 上级医检机构实体 |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @since: 2022/7/27 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@Accessors(chain = true) |
||||
@TableName(value="common_org") |
||||
public class Org extends CommonEntity { |
||||
|
||||
@TableId |
||||
private String id; |
||||
|
||||
private String name; |
||||
|
||||
private String type; |
||||
|
||||
private String contactName; |
||||
|
||||
private String contactPhone; |
||||
|
||||
private String contactTitle; |
||||
|
||||
private String addressIds; |
||||
|
||||
private String addressNames; |
||||
|
||||
private String detailAddress; |
||||
|
||||
private String status; |
||||
|
||||
private Integer mapOrientation; |
||||
|
||||
private BigDecimal mapLng; |
||||
|
||||
private BigDecimal mapLat; |
||||
|
||||
} |
@ -0,0 +1,27 @@
@@ -0,0 +1,27 @@
|
||||
package com.cloud.kicc.commonbiz.api.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
*<p> |
||||
* 上级医检机构与下级医院管理表 |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @since: 2022/7/27 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@Accessors(chain = true) |
||||
@TableName(value="common_org_hospital") |
||||
public class OrgHospital implements Serializable { |
||||
|
||||
private String orgId; |
||||
|
||||
private String hospitalId; |
||||
|
||||
} |
@ -0,0 +1,55 @@
@@ -0,0 +1,55 @@
|
||||
package com.cloud.kicc.commonbiz.api.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.cloud.kicc.common.data.entity.TreeEntity; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
/** |
||||
*<p> |
||||
* 项目表 |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @Date: 2022/2/24 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@Accessors(chain = true) |
||||
@TableName(value = "common_project") |
||||
public class Project extends TreeEntity<Project> { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 机构编码 |
||||
*/ |
||||
private String code; |
||||
|
||||
/** |
||||
* 联系人 |
||||
*/ |
||||
private String contact; |
||||
|
||||
/** |
||||
* 联系电话 |
||||
*/ |
||||
private String phone; |
||||
|
||||
/** |
||||
* 联系地址 |
||||
*/ |
||||
private String address; |
||||
|
||||
/** |
||||
* 联系邮箱 |
||||
*/ |
||||
private String email; |
||||
|
||||
/** |
||||
* 部门状态(0正常 1停用) |
||||
*/ |
||||
private String status; |
||||
|
||||
} |
@ -1,57 +0,0 @@
@@ -1,57 +0,0 @@
|
||||
package com.cloud.kicc.system.api.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.cloud.kicc.common.data.entity.CommonEntity; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Author: TangSheng |
||||
* @Description: 医院管理实体 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@Accessors(chain = true) |
||||
@TableName(value="sys_hospital") |
||||
public class Hospital extends CommonEntity implements Serializable { |
||||
|
||||
private static final long serialVersionUID = -7944080375255485489L; |
||||
|
||||
@TableId |
||||
private String id; |
||||
|
||||
private String name; |
||||
|
||||
private String type; |
||||
|
||||
private String contactsName; |
||||
|
||||
private String contactsTel; |
||||
|
||||
private String contactsTitle; |
||||
|
||||
private String payment; |
||||
|
||||
private String addressIds; |
||||
|
||||
private String detailAddress; |
||||
|
||||
private String status; |
||||
|
||||
@TableField(exist = false) |
||||
private String[] institutionIds; |
||||
|
||||
@TableField(exist = false) |
||||
private List<Institution> institutionList = new ArrayList<>(); |
||||
|
||||
@TableField(exist = false) |
||||
private String otherId; |
||||
|
||||
} |
@ -1,31 +0,0 @@
@@ -1,31 +0,0 @@
|
||||
package com.cloud.kicc.system.api.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.cloud.kicc.common.data.entity.BaseEntity; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
/** |
||||
* @Author: TangSheng |
||||
* @Description: 机构关联医院 |
||||
* @Since 1.0 |
||||
* @Date Created in 11:05 2022/4/25 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@Accessors(chain = true) |
||||
@TableName(value="sys_institution_relation") |
||||
public class InstitutionRelation extends BaseEntity { |
||||
|
||||
@TableId |
||||
private String id; |
||||
|
||||
private String institutionId; |
||||
|
||||
private String hospitalId; |
||||
|
||||
|
||||
|
||||
} |
@ -1,88 +0,0 @@
@@ -1,88 +0,0 @@
|
||||
package com.cloud.kicc.system.api.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.cloud.kicc.common.data.entity.CommonEntity; |
||||
import com.fasterxml.jackson.annotation.JsonInclude; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
*<p> |
||||
* 部门表 |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @Date: 2022/2/24 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@Accessors(chain = true) |
||||
@TableName(value = "sys_project", excludeProperty = { "tenantId" }) |
||||
public class Project extends CommonEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 部门id |
||||
*/ |
||||
@TableId |
||||
private String projectId; |
||||
|
||||
/** |
||||
* 机构编码 |
||||
*/ |
||||
private String code; |
||||
|
||||
/** |
||||
* 机构名称 |
||||
*/ |
||||
private String name; |
||||
|
||||
/** |
||||
* 父部门id |
||||
*/ |
||||
private String parentId; |
||||
|
||||
/** |
||||
* 显示顺序 |
||||
*/ |
||||
private Integer sort; |
||||
|
||||
/** |
||||
* 联系人 |
||||
*/ |
||||
private String contacts; |
||||
|
||||
/** |
||||
* 联系电话 |
||||
*/ |
||||
private String phone; |
||||
|
||||
/** |
||||
* 联系地址 |
||||
*/ |
||||
private String address; |
||||
|
||||
/** |
||||
* 联系邮箱 |
||||
*/ |
||||
private String email; |
||||
|
||||
/** |
||||
* 部门状态(0正常 1停用) |
||||
*/ |
||||
private String status; |
||||
|
||||
/** |
||||
* 子菜单 |
||||
*/ |
||||
@TableField(exist = false) |
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY) |
||||
private List<Project> children = new ArrayList(); |
||||
} |
@ -1,98 +1,71 @@
@@ -1,98 +1,71 @@
|
||||
package com.cloud.kicc.system.controller; |
||||
package com.cloud.kicc.commonbiz.controller; |
||||
|
||||
import cn.hutool.core.util.StrUtil; |
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.cloud.kicc.common.core.api.R; |
||||
import com.cloud.kicc.common.core.constant.AppConstants; |
||||
import com.cloud.kicc.system.api.entity.Doctor; |
||||
import com.cloud.kicc.system.api.entity.Project; |
||||
import com.cloud.kicc.system.service.DoctorService; |
||||
import com.cloud.kicc.commonbiz.service.DoctorService; |
||||
import com.cloud.kicc.commonbiz.api.entity.Doctor; |
||||
import io.swagger.annotations.Api; |
||||
import lombok.RequiredArgsConstructor; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.Arrays; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Author: TangSheng |
||||
* @Description: 医生api |
||||
* @Since 1.0 |
||||
* @Date Created in 14:15 2022/4/21 |
||||
*<p> |
||||
* 医生前端控制器 |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @since: 2022/7/23 |
||||
*/ |
||||
@RestController |
||||
@RequiredArgsConstructor |
||||
@RequestMapping(AppConstants.APP_SYSTEM + "/doctor") |
||||
@RequestMapping(AppConstants.APP_COMMON + "/doctor") |
||||
@Api(value = "app", tags = "医生管理模块") |
||||
public class DoctorController { |
||||
|
||||
private final DoctorService doctorService; |
||||
|
||||
/** |
||||
* 查询根据id |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@GetMapping("/{id}") |
||||
public R queryById(@PathVariable String id) { |
||||
return R.ok(doctorService.getById(id)); |
||||
private LambdaQueryWrapper<Doctor> getQueryWrapper(Doctor doctor) { |
||||
return Wrappers.<Doctor>lambdaQuery() |
||||
.like(StrUtil.isNotBlank(doctor.getName()), Doctor::getName, doctor.getName()) |
||||
.eq(StrUtil.isNotBlank(doctor.getOrgType()), Doctor::getOrgType, doctor.getOrgType()) |
||||
.between(StrUtil.isNotBlank(doctor.getBeginTime()) && StrUtil.isNotBlank(doctor.getEndTime()), Doctor::getCreateTime, doctor.getBeginTime(), doctor.getEndTime()) |
||||
.orderByAsc(Doctor::getId); |
||||
} |
||||
|
||||
/** |
||||
* 分页条件查询 |
||||
* @param |
||||
* @param doctor |
||||
* @return |
||||
*/ |
||||
@GetMapping("/list") |
||||
public R list(Doctor doctor) { |
||||
List<Doctor> result = doctorService.list(getQueryWrapper(doctor)); |
||||
return R.ok(result, result.size()); |
||||
public R list(Page page, Doctor doctor) { |
||||
IPage<Doctor> result = doctorService.page(page, getQueryWrapper(doctor)); |
||||
return R.ok(result.getRecords(), result.getTotal()); |
||||
} |
||||
|
||||
/** |
||||
* 新增 |
||||
* @param doctor |
||||
* @return |
||||
*/ |
||||
@PostMapping("/add") |
||||
@GetMapping("/{id}") |
||||
public R getById(@PathVariable String id) { |
||||
return R.ok(doctorService.getById(id)); |
||||
} |
||||
|
||||
@PostMapping("/save") |
||||
public R add(@RequestBody Doctor doctor) { |
||||
doctorService.save(doctor); |
||||
return R.ok(); |
||||
} |
||||
|
||||
/** |
||||
* 修改 |
||||
* @param doctor |
||||
* @return |
||||
*/ |
||||
@PutMapping("/update") |
||||
public R update(@RequestBody Doctor doctor) { |
||||
doctorService.updateById(doctor); |
||||
return R.ok(); |
||||
} |
||||
|
||||
/** |
||||
* 删除 |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@DeleteMapping("/remove/{id:[\\w,]+}") |
||||
public R remove(@PathVariable("id") String[] id){ |
||||
doctorService.removeByIds(Arrays.asList(id)); |
||||
@DeleteMapping("/remove/{ids:[\\w,]+}") |
||||
public R remove(@PathVariable String[] ids) { |
||||
doctorService.removeByIds(Arrays.asList(ids)); |
||||
return R.ok(); |
||||
} |
||||
|
||||
|
||||
private LambdaQueryWrapper<Doctor> getQueryWrapper(Doctor doctor) { |
||||
return Wrappers.<Doctor>lambdaQuery() |
||||
.like(StrUtil.isNotBlank(doctor.getName()), Doctor::getName, doctor.getName()) |
||||
.eq(StrUtil.isNotBlank(doctor.getOrganType()),Doctor::getOrganType,doctor.getOrganType()) |
||||
.between(StrUtil.isNotBlank(doctor.getBeginTime()) && StrUtil.isNotBlank(doctor.getEndTime()), Doctor::getCreateTime, doctor.getBeginTime(), doctor.getEndTime()) |
||||
.orderByAsc(Doctor::getId); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,83 @@
@@ -0,0 +1,83 @@
|
||||
package com.cloud.kicc.commonbiz.controller; |
||||
|
||||
import cn.hutool.core.util.ArrayUtil; |
||||
import cn.hutool.core.util.StrUtil; |
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.cloud.kicc.common.core.api.R; |
||||
import com.cloud.kicc.common.core.constant.AppConstants; |
||||
import com.cloud.kicc.commonbiz.api.entity.Hospital; |
||||
import com.cloud.kicc.commonbiz.api.entity.OrgHospital; |
||||
import com.cloud.kicc.commonbiz.service.HospitalService; |
||||
import com.cloud.kicc.commonbiz.service.OrgHospitalService; |
||||
import io.swagger.annotations.Api; |
||||
import lombok.RequiredArgsConstructor; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.Arrays; |
||||
import java.util.List; |
||||
import java.util.stream.Collectors; |
||||
|
||||
/** |
||||
*<p> |
||||
* 医院前端控制器 |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @since: 2022/7/23 |
||||
*/ |
||||
@RestController |
||||
@RequiredArgsConstructor |
||||
@RequestMapping(AppConstants.APP_COMMON + "/hospital") |
||||
@Api(value = "app", tags = "医院管理模块") |
||||
public class HospitalController { |
||||
|
||||
private final HospitalService hospitalService; |
||||
|
||||
private final OrgHospitalService orgHospitalService; |
||||
|
||||
private LambdaQueryWrapper<Hospital> getQueryWrapper(Hospital hospital) { |
||||
return new LambdaQueryWrapper<Hospital>() |
||||
.like(StrUtil.isNotBlank(hospital.getName()), Hospital::getName, hospital.getName()) |
||||
.eq(StrUtil.isNotBlank(hospital.getType()), Hospital::getType, hospital.getType()) |
||||
.between(StrUtil.isNotBlank(hospital.getBeginTime()) && StrUtil.isNotBlank(hospital.getEndTime()), Hospital::getCreateTime, hospital.getBeginTime(), hospital.getEndTime()) |
||||
.orderByAsc(Hospital::getCreateTime); |
||||
} |
||||
|
||||
@GetMapping("/list") |
||||
public R list(Page page, Hospital hospital) { |
||||
IPage<Hospital> result = hospitalService.page(page, getQueryWrapper(hospital)); |
||||
return R.ok(result.getRecords(), result.getTotal()); |
||||
} |
||||
|
||||
@GetMapping("/{id:\\w+}") |
||||
public R getById(@PathVariable("id") String id) { |
||||
Hospital hospital = hospitalService.getById(id); |
||||
if(hospital !=null){ |
||||
List<String> orgIds = orgHospitalService.list(new LambdaQueryWrapper<OrgHospital>().eq(OrgHospital::getHospitalId, hospital.getId())) |
||||
.stream().map(item -> item.getOrgId()).collect(Collectors.toList()); |
||||
hospital.setOrgIds(ArrayUtil.toArray(orgIds, String.class)); |
||||
} |
||||
return R.ok(hospital); |
||||
} |
||||
|
||||
@PostMapping("/save") |
||||
public R save(@RequestBody Hospital hospital) { |
||||
hospitalService.insertHospital(hospital); |
||||
return R.ok(); |
||||
} |
||||
|
||||
@PutMapping("/update") |
||||
public R update(@RequestBody Hospital hospital){ |
||||
hospitalService.updateHospital(hospital); |
||||
return R.ok(); |
||||
} |
||||
|
||||
@DeleteMapping("/remove/{ids:[\\w,]+}") |
||||
public R remove(@PathVariable String[] ids) { |
||||
hospitalService.removeByIds(Arrays.asList(ids)); |
||||
return R.ok(); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,73 @@
@@ -0,0 +1,73 @@
|
||||
package com.cloud.kicc.commonbiz.controller; |
||||
|
||||
import cn.hutool.core.util.StrUtil; |
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.cloud.kicc.common.core.api.R; |
||||
import com.cloud.kicc.common.core.constant.AppConstants; |
||||
import com.cloud.kicc.commonbiz.api.entity.Office; |
||||
import com.cloud.kicc.commonbiz.service.OfficeService; |
||||
import io.swagger.annotations.Api; |
||||
import lombok.RequiredArgsConstructor; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.Arrays; |
||||
import java.util.List; |
||||
|
||||
|
||||
/** |
||||
*<p> |
||||
* 科室前端控制器 |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @since: 2022/7/27 |
||||
*/ |
||||
@RestController |
||||
@RequiredArgsConstructor |
||||
@RequestMapping(AppConstants.APP_COMMON + "/office") |
||||
@Api(value = "app", tags = "科室管理模块") |
||||
public class OfficeController { |
||||
|
||||
private final OfficeService officeService; |
||||
|
||||
private LambdaQueryWrapper<Office> getQueryWrapper(Office office) { |
||||
return new LambdaQueryWrapper<Office>() |
||||
.like(StrUtil.isNotBlank(office.getName()), Office::getName, office.getName()) |
||||
.eq(StrUtil.isNotBlank(office.getOrgType()), Office::getOrgType, office.getOrgType()) |
||||
.between(StrUtil.isAllNotBlank(office.getBeginTime(),office.getEndTime()),Office::getCreateTime, office.getBeginTime(), office.getEndTime()) |
||||
.orderByAsc(Office::getId); |
||||
} |
||||
|
||||
@GetMapping("/list") |
||||
public R list(Page page, Office office) { |
||||
IPage<Office> result = officeService.page(page, getQueryWrapper(office)); |
||||
return R.ok(result.getRecords(), result.getTotal()); |
||||
} |
||||
|
||||
@GetMapping("/{id}") |
||||
public R getById(@PathVariable String id) { |
||||
return R.ok(officeService.getById(id)); |
||||
} |
||||
|
||||
@PostMapping("/save") |
||||
public R save(@RequestBody Office office) { |
||||
officeService.save(office); |
||||
return R.ok(); |
||||
} |
||||
|
||||
@PutMapping("/update") |
||||
public R update(@RequestBody Office office) { |
||||
officeService.updateById(office); |
||||
return R.ok(); |
||||
} |
||||
|
||||
@DeleteMapping("/remove/{ids:[\\w,]+}") |
||||
public R remove(@PathVariable String[] ids){ |
||||
officeService.removeByIds(Arrays.asList(ids)); |
||||
return R.ok(); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,71 @@
@@ -0,0 +1,71 @@
|
||||
package com.cloud.kicc.commonbiz.controller; |
||||
|
||||
import cn.hutool.core.util.StrUtil; |
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.cloud.kicc.common.core.api.R; |
||||
import com.cloud.kicc.common.core.constant.AppConstants; |
||||
import com.cloud.kicc.commonbiz.api.entity.Org; |
||||
import com.cloud.kicc.commonbiz.service.OrgService; |
||||
import io.swagger.annotations.Api; |
||||
import lombok.RequiredArgsConstructor; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.Arrays; |
||||
|
||||
/** |
||||
*<p> |
||||
* 上级医检前端控制器 |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @since: 2022/7/27 |
||||
*/ |
||||
@RestController |
||||
@RequiredArgsConstructor |
||||
@RequestMapping(AppConstants.APP_COMMON + "/org") |
||||
@Api(value = "app", tags = "机构管理模块") |
||||
public class OrgController { |
||||
|
||||
private final OrgService orgService; |
||||
|
||||
private LambdaQueryWrapper<Org> getQueryWrapper(Org org) { |
||||
return Wrappers.<Org>lambdaQuery() |
||||
.like(StrUtil.isNotBlank(org.getName()), Org::getName, org.getName()) |
||||
.eq(StrUtil.isNotBlank(org.getType()), Org::getType, org.getType()) |
||||
.between(StrUtil.isAllNotBlank(org.getBeginTime(), org.getEndTime()), Org::getCreateTime, org.getBeginTime(), org.getEndTime()) |
||||
.orderByAsc(Org::getId); |
||||
} |
||||
|
||||
@GetMapping("/list") |
||||
public R list(Page page, Org org) { |
||||
IPage<Org> result = orgService.page(page, getQueryWrapper(org)); |
||||
return R.ok(result.getRecords(), result.getTotal()); |
||||
} |
||||
|
||||
@GetMapping("{id}") |
||||
public R getById(@PathVariable String id) { |
||||
return R.ok(orgService.getById(id)); |
||||
} |
||||
|
||||
@PostMapping("/save") |
||||
public R save(@RequestBody Org org) { |
||||
orgService.save(org); |
||||
return R.ok(); |
||||
} |
||||
|
||||
@PutMapping("/update") |
||||
public R update(@RequestBody Org org) { |
||||
orgService.updateById(org); |
||||
return R.ok(); |
||||
} |
||||
|
||||
@DeleteMapping("/remove/{ids:[\\w,]+}") |
||||
public R remove(@PathVariable String[] ids) { |
||||
orgService.removeByIds(Arrays.asList(ids)); |
||||
return R.ok(); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
package com.cloud.kicc.commonbiz.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.cloud.kicc.commonbiz.api.entity.Doctor; |
||||
|
||||
/** |
||||
*<p> |
||||
* 医生 Mapper |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @since: 2022/7/23 |
||||
*/ |
||||
public interface DoctorMapper extends BaseMapper<Doctor> { |
||||
|
||||
} |
@ -0,0 +1,19 @@
@@ -0,0 +1,19 @@
|
||||
package com.cloud.kicc.commonbiz.mapper; |
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.cloud.kicc.commonbiz.api.entity.Hospital; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
/** |
||||
*<p> |
||||
* 医院管理 |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @since: 2022/7/27 |
||||
*/ |
||||
public interface HospitalMapper extends BaseMapper<Hospital> { |
||||
|
||||
} |
@ -0,0 +1,17 @@
@@ -0,0 +1,17 @@
|
||||
package com.cloud.kicc.commonbiz.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.cloud.kicc.commonbiz.api.entity.Office; |
||||
|
||||
|
||||
/** |
||||
*<p> |
||||
* 科室 Mapper |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @since: 2022/7/27 |
||||
*/ |
||||
public interface OfficeMapper extends BaseMapper<Office> { |
||||
|
||||
} |
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
package com.cloud.kicc.commonbiz.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.cloud.kicc.commonbiz.api.entity.OrgHospital; |
||||
|
||||
/** |
||||
*<p> |
||||
* 机构医院关联 Mapper |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @since: 2022/7/27 |
||||
*/ |
||||
public interface OrgHospitalMapper extends BaseMapper<OrgHospital> { |
||||
|
||||
} |
@ -0,0 +1,20 @@
@@ -0,0 +1,20 @@
|
||||
package com.cloud.kicc.commonbiz.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.cloud.kicc.commonbiz.api.entity.Org; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Select; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
*<p> |
||||
* 机构 Mapper |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @since: 2022/7/27 |
||||
*/ |
||||
public interface OrgMapper extends BaseMapper<Org> { |
||||
|
||||
} |
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
package com.cloud.kicc.commonbiz.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.cloud.kicc.commonbiz.api.entity.Project; |
||||
|
||||
/** |
||||
*<p> |
||||
* 项目管理 |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @since: 2022/7/27 |
||||
*/ |
||||
public interface ProjectMapper extends BaseMapper<Project> { |
||||
|
||||
} |
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
package com.cloud.kicc.commonbiz.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.cloud.kicc.commonbiz.api.entity.Doctor; |
||||
|
||||
/** |
||||
*<p> |
||||
* 服务接口 |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @since: 2022/7/23 |
||||
*/ |
||||
public interface DoctorService extends IService<Doctor> { |
||||
|
||||
} |
@ -0,0 +1,30 @@
@@ -0,0 +1,30 @@
|
||||
package com.cloud.kicc.commonbiz.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.cloud.kicc.commonbiz.api.entity.Hospital; |
||||
|
||||
/** |
||||
*<p> |
||||
* 医院管理 |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @since: 2022/7/27 |
||||
*/ |
||||
public interface HospitalService extends IService<Hospital> { |
||||
|
||||
/** |
||||
* 新增医院(包含上级机构关联数据) |
||||
* @param hospital 医院实体 |
||||
* @return boolean |
||||
*/ |
||||
boolean insertHospital(Hospital hospital); |
||||
|
||||
/** |
||||
* 修改医院(包含上级机构关联数据) |
||||
* @param hospital 医院实体 |
||||
* @return boolean |
||||
*/ |
||||
boolean updateHospital(Hospital hospital); |
||||
|
||||
} |
@ -0,0 +1,15 @@
@@ -0,0 +1,15 @@
|
||||
package com.cloud.kicc.commonbiz.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.cloud.kicc.commonbiz.api.entity.Office; |
||||
|
||||
/** |
||||
*<p> |
||||
* 科室服务 |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @since: 2022/7/27 |
||||
*/ |
||||
public interface OfficeService extends IService<Office> { |
||||
} |
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
package com.cloud.kicc.commonbiz.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.cloud.kicc.commonbiz.api.entity.OrgHospital; |
||||
|
||||
/** |
||||
*<p> |
||||
* 机构医院关联服务 |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @since: 2022/7/27 |
||||
*/ |
||||
public interface OrgHospitalService extends IService<OrgHospital> { |
||||
|
||||
} |
@ -0,0 +1,18 @@
@@ -0,0 +1,18 @@
|
||||
package com.cloud.kicc.commonbiz.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.cloud.kicc.commonbiz.api.entity.Org; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
*<p> |
||||
* 机构服务 |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @since: 2022/7/27 |
||||
*/ |
||||
public interface OrgService extends IService<Org> { |
||||
|
||||
} |
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
package com.cloud.kicc.commonbiz.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.cloud.kicc.commonbiz.api.entity.Project; |
||||
|
||||
/** |
||||
*<p> |
||||
* 项目服务 |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @since: 2022/7/27 |
||||
*/ |
||||
public interface ProjectService extends IService<Project> { |
||||
|
||||
} |
@ -0,0 +1,20 @@
@@ -0,0 +1,20 @@
|
||||
package com.cloud.kicc.commonbiz.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.cloud.kicc.commonbiz.mapper.DoctorMapper; |
||||
import com.cloud.kicc.commonbiz.service.DoctorService; |
||||
import com.cloud.kicc.commonbiz.api.entity.Doctor; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
*<p> |
||||
* 服务实现 |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @since: 2022/7/23 |
||||
*/ |
||||
@Service |
||||
public class DoctorServiceImpl extends ServiceImpl<DoctorMapper, Doctor> implements DoctorService { |
||||
|
||||
} |
@ -0,0 +1,61 @@
@@ -0,0 +1,61 @@
|
||||
package com.cloud.kicc.commonbiz.service.impl; |
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.cloud.kicc.commonbiz.api.entity.Hospital; |
||||
import com.cloud.kicc.commonbiz.api.entity.OrgHospital; |
||||
import com.cloud.kicc.commonbiz.mapper.HospitalMapper; |
||||
import com.cloud.kicc.commonbiz.service.HospitalService; |
||||
import com.cloud.kicc.commonbiz.service.OrgHospitalService; |
||||
import lombok.RequiredArgsConstructor; |
||||
import org.springframework.stereotype.Service; |
||||
import org.springframework.transaction.annotation.Transactional; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
*<p> |
||||
* 医院服务实现 |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @since: 2022/7/27 |
||||
*/ |
||||
@Service |
||||
@RequiredArgsConstructor |
||||
@Transactional(rollbackFor = Exception.class) |
||||
public class HospitalServiceImpl extends ServiceImpl<HospitalMapper, Hospital> implements HospitalService { |
||||
|
||||
private final OrgHospitalService orgHospitalService; |
||||
|
||||
@Override |
||||
public boolean insertHospital(Hospital hospital) { |
||||
baseMapper.insert(hospital); |
||||
return insertOrgHospital(hospital); |
||||
} |
||||
|
||||
@Override |
||||
public boolean updateHospital(Hospital hospital) { |
||||
baseMapper.updateById(hospital); |
||||
orgHospitalService.remove(new LambdaQueryWrapper<OrgHospital>().eq(OrgHospital::getHospitalId, hospital.getId())); |
||||
return insertOrgHospital(hospital); |
||||
} |
||||
|
||||
public boolean insertOrgHospital(Hospital hospital) { |
||||
boolean rows = true; |
||||
List<OrgHospital> list = new ArrayList(); |
||||
for (String orgId : hospital.getOrgIds()) { |
||||
OrgHospital oh = new OrgHospital(); |
||||
oh.setOrgId(orgId); |
||||
oh.setHospitalId(hospital.getId()); |
||||
list.add(oh); |
||||
} |
||||
if (list.size() > 0) { |
||||
rows = orgHospitalService.saveBatch(list); |
||||
} |
||||
return rows; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,19 @@
@@ -0,0 +1,19 @@
|
||||
package com.cloud.kicc.commonbiz.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.cloud.kicc.commonbiz.api.entity.Office; |
||||
import com.cloud.kicc.commonbiz.mapper.OfficeMapper; |
||||
import com.cloud.kicc.commonbiz.service.OfficeService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
*<p> |
||||
* 科室服务实现 |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @since: 2022/7/27 |
||||
*/ |
||||
@Service |
||||
public class OfficeServiceImpl extends ServiceImpl<OfficeMapper, Office> implements OfficeService { |
||||
} |
@ -0,0 +1,20 @@
@@ -0,0 +1,20 @@
|
||||
package com.cloud.kicc.commonbiz.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.cloud.kicc.commonbiz.api.entity.OrgHospital; |
||||
import com.cloud.kicc.commonbiz.mapper.OrgHospitalMapper; |
||||
import com.cloud.kicc.commonbiz.service.OrgHospitalService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
*<p> |
||||
* 机构与医院关联服务实现 |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @since: 2022/7/27 |
||||
*/ |
||||
@Service |
||||
public class OrgHospitalServiceImpl extends ServiceImpl<OrgHospitalMapper, OrgHospital> implements OrgHospitalService { |
||||
|
||||
} |
@ -0,0 +1,20 @@
@@ -0,0 +1,20 @@
|
||||
package com.cloud.kicc.commonbiz.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.cloud.kicc.commonbiz.api.entity.Org; |
||||
import com.cloud.kicc.commonbiz.mapper.OrgMapper; |
||||
import com.cloud.kicc.commonbiz.service.OrgService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
*<p> |
||||
* 机构服务实现 |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @since: 2022/7/27 |
||||
*/ |
||||
@Service |
||||
public class OrgServiceImpl extends ServiceImpl<OrgMapper, Org> implements OrgService { |
||||
|
||||
} |
@ -0,0 +1,20 @@
@@ -0,0 +1,20 @@
|
||||
package com.cloud.kicc.commonbiz.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.cloud.kicc.commonbiz.api.entity.Project; |
||||
import com.cloud.kicc.commonbiz.mapper.ProjectMapper; |
||||
import com.cloud.kicc.commonbiz.service.ProjectService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
*<p> |
||||
* 项目服务实现 |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @since: 2022/7/27 |
||||
*/ |
||||
@Service |
||||
public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> implements ProjectService { |
||||
|
||||
} |
@ -1,4 +1,5 @@
@@ -1,4 +1,5 @@
|
||||
<?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.cloud.kicc.system.mapper.InstitutionRelationMapper"> |
||||
<mapper namespace="com.cloud.kicc.commonbiz.mapper.DoctorMapper"> |
||||
|
||||
</mapper> |
@ -1,4 +1,5 @@
@@ -1,4 +1,5 @@
|
||||
<?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.cloud.kicc.system.mapper.InstitutionMapper"> |
||||
<mapper namespace="com.cloud.kicc.commonbiz.mapper.HospitalMapper"> |
||||
|
||||
</mapper> |
@ -1,4 +1,5 @@
@@ -1,4 +1,5 @@
|
||||
<?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.cloud.kicc.system.mapper.OfficeMapper"> |
||||
<mapper namespace="com.cloud.kicc.commonbiz.mapper.OfficeMapper"> |
||||
|
||||
</mapper> |
@ -0,0 +1,5 @@
@@ -0,0 +1,5 @@
|
||||
<?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.cloud.kicc.commonbiz.mapper.OrgHospitalMapper"> |
||||
|
||||
</mapper> |
@ -1,4 +1,4 @@
@@ -1,4 +1,4 @@
|
||||
<?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.cloud.kicc.system.mapper.DoctorMapper"> |
||||
<mapper namespace="com.cloud.kicc.commonbiz.mapper.OrgMapper"> |
||||
</mapper> |
@ -0,0 +1,5 @@
@@ -0,0 +1,5 @@
|
||||
<?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.cloud.kicc.commonbiz.mapper.ProjectMapper"> |
||||
|
||||
</mapper> |
@ -1,162 +0,0 @@
@@ -1,162 +0,0 @@
|
||||
package com.cloud.kicc.system.controller; |
||||
|
||||
import cn.hutool.core.util.ArrayUtil; |
||||
import cn.hutool.core.util.StrUtil; |
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.cloud.kicc.common.core.api.R; |
||||
import com.cloud.kicc.common.core.constant.AppConstants; |
||||
import com.cloud.kicc.system.api.entity.Hospital; |
||||
import com.cloud.kicc.system.api.entity.Institution; |
||||
import com.cloud.kicc.system.api.entity.InstitutionRelation; |
||||
import com.cloud.kicc.system.service.HospitalService; |
||||
import com.cloud.kicc.system.service.InstitutionRelationService; |
||||
import com.cloud.kicc.system.service.InstitutionService; |
||||
import io.swagger.annotations.Api; |
||||
import lombok.RequiredArgsConstructor; |
||||
import org.springframework.transaction.annotation.Transactional; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.Arrays; |
||||
import java.util.List; |
||||
import java.util.stream.Collectors; |
||||
|
||||
/** |
||||
* @Author: TangSheng |
||||
* @Description: |
||||
* @Since 1.0 |
||||
* @Date Created in 15:32 2022/3/24 |
||||
*/ |
||||
@RestController |
||||
@RequiredArgsConstructor |
||||
@RequestMapping(AppConstants.APP_SYSTEM + "/hospital") |
||||
@Api(value = "app", tags = "医院管理模块") |
||||
public class HospitalController { |
||||
|
||||
private final HospitalService hospitalService; |
||||
|
||||
private final InstitutionService institutionService; |
||||
|
||||
private final InstitutionRelationService institutionRelationService; |
||||
|
||||
/** |
||||
* 新增 |
||||
* @param hospital 节点dto |
||||
* @return |
||||
*/ |
||||
@Transactional(rollbackFor = Exception.class) |
||||
@PostMapping("/add") |
||||
public R add(@RequestBody Hospital hospital){ |
||||
//新增医院
|
||||
hospitalService.save(hospital); |
||||
//医院机构关联
|
||||
List<InstitutionRelation> institutionRelations = new ArrayList<>(); |
||||
|
||||
|
||||
for (String institutionId : hospital.getInstitutionIds()) { |
||||
InstitutionRelation institutionRelation = new InstitutionRelation(); |
||||
institutionRelation.setInstitutionId(institutionId); |
||||
institutionRelation.setHospitalId(hospital.getId()); |
||||
institutionRelations.add(institutionRelation); |
||||
} |
||||
institutionRelationService.saveBatch(institutionRelations); |
||||
|
||||
return R.ok(hospital); |
||||
} |
||||
// @GetMapping("/{id}")
|
||||
// public R queryById(@PathVariable String id){
|
||||
// hospitalService.getById(id);
|
||||
// return R.ok(hospitalService.getById(id));
|
||||
// }
|
||||
@GetMapping("/{id:\\w+}") |
||||
public R queryById(@PathVariable("id") String id){ |
||||
Hospital hospital = hospitalService.getById(id); |
||||
List<String> institutionIds; |
||||
if(hospital!=null){ |
||||
institutionIds = institutionRelationService.list(new LambdaQueryWrapper<InstitutionRelation>().eq(InstitutionRelation::getHospitalId,hospital.getId())) |
||||
.stream().map(institutionRelation -> institutionRelation.getInstitutionId()).collect(Collectors.toList()); |
||||
hospital.setInstitutionIds(ArrayUtil.toArray(institutionIds,String.class)); |
||||
} |
||||
return R.ok(hospital); |
||||
} |
||||
/** |
||||
* 修改 |
||||
* @param hospital 修改对象 |
||||
* @return |
||||
*/ |
||||
// @PutMapping("/update")
|
||||
// public R update(@RequestBody Hospital hospital){
|
||||
// hospitalService.updateById(hospital);
|
||||
// return R.ok(hospital);
|
||||
// }
|
||||
@PutMapping("/update") |
||||
public R update(@RequestBody Hospital hospital){ |
||||
hospitalService.updateHospital(hospital); |
||||
return R.ok(); |
||||
} |
||||
|
||||
/** |
||||
* 删除 |
||||
* @param id 节点id |
||||
* @return |
||||
*/ |
||||
@DeleteMapping("/remove/{id:[\\w,]+}") |
||||
public R remove(@PathVariable("id") String[] id){ |
||||
hospitalService.removeByIds(Arrays.asList(id)); |
||||
return R.ok(); |
||||
} |
||||
|
||||
/** |
||||
* 查询根据id |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@GetMapping("/query/{id}") |
||||
public R getById(@PathVariable("id") String id) { |
||||
return R.ok(hospitalService.getById(id)); |
||||
} |
||||
|
||||
/** |
||||
* 查询根据条件 |
||||
* @param |
||||
* @param hospital |
||||
* @return |
||||
*/ |
||||
// @GetMapping("/list")
|
||||
// public R list(Page page, Hospital hospital) {
|
||||
// IPage<Hospital> iPage = hospitalService.page(page, getQueryWrapper(hospital));
|
||||
// return R.ok(iPage.getRecords(), iPage.getTotal());
|
||||
// }
|
||||
@GetMapping("/list") |
||||
public R list(Hospital hospital){ |
||||
List<Hospital> hospitalList = hospitalService.list(getQueryWrapper(hospital)); |
||||
return R.ok(hospitalList,hospitalList.size()); |
||||
} |
||||
/** |
||||
* 查询医院关联的机构 |
||||
* @param id 医院id |
||||
* @return |
||||
*/ |
||||
@GetMapping("/relation/institution/{id}") |
||||
public R relationInstitution(@PathVariable("id") String id){ |
||||
List<Institution> institutions = institutionService.queryRelationInstitution(id); |
||||
return R.ok(institutions); |
||||
} |
||||
|
||||
|
||||
private LambdaQueryWrapper<Hospital> getQueryWrapper(Hospital hospital) { |
||||
return new LambdaQueryWrapper<Hospital>() |
||||
.like(StrUtil.isNotBlank(hospital.getName()),Hospital::getName,hospital.getName()) |
||||
.eq(StrUtil.isNotBlank(hospital.getType()),Hospital::getType,hospital.getType()) |
||||
.between(StrUtil.isNotBlank(hospital.getBeginTime()) && StrUtil.isNotBlank(hospital.getEndTime()),Hospital::getCreateTime,hospital.getBeginTime(),hospital.getEndTime()) |
||||
.orderByAsc(Hospital::getCreateTime); |
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
} |
@ -1,98 +0,0 @@
@@ -1,98 +0,0 @@
|
||||
package com.cloud.kicc.system.controller; |
||||
|
||||
import cn.hutool.core.util.StrUtil; |
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.cloud.kicc.common.core.api.R; |
||||
import com.cloud.kicc.common.core.constant.AppConstants; |
||||
import com.cloud.kicc.system.api.entity.Institution; |
||||
import com.cloud.kicc.system.service.InstitutionService; |
||||
import io.swagger.annotations.Api; |
||||
import lombok.RequiredArgsConstructor; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.Arrays; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Author: TangSheng |
||||
* @Description: 医检api |
||||
* @Since 1.0 |
||||
* @Date Created in 14:15 2022/4/21 |
||||
*/ |
||||
@RestController |
||||
@RequiredArgsConstructor |
||||
@RequestMapping(AppConstants.APP_SYSTEM + "/institution") |
||||
@Api(value = "app", tags = "机构管理模块") |
||||
public class InstitutionController { |
||||
|
||||
private final InstitutionService institutionService; |
||||
|
||||
/** |
||||
* 查询根据id |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@GetMapping("{id}") |
||||
public R queryById(@PathVariable String id) { |
||||
return R.ok(institutionService.getById(id)); |
||||
} |
||||
|
||||
/** |
||||
* 分页条件查询 |
||||
* @param |
||||
* @param institution |
||||
* @return |
||||
*/ |
||||
@GetMapping("/list") |
||||
public R list( Institution institution) { |
||||
List<Institution> result = institutionService.list( getQueryWrapper(institution)); |
||||
return R.ok(result, result.size()); |
||||
} |
||||
|
||||
/** |
||||
* 新增 |
||||
* @param institution |
||||
* @return |
||||
*/ |
||||
@PostMapping("/add") |
||||
public R add(@RequestBody Institution institution) { |
||||
institutionService.save(institution); |
||||
return R.ok(); |
||||
} |
||||
|
||||
/** |
||||
* 修改 |
||||
* @param institution |
||||
* @return |
||||
*/ |
||||
@PutMapping("/update") |
||||
public R update(@RequestBody Institution institution) { |
||||
institutionService.updateById(institution); |
||||
return R.ok(); |
||||
} |
||||
|
||||
/** |
||||
* 删除 |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@DeleteMapping("/remove/{id:[\\w,]+}") |
||||
public R remove(@PathVariable("id") String[] id){ |
||||
institutionService.removeByIds(Arrays.asList(id)); |
||||
return R.ok(); |
||||
} |
||||
|
||||
|
||||
private QueryWrapper<Institution> getQueryWrapper(Institution institution) { |
||||
return new QueryWrapper<Institution>() |
||||
.like(StrUtil.isNotBlank(institution.getName()), "name", institution.getName()) |
||||
.eq(StrUtil.isNotBlank(institution.getType()),"type",institution.getType()) |
||||
.between(StrUtil.isAllNotBlank(institution.getBeginTime(),institution.getEndTime()),"create_time", |
||||
institution.getBeginTime(), |
||||
institution.getEndTime()) |
||||
.orderByAsc("id"); |
||||
} |
||||
|
||||
|
||||
} |
@ -1,101 +0,0 @@
@@ -1,101 +0,0 @@
|
||||
package com.cloud.kicc.system.controller; |
||||
|
||||
import cn.hutool.core.util.StrUtil; |
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.cloud.kicc.common.core.api.R; |
||||
import com.cloud.kicc.common.core.constant.AppConstants; |
||||
import com.cloud.kicc.system.api.entity.Office; |
||||
import com.cloud.kicc.system.service.OfficeService; |
||||
import io.swagger.annotations.Api; |
||||
import lombok.RequiredArgsConstructor; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.Arrays; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Author: TangSheng |
||||
* @Description: 科室api |
||||
* @Since 1.0 |
||||
* @Date Created in 14:15 2022/4/21 |
||||
*/ |
||||
@RestController |
||||
@RequiredArgsConstructor |
||||
@RequestMapping(AppConstants.APP_SYSTEM + "/office") |
||||
@Api(value = "app", tags = "科室管理模块") |
||||
public class OfficeController { |
||||
|
||||
private final OfficeService officeService; |
||||
|
||||
/** |
||||
* 查询根据id |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
// @GetMapping("/query/{id}")
|
||||
// public R queryById(@PathVariable String id) {
|
||||
// return R.ok(officeService.getById(id));
|
||||
// }
|
||||
|
||||
/** |
||||
* 分页条件查询 |
||||
* @param |
||||
* @param office |
||||
* @return |
||||
*/ |
||||
@GetMapping("/list") |
||||
public R list( Office office) { |
||||
List<Office> result = officeService.list( getQueryWrapper(office)); |
||||
return R.ok(result, result.size()); |
||||
} |
||||
|
||||
/** |
||||
* 新增 |
||||
* @param office |
||||
* @return |
||||
*/ |
||||
@PostMapping("/add") |
||||
public R add(@RequestBody Office office) { |
||||
officeService.save(office); |
||||
return R.ok(); |
||||
} |
||||
|
||||
/** |
||||
* 修改 |
||||
* @param office |
||||
* @return |
||||
*/ |
||||
@PutMapping("/update") |
||||
public R update(@RequestBody Office office) { |
||||
officeService.updateById(office); |
||||
return R.ok(); |
||||
} |
||||
@GetMapping("/{id}") |
||||
public R queryById(@PathVariable String id){ |
||||
return R.ok(officeService.getById(id)); |
||||
} |
||||
/** |
||||
* 删除 |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@DeleteMapping("/remove/{id:[\\w,]+}") |
||||
public R remove(@PathVariable("id") String[] id){ |
||||
officeService.removeByIds(Arrays.asList(id)); |
||||
return R.ok(); |
||||
} |
||||
|
||||
|
||||
private QueryWrapper<Office> getQueryWrapper(Office office) { |
||||
return new QueryWrapper<Office>() |
||||
.like(StrUtil.isNotBlank(office.getName()), "name", office.getName()) |
||||
.eq(StrUtil.isNotBlank(office.getOrganType()),"organ_type",office.getOrganType()) |
||||
.between(StrUtil.isAllNotBlank(office.getBeginTime(),office.getEndTime()),"create_time", |
||||
office.getBeginTime(), |
||||
office.getEndTime()) |
||||
.orderByAsc("id"); |
||||
} |
||||
|
||||
|
||||
} |
@ -1,13 +0,0 @@
@@ -1,13 +0,0 @@
|
||||
package com.cloud.kicc.system.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.cloud.kicc.system.api.entity.Doctor; |
||||
|
||||
/** |
||||
* @Author: TangSheng |
||||
* @Description: |
||||
* @Since 1.0 |
||||
* @Date Created in 14:07 2022/4/21 |
||||
*/ |
||||
public interface DoctorMapper extends BaseMapper<Doctor> { |
||||
} |
@ -1,25 +0,0 @@
@@ -1,25 +0,0 @@
|
||||
package com.cloud.kicc.system.mapper; |
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.cloud.kicc.system.api.entity.Hospital; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
/** |
||||
* @Author: TangSheng |
||||
* @Description: 医院管理 |
||||
* @Since 1.0 |
||||
* @Date Created in 15:28 2022/3/24 |
||||
*/ |
||||
public interface HospitalMapper extends BaseMapper<Hospital> { |
||||
|
||||
/** |
||||
* 条件查询list |
||||
* @param page |
||||
* @param hospital |
||||
* @return |
||||
*/ |
||||
IPage<Hospital> queryList(IPage<Hospital> page, @Param("param") Hospital hospital); |
||||
|
||||
} |
@ -1,28 +0,0 @@
@@ -1,28 +0,0 @@
|
||||
package com.cloud.kicc.system.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.cloud.kicc.system.api.entity.Institution; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Select; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Author: TangSheng |
||||
* @Description: |
||||
* @Since 1.0 |
||||
* @Date Created in 14:04 2022/4/21 |
||||
*/ |
||||
public interface InstitutionMapper extends BaseMapper<Institution> { |
||||
|
||||
|
||||
/** |
||||
* 查询关联的组织 |
||||
* @param hospitalId |
||||
* @return |
||||
*/ |
||||
@Select("select * from sys_institution i " + |
||||
"where id in (SELECT institution_id FROM `sys_institution_relation` where hospital_id = #{hospitalId})") |
||||
List<Institution> queryRelationInstitution(@Param("hospitalId") String hospitalId); |
||||
|
||||
} |
@ -1,16 +0,0 @@
@@ -1,16 +0,0 @@
|
||||
package com.cloud.kicc.system.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.cloud.kicc.system.api.entity.InstitutionRelation; |
||||
|
||||
/** |
||||
* @Author: TangSheng |
||||
* @Description: |
||||
* @Since 1.0 |
||||
* @Date Created in 11:08 2022/4/25 |
||||
*/ |
||||
public interface InstitutionRelationMapper extends BaseMapper<InstitutionRelation> { |
||||
|
||||
|
||||
|
||||
} |
@ -1,13 +0,0 @@
@@ -1,13 +0,0 @@
|
||||
package com.cloud.kicc.system.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.cloud.kicc.system.api.entity.Office; |
||||
|
||||
/** |
||||
* @Author: TangSheng |
||||
* @Description: |
||||
* @Since 1.0 |
||||
* @Date Created in 14:05 2022/4/21 |
||||
*/ |
||||
public interface OfficeMapper extends BaseMapper<Office> { |
||||
} |
@ -1,13 +0,0 @@
@@ -1,13 +0,0 @@
|
||||
package com.cloud.kicc.system.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.cloud.kicc.system.api.entity.Project; |
||||
|
||||
/** |
||||
* @Author: TangSheng |
||||
* @Description: |
||||
* @Since 1.0 |
||||
* @Date Created in 14:00 2022/6/7 |
||||
*/ |
||||
public interface ProjectMapper extends BaseMapper<Project> { |
||||
} |
@ -1,13 +0,0 @@
@@ -1,13 +0,0 @@
|
||||
package com.cloud.kicc.system.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.cloud.kicc.system.api.entity.Doctor; |
||||
|
||||
/** |
||||
* @Author: TangSheng |
||||
* @Description: |
||||
* @Since 1.0 |
||||
* @Date Created in 14:09 2022/4/21 |
||||
*/ |
||||
public interface DoctorService extends IService<Doctor> { |
||||
} |
@ -1,18 +0,0 @@
@@ -1,18 +0,0 @@
|
||||
package com.cloud.kicc.system.service; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.cloud.kicc.system.api.entity.Hospital; |
||||
|
||||
/** |
||||
* @Author: TangSheng |
||||
* @Description: 医院管理 |
||||
* @Since 1.0 |
||||
* @Date Created in 15:29 2022/3/24 |
||||
*/ |
||||
public interface HospitalService extends IService<Hospital> { |
||||
|
||||
|
||||
IPage<Hospital> queryList(IPage<Hospital> page, Hospital hospital); |
||||
boolean updateHospital(Hospital hospital); |
||||
} |
@ -1,14 +0,0 @@
@@ -1,14 +0,0 @@
|
||||
package com.cloud.kicc.system.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.cloud.kicc.system.api.entity.InstitutionRelation; |
||||
|
||||
/** |
||||
* @Author: TangSheng |
||||
* @Description: |
||||
* @Since 1.0 |
||||
* @Date Created in 11:09 2022/4/25 |
||||
*/ |
||||
public interface InstitutionRelationService extends IService<InstitutionRelation> { |
||||
|
||||
} |
@ -1,21 +0,0 @@
@@ -1,21 +0,0 @@
|
||||
package com.cloud.kicc.system.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.cloud.kicc.system.api.entity.Institution; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Author: lizhi |
||||
* @Description: |
||||
* @Since 1.0 |
||||
* @Date Created in 10:54 2022/6/9 |
||||
*/ |
||||
public interface InstitutionService extends IService<Institution> { |
||||
/** |
||||
* 查询关联组织 |
||||
* @param hospitalId |
||||
* @return |
||||
*/ |
||||
List<Institution> queryRelationInstitution(String hospitalId); |
||||
} |
@ -1,13 +0,0 @@
@@ -1,13 +0,0 @@
|
||||
package com.cloud.kicc.system.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.cloud.kicc.system.api.entity.Office; |
||||
|
||||
/** |
||||
* @Author: TangSheng |
||||
* @Description: |
||||
* @Since 1.0 |
||||
* @Date Created in 14:08 2022/4/21 |
||||
*/ |
||||
public interface OfficeService extends IService<Office> { |
||||
} |
@ -1,17 +0,0 @@
@@ -1,17 +0,0 @@
|
||||
package com.cloud.kicc.system.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.cloud.kicc.system.api.entity.Dept; |
||||
import com.cloud.kicc.system.api.entity.Project; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Author: TangSheng |
||||
* @Description: |
||||
* @Since 1.0 |
||||
* @Date Created in 13:48 2022/6/7 |
||||
*/ |
||||
public interface ProjectService extends IService<Project> { |
||||
List<Project> buildTree(List<Project> list, String parentId); |
||||
} |
@ -1,17 +0,0 @@
@@ -1,17 +0,0 @@
|
||||
package com.cloud.kicc.system.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.cloud.kicc.system.api.entity.Doctor; |
||||
import com.cloud.kicc.system.mapper.DoctorMapper; |
||||
import com.cloud.kicc.system.service.DoctorService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
* @Author: TangSheng |
||||
* @Description: |
||||
* @Since 1.0 |
||||
* @Date Created in 14:13 2022/4/21 |
||||
*/ |
||||
@Service |
||||
public class DoctorServiceImpl extends ServiceImpl<DoctorMapper, Doctor> implements DoctorService { |
||||
} |
@ -1,58 +0,0 @@
@@ -1,58 +0,0 @@
|
||||
package com.cloud.kicc.system.service.impl; |
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.cloud.kicc.common.core.api.R; |
||||
import com.cloud.kicc.system.api.entity.Hospital; |
||||
import com.cloud.kicc.system.api.entity.InstitutionRelation; |
||||
import com.cloud.kicc.system.mapper.HospitalMapper; |
||||
import com.cloud.kicc.system.service.HospitalService; |
||||
import com.cloud.kicc.system.service.InstitutionRelationService; |
||||
import lombok.AllArgsConstructor; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Author: TangSheng |
||||
* @Description: 医院管理 |
||||
* @Since 1.0 |
||||
* @Date Created in 15:30 2022/3/24 |
||||
*/ |
||||
@Service |
||||
@AllArgsConstructor |
||||
public class HospitalServiceImpl extends ServiceImpl<HospitalMapper, Hospital> implements HospitalService { |
||||
private final InstitutionRelationService institutionRelationService; |
||||
@Override |
||||
public IPage<Hospital> queryList(IPage<Hospital> page, Hospital hospital) { |
||||
return this.baseMapper.queryList(page, hospital); |
||||
} |
||||
|
||||
@Override |
||||
public boolean updateHospital(Hospital hospital) { |
||||
//修改医院信息
|
||||
baseMapper.updateById(hospital); |
||||
//删除医院与机构关联
|
||||
institutionRelationService.remove(new LambdaQueryWrapper<InstitutionRelation>().eq(InstitutionRelation::getHospitalId,hospital.getId())); |
||||
insertInstitutionRelation(hospital); |
||||
return true; |
||||
} |
||||
public boolean insertInstitutionRelation(Hospital hospital){ |
||||
boolean rows = true; |
||||
//新增医院与机构关联
|
||||
List<InstitutionRelation> list = new ArrayList(); |
||||
for(String institutionId : hospital.getInstitutionIds()){ |
||||
InstitutionRelation relation = new InstitutionRelation(); |
||||
relation.setHospitalId(hospital.getId()); |
||||
relation.setInstitutionId(institutionId); |
||||
list.add(relation); |
||||
} |
||||
if (list.size()>0){ |
||||
rows = institutionRelationService.saveBatch(list); |
||||
} |
||||
return rows; |
||||
} |
||||
} |
@ -1,20 +0,0 @@
@@ -1,20 +0,0 @@
|
||||
package com.cloud.kicc.system.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.cloud.kicc.system.api.entity.InstitutionRelation; |
||||
import com.cloud.kicc.system.mapper.InstitutionRelationMapper; |
||||
import com.cloud.kicc.system.service.InstitutionRelationService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
* @Author: TangSheng |
||||
* @Description: |
||||
* @Since 1.0 |
||||
* @Date Created in 11:10 2022/4/25 |
||||
*/ |
||||
@Service |
||||
public class InstitutionRelationServiceImpl |
||||
extends ServiceImpl<InstitutionRelationMapper, InstitutionRelation> |
||||
implements InstitutionRelationService { |
||||
|
||||
} |
@ -1,23 +0,0 @@
@@ -1,23 +0,0 @@
|
||||
package com.cloud.kicc.system.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.cloud.kicc.system.api.entity.Institution; |
||||
import com.cloud.kicc.system.mapper.InstitutionMapper; |
||||
import com.cloud.kicc.system.service.InstitutionService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Author: lizhi |
||||
* @Description: |
||||
* @Since 1.0 |
||||
* @Date Created in 14:11 2022/4/21 |
||||
*/ |
||||
@Service |
||||
public class InstitutionServiceImpl extends ServiceImpl<InstitutionMapper, Institution> implements InstitutionService { |
||||
@Override |
||||
public List<Institution> queryRelationInstitution(String hospitalId) { |
||||
return this.baseMapper.queryRelationInstitution(hospitalId); |
||||
} |
||||
} |
@ -1,17 +0,0 @@
@@ -1,17 +0,0 @@
|
||||
package com.cloud.kicc.system.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.cloud.kicc.system.api.entity.Office; |
||||
import com.cloud.kicc.system.mapper.OfficeMapper; |
||||
import com.cloud.kicc.system.service.OfficeService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
* @Author: TangSheng |
||||
* @Description: |
||||
* @Since 1.0 |
||||
* @Date Created in 14:13 2022/4/21 |
||||
*/ |
||||
@Service |
||||
public class OfficeServiceImpl extends ServiceImpl<OfficeMapper, Office> implements OfficeService { |
||||
} |
@ -1,69 +0,0 @@
@@ -1,69 +0,0 @@
|
||||
package com.cloud.kicc.system.service.impl; |
||||
|
||||
import cn.hutool.core.util.StrUtil; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.cloud.kicc.system.api.entity.Dept; |
||||
import com.cloud.kicc.system.api.entity.Project; |
||||
import com.cloud.kicc.system.mapper.ProjectMapper; |
||||
import com.cloud.kicc.system.service.ProjectService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.Iterator; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 项目表,服务实现类 |
||||
* @Author: lizhi |
||||
* @Description: |
||||
* @Since 1.0 |
||||
* @Date Created in 13:51 2022/6/7 |
||||
*/ |
||||
@Service |
||||
public class ProjectServiceImpl extends ServiceImpl<ProjectMapper,Project> implements ProjectService{ |
||||
|
||||
@Override |
||||
public List<Project> buildTree(List<Project> list, String parentId) { |
||||
List<Project> projectList = new ArrayList<>(); |
||||
for (Iterator<Project> iterator=list.iterator();iterator.hasNext();){ |
||||
Project p = iterator.next(); |
||||
if (StrUtil.equals(p.getParentId(),parentId)){ |
||||
|
||||
} |
||||
} |
||||
return projectList; |
||||
} |
||||
/** 递归列表 */ |
||||
private void recursion(List<Project> list, Project project) { |
||||
// 得到子节点列表
|
||||
List<Project> childList = getChildList(list, project); |
||||
project.setChildren(childList); |
||||
for (Project tChild : childList) { |
||||
if (hasChild(list, tChild)) { |
||||
// 判断是否有子节点
|
||||
Iterator<Project> it = childList.iterator(); |
||||
while (it.hasNext()) { |
||||
Project n = (Project) it.next(); |
||||
recursion(list, n); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
/** 得到子节点列表 */ |
||||
private List<Project> getChildList(List<Project> list, Project project) { |
||||
List<Project> projectList = new ArrayList() ; |
||||
Iterator<Project> it = list.iterator(); |
||||
while (it.hasNext()) { |
||||
Project n = it.next(); |
||||
if (StrUtil.equals(n.getParentId(), project.getProjectId())) { |
||||
projectList.add(n); |
||||
} |
||||
} |
||||
return projectList; |
||||
} |
||||
|
||||
/** 判断是否有子节点 */ |
||||
private boolean hasChild(List<Project> list, Project t) { |
||||
return getChildList(list, t).size() > 0 ? true : false; |
||||
} |
||||
} |
@ -1,66 +0,0 @@
@@ -1,66 +0,0 @@
|
||||
<?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.cloud.kicc.system.mapper.HospitalMapper"> |
||||
|
||||
<resultMap id="hospitalResult" type="com.cloud.kicc.system.api.entity.Hospital"> |
||||
<id column="id" property="id" /> |
||||
<result column="name" property="name" /> |
||||
<result column="type" property="type" /> |
||||
<result column="contacts_name" property="contactsName" /> |
||||
<result column="contacts_tel" property="contactsTel" /> |
||||
<result column="contacts_title" property="contactsTitle" /> |
||||
<result column="payment" property="payment" /> |
||||
<result column="address_ids" property="addressIds" /> |
||||
<result column="detail_address" property="detailAddress" /> |
||||
<result column="status" property="status" /> |
||||
<result column="tenant_id" property="tenantId" /> |
||||
<result column="create_by_id" property="createById"/> |
||||
<result column="create_by_name" property="createByName"/> |
||||
<result column="create_time" property="createTime"/> |
||||
<result column="update_by_id" property="updateById"/> |
||||
<result column="update_by_name" property="updateByName"/> |
||||
<result column="update_time" property="updateTime"/> |
||||
<result column="remarks" property="remarks"/> |
||||
<collection property="institutionIds" ofType="String"> |
||||
<result column="institution_id"/> |
||||
</collection> |
||||
<collection property="institutionList" ofType="com.cloud.kicc.system.api.entity.Institution"> |
||||
<id property="id" column="institution_id"/> |
||||
<result property="name" column="institution_name"/> |
||||
</collection> |
||||
</resultMap> |
||||
|
||||
|
||||
|
||||
<select id="queryList" resultMap="hospitalResult"> |
||||
SELECT h.id,h.`name`,h.`type`,h.contacts_name, |
||||
h.contacts_tel,h.contacts_title,h.payment, |
||||
h.address_ids,h.detail_address,h.status, |
||||
h.create_by_id,h.create_by_name,h.create_time, |
||||
h.update_by_id,h.update_by_name,h.update_time, |
||||
h.remarks,h.tenant_id, |
||||
i.id as institution_id, |
||||
i.name as institution_name |
||||
FROM sys_hospital h |
||||
left join sys_institution_relation ir on ir.hospital_id = h.id |
||||
left join sys_institution i on ir.institution_id = i.id |
||||
<where> |
||||
<if test="param.id != null"> |
||||
AND h.id = #{param.id} |
||||
</if> |
||||
<if test="param.name != null"> |
||||
AND h.name = #{param.name} |
||||
</if> |
||||
<if test="param.type != null and param.type != 0"> |
||||
AND h.type = #{param.type} |
||||
</if> |
||||
<if test="param.contactsName != null"> |
||||
AND h.contactsName = #{param.contactsName} |
||||
</if> |
||||
</where> |
||||
ORDER BY h.create_time ASC |
||||
</select> |
||||
|
||||
|
||||
|
||||
</mapper> |
@ -1,24 +0,0 @@
@@ -1,24 +0,0 @@
|
||||
<?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.cloud.kicc.system.mapper.ProjectMapper"> |
||||
|
||||
<resultMap type="Project" id="ProjectResult"> |
||||
<id property="projectId" column="project_id"/> |
||||
<result property="code" column="code"/> |
||||
<result property="name" column="name"/> |
||||
<result property="parentId" column="parent_id"/> |
||||
<result property="sort" column="sort"/> |
||||
<result property="contacts" column="contacts"/> |
||||
<result property="phone" column="phone"/> |
||||
<result property="email" column="email"/> |
||||
<result property="status" column="status"/> |
||||
<result property="createById" column="create_by_id"/> |
||||
<result property="createByName" column="create_by_name"/> |
||||
<result property="createTime" column="create_time"/> |
||||
<result property="updateById" column="update_by_id"/> |
||||
<result property="updateByName" column="update_by_name"/> |
||||
<result property="updateTime" column="update_time"/> |
||||
<result property="delFlag" column="del_flag"/> |
||||
</resultMap> |
||||
|
||||
</mapper> |
Loading…
Reference in new issue