Browse Source

Merge branch 'master' into feature/v4.8.96

lianbingjie 1 year ago
parent
commit
2efb8589d2

+ 32 - 17
src/jfw/modules/bigmember/src/entity/report.go

@@ -75,21 +75,28 @@ func GetReportProjectInfo(param *ReportProjectInfoParam, positionId int64) (data
 		// 行业 {"水利水电":["水利工程","发电工程","航运工程","其他工程"]} sql中处理成 "水利水电_水利工程"
 		tmpArr := []string{}
 		for topIndustry, subList := range param.Industry {
-			for i := 0; i < len(subList); i++ {
+			if param.From == From {
 				tmpArr = append(tmpArr, "find_in_set(?,subscopeclass)")
-				values = append(values, fmt.Sprintf("%s_%s", topIndustry, subList[i]))
+				values = append(values, topIndustry)
+			} else {
+				for i := 0; i < len(subList); i++ {
+					tmpArr = append(tmpArr, "find_in_set(?,subscopeclass)")
+					values = append(values, fmt.Sprintf("%s_%s", topIndustry, subList[i]))
+				}
 			}
 		}
 		qstr = append(qstr, fmt.Sprintf("(%s)", strings.Join(tmpArr, " or ")))
 	}
 	// 采购单位类型
-	if param.BuyerClass != nil && len(param.BuyerClass) > 0 {
-		tmpArr := []string{}
-		for i := 0; i < len(param.BuyerClass); i++ {
-			tmpArr = append(tmpArr, "?")
-			values = append(values, param.BuyerClass[i])
+	if param.From != From {
+		if param.BuyerClass != nil && len(param.BuyerClass) > 0 {
+			tmpArr := []string{}
+			for i := 0; i < len(param.BuyerClass); i++ {
+				tmpArr = append(tmpArr, "?")
+				values = append(values, param.BuyerClass[i])
+			}
+			qstr = append(qstr, fmt.Sprintf("buyerclass in (%s)", strings.Join(tmpArr, ",")))
 		}
-		qstr = append(qstr, fmt.Sprintf("buyerclass in (%s)", strings.Join(tmpArr, ",")))
 	}
 	// 采购单位
 	if param.Buyer != "" {
@@ -110,7 +117,7 @@ func GetReportProjectInfo(param *ReportProjectInfoParam, positionId int64) (data
 	if param.From == From {
 		table = TableMemberReportProjectYys
 	}
-	CountQuery := fmt.Sprintf("select count(1) from %s where position_id=? and start_time>=? and end_time<=? %s ", table, q)
+	CountQuery := fmt.Sprintf("select count(1) from %s where position_id=? and start_time=? and end_time=? %s ", table, q)
 	total = db.Base.CountBySql(CountQuery, values...)
 	if total == 0 {
 		return data, 0
@@ -119,7 +126,7 @@ func GetReportProjectInfo(param *ReportProjectInfoParam, positionId int64) (data
 	if param.Sort == 1 {
 		orderby = " (if(bidamount >0,bidamount,budget)) desc,id desc"
 	}
-	query := fmt.Sprintf("select * from %s where position_id=? and start_time>=? and end_time<=? %s  order by  %s   limit %d,%d", table, q, orderby, (param.PageNum-1)*param.PageSize, param.PageSize)
+	query := fmt.Sprintf("select * from %s where position_id=? and start_time=? and end_time=? %s  order by  %s   limit %d,%d", table, q, orderby, (param.PageNum-1)*param.PageSize, param.PageSize)
 	rs := db.Base.SelectBySql(query, values...)
 	if rs != nil && len(*rs) > 0 {
 		data = *rs
@@ -128,7 +135,7 @@ func GetReportProjectInfo(param *ReportProjectInfoParam, positionId int64) (data
 }
 
 // ReportProjectInfoFormat 周报/月报 项目明细 格式化数据
-func ReportProjectInfoFormat(data []map[string]interface{}) []map[string]interface{} {
+func ReportProjectInfoFormat(data []map[string]interface{}, from string) []map[string]interface{} {
 	rs := []map[string]interface{}{}
 	for i := 0; i < len(data); i++ {
 		tmp := map[string]interface{}{}
@@ -144,12 +151,16 @@ func ReportProjectInfoFormat(data []map[string]interface{}) []map[string]interfa
 			winIdArr = append(winIdArr, splitWinnerId[j])
 		}
 		tmp["id"] = encrypt.EncodeArticleId2ByCheck(common.ObjToString(data[i]["source_infoid"]))
+		if from == From {
+			tmp["id"] = common.ObjToString(data[i]["source_infoid"])
+		}
+
 		tmp["winnerId"] = winIdArr
 		tmp["winner"] = strings.Split(tmpWinner, ",")
 		tmp["name"] = common.ObjToString(data[i]["name"])
 		tmp["area"] = data[i]["area"]
 		tmp["bidStatus"] = data[i]["bidstatus"]
-		tmp["buyerClass"] = data[i]["buyerclass"]
+		tmp["buyerClass"] = ""
 		tmp["subscopeclass"] = data[i]["subscopeclass"]
 		tmp["bidAmount"] = data[i]["bidamount"]
 		tmp["budget"] = data[i]["budget"]
@@ -196,7 +207,7 @@ func ReportGetBuyerClass(positionId, start, end int64, from string) []string {
 	if from == From {
 		table = TableMemberReportProjectYys
 	}
-	q := "select distinct(buyerclass) from " + table + " where position_id =? and start_time >=? and end_time<=?  order by buyerclass "
+	q := "select distinct(buyerclass) from " + table + " where position_id =? and start_time =? and end_time=?  order by buyerclass "
 	rs := db.Base.SelectBySql(q, positionId, start, end)
 	if rs != nil && len(*rs) > 0 {
 		for i := 0; i < len(*rs); i++ {
@@ -207,8 +218,8 @@ func ReportGetBuyerClass(positionId, start, end int64, from string) []string {
 }
 
 // ReportGetIndustry 周报月报获取当前行业
-func ReportGetIndustry(positionId, start, end int64, from string) []string {
-	subscopeclass := []string{}
+func ReportGetIndustry(positionId, start, end int64, from string) map[string]interface{} {
+	subscopeclassArr := map[string]interface{}{}
 	table := TableMemberReportProject
 	if from == From {
 		table = TableMemberReportProjectYys
@@ -217,10 +228,14 @@ func ReportGetIndustry(positionId, start, end int64, from string) []string {
 	rs := db.Base.SelectBySql(q, positionId, start, end)
 	if rs != nil && len(*rs) > 0 {
 		for i := 0; i < len(*rs); i++ {
-			subscopeclass = append(subscopeclass, common.ObjToString((*rs)[i]["subscopeclass"]))
+			subscopeclass := common.ObjToString((*rs)[i]["subscopeclass"])
+			if subscopeclass != "" {
+				subscopeclassArr[subscopeclass] = []interface{}{}
+			}
+
 		}
 	}
-	return subscopeclass
+	return subscopeclassArr
 }
 
 // GetMainPositionId 根据用户id获取主账号的职位id

+ 6 - 4
src/jfw/modules/bigmember/src/service/report/report.go

@@ -243,13 +243,15 @@ func (r *Report) ProjectInfo() {
 	param.PageSize = qutil.If(param.PageSize < 1 || param.PageSize > 100, 50, param.PageSize).(int)
 	// 取positionId
 	positionId := qutil.Int64All(r.GetSession("positionId"))
-	mainPositionId := entity.GetMainPositionId(qutil.ObjToString(r.GetSession("mgoUserId")))
-	if mainPositionId != int64(0) {
-		positionId = mainPositionId
+	if param.From != From {
+		mainPositionId := entity.GetMainPositionId(qutil.ObjToString(r.GetSession("mgoUserId")))
+		if mainPositionId != int64(0) {
+			positionId = mainPositionId
+		}
 	}
 	m := map[string]interface{}{}
 	list, total := entity.GetReportProjectInfo(&param, positionId)
-	m["list"] = entity.ReportProjectInfoFormat(list)
+	m["list"] = entity.ReportProjectInfoFormat(list, param.From)
 	m["total"] = total
 	r.ServeJson(Result{
 		Data: m,

+ 9 - 1
src/jfw/modules/publicapply/.idea/workspace.xml

@@ -5,8 +5,9 @@
   </component>
   <component name="ChangeListManager">
     <list default="true" id="99903b5d-26c6-49b2-8d9c-56347398c448" name="变更" comment="">
-      <change beforePath="$PROJECT_DIR$/../app/src/go.sum" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/../bigmember/src/service/analysis/forecastproject.go" beforeDir="false" afterPath="$PROJECT_DIR$/../bigmember/src/service/analysis/forecastproject.go" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/../subscribepay/src/invoice.json" beforeDir="false" afterPath="$PROJECT_DIR$/../subscribepay/src/invoice.json" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -32,6 +33,13 @@
   <component name="GoLibraries">
     <option name="indexEntireGoPath" value="false" />
   </component>
+  <component name="HighlightingSettingsPerFile">
+    <setting file="file://H:/go/go1.20.4/pkg/mod/app.yhyue.com/moapp/jypkg@v0.0.0-20230925120741-9e02619bfe25/common/src/qfw/util/jy/bigVipPower.go" root0="SKIP_INSPECTION" />
+    <setting file="file://H:/go/go1.20.4/pkg/mod/app.yhyue.com/moapp/jypkg@v0.0.0-20230925120741-9e02619bfe25/middleground/usercenter.go" root0="SKIP_INSPECTION" />
+    <setting file="file://H:/go/go1.20.4/pkg/mod/app.yhyue.com/moapp/jypkg@v1.1.2/common/src/qfw/util/dataexport/dataexport.go" root0="SKIP_INSPECTION" />
+    <setting file="file://H:/go/go1.20.4/pkg/mod/app.yhyue.com/moapp/jypkg@v1.1.7/common/src/qfw/util/dataexport/dataexport.go" root0="SKIP_INSPECTION" />
+    <setting file="file://H:/go/go1.20.4/pkg/mod/bp.jydev.jianyu360.cn/!base!service/user!center@v1.2.14/rpc/usercenter/usercenter.go" root0="SKIP_INSPECTION" />
+  </component>
   <component name="MarkdownSettingsMigration">
     <option name="stateVersion" value="1" />
   </component>

+ 1 - 1
src/jfw/modules/subscribepay/src/invoice.json

@@ -3,7 +3,7 @@
   "tax_rate": "0.06",
   "tax_policy": "0",
   "invoice_nature": "0",
-  "invoice_interface_address": "https://jybx3-webtest.jydev.jianyu360.com",
+  "invoice_interface_address": "http://127.0.0.1:7070",
   "code": "3040205000000000000",
   "switch_paymch":{
 	"model":1,