package service
|
|
|
|
import (
|
|
"leit.com/LAPP_CHEERSSON_BACKEND/utils"
|
|
"leit.com/LAPP_CHEERSSON_BACKEND/utils/k3cloud/struct/pln_forecast"
|
|
request2 "leit.com/LAPP_CHEERSSON_BACKEND/utils/k3cloud/struct/request"
|
|
"leit.com/LAPP_CHEERSSON_BACKEND/utils/k3cloud/struct/response"
|
|
)
|
|
|
|
type PlnForecastService struct {
|
|
*utils.K3config
|
|
FormID string
|
|
}
|
|
|
|
func PlnForecastInit() *PlnForecastService {
|
|
cust := &PlnForecastService{
|
|
K3config: utils.K3Obj,
|
|
FormID: "PLN_FORECAST",
|
|
}
|
|
return cust
|
|
}
|
|
|
|
func (_this *PlnForecastService) SaveForecast(_request pln_forecast.PlnForecastSave) (response *response.K3ResponseStruct, err error) {
|
|
|
|
request := request2.SaveRequest{
|
|
Model: _request,
|
|
}
|
|
|
|
response, err, _, _ = _this.SaveApi(_this.FormID, request)
|
|
return
|
|
}
|
|
|
|
func (_this *PlnForecastService) CloseForecast(ids string) error {
|
|
request := request2.CloseRequest{
|
|
Ids: ids,
|
|
}
|
|
_, err := _this.BillCloseApi(_this.FormID, "BillClose", request)
|
|
return err
|
|
}
|
|
|
|
func (_this *PlnForecastService) DeleteForecast(ids string) error {
|
|
request := request2.DeleteRequest{
|
|
Ids: ids,
|
|
}
|
|
_, err := _this.DeleteApi(_this.FormID, request)
|
|
return err
|
|
}
|