Merge branch 'yonghui' of e.coding.net:rosydev/jx-callback into su

This commit is contained in:
苏尹岚
2019-11-28 09:50:19 +08:00
5 changed files with 286 additions and 7 deletions

View File

@@ -541,7 +541,7 @@ func updateWeiMobGoods(costPrice, salePrice float64, unit string, isCompare bool
} else {
outPutData := DataSuccess{
NameID: goodsDetail.OuterGoodsCode,
Name: goodsDetail.Title,
Name: newSkuTitle,
Unit: unit,
OrgPrice: goodsDetail.SkuMap.SingleSku.SalePrice,
NowPrice: salePrice,
@@ -773,6 +773,7 @@ func UpdateJxPriceByWeimob(ctx *jxcontext.Context, storeIDs []int, isAsync, isCo
var (
storeSkuBindInfoList []interface{}
skuBindInfos []*cms.StoreSkuBindInfo
nameID int
)
db := dao.GetDB()
dataFailed.dataFailedList = dataFailed.dataFailedList[0:0]
@@ -795,9 +796,19 @@ func UpdateJxPriceByWeimob(ctx *jxcontext.Context, storeIDs []int, isAsync, isCo
if err != nil {
baseapi.SugarLogger.Errorf("QueryGoodsDetail error:%v", err)
}
nameID := int(utils.Str2Int64(goodsDetail.SkuMap.SingleSku.OuterSkuCode))
unitPrice := int(utils.Float64TwoInt64(goodsDetail.SkuMap.SingleSku.CostPrice * 100))
goodsID := goodsDetail.OuterGoodsCode
unitPrice := int(utils.Float64TwoInt64(goodsDetail.SkuMap.SingleSku.CostPrice * 100))
if goodsDetail.SkuMap.SingleSku.OuterSkuCode != "" {
nameID = int(utils.Str2Int64(goodsDetail.SkuMap.SingleSku.OuterSkuCode))
} else {
outPutData := DataFailed{
GoodsID: goodsID,
GoodsName: goodsDetail.Title,
Comment: "微盟上没有该商品的商品编码",
}
dataFailed.AppendData2(outPutData)
nameID = -1
}
skuList, err := dao.GetStoreSkusByNameIDs(db, storeIDs, nameID)
if len(skuList) > 0 {
if goodsDetail.OuterGoodsCode != "" {
@@ -1025,17 +1036,23 @@ func GetWeimobOrdersExcel(ctx *jxcontext.Context, OrderNo string) (result *Weimo
itemList := orderSingle.ItemList
for _, v := range itemList {
if v.GoodsCode != "" {
var goodsTile string
if v.GoodsTitle[0:1] == "(" {
goodsTile = v.GoodsTitle[strings.Index(v.GoodsTitle, ")")+1 : len(v.GoodsTitle)]
} else {
goodsTile = v.GoodsTitle
}
if v.GoodsCode[0:1] == "0" {
DataHairy := &Data{
GoodsID: v.GoodsCode,
GoodsName: v.GoodsTitle,
GoodsID: v.GoodsCode[1:len(v.GoodsCode)],
GoodsName: goodsTile,
GoodsNum: v.SkuNum,
}
DataHairyList = append(DataHairyList, DataHairy)
} else {
DataFine := &Data{
GoodsID: v.GoodsCode,
GoodsName: v.GoodsTitle,
GoodsName: goodsTile,
GoodsNum: v.SkuNum,
}
DataFineList = append(DataFineList, DataFine)