Merge remote-tracking branch 'origin/mark' into su

This commit is contained in:
苏尹岚
2019-12-03 11:30:40 +08:00
42 changed files with 667 additions and 2419 deletions

View File

@@ -200,7 +200,6 @@ var (
const (
parallelCount = 5
UpdateGoodsShelfStatusCount = 50 //微盟下架商品api限制一次50个
fileExt = ".xlsx"
)
func (d *DataSuccessLock) AppendData(dataSuccess DataSuccess) {
@@ -753,12 +752,12 @@ func WriteToExcel(task *tasksch.SeqTask, dataSuccess []DataSuccess, dataFailed [
}
sheetList2 = append(sheetList2, excelConf2)
if excelConf1 != nil {
downloadURL1, fileName1, err = UploadExeclAndPushMsg(sheetList1, "微盟已更新商品")
downloadURL1, fileName1, err = jxutils.UploadExeclAndPushMsg(sheetList1, "微盟已更新商品")
} else {
baseapi.SugarLogger.Debug("WriteToExcel: dataSuccess is nil!")
}
if excelConf2 != nil {
downloadURL2, fileName2, err = UploadExeclAndPushMsg(sheetList2, "缺少商品_微盟")
downloadURL2, fileName2, err = jxutils.UploadExeclAndPushMsg(sheetList2, "缺少商品_微盟")
} else {
baseapi.SugarLogger.Debug("WriteToExcel: dataFailed is nil!")
}
@@ -772,15 +771,6 @@ func WriteToExcel(task *tasksch.SeqTask, dataSuccess []DataSuccess, dataFailed [
return err
}
func UploadExeclAndPushMsg(sheetList []*excel.Obj2ExcelSheetConfig, name string) (downloadURL, fileName string, err error) {
excelBin := excel.Obj2Excel(sheetList)
timeStr := utils.Int64ToStr(time.Now().Unix())
fileName = name + timeStr + fileExt
baseapi.SugarLogger.Debugf("WriteToExcel:save %s success", fileName)
downloadURL, err = jxutils.UploadExportContent(excelBin, fileName)
return downloadURL, fileName, err
}
func UpdateJxPriceByWeimob(ctx *jxcontext.Context, storeIDs []int, isAsync, isContinueWhenError bool) (hint string, err error) {
var (
storeSkuBindInfoList []interface{}
@@ -909,12 +899,12 @@ func WriteToExcel3(task *tasksch.SeqTask, dataSuccess []DataStoreSkusSuccess, da
}
sheetList2 = append(sheetList2, excelConf2)
if excelConf1 != nil {
downloadURL1, fileName1, err = UploadExeclAndPushMsg(sheetList1, "京西已更新商品")
downloadURL1, fileName1, err = jxutils.UploadExeclAndPushMsg(sheetList1, "京西已更新商品")
} else {
baseapi.SugarLogger.Debug("WriteToExcel: dataSuccess is nil!")
}
if excelConf2 != nil {
downloadURL2, fileName2, err = UploadExeclAndPushMsg(sheetList2, "缺少商品_京西")
downloadURL2, fileName2, err = jxutils.UploadExeclAndPushMsg(sheetList2, "缺少商品_京西")
} else {
baseapi.SugarLogger.Debug("WriteToExcel: dataFailed is nil!")
}
@@ -1105,13 +1095,13 @@ func WriteToExcel2(ctx *jxcontext.Context, DataFineList, DataHairyList []*Data)
sheetList2 = append(sheetList2, excelConf2)
noticeMsg += "[详情点我]"
if len(DataFineList) > 0 {
downloadURL1, fileName1, err = UploadExeclAndPushMsg(sheetList1, "京西采购_精品")
downloadURL1, fileName1, err = jxutils.UploadExeclAndPushMsg(sheetList1, "京西采购_精品")
noticeMsg += "path1=" + downloadURL1 + " "
} else {
baseapi.SugarLogger.Debug("WriteToExcel: DataFineList is nil!")
}
if len(DataHairyList) > 0 {
downloadURL2, fileName2, err = UploadExeclAndPushMsg(sheetList2, "京西采购_毛菜")
downloadURL2, fileName2, err = jxutils.UploadExeclAndPushMsg(sheetList2, "京西采购_毛菜")
noticeMsg += "path2=" + downloadURL2
} else {
baseapi.SugarLogger.Debug("WriteToExcel: DataHairyList is nil!")