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

ibizdev提交

上级 2803b078
...@@ -191,6 +191,94 @@ mock.onGet(new RegExp(/^\/ibzorganizations\/getdraft$/)).reply((config: any) => ...@@ -191,6 +191,94 @@ mock.onGet(new RegExp(/^\/ibzorganizations\/getdraft$/)).reply((config: any) =>
return [status, {}]; return [status, {}];
}); });
// FetchSelectSOrg
mock.onGet(new RegExp(/^\/ibzorganizations\/fetchselectsorg$/)).reply((config: any) => {
console.groupCollapsed("实体:ibzorganization 方法: FetchSelectSOrg");
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 : []];
});
// FetchSelectSOrg
mock.onGet(new RegExp(/^\/ibzorganizations\/fetchselectsorg(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:ibzorganization 方法: FetchSelectSOrg");
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 : []];
});
// FetchSelectPOrg
mock.onGet(new RegExp(/^\/ibzorganizations\/fetchselectporg$/)).reply((config: any) => {
console.groupCollapsed("实体:ibzorganization 方法: FetchSelectPOrg");
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 : []];
});
// FetchSelectPOrg
mock.onGet(new RegExp(/^\/ibzorganizations\/fetchselectporg(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:ibzorganization 方法: FetchSelectPOrg");
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 // FetchDefault
mock.onGet(new RegExp(/^\/ibzorganizations\/fetchdefault$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/ibzorganizations\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:ibzorganization 方法: FetchDefault"); console.groupCollapsed("实体:ibzorganization 方法: FetchDefault");
......
...@@ -261,6 +261,34 @@ export default class IBZOrganizationServiceBase extends EntityService { ...@@ -261,6 +261,34 @@ export default class IBZOrganizationServiceBase extends EntityService {
return res; return res;
} }
/**
* FetchSelectSOrg接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof IBZOrganizationServiceBase
*/
public async FetchSelectSOrg(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/ibzorganizations/fetchselectsorg`,tempData,isloading);
}
/**
* FetchSelectPOrg接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof IBZOrganizationServiceBase
*/
public async FetchSelectPOrg(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/ibzorganizations/fetchselectporg`,tempData,isloading);
}
/** /**
* FetchDefault接口方法 * FetchDefault接口方法
* *
......
...@@ -18,6 +18,8 @@ import com.alibaba.fastjson.JSONObject; ...@@ -18,6 +18,8 @@ import com.alibaba.fastjson.JSONObject;
public interface IBZOrganizationMapper extends BaseMapper<IBZOrganization>{ public interface IBZOrganizationMapper extends BaseMapper<IBZOrganization>{
Page<IBZOrganization> searchSelectSOrg(IPage page, @Param("srf") IBZOrganizationSearchContext context, @Param("ew") Wrapper<IBZOrganization> wrapper) ;
Page<IBZOrganization> searchSelectPOrg(IPage page, @Param("srf") IBZOrganizationSearchContext context, @Param("ew") Wrapper<IBZOrganization> wrapper) ;
Page<IBZOrganization> searchDefault(IPage page, @Param("srf") IBZOrganizationSearchContext context, @Param("ew") Wrapper<IBZOrganization> wrapper) ; Page<IBZOrganization> searchDefault(IPage page, @Param("srf") IBZOrganizationSearchContext context, @Param("ew") Wrapper<IBZOrganization> wrapper) ;
@Override @Override
@Cacheable( value="ibzorganization",key = "'row:'+#p0") @Cacheable( value="ibzorganization",key = "'row:'+#p0")
......
...@@ -35,6 +35,8 @@ public interface IIBZOrganizationService extends IService<IBZOrganization>{ ...@@ -35,6 +35,8 @@ public interface IIBZOrganizationService extends IService<IBZOrganization>{
void removeBatch(Collection<String> idList) ; void removeBatch(Collection<String> idList) ;
IBZOrganization get(String key) ; IBZOrganization get(String key) ;
IBZOrganization getDraft(IBZOrganization et) ; IBZOrganization getDraft(IBZOrganization et) ;
Page<IBZOrganization> searchSelectSOrg(IBZOrganizationSearchContext context) ;
Page<IBZOrganization> searchSelectPOrg(IBZOrganizationSearchContext context) ;
Page<IBZOrganization> searchDefault(IBZOrganizationSearchContext context) ; Page<IBZOrganization> searchDefault(IBZOrganizationSearchContext context) ;
List<IBZOrganization> selectByParentorgid(String orgid) ; List<IBZOrganization> selectByParentorgid(String orgid) ;
......
...@@ -153,6 +153,24 @@ public class IBZOrganizationServiceImpl extends ServiceImpl<IBZOrganizationMappe ...@@ -153,6 +153,24 @@ public class IBZOrganizationServiceImpl extends ServiceImpl<IBZOrganizationMappe
} }
/**
* 查询集合 查询下级单位
*/
@Override
public Page<IBZOrganization> searchSelectSOrg(IBZOrganizationSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<IBZOrganization> pages=baseMapper.searchSelectSOrg(context.getPages(),context,context.getSelectCond());
return new PageImpl<IBZOrganization>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 查询上级单位
*/
@Override
public Page<IBZOrganization> searchSelectPOrg(IBZOrganizationSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<IBZOrganization> pages=baseMapper.searchSelectPOrg(context.getPages(),context,context.getSelectCond());
return new PageImpl<IBZOrganization>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/** /**
* 查询集合 DEFAULT * 查询集合 DEFAULT
*/ */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<!--输出实体[IBZORG]数据结构 --> <!--输出实体[IBZORG]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-ibzorg-344-1"> <changeSet author="a_A_5d9d78509" id="tab-ibzorg-368-1">
<createTable tableName="IBZORG"> <createTable tableName="IBZORG">
<column name="ORGID" remarks="" type="VARCHAR(100)"> <column name="ORGID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_IBZORG_ORGID"/> <constraints primaryKey="true" primaryKeyName="PK_IBZORG_ORGID"/>
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
</changeSet> </changeSet>
<!--输出实体[IBZORG]外键关系 --> <!--输出实体[IBZORG]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-ibzorg-344-4"> <changeSet author="a_A_5d9d78509" id="fk-ibzorg-368-4">
<addForeignKeyConstraint baseColumnNames="PORGID" baseTableName="IBZORG" constraintName="DER1N_IBZORG_IBZORG_PORGID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGID" referencedTableName="IBZORG" validate="true"/> <addForeignKeyConstraint baseColumnNames="PORGID" baseTableName="IBZORG" constraintName="DER1N_IBZORG_IBZORG_PORGID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGID" referencedTableName="IBZORG" validate="true"/>
</changeSet> </changeSet>
<!--输出实体[IBZEMP]外键关系 --> <!--输出实体[IBZEMP]外键关系 -->
......
...@@ -29,6 +29,24 @@ ...@@ -29,6 +29,24 @@
where porgid=#{orgid} where porgid=#{orgid}
</select> </select>
<!--数据集合[SelectSOrg]-->
<select id="searchSelectSOrg" parameterType="cn.ibizlab.core.ou.filter.IBZOrganizationSearchContext" resultMap="IBZOrganizationResultMap">
select t1.* from (
<include refid="SelectSOrg" />
)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>
<!--数据集合[SelectPOrg]-->
<select id="searchSelectPOrg" parameterType="cn.ibizlab.core.ou.filter.IBZOrganizationSearchContext" resultMap="IBZOrganizationResultMap">
select t1.* from (
<include refid="SelectPOrg" />
)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]--> <!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.core.ou.filter.IBZOrganizationSearchContext" resultMap="IBZOrganizationResultMap"> <select id="searchDefault" parameterType="cn.ibizlab.core.ou.filter.IBZOrganizationSearchContext" resultMap="IBZOrganizationResultMap">
select t1.* from ( select t1.* from (
......
...@@ -162,6 +162,50 @@ public class IBZOrganizationResource { ...@@ -162,6 +162,50 @@ public class IBZOrganizationResource {
return ResponseEntity.status(HttpStatus.OK).body(ibzorganizationMapping.toDto(ibzorganizationService.getDraft(new IBZOrganization()))); return ResponseEntity.status(HttpStatus.OK).body(ibzorganizationMapping.toDto(ibzorganizationService.getDraft(new IBZOrganization())));
} }
@PreAuthorize("hasPermission('READ',{#context,'SelectSOrg',this.getEntity()})")
@ApiOperation(value = "fetch查询下级单位", tags = {"IBZOrganization" } ,notes = "fetch查询下级单位")
@RequestMapping(method= RequestMethod.GET , value="/ibzorganizations/fetchselectsorg")
public ResponseEntity<List<IBZOrganizationDTO>> fetchSelectSOrg(IBZOrganizationSearchContext context) {
Page<IBZOrganization> domains = ibzorganizationService.searchSelectSOrg(context) ;
List<IBZOrganizationDTO> list = ibzorganizationMapping.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("hasPermission('READ',{#context,'SelectSOrg',this.getEntity()})")
@ApiOperation(value = "search查询下级单位", tags = {"IBZOrganization" } ,notes = "search查询下级单位")
@RequestMapping(method= RequestMethod.GET , value="/ibzorganizations/searchselectsorg")
public ResponseEntity<Page<IBZOrganizationDTO>> searchSelectSOrg(IBZOrganizationSearchContext context) {
Page<IBZOrganization> domains = ibzorganizationService.searchSelectSOrg(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(ibzorganizationMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission('READ',{#context,'SelectPOrg',this.getEntity()})")
@ApiOperation(value = "fetch查询上级单位", tags = {"IBZOrganization" } ,notes = "fetch查询上级单位")
@RequestMapping(method= RequestMethod.GET , value="/ibzorganizations/fetchselectporg")
public ResponseEntity<List<IBZOrganizationDTO>> fetchSelectPOrg(IBZOrganizationSearchContext context) {
Page<IBZOrganization> domains = ibzorganizationService.searchSelectPOrg(context) ;
List<IBZOrganizationDTO> list = ibzorganizationMapping.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("hasPermission('READ',{#context,'SelectPOrg',this.getEntity()})")
@ApiOperation(value = "search查询上级单位", tags = {"IBZOrganization" } ,notes = "search查询上级单位")
@RequestMapping(method= RequestMethod.GET , value="/ibzorganizations/searchselectporg")
public ResponseEntity<Page<IBZOrganizationDTO>> searchSelectPOrg(IBZOrganizationSearchContext context) {
Page<IBZOrganization> domains = ibzorganizationService.searchSelectPOrg(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(ibzorganizationMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission('READ',{#context,'Default',this.getEntity()})") @PreAuthorize("hasPermission('READ',{#context,'Default',this.getEntity()})")
@ApiOperation(value = "fetchDEFAULT", tags = {"IBZOrganization" } ,notes = "fetchDEFAULT") @ApiOperation(value = "fetchDEFAULT", tags = {"IBZOrganization" } ,notes = "fetchDEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/ibzorganizations/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/ibzorganizations/fetchdefault")
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册