You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
2.3 KiB

package BaseGlobalService
import (
"dsBaseWeb/Business/BaseGlobal/BaseGlobalProto"
"strings"
)
func AddGlobalInfo(globalTypeId int, globalCode string, globalValue string, globalRemarks string, sortId int32, actionPersonId string, actionIpAddress string) (*BaseGlobalProto.Reply, error) {
Reply, err := AddBaseGlobal(BaseGlobalProto.ModelArg{GlobalTypeId: int32(globalTypeId), GlobalCode: globalCode, GlobalValue: globalValue, GlobalRemarks: globalRemarks, SortId: sortId, BUse: 1, ActionPersonId: actionPersonId, ActionIpAddress: actionIpAddress})
return Reply, err
}
func DeleteGlobalInfo(ids string, actionPersonId string, actionIpAddress string) (*BaseGlobalProto.Reply, error) {
idsArr := strings.Split(ids, ",")
Reply, err := DeleteBaseGlobal(BaseGlobalProto.DeleteIdsArg{Ids: idsArr, ActionPersonId: actionPersonId, ActionIpAddress: actionIpAddress})
return Reply, err
}
func UpdateGlobalInfo(globalId string, globalTypeId int32, globalCode string, globalValue string, globalRemarks string, sortId int32, actionPersonId string, actionIpAddress string) (*BaseGlobalProto.Reply, error) {
forceUpdateFields := []string{"global_remarks"}
Reply, err := UpdateBaseGlobal(BaseGlobalProto.ModelArg{GlobalId: globalId, GlobalTypeId: globalTypeId, GlobalCode: globalCode, GlobalValue: globalValue, GlobalRemarks: globalRemarks, SortId: sortId, ActionPersonId: actionPersonId, ActionIpAddress: actionIpAddress, ForceUpdateFields: forceUpdateFields})
return Reply, err
}
func PageGlobalInfo(page int32, limit int32, globalTypeId int32, actionPersonId string, actionIpAddress string) (*BaseGlobalProto.Reply, error) {
Reply, err := PageBaseGlobal(BaseGlobalProto.QueryArg{Page: page, Limit: limit, GlobalTypeId: globalTypeId, ActionPersonId: actionPersonId, ActionIpAddress: actionIpAddress})
return Reply, err
}
func GetGlobalInfo(globalId string, actionPersonId string, actionIpAddress string) (*BaseGlobalProto.Reply, error) {
Reply, err := GetBaseGlobal(BaseGlobalProto.ModelArg{GlobalId: globalId, ActionPersonId: actionPersonId, ActionIpAddress: actionIpAddress})
return Reply, err
}
func GetGlobalValueByCodes(codes string) (*BaseGlobalProto.Reply, error) {
idsArr := strings.Split(codes, ",")
Reply, err := GetBaseGlobalByCodes(BaseGlobalProto.GlobalCodesArg{GlobalCodes: idsArr})
return Reply, err
}