12.19
This commit is contained in:
parent
2195c466bd
commit
84162f22d3
|
@ -17,9 +17,9 @@ public class UserAppointment extends BaseEntity {
|
|||
@TableField(value = "user_id")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "预约时间id")
|
||||
@TableField(value = "appointment_id")
|
||||
private Long appointmentId;
|
||||
@Schema(description = "预约时间")
|
||||
@TableField(value = "appointmentDate")
|
||||
private String appointmentDate;
|
||||
|
||||
@Schema(description = "状态")
|
||||
@TableField(value = "state")
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
package com.atjy.web.admin.controller.appointment;
|
||||
|
||||
import com.atjy.common.result.Result;
|
||||
import com.atjy.model.entity.AppointmentInfo;
|
||||
import com.atjy.web.admin.service.AppointmentInfoService;
|
||||
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.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "预约信息管理")
|
||||
@RestController
|
||||
@RequestMapping("/admin/appointment")
|
||||
public class AppointmentController {
|
||||
|
||||
@Autowired
|
||||
private AppointmentInfoService service;
|
||||
|
||||
@Operation(summary = "获取全部预约日期")
|
||||
@GetMapping("getAllAppointmentDate")
|
||||
public Result<List<AppointmentInfo>> getAllAppointmentDate() {
|
||||
return Result.ok(service.list());
|
||||
}
|
||||
|
||||
@Operation(summary = "删除预约日期")
|
||||
@PostMapping("deleteAppointmentDate")
|
||||
public Result deleteAppointmentDate(@RequestParam Long id) {
|
||||
service.deleteAppointmentDate(id);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "增加预约日期")
|
||||
@PostMapping("addAppointmentDate")
|
||||
public Result addAppointmentDate(@RequestParam String date) {
|
||||
AppointmentInfo appointmentInfo = new AppointmentInfo();
|
||||
appointmentInfo.setAppointmentDate(date);
|
||||
service.saveOrUpdate(appointmentInfo);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package com.atjy.web.admin.controller.myself;
|
||||
|
||||
import com.atjy.common.result.Result;
|
||||
import com.atjy.model.entity.UserAppointment;
|
||||
import com.atjy.web.admin.service.UserAppointmentService;
|
||||
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.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "就诊信息管理")
|
||||
@RestController
|
||||
@RequestMapping("/admin/center/appointment")
|
||||
public class UserAppointmentController {
|
||||
|
||||
@Autowired
|
||||
private UserAppointmentService service;
|
||||
|
||||
@Operation(summary = "获取全部就诊详情")
|
||||
@GetMapping("getAllAppointment")
|
||||
public Result<List<UserAppointment>> getAllAppointment() {
|
||||
return Result.ok(service.list());
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package com.atjy.web.admin.mapper;
|
||||
|
||||
import com.atjy.model.entity.AppointmentInfo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
public interface AppointmentInfoMapper extends BaseMapper<AppointmentInfo> {
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.atjy.web.admin.mapper;
|
||||
|
||||
import com.atjy.model.entity.DoctorAppointment;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DoctorAppointmentMapper extends BaseMapper<DoctorAppointment> {
|
||||
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.atjy.web.admin.mapper;
|
||||
|
||||
import com.atjy.model.entity.UserAppointment;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface UserAppointmentMapper extends BaseMapper<UserAppointment> {
|
||||
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.atjy.web.admin.service;
|
||||
|
||||
import com.atjy.model.entity.AppointmentInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
public interface AppointmentInfoService extends IService<AppointmentInfo> {
|
||||
void deleteAppointmentDate(Long id);
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.atjy.web.admin.service;
|
||||
|
||||
import com.atjy.model.entity.UserAppointment;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
public interface UserAppointmentService extends IService<UserAppointment> {
|
||||
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package com.atjy.web.admin.service.impl;
|
||||
|
||||
import com.atjy.common.exception.HassleFreeException;
|
||||
import com.atjy.common.result.ResultCodeEnum;
|
||||
import com.atjy.model.entity.AppointmentInfo;
|
||||
import com.atjy.model.entity.DoctorAppointment;
|
||||
import com.atjy.model.entity.UserAppointment;
|
||||
import com.atjy.web.admin.mapper.AppointmentInfoMapper;
|
||||
import com.atjy.web.admin.mapper.DoctorAppointmentMapper;
|
||||
import com.atjy.web.admin.mapper.UserAppointmentMapper;
|
||||
import com.atjy.web.admin.service.AppointmentInfoService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mysql.cj.log.Log;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.checkerframework.checker.index.qual.SubstringIndexUnknown;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class AppointmentInfoServiceImpl extends ServiceImpl<AppointmentInfoMapper, AppointmentInfo> implements AppointmentInfoService {
|
||||
|
||||
@Autowired
|
||||
private AppointmentInfoMapper appointmentInfoMapper;
|
||||
|
||||
@Autowired
|
||||
private DoctorAppointmentMapper doctorAppointmentMapper;
|
||||
|
||||
@Override
|
||||
public void deleteAppointmentDate(Long id) {
|
||||
String date = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
|
||||
List<DoctorAppointment> doctorAppointmentList = doctorAppointmentMapper.selectList(new LambdaQueryWrapper<DoctorAppointment>().eq(DoctorAppointment::getAppointmentId, id));
|
||||
if (appointmentInfoMapper.selectById(id).getAppointmentDate().compareTo(date) < 0) {
|
||||
ArrayList<Long> ids = new ArrayList<>();
|
||||
for (DoctorAppointment doctorAppointment : doctorAppointmentList) {
|
||||
ids.add(doctorAppointment.getId());
|
||||
}
|
||||
doctorAppointmentMapper.deleteByIds(ids);
|
||||
appointmentInfoMapper.deleteById(id);
|
||||
} else {
|
||||
if (!doctorAppointmentList.isEmpty()) {
|
||||
throw new HassleFreeException(ResultCodeEnum.DELETE_ERROR);
|
||||
} else {
|
||||
appointmentInfoMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.atjy.web.admin.service.impl;
|
||||
|
||||
import com.atjy.model.entity.UserAppointment;
|
||||
import com.atjy.web.admin.mapper.UserAppointmentMapper;
|
||||
import com.atjy.web.admin.service.UserAppointmentService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class UserAppointmentServiceImpl extends ServiceImpl<UserAppointmentMapper, UserAppointment> implements UserAppointmentService {
|
||||
}
|
|
@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
@Tag(name = "预约信息")
|
||||
@RestController
|
||||
@RequestMapping("/app/appointment")
|
||||
public class Appointment {
|
||||
public class AppointmentController {
|
||||
|
||||
@Autowired
|
||||
private AppointmentInfoService service;
|
||||
|
@ -32,8 +32,8 @@ public class Appointment {
|
|||
|
||||
@Operation(summary = "生成预约订单")
|
||||
@PostMapping("setAppointmentOrder")
|
||||
public Result<AppointmentOrderVo> setAppointmentOrder(@RequestBody AppointmentSetOrderVo appointmentSetOrderVo) {
|
||||
public Result setAppointmentOrder(@RequestBody AppointmentSetOrderVo appointmentSetOrderVo) {
|
||||
service.setAppointmentOrder(appointmentSetOrderVo);
|
||||
return null;
|
||||
return Result.ok();
|
||||
}
|
||||
}
|
|
@ -9,7 +9,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Tag(name = "问诊管理")
|
||||
@Tag(name = "问诊信息")
|
||||
@RestController
|
||||
@RequestMapping("/app/ai")
|
||||
public class AiConsultController {
|
||||
|
|
|
@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "医生管理")
|
||||
@Tag(name = "医生信息")
|
||||
@RestController
|
||||
@RequestMapping("/app/doctor")
|
||||
public class DoctorController {
|
||||
|
|
|
@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "首页管理")
|
||||
@Tag(name = "首页信息")
|
||||
@RestController
|
||||
@RequestMapping("/app/homepage")
|
||||
public class HomepageController {
|
||||
|
|
|
@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "医院管理")
|
||||
@Tag(name = "医院信息")
|
||||
@RestController
|
||||
@RequestMapping("/app/hospital")
|
||||
public class HospitalController {
|
||||
|
|
|
@ -12,7 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
@Tag(name = "登录管理")
|
||||
@Tag(name = "登录信息")
|
||||
@RestController
|
||||
@RequestMapping("/app")
|
||||
public class LoginController {
|
||||
|
|
|
@ -12,13 +12,12 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "就诊信息")
|
||||
@RestController
|
||||
@RequestMapping("/app/center/appointment")
|
||||
public class AppointmentController {
|
||||
public class UserAppointmentController {
|
||||
|
||||
@Autowired
|
||||
private UserAppointmentService service;
|
|
@ -0,0 +1,7 @@
|
|||
package com.atjy.web.app.service;
|
||||
|
||||
import com.atjy.model.entity.DoctorAppointment;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
public interface DoctorAppointmentService extends IService<DoctorAppointment> {
|
||||
}
|
|
@ -63,9 +63,7 @@ public class AppointmentInfoServiceImpl extends ServiceImpl<AppointmentInfoMappe
|
|||
UserAppointment userAppointment = userAppointmentMapper.selectOne(new LambdaQueryWrapper<UserAppointment>()
|
||||
.eq(UserAppointment::getUserId, LoginUserHolder.getLoginUser().getUserId())
|
||||
.eq(UserAppointment::getDoctorId, id)
|
||||
.eq(UserAppointment::getAppointmentId, appointmentInfoMapper.selectOne(new LambdaQueryWrapper<AppointmentInfo>()
|
||||
.eq(AppointmentInfo::getAppointmentDate, date))
|
||||
.getId()));
|
||||
.eq(UserAppointment::getAppointmentDate, date));
|
||||
|
||||
HospitalInfo hospitalInfo = hospitalMapper.selectOne(new LambdaQueryWrapper<HospitalInfo>()
|
||||
.eq(HospitalInfo::getId, doctorMapper.selectOne(new LambdaQueryWrapper<DoctorInfo>()
|
||||
|
@ -93,9 +91,7 @@ public class AppointmentInfoServiceImpl extends ServiceImpl<AppointmentInfoMappe
|
|||
|
||||
userAppointment.setUserId(LoginUserHolder.getLoginUser().getUserId());
|
||||
userAppointment.setDoctorId(appointmentSetOrderVo.getId());
|
||||
userAppointment.setAppointmentId(appointmentInfoMapper.selectOne(new LambdaQueryWrapper<AppointmentInfo>()
|
||||
.eq(AppointmentInfo::getAppointmentDate, appointmentSetOrderVo.getAppointmentDate()))
|
||||
.getId());
|
||||
userAppointment.setAppointmentDate(appointmentSetOrderVo.getAppointmentDate());
|
||||
userAppointment.setState(AppointmentStatus.WAIT);
|
||||
userAppointment.setName(appointmentSetOrderVo.getName());
|
||||
userAppointment.setPhone(appointmentSetOrderVo.getPhone());
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
package com.atjy.web.app.service.impl;
|
||||
|
||||
import com.atjy.model.entity.DoctorAppointment;
|
||||
import com.atjy.web.app.mapper.DoctorAppointmentMapper;
|
||||
import com.atjy.web.app.service.DoctorAppointmentService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class DoctorAppointmentServiceImpl extends ServiceImpl<DoctorAppointmentMapper, DoctorAppointment> implements DoctorAppointmentService {
|
||||
}
|
|
@ -1,12 +1,8 @@
|
|||
package com.atjy.web.app.service.impl;
|
||||
|
||||
import com.atjy.model.entity.GraphInfo;
|
||||
import com.atjy.model.enums.GraphItemType;
|
||||
import com.atjy.web.app.mapper.GraphInfoMapper;
|
||||
import com.atjy.web.app.mapper.UserAppointmentMapper;
|
||||
import com.atjy.web.app.service.UserAppointmentService;
|
||||
import com.atjy.web.app.vo.appointment.AppointmentVo;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
ua.state,
|
||||
ua.fees,
|
||||
ua.name,
|
||||
ai.appointment_date,
|
||||
ua.appointment_date,
|
||||
di.doctor_name,
|
||||
di.hospital_name,
|
||||
di.level,
|
||||
|
@ -17,7 +17,6 @@
|
|||
di.briefly,
|
||||
di.url
|
||||
from user_appointment ua
|
||||
join appointment_info ai on ai.id = ua.appointment_id and ai.is_deleted = 0
|
||||
join (select hi.id hi_id,
|
||||
hi.hospital_name,
|
||||
di.id,
|
||||
|
@ -43,7 +42,7 @@
|
|||
ua.state,
|
||||
ua.fees,
|
||||
ua.name,
|
||||
ai.appointment_date,
|
||||
ua.appointment_date,
|
||||
di.doctor_name,
|
||||
di.hospital_name,
|
||||
di.level,
|
||||
|
@ -51,7 +50,6 @@
|
|||
di.briefly,
|
||||
di.url
|
||||
from user_appointment ua
|
||||
join appointment_info ai on ai.id = ua.appointment_id and ai.is_deleted = 0
|
||||
join (select hi.id hi_id,
|
||||
hi.hospital_name,
|
||||
di.id,
|
||||
|
|
Loading…
Reference in New Issue