@Override public void after(ActionEvent event) { IOrm orm = (IOrm) event.getOrm(); IBizSystem sys = (IBizSystem) event.getEntity(); if (sys == null) { return; } try { String extendClass = Demsy.bizEngine.getExtendClassName(sys); Demsy.bizEngine.parseSystemByAnnotation(Cls.forName(extendClass), sys); } catch (ClassNotFoundException e) { // throw new DemsyException(e); } // 将【业务系统】转换成【业务模块】 Demsy.moduleEngine.makeModule(orm, Demsy.me().getSoft(), sys); }
@Override public void before(ActionEvent<WebContentEntity> event) { Orm orm = event.getOrm(); WebContentEntity entity = event.getEntity(); /* * 获取栏目编码 */ WebCatalogEntity catalog = entity.getCatalog(); String catalogCode = catalog.getCode(); if (StringUtil.isNil(catalogCode)) { catalog = (WebCatalogEntity) orm.load(catalog.getClass(), catalog.getId()); catalogCode = catalog.getCode(); } /** 设置栏目编码(冗余字段) */ entity.setCatalogCode(catalogCode); }
@Override public void before(ActionEvent<WebCatalogEntity> event) { synchronized (SaveWebCatalog.class) { Orm orm = event.getOrm(); WebCatalogEntity entity = event.getEntity(); String catalogCode = entity.getCode(); if (!StringUtil.isNil(catalogCode)) { WebCatalogEntity existedCatalog = (WebCatalogEntity) orm.get(entity.getClass(), Expr.eq("code", catalogCode)); if (existedCatalog != null && catalogCode.equals(existedCatalog.getCode())) { if (entity.getId() != existedCatalog.getId()) { throw new CocException("栏目编码已经被占用!"); } } } } }
@Override public void after(ActionEvent event) { IBizSystem sys = (IBizSystem) event.getEntity(); if (sys == null) { return; } try { String extendClass = Demsy.bizEngine.getExtendClassName(sys); Demsy.bizEngine.parseSystemByAnnotation(Cls.forName(extendClass), sys); } catch (ClassNotFoundException e) { // throw new DemsyException(e); } }