diff --git a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/device/DeviceController.java b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/device/DeviceController.java new file mode 100644 index 000000000..b64d6ac88 --- /dev/null +++ b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/device/DeviceController.java @@ -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 createDevice(@Valid @RequestBody DeviceSaveReqVO createReqVO) { + return success(deviceService.createDevice(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新tb_device") + @PreAuthorize("@ss.hasPermission('test:device:update')") + public CommonResult 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 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 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> getDevicelist() { + List devices = deviceService.getDevicelist(); + return success(devices); + } + + @GetMapping("/page") + @Operation(summary = "获得tb_device分页") + @PreAuthorize("@ss.hasPermission('test:device:query')") + public CommonResult> getDevicePage(@Valid DevicePageReqVO pageReqVO) { + PageResult pageResult = deviceService.getDevicePage(pageReqVO); + return success(pageResult); + } + +} \ No newline at end of file diff --git a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/device/vo/DevicePageReqVO.java b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/device/vo/DevicePageReqVO.java new file mode 100644 index 000000000..e1a54f150 --- /dev/null +++ b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/device/vo/DevicePageReqVO.java @@ -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; + +} \ No newline at end of file diff --git a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/device/vo/DeviceSaveReqVO.java b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/device/vo/DeviceSaveReqVO.java new file mode 100644 index 000000000..53ed3c926 --- /dev/null +++ b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/device/vo/DeviceSaveReqVO.java @@ -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; + +} \ No newline at end of file diff --git a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/dal/device/DeviceDO.java b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/dal/device/DeviceDO.java index 845a70006..807bd3d97 100644 --- a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/dal/device/DeviceDO.java +++ b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/dal/device/DeviceDO.java @@ -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; } diff --git a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/device/DeviceService.java b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/device/DeviceService.java index dd2f03d81..aeaed6c20 100644 --- a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/device/DeviceService.java +++ b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/device/DeviceService.java @@ -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 getDevicelist(String orgId); + + PageResult getDevicePage(DevicePageReqVO pageReqVO); + + //临时方法 + List getDevicelist(); + } diff --git a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/device/DeviceServiceImpl.java b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/device/DeviceServiceImpl.java index 9269bc38c..278dc91ac 100644 --- a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/device/DeviceServiceImpl.java +++ b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/device/DeviceServiceImpl.java @@ -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 getDevicelist(String orgId) { - return DeviceMapper.SelectDevice(orgId); } + + @Override + public PageResult getDevicePage(DevicePageReqVO pageReqVO) { + return DeviceMapper.selectPage(pageReqVO, new LambdaQueryWrapperX() + .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 getDevicelist() { + return DeviceMapper.selectList(); + } + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/doctor/DoctorController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/doctor/DoctorController.java index 247f6440b..92c4b8d8b 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/doctor/DoctorController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/doctor/DoctorController.java @@ -120,4 +120,13 @@ public class DoctorController { } + //临时接口 + @GetMapping("/getlist") + @Operation(summary = "获得医生管理list") + @PreAuthorize("@ss.hasPermission('doctor::query')") + public CommonResult> getlist() { + List doctorDOs= Service.getDoctorList(); + return success(doctorDOs); + } + } \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/exampart/ExampartController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/exampart/ExampartController.java new file mode 100644 index 000000000..c11ed097a --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/exampart/ExampartController.java @@ -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 createExampart(@Valid @RequestBody ExampartSaveReqVO createReqVO) { + return success(exampartService.createExampart(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新检查部位") + @PreAuthorize("@ss.hasPermission('test:exampart:update')") + public CommonResult 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 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 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> getExampartlist() { + List examparts = exampartService.getExampartlist(); + return success(examparts); + } + + @GetMapping("/page") + @Operation(summary = "获得检查部位分页") + @PreAuthorize("@ss.hasPermission('test:exampart:query')") + public CommonResult> getExampartPage(@Valid ExampartPageReqVO pageReqVO) { + PageResult pageResult = exampartService.getExampartPage(pageReqVO); + return success(pageResult); + } + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/exampart/vo/ExampartPageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/exampart/vo/ExampartPageReqVO.java new file mode 100644 index 000000000..d3cf542db --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/exampart/vo/ExampartPageReqVO.java @@ -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; + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/exampart/vo/ExampartSaveReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/exampart/vo/ExampartSaveReqVO.java new file mode 100644 index 000000000..edc112346 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/exampart/vo/ExampartSaveReqVO.java @@ -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; + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/exampart/ExampartDO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/exampart/ExampartDO.java new file mode 100644 index 000000000..a9e95123b --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/exampart/ExampartDO.java @@ -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") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 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; + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/exampart/ExampartMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/exampart/ExampartMapper.java new file mode 100644 index 000000000..5d155d1be --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/exampart/ExampartMapper.java @@ -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 { + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/doctor/DoctorService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/doctor/DoctorService.java index e9d9ec620..6d7fffd77 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/doctor/DoctorService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/doctor/DoctorService.java @@ -53,4 +53,7 @@ public interface DoctorService { */ PageResult getPage(DoctorPageReqVO pageReqVO); + //临时方法 + List getDoctorList(); + } \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/doctor/DoctorServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/doctor/DoctorServiceImpl.java index f28220ee6..477931287 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/doctor/DoctorServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/doctor/DoctorServiceImpl.java @@ -73,4 +73,10 @@ public class DoctorServiceImpl implements DoctorService { return Mapper.selectPage(pageReqVO); } + //临时方法 + @Override + public List getDoctorList() { + return Mapper.selectList(); + } + } \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/exampart/ExampartService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/exampart/ExampartService.java new file mode 100644 index 000000000..f63e0dfbf --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/exampart/ExampartService.java @@ -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 getExampartlist(String orgId); + + PageResult getExampartPage(ExampartPageReqVO pageReqVO); + + //临时方法 + List getExampartlist(); + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/exampart/ExampartServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/exampart/ExampartServiceImpl.java new file mode 100644 index 000000000..6ea24f62b --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/exampart/ExampartServiceImpl.java @@ -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 getExampartlist(String orgId) { + return null; + } + + @Override + public PageResult getExampartPage(ExampartPageReqVO pageReqVO) { + return exampartMapper.selectPage(pageReqVO, new LambdaQueryWrapperX() + .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 getExampartlist() { + return exampartMapper.selectList(); + } +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/exampart/ExampartMapper.xml b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/exampart/ExampartMapper.xml new file mode 100644 index 000000000..d0debd68e --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/exampart/ExampartMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/controller/admin/reporttemplate/ReporttemplateController.java b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/controller/admin/reporttemplate/ReporttemplateController.java new file mode 100644 index 000000000..4c9b01144 --- /dev/null +++ b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/controller/admin/reporttemplate/ReporttemplateController.java @@ -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 createReporttemplate(@Valid @RequestBody ReporttemplateSaveReqVO createReqVO) { + return success(reporttemplateService.createReporttemplate(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新诊断模板") + @PreAuthorize("@ss.hasPermission('test:reporttemplate:update')") + public CommonResult 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 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 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> getReporttemplateList() { + List reporttemplates = reporttemplateService.getReporttemplatelist(); + return success(reporttemplates); + } + + @GetMapping("/page") + @Operation(summary = "获得诊断模板分页") + @PreAuthorize("@ss.hasPermission('test:reporttemplate:query')") + public CommonResult> getReporttemplatePage(@Valid ReporttemplatePageReqVO pageReqVO) { + PageResult pageResult = reporttemplateService.getReporttemplatePage(pageReqVO); + return success(pageResult); + } + +} \ No newline at end of file diff --git a/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/controller/admin/reporttemplate/vo/ReporttemplatePageReqVO.java b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/controller/admin/reporttemplate/vo/ReporttemplatePageReqVO.java new file mode 100644 index 000000000..0a2406c55 --- /dev/null +++ b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/controller/admin/reporttemplate/vo/ReporttemplatePageReqVO.java @@ -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 = "模板权限:all,private,public", 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; + +} \ No newline at end of file diff --git a/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/controller/admin/reporttemplate/vo/ReporttemplateSaveReqVO.java b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/controller/admin/reporttemplate/vo/ReporttemplateSaveReqVO.java new file mode 100644 index 000000000..00233319b --- /dev/null +++ b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/controller/admin/reporttemplate/vo/ReporttemplateSaveReqVO.java @@ -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; + +} \ No newline at end of file diff --git a/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/dal/reporttemplate/ReporttemplateDO.java b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/dal/reporttemplate/ReporttemplateDO.java new file mode 100644 index 000000000..adbb325dc --- /dev/null +++ b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/dal/reporttemplate/ReporttemplateDO.java @@ -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") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 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; + +} \ No newline at end of file diff --git a/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/dal/reporttemplate/ReporttemplateMapper.java b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/dal/reporttemplate/ReporttemplateMapper.java new file mode 100644 index 000000000..2d9dc3501 --- /dev/null +++ b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/dal/reporttemplate/ReporttemplateMapper.java @@ -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 { + +} \ No newline at end of file diff --git a/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/service/reporttemplate/ReporttemplateService.java b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/service/reporttemplate/ReporttemplateService.java new file mode 100644 index 000000000..af08d5c7a --- /dev/null +++ b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/service/reporttemplate/ReporttemplateService.java @@ -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 getReporttemplatelist(String orgId); + + PageResult getReporttemplatePage(ReporttemplatePageReqVO pageReqVO); + + //临时方法 + List getReporttemplatelist(); + +} \ No newline at end of file diff --git a/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/service/reporttemplate/ReporttemplateServiceImpl.java b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/service/reporttemplate/ReporttemplateServiceImpl.java new file mode 100644 index 000000000..d7336aa46 --- /dev/null +++ b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/service/reporttemplate/ReporttemplateServiceImpl.java @@ -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 getReporttemplatelist(String orgId) { + return null; + } + + @Override + public PageResult getReporttemplatePage(ReporttemplatePageReqVO pageReqVO) { + return reporttemplateMapper.selectPage(pageReqVO, new LambdaQueryWrapperX() + .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 getReporttemplatelist() { + return reporttemplateMapper.selectList(); + } +} \ No newline at end of file diff --git a/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/resources/mapper/reporttemplate/ReporttemplateMapper.xml b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/resources/mapper/reporttemplate/ReporttemplateMapper.xml new file mode 100644 index 000000000..fd7369e8e --- /dev/null +++ b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/resources/mapper/reporttemplate/ReporttemplateMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file