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

xignzi006 发布系统代码

上级 9ed6d07b
......@@ -1871,6 +1871,185 @@ mock.onGet(new RegExp(/^\/leads\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((confi
});
// FetchExcluded
mock.onGet(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/leads\/fetchexcluded$/)).reply((config: any) => {
console.groupCollapsed("实体:lead 方法: FetchExcluded");
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> = ['accountid','contactid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/leads\/fetchexcluded$/).exec(config.url);
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 : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchExcluded
mock.onGet(new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/leads\/fetchexcluded$/)).reply((config: any) => {
console.groupCollapsed("实体:lead 方法: FetchExcluded");
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> = ['contactid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/leads\/fetchexcluded$/).exec(config.url);
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 : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchExcluded
mock.onGet(new RegExp(/^\/campaigns\/([a-zA-Z0-9\-\;]{1,35})\/leads\/fetchexcluded$/)).reply((config: any) => {
console.groupCollapsed("实体:lead 方法: FetchExcluded");
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> = ['campaignid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/campaigns\/([a-zA-Z0-9\-\;]{1,35})\/leads\/fetchexcluded$/).exec(config.url);
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 : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchExcluded
mock.onGet(new RegExp(/^\/leads\/fetchexcluded$/)).reply((config: any) => {
console.groupCollapsed("实体:lead 方法: FetchExcluded");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas);
console.groupEnd();
console.groupEnd();
return [status, mockDatas ? mockDatas : []];
});
// FetchExcluded
mock.onGet(new RegExp(/^\/leads\/fetchexcluded(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:lead 方法: FetchExcluded");
console.table({url:config.url, method: config.method, data:config.data});
if(config.url.includes('page')){
let url = config.url.split('?')[1];
let params = qs.parse(url);
Object.assign(config, params);
}
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
let total = mockDatas.length;
let records: Array<any> = [];
if(!config.page || !config.size){
records = mockDatas;
}else{
if((config.page-1)*config.size < total){
records = mockDatas.slice(config.page,config.size);
}
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(records ? records : []);
console.groupEnd();
console.groupEnd();
return [status, records ? records : []];
});
// FetchOn
mock.onGet(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/leads\/fetchon$/)).reply((config: any) => {
console.groupCollapsed("实体:lead 方法: FetchOn");
......
......@@ -953,6 +953,32 @@ export default class LeadServiceBase extends EntityService {
return Http.getInstance().get(`/leads/fetchdefault`,tempData,isloading);
}
/**
* FetchExcluded接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof LeadServiceBase
*/
public async FetchExcluded(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/leads/fetchexcluded`,tempData,isloading);
}
if(context.contact && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/contacts/${context.contact}/leads/fetchexcluded`,tempData,isloading);
}
if(context.campaign && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/campaigns/${context.campaign}/leads/fetchexcluded`,tempData,isloading);
}
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/leads/fetchexcluded`,tempData,isloading);
}
/**
* FetchOn接口方法
*
......
......@@ -20,6 +20,7 @@ import com.alibaba.fastjson.JSONObject;
public interface LeadMapper extends BaseMapper<Lead>{
Page<Lead> searchDefault(IPage page, @Param("srf") LeadSearchContext context, @Param("ew") Wrapper<Lead> wrapper) ;
Page<Lead> searchExcluded(IPage page, @Param("srf") LeadSearchContext context, @Param("ew") Wrapper<Lead> wrapper) ;
Page<Lead> searchOn(IPage page, @Param("srf") LeadSearchContext context, @Param("ew") Wrapper<Lead> wrapper) ;
@Override
Lead selectById(Serializable id);
......
......@@ -45,6 +45,7 @@ public interface ILeadService extends IService<Lead>{
void saveBatch(List<Lead> list) ;
Lead unable(Lead et) ;
Page<Lead> searchDefault(LeadSearchContext context) ;
Page<Lead> searchExcluded(LeadSearchContext context) ;
Page<Lead> searchOn(LeadSearchContext context) ;
List<Lead> selectByParentaccountid(String accountid) ;
void removeByParentaccountid(String accountid) ;
......
......@@ -343,6 +343,15 @@ public class LeadServiceImpl extends ServiceImpl<LeadMapper, Lead> implements IL
return new PageImpl<Lead>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 已排除潜在顾客
*/
@Override
public Page<Lead> searchExcluded(LeadSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Lead> pages=baseMapper.searchExcluded(context.getPages(),context,context.getSelectCond());
return new PageImpl<Lead>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 已开启潜在顾客
*/
......
......@@ -157,6 +157,15 @@
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据集合[Excluded]-->
<select id="searchExcluded" parameterType="cn.ibizlab.businesscentral.core.sales.filter.LeadSearchContext" resultMap="LeadResultMap">
select t1.* from (
<include refid="Excluded" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据集合[On]-->
<select id="searchOn" parameterType="cn.ibizlab.businesscentral.core.sales.filter.LeadSearchContext" resultMap="LeadResultMap">
select t1.* from (
......
......@@ -127,7 +127,7 @@
"dename":"Lead",
"delogicname":"潜在顾客",
"sysmoudle":{"id":"SALES","name":"Sales"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"},{"id":"On" , "name":"已开启潜在顾客"}],
"dedataset":[{"id":"Default" , "name":"DEFAULT"},{"id":"Excluded" , "name":"已排除潜在顾客"},{"id":"On" , "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":"USERCUSTOM" },{"id":"AddList" , "name":"添加到市场营销列表" , "type":"USERCUSTOM" },{"id":"Cancel" , "name":"取消" , "type":"DELOGIC" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"DisQualification" , "name":"取消资格" , "type":"USERCUSTOM" },{"id":"LostOrder" , "name":"丢单" , "type":"DELOGIC" },{"id":"NoInterested" , "name":"不再感兴趣" , "type":"DELOGIC" },{"id":"Qualification" , "name":"授予资格" , "type":"USERCUSTOM" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"Unable" , "name":"无法联系" , "type":"DELOGIC" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
......
......@@ -256,6 +256,27 @@ public class LeadResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(leadMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Lead-searchExcluded-all') and hasPermission(#context,'iBizBusinessCentral-Lead-Get')")
@ApiOperation(value = "获取已排除潜在顾客", tags = {"潜在顾客" } ,notes = "获取已排除潜在顾客")
@RequestMapping(method= RequestMethod.GET , value="/leads/fetchexcluded")
public ResponseEntity<List<LeadDTO>> fetchExcluded(LeadSearchContext context) {
Page<Lead> domains = leadService.searchExcluded(context) ;
List<LeadDTO> list = leadMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Lead-searchExcluded-all') and hasPermission(#context,'iBizBusinessCentral-Lead-Get')")
@ApiOperation(value = "查询已排除潜在顾客", tags = {"潜在顾客" } ,notes = "查询已排除潜在顾客")
@RequestMapping(method= RequestMethod.POST , value="/leads/searchexcluded")
public ResponseEntity<Page<LeadDTO>> searchExcluded(@RequestBody LeadSearchContext context) {
Page<Lead> domains = leadService.searchExcluded(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(leadMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Lead-searchOn-all') and hasPermission(#context,'iBizBusinessCentral-Lead-Get')")
@ApiOperation(value = "获取已开启潜在顾客", tags = {"潜在顾客" } ,notes = "获取已开启潜在顾客")
@RequestMapping(method= RequestMethod.GET , value="/leads/fetchon")
......@@ -506,6 +527,29 @@ public class LeadResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(leadMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Lead-searchExcluded-all') and hasPermission(#context,'iBizBusinessCentral-Lead-Get')")
@ApiOperation(value = "根据市场活动获取已排除潜在顾客", tags = {"潜在顾客" } ,notes = "根据市场活动获取已排除潜在顾客")
@RequestMapping(method= RequestMethod.GET , value="/campaigns/{campaign_id}/leads/fetchexcluded")
public ResponseEntity<List<LeadDTO>> fetchLeadExcludedByCampaign(@PathVariable("campaign_id") String campaign_id,LeadSearchContext context) {
context.setN_campaignid_eq(campaign_id);
Page<Lead> domains = leadService.searchExcluded(context) ;
List<LeadDTO> list = leadMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Lead-searchExcluded-all') and hasPermission(#context,'iBizBusinessCentral-Lead-Get')")
@ApiOperation(value = "根据市场活动查询已排除潜在顾客", tags = {"潜在顾客" } ,notes = "根据市场活动查询已排除潜在顾客")
@RequestMapping(method= RequestMethod.POST , value="/campaigns/{campaign_id}/leads/searchexcluded")
public ResponseEntity<Page<LeadDTO>> searchLeadExcludedByCampaign(@PathVariable("campaign_id") String campaign_id, @RequestBody LeadSearchContext context) {
context.setN_campaignid_eq(campaign_id);
Page<Lead> domains = leadService.searchExcluded(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(leadMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Lead-searchOn-all') and hasPermission(#context,'iBizBusinessCentral-Lead-Get')")
@ApiOperation(value = "根据市场活动获取已开启潜在顾客", tags = {"潜在顾客" } ,notes = "根据市场活动获取已开启潜在顾客")
@RequestMapping(method= RequestMethod.GET , value="/campaigns/{campaign_id}/leads/fetchon")
......@@ -758,6 +802,29 @@ public class LeadResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(leadMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Lead-searchExcluded-all') and hasPermission(#context,'iBizBusinessCentral-Lead-Get')")
@ApiOperation(value = "根据联系人获取已排除潜在顾客", tags = {"潜在顾客" } ,notes = "根据联系人获取已排除潜在顾客")
@RequestMapping(method= RequestMethod.GET , value="/contacts/{contact_id}/leads/fetchexcluded")
public ResponseEntity<List<LeadDTO>> fetchLeadExcludedByContact(@PathVariable("contact_id") String contact_id,LeadSearchContext context) {
context.setN_parentcontactid_eq(contact_id);
Page<Lead> domains = leadService.searchExcluded(context) ;
List<LeadDTO> list = leadMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Lead-searchExcluded-all') and hasPermission(#context,'iBizBusinessCentral-Lead-Get')")
@ApiOperation(value = "根据联系人查询已排除潜在顾客", tags = {"潜在顾客" } ,notes = "根据联系人查询已排除潜在顾客")
@RequestMapping(method= RequestMethod.POST , value="/contacts/{contact_id}/leads/searchexcluded")
public ResponseEntity<Page<LeadDTO>> searchLeadExcludedByContact(@PathVariable("contact_id") String contact_id, @RequestBody LeadSearchContext context) {
context.setN_parentcontactid_eq(contact_id);
Page<Lead> domains = leadService.searchExcluded(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(leadMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Lead-searchOn-all') and hasPermission(#context,'iBizBusinessCentral-Lead-Get')")
@ApiOperation(value = "根据联系人获取已开启潜在顾客", tags = {"潜在顾客" } ,notes = "根据联系人获取已开启潜在顾客")
@RequestMapping(method= RequestMethod.GET , value="/contacts/{contact_id}/leads/fetchon")
......@@ -1010,6 +1077,29 @@ public class LeadResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(leadMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Lead-searchExcluded-all') and hasPermission(#context,'iBizBusinessCentral-Lead-Get')")
@ApiOperation(value = "根据客户联系人获取已排除潜在顾客", tags = {"潜在顾客" } ,notes = "根据客户联系人获取已排除潜在顾客")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/contacts/{contact_id}/leads/fetchexcluded")
public ResponseEntity<List<LeadDTO>> fetchLeadExcludedByAccountContact(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id,LeadSearchContext context) {
context.setN_parentcontactid_eq(contact_id);
Page<Lead> domains = leadService.searchExcluded(context) ;
List<LeadDTO> list = leadMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Lead-searchExcluded-all') and hasPermission(#context,'iBizBusinessCentral-Lead-Get')")
@ApiOperation(value = "根据客户联系人查询已排除潜在顾客", tags = {"潜在顾客" } ,notes = "根据客户联系人查询已排除潜在顾客")
@RequestMapping(method= RequestMethod.POST , value="/accounts/{account_id}/contacts/{contact_id}/leads/searchexcluded")
public ResponseEntity<Page<LeadDTO>> searchLeadExcludedByAccountContact(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @RequestBody LeadSearchContext context) {
context.setN_parentcontactid_eq(contact_id);
Page<Lead> domains = leadService.searchExcluded(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(leadMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Lead-searchOn-all') and hasPermission(#context,'iBizBusinessCentral-Lead-Get')")
@ApiOperation(value = "根据客户联系人获取已开启潜在顾客", tags = {"潜在顾客" } ,notes = "根据客户联系人获取已开启潜在顾客")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/contacts/{contact_id}/leads/fetchon")
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册