mitao
2025-03-21 ccb5d44c524d0f941b173418586d4b7ed8e93530
Merge branch 'master' of https://gitee.com/boymi/YiFeiNN
10个文件已修改
93 ■■■■■ 已修改文件
medicalWaste-admin/src/main/java/com/sinata/web/controller/applet/AppDepartmentController.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-admin/src/main/java/com/sinata/web/controller/applet/AppMwCheckoutRecordController.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-admin/src/main/java/com/sinata/web/controller/applet/AppMwCollectRecordController.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-admin/src/main/java/com/sinata/web/controller/applet/AppUserController.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/mapper/MwCheckoutRecordMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/MwCheckoutRecordService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwCheckoutRecordServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/impl/SysDepartmentServiceImpl.java 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/resources/mapper/system/MwCheckoutRecordMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/resources/mapper/system/MwCollectRecordMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-admin/src/main/java/com/sinata/web/controller/applet/AppDepartmentController.java
@@ -126,9 +126,9 @@
            //获取库存总量
            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 +184,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);
medicalWaste-admin/src/main/java/com/sinata/web/controller/applet/AppMwCheckoutRecordController.java
@@ -64,17 +64,17 @@
    @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();
@@ -92,17 +92,17 @@
    @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();
medicalWaste-admin/src/main/java/com/sinata/web/controller/applet/AppMwCollectRecordController.java
@@ -272,7 +272,6 @@
    @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();
@@ -294,7 +293,6 @@
    @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();
@@ -303,7 +301,7 @@
        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);
    }
@@ -311,7 +309,6 @@
    @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();
@@ -519,8 +516,8 @@
        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));
medicalWaste-admin/src/main/java/com/sinata/web/controller/applet/AppUserController.java
@@ -65,7 +65,8 @@
    @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);
    }
medicalWaste-system/src/main/java/com/sinata/system/mapper/MwCheckoutRecordMapper.java
@@ -95,7 +95,7 @@
    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);
medicalWaste-system/src/main/java/com/sinata/system/service/MwCheckoutRecordService.java
@@ -106,7 +106,7 @@
    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);
medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwCheckoutRecordServiceImpl.java
@@ -97,8 +97,8 @@
        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) {
medicalWaste-system/src/main/java/com/sinata/system/service/impl/SysDepartmentServiceImpl.java
@@ -140,7 +140,6 @@
    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()
@@ -198,16 +197,44 @@
    }
    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);
medicalWaste-system/src/main/resources/mapper/system/MwCheckoutRecordMapper.xml
@@ -252,12 +252,10 @@
        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') &lt; TO_DATE(#{date2},'YYYY-MM-DD')
            </if>
        </where>
        GROUP BY WASTE_TYPE
medicalWaste-system/src/main/resources/mapper/system/MwCollectRecordMapper.xml
@@ -274,7 +274,7 @@
    <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>
@@ -292,7 +292,7 @@
        <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}