Browse Source

Merge branch 'feature/v4.9.33' of https://jygit.jydev.jianyu360.cn/qmx/jy into dev/v4.9.33_wmh

wenmenghao321 1 year ago
parent
commit
ed1964557c

+ 15 - 10
src/jfw/modules/bigmember/src/entity/marketAnalysis/analysisPdf.go

@@ -264,17 +264,18 @@ func (me *MarketAnalysisEntity) GetPdfPageApi() (finalDate map[string]interface{
 	return
 	return
 }
 }
 
 
-func (this *AnalysisReportPdf) PdfSave() error {
+func (this *AnalysisReportPdf) PdfSave() {
 	sessVal := this.Session().GetMultiple()
 	sessVal := this.Session().GetMultiple()
 	userId := qutil.ObjToString(sessVal["userId"])
 	userId := qutil.ObjToString(sessVal["userId"])
 	if userId == "" || userId == "0" {
 	if userId == "" || userId == "0" {
-		return fmt.Errorf("用户异常")
+		this.ServeJson(NewResult(nil, fmt.Errorf("用户异常")))
+		return
 	}
 	}
 	sEmail := this.GetString("s_email")
 	sEmail := this.GetString("s_email")
 	log.Println("s_email", sEmail)
 	log.Println("s_email", sEmail)
 	if !jy.IsEmail(sEmail) {
 	if !jy.IsEmail(sEmail) {
 		this.ServeJson(NewResult(nil, fmt.Errorf("邮箱格式不正确")))
 		this.ServeJson(NewResult(nil, fmt.Errorf("邮箱格式不正确")))
-		return fmt.Errorf("邮箱格式不正确")
+		return
 	}
 	}
 	sType := this.GetString("type")
 	sType := this.GetString("type")
 	var id string
 	var id string
@@ -288,7 +289,8 @@ func (this *AnalysisReportPdf) PdfSave() error {
 	case "3": //定制化分析
 	case "3": //定制化分析
 		rid := util.DecodeId(this.GetString("sid")) //获取信息id
 		rid := util.DecodeId(this.GetString("sid")) //获取信息id
 		if rid == "" {
 		if rid == "" {
-			return fmt.Errorf("定制化分析异常")
+			this.ServeJson(NewResult(nil, fmt.Errorf("定制化分析异常")))
+			return
 		}
 		}
 		pid, _, _ := CheckPowerEquity(this.Session())
 		pid, _, _ := CheckPowerEquity(this.Session())
 		mae := &MarketAnalysisEntity{MgoRecordId: rid, UId: userId, Pid: pid, MgoUserId: qutil.ObjToString(sessVal["mgoUserId"]), PositionId: qutil.IntAll(sessVal["positionId"])}
 		mae := &MarketAnalysisEntity{MgoRecordId: rid, UId: userId, Pid: pid, MgoUserId: qutil.ObjToString(sessVal["mgoUserId"]), PositionId: qutil.IntAll(sessVal["positionId"])}
@@ -303,7 +305,8 @@ func (this *AnalysisReportPdf) PdfSave() error {
 		}
 		}
 		resData, _ := db.Mgo.FindOne(ReportHistoryTable, queryMap)
 		resData, _ := db.Mgo.FindOne(ReportHistoryTable, queryMap)
 		if resData == nil || len(*resData) == 0 {
 		if resData == nil || len(*resData) == 0 {
-			return fmt.Errorf("定制化分析异常")
+			this.ServeJson(NewResult(nil, fmt.Errorf("定制化分析异常")))
+			return
 		}
 		}
 		for s, i := range *resData {
 		for s, i := range *resData {
 			value := i
 			value := i
@@ -324,7 +327,8 @@ func (this *AnalysisReportPdf) PdfSave() error {
 			entName = getBuyerNameById(util.DecodeId(entName))
 			entName = getBuyerNameById(util.DecodeId(entName))
 		}
 		}
 		if entName == "" {
 		if entName == "" {
-			return fmt.Errorf("采购单位异常")
+			this.ServeJson(NewResult(nil, fmt.Errorf("采购单位异常")))
+			return
 		}
 		}
 		res["ent"] = entName
 		res["ent"] = entName
 		res["entName"] = entName
 		res["entName"] = entName
@@ -337,7 +341,7 @@ func (this *AnalysisReportPdf) PdfSave() error {
 		tRange := strings.Split(timeRange, "_")
 		tRange := strings.Split(timeRange, "_")
 		if len(tRange) != 2 {
 		if len(tRange) != 2 {
 			this.ServeJson(NewResult(util.EncodeId(id), fmt.Errorf("错误时间格式")))
 			this.ServeJson(NewResult(util.EncodeId(id), fmt.Errorf("错误时间格式")))
-			return fmt.Errorf("错误时间格式")
+			return
 		}
 		}
 		st := fmt.Sprintf("%s-01-01", tRange[0])
 		st := fmt.Sprintf("%s-01-01", tRange[0])
 		et := fmt.Sprintf("%s-12-31", tRange[1])
 		et := fmt.Sprintf("%s-12-31", tRange[1])
@@ -353,7 +357,8 @@ func (this *AnalysisReportPdf) PdfSave() error {
 		//}
 		//}
 		entId := this.GetString("entId")
 		entId := this.GetString("entId")
 		if util.DecodeId(entId) == "" {
 		if util.DecodeId(entId) == "" {
-			return fmt.Errorf("企业名称异常")
+			this.ServeJson(NewResult(util.EncodeId(id), fmt.Errorf("企业名称异常")))
+			return
 		}
 		}
 		res["ent"] = util.DecodeId(entId)
 		res["ent"] = util.DecodeId(entId)
 		res["entName"] = this.GetString("entName")
 		res["entName"] = this.GetString("entName")
@@ -365,7 +370,7 @@ func (this *AnalysisReportPdf) PdfSave() error {
 		tRange := strings.Split(this.GetString("timeRange"), "_")
 		tRange := strings.Split(this.GetString("timeRange"), "_")
 		if len(tRange) != 2 {
 		if len(tRange) != 2 {
 			this.ServeJson(NewResult(util.EncodeId(id), fmt.Errorf("错误时间格式")))
 			this.ServeJson(NewResult(util.EncodeId(id), fmt.Errorf("错误时间格式")))
-			return fmt.Errorf("时间格式异常")
+			return
 		}
 		}
 		st := fmt.Sprintf("%s-01-01", tRange[0])
 		st := fmt.Sprintf("%s-01-01", tRange[0])
 		et := fmt.Sprintf("%s-12-31", tRange[1])
 		et := fmt.Sprintf("%s-12-31", tRange[1])
@@ -377,7 +382,7 @@ func (this *AnalysisReportPdf) PdfSave() error {
 	}
 	}
 	id = db.Mgo.Save(MgoPdfName, res)
 	id = db.Mgo.Save(MgoPdfName, res)
 	this.ServeJson(NewResult(util.EncodeId(id), nil))
 	this.ServeJson(NewResult(util.EncodeId(id), nil))
-	return nil
+	return
 }
 }
 
 
 func getBuyerNameById(buyerId string) (buyerName string) {
 func getBuyerNameById(buyerId string) (buyerName string) {

+ 3 - 3
src/jfw/modules/subscribepay/src/util/dataExportExcel.go

@@ -94,9 +94,9 @@ func CreateDataExportExcelFile(list *[]map[string]interface{}, isSenior bool, fi
 	if err != nil {
 	if err != nil {
 		return err
 		return err
 	}
 	}
-	//if err := FolderCheck(filePath); err != nil {
-	//	return err
-	//}
+	if err := FolderCheck(filePath); err != nil {
+		return err
+	}
 	return file.Save(filePath)
 	return file.Save(filePath)
 }
 }
 func ExportExcelFile(list *[]map[string]interface{}, isSenior bool) (*xlsx.File, error) {
 func ExportExcelFile(list *[]map[string]interface{}, isSenior bool) (*xlsx.File, error) {