|
@@ -5,6 +5,7 @@ import (
|
|
|
"github.com/rdlucklib/rdluck_tools/paging"
|
|
|
sealReq "hongze/hongze_mobile_admin/models/request/seal"
|
|
|
sealResp "hongze/hongze_mobile_admin/models/response/seal"
|
|
|
+ "hongze/hongze_mobile_admin/models/tables/company"
|
|
|
"hongze/hongze_mobile_admin/models/tables/seal"
|
|
|
contractService "hongze/hongze_mobile_admin/services/contract"
|
|
|
sealService "hongze/hongze_mobile_admin/services/seal"
|
|
@@ -433,3 +434,44 @@ func (c *SealCommon) CompanyList() {
|
|
|
|
|
|
c.OkDetailed(companyNameList, "获取成功")
|
|
|
}
|
|
|
+
|
|
|
+// CompanyNameList
|
|
|
+// @Title 根据客户名称关键词获取系统中的客户名称列表
|
|
|
+// @Description 获取客户名称列表
|
|
|
+// @Param Keyword query string true "客户名称关键词"
|
|
|
+// @Param PageSize query int true "每页数据量"
|
|
|
+// @Param CurrentIndex query int true "页码"
|
|
|
+// @Success 200 {object} []company.CompanyNameList
|
|
|
+// @router /company_name_list [get]
|
|
|
+func (c *SealCommon) CompanyNameList() {
|
|
|
+ keyword := c.GetString("Keyword")
|
|
|
+ pageSize, _ := c.GetInt("PageSize")
|
|
|
+ currentIndex, _ := c.GetInt("CurrentIndex")
|
|
|
+
|
|
|
+ if keyword == "" {
|
|
|
+ c.FailWithMessage("关键词不能为空", "关键词不能为空")
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ var startSize int
|
|
|
+ if pageSize <= 0 {
|
|
|
+ pageSize = utils.PageSize20
|
|
|
+ }
|
|
|
+ if currentIndex <= 0 {
|
|
|
+ currentIndex = 1
|
|
|
+ }
|
|
|
+ startSize = paging.StartIndex(currentIndex, pageSize)
|
|
|
+
|
|
|
+ keyword = "%" + keyword + "%"
|
|
|
+ condition := " AND company_name LIKE ? "
|
|
|
+ pars := make([]interface{}, 0)
|
|
|
+ pars = append(pars, keyword)
|
|
|
+
|
|
|
+ list, err := company.GetCompanyNameList(condition, pars, startSize, pageSize)
|
|
|
+ if err != nil {
|
|
|
+ c.FailWithMessage("获取客户名称列表失败!", "获取客户名称列表失败,ERR:"+err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ c.OkDetailed(list, "获取成功")
|
|
|
+}
|