浏览代码

信息上报

Signed-off-by: lijunqing <lijunqing@dashoo.cn>
lijunqing 6 年之前
父节点
当前提交
6159e81ccd

+ 11 - 13
src/dashoo.cn/backend/api/business/oilsupplier/selectbusiness/selectservice.go

@@ -24,7 +24,6 @@ func (s *SelectService) GetMyPagingEntitiesWithOrderBytbl(supplierTableName, sup
 	//获取总记录数
 	sqlCount := `select count(*) from ` + supplierTableName + ` a `
 	sqlCount += ` left join ` + supplierCertTableName + " b on b.SupplierId = a.Id"
-	// sqlCount += ` left join ` + OilSupplierFileName + ` d on d.SupplierId = a.Id `
 	sqlCount += ` where ` + where
 
 	var sql string
@@ -45,7 +44,6 @@ func (s *SelectService) GetMyPagingEntitiesWithOrderBytbl(supplierTableName, sup
 	sql += ` (select c.OldSupplierName from OilInfoChange c where c.SupplierId=a.Id order by c.CreateOn desc limit 1) OldSupplierName `
 	sql += ` from ` + supplierTableName + ` a `
 	sql += ` left join ` + supplierCertTableName + ` b on b.SupplierId = a.Id) ab`
-	// sql += ` left join ` + OilSupplierFileName + ` d on d.SupplierId = a.Id `
 	sql += ` where ` + where
 	if asc {
 		sql += ` order by ` + orderby + ` ASC `
@@ -68,30 +66,30 @@ func (s *SelectService) GetMyPagingEntitiesWithOrderBytbl(supplierTableName, sup
 	return total
 }
 
-func (s *SelectService) GetUp(supplierTableName, supplierCertTableName, supplierCertSubTableName string, pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where string) (total int64) {
+func (s *SelectService) GetUp( supplierCertTableName string, pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where string) (total int64) {
 	var resultsSlice []map[string][]byte
 
-	//获取总记录数
-	sqlCount := `select count(*) from ` + supplierTableName + ` a `
-	sqlCount += ` left join ` + supplierCertTableName + " b on b.SupplierId = a.Id"
-	sqlCount += ` where ` + where
 
 	var sql string
-	sql = `select max(a.SupplierName) as SupplierName,b.SupplierTypeCode, b.SupplierTypeName, count(b.Id) as AllUpNum `
-	sql += ` from ` + supplierTableName + ` a `
-	sql += ` left join ` + supplierCertTableName + " b on b.SupplierId = a.Id "
-	sql += ` left join ` + supplierCertSubTableName + " c on c.SupplierCertId = b.Id "
-	sql += ` where ` + where
-	sql += ` group by b.Id `
+	sql = `  select (select FullName from Base_Organize where Id = a.CommitComId) FullName,a.CommitComId,a.SupplierTypeName,`
+	sql +=`  count(a.Status=6 or null ) HeGe,count(a.Status=-5 or null ) BuHeGe,count(a.Status=-5 or null ) + count(a.Status=6 or null ) ZongShu `
+	sql += ` from ` + supplierCertTableName + ` a `
+	sql += ` where a.CommitComId is not null and  a.CommitComId!="" and  a.CommitComId!=0 ` + where
+	sql += ` group by FullName,SupplierTypeName `
 
 	if asc {
 		sql += ` order by ` + orderby + ` ASC `
 	} else {
 		sql += ` order by ` + orderby + ` DESC `
 	}
+	//获取总记录数
+	sqlCount := `select count(*) from (` + sql+ `) a `
+
 	sql += ` limit ` + utils.ToStr((pageIndex-1)*itemsPerPage) + "," + utils.ToStr(itemsPerPage)
 	s.DBE.SQL(sql).Find(entitiesPtr)
 
+
+
 	resultsSlice, _ = s.DBE.Query(sqlCount)
 
 	if len(resultsSlice) > 0 {

+ 11 - 14
src/dashoo.cn/backend/api/controllers/oilsupplier/select.go

@@ -3,8 +3,6 @@ package oilsupplier
 import (
 	"encoding/json"
 	"fmt"
-	"strconv"
-	"time"
 
 	"dashoo.cn/backend/api/business/oilsupplier/annualaudit"
 	"dashoo.cn/backend/api/business/oilsupplier/infochange"
@@ -28,16 +26,15 @@ type RegCapitalRange struct {
 	RegCapital2 string
 }
 type UpSearch struct {
-	SupplierName string
+	FullName string
 }
 type UpInfoSearch struct {
-	SupplierName     string
-	SupplierTypeCode string
-	SupplierTypeName string
-	AllUpNum         int
-	HeGeNum          int
-	UnHeGeNum        int
-	Reason           string
+	FullName     		 string
+	SupplierTypeName    string
+	HeGe         		 int
+	BuHeGe              int
+	ZongShu             int
+	Reason              string
 }
 
 type NeedFileTypeStruct struct {
@@ -203,7 +200,7 @@ func (this *SelectController) Up() {
 
 	// //获取分页信息
 	page := this.GetPageInfoForm()
-	where := " 1=1"
+	where := ""
 	asc := false
 	Order := this.GetString("Order")
 	Prop := this.GetString("Prop")
@@ -213,14 +210,14 @@ func (this *SelectController) Up() {
 		}
 	}
 
-	if model.SupplierName != "" {
-		where = where + " and SupplierName like '%" + model.SupplierName + "%'"
+	if model.FullName != "" {
+		where = where + " and (select FullName from Base_Organize where Id = a.CommitComId) like '%" + model.FullName + "%'"
 	}
 
 	svc := selectbusiness.GetSelectService(utils.DBE)
 	var list []UpInfoSearch
 
-	total := svc.GetUp(OilSupplierName, OilSupplierCertName, OilSupplierCertSubName, page.CurrentPage, page.Size, Prop, asc, &list, where)
+	total := svc.GetUp( OilSupplierCertName , page.CurrentPage, page.Size, Prop, asc, &list, where)
 
 	var datainfo DataInfo
 	datainfo.Items = list

+ 1 - 0
src/dashoo.cn/frontend_web/src/pages/select/companyselect/index.vue

@@ -965,6 +965,7 @@ export default {
     clearSearch() {
       Object.assign(this.searchForm, this.searchFormReset);
       this.CityAry = [];
+      this.SetupTime="";
       (this.LinkCityAry = []), (this.currentPage = 1);
       this.initDatas();
     }

+ 9 - 9
src/dashoo.cn/frontend_web/src/pages/select/informationreporting/index.vue

@@ -20,7 +20,7 @@
           style="float: right;position:absolute;right:15px;top:10.5px"
         >
           <el-form-item label="推荐单位">
-            <el-input size="mini" v-model="searchForm.SupplierName" placeholder="请输入内容"></el-input>
+            <el-input size="mini" v-model="searchForm.FullName" placeholder="请输入内容"></el-input>
           </el-form-item>
           <el-form-item>
             <el-dropdown
@@ -54,11 +54,11 @@
         @sort-change="orderby"
       >
         <!--内框表格剩余栏显示-->
-        <el-table-column label="推荐单位" prop="SupplierName" align="center"></el-table-column>
+        <el-table-column label="推荐单位" prop="FullName" align="center"></el-table-column>
         <el-table-column label="准入类别" prop="SupplierTypeName" align="center"></el-table-column>
-        <el-table-column label="上报数量" prop="AllUpNum" align="center"></el-table-column>
-        <el-table-column label="合格数量" prop="AllUpNum" align="center"></el-table-column>
-        <el-table-column label="不合格数量" prop="UnHeGeNum" align="center"></el-table-column>
+        <el-table-column label="上报数量" prop="ZongShu" align="center"></el-table-column>
+        <el-table-column label="合格数量" prop="HeGe" align="center"></el-table-column>
+        <el-table-column label="不合格数量" prop="BuHeGe" align="center"></el-table-column>
         <el-table-column label="不合格原因" prop="Reason" align="center"></el-table-column>
       </el-table>
 
@@ -98,7 +98,7 @@ export default {
       currentPage: 1,
       currentItemCount: 0,
       searchForm: {
-        SupplierName: ""
+        FullName: ""
       },
       //列表排序
       Column: {
@@ -118,7 +118,7 @@ export default {
           this.pos = 0;
         } else {
           // 判断当前元素与上一个元素是否相同
-          if (data[i].SupplierName === data[i - 1].SupplierName) {
+          if (data[i].FullName === data[i - 1].FullName) {
             this.spanArr[this.pos] += 1;
             this.spanArr.push(0);
           } else {
@@ -183,7 +183,7 @@ export default {
         _size: this.size,
         _currentPage: this.currentPage,
         Order: "desc",
-        Prop: "SupplierName"
+        Prop: "Fullname"
       };
 
       console.log(params);
@@ -215,7 +215,7 @@ export default {
       }
     },
     clearSearch() {
-      this.searchForm.SupplierName = "";
+      this.searchForm.FullName = "";
       this.initDatas();
     }
   }