fix(order-closed-loop): 修复P0问题 - deptId过滤/权限控制/死代码
This commit is contained in:
@@ -4,7 +4,6 @@ import com.healthlink.his.orderclosedloop.domain.OrderExecuteStep;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
public interface IOrderClosedLoopAppService {
|
||||
IPage<OrderExecuteRecord> listRecords(String orderNo, String orderType, String executeStatus, Integer pageNum, Integer pageSize);
|
||||
Map<String, Object> getOrderStatus(Long orderId);
|
||||
@@ -14,5 +13,5 @@ public interface IOrderClosedLoopAppService {
|
||||
Map<String, Object> getStatistics(String type, String groupBy, Integer pageNum, Integer pageSize);
|
||||
void remindOrder(Map<String, Object> params);
|
||||
Map<String, Object> getTrace(Long adviceId);
|
||||
Map<String, Object> getStatisticsWithParams(String deptId, String startDate, String endDate);
|
||||
Map<String, Object> getStatisticsWithParams(String startDate, String endDate);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springframework.jdbc.support.JdbcUtils;
|
||||
@Service
|
||||
public class OrderClosedLoopAppServiceImpl implements IOrderClosedLoopAppService {
|
||||
@Autowired private IOrderExecuteRecordService recordService;
|
||||
@@ -256,13 +255,9 @@ public class OrderClosedLoopAppServiceImpl implements IOrderClosedLoopAppService
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getStatisticsWithParams(String deptId, String startDate, String endDate) {
|
||||
public Map<String, Object> getStatisticsWithParams(String startDate, String endDate) {
|
||||
Map<String, Object> result = new LinkedHashMap<>();
|
||||
LambdaQueryWrapper<OrderExecuteRecord> w = new LambdaQueryWrapper<>();
|
||||
w.ne(OrderExecuteRecord::getExecuteStatus, "cancelled");
|
||||
if (deptId != null && !deptId.isEmpty()) {
|
||||
List<Map<String, Object>> deptRows = recordMapper.selectOverviewByType();
|
||||
}
|
||||
List<OrderExecuteRecord> records = recordService.list(w);
|
||||
long total = records.size();
|
||||
long executing = 0;
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.healthlink.his.web.orderclosedloop.appservice.IOrderClosedLoopAppServ
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import java.util.Map;
|
||||
@Tag(name = "医嘱闭环") @RestController @RequestMapping("/api/v1/order-closed-loop")
|
||||
@@ -12,6 +13,7 @@ public class OrderClosedLoopController {
|
||||
@Autowired private IOrderClosedLoopAppService appService;
|
||||
|
||||
@Operation(summary = "医嘱执行记录列表")
|
||||
@PreAuthorize("@ss.hasPermi('inpatient:orderclosedloop:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(@RequestParam(required = false) String orderNo,
|
||||
@RequestParam(required = false) String orderType,
|
||||
@@ -22,12 +24,14 @@ public class OrderClosedLoopController {
|
||||
}
|
||||
|
||||
@Operation(summary = "获取医嘱执行状态")
|
||||
@PreAuthorize("@ss.hasPermi('inpatient:orderclosedloop:list')")
|
||||
@GetMapping("/status/{orderId}")
|
||||
public AjaxResult status(@PathVariable Long orderId) {
|
||||
return AjaxResult.success(appService.getOrderStatus(orderId));
|
||||
}
|
||||
|
||||
@Operation(summary = "执行医嘱")
|
||||
@PreAuthorize("@ss.hasPermi('inpatient:orderclosedloop:edit')")
|
||||
@PostMapping("/execute")
|
||||
public AjaxResult execute(@RequestBody OrderExecuteRecord record) {
|
||||
appService.executeOrder(record);
|
||||
@@ -35,6 +39,7 @@ public class OrderClosedLoopController {
|
||||
}
|
||||
|
||||
@Operation(summary = "完成医嘱")
|
||||
@PreAuthorize("@ss.hasPermi('inpatient:orderclosedloop:edit')")
|
||||
@PostMapping("/complete")
|
||||
public AjaxResult complete(@RequestBody OrderExecuteRecord record) {
|
||||
appService.completeOrder(record);
|
||||
@@ -42,6 +47,7 @@ public class OrderClosedLoopController {
|
||||
}
|
||||
|
||||
@Operation(summary = "取消医嘱")
|
||||
@PreAuthorize("@ss.hasPermi('inpatient:orderclosedloop:edit')")
|
||||
@PostMapping("/cancel")
|
||||
public AjaxResult cancel(@RequestBody OrderExecuteRecord record) {
|
||||
appService.cancelOrder(record);
|
||||
@@ -49,6 +55,7 @@ public class OrderClosedLoopController {
|
||||
}
|
||||
|
||||
@Operation(summary = "统计")
|
||||
@PreAuthorize("@ss.hasPermi('inpatient:orderclosedloop:list')")
|
||||
@GetMapping("/statistics")
|
||||
public AjaxResult statistics(@RequestParam(required = false) String type,
|
||||
@RequestParam(required = false) String groupBy,
|
||||
@@ -58,6 +65,7 @@ public class OrderClosedLoopController {
|
||||
}
|
||||
|
||||
@Operation(summary = "催办提醒")
|
||||
@PreAuthorize("@ss.hasPermi('inpatient:orderclosedloop:edit')")
|
||||
@PostMapping("/remind")
|
||||
public AjaxResult remind(@RequestBody Map<String, Object> params) {
|
||||
appService.remindOrder(params);
|
||||
@@ -65,16 +73,17 @@ public class OrderClosedLoopController {
|
||||
}
|
||||
|
||||
@Operation(summary = "医嘱执行追踪")
|
||||
@PreAuthorize("@ss.hasPermi('inpatient:orderclosedloop:list')")
|
||||
@GetMapping("/trace/{adviceId}")
|
||||
public AjaxResult trace(@PathVariable Long adviceId) {
|
||||
return AjaxResult.success(appService.getTrace(adviceId));
|
||||
}
|
||||
|
||||
@Operation(summary = "执行统计")
|
||||
@PreAuthorize("@ss.hasPermi('inpatient:orderclosedloop:list')")
|
||||
@GetMapping("/statistics/summary")
|
||||
public AjaxResult statisticsSummary(@RequestParam(required = false) String deptId,
|
||||
@RequestParam(required = false) String startDate,
|
||||
public AjaxResult statisticsSummary(@RequestParam(required = false) String startDate,
|
||||
@RequestParam(required = false) String endDate) {
|
||||
return AjaxResult.success(appService.getStatisticsWithParams(deptId, startDate, endDate));
|
||||
return AjaxResult.success(appService.getStatisticsWithParams(startDate, endDate));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,9 +63,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<el-form :inline="true" :model="statsParams" class="query-form">
|
||||
<el-form-item label="科室">
|
||||
<el-input v-model="statsParams.deptId" placeholder="科室ID" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="开始日期">
|
||||
<el-date-picker v-model="statsParams.startDate" type="date" placeholder="选择日期" value-format="YYYY-MM-DD" />
|
||||
</el-form-item>
|
||||
@@ -126,7 +123,7 @@ const loading = ref(false)
|
||||
const statsLoading = ref(false)
|
||||
const queryParams = ref({ adviceId: '' })
|
||||
const traceData = ref({})
|
||||
const statsParams = ref({ deptId: '', startDate: '', endDate: '' })
|
||||
const statsParams = ref({ startDate: '', endDate: '' })
|
||||
const statsData = ref({})
|
||||
|
||||
function handleSearch() {
|
||||
@@ -147,7 +144,6 @@ function handleSearch() {
|
||||
function loadStats() {
|
||||
statsLoading.value = true
|
||||
const params = {}
|
||||
if (statsParams.value.deptId) params.deptId = statsParams.value.deptId
|
||||
if (statsParams.value.startDate) params.startDate = statsParams.value.startDate
|
||||
if (statsParams.value.endDate) params.endDate = statsParams.value.endDate
|
||||
getExecuteStatistics(params).then(res => {
|
||||
|
||||
Reference in New Issue
Block a user