同步菜市物料到果园更新测试
This commit is contained in:
@@ -4332,9 +4332,6 @@ func SyncMatterC4ToGy(ctx *jxcontext.Context, isContinueWhenError, isAsync bool)
|
||||
updateMatters = append(updateMatters, skusMap[c4.EclpID])
|
||||
}
|
||||
}
|
||||
fmt.Println("deleteMatters", utils.Format4Output(deleteMatters, false))
|
||||
fmt.Println("addMatters", utils.Format4Output(addMatters, false))
|
||||
fmt.Println("updateMatters", utils.Format4Output(updateMatters, false))
|
||||
case 1:
|
||||
if len(deleteMatters) > 0 {
|
||||
for _, v := range deleteMatters {
|
||||
@@ -4412,8 +4409,9 @@ func SyncMatterC4ToGy(ctx *jxcontext.Context, isContinueWhenError, isAsync bool)
|
||||
WHERE a.sku_id = b.id
|
||||
AND a.store_id = ?
|
||||
AND b.eclp_id = ?
|
||||
AND a.deleted_at = ?
|
||||
`
|
||||
sqlParams2 := []interface{}{model.MatterStoreID, v.EclpID}
|
||||
sqlParams2 := []interface{}{model.MatterStoreID, v.EclpID, utils.DefaultTimeValue}
|
||||
err = dao.GetRows(db, &storeSkus, sql, sqlParams2)
|
||||
if err != nil {
|
||||
return retVal, err
|
||||
@@ -4440,11 +4438,12 @@ func SyncMatterC4ToGy(ctx *jxcontext.Context, isContinueWhenError, isAsync bool)
|
||||
)
|
||||
sql := `
|
||||
SELECT t1.*
|
||||
FROM jxd_dev_0.sku_name t1
|
||||
WHERE t1.deleted_at = ?
|
||||
AND t1.id = ?
|
||||
FROM jxd_dev_0.sku_name t1, jxd_dev_0.sku t2
|
||||
WHERE t1.id = t2.name_id
|
||||
AND t1.deleted_at = ?
|
||||
AND t2.eclp_id = ?
|
||||
`
|
||||
sqlParams := []interface{}{utils.DefaultTimeValue, v.NameID}
|
||||
sqlParams := []interface{}{utils.DefaultTimeValue, v.EclpID}
|
||||
err = dao.GetRows(db, &skuNames, sql, sqlParams)
|
||||
if len(skuNames) > 0 {
|
||||
skuName = skuNames[0]
|
||||
@@ -4457,6 +4456,7 @@ func SyncMatterC4ToGy(ctx *jxcontext.Context, isContinueWhenError, isAsync bool)
|
||||
}
|
||||
}()
|
||||
if v != nil {
|
||||
fmt.Println("test111111111111111111111111111111", utils.Format4Output(v, false))
|
||||
dao.WrapAddIDCULEntity(v, ctx.GetUserName())
|
||||
if _, err = dao.UpdateEntity(db, v, "SpecQuality", "SpecUnit", "EclpID"); err != nil {
|
||||
dao.Rollback(db)
|
||||
@@ -4464,6 +4464,7 @@ func SyncMatterC4ToGy(ctx *jxcontext.Context, isContinueWhenError, isAsync bool)
|
||||
}
|
||||
}
|
||||
if skuName != nil {
|
||||
fmt.Println("test222222222222222222222222222222", utils.Format4Output(skuName, false))
|
||||
dao.WrapAddIDCULEntity(skuName, ctx.GetUserName())
|
||||
if _, err = dao.UpdateEntity(db, skuName, "Name", "Img", "Img2", "DescImg", "Unit", "CategoryID", "Price"); err != nil {
|
||||
dao.Rollback(db)
|
||||
@@ -4471,13 +4472,14 @@ func SyncMatterC4ToGy(ctx *jxcontext.Context, isContinueWhenError, isAsync bool)
|
||||
}
|
||||
}
|
||||
sql = `
|
||||
SELECT *
|
||||
SELECT a.*
|
||||
FROM jxd_dev_0.store_sku_bind a, jxd_dev_0.sku b
|
||||
WHERE a.sku_id = b.id
|
||||
AND a.store_id = ?
|
||||
AND b.eclp_id = ?
|
||||
AND a.deleted_at = ?
|
||||
`
|
||||
sqlParams2 := []interface{}{model.MatterStoreID, v.EclpID}
|
||||
sqlParams2 := []interface{}{model.MatterStoreID, v.EclpID, utils.DefaultTimeValue}
|
||||
err = dao.GetRows(db, &storeSkus, sql, sqlParams2)
|
||||
if err != nil {
|
||||
return retVal, err
|
||||
|
||||
Reference in New Issue
Block a user