dyps update

This commit is contained in:
richboo111
2023-01-09 13:48:35 +08:00
22 changed files with 400 additions and 344 deletions

View File

@@ -79,7 +79,6 @@ func BatchUpdateEntityByKV(db *DaoDB, items []*KVUpdateItem) (num int64, err err
if r := recover(); r != nil {
if item != nil {
var bindID int64
globals.SugarLogger.Debugf("========item.item %s", utils.Format4Output(item.Item, false))
value := refutil.CheckAndGetStructValue(item.Item).FieldByName(model.FieldID)
if value.IsValid() {
bindID = value.Int()

View File

@@ -1037,7 +1037,6 @@ func GetOrders(db *DaoDB, ids []int64, isIncludeSku, isIncludeFake bool, fromDat
if len(vendorIDs) > 0 {
sqlWhere += " AND t1.vendor_id IN (" + GenQuestionMarks(len(vendorIDs)) + ")"
sqlParams = append(sqlParams, vendorIDs)
//globals.SugarLogger.Debugf("sqlParams vendorIDs================%d", vendorIDs)
}
}
if userID != "" {

View File

@@ -45,8 +45,21 @@ func CreateThingMap(thingId int64, vendorThingID, appOrgCode, err string, thingT
return CreateEntity(GetDB(), thingMap)
}
func UpdateThingMap(thingMap *model.ThingMap) error {
_, err := UpdateEntity(GetDB(), thingMap, "ID")
func UpdateThingMap(db *DaoDB, syncStatus int8, vendorThingId string, thingId int, vendorId int, vendorOrgCode string) error {
sql := `
UPDATE thing_map t1
SET t1.sync_status = ?,t1.vendor_thing_id = ?
WHERE t1.deleted_at = ? AND t1.thing_id = ? AND t1.vendor_id = ? AND t1.vendor_org_code = ?
`
sqlParams := []interface{}{
syncStatus,
vendorThingId,
utils.DefaultTimeValue,
thingId,
vendorId,
vendorOrgCode,
}
_, err := ExecuteSQL(db, sql, sqlParams...)
return err
}

View File

@@ -9,6 +9,12 @@ const (
ThingTypeOrder = 6 // 同步订单
)
const (
ThingTypeSyncSuccess = 0 // 主商品创建成功
ThingTypeSyncFail = 2 // 主商品创建失败
ThingTypeSyncing = 3 // 主商品创建中
)
type ThingMap struct {
ModelIDCULD