|
|
@@ -55,7 +55,7 @@ func (this *OilTechnologyServiceController) GetEntityList() {
|
|
|
orderby = Prop
|
|
|
if Order == "asc" {
|
|
|
asc = true
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
asc = false
|
|
|
}
|
|
|
}
|
|
|
@@ -71,7 +71,7 @@ func (this *OilTechnologyServiceController) GetEntityList() {
|
|
|
Code4 := this.GetString("Code4")
|
|
|
Name4 := this.GetString("Name4")
|
|
|
if Code != "" {
|
|
|
- where = where + " and Code like '%" + Code + "%'"
|
|
|
+ where = where + " and Code like '" + Code + "%'"
|
|
|
}
|
|
|
|
|
|
if Name != "" {
|
|
|
@@ -165,7 +165,7 @@ func (this *OilTechnologyServiceController) GetEntity() {
|
|
|
var model technologyservice.OilTechnologyServiceView
|
|
|
svc := technologyservice.GetOilTechnologyServiceService(utils.DBE)
|
|
|
//svc.GetEntityByIdBytbl(""+OilTechnologyServiceName, Id, &model)
|
|
|
- where := " Id ="+ Id
|
|
|
+ where := " Id =" + Id
|
|
|
svc.GetEntityByWhere(OilTechsrvDetailViewName, where, &model)
|
|
|
|
|
|
this.Data["json"] = &model
|
|
|
@@ -450,8 +450,8 @@ func (this *OilTechnologyServiceController) UpdateCodeEntity() {
|
|
|
colsName := []string{"Name"}
|
|
|
colsCode := []string{"Code"}
|
|
|
//svc.GetEntityById(id, &model)
|
|
|
- if classall.Name1 != ""{
|
|
|
- where := " Name = '" + classall.Name1 +"' and Id <> "+utils.ToStr(classall.Id1)
|
|
|
+ if classall.Name1 != "" {
|
|
|
+ where := " Name = '" + classall.Name1 + "' and Id <> " + utils.ToStr(classall.Id1)
|
|
|
svc.GetEntitysByWhere(OilTechnologyServiceClassName, where, &classmodel)
|
|
|
if len(classmodel) > 0 {
|
|
|
errinfo.Message = "一级名称已存在,请重新添加!"
|
|
|
@@ -459,13 +459,13 @@ func (this *OilTechnologyServiceController) UpdateCodeEntity() {
|
|
|
this.Data["json"] = &errinfo
|
|
|
this.ServeJSON()
|
|
|
return
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
model.Name = classall.Name1
|
|
|
err = svc.UpdateEntityBytbl(OilTechnologyServiceClassName, classall.Id1, &model, colsName)
|
|
|
}
|
|
|
}
|
|
|
- if classall.Name2 != ""{
|
|
|
- where := " Name = '" + classall.Name2 +"' and Id <> "+utils.ToStr(classall.Id2)
|
|
|
+ if classall.Name2 != "" {
|
|
|
+ where := " Name = '" + classall.Name2 + "' and Id <> " + utils.ToStr(classall.Id2)
|
|
|
svc.GetEntitysByWhere(OilTechnologyServiceClassName, where, &classmodel)
|
|
|
if len(classmodel) > 0 {
|
|
|
errinfo.Message = "二级名称已存在,请重新添加!"
|
|
|
@@ -473,13 +473,13 @@ func (this *OilTechnologyServiceController) UpdateCodeEntity() {
|
|
|
this.Data["json"] = &errinfo
|
|
|
this.ServeJSON()
|
|
|
return
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
model.Name = classall.Name2
|
|
|
err = svc.UpdateEntityBytbl(OilTechnologyServiceClassName, classall.Id2, &model, colsName)
|
|
|
}
|
|
|
}
|
|
|
- if classall.Name3 != ""{
|
|
|
- where := " Name = '" + classall.Name3 +"' and Id <> "+utils.ToStr(classall.Id3)
|
|
|
+ if classall.Name3 != "" {
|
|
|
+ where := " Name = '" + classall.Name3 + "' and Id <> " + utils.ToStr(classall.Id3)
|
|
|
svc.GetEntitysByWhere(OilTechnologyServiceClassName, where, &classmodel)
|
|
|
if len(classmodel) > 0 {
|
|
|
errinfo.Message = "三级名称已存在,请重新添加!"
|
|
|
@@ -487,13 +487,13 @@ func (this *OilTechnologyServiceController) UpdateCodeEntity() {
|
|
|
this.Data["json"] = &errinfo
|
|
|
this.ServeJSON()
|
|
|
return
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
model.Name = classall.Name3
|
|
|
err = svc.UpdateEntityBytbl(OilTechnologyServiceClassName, classall.Id3, &model, colsName)
|
|
|
}
|
|
|
}
|
|
|
- if classall.Name4 != ""{
|
|
|
- where := " Name = '" + classall.Name4 + "' and Id <> "+utils.ToStr(classall.Id4)
|
|
|
+ if classall.Name4 != "" {
|
|
|
+ where := " Name = '" + classall.Name4 + "' and Id <> " + utils.ToStr(classall.Id4)
|
|
|
svc.GetEntitysByWhere(OilTechnologyServiceClassName, where, &classmodel)
|
|
|
if len(classmodel) > 0 {
|
|
|
errinfo.Message = "四级名称已存在,请重新添加!"
|
|
|
@@ -501,13 +501,13 @@ func (this *OilTechnologyServiceController) UpdateCodeEntity() {
|
|
|
this.Data["json"] = &errinfo
|
|
|
this.ServeJSON()
|
|
|
return
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
model.Name = classall.Name4
|
|
|
err = svc.UpdateEntityBytbl(OilTechnologyServiceClassName, classall.Id4, &model, colsName)
|
|
|
}
|
|
|
}
|
|
|
- if classall.Code1 != ""{
|
|
|
- where := " Code = " + classall.Code1 +" and Id <> "+utils.ToStr(classall.Id1)
|
|
|
+ if classall.Code1 != "" {
|
|
|
+ where := " Code = " + classall.Code1 + " and Id <> " + utils.ToStr(classall.Id1)
|
|
|
svc.GetEntitysByWhere(OilTechnologyServiceClassName, where, &classmodel)
|
|
|
if len(classmodel) > 0 {
|
|
|
errinfo.Message = "一级编码已存在,请重新添加!"
|
|
|
@@ -515,13 +515,13 @@ func (this *OilTechnologyServiceController) UpdateCodeEntity() {
|
|
|
this.Data["json"] = &errinfo
|
|
|
this.ServeJSON()
|
|
|
return
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
model.Code = classall.Code1
|
|
|
err = svc.UpdateEntityBytbl(OilTechnologyServiceClassName, classall.Id1, &model, colsCode)
|
|
|
}
|
|
|
}
|
|
|
- if classall.Code2 != ""{
|
|
|
- where := " Code = " + classall.Code2 +" and Id <> "+utils.ToStr(classall.Id2)
|
|
|
+ if classall.Code2 != "" {
|
|
|
+ where := " Code = " + classall.Code2 + " and Id <> " + utils.ToStr(classall.Id2)
|
|
|
svc.GetEntitysByWhere(OilTechnologyServiceClassName, where, &classmodel)
|
|
|
if len(classmodel) > 0 {
|
|
|
errinfo.Message = "二级编码已存在,请重新添加!"
|
|
|
@@ -529,13 +529,13 @@ func (this *OilTechnologyServiceController) UpdateCodeEntity() {
|
|
|
this.Data["json"] = &errinfo
|
|
|
this.ServeJSON()
|
|
|
return
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
model.Code = classall.Code2
|
|
|
err = svc.UpdateEntityBytbl(OilTechnologyServiceClassName, classall.Id2, &model, colsCode)
|
|
|
}
|
|
|
}
|
|
|
- if classall.Code3 != ""{
|
|
|
- where := " Code = " + classall.Code3 +" and Id <> "+utils.ToStr(classall.Id3)
|
|
|
+ if classall.Code3 != "" {
|
|
|
+ where := " Code = " + classall.Code3 + " and Id <> " + utils.ToStr(classall.Id3)
|
|
|
svc.GetEntitysByWhere(OilTechnologyServiceClassName, where, &classmodel)
|
|
|
if len(classmodel) > 0 {
|
|
|
errinfo.Message = "三级编码已存在,请重新添加!"
|
|
|
@@ -543,13 +543,13 @@ func (this *OilTechnologyServiceController) UpdateCodeEntity() {
|
|
|
this.Data["json"] = &errinfo
|
|
|
this.ServeJSON()
|
|
|
return
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
model.Code = classall.Code3
|
|
|
err = svc.UpdateEntityBytbl(OilTechnologyServiceClassName, classall.Id3, &model, colsCode)
|
|
|
}
|
|
|
}
|
|
|
- if classall.Code4 != ""{
|
|
|
- where := " Code = " + classall.Code4 +" and Id <> "+utils.ToStr(classall.Id4)
|
|
|
+ if classall.Code4 != "" {
|
|
|
+ where := " Code = " + classall.Code4 + " and Id <> " + utils.ToStr(classall.Id4)
|
|
|
svc.GetEntitysByWhere(OilTechnologyServiceClassName, where, &classmodel)
|
|
|
if len(classmodel) > 0 {
|
|
|
errinfo.Message = "四级编码已存在,请重新添加!"
|
|
|
@@ -557,7 +557,7 @@ func (this *OilTechnologyServiceController) UpdateCodeEntity() {
|
|
|
this.Data["json"] = &errinfo
|
|
|
this.ServeJSON()
|
|
|
return
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
model.Code = classall.Code4
|
|
|
err = svc.UpdateEntityBytbl(OilTechnologyServiceClassName, classall.Id4, &model, colsCode)
|
|
|
}
|
|
|
@@ -575,7 +575,6 @@ func (this *OilTechnologyServiceController) UpdateCodeEntity() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// @Title 删除单条信息
|
|
|
// @Description
|
|
|
// @Success 200 {object} ErrorInfo
|
|
|
@@ -760,14 +759,15 @@ func (this *OilTechnologyServiceController) ExportExcelAll() {
|
|
|
elapsed := time.Since(t)
|
|
|
fmt.Println(elapsed)
|
|
|
}
|
|
|
+
|
|
|
// @Title 获取所有
|
|
|
// @Description
|
|
|
// @Success 200 {object}
|
|
|
// @router /getcompanylist [post]
|
|
|
func (this *OilTechnologyServiceController) 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
|
|
|
@@ -897,32 +897,32 @@ func (this *OilTechnologyServiceController) 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 + "'"
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- 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 := goodsaptitude.GetOilGoodsAptitudeService(utils.DBE)
|
|
|
var list []supplier.OilSupplierSelect
|
|
|
|
|
|
- total := svc.GetMyPagingDelEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, OilInfoChangeName,OilCorporateInfoName,OilSupplierCertSubName,
|
|
|
- OilSupplierFileName, page.CurrentPage, page.Size, orderby, asc, &list, where,having, leftjoin)
|
|
|
+ total := svc.GetMyPagingDelEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, OilInfoChangeName, OilCorporateInfoName, OilSupplierCertSubName,
|
|
|
+ OilSupplierFileName, page.CurrentPage, page.Size, orderby, asc, &list, where, having, leftjoin)
|
|
|
|
|
|
var datainfo DataInfo
|
|
|
datainfo.Items = list
|
|
|
@@ -933,6 +933,7 @@ func (this *OilTechnologyServiceController) GetTList() {
|
|
|
this.ServeJSON()
|
|
|
|
|
|
}
|
|
|
+
|
|
|
// @Title 删除不符合的的准入项
|
|
|
// @Description get user by token
|
|
|
// @Success 200 {object} []suppliercertsub.OilSupplierCertSub
|
|
|
@@ -959,7 +960,7 @@ func (this *OilTechnologyServiceController) DelTmpSupplierCertSub() {
|
|
|
svc.GetEntitysByWhere(TmpOilSupplierCertSubName, wheredel, &supplierCertSubList)
|
|
|
|
|
|
var errinfo ErrorInfo
|
|
|
- for _,item := range supplierCertSubList {
|
|
|
+ for _, item := range supplierCertSubList {
|
|
|
where := "Id = " + strconv.Itoa(item.Id)
|
|
|
err = svc.DeleteEntityBytbl(OilSupplierCertSubName, where)
|
|
|
if err != nil {
|
|
|
@@ -970,7 +971,7 @@ func (this *OilTechnologyServiceController) DelTmpSupplierCertSub() {
|
|
|
this.ServeJSON()
|
|
|
}
|
|
|
}
|
|
|
- for _,item := range supplierCertSubList {
|
|
|
+ for _, item := range supplierCertSubList {
|
|
|
where := "Id = " + strconv.Itoa(item.Id)
|
|
|
err = svc.DeleteEntityBytbl(TmpOilSupplierCertSubName, where)
|
|
|
}
|
|
|
@@ -1010,22 +1011,22 @@ func (this *OilTechnologyServiceController) FindInconformity() {
|
|
|
var jsonBlob = this.Ctx.Input.RequestBody
|
|
|
json.Unmarshal(jsonBlob, &model)
|
|
|
Code := model.Code
|
|
|
- where := " Code ='"+Code+"' and Type in ('1','3') and SupplierTypeCode = '03'"
|
|
|
- svc.FindGoodsByCode("OilSupplierCertSub",where,&companygoodslist)
|
|
|
+ where := " Code ='" + Code + "' and Type in ('1','3') and SupplierTypeCode = '03'"
|
|
|
+ svc.FindGoodsByCode("OilSupplierCertSub", where, &companygoodslist)
|
|
|
|
|
|
SurplusList = filesvc.GetBasicNeedFileList(strconv.Itoa(model.Id))
|
|
|
|
|
|
for _, CertSub := range companygoodslist {
|
|
|
companygood = CertSub
|
|
|
- wherecompany := " SupplierId ="+strconv.Itoa(CertSub.SupplierId)
|
|
|
- svc.FindFileByCompany("OilSupplierFile",wherecompany,&supfilemodel)
|
|
|
- if len(supfilemodel)<1 {
|
|
|
- _,err = svc.InsertEntityBytbl(""+TmpOilSupplierCertSubName, &companygood)
|
|
|
- }else {
|
|
|
+ wherecompany := " SupplierId =" + strconv.Itoa(CertSub.SupplierId)
|
|
|
+ svc.FindFileByCompany("OilSupplierFile", wherecompany, &supfilemodel)
|
|
|
+ if len(supfilemodel) < 1 {
|
|
|
+ _, err = svc.InsertEntityBytbl(""+TmpOilSupplierCertSubName, &companygood)
|
|
|
+ } else {
|
|
|
var tmplist1 []suppliercertsub.Tmp_OilSupplierCertSub
|
|
|
- wherecompany = " Id ="+strconv.Itoa(CertSub.Id)
|
|
|
- svc.FindFileByCompany("tmp_OilSupplierCertSub",wherecompany,&tmplist1)
|
|
|
- if len(tmplist1)<1{
|
|
|
+ wherecompany = " Id =" + strconv.Itoa(CertSub.Id)
|
|
|
+ svc.FindFileByCompany("tmp_OilSupplierCertSub", wherecompany, &tmplist1)
|
|
|
+ if len(tmplist1) < 1 {
|
|
|
wherecompany = " SupplierId ='" + strconv.Itoa(CertSub.SupplierId) + "'"
|
|
|
svc.FindFileByCompany("OilSupplierFile", wherecompany, &supfilemodel01)
|
|
|
var File01 string
|
|
|
@@ -1241,7 +1242,7 @@ func (this *OilTechnologyServiceController) GetImportEntityList() {
|
|
|
orderby = Prop
|
|
|
if Order == "asc" {
|
|
|
asc = true
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
asc = false
|
|
|
}
|
|
|
}
|
|
|
@@ -1509,12 +1510,12 @@ func (this *OilTechnologyServiceController) PdfExport() {
|
|
|
svc := supplierdataentry.GetSupplierDataEntryService(utils.DBE)
|
|
|
where1 := "1=1"
|
|
|
where1 += " AND Id = '" + Id + "'"
|
|
|
- where2 := "SupplierId = '" + Id + "' and SupplierTypecode='"+ SupplierTypeCode +"'"
|
|
|
+ where2 := "SupplierId = '" + Id + "' and SupplierTypecode='" + SupplierTypeCode + "'"
|
|
|
svc.GetEntityByWhere(OilSupplierName, where1, &model1)
|
|
|
svc.GetEntityByWhere(OilSupplierCertName, where2, &model2)
|
|
|
|
|
|
var tabledata []supplierdataentry.SupplierCertSubEntry
|
|
|
- where3:="SupplierId = '" + Id + "' and SupplierTypecode='"+ SupplierTypeCode +"' and Type in ('1','3')"//准入状态的准入项
|
|
|
+ where3 := "SupplierId = '" + Id + "' and SupplierTypecode='" + SupplierTypeCode + "' and Type in ('1','3')" //准入状态的准入项
|
|
|
svc.GetEntitysByOrderbyWhere(TmpOilSupplierCertSubName, where3, "1", &tabledata)
|
|
|
|
|
|
datamap := structToMapDemo(model1.OilSupplier)
|
|
|
@@ -1542,28 +1543,28 @@ func (this *OilTechnologyServiceController) PdfExport() {
|
|
|
datamap["HseTraining"] = "否"
|
|
|
}
|
|
|
if model1.OperType != "" {
|
|
|
- if model1.OperType == "1" || model1.OperType == "制造商"{
|
|
|
+ if model1.OperType == "1" || model1.OperType == "制造商" {
|
|
|
datamap["OperType"] = "√制造商 □代理商 □贸易商"
|
|
|
- }else if model1.OperType == "2" || model1.OperType == "代理商"{
|
|
|
+ } else if model1.OperType == "2" || model1.OperType == "代理商" {
|
|
|
datamap["OperType"] = "□制造商 √代理商 □贸易商"
|
|
|
- }else if model1.OperType == "3" || model1.OperType == "代理商"{
|
|
|
+ } else if model1.OperType == "3" || model1.OperType == "代理商" {
|
|
|
datamap["OperType"] = "□制造商 □代理商 √贸易商"
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
datamap["OperType"] = "□制造商 □代理商 □贸易商"
|
|
|
}
|
|
|
}
|
|
|
if model1.SpecTypeCode != "" {
|
|
|
- if model1.SpecTypeCode == "1"{
|
|
|
+ if model1.SpecTypeCode == "1" {
|
|
|
datamap["SpecTypeCode"] = "√一般外部 □多元企业"
|
|
|
- }else if model1.SpecTypeCode == "2"{
|
|
|
+ } else if model1.SpecTypeCode == "2" {
|
|
|
datamap["SpecTypeCode"] = "□一般外部 √多元企业"
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
datamap["SpecTypeCode"] = "□一般外部 □多元企业"
|
|
|
}
|
|
|
}
|
|
|
- if model1.Grade == "1"{
|
|
|
+ if model1.Grade == "1" {
|
|
|
datamap["Grade"] = "一级"
|
|
|
- }else if model1.SpecTypeCode == "2"{
|
|
|
+ } else if model1.SpecTypeCode == "2" {
|
|
|
datamap["Grade"] = "二级"
|
|
|
}
|
|
|
datamap["Fax"] = model1.Fax
|
|
|
@@ -1586,7 +1587,7 @@ func (this *OilTechnologyServiceController) PdfExport() {
|
|
|
datamap["LegalPerson"] = model1.LegalPerson
|
|
|
datamap["CompanyType"] = model1.CompanyType
|
|
|
datamap["ContactName"] = model1.ContactName
|
|
|
- datamap["RegCapital"] = strconv.FormatFloat(model1.RegCapital,'f',2,64)+"万元"+model1.Currency
|
|
|
+ datamap["RegCapital"] = strconv.FormatFloat(model1.RegCapital, 'f', 2, 64) + "万元" + model1.Currency
|
|
|
datamap["DepositBank"] = model1.DepositBank
|
|
|
datamap["BankAccount"] = model1.BankAccount
|
|
|
datamap["Mobile"] = model1.Mobile
|
|
|
@@ -1603,7 +1604,7 @@ func (this *OilTechnologyServiceController) PdfExport() {
|
|
|
|
|
|
if len(tabledata) != 0 {
|
|
|
var Name string
|
|
|
- Name = "\n待删除准入范围:"+ tabledata[0].Code
|
|
|
+ Name = "\n待删除准入范围:" + tabledata[0].Code
|
|
|
Name = Name + " " + tabledata[0].Name
|
|
|
var i int
|
|
|
for i = 1; i < len(tabledata); i++ {
|
|
|
@@ -1615,9 +1616,9 @@ func (this *OilTechnologyServiceController) PdfExport() {
|
|
|
// Name += "(准入范围未完全显示,请到系统查看详情)"
|
|
|
//}
|
|
|
|
|
|
- datamap["Name"] =datamap["Name"].(string) + Name
|
|
|
+ datamap["Name"] = datamap["Name"].(string) + Name
|
|
|
} else {
|
|
|
- datamap["Name"] =datamap["Name"].(string)
|
|
|
+ datamap["Name"] = datamap["Name"].(string)
|
|
|
}
|
|
|
|
|
|
svcActiviti := workflow.GetActivitiService(utils.DBE)
|
|
|
@@ -1679,7 +1680,7 @@ func (this *OilTechnologyServiceController) ExeclExport() {
|
|
|
svc := technologyservice.GetOilTechnologyServiceService(utils.DBE)
|
|
|
var list2 []supplier.OilSupplierContrast
|
|
|
where := " 1=1"
|
|
|
- svc.GetMyPagingEntitiesWithOrderBytbl("OilSupplierTecContrast", 0,0, "Id", false, &list2, where)
|
|
|
+ svc.GetMyPagingEntitiesWithOrderBytbl("OilSupplierTecContrast", 0, 0, "Id", false, &list2, where)
|
|
|
|
|
|
fileName := "资质导入对比表.xlsx"
|
|
|
Url := utils.Cfg.MustValue("workflow", "ContrastExcel")
|
|
|
@@ -1753,11 +1754,11 @@ func (this *OilTechnologyServiceController) GetCompareTmpSupplier() {
|
|
|
where = where + " and Name like '%" + Name + "%'"
|
|
|
}
|
|
|
|
|
|
- if Conditions == "2"{
|
|
|
+ if Conditions == "2" {
|
|
|
where = where + " and NoSubCnt > 0"
|
|
|
- } else if Conditions == "3"{
|
|
|
+ } else if Conditions == "3" {
|
|
|
where = where + " and Checked = '0'"
|
|
|
- } else if Conditions == "4"{
|
|
|
+ } else if Conditions == "4" {
|
|
|
where = where + " and Checked = '1"
|
|
|
}
|
|
|
|
|
|
@@ -1837,7 +1838,7 @@ func (this *OilTechnologyServiceController) GetCompareList() {
|
|
|
" and (a.F31 = tmpa.F31 or (tmpa.F31 = '' && a.F31 is null)) and (a.F32 = tmpa.F32 or (tmpa.F32 = '' && a.F32 is null)) and (a.F33 = tmpa.F33 or (tmpa.F33 = '' && a.F33 is null)) and (a.F34 = tmpa.F34 or (tmpa.F34 = '' && a.F34 is null)) and (a.F35 = tmpa.F35 or (tmpa.F35 = '' && a.F35 is null)) and (a.F36 = tmpa.F36 or (tmpa.F36 = '' && a.F36 is null)) and (a.F37 = tmpa.F37 or (tmpa.F37 = '' && a.F37 is null)) and (a.F38 = tmpa.F38 or (tmpa.F38 = '' && a.F38 is null)) and (a.F39 = tmpa.F39 or (tmpa.F39 = '' && a.F39 is null)) and (a.F40 = tmpa.F40 or (tmpa.F40 = '' && a.F40 is null))" +
|
|
|
" and (a.F41 = tmpa.F41 or (tmpa.F41 = '' && a.F41 is null)) and (a.F42 = tmpa.F42 or (tmpa.F42 = '' && a.F42 is null)) and (a.F43 = tmpa.F43 or (tmpa.F43 = '' && a.F43 is null)) and (a.F44 = tmpa.F44 or (tmpa.F44 = '' && a.F44 is null)) and (a.F45 = tmpa.F45 or (tmpa.F45 = '' && a.F45 is null)) and (a.F46 = tmpa.F46 or (tmpa.F46 = '' && a.F46 is null)) and (a.F47 = tmpa.F47 or (tmpa.F47 = '' && a.F47 is null)) and (a.F48 = tmpa.F48 or (tmpa.F48 = '' && a.F48 is null)) and (a.F49 = tmpa.F49 or (tmpa.F49 = '' && a.F49 is null)) and (a.F50 = tmpa.F50 or (tmpa.F50 = '' && a.F50 is null))" +
|
|
|
" and (a.F51 = tmpa.F51 or (tmpa.F51 = '' && a.F51 is null)) and (a.F52 = tmpa.F52 or (tmpa.F52 = '' && a.F52 is null))"
|
|
|
- }
|
|
|
+ }
|
|
|
if Order != "" && Prop != "" {
|
|
|
orderby = Prop
|
|
|
if Order == "asc" {
|
|
|
@@ -2074,7 +2075,7 @@ func (this *OilTechnologyServiceController) GetDelCertSubList() {
|
|
|
a := 0
|
|
|
for _, item := range list {
|
|
|
sql := "SELECT CONCAT_WS(',',IF(ifnull(F01, '') = '', '', F01),IF(ifnull(F02, '') = '', '', F02),IF(ifnull(F03, '') = '', '', F03),IF(ifnull(F04, '') = '', '', F04),IF(ifnull(F05, '') = '', '', F05),IF(ifnull(F06, '') = '', '', F06),IF(ifnull(F07, '') = '', '', F07),IF(ifnull(F08, '') = '', '', F08),IF(ifnull(F09, '') = '', '', F09),IF(ifnull(F10, '') = '', '', F10),IF(ifnull(F11, '') = '', '', F11),IF(ifnull(F12, '') = '', '', F12),IF(ifnull(F13, '') = '', '', F13),IF(ifnull(F14, '') = '', '', F14),IF(ifnull(F15, '') = '', '', F15),IF(ifnull(F16, '') = '', '', F16),IF(ifnull(F17, '') = '', '', F17),IF(ifnull(F18, '') = '', '', F18),IF(ifnull(F19, '') = '', '', F19),IF(ifnull(F20, '') = '', '', F20),IF(ifnull(F21, '') = '', '', F21),IF(ifnull(F22, '') = '', '', F22),IF(ifnull(F23, '') = '', '', F23),IF(ifnull(F24, '') = '', '', F24),IF(ifnull(F25, '') = '', '', F25),IF(ifnull(F26, '') = '', '', F26),IF(ifnull(F27, '') = '', '', F27),IF(ifnull(F28, '') = '', '', F28),IF(ifnull(F29, '') = '', '', F29),IF(ifnull(F30, '') = '', '', F30),IF(ifnull(F31, '') = '', '', F31),IF(ifnull(F32, '') = '', '', F32),IF(ifnull(F33, '') = '', '', F33),IF(ifnull(F34, '') = '', '', F34),IF(ifnull(F35, '') = '', '', F35),IF(ifnull(F36, '') = '', '', F36),IF(ifnull(F37, '') = '', '', F37),IF(ifnull(F38, '') = '', '', F38),IF(ifnull(F39, '') = '', '', F39),IF(ifnull(F40, '') = '', '', F40),IF(ifnull(F41, '') = '', '', F41),IF(ifnull(F42, '') = '', '', F42),IF(ifnull(F43, '') = '', '', F43),IF(ifnull(F44, '') = '', '', F44),IF(ifnull(F45, '') = '', '', F45),IF(ifnull(F46, '') = '', '', F46),IF(ifnull(F47, '') = '', '', F47),IF(ifnull(F48, '') = '', '', F48),IF(ifnull(F49, '') = '', '', F49),IF(ifnull(F50, '') = '', '', F50),IF(ifnull(F51, '') = '', '', F51),IF(ifnull(F52, '') = '', '', F52)) AS Codes FROM Tmp_OilTechnologyService a LEFT JOIN Tmp_OilTechnologyServiceClass class ON a.ClassId = class.Id"
|
|
|
- sql += " where class.Name = '"+ item.Name + "'"
|
|
|
+ sql += " where class.Name = '" + item.Name + "'"
|
|
|
model, _ := svc.DBE.QueryString(sql)
|
|
|
if model != nil {
|
|
|
code := strings.Split(model[0]["Codes"], ",")
|
|
|
@@ -2092,16 +2093,16 @@ func (this *OilTechnologyServiceController) GetDelCertSubList() {
|
|
|
} else if i > 10 {
|
|
|
if value == "1" && strings.Index(item.HeaderCodes, "F"+strconv.Itoa(i)) < 0 {
|
|
|
list[a].Checked = 1
|
|
|
- sql1 := "select Name from Base_TableHeader where Code = 'F"+strconv.Itoa(i)+"' and CategoryCode = '03'"
|
|
|
+ sql1 := "select Name from Base_TableHeader where Code = 'F" + strconv.Itoa(i) + "' and CategoryCode = '03'"
|
|
|
model1, _ := svc.DBE.QueryString(sql1)
|
|
|
- list[a].HeaderName += model1[0]["Name"]+ " "
|
|
|
+ list[a].HeaderName += model1[0]["Name"] + " "
|
|
|
}
|
|
|
} else {
|
|
|
if value == "1" && strings.Index(item.HeaderCodes, "F0"+strconv.Itoa(i)) < 0 {
|
|
|
list[a].Checked = 1
|
|
|
- sql1 := "select Name from Base_TableHeader where Code = 'F0"+strconv.Itoa(i)+"' and CategoryCode = '03'"
|
|
|
+ sql1 := "select Name from Base_TableHeader where Code = 'F0" + strconv.Itoa(i) + "' and CategoryCode = '03'"
|
|
|
model1, _ := svc.DBE.QueryString(sql1)
|
|
|
- list[a].HeaderName += model1[0]["Name"]+ " "
|
|
|
+ list[a].HeaderName += model1[0]["Name"] + " "
|
|
|
}
|
|
|
}
|
|
|
i += 1
|
|
|
@@ -2131,12 +2132,12 @@ func (this *OilTechnologyServiceController) DeleteUpdate() {
|
|
|
svc := technologyservice.GetOilTechnologyServiceService(utils.DBE)
|
|
|
var list1 []goodsaptitude.GoodsBusiness2
|
|
|
svc.GetEntityJoin(OilTechnologyServiceName, OilTechnologyServiceClassName, &list1)
|
|
|
- for _,item := range list1{
|
|
|
+ for _, item := range list1 {
|
|
|
var subDelete suppliercertsub.OilSupplierCertSub1
|
|
|
cols := []string{"SubClassId", "Code"}
|
|
|
subDelete.Code = item.Code
|
|
|
subDelete.SubClassId = item.Id
|
|
|
- err = svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &subDelete, cols, "SupplierTypeCode = '03' and Name = '" + item.Name + "'")
|
|
|
+ err = svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &subDelete, cols, "SupplierTypeCode = '03' and Name = '"+item.Name+"'")
|
|
|
}
|
|
|
//var list []goodsaptitude.Ids
|
|
|
//svc.DeleteTableBySelect(OilSupplierCertSubName, OilTechnologyServiceClassName, "a.SupplierTypeCode='03' AND b.Id IS NULL", &list, "Name")
|
|
|
@@ -2164,12 +2165,12 @@ func (this *OilTechnologyServiceController) DeleteSuspend() {
|
|
|
svc.GetEntitysByWhere("OilSupplierTecContrast", "Checked = '0'", &list)
|
|
|
paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
|
|
|
DueTimeStr := paramSvc.GetBaseparameterMessage("GFZT", "paramset", "Suspend")
|
|
|
- for _,item := range list{
|
|
|
+ for _, item := range list {
|
|
|
var sub []suppliercertsub.OilSupplierCertSub
|
|
|
- svc.GetEntitysByWhere("OilSupplierCertSub", "SupplierTypeCode = '03' and SupplierId = " + strconv.Itoa(item.Id), &sub)
|
|
|
+ svc.GetEntitysByWhere("OilSupplierCertSub", "SupplierTypeCode = '03' and SupplierId = "+strconv.Itoa(item.Id), &sub)
|
|
|
for _, itemSub := range sub {
|
|
|
sql := "SELECT CONCAT_WS(',',IF(ifnull(F01, '') = '', '', F01),IF(ifnull(F02, '') = '', '', F02),IF(ifnull(F03, '') = '', '', F03),IF(ifnull(F04, '') = '', '', F04),IF(ifnull(F05, '') = '', '', F05),IF(ifnull(F06, '') = '', '', F06),IF(ifnull(F07, '') = '', '', F07),IF(ifnull(F08, '') = '', '', F08),IF(ifnull(F09, '') = '', '', F09),IF(ifnull(F10, '') = '', '', F10),IF(ifnull(F11, '') = '', '', F11),IF(ifnull(F12, '') = '', '', F12),IF(ifnull(F13, '') = '', '', F13),IF(ifnull(F14, '') = '', '', F14),IF(ifnull(F15, '') = '', '', F15),IF(ifnull(F16, '') = '', '', F16),IF(ifnull(F17, '') = '', '', F17),IF(ifnull(F18, '') = '', '', F18),IF(ifnull(F19, '') = '', '', F19),IF(ifnull(F20, '') = '', '', F20),IF(ifnull(F21, '') = '', '', F21),IF(ifnull(F22, '') = '', '', F22),IF(ifnull(F23, '') = '', '', F23),IF(ifnull(F24, '') = '', '', F24),IF(ifnull(F25, '') = '', '', F25),IF(ifnull(F26, '') = '', '', F26),IF(ifnull(F27, '') = '', '', F27),IF(ifnull(F28, '') = '', '', F28),IF(ifnull(F29, '') = '', '', F29),IF(ifnull(F30, '') = '', '', F30),IF(ifnull(F31, '') = '', '', F31),IF(ifnull(F32, '') = '', '', F32),IF(ifnull(F33, '') = '', '', F33),IF(ifnull(F34, '') = '', '', F34),IF(ifnull(F35, '') = '', '', F35),IF(ifnull(F36, '') = '', '', F36),IF(ifnull(F37, '') = '', '', F37),IF(ifnull(F38, '') = '', '', F38),IF(ifnull(F39, '') = '', '', F39),IF(ifnull(F40, '') = '', '', F40),IF(ifnull(F41, '') = '', '', F41),IF(ifnull(F42, '') = '', '', F42),IF(ifnull(F43, '') = '', '', F43),IF(ifnull(F44, '') = '', '', F44),IF(ifnull(F45, '') = '', '', F45),IF(ifnull(F46, '') = '', '', F46),IF(ifnull(F47, '') = '', '', F47),IF(ifnull(F48, '') = '', '', F48),IF(ifnull(F49, '') = '', '', F49),IF(ifnull(F50, '') = '', '', F50),IF(ifnull(F51, '') = '', '', F51),IF(ifnull(F52, '') = '', '', F52)) AS Codes FROM OilTechnologyService a LEFT JOIN OilTechnologyServiceClass class ON a.ClassId = class.Id"
|
|
|
- sql += " where class.Name = '"+ itemSub.Name + "'"
|
|
|
+ sql += " where class.Name = '" + itemSub.Name + "'"
|
|
|
model, _ := svc.DBE.QueryString(sql)
|
|
|
var subDelete suppliercertsub.OilSupplierCertSub
|
|
|
if model != nil {
|
|
|
@@ -2178,14 +2179,14 @@ func (this *OilTechnologyServiceController) DeleteSuspend() {
|
|
|
err = svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &subDelete, cols, "Id = "+strconv.Itoa(itemSub.Id))
|
|
|
subDelete.CertSubStatus = "2"
|
|
|
currentTime := time.Now()
|
|
|
- days,_ := strconv.Atoi(DueTimeStr)
|
|
|
+ days, _ := strconv.Atoi(DueTimeStr)
|
|
|
subDelete.DueTime = currentTime.AddDate(0, 0, days)
|
|
|
i := 1
|
|
|
//暂停
|
|
|
for _, value := range code {
|
|
|
if i == 41 || i == 42 || i == 1 {
|
|
|
if (code[0] == "1" && strings.Index(item.HeaderCodes, "F01") < 0) && (code[40] == "1" && strings.Index(item.HeaderCodes, "F41") < 0) && (code[41] == "1" && strings.Index(item.HeaderCodes, "F42") < 0) {
|
|
|
- err = svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &subDelete, cols, "Id = " + strconv.Itoa(itemSub.Id))
|
|
|
+ err = svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &subDelete, cols, "Id = "+strconv.Itoa(itemSub.Id))
|
|
|
var model1 supplierpausereason.OilSupplierPauseReason
|
|
|
model1.SupplierId = item.Id
|
|
|
model1.CertSubId = itemSub.Id
|
|
|
@@ -2200,7 +2201,7 @@ func (this *OilTechnologyServiceController) DeleteSuspend() {
|
|
|
}
|
|
|
} else if i > 10 {
|
|
|
if value == "1" && strings.Index(item.HeaderCodes, "F"+strconv.Itoa(i)) < 0 {
|
|
|
- err = svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &subDelete, cols, "Id = " + strconv.Itoa(itemSub.Id))
|
|
|
+ err = svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &subDelete, cols, "Id = "+strconv.Itoa(itemSub.Id))
|
|
|
var model1 supplierpausereason.OilSupplierPauseReason
|
|
|
model1.SupplierId = item.Id
|
|
|
model1.CertSubId = itemSub.Id
|
|
|
@@ -2215,7 +2216,7 @@ func (this *OilTechnologyServiceController) DeleteSuspend() {
|
|
|
}
|
|
|
} else {
|
|
|
if value == "1" && strings.Index(item.HeaderCodes, "F0"+strconv.Itoa(i)) < 0 {
|
|
|
- err = svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &subDelete, cols, "Id = " + strconv.Itoa(itemSub.Id))
|
|
|
+ err = svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &subDelete, cols, "Id = "+strconv.Itoa(itemSub.Id))
|
|
|
var model1 supplierpausereason.OilSupplierPauseReason
|
|
|
model1.SupplierId = item.Id
|
|
|
model1.CertSubId = itemSub.Id
|
|
|
@@ -2260,33 +2261,33 @@ func (this *OilTechnologyServiceController) ManualDelete() {
|
|
|
var sub1 suppliercertsub.OilSupplierCertSub
|
|
|
var class technologyserviceclass.OilTechnologyServiceClass
|
|
|
if value.Operation == "删除" || value.Operation == "" {
|
|
|
- svc.DeleteTable(OilSupplierCertSubName, "SupplierTypeCode='03' and Code = '" + value.Code + "' and Name = '" + value.Name + "'")
|
|
|
- } else if value.Operation == "维持不动"{
|
|
|
+ svc.DeleteTable(OilSupplierCertSubName, "SupplierTypeCode='03' and Code = '"+value.Code+"' and Name = '"+value.Name+"'")
|
|
|
+ } else if value.Operation == "维持不动" {
|
|
|
|
|
|
} else if strings.Index(value.Operation, ",") > 0 {
|
|
|
//151508,151509
|
|
|
var sub []suppliercertsub.OilSupplierCertSub
|
|
|
- svc.GetEntitysByWhere(OilSupplierCertSubName, "SupplierTypeCode='03' and Code = '" + value.Code + "' and Name = '" + value.Name + "'", &sub)
|
|
|
+ svc.GetEntitysByWhere(OilSupplierCertSubName, "SupplierTypeCode='03' and Code = '"+value.Code+"' and Name = '"+value.Name+"'", &sub)
|
|
|
code := strings.Split(value.Operation, ",")
|
|
|
for _, c := range code {
|
|
|
- svc.GetEntityByWhere(OilTechnologyServiceClassName, "Code = '" + c +"'", &class)
|
|
|
+ svc.GetEntityByWhere(OilTechnologyServiceClassName, "Code = '"+c+"'", &class)
|
|
|
for _, s := range sub {
|
|
|
s.Name = class.Name
|
|
|
s.Code = class.Code
|
|
|
s.SubClassId = class.Id
|
|
|
s.Id = 0
|
|
|
- svc.GetEntityByWhere(OilSupplierCertSubName, "SupplierTypeCode='03' and SupplierCertId = " + strconv.Itoa(s.SupplierCertId) + " and Name = '" + class.Name + "'", &sub1)
|
|
|
+ svc.GetEntityByWhere(OilSupplierCertSubName, "SupplierTypeCode='03' and SupplierCertId = "+strconv.Itoa(s.SupplierCertId)+" and Name = '"+class.Name+"'", &sub1)
|
|
|
if sub1.Id > 0 {
|
|
|
continue
|
|
|
}
|
|
|
svc.InsertEntityBytbl(OilSupplierCertSubName, &s)
|
|
|
}
|
|
|
- svc.DeleteTable(OilSupplierCertSubName, "SupplierTypeCode='03' and Code = '" + value.Code + "' and Name = '" + value.Name + "'")
|
|
|
+ svc.DeleteTable(OilSupplierCertSubName, "SupplierTypeCode='03' and Code = '"+value.Code+"' and Name = '"+value.Name+"'")
|
|
|
}
|
|
|
} else {
|
|
|
//151507
|
|
|
- svc.GetEntityByWhere(OilTechnologyServiceClassName, "Code = '" + value.Operation +"'", &class)
|
|
|
- where1 := "SupplierTypeCode='03' and Code = '" + value.Code + "' and Name = '"+ value.Name + "'"
|
|
|
+ svc.GetEntityByWhere(OilTechnologyServiceClassName, "Code = '"+value.Operation+"'", &class)
|
|
|
+ where1 := "SupplierTypeCode='03' and Code = '" + value.Code + "' and Name = '" + value.Name + "'"
|
|
|
cols := []string{"Name", "Code", "SubClassId"}
|
|
|
sub1.Name = class.Name
|
|
|
sub1.Code = class.Code
|
|
|
@@ -2300,4 +2301,4 @@ func (this *OilTechnologyServiceController) ManualDelete() {
|
|
|
errinfo.Code = 0
|
|
|
this.Data["json"] = &errinfo
|
|
|
this.ServeJSON()
|
|
|
-}
|
|
|
+}
|