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

xignzi006 发布系统代码

上级 3b20e7f0
......@@ -665,6 +665,7 @@ export default {
address1_city: "地址 1: 市/县",
primarycontactname: "主要联系人",
emailaddress1: "电子邮件",
revenue: "年收入",
parentaccountname: "上级客户",
},
uiactions: {
......
......@@ -664,6 +664,7 @@ export default {
address1_city: "地址 1: 市/县",
primarycontactname: "主要联系人",
emailaddress1: "电子邮件",
revenue: "年收入",
parentaccountname: "上级客户",
},
uiactions: {
......
<studio-view-style2 viewName="activitypointergridview" viewTitle="活动" class='degridview activity-pointer-grid-view'>
<template slot='title'>
<span class='caption-info'>{{$t(model.srfTitle)}}</span>
</template>
<i-input slot="quickSearch" v-show="!isExpandSearchForm" v-model="query" search @on-search="onSearch($event)"/>
<template slot="quickGroupSearch">
<app-quick-group :items="quickGroupModel" @valuechange="quickGroupValueChange($event)"></app-quick-group>
......
......@@ -62,21 +62,6 @@ export default class CampaignServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
......@@ -107,6 +92,21 @@ export default class CampaignServiceBase extends EntityService {
}
}
masterData.campaigncampaigns = campaigncampaignsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -116,9 +116,9 @@ export default class CampaignServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/campaigns`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -133,21 +133,6 @@ export default class CampaignServiceBase extends EntityService {
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
......@@ -178,11 +163,26 @@ export default class CampaignServiceBase extends EntityService {
}
}
masterData.campaigncampaigns = campaigncampaignsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/campaigns/${context.campaign}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -210,9 +210,9 @@ export default class CampaignServiceBase extends EntityService {
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/campaigns/${context.campaign}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -228,9 +228,9 @@ export default class CampaignServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/campaigns/getdraft`,isloading);
res.data.campaign = data.campaign;
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -258,21 +258,6 @@ export default class CampaignServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
......@@ -303,11 +288,26 @@ export default class CampaignServiceBase extends EntityService {
}
}
masterData.campaigncampaigns = campaigncampaignsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......
import { Verify } from '@/utils/verify/verify';
/**
* 取消发票
*
* @export
* @class CancelLogicBase
*/
export default class CancelLogicBase {
/**
* 名称
*
* @memberof CancelLogicBase
*/
private name:string ="Cancel";
/**
* 唯一标识
*
* @memberof CancelLogicBase
*/
private id:string = "9A2B78B2-DC42-4EE1-96D4-507FAB73DE1D";
/**
* 默认参数名称
*
* @memberof CancelLogicBase
*/
private defaultParamName:string = "Default";
/**
* 参数集合
*
* @memberof CancelLogicBase
*/
private paramsMap:Map<string,any> = new Map();
/**
* Creates an instance of CancelLogicBase.
*
* @param {*} [opts={}]
* @memberof CancelLogicBase
*/
constructor(opts: any = {}) {
this.initParams(opts);
}
/**
* 初始化参数集合
*
* @param {*} [opts={}]
* @memberof CancelLogicBase
*/
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 CancelLogicBase from './cancel-logic-base';
/**
* 取消发票
*
* @export
* @class CancelLogic
*/
export default class CancelLogic extends CancelLogicBase{
/**
* Creates an instance of CancelLogic
*
* @param {*} [opts={}]
* @memberof CancelLogic
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import EntityService from '../entity-service';
import CancelLogic from '@/service/invoice/cancel-logic';
import PaidLogic from '@/service/invoice/paid-logic';
......@@ -1356,6 +1358,44 @@ export default class InvoiceServiceBase extends EntityService {
return Http.getInstance().get(`/invoices/fetchbyparentkey`,tempData,isloading);
}
/**
* FetchCancel接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof InvoiceServiceBase
*/
public async FetchCancel(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/invoices/fetchcancel`,tempData,isloading);
}
if(context.contact && context.opportunity && context.quote && context.salesorder && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/invoices/fetchcancel`,tempData,isloading);
}
if(context.account && context.opportunity && context.quote && context.salesorder && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/invoices/fetchcancel`,tempData,isloading);
}
if(context.opportunity && context.quote && context.salesorder && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/invoices/fetchcancel`,tempData,isloading);
}
if(context.quote && context.salesorder && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/quotes/${context.quote}/salesorders/${context.salesorder}/invoices/fetchcancel`,tempData,isloading);
}
if(context.salesorder && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/salesorders/${context.salesorder}/invoices/fetchcancel`,tempData,isloading);
}
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/invoices/fetchcancel`,tempData,isloading);
}
/**
* FetchDefault接口方法
*
......@@ -1393,4 +1433,42 @@ export default class InvoiceServiceBase extends EntityService {
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/invoices/fetchdefault`,tempData,isloading);
}
/**
* FetchPaid接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof InvoiceServiceBase
*/
public async FetchPaid(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/invoices/fetchpaid`,tempData,isloading);
}
if(context.contact && context.opportunity && context.quote && context.salesorder && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/invoices/fetchpaid`,tempData,isloading);
}
if(context.account && context.opportunity && context.quote && context.salesorder && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/invoices/fetchpaid`,tempData,isloading);
}
if(context.opportunity && context.quote && context.salesorder && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/invoices/fetchpaid`,tempData,isloading);
}
if(context.quote && context.salesorder && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/quotes/${context.quote}/salesorders/${context.salesorder}/invoices/fetchpaid`,tempData,isloading);
}
if(context.salesorder && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/salesorders/${context.salesorder}/invoices/fetchpaid`,tempData,isloading);
}
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/invoices/fetchpaid`,tempData,isloading);
}
}
\ No newline at end of file
import InvoiceService from '@/service/invoice/invoice-service';
import { Verify } from '@/utils/verify/verify';
/**
* 发票已支付
*
* @export
* @class PaidLogicBase
*/
export default class PaidLogicBase {
/**
* 名称
*
* @memberof PaidLogicBase
*/
private name:string ="Paid";
/**
* 唯一标识
*
* @memberof PaidLogicBase
*/
private id:string = "72CD98D0-46C7-4BE7-9FE6-44BB8CE4E5FC";
/**
* 默认参数名称
*
* @memberof PaidLogicBase
*/
private defaultParamName:string = "Default";
/**
* 参数集合
*
* @memberof PaidLogicBase
*/
private paramsMap:Map<string,any> = new Map();
/**
* Creates an instance of PaidLogicBase.
*
* @param {*} [opts={}]
* @memberof PaidLogicBase
*/
constructor(opts: any = {}) {
this.initParams(opts);
}
/**
* 初始化参数集合
*
* @param {*} [opts={}]
* @memberof PaidLogicBase
*/
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 context 应用上下文
* @param params 传入参数
*/
private async executePrepareparam1(context:any,params:any,isloading:boolean){
// 准备参数节点
let tempDstParam0Context:any = this.paramsMap.get('Default').context?this.paramsMap.get('Default').context:{};
let tempDstParam0Data:any = this.paramsMap.get('Default').data?this.paramsMap.get('Default').data:{};
Object.assign(tempDstParam0Data,{statecode:"2"});
this.paramsMap.set('Default',{data:tempDstParam0Data,context:tempDstParam0Context});
if(this.compute1Cond(params)){
return this.executeDeaction1(context,params,isloading);
}
}
/**
* 开始
*
* @param params 传入参数
*/
private async executeBegin(context:any,params:any,isloading:boolean){
//开始节点
if(this.compute0Cond(params)){
return this.executePrepareparam1(context,params,isloading);
}
}
/**
* 更新发票状态
*
* @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:InvoiceService = new InvoiceService();
if (targetService['Update'] && targetService['Update'] instanceof Function) {
result = await targetService['Update'](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 PaidLogicBase from './paid-logic-base';
/**
* 发票已支付
*
* @export
* @class PaidLogic
*/
export default class PaidLogic extends PaidLogicBase{
/**
* Creates an instance of PaidLogic
*
* @param {*} [opts={}]
* @memberof PaidLogic
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
......@@ -100,6 +100,13 @@ export class MainGridBase extends GridControllerBase {
show: true,
util: 'PX'
},
{
name: 'revenue',
label: '年收入',
langtag: 'entities.account.main_grid.columns.revenue',
show: true,
util: 'PX'
},
{
name: 'parentaccountname',
label: '上级客户',
......@@ -146,6 +153,7 @@ export class MainGridBase extends GridControllerBase {
'address1_city':false,
'primarycontactname':false,
'emailaddress1':false,
'revenue':false,
'parentaccountname':false,
};
......
......@@ -97,13 +97,13 @@ export default class MainModel {
dataType: 'TEXT',
},
{
name: 'originatingleadid',
prop: 'originatingleadid',
name: 'parentaccountid',
prop: 'parentaccountid',
dataType: 'PICKUP',
},
{
name: 'parentaccountid',
prop: 'parentaccountid',
name: 'originatingleadid',
prop: 'originatingleadid',
dataType: 'PICKUP',
},
{
......@@ -116,6 +116,11 @@ export default class MainModel {
prop: 'address1_city',
dataType: 'TEXT',
},
{
name: 'revenue',
prop: 'revenue',
dataType: 'BIGDECIMAL',
},
{
name: 'account',
prop: 'accountid',
......
......@@ -83,6 +83,18 @@
</template>
</el-table-column>
</template>
<template v-if="getColumnState('revenue')">
<el-table-column show-overflow-tooltip :prop="'revenue'" :label="$t('entities.account.main_grid.columns.revenue')" :width="100" :align="'left'" :sortable="'custom'">
<template v-slot:header="{column}">
<span class="column-header ">
{{$t('entities.account.main_grid.columns.revenue')}}
</span>
</template>
<template v-slot="{row,column,$index}">
<span>{{row.revenue}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('parentaccountname')">
<el-table-column show-overflow-tooltip :prop="'parentaccountname'" :label="$t('entities.account.main_grid.columns.parentaccountname')" :width="200" :align="'left'" :sortable="'custom'">
<template v-slot:header="{column}">
......
......@@ -20,7 +20,9 @@ import com.alibaba.fastjson.JSONObject;
public interface InvoiceMapper extends BaseMapper<Invoice>{
Page<Invoice> searchByParentKey(IPage page, @Param("srf") InvoiceSearchContext context, @Param("ew") Wrapper<Invoice> wrapper) ;
Page<Invoice> searchCancel(IPage page, @Param("srf") InvoiceSearchContext context, @Param("ew") Wrapper<Invoice> wrapper) ;
Page<Invoice> searchDefault(IPage page, @Param("srf") InvoiceSearchContext context, @Param("ew") Wrapper<Invoice> wrapper) ;
Page<Invoice> searchPaid(IPage page, @Param("srf") InvoiceSearchContext context, @Param("ew") Wrapper<Invoice> wrapper) ;
@Override
Invoice selectById(Serializable id);
@Override
......
......@@ -40,7 +40,9 @@ public interface IInvoiceService extends IService<Invoice>{
boolean save(Invoice et) ;
void saveBatch(List<Invoice> list) ;
Page<Invoice> searchByParentKey(InvoiceSearchContext context) ;
Page<Invoice> searchCancel(InvoiceSearchContext context) ;
Page<Invoice> searchDefault(InvoiceSearchContext context) ;
Page<Invoice> searchPaid(InvoiceSearchContext context) ;
List<Invoice> selectByOpportunityid(String opportunityid) ;
void removeByOpportunityid(String opportunityid) ;
List<Invoice> selectByPricelevelid(String pricelevelid) ;
......
......@@ -247,6 +247,15 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> impl
return new PageImpl<Invoice>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 已取消
*/
@Override
public Page<Invoice> searchCancel(InvoiceSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Invoice> pages=baseMapper.searchCancel(context.getPages(),context,context.getSelectCond());
return new PageImpl<Invoice>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 DEFAULT
*/
......@@ -256,6 +265,15 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> impl
return new PageImpl<Invoice>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 已支付
*/
@Override
public Page<Invoice> searchPaid(InvoiceSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Invoice> pages=baseMapper.searchPaid(context.getPages(),context,context.getSelectCond());
return new PageImpl<Invoice>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
......
package cn.ibizlab.businesscentral.core.finance.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.finance.domain.Invoice;
/**
* 关系型数据实体[Cancel] 对象
*/
public interface IInvoiceCancelLogic {
void execute(Invoice invoice ) ;
}
package cn.ibizlab.businesscentral.core.finance.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.finance.domain.Invoice;
/**
* 关系型数据实体[Paid] 对象
*/
public interface IInvoicePaidLogic {
void execute(Invoice invoice ) ;
}
package cn.ibizlab.businesscentral.core.finance.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.finance.service.logic.IInvoiceCancelLogic;
import cn.ibizlab.businesscentral.core.finance.domain.Invoice;
/**
* 关系型数据实体[Cancel] 对象
*/
@Slf4j
@Service
public class InvoiceCancelLogicImpl implements IInvoiceCancelLogic{
@Autowired
private KieContainer kieContainer;
@Autowired
private cn.ibizlab.businesscentral.core.finance.service.IInvoiceService iBzSysDefaultService;
public cn.ibizlab.businesscentral.core.finance.service.IInvoiceService getIBzSysDefaultService() {
return this.iBzSysDefaultService;
}
public void execute(Invoice et){
KieSession kieSession = null;
try{
kieSession=kieContainer.newKieSession();
kieSession.insert(et);
kieSession.setGlobal("invoicecanceldefault",et);
kieSession.setGlobal("iBzSysInvoiceDefaultService",iBzSysDefaultService);
kieSession.setGlobal("curuser", cn.ibizlab.businesscentral.util.security.AuthenticationUser.getAuthenticationUser());
kieSession.startProcess("cn.ibizlab.businesscentral.core.finance.service.logic.invoicecancel");
}catch(Exception e){
throw new RuntimeException("执行[取消发票]处理逻辑发生异常"+e);
}finally {
if(kieSession!=null)
kieSession.destroy();
}
}
}
package cn.ibizlab.businesscentral.core.finance.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.finance.service.logic.IInvoicePaidLogic;
import cn.ibizlab.businesscentral.core.finance.domain.Invoice;
/**
* 关系型数据实体[Paid] 对象
*/
@Slf4j
@Service
public class InvoicePaidLogicImpl implements IInvoicePaidLogic{
@Autowired
private KieContainer kieContainer;
@Autowired
private cn.ibizlab.businesscentral.core.finance.service.IInvoiceService invoiceservice;
public cn.ibizlab.businesscentral.core.finance.service.IInvoiceService getInvoiceService() {
return this.invoiceservice;
}
@Autowired
private cn.ibizlab.businesscentral.core.finance.service.IInvoiceService iBzSysDefaultService;
public cn.ibizlab.businesscentral.core.finance.service.IInvoiceService getIBzSysDefaultService() {
return this.iBzSysDefaultService;
}
public void execute(Invoice et){
KieSession kieSession = null;
try{
kieSession=kieContainer.newKieSession();
kieSession.insert(et);
kieSession.setGlobal("invoicepaiddefault",et);
kieSession.setGlobal("invoiceservice",invoiceservice);
kieSession.setGlobal("iBzSysInvoiceDefaultService",iBzSysDefaultService);
kieSession.setGlobal("curuser", cn.ibizlab.businesscentral.util.security.AuthenticationUser.getAuthenticationUser());
kieSession.startProcess("cn.ibizlab.businesscentral.core.finance.service.logic.invoicepaid");
}catch(Exception e){
throw new RuntimeException("执行[发票已支付]处理逻辑发生异常"+e);
}finally {
if(kieSession!=null)
kieSession.destroy();
}
}
}
......@@ -119,7 +119,7 @@
"dename":"Invoice",
"delogicname":"发票",
"sysmoudle":{"id":"FINANCE","name":"Finance"},
"dedataset":[{"id":"ByParentKey" , "name":"ByParentKey"},{"id":"Default" , "name":"DEFAULT"}],
"dedataset":[{"id":"ByParentKey" , "name":"ByParentKey"},{"id":"Cancel" , "name":"已取消"},{"id":"Default" , "name":"DEFAULT"},{"id":"Paid" , "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":"Cancel" , "name":"取消发票" , "type":"USERCUSTOM" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Finish" , "name":"确认发票" , "type":"USERCUSTOM" },{"id":"Paid" , "name":"发票已支付" , "type":"USERCUSTOM" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
......
package cn.ibizlab.businesscentral.finance.logic.invoicelogic.cancel;
import java.util.Map;
import java.util.HashMap;
import com.alibaba.fastjson.JSONObject;
global cn.ibizlab.businesscentral.core.finance.domain.Invoice invoicecanceldefault;
global cn.ibizlab.businesscentral.core.finance.service.IInvoiceService iBzSysInvoiceDefaultService;
global cn.ibizlab.businesscentral.util.security.AuthenticationUser curuser;
no-loop
//逻辑处理节点[开始]
rule "begin"
ruleflow-group "invoicecancelbegin"
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.finance.service.logic.invoicecancel" isClosed="false" isExecutable="true" name="ScoreRule" processType="Private" tns:packageName="cn.ibizlab.businesscentral.core.finance.service.logic.invoicecancel">
<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="invoicecanceldefault" type="cn.ibizlab.businesscentral.core.finance.domain.Invoice" />
</extensionElements>
<startEvent id="9A2B78B2-DC42-4EE1-96D4-507FAB73DE1D" isInterrupting="true"/>
<endEvent id="9A2B78B2-DC42-4EE1-96D4-507FAB73DE1D_End" name="End"/>
<sequenceFlow id="9A2B78B2-DC42-4EE1-96D4-507FAB73DE1D_End_Line" sourceRef="9A2B78B2-DC42-4EE1-96D4-507FAB73DE1D" targetRef="9A2B78B2-DC42-4EE1-96D4-507FAB73DE1D_End"/>
</process>
</definitions>
package cn.ibizlab.businesscentral.finance.logic.invoicelogic.paid;
import java.util.Map;
import java.util.HashMap;
import com.alibaba.fastjson.JSONObject;
global cn.ibizlab.businesscentral.core.finance.domain.Invoice invoicepaiddefault;
global cn.ibizlab.businesscentral.core.finance.service.IInvoiceService invoiceservice;
global cn.ibizlab.businesscentral.core.finance.service.IInvoiceService iBzSysInvoiceDefaultService;
global cn.ibizlab.businesscentral.util.security.AuthenticationUser curuser;
no-loop
//逻辑处理节点[准备参数]
rule "prepareparam1"
ruleflow-group "invoicepaidprepareparam1"
when
then
invoicepaiddefault.set("statecode","2");
update(invoicepaiddefault);//更新fact中变量值
end
//逻辑处理节点[开始]
rule "begin"
ruleflow-group "invoicepaidbegin"
when
then
end
//逻辑处理节点[更新发票状态]
rule "deaction1"
ruleflow-group "invoicepaiddeaction1"
when
then
invoiceservice.update(invoicepaiddefault);
update(invoicepaiddefault);//更新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.finance.service.logic.invoicepaid" isClosed="false" isExecutable="true" name="ScoreRule" processType="Private" tns:packageName="cn.ibizlab.businesscentral.core.finance.service.logic.invoicepaid">
<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="invoicepaiddefault" type="cn.ibizlab.businesscentral.core.finance.domain.Invoice" />
</extensionElements>
<businessRuleTask activiti:exclusive="true" g:ruleFlowGroup="invoicepaidprepareparam1" id="C0E66037-E024-43BE-B1B2-CEDA60C832EE" implementation="http://www.jboss.org/drools/rule" name="准备参数"/>
<startEvent id="72CD98D0-46C7-4BE7-9FE6-44BB8CE4E5FC" isInterrupting="true"/>
<businessRuleTask activiti:exclusive="true" g:ruleFlowGroup="invoicepaiddeaction1" id="E6819088-CA61-43E5-80E4-6720891C5F57" implementation="http://www.jboss.org/drools/rule" name="更新发票状态"/>
<endEvent id="E6819088-CA61-43E5-80E4-6720891C5F57_End" name="End"/>
<sequenceFlow id="E6819088-CA61-43E5-80E4-6720891C5F57_End_Line" sourceRef="E6819088-CA61-43E5-80E4-6720891C5F57" targetRef="E6819088-CA61-43E5-80E4-6720891C5F57_End"/>
<sequenceFlow id="B6C47053-84A3-4EB7-8DFD-3532F5597DAA" sourceRef="72CD98D0-46C7-4BE7-9FE6-44BB8CE4E5FC" targetRef="C0E66037-E024-43BE-B1B2-CEDA60C832EE">
</sequenceFlow>
<sequenceFlow id="7DA904A6-9E90-4FC8-A46F-E91620F1B28D" sourceRef="C0E66037-E024-43BE-B1B2-CEDA60C832EE" targetRef="E6819088-CA61-43E5-80E4-6720891C5F57">
</sequenceFlow>
</process>
</definitions>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册