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

xignzi006 发布系统代码

上级 d0227967
......@@ -361,6 +361,7 @@ export default {
address1_fax: "地址 1: 传真",
address1_freighttermscode: "地址 1: 货运条款",
address1_postalcode: "地址 1: 邮政编码",
primarycontactid: "主要联系人",
primarycontactname: "主要联系人",
preferredcontactmethodcode: "首选联系方式",
donotemail: "不允许使用电子邮件",
......
......@@ -360,6 +360,7 @@ export default {
address1_fax: "地址 1: 传真",
address1_freighttermscode: "地址 1: 货运条款",
address1_postalcode: "地址 1: 邮政编码",
primarycontactid: "主要联系人",
primarycontactname: "主要联系人",
preferredcontactmethodcode: "首选联系方式",
donotemail: "不允许使用电子邮件",
......
......@@ -611,6 +611,7 @@ mock.onGet(new RegExp(/^\/accounts\/fetchusable(\?[\w-./?%&=,]*)*$/)).reply((con
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// Remove
......
import { Http,Util } from '@/utils';
import EntityService from '../entity-service';
import ActiveLogic from '@/service/account/active-logic';
import FillContactLogic from '@/service/account/fill-contact-logic';
import InactiveLogic from '@/service/account/inactive-logic';
......@@ -475,4 +476,19 @@ export default class AccountServiceBase extends EntityService {
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/accounts/fetchusable`,tempData,isloading);
}
/**
* FillContact接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof AccountServiceBase
*/
public async FillContact(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let appLogic:FillContactLogic = new FillContactLogic({context:JSON.parse(JSON.stringify(context)),data:JSON.parse(JSON.stringify(data))});
const result = await appLogic.onExecute(context,data,isloading?true:false);
return {status:200,data:result};
}
}
\ No newline at end of file
import AccountService from '@/service/account/account-service';
import { Verify } from '@/utils/verify/verify';
/**
* FillContact
*
* @export
* @class FillContactLogicBase
*/
export default class FillContactLogicBase {
/**
* 名称
*
* @memberof FillContactLogicBase
*/
private name:string ="FillContact";
/**
* 唯一标识
*
* @memberof FillContactLogicBase
*/
private id:string = "7C1FBBB4-5480-4929-BA55-10FCEFFD86E9";
/**
* 默认参数名称
*
* @memberof FillContactLogicBase
*/
private defaultParamName:string = "Default";
/**
* 参数集合
*
* @memberof FillContactLogicBase
*/
private paramsMap:Map<string,any> = new Map();
/**
* Creates an instance of FillContactLogicBase.
*
* @param {*} [opts={}]
* @memberof FillContactLogicBase
*/
constructor(opts: any = {}) {
this.initParams(opts);
}
/**
* 初始化参数集合
*
* @param {*} [opts={}]
* @memberof FillContactLogicBase
*/
public initParams(opts:any){
this.paramsMap.set('Default',opts);
}
/**
* 计算0节点结果
*
* @param params 传入参数
*/
public compute0Cond(params:any):boolean{
return true;
}
/**
* 计算1节点结果
*
* @param params 传入参数
*/
public compute1Cond(params:any):boolean{
return true;
}
/**
* 执行逻辑
*
* @param context 应用上下文
* @param params 传入参数
*/
public onExecute(context:any,params:any,isloading:boolean){
return this.executeBegin(context,params,isloading);
}
/**
* 开始
*
* @param params 传入参数
*/
private async executeBegin(context:any,params:any,isloading:boolean){
//开始节点
if(this.compute1Cond(params)){
return this.executePrepareparam1(context,params,isloading);
}
}
/**
* Fill key
*
* @param context 应用上下文
* @param params 传入参数
*/
private async executePrepareparam1(context:any,params:any,isloading:boolean){
// 准备参数节点
if(this.compute0Cond(params)){
return this.executeDeaction1(context,params,isloading);
}
}
/**
* Get
*
* @param context 应用上下文
* @param params 传入参数
*/
private async executeDeaction1(context:any,params:any,isloading:boolean){
// 行为处理节点
let result: any;
let actionParam:any = this.paramsMap.get('Default');
const targetService:AccountService = new AccountService();
if (targetService['Get'] && targetService['Get'] instanceof Function) {
result = await targetService['Get'](actionParam.context,actionParam.data, false);
}
if(result && result.status == 200){
Object.assign(actionParam.data,result.data);
return this.paramsMap.get(this.defaultParamName).data;
}
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import FillContactLogicBase from './fill-contact-logic-base';
/**
* FillContact
*
* @export
* @class FillContactLogic
*/
export default class FillContactLogic extends FillContactLogicBase{
/**
* Creates an instance of FillContactLogic
*
* @param {*} [opts={}]
* @memberof FillContactLogic
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
......@@ -182,6 +182,7 @@ export class Info_AllEditFormBase extends EditFormControlBase {
address1_fax: null,
address1_freighttermscode: null,
address1_postalcode: null,
primarycontactid: null,
primarycontactname: null,
preferredcontactmethodcode: null,
donotemail: null,
......@@ -298,6 +299,8 @@ export class Info_AllEditFormBase extends EditFormControlBase {
address1_postalcode: new FormItemModel({ caption: '地址 1: 邮政编码', detailType: 'FORMITEM', name: 'address1_postalcode', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
primarycontactid: new FormItemModel({ caption: '主要联系人', detailType: 'FORMITEM', name: 'primarycontactid', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
primarycontactname: new FormItemModel({ caption: '主要联系人', detailType: 'FORMITEM', name: 'primarycontactname', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
preferredcontactmethodcode: new FormItemModel({ caption: '首选联系方式', detailType: 'FORMITEM', name: 'preferredcontactmethodcode', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
......
......@@ -170,6 +170,11 @@ export default class Info_AllModel {
prop: 'address1_postalcode',
dataType: 'TEXT',
},
{
name: 'primarycontactid',
prop: 'primarycontactid',
dataType: 'PICKUP',
},
{
name: 'primarycontactname',
prop: 'primarycontactname',
......
......@@ -87,6 +87,10 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
@Lazy
protected cn.ibizlab.businesscentral.core.base.service.logic.IAccountActiveLogic activeLogic;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.base.service.logic.IAccountFillContactLogic fillcontactLogic;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.base.service.logic.IAccountInactiveLogic inactiveLogic;
......
package cn.ibizlab.businesscentral.core.base.service.logic;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import cn.ibizlab.businesscentral.core.base.domain.Account;
/**
* 关系型数据实体[FillContact] 对象
*/
public interface IAccountFillContactLogic {
void execute(Account account ) ;
}
package cn.ibizlab.businesscentral.core.base.service.logic.impl;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.KieContainer;
import cn.ibizlab.businesscentral.core.base.service.logic.IAccountFillContactLogic;
import cn.ibizlab.businesscentral.core.base.domain.Account;
/**
* 关系型数据实体[FillContact] 对象
*/
@Slf4j
@Service
public class AccountFillContactLogicImpl implements IAccountFillContactLogic{
@Autowired
private KieContainer kieContainer;
@Autowired
private cn.ibizlab.businesscentral.core.base.service.IAccountService accountservice;
public cn.ibizlab.businesscentral.core.base.service.IAccountService getAccountService() {
return this.accountservice;
}
@Autowired
private cn.ibizlab.businesscentral.core.base.service.IAccountService iBzSysDefaultService;
public cn.ibizlab.businesscentral.core.base.service.IAccountService getIBzSysDefaultService() {
return this.iBzSysDefaultService;
}
public void execute(Account et){
KieSession kieSession = null;
try{
kieSession=kieContainer.newKieSession();
kieSession.insert(et);
kieSession.setGlobal("accountfillcontactdefault",et);
kieSession.setGlobal("accountservice",accountservice);
kieSession.setGlobal("iBzSysAccountDefaultService",iBzSysDefaultService);
kieSession.setGlobal("curuser", cn.ibizlab.businesscentral.util.security.AuthenticationUser.getAuthenticationUser());
kieSession.startProcess("cn.ibizlab.businesscentral.core.base.service.logic.accountfillcontact");
}catch(Exception e){
throw new RuntimeException("执行[FillContact]处理逻辑发生异常"+e);
}finally {
if(kieSession!=null)
kieSession.destroy();
}
}
}
......@@ -424,7 +424,7 @@
"delogicname":"客户",
"sysmoudle":{"id":"BASE","name":"Base"},
"dedataset":[{"id":"ByParentKey" , "name":"ByParentKey"},{"id":"Default" , "name":"DEFAULT"},{"id":"Root" , "name":"Root"},{"id":"Stop" , "name":"停用客户"},{"id":"Usable" , "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":"Active" , "name":"激活" , "type":"DELOGIC" },{"id":"AddList" , "name":"添加到市场营销列表" , "type":"USERCUSTOM" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Inactive" , "name":"停用" , "type":"DELOGIC" },{"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":"Active" , "name":"激活" , "type":"DELOGIC" },{"id":"AddList" , "name":"添加到市场营销列表" , "type":"USERCUSTOM" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"FillContact" , "name":"FillContact" , "type":"DELOGIC" },{"id":"Inactive" , "name":"停用" , "type":"DELOGIC" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
......
package cn.ibizlab.businesscentral.base.logic.accountlogic.fillcontact;
import java.util.Map;
import java.util.HashMap;
import com.alibaba.fastjson.JSONObject;
global cn.ibizlab.businesscentral.core.base.domain.Account accountfillcontactdefault;
global cn.ibizlab.businesscentral.core.base.service.IAccountService accountservice;
global cn.ibizlab.businesscentral.core.base.service.IAccountService iBzSysAccountDefaultService;
global cn.ibizlab.businesscentral.util.security.AuthenticationUser curuser;
no-loop
//逻辑处理节点[开始]
rule "begin"
ruleflow-group "accountfillcontactbegin"
when
then
end
//逻辑处理节点[fill key]
rule "prepareparam1"
ruleflow-group "accountfillcontactprepareparam1"
when
then
update(accountfillcontactdefault);//更新fact中变量值
end
//逻辑处理节点[get]
rule "deaction1"
ruleflow-group "accountfillcontactdeaction1"
when
then
cn.ibizlab.businesscentral.util.helper.CachedBeanCopier.copy(accountservice.get(accountfillcontactdefault.getAccountid()),accountfillcontactdefault);
update(accountfillcontactdefault);//更新fact中变量值
end
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:g="http://www.jboss.org/drools/flow/gpd" xmlns:tns="http://www.jboss.org/drools" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" expressionLanguage="http://www.mvel.org/2.0" id="Definition" name="" targetNamespace="http://www.jboss.org/drools" typeLanguage="http://www.java.com/javaTypes">
<process id="cn.ibizlab.businesscentral.core.base.service.logic.accountfillcontact" isClosed="false" isExecutable="true" name="ScoreRule" processType="Private" tns:packageName="cn.ibizlab.businesscentral.core.base.service.logic.accountfillcontact">
<extensionElements>
<tns:import name="java.util.Map" />
<tns:import name="org.springframework.util.StringUtils"/>
<tns:import name="cn.ibizlab.businesscentral.util.helper.RuleUtils"/>
<tns:global identifier="accountfillcontactdefault" type="cn.ibizlab.businesscentral.core.base.domain.Account" />
</extensionElements>
<startEvent id="7C1FBBB4-5480-4929-BA55-10FCEFFD86E9" isInterrupting="true"/>
<businessRuleTask activiti:exclusive="true" g:ruleFlowGroup="accountfillcontactprepareparam1" id="5F238258-5B6B-4B3B-8FFB-904709A074CD" implementation="http://www.jboss.org/drools/rule" name="Fill key"/>
<businessRuleTask activiti:exclusive="true" g:ruleFlowGroup="accountfillcontactdeaction1" id="0A0A7532-70B6-4473-9165-2535A50F2B88" implementation="http://www.jboss.org/drools/rule" name="Get"/>
<endEvent id="0A0A7532-70B6-4473-9165-2535A50F2B88_End" name="End"/>
<sequenceFlow id="0A0A7532-70B6-4473-9165-2535A50F2B88_End_Line" sourceRef="0A0A7532-70B6-4473-9165-2535A50F2B88" targetRef="0A0A7532-70B6-4473-9165-2535A50F2B88_End"/>
<sequenceFlow id="FA2EC61F-1953-426C-9814-DD52529D2C80" sourceRef="5F238258-5B6B-4B3B-8FFB-904709A074CD" targetRef="0A0A7532-70B6-4473-9165-2535A50F2B88">
</sequenceFlow>
<sequenceFlow id="F97D9997-6037-4AAD-84E4-C39A8BB48ED5" sourceRef="7C1FBBB4-5480-4929-BA55-10FCEFFD86E9" targetRef="5F238258-5B6B-4B3B-8FFB-904709A074CD">
</sequenceFlow>
</process>
</definitions>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册