permission

This commit is contained in:
xzb 2022-10-19 17:47:42 +08:00
parent 4b43640085
commit d29a869c26

View File

@ -115,9 +115,6 @@ public class PermissionDistributeService {
PermissionSubject updateSubject = new PermissionSubject(); PermissionSubject updateSubject = new PermissionSubject();
updateSubject.setId(permissionSubject.getId()); updateSubject.setId(permissionSubject.getId());
updateSubject.setRemains(permissionSubject.getRemains()-pd.getAmount()); updateSubject.setRemains(permissionSubject.getRemains()-pd.getAmount());
if(updateSubject.getRemains()<=0){
updateSubject.setStatus(PermissionSubjectStatusEnum.InValid.name());
}
this.permissionSubjectDAO.updateByPrimaryKeySelective(updateSubject); this.permissionSubjectDAO.updateByPrimaryKeySelective(updateSubject);
} }
// //
@ -239,9 +236,6 @@ public class PermissionDistributeService {
PermissionDistribute updateDistribute = new PermissionDistribute(); PermissionDistribute updateDistribute = new PermissionDistribute();
updateDistribute.setId(permissionDistribute.getId()); updateDistribute.setId(permissionDistribute.getId());
updateDistribute.setRemains(permissionDistribute.getRemains() - permissionSubject.getAmount()); updateDistribute.setRemains(permissionDistribute.getRemains() - permissionSubject.getAmount());
if (updateDistribute.getRemains() <= 0) {
updateDistribute.setStatus(PermissionDistributeStatusEnum.InValid.getValue());
}
this.permissionDistributeDAO.updateByPrimaryKeySelective(updateDistribute); this.permissionDistributeDAO.updateByPrimaryKeySelective(updateDistribute);
// //
return permissionSubjectId; return permissionSubjectId;