|
|
@@ -147,8 +147,19 @@ public class VppDrServiceImpl implements VppDrService {
|
|
|
event.setEventType(request.getEventType());
|
|
|
event.setStartTime(request.getStartTime());
|
|
|
event.setEndTime(request.getEndTime());
|
|
|
+ event.setDeclareDeadline(request.getDeclareDeadline());
|
|
|
+ event.setInviteScope(request.getInviteScope());
|
|
|
event.setTargetCapacityKw(request.getTargetCapacityKw());
|
|
|
event.setClearedCapacityKw(request.getClearedCapacityKw());
|
|
|
+ event.setDeclaredClearedCapacityKw(request.getDeclaredClearedCapacityKw());
|
|
|
+ event.setActualClearedCapacityKw(request.getActualClearedCapacityKw());
|
|
|
+ event.setEstimatedResponseCapacityKw(request.getEstimatedResponseCapacityKw());
|
|
|
+ event.setActualResponseCapacityKw(request.getActualResponseCapacityKw());
|
|
|
+ event.setResponseCompletionRate(VppDrParticipationHelper.calcResponseCompletionRate(
|
|
|
+ request.getActualResponseCapacityKw(), request.getTargetCapacityKw()));
|
|
|
+ event.setIsWinningBid(request.getIsWinningBid());
|
|
|
+ event.setRemarkAttachmentUrl(request.getRemarkAttachmentUrl());
|
|
|
+ event.setRemarkAttachmentName(request.getRemarkAttachmentName());
|
|
|
event.setSubsidyPrice(request.getSubsidyPrice());
|
|
|
event.setEventStatus(EVENT_STATUS_PENDING);
|
|
|
VppAuditHelper.fillCreate(event);
|
|
|
@@ -174,8 +185,19 @@ public class VppDrServiceImpl implements VppDrService {
|
|
|
event.setEventType(request.getEventType());
|
|
|
event.setStartTime(request.getStartTime());
|
|
|
event.setEndTime(request.getEndTime());
|
|
|
+ event.setDeclareDeadline(request.getDeclareDeadline());
|
|
|
+ event.setInviteScope(request.getInviteScope());
|
|
|
event.setTargetCapacityKw(request.getTargetCapacityKw());
|
|
|
event.setClearedCapacityKw(request.getClearedCapacityKw());
|
|
|
+ event.setDeclaredClearedCapacityKw(request.getDeclaredClearedCapacityKw());
|
|
|
+ event.setActualClearedCapacityKw(request.getActualClearedCapacityKw());
|
|
|
+ event.setEstimatedResponseCapacityKw(request.getEstimatedResponseCapacityKw());
|
|
|
+ event.setActualResponseCapacityKw(request.getActualResponseCapacityKw());
|
|
|
+ event.setResponseCompletionRate(VppDrParticipationHelper.calcResponseCompletionRate(
|
|
|
+ request.getActualResponseCapacityKw(), request.getTargetCapacityKw()));
|
|
|
+ event.setIsWinningBid(request.getIsWinningBid());
|
|
|
+ event.setRemarkAttachmentUrl(request.getRemarkAttachmentUrl());
|
|
|
+ event.setRemarkAttachmentName(request.getRemarkAttachmentName());
|
|
|
event.setSubsidyPrice(request.getSubsidyPrice());
|
|
|
VppAuditHelper.fillUpdate(event);
|
|
|
eventMapper.updateById(event);
|
|
|
@@ -269,7 +291,7 @@ public class VppDrServiceImpl implements VppDrService {
|
|
|
|
|
|
if (Boolean.TRUE.equals(request.getParticipate())) {
|
|
|
if (request.getDeclaredCapacityKw() == null || request.getDeclaredCapacityKw().compareTo(BigDecimal.ZERO) <= 0) {
|
|
|
- throw new BusinessException("申报容量必须大于0");
|
|
|
+ throw new BusinessException("申报出清容量必须大于0");
|
|
|
}
|
|
|
|
|
|
if (request.getResources() == null || request.getResources().isEmpty()) {
|
|
|
@@ -288,7 +310,7 @@ public class VppDrServiceImpl implements VppDrService {
|
|
|
throw new BusinessException("资源ID不能为空");
|
|
|
}
|
|
|
if (resource.getDeclaredCapacityKw() == null || resource.getDeclaredCapacityKw().compareTo(BigDecimal.ZERO) <= 0) {
|
|
|
- throw new BusinessException("资源申报容量必须大于0");
|
|
|
+ throw new BusinessException("资源申报出清容量必须大于0");
|
|
|
}
|
|
|
VppResourcePoint rp = resourcePointMapper.selectById(resource.getResourceId());
|
|
|
if (rp == null || VppAuditHelper.isDeleted(rp.getDeleteFlag())) {
|
|
|
@@ -305,7 +327,7 @@ public class VppDrServiceImpl implements VppDrService {
|
|
|
}
|
|
|
|
|
|
if (resourceDeclaredTotal.compareTo(request.getDeclaredCapacityKw()) != 0) {
|
|
|
- throw new BusinessException("各资源申报容量之和与总申报容量不一致");
|
|
|
+ throw new BusinessException("各资源申报出清容量之和与总申报出清容量不一致");
|
|
|
}
|
|
|
|
|
|
for (DrParticipateRequest.DrResourceDeclare resource : request.getResources()) {
|
|
|
@@ -322,6 +344,7 @@ public class VppDrServiceImpl implements VppDrService {
|
|
|
participationMapper.insert(participation);
|
|
|
}
|
|
|
|
|
|
+ event.setDeclaredClearedCapacityKw(request.getDeclaredCapacityKw());
|
|
|
event.setEventStatus(EVENT_STATUS_DECLARED);
|
|
|
VppAuditHelper.fillUpdate(event);
|
|
|
eventMapper.updateById(event);
|
|
|
@@ -396,7 +419,7 @@ public class VppDrServiceImpl implements VppDrService {
|
|
|
}
|
|
|
if (participation.getDeclaredCapacityKw() != null
|
|
|
&& resource.getClearedCapacityKw().compareTo(participation.getDeclaredCapacityKw()) > 0) {
|
|
|
- throw new BusinessException("出清容量不能超过申报容量");
|
|
|
+ throw new BusinessException("出清容量不能超过申报出清容量");
|
|
|
}
|
|
|
participation.setClearedCapacityKw(resource.getClearedCapacityKw());
|
|
|
VppDrParticipationHelper.refreshCompletionRate(participation);
|
|
|
@@ -575,6 +598,9 @@ public class VppDrServiceImpl implements VppDrService {
|
|
|
executionMapper.updateById(execution);
|
|
|
}
|
|
|
|
|
|
+ event.setEstimatedResponseCapacityKw(totalActual);
|
|
|
+ event.setResponseCompletionRate(VppDrParticipationHelper.calcResponseCompletionRate(
|
|
|
+ totalActual, event.getTargetCapacityKw()));
|
|
|
event.setEventStatus(EVENT_STATUS_ENDED);
|
|
|
VppAuditHelper.fillUpdate(event);
|
|
|
eventMapper.updateById(event);
|
|
|
@@ -814,10 +840,34 @@ public class VppDrServiceImpl implements VppDrService {
|
|
|
throw new BusinessException("响应结束时间不能早于开始时间");
|
|
|
}
|
|
|
if (request.getTargetCapacityKw() == null || request.getTargetCapacityKw().compareTo(BigDecimal.ZERO) <= 0) {
|
|
|
- throw new BusinessException("目标容量必须大于0");
|
|
|
+ throw new BusinessException("邀约规模必须大于0");
|
|
|
}
|
|
|
if (request.getClearedCapacityKw() != null && request.getClearedCapacityKw().compareTo(BigDecimal.ZERO) < 0) {
|
|
|
- throw new BusinessException("出清容量不能为负数");
|
|
|
+ throw new BusinessException("出清规模不能为负数");
|
|
|
+ }
|
|
|
+ if (request.getDeclaredClearedCapacityKw() != null
|
|
|
+ && request.getDeclaredClearedCapacityKw().compareTo(BigDecimal.ZERO) < 0) {
|
|
|
+ throw new BusinessException("申报出清容量不能为负数");
|
|
|
+ }
|
|
|
+ if (request.getActualClearedCapacityKw() != null
|
|
|
+ && request.getActualClearedCapacityKw().compareTo(BigDecimal.ZERO) < 0) {
|
|
|
+ throw new BusinessException("实际出清不能为负数");
|
|
|
+ }
|
|
|
+ if (request.getEstimatedResponseCapacityKw() != null
|
|
|
+ && request.getEstimatedResponseCapacityKw().compareTo(BigDecimal.ZERO) < 0) {
|
|
|
+ throw new BusinessException("预估响应容量不能为负数");
|
|
|
+ }
|
|
|
+ if (request.getActualResponseCapacityKw() != null
|
|
|
+ && request.getActualResponseCapacityKw().compareTo(BigDecimal.ZERO) < 0) {
|
|
|
+ throw new BusinessException("实际响应容量不能为负数");
|
|
|
+ }
|
|
|
+ if (request.getIsWinningBid() != null
|
|
|
+ && request.getIsWinningBid() != 0 && request.getIsWinningBid() != 1) {
|
|
|
+ throw new BusinessException("是否中标无效,取值 0否 1是");
|
|
|
+ }
|
|
|
+ if (request.getDeclareDeadline() != null && request.getStartTime() != null
|
|
|
+ && request.getDeclareDeadline().isAfter(request.getStartTime())) {
|
|
|
+ throw new BusinessException("申报截止时间不能晚于响应开始时间");
|
|
|
}
|
|
|
if (request.getSubsidyPrice() != null && request.getSubsidyPrice().compareTo(BigDecimal.ZERO) < 0) {
|
|
|
throw new BusinessException("补贴标准不能为负数");
|
|
|
@@ -866,8 +916,18 @@ public class VppDrServiceImpl implements VppDrService {
|
|
|
vo.setEventType(event.getEventType());
|
|
|
vo.setStartTime(event.getStartTime());
|
|
|
vo.setEndTime(event.getEndTime());
|
|
|
+ vo.setDeclareDeadline(event.getDeclareDeadline());
|
|
|
+ vo.setInviteScope(event.getInviteScope());
|
|
|
vo.setTargetCapacityKw(event.getTargetCapacityKw());
|
|
|
vo.setClearedCapacityKw(event.getClearedCapacityKw());
|
|
|
+ vo.setDeclaredClearedCapacityKw(event.getDeclaredClearedCapacityKw());
|
|
|
+ vo.setActualClearedCapacityKw(event.getActualClearedCapacityKw());
|
|
|
+ vo.setEstimatedResponseCapacityKw(event.getEstimatedResponseCapacityKw());
|
|
|
+ vo.setActualResponseCapacityKw(event.getActualResponseCapacityKw());
|
|
|
+ vo.setResponseCompletionRate(event.getResponseCompletionRate());
|
|
|
+ vo.setIsWinningBid(event.getIsWinningBid());
|
|
|
+ vo.setRemarkAttachmentUrl(event.getRemarkAttachmentUrl());
|
|
|
+ vo.setRemarkAttachmentName(event.getRemarkAttachmentName());
|
|
|
vo.setSubsidyPrice(event.getSubsidyPrice());
|
|
|
vo.setEventStatus(event.getEventStatus());
|
|
|
vo.setParticipations(loadParticipationVos(event.getId()));
|