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

xignzi006 发布系统代码

上级 1650d316
......@@ -315,6 +315,50 @@ mock.onGet(new RegExp(/^\/multipickdata\/fetchac(\?[\w-./?%&=,]*)*$/)).reply((co
return [status, records ? records : []];
});
// FetchACL
mock.onGet(new RegExp(/^\/multipickdata\/fetchacl$/)).reply((config: any) => {
console.groupCollapsed("实体:multipickdata 方法: FetchACL");
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 : []];
});
// FetchACL
mock.onGet(new RegExp(/^\/multipickdata\/fetchacl(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:multipickdata 方法: FetchACL");
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 : []];
});
// FetchDefault
mock.onGet(new RegExp(/^\/multipickdata\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:multipickdata 方法: FetchDefault");
......
......@@ -175,6 +175,20 @@ export default class MultiPickDataServiceBase extends EntityService {
return Http.getInstance().get(`/multipickdata/fetchac`,tempData,isloading);
}
/**
* FetchACL接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MultiPickDataServiceBase
*/
public async FetchACL(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/multipickdata/fetchacl`,tempData,isloading);
}
/**
* FetchDefault接口方法
*
......
......@@ -20,6 +20,7 @@ import com.alibaba.fastjson.JSONObject;
public interface MultiPickDataMapper extends BaseMapper<MultiPickData>{
Page<MultiPickData> searchAC(IPage page, @Param("srf") MultiPickDataSearchContext context, @Param("ew") Wrapper<MultiPickData> wrapper) ;
Page<MultiPickData> searchACL(IPage page, @Param("srf") MultiPickDataSearchContext context, @Param("ew") Wrapper<MultiPickData> wrapper) ;
Page<MultiPickData> searchDefault(IPage page, @Param("srf") MultiPickDataSearchContext context, @Param("ew") Wrapper<MultiPickData> wrapper) ;
@Override
MultiPickData selectById(Serializable id);
......
......@@ -37,6 +37,7 @@ public interface IMultiPickDataService extends IService<MultiPickData>{
boolean save(MultiPickData et) ;
void saveBatch(List<MultiPickData> list) ;
Page<MultiPickData> searchAC(MultiPickDataSearchContext context) ;
Page<MultiPickData> searchACL(MultiPickDataSearchContext context) ;
Page<MultiPickData> searchDefault(MultiPickDataSearchContext context) ;
/**
*自定义查询SQL
......
......@@ -151,6 +151,15 @@ public class MultiPickDataServiceImpl extends ServiceImpl<MultiPickDataMapper, M
return new PageImpl<MultiPickData>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 客户、联系人、潜在客户
*/
@Override
public Page<MultiPickData> searchACL(MultiPickDataSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<MultiPickData> pages=baseMapper.searchACL(context.getPages(),context,context.getSelectCond());
return new PageImpl<MultiPickData>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 DEFAULT
*/
......
......@@ -27,6 +27,19 @@
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据集合[ACL]-->
<select id="searchACL" parameterType="cn.ibizlab.businesscentral.core.base.filter.MultiPickDataSearchContext" resultMap="MultiPickDataResultMap">
select t1.* from (
<include refid="Account" />
union all
<include refid="Contact" />
union all
<include refid="Lead" />
)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>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.businesscentral.core.base.filter.MultiPickDataSearchContext" resultMap="MultiPickDataResultMap">
select t1.* from (
......@@ -38,7 +51,7 @@
<!--数据查询[Account]-->
<sql id="Account" databaseId="mysql">
<![CDATA[ select accountid as pickdataid, accountname as pickdataneme, 'ACCOUNT' as pickdatatype from account
<![CDATA[ select accountid as pickdataid, accountname as pickdataname, 'ACCOUNT' as pickdatatype from account
]]>
</sql>
<!--数据查询[Contact]-->
......@@ -51,14 +64,9 @@
<![CDATA[ SELECT t1.`PICKDATAID`, t1.`PICKDATAINFO`, t1.`PICKDATANAME`, t1.`PICKDATATYPE`, t1.`USERDATA`, t1.`USERDATA2`, t1.`USERDATA3`, t1.`USERDATA4`, t1.`USERDATE`, t1.`USERDATE2` FROM `MULTIPICKDATA` t1
]]>
</sql>
<!--数据查询[Query001]-->
<sql id="Query001" databaseId="mysql">
<![CDATA[ select accountid as pickdataid, accountname as pickdataneme from account union all select contactid as pickdataid ,fullname as pickdataname from contract
]]>
</sql>
<!--数据查询[Query002]-->
<sql id="Query002" databaseId="mysql">
<![CDATA[ select accountid as pickdataid, accountname as pickdataneme from account union all select contactid as pickdataid, fullname as pickdataname from contract union all select leadid as pickdataid, fullname as pickdataneme from lead
<!--数据查询[Lead]-->
<sql id="Lead" databaseId="mysql">
<![CDATA[ select leadid ad pickdataid, fullname as pickdataname, 'LEAD' as pickdatatype from lead
]]>
</sql>
<!--数据查询[View]-->
......
......@@ -375,7 +375,7 @@
"dename":"MultiPickData",
"delogicname":"多类选择实体",
"sysmoudle":{"id":"BASE","name":"Base"},
"dedataset":[{"id":"AC" , "name":"客户、联系人"},{"id":"Default" , "name":"DEFAULT"}],
"dedataset":[{"id":"AC" , "name":"客户、联系人"},{"id":"ACL" , "name":"客户、联系人、潜在客户"},{"id":"Default" , "name":"DEFAULT"}],
"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" }],
"datascope":[{"id":"all","name":"全部数据"}]
}
......
......@@ -159,6 +159,27 @@ public class MultiPickDataResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(multipickdataMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-MultiPickData-searchACL-all')")
@ApiOperation(value = "获取客户、联系人、潜在客户", tags = {"多类选择实体" } ,notes = "获取客户、联系人、潜在客户")
@RequestMapping(method= RequestMethod.GET , value="/multipickdata/fetchacl")
public ResponseEntity<List<MultiPickDataDTO>> fetchACL(MultiPickDataSearchContext context) {
Page<MultiPickData> domains = multipickdataService.searchACL(context) ;
List<MultiPickDataDTO> list = multipickdataMapping.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-MultiPickData-searchACL-all')")
@ApiOperation(value = "查询客户、联系人、潜在客户", tags = {"多类选择实体" } ,notes = "查询客户、联系人、潜在客户")
@RequestMapping(method= RequestMethod.POST , value="/multipickdata/searchacl")
public ResponseEntity<Page<MultiPickDataDTO>> searchACL(@RequestBody MultiPickDataSearchContext context) {
Page<MultiPickData> domains = multipickdataService.searchACL(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(multipickdataMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-MultiPickData-searchDefault-all')")
@ApiOperation(value = "获取DEFAULT", tags = {"多类选择实体" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/multipickdata/fetchdefault")
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册