New file |
| | |
| | | package com.sinata.task; |
| | | |
| | | import com.sinata.system.domain.MwWarningRecord; |
| | | import com.sinata.system.enums.WarningStatusEnum; |
| | | import com.sinata.system.service.MwCollectRecordService; |
| | | import com.sinata.system.service.MwContractService; |
| | | import com.sinata.system.service.MwProtectionEquipmentRecordService; |
| | | import com.sinata.system.service.MwProtectionEquipmentService; |
| | | import com.sinata.system.service.MwStaffService; |
| | | import com.sinata.system.service.MwStagingRoomService; |
| | | import com.sinata.system.service.MwWarningConfigItemService; |
| | | import com.sinata.system.service.MwWarningConfigService; |
| | | import com.sinata.system.service.MwWarningRecordService; |
| | | import com.sinata.system.service.biz.TaskService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jetbrains.annotations.NotNull; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/12/30 |
| | | */ |
| | | @Component |
| | | @Slf4j |
| | | @RequiredArgsConstructor |
| | | public class WarningTask { |
| | | private final MwWarningConfigService mwWarningConfigService; |
| | | private final MwWarningConfigItemService mwWarningConfigItemService; |
| | | private final MwCollectRecordService mwCollectRecordService; |
| | | private final MwWarningRecordService mwWarningRecordService; |
| | | private final MwStagingRoomService mwStagingRoomService; |
| | | private final MwContractService mwContractService; |
| | | private final MwStaffService mwStaffService; |
| | | private final MwProtectionEquipmentService mwProtectionEquipmentService; |
| | | private final MwProtectionEquipmentRecordService mwProtectionEquipmentRecordService; |
| | | private final TaskService taskService; |
| | | |
| | | /** |
| | | * 出库超时预警 |
| | | */ |
| | | @Scheduled(cron = "${medical.crons.checkout-over-time}") |
| | | public void checkoutOverTime() { |
| | | log.info("开始执行【出库超时预警】定时任务"); |
| | | taskService.checkoutOverTime(); |
| | | log.info("定时任务【出库超时预警】执行完毕"); |
| | | } |
| | | |
| | | /** |
| | | * 封装预警记录 |
| | | * |
| | | * @param id |
| | | * @param warningTargetName |
| | | * @param departmentName |
| | | * @param message |
| | | * @param departmentId |
| | | * @param currentValue |
| | | * @param normalRange |
| | | * @return |
| | | */ |
| | | @NotNull |
| | | private static MwWarningRecord getMwWarningRecord(Integer type, Long id, String warningTargetName, String departmentName, String message, Long departmentId, String currentValue, String normalRange) { |
| | | MwWarningRecord warningRecord = new MwWarningRecord(); |
| | | warningRecord.setType(type); |
| | | warningRecord.setWarningTargetId(id); |
| | | warningRecord.setWarningTargetName(warningTargetName); |
| | | warningRecord.setDepartmentName(departmentName); |
| | | warningRecord.setMessage(message); |
| | | warningRecord.setDepartmentId(departmentId); |
| | | warningRecord.setCurrentValue(currentValue); |
| | | warningRecord.setNormalRange(normalRange); |
| | | warningRecord.setStatus(WarningStatusEnum.UNRESOLVED.getCode()); |
| | | warningRecord.setWarnTime(new Date()); |
| | | return warningRecord; |
| | | } |
| | | |
| | | /** |
| | | * 暂存间使用率预警 |
| | | */ |
| | | @Scheduled(cron = "${medical.crons.staging-room-capacity}") |
| | | public void stagingRoomStorage() { |
| | | log.info("开始执行【暂存间使用率预警】定时任务"); |
| | | taskService.stagingRoomStorage(); |
| | | log.info("定时任务【暂存间使用率预警】执行完毕"); |
| | | } |
| | | |
| | | /** |
| | | * 合同到期预警 |
| | | */ |
| | | @Scheduled(cron = "${medical.crons.contract-expire}") |
| | | public void contractExpire() { |
| | | log.info("开始执行【合同到期预警】定时任务"); |
| | | taskService.contractExpire(); |
| | | log.info("定时任务【合同到期预警】执行完毕"); |
| | | } |
| | | |
| | | /** |
| | | * 健康记录预警、人员记录预警 |
| | | */ |
| | | @Scheduled(cron = "${medical.crons.health-vaccine-record}") |
| | | public void healthRecord() { |
| | | log.info("开始执行【健康记录预警】【人员记录预警】定时任务"); |
| | | taskService.healthRecord(); |
| | | log.info("定时任务【健康记录预警】【人员记录预警】执行完毕"); |
| | | } |
| | | |
| | | /** |
| | | * 防护用品使用预警 防护用品库存预警 |
| | | */ |
| | | @Scheduled(cron = "${medical.crons.protection-equipment-use-stock}") |
| | | public void protectionEquipmentUse() { |
| | | log.info("开始执行【防护用品使用预警】【防护用品库存预警】定时任务"); |
| | | taskService.protectionEquipmentUse(); |
| | | log.info("定时任务【防护用品使用预警】【防护用品库存预警】执行完毕"); |
| | | } |
| | | |
| | | /** |
| | | * 医疗机构产废日预警 |
| | | */ |
| | | @Scheduled(cron = "${medical.crons.medical-institution-waste-day}") |
| | | public void medicalInstitutionWasteDay() { |
| | | log.info("开始执行【医疗机构产废日预警】定时任务"); |
| | | taskService.medicalInstitutionWasteDay(); |
| | | log.info("定时任务【医疗机构产废日预警】执行完毕"); |
| | | } |
| | | |
| | | /** |
| | | * 医疗机构产废月预警 |
| | | */ |
| | | @Scheduled(cron = "${medical.crons.medical-institution-waste-month}") |
| | | public void medicalInstitutionWasteMonth() { |
| | | log.info("开始执行【医疗机构产废月预警】定时任务"); |
| | | taskService.medicalInstitutionWasteMonth(); |
| | | log.info("定时任务【医疗机构产废月预警】执行完毕"); |
| | | } |
| | | |
| | | /** |
| | | * 医疗机构存储量 |
| | | */ |
| | | @Scheduled(cron = "${medical.crons.medical-institution-waste-storage}") |
| | | public void medicalInstitutionStorage() { |
| | | log.info("开始执行【医疗机构存储量】定时任务"); |
| | | taskService.medicalInstitutionStorage(); |
| | | log.info("定时任务【医疗机构存储量】执行完毕"); |
| | | } |
| | | |
| | | /** |
| | | * 车辆转运异常预警 |
| | | */ |
| | | @Scheduled(cron = "${medical.crons.transit-car}") |
| | | public void transitCar() { |
| | | log.info("开始执行【车辆转运异常预警】定时任务"); |
| | | taskService.transitCar(); |
| | | log.info("定时任务【车辆转运异常预警】执行完毕"); |
| | | } |
| | | |
| | | @Scheduled(cron = "${medical.crons.disposal-unit-storage}") |
| | | public void disposalUnitStorage() { |
| | | log.info("开始执行【处置单位存储量预警】定时任务"); |
| | | taskService.disposalUnitStorage(); |
| | | log.info("定时任务【处置单位存储量预警】执行完毕"); |
| | | } |
| | | } |
| | |
| | | import com.sinata.system.domain.dto.MwMicroEquipmentRecordDTO; |
| | | import com.sinata.system.domain.query.MwMicroEquipmentRecordQuery; |
| | | import com.sinata.system.domain.query.MwMicroEquipmentStaticsQuery; |
| | | import com.sinata.system.domain.vo.DepartmentReportVO; |
| | | import com.sinata.system.domain.vo.MwMicroEquipmentRecordVO; |
| | | import com.sinata.system.domain.vo.MwMicroEquipmentStaticsTitleVO; |
| | | import com.sinata.system.service.MwMicroEquipmentRecordService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | * @author mitao |
| | | * @since 2024-12-02 |
| | | */ |
| | | @Api(tags = {"设备使用记录相关接口"}) |
| | | @Api(tags = {"小型微波设备使用记录相关接口"}) |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | |
| | | return R.ok(mwMicroEquipmentRecordService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 设备使用记录详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation("设备使用记录详情") |
| | | @GetMapping("/{id}") |
| | | public R<MwMicroEquipmentRecordVO> detail(@ApiParam(name = "id", value = "设备id", required = true) @PathVariable("id") Long id) { |
| | | return R.ok(mwMicroEquipmentRecordService.detail(id)); |
| | | } |
| | | /** |
| | | * 导出设备使用记录 |
| | | * |
| | |
| | | */ |
| | | @ApiOperation("处置分析数据") |
| | | @PostMapping("/statics/data") |
| | | public R<List<List<String>>> staticsData(@Valid @RequestBody MwMicroEquipmentStaticsQuery query) { |
| | | public R<DepartmentReportVO> staticsData(@Valid @RequestBody MwMicroEquipmentStaticsQuery query) { |
| | | return R.ok(mwMicroEquipmentRecordService.getStaticsData(query)); |
| | | } |
| | | |
| | | /** |
| | | * 处置分析导出 |
| | | * |
| | |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 暂存间待处理医废分页列表 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @ApiOperation("暂存间待处理医废分页列表") |
| | | @PostMapping("/temporarilyStoredMedicalWaste") |
| | | public R<PageDTO<MwStorageRecordVO>> temporarilyStoredMedicalWaste(@Valid @RequestBody StorageRecordQuery query) { |
| | | return R.ok(mwStagingRoomService.temporarilyStoredMedicalWaste(query)); |
| | | } |
| | | } |
| | |
| | | import com.sinata.system.service.MwWarningRecordService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | return R.ok(mwWarningRecordService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 解除预警 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation("解除预警") |
| | | @GetMapping("/relieve/{id}") |
| | | public R<?> relieve(@ApiParam(name = "id", value = "预警记录id", required = true) @PathVariable("id") Long id) { |
| | | mwWarningRecordService.relieve(id); |
| | | return R.ok(); |
| | | } |
| | | @ApiOperation("预警信息导出") |
| | | @PostMapping("/export") |
| | | public void export(@RequestBody MwWarningRecordQuery query) { |
| | |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | medical: |
| | | crons: |
| | | checkout-over-time: 0 0/60 * * * ? |
| | | non-collect-platform: 0 0 7 * * ? |
| | | checkout-over-time: 0 0/60 * * * ? # 每小时执行一次 |
| | | staging-room-capacity: 0 * */3 * * ? # 每三小时执行一次 |
| | | contract-expire: 0 0 0 * * ? # 每日0点执行 |
| | | health-vaccine-record: 0 0 1 * * ? # 每日1点执行 |
| | | protection-equipment-use-stock: 0 0 2 * * ? # 每日2点执行 |
| | | medical-institution-waste-day: 0 0 3 * * ? # 每日3点执行 |
| | | medical-institution-waste-month: 0 30 0 1 * ? # 每月1日0点30分执行 |
| | | medical-institution-waste-storage: 0 0 4 * * ? # 每日4点执行 |
| | | transit-car: 0 0 0/1 * * ? # 每小时执行一次 |
| | | |
| | |
| | | long hour = diff % nd / nh; |
| | | return hour; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 计算天数差 |
| | | * |
| | | * @param endDate |
| | | * @param startTime |
| | | * @return |
| | | */ |
| | | public static long timeDistanceDay(Date endDate, Date startTime) { |
| | | long nd = 1000 * 24 * 60 * 60; |
| | | long diff = endDate.getTime() - startTime.getTime(); |
| | | long day = diff / nd; |
| | | return day; |
| | | } |
| | | |
| | | /** |
| | | * 增加 LocalDateTime ==> Date |
| | | */ |
| | |
| | | @TableField("REMARK") |
| | | private String remark; |
| | | |
| | | |
| | | @ApiModelProperty("层级关系") |
| | | @TableField("RELATION") |
| | | private String relation; |
| | | } |
| | |
| | | @TableField("REMARK") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("层级关系") |
| | | @TableField("RELATION") |
| | | private String relation; |
| | | |
| | | |
| | | } |
| | |
| | | @TableField("REMARK") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("层级关系") |
| | | @TableField("RELATION") |
| | | private String relation; |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.sinata.common.entity.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Setter |
| | | @TableName("MW_PROTECTION_TASK_EQUIPMENT") |
| | | @ApiModel(value = "MwProtectionTaskEquipment对象", description = "防护作业防护器具关系") |
| | | public class MwProtectionTaskEquipment extends BaseModel { |
| | | public class MwProtectionTaskEquipment implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | import com.sinata.common.entity.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.Date; |
| | | |
| | |
| | | * @author mitao |
| | | * @since 2024-12-02 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @Builder |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @TableName("MW_WARNING_RECORD") |
| | | @ApiModel(value = "MwWarningRecord对象", description = "预警记录表") |
| | | public class MwWarningRecord extends BaseModel { |
| | |
| | | @TableField("WARNING_TARGET_NAME") |
| | | private String warningTargetName; |
| | | |
| | | @ApiModelProperty("预警类型 预警类型 1:出库超时预警 2:暂存间使用率预警 3:合同到期预警 4:健康记录预警 " + |
| | | "5:疫苗记录预警 6:防护用品使用预警 7:医疗机构产废日预警 8:医疗机构产废月预警 " + |
| | | "9:医疗机构存储量预警 10:车辆转运异常预警 11:处置单位存储量预警") |
| | | @ApiModelProperty("预警类型 1:出库超时预警 2:暂存间使用率预警 3:合同到期预警 4:健康记录预警 " + |
| | | "5:疫苗记录预警 6:防护用品使用预警 7:防护用品库存预警 8:医疗机构产废日预警 " + |
| | | "9:医疗机构产废月预警 10:医疗机构存储量预警 11:车辆转运异常预警 12:处置单位存储量预警") |
| | | @TableField("TYPE") |
| | | private Integer type; |
| | | |
| | |
| | | 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; |
| | |
| | | |
| | | @ApiModelProperty("合同生效日期") |
| | | @NotNull(message = "合同生效日期不能为空") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date effectiveDate; |
| | | |
| | | @ApiModelProperty("合同终止日期") |
| | | @NotNull(message = "合同终止日期不能为空") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date terminationDate; |
| | | |
| | | @ApiModelProperty("甲方名称") |
| | |
| | | |
| | | @ApiModelProperty("附件列表") |
| | | private List<MwAttachmentDTO> attachmentList; |
| | | |
| | | @ApiModelProperty("层级关系") |
| | | @NotBlank(message = "层级关系不能为空") |
| | | private String relation; |
| | | } |
| | |
| | | public class MwMicroEquipmentDTO { |
| | | |
| | | @ApiModelProperty(value = "小型微波设备id", notes = "新增不传,编辑必传") |
| | | @NotNull(message = "设备id不能为空") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("区域id(医院)") |
| | |
| | | |
| | | @ApiModelProperty("备注") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("层级关系") |
| | | @NotBlank(message = "层级关系不能为空") |
| | | private String relation; |
| | | |
| | | } |
| | |
| | | @ApiModel("防护作业使用器具数据传输对象") |
| | | public class MwProtectionTaskEquipmentDTO { |
| | | |
| | | @ApiModelProperty("防护作业id") |
| | | private Long protectionTaskId; |
| | | @ApiModelProperty("防护器具id") |
| | | private Long protectionEquipmentId; |
| | | |
| | | @ApiModelProperty("使用量") |
| | | private Integer usageQuantity; |
| | |
| | | @ApiModelProperty("医废类型") |
| | | private Long wasteType; |
| | | |
| | | @ApiModelProperty("医废类型名称") |
| | | private String wasteTypeStr; |
| | | |
| | | @ApiModelProperty("预警值") |
| | | private Integer value; |
| | | |
| | |
| | | |
| | | @ApiModelProperty("入库时间-结束") |
| | | private Date collectTimeEnd; |
| | | |
| | | @ApiModelProperty("医废状态 1:暂存中 2:运输中 3:已接收 4:已处置") |
| | | private Integer status; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("机构名称") |
| | | private String departmentName; |
| | | |
| | | @ApiModelProperty("设备名称") |
| | | private String equipmentName; |
| | | |
| | | @ApiModelProperty("类别") |
| | | private List<String> legend; |
| | |
| | | package com.sinata.system.domain.vo; |
| | | |
| | | import cn.idev.excel.annotation.ExcelIgnore; |
| | | import cn.idev.excel.annotation.ExcelProperty; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | private static final long serialVersionUID = -851971023455890457L; |
| | | |
| | | @ApiModelProperty("记录id") |
| | | @ExcelIgnore |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("出库时间") |
| | |
| | | private Date checkoutTime; |
| | | |
| | | @ApiModelProperty("区域id") |
| | | @ExcelIgnore |
| | | private Long departmentId; |
| | | |
| | | @ApiModelProperty("医院名称") |
| | |
| | | private String licensePlateNumber; |
| | | |
| | | @ApiModelProperty("转运线路") |
| | | @ExcelIgnore |
| | | private String routeName; |
| | | |
| | | } |
| | |
| | | package com.sinata.system.domain.vo; |
| | | |
| | | import cn.idev.excel.annotation.ExcelIgnore; |
| | | import cn.idev.excel.annotation.ExcelProperty; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | public class MwCollectRecordVO { |
| | | |
| | | @ApiModelProperty("收集记录id") |
| | | @ExcelIgnore |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("区域id") |
| | | @ExcelIgnore |
| | | private Long departmentId; |
| | | |
| | | @ApiModelProperty("医院名称") |
| | |
| | | private String hospitalName; |
| | | |
| | | @ApiModelProperty("暂存间id") |
| | | @ExcelIgnore |
| | | private Long stagingRoomId; |
| | | |
| | | @ApiModelProperty("医废编号") |
| | |
| | | private String medicalWasteNumber; |
| | | |
| | | @ApiModelProperty("转运箱id") |
| | | @ExcelIgnore |
| | | private Long boxId; |
| | | |
| | | @ApiModelProperty("箱子编号") |
| | |
| | | private BigDecimal weight; |
| | | |
| | | @ApiModelProperty("出库人员id") |
| | | @ExcelIgnore |
| | | private Long checkoutUserId; |
| | | |
| | | @ApiModelProperty("出库人员姓名") |
| | | @ExcelIgnore |
| | | private String checkoutUserName; |
| | | |
| | | @ApiModelProperty("出库时间") |
| | | @ExcelIgnore |
| | | private Date checkoutTime; |
| | | |
| | | @ApiModelProperty("医废状态 1:暂存中 2:运输中 3:已接收 4:已处置") |
| | |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("封箱时间") |
| | | @ExcelIgnore |
| | | private Date boxTime; |
| | | |
| | | @ApiModelProperty("收集人id") |
| | | @ExcelIgnore |
| | | private Long collectUserId; |
| | | |
| | | @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; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/12/31 |
| | | */ |
| | | @Data |
| | | @ApiModel("收集记录预警视图对象") |
| | | public class MwCollectRecordWarningVO { |
| | | |
| | | @ApiModelProperty("收集记录id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("区域id") |
| | | private Long departmentId; |
| | | |
| | | @ApiModelProperty("医院名称") |
| | | private String hospitalName; |
| | | |
| | | @ApiModelProperty("总重量") |
| | | private BigDecimal totalWeight; |
| | | |
| | | @ApiModelProperty("收集时间") |
| | | private Date collectTime; |
| | | |
| | | @ApiModelProperty("每日产废范围起") |
| | | private BigDecimal dailyMinWasteQuantity; |
| | | |
| | | @ApiModelProperty("每日产废范围止") |
| | | private BigDecimal dailyMaxWasteQuantity; |
| | | |
| | | @ApiModelProperty("每月产废范围起") |
| | | private BigDecimal monthlyMinWasteQuantity; |
| | | |
| | | @ApiModelProperty("每月产废范围止") |
| | | private BigDecimal monthlyMaxWasteQuantity; |
| | | |
| | | @ApiModelProperty("医废最大存储量") |
| | | private BigDecimal maximumStorageCapacity; |
| | | } |
| | |
| | | @ApiModelProperty("附件列表") |
| | | private List<MwAttachmentVO> attachmentList; |
| | | |
| | | @ApiModelProperty("层级关系") |
| | | private String relation; |
| | | |
| | | } |
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 2024/12/31 |
| | | */ |
| | | @Data |
| | | @ApiModel("处置单位储量预警视图对象") |
| | | public class MwDisposalRecordWarningVO { |
| | | |
| | | @ApiModelProperty("当前存储量") |
| | | private BigDecimal currentStorage; |
| | | |
| | | @ApiModelProperty("最大存储量") |
| | | private BigDecimal maximumStorageCapacity; |
| | | |
| | | @ApiModelProperty("区域id") |
| | | private Long departmentId; |
| | | |
| | | @ApiModelProperty("处置单位名称") |
| | | private String disposalUnitName; |
| | | |
| | | } |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author mitao |
| | |
| | | |
| | | @ApiModelProperty("备注") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("医废列表") |
| | | private List<MwStorageRecordVO> medicalWasteList; |
| | | } |
| | | |
| | |
| | | package com.sinata.system.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | |
| | | @Data |
| | | @ApiModel("处置分析视图对象") |
| | | public class MwMicroEquipmentStaticsVO { |
| | | |
| | | @ApiModelProperty("袋数") |
| | | private Integer bagNum; |
| | | |
| | | @ApiModelProperty("总重量") |
| | | private BigDecimal totalWeight; |
| | | |
| | | @ApiModelProperty("重量") |
| | | private BigDecimal weight; |
| | | |
| | | @ApiModelProperty("使用时间") |
| | | private Date useTime; |
| | | |
| | | @ApiModelProperty("医废类型") |
| | | private Long wasteType; |
| | | } |
| | |
| | | @ApiModelProperty("备注") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("层级关系") |
| | | private String relation; |
| | | |
| | | } |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @Data |
| | | @ApiModel("防护作业视图对象") |
| | | public class MwProtectionTaskVO { |
| | | |
| | | @ApiModelProperty("防护作业id") |
| | | private Long id; |
| | | |
| | |
| | | |
| | | @ApiModelProperty("层级关系") |
| | | private String relation; |
| | | |
| | | @ApiModelProperty(value = "作业时间") |
| | | private Date createTime; |
| | | } |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/12/12 |
| | |
| | | @ApiModelProperty("未使用数量") |
| | | private Integer unused; |
| | | |
| | | @ApiModelProperty("使用率") |
| | | private BigDecimal useRate; |
| | | |
| | | @ApiModelProperty("添加时间") |
| | | private String createTime; |
| | | |
| | |
| | | package com.sinata.system.domain.vo; |
| | | |
| | | import cn.idev.excel.annotation.ExcelIgnore; |
| | | import cn.idev.excel.annotation.ExcelProperty; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | @Data |
| | | @ApiModel("暂存间入库视图对象") |
| | | public class MwStorageRecordVO { |
| | | |
| | | @ApiModelProperty("收集记录id") |
| | | @ExcelIgnore |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("区域id") |
| | | @ExcelIgnore |
| | | private Long departmentId; |
| | | |
| | | @ApiModelProperty("医院名称") |
| | |
| | | private String hospitalName; |
| | | |
| | | @ApiModelProperty("暂存间id") |
| | | @ExcelIgnore |
| | | private Long stagingRoomId; |
| | | |
| | | @ApiModelProperty("暂存间名称") |
| | |
| | | private String medicalWasteNumber; |
| | | |
| | | @ApiModelProperty("转运箱id") |
| | | @ExcelIgnore |
| | | private Long boxId; |
| | | |
| | | @ApiModelProperty("箱子编号") |
| | | @ExcelProperty(value = "箱子编号", index = 5) |
| | | private String boxNumber; |
| | | |
| | | @ApiModelProperty("袋数") |
| | | @ExcelIgnore |
| | | private Integer bagNum; |
| | | |
| | | @ApiModelProperty("医废类型(数据字典id)") |
| | | private Integer wasteType; |
| | |
| | | private BigDecimal weight; |
| | | |
| | | @ApiModelProperty("出库人员id") |
| | | @ExcelIgnore |
| | | private Long checkoutUserId; |
| | | |
| | | @ApiModelProperty("出库人员姓名") |
| | | @ExcelIgnore |
| | | private String checkoutUserName; |
| | | |
| | | @ApiModelProperty("出库时间") |
| | | @ExcelIgnore |
| | | private Date checkoutTime; |
| | | |
| | | @ApiModelProperty("医废状态 1:暂存中 2:运输中 3:已接收 4:已处置") |
| | |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("封箱时间") |
| | | @ExcelIgnore |
| | | private Date boxTime; |
| | | |
| | | @ApiModelProperty("收集人id") |
| | | @ExcelIgnore |
| | | private Long collectUserId; |
| | | |
| | | @ApiModelProperty("入库人员") |
| | |
| | | @ApiModelProperty("入库时间") |
| | | @ExcelProperty(value = "入库时间", index = 1) |
| | | private Date collectTime; |
| | | |
| | | } |
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 2024/12/31 |
| | | */ |
| | | @Data |
| | | @ApiModel("转运车辆预警视图对象") |
| | | public class MwTransitCarWarningVO { |
| | | |
| | | @ApiModelProperty("车辆id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("区域id(处置单位id)") |
| | | private Long departmentId; |
| | | |
| | | @ApiModelProperty("处置单位") |
| | | private String departmentName; |
| | | |
| | | @ApiModelProperty("车牌号") |
| | | private String licensePlateNumber; |
| | | |
| | | @ApiModelProperty("最大载重") |
| | | private BigDecimal maximumLoad; |
| | | |
| | | @ApiModelProperty("当前载重") |
| | | private BigDecimal currentLoad; |
| | | } |
| | |
| | | @ApiModelProperty("医废类型") |
| | | private Long wasteType; |
| | | |
| | | @ApiModelProperty("医废类型名称") |
| | | private String wasteTypeStr; |
| | | |
| | | @ApiModelProperty("预警值") |
| | | private Integer value; |
| | | |
| | |
| | | @AllArgsConstructor |
| | | public enum WarningConfigTypeEnum { |
| | | MEDICAL_WASTE(1, "医疗废物预警"), |
| | | CONTRACT(2, "合同预警"), |
| | | CONTRACT_EXPIRE(2, "合同预警"), |
| | | STAFF(3, "人员预警"), |
| | | PROTECTION_PERSONNEL(4, "职业防护预警"), |
| | | STAGING_ROOM_CAPACITY(5, "入库暂存间存储容量预警"); |
| | |
| | | HEALTH_RECORD_WARNING(4, "健康记录预警"), |
| | | VACCINE_RECORD_WARNING(5, "疫苗记录预警"), |
| | | PROTECTION_EQUIPMENT_USE_WARNING(6, "防护用品使用预警"), |
| | | MEDICAL_INSTITUTION_WASTE_DAY_WARNING(7, "医疗机构产废日预警"), |
| | | MEDICAL_INSTITUTION_WASTE_MONTH_WARNING(8, "医疗机构产废月预警"), |
| | | MEDICAL_INSTITUTION_STORAGE_WARNING(9, "医疗机构存储量预警"), |
| | | TRANSIT_CAR_WARNING(10, "车辆转运异常预警"), |
| | | DISPOSAL_UNIT_STORAGE_WARNING(11, "处置单位存储量预警"); |
| | | PROTECTION_EQUIPMENT_STOCK_WARNING(7, "防护用品库存预警"), |
| | | MEDICAL_INSTITUTION_WASTE_DAY_WARNING(8, "医疗机构产废日预警"), |
| | | MEDICAL_INSTITUTION_WASTE_MONTH_WARNING(9, "医疗机构产废月预警"), |
| | | MEDICAL_INSTITUTION_STORAGE_WARNING(10, "医疗机构存储量预警"), |
| | | TRANSIT_CAR_WARNING(11, "车辆转运异常预警"), |
| | | DISPOSAL_UNIT_STORAGE_WARNING(12, "处置单位存储量预警"); |
| | | |
| | | private final Integer code; |
| | | private final String desc; |
| | |
| | | import com.sinata.system.domain.vo.MwCheckoutRecordVO; |
| | | import com.sinata.system.domain.vo.MwCollectRecordVO; |
| | | import com.sinata.system.domain.vo.MwMedicalWasteBoxVO; |
| | | import com.sinata.system.domain.vo.MwTransitCarWarningVO; |
| | | import com.sinata.system.domain.vo.MwTransitRecordVO; |
| | | import com.sinata.system.domain.vo.TransformVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | |
| | | * @return |
| | | */ |
| | | List<MwCollectRecordVO> getRegulationReportList(@Param("query") DisposalReportQuery query, @Param("treeCode") String treeCode); |
| | | |
| | | /** |
| | | * 车辆转运异常预警 |
| | | * |
| | | * @return |
| | | */ |
| | | List<MwTransitCarWarningVO> queryWarningList(); |
| | | } |
| | |
| | | package com.sinata.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.sinata.system.domain.MwCollectRecord; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.sinata.system.domain.query.DisposalReportQuery; |
| | | import com.sinata.system.domain.query.MwCollectRecordQuery; |
| | | import com.sinata.system.domain.vo.MedicalWasteProcessVO; |
| | | import com.sinata.system.domain.vo.MwCollectRecordVO; |
| | | import com.sinata.system.domain.vo.MwCollectRecordWarningVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | List<MwCollectRecordVO> getRegulationReportList(@Param("query") DisposalReportQuery query, @Param("treeCode") String treeCode); |
| | | |
| | | /** |
| | | * 获取时间类型列表 |
| | | * |
| | | * @param timeType 时间类型 1:日 2:月 |
| | | * @return |
| | | */ |
| | | List<MwCollectRecordWarningVO> queryListTimeType(Integer timeType); |
| | | |
| | | /** |
| | | * 根据医疗机构分组查询医废存储量 |
| | | * |
| | | * @return |
| | | */ |
| | | List<MwCollectRecordWarningVO> queryListGroupByDepartment(); |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 合同 Mapper 接口 |
| | |
| | | * |
| | | * @param page |
| | | * @param query |
| | | * @param treeCode |
| | | * @return |
| | | */ |
| | | Page<MwContractVO> pageList(Page<MwContractVO> page, @Param("query") MwContractQuery query); |
| | | Page<MwContractVO> pageList(Page<MwContractVO> page, @Param("query") MwContractQuery query, @Param("treeCode") String treeCode); |
| | | |
| | | /** |
| | | * 查询未过期合同列表 |
| | | * |
| | | * @param date |
| | | * @return |
| | | */ |
| | | List<MwContractVO> queryListTerminationDateBeforeNow(Date date); |
| | | } |
| | |
| | | import com.sinata.system.domain.vo.MwDisposalRecordItemVO; |
| | | import com.sinata.system.domain.vo.MwDisposalRecordReportVO; |
| | | import com.sinata.system.domain.vo.MwDisposalRecordVO; |
| | | import com.sinata.system.domain.vo.MwDisposalRecordWarningVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | */ |
| | | List<MwCollectRecordVO> getRegulationReportList(@Param("query") DisposalReportQuery query, @Param("treeCode") String treeCode); |
| | | |
| | | /** |
| | | * 处置单位存储量预警数据 |
| | | * |
| | | * @return |
| | | */ |
| | | List<MwDisposalRecordWarningVO> queryDisposalListByDepartment(); |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 防护器具 Mapper 接口 |
| | |
| | | * @return |
| | | */ |
| | | Page<MwProtectionEquipmentRecordVO> recordPage(Page<MwProtectionEquipmentRecordVO> page, @Param("id") Long id); |
| | | |
| | | /** |
| | | * 防护器具列表 |
| | | * |
| | | * @return |
| | | */ |
| | | List<MwProtectionEquipmentVO> queryList(); |
| | | } |
| | |
| | | package com.sinata.system.mapper; |
| | | |
| | | import com.sinata.system.domain.MwProtectionEquipmentRecord; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.sinata.system.domain.MwProtectionEquipmentRecord; |
| | | import com.sinata.system.domain.vo.MwProtectionEquipmentRecordVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Mapper |
| | | public interface MwProtectionEquipmentRecordMapper extends BaseMapper<MwProtectionEquipmentRecord> { |
| | | |
| | | /** |
| | | * 查询指定器具一个月的使用记录 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | List<MwProtectionEquipmentRecordVO> findByEquipmentIdAndUsageTimeAfter(@Param("id") Long id); |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 职工 Mapper 接口 |
| | |
| | | * @return |
| | | */ |
| | | Page<MwStaffVO> pageList(Page<MwStaffVO> page, @Param("query") MwStaffQuery query, @Param("treeCode") String treeCode); |
| | | |
| | | /** |
| | | * 职工列表 |
| | | * |
| | | * @return |
| | | */ |
| | | List<MwStaffVO> queryList(); |
| | | } |
| | |
| | | /** |
| | | * 暂存间分页列表 |
| | | * |
| | | * @param objectPage |
| | | * @param mwStagingRoomVOPage |
| | | * @param treeCode |
| | | * @return |
| | | */ |
| | |
| | | * @return |
| | | */ |
| | | List<MwCheckoutRecordVO> checkoutRecordList(@Param("query") CheckoutRecordQuery query, @Param("treeCode") String treeCode); |
| | | |
| | | /** |
| | | * 暂存间列表 |
| | | * |
| | | * @return |
| | | */ |
| | | List<MwStagingRoomVO> queryStagingRoomList(); |
| | | |
| | | /** |
| | | * 暂存间待处理医废分页列表 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Page<MwStorageRecordVO> temporarilyStoredMedicalWaste(StorageRecordQuery query); |
| | | |
| | | /** |
| | | * 根据医废查询使用列表 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | List<MwStorageRecordVO> queryMedicalWasteList(Long id); |
| | | } |
| | |
| | | import com.sinata.system.domain.vo.MwCheckoutRecordVO; |
| | | import com.sinata.system.domain.vo.MwCollectRecordVO; |
| | | import com.sinata.system.domain.vo.MwMedicalWasteBoxVO; |
| | | import com.sinata.system.domain.vo.MwTransitCarWarningVO; |
| | | import com.sinata.system.domain.vo.MwTransitRecordVO; |
| | | import com.sinata.system.domain.vo.TransformVO; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | List<MwCollectRecordVO> getRegulationReportList(DisposalReportQuery query); |
| | | |
| | | /** |
| | | * 车辆转运异常预警 |
| | | * |
| | | * @return |
| | | */ |
| | | List<MwTransitCarWarningVO> queryWarningList(); |
| | | } |
| | |
| | | import com.sinata.system.domain.query.MwCollectRecordQuery; |
| | | import com.sinata.system.domain.vo.MedicalWasteProcessVO; |
| | | import com.sinata.system.domain.vo.MwCollectRecordVO; |
| | | import com.sinata.system.domain.vo.MwCollectRecordWarningVO; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | |
| | | * @return |
| | | */ |
| | | List<MwCollectRecordVO> getRegulationReportList(DisposalReportQuery query); |
| | | |
| | | /** |
| | | * 查询昨日产废记录 |
| | | * |
| | | * @return |
| | | */ |
| | | List<MwCollectRecordWarningVO> queryListByDay(); |
| | | |
| | | /** |
| | | * 查询上月产废记录 |
| | | * |
| | | * @return |
| | | */ |
| | | List<MwCollectRecordWarningVO> queryListByMonth(); |
| | | |
| | | /** |
| | | * @return |
| | | */ |
| | | List<MwCollectRecordWarningVO> queryListGroupByDepartment(); |
| | | } |
| | |
| | | import com.sinata.system.domain.query.MwContractQuery; |
| | | import com.sinata.system.domain.vo.MwContractVO; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 合同 服务类 |
| | |
| | | * @return |
| | | */ |
| | | void delete(Long id); |
| | | |
| | | /** |
| | | * 查询待过期合同列表 |
| | | * |
| | | * @param date |
| | | * @return |
| | | */ |
| | | List<MwContractVO> queryListTerminationDateBeforeNow(Date date); |
| | | } |
| | |
| | | import com.sinata.system.domain.vo.MwDisposalRecordItemVO; |
| | | import com.sinata.system.domain.vo.MwDisposalRecordReportVO; |
| | | import com.sinata.system.domain.vo.MwDisposalRecordVO; |
| | | import com.sinata.system.domain.vo.MwDisposalRecordWarningVO; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | List<MwCollectRecordVO> getRegulationReportList(DisposalReportQuery query); |
| | | |
| | | /** |
| | | * 处置单位存储量预警 |
| | | * |
| | | * @return |
| | | */ |
| | | List<MwDisposalRecordWarningVO> queryDisposalListByDepartment(); |
| | | } |
| | |
| | | import com.sinata.system.domain.dto.MwMicroEquipmentRecordDTO; |
| | | import com.sinata.system.domain.query.MwMicroEquipmentRecordQuery; |
| | | import com.sinata.system.domain.query.MwMicroEquipmentStaticsQuery; |
| | | import com.sinata.system.domain.vo.DepartmentReportVO; |
| | | import com.sinata.system.domain.vo.MwMicroEquipmentRecordVO; |
| | | import com.sinata.system.domain.vo.MwMicroEquipmentStaticsTitleVO; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | PageDTO<MwMicroEquipmentRecordVO> pageList(MwMicroEquipmentRecordQuery query); |
| | | |
| | | /** |
| | | * 设备使用详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | MwMicroEquipmentRecordVO detail(Long id); |
| | | |
| | | /** |
| | | * 导出设备使用记录 |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<List<String>> getStaticsData(MwMicroEquipmentStaticsQuery query); |
| | | DepartmentReportVO getStaticsData(MwMicroEquipmentStaticsQuery query); |
| | | |
| | | /** |
| | | * 处置分析导出 |
| | |
| | | * @param response |
| | | */ |
| | | void staticsExport(MwMicroEquipmentStaticsQuery query, HttpServletResponse response) throws IOException; |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.sinata.system.domain.MwProtectionEquipmentRecord; |
| | | import com.sinata.system.domain.vo.MwProtectionEquipmentRecordVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2024-12-02 |
| | | */ |
| | | public interface MwProtectionEquipmentRecordService extends IService<MwProtectionEquipmentRecord> { |
| | | |
| | | /** |
| | | * 查询指定器具一个月的使用记录 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | List<MwProtectionEquipmentRecordVO> findByEquipmentIdAndUsageTimeAfter(Long id); |
| | | } |
| | |
| | | import com.sinata.system.domain.query.MwStaffQuery; |
| | | import com.sinata.system.domain.vo.MwStaffVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 职工 服务类 |
| | |
| | | * @return |
| | | */ |
| | | void edit(MwStaffDTO dto); |
| | | |
| | | /** |
| | | * 职工列表 |
| | | * |
| | | * @return |
| | | */ |
| | | List<MwStaffVO> queryList(); |
| | | } |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @param response |
| | | */ |
| | | void checkoutRecordExport(CheckoutRecordQuery query, HttpServletResponse response) throws IOException; |
| | | |
| | | /** |
| | | * 暂存间列表 |
| | | * |
| | | * @return |
| | | */ |
| | | List<MwStagingRoomVO> queryStagingRoomList(); |
| | | |
| | | /** |
| | | * 暂存间待处理医废分页列表 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageDTO<MwStorageRecordVO> temporarilyStoredMedicalWaste(StorageRecordQuery query); |
| | | |
| | | /** |
| | | * 根据设备id查询医废列表 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | List<MwStorageRecordVO> queryMedicalWasteList(Long id); |
| | | } |
| | |
| | | import com.sinata.system.domain.vo.MwWarningRecordVO; |
| | | |
| | | import java.io.IOException; |
| | | import java.io.UnsupportedEncodingException; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | PageDTO<MwWarningRecordVO> pageList(MwWarningRecordQuery query); |
| | | |
| | | /** |
| | | * 解除 |
| | | * |
| | | * @param id |
| | | */ |
| | | void relieve(Long id); |
| | | |
| | | /** |
| | | * 导出 |
| | | * |
| | | * @param query |
| | | * @throws IOException |
| | | */ |
| | | void export(MwWarningRecordQuery query) throws IOException; |
| | | |
| | | } |
New file |
| | |
| | | package com.sinata.system.service.biz; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.sinata.common.utils.CollUtils; |
| | | import com.sinata.common.utils.DateUtils; |
| | | import com.sinata.common.utils.StringUtils; |
| | | import com.sinata.system.domain.MwCollectRecord; |
| | | import com.sinata.system.domain.MwWarningConfig; |
| | | import com.sinata.system.domain.MwWarningConfigItem; |
| | | import com.sinata.system.domain.MwWarningRecord; |
| | | import com.sinata.system.domain.vo.MwCollectRecordWarningVO; |
| | | import com.sinata.system.domain.vo.MwContractVO; |
| | | import com.sinata.system.domain.vo.MwDisposalRecordWarningVO; |
| | | import com.sinata.system.domain.vo.MwProtectionEquipmentRecordVO; |
| | | import com.sinata.system.domain.vo.MwProtectionEquipmentVO; |
| | | import com.sinata.system.domain.vo.MwStaffVO; |
| | | import com.sinata.system.domain.vo.MwStagingRoomVO; |
| | | import com.sinata.system.domain.vo.MwTransitCarWarningVO; |
| | | import com.sinata.system.enums.MedicalWasteStatusEnum; |
| | | import com.sinata.system.enums.WarningConfigTypeEnum; |
| | | import com.sinata.system.enums.WarningStatusEnum; |
| | | import com.sinata.system.enums.WarningTypeEnum; |
| | | import com.sinata.system.service.MwCheckoutRecordService; |
| | | import com.sinata.system.service.MwCollectRecordService; |
| | | import com.sinata.system.service.MwContractService; |
| | | import com.sinata.system.service.MwDisposalRecordService; |
| | | import com.sinata.system.service.MwProtectionEquipmentRecordService; |
| | | import com.sinata.system.service.MwProtectionEquipmentService; |
| | | import com.sinata.system.service.MwStaffService; |
| | | import com.sinata.system.service.MwStagingRoomService; |
| | | import com.sinata.system.service.MwWarningConfigItemService; |
| | | import com.sinata.system.service.MwWarningConfigService; |
| | | import com.sinata.system.service.MwWarningRecordService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jetbrains.annotations.NotNull; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/12/31 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class TaskService { |
| | | private final MwWarningConfigService mwWarningConfigService; |
| | | private final MwWarningConfigItemService mwWarningConfigItemService; |
| | | private final MwCollectRecordService mwCollectRecordService; |
| | | private final MwWarningRecordService mwWarningRecordService; |
| | | private final MwStagingRoomService mwStagingRoomService; |
| | | private final MwContractService mwContractService; |
| | | private final MwStaffService mwStaffService; |
| | | private final MwProtectionEquipmentService mwProtectionEquipmentService; |
| | | private final MwProtectionEquipmentRecordService mwProtectionEquipmentRecordService; |
| | | private final MwCheckoutRecordService mwCheckoutRecordService; |
| | | private final MwDisposalRecordService mwDisposalRecordService; |
| | | |
| | | /** |
| | | * 出库超时预警 |
| | | */ |
| | | public void checkoutOverTime() { |
| | | // 获取配置 |
| | | MwWarningConfig config = mwWarningConfigService.getOne( |
| | | Wrappers.lambdaQuery(MwWarningConfig.class) |
| | | .eq(MwWarningConfig::getType, WarningConfigTypeEnum.MEDICAL_WASTE.getCode()) |
| | | .last("LIMIT 1") |
| | | ); |
| | | |
| | | if (Objects.isNull(config)) { |
| | | log.info("【出库超时预警】:未找到【医疗废弃物】的预警配置,跳过定时任务执行"); |
| | | return; |
| | | } |
| | | // 获取配置项 |
| | | List<MwWarningConfigItem> configItems = mwWarningConfigItemService.lambdaQuery() |
| | | .eq(MwWarningConfigItem::getConfigId, config.getId()) |
| | | .list(); |
| | | |
| | | if (CollUtils.isEmpty(configItems)) { |
| | | log.info("【出库超时预警】:未找到相关配置项,跳过定时任务执行"); |
| | | return; |
| | | } |
| | | |
| | | // 查询暂存间医废记录 |
| | | List<MwCollectRecord> collectRecordList = mwCollectRecordService.lambdaQuery() |
| | | .eq(MwCollectRecord::getStatus, MedicalWasteStatusEnum.TEMPORARILY_STORED.getCode()) |
| | | .list(); |
| | | |
| | | if (CollUtils.isEmpty(collectRecordList)) { |
| | | log.info("【出库超时预警】:没有暂存的医废记录,跳过定时任务执行"); |
| | | return; |
| | | } |
| | | |
| | | // 遍历配置项并处理预警 |
| | | for (MwWarningConfigItem configItem : configItems) { |
| | | // 过滤出需要预警的记录 |
| | | List<MwCollectRecord> recordList = collectRecordList.stream() |
| | | .filter(item -> item.getWasteType().equals(configItem.getWasteType()) && |
| | | DateUtils.timeDistanceHour(new Date(), item.getCollectTime()) > configItem.getValue()) |
| | | .collect(Collectors.toList()); |
| | | |
| | | if (CollUtils.isEmpty(recordList)) { |
| | | continue; // 如果没有需要预警的记录,则跳过 |
| | | } |
| | | |
| | | // 创建预警记录并保存 |
| | | List<MwWarningRecord> warningRecordList = recordList.stream().map(item -> { |
| | | Long id = item.getId(); |
| | | String medicalWasteNumber = item.getMedicalWasteNumber(); |
| | | String hospitalName = item.getHospitalName(); |
| | | String msg = String.format("%s医废超过%d小时未出库", item.getWasteTypeStr(), configItem.getValue()); |
| | | String currentValue = String.valueOf(DateUtils.timeDistanceHour(new Date(), item.getCollectTime())); |
| | | Long departmentId = item.getDepartmentId(); |
| | | String configValue = configItem.getValue().toString(); |
| | | return getMwWarningRecord(WarningTypeEnum.CHECKOUT_TIMEOUT_WARNING.getCode(), id, medicalWasteNumber, hospitalName, msg, departmentId, currentValue, configValue); |
| | | }).collect(Collectors.toList()); |
| | | |
| | | // 批量保存预警记录 |
| | | if (!warningRecordList.isEmpty()) { |
| | | mwWarningRecordService.saveBatch(warningRecordList); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 封装预警记录 |
| | | * |
| | | * @param id |
| | | * @param warningTargetName |
| | | * @param departmentName |
| | | * @param message |
| | | * @param departmentId |
| | | * @param currentValue |
| | | * @param normalRange |
| | | * @return |
| | | */ |
| | | @NotNull |
| | | private static MwWarningRecord getMwWarningRecord(Integer type, Long id, String warningTargetName, String departmentName, String message, Long departmentId, String currentValue, String normalRange) { |
| | | MwWarningRecord warningRecord = new MwWarningRecord(); |
| | | warningRecord.setType(type); |
| | | warningRecord.setWarningTargetId(id); |
| | | warningRecord.setWarningTargetName(warningTargetName); |
| | | warningRecord.setDepartmentName(departmentName); |
| | | warningRecord.setMessage(message); |
| | | warningRecord.setDepartmentId(departmentId); |
| | | warningRecord.setCurrentValue(currentValue); |
| | | warningRecord.setNormalRange(normalRange); |
| | | warningRecord.setStatus(WarningStatusEnum.UNRESOLVED.getCode()); |
| | | warningRecord.setWarnTime(new Date()); |
| | | return warningRecord; |
| | | } |
| | | |
| | | /** |
| | | * 暂存间使用率预警 |
| | | */ |
| | | public void stagingRoomStorage() { |
| | | //查询预警配置 |
| | | MwWarningConfig config = mwWarningConfigService.getOne( |
| | | Wrappers.lambdaQuery(MwWarningConfig.class) |
| | | .eq(MwWarningConfig::getType, WarningConfigTypeEnum.STAGING_ROOM_CAPACITY.getCode()) |
| | | .last("LIMIT 1") |
| | | ); |
| | | if (Objects.isNull(config)) { |
| | | log.info("【暂存间使用率预警】:未找到【暂存间使用率预警】的预警配置,跳过定时任务执行"); |
| | | return; |
| | | } |
| | | // 获取配置项 |
| | | List<MwWarningConfigItem> configItems = mwWarningConfigItemService.lambdaQuery() |
| | | .eq(MwWarningConfigItem::getConfigId, config.getId()).orderByDesc(MwWarningConfigItem::getValue) |
| | | .list(); |
| | | if (CollUtils.isEmpty(configItems)) { |
| | | log.info("【暂存间使用率预警】:未找到相关配置项,跳过定时任务执行"); |
| | | return; |
| | | } |
| | | List<MwStagingRoomVO> stagingRoomList = mwStagingRoomService.queryStagingRoomList(); |
| | | if (CollUtils.isEmpty(stagingRoomList)) { |
| | | log.info("【暂存间使用率预警】:暂存间列表为空,跳过定时任务执行"); |
| | | return; |
| | | } |
| | | List<MwWarningRecord> warningRecordList = new ArrayList<>(); |
| | | for (MwWarningConfigItem configItem : configItems) { |
| | | Integer configValue = configItem.getValue(); |
| | | warningRecordList.addAll(stagingRoomList.stream().filter(room -> room.getUseRate().compareTo(BigDecimal.valueOf(configValue)) >= 0).map(room -> { |
| | | Long id = room.getId(); |
| | | String roomName = room.getRoomName(); |
| | | String hospitalName = room.getHospitalName(); |
| | | String promptContent = configItem.getPromptContent(); |
| | | String msg = String.format("%s%s%s", room.getRoomName(), promptContent, configValue + "%"); |
| | | Long departmentId = room.getDepartmentId(); |
| | | String useRate = room.getUseRate().toString(); |
| | | return getMwWarningRecord(WarningTypeEnum.STAGING_ROOM_USE_RATE_WARNING.getCode(), id, roomName, hospitalName, msg, departmentId, useRate, configValue.toString()); |
| | | }).collect(Collectors.toList())); |
| | | } |
| | | //保存预警记录 |
| | | mwWarningRecordService.saveBatch(warningRecordList); |
| | | } |
| | | |
| | | /** |
| | | * 合同到期预警 |
| | | */ |
| | | public void contractExpire() { |
| | | //查询合同预警配置 |
| | | MwWarningConfig config = mwWarningConfigService.getOne( |
| | | Wrappers.lambdaQuery(MwWarningConfig.class) |
| | | .eq(MwWarningConfig::getType, WarningConfigTypeEnum.CONTRACT_EXPIRE.getCode()) |
| | | .last("LIMIT 1") |
| | | ); |
| | | if (Objects.isNull(config)) { |
| | | log.info("【合同到期预警】:未找到【合同到期预警】的预警配置,跳过定时任务执行"); |
| | | return; |
| | | } |
| | | int advanceDays = Integer.parseInt(config.getValue()); |
| | | List<MwContractVO> list = mwContractService.queryListTerminationDateBeforeNow(new Date()); |
| | | List<MwWarningRecord> warningRecordList = list.stream().filter(contract -> { |
| | | long distanceDay = DateUtils.timeDistanceDay(contract.getTerminationDate(), new Date()); |
| | | return distanceDay <= advanceDays; |
| | | }).map(contract -> { |
| | | String msg = String.format("合同【%s】即将到期", contract.getContractName()); |
| | | return getMwWarningRecord(WarningTypeEnum.CONTRACT_EXPIRY_WARNING.getCode(), contract.getId(), contract.getContractName(), |
| | | contract.getDepartmentName(), msg, contract.getDepartmentId(), |
| | | String.valueOf(DateUtils.timeDistanceDay(contract.getTerminationDate(), new Date())), config.getValue()); |
| | | }).collect(Collectors.toList()); |
| | | //保存预警记录 |
| | | mwWarningRecordService.saveBatch(warningRecordList); |
| | | } |
| | | |
| | | /** |
| | | * 健康记录预警、人员记录预警 |
| | | */ |
| | | public void healthRecord() { |
| | | //查询人员预警配置 |
| | | MwWarningConfig config = mwWarningConfigService.getOne( |
| | | Wrappers.lambdaQuery(MwWarningConfig.class) |
| | | .eq(MwWarningConfig::getType, WarningConfigTypeEnum.STAFF.getCode()) |
| | | .last("LIMIT 1")); |
| | | if (Objects.isNull(config)) { |
| | | log.info("【健康记录预警】【人员记录预警】:未找到人员预警配置,跳过定时任务执行"); |
| | | return; |
| | | } |
| | | List<MwStaffVO> list = mwStaffService.queryList(); |
| | | List<MwWarningRecord> warningRecordList = new ArrayList<>(); |
| | | if (config.getHealthFlag().equals(1)) { |
| | | warningRecordList.addAll(list.stream().filter(staff -> StringUtils.isBlank(staff.getHealthCertificate())).map(staff -> { |
| | | String msg = String.format("职工【%s】健康记录未上传", staff.getStaffName()); |
| | | return getMwWarningRecord(WarningTypeEnum.HEALTH_RECORD_WARNING.getCode(), staff.getId(), staff.getStaffName(), staff.getDepartmentName(), msg, staff.getDepartmentId(), "否", "是"); |
| | | }).collect(Collectors.toList())); |
| | | } |
| | | if (config.getVaccineFlag().equals(1)) { |
| | | warningRecordList.addAll(list.stream().filter(staff -> StringUtils.isBlank(staff.getVaccineCertificate())).map(staff -> { |
| | | String msg = String.format("职工【%s】疫苗记录未上传", staff.getStaffName()); |
| | | return getMwWarningRecord(WarningTypeEnum.VACCINE_RECORD_WARNING.getCode(), staff.getId(), staff.getStaffName(), staff.getDepartmentName(), msg, staff.getDepartmentId(), "否", "是"); |
| | | }).collect(Collectors.toList())); |
| | | } |
| | | //保存记录 |
| | | mwWarningRecordService.saveBatch(warningRecordList); |
| | | } |
| | | |
| | | /** |
| | | * 防护用品使用预警 防护用品库存预警 |
| | | */ |
| | | public void protectionEquipmentUse() { |
| | | //查询职业防护预警配置 |
| | | MwWarningConfig config = mwWarningConfigService.getOne( |
| | | Wrappers.lambdaQuery(MwWarningConfig.class) |
| | | .eq(MwWarningConfig::getType, WarningConfigTypeEnum.PROTECTION_PERSONNEL.getCode()) |
| | | .last("LIMIT 1")); |
| | | if (Objects.isNull(config)) { |
| | | log.info("【防护用品使用预警】【防护用品库存预警】:未找到职业防护预警配置,跳过定时任务执行"); |
| | | return; |
| | | } |
| | | List<MwWarningRecord> warningRecordList = new ArrayList<>(); |
| | | //查询防护设备列表 |
| | | List<MwProtectionEquipmentVO> protectionEquipmentVOList = mwProtectionEquipmentService.queryList(); |
| | | //防护器具使用预警 |
| | | if (config.getProtectionFlag().equals(1)) { |
| | | warningRecordList.addAll(protectionEquipmentVOList.stream().map(item -> { |
| | | List<MwProtectionEquipmentRecordVO> recordVOList = mwProtectionEquipmentRecordService.findByEquipmentIdAndUsageTimeAfter(item.getId()); |
| | | if (CollUtils.isEmpty(recordVOList)) { |
| | | String msg = String.format("【%s】30天没有产生使用记录", item.getEquipmentName()); |
| | | return getMwWarningRecord(WarningTypeEnum.PROTECTION_EQUIPMENT_USE_WARNING.getCode(), item.getId(), |
| | | item.getEquipmentName(), item.getDepartmentName(), msg, item.getDepartmentId(), "一个月内无使用记录", "一个月内有使用记录"); |
| | | } |
| | | return null; |
| | | }).filter(Objects::nonNull).collect(Collectors.toList())); |
| | | } |
| | | //防护器具库存预警 |
| | | warningRecordList.addAll(protectionEquipmentVOList.stream().filter(item -> item.getStock() <= Integer.parseInt(config.getValue())).map(item -> { |
| | | String msg = String.format("%s库存量低于%s", item.getEquipmentName(), config.getValue()); |
| | | return getMwWarningRecord(WarningTypeEnum.PROTECTION_EQUIPMENT_STOCK_WARNING.getCode(), item.getId(), |
| | | item.getEquipmentName(), item.getDepartmentName(), msg, item.getDepartmentId(), String.valueOf(item.getStock()), config.getValue()); |
| | | }).collect(Collectors.toList())); |
| | | //保存记录 |
| | | mwWarningRecordService.saveBatch(warningRecordList); |
| | | } |
| | | |
| | | /** |
| | | * 医疗机构产废日预警 |
| | | */ |
| | | public void medicalInstitutionWasteDay() { |
| | | //查询医废收集记录 |
| | | List<MwCollectRecordWarningVO> collectRecordVOList = mwCollectRecordService.queryListByDay(); |
| | | if (CollUtils.isNotEmpty(collectRecordVOList)) { |
| | | List<MwWarningRecord> warningRecordList = collectRecordVOList.stream().filter(item -> item.getTotalWeight().compareTo(item.getDailyMaxWasteQuantity()) > 0).map(item -> { |
| | | String msg = String.format("日产废量超过%f", item.getDailyMaxWasteQuantity()); |
| | | return getMwWarningRecord(WarningTypeEnum.MEDICAL_INSTITUTION_WASTE_DAY_WARNING.getCode(), item.getDepartmentId(), |
| | | item.getHospitalName(), item.getHospitalName(), msg, item.getDepartmentId(), item.getTotalWeight().toString(), item.getDailyMinWasteQuantity() + "-" + item.getDailyMaxWasteQuantity()); |
| | | }).collect(Collectors.toList()); |
| | | //保存预警记录 |
| | | mwWarningRecordService.saveBatch(warningRecordList); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 医疗机构产废月预警 |
| | | */ |
| | | public void medicalInstitutionWasteMonth() { |
| | | List<MwCollectRecordWarningVO> collectRecordVOList = mwCollectRecordService.queryListByMonth(); |
| | | if (CollUtils.isNotEmpty(collectRecordVOList)) { |
| | | List<MwWarningRecord> warningRecordList = collectRecordVOList.stream().filter(item -> item.getTotalWeight().compareTo(item.getDailyMaxWasteQuantity()) > 0).map(item -> { |
| | | String msg = String.format("日产废量超过%f", item.getDailyMaxWasteQuantity()); |
| | | return getMwWarningRecord(WarningTypeEnum.MEDICAL_INSTITUTION_WASTE_MONTH_WARNING.getCode(), item.getDepartmentId(), |
| | | item.getHospitalName(), item.getHospitalName(), msg, item.getDepartmentId(), item.getTotalWeight().toString(), item.getMonthlyMinWasteQuantity() + "-" + item.getMonthlyMaxWasteQuantity()); |
| | | }).collect(Collectors.toList()); |
| | | //保存预警记录 |
| | | mwWarningRecordService.saveBatch(warningRecordList); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 医疗机构存储量预警 |
| | | */ |
| | | public void medicalInstitutionStorage() { |
| | | List<MwCollectRecordWarningVO> collectRecordVOList = mwCollectRecordService.queryListGroupByDepartment(); |
| | | if (CollUtils.isNotEmpty(collectRecordVOList)) { |
| | | List<MwWarningRecord> warningRecordList = collectRecordVOList.stream().map(item -> { |
| | | if (item.getTotalWeight().compareTo(item.getMaximumStorageCapacity()) > 0) { |
| | | String msg = "医疗废物存储量超过最大值"; |
| | | return getMwWarningRecord(WarningTypeEnum.MEDICAL_INSTITUTION_STORAGE_WARNING.getCode(), item.getDepartmentId(), |
| | | item.getHospitalName(), item.getHospitalName(), msg, item.getDepartmentId(), item.getTotalWeight().toString(), item.getMaximumStorageCapacity().toString()); |
| | | } |
| | | return null; |
| | | }).filter(Objects::nonNull).collect(Collectors.toList()); |
| | | //保存预警记录 |
| | | mwWarningRecordService.saveBatch(warningRecordList); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 车辆转运异常预警 |
| | | */ |
| | | public void transitCar() { |
| | | List<MwTransitCarWarningVO> transitCarWarningVOList = mwCheckoutRecordService.queryWarningList(); |
| | | if (CollUtils.isNotEmpty(transitCarWarningVOList)) { |
| | | List<MwWarningRecord> warningRecordList = transitCarWarningVOList.stream() |
| | | .filter(item -> item.getCurrentLoad().compareTo(item.getMaximumLoad()) > 0).map(item -> { |
| | | String msg = String.format("%s转运的医废超过最大载重", item.getLicensePlateNumber()); |
| | | return getMwWarningRecord(WarningTypeEnum.TRANSIT_CAR_WARNING.getCode(), item.getId(), item.getLicensePlateNumber(), |
| | | item.getDepartmentName(), msg, item.getDepartmentId(), item.getCurrentLoad().toString(), item.getMaximumLoad().toString()); |
| | | }).collect(Collectors.toList()); |
| | | //保存预警记录 |
| | | mwWarningRecordService.saveBatch(warningRecordList); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 处置单位存储量预警 |
| | | */ |
| | | public void disposalUnitStorage() { |
| | | List<MwDisposalRecordWarningVO> disposalRecordWarningVOList = mwDisposalRecordService.queryDisposalListByDepartment(); |
| | | if (CollUtils.isNotEmpty(disposalRecordWarningVOList)) { |
| | | List<MwWarningRecord> warningRecordList = disposalRecordWarningVOList.stream().filter(item -> item.getCurrentStorage().compareTo(item.getMaximumStorageCapacity()) > 0).map(item -> { |
| | | String msg = "医疗废物存储量超过最大值"; |
| | | return getMwWarningRecord(WarningTypeEnum.DISPOSAL_UNIT_STORAGE_WARNING.getCode(), item.getDepartmentId(), item.getDisposalUnitName(), |
| | | item.getDisposalUnitName(), msg, item.getDepartmentId(), item.getCurrentStorage().toString(), item.getMaximumStorageCapacity().toString()); |
| | | }).collect(Collectors.toList()); |
| | | //保存预警记录 |
| | | mwWarningRecordService.saveBatch(warningRecordList); |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.sinata.system.domain.vo.MwCheckoutRecordVO; |
| | | import com.sinata.system.domain.vo.MwCollectRecordVO; |
| | | import com.sinata.system.domain.vo.MwMedicalWasteBoxVO; |
| | | import com.sinata.system.domain.vo.MwTransitCarWarningVO; |
| | | import com.sinata.system.domain.vo.MwTransitRecordVO; |
| | | import com.sinata.system.domain.vo.TransformVO; |
| | | import com.sinata.system.mapper.MwCheckoutRecordMapper; |
| | |
| | | String treeCode = sysDepartmentService.getTreeCodeByDepartmentId(query.getDepartmentId()); |
| | | return baseMapper.getRegulationReportList(query, treeCode); |
| | | } |
| | | |
| | | /** |
| | | * 车辆转运异常预警 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<MwTransitCarWarningVO> queryWarningList() { |
| | | return baseMapper.queryWarningList(); |
| | | } |
| | | } |
| | |
| | | import com.sinata.system.domain.query.MwCollectRecordQuery; |
| | | import com.sinata.system.domain.vo.MedicalWasteProcessVO; |
| | | import com.sinata.system.domain.vo.MwCollectRecordVO; |
| | | import com.sinata.system.domain.vo.MwCollectRecordWarningVO; |
| | | import com.sinata.system.mapper.MwCollectRecordMapper; |
| | | import com.sinata.system.service.MwCollectRecordService; |
| | | import com.sinata.system.service.SysDepartmentService; |
| | |
| | | String treeCode = sysDepartmentService.getTreeCodeByDepartmentId(query.getDepartmentId()); |
| | | return baseMapper.getRegulationReportList(query, treeCode); |
| | | } |
| | | |
| | | /** |
| | | * 查询日产废记录 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<MwCollectRecordWarningVO> queryListByDay() { |
| | | return baseMapper.queryListTimeType(1); |
| | | } |
| | | |
| | | /** |
| | | * 查询月产废记录 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<MwCollectRecordWarningVO> queryListByMonth() { |
| | | return baseMapper.queryListTimeType(2); |
| | | } |
| | | |
| | | @Override |
| | | public List<MwCollectRecordWarningVO> queryListGroupByDepartment() { |
| | | return baseMapper.queryListGroupByDepartment(); |
| | | } |
| | | } |
| | |
| | | import com.sinata.common.exception.ServiceException; |
| | | import com.sinata.common.utils.BeanUtils; |
| | | import com.sinata.common.utils.CollUtils; |
| | | import com.sinata.common.utils.StringUtils; |
| | | import com.sinata.system.domain.MwAttachment; |
| | | import com.sinata.system.domain.MwContract; |
| | | import com.sinata.system.domain.SysDepartment; |
| | | import com.sinata.system.domain.dto.MwContractDTO; |
| | | import com.sinata.system.domain.query.MwContractQuery; |
| | | import com.sinata.system.domain.vo.MwAttachmentVO; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public PageDTO<MwContractVO> pageList(MwContractQuery query) { |
| | | if (Objects.isNull(query.getDepartmentId())) { |
| | | SysDepartment myDepartment = sysDepartmentService.getMyDepartment(); |
| | | if (Objects.isNull(myDepartment)) { |
| | | return PageDTO.empty(0L, 0L); |
| | | } |
| | | query.setDepartmentId(myDepartment.getId()); |
| | | String treeCode = sysDepartmentService.getTreeCodeByDepartmentId(query.getDepartmentId()); |
| | | if (StringUtils.isBlank(treeCode)) { |
| | | return PageDTO.empty(0L, 0L); |
| | | } |
| | | Page<MwContractVO> page = baseMapper.pageList(new Page<>(query.getPageCurr(), query.getPageSize()), query); |
| | | Page<MwContractVO> page = baseMapper.pageList(new Page<>(query.getPageCurr(), query.getPageSize()), query, treeCode); |
| | | return PageDTO.of(page); |
| | | } |
| | | |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void add(MwContractDTO dto) { |
| | | MwContract mwContract = BeanUtils.copyBean(dto, MwContract.class); |
| | | save(mwContract); |
| | | if (CollUtils.isNotEmpty(dto.getAttachmentList())) { |
| | | List<MwAttachment> mwAttachments = BeanUtils.copyToList(dto.getAttachmentList(), MwAttachment.class); |
| | | mwAttachments.forEach(attachment -> { |
| | |
| | | //执行删除 |
| | | removeById(id); |
| | | } |
| | | |
| | | /** |
| | | * 查询未过期合同列表 |
| | | * |
| | | * @param date |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<MwContractVO> queryListTerminationDateBeforeNow(Date date) { |
| | | return baseMapper.queryListTerminationDateBeforeNow(date); |
| | | } |
| | | } |
| | |
| | | import com.sinata.system.domain.vo.MwDisposalRecordItemVO; |
| | | import com.sinata.system.domain.vo.MwDisposalRecordReportVO; |
| | | import com.sinata.system.domain.vo.MwDisposalRecordVO; |
| | | import com.sinata.system.domain.vo.MwDisposalRecordWarningVO; |
| | | import com.sinata.system.mapper.MwDisposalHandleRecordMapper; |
| | | import com.sinata.system.mapper.MwDisposalRecordMapper; |
| | | import com.sinata.system.service.MwDisposalRecordService; |
| | |
| | | String treeCode = sysDepartmentService.getTreeCodeByDepartmentId(query.getDepartmentId()); |
| | | return baseMapper.getRegulationReportList(query, treeCode); |
| | | } |
| | | |
| | | /** |
| | | * 处置单位存储量预警数据 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<MwDisposalRecordWarningVO> queryDisposalListByDepartment() { |
| | | return baseMapper.queryDisposalListByDepartment(); |
| | | } |
| | | } |
| | |
| | | import com.google.common.collect.Lists; |
| | | import com.sinata.common.core.domain.entity.SysDictData; |
| | | import com.sinata.common.entity.PageDTO; |
| | | import com.sinata.common.utils.BeanUtils; |
| | | import com.sinata.common.utils.CollUtils; |
| | | import com.sinata.common.utils.DateUtils; |
| | | import com.sinata.common.utils.SecurityUtils; |
| | | import com.sinata.common.utils.StringUtils; |
| | | import com.sinata.system.domain.MwCollectRecord; |
| | | import com.sinata.system.domain.MwMicroEquipment; |
| | | import com.sinata.system.domain.MwMicroEquipmentRecord; |
| | | import com.sinata.system.domain.MwMicroEquipmentRecordItem; |
| | | import com.sinata.system.domain.SysDepartment; |
| | | import com.sinata.system.domain.dto.MwMicroEquipmentRecordDTO; |
| | | import com.sinata.system.domain.query.MwMicroEquipmentRecordQuery; |
| | | import com.sinata.system.domain.query.MwMicroEquipmentStaticsQuery; |
| | | import com.sinata.system.domain.vo.DepartmentReportItemVO; |
| | | import com.sinata.system.domain.vo.DepartmentReportVO; |
| | | import com.sinata.system.domain.vo.MwCollectRecordVO; |
| | | import com.sinata.system.domain.vo.MwMicroEquipmentRecordVO; |
| | | import com.sinata.system.domain.vo.MwMicroEquipmentStaticsTitleVO; |
| | | import com.sinata.system.domain.vo.MwMicroEquipmentStaticsVO; |
| | | import com.sinata.system.domain.vo.SysDictDataVO; |
| | | import com.sinata.system.enums.MedicalWasteStatusEnum; |
| | | import com.sinata.system.mapper.MwMicroEquipmentRecordMapper; |
| | | import com.sinata.system.service.ISysDictDataService; |
| | | import com.sinata.system.service.MwCollectRecordService; |
| | | import com.sinata.system.service.MwMicroEquipmentRecordItemService; |
| | | import com.sinata.system.service.MwMicroEquipmentRecordService; |
| | | import com.sinata.system.service.MwMicroEquipmentService; |
| | | import com.sinata.system.service.MwStagingRoomService; |
| | | import com.sinata.system.service.SysDepartmentService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private final MwCollectRecordService mwCollectRecordService; |
| | | private final MwMicroEquipmentRecordItemService mwMicroEquipmentRecordItemService; |
| | | private final ISysDictDataService sysDictDataService; |
| | | private final MwStagingRoomService mwStagingRoomService; |
| | | private final MwMicroEquipmentService mwMicroEquipmentService; |
| | | |
| | | /** |
| | | * 设备使用记录分页列表 |
| | |
| | | return PageDTO.empty(0L, 0L); |
| | | } |
| | | return PageDTO.of(baseMapper.pageList(new Page<>(query.getPageCurr(), query.getPageSize()), query, treeCode)); |
| | | } |
| | | |
| | | @Override |
| | | public MwMicroEquipmentRecordVO detail(Long id) { |
| | | MwMicroEquipmentRecordVO mwMicroEquipmentRecordVO = BeanUtils.copyBean(this.getById(id), MwMicroEquipmentRecordVO.class); |
| | | if (Objects.nonNull(mwMicroEquipmentRecordVO)) { |
| | | mwMicroEquipmentRecordVO.setMedicalWasteList(mwStagingRoomService.queryMedicalWasteList(mwMicroEquipmentRecordVO.getId())); |
| | | } |
| | | return mwMicroEquipmentRecordVO; |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<List<String>> getStaticsData(MwMicroEquipmentStaticsQuery query) { |
| | | public DepartmentReportVO getStaticsData(MwMicroEquipmentStaticsQuery query) { |
| | | DepartmentReportVO vo = new DepartmentReportVO(); |
| | | SysDepartment department = sysDepartmentService.getById(query.getDepartmentId()); |
| | | if (Objects.nonNull(department)) { |
| | | vo.setDepartmentName(department.getDepartmentName()); |
| | | } |
| | | MwMicroEquipment microEquipment = mwMicroEquipmentService.getById(query.getEquipmentId()); |
| | | vo.setEquipmentName(microEquipment.getEquipmentName()); |
| | | List<SysDictDataVO> wasteTypeList = sysDictDataService.medicalWasteTypeList(); |
| | | |
| | | if (CollUtils.isEmpty(wasteTypeList)) { |
| | | return vo; |
| | | } |
| | | vo.setLegend(wasteTypeList.stream().map(SysDictDataVO::getDictLabel).collect(Collectors.toList())); |
| | | vo.getLegend().add("小计"); |
| | | String treeCode = sysDepartmentService.getTreeCodeByDepartmentId(query.getDepartmentId()); |
| | | List<SysDictData> medicalWasteTypeList = sysDictDataService.lambdaQuery().eq(SysDictData::getDictType, "medical_waste_type").list(); |
| | | |
| | | List<MwMicroEquipmentStaticsVO> staticsData = baseMapper.getStaticsData(query, treeCode); |
| | | SimpleDateFormat sdf = new SimpleDateFormat(DateUtils.YYYY_MM_DD_HH_MM_SS); |
| | | switch (query.getDateType()) { |
| | |
| | | break; |
| | | } |
| | | List<String> dateList = DateUtils.getDayBetween(query.getStartTime(), query.getEndTime(), query.getDateType()); |
| | | List<List<String>> result = new ArrayList<>(); |
| | | if (CollUtils.isNotEmpty(staticsData)) { |
| | | List<DepartmentReportItemVO> result = new ArrayList<>(); |
| | | for (String date : dateList) { |
| | | List<String> list = new ArrayList<>(); |
| | | list.add(date); |
| | | DepartmentReportItemVO departmentReportItemVO = new DepartmentReportItemVO(); |
| | | departmentReportItemVO.setName(date); |
| | | departmentReportItemVO.setData(new ArrayList<>()); |
| | | SimpleDateFormat finalSdf = sdf; |
| | | BigDecimal totalWeight = BigDecimal.ZERO; |
| | | BigDecimal totalCount = BigDecimal.ZERO; |
| | | for (SysDictData sysDictData : medicalWasteTypeList) { |
| | | BigDecimal weight = staticsData.stream().filter(e -> e.getWasteType().equals(sysDictData.getDictCode()) |
| | | && finalSdf.format(e.getUseTime()).equals(date) |
| | | ).map(MwMicroEquipmentStaticsVO::getWeight).reduce(BigDecimal::add).orElse(BigDecimal.ZERO).setScale(2, RoundingMode.HALF_UP); |
| | | ).map(MwMicroEquipmentStaticsVO::getWeight).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, RoundingMode.HALF_UP); |
| | | long count = staticsData.stream().filter(e -> e.getWasteType().equals(sysDictData.getDictCode()) |
| | | && finalSdf.format(e.getUseTime()).equals(date)).count(); |
| | | list.add(weight.toString()); |
| | | list.add(String.valueOf(count)); |
| | | departmentReportItemVO.getData().add(weight); |
| | | departmentReportItemVO.getData().add(BigDecimal.valueOf(count)); |
| | | totalWeight = totalWeight.add(weight); |
| | | totalCount = totalCount.add(BigDecimal.valueOf(count)); |
| | | } |
| | | staticsData.stream().filter(e -> finalSdf.format(e.getUseTime()).equals(date)).findFirst().ifPresent(item -> { |
| | | list.add(item.getTotalWeight().toString()); |
| | | list.add(String.valueOf(item.getBagNum())); |
| | | }); |
| | | result.add(list); |
| | | departmentReportItemVO.getData().add(totalWeight); |
| | | departmentReportItemVO.getData().add(totalCount); |
| | | result.add(departmentReportItemVO); |
| | | } |
| | | vo.setList(result); |
| | | } |
| | | return result; |
| | | return vo; |
| | | } |
| | | |
| | | @Override |
| | |
| | | .head(head) |
| | | .autoCloseStream(Boolean.TRUE) |
| | | .sheet("处置分析报表") |
| | | .doWrite(getStaticsData(query)); |
| | | .doWrite(getStaticsReportData(query)); |
| | | } |
| | | |
| | | /** |
| | | * 导出报表数据 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | private List<List<Object>> getStaticsReportData(MwMicroEquipmentStaticsQuery query) { |
| | | DepartmentReportVO vo = getStaticsData(query); |
| | | if (CollUtils.isNotEmpty(vo.getList())) { |
| | | List<List<Object>> result = new ArrayList<>(); |
| | | for (DepartmentReportItemVO departmentReportItemVO : vo.getList()) { |
| | | List<Object> data = new ArrayList<>(); |
| | | data.add(departmentReportItemVO.getName()); |
| | | data.addAll(departmentReportItemVO.getData()); |
| | | result.add(data); |
| | | } |
| | | return result; |
| | | } |
| | | return CollUtils.emptyList(); |
| | | } |
| | | |
| | | /** |
| | | * 导出报表表头 |
| | | * |
| | | * @return |
| | | */ |
| | | private List<List<String>> head() { |
| | | List<SysDictData> medicalWasteTypeList = sysDictDataService.lambdaQuery().eq(SysDictData::getDictType, "medical_waste_type").list(); |
| | | List<List<String>> headTitles = Lists.newArrayList(); |
| | |
| | | headTitles.add(Lists.newArrayList("小计", "总数量")); |
| | | return headTitles; |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.sinata.common.entity.PageDTO; |
| | | import com.sinata.common.exception.ServiceException; |
| | | import com.sinata.common.utils.BeanUtils; |
| | | import com.sinata.common.utils.CollUtils; |
| | | import com.sinata.common.utils.StringUtils; |
| | | import com.sinata.system.domain.MwMicroEquipment; |
| | | import com.sinata.system.domain.SysDepartment; |
| | |
| | | import com.sinata.system.domain.query.StorageRecordQuery; |
| | | import com.sinata.system.domain.vo.MwMedicalWasteBoxVO; |
| | | import com.sinata.system.domain.vo.MwMicroEquipmentVO; |
| | | import com.sinata.system.enums.DepartmentEnum; |
| | | import com.sinata.system.enums.MicroEquipmentStatusEnum; |
| | | import com.sinata.system.mapper.MwMicroEquipmentMapper; |
| | | import com.sinata.system.service.MwMicroEquipmentService; |
| | |
| | | @Override |
| | | public List<MwMicroEquipmentVO> getList() { |
| | | SysDepartment myDepartment = sysDepartmentService.getMyDepartment(); |
| | | if (Objects.nonNull(myDepartment)) { |
| | | //TODO 待完善 |
| | | List<MwMicroEquipment> list = this.lambdaQuery() |
| | | .eq(MwMicroEquipment::getStatus, MicroEquipmentStatusEnum.NORMAL.getCode()).list(); |
| | | return BeanUtils.copyList(list, MwMicroEquipmentVO.class); |
| | | /*if (Objects.nonNull(myDepartment)) { |
| | | if (myDepartment.getOrgType().equals(DepartmentEnum.MEDICAL_INSTITUTION.getCode())) { |
| | | List<MwMicroEquipment> list = this.lambdaQuery() |
| | | .eq(MwMicroEquipment::getStatus, MicroEquipmentStatusEnum.NORMAL.getCode()) |
| | |
| | | return BeanUtils.copyList(list, MwMicroEquipmentVO.class); |
| | | } |
| | | } |
| | | return CollUtils.emptyList(); |
| | | return CollUtils.emptyList();*/ |
| | | |
| | | } |
| | | } |
| | |
| | | package com.sinata.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.sinata.system.domain.MwProtectionEquipmentRecord; |
| | | import com.sinata.system.domain.dto.MwProtectionEquipmentRecordDTO; |
| | | import com.sinata.system.domain.vo.MwProtectionEquipmentRecordVO; |
| | | import com.sinata.system.mapper.MwProtectionEquipmentRecordMapper; |
| | | import com.sinata.system.service.MwProtectionEquipmentRecordService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Service |
| | | public class MwProtectionEquipmentRecordServiceImpl extends ServiceImpl<MwProtectionEquipmentRecordMapper, MwProtectionEquipmentRecord> implements MwProtectionEquipmentRecordService { |
| | | |
| | | /** |
| | | * 查询指定器具一个月的使用记录 |
| | | * |
| | | * @param id |
| | | * @param oneMonthAgo |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<MwProtectionEquipmentRecordVO> findByEquipmentIdAndUsageTimeAfter(Long id) { |
| | | return baseMapper.findByEquipmentIdAndUsageTimeAfter(id); |
| | | } |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public List<MwProtectionEquipmentVO> queryList() { |
| | | List<MwProtectionEquipment> list = list(); |
| | | return BeanUtils.copyToList(list, MwProtectionEquipmentVO.class); |
| | | return baseMapper.queryList(); |
| | | } |
| | | } |
| | |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | |
| | | } |
| | | updateById(mwStaff); |
| | | } |
| | | |
| | | /** |
| | | * 职工列表 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<MwStaffVO> queryList() { |
| | | return baseMapper.queryList(); |
| | | } |
| | | } |
| | |
| | | response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); |
| | | FastExcel.write(response.getOutputStream(), MwCheckoutRecordVO.class).sheet("暂存间出库记录").doWrite(list); |
| | | } |
| | | |
| | | @Override |
| | | public List<MwStagingRoomVO> queryStagingRoomList() { |
| | | return baseMapper.queryStagingRoomList(); |
| | | } |
| | | |
| | | /** |
| | | * 暂存间待处理医废分页列表 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageDTO<MwStorageRecordVO> temporarilyStoredMedicalWaste(StorageRecordQuery query) { |
| | | return PageDTO.of(baseMapper.temporarilyStoredMedicalWaste(query)); |
| | | } |
| | | |
| | | /** |
| | | * 根据医废查询使用列表 |
| | | * |
| | | * @param id 微波设备id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<MwStorageRecordVO> queryMedicalWasteList(Long id) { |
| | | return baseMapper.queryMedicalWasteList(id); |
| | | } |
| | | } |
| | |
| | | import com.sinata.system.domain.dto.MwWarningConfigDTO; |
| | | import com.sinata.system.domain.vo.MwWarningConfigItemVO; |
| | | import com.sinata.system.domain.vo.MwWarningConfigVO; |
| | | import com.sinata.system.domain.vo.SysDictDataVO; |
| | | import com.sinata.system.enums.WarningConfigTypeEnum; |
| | | import com.sinata.system.mapper.MwWarningConfigMapper; |
| | | import com.sinata.system.service.ISysDictDataService; |
| | | import com.sinata.system.service.MwWarningConfigItemService; |
| | | import com.sinata.system.service.MwWarningConfigService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RequiredArgsConstructor |
| | | public class MwWarningConfigServiceImpl extends ServiceImpl<MwWarningConfigMapper, MwWarningConfig> implements MwWarningConfigService { |
| | | private final MwWarningConfigItemService mwWarningConfigItemService; |
| | | |
| | | private final ISysDictDataService sysDictDataService; |
| | | /** |
| | | * 保存设置 |
| | | * |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveConfig(MwWarningConfigDTO dto) { |
| | | MwWarningConfig mwWarningConfig = lambdaQuery().eq(MwWarningConfig::getType, dto.getType()).last("limit 1").oneOpt().orElse(new MwWarningConfig()); |
| | | BeanUtils.copyProperties(dto, mwWarningConfig); |
| | | MwWarningConfig mwWarningConfig = BeanUtil.copyProperties(dto, MwWarningConfig.class); |
| | | MwWarningConfig config = lambdaQuery().eq(MwWarningConfig::getType, dto.getType()).last("limit 1").one(); |
| | | if (Objects.nonNull(config)) { |
| | | mwWarningConfig.setId(config.getId()); |
| | | } |
| | | saveOrUpdate(mwWarningConfig); |
| | | if (dto.getType().equals(WarningConfigTypeEnum.MEDICAL_WASTE.getCode()) || dto.getType().equals(WarningConfigTypeEnum.STAGING_ROOM_CAPACITY.getCode())) { |
| | | if (CollUtils.isEmpty(dto.getWarningConfigItemList())) { |
| | |
| | | //清空配置项 |
| | | mwWarningConfigItemService.lambdaUpdate().eq(MwWarningConfigItem::getConfigId, mwWarningConfig.getId()).remove(); |
| | | List<MwWarningConfigItem> mwWarningConfigItems = BeanUtil.copyToList(dto.getWarningConfigItemList(), MwWarningConfigItem.class); |
| | | mwWarningConfigItems.forEach(item -> item.setConfigId(mwWarningConfig.getId())); |
| | | mwWarningConfigItems.forEach(item -> { |
| | | item.setConfigId(mwWarningConfig.getId()); |
| | | item.setId(null); |
| | | }); |
| | | mwWarningConfigItemService.saveBatch(mwWarningConfigItems); |
| | | } |
| | | } |
| | |
| | | MwWarningConfigVO mwWarningConfigVO = null; |
| | | if (Objects.nonNull(mwWarningConfig)) { |
| | | mwWarningConfigVO = BeanUtil.copyProperties(mwWarningConfig, MwWarningConfigVO.class); |
| | | if (type.equals(WarningConfigTypeEnum.MEDICAL_WASTE.getCode()) || type.equals(WarningConfigTypeEnum.STAGING_ROOM_CAPACITY.getCode())) { |
| | | List<MwWarningConfigItem> mwWarningConfigItems = mwWarningConfigItemService.lambdaQuery().eq(MwWarningConfigItem::getConfigId, mwWarningConfig.getId()).list(); |
| | | List<MwWarningConfigItem> mwWarningConfigItems = mwWarningConfigItemService.lambdaQuery().eq(MwWarningConfigItem::getConfigId, mwWarningConfig.getId()).list(); |
| | | if (type.equals(WarningConfigTypeEnum.MEDICAL_WASTE.getCode())) { |
| | | mwWarningConfigVO.setWarningConfigItemList(BeanUtil.copyToList(mwWarningConfigItems, MwWarningConfigItemVO.class)); |
| | | if (CollUtils.isEmpty(mwWarningConfigItems)) { |
| | | List<SysDictDataVO> sysDictDataVOS = sysDictDataService.medicalWasteTypeList(); |
| | | List<MwWarningConfigItemVO> res = sysDictDataVOS.stream().map(item -> { |
| | | MwWarningConfigItemVO vo = new MwWarningConfigItemVO(); |
| | | vo.setWasteType(item.getDictCode()); |
| | | vo.setWasteTypeStr(item.getDictLabel()); |
| | | return vo; |
| | | }).collect(Collectors.toList()); |
| | | mwWarningConfigVO.setWarningConfigItemList(res); |
| | | } |
| | | |
| | | } |
| | | if (type.equals(WarningConfigTypeEnum.STAGING_ROOM_CAPACITY.getCode())) { |
| | | mwWarningConfigVO.setWarningConfigItemList(BeanUtil.copyToList(mwWarningConfigItems, MwWarningConfigItemVO.class)); |
| | | } |
| | | } |
| | |
| | | import com.sinata.system.domain.MwWarningRecord; |
| | | import com.sinata.system.domain.query.MwWarningRecordQuery; |
| | | import com.sinata.system.domain.vo.MwWarningRecordVO; |
| | | import com.sinata.system.enums.WarningStatusEnum; |
| | | import com.sinata.system.mapper.MwWarningRecordMapper; |
| | | import com.sinata.system.service.MwWarningRecordService; |
| | | import com.sinata.system.service.SysDepartmentService; |
| | |
| | | return PageDTO.of(page); |
| | | } |
| | | |
| | | /** |
| | | * 解除预警 |
| | | * |
| | | * @param id |
| | | */ |
| | | @Override |
| | | public void relieve(Long id) { |
| | | lambdaUpdate().set(MwWarningRecord::getStatus, WarningStatusEnum.RESOLVED.getCode()).eq(MwWarningRecord::getId, id).update(); |
| | | } |
| | | |
| | | @Override |
| | | public void export(MwWarningRecordQuery query) throws IOException { |
| | | String treeCode = sysDepartmentService.getTreeCodeByDepartmentId(query.getDepartmentId()); |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="queryWarningList" resultType="com.sinata.system.domain.vo.MwTransitCarWarningVO"> |
| | | SELECT MTC.ID, |
| | | MTC.LICENSE_PLATE_NUMBER, |
| | | MTC.MAXIMUM_LOAD, |
| | | MTC.DEPARTMENT_ID, SD.DEPARTMENT_NAME, SUM(MCR.TOTAL_WEIGHT) AS currentLoad |
| | | FROM MW_TRANSIT_ROUTE_CAR MTRC |
| | | LEFT JOIN MW_CHECKOUT_RECORD MCR ON MCR.CAR_ID = MTRC.CAR_ID |
| | | LEFT JOIN MW_TRANSIT_CAR MTC ON MTC.ID = MCR.CAR_ID |
| | | LEFT JOIN MW_CHECKOUT_RECORD_ITEM MCRI ON MCRI.CHECKOUT_RECORD_ID = MCR.ID |
| | | LEFT JOIN MW_COLLECT_RECORD MCR2 ON MCR2.ID = MCRI.COLLECT_RECORD_ID |
| | | LEFT JOIN SYS_DEPARTMENT SD ON SD.ID = MTC.DEPARTMENT_ID |
| | | <where> |
| | | MCR.DEL_FLAG = 0 |
| | | AND MCR2.STATUS = 2 |
| | | </where> |
| | | GROUP BY MTRC.ROUTE_ID,MTRC.CAR_ID |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="queryListTimeType" resultType="com.sinata.system.domain.vo.MwCollectRecordWarningVO" |
| | | parameterType="java.lang.Integer"> |
| | | SELECT mcr.ID, |
| | | mcr.DEPARTMENT_ID, |
| | | mcr.HOSPITAL_NAME, |
| | | mcr.STAGING_ROOM_ID, |
| | | mcr.MEDICAL_WASTE_NUMBER, |
| | | SUM(mcr.WEIGHT) AS totalWeight, |
| | | mcr.COLLECT_TIME, |
| | | sdi.DAILY_MIN_WASTE_QUANTITY, |
| | | sdi.DAILY_MAX_WASTE_QUANTITY, |
| | | sdi.MONTHLY_MIN_WASTE_QUANTITY, |
| | | sdi.MONTHLY_MAX_WASTE_QUANTITY |
| | | FROM MW_COLLECT_RECORD mcr |
| | | LEFT JOIN SYS_DEPARTMENT sd ON mcr.DEPARTMENT_ID = sd.ID |
| | | LEFT JOIN SYS_DEPARTMENT_INFO sdi ON sdi.DEPARTMENT_ID = sd.ID |
| | | <where> |
| | | mcr.DEL_FLAG = 0 |
| | | <if test="timeType != null and timeType == 1"> |
| | | AND mcr.COLLECT_TIME BETWEEN TRUNC(TRUNC(SYSDATE - 1,'dd'), 'dd') |
| | | AND TRUNC(TRUNC(SYSDATE - 1,'dd'), 'dd') + INTERVAL '1' DAY - INTERVAL '1' SECOND |
| | | </if> |
| | | <if test="timeType != null and timeType == 2"> |
| | | AND mcr.COLLECT_TIME BETWEEN TRUNC(ADD_MONTHS(SYSDATE, -1), 'mm') |
| | | AND TRUNC(ADD_MONTHS(SYSDATE, 0), 'mm') - INTERVAL '1' SECOND |
| | | </if> |
| | | </where> |
| | | GROUP BY sd.ID |
| | | ORDER BY mcr.CREATE_TIME DESC |
| | | </select> |
| | | <select id="queryListGroupByDepartment" resultType="com.sinata.system.domain.vo.MwCollectRecordWarningVO"> |
| | | SELECT MCR.ID, |
| | | MCR.DEPARTMENT_ID, |
| | | MCR.HOSPITAL_NAME, |
| | | MCR.STAGING_ROOM_ID, |
| | | MCR.MEDICAL_WASTE_NUMBER, |
| | | MCR.BOX_ID, |
| | | MCR.BOX_NUMBER, |
| | | MCR.WASTE_TYPE, |
| | | MCR.WASTE_TYPE_STR, |
| | | SUM(MCR.WEIGHT) totalWeight, |
| | | MCR.CHECKOUT_USER_ID, |
| | | MCR.CHECKOUT_TIME, |
| | | MCR.STATUS, |
| | | MCR.BOX_TIME, |
| | | MCR.DEL_FLAG, |
| | | MCR.CREATE_BY, |
| | | MCR.CREATE_TIME, |
| | | MCR.UPDATE_BY, |
| | | MCR.UPDATE_TIME, |
| | | MCR.COLLECT_USER_ID, |
| | | MCR.COLLECT_TIME, |
| | | MCR.DISPOSAL_HANDLE_RECORD_ID, |
| | | MCR.RECEIVE_TIME, |
| | | MCR.RECEIVE_USER_ID, |
| | | MCR.DRIVER_ID, |
| | | MCR.CAR_ID, |
| | | MCR.DISPOSAL_TIME, |
| | | MCR.DISPOSAL_USER_ID, |
| | | MCR.RECEIVE_DEPARTMENT_ID, |
| | | SDI.MAXIMUM_STORAGE_CAPACITY |
| | | FROM MW_COLLECT_RECORD MCR |
| | | LEFT JOIN SYS_DEPARTMENT_INFO SDI ON SDI.DEPARTMENT_ID = MCR.DEPARTMENT_ID |
| | | <where> |
| | | MCR.DEL_FLAG = 0 |
| | | </where> |
| | | GROUP BY MCR.DEPARTMENT_ID |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | MC.PARTY_B_PHONE, |
| | | MC.REMARK, |
| | | MC.CREATE_TIME, |
| | | MC.RELATION, |
| | | SD.DEPARTMENT_NAME |
| | | FROM MW_CONTRACT MC |
| | | LEFT JOIN SYS_DEPARTMENT SD ON SD.ID = MC.DEPARTMENT_ID |
| | | <where> |
| | | MC.DEL_FLAG = 0 |
| | | <if test="query.departmentId != null "> |
| | | AND MC.DEPARTMENT_ID = #{query.departmentId} |
| | | <if test="treeCode != null and treeCode != ''"> |
| | | AND SD.TREE_CODE LIKE CONCAT(#{treeCode},'%') |
| | | </if> |
| | | <if test="query.contractNumber != null and query.contractNumber != ''"> |
| | | AND MC.CONTRACT_NUMBER LIKE CONCAT('%',#{query.contractNumber},'%') |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="queryListTerminationDateBeforeNow" resultType="com.sinata.system.domain.vo.MwContractVO" |
| | | parameterType="java.util.Date"> |
| | | SELECT MC.ID, |
| | | MC.DEPARTMENT_ID, |
| | | MC.CONTRACT_NUMBER, |
| | | MC.CONTRACT_NAME, |
| | | MC.CONTRACT_AMOUNT, |
| | | MC.EFFECTIVE_DATE, |
| | | MC.TERMINATION_DATE, |
| | | MC.PARTY_A_NAME, |
| | | MC.PARTY_A_CONTACT, |
| | | MC.PARTY_A_PHONE, |
| | | MC.PARTY_B_NAME, |
| | | MC.PARTY_B_CONTACT, |
| | | MC.PARTY_B_PHONE, |
| | | MC.REMARK, |
| | | MC.CREATE_TIME, |
| | | MC.RELATION, |
| | | SD.DEPARTMENT_NAME |
| | | FROM MW_CONTRACT MC |
| | | LEFT JOIN SYS_DEPARTMENT SD ON SD.ID = MC.DEPARTMENT_ID |
| | | <where> |
| | | MC.DEL_FLAG = 0 |
| | | <if test="date !=null"> |
| | | AND MC.TERMINATION_DATE > #{date} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="queryDisposalListByDepartment" |
| | | resultType="com.sinata.system.domain.vo.MwDisposalRecordWarningVO"> |
| | | SELECT SUM(MDR.RECEIVE_WEIGHT) AS totalWeight, |
| | | SDI.MAXIMUM_STORAGE_CAPACITY, |
| | | MDR.DEPARTMENT_ID, |
| | | MDR.DISPOSAL_UNIT_NAME |
| | | FROM MW_COLLECT_RECORD MCR |
| | | LEFT JOIN MW_DISPOSAL_RECORD_ITEM MDRI ON MDRI.COLLECT_RECORD_ID = MCR.ID AND MCR.STATUS = 3 |
| | | LEFT JOIN MW_DISPOSAL_RECORD MDR ON MDR.ID = MDRI.DISPOSAL_RECORD_ID |
| | | LEFT JOIN SYS_DEPARTMENT_INFO SDI ON SDI.DEPARTMENT_ID = MDR.DEPARTMENT_ID |
| | | <where> |
| | | MDR.DEL_FLAG = 0 |
| | | </where> |
| | | GROUP BY MDR.DEPARTMENT_ID |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | mme.EQUIPMENT_NUMBER, |
| | | mme.STATUS, |
| | | mme.REMARK, |
| | | mme.RELATION, |
| | | SD.DEPARTMENT_NAME AS hospitalName |
| | | FROM MW_MICRO_EQUIPMENT mme |
| | | LEFT JOIN SYS_DEPARTMENT sd ON SD.ID = mme.DEPARTMENT_ID |
| | | <where> |
| | | mme.DEL_FLAG = 0 |
| | | <if test="treeCode != null and treeCode != ''"> |
| | | sd.TREE_CODE LIKE concat(#{treeCode}, '%') |
| | | AND sd.TREE_CODE LIKE concat(#{treeCode}, '%') |
| | | </if> |
| | | <if test="equipmentName != null and equipmentName != ''"> |
| | | AND mme.EQUIPMENT_NAME LIKE concat('%',#{equipmentName},'%') |
| | |
| | | AND MPE.EQUIPMENT_NAME LIKE CONCAT('%',#{query.equipmentName},'%') |
| | | </if> |
| | | </where> |
| | | ORDER BY MPE.CREATE_TIME DESC |
| | | </select> |
| | | <select id="recordPage" resultType="com.sinata.system.domain.vo.MwProtectionEquipmentRecordVO"> |
| | | SELECT MPER.ID, |
| | |
| | | MPER.DEL_FLAG = 0 AND MPER.PROTECTION_EQUIPMENT_ID = #{id} |
| | | </where> |
| | | </select> |
| | | <select id="queryList" resultType="com.sinata.system.domain.vo.MwProtectionEquipmentVO"> |
| | | SELECT MPE.ID, |
| | | MPE.DEPARTMENT_ID, |
| | | MPE.PROTECTION_EQUIPMENT_TYPE, |
| | | MPE.PROTECTION_EQUIPMENT_TYPE_STR, |
| | | MPE.EQUIPMENT_NAME, |
| | | MPE.STOCK, |
| | | MPE.REMARK, |
| | | MPE.DEL_FLAG, |
| | | MPE.CREATE_BY, |
| | | MPE.CREATE_TIME, |
| | | MPE.UPDATE_BY, |
| | | MPE.UPDATE_TIME, |
| | | MPE.RELATION, |
| | | SD.DEPARTMENT_NAME |
| | | FROM MW_PROTECTION_EQUIPMENT MPE |
| | | LEFT JOIN SYS_DEPARTMENT SD ON MPE.DEPARTMENT_ID = SD.ID |
| | | <where> |
| | | MPE.DEL_FLAG = 0 |
| | | </where> |
| | | ORDER BY MPE.CREATE_TIME DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | UPDATE_TIME, |
| | | ID, PROTECTION_EQUIPMENT_ID, CHANGE_QUANTITY, TYPE, OPERATOR |
| | | </sql> |
| | | <select id="findByEquipmentIdAndUsageTimeAfter" |
| | | resultType="com.sinata.system.domain.vo.MwProtectionEquipmentRecordVO"> |
| | | SELECT MPER.ID, |
| | | MPER.PROTECTION_EQUIPMENT_ID, |
| | | MPER.CHANGE_QUANTITY, |
| | | MPER.TYPE, |
| | | MPER.OPERATOR, |
| | | MPER.CREATE_TIME, |
| | | MPER.REMARK, |
| | | MPE.EQUIPMENT_NAME, |
| | | SD.DEPARTMENT_NAME |
| | | FROM MW_PROTECTION_EQUIPMENT_RECORD MPER |
| | | LEFT JOIN MW_PROTECTION_EQUIPMENT MPE ON MPE.ID = MPER.PROTECTION_EQUIPMENT_ID |
| | | LEFT JOIN SYS_DEPARTMENT SD ON SD.ID = MPE.DEPARTMENT_ID |
| | | <where> |
| | | MPE.DEL_FLAG = 0 |
| | | AND MPER.PROTECTION_EQUIPMENT_ID = #{id} |
| | | AND MPER.CREATE_TIME >= SYSDATE - INTERVAL '1' MONTH -- 最近一个月 |
| | | ORDER BY CREATE_TIME DESC |
| | | </where> |
| | | |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | </sql> |
| | | <select id="getUsageEquipmentListByTaskId" |
| | | resultType="com.sinata.system.domain.vo.MwProtectionTaskEquipmentVO"> |
| | | SELECT MPTE.ID, |
| | | SELECT MPE.ID, |
| | | MPTE.PROTECTION_EQUIPMENT_ID, |
| | | MPTE.PROTECTION_TASK_ID, |
| | | MPTE.USAGE_QUANTITY, |
| | |
| | | AND MS.VACCINE_CERTIFICATE IS NULL |
| | | </if> |
| | | </where> |
| | | ORDER BY MS.CREATE_TIME DESC |
| | | </select> |
| | | <select id="queryList" resultType="com.sinata.system.domain.vo.MwStaffVO"> |
| | | SELECT MS.ID, |
| | | MS.DEPARTMENT_ID, |
| | | MS.STAFF_NAME, |
| | | MS.PHONE, |
| | | MS.HEALTH_CERTIFICATE, |
| | | MS.VACCINE_CERTIFICATE, |
| | | SD.DEPARTMENT_NAME |
| | | FROM MW_STAFF MS |
| | | LEFT JOIN SYS_DEPARTMENT SD ON SD.ID = MS.DEPARTMENT_ID |
| | | <where> |
| | | MS.DEL_FLAG = 0 |
| | | </where> |
| | | ORDER BY MS.CREATE_TIME DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | (msr.MAX_CAPACITY - COUNT(mr.ID)) AS unUsedNum, |
| | | sd.DEPARTMENT_NAME AS hospitalName |
| | | FROM MW_STAGING_ROOM msr |
| | | LEFT JOIN (SELECT ID, |
| | | BOX_ID, |
| | | STAGING_ROOM_ID |
| | | FROM MW_COLLECT_RECORD |
| | | WHERE STATUS != 4 |
| | | GROUP BY BOX_ID) mr |
| | | LEFT JOIN (SELECT ID, BOX_ID, STAGING_ROOM_ID FROM MW_COLLECT_RECORD WHERE STATUS = 1 GROUP BY BOX_ID) mr |
| | | ON msr.ID = mr.STAGING_ROOM_ID |
| | | LEFT JOIN SYS_DEPARTMENT sd ON msr.DEPARTMENT_ID = sd.ID |
| | | <where> |
| | |
| | | </if> |
| | | <if test="query.wasteType != null"> |
| | | and mcr.WASTE_TYPE = #{query.wasteType} |
| | | </if> |
| | | <if test="query.status != null"> |
| | | and mcr.STATUS = #{query.status} |
| | | </if> |
| | | <if test="query.collectTimeStart != null and query.collectTimeEnd != null"> |
| | | and mcr.COLLECT_TIME between #{query.collectTimeStart} and #{query.collectTimeEnd} |
| | |
| | | </where> |
| | | ORDER BY mcr.CHECKOUT_TIME DESC |
| | | </select> |
| | | <select id="queryStagingRoomList" resultType="com.sinata.system.domain.vo.MwStagingRoomVO"> |
| | | SELECT msr.ID, |
| | | msr.DEPARTMENT_ID, |
| | | msr.ROOM_NAME, |
| | | msr.MAX_CAPACITY, |
| | | msr.CREATE_TIME, |
| | | msr.RELATION, |
| | | COUNT(mr.ID) AS usedNum, |
| | | (msr.MAX_CAPACITY - COUNT(mr.ID)) AS unUsedNum, |
| | | (COUNT(mr.ID) * 1.0 / msr.MAX_CAPACITY * 100) AS useRate, |
| | | sd.DEPARTMENT_NAME AS hospitalName |
| | | FROM MW_STAGING_ROOM msr |
| | | LEFT JOIN (SELECT ID, BOX_ID, STAGING_ROOM_ID FROM MW_COLLECT_RECORD WHERE STATUS = 1 GROUP BY BOX_ID) mr |
| | | ON msr.ID = mr.STAGING_ROOM_ID |
| | | LEFT JOIN SYS_DEPARTMENT sd ON msr.DEPARTMENT_ID = sd.ID |
| | | <where> |
| | | msr.DEL_FLAG = 0 |
| | | </where> |
| | | ORDER BY msr.CREATE_TIME DESC |
| | | </select> |
| | | <select id="temporarilyStoredMedicalWaste" resultType="com.sinata.system.domain.vo.MwStorageRecordVO" |
| | | parameterType="com.sinata.system.domain.query.StorageRecordQuery"> |
| | | SELECT |
| | | mcr.BOX_ID AS id, |
| | | mcr.DEPARTMENT_ID, |
| | | mcr.HOSPITAL_NAME, |
| | | mcr.STAGING_ROOM_ID, |
| | | mcr.MEDICAL_WASTE_NUMBER, |
| | | mcr.BOX_NUMBER, |
| | | mcr.WASTE_TYPE, |
| | | mcr.WASTE_TYPE_STR, |
| | | SUM(mcr.WEIGHT) AS weight, |
| | | mcr.CHECKOUT_USER_ID, |
| | | mcr.CHECKOUT_TIME, |
| | | mcr.STATUS, |
| | | mcr.BOX_TIME, |
| | | mcr.DEL_FLAG, |
| | | mcr.CREATE_BY, |
| | | mcr.CREATE_TIME, |
| | | mcr.UPDATE_BY, |
| | | mcr.UPDATE_TIME, |
| | | mcr.COLLECT_USER_ID, |
| | | mcr.COLLECT_TIME, |
| | | msr.ROOM_NAME, |
| | | su.NICK_NAME AS COLLECT_USER_NAME, |
| | | (SELECT COUNT(*) FROM MW_COLLECT_RECORD WHERE BOX_ID = mcr.BOX_ID) bagNum |
| | | FROM MW_COLLECT_RECORD mcr |
| | | LEFT JOIN SYS_USER su |
| | | ON mcr.COLLECT_USER_ID = su.USER_ID |
| | | LEFT JOIN SYS_DEPARTMENT sd ON su.DEPARTMENT_ID = sd.ID |
| | | LEFT JOIN MW_STAGING_ROOM msr ON msr.ID = mcr.STAGING_ROOM_ID |
| | | <where> |
| | | mcr.DEL_FLAG = 0 |
| | | <if test="query.departmentId != null "> |
| | | and mcr.DEPARTMENT_ID = #{query.departmentId} |
| | | </if> |
| | | <if test="query.stagingRoomId != null and query.stagingRoomId != ''"> |
| | | and mcr.STAGING_ROOM_ID = #{query.stagingRoomId} |
| | | </if> |
| | | <if test="query.wasteType != null"> |
| | | and mcr.WASTE_TYPE = #{query.wasteType} |
| | | </if> |
| | | <if test="query.status != null"> |
| | | and mcr.STATUS = #{query.status} |
| | | </if> |
| | | <if test="query.collectTimeStart != null and query.collectTimeEnd != null"> |
| | | and mcr.COLLECT_TIME between #{query.collectTimeStart} and #{query.collectTimeEnd} |
| | | </if> |
| | | </where> |
| | | GROUP BY mcr.BOX_ID |
| | | ORDER BY mcr.CREATE_TIME DESC |
| | | </select> |
| | | <select id="queryMedicalWasteList" resultType="com.sinata.system.domain.vo.MwStorageRecordVO" |
| | | parameterType="java.lang.Long"> |
| | | SELECT mcr.BOX_ID AS id, |
| | | mcr.DEPARTMENT_ID, |
| | | mcr.HOSPITAL_NAME, |
| | | mcr.STAGING_ROOM_ID, |
| | | mcr.MEDICAL_WASTE_NUMBER, |
| | | mcr.BOX_NUMBER, |
| | | mcr.WASTE_TYPE, |
| | | mcr.WASTE_TYPE_STR, |
| | | SUM(mcr.WEIGHT) AS weight, |
| | | mcr.CHECKOUT_USER_ID, |
| | | mcr.CHECKOUT_TIME, |
| | | mcr.STATUS, |
| | | mcr.BOX_TIME, |
| | | mcr.DEL_FLAG, |
| | | mcr.CREATE_BY, |
| | | mcr.CREATE_TIME, |
| | | mcr.UPDATE_BY, |
| | | mcr.UPDATE_TIME, |
| | | mcr.COLLECT_USER_ID, |
| | | mcr.COLLECT_TIME, |
| | | msr.ROOM_NAME, |
| | | su.NICK_NAME AS collectUserName, |
| | | (SELECT COUNT(*) FROM MW_COLLECT_RECORD WHERE BOX_ID = mcr.BOX_ID) bagNum |
| | | FROM MW_MICRO_EQUIPMENT_RECORD_ITEM mmeri |
| | | LEFT JOIN MW_COLLECT_RECORD mcr ON mcr.ID = mmeri.COLLECT_RECORD_ID |
| | | LEFT JOIN SYS_USER su ON mcr.COLLECT_USER_ID = su.USER_ID |
| | | LEFT JOIN MW_STAGING_ROOM msr ON msr.ID = mcr.STAGING_ROOM_ID |
| | | <where> |
| | | mcr.DEL_FLAG = 0 AND mmeri.EQUIPMENT_RECORD_ID =#{id} |
| | | </where> |
| | | GROUP BY mcr.BOX_ID |
| | | ORDER BY mcr.CREATE_TIME DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | LEFT JOIN SYS_DICT_DATA sdd2 |
| | | ON sdi.INSTITUTION_TYPE = sdd2.DICT_CODE |
| | | <where> |
| | | sd.ORG_TYPE = 2 |
| | | sd.DEL_FLAG =0 AND sd.ORG_TYPE = 2 |
| | | <if test="departmentName != null and departmentName != ''"> |
| | | AND sd.DEPARTMENT_NAME LIKE CONCAT('%', #{departmentName}, '%') |
| | | </if> |
| | |
| | | LEFT JOIN SYS_DEPARTMENT_INFO sdi |
| | | ON sd.ID = sdi.DEPARTMENT_ID |
| | | <where> |
| | | sd.ORG_TYPE = 3 |
| | | sd.DEL_FLAG = 0 AND sd.ORG_TYPE = 3 |
| | | <if test="departmentId != null"> |
| | | AND sd.PARENT_ID = #{departmentId} |
| | | </if> |