diff --git a/task/k3cloud.go b/task/k3cloud.go index 74af59b..d00dca4 100644 --- a/task/k3cloud.go +++ b/task/k3cloud.go @@ -30,31 +30,29 @@ var serviceOfProject = svrMe.NewProjectService() var serviceOfUom = svr.NewUomService() func TaskInit() { - utils.K3configInit() erp.PublishPlan(100, "admin") for true { oneTask(time.Time{}) - //time.Sleep(time.Hour * 1) - time.Sleep(time.Minute * 5) + time.Sleep(time.Hour * 1) } } //1天任务 func oneTask(_date time.Time) { - + //需要定时登录erp + utils.K3configInit() //if DaysBetweenDates(lastTime.OneTime, _date) >= 1 { //go func() { - ImportMaterial() - ImportMaterialGroupSearch() - ImportArticle() - ImportBomList() + //ImportMaterial() + //ImportMaterialGroupSearch() + //ImportArticle() + //ImportBomList() //ImportCustomer() //ImportSaleOrder() //ImportCustomerMaterialSearch() //ImportProjectSearch() //}() - //ImportCustomer() //ImportUnit() lastTime.OneTime = _date //} diff --git a/utils/k3cloud.go b/utils/k3cloud.go index ed2a3cd..06b17ad 100644 --- a/utils/k3cloud.go +++ b/utils/k3cloud.go @@ -84,6 +84,10 @@ func (K3config *K3config) SearchApi(formId string, search interface{}) ([][]inte if err != nil { return nil, err } + _response := response.K3ResponseToStruct(res) + if !_response.Result.ResponseStatus.IsSuccess { + return nil, fmt.Errorf("%s", _response.Result.ResponseStatus.Errors) + } return response.K3ResponseToMap(res), nil }