/** * 提供互娱调用的接口 更新flag状态 Test * * @author qiulongjie * @param result * @return */ @RequestMapping(value = "updOrdStatusTest", method = RequestMethod.POST) @ResponseBody public String updOrdStatusTest( Long id, @RequestParam(value = "isSuccess", defaultValue = "false") Boolean isSuccess, String msg, String resultObject) { logger.info( "--互娱同步平安数据之后回调接口updOrdStatusTest--id=" + id + ",isSuccess=" + isSuccess + ",msg=" + msg + ",resultObject=" + resultObject + ",time=" + DateUtil.getDateTime()); if (isSuccess) { adService.updOrdLogsPush(id, 9, msg, resultObject); return "true"; } adService.updOrdLogsPush(id, 0, ""); return "false"; }
/** * 添加在ok页面中点击红包或者下载apk包的记录 * * @author qiulongjie * @param request * @return */ @RequestMapping(value = "addOKClickLog", method = RequestMethod.POST) @ResponseBody public String addOKClickLog(HttpServletRequest request) { String channel = request.getParameter("a"); String clickType = request.getParameter("clickType"); String ipaddr = WebUtil.getIpAddr(request); String vtime = DateUtil.getDateTime(); adService.addOKClickLog(channel, clickType, ipaddr, vtime); return "1"; }
@RequestMapping(method = RequestMethod.GET) public String input( Model model, HttpServletRequest request, @RequestHeader("user-agent") String ua) { String channel = request.getParameter("a"); if (channel == null) { channel = "1000"; } else { request.setAttribute("a", channel); } if (channel.length() > 20) { logger.warn( "渠道长度超过20字符 对此渠道进行截取channel=" + channel + ",ua=" + ua + ",url=" + request.getRequestURL().toString() + "?" + request.getQueryString()); channel = channel.substring(0, 20); } channel = channel.replace("a", "A"); if (ua != null && ua.length() > 40) { ua = ua.substring(0, 40); } String ipaddr = WebUtil.getIpAddr(request); String prov = ""; prov = request.getParameter("code"); if (prov == null) { prov = ""; } else { request.setAttribute("code", prov); } String vtime = DateUtil.getDateTime(); adService.AddReqLogs(channel, ipaddr, prov, vtime, ua, "1"); return "pingan/ping"; }
/** * 推送订单数据 AddOrdLogs * * @param request * @return */ @RequestMapping(value = "pushOrdLog", method = RequestMethod.POST) @ResponseBody public String pushOrdLog(HttpServletRequest request) { String channel = request.getParameter("channel"); String uname = request.getParameter("uname"); String birthday = request.getParameter("birthday"); String ddlSex = request.getParameter("ddlSex") == null ? "男" : request.getParameter("ddlSex"); String phone = request.getParameter("phone"); String ipaddr = WebUtil.getIpAddr(request); String vtime = DateUtil.getDateTime(); if (!ValidUtil.isValidName(uname)) { logger.warn( "推送订单AddOrdLogsPush--姓名不合法,uname=" + uname + ",channel=" + channel + ",ip=" + ipaddr + ",vtime=" + vtime); return "0"; } if (!ValidUtil.isValidSex(ddlSex)) { logger.warn( "推送订单AddOrdLogsPush--性别不合法,ddlSex=" + ddlSex + ",channel=" + channel + ",ip=" + ipaddr + ",vtime=" + vtime); return "0"; } if (!ValidUtil.isBirthday(birthday)) { logger.warn( "推送订单AddOrdLogsPush--生日不合法,birthday=" + birthday + ",channel=" + channel + ",ip=" + ipaddr + ",vtime=" + vtime); return "0"; } if (!ValidUtil.isPhoneNumber(phone)) { logger.warn( "推送订单AddOrdLogsPush--手机号码不合法,phone=" + phone + ",channel=" + channel + ",ip=" + ipaddr + ",vtime=" + vtime); return "0"; } boolean pass = adService.isPassForPushOrd(channel, ipaddr); if (!pass) { logger.warn("==推送订单被拦截 -- channel=" + channel + ",ip=" + ipaddr + ",vtime=" + vtime); } System.out.println("**推送订单数据**ip=" + ipaddr + "***channel=" + channel + "***pass="******"push", vtime, channel, ""); return "1"; } return "0"; }
/** * 普通订单提交 同步给荣时代 * * @author qiulongjie * @param request * @return */ @RequestMapping(value = "submitGet") public String list(HttpServletRequest request) { String uname = request.getParameter("uname"); String birthday = request.getParameter("birthday"); String ddlSex = request.getParameter("ddlSex") == null ? "男" : request.getParameter("ddlSex"); String phone = request.getParameter("phone"); String ipaddr = WebUtil.getIpAddr(request); String prov = request.getParameter("code") == null ? "" : request.getParameter("code"); String pubcode = request.getParameter("a"); String ok_p = request.getParameter("ok_p"); // 检验 start if (!ValidUtil.isValidName(uname)) { return setAttributes(request, uname, birthday, ddlSex, phone, prov, pubcode, ok_p); } if (!ValidUtil.isValidSex(ddlSex)) { return setAttributes(request, uname, birthday, ddlSex, phone, prov, pubcode, ok_p); } if (!ValidUtil.isBirthday(birthday)) { return setAttributes(request, uname, birthday, ddlSex, phone, prov, pubcode, ok_p); } if (!ValidUtil.isPhoneNumber(phone)) { return setAttributes(request, uname, birthday, ddlSex, phone, prov, pubcode, ok_p); } // 检验 END String verifyCode = (String) request.getSession().getAttribute("verifyCode"); String realCode = request.getParameter("vryCode"); // 判断验证码是否正确 if (verifyCode != null && realCode != null && realCode.equalsIgnoreCase(verifyCode)) { String vtime = DateUtil.getDateTime(); String whois = request.getParameter("whois"); String country = request.getParameter("country"); String fee = request.getParameter("fee"); String isneed = request.getParameter("isneed"); String pcontent = whois + "," + country + "," + fee + "," + isneed; // AddrBean addrBean = iPService.getIPAddr2(ipaddr); // String province = addrBean.getProvinceCode(); // String city = addrBean.getCity(); int ads = 1; // 判断是否把这个数据同步给深圳互娱 /*boolean isPingan = pinganService.checkIP(pubcode,city,birthday); if(isPingan){ // 如果是深圳互娱则把 flag设置为8 ads = 2; adService.AddOrdLogs(uname, birthday, ddlSex, phone, ipaddr, prov, vtime,pubcode,pcontent,8,ads,province,city); }else{ adService.AddOrdLogs(uname, birthday, ddlSex, phone, ipaddr, prov, vtime,pubcode,pcontent,0,ads,province,city); }*/ // 判断是否要传给立其的数据 /*boolean isLiqi = liqiService.check(ipaddr,province,city); if(isLiqi){ // 如果是立其娱则把 flag设置为8 ads = 5; adService.AddOrdLogs(uname, birthday, ddlSex, phone, ipaddr, prov, vtime,pubcode,pcontent,8,ads,province,city); }else{ // 判断是否要传给360新媒体的数据 boolean isNewMedia = newMediaService.checkOrd(pubcode,city); if(isNewMedia){ // 如果是360新媒体则把 flag设置为8 ads = 4; adService.AddOrdLogs(uname, birthday, ddlSex, phone, ipaddr, prov, vtime,pubcode,pcontent,8,ads,province,city); }else{ adService.AddOrdLogs(uname, birthday, ddlSex, phone, ipaddr, prov, vtime,pubcode,pcontent,0,ads,province,city); } }*/ // 订单提交是flag置为3,后台任务更新省份和城市后再恢复值 adService.AddOrdLogs( uname, birthday, ddlSex, phone, ipaddr, prov, vtime, pubcode, pcontent, 3, ads, null, null); if (ok_p != null && !ok_p.trim().equals("")) { return "redirect:/ping/go/" + ok_p + "?a=" + pubcode; } } else { // 判断验证码错误 request.setAttribute("vry", "failure_vry"); return setAttributes(request, uname, birthday, ddlSex, phone, prov, pubcode, ok_p); } return "redirect:/ping/ok?a=" + pubcode; }