2
3
Prechádzať zdrojové kódy

前后:集中评审物资类导出加二位码

dubch 4 rokov pred
rodič
commit
c19a6a8b78

+ 21 - 2
src/dashoo.cn/backend/api/business/oilsupplier/supplier/oilsupplierService.go

@@ -211,8 +211,8 @@ func (s *OilSupplierService) GetMyPagingEntitiesWithOrderBytblExport(supplierTab
 	sql = `select a.*,b.Id as CertId, b.SupplierTypeName, b.InFlag, b.ApplyTime,b.EffectEndTime, `
 	sql += ` b.Status, `
 	sql += ` o.FullName, `
-	sql += ` b.RecUnitName, `
-	sql += ` GROUP_CONCAT(c.Name) as SubName `
+	sql += ` b.RecUnitName`
+	//sql += ` ''GROUP_CONCAT(c.Name)'' as SubName `
 	sql += ` from ` + supplierTableName + ` a `
 	sql += ` left join ` + supplierCertTableName + " b on b.SupplierId = a.Id"
 	sql += ` left join Base_Organize o on o.Id = b.ThirdAudit `
@@ -222,6 +222,25 @@ func (s *OilSupplierService) GetMyPagingEntitiesWithOrderBytblExport(supplierTab
 	s.DBE.SQL(sql).Find(entitiesPtr)
 }
 
+func (s *OilSupplierService) GetMyPagingEntitiesWithOrderBytblExportNew(supplierTableName, supplierCertTableName string, entitiesPtr interface{}, where string) {
+	var sql string
+	sql = `select aa.CertId,aa.Id,aa.SupplierName,aa.SupplierTypeName,aa.FullName,aa.RecUnitName,aa.LegalPerson,aa.CommercialNo,aa.RegCapital,aa.Currency,aa.CompanyType,aa.SetupTime,aa.Mobile,GROUP_CONCAT(aa.ax) as SubName 
+			from (select DISTINCT b.Id as CertId, a.*, b.AccessCardNo, b.SupplierTypeCode, b.SupplierTypeName, 
+			b.InFlag, b.ApplyTime,b.EffectEndTime,  b.WorkerTotal,  b.ContractNum,  b.UniversityNum,  
+			b.TechnicalNum,  b.AboveProfNum,  b.MiddleProfNum,  b.NationalRegNum,  b.NationalCertTotal,  
+			b.DesignerTotal,  b.SkillerTotal,  b.Status,  b.RecUnitName,  o.FullName,  b.WorkflowId ,b.CreateOn as CreateOn1,
+			b.ProcessKey,b.BusinessKey,b.BackRemark,b.IsRestrict,
+			CONCAT(left(s.Code, 2), ':', g.Name) as ax`
+	sql += ` from ` + supplierTableName + ` a `
+	sql += ` left join ` + supplierCertTableName + " b on b.SupplierId = a.Id"
+	sql += ` left join Base_Organize o on o.Id = b.ThirdAudit `
+	sql += ` left join OilSupplierCertSub s on s.SupplierCertId = b.Id`
+	sql += ` left join OilGoodsAptitudeClass g on g.Code = left(s.Code, 2)`
+	sql += ` where ` + where + ` and b.SupplierTypeCode = '01'`
+	sql += ` order by b.Id desc) aa GROUP BY aa.CertId`
+	s.DBE.SQL(sql).Find(entitiesPtr)
+}
+
 func (s *OilSupplierService) CheckRepeatApplyInfo(supplierTableName, supplierCertTableName, typeCode, SupplierName, CommercialNo, OrganCode, BankAccount, CompanyUrl string, entitiesPtr interface{}) {
 
 	//获取分页信息

+ 43 - 7
src/dashoo.cn/backend/api/controllers/oilsupplier/supplier.go

@@ -787,9 +787,6 @@ func (this *OilSupplierController) JzpsListExport() {
 	if SupplierName != "" {
 		where = where + " and a.SupplierName like '%" + SupplierName + "%'"
 	}
-	if SupplierTypeName != "" {
-		where = where + " and b.SupplierTypeName like '%" + SupplierTypeName + "%'"
-	}
 	if CreateOn != "" {
 		dates := strings.Split(CreateOn, ",")
 		if len(dates) == 2 {
@@ -921,13 +918,24 @@ func (this *OilSupplierController) JzpsListExport() {
 			}
 		}
 	}
+	where1 := where
 
 	svc := supplier.GetOilSupplierService(utils.DBE)
 	var list []supplier.OilSupplierExport
-	svc.GetMyPagingEntitiesWithOrderBytblExport(OilSupplierName, OilSupplierCertName, &list, where)
+	var list1 []supplier.OilSupplierExport
+	if SupplierTypeName == "物资类" {
+		svc.GetMyPagingEntitiesWithOrderBytblExportNew(OilSupplierName, OilSupplierCertName, &list1, where1)
+	} else if SupplierTypeName == "服务类" || SupplierTypeName == "基建类"{
+		where = where + " and b.SupplierTypeName like '%" + SupplierTypeName + "%'"
+		svc.GetMyPagingEntitiesWithOrderBytblExport(OilSupplierName, OilSupplierCertName, &list, where)
+	} else {
+		where = where + " and (b.SupplierTypeCode = '02' or b.SupplierTypeCode = '03')"
+		svc.GetMyPagingEntitiesWithOrderBytblExport(OilSupplierName, OilSupplierCertName, &list, where)
+		svc.GetMyPagingEntitiesWithOrderBytblExportNew(OilSupplierName, OilSupplierCertName, &list1, where1)
+	}
 
 	fileTitle := "集中评审"
-	showColumnArr := "序号,审核状态,企业名称,准入类别,审核处室,推荐单位,法人,工商注册号,注册资本,币种,公司类型,成立时间,手机号,准入范围"
+	showColumnArr := "序号,审核状态,企业名称,准入类别,审核处室,推荐单位,法人,工商注册号,注册资本,币种,公司类型,成立时间,手机号,二位准入范围,八位准入范围"
 
 	f := xlsx.NewFile()
 	sheet, _ := f.AddSheet(fileTitle)
@@ -940,7 +948,35 @@ func (this *OilSupplierController) JzpsListExport() {
 		svc.GetEntitysByWhere(OilSupplierCertSubName, "SupplierCertId = "+strconv.Itoa(item.CertId), &certSubList)
 		subName := ""
 		for _, certSub := range certSubList {
-			subName += "," + certSub.Name
+			subName += "," + certSub.Code + ":" + certSub.Name
+		}
+		regCapital := strconv.FormatFloat(item.RegCapital, 'f', 2, 64)
+		currency := "人民币"
+		if item.Currency == "人民币元" {
+			currency = "人民币"
+		}
+		if item.Currency == "JPY" {
+			currency = "日元"
+		}
+		if item.Currency == "USD" {
+			currency = "美元"
+		}
+		if item.Currency == "EUR" {
+			currency = "欧元"
+		}
+		dataString := strconv.Itoa(idx+1) + "+待集中评审+" + item.SupplierName + "+" + item.SupplierTypeName + "+" + item.FullName + "+" + item.RecUnitName + "+" + item.LegalPerson + "+" + item.CommercialNo + "+" +
+			regCapital + "+" + currency + "+" + item.CompanyType + "+" + utils.ToStr(item.SetupTime.Format("2006-01-02")) + "+" + item.Mobile + "+" + item.SubName + "+" + strings.TrimLeft(subName, ",")
+		cellName := strings.Split(dataString, "+")
+		row := sheet.AddRow()
+		row.WriteSlice(&cellName, -1)
+	}
+
+	for idx, item := range list1 {
+		var certSubList []suppliercertsub.OilSupplierCertSub
+		svc.GetEntitysByWhere(OilSupplierCertSubName, "SupplierCertId = "+strconv.Itoa(item.CertId), &certSubList)
+		subName := ""
+		for _, certSub := range certSubList {
+			subName += "," + certSub.Code + ":" + certSub.Name
 		}
 		regCapital := strconv.FormatFloat(item.RegCapital, 'f', 2, 64)
 		currency := "人民币"
@@ -957,7 +993,7 @@ func (this *OilSupplierController) JzpsListExport() {
 			currency = "欧元"
 		}
 		dataString := strconv.Itoa(idx+1) + "+待集中评审+" + item.SupplierName + "+" + item.SupplierTypeName + "+" + item.FullName + "+" + item.RecUnitName + "+" + item.LegalPerson + "+" + item.CommercialNo + "+" +
-			regCapital + "+" + currency + "+" + item.CompanyType + "+" + utils.ToStr(item.SetupTime.Format("2006-01-02")) + "+" + item.Mobile + "+" + strings.TrimLeft(subName, ",")
+			regCapital + "+" + currency + "+" + item.CompanyType + "+" + utils.ToStr(item.SetupTime.Format("2006-01-02")) + "+" + item.Mobile + "+" + item.SubName + "+" + strings.TrimLeft(subName, ",")
 		cellName := strings.Split(dataString, "+")
 		row := sheet.AddRow()
 		row.WriteSlice(&cellName, -1)

+ 0 - 1
src/dashoo.cn/frontend_web/src/pages/system/resource/documentnew.vue

@@ -79,7 +79,6 @@
           })
       },
       getDownloadFile (val) {
-        console.log(val, '212121')
         let urlArr = val.split('|')
         let retUrl = urlArr[0]
         // 内网服务器专用