mitao
2025-03-27 97e105959d04d24eee3ce14c50685d57dceb5b1a
medicalWaste-admin/src/main/java/com/sinata/web/controller/applet/AppDepartmentController.java
@@ -3,6 +3,7 @@
import com.sinata.common.core.domain.R;
import com.sinata.common.core.domain.entity.SysUser;
import com.sinata.common.utils.SecurityUtils;
import com.sinata.common.utils.StringUtils;
import com.sinata.system.domain.*;
import com.sinata.system.domain.dto.CheckOutDto;
import com.sinata.system.domain.dto.CollectTotalUpDto;
@@ -94,9 +95,9 @@
    @ApiOperation("获取医院监管列表")
    @PostMapping("/hospita/list")
    public R<List<SysDepartment>> list(String name, Long areaId) {
        Long departmentId = SecurityUtils.getLoginUser().getUser().getDepartmentId();
        SysDepartment byId = sysDepartmentService.getById(departmentId);
        List<SysDepartment> list = sysDepartmentService.lambdaQuery().likeRight(SysDepartment::getTreeCode, byId.getTreeCode()).eq(areaId != null, SysDepartment::getParentId, areaId).like(name != null, SysDepartment::getDepartmentName, name).eq(SysDepartment::getOrgType, 2).list();
//        SysDepartment byId = sysDepartmentService.getMyDepartment();
        SysDepartment byId = sysDepartmentService.getById(areaId);
        List<SysDepartment> list = sysDepartmentService.lambdaQuery().likeRight(SysDepartment::getTreeCode, byId.getTreeCode()).like(StringUtils.isNotEmpty(name), SysDepartment::getDepartmentName, name).eq(SysDepartment::getOrgType, 2).list();
        for (SysDepartment sysDepartment : list) {
            //获取医院暂存间信息
            MwStagingRoom one = roomService.lambdaQuery().eq(MwStagingRoom::getDepartmentId, sysDepartment.getId()).one();
@@ -119,16 +120,17 @@
    @ApiOperation("获取处置监管列表")
    @PostMapping("/end/list")
    public R<List<SysDepartment>> list2(String name) {
        List<SysDepartment> list = sysDepartmentService.lambdaQuery().like(name!=null,SysDepartment::getDepartmentName,name).eq(SysDepartment::getOrgType, 3).list();
    public R<List<SysDepartment>> list2(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).eq(SysDepartment::getOrgType, 3).list();
        LocalDate now = LocalDate.now();
        for (SysDepartment sysDepartment : list) {
            //获取库存总量
            Long count1 = collectRecordService.lambdaQuery().eq(MwCollectRecord::getReceiveDepartmentId, sysDepartment.getId()).count();
            //获取接收数量
            Long count2 = collectRecordService.lambdaQuery().isNotNull(MwCollectRecord::getReceiveTime).eq(MwCollectRecord::getReceiveDepartmentId, sysDepartment.getId()).count();
            Long count2 = collectRecordService.lambdaQuery().ge(MwCollectRecord::getReceiveTime,now.atStartOfDay()).le(MwCollectRecord::getReceiveTime,now.atTime(23,59,59)).eq(MwCollectRecord::getReceiveDepartmentId, sysDepartment.getId()).count();
            //获取处置数量
            Long count3 = collectRecordService.lambdaQuery().isNotNull(MwCollectRecord::getDisposalTime).eq(MwCollectRecord::getReceiveDepartmentId, sysDepartment.getId()).count();
            Long count3 = collectRecordService.lambdaQuery().ge(MwCollectRecord::getDisposalTime,now.atStartOfDay()).le(MwCollectRecord::getDisposalTime,now.atTime(23,59,59)).eq(MwCollectRecord::getReceiveDepartmentId, sysDepartment.getId()).count();
            sysDepartment.setCont1(count1);
            sysDepartment.setCont2(count2);
            sysDepartment.setCont3(count3);
@@ -184,8 +186,8 @@
    public R<CountTwoDto> outtotal2(@ApiParam("处置机构id")@RequestParam Long departmentId) {
        CountTwoDto countTwoDto = new CountTwoDto();
        LocalDate now = LocalDate.now();
        Long count = collectRecordService.lambdaQuery().eq(MwCollectRecord::getReceiveDepartmentId, departmentId).eq(MwCollectRecord::getReceiveTime, now).count();
        Long count1 = collectRecordService.lambdaQuery().eq(MwCollectRecord::getReceiveDepartmentId, departmentId).eq(MwCollectRecord::getDisposalTime, now).count();
        Long count = collectRecordService.lambdaQuery().eq(MwCollectRecord::getReceiveDepartmentId, departmentId).ge(MwCollectRecord::getReceiveTime, now.atStartOfDay()).le(MwCollectRecord::getReceiveTime,now.atTime(23,59,59)).count();
        Long count1 = collectRecordService.lambdaQuery().eq(MwCollectRecord::getReceiveDepartmentId, departmentId).ge(MwCollectRecord::getDisposalTime, now.atStartOfDay()).le(MwCollectRecord::getDisposalTime,now.atTime(23,59,59)).count();
        countTwoDto.setCount(count);
        countTwoDto.setCount1(count1);
        return R.ok(countTwoDto);