Browse Source

feat: 驿站信息添加修改经纬度

zhangying 1 year ago
parent
commit
7d20f271ef

+ 20 - 0
src/main/java/com/hz/employmentsite/model/PcSite.java

@@ -17,6 +17,10 @@ public class PcSite {
 
     private String siteY;
 
+    private Double siteLongitude;
+
+    private Double siteLatitude;
+
     private String siteName;
 
     private String fzrName;
@@ -152,4 +156,20 @@ public class PcSite {
     public void setRemark(String remark) {
         this.remark = remark == null ? null : remark.trim();
     }
+
+    public Double getSiteLongitude() {
+        return siteLongitude;
+    }
+
+    public void setSiteLongitude(Double siteLongitude) {
+        this.siteLongitude = siteLongitude;
+    }
+
+    public Double getSiteLatitude() {
+        return siteLatitude;
+    }
+
+    public void setSiteLatitude(Double siteLatitude) {
+        this.siteLatitude = siteLatitude;
+    }
 }

+ 6 - 2
src/main/java/com/hz/employmentsite/services/impl/baseSettings/SiteInfoImpl.java

@@ -3,8 +3,8 @@ package com.hz.employmentsite.services.impl.baseSettings;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.hz.employmentsite.filter.exception.BaseException;
-import com.hz.employmentsite.mapper.PcSiteMapper;
 import com.hz.employmentsite.mapper.PcSiteInstitutionMapper;
+import com.hz.employmentsite.mapper.PcSiteMapper;
 import com.hz.employmentsite.mapper.PcSiteUserMapper;
 import com.hz.employmentsite.mapper.cquery.SiteInfoCQuery;
 import com.hz.employmentsite.mapper.cquery.SiteInstitutionCQuery;
@@ -12,7 +12,7 @@ import com.hz.employmentsite.model.*;
 import com.hz.employmentsite.services.service.baseSettings.SiteInfoService;
 import com.hz.employmentsite.util.StringUtils;
 import com.hz.employmentsite.vo.baseSettings.SiteInfoVo;
-import com.hz.employmentsite.vo.baseSettings.SiteUserVo; 
+import com.hz.employmentsite.vo.baseSettings.SiteUserVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -119,6 +119,8 @@ public class SiteInfoImpl implements SiteInfoService {
             dbData.setFzrMobile(data.getFzrMobile());
             dbData.setSiteX(data.getSiteX());
             dbData.setSiteY(data.getSiteY());
+            dbData.setSiteLongitude(data.getSiteLongitude());
+            dbData.setSiteLatitude(data.getSiteLatitude());
             dbData.setDetailAddress(data.getDetailAddress());
             dbData.setRegionCode(data.getRegionCode());
             dbData.setStreetCode(data.getStreetCode());
@@ -135,6 +137,8 @@ public class SiteInfoImpl implements SiteInfoService {
             dbData.setFzrMobile(data.fzrMobile);
             dbData.setSiteX(data.siteX);
             dbData.setSiteY(data.siteY);
+            dbData.setSiteLongitude(data.siteLongitude);
+            dbData.setSiteLatitude(data.siteLatitude);
             dbData.setDetailAddress(data.detailAddress);
             dbData.setRegionCode(data.regionCode);
             dbData.setStreetCode(data.streetCode);

+ 5 - 1
src/main/java/com/hz/employmentsite/vo/baseSettings/SiteInfoVo.java

@@ -2,10 +2,11 @@ package com.hz.employmentsite.vo.baseSettings;
 
 import com.hz.employmentsite.util.datarange.annotations.InstitutionID;
 import com.hz.employmentsite.util.datarange.annotations.RegionID;
+import com.hz.employmentsite.util.datarange.annotations.SiteID;
 import lombok.Data;
+
 import java.sql.Date;
 import java.util.List;
-import com.hz.employmentsite.util.datarange.annotations.SiteID;
 
 @Data
 public class SiteInfoVo {
@@ -24,6 +25,9 @@ public class SiteInfoVo {
     public String siteX;
     public String siteY;
 
+    public Double siteLongitude;
+    public Double siteLatitude;
+
     public String siteName;
     public String fzrName;
     public String fzrMobile;

+ 85 - 55
src/main/resources/mapping/PcSiteMapper.xml

@@ -2,21 +2,23 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.hz.employmentsite.mapper.PcSiteMapper">
   <resultMap id="BaseResultMap" type="com.hz.employmentsite.model.PcSite">
-    <id column="SiteID" jdbcType="VARCHAR" property="siteID" />
-    <result column="SiteCode" jdbcType="VARCHAR" property="siteCode" />
-    <result column="RegionCode" jdbcType="VARCHAR" property="regionCode" />
-    <result column="StreetCode" jdbcType="VARCHAR" property="streetCode" />
-    <result column="DetailAddress" jdbcType="VARCHAR" property="detailAddress" />
-    <result column="SiteX" jdbcType="VARCHAR" property="siteX" />
-    <result column="SiteY" jdbcType="VARCHAR" property="siteY" />
-    <result column="SiteName" jdbcType="VARCHAR" property="siteName" />
-    <result column="FzrName" jdbcType="VARCHAR" property="fzrName" />
-    <result column="FzrMobile" jdbcType="VARCHAR" property="fzrMobile" />
-    <result column="CreateUserID" jdbcType="VARCHAR" property="createUserID" />
-    <result column="CreateTime" jdbcType="TIMESTAMP" property="createTime" />
-    <result column="ModifyUserID" jdbcType="VARCHAR" property="modifyUserID" />
-    <result column="ModifyTime" jdbcType="TIMESTAMP" property="modifyTime" />
-    <result column="Remark" jdbcType="VARCHAR" property="remark" />
+    <id column="SiteID" jdbcType="VARCHAR" property="siteID"/>
+    <result column="SiteCode" jdbcType="VARCHAR" property="siteCode"/>
+    <result column="RegionCode" jdbcType="VARCHAR" property="regionCode"/>
+    <result column="StreetCode" jdbcType="VARCHAR" property="streetCode"/>
+    <result column="DetailAddress" jdbcType="VARCHAR" property="detailAddress"/>
+    <result column="SiteX" jdbcType="VARCHAR" property="siteX"/>
+    <result column="SiteY" jdbcType="VARCHAR" property="siteY"/>
+    <result column="SiteLongitude" jdbcType="DOUBLE" property="siteLongitude"/>
+    <result column="SiteLatitude" jdbcType="DOUBLE" property="siteLatitude"/>
+    <result column="SiteName" jdbcType="VARCHAR" property="siteName"/>
+    <result column="FzrName" jdbcType="VARCHAR" property="fzrName"/>
+    <result column="FzrMobile" jdbcType="VARCHAR" property="fzrMobile"/>
+    <result column="CreateUserID" jdbcType="VARCHAR" property="createUserID"/>
+    <result column="CreateTime" jdbcType="TIMESTAMP" property="createTime"/>
+    <result column="ModifyUserID" jdbcType="VARCHAR" property="modifyUserID"/>
+    <result column="ModifyTime" jdbcType="TIMESTAMP" property="modifyTime"/>
+    <result column="Remark" jdbcType="VARCHAR" property="remark"/>
   </resultMap>
   <sql id="Example_Where_Clause">
     <where>
@@ -111,18 +113,18 @@
     </if>
   </delete>
   <insert id="insert" parameterType="com.hz.employmentsite.model.PcSite">
-    insert into pc_site (SiteID, SiteCode, RegionCode, 
-      StreetCode, DetailAddress, SiteX, 
-      SiteY, SiteName, FzrName, 
-      FzrMobile, CreateUserID, CreateTime, 
-      ModifyUserID, ModifyTime, Remark
-      )
-    values (#{siteID,jdbcType=VARCHAR}, #{siteCode,jdbcType=VARCHAR}, #{regionCode,jdbcType=VARCHAR}, 
-      #{streetCode,jdbcType=VARCHAR}, #{detailAddress,jdbcType=VARCHAR}, #{siteX,jdbcType=VARCHAR}, 
-      #{siteY,jdbcType=VARCHAR}, #{siteName,jdbcType=VARCHAR}, #{fzrName,jdbcType=VARCHAR}, 
-      #{fzrMobile,jdbcType=VARCHAR}, #{createUserID,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
-      #{modifyUserID,jdbcType=VARCHAR}, #{modifyTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}
-      )
+    insert into pc_site (SiteID, SiteCode, RegionCode,
+                         StreetCode, DetailAddress, SiteX,
+                         SiteY, SiteLongitude, SiteLatitude,
+                         SiteName, FzrName, FzrMobile,
+                         CreateUserID, CreateTime, ModifyUserID,
+                         ModifyTime, Remark)
+    values (#{siteID,jdbcType=VARCHAR}, #{siteCode,jdbcType=VARCHAR}, #{regionCode,jdbcType=VARCHAR},
+            #{streetCode,jdbcType=VARCHAR}, #{detailAddress,jdbcType=VARCHAR}, #{siteX,jdbcType=VARCHAR},
+            #{siteY,jdbcType=VARCHAR}, #{siteLongitude,jdbcType=DOUBLE}, #{siteLatitude,jdbcType=DOUBLE},
+            #{siteName,jdbcType=VARCHAR}, #{fzrName,jdbcType=VARCHAR},
+            #{fzrMobile,jdbcType=VARCHAR}, #{createUserID,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
+            #{modifyUserID,jdbcType=VARCHAR}, #{modifyTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.hz.employmentsite.model.PcSite">
     insert into pc_site
@@ -148,6 +150,12 @@
       <if test="siteY != null">
         SiteY,
       </if>
+      <if test="siteLongitude != null">
+        SiteLongitude,
+      </if>
+      <if test="siteLatitude != null">
+        SiteLatitude,
+      </if>
       <if test="siteName != null">
         SiteName,
       </if>
@@ -195,6 +203,12 @@
       <if test="siteY != null">
         #{siteY,jdbcType=VARCHAR},
       </if>
+      <if test="siteLongitude != null">
+        #{siteLongitude,jdbcType=DOUBLE},
+      </if>
+      <if test="siteLatitude != null">
+        #{siteLatitude,jdbcType=DOUBLE},
+      </if>
       <if test="siteName != null">
         #{siteName,jdbcType=VARCHAR},
       </if>
@@ -251,6 +265,12 @@
       <if test="row.siteY != null">
         SiteY = #{row.siteY,jdbcType=VARCHAR},
       </if>
+      <if test="row.siteLongitude != null">
+        SiteLongitude = #{row.siteLongitude,jdbcType=DOUBLE},
+      </if>
+      <if test="row.siteLatitude != null">
+        SiteLatitude = #{row.siteLatitude,jdbcType=DOUBLE},
+      </if>
       <if test="row.siteName != null">
         SiteName = #{row.siteName,jdbcType=VARCHAR},
       </if>
@@ -283,20 +303,22 @@
   <update id="updateByExample" parameterType="map">
     update pc_site
     set SiteID = #{row.siteID,jdbcType=VARCHAR},
-      SiteCode = #{row.siteCode,jdbcType=VARCHAR},
-      RegionCode = #{row.regionCode,jdbcType=VARCHAR},
-      StreetCode = #{row.streetCode,jdbcType=VARCHAR},
-      DetailAddress = #{row.detailAddress,jdbcType=VARCHAR},
-      SiteX = #{row.siteX,jdbcType=VARCHAR},
-      SiteY = #{row.siteY,jdbcType=VARCHAR},
-      SiteName = #{row.siteName,jdbcType=VARCHAR},
-      FzrName = #{row.fzrName,jdbcType=VARCHAR},
-      FzrMobile = #{row.fzrMobile,jdbcType=VARCHAR},
-      CreateUserID = #{row.createUserID,jdbcType=VARCHAR},
-      CreateTime = #{row.createTime,jdbcType=TIMESTAMP},
-      ModifyUserID = #{row.modifyUserID,jdbcType=VARCHAR},
-      ModifyTime = #{row.modifyTime,jdbcType=TIMESTAMP},
-      Remark = #{row.remark,jdbcType=VARCHAR}
+    SiteCode = #{row.siteCode,jdbcType=VARCHAR},
+    RegionCode = #{row.regionCode,jdbcType=VARCHAR},
+    StreetCode = #{row.streetCode,jdbcType=VARCHAR},
+    DetailAddress = #{row.detailAddress,jdbcType=VARCHAR},
+    SiteX = #{row.siteX,jdbcType=VARCHAR},
+    SiteY = #{row.siteY,jdbcType=VARCHAR},
+    SiteLongitude = #{siteLongitude,jdbcType=DOUBLE},
+    SiteLatitude = #{siteLatitude,jdbcType=DOUBLE},
+    SiteName = #{row.siteName,jdbcType=VARCHAR},
+    FzrName = #{row.fzrName,jdbcType=VARCHAR},
+    FzrMobile = #{row.fzrMobile,jdbcType=VARCHAR},
+    CreateUserID = #{row.createUserID,jdbcType=VARCHAR},
+    CreateTime = #{row.createTime,jdbcType=TIMESTAMP},
+    ModifyUserID = #{row.modifyUserID,jdbcType=VARCHAR},
+    ModifyTime = #{row.modifyTime,jdbcType=TIMESTAMP},
+    Remark = #{row.remark,jdbcType=VARCHAR}
     <if test="example != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -322,6 +344,12 @@
       <if test="siteY != null">
         SiteY = #{siteY,jdbcType=VARCHAR},
       </if>
+      <if test="row.siteLongitude != null">
+        SiteLongitude = #{row.siteLongitude,jdbcType=DOUBLE},
+      </if>
+      <if test="row.siteLatitude != null">
+        SiteLatitude = #{row.siteLatitude,jdbcType=DOUBLE},
+      </if>
       <if test="siteName != null">
         SiteName = #{siteName,jdbcType=VARCHAR},
       </if>
@@ -351,20 +379,22 @@
   </update>
   <update id="updateByPrimaryKey" parameterType="com.hz.employmentsite.model.PcSite">
     update pc_site
-    set SiteCode = #{siteCode,jdbcType=VARCHAR},
-      RegionCode = #{regionCode,jdbcType=VARCHAR},
-      StreetCode = #{streetCode,jdbcType=VARCHAR},
-      DetailAddress = #{detailAddress,jdbcType=VARCHAR},
-      SiteX = #{siteX,jdbcType=VARCHAR},
-      SiteY = #{siteY,jdbcType=VARCHAR},
-      SiteName = #{siteName,jdbcType=VARCHAR},
-      FzrName = #{fzrName,jdbcType=VARCHAR},
-      FzrMobile = #{fzrMobile,jdbcType=VARCHAR},
-      CreateUserID = #{createUserID,jdbcType=VARCHAR},
-      CreateTime = #{createTime,jdbcType=TIMESTAMP},
-      ModifyUserID = #{modifyUserID,jdbcType=VARCHAR},
-      ModifyTime = #{modifyTime,jdbcType=TIMESTAMP},
-      Remark = #{remark,jdbcType=VARCHAR}
+    set SiteCode      = #{siteCode,jdbcType=VARCHAR},
+        RegionCode    = #{regionCode,jdbcType=VARCHAR},
+        StreetCode    = #{streetCode,jdbcType=VARCHAR},
+        DetailAddress = #{detailAddress,jdbcType=VARCHAR},
+        SiteX         = #{siteX,jdbcType=VARCHAR},
+        SiteY         = #{siteY,jdbcType=VARCHAR},
+        SiteLongitude = #{siteLongitude,jdbcType=DOUBLE},
+        SiteLatitude  = #{siteLatitude,jdbcType=DOUBLE},
+        SiteName      = #{siteName,jdbcType=VARCHAR},
+        FzrName       = #{fzrName,jdbcType=VARCHAR},
+        FzrMobile     = #{fzrMobile,jdbcType=VARCHAR},
+        CreateUserID  = #{createUserID,jdbcType=VARCHAR},
+        CreateTime    = #{createTime,jdbcType=TIMESTAMP},
+        ModifyUserID  = #{modifyUserID,jdbcType=VARCHAR},
+        ModifyTime    = #{modifyTime,jdbcType=TIMESTAMP},
+        Remark        = #{remark,jdbcType=VARCHAR}
     where SiteID = #{siteID,jdbcType=VARCHAR}
   </update>
 </mapper>

+ 19 - 5
vue/src/views/baseSettings/siteInfo/edit.vue

@@ -59,13 +59,27 @@
           </a-form-item>
         </a-col>
         <a-col :span="8">
-          <a-form-item label="驿站坐标"  name="sitePosition" :label-col="{span:7}" :rules="[{ required: true, message: '请选择驿站坐标!' }]">
-            <label v-if="opCategory==3">{{dataModel.sitePosition}}</label>
-            <a-input v-model:value="dataModel.sitePosition" placeholder=""/>
+          <a-form-item label="经度"  name="siteLongitude" :label-col="{span:7}" :rules="[{ required: true, message: '请输入经度!' }]">
+            <label v-if="opCategory==3">{{dataModel.siteLongitude }}</label>
+            <a-input-number style="width: 100%" :controls="false" v-model:value="dataModel.siteLongitude" placeholder=""/>
           </a-form-item>
         </a-col>
-        <a-col :span="1">
-            <a-button type="primary"  @click='' >选择</a-button>
+<!--        <a-col :span="8">-->
+<!--          <a-form-item label="驿站坐标"  name="sitePosition" :label-col="{span:7}" :rules="[{ required: true, message: '请选择驿站坐标!' }]">-->
+<!--            <label v-if="opCategory==3">{{dataModel.sitePosition}}</label>-->
+<!--            <a-input v-model:value="dataModel.sitePosition" placeholder=""/>-->
+<!--          </a-form-item>-->
+<!--        </a-col>-->
+<!--        <a-col :span="1">-->
+<!--            <a-button type="primary"  @click='' >选择</a-button>-->
+<!--        </a-col>-->
+      </a-row>
+      <a-row type="flex">
+        <a-col :span="7">
+          <a-form-item label="纬度"  name="siteLatitude" :label-col="{span:7}" :rules="[{ required: true, message: '请输入站点负责人!' }]">
+            <label v-if="opCategory==3">{{dataModel.siteLatitude }}</label>
+            <a-input-number style="width: 100%" :controls="false" v-model:value="dataModel.siteLatitude" placeholder=""/>
+          </a-form-item>
         </a-col>
       </a-row>
 <!--      <a-divider orientation="left">管理人员 共计:{{manageUsers.length}}</a-divider>