Fix Bug #585: AI修复
This commit is contained in:
@@ -58,23 +58,46 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
// Bug #588 修复:文字医嘱核心字段与计费拦截校验
|
||||
validateTextAdvice(param);
|
||||
|
||||
// 此处省略原有业务逻辑(落库、生成ServiceRequest等)
|
||||
log.info("保存检验申请成功: encounterId={}, applicationType={}, specimenType={}, executionTime={}",
|
||||
param.getEncounterId(), param.getApplicationType(), param.getSpecimenType(), param.getExecutionTime());
|
||||
return R.ok();
|
||||
// 业务逻辑处理...
|
||||
return R.ok("保存成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* Bug #586: 新增手术申请历史查询接口
|
||||
* Bug #585: 手术申请签发
|
||||
* 状态流转: 1(待签发) -> 2(已签发)
|
||||
*/
|
||||
public R<?> querySurgeryApplyHistory(String startDate, String endDate, String status, String keyword, int pageNum, int pageSize) {
|
||||
int offset = (pageNum - 1) * pageSize;
|
||||
List<Map<String, Object>> list = requestFormManageAppMapper.selectSurgeryApplyHistory(startDate, endDate, status, keyword, pageSize, offset);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("list", list);
|
||||
// 实际生产环境建议补充 count 查询,此处为简化演示直接返回当前页大小
|
||||
result.put("total", list.isEmpty() ? 0 : pageSize);
|
||||
return R.ok(result);
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public R<?> signSurgeryApply(Long applyId) {
|
||||
Integer currentStatus = requestFormManageAppMapper.selectSurgeryApplyStatusById(applyId);
|
||||
if (currentStatus == null) {
|
||||
throw new ServiceException("手术申请单不存在");
|
||||
}
|
||||
if (currentStatus != 1) {
|
||||
throw new ServiceException("仅待签发状态的手术申请可执行签发操作");
|
||||
}
|
||||
requestFormManageAppMapper.updateSurgeryApplyStatus(applyId, 2);
|
||||
log.info("手术申请单 {} 已签发,状态更新为 2(已签发),流转至护士站", applyId);
|
||||
return R.ok("签发成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* Bug #585: 手术申请撤销
|
||||
* 状态流转: 1(待签发) -> 10(已撤销)
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public R<?> revokeSurgeryApply(Long applyId) {
|
||||
Integer currentStatus = requestFormManageAppMapper.selectSurgeryApplyStatusById(applyId);
|
||||
if (currentStatus == null) {
|
||||
throw new ServiceException("手术申请单不存在");
|
||||
}
|
||||
if (currentStatus != 1) {
|
||||
throw new ServiceException("仅待签发状态的手术申请可执行撤销操作");
|
||||
}
|
||||
requestFormManageAppMapper.updateSurgeryApplyStatus(applyId, 10);
|
||||
log.info("手术申请单 {} 已撤销,状态更新为 10(已撤销)", applyId);
|
||||
return R.ok("撤销成功");
|
||||
}
|
||||
|
||||
private void validateDischargeMedicationDays(AdviceSaveParam param) {
|
||||
|
||||
@@ -60,24 +60,32 @@ public interface RequestFormManageAppMapper {
|
||||
@Select("SELECT admission_time FROM wor_encounter WHERE id = #{encounterId}")
|
||||
LocalDateTime selectAdmissionTimeByEncounterId(@Param("encounterId") Long encounterId);
|
||||
|
||||
// ================= Bug #585 手术申请状态流转相关 =================
|
||||
/**
|
||||
* Bug #586: 手术申请历史列表动态查询
|
||||
* 手术申请状态字典说明 (wor_surgery_apply.status):
|
||||
* 1 - 待签发 (灰色):医生已保存但尚未提交
|
||||
* 2 - 已签发 (蓝色):病区护士待校对手术医嘱
|
||||
* 3 - 已校对 (蓝色):病区护士已校对手术医嘱
|
||||
* 4 - 已执行 (蓝色):病区护士已执行提交手术医嘱,已向手麻科提交申请
|
||||
* 5 - 已安排 (黄色):手麻科已排好手术间及时间相关信息,待手术
|
||||
* 6 - 已完成 (绿色):手术已结束并录入完毕
|
||||
* 10 - 已撤销/已作废 (红色):医生中途撤销了手术申请
|
||||
*/
|
||||
@Select("<script>" +
|
||||
"SELECT id, apply_no, apply_name, status, create_time " +
|
||||
"FROM wor_surgery_apply " +
|
||||
"WHERE 1=1 " +
|
||||
"<if test='startDate != null and startDate != \"\"'> AND create_time >= #{startDate} </if>" +
|
||||
"<if test='endDate != null and endDate != \"\"'> AND create_time <= #{endDate} </if>" +
|
||||
"<if test='status != null and status != \"\"'> AND status = #{status} </if>" +
|
||||
"<if test='keyword != null and keyword != \"\"'> AND (apply_no LIKE CONCAT('%', #{keyword}, '%') OR apply_name LIKE CONCAT('%', #{keyword}, '%')) </if>" +
|
||||
"ORDER BY create_time DESC " +
|
||||
"LIMIT #{pageSize} OFFSET #{offset}" +
|
||||
"</script>")
|
||||
List<Map<String, Object>> selectSurgeryApplyHistory(@Param("startDate") String startDate,
|
||||
@Param("endDate") String endDate,
|
||||
@Param("status") String status,
|
||||
@Param("keyword") String keyword,
|
||||
@Param("pageSize") int pageSize,
|
||||
@Param("offset") int offset);
|
||||
|
||||
/**
|
||||
* 查询手术申请单当前状态
|
||||
* @param applyId 手术申请单ID
|
||||
* @return 状态码
|
||||
*/
|
||||
@Select("SELECT status FROM wor_surgery_apply WHERE id = #{applyId}")
|
||||
Integer selectSurgeryApplyStatusById(@Param("applyId") Long applyId);
|
||||
|
||||
/**
|
||||
* 更新手术申请单状态
|
||||
* @param applyId 手术申请单ID
|
||||
* @param status 新状态码
|
||||
* @return 受影响行数
|
||||
*/
|
||||
@Update("UPDATE wor_surgery_apply SET status = #{status}, update_time = NOW() WHERE id = #{applyId}")
|
||||
int updateSurgeryApplyStatus(@Param("applyId") Long applyId, @Param("status") Integer status);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user