fix(clinical-pathway): 修复P0问题 - delete_flag/权限控制/缺失端点/tenant_id类型

This commit is contained in:
2026-06-17 12:20:11 +08:00
parent 815b80437e
commit f79c5a2c26
3 changed files with 18 additions and 2 deletions

View File

@@ -18,6 +18,7 @@ public class ClinicalPathwayController {
private final IClinicalPathwayService pathwayService;
private final IClinicalPathwayExecutionService executionService;
private final IClinicalPathwayAppService clinicalPathwayAppService;
@PreAuthorize("@ss.hasPermi('inpatient:clinical:list')")
@GetMapping("/page")
public R<?> getPage(@RequestParam(value="diseaseCode",required=false) String diseaseCode,
@RequestParam(value="pageNo",defaultValue="1") Integer pageNo,
@@ -27,13 +28,16 @@ public class ClinicalPathwayController {
.eq(ClinicalPathway::getStatus, "ACTIVE");
return R.ok(pathwayService.page(new Page<>(pageNo, pageSize), w));
}
@PreAuthorize("@ss.hasPermi('inpatient:clinical:edit')")
@PostMapping("/add") @Transactional(rollbackFor=Exception.class)
public R<?> add(@RequestBody ClinicalPathway p) { p.setVersion(1); p.setStatus("ACTIVE"); p.setCreateTime(new Date()); pathwayService.save(p); return R.ok(p); }
@PreAuthorize("@ss.hasPermi('inpatient:clinical:edit')")
@PostMapping("/enter") @Transactional(rollbackFor=Exception.class)
public R<?> enterPathway(@RequestBody ClinicalPathwayExecution e) {
e.setStatus("IN_PATH"); e.setEnterDate(java.time.LocalDate.now()); e.setCreateTime(new Date());
executionService.save(e); return R.ok(e);
}
@PreAuthorize("@ss.hasPermi('inpatient:clinical:edit')")
@PutMapping("/complete/{id}") @Transactional(rollbackFor=Exception.class)
public R<?> completePathway(@PathVariable Long id) {
LambdaQueryWrapper<ClinicalPathwayExecution> qw = new LambdaQueryWrapper<>();
@@ -42,6 +46,7 @@ public class ClinicalPathwayController {
e.setStatus("COMPLETED"); e.setCompleteDate(java.time.LocalDate.now());
executionService.updateById(e); return R.ok();
}
@PreAuthorize("@ss.hasPermi('inpatient:clinical:edit')")
@PutMapping("/vary/{id}") @Transactional(rollbackFor=Exception.class)
public R<?> varyPathway(@PathVariable Long id, @RequestParam("reason") String reason) {
LambdaQueryWrapper<ClinicalPathwayExecution> qw = new LambdaQueryWrapper<>();
@@ -49,6 +54,7 @@ public class ClinicalPathwayController {
ClinicalPathwayExecution e = executionService.getOne(qw); if (e == null) return R.fail("执行记录不存在");
e.setStatus("VARIATION"); e.setVariationReason(reason); executionService.updateById(e); return R.ok();
}
@PreAuthorize("@ss.hasPermi('inpatient:clinical:list')")
@GetMapping("/stats")
public R<?> getStats() {
Map<String, Object> stats = new HashMap<>();
@@ -106,4 +112,12 @@ public class ClinicalPathwayController {
@RequestParam(required = false) String endDate) {
return AjaxResult.success(clinicalPathwayAppService.getStatistics(startDate, endDate));
}
@Operation(summary = "执行记录分页")
@PreAuthorize("@ss.hasPermi('inpatient:clinical:list')")
@GetMapping("/execution/page")
public AjaxResult getExecutionPage(@RequestParam(required = false) Long pathwayId,
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "20") Integer pageSize) {
return AjaxResult.success(clinicalPathwayAppService.getExecutionPage(pathwayId, pageNo, pageSize));
}
}

View File

@@ -10,8 +10,8 @@ CREATE TABLE IF NOT EXISTS clinical_pathway_variance (
adjustment_action TEXT,
record_by BIGINT,
record_by_name VARCHAR(50),
tenant_id INTEGER DEFAULT 0,
del_flag CHAR(1) DEFAULT '0',
tenant_id BIGINT DEFAULT 0,
delete_flag CHAR(1) DEFAULT '0',
create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
create_by VARCHAR(64),
update_time TIMESTAMP,

View File

@@ -0,0 +1,2 @@
ALTER TABLE clinical_pathway_variance RENAME COLUMN del_flag TO delete_flag;
ALTER TABLE clinical_pathway_variance ALTER COLUMN tenant_id SET DATA TYPE BIGINT;