|
@@ -60,6 +60,8 @@ public class ContractMaterialAdjustServiceImpl extends BaseServiceImpl<ContractM
|
|
|
|
|
|
private final IInventoryFormMaterialService formMaterialService;
|
|
private final IInventoryFormMaterialService formMaterialService;
|
|
|
|
|
|
|
|
+ private final IMeterPeriodService meterPeriodService;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
@Transactional
|
|
@Transactional
|
|
public void add(ContractMaterialAdjustAddDTO dto) {
|
|
public void add(ContractMaterialAdjustAddDTO dto) {
|
|
@@ -207,4 +209,20 @@ public class ContractMaterialAdjustServiceImpl extends BaseServiceImpl<ContractM
|
|
attachmentFormService.saveBatch(files);
|
|
attachmentFormService.saveBatch(files);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void delete(Long id) {
|
|
|
|
+ //获取调差信息,判断是否已经审批
|
|
|
|
+ ContractMaterialAdjust adjust = this.getById(id);
|
|
|
|
+ if (adjust.getApproveStatus() == 1){
|
|
|
|
+ throw new ServiceException("当前材料调差单已经上报,删除失败");
|
|
|
|
+ }
|
|
|
|
+ //获取材料计量期,判断是否已经审批
|
|
|
|
+ MeterPeriod period = meterPeriodService.getById(adjust.getMeterPeriodId());
|
|
|
|
+ if (period.getApproveStatus() != 0){
|
|
|
|
+ throw new ServiceException("删除失败,当前计量期不是未上报状态");
|
|
|
|
+ }
|
|
|
|
+ this.removeById(id);
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|