|
@@ -31,11 +31,14 @@ import com.persagy.mybatis.SMybatisDao
|
|
|
import com.persagy.server.datacenter.models.entities.logs.DataCenterLogs
|
|
|
import com.persagy.server.datacenter.wanda.obj.ZoneIspace
|
|
|
import com.persagy.server.datacenter.models.requests.DCSQueryRequest
|
|
|
+import com.persagy.server.datacenter.services.objects.ZoneSpaceBaseService
|
|
|
+import com.persagy.server.datacenter.wanda.obj.ZoneSpace
|
|
|
import com.persagy.server.services.base.Service
|
|
|
import com.persagy.server.utils.IdUtils
|
|
|
import com.persagy.server.utils.ShaftNameUtil
|
|
|
import com.persagy.service.SPageContext
|
|
|
import com.persagy.service.models.enums.SResponseType
|
|
|
+import com.persagy.service.models.requests.SCreateRequest
|
|
|
import com.persagy.service.models.responses.SQueryResponse
|
|
|
|
|
|
/**
|
|
@@ -70,6 +73,35 @@ object SpaceService : Service<ZoneIspace>(SMybatisDao(ZoneIspace::class.java)) {
|
|
|
return true
|
|
|
} // Function onCreateBefore()
|
|
|
|
|
|
+ /**
|
|
|
+ * @Description: 创建元空间后批量创建业务空间
|
|
|
+ */
|
|
|
+ override fun onCreateSuccess(entityList: ArrayList<ZoneIspace>) {
|
|
|
+ super.onCreateSuccess(entityList)
|
|
|
+ val zoneSpaces = ArrayList<ZoneSpace>()
|
|
|
+ for (zoneIspace in entityList) {
|
|
|
+ val zoneSpace = ZoneSpace()
|
|
|
+ zoneSpace.name = zoneIspace.name
|
|
|
+ zoneSpace.localId = zoneIspace.localId
|
|
|
+ zoneSpace.localName = zoneIspace.localName
|
|
|
+ zoneSpace.projectId = zoneIspace.projectId
|
|
|
+ zoneSpace.buildingId = zoneIspace.buildingId
|
|
|
+ zoneSpace.floorId = zoneIspace.floorId
|
|
|
+ zoneSpace.bimId = zoneIspace.bimId
|
|
|
+ zoneSpace.classCode = "GeneralZone"
|
|
|
+ zoneSpace.infos = zoneIspace.infos
|
|
|
+ if(zoneIspace.outline != null){
|
|
|
+ zoneSpace.outline = arrayListOf(zoneIspace.outline!!)
|
|
|
+ }
|
|
|
+ zoneSpace.state = 0
|
|
|
+ zoneSpaces.add(zoneSpace)
|
|
|
+ }
|
|
|
+ val request = SCreateRequest<ZoneSpace>()
|
|
|
+ request.content = zoneSpaces
|
|
|
+ ZoneSpaceBaseService.createList(request)
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
override fun onDeleteBefore(entity: ZoneIspace): Boolean {
|
|
|
try {
|
|
|
val zoneIspace = this.select(SFilter.eq("id", entity.id!!)).entity()
|