This commit is contained in:
suyl
2021-09-13 09:09:17 +08:00
parent bbb3a27ca6
commit f07752806d
5 changed files with 86 additions and 12 deletions

View File

@@ -555,7 +555,9 @@ func (c *OrderManager) updateOrderSkuOtherInfo(order *model.GoodsOrder, db *dao.
}
v.SkuName = jxutils.ComposeSkuNameOriginal(skuBindInfo.Prefix, skuBindInfo.Name, skuBindInfo.Comment, skuBindInfo.Unit, skuBindInfo.SpecQuality, skuBindInfo.SpecUnit, 0)
v.Weight = skuBindInfo.Weight // 以本地信息中的WEIGHT为准
v.Upc = skuBindInfo.Upc
if v.Upc == "" {
v.Upc = skuBindInfo.Upc
}
//饿鲜达的订单做一下处理
if strings.Contains(order.StoreName, model.ExdStoreName) {
if v.SkuID == 0 && !strings.Contains(v.SkuName, "免费") {
@@ -2312,3 +2314,24 @@ func BuildFakeMatterOrder() {
tasksch.HandleTask(task, nil, true).Run()
task.GetResult(0)
}
func ExportOrderWithSku(ctx *jxcontext.Context, orders []*model.GoodsOrderExt) (url string, err error) {
var (
db = dao.GetDB()
excelTitle = []string{
"门店名",
"平台名",
"下单时间",
"订单号",
"订单结算",
"商品名",
"一级分类名",
"二级分类名",
"商品报价",
"数量",
"商品结算",
"条形码",
}
)
return url, err
}

View File

@@ -1486,19 +1486,19 @@ func UpdateStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendor
delete(payload, "bussinessStatus")
var vendorOrgCode = ""
if payload["vendorOrgCode"].(string) == "" {
return 0, fmt.Errorf("平台账号不能为空")
} else {
vendorOrgCode = payload["vendorOrgCode"].(string)
}
//var vendorOrgCode = ""
//if payload["vendorOrgCode"].(string) == "" {
// return 0, fmt.Errorf("平台账号不能为空")
//} else {
// vendorOrgCode = payload["vendorOrgCode"].(string)
//}
if db == nil {
db = dao.GetDB()
}
storeMap := &model.StoreMap{
StoreID: storeID,
VendorID: vendorID,
VendorOrgCode: vendorOrgCode,
StoreID: storeID,
VendorID: vendorID,
//VendorOrgCode: vendorOrgCode,
}
storeMap.DeletedAt = utils.DefaultTimeValue
if err = dao.GetEntity(db, storeMap, model.FieldStoreID, model.FieldVendorID, "VendorOrgCode", model.FieldDeletedAt); err != nil {
@@ -1564,13 +1564,13 @@ func UpdateStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendor
num, err = dao.UpdateEntityLogicallyAndUpdateSyncStatus(db, storeMap, valid, userName, map[string]interface{}{
model.FieldStoreID: storeID,
model.FieldVendorID: vendorID,
"VendorOrgCode": vendorOrgCode,
//"VendorOrgCode": vendorOrgCode,
}, model.FieldSyncStatus, syncStatus)
} else {
num, err = dao.UpdateEntityLogically(db, storeMap, valid, userName, map[string]interface{}{
model.FieldStoreID: storeID,
model.FieldVendorID: vendorID,
"VendorOrgCode": vendorOrgCode,
//"VendorOrgCode": vendorOrgCode,
})
}
if err != nil {

View File

@@ -340,6 +340,9 @@ func Map2Order(orderData map[string]interface{}) (order *model.GoodsOrder) {
VendorPrice: utils.MustInterface2Int64(product["skuStorePrice"]),
SalePrice: utils.MustInterface2Int64(product["skuJdPrice"]),
}
if product["upcCode"] != nil && product["upcCode"].(string) != "" {
sku.Upc = product["upcCode"].(string)
}
if jdPromotionType := int(utils.MustInterface2Int64(product["promotionType"])); jdPromotionType != 0 && jdPromotionType != jdapi.PromotionTypeNormal {
sku.StoreSubName = utils.Int2Str(jdPromotionType)
}

View File

@@ -249,6 +249,9 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
VendorPrice: jxutils.StandardPrice2Int(utils.MustInterface2Float64(product["price"])),
SalePrice: jxutils.StandardPrice2Int(utils.MustInterface2Float64(product["price"])),
}
if product["upc"] != nil && product["upc"].(string) != "" {
sku.Upc = product["upc"].(string)
}
if sku.VendorSkuID == "" {
if !strings.Contains(product["app_food_code"].(string), "mtcode") {
sku.VendorSkuID = product["app_food_code"].(string)