Browse Source

excel style

Liuqi 6 years ago
parent
commit
ba0dea83e6

+ 17 - 0
src/dashoo.cn/backend/api/business/oilsupplier/goodsaptitude/oilgoodsaptitudeService.go

@@ -176,5 +176,22 @@ OilSupplierFileName string, pageIndex, itemsPerPage int64, orderby string, asc b
 	session.Commit()
 	total = totalResult.Total
 
+	return total
+}
+//查看贸易或制造商准入资质个数
+func (s *OilGoodsAptitudeService) GetNumOfPass(ismanf string) (total int64) {
+	var resultsSlice []map[string][]byte
+	sqlCount := "SELECT COUNT(Id) FROM Base_TableHeader WHERE IsManuf = '"+ismanf+"' AND CategoryCode = '01'"
+
+	resultsSlice, _ = s.DBE.Query(sqlCount)
+
+	if len(resultsSlice) > 0 {
+		results := resultsSlice[0]
+		for _, value := range results {
+			total, _ = strconv.ParseInt(string(value), 10, 64)
+			break
+		}
+	}
+
 	return total
 }

+ 26 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/goodsaptitude.go

@@ -1055,9 +1055,35 @@ func (this *OilGoodsAptitudeController) ExportExcelAll() {
 	sheet, _ := f.AddSheet(filetitle)
 	//rowhead := sheet.AddRow()
 	//rowhead.WriteSlice(&title, -1)
+
 	cellname := strings.Split(showcolumnarr, ",")
 	row := sheet.AddRow()
+	row2 := sheet.AddRow()
 	row.WriteSlice(&cellname, -1)
+	row2.WriteSlice(&cellname, -1)
+
+	//doublename := "制造商,贸易商"
+	//doubleslice := strings.Split(doublename, ",")
+	//rowhead := sheet.AddRow()
+	//rowhead.WriteSlice(&doubleslice, -1)
+
+	intsix := svc.GetNumOfPass("0")
+	intStr := strconv.FormatInt(intsix, 10)
+	alluse ,_ := strconv.Atoi(intStr)
+	for i := 0; i < alluse+12; i++ {
+		row.Cells[i].Merge(0, 1)
+	}
+	intsix1 := svc.GetNumOfPass("2")
+	intStr1 := strconv.FormatInt(intsix1, 10)
+	traker ,_ := strconv.Atoi(intStr1)
+	row.Cells[alluse+12].Merge(traker-1,0)
+	row.Cells[alluse+12].Value = "贸易产品"
+	intsix2 := svc.GetNumOfPass("1")
+	intStr2 := strconv.FormatInt(intsix2, 10)
+	maker ,_ := strconv.Atoi(intStr2)
+	row.Cells[alluse+12+traker].Merge(maker-1,0)
+	row.Cells[alluse+12+traker].Value = "制造产品"
+
 
 	for _, item := range list {
 		var enumModel goodsaptitude.OilGoodsAptitudeView