- remove fuck
This commit is contained in:
@@ -211,10 +211,10 @@ func HandleOrder4Consignee(order *model.GoodsOrder) (err error) {
|
|||||||
setUserAddress(db, user, order)
|
setUserAddress(db, user, order)
|
||||||
|
|
||||||
if user.GetID2() == "" {
|
if user.GetID2() == "" {
|
||||||
user.UserID2 = vendorUserID
|
user.UserID2 = order.VendorUserID
|
||||||
}
|
}
|
||||||
if user.GetID2() == "" {
|
if user.GetID2() == "" {
|
||||||
user.UserID2 = order.VendorUserID
|
user.UserID2 = order.VendorOrderID
|
||||||
}
|
}
|
||||||
|
|
||||||
user.Type = model.UserTypeConsumer
|
user.Type = model.UserTypeConsumer
|
||||||
|
|||||||
@@ -1028,7 +1028,7 @@ func CreateConsumerFromOrders(ctx *jxcontext.Context, vendorIDs []int, fromDate,
|
|||||||
}
|
}
|
||||||
|
|
||||||
db := dao.GetDB()
|
db := dao.GetDB()
|
||||||
rootTask := tasksch.NewParallelTask("从订单中创建消费都账户", tasksch.NewParallelConfig().SetParallelCount(1).SetIsContinueWhenError(isContinueWhenError), ctx,
|
rootTask := tasksch.NewParallelTask("从订单中创建消费者账户", tasksch.NewParallelConfig().SetParallelCount(1).SetIsContinueWhenError(isContinueWhenError), ctx,
|
||||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||||
curDate := batchItemList[0].(time.Time)
|
curDate := batchItemList[0].(time.Time)
|
||||||
sql := `
|
sql := `
|
||||||
@@ -1051,13 +1051,12 @@ func CreateConsumerFromOrders(ctx *jxcontext.Context, vendorIDs []int, fromDate,
|
|||||||
if err = dao.GetRows(db, &orderList, sql, sqlParams...); err == nil {
|
if err = dao.GetRows(db, &orderList, sql, sqlParams...); err == nil {
|
||||||
if len(orderList) > 0 {
|
if len(orderList) > 0 {
|
||||||
// 并发必须是1,否则在HandleOrder4Consignee中可能导致主键重,错误
|
// 并发必须是1,否则在HandleOrder4Consignee中可能导致主键重,错误
|
||||||
subTask := tasksch.NewParallelTask("RefreshMtpsWaybillFee", tasksch.NewParallelConfig().SetParallelCount(1).SetIsContinueWhenError(isContinueWhenError), ctx,
|
subTask := tasksch.NewParallelTask(fmt.Sprintf("处理日期:%s的订单", utils.Time2DateStr(curDate)), tasksch.NewParallelConfig().SetParallelCount(1).SetIsContinueWhenError(isContinueWhenError), ctx,
|
||||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||||
order := batchItemList[0].(*GoodsOrderWithOriginal)
|
order := batchItemList[0].(*GoodsOrderWithOriginal)
|
||||||
if isForce || order.VendorUserID == "" {
|
if isForce || order.VendorUserID == "" {
|
||||||
if handler := partner.GetPurchasePlatformFromVendorID(order.VendorID); handler != nil {
|
if handler := partner.GetPurchasePlatformFromVendorID(order.VendorID); handler != nil {
|
||||||
var order2 *model.GoodsOrder
|
var order2 *model.GoodsOrder
|
||||||
// globals.SugarLogger.Debugf("fuck:%s", order.OriginalData)
|
|
||||||
if order.OriginalData != "" {
|
if order.OriginalData != "" {
|
||||||
var orderData map[string]interface{}
|
var orderData map[string]interface{}
|
||||||
if utils.UnmarshalUseNumber([]byte(order.OriginalData), &orderData) == nil {
|
if utils.UnmarshalUseNumber([]byte(order.OriginalData), &orderData) == nil {
|
||||||
@@ -1071,12 +1070,17 @@ func CreateConsumerFromOrders(ctx *jxcontext.Context, vendorIDs []int, fromDate,
|
|||||||
order2, err = handler.GetOrder(order.VendorOrderID)
|
order2, err = handler.GetOrder(order.VendorOrderID)
|
||||||
}
|
}
|
||||||
if order2 != nil {
|
if order2 != nil {
|
||||||
isNeedUpdateOrder := order.VendorUserID != order2.VendorUserID
|
var updateFields []string
|
||||||
order.VendorUserID = order2.VendorUserID
|
if order2.VendorUserID != "" && order.VendorUserID != order2.VendorUserID {
|
||||||
if isNeedUpdateOrder {
|
updateFields = append(updateFields, "VendorUserID")
|
||||||
dao.UpdateEntity(db, &order.GoodsOrder, "VendorUserID")
|
order.VendorUserID = order2.VendorUserID
|
||||||
|
}
|
||||||
|
if err = cms.HandleOrder4Consignee(&order.GoodsOrder); err == nil {
|
||||||
|
updateFields = append(updateFields, "UserID")
|
||||||
|
}
|
||||||
|
if len(updateFields) > 0 {
|
||||||
|
dao.UpdateEntity(db, &order.GoodsOrder, updateFields...)
|
||||||
}
|
}
|
||||||
err = cms.HandleOrder4Consignee(&order.GoodsOrder)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
4
business/jxutils/cache/redis/redis_test.go
vendored
4
business/jxutils/cache/redis/redis_test.go
vendored
@@ -16,7 +16,7 @@ func init() {
|
|||||||
cacher = New("localhost", 6379, "")
|
cacher = New("localhost", 6379, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
type FuckYou struct {
|
type TestType struct {
|
||||||
Key string `json:"key"`
|
Key string `json:"key"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ func TestIt(t *testing.T) {
|
|||||||
t.Fatal("should not get nothing")
|
t.Fatal("should not get nothing")
|
||||||
}
|
}
|
||||||
|
|
||||||
result := new(FuckYou)
|
result := new(TestType)
|
||||||
cacher.GetAs("key", result)
|
cacher.GetAs("key", result)
|
||||||
if result.Key != "value" {
|
if result.Key != "value" {
|
||||||
t.Fatal("should get value")
|
t.Fatal("should get value")
|
||||||
|
|||||||
Reference in New Issue
Block a user