|
@@ -36,6 +36,7 @@ import com.persagy.server.datacenter.models.entities.task.base.ScanTaskBase
|
|
|
import com.persagy.server.mappers.StatisticsCountMapper
|
|
|
import com.persagy.server.services.AdmBaseService
|
|
|
import com.persagy.server.services.DmpBaseService
|
|
|
+import com.persagy.server.services.StatisticsCountService
|
|
|
import com.persagy.server.services.base.RService
|
|
|
import com.persagy.server.util.AdmEntityTransferUtil
|
|
|
import com.persagy.service.SPageContext
|
|
@@ -64,6 +65,9 @@ object ScanTaskBaseService : RService<ScanTaskBase>(SMybatisDao(ScanTaskBase::cl
|
|
|
@Autowired
|
|
|
private val admBaseService: AdmBaseService? = AdmBaseService()
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private val statisticsCountService: StatisticsCountService? = StatisticsCountService()
|
|
|
+
|
|
|
/**
|
|
|
* 查询所有设备类型或设备族
|
|
|
*/
|
|
@@ -97,7 +101,14 @@ object ScanTaskBaseService : RService<ScanTaskBase>(SMybatisDao(ScanTaskBase::cl
|
|
|
objTypeList.add("equipment")
|
|
|
objTypeList.add("component")
|
|
|
objTypes["\$in"] = objTypeList
|
|
|
- }else{
|
|
|
+ }else if ("model" == type){
|
|
|
+ val objTypes = JSONObject()
|
|
|
+ val objTypeList: MutableList<String> = java.util.ArrayList()
|
|
|
+ objTypeList.add("equipment")
|
|
|
+ objTypeList.add("component")
|
|
|
+ objTypeList.add("model")
|
|
|
+ objTypes["\$in"] = objTypeList
|
|
|
+ }else{
|
|
|
criteria["objType"] = type
|
|
|
}
|
|
|
param["criteria"] = criteria
|
|
@@ -178,13 +189,13 @@ object ScanTaskBaseService : RService<ScanTaskBase>(SMybatisDao(ScanTaskBase::cl
|
|
|
var buildingRequest = SQueryRequest()
|
|
|
|
|
|
// buildingRequest.filters = "id in (" +builds!!.joinToString(",", ",", "'").substring(1) + ")"
|
|
|
- buildingRequest.filters = "id in "+"(\'" + java.lang.String.join("\',\'", builds) + "\')"
|
|
|
+ buildingRequest.filters = "id in "+"(\'" + java.lang.String.join("\',\'", builds) + "\')"
|
|
|
buildingRequest.pageSize = 1000
|
|
|
buildingRequest.pageNumber = 1
|
|
|
var cascade = SCascadeQuery()
|
|
|
cascade.name = "floor"
|
|
|
//cascade.filters = "id in (" +floors!!.joinToString(",", ",", "'").substring(1) + ")"
|
|
|
- cascade.filters = "id in "+"(\'" + java.lang.String.join("\',\'", floors) + "\')"
|
|
|
+ cascade.filters = "id in "+"(\'" + java.lang.String.join("\',\'", floors) + "\')"
|
|
|
buildingRequest.cascade = arrayListOf(cascade)
|
|
|
//调用adm-middleware建筑查询接口
|
|
|
val buildingList = admBaseService?.queryBuilding(buildingRequest) as ArrayList<Building>?
|
|
@@ -281,9 +292,9 @@ object ScanTaskBaseService : RService<ScanTaskBase>(SMybatisDao(ScanTaskBase::cl
|
|
|
try {
|
|
|
val projectId = SPageContext.getHeader("projectId").toString()
|
|
|
if (!equipScanTask.id.isNullOrEmpty()&&!equipScanTask.equipId.isNullOrEmpty()){
|
|
|
- val categoryStatistics = mapper.categoryStatistics(projectId,equipScanTask.id!!, equipScanTask.equipId!!)
|
|
|
+ val categoryStatistics = statisticsCountService?.categoryStatistics(projectId,equipScanTask.id!!, equipScanTask.equipId!!)
|
|
|
val sQueryResponse = SQueryResponse<CategoryStatistics>()
|
|
|
- sQueryResponse.total = categoryStatistics.size.toLong()
|
|
|
+ sQueryResponse.total = categoryStatistics?.size?.toLong()
|
|
|
sQueryResponse.content = categoryStatistics
|
|
|
sQueryResponse.result = SResponseType.success
|
|
|
return sQueryResponse
|
|
@@ -307,16 +318,16 @@ object ScanTaskBaseService : RService<ScanTaskBase>(SMybatisDao(ScanTaskBase::cl
|
|
|
val projectId = SPageContext.getHeader("projectId")
|
|
|
if (!equipScanTask.id.isNullOrEmpty()&&!equipScanTask.equipId.isNullOrEmpty()){
|
|
|
if (!type.isNullOrEmpty()&&type == "model"){
|
|
|
- val categoryStatistics = ModelScanTaskService.mapper.categoryStatisticsModel(projectId!!,equipScanTask.id!!, equipScanTask.equipId!!)
|
|
|
+ val categoryStatistics = statisticsCountService?.categoryStatisticsModel(projectId!!,equipScanTask.id!!, equipScanTask.equipId!!)
|
|
|
val sQueryResponse = SQueryResponse<CategoryStatistics>()
|
|
|
- sQueryResponse.total = categoryStatistics.size.toLong()
|
|
|
+ sQueryResponse.total = categoryStatistics?.size?.toLong()
|
|
|
sQueryResponse.content = categoryStatistics
|
|
|
sQueryResponse.result = SResponseType.success
|
|
|
return sQueryResponse
|
|
|
}else{
|
|
|
- val categoryStatistics = mapper.categoryStatistics(projectId!!,equipScanTask.id!!, equipScanTask.equipId!!)
|
|
|
+ val categoryStatistics = statisticsCountService?.categoryStatistics(projectId!!,equipScanTask.id!!, equipScanTask.equipId!!)
|
|
|
val sQueryResponse = SQueryResponse<CategoryStatistics>()
|
|
|
- sQueryResponse.total = categoryStatistics.size.toLong()
|
|
|
+ sQueryResponse.total = categoryStatistics?.size?.toLong()
|
|
|
sQueryResponse.content = categoryStatistics
|
|
|
sQueryResponse.result = SResponseType.success
|
|
|
return sQueryResponse
|