luwenna 3 年 前
コミット
e38aa133db

+ 3 - 0
src/config.json

@@ -309,6 +309,9 @@
     "sessionTimeout":168,
     "pcSessionTimeout":168,
     "shareRedisName":"other",
+    "wxWebdomain": "https://web-ws.jydev.jianyu360.com",
+    "wxOrgUrl": "/page_entbase_mobile/page/invite/inviting.html",
+    "pcOrgUrl":"/orgpc/inviting",
     "criticality":2,
     "indexcontentTimeOut":86400,
     "seoBeforeTimeHour":12160

+ 298 - 5
src/jfw/front/dataExport.go

@@ -14,6 +14,7 @@ import (
 	"regexp"
 	"strconv"
 	"strings"
+	"sync"
 	"time"
 
 	"github.com/go-xweb/xweb"
@@ -49,8 +50,14 @@ type DataExport struct {
 	integralDetail       xweb.Mapper `xweb:"/front/integral/integralDetail"`             //剑鱼币订单详情
 
 	getPcEntAuth xweb.Mapper `xweb:"/front/entExportAuth/getAuth"` //获取企业权限
+
+	//gettest            xweb.Mapper `xweb:"/front/order/gettest"`                    //模拟
+	//entDataExport      xweb.Mapper `xweb:"/front/entDataExport/(.*)"`               //企业数据导出
+	//isEntExportSuccess xweb.Mapper `xweb:"/front/entExportAuth/isEntExportSuccess"` //企业导出是否成功
 }
 
+var order_pageSize = 10
+
 type Filters struct {
 	FilterId string
 }
@@ -60,8 +67,15 @@ func init() {
 }
 
 var (
-	layout_date     = "2006.01.02"
-	tableName_order = "dataexport_order" //订单表
+	layout_date         = "2006.01.02"
+	orderStatus_unPaid  = "0"                //订单状态-待支付
+	orderStatus_paid    = "1"                //订单状态-已完成
+	orderStatus_deleted = "-1"               //订单状态-已删除
+	orderStatus_cancel  = "-2"               //订单状态-已取消
+	tableName_order     = "dataexport_order" //订单表
+	SE                  = util.SimpleEncrypt{Key: "topJYBX2019"}
+	exportLock          = sync.Mutex{}
+	exportLockMap       = map[int]sync.Mutex{}
 )
 
 func (d *DataExport) ToSieve() error {
@@ -92,38 +106,57 @@ func (d *DataExport) SieveData() error {
 	var cityArr []string
 	var regionArr []string
 	var industryArr []string
+	var subTypeArr []string
 	var buyerArr []string
 	var buyerclassArr []string
 	var winnerArr []string
 	var keywordList []dataexport.KeyWord
 
+	log.Println("price", minPrice, maxPrice)
+	if publishtime != "" {
+		log.Println("publishtime", publishtime)
+	}
 	if area != "" {
 		areaArr = strings.Split(area, ",")
+		log.Println("areaArr", areaArr)
 	}
 	if city != "" {
 		cityArr = strings.Split(city, ",")
+		log.Println("cityArr", cityArr)
 	}
 	if region != "" {
 		regionArr = strings.Split(region, ",")
+		log.Println("regionArr", regionArr)
 	}
 	if industry != "" {
 		industryArr = strings.Split(industry, ",")
 		log.Println("industryArr", industryArr)
 	}
+	if subType != "" {
+		subTypeArr = strings.Split(subType, ",")
+		log.Println("subTypeArr", subTypeArr)
+	}
+	log.Println("keywordParam", keyword)
 	if keyword != "" {
 		err := json.Unmarshal([]byte(keyword), &keywordList)
 		if err != nil {
 			log.Println("keyword param 反序列化异常,查看前后台字段是否对应")
+		} else {
+			log.Println("keywordList", len(keywordList), keywordList)
 		}
 	}
+	log.Println("selectType", selectType)
 	if buyer != "" {
 		buyerArr = strings.Split(buyer, ",")
+		log.Println("buyerArr", buyerArr)
 	}
 	if buyerclass != "" {
 		buyerclassArr = strings.Split(buyerclass, ",")
+		log.Println("buyerclassArr", buyerclassArr)
 	}
 	if winner != "" {
 		winnerArr = strings.Split(winner, ",")
+		log.Println("winnerArr", winnerArr)
 	}
 	sieveCondition := map[string]interface{}{
 		"publishtime": publishtime,
@@ -197,6 +230,7 @@ func (d *DataExport) ToOrderDetail(orderCode string) error {
 	if orderCode != "" {
 		orderDetail = *public.Mysql.FindOne(tableName_order, queryMap, "", "")
 	}
+	//	log.Println("ToOrderDetail", orderCode, orderDetail)
 	if orderDetail["pay_money"] != nil {
 		orderDetail["pay_money"] = float64(orderDetail["pay_money"].(int64))
 	}
@@ -687,6 +721,15 @@ func (d *DataExport) Check_invoice(order_code string) error {
 	return d.Render("/_error.html")
 }
 
+//func (d *DataExport) Gettest() {
+//	order_code := d.GetString("order_code")
+//	info := public.Mysql.FindOne("invoice", map[string]interface{}{"order_code": order_code}, "", "")
+//	d.ServeJson(map[string]interface{}{
+//		"data": info,
+//	})
+//	return
+//}
+
 func (d *DataExport) InvoicetimeOut() {
 	d.Render("/pc/invoice_error.html")
 }
@@ -700,6 +743,86 @@ func (d *DataExport) ValuationList(order_code string) error {
 	return d.Render("/_error.html")
 }
 
+//
+//func (d *DataExport) EntDataExport(_id string) error {
+//	id := util.SE.Decode4Hex(_id)
+//	userId := util.ObjToString(d.GetSession("userId"))
+//	entId := util.IntAll(d.GetSession("entId"))
+//	entUserId := util.IntAll(d.GetSession("entUserId"))
+//	isFirst, err := d.GetBool("isFirst")
+//	if err != nil {
+//		isFirst = true
+//	}
+//	if userId == "" {
+//		return errors.New("未登录")
+//	}
+//	exportLock.Lock()
+//	exportLockMap[entId] = sync.Mutex{}
+//	entLock := exportLockMap[entId]
+//	exportLock.Unlock()
+//	entLock.Lock()
+//	query := map[string]interface{}{"ent_id": entId, "user_id": entUserId}
+//	data_limit, remain_nums, export_nums := 0, 0, 0
+//	limit := public.Mysql.FindOne("entniche_export_limit", query, "data_limit,remain_nums,export_nums", "")
+//	if limit != nil {
+//		data_limit = util.IntAll((*limit)["data_limit"])
+//		remain_nums = util.IntAll((*limit)["remain_nums"])
+//		export_nums = util.IntAll((*limit)["export_nums"])
+//	}
+//	count := 0
+//	newCount := 0
+//	data := &[]map[string]interface{}{}
+//	current := GetCurrentCount(entId)
+//	log.Println("企业总条数", current)
+//	url := config.Sysconfig["dedupUrl"].(string)
+//	count, newCount, data = public.GetEntDataExportCount(id, entId, entUserId, remain_nums, current, isFirst, util.ObjToString(config.Sysconfig["webdomain"]), url)
+//	isExport := true
+//	isEntExport := true
+//	if newCount > current {
+//		isEntExport = false
+//	}
+//	if newCount > remain_nums {
+//		isExport = false
+//	}
+//	//current 企业总条数   count 筛选条数  newCount 去重后条数  exportNum 今日已导出  limit 今日剩余 limitDay 今日限额
+//	result := map[string]interface{}{
+//		"newCount":    newCount,
+//		"count":       count,
+//		"limit":       remain_nums,
+//		"limitDay":    data_limit,
+//		"exportNum":   export_nums,
+//		"current":     current,
+//		"isExport":    isExport,
+//		"isEntExport": isEntExport,
+//	}
+//	if isFirst || !isExport || !isEntExport {
+//		entLock.Unlock()
+//		d.ServeJson(result)
+//	} else {
+//		go func() {
+//			data = public.FormatExportDatas(data, config.Sysconfig["webdomain"].(string), "2", entId)
+//			xlsxUrl := GetXlsx(*data, entId, entUserId)
+//			if xlsxUrl != "" {
+//				filter := Filters{
+//					FilterId: id,
+//				}
+//				filterStr, _ := json.Marshal(filter)
+//				SaveExportLog(entId, entUserId, count, newCount, remain_nums, export_nums, xlsxUrl, "2", string(filterStr))
+//				DeductNum(entId, newCount)
+//				go func() {
+//					for _, v := range *data {
+//						mongodb.Save("entdataexport", v)
+//					}
+//				}()
+//				redis.Put("other", "entexportdata_"+fmt.Sprintln(entId), xlsxUrl, 60)
+//				entLock.Unlock()
+//			}
+//		}()
+//		d.ServeJson(result)
+//	}
+//	return nil
+//}
+
 //剑鱼pc判断登录用户是否有我的企业、商机管理菜单
 func (this *DataExport) GetPcEntAuth() {
 	userId, _ := this.GetSession("userId").(string)
@@ -736,7 +859,7 @@ func (this *DataExport) GetPcEntAuth() {
 					if hideUsers[util.IntAll(val["id"])] {
 						entnicheMenu = false
 					} else {
-						if  util.IntAll(val["isNew"])==1{
+						if util.IntAll(val["isNew"]) == 1 {
 							isNew = true
 						}
 						entnicheMenu = true
@@ -760,7 +883,7 @@ func (this *DataExport) GetPcEntAuth() {
 									if hideUsers[util.IntAll(vv["id"])] {
 										entnicheMenu = false
 									} else {
-										if  util.IntAll(vv["isNew"])==1{
+										if util.IntAll(vv["isNew"]) == 1 {
 											isNew = true
 										}
 										entnicheMenu = true
@@ -780,7 +903,7 @@ func (this *DataExport) GetPcEntAuth() {
 	}
 
 	data := map[string]interface{}{
-		"myEntMenu":    myEntMenu,
+		"myEntMenu":    true,
 		"entnicheMenu": entnicheMenu,
 		"isNew":        isNew,
 		"privatedata":  privatedata,
@@ -788,6 +911,176 @@ func (this *DataExport) GetPcEntAuth() {
 	this.ServeJson(data)
 }
 
+//
+////判断是否导出成功
+//func (this *DataExport) IsEntExportSuccess() {
+//	entId := util.IntAll(this.GetSession("entId"))
+//	res := map[string]interface{}{
+//		"state": false,
+//	}
+//	if entId != 0 {
+//		key := "entexportdata_" + fmt.Sprintln(entId)
+//		log.Println(key)
+//		xlsxUrl := redis.Get("other", key)
+//		log.Println(xlsxUrl)
+//		if xlsxUrl != nil {
+//			res["state"] = true
+//			res["xlsxUrl"] = xlsxUrl
+//			redis.Del("other", key)
+//		}
+//	}
+//	this.ServeJson(res)
+//}
+//
+////生成xlsx
+//func GetXlsx(mMap []map[string]interface{}, entId, entUserId int) string {
+//	xf, err := xlsx.OpenFile("./web/staticres/fields.xlsx")
+//	if err != nil {
+//		log.Println("fields file not foud", err.Error())
+//	}
+//	sh := xf.Sheets[1]
+//	for _, v := range mMap {
+//		row := sh.AddRow()
+//		row.AddCell().SetValue(v["area"])
+//		row.AddCell().SetValue(v["city"])
+//		row.AddCell().SetValue(v["title"])
+//		row.AddCell().SetValue(v["subtype"])
+//		row.AddCell().SetValue(v["detail"])
+//		if v["publishtime"] != nil {
+//			row.AddCell().SetValue(v["publishtime"])
+//		} else {
+//			row.AddCell()
+//		}
+//		row.AddCell().SetValue(v["href"])
+//		row.AddCell().SetValue(v["url"])
+//		row.AddCell().SetValue(v["projectname"])
+//		row.AddCell().SetValue(v["projectcode"])
+//		row.AddCell().SetValue(v["projectscope"])
+//		if v["budget"] != nil {
+//			row.AddCell().SetFloat(util.Float64All(v["budget"]))
+//		} else {
+//			row.AddCell()
+//		}
+//		if v["bidamount"] != nil {
+//			row.AddCell().SetFloat(util.Float64All(v["bidamount"]))
+//		} else {
+//			row.AddCell()
+//		}
+//		if v["bidopentime"] != nil {
+//			row.AddCell().SetValue(v["bidopentime"])
+//		} else {
+//			row.AddCell()
+//		}
+//		row.AddCell().SetValue(v["buyer"])
+//		row.AddCell().SetValue(v["buyerperson"])
+//		row.AddCell().SetValue(v["buyertel"])
+//		row.AddCell().SetValue(v["agency"])
+//		row.AddCell().SetValue(v["s_winner"])
+//		row.AddCell().SetValue(v["winnerperson"])
+//		row.AddCell().SetValue(v["winnertel"])
+//		row.AddCell().SetValue(v["legal_person"])
+//		row.AddCell().SetValue(v["company_phone"])
+//		row.AddCell().SetValue(v["company_email"])
+//	}
+//	xf.Sheets = xf.Sheets[1:2]
+//	xf.Sheets[0].Name = "数据导出"
+//	//生文件
+//	t := strconv.FormatInt(time.Now().Unix(), 10)
+//	entIds := strconv.Itoa(entId)
+//	entUserIds := strconv.Itoa(entUserId)
+//	dir := "./web/staticres/xlsx/entsearchexport/" + entIds + "_" + entUserIds + "_" + t + "/"
+//	if b, _ := PathExists(dir); !b {
+//		err1 := os.MkdirAll(dir, os.ModePerm)
+//		if err1 != nil {
+//			log.Println("mkdir err", dir)
+//		}
+//	}
+//	fname := entIds + "_" + entUserIds + "_" + "entdataexport.xlsx"
+//	xlsxUrl := dir + fname
+//	xlsxUrls := "/xlsx/entsearchexport/" + entIds + "_" + entUserIds + "_" + t + "/" + fname
+//	err = xf.Save(xlsxUrl)
+//	if err != nil {
+//		log.Println("xls error", fname)
+//		xlsxUrls = ""
+//	}
+//	return xlsxUrls
+//}
+//
+//func PathExists(path string) (bool, error) {
+//	_, err := os.Stat(path)
+//	if err == nil {
+//		return true, nil
+//	}
+//	if os.IsNotExist(err) {
+//		return false, nil
+//	}
+//	return false, err
+//}
+//
+//func SaveExportLog(entId, entUserId, count, newCount, remain_nums, export_nums int, xlsxUrl, types, filterStr string) {
+//	query := map[string]interface{}{
+//		"id":     entUserId,
+//		"ent_id": entId,
+//	}
+//	set := map[string]interface{}{
+//		"remain_nums": remain_nums - newCount,
+//		"export_nums": export_nums + newCount,
+//	}
+//	ok := public.Mysql.Update("entniche_export_limit", map[string]interface{}{"ent_id": entId, "user_id": entUserId}, set)
+//	if !ok {
+//		log.Println("修改导出条数失败", query, remain_nums, newCount)
+//	}
+//	userData := public.Mysql.FindOne("entniche_user", query, "name,phone", "")
+//	if userData != nil {
+//		name := util.ObjToString((*userData)["name"])
+//		phone := util.ObjToString((*userData)["phone"])
+//		now := time.Now()
+//		public.Mysql.Insert("entniche_export_log", map[string]interface{}{
+//			"user_name":    name,
+//			"export_time":  util.FormatDate(&now, util.Date_Full_Layout),
+//			"data_source":  "2",
+//			"export_num":   count,
+//			"deduct_num":   newCount,
+//			"download_url": xlsxUrl,
+//			"ent_id":       entId,
+//			"phone":        phone,
+//			"user_id":      entUserId,
+//			"filter":       filterStr,
+//		})
+//	}
+//}
+//
+//func DeductNum(entId, newCount int) {
+//	query := map[string]interface{}{
+//		"id": entId,
+//	}
+//	userData := public.Mysql.FindOne("entniche_info", query, "name,phone", "")
+//	if userData != nil {
+//		name := util.ObjToString((*userData)["name"])
+//		phone := util.ObjToString((*userData)["phone"])
+//		public.Mgo_Qyfw.Update("user", map[string]interface{}{"phone": phone, "username": name}, map[string]interface{}{
+//			"$inc": map[string]interface{}{
+//				"plan.current": -newCount,
+//			},
+//		}, false, false)
+//	}
+//}
+//
+//func GetCurrentCount(entId int) int {
+//	count := 0
+//	userData := public.Mysql.FindOne("entniche_info", map[string]interface{}{"id": entId}, "name,phone", "")
+//	if userData == nil {
+//		return count
+//	}
+//	current, ok := public.Mgo_Qyfw.FindOne("user", map[string]interface{}{"phone": util.ObjToString((*userData)["phone"]), "username": util.ObjToString((*userData)["name"])})
+//	if current == nil || !ok {
+//		return count
+//	}
+//	plan, _ := (*current)["plan"].(map[string]interface{})
+//	count = util.IntAll(plan["current"])
+//	return count
+//}
+
 //获取当前登录用户的手机号
 func GetPhone(userId string) (string, string) {
 	u, ok := mongodb.FindById("user", userId, `{"s_phone":1,"s_m_phone":1}`)

+ 11 - 1
src/jfw/front/front.go

@@ -153,6 +153,7 @@ func init() {
 	sewx = util.SimpleEncrypt{Key: "topnet"}
 	xweb.AddAction(&Front{})
 	xweb.AddAction(&Short{})
+	xweb.AddAction(&OrgStructure{})
 	urlMap = config.Sysconfig["redirect"].(map[string]interface{})
 }
 
@@ -609,6 +610,12 @@ func (f *Front) HasSign() error {
 			"s_headimage": f.GetSession("s_avatar"),
 			"encryptId":   se.EncodeString(userId),
 		}
+		//是否需要重新登录,企业基础架构给虚拟账号重置密码后,需要重新登录
+		if resetpwd, _ := redis.Exists("other", "resetpwd_"+userId); resetpwd {
+			redis.Del("other", "resetpwd_"+userId)
+			redis.Del("session", f.Session().Id())
+			m["resetpwd"] = resetpwd
+		}
 		if openid, _ := f.GetSession("s_m_openid").(string); openid != "" {
 			m["openid"] = se.EncodeString(openid)
 		}
@@ -773,8 +780,8 @@ func CreateSession(q map[string]interface{}, sess *httpsession.Session, typ stri
 	if person == nil {
 		return false, nil, nil
 	}
+	userid := util.ObjToString(sessionVal["userId"])
 	if pcSessionFlag, ok := config.Sysconfig["pcSessionFlag"].(bool); pcSessionFlag && ok && flag {
-		userid := util.ObjToString(sessionVal["userId"])
 		//无限制登陆用户
 		if util.IntAll(sessionVal["i_unlimited"]) <= 0 {
 			redis.Put("other", jyutil.LoginRedisKey(userid), sess.Id(), 3600*util.IntAllDef(config.Sysconfig["pcSessionTimeout"], 168))
@@ -794,6 +801,8 @@ func CreateSession(q map[string]interface{}, sess *httpsession.Session, typ stri
 	}
 	//大会员动画 清除首页缓存
 	redis.Del("other", "jypcindex")
+	//清除企业基础架构给虚拟账号重置密码后需要重新登录的标识
+	redis.Del("other", "resetpwd_"+userid)
 	return true, person, infoData
 }
 
@@ -815,6 +824,7 @@ func (m *Front) Sess(ostr string) error {
 		} else {
 			ok, _, _ = FindUserAndCreateSess(openid, m.Session(), "wx", false)
 		}
+		log.Println("ok:", ok)
 		if ok {
 			actionurl := util.ObjToString(urlMap[str[3]])
 			if actionurl != "" {

+ 15 - 0
src/jfw/front/frontRouter.go

@@ -45,6 +45,10 @@ type CommonRouter struct {
 
 	//双十一活动留资
 	activityLeads xweb.Mapper `xweb:"/weixin/leads/(.*)"`
+
+	//组织机构:organizational structure
+	orgpcIndex xweb.Mapper `xweb:"/orgpc/"`
+	orgpcPage  xweb.Mapper `xweb:"/orgpc/(.*)"`
 }
 
 func init() {
@@ -243,3 +247,14 @@ func (this *CommonRouter) ActivityLeads(sign string) error {
 	}
 	return this.Redirect(fmt.Sprintf("/weixin/frontPage/bigmember/free/perfect_info?source=%v", sign))
 }
+
+//组织架构
+func (this *CommonRouter) OrgpcIndex() error {
+	return this.doEntpcPage()
+}
+func (this *CommonRouter) OrgpcPage(htmlPage string) error {
+	return this.doOrgpcPage()
+}
+func (this *CommonRouter) doOrgpcPage() error {
+	return this.Render(fmt.Sprintf("/frontRouter/pc/page_entbase_pc/sess/index.html"))
+}

+ 12 - 0
src/jfw/front/login.go

@@ -317,3 +317,15 @@ func GetModule(source string) string {
 	sourceModuleMap, _ := config.Seoconfig["cookieSource"].(map[string]interface{})
 	return qutil.ObjToString(sourceModuleMap[source])
 }
+
+//当前用户是否存在
+func isExistsByPO(phone, openId string) bool {
+	return mongodb.Count("user", map[string]interface{}{
+		"i_appid": 2,
+		"$or": []map[string]interface{}{
+			{"s_phone": phone},
+			{"s_m_phone": phone},
+			{"s_m_openid": openId},
+		},
+	}) > 0
+}

+ 191 - 0
src/jfw/front/org_structure.go

@@ -0,0 +1,191 @@
+/**
+组织结构
+大会员&商机管理 企业组织架构优化
+2022-2-11
+王山
+**/
+
+package front
+
+import (
+	"fmt"
+	"jfw/config"
+	"jfw/jyutil"
+	"jfw/public"
+	"log"
+	"net/url"
+	"time"
+
+	"qfw/util"
+
+	"github.com/SKatiyar/qr"
+	"github.com/go-xweb/xweb"
+)
+
+type OrgStructure struct {
+	*xweb.Action
+	invitationQR   xweb.Mapper `xweb:"/orgstructure/invaction/(.*)"` //邀请加入组织的二维码 参数是部门id
+	invitationPage xweb.Mapper `xweb:"/orgstructure/invpage"`        //邀请路由
+	authorize      xweb.Mapper `xweb:"/orgstructure/authorize"`      //微信用户授权 获取用户信息
+	autoLogon      xweb.Mapper `xweb:"/orgstructure/autoLogon"`      //非剑鱼用户接收邀请注册为剑鱼用户
+}
+
+//
+func (this *OrgStructure) InvitationQR(depId string) {
+	wxWebdomain := util.ObjToString(config.Sysconfig["wxWebdomain"])
+	entId := this.GetString("entId")         //加密后-企业id
+	entUserId := this.GetString("entUserId") //加密后-企业用户id
+	depcname := this.GetString("depcname")
+	if wxWebdomain != "" {
+		qrUrl := wxWebdomain + "/orgstructure/invpage?entUserId=" + entUserId + "&depId=" + depId + "&entId=" + entId + "&depcname=" + depcname
+		log.Println("qrUrl:", qrUrl)
+		//生二维码
+		_r, err := qr.Encode(qrUrl, qr.L)
+		if err != nil {
+			log.Println(err.Error())
+		} else {
+			w := this.ResponseWriter
+			w.Header().Set("Cache-Control", "no-cache,no-store,must-revalidate")
+			w.Header().Set("Prama", "no-cache")
+			w.Header().Set("Expires", "0")
+			w.Header().Set("Content-Type", "image/png")
+			w.Write((*_r).PNG())
+		}
+	}
+}
+
+//
+func (this *OrgStructure) InvitationPage() error {
+	client := this.Header("User-Agent")
+	entUserId := this.GetString("entUserId") //加密后-企业邀请人id
+	depId := this.GetString("depId")         //加密后-部门id
+	entId := this.GetString("entId")         //加密后-企业id
+	depcname := this.GetString("depcname")
+	registered := "0"                                     //是否是剑鱼用户:0:未关注; 1:已关注
+	entUserId_str := util.SE.Decode4HexByCheck(entUserId) //解密
+	entUserId_sess := this.GetSession("entUserId")
+	OrgUrl := util.ObjToString(config.Sysconfig["wxOrgUrl"]) + "?entUserId=" + entUserId + "&depId=" + depId + "&entId=" + entId + "&depcname=" + depcname
+	if !mobileReg.MatchString(client) {
+		OrgUrl = util.ObjToString(config.Sysconfig["pcOrgUrl"]) + "?entUserId=" + entUserId + "&depId=" + depId + "&entId=" + entId + "&depcname=" + depcname
+	} else if entUserId_sess == nil || util.ObjToString(entUserId_sess) != entUserId_str {
+		userId := util.ObjToString(this.Session().Get("userId"))
+		openId := util.ObjToString(this.Session().Get("s_m_openid"))
+		phone := util.ObjToString(this.Session().Get("phone"))
+		isSubscribe := false //是否关注
+		if userId == "" {
+			if this.GetString("state") == "wx" {
+				//微信跳回来的
+				code := this.GetString("code")
+				if code != "" {
+					openId = jyutil.Getopenid(code)
+				}
+			} else if public.CheckWxBrowser(this.Request) {
+				//所有参数都不再使用,跳到微信验证用户
+				return this.Redirect(fmt.Sprintf(config.Wxoauth, url.QueryEscape(this.Site()+this.Url()), "wx"), 302)
+			}
+		}
+		if openId != "" {
+			isSubscribe = CheckUserIsSubscribe(openId)
+			if isSubscribe {
+				registered = "1"
+				FindUserAndCreateSess(openId, this.Session(), "wx", false)
+				phone = util.If(this.GetSession("phone") != nil, this.GetSession("phone"), "").(string)
+			}
+		}
+		if phone != "" {
+			phone = util.SE.EncodeString(phone)
+		}
+		OrgUrl = OrgUrl + "&openId=" + util.SE.EncodeString(openId) + "&phone=" + phone + "&registered=" + registered
+	}
+	return this.Redirect(OrgUrl)
+
+}
+
+//暂时不用
+func (this *OrgStructure) Authorize() error {
+	openId := util.ObjToString(this.Session().Get("s_m_openid"))
+	unionId := ""
+	isSubscribe := false //是否关注
+	if openId == "" && this.GetString("state") == "authorize" {
+		//微信授权
+		code := this.GetString("code")
+		if code != "" {
+			openId = jyutil.Getopenid(code)
+		}
+	}
+	if openId != "" {
+		isSubscribe = CheckUserIsSubscribe(openId)
+		if isSubscribe {
+			FindUserAndCreateSess(openId, this.Session(), "wx", false)
+		} else { //获取未关注用户uninoid
+			unionId = public.GetUnionid(openId)
+		}
+	}
+	this.ServeJson(map[string]interface{}{
+		"openId":      util.SE.EncodeString(openId),
+		"unionId":     util.SE.EncodeString(unionId),
+		"isSubscribe": isSubscribe,
+		"phone":       util.If(this.GetSession("phone") != nil, this.GetSession("phone"), ""),
+	})
+	return nil
+}
+
+//移动端(PC端已注册)
+func (this *OrgStructure) AutoLogon() error {
+	openId := this.GetString("openId")
+	phone := this.GetString("phone")
+	name := this.GetString("name")
+	mail := this.GetString("email")
+	rb := false
+	if openId != "" && phone != "" {
+		//解密
+		openId = util.SE.DecodeString(openId)
+		//当前用户未成为剑鱼用户
+		if !isExistsByPO(phone, openId) {
+			unionId := public.GetUnionid(openId)
+			if openId == unionId {
+				unionId = "uni_" + unionId
+			}
+			//新用户 保存新信息  微信未关注;手机号可使用
+			data := map[string]interface{}{
+				"i_ispush":         0,
+				"i_appid":          2,
+				"s_phone":          phone,
+				"s_m_phone":        phone,
+				"s_m_openid":       openId,
+				"s_unionid":        unionId,
+				"s_unique":         "wx_" + unionId,
+				"i_applystatus":    1,
+				"s_registersource": "org_structure_share", //组织机构优化 邀请加入剑鱼
+				"l_registedate":    time.Now().Unix(),
+				"i_ts_guide":       2,
+				"s_platform":       "wx",
+				"o_jy": map[string]interface{}{
+					"s_email":      mail,
+					"i_apppush":    1,
+					"i_wxpush":     1,
+					"i_ratemode":   2,
+					"l_modifydate": time.Now().Unix(),
+					"i_newfree":    1,
+				},
+				"s_regsource": "wx_org_structure_share",
+				"s_nickname":  name,
+				"s_myemail":   mail,
+			}
+			source := this.GetString("source")
+			if ck, err := this.GetCookie("source"); err == nil && ck.Value != "" {
+				//cookie中记录用户的来源
+				data["s_newsource"] = ck.Value
+				data["s_module"] = GetModule(ck.Value) //根据cookie中记录的来源获取模块
+			}
+			if source != "" {
+				data["s_tracksource"] = source
+			}
+			if mongodb.Save("user", data) != "" {
+				rb = true
+			}
+		}
+	}
+	this.ServeJson(map[string]interface{}{"flag": rb})
+	return nil
+}

+ 44 - 0
src/jfw/front/shorturl.go

@@ -212,6 +212,50 @@ func (s *Short) Article(stype, id string) error {
 			s.T["advertName"] = config.Sysconfig["advertName"]
 			s.T["advertUrl"] = config.Sysconfig["advertUrl"]
 			s.T["obj"] = obj
+			if obj["entidlist"] != nil { //大会员中标企业跳转至画像
+				if winner := util.ObjToString(obj["winner"]); winner != "" {
+					//临时更改为企业名称查询企业id
+					rData := elastic.Get("qyxy", "qyxy", fmt.Sprintf(`{"query":{"bool":{"should":[{"term":{"company_name":"%s"}},{"term":{"hname":"%s"}}],"minimum_should_match":1}},"_source":["name","_id","capital","company_phone"],"size":1}`, winner, winner))
+					if rData != nil && len(*rData) == 1 {
+						if entId := util.ObjToString((*rData)[0]["_id"]); entId != "" {
+							obj["entId"] = util.EncodeArticleId2ByCheck(util.ObjToString((*rData)[0]["_id"]))
+						}
+					}
+					//s_winner := util.ObjToString(obj["s_winner"])
+					//idObjs, _ := obj["entidlist"].([]interface{})
+					//winnerId := ""
+					//if names := strings.Split(s_winner, ","); len(names) > 1 {
+					//	index := 0
+					//	for i := 0; i < len(names); i++ {
+					//		if names[i] == winner {
+					//			index = i
+					//			break
+					//		}
+					//	}
+					//	if len(idObjs) > index {
+					//		winnerId = util.ObjToString(idObjs[index])
+					//	}
+					//} else { //中标企业仅一个
+					//	if len(idObjs) > 0 {
+					//		winnerId = util.ObjToString(idObjs[0])
+					//	}
+					//}
+					//if winnerId != "" {
+					//	obj["entId"] = util.EncodeArticleId2ByCheck(winnerId)
+					//}
+				}
+			}
+			if from_userid != "" && se.Decode4Hex(from_userid) != "" && se.Decode4Hex(from_userid) != userId && util.ObjToString(obj["subtype"]) != "拟建" { //分享开打的
+				article_id := util.CommonDecodeArticle(stype, id)[0]
+				key := fmt.Sprintf("integral_article_%s_%s_%s", article_id, from_userid, userId)
+				if redis.Incr("other", key) == 1 {
+					redis.SetExpire("other", key, 60*60*24)
+					err := jy.Publish(public.Mgo_Log, config.Sysconfig["nsq"].(string), jy.Jyweb_article_open, se.Decode4Hex(from_userid), jy.Jywx_node1)
+					if err != nil {
+						log.Println("nsq队列写入失败-->", jy.Jyweb_article_open, se.Decode4Hex(from_userid))
+					}
+				}
+			}
 			s.T["advertcode"] = s.GetString("advertcode")
 			content, _ := s.Render4Cache("/weixin/wxinfocontent_rec.html", &s.T)
 			return s.SetBody(content)

+ 1 - 1
src/jfw/jyutil/sessionkeep.go

@@ -41,7 +41,7 @@ func (sk *SessionKeep) Do() bool {
 		}
 	}()
 	rqu := sk.R.URL.Path
-	if strings.HasSuffix(rqu, "/notin/page") || strings.HasSuffix(rqu, "/swordfish/about") {
+	if strings.HasSuffix(rqu, "/notin/page") || strings.HasSuffix(rqu, "/swordfish/about") || strings.HasSuffix(rqu, "/orgstructure/invpage") {
 		return true
 	} else {
 		rhd := sk.R.Header

+ 7 - 1
src/jfw/modules/app/src/app/front/front.go

@@ -73,7 +73,8 @@ type Front struct {
 
 	qRCodePage xweb.Mapper `xweb:"/jyapp/free/qRCodePage"` //二维码页面
 
-	appConfig xweb.Mapper `xweb:"/jyapp/free/config"` //app配置项
+	appConfig   xweb.Mapper `xweb:"/jyapp/free/config"`      //app配置项
+	shareDomain xweb.Mapper `xweb:"/jyapp/free/shareDomain"` //app分享 域名配置项
 }
 
 var sewx util.SimpleEncrypt //微信的加密方法
@@ -705,3 +706,8 @@ func (s *Front) QRCodePage() error {
 func (s *Front) AppConfig() {
 	s.ServeJson(config.Sysconfig["appConfig"])
 }
+
+//app微信分享域名
+func (s *Front) ShareDomain() {
+	s.ServeJson(config.Seoconfig["wxDomain"].(string))
+}

+ 2 - 1
src/jfw/modules/app/src/seo.json

@@ -99,5 +99,6 @@
 	},
 	"structedUploadA":"/structuredata/file/【剑鱼标讯】结构化招标数据.xlsx",
 	"buryingPointUrl":"https://md.jianyu360.com",
-	"distance":"0"
+	"distance":"0",
+	"wxDomain":"http://web1-jydev-zxl.jianyu360.cn"
 }

+ 1 - 1
src/jfw/modules/bigmember/src/service/use/use.go

@@ -38,7 +38,7 @@ type Use struct {
 
 func (u *Use) SubPageMoveTip() {
 	flag := false
-	if userId := u.GetSession("userId").(string); userId != "" {
+	if userId := qu.ObjToString(u.GetSession("userId")); userId != "" {
 		if u.GetString("doType") == "know" { //我知道了 更新
 			flag = db.Mgo.UpdateById("user", userId, map[string]interface{}{
 				"$set": map[string]interface{}{

+ 4 - 0
src/jfw/modules/common/src/qfw/util/jy/jy.go

@@ -434,7 +434,11 @@ func LoginOutPush(mongodb MongodbSim, userid, sessid, apppushRpc string) {
 	if err2 != nil {
 		log.Println("json Unmarshal err:", err)
 	}
+	if apppush.JgPushId == "" {
+		return
+	}
 	mongodb.UpdateById("user", userid, map[string]interface{}{
+		"$unset":    map[string]interface{}{"s_jpushid": "", "s_opushid": ""},
 		"$addToSet": map[string]interface{}{"a_jpushid": apppush.JgPushId},
 	})
 	//

+ 8 - 17
src/jfw/modules/common/src/qfw/util/jy/subscribepush.go

@@ -59,10 +59,10 @@ const (
 )
 
 var aboutDbMsg map[string]*AboutDbMsg = map[string]*AboutDbMsg{
-	SubFreeFlag: &AboutDbMsg{"pushsubscribe", "subpush"},
-	SubVipFlag:  &AboutDbMsg{"pushsubscribe", "subpush"},
-	MemberFlag:  &AboutDbMsg{"pushmember", "memberpush"},
-	EntnicheFlag:  &AboutDbMsg{"pushentniche", "pushentniche"},
+	SubFreeFlag:  &AboutDbMsg{"pushsubscribe", "subpush"},
+	SubVipFlag:   &AboutDbMsg{"pushsubscribe", "subpush"},
+	MemberFlag:   &AboutDbMsg{"pushmember", "memberpush"},
+	EntnicheFlag: &AboutDbMsg{"pushentniche", "pushentniche"},
 }
 
 type AboutDbMsg struct {
@@ -147,7 +147,6 @@ func (s *subscribePush) todayKey(userId string) string {
 	return fmt.Sprintf("%s_%s", aboutDbMsg[s.ModuleFlag].RedisKeyFlag, userId)
 }
 func (s *subscribePush) allKey(userId string) string {
-	log.Println(fmt.Sprintf("all_%s_%s", aboutDbMsg[s.ModuleFlag].RedisKeyFlag, userId))
 	return fmt.Sprintf("all_%s_%s", aboutDbMsg[s.ModuleFlag].RedisKeyFlag, userId)
 }
 
@@ -208,7 +207,7 @@ func (s *subscribePush) InfoFormat(p *PushCa, info *map[string]interface{}) *Sub
 }
 
 func (s *subscribePush) Datas(spqp *SubPushQueryParam) (hasNextPage bool, total int64, result []*SubPushList) {
-	 log.Println(spqp.UserId, s.ModuleFlag, "subscribePush query param:", "SelectTime", spqp.SelectTime, "Area", spqp.Area, "City", spqp.City, "Subtype", spqp.Subtype, "Subscopeclass", spqp.Subscopeclass, "Buyerclass", spqp.Buyerclass, "Key", spqp.Key, "PageNum", spqp.PageNum)
+	log.Println(spqp.UserId, s.ModuleFlag, "subscribePush query param:", "SelectTime", spqp.SelectTime, "Area", spqp.Area, "City", spqp.City, "Subtype", spqp.Subtype, "Subscopeclass", spqp.Subscopeclass, "Buyerclass", spqp.Buyerclass, "Key", spqp.Key, "PageNum", spqp.PageNum)
 	if spqp.UserId == "" {
 		return
 	}
@@ -227,7 +226,6 @@ func (s *subscribePush) Datas(spqp *SubPushQueryParam) (hasNextPage bool, total
 	starttime, endtime := int64(0), int64(0)
 	st, et := "", ""
 	now := time.Now()
-	log.Println(4444)
 	if spqp.SelectTime == "today" { //今天
 		starttime = time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local).Unix()
 	} else if spqp.SelectTime == "yesterday" { //昨天
@@ -250,14 +248,11 @@ func (s *subscribePush) Datas(spqp *SubPushQueryParam) (hasNextPage bool, total
 			endtime = time.Date(etTime.Year(), etTime.Month(), etTime.Day(), 23, 59, 59, 0, time.Local).Unix()
 		}
 	}
-	log.Println(2222)
 	nowFormat := NowFormat(Date_Short_Layout)
 	start := (spqp.PageNum - 1) * spqp.PageSize
 	end := start + spqp.PageSize
 	//时间是今天,没有别的过滤条件
 	if nowFormat == FormatDateByInt64(&starttime, Date_Short_Layout) && spqp.Area == "" && spqp.City == "" && spqp.Buyerclass == "" && spqp.Subscopeclass == "" && spqp.Subtype == "" && spqp.Key == "" {
-
-		log.Println("a1")
 		subPush, err := s.GetTodayCache(spqp.UserId)
 		if err != nil {
 			log.Println(spqp.UserId, "GetTodayCache Error", err)
@@ -280,15 +275,12 @@ func (s *subscribePush) Datas(spqp *SubPushQueryParam) (hasNextPage bool, total
 		}
 		total = int64(length)
 	} else if spqp.IsEmpty() && (spqp.PageNum-1)*spqp.PageSize <= 250 { //全部,没有过滤条件 之前缓存5页*50条=250
-		log.Println("a2")
-	allCache, err := s.GetAllCache(spqp.UserId)
+		allCache, err := s.GetAllCache(spqp.UserId)
 		if err != nil {
 			log.Println(spqp.UserId, "GetAllCache Error", err)
 		}
 		if err != nil || allCache == nil || allCache.Date != nowFormat || len(allCache.Datas) == 0 {
-			log.Println("a3")
 			spqp.PageNum = 1
-			log.Println(1111)
 			list, countSearch := s.getDatasFromMysql(spqp, starttime, endtime, AllSubPushCacheSize, true)
 			allCache = &SubPush{
 				Date:  nowFormat,
@@ -306,7 +298,6 @@ func (s *subscribePush) Datas(spqp *SubPushQueryParam) (hasNextPage bool, total
 		}
 		total = allCache.Count
 	} else {
-		log.Println("a4")
 		result, total = s.getDatasFromMysql(spqp, starttime, endtime, spqp.PageSize, true)
 	}
 	if result == nil {
@@ -424,9 +415,9 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
 
 	findSql := "select id,date,infoid,isvisit,matchkeys,type"
 	if s.ModuleFlag != MemberFlag {
-		if s.ModuleFlag==EntnicheFlag{
+		if s.ModuleFlag == EntnicheFlag {
 
-		}else{
+		} else {
 			findSql += ",isvip"
 		}
 

+ 11 - 0
src/jfw/modules/weixin/src/jrpc/jrpc.go

@@ -525,3 +525,14 @@ func permQrCodeFromWx(id string, w *weixin.Weixin) ([]byte, error) {
 	}
 	return r.PNG(), nil
 }
+
+//剑鱼标讯获取未关注用户得unionid
+func (w *WeiXinRpc) GetUnionid(openid string, unionid *string) (err error) {
+	bs, err := w.Wwx.GetUserInfo(openid)
+	if err != nil {
+		log.Println("err:", err.Error())
+		return nil
+	}
+	*unionid = bs.UnionId
+	return nil
+}

BIN
src/jfw/modules/weixin/src/微信模板消息.xlsx


+ 18 - 0
src/jfw/public/rpccall.go

@@ -119,3 +119,21 @@ func GetShareQRStr(url string) string {
 	}, func(e interface{}) {})
 	return ret
 }
+
+//获取未关注用户unionid
+func GetUnionid(openid string) string {
+	var unionid string
+	util.Try(func() {
+		client, err := rpc.DialHTTP("tcp", rpcserver)
+		defer client.Close()
+		if err != nil {
+			log.Println(err.Error())
+			return
+		}
+		err = client.Call("WeiXinRpc.GetUnionid", openid, &unionid)
+		if err != nil {
+			log.Println(err.Error())
+		}
+	}, func(e interface{}) {})
+	return unionid
+}

+ 3 - 1
src/phoneFilter.json

@@ -15,7 +15,9 @@
 		"^/qr$",
 		"^/front/landpage/captcha$",
 		"^/biddetail/(\\w+)/qr/(.*)",
-		"^/swordfish/about$"
+		"^/swordfish/about$",
+		"^/orgstructure/invpage",
+		"^/orgpc/(.*)"
 	],
 	"sessUrl":{
 		"/jyTreasureBox/treasureBox":"",

+ 2 - 1
src/seo.json

@@ -20,7 +20,8 @@
 		"coupon_v:0001",
 		"big_pc_v:0001",
 		"xskc_v:0001",
-        "digital_v:0001"
+        "digital_v:0001",
+        "entbase_v:00001"
     ],
     "area": {
         "QG": {

+ 28 - 10
src/web/staticres/js/login.js

@@ -340,15 +340,15 @@ function checkMenuForEnt () {
     $.ajax({
         type: 'get',
         url: '/entbase/ent/mySelectent?t=' + new Date().getTime(),
-        success: function () {
+        success: function (er) {
             $.ajax({
                 type: 'get',
                 url: '/front/entExportAuth/getAuth?t=' + new Date().getTime(),
                 success: function (r) {
 					$(".myorderDiv[data-ent-menu]").remove()
 					var tempHtml = ''
-                    if(r.myEntMenu){
-                        tempHtml += "<div data-ent-menu class=\"myorderDiv\" onclick=\"window.location.href='/entpc/myent'\">"
+                    if(er.data!=null && er.data.status==1){
+                        tempHtml += "<div data-ent-menu class=\"myorderDiv\" onclick=\"window.location.href='/orgpc/myent'\">"
                         +"<span>我的企业</span>"
                         +"</div>"
                     }
@@ -478,6 +478,11 @@ var logic = function(data,num){
 
 //登录后处理页面逻辑
 var processpage = function(shareid,num){
+  var backToUrl = getParam('backTo')
+  if (backToUrl) {
+    return location.replace(decodeURIComponent(backToUrl))
+  }
+
 	var toHref=$("#bidLogin").attr("data-rec")
 	switch (toHref) {
 		case "sjdc":
@@ -660,12 +665,8 @@ var signout = function(){
 		if(data=="ok"){
             $('#noticed').hide()
             clearLoginStorage(/-login-clear/)
-			try{
-				$.cookie("userid_secure","",{expires:-1,path:"/",domain:document.domain.replace(/[^.]+/,"")});
-			}catch(e){
-				document.cookie = "userid_secure=;expires=-1;path=/";
-			}
-			window.location.href="/";
+			afterSignoutClearCookit();
+			// window.location.href="/";
             var pt = new RegExp("^/article/content/.+$|^/front/dataExport/.+$|^/front/course/codePay$|^/front/course/orderPay$|^/entpc/.+$|^/bid/pc/page/.+$");
             if(pt.test(window.location.pathname)){
                 window.location.href="/";
@@ -680,6 +681,14 @@ var signout = function(){
 	})
 }
 
+var afterSignoutClearCookit = function(){
+	try{
+		$.cookie("userid_secure","",{expires:-1,path:"/",domain:document.domain.replace(/[^.]+/,"")});
+	}catch(e){
+		document.cookie = "userid_secure=;expires=-1;path=/";
+	}
+}
+
 //查看用户是否已经登录
 var haslogin = function(num,kyorpn,url){
 	mynum = num;//页面logid
@@ -687,6 +696,11 @@ var haslogin = function(num,kyorpn,url){
 	thurl = url;//列表也跳转快照页url
 	$.post("/front/hasSign",function(data, location){
 		if(data){
+			if(data.resetpwd){
+				afterSignoutClearCookit();
+			    window.location.href = "/?nol=2";
+				return;
+			}
 			loginflag = true;
 			encryptId = data.encryptId
 			if(data.s_nickname!=null&&data.s_nickname.length>11){
@@ -773,7 +787,7 @@ var haslogin = function(num,kyorpn,url){
 			loginBtnType();
 			//pc限制登陆
 			var nosess = getParam("nol");
-			if (nosess=="1"&& (!loginflag) ){
+			if (nosess!=null && (!loginflag)){
 			    openLoginDig();
 			}
 		}
@@ -964,6 +978,10 @@ $(function(){
                     e.setAttribute('data-loading', 'false')
                     if (r && r.error_code > -1) {
                         if(r.data.state==1){
+                            var backToUrl = getParam('backTo')
+                            if (backToUrl) {
+                              return location.replace(decodeURIComponent(backToUrl))
+                            }
                             if (isBindPage) {
                               if (history.length === 1) {
                                 goBackOrigin()

+ 1 - 1
src/web/staticres/public-pc/js/article-content.js

@@ -1150,7 +1150,7 @@ $(function(){
         $(".pdf-div").html(pdfshow);
         var pdfhtml = "";
         pdfhtml = '<div class="preb-encont"><div style="float:left;"><img src="'+goTemplateData.cdn+'/images/wx/pdf.png"/></div><div style="float:left;line-height: 22px;">'+arr["filename"]+'<br><a style="color:blue;" href="'+arr["url"]+'">下载</a></div><div style="clear:both;"></div></div>';
-        PDFObject.embed(arr["url"], "#preb-pdf"+j);
+        //PDFObject.embed(arr["url"], "#preb-pdf"+j);
       }
       //}
       $(".preb-enclosure").append(pdfhtml)

+ 118 - 0
src/web/templates/frontRouter/pc/entpc/sess/index.html

@@ -0,0 +1,118 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>商机管理_剑鱼标讯,全行业招标信息智能推送领导者</title>
+    <meta content="IE=edge,Chrome=1" http-equiv="X-UA-Compatible"/>
+    <meta content="招标订阅,招标项目,中标项目,招标信息,剑鱼标讯" name="Keywords"/>
+    <meta content="使用剑鱼标讯,可以精准匹配招标信息,只需要微信关注剑鱼标讯公众号,然后自行设定所关注的招标关键词和地区,满足订阅需求的招标信息就会在两个小时内自动推送。" name="Description"/>
+    <meta content="webkit" name="renderer">
+    <meta content="telephone=no" name="format-detection"/>
+    <meta content="商机管理" theme="light" name="enable-header">
+    {{include "/common/pnc.html"}}
+    <link href='{{Msg "seo" "cdn"}}/css/reset.css?v={{Msg "seo" "version"}}' rel="stylesheet" type="text/css"/>
+    <link href='{{Msg "seo" "cdn"}}/pccss/reset_pc.css' rel="stylesheet" type="text/css"/>
+    <link href='{{Msg "seo" "cdn"}}/css/pc.css?v={{Msg "seo" "version"}}' rel="stylesheet"/>
+    <link href='{{Msg "seo" "cdn"}}/pccss/public-nav-1200.css?v={{Msg "seo" "version"}}' rel="stylesheet" type="text/css"/>
+    <!-- S-注入  -->
+
+    <meta name="importmap-type" content="systemjs-importmap">
+    <script>
+      if (String.prototype.startsWith === 'undefined') {
+        String.prototype.startsWith = function (str) {
+          if(str==null||str==""||this.length==0||str.length>this.length)
+            return false;
+          if(this.substr(0,str.length)==str)
+            return true;
+          else
+            return false;
+        }
+      }
+      if (typeof Promise === 'undefined')
+        document.write('<script src="https://cdn-common.jianyu360.com/cdn/lib/bluebird/3.7.2/js/browser/bluebird.core.min.js"><\/script>');
+      if (typeof fetch === 'undefined')
+        document.write('<script src="//cdn-common.jianyu360.com/cdn/lib/whatwg-fetch/3.4.1/dist/fetch.umd.min.js"><\/script>');
+    </script>
+    <script type="systemjs-importmap" crossorigin="anonymous">
+      {
+        "imports": {
+          "entpc": "/page_entpc/js/app.js?v={{Msg "seo" "entniche_v"}}",
+          "single-spa": "https://cdn-common.jianyu360.com/cdn/lib/single-spa/4.3.7/lib/system/single-spa.min.js",
+          "vue": "https://cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js",
+          "vue-router": "https://cdn-common.jianyu360.com/cdn/lib/vue-router/3.0.7/dist/vue-router.min.js"
+        }
+      }
+    </script>
+    <link rel="preload" href="https://cdn-common.jianyu360.com/cdn/lib/single-spa/4.3.7/lib/system/single-spa.min.js" as="script" crossorigin="anonymous" />
+    <link rel="preload" href="https://cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js" as="script" crossorigin="anonymous" />
+    <script src="https://cdn-common.jianyu360.com/cdn/lib/import-map-overrides/2.2.0/dist/import-map-overrides.js"></script>
+    <script src="https://cdn-common.jianyu360.com/cdn/lib/systemjs/6.8.3/dist/system.min.js"></script>
+    <script src="https://cdn-common.jianyu360.com/cdn/lib/systemjs/6.8.3/dist/extras/amd.min.js"></script>
+    <script src="https://cdn-common.jianyu360.com/cdn/lib/systemjs/6.8.3/dist/extras/named-exports.js"></script>
+    <script src="https://cdn-common.jianyu360.com/cdn/lib/systemjs/6.8.3/dist/extras/named-register.min.js"></script>
+    <script src="https://cdn-common.jianyu360.com/cdn/lib/systemjs/6.8.3/dist/extras/use-default.min.js"></script>
+    <!-- E-注入  -->
+
+    <style>
+        #public-nav {
+            border-bottom: 1px solid #e0e0e0;
+            background: #fff;
+        }
+        .page--entpc--index .page-container {
+            min-height: calc(100vh - 364px);
+            padding-top: 64px;
+            box-sizing: border-box;
+        }
+        .page--entpc--index .w-box .w1200 {
+            width: 1200px;
+            margin: 0 auto;
+            min-width: 1200px;
+        }
+    </style>
+</head>
+<body class="page--entpc--index">
+{{include "/common/pchead.html"}}
+<!-- S-注入  -->
+<div class="w-box page-container">
+    <div>
+        <div id="single-spa-app"></div>
+    </div>
+</div>
+<!-- See https://github.com/joeldenning/import-map-overrides#user-interface  -->
+<import-map-overrides-full show-when-local-storage="overrides-ui"></import-map-overrides-full>
+<!-- E-注入  -->
+<script>
+  (function() {
+    Promise.all([System.import('single-spa'), System.import('vue'), System.import('vue-router')]).then(function (modules) {
+      var singleSpa = modules[0];
+      var Vue = modules[1];
+      var VueRouter = modules[2];
+
+      Vue.use(VueRouter)
+
+      singleSpa.registerApplication(
+        'entpc',
+        function() {
+          return System.import('entpc')
+        },
+        function (location) {
+          return true
+        }
+      )
+
+      singleSpa.start();
+    })
+  })()
+</script>
+<script src='{{Msg "seo" "cdn"}}/js/jquery.cookie.js?v={{Msg "seo" "version"}}' type="text/javascript"></script>
+<script src='{{Msg "seo" "cdn"}}/js/public-nav.js?v={{Msg "seo" "version"}}' type="text/javascript"></script>
+<script>
+    $(function () {
+      haslogin({{.T.logid}});
+    })
+</script>
+<!--S-百度统计-->
+{{include "/common/pcbottom.html"}}
+{{include "/common/baiducc.html"}}
+<!--E-百度统计-->
+</body>
+</html>

+ 118 - 0
src/web/templates/frontRouter/pc/page_entbase_pc/sess/index.html

@@ -0,0 +1,118 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>商机管理_剑鱼标讯,全行业招标信息智能推送领导者</title>
+    <meta content="IE=edge,Chrome=1" http-equiv="X-UA-Compatible"/>
+    <meta content="招标订阅,招标项目,中标项目,招标信息,剑鱼标讯" name="Keywords"/>
+    <meta content="使用剑鱼标讯,可以精准匹配招标信息,只需要微信关注剑鱼标讯公众号,然后自行设定所关注的招标关键词和地区,满足订阅需求的招标信息就会在两个小时内自动推送。" name="Description"/>
+    <meta content="webkit" name="renderer">
+    <meta content="telephone=no" name="format-detection"/>
+    <meta content="企业基础架构" theme="light" name="enable-header">
+    {{include "/common/pnc.html"}}
+    <link href='{{Msg "seo" "cdn"}}/css/reset.css?v={{Msg "seo" "version"}}' rel="stylesheet" type="text/css"/>
+    <link href='{{Msg "seo" "cdn"}}/pccss/reset_pc.css' rel="stylesheet" type="text/css"/>
+    <link href='{{Msg "seo" "cdn"}}/css/pc.css?v={{Msg "seo" "version"}}' rel="stylesheet"/>
+    <link href='{{Msg "seo" "cdn"}}/pccss/public-nav-1200.css?v={{Msg "seo" "version"}}' rel="stylesheet" type="text/css"/>
+    <!-- S-注入  -->
+
+    <meta name="importmap-type" content="systemjs-importmap">
+    <script>
+      if (String.prototype.startsWith === 'undefined') {
+        String.prototype.startsWith = function (str) {
+          if(str==null||str==""||this.length==0||str.length>this.length)
+            return false;
+          if(this.substr(0,str.length)==str)
+            return true;
+          else
+            return false;
+        }
+      }
+      if (typeof Promise === 'undefined')
+        document.write('<script src="https://cdn-common.jianyu360.com/cdn/lib/bluebird/3.7.2/js/browser/bluebird.core.min.js"><\/script>');
+      if (typeof fetch === 'undefined')
+        document.write('<script src="//cdn-common.jianyu360.com/cdn/lib/whatwg-fetch/3.4.1/dist/fetch.umd.min.js"><\/script>');
+    </script>
+    <script type="systemjs-importmap" crossorigin="anonymous">
+      {
+        "imports": {
+          "app": "/page_entbase_pc/js/app.js?v={{Msg "seo" "entbase_v"}}",
+          "single-spa": "https://cdn-common.jianyu360.com/cdn/lib/single-spa/4.3.7/lib/system/single-spa.min.js",
+          "vue": "https://cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js",
+          "vue-router": "https://cdn-common.jianyu360.com/cdn/lib/vue-router/3.0.7/dist/vue-router.min.js"
+        }
+      }
+    </script>
+    <link rel="preload" href="https://cdn-common.jianyu360.com/cdn/lib/single-spa/4.3.7/lib/system/single-spa.min.js" as="script" crossorigin="anonymous" />
+    <link rel="preload" href="https://cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js" as="script" crossorigin="anonymous" />
+    <script src="https://cdn-common.jianyu360.com/cdn/lib/import-map-overrides/2.2.0/dist/import-map-overrides.js"></script>
+    <script src="https://cdn-common.jianyu360.com/cdn/lib/systemjs/6.8.3/dist/system.min.js"></script>
+    <script src="https://cdn-common.jianyu360.com/cdn/lib/systemjs/6.8.3/dist/extras/amd.min.js"></script>
+    <script src="https://cdn-common.jianyu360.com/cdn/lib/systemjs/6.8.3/dist/extras/named-exports.js"></script>
+    <script src="https://cdn-common.jianyu360.com/cdn/lib/systemjs/6.8.3/dist/extras/named-register.min.js"></script>
+    <script src="https://cdn-common.jianyu360.com/cdn/lib/systemjs/6.8.3/dist/extras/use-default.min.js"></script>
+    <!-- E-注入  -->
+
+    <style>
+        #public-nav {
+            border-bottom: 1px solid #e0e0e0;
+            background: #fff;
+        }
+        .page--entpc--index .page-container {
+            min-height: calc(100vh - 364px);
+            padding-top: 64px;
+            box-sizing: border-box;
+        }
+        .page--entpc--index .w-box .w1200 {
+            width: 1200px;
+            margin: 0 auto;
+            min-width: 1200px;
+        }
+    </style>
+</head>
+<body class="page--entpc--index">
+{{include "/common/pchead.html"}}
+<!-- S-注入  -->
+<div class="w-box page-container">
+    <div>
+        <div id="single-spa-app"></div>
+    </div>
+</div>
+<!-- See https://github.com/joeldenning/import-map-overrides#user-interface  -->
+<import-map-overrides-full show-when-local-storage="overrides-ui"></import-map-overrides-full>
+<!-- E-注入  -->
+<script>
+  (function() {
+    Promise.all([System.import('single-spa'), System.import('vue'), System.import('vue-router')]).then(function (modules) {
+      var singleSpa = modules[0];
+      var Vue = modules[1];
+      var VueRouter = modules[2];
+
+      Vue.use(VueRouter)
+
+      singleSpa.registerApplication(
+        'app',
+        function() {
+          return System.import('app')
+        },
+        function (location) {
+          return true
+        }
+      )
+
+      singleSpa.start();
+    })
+  })()
+</script>
+<script src='{{Msg "seo" "cdn"}}/js/jquery.cookie.js?v={{Msg "seo" "version"}}' type="text/javascript"></script>
+<script src='{{Msg "seo" "cdn"}}/js/public-nav.js?v={{Msg "seo" "version"}}' type="text/javascript"></script>
+<script>
+    $(function () {
+      haslogin({{.T.logid}});
+    })
+</script>
+<!--S-百度统计-->
+{{include "/common/pcbottom.html"}}
+{{include "/common/baiducc.html"}}
+<!--E-百度统计-->
+</body>
+</html>

+ 6 - 4
src/web/templates/pc/index.html

@@ -359,10 +359,12 @@
               type:'POST',
               url:'/entnicheNew/buy/whetherbuy',
               success:function (res) {
-                if (res.data.isNew) {
-                  $('#buyUnits').css('display', 'inline-block')
-                } else {
-                  $('#buyUnits').css('display', 'none')
+                if (res.data){
+                  if (res.data.isNew) {
+                    $('#buyUnits').css('display', 'inline-block')
+                  } else {
+                    $('#buyUnits').css('display', 'none')
+                  }
                 }
               }
           })

+ 1 - 0
src/web/templates/weixin/orgStructure/invitationPage.html

@@ -0,0 +1 @@
+<!--#组织结构优化-邀请用户加入部门页面-->