This commit is contained in:
BLRTTX 2024-12-23 01:59:52 +08:00
parent e1abcbef16
commit b8284926b1
18 changed files with 139 additions and 33 deletions

View File

@ -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<List<DoctorVo>> getAllDoctor() {
List<DoctorVo> result = service.getAllDoctor();
return Result.ok(result);
}
}

View File

@ -22,9 +22,9 @@ public class HospitalInfoController {
@Operation(summary = "根据条件分页查询医院")
@PostMapping("getHospitalPageItem")
public Result<IPage<HospitalInfoVo>> getHospitalPageItem(@RequestParam Integer current, @RequestParam Integer size, @RequestParam(required = false) String name) {
public Result<IPage<HospitalInfoVo>> getHospitalPageItem(@RequestParam Integer current, @RequestParam Integer size, @RequestParam(required = false) String name, @RequestParam(required = false) String districtName) {
Page<HospitalInfoVo> page = new Page<>(current, size);
IPage<HospitalInfoVo> result = service.getHospitalPageItem(page, name);
IPage<HospitalInfoVo> 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<List<String>> getAllHospital() {
List<String> result = service.getAllHospital();
return Result.ok(result);
}
}

View File

@ -42,8 +42,8 @@ public class HospitalLabelController {
@Operation(summary = "删除医院-标签")
@PostMapping("deleteHospitalLabel")
public Result deleteHospitalLabel(@RequestParam Long hospitalId, @RequestParam String getLabelName) {
service.remove(new LambdaQueryWrapper<HospitalLabel>().eq(HospitalLabel::getHospitalId, hospitalId).eq(HospitalLabel::getLabelName, getLabelName));
public Result deleteHospitalLabel(@RequestParam Long hospitalId, @RequestParam String labelName) {
service.remove(new LambdaQueryWrapper<HospitalLabel>().eq(HospitalLabel::getHospitalId, hospitalId).eq(HospitalLabel::getLabelName, labelName));
return Result.ok();
}

View File

@ -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<UserAppointment> 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();
}

View File

@ -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<UserInfo> 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();

View File

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

View File

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

View File

@ -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<DoctorInfo> {
IPage<DoctorInfoVo> getDoctorPageItem(Page<DoctorInfoVo> page);
IPage<DoctorInfoVo> getDoctorPageItemByName(Page<DoctorInfoVo> page, String name);
List<DoctorVo> getAllDoctor();
}

View File

@ -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<HospitalInfo> {
IPage<HospitalInfoVo> getHospitalPageItem(Page<HospitalInfoVo> page);
IPage<HospitalInfoVo> getHospitalPageItemByName(Page<HospitalInfoVo> page, String name);
IPage<HospitalInfoVo> getHospitalPageItemByDistrictName(Page<HospitalInfoVo> page, String districtName);
List<String> getAllHospital();
}

View File

@ -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<DoctorInfo> {
void saveOrUpdateDoctor(DoctorInfoVo doctorInfoVo);
void deleteDoctor(List<Long> ids);
List<DoctorVo> getAllDoctor();
}

View File

@ -10,9 +10,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
public interface HospitalInfoService extends IService<HospitalInfo> {
IPage<HospitalInfoVo> getHospitalPageItem(Page<HospitalInfoVo> page,String name);
IPage<HospitalInfoVo> getHospitalPageItem(Page<HospitalInfoVo> page, String name, String districtName);
void saveOrUpdateHospital(HospitalInfoVo hospitalInfoVo);
void deleteHospital(List<Long> ids);
List<String> getAllHospital();
}

View File

@ -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<DoctorInfoMapper, DoctorI
doctorInfoMapper.deleteByIds(ids);
}
@Override
public List<DoctorVo> getAllDoctor() {
return doctorInfoMapper.getAllDoctor();
}
}

View File

@ -41,11 +41,16 @@ public class HospitalInfoServiceImpl extends ServiceImpl<HospitalInfoMapper, Hos
@Autowired
private CityInfoMapper cityInfoMapper;
@Autowired
private DistrictInfoMapper districtInfoMapper;
@Override
public IPage<HospitalInfoVo> getHospitalPageItem(Page<HospitalInfoVo> page, String name) {
public IPage<HospitalInfoVo> getHospitalPageItem(Page<HospitalInfoVo> page, String name, String districtName) {
IPage<HospitalInfoVo> 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<HospitalInfoMapper, Hos
@Override
public void saveOrUpdateHospital(HospitalInfoVo hospitalInfoVo) {
Long districtId = districtInfoMapper.selectOne(new LambdaQueryWrapper<DistrictInfo>().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<ProvinceInfo>().eq(ProvinceInfo::getId, provinceId)).getName());
hospitalInfo.setCityId(cityId);
hospitalInfo.setCityName(cityInfoMapper.selectOne(new LambdaQueryWrapper<CityInfo>().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<HospitalInfoMapper, Hos
graphInfo.setId(hospitalInfoVo.getUrlId());
graphInfoMapper.insertOrUpdate(graphInfo);
} else {
if (graphInfoMapper.selectOne(new LambdaQueryWrapper<GraphInfo>().eq(GraphInfo::getItemId, hospitalInfo.getId()).eq(GraphInfo::getItemType, GraphItemType.DOCTOR)) != null) {
if (graphInfoMapper.selectOne(new LambdaQueryWrapper<GraphInfo>().eq(GraphInfo::getItemId, hospitalInfo.getId()).eq(GraphInfo::getItemType, GraphItemType.HOSPITAL)) != null) {
graphInfoMapper.update(new UpdateWrapper<GraphInfo>().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<HospitalInfoMapper, Hos
hospitalInfoMapper.deleteByIds(ids);
}
@Override
public List<String> getAllHospital() {
return hospitalInfoMapper.getAllHospital();
}
}

View File

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

View File

@ -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
</select>
@ -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}%'
</select>

View File

@ -24,7 +24,6 @@
where di.is_deleted = 0
</select>
<select id="getDoctorPageItemByName" resultType="com.atjy.web.admin.vo.doctor.DoctorInfoVo">
select distinct di.id,
di.doctor_name,
@ -45,4 +44,11 @@
where di.is_deleted = 0
and di.doctor_name like '%${name}%'
</select>
<select id="getAllDoctor" resultType="com.atjy.web.admin.vo.doctor.DoctorVo">
select id doctor_id,
doctor_name name
from doctor_info
where is_deleted = 0;
</select>
</mapper>

View File

@ -47,4 +47,31 @@
and hi.hospital_name like '%${name}%'
</select>
<select id="getHospitalPageItemByDistrictName" resultType="com.atjy.web.admin.vo.hospital.HospitalInfoVo">
select distinct hi.id,
hi.hospital_name,
hi.province_id,
hi.province_name,
hi.city_id,
hi.city_name,
hi.district_id,
hi.district_name,
hi.address,
hi.introduction,
hi.appointment_number,
hi.phone,
hi.level,
gi.name graph_name,
gi.url
from hospital_info hi
join graph_info gi on gi.item_type = 2 and gi.item_id = hi.id and gi.is_deleted = 0
and hi.is_deleted = 0
and hi.district_name = #{districtName}
</select>
<select id="getAllHospital" resultType="java.lang.String">
select hospital_name
from hospital_info
where is_deleted = 0
</select>
</mapper>

View File

@ -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秒