96-门诊医生站会诊申请确认界面和97-门诊会诊申请管理界面全部功能。
This commit is contained in:
@@ -1,95 +0,0 @@
|
||||
package com.openhis.web.consultation.controller;
|
||||
|
||||
import com.core.common.core.controller.BaseController;
|
||||
import com.core.common.core.domain.AjaxResult;
|
||||
import com.core.common.annotation.Log;
|
||||
import com.core.common.enums.BusinessType;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.consultation.domain.ConsultationConfirmation;
|
||||
import com.openhis.consultation.service.IConsultationConfirmationService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会诊确认 Controller
|
||||
*
|
||||
* @author his
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/consultation/confirmation")
|
||||
public class ConsultationConfirmationController extends BaseController {
|
||||
@Autowired
|
||||
private IConsultationConfirmationService consultationConfirmationService;
|
||||
|
||||
/**
|
||||
* 查询会诊确认列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('consultation:confirmation:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(ConsultationConfirmation consultationConfirmation,
|
||||
@RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(defaultValue = "10") Integer pageSize) {
|
||||
LambdaQueryWrapper<ConsultationConfirmation> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(consultationConfirmation.getConsultationRequestId() != null,
|
||||
ConsultationConfirmation::getConsultationRequestId,
|
||||
consultationConfirmation.getConsultationRequestId())
|
||||
.eq(consultationConfirmation.getConfirmationStatus() != null,
|
||||
ConsultationConfirmation::getConfirmationStatus,
|
||||
consultationConfirmation.getConfirmationStatus())
|
||||
.orderByDesc(ConsultationConfirmation::getCreateTime);
|
||||
|
||||
Page<ConsultationConfirmation> page = new Page<>(pageNum, pageSize);
|
||||
Page<ConsultationConfirmation> result = consultationConfirmationService.page(page, queryWrapper);
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取会诊确认详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('consultation:confirmation:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(consultationConfirmationService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增会诊确认
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('consultation:confirmation:add')")
|
||||
@Log(title = "会诊确认", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ConsultationConfirmation consultationConfirmation) {
|
||||
consultationConfirmation.setCreatorId(getUserId());
|
||||
consultationConfirmation.setCreatorName(getUsername());
|
||||
return toAjax(consultationConfirmationService.save(consultationConfirmation));
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认会诊(同意或拒绝)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('consultation:confirmation:confirm')")
|
||||
@Log(title = "会诊确认", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/confirm")
|
||||
public AjaxResult confirm(@RequestBody ConsultationConfirmation consultationConfirmation) {
|
||||
// 设置确认日期
|
||||
consultationConfirmation.setConfirmationDate(LocalDateTime.now());
|
||||
consultationConfirmation.setUpdaterId(getUserId());
|
||||
consultationConfirmation.setUpdaterName(getUsername());
|
||||
return toAjax(consultationConfirmationService.updateById(consultationConfirmation));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会诊确认
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('consultation:confirmation:remove')")
|
||||
@Log(title = "会诊确认", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(consultationConfirmationService.removeByIds(java.util.Arrays.asList(ids)));
|
||||
}
|
||||
}
|
||||
@@ -41,12 +41,10 @@ public class ConsultationController {
|
||||
@ApiParam("就诊ID(可选,不传则查询当前医生的所有会诊申请)")
|
||||
@RequestParam(required = false) Long encounterId) {
|
||||
try {
|
||||
log.info("获取会诊列表,encounterId: {}", encounterId);
|
||||
List<ConsultationRequestDto> list = consultationAppService.getConsultationList(encounterId);
|
||||
log.info("获取会诊列表成功,共 {} 条记录", list != null ? list.size() : 0);
|
||||
return R.ok(list);
|
||||
} catch (Exception e) {
|
||||
log.error("获取会诊列表失败,encounterId: {}", encounterId, e);
|
||||
log.error("获取会诊列表失败", e);
|
||||
return R.fail("获取会诊列表失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
package com.openhis.web.consultation.controller;
|
||||
|
||||
import com.core.common.core.controller.BaseController;
|
||||
import com.core.common.core.domain.AjaxResult;
|
||||
import com.core.common.annotation.Log;
|
||||
import com.core.common.enums.BusinessType;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.consultation.domain.ConsultationRecord;
|
||||
import com.openhis.consultation.service.IConsultationRecordService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会诊记录 Controller
|
||||
*
|
||||
* @author his
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/consultation/record")
|
||||
public class ConsultationRecordController extends BaseController {
|
||||
@Autowired
|
||||
private IConsultationRecordService consultationRecordService;
|
||||
|
||||
/**
|
||||
* 查询会诊记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('consultation:record:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(ConsultationRecord consultationRecord,
|
||||
@RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(defaultValue = "10") Integer pageSize) {
|
||||
LambdaQueryWrapper<ConsultationRecord> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(consultationRecord.getConsultationRequestId() != null,
|
||||
ConsultationRecord::getConsultationRequestId,
|
||||
consultationRecord.getConsultationRequestId())
|
||||
.eq(consultationRecord.getParticipantDoctorId() != null,
|
||||
ConsultationRecord::getParticipantDoctorId,
|
||||
consultationRecord.getParticipantDoctorId())
|
||||
.orderByDesc(ConsultationRecord::getRecordDate);
|
||||
|
||||
Page<ConsultationRecord> page = new Page<>(pageNum, pageSize);
|
||||
Page<ConsultationRecord> result = consultationRecordService.page(page, queryWrapper);
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取会诊记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('consultation:record:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(consultationRecordService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增会诊记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('consultation:record:add')")
|
||||
@Log(title = "会诊记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ConsultationRecord consultationRecord) {
|
||||
consultationRecord.setCreatorId(getUserId());
|
||||
consultationRecord.setCreatorName(getUsername());
|
||||
return toAjax(consultationRecordService.save(consultationRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会诊记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('consultation:record:edit')")
|
||||
@Log(title = "会诊记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ConsultationRecord consultationRecord) {
|
||||
consultationRecord.setUpdaterId(getUserId());
|
||||
consultationRecord.setUpdaterName(getUsername());
|
||||
return toAjax(consultationRecordService.updateById(consultationRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会诊记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('consultation:record:remove')")
|
||||
@Log(title = "会诊记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(consultationRecordService.removeByIds(java.util.Arrays.asList(ids)));
|
||||
}
|
||||
}
|
||||
@@ -1,170 +0,0 @@
|
||||
package com.openhis.web.consultation.controller;
|
||||
|
||||
import com.core.common.core.controller.BaseController;
|
||||
import com.core.common.core.domain.AjaxResult;
|
||||
import com.core.common.annotation.Log;
|
||||
import com.core.common.enums.BusinessType;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.consultation.domain.ConsultationRequest;
|
||||
import com.openhis.consultation.service.IConsultationRequestService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会诊申请 Controller
|
||||
*
|
||||
* @author his
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/consultation/request")
|
||||
public class ConsultationRequestController extends BaseController {
|
||||
@Autowired
|
||||
private IConsultationRequestService consultationRequestService;
|
||||
|
||||
/**
|
||||
* 查询会诊申请列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('consultation:request:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(ConsultationRequest consultationRequest,
|
||||
@RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(defaultValue = "10") Integer pageSize) {
|
||||
LambdaQueryWrapper<ConsultationRequest> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.like(consultationRequest.getPatientName() != null, ConsultationRequest::getPatientName, consultationRequest.getPatientName())
|
||||
.eq(consultationRequest.getConsultationStatus() != null, ConsultationRequest::getConsultationStatus, consultationRequest.getConsultationStatus())
|
||||
.eq(consultationRequest.getConsultationActivityId() != null, ConsultationRequest::getConsultationActivityId, consultationRequest.getConsultationActivityId())
|
||||
.orderByDesc(ConsultationRequest::getConsultationRequestDate);
|
||||
|
||||
Page<ConsultationRequest> page = new Page<>(pageNum, pageSize);
|
||||
Page<ConsultationRequest> result = consultationRequestService.page(page, queryWrapper);
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取会诊申请详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('consultation:request:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(consultationRequestService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增会诊申请
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('consultation:request:add')")
|
||||
@Log(title = "会诊申请", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ConsultationRequest consultationRequest) {
|
||||
// 自动生成申请单号
|
||||
String consultationId = "CS" + LocalDateTime.now().toString().replaceAll("[^0-9]", "").substring(0, 14) + String.format("%04d", (int)(Math.random() * 10000));
|
||||
consultationRequest.setConsultationId(consultationId);
|
||||
|
||||
consultationRequest.setCreateBy(getUsername());
|
||||
consultationRequest.setConsultationRequestDate(LocalDateTime.now());
|
||||
consultationRequest.setConsultationStatus(0); // 新开状态
|
||||
return toAjax(consultationRequestService.save(consultationRequest));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会诊申请
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('consultation:request:edit')")
|
||||
@Log(title = "会诊申请", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ConsultationRequest consultationRequest) {
|
||||
consultationRequest.setUpdateBy(getUsername());
|
||||
return toAjax(consultationRequestService.updateById(consultationRequest));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会诊申请
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('consultation:request:remove')")
|
||||
@Log(title = "会诊申请", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(consultationRequestService.removeByIds(java.util.Arrays.asList(ids)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交会诊申请
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('consultation:request:submit')")
|
||||
@Log(title = "会诊申请", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/submit/{id}")
|
||||
public AjaxResult submit(@PathVariable Long id) {
|
||||
int result = consultationRequestService.submitConsultation(id, getUserId(), getUsername());
|
||||
return result > 0 ? AjaxResult.success("提交成功") : AjaxResult.error("提交失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消提交会诊申请
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('consultation:request:cancelSubmit')")
|
||||
@Log(title = "会诊申请", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/cancelSubmit/{id}")
|
||||
public AjaxResult cancelSubmit(@PathVariable Long id) {
|
||||
int result = consultationRequestService.cancelSubmitConsultation(id);
|
||||
return result > 0 ? AjaxResult.success("取消提交成功") : AjaxResult.error("取消提交失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 结束会诊申请
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('consultation:request:end')")
|
||||
@Log(title = "会诊申请", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/end/{id}")
|
||||
public AjaxResult end(@PathVariable Long id) {
|
||||
int result = consultationRequestService.endConsultation(id, getUserId(), getUsername());
|
||||
return result > 0 ? AjaxResult.success("结束成功") : AjaxResult.error("结束失败,请确保会诊已签名");
|
||||
}
|
||||
|
||||
/**
|
||||
* 作废会诊申请
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('consultation:request:cancel')")
|
||||
@Log(title = "会诊申请", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/cancel/{id}")
|
||||
public AjaxResult cancel(@PathVariable Long id) {
|
||||
int result = consultationRequestService.cancelConsultation(id, getUserId(), getUsername());
|
||||
return result > 0 ? AjaxResult.success("作废成功") : AjaxResult.error("作废失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认会诊
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('consultation:request:confirm')")
|
||||
@Log(title = "会诊申请", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/confirm")
|
||||
public AjaxResult confirm(@RequestBody ConsultationRequest request) {
|
||||
int result = consultationRequestService.confirmConsultation(
|
||||
request.getId(),
|
||||
request.getConfirmingPhysicianName(),
|
||||
String.valueOf(request.getConfirmingPhysicianId()),
|
||||
request.getConsultationOpinion()
|
||||
);
|
||||
return result > 0 ? AjaxResult.success("确认成功") : AjaxResult.error("确认失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 签名会诊
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('consultation:request:sign')")
|
||||
@Log(title = "会诊申请", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/sign")
|
||||
public AjaxResult sign(@RequestBody ConsultationRequest request) {
|
||||
int result = consultationRequestService.signConsultation(
|
||||
request.getId(),
|
||||
request.getSignature(),
|
||||
getUserId(),
|
||||
getUsername()
|
||||
);
|
||||
return result > 0 ? AjaxResult.success("签名成功") : AjaxResult.error("签名失败,请确保会诊已确认");
|
||||
}
|
||||
}
|
||||
@@ -3,20 +3,18 @@ package com.openhis.web.consultation.domain;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.apache.ibatis.type.Alias;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 会诊申请单实体类
|
||||
*
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-01-29
|
||||
*/
|
||||
@Data
|
||||
@TableName("consultation_request")
|
||||
@Alias("webConsultationRequest")
|
||||
public class ConsultationRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.openhis.web.consultation.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.web.consultation.domain.ConsultationRequest;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 会诊申请Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-01-29
|
||||
*/
|
||||
@Mapper
|
||||
public interface ConsultationRequestMapper extends BaseMapper<ConsultationRequest> {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user