| | |
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.wx.WXUtil;
|
| | |
|
| | | import com.google.gson.GsonBuilder;
|
| | | 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.BusinessSystem;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.entity.system.CustomerContent;
|
| | | import com.yeshi.fanli.entity.system.CustomerName;
|
| | | import com.yeshi.fanli.entity.system.SystemClientParams;
|
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoUnionConfig;
|
| | | import com.yeshi.fanli.exception.ShareGoodsException;
|
| | | import com.yeshi.fanli.exception.share.ShareGoodsException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.BusinessSystemService;
|
| | |
| | | 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.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | 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.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.util.AESUtil;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.GsonUtil;
|
| | |
| | | return "coupon";
|
| | | }
|
| | |
|
| | | @RequestMapping("findThreeFriendsCount")
|
| | | public void findThreeFriendsCount(long id, String callback, PrintWriter out) {
|
| | | int count1 = userInfoService.findFriendsCount(id, 1);
|
| | | int count2 = userInfoService.findFriendsCount(id, 2);
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("count1", count1);
|
| | | data.put("count2", count2);
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(callback)) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | } else {
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | }
|
| | |
|
| | | @RequestMapping("findThreeFriends")
|
| | | public void findThreeFriends(long id, int type, int page, String callback, PrintWriter out) {
|
| | | int pageSize = 30;
|
| | | List<InviteUser> list = userInfoService.getFriendsList(id, type, page, pageSize);
|
| | | JSONArray array = new JSONArray();
|
| | | for (InviteUser user : list) {
|
| | | JSONObject item = JSONObject.fromObject(new GsonBuilder().create().toJson(user.getUserInfo()));
|
| | | item.put("valid", user.isValid());
|
| | | array.add(item);
|
| | | }
|
| | |
|
| | | long count = userInfoService.getFriendsListCount(id, type);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("list", array);
|
| | | data.put("pages", count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | if (!StringUtil.isNullOrEmpty(callback)) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | } else {
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "getConpon", method = RequestMethod.POST)
|
| | | public void getConpon(int page, PrintWriter out) {
|
| | | List<TaoBaoCoupon> taoBaoCouponList = taoBaoCouponService.getTaoBaoCouponList("", page);
|
| | |
| | |
|
| | | @RequestMapping("share")
|
| | | public String getShare(Model model, String uid) {
|
| | | String value = configService.get("share_message");
|
| | | String value = configService.get(ConfigKeyEnum.shareMessage.getKey());
|
| | | try {
|
| | | if (uid == null) {
|
| | | uid = "0";
|
| | |
| | |
|
| | | @RequestMapping("shares")
|
| | | public String getShares(Model model, String uid) {
|
| | | String value = configService.get("share_message");
|
| | | String value = configService.get(ConfigKeyEnum.shareMessage.getKey());
|
| | | try {
|
| | | if (uid == null) {
|
| | | uid = "0";
|
| | |
| | | if (params != null)
|
| | | down = params.getValue();
|
| | |
|
| | | if (!state.equals(wxState)) {// 不是微信返回的!
|
| | | if (state!=null&&!state.equals(wxState)) {// 不是微信返回的!
|
| | | // request.setAttribute("error", "1");
|
| | | return "redirect:" + down;
|
| | | }
|
| | |
| | | @RequestMapping("threeShareNew")
|
| | | public String threeShareNew(HttpServletRequest request, HttpSession session, HttpServletResponse response,
|
| | | long uid) {
|
| | | String serverName = request.getServerName();
|
| | | String contextPath = request.getContextPath();
|
| | | UserInfo userInfo = userInfoService.getUserById(uid);
|
| | | if (userInfo == null) {
|
| | | return "share/error";
|