提交 287a44e4 编写于 作者: sq3536's avatar sq3536

sysapps

上级 ed7c7978
......@@ -5,7 +5,7 @@ spring:
name: ibzlite-web
zuul:
routes:
lite:
lite-core:
path: /lite/**
serviceId: ${ibiz.ref.service.ibzlite-api:ibzlite-api}
stripPrefix: false
\ No newline at end of file
......@@ -9,6 +9,7 @@ import cn.ibizlab.core.lite.extensions.domain.FieldModel;
import cn.ibizlab.core.lite.extensions.domain.RelationshipModel;
import cn.ibizlab.core.lite.extensions.util.LiteStorage;
import cn.ibizlab.core.lite.service.*;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
......@@ -168,7 +169,8 @@ public class LiteModelService {
@Caching( evict = {
@CacheEvict( value="syspssystem",key = "'row:all-apps'"),
@CacheEvict( value="syspssystem",key = "'row:all-dst-apps'")
@CacheEvict( value="syspssystem",key = "'row:all-dst-apps'"),
@CacheEvict( value="syspssystem",key = "'row:all-dst-sys-apps'")
})
public void resetApps()
{
......@@ -176,4 +178,24 @@ public class LiteModelService {
}
@Cacheable( value="syspssystem",key = "'row:sys-dst-sys-apps'")
public List<DstSystem> getSysApp()
{
List<DstSystem> list = new ArrayList<>();
dstSystemService.list().forEach(system -> {
if (system.getSysstructure() == null)
{
return;
}
if (system.getApps() == null)
{
system.setApps(system.getSysstructure().getSysApps(true));
}
system.setSysstructure(null);
list.add(system);
});
return list;
}
}
......@@ -11,8 +11,8 @@
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="DstSystemResultMap" type="cn.ibizlab.core.lite.domain.DstSystem" autoMapping="true">
<id property="pssystemid" column="pssystemid" /><!--主键字段映射-->
<result column="sysstructure" jdbcType="VARCHAR" property="sysstructure" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" />
<result property="apps" column="apps" typeHandler="cn.ibizlab.core.lite.domain.handlers.DstAppTypeHandler" />
</resultMap>
......@@ -35,5 +35,18 @@
<![CDATA[ SELECT t1.`APPS`, t1.`MD5CHECK`, t1.`PSSYSTEMID`, t1.`PSSYSTEMNAME`, t1.`SHOWORDER`, t1.`SYSSTRUCTURE` FROM `IBZPSSYSTEM` t1
]]>
</sql>
<!--数据查询[Default]-->
<sql id="Default" databaseId="oracle">
<![CDATA[ SELECT t1.PSSYSTEMID, t1.PSSYSTEMNAME, t1.SYSSTRUCTURE, t1.APPS, t1.MD5CHECK, t1.SHOWORDER FROM IBZPSSYSTEM t1
]]>
</sql>
<!--数据查询[Default]-->
<sql id="Default" databaseId="postgresql">
<![CDATA[ SELECT t1.PSSYSTEMID, t1.PSSYSTEMNAME, t1.SYSSTRUCTURE, t1.APPS, t1.MD5CHECK, t1.SHOWORDER FROM IBZPSSYSTEM t1
]]>
</sql>
</mapper>
package cn.ibizlab.api.rest.extensions;
import cn.ibizlab.core.lite.domain.DstComponent;
import cn.ibizlab.core.lite.domain.DstSystem;
import cn.ibizlab.core.lite.extensions.domain.EntityModel;
import cn.ibizlab.core.lite.extensions.domain.SysModel;
import cn.ibizlab.core.lite.extensions.service.LiteCoreService;
......@@ -19,6 +20,8 @@ import org.springframework.http.ResponseEntity;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Slf4j
@Api(tags = {"接口" })
@RestController("api-litecore")
......@@ -60,4 +63,10 @@ public class LiteCoreResource {
return ResponseEntity.status(HttpStatus.OK).body(liteCoreService.syncSysModel(sysModel));
}
@RequestMapping(method = RequestMethod.GET, value = "/lite/sysapps")
public ResponseEntity<List<DstSystem>> getSysApps() {
return ResponseEntity.status(HttpStatus.OK).body(liteModelService.getSysApp());
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册