提交 df1c3172 编写于 作者: ibizdev's avatar ibizdev

ibiz4j 发布系统代码 [ibz-dst,应用]

上级 e1b431c6
...@@ -40,6 +40,9 @@ export default { ...@@ -40,6 +40,9 @@ export default {
}, },
main_form: { main_form: {
details: { details: {
tabpage1: "规则设置",
tabpage2: "属性集合",
tabpanel1: "",
group1: "规则基本信息", group1: "规则基本信息",
formpage1: "基本信息", formpage1: "基本信息",
srfupdatedate: "更新时间", srfupdatedate: "更新时间",
......
...@@ -39,6 +39,9 @@ export default { ...@@ -39,6 +39,9 @@ export default {
}, },
main_form: { main_form: {
details: { details: {
tabpage1: "规则设置",
tabpage2: "属性集合",
tabpanel1: "",
group1: "规则基本信息", group1: "规则基本信息",
formpage1: "基本信息", formpage1: "基本信息",
srfupdatedate: "更新时间", srfupdatedate: "更新时间",
......
...@@ -233,6 +233,44 @@ mock.onPost(new RegExp(/^\/ruleitems\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).rep ...@@ -233,6 +233,44 @@ mock.onPost(new RegExp(/^\/ruleitems\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).rep
return [status, data]; return [status, data];
}); });
// Modelchange
mock.onPost(new RegExp(/^\/ruleitems\/?([a-zA-Z0-9\-\;]{0,35})\/modelchange$/)).reply((config: any) => {
console.groupCollapsed("实体:ruleitem 方法: Modelchange");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['rule_id'];
const matchArray:any = new RegExp(/^\/ruleitems\/([a-zA-Z0-9\-\;]{1,35})\/modelchange$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.rule_id, tempValue.rule_id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['rule_id'] == tempValue['rule_id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// Save // Save
mock.onPost(new RegExp(/^\/ruleitems\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/ruleitems\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:ruleitem 方法: Save"); console.groupCollapsed("实体:ruleitem 方法: Save");
......
...@@ -153,6 +153,20 @@ export default class RuleItemServiceBase extends EntityService { ...@@ -153,6 +153,20 @@ export default class RuleItemServiceBase extends EntityService {
return res; return res;
} }
/**
* Modelchange接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof RuleItemServiceBase
*/
public async Modelchange(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/ruleitems/${context.ruleitem}/modelchange`,data,isloading);
return res;
}
/** /**
* Save接口方法 * Save接口方法
* *
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
</i-col> </i-col>
<i-col v-show="detailsModel.rulegroup.visible" :style="{}" :sm="{ span: 24, offset: 0 }" :md="{ span: 24, offset: 0 }" :lg="{ span: 24, offset: 0 }" :xl="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.rulegroup.visible" :style="{}" :sm="{ span: 24, offset: 0 }" :md="{ span: 24, offset: 0 }" :lg="{ span: 24, offset: 0 }" :xl="{ span: 24, offset: 0 }">
<app-form-item name='rulegroup' :itemRules="this.rules().rulegroup" class='' :caption="$t('entities.ruleitem.main_form.details.rulegroup')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.rulegroup.error" :isEmptyCaption="false" labelPos="TOP"> <app-form-item name='rulegroup' :itemRules="this.rules().rulegroup" class='' :caption="$t('entities.ruleitem.main_form.details.rulegroup')" uiStyle="DEFAULT" :labelWidth="0" :isShowCaption="false" :error="detailsModel.rulegroup.error" :isEmptyCaption="false" labelPos="NONE">
<app-checkbox-list <app-checkbox-list
v-model="data.rulegroup" v-model="data.rulegroup"
...@@ -83,15 +83,44 @@ ...@@ -83,15 +83,44 @@
</app-form-item> </app-form-item>
</i-col> </i-col>
<i-col v-show="detailsModel.cfg.visible" :style="{}" :sm="{ span: 24, offset: 0 }" :md="{ span: 24, offset: 0 }" :lg="{ span: 24, offset: 0 }" :xl="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.tabpanel1.visible" :style="{}" :sm="{ span: 24, offset: 0 }" :md="{ span: 24, offset: 0 }" :lg="{ span: 24, offset: 0 }" :xl="{ span: 24, offset: 0 }">
<tabs :animated="false" name='tabpanel1' v-show="detailsModel.tabpanel1.visible" class=''
:value="detailsModel.tabpanel1.activiedPage" @on-click="detailsModel.tabpanel1.clickPage($event)">
<tab-pane v-show="detailsModel.tabpage1.visible" name='tabpage1' :index="0" tab='tabpanel1' class=''
:label="(h) =>{
return h('span',{
class:'caption'
},[
$t('entities.ruleitem.main_form.details.tabpage1')
])
}">
<i-col v-show="detailsModel.cfg.visible" :style="{}" :sm="{ span: 24, offset: 0 }" :md="{ span: 24, offset: 0 }" :lg="{ span: 24, offset: 0 }" :xl="{ span: 24, offset: 0 }">
<app-form-json-logic v-model="data.cfg" :formState="formState" :data="data" :disabled="detailsModel.cfg.disabled" ></app-form-json-logic> <app-form-json-logic v-model="data.cfg" :formState="formState" :data="data" :disabled="detailsModel.cfg.disabled" ></app-form-json-logic>
</i-col> </i-col>
<i-col v-show="detailsModel.fieldset.visible" :style="{}" :sm="{ span: 24, offset: 0 }" :md="{ span: 24, offset: 0 }" :lg="{ span: 24, offset: 0 }" :xl="{ span: 24, offset: 0 }">
</tab-pane>
<tab-pane v-show="detailsModel.tabpage2.visible" name='tabpage2' :index="1" tab='tabpanel1' class=''
:label="(h) =>{
return h('span',{
class:'caption'
},[
$t('entities.ruleitem.main_form.details.tabpage2')
])
}">
<i-col v-show="detailsModel.fieldset.visible" :style="{}" :sm="{ span: 24, offset: 0 }" :md="{ span: 24, offset: 0 }" :lg="{ span: 24, offset: 0 }" :xl="{ span: 24, offset: 0 }">
<app-form-json-field-set v-model="data.fieldset" :formState="formState" :data="data" :disabled="detailsModel.fieldset.disabled" ></app-form-json-field-set> <app-form-json-field-set v-model="data.fieldset" :formState="formState" :data="data" :disabled="detailsModel.fieldset.disabled" ></app-form-json-field-set>
</i-col>
</tab-pane>
</tabs>
</i-col> </i-col>
<i-col v-show="detailsModel.cond.visible" :style="{}" :sm="{ span: 24, offset: 0 }" :md="{ span: 24, offset: 0 }" :lg="{ span: 24, offset: 0 }" :xl="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.cond.visible" :style="{}" :sm="{ span: 24, offset: 0 }" :md="{ span: 24, offset: 0 }" :lg="{ span: 24, offset: 0 }" :xl="{ span: 24, offset: 0 }">
<app-form-item name='cond' :itemRules="this.rules().cond" class='' :caption="$t('entities.ruleitem.main_form.details.cond')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.cond.error" :isEmptyCaption="false" labelPos="TOP"> <app-form-item name='cond' :itemRules="this.rules().cond" class='' :caption="$t('entities.ruleitem.main_form.details.cond')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.cond.error" :isEmptyCaption="false" labelPos="TOP">
...@@ -762,6 +791,12 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -762,6 +791,12 @@ export default class MainBase extends Vue implements ControlInterface {
* @memberof MainBase * @memberof MainBase
*/ */
public detailsModel: any = { public detailsModel: any = {
tabpage1: new FormTabPageModel({ caption: '规则设置', detailType: 'TABPAGE', name: 'tabpage1', visible: true, isShowCaption: true, form: this, isControlledContent: false })
,
tabpage2: new FormTabPageModel({ caption: '属性集合', detailType: 'TABPAGE', name: 'tabpage2', visible: true, isShowCaption: true, form: this, isControlledContent: false })
,
tabpanel1: new FormTabPanelModel({ caption: '', detailType: 'TABPANEL', name: 'tabpanel1', visible: true, isShowCaption: false, form: this, isControlledContent: false , tabPages: [{ name: 'tabpage1', index: 0, visible: true }, { name: 'tabpage2', index: 1, visible: true }] })
,
group1: new FormGroupPanelModel({ caption: '规则基本信息', detailType: 'GROUPPANEL', name: 'group1', visible: true, isShowCaption: false, form: this, isControlledContent: false , uiActionGroup: { caption: '', langbase: 'entities.ruleitem.main_form', extractMode: 'ITEM', details: [] }, isManageContainer: false, showMoreModeItems: [] }) group1: new FormGroupPanelModel({ caption: '规则基本信息', detailType: 'GROUPPANEL', name: 'group1', visible: true, isShowCaption: false, form: this, isControlledContent: false , uiActionGroup: { caption: '', langbase: 'entities.ruleitem.main_form', extractMode: 'ITEM', details: [] }, isManageContainer: false, showMoreModeItems: [] })
, ,
formpage1: new FormPageModel({ caption: '基本信息', detailType: 'FORMPAGE', name: 'formpage1', visible: true, isShowCaption: true, form: this, isControlledContent: false }) formpage1: new FormPageModel({ caption: '基本信息', detailType: 'FORMPAGE', name: 'formpage1', visible: true, isShowCaption: true, form: this, isControlledContent: false })
...@@ -788,7 +823,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -788,7 +823,7 @@ export default class MainBase extends Vue implements ControlInterface {
, ,
businesscat: new FormItemModel({ caption: '业务类别', detailType: 'FORMITEM', name: 'businesscat', visible: true, isShowCaption: true, form: this, isControlledContent: false , required:false, disabled: false, enableCond: 3 }) businesscat: new FormItemModel({ caption: '业务类别', detailType: 'FORMITEM', name: 'businesscat', visible: true, isShowCaption: true, form: this, isControlledContent: false , required:false, disabled: false, enableCond: 3 })
, ,
rulegroup: new FormItemModel({ caption: '规则分组', detailType: 'FORMITEM', name: 'rulegroup', visible: true, isShowCaption: true, form: this, isControlledContent: false , required:false, disabled: false, enableCond: 3 }) rulegroup: new FormItemModel({ caption: '规则分组', detailType: 'FORMITEM', name: 'rulegroup', visible: true, isShowCaption: false, form: this, isControlledContent: false , required:false, disabled: false, enableCond: 3 })
, ,
cfg: new FormItemModel({ caption: '配置', detailType: 'FORMITEM', name: 'cfg', visible: true, isShowCaption: true, form: this, isControlledContent: false , required:false, disabled: false, enableCond: 3 }) cfg: new FormItemModel({ caption: '配置', detailType: 'FORMITEM', name: 'cfg', visible: true, isShowCaption: true, form: this, isControlledContent: false , required:false, disabled: false, enableCond: 3 })
, ,
...@@ -1154,6 +1189,16 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1154,6 +1189,16 @@ export default class MainBase extends Vue implements ControlInterface {
if(Object.is(name, 'modelname')){
const details: string[] = [];
if(await this.checkItem('modelname')){
this.updateFormItems('Modelchange', this.data, details, true);
}
}
} }
/** /**
......
package cn.ibizlab.core.extensions.service;
import cn.ibizlab.core.rule.service.impl.RuleItemServiceImpl;
import lombok.extern.slf4j.Slf4j;
import cn.ibizlab.core.rule.domain.RuleItem;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Primary;
import java.util.*;
/**
* 实体[规则] 自定义服务对象
*/
@Slf4j
@Primary
@Service("RuleItemExService")
public class RuleItemExService extends RuleItemServiceImpl {
@Override
protected Class currentModelClass() {
return com.baomidou.mybatisplus.core.toolkit.ReflectionKit.getSuperClassGenericType(this.getClass().getSuperclass(), 1);
}
/**
* [Modelchange:modelchange] 行为扩展
* @param et
* @return
*/
@Override
@Transactional
public RuleItem modelchange(RuleItem et) {
return super.modelchange(et);
}
}
...@@ -34,6 +34,7 @@ public interface IRuleItemService extends IService<RuleItem> { ...@@ -34,6 +34,7 @@ public interface IRuleItemService extends IService<RuleItem> {
RuleItem get(String key); RuleItem get(String key);
RuleItem getDraft(RuleItem et); RuleItem getDraft(RuleItem et);
boolean checkKey(RuleItem et); boolean checkKey(RuleItem et);
RuleItem modelchange(RuleItem et);
boolean save(RuleItem et); boolean save(RuleItem et);
void saveBatch(List<RuleItem> list); void saveBatch(List<RuleItem> list);
Page<RuleItem> searchDefault(RuleItemSearchContext context); Page<RuleItem> searchDefault(RuleItemSearchContext context);
......
...@@ -129,6 +129,13 @@ public class RuleItemServiceImpl extends ServiceImpl<RuleItemMapper, RuleItem> i ...@@ -129,6 +129,13 @@ public class RuleItemServiceImpl extends ServiceImpl<RuleItemMapper, RuleItem> i
public boolean checkKey(RuleItem et) { public boolean checkKey(RuleItem et) {
return (!ObjectUtils.isEmpty(et.getRuleId())) && (!Objects.isNull(this.getById(et.getRuleId()))); return (!ObjectUtils.isEmpty(et.getRuleId())) && (!Objects.isNull(this.getById(et.getRuleId())));
} }
@Override
@Transactional
public RuleItem modelchange(RuleItem et) {
//自定义代码
return et;
}
@Override @Override
@Transactional @Transactional
public boolean save(RuleItem et) { public boolean save(RuleItem et) {
......
...@@ -420,7 +420,7 @@ ...@@ -420,7 +420,7 @@
<!--输出实体[RU_ITEM]数据结构 --> <!--输出实体[RU_ITEM]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-ru_item-51-16"> <changeSet author="a_A_5d9d78509" id="tab-ru_item-54-16">
<createTable tableName="IBZRULE"> <createTable tableName="IBZRULE">
<column name="RULEID" remarks="" type="VARCHAR(100)"> <column name="RULEID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_RU_ITEM_RULEID"/> <constraints primaryKey="true" primaryKeyName="PK_RU_ITEM_RULEID"/>
......
...@@ -152,7 +152,7 @@ ...@@ -152,7 +152,7 @@
"delogicname":"规则", "delogicname":"规则",
"sysmoudle":{"id":"RULE","name":"rule"}, "sysmoudle":{"id":"RULE","name":"rule"},
"dedataset":[{"id":"Default" , "name":"数据集"}], "dedataset":[{"id":"Default" , "name":"数据集"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }], "deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Modelchange" , "name":"modelchange" , "type":"USERCUSTOM" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}] "datascope":[{"id":"all","name":"全部数据"}]
} }
], ],
......
...@@ -121,6 +121,17 @@ public class RuleItemResource { ...@@ -121,6 +121,17 @@ public class RuleItemResource {
return ResponseEntity.status(HttpStatus.OK).body(ruleitemService.checkKey(ruleitemMapping.toDomain(ruleitemdto))); return ResponseEntity.status(HttpStatus.OK).body(ruleitemService.checkKey(ruleitemMapping.toDomain(ruleitemdto)));
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzdst-RuleItem-Modelchange-all')")
@ApiOperation(value = "modelchange", tags = {"规则" }, notes = "modelchange")
@RequestMapping(method = RequestMethod.POST, value = "/ruleitems/{ruleitem_id}/modelchange")
public ResponseEntity<RuleItemDTO> modelchange(@PathVariable("ruleitem_id") String ruleitem_id, @RequestBody RuleItemDTO ruleitemdto) {
RuleItem domain = ruleitemMapping.toDomain(ruleitemdto);
domain.setRuleId(ruleitem_id);
domain = ruleitemService.modelchange(domain);
ruleitemdto = ruleitemMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(ruleitemdto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzdst-RuleItem-Save-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzdst-RuleItem-Save-all')")
@ApiOperation(value = "保存规则", tags = {"规则" }, notes = "保存规则") @ApiOperation(value = "保存规则", tags = {"规则" }, notes = "保存规则")
@RequestMapping(method = RequestMethod.POST, value = "/ruleitems/save") @RequestMapping(method = RequestMethod.POST, value = "/ruleitems/save")
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册