浏览代码

feature(权限): 权限优化

ZZH-wl 2 年之前
父节点
当前提交
7e3e5672ce

+ 1 - 1
opms_parent/app/dao/contract/internal/ctr_contract.go

@@ -893,7 +893,7 @@ func (d *CtrContractDao) checkColumnsName(dataScope map[string]interface{}, args
 	delete(dataScope, "roles")
 	delete(dataScope, "posts")
 	delete(dataScope, bigColumns)
-	if len(colsContrast) > 0 {
+	if specialFlag && len(args) == 1 {
 		for k, v := range dataScope {
 			if data, ok := colsContrast[k]; ok {
 				dataScope[data.(string)] = v

+ 1 - 1
opms_parent/app/dao/contract/internal/ctr_contract_collection_plan.go

@@ -830,7 +830,7 @@ func (d *CtrContractCollectionPlanDao) checkColumnsName(dataScope map[string]int
 	delete(dataScope, "roles")
 	delete(dataScope, "posts")
 	delete(dataScope, bigColumns)
-	if len(colsContrast) > 0 {
+	if specialFlag && len(args) == 1 {
 		for k, v := range dataScope {
 			if data, ok := colsContrast[k]; ok {
 				dataScope[data.(string)] = v

+ 1 - 1
opms_parent/app/dao/contract/internal/ctr_contract_product.go

@@ -857,7 +857,7 @@ func (d *CtrContractProductDao) checkColumnsName(dataScope map[string]interface{
 	delete(dataScope, "roles")
 	delete(dataScope, "posts")
 	delete(dataScope, bigColumns)
-	if len(colsContrast) > 0 {
+	if specialFlag && len(args) == 1 {
 		for k, v := range dataScope {
 			if data, ok := colsContrast[k]; ok {
 				dataScope[data.(string)] = v

+ 1 - 1
opms_parent/app/dao/plat/internal/plat_followup.go

@@ -832,7 +832,7 @@ func (d *PlatFollowupDao) checkColumnsName(dataScope map[string]interface{}, arg
 	delete(dataScope, "roles")
 	delete(dataScope, "posts")
 	delete(dataScope, bigColumns)
-	if len(colsContrast) > 0 {
+	if specialFlag && len(args) == 1 {
 		for k, v := range dataScope {
 			if data, ok := colsContrast[k]; ok {
 				dataScope[data.(string)] = v

+ 8 - 6
opms_parent/app/dao/work/internal/work_order.go

@@ -838,12 +838,14 @@ func (d *WorkOrderDao) checkColumnsName(dataScope map[string]interface{}, args .
 	delete(dataScope, "roles")
 	delete(dataScope, "posts")
 	delete(dataScope, bigColumns)
-	for k, v := range colsContrast {
-		if data, ok := dataScope[k]; ok {
-			dataScope[v.(string)] = data
-			delete(dataScope, k)
-		} else {
-			dataScope[k] = v
+	if specialFlag && len(args) == 1 {
+		for k, v := range colsContrast {
+			if data, ok := dataScope[k]; ok {
+				dataScope[v.(string)] = data
+				delete(dataScope, k)
+			} else {
+				dataScope[k] = v
+			}
 		}
 	}
 	return specialFlag, userCols, orColsMap

+ 6 - 6
opms_parent/app/service/proj/business.go

@@ -750,7 +750,7 @@ func (p *businessService) BusUpgradeDingEvent(business *model.ProjBusiness, req
 			for k, files := range fileMap {
 				// 报价单
 				if k == "quotationFile" {
-					if quotationFile, err = p.txCreateBusinessDingTalkFile(business, k, files); err != nil {
+					if quotationFile, err = p.txCreateBusinessDingTalkFile(business.Id, upgradeType, k, files); err != nil {
 						return err
 					}
 				}
@@ -843,13 +843,13 @@ func (p *businessService) BusUpgradeDingEvent(business *model.ProjBusiness, req
 			for k, files := range fileMap {
 				// 报价单
 				if k == "quotationFile" {
-					if quotationFile, err = p.txCreateBusinessDingTalkFile(business, k, files); err != nil {
+					if quotationFile, err = p.txCreateBusinessDingTalkFile(business.Id, upgradeType, k, files); err != nil {
 						return err
 					}
 				}
 				// 大数参数文件
 				if k == "dashooParamFile" {
-					if dashooParamFile, err = p.txCreateBusinessDingTalkFile(business, k, files); err != nil {
+					if dashooParamFile, err = p.txCreateBusinessDingTalkFile(business.Id, upgradeType, k, files); err != nil {
 						return err
 					}
 				}
@@ -952,7 +952,7 @@ func (p *businessService) BusUpgradeDingEvent(business *model.ProjBusiness, req
 }
 
 // 项目上传文件至钉钉
-func (p *businessService) txCreateBusinessDingTalkFile(business *model.ProjBusiness, fileType string, file *multipart.FileHeader) ([]contractModel.DingFileInfo, error) {
+func (p *businessService) txCreateBusinessDingTalkFile(businessId int, upgradeType, fileType string, file *multipart.FileHeader) ([]contractModel.DingFileInfo, error) {
 	dingTalkFiles := make([]contractModel.DingFileInfo, 0)
 	//for _, file := range files {
 	resp, err := dingtalk.Client.GetStorage().UploadFile(service.DingTalkSpaceId, p.GetCxtUserDingtalkId(), file.FileName, file.File.Name())
@@ -960,7 +960,7 @@ func (p *businessService) txCreateBusinessDingTalkFile(business *model.ProjBusin
 		g.Log().Error(err)
 		return nil, myerrors.TipsError("钉钉上传文件异常")
 	}
-	typ := "项目转" + nboType[business.NboType] + "类"
+	typ := "项目" + upgradeType
 	if fileType == "quotationFile" {
 		typ += "上传报价单文件"
 	}
@@ -976,7 +976,7 @@ func (p *businessService) txCreateBusinessDingTalkFile(business *model.ProjBusin
 		FileType: resp.Dentry.Extension,
 	})
 	//}
-	err = p.txCreateBusinessFile(business.Id, typ, dingTalkFiles)
+	err = p.txCreateBusinessFile(businessId, typ, dingTalkFiles)
 	if err != nil {
 		return nil, err
 	}