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

zhouweidong 发布系统代码 [ibz-ou,统一组织单位]

上级 bbd8c350
...@@ -891,7 +891,7 @@ export default class SysDeptMemberGridViewBase extends Vue { ...@@ -891,7 +891,7 @@ export default class SysDeptMemberGridViewBase extends Vue {
'resAppKey':'userid'}, 'resAppKey':'userid'},
{view:{viewname:'sys-department-mpickup-view',height: 0,width: 0,title: '部门数据多项选择视图'}, {view:{viewname:'sys-department-mpickup-view',height: 0,width: 0,title: '部门数据多项选择视图'},
res:['SysDepartment'], res:['SysDepartment'],
'resAppKey':'userid'} 'resAppKey':'deptid'}
]; ];
if(batchAddPSAppViews.length == 0 || !this.context.srfparentdename){ if(batchAddPSAppViews.length == 0 || !this.context.srfparentdename){
this.$Notice.warning({ title: '错误', desc: '批量添加需添加N:N关系' }); this.$Notice.warning({ title: '错误', desc: '批量添加需添加N:N关系' });
......
...@@ -175,7 +175,7 @@ public class SysDeptMemberResource { ...@@ -175,7 +175,7 @@ public class SysDeptMemberResource {
@RequestMapping(method = RequestMethod.POST, value = "/sysdepartments/{sysdepartment_id}/sysdeptmembers") @RequestMapping(method = RequestMethod.POST, value = "/sysdepartments/{sysdepartment_id}/sysdeptmembers")
public ResponseEntity<SysDeptMemberDTO> createBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody SysDeptMemberDTO sysdeptmemberdto) { public ResponseEntity<SysDeptMemberDTO> createBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody SysDeptMemberDTO sysdeptmemberdto) {
SysDeptMember domain = sysdeptmemberMapping.toDomain(sysdeptmemberdto); SysDeptMember domain = sysdeptmemberMapping.toDomain(sysdeptmemberdto);
domain.setUserid(sysdepartment_id); domain.setDeptid(sysdepartment_id);
sysdeptmemberService.create(domain); sysdeptmemberService.create(domain);
SysDeptMemberDTO dto = sysdeptmemberMapping.toDto(domain); SysDeptMemberDTO dto = sysdeptmemberMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
...@@ -187,7 +187,7 @@ public class SysDeptMemberResource { ...@@ -187,7 +187,7 @@ public class SysDeptMemberResource {
public ResponseEntity<Boolean> createBatchBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody List<SysDeptMemberDTO> sysdeptmemberdtos) { public ResponseEntity<Boolean> createBatchBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody List<SysDeptMemberDTO> sysdeptmemberdtos) {
List<SysDeptMember> domainlist=sysdeptmemberMapping.toDomain(sysdeptmemberdtos); List<SysDeptMember> domainlist=sysdeptmemberMapping.toDomain(sysdeptmemberdtos);
for(SysDeptMember domain:domainlist){ for(SysDeptMember domain:domainlist){
domain.setUserid(sysdepartment_id); domain.setDeptid(sysdepartment_id);
} }
sysdeptmemberService.createBatch(domainlist); sysdeptmemberService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
...@@ -198,7 +198,7 @@ public class SysDeptMemberResource { ...@@ -198,7 +198,7 @@ public class SysDeptMemberResource {
@RequestMapping(method = RequestMethod.PUT, value = "/sysdepartments/{sysdepartment_id}/sysdeptmembers/{sysdeptmember_id}") @RequestMapping(method = RequestMethod.PUT, value = "/sysdepartments/{sysdepartment_id}/sysdeptmembers/{sysdeptmember_id}")
public ResponseEntity<SysDeptMemberDTO> updateBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id, @PathVariable("sysdeptmember_id") String sysdeptmember_id, @RequestBody SysDeptMemberDTO sysdeptmemberdto) { public ResponseEntity<SysDeptMemberDTO> updateBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id, @PathVariable("sysdeptmember_id") String sysdeptmember_id, @RequestBody SysDeptMemberDTO sysdeptmemberdto) {
SysDeptMember domain = sysdeptmemberMapping.toDomain(sysdeptmemberdto); SysDeptMember domain = sysdeptmemberMapping.toDomain(sysdeptmemberdto);
domain.setUserid(sysdepartment_id); domain.setDeptid(sysdepartment_id);
domain.setMemberid(sysdeptmember_id); domain.setMemberid(sysdeptmember_id);
sysdeptmemberService.update(domain); sysdeptmemberService.update(domain);
SysDeptMemberDTO dto = sysdeptmemberMapping.toDto(domain); SysDeptMemberDTO dto = sysdeptmemberMapping.toDto(domain);
...@@ -211,7 +211,7 @@ public class SysDeptMemberResource { ...@@ -211,7 +211,7 @@ public class SysDeptMemberResource {
public ResponseEntity<Boolean> updateBatchBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody List<SysDeptMemberDTO> sysdeptmemberdtos) { public ResponseEntity<Boolean> updateBatchBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody List<SysDeptMemberDTO> sysdeptmemberdtos) {
List<SysDeptMember> domainlist=sysdeptmemberMapping.toDomain(sysdeptmemberdtos); List<SysDeptMember> domainlist=sysdeptmemberMapping.toDomain(sysdeptmemberdtos);
for(SysDeptMember domain:domainlist){ for(SysDeptMember domain:domainlist){
domain.setUserid(sysdepartment_id); domain.setDeptid(sysdepartment_id);
} }
sysdeptmemberService.updateBatch(domainlist); sysdeptmemberService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
...@@ -245,7 +245,7 @@ public class SysDeptMemberResource { ...@@ -245,7 +245,7 @@ public class SysDeptMemberResource {
@RequestMapping(method = RequestMethod.GET, value = "/sysdepartments/{sysdepartment_id}/sysdeptmembers/getdraft") @RequestMapping(method = RequestMethod.GET, value = "/sysdepartments/{sysdepartment_id}/sysdeptmembers/getdraft")
public ResponseEntity<SysDeptMemberDTO> getDraftBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id, SysDeptMemberDTO dto) { public ResponseEntity<SysDeptMemberDTO> getDraftBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id, SysDeptMemberDTO dto) {
SysDeptMember domain = sysdeptmemberMapping.toDomain(dto); SysDeptMember domain = sysdeptmemberMapping.toDomain(dto);
domain.setUserid(sysdepartment_id); domain.setDeptid(sysdepartment_id);
return ResponseEntity.status(HttpStatus.OK).body(sysdeptmemberMapping.toDto(sysdeptmemberService.getDraft(domain))); return ResponseEntity.status(HttpStatus.OK).body(sysdeptmemberMapping.toDto(sysdeptmemberService.getDraft(domain)));
} }
...@@ -260,7 +260,7 @@ public class SysDeptMemberResource { ...@@ -260,7 +260,7 @@ public class SysDeptMemberResource {
@RequestMapping(method = RequestMethod.POST, value = "/sysdepartments/{sysdepartment_id}/sysdeptmembers/save") @RequestMapping(method = RequestMethod.POST, value = "/sysdepartments/{sysdepartment_id}/sysdeptmembers/save")
public ResponseEntity<Boolean> saveBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody SysDeptMemberDTO sysdeptmemberdto) { public ResponseEntity<Boolean> saveBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody SysDeptMemberDTO sysdeptmemberdto) {
SysDeptMember domain = sysdeptmemberMapping.toDomain(sysdeptmemberdto); SysDeptMember domain = sysdeptmemberMapping.toDomain(sysdeptmemberdto);
domain.setUserid(sysdepartment_id); domain.setDeptid(sysdepartment_id);
return ResponseEntity.status(HttpStatus.OK).body(sysdeptmemberService.save(domain)); return ResponseEntity.status(HttpStatus.OK).body(sysdeptmemberService.save(domain));
} }
...@@ -270,7 +270,7 @@ public class SysDeptMemberResource { ...@@ -270,7 +270,7 @@ public class SysDeptMemberResource {
public ResponseEntity<Boolean> saveBatchBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody List<SysDeptMemberDTO> sysdeptmemberdtos) { public ResponseEntity<Boolean> saveBatchBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody List<SysDeptMemberDTO> sysdeptmemberdtos) {
List<SysDeptMember> domainlist=sysdeptmemberMapping.toDomain(sysdeptmemberdtos); List<SysDeptMember> domainlist=sysdeptmemberMapping.toDomain(sysdeptmemberdtos);
for(SysDeptMember domain:domainlist){ for(SysDeptMember domain:domainlist){
domain.setUserid(sysdepartment_id); domain.setDeptid(sysdepartment_id);
} }
sysdeptmemberService.saveBatch(domainlist); sysdeptmemberService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
...@@ -281,7 +281,7 @@ public class SysDeptMemberResource { ...@@ -281,7 +281,7 @@ public class SysDeptMemberResource {
@RequestMapping(method = RequestMethod.POST, value = "/sysdepartments/{sysdepartment_id}/sysdeptmembers/{sysdeptmember_id}/savedeptmember") @RequestMapping(method = RequestMethod.POST, value = "/sysdepartments/{sysdepartment_id}/sysdeptmembers/{sysdeptmember_id}/savedeptmember")
public ResponseEntity<SysDeptMemberDTO> saveDeptMemberBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id, @PathVariable("sysdeptmember_id") String sysdeptmember_id, @RequestBody SysDeptMemberDTO sysdeptmemberdto) { public ResponseEntity<SysDeptMemberDTO> saveDeptMemberBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id, @PathVariable("sysdeptmember_id") String sysdeptmember_id, @RequestBody SysDeptMemberDTO sysdeptmemberdto) {
SysDeptMember domain = sysdeptmemberMapping.toDomain(sysdeptmemberdto); SysDeptMember domain = sysdeptmemberMapping.toDomain(sysdeptmemberdto);
domain.setUserid(sysdepartment_id); domain.setDeptid(sysdepartment_id);
domain = sysdeptmemberService.saveDeptMember(domain) ; domain = sysdeptmemberService.saveDeptMember(domain) ;
sysdeptmemberdto = sysdeptmemberMapping.toDto(domain); sysdeptmemberdto = sysdeptmemberMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(sysdeptmemberdto); return ResponseEntity.status(HttpStatus.OK).body(sysdeptmemberdto);
...@@ -290,7 +290,7 @@ public class SysDeptMemberResource { ...@@ -290,7 +290,7 @@ public class SysDeptMemberResource {
@ApiOperation(value = "根据部门获取DEFAULT", tags = {"部门成员" } ,notes = "根据部门获取DEFAULT") @ApiOperation(value = "根据部门获取DEFAULT", tags = {"部门成员" } ,notes = "根据部门获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/sysdepartments/{sysdepartment_id}/sysdeptmembers/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/sysdepartments/{sysdepartment_id}/sysdeptmembers/fetchdefault")
public ResponseEntity<List<SysDeptMemberDTO>> fetchSysDeptMemberDefaultBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id,SysDeptMemberSearchContext context) { public ResponseEntity<List<SysDeptMemberDTO>> fetchSysDeptMemberDefaultBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id,SysDeptMemberSearchContext context) {
context.setN_userid_eq(sysdepartment_id); context.setN_deptid_eq(sysdepartment_id);
Page<SysDeptMember> domains = sysdeptmemberService.searchDefault(context) ; Page<SysDeptMember> domains = sysdeptmemberService.searchDefault(context) ;
List<SysDeptMemberDTO> list = sysdeptmemberMapping.toDto(domains.getContent()); List<SysDeptMemberDTO> list = sysdeptmemberMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK) return ResponseEntity.status(HttpStatus.OK)
...@@ -304,7 +304,7 @@ public class SysDeptMemberResource { ...@@ -304,7 +304,7 @@ public class SysDeptMemberResource {
@ApiOperation(value = "根据部门查询DEFAULT", tags = {"部门成员" } ,notes = "根据部门查询DEFAULT") @ApiOperation(value = "根据部门查询DEFAULT", tags = {"部门成员" } ,notes = "根据部门查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/sysdepartments/{sysdepartment_id}/sysdeptmembers/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/sysdepartments/{sysdepartment_id}/sysdeptmembers/searchdefault")
public ResponseEntity<Page<SysDeptMemberDTO>> searchSysDeptMemberDefaultBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody SysDeptMemberSearchContext context) { public ResponseEntity<Page<SysDeptMemberDTO>> searchSysDeptMemberDefaultBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody SysDeptMemberSearchContext context) {
context.setN_userid_eq(sysdepartment_id); context.setN_deptid_eq(sysdepartment_id);
Page<SysDeptMember> domains = sysdeptmemberService.searchDefault(context) ; Page<SysDeptMember> domains = sysdeptmemberService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK) return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(sysdeptmemberMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements())); .body(new PageImpl(sysdeptmemberMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
...@@ -592,7 +592,7 @@ public class SysDeptMemberResource { ...@@ -592,7 +592,7 @@ public class SysDeptMemberResource {
@RequestMapping(method = RequestMethod.POST, value = "/sysorganizations/{sysorganization_id}/sysdepartments/{sysdepartment_id}/sysdeptmembers") @RequestMapping(method = RequestMethod.POST, value = "/sysorganizations/{sysorganization_id}/sysdepartments/{sysdepartment_id}/sysdeptmembers")
public ResponseEntity<SysDeptMemberDTO> createBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody SysDeptMemberDTO sysdeptmemberdto) { public ResponseEntity<SysDeptMemberDTO> createBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody SysDeptMemberDTO sysdeptmemberdto) {
SysDeptMember domain = sysdeptmemberMapping.toDomain(sysdeptmemberdto); SysDeptMember domain = sysdeptmemberMapping.toDomain(sysdeptmemberdto);
domain.setUserid(sysdepartment_id); domain.setDeptid(sysdepartment_id);
sysdeptmemberService.create(domain); sysdeptmemberService.create(domain);
SysDeptMemberDTO dto = sysdeptmemberMapping.toDto(domain); SysDeptMemberDTO dto = sysdeptmemberMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
...@@ -604,7 +604,7 @@ public class SysDeptMemberResource { ...@@ -604,7 +604,7 @@ public class SysDeptMemberResource {
public ResponseEntity<Boolean> createBatchBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody List<SysDeptMemberDTO> sysdeptmemberdtos) { public ResponseEntity<Boolean> createBatchBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody List<SysDeptMemberDTO> sysdeptmemberdtos) {
List<SysDeptMember> domainlist=sysdeptmemberMapping.toDomain(sysdeptmemberdtos); List<SysDeptMember> domainlist=sysdeptmemberMapping.toDomain(sysdeptmemberdtos);
for(SysDeptMember domain:domainlist){ for(SysDeptMember domain:domainlist){
domain.setUserid(sysdepartment_id); domain.setDeptid(sysdepartment_id);
} }
sysdeptmemberService.createBatch(domainlist); sysdeptmemberService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
...@@ -615,7 +615,7 @@ public class SysDeptMemberResource { ...@@ -615,7 +615,7 @@ public class SysDeptMemberResource {
@RequestMapping(method = RequestMethod.PUT, value = "/sysorganizations/{sysorganization_id}/sysdepartments/{sysdepartment_id}/sysdeptmembers/{sysdeptmember_id}") @RequestMapping(method = RequestMethod.PUT, value = "/sysorganizations/{sysorganization_id}/sysdepartments/{sysdepartment_id}/sysdeptmembers/{sysdeptmember_id}")
public ResponseEntity<SysDeptMemberDTO> updateBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id, @PathVariable("sysdeptmember_id") String sysdeptmember_id, @RequestBody SysDeptMemberDTO sysdeptmemberdto) { public ResponseEntity<SysDeptMemberDTO> updateBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id, @PathVariable("sysdeptmember_id") String sysdeptmember_id, @RequestBody SysDeptMemberDTO sysdeptmemberdto) {
SysDeptMember domain = sysdeptmemberMapping.toDomain(sysdeptmemberdto); SysDeptMember domain = sysdeptmemberMapping.toDomain(sysdeptmemberdto);
domain.setUserid(sysdepartment_id); domain.setDeptid(sysdepartment_id);
domain.setMemberid(sysdeptmember_id); domain.setMemberid(sysdeptmember_id);
sysdeptmemberService.update(domain); sysdeptmemberService.update(domain);
SysDeptMemberDTO dto = sysdeptmemberMapping.toDto(domain); SysDeptMemberDTO dto = sysdeptmemberMapping.toDto(domain);
...@@ -628,7 +628,7 @@ public class SysDeptMemberResource { ...@@ -628,7 +628,7 @@ public class SysDeptMemberResource {
public ResponseEntity<Boolean> updateBatchBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody List<SysDeptMemberDTO> sysdeptmemberdtos) { public ResponseEntity<Boolean> updateBatchBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody List<SysDeptMemberDTO> sysdeptmemberdtos) {
List<SysDeptMember> domainlist=sysdeptmemberMapping.toDomain(sysdeptmemberdtos); List<SysDeptMember> domainlist=sysdeptmemberMapping.toDomain(sysdeptmemberdtos);
for(SysDeptMember domain:domainlist){ for(SysDeptMember domain:domainlist){
domain.setUserid(sysdepartment_id); domain.setDeptid(sysdepartment_id);
} }
sysdeptmemberService.updateBatch(domainlist); sysdeptmemberService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
...@@ -662,7 +662,7 @@ public class SysDeptMemberResource { ...@@ -662,7 +662,7 @@ public class SysDeptMemberResource {
@RequestMapping(method = RequestMethod.GET, value = "/sysorganizations/{sysorganization_id}/sysdepartments/{sysdepartment_id}/sysdeptmembers/getdraft") @RequestMapping(method = RequestMethod.GET, value = "/sysorganizations/{sysorganization_id}/sysdepartments/{sysdepartment_id}/sysdeptmembers/getdraft")
public ResponseEntity<SysDeptMemberDTO> getDraftBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id, SysDeptMemberDTO dto) { public ResponseEntity<SysDeptMemberDTO> getDraftBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id, SysDeptMemberDTO dto) {
SysDeptMember domain = sysdeptmemberMapping.toDomain(dto); SysDeptMember domain = sysdeptmemberMapping.toDomain(dto);
domain.setUserid(sysdepartment_id); domain.setDeptid(sysdepartment_id);
return ResponseEntity.status(HttpStatus.OK).body(sysdeptmemberMapping.toDto(sysdeptmemberService.getDraft(domain))); return ResponseEntity.status(HttpStatus.OK).body(sysdeptmemberMapping.toDto(sysdeptmemberService.getDraft(domain)));
} }
...@@ -677,7 +677,7 @@ public class SysDeptMemberResource { ...@@ -677,7 +677,7 @@ public class SysDeptMemberResource {
@RequestMapping(method = RequestMethod.POST, value = "/sysorganizations/{sysorganization_id}/sysdepartments/{sysdepartment_id}/sysdeptmembers/save") @RequestMapping(method = RequestMethod.POST, value = "/sysorganizations/{sysorganization_id}/sysdepartments/{sysdepartment_id}/sysdeptmembers/save")
public ResponseEntity<Boolean> saveBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody SysDeptMemberDTO sysdeptmemberdto) { public ResponseEntity<Boolean> saveBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody SysDeptMemberDTO sysdeptmemberdto) {
SysDeptMember domain = sysdeptmemberMapping.toDomain(sysdeptmemberdto); SysDeptMember domain = sysdeptmemberMapping.toDomain(sysdeptmemberdto);
domain.setUserid(sysdepartment_id); domain.setDeptid(sysdepartment_id);
return ResponseEntity.status(HttpStatus.OK).body(sysdeptmemberService.save(domain)); return ResponseEntity.status(HttpStatus.OK).body(sysdeptmemberService.save(domain));
} }
...@@ -687,7 +687,7 @@ public class SysDeptMemberResource { ...@@ -687,7 +687,7 @@ public class SysDeptMemberResource {
public ResponseEntity<Boolean> saveBatchBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody List<SysDeptMemberDTO> sysdeptmemberdtos) { public ResponseEntity<Boolean> saveBatchBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody List<SysDeptMemberDTO> sysdeptmemberdtos) {
List<SysDeptMember> domainlist=sysdeptmemberMapping.toDomain(sysdeptmemberdtos); List<SysDeptMember> domainlist=sysdeptmemberMapping.toDomain(sysdeptmemberdtos);
for(SysDeptMember domain:domainlist){ for(SysDeptMember domain:domainlist){
domain.setUserid(sysdepartment_id); domain.setDeptid(sysdepartment_id);
} }
sysdeptmemberService.saveBatch(domainlist); sysdeptmemberService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
...@@ -698,7 +698,7 @@ public class SysDeptMemberResource { ...@@ -698,7 +698,7 @@ public class SysDeptMemberResource {
@RequestMapping(method = RequestMethod.POST, value = "/sysorganizations/{sysorganization_id}/sysdepartments/{sysdepartment_id}/sysdeptmembers/{sysdeptmember_id}/savedeptmember") @RequestMapping(method = RequestMethod.POST, value = "/sysorganizations/{sysorganization_id}/sysdepartments/{sysdepartment_id}/sysdeptmembers/{sysdeptmember_id}/savedeptmember")
public ResponseEntity<SysDeptMemberDTO> saveDeptMemberBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id, @PathVariable("sysdeptmember_id") String sysdeptmember_id, @RequestBody SysDeptMemberDTO sysdeptmemberdto) { public ResponseEntity<SysDeptMemberDTO> saveDeptMemberBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id, @PathVariable("sysdeptmember_id") String sysdeptmember_id, @RequestBody SysDeptMemberDTO sysdeptmemberdto) {
SysDeptMember domain = sysdeptmemberMapping.toDomain(sysdeptmemberdto); SysDeptMember domain = sysdeptmemberMapping.toDomain(sysdeptmemberdto);
domain.setUserid(sysdepartment_id); domain.setDeptid(sysdepartment_id);
domain = sysdeptmemberService.saveDeptMember(domain) ; domain = sysdeptmemberService.saveDeptMember(domain) ;
sysdeptmemberdto = sysdeptmemberMapping.toDto(domain); sysdeptmemberdto = sysdeptmemberMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(sysdeptmemberdto); return ResponseEntity.status(HttpStatus.OK).body(sysdeptmemberdto);
...@@ -707,7 +707,7 @@ public class SysDeptMemberResource { ...@@ -707,7 +707,7 @@ public class SysDeptMemberResource {
@ApiOperation(value = "根据单位机构部门获取DEFAULT", tags = {"部门成员" } ,notes = "根据单位机构部门获取DEFAULT") @ApiOperation(value = "根据单位机构部门获取DEFAULT", tags = {"部门成员" } ,notes = "根据单位机构部门获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/sysorganizations/{sysorganization_id}/sysdepartments/{sysdepartment_id}/sysdeptmembers/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/sysorganizations/{sysorganization_id}/sysdepartments/{sysdepartment_id}/sysdeptmembers/fetchdefault")
public ResponseEntity<List<SysDeptMemberDTO>> fetchSysDeptMemberDefaultBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id,SysDeptMemberSearchContext context) { public ResponseEntity<List<SysDeptMemberDTO>> fetchSysDeptMemberDefaultBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id,SysDeptMemberSearchContext context) {
context.setN_userid_eq(sysdepartment_id); context.setN_deptid_eq(sysdepartment_id);
Page<SysDeptMember> domains = sysdeptmemberService.searchDefault(context) ; Page<SysDeptMember> domains = sysdeptmemberService.searchDefault(context) ;
List<SysDeptMemberDTO> list = sysdeptmemberMapping.toDto(domains.getContent()); List<SysDeptMemberDTO> list = sysdeptmemberMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK) return ResponseEntity.status(HttpStatus.OK)
...@@ -721,7 +721,7 @@ public class SysDeptMemberResource { ...@@ -721,7 +721,7 @@ public class SysDeptMemberResource {
@ApiOperation(value = "根据单位机构部门查询DEFAULT", tags = {"部门成员" } ,notes = "根据单位机构部门查询DEFAULT") @ApiOperation(value = "根据单位机构部门查询DEFAULT", tags = {"部门成员" } ,notes = "根据单位机构部门查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/sysorganizations/{sysorganization_id}/sysdepartments/{sysdepartment_id}/sysdeptmembers/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/sysorganizations/{sysorganization_id}/sysdepartments/{sysdepartment_id}/sysdeptmembers/searchdefault")
public ResponseEntity<Page<SysDeptMemberDTO>> searchSysDeptMemberDefaultBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody SysDeptMemberSearchContext context) { public ResponseEntity<Page<SysDeptMemberDTO>> searchSysDeptMemberDefaultBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody SysDeptMemberSearchContext context) {
context.setN_userid_eq(sysdepartment_id); context.setN_deptid_eq(sysdepartment_id);
Page<SysDeptMember> domains = sysdeptmemberService.searchDefault(context) ; Page<SysDeptMember> domains = sysdeptmemberService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK) return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(sysdeptmemberMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements())); .body(new PageImpl(sysdeptmemberMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
......
...@@ -8,6 +8,7 @@ import org.springframework.data.redis.core.RedisTemplate; ...@@ -8,6 +8,7 @@ import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.listener.adapter.MessageListenerAdapter; import org.springframework.data.redis.listener.adapter.MessageListenerAdapter;
import org.springframework.data.redis.serializer.RedisSerializer; import org.springframework.data.redis.serializer.RedisSerializer;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.util.ObjectUtils;
import java.util.Map; import java.util.Map;
import cn.ibizlab.util.cache.cache.LayeringCache; import cn.ibizlab.util.cache.cache.LayeringCache;
import cn.ibizlab.util.enums.RedisChannelTopic; import cn.ibizlab.util.enums.RedisChannelTopic;
...@@ -34,20 +35,25 @@ public class RedisMessageListener extends MessageListenerAdapter { ...@@ -34,20 +35,25 @@ public class RedisMessageListener extends MessageListenerAdapter {
if(result instanceof Map){ if(result instanceof Map){
map= (Map<String, Object>) result; map= (Map<String, Object>) result;
} }
if(StringUtils.isEmpty(map)|| (!map.containsKey("cacheName"))|| (!map.containsKey("key"))){ if(StringUtils.isEmpty(map)|| (!map.containsKey("cacheName"))){
log.debug("解析缓存数据失败,无法获取指定值!"); log.debug("解析缓存数据失败,无法获取指定值!");
return ; return ;
} }
log.debug("redis消息订阅者接收到频道【{}】发布的消息。消息内容:{}", channelTopic.getChannelTopicStr(), result.toString()); log.debug("redis消息订阅者接收到频道【{}】发布的消息。消息内容:{}", channelTopic.getChannelTopicStr(), result.toString());
String cacheName = (String) map.get("cacheName"); String cacheName = (String) map.get("cacheName");
Object key = map.get("key");
Cache cache = cacheManager.getCache(cacheName);// 根据缓存名称获取多级缓存 Cache cache = cacheManager.getCache(cacheName);// 根据缓存名称获取多级缓存
if (cache != null && cache instanceof LayeringCache) { // 判断缓存是否是多级缓存 if (cache != null && cache instanceof LayeringCache) { // 判断缓存是否是多级缓存
switch (channelTopic) { switch (channelTopic) {
case REDIS_CACHE_DELETE_TOPIC: // 获取一级缓存,并删除一级缓存数据 case REDIS_CACHE_DELETE_TOPIC: // 获取一级缓存,并删除一级缓存数据
((LayeringCache) cache).getFirstCache().evict(key); Object cacheKey = map.get("key");
((LayeringCache) cache).getSecondCache().evict(key); if(!ObjectUtils.isEmpty(cacheKey)){
log.debug("同步删除缓存{}数据,key:{},", cacheName, key.toString()); ((LayeringCache) cache).getFirstCache().evict(cacheKey);
((LayeringCache) cache).getSecondCache().evict(cacheKey);
log.debug("同步删除缓存{}数据,key:{},", cacheName, cacheKey.toString());
}
else{
log.debug("同步删除缓存失败,{}缓存键值为空!",cacheName);
}
break; break;
case REDIS_CACHE_CLEAR_TOPIC:// 获取一级缓存,并删除一级缓存数据 case REDIS_CACHE_CLEAR_TOPIC:// 获取一级缓存,并删除一级缓存数据
((LayeringCache) cache).getFirstCache().clear(); ((LayeringCache) cache).getFirstCache().clear();
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册