Explorar el Código

********************WX******************
关系修复,扫楼问题记录

zhangweixin hace 4 años
padre
commit
210ca4391a
Se han modificado 22 ficheros con 197 adiciones y 52 borrados
  1. 3 1
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/dictnew/DefFuncId.kt
  2. 1 1
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/electricity/RelEquipmentHubOrdinary.kt
  3. 1 1
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/electricity/RelEquipmentHubPrepare.kt
  4. 1 1
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/electricity/RelEquipmentLubOrdinary.kt
  5. 1 1
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/electricity/RelEquipmentLubPrepare.kt
  6. 1 1
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/electricity/RelEquipmentSparePower.kt
  7. 1 1
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/electricity/RelEquipmentSySparePower.kt
  8. 2 2
      datacenter/src/main/kotlin/com/persagy/server/jms/TopicReceiver.kt
  9. 1 0
      datacenter/src/main/kotlin/com/persagy/server/services/graphtype/RelationTypeProjectService.kt
  10. 7 2
      datacenter/src/main/kotlin/com/persagy/server/services/objects/FloorService.kt
  11. 1 1
      datacenter/src/main/kotlin/com/persagy/server/services/objects/ZoneSpaceBaseService.kt
  12. 17 1
      datacenter/src/main/kotlin/com/persagy/server/services/rel/RSyEqService.kt
  13. 14 14
      datacenter/src/main/resources/application-test.yml
  14. 7 3
      datasyn/src/main/kotlin/com/persagy/server/syn/Opts.kt
  15. 7 1
      datasyn/src/main/kotlin/com/persagy/server/syn/models/api/dict/DictTypeApi.kt
  16. 2 1
      datasyn/src/main/kotlin/com/persagy/server/syn/services/dict/DClassDefService.kt
  17. 1 1
      datasyn/src/main/kotlin/com/persagy/server/syn/task/SchedulerTask.kt
  18. 1 1
      datasyn/src/main/kotlin/com/persagy/server/syn/task/SchedulerTaskRel.kt
  19. 24 15
      datasyn/src/main/resources/application-prod.yml
  20. 65 0
      datasyn/src/main/resources/application-prod2.yml
  21. 37 1
      scanbuilding/src/main/kotlin/com/persagy/server/services/task/RecordProblemsService.kt
  22. 2 2
      scanbuilding/src/main/resources/application-dev.yml

+ 3 - 1
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/dictnew/DefFuncId.kt

@@ -224,7 +224,9 @@ open class DefFuncId: Serializable {
     @Schema(description = "路径")
     var path: String? = null
         get() {
-            return  if (!code.isNullOrEmpty()&&DictInfoTools.pathCode(code!!)) {
+            return if (!classCode.isNullOrEmpty()&&!code.isNullOrEmpty()&&code == "height" ){
+                "infos.$code"
+            } else if (!code.isNullOrEmpty()&&DictInfoTools.pathCode(code!!)) {
                 code
             } else if (firstName == "基本信息"&&code == "pic"){
                 code

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

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

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

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

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

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

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

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

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

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

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

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

+ 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")

+ 1 - 0
datacenter/src/main/kotlin/com/persagy/server/services/graphtype/RelationTypeProjectService.kt

@@ -92,6 +92,7 @@ object RelationTypeProjectService : RService<RelationTypeProject>(SMybatisDao(Re
         map["对象名称"] = "name"
         map["对象本地编码"] = "local_id"
         map["对象本地名称"] = "local_name"
+        map["设计图纸中编码"] = "cad_id"
         map
     }
 

+ 7 - 2
datacenter/src/main/kotlin/com/persagy/server/services/objects/FloorService.kt

@@ -121,12 +121,17 @@ object FloorService : Service<Floor>(SMybatisDao(Floor::class.java)) {
                         if (floor.name.isNullOrEmpty()){
                             floor.name = ShaftNameUtil.shaftName("楼层-")
                         }
+                        if (floor.floorSequenceId == null) {
+                            val sCreateResponse = SCreateResponse<Floor>(SResponseType.failure)
+                            sCreateResponse.message = "楼层顺序号不可以为空或类型错误"
+                            return sCreateResponse
+                        }
                         if (!floor.buildingId.isNullOrEmpty()){
                             val floorList = select(SFilter.eq("projectId", projectId!!),
                                 SFilter.eq("buildingId", floor.buildingId!!)).exec()
                             if (floorList.size>0){
                                 for (floor001 in floorList){
-                                    if (floor001.floorSequenceId == floor.floorSequenceId){
+                                    if (floor001.floorSequenceId!=null&&floor001.floorSequenceId == floor.floorSequenceId){
                                         val sCreateResponse = SCreateResponse<Floor>(SResponseType.failure)
                                         sCreateResponse.message = "楼层顺序号不可以重复"
                                         return sCreateResponse
@@ -338,7 +343,7 @@ object FloorService : Service<Floor>(SMybatisDao(Floor::class.java)) {
                     return sBaseResponse
                 }
 
-                val delete = delete(SFilter.eq("projectId", Opt.projectId!!), SFilter.eq("floorId", floor.id!!))
+                val delete = delete(SFilter.eq("projectId", Opt.projectId!!), SFilter.eq("id", floor.id!!))
                 if (delete) {
                     try {
                         rabbitMqService.sendObjects(Opt.projectId!!, Opt.DELETE, floor.id!!)

+ 1 - 1
datacenter/src/main/kotlin/com/persagy/server/services/objects/ZoneSpaceBaseService.kt

@@ -159,7 +159,7 @@ object ZoneSpaceBaseService : ServiceSpace<ZoneSpace>(SMybatisDao(ZoneSpace::cla
                            var listSFilter = ArrayList<SFilter>()
                            listSFilter.add(SFilter.eq("projectId",projectId))
                            listSFilter.add(SFilter.inList("id",listId))
-                           listSFilter.add(SFilter.eq("objectType",request.zoneType!!))
+                           listSFilter.add(SFilter.eq("classCode",request.zoneType!!))
                           val pageQuery = pageQuery(request, listSFilter)
                            spaceSQueryResponse.message = pageQuery.message
                            spaceSQueryResponse.total = pageQuery.total

+ 17 - 1
datacenter/src/main/kotlin/com/persagy/server/services/rel/RSyEqService.kt

@@ -134,6 +134,23 @@ object RSyEqService : RService<RSyEq>(SMybatisDao(RSyEq::class.java)) {
             } catch (e: Exception) {
                 e.printStackTrace()
             }
+            try {
+                /** 处理关系标记 */
+                val listtype = ArrayList<String>()
+                listtype.add("sy2fl")
+                listtype.add("sy2sp")
+                listtype.add("sy2sh")
+                for (type in listtype){
+                    val entity = EquipmentService.relationTypeProjectservice.select(SFilter.eq("projectId", Opt.projectId!!), SFilter.eq("relationType", type)).entity()
+                    if (entity!=null){
+                        entity.computationalState = 2
+                        EquipmentService.relationTypeProjectservice.update(entity)
+                    }
+                }
+            } catch (e: Exception) {
+                e.printStackTrace()
+            }
+
             if (rSyEqList.equipIdList!=null&&rSyEqList.equipIdList!!.isNotEmpty()){
                 for (eqId in rSyEqList.equipIdList!!){
                     val rSyEq = RSyEq()
@@ -148,7 +165,6 @@ object RSyEqService : RService<RSyEq>(SMybatisDao(RSyEq::class.java)) {
                     }
                 }
                 if (successList.size>0){
-
                     try {
                         /** 发送消息 */
                         rabbitMqService.sendRel(Opt.projectId!!, "SystemEquip","13",rSyEqList.sysId!!,successList.toJson()!!)

+ 14 - 14
datacenter/src/main/resources/application-test.yml

@@ -25,28 +25,28 @@ server:
 
 spring:
   datasource:
-#    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
+    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
 #    url:                                jdbc:postgresql://datacenter:5432/datacenterlabsl
-    url:                                jdbc:postgresql://192.168.64.15:5432/datacenter
+#    url:                                jdbc:postgresql://192.168.64.15:5432/datacenter
 #    url:                                jdbc:postgresql://datacenter:5432/datacenter
     username:                           postgres
     password:                           cGVyc2FneV8yMDIwcXdlIUAj
 
-#  rabbitmq:
-#    host: 192.168.100.108
-#    port: 9936
-#    username: pbsage
-#    password: pbsage123
-#    #虚拟host 可以不设置,使用server默认host
-#    virtual-host: /adm
-
   rabbitmq:
-    host: 192.168.64.15
+    host: 192.168.100.108
     port: 9936
-    username: admin
-    password: brzj123456
+    username: pbsage
+    password: pbsage123
     #虚拟host 可以不设置,使用server默认host
-    virtual-host: /test
+    virtual-host: /adm
+
+#  rabbitmq:
+#    host: 192.168.64.15
+#    port: 9936
+#    username: admin
+#    password: brzj123456
+#    #虚拟host 可以不设置,使用server默认host
+#    virtual-host: /test
 
 
   servlet:

+ 7 - 3
datasyn/src/main/kotlin/com/persagy/server/syn/Opts.kt

@@ -50,9 +50,13 @@ open class Opts {
     /** 物理世界地址 */
     lateinit var dataPlatform: String
 
-    lateinit var data_org: String
-    lateinit var data_rwd: String
-    lateinit var data_dic: String
+//    lateinit var data_org: String
+//    lateinit var data_rwd: String
+//    lateinit var data_dic: String
+
+     var data_org: String = "http://172.16.46.33:8831"
+     var data_rwd: String = "http://172.16.46.33:8832"
+     var data_dic: String = "http://172.16.46.33:8830"
 
 
     val SUCCESS_CODE = "success"

+ 7 - 1
datasyn/src/main/kotlin/com/persagy/server/syn/models/api/dict/DictTypeApi.kt

@@ -144,7 +144,7 @@ object DictTypeApi {
      * 平台字典对象类型
      */
     fun dictPlatform(): ArrayList<DictPlatformType>{
-
+        logger.info("888888888888888888888888888888888888888888888888888888888888888888888888")
         try {
             val jsonObject = JSONObject()
             val jsonObject2 = JSONObject()
@@ -153,7 +153,10 @@ object DictTypeApi {
             /** 直接 http 请求还是通过注册中心 */
             if (!Configure.customProperties.eurekaorhttp) {
                 val url = "${Configure.opts.data_rwd}/rwd/def/class/"
+                logger.info("url=${url}")
+                logger.info("boby=${jsonObject}")
                 val postObject = SHttpUtil.postObject<DictPlatformTypeResponse>(url, jsonObject)
+                logger.info("result=${postObject.toJson()}")
                 if (postObject.result == Configure.opts.SUCCESS_CODE) {
                     if (!postObject.data.isNullOrEmpty()){
                         return postObject.data!!
@@ -162,7 +165,10 @@ object DictTypeApi {
             } else {
                 val url = "http://${Configure.serviceNameConfig.DMPRWD}/rwd/def/class/"
     //            val postObject = SHttpUtil.postObject<DictPlatformTypeResponse>(url, jsonObject)
+                logger.info("url=${url}")
+                logger.info("boby=${jsonObject}")
                 val postObject = Configure.restTemplate.postForObject(url, jsonObject, DictPlatformTypeResponse::class.java)
+                logger.info("result=${postObject.toJson()}")
                 if (postObject.result == Configure.opts.SUCCESS_CODE) {
                     if (!postObject.data.isNullOrEmpty()){
                         return postObject.data!!

+ 2 - 1
datasyn/src/main/kotlin/com/persagy/server/syn/services/dict/DClassDefService.kt

@@ -164,9 +164,10 @@ object DClassDefService : SObjectService<DefClass>(SMybatisDao(DefClass::class.j
      */
     fun dictPlatform(): SBaseResponse {
         val sBaseResponse = SBaseResponse()
+        logger.info("*************************************************************************************************")
         val dictPlatformList = DictTypeApi.dictPlatform()
         if (dictPlatformList.size>0){
-            defClassService.delete(SFilter.eq("type","common"))
+//            defClassService.delete(SFilter.eq("type","common"))
             for (dictPlatform in dictPlatformList){
                 val defClass = DefClass()
                 defClass.id = dictPlatform.id

+ 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()

+ 24 - 15
datasyn/src/main/resources/application-prod.yml

@@ -1,32 +1,41 @@
 server:
-  port: 8080
+  port: 8834
 
 spring:
   datasource:
 #    url:                                jdbc:postgresql://data-center:5432/datacenterlabsl
-    url:                                jdbc:postgresql://172.17.100.16:5432/datacenter
+#    url:                                jdbc:postgresql://172.17.100.16:5432/datacenter
+#    username:                           postgres
+#    password:                           cGVyc2FneV8yMDIwcXdlIUAj
+    url:                                jdbc:postgresql://v49201.db.redstar.pro:5432/datacenter
     username:                           postgres
-    password:                           cGVyc2FneV8yMDIwcXdlIUAj
-
+    password:                           123456
 
 
 
     #配置rabbitMq 服务器
+#  rabbitmq:
+#    host: 39.102.43.179
+#    port: 9936
+#    username: admin
+#    password: brzj123456
+#    #虚拟host 可以不设置,使用server默认host
+#    virtual-host: /test
+#    配置rabbitMq 服务器
   rabbitmq:
-    host: 39.102.43.179
-    port: 9936
-    username: admin
-    password: brzj123456
+    host: rabbitmq4928.prod.rs.com
+    port: 5672
+    username: mq_secur
+    password: Mq_seCur0604
     #虚拟host 可以不设置,使用server默认host
-    virtual-host: /test
-
+    virtual-host: /secur
 
 # spring-cloud相关配置
 eureka:
   client:                                   #客户端注册进eureka服务列表内
     service-url:
       #      defaultZone:                          http://192.168.64.18:9931/eureka
-      defaultZone:                                http://frame:123456@39.102.43.179:9931/eureka/
+      defaultZone:                                http://frame:123456@172.16.46.33:9931/integrated-eureka/eureka/,http://frame:123456@172.16.46.34:9931/integrated-eureka/eureka/
 #      defaultZone:                                http://frame:123456@192.168.64.18:9931/eureka
       #      defaultZone:                          http://admin:1qaz2wsx@127.0.0.1:8888/eureka/ #增加密码
       enable-self-preservation: false # 设为false,关闭自我保护
@@ -41,9 +50,9 @@ eureka:
 
 saga:
   dataPlatform:                        http://39.102.40.239:9970
-  data_org:                            http://39.102.40.239:9970
-  data_rwd:                            http://39.102.40.239:9970
-  data_dic:                            http://39.102.40.239:9970
+  data_org:                            http://172.16.46.33:8831
+  data_rwd:                            http://172.16.46.33:8832
+  data_dic:                            http://172.16.46.33:8830
 
 mqtopid:
   exchange:                           exchange-dmp
@@ -52,7 +61,7 @@ mqtopid:
 
 custom: # 自定义类型
   #true 代表eureka  false  代表 http
-  eurekaorhttp:                       true
+  eurekaorhttp:                       false
 
 # 服务名
 servicename: #注册中心使用,服务名

+ 65 - 0
datasyn/src/main/resources/application-prod2.yml

@@ -0,0 +1,65 @@
+server:
+  port: 8080
+
+spring:
+  datasource:
+#    url:                                jdbc:postgresql://data-center:5432/datacenterlabsl
+    url:                                jdbc:postgresql://172.17.100.16:5432/datacenter
+    username:                           postgres
+    password:                           cGVyc2FneV8yMDIwcXdlIUAj
+
+
+
+
+    #配置rabbitMq 服务器
+  rabbitmq:
+    host: 39.102.43.179
+    port: 9936
+    username: admin
+    password: brzj123456
+    #虚拟host 可以不设置,使用server默认host
+    virtual-host: /test
+
+
+# spring-cloud相关配置
+eureka:
+  client:                                   #客户端注册进eureka服务列表内
+    service-url:
+      #      defaultZone:                          http://192.168.64.18:9931/eureka
+      defaultZone:                                http://frame:123456@39.102.43.179:9931/eureka/
+#      defaultZone:                                http://frame:123456@192.168.64.18:9931/eureka
+      #      defaultZone:                          http://admin:1qaz2wsx@127.0.0.1:8888/eureka/ #增加密码
+      enable-self-preservation: false # 设为false,关闭自我保护
+      eviction-interval-timer-in-ms: 5000 # 清理间隔(单位毫秒,默认是60*1000)启用主动失效,
+  instance:
+    #不加的话我看过eureka注册界面,是以docker容器的container id注册过去的,譬如container id为abcde,
+    #那么当访问该微服务时,eureka以http://abcde/xxx,去访问的,当然是访问不到该服务.
+    #配置下面的选项后,就会以内网ip加端口去访问就能访问到了。
+    prefer-ip-address: true
+    instance-id: ${spring.cloud.client.ip-address}:${spring.application.name}:${server.port}
+
+
+saga:
+  dataPlatform:                        http://39.102.40.239:9970
+  data_org:                            http://39.102.40.239:9970
+  data_rwd:                            http://39.102.40.239:9970
+  data_dic:                            http://39.102.40.239:9970
+
+mqtopid:
+  exchange:                           exchange-dmp
+  routingKey:
+
+
+custom: # 自定义类型
+  #true 代表eureka  false  代表 http
+  eurekaorhttp:                       true
+
+# 服务名
+servicename: #注册中心使用,服务名
+
+  DMPORG:                             DMP-ORG   #物理3世界
+  DMPRWD:                             DMP-RWD   #中台
+  DMPDIC:                             DMP-DIC   #字典
+
+
+

+ 37 - 1
scanbuilding/src/main/kotlin/com/persagy/server/services/task/RecordProblemsService.kt

@@ -26,11 +26,15 @@
 
 package com.persagy.server.services.task
 
+import com.persagy.database.SFilter
 import com.persagy.mybatis.SMybatisDao
+import com.persagy.server.Opts
 import com.persagy.server.datacenter.models.entities.task.RecordProblems
+import com.persagy.server.scanbuilding.UserLog
 import com.persagy.server.services.base.RService
 import com.persagy.server.util.IdUtils
 import com.persagy.service.SPageContext
+import org.checkerframework.checker.nullness.Opt
 
 
 /**
@@ -48,10 +52,42 @@ object RecordProblemsService : RService<RecordProblems>(SMybatisDao(RecordProble
         if (entity.projectId.isNullOrEmpty()){
             entity.projectId = projectId
         }
-
+        try {
+            if (!Opts.account.isNullOrEmpty()) {
+                val entity1 = ModelScanTaskService.userService.select(SFilter.eq("projectId",Opts.projectId!!), SFilter.eq("phone", Opts.account!!)).entity()
+                if (entity1!=null) {
+                    entity.author = entity1.name
+                }
+            }
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
         return super.onCreateBefore(entity)
     }
 
+    override fun onCreateSuccess(entityList: ArrayList<RecordProblems>) {
+        super.onCreateSuccess(entityList)
+        try {
+            if (!Opts.coming.isNullOrEmpty()&& Opts.coming == "app"){
+                val entity = ModelScanTaskService.userService.select(SFilter.eq("projectId",Opts.projectId!!), SFilter.eq("phone", Opts.account!!)).entity()
+                val userLog = UserLog()
+                userLog.comming = "app"
+                userLog.action = "问题记录"
+                userLog.id = IdUtils.uuidCreate()
+                userLog.note = "记录扫楼过程的问题"
+                userLog.phone = entity?.phone
+                userLog.projectId = Opts.projectId
+                userLog.userId = entity!!.id
+                userLog.name = entity.name
+                userLog.objectId = entityList[0].id
+                ModelScanTaskService.userLogService.insert(userLog)
+            }
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+
+    }
+
 
 
 

+ 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