张延森 2 years ago
parent
commit
7ca485f384

+ 1
- 1
pom.xml View File

10
 	</parent>
10
 	</parent>
11
 	<groupId>com.njyunzhi</groupId>
11
 	<groupId>com.njyunzhi</groupId>
12
 	<artifactId>nanyang</artifactId>
12
 	<artifactId>nanyang</artifactId>
13
-	<version>0.0.1-hatc</version>
13
+	<version>0.0.2-hatc</version>
14
 	<name>hatc-api</name>
14
 	<name>hatc-api</name>
15
 	<description>海康接口</description>
15
 	<description>海康接口</description>
16
 	<properties>
16
 	<properties>

+ 2
- 0
src/main/java/com/njyunzhi/nanyang/mapper/TaMachineryGpsMapper.java View File

3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
 import com.njyunzhi.nanyang.entity.TaMachineryGps;
4
 import com.njyunzhi.nanyang.entity.TaMachineryGps;
5
 import org.apache.ibatis.annotations.Mapper;
5
 import org.apache.ibatis.annotations.Mapper;
6
+import org.apache.ibatis.annotations.Param;
6
 
7
 
7
 /**
8
 /**
8
  * <p>
9
  * <p>
15
 @Mapper
16
 @Mapper
16
 public interface TaMachineryGpsMapper extends BaseMapper<TaMachineryGps> {
17
 public interface TaMachineryGpsMapper extends BaseMapper<TaMachineryGps> {
17
 
18
 
19
+    int updateMachineryLoc(@Param("terminalID") String terminalID, @Param("lat") String lat, @Param("lng") String lng);
18
 }
20
 }

+ 1
- 0
src/main/java/com/njyunzhi/nanyang/service/impl/TdHatcDeviceServiceImpl.java View File

162
                             taMachineryGps.setGpsData(gpsJsonData);
162
                             taMachineryGps.setGpsData(gpsJsonData);
163
                             taMachineryGps.setCreateDate(LocalDateTime.now());
163
                             taMachineryGps.setCreateDate(LocalDateTime.now());
164
                             taMachineryGpsMapper.insert(taMachineryGps);
164
                             taMachineryGpsMapper.insert(taMachineryGps);
165
+                            taMachineryGpsMapper.updateMachineryLoc(terminalID, taMachineryGps.getLat(), taMachineryGps.getLng());
165
                         }
166
                         }
166
             });
167
             });
167
             System.out.println("根据ProductKey订阅GPS结果:" + JSON.toJSONString(subscribeGPSResult));
168
             System.out.println("根据ProductKey订阅GPS结果:" + JSON.toJSONString(subscribeGPSResult));

+ 7
- 0
src/main/resources/application.yml View File

14
   cmsPort: 14000
14
   cmsPort: 14000
15
   hatcAccount: D_SUB_HNYJ_1650285541603
15
   hatcAccount: D_SUB_HNYJ_1650285541603
16
   hatcSecret: GZm32ONkokYVtMum
16
   hatcSecret: GZm32ONkokYVtMum
17
+
18
+###
19
+mybatis-plus:
20
+  configuration:
21
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
22
+    call-setters-on-nulls: true
23
+  mapper-locations: classpath:mapper/**/*.xml

+ 7
- 0
src/main/resources/mapper/TaMachineryGpsMapper.xml View File

2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
 <mapper namespace="com.njyunzhi.nanyang.mapper.TaMachineryGpsMapper">
3
 <mapper namespace="com.njyunzhi.nanyang.mapper.TaMachineryGpsMapper">
4
 
4
 
5
+    <update id="updateMachineryLoc">
6
+        UPDATE ta_machinery t
7
+            INNER JOIN td_device s ON t.machinery_id = s.machinery_id
8
+            SET t.location = CONCAT( #{lng}, ',', #{lat} )
9
+        WHERE
10
+            s.device_no = #{terminalID}
11
+    </update>
5
 </mapper>
12
 </mapper>