Showing
5 changed files
with
51 additions
and
3 deletions
@@ -9,6 +9,7 @@ import com.yoho.service.model.union.request.UserInfoBO; | @@ -9,6 +9,7 @@ import com.yoho.service.model.union.request.UserInfoBO; | ||
9 | import com.yoho.unions.common.Response; | 9 | import com.yoho.unions.common.Response; |
10 | import com.yoho.unions.common.constant.Constant; | 10 | import com.yoho.unions.common.constant.Constant; |
11 | import com.yoho.unions.common.enums.CodeEnum; | 11 | import com.yoho.unions.common.enums.CodeEnum; |
12 | +import com.yoho.unions.common.redis.RedisValueCache; | ||
12 | import com.yoho.unions.common.service.ILoginService; | 13 | import com.yoho.unions.common.service.ILoginService; |
13 | import com.yoho.unions.common.utils.SessionUtil; | 14 | import com.yoho.unions.common.utils.SessionUtil; |
14 | import org.apache.commons.lang3.StringUtils; | 15 | import org.apache.commons.lang3.StringUtils; |
@@ -22,6 +23,7 @@ import javax.annotation.Resource; | @@ -22,6 +23,7 @@ import javax.annotation.Resource; | ||
22 | import javax.servlet.http.HttpServletRequest; | 23 | import javax.servlet.http.HttpServletRequest; |
23 | import javax.servlet.http.HttpServletResponse; | 24 | import javax.servlet.http.HttpServletResponse; |
24 | import javax.servlet.http.HttpSession; | 25 | import javax.servlet.http.HttpSession; |
26 | +import java.util.concurrent.TimeUnit; | ||
25 | 27 | ||
26 | /** | 28 | /** |
27 | * 描述: | 29 | * 描述: |
@@ -37,6 +39,9 @@ public class LoginController { | @@ -37,6 +39,9 @@ public class LoginController { | ||
37 | @Resource | 39 | @Resource |
38 | private ILoginService loginService; | 40 | private ILoginService loginService; |
39 | 41 | ||
42 | + @Resource | ||
43 | + RedisValueCache redisValueCache; | ||
44 | + | ||
40 | private static String SALT= DynamicPropertyFactory.getInstance().getStringProperty("platform.login.salt", "").get(); | 45 | private static String SALT= DynamicPropertyFactory.getInstance().getStringProperty("platform.login.salt", "").get(); |
41 | 46 | ||
42 | @RequestMapping("/loginForPid.do") | 47 | @RequestMapping("/loginForPid.do") |
@@ -50,6 +55,7 @@ public class LoginController { | @@ -50,6 +55,7 @@ public class LoginController { | ||
50 | if (null != userInfoResponseBO && pid.equals(userInfoResponseBO.getPid())) { | 55 | if (null != userInfoResponseBO && pid.equals(userInfoResponseBO.getPid())) { |
51 | request.setAttribute("pid", pid); | 56 | request.setAttribute("pid", pid); |
52 | request.getRequestDispatcher(callbackUrl).forward(request, response); | 57 | request.getRequestDispatcher(callbackUrl).forward(request, response); |
58 | + addToRedis(pid, userInfoResponseBO); | ||
53 | } else if (pidMd5.equals(MD5.md5(pid + SALT))) { | 59 | } else if (pidMd5.equals(MD5.md5(pid + SALT))) { |
54 | log.info("loginForPid with session is empty. and login start. with pid={}", pid); | 60 | log.info("loginForPid with session is empty. and login start. with pid={}", pid); |
55 | Response<UserInfoBO> responseBO = loginService.loginByPid(pid); | 61 | Response<UserInfoBO> responseBO = loginService.loginByPid(pid); |
@@ -60,11 +66,16 @@ public class LoginController { | @@ -60,11 +66,16 @@ public class LoginController { | ||
60 | request.setAttribute("pid", pid); | 66 | request.setAttribute("pid", pid); |
61 | request.getSession().setAttribute(Constant.USER_SESSION, responseBO.getData()); | 67 | request.getSession().setAttribute(Constant.USER_SESSION, responseBO.getData()); |
62 | request.getRequestDispatcher(callbackUrl).forward(request, response); | 68 | request.getRequestDispatcher(callbackUrl).forward(request, response); |
69 | + addToRedis(pid, userInfoResponseBO); | ||
63 | } | 70 | } |
64 | } | 71 | } |
65 | 72 | ||
66 | } | 73 | } |
67 | 74 | ||
75 | + private void addToRedis(String pid,UserInfoBO userInfoResponseBO) { | ||
76 | + redisValueCache.set("yh:union:pid:"+pid,userInfoResponseBO,300, TimeUnit.SECONDS); | ||
77 | + } | ||
78 | + | ||
68 | /** | 79 | /** |
69 | * 注销 | 80 | * 注销 |
70 | * @param session | 81 | * @param session |
@@ -8,8 +8,10 @@ import com.yoho.service.model.union.bo.*; | @@ -8,8 +8,10 @@ import com.yoho.service.model.union.bo.*; | ||
8 | import com.yoho.service.model.union.request.*; | 8 | import com.yoho.service.model.union.request.*; |
9 | import com.yoho.service.model.union.response.*; | 9 | import com.yoho.service.model.union.response.*; |
10 | import com.yoho.unions.common.constant.Constant; | 10 | import com.yoho.unions.common.constant.Constant; |
11 | +import com.yoho.unions.common.redis.RedisValueCache; | ||
11 | import com.yoho.unions.dal.model.*; | 12 | import com.yoho.unions.dal.model.*; |
12 | import com.yoho.unions.server.task.CpsNewUserActivityTask; | 13 | import com.yoho.unions.server.task.CpsNewUserActivityTask; |
14 | +import org.apache.commons.lang3.StringUtils; | ||
13 | import org.slf4j.Logger; | 15 | import org.slf4j.Logger; |
14 | import org.slf4j.LoggerFactory; | 16 | import org.slf4j.LoggerFactory; |
15 | import org.springframework.beans.factory.annotation.Autowired; | 17 | import org.springframework.beans.factory.annotation.Autowired; |
@@ -30,6 +32,7 @@ import com.yoho.unions.common.ApiResponse; | @@ -30,6 +32,7 @@ import com.yoho.unions.common.ApiResponse; | ||
30 | import com.yoho.unions.server.service.IUnionShareService; | 32 | import com.yoho.unions.server.service.IUnionShareService; |
31 | import com.yoho.unions.server.task.CpsOrderExtraActivityTask; | 33 | import com.yoho.unions.server.task.CpsOrderExtraActivityTask; |
32 | 34 | ||
35 | +import javax.annotation.Resource; | ||
33 | import javax.servlet.http.HttpServletRequest; | 36 | import javax.servlet.http.HttpServletRequest; |
34 | import javax.servlet.http.HttpSession; | 37 | import javax.servlet.http.HttpSession; |
35 | 38 | ||
@@ -52,6 +55,9 @@ public class UnionShareRest { | @@ -52,6 +55,9 @@ public class UnionShareRest { | ||
52 | @Autowired | 55 | @Autowired |
53 | CpsNewUserActivityTask cpsNewUserActivityTask; | 56 | CpsNewUserActivityTask cpsNewUserActivityTask; |
54 | 57 | ||
58 | + @Resource | ||
59 | + RedisValueCache redisValueCache; | ||
60 | + | ||
55 | @RequestMapping("/getShareInfoByUid") | 61 | @RequestMapping("/getShareInfoByUid") |
56 | @ResponseBody | 62 | @ResponseBody |
57 | public ShareUserSettlementInfoBo getShareInfoByUid(@RequestBody int uid){ | 63 | public ShareUserSettlementInfoBo getShareInfoByUid(@RequestBody int uid){ |
@@ -589,12 +595,16 @@ public class UnionShareRest { | @@ -589,12 +595,16 @@ public class UnionShareRest { | ||
589 | log.info("specialAward req is {}", req); | 595 | log.info("specialAward req is {}", req); |
590 | UserInfoBO userInfoBO= (UserInfoBO) session.getAttribute("userSession"); | 596 | UserInfoBO userInfoBO= (UserInfoBO) session.getAttribute("userSession"); |
591 | if (userInfoBO == null) { | 597 | if (userInfoBO == null) { |
598 | + userInfoBO=getFromredis(req.getString("pid")); | ||
599 | + if (userInfoBO == null){ | ||
592 | return new UnionResponse(403, "请刷新页面重新操作"); | 600 | return new UnionResponse(403, "请刷新页面重新操作"); |
593 | } | 601 | } |
602 | + } | ||
594 | log.info("specialAward req is {},account is {}", req,userInfoBO); | 603 | log.info("specialAward req is {},account is {}", req,userInfoBO); |
595 | boolean result = unionShareService.specialAward(req,userInfoBO); | 604 | boolean result = unionShareService.specialAward(req,userInfoBO); |
596 | return new UnionResponse(200, "specialAward end",result); | 605 | return new UnionResponse(200, "specialAward end",result); |
597 | } | 606 | } |
607 | + | ||
598 | /** | 608 | /** |
599 | * 特殊佣金状态变更 | 609 | * 特殊佣金状态变更 |
600 | * @param req | 610 | * @param req |
@@ -607,8 +617,11 @@ public class UnionShareRest { | @@ -607,8 +617,11 @@ public class UnionShareRest { | ||
607 | log.info("specialAwardChange req is {}", req); | 617 | log.info("specialAwardChange req is {}", req); |
608 | UserInfoBO userInfoBO= (UserInfoBO) session.getAttribute("userSession"); | 618 | UserInfoBO userInfoBO= (UserInfoBO) session.getAttribute("userSession"); |
609 | if (userInfoBO == null) { | 619 | if (userInfoBO == null) { |
620 | + userInfoBO=getFromredis(req.getString("pid")); | ||
621 | + if (userInfoBO == null){ | ||
610 | return new UnionResponse(403, "请刷新页面重新操作"); | 622 | return new UnionResponse(403, "请刷新页面重新操作"); |
611 | } | 623 | } |
624 | + } | ||
612 | log.info("specialAwardChange req is {},account is {}", req,userInfoBO); | 625 | log.info("specialAwardChange req is {},account is {}", req,userInfoBO); |
613 | int result = unionShareService.specialAwardChange(req); | 626 | int result = unionShareService.specialAwardChange(req); |
614 | return new UnionResponse(200, "specialAwardChange end",result); | 627 | return new UnionResponse(200, "specialAwardChange end",result); |
@@ -802,4 +815,11 @@ public class UnionShareRest { | @@ -802,4 +815,11 @@ public class UnionShareRest { | ||
802 | 815 | ||
803 | } | 816 | } |
804 | 817 | ||
818 | + private UserInfoBO getFromredis(String pid) { | ||
819 | + if (StringUtils.isBlank(pid)) { | ||
820 | + return null; | ||
821 | + } | ||
822 | + UserInfoBO userInfoResponseBO=redisValueCache.get("yh:union:pid:"+pid,UserInfoBO.class); | ||
823 | + return userInfoResponseBO; | ||
824 | + } | ||
805 | } | 825 | } |
@@ -78,7 +78,7 @@ public class GDT2019ServiceImpl extends UnionServiceImpl implements IUnionServic | @@ -78,7 +78,7 @@ public class GDT2019ServiceImpl extends UnionServiceImpl implements IUnionServic | ||
78 | activeUnion.warn("GDT2019ServiceImpl Callback error,clickBO is {},url is {},params is {},resp is {}.",clickBO,url,params,resp); | 78 | activeUnion.warn("GDT2019ServiceImpl Callback error,clickBO is {},url is {},params is {},resp is {}.",clickBO,url,params,resp); |
79 | return Pair.of(303, "GDT2019ServiceImpl Callback error"); | 79 | return Pair.of(303, "GDT2019ServiceImpl Callback error"); |
80 | } else if (resp.getLeft() == 200 && data.getInteger("code") == 0) { | 80 | } else if (resp.getLeft() == 200 && data.getInteger("code") == 0) { |
81 | - activeUnion.warn("GDT2019ServiceImpl Callback success,clickBO is {},url is {},params is {},resp is {}.",clickBO,url,params,resp); | 81 | + activeUnion.info("GDT2019ServiceImpl Callback success,clickBO is {},url is {},params is {},resp is {}.",clickBO,url,params,resp); |
82 | } | 82 | } |
83 | return resp; | 83 | return resp; |
84 | } catch (Exception e) { | 84 | } catch (Exception e) { |
@@ -668,7 +668,7 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher | @@ -668,7 +668,7 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher | ||
668 | // 若只走老版本,把zk里的值设true且表union_type_match对应的两个条数据union_type_match改成3; | 668 | // 若只走老版本,把zk里的值设true且表union_type_match对应的两个条数据union_type_match改成3; |
669 | // 若只走新版本,则把表union_type_match对应的两个条数据union_type_match改成201901即可 | 669 | // 若只走新版本,则把表union_type_match对应的两个条数据union_type_match改成201901即可 |
670 | if (finalUnionType.equals("3")&&(unionTypeMatch.getUnionType()==100000000003767L||unionTypeMatch.getUnionType()==100000000012786L)&&!configReader.getBoolean("union.gdtAuth2Close", true)) { | 670 | if (finalUnionType.equals("3")&&(unionTypeMatch.getUnionType()==100000000003767L||unionTypeMatch.getUnionType()==100000000012786L)&&!configReader.getBoolean("union.gdtAuth2Close", true)) { |
671 | - log.info("activateUnion call UnionServiceImpl_201901 with request is {}", request); | 671 | + log.info("activateUnion call UnionServiceImpl_201901,GDT2019ServiceImpl with request is {}", request); |
672 | taskExecutor.execute(() -> { | 672 | taskExecutor.execute(() -> { |
673 | IUnionService uniteService2 = SpringContextUtil.getBean("UnionServiceImpl_201901", IUnionService.class); | 673 | IUnionService uniteService2 = SpringContextUtil.getBean("UnionServiceImpl_201901", IUnionService.class); |
674 | uniteService2.visitCallbackUrl(null, click); | 674 | uniteService2.visitCallbackUrl(null, click); |
@@ -43,8 +43,23 @@ | @@ -43,8 +43,23 @@ | ||
43 | </div> | 43 | </div> |
44 | <script type="text/javascript"> | 44 | <script type="text/javascript"> |
45 | var checkedItems = []; | 45 | var checkedItems = []; |
46 | - $(function () { | 46 | + function getQueryString(url,name) { |
47 | + debugger; | ||
48 | + var i=url.lastIndexOf('?'); | ||
49 | + if(i==-1)return; | ||
50 | + var querystr=url.substr(i+1); | ||
51 | + var arr1=querystr.split('&'); | ||
52 | + var arr2=new Object(); | ||
53 | + for (i in arr1){ | ||
54 | + var ta=arr1[i].split('='); | ||
55 | + arr2[ta[0]]=ta[1]; | ||
56 | + } | ||
57 | + return arr2[name]; | ||
58 | + } | ||
47 | 59 | ||
60 | + var param=window.location.search; | ||
61 | + var pid = getQueryString(param, "pid"); | ||
62 | + $(function () { | ||
48 | $("#userTable").myDatagrid({ | 63 | $("#userTable").myDatagrid({ |
49 | fit: true, | 64 | fit: true, |
50 | fitColumns: true, | 65 | fitColumns: true, |
@@ -203,6 +218,7 @@ | @@ -203,6 +218,7 @@ | ||
203 | var param = {}; | 218 | var param = {}; |
204 | param.status = $.trim(rewardStatus); | 219 | param.status = $.trim(rewardStatus); |
205 | param.orderIds = $.trim(orderIds); | 220 | param.orderIds = $.trim(orderIds); |
221 | + param.pid = pid; | ||
206 | 222 | ||
207 | $.ajax({ | 223 | $.ajax({ |
208 | type: "POST", | 224 | type: "POST", |
@@ -282,6 +298,7 @@ | @@ -282,6 +298,7 @@ | ||
282 | param.activityId = $.trim(activityId); | 298 | param.activityId = $.trim(activityId); |
283 | // param.status = $.trim(rewardStatus); | 299 | // param.status = $.trim(rewardStatus); |
284 | param.orderCodes = $.trim(orderCodes); | 300 | param.orderCodes = $.trim(orderCodes); |
301 | + param.pid = pid; | ||
285 | 302 | ||
286 | var remarks = $("#remarks").val(); | 303 | var remarks = $("#remarks").val(); |
287 | if (remarks != "") { | 304 | if (remarks != "") { |
-
Please register or login to post a comment