From dea15cefacad159ae3167cef5078c4c4bbd75a8f Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Wed, 16 Jun 2021 13:03:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=A2=9E=E5=8A=A0=E6=8F=8F=E8=BF=B0=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/20210616-thesai.sql | 3 + .../club/joylink/rtss/dao/MapDataDAO.java | 4 +- .../club/joylink/rtss/entity/MapData.java | 106 +++++++++++++++- .../joylink/rtss/entity/MapDataExample.java | 70 +++++++++++ .../joylink/rtss/entity/MapDataWithBLOBs.java | 113 +++++++++++++++++- .../rtss/services/DraftMapService.java | 1 + .../joylink/rtss/services/MapService.java | 1 + .../rtss/vo/client/map/DraftMapVO.java | 2 + .../joylink/rtss/vo/client/map/MapDataVO.java | 2 + .../joylink/rtss/vo/map/MapVersionVO.java | 3 + .../resources/mybatis/mapper/MapDataDAO.xml | 37 ++++-- 11 files changed, 325 insertions(+), 17 deletions(-) create mode 100644 sql/20210616-thesai.sql diff --git a/sql/20210616-thesai.sql b/sql/20210616-thesai.sql new file mode 100644 index 000000000..e2011f283 --- /dev/null +++ b/sql/20210616-thesai.sql @@ -0,0 +1,3 @@ +ALTER TABLE `map_data` +ADD COLUMN `note` varchar(255) NULL COMMENT '备注' AFTER `version`; + diff --git a/src/main/java/club/joylink/rtss/dao/MapDataDAO.java b/src/main/java/club/joylink/rtss/dao/MapDataDAO.java index 6e2852f45..a80a0a09f 100644 --- a/src/main/java/club/joylink/rtss/dao/MapDataDAO.java +++ b/src/main/java/club/joylink/rtss/dao/MapDataDAO.java @@ -50,7 +50,7 @@ public interface MapDataDAO { " #{entity.graphData,jdbcType=LONGVARCHAR}, #{entity.logicData,jdbcType=LONGVARCHAR}," + " #{entity.initPosConfig,jdbcType=LONGVARCHAR}, #{entity.checkConfig,jdbcType=LONGVARCHAR}," + " #{entity.ciGenerateConfig,jdbcType=LONGVARCHAR}, #{entity.bigScreenConfig,jdbcType=LONGVARCHAR}" + - " #{entity.version, jdbcType=VARCHAR}, #{entity.time, jdbcType=TIMESTAMP}, #{entity.userId, jdbcType=BIGINT})"+ + " #{entity.version, jdbcType=VARCHAR}, , #{entity.note, jdbcType=VARCHAR}, #{entity.time, jdbcType=TIMESTAMP}, #{entity.userId, jdbcType=BIGINT})"+ " " + "") int batchInsertWithId(@Param("list") List mapDataList); @@ -65,4 +65,4 @@ public interface MapDataDAO { "\tmap_data.time DESC\n" + "LIMIT 1") String findVersion(Long mapId); -} \ No newline at end of file +} diff --git a/src/main/java/club/joylink/rtss/entity/MapData.java b/src/main/java/club/joylink/rtss/entity/MapData.java index 6958dc570..4fc6cc9bd 100644 --- a/src/main/java/club/joylink/rtss/entity/MapData.java +++ b/src/main/java/club/joylink/rtss/entity/MapData.java @@ -1,7 +1,5 @@ package club.joylink.rtss.entity; -import lombok.Data; - import java.io.Serializable; import java.time.LocalDateTime; @@ -9,7 +7,6 @@ import java.time.LocalDateTime; * @author * 地图数据 */ -@Data public class MapData implements Serializable { private Long id; @@ -23,6 +20,11 @@ public class MapData implements Serializable { */ private String version; + /** + * 备注 + */ + private String note; + /** * 发布时间 */ @@ -34,4 +36,102 @@ public class MapData implements Serializable { private Long userId; private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getMapId() { + return mapId; + } + + public void setMapId(Long mapId) { + this.mapId = mapId; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getNote() { + return note; + } + + public void setNote(String note) { + this.note = note; + } + + public LocalDateTime getTime() { + return time; + } + + public void setTime(LocalDateTime time) { + this.time = time; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + MapData other = (MapData) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getMapId() == null ? other.getMapId() == null : this.getMapId().equals(other.getMapId())) + && (this.getVersion() == null ? other.getVersion() == null : this.getVersion().equals(other.getVersion())) + && (this.getNote() == null ? other.getNote() == null : this.getNote().equals(other.getNote())) + && (this.getTime() == null ? other.getTime() == null : this.getTime().equals(other.getTime())) + && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getMapId() == null) ? 0 : getMapId().hashCode()); + result = prime * result + ((getVersion() == null) ? 0 : getVersion().hashCode()); + result = prime * result + ((getNote() == null) ? 0 : getNote().hashCode()); + result = prime * result + ((getTime() == null) ? 0 : getTime().hashCode()); + result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", mapId=").append(mapId); + sb.append(", version=").append(version); + sb.append(", note=").append(note); + sb.append(", time=").append(time); + sb.append(", userId=").append(userId); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } } \ No newline at end of file diff --git a/src/main/java/club/joylink/rtss/entity/MapDataExample.java b/src/main/java/club/joylink/rtss/entity/MapDataExample.java index 153f067c3..e3928a571 100644 --- a/src/main/java/club/joylink/rtss/entity/MapDataExample.java +++ b/src/main/java/club/joylink/rtss/entity/MapDataExample.java @@ -315,6 +315,76 @@ public class MapDataExample { return (Criteria) this; } + public Criteria andNoteIsNull() { + addCriterion("note is null"); + return (Criteria) this; + } + + public Criteria andNoteIsNotNull() { + addCriterion("note is not null"); + return (Criteria) this; + } + + public Criteria andNoteEqualTo(String value) { + addCriterion("note =", value, "note"); + return (Criteria) this; + } + + public Criteria andNoteNotEqualTo(String value) { + addCriterion("note <>", value, "note"); + return (Criteria) this; + } + + public Criteria andNoteGreaterThan(String value) { + addCriterion("note >", value, "note"); + return (Criteria) this; + } + + public Criteria andNoteGreaterThanOrEqualTo(String value) { + addCriterion("note >=", value, "note"); + return (Criteria) this; + } + + public Criteria andNoteLessThan(String value) { + addCriterion("note <", value, "note"); + return (Criteria) this; + } + + public Criteria andNoteLessThanOrEqualTo(String value) { + addCriterion("note <=", value, "note"); + return (Criteria) this; + } + + public Criteria andNoteLike(String value) { + addCriterion("note like", value, "note"); + return (Criteria) this; + } + + public Criteria andNoteNotLike(String value) { + addCriterion("note not like", value, "note"); + return (Criteria) this; + } + + public Criteria andNoteIn(List values) { + addCriterion("note in", values, "note"); + return (Criteria) this; + } + + public Criteria andNoteNotIn(List values) { + addCriterion("note not in", values, "note"); + return (Criteria) this; + } + + public Criteria andNoteBetween(String value1, String value2) { + addCriterion("note between", value1, value2, "note"); + return (Criteria) this; + } + + public Criteria andNoteNotBetween(String value1, String value2) { + addCriterion("note not between", value1, value2, "note"); + return (Criteria) this; + } + public Criteria andTimeIsNull() { addCriterion("`time` is null"); return (Criteria) this; diff --git a/src/main/java/club/joylink/rtss/entity/MapDataWithBLOBs.java b/src/main/java/club/joylink/rtss/entity/MapDataWithBLOBs.java index 08b901e3f..4674ceab6 100644 --- a/src/main/java/club/joylink/rtss/entity/MapDataWithBLOBs.java +++ b/src/main/java/club/joylink/rtss/entity/MapDataWithBLOBs.java @@ -1,14 +1,11 @@ package club.joylink.rtss.entity; -import lombok.Data; - import java.io.Serializable; /** * @author * 地图数据 */ -@Data public class MapDataWithBLOBs extends MapData implements Serializable { /** * 图形数据 @@ -41,4 +38,114 @@ public class MapDataWithBLOBs extends MapData implements Serializable { private String bigScreenConfig; private static final long serialVersionUID = 1L; + + public String getGraphData() { + return graphData; + } + + public void setGraphData(String graphData) { + this.graphData = graphData; + } + + public String getLogicData() { + return logicData; + } + + public void setLogicData(String logicData) { + this.logicData = logicData; + } + + public String getInitPosConfig() { + return initPosConfig; + } + + public void setInitPosConfig(String initPosConfig) { + this.initPosConfig = initPosConfig; + } + + public String getCheckConfig() { + return checkConfig; + } + + public void setCheckConfig(String checkConfig) { + this.checkConfig = checkConfig; + } + + public String getCiGenerateConfig() { + return ciGenerateConfig; + } + + public void setCiGenerateConfig(String ciGenerateConfig) { + this.ciGenerateConfig = ciGenerateConfig; + } + + public String getBigScreenConfig() { + return bigScreenConfig; + } + + public void setBigScreenConfig(String bigScreenConfig) { + this.bigScreenConfig = bigScreenConfig; + } + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + MapDataWithBLOBs other = (MapDataWithBLOBs) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getMapId() == null ? other.getMapId() == null : this.getMapId().equals(other.getMapId())) + && (this.getVersion() == null ? other.getVersion() == null : this.getVersion().equals(other.getVersion())) + && (this.getNote() == null ? other.getNote() == null : this.getNote().equals(other.getNote())) + && (this.getTime() == null ? other.getTime() == null : this.getTime().equals(other.getTime())) + && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId())) + && (this.getGraphData() == null ? other.getGraphData() == null : this.getGraphData().equals(other.getGraphData())) + && (this.getLogicData() == null ? other.getLogicData() == null : this.getLogicData().equals(other.getLogicData())) + && (this.getInitPosConfig() == null ? other.getInitPosConfig() == null : this.getInitPosConfig().equals(other.getInitPosConfig())) + && (this.getCheckConfig() == null ? other.getCheckConfig() == null : this.getCheckConfig().equals(other.getCheckConfig())) + && (this.getCiGenerateConfig() == null ? other.getCiGenerateConfig() == null : this.getCiGenerateConfig().equals(other.getCiGenerateConfig())) + && (this.getBigScreenConfig() == null ? other.getBigScreenConfig() == null : this.getBigScreenConfig().equals(other.getBigScreenConfig())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getMapId() == null) ? 0 : getMapId().hashCode()); + result = prime * result + ((getVersion() == null) ? 0 : getVersion().hashCode()); + result = prime * result + ((getNote() == null) ? 0 : getNote().hashCode()); + result = prime * result + ((getTime() == null) ? 0 : getTime().hashCode()); + result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode()); + result = prime * result + ((getGraphData() == null) ? 0 : getGraphData().hashCode()); + result = prime * result + ((getLogicData() == null) ? 0 : getLogicData().hashCode()); + result = prime * result + ((getInitPosConfig() == null) ? 0 : getInitPosConfig().hashCode()); + result = prime * result + ((getCheckConfig() == null) ? 0 : getCheckConfig().hashCode()); + result = prime * result + ((getCiGenerateConfig() == null) ? 0 : getCiGenerateConfig().hashCode()); + result = prime * result + ((getBigScreenConfig() == null) ? 0 : getBigScreenConfig().hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", graphData=").append(graphData); + sb.append(", logicData=").append(logicData); + sb.append(", initPosConfig=").append(initPosConfig); + sb.append(", checkConfig=").append(checkConfig); + sb.append(", ciGenerateConfig=").append(ciGenerateConfig); + sb.append(", bigScreenConfig=").append(bigScreenConfig); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } } \ No newline at end of file diff --git a/src/main/java/club/joylink/rtss/services/DraftMapService.java b/src/main/java/club/joylink/rtss/services/DraftMapService.java index 10a79d1ad..a670d8163 100644 --- a/src/main/java/club/joylink/rtss/services/DraftMapService.java +++ b/src/main/java/club/joylink/rtss/services/DraftMapService.java @@ -335,6 +335,7 @@ public class DraftMapService implements IDraftMapService { public void publish(Long id, DraftMapVO draftMapVO, AccountVO accountVO, MapDataVO mapDataVO) { DraftMap draftMap = draftMapDAO.selectByPrimaryKey(id); mapDataVO.setMap3dDataVO(find3dMapDataByMapId(id)); + mapDataVO.setNote(draftMapVO.getNote()); iMapService.publish(new MapVO(draftMap, draftMapVO.getName(), draftMapVO.getCityCode()), mapDataVO, accountVO); } diff --git a/src/main/java/club/joylink/rtss/services/MapService.java b/src/main/java/club/joylink/rtss/services/MapService.java index eca90e984..1bbc4177a 100644 --- a/src/main/java/club/joylink/rtss/services/MapService.java +++ b/src/main/java/club/joylink/rtss/services/MapService.java @@ -392,6 +392,7 @@ public class MapService implements IMapService { mapData.setCheckConfig(new MapCheckConfig().toJson()); } mapData.setVersion(VersionUtil.generateNext(findMapVersion(map.getId()))); + mapData.setNote(mapDataVO.getNote()); mapData.setTime(LocalDateTime.now()); mapData.setUserId(accountVO.getId()); mapDataDAO.insert(mapData); diff --git a/src/main/java/club/joylink/rtss/vo/client/map/DraftMapVO.java b/src/main/java/club/joylink/rtss/vo/client/map/DraftMapVO.java index ba6744eba..33d7ab655 100644 --- a/src/main/java/club/joylink/rtss/vo/client/map/DraftMapVO.java +++ b/src/main/java/club/joylink/rtss/vo/client/map/DraftMapVO.java @@ -40,6 +40,8 @@ public class DraftMapVO { @NotBlank(message="城市不能为空", groups= {DraftMapPublishCheck.class}) private String cityCode; + private String note; + public DraftMapVO(DraftMap draftMap) { this.id = draftMap.getId(); this.name = draftMap.getName(); diff --git a/src/main/java/club/joylink/rtss/vo/client/map/MapDataVO.java b/src/main/java/club/joylink/rtss/vo/client/map/MapDataVO.java index e2bc8ce9c..b9eb62350 100644 --- a/src/main/java/club/joylink/rtss/vo/client/map/MapDataVO.java +++ b/src/main/java/club/joylink/rtss/vo/client/map/MapDataVO.java @@ -23,6 +23,8 @@ public class MapDataVO { private Map3dDataVO map3dDataVO; + private String note; + public MapDataVO(MapDataWithBLOBs mapData) { if (StringUtils.hasText(mapData.getCheckConfig())) { diff --git a/src/main/java/club/joylink/rtss/vo/map/MapVersionVO.java b/src/main/java/club/joylink/rtss/vo/map/MapVersionVO.java index abf239bb6..5c9cd632b 100644 --- a/src/main/java/club/joylink/rtss/vo/map/MapVersionVO.java +++ b/src/main/java/club/joylink/rtss/vo/map/MapVersionVO.java @@ -24,10 +24,13 @@ public class MapVersionVO { private String version; + private String note; + public MapVersionVO(MapData mapData) { this.userId = mapData.getUserId(); this.publishTime = mapData.getTime(); this.version = mapData.getVersion(); + this.note = mapData.getNote(); } public static List convert2VOList(List list) { diff --git a/src/main/resources/mybatis/mapper/MapDataDAO.xml b/src/main/resources/mybatis/mapper/MapDataDAO.xml index c3db9607b..2d0ef3050 100644 --- a/src/main/resources/mybatis/mapper/MapDataDAO.xml +++ b/src/main/resources/mybatis/mapper/MapDataDAO.xml @@ -5,6 +5,7 @@ + @@ -75,7 +76,7 @@ - id, map_id, version, `time`, user_id + id, map_id, version, note, `time`, user_id graph_data, logic_data, init_pos_config, check_config, ci_generate_config, big_screen_config @@ -145,14 +146,16 @@ - insert into map_data (map_id, version, `time`, - user_id, graph_data, logic_data, - init_pos_config, check_config, ci_generate_config, - big_screen_config) - values (#{mapId,jdbcType=BIGINT}, #{version,jdbcType=VARCHAR}, #{time,jdbcType=TIMESTAMP}, - #{userId,jdbcType=BIGINT}, #{graphData,jdbcType=LONGVARCHAR}, #{logicData,jdbcType=LONGVARCHAR}, - #{initPosConfig,jdbcType=LONGVARCHAR}, #{checkConfig,jdbcType=LONGVARCHAR}, #{ciGenerateConfig,jdbcType=LONGVARCHAR}, - #{bigScreenConfig,jdbcType=LONGVARCHAR}) + insert into map_data (map_id, version, note, + `time`, user_id, graph_data, + logic_data, init_pos_config, check_config, + ci_generate_config, big_screen_config + ) + values (#{mapId,jdbcType=BIGINT}, #{version,jdbcType=VARCHAR}, #{note,jdbcType=VARCHAR}, + #{time,jdbcType=TIMESTAMP}, #{userId,jdbcType=BIGINT}, #{graphData,jdbcType=LONGVARCHAR}, + #{logicData,jdbcType=LONGVARCHAR}, #{initPosConfig,jdbcType=LONGVARCHAR}, #{checkConfig,jdbcType=LONGVARCHAR}, + #{ciGenerateConfig,jdbcType=LONGVARCHAR}, #{bigScreenConfig,jdbcType=LONGVARCHAR} + ) insert into map_data @@ -163,6 +166,9 @@ version, + + note, + `time`, @@ -195,6 +201,9 @@ #{version,jdbcType=VARCHAR}, + + #{note,jdbcType=VARCHAR}, + #{time,jdbcType=TIMESTAMP}, @@ -239,6 +248,9 @@ version = #{record.version,jdbcType=VARCHAR}, + + note = #{record.note,jdbcType=VARCHAR}, + `time` = #{record.time,jdbcType=TIMESTAMP}, @@ -273,6 +285,7 @@ set id = #{record.id,jdbcType=BIGINT}, map_id = #{record.mapId,jdbcType=BIGINT}, version = #{record.version,jdbcType=VARCHAR}, + note = #{record.note,jdbcType=VARCHAR}, `time` = #{record.time,jdbcType=TIMESTAMP}, user_id = #{record.userId,jdbcType=BIGINT}, graph_data = #{record.graphData,jdbcType=LONGVARCHAR}, @@ -290,6 +303,7 @@ set id = #{record.id,jdbcType=BIGINT}, map_id = #{record.mapId,jdbcType=BIGINT}, version = #{record.version,jdbcType=VARCHAR}, + note = #{record.note,jdbcType=VARCHAR}, `time` = #{record.time,jdbcType=TIMESTAMP}, user_id = #{record.userId,jdbcType=BIGINT} @@ -305,6 +319,9 @@ version = #{version,jdbcType=VARCHAR}, + + note = #{note,jdbcType=VARCHAR}, + `time` = #{time,jdbcType=TIMESTAMP}, @@ -336,6 +353,7 @@ update map_data set map_id = #{mapId,jdbcType=BIGINT}, version = #{version,jdbcType=VARCHAR}, + note = #{note,jdbcType=VARCHAR}, `time` = #{time,jdbcType=TIMESTAMP}, user_id = #{userId,jdbcType=BIGINT}, graph_data = #{graphData,jdbcType=LONGVARCHAR}, @@ -350,6 +368,7 @@ update map_data set map_id = #{mapId,jdbcType=BIGINT}, version = #{version,jdbcType=VARCHAR}, + note = #{note,jdbcType=VARCHAR}, `time` = #{time,jdbcType=TIMESTAMP}, user_id = #{userId,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}