| | |
| | | import java.net.URLEncoder;
|
| | | import java.text.MessageFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Arrays;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
| | | import org.yeshi.utils.wx.WXUtil;
|
| | |
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.taobao.api.ApiException;
|
| | | import com.yeshi.fanli.entity.bus.recommend.RecommendDetails;
|
| | | import com.yeshi.fanli.entity.bus.share.UserShareGoodsHistory;
|
| | | import com.yeshi.fanli.entity.bus.user.InviteUser;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | |
| | | 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.RelateGoods;
|
| | | 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.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.BusinessSystemService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.config.CustomerContentService;
|
| | | import com.yeshi.fanli.service.inter.config.CustomerNameService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemClientParamsService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemConfigService;
|
| | | import com.yeshi.fanli.service.inter.goods.GoodsSecondClassService;
|
| | | import com.yeshi.fanli.service.inter.goods.RecommendDetailsService;
|
| | | import com.yeshi.fanli.service.inter.goods.ShareGoodsService;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoCouponService;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
|
| | |
| | | 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 RecommendDetailsService recommendDetailsService;
|
| | |
|
| | | @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;
|
| | |
|
| | | private static final String DOWNURL = "http://sj.qq.com/myapp/detail.htm?apkName="
|
| | | + Constant.systemCommonConfig.getAndroidPackageName();
|
| | |
| | | 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;
|
| | | }
|
| | |
| | |
|
| | | }
|
| | |
|
| | | @RequestMapping("details")
|
| | | public String getRecommendDetails(long drid, Model model) {
|
| | | RecommendDetails recommendDetails = recommendDetailsService.getRecommendDetails(drid, 0);
|
| | | if (recommendDetails == null) {
|
| | | return "";
|
| | | }
|
| | | model.addAttribute("recommendDetails", recommendDetails);
|
| | | try {
|
| | | List<RelateGoods> list = TaoKeApiUtil
|
| | | .getRelateGoodsList(Long.parseLong(recommendDetails.getDynamicRecommend().getAuctionId()));
|
| | | String upicUrls = recommendDetails.getDynamicRecommend().getuPicUrl();
|
| | | String[] imgs = upicUrls.split(",");
|
| | | List<String> tbImg = Arrays.asList(imgs);
|
| | | // List<String> tbImg =
|
| | | // TaoBaoUtil.getTbImg(recommendDetails.getDynamicRecommend().getAuctionId());
|
| | | model.addAttribute("tbImgs", tbImg);
|
| | | model.addAttribute("relateGoodsList", list);
|
| | | } catch (NumberFormatException e) {
|
| | | e.printStackTrace();
|
| | | } catch (ApiException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return "tuijian";
|
| | | }
|
| | |
|
| | |
|
| | | @RequestMapping("shareGoods")
|
| | | public void shareGoods(String auctionId, PrintWriter out) {
|
| | | TaoBaoGoodsBrief alimama = null;
|
| | |
| | | }
|
| | | 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);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | public void getHelpList(PrintWriter out) {
|
| | | List<CustomerName> totalList = new ArrayList<>();
|
| | | int page = 0;
|
| | | List<CustomerName> customerNameList = systemClientParamsService.customerNameList(page, "", 1);
|
| | | List<CustomerName> customerNameList = customerNameService.customerNameList(page, "", 1);
|
| | | if (customerNameList != null && customerNameList.size() > 0)
|
| | | totalList.addAll(customerNameList);
|
| | |
|
| | | while (customerNameList != null && customerNameList.size() == Constant.PAGE_SIZE) {
|
| | | page++;
|
| | | customerNameList = systemClientParamsService.customerNameList(page, "", 1);
|
| | | customerNameList = customerNameService.customerNameList(page, "", 1);
|
| | | if (customerNameList != null && customerNameList.size() > 0)
|
| | | totalList.addAll(customerNameList);
|
| | | }
|
| | |
|
| | | // 获取每个下面的详情
|
| | | for (CustomerName cn : totalList) {
|
| | | List<CustomerContent> contentList = systemClientParamsService.getSecondProblemList(0, "", cn.getId());
|
| | | List<CustomerContent> contentList = customerContentService.getSecondProblemList(0, "", cn.getId());
|
| | | cn.setCustomerContentList(contentList);
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(JsonUtil.getSimpleGson().toJson(totalList)));
|
| | |
| | | @RequestMapping("getHelpDetail")
|
| | | public void getHelpDetail(long id, PrintWriter out) {
|
| | | List<CustomerName> totalList = new ArrayList<>();
|
| | | CustomerContent customerContent = systemClientParamsService.getCustomerContent(id);
|
| | | CustomerContent customerContent = customerContentService.getCustomerContent(id);
|
| | | out.print(JsonUtil.loadTrueResult(customerContent.getContent().replace("\n", "<br>")));
|
| | | }
|
| | |
|