ezhizao_zx 1 year ago
parent
commit
b4c55d620f

+ 1 - 1
src/main/java/cn/ezhizao/project/business/order/service/impl/BizArchiveInputServiceImpl.java

@@ -315,7 +315,7 @@ public class BizArchiveInputServiceImpl extends ServiceImpl<BizArchiveInputMappe
     @Override
     public boolean save(BizArchiveInput bizArchiveInput) {
         // 判断是否重复订单号
-        if(bizArchiveInput.getFromId().equals(0L) && this.query().eq("from_id", 0L).eq("contract_no", bizArchiveInput.getContractNo()).ne("id", bizArchiveInput.getId() == null ? 0L :bizArchiveInput.getId()).count() > 0) throw new ServiceException("订单号不能重复", HttpStatus.ERROR);
+        if((bizArchiveInput.getFromId() == null || bizArchiveInput.getFromId().equals(0L)) && this.query().eq("from_id", 0L).eq("contract_no", bizArchiveInput.getContractNo()).ne("id", bizArchiveInput.getId() == null ? 0L :bizArchiveInput.getId()).count() > 0) throw new ServiceException("订单号不能重复", HttpStatus.ERROR);
 
         boolean saveStatus = super.save(bizArchiveInput);
         List<BizArchiveInputDetail> bizArchiveInputDetails = bizArchiveInput.getDetails();