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

xignzi006 发布系统代码

上级 802684ce
import { Http,Util } from '@/utils';
import EntityService from '../entity-service';
import WinLogic from '@/service/opportunity/win-logic';
......
import { Verify } from '@/utils/verify/verify';
/**
* 作为赢单结束
*
* @export
* @class WinLogicBase
*/
export default class WinLogicBase {
/**
* 名称
*
* @memberof WinLogicBase
*/
private name:string ="Win";
/**
* 唯一标识
*
* @memberof WinLogicBase
*/
private id:string = "67643EA0-5920-48F8-8411-251152430059";
/**
* 默认参数名称
*
* @memberof WinLogicBase
*/
private defaultParamName:string = "Default";
/**
* 参数集合
*
* @memberof WinLogicBase
*/
private paramsMap:Map<string,any> = new Map();
/**
* Creates an instance of WinLogicBase.
*
* @param {*} [opts={}]
* @memberof WinLogicBase
*/
constructor(opts: any = {}) {
this.initParams(opts);
}
/**
* 初始化参数集合
*
* @param {*} [opts={}]
* @memberof WinLogicBase
*/
public initParams(opts:any){
this.paramsMap.set('Default',opts);
}
/**
* 执行逻辑
*
* @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){
//开始节点
return this.paramsMap.get(this.defaultParamName).data;
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import WinLogicBase from './win-logic-base';
/**
* 作为赢单结束
*
* @export
* @class WinLogic
*/
export default class WinLogic extends WinLogicBase{
/**
* Creates an instance of WinLogic
*
* @param {*} [opts={}]
* @memberof WinLogic
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
package cn.ibizlab.businesscentral.core.sales.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.sales.domain.Opportunity;
/**
* 关系型数据实体[Win] 对象
*/
public interface IOpportunityWinLogic {
void execute(Opportunity opportunity ) ;
}
package cn.ibizlab.businesscentral.core.sales.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.sales.service.logic.IOpportunityWinLogic;
import cn.ibizlab.businesscentral.core.sales.domain.Opportunity;
/**
* 关系型数据实体[Win] 对象
*/
@Slf4j
@Service
public class OpportunityWinLogicImpl implements IOpportunityWinLogic{
@Autowired
private KieContainer kieContainer;
@Autowired
private cn.ibizlab.businesscentral.core.sales.service.IOpportunityService iBzSysDefaultService;
public cn.ibizlab.businesscentral.core.sales.service.IOpportunityService getIBzSysDefaultService() {
return this.iBzSysDefaultService;
}
public void execute(Opportunity et){
KieSession kieSession = null;
try{
kieSession=kieContainer.newKieSession();
kieSession.insert(et);
kieSession.setGlobal("opportunitywindefault",et);
kieSession.setGlobal("iBzSysOpportunityDefaultService",iBzSysDefaultService);
kieSession.setGlobal("curuser", cn.ibizlab.businesscentral.util.security.AuthenticationUser.getAuthenticationUser());
kieSession.startProcess("cn.ibizlab.businesscentral.core.sales.service.logic.opportunitywin");
}catch(Exception e){
throw new RuntimeException("执行[作为赢单结束]处理逻辑发生异常"+e);
}finally {
if(kieSession!=null)
kieSession.destroy();
}
}
}
......@@ -122,6 +122,12 @@
<![CDATA[ SELECT t1.`ACCOUNTIDYOMINAME`, t1.`ACTUALCLOSEDATE`, t1.`ACTUALVALUE`, t1.`ACTUALVALUE_BASE`, t1.`BUDGETAMOUNT`, t1.`BUDGETAMOUNT_BASE`, t1.`BUDGETSTATUS`, t1.`CAMPAIGNID`, t1.`CAMPAIGNNAME`, t1.`CAPTUREPROPOSALFEEDBACK`, t1.`CLOSEPROBABILITY`, t1.`COMPLETEFINALPROPOSAL`, t1.`COMPLETEINTERNALREVIEW`, t1.`CONFIRMINTEREST`, t1.`CONTACTIDYOMINAME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`CURRENTSITUATION`, t1.`CUSTOMERID`, t1.`CUSTOMERIDTYPE`, t1.`CUSTOMERIDYOMINAME`, t1.`CUSTOMERNEED`, t1.`CUSTOMERPAINPOINTS`, t1.`DECISIONMAKER`, t1.`DESCRIPTION`, t1.`DEVELOPPROPOSAL`, t1.`DISCOUNTAMOUNT`, t1.`DISCOUNTAMOUNT_BASE`, t1.`DISCOUNTPERCENTAGE`, t1.`EMAILADDRESS`, t1.`ESTIMATEDCLOSEDATE`, t1.`ESTIMATEDVALUE`, t1.`ESTIMATEDVALUE_BASE`, t1.`EVALUATEFIT`, t1.`EXCHANGERATE`, t1.`FILEDEBRIEF`, t1.`FINALDECISIONDATE`, t1.`FREIGHTAMOUNT`, t1.`FREIGHTAMOUNT_BASE`, t1.`IDENTIFYCOMPETITORS`, t1.`IDENTIFYCUSTOMERCONTACTS`, t1.`IDENTIFYPURSUITTEAM`, t1.`IMPORTSEQUENCENUMBER`, t1.`INITIALCOMMUNICATION`, t1.`LASTONHOLDTIME`, t1.`NEED`, t1.`ONHOLDTIME`, t1.`OPPORTUNITYID`, t1.`OPPORTUNITYNAME`, t1.`OPPORTUNITYRATINGCODE`, t1.`ORIGINATINGLEADID`, t1.`ORIGINATINGLEADNAME`, t1.`OVERRIDDENCREATEDON`, t1.`OWNERID`, t1.`OWNERIDTYPE`, t1.`OWNERIDYOMINAME`, t1.`PARENTACCOUNTID`, t1.`PARENTACCOUNTNAME`, t1.`PARENTCONTACTID`, t1.`PARENTCONTACTNAME`, t1.`PARTICIPATESINWORKFLOW`, t1.`PRESENTFINALPROPOSAL`, t1.`PRESENTPROPOSAL`, t1.`PRICELEVELID`, t1.`PRICELEVELNAME`, t1.`PRICINGERRORCODE`, t1.`PRIORITYCODE`, t1.`PRIVATE`, t1.`PROCESSID`, t1.`PROPOSEDSOLUTION`, t1.`PURCHASEPROCESS`, t1.`PURCHASETIMEFRAME`, t1.`PURSUITDECISION`, t1.`QUALIFICATIONCOMMENTS`, t1.`QUOTECOMMENTS`, t1.`RESOLVEFEEDBACK`, t1.`REVENUESYSTEMCALCULATED`, t1.`SALESSTAGE`, t1.`SALESSTAGECODE`, t1.`SCHEDULEFOLLOWUP_PROSPECT`, t1.`SCHEDULEFOLLOWUP_QUALIFY`, t1.`SCHEDULEPROPOSALMEETING`, t1.`SENDTHANKYOUNOTE`, t1.`SLAID`, t1.`SLANAME`, t1.`STAGEID`, t1.`STATECODE`, t1.`STATUSCODE`, t1.`STEPID`, t1.`STEPNAME`, t1.`TEAMSFOLLOWED`, t1.`TIMELINE`, t1.`TIMEZONERULEVERSIONNUMBER`, t1.`TOTALAMOUNT`, t1.`TOTALAMOUNTLESSFREIGHT`, t1.`TOTALAMOUNTLESSFREIGHT_BASE`, t1.`TOTALAMOUNT_BASE`, t1.`TOTALDISCOUNTAMOUNT`, t1.`TOTALDISCOUNTAMOUNT_BASE`, t1.`TOTALLINEITEMAMOUNT`, t1.`TOTALLINEITEMAMOUNT_BASE`, t1.`TOTALLINEITEMDISCOUNTAMOUNT`, t1.`TOTALTAX`, t1.`TOTALTAX_BASE`, t1.`TRANSACTIONCURRENCYID`, t1.`TRANSACTIONCURRENCYNAME`, t1.`TRAVERSEDPATH`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`UTCCONVERSIONTIMEZONECODE`, t1.`VERSIONNUMBER` FROM `OPPORTUNITY` t1
]]>
</sql>
<!--数据查询[Lost]-->
<sql id="Lost" databaseId="mysql">
<![CDATA[ SELECT t1.`ACCOUNTIDYOMINAME`, t1.`ACTUALCLOSEDATE`, t1.`ACTUALVALUE`, t1.`ACTUALVALUE_BASE`, t1.`BUDGETAMOUNT`, t1.`BUDGETAMOUNT_BASE`, t1.`BUDGETSTATUS`, t1.`CAMPAIGNID`, t1.`CAMPAIGNNAME`, t1.`CAPTUREPROPOSALFEEDBACK`, t1.`CLOSEPROBABILITY`, t1.`COMPLETEFINALPROPOSAL`, t1.`COMPLETEINTERNALREVIEW`, t1.`CONFIRMINTEREST`, t1.`CONTACTIDYOMINAME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`CURRENTSITUATION`, t1.`CUSTOMERID`, t1.`CUSTOMERIDTYPE`, t1.`CUSTOMERIDYOMINAME`, t1.`CUSTOMERNEED`, t1.`CUSTOMERPAINPOINTS`, t1.`DECISIONMAKER`, t1.`DESCRIPTION`, t1.`DEVELOPPROPOSAL`, t1.`DISCOUNTAMOUNT`, t1.`DISCOUNTAMOUNT_BASE`, t1.`DISCOUNTPERCENTAGE`, t1.`EMAILADDRESS`, t1.`ESTIMATEDCLOSEDATE`, t1.`ESTIMATEDVALUE`, t1.`ESTIMATEDVALUE_BASE`, t1.`EVALUATEFIT`, t1.`EXCHANGERATE`, t1.`FILEDEBRIEF`, t1.`FINALDECISIONDATE`, t1.`FREIGHTAMOUNT`, t1.`FREIGHTAMOUNT_BASE`, t1.`IDENTIFYCOMPETITORS`, t1.`IDENTIFYCUSTOMERCONTACTS`, t1.`IDENTIFYPURSUITTEAM`, t1.`IMPORTSEQUENCENUMBER`, t1.`INITIALCOMMUNICATION`, t1.`LASTONHOLDTIME`, t1.`NEED`, t1.`ONHOLDTIME`, t1.`OPPORTUNITYID`, t1.`OPPORTUNITYNAME`, t1.`OPPORTUNITYRATINGCODE`, t1.`ORIGINATINGLEADID`, t1.`ORIGINATINGLEADNAME`, t1.`OVERRIDDENCREATEDON`, t1.`OWNERID`, t1.`OWNERIDTYPE`, t1.`OWNERIDYOMINAME`, t1.`PARENTACCOUNTID`, t1.`PARENTACCOUNTNAME`, t1.`PARENTCONTACTID`, t1.`PARENTCONTACTNAME`, t1.`PARTICIPATESINWORKFLOW`, t1.`PRESENTFINALPROPOSAL`, t1.`PRESENTPROPOSAL`, t1.`PRICELEVELID`, t1.`PRICELEVELNAME`, t1.`PRICINGERRORCODE`, t1.`PRIORITYCODE`, t1.`PRIVATE`, t1.`PROCESSID`, t1.`PROPOSEDSOLUTION`, t1.`PURCHASEPROCESS`, t1.`PURCHASETIMEFRAME`, t1.`PURSUITDECISION`, t1.`QUALIFICATIONCOMMENTS`, t1.`QUOTECOMMENTS`, t1.`RESOLVEFEEDBACK`, t1.`REVENUESYSTEMCALCULATED`, t1.`SALESSTAGE`, t1.`SALESSTAGECODE`, t1.`SCHEDULEFOLLOWUP_PROSPECT`, t1.`SCHEDULEFOLLOWUP_QUALIFY`, t1.`SCHEDULEPROPOSALMEETING`, t1.`SENDTHANKYOUNOTE`, t1.`SLAID`, t1.`SLANAME`, t1.`STAGEID`, t1.`STATECODE`, t1.`STATUSCODE`, t1.`STEPID`, t1.`STEPNAME`, t1.`TEAMSFOLLOWED`, t1.`TIMELINE`, t1.`TIMEZONERULEVERSIONNUMBER`, t1.`TOTALAMOUNT`, t1.`TOTALAMOUNTLESSFREIGHT`, t1.`TOTALAMOUNTLESSFREIGHT_BASE`, t1.`TOTALAMOUNT_BASE`, t1.`TOTALDISCOUNTAMOUNT`, t1.`TOTALDISCOUNTAMOUNT_BASE`, t1.`TOTALLINEITEMAMOUNT`, t1.`TOTALLINEITEMAMOUNT_BASE`, t1.`TOTALLINEITEMDISCOUNTAMOUNT`, t1.`TOTALTAX`, t1.`TOTALTAX_BASE`, t1.`TRANSACTIONCURRENCYID`, t1.`TRANSACTIONCURRENCYNAME`, t1.`TRAVERSEDPATH`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`UTCCONVERSIONTIMEZONECODE`, t1.`VERSIONNUMBER` FROM `OPPORTUNITY` t1
WHERE ( t1.`STATECODE` = 2 )
]]>
</sql>
<!--数据查询[Top5]-->
<sql id="Top5" databaseId="mysql">
<![CDATA[ SELECT t1.`ACCOUNTIDYOMINAME`, t1.`ACTUALCLOSEDATE`, t1.`ACTUALVALUE`, t1.`ACTUALVALUE_BASE`, t1.`BUDGETAMOUNT`, t1.`BUDGETAMOUNT_BASE`, t1.`BUDGETSTATUS`, t1.`CAMPAIGNID`, t1.`CAMPAIGNNAME`, t1.`CAPTUREPROPOSALFEEDBACK`, t1.`CLOSEPROBABILITY`, t1.`COMPLETEFINALPROPOSAL`, t1.`COMPLETEINTERNALREVIEW`, t1.`CONFIRMINTEREST`, t1.`CONTACTIDYOMINAME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`CURRENTSITUATION`, t1.`CUSTOMERID`, t1.`CUSTOMERIDTYPE`, t1.`CUSTOMERIDYOMINAME`, t1.`CUSTOMERNEED`, t1.`CUSTOMERPAINPOINTS`, t1.`DECISIONMAKER`, t1.`DESCRIPTION`, t1.`DEVELOPPROPOSAL`, t1.`DISCOUNTAMOUNT`, t1.`DISCOUNTAMOUNT_BASE`, t1.`DISCOUNTPERCENTAGE`, t1.`EMAILADDRESS`, t1.`ESTIMATEDCLOSEDATE`, t1.`ESTIMATEDVALUE`, t1.`ESTIMATEDVALUE_BASE`, t1.`EVALUATEFIT`, t1.`EXCHANGERATE`, t1.`FILEDEBRIEF`, t1.`FINALDECISIONDATE`, t1.`FREIGHTAMOUNT`, t1.`FREIGHTAMOUNT_BASE`, t1.`IDENTIFYCOMPETITORS`, t1.`IDENTIFYCUSTOMERCONTACTS`, t1.`IDENTIFYPURSUITTEAM`, t1.`IMPORTSEQUENCENUMBER`, t1.`INITIALCOMMUNICATION`, t1.`LASTONHOLDTIME`, t1.`NEED`, t1.`ONHOLDTIME`, t1.`OPPORTUNITYID`, t1.`OPPORTUNITYNAME`, t1.`OPPORTUNITYRATINGCODE`, t1.`ORIGINATINGLEADID`, t1.`ORIGINATINGLEADNAME`, t1.`OVERRIDDENCREATEDON`, t1.`OWNERID`, t1.`OWNERIDTYPE`, t1.`OWNERIDYOMINAME`, t1.`PARENTACCOUNTID`, t1.`PARENTACCOUNTNAME`, t1.`PARENTCONTACTID`, t1.`PARENTCONTACTNAME`, t1.`PARTICIPATESINWORKFLOW`, t1.`PRESENTFINALPROPOSAL`, t1.`PRESENTPROPOSAL`, t1.`PRICELEVELID`, t1.`PRICELEVELNAME`, t1.`PRICINGERRORCODE`, t1.`PRIORITYCODE`, t1.`PRIVATE`, t1.`PROCESSID`, t1.`PROPOSEDSOLUTION`, t1.`PURCHASEPROCESS`, t1.`PURCHASETIMEFRAME`, t1.`PURSUITDECISION`, t1.`QUALIFICATIONCOMMENTS`, t1.`QUOTECOMMENTS`, t1.`RESOLVEFEEDBACK`, t1.`REVENUESYSTEMCALCULATED`, t1.`SALESSTAGE`, t1.`SALESSTAGECODE`, t1.`SCHEDULEFOLLOWUP_PROSPECT`, t1.`SCHEDULEFOLLOWUP_QUALIFY`, t1.`SCHEDULEPROPOSALMEETING`, t1.`SENDTHANKYOUNOTE`, t1.`SLAID`, t1.`SLANAME`, t1.`STAGEID`, t1.`STATECODE`, t1.`STATUSCODE`, t1.`STEPID`, t1.`STEPNAME`, t1.`TEAMSFOLLOWED`, t1.`TIMELINE`, t1.`TIMEZONERULEVERSIONNUMBER`, t1.`TOTALAMOUNT`, t1.`TOTALAMOUNTLESSFREIGHT`, t1.`TOTALAMOUNTLESSFREIGHT_BASE`, t1.`TOTALAMOUNT_BASE`, t1.`TOTALDISCOUNTAMOUNT`, t1.`TOTALDISCOUNTAMOUNT_BASE`, t1.`TOTALLINEITEMAMOUNT`, t1.`TOTALLINEITEMAMOUNT_BASE`, t1.`TOTALLINEITEMDISCOUNTAMOUNT`, t1.`TOTALTAX`, t1.`TOTALTAX_BASE`, t1.`TRANSACTIONCURRENCYID`, t1.`TRANSACTIONCURRENCYNAME`, t1.`TRAVERSEDPATH`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`UTCCONVERSIONTIMEZONECODE`, t1.`VERSIONNUMBER` FROM `OPPORTUNITY` t1
......
package cn.ibizlab.businesscentral.sales.logic.opportunitylogic.win;
import java.util.Map;
import java.util.HashMap;
import com.alibaba.fastjson.JSONObject;
global cn.ibizlab.businesscentral.core.sales.domain.Opportunity opportunitywindefault;
global cn.ibizlab.businesscentral.core.sales.service.IOpportunityService iBzSysOpportunityDefaultService;
global cn.ibizlab.businesscentral.util.security.AuthenticationUser curuser;
no-loop
//逻辑处理节点[开始]
rule "begin"
ruleflow-group "opportunitywinbegin"
when
then
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.sales.service.logic.opportunitywin" isClosed="false" isExecutable="true" name="ScoreRule" processType="Private" tns:packageName="cn.ibizlab.businesscentral.core.sales.service.logic.opportunitywin">
<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="opportunitywindefault" type="cn.ibizlab.businesscentral.core.sales.domain.Opportunity" />
</extensionElements>
<startEvent id="67643EA0-5920-48F8-8411-251152430059" isInterrupting="true"/>
<endEvent id="67643EA0-5920-48F8-8411-251152430059_End" name="End"/>
<sequenceFlow id="67643EA0-5920-48F8-8411-251152430059_End_Line" sourceRef="67643EA0-5920-48F8-8411-251152430059" targetRef="67643EA0-5920-48F8-8411-251152430059_End"/>
</process>
</definitions>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册