| | |
| | | //获取库存总量 |
| | | 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); |
| | |
| | | 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); |
| | |
| | | |
| | | @ApiOperation(value = "接收统计上",tags = "处置人员") |
| | | @PostMapping("/out/total") |
| | | public R<List<CollectTotalUpDto>> outtotal(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date1,@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date2) { |
| | | public R<List<CollectTotalUpDto>> outtotal(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | return R.ok(mwCheckoutRecordService.totalUp2(date1,date2,sysUser.getUserId())); |
| | | return R.ok(mwCheckoutRecordService.totalUp2(date,sysUser.getUserId())); |
| | | } |
| | | @ApiOperation(value = "接收统计下",tags = "处置人员") |
| | | @PostMapping("/out/record") |
| | | public R<List<CheckOutDto>> record1(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date1,@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date2) { |
| | | public R<List<CheckOutDto>> record1(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date) { |
| | | SysUser sysUser1 = SecurityUtils.getLoginUser().getUser(); |
| | | SysUser sysUser = userService.getById(sysUser1.getUserId()); |
| | | LocalDate now = LocalDate.now(); |
| | | List<MwDisposalRecord> list = disposalRecordService.lambdaQuery().ge(date1!=null,MwDisposalRecord::getReceiveTime, date1.atStartOfDay()).le(date2!=null,MwDisposalRecord::getReceiveTime,date2.atTime(23,59,59)).eq(MwDisposalRecord::getDepartmentId, sysUser.getDepartmentId()).orderByDesc(MwDisposalRecord::getReceiveTime).list(); |
| | | List<MwDisposalRecord> list = disposalRecordService.lambdaQuery().ge(date!=null,MwDisposalRecord::getReceiveTime, date.atStartOfDay()).le(date!=null,MwDisposalRecord::getReceiveTime,date.atTime(23,59,59)).eq(MwDisposalRecord::getDepartmentId, sysUser.getDepartmentId()).orderByDesc(MwDisposalRecord::getReceiveTime).list(); |
| | | List<CheckOutDto> backList = new ArrayList<>(); |
| | | for (MwDisposalRecord mwCheckoutRecord : list) { |
| | | CheckOutDto checkOutDto = new CheckOutDto(); |
| | |
| | | |
| | | @ApiOperation(value = "处置统计上",tags = "处置人员") |
| | | @PostMapping("/end/total") |
| | | public R<List<CollectTotalUpDto>> outtotal1(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date1, @DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date2) { |
| | | public R<List<CollectTotalUpDto>> outtotal1(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | return R.ok(mwCheckoutRecordService.totalUp2(date1,date2,sysUser.getUserId())); |
| | | return R.ok(mwCheckoutRecordService.totalUp2(date,sysUser.getUserId())); |
| | | } |
| | | |
| | | @ApiOperation(value = "处置统下",tags = "处置人员") |
| | | @PostMapping("/end/record") |
| | | public R<List<CheckOutDto>> record2(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date1,@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date2) { |
| | | public R<List<CheckOutDto>> record2(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | LocalDate now = LocalDate.now(); |
| | | List<MwDisposalHandleRecord> list = handleRecordService.lambdaQuery().ge(date1!=null,MwDisposalHandleRecord::getDisposalTime, date1.atStartOfDay()).le(date2!=null,MwDisposalHandleRecord::getDisposalTime,date2.atTime(23,59,59)).eq(MwDisposalHandleRecord::getDepartmentId, sysUser.getDepartmentId()).orderByDesc(MwDisposalHandleRecord::getDisposalTime).list(); |
| | | List<MwDisposalHandleRecord> list = handleRecordService.lambdaQuery().ge(date!=null,MwDisposalHandleRecord::getDisposalTime, date.atStartOfDay()).le(date!=null,MwDisposalHandleRecord::getDisposalTime,date.atTime(23,59,59)).eq(MwDisposalHandleRecord::getDepartmentId, sysUser.getDepartmentId()).orderByDesc(MwDisposalHandleRecord::getDisposalTime).list(); |
| | | List<CheckOutDto> backList = new ArrayList<>(); |
| | | for (MwDisposalHandleRecord mwCheckoutRecord : list) { |
| | | CheckOutDto checkOutDto = new CheckOutDto(); |
| | |
| | | @ApiOperation(value = "扫码接收列表",tags = "处置人员") |
| | | @PostMapping("/end/down/collect/total") |
| | | public R<List<HospitalCollectTotalUp1Dto>> tanscollecttotal3(String boxNum) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | MwCollectRecord one = collectRecordService.lambdaQuery().eq(MwCollectRecord::getBoxNumber, boxNum).eq(MwCollectRecord::getStatus, 2).last("limit 1").one(); |
| | | if (one==null){ |
| | | return R.ok(); |
| | |
| | | @ApiOperation(value = "获取车辆",tags = "处置人员") |
| | | @PostMapping("/end/down/collect/car") |
| | | public R<CarDto> tanscollecttotal7(String boxNum) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | MwCollectRecord one = collectRecordService.lambdaQuery().eq(MwCollectRecord::getBoxNumber, boxNum).eq(MwCollectRecord::getStatus, 2).last("limit 1").one(); |
| | | if (one == null) { |
| | | return R.ok(); |
| | |
| | | SysUser one1 = userService.lambdaQuery().eq(SysUser::getCarId, byId.getId()).last("limit 1").one(); |
| | | CarDto carDto = new CarDto(); |
| | | carDto.setLicensePlateNumber(byId.getLicensePlateNumber()); |
| | | carDto.setUserName(one1.getUserName()); |
| | | carDto.setUserName(one1.getNickName()); |
| | | return R.ok(carDto); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "扫码接收列表上获取医院",tags = "处置人员") |
| | | @PostMapping("/end/down/collect/up") |
| | | public R<SysDepartment> tanscollecttotal4(String boxNum) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | MwCollectRecord one = collectRecordService.lambdaQuery().eq(MwCollectRecord::getBoxNumber, boxNum).eq(MwCollectRecord::getStatus, 2).last("limit 1").one(); |
| | | if (one == null) { |
| | | return R.ok(); |
| | |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | SysUser byId = userService.getById(sysUser.getUserId()); |
| | | Page<MwCollectRecord> page = collectRecordService.lambdaQuery() |
| | | .ge(MwCollectRecord::getCreateTime, date.atStartOfDay()) |
| | | .le(MwCollectRecord::getCreateTime, date.atTime(23,59,59)) |
| | | .ge(MwCollectRecord::getCollectTime, date.atStartOfDay()) |
| | | .le(MwCollectRecord::getCollectTime, date.atTime(23,59,59)) |
| | | .eq(MwCollectRecord::getDepartmentId, byId.getDepartmentId()) |
| | | .orderByDesc(MwCollectRecord::getCollectTime) |
| | | .page(Page.of(pageNum, pageSize)); |
| | |
| | | @ApiOperation(value = "获取车辆列表",tags = "运输人员") |
| | | @PostMapping("/list") |
| | | public R<List<MwTransitCar>> list() { |
| | | List<MwTransitCar> list = carService.list(); |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | List<MwTransitCar> list = carService.lambdaQuery().eq(MwTransitCar::getDepartmentId,user.getDepartmentId()).list(); |
| | | return R.ok(list); |
| | | } |
| | | |
| | |
| | | |
| | | List<CollectTotalUpDto> totalUp(@Param("date") LocalDate date, @Param("departmentId")Long departmentId); |
| | | List<CollectTotalUpDto> totalUp4(@Param("departmentId")Long departmentId); |
| | | List<CollectTotalUpDto> totalUp2(@Param("date1") LocalDate date1, @Param("date2") LocalDate date2,@Param("departmentId")Long departmentId); |
| | | List<CollectTotalUpDto> totalUp2(@Param("date") LocalDate date ,@Param("departmentId")Long departmentId); |
| | | List<CollectTotalUpDto> totalUp5(@Param("departmentId")Long departmentId); |
| | | List<CollectTotalUpDto> totalUp3(@Param("date1") LocalDate date1, @Param("date2") LocalDate date2,@Param("departmentId")Long departmentId); |
| | | List<CollectTotalUpDto> totalUp1(@Param("outId")Long outId); |
| | |
| | | |
| | | List<CollectTotalUpDto> totalUp(LocalDate date, Long departmentId); |
| | | List<CollectTotalUpDto> totalUp4(Long departmentId); |
| | | List<CollectTotalUpDto> totalUp2(LocalDate date1,LocalDate date2, Long departmentId); |
| | | List<CollectTotalUpDto> totalUp2(LocalDate date1, Long departmentId); |
| | | List<CollectTotalUpDto> totalUp5(Long departmentId); |
| | | List<CollectTotalUpDto> totalUp3(LocalDate date1,LocalDate date2, Long departmentId); |
| | | List<CollectTotalUpDto> totalUp1(Long outId); |
| | |
| | | return this.baseMapper.totalUp4(departmentId); |
| | | } |
| | | @Override |
| | | public List<CollectTotalUpDto> totalUp2(LocalDate date1,LocalDate date2, Long departmentId) { |
| | | return this.baseMapper.totalUp2(date1,date2,departmentId); |
| | | public List<CollectTotalUpDto> totalUp2(LocalDate date,Long departmentId) { |
| | | return this.baseMapper.totalUp2(date,departmentId); |
| | | } |
| | | @Override |
| | | public List<CollectTotalUpDto> totalUp5( Long departmentId) { |
| | |
| | | private Map<Long, List<SysDepartment>> getChildrenDepartmentByOrgType(SysDepartment myDepartment, List<Integer> orgTypes) { |
| | | List<SysDepartment> sysDepartmentList = this.lambdaQuery() |
| | | .likeRight(SysDepartment::getTreeCode, myDepartment.getTreeCode()) |
| | | .in(CollUtils.isNotEmpty(orgTypes), SysDepartment::getOrgType, orgTypes) |
| | | .orderByDesc(SysDepartment::getCreateTime) |
| | | .list(); |
| | | return sysDepartmentList.stream() |
| | |
| | | } |
| | | public List<SysDepartmentVO> getRegionTree2(String keyword) { |
| | | |
| | | // SysDepartment currentDepartment = getMyDepartment(); |
| | | |
| | | List<SysDepartmentVO> root = new ArrayList<>(); |
| | | SysDepartment currentDepartment = this.baseMapper.selectById(-1); |
| | | SysDepartment currentDepartment = getMyDepartment(); |
| | | if (Objects.isNull(currentDepartment)) { |
| | | return root; |
| | | } |
| | | if (!currentDepartment.getOrgType().equals(DepartmentEnum.REGION.getCode())) { |
| | | return root; |
| | | } |
| | | // if (!currentDepartment.getOrgType().equals(DepartmentEnum.REGION.getCode())) { |
| | | // return root; |
| | | // } |
| | | Map<Long, List<SysDepartment>> childrenMap = getChildrenDepartmentByOrgType(currentDepartment, Collections.singletonList(DepartmentEnum.REGION.getCode())); |
| | | SysDepartmentVO sysDepartmentVO = fillChildrenTreeModel(currentDepartment, childrenMap); |
| | | if (sysDepartmentVO.getTreeCode().length()==10){ |
| | | SysDepartment sysDepartment = this.baseMapper.selectById(sysDepartmentVO.getParentId()); |
| | | SysDepartmentVO sysDepartmentVO1 = new SysDepartmentVO(); |
| | | BeanUtils.copyProperties(sysDepartment,sysDepartmentVO1); |
| | | List<SysDepartmentVO> root1 = new ArrayList<>(); |
| | | root1.add(sysDepartmentVO); |
| | | sysDepartmentVO1.setChildren(root1); |
| | | sysDepartmentVO = sysDepartmentVO1; |
| | | } |
| | | if (sysDepartmentVO.getTreeCode().length()==14){ |
| | | SysDepartment sysDepartment = this.baseMapper.selectById(sysDepartmentVO.getParentId()); |
| | | SysDepartmentVO sysDepartmentVO1 = new SysDepartmentVO(); |
| | | BeanUtils.copyProperties(sysDepartment,sysDepartmentVO1); |
| | | List<SysDepartmentVO> root1 = new ArrayList<>(); |
| | | root1.add(sysDepartmentVO); |
| | | sysDepartmentVO1.setChildren(root1); |
| | | |
| | | |
| | | SysDepartment sysDepartment2 = this.baseMapper.selectById(sysDepartment.getParentId()); |
| | | SysDepartmentVO sysDepartmentVO2 = new SysDepartmentVO(); |
| | | BeanUtils.copyProperties(sysDepartment2,sysDepartmentVO2); |
| | | List<SysDepartmentVO> root2 = new ArrayList<>(); |
| | | root2.add(sysDepartmentVO1); |
| | | sysDepartmentVO2.setChildren(root2); |
| | | sysDepartmentVO = sysDepartmentVO2; |
| | | } |
| | | root.add(sysDepartmentVO); |
| | | if (StringUtils.isNotBlank(keyword)) { |
| | | treeMatch(root, keyword); |
| | |
| | | SELECT WASTE_TYPE as wasteType,WASTE_TYPE_STR as wasteTypeStr,COUNT(DISTINCT BOX_NUMBER ) as boxNum ,COUNT(1)as num,sum(WEIGHT) as weight from MEDICAL_WASTE.MW_COLLECT_RECORD |
| | | <where> |
| | | RECEIVE_USER_ID is not null AND RECEIVE_USER_ID = #{departmentId} |
| | | <if test="date1 != null"> |
| | | AND TRUNC(RECEIVE_TIME, 'DAY') >= TO_DATE(#{date1},'YYYY-MM-DD') |
| | | <if test="date != null"> |
| | | AND TRUNC(RECEIVE_TIME) == TO_DATE(#{date},'YYYY-MM-DD') |
| | | </if> |
| | | <if test="date2 != null"> |
| | | AND TRUNC(RECEIVE_TIME, 'DAY') < TO_DATE(#{date2},'YYYY-MM-DD') |
| | | </if> |
| | | |
| | | |
| | | </where> |
| | | GROUP BY WASTE_TYPE |
| | |
| | | <select id="collectTotal" resultType="com.sinata.system.domain.dto.CollectTotalUpDto"> |
| | | SELECT WASTE_TYPE as wasteType,WASTE_TYPE_STR as wasteTypeStr,COUNT(DISTINCT BOX_NUMBER ) as boxNum ,COUNT(1)as num,sum(WEIGHT) as weight from MEDICAL_WASTE.MW_COLLECT_RECORD |
| | | <where> |
| | | DEPARTMENT_ID = #{departmentId} AND TRUNC(COLLECT_TIME, 'DAY') = TO_DATE(#{date},'YYYY-MM-DD') |
| | | DEPARTMENT_ID = #{departmentId} AND TRUNC(COLLECT_TIME) = TO_DATE(#{date},'YYYY-MM-DD') |
| | | </where> |
| | | GROUP BY WASTE_TYPE |
| | | </select> |
| | |
| | | <where> |
| | | CHECKOUT_USER_ID = #{checkOutUserId} |
| | | <if test="date !=null"> |
| | | AND TRUNC(CHECKOUT_TIME, 'DAY') = TO_DATE(#{date},'YYYY-MM-DD') |
| | | AND TRUNC(CHECKOUT_TIME) = TO_DATE(#{date},'YYYY-MM-DD') |
| | | </if> |
| | | <if test="id != null "> |
| | | and DEPARTMENT_ID = #{id} |