Browse Source

********************WX******************
删除建筑和楼层提示

zhangweixin 4 năm trước cách đây
mục cha
commit
db3f96626c
18 tập tin đã thay đổi với 120 bổ sung86 xóa
  1. 1 1
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/electricity/RelEquipmentSyRoutinePower.kt
  2. 1 1
      datacenter/build.gradle
  3. 3 0
      datacenter/src/main/kotlin/com/persagy/server/Opt.kt
  4. 2 2
      datacenter/src/main/kotlin/com/persagy/server/jms/TopicReceiver.kt
  5. 23 0
      datacenter/src/main/kotlin/com/persagy/server/services/base/Service.kt
  6. 8 4
      datacenter/src/main/kotlin/com/persagy/server/services/objects/EquipmentService.kt
  7. 15 21
      datacenter/src/main/kotlin/com/persagy/server/services/objects/LocationPointServices.kt
  8. 2 2
      datacenter/src/main/resources/application-dev.yml
  9. 6 6
      datacenter/src/main/resources/logback-spring.xml
  10. 1 1
      datasyn/src/main/kotlin/com/persagy/server/syn/task/SchedulerTask.kt
  11. 1 1
      datasyn/src/main/kotlin/com/persagy/server/syn/task/SchedulerTaskRel.kt
  12. 16 0
      scanbuilding/src/main/kotlin/com/persagy/server/Opts.kt
  13. 12 0
      scanbuilding/src/main/kotlin/com/persagy/server/Swagger3Config.kt
  14. 11 15
      scanbuilding/src/main/kotlin/com/persagy/server/services/UserService.kt
  15. 5 9
      scanbuilding/src/main/kotlin/com/persagy/server/services/task/EquipScanTaskService.kt
  16. 5 8
      scanbuilding/src/main/kotlin/com/persagy/server/services/task/ModelScanTaskService.kt
  17. 6 13
      scanbuilding/src/main/kotlin/com/persagy/server/services/task/PropertyScanTaskService.kt
  18. 2 2
      scanbuilding/src/main/resources/application-dev.yml

+ 1 - 1
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/electricity/RelEquipmentSyRoutinePower.kt

@@ -43,7 +43,7 @@ open class RelEquipmentSyRoutinePower : EquipmentBase() {
 
     /** 级联-设备 */
     @Schema(description = "级联-设备")
-    @SCascade(table="r_eq2eq", idColumn="id1", childIdColumn="id2",self = false,filter = "type = 'eq2eq_EquipPower_3'")
+    @SCascade(table="relationship.r_eq2eq", idColumn="id1", childIdColumn="id2",self = false,filter = "type = 'eq2eq_EquipPower_3'")
     var objectInfo: ArrayList<RelEquipmentFloor>? = null
 
 }

+ 1 - 1
datacenter/build.gradle

@@ -65,7 +65,7 @@ dependencies {
     compile group: 'org.springframework.boot',    name: 'spring-boot-starter-amqp', version: SPRING_BOOT_VERSION
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // spring cloud 依赖
-    compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-eureka', version: SPRING_CLOUD_VERSION
+//    compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-eureka', version: SPRING_CLOUD_VERSION
 
 
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*

+ 3 - 0
datacenter/src/main/kotlin/com/persagy/server/Opt.kt

@@ -64,6 +64,9 @@ object Opt {
     /** 账号信息 */
     val account: String?
         get() = SPageContext.getHeader("userId")
+    /** 集团编码 */
+    val groupCode: String?
+        get() = SPageContext.getHeader("groupCode")
 
     /**  使用字典信息点全局定义 ****************************************************************************/
     /** 楼层平面图 */

+ 2 - 2
datacenter/src/main/kotlin/com/persagy/server/jms/TopicReceiver.kt

@@ -63,8 +63,8 @@ class TopicReceiver {
      *
      * @param
      */
-    @RabbitListener(queues = ["queue-center-adm"])
-    @RabbitHandler
+//    @RabbitListener(queues = ["queue-center-adm"])
+//    @RabbitHandler
     fun receiveMessage(message: String) {
         try {
             println("接收数据中心消息 , $message")

+ 23 - 0
datacenter/src/main/kotlin/com/persagy/server/services/base/Service.kt

@@ -26,6 +26,7 @@
 
 package com.persagy.server.services.base
 
+import com.persagy.base.extensions.toJson
 import com.persagy.database.SAbstractDao
 import com.persagy.database.SFilter
 import com.persagy.database.extensions.keyValue
@@ -35,11 +36,14 @@ import com.persagy.server.datacenter.models.entities.base.BaseInfo
 import com.persagy.server.datacenter.models.entities.dictnew.DefClass
 import com.persagy.server.datacenter.models.entities.logs.DataCenterLogs
 import com.persagy.server.jms.RabbitMqService
+import com.persagy.server.scanbuilding.UserLog
 import com.persagy.server.services.assistant.SchemeService
 import com.persagy.server.services.log.DataCenterLogsService
+import com.persagy.server.services.objects.PropertyService
 import com.persagy.server.services.rel.RSpInBdService
 import com.persagy.server.services.rel.RSpInFlService
 import com.persagy.server.synchronize.MessageHandler
+import com.persagy.server.utils.IdUtils
 import com.persagy.service.SObjectService
 import com.persagy.service.utils.SSpringContextUtil
 import org.slf4j.LoggerFactory
@@ -99,6 +103,25 @@ open class Service<ENTITY : BaseInfo>(daoClass: SAbstractDao<ENTITY>) : SObjectS
             } catch (e: Exception) {
                 e.printStackTrace()
             }
+
+            if (!Opt.coming.isNullOrEmpty()&&Opt.coming == "app") {
+                try {
+                    val user = PropertyService.userService.select(SFilter.eq("projectId", Opt.projectId!!), SFilter.eq("name", Opt.account!!)).entity()
+                    val userLog = UserLog()
+                    userLog.comming = "app"
+                    userLog.action = "创建设备"
+                    userLog.id = IdUtils.uuidCreate()
+                    userLog.note = "创建现场发现的设备"
+                    userLog.phone = user?.phone
+                    userLog.projectId = Opt.projectId
+                    userLog.userId = user?.id
+                    userLog.name = user?.name
+                    userLog.objectId = it.keyValue("id").toString()
+                    PropertyService.userLogService.insert(userLog)
+                } catch (e: Exception) {
+                    e.printStackTrace()
+                }
+            }
         }
 
         return

+ 8 - 4
datacenter/src/main/kotlin/com/persagy/server/services/objects/EquipmentService.kt

@@ -26,6 +26,7 @@
 
 package com.persagy.server.services.objects
 
+import cn.sagacloud.server.scanbuilding.User
 import com.persagy.base.extensions.toJson
 import com.persagy.database.SFilter
 import com.persagy.database.SQueryBuilder
@@ -43,6 +44,7 @@ import com.persagy.server.services.log.DataCenterLogsService
 import com.persagy.server.utils.IdUtils
 import com.persagy.server.utils.ShaftNameUtil
 import com.persagy.service.SBaseService
+import com.persagy.service.SObjectService
 import com.persagy.service.models.enums.SResponseType
 import com.persagy.service.models.requests.SUpdateRequest
 import com.persagy.service.models.responses.SQueryResponse
@@ -59,6 +61,8 @@ object EquipmentService : Service<Equipment>(SMybatisDao(Equipment::class.java))
 
     /** 关系总览服务 */
     val relationTypeProjectservice = SBaseService(SMybatisDao(RelationTypeProject::class.java))
+    /** 用户 */
+    var userService = SObjectService(SMybatisDao(User::class.java))
 
     /**
      * 创建前赋值操作
@@ -386,16 +390,16 @@ object EquipmentService : Service<Equipment>(SMybatisDao(Equipment::class.java))
                 try {
                     if (!Opt.coming.isNullOrEmpty()){
                         if (Opt.coming == "app"){
-                            val user = LocationPointServices.userService.select(SFilter.eq("projectId", Opt.projectId!!), SFilter.eq("phone", Opt.account!!)).entity()
+                            val user = LocationPointServices.userService.select(SFilter.eq("projectId", Opt.projectId!!), SFilter.eq("name", Opt.account!!)).entity()
                             val userLog = UserLog()
                             userLog.comming = "app"
                             userLog.action = "更新设备"
                             userLog.id = IdUtils.uuidCreate()
-                            userLog.note = "项目ID: "+Opt.projectId+" 用户ID:"+user!!.id+" 手机号:"+ Opt.account+" 请求来源:"+Opt.coming+ " "+entity.toJson()
+                            userLog.note = "更新设备信息"
                             userLog.phone = Opt.account
                             userLog.projectId = Opt.projectId
-                            userLog.userId = user.id
-                            userLog.name = user.name
+                            userLog.userId = user?.id
+                            userLog.name = user?.name
                             userLog.objectId = entity.id
                             LocationPointServices.userLogService.insert(userLog)
                         }

+ 15 - 21
datacenter/src/main/kotlin/com/persagy/server/services/objects/LocationPointServices.kt

@@ -30,6 +30,7 @@ import cn.sagacloud.server.scanbuilding.User
 import com.persagy.base.extensions.toJson
 import com.persagy.database.SFilter
 import com.persagy.mybatis.SMybatisDao
+import com.persagy.server.Opt
 import com.persagy.server.datacenter.models.entities.assistant.PointImage
 import com.persagy.server.datacenter.models.entities.objects.LocationPoint
 import com.persagy.server.scanbuilding.UserLog
@@ -88,25 +89,22 @@ object LocationPointServices : RService<LocationPoint>(SMybatisDao(LocationPoint
 
         try {
             val projectId = SPageContext.getHeader("projectId")
-            val comming = SPageContext.getHeader("coming")
-            val account = SPageContext.getHeader("account")
             for (entity in entityList){
                 try {
-                    if (!comming.isNullOrEmpty()){
-                        if (comming == "app"){
-                            val user = userService.select(SFilter.eq("projectId", projectId!!), SFilter.eq("phone", account!!)).entity()
+                    if (!Opt.coming.isNullOrEmpty()&&Opt.coming == "app"){
+                            val user = userService.select(SFilter.eq("projectId", projectId!!), SFilter.eq("name", Opt.account!!)).entity()
                             val userLog = UserLog()
                             userLog.comming = "app"
                             userLog.action = "创建点位标签"
                             userLog.id = IdUtils.uuidCreate()
-                            userLog.note = "项目ID: "+projectId+" 用户ID:"+user!!.id+" 手机号:"+ account+" 请求来源:"+comming+ " "+entity.toJson()
-                            userLog.phone = account
+                            userLog.note = "标记点位空间"
+                            userLog.phone = user?.phone
                             userLog.projectId = projectId
-                            userLog.userId = user.id
-                            userLog.name = user.name
+                            userLog.userId = user?.id
+                            userLog.name = user?.name
                             userLog.objectId = entity.id
                             userLogService.insert(userLog)
-                        }
+
                     }
                 } catch (e: Exception) {
                     e.printStackTrace()
@@ -145,25 +143,21 @@ object LocationPointServices : RService<LocationPoint>(SMybatisDao(LocationPoint
         super.onUpdateSuccess(entityList)
         try {
             val projectId = SPageContext.getHeader("projectId")
-            val comming = SPageContext.getHeader("coming")
-            val account = SPageContext.getHeader("account")
             for (entity in entityList){
                 try {
-                    if (!comming.isNullOrEmpty()){
-                        if (comming == "app"){
-                            val user = userService.select(SFilter.eq("projectId", projectId!!), SFilter.eq("phone", account!!)).entity()
+                    if (!Opt.coming.isNullOrEmpty()&&Opt.coming == "app"){
+                            val user = userService.select(SFilter.eq("projectId", Opt.projectId!!), SFilter.eq("phone", Opt.account!!)).entity()
                             val userLog = UserLog()
                             userLog.comming = "app"
                             userLog.action = "更新点位标签"
                             userLog.id = IdUtils.uuidCreate()
-                            userLog.note = "项目ID: "+projectId+" 用户ID:"+user!!.id+" 手机号:"+ account+" 请求来源:"+comming+ " "+entity.toJson()
-                            userLog.phone = account
-                            userLog.projectId = projectId
-                            userLog.userId = user.id
-                            userLog.name = user.name
+                            userLog.note = "更新点位标签信息"
+                            userLog.phone = user?.phone
+                            userLog.projectId = Opt.projectId
+                            userLog.userId = user?.id
+                            userLog.name = user?.name
                             userLog.objectId = entity.id
                             userLogService.insert(userLog)
-                        }
                     }
                 } catch (e: Exception) {
                     e.printStackTrace()

+ 2 - 2
datacenter/src/main/resources/application-dev.yml

@@ -34,9 +34,9 @@ spring:
     type:                               com.alibaba.druid.pool.DruidDataSource
     driver-class-name:                  org.postgresql.Driver
 #    url:                                jdbc:postgresql://60.205.177.43:5432/datacenterlabsl
-    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
+#    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
 #    url:                                jdbc:postgresql://192.168.64.15:5432/datacenter
-#    url:                                jdbc:postgresql://39.102.40.239:5432/datacenter
+    url:                                jdbc:postgresql://39.102.40.239:5432/datacenter
     username:                           postgres
 #    password:                           persagy_2020qwe!@#
     password:                           cGVyc2FneV8yMDIwcXdlIUAj

+ 6 - 6
datacenter/src/main/resources/logback-spring.xml

@@ -38,21 +38,21 @@
     </appender>
 
     <!-- 定义cn.sagacloud包的日志级别 -->
-    <logger name="com.persagy" level="debug" additivity="false">
-        <appender-ref ref="STDOUT"/>
-    </logger>
+<!--    <logger name="com.persagy" level="debug" additivity="false">-->
+<!--        <appender-ref ref="STDOUT"/>-->
+<!--    </logger>-->
 
-    <!-- 定义com.persagy包的日志级别 -->
+<!--    &lt;!&ndash; 定义com.persagy包的日志级别 &ndash;&gt;-->
     <logger name="com.persagy" level="debug" additivity="false">
         <appender-ref ref="STDOUT"/>
     </logger>
 
-<!--    &lt;!&ndash; 定义cn.sagacloud包的日志级别 &ndash;&gt;-->
+<!--&lt;!&ndash;    &lt;!&ndash; 定义cn.sagacloud包的日志级别 &ndash;&gt;&ndash;&gt;-->
 <!--    <logger name="com.persagy" level="ERROR" additivity="false">-->
 <!--        <appender-ref ref="STDOUT"/>-->
 <!--    </logger>-->
 
-<!--    &lt;!&ndash; 定义com.persagy包的日志级别 &ndash;&gt;-->
+<!--&lt;!&ndash;    &lt;!&ndash; 定义com.persagy包的日志级别 &ndash;&gt;&ndash;&gt;-->
 <!--    <logger name="com.persagy" level="ERROR" additivity="false">-->
 <!--        <appender-ref ref="STDOUT"/>-->
 <!--    </logger>-->

+ 1 - 1
datasyn/src/main/kotlin/com/persagy/server/syn/task/SchedulerTask.kt

@@ -53,7 +53,7 @@ class SchedulerTask {
     //cron表达式:每隔5秒执行一次
 //    @Scheduled(cron = "0 */5 * * * ?")
 //    @Scheduled(cron="0/30 * *  * * ? ")   //每5秒执行一次
-//    @Scheduled(cron = "0 */1 * * * ?")
+    @Scheduled(cron = "0 */1 * * * ?")
     fun scheduled() {
         logger.info("同步数据中心任务开始至中台")
         messageProcessing.syncDataCenter()

+ 1 - 1
datasyn/src/main/kotlin/com/persagy/server/syn/task/SchedulerTaskRel.kt

@@ -53,7 +53,7 @@ class SchedulerTaskRel {
     //cron表达式:每隔5秒执行一次
 //    @Scheduled(cron = "0 */5 * * * ?")
 //    @Scheduled(cron="0/5 * *  * * ? ")   //每5秒执行一次
-//    @Scheduled(cron = "0 */3 * * * ?")
+    @Scheduled(cron = "0 */3 * * * ?")
     fun scheduled() {
         logger.info("同步数据中心任务开始至数据中台-关系数据")
         messageProcessing.syncDataCenterRel()

+ 16 - 0
scanbuilding/src/main/kotlin/com/persagy/server/Opts.kt

@@ -26,6 +26,8 @@
 
 package com.persagy.server
 
+import com.persagy.service.SPageContext
+
 /**
  * 配置信息
  *
@@ -51,6 +53,20 @@ object Opts {
 //    /** 二维码服务器地址 */
 //    const val qrCodeServer = "http://192.168.30.96:8080/qrcode"
 
+    /** 项目 id */
+    val projectId: String?
+        get() = SPageContext.getHeader("projectId")
+    /** 数据来源 */
+    val coming: String?
+        get() = SPageContext.getHeader("appId")
+    /** 账号信息 */
+    val account: String?
+        get() = SPageContext.getHeader("userId")
+    /** 集团编码 */
+    val groupCode: String?
+        get() = SPageContext.getHeader("groupCode")
+
+
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // 线上环境
     /** 数据平台地址 */

+ 12 - 0
scanbuilding/src/main/kotlin/com/persagy/server/Swagger3Config.kt

@@ -122,7 +122,19 @@ open class Swagger3Config {
             val projectId = Parameter().`in`(ParameterIn.HEADER.toString())
                 .name("projectId").description("项目 id")
                 .schema(StringSchema()).required(false)
+            val groupCode = Parameter().`in`(ParameterIn.HEADER.toString())
+                .name("groupCode").description("集团编码")
+                .schema(StringSchema()).required(false)
+            val appId = Parameter().`in`(ParameterIn.HEADER.toString())
+                .name("appId").description("应用id")
+                .schema(StringSchema()).required(false)
+            val userId = Parameter().`in`(ParameterIn.HEADER.toString())
+                .name("userId").description("用户id")
+                .schema(StringSchema()).required(false)
             operation.addParametersItem(projectId)
+            operation.addParametersItem(groupCode)
+            operation.addParametersItem(appId)
+            operation.addParametersItem(userId)
             return operation
         }
     }

+ 11 - 15
scanbuilding/src/main/kotlin/com/persagy/server/services/UserService.kt

@@ -75,7 +75,6 @@ object UserService : SObjectService<User>(SMybatisDao(User::class.java)) {
      */
     fun create(request: SCreateRequest<User>): SCreateResponse<User> {
         val projectId = SPageContext.getHeader("projectId")
-        val coming = SPageContext.getHeader("coming")
         val sCreateResponse = SCreateResponse<User>(SResponseType.success)
         if (!request.content.isNullOrEmpty()) {
             for (content in request.content) {
@@ -91,14 +90,14 @@ object UserService : SObjectService<User>(SMybatisDao(User::class.java)) {
                     if(insert){
                         try {
                             val userLog = UserLog()
-                            userLog.comming = coming!!
+                            userLog.comming = Opts.coming
                             userLog.action = "创建用户"
                             userLog.id = QrCodeUntils.uuidCreate()
-                            userLog.note = QrCodeUntils.toLog(content,coming)
+                            userLog.note =  "创建用户信息"
                             userLog.phone = content.phone
                             userLog.projectId = projectId
                             userLog.userId = content.userId
-                            userLog.userName = content.userName
+                            userLog.userName = Opts.account
                             userLogService.insert(userLog)
                         } catch (e: Exception) {
                             e.printStackTrace()
@@ -144,16 +143,15 @@ object UserService : SObjectService<User>(SMybatisDao(User::class.java)) {
 
         try {
             val projectId = SPageContext.getHeader("projectId")
-            val coming = SPageContext.getHeader("coming")
             val userLog = UserLog()
-            userLog.comming = coming!!
+            userLog.comming = Opts.coming
             userLog.action = "删除用户"
             userLog.id = QrCodeUntils.uuidCreate()
-            userLog.note = QrCodeUntils.toLog(entity,coming)
+            userLog.note = "删除项目下用户"
             userLog.phone = entity.phone
             userLog.projectId = projectId
             userLog.userId = entity.userId
-            userLog.userName = entity.userName
+            userLog.userName = Opts.account
             userLogService.insert(userLog)
         } catch (e: Exception) {
             e.printStackTrace()
@@ -167,7 +165,6 @@ object UserService : SObjectService<User>(SMybatisDao(User::class.java)) {
     fun update(@RequestBody request: SUpdateRequest<User>): SBaseResponse {
         val sBaseResponse = SBaseResponse(SResponseType.success)
         val projectId = SPageContext.getHeader("projectId")
-        val coming = SPageContext.getHeader("coming")
         if (!request.content.isNullOrEmpty()) {
             for (content in request.content!!) {
                 val entity = select(SFilter.eq("projectId", projectId!!),SFilter.not(SFilter.eq("userId",content.userId!!)), SFilter.eq("phone", content.phone!!)).entity()
@@ -180,14 +177,14 @@ object UserService : SObjectService<User>(SMybatisDao(User::class.java)) {
                     if (update) {
                         try {
                             val userLog = UserLog()
-                            userLog.comming = coming
+                            userLog.comming = Opts.coming
                             userLog.action = "更新用户信息"
                             userLog.id = QrCodeUntils.uuidCreate()
-                            userLog.note = QrCodeUntils.toLog(content,coming)
+                            userLog.note = "更新用户信息"
                             userLog.phone = content.phone
                             userLog.projectId = projectId
                             userLog.userId = content.userId
-                            userLog.userName = content.userName
+                            userLog.userName = Opts.account
                             userLogService.insert(userLog)
                         } catch (e: Exception) {
                             e.printStackTrace()
@@ -243,16 +240,15 @@ object UserService : SObjectService<User>(SMybatisDao(User::class.java)) {
             if (userList.size>0){
                 try {
                     var projectId = SPageContext.getHeader("projectId")
-                    val coming = SPageContext.getHeader("coming")
                     logger.debug("ProjectId====$projectId")
                     if (projectId.isNullOrEmpty()){
                         projectId = userList[0].projectId
                     }
                     val userLog = UserLog()
-                    userLog.comming = coming!!
+                    userLog.comming = Opts.coming
                     userLog.action = "用户登录"
                     userLog.id = QrCodeUntils.uuidCreate()
-                    userLog.note = QrCodeUntils.toLog(userList[0],coming)
+                    userLog.note = "APP用户登录"
                     userLog.phone = phone
                     userLog.projectId = projectId
                     userLog.userId = userList[0].userId

+ 5 - 9
scanbuilding/src/main/kotlin/com/persagy/server/services/task/EquipScanTaskService.kt

@@ -295,8 +295,6 @@ object EquipScanTaskService : RService<EquipScanTask>(SMybatisDao(EquipScanTask:
      */
     override fun onUpdateSuccess(list: ArrayList<EquipScanTask>) {
         val projectId = SPageContext.getHeader("projectId")
-        val comming = SPageContext.getHeader("coming")
-        val account = SPageContext.getHeader("account")
         for (task in list) {
             val equipmentService = SBaseService(SMybatisDao(Equipment::class.java))
             if(task.equipId == null ){
@@ -326,21 +324,19 @@ object EquipScanTaskService : RService<EquipScanTask>(SMybatisDao(EquipScanTask:
             }
 
             try {
-                if (!comming.isNullOrEmpty()){
-                    if (comming == "app"){
-                        val entity = userService.select(SFilter.eq("projectId", projectId!!), SFilter.eq("phone", account!!)).entity()
+                if (!Opts.coming.isNullOrEmpty()&&Opts.coming == "app"){
+                        val entity = userService.select(SFilter.eq("projectId", projectId!!), SFilter.eq("name", Opts.account!!)).entity()
                         val userLog = UserLog()
                         userLog.comming = "app"
                         userLog.action = "修改任务"
                         userLog.id = IdUtils.uuidCreate()
-                        userLog.note = "项目ID: "+projectId+" 用户ID:"+entity!!.id+" 手机号:"+ account+" 请求来源:"+comming+ " "+task.toJson()
-                        userLog.phone = account
+                        userLog.note = "确认设备任务"
+                        userLog.phone = entity?.phone
                         userLog.projectId = projectId
                         userLog.userId = entity!!.id
                         userLog.name = entity.name
-                        userLog.objectId = task.equipId
+                        userLog.objectId = task.id
                         userLogService.insert(userLog)
-                    }
                 }
             } catch (e: Exception) {
                 e.printStackTrace()

+ 5 - 8
scanbuilding/src/main/kotlin/com/persagy/server/services/task/ModelScanTaskService.kt

@@ -286,8 +286,6 @@ object ModelScanTaskService : RService<ModelScanTask>(SMybatisDao(ModelScanTask:
     override fun onUpdateSuccess(list: ArrayList<ModelScanTask>) {
 
         val projectId = SPageContext.getHeader("projectId")
-        val comming = SPageContext.getHeader("coming")
-        val account = SPageContext.getHeader("account")
 
         for (task in list) {
             val equipmentService = SBaseService(SMybatisDao(Equipment::class.java))
@@ -318,21 +316,20 @@ object ModelScanTaskService : RService<ModelScanTask>(SMybatisDao(ModelScanTask:
                 equipmentService.update(equip)
             }
             try {
-                if (!comming.isNullOrEmpty()){
-                    if (comming == "app"){
-                        val entity = userService.select(SFilter.eq("projectId", projectId!!), SFilter.eq("phone", account!!)).entity()
+                if (!Opts.coming.isNullOrEmpty()&&Opts.coming == "app"){
+
+                        val entity = userService.select(SFilter.eq("projectId", projectId!!), SFilter.eq("name", Opts.account!!)).entity()
                         val userLog = UserLog()
                         userLog.comming = "app"
                         userLog.action = "修改任务"
                         userLog.id = IdUtils.uuidCreate()
-                        userLog.note = "项目ID: "+projectId+" 用户ID:"+entity!!.id+" 手机号:"+ account+" 请求来源:"+comming+ " "+task.toJson()
-                        userLog.phone = account
+                        userLog.note = "确认模型设备任务"
+                        userLog.phone = entity?.phone
                         userLog.projectId = projectId
                         userLog.userId = entity!!.id
                         userLog.name = entity.name
                         userLog.objectId = task.equipId
                         userLogService.insert(userLog)
-                    }
                 }
             } catch (e: Exception) {
                 e.printStackTrace()

+ 6 - 13
scanbuilding/src/main/kotlin/com/persagy/server/services/task/PropertyScanTaskService.kt

@@ -263,8 +263,6 @@ object PropertyScanTaskService : RService<PropertyScanTask>(SMybatisDao(Property
      */
     override fun onUpdateSuccess(list: ArrayList<PropertyScanTask>) {
         val projectId = SPageContext.getHeader("projectId")
-        val comming = SPageContext.getHeader("Coming")
-        val account = SPageContext.getHeader("Account")
         for (task in list) {
             val propertyService = SBaseService(SMybatisDao(Property::class.java))
             if(task.equipId == null ){
@@ -280,21 +278,19 @@ object PropertyScanTaskService : RService<PropertyScanTask>(SMybatisDao(Property
                 propertyService.update(property)
             }
             try {
-                if (!comming.isNullOrEmpty()){
-                    if (comming == "app"){
-                        val entity = userService.select(SFilter.eq("projectId", projectId!!), SFilter.eq("phone", account!!)).entity()
+                if (!Opts.coming.isNullOrEmpty()&&Opts.coming == "app"){
+                        val entity = userService.select(SFilter.eq("projectId", projectId!!), SFilter.eq("name", Opts.account!!)).entity()
                         val userLog = UserLog()
                         userLog.comming = "app"
-                        userLog.action = "修改任务"
+                        userLog.action = "修改资产任务"
                         userLog.id = IdUtils.uuidCreate()
-                        userLog.note = "项目ID: "+projectId+" 用户ID:"+entity!!.id+" 手机号:"+ account+" 请求来源:"+comming+ " "+task.toJson()
-                        userLog.phone = account
+                        userLog.note = "确认资产任务"
+                        userLog.phone = entity?.phone
                         userLog.projectId = projectId
                         userLog.userId = entity!!.id
                         userLog.name = entity.name
-                        userLog.objectId = task.equipId
+                        userLog.objectId = task.id
                         userLogService.insert(userLog)
-                    }
                 }
             } catch (e: Exception) {
                 e.printStackTrace()
@@ -315,9 +311,6 @@ object PropertyScanTaskService : RService<PropertyScanTask>(SMybatisDao(Property
             }
         }
         super.onQuerySuccess(pageInfo)
-
     }
 
-
-
 } // Class PropertyScanTaskService

+ 2 - 2
scanbuilding/src/main/resources/application-dev.yml

@@ -6,10 +6,10 @@ spring:
 #    url:                                jdbc:postgresql://172.16.44.234:5432/datacenter
 #    username:                           postgres
 #    password:                           123456
-#    url:                                jdbc:postgresql://39.102.40.239:5432/datacenter
+    url:                                jdbc:postgresql://39.102.40.239:5432/datacenter
 #    url:                                jdbc:postgresql://60.205.177.43:5432/datacenterlabsl
 #    url:                                jdbc:postgresql://192.168.64.15:5432/datacenter
-    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
+#    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
     username:                           postgres
     #    password:                           persagy_2020qwe!@#
     password:                           cGVyc2FneV8yMDIwcXdlIUAj