|
@@ -62,6 +62,9 @@ public class MiddleMeterApplyServiceImpl extends BaseServiceImpl<MiddleMeterAppl
|
|
|
|
|
|
private final IAttachmentFormService attachmentFormService;
|
|
|
|
|
|
+ //合同计量期
|
|
|
+ private final IContractMeterPeriodService contractMeterPeriodService;
|
|
|
+
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -126,6 +129,7 @@ public class MiddleMeterApplyServiceImpl extends BaseServiceImpl<MiddleMeterAppl
|
|
|
formApply.setContractFormId(l.getId());
|
|
|
formApply.setMiddleMeterId(id);
|
|
|
formApply.setContractPeriodId(dto.getContractPeriodId());
|
|
|
+ formApply.setMeterNumber(dto.getMeterNumber());
|
|
|
if (l.getCurrentMeterTotal() != null && l.getCurrentPrice() != null) {
|
|
|
formApply.setCurrentMeterTotal(l.getCurrentMeterTotal());
|
|
|
formApply.setCurrentMeterMoney(l.getCurrentPrice().multiply(new BigDecimal(l.getCurrentMeterTotal())));
|
|
@@ -219,6 +223,7 @@ public class MiddleMeterApplyServiceImpl extends BaseServiceImpl<MiddleMeterAppl
|
|
|
formApply.setContractFormId(l.getId());
|
|
|
formApply.setMiddleMeterId(dto.getId());
|
|
|
formApply.setContractPeriodId(dto.getContractPeriodId());
|
|
|
+ formApply.setMeterNumber(dto.getMeterNumber());
|
|
|
if (l.getCurrentMeterTotal() != null && l.getCurrentPrice() != null) {
|
|
|
formApply.setCurrentMeterTotal(l.getCurrentMeterTotal());
|
|
|
formApply.setCurrentMeterMoney(l.getCurrentPrice().multiply(new BigDecimal(l.getCurrentMeterTotal())));
|
|
@@ -327,4 +332,30 @@ public class MiddleMeterApplyServiceImpl extends BaseServiceImpl<MiddleMeterAppl
|
|
|
vo.setFileList(list);
|
|
|
return vo;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取计量单编号
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public String getMeterNumber(MiddleMeterApply apply) {
|
|
|
+ StringBuilder str = new StringBuilder();
|
|
|
+ //获取合同信息
|
|
|
+ String contractNumber = baseMapper.getContractInfo(apply.getContractId());
|
|
|
+ if (StringUtils.isBlank(contractNumber)){
|
|
|
+ throw new ServiceException("未获取到当前合同段编号信息");
|
|
|
+ }
|
|
|
+ str.append(contractNumber+"-");
|
|
|
+ //获取计量期信息
|
|
|
+ ContractMeterPeriod contractMeterPeriod = contractMeterPeriodService.getById(apply.getContractPeriodId());
|
|
|
+ if (contractMeterPeriod == null || StringUtils.isBlank(contractMeterPeriod.getPeriodNumber())){
|
|
|
+ throw new ServiceException("未获取到计量期期号信息");
|
|
|
+ }
|
|
|
+ str.append(contractMeterPeriod.getPeriodNumber()+"-");
|
|
|
+ //获取流水号:当前合同段存在的所有合同计量申请的数量+1
|
|
|
+ long count = this.count(new LambdaQueryWrapper<MiddleMeterApply>()
|
|
|
+ .eq(MiddleMeterApply::getContractId, apply.getContractId())
|
|
|
+ .eq(MiddleMeterApply::getContractPeriodId,apply.getContractPeriodId()));
|
|
|
+ str.append(count+1);
|
|
|
+ return str.toString();
|
|
|
+ }
|
|
|
}
|