后端功能
Some checks are pending
Java CI with Maven / build (11) (push) Waiting to run
Java CI with Maven / build (17) (push) Waiting to run
Java CI with Maven / build (8) (push) Waiting to run
yudao-ui-admin CI / build (14.x) (push) Waiting to run
yudao-ui-admin CI / build (16.x) (push) Waiting to run

This commit is contained in:
旺仔 2024-08-06 11:02:19 +08:00
parent a067b9ad65
commit 851aa0051c
25 changed files with 1381 additions and 13 deletions

View File

@ -0,0 +1,86 @@
package cn.iocoder.yudao.module.applyregistration.controller.admin.device;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.*;
import javax.annotation.Resource;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import cn.iocoder.yudao.module.applyregistration.controller.admin.device.vo.*;
import cn.iocoder.yudao.module.applyregistration.dal.device.*;
import cn.iocoder.yudao.module.applyregistration.service.applyform.device.*;
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
@Tag(name = "管理后台 - tb_device")
@RestController
@RequestMapping("/test/device")
@Validated
public class DeviceController {
@Resource
private DeviceService deviceService;
@PostMapping("/create")
@Operation(summary = "创建tb_device")
@PreAuthorize("@ss.hasPermission('test:device:create')")
public CommonResult<String> createDevice(@Valid @RequestBody DeviceSaveReqVO createReqVO) {
return success(deviceService.createDevice(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新tb_device")
@PreAuthorize("@ss.hasPermission('test:device:update')")
public CommonResult<Boolean> updateDevice(@Valid @RequestBody DeviceSaveReqVO updateReqVO) {
deviceService.updateDevice(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除tb_device")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('test:device:delete')")
public CommonResult<Boolean> deleteDevice(@RequestParam("id") String id) {
deviceService.deleteDevice(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得tb_device")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('test:device:query')")
public CommonResult<DeviceDO> getDevice(@RequestParam("id") String id) {
DeviceDO device = deviceService.getDevice(id);
return success(device);
}
@GetMapping("/getlist")
@Operation(summary = "获得tb_device")
@PreAuthorize("@ss.hasPermission('test:device:query')")
public CommonResult<List<DeviceDO>> getDevicelist() {
List<DeviceDO> devices = deviceService.getDevicelist();
return success(devices);
}
@GetMapping("/page")
@Operation(summary = "获得tb_device分页")
@PreAuthorize("@ss.hasPermission('test:device:query')")
public CommonResult<PageResult<DeviceDO>> getDevicePage(@Valid DevicePageReqVO pageReqVO) {
PageResult<DeviceDO> pageResult = deviceService.getDevicePage(pageReqVO);
return success(pageResult);
}
}

View File

@ -0,0 +1,87 @@
package cn.iocoder.yudao.module.applyregistration.controller.admin.device.vo;
import lombok.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.*;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - tb_device分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class DevicePageReqVO extends PageParam {
/*******在用参数******/
@Schema(description = "设备信息描述", example = "设备名称、编号、型号")
private String deviceDesc;
@Schema(description = "设备名称", example = "赵六")
private String deviceName;
@Schema(description = "设备唯一编号", example = "25589")
private String deviceId;
@Schema(description = "设备型号")
private String deviceModel;
@Schema(description = "设备归属科室代码")
private String departmentCode;
@Schema(description = "设备归属科室")
private String deviceDepartment;
@Schema(description = "机构ID", example = "18179")
private String orgId;
/*******备选参数******/
@Schema(description = "设备生产商")
private String deviceMaker;
@Schema(description = "DR CT MR 超声等类别", example = "2")
private String deviceType;
@Schema(description = "设备状态0失效1正常设备故障或者淘汰此状态置为 0", example = "1")
private String deviceStatus;
@Schema(description = "设备生产商")
private String madeCompany;
@Schema(description = "设备生产商联系电话")
private String madeCompanyTel;
@Schema(description = "设备销售商")
private String saleCompany;
@Schema(description = "设备销售商电话")
private String saleCompanyTel;
@Schema(description = "备注", example = "随便")
private String remark;
@Schema(description = "设备位置XX楼XX室..")
private String deviceLocalAddress;
@Schema(description = "删除标记1为删除")
private String isDelete;
@Schema(description = "删除操作人")
private String deletePerson;
@Schema(description = "删除时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] deleteDate;
@Schema(description = "创建人")
private String createPerson;
@Schema(description = "设备录入时间:年月日时分秒")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createDate;
}

View File

@ -0,0 +1,62 @@
package cn.iocoder.yudao.module.applyregistration.controller.admin.device.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import javax.validation.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.*;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - tb_device新增/修改 Request VO")
@Data
public class DeviceSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "15870")
private String id;
@Schema(description = "设备名称", example = "赵六")
private String deviceName;
@Schema(description = "设备唯一编号", example = "25589")
private String deviceId;
@Schema(description = "设备型号")
private String deviceModel;
@Schema(description = "设备生产商")
private String deviceMaker;
@Schema(description = "DR CT MR 超声等类别", example = "2")
private String deviceType;
@Schema(description = "设备状态0失效1正常设备故障或者淘汰此状态置为 0", example = "1")
private String deviceStatus;
@Schema(description = "设备归属科室")
private String deviceDepartment;
@Schema(description = "机构ID", example = "18179")
private String orgId;
@Schema(description = "设备归属科室代码")
private String departmentCode;
@Schema(description = "设备生产商")
private String madeCompany;
@Schema(description = "设备生产商联系电话")
private String madeCompanyTel;
@Schema(description = "设备销售商")
private String saleCompany;
@Schema(description = "设备销售商电话")
private String saleCompanyTel;
@Schema(description = "备注", example = "随便")
private String remark;
@Schema(description = "设备位置XX楼XX室..")
private String deviceLocalAddress;
}

View File

@ -3,6 +3,8 @@ package cn.iocoder.yudao.module.applyregistration.dal.device;
import com.baomidou.mybatisplus.annotation.*;
import lombok.*;
import java.time.LocalDateTime;
@TableName("tb_device")
@Data
@ToString(callSuper = true)
@ -11,7 +13,7 @@ import lombok.*;
@AllArgsConstructor
public class DeviceDO {
@TableId(type = IdType.INPUT)
@TableId(value="ID",type = IdType.INPUT)
private String ID;
/**
@ -64,11 +66,64 @@ public class DeviceDO {
* 设备录入时间
*/
@TableField("createDate")
private String createDate;
private LocalDateTime createDate;
/**
* 创建人
*/
@TableField("createPerson")
private String createPerson;
/**
* 设备归属科室代码
*/
@TableField("departmentCode")
private String departmentCode;
/**
* 设备生产商
*/
@TableField("madeCompany")
private String madeCompany;
/**
* 设备生产商联系电话
*/
@TableField("madeCompanyTel")
private String madeCompanyTel;
/**
* 设备销售商
*/
@TableField("saleCompany")
private String saleCompany;
/**
* 设备销售商电话
*/
@TableField("saleCompanyTel")
private String saleCompanyTel;
/**
* 备注
*/
@TableField("remark")
private String remark;
/**
* 设备位置XX楼XX室..
*/
@TableField("deviceLocalAddress")
private String deviceLocalAddress;
/**
* 删除标记1 为删除
*/
@TableField("isdelete")
private String isdelete;
/**
* 删除人
*/
@TableField("deletePerson")
private String deletePerson;
/**
* 删除日期
*/
@TableField("deleteDate")
private LocalDateTime deleteDate;
}

View File

@ -1,13 +1,33 @@
package cn.iocoder.yudao.module.applyregistration.service.applyform.device;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.applyregistration.controller.admin.applyform.vo.ApplyformPageReqVO;
import cn.iocoder.yudao.module.applyregistration.dal.dataobject.applyform.ApplyformDO;
import cn.iocoder.yudao.module.applyregistration.dal.device.DeviceDO;
import cn.iocoder.yudao.module.applyregistration.controller.admin.device.vo.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import javax.validation.*;
import java.util.*;
import java.util.List;
/**
* 设备管理 Service 接口
*
* @author 李晓东 李传洋
*/
public interface DeviceService {
//更新方法
String createDevice(@Valid DeviceSaveReqVO createReqVO);
void updateDevice(@Valid DeviceSaveReqVO updateReqVO);
void deleteDevice(String id);
//查询方法
DeviceDO getDevice(String id);
List<DeviceDO> getDevicelist(String orgId);
PageResult<DeviceDO> getDevicePage(DevicePageReqVO pageReqVO);
//临时方法
List<DeviceDO> getDevicelist();
}

View File

@ -1,25 +1,130 @@
package cn.iocoder.yudao.module.applyregistration.service.applyform.device;
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.applyregistration.controller.admin.device.vo.*;
import cn.iocoder.yudao.module.applyregistration.dal.device.*;
import cn.iocoder.yudao.module.applyregistration.dal.device.Mapper.*;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import cn.iocoder.yudao.module.system.service.user.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.applyregistration.dal.device.DeviceDO;
import cn.iocoder.yudao.module.applyregistration.dal.device.Mapper.DeviceMapper;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.List;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
/**
* 设备管理 Service 实现类
*
* @author 李晓东 李传洋
*/
@Service
@Validated
public class DeviceServiceImpl implements DeviceService {
//属性
@Resource
private DeviceMapper DeviceMapper;
@Resource
private AdminUserService userService;
//实现方法
@Override
public String createDevice(DeviceSaveReqVO createReqVO) {
//当前登陆用户
AdminUserDO user = userService.getUser(getLoginUserId());
//当前时间
LocalDateTime dateTime= LocalDateTime.parse(
LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")),
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
);
//生成UUID
UUID guid = UUID.randomUUID();
//VO转DO
DeviceDO deviceDO = BeanUtils.toBean(createReqVO, DeviceDO.class);
deviceDO.setID(guid.toString());
deviceDO.setDeviceId(guid.toString());
deviceDO.setCreateDate(dateTime);
deviceDO.setCreatePerson(user.getUsername());
deviceDO.setIsdelete("0");
DeviceMapper.insert(deviceDO);
return deviceDO.getID();
}
@Override
public void updateDevice(DeviceSaveReqVO updateReqVO) {
//校验存在
validateExists(updateReqVO.getId());
//VO转DO
DeviceDO deviceDO = BeanUtils.toBean(updateReqVO, DeviceDO.class);
DeviceMapper.updateById(deviceDO);
}
@Override
public void deleteDevice(String id) {
//校验存在
validateExists(id);
//当前登陆用户
AdminUserDO user = userService.getUser(getLoginUserId());
//当前时间
LocalDateTime dateTime= LocalDateTime.parse(
LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")),
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
);
//创建DO
DeviceDO deviceDO=new DeviceDO();
deviceDO.setID(id);
deviceDO.setDeleteDate(dateTime);
deviceDO.setDeletePerson(user.getUsername());
deviceDO.setIsdelete("1");
DeviceMapper.updateById(deviceDO);
}
@Override
public DeviceDO getDevice(String id) {
return DeviceMapper.selectById(id);
}
@Override
public List<DeviceDO> getDevicelist(String orgId) {
return DeviceMapper.SelectDevice(orgId);
}
@Override
public PageResult<DeviceDO> getDevicePage(DevicePageReqVO pageReqVO) {
return DeviceMapper.selectPage(pageReqVO, new LambdaQueryWrapperX<DeviceDO>()
.likeIfPresent(DeviceDO::getDeviceDepartment, pageReqVO.getDeviceDepartment())
.likeIfPresent(DeviceDO::getDeviceName, pageReqVO.getDeviceDesc())
.likeIfPresent(DeviceDO::getDeviceId, pageReqVO.getDeviceDesc())
.likeIfPresent(DeviceDO::getDeviceModel, pageReqVO.getDeviceDesc())
.eq(DeviceDO::getIsdelete, '0'));
}
//其它方法
private void validateExists(String id) {
if (DeviceMapper.selectById(id) == null) {
throw exception(new ErrorCode(1,"ID为空"));
}
}
//临时方法
@Override
public List<DeviceDO> getDevicelist() {
return DeviceMapper.selectList();
}
}

View File

@ -120,4 +120,13 @@ public class DoctorController {
}
//临时接口
@GetMapping("/getlist")
@Operation(summary = "获得医生管理list")
@PreAuthorize("@ss.hasPermission('doctor::query')")
public CommonResult<List<DoctorDO>> getlist() {
List<DoctorDO> doctorDOs= Service.getDoctorList();
return success(doctorDOs);
}
}

View File

@ -0,0 +1,86 @@
package cn.iocoder.yudao.module.system.controller.admin.exampart;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.*;
import javax.annotation.Resource;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import cn.iocoder.yudao.module.system.controller.admin.exampart.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.exampart.*;
import cn.iocoder.yudao.module.system.service.exampart.*;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 检查部位")
@RestController
@RequestMapping("/test/exampart")
@Validated
public class ExampartController {
@Resource
private ExampartService exampartService;
@PostMapping("/create")
@Operation(summary = "创建检查部位")
@PreAuthorize("@ss.hasPermission('test:exampart:create')")
public CommonResult<String> createExampart(@Valid @RequestBody ExampartSaveReqVO createReqVO) {
return success(exampartService.createExampart(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新检查部位")
@PreAuthorize("@ss.hasPermission('test:exampart:update')")
public CommonResult<Boolean> updateExampart(@Valid @RequestBody ExampartSaveReqVO updateReqVO) {
exampartService.updateExampart(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除检查部位")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('test:exampart:delete')")
public CommonResult<Boolean> deleteExampart(@RequestParam("id") String id) {
exampartService.deleteExampart(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得检查部位")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('test:exampart:query')")
public CommonResult<ExampartDO> getExampart(@RequestParam("id") String id) {
ExampartDO exampart = exampartService.getExampart(id);
return success(exampart);
}
@GetMapping("/getlist")
@Operation(summary = "获得检查部位")
@PreAuthorize("@ss.hasPermission('test:exampart:query')")
public CommonResult<List<ExampartDO>> getExampartlist() {
List<ExampartDO> examparts = exampartService.getExampartlist();
return success(examparts);
}
@GetMapping("/page")
@Operation(summary = "获得检查部位分页")
@PreAuthorize("@ss.hasPermission('test:exampart:query')")
public CommonResult<PageResult<ExampartDO>> getExampartPage(@Valid ExampartPageReqVO pageReqVO) {
PageResult<ExampartDO> pageResult = exampartService.getExampartPage(pageReqVO);
return success(pageResult);
}
}

View File

@ -0,0 +1,54 @@
package cn.iocoder.yudao.module.system.controller.admin.exampart.vo;
import lombok.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.*;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 检查部位分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ExampartPageReqVO extends PageParam {
/*******在用参数******/
@Schema(description = "检查部位名称", example = "张三")
private String examPartName;
@Schema(description = "检查部位代码")
private String examPartCode;
@Schema(description = "机构ID", example = "23373")
private String orgId;
/*******备选参数******/
@Schema(description = "主键", example = "29261")
private String id;
@Schema(description = "创建人")
private String createPerson;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createDate;
@Schema(description = "删除标记1为删除")
private String isDelete;
@Schema(description = "删除操作人")
private String deletePerson;
@Schema(description = "删除时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] deleteDate;
@Schema(description = "备注", example = "你说的对")
private String remark;
}

View File

@ -0,0 +1,29 @@
package cn.iocoder.yudao.module.system.controller.admin.exampart.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import javax.validation.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.*;
import java.time.*;
@Schema(description = "管理后台 - 检查部位新增/修改 Request VO")
@Data
public class ExampartSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "29261")
private String id;
@Schema(description = "检查部位名称", example = "张三")
private String examPartName;
@Schema(description = "检查部位代码", requiredMode = Schema.RequiredMode.REQUIRED)
private String examPartCode;
@Schema(description = "机构ID", example = "23373")
private String orgId;
@Schema(description = "备注", example = "你说的对")
private String remark;
}

View File

@ -0,0 +1,73 @@
package cn.iocoder.yudao.module.system.dal.dataobject.exampart;
import lombok.*;
import java.util.*;
import java.time.*;
import com.baomidou.mybatisplus.annotation.*;
/**
* 检查部位 DO
*
* @author 李传洋
*/
@TableName("tb_exampart")
@KeySequence("tb_exampart_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ExampartDO {
/**
* 主键
*/
@TableId(value="ID",type = IdType.INPUT)
private String ID;
/**
* 检查部位名称
*/
@TableField("examPartName")
private String examPartName;
/**
* 检查部位代码
*/
@TableField("examPartCode")
private String examPartCode;
/**
* 机构ID
*/
@TableField("orgId")
private String orgId;
/**
* 创建人
*/
@TableField("createPerson")
private String createPerson;
/**
* 创建时间
*/
@TableField("createDate")
private LocalDateTime createDate;
/**
* 删除标记1为删除
*/
@TableField("isDelete")
private String isDelete;
/**
* 删除操作人
*/
@TableField("deletePerson")
private String deletePerson;
/**
* 删除时间
*/
@TableField("deleteDate")
private LocalDateTime deleteDate;
/**
* 备注
*/
@TableField("remark")
private String remark;
}

View File

@ -0,0 +1,20 @@
package cn.iocoder.yudao.module.system.dal.mysql.exampart;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.exampart.ExampartDO;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import org.apache.ibatis.annotations.Mapper;
import java.util.*;
/**
* 检查部位 Mapper
*
* @author 李传洋
*/
@InterceptorIgnore(tenantLine = "true")
@Mapper
public interface ExampartMapper extends BaseMapperX<ExampartDO> {
}

View File

@ -53,4 +53,7 @@ public interface DoctorService {
*/
PageResult<DoctorDO> getPage(DoctorPageReqVO pageReqVO);
//临时方法
List<DoctorDO> getDoctorList();
}

View File

@ -73,4 +73,10 @@ public class DoctorServiceImpl implements DoctorService {
return Mapper.selectPage(pageReqVO);
}
//临时方法
@Override
public List<DoctorDO> getDoctorList() {
return Mapper.selectList();
}
}

View File

@ -0,0 +1,35 @@
package cn.iocoder.yudao.module.system.service.exampart;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.module.system.controller.admin.exampart.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.exampart.*;
import java.util.*;
import javax.validation.*;
/**
* 检查部位 Service 接口
*
* @author 李传洋
*/
public interface ExampartService {
//更新方法
String createExampart(@Valid ExampartSaveReqVO createReqVO);
void updateExampart(@Valid ExampartSaveReqVO updateReqVO);
void deleteExampart(String id);
//查询方法
ExampartDO getExampart(String id);
List<ExampartDO> getExampartlist(String orgId);
PageResult<ExampartDO> getExampartPage(ExampartPageReqVO pageReqVO);
//临时方法
List<ExampartDO> getExampartlist();
}

View File

@ -0,0 +1,127 @@
package cn.iocoder.yudao.module.system.service.exampart;
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.system.controller.admin.exampart.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.exampart.*;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import cn.iocoder.yudao.module.system.dal.mysql.exampart.*;
import cn.iocoder.yudao.module.system.service.user.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
/**
* 检查部位 Service 实现类
*
* @author 李传洋
*/
@Service
@Validated
public class ExampartServiceImpl implements ExampartService {
//属性
@Resource
private ExampartMapper exampartMapper;
@Resource
private AdminUserService userService;
//实现方法
@Override
public String createExampart(ExampartSaveReqVO createReqVO) {
//当前登陆用户
AdminUserDO user = userService.getUser(getLoginUserId());
//当前时间
LocalDateTime dateTime= LocalDateTime.parse(
LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")),
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
);
//生成UUID
UUID guid = UUID.randomUUID();
//VO转DO
ExampartDO exampartDO = BeanUtils.toBean(createReqVO, ExampartDO.class);
exampartDO.setID(guid.toString());
exampartDO.setCreateDate(dateTime);
exampartDO.setCreatePerson(user.getUsername());
exampartDO.setIsDelete("0");
exampartMapper.insert(exampartDO);
return exampartDO.getID();
}
@Override
public void updateExampart(ExampartSaveReqVO updateReqVO) {
//校验存在
validateExists(updateReqVO.getId());
//VO转DO
ExampartDO exampartDO = BeanUtils.toBean(updateReqVO, ExampartDO.class);
exampartMapper.updateById(exampartDO);
}
@Override
public void deleteExampart(String id) {
//校验存在
validateExists(id);
//当前登陆用户
AdminUserDO user = userService.getUser(getLoginUserId());
//当前时间
LocalDateTime dateTime= LocalDateTime.parse(
LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")),
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
);
//创建DO
ExampartDO exampartDO=new ExampartDO();
exampartDO.setID(id);
exampartDO.setDeleteDate(dateTime);
exampartDO.setDeletePerson(user.getUsername());
exampartDO.setIsDelete("1");
exampartMapper.updateById(exampartDO);
}
@Override
public ExampartDO getExampart(String id) {
return exampartMapper.selectById(id);
}
@Override
public List<ExampartDO> getExampartlist(String orgId) {
return null;
}
@Override
public PageResult<ExampartDO> getExampartPage(ExampartPageReqVO pageReqVO) {
return exampartMapper.selectPage(pageReqVO, new LambdaQueryWrapperX<ExampartDO>()
.likeIfPresent(ExampartDO::getExamPartName, pageReqVO.getExamPartName())
.likeIfPresent(ExampartDO::getExamPartCode, pageReqVO.getExamPartCode())
.eq(ExampartDO::getIsDelete, '0'));
}
//其它方法
private void validateExists(String id) {
if (exampartMapper.selectById(id) == null) {
throw exception(new ErrorCode(1,"ID为空"));
}
}
//临时方法
@Override
public List<ExampartDO> getExampartlist() {
return exampartMapper.selectList();
}
}

View File

@ -0,0 +1,12 @@
<?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="cn.iocoder.yudao.module.system.dal.mysql.exampart.ExampartMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>

View File

@ -0,0 +1,87 @@
package cn.iocoder.yudao.module.ultrasoniccom.controller.admin.reporttemplate;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.*;
import io.swagger.v3.oas.annotations.tags.Tag;
import javax.annotation.Resource;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import cn.iocoder.yudao.module.ultrasoniccom.dal.reporttemplate.*;
import cn.iocoder.yudao.module.ultrasoniccom.controller.admin.reporttemplate.vo.*;
import cn.iocoder.yudao.module.ultrasoniccom.service.reporttemplate.*;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
@Tag(name = "管理后台 - 诊断模板")
@RestController
@RequestMapping("/test/reporttemplate")
@Validated
public class ReporttemplateController {
@Resource
private ReporttemplateService reporttemplateService;
@PostMapping("/create")
@Operation(summary = "创建诊断模板")
@PreAuthorize("@ss.hasPermission('test:reporttemplate:create')")
public CommonResult<String> createReporttemplate(@Valid @RequestBody ReporttemplateSaveReqVO createReqVO) {
return success(reporttemplateService.createReporttemplate(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新诊断模板")
@PreAuthorize("@ss.hasPermission('test:reporttemplate:update')")
public CommonResult<Boolean> updateReporttemplate(@Valid @RequestBody ReporttemplateSaveReqVO updateReqVO) {
reporttemplateService.updateReporttemplate(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除诊断模板")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('test:reporttemplate:delete')")
public CommonResult<Boolean> deleteReporttemplate(@RequestParam("id") String id) {
reporttemplateService.deleteReporttemplate(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得诊断模板")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('test:reporttemplate:query')")
public CommonResult<ReporttemplateDO> getReporttemplate(@RequestParam("id") String id) {
ReporttemplateDO reporttemplate = reporttemplateService.getReporttemplate(id);
return success(reporttemplate);
}
@GetMapping("/getlist")
@Operation(summary = "获得诊断模板list")
@PreAuthorize("@ss.hasPermission('test:reporttemplate:query')")
public CommonResult<List<ReporttemplateDO>> getReporttemplateList() {
List<ReporttemplateDO> reporttemplates = reporttemplateService.getReporttemplatelist();
return success(reporttemplates);
}
@GetMapping("/page")
@Operation(summary = "获得诊断模板分页")
@PreAuthorize("@ss.hasPermission('test:reporttemplate:query')")
public CommonResult<PageResult<ReporttemplateDO>> getReporttemplatePage(@Valid ReporttemplatePageReqVO pageReqVO) {
PageResult<ReporttemplateDO> pageResult = reporttemplateService.getReporttemplatePage(pageReqVO);
return success(pageResult);
}
}

View File

@ -0,0 +1,76 @@
package cn.iocoder.yudao.module.ultrasoniccom.controller.admin.reporttemplate.vo;
import lombok.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.*;
import java.time.*;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 诊断模板分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ReporttemplatePageReqVO extends PageParam {
/*******在用参数******/
@Schema(description = "模板名称", example = "李四")
private String templateName;
@Schema(description = "模板权限allprivatepublic", example = "2")
private String templateLimitsType;
@Schema(description = "机构ID", example = "2935")
private String orgId;
/*******备选参数******/
@Schema(description = "主键", example = "17893")
private String id;
@Schema(description = "下拉框:体检模板,住院模板,门诊模板", example = "2")
private String templateType;
@Schema(description = "检查部位代码")
private String examPartCode;
@Schema(description = "检查部位名称")
private String examPart;
@Schema(description = "检查所见", example = "随便")
private String examDescription;
@Schema(description = "诊断结论")
private String diagResults;
@Schema(description = "创建人")
private String createPerson;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createDate;
@Schema(description = "删除标记1为删除NULL或者0 为未删除")
private String isdelete;
@Schema(description = "删除是时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] deleteDate;
@Schema(description = "删除人")
private String deletePerson;
@Schema(description = "私有模板的归属医生ID", example = "17696")
private String privateDoctorId;
@Schema(description = "父类ID", example = "29846")
private String pid;
@Schema(description = "模板使用的时间 按此时间 做降序排列")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] updateTime;
}

View File

@ -0,0 +1,47 @@
package cn.iocoder.yudao.module.ultrasoniccom.controller.admin.reporttemplate.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.*;
import java.util.*;
import javax.validation.constraints.*;
@Schema(description = "管理后台 - 诊断模板新增/修改 Request VO")
@Data
public class ReporttemplateSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "17893")
private String id;
@Schema(description = "下拉框:体检模板,住院模板,门诊模板", example = "2")
private String templateType;
@Schema(description = "检查部位代码")
private String examPartCode;
@Schema(description = "检查部位名称")
private String examPart;
@Schema(description = "模板名称", example = "李四")
private String templateName;
@Schema(description = "检查所见", example = "随便")
private String examDescription;
@Schema(description = "诊断结论")
private String diagResults;
@Schema(description = "机构ID", example = "2935")
private String orgId;
@Schema(description = "私有模板的归属医生ID", example = "17696")
private String privateDoctorId;
@Schema(description = "父类ID", example = "29846")
private String pid;
@Schema(description = "模板使用的时间 按此时间 做降序排列")
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,98 @@
package cn.iocoder.yudao.module.ultrasoniccom.dal.reporttemplate;
import lombok.*;
import com.baomidou.mybatisplus.annotation.*;
import java.util.*;
import java.time.*;
/**
* 诊断模板 DO
*
* @author 李传洋
*/
@TableName("tb_reporttemplate")
@KeySequence("tb_reporttemplate_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ReporttemplateDO {
/**
* 主键
*/
@TableId(value="ID",type = IdType.INPUT)
private String id;
/**
* 父类ID
*/
@TableField("pid")
private String pid;
/**
* 机构ID
*/
@TableField("orgId")
private String orgId;
/**
* 下拉框体检模板住院模板门诊模板
*/
@TableField("templateType")
private String templateType;
/**
* 私有模板的归属医生ID
*/
@TableField("privateDoctorId")
private String privateDoctorId;
/**
* 检查部位代码
*/
@TableField("examPartCode")
private String examPartCode;
/**
* 检查部位名称
*/
@TableField("examPart")
private String examPart;
/**
* 模板名称
*/
@TableField("templateName")
private String templateName;
/**
* 检查所见
*/
@TableField("examDescription")
private String examDescription;
/**
* 诊断结论
*/
@TableField("diagResults")
private String diagResults;
/**
* 创建人
*/
@TableField("createPerson")
private String createPerson;
/**
* 创建时间
*/
@TableField("createDate")
private LocalDateTime createDate;
/**
* 删除标记1为删除NULL或者0 为未删除
*/
@TableField("isdelete")
private String isdelete;
/**
* 删除是时间
*/
@TableField("deleteDate")
private LocalDateTime deleteDate;
/**
* 删除人
*/
@TableField("deletePerson")
private String deletePerson;
}

View File

@ -0,0 +1,19 @@
package cn.iocoder.yudao.module.ultrasoniccom.dal.reporttemplate;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import org.apache.ibatis.annotations.Mapper;
import java.util.*;
/**
* 诊断模板 Mapper
*
* @author 李传洋
*/
@InterceptorIgnore(tenantLine = "true")
@Mapper
public interface ReporttemplateMapper extends BaseMapperX<ReporttemplateDO> {
}

View File

@ -0,0 +1,35 @@
package cn.iocoder.yudao.module.ultrasoniccom.service.reporttemplate;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.module.ultrasoniccom.controller.admin.reporttemplate.vo.*;
import cn.iocoder.yudao.module.ultrasoniccom.dal.reporttemplate.*;
import javax.validation.*;
import java.util.*;
/**
* 诊断模板 Service 接口
*
* @author 李传洋
*/
public interface ReporttemplateService {
//更新方法
String createReporttemplate(@Valid ReporttemplateSaveReqVO createReqVO);
void updateReporttemplate(@Valid ReporttemplateSaveReqVO updateReqVO);
void deleteReporttemplate(String id);
//查询方法
ReporttemplateDO getReporttemplate(String id);
List<ReporttemplateDO> getReporttemplatelist(String orgId);
PageResult<ReporttemplateDO> getReporttemplatePage(ReporttemplatePageReqVO pageReqVO);
//临时方法
List<ReporttemplateDO> getReporttemplatelist();
}

View File

@ -0,0 +1,125 @@
package cn.iocoder.yudao.module.ultrasoniccom.service.reporttemplate;
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import cn.iocoder.yudao.module.ultrasoniccom.controller.admin.reporttemplate.vo.*;
import cn.iocoder.yudao.module.ultrasoniccom.dal.reporttemplate.*;
import cn.iocoder.yudao.module.system.service.user.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import javax.annotation.Resource;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
/**
* 诊断模板 Service 实现类
*
* @author 李传洋
*/
@Service
@Validated
public class ReporttemplateServiceImpl implements ReporttemplateService {
//属性
@Resource
private ReporttemplateMapper reporttemplateMapper;
@Resource
private AdminUserService userService;
//实现方法
@Override
public String createReporttemplate(ReporttemplateSaveReqVO createReqVO) {
//当前登陆用户
AdminUserDO user = userService.getUser(getLoginUserId());
//当前时间
LocalDateTime dateTime= LocalDateTime.parse(
LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")),
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
);
//生成UUID
UUID guid = UUID.randomUUID();
//VO转DO
ReporttemplateDO reporttemplateDO = BeanUtils.toBean(createReqVO, ReporttemplateDO.class);
reporttemplateDO.setId(guid.toString());
reporttemplateDO.setCreateDate(dateTime);
reporttemplateDO.setCreatePerson(user.getUsername());
reporttemplateDO.setIsdelete("0");
reporttemplateMapper.insert(reporttemplateDO);
return reporttemplateDO.getId();
}
@Override
public void updateReporttemplate(ReporttemplateSaveReqVO updateReqVO) {
//校验存在
validateExists(updateReqVO.getId());
//VO转DO
ReporttemplateDO reporttemplateDO = BeanUtils.toBean(updateReqVO, ReporttemplateDO.class);
reporttemplateMapper.updateById(reporttemplateDO);
}
@Override
public void deleteReporttemplate(String id) {
//校验存在
validateExists(id);
//当前登陆用户
AdminUserDO user = userService.getUser(getLoginUserId());
//当前时间
LocalDateTime dateTime= LocalDateTime.parse(
LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")),
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
);
//创建DO
ReporttemplateDO reporttemplateDO=new ReporttemplateDO();
reporttemplateDO.setId(id);
reporttemplateDO.setDeleteDate(dateTime);
reporttemplateDO.setDeletePerson(user.getUsername());
reporttemplateDO.setIsdelete("1");
reporttemplateMapper.updateById(reporttemplateDO);
}
@Override
public ReporttemplateDO getReporttemplate(String id) {
return reporttemplateMapper.selectById(id);
}
@Override
public List<ReporttemplateDO> getReporttemplatelist(String orgId) {
return null;
}
@Override
public PageResult<ReporttemplateDO> getReporttemplatePage(ReporttemplatePageReqVO pageReqVO) {
return reporttemplateMapper.selectPage(pageReqVO, new LambdaQueryWrapperX<ReporttemplateDO>()
.likeIfPresent(ReporttemplateDO::getTemplateName, pageReqVO.getTemplateName())
.eq(ReporttemplateDO::getIsdelete, '0'));
}
//其它方法
private void validateExists(String id) {
if (reporttemplateMapper.selectById(id) == null) {
throw exception(new ErrorCode(1,"ID为空"));
}
}
//临时方法
@Override
public List<ReporttemplateDO> getReporttemplatelist() {
return reporttemplateMapper.selectList();
}
}

View File

@ -0,0 +1,12 @@
<?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="cn.iocoder.yudao.module.ultrasoniccom.dal.reporttemplate.ReporttemplateMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>