修改写法

This commit is contained in:
qjq
2024-11-27 13:56:29 +08:00
parent 1c235b8a99
commit cd26a7688a

View File

@ -38,6 +38,7 @@ import cn.iocoder.yudao.module.member.enums.*;
import cn.iocoder.yudao.module.member.service.orderdetail.OrderDetailService;
import cn.iocoder.yudao.module.member.service.storeorderdetail.StoreOrderDetailService;
import cn.iocoder.yudao.module.system.api.carteen.CarteenApi;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -361,6 +362,8 @@ public class BillingServiceImpl implements BillingService {
}
billingMapper.updateById(updateObj);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updateBillingUnit(BillingSaveReqVO updateReqVO) {
// 校验存在
BillingDO billingDO = billingMapper.selectById(updateReqVO.getId());
@ -383,10 +386,10 @@ public class BillingServiceImpl implements BillingService {
//设置同意人
updateObj.setSystemId(SecurityFrameworkUtils.getLoginUserId());
//拒绝就把锁住的订单释放掉
LambdaUpdateChainWrapper<CardDO> wrapper = new LambdaUpdateChainWrapper<>(cardMapper);
wrapper.in(CardDO::getId,orderIds);
wrapper.set(CardDO::getBillingExist,BillingStatusEnum.BILLING_INVOICING_IS_COMPLETE.getCode());
cardMapper.update(wrapper);
LambdaUpdateWrapper<CardDO> wrapper = new LambdaUpdateWrapper<>();
wrapper.in(CardDO::getId, orderIds);
wrapper.set(CardDO::getBillingExist, BillingStatusEnum.BILLING_INVOICING_IS_COMPLETE.getCode());
cardMapper.update(null, wrapper);
}else{
//开票回拒
if(StrUtil.isBlank(updateObj.getRefuseDetails())){
@ -395,11 +398,11 @@ public class BillingServiceImpl implements BillingService {
updateObj.setStatus(BillingStatusEnum.BILLING_INVOICING_REJECTION.getCode());
updateObj.setRefuseTime(LocalDateTime.now());
//拒绝就把锁住的订单释放掉
LambdaUpdateChainWrapper<CardDO> wrapper = new LambdaUpdateChainWrapper<>(cardMapper);
wrapper.in(CardDO::getId,orderIds);
wrapper.set(CardDO::getBillingExist,BillingStatusEnum.BILLING_INVOICING_REJECTION.getCode());
LambdaUpdateWrapper<CardDO> wrapper = new LambdaUpdateWrapper<>();
wrapper.in(CardDO::getId, orderIds);
wrapper.set(CardDO::getBillingExist, BillingStatusEnum.BILLING_INVOICING_IS_COMPLETE.getCode());
wrapper.set(CardDO::getBillingNum,null);
cardMapper.update(wrapper);
cardMapper.update(null, wrapper);
}
billingMapper.updateById(updateObj);
}