修改开票流程

This commit is contained in:
qjq
2024-11-18 09:29:00 +08:00
parent 23d10238a1
commit 00a44f7ead
2 changed files with 10 additions and 4 deletions

View File

@ -151,5 +151,6 @@ public interface ErrorCodeConstants {
ErrorCode BILLING_NOT_EXISTS = new ErrorCode(1_004_023_00, "开票记录不存在");
ErrorCode BILLING_NOT_ORDER_EXISTS= new ErrorCode(1_004_023_00, "该时间段没有订单可开票");
ErrorCode BILLING_NOT_ORDER_REFUSE= new ErrorCode(1_004_024_00, "拒绝理由不能为空");
}

View File

@ -51,8 +51,7 @@ import java.util.function.Function;
import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.BILLING_NOT_EXISTS;
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.BILLING_NOT_ORDER_EXISTS;
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*;
/**
* 开票记录 Service 实现类
@ -206,9 +205,13 @@ public class BillingServiceImpl implements BillingService {
@Override
public void updateBilling(BillingSaveReqVO updateReqVO) {
// 校验存在
validateBillingExists(updateReqVO.getId());
BillingDO billingDO = billingMapper.selectById(updateReqVO.getId());
if (billingDO== null) {
throw exception(BILLING_NOT_EXISTS);
}
// 更新
BillingDO updateObj = BeanUtils.toBean(updateReqVO, BillingDO.class);
updateObj.setOrderId(billingDO.getOrderId());
//开票成功是根据pdf上传成功没
if(StrUtil.isNotBlank(updateObj.getPdfUrl())){
//上传成功 修改状态
@ -217,7 +220,9 @@ public class BillingServiceImpl implements BillingService {
updateObj.setSystemId(SecurityFrameworkUtils.getLoginUserId());
}else{
//开票回拒
Assert.notNull(updateObj.getRefuseDetails(),"拒绝理由不能为空");
if(StrUtil.isBlank(updateObj.getRefuseDetails())){
throw exception(BILLING_NOT_ORDER_REFUSE);
}
updateObj.setStatus(BillingStatusEnum.BILLING_INVOICING_REJECTION.getCode());
updateObj.setRefuseTime(LocalDateTime.now());
String orderId = updateObj.getOrderId();