|
@@ -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()
|
|
|
+
|
|
|
/**
|
|
|
* 查询所有设备类型或设备族
|
|
|
*/
|
|
@@ -281,9 +285,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 +311,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
|