Merge remote-tracking branch 'origin/master'
| | |
| | | |
| | | 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; |
| | |
| | | @Api(tags = {"数据大屏相关接口"}) |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @RequestMapping("/screen") |
| | | @RequestMapping("/backend/screen") |
| | | public class ScreenController { |
| | | private final ScreenService screenService; |
| | | |
| | |
| | | @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)); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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>> |
| | | } |
| | |
| | | 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; |
| | |
| | | private Long departmentId; |
| | | |
| | | @ApiModelProperty("检查日期") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date checkDate; |
| | | |
| | | @ApiModelProperty("检查人员") |
New file |
| | |
| | | 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; |
| | | } |
| | |
| | | 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; |
| | |
| | | * @return |
| | | */ |
| | | MedicalWasteStaticsVO queryMedicalWasteStatics(String treeCode); |
| | | |
| | | /** |
| | | * 获取大屏医疗机构标签信息 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | DepartmentTagInfoVO getTagInfo(Long id); |
| | | } |
| | |
| | | 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; |
| | |
| | | * @return |
| | | */ |
| | | List<MwDisposalRecordWarningVO> queryDisposalListByDepartment(); |
| | | |
| | | /** |
| | | * @param id |
| | | * @return |
| | | */ |
| | | DepartmentTagInfoVO getTagInfo(Long id); |
| | | } |
| | |
| | | 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; |
| | |
| | | * @return |
| | | */ |
| | | MedicalWasteStaticsVO queryMedicalWasteStatics(String treeCode); |
| | | |
| | | /** |
| | | * 获取大屏医疗机构标签信息 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | DepartmentTagInfoVO getTagInfo(Long id); |
| | | } |
| | |
| | | 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; |
| | |
| | | * @return |
| | | */ |
| | | List<MwDisposalRecordWarningVO> queryDisposalListByDepartment(); |
| | | |
| | | /** |
| | | * 获取大屏处置单位标签信息 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | DepartmentTagInfoVO getTagInfo(Long id); |
| | | } |
| | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | @Service |
| | | @Slf4j |
| | |
| | | */ |
| | | 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( |
| | |
| | | throw new ServiceException("视频服务器连接失败"); |
| | | } |
| | | } |
| | | redisTemplate.opsForValue().set(key, jsession, timeOut); |
| | | redisTemplate.opsForValue().set(key, jsession, timeOut, TimeUnit.SECONDS); |
| | | return jsession; |
| | | } |
| | | |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | private final SysDepartmentService sysDepartmentService; |
| | | private final MwCollectRecordService mwCollectRecordService; |
| | | private final ISysDictDataService sysDictDataService; |
| | | private final MwDisposalRecordService mwDisposalRecordService; |
| | | |
| | | /** |
| | | * 机构分布-获取机构列表 |
| | |
| | | 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; |
| | | } |
| | | /** |
| | | * 预警数据统计 |
| | | * |
| | |
| | | } |
| | | return vo; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | public MedicalWasteStaticsVO queryMedicalWasteStatics(String treeCode) { |
| | | return baseMapper.queryMedicalWasteStatics(treeCode); |
| | | } |
| | | |
| | | /** |
| | | * 获取大屏医疗机构标签信息 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public DepartmentTagInfoVO getTagInfo(Long id) { |
| | | return baseMapper.getTagInfo(id); |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | public List<MwDisposalRecordWarningVO> queryDisposalListByDepartment() { |
| | | return baseMapper.queryDisposalListByDepartment(); |
| | | } |
| | | |
| | | /** |
| | | * 获取大屏单位标签信息 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public DepartmentTagInfoVO getTagInfo(Long id) { |
| | | return baseMapper.getTagInfo(id); |
| | | } |
| | | } |
| | |
| | | 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> |
| | |
| | | </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> |
| | |
| | | </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> |