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

JunZai 发布系统代码

上级 ce705889
......@@ -516,6 +516,184 @@ mock.onGet(new RegExp(/^\/hrarchives\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((
return [status, records ? records : []];
});
// FetchNonArchives
mock.onGet(new RegExp(/^\/hremployees\/([a-zA-Z0-9\-\;]{1,35})\/hrarchives\/fetchnonarchives$/)).reply((config: any) => {
console.groupCollapsed("实体:hrarchives 方法: FetchNonArchives");
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> = ['employeeid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/hremployees\/([a-zA-Z0-9\-\;]{1,35})\/hrarchives\/fetchnonarchives$/).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];
});
// FetchNonArchives
mock.onGet(new RegExp(/^\/hrarchives\/fetchnonarchives$/)).reply((config: any) => {
console.groupCollapsed("实体:hrarchives 方法: FetchNonArchives");
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 : []];
});
// FetchNonArchives
mock.onGet(new RegExp(/^\/hrarchives\/fetchnonarchives(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:hrarchives 方法: FetchNonArchives");
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 : []];
});
// FetchNonEmployee
mock.onGet(new RegExp(/^\/hremployees\/([a-zA-Z0-9\-\;]{1,35})\/hrarchives\/fetchnonemployee$/)).reply((config: any) => {
console.groupCollapsed("实体:hrarchives 方法: FetchNonEmployee");
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> = ['employeeid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/hremployees\/([a-zA-Z0-9\-\;]{1,35})\/hrarchives\/fetchnonemployee$/).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];
});
// FetchNonEmployee
mock.onGet(new RegExp(/^\/hrarchives\/fetchnonemployee$/)).reply((config: any) => {
console.groupCollapsed("实体:hrarchives 方法: FetchNonEmployee");
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 : []];
});
// FetchNonEmployee
mock.onGet(new RegExp(/^\/hrarchives\/fetchnonemployee(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:hrarchives 方法: FetchNonEmployee");
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 : []];
});
// URI参数传递情况未实现
// URI参数传递情况未实现
......
......@@ -1057,7 +1057,7 @@ export class HRTransferApplyWFDynaExpGridViewBase extends ViewBase {
* @type {any}
* @memberof HRTransferApplyWFDynaExpGridViewBase
*/
public curSelectedNode:any;
public curSelectedNode:any = {};
/**
* 获取树导航栏数据
......
......@@ -244,4 +244,44 @@ export default class HRArchivesServiceBase extends EntityService {
let res:any = Http.getInstance().get(`/hrarchives/fetchdefault`,tempData,isloading);
return res;
}
/**
* FetchNonArchives接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HRArchivesServiceBase
*/
public async FetchNonArchives(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.hremployee && true){
let tempData:any = JSON.parse(JSON.stringify(data));
let res:any = Http.getInstance().get(`/hremployees/${context.hremployee}/hrarchives/fetchnonarchives`,tempData,isloading);
return res;
}
let tempData:any = JSON.parse(JSON.stringify(data));
let res:any = Http.getInstance().get(`/hrarchives/fetchnonarchives`,tempData,isloading);
return res;
}
/**
* FetchNonEmployee接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HRArchivesServiceBase
*/
public async FetchNonEmployee(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.hremployee && true){
let tempData:any = JSON.parse(JSON.stringify(data));
let res:any = Http.getInstance().get(`/hremployees/${context.hremployee}/hrarchives/fetchnonemployee`,tempData,isloading);
return res;
}
let tempData:any = JSON.parse(JSON.stringify(data));
let res:any = Http.getInstance().get(`/hrarchives/fetchnonemployee`,tempData,isloading);
return res;
}
}
\ No newline at end of file
......@@ -20,6 +20,8 @@ import com.alibaba.fastjson.JSONObject;
public interface HRArchivesMapper extends BaseMapper<HRArchives>{
Page<HRArchives> searchDefault(IPage page, @Param("srf") HRArchivesSearchContext context, @Param("ew") Wrapper<HRArchives> wrapper) ;
Page<HRArchives> searchNonArchives(IPage page, @Param("srf") HRArchivesSearchContext context, @Param("ew") Wrapper<HRArchives> wrapper) ;
Page<HRArchives> searchNonEmployee(IPage page, @Param("srf") HRArchivesSearchContext context, @Param("ew") Wrapper<HRArchives> wrapper) ;
@Override
HRArchives selectById(Serializable id);
@Override
......
......@@ -37,6 +37,8 @@ public interface IHRArchivesService extends IService<HRArchives>{
boolean save(HRArchives et) ;
void saveBatch(List<HRArchives> list) ;
Page<HRArchives> searchDefault(HRArchivesSearchContext context) ;
Page<HRArchives> searchNonArchives(HRArchivesSearchContext context) ;
Page<HRArchives> searchNonEmployee(HRArchivesSearchContext context) ;
List<HRArchives> selectByHremployeeid(String employeeid) ;
void removeByHremployeeid(String employeeid) ;
List<HRArchives> selectByHrorganizationid(String organizationid) ;
......
......@@ -183,6 +183,24 @@ public class HRArchivesServiceImpl extends ServiceImpl<HRArchivesMapper, HRArchi
return new PageImpl<HRArchives>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 员工不在档
*/
@Override
public Page<HRArchives> searchNonArchives(HRArchivesSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<HRArchives> pages=baseMapper.searchNonArchives(context.getPages(),context,context.getSelectCond());
return new PageImpl<HRArchives>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 非员工在档
*/
@Override
public Page<HRArchives> searchNonEmployee(HRArchivesSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<HRArchives> pages=baseMapper.searchNonEmployee(context.getPages(),context,context.getSelectCond());
return new PageImpl<HRArchives>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
......
......@@ -45,6 +45,24 @@
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据集合[NonArchives]-->
<select id="searchNonArchives" parameterType="cn.ibizlab.humanresource.core.humanresource.filter.HRArchivesSearchContext" resultMap="HRArchivesResultMap">
select t1.* from (
<include refid="NonArchives" />
)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>
<!--数据集合[NonEmployee]-->
<select id="searchNonEmployee" parameterType="cn.ibizlab.humanresource.core.humanresource.filter.HRArchivesSearchContext" resultMap="HRArchivesResultMap">
select t1.* from (
<include refid="NonEmployee" />
)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]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`ACTIVEFLAG`, t1.`ARCHIVESCODE`, t1.`ARCHIVESPLACE`, t1.`ARCHIVESPLACETYPE`, t1.`ARCHIVESROOM`, t1.`ATTACHMENT`, t1.`BIRTHDAY`, t1.`BORROWSTATE`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DEGREE`, t11.`EMPLOYEECODE`, t11.`EMPSTATE`, t1.`HRARCHIVESID`, t1.`HRARCHIVESNAME`, t1.`HREMPLOYEEID`, t11.`EMPLOYEENAME` AS `HREMPLOYEENAME`, t1.`HRORGANIZATIONID`, t31.`ORGANIZATIONNAME` AS `HRORGANIZATIONNAME`, t1.`MEMO`, t11.`ORGANIZATIONID`, t21.`ORGANIZATIONNAME`, t1.`POLITICALTIME`, t1.`STARTWORKTIME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRARCHIVES` t1 LEFT JOIN EMPLOYEE t11 ON t1.HREMPLOYEEID = t11.EMPLOYEEID LEFT JOIN ORGANIZATION t21 ON t11.ORGANIZATIONID = t21.ORGANIZATIONID LEFT JOIN ORGANIZATION t31 ON t1.HRORGANIZATIONID = t31.ORGANIZATIONID
......
......@@ -255,7 +255,7 @@
"dename":"HRArchives",
"delogicname":"档案信息",
"sysmoudle":{"id":"HUMANRESOURCE","name":"人力"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"dedataset":[{"id":"Default" , "name":"DEFAULT"},{"id":"NonArchives" , "name":"员工不在档"},{"id":"NonEmployee" , "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":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
......
......@@ -160,6 +160,48 @@ public class HRArchivesResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrarchivesMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HRArchives-searchNonArchives-all') and hasPermission(#context,'iBizHumanResources-HRArchives-Get')")
@ApiOperation(value = "获取员工不在档", tags = {"档案信息" } ,notes = "获取员工不在档")
@RequestMapping(method= RequestMethod.GET , value="/hrarchives/fetchnonarchives")
public ResponseEntity<List<HRArchivesDTO>> fetchNonArchives(HRArchivesSearchContext context) {
Page<HRArchives> domains = hrarchivesService.searchNonArchives(context) ;
List<HRArchivesDTO> list = hrarchivesMapping.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','iBizHumanResources-HRArchives-searchNonArchives-all') and hasPermission(#context,'iBizHumanResources-HRArchives-Get')")
@ApiOperation(value = "查询员工不在档", tags = {"档案信息" } ,notes = "查询员工不在档")
@RequestMapping(method= RequestMethod.POST , value="/hrarchives/searchnonarchives")
public ResponseEntity<Page<HRArchivesDTO>> searchNonArchives(@RequestBody HRArchivesSearchContext context) {
Page<HRArchives> domains = hrarchivesService.searchNonArchives(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrarchivesMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HRArchives-searchNonEmployee-all') and hasPermission(#context,'iBizHumanResources-HRArchives-Get')")
@ApiOperation(value = "获取非员工在档", tags = {"档案信息" } ,notes = "获取非员工在档")
@RequestMapping(method= RequestMethod.GET , value="/hrarchives/fetchnonemployee")
public ResponseEntity<List<HRArchivesDTO>> fetchNonEmployee(HRArchivesSearchContext context) {
Page<HRArchives> domains = hrarchivesService.searchNonEmployee(context) ;
List<HRArchivesDTO> list = hrarchivesMapping.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','iBizHumanResources-HRArchives-searchNonEmployee-all') and hasPermission(#context,'iBizHumanResources-HRArchives-Get')")
@ApiOperation(value = "查询非员工在档", tags = {"档案信息" } ,notes = "查询非员工在档")
@RequestMapping(method= RequestMethod.POST , value="/hrarchives/searchnonemployee")
public ResponseEntity<Page<HRArchivesDTO>> searchNonEmployee(@RequestBody HRArchivesSearchContext context) {
Page<HRArchives> domains = hrarchivesService.searchNonEmployee(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrarchivesMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.hrarchivesMapping.toDomain(#hrarchivesdto),'iBizHumanResources-HRArchives-Create')")
@ApiOperation(value = "根据员工建立档案信息", tags = {"档案信息" }, notes = "根据员工建立档案信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrarchives")
......@@ -293,5 +335,51 @@ public class HRArchivesResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrarchivesMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HRArchives-searchNonArchives-all') and hasPermission(#context,'iBizHumanResources-HRArchives-Get')")
@ApiOperation(value = "根据员工获取员工不在档", tags = {"档案信息" } ,notes = "根据员工获取员工不在档")
@RequestMapping(method= RequestMethod.GET , value="/hremployees/{hremployee_id}/hrarchives/fetchnonarchives")
public ResponseEntity<List<HRArchivesDTO>> fetchHRArchivesNonArchivesByHREmployee(@PathVariable("hremployee_id") String hremployee_id,HRArchivesSearchContext context) {
context.setN_hremployeeid_eq(hremployee_id);
Page<HRArchives> domains = hrarchivesService.searchNonArchives(context) ;
List<HRArchivesDTO> list = hrarchivesMapping.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','iBizHumanResources-HRArchives-searchNonArchives-all') and hasPermission(#context,'iBizHumanResources-HRArchives-Get')")
@ApiOperation(value = "根据员工查询员工不在档", tags = {"档案信息" } ,notes = "根据员工查询员工不在档")
@RequestMapping(method= RequestMethod.POST , value="/hremployees/{hremployee_id}/hrarchives/searchnonarchives")
public ResponseEntity<Page<HRArchivesDTO>> searchHRArchivesNonArchivesByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRArchivesSearchContext context) {
context.setN_hremployeeid_eq(hremployee_id);
Page<HRArchives> domains = hrarchivesService.searchNonArchives(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrarchivesMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HRArchives-searchNonEmployee-all') and hasPermission(#context,'iBizHumanResources-HRArchives-Get')")
@ApiOperation(value = "根据员工获取非员工在档", tags = {"档案信息" } ,notes = "根据员工获取非员工在档")
@RequestMapping(method= RequestMethod.GET , value="/hremployees/{hremployee_id}/hrarchives/fetchnonemployee")
public ResponseEntity<List<HRArchivesDTO>> fetchHRArchivesNonEmployeeByHREmployee(@PathVariable("hremployee_id") String hremployee_id,HRArchivesSearchContext context) {
context.setN_hremployeeid_eq(hremployee_id);
Page<HRArchives> domains = hrarchivesService.searchNonEmployee(context) ;
List<HRArchivesDTO> list = hrarchivesMapping.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','iBizHumanResources-HRArchives-searchNonEmployee-all') and hasPermission(#context,'iBizHumanResources-HRArchives-Get')")
@ApiOperation(value = "根据员工查询非员工在档", tags = {"档案信息" } ,notes = "根据员工查询非员工在档")
@RequestMapping(method= RequestMethod.POST , value="/hremployees/{hremployee_id}/hrarchives/searchnonemployee")
public ResponseEntity<Page<HRArchivesDTO>> searchHRArchivesNonEmployeeByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRArchivesSearchContext context) {
context.setN_hremployeeid_eq(hremployee_id);
Page<HRArchives> domains = hrarchivesService.searchNonEmployee(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrarchivesMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册