luodangjia
2025-01-02 268809bb4d1ace0bbe8ec20262ebb7d7822c8630
Merge remote-tracking branch 'origin/master'
12个文件已修改
1个文件已添加
205 ■■■■■ 已修改文件
medicalWaste-admin/src/main/java/com/sinata/web/controller/screen/ScreenController.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/domain/dto/MwRegulatoryRecordDTO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/domain/vo/DepartmentTagInfoVO.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/mapper/MwCollectRecordMapper.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/mapper/MwDisposalRecordMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/MwCollectRecordService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/MwDisposalRecordService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/biz/MonitorDeviceApiNewService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/biz/ScreenService.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwCollectRecordServiceImpl.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwDisposalRecordServiceImpl.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/resources/mapper/system/MwCollectRecordMapper.xml 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/resources/mapper/system/MwDisposalRecordMapper.xml 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-admin/src/main/java/com/sinata/web/controller/screen/ScreenController.java
@@ -2,6 +2,7 @@
import com.sinata.common.core.domain.R;
import com.sinata.system.domain.MedicalWasteStaticsVO;
import com.sinata.system.domain.vo.DepartmentTagInfoVO;
import com.sinata.system.domain.vo.ScreenDepartmentVO;
import com.sinata.system.domain.vo.TodayMedicalWastePieVO;
import com.sinata.system.domain.vo.TotalCollectWeightByTypeVO;
@@ -26,7 +27,7 @@
@Api(tags = {"数据大屏相关接口"})
@RestController
@RequiredArgsConstructor
@RequestMapping("/screen")
@RequestMapping("/backend/screen")
public class ScreenController {
    private final ScreenService screenService;
@@ -39,6 +40,18 @@
    @GetMapping(value = "/departmentList")
    public R<List<ScreenDepartmentVO>> departmentList() {
        return R.ok(screenService.departmentList());
    }
    /**
     * 获取单位标签信息
     *
     * @param id
     * @return
     */
    @ApiOperation("获取单位标签信息")
    @GetMapping("/getTagInfo/{id}")
    public R<DepartmentTagInfoVO> getTagInfo(@ApiParam(name = "id", value = "单位id", required = true) @PathVariable("id") Long id) {
        return R.ok(screenService.getTagInfo(id));
    }
    /**
@@ -74,4 +87,10 @@
    public R<TotalCollectWeightByTypeVO> totalCollectWeightByType(@ApiParam(name = "type", value = "统计类型 1:按周统计 2:按月统计") @PathVariable("type") Integer type) {
        return R.ok(screenService.totalCollectWeightByType(type));
    }
    /**
     * 医疗机构收集情况
     */
    @ApiOperation("医疗机构收集情况")
    @GetMapping("/medicalInstitutionCollectList")
    public R<List<MedicalInstitutionCollectListVO>>
}
medicalWaste-system/src/main/java/com/sinata/system/domain/dto/MwRegulatoryRecordDTO.java
@@ -1,5 +1,6 @@
package com.sinata.system.domain.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -22,6 +23,7 @@
    private Long departmentId;
    @ApiModelProperty("检查日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date checkDate;
    @ApiModelProperty("检查人员")
medicalWaste-system/src/main/java/com/sinata/system/domain/vo/DepartmentTagInfoVO.java
New file
@@ -0,0 +1,34 @@
package com.sinata.system.domain.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
 * @author mitao
 * @date 2025/1/2
 */
@Data
@ApiModel("单位标签信息视图对象")
public class DepartmentTagInfoVO {
    @ApiModelProperty("单位id")
    private Long id;
    @ApiModelProperty("单位名称")
    private String departmentName;
    @ApiModelProperty("当前医废库存-重量")
    private BigDecimal currentStorageWeight;
    @ApiModelProperty("当前医废库存-袋数")
    private Integer currentStorageBagNum;
    @ApiModelProperty("今日处置/产废情况-重量")
    private BigDecimal todayHandleWeight;
    @ApiModelProperty("今日处置/产废情况-袋数")
    private Integer todayHandleBagNum;
}
medicalWaste-system/src/main/java/com/sinata/system/mapper/MwCollectRecordMapper.java
@@ -10,6 +10,7 @@
import com.sinata.system.domain.dto.CollectTotalUpDto;
import com.sinata.system.domain.query.DisposalReportQuery;
import com.sinata.system.domain.query.MwCollectRecordQuery;
import com.sinata.system.domain.vo.DepartmentTagInfoVO;
import com.sinata.system.domain.vo.MedicalWasteProcessVO;
import com.sinata.system.domain.vo.MwCollectRecordVO;
import com.sinata.system.domain.vo.MwCollectRecordWarningVO;
@@ -103,4 +104,12 @@
     * @return
     */
    MedicalWasteStaticsVO queryMedicalWasteStatics(String treeCode);
    /**
     * 获取大屏医疗机构标签信息
     *
     * @param id
     * @return
     */
    DepartmentTagInfoVO getTagInfo(Long id);
}
medicalWaste-system/src/main/java/com/sinata/system/mapper/MwDisposalRecordMapper.java
@@ -5,6 +5,7 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sinata.system.domain.query.DisposalReportQuery;
import com.sinata.system.domain.query.MwDisposalRecordQuery;
import com.sinata.system.domain.vo.DepartmentTagInfoVO;
import com.sinata.system.domain.vo.DisposalRecordStaticsVO;
import com.sinata.system.domain.vo.MwCollectRecordVO;
import com.sinata.system.domain.vo.MwDisposalRecordItemVO;
@@ -78,4 +79,10 @@
     * @return
     */
    List<MwDisposalRecordWarningVO> queryDisposalListByDepartment();
    /**
     * @param id
     * @return
     */
    DepartmentTagInfoVO getTagInfo(Long id);
}
medicalWaste-system/src/main/java/com/sinata/system/service/MwCollectRecordService.java
@@ -10,6 +10,7 @@
import com.sinata.system.domain.dto.MwCollectRecordDTO;
import com.sinata.system.domain.query.DisposalReportQuery;
import com.sinata.system.domain.query.MwCollectRecordQuery;
import com.sinata.system.domain.vo.DepartmentTagInfoVO;
import com.sinata.system.domain.vo.MedicalWasteProcessVO;
import com.sinata.system.domain.vo.MwCollectRecordVO;
import com.sinata.system.domain.vo.MwCollectRecordWarningVO;
@@ -112,4 +113,12 @@
     * @return
     */
    MedicalWasteStaticsVO queryMedicalWasteStatics(String treeCode);
    /**
     * 获取大屏医疗机构标签信息
     *
     * @param id
     * @return
     */
    DepartmentTagInfoVO getTagInfo(Long id);
}
medicalWaste-system/src/main/java/com/sinata/system/service/MwDisposalRecordService.java
@@ -6,6 +6,7 @@
import com.sinata.system.domain.query.DisposalReportQuery;
import com.sinata.system.domain.query.MwDisposalRecordItemQuery;
import com.sinata.system.domain.query.MwDisposalRecordQuery;
import com.sinata.system.domain.vo.DepartmentTagInfoVO;
import com.sinata.system.domain.vo.DisposalRecordStaticsVO;
import com.sinata.system.domain.vo.MwCollectRecordVO;
import com.sinata.system.domain.vo.MwDisposalRecordItemVO;
@@ -70,4 +71,12 @@
     * @return
     */
    List<MwDisposalRecordWarningVO> queryDisposalListByDepartment();
    /**
     * 获取大屏处置单位标签信息
     *
     * @param id
     * @return
     */
    DepartmentTagInfoVO getTagInfo(Long id);
}
medicalWaste-system/src/main/java/com/sinata/system/service/biz/MonitorDeviceApiNewService.java
@@ -21,6 +21,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
@Service
@Slf4j
@@ -61,7 +62,7 @@
     */
    public String getJSession(Integer type) {
        String key = "monitor:device:jsession:now";
        String jsession = redisTemplate.opsForValue().get(key).toString();
        String jsession = (String) redisTemplate.opsForValue().get(key);
        Long timeOut = 604800L;
        if (jsession == null || type == 1) {
            String loginUrl = String.format(
@@ -79,7 +80,7 @@
                throw new ServiceException("视频服务器连接失败");
            }
        }
        redisTemplate.opsForValue().set(key, jsession, timeOut);
        redisTemplate.opsForValue().set(key, jsession, timeOut, TimeUnit.SECONDS);
        return jsession;
    }
medicalWaste-system/src/main/java/com/sinata/system/service/biz/ScreenService.java
@@ -8,6 +8,7 @@
import com.sinata.system.domain.MedicalWasteStaticsVO;
import com.sinata.system.domain.MwCollectRecord;
import com.sinata.system.domain.SysDepartment;
import com.sinata.system.domain.vo.DepartmentTagInfoVO;
import com.sinata.system.domain.vo.ScreenDepartmentVO;
import com.sinata.system.domain.vo.SysDictDataVO;
import com.sinata.system.domain.vo.TodayMedicalWastePieVO;
@@ -15,6 +16,7 @@
import com.sinata.system.enums.DepartmentEnum;
import com.sinata.system.service.ISysDictDataService;
import com.sinata.system.service.MwCollectRecordService;
import com.sinata.system.service.MwDisposalRecordService;
import com.sinata.system.service.SysDepartmentService;
import lombok.RequiredArgsConstructor;
import org.jetbrains.annotations.NotNull;
@@ -39,6 +41,7 @@
    private final SysDepartmentService sysDepartmentService;
    private final MwCollectRecordService mwCollectRecordService;
    private final ISysDictDataService sysDictDataService;
    private final MwDisposalRecordService mwDisposalRecordService;
    /**
     * 机构分布-获取机构列表
@@ -51,6 +54,25 @@
        return BeanUtils.copyToList(list, ScreenDepartmentVO.class);
    }
    /**
     * 获取大屏单位标签信息
     *
     * @param id
     * @return
     */
    public DepartmentTagInfoVO getTagInfo(Long id) {
        SysDepartment department = sysDepartmentService.getById(id);
        DepartmentTagInfoVO vo = null;
        if (Objects.isNull(department)) {
            throw new ServiceException("单位不存在");
        }
        if (department.getOrgType().equals(DepartmentEnum.MEDICAL_INSTITUTION.getCode())) {
            vo = mwCollectRecordService.getTagInfo(id);
        } else {
            vo = mwDisposalRecordService.getTagInfo(id);
        }
        return vo;
    }
    /**
     * 预警数据统计
     *
@@ -160,4 +182,6 @@
        }
        return vo;
    }
}
medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwCollectRecordServiceImpl.java
@@ -13,6 +13,7 @@
import com.sinata.system.domain.dto.MwCollectRecordDTO;
import com.sinata.system.domain.query.DisposalReportQuery;
import com.sinata.system.domain.query.MwCollectRecordQuery;
import com.sinata.system.domain.vo.DepartmentTagInfoVO;
import com.sinata.system.domain.vo.MedicalWasteProcessVO;
import com.sinata.system.domain.vo.MwCollectRecordVO;
import com.sinata.system.domain.vo.MwCollectRecordWarningVO;
@@ -195,4 +196,15 @@
    public MedicalWasteStaticsVO queryMedicalWasteStatics(String treeCode) {
        return baseMapper.queryMedicalWasteStatics(treeCode);
    }
    /**
     * 获取大屏医疗机构标签信息
     *
     * @param id
     * @return
     */
    @Override
    public DepartmentTagInfoVO getTagInfo(Long id) {
        return baseMapper.getTagInfo(id);
    }
}
medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwDisposalRecordServiceImpl.java
@@ -8,6 +8,7 @@
import com.sinata.system.domain.query.DisposalReportQuery;
import com.sinata.system.domain.query.MwDisposalRecordItemQuery;
import com.sinata.system.domain.query.MwDisposalRecordQuery;
import com.sinata.system.domain.vo.DepartmentTagInfoVO;
import com.sinata.system.domain.vo.DisposalRecordStaticsVO;
import com.sinata.system.domain.vo.MwCollectRecordVO;
import com.sinata.system.domain.vo.MwDisposalRecordItemVO;
@@ -113,4 +114,15 @@
    public List<MwDisposalRecordWarningVO> queryDisposalListByDepartment() {
        return baseMapper.queryDisposalListByDepartment();
    }
    /**
     * 获取大屏单位标签信息
     *
     * @param id
     * @return
     */
    @Override
    public DepartmentTagInfoVO getTagInfo(Long id) {
        return baseMapper.getTagInfo(id);
    }
}
medicalWaste-system/src/main/resources/mapper/system/MwCollectRecordMapper.xml
@@ -408,36 +408,36 @@
            parameterType="java.lang.Long">
        SELECT
        -- 今日收集
        COALESCE(SUM(CASE WHEN TRUNC(MCR.COLLECT_TIME) = TRUNC(SYSDATE) THEN MCR.WEIGHT ELSE 0 END), 0) AS
        COALESCE(SUM(IF(TRUNC(MCR.COLLECT_TIME) = TRUNC(SYSDATE), MCR.WEIGHT, 0)), 0) AS
        todayCollectWeight,
        COALESCE(COUNT(CASE WHEN TRUNC(MCR.COLLECT_TIME) = TRUNC(SYSDATE) THEN MCR.ID ELSE NULL END), 0) AS
        COALESCE(COUNT(IF(TRUNC(MCR.COLLECT_TIME) = TRUNC(SYSDATE), MCR.ID, NULL)), 0) AS
        todayCollectBagNum,
        -- 今日出库
        COALESCE(SUM(CASE WHEN TRUNC(MCR.CHECKOUT_TIME) = TRUNC(SYSDATE) THEN MCR.WEIGHT ELSE 0 END), 0) AS
        COALESCE(SUM(IF(TRUNC(MCR.CHECKOUT_TIME) = TRUNC(SYSDATE), MCR.WEIGHT, 0)), 0) AS
        todayCheckoutWeight,
        COALESCE(COUNT(CASE WHEN TRUNC(MCR.CHECKOUT_TIME) = TRUNC(SYSDATE) THEN MCR.ID ELSE NULL END), 0) AS
        COALESCE(COUNT(IF(TRUNC(MCR.CHECKOUT_TIME) = TRUNC(SYSDATE), MCR.ID, NULL)), 0) AS
        todayCheckoutBagNum,
        -- 待转运(状态为 1 暂存中)
        COALESCE(SUM(CASE WHEN MCR.STATUS = 1 THEN MCR.WEIGHT ELSE 0 END), 0) AS toBeTransportedWeight,
        COALESCE(COUNT(CASE WHEN MCR.STATUS = 1 THEN MCR.ID ELSE NULL END), 0) AS toBeTransportedBagNum,
        COALESCE(SUM(IF(MCR.STATUS = 1, MCR.WEIGHT, 0)), 0) AS toBeTransportedWeight,
        COALESCE(COUNT(IF(MCR.STATUS = 1, MCR.ID, NULL)), 0) AS toBeTransportedBagNum,
        -- 运输中(状态为 2 运输中)
        COALESCE(SUM(CASE WHEN MCR.STATUS = 2 THEN MCR.WEIGHT ELSE 0 END), 0) AS inTransitWeight,
        COALESCE(COUNT(CASE WHEN MCR.STATUS = 2 THEN MCR.ID ELSE NULL END), 0) AS inTransitBagNum,
        COALESCE(SUM(IF(MCR.STATUS = 2, MCR.WEIGHT, 0)), 0) AS inTransitWeight,
        COALESCE(COUNT(IF(MCR.STATUS = 2, MCR.ID, NULL)), 0) AS inTransitBagNum,
        -- 已入场(状态为 3 已接收)
        COALESCE(SUM(CASE WHEN MCR.STATUS = 3 THEN MCR.WEIGHT ELSE 0 END), 0) AS enteredAlreadyWeight,
        COALESCE(COUNT(CASE WHEN MCR.STATUS = 3 THEN MCR.ID ELSE NULL END), 0) AS enteredAlreadyBagNum,
        COALESCE(SUM(IF(MCR.STATUS = 3, MCR.WEIGHT, 0)), 0) AS enteredAlreadyWeight,
        COALESCE(COUNT(IF(MCR.STATUS = 3, MCR.ID, NULL)), 0) AS enteredAlreadyBagNum,
        -- 待处置(状态为 4 待处置)
        COALESCE(SUM(CASE WHEN MCR.STATUS = 4 THEN MCR.WEIGHT ELSE 0 END), 0) AS toBeDisposedOfWeight,
        COALESCE(COUNT(CASE WHEN MCR.STATUS = 4 THEN MCR.ID ELSE NULL END), 0) AS toBeDisposedOfBagNum,
        COALESCE(SUM(IF(MCR.STATUS = 4, MCR.WEIGHT, 0)), 0) AS toBeDisposedOfWeight,
        COALESCE(COUNT(IF(MCR.STATUS = 4, MCR.ID, NULL)), 0) AS toBeDisposedOfBagNum,
        -- 已处置(状态为 5 已处置)
        COALESCE(SUM(CASE WHEN MCR.STATUS = 5 THEN MCR.WEIGHT ELSE 0 END), 0) AS disposedWeight,
        COALESCE(COUNT(CASE WHEN MCR.STATUS = 5 THEN MCR.ID ELSE NULL END), 0) AS disposedBagNum
        COALESCE(SUM(IF(MCR.STATUS = 5, MCR.WEIGHT, 0)), 0) AS disposedWeight,
        COALESCE(COUNT(IF(MCR.STATUS = 5, MCR.ID, NULL)), 0) AS disposedBagNum
        FROM
        MW_COLLECT_RECORD MCR LEFT JOIN SYS_DEPARTMENT SD ON SD.ID = MCR.DEPARTMENT_ID
        <where>
@@ -447,5 +447,19 @@
            </if>
        </where>
    </select>
    <select id="getTagInfo" resultType="com.sinata.system.domain.vo.DepartmentTagInfoVO"
            parameterType="java.lang.Long">
        SELECT SD.ID,SD.DEPARTMENT_NAME,COALESCE(SUM(MCR.WEIGHT), 0) AS currentStorageWeight,
        COUNT(MCR.ID) AS currentStorageBagNum,
        COALESCE(SUM(IF(TRUNC(MCR.COLLECT_TIME) = TRUNC(SYSDATE), MCR.WEIGHT, 0)), 0) AS
        todayHandleWeight,
        COALESCE(COUNT(IF(TRUNC(MCR.COLLECT_TIME) = TRUNC(SYSDATE), MCR.ID, NULL)), 0) AS
        todayHandleBagNum FROM MW_COLLECT_RECORD MCR LEFT JOIN SYS_DEPARTMENT SD ON MCR.DEPARTMENT_ID
        <where>
            MCR.DEL_FLAG = 0,
            MCR.DEPARTMENT_ID = #{id}
        </where>
        GROUP BY MCR.DEPARTMENT_ID
    </select>
</mapper>
medicalWaste-system/src/main/resources/mapper/system/MwDisposalRecordMapper.xml
@@ -163,5 +163,24 @@
        </where>
        GROUP BY MDR.DEPARTMENT_ID
    </select>
    <select id="getTagInfo" resultType="com.sinata.system.domain.vo.DepartmentTagInfoVO"
            parameterType="java.lang.Long">
        SELECT SD.ID ,SD.DEPARTMENT_NAME,
        COALESCE(SUM(IF(MCR.STATUS = 3, MCR.WEIGHT,0)), 0) AS currentStorageWeight,
        COALESCE(COUNT(IF(MCR.STATUS = 3, MCR.ID,NULL)), 0) AS currentStorageBagNum,
        COALESCE(SUM(IF(TRUNC(MCR.DISPOSAL_TIME) = TRUNC(SYSDATE) AND MCR.STATUS = 4, MCR.WEIGHT, 0)), 0) AS
        todayHandleWeight,
        COALESCE(COUNT(IF(TRUNC(MCR.DISPOSAL_TIME) = TRUNC(SYSDATE) AND MCR.STATUS = 4, MCR.ID, NULL)), 0) AS
        todayHandleBagNum
        FROM MW_DISPOSAL_RECORD MDR
        LEFT JOIN MW_DISPOSAL_RECORD_ITEM MDRI ON MDR.ID = MDRI.DISPOSAL_RECORD_ID
        LEFT JOIN MW_COLLECT_RECORD MCR ON MCR.ID = MDRI.COLLECT_RECORD_ID
        LEFT JOIN SYS_DEPARTMENT SD ON MDR.DEPARTMENT_ID
        <where>
            MDR.DEL_FLAG = 0
            AND MDR.DEPARTMENT_ID = #{id}
        </where>
        GROUP BY MDR.DEPARTMENT_ID
    </select>
</mapper>