|
|
@@ -449,10 +449,12 @@ public class ThirdPartyChargingServiceImpl implements ThirdPartyChargingService
|
|
|
pricePolicyVO.getConnectorID()
|
|
|
);
|
|
|
|
|
|
- // 如果数据完全相同,不做任何操作
|
|
|
+ // 如果数据完全相同,仅更新同步时间
|
|
|
if (latestPolicy != null && isPolicySame(latestPolicy, pricePolicyVO)) {
|
|
|
- log.info("价格策略数据未发生变化,跳过保存 - equipBizSeq: {}, connectorId: {}",
|
|
|
+ log.info("价格策略数据未发生变化,仅更新同步时间 - equipBizSeq: {}, connectorId: {}",
|
|
|
pricePolicyVO.getEquipBizSeq(), pricePolicyVO.getConnectorID());
|
|
|
+ // 更新所有明细的同步时间
|
|
|
+ updateAllDetailSyncTime(latestPolicy.getId());
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -654,10 +656,30 @@ public class ThirdPartyChargingServiceImpl implements ThirdPartyChargingService
|
|
|
updatePolicyInfoDetail(existing, policyInfo);
|
|
|
log.debug("价格策略明细更新成功 - policyId: {}, startTime: {}", policyId, policyInfo.getStartTime());
|
|
|
} else {
|
|
|
- log.debug("价格策略明细未变化,跳过保存 - policyId: {}, startTime: {}", policyId, policyInfo.getStartTime());
|
|
|
+ // 数据未变化,但仍更新同步时间
|
|
|
+ updateSyncTime(existing);
|
|
|
+ log.debug("价格策略明细未变化,更新同步时间 - policyId: {}, startTime: {}", policyId, policyInfo.getStartTime());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 更新同步时间(数据未变化时仅更新update_time)
|
|
|
+ */
|
|
|
+ private void updateSyncTime(ThirdPartyPolicyInfo existing) {
|
|
|
+ existing.setUpdateTime(LocalDateTime.now());
|
|
|
+ policyInfoMapper.updateById(existing);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 更新所有明细的同步时间
|
|
|
+ */
|
|
|
+ private void updateAllDetailSyncTime(Long policyId) {
|
|
|
+ policyInfoMapper.update(null, Wrappers.<ThirdPartyPolicyInfo>lambdaUpdate()
|
|
|
+ .eq(ThirdPartyPolicyInfo::getPricePolicyId, policyId)
|
|
|
+ .set(ThirdPartyPolicyInfo::getUpdateTime, LocalDateTime.now()));
|
|
|
+ log.debug("批量更新价格策略明细同步时间完成 - policyId: {}", policyId);
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 判断价格策略明细是否相同
|