Browse Source

金蝶更新

pull/122/head
yehongyang 3 years ago
parent
commit
9ff8df0733
2 changed files with 11 additions and 9 deletions
  1. +7
    -9
      task/k3cloud.go
  2. +4
    -0
      utils/k3cloud.go

+ 7
- 9
task/k3cloud.go View File

@ -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
//}


+ 4
- 0
utils/k3cloud.go View File

@ -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
}


Loading…
Cancel
Save