This commit is contained in:
suyl
2021-05-24 15:25:08 +08:00
parent d986be7cad
commit c1908dcd8f
5 changed files with 98 additions and 0 deletions

View File

@@ -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
}