Browse Source

Merge remote-tracking branch 'origin/develop' into develop

develop
wangsixiang 4 months ago
parent
commit
4d2d78dbe4
  1. 135
      zc-business/src/main/java/com/zc/business/domain/DcEventProcess.java
  2. 28
      zc-business/src/main/java/com/zc/business/domain/MdDevice.java
  3. 15
      zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java
  4. 2
      zc-business/src/main/java/com/zc/business/service/impl/DcStakeMarkServiceImpl.java
  5. 2
      zc-business/src/main/resources/mapper/business/DcDeviceMapper.xml
  6. 8
      zc-business/src/main/resources/mapper/business/DcEventProcessMapper.xml
  7. 12
      zc-business/src/main/resources/mapper/business/MiddleDatabaseMapper.xml

135
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 java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; 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.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel;
@ -19,6 +22,9 @@ import javax.validation.constraints.Size;
* @author ruoyi * @author ruoyi
* @date 2024-01-03 * @date 2024-01-03
*/ */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class DcEventProcess public class DcEventProcess
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -83,131 +89,8 @@ public class DcEventProcess
@ApiModelProperty("内容类型") @ApiModelProperty("内容类型")
@Excel(name = "${type}", readConverterExp = "$column.readConverterExp()") @Excel(name = "${type}", readConverterExp = "$column.readConverterExp()")
private String type; private String type;
/* @ApiModelProperty("其他")
@ApiModelProperty("上传文件") @Excel(name = "${remark}", readConverterExp = "$column.readConverterExp()")
private MultipartFile file;*/ 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();
}
} }

28
zc-business/src/main/java/com/zc/business/domain/MdDevice.java

@ -120,6 +120,14 @@ public class MdDevice
@Excel(name = "删除人") @Excel(name = "删除人")
private Long deleterUserId; private Long deleterUserId;
/** 经度 */
@Excel(name = "经度")
private String longitude;
/** 纬度 */
@Excel(name = "纬度")
private String latitude;
/** 删除时间 */ /** 删除时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "删除时间", width = 30, dateFormat = "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; 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 @Override
public String toString() { public String toString() {
return new ToStringBuilder(this) return new ToStringBuilder(this)
@ -309,6 +333,8 @@ public class MdDevice
.append("isDeleted", isDeleted) .append("isDeleted", isDeleted)
.append("deleterUserId", deleterUserId) .append("deleterUserId", deleterUserId)
.append("deletionTime", deletionTime) .append("deletionTime", deletionTime)
.append("longitude", longitude)
.append("latitude", latitude)
.toString(); .toString();
} }
@ -330,5 +356,7 @@ public class MdDevice
this.opmaManagerId = dcDevice.getGroupId().toString(); this.opmaManagerId = dcDevice.getGroupId().toString();
} }
this.supplierName = dcDevice.getManufacturer(); this.supplierName = dcDevice.getManufacturer();
this.longitude = dcDevice.getLongitude();
this.latitude = dcDevice.getLatitude();
} }
} }

15
zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java

@ -237,6 +237,14 @@ public class DcDeviceServiceImpl extends ServiceImpl<DcDeviceMapper, DcDevice> i
dcDevice.setCreateTime(new Date()); dcDevice.setCreateTime(new Date());
dcDevice.setUseState(DcDevice.UNUSEDSTATE); 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)) { if (save(dcDevice)) {
// 更新缓存 // 更新缓存
updateRedisCache(); updateRedisCache();
@ -281,6 +289,13 @@ public class DcDeviceServiceImpl extends ServiceImpl<DcDeviceMapper, DcDevice> i
} }
dcDevice.setUpdateTime(new Date()); 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)) { if (updateById(dcDevice)) {
// 更新缓存 // 更新缓存

2
zc-business/src/main/java/com/zc/business/service/impl/DcStakeMarkServiceImpl.java

@ -134,7 +134,7 @@ public class DcStakeMarkServiceImpl extends ServiceImpl<DcStakeMarkMapper, DcSta
throw new ServiceException("桩号ID[" + id + "]不存在", HttpStatus.BAD_REQUEST); throw new ServiceException("桩号ID[" + id + "]不存在", HttpStatus.BAD_REQUEST);
} }
return getById(id); return product;
} }
/** /**

2
zc-business/src/main/resources/mapper/business/DcDeviceMapper.xml

@ -78,7 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
t1.create_time,t1.update_time,t1.facilities_type,t1.device_ip,t1.stake_mark_range,t1.network_segment,t1.device_img,t1.child_type, t1.create_time,t1.update_time,t1.facilities_type,t1.device_ip,t1.stake_mark_range,t1.network_segment,t1.device_img,t1.child_type,
t1.facilities_type,t2.longitude,t2.latitude,t3.manufacturer t1.facilities_type,t2.longitude,t2.latitude,t3.manufacturer
from dc_device t1 from dc_device t1
left join dc_stake_mark t2 on t1.stake_mark = t2.stake_mark and t1.direction = t2.direction left join dc_stake_mark t2 on t1.stake_mark = t2.stake_mark
left join dc_product t3 on t3.id = t1.product_id left join dc_product t3 on t3.id = t1.product_id
<where> <where>
<if test="id != null and id != ''">and t1.id = #{id}</if> <if test="id != null and id != ''">and t1.id = #{id}</if>

8
zc-business/src/main/resources/mapper/business/DcEventProcessMapper.xml

@ -16,10 +16,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="processId" column="process_id" /> <result property="processId" column="process_id" />
<result property="processName" column="process_name" /> <result property="processName" column="process_name" />
<result property="type" column="type" /> <result property="type" column="type" />
<result property="remark" column="remark" />
</resultMap> </resultMap>
<sql id="selectDcEventProcessVo"> <sql id="selectDcEventProcessVo">
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
</sql> </sql>
<select id="selectDcEventProcessList" parameterType="DcEventProcess" resultMap="DcEventProcessResult"> <select id="selectDcEventProcessList" parameterType="DcEventProcess" resultMap="DcEventProcessResult">
@ -57,6 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="processId != null">process_id,</if> <if test="processId != null">process_id,</if>
<if test="processName != null">process_name,</if> <if test="processName != null">process_name,</if>
<if test="type != null">`type`,</if> <if test="type != null">`type`,</if>
<if test="remark != null">remark,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if> <if test="id != null">#{id},</if>
@ -70,6 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="processId != null">#{processId},</if> <if test="processId != null">#{processId},</if>
<if test="processName != null">#{processName},</if> <if test="processName != null">#{processName},</if>
<if test="type != null">#{type},</if> <if test="type != null">#{type},</if>
<if test="remark != null">#{remark},</if>
</trim> </trim>
</insert> </insert>
@ -88,6 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="item.processId != null">process_id,</if> <if test="item.processId != null">process_id,</if>
<if test="item.processName != null">process_name,</if> <if test="item.processName != null">process_name,</if>
<if test="item.type != null">`type`,</if> <if test="item.type != null">`type`,</if>
<if test="item.remark != null">`remark`,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="item.id != null">#{item.id},</if> <if test="item.id != null">#{item.id},</if>
@ -101,6 +105,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="item.processId != null">#{item.processId},</if> <if test="item.processId != null">#{item.processId},</if>
<if test="item.processName != null">#{item.processName},</if> <if test="item.processName != null">#{item.processName},</if>
<if test="item.type != null">#{item.type},</if> <if test="item.type != null">#{item.type},</if>
<if test="item.remark != null">#{item.remark},</if>
</trim> </trim>
</foreach> </foreach>
</insert> </insert>
@ -118,6 +123,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="type != null">`type` = #{type},</if> <if test="type != null">`type` = #{type},</if>
<if test="processId != null">process_id = #{processId},</if> <if test="processId != null">process_id = #{processId},</if>
<if test="processName != null">process_name = #{processName},</if> <if test="processName != null">process_name = #{processName},</if>
<if test="remark != null">remark = #{remark},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>

12
zc-business/src/main/resources/mapper/business/MiddleDatabaseMapper.xml

@ -162,6 +162,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isDeleted != null">IsDeleted,</if> <if test="isDeleted != null">IsDeleted,</if>
<if test="deleterUserId != null">DeleterUserId,</if> <if test="deleterUserId != null">DeleterUserId,</if>
<if test="deletionTime != null">DeletionTime,</if> <if test="deletionTime != null">DeletionTime,</if>
<if test="longitude != null">longitude,</if>
<if test="latitude != null">latitude,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if> <if test="id != null">#{id},</if>
@ -184,6 +186,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isDeleted != null">#{isDeleted},</if> <if test="isDeleted != null">#{isDeleted},</if>
<if test="deleterUserId != null">#{deleterUserId},</if> <if test="deleterUserId != null">#{deleterUserId},</if>
<if test="deletionTime != null">#{deletionTime},</if> <if test="deletionTime != null">#{deletionTime},</if>
<if test="longitude != null">#{longitude},</if>
<if test="latitude != null">#{latitude},</if>
</trim> </trim>
</insert> </insert>
@ -212,6 +216,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="mdDevice.isDeleted != null">IsDeleted,</if> <if test="mdDevice.isDeleted != null">IsDeleted,</if>
<if test="mdDevice.deleterUserId != null">DeleterUserId,</if> <if test="mdDevice.deleterUserId != null">DeleterUserId,</if>
<if test="mdDevice.deletionTime != null">DeletionTime,</if> <if test="mdDevice.deletionTime != null">DeletionTime,</if>
<if test="mdDevice.longitude != null">longitude,</if>
<if test="mdDevice.latitude != null">latitude,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="mdDevice.id != null">#{mdDevice.id},</if> <if test="mdDevice.id != null">#{mdDevice.id},</if>
@ -234,6 +240,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="mdDevice.isDeleted != null">#{mdDevice.isDeleted},</if> <if test="mdDevice.isDeleted != null">#{mdDevice.isDeleted},</if>
<if test="mdDevice.deleterUserId != null">#{mdDevice.deleterUserId},</if> <if test="mdDevice.deleterUserId != null">#{mdDevice.deleterUserId},</if>
<if test="mdDevice.deletionTime != null">#{mdDevice.deletionTime},</if> <if test="mdDevice.deletionTime != null">#{mdDevice.deletionTime},</if>
<if test="mdDevice.longitude != null">#{mdDevice.longitude},</if>
<if test="mdDevice.latitude != null">#{mdDevice.latitude},</if>
</trim> </trim>
ON DUPLICATE KEY UPDATE ON DUPLICATE KEY UPDATE
<trim suffixOverrides=","> <trim suffixOverrides=",">
@ -254,6 +262,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="mdDevice.isDeleted != null">IsDeleted = #{mdDevice.isDeleted},</if> <if test="mdDevice.isDeleted != null">IsDeleted = #{mdDevice.isDeleted},</if>
<if test="mdDevice.deleterUserId != null">DeleterUserId = #{mdDevice.deleterUserId},</if> <if test="mdDevice.deleterUserId != null">DeleterUserId = #{mdDevice.deleterUserId},</if>
<if test="mdDevice.deletionTime != null">DeletionTime = #{mdDevice.deletionTime},</if> <if test="mdDevice.deletionTime != null">DeletionTime = #{mdDevice.deletionTime},</if>
<if test="mdDevice.longitude != null">longitude = #{mdDevice.longitude},</if>
<if test="mdDevice.latitude != null">latitude = #{mdDevice.latitude},</if>
</trim> </trim>
</foreach> </foreach>
</insert> </insert>
@ -386,6 +396,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isDeleted != null">IsDeleted = #{isDeleted},</if> <if test="isDeleted != null">IsDeleted = #{isDeleted},</if>
<if test="deleterUserId != null">DeleterUserId = #{deleterUserId},</if> <if test="deleterUserId != null">DeleterUserId = #{deleterUserId},</if>
<if test="deletionTime != null">DeletionTime = #{deletionTime},</if> <if test="deletionTime != null">DeletionTime = #{deletionTime},</if>
<if test="longitude != null">longitude = #{longitude},</if>
<if test="latitude != null">latitude = #{latitude},</if>
</set> </set>
where id = #{id} where id = #{id}
</update> </update>

Loading…
Cancel
Save