| | |
| | | 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; |
| | |
| | | @AllArgsConstructor |
| | | public class AppMwWarningRecordController { |
| | | private final MwWarningRecordService mwWarningRecordService; |
| | | private final SysDepartmentService sysDepartmentService; |
| | | |
| | | @ApiOperation("预警记录") |
| | | @PostMapping("/record") |
| | |
| | | return R.ok(page); |
| | | } |
| | | |
| | | @ApiOperation(value = "预警统计",tags = "监管人员") |
| | | @PostMapping("/danger") |
| | | public R<List<SysDepartment>> danger(String name) { |
| | | // |
| | | List<SysDepartment> list = sysDepartmentService.lambdaQuery().like(name!=null,SysDepartment::getDepartmentName,name).eq(SysDepartment::getOrgType, 2).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); |
| | | } |
| | | |
| | | } |