|
@@ -5,6 +5,8 @@ import com.persagy.database.SPageQueryInfo
|
|
|
import com.persagy.database.SQueryBuilder
|
|
|
import com.persagy.mybatis.SMybatisDao
|
|
|
import com.persagy.server.datacenter.models.entities.dict.DictBatchProcessing
|
|
|
+import com.persagy.server.datacenter.models.entities.dict.EquipFamily
|
|
|
+import com.persagy.server.datacenter.models.entities.dict.Family
|
|
|
import com.persagy.server.datacenter.models.entities.dictnew.*
|
|
|
import com.persagy.server.datacenter.models.requests.CategoryRequest
|
|
|
import com.persagy.server.mappers.CustomMapper
|
|
@@ -49,7 +51,9 @@ object DictDefClassService : SObjectService<DefClass>(SMybatisDao(DefClass::clas
|
|
|
private val dictDefFuncId = SObjectService(SMybatisDao(DefFuncId::class.java))
|
|
|
/** 项目定制化服务 */
|
|
|
private val defFuncIdProjectService = SObjectService(SMybatisDao(DefFuncIdProject::class.java))
|
|
|
-
|
|
|
+ /** 设备族和设备类型对应表服务 */
|
|
|
+ private val equipFamilyService = SObjectService(SMybatisDao(EquipFamily::class.java))
|
|
|
+ private val familyService = SObjectService(SMybatisDao(Family::class.java))
|
|
|
|
|
|
/**
|
|
|
* 查询设备、部件、系统、专业类型
|
|
@@ -245,6 +249,18 @@ object DictDefClassService : SObjectService<DefClass>(SMybatisDao(DefClass::clas
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ "property" -> {
|
|
|
+ /** 资产 */
|
|
|
+ val familyList = familyService.selectAll().exec()
|
|
|
+ for (family in familyList){
|
|
|
+ val defClass = DefClass()
|
|
|
+ defClass.code = family.code
|
|
|
+ defClass.name = family.name
|
|
|
+ defClass.aliasName = family.code
|
|
|
+ defClass.aliasCode = family.name
|
|
|
+ dictSchemeCategoryList.add(defClass)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
sQueryResponse.result = SResponseType.success
|
|
|
sQueryResponse.content = dictSchemeCategoryList
|
|
@@ -284,7 +300,22 @@ object DictDefClassService : SObjectService<DefClass>(SMybatisDao(DefClass::clas
|
|
|
if (dictDefFuncList.size>0) {
|
|
|
sQueryResponse.content = dictDefFuncList
|
|
|
sQueryResponse.total = dictDefFuncList.size.toLong()
|
|
|
- } else {
|
|
|
+ } else if(categoryRequest.type!!.length == 3){
|
|
|
+
|
|
|
+ val familyList = equipFamilyService.select(SFilter.eq("family", categoryRequest.type!!)).exec()
|
|
|
+ if (familyList.size>0){
|
|
|
+ val equipFamily = familyList[0]
|
|
|
+ schemeService.dictInfoProperty(projectId, dictProject.groupCode!!, equipFamily.equipCode!!,categoryRequest.type!!)
|
|
|
+ val dictDefFuncBuilder = dictDefFuncId.select(
|
|
|
+ SFilter.eq("projectId", projectId),
|
|
|
+ SFilter.eq("groupCode", dictProject.groupCode!!),
|
|
|
+ SFilter.eq("classCode", categoryRequest.type!!)
|
|
|
+ )
|
|
|
+ val dictDefFuncList = dictDefFuncBuilder.table("dict.def_funcid_project").order("sort").exec()
|
|
|
+ sQueryResponse.content = dictDefFuncList
|
|
|
+ sQueryResponse.total = dictDefFuncList.size.toLong()
|
|
|
+ }
|
|
|
+ }else{
|
|
|
schemeService.dictInfo(projectId, dictProject.groupCode!!, categoryRequest.type!!)
|
|
|
val dictDefFuncBuilder = dictDefFuncId.select(
|
|
|
SFilter.eq("projectId", projectId),
|
|
@@ -384,6 +415,8 @@ object DictDefClassService : SObjectService<DefClass>(SMybatisDao(DefClass::clas
|
|
|
|
|
|
/**
|
|
|
* 根据项目重置信息点
|
|
|
+ *
|
|
|
+ * @return 返回结果
|
|
|
*/
|
|
|
fun resetProjectId(): SBaseResponse {
|
|
|
return try {
|
|
@@ -413,6 +446,9 @@ object DictDefClassService : SObjectService<DefClass>(SMybatisDao(DefClass::clas
|
|
|
|
|
|
/**
|
|
|
* 方案设定
|
|
|
+ *
|
|
|
+ * @param request 条件
|
|
|
+ * @return 返回结果
|
|
|
*/
|
|
|
fun setSchemeProject(request: DictBatchProcessing): SCreateResponse<DictBatchProcessing>{
|
|
|
val projectId = SPageContext.getHeader("projectId")
|