|
|
@@ -1,6 +1,7 @@
|
|
|
package oilsupplier
|
|
|
|
|
|
import (
|
|
|
+ "dashoo.cn/backend/api/business/workflow"
|
|
|
"encoding/json"
|
|
|
"strconv"
|
|
|
"strings"
|
|
|
@@ -629,38 +630,314 @@ func (this *OilSupplierController) GetJoinCertEntityList() {
|
|
|
svc := supplier.GetOilSupplierService(utils.DBE)
|
|
|
var list []supplier.OilSupplierView
|
|
|
|
|
|
- var total int64
|
|
|
- if where == "" {
|
|
|
- where = " 1=1 "
|
|
|
+ total := svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, page.CurrentPage, page.Size, orderby, asc, &list, where)
|
|
|
+
|
|
|
+ var datainfo DataInfo
|
|
|
+ datainfo.Items = list
|
|
|
+ datainfo.CurrentItemCount = total
|
|
|
+ datainfo.PageIndex = page.CurrentPage
|
|
|
+ datainfo.ItemsPerPage = page.Size
|
|
|
+ this.Data["json"] = &datainfo
|
|
|
+ this.ServeJSON()
|
|
|
+}
|
|
|
+
|
|
|
+// @Title 获取列表
|
|
|
+// @Description get user by token
|
|
|
+// @Success 200 {object} []supplier.OilSupplierView
|
|
|
+// @router /mytasks [get]
|
|
|
+func (this *OilSupplierController) GetMyTaskEntityList() {
|
|
|
+
|
|
|
+ //获取分页信息
|
|
|
+ page := this.GetPageInfoForm()
|
|
|
+ where := " 1=1 "
|
|
|
+ orderby := "Id"
|
|
|
+ asc := false
|
|
|
+ Order := this.GetString("Order")
|
|
|
+ Prop := this.GetString("Prop")
|
|
|
+ if Order != "" && Prop != "" {
|
|
|
+ orderby = Prop
|
|
|
+ if Order == "asc" {
|
|
|
+ asc = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Id := this.GetString("Id")
|
|
|
+ SupplierName := this.GetString("SupplierName")
|
|
|
+ OilCertificateNo := this.GetString("OilCertificateNo")
|
|
|
+ Grade := this.GetString("Grade")
|
|
|
+ MgrUnit := this.GetString("MgrUnit")
|
|
|
+ OperType := this.GetString("OperType")
|
|
|
+ Country := this.GetString("Country")
|
|
|
+ MaunAgent := this.GetString("MaunAgent")
|
|
|
+ ConstructTeam := this.GetString("ConstructTeam")
|
|
|
+ CommercialNo := this.GetString("CommercialNo")
|
|
|
+ OrganCode := this.GetString("OrganCode")
|
|
|
+ CountryTaxNo := this.GetString("CountryTaxNo")
|
|
|
+ LocalTaxNo := this.GetString("LocalTaxNo")
|
|
|
+ Address := this.GetString("Address")
|
|
|
+ Province := this.GetString("Province")
|
|
|
+ City := this.GetString("City")
|
|
|
+ Street := this.GetString("Street")
|
|
|
+ HouseNo := this.GetString("HouseNo")
|
|
|
+ ZipCode := this.GetString("ZipCode")
|
|
|
+ QualitySystemCert := this.GetString("QualitySystemCert")
|
|
|
+ ProductQualityCert := this.GetString("ProductQualityCert")
|
|
|
+ MaunLicense := this.GetString("MaunLicense")
|
|
|
+ QualifCert := this.GetString("QualifCert")
|
|
|
+ QualifCertLevel := this.GetString("QualifCertLevel")
|
|
|
+ SafetyLicense := this.GetString("SafetyLicense")
|
|
|
+ TechServiceLic := this.GetString("TechServiceLic")
|
|
|
+ TJInNotify := this.GetString("TJInNotify")
|
|
|
+ SpecIndustryCert := this.GetString("SpecIndustryCert")
|
|
|
+ LegalPerson := this.GetString("LegalPerson")
|
|
|
+ CategoryCode := this.GetString("CategoryCode")
|
|
|
+ CategoryName := this.GetString("CategoryName")
|
|
|
+ RegCapital := this.GetString("RegCapital")
|
|
|
+ Currency := this.GetString("Currency")
|
|
|
+ ContactName := this.GetString("ContactName")
|
|
|
+ CompanyType := this.GetString("CompanyType")
|
|
|
+ SetupTime := this.GetString("SetupTime")
|
|
|
+ DepositBank := this.GetString("DepositBank")
|
|
|
+ BankAccount := this.GetString("BankAccount")
|
|
|
+ EMail := this.GetString("EMail")
|
|
|
+ BankCreditRating := this.GetString("BankCreditRating")
|
|
|
+ Mobile := this.GetString("Mobile")
|
|
|
+ Telphone := this.GetString("Telphone")
|
|
|
+ Fax := this.GetString("Fax")
|
|
|
+ CompanyTel := this.GetString("CompanyTel")
|
|
|
+ QQ := this.GetString("QQ")
|
|
|
+ CompanyUrl := this.GetString("CompanyUrl")
|
|
|
+ SpecSupplier := this.GetString("SpecSupplier")
|
|
|
+ SpecTypeCode := this.GetString("SpecTypeCode")
|
|
|
+ SpecTypeName := this.GetString("SpecTypeName")
|
|
|
+ Remark := this.GetString("Remark")
|
|
|
+ CreateOn := this.GetString("CreateOn")
|
|
|
+ SupplierTypeCode := this.GetString("SupplierTypeCode")
|
|
|
+
|
|
|
+ if Id != "" {
|
|
|
+ where = where + " and a.Id like '%" + Id + "%'"
|
|
|
}
|
|
|
|
|
|
- //获取总记录数
|
|
|
- sqlCount := `select count(*) from ` + OilSupplierName + ` a `
|
|
|
- sqlCount += ` left join ` + OilSupplierCertName + " b on b.SupplierId = a.Id"
|
|
|
- sqlCount += ` where ` + where
|
|
|
+ if SupplierName != "" {
|
|
|
+ where = where + " and a.SupplierName like '%" + SupplierName + "%'"
|
|
|
+ }
|
|
|
|
|
|
- var sql string
|
|
|
- sql = `select a.*, b.Id as CertId, b.AccessCardNo, b.SupplierTypeCode, b.SupplierTypeName from ` + OilSupplierName + ` a `
|
|
|
- sql += ` left join ` + OilSupplierCertName + " b on b.SupplierId = a.Id"
|
|
|
- sql += ` where ` + where
|
|
|
- if asc {
|
|
|
- sql += ` order by ` + orderby + ` ASC `
|
|
|
- } else {
|
|
|
- sql += ` order by ` + orderby + ` DESC `
|
|
|
+ if OilCertificateNo != "" {
|
|
|
+ where = where + " and a.OilCertificateNo like '%" + OilCertificateNo + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if Grade != "" {
|
|
|
+ where = where + " and a.Grade like '%" + Grade + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if MgrUnit != "" {
|
|
|
+ where = where + " and a.MgrUnit like '%" + MgrUnit + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if OperType != "" {
|
|
|
+ where = where + " and a.OperType like '%" + OperType + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if Country != "" {
|
|
|
+ where = where + " and a.Country like '%" + Country + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if MaunAgent != "" {
|
|
|
+ where = where + " and a.MaunAgent like '%" + MaunAgent + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if ConstructTeam != "" {
|
|
|
+ where = where + " and a.ConstructTeam like '%" + ConstructTeam + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if CommercialNo != "" {
|
|
|
+ where = where + " and a.CommercialNo like '%" + CommercialNo + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if OrganCode != "" {
|
|
|
+ where = where + " and a.OrganCode like '%" + OrganCode + "%'"
|
|
|
}
|
|
|
- sql += ` limit ` + utils.ToStr((page.CurrentPage-1)*page.Size) + "," + utils.ToStr(page.Size)
|
|
|
- utils.DBE.SQL(sql).Find(&list)
|
|
|
|
|
|
- resultsSlice, _ := svc.DBE.Query(sqlCount)
|
|
|
+ if CountryTaxNo != "" {
|
|
|
+ where = where + " and a.CountryTaxNo like '%" + CountryTaxNo + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if LocalTaxNo != "" {
|
|
|
+ where = where + " and a.LocalTaxNo like '%" + LocalTaxNo + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if Address != "" {
|
|
|
+ where = where + " and a.Address like '%" + Address + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if Province != "" {
|
|
|
+ where = where + " and a.Province like '%" + Province + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if City != "" {
|
|
|
+ where = where + " and a.City like '%" + City + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if Street != "" {
|
|
|
+ where = where + " and a.Street like '%" + Street + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if HouseNo != "" {
|
|
|
+ where = where + " and a.HouseNo like '%" + HouseNo + "%'"
|
|
|
+ }
|
|
|
|
|
|
- if len(resultsSlice) > 0 {
|
|
|
- results := resultsSlice[0]
|
|
|
- for _, value := range results {
|
|
|
- total, _ = strconv.ParseInt(string(value), 10, 64)
|
|
|
- break
|
|
|
+ if ZipCode != "" {
|
|
|
+ where = where + " and a.ZipCode like '%" + ZipCode + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if QualitySystemCert != "" {
|
|
|
+ where = where + " and a.QualitySystemCert like '%" + QualitySystemCert + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if ProductQualityCert != "" {
|
|
|
+ where = where + " and a.ProductQualityCert like '%" + ProductQualityCert + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if MaunLicense != "" {
|
|
|
+ where = where + " and a.MaunLicense like '%" + MaunLicense + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if QualifCert != "" {
|
|
|
+ where = where + " and a.QualifCert like '%" + QualifCert + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if QualifCertLevel != "" {
|
|
|
+ where = where + " and a.QualifCertLevel like '%" + QualifCertLevel + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if SafetyLicense != "" {
|
|
|
+ where = where + " and a.SafetyLicense like '%" + SafetyLicense + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if TechServiceLic != "" {
|
|
|
+ where = where + " and a.TechServiceLic like '%" + TechServiceLic + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if TJInNotify != "" {
|
|
|
+ where = where + " and a.TJInNotify like '%" + TJInNotify + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if SpecIndustryCert != "" {
|
|
|
+ where = where + " and a.SpecIndustryCert like '%" + SpecIndustryCert + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if LegalPerson != "" {
|
|
|
+ where = where + " and a.LegalPerson like '%" + LegalPerson + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if CategoryCode != "" {
|
|
|
+ where = where + " and a.CategoryCode like '%" + CategoryCode + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if CategoryName != "" {
|
|
|
+ where = where + " and a.CategoryName like '%" + CategoryName + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if RegCapital != "" {
|
|
|
+ where = where + " and a.RegCapital like '%" + RegCapital + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if Currency != "" {
|
|
|
+ where = where + " and a.Currency like '%" + Currency + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if ContactName != "" {
|
|
|
+ where = where + " and a.ContactName like '%" + ContactName + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if CompanyType != "" {
|
|
|
+ where = where + " and a.CompanyType like '%" + CompanyType + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if SetupTime != "" {
|
|
|
+ where = where + " and a.SetupTime like '%" + SetupTime + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if DepositBank != "" {
|
|
|
+ where = where + " and a.DepositBank like '%" + DepositBank + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if BankAccount != "" {
|
|
|
+ where = where + " and a.BankAccount like '%" + BankAccount + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if EMail != "" {
|
|
|
+ where = where + " and a.EMail like '%" + EMail + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if BankCreditRating != "" {
|
|
|
+ where = where + " and a.BankCreditRating like '%" + BankCreditRating + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if Mobile != "" {
|
|
|
+ where = where + " and a.Mobile like '%" + Mobile + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if Telphone != "" {
|
|
|
+ where = where + " and a.Telphone like '%" + Telphone + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if Fax != "" {
|
|
|
+ where = where + " and a.Fax like '%" + Fax + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if CompanyTel != "" {
|
|
|
+ where = where + " and a.CompanyTel like '%" + CompanyTel + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if QQ != "" {
|
|
|
+ where = where + " and a.QQ like '%" + QQ + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if CompanyUrl != "" {
|
|
|
+ where = where + " and a.CompanyUrl like '%" + CompanyUrl + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if SpecSupplier != "" {
|
|
|
+ where = where + " and a.SpecSupplier like '%" + SpecSupplier + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if SpecTypeCode != "" {
|
|
|
+ where = where + " and a.SpecTypeCode like '%" + SpecTypeCode + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if SpecTypeName != "" {
|
|
|
+ where = where + " and a.SpecTypeName like '%" + SpecTypeName + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if Remark != "" {
|
|
|
+ where = where + " and a.Remark like '%" + Remark + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ 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 + "'"
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if SupplierTypeCode != "" {
|
|
|
+ where = where + " and b.SupplierTypeCode = '" + SupplierTypeCode + "'"
|
|
|
+ }
|
|
|
+
|
|
|
+ //找出待办任务
|
|
|
+ actisvc := workflow.GetActivitiService(utils.DBE)
|
|
|
+ certIdList := actisvc.GetMyTasks(workflow.OIL_SUPPLIER_APPLY, this.User.Id)
|
|
|
+ where += "b.Id in (" + certIdList + ")"
|
|
|
+ //根据部门查询待办任务
|
|
|
+
|
|
|
+
|
|
|
+ svc := supplier.GetOilSupplierService(utils.DBE)
|
|
|
+ var list []supplier.OilSupplierView
|
|
|
+
|
|
|
+ total := svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, page.CurrentPage, page.Size, orderby, asc, &list, where)
|
|
|
+
|
|
|
var datainfo DataInfo
|
|
|
datainfo.Items = list
|
|
|
datainfo.CurrentItemCount = total
|
|
|
@@ -1052,13 +1329,3 @@ func (this *OilSupplierController) DeleteEntity() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// @Title 启动工作流
|
|
|
-// @Description 启动工作流
|
|
|
-// @Param body body supplier.OilSupplier
|
|
|
-// @Success 200 {object} controllers.Request
|
|
|
-// @router /workflow/:id [post]
|
|
|
-func (this *OilSupplierController) StartAudit() {
|
|
|
- //测试多实例工作流
|
|
|
- svcFlow := supplier.GetOilSupplierService(utils.DBE)
|
|
|
- svcFlow.StartAudit()
|
|
|
-}
|