|
@@ -2,6 +2,7 @@ package com.zhongzheng.modules.order.service.impl;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import com.zhongzheng.common.exception.CustomException;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
import com.zhongzheng.modules.order.bo.OrderInvoiceAddBo;
|
|
|
import com.zhongzheng.modules.order.bo.OrderInvoiceEditBo;
|
|
@@ -101,6 +102,19 @@ public class OrderInvoiceServiceImpl extends ServiceImpl<OrderInvoiceMapper, Ord
|
|
|
public Boolean updateByEditBo(OrderInvoiceEditBo bo) {
|
|
|
OrderInvoice update = BeanUtil.toBean(bo, OrderInvoice.class);
|
|
|
validEntityBeforeSave(update);
|
|
|
+ //获取旧的实体
|
|
|
+ OrderInvoiceVo old = queryById(bo.getInvoiceId());
|
|
|
+ if(old.getPeriodStatus()==2&&bo.getPeriodStatus()!=2){
|
|
|
+ throw new CustomException("驳回状态无法修改");
|
|
|
+ }
|
|
|
+ if(old.getPeriodStatus()==3&&bo.getPeriodStatus()!=3){
|
|
|
+ if(bo.getPeriodStatus()==2){
|
|
|
+ throw new CustomException("无法修改审核状态");
|
|
|
+ }
|
|
|
+ if(bo.getPeriodStatus()==1&&old.getInvoiceStatus()!=1){
|
|
|
+ throw new CustomException("已开票或已退票状态无法修改审核状态");
|
|
|
+ }
|
|
|
+ }
|
|
|
update.setUpdateTime(DateUtils.getNowTime());
|
|
|
return this.updateById(update);
|
|
|
}
|