门诊号码管理维护界面-》优化
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.businessrule.appservice;
|
||||
|
||||
import com.openhis.web.businessrule.dto.OutpatientNoLogDto;
|
||||
|
||||
/**
|
||||
* 门诊号码管理服务接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-01-XX
|
||||
*/
|
||||
public interface IOutpatientNoAppService {
|
||||
|
||||
/**
|
||||
* 记录操作日志
|
||||
*
|
||||
* @param logDto 日志数据
|
||||
*/
|
||||
void addOperationLog(OutpatientNoLogDto logDto);
|
||||
}
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.businessrule.appservice.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.openhis.web.businessrule.appservice.IOutpatientNoAppService;
|
||||
import com.openhis.web.businessrule.dto.OutpatientNoLogDto;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 门诊号码管理服务实现
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-01-XX
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class OutpatientNoAppServiceImpl implements IOutpatientNoAppService {
|
||||
|
||||
/**
|
||||
* 记录操作日志
|
||||
*
|
||||
* @param logDto 日志数据
|
||||
*/
|
||||
@Override
|
||||
public void addOperationLog(OutpatientNoLogDto logDto) {
|
||||
// 记录日志到系统日志
|
||||
log.info("门诊号码管理操作日志 - 操作类型: {}, 操作详情: {}, 操作结果: {}, 用户: {} (ID: {})",
|
||||
logDto.getOperation(),
|
||||
logDto.getDetails(),
|
||||
logDto.getSuccess() ? "成功" : "失败",
|
||||
logDto.getUserName(),
|
||||
logDto.getUserId());
|
||||
|
||||
if (logDto.getErrorMessage() != null && !logDto.getErrorMessage().isEmpty()) {
|
||||
log.warn("操作失败原因: {}", logDto.getErrorMessage());
|
||||
}
|
||||
|
||||
// TODO: 如果需要保存到数据库,可以在这里添加数据库操作
|
||||
// 例如:保存到 sys_oper_log 表或其他日志表
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.businessrule.controller;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.businessrule.appservice.IOutpatientNoAppService;
|
||||
import com.openhis.web.businessrule.dto.OutpatientNoLogDto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 门诊号码管理 controller
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-01-XX
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/business-rule/outpatient-no")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class OutpatientNoController {
|
||||
|
||||
@Autowired
|
||||
private IOutpatientNoAppService outpatientNoAppService;
|
||||
|
||||
/**
|
||||
* 记录操作日志
|
||||
*
|
||||
* @param logDto 日志数据
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping("/log")
|
||||
public R<?> addOperationLog(@RequestBody OutpatientNoLogDto logDto) {
|
||||
try {
|
||||
outpatientNoAppService.addOperationLog(logDto);
|
||||
return R.ok("操作日志记录成功");
|
||||
} catch (Exception e) {
|
||||
log.error("记录操作日志失败", e);
|
||||
return R.fail("操作日志记录失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.businessrule.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 门诊号码操作日志DTO
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-01-XX
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OutpatientNoLogDto {
|
||||
|
||||
/** 操作类型(新增/修改/删除/查询) */
|
||||
private String operation;
|
||||
|
||||
/** 操作详情 */
|
||||
private String details;
|
||||
|
||||
/** 操作是否成功 */
|
||||
private Boolean success;
|
||||
|
||||
/** 错误信息 */
|
||||
private String errorMessage;
|
||||
|
||||
/** 时间戳 */
|
||||
private String timestamp;
|
||||
|
||||
/** 用户ID */
|
||||
private Long userId;
|
||||
|
||||
/** 用户名称 */
|
||||
private String userName;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user