/** * 推送订单数据 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; }