43 changed files with 1672 additions and 1 deletions
@ -0,0 +1,29 @@
@@ -0,0 +1,29 @@
|
||||
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.TreeEntity; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
/** |
||||
* @Author: TangSheng |
||||
* @Description: 地址管理实体 |
||||
* @Since 1.0 |
||||
* @Date Created in 9:57 2022/3/21 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@Accessors(chain = true) |
||||
@TableName(value="sys_address") |
||||
public class Address extends TreeEntity<Address> { |
||||
|
||||
@TableId(value = "code") |
||||
private String code; |
||||
|
||||
private Integer level; |
||||
|
||||
private boolean lastLevel; |
||||
|
||||
} |
@ -0,0 +1,58 @@
@@ -0,0 +1,58 @@
|
||||
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; |
||||
|
||||
/** |
||||
* @Author: TangSheng |
||||
* @Description: 医生 |
||||
* @Since 1.0 |
||||
* @Date Created in 11:54 2022/4/21 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@Accessors(chain = true) |
||||
@TableName(value="sys_doctor") |
||||
public class Doctor extends CommonEntity implements Serializable { |
||||
|
||||
private static final long serialVersionUID = 6897720098338460586L; |
||||
|
||||
/**医生ID*/ |
||||
@TableId |
||||
private String id; |
||||
/**医生姓名*/ |
||||
private String name; |
||||
/**医生职称*/ |
||||
private String title; |
||||
/**医生性别*/ |
||||
private String sex; |
||||
/**医生电话*/ |
||||
private String phone; |
||||
/**医生邮箱*/ |
||||
private String email; |
||||
/**地址(门牌号)*/ |
||||
private String detailAddress; |
||||
/**组织类型*/ |
||||
private Integer organType; |
||||
/**组织id*/ |
||||
private String organId; |
||||
/**组织名称*/ |
||||
private String organName; |
||||
/**科室ID*/ |
||||
private String officeId; |
||||
/**科室名称*/ |
||||
private String officeName; |
||||
/**医生状态*/ |
||||
private String status; |
||||
|
||||
@TableField(exist = false) |
||||
private String otherId; |
||||
|
||||
} |
@ -0,0 +1,57 @@
@@ -0,0 +1,57 @@
|
||||
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 Integer 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 List<String> institutionIds; |
||||
|
||||
@TableField(exist = false) |
||||
private List<Institution> institutionList = new ArrayList<>(); |
||||
|
||||
@TableField(exist = false) |
||||
private String otherId; |
||||
|
||||
} |
@ -0,0 +1,51 @@
@@ -0,0 +1,51 @@
|
||||
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; |
||||
|
||||
/** |
||||
* @Author: lizhi |
||||
* @Description: |
||||
* @Since 1.0 |
||||
* @Date Created in 10:50 2022/6/9 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@Accessors(chain = true) |
||||
@TableName(value="sys_institution") |
||||
public class Institution extends CommonEntity implements Serializable{ |
||||
private static final long serialVersionUID = 6481437030667115170L; |
||||
|
||||
@TableId |
||||
private String id; |
||||
|
||||
private String name; |
||||
|
||||
private Integer type; |
||||
|
||||
private String contactsName; |
||||
|
||||
private String contactsTel; |
||||
|
||||
private String contactsTitle; |
||||
|
||||
/**地址id数组字符串*/ |
||||
private String addressIds; |
||||
|
||||
/**地址name数组字符串*/ |
||||
private String addressNames; |
||||
|
||||
private String detailAddress; |
||||
|
||||
private String status; |
||||
|
||||
@TableField(exist = false) |
||||
private String otherId; |
||||
} |
@ -0,0 +1,31 @@
@@ -0,0 +1,31 @@
|
||||
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; |
||||
|
||||
|
||||
|
||||
} |
@ -0,0 +1,49 @@
@@ -0,0 +1,49 @@
|
||||
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; |
||||
|
||||
/** |
||||
* @Author: TangSheng |
||||
* @Description: 科室 |
||||
* @Since 1.0 |
||||
* @Date Created in 13:54 2022/4/21 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@Accessors(chain = true) |
||||
@TableName(value="sys_office") |
||||
public class Office extends CommonEntity implements Serializable { |
||||
|
||||
private static final long serialVersionUID = -7415141113272373249L; |
||||
|
||||
@TableId |
||||
private String id; |
||||
|
||||
private String name; |
||||
|
||||
private Integer organType; |
||||
|
||||
private String organId; |
||||
|
||||
private String organName; |
||||
|
||||
private String directorName; |
||||
|
||||
private String directorTel; |
||||
|
||||
private String detailAddress; |
||||
|
||||
private String status; |
||||
|
||||
@TableField(exist = false) |
||||
private String otherId; |
||||
|
||||
} |
@ -0,0 +1,88 @@
@@ -0,0 +1,88 @@
|
||||
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(); |
||||
} |
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
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; |
||||
/** |
||||
*<p> |
||||
* 地图任务 |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @Date: 2022/6/6 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@Accessors(chain = true) |
||||
@TableName(value = "common_map_task", excludeProperty = { "remarks", "delFlag" }) |
||||
public class MapTask extends CommonEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
@TableId |
||||
private String id; |
||||
|
||||
private String name; |
||||
|
||||
private String smallHospitalId; |
||||
|
||||
private String largeHospitalId; |
||||
|
||||
private String takeSpecimenId; |
||||
|
||||
} |
@ -0,0 +1,101 @@
@@ -0,0 +1,101 @@
|
||||
package com.cloud.kicc.system.controller; |
||||
|
||||
import cn.hutool.core.util.ObjectUtil; |
||||
import cn.hutool.core.util.StrUtil; |
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.cloud.kicc.common.core.api.R; |
||||
import com.cloud.kicc.common.core.constant.AppConstants; |
||||
import com.cloud.kicc.system.api.entity.Address; |
||||
import com.cloud.kicc.system.service.AddressService; |
||||
import io.swagger.annotations.Api; |
||||
import lombok.RequiredArgsConstructor; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.Arrays; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Author: TangSheng |
||||
* @Description: 地址管理 |
||||
* @Since 1.0 |
||||
* @Date Created in 10:22 2022/3/21 |
||||
*/ |
||||
@RestController |
||||
@RequiredArgsConstructor |
||||
@RequestMapping(AppConstants.APP_SYSTEM + "/address") |
||||
@Api(value = "app", tags = "地址管理模块") |
||||
public class AddressController { |
||||
|
||||
private final AddressService addressService; |
||||
|
||||
/** |
||||
* 新增节点 |
||||
* @param address 节点dto |
||||
* @return |
||||
*/ |
||||
@PostMapping("/add") |
||||
public R add(@RequestBody Address address){ |
||||
addressService.save(address); |
||||
return R.ok(address); |
||||
} |
||||
|
||||
/** |
||||
* 修改节点 |
||||
* @param address 修改对象 |
||||
* @return |
||||
*/ |
||||
@PutMapping("/update") |
||||
public R update(@RequestBody Address address){ |
||||
addressService.updateById(address); |
||||
return R.ok(address); |
||||
} |
||||
|
||||
/** |
||||
* 删除地址节点 |
||||
* @param ids 节点id |
||||
* @return |
||||
*/ |
||||
@DeleteMapping("/remove/{ids}") |
||||
public R remove(@PathVariable("ids") String[] ids){ |
||||
addressService.removeBatchByIds(Arrays.asList(ids)); |
||||
return R.ok(); |
||||
} |
||||
|
||||
/** |
||||
* 查询根据id |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@GetMapping("/query/{id}") |
||||
public R getById(@PathVariable("id") String id) { |
||||
return R.ok(addressService.getById(id)); |
||||
} |
||||
|
||||
/** |
||||
* 查询根据条件 |
||||
* @param address |
||||
* @return |
||||
*/ |
||||
@GetMapping("/list") |
||||
public R list(Address address) { |
||||
List<Address> addressList = addressService.queryList(address); |
||||
return R.ok(addressList, addressList.size()); |
||||
} |
||||
|
||||
/** |
||||
* 根据parentIds列表查询list |
||||
* @param parentIds |
||||
* @return |
||||
*/ |
||||
@GetMapping("/queryByParentIds/{ids}") |
||||
public R queryByParentIds(@PathVariable("ids") String[] parentIds) { |
||||
if (ObjectUtil.isEmpty(parentIds)) { |
||||
return R.ok(new ArrayList<>(), 0); |
||||
} |
||||
List<Address> addressList = addressService.queryListByParentIds(Arrays.asList(parentIds)); |
||||
return R.ok(addressList, addressList.size()); |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,95 @@
@@ -0,0 +1,95 @@
|
||||
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.Doctor; |
||||
import com.cloud.kicc.system.service.DoctorService; |
||||
import io.swagger.annotations.Api; |
||||
import lombok.RequiredArgsConstructor; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.Arrays; |
||||
|
||||
/** |
||||
* @Author: TangSheng |
||||
* @Description: 医生api |
||||
* @Since 1.0 |
||||
* @Date Created in 14:15 2022/4/21 |
||||
*/ |
||||
@RestController |
||||
@RequiredArgsConstructor |
||||
@RequestMapping(AppConstants.APP_SYSTEM + "/doctor") |
||||
@Api(value = "app", tags = "医生管理模块") |
||||
public class DoctorController { |
||||
|
||||
private final DoctorService doctorService; |
||||
|
||||
/** |
||||
* 查询根据id |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@GetMapping("/query/{id}") |
||||
public R queryById(@PathVariable String id) { |
||||
return R.ok(doctorService.getById(id)); |
||||
} |
||||
|
||||
/** |
||||
* 分页条件查询 |
||||
* @param page |
||||
* @param doctor |
||||
* @return |
||||
*/ |
||||
@GetMapping("/list") |
||||
public R list(Page page, Doctor doctor) { |
||||
Page result = doctorService.page(page, getQueryWrapper(doctor)); |
||||
return R.ok(result.getRecords(), result.getTotal()); |
||||
} |
||||
|
||||
/** |
||||
* 新增 |
||||
* @param doctor |
||||
* @return |
||||
*/ |
||||
@PostMapping("/add") |
||||
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)); |
||||
return R.ok(); |
||||
} |
||||
|
||||
|
||||
private QueryWrapper<Doctor> getQueryWrapper(Doctor doctor) { |
||||
return new QueryWrapper<Doctor>() |
||||
.like(StrUtil.isNotBlank(doctor.getName()), "name", doctor.getName()) |
||||
.between(StrUtil.isAllNotBlank(doctor.getBeginTime(),doctor.getEndTime()),"create_time", |
||||
doctor.getBeginTime(), |
||||
doctor.getEndTime()) |
||||
.orderByAsc("id"); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,139 @@
@@ -0,0 +1,139 @@
|
||||
package com.cloud.kicc.system.controller; |
||||
|
||||
import cn.hutool.core.util.StrUtil; |
||||
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.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; |
||||
|
||||
/** |
||||
* @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<>(hospital.getInstitutionIds().size()); |
||||
|
||||
|
||||
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); |
||||
} |
||||
|
||||
/** |
||||
* 修改 |
||||
* @param hospital 修改对象 |
||||
* @return |
||||
*/ |
||||
@PutMapping("/update") |
||||
public R update(@RequestBody Hospital hospital){ |
||||
hospitalService.updateById(hospital); |
||||
return R.ok(hospital); |
||||
} |
||||
|
||||
/** |
||||
* 删除 |
||||
* @param ids 节点id |
||||
* @return |
||||
*/ |
||||
@DeleteMapping("/remove/{ids}") |
||||
public R remove(@PathVariable("ids") String[] ids){ |
||||
hospitalService.removeBatchByIds(Arrays.asList(ids)); |
||||
return R.ok(); |
||||
} |
||||
|
||||
/** |
||||
* 查询根据id |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@GetMapping("/query/{id}") |
||||
public R getById(@PathVariable("id") String id) { |
||||
return R.ok(hospitalService.getById(id)); |
||||
} |
||||
|
||||
/** |
||||
* 查询根据条件 |
||||
* @param page |
||||
* @param hospital |
||||
* @return |
||||
*/ |
||||
@GetMapping("/list") |
||||
public R list(Page page, Hospital hospital) { |
||||
IPage<Hospital> iPage = hospitalService.queryList(page, hospital); |
||||
return R.ok(iPage.getRecords(), iPage.getTotal()); |
||||
} |
||||
|
||||
/** |
||||
* 查询医院关联的机构 |
||||
* @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 QueryWrapper<Hospital> getQueryWrapper(Hospital hospital) { |
||||
return new QueryWrapper<Hospital>() |
||||
.like(StrUtil.isNotBlank(hospital.getName()), "name", hospital.getName()) |
||||
.like(StrUtil.isNotBlank(hospital.getContactsName()), "contacts_name", hospital.getContactsName()) |
||||
.like(StrUtil.isNotBlank(hospital.getContactsTel()), "contacts_tel", hospital.getContactsTel()) |
||||
.like(StrUtil.isNotBlank(hospital.getContactsTitle()), "contacts_title", hospital.getContactsTitle()) |
||||
.like(StrUtil.isNotBlank(hospital.getDetailAddress()), "detail_address", hospital.getDetailAddress()) |
||||
.between(!StrUtil.hasBlank(hospital.getBeginTime(),hospital.getEndTime()),"create_time", |
||||
hospital.getBeginTime(), |
||||
hospital.getEndTime()) |
||||
.orderByAsc("create_time"); |
||||
} |
||||
|
||||
|
||||
|
||||
} |
@ -0,0 +1,96 @@
@@ -0,0 +1,96 @@
|
||||
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; |
||||
|
||||
/** |
||||
* @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("/query/{id}") |
||||
public R queryById(@PathVariable String id) { |
||||
return R.ok(institutionService.getById(id)); |
||||
} |
||||
|
||||
/** |
||||
* 分页条件查询 |
||||
* @param page |
||||
* @param institution |
||||
* @return |
||||
*/ |
||||
@GetMapping("/list") |
||||
public R list(Page page, Institution institution) { |
||||
Page result = institutionService.page(page, getQueryWrapper(institution)); |
||||
return R.ok(result.getRecords(), result.getTotal()); |
||||
} |
||||
|
||||
/** |
||||
* 新增 |
||||
* @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()) |
||||
.between(StrUtil.isAllNotBlank(institution.getBeginTime(),institution.getEndTime()),"create_time", |
||||
institution.getBeginTime(), |
||||
institution.getEndTime()) |
||||
.orderByAsc("id"); |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,96 @@
@@ -0,0 +1,96 @@
|
||||
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; |
||||
|
||||
/** |
||||
* @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 page |
||||
* @param office |
||||
* @return |
||||
*/ |
||||
@GetMapping("/list") |
||||
public R list(Page page, Office office) { |
||||
Page result = officeService.page(page, getQueryWrapper(office)); |
||||
return R.ok(result.getRecords(), result.getTotal()); |
||||
} |
||||
|
||||
/** |
||||
* 新增 |
||||
* @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(); |
||||
} |
||||
|
||||
/** |
||||
* 删除 |
||||
* @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()) |
||||
.between(StrUtil.isAllNotBlank(office.getBeginTime(),office.getEndTime()),"create_time", |
||||
office.getBeginTime(), |
||||
office.getEndTime()) |
||||
.orderByAsc("id"); |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,105 @@
@@ -0,0 +1,105 @@
|
||||
package com.cloud.kicc.system.controller; |
||||
|
||||
import cn.hutool.core.util.StrUtil; |
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
||||
import com.cloud.kicc.common.core.api.R; |
||||
import com.cloud.kicc.common.core.constant.AppConstants; |
||||
import com.cloud.kicc.common.log.annotation.SysLog; |
||||
import com.cloud.kicc.system.api.entity.Dept; |
||||
import com.cloud.kicc.system.api.entity.Project; |
||||
import com.cloud.kicc.system.api.entity.User; |
||||
import com.cloud.kicc.system.service.ProjectService; |
||||
import com.cloud.kicc.system.service.UserService; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import lombok.AllArgsConstructor; |
||||
import org.springframework.security.access.prepost.PreAuthorize; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Author: lizhi |
||||
* @Description: |
||||
* @Since 1.0 |
||||
* @Date Created in 14:34 2022/6/7 |
||||
* 项目信息 |
||||
*/ |
||||
|
||||
@RestController |
||||
@AllArgsConstructor |
||||
@RequestMapping(AppConstants.APP_SYSTEM + "/project") |
||||
public class ProjectController { |
||||
private final ProjectService projectService; |
||||
private final UserService userService; |
||||
private LambdaQueryWrapper<Project> getQueryWrapper(Project project) { |
||||
return Wrappers.<Project>lambdaQuery() |
||||
.like(StrUtil.isNotBlank(project.getName()), Project::getName, project.getName()) |
||||
.eq(StrUtil.isNotBlank(project.getStatus()), Project::getStatus, project.getStatus()) |
||||
.between(StrUtil.isNotBlank(project.getBeginTime()) && StrUtil.isNotBlank(project.getEndTime()), Project::getCreateTime, project.getBeginTime(), project.getEndTime()) |
||||
.orderByAsc(Project::getSort); |
||||
} |
||||
@GetMapping("/list") |
||||
//@PreAuthorize("@pms.hasPermission('project_view')")
|
||||
public R list(Project project) { |
||||
List<Project> projectList = projectService.list(getQueryWrapper(project)); |
||||
return R.ok(projectList, projectList.size()); |
||||
} |
||||
|
||||
@GetMapping("/{id:\\w+}") |
||||
public R getById(@PathVariable("id") String id) { |
||||
return R.ok(projectService.getById(id)); |
||||
} |
||||
|
||||
@SysLog("项目新增") |
||||
@PostMapping("/save") |
||||
//@PreAuthorize("@pms.hasPermission('project_add')")
|
||||
public R save(@RequestBody Project project) { |
||||
projectService.save(project); |
||||
return R.ok(); |
||||
} |
||||
|
||||
@SysLog("项目修改") |
||||
@PutMapping("/update") |
||||
//@PreAuthorize("@pms.hasPermission('project_edit')")
|
||||
public R update(@RequestBody Project project) { |
||||
projectService.updateById(project); |
||||
// 更新项目
|
||||
new Thread(() -> { |
||||
List<User> userList = userService.list(new LambdaQueryWrapper<User>().eq(User::getDeptId, project.getProjectId())); |
||||
for (User user : userList) { |
||||
user.setDeptName(project.getName()); |
||||
userService.updateById(user); |
||||
} |
||||
}).start(); |
||||
return R.ok(); |
||||
} |
||||
|
||||
@SysLog("项目删除") |
||||
@DeleteMapping("/remove/{id:\\w+}") |
||||
//@PreAuthorize("@pms.hasPermission('project_del')")
|
||||
public R remove(@PathVariable("id") String id) { |
||||
if (projectService.getOne(Wrappers.<Project>lambdaQuery().eq(Project::getParentId, id)) != null) { |
||||
return R.error("存在下级项目,不允许删除"); |
||||
} |
||||
projectService.removeById(id); |
||||
return R.ok(); |
||||
} |
||||
|
||||
@SysLog("项目状态更改") |
||||
@GetMapping("/changeStatus") |
||||
//@PreAuthorize("@pms.hasPermission('project_edit')")
|
||||
public R changeStatus(Project project) { |
||||
projectService.updateById(project); |
||||
return R.ok(); |
||||
} |
||||
|
||||
/** 加载项目列表树 */ |
||||
@GetMapping("/projectTree") |
||||
public R deptTree() { |
||||
List<Project> projectList = projectService.list(new LambdaQueryWrapper<Project>().orderByAsc(Project::getSort)); |
||||
return R.ok(projectService.buildTree(projectList, "0")); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,31 @@
@@ -0,0 +1,31 @@
|
||||
package com.cloud.kicc.system.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.cloud.kicc.system.api.entity.Address; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Author: TangSheng |
||||
* @Description: |
||||
* @Since 1.0 |
||||
* @Date Created in 11:07 2022/3/21 |
||||
*/ |
||||
public interface AddressMapper extends BaseMapper<Address> { |
||||
|
||||
/** |
||||
* 分页条件查询 |
||||
* @param param |
||||
* @return |
||||
*/ |
||||
List<Address> queryList(@Param("param") Address param); |
||||
|
||||
/** |
||||
* 查询根据parentId列表 |
||||
* @param list |
||||
* @return |
||||
*/ |
||||
List<Address> queryListByParentIds(@Param("list") List<String> list); |
||||
|
||||
} |
@ -0,0 +1,13 @@
@@ -0,0 +1,13 @@
|
||||
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> { |
||||
} |
@ -0,0 +1,25 @@
@@ -0,0 +1,25 @@
|
||||
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); |
||||
|
||||
} |
@ -0,0 +1,28 @@
@@ -0,0 +1,28 @@
|
||||
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); |
||||
|
||||
} |
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
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> { |
||||
|
||||
|
||||
|
||||
} |
@ -0,0 +1,13 @@
@@ -0,0 +1,13 @@
|
||||
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> { |
||||
} |
@ -0,0 +1,13 @@
@@ -0,0 +1,13 @@
|
||||
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> { |
||||
} |
@ -0,0 +1,31 @@
@@ -0,0 +1,31 @@
|
||||
package com.cloud.kicc.system.service; |
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.cloud.kicc.system.api.entity.Address; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Author: TangSheng |
||||
* @Description: |
||||
* @Since 1.0 |
||||
* @Date Created in 10:23 2022/3/21 |
||||
*/ |
||||
public interface AddressService extends IService<Address> { |
||||
|
||||
/** |
||||
* 查询list |
||||
* @param address |
||||
* @return |
||||
*/ |
||||
List<Address> queryList(Address address); |
||||
|
||||
/** |
||||
* 查询根据parentId列表 |
||||
* @param list |
||||
* @return |
||||
*/ |
||||
List<Address> queryListByParentIds(List<String> list); |
||||
|
||||
} |
@ -0,0 +1,13 @@
@@ -0,0 +1,13 @@
|
||||
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> { |
||||
} |
@ -0,0 +1,18 @@
@@ -0,0 +1,18 @@
|
||||
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); |
||||
|
||||
} |
@ -0,0 +1,14 @@
@@ -0,0 +1,14 @@
|
||||
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> { |
||||
|
||||
} |
@ -0,0 +1,21 @@
@@ -0,0 +1,21 @@
|
||||
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); |
||||
} |
@ -0,0 +1,13 @@
@@ -0,0 +1,13 @@
|
||||
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> { |
||||
} |
@ -0,0 +1,17 @@
@@ -0,0 +1,17 @@
|
||||
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); |
||||
} |
@ -0,0 +1,37 @@
@@ -0,0 +1,37 @@
|
||||
package com.cloud.kicc.system.service.impl; |
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.cloud.kicc.system.api.entity.Address; |
||||
import com.cloud.kicc.system.mapper.AddressMapper; |
||||
import com.cloud.kicc.system.service.AddressService; |
||||
import lombok.RequiredArgsConstructor; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.List; |
||||
|
||||
|
||||
/** |
||||
* @Author: TangSheng |
||||
* @Description: 地址管理业务实现 |
||||
* @Since 1.0 |
||||
* @Date Created in 10:24 2022/3/21 |
||||
*/ |
||||
@Service |
||||
@RequiredArgsConstructor |
||||
@Slf4j |
||||
public class AddressServiceImpl extends ServiceImpl<AddressMapper, Address> implements AddressService { |
||||
|
||||
|
||||
@Override |
||||
public List<Address> queryList(Address address) { |
||||
return this.baseMapper.queryList(address); |
||||
} |
||||
|
||||
@Override |
||||
public List<Address> queryListByParentIds(List<String> list) { |
||||
return this.baseMapper.queryListByParentIds(list); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,17 @@
@@ -0,0 +1,17 @@
|
||||
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 { |
||||
} |
@ -0,0 +1,24 @@
@@ -0,0 +1,24 @@
|
||||
package com.cloud.kicc.system.service.impl; |
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.cloud.kicc.system.api.entity.Hospital; |
||||
import com.cloud.kicc.system.mapper.HospitalMapper; |
||||
import com.cloud.kicc.system.service.HospitalService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
* @Author: TangSheng |
||||
* @Description: 医院管理 |
||||
* @Since 1.0 |
||||
* @Date Created in 15:30 2022/3/24 |
||||
*/ |
||||
@Service |
||||
public class HospitalServiceImpl extends ServiceImpl<HospitalMapper, Hospital> implements HospitalService { |
||||
|
||||
@Override |
||||
public IPage<Hospital> queryList(IPage<Hospital> page, Hospital hospital) { |
||||
return this.baseMapper.queryList(page, hospital); |
||||
} |
||||
} |
@ -0,0 +1,20 @@
@@ -0,0 +1,20 @@
|
||||
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 { |
||||
|
||||
} |
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
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); |
||||
} |
||||
} |
@ -0,0 +1,17 @@
@@ -0,0 +1,17 @@
|
||||
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 { |
||||
} |
@ -0,0 +1,69 @@
@@ -0,0 +1,69 @@
|
||||
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; |
||||
} |
||||
} |
@ -0,0 +1,61 @@
@@ -0,0 +1,61 @@
|
||||
<?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.AddressMapper"> |
||||
|
||||
<resultMap id="AddressResult" type="com.cloud.kicc.system.api.entity.Address"> |
||||
<id column="code" property="code" /> |
||||
<result column="parent_id" property="parentId" /> |
||||
<result column="level" property="level" /> |
||||
<result column="lastLevel" property="lastLevel" /> |
||||
<result column="name" property="name" /> |
||||
<result column="sort" property="sort" /> |
||||
<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"/> |
||||
</resultMap> |
||||
|
||||
|
||||
<select id="queryList" resultType="com.cloud.kicc.system.api.entity.Address"> |
||||
SELECT code, level, (select count(code)=0 from sys_address a2 where a2.parent_id = a.code) lastLevel, parent_id, |
||||
name, sort, create_by_id, |
||||
create_by_name, create_time, |
||||
update_by_id, update_by_name, update_time, |
||||
remarks, tenant_id |
||||
FROM sys_address a |
||||
<where> |
||||
<if test="param.code != null"> |
||||
AND a.code = #{param.code} |
||||
</if> |
||||
<if test="param.level != null and param.level != 0"> |
||||
AND a.level = #{param.level} |
||||
</if> |
||||
<if test="param.name != null"> |
||||
AND a.name = #{param.name} |
||||
</if> |
||||
<if test="param.parentId != null"> |
||||
AND a.parent_id = #{param.parentId} |
||||
</if> |
||||
</where> |
||||
ORDER BY sort ASC |
||||
</select> |
||||
|
||||
<select id="queryListByParentIds" resultType="com.cloud.kicc.system.api.entity.Address"> |
||||
SELECT code, level, (select count(code)=0 from sys_address a2 where a2.parent_id = a.code) lastLevel, parent_id, |
||||
name, sort, create_by_id, |
||||
create_by_name, create_time, |
||||
update_by_id, update_by_name, update_time, |
||||
remarks, tenant_id |
||||
FROM sys_address a |
||||
<where> |
||||
<foreach item="item" index="index" collection="list" |
||||
open="parent_id in (" separator="," close=")" nullable="true"> |
||||
#{item} |
||||
</foreach> |
||||
</where> |
||||
</select> |
||||
</mapper> |
@ -0,0 +1,4 @@
@@ -0,0 +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> |
@ -0,0 +1,66 @@
@@ -0,0 +1,66 @@
|
||||
<?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> |
@ -0,0 +1,4 @@
@@ -0,0 +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.InstitutionMapper"> |
||||
</mapper> |
@ -0,0 +1,4 @@
@@ -0,0 +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.InstitutionRelationMapper"> |
||||
</mapper> |
@ -0,0 +1,4 @@
@@ -0,0 +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.OfficeMapper"> |
||||
</mapper> |
@ -0,0 +1,24 @@
@@ -0,0 +1,24 @@
|
||||
<?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