新增科室预约工作时间维护页面
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package com.openhis.web.appointmentmanage.appservice;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.appointmentmanage.domain.DeptAppointmentHours;
|
||||
|
||||
public interface IDeptAppointmentHoursAppService {
|
||||
|
||||
R<?> getDeptAppthoursList(DeptAppointmentHours deptAppointmentHours, Integer pageNum, Integer pageSize);
|
||||
|
||||
R<?> getDeptAppthoursDetail(Long id);
|
||||
|
||||
R<?> addDeptAppthours(DeptAppointmentHours deptAppointmentHours);
|
||||
|
||||
R<?> updateDeptAppthours(DeptAppointmentHours deptAppointmentHours);
|
||||
|
||||
R<?> deleteDeptAppthours(Long id);
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package com.openhis.web.appointmentmanage.appservice.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.appointmentmanage.domain.DeptAppointmentHours;
|
||||
import com.openhis.appointmentmanage.mapper.DeptAppointmentHoursMapper;
|
||||
import com.openhis.appointmentmanage.service.IDeptAppointmentHoursService;
|
||||
import com.openhis.web.appointmentmanage.appservice.IDeptAppointmentHoursAppService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class DeptAppointmentHoursAppServiceImpl implements IDeptAppointmentHoursAppService {
|
||||
|
||||
@Resource
|
||||
private IDeptAppointmentHoursService deptAppointmentHoursService;
|
||||
|
||||
@Resource
|
||||
private DeptAppointmentHoursMapper deptAppointmentHoursMapper;
|
||||
|
||||
@Override
|
||||
public R<?> getDeptAppthoursList(DeptAppointmentHours deptAppointmentHours, Integer pageNum, Integer pageSize) {
|
||||
LambdaQueryWrapper<DeptAppointmentHours> wrapper = new LambdaQueryWrapper<>();
|
||||
if (StrUtil.isNotBlank(deptAppointmentHours.getInstitution())) {
|
||||
wrapper.eq(DeptAppointmentHours::getInstitution, deptAppointmentHours.getInstitution());
|
||||
}
|
||||
if (StrUtil.isNotBlank(deptAppointmentHours.getDepartment())) {
|
||||
wrapper.eq(DeptAppointmentHours::getDepartment, deptAppointmentHours.getDepartment());
|
||||
}
|
||||
wrapper.orderByDesc(DeptAppointmentHours::getCreatedTime);
|
||||
|
||||
Page<DeptAppointmentHours> page = new Page<>(pageNum, pageSize);
|
||||
Page<DeptAppointmentHours> resultPage = deptAppointmentHoursMapper.selectPage(page, wrapper);
|
||||
|
||||
return R.ok(resultPage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> getDeptAppthoursDetail(Long id) {
|
||||
if (ObjectUtil.isNull(id)) {
|
||||
return R.fail("ID不能为空");
|
||||
}
|
||||
DeptAppointmentHours deptAppointmentHours = deptAppointmentHoursService.getById(id);
|
||||
if (ObjectUtil.isNull(deptAppointmentHours)) {
|
||||
return R.fail("数据不存在");
|
||||
}
|
||||
return R.ok(deptAppointmentHours);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> addDeptAppthours(DeptAppointmentHours deptAppointmentHours) {
|
||||
if (ObjectUtil.isNull(deptAppointmentHours)) {
|
||||
return R.fail("数据不能为空");
|
||||
}
|
||||
if (StrUtil.isBlank(deptAppointmentHours.getInstitution())) {
|
||||
return R.fail("所属机构不能为空");
|
||||
}
|
||||
if (StrUtil.isBlank(deptAppointmentHours.getDepartment())) {
|
||||
return R.fail("科室名称不能为空");
|
||||
}
|
||||
|
||||
deptAppointmentHours.setCreatedTime(LocalDateTime.now());
|
||||
boolean save = deptAppointmentHoursService.save(deptAppointmentHours);
|
||||
return R.ok(save);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> updateDeptAppthours(DeptAppointmentHours deptAppointmentHours) {
|
||||
if (ObjectUtil.isNull(deptAppointmentHours) || ObjectUtil.isNull(deptAppointmentHours.getId())) {
|
||||
return R.fail("ID不能为空");
|
||||
}
|
||||
|
||||
DeptAppointmentHours existing = deptAppointmentHoursService.getById(deptAppointmentHours.getId());
|
||||
if (ObjectUtil.isNull(existing)) {
|
||||
return R.fail("数据不存在");
|
||||
}
|
||||
|
||||
deptAppointmentHours.setUpdatedTime(LocalDateTime.now());
|
||||
boolean update = deptAppointmentHoursService.updateById(deptAppointmentHours);
|
||||
return R.ok(update);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> deleteDeptAppthours(Long id) {
|
||||
if (ObjectUtil.isNull(id)) {
|
||||
return R.fail("ID不能为空");
|
||||
}
|
||||
|
||||
DeptAppointmentHours existing = deptAppointmentHoursService.getById(id);
|
||||
if (ObjectUtil.isNull(existing)) {
|
||||
return R.fail("数据不存在");
|
||||
}
|
||||
|
||||
boolean remove = deptAppointmentHoursService.removeById(id);
|
||||
return R.ok(remove);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.openhis.web.appointmentmanage.controller;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.appointmentmanage.domain.DeptAppointmentHours;
|
||||
import com.openhis.web.appointmentmanage.appservice.IDeptAppointmentHoursAppService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 科室预约工作时间维护 Controller
|
||||
*
|
||||
* @author openhis
|
||||
* @date 2025-12-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/appoinment/dept-appthours")
|
||||
public class DeptAppthoursController {
|
||||
|
||||
@Resource
|
||||
private IDeptAppointmentHoursAppService deptAppointmentHoursAppService;
|
||||
|
||||
/**
|
||||
* 获取科室预约工作时间列表
|
||||
*
|
||||
* @param deptAppointmentHours 查询条件
|
||||
* @param pageNum 页码
|
||||
* @param pageSize 每页大小
|
||||
* @return 列表数据
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public R<?> getDeptAppthoursList(
|
||||
DeptAppointmentHours deptAppointmentHours,
|
||||
@RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(defaultValue = "10") Integer pageSize) {
|
||||
return deptAppointmentHoursAppService.getDeptAppthoursList(deptAppointmentHours, pageNum, pageSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取科室预约工作时间详情
|
||||
*
|
||||
* @param id 记录ID
|
||||
* @return 详情数据
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public R<?> getDeptAppthoursDetail(@PathVariable("id") Long id) {
|
||||
return deptAppointmentHoursAppService.getDeptAppthoursDetail(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增科室预约工作时间
|
||||
*
|
||||
* @param deptAppointmentHours 新增数据
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PostMapping
|
||||
public R<?> addDeptAppthours(@RequestBody DeptAppointmentHours deptAppointmentHours) {
|
||||
return deptAppointmentHoursAppService.addDeptAppthours(deptAppointmentHours);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改科室预约工作时间
|
||||
*
|
||||
* @param deptAppointmentHours 修改数据
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping
|
||||
public R<?> updateDeptAppthours(@RequestBody DeptAppointmentHours deptAppointmentHours) {
|
||||
return deptAppointmentHoursAppService.updateDeptAppthours(deptAppointmentHours);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除科室预约工作时间
|
||||
*
|
||||
* @param id 记录ID
|
||||
* @return 操作结果
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
public R<?> deleteDeptAppthours(@PathVariable("id") Long id) {
|
||||
return deptAppointmentHoursAppService.deleteDeptAppthours(id);
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,9 @@ core:
|
||||
|
||||
# 开发环境配置
|
||||
server:
|
||||
# 应用上下文路径
|
||||
servlet:
|
||||
context-path: /openhis
|
||||
tomcat:
|
||||
# tomcat的URI编码
|
||||
uri-encoding: UTF-8
|
||||
|
||||
Reference in New Issue
Block a user