enhance(tenement):基本完成商户相关借口,待测。

This commit is contained in:
徐涛
2023-06-15 13:50:50 +08:00
parent 577ac9d1dc
commit 2d6bff5828
3 changed files with 336 additions and 0 deletions

View File

@@ -207,6 +207,11 @@ func (ts _TenementService) MoveOutTenement(pid, tid string, reading []*vo.MeterR
tx.Rollback(ctx)
return fmt.Errorf("找不到指定表计[%s]的抄表信息,%w", meterCode, err)
}
if reading.Validate() {
ts.log.Error("迁出指定商户失败,表计读数不能正确配平,尖锋电量、峰电量、谷电量之和超过总电量。", zap.String("Meter", meterCode))
tx.Rollback(ctx)
return fmt.Errorf("表计[%s]读数不能正确配平,尖锋电量、峰电量、谷电量之和超过总电量。", meterCode)
}
err = repository.TenementRepository.UnbindMeter(tx, ctx, pid, tid, meterCode)
if err != nil {
ts.log.Error("迁出指定商户失败,未能解除表计绑定", zap.Error(err))