|
|
@@ -1,17 +1,18 @@
|
|
|
package oilsupplier
|
|
|
|
|
|
import (
|
|
|
- "dashoo.cn/backend/api/business/oilsupplier/suppliercert"
|
|
|
- "dashoo.cn/business/userRole"
|
|
|
+ "encoding/json"
|
|
|
+ "strconv"
|
|
|
+ "strings"
|
|
|
+ "time"
|
|
|
+
|
|
|
"dashoo.cn/backend/api/business/baseUser"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/supplier"
|
|
|
+ "dashoo.cn/backend/api/business/oilsupplier/suppliercert"
|
|
|
. "dashoo.cn/backend/api/controllers"
|
|
|
+ "dashoo.cn/business/userRole"
|
|
|
"dashoo.cn/utils"
|
|
|
- "encoding/json"
|
|
|
"github.com/go-xorm/xorm"
|
|
|
- "strconv"
|
|
|
- "strings"
|
|
|
- "time"
|
|
|
)
|
|
|
|
|
|
type OilSupplierController struct {
|
|
|
@@ -99,282 +100,226 @@ func (this *OilSupplierController) GetEntityList() {
|
|
|
where = where + " and Id like '%" + Id + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if SupplierName != "" {
|
|
|
where = where + " and SupplierName like '%" + SupplierName + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if OilCertificateNo != "" {
|
|
|
where = where + " and OilCertificateNo like '%" + OilCertificateNo + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if Grade != "" {
|
|
|
where = where + " and Grade like '%" + Grade + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if MgrUnit != "" {
|
|
|
where = where + " and MgrUnit like '%" + MgrUnit + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if OperType != "" {
|
|
|
where = where + " and OperType like '%" + OperType + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if Country != "" {
|
|
|
where = where + " and Country like '%" + Country + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if MaunAgent != "" {
|
|
|
where = where + " and MaunAgent like '%" + MaunAgent + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if ConstructTeam != "" {
|
|
|
where = where + " and ConstructTeam like '%" + ConstructTeam + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if CommercialNo != "" {
|
|
|
where = where + " and CommercialNo like '%" + CommercialNo + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if OrganCode != "" {
|
|
|
where = where + " and OrganCode like '%" + OrganCode + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if CountryTaxNo != "" {
|
|
|
where = where + " and CountryTaxNo like '%" + CountryTaxNo + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if LocalTaxNo != "" {
|
|
|
where = where + " and LocalTaxNo like '%" + LocalTaxNo + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if Address != "" {
|
|
|
where = where + " and Address like '%" + Address + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if Province != "" {
|
|
|
where = where + " and Province like '%" + Province + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if City != "" {
|
|
|
where = where + " and City like '%" + City + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if Street != "" {
|
|
|
where = where + " and Street like '%" + Street + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if HouseNo != "" {
|
|
|
where = where + " and HouseNo like '%" + HouseNo + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if ZipCode != "" {
|
|
|
where = where + " and ZipCode like '%" + ZipCode + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if QualitySystemCert != "" {
|
|
|
where = where + " and QualitySystemCert like '%" + QualitySystemCert + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if ProductQualityCert != "" {
|
|
|
where = where + " and ProductQualityCert like '%" + ProductQualityCert + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if MaunLicense != "" {
|
|
|
where = where + " and MaunLicense like '%" + MaunLicense + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if QualifCert != "" {
|
|
|
where = where + " and QualifCert like '%" + QualifCert + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if QualifCertLevel != "" {
|
|
|
where = where + " and QualifCertLevel like '%" + QualifCertLevel + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if SafetyLicense != "" {
|
|
|
where = where + " and SafetyLicense like '%" + SafetyLicense + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if TechServiceLic != "" {
|
|
|
where = where + " and TechServiceLic like '%" + TechServiceLic + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if TJInNotify != "" {
|
|
|
where = where + " and TJInNotify like '%" + TJInNotify + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if SpecIndustryCert != "" {
|
|
|
where = where + " and SpecIndustryCert like '%" + SpecIndustryCert + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if LegalPerson != "" {
|
|
|
where = where + " and LegalPerson like '%" + LegalPerson + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if CategoryCode != "" {
|
|
|
where = where + " and CategoryCode like '%" + CategoryCode + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if CategoryName != "" {
|
|
|
where = where + " and CategoryName like '%" + CategoryName + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if RegCapital != "" {
|
|
|
where = where + " and RegCapital like '%" + RegCapital + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if Currency != "" {
|
|
|
where = where + " and Currency like '%" + Currency + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if ContactName != "" {
|
|
|
where = where + " and ContactName like '%" + ContactName + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if CompanyType != "" {
|
|
|
where = where + " and CompanyType like '%" + CompanyType + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if SetupTime != "" {
|
|
|
where = where + " and SetupTime like '%" + SetupTime + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if DepositBank != "" {
|
|
|
where = where + " and DepositBank like '%" + DepositBank + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if BankAccount != "" {
|
|
|
where = where + " and BankAccount like '%" + BankAccount + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if EMail != "" {
|
|
|
where = where + " and EMail like '%" + EMail + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if BankCreditRating != "" {
|
|
|
where = where + " and BankCreditRating like '%" + BankCreditRating + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if Mobile != "" {
|
|
|
where = where + " and Mobile like '%" + Mobile + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if Telphone != "" {
|
|
|
where = where + " and Telphone like '%" + Telphone + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if Fax != "" {
|
|
|
where = where + " and Fax like '%" + Fax + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if CompanyTel != "" {
|
|
|
where = where + " and CompanyTel like '%" + CompanyTel + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if QQ != "" {
|
|
|
where = where + " and QQ like '%" + QQ + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if CompanyUrl != "" {
|
|
|
where = where + " and CompanyUrl like '%" + CompanyUrl + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if SpecSupplier != "" {
|
|
|
where = where + " and SpecSupplier like '%" + SpecSupplier + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if SpecTypeCode != "" {
|
|
|
where = where + " and SpecTypeCode like '%" + SpecTypeCode + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if SpecTypeName != "" {
|
|
|
where = where + " and SpecTypeName like '%" + SpecTypeName + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if Remark != "" {
|
|
|
where = where + " and Remark like '%" + Remark + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if IsDelete != "" {
|
|
|
where = where + " and IsDelete like '%" + IsDelete + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if CreateUserId != "" {
|
|
|
where = where + " and CreateUserId like '%" + CreateUserId + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if CreateBy != "" {
|
|
|
where = where + " and CreateBy like '%" + CreateBy + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if ModifiedOn != "" {
|
|
|
where = where + " and ModifiedOn like '%" + ModifiedOn + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if ModifiedUserId != "" {
|
|
|
where = where + " and ModifiedUserId like '%" + ModifiedUserId + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if ModifiedBy != "" {
|
|
|
where = where + " and ModifiedBy like '%" + ModifiedBy + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if CreateOn != "" {
|
|
|
dates := strings.Split(CreateOn, ",")
|
|
|
if len(dates) == 2 {
|
|
|
@@ -468,252 +413,202 @@ func (this *OilSupplierController) GetJoinCertEntityList() {
|
|
|
CreateOn := this.GetString("CreateOn")
|
|
|
SupplierTypeCode := this.GetString("SupplierTypeCode")
|
|
|
|
|
|
-
|
|
|
if Id != "" {
|
|
|
where = where + " and a.Id like '%" + Id + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if SupplierName != "" {
|
|
|
where = where + " and a.SupplierName like '%" + SupplierName + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
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 + "%'"
|
|
|
}
|
|
|
|
|
|
-
|
|
|
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 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 + "%'"
|
|
|
}
|
|
|
@@ -826,7 +721,7 @@ func (this *OilSupplierController) GetEntityAndCert() {
|
|
|
svc.GetEntityByIdBytbl(OilSupplierName, Id, &model)
|
|
|
|
|
|
var sql string
|
|
|
- sql = `select a.*, b.Id as CertId, b.AccessCardNo, b.SupplierTypeCode, b.SupplierTypeName, b.Step from ` + OilSupplierName + ` a `
|
|
|
+ sql = `select a.*, b.Id as CertId, b.AccessCardNo, b.SupplierTypeCode, b.SupplierTypeName, b.Step, b.WorkerTotal, b.ContractNum, b.UniversityNum, b.TechnicalNum, b.AboveProfNum, b.MiddleProfNum, b.NationalRegNum, b.NationalCertTotal, b.DesignerTotal, b.SkillerTotal from ` + OilSupplierName + ` a `
|
|
|
sql += ` left join ` + OilSupplierCertName + " b on b.SupplierId = a.Id"
|
|
|
sql += ` where b.Id ='` + Id + `'`
|
|
|
utils.DBE.SQL(sql).Get(&model)
|
|
|
@@ -856,7 +751,6 @@ func (this *OilSupplierController) AddEntity() {
|
|
|
model.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
//model.OrganizeId, _ = utils.StrTo(this.User.DepartmentId).Int()
|
|
|
|
|
|
-
|
|
|
defer session.Close()
|
|
|
err := session.Begin()
|
|
|
_, err = svc.InsertEntityBytbl(OilSupplierName, &model)
|
|
|
@@ -1047,8 +941,6 @@ func (this *OilSupplierController) UpdateEntity() {
|
|
|
"ModifiedUserId",
|
|
|
|
|
|
"ModifiedBy",
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
err := svc.UpdateEntityBytbl(OilSupplierName, id, &model, cols)
|
|
|
if err == nil {
|
|
|
@@ -1082,7 +974,6 @@ func (this *OilSupplierController) UpdateNumberEntity() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-
|
|
|
var modelCert suppliercert.OilSupplierCert
|
|
|
svcCert := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
|
|
|
|
@@ -1092,8 +983,6 @@ func (this *OilSupplierController) UpdateNumberEntity() {
|
|
|
modelCert.ModifiedBy = this.User.Realname
|
|
|
modelCert.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
|
|
|
-
|
|
|
-
|
|
|
colcerts := []string{
|
|
|
"Id",
|
|
|
"WorkerTotal",
|
|
|
@@ -1106,11 +995,8 @@ func (this *OilSupplierController) UpdateNumberEntity() {
|
|
|
"NationalCertTotal",
|
|
|
"DesignerTotal",
|
|
|
"SkillerTotal",
|
|
|
-
|
|
|
"ModifiedOn",
|
|
|
-
|
|
|
"ModifiedUserId",
|
|
|
-
|
|
|
"ModifiedBy",
|
|
|
}
|
|
|
if modelCert.Step <= 2 {
|
|
|
@@ -1120,7 +1006,6 @@ func (this *OilSupplierController) UpdateNumberEntity() {
|
|
|
|
|
|
err := svcCert.UpdateEntityBytbl(OilSupplierCertName, certId, &modelCert, colcerts)
|
|
|
|
|
|
-
|
|
|
if err == nil {
|
|
|
errinfo.Message = "保存成功!"
|
|
|
errinfo.Code = 0
|
|
|
@@ -1177,4 +1062,3 @@ func (this *OilSupplierController) StartAudit() {
|
|
|
svcFlow := supplier.GetOilSupplierService(utils.DBE)
|
|
|
svcFlow.StartAudit()
|
|
|
}
|
|
|
-
|