|
@@ -30,8 +30,10 @@ import com.persagy.database.SFilter
|
|
|
import com.persagy.database.extensions.keyValue
|
|
|
import com.persagy.mybatis.SMybatisDao
|
|
|
import com.persagy.server.Opt
|
|
|
+import com.persagy.server.datacenter.models.entities.dictnew.DefFuncId
|
|
|
import com.persagy.server.datacenter.models.entities.dictnew.DefFuncIdProject
|
|
|
import com.persagy.server.datacenter.models.entities.graphtype.RelationTypeProject
|
|
|
+import com.persagy.server.datacenter.wanda.dict.DictInfosWanDa
|
|
|
import com.persagy.server.datacenter.wanda.obj.Equipment
|
|
|
import com.persagy.server.datacenter.wanda.rel.REq2Sy
|
|
|
import com.persagy.server.services.base.Service
|
|
@@ -73,7 +75,10 @@ object EquipmentService : Service<Equipment>(SMybatisDao(Equipment::class.java))
|
|
|
private val rEq2SyService = SObjectService(SMybatisDao(REq2Sy::class.java))
|
|
|
|
|
|
/** 设备与信息点关系 */
|
|
|
- private val defFuncIdProjectService = SObjectService(SMybatisDao(DefFuncIdProject::class.java))
|
|
|
+ private val defFuncIdService = SObjectService(SMybatisDao(DefFuncId::class.java))
|
|
|
+
|
|
|
+ /** 对照表 */
|
|
|
+ private val dictInfosWanDaService = SObjectService(SMybatisDao(DictInfosWanDa::class.java))
|
|
|
|
|
|
/**
|
|
|
* 创建前赋值操作
|
|
@@ -235,25 +240,39 @@ object EquipmentService : Service<Equipment>(SMybatisDao(Equipment::class.java))
|
|
|
response.contentType = "application/octet-stream"
|
|
|
response.setHeader("Content-disposition", "attachment;filename=equip-$classCode.xlsx")
|
|
|
response.flushBuffer()
|
|
|
- val defFuncIds = defFuncIdProjectService.select(SFilter.eq("projectId",projectId), SFilter.eq("classCode",classCode)).exec()
|
|
|
+ val dictInfosWanDaGroupList = dictInfosWanDaService.select(SFilter.eq("groupCode", "WD"), SFilter.eq("projectId", "0"), SFilter.eq("stage","moms")).exec()
|
|
|
+ val dictInfosWanDaProjectList = dictInfosWanDaService.select(SFilter.eq("groupCode","WD"), SFilter.eq("projectId", Opt.projectId!!), SFilter.eq("stage","moms")).exec()
|
|
|
+ val setCode = HashSet<String>()
|
|
|
+ for (dictInfosWanDaGroup in dictInfosWanDaGroupList){
|
|
|
+ setCode.add(dictInfosWanDaGroup.code!!)
|
|
|
+ }
|
|
|
+ if (dictInfosWanDaProjectList.size>0){
|
|
|
+ for (dictInfosWanDaProject in dictInfosWanDaProjectList){
|
|
|
+ setCode.add(dictInfosWanDaProject.code!!)
|
|
|
+ }
|
|
|
+ }
|
|
|
+// if(setCode.size > 0){
|
|
|
+//
|
|
|
+// }
|
|
|
+ val defFuncIds = defFuncIdService.select(SFilter.eq("projectId",projectId), SFilter.eq("classCode",classCode),SFilter.inList("code",ArrayList(setCode))).exec()
|
|
|
|
|
|
val equipments = select(SFilter.eq("projectId",projectId), SFilter.eq("classCode",classCode)).exec()
|
|
|
val list = ArrayList<List<Any>>()
|
|
|
val firstList = ArrayList<String>()
|
|
|
val codeList = ArrayList<String>()
|
|
|
codeList.add("id")
|
|
|
- codeList.add("bimTypeId")
|
|
|
- codeList.add("systemCategory")
|
|
|
- codeList.add("codeName")
|
|
|
+ codeList.add("bimTypeName")
|
|
|
+// codeList.add("systemCategory")
|
|
|
+// codeList.add("codeName")
|
|
|
codeList.add("localId")
|
|
|
firstList.add("设备ID-id")
|
|
|
- firstList.add("BIM构件编码-bimTypeId")
|
|
|
- firstList.add("系统分类-systemCategory")
|
|
|
- firstList.add("设备类型名称-codeName")
|
|
|
+ firstList.add("构件分类名称-bimTypeName")
|
|
|
+// firstList.add("系统分类-systemCategory")
|
|
|
+// firstList.add("设备类型名称-codeName")
|
|
|
firstList.add("本地编码-localId")
|
|
|
for (defFuncId in defFuncIds) {
|
|
|
codeList.add(defFuncId.code!!)
|
|
|
- firstList.add("${defFuncId.name}-${defFuncId.code}")
|
|
|
+ firstList.add("${defFuncId.aliasName}-${defFuncId.code}")
|
|
|
}
|
|
|
|
|
|
|
|
@@ -264,13 +283,15 @@ object EquipmentService : Service<Equipment>(SMybatisDao(Equipment::class.java))
|
|
|
for (s in codeList) {
|
|
|
if(s == "id"){
|
|
|
itemList.add(equipment.id?:"")
|
|
|
- } else if(s == "bimTypeId"){
|
|
|
- itemList.add(equipment.bimTypeId?:"")
|
|
|
- }else if(s == "systemCategory"){
|
|
|
- itemList.add(equipment.systemCategory?:"")
|
|
|
- }else if(s == "codeName"){
|
|
|
- itemList.add(equipment.codeName?:"")
|
|
|
- }else if(s == "localId"){
|
|
|
+ } else if(s == "bimTypeName"){
|
|
|
+ itemList.add(equipment.bimTypeName?:"")
|
|
|
+ }
|
|
|
+// else if(s == "systemCategory"){
|
|
|
+// itemList.add(equipment.systemCategory?:"")
|
|
|
+// }else if(s == "codeName"){
|
|
|
+// itemList.add(equipment.codeName?:"")
|
|
|
+// }
|
|
|
+ else if(s == "localId"){
|
|
|
itemList.add(equipment.localId?:"")
|
|
|
}else{
|
|
|
if(infos != null && infos[s] != null){
|
|
@@ -280,7 +301,7 @@ object EquipmentService : Service<Equipment>(SMybatisDao(Equipment::class.java))
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
list.add(itemList)
|
|
|
|
|
@@ -340,15 +361,15 @@ object EquipmentService : Service<Equipment>(SMybatisDao(Equipment::class.java))
|
|
|
equipMap[equipment.id!!] = equipment
|
|
|
}
|
|
|
val content = ArrayList<Equipment>()
|
|
|
- val list = readExcel(file.inputStream,"")
|
|
|
+ val list = readExcel(file.inputStream,"设备绑点")
|
|
|
for (map in list) {
|
|
|
val infos = HashMap<String,Any?>()
|
|
|
var equipId : String? = null
|
|
|
for (key in map.keys) {
|
|
|
- val code = key.substring(key.lastIndexOf("-"),key.length)
|
|
|
+ val code = key.substring(key.lastIndexOf("-")+1,key.length)
|
|
|
if(code == "id"){
|
|
|
equipId = map[key]!!
|
|
|
- } else if(code == "bimTypeId"){
|
|
|
+ } else if(code == "bimTypeName"){
|
|
|
|
|
|
}else if(code == "systemCategory"){
|
|
|
|
|
@@ -358,13 +379,14 @@ object EquipmentService : Service<Equipment>(SMybatisDao(Equipment::class.java))
|
|
|
|
|
|
}else{
|
|
|
if(!map[key].isNullOrEmpty()){
|
|
|
- infos[key] = map[key]
|
|
|
+ infos[code] = map[key]
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
val equipment = equipMap[equipId]
|
|
|
if(equipment != null){
|
|
|
+ equipment.infos = infos
|
|
|
content.add(equipment)
|
|
|
}
|
|
|
}
|