Browse Source

fix bug:修复查询报该方法仅能传入 lambda 表达式产生的合成类错误

lijie 2 years ago
parent
commit
946d4398c4

+ 17 - 35
labsl/src/main/kotlin/com/persagy/labsl/service/impl/GraphServiceImpl.kt

@@ -4,18 +4,12 @@ import cn.hutool.core.bean.BeanUtil
 import cn.hutool.core.collection.CollUtil
 import cn.hutool.core.util.ObjectUtil
 import cn.hutool.core.util.StrUtil
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
-import com.baomidou.mybatisplus.core.toolkit.Wrappers
-import com.baomidou.mybatisplus.extension.kotlin.KtQueryChainWrapper
 import com.baomidou.mybatisplus.extension.kotlin.KtQueryWrapper
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
-import com.persagy.database.SFilter
 import com.persagy.labsl.Opts
 import com.persagy.labsl.domain.*
 import com.persagy.labsl.mapper.GraphMapper
 import com.persagy.labsl.service.*
-import com.persagy.labsl.services.AttachObjectIdsServices
-import com.persagy.labsl.services.MarkersService
 import com.persagy.labsl.utils.IdUtils
 import com.persagy.service.models.enums.SResponseType
 import com.persagy.service.models.requests.SCreateRequest
@@ -86,7 +80,7 @@ open class GraphServiceImpl : ServiceImpl<GraphMapper?, GraphEntity?>(), GraphSe
             if (content.projectId.isNullOrEmpty()){
                 content.projectId = Opts.projectId
             }
-            val entity = list(Wrappers.lambdaQuery(GraphEntity::class.java)
+            val entity = list(KtQueryWrapper(GraphEntity())
                     .eq(StrUtil.isNotBlank(Opts.projectId),GraphEntity::projectId, Opts.projectId!!)
                     .eq(StrUtil.isNotBlank(content.categoryId),GraphEntity::categoryId, content.categoryId!!)
                     .eq(StrUtil.isNotBlank(content.name),GraphEntity::name, content.name!!))
@@ -95,7 +89,7 @@ open class GraphServiceImpl : ServiceImpl<GraphMapper?, GraphEntity?>(), GraphSe
                 sCreateResponse.message = "同一分类下图名称不可以重复"
                 return sCreateResponse
             }
-            val entity1 = graphPubService.list(Wrappers.lambdaQuery(GraphPubEntity::class.java)
+            val entity1 = graphPubService.list(KtQueryWrapper(GraphPubEntity())
                     .eq(StrUtil.isNotBlank(Opts.projectId),GraphPubEntity::projectId, Opts.projectId!!)
                     .eq(StrUtil.isNotBlank(content.categoryId),GraphPubEntity::categoryId, content.categoryId!!)
                     .eq(StrUtil.isNotBlank(content.name),GraphPubEntity::name, content.name!!))
@@ -341,7 +335,7 @@ open class GraphServiceImpl : ServiceImpl<GraphMapper?, GraphEntity?>(), GraphSe
             /** 项目 id */
             graph.projectId = Opts.projectId
             /** 设置表明,查询 */
-            val graphPub = graphPubService.getOne(Wrappers.lambdaQuery(GraphPubEntity::class.java)
+            val graphPub = graphPubService.getOne(KtQueryWrapper(GraphPubEntity())
                     .eq(StrUtil.isNotBlank(Opts.projectId),GraphPubEntity::projectId,Opts.projectId!!)
                     .eq(StrUtil.isNotBlank(graph.id),GraphPubEntity::id,graph.id!!)
                     .eq(StrUtil.isNotBlank(graph.graphId),GraphPubEntity::graphId,graph.graphId!!))
@@ -355,14 +349,8 @@ open class GraphServiceImpl : ServiceImpl<GraphMapper?, GraphEntity?>(), GraphSe
             graphEntity.state = 4
             graphEntity.delTime = Date()
             save(graphEntity)
-            /** 查询 */
-            val nodeBuilder = com.persagy.labsl.services.NodeService.select(
-                    SFilter.eq("id", graph.id!!),
-                    SFilter.eq("graphId", graph.graphId!!)
-            )
-
             /** 设置表明,查询 */
-            val nodePubList = nodePubService.list(Wrappers.lambdaQuery(NodePubEntity::class.java)
+            val nodePubList = nodePubService.list(KtQueryWrapper(NodePubEntity())
                     .eq(StrUtil.isNotBlank(graph.id),NodePubEntity::id,graph.id!!)
                     .eq(StrUtil.isNotBlank(graph.graphId),NodePubEntity::graphId,graph.graphId!!))
             /** 里边数量大于 0  */
@@ -379,7 +367,7 @@ open class GraphServiceImpl : ServiceImpl<GraphMapper?, GraphEntity?>(), GraphSe
                 }
                 nodeService.saveBatch(CollUtil.newArrayList(nodeList))
                 /** 设置表明,查询 */
-                val anchorPubList = anchorPubService.list(Wrappers.lambdaQuery(AnchorPubEntity::class.java)
+                val anchorPubList = anchorPubService.list(KtQueryWrapper(AnchorPubEntity())
                         .eq(StrUtil.isNotBlank(graph.id),AnchorPubEntity::id,graph.id!!)
                         .eq(StrUtil.isNotBlank(graph.graphId),AnchorPubEntity::graphId,graph.graphId!!))
                 /** 列表大于 0  */
@@ -398,7 +386,7 @@ open class GraphServiceImpl : ServiceImpl<GraphMapper?, GraphEntity?>(), GraphSe
                 }
             }
             /** 设置表明,查询 */
-            val markerPubList = markerPubService.list(Wrappers.lambdaQuery(MarkerPubEntity::class.java)
+            val markerPubList = markerPubService.list(KtQueryWrapper(MarkerPubEntity())
                     .eq(StrUtil.isNotBlank(graph.id),MarkerPubEntity::id,graph.id!!)
                     .eq(StrUtil.isNotBlank(graph.graphId),MarkerPubEntity::graphId,graph.graphId!!))
             /** 列表大于 0  */
@@ -415,14 +403,8 @@ open class GraphServiceImpl : ServiceImpl<GraphMapper?, GraphEntity?>(), GraphSe
                 }
                 markerService.saveBatch(CollUtil.newArrayList(markerList))
             }
-
-            /** 查询 */
-            val relationBuilder = com.persagy.labsl.services.RelationService.select(
-                    SFilter.eq("id", graph.id!!),
-                    SFilter.eq("graphId", graph.graphId!!)
-            )
             /** 设置表明,查询 */
-            val relationPubList = relationPubService.list(Wrappers.lambdaQuery(RelationPubEntity::class.java)
+            val relationPubList = relationPubService.list(KtQueryWrapper(RelationPubEntity())
                     .eq(StrUtil.isNotBlank(graph.id),RelationPubEntity::id,graph.id!!)
                     .eq(StrUtil.isNotBlank(graph.graphId),RelationPubEntity::graphId,graph.graphId!!))
             /** 列表大于 0  */
@@ -458,7 +440,7 @@ open class GraphServiceImpl : ServiceImpl<GraphMapper?, GraphEntity?>(), GraphSe
             return sBaseResponse
         }
         for (content in request.content!!) {
-            val entity = list(Wrappers.lambdaQuery(GraphEntity::class.java)
+            val entity = list(KtQueryWrapper(GraphEntity())
                     .eq(StrUtil.isNotBlank(Opts.projectId),GraphEntity::projectId, Opts.projectId!!)
                     .eq(StrUtil.isNotBlank(content.categoryId),GraphEntity::categoryId, content.categoryId!!)
                     .eq(StrUtil.isNotBlank(content.name),GraphEntity::name, content.name!!))
@@ -467,7 +449,7 @@ open class GraphServiceImpl : ServiceImpl<GraphMapper?, GraphEntity?>(), GraphSe
                 sBaseResponse.message = "图名称已经存在"
                 return sBaseResponse
             }
-            val entity1 = graphPubService.list(Wrappers.lambdaQuery(GraphPubEntity::class.java)
+            val entity1 = graphPubService.list(KtQueryWrapper(GraphPubEntity())
                     .eq(StrUtil.isNotBlank(Opts.projectId),GraphPubEntity::projectId, Opts.projectId!!)
                     .eq(StrUtil.isNotBlank(content.categoryId),GraphPubEntity::categoryId, content.categoryId!!)
                     .eq(StrUtil.isNotBlank(content.name),GraphPubEntity::name, content.name!!))
@@ -492,7 +474,7 @@ open class GraphServiceImpl : ServiceImpl<GraphMapper?, GraphEntity?>(), GraphSe
             return sBaseResponse
         }
         for (content in request.content!!) {
-            val entity = list(Wrappers.lambdaQuery(GraphEntity::class.java)
+            val entity = list(KtQueryWrapper(GraphEntity())
                     .eq(StrUtil.isNotBlank(Opts.projectId),GraphEntity::projectId, Opts.projectId!!)
                     .eq(StrUtil.isNotBlank(content.categoryId),GraphEntity::categoryId, content.categoryId!!)
                     .eq(StrUtil.isNotBlank(content.name),GraphEntity::name, content.name!!))
@@ -501,7 +483,7 @@ open class GraphServiceImpl : ServiceImpl<GraphMapper?, GraphEntity?>(), GraphSe
                 sBaseResponse.message = "图名称已经存在"
                 return sBaseResponse
             }
-            val entity1 = graphPubService.list(Wrappers.lambdaQuery(GraphPubEntity::class.java)
+            val entity1 = graphPubService.list(KtQueryWrapper(GraphPubEntity())
                     .eq(StrUtil.isNotBlank(Opts.projectId),GraphPubEntity::projectId, Opts.projectId!!)
                     .eq(StrUtil.isNotBlank(content.categoryId),GraphPubEntity::categoryId, content.categoryId!!)
                     .eq(StrUtil.isNotBlank(content.name),GraphPubEntity::name, content.name!!))
@@ -524,7 +506,7 @@ open class GraphServiceImpl : ServiceImpl<GraphMapper?, GraphEntity?>(), GraphSe
         /** 项目 id */
         graphs.projectId = Opts.projectId
         /** 查询图 */
-        val graph = getOne(Wrappers.lambdaQuery(GraphEntity::class.java)
+        val graph = getOne(KtQueryWrapper(GraphEntity())
                 .eq(StrUtil.isNotBlank(Opts.projectId),GraphEntity::projectId,Opts.projectId!!)
                 .eq(StrUtil.isNotBlank(graphs.id),GraphEntity::id,graphs.id!!)
                 .eq(StrUtil.isNotBlank(graphs.graphId),GraphEntity::graphId,graphs.graphId!!))
@@ -533,23 +515,23 @@ open class GraphServiceImpl : ServiceImpl<GraphMapper?, GraphEntity?>(), GraphSe
         }
         /** 图对象不为空 */
         /** 查询 */
-        val markersList = markerService.list(Wrappers.lambdaQuery(MarkerEntity::class.java)
+        val markersList = markerService.list(KtQueryWrapper(MarkerEntity())
                 .eq(StrUtil.isNotBlank(graphs.id!!),MarkerEntity::id,graphs.id!!)
                 .eq(StrUtil.isNotBlank(graphs.graphId!!),MarkerEntity::graphId,graphs.graphId))
         /** 查询 */
-        val nodeList = nodeService.list(Wrappers.lambdaQuery(NodeEntity::class.java)
+        val nodeList = nodeService.list(KtQueryWrapper(NodeEntity())
                 .eq(StrUtil.isNotBlank(graphs.id!!),NodeEntity::id,graphs.id!!)
                 .eq(StrUtil.isNotBlank(graphs.graphId!!),NodeEntity::graphId,graphs.graphId))
         /** 查询 */
-        val anchorList = anchorService.list(Wrappers.lambdaQuery(AnchorEntity::class.java)
+        val anchorList = anchorService.list(KtQueryWrapper(AnchorEntity())
                 .eq(StrUtil.isNotBlank(graphs.id!!),AnchorEntity::id,graphs.id!!)
                 .eq(StrUtil.isNotBlank(graphs.graphId!!),AnchorEntity::graphId,graphs.graphId))
         /** 查询 */
-        val attachObjectIdsList = attachObjectIdsService.list(Wrappers.lambdaQuery(AttachObjectIdsEntity::class.java)
+        val attachObjectIdsList = attachObjectIdsService.list(KtQueryWrapper(AttachObjectIdsEntity())
                 .eq(StrUtil.isNotBlank(graphs.id!!),AttachObjectIdsEntity::id,graphs.id!!)
                 .eq(StrUtil.isNotBlank(graphs.graphId!!),AttachObjectIdsEntity::graphId,graphs.graphId))
         /** 查询 */
-        val relationList = relationService.list(Wrappers.lambdaQuery(RelationEntity::class.java)
+        val relationList = relationService.list(KtQueryWrapper(RelationEntity())
                 .eq(StrUtil.isNotBlank(graphs.id!!),RelationEntity::id,graphs.id!!)
                 .eq(StrUtil.isNotBlank(graphs.graphId!!),RelationEntity::graphId,graphs.graphId))
         /** 清除草稿箱数据 */