Jelajahi Sumber

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	aidex-admin/src/main/resources/application.yml
ChenSir 1 tahun lalu
induk
melakukan
fc8d7c3ebe

+ 6 - 6
aidex-admin/src/main/resources/application-druid.yml

@@ -6,12 +6,12 @@ spring:
         druid:
             # 主库数据源
             master:
-                url: jdbc:mysql://152.136.217.148:3306/water_bus?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&&allowMultiQueries=true
-                username: site
-                password: admin@2022.cn
-#                url: jdbc:mysql://192.168.0.116:3306/water_bus?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&&allowMultiQueries=true
-#                username: root
-#                password: Gshk@ssbs@8551398
+#                url: jdbc:mysql://152.136.217.148:3306/water_bus?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&&allowMultiQueries=true
+#                username: site
+#                password: admin@2022.cn
+                url: jdbc:mysql://192.168.0.116:3306/water_bus?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&&allowMultiQueries=true
+                username: root
+                password: Gshk@ssbs@8551398
             # 从库数据源
             slave:
                 # 从数据源开关/默认关闭

+ 5 - 5
aidex-admin/src/main/resources/application.yml

@@ -72,11 +72,11 @@ spring:
     # 地址
     host: 127.0.0.1
     # 端口,默认为6379
-    port: 16379
+    port: 6379
     # 数据库索引
     database: 0
     # 密码
-    #password: 12345678
+#    password: 12345678
     # 连接超时时间
     timeout: 10s
     lettuce:
@@ -123,7 +123,7 @@ pagehelper:
 # Swagger配置
 swagger:
   # 是否开启swagger
-  enabled: true
+  enabled: false
   # 请求前缀
   pathMapping: /api
 
@@ -138,8 +138,8 @@ xss:
 
 wx:
   miniapp:
-    appid: wx43371b1687d52c06    #微信小程序的appid
-    secret: 98444ae0dfb97e12eb262bea10a5fbd5  #微信小程序的Secret
+    appid: wx89863f6cc3943d04 #微信小程序的appid
+    secret: 1d8a4519dd92e626e183c4c7e2dad14e  #微信小程序的Secret
     msgDataFormat: JSON
     token:
     aesKey:

+ 10 - 5
aidex-system/src/main/java/com/aidex/common/app/server/impl/AppService.java

@@ -115,19 +115,24 @@ public class AppService implements IAppService {
         Integer inStopTime = Integer.valueOf(ConfigUtils.getConfigByKey("pull.in.time").getConfigValue());
         // 停靠速度
         Integer stopSpeed = Integer.valueOf(ConfigUtils.getConfigByKey("stop.speed").getConfigValue());
+        // 停靠误差范围
+        Integer stopRadius = Integer.valueOf(ConfigUtils.getConfigByKey("stop.ship.radius").getConfigValue());
 
         // 查找未经过该站点的船只
         SysShipExtendVO noSiteShip = null;
         for (SysShipExtendVO sysShipExtendVO : sysShipExtendVOS) {
-            if(direction && CalcDist.gps2d(Double.valueOf(wharf.getLat()),Double.valueOf(wharf.getLng()),Double.valueOf(sysShipExtendVO.getLat()),Double.valueOf(sysShipExtendVO.getLon())) <= 0){
+            if(direction && CalcDist.gps2d(Double.valueOf(wharf.getLat()),Double.valueOf(wharf.getLng()),Double.valueOf(sysShipExtendVO.getLat()),Double.valueOf(sysShipExtendVO.getLon())) <= Double.valueOf(stopRadius)){
                 noSiteShip = sysShipExtendVO;
                 break;
             }
-            if(!direction && CalcDist.gps2d(Double.valueOf(sysShipExtendVO.getLat()),Double.valueOf(sysShipExtendVO.getLon()),Double.valueOf(wharf.getLat()),Double.valueOf(wharf.getLng())) <= 0){
+            if(!direction && CalcDist.gps2d(Double.valueOf(sysShipExtendVO.getLat()),Double.valueOf(sysShipExtendVO.getLon()),Double.valueOf(wharf.getLat()),Double.valueOf(wharf.getLng())) <= Double.valueOf(stopRadius)){
                 noSiteShip = sysShipExtendVO;
                 break;
             }
         }
+
+
+
         if(noSiteShip == null)
             throw new SysException(8221,"当前运行船只已全部经过该站点!暂无船只!请等待发船");
         SysShipResVO sysShipResVO = new SysShipResVO();
@@ -136,11 +141,11 @@ public class AppService implements IAppService {
         sysShipResVO.setMy(wharf);
 
         Long defaultSpeed = 0L;
-        if(sysShipResVO.getTravel() == 1L)
+        if(sysShipResVO.getTravel() == 1L) {
             defaultSpeed = Long.valueOf(ConfigUtils.getConfigByKey("forward.default.speed").getConfigValue());
-        else
+        }else {
             defaultSpeed = Long.valueOf(ConfigUtils.getConfigByKey("reverse.default.speed").getConfigValue());
-
+        }
         // 停靠时间
         Long awaitTime = 0L;
         Double stopDist = 0.0;

+ 1 - 1
aidex-system/src/main/java/com/aidex/common/plush/mapper/SysShipExtendMapper.xml

@@ -158,7 +158,7 @@
 
     <update id="updateByShip">
         UPDATE sys_ship_extend SET
-       mac_id = #{macId},
+       mac_id = #{macId}
        WHERE id = #{macId}
     </update>
 

+ 6 - 4
aidex-system/src/main/java/com/aidex/system/mapper/SysShipMapper.xml

@@ -198,12 +198,14 @@
             update_ip = #{updateIp},
             version = version + 1
         WHERE id = #{id} and version = #{version}
+
     </update>
 
+
+<!--  由于定时请求频繁修改数据Version  手动修改无法做到避免重复修改 固注释  version = version + 1-->
     <update id="updateStatus">
         UPDATE sys_ship SET
-            status = #{status},
-            version = version + 1
+            status = #{status}
         WHERE id = #{id}
     </update>
 
@@ -213,10 +215,10 @@
         WHERE id = #{id}
     </update>
 
+    <!--  由于定时请求频繁修改数据Version  手动修改无法做到避免重复修改 固注释  version = version + 1-->
     <update id="updateStatusByMacId">
         UPDATE sys_ship SET
-            status = #{status},
-            version = version + 1
+            status = #{status}
         WHERE ship_num = #{macId}
     </update>
 

+ 3 - 1
aidex-system/src/main/java/com/aidex/system/service/impl/SysShipServiceImpl.java

@@ -90,12 +90,14 @@ public class SysShipServiceImpl extends BaseServiceImpl<SysShipMapper, SysShip>
         BeanUtils.copyProperties(sysShip,shipVo);
         SysShip ship = new SysShip();
         BeanUtils.copyProperties(sysShip,ship);
+        if(StringUtils.isEmpty(ship.getRemark()))
+            ship.setRemark("");
         if(super.save(ship)) {
             SysShipExtend shipExtend = new SysShipExtend();
             shipExtend.setShipId(sysShip.getId());
             shipExtend.setId(sysShip.getId());
             shipExtend.setMacId(sysShip.getShipNum());
-            shipExtend.setDir((!StringUtils.isEmpty(shipVo.getTravel()) || shipVo.getTravel().equals("1"))?"100":"270");
+            shipExtend.setDir((StringUtils.isEmpty(shipVo.getTravel()) || shipVo.getTravel().equals("1"))?"100":"270");
             shipExtend.setIsStop(1L);
             shipExtend.setLat(!StringUtils.isEmpty(sysShip.getLat())?sysShip.getLat():"36.077395");
             shipExtend.setLon(!StringUtils.isEmpty(sysShip.getLng())?sysShip.getLng():"103.863987");

+ 2 - 2
aidex-ui/src/views/system/sysship/modules/SysShipEditForm.vue

@@ -40,7 +40,7 @@
               <a-input v-model="form.lng" placeholder="请输入当前维度"/>
             </a-form-model-item>
           </a-col>
-          <a-col :span="12">
+          <!-- <a-col :span="12">
             <a-form-model-item label="默认停靠码头" prop="wharf">
               <a-select v-model="form.wharf" placeholder="请选择默认停靠码头">
                 <a-select-option v-for="item in wharfList" :value="item.id" :key="item.id">{{ item.wharfNanme }}</a-select-option>
@@ -53,7 +53,7 @@
                 <a-select-option v-for="item in travelList" :value="item.id" :key="item.id">{{ item.name }}</a-select-option>
               </a-select>
             </a-form-model-item>
-          </a-col>
+          </a-col> -->
           <a-col :span="12" >
             <a-form-model-item label="船只在线状态" prop="status">
               <a-radio-group v-model="form.status">