Bladeren bron

前后:序号;流程查询groupby

dubch 4 jaren geleden
bovenliggende
commit
fcc07bd340

+ 17 - 16
src/dashoo.cn/backend/api/business/oilsupplier/annualaudit/annualauditService.go

@@ -161,26 +161,27 @@ func (s *OilAnnualAuditService) GetProcessInfoWithOrderBytbl(oilAnnualAuditName
 
 	//获取总记录数
 	sqlCount := `select count(*) from ` + oilAnnualAuditName + ` a `
-	sqlCount += ` LEFT JOIN Base_User u ON a.CreateUserId = u.Id`
-	sqlCount += ` Left join OilSupplier s on a.SupplierId = s.Id
-			 left join Base_User uu on s.CreateUserId = uu.Id
-			 left join OilCorporateInfo c on s.CreateUserId = c.UserId`
+	//sqlCount += ` LEFT JOIN Base_User u ON a.CreateUserId = u.Id`
+	//sqlCount += ` Left join OilSupplier s on a.SupplierId = s.Id
+	//		 left join Base_User uu on a.CreateUserId = uu.Id
+	//		 left join OilCorporateInfo c on a.CreateUserId = c.UserId`
 	sqlCount += ` where ` + where
 
 	var sql string
 	sql = `select a.SupplierName, a.Id, `
 	sql += ` a.Status, a.SupplierTypeName SupplierTypeCode, `
 	sql += ` a.WorkflowId, '3' as Type, a.CreateOn, a.AccessCardNo, a.ModifiedOn as AddinTime, u.Realname AS ContactName, u.Telephone AS Mobile,`
-	sql += ` CASE WHEN uu.IsCompanyUser = 1 THEN c.CheckUnitName
+	sql += ` CASE WHEN uu.IsCompanyUser = 1 THEN org.FullName
 			WHEN uu.IsCompanyUser = 0 THEN uu.Unit
  			ELSE ''
  			END AS RecUnitName`
 	sql += ` from ` + oilAnnualAuditName + ` a `
 	sql += ` LEFT JOIN Base_User u ON a.CreateUserId = u.Id`
 	sql += ` Left join OilSupplier s on a.SupplierId = s.Id
-			 left join Base_User uu on s.CreateUserId = uu.Id
-			 left join OilCorporateInfo c on s.CreateUserId = c.UserId`
+			 left join Base_User uu on a.CreateUserId = uu.Id
+			 left join Base_Organize org on a.CommitComId = org.Id`
 	sql += ` where ` + where
+	sql += ` group by a.Id`
 	if asc {
 		sql += ` order by ` + orderby + ` ASC `
 	} else {
@@ -233,45 +234,45 @@ func (s *OilAnnualAuditService) GetProcessInfoAllWithOrderBytbl(pageIndex, items
 	sql += `select a.SupplierName, a.Id, `
 	sql += ` a.Status, a.AppendType SupplierTypeCode, `
 	sql += ` a.WorkflowId, a.ProcessKey, '2' as Type, a.CreateOn, a.AccessCardNo, a.ModifiedOn as AddinTime, u.Realname AS ContactName, u.Telephone AS Mobile,`
-	sql += ` case when uu.IsCompanyUser = 1 then c.CheckUnitName
+	sql += ` case when uu.IsCompanyUser = 1 then org.FullName
  				when uu.IsCompanyUser = 0 then uu.Unit
  				else ''
  			end As RecUnitName `
 	sql += ` from OilSupplierCertAppend a `
 	sql += ` LEFT JOIN Base_User u ON a.CreateUserId = u.Id`
 	sql += ` Left join OilSupplier s on a.SupplierId = s.Id
-			 left join Base_User uu on s.CreateUserId = uu.Id
-			 left join OilCorporateInfo c on s.CreateUserId = c.UserId`
+			 left join Base_User uu on a.CreateUserId = uu.Id
+			 left join Base_Organize org on a.CommitComId = org.Id`
 	sql += ` where ` + where2
 	sql += ` union `
 
 	sql += `select a.SupplierName, a.Id, `
 	sql += ` a.Status, a.SupplierTypeName SupplierTypeCode, `
 	sql += ` a.WorkflowId, a.ProcessKey, '3' as Type, a.CreateOn, a.AccessCardNo, a.ModifiedOn as AddinTime, u.Realname AS ContactName, u.Telephone AS Mobile,`
-	sql += ` CASE WHEN uu.IsCompanyUser = 1 THEN c.CheckUnitName
+	sql += ` CASE WHEN uu.IsCompanyUser = 1 THEN org.FullName
 			WHEN uu.IsCompanyUser = 0 THEN uu.Unit
  			ELSE ''
  			END AS RecUnitName`
 	sql += ` from OilAnnualAudit a `
 	sql += ` LEFT JOIN Base_User u ON a.CreateUserId = u.Id`
 	sql += ` Left join OilSupplier s on a.SupplierId = s.Id
-			 left join Base_User uu on s.CreateUserId = uu.Id
-			 left join OilCorporateInfo c on s.CreateUserId = c.UserId`
+			 left join Base_User uu on a.CreateUserId = uu.Id
+			 left join Base_Organize org on a.CommitComId = org.Id`
 	sql += ` where ` + where3
 	sql += ` union `
 
 	sql += `select a.SupplierName, a.Id, `
 	sql += ` a.Status,a.SupplierTypeCode, `
 	sql += ` a.WorkflowId, a.ProcessKey, '4' as Type, a.CreateOn, a.AccessCardNo, a.ModifiedOn as AddinTime, u.Realname AS ContactName, u.Telephone AS Mobile, `
-	sql += ` CASE WHEN uu.IsCompanyUser = 1 THEN c.CheckUnitName
+	sql += ` CASE WHEN uu.IsCompanyUser = 1 THEN org.FullName
  				WHEN uu.IsCompanyUser = 0 THEN uu.Unit
  				ELSE ''
  				END AS RecUnitName`
 	sql += ` from OilInfoChange a `
 	sql += ` LEFT JOIN Base_User u ON a.CreateUserId = u.Id`
 	sql += ` Left join OilSupplier s on a.SupplierId = s.Id
-			left join Base_User uu on s.CreateUserId = uu.Id
-			left join OilCorporateInfo c on s.CreateUserId = c.UserId `
+			left join Base_User uu on a.CreateUserId = uu.Id
+			left join Base_Organize org on a.CommitComId = org.Id `
 	sql += ` where ` + where
 	if asc {
 		sql += ` order by ` + orderby + ` ASC `

+ 9 - 7
src/dashoo.cn/backend/api/business/oilsupplier/infochange/infochangeService.go

@@ -246,26 +246,28 @@ func (s *InfoChangeService) GetProcessInfoWithOrderBytbl(tableName string, pageI
 
 	//获取总记录数
 	sqlCount := `select count(*) from ` + tableName + ` a `
-	sqlCount += ` LEFT JOIN Base_User u ON a.CreateUserId = u.Id`
-	sqlCount += ` Left join OilSupplier s on a.SupplierId = s.Id
-			left join Base_User uu on s.CreateUserId = uu.Id
-			left join OilCorporateInfo c on s.CreateUserId = c.UserId `
+	//sqlCount += ` LEFT JOIN Base_User u ON a.CreateUserId = u.Id`
+	//sqlCount += ` Left join OilSupplier s on a.SupplierId = s.Id
+	//		left join Base_User uu on s.CreateUserId = uu.Id
+	//		left join OilCorporateInfo c on s.CreateUserId = c.UserId `
 	sqlCount += ` where ` + where
+	//sqlCount += ` group by a.Id`
 
 	var sql string
 	sql = `select a.SupplierName,a.SupplierId, a.Id, `
 	sql += ` a.Status, `
 	sql += ` a.WorkflowId, '4' as Type, a.CreateOn, a.AccessCardNo, a.ModifiedOn as AddinTime, u.Realname AS ContactName, u.Telephone AS Mobile, `
-	sql += ` CASE WHEN uu.IsCompanyUser = 1 THEN c.CheckUnitName
+	sql += ` CASE WHEN uu.IsCompanyUser = 1 THEN org.FullName
  				WHEN uu.IsCompanyUser = 0 THEN uu.Unit
  				ELSE ''
  				END AS RecUnitName`
 	sql += ` from ` + tableName + ` a `
 	sql += ` LEFT JOIN Base_User u ON a.CreateUserId = u.Id`
 	sql += ` Left join OilSupplier s on a.SupplierId = s.Id
-			left join Base_User uu on s.CreateUserId = uu.Id
-			left join OilCorporateInfo c on s.CreateUserId = c.UserId `
+			left join Base_User uu on a.CreateUserId = uu.Id
+			left join Base_Organize org on a.CommitComId = org.Id`
 	sql += ` where ` + where
+	sql += ` group by a.Id`
 	if asc {
 		sql += ` order by ` + orderby + ` ASC `
 	} else {

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

@@ -401,9 +401,10 @@ func (s *OilSupplierService) GetProcessInfoWithOrderBytbl(supplierTableName, sup
 	sql += ` u.Telephone as Mobile`
 	sql += ` from ` + supplierTableName + ` a `
 	sql += ` left join ` + supplierCertTableName + ` b on b.SupplierId = a.Id`
-	sql += ` Left join Base_User u on a.CreateUserId = u.Id `
+	sql += ` Left join Base_User u on b.CreateUserId = u.Id `
 	sql += ` LEFT JOIN Base_Organize org ON b.CommitComId = org.Id`
 	sql += ` where ` + where
+	sql += ` group by b.Id`
 	if asc {
 		sql += ` order by ` + orderby + ` ASC `
 	} else {

+ 11 - 3
src/dashoo.cn/backend/api/business/oilsupplier/suppliercertappend/oilsuppliercertappendService.go

@@ -175,16 +175,24 @@ func (s *OilSupplierCertAppendService) GetProcessInfoWithOrderBytbl(supplierCert
 	sql = `select a.SupplierId,a.SupplierName, a.Id, `
 	sql += ` a.Status, a.AppendType SupplierTypeCode, `
 	sql += ` a.WorkflowId, a.ProcessKey, '2' as Type, a.CreateOn, a.AccessCardNo, a.ModifiedOn as AddinTime, u.Realname AS ContactName, u.Telephone AS Mobile,`
-	sql += ` case when uu.IsCompanyUser = 1 then c.CheckUnitName
+	//sql += ` case when uu.IsCompanyUser = 1 then c.CheckUnitName
+ 	//			when uu.IsCompanyUser = 0 then uu.Unit
+ 	//			else ''
+ 	//		end As RecUnitName `
+ 	sql += ` case when uu.IsCompanyUser = 1 then org.FullName
  				when uu.IsCompanyUser = 0 then uu.Unit
  				else ''
  			end As RecUnitName `
 	sql += ` from ` + supplierCertAppendName + ` a `
 	sql += ` LEFT JOIN Base_User u ON a.CreateUserId = u.Id`
+	//sql += ` Left join OilSupplier s on a.SupplierId = s.Id
+	//		 left join Base_User uu on s.CreateUserId = uu.Id
+	//		 left join OilCorporateInfo c on s.CreateUserId = c.UserId`
 	sql += ` Left join OilSupplier s on a.SupplierId = s.Id
-			 left join Base_User uu on s.CreateUserId = uu.Id
-			 left join OilCorporateInfo c on s.CreateUserId = c.UserId`
+			 left join Base_User uu on a.CreateUserId = uu.Id
+			 left join Base_Organize org on a.CommitComId = org.Id`
 	sql += ` where ` + where
+	sql += ` group by a.Id`
 	if asc {
 		sql += ` order by ` + orderby + ` ASC `
 	} else {

+ 6 - 1
src/dashoo.cn/frontend_web/src/pages/oilcontract/contract-select/index.vue

@@ -54,12 +54,17 @@
       </div>
       <el-table size="mini" id="rebateSetTable" highlight-current-row stripe :data="entityList" border ref="refTable"
                 height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby" @selection-change="onSelectAll" v-loading="tableLoading">
-        <el-table-column label="操作" min-width="140" align="center" fixed>
+        <el-table-column label="操作" min-width="140" fixed="right" align="center">
           <template slot-scope="scope">
             <el-button type="text" title="查看" size="small" @click="onNavigateEvaluate(scope.row)">查看流程
             </el-button>
           </template>
         </el-table-column>
+        <el-table-column align="center" width="70" label="序号">
+          <template slot-scope="scope">
+            <span>{{scope.$index+(currentPage - 1) * size + 1}} </span>
+          </template>
+        </el-table-column>
         <el-table-column v-for="column in tableColumns" :key="column.Id"
                          v-if="column.prop === 'Status'" :prop="column.prop" sortable :min-width="140" :label="column.label" align="center" show-overflow-tooltip>
           <template slot-scope="scope">