Browse Source

后端: 资质配置的基建类和服务类 编码 字段按右侧模糊匹配查询

baichengfei 4 years ago
parent
commit
86cf47b8f4

+ 71 - 70
src/dashoo.cn/backend/api/controllers/oilsupplier/basisbuild.go

@@ -54,7 +54,7 @@ func (this *OilBasisBuildController) GetEntityList() {
 		orderby = Prop
 		if Order == "asc" {
 			asc = true
-		}else {
+		} else {
 			asc = false
 		}
 	}
@@ -64,7 +64,7 @@ func (this *OilBasisBuildController) GetEntityList() {
 	Name := this.GetString("Name")
 
 	if Code != "" {
-		where = where + " and Code like '%" + Code + "%'"
+		where = where + " and Code like '" + Code + "%'"
 	}
 
 	if Name != "" {
@@ -169,7 +169,6 @@ func (this *OilBasisBuildController) AddEntity() {
 
 	_, err := svc.InsertEntityBytbl(""+OilBasisBuildName, &model)
 
-
 	if err == nil {
 		//新增
 		errinfo.Message = "添加成功!"
@@ -206,7 +205,7 @@ func (this *OilBasisBuildController) UpdateEntity() {
 	var jsonBlob = this.Ctx.Input.RequestBody
 	json.Unmarshal(jsonBlob, &model)
 	if model.Name != "" {
-		where := " Name = '" + model.Name +"' and Id not in ('"+id+"')"
+		where := " Name = '" + model.Name + "' and Id not in ('" + id + "')"
 		svc.GetEntitysByWhere(OilBasisBuildName, where, &basmodel)
 		if len(basmodel) > 0 {
 			errinfo.Message = "名称已存在,请重新添加!"
@@ -217,7 +216,7 @@ func (this *OilBasisBuildController) UpdateEntity() {
 		}
 	}
 	if model.Code != "" {
-		cowhere := " Code = '" + model.Code+"' and Id not in ('"+id+"')"
+		cowhere := " Code = '" + model.Code + "' and Id not in ('" + id + "')"
 		svc.GetEntitysByWhere(OilBasisBuildName, cowhere, &basmodel)
 		if len(basmodel) > 0 {
 			errinfo.Message = "编码已存在,请重新添加!"
@@ -468,14 +467,15 @@ func (this *OilBasisBuildController) ExportExcelAll() {
 	elapsed := time.Since(t)
 	fmt.Println(elapsed)
 }
+
 // @Title 获取所有
 // @Description
 // @Success 200 {object}
 // @router /getcompanylist [post]
 func (this *OilBasisBuildController) 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
@@ -605,32 +605,32 @@ func (this *OilBasisBuildController) 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
@@ -641,6 +641,7 @@ func (this *OilBasisBuildController) GetTList() {
 	this.ServeJSON()
 
 }
+
 // @Title 删除不符合的的准入项
 // @Description get user by token
 // @Success 200 {object} []suppliercertsub.OilSupplierCertSub
@@ -667,7 +668,7 @@ func (this *OilBasisBuildController) 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 {
@@ -678,7 +679,7 @@ func (this *OilBasisBuildController) DelTmpSupplierCertSub() {
 			this.ServeJSON()
 		}
 	}
-	for _,item := range supplierCertSubList {
+	for _, item := range supplierCertSubList {
 		where := "Id = " + strconv.Itoa(item.Id)
 		err = svc.DeleteEntityBytbl(TmpOilSupplierCertSubName, where)
 	}
@@ -718,22 +719,22 @@ func (this *OilBasisBuildController) FindInconformity() {
 	var jsonBlob = this.Ctx.Input.RequestBody
 	json.Unmarshal(jsonBlob, &model)
 	Code := model.Code
-	where := " Code ='"+Code+"' and Type in ('1','3') and SupplierTypeCode = '02'"
-	svc.FindGoodsByCode("OilSupplierCertSub",where,&companygoodslist)
+	where := " Code ='" + Code + "' and Type in ('1','3') and SupplierTypeCode = '02'"
+	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
@@ -905,13 +906,13 @@ func (this *OilBasisBuildController) OperationCell(svc *basisbuild.OilBasisbuild
 	cellsArrLen := len(cellsArr)
 	var valstr = ""
 
-	for i := 0; i < cellsArrLen;i++ {
+	for i := 0; i < cellsArrLen; i++ {
 		valstr += "'" + cellsArr[i].String() + "',"
 	}
 	valstr = strings.Trim(valstr, ",")
 	valstr = strings.Replace(valstr, "是", "1", -1)
 	log.Println(cellsArr[6].String() + "==" + valstr)
-	var columnstr= ""
+	var columnstr = ""
 	for l := 0; l < cellsArrLen; l++ {
 		columnstr += columnArr[l] + ","
 	}
@@ -1124,12 +1125,12 @@ func (this *OilBasisBuildController) 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)
@@ -1157,28 +1158,28 @@ func (this *OilBasisBuildController) 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
@@ -1201,7 +1202,7 @@ func (this *OilBasisBuildController) 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
@@ -1218,7 +1219,7 @@ func (this *OilBasisBuildController) 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++ {
@@ -1230,9 +1231,9 @@ func (this *OilBasisBuildController) 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)
@@ -1257,7 +1258,7 @@ func (this *OilBasisBuildController) ExeclExport() {
 	svc := basisbuild.GetOilBasisBuildService(utils.DBE)
 	var list2 []supplier.OilSupplierContrast
 	where := " 1=1"
-	svc.GetMyPagingEntitiesWithOrderBytbl("OilSupplierBasContrast", 0,0, "Id", false, &list2, where)
+	svc.GetMyPagingEntitiesWithOrderBytbl("OilSupplierBasContrast", 0, 0, "Id", false, &list2, where)
 
 	fileName := "资质导入对比表.xlsx"
 	Url := utils.Cfg.MustValue("workflow", "ContrastExcel")
@@ -1331,11 +1332,11 @@ func (this *OilBasisBuildController) 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"
 	}
 
@@ -1637,7 +1638,7 @@ func (this *OilBasisBuildController) 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)) AS Codes FROM Tmp_OilBasisBuild"
-		sql += " where Name = '"+ item.Name + "'"
+		sql += " where Name = '" + item.Name + "'"
 		model, _ := svc.DBE.QueryString(sql)
 		if model != nil {
 			code := strings.Split(model[0]["Codes"], ",")
@@ -1655,16 +1656,16 @@ func (this *OilBasisBuildController) 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 = '02'"
+						sql1 := "select Name from Base_TableHeader where Code = 'F" + strconv.Itoa(i) + "' and CategoryCode = '02'"
 						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 = '02'"
+						sql1 := "select Name from Base_TableHeader where Code = 'F0" + strconv.Itoa(i) + "' and CategoryCode = '02'"
 						model1, _ := svc.DBE.QueryString(sql1)
-						list[a].HeaderName += model1[0]["Name"]+ " "
+						list[a].HeaderName += model1[0]["Name"] + " "
 					}
 				}
 				i += 1
@@ -1694,17 +1695,17 @@ func (this *OilBasisBuildController) DeleteUpdate() {
 		svc := goodsaptitude.GetOilGoodsAptitudeService(utils.DBE)
 		var list1 []goodsaptitude.GoodsBusiness2
 		svc.GetEntitysByWhere(OilBasisBuildName, "1=1", &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 = '02' and Name = '" + item.Name + "'")
+			err = svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &subDelete, cols, "SupplierTypeCode = '02' and Name = '"+item.Name+"'")
 		}
 		var list []goodsaptitude.Ids
 		svc.DeleteTableBySelect(OilSupplierCertSubName, OilBasisBuildName, "a.SupplierTypeCode='02' AND b.Id IS NULL", &list, "Name")
-		for _,id := range list{
-			err = svc.DeleteTable(OilSupplierCertSubName, "Id = " + strconv.Itoa(id.Id))
+		for _, id := range list {
+			err = svc.DeleteTable(OilSupplierCertSubName, "Id = "+strconv.Itoa(id.Id))
 		}
 	}()
 	errinfo.Message = "更新中,请勿重复更新!"
@@ -1727,13 +1728,13 @@ func (this *OilBasisBuildController) Suspend() {
 		svc.GetEntitysByWhere("OilSupplierBasContrast", "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 = '02' and SupplierId = " + strconv.Itoa(item.Id), &sub)
+			svc.GetEntitysByWhere("OilSupplierCertSub", "SupplierTypeCode = '02' 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)) AS Codes,Code FROM OilBasisBuild"
 				//sql := "SELECT Code FROM Tmp_OilBasisBuild"
-				sql += " where Name = '"+ itemSub.Name + "'"
+				sql += " where Name = '" + itemSub.Name + "'"
 				model, _ := svc.DBE.QueryString(sql)
 				var subDelete suppliercertsub.OilSupplierCertSub
 				if model != nil {
@@ -1742,14 +1743,14 @@ func (this *OilBasisBuildController) Suspend() {
 					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 == 14 || i == 15 || i == 1 {
 							if (code[0] == "1" && strings.Index(item.HeaderCodes, "F01") < 0) && (code[13] == "1" && strings.Index(item.HeaderCodes, "F14") < 0) && (code[14] == "1" && strings.Index(item.HeaderCodes, "F15") < 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
@@ -1764,7 +1765,7 @@ func (this *OilBasisBuildController) Suspend() {
 							}
 						} 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
@@ -1779,7 +1780,7 @@ func (this *OilBasisBuildController) Suspend() {
 							}
 						} 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
@@ -1808,4 +1809,4 @@ func (this *OilBasisBuildController) Suspend() {
 	errinfo.Code = 0
 	this.Data["json"] = &errinfo
 	this.ServeJSON()
-}
+}

+ 100 - 99
src/dashoo.cn/backend/api/controllers/oilsupplier/technologyservice.go

@@ -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()
-}
+}