|
@@ -5,13 +5,9 @@ import com.alibaba.fastjson.JSONObject
|
|
|
import com.persagy.base.extensions.toJson
|
|
|
import com.persagy.database.SFilter
|
|
|
import com.persagy.labsl.Opts
|
|
|
-import com.persagy.labsl.Opts.groupCode
|
|
|
-import com.persagy.labsl.Opts.projectId
|
|
|
-import com.persagy.labsl.client.DmpRwdClient
|
|
|
import com.persagy.labsl.models.entities.pbs.*
|
|
|
-import com.persagy.labsl.models.request.InstanceUrlParam
|
|
|
-import com.persagy.labsl.models.response.DmpResult
|
|
|
import com.persagy.labsl.models.response.SCommonResponse
|
|
|
+import com.persagy.labsl.services.DmpBaseService
|
|
|
import com.persagy.labsl.utils.AdmEntityTransferUtil
|
|
|
import com.persagy.labsl.utils.IdUtils
|
|
|
import com.persagy.mybatis.SMybatisDao
|
|
@@ -22,6 +18,7 @@ import com.persagy.service.models.requests.SUpdateRequest
|
|
|
import com.persagy.service.models.responses.SBaseResponse
|
|
|
import com.persagy.service.models.responses.SCreateResponse
|
|
|
import com.persagy.service.models.responses.SQueryResponse
|
|
|
+import org.apache.poi.ss.formula.functions.T
|
|
|
import org.slf4j.LoggerFactory
|
|
|
import org.springframework.beans.factory.annotation.Autowired
|
|
|
import java.text.SimpleDateFormat
|
|
@@ -61,9 +58,8 @@ object PlanarGraphService : SObjectService<PlanarGraph>(SMybatisDao(PlanarGraph:
|
|
|
/** 楼层 */
|
|
|
// val floorService = SObjectService(SMybatisDao(Floor::class.java))
|
|
|
|
|
|
-
|
|
|
@Autowired
|
|
|
- private val rwdClient: DmpRwdClient? = null
|
|
|
+ private val dmpBaseService: DmpBaseService? = DmpBaseService()
|
|
|
|
|
|
/**
|
|
|
* 创建图形
|
|
@@ -1184,12 +1180,47 @@ object PlanarGraphService : SObjectService<PlanarGraph>(SMybatisDao(PlanarGraph:
|
|
|
|
|
|
|
|
|
/**
|
|
|
+ * 查询对象信息
|
|
|
+ * @param ids
|
|
|
+ * @param type
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ fun queryBuilding(ids: SFilter): List<Building?>? {
|
|
|
+ val param = JSONObject()
|
|
|
+ val criteria = JSONObject()
|
|
|
+ criteria["id"] = ids.second
|
|
|
+ param["criteria"] = criteria
|
|
|
+ return dmpBaseService!!.queryBuilding(param)
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询对象信息
|
|
|
+ * @param ids
|
|
|
+ * @param type
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ fun queryFloor(ids: SFilter): List<Floor?>? {
|
|
|
+ val param = JSONObject()
|
|
|
+ val criteria = JSONObject()
|
|
|
+ criteria["id"] = ids.second
|
|
|
+ param["criteria"] = criteria
|
|
|
+ //排序
|
|
|
+ val orders = JSONArray()
|
|
|
+ val order = JSONObject()
|
|
|
+ order["column"] = "floorSequenceID"
|
|
|
+ order["asc"] = false
|
|
|
+ orders.add(order)
|
|
|
+ param["orders"] = orders
|
|
|
+ return dmpBaseService!!.queryFloor(param)
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 查询草稿箱平面图
|
|
|
*
|
|
|
* @param request 查询条件
|
|
|
*/
|
|
|
fun pageQuerysDrafts(request: SQueryRequest): SQueryResponse<Building> {
|
|
|
- // val projectId = instanceUrlParam.projectId;
|
|
|
val sQueryResponse = SQueryResponse<Building>()
|
|
|
try {
|
|
|
val pageQuery = PlanarGraphService.pageQuery(request, arrayListOf(SFilter.eq("projectId", Opts.projectId!!)))
|
|
@@ -1205,35 +1236,34 @@ object PlanarGraphService : SObjectService<PlanarGraph>(SMybatisDao(PlanarGraph:
|
|
|
for (content in pageQuery.content!!) {
|
|
|
setFloor.add(content.floorId!!)
|
|
|
}
|
|
|
+ val buildingList = queryBuilding(SFilter.inList("id", setBuilding.toList()))
|
|
|
+ val floorList = queryFloor(SFilter.inList("id", setFloor.toList()))
|
|
|
|
|
|
- // val buildingList = buildingService.select(SFilter.inList("id", setBuilding.toList())).exec()
|
|
|
- var dmpBuildResult = queryDmpObject(SFilter.inList("id", setBuilding.toList()))
|
|
|
- val buildingList = AdmEntityTransferUtil.toAdmMultiEntity(dmpBuildResult!!.data, null, Building::class.java)
|
|
|
-
|
|
|
- //val floorList = floorService.select(SFilter.inList("id", setFloor.toList())).order("floorSequenceId desc").exec()
|
|
|
- var dmpFloorResult = queryDmpObject(SFilter.inList("id", setFloor.toList()))
|
|
|
- val floorList = AdmEntityTransferUtil.toAdmMultiEntity(dmpFloorResult!!.data, null, Floor::class.java)
|
|
|
- for (floor in floorList) {
|
|
|
+ for (floor in floorList!!) {
|
|
|
for (content in pageQuery.content!!) {
|
|
|
- if (content.floorId == floor.id) {
|
|
|
- if (floor.planarGraphList.isNullOrEmpty()) {
|
|
|
- floor.planarGraphList = ArrayList()
|
|
|
+ if (floor != null) {
|
|
|
+ if (content.floorId == floor.id) {
|
|
|
+ if (floor!!.planarGraphList.isNullOrEmpty()) {
|
|
|
+ floor.planarGraphList = ArrayList()
|
|
|
+ }
|
|
|
+ floor.planarGraphList!!.add(content)
|
|
|
}
|
|
|
- floor.planarGraphList!!.add(content)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- for (building in buildingList) {
|
|
|
+ for (building in buildingList!!) {
|
|
|
for (floor in floorList) {
|
|
|
- if (floor.buildingId == building.id) {
|
|
|
- if (building.floorList.isNullOrEmpty()) {
|
|
|
- building.floorList = ArrayList<Floor>()
|
|
|
+ if (building != null) {
|
|
|
+ if (floor!!.buildingId == building.id) {
|
|
|
+ if (building.floorList.isNullOrEmpty()) {
|
|
|
+ building.floorList = ArrayList<Floor>()
|
|
|
+ }
|
|
|
+ building.floorList!!.add(floor)
|
|
|
}
|
|
|
- building.floorList!!.add(floor)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- sQueryResponse.content = buildingList
|
|
|
+ sQueryResponse.content = buildingList as List<Building>?
|
|
|
}else{
|
|
|
sQueryResponse.content = ArrayList()
|
|
|
}
|
|
@@ -1249,19 +1279,6 @@ object PlanarGraphService : SObjectService<PlanarGraph>(SMybatisDao(PlanarGraph:
|
|
|
return sQueryResponse
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 查询物理世界对象信息
|
|
|
- */
|
|
|
- fun queryDmpObject(id: SFilter): DmpResult<JSONArray?>? {
|
|
|
- val context = InstanceUrlParam()
|
|
|
- context.groupCode = groupCode
|
|
|
- context.projectId = projectId
|
|
|
- val param = JSONObject()
|
|
|
- val criteria = JSONObject()
|
|
|
- criteria["id"] = id
|
|
|
- param["criteria"] = id
|
|
|
- return rwdClient?.queryObject(context,criteria)
|
|
|
- }
|
|
|
|
|
|
/**
|
|
|
* 查询已发布平面图
|
|
@@ -1282,35 +1299,37 @@ object PlanarGraphService : SObjectService<PlanarGraph>(SMybatisDao(PlanarGraph:
|
|
|
for (content in pageQuery.content!!) {
|
|
|
setFloor.add(content.floorId!!)
|
|
|
}
|
|
|
- //val buildingList = buildingService.select(SFilter.inList("id", setBuilding.toList())).exec()
|
|
|
- var dmpBuildResult = queryDmpObject(SFilter.inList("id", setBuilding.toList()))
|
|
|
- val buildingList = AdmEntityTransferUtil.toAdmMultiEntity(dmpBuildResult!!.data, null, Building::class.java)
|
|
|
|
|
|
- //val floorList = floorService.select(SFilter.inList("id", setFloor.toList())).order("floorSequenceId desc").exec()
|
|
|
- var dmpFloorResult = queryDmpObject(SFilter.inList("id", setFloor.toList()))
|
|
|
- val floorList = AdmEntityTransferUtil.toAdmMultiEntity(dmpFloorResult!!.data, null, Floor::class.java)
|
|
|
+ val buildingList = queryBuilding(SFilter.inList("id", setBuilding.toList()))
|
|
|
+ val floorList = queryFloor(SFilter.inList("id", setFloor.toList()))
|
|
|
|
|
|
- for (floor in floorList) {
|
|
|
- for (content in pageQuery.content!!) {
|
|
|
- if (content.floorId == floor.id) {
|
|
|
- if (floor.planarGraphList.isNullOrEmpty()) {
|
|
|
- floor.planarGraphList = ArrayList()
|
|
|
+ if (floorList != null) {
|
|
|
+ for (floor in floorList) {
|
|
|
+ for (content in pageQuery.content!!) {
|
|
|
+ if (content.floorId == floor!!.id) {
|
|
|
+ if (floor.planarGraphList.isNullOrEmpty()) {
|
|
|
+ floor.planarGraphList = ArrayList()
|
|
|
+ }
|
|
|
+ floor.planarGraphList!!.add(content)
|
|
|
}
|
|
|
- floor.planarGraphList!!.add(content)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- for (building in buildingList) {
|
|
|
- for (floor in floorList) {
|
|
|
- if (floor.buildingId == building.id) {
|
|
|
- if (building.floorList.isNullOrEmpty()) {
|
|
|
- building.floorList = ArrayList<Floor>()
|
|
|
+ if (buildingList != null) {
|
|
|
+ for (building in buildingList) {
|
|
|
+ if (floorList != null) {
|
|
|
+ for (floor in floorList) {
|
|
|
+ if (floor!!.buildingId == building!!.id) {
|
|
|
+ if (building.floorList.isNullOrEmpty()) {
|
|
|
+ building.floorList = ArrayList<Floor>()
|
|
|
+ }
|
|
|
+ building.floorList!!.add(floor)
|
|
|
+ }
|
|
|
}
|
|
|
- building.floorList!!.add(floor)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- sQueryResponse.content = buildingList
|
|
|
+ sQueryResponse.content = buildingList as List<Building>?
|
|
|
}else{
|
|
|
sQueryResponse.content = ArrayList()
|
|
|
}
|