This commit is contained in:
baozhipeng
2021-12-22 15:32:34 +08:00
parent 3a2d61b63d
commit 347322497c
@@ -436,36 +436,9 @@ public class PayPaymentCheckServiceImpl extends ServiceImpl<PayPaymentCheckMappe
//来款条件校验
payPaymentRecordService.amountReceivedVerification( payPaymentRecord, ProjectCommon.PAYMENT_FLAG2);
LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal();
payPaymentRecord.setReviewerId(sysUser.getId());
payPaymentRecord.setReviewerName(sysUser.getRealname());
payPaymentRecord.setReviewTime(new Date());
if(PayIncomeContractCommon.PROJECT_TYPE1.equals(String.valueOf(payPaymentRecord.getProjectType())) ||
PayIncomeContractCommon.PROJECT_TYPE2.equals(String.valueOf(payPaymentRecord.getProjectType())) ||
PayIncomeContractCommon.PROJECT_TYPE4.equals(String.valueOf(payPaymentRecord.getProjectType()))){
//更新来款记录主表
payPaymentRecordMapper.updateById(payPaymentRecord);
//更新来款记录表子表
LambdaUpdateWrapper<PayPaymentRecordSub> wrapper = new LambdaUpdateWrapper<>();
wrapper.eq(PayPaymentRecordSub::getRecordId,payPaymentRecord.getId());
wrapper.eq(PayPaymentRecordSub::getProjectId,payPaymentRecord.getProjectId());
wrapper.orderByDesc(PayPaymentRecordSub::getCreateTime);
PayPaymentRecordSub sub = payPaymentCheckMapper.selectList(wrapper).get(0);
sub.setRemark(payPaymentRecord.getRemark());
sub.setPaymentStatus(payPaymentRecord.getPaymentStatus());
sub.setReviewerId(payPaymentRecord.getReviewerId());
sub.setReviewerName(payPaymentRecord.getReviewerName());
sub.setReviewTime(payPaymentRecord.getReviewTime());
sub.setReviewInstructions(payPaymentRecord.getReviewInstructions());
payPaymentCheckMapper.updateById(sub);
}
BigDecimal newPaidAmount;
Integer inAccount;
String paymentStatus;
String paymentStatus=PaymentStatusEnum.TO_BE_REVIEWED.getCode();
String principalId="";
String project="";
List<PayContactsManagementTemporary> listId = new ArrayList<>();
@@ -476,6 +449,10 @@ public class PayPaymentCheckServiceImpl extends ServiceImpl<PayPaymentCheckMappe
case PayIncomeContractCommon.PROJECT_TYPE1:
PayCommonProject payCommonProject = payCommonProjectMapper.selectById(payPaymentRecord.getProjectId());
if(!PaymentStatusEnum.TO_BE_REVIEWED.getCode().equals(payCommonProject.getPaymentStatus())){
throw new JeroBootException("只有待审核的才可以审核");
}
if(PaymentStatusEnum.COMPLETED.getCode().equals(payPaymentRecord.getPaymentStatus())) {
//已同意
newPaidAmount = payPaymentRecordService.addPaidAmount(payCommonProject.getPaidAmount(), payPaymentRecord.getAmountReceived());//累加实收
@@ -500,6 +477,10 @@ public class PayPaymentCheckServiceImpl extends ServiceImpl<PayPaymentCheckMappe
PayWorkingGroupSubItem payWorking = payWorkingGroupSubItemMapper.selectById(payPaymentRecord.getProjectId());
PayWorkingGroup payWorkingGroup = payWorkingGroupService.getById(payWorking.getWorkingGroupId());
if(!PaymentStatusEnum.TO_BE_REVIEWED.getCode().equals(payWorking.getPaymentStatus())){
throw new JeroBootException("只有待审核的才可以审核");
}
if(PaymentStatusEnum.COMPLETED.getCode().equals(payPaymentRecord.getPaymentStatus())) {
//已同意
newPaidAmount =payPaymentRecordService.addPaidAmount(payWorking.getPaidAmount(),payPaymentRecord.getAmountReceived());//累加实收
@@ -524,6 +505,10 @@ public class PayPaymentCheckServiceImpl extends ServiceImpl<PayPaymentCheckMappe
PayMemberProjectSubitem member = payMemberProjectSubitemMapper.selectById(payPaymentRecord.getProjectId());
PayMemberProject payMemberProject = memberProjectService.getById(member.getProjectId());
if(!PaymentStatusEnum.TO_BE_REVIEWED.getCode().equals(member.getPaymentStatus())){
throw new JeroBootException("只有待审核的才可以审核");
}
if(PaymentStatusEnum.COMPLETED.getCode().equals(payPaymentRecord.getPaymentStatus())) {
//已同意
newPaidAmount =payPaymentRecordService.addPaidAmount(member.getPaidAmount(),payPaymentRecord.getAmountReceived());//累加实收
@@ -548,6 +533,10 @@ public class PayPaymentCheckServiceImpl extends ServiceImpl<PayPaymentCheckMappe
TbMemberProjectSubitem tbMember = tbMemberProjectSubitemMapper.selectById(payPaymentRecord.getProjectId());
TbMemberProject tbMemberProject = tbMemberProjectService.getById(tbMember.getProjectId());
if(!PaymentStatusEnum.TO_BE_REVIEWED.getCode().equals(tbMember.getPaymentStatus())){
throw new JeroBootException("只有待审核的才可以审核");
}
TbCheckVo tbCheckVo = new TbCheckVo();
if(PaymentStatusEnum.COMPLETED.getCode().equals(payPaymentRecord.getPaymentStatus())) {
@@ -559,7 +548,7 @@ public class PayPaymentCheckServiceImpl extends ServiceImpl<PayPaymentCheckMappe
paymentStatus = getPaymentStatus(tbMember.getAmountReceivable(), newPaidAmount, PaymentStatusEnum.COMPLETED.getCode());//缴费状态
//插入来款记录表
payPaymentRecord.setPaymentStatus(PaymentStatusEnum.COMPLETED.getCode());
payPaymentRecord.setPaymentStatus(paymentStatus);
payPaymentRecordMapper.insert(payPaymentRecord);
tbCheckVo.setCheckResult(PayProjectCommon.YES);
@@ -589,6 +578,10 @@ public class PayPaymentCheckServiceImpl extends ServiceImpl<PayPaymentCheckMappe
TbCertificatePayment tbMemberCertificate = certificatePaymentMapper.selectById(payPaymentRecord.getProjectId());
TbMemberProject tbMemberProjectCertificate = tbMemberProjectService.getById(tbMemberCertificate.getProjectId());
if(!PaymentStatusEnum.TO_BE_REVIEWED.getCode().equals(tbMemberCertificate.getPaymentStatus())){
throw new JeroBootException("只有待审核的才可以审核");
}
TbCheckVo tbCheckCerVo = new TbCheckVo();
if(PaymentStatusEnum.COMPLETED.getCode().equals(payPaymentRecord.getPaymentStatus())) {
@@ -600,7 +593,7 @@ public class PayPaymentCheckServiceImpl extends ServiceImpl<PayPaymentCheckMappe
paymentStatus = getPaymentStatus(tbMemberCertificate.getAmountReceivable(), newPaidAmount, PaymentStatusEnum.COMPLETED.getCode());//缴费状态
//插入来款记录表
payPaymentRecord.setPaymentStatus(PaymentStatusEnum.COMPLETED.getCode());
payPaymentRecord.setPaymentStatus(paymentStatus);
payPaymentRecordMapper.insert(payPaymentRecord);
tbCheckCerVo.setCheckResult(PayProjectCommon.YES);
@@ -635,6 +628,33 @@ public class PayPaymentCheckServiceImpl extends ServiceImpl<PayPaymentCheckMappe
default:break;
}
LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal();
payPaymentRecord.setReviewerId(sysUser.getId());
payPaymentRecord.setReviewerName(sysUser.getRealname());
payPaymentRecord.setReviewTime(new Date());
if(PayIncomeContractCommon.PROJECT_TYPE1.equals(String.valueOf(payPaymentRecord.getProjectType())) ||
PayIncomeContractCommon.PROJECT_TYPE2.equals(String.valueOf(payPaymentRecord.getProjectType())) ||
PayIncomeContractCommon.PROJECT_TYPE4.equals(String.valueOf(payPaymentRecord.getProjectType()))){
//更新来款记录主表
payPaymentRecordMapper.updateById(payPaymentRecord);
//更新来款记录表子表
LambdaUpdateWrapper<PayPaymentRecordSub> wrapper = new LambdaUpdateWrapper<>();
wrapper.eq(PayPaymentRecordSub::getRecordId,payPaymentRecord.getId());
wrapper.eq(PayPaymentRecordSub::getProjectId,payPaymentRecord.getProjectId());
wrapper.orderByDesc(PayPaymentRecordSub::getCreateTime);
PayPaymentRecordSub sub = payPaymentCheckMapper.selectList(wrapper).get(0);
sub.setRemark(payPaymentRecord.getRemark());
sub.setPaymentStatus(payPaymentRecord.getPaymentStatus());
sub.setReviewerId(payPaymentRecord.getReviewerId());
sub.setReviewerName(payPaymentRecord.getReviewerName());
sub.setReviewTime(payPaymentRecord.getReviewTime());
sub.setReviewInstructions(payPaymentRecord.getReviewInstructions());
payPaymentCheckMapper.updateById(sub);
}
//通过消息
// payPaymentRecordService.sendMessage( principalId,project, payPaymentRecord,listId);
// //拒绝消息