Ver Fonte

Merge branch 'develop' of 192.168.3.17:zhanghongbo/qfw into develop

wangchuanjin há 9 anos atrás
pai
commit
6e96db7901

+ 17 - 1
common/src/qfw/util/credit/credit.go

@@ -30,6 +30,7 @@ const (
 	A_FXFWXQ = "a13" //分享服务
 	A_FXFWXQ = "a13" //分享服务
 	A_WCJY   = "a14" //完成交易
 	A_WCJY   = "a14" //完成交易
 	A_WCJYPJ = "a15" //完成交易评价
 	A_WCJYPJ = "a15" //完成交易评价
+	A_JYSCTS = "a63" //剑鱼首次推送
 
 
 	B_QD       = "b1" //签到
 	B_QD       = "b1" //签到
 	B_QD_T     = 7    //最高连续签到次数
 	B_QD_T     = 7    //最高连续签到次数
@@ -57,7 +58,7 @@ func init() {
 	util.ReadConfig(&SysConfig)
 	util.ReadConfig(&SysConfig)
 	CreditA = make(map[string]uint64)
 	CreditA = make(map[string]uint64)
 	//初始化一次性任务
 	//初始化一次性任务
-	for i := 1; i < 16; i++ {
+	for i := 1; i <= 64; i++ {
 		CreditA["a"+fmt.Sprint(i)] = uint64(i)
 		CreditA["a"+fmt.Sprint(i)] = uint64(i)
 	}
 	}
 	Rc = rpc.RpcCall{Addr: SysConfig["creditRpc"].(string)}
 	Rc = rpc.RpcCall{Addr: SysConfig["creditRpc"].(string)}
@@ -81,6 +82,18 @@ func InCreditA(userId, code string, credit_a int) (bool, int, int, error) {
 	return result, credit_a, 0, nil
 	return result, credit_a, 0, nil
 }
 }
 
 
+//剑鱼一次性任务
+func CheckSword(userId, code string, credit_a int, xb *xweb.Action) bool {
+	result := false
+	if !AIsHasDo(code, credit_a) {
+		result, credit_a = UpuserCreditA(code, userId, credit_a)
+		if result {
+			xb.Session().UpdateByCustomField("id", userId, "credit_a", credit_a)
+		}
+	}
+	return result
+}
+
 //日常任务积分
 //日常任务积分
 func InCreditB(userId, code string, param map[string]interface{}) (bool, int, error) {
 func InCreditB(userId, code string, param map[string]interface{}) (bool, int, error) {
 	b := false
 	b := false
@@ -129,6 +142,9 @@ func AAllIsHasDo(num int) bool {
 			b = true
 			b = true
 			continue
 			continue
 		}
 		}
+		if v > uint64(15) { //目前超出15状态是非任务状态
+			continue
+		}
 		if uint64(num)&ret > 0 {
 		if uint64(num)&ret > 0 {
 			b = true
 			b = true
 		} else {
 		} else {

+ 1 - 1
common/src/qfw/util/encrypt_test.go

@@ -12,7 +12,7 @@ import (
 func TestEncrypt(t *testing.T) {
 func TestEncrypt(t *testing.T) {
 	se := &SimpleEncrypt{Key: "topnet"}
 	se := &SimpleEncrypt{Key: "topnet"}
 
 
-	log.Println(se.EncodeString("oJULtwzXo6EFV1Ah-XeyRBimXGM8,ff,ff,swordfishaction"))
+	log.Println(se.EncodeString("obEpLuH03fTYZ2e0xhJL3k7H6q48,ff,ff,swordfishaction"))
 }
 }
 
 
 func Test_sim(t *testing.T) {
 func Test_sim(t *testing.T) {

+ 28 - 0
common/src/qfw/util/redis/redisutil.go

@@ -386,3 +386,31 @@ func DelByPattern(key string) {
 
 
 }
 }
 **/
 **/
+//自增计数器
+func Incr(code, key string) int64 {
+	defer func() {
+		if r := recover(); r != nil {
+			log.Println("[E]", r)
+			for skip := 1; ; skip++ {
+				_, file, line, ok := runtime.Caller(skip)
+				if !ok {
+					break
+				}
+				go log.Printf("%v,%v\n", file, line)
+			}
+		}
+	}()
+	conn := RedisPool[code].Get()
+	defer conn.Close()
+	ret, err := conn.Do("INCR", key)
+	if nil != err {
+		log.Println("redisutil-GetError", err)
+	} else {
+		if res, ok := ret.(int64); ok {
+			return res
+		} else {
+			return 0
+		}
+	}
+	return 0
+}

+ 5 - 0
common/src/qfw/util/redis/redisutil_test.go

@@ -56,3 +56,8 @@ func Test_other(t *testing.T) {
 	}
 	}
 	<-pools
 	<-pools
 }
 }
+
+func TestIncr(t *testing.T) {
+	InitRedis("sso=192.168.3.14:1379")
+	log.Println(Incr("sso", "user"))
+}

+ 1 - 0
core/src/config.json

@@ -29,6 +29,7 @@
     "chatServer": "127.0.0.1:83",
     "chatServer": "127.0.0.1:83",
     "chatRpc": "127.0.0.1:88",
     "chatRpc": "127.0.0.1:88",
 	"creditRpc":"127.0.0.1:8765",
 	"creditRpc":"127.0.0.1:8765",
+	"pushRpc":"127.0.0.1:8766",
 	"domainName":"http://www.qimingxing.info"
 	"domainName":"http://www.qimingxing.info"
 
 
 }
 }

+ 1 - 0
core/src/qfw/coreconfig/SysConfig.go

@@ -22,6 +22,7 @@ type config struct {
 	MailFailureTime int         `json:"mailFailureTime"`
 	MailFailureTime int         `json:"mailFailureTime"`
 	ChatServer      string      `json:"chatServer"`
 	ChatServer      string      `json:"chatServer"`
 	ChatRpc         string      `json:"chatRpc"`
 	ChatRpc         string      `json:"chatRpc"`
+	PushRpc         string      `json:"pushRpc"`
 	ElasticPoolSize int         `json:"elasticPoolSize"`
 	ElasticPoolSize int         `json:"elasticPoolSize"`
 	DomainName      string      `json:"domainName"`
 	DomainName      string      `json:"domainName"`
 }
 }

+ 22 - 0
core/src/qfw/coreutil/counterutil.go

@@ -0,0 +1,22 @@
+package coreutil
+
+import (
+	"qfw/util/redis"
+)
+
+//计数器
+const (
+	TYPE_INVITE = iota //邀请
+	TYPE_GIVE          //赠送积分
+)
+
+//基于Redis的计数器实现
+func GetShareId(businesstype int) uint32 {
+	var tmp int64
+	if businesstype == TYPE_INVITE {
+		tmp = redis.Incr("other", "invite_counter") + 3200000000
+	} else if businesstype == TYPE_GIVE {
+		tmp = redis.Incr("other", "give_counter") + 3200000000
+	}
+	return uint32(tmp)
+}

+ 13 - 0
core/src/qfw/coreutil/counterutil_test.go

@@ -0,0 +1,13 @@
+package coreutil
+
+import (
+	"log"
+	"qfw/util/redis"
+	"testing"
+)
+
+func TestCounter(t *testing.T) {
+	redis.InitRedis("other=192.168.3.14:1379")
+	log.Println("初始化缓存")
+	log.Println("id::", GetShareId(TYPE_INVITE))
+}

+ 1 - 1
core/src/qfw/mobile/mobile.go

@@ -16,7 +16,7 @@ type Mobile struct {
 	getMyCredit   xweb.Mapper `xweb:"/member/credit/getcredit"`
 	getMyCredit   xweb.Mapper `xweb:"/member/credit/getcredit"`
 	swordfishPay  xweb.Mapper `xweb:"/member/credit/swordfishpay"`
 	swordfishPay  xweb.Mapper `xweb:"/member/credit/swordfishpay"`
 	msgSet        xweb.Mapper `xweb:"/swordfish/msgpushsetting/msgset"`
 	msgSet        xweb.Mapper `xweb:"/swordfish/msgpushsetting/msgset"`
-	ajaxReq       xweb.Mapper `xweb:"/swordfish/ajaxReq"`
+	ajaxReq       xweb.Mapper `xweb:"/member/swordfish/ajaxReq"`
 	advise        xweb.Mapper `xweb:"/mobile/advise"`
 	advise        xweb.Mapper `xweb:"/mobile/advise"`
 	adviseSave    xweb.Mapper `xweb:"/mobile/advisesave"`
 	adviseSave    xweb.Mapper `xweb:"/mobile/advisesave"`
 	wxpushList    xweb.Mapper `xweb:"/wxpush/bid/(.*)/(.*)/(.*)"` //推送列表
 	wxpushList    xweb.Mapper `xweb:"/wxpush/bid/(.*)/(.*)/(.*)"` //推送列表

+ 26 - 0
core/src/qfw/mobile/wxmenu.go

@@ -5,12 +5,14 @@ import (
 	"fmt"
 	"fmt"
 	"log"
 	"log"
 	"math/rand"
 	"math/rand"
+	"net/rpc"
 	"qfw/coreconfig"
 	"qfw/coreconfig"
 	"qfw/coreutil"
 	"qfw/coreutil"
 	"qfw/util"
 	"qfw/util"
 	"qfw/util/credit"
 	"qfw/util/credit"
 	"qfw/util/mongodb"
 	"qfw/util/mongodb"
 	"qfw/util/redis"
 	"qfw/util/redis"
+	qrpc "qfw/util/rpc"
 	"runtime"
 	"runtime"
 	"time"
 	"time"
 )
 )
@@ -134,6 +136,7 @@ func (m *Mobile) SwordfishPay() error {
 					i_credit := util.IntAll(user["i_credit"])
 					i_credit := util.IntAll(user["i_credit"])
 					if i_credit > 0 {
 					if i_credit > 0 {
 						isPay := map[string]interface{}{}
 						isPay := map[string]interface{}{}
+						mapPush := map[string]string{}
 						for _, v := range types {
 						for _, v := range types {
 							util.Try(func() {
 							util.Try(func() {
 								obj_typei := user["o_msgset"].(map[string]interface{})[v]
 								obj_typei := user["o_msgset"].(map[string]interface{})[v]
@@ -157,6 +160,7 @@ func (m *Mobile) SwordfishPay() error {
 								}
 								}
 								if b_newopen { //进行扣费操作
 								if b_newopen { //进行扣费操作
 									isPay[v] = v
 									isPay[v] = v
+									mapPush[v] = util.If(v == "bid", "中标", "招标").(string)
 								}
 								}
 							}, func(e interface{}) {
 							}, func(e interface{}) {
 								log.Println(e)
 								log.Println(e)
@@ -168,6 +172,28 @@ func (m *Mobile) SwordfishPay() error {
 								//先扣分,然后更新,然后返回结果
 								//先扣分,然后更新,然后返回结果
 								res["credit"] = i_credit
 								res["credit"] = i_credit
 								res["oprstatus"] = true
 								res["oprstatus"] = true
+								//初次提交积分时
+								//加上剑鱼是否推送过的逻辑判断
+								credit_a := util.IntAll(m.GetSession("credit_a"))
+								if !credit.AIsHasDo(credit.A_JYSCTS, credit_a) {
+									util.Try(func() {
+										//对用户进行推送
+										var repl int
+										clent, errs := rpc.DialHTTP("tcp", coreconfig.SysConfig.PushRpc)
+										defer clent.Close()
+										rpcData := qrpc.PushData{
+											Mopenid:  m.GetSession("s_m_openid").(string),
+											PushType: mapPush,
+										}
+										go clent.Call("PushInfo.PushMsg", &rpcData, &repl)
+										if errs == nil {
+											//修改剑鱼占位值
+											credit.CheckSword(userId.(string), credit.A_JYSCTS, credit_a, m.Action)
+										}
+									}, func(e interface{}) {
+										log.Println("给用户摄推送出错", e)
+									})
+								}
 							}
 							}
 						} else {
 						} else {
 							res["credit"] = i_credit
 							res["credit"] = i_credit

+ 2 - 0
core/src/qfw/swordfish/swordfishmanage.go

@@ -30,6 +30,8 @@ func (s *SwordFish) Swordfish() error {
 func (s *SwordFish) RssSet() error {
 func (s *SwordFish) RssSet() error {
 	u := mongodb.FindById("user", s.GetSession("userId").(string), `{"o_msgset":1}`)
 	u := mongodb.FindById("user", s.GetSession("userId").(string), `{"o_msgset":1}`)
 	s.T["msgset"] = (*u)["o_msgset"]
 	s.T["msgset"] = (*u)["o_msgset"]
+	//判断是否使用过剑鱼
+
 	return s.Render("/swordfish/rssset.html", &s.T)
 	return s.Render("/swordfish/rssset.html", &s.T)
 }
 }
 func (s *SwordFish) RsssetAjaxReq() error {
 func (s *SwordFish) RsssetAjaxReq() error {

+ 1 - 2
core/src/timetask.json

@@ -1,2 +1 @@
-{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-01-18 14:14:51"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-01-18 14:14:51"}},"marketisstart":true,"marketrate":300}
-
+{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-01-18 16:22:55"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-01-18 16:22:55"}},"marketisstart":true,"marketrate":300}

+ 23 - 1
core/src/web/staticres/css/swordfish.css

@@ -47,6 +47,21 @@ a:focus, a:hover{
 	padding-left: 3px;
 	padding-left: 3px;
 	padding-top: 1px;
 	padding-top: 1px;
 }
 }
+.swordfish-page-title span{
+	margin-right: 5px;
+	width: 25px;
+	height: 25px;
+	font-size: 14px;
+	color: #CCCCCC;
+	text-align: center;
+	padding-left: 3px;
+	padding-top: 1px;
+	font-weight: normal;
+}
+.swordfish-page-title a{
+	color: #37C6DA;
+	font-weight: normal;
+}
 /*剑鱼设置页面*/
 /*剑鱼设置页面*/
 .swordfish-rssset .btn{
 .swordfish-rssset .btn{
 	background-color: #37C6DA;
 	background-color: #37C6DA;
@@ -95,6 +110,13 @@ a:focus, a:hover{
 	font-size: 14px;
 	font-size: 14px;
 	font-weight: normal;
 	font-weight: normal;
 	margin-left: 10px;
 	margin-left: 10px;
+	color: #666666;
+}
+.swordfish-panel-t a{
+	font-size: 14px;
+	font-weight: normal;
+	margin-left: 10px;
+	color: #37C6DC;
 }
 }
 .swordfish-panel-t img{
 .swordfish-panel-t img{
 	width: 15px;
 	width: 15px;
@@ -160,7 +182,7 @@ a:focus, a:hover{
 }
 }
 .swordfish-keywords lable{
 .swordfish-keywords lable{
 	display: inline-block;
 	display: inline-block;
-	width: 70px;
+	width: 75px;
 }
 }
 .swordfish-keywords img{
 .swordfish-keywords img{
 	width: 20px;
 	width: 20px;

+ 2 - 1
core/src/web/staticres/wxswordfish/main.js

@@ -379,6 +379,7 @@ function commonAjaxReq(object,module){
 	}
 	}
 	dataObj[module+"_keys"] = this.setKeyWord(module);
 	dataObj[module+"_keys"] = this.setKeyWord(module);
 	dataObj[module+"_scope"] = this.setScope(module);
 	dataObj[module+"_scope"] = this.setScope(module);
+
 	if(dataObj[module+"_keys"].length > 0 && dataObj[module+"_scope"] == ""){
 	if(dataObj[module+"_keys"].length > 0 && dataObj[module+"_scope"] == ""){
 		dataObj[module+"_scope"] = "A";
 		dataObj[module+"_scope"] = "A";
 	}
 	}
@@ -387,7 +388,7 @@ function commonAjaxReq(object,module){
 	/*****************************************/
 	/*****************************************/
 	$.ajax({
 	$.ajax({
 		type: "POST",
 		type: "POST",
-		url: "/swordfish/ajaxReq",
+		url: "/member/swordfish/ajaxReq",
 		data: dataObj,
 		data: dataObj,
 		dataType: "json",
 		dataType: "json",
 		traditional: true,
 		traditional: true,

+ 65 - 26
core/src/web/templates/swordfish/rssset.html

@@ -11,13 +11,18 @@
 	<div class="b-left">
 	<div class="b-left">
 		<div class="swordfish-page-title">
 		<div class="swordfish-page-title">
 			<i class="img-circle glyphicon jianyu"></i>订阅设置
 			<i class="img-circle glyphicon jianyu"></i>订阅设置
+			<span >继续使用表明你已经同意了<span><a>剑鱼用户服务协议</a>
+			<span style="float:right;width:190px">
+			<a id="ckys">查看演示&nbsp;&nbsp;</a>
+			<a id="sfbz">收费标准</a>
+			<a id="yjfk">去提意见</a>
+			</span>
 		</div>
 		</div>
-		<div class="swordfish-explain">
+		<div id="swordfish-tishi" class="swordfish-explain">
 			“剑鱼”是企明星的特色产品,它借助内置的互联网搜索引擎、大数据平台和自然语言分析系统,
 			“剑鱼”是企明星的特色产品,它借助内置的互联网搜索引擎、大数据平台和自然语言分析系统,
 			为企业从互联网上自动抓取、分析、筛选并推送富有价值的信息情报,
 			为企业从互联网上自动抓取、分析、筛选并推送富有价值的信息情报,
 			比如本企业或其他企业的失信行为信息、受到行政处罚的信息、招标公告、中标公告等等。
 			比如本企业或其他企业的失信行为信息、受到行政处罚的信息、招标公告、中标公告等等。
 			您在输入了想要订阅的信息主题以后,网上一旦发布这些主题的信息,剑鱼就会第一时间将信息推送给您。
 			您在输入了想要订阅的信息主题以后,网上一旦发布这些主题的信息,剑鱼就会第一时间将信息推送给您。
-			<br><span class="pull-right">信息类型太少?没有找到想要的?<a id="yjfk">去提意见</a></span>
 			<div class="clearfix"></div>
 			<div class="clearfix"></div>
 		</div>
 		</div>
 		<div class="swordfish-panel" id="tender">
 		<div class="swordfish-panel" id="tender">
@@ -25,11 +30,12 @@
 				<img class="swordfish-uncheck" src="/images/swordfish/checkbox.png">
 				<img class="swordfish-uncheck" src="/images/swordfish/checkbox.png">
 				<img class="swordfish-checked" src="/images/swordfish/checkbox-a.png">
 				<img class="swordfish-checked" src="/images/swordfish/checkbox-a.png">
 				招标公告
 				招标公告
+				<span id="tender-panel-info">本栏目推送服务期还剩3天。想要服务不间断,请确保积分充足。 <a href="/member/credit/myCredit">去做任务赚积分</a></span>
 			</div>
 			</div>
 			<div class="swordfish-panel-c">
 			<div class="swordfish-panel-c">
 				<div>
 				<div>
 					<div class="swordfish-panel-c-t">
 					<div class="swordfish-panel-c-t">
-						<span></span><div>订阅关键词<span>最多订阅5组关键词</span></div>
+						<span></span><div>订阅关键词<span>最多订阅10组关键词</span></div>
 					</div>
 					</div>
 					<div class="swordfish-panel-c-c swordfish-keywords" id="tender-keywords">
 					<div class="swordfish-panel-c-c swordfish-keywords" id="tender-keywords">
 						<button class="btn" id="tender-addkeyword"><span>+</span>添加关键词</button>
 						<button class="btn" id="tender-addkeyword"><span>+</span>添加关键词</button>
@@ -50,11 +56,12 @@
 				<img class="swordfish-uncheck" src="/images/swordfish/checkbox.png">
 				<img class="swordfish-uncheck" src="/images/swordfish/checkbox.png">
 				<img class="swordfish-checked" src="/images/swordfish/checkbox-a.png">
 				<img class="swordfish-checked" src="/images/swordfish/checkbox-a.png">
 				中标公告
 				中标公告
+				<span id="bid-panel-info">本栏目推送服务期还剩3天。想要服务不间断,请确保积分充足。 <a href="/member/credit/myCredit">去做任务赚积分</a></span>
 			</div>
 			</div>
 			<div class="swordfish-panel-c">
 			<div class="swordfish-panel-c">
 				<div>
 				<div>
 					<div class="swordfish-panel-c-t">
 					<div class="swordfish-panel-c-t">
-						<span></span><div>订阅关键词<span>最多订阅5组关键词</span></div>
+						<span></span><div>订阅关键词<span>最多订阅10组关键词</span></div>
 					</div>
 					</div>
 					<div class="swordfish-panel-c-c swordfish-keywords" id="bid-keywords">
 					<div class="swordfish-panel-c-c swordfish-keywords" id="bid-keywords">
 						<button class="btn swordfish-addkeyword" id="bid-addkeyword"><span>+</span>添加关键词</button>
 						<button class="btn swordfish-addkeyword" id="bid-addkeyword"><span>+</span>添加关键词</button>
@@ -230,10 +237,11 @@
 <!-- 底部 -->
 <!-- 底部 -->
 {{include "/common/bottom.html"}}
 {{include "/common/bottom.html"}}
 <script type="text/javascript">
 <script type="text/javascript">
+
 $(function(){
 $(function(){
-	var selectKeyword = function(type,keyword){
+	var selectKeyword = function(type,keyword,i_switchstatus){
 		if(keyword == "" || typeof(keyword) == "undefined"){
 		if(keyword == "" || typeof(keyword) == "undefined"){
-			autoChecked(type,false);
+			autoChecked(type,i_switchstatus==1?true:false,i_switchstatus);
 			return;
 			return;
 		}
 		}
 		for(var i=0;i<keyword.length;i++){
 		for(var i=0;i<keyword.length;i++){
@@ -265,14 +273,21 @@ $(function(){
 	if(msgset != ""){
 	if(msgset != ""){
 		if(typeof(msgset.tender) != "undefined"){
 		if(typeof(msgset.tender) != "undefined"){
 			selectScope("tender",msgset.tender.s_scope);
 			selectScope("tender",msgset.tender.s_scope);
-			selectKeyword("tender",msgset.tender.a_key);
+			var i_switchstatus=msgset.tender.i_switchstatus;
+			selectKeyword("tender",msgset.tender.a_key,i_switchstatus);
+			autoChecked("tender",i_switchstatus==1?true:false,i_switchstatus);
 		}
 		}
 		if(typeof(msgset.bid) != "undefined"){
 		if(typeof(msgset.bid) != "undefined"){
 			selectScope("bid",msgset.bid.s_scope);
 			selectScope("bid",msgset.bid.s_scope);
-			selectKeyword("bid",msgset.bid.a_key);
+			var i_switchstatus=msgset.bid.i_switchstatus
+			selectKeyword("bid",msgset.bid.a_key,i_switchstatus);
+			autoChecked("bid",i_switchstatus==1?true:false,i_switchstatus);
 		}
 		}
 	}
 	}
 	$(".b-nav>ul>li:eq(2)").addClass("b-nav-active");
 	$(".b-nav>ul>li:eq(2)").addClass("b-nav-active");
+	$("#ckys").click(function(){
+		window.location.href="/front/swordfish";
+	});
 	$("#yjfk").click(function(){
 	$("#yjfk").click(function(){
 		$("body").append('<form id="feedbackForm" action="/front/web_feedbacklist.html" method="post" class="hide"><input type="hidden" name="url" value="'+window.location.href+'"></form>');
 		$("body").append('<form id="feedbackForm" action="/front/web_feedbacklist.html" method="post" class="hide"><input type="hidden" name="url" value="'+window.location.href+'"></form>');
 		$("#feedbackForm").submit();
 		$("#feedbackForm").submit();
@@ -294,13 +309,16 @@ $(function(){
 	$(".swordfish-uncheck").click(function(){
 	$(".swordfish-uncheck").click(function(){
 		$(this).next().show();
 		$(this).next().show();
 		$(this).hide();
 		$(this).hide();
-		autoChecked($(this).parents(".swordfish-panel").attr("id"),true);
+		autoChecked($(this).parents(".swordfish-panel").attr("id"),true,1);
 	});
 	});
+	var arrinfo=["您选择了?个信息栏目,确认后系统将每月扣除?积分,您目前的积分余额是?积分,扣除后将剩余?积分。",
+				"ss"];
 	$(".swordfish-checked").click(function(){
 	$(".swordfish-checked").click(function(){
 		$(this).parents(".swordfish-panel").removeClass("swordfish-panel-a");
 		$(this).parents(".swordfish-panel").removeClass("swordfish-panel-a");
 		$(this).prev().show();
 		$(this).prev().show();
 		$(this).hide();
 		$(this).hide();
-		ajaxReq();
+		$(this).next().css('display','none');
+		//ajaxReq();
 	});
 	});
 });
 });
 function afterSelectScope(type,btn){
 function afterSelectScope(type,btn){
@@ -326,10 +344,10 @@ function afterSelectScope(type,btn){
 			}
 			}
 		});
 		});
 	}
 	}
-	autoChecked(type,true);
+	autoChecked(type,true,1);
 	ajaxReq();
 	ajaxReq();
 }
 }
-function autoChecked(type,flag){
+function autoChecked(type,flag,i_switchstatus){
 	var obj = $("#"+type);
 	var obj = $("#"+type);
 	if(obj.find(".swordfish-scope").children(".btn").length == 0){
 	if(obj.find(".swordfish-scope").children(".btn").length == 0){
 		obj.find(".swordfish-scope").html('<button class="btn swordfish-btn-a swordfish-country">全国</button>');
 		obj.find(".swordfish-scope").html('<button class="btn swordfish-btn-a swordfish-country">全国</button>');
@@ -338,9 +356,13 @@ function autoChecked(type,flag){
 	if(obj.hasClass("swordfish-panel-a")){
 	if(obj.hasClass("swordfish-panel-a")){
 		return;
 		return;
 	}
 	}
-	obj.addClass("swordfish-panel-a");
-	obj.find(".swordfish-uncheck").hide();
-	obj.find(".swordfish-checked").show();
+	if(i_switchstatus==1){
+		obj.addClass("swordfish-panel-a");
+		obj.find(".swordfish-uncheck").hide();
+		obj.find(".swordfish-checked").show();
+		obj.find(".swordfish-checked").next().css('display','');
+	}
+	
 	if(obj.find(".swordfish-keywords").children(".swordfish-keyword").length == 0){
 	if(obj.find(".swordfish-keywords").children(".swordfish-keyword").length == 0){
 		appendKeyWord(type,"",false);
 		appendKeyWord(type,"",false);
 	}
 	}
@@ -350,18 +372,25 @@ function autoChecked(type,flag){
 }
 }
 function appendKeyWord(type,value,isFocus){
 function appendKeyWord(type,value,isFocus){
 	this.getHtml = function(index,value){
 	this.getHtml = function(index,value){
-		return '<div class="swordfish-keyword">'
+		var html='<div class="swordfish-keyword">'
 					+'<lable>关键词<font>'+index+'</font>:</lable>'
 					+'<lable>关键词<font>'+index+'</font>:</lable>'
 					+'<input type="text" class="form-control" value="'+(value?value:"")+'" placeholder="示例:综合布线 电话线 网线" maxlength="100">'
 					+'<input type="text" class="form-control" value="'+(value?value:"")+'" placeholder="示例:综合布线 电话线 网线" maxlength="100">'
 					+'<img src="/images/swordfish/delete.png">'
 					+'<img src="/images/swordfish/delete.png">'
 				+'</div>';
 				+'</div>';
+		if (index==1){
+			html='<div class="swordfish-keyword">'
+					+'<lable>关键词<font>'+index+'</font>:</lable>'
+					+'<input type="text" class="form-control" value="'+(value?value:"")+'" placeholder="示例:综合布线 电话线 网线" maxlength="100">'
+				+'</div>';
+		}
+		return html;
 	}
 	}
 	var obj = $("#"+type+"-keywords");
 	var obj = $("#"+type+"-keywords");
 	var count = obj.children(".swordfish-keyword").length;
 	var count = obj.children(".swordfish-keyword").length;
-	if(count >= 5){
+	if(count >= 10){
 		return;
 		return;
 	}
 	}
-	if(count == 4){
+	if(count == 9){
 		$("#"+type+"-addkeyword").attr("disabled",true);
 		$("#"+type+"-addkeyword").attr("disabled",true);
 	}
 	}
 	var node = $(getHtml(count+1,value));
 	var node = $(getHtml(count+1,value));
@@ -372,24 +401,27 @@ function appendKeyWord(type,value,isFocus){
 		obj.find(".swordfish-keyword").each(function(i){
 		obj.find(".swordfish-keyword").each(function(i){
 			$(this).children("b").children("font").text(i+1);
 			$(this).children("b").children("font").text(i+1);
 		});
 		});
-		autoChecked(type,false);
+		//autoChecked(type,false,i_switchstatus);
 		ajaxReq();
 		ajaxReq();
 	});
 	});
 	node.children("[type='text']").blur(function(){
 	node.children("[type='text']").blur(function(){
-		autoChecked(type,false);
+		//autoChecked(type,false,i_switchstatus);
 		ajaxReq();
 		ajaxReq();
 	});
 	});
 	if(isFocus){
 	if(isFocus){
 		node.children("[type='text']").focus()
 		node.children("[type='text']").focus()
 	}
 	}
-	autoChecked(type,false);
+	//autoChecked(type,false,i_switchstatus);
 }
 }
 function ajaxReq(){
 function ajaxReq(){
 	var thisClass = this;
 	var thisClass = this;
 	var dataObj = {
 	var dataObj = {
+		reqType: "other",
+		snopshot:false,
 		tender_flag: $("#tender").hasClass("swordfish-panel-a"),
 		tender_flag: $("#tender").hasClass("swordfish-panel-a"),
 		bid_flag: $("#bid").hasClass("swordfish-panel-a")
 		bid_flag: $("#bid").hasClass("swordfish-panel-a")
 	};
 	};
+
 	//关键词
 	//关键词
 	this.setKeyWord = function(type){
 	this.setKeyWord = function(type){
 		var tender_keys = [];
 		var tender_keys = [];
@@ -417,19 +449,26 @@ function ajaxReq(){
 		return tender_scope.join(",");
 		return tender_scope.join(",");
 	}
 	}
 	/*******************招标公告****************/
 	/*******************招标公告****************/
+	dataObj["tender_keys"] = this.setKeyWord("tender");
+	dataObj["tender_scope"] = this.setScope("tender");
 	if(dataObj.tender_flag){
 	if(dataObj.tender_flag){
-		dataObj["tender_keys"] = this.setKeyWord("tender");
-		dataObj["tender_scope"] = this.setScope("tender");
+		dataObj["tender_switchstatus"] = 1;
+	}else{
+		dataObj["tender_switchstatus"] = 0;
 	}
 	}
 	/*******************中标公告****************/
 	/*******************中标公告****************/
+	dataObj["bid_keys"] = this.setKeyWord("bid");
+	dataObj["bid_scope"] = this.setScope("bid");
 	if(dataObj.bid_flag){
 	if(dataObj.bid_flag){
-		dataObj["bid_keys"] = this.setKeyWord("bid");
-		dataObj["bid_scope"] = this.setScope("bid");
+		dataObj["bid_switchstatus"] = 1;	
+	}else{
+		dataObj["bid_switchstatus"] = 0;
 	}
 	}
 	/*****************************************/
 	/*****************************************/
 	$.ajax({
 	$.ajax({
 		type: "POST",
 		type: "POST",
-		url: "/member/swordfish/rssset/ajaxReq",
+		//url: "/member/swordfish/rssset/ajaxReq",
+		url: "/member/swordfish/ajaxReq",
 		data: dataObj,
 		data: dataObj,
 		dataType: "json",
 		dataType: "json",
 		traditional: true,
 		traditional: true,

+ 1 - 0
credit/src/config.json

@@ -67,6 +67,7 @@
         "txt_a13": "分享服务",
         "txt_a13": "分享服务",
         "txt_a14": "完成交易",
         "txt_a14": "完成交易",
         "txt_a15": "完成交易评价",
         "txt_a15": "完成交易评价",
+		"txt_a63": "剑鱼首次推送",
         "txt_a64": "完成一次性所有任务",
         "txt_a64": "完成一次性所有任务",
         "txt_b1": "签到",
         "txt_b1": "签到",
         "txt_b2": "企业查询",
         "txt_b2": "企业查询",

+ 1 - 65
push/src/config.json

@@ -1,65 +1 @@
-{
-    "bid": {
-        "interval": 60,
-        "lastpushtime": "2015-10-10 10:10:10"
-    },
-    "bidStartTime": "2015-12-17 14:10:11",
-    "bidTitle": "亲!剑鱼为您速报最新鲜的中标信息啦",
-    "bidViewDomain": "192.168.3.132",
-    "bidrStartTime": "2015-12-30 17:27:31",
-    "durationMinutes": 1,
-    "fixPush": "oJULtwzXo6EFV1Ah-XeyRBimXGM8",
-    "mail_bid": "\u003cdiv\u003e%s\u003c/div\u003e,想了解更多信息,请访问http://www.qimingxing.info。",
-    "maxPushSize": 50,
-    "mgoAddr": "192.168.3.18:27080",
-    "mgoSize": 10,
-    "province": {
-        "上海": 9,
-        "云南": 25,
-        "内蒙古": 5,
-        "北京": 1,
-        "台湾": 32,
-        "吉林": 7,
-        "四川": 13,
-        "天津": 2,
-        "宁夏": 30,
-        "安徽": 12,
-        "山东": 15,
-        "山西": 4,
-        "广东": 19,
-        "广西": 20,
-        "新疆": 31,
-        "江苏": 10,
-        "江西": 14,
-        "河北": 3,
-        "河南": 16,
-        "浙江": 11,
-        "海南": 21,
-        "湖北": 17,
-        "湖南": 18,
-        "澳门": 34,
-        "甘肃": 28,
-        "福建": 13,
-        "西藏": 26,
-        "贵州": 24,
-        "辽宁": 6,
-        "重庆": 22,
-        "陕西": 27,
-        "青海": 29,
-        "香港": 33,
-        "黑龙江": 8
-    },
-    "pushInfoScopeDays": 1,
-    "rpcPort": 8766,
-    "smtpAddr": "smtp.exmail.qq.com",
-    "smtpFromUser": "企明星",
-    "smtpPort": 465,
-    "smtpPwd": "qy123456",
-    "smtpUser": "qyfw@topnet.net.cn",
-    "tenderStartTime": "2015-12-17 14:10:11",
-    "tenderTitle": "亲!剑鱼为您速报最新鲜的招标信息啦",
-    "tenderrStartTime": "2015-12-30 17:27:29",
-    "weixinRpcServer": "127.0.0.1:82",
-    "weixin_bid": "\u003cdiv\u003e%s最新招标信息\u003c/div\u003e\u003cdiv\u003e%s\u003c/div\u003e",
-    "wxRpcRemark": "请到网站个人中心查看详细."
-}
+{"bid":{"interval":60,"lastpushtime":"2015-10-10 10:10:10"},"bidStartTime":"2015-12-30 17:28:48","bidTitle":"亲!剑鱼为您速报最新鲜的中标信息啦","bidViewDomain":"192.168.3.132","durationMinutes":10,"fixPush":"oJULtwzXo6EFV1Ah-XeyRBimXGM8","mail_bid":"\u003cdiv\u003e%s\u003c/div\u003e,想了解更多信息,请访问http://www.qimingxing.info。","maxPushSize":50,"mgoAddr":"192.168.3.18:27080","mgoSize":10,"province":{"上海":9,"云南":25,"内蒙古":5,"北京":1,"台湾":32,"吉林":7,"四川":13,"天津":2,"宁夏":30,"安徽":12,"山东":15,"山西":4,"广东":19,"广西":20,"新疆":31,"江苏":10,"江西":14,"河北":3,"河南":16,"浙江":11,"海南":21,"湖北":17,"湖南":18,"澳门":34,"甘肃":28,"福建":13,"西藏":26,"贵州":24,"辽宁":6,"重庆":22,"陕西":27,"青海":29,"香港":33,"黑龙江":8},"pushInfoScopeDays":30,"rpcPort":"8766","smtpAddr":"smtp.exmail.qq.com","smtpFromUser":"企明星","smtpPort":465,"smtpPwd":"qy123456","smtpUser":"qyfw@topnet.net.cn","tenderStartTime":"2015-12-30 17:28:48","tenderTitle":"亲!剑鱼为您速报最新鲜的招标信息啦","weixinRpcServer":"127.0.0.1:82","weixin_bid":"\u003cdiv\u003e%s最新招标信息\u003c/div\u003e\u003cdiv\u003e%s\u003c/div\u003e","wxRpcRemark":"请到网站个人中心查看详细."}

+ 25 - 0
push/src/qfw/push/bid/bid_test.go

@@ -4,9 +4,11 @@ import (
 	"fmt"
 	"fmt"
 	"log"
 	"log"
 	"math/rand"
 	"math/rand"
+	"net/rpc"
 	"qfw/push"
 	"qfw/push"
 	"qfw/util"
 	"qfw/util"
 	"qfw/util/mongodb"
 	"qfw/util/mongodb"
+	qrpc "qfw/util/rpc"
 	"strings"
 	"strings"
 	"testing"
 	"testing"
 	"time"
 	"time"
@@ -57,3 +59,26 @@ func Test_1(t *testing.T) {
 	a2 := push.GetChoiceCode(strings.Split("北京,河南,广东,山西,新疆", ",")...)
 	a2 := push.GetChoiceCode(strings.Split("北京,河南,广东,山西,新疆", ",")...)
 	log.Println(a1, a2, a1&a2)
 	log.Println(a1, a2, a1&a2)
 }
 }
+
+func Test_rpc(t *testing.T) {
+	log.Println("----------")
+	for i := 0; i < 30; i++ {
+		dd := qrpc.PushData{
+			Mopenid: "oJULtwzXo6EFV1Ah-XeyRBimXGM8",
+			PushType: map[string]string{
+				"tender": "招标",
+				"bid":    "中标",
+			},
+		}
+		var repl int
+		clent, _ := rpc.DialHTTP("tcp", "127.0.0.1:8766")
+		clent.Call("PushInfo.PushMsg", &dd, &repl)
+
+		log.Println(repl)
+		clent.Close()
+		time.Sleep(10 * time.Millisecond)
+	}
+
+	c := make(chan bool, 1)
+	<-c
+}

+ 9 - 9
push/src/qfw/push/dopush/dopush.go

@@ -40,7 +40,7 @@ func (p *Pjob) DoPush(mopenid, stime string, opr int, ltime int64) bool {
 	*p.Cache = push.InitCache(p.Stype, mopenid)
 	*p.Cache = push.InitCache(p.Stype, mopenid)
 	p.CreateUserInterestWord()
 	p.CreateUserInterestWord()
 	EachAllBidInfo(p.Stype, "["+p.StypeName+"信息]", p.StypeName, ltime, p.MaxPushSize, p.Dfa, p.Cache, opr)
 	EachAllBidInfo(p.Stype, "["+p.StypeName+"信息]", p.StypeName, ltime, p.MaxPushSize, p.Dfa, p.Cache, opr)
-	return false
+	return true
 }
 }
 
 
 //遍历数据并执行推送操作
 //遍历数据并执行推送操作
@@ -99,18 +99,18 @@ L1:
 	}
 	}
 	now := time.Now()
 	now := time.Now()
 	if pushType == 1 && returnLastTime != nil {
 	if pushType == 1 && returnLastTime != nil {
-		push.PushConfig[stype+"rStartTime"] = util.FormatDateWithObj(&returnLastTime, util.Date_Full_Layout)
+		push.PushConfig[stype+"StartTime"] = util.FormatDateWithObj(&returnLastTime, util.Date_Full_Layout)
 	}
 	}
 	for k, v := range *(userMap) {
 	for k, v := range *(userMap) {
 		kk := *k
 		kk := *k
 		vv := *v
 		vv := *v
 		time.Sleep(50 * time.Millisecond)
 		time.Sleep(50 * time.Millisecond)
-		go Send(&kk, &vv, now, TITLEA, ShortTitle, MaxPushSize)
+		go Send(&kk, &vv, now, TITLEA, ShortTitle, stype, MaxPushSize)
 	}
 	}
 }
 }
 
 
 //全局推送功能
 //全局推送功能
-func Send(k *push.MemberInterest, v *list.List, now time.Time, TITLEA, ShortTitle string, MaxPushSize int) {
+func Send(k *push.MemberInterest, v *list.List, now time.Time, TITLEA, ShortTitle, stype string, MaxPushSize int) {
 	defer func() {
 	defer func() {
 		if r := recover(); r != nil {
 		if r := recover(); r != nil {
 			log.Println("[E]", r)
 			log.Println("[E]", r)
@@ -170,13 +170,13 @@ func Send(k *push.MemberInterest, v *list.List, now time.Time, TITLEA, ShortTitl
 
 
 	//3、发送微信
 	//3、发送微信
 	if len(k.Openid) > 0 {
 	if len(k.Openid) > 0 {
-		SendWeixin(k, TITLE, ShortTitle, str, "", now, WXTitle, publishTimes)
+		SendWeixin(k, TITLE, ShortTitle, str, stype, now, WXTitle, publishTimes)
 	}
 	}
 
 
 }
 }
 
 
 //推送微信
 //推送微信
-func SendWeixin(k *push.MemberInterest, TITLE, ShortTitle, str, wxstr string, now time.Time, WXTitle string, publishTimes map[string]interface{}) {
+func SendWeixin(k *push.MemberInterest, TITLE, ShortTitle, str, stype string, now time.Time, WXTitle string, publishTimes map[string]interface{}) {
 	defer func() {
 	defer func() {
 		if r := recover(); r != nil {
 		if r := recover(); r != nil {
 			fmt.Println("发送微信[E]", r)
 			fmt.Println("发送微信[E]", r)
@@ -192,7 +192,7 @@ func SendWeixin(k *push.MemberInterest, TITLE, ShortTitle, str, wxstr string, no
 		"s_province":    k.Province,
 		"s_province":    k.Province,
 		"a_interest":    k.Interest,
 		"a_interest":    k.Interest,
 		"s_content":     str,
 		"s_content":     str,
-		"s_type":        "tender",
+		"s_type":        stype,
 		"a_publishtime": publishTimes,
 		"a_publishtime": publishTimes,
 		"i_size":        len(publishTimes),
 		"i_size":        len(publishTimes),
 	}
 	}
@@ -208,10 +208,10 @@ func SendWeixin(k *push.MemberInterest, TITLE, ShortTitle, str, wxstr string, no
 		wxDate = time.Now().Local().Add(time.Duration(-n2) * time.Second).Add(time.Duration(-n1*24) * time.Hour).Format(util.Date_Full_Layout)
 		wxDate = time.Now().Local().Add(time.Duration(-n2) * time.Second).Add(time.Duration(-n1*24) * time.Hour).Format(util.Date_Full_Layout)
 	}
 	}
 
 
-	wxstr = "\n点击下方“详情”查看详细信息。\n以上" + ShortTitle + "信息,是剑鱼根据关键字“" + strings.Join(k.Interest, ";") + "”奋力查找并推送,如不合您心意,请猛戳企明星菜单“会员服务—剑鱼”进行修改。"
+	wxstr := "\n点击下方“详情”查看详细信息。\n以上" + ShortTitle + "信息,是剑鱼根据关键字“" + strings.Join(k.Interest, ";") + "”奋力查找并推送,如不合您心意,请猛戳企明星菜单“会员服务—剑鱼”进行修改。"
 	push.SendWinXin(&qrpc.NotifyMsg{
 	push.SendWinXin(&qrpc.NotifyMsg{
 		Openid:  k.Openid,
 		Openid:  k.Openid,
-		Title:   push.PushConfig["tenderTitle"].(string),
+		Title:   push.PushConfig[stype+"Title"].(string),
 		Remark:  wxstr,
 		Remark:  wxstr,
 		Detail:  WXTitle,
 		Detail:  WXTitle,
 		Date:    wxDate,
 		Date:    wxDate,

+ 8 - 1
push/src/qfw/push/rpcpush/rpcpush.go

@@ -2,6 +2,7 @@ package rpcpush
 
 
 import (
 import (
 	"fmt"
 	"fmt"
+	"log"
 	"qfw/push/bid"
 	"qfw/push/bid"
 	"qfw/push/dopush"
 	"qfw/push/dopush"
 	qrpc "qfw/util/rpc"
 	qrpc "qfw/util/rpc"
@@ -14,6 +15,7 @@ type PushInfo struct {
 var PushInfoScopeDays int
 var PushInfoScopeDays int
 
 
 func (p *PushInfo) PushMsg(data *qrpc.PushData, Reply *int) error {
 func (p *PushInfo) PushMsg(data *qrpc.PushData, Reply *int) error {
+	log.Println("dddddddd", data)
 	for k, v := range data.PushType {
 	for k, v := range data.PushType {
 		//昨天到今天的数据
 		//昨天到今天的数据
 		pj := dopush.Pjob{
 		pj := dopush.Pjob{
@@ -23,7 +25,12 @@ func (p *PushInfo) PushMsg(data *qrpc.PushData, Reply *int) error {
 		}
 		}
 		now := time.Now()
 		now := time.Now()
 		tom := time.Date(now.Year(), now.Month(), now.Day()-PushInfoScopeDays, 0, 0, 0, 0, time.Local)
 		tom := time.Date(now.Year(), now.Month(), now.Day()-PushInfoScopeDays, 0, 0, 0, 0, time.Local)
-		pj.DoPush(data.Mopenid, fmt.Sprintf("%d days", PushInfoScopeDays), 2, tom.Unix())
+		b := pj.DoPush(data.Mopenid, fmt.Sprintf("%d days", PushInfoScopeDays), 2, tom.Unix())
+		if b {
+			*Reply = 1
+		} else {
+			*Reply = 0
+		}
 	}
 	}
 	return nil
 	return nil
 }
 }

+ 4 - 1
push/src/qfw/push/weixincall.go

@@ -6,9 +6,10 @@ import (
 	"net/rpc"
 	"net/rpc"
 	"qfw/util"
 	"qfw/util"
 	qrpc "qfw/util/rpc"
 	qrpc "qfw/util/rpc"
+	"time"
 )
 )
 
 
-var wxpool chan bool = make(chan bool, 50)
+var wxpool chan bool = make(chan bool, 30)
 
 
 //微信远程调用,实现模板发送消息
 //微信远程调用,实现模板发送消息
 func SendWinXin(p *qrpc.NotifyMsg) {
 func SendWinXin(p *qrpc.NotifyMsg) {
@@ -18,6 +19,7 @@ func SendWinXin(p *qrpc.NotifyMsg) {
 	}()
 	}()
 	util.Try(func() {
 	util.Try(func() {
 		client, err := rpc.DialHTTP("tcp", PushConfig["weixinRpcServer"].(string))
 		client, err := rpc.DialHTTP("tcp", PushConfig["weixinRpcServer"].(string))
+		defer client.Close()
 		if err != nil {
 		if err != nil {
 			log.Println(err.Error())
 			log.Println(err.Error())
 			return
 			return
@@ -28,4 +30,5 @@ func SendWinXin(p *qrpc.NotifyMsg) {
 			log.Println(err.Error())
 			log.Println(err.Error())
 		}
 		}
 	}, func(e interface{}) {})
 	}, func(e interface{}) {})
+	time.Sleep(10 * time.Millisecond)
 }
 }

+ 4 - 4
weixin/src/qfw/weixin/rpc/share.go

@@ -2,10 +2,10 @@ package rpc
 
 
 import (
 import (
 	"encoding/json"
 	"encoding/json"
+	"fmt"
 	"github.com/SKatiyar/qr"
 	"github.com/SKatiyar/qr"
 	"log"
 	"log"
 	"qfw/util/redis"
 	"qfw/util/redis"
-	"strconv"
 )
 )
 
 
 /**生成分享二维码
 /**生成分享二维码
@@ -13,14 +13,14 @@ import (
 	开发在使用时,先查看redis,没有的话再调用此RPC方法
 	开发在使用时,先查看redis,没有的话再调用此RPC方法
 	生成的二维码有效期为一个月
 	生成的二维码有效期为一个月
 **/
 **/
-func (wxrpc *WeiXinRpc) GetShareQR(shareid int, ret *string) (err error) {
+func (wxrpc *WeiXinRpc) GetShareQR(shareid uint32, ret *string) (err error) {
 	//构造自定义消息文本
 	//构造自定义消息文本
 	var msg struct {
 	var msg struct {
 		Expire int    `json:"expire_seconds"`
 		Expire int    `json:"expire_seconds"`
 		Name   string `json:"action_name"`
 		Name   string `json:"action_name"`
 		Info   struct {
 		Info   struct {
 			Scene struct {
 			Scene struct {
-				Id int `json:"scene_id"`
+				Id uint32 `json:"scene_id"`
 			} `json:"scene"`
 			} `json:"scene"`
 		} `json:"action_info"`
 		} `json:"action_info"`
 	}
 	}
@@ -40,7 +40,7 @@ func (wxrpc *WeiXinRpc) GetShareQR(shareid int, ret *string) (err error) {
 	r, _ := qr.Encode(url, qr.L)
 	r, _ := qr.Encode(url, qr.L)
 	pngdat := r.PNG()
 	pngdat := r.PNG()
 	//存储到redis
 	//存储到redis
-	redis.PutBytes("sso", "p_share_"+strconv.Itoa(shareid), &pngdat, msg.Expire)
+	redis.PutBytes("sso", fmt.Sprintf("p_share_%d", shareid), &pngdat, msg.Expire)
 	*ret = "ok"
 	*ret = "ok"
 	return nil
 	return nil
 }
 }