Răsfoiți Sursa

Merge branch 'develop' of http://code.dashoo.cn/chengjian/opms_backend into develop

liuyaqi 2 ani în urmă
părinte
comite
607712766d

+ 10 - 8
opms_parent/app/dao/contract/internal/ctr_contract.go

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

+ 10 - 8
opms_parent/app/dao/contract/internal/ctr_contract_collection_plan.go

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

+ 10 - 8
opms_parent/app/dao/contract/internal/ctr_contract_product.go

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

+ 10 - 8
opms_parent/app/dao/plat/internal/plat_followup.go

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

+ 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

+ 1 - 1
opms_parent/app/service/base.go

@@ -279,7 +279,7 @@ func GetUsersByRoleCode(ctx context.Context, roleCode []string, pageSize ...int)
 	srv := micro_srv.InitMicroSrvClient("User", "micro_srv.auth")
 	defer srv.Close()
 	resp := &comm_def.CommonMsg{}
-	req := &SysUserSearchReq{Roles: roleCode}
+	req := &SysUserSearchReq{Roles: roleCode, Status: "10"}
 	if len(pageSize) > 0 {
 		req.PageSize = pageSize[0]
 	}

+ 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
 	}