瀏覽代碼

后端: 供方信息查询导出表在后台实现

baichengfei 4 年之前
父節點
當前提交
3a8968a4ec

+ 66 - 24
src/dashoo.cn/backend/api/business/oilsupplier/selectbusiness/selectservice.go

@@ -21,7 +21,7 @@ func GetSelectService(xormEngine *xorm.Engine) *SelectService {
 }
 
 func (s *SelectService) GetMyPagingEntitiesWithOrderBytbl(supplierTableName, supplierCertTableName, OilInfoChangeName, OilCorporateInfoName, OilSupplierCertSubName,
-	OilSupplierFileName string, pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where,having, CerSubName string, Ids string, NeedFileType string) (total int64) {
+	OilSupplierFileName string, pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where, having, CerSubName string, Ids string, NeedFileType string) (total int64) {
 
 	//获取总记录数
 	/*sqlCount := `select count(*) from (`
@@ -69,6 +69,50 @@ func (s *SelectService) GetMyPagingEntitiesWithOrderBytbl(supplierTableName, sup
 	}
 	sql += ` limit ` + utils.ToStr((pageIndex-1)*itemsPerPage) + "," + utils.ToStr(itemsPerPage)
 
+	sqlCount := "SELECT FOUND_ROWS() as total"
+
+	var totalResult TotalResult
+	session := s.DBE.NewSession()
+	session.Begin()
+	session.SQL(sql).Find(entitiesPtr)
+	session.SQL(sqlCount).Get(&totalResult)
+	session.Commit()
+	total = totalResult.Total
+
+	return total
+}
+
+func (s *SelectService) GetMyPagingEntitiesWithOrderBytblForExport(supplierTableName, supplierCertTableName, OilInfoChangeName, OilCorporateInfoName, OilSupplierCertSubName,
+	OilSupplierFileName string, pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where, having, CerSubName string, Ids string, NeedFileType string) (total int64) {
+
+	// TODO 推荐单位不从供方注册表取
+	var sql string
+	sql = `select SQL_CALC_FOUND_ROWS a.Id,a.SupplierName,b.AccessCardNo, a.OldSupplierName, b.SupplierTypeCode, b.CreateOn as CreateOn, `
+	sql += `a.LegalPerson,a.RegCapital,a.Mobile,b.AuditDate,b.ApplyTime,b.EffectEndTime,b.InFlag,a.ContactName,a.CommercialNo, `
+	sql += `a.DepositBank,a.HseTraining,a.CompanyType,a.SetupTime,a.Address,a.Province,a.City,a.Street, a.Grade, a.OperType, `
+	sql += `a.LinkAddress,a.LinkProvince,a.LinkCity,a.LinkStreet,a.BusinessScope, `
+	sql += `b.InStyle, b.Id CertId, f.FullName, b.RecUnitName as CheckUnitName, b.Remark `
+	sql += `,group_concat(distinct e.NeedFileType) NeedFileType `
+	sql += `from ` + supplierTableName + ` a `
+	sql += `left join ` + supplierCertTableName + ` b on b.SupplierId = a.Id `
+	sql += `left join  Base_Organize f on f.Id = b.ThirdAudit `
+	// sql += `left join  OilCorporateInfo g on g.CommercialNo = a.CommercialNo `
+	// sql += `left join ` + OilInfoChangeName + ` c  on c.SupplierId = a.Id `
+	sql += `left join ` + OilSupplierFileName + ` e  on e.SupplierId = a.Id `
+
+	sql += `where ` + where
+
+	if CerSubName != "" && Ids != "" {
+		sql += " and b.Id in (" + Ids + ")"
+	}
+
+	sql += ` group by a.Id,b.Id ` + having
+	if asc {
+		sql += ` order by ` + orderby + ` ASC `
+	} else {
+		sql += ` order by ` + orderby + ` DESC `
+	}
+	sql += ` limit ` + utils.ToStr((pageIndex-1)*itemsPerPage) + "," + utils.ToStr(itemsPerPage)
 
 	sqlCount := "SELECT FOUND_ROWS() as total"
 
@@ -83,13 +127,12 @@ func (s *SelectService) GetMyPagingEntitiesWithOrderBytbl(supplierTableName, sup
 	return total
 }
 
-func (s *SelectService) GetUp( supplierCertTableName string, pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where string) (total int64) {
+func (s *SelectService) GetUp(supplierCertTableName string, pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where string) (total int64) {
 	var resultsSlice []map[string][]byte
 
-
 	var sql string
 	sql = `  select (select FullName from Base_Organize where Id = a.CommitComId) FullName,max(a.CommitComId) CommitComId,a.SupplierTypeName,`
-	sql +=`  count(a.Status>=6 or null ) HeGe,count(a.Status=-5 or null ) BuHeGe,count(a.Status=-5 or null ) + count(a.Status>=6 or null ) ZongShu,GROUP_CONCAT(a.BackReason SEPARATOR ';') Reason  `
+	sql += `  count(a.Status>=6 or null ) HeGe,count(a.Status=-5 or null ) BuHeGe,count(a.Status=-5 or null ) + count(a.Status>=6 or null ) ZongShu,GROUP_CONCAT(a.BackReason SEPARATOR ';') Reason  `
 	sql += ` from ` + supplierCertTableName + ` a `
 	sql += ` where a.CommitComId is not null and  a.CommitComId!="" and  a.CommitComId!=0 ` + where
 	sql += ` group by FullName,SupplierTypeName `
@@ -100,13 +143,11 @@ func (s *SelectService) GetUp( supplierCertTableName string, pageIndex, itemsPer
 		sql += ` order by ` + orderby + ` DESC `
 	}
 	//获取总记录数
-	sqlCount := `select count(*) from (` + sql+ `) a `
+	sqlCount := `select count(*) from (` + sql + `) a `
 
 	sql += ` limit ` + utils.ToStr((pageIndex-1)*itemsPerPage) + "," + utils.ToStr(itemsPerPage)
 	s.DBE.SQL(sql).Find(entitiesPtr)
 
-
-
 	resultsSlice, _ = s.DBE.Query(sqlCount)
 
 	if len(resultsSlice) > 0 {
@@ -119,59 +160,60 @@ func (s *SelectService) GetUp( supplierCertTableName string, pageIndex, itemsPer
 
 	return total
 }
-func (s *SelectService) GetTotalInMonth( orderby string, asc bool, entitiesTotal interface{}, where string) (total int64) {
+func (s *SelectService) GetTotalInMonth(orderby string, asc bool, entitiesTotal interface{}, where string) (total int64) {
 	var resultsSlice []map[string][]byte
 	endtime, _ := strconv.Atoi(where)
 	if endtime == 0 {
 		endtime = 5000
-	}else {
-	endtime = endtime+1}
+	} else {
+		endtime = endtime + 1
+	}
 	timedone := strconv.Itoa(endtime)
 	var sql string
 	sql = `(SELECT AnnualAudit.Month,AnnualAudit,Store,Append,InfoChange,CatalogSelf,CatalogWin,CatalogTrade,CatalogComp,CatalogSpe FROM(
 SELECT  b.Month,a.AnnualAudit from (select extract(month from ApplyTime) time ,COUNT(*) AnnualAudit
 			from OilAnnualAudit
-			WHERE ApplyTime >= '` + where +`' AND ApplyTime < '` + timedone +`' AND Status = '11'
+			WHERE ApplyTime >= '` + where + `' AND ApplyTime < '` + timedone + `' AND Status = '11'
 			group by extract(month from ApplyTime)) a 
 			RIGHT JOIN OilCountMonth b ON b.Month = a.time) AnnualAudit
 LEFT JOIN (SELECT  b.Month,a.Store from (select extract(month from StorageOn) time ,COUNT(*) Store
 			from OilSupplierCert
-			WHERE StorageOn >= '` + where +`' AND StorageOn < '` + timedone +`' AND InFlag = '1'
+			WHERE StorageOn >= '` + where + `' AND StorageOn < '` + timedone + `' AND InFlag = '1'
 			group by extract(month from StorageOn)) a 
 			RIGHT JOIN OilCountMonth b ON b.Month = a.time) Store ON AnnualAudit.Month = Store.Month
 LEFT JOIN (SELECT  b.Month,a.Append from (select extract(month from ApplyDate) time ,COUNT(*) Append
 			from OilSupplierCertAppend
-			WHERE ApplyDate >= '` + where +`' AND ApplyDate < '` + timedone +`' AND Status = '11'
+			WHERE ApplyDate >= '` + where + `' AND ApplyDate < '` + timedone + `' AND Status = '11'
 			group by extract(month from ApplyDate)) a 
 			RIGHT JOIN OilCountMonth b ON b.Month = a.time) Append ON AnnualAudit.Month = Append.Month
 LEFT JOIN (SELECT  b.Month,a.InfoChange from (select extract(month from CreateOn) time ,COUNT(*) InfoChange
 			from OilInfoChange
-			WHERE CreateOn >= '` + where +`' AND CreateOn < '` + timedone +`' AND Status = '11'
+			WHERE CreateOn >= '` + where + `' AND CreateOn < '` + timedone + `' AND Status = '11'
 			group by extract(month from CreateOn)) a 
 			RIGHT JOIN OilCountMonth b ON b.Month = a.time) InfoChange ON AnnualAudit.Month = InfoChange.Month
 LEFT JOIN (SELECT  b.Month,a.CatalogSelf from (select extract(month from CreateOn) time ,COUNT(*) CatalogSelf
 			from OilCatalog
-			WHERE CreateOn >= '` + where +`' AND CreateOn < '` + timedone +`' AND CatalogType=1 
+			WHERE CreateOn >= '` + where + `' AND CreateOn < '` + timedone + `' AND CatalogType=1 
 			group by extract(month from CreateOn)) a 
 			RIGHT JOIN OilCountMonth b ON b.Month = a.time) CatalogSelf ON AnnualAudit.Month = CatalogSelf.Month
 LEFT JOIN (SELECT  b.Month,a.CatalogWin from (select extract(month from CreateOn) time ,COUNT(*) CatalogWin
 			from OilCatalog
-			WHERE CreateOn >= '` + where +`' AND CreateOn < '` + timedone +`' AND CatalogType=2 
+			WHERE CreateOn >= '` + where + `' AND CreateOn < '` + timedone + `' AND CatalogType=2 
 			group by extract(month from CreateOn)) a 
 			RIGHT JOIN OilCountMonth b ON b.Month = a.time) CatalogWin ON AnnualAudit.Month = CatalogWin.Month
 LEFT JOIN (SELECT  b.Month,a.CatalogTrade from (select extract(month from CreateOn) time ,COUNT(*) CatalogTrade
 			from OilCatalog
-			WHERE CreateOn >= '` + where +`' AND CreateOn < '` + timedone +`' AND CatalogType=3 
+			WHERE CreateOn >= '` + where + `' AND CreateOn < '` + timedone + `' AND CatalogType=3 
 			group by extract(month from CreateOn)) a 
 			RIGHT JOIN OilCountMonth b ON b.Month = a.time) CatalogTrade ON AnnualAudit.Month = CatalogTrade.Month
 LEFT JOIN (SELECT  b.Month,a.CatalogComp from (select extract(month from CreateOn) time ,COUNT(*) CatalogComp
 			from OilCatalog
-			WHERE CreateOn >= '` + where +`' AND CreateOn < '` + timedone +`' AND CatalogType=4 
+			WHERE CreateOn >= '` + where + `' AND CreateOn < '` + timedone + `' AND CatalogType=4 
 			group by extract(month from CreateOn)) a 
 			RIGHT JOIN OilCountMonth b ON b.Month = a.time) CatalogComp ON AnnualAudit.Month = CatalogComp.Month
 LEFT JOIN (SELECT  b.Month,a.CatalogSpe from (select extract(month from CreateOn) time ,COUNT(*) CatalogSpe
 			from OilCatalog
-			WHERE CreateOn >= '` + where +`' AND CreateOn < '` + timedone +`' AND CatalogType=5 
+			WHERE CreateOn >= '` + where + `' AND CreateOn < '` + timedone + `' AND CatalogType=5 
 			group by extract(month from CreateOn)) a 
 			RIGHT JOIN OilCountMonth b ON b.Month = a.time) CatalogSpe ON AnnualAudit.Month = CatalogSpe.Month ORDER BY AnnualAudit.Month) `
 
@@ -194,9 +236,9 @@ LEFT JOIN (SELECT  b.Month,a.CatalogSpe from (select extract(month from CreateOn
 
 //获取公司信息和准入范围
 
-func (s *SelectService) GetInfoByCompId(where string,entitiesPtr interface{}) (total int64) {
+func (s *SelectService) GetInfoByCompId(where string, entitiesPtr interface{}) (total int64) {
 	var sql string
-	sql = `SELECT a.* from OilSupplier a `+ where
+	sql = `SELECT a.* from OilSupplier a ` + where
 
 	var totalResult TotalResult
 	session := s.DBE.NewSession()
@@ -209,10 +251,10 @@ func (s *SelectService) GetInfoByCompId(where string,entitiesPtr interface{}) (t
 	return total
 }
 
-func (s *SelectService) Getoilsuppliercertsub( tableName, where string, entitiesPtr interface{}) error {
+func (s *SelectService) Getoilsuppliercertsub(tableName, where string, entitiesPtr interface{}) error {
 	var sql string
-	sql = `SELECT a.* from `+ tableName +` a `+ where
+	sql = `SELECT a.* from ` + tableName + ` a ` + where
 
 	err := s.DBE.SQL(sql).Find(entitiesPtr)
 	return err
-}
+}

+ 23 - 20
src/dashoo.cn/backend/api/business/oilsupplier/supplier/oilsupplier.go

@@ -156,7 +156,7 @@ type OilSupplier1 struct {
 	ModifiedBy          string    `xorm:"VARCHAR(50)"`
 	PACNumber           string    `xorm:"comment('中石油准入证编号') VARCHAR(50)"`
 	SupplierCertificate string    `xorm:"comment('中石油物资供应商证书') VARCHAR(200)"`
-	CodeName			string
+	CodeName            string
 }
 
 type Del_OilSupplier struct {
@@ -287,12 +287,12 @@ type OilSupplierView struct {
 	AuditIndex        int       `xorm:"INT(10)"`
 	ProcessKey        string    `xorm:"VARCHAR(255)"`
 	BackRemark        string    `xorm:"VARCHAR(255)"`
-	Remark        	  string    `xorm:"VARCHAR(255)"`
-	Remark1        	  string    `xorm:"VARCHAR(255)"`
+	Remark            string    `xorm:"VARCHAR(255)"`
+	Remark1           string    `xorm:"VARCHAR(255)"`
 }
 
 type OilSupplierView1 struct {
-	OilSupplier1       `xorm:"extends"`
+	OilSupplier1      `xorm:"extends"`
 	CertId            string
 	AccessCardNo      string
 	SupplierTypeCode  string
@@ -342,8 +342,8 @@ type OilSupplierView1 struct {
 	AuditIndex        int       `xorm:"INT(10)"`
 	ProcessKey        string    `xorm:"VARCHAR(255)"`
 	BackRemark        string    `xorm:"VARCHAR(255)"`
-	Remark        	  string    `xorm:"VARCHAR(255)"`
-	Remark1        	  string    `xorm:"VARCHAR(255)"`
+	Remark            string    `xorm:"VARCHAR(255)"`
+	Remark1           string    `xorm:"VARCHAR(255)"`
 }
 
 type OilSupplierSelect struct {
@@ -353,6 +353,8 @@ type OilSupplierSelect struct {
 	SupplierName     string    //企业名称
 	OldSupplierName  string    //企业曾用名
 	SupplierTypeCode string    //准入类别编号
+	Grade            string    //级别
+	OperType         string    //供应商类型
 	LegalPerson      string    //法定代表人姓名
 	RegCapital       float64   //注册资本
 	Mobile           string    //移动电话
@@ -380,6 +382,7 @@ type OilSupplierSelect struct {
 	InStyle          string    //准入方式
 	FullName         string    //专业科室审批
 	CheckUnitName    string    //推荐单位
+	CreateOn         time.Time //申请时间
 	Remark           string
 }
 
@@ -529,8 +532,8 @@ type ManualDelete struct {
 }
 
 type TmpZcgf struct {
-	Sub      string
-	Code      string
+	Sub  string
+	Code string
 }
 
 type ExpireFileList struct {
@@ -637,21 +640,21 @@ type OilSupplierInte struct {
 }
 
 type OilCertIds struct {
-	Ids 		string
+	Ids string
 }
 
 type OilSupplierOldName struct {
-	Id                  int       `xorm:"not null pk autoincr INT(11)"`
-	Name        		string    `xorm:"comment('企业名称') VARCHAR(255)"`
-	OldName        		string    `xorm:"comment('曾用名') VARCHAR(255)"`
-	SupplierId     		int    `xorm:" INT(11)"`
-	GfId    			int    `xorm:" INT(11)"`
-	CreateOn            time.Time `xorm:"DATETIME"`
-	CreateUserId        int       `xorm:"INT(10)"`
-	CreateBy            string    `xorm:"VARCHAR(50)"`
-	ModifiedOn          time.Time `xorm:"DATETIME"`
-	ModifiedUserId      int       `xorm:"INT(10)"`
-	ModifiedBy          string    `xorm:"VARCHAR(50)"`
+	Id             int       `xorm:"not null pk autoincr INT(11)"`
+	Name           string    `xorm:"comment('企业名称') VARCHAR(255)"`
+	OldName        string    `xorm:"comment('曾用名') VARCHAR(255)"`
+	SupplierId     int       `xorm:" INT(11)"`
+	GfId           int       `xorm:" INT(11)"`
+	CreateOn       time.Time `xorm:"DATETIME"`
+	CreateUserId   int       `xorm:"INT(10)"`
+	CreateBy       string    `xorm:"VARCHAR(50)"`
+	ModifiedOn     time.Time `xorm:"DATETIME"`
+	ModifiedUserId int       `xorm:"INT(10)"`
+	ModifiedBy     string    `xorm:"VARCHAR(50)"`
 }
 
 const (

+ 322 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/select.go

@@ -4,7 +4,9 @@ import (
 	"archive/zip"
 	"encoding/json"
 	"fmt"
+	"github.com/tealeg/xlsx"
 	"io"
+	"log"
 	"os"
 	"sort"
 	"strconv"
@@ -286,6 +288,326 @@ func (this *SelectController) GetTList() {
 
 }
 
+// @Title get 导出ex
+// @Description
+// @Success 200 {object}
+// @router /export-company-list [post]
+func (this *SelectController) ExportCompanyList() {
+
+	var model supplier.OilSupplierSelect
+	var model1 supplier.RegCapitalRange //注册资金范围
+
+	var jsonBlob = this.Ctx.Input.RequestBody
+	json.Unmarshal(jsonBlob, &model)
+	json.Unmarshal(jsonBlob, &model1)
+	//json.Unmarshal(jsonBlob, &model2)
+
+	// //获取分页信息
+	page := this.GetPageInfoForm()
+	where := " 1=1 AND b.InFlag in (1,2,3) AND b.Status = '8' "
+	orderby := "a.Id"
+	asc := true
+	Order := this.GetString("Order")
+	Prop := this.GetString("Prop")
+	OperType := this.GetString("OperType")
+	Grade := this.GetString("Grade")
+	CheckUId := this.GetString("CheckUId")
+	FullId := this.GetString("FullId")
+	selectedCertIdList := this.GetString("selectedCertIdList")
+	if Order != "" && Prop != "" {
+		orderby = Prop
+		if Order == "desc" {
+			asc = false
+		}
+	}
+
+	having := ""
+	var Ids supplier.OilCertIds
+	if selectedCertIdList != "" {
+		where = where + " and b.Id in (" + selectedCertIdList + ") "
+	} else {
+		//准入证号
+		if model.AccessCardNo != "" {
+			where = where + " and b.AccessCardNo like '%" + model.AccessCardNo + "%'"
+		}
+
+		//企业名称
+		if model.SupplierName != "" {
+			where = where + " and a.SupplierName like '%" + model.SupplierName + "%'"
+		}
+
+		if model.OldSupplierName != "" {
+			where = where + " and a.OldSupplierName like '%" + model.OldSupplierName + "%'"
+		}
+		if FullId != "" {
+			where = where + " and f.Id = '" + FullId + "'"
+		}
+		if CheckUId != "" {
+			where = where + " and b.RecUnitId = '" + CheckUId + "'"
+		}
+
+		//准入类别(基建,物资,技术服务)
+		if model.SupplierTypeCode != "" {
+			where = where + " and b.SupplierTypeCode = '" + model.SupplierTypeCode + "'"
+		}
+		//准入标识 1 准入 2 暂停 3取消
+		if model.InFlag != "" {
+			where = where + " and b.InFlag = '" + model.InFlag + "'"
+		}
+		//法人
+		if model.LegalPerson != "" {
+			where = where + " and a.LegalPerson like '%" + model.LegalPerson + "%'"
+		}
+		//联系人
+		if model.ContactName != "" {
+			where = where + " and a.ContactName like '%" + model.ContactName + "%'"
+		}
+		//统一社会信用代码
+		if model.CommercialNo != "" {
+			where = where + " and a.CommercialNo like '%" + model.CommercialNo + "%'"
+		}
+		//开户银行
+		if model.DepositBank != "" {
+			where = where + " and a.DepositBank like '%" + model.DepositBank + "%'"
+		}
+
+		if OperType == "1" {
+			OperType = "制造商"
+		} else if OperType == "2" {
+			OperType = "代理商"
+		} else if OperType == "3" {
+			OperType = "贸易商"
+		}
+		//准入状态
+		if OperType != "" {
+			where = where + " and a.OperType = '" + OperType + "'"
+		}
+		//级别
+		if Grade != "" {
+			where = where + " and a.Grade = '" + Grade + "'"
+		}
+
+		//HSE审查
+		if model.HseTraining != "" {
+			where = where + " and a.HseTraining = '" + model.HseTraining + "'"
+		}
+		//公司类型
+		if model.CompanyType != "" {
+			where = where + " and a.CompanyType like '%" + model.CompanyType + "%'"
+		}
+		//成立时间
+		SetupTime := this.GetString("SetupTime")
+		if SetupTime != "" {
+			where = where + " and a.SetupTime ='" + SetupTime + "'"
+		}
+		//注册资金范围
+		if model1.RegCapital1 != "" {
+			where = where + " and a.RegCapital >= '" + model1.RegCapital1 + "'"
+		}
+		if model1.RegCapital2 != "" {
+			where = where + " and a.RegCapital <= '" + model1.RegCapital2 + "'"
+		}
+
+		//注册省份
+		if model.Province != "" {
+			where = where + " and a.Province = '" + model.Province + "'"
+		}
+		//注册市
+		if model.City != "" {
+			where = where + " and a.City = '" + model.City + "'"
+		}
+		//注册区
+		if model.Street != "" {
+			where = where + " and a.Street = '" + model.Street + "'"
+		}
+		//注册详细地址
+		if model.Address != "" {
+			where = where + " and a.Address like '%" + model.Address + "%'"
+		}
+		if model.LinkProvince != "" {
+			where = where + " and a.LinkProvince = '" + model.LinkProvince + "'"
+		}
+		if model.LinkCity != "" {
+			where = where + " and a.LinkCity = '" + model.LinkCity + "'"
+		}
+		if model.LinkStreet != "" {
+			where = where + " and a.LinkStreet = '" + model.LinkStreet + "'"
+		}
+		if model.LinkAddress != "" {
+			where = where + " and a.LinkAddress like '%" + model.LinkAddress + "%'"
+		}
+		//营业范围
+		if model.BusinessScope != "" {
+			where = where + " and a.BusinessScope like '%" + model.BusinessScope + "%'"
+		}
+		CreateOn := this.GetString("CreateOn")
+		if CreateOn != "" {
+			dates := strings.Split(CreateOn, ",")
+			if len(dates) == 2 {
+				minDate := dates[0]
+				maxDate := dates[1]
+				where = where + " and a.CreateOn>='" + minDate + "' and a.CreateOn<='" + maxDate + "'"
+			}
+		}
+
+		a := model.InStyle
+		fmt.Println(a)
+		//准入方式
+		if model.InStyle != "" {
+			if model.InStyle == "0" {
+				where = where + " and b.InStyle in ('2','3','4','5')"
+			} else {
+				where = where + " and b.InStyle ='" + model.InStyle + "'"
+			}
+		}
+
+		CerSubName := strings.Split(model.CerSubName, ",")
+		comma := strings.Contains(model.CerSubName, ",")
+
+		if comma {
+			CerSubName = strings.Split(model.CerSubName, ",")
+		} else {
+			CerSubName = strings.Split(model.CerSubName, ",")
+		}
+
+		//准入范围
+		if model.CerSubName != "" {
+			svc := supplier.GetOilSupplierService(utils.DBE)
+			where1 := ""
+			for key, value := range CerSubName {
+				if key == 0 {
+					where1 += " (Name like '%" + value + "%' or Code like '" + value + "%' "
+				} else {
+					where1 += "or Name like '%" + value + "%'  or Code like '" + value + "%' "
+				}
+			}
+			where1 += ") "
+			svc.GetCertIds(&Ids, where1)
+		}
+		//资质
+		if model.NeedFileType != "" {
+			having = " having NeedFileType like '%" + model.NeedFileType + "%' "
+		}
+	}
+
+	page.Size = 15000
+	svc := selectbusiness.GetSelectService(utils.DBE)
+	var list []supplier.OilSupplierSelect
+
+	total := svc.GetMyPagingEntitiesWithOrderBytblForExport(OilSupplierName, OilSupplierCertName, OilInfoChangeName, OilCorporateInfoName, OilSupplierCertSubName,
+		OilSupplierFileName, page.CurrentPage, page.Size, orderby, asc, &list, where, having, model.CerSubName, Ids.Ids, model.NeedFileType)
+	log.Print("共导出供方信息:", total)
+	// 获取到所有符合条件的供方信息列表 ↑
+
+	fileTitle := "供方信息表"
+	//自定义显示列
+	title := strings.Split("企业名称,准入证号,准入类别,准入方式,状态,有效日期,企业曾用名,级别,供应商类型,法人代表,注册资金,联系人,"+
+		"移动电话,统一社会信用代码,开户银行,公司类型,成立时间,推荐单位,专业处室,申请时间,注册地址,通信地址,营业范围,企业资质,备注", ",")
+
+	f := xlsx.NewFile()
+	sheet, _ := f.AddSheet(fileTitle)
+	row := sheet.AddRow()
+	row.WriteSlice(&title, -1)
+
+	// 与表头顺序一一对应 ↓
+	for _, item := range list {
+		var dataArr []string
+		dataArr = append(dataArr, item.SupplierName)
+		dataArr = append(dataArr, item.AccessCardNo)
+		// 准入类别
+		if item.SupplierTypeCode == "01" {
+			dataArr = append(dataArr, "物资类")
+		} else if item.SupplierTypeCode == "02" {
+			dataArr = append(dataArr, "基建类")
+		} else if item.SupplierTypeCode == "03" {
+			dataArr = append(dataArr, "服务类")
+		} else {
+			dataArr = append(dataArr, "")
+		}
+		// 准入方式
+		if item.InStyle == "1" {
+			dataArr = append(dataArr, "评审准入")
+		} else if item.InStyle == "2" {
+			dataArr = append(dataArr, "一级物资备案准入")
+		} else if item.InStyle == "3" {
+			dataArr = append(dataArr, "二级物资备案准入")
+		} else if item.InStyle == "4" {
+			dataArr = append(dataArr, "战略合作准入")
+		} else if item.InStyle == "5" {
+			dataArr = append(dataArr, "内部多元准入")
+		} else if item.InStyle == "6" {
+			dataArr = append(dataArr, "招标准入")
+		} else {
+			dataArr = append(dataArr, "")
+		}
+		// 准入标识
+		if item.InFlag == "1" {
+			dataArr = append(dataArr, "准入")
+		} else if item.InFlag == "2" {
+			dataArr = append(dataArr, "暂停")
+		} else if item.InFlag == "3" {
+			dataArr = append(dataArr, "取消")
+		} else {
+			dataArr = append(dataArr, "")
+		}
+
+		dataArr = append(dataArr, item.ApplyTime.Format("2006-01-02 15:04:05"))
+		dataArr = append(dataArr, item.OldSupplierName)
+		if item.Grade == "1" {
+			dataArr = append(dataArr, "一级")
+		} else if item.Grade == "2" {
+			dataArr = append(dataArr, "二级")
+		} else {
+			dataArr = append(dataArr, "")
+		}
+
+		if item.OperType == "制造商" {
+			dataArr = append(dataArr, item.OperType)
+		} else {
+			dataArr = append(dataArr, "非制造商")
+		}
+		dataArr = append(dataArr, item.LegalPerson)
+		dataArr = append(dataArr, strconv.FormatFloat(item.RegCapital, 'f', 2, 64))
+		dataArr = append(dataArr, item.ContactName)
+		dataArr = append(dataArr, item.Mobile)
+		dataArr = append(dataArr, item.CommercialNo)
+		dataArr = append(dataArr, item.DepositBank)
+		dataArr = append(dataArr, item.CompanyType)
+		dataArr = append(dataArr, item.SetupTime.Format("2006-01-02 15:04:05"))
+		dataArr = append(dataArr, item.CheckUnitName)
+		dataArr = append(dataArr, item.FullName)
+		dataArr = append(dataArr, item.CreateOn.Format("2006-01-02 15:04:05"))
+		dataArr = append(dataArr, item.Address)
+		dataArr = append(dataArr, item.LinkAddress)
+		dataArr = append(dataArr, item.BusinessScope)
+		dataArr = append(dataArr, item.NeedFileType)
+		// dataArr = append(dataArr, item.CerSubName)	// 准入编码
+		dataArr = append(dataArr, item.Remark)
+
+		row := sheet.AddRow()
+		row.WriteSlice(&dataArr, -1)
+	}
+	for c, cl := 0, len(sheet.Cols); c < cl; c++ {
+		sheet.Cols[c].Width = 20
+	}
+	dir := "static/file/excel/report/" + this.GetAccode()
+	SaveDirectory(dir)
+	path := dir + "/" + "supplier_export_" + utils.TimeFormat(time.Now(), "20060102") + fileTitle + ".xlsx"
+	f.Save(path)
+	var sw *Seaweed
+	var filer []string
+	if _filer := os.Getenv("GOSWFS_FILER_URL"); _filer != "" {
+		filer = []string{_filer}
+	}
+	sw = NewSeaweed("http", utils.Cfg.MustValue("file", "upFileHost"), filer, 2*1024*1024, 5*time.Minute)
+	_, _, fID, _ := sw.UploadFile(path, "", "")
+
+	retDocUrl := utils.Cfg.MustValue("file", "downFileHost") + "/" + fID
+	os.Remove(path)
+	this.Data["json"] = retDocUrl
+	this.ServeJSON()
+}
+
 // @Title 根据公司名获取公司信息和准入
 // @Description
 // @Success 200 {object}