| | |
| | | import com.yeshi.fanli.dto.HongBaoDTO;
|
| | | import com.yeshi.fanli.dto.money.AccountDetails;
|
| | | import com.yeshi.fanli.dto.order.OrderItem;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.entity.AppVersionInfo;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.AccountMessage;
|
| | |
| | | import com.yeshi.fanli.entity.common.Config;
|
| | | import com.yeshi.fanli.entity.goods.CollectionGoodsV2;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | | import com.yeshi.fanli.entity.order.HongBaoOrder;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | |
| | | import com.yeshi.fanli.util.factory.AccountDetailsFactory;
|
| | | import com.yeshi.fanli.util.factory.HongBaoFactory;
|
| | | import com.yeshi.fanli.util.factory.OrderItemFactory;
|
| | | import com.yeshi.fanli.util.jd.JDApiUtil;
|
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.util.wx.WXLoginUtil;
|
| | |
| | | }
|
| | |
|
| | | @RequestMapping("collectionGoods")
|
| | | public void collectionGoods(AcceptData acceptData, long uid, long auctionId, int type, Integer goodsType,
|
| | | PrintWriter out) {
|
| | | if (goodsType == null) {
|
| | | goodsType = Constant.SOURCE_TYPE_TAOBAO;
|
| | | }
|
| | | CollectionGoodsV2 find = collectionGoodsV2Service.findByUidAndAuctionId(uid, auctionId, goodsType);
|
| | | if (type == 1) {
|
| | | if (find != null) {
|
| | | out.print(JsonUtil.loadFalseResult(""));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (goodsType == Constant.SOURCE_TYPE_JD) {
|
| | | JDGoods jdGoods = JDApiUtil.queryGoodsDetail(auctionId);
|
| | | if (jdGoods == null) {
|
| | | jdGoods = JDApiUtil.getGoodsDetail(auctionId);
|
| | | }
|
| | |
|
| | | if (jdGoods == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "商品已下架"));
|
| | | } else {
|
| | | try {
|
| | | collectionGoodsV2Service.addJDCollection(uid, jdGoods);
|
| | | out.print(JsonUtil.loadTrueResult("收藏成功"));
|
| | | } catch (CollectionGoodsException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | | }
|
| | | }
|
| | | } else if (goodsType == Constant.SOURCE_TYPE_PDD) {
|
| | | PDDGoodsDetail pddGoods = PinDuoDuoApiUtil.getGoodsDetail(auctionId);
|
| | | if (pddGoods == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "商品已下架"));
|
| | | public void collectionGoods(AcceptData acceptData, long uid, long auctionId, int type, PrintWriter out) {
|
| | | try {
|
| | | CollectionGoodsV2 find = collectionGoodsV2Service.findByUidAndAuctionId(uid, auctionId,
|
| | | Constant.SOURCE_TYPE_TAOBAO);
|
| | | if (type == 1) {
|
| | | if (find != null) {
|
| | | out.print(JsonUtil.loadFalseResult(""));
|
| | | return;
|
| | | }
|
| | | try {
|
| | | collectionGoodsV2Service.addPDDCollection(uid, pddGoods);
|
| | | out.print(JsonUtil.loadTrueResult("收藏成功"));
|
| | | } catch (CollectionGoodsException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | | }
|
| | |
|
| | | } else {
|
| | | try {
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = redisManager.getTaoBaoGoodsBrief(auctionId);
|
| | | collectionGoodsV2Service.addCollection(uid, taoBaoGoodsBrief);
|
| | | out.print(JsonUtil.loadTrueResult("收藏成功"));
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "商品已下架"));
|
| | | } catch (CollectionGoodsException e1) {
|
| | | out.print(JsonUtil.loadFalseResult(e1.getCode(), e1.getMsg()));
|
| | | }
|
| | | }
|
| | | } else {
|
| | | if (find == null) {
|
| | | out.print(JsonUtil.loadTrueResult("取消收藏成功"));
|
| | | return;
|
| | | } else {
|
| | | try {
|
| | | collectionGoodsV2Service.cancelCollectionByAuctionId(uid, auctionId, goodsType);
|
| | | if (find == null) {
|
| | | out.print(JsonUtil.loadTrueResult("取消收藏成功"));
|
| | | } catch (CollectionGoodsException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | | return;
|
| | | } else {
|
| | | collectionGoodsV2Service.cancelCollectionByAuctionId(uid, auctionId, Constant.SOURCE_TYPE_TAOBAO);
|
| | | out.print(JsonUtil.loadTrueResult("取消收藏成功"));
|
| | | }
|
| | | }
|
| | | } catch (CollectionGoodsException e1) {
|
| | | out.print(JsonUtil.loadFalseResult(e1.getCode(), e1.getMsg()));
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * h5收藏
|
| | | *
|
| | |
| | | bossData = new JSONObject();
|
| | | UserInfo boss = threeSale.getBoss();
|
| | | if (boss != null) {
|
| | | bossData.put("bossId", boss.getId());
|
| | | bossData.put("nickName", boss.getNickName());
|
| | | bossData.put("portrait", boss.getPortrait());
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(boss.getId());
|
| | | if (userInfoExtra != null) |
| | | bossData.put("weiXin", userInfoExtra.getWeiXin());
|
| | | }
|
| | |
|
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd");
|
| | | Long createTime = threeSale.getCreateTime();
|
| | | Date inviteTime = new Date(createTime);
|
| | |
| | |
|
| | | GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("user", JsonUtil.getConvertBigDecimalToStringBuilder(gsonBuilder).create().toJson(userInfo));
|
| | |
|
| | | // 界面状态
|
| | | UserSettingsVO mySettings = null;
|
| | | try {
|
| | |
| | | userInfo.setRankNamePicture(null);
|
| | | userInfo.setRankIcon(null);
|
| | | }
|
| | | |
| | | userInfo.setSex(userInfoExtra.getSex());
|
| | | userInfo.setWeiXin(userInfoExtra.getWeiXin());
|
| | | }
|
| | |
|
| | | |
| | | |
| | | |
| | | data.put("user", JsonUtil.getConvertBigDecimalToStringBuilder(gsonBuilder).create().toJson(userInfo));
|
| | | data.put("invitCode", invitCode); // 邀请码
|
| | | data.put("welfareCenterNews", welfareCenterNews);// 福利中心消息
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 更换昵称
|
| | | * 更换基础信息
|
| | | *
|
| | | * @param acceptData
|
| | | * @param nickName
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "saveInfo")
|
| | | public void saveInfo(AcceptData acceptData, String nickName, Long uid, PrintWriter out) {
|
| | | public void saveInfo(AcceptData acceptData, String nickName, String weiXin, Integer sex, Long uid, PrintWriter out) {
|
| | | try {
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | | }
|
| | | if (StringUtil.isNullOrEmpty(nickName)) {
|
| | | out.print(JsonUtil.loadFalseResult("昵称不能为空"));
|
| | | return;
|
| | | }
|
| | | if (nickName.length() > 200) {
|
| | | out.print(JsonUtil.loadFalseResult("昵称过长"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (maskKeyService.examineContent(nickName)) {
|
| | | out.print(JsonUtil.loadFalseResult("不能包含敏感词汇"));
|
| | | return;
|
| | | // 修改昵称
|
| | | if (!StringUtil.isNullOrEmpty(nickName)) {
|
| | | if (nickName.length() > 200) {
|
| | | out.print(JsonUtil.loadFalseResult("昵称过长"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (maskKeyService.examineContent(nickName)) {
|
| | | out.print(JsonUtil.loadFalseResult("不能包含敏感词汇"));
|
| | | return;
|
| | | }
|
| | | userInfoService.saveUserInfo(nickName, uid);
|
| | | }
|
| | |
|
| | | userInfoService.saveUserInfo(nickName, uid);
|
| | |
|
| | | |
| | | // 修改微信号
|
| | | if (!StringUtil.isNullOrEmpty(weiXin)) {
|
| | | if (weiXin.length() > 32) {
|
| | | out.print(JsonUtil.loadFalseResult("微信号过长"));
|
| | | return;
|
| | | }
|
| | | |
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra != null) {
|
| | | UserInfoExtra extra = new UserInfoExtra();
|
| | | extra.setId(userInfoExtra.getId());
|
| | | extra.setWeiXin(weiXin);
|
| | | userInfoExtraService.saveUserInfoExtra(extra);
|
| | | }
|
| | | }
|
| | | |
| | | // 修改性别
|
| | | if (sex != null && sex > 0 && sex < 3) {
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra != null) {
|
| | | UserInfoExtra extra = new UserInfoExtra();
|
| | | extra.setId(userInfoExtra.getId());
|
| | | extra.setSex(sex);
|
| | | userInfoExtraService.saveUserInfoExtra(extra);
|
| | | }
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult("保存成功"));
|
| | | } catch (UserInfoException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getMsg()));
|