Merge branch 'master' of https://gitee.com/boymi/YiFeiNN
| | |
| | | LocalDate now = LocalDate.now(); |
| | | for (SysDepartment sysDepartment : list) { |
| | | //获取库存总量 |
| | | BigDecimal count1 = collectRecordService.lambdaQuery().eq(MwCollectRecord::getReceiveDepartmentId, sysDepartment.getId()).list().stream() |
| | | BigDecimal count1 = collectRecordService.lambdaQuery().eq(MwCollectRecord::getReceiveDepartmentId, sysDepartment.getId()).eq(MwCollectRecord::getStatus ,3).list().stream() |
| | | .map(MwCollectRecord::getWeight) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | //获取接收数量 |
| | |
| | | @ApiOperation(value = "接收统计上",tags = "处置人员") |
| | | @PostMapping("/out/total") |
| | | public R<List<CollectTotalUpDto>> outtotal(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | return R.ok(mwCheckoutRecordService.totalUp2(date,sysUser.getUserId())); |
| | | // SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | SysDepartment myDepartment = departmentService.getMyDepartment(); |
| | | return R.ok(mwCheckoutRecordService.totalUp2(date,myDepartment.getId())); |
| | | } |
| | | @ApiOperation(value = "接收统计下",tags = "处置人员") |
| | | @PostMapping("/out/record") |
| | | 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(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(); |
| | | // SysUser sysUser1 = SecurityUtils.getLoginUser().getUser(); |
| | | // SysUser sysUser = userService.getById(sysUser1.getUserId()); |
| | | // LocalDate now = LocalDate.now(); |
| | | SysDepartment myDepartment = departmentService.getMyDepartment(); |
| | | 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, myDepartment.getId()).orderByDesc(MwDisposalRecord::getReceiveTime).list(); |
| | | List<CheckOutDto> backList = new ArrayList<>(); |
| | | for (MwDisposalRecord mwCheckoutRecord : list) { |
| | | CheckOutDto checkOutDto = new CheckOutDto(); |
| | |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @ApiOperation("库存详情") |
| | | @PostMapping("/record1") |
| | | public R<List<MwCollectRecord>> record1(@RequestParam String boxNumber) { |
| | | List<MwCollectRecord> list = collectRecordService.lambdaQuery().isNull(MwCollectRecord::getCheckoutTime).eq(MwCollectRecord::getBoxNumber, boxNumber).orderByDesc(MwCollectRecord::getCollectTime).list(); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("收集统计上") |
| | | @PostMapping("/collect/total") |
| | | public R<List<CollectTotalUpDto>> collecttotal1(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date) { |
| | |
| | | @ApiOperation(value = "更换绑定车辆",tags = "运输人员") |
| | | @PostMapping("/change") |
| | | public R<List<MwTransitCar>> change(@RequestParam Long carId) { |
| | | |
| | | SysUser one = userService.lambdaQuery().eq(SysUser::getCarId, carId).one(); |
| | | if (one!=null){ |
| | | return R.fail("当前车辆已绑定"); |
| | | } |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | SysUser byId = userService.getById(sysUser.getUserId()); |
| | | byId.setCarId(carId); |
| | |
| | | List<CollectTotalUpDto> totalUp(@Param("date") LocalDate date, @Param("departmentId")Long departmentId); |
| | | List<CollectTotalUpDto> totalUp4(@Param("departmentId")Long departmentId); |
| | | List<CollectTotalUpDto> totalUp2(@Param("date") LocalDate date ,@Param("departmentId")Long departmentId); |
| | | List<CollectTotalUpDto> totalUp22(@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, Long departmentId); |
| | | List<CollectTotalUpDto> totalUp22(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.totalUp2(date,departmentId); |
| | | } |
| | | @Override |
| | | public List<CollectTotalUpDto> totalUp22(LocalDate date,Long departmentId) { |
| | | return this.baseMapper.totalUp22(date,departmentId); |
| | | } |
| | | @Override |
| | | public List<CollectTotalUpDto> totalUp5( Long departmentId) { |
| | | return this.baseMapper.totalUp5(departmentId); |
| | | } |
| | |
| | | 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 DEPARTMENT_ID = #{departmentId} |
| | | RECEIVE_USER_ID is not null AND RECEIVE_DEPARTMENT_ID = #{departmentId} |
| | | <if test="date != null"> |
| | | AND TRUNC(RECEIVE_TIME) = TO_DATE(#{date}, 'YYYY-MM-DD') |
| | | </if> |
| | |
| | | GROUP BY WASTE_TYPE |
| | | </select> |
| | | |
| | | |
| | | <select id="totalUp22" 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> |
| | | DISPOSAL_USER_ID is not null AND RECEIVE_DEPARTMENT_ID = #{departmentId} |
| | | <if test="date != null"> |
| | | AND TRUNC(RECEIVE_TIME) = TO_DATE(#{date}, 'YYYY-MM-DD') |
| | | </if> |
| | | </where> |
| | | GROUP BY WASTE_TYPE |
| | | </select> |
| | | <select id="totalUp5" 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> |
| | | RECEIVE_DEPARTMENT_ID is not null AND RECEIVE_DEPARTMENT_ID = #{departmentId} |
| | | RECEIVE_DEPARTMENT_ID is not null AND RECEIVE_DEPARTMENT_ID = #{departmentId} AND STATUS = 3 |
| | | </where> |
| | | GROUP BY WASTE_TYPE |
| | | </select> |