|
|
@ -77,7 +77,7 @@ func (_this *PLN_PLANORDER_Service) Save(PlantNr int, UserId string, articleDema |
|
|
|
dao_Article := dal_base.NewArticleDAO(session, PlantNr, UserId) |
|
|
|
dao_PlanOrder := dal.NewPlanOrderDAO(session, PlantNr, UserId) |
|
|
|
article, err := dao_Article.SelectOne(articleDemand.ArtId) |
|
|
|
if err != nil || article == nil{ |
|
|
|
if err != nil || article == nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
|
|
|
@ -88,8 +88,8 @@ func (_this *PLN_PLANORDER_Service) Save(PlantNr int, UserId string, articleDema |
|
|
|
ValidateFlag: true, |
|
|
|
NumberSearch: true, |
|
|
|
Model: PLN_PLANORDER.PLN_PLANORDER_SAVE{ |
|
|
|
F_RDPB_MPSVNO: articleDemand.DemandKey+"_"+ strconv.Itoa(articleDemand.VersionNr), |
|
|
|
FReleaseStatus:"0",//计划
|
|
|
|
F_RDPB_MPSVNO: articleDemand.DemandKey + "_" + strconv.Itoa(articleDemand.VersionNr), |
|
|
|
FReleaseStatus: "0", //计划
|
|
|
|
//FID: 0,
|
|
|
|
FBillTypeID: _struct.FNumber{ |
|
|
|
FNumber: "JHDD01_SYS", |
|
|
@ -141,7 +141,7 @@ func (_this *PLN_PLANORDER_Service) Save(PlantNr int, UserId string, articleDema |
|
|
|
|
|
|
|
response, err := _this.SaveApi(_this.FormID, request) |
|
|
|
|
|
|
|
if err == nil && response.Result.ResponseStatus.IsSuccess == true{ |
|
|
|
if err == nil && response.Result.ResponseStatus.IsSuccess == true { |
|
|
|
articleDemand.Operator = strconv.Itoa(response.Result.ID) |
|
|
|
dao_PlanOrder.UpdateOne(articleDemand) |
|
|
|
} |
|
|
@ -150,15 +150,10 @@ func (_this *PLN_PLANORDER_Service) Save(PlantNr int, UserId string, articleDema |
|
|
|
} |
|
|
|
|
|
|
|
func (_this *PLN_PLANORDER_Service) Close(PlantNr int, UserId string, articleDemand *model.PlanOrder) error { |
|
|
|
engine := db.Eloquent.Master() |
|
|
|
session := engine.NewSession() |
|
|
|
defer session.Close() |
|
|
|
|
|
|
|
request := request2.CloseRequest{ |
|
|
|
Ids:articleDemand.Operator, |
|
|
|
Ids: articleDemand.Operator, |
|
|
|
} |
|
|
|
|
|
|
|
_, err := _this.BillCloseApi(_this.FormID, request) |
|
|
|
return err |
|
|
|
} |
|
|
|
|