feat(report):完成修改单一抄表记录的功能。

This commit is contained in:
徐涛
2022-08-23 11:07:42 +08:00
parent aec0cd379f
commit c0e5ca8c33
3 changed files with 112 additions and 5 deletions

View File

@@ -56,6 +56,15 @@ func (_EndUserService) AllEndUserRecord(reportId string) ([]model.EndUserDetail,
return users, err
}
func (_EndUserService) FetchSpecificEndUserRecord(reportId, parkId, meterId string) (*model.EndUserDetail, error) {
record := new(model.EndUserDetail)
_, err := global.DBConn.
ID(schemas.NewPK(reportId, parkId, meterId)).
NoAutoCondition().
Get(record)
return record, err
}
func (_EndUserService) UpdateEndUserRegisterRecord(tx *xorm.Session, record model.EndUserDetail) (err error) {
record.CalculatePeriod()
_, err = tx.ID(schemas.NewPK(record.ReportId, record.ParkId, record.MeterId)).
@@ -70,6 +79,11 @@ func (_EndUserService) UpdateEndUserRegisterRecord(tx *xorm.Session, record mode
"adjust_peak",
"adjust_flat",
"adjust_valley",
"overall",
"critical",
"peak",
"flat",
"valley",
).
Update(record)
return