aa
This commit is contained in:
@@ -5734,3 +5734,29 @@ func CopyMtToJd(ctx *jxcontext.Context, mtStoreID, mtOrgCode, jdStoreID, jdOrgCo
|
||||
task.GetResult(0)
|
||||
return err
|
||||
}
|
||||
|
||||
func UpdateMtCatToJd(ctx *jxcontext.Context, mtCatID, jdCatID string) (err error) {
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
)
|
||||
list, _ := dao.GetMtJdCategoryMap(db, mtCatID, jdCatID)
|
||||
if len(list) > 0 {
|
||||
return
|
||||
}
|
||||
list2, _ := dao.GetMtJdCategoryMap(db, mtCatID, "")
|
||||
if len(list2) > 0 {
|
||||
if list2[0].JdID == jdCatID {
|
||||
return
|
||||
} else {
|
||||
list2[0].JdID = jdCatID
|
||||
dao.UpdateEntity(db, list2[0], "JdID")
|
||||
}
|
||||
} else {
|
||||
catMap := &model.MtJdCategoryMap{
|
||||
MtID: mtCatID,
|
||||
JdID: jdCatID,
|
||||
}
|
||||
dao.CreateEntity(db, catMap)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user