|
|
@@ -32,33 +32,32 @@ type SelectController struct {
|
|
|
BaseController
|
|
|
}
|
|
|
|
|
|
-
|
|
|
type UpSearch struct {
|
|
|
FullName string
|
|
|
}
|
|
|
type UpInfoSearch struct {
|
|
|
- FullName string
|
|
|
- SupplierTypeName string
|
|
|
- HeGe int
|
|
|
- BuHeGe int
|
|
|
- ZongShu int
|
|
|
- Reason string
|
|
|
+ FullName string
|
|
|
+ SupplierTypeName string
|
|
|
+ HeGe int
|
|
|
+ BuHeGe int
|
|
|
+ ZongShu int
|
|
|
+ Reason string
|
|
|
}
|
|
|
|
|
|
type Processinfo struct {
|
|
|
- Id int
|
|
|
- AccessCardNo string
|
|
|
- WorkflowId string
|
|
|
- ProcessKey string
|
|
|
- SupplierName string
|
|
|
- SupplierTypeCode string
|
|
|
- Status string
|
|
|
- Type string
|
|
|
- CreateOn time.Time
|
|
|
- AddinTime time.Time
|
|
|
- RecUnitName string
|
|
|
- ContactName string
|
|
|
- Mobile string
|
|
|
+ Id int
|
|
|
+ AccessCardNo string
|
|
|
+ WorkflowId string
|
|
|
+ ProcessKey string
|
|
|
+ SupplierName string
|
|
|
+ SupplierTypeCode string
|
|
|
+ Status string
|
|
|
+ Type string
|
|
|
+ CreateOn time.Time
|
|
|
+ AddinTime time.Time
|
|
|
+ RecUnitName string
|
|
|
+ ContactName string
|
|
|
+ Mobile string
|
|
|
}
|
|
|
|
|
|
// @Title 获取所有
|
|
|
@@ -67,8 +66,8 @@ type Processinfo struct {
|
|
|
// @router /getcompanylist [post]
|
|
|
func (this *SelectController) GetTList() {
|
|
|
|
|
|
- var model supplier.OilSupplierSelect
|
|
|
- var model1 supplier.RegCapitalRange //注册资金范围
|
|
|
+ var model supplier.OilSupplierSelect
|
|
|
+ var model1 supplier.RegCapitalRange //注册资金范围
|
|
|
//var model2 supplier.NeedFileTypeStruct //资质结构体
|
|
|
|
|
|
var jsonBlob = this.Ctx.Input.RequestBody
|
|
|
@@ -202,9 +201,9 @@ func (this *SelectController) GetTList() {
|
|
|
fmt.Println(a)
|
|
|
//准入方式
|
|
|
if model.InStyle != "" {
|
|
|
- if model.InStyle == "0"{
|
|
|
+ if model.InStyle == "0" {
|
|
|
where = where + " and b.InStyle in ('2','3','4','5')"
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
where = where + " and b.InStyle ='" + model.InStyle + "'"
|
|
|
}
|
|
|
}
|
|
|
@@ -221,25 +220,25 @@ func (this *SelectController) GetTList() {
|
|
|
// where = where + " and d.NeedFileType in (" + pararm[0:len(pararm)-1] + ")"
|
|
|
//}
|
|
|
|
|
|
- having:=""
|
|
|
+ having := ""
|
|
|
//准入范围
|
|
|
- if model.CerSubName!="" {
|
|
|
- having = " having CerSubName like '%"+model.CerSubName+"%' "
|
|
|
- leftjoin = "left join "+ OilSupplierCertSubName + " d on d.SupplierCertId = b.Id "
|
|
|
+ if model.CerSubName != "" {
|
|
|
+ having = " having CerSubName like '%" + model.CerSubName + "%' "
|
|
|
+ leftjoin = "left join " + OilSupplierCertSubName + " d on d.SupplierCertId = b.Id "
|
|
|
}
|
|
|
//资质
|
|
|
- if model.NeedFileType!="" {
|
|
|
- having = " having NeedFileType like '%"+model.NeedFileType+"%' "
|
|
|
+ if model.NeedFileType != "" {
|
|
|
+ having = " having NeedFileType like '%" + model.NeedFileType + "%' "
|
|
|
}
|
|
|
- if model.CerSubName!=""&& model.NeedFileType!=""{
|
|
|
- having = " having CerSubName like '%"+model.CerSubName+"%' and NeedFileType like '%"+model.NeedFileType+"%' "
|
|
|
- leftjoin = "left join "+ OilSupplierCertSubName + " d on d.SupplierCertId = b.Id "
|
|
|
+ if model.CerSubName != "" && model.NeedFileType != "" {
|
|
|
+ having = " having CerSubName like '%" + model.CerSubName + "%' and NeedFileType like '%" + model.NeedFileType + "%' "
|
|
|
+ leftjoin = "left join " + OilSupplierCertSubName + " d on d.SupplierCertId = b.Id "
|
|
|
}
|
|
|
svc := selectbusiness.GetSelectService(utils.DBE)
|
|
|
var list []supplier.OilSupplierSelect
|
|
|
|
|
|
- total := svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, OilInfoChangeName,OilCorporateInfoName,OilSupplierCertSubName,
|
|
|
- OilSupplierFileName, page.CurrentPage, page.Size, orderby, asc, &list, where,having, leftjoin)
|
|
|
+ total := svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, OilInfoChangeName, OilCorporateInfoName, OilSupplierCertSubName,
|
|
|
+ OilSupplierFileName, page.CurrentPage, page.Size, orderby, asc, &list, where, having, leftjoin)
|
|
|
|
|
|
var datainfo DataInfo
|
|
|
datainfo.Items = list
|
|
|
@@ -262,11 +261,11 @@ func (this *SelectController) GetBaseInfo() {
|
|
|
svc := selectbusiness.GetSelectService(utils.DBE)
|
|
|
var infoIntelist []supplier.OilSupplierInte
|
|
|
|
|
|
- for _,item := range spesearchs {
|
|
|
+ for _, item := range spesearchs {
|
|
|
//var supplierinfo supplier.SupplierInfoInte
|
|
|
var infoInte supplier.OilSupplierInte
|
|
|
where := " where 1 = 1 AND a.SupplierName = '" + item + "'"
|
|
|
- svc.GetInfoByCompId(where,&infoInte.SupplierInfo)
|
|
|
+ svc.GetInfoByCompId(where, &infoInte.SupplierInfo)
|
|
|
|
|
|
var cert1 suppliercert.OilSupplierCert
|
|
|
where = "SupplierId=" + strconv.Itoa(infoInte.SupplierInfo.Id) + " and SupplierTypeCode= '01'"
|
|
|
@@ -296,7 +295,7 @@ func (this *SelectController) GetBaseInfo() {
|
|
|
where = "where SupplierId=" + strconv.Itoa(infoInte.SupplierInfo.Id) + " and SupplierTypeCode='03'"
|
|
|
svc.Getoilsuppliercertsub(OilSupplierCertSubName, where, &infoInte.JFsub)
|
|
|
|
|
|
- }else if item == "" {
|
|
|
+ } else if item == "" {
|
|
|
where = "where SupplierTypeCode='01'"
|
|
|
svc.Getoilsuppliercertsub(OilSupplierCertSubName, where, &infoInte.WZsub)
|
|
|
|
|
|
@@ -328,12 +327,12 @@ func (this *SelectController) GetInfoByPage() {
|
|
|
var infoIntelist []supplier.OilSupplierInte
|
|
|
intpage, _ := strconv.Atoi(page)
|
|
|
|
|
|
- for i:= (intpage-1)*50;i < (intpage*50) ;i++{
|
|
|
+ for i := (intpage - 1) * 50; i < (intpage * 50); i++ {
|
|
|
//var supplierinfo supplier.SupplierInfoInte
|
|
|
var infoInte supplier.OilSupplierInte
|
|
|
stringi := strconv.Itoa(i)
|
|
|
- where := " where 1 = 1 limit "+ stringi + ",1"
|
|
|
- svc.GetInfoByCompId(where,&infoInte.SupplierInfo)
|
|
|
+ where := " where 1 = 1 limit " + stringi + ",1"
|
|
|
+ svc.GetInfoByCompId(where, &infoInte.SupplierInfo)
|
|
|
|
|
|
var cert1 suppliercert.OilSupplierCert
|
|
|
where = "SupplierId=" + strconv.Itoa(infoInte.SupplierInfo.Id) + " and SupplierTypeCode= '01'"
|
|
|
@@ -412,7 +411,7 @@ func (this *SelectController) Up() {
|
|
|
svc := selectbusiness.GetSelectService(utils.DBE)
|
|
|
var list []UpInfoSearch
|
|
|
|
|
|
- total := svc.GetUp( OilSupplierCertName , page.CurrentPage, page.Size, Prop, asc, &list, where)
|
|
|
+ total := svc.GetUp(OilSupplierCertName, page.CurrentPage, page.Size, Prop, asc, &list, where)
|
|
|
|
|
|
var datainfo DataInfo
|
|
|
datainfo.Items = list
|
|
|
@@ -471,10 +470,10 @@ func (this *SelectController) GetProcessAuditList() {
|
|
|
//企业用户必须加创建人条件
|
|
|
var registerUser register.OilCorporateInfo
|
|
|
sql := " UserName='" + this.User.Username + "'"
|
|
|
- svc.GetEntity(®isterUser,sql)
|
|
|
+ svc.GetEntity(®isterUser, sql)
|
|
|
var processinfolist []Processinfo
|
|
|
if this.User.IsCompanyUser == 1 {
|
|
|
- where = where + " and (b.CreateUserId = '" + this.User.Id + "' or a.CommercialNo='"+registerUser.CommercialNo+"')"
|
|
|
+ where = where + " and (b.CreateUserId = '" + this.User.Id + "' or a.CommercialNo='" + registerUser.CommercialNo + "')"
|
|
|
}
|
|
|
if supplierTypeCode != "" {
|
|
|
where = where + " and b.SupplierTypeCode like '%" + supplierTypeCode + "%'"
|
|
|
@@ -518,7 +517,7 @@ func (this *SelectController) GetProcessAuditList() {
|
|
|
whereapp = whereapp + " a.and CreateOn>='" + minDate + "' and a.CreateOn<='" + maxDate + "'"
|
|
|
}
|
|
|
}
|
|
|
- var list []Processinfo//[]suppliercertappend.OilSupplierCertAppend
|
|
|
+ var list []Processinfo //[]suppliercertappend.OilSupplierCertAppend
|
|
|
svc := suppliercertappend.GetOilSupplierCertAppendService(utils.DBE)
|
|
|
total = total + svc.GetProcessInfoWithOrderBytbl(OilSupplierCertAppendName, page.CurrentPage, page.Size, "a.Id", asc, &list, whereapp)
|
|
|
processinfolist = append(processinfolist, list...)
|
|
|
@@ -544,7 +543,7 @@ func (this *SelectController) GetProcessAuditList() {
|
|
|
whereapp = whereapp + " and a.CreateOn>='" + minDate + "' and a.CreateOn<='" + maxDate + "'"
|
|
|
}
|
|
|
}
|
|
|
- var list []Processinfo//[]annualaudit.OilAnnualAudit
|
|
|
+ var list []Processinfo //[]annualaudit.OilAnnualAudit
|
|
|
svc := annualaudit.GetOilAnnualAuditService(utils.DBE)
|
|
|
total = total + svc.GetProcessInfoWithOrderBytbl(OilAnnualAuditName, page.CurrentPage, page.Size, orderby, asc, &list, whereapp)
|
|
|
processinfolist = append(processinfolist, list...)
|
|
|
@@ -567,7 +566,7 @@ func (this *SelectController) GetProcessAuditList() {
|
|
|
whereapp = whereapp + " and a.CreateOn>='" + minDate + "' and a.CreateOn<='" + maxDate + "'"
|
|
|
}
|
|
|
}
|
|
|
- var list []Processinfo//[]infochange.OilInfoChange
|
|
|
+ var list []Processinfo //[]infochange.OilInfoChange
|
|
|
svc := infochange.GetInfoChangeService(utils.DBE)
|
|
|
total = total + svc.GetProcessInfoWithOrderBytbl(OilInfoChangeName, page.CurrentPage, page.Size, orderby, asc, &list, whereapp)
|
|
|
processinfolist = append(processinfolist, list...)
|
|
|
@@ -607,9 +606,6 @@ func (this *SelectController) GetProcessAuditList() {
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
// @Title 准入范围查询
|
|
|
// @Description
|
|
|
// @Success 200 {object}
|
|
|
@@ -618,7 +614,7 @@ func (this *SelectController) ZrfwSelect() {
|
|
|
|
|
|
//获取分页信息
|
|
|
page := this.GetPageInfoForm()
|
|
|
- limitCurrent:=(page.CurrentPage-1)*page.Size
|
|
|
+ limitCurrent := (page.CurrentPage - 1) * page.Size
|
|
|
svc := selectbusiness.GetSelectService(utils.DBE)
|
|
|
supplierTypeCode := this.GetString("SupplierTypeCode")
|
|
|
certsub := this.GetString("certsub")
|
|
|
@@ -628,10 +624,10 @@ func (this *SelectController) ZrfwSelect() {
|
|
|
var company supplier.OilSupplier
|
|
|
|
|
|
sql := " UserName='" + this.User.Username + "'"
|
|
|
- svc.GetEntity(®isterUser,sql)
|
|
|
+ svc.GetEntity(®isterUser, sql)
|
|
|
if this.User.IsCompanyUser == 1 {
|
|
|
- sql1:= " CreateUserId = '" + this.User.Id + "' or CommercialNo='"+registerUser.CommercialNo+"'"
|
|
|
- svc.GetEntity(&company,sql1)
|
|
|
+ sql1 := " CreateUserId = '" + this.User.Id + "' or CommercialNo='" + registerUser.CommercialNo + "'"
|
|
|
+ svc.GetEntity(&company, sql1)
|
|
|
}
|
|
|
|
|
|
where := ""
|
|
|
@@ -639,13 +635,13 @@ func (this *SelectController) ZrfwSelect() {
|
|
|
where = " and (Code like '%" + certsub + "%' or Name like '%" + certsub + "%')"
|
|
|
}
|
|
|
|
|
|
- if company.SupplierName!=""{
|
|
|
- sql2:="select distinct(Code),Name,SupplierId,CertSubStatus from OilSupplierCertSub where SupplierId='"+strconv.Itoa(company.Id)+"' and SupplierTypeCode='"+supplierTypeCode+"' " + where + " order by CertSubStatus desc,Code asc limit "+strconv.FormatInt(limitCurrent,10)+","+strconv.FormatInt(page.Size,10)+""
|
|
|
- result,_:=svc.DBE.QueryString(sql2)
|
|
|
- sql3:="select count(distinct(Code)) total from OilSupplierCertSub where SupplierId='"+strconv.Itoa(company.Id)+"' and SupplierTypeCode='"+supplierTypeCode+"'" + where
|
|
|
- result1,_:=svc.DBE.QueryString(sql3)
|
|
|
+ if company.SupplierName != "" {
|
|
|
+ sql2 := "select distinct(Code),Name,SupplierId,CertSubStatus from OilSupplierCertSub where SupplierId='" + strconv.Itoa(company.Id) + "' and SupplierTypeCode='" + supplierTypeCode + "' " + where + " order by CertSubStatus desc,Code asc limit " + strconv.FormatInt(limitCurrent, 10) + "," + strconv.FormatInt(page.Size, 10) + ""
|
|
|
+ result, _ := svc.DBE.QueryString(sql2)
|
|
|
+ sql3 := "select count(distinct(Code)) total from OilSupplierCertSub where SupplierId='" + strconv.Itoa(company.Id) + "' and SupplierTypeCode='" + supplierTypeCode + "'" + where
|
|
|
+ result1, _ := svc.DBE.QueryString(sql3)
|
|
|
|
|
|
- total,_:= strconv.ParseInt(result1[0]["total"], 10, 64)
|
|
|
+ total, _ := strconv.ParseInt(result1[0]["total"], 10, 64)
|
|
|
var datainfo DataInfo
|
|
|
datainfo.Items = result
|
|
|
datainfo.CurrentItemCount = total
|
|
|
@@ -653,7 +649,7 @@ func (this *SelectController) ZrfwSelect() {
|
|
|
datainfo.ItemsPerPage = page.Size
|
|
|
this.Data["json"] = &datainfo
|
|
|
this.ServeJSON()
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
var datainfo DataInfo
|
|
|
datainfo.Items = ""
|
|
|
datainfo.PageIndex = page.CurrentPage
|
|
|
@@ -674,7 +670,6 @@ func (this *SelectController) GetAllBusinesList() {
|
|
|
supplierTypeCode := this.GetString("SupplierTypeCode")
|
|
|
supplierName := this.GetString("SupplierName")
|
|
|
|
|
|
-
|
|
|
var list []selectbusiness.SelectBusiness
|
|
|
// 准入
|
|
|
if perject == "1" || perject == "" {
|
|
|
@@ -686,7 +681,7 @@ func (this *SelectController) GetAllBusinesList() {
|
|
|
where = where + " and b.SupplierTypeCode='" + supplierTypeCode + "'"
|
|
|
}
|
|
|
if supplierName != "" {
|
|
|
- where =where + " and a.SupplierName like '%" + supplierName + "%'"
|
|
|
+ where = where + " and a.SupplierName like '%" + supplierName + "%'"
|
|
|
}
|
|
|
|
|
|
var zrlist []supplier.OilSupplierView
|
|
|
@@ -694,14 +689,14 @@ func (this *SelectController) GetAllBusinesList() {
|
|
|
if this.User.IsCompanyUser == 1 {
|
|
|
var registerUser register.OilCorporateInfo
|
|
|
sql := " UserName='" + this.User.Username + "'"
|
|
|
- zrsvc.GetEntity(®isterUser,sql)
|
|
|
+ zrsvc.GetEntity(®isterUser, sql)
|
|
|
where = where + " and (b.CreateUserId = '" + this.User.Id + "' or a.CommercialNo='" + registerUser.CommercialNo + "')"
|
|
|
}
|
|
|
zrwhere := where + " and b.Status='" + suppliercert.STORE_STATUS + "'"
|
|
|
- zrsvc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, 1, 100, "b.Id", false , &zrlist, zrwhere)
|
|
|
+ zrsvc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, 1, 100, "b.Id", false, &zrlist, zrwhere)
|
|
|
|
|
|
for _, item := range zrlist {
|
|
|
- var sele selectbusiness.SelectBusiness
|
|
|
+ var sele selectbusiness.SelectBusiness
|
|
|
sele.SupplierName = item.SupplierName
|
|
|
sele.CreateOn = item.CreateOn
|
|
|
sele.AccessCardNo = item.AccessCardNo
|
|
|
@@ -722,7 +717,7 @@ func (this *SelectController) GetAllBusinesList() {
|
|
|
where = where + " and b.AppendType='" + supplierTypeCode + "'"
|
|
|
}
|
|
|
if supplierName != "" {
|
|
|
- where =where + " and a.SupplierName like '%" + supplierName + "%'"
|
|
|
+ where = where + " and a.SupplierName like '%" + supplierName + "%'"
|
|
|
}
|
|
|
var zxlist []suppliercertappend.OilSupplierCertAppend
|
|
|
zxsvc := suppliercertappend.GetOilSupplierCertAppendService(utils.DBE)
|
|
|
@@ -730,14 +725,14 @@ func (this *SelectController) GetAllBusinesList() {
|
|
|
if this.User.IsCompanyUser == 1 {
|
|
|
var registerUser register.OilCorporateInfo
|
|
|
sql := " UserName='" + this.User.Username + "'"
|
|
|
- zxsvc.GetEntity(®isterUser,sql)
|
|
|
+ zxsvc.GetEntity(®isterUser, sql)
|
|
|
where = where + " and (b.CreateUserId = '" + this.User.Id + "' or a.CommercialNo='" + registerUser.CommercialNo + "')"
|
|
|
}
|
|
|
zxwhere := where + " and b.Status='" + suppliercert.STORE_STATUS + "'"
|
|
|
zxsvc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertAppendName, 1, 100, "b.Id", false, &zxlist, zxwhere)
|
|
|
|
|
|
for _, item := range zxlist {
|
|
|
- var sele selectbusiness.SelectBusiness
|
|
|
+ var sele selectbusiness.SelectBusiness
|
|
|
sele.SupplierName = item.SupplierName
|
|
|
sele.CreateOn = item.CreateOn
|
|
|
sele.AccessCardNo = item.AccessCardNo
|
|
|
@@ -758,21 +753,21 @@ func (this *SelectController) GetAllBusinesList() {
|
|
|
where = where + " and b.SupplierTypeName='" + supplierTypeCode + "'"
|
|
|
}
|
|
|
if supplierName != "" {
|
|
|
- where =where + " and a.SupplierName like '%" + supplierName + "%'"
|
|
|
+ where = where + " and a.SupplierName like '%" + supplierName + "%'"
|
|
|
}
|
|
|
var nslist []annualaudit.OilAnnualAudit
|
|
|
nssvc := annualaudit.GetOilAnnualAuditService(utils.DBE)
|
|
|
if this.User.IsCompanyUser == 1 {
|
|
|
var registerUser register.OilCorporateInfo
|
|
|
sql := " UserName='" + this.User.Username + "'"
|
|
|
- nssvc.GetEntity(®isterUser,sql)
|
|
|
+ nssvc.GetEntity(®isterUser, sql)
|
|
|
where = where + " and (b.CreateUserId = '" + this.User.Id + "' or a.CommercialNo='" + registerUser.CommercialNo + "')"
|
|
|
}
|
|
|
zswhere := where + " and b.Status='" + suppliercert.DRAFT_STATUS + "'"
|
|
|
- nssvc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilAnnualAuditName,1, 100, "b.Id", false, &nslist, zswhere)
|
|
|
+ nssvc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilAnnualAuditName, 1, 100, "b.Id", false, &nslist, zswhere)
|
|
|
|
|
|
for _, item := range nslist {
|
|
|
- var sele selectbusiness.SelectBusiness
|
|
|
+ var sele selectbusiness.SelectBusiness
|
|
|
sele.SupplierName = item.SupplierName
|
|
|
sele.CreateOn = item.CreateOn
|
|
|
sele.AccessCardNo = item.AccessCardNo
|
|
|
@@ -784,40 +779,40 @@ func (this *SelectController) GetAllBusinesList() {
|
|
|
|
|
|
}
|
|
|
|
|
|
- // 变更申请
|
|
|
- if perject == "4" || perject == "" {
|
|
|
- where := "1=1 "
|
|
|
- if accessCardNo != "" {
|
|
|
- where = where + " and b.AccessCardNo='" + accessCardNo + "'"
|
|
|
- }
|
|
|
- if supplierTypeCode != "" {
|
|
|
- where = where + " and b.SupplierTypeCode='" + supplierTypeCode + "'"
|
|
|
- }
|
|
|
- if supplierName != "" {
|
|
|
- where =where + " and a.SupplierName like '%" + supplierName + "%'"
|
|
|
- }
|
|
|
- var bglist []infochange.SuppModelInfo
|
|
|
- bgsvc := infochange.GetInfoChangeService(utils.DBE)
|
|
|
- if this.User.IsCompanyUser == 1 {
|
|
|
- var registerUser register.OilCorporateInfo
|
|
|
- sql := " UserName='" + this.User.Username + "'"
|
|
|
- bgsvc.GetEntity(®isterUser,sql)
|
|
|
- where = where + " and (b.CreateUserId = '" + this.User.Id + "' or a.CommercialNo='" + registerUser.CommercialNo + "')"
|
|
|
- }
|
|
|
- bgwhere := where + " and b.Status='" + suppliercert.DRAFT_STATUS + "'"
|
|
|
- bgsvc.GetSuppPagingEntitiesWithOrderBytbl(OilSupplierName, OilInfoChangeName, 1, 100, "b.Id", false, &bglist, bgwhere)
|
|
|
-
|
|
|
- for _, item := range bglist {
|
|
|
- var sele selectbusiness.SelectBusiness
|
|
|
- sele.SupplierName = item.SupplierName
|
|
|
- sele.CreateOn = item.CreateOn
|
|
|
- sele.AccessCardNo = ""
|
|
|
- sele.TypeCode = item.SupplierTypeCode
|
|
|
- sele.TypeName = item.SupplierTypeName
|
|
|
- sele.Preject = "4"
|
|
|
- list = append(list, sele)
|
|
|
- }
|
|
|
- }
|
|
|
+ // 变更申请
|
|
|
+ if perject == "4" || perject == "" {
|
|
|
+ where := "1=1 "
|
|
|
+ if accessCardNo != "" {
|
|
|
+ where = where + " and b.AccessCardNo='" + accessCardNo + "'"
|
|
|
+ }
|
|
|
+ if supplierTypeCode != "" {
|
|
|
+ where = where + " and b.SupplierTypeCode='" + supplierTypeCode + "'"
|
|
|
+ }
|
|
|
+ if supplierName != "" {
|
|
|
+ where = where + " and a.SupplierName like '%" + supplierName + "%'"
|
|
|
+ }
|
|
|
+ var bglist []infochange.SuppModelInfo
|
|
|
+ bgsvc := infochange.GetInfoChangeService(utils.DBE)
|
|
|
+ if this.User.IsCompanyUser == 1 {
|
|
|
+ var registerUser register.OilCorporateInfo
|
|
|
+ sql := " UserName='" + this.User.Username + "'"
|
|
|
+ bgsvc.GetEntity(®isterUser, sql)
|
|
|
+ where = where + " and (b.CreateUserId = '" + this.User.Id + "' or a.CommercialNo='" + registerUser.CommercialNo + "')"
|
|
|
+ }
|
|
|
+ bgwhere := where + " and b.Status='" + suppliercert.DRAFT_STATUS + "'"
|
|
|
+ bgsvc.GetSuppPagingEntitiesWithOrderBytbl(OilSupplierName, OilInfoChangeName, 1, 100, "b.Id", false, &bglist, bgwhere)
|
|
|
+
|
|
|
+ for _, item := range bglist {
|
|
|
+ var sele selectbusiness.SelectBusiness
|
|
|
+ sele.SupplierName = item.SupplierName
|
|
|
+ sele.CreateOn = item.CreateOn
|
|
|
+ sele.AccessCardNo = ""
|
|
|
+ sele.TypeCode = item.SupplierTypeCode
|
|
|
+ sele.TypeName = item.SupplierTypeName
|
|
|
+ sele.Preject = "4"
|
|
|
+ list = append(list, sele)
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
var datainfo DataInfo
|
|
|
datainfo.Items = list
|
|
|
@@ -825,7 +820,6 @@ func (this *SelectController) GetAllBusinesList() {
|
|
|
this.ServeJSON()
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// @Title 文件上传
|
|
|
// @Description get user by tokenaddsubfile
|
|
|
// @Success 200 {object} models.Userblood
|
|
|
@@ -839,11 +833,10 @@ func (this *SelectController) FileList() {
|
|
|
asc := true
|
|
|
Order := this.GetString("Order")
|
|
|
Prop := this.GetString("Prop")
|
|
|
- subfilename := this.GetString("subfileName")
|
|
|
+ subfilename := this.GetString("subfileName")
|
|
|
supplierId := this.GetString("SupplierId")
|
|
|
createOn := this.GetString("CreateOn")
|
|
|
|
|
|
-
|
|
|
if Order != "" && Prop != "" {
|
|
|
orderby = Prop
|
|
|
if Order == "asc" {
|
|
|
@@ -856,9 +849,9 @@ func (this *SelectController) FileList() {
|
|
|
var company supplier.OilSupplier
|
|
|
|
|
|
sql := " UserName='" + this.User.Username + "'"
|
|
|
- svc.GetEntity(®isterUser,sql)
|
|
|
- sql1:= " CreateUserId = '" + this.User.Id + "' or CommercialNo='"+registerUser.CommercialNo+"'"
|
|
|
- svc.GetEntity(&company,sql1)
|
|
|
+ svc.GetEntity(®isterUser, sql)
|
|
|
+ sql1 := " CreateUserId = '" + this.User.Id + "' or CommercialNo='" + registerUser.CommercialNo + "'"
|
|
|
+ svc.GetEntity(&company, sql1)
|
|
|
|
|
|
if supplierId != "0" {
|
|
|
where = where + " and SupplierId=" + supplierId
|
|
|
@@ -866,7 +859,6 @@ func (this *SelectController) FileList() {
|
|
|
where = where + " and SupplierId=" + strconv.Itoa(company.Id)
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if subfilename != "" {
|
|
|
where = where + " and NeedFileType like '%" + subfilename + "%'"
|
|
|
}
|
|
|
@@ -886,6 +878,7 @@ func (this *SelectController) FileList() {
|
|
|
this.Data["json"] = &datainfo
|
|
|
this.ServeJSON()
|
|
|
}
|
|
|
+
|
|
|
// @Title 获取列表
|
|
|
// @Description
|
|
|
// @Success 200 {object}
|
|
|
@@ -946,7 +939,7 @@ func (this *SelectController) GetAllBusinessLicense() {
|
|
|
svc.GetEntities(&supplierList, where)
|
|
|
_dir := utils.Cfg.MustValue("file", "tmplateDir") + needFileType
|
|
|
downFileUrl := "http://" + utils.Cfg.MustValue("server", "localIP")
|
|
|
- for _,item := range supplierList {
|
|
|
+ for _, item := range supplierList {
|
|
|
var supplierFile supplierfile.OilSupplierFile
|
|
|
where := "SupplierId=" + strconv.Itoa(item.Id) + " and NeedFileType='" + needFileType + "'"
|
|
|
has := svc.GetEntity(&supplierFile, where)
|
|
|
@@ -954,19 +947,20 @@ func (this *SelectController) GetAllBusinessLicense() {
|
|
|
fileArr := strings.Split(supplierFile.FileName, ".")
|
|
|
fileUrl := strings.Split(supplierFile.FileUrl, "|")
|
|
|
if len(fileUrl) == 2 && len(fileArr) == 2 {
|
|
|
- utils.DownloadFile( downFileUrl + fileUrl[0], item.SupplierName + "." + fileArr[1] , _dir)
|
|
|
+ utils.DownloadFile(downFileUrl+fileUrl[0], item.SupplierName+"."+fileArr[1], _dir)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//Zip(_dir, utils.Cfg.MustValue("file", "tmplateDir") + "license.zip")
|
|
|
|
|
|
- f1,_ := os.Open(_dir)
|
|
|
+ f1, _ := os.Open(_dir)
|
|
|
var files = []*os.File{f1}
|
|
|
- destZipName := time.Now().Format("2006-01-02")
|
|
|
+
|
|
|
+ //destZipName := time.Now().Format("2006-01-02")
|
|
|
+ destZipName := needFileType
|
|
|
destZip := utils.Cfg.MustValue("file", "tmplateDir") + destZipName + ".zip"
|
|
|
err := Compress(files, destZip)
|
|
|
-
|
|
|
retDocUrl := ""
|
|
|
if err == nil {
|
|
|
var sw *Seaweed
|
|
|
@@ -1006,9 +1000,9 @@ func (this *SelectController) GetBusinessLicenseById() {
|
|
|
var company supplier.OilSupplier
|
|
|
|
|
|
sql := " UserName='" + this.User.Username + "'"
|
|
|
- svc.GetEntity(®isterUser,sql)
|
|
|
- sql1:= " CreateUserId = '" + this.User.Id + "' or CommercialNo='"+registerUser.CommercialNo+"'"
|
|
|
- svc.GetEntity(&company,sql1)
|
|
|
+ svc.GetEntity(®isterUser, sql)
|
|
|
+ sql1 := " CreateUserId = '" + this.User.Id + "' or CommercialNo='" + registerUser.CommercialNo + "'"
|
|
|
+ svc.GetEntity(&company, sql1)
|
|
|
SupplierId = strconv.Itoa(company.Id)
|
|
|
SupplierName = company.SupplierName
|
|
|
}
|
|
|
@@ -1027,17 +1021,17 @@ func (this *SelectController) GetBusinessLicenseById() {
|
|
|
this.ServeJSON()
|
|
|
return
|
|
|
}
|
|
|
- for _,item := range supplierFile {
|
|
|
+ for _, item := range supplierFile {
|
|
|
fileArr := strings.Split(item.FileName, ".")
|
|
|
fileUrl := strings.Split(item.FileUrl, "|")
|
|
|
if len(fileUrl) == 2 && len(fileArr) == 2 {
|
|
|
- utils.DownloadFile( downFileUrl + fileUrl[0], item.NeedFileType + "." + fileArr[1] , _dir)
|
|
|
+ utils.DownloadFile(downFileUrl+fileUrl[0], item.NeedFileType+"."+fileArr[1], _dir)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//Zip(_dir, utils.Cfg.MustValue("file", "tmplateDir") + "license.zip")
|
|
|
|
|
|
- f1,_ := os.Open(_dir)
|
|
|
+ f1, _ := os.Open(_dir)
|
|
|
var files = []*os.File{f1}
|
|
|
if SupplierTypeCode == "01" {
|
|
|
SupplierTypeCode = "WZ"
|
|
|
@@ -1048,10 +1042,9 @@ func (this *SelectController) GetBusinessLicenseById() {
|
|
|
} else {
|
|
|
SupplierTypeCode = ""
|
|
|
}
|
|
|
- destZipName := SupplierName + time.Now().Format("2006-01-02") + SupplierTypeCode
|
|
|
+ destZipName := SupplierName + time.Now().Format("20060102") + SupplierTypeCode
|
|
|
destZip := utils.Cfg.MustValue("file", "tmplateDir") + destZipName + ".zip"
|
|
|
err := Compress(files, destZip)
|
|
|
- fmt.Println("err28==", err)
|
|
|
retDocUrl := ""
|
|
|
if err == nil {
|
|
|
var sw *Seaweed
|
|
|
@@ -1064,12 +1057,8 @@ func (this *SelectController) GetBusinessLicenseById() {
|
|
|
retDocUrl = utils.Cfg.MustValue("file", "downFileHost") + "/" + fID
|
|
|
|
|
|
}
|
|
|
- fmt.Println("==retDocWatermarkUrlZZXZ==", retDocUrl)
|
|
|
- err = os.RemoveAll(destZip)
|
|
|
- fmt.Println(err)
|
|
|
- err = os.RemoveAll(_dir)
|
|
|
- fmt.Println(err)
|
|
|
-
|
|
|
+ os.Remove(destZip)
|
|
|
+ os.RemoveAll(_dir)
|
|
|
errinfo.Code = 0
|
|
|
errinfo.Item = retDocUrl
|
|
|
this.Data["json"] = &errinfo
|
|
|
@@ -1131,7 +1120,6 @@ func compress(file *os.File, prefix string, zw *zip.Writer) error {
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// @Title 获取资质列表
|
|
|
// @Description get user by tokenaddsubfile
|
|
|
// @Success 200 {object} models.Userblood
|
|
|
@@ -1151,15 +1139,3 @@ func (this *SelectController) GetTableHeaderList() {
|
|
|
this.ServeJSON()
|
|
|
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|