修改bug#41796

This commit is contained in:
梁琦涛
2021-11-01 14:05:06 +08:00
parent 37fbd7a188
commit 3be9f7b2cd
7 changed files with 47 additions and 44 deletions
@@ -253,7 +253,7 @@ public class PayIncomeContractServiceImpl extends ServiceImpl<PayIncomeContractM
}
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(!sysUser.getRoleCode().contains(RoleCommon.CWRY) && !Objects.equals(sysUser.getId(),payIncomeContractStatus.getPrincipalId())){
throw new JeroBootException("收入合同不可操作!");
throw new JeroBootException("数据权限不足!");
}
// 项目已打包
if(Objects.equals(payIncomeContractStatus.getPack(),PayIncomeContractCommon.PACK1)){
@@ -320,7 +320,7 @@ public class PayIncomeContractServiceImpl extends ServiceImpl<PayIncomeContractM
}
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(!sysUser.getRoleCode().contains(RoleCommon.CWRY) && !Objects.equals(sysUser.getId(),payIncomeContract.getPrincipalId())){
throw new JeroBootException("收入合同不可操作!");
throw new JeroBootException("数据权限不足!");
}
if(Objects.isNull(payIncomeContract.getAmountReceived())){
payIncomeContract.setAmountReceived(new BigDecimal("0.00"));
@@ -594,7 +594,7 @@ public class PayIncomeContractServiceImpl extends ServiceImpl<PayIncomeContractM
}
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(!sysUser.getRoleCode().contains(RoleCommon.CWRY) && !Objects.equals(sysUser.getId(),payIncomeContract.getPrincipalId())){
throw new JeroBootException("收入合同不可操作!");
throw new JeroBootException("数据权限不足!");
}
// 查看项目类型
switch (String.valueOf(payIncomeContractAssociated.getProjectType())){
@@ -746,7 +746,7 @@ public class PayIncomeContractServiceImpl extends ServiceImpl<PayIncomeContractM
}
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(!sysUser.getRoleCode().contains(RoleCommon.CWRY) && !Objects.equals(sysUser.getId(),payIncomeContractNew.getPrincipalId())){
throw new JeroBootException("收入合同不可操作!");
throw new JeroBootException("数据权限不足!");
}
// 验证合同状态是否为草稿或者未通过
if(!Objects.equals(payIncomeContract.getStatus(),PayIncomeContractCommon.STATUS2)
@@ -1004,7 +1004,7 @@ public class PayIncomeContractServiceImpl extends ServiceImpl<PayIncomeContractM
}
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(!sysUser.getRoleCode().contains(RoleCommon.CWRY) && !Objects.equals(sysUser.getId(),payIncomeContractStatus.getPrincipalId())){
throw new JeroBootException(payIncomeContractStatus.getContractName() + "收入合同不可操作!");
throw new JeroBootException(payIncomeContractStatus.getContractName() + "数据权限不足!");
}
if(!Objects.equals(payIncomeContractStatus.getStatus(),PayIncomeContractCommon.STATUS1)
&& !Objects.equals(payIncomeContractStatus.getStatus(),PayIncomeContractCommon.STATUS4)){
@@ -1036,7 +1036,7 @@ public class PayIncomeContractServiceImpl extends ServiceImpl<PayIncomeContractM
StringBuilder msg1 = new StringBuilder();
listPayIncomeContractStatus.forEach(p->{
if(!sysUser.getRoleCode().contains(RoleCommon.CWRY) && !Objects.equals(sysUser.getId(),p.getPrincipalId())){
msg.append(p.getContractName() + "收入合同不可操作!");
msg.append(p.getContractName() + "数据权限不足!");
}
if(!Objects.equals(p.getStatus(),PayIncomeContractCommon.STATUS1)
&& !Objects.equals(p.getStatus(),PayIncomeContractCommon.STATUS4)){
@@ -210,7 +210,7 @@ public class PaySpendingContractServiceImpl extends ServiceImpl<PaySpendingContr
}
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(!sysUser.getRoleCode().contains(RoleCommon.CWRY) && !Objects.equals(sysUser.getId(),paySpendingContractStatus.getPrincipalId())){
throw new JeroBootException("支出合同不可操作!");
throw new JeroBootException("数据权限不足!");
}
List<PaySpendingContractInstallment> listPaySpendingContractInstallment = new ArrayList<>();
if(!CollectionUtils.isEmpty(input.getInstallment())){
@@ -276,7 +276,7 @@ public class PaySpendingContractServiceImpl extends ServiceImpl<PaySpendingContr
}
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(!sysUser.getRoleCode().contains(RoleCommon.CWRY) && !Objects.equals(sysUser.getId(),paySpendingContractStatus.getPrincipalId())){
throw new JeroBootException("支出合同不可操作!");
throw new JeroBootException("数据权限不足!");
}
paySpendingContractService.removeById(id);
LambdaUpdateWrapper<PaySpendingContractInstallment> updatePaySpendingContractInstallment = new LambdaUpdateWrapper<>();
@@ -298,7 +298,7 @@ public class PaySpendingContractServiceImpl extends ServiceImpl<PaySpendingContr
if(!sysUser.getRoleCode().contains(RoleCommon.CWRY)){
listPaySpendingContractStatus.forEach(p->{
if(!Objects.equals(sysUser.getId(),p.getPrincipalId())){
msg.append(p.getContractName() + "支出合同不可操作!");
msg.append(p.getContractName() + "数据权限不足!");
}
});
}