This commit is contained in:
BLRTTX 2024-12-20 12:07:55 +08:00
parent 7062ae55a4
commit c5f318cc43
10 changed files with 111 additions and 27 deletions

View File

@ -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;
}

View File

@ -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<String> upload(@RequestParam MultipartFile file) throws ServerException, InsufficientDataException, ErrorResponseException, IOException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException {
String url = service.upload(file);
return Result.ok(url);
}
}

View File

@ -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<String> 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<List<GraphInfo>> getAllGraph() {
return Result.ok(service.list());
}
}

View File

@ -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<IPage<UserAppointment>> getAppointmentPageItem(@RequestParam Integer current, @RequestParam Integer size, @RequestParam(required = false) Long userId) {
Page<UserAppointment> page = new Page<>(current, size);
IPage<UserAppointment> userAppointmentIPage = service.pageItem(page,userId);
IPage<UserAppointment> userAppointmentIPage = service.pageItem(page, userId);
return Result.ok(userAppointmentIPage);
}
@Operation(summary = "修改就诊状态")
@PostMapping("updateAppointmentState")
public Result updateAppointmentState(@RequestParam Long id) {
UpdateWrapper<UserAppointment> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("id", id).set("state", AppointmentStatus.ALREADY);
service.update(updateWrapper);
return Result.ok();
}
}

View File

@ -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<DepartmentInfo> {
}

View File

@ -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<DepartmentInfo> {
}

View File

@ -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<DepartmentInfoMapper, DepartmentInfo> implements DepartmentInfoService {
}

View File

@ -4,7 +4,6 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.atjy.web.admin.mapper.GraphInfoMapper">
<select id="selectListByItemTypeAndId" resultType="com.atjy.web.admin.vo.graph.GraphVo">
select name,
url

View File

@ -1,7 +0,0 @@
package com.atjy.web.app.mapper;
import com.atjy.model.entity.DepartmentInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface DepartmentMapper extends BaseMapper<DepartmentInfo> {
}

View File

@ -8,7 +8,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
public interface GraphInfoMapper extends BaseMapper<GraphInfo> {
List<GraphVo> selectListByItemTypeAndId(GraphItemType itemType, Long id);
}