工作组复制功能变更

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);
@@ -11,6 +11,7 @@ import com.jero.contract.entity.PayIncomeContractAssociated;
import com.jero.contract.service.IPayIncomeContractAssociatedService;
import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.service.ISysUserService;
import com.jero.project.common.PayProjectCommon;
import com.jero.project.entity.*;
import com.jero.project.service.IPayWorkingGroupSubItemService;
import com.jero.project.vo.PayWorkingGroupVO;
@@ -184,6 +185,18 @@ public class PayWorkingGroupServiceImpl extends ServiceImpl<PayWorkingGroupMappe
List<PayWorkingGroupSubItem> listPayWorkingGroupSubItem = payWorkingGroupSubItemService.list(query);
if(!CollectionUtils.isEmpty(listPayWorkingGroupSubItem)){
listPayWorkingGroupSubItem.forEach(p->{
// 来款为合同,不复制合同编号
if(Objects.equals(p.getChargeWay(), PayProjectCommon.CHARGE_WAY2)){
p.setContractNum(null);
}
// 来款为收费通知,不复制收费通知文件
if(Objects.equals(p.getChargeWay(), PayProjectCommon.CHARGE_WAY3)){
p.setChargeNoticeId(null);
}
p.setPack(PayProjectCommon.PACKAGING0);
p.setInAccount(PayProjectCommon.IN_ACCOUNT0);
p.setMakeInvoice(PayProjectCommon.MAKE_INVOICE0);
p.setMail(PayProjectCommon.MAIL0);
p.setId(null);
p.setCreateBy(null);
p.setCreateTime(null);