| | |
| | | import com.yeshi.fanli.entity.system.CustomerName;
|
| | | import com.yeshi.fanli.entity.system.SystemClientParams;
|
| | | import com.yeshi.fanli.entity.taobao.PidUser;
|
| | | import com.yeshi.fanli.entity.taobao.SearchFilter;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoCoupon;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
|
| | |
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.user.ShamUserService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInviteRecordService;
|
| | | import com.yeshi.fanli.util.AESUtil;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.GsonUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private GoodsSecondClassService goodsSecondClassService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private TaoBaoCouponService taoBaoCouponService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | |
|
| | |
| | | private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
|
| | |
|
| | | @Resource
|
| | | private UserInviteRecordService userInviteRecordService;
|
| | |
|
| | | @Resource
|
| | | private RedisManager redisManager;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoUnionConfigService taoBaoUnionConfigService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private CustomerNameService customerNameService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private CustomerContentService customerContentService;
|
| | |
|
| | |
| | | if ("2".equalsIgnoreCase(ios)) {
|
| | | down = DOWNURL;
|
| | | }
|
| | | if (!state.equals(wxState)) {// 不是微信返回的!
|
| | | if (state == null || !state.equals(wxState)) {// 不是微信返回的!
|
| | | // request.setAttribute("error", "1");
|
| | | return "redirect:" + down;
|
| | | }
|
| | |
|
| | | if (code == null) {// 用户取消了登陆!
|
| | | return "redirect:" + down;
|
| | | }
|
| | |
| | | // request.setAttribute("error", "1");
|
| | | return "redirect:" + down;
|
| | | }
|
| | | if (code == null) {// 用户取消了登陆!
|
| | | return "redirect:" + down;
|
| | | }
|
| | |
|
| | | UserInfo inviter = userInfoService.getUserById(Long.parseLong(uid));
|
| | | if (inviter == null) {// 没得这个人
|
| | | return "redirect:" + down;
|
| | | }
|
| | |
|
| | | boolean b = userInfoService.inviteWXUserInfo(code, inviter);
|
| | | if (!b) { // 绑定失败
|
| | | // request.setAttribute("msg", "非常遗憾,你已领取过红包,请勿再次领取。");
|
| | | return "redirect:" + down;
|
| | | }
|
| | | // 保存邀请记录
|
| | | userInviteRecordService.saveInviteRecord(code, uid);
|
| | |
|
| | | return "redirect:" + down;
|
| | | }
|
| | |
| | | try {
|
| | | if (request.getSession().getAttribute("search-quan-" + map.get("FromUserName")) == null) {
|
| | | request.getSession().setAttribute("search-quan-" + map.get("FromUserName"), "1");
|
| | | TaoBaoSearchResult result = TaoKeApiUtil.searchCouple(content, null, 1, 5);
|
| | | SearchFilter sf = new SearchFilter();
|
| | | sf.setPage(1);
|
| | | sf.setPageSize(5);
|
| | | sf.setKey(content);
|
| | | sf.setQuan(1);
|
| | | TaoBaoSearchResult result = TaoKeApiUtil.searchWuLiao(sf);
|
| | | if (result == null || result.getTaoBaoGoodsBriefs() == null
|
| | | || result.getTaoBaoGoodsBriefs().size() <= 0) {
|
| | | Map<String, String> parmas = new HashMap<>();
|
| | |
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | JSONObject rdata = new JSONObject();
|
| | | rdata.put("uid", uid);
|
| | | rdata.put("id", id);
|
| | | LogHelper.errorDetailInfo(e, rdata.toString(), request.getRequestURI());
|
| | | } catch (Exception e2) {
|
| | | e2.printStackTrace();
|
| | | }
|
| | | JSONObject rdata = new JSONObject();
|
| | | rdata.put("uid", uid);
|
| | | rdata.put("id", id);
|
| | | LogHelper.errorDetailInfo(e, rdata.toString(), request.getRequestURI());
|
| | | out.print(JsonUtil.loadFalseResult(1001, "未知错误"));
|
| | | }
|
| | |
|
| | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("uid", uid);
|
| | | data.put("id", id);
|
| | |
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e1, data.toString(), request.getRequestURI());
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | LogHelper.errorDetailInfo(e1, data.toString(), request.getRequestURI());
|
| | | out.print(JsonUtil.loadFalseResult(e1.getCode(), e1.getMsg()));
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e2) {
|
| | | e2.printStackTrace();
|
| | | }
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | |
|
| | | }
|