|
@@ -54,6 +54,7 @@ import com.persagy.service.models.requests.SCreateRequest
|
|
|
import com.persagy.service.models.requests.SQueryRequest
|
|
|
import com.persagy.service.models.responses.SCreateResponse
|
|
|
import com.persagy.service.models.responses.SQueryResponse
|
|
|
+import org.slf4j.LoggerFactory
|
|
|
|
|
|
/**
|
|
|
* 系统信息服务
|
|
@@ -63,6 +64,8 @@ import com.persagy.service.models.responses.SQueryResponse
|
|
|
object GeneralSystemService : Service<GeneralSystem>(SMybatisDao(GeneralSystem::class.java)) {
|
|
|
|
|
|
|
|
|
+ /** 日志 */
|
|
|
+ private val logger = LoggerFactory.getLogger(FloorService::class.java)
|
|
|
/**
|
|
|
* 创建之前的操作
|
|
|
*/
|
|
@@ -396,7 +399,7 @@ object GeneralSystemService : Service<GeneralSystem>(SMybatisDao(GeneralSystem::
|
|
|
val syinFlService = SObjectService(SMybatisDao(RSyInFl::class.java))
|
|
|
val syinBdService = SObjectService(SMybatisDao(RSyInBd::class.java))
|
|
|
val buildingFloorInfoService = SObjectService(SMybatisDao(BuildingFloorInfo::class.java))
|
|
|
- val idList = ArrayList<String>()
|
|
|
+ val idList = HashSet<String>()
|
|
|
val notIdList = ArrayList<String>()
|
|
|
var list = ArrayList<SFilter>()
|
|
|
list.add(SFilter.eq("projectId",projectId!!))
|
|
@@ -411,7 +414,7 @@ object GeneralSystemService : Service<GeneralSystem>(SMybatisDao(GeneralSystem::
|
|
|
}else{
|
|
|
idList.add("")
|
|
|
}
|
|
|
- list.add(SFilter.inList("id",idList))
|
|
|
+ list.add(SFilter.inList("id",idList.toList()))
|
|
|
}else if((floorId.isNullOrEmpty()||floorId.equals("1"))&&!buildingId.isNullOrEmpty()&&!buildingId.equals("1")){
|
|
|
/** 楼层id为空,建筑id不为空且不为1 ---> 系统和建筑关系表 取系统id */
|
|
|
val objList = syinBdService.select(SFilter.eq("buildingId", buildingId)).distinct().projection("sysId").exec()
|
|
@@ -422,7 +425,7 @@ object GeneralSystemService : Service<GeneralSystem>(SMybatisDao(GeneralSystem::
|
|
|
}else{
|
|
|
idList.add("")
|
|
|
}
|
|
|
- list.add(SFilter.inList("id", idList))
|
|
|
+ list.add(SFilter.inList("id", idList.toList()))
|
|
|
}else if(!floorId.isNullOrEmpty()&&floorId.equals("1")&&!buildingId.isNullOrEmpty()&&buildingId.equals("1")){
|
|
|
/** 楼层id为1,建筑id为1 ---> 系统id不在(系统和楼层关系表 取系统id 系统和建筑关系表 取系统id)之内*/
|
|
|
val objList1 = syinFlService.selectAll().distinct().projection("sysId").exec()
|
|
@@ -437,7 +440,7 @@ object GeneralSystemService : Service<GeneralSystem>(SMybatisDao(GeneralSystem::
|
|
|
idList.add(obj.sysId!!)
|
|
|
}
|
|
|
}
|
|
|
- list.add(SFilter.not(SFilter.inList("id", idList)))
|
|
|
+ list.add(SFilter.not(SFilter.inList("id", idList.toList())))
|
|
|
}else if(!floorId.isNullOrEmpty()&&!floorId.equals("1")&&!buildingId.isNullOrEmpty()&&!buildingId.equals("1")){
|
|
|
/** 楼层id不为空,建筑id不为空 ---> 系统和楼层关系表 取系统id 将建筑id作为条件 */
|
|
|
val objList = syinFlService.select(SFilter.eq("floorId", floorId),SFilter.eq("buildingId", buildingId)).distinct().projection("sysId").exec()
|
|
@@ -448,19 +451,21 @@ object GeneralSystemService : Service<GeneralSystem>(SMybatisDao(GeneralSystem::
|
|
|
}else{
|
|
|
idList.add("")
|
|
|
}
|
|
|
- list.add(SFilter.inList("id", idList))
|
|
|
+
|
|
|
+ list.add(SFilter.inList("id", idList.toList()))
|
|
|
}
|
|
|
// else if(floorId.isNullOrEmpty()&&buildingId.isNullOrEmpty()){
|
|
|
// /** 楼层id为空,建筑id为空 ---> 查询所有 */
|
|
|
// }
|
|
|
+ logger.debug("id01= ${list.toJson()}")
|
|
|
val pageInfo = pageQuery(request, list)
|
|
|
|
|
|
- for(system in pageInfo.content!!){
|
|
|
- val queryBuilder = buildingFloorInfoService.selectAll()
|
|
|
- queryBuilder.tableName="f_get_bd_and_fl('${system.id}','$buildingId','$floorId')"
|
|
|
- val bdflList = queryBuilder.exec()
|
|
|
- system.buildingFloorInfoList = bdflList
|
|
|
- }
|
|
|
+// for(system in pageInfo.content!!){
|
|
|
+// val queryBuilder = buildingFloorInfoService.selectAll()
|
|
|
+// queryBuilder.tableName="f_get_bd_and_fl('${system.id}','$buildingId','$floorId')"
|
|
|
+// val bdflList = queryBuilder.exec()
|
|
|
+// system.buildingFloorInfoList = bdflList
|
|
|
+// }
|
|
|
return pageInfo
|
|
|
} // Fun pageQuerys
|
|
|
|