提交 a3192a57 编写于 作者: zhouweidong's avatar zhouweidong

实体、属性、关系注册

上级 c52f2210
package cn.ibizlab.core.lite.extensions.service; package cn.ibizlab.core.lite.extensions.service;
import cn.ibizlab.core.extensions.service.DstSystemExService;
import cn.ibizlab.core.lite.domain.MetaEntity; import cn.ibizlab.core.lite.domain.MetaEntity;
import cn.ibizlab.core.lite.domain.MetaField; import cn.ibizlab.core.lite.domain.MetaField;
import cn.ibizlab.core.lite.domain.MetaRelationship; import cn.ibizlab.core.lite.domain.MetaRelationship;
...@@ -39,25 +38,27 @@ public class LiteCoreService { ...@@ -39,25 +38,27 @@ public class LiteCoreService {
@Autowired @Autowired
@Lazy @Lazy
DstSystemExService proxyService; LiteCoreService proxyService;
@Autowired @Autowired
@Lazy @Lazy
MetaEntityMapping entityMapping; MetaEntityMapping entityMapping;
/**
* 自定义行为[SyncSysModel]用户扩展 @Transactional
* @param sysModel public boolean syncSysModel(SysModel sysModel) {
* @return // proxyService.asyncSysModel(sysModel);
*/ return true;
}
@Transactional @Transactional
@Async("asyncExecutor") @Async("asyncExecutor")
public void syncSysModel(SysModel sysModel) { public void asyncSysModel(SysModel sysModel) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
log.info("开始同步[{}]系统模型",sysModel.getSystemid()); log.info("开始同步[{}]系统模型",sysModel.getSystemid());
syncDE(sysModel); syncDE(sysModel);
syncDERelation(sysModel);
syncDEField(sysModel); syncDEField(sysModel);
syncDERelation(sysModel);
long end = System.currentTimeMillis(); long end = System.currentTimeMillis();
log.info("完成[{}]系统同步模型任务,总耗时[{}]秒",sysModel.getSystemid(),(end-start)/1000); log.info("完成[{}]系统同步模型任务,总耗时[{}]秒",sysModel.getSystemid(),(end-start)/1000);
} }
......
...@@ -31,6 +31,10 @@ public class LiteCoreResource { ...@@ -31,6 +31,10 @@ public class LiteCoreResource {
@Autowired @Autowired
private IDstComponentService dstComponentService; private IDstComponentService dstComponentService;
@Autowired
@Lazy
LiteCoreService liteCoreService;
@RequestMapping(method = RequestMethod.GET, value = "/lite/{system}/entitys/{entity}") @RequestMapping(method = RequestMethod.GET, value = "/lite/{system}/entitys/{entity}")
public ResponseEntity<EntityModel> getEntityModel(@PathVariable("system") String system,@PathVariable("entity") String entity) { public ResponseEntity<EntityModel> getEntityModel(@PathVariable("system") String system,@PathVariable("entity") String entity) {
return ResponseEntity.status(HttpStatus.OK).body(liteModelService.getEntityModel(system,entity)); return ResponseEntity.status(HttpStatus.OK).body(liteModelService.getEntityModel(system,entity));
...@@ -50,14 +54,10 @@ public class LiteCoreResource { ...@@ -50,14 +54,10 @@ public class LiteCoreResource {
return ResponseEntity.status(HttpStatus.OK).body(JSON.parseObject(dstComponent.getConfig())); return ResponseEntity.status(HttpStatus.OK).body(JSON.parseObject(dstComponent.getConfig()));
} }
@Autowired
@Lazy
LiteCoreService liteCoreService;
@ApiOperation(value = "保存系统", tags = {"系统" }, notes = "保存系统") @ApiOperation(value = "保存系统", tags = {"系统" }, notes = "保存系统")
@RequestMapping(method = RequestMethod.POST, value = "/lite/syncsysmodel") @RequestMapping(method = RequestMethod.POST, value = "/lite/syncsysmodel")
public void syncSysModel(@RequestBody SysModel sysModel) { public ResponseEntity<Boolean> syncSysModel(@RequestBody SysModel sysModel) {
// liteCoreService.syncSysModel(sysModel); return ResponseEntity.status(HttpStatus.OK).body(liteCoreService.syncSysModel(sysModel));
} }
} }
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册