|
@@ -84,11 +84,17 @@ public class ContractInventoryFormServiceImpl extends BaseServiceImpl<ContractIn
|
|
|
if (excels == null || excels.size() == 0){
|
|
|
throw new ServiceException("未检测到excel中清单数据,请检查格式后后重新导入");
|
|
|
}
|
|
|
- //校验必填字段是否为空
|
|
|
+ //校验必填字段是否为空,校验填写数量就必须填写金额
|
|
|
excels.stream().forEach(l->{
|
|
|
if (StringUtils.isBlank(l.getImportNumber()) || StringUtils.isBlank(l.getFormNumber() ) || StringUtils.isBlank(l.getFormName())){
|
|
|
throw new ServiceException("excel中有必填项未填写,请检查(导入编号,清单编号,清单名称)后重新导入");
|
|
|
}
|
|
|
+ if (l.getBidPrice() == null && l.getContractTotal() != null){
|
|
|
+ throw new ServiceException("excel中有清单单价未填写,填写数量则必须填写单价");
|
|
|
+ }
|
|
|
+ if (l.getBidPrice() != null && l.getContractTotal() == null){
|
|
|
+ throw new ServiceException("excel中有清单数量未填写,填写单价则必须填写数量");
|
|
|
+ }
|
|
|
});
|
|
|
allTotal = excels.size();
|
|
|
List<Integer> firstNode = new ArrayList<>();
|