Browse Source

打开管网检查以及修改报告格式

caiaf 3 years ago
parent
commit
1122312f37

+ 11 - 11
revit-algorithm/src/main/kotlin/cn/sagacloud/server/algorithm/backstage/state/ExportPassedState_3.kt

@@ -105,17 +105,17 @@ class ExportPassedState_3 : ModelState {
                 val excelService = SSpringContextUtil.getBean(ExcelService::class.java) as ExcelService
                 excelService.readBlockingExcel2007()
                 // 多楼层的模型检查
-//                var isPassed = monitorService.doMultiFloorCheck(it, excelService, floor.projectId!!, floor.folderId!!, floor.floorName)
-//                // 如果标高和轴网检查没通过, 则删除所有数据, 并回退到上个版本
-//                /************************************************** 轴网计算 处理标志 *********************************************************************/
-//                if(!isPassed){
-//                    modelFileService.removeSingle(it, myProperties, isForce = true, isMarkDelete = false)
-//                    //发送标高和轴网检查没通过的消息
-//                    val message = messageService.buildMultiModelCheckErrorMessage(floor.projectId!!, it.userId?: "",
-//                            "${folderFloorName.first}的${folderFloorName.second}未通过模型检查,请修改后重新上传", excelService.getDownloadUrl(it.id!!), folderFloorName)
-//                    messageService.sendMessage(message)
-//                    return@forEach
-//                }
+                var isPassed = monitorService.doMultiFloorCheck(it, excelService, floor.projectId!!, floor.folderId!!, floor.floorName)
+                // 如果标高和轴网检查没通过, 则删除所有数据, 并回退到上个版本
+                /************************************************** 轴网计算 处理标志 *********************************************************************/
+                if(!isPassed){
+                    modelFileService.removeSingle(it, myProperties, isForce = true, isMarkDelete = false)
+                    //发送标高和轴网检查没通过的消息
+                    val message = messageService.buildMultiModelCheckErrorMessage(floor.projectId!!, it.userId?: "",
+                            "${folderFloorName.first}的${folderFloorName.second}未通过模型检查,请修改后重新上传", excelService.getDownloadUrl(it.id!!), folderFloorName)
+                    messageService.sendMessage(message)
+                    return@forEach
+                }
 
                 val syncFloor = SSpringContextUtil.getBean(SyncFloor::class.java) as SyncFloor
                 syncFloor.init(floor).prepareDataCenterData()

+ 5 - 1
revit-algorithm/src/main/kotlin/cn/sagacloud/server/algorithm/controllers/modelFile/ReportController.kt

@@ -27,7 +27,10 @@ import org.springframework.web.bind.annotation.RequestMapping
 import org.springframework.web.bind.annotation.RestController
 import java.net.URLEncoder
 import java.nio.charset.Charset
+import java.text.SimpleDateFormat
+import java.util.*
 import javax.servlet.http.HttpServletResponse
+import kotlin.collections.ArrayList
 
 /**
  *
@@ -123,7 +126,8 @@ class ReportController {
             excelService.readNonBlockingExcel2007()
             reportService.writeNonBlockingReportToExcel(list, reportMap, excelService)
             response.contentType = "application/vnd.ms-excel;charset=utf-8"
-            var str = (folder?.name + "检查报告.xlsx")
+            val desiredFormat = SimpleDateFormat("yyyyMMdd").format(Date())
+            var str = ("${folder?.name}-模型检查报告-${desiredFormat}.xlsx")
             response.setHeader("Content-disposition",
                     "attachment;filename=${URLEncoder.encode(str, "UTF-8")}")
             excelService.workBook!!.write(response.outputStream)