工作组复制功能变更

This commit is contained in:
梁琦涛
2021-10-25 10:15:00 +08:00
parent a6982f653f
commit 0299d811d0
3 changed files with 13 additions and 22 deletions
@@ -98,10 +98,6 @@ public class PaySpendingContractController extends JeroController<PaySpendingCon
if(!StringUtils.isBlank(paySpendingContract.getContractNum())){
paySpendingContract.setContractNum(oConvertUtils.replaceAllPercent(paySpendingContract.getContractNum()));
}
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(!sysUser.getRoleCode().contains(RoleCommon.CWRY)){
paySpendingContract.setPrincipalId(sysUser.getId());
}
Page<PaySpendingContract> page = new Page<>(pageNo, pageSize);
IPage<PaySpendingContract> pageList = paySpendingContractService.queryPageList(page, paySpendingContract,startTime,endTime);
return Result.OK(pageList);
@@ -159,12 +159,6 @@ public class PaySpendingContractServiceImpl extends ServiceImpl<PaySpendingContr
if(Objects.isNull(paySpendingContractStatus)){
throw new JeroBootException("支出合同不存在!");
}
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(!sysUser.getRoleCode().contains(RoleCommon.CWRY)){
if(!Objects.equals(sysUser.getId(),paySpendingContractStatus.getPrincipalId())){
throw new JeroBootException("支出合同不可操作!");
}
}
List<PaySpendingContractInstallment> listPaySpendingContractInstallment = new ArrayList<>();
if(!CollectionUtils.isEmpty(input.getInstallment())){
listPaySpendingContractInstallment = input.getInstallment();
@@ -244,21 +238,9 @@ public class PaySpendingContractServiceImpl extends ServiceImpl<PaySpendingContr
LambdaQueryWrapper<PaySpendingContract> query = new LambdaQueryWrapper<>();
query.in(PaySpendingContract::getId,ids);
List<PaySpendingContract> listPaySpendingContractStatus = paySpendingContractService.list(query);
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(CollectionUtils.isEmpty(listPaySpendingContractStatus)){
throw new JeroBootException("收入合同不存在!");
}
StringBuilder msg = new StringBuilder();
listPaySpendingContractStatus.forEach(p->{
if(!sysUser.getRoleCode().contains(RoleCommon.CWRY)){
if(!Objects.equals(sysUser.getId(),p.getPrincipalId())){
msg.append(p.getContractName() + "支出合同不可操作!<br/>");
}
}
});
if(!StringUtils.isEmpty(msg)){
throw new JeroBootException(msg.toString());
}
paySpendingContractService.removeByIds(ids);
LambdaUpdateWrapper<PaySpendingContractInstallment> updatePaySpendingContractInstallment = new LambdaUpdateWrapper<>();
updatePaySpendingContractInstallment.in(PaySpendingContractInstallment::getContractId,ids);