|
@@ -34,8 +34,12 @@ import com.persagy.server.datacenter.models.entities.dictnew.DictProject
|
|
|
import com.persagy.server.datacenter.models.entities.objects.Equipment
|
|
|
import com.persagy.server.datacenter.models.entities.objects.Floor
|
|
|
import com.persagy.server.datacenter.models.entities.objects.Project
|
|
|
+import com.persagy.server.datacenter.models.entities.objects.ZoneSpace
|
|
|
+import com.persagy.server.datacenter.models.entities.rel.RSpinBd
|
|
|
+import com.persagy.server.datacenter.models.entities.rel.RSpinFl
|
|
|
import com.persagy.server.syn.models.api.obj.BuildingApi
|
|
|
import com.persagy.server.syn.models.api.obj.EquipApi
|
|
|
+import com.persagy.server.syn.models.test.ZoneSpaceTest
|
|
|
import com.persagy.server.syn.models.tools.EquipUtil
|
|
|
import com.persagy.server.syn.services.dict.DClassDefService
|
|
|
import com.persagy.server.syn.utils.ShaftNameUtil
|
|
@@ -81,6 +85,13 @@ class TestControllers {
|
|
|
|
|
|
/** 信息点 */
|
|
|
private val dictDefFuncId = SObjectService(SMybatisDao(DefFuncId::class.java))
|
|
|
+ /** 空间-old */
|
|
|
+ private val zoneSpaceTestService = SObjectService(SMybatisDao(ZoneSpaceTest::class.java))
|
|
|
+ /** 空间-old */
|
|
|
+ private val zoneSpaceService = SObjectService(SMybatisDao(ZoneSpace::class.java))
|
|
|
+ /** 空间-old */
|
|
|
+ private val rSpinBdService = SObjectService(SMybatisDao(RSpinBd::class.java))
|
|
|
+ private val rSpinFlService = SObjectService(SMybatisDao(RSpinFl::class.java))
|
|
|
|
|
|
/**
|
|
|
* 设备
|
|
@@ -217,6 +228,69 @@ class TestControllers {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ */
|
|
|
+ @Operation(summary = "恢复数据 ", description = "")
|
|
|
+ @PostMapping(value = ["/space/data"])
|
|
|
+ fun spaceData(@RequestParam projectId: String): SCreateResponse<Equipment> {
|
|
|
+ return try {
|
|
|
+ val zoneSpaceList = zoneSpaceTestService.select(SFilter.eq("projectId", projectId)).exec()
|
|
|
+ for (zoneSpaceOld in zoneSpaceList) {
|
|
|
+
|
|
|
+ val zoneSpace = ZoneSpace()
|
|
|
+ zoneSpace.id = zoneSpaceOld.id
|
|
|
+ zoneSpace.localId = zoneSpaceOld.localId
|
|
|
+ zoneSpace.localName = zoneSpaceOld.localName
|
|
|
+ zoneSpace.bimLocation = zoneSpaceOld.bimLocation
|
|
|
+ zoneSpace.buildingId = zoneSpaceOld.buildingId
|
|
|
+ zoneSpace.classCode = zoneSpaceOld.classCode
|
|
|
+ zoneSpace.outline = zoneSpaceOld.outline
|
|
|
+ zoneSpace.name = zoneSpaceOld.name
|
|
|
+ zoneSpace.height = zoneSpaceOld.height
|
|
|
+ zoneSpace.projectId = zoneSpaceOld.projectId
|
|
|
+ zoneSpace.floorId = zoneSpaceOld.floorId
|
|
|
+ val replace = zoneSpaceService.replace(zoneSpace)
|
|
|
+ if (replace) {
|
|
|
+
|
|
|
+ if (!zoneSpaceOld.buildingId.isNullOrEmpty()) {
|
|
|
+ try {
|
|
|
+ val rSpinBd = RSpinBd()
|
|
|
+ rSpinBd.buildingId = zoneSpaceOld.buildingId
|
|
|
+ rSpinBd.projectId = projectId
|
|
|
+ rSpinBd.objectType = zoneSpace.classCode
|
|
|
+ rSpinBd.sign = 1
|
|
|
+ rSpinBd.spaceId = zoneSpace.id
|
|
|
+ rSpinBdService.replace(rSpinBd)
|
|
|
+ } catch (e: Exception) {
|
|
|
+ e.printStackTrace()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ if (!zoneSpaceOld.buildingId.isNullOrEmpty()&&!zoneSpaceOld.floorId.isNullOrEmpty()) {
|
|
|
+ val rSpinFl = RSpinFl()
|
|
|
+ rSpinFl.buildingId = zoneSpaceOld.buildingId
|
|
|
+ rSpinFl.floorId = zoneSpaceOld.floorId
|
|
|
+ rSpinFl.projectId = projectId
|
|
|
+ rSpinFl.objectType = zoneSpace.classCode
|
|
|
+ rSpinFl.sign = 1
|
|
|
+ rSpinFl.spaceId = zoneSpace.id
|
|
|
+ rSpinFlService.replace(rSpinFl)
|
|
|
+ }
|
|
|
+ } catch (e: Exception) {
|
|
|
+ e.printStackTrace()
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ SCreateResponse(SResponseType.success)
|
|
|
+ } catch (e: Exception) {
|
|
|
+ e.printStackTrace()
|
|
|
+ SCreateResponse(SResponseType.failure, e.message!!)
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|