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

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

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