|
@@ -29,7 +29,9 @@ package com.persagy.server.services.assistant
|
|
import com.persagy.database.SFilter
|
|
import com.persagy.database.SFilter
|
|
import com.persagy.server.Opt
|
|
import com.persagy.server.Opt
|
|
import com.persagy.server.datacenter.dao.mappers.SchemeMapper
|
|
import com.persagy.server.datacenter.dao.mappers.SchemeMapper
|
|
|
|
+import com.persagy.server.jms.RabbitMqService
|
|
import com.persagy.server.services.objects.FloorService
|
|
import com.persagy.server.services.objects.FloorService
|
|
|
|
+import com.persagy.service.utils.SSpringContextUtil
|
|
import org.slf4j.LoggerFactory
|
|
import org.slf4j.LoggerFactory
|
|
import org.springframework.beans.factory.annotation.Autowired
|
|
import org.springframework.beans.factory.annotation.Autowired
|
|
import org.springframework.stereotype.Service
|
|
import org.springframework.stereotype.Service
|
|
@@ -45,8 +47,14 @@ open class SchemeService {
|
|
companion object {
|
|
companion object {
|
|
/** 日志 */
|
|
/** 日志 */
|
|
private val logger = LoggerFactory.getLogger(SchemeService::class.java)
|
|
private val logger = LoggerFactory.getLogger(SchemeService::class.java)
|
|
|
|
+
|
|
} // Companion object
|
|
} // Companion object
|
|
|
|
|
|
|
|
+ /** RabbitMQ消息对象 */
|
|
|
|
+ val rabbitMqService by lazy {
|
|
|
|
+ SSpringContextUtil.getBean(RabbitMqService::class.java) as RabbitMqService
|
|
|
|
+ }
|
|
|
|
+
|
|
/** 实例化 mapper 对象 */
|
|
/** 实例化 mapper 对象 */
|
|
@Autowired
|
|
@Autowired
|
|
lateinit var mapper: SchemeMapper
|
|
lateinit var mapper: SchemeMapper
|
|
@@ -133,6 +141,8 @@ open class SchemeService {
|
|
if (!oldBimId.isNullOrEmpty()){
|
|
if (!oldBimId.isNullOrEmpty()){
|
|
oldBimIdNew = oldBimId
|
|
oldBimIdNew = oldBimId
|
|
}
|
|
}
|
|
|
|
+ logger.debug( "前缀数据bimId = ${bimId} *******************************************************")
|
|
|
|
+ logger.debug( "前缀数据oldBimId = ${oldBimId} *******************************************************")
|
|
val rUpDateEquipAndSapce = mapper.rUpDateEquipAndSapce(projectId, oldBimIdNew, bimId, floorId)
|
|
val rUpDateEquipAndSapce = mapper.rUpDateEquipAndSapce(projectId, oldBimIdNew, bimId, floorId)
|
|
|
|
|
|
val floorEntity = FloorService.select(SFilter.eq("id", floorId)).entity()
|
|
val floorEntity = FloorService.select(SFilter.eq("id", floorId)).entity()
|
|
@@ -152,6 +162,11 @@ open class SchemeService {
|
|
floorEntity.infos = map
|
|
floorEntity.infos = map
|
|
}
|
|
}
|
|
floorEntity.modelId = modelId
|
|
floorEntity.modelId = modelId
|
|
|
|
+ if (!floorEntity.bimIdPre.isNullOrEmpty()) {
|
|
|
|
+ floorEntity.bimIdPre = bimId
|
|
|
|
+ } else {
|
|
|
|
+ floorEntity.bimIdPre = bimId
|
|
|
|
+ }
|
|
/** 处理楼层标高 */
|
|
/** 处理楼层标高 */
|
|
if (!attributeMap.isNullOrEmpty()&&attributeMap.size>0){
|
|
if (!attributeMap.isNullOrEmpty()&&attributeMap.size>0){
|
|
val containsKey = attributeMap.containsKey(Opt.FLOORELEVATION)
|
|
val containsKey = attributeMap.containsKey(Opt.FLOORELEVATION)
|
|
@@ -168,7 +183,12 @@ open class SchemeService {
|
|
}
|
|
}
|
|
var list = ArrayList<SFilter>()
|
|
var list = ArrayList<SFilter>()
|
|
list.add(SFilter.eq("id",floorId))
|
|
list.add(SFilter.eq("id",floorId))
|
|
- FloorService.update(floorEntity,null,list)
|
|
|
|
|
|
+
|
|
|
|
+ val update = FloorService.update(floorEntity, null, list)
|
|
|
|
+ if (update){
|
|
|
|
+ rabbitMqService.sendObjects(projectId!!, Opt.UPDATE,floorEntity.id!!)
|
|
|
|
+ rabbitMqService.sendObjects(projectId!!, "equip",floorEntity.id!!)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
return rUpDateEquipAndSapce
|
|
return rUpDateEquipAndSapce
|
|
} catch (e: Exception) {
|
|
} catch (e: Exception) {
|