同步菜市物料到果园更新测试
This commit is contained in:
@@ -4456,8 +4456,13 @@ func SyncMatterC4ToGy(ctx *jxcontext.Context, isContinueWhenError, isAsync bool)
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
if v != nil {
|
if v != nil {
|
||||||
dao.WrapAddIDCULEntity(v, ctx.GetUserName())
|
sql := `
|
||||||
if num1, err := dao.UpdateEntity(db, v, "SpecQuality", "SpecUnit", "EclpID"); err != nil {
|
UPDATE sku SET spec_quality = ?, sepc_unit = ?, eclp_id = ?, updated_at = ?, last_operator = ?
|
||||||
|
WHERE eclp_id = ?
|
||||||
|
AND deleted_at = ?
|
||||||
|
`
|
||||||
|
sqlParams := []interface{}{v.SpecQuality, v.SpecUnit, v.EclpID, time.Now(), ctx.GetUserName(), v.EclpID, utils.DefaultTimeValue}
|
||||||
|
if num1, err := dao.ExecuteSQL(db, sql, sqlParams); err != nil {
|
||||||
dao.Rollback(db)
|
dao.Rollback(db)
|
||||||
return retVal, err
|
return retVal, err
|
||||||
} else {
|
} else {
|
||||||
@@ -4465,8 +4470,16 @@ func SyncMatterC4ToGy(ctx *jxcontext.Context, isContinueWhenError, isAsync bool)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if skuName != nil {
|
if skuName != nil {
|
||||||
dao.WrapAddIDCULEntity(skuName, ctx.GetUserName())
|
sql := `
|
||||||
if num2, err := dao.UpdateEntity(db, skuName, "Name", "Img", "Img2", "DescImg", "Unit", "CategoryID", "Price"); err != nil {
|
UPDATE sku_name a
|
||||||
|
JOIN sku b ON a.id = b.name_id
|
||||||
|
SET a.name = ?, a.img = ?, a.img2 = ?, a.desc_img = ?, a.unit = ?, a.price = ?, updated_at = ?, lase_operator = ?
|
||||||
|
WHERE b.eclp_id = ?
|
||||||
|
AND a.deleted_at = ?
|
||||||
|
`
|
||||||
|
sqlParams := []interface{}{skuName.Name, skuName.Img, skuName.Img2, skuName.DescImg, skuName.Unit, skuName.Price,
|
||||||
|
time.Now(), ctx.GetUserName(), v.EclpID, utils.DefaultTimeValue}
|
||||||
|
if num2, err := dao.ExecuteSQL(db, sql, sqlParams); err != nil {
|
||||||
dao.Rollback(db)
|
dao.Rollback(db)
|
||||||
return retVal, err
|
return retVal, err
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user