| | |
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.NumberUtil;
|
| | | import org.yeshi.utils.wx.WXUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.taobao.api.ApiException;
|
| | | import com.yeshi.fanli.entity.admin.InviteGetMoney;
|
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsSecondClass;
|
| | | import com.yeshi.fanli.entity.bus.recommend.RecommendDetails;
|
| | | import com.yeshi.fanli.entity.bus.recommend.RecommendSectionDetail;
|
| | | import com.yeshi.fanli.entity.bus.recommend.RecommendSectionGoods;
|
| | | import com.yeshi.fanli.entity.bus.share.UserShareGoodsHistory;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBao;
|
| | | import com.yeshi.fanli.entity.bus.user.InviteUser;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSaleRank;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.entity.system.CustomerContent;
|
| | | import com.yeshi.fanli.entity.system.CustomerName;
|
| | | import com.yeshi.fanli.entity.system.System;
|
| | | 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.exception.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.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.config.InviteGetMoneyService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemClientParamsService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemConfigService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemService;
|
| | | import com.yeshi.fanli.service.inter.goods.ClassRecommendGoodsService;
|
| | | import com.yeshi.fanli.service.inter.goods.GoodsSecondClassService;
|
| | | import com.yeshi.fanli.service.inter.goods.RecommendDetailsService;
|
| | |
| | | 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.HongBaoService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.ThreeSaleRankService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.user.ScanHistoryService;
|
| | | import com.yeshi.fanli.service.inter.user.ShamUserService;
|
| | | import com.yeshi.fanli.service.inter.user.ShareManageService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.util.AESUtil;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | |
|
| | | @Resource
|
| | | private ShareManageService shareManageService;
|
| | |
|
| | | |
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | |
|
| | |
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | |
|
| | | @Resource
|
| | | private HongBaoService hongBaoService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | |
|
| | | @Resource
|
| | | private ThreeSaleRankService threeSaleRankService;
|
| | |
|
| | | @Resource
|
| | | private SystemService systemService;
|
| | | private BusinessSystemService businessSystemService;
|
| | |
|
| | | @Resource
|
| | | private SystemConfigService systemConfigService;
|
| | |
| | |
|
| | | @Resource
|
| | | private RedisManager redisManager;
|
| | |
|
| | | @Resource
|
| | | private InviteGetMoneyService inviteGetMoneyService;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoUnionConfigService taoBaoUnionConfigService;
|
| | |
| | | return "coupon";
|
| | | }
|
| | |
|
| | | @RequestMapping("findThreeSaleInfo")
|
| | | public void findThreeSaleInfo(long id, PrintWriter out) {
|
| | | int count = threeSaleSerivce.findInviteCount(id);
|
| | | double money = hongBaoService.findThreeSaleMoney(id);
|
| | | List<ThreeSaleRank> list = threeSaleRankService.rank(5);
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", count);
|
| | | data.put("money", money);
|
| | | data.put("list", list);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | @RequestMapping("findThreeFriendsCount")
|
| | | public void findThreeFriendsCount(long id, String callback, PrintWriter out) {
|
| | | int count1 = userInfoService.findFriendsCount(id, 1);
|
| | |
| | | } else {
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | }
|
| | |
|
| | | @RequestMapping("findThreeSales")
|
| | | public void findThreeSales(long id, PrintWriter out) {
|
| | | List<HongBao> list = hongBaoService.findThreeSaleHongBao(id);
|
| | | String json = JsonUtil.getApiCommonGson().toJson(list);
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("list", json);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "getConpon", method = RequestMethod.POST)
|
| | |
| | | public String threeShareRep(@PathVariable String uid, String code, String state, String packages, String platform,
|
| | | String ios, HttpSession httpSession, HttpServletRequest request) {
|
| | |
|
| | | System system = systemService.getSystem(platform, packages);
|
| | | BusinessSystem system = businessSystemService.getBusinessSystem(platform, packages);
|
| | | String wxState = (String) httpSession.getAttribute("wxState");
|
| | | // 通过配置参数获取
|
| | | String down = DOWNURL2;
|
| | |
| | | public String threeShareRepNew(@PathVariable String uid, String code, String state, String packages,
|
| | | String platform, String ios, HttpSession httpSession, HttpServletRequest request) {
|
| | |
|
| | | System system = systemService.getSystem(platform, packages);
|
| | | BusinessSystem system = businessSystemService.getBusinessSystem(platform, packages);
|
| | | String wxState = (String) httpSession.getAttribute("wxState");
|
| | | // 通过配置参数获取
|
| | | String down = DOWNURL2;
|
| | |
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "shareSubmit", method = RequestMethod.POST)
|
| | | public void getShareSubmit(long uid, String share, PrintWriter out) {
|
| | | String uidStr = StringUtil.getFromBase64(share);
|
| | | boolean b = NumberUtil.isNumeric(uidStr);
|
| | | if (!b) {
|
| | | out.print(JsonUtil.loadTrueResult("0")); // 不存在该邀请码
|
| | | return;
|
| | | }
|
| | | long inviterId = Long.parseLong(uidStr);
|
| | | int type = shareManageService.addShareManage(inviterId, uid);
|
| | | if (type == -1) {
|
| | | out.print(JsonUtil.loadTrueResult("-1")); // 邀请者与被邀请者不能相同
|
| | | return;
|
| | | } else if (type == 0) {
|
| | | out.print(JsonUtil.loadTrueResult("0")); // 不存在该邀请码
|
| | | return;
|
| | | } else if (type == 2) {
|
| | | out.print(JsonUtil.loadTrueResult("2")); // 被邀请者不是新用户
|
| | | return;
|
| | | } else if (type == 3) {
|
| | | out.print(JsonUtil.loadTrueResult("3")); // 被邀请者已存在
|
| | | return;
|
| | | } else {
|
| | | out.print(JsonUtil.loadTrueResult("1")); // 添加成功
|
| | | }
|
| | | }
|
| | |
|
| | | @RequestMapping("details")
|
| | |
| | | out.print(JsonUtil.loadTrueResult(customerContent.getContent().replace("\n", "<br>")));
|
| | | }
|
| | |
|
| | | @RequestMapping("getInviteInfo")
|
| | | public void getInviteInfo(PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | |
|
| | | String key = "activityRules";
|
| | | com.yeshi.fanli.entity.system.System system = new System();
|
| | | system.setCreatetime(java.lang.System.currentTimeMillis());
|
| | | system.setPlatform(1);
|
| | | system.setId(4L);
|
| | | SystemClientParams values = systemClientParamsService.getSystemClientParamsBySystemAndKey(system, key);
|
| | | // 转换换行符 给前端
|
| | | String valueN = values.getValue();
|
| | | String valueBr = valueN;
|
| | |
|
| | | String[] sts = valueBr.split("\n");
|
| | | JSONArray array = new JSONArray();
|
| | | for (String st : sts)
|
| | | array.add(st);
|
| | |
|
| | | data.put("activityRules", array);
|
| | |
|
| | | List<InviteGetMoney> inviteGetMoneyList = inviteGetMoneyService.inviteGetMoneyList(0, "");
|
| | |
|
| | | // 名字*处理
|
| | | for (InviteGetMoney inviteGetMoney : inviteGetMoneyList) {
|
| | |
|
| | | String name = inviteGetMoney.getName();
|
| | | if (name != null) {
|
| | | if (name.length() > 2) {
|
| | | name = Utils.getStarString(name, 1, name.length() - 1);
|
| | | } else {
|
| | | name = name.substring(0, 1) + "**" + name.substring(name.length() - 1);
|
| | | }
|
| | | }
|
| | | inviteGetMoney.setName(name);
|
| | | }
|
| | |
|
| | | data.put("inviteGetMoneyList", JsonUtil.getSimpleGsonWithDate().toJson(inviteGetMoneyList));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取邀请有奖的规则
|
| | | *
|
| | |
| | | @RequestMapping("getinviteactivityrules")
|
| | | public void getInviteActivityRules(String callback, PrintWriter out) {
|
| | | String key = "activityRules"; // key值
|
| | | com.yeshi.fanli.entity.system.System system = new System();
|
| | | com.yeshi.fanli.entity.system.BusinessSystem system = new BusinessSystem();
|
| | | system.setCreatetime(java.lang.System.currentTimeMillis());
|
| | | system.setPlatform(1);
|
| | | system.setId(4L);
|