|
|
@ -13,7 +13,6 @@ import ( |
|
|
|
model "LAPP_GAAS_GFrame_BACKEND/models/log" |
|
|
|
"LAPP_GAAS_GFrame_BACKEND/utils" |
|
|
|
"LAPP_GAAS_GFrame_BACKEND/web/models" |
|
|
|
"errors" |
|
|
|
"fmt" |
|
|
|
"github.com/360EntSecGroup-Skylar/excelize/v2" |
|
|
|
json "github.com/json-iterator/go" |
|
|
@ -836,11 +835,16 @@ func (impl *ArtDemandHeadServiceImplement) TransferDataToOrigin(getTimeUrl, post |
|
|
|
log.Error("DataToOrigin unmarshal time body failed, error:"+err.Error(), "body: "+string(timeBody)) |
|
|
|
return |
|
|
|
} |
|
|
|
log.Debug("DataToOrigin get time response:" + string(timeBody)) |
|
|
|
|
|
|
|
if response.Code != http.StatusOK { |
|
|
|
log.Info("DataToOrigin get time data failed, response:" + string(timeBody)) |
|
|
|
return |
|
|
|
} |
|
|
|
lastTime := string(response.Data) |
|
|
|
lastTime := response.Data |
|
|
|
if lastTime == "" { |
|
|
|
lastTime = "2000-01-01 00:00:00" |
|
|
|
} |
|
|
|
_, err = time.Parse("2006-01-02 15:04:05", lastTime) |
|
|
|
if err != nil { |
|
|
|
log.Error("DataToOrigin parse time failed, error:"+err.Error(), "time string:"+lastTime) |
|
|
@ -881,6 +885,7 @@ func (impl *ArtDemandHeadServiceImplement) TransferDataToOrigin(getTimeUrl, post |
|
|
|
log.Error("DataToOrigin unmarshal post file response failed, error:"+err.Error(), "data:"+string(resp)) |
|
|
|
return |
|
|
|
} |
|
|
|
log.Debug("DataToOrigin post file response:" + string(resp)) |
|
|
|
if postResp.Code != http.StatusOK { |
|
|
|
log.Error("DataToOrigin post file response code is not OK, data:" + string(resp)) |
|
|
|
return |
|
|
@ -985,9 +990,10 @@ func (impl *ArtDemandHeadServiceImplement) SaveToExcel(headLi *[]model.ArtDemand |
|
|
|
if err != nil { |
|
|
|
return "", err |
|
|
|
} |
|
|
|
pathLi := strings.Split(filepath, "web\\") |
|
|
|
if len(pathLi) != 2 { |
|
|
|
return "", errors.New("导出失败,请重试") |
|
|
|
} |
|
|
|
return pathLi[1], nil |
|
|
|
//pathLi := strings.Split(filepath, "web\\")
|
|
|
|
//if len(pathLi) != 2 {
|
|
|
|
// return "", errors.New("导出失败,请重试")
|
|
|
|
//}
|
|
|
|
//return pathLi[1], nil
|
|
|
|
return filepath, nil |
|
|
|
} |