From c5f318cc432edb61656b01e2bc5c915d7f5ad1f9 Mon Sep 17 00:00:00 2001 From: BLRTTX <2232721325@qq.com> Date: Fri, 20 Dec 2024 12:07:55 +0800 Subject: [PATCH] 12.20 --- .../department/DepartmentController.java | 16 ++++++++ .../admin/controller/file/FileController.java | 33 ++++++++++++++++ .../controller/graph/GraphController.java | 39 +++++++++++-------- .../myself/UserAppointmentController.java | 13 ++++++- .../admin/mapper/DepartmentInfoMapper.java | 9 +++++ .../admin/service/DepartmentInfoService.java | 7 ++++ .../impl/DepartmentInfoServiceImpl.java | 11 ++++++ .../main/resources/mapper/GraphInfoMapper.xml | 1 - .../atjy/web/app/mapper/DepartmentMapper.java | 7 ---- .../atjy/web/app/mapper/GraphInfoMapper.java | 2 - 10 files changed, 111 insertions(+), 27 deletions(-) create mode 100644 web/web-admin/src/main/java/com/atjy/web/admin/controller/department/DepartmentController.java create mode 100644 web/web-admin/src/main/java/com/atjy/web/admin/controller/file/FileController.java create mode 100644 web/web-admin/src/main/java/com/atjy/web/admin/mapper/DepartmentInfoMapper.java create mode 100644 web/web-admin/src/main/java/com/atjy/web/admin/service/DepartmentInfoService.java create mode 100644 web/web-admin/src/main/java/com/atjy/web/admin/service/impl/DepartmentInfoServiceImpl.java delete mode 100644 web/web-app/src/main/java/com/atjy/web/app/mapper/DepartmentMapper.java diff --git a/web/web-admin/src/main/java/com/atjy/web/admin/controller/department/DepartmentController.java b/web/web-admin/src/main/java/com/atjy/web/admin/controller/department/DepartmentController.java new file mode 100644 index 0000000..b576ff8 --- /dev/null +++ b/web/web-admin/src/main/java/com/atjy/web/admin/controller/department/DepartmentController.java @@ -0,0 +1,16 @@ +package com.atjy.web.admin.controller.department; + +import com.atjy.web.admin.service.DepartmentInfoService; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@Tag(name = "科室信息管理") +@RestController +@RequestMapping("/admin/department") +public class DepartmentController { + + @Autowired + private DepartmentInfoService service; +} diff --git a/web/web-admin/src/main/java/com/atjy/web/admin/controller/file/FileController.java b/web/web-admin/src/main/java/com/atjy/web/admin/controller/file/FileController.java new file mode 100644 index 0000000..a6d247d --- /dev/null +++ b/web/web-admin/src/main/java/com/atjy/web/admin/controller/file/FileController.java @@ -0,0 +1,33 @@ +package com.atjy.web.admin.controller.file; + +import com.atjy.common.result.Result; +import com.atjy.web.admin.service.FileService; +import io.minio.errors.*; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; + +@Tag(name = "文件管理") +@RequestMapping("/admin/file") +@RestController +public class FileController { + + @Autowired + private FileService service; + + @Operation(summary = "上传文件") + @PostMapping("upload") + public Result upload(@RequestParam MultipartFile file) throws ServerException, InsufficientDataException, ErrorResponseException, IOException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException { + String url = service.upload(file); + return Result.ok(url); + } +} diff --git a/web/web-admin/src/main/java/com/atjy/web/admin/controller/graph/GraphController.java b/web/web-admin/src/main/java/com/atjy/web/admin/controller/graph/GraphController.java index 27541a8..dd88886 100644 --- a/web/web-admin/src/main/java/com/atjy/web/admin/controller/graph/GraphController.java +++ b/web/web-admin/src/main/java/com/atjy/web/admin/controller/graph/GraphController.java @@ -1,20 +1,14 @@ package com.atjy.web.admin.controller.graph; import com.atjy.common.result.Result; -import com.atjy.web.admin.service.FileService; -import io.minio.errors.*; +import com.atjy.model.entity.GraphInfo; +import com.atjy.web.admin.service.GraphInfoService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.bind.annotation.*; -import java.io.IOException; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; +import java.util.List; @Tag(name = "图片管理") @RequestMapping("/admin/graph") @@ -22,12 +16,25 @@ import java.security.NoSuchAlgorithmException; public class GraphController { @Autowired - private FileService service; + private GraphInfoService service; - @Operation(summary = "上传文件") - @PostMapping("upload") - public Result upload(@RequestParam MultipartFile file) throws ServerException, InsufficientDataException, ErrorResponseException, IOException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException { - String url = service.upload(file); - return Result.ok(url); + @Operation(summary = "上传/修改图片") + @PostMapping("saveOrUpdateGraph") + public Result saveOrUpdateGraph(@RequestBody GraphInfo graphInfo) { + service.saveOrUpdate(graphInfo); + return Result.ok(); + } + + @Operation(summary = "删除图片") + @PostMapping("deleteGraph") + public Result deleteGraph(@RequestParam Long id) { + service.removeById(id); + return Result.ok(); + } + + @Operation(summary = "查询图片") + @GetMapping("getAllGraph") + public Result> getAllGraph() { + return Result.ok(service.list()); } } diff --git a/web/web-admin/src/main/java/com/atjy/web/admin/controller/myself/UserAppointmentController.java b/web/web-admin/src/main/java/com/atjy/web/admin/controller/myself/UserAppointmentController.java index f8a9a12..2cd6287 100644 --- a/web/web-admin/src/main/java/com/atjy/web/admin/controller/myself/UserAppointmentController.java +++ b/web/web-admin/src/main/java/com/atjy/web/admin/controller/myself/UserAppointmentController.java @@ -2,7 +2,9 @@ package com.atjy.web.admin.controller.myself; import com.atjy.common.result.Result; import com.atjy.model.entity.UserAppointment; +import com.atjy.model.enums.AppointmentStatus; import com.atjy.web.admin.service.UserAppointmentService; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.v3.oas.annotations.Operation; @@ -22,8 +24,17 @@ public class UserAppointmentController { @PostMapping("getAppointmentPageItem") public Result> getAppointmentPageItem(@RequestParam Integer current, @RequestParam Integer size, @RequestParam(required = false) Long userId) { Page page = new Page<>(current, size); - IPage userAppointmentIPage = service.pageItem(page,userId); + IPage userAppointmentIPage = service.pageItem(page, userId); return Result.ok(userAppointmentIPage); } + @Operation(summary = "修改就诊状态") + @PostMapping("updateAppointmentState") + public Result updateAppointmentState(@RequestParam Long id) { + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.eq("id", id).set("state", AppointmentStatus.ALREADY); + service.update(updateWrapper); + return Result.ok(); + } + } diff --git a/web/web-admin/src/main/java/com/atjy/web/admin/mapper/DepartmentInfoMapper.java b/web/web-admin/src/main/java/com/atjy/web/admin/mapper/DepartmentInfoMapper.java new file mode 100644 index 0000000..0206bd2 --- /dev/null +++ b/web/web-admin/src/main/java/com/atjy/web/admin/mapper/DepartmentInfoMapper.java @@ -0,0 +1,9 @@ +package com.atjy.web.admin.mapper; + +import com.atjy.model.entity.DepartmentInfo; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +import java.util.List; + +public interface DepartmentInfoMapper extends BaseMapper { +} diff --git a/web/web-admin/src/main/java/com/atjy/web/admin/service/DepartmentInfoService.java b/web/web-admin/src/main/java/com/atjy/web/admin/service/DepartmentInfoService.java new file mode 100644 index 0000000..2d1168c --- /dev/null +++ b/web/web-admin/src/main/java/com/atjy/web/admin/service/DepartmentInfoService.java @@ -0,0 +1,7 @@ +package com.atjy.web.admin.service; + +import com.atjy.model.entity.DepartmentInfo; +import com.baomidou.mybatisplus.extension.service.IService; + +public interface DepartmentInfoService extends IService { +} diff --git a/web/web-admin/src/main/java/com/atjy/web/admin/service/impl/DepartmentInfoServiceImpl.java b/web/web-admin/src/main/java/com/atjy/web/admin/service/impl/DepartmentInfoServiceImpl.java new file mode 100644 index 0000000..4ece2f3 --- /dev/null +++ b/web/web-admin/src/main/java/com/atjy/web/admin/service/impl/DepartmentInfoServiceImpl.java @@ -0,0 +1,11 @@ +package com.atjy.web.admin.service.impl; + +import com.atjy.model.entity.DepartmentInfo; +import com.atjy.web.admin.mapper.DepartmentInfoMapper; +import com.atjy.web.admin.service.DepartmentInfoService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +@Service +public class DepartmentInfoServiceImpl extends ServiceImpl implements DepartmentInfoService { +} diff --git a/web/web-admin/src/main/resources/mapper/GraphInfoMapper.xml b/web/web-admin/src/main/resources/mapper/GraphInfoMapper.xml index 567c5df..fce98f2 100644 --- a/web/web-admin/src/main/resources/mapper/GraphInfoMapper.xml +++ b/web/web-admin/src/main/resources/mapper/GraphInfoMapper.xml @@ -4,7 +4,6 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> -