添加API:cms/GetCityBankBranches
This commit is contained in:
@@ -315,3 +315,17 @@ func UpdateConfig(ctx *jxcontext.Context, key, configType, value string) (err er
|
|||||||
func QueryConfigs(key, configType, keyword string) (configList []*model.NewConfig, err error) {
|
func QueryConfigs(key, configType, keyword string) (configList []*model.NewConfig, err error) {
|
||||||
return dao.QueryConfigs(dao.GetDB(), key, configType, keyword)
|
return dao.QueryConfigs(dao.GetDB(), key, configType, keyword)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetCityBankBranches(ctx *jxcontext.Context, cityCode int, bankCode string) (info map[int]map[string][]string, err error) {
|
||||||
|
list, err := dao.GetCityBankBranches(dao.GetDB(), cityCode, bankCode)
|
||||||
|
if err == nil && len(list) > 0 {
|
||||||
|
info = make(map[int]map[string][]string)
|
||||||
|
for _, v := range list {
|
||||||
|
if info[v.CityCode] == nil {
|
||||||
|
info[v.CityCode] = make(map[string][]string)
|
||||||
|
}
|
||||||
|
info[v.CityCode][v.PayeeBankCode] = append(info[v.CityCode][v.PayeeBankCode], v.PayeeBankBranchName)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return info, err
|
||||||
|
}
|
||||||
|
|||||||
@@ -47,6 +47,12 @@ type StoreDetail2 struct {
|
|||||||
CityName string `json:"cityName"`
|
CityName string `json:"cityName"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type CityBrankBranch struct {
|
||||||
|
CityCode int
|
||||||
|
PayeeBankBranchName string `orm:"size(255)" json:"payeeBankBranchName"` // 开户支行
|
||||||
|
PayeeBankCode string `orm:"size(8)" json:"payeeBankCode"` // 开户行代码
|
||||||
|
}
|
||||||
|
|
||||||
func (s *StoreDetail) GetPricePerentage(price int) (pricePercentage int) {
|
func (s *StoreDetail) GetPricePerentage(price int) (pricePercentage int) {
|
||||||
return pricePercentage
|
return pricePercentage
|
||||||
}
|
}
|
||||||
@@ -484,3 +490,26 @@ func GetStoreList(db *DaoDB, idList []int, mobileList []string, shortRoleName st
|
|||||||
err = GetRows(db, &storeList, sql, sqlParams...)
|
err = GetRows(db, &storeList, sql, sqlParams...)
|
||||||
return storeList, err
|
return storeList, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetCityBankBranches(db *DaoDB, cityCode int, bankCode string) (list []*CityBrankBranch, err error) {
|
||||||
|
sql := `
|
||||||
|
SELECT payee_bank_code, city_code, payee_bank_branch_name
|
||||||
|
FROM store
|
||||||
|
WHERE payee_bank_branch_name <> ''`
|
||||||
|
sqlParams := []interface{}{}
|
||||||
|
if cityCode > 0 {
|
||||||
|
sql += " AND city_code = ?"
|
||||||
|
sqlParams = append(sqlParams, cityCode)
|
||||||
|
} else {
|
||||||
|
sql += " AND city_code <> 0"
|
||||||
|
}
|
||||||
|
if bankCode != "" {
|
||||||
|
sql += " AND payee_bank_code = ?"
|
||||||
|
sqlParams = append(sqlParams, bankCode)
|
||||||
|
} else {
|
||||||
|
sql += " AND payee_bank_code <> ''"
|
||||||
|
}
|
||||||
|
sql += " GROUP BY 1,2,3;"
|
||||||
|
err = GetRows(db, &list, sql, sqlParams...)
|
||||||
|
return list, err
|
||||||
|
}
|
||||||
|
|||||||
@@ -315,3 +315,18 @@ func (c *CmsController) CreateQrOrBarCode() {
|
|||||||
return retVal, "", err
|
return retVal, "", err
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @Title 查询当前系统中已有的城市中的银行支行
|
||||||
|
// @Description 查询当前系统中已有的城市中的银行支行
|
||||||
|
// @Param token header string true "认证token"
|
||||||
|
// @Param cityCode query int false "城市代码"
|
||||||
|
// @Param bankCode query string false "银行代码"
|
||||||
|
// @Success 200 {object} controllers.CallResult
|
||||||
|
// @Failure 200 {object} controllers.CallResult
|
||||||
|
// @router /GetCityBankBranches [get]
|
||||||
|
func (c *CmsController) GetCityBankBranches() {
|
||||||
|
c.callGetCityBankBranches(func(params *tCmsGetCityBankBranchesParams) (retVal interface{}, errCode string, err error) {
|
||||||
|
retVal, err = cms.GetCityBankBranches(params.Ctx, params.CityCode, params.BankCode)
|
||||||
|
return retVal, "", err
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -214,6 +214,15 @@ func init() {
|
|||||||
Filters: nil,
|
Filters: nil,
|
||||||
Params: nil})
|
Params: nil})
|
||||||
|
|
||||||
|
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"],
|
||||||
|
beego.ControllerComments{
|
||||||
|
Method: "GetCityBankBranches",
|
||||||
|
Router: `/GetCityBankBranches`,
|
||||||
|
AllowHTTPMethods: []string{"get"},
|
||||||
|
MethodParams: param.Make(),
|
||||||
|
Filters: nil,
|
||||||
|
Params: nil})
|
||||||
|
|
||||||
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"],
|
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"],
|
||||||
beego.ControllerComments{
|
beego.ControllerComments{
|
||||||
Method: "GetConfig",
|
Method: "GetConfig",
|
||||||
|
|||||||
Reference in New Issue
Block a user