Explorar o código

设备服务业务空间关系计算

caiaf %!s(int64=4) %!d(string=hai) anos
pai
achega
f6fadd66ff

+ 10 - 7
datacenter/src/main/kotlin/com/persagy/server/services/relation_calc/RelationCalcService.kt

@@ -45,6 +45,9 @@ import com.persagy.service.utils.SSpringContextUtil
 import org.slf4j.LoggerFactory
 import org.springframework.beans.factory.annotation.Autowired
 import org.springframework.stereotype.Service
+import java.util.*
+import kotlin.collections.ArrayList
+import kotlin.collections.HashMap
 
 /**
  * 自动关系计算
@@ -1151,10 +1154,10 @@ open class RelationCalcService {
             }
 
             for ((mapKey, mapValue) in map) {
-                val element = REq2SpService.select(SFilter.eq("id1",mapKey), SFilter.eq("id2",mapValue)).exec()
-                if(element != null && element.size >0){
-                    continue
-                }
+//                val element = REq2SpService.select(SFilter.eq("id1",mapKey), SFilter.eq("id2",mapValue)).exec()
+//                if(element != null && element.size >0){
+//                    continue
+//                }
                 val req = REq2Sp()
                 req.id1 = mapKey
                 req.id2 = mapValue
@@ -1162,12 +1165,12 @@ open class RelationCalcService {
                 req.sign = 1
                 req.type = "eq2sp_for"
                 req.zoneType = "GeneralZone"
+                req.lastUpdate = Date()
 
-
-                REq2SpService.insert(req)
+                REq2SpService.replace(req)
             }
 
-            Thread.sleep(2000000);
+//            Thread.sleep(2000000);
 
             /*************************上面添加数据**********************************/