From 16b961c2210fe29fd494ac1f9d830dd93503961f Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期五, 02 八月 2024 17:25:17 +0800
Subject: [PATCH] 1. 新增监测设备的管理功能
---
src/main/resources/mapper/ds1/MonitorobjectversionMapper.xml | 6
src/main/kotlin/cn/flightfeather/supervision/common/exception/BizException.kt | 6
src/main/resources/mapper/ds1/DeviceInfoMapper.xml | 27 +
src/main/resources/mapper/ds3/FumeExceptionDataMapper.xml | 24
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/DeviceLocationMapper.java | 9
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/InspectionServiceImpl.kt | 4
pom.xml | 4
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/DeviceRep.kt | 60 +++
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/DeviceService.kt | 32 +
src/main/kotlin/cn/flightfeather/supervision/domain/ds3/mapper/FumeExceptionDataMapper.java | 3
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/EvaluationServiceImpl.kt | 2
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/entity/DeviceInfo.java | 251 +++++++++++++
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/DeviceInfoMapper.java | 9
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/entity/DeviceLocation.java | 238 ++++++++++++
src/main/kotlin/cn/flightfeather/supervision/business/report/cols/ColLedger.kt | 3
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/TableController.kt | 4
src/main/kotlin/cn/flightfeather/supervision/business/report/cols/ColInspectionInfo.kt | 5
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/DeviceController.kt | 48 ++
src/main/resources/mapper/ds1/DeviceLocationMapper.xml | 27 +
src/main/kotlin/cn/flightfeather/supervision/common/utils/FileUtil.kt | 39 +
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/DeviceServiceImpl.kt | 79 ++++
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ProblemlistServiceImpl.kt | 2
src/test/kotlin/cn/flightfeather/supervision/business/bgtask/AopTaskCtrlTest.kt | 9
src/main/kotlin/cn/flightfeather/supervision/business/datafetch/FetchNightConstruction.kt | 10
src/main/kotlin/cn/flightfeather/supervision/common/utils/DateUtil.kt | 3
src/main/kotlin/cn/flightfeather/supervision/business/location/UtilFile.kt | 2
src/main/kotlin/cn/flightfeather/supervision/domain/ds2/repository/ComplaintAndPunishmentRep.kt | 9
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/MenuController.kt | 20
/dev/null | 20 -
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/ScoreItem.kt | 1
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/RegionRep.kt | 3
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/TaskServiceImpl.kt | 39 +-
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SubtaskServiceImpl.kt | 62 +-
src/main/kotlin/cn/flightfeather/supervision/scheduler/ScheduleService.kt | 19
src/main/kotlin/cn/flightfeather/supervision/business/report/DataSource.kt | 4
src/main/resources/generator/generatorConfig4ds1.xml | 8
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SearchServiceImpl.kt | 8
37 files changed, 946 insertions(+), 153 deletions(-)
diff --git a/pom.xml b/pom.xml
index 6d4c67e..4145dee 100644
--- a/pom.xml
+++ b/pom.xml
@@ -437,8 +437,8 @@
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.2</version>
<configuration>
- <!-- <configurationFile>src/main/resources/generator/generatorConfig4ds1.xml</configurationFile>-->
- <configurationFile>src/main/resources/generator/generatorConfig4ds3.xml</configurationFile>
+ <configurationFile>src/main/resources/generator/generatorConfig4ds1.xml</configurationFile>
+<!-- <configurationFile>src/main/resources/generator/generatorConfig4ds3.xml</configurationFile>-->
<overwrite>true</overwrite>
<verbose>true</verbose>
</configuration>
diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/ScoreItem.kt b/src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/ScoreItem.kt
index 6264100..a394739 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/ScoreItem.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/ScoreItem.kt
@@ -23,7 +23,6 @@
//鏈�灏忓垎鍊硷紙榛樿0鍒嗭級
var minScore: Int = 0
- val dateUtil = DateUtil()
// 璇勫垎椤规槸鍚﹁眮鍏嶄笉鎵e垎
var exemption = false
diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/datafetch/FetchNightConstruction.kt b/src/main/kotlin/cn/flightfeather/supervision/business/datafetch/FetchNightConstruction.kt
index 85b4cc8..4f0ed9f 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/business/datafetch/FetchNightConstruction.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/business/datafetch/FetchNightConstruction.kt
@@ -43,8 +43,6 @@
@Autowired
lateinit var userinfoMapper: UserinfoMapper
- private val dateUtil = DateUtil()
-
@PostConstruct
fun init() {
instance = this
@@ -65,7 +63,7 @@
val timeStr = if (it.isNotEmpty()) {
val cal = Calendar.getInstance().apply { time = it[0]?.ncCreateTime }
cal.add(Calendar.DAY_OF_MONTH, -1)
- dateUtil.DateToString(cal.time, DateUtil.DateStyle.YYYY_MM_DD_HH_MM_SS) ?: DEFAULT_TIME
+ DateUtil.DateToString(cal.time, DateUtil.DateStyle.YYYY_MM_DD_HH_MM_SS) ?: DEFAULT_TIME
} else {
DEFAULT_TIME
}
@@ -83,10 +81,10 @@
ncConstructionUnit = vo["constructionUnit"].asString
ncPerson = vo["person"].asString
ncApplyContent = vo["applyContent"].asString
- ncStartDate = dateUtil.StringToDate(vo["startDate"].asString)
- ncEndDate = dateUtil.StringToDate(vo["endDate"].asString)
+ ncStartDate = DateUtil.StringToDate(vo["startDate"].asString)
+ ncEndDate = DateUtil.StringToDate(vo["endDate"].asString)
ncFileName = vo["filename"].asString
- ncCreateTime = dateUtil.StringToDate(vo["createtime"].asString)
+ ncCreateTime = DateUtil.StringToDate(vo["createtime"].asString)
ncUrl = vo["url"].asString
ncProvinceCode = PROVINCE_CODE
diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/location/UtilFile.kt b/src/main/kotlin/cn/flightfeather/supervision/business/location/UtilFile.kt
index 238fcb0..aee975c 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/business/location/UtilFile.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/business/location/UtilFile.kt
@@ -79,7 +79,7 @@
fun outPutToFile(distance: Double? = null) {
val workbook = HSSFWorkbook()
val tag = if (distance == null) "" else "${distance}绫�"
- val fileName = "鍛ㄨ竟${tag}鐐逛綅-${DateUtil().DateToString(Date(), "yyyy-MM-ddhhmmss")}.xls"
+ val fileName = "鍛ㄨ竟${tag}鐐逛綅-${DateUtil.DateToString(Date(), "yyyy-MM-ddhhmmss")}.xls"
val filePath = "C:\\work\\宸ヤ綔\\绗笁鏂圭洃绠\鍛ㄨ竟鐐逛綅\\$fileName"
val out = FileOutputStream(File(filePath))
ExcelUtil.write(heads, contents, workbook)
diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/report/DataSource.kt b/src/main/kotlin/cn/flightfeather/supervision/business/report/DataSource.kt
index 2fd96af..92f0633 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/business/report/DataSource.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/business/report/DataSource.kt
@@ -23,8 +23,6 @@
*/
class DataSource(val config: ExcelConfigVo, val dbMapper: DbMapper){
- private val dateUtil = DateUtil()
-
private val sourceList = mutableListOf<Subtask>()
var year = 0
@@ -70,7 +68,7 @@
*/
fun areaName(): String {
val t = dbMapper.taskMapper.selectByPrimaryKey(config.topTaskGuid)
- return "${dateUtil.DateToString(t.starttime, DateUtil.DateStyle.YYYY_MM_CN)}${t.districtname}${if (area != t.districtname) area else ""}${Constant.SceneType.getDes(config.sceneType)}"
+ return "${DateUtil.DateToString(t.starttime, DateUtil.DateStyle.YYYY_MM_CN)}${t.districtname}${if (area != t.districtname) area else ""}${Constant.SceneType.getDes(config.sceneType)}"
}
/**
diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/report/cols/ColInspectionInfo.kt b/src/main/kotlin/cn/flightfeather/supervision/business/report/cols/ColInspectionInfo.kt
index 507266d..adb52e9 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/business/report/cols/ColInspectionInfo.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/business/report/cols/ColInspectionInfo.kt
@@ -36,7 +36,6 @@
}
override fun onOneRow(rowData: DataSource.RowData): List<Any> {
- val dateUtil = DateUtil()
val row = mutableListOf<Any>()
if (rowData.noRecord()) {
repeat(heads.last().size) { row.add(("")) }
@@ -44,7 +43,7 @@
row.apply {
// 琛ㄥご锛氬贰鏌ユ儏鍐靛強闂銆佹暣鏀圭粺璁�
//鐩戠鏃堕棿
- add(dateUtil.DateToString(rowData.subTask?.planstarttime, DateUtil.DateStyle.MM_DD) ?: "")
+ add(DateUtil.DateToString(rowData.subTask?.planstarttime, DateUtil.DateStyle.MM_DD) ?: "")
//宸℃煡浜哄憳
add(rowData.subTask?.executorrealtimes?.replace("#", "銆�") ?: "")
//鏌ヨ瀛愪换鍔″搴旂殑闂锛屽苟涓旀牴鎹潯浠惰繘琛岀瓫閫�
@@ -82,7 +81,7 @@
pDes += "${lr}$y銆�${p.problemname}"
pLoc += "${lr}$y銆�${p.location}"
pNum++
- changeTime += "${lr}$y銆�${dateUtil.DateToString(p.changedtime, DateUtil.DateStyle.YYYY_MM_DD_HH_MM_CN)}"
+ changeTime += "${lr}$y銆�${DateUtil.DateToString(p.changedtime, DateUtil.DateStyle.YYYY_MM_DD_HH_MM_CN)}"
pChanged += "${lr}$y銆�${if (p.ischanged == true) "鉁�" else "脳"}"
if (p.ischanged == true) {
if (changedProblem.isNotBlank()) {
diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/report/cols/ColLedger.kt b/src/main/kotlin/cn/flightfeather/supervision/business/report/cols/ColLedger.kt
index ab379e6..4329784 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/business/report/cols/ColLedger.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/business/report/cols/ColLedger.kt
@@ -21,7 +21,6 @@
}
override fun onOneRow(rowData: DataSource.RowData): List<Any> {
- val dateUtil = DateUtil()
rowData.ledgerRecords.sortedByDescending {
it.lrSubmitdate
}
@@ -30,7 +29,7 @@
var t2 = "/"
if (rowData.ledgerRecords.isNotEmpty()) {
val r = rowData.ledgerRecords[0]
- t1 = "${dateUtil.DateToString(r.lrSubmitdate, DateUtil.DateStyle.YYYY_MM_DD_HH_MM_CN)}"
+ t1 = "${DateUtil.DateToString(r.lrSubmitdate, DateUtil.DateStyle.YYYY_MM_DD_HH_MM_CN)}"
val random = Random(Date().time).nextLong(0, 6)
val checkTime = LocalDateTime.ofInstant(r.lrSubmitdate.toInstant(), ZoneId.systemDefault()).plusDays(random)
t2 = checkTime.format(DateTimeFormatter.ofPattern("yyyy骞碝M鏈坉d鏃�"))
diff --git a/src/main/kotlin/cn/flightfeather/supervision/common/exception/BizException.kt b/src/main/kotlin/cn/flightfeather/supervision/common/exception/BizException.kt
index 2b21147..24118cc 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/common/exception/BizException.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/common/exception/BizException.kt
@@ -6,8 +6,8 @@
class BizException : Exception {
constructor():super()
constructor(message: String) : super(message)
- constructor(message: String, cause: Throwable) : super(message, cause)
- constructor(cause: Throwable) : super(cause)
- constructor(message: String, cause: Throwable, enableSuppression: Boolean, writableStackTrace: Boolean)
+ constructor(message: String, cause: Throwable?) : super(message, cause)
+ constructor(cause: Throwable?) : super(cause)
+ constructor(message: String, cause: Throwable?, enableSuppression: Boolean, writableStackTrace: Boolean)
: super(message, cause, enableSuppression, writableStackTrace)
}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/common/utils/CacheUtil.kt b/src/main/kotlin/cn/flightfeather/supervision/common/utils/CacheUtil.kt
deleted file mode 100644
index e24f57b..0000000
--- a/src/main/kotlin/cn/flightfeather/supervision/common/utils/CacheUtil.kt
+++ /dev/null
@@ -1,20 +0,0 @@
-package cn.flightfeather.supervision.common.utils
-
-import org.springframework.stereotype.Component
-
-/**
- * 缂撳瓨鍙橀噺绠$悊宸ュ叿
- * 鍏佽鏁版嵁搴撳父鐢ㄧ殑鍙橀噺鍦ㄥ唴瀛樹腑缂撳瓨涓�娈垫椂闂达紝鎻愰珮璁块棶閫熷害
- * 鍚庣画搴旇浣跨敤redis绛塏OSQL鏁版嵁搴撴浛浠�
- */
-@Component
-class CacheUtil {
-
- /**
- * 娣诲姞鍙橀噺
- *
- */
- fun addParams(p:Any?) {
-
- }
-}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/common/utils/DateUtil.kt b/src/main/kotlin/cn/flightfeather/supervision/common/utils/DateUtil.kt
index b520fc8..811545a 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/common/utils/DateUtil.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/common/utils/DateUtil.kt
@@ -6,8 +6,7 @@
import java.text.SimpleDateFormat
import java.util.*
-@Component
-class DateUtil {
+object DateUtil {
private val threadLocal = ThreadLocal<SimpleDateFormat>()
private val `object` = Any()
diff --git a/src/main/kotlin/cn/flightfeather/supervision/common/utils/FileUtil.kt b/src/main/kotlin/cn/flightfeather/supervision/common/utils/FileUtil.kt
index f96d545..dc7edd0 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/common/utils/FileUtil.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/common/utils/FileUtil.kt
@@ -1,10 +1,9 @@
package cn.flightfeather.supervision.common.utils
-import java.awt.Image
-import java.awt.image.BufferedImage
+import cn.flightfeather.supervision.common.exception.BizException
+import org.springframework.web.multipart.MultipartFile
import java.io.*
import java.util.*
-import javax.imageio.ImageIO
object FileUtil {
@@ -20,13 +19,24 @@
out.close()
}
+ fun delFile(path: String): Boolean {
+ val file = File(path)
+ if (!file.exists()) return false
+ if (file.isDirectory) return false
+ try {
+ file.delete()
+ return true
+ } catch (e: Exception) {
+ throw BizException("鏂囦欢鍒犻櫎鍑洪敊", e.cause)
+ }
+ }
+
//鍒犻櫎鏂囦欢澶�
fun delFolder(folderPath: String) {
try {
delAllFile(folderPath) //鍒犻櫎瀹岄噷闈㈡墍鏈夊唴瀹�
- var filePath = folderPath
- filePath = filePath
- val myFilePath = java.io.File(filePath)
+ val filePath = folderPath
+ val myFilePath = File(filePath)
myFilePath.delete() //鍒犻櫎绌烘枃浠跺す
} catch (e: Exception) {
e.printStackTrace()
@@ -117,6 +127,23 @@
}
}
+ fun saveFiles(files: Array<MultipartFile>, basePath: String, path: String): List<String> {
+ val pathList = mutableListOf<String>()
+ files.forEach { file ->
+ val ext = file.resource.file.extension
+ val fileName = UUID.randomUUID().toString() + "." + ext
+ pathList.add("$path$fileName")
+ val absolutePath = "${basePath}/$path/"
+ try {
+ //璋冪敤鏂囦欢淇濆瓨鏂规硶
+ uploadFile(file.bytes, absolutePath, fileName)
+ } catch (e: Exception) {
+ // TODO: handle exception
+ }
+ }
+ return pathList
+ }
+
/**
* 鎸夌収鍥哄畾瀹藉害鍘嬬缉鍥剧墖鑷砨ase64褰㈠紡
*/
diff --git a/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/entity/DeviceInfo.java b/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/entity/DeviceInfo.java
new file mode 100644
index 0000000..39cde3b
--- /dev/null
+++ b/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/entity/DeviceInfo.java
@@ -0,0 +1,251 @@
+package cn.flightfeather.supervision.domain.ds1.entity;
+
+import java.util.Date;
+import javax.persistence.*;
+
+@Table(name = "sm_t_device_info")
+public class DeviceInfo {
+ @Id
+ @Column(name = "DI_ID")
+ private Integer diId;
+
+ /**
+ * 鐩戞祴璁惧MN缂栧彿
+ */
+ @Column(name = "DI_Mn_Code")
+ private String diMnCode;
+
+ /**
+ * 绔欑偣鍚嶇О
+ */
+ @Column(name = "DI_Name")
+ private String diName;
+
+ /**
+ * 鎵�灞炲満鏅痠d
+ */
+ @Column(name = "DI_Scene_GUID")
+ private String diSceneGuid;
+
+ /**
+ * 璁惧渚涘簲鍟�
+ */
+ @Column(name = "DI_Supplier")
+ private String diSupplier;
+
+ /**
+ * 杩愮淮鍟�
+ */
+ @Column(name = "DI_Maintainer")
+ private String diMaintainer;
+
+ /**
+ * 杩愯鐘舵��(1:涓婄嚎涓�;0:涓嬬嚎)
+ */
+ @Column(name = "DI_Running_Status")
+ private Byte diRunningStatus;
+
+ /**
+ * 鏄惁鎷嗛櫎
+ */
+ @Column(name = "DI_Removed")
+ private Boolean diRemoved;
+
+ /**
+ * 璁惧绫诲瀷(1: 鐩戞祴璁惧; 2: 鍑�鍖栬澶�)
+ */
+ @Column(name = "DI_Type")
+ private Byte diType;
+
+ @Column(name = "DI_Create_Time")
+ private Date diCreateTime;
+
+ @Column(name = "DI_Update_Time")
+ private Date diUpdateTime;
+
+ /**
+ * @return DI_ID
+ */
+ public Integer getDiId() {
+ return diId;
+ }
+
+ /**
+ * @param diId
+ */
+ public void setDiId(Integer diId) {
+ this.diId = diId;
+ }
+
+ /**
+ * 鑾峰彇鐩戞祴璁惧MN缂栧彿
+ *
+ * @return DI_Mn_Code - 鐩戞祴璁惧MN缂栧彿
+ */
+ public String getDiMnCode() {
+ return diMnCode;
+ }
+
+ /**
+ * 璁剧疆鐩戞祴璁惧MN缂栧彿
+ *
+ * @param diMnCode 鐩戞祴璁惧MN缂栧彿
+ */
+ public void setDiMnCode(String diMnCode) {
+ this.diMnCode = diMnCode == null ? null : diMnCode.trim();
+ }
+
+ /**
+ * 鑾峰彇绔欑偣鍚嶇О
+ *
+ * @return DI_Name - 绔欑偣鍚嶇О
+ */
+ public String getDiName() {
+ return diName;
+ }
+
+ /**
+ * 璁剧疆绔欑偣鍚嶇О
+ *
+ * @param diName 绔欑偣鍚嶇О
+ */
+ public void setDiName(String diName) {
+ this.diName = diName == null ? null : diName.trim();
+ }
+
+ /**
+ * 鑾峰彇鎵�灞炲満鏅痠d
+ *
+ * @return DI_Scene_GUID - 鎵�灞炲満鏅痠d
+ */
+ public String getDiSceneGuid() {
+ return diSceneGuid;
+ }
+
+ /**
+ * 璁剧疆鎵�灞炲満鏅痠d
+ *
+ * @param diSceneGuid 鎵�灞炲満鏅痠d
+ */
+ public void setDiSceneGuid(String diSceneGuid) {
+ this.diSceneGuid = diSceneGuid == null ? null : diSceneGuid.trim();
+ }
+
+ /**
+ * 鑾峰彇璁惧渚涘簲鍟�
+ *
+ * @return DI_Supplier - 璁惧渚涘簲鍟�
+ */
+ public String getDiSupplier() {
+ return diSupplier;
+ }
+
+ /**
+ * 璁剧疆璁惧渚涘簲鍟�
+ *
+ * @param diSupplier 璁惧渚涘簲鍟�
+ */
+ public void setDiSupplier(String diSupplier) {
+ this.diSupplier = diSupplier == null ? null : diSupplier.trim();
+ }
+
+ /**
+ * 鑾峰彇杩愮淮鍟�
+ *
+ * @return DI_Maintainer - 杩愮淮鍟�
+ */
+ public String getDiMaintainer() {
+ return diMaintainer;
+ }
+
+ /**
+ * 璁剧疆杩愮淮鍟�
+ *
+ * @param diMaintainer 杩愮淮鍟�
+ */
+ public void setDiMaintainer(String diMaintainer) {
+ this.diMaintainer = diMaintainer == null ? null : diMaintainer.trim();
+ }
+
+ /**
+ * 鑾峰彇杩愯鐘舵��(1:涓婄嚎涓�;0:涓嬬嚎)
+ *
+ * @return DI_Running_Status - 杩愯鐘舵��(1:涓婄嚎涓�;0:涓嬬嚎)
+ */
+ public Byte getDiRunningStatus() {
+ return diRunningStatus;
+ }
+
+ /**
+ * 璁剧疆杩愯鐘舵��(1:涓婄嚎涓�;0:涓嬬嚎)
+ *
+ * @param diRunningStatus 杩愯鐘舵��(1:涓婄嚎涓�;0:涓嬬嚎)
+ */
+ public void setDiRunningStatus(Byte diRunningStatus) {
+ this.diRunningStatus = diRunningStatus;
+ }
+
+ /**
+ * 鑾峰彇鏄惁鎷嗛櫎
+ *
+ * @return DI_Removed - 鏄惁鎷嗛櫎
+ */
+ public Boolean getDiRemoved() {
+ return diRemoved;
+ }
+
+ /**
+ * 璁剧疆鏄惁鎷嗛櫎
+ *
+ * @param diRemoved 鏄惁鎷嗛櫎
+ */
+ public void setDiRemoved(Boolean diRemoved) {
+ this.diRemoved = diRemoved;
+ }
+
+ /**
+ * 鑾峰彇璁惧绫诲瀷(1: 鐩戞祴璁惧; 2: 鍑�鍖栬澶�)
+ *
+ * @return DI_Type - 璁惧绫诲瀷(1: 鐩戞祴璁惧; 2: 鍑�鍖栬澶�)
+ */
+ public Byte getDiType() {
+ return diType;
+ }
+
+ /**
+ * 璁剧疆璁惧绫诲瀷(1: 鐩戞祴璁惧; 2: 鍑�鍖栬澶�)
+ *
+ * @param diType 璁惧绫诲瀷(1: 鐩戞祴璁惧; 2: 鍑�鍖栬澶�)
+ */
+ public void setDiType(Byte diType) {
+ this.diType = diType;
+ }
+
+ /**
+ * @return DI_Create_Time
+ */
+ public Date getDiCreateTime() {
+ return diCreateTime;
+ }
+
+ /**
+ * @param diCreateTime
+ */
+ public void setDiCreateTime(Date diCreateTime) {
+ this.diCreateTime = diCreateTime;
+ }
+
+ /**
+ * @return DI_Update_Time
+ */
+ public Date getDiUpdateTime() {
+ return diUpdateTime;
+ }
+
+ /**
+ * @param diUpdateTime
+ */
+ public void setDiUpdateTime(Date diUpdateTime) {
+ this.diUpdateTime = diUpdateTime;
+ }
+}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/entity/DeviceLocation.java b/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/entity/DeviceLocation.java
new file mode 100644
index 0000000..fda74e0
--- /dev/null
+++ b/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/entity/DeviceLocation.java
@@ -0,0 +1,238 @@
+package cn.flightfeather.supervision.domain.ds1.entity;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import javax.persistence.*;
+
+@Table(name = "sm_t_device_location")
+public class DeviceLocation {
+ @Id
+ @Column(name = "DL_ID")
+ private Integer dlId;
+
+ /**
+ * 鎵�灞炶澶噄d
+ */
+ @Column(name = "DL_Device_Id")
+ private Integer dlDeviceId;
+
+ /**
+ * 鐩戞祴璁惧MN缂栧彿
+ */
+ @Column(name = "DL_Mn_Code")
+ private String dlMnCode;
+
+ /**
+ * 璁惧浣嶇疆
+ */
+ @Column(name = "DL_Location")
+ private String dlLocation;
+
+ @Column(name = "DL_Longitude")
+ private BigDecimal dlLongitude;
+
+ @Column(name = "DL_Latitude")
+ private BigDecimal dlLatitude;
+
+ /**
+ * 瀹夎浣嶇疆鏄惁瑙勮寖
+ */
+ @Column(name = "DL_Standard")
+ private Boolean dlStandard;
+
+ /**
+ * 瀹夎浣嶇疆涓嶈鑼冨師鍥�
+ */
+ @Column(name = "DL_UnStandard_Reason")
+ private String dlUnstandardReason;
+
+ /**
+ * 璁惧鐜板満鍥剧墖
+ */
+ @Column(name = "DL_Pic_Url")
+ private String dlPicUrl;
+
+ @Column(name = "DL_Create_Time")
+ private Date dlCreateTime;
+
+ @Column(name = "DL_Update_Time")
+ private Date dlUpdateTime;
+
+ /**
+ * @return DL_ID
+ */
+ public Integer getDlId() {
+ return dlId;
+ }
+
+ /**
+ * @param dlId
+ */
+ public void setDlId(Integer dlId) {
+ this.dlId = dlId;
+ }
+
+ /**
+ * 鑾峰彇鎵�灞炶澶噄d
+ *
+ * @return DL_Device_Id - 鎵�灞炶澶噄d
+ */
+ public Integer getDlDeviceId() {
+ return dlDeviceId;
+ }
+
+ /**
+ * 璁剧疆鎵�灞炶澶噄d
+ *
+ * @param dlDeviceId 鎵�灞炶澶噄d
+ */
+ public void setDlDeviceId(Integer dlDeviceId) {
+ this.dlDeviceId = dlDeviceId;
+ }
+
+ /**
+ * 鑾峰彇鐩戞祴璁惧MN缂栧彿
+ *
+ * @return DL_Mn_Code - 鐩戞祴璁惧MN缂栧彿
+ */
+ public String getDlMnCode() {
+ return dlMnCode;
+ }
+
+ /**
+ * 璁剧疆鐩戞祴璁惧MN缂栧彿
+ *
+ * @param dlMnCode 鐩戞祴璁惧MN缂栧彿
+ */
+ public void setDlMnCode(String dlMnCode) {
+ this.dlMnCode = dlMnCode == null ? null : dlMnCode.trim();
+ }
+
+ /**
+ * 鑾峰彇璁惧浣嶇疆
+ *
+ * @return DL_Location - 璁惧浣嶇疆
+ */
+ public String getDlLocation() {
+ return dlLocation;
+ }
+
+ /**
+ * 璁剧疆璁惧浣嶇疆
+ *
+ * @param dlLocation 璁惧浣嶇疆
+ */
+ public void setDlLocation(String dlLocation) {
+ this.dlLocation = dlLocation == null ? null : dlLocation.trim();
+ }
+
+ /**
+ * @return DL_Longitude
+ */
+ public BigDecimal getDlLongitude() {
+ return dlLongitude;
+ }
+
+ /**
+ * @param dlLongitude
+ */
+ public void setDlLongitude(BigDecimal dlLongitude) {
+ this.dlLongitude = dlLongitude;
+ }
+
+ /**
+ * @return DL_Latitude
+ */
+ public BigDecimal getDlLatitude() {
+ return dlLatitude;
+ }
+
+ /**
+ * @param dlLatitude
+ */
+ public void setDlLatitude(BigDecimal dlLatitude) {
+ this.dlLatitude = dlLatitude;
+ }
+
+ /**
+ * 鑾峰彇瀹夎浣嶇疆鏄惁瑙勮寖
+ *
+ * @return DL_Standard - 瀹夎浣嶇疆鏄惁瑙勮寖
+ */
+ public Boolean getDlStandard() {
+ return dlStandard;
+ }
+
+ /**
+ * 璁剧疆瀹夎浣嶇疆鏄惁瑙勮寖
+ *
+ * @param dlStandard 瀹夎浣嶇疆鏄惁瑙勮寖
+ */
+ public void setDlStandard(Boolean dlStandard) {
+ this.dlStandard = dlStandard;
+ }
+
+ /**
+ * 鑾峰彇瀹夎浣嶇疆涓嶈鑼冨師鍥�
+ *
+ * @return DL_UnStandard_Reason - 瀹夎浣嶇疆涓嶈鑼冨師鍥�
+ */
+ public String getDlUnstandardReason() {
+ return dlUnstandardReason;
+ }
+
+ /**
+ * 璁剧疆瀹夎浣嶇疆涓嶈鑼冨師鍥�
+ *
+ * @param dlUnstandardReason 瀹夎浣嶇疆涓嶈鑼冨師鍥�
+ */
+ public void setDlUnstandardReason(String dlUnstandardReason) {
+ this.dlUnstandardReason = dlUnstandardReason == null ? null : dlUnstandardReason.trim();
+ }
+
+ /**
+ * 鑾峰彇璁惧鐜板満鍥剧墖
+ *
+ * @return DL_Pic_Url - 璁惧鐜板満鍥剧墖
+ */
+ public String getDlPicUrl() {
+ return dlPicUrl;
+ }
+
+ /**
+ * 璁剧疆璁惧鐜板満鍥剧墖
+ *
+ * @param dlPicUrl 璁惧鐜板満鍥剧墖
+ */
+ public void setDlPicUrl(String dlPicUrl) {
+ this.dlPicUrl = dlPicUrl == null ? null : dlPicUrl.trim();
+ }
+
+ /**
+ * @return DL_Create_Time
+ */
+ public Date getDlCreateTime() {
+ return dlCreateTime;
+ }
+
+ /**
+ * @param dlCreateTime
+ */
+ public void setDlCreateTime(Date dlCreateTime) {
+ this.dlCreateTime = dlCreateTime;
+ }
+
+ /**
+ * @return DL_Update_Time
+ */
+ public Date getDlUpdateTime() {
+ return dlUpdateTime;
+ }
+
+ /**
+ * @param dlUpdateTime
+ */
+ public void setDlUpdateTime(Date dlUpdateTime) {
+ this.dlUpdateTime = dlUpdateTime;
+ }
+}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/DeviceInfoMapper.java b/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/DeviceInfoMapper.java
new file mode 100644
index 0000000..dbf049f
--- /dev/null
+++ b/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/DeviceInfoMapper.java
@@ -0,0 +1,9 @@
+package cn.flightfeather.supervision.domain.ds1.mapper;
+
+import cn.flightfeather.supervision.domain.ds1.entity.DeviceInfo;
+import cn.flightfeather.supervision.domain.util.MyMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface DeviceInfoMapper extends MyMapper<DeviceInfo> {
+}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/DeviceLocationMapper.java b/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/DeviceLocationMapper.java
new file mode 100644
index 0000000..63b60f2
--- /dev/null
+++ b/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/DeviceLocationMapper.java
@@ -0,0 +1,9 @@
+package cn.flightfeather.supervision.domain.ds1.mapper;
+
+import cn.flightfeather.supervision.domain.ds1.entity.DeviceLocation;
+import cn.flightfeather.supervision.domain.util.MyMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface DeviceLocationMapper extends MyMapper<DeviceLocation> {
+}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/DeviceRep.kt b/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/DeviceRep.kt
new file mode 100644
index 0000000..46fdfe1
--- /dev/null
+++ b/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/DeviceRep.kt
@@ -0,0 +1,60 @@
+package cn.flightfeather.supervision.domain.ds1.repository
+
+import cn.flightfeather.supervision.domain.ds1.entity.DeviceInfo
+import cn.flightfeather.supervision.domain.ds1.entity.DeviceLocation
+import cn.flightfeather.supervision.domain.ds1.mapper.DeviceInfoMapper
+import cn.flightfeather.supervision.domain.ds1.mapper.DeviceLocationMapper
+import org.springframework.stereotype.Repository
+
+/**
+ *
+ * @date 2024/7/24
+ * @author feiyu02
+ */
+@Repository
+class DeviceRep(
+ private val deviceInfoMapper: DeviceInfoMapper,
+ private val deviceLocationMapper: DeviceLocationMapper,
+) {
+ /***--DeviceInfo--***/
+ fun findDevice(sceneId: String): DeviceInfo? {
+ return deviceInfoMapper.selectByPrimaryKey(sceneId)
+ }
+
+ fun findDeviceList(sceneId: String): List<DeviceInfo> {
+ return findDeviceList(DeviceInfo().apply { diSceneGuid = sceneId })
+ }
+
+ fun findDeviceList(deviceInfo: DeviceInfo): List<DeviceInfo> {
+ return deviceInfoMapper.select(deviceInfo)
+ }
+
+ fun insertDevice(deviceInfo: DeviceInfo): Int {
+ return deviceInfoMapper.insert(deviceInfo)
+ }
+
+ fun updateDevice(deviceInfo: DeviceInfo): Int {
+ return deviceInfoMapper.updateByPrimaryKey(deviceInfo)
+ }
+
+ /***--DeviceLocation--***/
+ fun findLocation(id: Int): DeviceLocation? {
+ return deviceLocationMapper.selectByPrimaryKey(id)
+ }
+
+ fun findLocations(deviceId: Int): List<DeviceLocation> {
+ return findLocations(DeviceLocation().apply { dlDeviceId = deviceId })
+ }
+
+ fun findLocations(location: DeviceLocation): List<DeviceLocation> {
+ return deviceLocationMapper.select(location)
+ }
+
+ fun insertLocation(location: DeviceLocation): Int {
+ return deviceLocationMapper.insert(location)
+ }
+
+ fun updateLocation(location: DeviceLocation): Int {
+ return deviceLocationMapper.updateByPrimaryKey(location)
+ }
+}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/RegionRep.kt b/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/RegionRep.kt
index fbe9e51..5e789d8 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/RegionRep.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/RegionRep.kt
@@ -1,6 +1,5 @@
package cn.flightfeather.supervision.domain.ds1.repository
-import cn.flightfeather.supervision.common.utils.CacheUtil
import cn.flightfeather.supervision.domain.ds1.entity.City
import cn.flightfeather.supervision.domain.ds1.entity.District
import cn.flightfeather.supervision.domain.ds1.entity.Province
@@ -10,7 +9,6 @@
import cn.flightfeather.supervision.domain.ds1.mapper.ProvinceMapper
import cn.flightfeather.supervision.domain.ds1.mapper.TownMapper
import org.springframework.stereotype.Repository
-import tk.mybatis.mapper.entity.Example
/**
* 鍦板煙淇℃伅鐩稿叧鏁版嵁搴撴搷浣�
@@ -21,7 +19,6 @@
private val cityMapper: CityMapper,
private val districtMapper: DistrictMapper,
private val townMapper: TownMapper,
- private val cacheUtil: CacheUtil,
) {
private val cacheMap = mutableMapOf<String, Any?>()
diff --git a/src/main/kotlin/cn/flightfeather/supervision/domain/ds2/repository/ComplaintAndPunishmentRep.kt b/src/main/kotlin/cn/flightfeather/supervision/domain/ds2/repository/ComplaintAndPunishmentRep.kt
index f6f0caa..5ccbc6a 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/domain/ds2/repository/ComplaintAndPunishmentRep.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/domain/ds2/repository/ComplaintAndPunishmentRep.kt
@@ -17,7 +17,6 @@
class ComplaintAndPunishmentRep(
private val complaintMapper: ComplaintMapper,
private val punishmentMapper: PunishmentMapper,
- private val dateUtil: DateUtil,
){
@@ -27,8 +26,8 @@
* @param tzUserIdList 椋炵窘鐜绯荤粺涓嬬殑鐢ㄦ埛id鍒楄〃
*/
fun findComplaint(tzUserIdList: List<String?>, sTime: Date?, eTime: Date?): List<ComplaintVo?> {
- val s = dateUtil.DateToString(sTime, DateUtil.DateStyle.YYYY_MM_DD_HH_MM_SS)
- val e = dateUtil.DateToString(eTime, DateUtil.DateStyle.YYYY_MM_DD_HH_MM_SS)
+ val s = DateUtil.DateToString(sTime, DateUtil.DateStyle.YYYY_MM_DD_HH_MM_SS)
+ val e = DateUtil.DateToString(eTime, DateUtil.DateStyle.YYYY_MM_DD_HH_MM_SS)
return findComplaint(tzUserIdList, s, e)
}
@@ -47,8 +46,8 @@
* @param tzUserIdList 椋炵窘鐜绯荤粺涓嬬殑鐢ㄦ埛id鍒楄〃
*/
fun findPunishment(tzUserIdList: List<String?>, sTime: Date?, eTime: Date?): List<PunishmentVo?> {
- val s = dateUtil.DateToString(sTime, DateUtil.DateStyle.YYYY_MM_DD_HH_MM_SS)
- val e = dateUtil.DateToString(eTime, DateUtil.DateStyle.YYYY_MM_DD_HH_MM_SS)
+ val s = DateUtil.DateToString(sTime, DateUtil.DateStyle.YYYY_MM_DD_HH_MM_SS)
+ val e = DateUtil.DateToString(eTime, DateUtil.DateStyle.YYYY_MM_DD_HH_MM_SS)
return findPunishment(tzUserIdList, s, e)
}
diff --git a/src/main/kotlin/cn/flightfeather/supervision/domain/ds3/mapper/FumeExceptionDataMapper.java b/src/main/kotlin/cn/flightfeather/supervision/domain/ds3/mapper/FumeExceptionDataMapper.java
index 831ddae..864a461 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/domain/ds3/mapper/FumeExceptionDataMapper.java
+++ b/src/main/kotlin/cn/flightfeather/supervision/domain/ds3/mapper/FumeExceptionDataMapper.java
@@ -1,8 +1,7 @@
package cn.flightfeather.supervision.domain.ds3.mapper;
import cn.flightfeather.supervision.domain.ds3.entity.FumeExceptionData;
-import cn.flightfeather.supervision.domain.util.MyMapper;
import tk.mybatis.mapper.common.Mapper;
-public interface FumeExceptionDataMapper extends MyMapper<FumeExceptionData> {
+public interface FumeExceptionDataMapper extends Mapper<FumeExceptionData> {
}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/DeviceService.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/DeviceService.kt
new file mode 100644
index 0000000..39bfb91
--- /dev/null
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/DeviceService.kt
@@ -0,0 +1,32 @@
+package cn.flightfeather.supervision.lightshare.service
+
+import cn.flightfeather.supervision.domain.ds1.entity.DeviceInfo
+import cn.flightfeather.supervision.domain.ds1.entity.DeviceLocation
+import org.springframework.web.multipart.MultipartFile
+
+interface DeviceService {
+
+ fun findDevices(sceneId: String): List<DeviceInfo>
+
+ /**
+ * 鏂板璁惧淇℃伅
+ */
+ fun insertDevice(deviceInfo: DeviceInfo): Int
+
+ /**
+ * 鏇存柊璁惧淇℃伅
+ */
+ fun updateDevice(deviceInfo: DeviceInfo): Int
+
+ fun findDeviceLocations(deviceId: Int): List<DeviceLocation>
+
+ /**
+ *鏂板璁惧浣嶇疆鍙樻洿淇℃伅
+ */
+ fun insertDeviceLocation(deviceLocation: String, files: Array<MultipartFile>): Int
+
+ /**
+ *鏇存柊璁惧鍙婂浘鐗�
+ */
+ fun updateDeviceLocation(deviceLocation: String, deleteImg: List<String>, files: Array<MultipartFile>): Int
+}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/DeviceServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/DeviceServiceImpl.kt
new file mode 100644
index 0000000..d4a05aa
--- /dev/null
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/DeviceServiceImpl.kt
@@ -0,0 +1,79 @@
+package cn.flightfeather.supervision.lightshare.service.impl
+
+import cn.flightfeather.supervision.common.exception.BizException
+import cn.flightfeather.supervision.common.utils.Constant
+import cn.flightfeather.supervision.common.utils.DateUtil
+import cn.flightfeather.supervision.common.utils.FileUtil
+import cn.flightfeather.supervision.common.utils.JsonUtil
+import cn.flightfeather.supervision.domain.ds1.entity.DeviceInfo
+import cn.flightfeather.supervision.domain.ds1.entity.DeviceLocation
+import cn.flightfeather.supervision.domain.ds1.repository.DeviceRep
+import cn.flightfeather.supervision.lightshare.service.DeviceService
+import org.springframework.stereotype.Service
+import org.springframework.web.multipart.MultipartFile
+import java.util.*
+
+/**
+ *
+ * @date 2024/7/24
+ * @author feiyu02
+ */
+@Service
+class DeviceServiceImpl(private val deviceRep: DeviceRep) : DeviceService {
+
+ companion object{
+ private const val BASE_IMG_PATH = "${Constant.DEFAULT_FILE_PATH}/images/"
+ }
+
+ override fun findDevices(sceneId: String): List<DeviceInfo> {
+ return deviceRep.findDeviceList(sceneId)
+ }
+
+ override fun insertDevice(deviceInfo: DeviceInfo): Int {
+ return deviceRep.insertDevice(deviceInfo)
+ }
+
+ override fun updateDevice(deviceInfo: DeviceInfo): Int {
+ return deviceRep.updateDevice(deviceInfo)
+ }
+
+ override fun findDeviceLocations(deviceId: Int): List<DeviceLocation> {
+ return deviceRep.findLocations(deviceId)
+ }
+
+ override fun insertDeviceLocation(deviceLocation: String, files: Array<MultipartFile>): Int {
+ val obj = JsonUtil.gson.fromJson(deviceLocation, DeviceLocation::class.java)
+ val time = DateUtil.DateToString(obj.dlCreateTime, DateUtil.DateStyle.YYYY_MM_DD)
+ val picPath = FileUtil.saveFiles(files, BASE_IMG_PATH, "device/${obj.dlId}/${time}")
+ obj.dlPicUrl = picPath.joinToString(";")
+ return deviceRep.insertLocation(obj)
+ }
+
+ override fun updateDeviceLocation(
+ deviceLocation: String,
+ deleteImg: List<String>,
+ files: Array<MultipartFile>,
+ ): Int {
+ // 鑾峰彇鏇存柊淇℃伅
+ val obj = JsonUtil.gson.fromJson(deviceLocation, DeviceLocation::class.java)
+
+ // 鑾峰彇鍘熶綅缃俊鎭紝鍒犻櫎鍥剧墖璺緞鍜屽搴斿浘鐗�
+ val dL = deviceRep.findLocation(obj.dlId) ?: throw BizException("璇ヨ澶囦綅缃俊鎭笉瀛樺湪锛屾棤娉曚慨鏀�")
+ val oldImg = dL.dlPicUrl.split(";").toMutableList()
+ deleteImg.forEach {
+ if (oldImg.contains(it)) {
+ if (FileUtil.delFile(BASE_IMG_PATH + it)) {
+ oldImg.remove(it)
+ }
+ }
+ }
+
+ // 淇濆瓨鏂板鍥剧墖
+ val time = DateUtil.DateToString(obj.dlCreateTime, DateUtil.DateStyle.YYYY_MM_DD)
+ val picPath = FileUtil.saveFiles(files, BASE_IMG_PATH, "device/${obj.dlId}/${time}")
+
+ oldImg.addAll(picPath)
+ obj.dlPicUrl = oldImg.joinToString(";")
+ return deviceRep.updateLocation(obj)
+ }
+}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/EvaluationServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/EvaluationServiceImpl.kt
index e0a0cf8..346b362 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/EvaluationServiceImpl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/EvaluationServiceImpl.kt
@@ -218,7 +218,7 @@
val example = Example(Subtask::class.java)
val criteria = example.createCriteria()
criteria.andEqualTo("districtcode", districtCode)
- val date = DateUtil().StringToDate(time)
+ val date = DateUtil.StringToDate(time)
criteria.andGreaterThanOrEqualTo("planstarttime", time)
val subTaskList = subtaskMapper.selectByExample(example)
subTaskList.forEach {
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/InspectionServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/InspectionServiceImpl.kt
index 2240ac3..9072c29 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/InspectionServiceImpl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/InspectionServiceImpl.kt
@@ -34,8 +34,6 @@
@Autowired
lateinit var subtaskService: SubtaskService
- private val dateUtil = DateUtil()
-
//鑾峰彇姹℃煋鍦烘櫙鐗堟湰涓婚〉鐨勭洃绠℃儏鍐靛睍绀哄唴瀹�
override fun getInspectionInfoByScene(sceneId: String, topTaskId: String): InspectionInfoVo? {
val resList = inspectionMapper.getInspectionInfoByScene(sceneId, topTaskId)
@@ -78,7 +76,7 @@
val example = Example(Inspection::class.java)
val criteria = example.createCriteria()
criteria.andEqualTo("sguid", id)
- criteria.andLessThan("executionstarttime", DateUtil().StringToDate(date))
+ criteria.andLessThan("executionstarttime", DateUtil.StringToDate(date))
//娣诲姞宸℃煡鎸夋墽琛屾椂闂存帓搴�*****
example.orderBy("executionstarttime").desc()
//**************************
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ProblemlistServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ProblemlistServiceImpl.kt
index 5b28608..8f2b7d4 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ProblemlistServiceImpl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ProblemlistServiceImpl.kt
@@ -452,7 +452,7 @@
response.success = false
response.message = "闂鏇存柊澶辫触锛�"
} else {
- bizLog.info(WorkStreamLogInfo(subtask?.executorguids, subtask?.executorrealtimes, event))
+ bizLog.info(WorkStreamLogInfo(userId, userName, event))
}
}
return response
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SearchServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SearchServiceImpl.kt
index 51c20ef..2a55953 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SearchServiceImpl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SearchServiceImpl.kt
@@ -68,8 +68,6 @@
@Value("\${imgPath}") var imgPath: String,
) : SearchService {
- private val dateUtil = DateUtil()
-
override fun writeToFile(config: ExcelConfigVo, mode: Int) {
val dbMapper = DbMapper(
scenseMapper,
@@ -258,7 +256,7 @@
}
//寤虹珛绗竴灞傜洰褰曪紝鍖呭惈鎵�鏈夌殑浠诲姟
- val time = dateUtil.DateToString(Date(), "yyyy-MM-dd_HH-mm-ss")
+ val time = DateUtil.DateToString(Date(), "yyyy-MM-dd_HH-mm-ss")
var basePath =
Constant.DEFAULT_FILE_PATH + File.separator + "images" + File.separator + "temp" + File.separator + time
var file = File(basePath)
@@ -351,7 +349,7 @@
override fun downloadPic2(sceneType: Int, topTaskId: String, response: HttpServletResponse): HttpServletResponse {
//寤虹珛绗竴灞傜洰褰曪紝鍖呭惈鎵�鏈夌殑浠诲姟
val topTask = taskMapper.selectByPrimaryKey(topTaskId)
- val time = dateUtil.DateToString(Date(), "yyyy-MM-dd_HH-mm-ss")
+ val time = DateUtil.DateToString(Date(), "yyyy-MM-dd_HH-mm-ss")
val basePath =
Constant.DEFAULT_FILE_PATH + File.separator + "images" + File.separator + "temp" + File.separator + topTask.name
val file = File(basePath)
@@ -372,7 +370,7 @@
//寤虹珛涓�涓瓙浠诲姟鏂囦欢澶�
var subTaskFilePath = "${basePath}${File.separator}(${
- dateUtil.DateToString(
+ DateUtil.DateToString(
it.planstarttime,
DateUtil.DateStyle.YYYY_MM_DD_CN
)
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SubtaskServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SubtaskServiceImpl.kt
index 96d689b..d58addf 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SubtaskServiceImpl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SubtaskServiceImpl.kt
@@ -31,8 +31,6 @@
private val subTaskRep: SubTaskRep,
) : SubtaskService {
- val dateUtil = DateUtil()
-
@Autowired
lateinit var taskService: TaskService
@Autowired
@@ -188,25 +186,25 @@
dateString = date.substring(0, 7)
}
//鍒ゆ柇鍙傛暟鏄惁姝g‘
- if (dateUtil.StringToDate(dateString) == null) {
+ if (DateUtil.StringToDate(dateString) == null) {
return taskPackList
}
//鏍规嵁type绫诲瀷,寰楀埌鍏蜂綋鏄鍝笁涓湀鏁版嵁
when (type) {
"Middle" -> {
- one = dateUtil.addMonth(dateString, -1)
+ one = DateUtil.addMonth(dateString, -1)
two = dateString
- three = dateUtil.addMonth(dateString, 1)
+ three = DateUtil.addMonth(dateString, 1)
}
"Left" -> {
- one = dateUtil.addMonth(dateString, 1)
- two = dateUtil.addMonth(dateString, 2)
- three = dateUtil.addMonth(dateString, 3)
+ one = DateUtil.addMonth(dateString, 1)
+ two = DateUtil.addMonth(dateString, 2)
+ three = DateUtil.addMonth(dateString, 3)
}
"Right" -> {
- one = dateUtil.addMonth(dateString, -1)
- two = dateUtil.addMonth(dateString, -2)
- three = dateUtil.addMonth(dateString, -3)
+ one = DateUtil.addMonth(dateString, -1)
+ two = DateUtil.addMonth(dateString, -2)
+ three = DateUtil.addMonth(dateString, -3)
}
else -> {
//鍙傛暟涓嶆纭氨杩斿洖
@@ -242,25 +240,25 @@
dateString = date.substring(0, 7)
}
//鍒ゆ柇鍙傛暟鏄惁姝g‘
- if (dateUtil.StringToDate(dateString) == null) {
+ if (DateUtil.StringToDate(dateString) == null) {
return taskPackList
}
//鏍规嵁type绫诲瀷,寰楀埌鍏蜂綋鏄鍝笁涓湀鏁版嵁
when (type) {
"Middle" -> {
- one = dateUtil.addMonth(dateString, -1)
+ one = DateUtil.addMonth(dateString, -1)
two = dateString
- three = dateUtil.addMonth(dateString, 1)
+ three = DateUtil.addMonth(dateString, 1)
}
"Left" -> {
- one = dateUtil.addMonth(dateString, 1)
- two = dateUtil.addMonth(dateString, 2)
- three = dateUtil.addMonth(dateString, 3)
+ one = DateUtil.addMonth(dateString, 1)
+ two = DateUtil.addMonth(dateString, 2)
+ three = DateUtil.addMonth(dateString, 3)
}
"Right" -> {
- one = dateUtil.addMonth(dateString, -1)
- two = dateUtil.addMonth(dateString, -2)
- three = dateUtil.addMonth(dateString, -3)
+ one = DateUtil.addMonth(dateString, -1)
+ two = DateUtil.addMonth(dateString, -2)
+ three = DateUtil.addMonth(dateString, -3)
}
else -> {
//鍙傛暟涓嶆纭氨杩斿洖
@@ -393,7 +391,7 @@
val toptaskVo = taskService.findByID(subtask.tguid.toString())
// //鏍规嵁鏃ユ湡鑾峰彇鏃ヤ换鍔�
-// val daytaskVo = taskService.findByDate(dateUtil.getDate(subtask.planstarttime)!!)
+// val daytaskVo = taskService.findByDate(DateUtil.getDate(subtask.planstarttime)!!)
//搴旇鐩存帴鏍规嵁瀛愪换鍔$殑鏃ヤ换鍔d鏌ヨ鏃ヤ换鍔�
val daytaskVo = taskService.findByID(subtask.tsguid!!)
@@ -407,9 +405,9 @@
task.tsguid = toptaskVo.tguid
task.tguid = guid
task.name = subtask.name
- task.starttime = dateUtil.StringToDate(dateUtil.getDate(subtask.planstarttime)!!.substring(0, 10))
+ task.starttime = DateUtil.StringToDate(DateUtil.getDate(subtask.planstarttime)!!.substring(0, 10))
task.endtime =
- dateUtil.StringToDate(dateUtil.getDate(subtask.planstarttime)!!.substring(0, 10) + " 23:59:59")
+ DateUtil.StringToDate(DateUtil.getDate(subtask.planstarttime)!!.substring(0, 10) + " 23:59:59")
//****鏃ヤ换鍔℃墽琛岀姸鎬佺户鎵垮瓙浠诲姟鐨勭姸鎬�*锛堜慨鏀癸級***
task.runingstatus = subtask.status
//********************************************
@@ -517,7 +515,7 @@
cal.set(Calendar.MILLISECOND, 0)
cal.time
} else {
- DateUtil().StringToDate(startTime!!)
+ DateUtil.StringToDate(startTime!!)
}
val _endTime = if (endTime.isNullOrBlank()) {
@@ -528,7 +526,7 @@
cal.set(Calendar.MILLISECOND, 999)
cal.time
} else {
- DateUtil().StringToDate(endTime!!)?.apply {
+ DateUtil.StringToDate(endTime!!)?.apply {
time += 24 * 60 * 60 * 1000
}
}
@@ -593,7 +591,7 @@
}
val time = if (updateTime != null) {
- DateUtil().StringToDate(updateTime)
+ DateUtil.StringToDate(updateTime)
} else {
null
}
@@ -612,7 +610,7 @@
cal.set(Calendar.MILLISECOND, 0)
cal.time
} else {
- DateUtil().StringToDate(startTime!!)
+ DateUtil.StringToDate(startTime!!)
}
val _endTime = if (endTime.isNullOrBlank()) {
@@ -623,7 +621,7 @@
cal.set(Calendar.MILLISECOND, 999)
cal.time
} else {
- DateUtil().StringToDate(endTime!!)?.apply {
+ DateUtil.StringToDate(endTime!!)?.apply {
this.time += 24 * 60 * 60 * 1000
}
}
@@ -744,7 +742,7 @@
}
val time = if (updateTime != null) {
- DateUtil().StringToDate(updateTime)
+ DateUtil.StringToDate(updateTime)
} else {
null
}
@@ -763,7 +761,7 @@
cal.set(Calendar.MILLISECOND, 0)
cal.time
} else {
- DateUtil().StringToDate(startTime!!)
+ DateUtil.StringToDate(startTime!!)
}
val _endTime = if (endTime.isNullOrBlank()) {
@@ -774,7 +772,7 @@
cal.set(Calendar.MILLISECOND, 999)
cal.time
} else {
- DateUtil().StringToDate(endTime!!)?.apply {
+ DateUtil.StringToDate(endTime!!)?.apply {
this.time += 24 * 60 * 60 * 1000
}
}
@@ -895,7 +893,7 @@
}
override fun findByDate(date: String, userId: String): List<SubtaskVo> {
- val time = DateUtil().StringToDate(date)
+ val time = DateUtil.StringToDate(date)
val resultList = mutableListOf<SubtaskVo>()
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/TaskServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/TaskServiceImpl.kt
index 7853af7..bc6354d 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/TaskServiceImpl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/TaskServiceImpl.kt
@@ -8,6 +8,7 @@
import cn.flightfeather.supervision.domain.ds1.mapper.TaskMapper
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.common.utils.DateUtil
+import cn.flightfeather.supervision.domain.ds1.repository.SubTaskRep
import cn.flightfeather.supervision.domain.ds1.repository.TaskRep
import cn.flightfeather.supervision.lightshare.service.*
import cn.flightfeather.supervision.lightshare.vo.*
@@ -22,6 +23,7 @@
class TaskServiceImpl(
val taskMapper: TaskMapper,
private val taskRep: TaskRep,
+ private val subTaskRep: SubTaskRep,
) : TaskService {
@Autowired
@@ -181,7 +183,7 @@
val example = Example(Task::class.java)
val criteria = example.createCriteria()
//gsguid涓嶄负绌轰负鏃ヤ换鍔�,鏃ヤ换鍔″紑濮嬫椂闂村拰缁撴潫鏃堕棿鍦ㄥ悓涓�澶�,杩囨护寮�濮嬫椂闂村氨ok
- criteria.andEqualTo("starttime", dateUtil.StringToDate(date.substring(0, 10)))
+ criteria.andEqualTo("starttime", DateUtil.StringToDate(date.substring(0, 10)))
criteria.andIsNotNull("tsguid")
val tasklist = taskMapper.selectByExample(example)
if (tasklist.isNotEmpty()) {
@@ -287,8 +289,6 @@
return if (tasks.isEmpty()) Task() else tasks[0]
}
- val dateUtil = DateUtil()
-
//鏍规嵁椤跺眰鍒楄〃,鏃ユ湡,鍜屾墽琛屼汉鍛業D锛岀敤鎴风被鍨嬭幏鍙栨棩浠诲姟
override fun getDayTaskList(taskVoList: List<TaskVo>, date: String, guid: String, userType: String): List<TaskVo> {
if (taskVoList.isEmpty()) return taskVoList
@@ -297,9 +297,9 @@
val criteria = example.createCriteria()
//鏋勯�犳煡璇㈡潯浠�
criteria.andEqualTo("tsguid", it.tguid)
- val dateTemo = dateUtil.StringToDate(date)
+ val dateTemo = DateUtil.StringToDate(date)
//鏉′欢杩囨护
- criteria.andBetween("starttime", dateTemo, dateUtil.addSecond(dateUtil.addMonth(dateTemo!!, 1)!!, 1))
+ criteria.andBetween("starttime", dateTemo, DateUtil.addSecond(DateUtil.addMonth(dateTemo!!, 1)!!, 1))
if (userType == "1") {
criteria.andLike("executorguids", "%$guid%")
}
@@ -379,9 +379,9 @@
val criteria = example.createCriteria()
//鏋勯�犳煡璇㈡潯浠�
criteria.andEqualTo("tsguid", it.tguid)
- val dateTemo = dateUtil.StringToDate(date)
+ val dateTemo = DateUtil.StringToDate(date)
//鏉′欢杩囨护
- criteria.andBetween("starttime", dateTemo, dateUtil.addSecond(dateUtil.addMonth(dateTemo!!, 1)!!, 1))
+ criteria.andBetween("starttime", dateTemo, DateUtil.addSecond(DateUtil.addMonth(dateTemo!!, 1)!!, 1))
criteria.andLike("executorguids", "%$guid%")
//鏍规嵁sql鏉′欢鏌ヨ
val taskList = taskMapper.selectByExample(example)
@@ -402,10 +402,10 @@
if (date.length < 7) {
return taskVoList
}
- val startDate = DateUtil().StringToDate(date.substring(0, 7)) ?: return taskVoList
+ val startDate = DateUtil.StringToDate(date.substring(0, 7)) ?: return taskVoList
//鏌ヨ涓�涓湀浠诲姟
- var endDate = DateUtil().addMonth(startDate, 1) ?: return taskVoList
- endDate = DateUtil().addSecond(endDate, -1)!!
+ var endDate = DateUtil.addMonth(startDate, 1) ?: return taskVoList
+ endDate = DateUtil.addSecond(endDate, -1)!!
//鏋勯�犳煡璇㈡潯浠�
val example = Example(Task::class.java)
val criteria = example.createCriteria()
@@ -454,22 +454,22 @@
// return taskVoList
// }
// //鏃堕棿杞崲
-// val d1 = DateUtil().StringToDate(date.substring(0, 7)) ?: return taskVoList
+// val d1 = DateUtil.StringToDate(date.substring(0, 7)) ?: return taskVoList
// var startDate: Date? = null
// var endDate: Date? = null
// //鏍规嵁type绫诲瀷,寰楀埌瑕佹煡璇㈢殑鑼冨洿
// when (type) {
// "Middle" -> {
-// startDate = DateUtil().addMonth(d1, -1);endDate = DateUtil().addMonth(d1, 2)
+// startDate = DateUtil.addMonth(d1, -1);endDate = DateUtil.addMonth(d1, 2)
// }
// "Left" -> {
-// startDate = DateUtil().addMonth(d1, -3);endDate = d1
+// startDate = DateUtil.addMonth(d1, -3);endDate = d1
// }
// "Right" -> {
-// startDate = DateUtil().addMonth(d1, 1);endDate = DateUtil().addMonth(d1, 4)
+// startDate = DateUtil.addMonth(d1, 1);endDate = DateUtil.addMonth(d1, 4)
// }
// else -> {
-// startDate = d1;endDate = DateUtil().addMonth(d1, 1)
+// startDate = d1;endDate = DateUtil.addMonth(d1, 1)
// }
// }
//
@@ -498,10 +498,10 @@
if (date.length < 7) {
return taskVoList
}
- val startDate = DateUtil().StringToDate(date.substring(0, 7)) ?: return taskVoList
+ val startDate = DateUtil.StringToDate(date.substring(0, 7)) ?: return taskVoList
//鏌ヨ涓�涓湀浠诲姟
- var endDate = DateUtil().addMonth(startDate, 1) ?: return taskVoList
- endDate = DateUtil().addSecond(endDate, -1)!!
+ var endDate = DateUtil.addMonth(startDate, 1) ?: return taskVoList
+ endDate = DateUtil.addSecond(endDate, -1)!!
//鏋勯�犳煡璇㈡潯浠�
val example = Example(Task::class.java)
val criteria = example.createCriteria()
@@ -752,7 +752,8 @@
count += c
}
totaltask = count
- completetask = subtaskService.getSummary(t.tguid!!, areaVo.scensetypeid?.toIntOrNull()).size
+ subTaskSummary = subTaskRep.findSummary(areaVo)
+ completetask = this.subTaskSummary?.size
}
res.add(pro)
}
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/DeviceController.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/DeviceController.kt
new file mode 100644
index 0000000..7ee606f
--- /dev/null
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/DeviceController.kt
@@ -0,0 +1,48 @@
+package cn.flightfeather.supervision.lightshare.web
+
+import cn.flightfeather.supervision.domain.ds1.entity.DeviceInfo
+import cn.flightfeather.supervision.lightshare.service.DeviceService
+import io.swagger.annotations.Api
+import io.swagger.annotations.ApiOperation
+import io.swagger.annotations.ApiParam
+import org.springframework.web.bind.annotation.*
+import org.springframework.web.multipart.MultipartFile
+
+@Api(tags = ["DeviceController"], description = "鐩戠鍦烘櫙鐩稿叧璁惧API鎺ュ彛")
+@RestController
+@RequestMapping("/device")
+class DeviceController(private val deviceService: DeviceService) {
+
+ @ApiOperation("鑾峰彇鍦烘櫙璁惧淇℃伅")
+ @GetMapping
+ fun fetchDevice(
+ @ApiParam("鍦烘櫙id") sceneId: String,
+ ) = resPack { deviceService.findDevices(sceneId) }
+
+ @ApiOperation("鏂板鍦烘櫙璁惧淇℃伅")
+ @PutMapping("/upload")
+ fun uploadDevice(
+ @ApiParam("璁惧淇℃伅") deviceInfo: DeviceInfo,
+ ) = resPack { deviceService.insertDevice(deviceInfo) }
+
+ @ApiOperation("鏇存柊鍦烘櫙璁惧淇℃伅")
+ @PostMapping("/update")
+ fun updateDevice(
+ @ApiParam("璁惧淇℃伅") deviceInfo: DeviceInfo,
+ ) = resPack { deviceService.updateDevice(deviceInfo) }
+
+ @ApiOperation("鏂板鍦烘櫙璁惧浣嶇疆鍙樻洿淇℃伅")
+ @PutMapping("/location/upload")
+ fun uploadDeviceLocation(
+ @ApiParam("璁惧浣嶇疆淇℃伅json") @RequestParam("location") location: String,
+ @ApiParam("璁惧鍥剧墖") @RequestPart("images") images: Array<MultipartFile>,
+ ) = resPack { deviceService.insertDeviceLocation(location, images) }
+
+ @ApiOperation("鏇存柊鍦烘櫙璁惧浣嶇疆鍙樻洿淇℃伅")
+ @PutMapping("/location/update")
+ fun updateDeviceLocation(
+ @ApiParam("璁惧浣嶇疆淇℃伅json") @RequestParam("location") location: String,
+ @ApiParam("鍒犻櫎鐨勮澶囧浘鐗囪矾寰�") @RequestPart("deleteImg") deleteImg: List<String>,
+ @ApiParam("璁惧鍥剧墖") @RequestPart("images") images: Array<MultipartFile>,
+ ) = resPack { deviceService.updateDeviceLocation(location, deleteImg, images) }
+}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/MenuController.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/MenuController.kt
index f0400fa..a6dadff 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/MenuController.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/MenuController.kt
@@ -247,10 +247,10 @@
val planstarttime = subtaskVo.planstarttime
val planendtime = subtaskVo.planendtime
if (planstarttime != null) {
- subtaskVo.planstarttimestr = DateUtil().DateToString(planstarttime, "yyyy-MM-dd")
+ subtaskVo.planstarttimestr = DateUtil.DateToString(planstarttime, "yyyy-MM-dd")
}
if (planendtime != null) {
- subtaskVo.planendtimestr = DateUtil().DateToString(planendtime, "yyyy-MM-dd")
+ subtaskVo.planendtimestr = DateUtil.DateToString(planendtime, "yyyy-MM-dd")
}
}
val taskdayVolist = taskService.getDayTaskByTaskID(taskId)
@@ -308,10 +308,10 @@
val starttime = taskVo.starttime
val endtime = taskVo.endtime
if (starttime != null) {
- taskVo.starttimestr = DateUtil().DateToString(starttime, "yyyy-MM-dd")
+ taskVo.starttimestr = DateUtil.DateToString(starttime, "yyyy-MM-dd")
}
if (endtime != null) {
- taskVo.endtimestr = DateUtil().DateToString(endtime, "yyyy-MM-dd")
+ taskVo.endtimestr = DateUtil.DateToString(endtime, "yyyy-MM-dd")
}
}
@@ -349,10 +349,10 @@
val starttime = taskVo.starttime
val endtime = taskVo.endtime
if (starttime != null) {
- taskVo.starttimestr = DateUtil().DateToString(starttime, "yyyy-MM-dd")
+ taskVo.starttimestr = DateUtil.DateToString(starttime, "yyyy-MM-dd")
}
if (endtime != null) {
- taskVo.endtimestr = DateUtil().DateToString(endtime, "yyyy-MM-dd")
+ taskVo.endtimestr = DateUtil.DateToString(endtime, "yyyy-MM-dd")
}
}
val taskVolist = taskService.findTopTask()
@@ -398,8 +398,8 @@
//鏂拌祴鍊糶uid
toptask.tguid = UUIDGenerator.generate16ShortUUID()
//鏃ユ湡鍙樺寲
- toptask.starttime = DateUtil().StringToDate(starttimestr)
- toptask.endtime = DateUtil().StringToDate(starttimestr)
+ toptask.starttime = DateUtil.StringToDate(starttimestr)
+ toptask.endtime = DateUtil.StringToDate(starttimestr)
//鏂板缓浠诲姟鍙戝竷涓簄ull
toptask.deploytime = null
}
@@ -437,8 +437,8 @@
// }
task.tguid = UUIDGenerator.generate16ShortUUID()
task.name = taskname
- task.starttime = DateUtil().StringToDate(taskVo.starttimestr!!)
- task.endtime = DateUtil().StringToDate(taskVo.endtimestr!!)
+ task.starttime = DateUtil.StringToDate(taskVo.starttimestr!!)
+ task.endtime = DateUtil.StringToDate(taskVo.endtimestr!!)
task.settime = Date()
taskService.save(task)
}
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/TableController.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/TableController.kt
index f29168f..a70f927 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/TableController.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/TableController.kt
@@ -48,7 +48,7 @@
fun testdate() {
val wordMLPackage = WordprocessingMLPackage.createPackage()
wordMLPackage.mainDocumentPart.addAltChunk(AltChunkType.Html, t.block()!!.toString().toByteArray())
- val time = DateUtil().getTime(Date()).toString()
+ val time = DateUtil.getTime(Date()).toString()
val outputfilepath = File("/Users/liwei/resource/supervision/src/main/resources/public/htmltable.docx")
wordMLPackage.save(outputfilepath)
//Thread.sleep(1000)
@@ -68,7 +68,7 @@
val paragraphOfText = wordMLPackage.mainDocumentPart.createParagraphOfText("Field 1")
addTableCell(tr, paragraphOfText)
- val time = DateUtil().getTime(Date())
+ val time = DateUtil.getTime(Date())
val file = File("/Users/liwei/resource/supervision/src/main/resources/static/images/tutu.png")
val paragraphWithImage = addInlineImageToParagraph(createInlineImage(file))
addTableCell(tr, paragraphWithImage)
diff --git a/src/main/kotlin/cn/flightfeather/supervision/scheduler/ScheduleService.kt b/src/main/kotlin/cn/flightfeather/supervision/scheduler/ScheduleService.kt
index c34d071..b155114 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/scheduler/ScheduleService.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/scheduler/ScheduleService.kt
@@ -43,8 +43,8 @@
logger.info("=====>>>>>姣忔棩浠诲姟缁撴潫 {}", System.currentTimeMillis())
}
- @Async
- @Scheduled(cron = "0 0 0 * * MON")
+// @Async
+// @Scheduled(cron = "0 0 0 * * MON")
fun eachWeek() {
if (mode != "pro") return
@@ -54,16 +54,27 @@
logger.info("=====>>>>>姣忓懆浠诲姟缁撴潫 {}", System.currentTimeMillis())
}
+// @Async
+// @Scheduled(cron = "0 0 0 1 * *")
+ fun eachStartOfMonth() {
+ if (mode != "pro") return
+
+ logger.info("=====>>>>>姣忔湀1鍙蜂换鍔℃墽琛� {}", System.currentTimeMillis())
+ // 璁$畻鍘婚櫎鎵皹鐩戞祴鏁版嵁鍚庣殑璇勫垎
+ aopTaskCtrl.startAllEvaluation(LocalDate.now().atStartOfDay().minusMonths(1))
+ logger.info("=====>>>>>姣忔湀1鍙蜂换鍔$粨鏉� {}", System.currentTimeMillis())
+ }
+
@Async
@Scheduled(cron = "0 0 0 2 * *")
fun eachMonth() {
if (mode != "pro") return
- logger.info("=====>>>>>姣忔湀浠诲姟鎵ц {}", System.currentTimeMillis())
+ logger.info("=====>>>>>姣忔湀2鍙蜂换鍔℃墽琛� {}", System.currentTimeMillis())
// 鎵ц涓婁釜鏈堢殑瀹屾暣鑷瘎浠诲姟
aopTaskCtrl.startAll(LocalDate.now().atStartOfDay().minusMonths(1))
// 鎵ц椤跺眰浠诲姟鑷姩缁撴潫浠诲姟
taskFinishTopTask.handle()
- logger.info("=====>>>>>姣忔湀浠诲姟缁撴潫 {}", System.currentTimeMillis())
+ logger.info("=====>>>>>姣忔湀2鍙蜂换鍔$粨鏉� {}", System.currentTimeMillis())
}
}
\ No newline at end of file
diff --git a/src/main/resources/generator/generatorConfig4ds1.xml b/src/main/resources/generator/generatorConfig4ds1.xml
index 4056ebf..ed6c252 100644
--- a/src/main/resources/generator/generatorConfig4ds1.xml
+++ b/src/main/resources/generator/generatorConfig4ds1.xml
@@ -56,7 +56,13 @@
<!-- <table tableName="ea_t_mediafile" domainObjectName="LedgerMediaFile" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
<!-- <table tableName="ea_t_dust_data_result" domainObjectName="DustDataResult" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false"/>-->
- <table tableName="ea_t_evaluation" domainObjectName="Evaluation" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
+<!-- <table tableName="ea_t_evaluation" domainObjectName="Evaluation" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
+<!-- enableSelectByExample="false" selectByExampleQueryId="false"/>-->
+<!-- <table tableName="sm_t_device_info" domainObjectName="DeviceInfo" enableCountByExample="false"-->
+<!-- enableUpdateByExample="false" enableDeleteByExample="false"-->
+<!-- enableSelectByExample="false" selectByExampleQueryId="false"/>-->
+ <table tableName="sm_t_device_location" domainObjectName="DeviceLocation" enableCountByExample="false"
+ enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false"/>
</context>
</generatorConfiguration>
\ No newline at end of file
diff --git a/src/main/resources/mapper/ds1/DeviceInfoMapper.xml b/src/main/resources/mapper/ds1/DeviceInfoMapper.xml
new file mode 100644
index 0000000..25df023
--- /dev/null
+++ b/src/main/resources/mapper/ds1/DeviceInfoMapper.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="cn.flightfeather.supervision.domain.ds1.mapper.DeviceInfoMapper" >
+ <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.ds1.entity.DeviceInfo" >
+ <!--
+ WARNING - @mbg.generated
+ -->
+ <id column="DI_ID" property="diId" jdbcType="INTEGER" />
+ <result column="DI_Mn_Code" property="diMnCode" jdbcType="VARCHAR" />
+ <result column="DI_Name" property="diName" jdbcType="VARCHAR" />
+ <result column="DI_Scene_GUID" property="diSceneGuid" jdbcType="VARCHAR" />
+ <result column="DI_Supplier" property="diSupplier" jdbcType="VARCHAR" />
+ <result column="DI_Maintainer" property="diMaintainer" jdbcType="VARCHAR" />
+ <result column="DI_Running_Status" property="diRunningStatus" jdbcType="TINYINT" />
+ <result column="DI_Removed" property="diRemoved" jdbcType="BIT" />
+ <result column="DI_Type" property="diType" jdbcType="TINYINT" />
+ <result column="DI_Create_Time" property="diCreateTime" jdbcType="TIMESTAMP" />
+ <result column="DI_Update_Time" property="diUpdateTime" jdbcType="TIMESTAMP" />
+ </resultMap>
+ <sql id="Base_Column_List" >
+ <!--
+ WARNING - @mbg.generated
+ -->
+ DI_ID, DI_Mn_Code, DI_Name, DI_Scene_GUID, DI_Supplier, DI_Maintainer, DI_Running_Status,
+ DI_Removed, DI_Type, DI_Create_Time, DI_Update_Time
+ </sql>
+</mapper>
\ No newline at end of file
diff --git a/src/main/resources/mapper/ds1/DeviceLocationMapper.xml b/src/main/resources/mapper/ds1/DeviceLocationMapper.xml
new file mode 100644
index 0000000..6e99399
--- /dev/null
+++ b/src/main/resources/mapper/ds1/DeviceLocationMapper.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.flightfeather.supervision.domain.ds1.mapper.DeviceLocationMapper">
+ <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.ds1.entity.DeviceLocation">
+ <!--
+ WARNING - @mbg.generated
+ -->
+ <id column="DL_ID" jdbcType="INTEGER" property="dlId" />
+ <result column="DL_Device_Id" jdbcType="INTEGER" property="dlDeviceId" />
+ <result column="DL_Mn_Code" jdbcType="VARCHAR" property="dlMnCode" />
+ <result column="DL_Location" jdbcType="VARCHAR" property="dlLocation" />
+ <result column="DL_Longitude" jdbcType="DECIMAL" property="dlLongitude" />
+ <result column="DL_Latitude" jdbcType="DECIMAL" property="dlLatitude" />
+ <result column="DL_Standard" jdbcType="BIT" property="dlStandard" />
+ <result column="DL_UnStandard_Reason" jdbcType="VARCHAR" property="dlUnstandardReason" />
+ <result column="DL_Pic_Url" jdbcType="VARCHAR" property="dlPicUrl" />
+ <result column="DL_Create_Time" jdbcType="TIMESTAMP" property="dlCreateTime" />
+ <result column="DL_Update_Time" jdbcType="TIMESTAMP" property="dlUpdateTime" />
+ </resultMap>
+ <sql id="Base_Column_List">
+ <!--
+ WARNING - @mbg.generated
+ -->
+ DL_ID, DL_Device_Id, DL_Mn_Code, DL_Location, DL_Longitude, DL_Latitude, DL_Standard,
+ DL_UnStandard_Reason, DL_Pic_Url, DL_Create_Time, DL_Update_Time
+ </sql>
+</mapper>
\ No newline at end of file
diff --git a/src/main/resources/mapper/ds1/MonitorobjectversionMapper.xml b/src/main/resources/mapper/ds1/MonitorobjectversionMapper.xml
index 0c2f041..ee6df43 100644
--- a/src/main/resources/mapper/ds1/MonitorobjectversionMapper.xml
+++ b/src/main/resources/mapper/ds1/MonitorobjectversionMapper.xml
@@ -5,9 +5,9 @@
<!--
WARNING - @mbg.generated
-->
- <id column="MOV_ID" property="movId" jdbcType="VARCHAR" />
- <result column="T_ID" property="tId" jdbcType="VARCHAR" />
- <result column="S_GUID" property="sGuid" jdbcType="VARCHAR" />
+ <id column="MOV_ID" property="movid" jdbcType="VARCHAR" />
+ <result column="T_ID" property="tid" jdbcType="VARCHAR" />
+ <result column="S_GUID" property="sguid" jdbcType="VARCHAR" />
<result column="MOV_SenseName" property="sensename" jdbcType="VARCHAR" />
<result column="MOV_TaskTypeID" property="tasktypeid" jdbcType="TINYINT" />
<result column="MOV_TaskType" property="tasktype" jdbcType="VARCHAR" />
diff --git a/src/main/resources/mapper/ds3/FumeExceptionDataMapper.xml b/src/main/resources/mapper/ds3/FumeExceptionDataMapper.xml
index 5090606..0f3b8e3 100644
--- a/src/main/resources/mapper/ds3/FumeExceptionDataMapper.xml
+++ b/src/main/resources/mapper/ds3/FumeExceptionDataMapper.xml
@@ -1,19 +1,19 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
-<mapper namespace="cn.flightfeather.supervision.domain.ds3.mapper.FumeExceptionDataMapper" >
- <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.ds3.entity.FumeExceptionData" >
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.flightfeather.supervision.domain.ds3.mapper.FumeExceptionDataMapper">
+ <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.ds3.entity.FumeExceptionData">
<!--
WARNING - @mbg.generated
-->
- <id column="id" property="id" jdbcType="INTEGER" />
- <result column="dev_id" property="devId" jdbcType="VARCHAR" />
- <result column="exception" property="exception" jdbcType="VARCHAR" />
- <result column="exception_type" property="exceptionType" jdbcType="VARCHAR" />
- <result column="region" property="region" jdbcType="VARCHAR" />
- <result column="begin_time" property="beginTime" jdbcType="TIMESTAMP" />
- <result column="end_time" property="endTime" jdbcType="TIMESTAMP" />
+ <id column="id" jdbcType="INTEGER" property="id" />
+ <result column="dev_id" jdbcType="VARCHAR" property="devId" />
+ <result column="exception" jdbcType="VARCHAR" property="exception" />
+ <result column="exception_type" jdbcType="VARCHAR" property="exceptionType" />
+ <result column="region" jdbcType="VARCHAR" property="region" />
+ <result column="begin_time" jdbcType="TIMESTAMP" property="beginTime" />
+ <result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
</resultMap>
- <sql id="Base_Column_List" >
+ <sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
-->
diff --git a/src/test/kotlin/cn/flightfeather/supervision/business/bgtask/AopTaskCtrlTest.kt b/src/test/kotlin/cn/flightfeather/supervision/business/bgtask/AopTaskCtrlTest.kt
index 242ae46..5615141 100644
--- a/src/test/kotlin/cn/flightfeather/supervision/business/bgtask/AopTaskCtrlTest.kt
+++ b/src/test/kotlin/cn/flightfeather/supervision/business/bgtask/AopTaskCtrlTest.kt
@@ -40,8 +40,15 @@
}
@Test
+ fun startMonthly() {
+ aopTaskCtrl.startAll(LocalDate.now().atStartOfDay().minusMonths(1))
+ val reader = BufferedReader(InputStreamReader(System.`in`))
+ reader.readLine()
+ }
+
+ @Test
fun startNewTask(){
- val time = LocalDate.of(2024, 6, 23).atStartOfDay()
+ val time = LocalDate.of(2024, 7, 23).atStartOfDay()
aopTaskCtrl.startNewTask(aopTaskCtrl.getArea(time, "310106", "闈欏畨鍖�", Constant.SceneType.TYPE1))
val reader = BufferedReader(InputStreamReader(System.`in`))
reader.readLine()
--
Gitblit v1.9.3