| | |
| | | package com.sinata.web.controller.applet; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.sinata.common.core.domain.R; |
| | | import com.sinata.common.core.domain.entity.SysUser; |
| | | import com.sinata.common.utils.SecurityUtils; |
| | | import com.sinata.system.domain.MwWarningRecord; |
| | | import com.sinata.system.domain.SysDepartment; |
| | | import com.sinata.system.domain.dto.CollectTotalUpDto; |
| | | import com.sinata.system.service.MwWarningRecordService; |
| | | import com.sinata.system.service.SysDepartmentService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/applet/mwWarningRecord") |
| | | @Api(tags = {"医院工作人员-预警"}) |
| | | @Api(tags = {"医院工作人员"}) |
| | | @AllArgsConstructor |
| | | public class AppMwWarningRecordController { |
| | | private final MwWarningRecordService mwWarningRecordService; |
| | | private final SysDepartmentService sysDepartmentService; |
| | | |
| | | @ApiOperation("记录") |
| | | @ApiOperation("预警记录") |
| | | @PostMapping("/record") |
| | | public R<List<CollectTotalUpDto>> record(@RequestParam Integer pageNum,@RequestParam Integer pageSize) { |
| | | public R<Page<MwWarningRecord>> record(@RequestParam Integer pageNum,@RequestParam Integer pageSize) { |
| | | SysDepartment myDepartment = sysDepartmentService.getMyDepartment(); |
| | | Page<MwWarningRecord> page = mwWarningRecordService.lambdaQuery().eq(MwWarningRecord::getDepartmentId, myDepartment.getId()).page(Page.of(pageNum, pageSize)); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | @ApiOperation(value = "预警统计",tags = "监管人员") |
| | | @PostMapping("/danger") |
| | | public R<List<SysDepartment>> danger(String name, Long areaId) { |
| | | SysDepartment byId = sysDepartmentService.getById(areaId); |
| | | // |
| | | List<SysDepartment> list = sysDepartmentService.lambdaQuery().likeRight(SysDepartment::getTreeCode, byId.getTreeCode()).like(name!=null,SysDepartment::getDepartmentName,name).in(SysDepartment::getOrgType, 2,3).list(); |
| | | for (SysDepartment sysDepartment : list) { |
| | | sysDepartment.setDangerCount(mwWarningRecordService.lambdaQuery().eq(MwWarningRecord::getDepartmentId,sysDepartment.getId()).count()); |
| | | } |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "预警统计详情",tags = "监管人员") |
| | | @PostMapping("/detail/record") |
| | | public R<Page<MwWarningRecord>> record1(@RequestParam Long id,@RequestParam Integer pageNum,@RequestParam Integer pageSize) { |
| | | Page<MwWarningRecord> page = mwWarningRecordService.lambdaQuery().eq(MwWarningRecord::getDepartmentId, id).page(Page.of(pageNum, pageSize)); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | } |