forked from free-lancers/electricity_bill_calc_service
feat(report):完成修改单一抄表记录的功能。
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user