Merge remote-tracking branch 'origin/mark' into su
This commit is contained in:
@@ -1066,7 +1066,7 @@ func (c *OrderManager) AmendMissingOrders(ctx *jxcontext.Context, vendorIDs []in
|
|||||||
if err = err2; err == nil {
|
if err = err2; err == nil {
|
||||||
if model.IsOrderFinalStatus(order.Status) {
|
if model.IsOrderFinalStatus(order.Status) {
|
||||||
goodsOrder.Status = order.Status
|
goodsOrder.Status = order.Status
|
||||||
goodsOrder.OrderFinishedAt = order.OrderFinishedAt
|
goodsOrder.OrderFinishedAt = order.StatusTime
|
||||||
_, err = dao.UpdateEntity(db, goodsOrder, "Status", "OrderFinishedAt")
|
_, err = dao.UpdateEntity(db, goodsOrder, "Status", "OrderFinishedAt")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,6 +150,11 @@ func UpdateCategory(ctx *jxcontext.Context, categoryID int, payload map[string]i
|
|||||||
if err = dao.GetEntity(db, cat); err != nil {
|
if err = dao.GetEntity(db, cat); err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
for k, v := range payload {
|
||||||
|
if v == nil {
|
||||||
|
delete(payload, k)
|
||||||
|
}
|
||||||
|
}
|
||||||
valid := dao.StrictMakeMapByStructObject(payload, cat, userName)
|
valid := dao.StrictMakeMapByStructObject(payload, cat, userName)
|
||||||
if len(valid) > 0 {
|
if len(valid) > 0 {
|
||||||
// syncStatus := 0
|
// syncStatus := 0
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ func excel2FakeJdThingMap(ctx *jxcontext.Context, reader io.Reader) (thingMapLis
|
|||||||
for rowNum, row := range rows {
|
for rowNum, row := range rows {
|
||||||
thingMap := &model.FakeJdThingMap{
|
thingMap := &model.FakeJdThingMap{
|
||||||
JxID: int(utils.Str2Int64WithDefault(row[0], 0)),
|
JxID: int(utils.Str2Int64WithDefault(row[0], 0)),
|
||||||
JdID: utils.Str2Int64WithDefault(row[0], 0),
|
JdID: utils.Str2Int64WithDefault(row[1], 0),
|
||||||
}
|
}
|
||||||
if thingMap.JxID == 0 || thingMap.JdID == 0 {
|
if thingMap.JxID == 0 || thingMap.JdID == 0 {
|
||||||
if rowNum == 0 {
|
if rowNum == 0 {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ func TestSyncStoreSku4FakeJD(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestUploadFakeJdThingMap(t *testing.T) {
|
func TestUploadFakeJdThingMap(t *testing.T) {
|
||||||
file, err := os.Open("/Users/xujianhua/Downloads/thingmap.xlsx")
|
file, err := os.Open("/Users/xujianhua/Downloads/到家菜市门店与商品映射信息(1).xlsx")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
|
|||||||
OrderSeq: int(utils.ForceInterface2Int64(orderMap["order_index"])),
|
OrderSeq: int(utils.ForceInterface2Int64(orderMap["order_index"])),
|
||||||
StatusTime: getTimeFromInterface(orderMap["create_time"]),
|
StatusTime: getTimeFromInterface(orderMap["create_time"]),
|
||||||
OrderCreatedAt: getTimeFromInterface(orderMap["create_time"]),
|
OrderCreatedAt: getTimeFromInterface(orderMap["create_time"]),
|
||||||
OrderFinishedAt: getTimeFromInterface(orderMap["finished_time"]),
|
// OrderFinishedAt: getTimeFromInterface(orderMap["finished_time"]),
|
||||||
OriginalData: string(utils.MustMarshal(result)),
|
OriginalData: string(utils.MustMarshal(result)),
|
||||||
ActualPayPrice: utils.ForceInterface2Int64(orderMap["user_fee"]),
|
ActualPayPrice: utils.ForceInterface2Int64(orderMap["user_fee"]),
|
||||||
BaseFreightMoney: utils.ForceInterface2Int64(orderMap["send_fee"]),
|
BaseFreightMoney: utils.ForceInterface2Int64(orderMap["send_fee"]),
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ func (c *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
|
|||||||
OrderSeq: int(utils.MustInterface2Int64(result["orderNum"])),
|
OrderSeq: int(utils.MustInterface2Int64(result["orderNum"])),
|
||||||
StatusTime: utils.Str2Time(result[statusTimeField].(string)),
|
StatusTime: utils.Str2Time(result[statusTimeField].(string)),
|
||||||
OrderCreatedAt: utils.Str2Time(result[statusTimeField].(string)),
|
OrderCreatedAt: utils.Str2Time(result[statusTimeField].(string)),
|
||||||
OrderFinishedAt: utils.Str2Time(result["orderStatusTime"].(string)),
|
// OrderFinishedAt: utils.Str2Time(result["orderStatusTime"].(string)),
|
||||||
OriginalData: string(utils.MustMarshal(result)),
|
OriginalData: string(utils.MustMarshal(result)),
|
||||||
ActualPayPrice: utils.MustInterface2Int64(result["orderBuyerPayableMoney"]),
|
ActualPayPrice: utils.MustInterface2Int64(result["orderBuyerPayableMoney"]),
|
||||||
BaseFreightMoney: utils.Interface2Int64WithDefault(result["orderBaseFreightMoney"], 0),
|
BaseFreightMoney: utils.Interface2Int64WithDefault(result["orderBaseFreightMoney"], 0),
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
|
|||||||
OrderSeq: int(utils.MustInterface2Int64(result["day_seq"])),
|
OrderSeq: int(utils.MustInterface2Int64(result["day_seq"])),
|
||||||
StatusTime: getTimeFromTimestamp(utils.MustInterface2Int64(result["ctime"])),
|
StatusTime: getTimeFromTimestamp(utils.MustInterface2Int64(result["ctime"])),
|
||||||
OrderCreatedAt: getTimeFromTimestamp(utils.MustInterface2Int64(result["ctime"])),
|
OrderCreatedAt: getTimeFromTimestamp(utils.MustInterface2Int64(result["ctime"])),
|
||||||
OrderFinishedAt: getTimeFromTimestamp(utils.MustInterface2Int64(result["order_completed_time"])),
|
// OrderFinishedAt: getTimeFromTimestamp(utils.MustInterface2Int64(result["order_completed_time"])),
|
||||||
OriginalData: string(utils.MustMarshal(result)),
|
OriginalData: string(utils.MustMarshal(result)),
|
||||||
ActualPayPrice: jxutils.StandardPrice2Int(utils.MustInterface2Float64(result["total"])),
|
ActualPayPrice: jxutils.StandardPrice2Int(utils.MustInterface2Float64(result["total"])),
|
||||||
BaseFreightMoney: jxutils.StandardPrice2Int(utils.Interface2Float64WithDefault(result["shipping_fee"], 0)),
|
BaseFreightMoney: jxutils.StandardPrice2Int(utils.Interface2Float64WithDefault(result["shipping_fee"], 0)),
|
||||||
|
|||||||
Reference in New Issue
Block a user