+ Store添加OperatorRole2,Store.PrinterFontSize

This commit is contained in:
gazebo
2019-08-19 09:40:27 +08:00
parent 93a3022925
commit 1f2c9ae48f
4 changed files with 11 additions and 7 deletions

View File

@@ -534,7 +534,7 @@ func UpdateStore(ctx *jxcontext.Context, storeID int, payload map[string]interfa
valid := dao.StrictMakeMapByStructObject(payload, store, userName)
if globals.EnableWXAuth2 {
if err = dao.ValidateRoles(db, utils.Interface2String(valid["marketManRole"]), utils.Interface2String(valid["OperatorRole"])); err != nil {
if err = dao.ValidateRoles(db, utils.Interface2String(valid["marketManRole"]), utils.Interface2String(valid["operatorRole"]), utils.Interface2String(valid["operatorRole2"])); err != nil {
return 0, err
}
}
@@ -716,7 +716,7 @@ func CreateStore(ctx *jxcontext.Context, storeExt *StoreExt, userName string) (i
}
db := dao.GetDB()
if globals.EnableWXAuth2 {
if err = dao.ValidateRoles(db, store.MarketManRole, store.OperatorRole); err != nil {
if err = dao.ValidateRoles(db, store.MarketManRole, store.OperatorRole, store.OperatorRole2); err != nil {
return 0, err
}
}

View File

@@ -168,8 +168,9 @@ func GetStoreListByMobileOrStoreIDs(db *DaoDB, mobile string, shortRoleNameList
sqlParams = append(sqlParams, mobile, mobile)
}
if len(shortRoleNameList) > 0 {
sql += " OR t1.market_man_role IN (" + GenQuestionMarks(len(shortRoleNameList)) + ") OR t1.operator_role IN (" + GenQuestionMarks(len(shortRoleNameList)) + ")"
sqlParams = append(sqlParams, shortRoleNameList, shortRoleNameList)
questionMarks := GenQuestionMarks(len(shortRoleNameList))
sql += " OR t1.market_man_role IN (" + questionMarks + ") OR t1.operator_role IN (" + questionMarks + ") OR t1.operator_role2 IN (" + questionMarks + ")"
sqlParams = append(sqlParams, shortRoleNameList, shortRoleNameList, shortRoleNameList)
}
if len(storeIDs) > 0 {
sql += " OR t1.id IN (" + GenQuestionMarks(len(storeIDs)) + ")"

View File

@@ -435,11 +435,12 @@ func GetStoreList4Role(db *DaoDB, shortRoleName string) (storeList []*model.Stor
sql := `
SELECT t1.*
FROM store t1
WHERE t1.deleted_at = ? AND (t1.market_man_role = ? OR t1.operator_role = ?)`
WHERE t1.deleted_at = ? AND (t1.market_man_role = ? OR t1.operator_role = ? OR t1.operator_role2 = ?)`
sqlParams := []interface{}{
utils.DefaultTimeValue,
shortRoleName,
shortRoleName,
shortRoleName,
}
err = GetRows(db, &storeList, sql, sqlParams...)
return storeList, err

View File

@@ -256,6 +256,7 @@ type Store struct {
ChangePriceType int8 `json:"changePriceType"` // 修改价格类型,即是否需要审核
PrinterDisabled int8 `orm:"default(0)" json:"printerDisabled"` // 是否禁用网络打印机
PrinterFontSize int8 `orm:"default(0)" json:"printerFontSize"` // 打印字体-10正常1
PrinterVendorID int `orm:"column(printer_vendor_id);" json:"printerVendorID"`
PrinterSN string `orm:"size(32);column(printer_sn);index" json:"printerSN"`
PrinterKey string `orm:"size(64)" json:"printerKey"`
@@ -299,7 +300,8 @@ type Store struct {
OperatorName string `orm:"size(8)" json:"operatorName"` // 运营人姓名
OperatorPhone string `orm:"size(16)" json:"operatorPhone"` // 运营人电话
OperatorRole string `orm:"size(32)" json:"operatorRole"` // 运营人组(角色)
OperatorRole string `orm:"size(32)" json:"operatorRole"` // 京东运营人组(角色)
OperatorRole2 string `orm:"size(32)" json:"operatorRole2"` // 非京东运营人组(角色)
}
func (*Store) TableUnique() [][]string {
@@ -309,7 +311,7 @@ func (*Store) TableUnique() [][]string {
}
func (s *Store) IsPrinterDisabled() bool {
return s.PrinterDisabled != 0
return s.PrinterDisabled == 1
}
func (s *Store) GetOpTimeList() (opTimeList []int16) {