diff --git a/zc-business/src/main/java/com/zc/business/domain/DcEventProcess.java b/zc-business/src/main/java/com/zc/business/domain/DcEventProcess.java index c1435ef4..4eb0e301 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcEventProcess.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcEventProcess.java @@ -3,6 +3,9 @@ package com.zc.business.domain; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; @@ -19,6 +22,9 @@ import javax.validation.constraints.Size; * @author ruoyi * @date 2024-01-03 */ +@Data +@NoArgsConstructor +@AllArgsConstructor public class DcEventProcess { private static final long serialVersionUID = 1L; @@ -83,131 +89,8 @@ public class DcEventProcess @ApiModelProperty("内容类型") @Excel(name = "${type}", readConverterExp = "$column.readConverterExp()") private String type; -/* - @ApiModelProperty("上传文件") - private MultipartFile file;*/ + @ApiModelProperty("其他") + @Excel(name = "${remark}", readConverterExp = "$column.readConverterExp()") + private String remark; - - /* public MultipartFile getFile() { - return file; - } - - public void setFile(MultipartFile file) { - this.file = file; - }*/ - - public void setId(Long id) - { - this.id = id; - } - - public Long getId() - { - return id; - } - public void setEventId(String eventId) - { - this.eventId = eventId; - } - - public String getEventId() - { - return eventId; - } - public void setOperationTime(Date operationTime) - { - this.operationTime = operationTime; - } - - public Date getOperationTime() - { - return operationTime; - } - public void setOperator(String operator) - { - this.operator = operator; - } - - public String getOperator() - { - return operator; - } - - public String getOperatorName() { - return operatorName; - } - - public void setOperatorName(String operatorName) { - this.operatorName = operatorName; - } - - public void setSource(Integer source) - { - this.source = source; - } - - public Integer getSource() - { - return source; - } - public void setProcessType(Integer processType) - { - this.processType = processType; - } - - public Integer getProcessType() - { - return processType; - } - public void setContext(String context) - { - this.context = context; - } - - public String getContext() - { - return context; - } - public void setProcessId(Long processId) - { - this.processId = processId; - } - - public Long getProcessId() - { - return processId; - } - public void setProcessName(String processName) - { - this.processName = processName; - } - - public String getProcessName() - { - return processName; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("eventId", getEventId()) - .append("operationTime", getOperationTime()) - .append("operator", getOperator()) - .append("source", getSource()) - .append("processType", getProcessType()) - .append("context", getContext()) - .append("processId", getProcessId()) - .append("processName", getProcessName()) - .append("type", getType()) - .toString(); - } } diff --git a/zc-business/src/main/java/com/zc/business/domain/MdDevice.java b/zc-business/src/main/java/com/zc/business/domain/MdDevice.java index 42531871..37f6cb9b 100644 --- a/zc-business/src/main/java/com/zc/business/domain/MdDevice.java +++ b/zc-business/src/main/java/com/zc/business/domain/MdDevice.java @@ -120,6 +120,14 @@ public class MdDevice @Excel(name = "删除人") private Long deleterUserId; + /** 经度 */ + @Excel(name = "经度") + private String longitude; + + /** 纬度 */ + @Excel(name = "纬度") + private String latitude; + /** 删除时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "删除时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @@ -287,6 +295,22 @@ public class MdDevice this.childTypeCode = childTypeCode; } + public String getLongitude() { + return longitude; + } + + public void setLongitude(String longitude) { + this.longitude = longitude; + } + + public String getLatitude() { + return latitude; + } + + public void setLatitude(String latitude) { + this.latitude = latitude; + } + @Override public String toString() { return new ToStringBuilder(this) @@ -309,6 +333,8 @@ public class MdDevice .append("isDeleted", isDeleted) .append("deleterUserId", deleterUserId) .append("deletionTime", deletionTime) + .append("longitude", longitude) + .append("latitude", latitude) .toString(); } @@ -330,5 +356,7 @@ public class MdDevice this.opmaManagerId = dcDevice.getGroupId().toString(); } this.supplierName = dcDevice.getManufacturer(); + this.longitude = dcDevice.getLongitude(); + this.latitude = dcDevice.getLatitude(); } } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java index 55c3beae..dbabfdba 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java @@ -237,6 +237,14 @@ public class DcDeviceServiceImpl extends ServiceImpl i dcDevice.setCreateTime(new Date()); dcDevice.setUseState(DcDevice.UNUSEDSTATE); + if (Objects.nonNull(dcDevice.getStakeMark())){ + DcStakeMark dcStakeMark = dcStakeMarkService.getStakeMark(dcDevice.getStakeMark()); + if (Objects.nonNull(dcStakeMark)){ + dcDevice.setLongitude(dcStakeMark.getLongitude()); + dcDevice.setLatitude(dcStakeMark.getLatitude()); + } + } + if (save(dcDevice)) { // 更新缓存 updateRedisCache(); @@ -281,6 +289,13 @@ public class DcDeviceServiceImpl extends ServiceImpl i } dcDevice.setUpdateTime(new Date()); + if (Objects.nonNull(dcDevice.getStakeMark())){ + DcStakeMark dcStakeMark = dcStakeMarkService.getStakeMark(dcDevice.getStakeMark()); + if (Objects.nonNull(dcStakeMark)){ + dcDevice.setLongitude(dcStakeMark.getLongitude()); + dcDevice.setLatitude(dcStakeMark.getLatitude()); + } + } if (updateById(dcDevice)) { // 更新缓存 diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcStakeMarkServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcStakeMarkServiceImpl.java index 9ab9e008..6e514762 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcStakeMarkServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcStakeMarkServiceImpl.java @@ -134,7 +134,7 @@ public class DcStakeMarkServiceImpl extends ServiceImpl and t1.id = #{id} diff --git a/zc-business/src/main/resources/mapper/business/DcEventProcessMapper.xml b/zc-business/src/main/resources/mapper/business/DcEventProcessMapper.xml index 68376d4f..a36f18d7 100644 --- a/zc-business/src/main/resources/mapper/business/DcEventProcessMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcEventProcessMapper.xml @@ -16,10 +16,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + - select id, event_id, operation_time, operator,operator_name, source, process_type, context, process_id, process_name, `type` from dc_event_process + select id, event_id, operation_time, operator,operator_name, source, process_type, context, process_id, process_name, `type` ,remark from dc_event_process