From b8284926b136d412427516a595fab4143e381305 Mon Sep 17 00:00:00 2001 From: BLRTTX <2232721325@qq.com> Date: Mon, 23 Dec 2024 01:59:52 +0800 Subject: [PATCH] 12.23 --- .../doctor/DoctorInfoController.java | 8 +++++ .../hospital/HospitalInfoController.java | 11 ++++-- .../hospital/HospitalLabelController.java | 4 +-- .../user/UserAppointmentController.java | 8 +++-- .../controller/user/UserInfoController.java | 10 ++++-- .../custom/config/Knife4jConfiguration.java | 6 ++-- .../web/admin/mapper/DistrictInfoMapper.java | 7 ++++ .../web/admin/mapper/DoctorInfoMapper.java | 5 +++ .../web/admin/mapper/HospitalInfoMapper.java | 6 ++++ .../web/admin/service/DoctorInfoService.java | 3 ++ .../admin/service/HospitalInfoService.java | 4 ++- .../service/impl/DoctorInfoServiceImpl.java | 6 ++++ .../service/impl/HospitalInfoServiceImpl.java | 36 +++++++++++++------ .../src/main/resources/application.yml | 13 +++++-- .../resources/mapper/ArticleInfoMapper.xml | 4 +-- .../resources/mapper/DoctorInfoMapper.xml | 8 ++++- .../resources/mapper/HospitalInfoMapper.xml | 27 ++++++++++++++ .../src/main/resources/application.yml | 6 ++-- 18 files changed, 139 insertions(+), 33 deletions(-) create mode 100644 web/web-admin/src/main/java/com/atjy/web/admin/mapper/DistrictInfoMapper.java diff --git a/web/web-admin/src/main/java/com/atjy/web/admin/controller/doctor/DoctorInfoController.java b/web/web-admin/src/main/java/com/atjy/web/admin/controller/doctor/DoctorInfoController.java index af316f9..7c88df0 100644 --- a/web/web-admin/src/main/java/com/atjy/web/admin/controller/doctor/DoctorInfoController.java +++ b/web/web-admin/src/main/java/com/atjy/web/admin/controller/doctor/DoctorInfoController.java @@ -3,6 +3,7 @@ package com.atjy.web.admin.controller.doctor; import com.atjy.common.result.Result; import com.atjy.web.admin.service.DoctorInfoService; import com.atjy.web.admin.vo.doctor.DoctorInfoVo; +import com.atjy.web.admin.vo.doctor.DoctorVo; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.v3.oas.annotations.Operation; @@ -41,4 +42,11 @@ public class DoctorInfoController { service.deleteDoctor(ids); return Result.ok(); } + + @Operation(summary = "获取全部医生") + @GetMapping("getAllDoctor") + public Result> getAllDoctor() { + List result = service.getAllDoctor(); + return Result.ok(result); + } } diff --git a/web/web-admin/src/main/java/com/atjy/web/admin/controller/hospital/HospitalInfoController.java b/web/web-admin/src/main/java/com/atjy/web/admin/controller/hospital/HospitalInfoController.java index c21a02a..7776217 100644 --- a/web/web-admin/src/main/java/com/atjy/web/admin/controller/hospital/HospitalInfoController.java +++ b/web/web-admin/src/main/java/com/atjy/web/admin/controller/hospital/HospitalInfoController.java @@ -22,9 +22,9 @@ public class HospitalInfoController { @Operation(summary = "根据条件分页查询医院") @PostMapping("getHospitalPageItem") - public Result> getHospitalPageItem(@RequestParam Integer current, @RequestParam Integer size, @RequestParam(required = false) String name) { + public Result> getHospitalPageItem(@RequestParam Integer current, @RequestParam Integer size, @RequestParam(required = false) String name, @RequestParam(required = false) String districtName) { Page page = new Page<>(current, size); - IPage result = service.getHospitalPageItem(page, name); + IPage result = service.getHospitalPageItem(page, name, districtName); return Result.ok(result); } @@ -41,4 +41,11 @@ public class HospitalInfoController { service.deleteHospital(ids); return Result.ok(); } + + @Operation(summary = "获取全部医院") + @GetMapping("getAllHospital") + public Result> getAllHospital() { + List result = service.getAllHospital(); + return Result.ok(result); + } } diff --git a/web/web-admin/src/main/java/com/atjy/web/admin/controller/hospital/HospitalLabelController.java b/web/web-admin/src/main/java/com/atjy/web/admin/controller/hospital/HospitalLabelController.java index a2f2544..d417884 100644 --- a/web/web-admin/src/main/java/com/atjy/web/admin/controller/hospital/HospitalLabelController.java +++ b/web/web-admin/src/main/java/com/atjy/web/admin/controller/hospital/HospitalLabelController.java @@ -42,8 +42,8 @@ public class HospitalLabelController { @Operation(summary = "删除医院-标签") @PostMapping("deleteHospitalLabel") - public Result deleteHospitalLabel(@RequestParam Long hospitalId, @RequestParam String getLabelName) { - service.remove(new LambdaQueryWrapper().eq(HospitalLabel::getHospitalId, hospitalId).eq(HospitalLabel::getLabelName, getLabelName)); + public Result deleteHospitalLabel(@RequestParam Long hospitalId, @RequestParam String labelName) { + service.remove(new LambdaQueryWrapper().eq(HospitalLabel::getHospitalId, hospitalId).eq(HospitalLabel::getLabelName, labelName)); return Result.ok(); } diff --git a/web/web-admin/src/main/java/com/atjy/web/admin/controller/user/UserAppointmentController.java b/web/web-admin/src/main/java/com/atjy/web/admin/controller/user/UserAppointmentController.java index 69e88fa..8b99465 100644 --- a/web/web-admin/src/main/java/com/atjy/web/admin/controller/user/UserAppointmentController.java +++ b/web/web-admin/src/main/java/com/atjy/web/admin/controller/user/UserAppointmentController.java @@ -31,9 +31,13 @@ public class UserAppointmentController { @Operation(summary = "修改就诊状态") @PostMapping("updateAppointmentState") - public Result updateAppointmentState(@RequestParam Long id) { + public Result updateAppointmentState(@RequestParam Long id, @RequestParam Integer state) { UpdateWrapper updateWrapper = new UpdateWrapper<>(); - updateWrapper.eq("id", id).set("state", AppointmentStatus.ALREADY); + if (state > 1) { + updateWrapper.eq("id", id).set("state", AppointmentStatus.WAIT); + } else { + 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/controller/user/UserInfoController.java b/web/web-admin/src/main/java/com/atjy/web/admin/controller/user/UserInfoController.java index 0be17ed..eb4d039 100644 --- a/web/web-admin/src/main/java/com/atjy/web/admin/controller/user/UserInfoController.java +++ b/web/web-admin/src/main/java/com/atjy/web/admin/controller/user/UserInfoController.java @@ -36,15 +36,19 @@ public class UserInfoController { @Operation(summary = "修改用户状态") @PostMapping("updateUserInfoState") - public Result updateUserInfoState(@RequestParam Long id) { + public Result updateUserInfoState(@RequestParam Long id, @RequestParam Integer state) { UpdateWrapper updateWrapper = new UpdateWrapper<>(); - updateWrapper.eq("id", id).set("state", BaseStatus.DISABLE); + if (state > 0) { + updateWrapper.eq("id", id).set("state", BaseStatus.DISABLE); + } else { + updateWrapper.eq("id", id).set("state", BaseStatus.ENABLE); + } service.update(updateWrapper); return Result.ok(); } @Operation(summary = "删除用户信息") - @PostMapping("deletedUserInfo") + @PostMapping("deleteUserInfo") public Result deletedUserInfo(@RequestParam Long id) { service.deletedUserInfo(id); return Result.ok(); diff --git a/web/web-admin/src/main/java/com/atjy/web/admin/custom/config/Knife4jConfiguration.java b/web/web-admin/src/main/java/com/atjy/web/admin/custom/config/Knife4jConfiguration.java index 107aa09..f1369a3 100644 --- a/web/web-admin/src/main/java/com/atjy/web/admin/custom/config/Knife4jConfiguration.java +++ b/web/web-admin/src/main/java/com/atjy/web/admin/custom/config/Knife4jConfiguration.java @@ -46,11 +46,11 @@ public class Knife4jConfiguration { } @Bean - public GroupedOpenApi myselfAPI() { + public GroupedOpenApi userAPI() { - return GroupedOpenApi.builder().group("个人中心管理"). + return GroupedOpenApi.builder().group("用户管理"). pathsToMatch( - "/admin/center/**" + "/admin/user/**" ). build(); } diff --git a/web/web-admin/src/main/java/com/atjy/web/admin/mapper/DistrictInfoMapper.java b/web/web-admin/src/main/java/com/atjy/web/admin/mapper/DistrictInfoMapper.java new file mode 100644 index 0000000..059038e --- /dev/null +++ b/web/web-admin/src/main/java/com/atjy/web/admin/mapper/DistrictInfoMapper.java @@ -0,0 +1,7 @@ +package com.atjy.web.admin.mapper; + +import com.atjy.model.entity.DistrictInfo; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +public interface DistrictInfoMapper extends BaseMapper { +} diff --git a/web/web-admin/src/main/java/com/atjy/web/admin/mapper/DoctorInfoMapper.java b/web/web-admin/src/main/java/com/atjy/web/admin/mapper/DoctorInfoMapper.java index b5b3219..e05264c 100644 --- a/web/web-admin/src/main/java/com/atjy/web/admin/mapper/DoctorInfoMapper.java +++ b/web/web-admin/src/main/java/com/atjy/web/admin/mapper/DoctorInfoMapper.java @@ -2,12 +2,17 @@ package com.atjy.web.admin.mapper; import com.atjy.model.entity.DoctorInfo; import com.atjy.web.admin.vo.doctor.DoctorInfoVo; +import com.atjy.web.admin.vo.doctor.DoctorVo; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import java.util.List; + public interface DoctorInfoMapper extends BaseMapper { IPage getDoctorPageItem(Page page); IPage getDoctorPageItemByName(Page page, String name); + + List getAllDoctor(); } diff --git a/web/web-admin/src/main/java/com/atjy/web/admin/mapper/HospitalInfoMapper.java b/web/web-admin/src/main/java/com/atjy/web/admin/mapper/HospitalInfoMapper.java index 4ed1636..89aab23 100644 --- a/web/web-admin/src/main/java/com/atjy/web/admin/mapper/HospitalInfoMapper.java +++ b/web/web-admin/src/main/java/com/atjy/web/admin/mapper/HospitalInfoMapper.java @@ -6,9 +6,15 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import java.util.List; + public interface HospitalInfoMapper extends BaseMapper { IPage getHospitalPageItem(Page page); IPage getHospitalPageItemByName(Page page, String name); + + IPage getHospitalPageItemByDistrictName(Page page, String districtName); + + List getAllHospital(); } diff --git a/web/web-admin/src/main/java/com/atjy/web/admin/service/DoctorInfoService.java b/web/web-admin/src/main/java/com/atjy/web/admin/service/DoctorInfoService.java index 2f7c3f4..10d7143 100644 --- a/web/web-admin/src/main/java/com/atjy/web/admin/service/DoctorInfoService.java +++ b/web/web-admin/src/main/java/com/atjy/web/admin/service/DoctorInfoService.java @@ -2,6 +2,7 @@ package com.atjy.web.admin.service; import com.atjy.model.entity.DoctorInfo; import com.atjy.web.admin.vo.doctor.DoctorInfoVo; +import com.atjy.web.admin.vo.doctor.DoctorVo; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; @@ -14,4 +15,6 @@ public interface DoctorInfoService extends IService { void saveOrUpdateDoctor(DoctorInfoVo doctorInfoVo); void deleteDoctor(List ids); + + List getAllDoctor(); } diff --git a/web/web-admin/src/main/java/com/atjy/web/admin/service/HospitalInfoService.java b/web/web-admin/src/main/java/com/atjy/web/admin/service/HospitalInfoService.java index bada799..6ec74c5 100644 --- a/web/web-admin/src/main/java/com/atjy/web/admin/service/HospitalInfoService.java +++ b/web/web-admin/src/main/java/com/atjy/web/admin/service/HospitalInfoService.java @@ -10,9 +10,11 @@ import com.baomidou.mybatisplus.extension.service.IService; import java.util.List; public interface HospitalInfoService extends IService { - IPage getHospitalPageItem(Page page,String name); + IPage getHospitalPageItem(Page page, String name, String districtName); void saveOrUpdateHospital(HospitalInfoVo hospitalInfoVo); void deleteHospital(List ids); + + List getAllHospital(); } diff --git a/web/web-admin/src/main/java/com/atjy/web/admin/service/impl/DoctorInfoServiceImpl.java b/web/web-admin/src/main/java/com/atjy/web/admin/service/impl/DoctorInfoServiceImpl.java index 76ea02c..ac96661 100644 --- a/web/web-admin/src/main/java/com/atjy/web/admin/service/impl/DoctorInfoServiceImpl.java +++ b/web/web-admin/src/main/java/com/atjy/web/admin/service/impl/DoctorInfoServiceImpl.java @@ -7,6 +7,7 @@ import com.atjy.model.enums.GraphItemType; import com.atjy.web.admin.mapper.*; import com.atjy.web.admin.service.DoctorInfoService; import com.atjy.web.admin.vo.doctor.DoctorInfoVo; +import com.atjy.web.admin.vo.doctor.DoctorVo; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -109,4 +110,9 @@ public class DoctorInfoServiceImpl extends ServiceImpl getAllDoctor() { + return doctorInfoMapper.getAllDoctor(); + } } diff --git a/web/web-admin/src/main/java/com/atjy/web/admin/service/impl/HospitalInfoServiceImpl.java b/web/web-admin/src/main/java/com/atjy/web/admin/service/impl/HospitalInfoServiceImpl.java index 20edb26..e7610e4 100644 --- a/web/web-admin/src/main/java/com/atjy/web/admin/service/impl/HospitalInfoServiceImpl.java +++ b/web/web-admin/src/main/java/com/atjy/web/admin/service/impl/HospitalInfoServiceImpl.java @@ -41,11 +41,16 @@ public class HospitalInfoServiceImpl extends ServiceImpl getHospitalPageItem(Page page, String name) { + public IPage getHospitalPageItem(Page page, String name, String districtName) { IPage result; if (name != null) { result = hospitalInfoMapper.getHospitalPageItemByName(page, name); + } else if (districtName != null) { + result = hospitalInfoMapper.getHospitalPageItemByDistrictName(page, districtName); } else { result = hospitalInfoMapper.getHospitalPageItem(page); } @@ -54,23 +59,28 @@ public class HospitalInfoServiceImpl extends ServiceImpl().eq(DistrictInfo::getName, hospitalInfoVo.getDistrictName())).getId(); + HospitalInfo hospitalInfo = new HospitalInfo(); - Long provinceId = hospitalInfoVo.getDistrictId() / 10000L; - Long cityId = hospitalInfoVo.getDistrictId() / 100L; + Long provinceId = districtId / 10000L; + Long cityId = districtId / 100L; hospitalInfo.setHospitalName(hospitalInfoVo.getHospitalName()); hospitalInfo.setProvinceId(provinceId); hospitalInfo.setProvinceName(provinceInfoMapper.selectOne(new LambdaQueryWrapper().eq(ProvinceInfo::getId, provinceId)).getName()); hospitalInfo.setCityId(cityId); hospitalInfo.setCityName(cityInfoMapper.selectOne(new LambdaQueryWrapper().eq(CityInfo::getId, cityId)).getName()); - hospitalInfo.setDistrictId(hospitalInfoVo.getDistrictId()); + hospitalInfo.setDistrictId(districtId); hospitalInfo.setDistrictName(hospitalInfoVo.getDistrictName()); - hospitalInfo.setAddress(hospitalInfo.getAddress()); - hospitalInfo.setIntroduction(hospitalInfo.getIntroduction()); - hospitalInfo.setAppointmentNumber(hospitalInfo.getAppointmentNumber()); - hospitalInfo.setLevel(hospitalInfo.getLevel()); - hospitalInfo.setPhone(hospitalInfo.getPhone()); + hospitalInfo.setAddress(hospitalInfoVo.getAddress()); + hospitalInfo.setIntroduction(hospitalInfoVo.getIntroduction()); + hospitalInfo.setAppointmentNumber(hospitalInfoVo.getAppointmentNumber()); + hospitalInfo.setLevel(hospitalInfoVo.getLevel()); + hospitalInfo.setPhone(hospitalInfoVo.getPhone()); hospitalInfo.setIsDeleted((byte) 0); + if (hospitalInfoVo.getId() != null) { + hospitalInfo.setId(hospitalInfoVo.getId()); + } hospitalInfoMapper.insertOrUpdate(hospitalInfo); @@ -85,14 +95,13 @@ public class HospitalInfoServiceImpl extends ServiceImpl().eq(GraphInfo::getItemId, hospitalInfo.getId()).eq(GraphInfo::getItemType, GraphItemType.DOCTOR)) != null) { + if (graphInfoMapper.selectOne(new LambdaQueryWrapper().eq(GraphInfo::getItemId, hospitalInfo.getId()).eq(GraphInfo::getItemType, GraphItemType.HOSPITAL)) != null) { graphInfoMapper.update(new UpdateWrapper().eq("item_type", GraphItemType.HOSPITAL).eq("item_id", hospitalInfo.getId()).set("name", hospitalInfoVo.getGraphName()).set("url", hospitalInfoVo.getUrl())); } else { graphInfoMapper.insertOrUpdate(graphInfo); } } - graphInfoMapper.insertOrUpdate(graphInfo); } @Override @@ -115,4 +124,9 @@ public class HospitalInfoServiceImpl extends ServiceImpl getAllHospital() { + return hospitalInfoMapper.getAllHospital(); + } } diff --git a/web/web-admin/src/main/resources/application.yml b/web/web-admin/src/main/resources/application.yml index 63568ec..4163213 100644 --- a/web/web-admin/src/main/resources/application.yml +++ b/web/web-admin/src/main/resources/application.yml @@ -3,9 +3,9 @@ server: spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver - username: root - password: Atjy.000000 - url: jdbc:mysql://192.168.47.101:3306/hassle_free?useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2b8 + username: 202201020331 + password: "@hnucm1254" + url: jdbc:mysql://10.33.66.120:3306/bigcoursedesign202201020331?useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2b8 hikari: connection-test-query: SELECT 1 # 自动检测连接 connection-timeout: 60000 #数据库连接超时时间,默认30秒 @@ -24,6 +24,13 @@ spring: port: 6379 database: 0 + servlet: + multipart: + # 单个文件最大大小 + max-file-size: 50MB + # 所有上传文件最大大小 + max-request-size: 50MB + mybatis-plus: configuration: log-impl: org.apache.ibatis.logging.stdout.StdOutImpl diff --git a/web/web-admin/src/main/resources/mapper/ArticleInfoMapper.xml b/web/web-admin/src/main/resources/mapper/ArticleInfoMapper.xml index a1b975b..9044704 100644 --- a/web/web-admin/src/main/resources/mapper/ArticleInfoMapper.xml +++ b/web/web-admin/src/main/resources/mapper/ArticleInfoMapper.xml @@ -32,7 +32,7 @@ end as type_name from article_info ai join doctor_info di on ai.doctor_id = di.id and di.is_deleted = 0 - join hassle_free.graph_info gi on gi.item_type = 4 and gi.item_id = ai.id and gi.is_deleted = 0 + join graph_info gi on gi.item_type = 4 and gi.item_id = ai.id and gi.is_deleted = 0 and ai.is_deleted = 0 @@ -56,7 +56,7 @@ end as type_name from article_info ai join doctor_info di on ai.doctor_id = di.id and di.is_deleted = 0 - join hassle_free.graph_info gi on gi.item_type = 4 and gi.item_id = ai.id and gi.is_deleted = 0 + join graph_info gi on gi.item_type = 4 and gi.item_id = ai.id and gi.is_deleted = 0 and ai.is_deleted = 0 and ai.title_big like '%${title}%' diff --git a/web/web-admin/src/main/resources/mapper/DoctorInfoMapper.xml b/web/web-admin/src/main/resources/mapper/DoctorInfoMapper.xml index f364764..a04e9c6 100644 --- a/web/web-admin/src/main/resources/mapper/DoctorInfoMapper.xml +++ b/web/web-admin/src/main/resources/mapper/DoctorInfoMapper.xml @@ -24,7 +24,6 @@ where di.is_deleted = 0 - + + \ No newline at end of file diff --git a/web/web-admin/src/main/resources/mapper/HospitalInfoMapper.xml b/web/web-admin/src/main/resources/mapper/HospitalInfoMapper.xml index 9a725ca..7c030b2 100644 --- a/web/web-admin/src/main/resources/mapper/HospitalInfoMapper.xml +++ b/web/web-admin/src/main/resources/mapper/HospitalInfoMapper.xml @@ -47,4 +47,31 @@ and hi.hospital_name like '%${name}%' + + + \ No newline at end of file diff --git a/web/web-app/src/main/resources/application.yml b/web/web-app/src/main/resources/application.yml index 668435a..828e839 100644 --- a/web/web-app/src/main/resources/application.yml +++ b/web/web-app/src/main/resources/application.yml @@ -3,9 +3,9 @@ server: spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver - username: root - password: Atjy.000000 - url: jdbc:mysql://192.168.47.101:3306/hassle_free?useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2b8 + username: 202201020331 + password: "@hnucm1254" + url: jdbc:mysql://10.33.66.120:3306/bigcoursedesign202201020331?useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2b8 hikari: connection-test-query: SELECT 1 # 自动检测连接 connection-timeout: 60000 #数据库连接超时时间,默认30秒