From 4b5d0c06baa6542c7d9acde19e97b90232da0c88 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期二, 20 四月 2021 09:42:42 +0800
Subject: [PATCH] 1. 新增获取工业企业信息接口; 2. 调整获取数据接口的结果按照时间升序排列; 3. 新增获取给定时间之后的数据的接口;

---
 src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/CompanyServiceImpl.kt      |   16 
 src/main/kotlin/com/flightfeather/uav/domain/entity/Company.java                         |  915 ++++++++++++++++++++++++++++++++++++++
 src/main/kotlin/com/flightfeather/uav/common/utils/ExcelUtil.kt                          |  157 ++++++
 src/main/kotlin/com/flightfeather/uav/lightshare/web/RealTimeDataController.kt           |    8 
 src/main/kotlin/com/flightfeather/uav/common/utils/FileExchange.kt                       |  176 +++++++
 src/main/kotlin/com/flightfeather/uav/lightshare/service/RealTimeDataService.kt          |    2 
 pom.xml                                                                                  |   59 +
 src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/CompanyServiceImplTest.kt  |   24 +
 src/test/kotlin/com/flightfeather/uav/Test.kt                                            |    6 
 src/main/kotlin/com/flightfeather/uav/domain/mapper/CompanyMapper.kt                     |    8 
 src/main/kotlin/com/flightfeather/uav/lightshare/service/CompanyService.kt               |   10 
 src/main/kotlin/com/flightfeather/uav/lightshare/web/CompanyController.kt                |   14 
 src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/RealTimeDataServiceImpl.kt |   31 +
 src/main/resources/application.yml                                                       |    6 
 14 files changed, 1,404 insertions(+), 28 deletions(-)

diff --git a/pom.xml b/pom.xml
index 3f610f5..4e9ea76 100644
--- a/pom.xml
+++ b/pom.xml
@@ -116,35 +116,48 @@
             <artifactId>spring-boot-starter-log4j2</artifactId>
         </dependency>
 
+        <!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi</artifactId>
+            <version>4.1.2</version>
+        </dependency>
+
+        <!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>1.2.75</version>
+        </dependency>
     </dependencies>
 
     <build>
         <sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
         <testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
         <plugins>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-            </plugin>
-            <plugin>
-                <groupId>org.jetbrains.kotlin</groupId>
-                <artifactId>kotlin-maven-plugin</artifactId>
-                <configuration>
-                    <args>
-                        <arg>-Xjsr305=strict</arg>
-                    </args>
-                    <compilerPlugins>
-                        <plugin>spring</plugin>
-                    </compilerPlugins>
-                </configuration>
-                <dependencies>
-                    <dependency>
-                        <groupId>org.jetbrains.kotlin</groupId>
-                        <artifactId>kotlin-maven-allopen</artifactId>
-                        <version>${kotlin.version}</version>
-                    </dependency>
-                </dependencies>
-            </plugin>
+<!--            <plugin>-->
+<!--                <groupId>org.springframework.boot</groupId>-->
+<!--                <artifactId>spring-boot-maven-plugin</artifactId>-->
+<!--            </plugin>-->
+<!--            <plugin>-->
+<!--                <groupId>org.jetbrains.kotlin</groupId>-->
+<!--                <artifactId>kotlin-maven-plugin</artifactId>-->
+<!--                <configuration>-->
+<!--                    <args>-->
+<!--                        <arg>-Xjsr305=strict</arg>-->
+<!--                    </args>-->
+<!--                    <compilerPlugins>-->
+<!--                        <plugin>spring</plugin>-->
+<!--                    </compilerPlugins>-->
+<!--                </configuration>-->
+<!--                <dependencies>-->
+<!--                    <dependency>-->
+<!--                        <groupId>org.jetbrains.kotlin</groupId>-->
+<!--                        <artifactId>kotlin-maven-allopen</artifactId>-->
+<!--                        <version>${kotlin.version}</version>-->
+<!--                    </dependency>-->
+<!--                </dependencies>-->
+<!--            </plugin>-->
             <!-- mybatis generator 鑷姩鐢熸垚浠g爜鎻掍欢 -->
             <plugin>
                 <groupId>org.mybatis.generator</groupId>
diff --git a/src/main/kotlin/com/flightfeather/uav/common/utils/ExcelUtil.kt b/src/main/kotlin/com/flightfeather/uav/common/utils/ExcelUtil.kt
new file mode 100644
index 0000000..0d41d40
--- /dev/null
+++ b/src/main/kotlin/com/flightfeather/uav/common/utils/ExcelUtil.kt
@@ -0,0 +1,157 @@
+package com.flightfeather.uav.common.utils
+
+import org.apache.poi.hssf.usermodel.HSSFWorkbook
+import org.apache.poi.ss.util.CellRangeAddress
+import java.time.LocalDate
+import java.util.*
+import kotlin.math.max
+
+/**
+ * @author riku
+ * Date: 2020/6/12
+ */
+object ExcelUtil {
+
+    class MyCell(
+            var text: String,
+            var rowSpan: Int = 1
+    )
+
+    /**
+     * 鑷姩澶勭悊琛屽悎骞舵暟鎹�
+     */
+    fun write2(heads: List<String>, contents: List<Array<Any>>, workbook: HSSFWorkbook, sheetName:String) {
+
+        val sheet = workbook.createSheet(sheetName)
+
+        var rowIndex = 0
+
+        if (heads.isNotEmpty()) {
+            val rows = sheet.createRow(rowIndex)
+            for (i in 0 until heads.size) {
+                rows.createCell(i).setCellValue(heads[i])
+            }
+            rowIndex++
+        }
+
+        contents.forEach {
+            val maxRow = getMaxRows(it)
+
+            var rows = sheet.getRow(rowIndex) ?: sheet.createRow(rowIndex)
+
+            val arrayMap = mutableMapOf<Int, Array<*>>()
+
+            for (i in it.indices) {
+                val cell = it[i]
+
+                var rowspan = maxRow//鍚堝苟鐨勮鐨勮法搴�
+
+                val c =
+                        if (cell is Array<*>) {
+                            //褰撴暟鎹负鏁扮粍鏃讹紝闇�瑕佹牴鎹渶澶ц鏁伴噸鏂拌绠楄鍗曞厓鏍肩殑琛岃法搴�
+                            arrayMap[i] = cell
+                            rowspan = maxRow / if (cell.size == 0) 1 else cell.size
+                            val c = cell[0]
+                            if (c is MyCell) {
+                                rowspan = c.rowSpan
+                            }
+                            if (rowspan > 1) {
+                                println("鍚堝苟1-1锛�$rowIndex;${rowIndex + rowspan - 1};$i")
+                                sheet.addMergedRegion(CellRangeAddress(rowIndex, rowIndex + rowspan - 1, i, i))
+                            }
+                            if (cell.isEmpty()) {
+                                ""
+                            } else {
+                                cell[0]
+                            }
+                        } else {
+                            //褰撴暟鎹笉鏄暟缁勬椂锛岄渶瑕佹寜鏈�澶ц鏁板悎骞跺崟鍏冩牸
+                            if (rowspan > 1) {
+                                println("鍚堝苟1-2锛�$rowIndex;${rowIndex + rowspan - 1};$i")
+                                sheet.addMergedRegion(CellRangeAddress(rowIndex, rowIndex + rowspan - 1, i, i))
+                            }
+                            cell
+                        }
+                when (c) {
+                    is MyCell -> {
+                        rows.createCell(i).setCellValue(c.text)
+                        println("write1-1: ${c.text};($rowIndex, ${i})")
+                    }
+                    is String -> {
+                        rows.createCell(i).setCellValue(c)
+                        println("write1-2: ${c};($rowIndex, ${i})")
+                    }
+                    is Double -> rows.createCell(i).setCellValue(c)
+                    is Boolean -> rows.createCell(i).setCellValue(c)
+                    is Date -> rows.createCell(i).setCellValue(c)
+                    is Calendar -> rows.createCell(i).setCellValue(c)
+                    is LocalDate -> rows.createCell(i).setCellValue(c)
+                }
+            }
+
+            for (i in 1 until maxRow) {
+                rowIndex++
+                arrayMap.forEach { map ->
+                    rows = sheet.getRow(rowIndex) ?: sheet.createRow(rowIndex)
+                    val array = map.value
+                    if (i < array.size) {
+//                        var rowspan = maxRow / array.size
+                        var lastRowSpan = 1
+                        var rowspan = 1
+                        val c = array[i]
+                        if (c is MyCell) {
+                            rowspan = c.rowSpan
+                        }
+                        val _c = array[i-1]
+                        if (_c is MyCell) {
+                            lastRowSpan = _c.rowSpan
+                        }
+                        var _rowIndex = rowIndex
+                        var index = rowIndex
+                        if (lastRowSpan > 1) {
+                            index = rowIndex + (i * lastRowSpan) - 1
+                            _rowIndex = index
+                            rows = sheet.getRow(_rowIndex) ?: sheet.createRow(_rowIndex)
+                        }
+                        if (rowspan > 1) {
+                            println("鍚堝苟2锛�${index};${index + rowspan - 1};$i")
+                            sheet.addMergedRegion(CellRangeAddress(index, index + rowspan - 1, i, i))
+                        }
+
+                        when (c) {
+                            is MyCell -> {
+                                rows.createCell(map.key).setCellValue(c.text)
+                                println("write2-1: ${c.text};($_rowIndex, ${map.key})")
+                            }
+                            is String -> {
+                                rows.createCell(map.key).setCellValue(c)
+                                println("write2-2: ${c};($_rowIndex, ${map.key})")
+                            }
+                            is Double -> rows.createCell(map.key).setCellValue(c)
+                            is Boolean -> rows.createCell(map.key).setCellValue(c)
+                            is Date -> rows.createCell(map.key).setCellValue(c)
+                            is Calendar -> rows.createCell(map.key).setCellValue(c)
+                            is LocalDate -> rows.createCell(map.key).setCellValue(c)
+                        }
+                    }
+                }
+            }
+
+            rowIndex++
+        }
+//        workbook.write(out)
+//        workbook.close()
+//        out.flush()
+//        out.close()
+    }
+
+    private fun getMaxRows(rowArray: Array<Any>): Int {
+        var maxRows = 1
+        rowArray.forEach {
+            if (it is Array<*>) {
+                maxRows = max(it.size, maxRows)
+            }
+        }
+        return maxRows
+    }
+}
\ No newline at end of file
diff --git a/src/main/kotlin/com/flightfeather/uav/common/utils/FileExchange.kt b/src/main/kotlin/com/flightfeather/uav/common/utils/FileExchange.kt
new file mode 100644
index 0000000..b282399
--- /dev/null
+++ b/src/main/kotlin/com/flightfeather/uav/common/utils/FileExchange.kt
@@ -0,0 +1,176 @@
+package com.flightfeather.uav.common.utils
+
+import com.alibaba.fastjson.JSONObject
+import com.flightfeather.uav.socket.bean.AirData
+import org.apache.poi.hssf.usermodel.HSSFWorkbook
+import java.io.File
+import java.io.FileInputStream
+import java.io.FileOutputStream
+import java.text.SimpleDateFormat
+import java.util.*
+
+class FileExchange {
+
+    companion object {
+        private const val TMP = "65536"
+        private const val SPCOND = "65548"
+        private const val TUR = "65702"
+        private const val DO = "65542"
+        private const val PH = "65558"
+
+        private val format = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
+    }
+
+    fun doTask() {
+        //source
+        val path = "E:\\宸ヤ綔\\閲戝北璧拌埅\\MissionData.xls"
+        val workbook = HSSFWorkbook(FileInputStream(path))
+        val sheet = workbook.getSheetAt(0)
+
+        //target
+        val fileName = "鏃犱汉鑸规暟鎹�.xls"
+        val filePath = "e:/$fileName"
+        val out = FileOutputStream(File(filePath))
+
+        val heads = listOf("鏃堕棿", "缁忓害", "绾害", "Temperature(掳C)", "spCond(uS/cm)", "Turbidity(NTU)", "DO(mg/L)", "PH")
+        val contents = mutableListOf<Array<Any>>()
+
+        val lastRow = mutableListOf<Any>()
+        for (i in 1 until sheet.lastRowNum) {
+            val row = sheet.getRow(i)
+            val time = row.getCell(2).numericCellValue.toLong() * 1000
+            val lat = row.getCell(4).numericCellValue
+            val lng = row.getCell(5).numericCellValue
+            val value = row.getCell(6).stringCellValue
+
+            val cList = mutableListOf<Any>()
+            //鏃堕棿
+            val date = Date(time)
+            val d = format.format(date)
+            cList.add(d)
+            //缁忓害
+            cList.add(lng)
+            cList.add(lat)
+            //
+            val jO = JSONObject.parseObject(value)
+            cList.add((jO[TMP] ?: "0").toString())
+            cList.add((jO[SPCOND] ?: "0").toString())
+            cList.add((jO[TUR] ?: "0").toString())
+            cList.add((jO[DO] ?: "0").toString())
+            cList.add((jO[PH] ?: "0").toString())
+
+//            if (lastRow.isEmpty()) {
+//                lastRow.addAll(cList)
+//            } else {
+//                for (i in cList.indices) {
+//                    if (cList[i] == "") {
+//                        cList[i] = lastRow[i]
+//                    }
+//                }
+//                lastRow.clear()
+//                lastRow.addAll(cList)
+//            }
+
+            contents.add(cList.toTypedArray())
+        }
+
+
+        val newWorkBook = HSSFWorkbook()
+        ExcelUtil.write2(heads, contents, newWorkBook, "data")
+
+        newWorkBook.write(out)
+        newWorkBook.close()
+        workbook.close()
+        out.flush()
+        out.close()
+    }
+
+    fun doTask2() {
+        //source
+        val path = "E:\\宸ヤ綔\\閲戝北璧拌埅\\鏃犱汉鑸规暟鎹�-琛ュ厖绌虹櫧鍊�.xls"
+        val workbook = HSSFWorkbook(FileInputStream(path))
+        val sheet = workbook.getSheetAt(0)
+
+        //target
+        val fileName = "鏃犱汉鑸硅蛋鑸暟鎹�.xls"
+        val filePath = "e:/$fileName"
+        val out = FileOutputStream(File(filePath))
+
+        val heads = listOf("id", "device_code", "latitude", "longitude", "altitude", "height", "factors", "data_time", "create_time")
+        val contents = mutableListOf<Array<Any>>()
+
+        for (i in 1..sheet.lastRowNum) {
+            val row = sheet.getRow(i)
+            val deviceCode = "0c"
+            val latitude = row.getCell(2).numericCellValue
+            val longitude = row.getCell(1).numericCellValue
+            val altitude = ""
+            val height = ""
+            val dataTime = row.getCell(0).stringCellValue
+            val createTime = dataTime
+
+            val factorsList = mutableListOf<AirData>()
+            val tmp = row.getCell(3).numericCellValue
+            val spC = row.getCell(4).numericCellValue
+            val tur = row.getCell(5).numericCellValue
+            val dO = row.getCell(6).numericCellValue
+            val ph = row.getCell(7).numericCellValue
+
+            factorsList.apply {
+                add(AirData().apply {
+                    factorId = "1"
+                    factorName = "TMP"
+                    factorData = tmp
+                    physicalQuantity = 0.0
+                })
+                add(AirData().apply {
+                    factorId = "2"
+                    factorName = "spC"
+                    factorData = spC
+                    physicalQuantity = 0.0
+                })
+                add(AirData().apply {
+                    factorId = "3"
+                    factorName = "tur"
+                    factorData = tur
+                    physicalQuantity = 0.0
+                })
+                add(AirData().apply {
+                    factorId = "4"
+                    factorName = "DO"
+                    factorData = dO
+                    physicalQuantity = 0.0
+                })
+                add(AirData().apply {
+                    factorId = "5"
+                    factorName = "PH"
+                    factorData = ph
+                    physicalQuantity = 0.0
+                })
+            }
+
+            val factors = JSONObject.toJSON(factorsList).toString()
+            val cList = mutableListOf<Any>()
+            cList.add("")
+            cList.add(deviceCode)
+            cList.add(latitude)
+            cList.add(longitude)
+            cList.add(altitude)
+            cList.add(height)
+            cList.add(factors)
+            cList.add(dataTime)
+            cList.add(createTime)
+
+            contents.add(cList.toTypedArray())
+        }
+
+        val newWorkBook = HSSFWorkbook()
+        ExcelUtil.write2(heads, contents, newWorkBook, "data")
+
+        newWorkBook.write(out)
+        newWorkBook.close()
+        workbook.close()
+        out.flush()
+        out.close()
+    }
+}
\ No newline at end of file
diff --git a/src/main/kotlin/com/flightfeather/uav/domain/entity/Company.java b/src/main/kotlin/com/flightfeather/uav/domain/entity/Company.java
new file mode 100644
index 0000000..11b103c
--- /dev/null
+++ b/src/main/kotlin/com/flightfeather/uav/domain/entity/Company.java
@@ -0,0 +1,915 @@
+package com.flightfeather.uav.domain.entity;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+import javax.persistence.Column;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Table(name = "ea_companyinfo")
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class Company {
+    @Id
+    @Column(name = "CI_GUID")
+    private String ciGuid;
+
+    /**
+     * 鍗曚綅鍚嶇О
+     */
+    @Column(name = "CI_Name")
+    private String ciName;
+
+    /**
+     * 涓昏浠庝簨涓氬姟
+     */
+    @Column(name = "CI_Main_Business")
+    private String ciMainBusiness;
+
+    /**
+     * 鎵�灞為泦鍥�
+     */
+    @Column(name = "CI_Member_Group")
+    private String ciMemberGroup;
+
+    /**
+     * 鐪佷唤缂栫爜
+     */
+    @Column(name = "CI_Province_Code")
+    private String ciProvinceCode;
+
+    /**
+     * 鐪佷唤鍚嶇О
+     */
+    @Column(name = "CI_Province_Name")
+    private String ciProvinceName;
+
+    /**
+     * 鍦板競缂栫爜
+     */
+    @Column(name = "CI_City_Code")
+    private String ciCityCode;
+
+    /**
+     * 鍦板競鍚嶇О
+     */
+    @Column(name = "CI_City_Name")
+    private String ciCityName;
+
+    /**
+     * 鍖哄幙缂栧彿
+     */
+    @Column(name = "CI_District_Code")
+    private String ciDistrictCode;
+
+    /**
+     * 鍖哄幙鍚嶇О
+     */
+    @Column(name = "CI_District_Name")
+    private String ciDistrictName;
+
+    /**
+     * 琛楅晣缂栫爜
+     */
+    @Column(name = "CI_Town_Code")
+    private String ciTownCode;
+
+    /**
+     * 琛楅晣鍚嶇О
+     */
+    @Column(name = "CI_Town_Name")
+    private String ciTownName;
+
+    /**
+     * 鎵�鍦ㄥ伐涓氬尯
+     */
+    @Column(name = "CI_Ind_District")
+    private String ciIndDistrict;
+
+    /**
+     * 鍗曚綅鍦板潃
+     */
+    @Column(name = "CI_Address")
+    private String ciAddress;
+
+    /**
+     * 涓績缁忓害
+     */
+    @Column(name = "CI_Longitude")
+    private BigDecimal ciLongitude;
+
+    /**
+     * 涓績绾害
+     */
+    @Column(name = "CI_Latitude")
+    private BigDecimal ciLatitude;
+
+    /**
+     * 缁勭粐鏈烘瀯浠g爜
+     */
+    @Column(name = "CI_Org_Code")
+    private String ciOrgCode;
+
+    /**
+     * 娉曚汉
+     */
+    @Column(name = "CI_Juridical_Person")
+    private String ciJuridicalPerson;
+
+    /**
+     * 琛屼笟绫诲埆
+     */
+    @Column(name = "CI_Ind_Classification")
+    private String ciIndClassification;
+
+    /**
+     * 琛屼笟浠g爜
+     */
+    @Column(name = "CI_Industry_Code")
+    private String ciIndustryCode;
+
+    /**
+     * 鐧昏娉ㄥ唽绫诲瀷
+     */
+    @Column(name = "CI_Registration_Type")
+    private String ciRegistrationType;
+
+    /**
+     * 娉ㄥ唽璧勬湰锛堜竾鍏冿級
+     */
+    @Column(name = "CI_Registered_Capital")
+    private Integer ciRegisteredCapital;
+
+    /**
+     * 寤哄巶骞存湀
+     */
+    @Column(name = "CI_Build_Date")
+    private Date ciBuildDate;
+
+    /**
+     * 鏈�鏂版敼鎵╁缓骞存湀
+     */
+    @Column(name = "CI_Expansion_Date")
+    private Date ciExpansionDate;
+
+    /**
+     * 鑱屽伐浜烘暟
+     */
+    @Column(name = "CI_Workers_Number")
+    private Integer ciWorkersNumber;
+
+    /**
+     * 浼佷笟瑙勬ā
+     */
+    @Column(name = "CI_Scale")
+    private Byte ciScale;
+
+    /**
+     * 鍘嗘鐜瘎瀹℃壒骞存湀
+     */
+    @Column(name = "CI_Eia_Approval_Date")
+    private String ciEiaApprovalDate;
+
+    /**
+     * 鎺掓薄璁稿彲璇佺紪鍙�
+     */
+    @Column(name = "CI_Plt_Permit_Code")
+    private String ciPltPermitCode;
+
+    /**
+     * 鎺掓薄鏉冧氦鏄撴枃浠�
+     */
+    @Column(name = "CI_Trading_Files")
+    private String ciTradingFiles;
+
+    /**
+     * 閭斂缂栫爜
+     */
+    @Column(name = "CI_Postal_Code")
+    private String ciPostalCode;
+
+    /**
+     * 鑱旂郴浜哄鍚�
+     */
+    @Column(name = "CI_Contact_Name")
+    private String ciContactName;
+
+    /**
+     * 鑱旂郴鐢佃瘽
+     */
+    @Column(name = "CI_Telephone")
+    private String ciTelephone;
+
+    /**
+     * 鑱旂郴寰俊鍙�
+     */
+    @Column(name = "CI_Contacts_WX")
+    private String ciContactsWx;
+
+    /**
+     * 浼犵湡
+     */
+    @Column(name = "CI_Fax")
+    private String ciFax;
+
+    /**
+     * 鐢靛瓙閭
+     */
+    @Column(name = "CI_Email")
+    private String ciEmail;
+
+    @Column(name = "CI_Extension1")
+    private String ciExtension1;
+
+    @Column(name = "CI_Extension2")
+    private String ciExtension2;
+
+    @Column(name = "CI_Extension3")
+    private String ciExtension3;
+
+    @Column(name = "CI_Remark")
+    private String ciRemark;
+
+    /**
+     * @return CI_GUID
+     */
+    public String getCiGuid() {
+        return ciGuid;
+    }
+
+    /**
+     * @param ciGuid
+     */
+    public void setCiGuid(String ciGuid) {
+        this.ciGuid = ciGuid == null ? null : ciGuid.trim();
+    }
+
+    /**
+     * 鑾峰彇鍗曚綅鍚嶇О
+     *
+     * @return CI_Name - 鍗曚綅鍚嶇О
+     */
+    public String getCiName() {
+        return ciName;
+    }
+
+    /**
+     * 璁剧疆鍗曚綅鍚嶇О
+     *
+     * @param ciName 鍗曚綅鍚嶇О
+     */
+    public void setCiName(String ciName) {
+        this.ciName = ciName == null ? null : ciName.trim();
+    }
+
+    /**
+     * 鑾峰彇涓昏浠庝簨涓氬姟
+     *
+     * @return CI_Main_Business - 涓昏浠庝簨涓氬姟
+     */
+    public String getCiMainBusiness() {
+        return ciMainBusiness;
+    }
+
+    /**
+     * 璁剧疆涓昏浠庝簨涓氬姟
+     *
+     * @param ciMainBusiness 涓昏浠庝簨涓氬姟
+     */
+    public void setCiMainBusiness(String ciMainBusiness) {
+        this.ciMainBusiness = ciMainBusiness == null ? null : ciMainBusiness.trim();
+    }
+
+    /**
+     * 鑾峰彇鎵�灞為泦鍥�
+     *
+     * @return CI_Member_Group - 鎵�灞為泦鍥�
+     */
+    public String getCiMemberGroup() {
+        return ciMemberGroup;
+    }
+
+    /**
+     * 璁剧疆鎵�灞為泦鍥�
+     *
+     * @param ciMemberGroup 鎵�灞為泦鍥�
+     */
+    public void setCiMemberGroup(String ciMemberGroup) {
+        this.ciMemberGroup = ciMemberGroup == null ? null : ciMemberGroup.trim();
+    }
+
+    /**
+     * 鑾峰彇鐪佷唤缂栫爜
+     *
+     * @return CI_Province_Code - 鐪佷唤缂栫爜
+     */
+    public String getCiProvinceCode() {
+        return ciProvinceCode;
+    }
+
+    /**
+     * 璁剧疆鐪佷唤缂栫爜
+     *
+     * @param ciProvinceCode 鐪佷唤缂栫爜
+     */
+    public void setCiProvinceCode(String ciProvinceCode) {
+        this.ciProvinceCode = ciProvinceCode == null ? null : ciProvinceCode.trim();
+    }
+
+    /**
+     * 鑾峰彇鐪佷唤鍚嶇О
+     *
+     * @return CI_Province_Name - 鐪佷唤鍚嶇О
+     */
+    public String getCiProvinceName() {
+        return ciProvinceName;
+    }
+
+    /**
+     * 璁剧疆鐪佷唤鍚嶇О
+     *
+     * @param ciProvinceName 鐪佷唤鍚嶇О
+     */
+    public void setCiProvinceName(String ciProvinceName) {
+        this.ciProvinceName = ciProvinceName == null ? null : ciProvinceName.trim();
+    }
+
+    /**
+     * 鑾峰彇鍦板競缂栫爜
+     *
+     * @return CI_City_Code - 鍦板競缂栫爜
+     */
+    public String getCiCityCode() {
+        return ciCityCode;
+    }
+
+    /**
+     * 璁剧疆鍦板競缂栫爜
+     *
+     * @param ciCityCode 鍦板競缂栫爜
+     */
+    public void setCiCityCode(String ciCityCode) {
+        this.ciCityCode = ciCityCode == null ? null : ciCityCode.trim();
+    }
+
+    /**
+     * 鑾峰彇鍦板競鍚嶇О
+     *
+     * @return CI_City_Name - 鍦板競鍚嶇О
+     */
+    public String getCiCityName() {
+        return ciCityName;
+    }
+
+    /**
+     * 璁剧疆鍦板競鍚嶇О
+     *
+     * @param ciCityName 鍦板競鍚嶇О
+     */
+    public void setCiCityName(String ciCityName) {
+        this.ciCityName = ciCityName == null ? null : ciCityName.trim();
+    }
+
+    /**
+     * 鑾峰彇鍖哄幙缂栧彿
+     *
+     * @return CI_District_Code - 鍖哄幙缂栧彿
+     */
+    public String getCiDistrictCode() {
+        return ciDistrictCode;
+    }
+
+    /**
+     * 璁剧疆鍖哄幙缂栧彿
+     *
+     * @param ciDistrictCode 鍖哄幙缂栧彿
+     */
+    public void setCiDistrictCode(String ciDistrictCode) {
+        this.ciDistrictCode = ciDistrictCode == null ? null : ciDistrictCode.trim();
+    }
+
+    /**
+     * 鑾峰彇鍖哄幙鍚嶇О
+     *
+     * @return CI_District_Name - 鍖哄幙鍚嶇О
+     */
+    public String getCiDistrictName() {
+        return ciDistrictName;
+    }
+
+    /**
+     * 璁剧疆鍖哄幙鍚嶇О
+     *
+     * @param ciDistrictName 鍖哄幙鍚嶇О
+     */
+    public void setCiDistrictName(String ciDistrictName) {
+        this.ciDistrictName = ciDistrictName == null ? null : ciDistrictName.trim();
+    }
+
+    /**
+     * 鑾峰彇琛楅晣缂栫爜
+     *
+     * @return CI_Town_Code - 琛楅晣缂栫爜
+     */
+    public String getCiTownCode() {
+        return ciTownCode;
+    }
+
+    /**
+     * 璁剧疆琛楅晣缂栫爜
+     *
+     * @param ciTownCode 琛楅晣缂栫爜
+     */
+    public void setCiTownCode(String ciTownCode) {
+        this.ciTownCode = ciTownCode == null ? null : ciTownCode.trim();
+    }
+
+    /**
+     * 鑾峰彇琛楅晣鍚嶇О
+     *
+     * @return CI_Town_Name - 琛楅晣鍚嶇О
+     */
+    public String getCiTownName() {
+        return ciTownName;
+    }
+
+    /**
+     * 璁剧疆琛楅晣鍚嶇О
+     *
+     * @param ciTownName 琛楅晣鍚嶇О
+     */
+    public void setCiTownName(String ciTownName) {
+        this.ciTownName = ciTownName == null ? null : ciTownName.trim();
+    }
+
+    /**
+     * 鑾峰彇鎵�鍦ㄥ伐涓氬尯
+     *
+     * @return CI_Ind_District - 鎵�鍦ㄥ伐涓氬尯
+     */
+    public String getCiIndDistrict() {
+        return ciIndDistrict;
+    }
+
+    /**
+     * 璁剧疆鎵�鍦ㄥ伐涓氬尯
+     *
+     * @param ciIndDistrict 鎵�鍦ㄥ伐涓氬尯
+     */
+    public void setCiIndDistrict(String ciIndDistrict) {
+        this.ciIndDistrict = ciIndDistrict == null ? null : ciIndDistrict.trim();
+    }
+
+    /**
+     * 鑾峰彇鍗曚綅鍦板潃
+     *
+     * @return CI_Address - 鍗曚綅鍦板潃
+     */
+    public String getCiAddress() {
+        return ciAddress;
+    }
+
+    /**
+     * 璁剧疆鍗曚綅鍦板潃
+     *
+     * @param ciAddress 鍗曚綅鍦板潃
+     */
+    public void setCiAddress(String ciAddress) {
+        this.ciAddress = ciAddress == null ? null : ciAddress.trim();
+    }
+
+    /**
+     * 鑾峰彇涓績缁忓害
+     *
+     * @return CI_Longitude - 涓績缁忓害
+     */
+    public BigDecimal getCiLongitude() {
+        return ciLongitude;
+    }
+
+    /**
+     * 璁剧疆涓績缁忓害
+     *
+     * @param ciLongitude 涓績缁忓害
+     */
+    public void setCiLongitude(BigDecimal ciLongitude) {
+        this.ciLongitude = ciLongitude;
+    }
+
+    /**
+     * 鑾峰彇涓績绾害
+     *
+     * @return CI_Latitude - 涓績绾害
+     */
+    public BigDecimal getCiLatitude() {
+        return ciLatitude;
+    }
+
+    /**
+     * 璁剧疆涓績绾害
+     *
+     * @param ciLatitude 涓績绾害
+     */
+    public void setCiLatitude(BigDecimal ciLatitude) {
+        this.ciLatitude = ciLatitude;
+    }
+
+    /**
+     * 鑾峰彇缁勭粐鏈烘瀯浠g爜
+     *
+     * @return CI_Org_Code - 缁勭粐鏈烘瀯浠g爜
+     */
+    public String getCiOrgCode() {
+        return ciOrgCode;
+    }
+
+    /**
+     * 璁剧疆缁勭粐鏈烘瀯浠g爜
+     *
+     * @param ciOrgCode 缁勭粐鏈烘瀯浠g爜
+     */
+    public void setCiOrgCode(String ciOrgCode) {
+        this.ciOrgCode = ciOrgCode == null ? null : ciOrgCode.trim();
+    }
+
+    /**
+     * 鑾峰彇娉曚汉
+     *
+     * @return CI_Juridical_Person - 娉曚汉
+     */
+    public String getCiJuridicalPerson() {
+        return ciJuridicalPerson;
+    }
+
+    /**
+     * 璁剧疆娉曚汉
+     *
+     * @param ciJuridicalPerson 娉曚汉
+     */
+    public void setCiJuridicalPerson(String ciJuridicalPerson) {
+        this.ciJuridicalPerson = ciJuridicalPerson == null ? null : ciJuridicalPerson.trim();
+    }
+
+    /**
+     * 鑾峰彇琛屼笟绫诲埆
+     *
+     * @return CI_Ind_Classification - 琛屼笟绫诲埆
+     */
+    public String getCiIndClassification() {
+        return ciIndClassification;
+    }
+
+    /**
+     * 璁剧疆琛屼笟绫诲埆
+     *
+     * @param ciIndClassification 琛屼笟绫诲埆
+     */
+    public void setCiIndClassification(String ciIndClassification) {
+        this.ciIndClassification = ciIndClassification == null ? null : ciIndClassification.trim();
+    }
+
+    /**
+     * 鑾峰彇琛屼笟浠g爜
+     *
+     * @return CI_Industry_Code - 琛屼笟浠g爜
+     */
+    public String getCiIndustryCode() {
+        return ciIndustryCode;
+    }
+
+    /**
+     * 璁剧疆琛屼笟浠g爜
+     *
+     * @param ciIndustryCode 琛屼笟浠g爜
+     */
+    public void setCiIndustryCode(String ciIndustryCode) {
+        this.ciIndustryCode = ciIndustryCode == null ? null : ciIndustryCode.trim();
+    }
+
+    /**
+     * 鑾峰彇鐧昏娉ㄥ唽绫诲瀷
+     *
+     * @return CI_Registration_Type - 鐧昏娉ㄥ唽绫诲瀷
+     */
+    public String getCiRegistrationType() {
+        return ciRegistrationType;
+    }
+
+    /**
+     * 璁剧疆鐧昏娉ㄥ唽绫诲瀷
+     *
+     * @param ciRegistrationType 鐧昏娉ㄥ唽绫诲瀷
+     */
+    public void setCiRegistrationType(String ciRegistrationType) {
+        this.ciRegistrationType = ciRegistrationType == null ? null : ciRegistrationType.trim();
+    }
+
+    /**
+     * 鑾峰彇娉ㄥ唽璧勬湰锛堜竾鍏冿級
+     *
+     * @return CI_Registered_Capital - 娉ㄥ唽璧勬湰锛堜竾鍏冿級
+     */
+    public Integer getCiRegisteredCapital() {
+        return ciRegisteredCapital;
+    }
+
+    /**
+     * 璁剧疆娉ㄥ唽璧勬湰锛堜竾鍏冿級
+     *
+     * @param ciRegisteredCapital 娉ㄥ唽璧勬湰锛堜竾鍏冿級
+     */
+    public void setCiRegisteredCapital(Integer ciRegisteredCapital) {
+        this.ciRegisteredCapital = ciRegisteredCapital;
+    }
+
+    /**
+     * 鑾峰彇寤哄巶骞存湀
+     *
+     * @return CI_Build_Date - 寤哄巶骞存湀
+     */
+    public Date getCiBuildDate() {
+        return ciBuildDate;
+    }
+
+    /**
+     * 璁剧疆寤哄巶骞存湀
+     *
+     * @param ciBuildDate 寤哄巶骞存湀
+     */
+    public void setCiBuildDate(Date ciBuildDate) {
+        this.ciBuildDate = ciBuildDate;
+    }
+
+    /**
+     * 鑾峰彇鏈�鏂版敼鎵╁缓骞存湀
+     *
+     * @return CI_Expansion_Date - 鏈�鏂版敼鎵╁缓骞存湀
+     */
+    public Date getCiExpansionDate() {
+        return ciExpansionDate;
+    }
+
+    /**
+     * 璁剧疆鏈�鏂版敼鎵╁缓骞存湀
+     *
+     * @param ciExpansionDate 鏈�鏂版敼鎵╁缓骞存湀
+     */
+    public void setCiExpansionDate(Date ciExpansionDate) {
+        this.ciExpansionDate = ciExpansionDate;
+    }
+
+    /**
+     * 鑾峰彇鑱屽伐浜烘暟
+     *
+     * @return CI_Workers_Number - 鑱屽伐浜烘暟
+     */
+    public Integer getCiWorkersNumber() {
+        return ciWorkersNumber;
+    }
+
+    /**
+     * 璁剧疆鑱屽伐浜烘暟
+     *
+     * @param ciWorkersNumber 鑱屽伐浜烘暟
+     */
+    public void setCiWorkersNumber(Integer ciWorkersNumber) {
+        this.ciWorkersNumber = ciWorkersNumber;
+    }
+
+    /**
+     * 鑾峰彇浼佷笟瑙勬ā
+     *
+     * @return CI_Scale - 浼佷笟瑙勬ā
+     */
+    public Byte getCiScale() {
+        return ciScale;
+    }
+
+    /**
+     * 璁剧疆浼佷笟瑙勬ā
+     *
+     * @param ciScale 浼佷笟瑙勬ā
+     */
+    public void setCiScale(Byte ciScale) {
+        this.ciScale = ciScale;
+    }
+
+    /**
+     * 鑾峰彇鍘嗘鐜瘎瀹℃壒骞存湀
+     *
+     * @return CI_Eia_Approval_Date - 鍘嗘鐜瘎瀹℃壒骞存湀
+     */
+    public String getCiEiaApprovalDate() {
+        return ciEiaApprovalDate;
+    }
+
+    /**
+     * 璁剧疆鍘嗘鐜瘎瀹℃壒骞存湀
+     *
+     * @param ciEiaApprovalDate 鍘嗘鐜瘎瀹℃壒骞存湀
+     */
+    public void setCiEiaApprovalDate(String ciEiaApprovalDate) {
+        this.ciEiaApprovalDate = ciEiaApprovalDate == null ? null : ciEiaApprovalDate.trim();
+    }
+
+    /**
+     * 鑾峰彇鎺掓薄璁稿彲璇佺紪鍙�
+     *
+     * @return CI_Plt_Permit_Code - 鎺掓薄璁稿彲璇佺紪鍙�
+     */
+    public String getCiPltPermitCode() {
+        return ciPltPermitCode;
+    }
+
+    /**
+     * 璁剧疆鎺掓薄璁稿彲璇佺紪鍙�
+     *
+     * @param ciPltPermitCode 鎺掓薄璁稿彲璇佺紪鍙�
+     */
+    public void setCiPltPermitCode(String ciPltPermitCode) {
+        this.ciPltPermitCode = ciPltPermitCode == null ? null : ciPltPermitCode.trim();
+    }
+
+    /**
+     * 鑾峰彇鎺掓薄鏉冧氦鏄撴枃浠�
+     *
+     * @return CI_Trading_Files - 鎺掓薄鏉冧氦鏄撴枃浠�
+     */
+    public String getCiTradingFiles() {
+        return ciTradingFiles;
+    }
+
+    /**
+     * 璁剧疆鎺掓薄鏉冧氦鏄撴枃浠�
+     *
+     * @param ciTradingFiles 鎺掓薄鏉冧氦鏄撴枃浠�
+     */
+    public void setCiTradingFiles(String ciTradingFiles) {
+        this.ciTradingFiles = ciTradingFiles == null ? null : ciTradingFiles.trim();
+    }
+
+    /**
+     * 鑾峰彇閭斂缂栫爜
+     *
+     * @return CI_Postal_Code - 閭斂缂栫爜
+     */
+    public String getCiPostalCode() {
+        return ciPostalCode;
+    }
+
+    /**
+     * 璁剧疆閭斂缂栫爜
+     *
+     * @param ciPostalCode 閭斂缂栫爜
+     */
+    public void setCiPostalCode(String ciPostalCode) {
+        this.ciPostalCode = ciPostalCode == null ? null : ciPostalCode.trim();
+    }
+
+    /**
+     * 鑾峰彇鑱旂郴浜哄鍚�
+     *
+     * @return CI_Contact_Name - 鑱旂郴浜哄鍚�
+     */
+    public String getCiContactName() {
+        return ciContactName;
+    }
+
+    /**
+     * 璁剧疆鑱旂郴浜哄鍚�
+     *
+     * @param ciContactName 鑱旂郴浜哄鍚�
+     */
+    public void setCiContactName(String ciContactName) {
+        this.ciContactName = ciContactName == null ? null : ciContactName.trim();
+    }
+
+    /**
+     * 鑾峰彇鑱旂郴鐢佃瘽
+     *
+     * @return CI_Telephone - 鑱旂郴鐢佃瘽
+     */
+    public String getCiTelephone() {
+        return ciTelephone;
+    }
+
+    /**
+     * 璁剧疆鑱旂郴鐢佃瘽
+     *
+     * @param ciTelephone 鑱旂郴鐢佃瘽
+     */
+    public void setCiTelephone(String ciTelephone) {
+        this.ciTelephone = ciTelephone == null ? null : ciTelephone.trim();
+    }
+
+    /**
+     * 鑾峰彇鑱旂郴寰俊鍙�
+     *
+     * @return CI_Contacts_WX - 鑱旂郴寰俊鍙�
+     */
+    public String getCiContactsWx() {
+        return ciContactsWx;
+    }
+
+    /**
+     * 璁剧疆鑱旂郴寰俊鍙�
+     *
+     * @param ciContactsWx 鑱旂郴寰俊鍙�
+     */
+    public void setCiContactsWx(String ciContactsWx) {
+        this.ciContactsWx = ciContactsWx == null ? null : ciContactsWx.trim();
+    }
+
+    /**
+     * 鑾峰彇浼犵湡
+     *
+     * @return CI_Fax - 浼犵湡
+     */
+    public String getCiFax() {
+        return ciFax;
+    }
+
+    /**
+     * 璁剧疆浼犵湡
+     *
+     * @param ciFax 浼犵湡
+     */
+    public void setCiFax(String ciFax) {
+        this.ciFax = ciFax == null ? null : ciFax.trim();
+    }
+
+    /**
+     * 鑾峰彇鐢靛瓙閭
+     *
+     * @return CI_Email - 鐢靛瓙閭
+     */
+    public String getCiEmail() {
+        return ciEmail;
+    }
+
+    /**
+     * 璁剧疆鐢靛瓙閭
+     *
+     * @param ciEmail 鐢靛瓙閭
+     */
+    public void setCiEmail(String ciEmail) {
+        this.ciEmail = ciEmail == null ? null : ciEmail.trim();
+    }
+
+    /**
+     * @return CI_Extension1
+     */
+    public String getCiExtension1() {
+        return ciExtension1;
+    }
+
+    /**
+     * @param ciExtension1
+     */
+    public void setCiExtension1(String ciExtension1) {
+        this.ciExtension1 = ciExtension1 == null ? null : ciExtension1.trim();
+    }
+
+    /**
+     * @return CI_Extension2
+     */
+    public String getCiExtension2() {
+        return ciExtension2;
+    }
+
+    /**
+     * @param ciExtension2
+     */
+    public void setCiExtension2(String ciExtension2) {
+        this.ciExtension2 = ciExtension2 == null ? null : ciExtension2.trim();
+    }
+
+    /**
+     * @return CI_Extension3
+     */
+    public String getCiExtension3() {
+        return ciExtension3;
+    }
+
+    /**
+     * @param ciExtension3
+     */
+    public void setCiExtension3(String ciExtension3) {
+        this.ciExtension3 = ciExtension3 == null ? null : ciExtension3.trim();
+    }
+
+    /**
+     * @return CI_Remark
+     */
+    public String getCiRemark() {
+        return ciRemark;
+    }
+
+    /**
+     * @param ciRemark
+     */
+    public void setCiRemark(String ciRemark) {
+        this.ciRemark = ciRemark == null ? null : ciRemark.trim();
+    }
+}
\ No newline at end of file
diff --git a/src/main/kotlin/com/flightfeather/uav/domain/mapper/CompanyMapper.kt b/src/main/kotlin/com/flightfeather/uav/domain/mapper/CompanyMapper.kt
new file mode 100644
index 0000000..55ca33d
--- /dev/null
+++ b/src/main/kotlin/com/flightfeather/uav/domain/mapper/CompanyMapper.kt
@@ -0,0 +1,8 @@
+package com.flightfeather.uav.domain.mapper
+
+import com.flightfeather.uav.domain.MyMapper
+import com.flightfeather.uav.domain.entity.Company
+import org.apache.ibatis.annotations.Mapper
+
+@Mapper
+interface CompanyMapper : MyMapper<Company>
\ No newline at end of file
diff --git a/src/main/kotlin/com/flightfeather/uav/lightshare/service/CompanyService.kt b/src/main/kotlin/com/flightfeather/uav/lightshare/service/CompanyService.kt
new file mode 100644
index 0000000..8d4c723
--- /dev/null
+++ b/src/main/kotlin/com/flightfeather/uav/lightshare/service/CompanyService.kt
@@ -0,0 +1,10 @@
+package com.flightfeather.uav.lightshare.service
+
+import com.flightfeather.uav.domain.entity.Company
+import com.flightfeather.uav.lightshare.bean.BaseResponse
+import com.flightfeather.uav.lightshare.bean.DataVo
+
+interface CompanyService {
+
+    fun getCompanyInfo(): BaseResponse<List<Company>>
+}
\ No newline at end of file
diff --git a/src/main/kotlin/com/flightfeather/uav/lightshare/service/RealTimeDataService.kt b/src/main/kotlin/com/flightfeather/uav/lightshare/service/RealTimeDataService.kt
index d00d43c..85fb096 100644
--- a/src/main/kotlin/com/flightfeather/uav/lightshare/service/RealTimeDataService.kt
+++ b/src/main/kotlin/com/flightfeather/uav/lightshare/service/RealTimeDataService.kt
@@ -6,4 +6,6 @@
 interface RealTimeDataService {
 
     fun getSecondData(deviceCode: String?, startTime: String?, endTime: String?, page: Int?, perPage: Int?): BaseResponse<List<DataVo>>
+
+    fun getNextData(deviceCode: String, updateTime: String, page: Int?, perPage: Int?): BaseResponse<List<DataVo>>
 }
\ No newline at end of file
diff --git a/src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/CompanyServiceImpl.kt b/src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/CompanyServiceImpl.kt
new file mode 100644
index 0000000..8e0c9af
--- /dev/null
+++ b/src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/CompanyServiceImpl.kt
@@ -0,0 +1,16 @@
+package com.flightfeather.uav.lightshare.service.impl
+
+import com.flightfeather.uav.domain.entity.Company
+import com.flightfeather.uav.domain.mapper.CompanyMapper
+import com.flightfeather.uav.lightshare.bean.BaseResponse
+import com.flightfeather.uav.lightshare.service.CompanyService
+import org.springframework.stereotype.Service
+import tk.mybatis.mapper.entity.Example
+
+@Service
+class CompanyServiceImpl(private val companyMapper: CompanyMapper) : CompanyService {
+    override fun getCompanyInfo(): BaseResponse<List<Company>> {
+        val result = companyMapper.selectAll()
+        return BaseResponse(true, data = result)
+    }
+}
\ No newline at end of file
diff --git a/src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/RealTimeDataServiceImpl.kt b/src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/RealTimeDataServiceImpl.kt
index 0872846..a22bee6 100644
--- a/src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/RealTimeDataServiceImpl.kt
+++ b/src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/RealTimeDataServiceImpl.kt
@@ -32,7 +32,12 @@
                 sTime?.let { andGreaterThanOrEqualTo("dataTime", it) }
                 eTime?.let { andLessThanOrEqualTo("dataTime", it) }
             }
-            orderBy("dataTime").desc()
+            orderBy("dataTime").apply {
+                // 褰撹姹傛帴鍙d笉浼犻�掕捣濮嬫椂闂达紝榛樿鑾峰彇鏈�鏂扮殑鏁版嵁
+                if (startTime == null && endTime == null) {
+                    desc()
+                }
+            }
         }).forEach {
             result.add(DataVo(
                     dateFormatter.format(it.dataTime),
@@ -41,7 +46,29 @@
                     it.longitude.toDouble(), it.latitude.toDouble()
             ))
         }
-//        result.reverse()
+        if (startTime == null && endTime == null) {
+            result.reverse()
+        }
+        return BaseResponse(true, head = DataHead(pageInfo.pageNum, pageInfo.pages), data = result)
+    }
+
+    override fun getNextData(deviceCode: String, updateTime: String, page: Int?, perPage: Int?): BaseResponse<List<DataVo>> {
+        val _perPage = perPage ?: 60
+        val _page = page ?: 1
+        val pageInfo = PageHelper.startPage<RealTimeData>(_page, _perPage)
+        val result = mutableListOf<DataVo>()
+        realTimeDataMapper.selectByExample(Example(RealTimeData::class.java).apply {
+            createCriteria().andEqualTo("deviceCode", deviceCode)
+                .andGreaterThan("dataTime", updateTime)
+            orderBy("dataTime")
+        }).forEach {
+            result.add(DataVo(
+                dateFormatter.format(it.dataTime),
+                it.deviceCode,
+                GsonUtils.parserJsonToArrayBeans(it.factors, AirData::class.java),
+                it.longitude.toDouble(), it.latitude.toDouble()
+            ))
+        }
         return BaseResponse(true, head = DataHead(pageInfo.pageNum, pageInfo.pages), data = result)
     }
 }
\ No newline at end of file
diff --git a/src/main/kotlin/com/flightfeather/uav/lightshare/web/CompanyController.kt b/src/main/kotlin/com/flightfeather/uav/lightshare/web/CompanyController.kt
new file mode 100644
index 0000000..e4c280e
--- /dev/null
+++ b/src/main/kotlin/com/flightfeather/uav/lightshare/web/CompanyController.kt
@@ -0,0 +1,14 @@
+package com.flightfeather.uav.lightshare.web
+
+import com.flightfeather.uav.lightshare.service.CompanyService
+import org.springframework.web.bind.annotation.GetMapping
+import org.springframework.web.bind.annotation.RequestMapping
+import org.springframework.web.bind.annotation.RestController
+
+@RestController
+@RequestMapping("air/company")
+class CompanyController(private val companyService: CompanyService) {
+
+    @GetMapping("/info")
+    fun getCompanyInfo() = companyService.getCompanyInfo()
+}
diff --git a/src/main/kotlin/com/flightfeather/uav/lightshare/web/RealTimeDataController.kt b/src/main/kotlin/com/flightfeather/uav/lightshare/web/RealTimeDataController.kt
index e491030..e97b121 100644
--- a/src/main/kotlin/com/flightfeather/uav/lightshare/web/RealTimeDataController.kt
+++ b/src/main/kotlin/com/flightfeather/uav/lightshare/web/RealTimeDataController.kt
@@ -18,4 +18,12 @@
             @RequestParam(value = "page", required = false) page: Int?,
             @RequestParam(value = "perPage", required = false) perPage: Int?
     ) = realTimeDataService.getSecondData(deviceCode, startTime, endTime, page, perPage)
+
+    @GetMapping("/sec/next")
+    fun getNextData(
+        @RequestParam(value = "deviceCode") deviceCode: String,
+        @RequestParam(value = "updateTime") updateTime: String,
+        @RequestParam(value = "page", required = false) page: Int?,
+        @RequestParam(value = "perPage", required = false) perPage: Int?
+    ) = realTimeDataService.getNextData(deviceCode, updateTime, page, perPage)
 }
\ No newline at end of file
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 27d2245..be99472 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -1,9 +1,9 @@
 spring:
   datasource:
     driver-class-name: com.mysql.cj.jdbc.Driver
-#    url: jdbc:mysql://47.100.191.150:3306/uav?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
-#    username: uav
-#    password: obd2019
+#    url: jdbc:mysql://192.168.0.200:3306/dronemonitor?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
+#    username: root
+#    password: cn.FLIGHTFEATHER
 
     url: jdbc:mysql://localhost:3306/dronemonitor?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
     username: dronemonitor
diff --git a/src/test/kotlin/com/flightfeather/uav/Test.kt b/src/test/kotlin/com/flightfeather/uav/Test.kt
index 9ab8a21..38e6067 100644
--- a/src/test/kotlin/com/flightfeather/uav/Test.kt
+++ b/src/test/kotlin/com/flightfeather/uav/Test.kt
@@ -1,5 +1,6 @@
 package com.flightfeather.uav
 
+import com.flightfeather.uav.common.utils.FileExchange
 import com.flightfeather.uav.socket.bean.DataUnit
 import com.flightfeather.uav.socket.decoder.AirDataDecoder
 import com.flightfeather.uav.socket.eunm.AirCommandUnit
@@ -41,4 +42,9 @@
         out.flush()
         out.close()
     }
+
+    @Test
+    fun dataChange() {
+        FileExchange().doTask2()
+    }
 }
\ No newline at end of file
diff --git a/src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/CompanyServiceImplTest.kt b/src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/CompanyServiceImplTest.kt
new file mode 100644
index 0000000..d0066ee
--- /dev/null
+++ b/src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/CompanyServiceImplTest.kt
@@ -0,0 +1,24 @@
+package com.flightfeather.uav.lightshare.service.impl
+
+import com.flightfeather.uav.lightshare.service.CompanyService
+import org.junit.Test
+
+import org.junit.Assert.*
+import org.junit.runner.RunWith
+import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.boot.test.context.SpringBootTest
+import org.springframework.test.context.junit4.SpringRunner
+
+@RunWith(SpringRunner::class)
+@SpringBootTest
+class CompanyServiceImplTest {
+
+    @Autowired
+    lateinit var companyService: CompanyService
+
+    @Test
+    fun getCompanyInfo() {
+        val r = companyService.getCompanyInfo()
+        println(r)
+    }
+}
\ No newline at end of file

--
Gitblit v1.9.3