medicalWaste-admin/src/main/java/com/sinata/web/controller/applet/AppMwCheckoutRecordController.java
@@ -7,10 +7,7 @@ import com.sinata.common.core.domain.entity.SysUser; import com.sinata.common.entity.PageDTO; import com.sinata.common.utils.SecurityUtils; import com.sinata.system.domain.MwCheckoutRecord; import com.sinata.system.domain.MwDisposalHandleRecord; import com.sinata.system.domain.MwDisposalRecord; import com.sinata.system.domain.MwTransitCar; import com.sinata.system.domain.*; import com.sinata.system.domain.dto.CheckOutDto; import com.sinata.system.domain.dto.CollectTotalUpDto; import com.sinata.system.domain.query.CheckoutRecordQuery; @@ -126,11 +123,12 @@ @ApiOperation(value = "出库统计下") @PostMapping("/record") public R<List<CheckOutDto>> record() { public R<List<CheckOutDto>> record(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date) { SysUser sysUser = SecurityUtils.getLoginUser().getUser(); SysUser byId2 = userService.getById(sysUser.getUserId()); LocalDate now = LocalDate.now(); List<MwCheckoutRecord> list = mwCheckoutRecordService.lambdaQuery().eq(MwCheckoutRecord::getDepartmentId, byId2.getDepartmentId()).orderByDesc(MwCheckoutRecord::getCheckoutTime).list(); List<MwCheckoutRecord> list = mwCheckoutRecordService.lambdaQuery().ge(MwCheckoutRecord::getCreateTime, date.atStartOfDay()) .le(MwCheckoutRecord::getCreateTime, date.atTime(23,59,59)).eq(MwCheckoutRecord::getDepartmentId, byId2.getDepartmentId()).orderByDesc(MwCheckoutRecord::getCheckoutTime).list(); List<CheckOutDto> backList = new ArrayList<>(); for (MwCheckoutRecord mwCheckoutRecord : list) { CheckOutDto checkOutDto = new CheckOutDto(); medicalWaste-admin/src/main/java/com/sinata/web/controller/applet/AppMwCollectRecordController.java
@@ -219,7 +219,9 @@ public R<List<HospitalCollectTotalUpDto>> tanscollecttotal2(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date) { SysUser sysUser = SecurityUtils.getLoginUser().getUser(); //先获取医院ids List<MwCollectRecord> list = collectRecordService.lambdaQuery().eq(date!=null,MwCollectRecord::getCheckoutTime,date).eq(MwCollectRecord::getCheckoutUserId, sysUser.getUserId()).groupBy(MwCollectRecord::getDepartmentId).list(); List<MwCollectRecord> list = collectRecordService.lambdaQuery().ge(MwCollectRecord::getCheckoutTime, date.atStartOfDay()) .le(MwCollectRecord::getCheckoutTime, date.atTime(23,59,59)) .eq(MwCollectRecord::getCheckoutUserId, sysUser.getUserId()).groupBy(MwCollectRecord::getDepartmentId).list(); //循环医院,然后放入 List<HospitalCollectTotalUpDto> list1 = new ArrayList<>(); for (MwCollectRecord mwCollectRecord : list) { medicalWaste-system/src/main/resources/mapper/system/MwCheckoutRecordMapper.xml
@@ -231,7 +231,7 @@ <select id="totalUp" 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> CHECKOUT_TIME is not null AND DEPARTMENT_ID = #{departmentId} CHECKOUT_TIME is not null AND DEPARTMENT_ID = #{departmentId} AND TRUNC(COLLECT_TIME, 'DAY') = TO_DATE(#{date},'YYYY-MM-DD') </where> GROUP BY WASTE_TYPE </select>