| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | @PostMapping("/regionTree") |
| | | @ApiImplicitParam(name = "keyword", value = "关键字", required = false) |
| | | public R<List<SysDepartmentVO>> getRegionTree(@RequestParam(required = false) String keyword) { |
| | | return R.ok(sysDepartmentService.getRegionTree1(keyword)); |
| | | List<SysDepartmentVO> regionTree1 = sysDepartmentService.getRegionTree2(keyword); |
| | | return R.ok(regionTree1); |
| | | } |
| | | |
| | | @ApiOperation("获取区域树") |
| | | @PostMapping("/pub/regionTree") |
| | | @ApiImplicitParam(name = "keyword", value = "关键字", required = false) |
| | | public R<List<SysDepartmentVO>> getRegionTree1(@RequestParam(required = false) String keyword) { |
| | | return R.ok(sysDepartmentService.getRegionTree1(keyword)); |
| | | List<SysDepartmentVO> regionTree1 = sysDepartmentService.getRegionTree2(keyword); |
| | | return R.ok(regionTree1); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | @ApiOperation("获取医院监管列表") |
| | | @PostMapping("/hospita/list") |
| | | public R<List<SysDepartment>> list(String name) { |
| | | List<SysDepartment> list = sysDepartmentService.lambdaQuery().like(name!=null,SysDepartment::getDepartmentName,name).eq(SysDepartment::getOrgType, 2).list(); |
| | | public R<List<SysDepartment>> list(String name,Long areaId) { |
| | | List<SysDepartment> list = sysDepartmentService.lambdaQuery().eq(areaId!=null,SysDepartment::getParentId,areaId).like(name!=null,SysDepartment::getDepartmentName,name).eq(SysDepartment::getOrgType, 2).list(); |
| | | for (SysDepartment sysDepartment : list) { |
| | | //获取医院暂存间信息 |
| | | MwStagingRoom one = roomService.lambdaQuery().eq(MwStagingRoom::getDepartmentId, sysDepartment.getId()).one(); |
| | |
| | | LocalDate now = LocalDate.now(); |
| | | for (SysDepartment sysDepartment : list) { |
| | | //获取库存总量 |
| | | Long count1 = collectRecordService.lambdaQuery().eq(MwCollectRecord::getReceiveDepartmentId, sysDepartment.getId()).eq(MwCollectRecord::getStatus, 3).groupBy(MwCollectRecord::getBoxNumber).count(); |
| | | Long count1 = collectRecordService.lambdaQuery().eq(MwCollectRecord::getReceiveDepartmentId, sysDepartment.getId()).count(); |
| | | //获取接收数量 |
| | | Long count2 = collectRecordService.lambdaQuery().eq(MwCollectRecord::getReceiveTime,now).eq(MwCollectRecord::getReceiveDepartmentId, sysDepartment.getId()).eq(MwCollectRecord::getStatus, 3).groupBy(MwCollectRecord::getBoxNumber).count(); |
| | | Long count2 = collectRecordService.lambdaQuery().isNotNull(MwCollectRecord::getReceiveTime).eq(MwCollectRecord::getReceiveDepartmentId, sysDepartment.getId()).count(); |
| | | //获取处置数量 |
| | | Long count3 = collectRecordService.lambdaQuery().eq(MwCollectRecord::getReceiveTime,now).eq(MwCollectRecord::getReceiveDepartmentId, sysDepartment.getId()).eq(MwCollectRecord::getStatus, 4).groupBy(MwCollectRecord::getBoxNumber).count(); |
| | | Long count3 = collectRecordService.lambdaQuery().isNotNull(MwCollectRecord::getDisposalTime).eq(MwCollectRecord::getReceiveDepartmentId, sysDepartment.getId()).count(); |
| | | sysDepartment.setCont1(count1); |
| | | sysDepartment.setCont2(count2); |
| | | sysDepartment.setCont3(count3); |
| | |
| | | |
| | | @ApiOperation(value = "医院转运记录") |
| | | @PostMapping("/trans") |
| | | public R<List<CheckOutDto>> trans(LocalDate date,@ApiParam("医院id")@RequestParam Long departmentId) { |
| | | public R<List<CheckOutDto>> trans(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date, @ApiParam("医院id")@RequestParam Long departmentId) { |
| | | LocalDate now = LocalDate.now().minusDays(7); |
| | | if (date!=null){ |
| | | now = LocalDate.now(); |