|
|
@@ -573,6 +573,7 @@ func (this *BadRecordController) SerachGoodsCertByCompany() {
|
|
|
size := this.GetString("_size")
|
|
|
certName := this.GetString("_certName")
|
|
|
certSubStatus := this.GetString("_certSubStatus")
|
|
|
+ badStatus := this.GetString("badStatus")
|
|
|
|
|
|
sqlAdd:=""
|
|
|
cwhere := ""
|
|
|
@@ -584,12 +585,15 @@ func (this *BadRecordController) SerachGoodsCertByCompany() {
|
|
|
sqlAdd= sqlAdd + " and (a.CertSubStatus = '"+certSubStatus+"')"
|
|
|
cwhere = cwhere + " and (CertSubStatus = '"+certSubStatus+"')"
|
|
|
}
|
|
|
+ if badStatus != "" {
|
|
|
+ sqlAdd = sqlAdd + " and b.Id is not null"
|
|
|
+ }
|
|
|
sizeIntPage,_:=strconv.Atoi(size)
|
|
|
currentIntPage,_:=strconv.Atoi(currentPage)
|
|
|
ye:=strconv.Itoa((currentIntPage-1)*sizeIntPage)
|
|
|
|
|
|
svc := BadRecord.GetBadRecordService(utils.DBE) //获得数据库引擎
|
|
|
- var tempEntity suppliercertsub.OilSupplierCertSub
|
|
|
+ //var tempEntity suppliercertsub.OilSupplierCertSub
|
|
|
|
|
|
var goodslist []map[string]string
|
|
|
sql := "select a.*, b.CreateOn badCreateOn, b.BackReason from " + OilSupplierCertSubName + " a"
|
|
|
@@ -597,11 +601,11 @@ func (this *BadRecordController) SerachGoodsCertByCompany() {
|
|
|
sql = sql + " where a.SupplierId='"+companyId+"' and a.SupplierTypeCode='01' "+ sqlAdd +" order by a.CertSubStatus desc,a.Id asc limit "+ye+","+size+""
|
|
|
goodslist, _ = svc.DBE.QueryString(sql)
|
|
|
|
|
|
- goodsTotal,_:=svc.GetCount(tempEntity,"SupplierId='"+companyId+"' and SupplierTypeCode='01' "+ cwhere +"")
|
|
|
-
|
|
|
+ //goodsTotal,_:=svc.GetCount(tempEntity,"SupplierId='"+companyId+"' and SupplierTypeCode='01' "+ cwhere +"")
|
|
|
+ goodsTotal := len(goodslist)
|
|
|
var datainfo DataInfo
|
|
|
datainfo.Items = goodslist
|
|
|
- datainfo.CurrentItemCount = goodsTotal
|
|
|
+ datainfo.CurrentItemCount = int64(goodsTotal)
|
|
|
this.Data["json"] = &datainfo
|
|
|
this.ServeJSON()
|
|
|
|
|
|
@@ -617,6 +621,7 @@ func (this *BadRecordController) SerachBasisCertByCompany() {
|
|
|
size := this.GetString("_size")
|
|
|
certName := this.GetString("_certName")
|
|
|
certSubStatus := this.GetString("_certSubStatus")
|
|
|
+ badStatus := this.GetString("badStatus")
|
|
|
sqlAdd:=""
|
|
|
cwhere := ""
|
|
|
if certName!=""{
|
|
|
@@ -628,13 +633,15 @@ func (this *BadRecordController) SerachBasisCertByCompany() {
|
|
|
sqlAdd = sqlAdd + " and (a.CertSubStatus = '"+certSubStatus+"')"
|
|
|
cwhere = cwhere + " and (CertSubStatus = '"+certSubStatus+"')"
|
|
|
}
|
|
|
-
|
|
|
+ if badStatus != "" {
|
|
|
+ sqlAdd = sqlAdd + " and b.Id is not null"
|
|
|
+ }
|
|
|
sizeIntPage,_:=strconv.Atoi(size)
|
|
|
currentIntPage,_:=strconv.Atoi(currentPage)
|
|
|
ye:=strconv.Itoa((currentIntPage-1)*sizeIntPage)
|
|
|
|
|
|
svc := BadRecord.GetBadRecordService(utils.DBE) //获得数据库引擎
|
|
|
- var tempEntity suppliercertsub.OilSupplierCertSub
|
|
|
+ //var tempEntity suppliercertsub.OilSupplierCertSub
|
|
|
|
|
|
var basislist []map[string]string
|
|
|
sql := "select a.*, b.CreateOn badCreateOn, b.BackReason from " + OilSupplierCertSubName + " a"
|
|
|
@@ -642,10 +649,13 @@ func (this *BadRecordController) SerachBasisCertByCompany() {
|
|
|
sql = sql + " where a.SupplierId='"+companyId+"' and a.SupplierTypeCode='02' "+ sqlAdd +" order by a.CertSubStatus desc,a.Id asc limit "+ye+","+size+""
|
|
|
basislist, _ = svc.DBE.QueryString(sql)
|
|
|
|
|
|
- basisTotal,_:=svc.GetCount(tempEntity,"SupplierId='"+companyId+"' and SupplierTypeCode='02' "+ cwhere +"")
|
|
|
+ //basisTotal,_:=svc.GetCount(tempEntity,"SupplierId='"+companyId+"' and SupplierTypeCode='02' "+ cwhere +"")
|
|
|
+
|
|
|
+ basisTotal := len(basislist)
|
|
|
+
|
|
|
var datainfo DataInfo
|
|
|
datainfo.Items = basislist
|
|
|
- datainfo.CurrentItemCount = basisTotal
|
|
|
+ datainfo.CurrentItemCount = int64(basisTotal)
|
|
|
this.Data["json"] = &datainfo
|
|
|
this.ServeJSON()
|
|
|
|
|
|
@@ -661,7 +671,7 @@ func (this *BadRecordController) SerachTCCertByCompany() {
|
|
|
size := this.GetString("_size")
|
|
|
certName := this.GetString("_certName")
|
|
|
certSubStatus := this.GetString("_certSubStatus")
|
|
|
-
|
|
|
+ badStatus := this.GetString("badStatus")
|
|
|
sqlAdd:=""
|
|
|
cwhere := ""
|
|
|
if certName!=""{
|
|
|
@@ -672,13 +682,15 @@ func (this *BadRecordController) SerachTCCertByCompany() {
|
|
|
sqlAdd = sqlAdd + " and (a.CertSubStatus = '"+certSubStatus+"')"
|
|
|
cwhere = cwhere + " and (CertSubStatus = '"+certSubStatus+"')"
|
|
|
}
|
|
|
-
|
|
|
+ if badStatus != "" {
|
|
|
+ sqlAdd = sqlAdd + " and b.Id is not null"
|
|
|
+ }
|
|
|
sizeIntPage,_:=strconv.Atoi(size)
|
|
|
currentIntPage,_:=strconv.Atoi(currentPage)
|
|
|
ye:=strconv.Itoa((currentIntPage-1)*sizeIntPage)
|
|
|
|
|
|
svc := BadRecord.GetBadRecordService(utils.DBE) //获得数据库引擎
|
|
|
- var tempEntity suppliercertsub.OilSupplierCertSub
|
|
|
+ //var tempEntity suppliercertsub.OilSupplierCertSub
|
|
|
|
|
|
var tclist []map[string]string
|
|
|
sql := "select a.*, b.CreateOn badCreateOn, b.BackReason from " + OilSupplierCertSubName + " a"
|
|
|
@@ -686,11 +698,11 @@ func (this *BadRecordController) SerachTCCertByCompany() {
|
|
|
sql = sql + " where a.SupplierId='"+companyId+"' and a.SupplierTypeCode='03' "+ sqlAdd +" order by a.CertSubStatus desc,a.Id asc limit "+ye+","+size+""
|
|
|
tclist, _ = svc.DBE.QueryString(sql)
|
|
|
|
|
|
- tcTotal,_:=svc.GetCount(tempEntity,"SupplierId='"+companyId+"' and SupplierTypeCode='03' "+ cwhere +"")
|
|
|
-
|
|
|
+ //tcTotal,_:=svc.GetCount(tempEntity,"SupplierId='"+companyId+"' and SupplierTypeCode='03' "+ cwhere +"")
|
|
|
+ tcTotal := len(tclist)
|
|
|
var datainfo DataInfo
|
|
|
datainfo.Items = tclist
|
|
|
- datainfo.CurrentItemCount = tcTotal
|
|
|
+ datainfo.CurrentItemCount = int64(tcTotal)
|
|
|
this.Data["json"] = &datainfo
|
|
|
this.ServeJSON()
|
|
|
|