Merge remote-tracking branch 'origin/feature/REQ-1309' into feature/REQ-1309
# Conflicts: # tyr-server/src/main/java/cn/axzo/tyr/server/service/impl/SaasFeatureApplyDetailServiceImpl.java
This commit is contained in:
commit
d44256638a
@ -164,13 +164,10 @@ public class PermissionPointVO {
|
||||
private String delegatedTypeDesc;
|
||||
|
||||
public void applyFitOuTypeBit(long fitOuTypeBit) {
|
||||
//这个最值需要处理
|
||||
if (fitOuTypeBit > 63L) {
|
||||
fitOuTypeBit = 63L;
|
||||
}
|
||||
long mask = 1L;
|
||||
ArrayList<Long> list = new ArrayList<>();
|
||||
while (mask <= 32) {
|
||||
//这个最值依赖枚举可支持的最大值 - 避免数据为65535解析出多的数据
|
||||
while (mask <= 64) {
|
||||
long bitValue = fitOuTypeBit & mask;
|
||||
if (bitValue != 0) {
|
||||
list.add(bitValue);
|
||||
@ -182,9 +179,6 @@ public class PermissionPointVO {
|
||||
|
||||
public void applyFitOuNodeTypeBit(long fitOuNodeTypeBit) {
|
||||
//这个最值需要处理
|
||||
if (fitOuNodeTypeBit > 7L) {
|
||||
fitOuNodeTypeBit = 7L;
|
||||
}
|
||||
long mask = 1L;
|
||||
ArrayList<Long> list = new ArrayList<>();
|
||||
while (mask <= 32) {
|
||||
|
||||
@ -84,7 +84,10 @@ public class SaasFeatureApplyDetailServiceImpl implements SaasFeatureApplyDetail
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateApplyDetail(PermissionPointApplyDetailUpdateReq req) {
|
||||
SaasFeatureApplyDetail detail = BeanMapper.copyBean(req, SaasFeatureApplyDetail.class);
|
||||
SaasFeatureApplyDetail detail = BeanMapper.copyBean(req, SaasFeatureApplyDetail.class, (p, s) -> {
|
||||
s.setFitOuTypeBit(JSON.toJSONString(p.getFitOuTypeList()));
|
||||
s.setFitOuNodeTypeBit(JSON.toJSONString(p.getFitOuNodeTypeList()));
|
||||
});
|
||||
this.saveOrUpdate(Lists.newArrayList(detail));
|
||||
}
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ public class SimpleTest {
|
||||
public void testSplitBit() {
|
||||
|
||||
PermissionPointVO vo = new PermissionPointVO();
|
||||
vo.applyFitOuTypeBit(34L);
|
||||
vo.applyFitOuTypeBit(65535L);
|
||||
System.out.println(vo.getFitOuTypeList());
|
||||
vo.applyFitOuTypeBit(65535L);
|
||||
System.out.println(vo.getFitOuTypeList());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user