From b882114079843509a58866b870575604723425a9 Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期三, 28 八月 2024 10:35:35 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ycl-pojo/src/main/java/com/ycl/platform/domain/query/DistributeWorkOrderQuery.java | 5 ycl-server/src/main/java/com/ycl/platform/controller/WorkOrderController.java | 12 ycl-pojo/src/main/java/com/ycl/platform/domain/entity/ImageResourceSecurityDetail.java | 61 + ycl-pojo/src/main/java/com/ycl/platform/domain/entity/WorkOrderAuditingRecord.java | 6 ycl-server/src/main/java/com/ycl/platform/mapper/ImageResourceSecurityDetailMapper.java | 15 ycl-common/src/main/java/enumeration/converter/RuleDeductCategoryConverter.java | 8 ycl-server/src/main/java/com/ycl/platform/service/HKErrorTypeService.java | 76 +++ ycl-server/src/main/java/com/ycl/platform/mapper/WorkOrderYwConditionRecordMapper.java | 4 ycl-server/src/main/resources/mapper/zgyw/ImageResourceSecurityMapper.xml | 63 +- ycl-pojo/src/main/java/com/ycl/platform/domain/entity/ImageResourceSecurity.java | 2 ycl-server/src/main/resources/application-prod.yml | 1 ycl-server/src/main/java/com/ycl/platform/service/impl/HKErrorTypeServiceImpl.java | 74 +++ ycl-common/src/main/java/enumeration/converter/AlarmCategoryConverter.java | 53 ++ ycl-pojo/src/main/java/com/ycl/platform/domain/entity/TMonitor.java | 319 -------------- ycl-server/src/main/java/com/ycl/task/WorkOrderImgTask.java | 2 ycl-server/src/main/java/com/ycl/task/ImageResourceSecurityTask.java | 72 +++ ycl-server/src/main/java/com/ycl/platform/service/impl/WorkOrderServiceImpl.java | 22 ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml | 24 + ycl-server/src/main/java/com/ycl/platform/service/IImageResourceSecurityService.java | 22 + ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml | 17 ycl-common/src/main/java/enumeration/converter/AlarmLevelConverter.java | 50 ++ ycl-pojo/src/main/java/com/ycl/platform/base/AbsEntity.java | 2 ycl-server/src/main/java/com/ycl/task/HKTask.java | 3 ycl-server/src/main/resources/mapper/zgyw/WorkOrderMapper.xml | 37 + ycl-server/src/main/java/com/ycl/handler/ImageResourceHandler.java | 40 + ycl-server/src/main/java/com/ycl/platform/controller/ImageResourceSecurityController.java | 24 + ycl-server/src/main/java/com/ycl/platform/mapper/TMonitorMapper.java | 7 ycl-server/src/main/resources/mapper/zgyw/WorkOrderYwConditionRecordMapper.xml | 3 ycl-server/src/main/resources/application-dev.yml | 9 ycl-common/src/main/java/enumeration/general/AlarmCategoryEnum.java | 32 + ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexVideoMapper.java | 6 ycl-common/src/main/java/enumeration/DeviceType.java | 28 + ycl-common/src/main/java/enumeration/general/AlarmLevelEnum.java | 30 + ycl-server/src/main/java/com/ycl/platform/service/WorkOrderService.java | 8 ycl-server/src/main/resources/mapper/zgyw/ImageResourceSecurityDetailMapper.xml | 35 + ycl-server/src/main/java/com/ycl/platform/mapper/ImageResourceSecurityMapper.java | 7 ycl-server/src/main/java/com/ycl/platform/service/impl/ImageResourceSecurityServiceImpl.java | 105 ++-- 37 files changed, 817 insertions(+), 467 deletions(-) diff --git a/ycl-common/src/main/java/enumeration/DeviceType.java b/ycl-common/src/main/java/enumeration/DeviceType.java new file mode 100644 index 0000000..a88d626 --- /dev/null +++ b/ycl-common/src/main/java/enumeration/DeviceType.java @@ -0,0 +1,28 @@ +package enumeration; + +import lombok.Getter; + +/** + * 璁惧鍘傚晢 + * + * @author锛歺p + * @date锛�2024/8/26 19:37 + */ +@Getter +public enum DeviceType { + + HK(0, "娴峰悍"), + DH(1, "澶у崕"), + YS(2, "瀹囪"), + ; + + private final Integer type; + + private final String desc; + + + DeviceType(Integer type, String desc) { + this.type = type; + this.desc = desc; + } +} diff --git a/ycl-common/src/main/java/enumeration/converter/AlarmCategoryConverter.java b/ycl-common/src/main/java/enumeration/converter/AlarmCategoryConverter.java new file mode 100644 index 0000000..ff132f9 --- /dev/null +++ b/ycl-common/src/main/java/enumeration/converter/AlarmCategoryConverter.java @@ -0,0 +1,53 @@ +package enumeration.converter; + +import com.alibaba.excel.converters.Converter; +import com.alibaba.excel.enums.CellDataTypeEnum; +import com.alibaba.excel.metadata.GlobalConfiguration; +import com.alibaba.excel.metadata.data.ReadCellData; +import com.alibaba.excel.metadata.data.WriteCellData; +import com.alibaba.excel.metadata.property.ExcelContentProperty; +import enumeration.general.AlarmCategoryEnum; + +/** + * @author gonghl + * @since 2024/8/26 涓嬪崍 4:00 + */ +public class AlarmCategoryConverter implements Converter<AlarmCategoryEnum> { + + @Override + public Class<?> supportJavaTypeKey() { + return Converter.super.supportJavaTypeKey(); + } + + @Override + public CellDataTypeEnum supportExcelTypeKey() { + return Converter.super.supportExcelTypeKey(); + } + + @Override + public AlarmCategoryEnum convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { + String value = cellData.getStringValue(); + if (AlarmCategoryEnum.SSH.getDesc().equals(value)) { + return AlarmCategoryEnum.SSH; + } + if (AlarmCategoryEnum.TELNET.getDesc().equals(value)) { + return AlarmCategoryEnum.TELNET; + } + if (AlarmCategoryEnum.RDP.getDesc().equals(value)) { + return AlarmCategoryEnum.RDP; + } + if (AlarmCategoryEnum.FTP.getDesc().equals(value)) { + return AlarmCategoryEnum.FTP; + } + if (AlarmCategoryEnum.DATABASE.getDesc().equals(value)) { + return AlarmCategoryEnum.DATABASE; + } + return null; + } + + @Override + public WriteCellData<AlarmCategoryEnum> convertToExcelData(AlarmCategoryEnum value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { + return new WriteCellData<>(value.getDesc()); + } + +} diff --git a/ycl-common/src/main/java/enumeration/converter/AlarmLevelConverter.java b/ycl-common/src/main/java/enumeration/converter/AlarmLevelConverter.java new file mode 100644 index 0000000..2784688 --- /dev/null +++ b/ycl-common/src/main/java/enumeration/converter/AlarmLevelConverter.java @@ -0,0 +1,50 @@ +package enumeration.converter; + +import com.alibaba.excel.converters.Converter; +import com.alibaba.excel.enums.CellDataTypeEnum; +import com.alibaba.excel.metadata.GlobalConfiguration; +import com.alibaba.excel.metadata.data.ReadCellData; +import com.alibaba.excel.metadata.data.WriteCellData; +import com.alibaba.excel.metadata.property.ExcelContentProperty; +import enumeration.general.AlarmLevelEnum; + +/** + * @author gonghl + * @since 2024/8/26 涓嬪崍 4:00 + */ +public class AlarmLevelConverter implements Converter<AlarmLevelEnum> { + + @Override + public Class<?> supportJavaTypeKey() { + return Converter.super.supportJavaTypeKey(); + } + + @Override + public CellDataTypeEnum supportExcelTypeKey() { + return Converter.super.supportExcelTypeKey(); + } + + @Override + public AlarmLevelEnum convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { + String value = cellData.getStringValue(); + if (AlarmLevelEnum.LOW.getDesc().equals(value)) { + return AlarmLevelEnum.LOW; + } + if (AlarmLevelEnum.MIDDLE.getDesc().equals(value)) { + return AlarmLevelEnum.MIDDLE; + } + if (AlarmLevelEnum.HIGH.getDesc().equals(value)) { + return AlarmLevelEnum.HIGH; + } + if (AlarmLevelEnum.VERY_HIGH.getDesc().equals(value)) { + return AlarmLevelEnum.VERY_HIGH; + } + return null; + } + + @Override + public WriteCellData<AlarmLevelEnum> convertToExcelData(AlarmLevelEnum value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { + return new WriteCellData<>(value.getDesc()); + } + +} diff --git a/ycl-common/src/main/java/enumeration/converter/RuleDeductCategoryConverter.java b/ycl-common/src/main/java/enumeration/converter/RuleDeductCategoryConverter.java index a972243..98cdc28 100644 --- a/ycl-common/src/main/java/enumeration/converter/RuleDeductCategoryConverter.java +++ b/ycl-common/src/main/java/enumeration/converter/RuleDeductCategoryConverter.java @@ -7,14 +7,12 @@ import com.alibaba.excel.metadata.data.WriteCellData; import com.alibaba.excel.metadata.property.ExcelContentProperty; import enumeration.general.RuleDeductCategoryEnum; -import lombok.extern.slf4j.Slf4j; /** * 鎵e垎绫诲瀷鏋氫妇瑁呮崲鍣� * * @author gonghl */ -@Slf4j public class RuleDeductCategoryConverter implements Converter<RuleDeductCategoryEnum> { @Override @@ -28,7 +26,7 @@ } @Override - public RuleDeductCategoryEnum convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { + public RuleDeductCategoryEnum convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { if (cellData.getStringValue().equals(RuleDeductCategoryEnum.DEDUCT_POINTS.getDesc())) { return RuleDeductCategoryEnum.DEDUCT_POINTS; } else if (cellData.getStringValue().equals(RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY.getDesc())) { @@ -41,7 +39,7 @@ } @Override - public WriteCellData convertToExcelData(RuleDeductCategoryEnum value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { - return new WriteCellData(value.getDesc()); + public WriteCellData<RuleDeductCategoryEnum> convertToExcelData(RuleDeductCategoryEnum value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { + return new WriteCellData<>(value.getDesc()); } } \ No newline at end of file diff --git a/ycl-common/src/main/java/enumeration/general/AlarmCategoryEnum.java b/ycl-common/src/main/java/enumeration/general/AlarmCategoryEnum.java new file mode 100644 index 0000000..ff85036 --- /dev/null +++ b/ycl-common/src/main/java/enumeration/general/AlarmCategoryEnum.java @@ -0,0 +1,32 @@ +package enumeration.general; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import com.fasterxml.jackson.annotation.JsonValue; +import lombok.Getter; + +/** + * @author gonghl + * @since 2024/8/26 涓嬪崍 3:47 + */ +@Getter +public enum AlarmCategoryEnum { + + SSH("1", "SSH寮卞彛浠�", 2), + TELNET("2", "Telnet寮卞彛浠�", 2), + RDP("3", "RDP寮卞彛浠�", 2), + FTP("4", "FTP寮卞彛浠�", 6), + DATABASE("5", "鏁版嵁搴撳急鍙d护", 6); + + @EnumValue + private final String value; + @JsonValue + private final String desc; + private final Integer score; + + AlarmCategoryEnum(String value, String desc, Integer score) { + this.value = value; + this.desc = desc; + this.score = score; + } + +} diff --git a/ycl-common/src/main/java/enumeration/general/AlarmLevelEnum.java b/ycl-common/src/main/java/enumeration/general/AlarmLevelEnum.java new file mode 100644 index 0000000..da16f42 --- /dev/null +++ b/ycl-common/src/main/java/enumeration/general/AlarmLevelEnum.java @@ -0,0 +1,30 @@ +package enumeration.general; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import com.fasterxml.jackson.annotation.JsonValue; +import lombok.Getter; + +/** + * @author gonghl + * @since 2024/8/26 涓嬪崍 3:47 + */ +@Getter +public enum AlarmLevelEnum { + + LOW("1", "浣庡嵄"), + MIDDLE("2", "涓嵄"), + HIGH("3", "楂樺嵄"), + VERY_HIGH("4", "瓒呭嵄"); + + @EnumValue + private final String value; + @JsonValue + private final String desc; + + AlarmLevelEnum(String value, String desc) { + this.value = value; + this.desc = desc; + } + + +} diff --git a/ycl-pojo/src/main/java/com/ycl/platform/base/AbsEntity.java b/ycl-pojo/src/main/java/com/ycl/platform/base/AbsEntity.java index 11e52d4..dff8d5f 100644 --- a/ycl-pojo/src/main/java/com/ycl/platform/base/AbsEntity.java +++ b/ycl-pojo/src/main/java/com/ycl/platform/base/AbsEntity.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.util.Date; @@ -23,6 +24,7 @@ /** * 鍒涘缓鏃堕棿 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @TableField(value = "create_time",fill = FieldFill.INSERT) private Date createTime; diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/ImageResourceSecurity.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/ImageResourceSecurity.java index 4c905f8..0863c47 100644 --- a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/ImageResourceSecurity.java +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/ImageResourceSecurity.java @@ -24,6 +24,8 @@ @Excel(name = "閮ㄩ棬id") private Long deptId; + private String deptName; + /** 骞冲彴杩愯鐜� */ @Excel(name = "骞冲彴杩愯鐜�") private BigDecimal platformOnline; diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/ImageResourceSecurityDetail.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/ImageResourceSecurityDetail.java index 3684114..e417a6f 100644 --- a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/ImageResourceSecurityDetail.java +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/ImageResourceSecurityDetail.java @@ -1,10 +1,17 @@ package com.ycl.platform.domain.entity; -import annotation.Excel; +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.baomidou.mybatisplus.annotation.TableField; import com.fasterxml.jackson.annotation.JsonFormat; -import com.ycl.system.entity.BaseEntity; +import enumeration.converter.AlarmCategoryConverter; +import enumeration.converter.AlarmLevelConverter; +import enumeration.general.AlarmCategoryEnum; +import enumeration.general.AlarmLevelEnum; import lombok.Data; +import java.time.LocalDateTime; import java.util.Date; /** @@ -14,37 +21,51 @@ * @date 2024-08-24 */ @Data -public class ImageResourceSecurityDetail extends BaseEntity -{ - private static final long serialVersionUID = 1L; +@ColumnWidth(20) +public class ImageResourceSecurityDetail { - /** $column.columnComment */ + @ExcelIgnore private Long id; - /** $column.columnComment */ - @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + @ExcelProperty("IP鍦板潃") private String ip; - /** 閮ㄩ棬id */ - @Excel(name = "閮ㄩ棬id") + /** + * 閮ㄩ棬id + */ + @ExcelIgnore private Long deptId; - /** 鎶ヨ绫诲瀷 */ - @Excel(name = "鎶ヨ绫诲瀷") - private String alarmCategory; + @ExcelProperty("閮ㄩ棬鍚嶇О") + @TableField(exist = false) + private String deptName; - /** 鎶ヨ绾у埆 */ - @Excel(name = "鎶ヨ绾у埆") - private Long alarmLevel; + /** + * 鎶ヨ绫诲瀷 + */ + @ExcelProperty(value = "鎶ヨ绫诲瀷", converter = AlarmCategoryConverter.class) + private AlarmCategoryEnum alarmCategory; - /** 鎶ヨ娆℃暟 */ - @Excel(name = "鎶ヨ娆℃暟") + /** + * 鎶ヨ绾у埆 + */ + @ExcelProperty(value = "鎶ヨ绾у埆", converter = AlarmLevelConverter.class) + private AlarmLevelEnum alarmLevel; + + /** + * 鎶ヨ娆℃暟 + */ + @ExcelProperty("鎶ヨ娆℃暟") private Long num; - /** 鎶ヨ鏃堕棿 */ + /** + * 鎶ヨ鏃堕棿 + */ @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "鎶ヨ鏃堕棿", width = 30, dateFormat = "yyyy-MM-dd") + @ExcelProperty("鎶ヨ鏃堕棿") private Date alarmTime; + @ExcelIgnore + private LocalDateTime createTime; } diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/TMonitor.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/TMonitor.java index eb49977..4b6c13f 100644 --- a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/TMonitor.java +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/TMonitor.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.fasterxml.jackson.annotation.JsonFormat; import com.ycl.system.entity.BaseEntity; +import lombok.Data; import java.util.Date; @@ -14,6 +15,7 @@ * @author ruoyi * @date 2024-03-04 */ +@Data public class TMonitor extends BaseEntity { private static final long serialVersionUID = 1L; @@ -142,320 +144,7 @@ @Excel(name = "绫诲瀷缂栫爜 : [131.鎽勫儚鏈虹紪鐮�;132.缃戠粶鎽勫儚鏈虹紪鐮�;]") private Long lxbm; - public void setInstalledTime(Date installedTime) { - this.installedTime = installedTime; - } + /** 璁惧鍘傚晢锛� 0娴峰悍 1澶у崕 2瀹囪*/ + private Integer deviceType; - public Date getInstalledTime() { - return installedTime; - } - - public void setId(Long id) - { - this.id = id; - } - - public Long getId() - { - return id; - } - public void setSerialNumber(String serialNumber) - { - this.serialNumber = serialNumber; - } - - public String getSerialNumber() - { - return serialNumber; - } - public void setName(String name) - { - this.name = name; - } - - public String getName() - { - return name; - } - public void setSiteType(Long siteType) - { - this.siteType = siteType; - } - - public Long getSiteType() - { - return siteType; - } - public void setMacAddr(String macAddr) - { - this.macAddr = macAddr; - } - - public String getMacAddr() - { - return macAddr; - } - public void setIp(String ip) - { - this.ip = ip; - } - - public String getIp() - { - return ip; - } - public void setCameraFunType(String cameraFunType) - { - this.cameraFunType = cameraFunType; - } - - public String getCameraFunType() - { - return cameraFunType; - } - public void setLongitude(String longitude) - { - this.longitude = longitude; - } - - public String getLongitude() - { - return longitude; - } - public void setLatitude(String latitude) - { - this.latitude = latitude; - } - - public String getLatitude() - { - return latitude; - } - public void setCameraCaptureArea(String cameraCaptureArea) - { - this.cameraCaptureArea = cameraCaptureArea; - } - - public String getCameraCaptureArea() - { - return cameraCaptureArea; - } - public void setOnState(Long onState) - { - this.onState = onState; - } - - public Long getOnState() - { - return onState; - } - public void setCivilCode(String civilCode) - { - this.civilCode = civilCode; - } - - public String getCivilCode() - { - return civilCode; - } - public void setIntegratedDevice(Long integratedDevice) - { - this.integratedDevice = integratedDevice; - } - - public Long getIntegratedDevice() - { - return integratedDevice; - } - public void setCameraBrand(Long cameraBrand) - { - this.cameraBrand = cameraBrand; - } - - public Long getCameraBrand() - { - return cameraBrand; - } - public void setAddress(String address) - { - this.address = address; - } - - public String getAddress() - { - return address; - } - public void setNetWorking(Long netWorking) - { - this.netWorking = netWorking; - } - - public Long getNetWorking() - { - return netWorking; - } - public void setPublicSecurity(String publicSecurity) - { - this.publicSecurity = publicSecurity; - } - - public String getPublicSecurity() - { - return publicSecurity; - } - - public void setManagementUnit(String managementUnit) - { - this.managementUnit = managementUnit; - } - - public String getManagementUnit() - { - return managementUnit; - } - public void setMuContactInfo(String muContactInfo) - { - this.muContactInfo = muContactInfo; - } - - public String getMuContactInfo() - { - return muContactInfo; - } - public void setStorageDays(Long storageDays) - { - this.storageDays = storageDays; - } - - public Long getStorageDays() - { - return storageDays; - } - public void setMonitorAzimuth(Long monitorAzimuth) - { - this.monitorAzimuth = monitorAzimuth; - } - - public Long getMonitorAzimuth() - { - return monitorAzimuth; - } - public void setScenePhotoAddr(String scenePhotoAddr) - { - this.scenePhotoAddr = scenePhotoAddr; - } - - public String getScenePhotoAddr() - { - return scenePhotoAddr; - } - public void setModel(String model) - { - this.model = model; - } - - public String getModel() - { - return model; - } - public void setSiteVulgo(String siteVulgo) - { - this.siteVulgo = siteVulgo; - } - - public String getSiteVulgo() - { - return siteVulgo; - } - public void setCameraType(Long cameraType) - { - this.cameraType = cameraType; - } - - public Long getCameraType() - { - return cameraType; - } - public void setCameraLightType(Long cameraLightType) - { - this.cameraLightType = cameraLightType; - } - - public Long getCameraLightType() - { - return cameraLightType; - } - public void setEncodedFormat(Long encodedFormat) - { - this.encodedFormat = encodedFormat; - } - - public Long getEncodedFormat() - { - return encodedFormat; - } - public void setCameraDept(String cameraDept) - { - this.cameraDept = cameraDept; - } - - public String getCameraDept() - { - return cameraDept; - } - public void setHybm(String hybm) - { - this.hybm = hybm; - } - - public String getHybm() - { - return hybm; - } - public void setLxbm(Long lxbm) - { - this.lxbm = lxbm; - } - - public Long getLxbm() - { - return lxbm; - } - - @Override - public String toString() { - return "TMonitor{" + - "id=" + id + - ", serialNumber='" + serialNumber + '\'' + - ", name='" + name + '\'' + - ", siteType=" + siteType + - ", macAddr='" + macAddr + '\'' + - ", ip='" + ip + '\'' + - ", cameraFunType='" + cameraFunType + '\'' + - ", longitude='" + longitude + '\'' + - ", latitude='" + latitude + '\'' + - ", cameraCaptureArea='" + cameraCaptureArea + '\'' + - ", onState=" + onState + - ", civilCode='" + civilCode + '\'' + - ", integratedDevice=" + integratedDevice + - ", cameraBrand=" + cameraBrand + - ", address='" + address + '\'' + - ", netWorking=" + netWorking + - ", publicSecurity='" + publicSecurity + '\'' + - ", installedTime=" + installedTime + - ", managementUnit='" + managementUnit + '\'' + - ", muContactInfo='" + muContactInfo + '\'' + - ", storageDays=" + storageDays + - ", monitorAzimuth=" + monitorAzimuth + - ", scenePhotoAddr='" + scenePhotoAddr + '\'' + - ", model='" + model + '\'' + - ", siteVulgo='" + siteVulgo + '\'' + - ", cameraType=" + cameraType + - ", cameraLightType=" + cameraLightType + - ", encodedFormat=" + encodedFormat + - ", cameraDept='" + cameraDept + '\'' + - ", hybm='" + hybm + '\'' + - ", lxbm=" + lxbm + - '}'; - } } diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/WorkOrderAuditingRecord.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/WorkOrderAuditingRecord.java index ad21639..ff225ff 100644 --- a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/WorkOrderAuditingRecord.java +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/WorkOrderAuditingRecord.java @@ -22,9 +22,9 @@ private static final long serialVersionUID = 1L; - @ApiModelProperty("宸ュ崟ID") - @TableField("work_order_id") - private Integer workOrderId; + @ApiModelProperty("宸ュ崟鍙�") + @TableField("work_order_no") + private String workOrderNo; @ApiModelProperty("瀹℃牳浜�") @TableField("auditing_user") diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/query/DistributeWorkOrderQuery.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/query/DistributeWorkOrderQuery.java index fab30c1..cfefabe 100644 --- a/ycl-pojo/src/main/java/com/ycl/platform/domain/query/DistributeWorkOrderQuery.java +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/query/DistributeWorkOrderQuery.java @@ -32,6 +32,11 @@ private Integer unitId; /** + * 鏁呴殰绫诲瀷 + */ + private List<String> errorTypeList; + + /** * 宸ュ崟id */ @JsonProperty("ids") diff --git a/ycl-server/src/main/java/com/ycl/handler/ImageResourceHandler.java b/ycl-server/src/main/java/com/ycl/handler/ImageResourceHandler.java new file mode 100644 index 0000000..348f114 --- /dev/null +++ b/ycl-server/src/main/java/com/ycl/handler/ImageResourceHandler.java @@ -0,0 +1,40 @@ +package com.ycl.handler; + +import com.alibaba.excel.write.handler.SheetWriteHandler; +import com.alibaba.excel.write.handler.context.SheetWriteHandlerContext; +import org.apache.poi.ss.usermodel.DataValidation; +import org.apache.poi.ss.usermodel.DataValidationConstraint; +import org.apache.poi.ss.usermodel.DataValidationHelper; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.util.CellRangeAddressList; + +/** + * @author gonghl + * @since 2024/8/26 涓嬪崍 1:38 + */ +public class ImageResourceHandler implements SheetWriteHandler { + + @Override + public void afterSheetCreate(SheetWriteHandlerContext context) { + Sheet sheet = context.getWriteSheetHolder().getSheet(); + // 鍖哄煙/鍗曚綅鍚嶇О + CellRangeAddressList cellRangeAddressList3 = new CellRangeAddressList(1, 9999, 1, 1); + DataValidationHelper helper3 = context.getWriteSheetHolder().getSheet().getDataValidationHelper(); + DataValidationConstraint constraint3 = helper3.createExplicitListConstraint(new String[]{"瀵岄『鍘垮叕瀹夊眬", "澶у畨鍖哄叕瀹夊眬", "鑷祦浜曞尯鍏畨灞�", "璐′簳鍖哄叕瀹夊眬", "鑽e幙鍏畨灞�", "鑷础甯傚叕瀹夊眬", "楂樻柊鍖哄叕瀹夊眬", "娌挎哗鍖哄叕瀹夊眬"}); + DataValidation dataValidation3 = helper3.createValidation(constraint3, cellRangeAddressList3); + // 鎶ヨ绫诲瀷 + CellRangeAddressList cellRangeAddressList = new CellRangeAddressList(1, 9999, 2, 2); + DataValidationHelper helper = context.getWriteSheetHolder().getSheet().getDataValidationHelper(); + DataValidationConstraint constraint = helper.createExplicitListConstraint(new String[]{"SSH寮卞彛浠�", "Telnet寮卞彛浠�", "RDP寮卞彛浠�", "FTP寮卞彛浠�", "鏁版嵁搴撳急鍙d护"}); + DataValidation dataValidation = helper.createValidation(constraint, cellRangeAddressList); + // 鎶ヨ绾у埆 + CellRangeAddressList cellRangeAddressList2 = new CellRangeAddressList(1, 9999, 3, 3); + DataValidationHelper helper2 = context.getWriteSheetHolder().getSheet().getDataValidationHelper(); + DataValidationConstraint constraint2 = helper2.createExplicitListConstraint(new String[]{"浣庡嵄", "涓嵄", "楂樺嵄", "瓒呭嵄"}); + DataValidation dataValidation2 = helper2.createValidation(constraint2, cellRangeAddressList2); + sheet.addValidationData(dataValidation); + sheet.addValidationData(dataValidation2); + sheet.addValidationData(dataValidation3); + } + +} diff --git a/ycl-server/src/main/java/com/ycl/platform/controller/ImageResourceSecurityController.java b/ycl-server/src/main/java/com/ycl/platform/controller/ImageResourceSecurityController.java index 8edd3dd..295fc53 100644 --- a/ycl-server/src/main/java/com/ycl/platform/controller/ImageResourceSecurityController.java +++ b/ycl-server/src/main/java/com/ycl/platform/controller/ImageResourceSecurityController.java @@ -6,12 +6,12 @@ import com.ycl.system.AjaxResult; import com.ycl.system.controller.BaseController; import com.ycl.system.page.TableDataInfo; -import com.ycl.utils.poi.ExcelUtil; import enumeration.BusinessType; import jakarta.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import java.util.List; @@ -35,7 +35,6 @@ @GetMapping("/list") public TableDataInfo list(ImageResourceSecurity imageResourceSecurity) { - startPage(); List<ImageResourceSecurity> list = imageResourceSecurityService.selectImageResourceSecurityList(imageResourceSecurity); return getDataTable(list); } @@ -60,4 +59,25 @@ { return toAjax(imageResourceSecurityService.updateImageResourceSecurity(imageResourceSecurity)); } + + /** + * 瀵煎叆妯℃澘 + */ + @PreAuthorize("@ss.hasPermi('platform:security:list')") + @Log(title = "瀵煎叆妯℃澘", businessType = BusinessType.IMPORT) + @PostMapping("/importTemplate") + public void importTemplate(HttpServletResponse response) { + imageResourceSecurityService.importTemplate(response); + } + + /** + * 瀵煎叆鏁版嵁 + */ + @PreAuthorize("@ss.hasPermi('platform:security:list')") + @Log(title = "瀵煎叆", businessType = BusinessType.IMPORT) + @PostMapping("/importData") + public AjaxResult importData(MultipartFile file) { + return toAjax(imageResourceSecurityService.importData(file)); + } + } diff --git a/ycl-server/src/main/java/com/ycl/platform/controller/WorkOrderController.java b/ycl-server/src/main/java/com/ycl/platform/controller/WorkOrderController.java index 428d483..6c0fe66 100644 --- a/ycl-server/src/main/java/com/ycl/platform/controller/WorkOrderController.java +++ b/ycl-server/src/main/java/com/ycl/platform/controller/WorkOrderController.java @@ -69,16 +69,16 @@ return workOrderService.ywCondition(form); } - @GetMapping("/yw-condition/{id}") + @GetMapping("/yw-condition/{workOrderNo}") @ApiOperation(value = "杩愮淮鎯呭喌", notes = "杩愮淮鎯呭喌") - public Result ywCondition(@PathVariable Integer id) { - return workOrderService.selectYwConditionByYwId(id); + public Result ywCondition(@PathVariable String workOrderNo) { + return workOrderService.selectYwConditionByYwId(workOrderNo); } - @GetMapping("/yw-auditing-list/{id}") + @GetMapping("/yw-auditing-list/{workOrderNo}") @ApiOperation(value = "杩愮淮瀹℃牳璁板綍", notes = "杩愮淮瀹℃牳璁板綍") - public Result ywAuditingByYwId(@PathVariable @Validated(Update.class) String id) { - return workOrderService.selectYwAuditingListByYwId(id); + public Result ywAuditingByYwId(@PathVariable String workOrderNo) { + return workOrderService.selectYwAuditingListByYwId(workOrderNo); } @PutMapping("/yw-result") diff --git a/ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexVideoMapper.java b/ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexVideoMapper.java index ec27a1d..2743448 100644 --- a/ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexVideoMapper.java +++ b/ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexVideoMapper.java @@ -70,4 +70,10 @@ * @return 鏁版嵁 */ CheckIndexVideo dashboard(DashboardQuery dashboardQuery); + + /** + * 鏌ヨ瑙嗛鎸囨爣姒傜巼鏁版嵁甯︿笂閮ㄩ棬鍚嶇О + * @return 瑙嗛鎸囨爣姒傜巼鏁版嵁闆嗗悎 + */ + List<CheckIndexVideo> selectAndDeptName(); } diff --git a/ycl-server/src/main/java/com/ycl/platform/mapper/ImageResourceSecurityDetailMapper.java b/ycl-server/src/main/java/com/ycl/platform/mapper/ImageResourceSecurityDetailMapper.java index 45e1889..e35795b 100644 --- a/ycl-server/src/main/java/com/ycl/platform/mapper/ImageResourceSecurityDetailMapper.java +++ b/ycl-server/src/main/java/com/ycl/platform/mapper/ImageResourceSecurityDetailMapper.java @@ -1,7 +1,9 @@ package com.ycl.platform.mapper; import com.ycl.platform.domain.entity.ImageResourceSecurityDetail; +import org.apache.ibatis.annotations.Select; +import java.util.ArrayList; import java.util.List; /** @@ -59,4 +61,17 @@ * @return 缁撴灉 */ public int deleteImageResourceSecurityDetailByIds(Long[] ids); + + /** + * 鎵归噺鎻掑叆 + * @param list 鏁版嵁 + */ + void saveBatch(ArrayList<ImageResourceSecurityDetail> list); + + /** + * 瀹氭椂浠诲姟鑾峰彇璇︽儏璁$畻 + * @return 鏁版嵁 + */ + @Select("select dept_id, alarm_category, alarm_level, num from t_image_resource_security_detail") + List<ImageResourceSecurityDetail> getList(); } diff --git a/ycl-server/src/main/java/com/ycl/platform/mapper/ImageResourceSecurityMapper.java b/ycl-server/src/main/java/com/ycl/platform/mapper/ImageResourceSecurityMapper.java index 4958662..3b433f9 100644 --- a/ycl-server/src/main/java/com/ycl/platform/mapper/ImageResourceSecurityMapper.java +++ b/ycl-server/src/main/java/com/ycl/platform/mapper/ImageResourceSecurityMapper.java @@ -2,6 +2,7 @@ import com.ycl.platform.domain.entity.ImageResourceSecurity; +import java.util.ArrayList; import java.util.List; /** @@ -59,4 +60,10 @@ * @return 缁撴灉 */ public int deleteImageResourceSecurityByIds(Long[] ids); + + /** + * 鎵归噺淇濆瓨 + * @param imageResourceSecurities 鏁版嵁闆嗗悎 + */ + void saveBatch(ArrayList<ImageResourceSecurity> imageResourceSecurities); } diff --git a/ycl-server/src/main/java/com/ycl/platform/mapper/TMonitorMapper.java b/ycl-server/src/main/java/com/ycl/platform/mapper/TMonitorMapper.java index 6e66a2a..239924e 100644 --- a/ycl-server/src/main/java/com/ycl/platform/mapper/TMonitorMapper.java +++ b/ycl-server/src/main/java/com/ycl/platform/mapper/TMonitorMapper.java @@ -131,4 +131,11 @@ void deleteAll(); + /** + * 鎵归噺淇敼璁惧鍘傚晢绫诲瀷 + * + * @param list + * @return + */ + int batchUpdateDeviceType(@Param("list") List<TMonitor> list); } diff --git a/ycl-server/src/main/java/com/ycl/platform/mapper/WorkOrderYwConditionRecordMapper.java b/ycl-server/src/main/java/com/ycl/platform/mapper/WorkOrderYwConditionRecordMapper.java index fbad792..024a69a 100644 --- a/ycl-server/src/main/java/com/ycl/platform/mapper/WorkOrderYwConditionRecordMapper.java +++ b/ycl-server/src/main/java/com/ycl/platform/mapper/WorkOrderYwConditionRecordMapper.java @@ -20,10 +20,10 @@ /** * 鏍规嵁宸ュ崟ID鏌ヨ杩愮淮璁板綍 * - * @param workOrderId + * @param workOrderNo * @return */ - List<WorkOrderYwConditionRecordVO> selectYwConditionByYwId(@Param("workOrderId") Integer workOrderId); + List<WorkOrderYwConditionRecordVO> selectYwConditionByYwId(@Param("workOrderNo") String workOrderNo); /** * 鎵归噺鎻掑叆 diff --git a/ycl-server/src/main/java/com/ycl/platform/service/HKErrorTypeService.java b/ycl-server/src/main/java/com/ycl/platform/service/HKErrorTypeService.java new file mode 100644 index 0000000..5bf94ea --- /dev/null +++ b/ycl-server/src/main/java/com/ycl/platform/service/HKErrorTypeService.java @@ -0,0 +1,76 @@ +package com.ycl.platform.service; + +import com.ycl.platform.domain.result.HK.*; + +import java.util.List; + +/** + * 娴峰悍妫�娴� + * + * @author锛歺p + * @date锛�2024/8/24 17:45 + */ +public interface HKErrorTypeService { + + /** + * 鎶撴媿鏁版嵁閲忕洃娴嬬粨鏋� 杞﹁締/浜鸿劯 + * + */ + void snapshotDataMonitorTaskCheck(List<SnapshotDataMonitorResult> dataList); + + + /** + * 閲囬泦璁惧灞炴�х洃娴嬬粨鏋�(浜鸿劯) + * + */ + void monitorDetailTaskCheck(List<MonitoringDetailResult> dataList); + + + /** + * 鍗″彛灞炴�х洃娴嬬粨鏋� + * + */ + void crossDetailTaskCheck(List<CrossDetailResult> dataList); + + + /** + * 鏁版嵁瀹屾暣鎬х洃娴嬬粨鏋� + * + */ + void dataIntegrityMonitoringTaskCheck(List<DataIntegrityMonitoringResult> dataList); + + + /** + * 灞炴�ц瘑鍒噯纭洃娴嬬粨鏋� + * + */ + void attrRecognitionMonitorTaskCheck(List<AttrRecognitionMonitorResult> dataList); + + + /** + * 鎶撴媿鏁版嵁鏃跺欢鐩戞祴缁撴灉 + * + */ + void snapshopDelayMonitorTaskCheck(List<SnapshotDelayMonitorResult> dataList); + + + /** + * 鍥剧墖璁块棶鐩戞祴缁撴灉 + * + */ + void picAccessTaskCheck(List<PicAccessResult> dataList); + + + /** + * 杞﹁締璁惧鎶芥鎸囨爣鐩戞祴缁撴灉 + * + */ + void vehicleDeviceSamplingTaskCheck(List<VehicleDeviceSamplingResult> dataList); + + + /** + * 浜鸿劯璁惧鎶芥鎸囨爣鐩戞祴缁撴灉 + * + */ + void faceDeviceSamplingTaskCheck(List<FaceDeviceSamplingResult> dataList); +} diff --git a/ycl-server/src/main/java/com/ycl/platform/service/IImageResourceSecurityService.java b/ycl-server/src/main/java/com/ycl/platform/service/IImageResourceSecurityService.java index 090586b..4303294 100644 --- a/ycl-server/src/main/java/com/ycl/platform/service/IImageResourceSecurityService.java +++ b/ycl-server/src/main/java/com/ycl/platform/service/IImageResourceSecurityService.java @@ -1,7 +1,10 @@ package com.ycl.platform.service; import com.ycl.platform.domain.entity.ImageResourceSecurity; +import jakarta.servlet.http.HttpServletResponse; +import org.springframework.web.multipart.MultipartFile; +import java.util.ArrayList; import java.util.List; /** @@ -59,4 +62,23 @@ * @return 缁撴灉 */ public int deleteImageResourceSecurityById(Long id); + + /** + * 瀵煎叆妯℃澘 + * @param response 鏂囦欢 + */ + void importTemplate(HttpServletResponse response); + + /** + * 瀵煎叆鏁版嵁 + * @param file 鏁版嵁 + * @return 缁撴灉 + */ + Boolean importData(MultipartFile file); + + /** + * 鎵归噺淇濆瓨 + * @param imageResourceSecurities 鏁版嵁闆嗗悎 + */ + void saveBatch(ArrayList<ImageResourceSecurity> imageResourceSecurities); } diff --git a/ycl-server/src/main/java/com/ycl/platform/service/WorkOrderService.java b/ycl-server/src/main/java/com/ycl/platform/service/WorkOrderService.java index fcaee48..edd2a15 100644 --- a/ycl-server/src/main/java/com/ycl/platform/service/WorkOrderService.java +++ b/ycl-server/src/main/java/com/ycl/platform/service/WorkOrderService.java @@ -129,17 +129,17 @@ /** * 鑾峰彇宸ュ崟杩愮淮鎯呭喌 - * @param id 宸ュ崟id + * @param workOrderNo 宸ュ崟鍙� * @return 宸ュ崟杩愮淮鎯呭喌 */ - Result selectYwConditionByYwId(Integer id); + Result selectYwConditionByYwId(String workOrderNo); /** * 鑾峰彇宸ュ崟杩愮淮瀹℃牳璁板綍 - * @param id 宸ュ崟id + * @param workOrderNo 宸ュ崟鍙� * @return 宸ュ崟杩愮淮瀹℃牳璁板綍 */ - Result selectYwAuditingListByYwId(String id); + Result selectYwAuditingListByYwId(String workOrderNo); /** * 鎵归噺涓嬪彂 diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/HKErrorTypeServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/HKErrorTypeServiceImpl.java new file mode 100644 index 0000000..c36bdeb --- /dev/null +++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/HKErrorTypeServiceImpl.java @@ -0,0 +1,74 @@ +package com.ycl.platform.service.impl; + +import com.ycl.platform.domain.entity.WorkOrder; +import com.ycl.platform.domain.result.HK.*; +import com.ycl.platform.service.HKErrorTypeService; +import com.ycl.platform.service.WorkOrderService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author锛歺p + * @date锛�2024/8/24 17:58 + */ +@Service +@RequiredArgsConstructor +public class HKErrorTypeServiceImpl implements HKErrorTypeService { + + private final WorkOrderService workOrderService; + + /** + * 鎶撴媿鏁版嵁閲忕洃娴嬬粨鏋� 杞﹁締/浜鸿劯 + * + * @param dataList + */ + @Override + public void snapshotDataMonitorTaskCheck(List<SnapshotDataMonitorResult> dataList) { + + } + + @Override + public void monitorDetailTaskCheck(List<MonitoringDetailResult> dataList) { + + } + + @Override + public void crossDetailTaskCheck(List<CrossDetailResult> dataList) { +// dataList.stream().map(item -> { +// WorkOrder workOrder = new WorkOrder(); +// if (item.get) +// }) + } + + @Override + public void dataIntegrityMonitoringTaskCheck(List<DataIntegrityMonitoringResult> dataList) { + + } + + @Override + public void attrRecognitionMonitorTaskCheck(List<AttrRecognitionMonitorResult> dataList) { + + } + + @Override + public void snapshopDelayMonitorTaskCheck(List<SnapshotDelayMonitorResult> dataList) { + + } + + @Override + public void picAccessTaskCheck(List<PicAccessResult> dataList) { + + } + + @Override + public void vehicleDeviceSamplingTaskCheck(List<VehicleDeviceSamplingResult> dataList) { + + } + + @Override + public void faceDeviceSamplingTaskCheck(List<FaceDeviceSamplingResult> dataList) { + + } +} diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/ImageResourceSecurityServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/ImageResourceSecurityServiceImpl.java index d2fc697..68853c4 100644 --- a/ycl-server/src/main/java/com/ycl/platform/service/impl/ImageResourceSecurityServiceImpl.java +++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/ImageResourceSecurityServiceImpl.java @@ -1,12 +1,24 @@ package com.ycl.platform.service.impl; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.read.listener.PageReadListener; +import com.ycl.handler.ImageResourceHandler; import com.ycl.platform.domain.entity.ImageResourceSecurity; +import com.ycl.platform.domain.entity.ImageResourceSecurityDetail; +import com.ycl.platform.mapper.ImageResourceSecurityDetailMapper; import com.ycl.platform.mapper.ImageResourceSecurityMapper; import com.ycl.platform.service.IImageResourceSecurityService; +import com.ycl.system.entity.SysDept; +import com.ycl.system.service.ISysDeptService; import com.ycl.utils.DateUtils; -import org.springframework.beans.factory.annotation.Autowired; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import lombok.SneakyThrows; import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; +import java.util.ArrayList; +import java.util.Collections; import java.util.List; /** @@ -16,81 +28,68 @@ * @date 2024-08-24 */ @Service -public class ImageResourceSecurityServiceImpl implements IImageResourceSecurityService -{ - @Autowired - private ImageResourceSecurityMapper imageResourceSecurityMapper; +@RequiredArgsConstructor +public class ImageResourceSecurityServiceImpl implements IImageResourceSecurityService { - /** - * 鏌ヨplatform - * - * @param id platform涓婚敭 - * @return platform - */ + private final ImageResourceSecurityMapper imageResourceSecurityMapper; + private final ImageResourceSecurityDetailMapper imageResourceSecurityDetailMapper; + private final ISysDeptService deptService; + @Override - public ImageResourceSecurity selectImageResourceSecurityById(Long id) - { + public ImageResourceSecurity selectImageResourceSecurityById(Long id) { return imageResourceSecurityMapper.selectImageResourceSecurityById(id); } - /** - * 鏌ヨplatform鍒楄〃 - * - * @param imageResourceSecurity platform - * @return platform - */ @Override - public List<ImageResourceSecurity> selectImageResourceSecurityList(ImageResourceSecurity imageResourceSecurity) - { + public List<ImageResourceSecurity> selectImageResourceSecurityList(ImageResourceSecurity imageResourceSecurity) { return imageResourceSecurityMapper.selectImageResourceSecurityList(imageResourceSecurity); } - /** - * 鏂板platform - * - * @param imageResourceSecurity platform - * @return 缁撴灉 - */ @Override - public int insertImageResourceSecurity(ImageResourceSecurity imageResourceSecurity) - { + public int insertImageResourceSecurity(ImageResourceSecurity imageResourceSecurity) { imageResourceSecurity.setCreateTime(DateUtils.getNowDate()); return imageResourceSecurityMapper.insertImageResourceSecurity(imageResourceSecurity); } - /** - * 淇敼platform - * - * @param imageResourceSecurity platform - * @return 缁撴灉 - */ @Override - public int updateImageResourceSecurity(ImageResourceSecurity imageResourceSecurity) - { + public int updateImageResourceSecurity(ImageResourceSecurity imageResourceSecurity) { return imageResourceSecurityMapper.updateImageResourceSecurity(imageResourceSecurity); } - /** - * 鎵归噺鍒犻櫎platform - * - * @param ids 闇�瑕佸垹闄ょ殑platform涓婚敭 - * @return 缁撴灉 - */ @Override - public int deleteImageResourceSecurityByIds(Long[] ids) - { + public int deleteImageResourceSecurityByIds(Long[] ids) { return imageResourceSecurityMapper.deleteImageResourceSecurityByIds(ids); } - /** - * 鍒犻櫎platform淇℃伅 - * - * @param id platform涓婚敭 - * @return 缁撴灉 - */ @Override - public int deleteImageResourceSecurityById(Long id) - { + public int deleteImageResourceSecurityById(Long id) { return imageResourceSecurityMapper.deleteImageResourceSecurityById(id); } + + @Override + @SneakyThrows + public void importTemplate(HttpServletResponse response) { + EasyExcel.write(response.getOutputStream(), ImageResourceSecurityDetail.class).sheet("妯℃澘").registerWriteHandler(new ImageResourceHandler()).doWrite(Collections.emptyList()); + } + + @Override + @SneakyThrows + public Boolean importData(MultipartFile file) { + ArrayList<ImageResourceSecurityDetail> list = new ArrayList<>(); + List<SysDept> sysDept = deptService.selectDeptList(new SysDept()); + EasyExcel.read(file.getInputStream(), ImageResourceSecurityDetail.class, new PageReadListener<ImageResourceSecurityDetail>(dataList -> { + for (ImageResourceSecurityDetail detail : dataList) { + SysDept sysDept1 = sysDept.stream().filter(dept -> dept.getDeptName().equals(detail.getDeptName())).findFirst().orElseThrow(() -> new RuntimeException(detail.getDeptName() + "涓嶅瓨鍦�")); + detail.setDeptId(sysDept1.getDeptId()); + list.add(detail); + } + })).sheet().doRead(); + imageResourceSecurityDetailMapper.saveBatch(list); + return true; + } + + @Override + public void saveBatch(ArrayList<ImageResourceSecurity> imageResourceSecurities) { + imageResourceSecurityMapper.saveBatch(imageResourceSecurities); + } } diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/WorkOrderServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/WorkOrderServiceImpl.java index b26d549..9d519a6 100644 --- a/ycl-server/src/main/java/com/ycl/platform/service/impl/WorkOrderServiceImpl.java +++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/WorkOrderServiceImpl.java @@ -157,6 +157,7 @@ ywRecord.setCommitUser(1); ywRecord.setYwCondition("鏁呴殰绫诲瀷鏇存柊锛屽伐鍗曠姸鎬佽皟鏁翠负寰呭鐞�"); ywRecord.setCreateTime(new Date()); + ywRecord.setSysMsg(Boolean.TRUE); willAddMsg.add(ywRecord); } } else { @@ -300,7 +301,7 @@ baseMapper.updateById(workOrder); // 娣诲姞涓�鏉″鏍歌褰� WorkOrderAuditingRecord workOrderAuditingRecord = new WorkOrderAuditingRecord(); - workOrderAuditingRecord.setWorkOrderId(workOrder.getId()); + workOrderAuditingRecord.setWorkOrderNo(workOrder.getWorkOrderNo()); workOrderAuditingRecord.setAuditingUser(SecurityUtils.getLoginUser().getUserId().intValue()); workOrderAuditingRecord.setResult(form.getAuditingResult().getDesc()); workOrderAuditingRecord.setRemark(form.getAuditingRemark()); @@ -331,18 +332,18 @@ if (list.isEmpty()) { return Result.error("娌℃湁宸ュ崟鍙互瀹℃牳"); } - List<Integer> ids = list.stream().map(WorkOrder::getId).collect(Collectors.toList()); + List<String> workOrderNoList = list.stream().map(WorkOrder::getWorkOrderNo).collect(Collectors.toList()); List<String> serialNumbers = list.stream().map(WorkOrder::getSerialNumber).toList(); // 宸ュ崟鐘舵�� LambdaUpdateWrapper<WorkOrder> lambdaUpdateWrapper = new LambdaUpdateWrapper<>(); - lambdaUpdateWrapper.in(WorkOrder::getId, ids); + lambdaUpdateWrapper.in(WorkOrder::getWorkOrderNo, workOrderNoList); lambdaUpdateWrapper.set(WorkOrder::getStatus, form.getAuditingResult()); baseMapper.update(lambdaUpdateWrapper); // 娣诲姞澶氭潯瀹℃牳璁板綍 List<WorkOrderAuditingRecord> workOrderAuditingRecords = new ArrayList<>(); - for (Integer id : ids) { + for (String workOrderNo : workOrderNoList) { WorkOrderAuditingRecord workOrderAuditingRecord = new WorkOrderAuditingRecord(); - workOrderAuditingRecord.setWorkOrderId(id); + workOrderAuditingRecord.setWorkOrderNo(workOrderNo); workOrderAuditingRecord.setAuditingUser(SecurityUtils.getLoginUser().getUserId().intValue()); workOrderAuditingRecord.setResult(form.getAuditingResult().getDesc()); workOrderAuditingRecord.setRemark(form.getAuditingRemark()); @@ -390,8 +391,8 @@ } @Override - public Result selectYwConditionByYwId(Integer id) { - List<WorkOrderYwConditionRecordVO> ywConditionList = workOrderYwConditionRecordMapper.selectYwConditionByYwId(id); + public Result selectYwConditionByYwId(String workOrderNo) { + List<WorkOrderYwConditionRecordVO> ywConditionList = workOrderYwConditionRecordMapper.selectYwConditionByYwId(workOrderNo); ywConditionList.stream().forEach(item -> { if (Objects.nonNull(item.getSysMsg()) && item.getSysMsg()) { item.setCommitUserName("绯荤粺娑堟伅"); @@ -401,10 +402,10 @@ } @Override - public Result selectYwAuditingListByYwId(String id) { + public Result selectYwAuditingListByYwId(String workOrderNo) { return Result.ok().data( new LambdaQueryChainWrapper<>(workOrderAuditingRecordMapper) - .eq(WorkOrderAuditingRecord::getWorkOrderId, id) + .eq(WorkOrderAuditingRecord::getWorkOrderNo, workOrderNo) .orderByAsc(WorkOrderAuditingRecord::getCreateTime) .list()); } @@ -663,9 +664,12 @@ public String getFrameImgByDevice(String deviceId, String channelId) { String url = String.format(this.rtspServer + "/start/%s/%s", deviceId, channelId); String result = HttpUtils.sendGet(url); + log.error("鎷垮埌鍙栨祦鍝嶅簲缁撴灉锛�" + result); WVPResult wvpResult = JSON.parseObject(result, WVPResult.class); if (0 == wvpResult.getCode()) { + log.error("璇锋眰鎴愬姛"); StreamContent data = (StreamContent) wvpResult.getData(); + log.error("鎷垮埌鍙栨祦鍝嶅簲缁撴灉锛�" + data); String rtspUrl = data.getRtsp(); if (StringUtils.hasText(rtspUrl)) { try { diff --git a/ycl-server/src/main/java/com/ycl/task/HKTask.java b/ycl-server/src/main/java/com/ycl/task/HKTask.java index 00b346a..6072c95 100644 --- a/ycl-server/src/main/java/com/ycl/task/HKTask.java +++ b/ycl-server/src/main/java/com/ycl/task/HKTask.java @@ -87,7 +87,7 @@ } - //鎶撴媿鏁版嵁閲忕洃娴嬬粨鏋� + // 鎶撴媿鏁版嵁閲忕洃娴嬬粨鏋� public void snapshotDataMonitorTask() { log.info("寮�濮嬫墽琛屾姄鎷嶆暟鎹噺妫�娴嬬粨鏋滄暟鎹悓姝�"); /** 杞﹁締鏁版嵁 */ @@ -285,6 +285,7 @@ //TODO:宸ュ崟澶勭悊 log.info("缁撴潫鍥剧墖璁块棶鐩戞祴缁撴灉鏁版嵁鍚屾"); } + //杞﹁締璁惧鎶芥鎸囨爣鐩戞祴缁撴灉 public void vehicleDeviceSamplingTask() { log.info("寮�濮嬫墽琛岃溅杈嗚澶囨娊妫�鎸囨爣鐩戞祴缁撴灉鏁版嵁鍚屾"); diff --git a/ycl-server/src/main/java/com/ycl/task/ImageResourceSecurityTask.java b/ycl-server/src/main/java/com/ycl/task/ImageResourceSecurityTask.java new file mode 100644 index 0000000..01111d5 --- /dev/null +++ b/ycl-server/src/main/java/com/ycl/task/ImageResourceSecurityTask.java @@ -0,0 +1,72 @@ +package com.ycl.task; + +import com.ycl.platform.domain.entity.CheckIndexVideo; +import com.ycl.platform.domain.entity.ImageResourceSecurity; +import com.ycl.platform.domain.entity.ImageResourceSecurityDetail; +import com.ycl.platform.mapper.CheckIndexVideoMapper; +import com.ycl.platform.mapper.ImageResourceSecurityDetailMapper; +import com.ycl.platform.service.IImageResourceSecurityService; +import com.ycl.utils.DateUtils; +import com.ycl.utils.DictUtils; +import lombok.RequiredArgsConstructor; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * @author gonghl + * @since 2024/8/26 涓嬪崍 4:43 + */ +@Component("ImageResourceSecurityTask") +@RequiredArgsConstructor +public class ImageResourceSecurityTask { + + private final IImageResourceSecurityService imageResourceSecurityService; + private final CheckIndexVideoMapper checkIndexVideoMapper; + private final ImageResourceSecurityDetailMapper imageResourceSecurityDetailMapper; + + /** + * 姣忓ぉ鏅氫笂1鐐规墽琛� + */ + @Scheduled(cron = "0 0 1 * * ?") + public void calc() { + ArrayList<ImageResourceSecurity> imageResourceSecurities = new ArrayList<>(); + List<CheckIndexVideo> list = checkIndexVideoMapper.selectAndDeptName(); + List<ImageResourceSecurityDetail> detail = imageResourceSecurityDetailMapper.getList(); + + // 姣忎釜閮ㄩ棬寰幆涓�娆¤绠楁暟鎹� + for (CheckIndexVideo checkIndexVideo : list) { + ImageResourceSecurity imageResourceSecurity = new ImageResourceSecurity(); + imageResourceSecurity.setDeptId(checkIndexVideo.getDeptId()); + // 鐩存帴鍙栨寚鏍� + imageResourceSecurity.setPlatformOnline(checkIndexVideo.getPlatformOnline()); + imageResourceSecurity.setPropertyAccuracy(checkIndexVideo.getMonitorQualification()); + // 鑾峰彇褰撳墠閮ㄩ棬鐨刣etail杩涜璁$畻 + List<ImageResourceSecurityDetail> detailList = detail.stream().filter(imageResourceSecurityDetail -> Objects.equals(imageResourceSecurityDetail.getDeptId(), checkIndexVideo.getDeptId())).toList(); + int score = 100; + int count = 0; + // 寰幆detail璁$畻 + for (ImageResourceSecurityDetail imageResourceSecurityDetail : detailList) { + // 鎵i櫎鍒嗘暟 + score -= imageResourceSecurityDetail.getAlarmCategory().getScore(); + imageResourceSecurity.setWeakPassword(BigDecimal.valueOf(score)); + // 缁熻鏁伴噺 + if (Integer.parseInt(imageResourceSecurityDetail.getAlarmLevel().getValue()) > 1) { + count++; + } + } + // 鑾峰彇瀛楀吀鍊�-鎬绘暟 + int onlineAssetsTotal = Integer.parseInt(DictUtils.getDictValue("online_assets_total", checkIndexVideo.getDeptName())); + imageResourceSecurity.setRiskProperty(BigDecimal.valueOf(count / onlineAssetsTotal)); + imageResourceSecurity.setCreateTime(DateUtils.getNowDate()); + imageResourceSecurities.add(imageResourceSecurity); + } + imageResourceSecurityService.saveBatch(imageResourceSecurities); + + } + +} diff --git a/ycl-server/src/main/java/com/ycl/task/WorkOrderImgTask.java b/ycl-server/src/main/java/com/ycl/task/WorkOrderImgTask.java index 8603ba8..4749539 100644 --- a/ycl-server/src/main/java/com/ycl/task/WorkOrderImgTask.java +++ b/ycl-server/src/main/java/com/ycl/task/WorkOrderImgTask.java @@ -3,6 +3,7 @@ import com.ycl.platform.domain.vo.DeviceInfoVO; import com.ycl.platform.service.WorkOrderService; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; import org.springframework.util.StringUtils; @@ -18,6 +19,7 @@ * @author锛歺p * @date锛�2024/8/21 11:56 */ +@Slf4j @RequiredArgsConstructor @Component("workOrderImgTask") public class WorkOrderImgTask { diff --git a/ycl-server/src/main/resources/application-dev.yml b/ycl-server/src/main/resources/application-dev.yml index 7f977fe..b0129c1 100644 --- a/ycl-server/src/main/resources/application-dev.yml +++ b/ycl-server/src/main/resources/application-dev.yml @@ -36,7 +36,7 @@ spring: # 鏁版嵁婧愰厤缃� datasource: - url: jdbc:mysql://101.35.247.188/zgyw?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&rewriteBatchedStatements=true&allowMultiQueries=true + url: jdbc:mysql://101.35.247.188/zgyw?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&rewriteBatchedStatements=true&allowMultiQueries=true&allowPublicKeyRetrieval=true username: root password: ycl@202466 type: com.alibaba.druid.pool.DruidDataSource @@ -76,10 +76,12 @@ spring.data: redis: # 鍦板潃 - host: 42.193.1.25 + #host: 42.193.1.25 + host: 127.0.0.1 # 绔彛锛岄粯璁や负6379 port: 6379 - password: ycl2018 + #password: ycl2018 + password: # 鏁版嵁搴撶储寮� database: 0 # 瀵嗙爜(濡傛病鏈夊瘑鐮佽娉ㄩ噴鎺�) @@ -130,7 +132,6 @@ retry: 4 # 鏈�澶ч噸璇曟鏁� youYunDomain: http://51.92.65.56 # 浼樹簯鍦板潃 haiKangDomain: 51.92.65.48 # 娴峰悍鍦板潃 - pythonDomain: 11 # python鑴氭湰鍦板潃 youYun: tenantId: e10adc3949ba59abbe56e057f20f88dd diff --git a/ycl-server/src/main/resources/application-prod.yml b/ycl-server/src/main/resources/application-prod.yml index 690ddd5..5df6354 100644 --- a/ycl-server/src/main/resources/application-prod.yml +++ b/ycl-server/src/main/resources/application-prod.yml @@ -130,7 +130,6 @@ retry: 4 # 鏈�澶ч噸璇曟鏁� youYunDomain: http://51.92.65.56 # 浼樹簯鍦板潃 haiKangDomain: 51.92.65.48 # 娴峰悍鍦板潃 - pythonDomain: 11 # python鑴氭湰鍦板潃 youYun: tenantId: e10adc3949ba59abbe56e057f20f88dd diff --git a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml index ce044f0..1c42656 100644 --- a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml +++ b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml @@ -181,4 +181,28 @@ LIMIT 1 </if> </select> + + <select id="selectAndDeptName" resultType="com.ycl.platform.domain.entity.CheckIndexVideo"> + WITH temp AS ( + SELECT + r.dept_id, + r.platform_online, + r.monitor_qualification, + d.area, + ROW_NUMBER() OVER(PARTITION BY r.dept_id ORDER BY r.create_time DESC) AS rn + FROM + t_check_index_video r + JOIN + sys_dept d ON r.dept_id = d.dept_id + ) + SELECT + dept_id, + area as deptName, + platform_online, + monitor_qualification + FROM + temp + WHERE + rn = 1; + </select> </mapper> diff --git a/ycl-server/src/main/resources/mapper/zgyw/ImageResourceSecurityDetailMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/ImageResourceSecurityDetailMapper.xml index 7cf6eed..56f3aef 100644 --- a/ycl-server/src/main/resources/mapper/zgyw/ImageResourceSecurityDetailMapper.xml +++ b/ycl-server/src/main/resources/mapper/zgyw/ImageResourceSecurityDetailMapper.xml @@ -16,7 +16,7 @@ </resultMap> <sql id="selectImageResourceSecurityDetailVo"> - select id, + SELECT id, ip, dept_id, alarm_category, @@ -24,14 +24,24 @@ num, alarm_time, create_time - from t_image_resource_security_detail + FROM t_image_resource_security_detail </sql> - <select id="selectImageResourceSecurityDetailList" resultMap="ImageResourceSecurityDetailResult"> - <include refid="selectImageResourceSecurityDetailVo"/> + <select id="selectImageResourceSecurityDetailList" resultType="com.ycl.platform.domain.entity.ImageResourceSecurityDetail"> + select id, + ip, + a.dept_id, + dept_name, + alarm_category, + alarm_level, + num, + alarm_time, + a.create_time + from t_image_resource_security_detail a + LEFT JOIN sys_dept b ON a.dept_id = b.dept_id AND b.del_flag = 0 <where> <if test="ip != null and ip != ''">and ip = #{ip}</if> - <if test="deptId != null ">and dept_id = #{deptId}</if> + <if test="deptId != null ">and a.dept_id = #{deptId}</if> <if test="alarmCategory != null and alarmCategory != ''">and alarm_category = #{alarmCategory}</if> <if test="alarmLevel != null ">and alarm_level = #{alarmLevel}</if> <if test="num != null ">and num = #{num}</if> @@ -40,7 +50,7 @@ </select> <select id="selectImageResourceSecurityDetailById"> - resultMap="ImageResourceSecurityDetailResult"> + resultMap="ImageResourceSecurityDetailResult"> <include refid="selectImageResourceSecurityDetailVo"/> where id = #{id} </select> @@ -67,6 +77,13 @@ </trim> </insert> + <insert id="saveBatch"> + INSERT INTO t_image_resource_security_detail (ip, dept_id, alarm_category, alarm_level, num, alarm_time, create_time) VALUES + <foreach collection="list" item="item" index="index" separator=","> + (#{item.ip}, #{item.deptId}, #{item.alarmCategory}, #{item.alarmLevel}, #{item.num}, #{item.alarmTime}, NOW()) + </foreach> + </insert> + <update id="updateImageResourceSecurityDetail"> update t_image_resource_security_detail <trim prefix="SET" suffixOverrides=","> @@ -82,9 +99,9 @@ </update> <delete id="deleteImageResourceSecurityDetailById"> - delete - from t_image_resource_security_detail - where id = #{id} + DELETE + FROM t_image_resource_security_detail + WHERE id = #{id} </delete> <delete id="deleteImageResourceSecurityDetailByIds"> diff --git a/ycl-server/src/main/resources/mapper/zgyw/ImageResourceSecurityMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/ImageResourceSecurityMapper.xml index 74b5a0e..97b345f 100644 --- a/ycl-server/src/main/resources/mapper/zgyw/ImageResourceSecurityMapper.xml +++ b/ycl-server/src/main/resources/mapper/zgyw/ImageResourceSecurityMapper.xml @@ -1,34 +1,44 @@ <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper -PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.ycl.platform.mapper.ImageResourceSecurityMapper"> <resultMap type="com.ycl.platform.domain.entity.ImageResourceSecurity" id="ImageResourceSecurityResult"> - <result property="id" column="id" /> - <result property="deptId" column="dept_id" /> - <result property="platformOnline" column="platform_online" /> - <result property="propertyAccuracy" column="property_accuracy" /> - <result property="weakPassword" column="weak_password" /> - <result property="riskProperty" column="risk_property" /> - <result property="boundaryIntegrity" column="boundary_integrity" /> - <result property="createTime" column="create_time" /> + <result property="id" column="id"/> + <result property="deptId" column="dept_id"/> + <result property="platformOnline" column="platform_online"/> + <result property="propertyAccuracy" column="property_accuracy"/> + <result property="weakPassword" column="weak_password"/> + <result property="riskProperty" column="risk_property"/> + <result property="boundaryIntegrity" column="boundary_integrity"/> + <result property="createTime" column="create_time"/> </resultMap> <sql id="selectImageResourceSecurityVo"> - select id, dept_id, platform_online, property_accuracy, weak_password, risk_property, boundary_integrity, create_time from t_image_resource_security + SELECT id, + dept_id, + platform_online, + property_accuracy, + weak_password, + risk_property, + boundary_integrity, + create_time + FROM t_image_resource_security </sql> - <select id="selectImageResourceSecurityList" resultMap="ImageResourceSecurityResult"> - <include refid="selectImageResourceSecurityVo"/> + <select id="selectImageResourceSecurityList" resultType="com.ycl.platform.domain.entity.ImageResourceSecurity"> + select id, a.dept_id, area AS deptName, platform_online, property_accuracy, weak_password, risk_property, boundary_integrity from t_image_resource_security a + LEFT JOIN sys_dept b ON a.dept_id = b.dept_id AND b.del_flag = 0 <where> - <if test="deptId != null "> and dept_id = #{deptId}</if> - <if test="platformOnline != null "> and platform_online = #{platformOnline}</if> - <if test="propertyAccuracy != null "> and property_accuracy = #{propertyAccuracy}</if> - <if test="weakPassword != null "> and weak_password = #{weakPassword}</if> - <if test="riskProperty != null "> and risk_property = #{riskProperty}</if> - <if test="boundaryIntegrity != null "> and boundary_integrity = #{boundaryIntegrity}</if> + <if test="platformOnline != null ">and platform_online = #{platformOnline}</if> + <if test="propertyAccuracy != null ">and property_accuracy = #{propertyAccuracy}</if> + <if test="weakPassword != null ">and weak_password = #{weakPassword}</if> + <if test="riskProperty != null ">and risk_property = #{riskProperty}</if> + <if test="boundaryIntegrity != null ">and boundary_integrity = #{boundaryIntegrity}</if> </where> + ORDER BY a.create_time DESC + limit 7 </select> <select id="selectImageResourceSecurityById" resultMap="ImageResourceSecurityResult"> @@ -46,7 +56,7 @@ <if test="riskProperty != null">risk_property,</if> <if test="boundaryIntegrity != null">boundary_integrity,</if> <if test="createTime != null">create_time,</if> - </trim> + </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="deptId != null">#{deptId},</if> <if test="platformOnline != null">#{platformOnline},</if> @@ -55,7 +65,14 @@ <if test="riskProperty != null">#{riskProperty},</if> <if test="boundaryIntegrity != null">#{boundaryIntegrity},</if> <if test="createTime != null">#{createTime},</if> - </trim> + </trim> + </insert> + + <insert id="saveBatch"> + insert into t_image_resource_security (dept_id, platform_online, property_accuracy, weak_password, risk_property, boundary_integrity, create_time) VALUES + <foreach collection="list" item="item" separator=","> + (#{item.deptId}, #{item.platformOnline}, #{item.propertyAccuracy}, #{item.weakPassword}, #{item.riskProperty}, #{item.boundaryIntegrity}, #{item.createTime}) + </foreach> </insert> <update id="updateImageResourceSecurity"> @@ -73,7 +90,9 @@ </update> <delete id="deleteImageResourceSecurityById"> - delete from t_image_resource_security where id = #{id} + DELETE + FROM t_image_resource_security + WHERE id = #{id} </delete> <delete id="deleteImageResourceSecurityByIds"> diff --git a/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml index 14b8c34..b97bffc 100644 --- a/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml +++ b/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml @@ -36,6 +36,7 @@ <result property="cameraDept" column="camera_dept"/> <result property="hybm" column="hybm"/> <result property="lxbm" column="lxbm"/> + <result property="deviceType" column="device_type"/> </resultMap> <sql id="selectTMonitorVo"> @@ -69,7 +70,8 @@ encoded_format, camera_dept, hybm, - lxbm + lxbm, + device_type from t_monitor </sql> @@ -184,6 +186,7 @@ <if test="cameraDept != null">camera_dept,</if> <if test="hybm != null">hybm,</if> <if test="lxbm != null">lxbm,</if> + <if test="deviceType != null">device_type,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="serialNumber != null and serialNumber != ''">#{serialNumber},</if> @@ -216,8 +219,19 @@ <if test="cameraDept != null">#{cameraDept},</if> <if test="hybm != null">#{hybm},</if> <if test="lxbm != null">#{lxbm},</if> + <if test="deviceType != null">#{deviceType},</if> </trim> </insert> + + <update id="batchUpdateDeviceType"> + <foreach collection="list" separator=";" item="item"> + UPDATE t_monitor + SET + update_time = #{item.updateTime}, + device_type = #{item.deviceType} + WHERE id = #{item.id} + </foreach> + </update> <update id="updateTMonitor" parameterType="com.ycl.platform.domain.entity.TMonitor"> update t_monitor @@ -254,6 +268,7 @@ <if test="cameraDept != null">camera_dept = #{cameraDept},</if> <if test="hybm != null">hybm = #{hybm},</if> <if test="lxbm != null">lxbm = #{lxbm},</if> + <if test="deviceType != null">device_type = #{deviceType},</if> </trim> where id = #{id} </update> diff --git a/ycl-server/src/main/resources/mapper/zgyw/WorkOrderMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/WorkOrderMapper.xml index 87b67e7..18827a0 100644 --- a/ycl-server/src/main/resources/mapper/zgyw/WorkOrderMapper.xml +++ b/ycl-server/src/main/resources/mapper/zgyw/WorkOrderMapper.xml @@ -39,11 +39,11 @@ FROM t_work_order wo INNER JOIN t_monitor tm ON wo.serial_number = tm.serial_number - LEFT JOIN t_yw_unit u ON wo.unit_id = u.id AND u.deleted = 0 - LEFT JOIN t_yw_people p ON wo.yw_people_id = p.id AND p.deleted = 0 INNER JOIN t_work_order_error_type et ON wo.work_order_no = et.work_order_no INNER JOIN sys_dict_data da ON da.dict_value = et.error_name AND da.dict_type = 'error_type' <if test="query.errorTypeList != null and query.errorTypeList.size() > 0">AND da.dict_value in <foreach collection="query.errorTypeList" open="(" separator="," close=")" item="errorType">#{errorType}</foreach> </if> + LEFT JOIN t_yw_unit u ON wo.unit_id = u.id AND u.deleted = 0 + LEFT JOIN t_yw_people p ON wo.yw_people_id = p.id AND p.deleted = 0 WHERE wo.deleted = 0 <if test="query.workOrderNo != null and query.workOrderNo != ''"> @@ -65,19 +65,25 @@ <select id="distributePage" resultType="com.ycl.platform.domain.vo.WorkOrderVO"> SELECT - wo.*, - u.unit_name, + wo.id,wo.status, wo.work_order_no,wo.create_time, wo.unit_id, wo.yw_people_id, wo.yw_handle_time, wo.yw_result, wo.yw_check_result, wo.overtime, wo.deduct, + u.unit_name, p.yw_person_name, yp.province_tag, yp.important_tag, yp.important_command_image_tag, odr.create_time as distributeTime, - su.nick_name as realName + su.nick_name as realName, + tm.name as source, + GROUP_CONCAT(DISTINCT da.dict_label ORDER BY da.dict_label SEPARATOR '銆�') AS errorType FROM t_work_order wo + INNER JOIN t_monitor tm ON wo.serial_number = tm.serial_number + INNER JOIN t_yw_point yp ON yp.serial_number = wo.serial_number AND yp.deleted = 0 + INNER JOIN t_work_order_error_type et ON wo.work_order_no = et.work_order_no + INNER JOIN sys_dict_data da ON da.dict_value = et.error_name AND da.dict_type = 'error_type' <if test="query.errorTypeList != null and query.errorTypeList.size() > 0">AND da.dict_value in <foreach + collection="query.errorTypeList" open="(" separator="," close=")" item="errorType">#{errorType}</foreach> </if> LEFT JOIN t_yw_unit u ON wo.unit_id = u.id and u.deleted = 0 LEFT JOIN t_yw_people p ON wo.yw_people_id = p.id and p.deleted = 0 - INNER JOIN t_yw_point yp ON yp.serial_number = wo.serial_number AND yp.deleted = 0 LEFT JOIN t_work_order_distribute_record odr ON odr.work_order_no = wo.work_order_no AND odr.deleted = 0 LEFT JOIN sys_user su ON su.user_id = odr.user_id WHERE @@ -88,6 +94,18 @@ <if test="query.status != null and query.status != ''"> AND wo.status = #{query.status} </if> + <if test="query.keyword != null and query.keyword != ''"> + AND (tm.name like concat('%', #{query.keyword}, '%') or tm.serial_number like concat('%', #{query.keyword}, '%')) + </if> + GROUP BY + wo.id, wo.status, wo.work_order_no,wo.create_time, wo.unit_id, wo.yw_people_id, tm.name, wo.yw_handle_time, wo.yw_result, wo.yw_check_result, wo.overtime, wo.deduct, + u.unit_name, + p.yw_person_name, + yp.province_tag, + yp.important_tag, + yp.important_command_image_tag, + odr.create_time, + su.nick_name ORDER BY wo.create_time DESC </select> @@ -197,11 +215,12 @@ <select id="hasErrorWorkOrderList" resultType="com.ycl.platform.domain.vo.DeviceInfoVO"> SELECT wo.id as workOrderId, - di.device_id, - di.channel_id + we.device_id, + wec.channel_id FROM t_work_order wo - INNER JOIN t_device_info di ON wo.serial_number = di.device_id + INNER JOIN wvp2.wvp_device we ON we.device_id = wo.serial_number + INNER JOIN wvp2.wvp_device_channel wec ON we.device_id = wec.device_id </select> <insert id="addMany"> diff --git a/ycl-server/src/main/resources/mapper/zgyw/WorkOrderYwConditionRecordMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/WorkOrderYwConditionRecordMapper.xml index 940786c..43dce5d 100644 --- a/ycl-server/src/main/resources/mapper/zgyw/WorkOrderYwConditionRecordMapper.xml +++ b/ycl-server/src/main/resources/mapper/zgyw/WorkOrderYwConditionRecordMapper.xml @@ -9,13 +9,14 @@ <result column="yw_condition" property="ywCondition"/> <result column="commit_user" property="commitUser"/> <result column="nick_name" property="commitUserName"/> + <result column="sys_msg" property="sysMsg"/> <result column="yw_proofMaterials" property="ywProofMaterials"/> </resultMap> <select id="selectYwConditionByYwId" resultMap="BaseResultMap"> SELECT yw.id, yw.commit_user, yw.yw_condition, yw.yw_proofMaterials, yw.create_time, yw.sys_msg, su.nick_name FROM t_work_order_yw_condition_record yw - INNER JOIN sys_user su ON yw.commit_user = su.user_id AND yw.deleted = 0 AND yw.work_order_no = #{workOrderId} + INNER JOIN sys_user su ON yw.commit_user = su.user_id AND yw.deleted = 0 AND yw.work_order_no = #{workOrderNo} ORDER BY yw.create_time DESC </select> -- Gitblit v1.8.0