| | |
| | | @Resource
|
| | | private HongBaoV2CountService hongBaoV2CountService;
|
| | |
|
| | | |
| | | /**
|
| | | * 查询用户信息列表 正常用户/异常用户
|
| | | *
|
| | | * @param callback
|
| | | * @param pageIndex
|
| | | * @param key
|
| | | * 查询条件
|
| | | * @param userType
|
| | | * 用户类型:金冠、银冠、铜冠
|
| | | * @param days
|
| | | * 查询天数
|
| | | * @param startTime
|
| | | * 注册时间
|
| | | * @param endTime
|
| | | * 注册时间
|
| | | * @param orderMode
|
| | | * 排序方式 订单数量 今日订单 累计队员
|
| | | * @param key 查询条件
|
| | | * @param userType 用户类型:金冠、银冠、铜冠
|
| | | * @param days 查询天数
|
| | | * @param startTime 注册时间
|
| | | * @param endTime 注册时间
|
| | | * @param orderMode 排序方式 订单数量 今日订单 累计队员
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "query")
|
| | | public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer keyType, Integer rank,Integer userType,
|
| | | Integer days, String startTime, String endTime, Integer orderMode, Integer type,String level,
|
| | | Integer activeCode, PrintWriter out) {
|
| | | public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer keyType, Integer rank,
|
| | | Integer userType, Integer days, String startTime, String endTime, Integer orderMode, Integer type,
|
| | | String level, Integer activeCode, PrintWriter out) {
|
| | | try {
|
| | | if (type == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户类型type不能为空"));
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | long count = userInfoService.queryCount(type, key, keyType, userRank, days, startTime, endTime,userType, level, activeCode);
|
| | | long count = userInfoService.queryCount(type, key, keyType, userRank, days, startTime, endTime, userType,
|
| | | level, activeCode);
|
| | |
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
| | |
|
| | | /**
|
| | | * 用户基础信息查询
|
| | | * |
| | | * @param callback
|
| | | * @param pageIndex
|
| | | * @param pageSize
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "queryInfo")
|
| | | public void queryInfo(String callback, Integer pageIndex, Integer pageSize, String key, Integer keyType, Integer rank,Integer userType,
|
| | | Integer days, String startTime, String endTime, Integer state,String level,
|
| | | public void queryInfo(String callback, Integer pageIndex, Integer pageSize, String key, Integer keyType,
|
| | | Integer rank, Integer userType, Integer days, String startTime, String endTime, Integer state, String level,
|
| | | Integer activeCode, PrintWriter out) {
|
| | | try {
|
| | | if (pageIndex == null)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | List<UserInfoVO> userList = userInfoService.queryInfo((pageIndex - 1) * pageSize, pageSize, state, key, keyType,
|
| | | userRank, days, startTime, endTime, userType, level, activeCode);
|
| | | List<UserInfoVO> userList = userInfoService.queryInfo((pageIndex - 1) * pageSize, pageSize, state, key,
|
| | | keyType, userRank, days, startTime, endTime, userType, level, activeCode);
|
| | |
|
| | | if (userList == null || userList.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无相关数据"));
|
| | | return;
|
| | | }
|
| | |
|
| | | long count = userInfoService.countInfo(state, key, keyType, userRank, days, startTime, endTime,userType, level, activeCode);
|
| | | long count = userInfoService.countInfo(state, key, keyType, userRank, days, startTime, endTime, userType,
|
| | | level, activeCode);
|
| | |
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 资金统计
|
| | | * |
| | | * @param callback
|
| | | * @param uid
|
| | | * @param out
|
| | |
| | | minDate = new Date(0L);
|
| | | maxDate = new Date(timeStamp);
|
| | | // 累计成功提现
|
| | | BigDecimal totalExtractMoney = userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate,
|
| | | maxDate, 1).abs();
|
| | | BigDecimal totalExtractMoney = userMoneyDetailService
|
| | | .statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate, 1).abs();
|
| | | // 提现中金额
|
| | | BigDecimal extractingMoney = extractService.sumVerifyingMoney(uid);
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 权益统计
|
| | | * |
| | | * @param callback
|
| | | * @param uid
|
| | | * @param out
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 用户粉丝统计
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 用户详细信息
|
| | | * |
| | | * @param callback
|
| | | * @param uid
|
| | | * @param out
|
| | |
| | | @RequestMapping(value = "getInfoDetail")
|
| | | public void getInfoDetail(String callback, Long uid, PrintWriter out) {
|
| | |
|
| | | UserInfo user = userInfoService.getUserByIdWithMybatis(uid);
|
| | | UserInfo user = userInfoService.selectByPKey(uid);
|
| | | UserInfoVO userInfoVO = new UserInfoVO();
|
| | | userInfoVO.setId(uid);
|
| | | userInfoVO.setPhone(user.getPhone());
|
| | | userInfoVO.setState(user.getState());
|
| | | userInfoVO.setCreatetime(user.getCreatetime());
|
| | |
| | | }
|
| | | userInfoVO.setInviteCode(userInfoExtra.getInviteCode());
|
| | | userInfoVO.setInviteCodeVip(userInfoExtra.getInviteCodeVip());
|
| | | userInfoVO.setWxId(userInfoExtra.getWeiXin());
|
| | | }
|
| | |
|
| | | // 最近一次下单时间
|
| | |
| | | }
|
| | |
|
| | | // 显示用户微信 淘宝 老版本存在
|
| | | String wxUnionId = user.getWxUnionId();
|
| | | if (wxUnionId == null || wxUnionId.trim().length() == 0) {
|
| | | user.setWxName(null);
|
| | | String wxId = userInfoVO.getWxId();
|
| | | if (wxId == null) {
|
| | | userInfoVO.setWxId("");
|
| | | }
|
| | | user.setWxName(user.getWxUnionId());
|
| | | |
| | |
|
| | | // 是否绑定支付宝(购买 + 分享权限)
|
| | | UserExtraTaoBaoInfo extraTaoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid);
|
| | | if (extraTaoBaoInfo != null) {
|
| | | String taoBaoUid = extraTaoBaoInfo.getTaoBaoUid();
|
| | | String specialId = extraTaoBaoInfo.getSpecialId();
|
| | | String relationId = extraTaoBaoInfo.getRelationId();
|
| | |
| | | } else {
|
| | | userInfoVO.setTbName(extraTaoBaoInfo.getTaoBaoNickName());
|
| | | userInfoVO.setTaoBaoUid(extraTaoBaoInfo.getTaoBaoUid());
|
| | | }
|
| | | }
|
| | |
|
| | | /* 绑定收款账号信息 */
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(userInfoVO));
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 绑定详情
|
| | | * |
| | | * @param callback
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getBindDetail")
|
| | | public void getBindDetail(String callback, Long uid, PrintWriter out) {
|
| | | UserInfo user = userInfoService.selectByPKey(uid);
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | |
| | | Integer state = user.getState();
|
| | | if (state == UserInfo.STATE_FORBIDDEN) {
|
| | | data.put("state", false);
|
| | | } else {
|
| | | data.put("state", true);
|
| | | }
|
| | | |
| | | data.put("phone", user.getPhone());
|
| | | |
| | | // 微信授权
|
| | | String wxUnionId = user.getWxUnionId();
|
| | | if(StringUtil.isNullOrEmpty(wxUnionId)) {
|
| | | data.put("wxName", "");
|
| | | data.put("wxState", false);
|
| | | } else {
|
| | | data.put("wxName", user.getWxName());
|
| | | data.put("wxnState", true);
|
| | | }
|
| | | |
| | | String mark = "";
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra != null) {
|
| | | if (!StringUtil.isNullOrEmpty(userInfoExtra.getMark())) {
|
| | | mark = userInfoExtra.getMark();
|
| | | }
|
| | | }
|
| | | data.put("mark", mark);
|
| | | |
| | | |
| | | // 淘宝授权
|
| | | String tbName = "";
|
| | | boolean tbState = false;
|
| | | UserExtraTaoBaoInfo extraTaoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid);
|
| | | if (extraTaoBaoInfo != null) {
|
| | | String taoBaoUid = extraTaoBaoInfo.getTaoBaoUid();
|
| | | String specialId = extraTaoBaoInfo.getSpecialId();
|
| | | String relationId = extraTaoBaoInfo.getRelationId();
|
| | | if (!StringUtil.isNullOrEmpty(taoBaoUid) && StringUtil.isNullOrEmpty(specialId) && StringUtil.isNullOrEmpty(relationId)) {
|
| | | tbState = true;
|
| | | tbName = extraTaoBaoInfo.getTaoBaoNickName();
|
| | | }
|
| | | }
|
| | | data.put("tbName", tbName);
|
| | | data.put("tbState", tbState);
|
| | | |
| | | /* 绑定收款账号信息 */
|
| | | String accountName = "";
|
| | | boolean accountState = false;
|
| | | List<BindingAccount> account = bindingAccountService.getBindingAccountByUid(uid);
|
| | | if (account != null && account.size() > 0) {
|
| | | BindingAccount bindingAccount = account.get(0);
|
| | | Integer type = bindingAccount.getType();
|
| | | // 支付宝
|
| | | if (type != null && type == 1) {
|
| | | accountState = true;
|
| | | accountName = bindingAccount.getName();
|
| | | } |
| | | }
|
| | | data.put("accountName", accountName);
|
| | | data.put("accountState", accountState);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 统计今日用户总情况
|
| | |
| | | * // 统计所有总金额 BigDecimal countTotalMoney =
|
| | | * userInfoCountService.countAllMoney(null);
|
| | | *
|
| | | * // 统计所有可提现金额 String minMoney =
|
| | | * configService.get(Constant.EXTRACT_MIN_MONEY); if (minMoney ==
|
| | | * null) { minMoney = "20"; } double min =
|
| | | * // 统计所有可提现金额 String minMoney = configService.get(Constant.EXTRACT_MIN_MONEY);
|
| | | * if (minMoney == null) { minMoney = "20"; } double min =
|
| | | * Double.parseDouble(minMoney); BigDecimal countCanAssets =
|
| | | * userInfoCountService.countAllMoney(min);
|
| | | * data.put("countTotalMoney", countTotalMoney);
|
| | | * data.put("countCanAssets", countCanAssets);
|
| | | * userInfoCountService.countAllMoney(min); data.put("countTotalMoney",
|
| | | * countTotalMoney); data.put("countCanAssets", countCanAssets);
|
| | | */
|
| | |
|
| | | // 今日新增用户数量
|
| | |
| | | /**
|
| | | *
|
| | | * @param data
|
| | | * @param uid
|
| | | * 用户ID
|
| | | * @param type
|
| | | * 需要解绑的账户类型
|
| | | * @param uid 用户ID
|
| | | * @param type 需要解绑的账户类型
|
| | | */
|
| | | @RequestMapping("unBindUserInfo")
|
| | | public void unBindUserInfo(String callback, Long uid, String typeArray, PrintWriter out) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | /**
|
| | | * 修改用户备注
|
| | | * |
| | | * @param callback
|
| | | * @param uid
|
| | | * @param mark
|
| | |
| | |
|
| | | /**
|
| | | * 删除用户-改变其状态
|
| | | * |
| | | * @param callback
|
| | | * @param idArray
|
| | | * @param out
|
| | |
| | | }
|
| | |
|
| | | Gson gson = new Gson();
|
| | | List<Long> list = gson.fromJson(idArray, new TypeToken<ArrayList<Long>>() {}.getType());
|
| | | List<Long> list = gson.fromJson(idArray, new TypeToken<ArrayList<Long>>() {
|
| | | }.getType());
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("未检测到删除的数据"));
|
| | | return;
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 封禁用户ID
|
| | |
| | | *
|
| | | * @param callback
|
| | | * @param code
|
| | | * @param type
|
| | | * 1("微信unionId"), 2("淘宝ID"), 3("手机号"), 4("支付宝账号");
|
| | | * @param type 1("微信unionId"), 2("淘宝ID"), 3("手机号"), 4("支付宝账号");
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "saveForbiddenInfo")
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | /**
|
| | | * 队员关系
|
| | |
| | | UserInfo worker = threeSale.getWorker();
|
| | | threeSale.setWorker(userInfoService.selectByPKey(worker.getId()));
|
| | |
|
| | | |
| | | Integer expire = threeSale.getExpire();
|
| | | if (threeSale.getState()) {
|
| | | threeSale.setExpire(1); // 邀请成功
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | long count = 0;
|
| | | if (type == 0) {
|
| | |
| | | /**
|
| | | * 根据渠道 统计当日新增用户数量
|
| | | *
|
| | | * @param channelArray
|
| | | * 名字数组
|
| | | * @param dateType
|
| | | * 类型 1日 2月 3年
|
| | | * @param year
|
| | | * 2018
|
| | | * @param startTime
|
| | | * 2018-12-01
|
| | | * @param endTime
|
| | | * 2018-12-01
|
| | | * @param channelArray 名字数组
|
| | | * @param dateType 类型 1日 2月 3年
|
| | | * @param year 2018
|
| | | * @param startTime 2018-12-01
|
| | | * @param endTime 2018-12-01
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getNewUserCharts")
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | private List<Object> getNewUserData(List<String> dateList, Integer dateType, Date beginDate, Date endDate, String channel) {
|
| | | private List<Object> getNewUserData(List<String> dateList, Integer dateType, Date beginDate, Date endDate,
|
| | | String channel) {
|
| | | List<Object> list = new ArrayList<>();
|
| | | List<CountUserInfo> listHistory = userInfoCountService.getNewUserData(beginDate, endDate, channel);
|
| | | for (String date: dateList) {
|
| | |
| | | /**
|
| | | * 根据渠道 统计当日新增用户数量
|
| | | *
|
| | | * @param channelArray
|
| | | * 名字数组
|
| | | * @param dateType
|
| | | * 类型 1日 2月 3年
|
| | | * @param year
|
| | | * 2018
|
| | | * @param startTime
|
| | | * 2018-12-01
|
| | | * @param endTime
|
| | | * 2018-12-01
|
| | | * @param channelArray 名字数组
|
| | | * @param dateType 类型 1日 2月 3年
|
| | | * @param year 2018
|
| | | * @param startTime 2018-12-01
|
| | | * @param endTime 2018-12-01
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getTodayBuyRate")
|
| | |
| | | JSONArray line_list = new JSONArray();
|
| | | for (String channel : channelList) {
|
| | |
|
| | | List<ChartTDO> list = userInfoCountService.getTodayBuyRate(channel, dateType, year,
|
| | | startTime, endTime);
|
| | | List<ChartTDO> list = userInfoCountService.getTodayBuyRate(channel, dateType, year, startTime, endTime);
|
| | |
|
| | | if ("all".equalsIgnoreCase(channel)) {
|
| | | channel = "总计";
|
| | |
| | | * 当周产生3单的新增用户概率
|
| | | *
|
| | | * @param callback
|
| | | * @param channelArray
|
| | | * 渠道名称
|
| | | * @param channelArray 渠道名称
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @param orderNum
|
| | | * 订单数量
|
| | | * @param orderNum 订单数量
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getWeekBuyRate")
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 获取金币排行榜
|
| | | * |
| | | * @param callback
|
| | | * @param pageIndex
|
| | | * @param pageSize
|
| | |
| | | if(list == null)
|
| | | list = new ArrayList<>();
|
| | |
|
| | |
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 获取金币排行榜
|
| | | * |
| | | * @param callback
|
| | | * @param pageIndex
|
| | | * @param pageSize
|
| | |
| | | gsonBuilder.serializeNulls();
|
| | | Gson gson = gsonBuilder.setDateFormat("yyyy/MM/dd HH:mm:ss").create();
|
| | |
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("list", gson.toJson(list));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | *
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "queryVip")
|
| | | public void queryVip(String callback, Integer pageIndex, Integer pageSize, String key, Integer state, PrintWriter out) {
|
| | | public void queryVip(String callback, Integer pageIndex, Integer pageSize, String key, Integer state,
|
| | | PrintWriter out) {
|
| | | try {
|
| | | List<UserVIPInfo> list = userVIPInfoService.listQuery(pageIndex, pageSize, key, state);
|
| | | if (list == null || list.size() == 0) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | /**
|
| | | * 超级会员升级通过
|
| | | * |
| | | * @param callback
|
| | | * @param id
|
| | | * @param out
|
| | |
| | | }
|
| | | userVIPInfoService.passVIPApply(id);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
|
| | | LogHelper.userInfo("[ip:" + IPUtil.getRemotIP(request) + "]" + admin.getName() + "通过了[id=" + id + "]的升级超级会员申请!");
|
| | | LogHelper.userInfo(
|
| | | "[ip:" + IPUtil.getRemotIP(request) + "]" + admin.getName() + "通过了[id=" + id + "]的升级超级会员申请!");
|
| | | } catch (UserVIPInfoException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | return;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 超级会员升级拒绝
|
| | | * |
| | | * @param callback
|
| | | * @param id
|
| | | * @param reason
|
| | |
| | | }
|
| | | userVIPInfoService.rejectVIPApply(id, reason);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("拒绝成功"));
|
| | | LogHelper.userInfo("[ip:" + IPUtil.getRemotIP(request) + "][管理员:" + admin.getName() + "] 拒绝提现id=" + id + "的升级超级会员申请不存在!");
|
| | | LogHelper.userInfo("[ip:" + IPUtil.getRemotIP(request) + "][管理员:" + admin.getName() + "] 拒绝提现id=" + id
|
| | | + "的升级超级会员申请不存在!");
|
| | | } catch (UserVIPInfoException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | return;
|
| | |
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | /**
|
| | | * 用户账户明细
|
| | |
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
|
| | | GsonBuilder gsonBuilder = new GsonBuilder().setDateFormat("yyyy-MM-dd HH:mm:ss");
|
| | | gsonBuilder.registerTypeAdapter(UserMoneyDetailTypeEnum.class, new JsonSerializer<UserMoneyDetailTypeEnum>() {
|
| | | gsonBuilder.registerTypeAdapter(UserMoneyDetailTypeEnum.class,
|
| | | new JsonSerializer<UserMoneyDetailTypeEnum>() {
|
| | | @Override
|
| | | public JsonElement serialize(UserMoneyDetailTypeEnum value, Type theType, JsonSerializationContext context) {
|
| | | public JsonElement serialize(UserMoneyDetailTypeEnum value, Type theType,
|
| | | JsonSerializationContext context) {
|
| | | if (value == null) {
|
| | | return new JsonPrimitive("");
|
| | | } else {
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("查询失败"));
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | |
| | | |
| | |
|
| | |
|
| | | }
|
| | |
| | |
|
| | | // 云发单链接
|
| | | if (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | boolean cloudOpen = configService.isRobotCloudOpen();
|
| | | boolean cloudOpen = configService.isRobotCloudOpen(ConfigKeyEnum.robotCloudOpen.getKey());
|
| | | if (!cloudOpen && uid != null) {
|
| | | List<String> testUsers = configService.getTestUsers();
|
| | | if (testUsers != null && testUsers.contains(uid+"")) {
|
| | |
| | | } else if (list.size() > 0) { // 活动图片不允许跳转 |
| | | |
| | | // 云发单是否开启 |
| | | boolean cloudOpen = configService.isRobotCloudOpen(); |
| | | boolean cloudOpen = configService.isRobotCloudOpen(ConfigKeyEnum.robotCloudOpenCircle.getKey()); |
| | | if (!cloudOpen && uid != null) { |
| | | List<String> testUsers = configService.getTestUsers(); |
| | | if (testUsers != null && testUsers.contains(uid+"")) { |
| | |
| | | */
|
| | | private void getCloudInfo(AcceptData acceptData,Long uid, GoodsDetailVO goodsDetail, GoodsDetailExtraVO extraVO) {
|
| | | // 云发单是否开启
|
| | | boolean cloudOpen = configService.isRobotCloudOpen();
|
| | | boolean cloudOpen = configService.isRobotCloudOpen(ConfigKeyEnum.robotCloudOpenGoodsDetail.getKey());
|
| | | if (!cloudOpen && uid != null) {
|
| | | List<String> testUsers = configService.getTestUsers();
|
| | | if (testUsers != null && testUsers.contains(uid+"")) {
|
| | |
| | | }
|
| | | extraVO.setCloudOpen(cloudOpen);
|
| | |
|
| | | if (!goodsDetail.isHasCoupon()) {
|
| | | // 无券或者未开启发圈
|
| | | if (!goodsDetail.isHasCoupon() || !cloudOpen) {
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.exception.user.cloud.UserCloudException;
|
| | | import com.yeshi.fanli.exception.user.cloud.UserCloudGroupException;
|
| | | import com.yeshi.fanli.exception.user.cloud.UserCloudOrderException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.dynamic.GoodsEvaluateService;
|
| | |
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.aitaoker.AitaokerApiUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestSerializableByKey;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.util.suning.SuningUtil;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | |
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestSerializableByKey(key = "'getQrcodeMaclogin-'+#uid")
|
| | | @RequestMapping(value = "getQrcodeMaclogin")
|
| | | public void getQrcodeMaclogin(String callback, AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | if (uid == null) {
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | UserCloud userCloud = userCloudService.getValidByUid(uid);
|
| | | if (userCloud == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "请先开通云发单"));
|
| | | return;
|
| | | }
|
| | | |
| | | try {
|
| | | // 重新获取群列表
|
| | | userCloudService.searchGroup(uid);
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | UserCloud userCloud = userCloudService.getValidByUid(uid);
|
| | | if (userCloud == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "请先开通云发单"));
|
| | | return;
|
| | | }
|
| | | |
| | | boolean reslut = false;
|
| | | if (state == 1) {
|
| | | reslut = true;
|
| | | }
|
| | |
|
| | | try {
|
| | | |
| | | |
| | | userCloudGroupService.switchGroupState(uid, id, reslut);
|
| | | // 获取最新群
|
| | | List<UserCloudGroup> list = userCloudGroupService.listGroupByUid(uid);
|
| | |
| | | List<Criteria> list = new ArrayList<Criteria>(); |
| | | list.add(Criteria.where("dynamicType").is(1)); |
| | | list.add(Criteria.where("state").is(1)); |
| | | list.add(Criteria.where("imgList.goods.goodsId").is(goodsId)); |
| | | list.add(Criteria.where("imgList.goods.goodsType").is(goodsType)); |
| | | list.add(Criteria.where("goods.goodsId").is(goodsId)); |
| | | list.add(Criteria.where("goods.goodsType").is(goodsType)); |
| | | // 限制时间内 |
| | | list.add(Criteria.where("startTime").gte(limitTime)); |
| | | |
| | |
| | | |
| | | public interface UserCloudManageMapper extends BaseMapper<UserCloudManage> { |
| | | |
| | | /** |
| | | * 查询更新 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | UserCloudManage selectForUpdate(long id); |
| | | } |
| | |
| | |
|
| | | public final static int TYPE_STORE = 1; // 商品库
|
| | | public final static int TYPE_EVALUATE = 2; // 发圈内容
|
| | | public final static int TYPE_PUSH = 3; // 站内推送消息
|
| | |
|
| | | private Long uid;// 用户ID
|
| | | private String id;// 发圈id 、 商品库id
|
| | | private Integer type;// 类型
|
| | |
|
| | | public UserCloudMQMsg(Long uid, Integer type) {
|
| | | super();
|
| | | this.uid = uid;
|
| | | this.type = type;
|
| | | }
|
| | | |
| | | public UserCloudMQMsg(Long uid, String id, Integer type) {
|
| | | super();
|
| | | this.uid = uid;
|
| | |
| | | */
|
| | | public class HDKGoodsListResultDTO {
|
| | | private List<HDKGoodsDetail> goodsList;
|
| | | private List<HDKWXCircleContentDTO> list;
|
| | | private Integer minId;
|
| | | |
| | | public HDKGoodsListResultDTO() {
|
| | | |
| | | }
|
| | |
|
| | | public HDKGoodsListResultDTO(List<HDKGoodsDetail> goodsList, Integer minId) {
|
| | | super();
|
| | |
| | | public void setMinId(Integer minId) {
|
| | | this.minId = minId;
|
| | | }
|
| | |
|
| | | public List<HDKWXCircleContentDTO> getList() {
|
| | | return list;
|
| | | }
|
| | |
|
| | | public void setList(List<HDKWXCircleContentDTO> list) {
|
| | | this.list = list;
|
| | | }
|
| | | }
|
| | |
| | | rejectVIPApply("超级会员","http://img.flqapp.com/resource/msg/icon_msg_vip.png"),
|
| | | teamVIPCallBoss ("温馨提醒","http://img.flqapp.com/resource/msg/icon_msg_notify.png"),
|
| | | teamSplitCallBoss ("邀请脱离","http://img.flqapp.com/resource/msg/icon_msg_invite_break.png"),
|
| | | cloudWX("云发单","http://img.flqapp.com/resource/msg/icon_msg_other_cloud.png"),
|
| | | vipUpgradeReward("系统赠送","http://img.flqapp.com/resource/msg/icon_msg_vip.png");
|
| | |
|
| | | private final String desc;
|
| | |
| | | @Column(name = "ucm_custom")
|
| | | private Boolean custom; // 状态
|
| | |
|
| | | @Column(name = "ucm_offline_notice")
|
| | | private Boolean offlineNotice; // 掉线通知
|
| | |
|
| | | @Column(name = "ucm_create_time")
|
| | | private Date createTime;
|
| | |
|
| | |
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | public Boolean getOfflineNotice() {
|
| | | return offlineNotice;
|
| | | }
|
| | |
|
| | | public void setOfflineNotice(Boolean offlineNotice) {
|
| | | this.offlineNotice = offlineNotice;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | |
| | | testUserArray("test_user_array","测试用户数组"), |
| | | |
| | | robotCloudOpen("robot_cloud_open","云发单是否开启"), |
| | | robotCloudLink("robot_cloud_link","云发单链接"), |
| | | robotCloudOpen("robot_cloud_open","云发单是否开启-我的界面"), |
| | | robotCloudOpenCircle("robot_cloud_open_circle","云发单是否开启-发圈界面"), |
| | | robotCloudOpenGoodsDetail("robot_cloud_open_goods_detail","云发单是否开启-商品详情"), |
| | | robotCloudGroupPictureNum("robot_cloud_group_picture_num","云发单群图片数量"), |
| | | |
| | | |
| | | cloudAlipayJumpLink("cloud_alipay_jump_link","云发单支付跳转地址"), |
| | | cloudAlipayReturnLink("cloud_alipay_return_link","云发单支付成功后返回哪个前端页面"), |
| | | cloudAlipayNotifyLink("cloud_alipay_notify_link","云发单支付成功后回调地址"); |
| | |
| | | @Field
|
| | | private Integer commission;// 佣金金额,单位为分
|
| | |
|
| | | private String circleText;// 朋友圈文案,需要url解码后使用
|
| | | |
| | | |
| | |
|
| | | public Integer getCommission() {
|
| | | return commission;
|
| | | }
|
| | |
| | | public void setTbcid(Integer tbcid) {
|
| | | this.tbcid = tbcid;
|
| | | }
|
| | |
|
| | | public String getCircleText() {
|
| | | return circleText;
|
| | | }
|
| | |
|
| | | public void setCircleText(String circleText) {
|
| | | this.circleText = circleText;
|
| | | }
|
| | | }
|
| | |
| | | package com.yeshi.fanli.job;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.net.URLDecoder;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.apache.commons.lang.StringEscapeUtils;
|
| | | import org.springframework.scheduling.annotation.Scheduled;
|
| | | import org.springframework.stereotype.Component;
|
| | | import org.yeshi.utils.DateUtil;
|
| | |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.dto.dataoke.DaTaoKeGoodsResult;
|
| | | import com.yeshi.fanli.dto.taobao.haodanku.HDKGoodsListResultDTO;
|
| | | import com.yeshi.fanli.dto.taobao.haodanku.HDKWXCircleContentDTO;
|
| | | import com.yeshi.fanli.entity.bus.activity.ActivityRuleUser;
|
| | | import com.yeshi.fanli.entity.bus.activity.ActivityUser;
|
| | | import com.yeshi.fanli.entity.bus.activity.RecommendActivity;
|
| | |
| | | import com.yeshi.fanli.entity.goods.jd.NYouHuiGoods;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | | import com.yeshi.fanli.entity.taobao.haodanku.HDKGoodsDetail;
|
| | | import com.yeshi.fanli.exception.dynamic.GoodsEvaluateException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.activity.ActivityService;
|
| | |
| | |
|
| | |
|
| | | /**
|
| | | * 好单库商品加入发圈
|
| | | */
|
| | | @XxlJob("dynamic-insertEvaluate")
|
| | | public ReturnT<String> insertEvaluate(String param) throws Exception {
|
| | | try {
|
| | | boolean addGoods = false;
|
| | | Integer minId = 1;
|
| | | while (minId != null) {
|
| | | HDKGoodsListResultDTO dto = HaoDanKuApiUtil.getInstance().listHotGoods(minId, 100, 1, null);
|
| | | if (dto != null) {
|
| | | minId = dto.getMinId();
|
| | | addGoods = addGoodsEvaluate(dto.getGoodsList());
|
| | | } else {
|
| | | minId = null;
|
| | | }
|
| | | |
| | | if(addGoods) {
|
| | | break;
|
| | | }
|
| | | }
|
| | | |
| | | // 大淘客备用
|
| | | if (!addGoods) {
|
| | | DaTaoKeGoodsResult result = DaTaoKeApiUtil.getRankingList(DaTaoKeApiUtil.RANK_TYPE_TIME, null);
|
| | | if (result != null) {
|
| | | List<DaTaoKeDetailV2> detailList = result.getGoodsList();
|
| | | if (detailList != null && detailList.size() > 0) {
|
| | | for (DaTaoKeDetailV2 daTaoKeV2: detailList) {
|
| | | if(goodsEvaluateService.addByDaTaoKeGoods(daTaoKeV2))
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | | |
| | | |
| | | private boolean addGoodsEvaluate(List<HDKGoodsDetail> hdkList) {
|
| | | if (hdkList == null || hdkList.size() == 0) {
|
| | | return false;
|
| | | }
|
| | | for (HDKGoodsDetail hdkGoods: hdkList) {
|
| | | try {
|
| | | Long itemid = hdkGoods.getItemid();
|
| | | String itemdesc = hdkGoods.getItemdesc();
|
| | | List<ActivityRuleUser> ruleList = activityUserService.listByRuleCode(ActivityRuleUser.RULE_HAOHUO, 1, 20);
|
| | | ActivityUser user = ruleList.get((int) (ruleList.size() * Math.random())).getActivityUser();
|
| | | goodsEvaluateService.addGoodsEvaluate(itemid + "", null, user, itemdesc, null, new Date());
|
| | | return true;
|
| | | } catch (GoodsEvaluateException e) {
|
| | | e.printStackTrace();
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | | |
| | |
|
| | | |
| | | /**
|
| | | * 每一个小时随机在分享数的基础上加10~100。增加的时间段是每天8~22点。
|
| | | * 早上6,7,15,16,21,22,23点更新1次
|
| | | */
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 商品加入发圈
|
| | | */
|
| | | @XxlJob("dynamic-insertEvaluate")
|
| | | public ReturnT<String> insertEvaluate(String param) throws Exception {
|
| | | // 好单库
|
| | | boolean addResult = addHDKListSelected();
|
| | | // 大淘客备用
|
| | | if (!addResult) {
|
| | | addDTKFriendsFircleList();
|
| | | }
|
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 好单库商品加入发圈
|
| | | * @return
|
| | | */
|
| | | private boolean addHDKListSelected () {
|
| | | boolean addResult = false;
|
| | | Integer minId = 1;
|
| | | while (minId != null) {
|
| | | HDKGoodsListResultDTO dto = HaoDanKuApiUtil.getInstance().listSelected(minId);
|
| | | if (dto == null) {
|
| | | minId = null;
|
| | | } else {
|
| | | minId = dto.getMinId();
|
| | | List<HDKWXCircleContentDTO> list = dto.getList();
|
| | | if (list== null || list.size() == 0) {
|
| | | continue;
|
| | | }
|
| | | |
| | | for (HDKWXCircleContentDTO hdkGoods: list) {
|
| | | try {
|
| | | String itemid = hdkGoods.getItemid();
|
| | | List<String> pics = hdkGoods.getItempic();
|
| | | String copy_content = hdkGoods.getCopy_content();
|
| | | |
| | | String showtitle = StringEscapeUtils.unescapeHtml(copy_content);
|
| | | showtitle = showtitle.replace("<br>", "\r\n");
|
| | | |
| | | List<ActivityRuleUser> ruleList = activityUserService.listByRuleCode(ActivityRuleUser.RULE_HAOHUO, 1, 20);
|
| | | ActivityUser user = ruleList.get((int) (ruleList.size() * Math.random())).getActivityUser();
|
| | | goodsEvaluateService.addGoodsEvaluate2(itemid, pics, user, showtitle, null);
|
| | | addResult = true;
|
| | | break;
|
| | | } catch (GoodsEvaluateException e) {
|
| | | e.printStackTrace();
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | | if(addResult)
|
| | | break;
|
| | | }
|
| | | return addResult;
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 大淘客商品加入发圈
|
| | | * @return
|
| | | */
|
| | | private boolean addDTKFriendsFircleList() {
|
| | | boolean addResult = false;
|
| | | try {
|
| | | DaTaoKeGoodsResult result = DaTaoKeApiUtil.getFriendsFircleList("1", 100);
|
| | | while (result.getGoodsList() != null && result.getGoodsList().size() > 0) {
|
| | | for (DaTaoKeDetailV2 v2 : result.getGoodsList()) {
|
| | | try {
|
| | | Long goodsId = v2.getGoodsId();
|
| | | String circleText = v2.getCircleText();
|
| | | if (circleText == null) {
|
| | | continue;
|
| | | }
|
| | | String showtitle = URLDecoder.decode(circleText, "UTF-8");
|
| | | showtitle = showtitle.replace(" ", " ");
|
| | |
|
| | | ActivityUser user = null;
|
| | | if (v2.getCid() != null) {
|
| | | user = activityUserService.getRandomByDaTaoKeCid(v2.getCid());
|
| | | }
|
| | | if (user == null) {
|
| | | List<ActivityRuleUser> ruleList = activityUserService
|
| | | .listByRuleCode(ActivityRuleUser.RULE_HAOHUO, 1, 20);
|
| | | user = ruleList.get((int) (ruleList.size() * Math.random())).getActivityUser();
|
| | | }
|
| | | goodsEvaluateService.addGoodsEvaluate2(goodsId + "", null, user, showtitle, null);
|
| | | addResult = true;
|
| | | break;
|
| | | } catch (GoodsEvaluateException e) {
|
| | | e.printStackTrace();
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | if (addResult) {
|
| | | break;
|
| | | }
|
| | |
|
| | | try {
|
| | | result = DaTaoKeApiUtil.listAll(result.getPageId());
|
| | | } catch (Exception e) {
|
| | | result = DaTaoKeApiUtil.listAll(result.getPageId());
|
| | | }
|
| | | try {
|
| | | Thread.sleep(10);
|
| | | } catch (InterruptedException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | return addResult;
|
| | | }
|
| | | |
| | | }
|
| | |
| | | SELECT * FROM yeshi_ec_user u
|
| | | LEFT JOIN yeshi_ec_user_info_extra ext ON u.`id` = ext.uie_uid
|
| | | LEFT JOIN yeshi_ec_user_rank rak ON rak.ur_id = ext.uie_rank_id
|
| | | <if test="keyType == 4">
|
| | | LEFT JOIN yeshi_ec_team_user_level_statistic lc ON lc.`tuls_uid` = u.id
|
| | | <if test="keyType == 4 || level != null">
|
| | | LEFT JOIN yeshi_ec_binding_account b ON u.`id` = b.`uid`
|
| | | </if>
|
| | | WHERE 1=1
|
| | |
| | | <id column="ucm_uid" property="id" jdbcType="BIGINT"/> |
| | | <result column="ucm_official" property="official" jdbcType="BOOLEAN"/> |
| | | <result column="ucm_custom" property="custom" jdbcType="BOOLEAN"/> |
| | | <result column="ucm_offline_notice" property="offlineNotice" jdbcType="BOOLEAN"/> |
| | | <result column="ucm_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="ucm_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">ucm_uid,ucm_official,ucm_custom,ucm_create_time,ucm_update_time</sql> |
| | | <sql id="Base_Column_List">ucm_uid,ucm_official,ucm_custom,ucm_offline_notice,ucm_create_time,ucm_update_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_user_cloud_manage where ucm_uid = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_cloud_manage where ucm_uid = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.cloud.UserCloudManage" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_cloud_manage (ucm_uid,ucm_official,ucm_custom,ucm_create_time,ucm_update_time) values (#{id,jdbcType=BIGINT},#{official,jdbcType=BOOLEAN},#{custom,jdbcType=BOOLEAN},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.cloud.UserCloudManage" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_cloud_manage (ucm_uid,ucm_official,ucm_custom,ucm_offline_notice,ucm_create_time,ucm_update_time) values (#{id,jdbcType=BIGINT},#{official,jdbcType=BOOLEAN},#{custom,jdbcType=BOOLEAN},#{offlineNotice,jdbcType=BOOLEAN},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.cloud.UserCloudManage" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_cloud_manage |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">ucm_uid,</if> |
| | | <if test="official != null">ucm_official,</if> |
| | | <if test="custom != null">ucm_custom,</if> |
| | | <if test="offlineNotice != null">ucm_offline_notice,</if> |
| | | <if test="createTime != null">ucm_create_time,</if> |
| | | <if test="updateTime != null">ucm_update_time,</if> |
| | | </trim>values |
| | |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="official != null">#{official,jdbcType=BOOLEAN},</if> |
| | | <if test="custom != null">#{custom,jdbcType=BOOLEAN},</if> |
| | | <if test="offlineNotice != null">#{offlineNotice,jdbcType=BOOLEAN},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.cloud.UserCloudManage">update yeshi_ec_user_cloud_manage set ucm_official = #{official,jdbcType=BOOLEAN},ucm_custom = #{custom,jdbcType=BOOLEAN},ucm_create_time = #{createTime,jdbcType=TIMESTAMP},ucm_update_time = #{updateTime,jdbcType=TIMESTAMP} where ucm_uid = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.cloud.UserCloudManage">update yeshi_ec_user_cloud_manage set ucm_official = #{official,jdbcType=BOOLEAN},ucm_custom = #{custom,jdbcType=BOOLEAN},ucm_offline_notice = #{offlineNotice,jdbcType=BOOLEAN},ucm_create_time = #{createTime,jdbcType=TIMESTAMP},ucm_update_time = #{updateTime,jdbcType=TIMESTAMP} where ucm_uid = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.cloud.UserCloudManage">update yeshi_ec_user_cloud_manage |
| | | <set> |
| | | <if test="official != null">ucm_official=#{official,jdbcType=BOOLEAN},</if> |
| | | <if test="custom != null">ucm_custom=#{custom,jdbcType=BOOLEAN},</if> |
| | | <if test="offlineNotice != null">ucm_offline_notice=#{offlineNotice,jdbcType=BOOLEAN},</if> |
| | | <if test="createTime != null">ucm_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">ucm_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where ucm_uid = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <select id="selectForUpdate" resultMap="BaseResultMap" parameterType="java.lang.Long"> |
| | | SELECT * from yeshi_ec_user_cloud_manage where ucm_uid = #{id,jdbcType=BIGINT} FOR UPDATE |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | </mapper> |
| | |
| | | }
|
| | |
|
| | |
|
| | | @Cacheable(value = "config", key = "'isRobotCloudOpen'")
|
| | | @Cacheable(value = "config", key = "'isRobotCloudOpen'+'-'+#key")
|
| | | @Override
|
| | | public boolean isRobotCloudOpen() {
|
| | | String value = get(ConfigKeyEnum.robotCloudOpen.getKey());
|
| | | public boolean isRobotCloudOpen(String key) {
|
| | | String value = get(key);
|
| | | if (StringUtil.isNullOrEmpty(value))
|
| | | return false;
|
| | | if ("1".equalsIgnoreCase(value.trim())) {
|
| | |
| | | }
|
| | |
|
| | |
|
| | | |
| | | @Cacheable(value = "config", key = "'getTestUsers'")
|
| | | @Override
|
| | | public List<String> getTestUsers() {
|
| | |
| | | |
| | | // 白底图 |
| | | List<String> imgs = new ArrayList<>(); |
| | | |
| | | imgs.addAll(goodsBrief.getImgList()); |
| | | |
| | | // 商品VO |
| | |
| | | goodsEvaluateDao.save(goodsEvaluate); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void addGoodsEvaluate2(String goodsId, List<String> imgs, ActivityUser user, String title, String comment) throws GoodsEvaluateException { |
| | | if (goodsId == null || user == null || StringUtil.isNullOrEmpty(title)) { |
| | | throw new GoodsEvaluateException(1, "相关参数不能为空"); |
| | | } |
| | | |
| | | Date limitDate = DateUtil.reduceDay(new Date(), 7); |
| | | |
| | | List<GoodsEvaluate> evaluateList = goodsEvaluateDao.queryExistLimitTime(Constant.SOURCE_TYPE_TAOBAO, goodsId, limitDate); |
| | | if (evaluateList != null && evaluateList.size() > 0) |
| | | throw new GoodsEvaluateException(1, "该商品已存在"); |
| | | |
| | | TaoBaoGoodsBrief goodsBrief = null; |
| | | try { |
| | | goodsBrief = redisManager.getTaoBaoGoodsBrief(Long.parseLong(goodsId)); |
| | | } catch (TaobaoGoodsDownException e) { |
| | | throw new GoodsEvaluateException(1, "商品已下架"); |
| | | } |
| | | |
| | | if (goodsBrief == null) { |
| | | throw new GoodsEvaluateException(1, "未找到商品信息"); |
| | | } |
| | | |
| | | BigDecimal couponAmount = goodsBrief.getCouponAmount(); |
| | | if (couponAmount == null || couponAmount.compareTo(new BigDecimal(0)) < 1) { |
| | | throw new GoodsEvaluateException(1, "该商品无券"); |
| | | } |
| | | |
| | | if (imgs == null) { |
| | | imgs = new ArrayList<>(); |
| | | } |
| | | if (imgs.size() == 0) { |
| | | imgs.addAll(goodsBrief.getImgList()); |
| | | } |
| | | |
| | | // 商品VO |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55"); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate()); |
| | | GoodsDetailVO goodsVO = GoodsDetailVOFactory.convertTaoBao(goodsBrief, paramsDTO); |
| | | |
| | | // 商品图片信息 |
| | | int i = 0; |
| | | List<ImgInfo> imgList = new ArrayList<ImgInfo>(); |
| | | |
| | | for (String img : imgs) { |
| | | ImgInfo imgInfo = new ImgInfo(); |
| | | imgInfo.setH(1); |
| | | imgInfo.setW(1); |
| | | imgInfo.setLarge(false); |
| | | imgInfo.setUrl(img); |
| | | imgInfo.setUrlHD(img); |
| | | if (i != 0) { |
| | | imgInfo.setType(ImgEnum.img); |
| | | } else { |
| | | imgInfo.setType(ImgEnum.goods); |
| | | SimpleGoods simpleGoods = new SimpleGoods(); |
| | | simpleGoods.setGoodsId(goodsVO.getGoodsId()); |
| | | simpleGoods.setGoodsType(goodsVO.getGoodsType()); |
| | | simpleGoods.setState(goodsVO.getState()); |
| | | CouponInfoVO couponInfo = goodsVO.getCouponInfo(); |
| | | if (couponInfo == null) { |
| | | simpleGoods.setPrice(goodsVO.getZkPrice()); |
| | | } else { |
| | | simpleGoods.setPrice(goodsVO.getCouponPrice()); |
| | | simpleGoods.setAmount(couponInfo.getAmount()); |
| | | } |
| | | imgInfo.setGoods(simpleGoods); |
| | | imgInfo.setGoodsVO(goodsVO); |
| | | } |
| | | imgList.add(imgInfo); |
| | | i++; |
| | | } |
| | | |
| | | // 评论内容 |
| | | CommentInfo commentInfo = new CommentInfo(); |
| | | commentInfo.setNeedSpin(true); |
| | | commentInfo.setId(UUID.randomUUID().toString().replace("-", "")); |
| | | commentInfo.setTypeEnum(CommentInfoEnum.goodsCoupon); |
| | | if (!StringUtil.isNullOrEmpty(comment)) { |
| | | commentInfo.setContent(comment); |
| | | commentInfo.setType(""); |
| | | } else { |
| | | String token = shareGoodsService.createTaoBaoToken(Constant.LINK_TOKEN_VERIFY_UID, goodsBrief); |
| | | String template = configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()); |
| | | String commentText = template.replace("[淘口令]", TaoBaoUtil.filterTaoToken(token)); |
| | | if (!goodsVO.isHasCoupon()) { |
| | | commentText = commentText.replace("领券抢购", "抢购"); |
| | | commentText = commentText.replace("【券后价】[券后价]元", ""); |
| | | commentText = commentText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", |
| | | "\r\n"); |
| | | } |
| | | commentInfo.setContent(commentText); |
| | | commentInfo.setType(CommentInfoEnum.goodsCoupon.getDesc()); |
| | | } |
| | | |
| | | List<CommentInfo> commentsNew = new ArrayList<>(); |
| | | commentsNew.add(commentInfo); |
| | | |
| | | // 一行显示多少个图片 |
| | | int lineNum = 0; |
| | | if (imgList.size() > 0) { |
| | | if (imgList.size() == 1) { |
| | | lineNum = 1; |
| | | } else if (imgList.size() == 3) { |
| | | lineNum = 3; |
| | | } else if (imgList.size() == 2 || imgList.size() == 4) { |
| | | lineNum = 2; |
| | | } else { |
| | | lineNum = 3; |
| | | } |
| | | } |
| | | |
| | | GoodsEvaluate goodsEvaluate = new GoodsEvaluate(); |
| | | goodsEvaluate.setId(UUID.randomUUID().toString().replace("-", "")); |
| | | goodsEvaluate.setUser(user); |
| | | goodsEvaluate.setTitle(getDescNew(title)); |
| | | goodsEvaluate.setState(1); |
| | | goodsEvaluate.setDynamicType(1); |
| | | goodsEvaluate.setType(EvaluateEnum.single); |
| | | goodsEvaluate.setShareNum((int) (Math.random() * 5000) + 1000); |
| | | goodsEvaluate.setShareNumReal(0); |
| | | goodsEvaluate.setWeight(0.0); |
| | | goodsEvaluate.setStartTime(new Date()); |
| | | goodsEvaluate.setEndTime(DateUtil.plusDayDate(3, new Date())); |
| | | goodsEvaluate.setPublishTime(new Date()); |
| | | goodsEvaluate.setCreateTime(new Date()); |
| | | goodsEvaluate.setUpdateTime(new Date()); |
| | | goodsEvaluate.setGoods(goodsVO); |
| | | goodsEvaluate.setLineNum(lineNum); |
| | | goodsEvaluate.setImgList(imgList); |
| | | goodsEvaluate.setComments(commentsNew); |
| | | goodsEvaluateDao.save(goodsEvaluate); |
| | | } |
| | | |
| | | @Override |
| | | public void addGoodsEvaluateByDaTaoKe() { |
| | | List<Long> listId = null; |
| | |
| | | saveMsgDetail(MsgOtherDetailFactory.goldCoinExChangeMsg(uid, num, banlce, name, exNum));
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void cloudMsg(Long uid, String category, String item, String desc) {
|
| | | saveMsgDetail(MsgOtherDetailFactory.cloudMsg(uid, category, item, desc));
|
| | | }
|
| | | |
| | | }
|
| | |
| | | userInfoVO.setTotalOrder(commonOrderCountService.countHistoryOrderNum(uid));
|
| | |
|
| | | // 累计兑换金币
|
| | | userInfoVO.setTotalGoldCoinUsed(integralDetailService.sumUseGoldCoin(uid));
|
| | | userInfoVO.setTotalGoldCoinUsed(Math.abs(integralDetailService.sumUseGoldCoin(uid)));
|
| | |
|
| | | // 邀请人
|
| | | UserInfo boss = threeSaleSerivce.getBoss(uid);
|
| | | if (boss == null) {
|
| | | userInfoVO.setBossName("");
|
| | | } else {
|
| | | userInfoVO.setBossName("上级:" + boss.getNickName());
|
| | | userInfoVO.setBossName("邀请人:" + boss.getNickName());
|
| | | }
|
| | |
|
| | | // 微信号
|
| | |
| | | manage.setCustom(custom);
|
| | | manage.setOfficial(official);
|
| | | manage.setCreateTime(new Date());
|
| | | manage.setOfflineNotice(false);
|
| | | userCloudManageMapper.insertSelective(manage);
|
| | |
|
| | | send = manage.getCustom();
|
| | |
| | | return userCloudManageMapper.selectByPrimaryKey(uid);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void updateByPrimaryKeySelective(UserCloudManage record) {
|
| | | userCloudManageMapper.updateByPrimaryKeySelective(record);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public UserCloudManage selectForUpdate(Long uid) {
|
| | | return userCloudManageMapper.selectForUpdate(uid);
|
| | | }
|
| | | |
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudOrder;
|
| | | import com.yeshi.fanli.exception.user.cloud.UserCloudOrderException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.msg.UserOtherMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudService;
|
| | |
|
| | |
| | | @Resource
|
| | | private UserCloudService userCloudService;
|
| | |
|
| | | |
| | | |
| | | @Override
|
| | | public UserCloudOrder addCloudOrder(Long uid, String type) throws UserCloudOrderException{
|
| | | if (uid == null)
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.core.task.TaskExecutor;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.yeshi.utils.BigDecimalUtil;
|
| | |
| | | import com.yeshi.fanli.service.inter.goods.CommonGoodsService;
|
| | | import com.yeshi.fanli.service.inter.goods.ShareGoodsService;
|
| | | import com.yeshi.fanli.service.inter.goods.ShareGoodsTextTemplateService;
|
| | | import com.yeshi.fanli.service.inter.msg.UserOtherMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.msg.UserSystemMsgService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.push.PushService;
|
| | | import com.yeshi.fanli.service.inter.user.QrCodeService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | |
| | | @Resource(name = "producer")
|
| | | private Producer producer;
|
| | |
|
| | | @Resource
|
| | | private UserOtherMsgNotificationService userOtherMsgNotificationService;
|
| | | |
| | | @Resource
|
| | | private PushService pushService;
|
| | | |
| | | @Resource
|
| | | private UserSystemMsgService userSystemMsgService;
|
| | | |
| | | @Resource(name = "taskExecutor")
|
| | | private TaskExecutor executor;
|
| | |
|
| | | |
| | |
|
| | | @Override
|
| | | public UserCloud getValidByUid(Long uid) {
|
| | |
| | | if (userCloud == null)
|
| | | throw new UserCloudException(1, "云发单已过期");
|
| | |
|
| | | // 检测是否需要更新 - 1分钟间隔
|
| | | String key = "cloudLogin_" + uid;
|
| | | String result = redisManager.getCommonString(key);
|
| | | if (!StringUtil.isNullOrEmpty(result)) {
|
| | | return;
|
| | | }
|
| | | redisManager.cacheCommonString(key , "true" , 60);
|
| | | |
| | | |
| | | // 更新信息
|
| | | UserCloud update = new UserCloud();
|
| | | update.setId(userCloud.getId());
|
| | |
| | | update.setWxName(wxName);
|
| | | update.setWxPortrait(wxPortrait);
|
| | | userCloudMapper.updateByPrimaryKeySelective(update);
|
| | | |
| | | try {
|
| | | userOtherMsgNotificationService.cloudMsg(uid, "云发单微信账号", "微信账号登录成功", "可以开启你的群发单了");
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | |
| | | // 更新提醒状态
|
| | | UserCloudManage cloudManage = userCloudManageService.selectForUpdate(uid);
|
| | | if (cloudManage == null) {
|
| | | userCloudManageService.save(uid, false, false);
|
| | | } else {
|
| | | UserCloudManage updateManage = new UserCloudManage();
|
| | | updateManage.setId(uid);
|
| | | updateManage.setOfflineNotice(false);
|
| | | userCloudManageService.updateByPrimaryKeySelective(updateManage);
|
| | | }
|
| | |
|
| | | // 微信号变化-清空群信息
|
| | | if (!wxId.equals(userCloud.getWxId())) {
|
| | |
| | |
|
| | | // 开启发圈功能
|
| | | userCloudManageService.save(uid, null, null);
|
| | | |
| | | try {
|
| | | String item = null;
|
| | | if (renew) {
|
| | | item = "成功续费" + menuEnum.getDescShow();
|
| | | } else {
|
| | | item = "成功开通" + menuEnum.getDescShow();
|
| | | }
|
| | | String desc = "完成充值支付"+ BigDecimal.valueOf(menuEnum.getMoney()).setScale(2, BigDecimal.ROUND_DOWN) +"元";
|
| | | userOtherMsgNotificationService.cloudMsg(uid, "云发单充值", item, desc);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | if (StringUtil.isNullOrEmpty(wxId))
|
| | | throw new UserCloudException(1003, "微信号不存在,请先微信登录");
|
| | |
|
| | | if (!AitaokerApiUtil.onlineCheck(robotId)) {
|
| | | throw new UserCloudException(1003, "微信已掉线,请先重新登录微信");
|
| | | }
|
| | | |
| | | // 验证开启状态
|
| | | List<UserCloudGroup> listGroup = userCloudGroupService.listByUid(uid);
|
| | | if (listGroup == null || listGroup.size() == 0)
|
| | |
| | |
|
| | | // 检测微信是否登录状态
|
| | | if (!AitaokerApiUtil.onlineCheck(robotId)) {
|
| | | throw new UserCloudException(1003, "请重新登录微信");
|
| | | // 通知登录微信
|
| | | offlineNotification(uid);
|
| | | |
| | | throw new UserCloudException(1003, "微信已掉线,需要重新扫描二维码登录");
|
| | | }
|
| | |
|
| | |
|
| | |
| | |
|
| | |
|
| | | String qrCode = null;
|
| | | String cloudPic = null;
|
| | | ImgInfo imgVideo = null;
|
| | | List<String> listImg = new ArrayList<>();
|
| | |
|
| | |
| | | imgVideo = imgInfo;
|
| | | continue;
|
| | | }
|
| | | |
| | | if (imgInfo.getType() == ImgEnum.goods) {
|
| | | cloudPic = imgInfo.getUrl();
|
| | | }
|
| | | listImg.add(imgInfo.getUrl());
|
| | | |
| | | // 取消二维码图
|
| | | // GoodsDetailVO goodsVO = imgInfo.getGoodsVO();
|
| | | // if (goodsVO == null) {
|
| | | // listImg.add(imgInfo.getUrl());
|
| | | // } else {
|
| | | // String jumpLink = getJumpLink(goodsVO, user, relationId, inviteCode, imgInfo.getUrl());
|
| | | // if (!StringUtil.isNullOrEmpty(jumpLink)) {
|
| | | // qrCode = jumpLink;
|
| | | // }
|
| | | // }
|
| | | }
|
| | | |
| | | if (cloudPic == null) {
|
| | | cloudPic = imgs.get(0).getUrl();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | // 发送图片
|
| | | if (!StringUtil.isNullOrEmpty(cloudPic)) {
|
| | | int num = 1;
|
| | | String picNum = configService.get(ConfigKeyEnum.robotCloudGroupPictureNum.getKey());
|
| | | if (!StringUtil.isNullOrEmpty(picNum)) {
|
| | | num = Integer.parseInt(picNum);
|
| | | }
|
| | | |
| | | if (listImg.size() > 0) |
| | | for (int i = 0; i < num && i < listImg.size(); i++) {
|
| | | try {
|
| | | String imgBase64 = ImageToBase64.NetImageToBase64(cloudPic);
|
| | | String imgBase64 = ImageToBase64.NetImageToBase64(listImg.get(i));
|
| | | boolean macsend = AitaokerApiUtil.macsendImgBase64(robotId, cloudGroup.getGroupId(), imgBase64);
|
| | | if (macsend)
|
| | | sendContent.setPicUrl(cloudPic);
|
| | | sendContent.setPicUrl(listImg.get(i));
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | |
| | | if (StringUtil.isNullOrEmpty(wxId))
|
| | | throw new UserCloudException(1002, "请先登录微信");
|
| | |
|
| | | if (!AitaokerApiUtil.onlineCheck(robotId)) {
|
| | | throw new UserCloudException(1003, "微信已掉线,请先重新登录微信");
|
| | | }
|
| | | |
| | | |
| | | // 验证开启状态
|
| | | List<UserCloudGroup> listGroup = userCloudGroupService.listByUid(uid);
|
| | | if (listGroup == null || listGroup.size() == 0)
|
| | |
| | |
|
| | | // 检测微信是否登录状态
|
| | | if (!AitaokerApiUtil.onlineCheck(robotId)) {
|
| | | throw new UserCloudException(1003, "请重新登录微信");
|
| | | }
|
| | | // 通知登录微信
|
| | | offlineNotification(uid);
|
| | |
|
| | | throw new UserCloudException(1003, "微信已掉线,需要重新扫描二维码登录");
|
| | | }
|
| | |
|
| | | // 保存发送记录
|
| | | UserCloudSendRecord sendRecord = new UserCloudSendRecord();
|
| | |
| | | }
|
| | |
|
| | | // 发送图片
|
| | | String picurl = listImg.get(0);
|
| | | if (!StringUtil.isNullOrEmpty(picurl)) {
|
| | | int num = 1;
|
| | | String picNum = configService.get(ConfigKeyEnum.robotCloudGroupPictureNum.getKey());
|
| | | if (!StringUtil.isNullOrEmpty(picNum)) {
|
| | | num = Integer.parseInt(picNum);
|
| | | }
|
| | | |
| | | if (listImg.size() > 0) |
| | | for (int i = 0; i < num && i < listImg.size(); i++) {
|
| | | try {
|
| | | String imgBase64 = ImageToBase64.NetImageToBase64(picurl);
|
| | | String imgBase64 = ImageToBase64.NetImageToBase64(listImg.get(i));
|
| | | boolean macsend = AitaokerApiUtil.macsendImgBase64(robotId, cloudGroup.getGroupId(), imgBase64);
|
| | | if (macsend)
|
| | | sendContent.setPicUrl(picurl);
|
| | | sendContent.setPicUrl(listImg.get(i));
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | |
| | | }
|
| | | |
| | | |
| | | // 评论文本
|
| | | List<String> list = new ArrayList<>();
|
| | | boolean macsend = AitaokerApiUtil.macsendText(robotId, cloudGroup.getGroupId(), comment);
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | | |
| | | private void offlineNotification(Long uid) {
|
| | | UserCloudManage cloudManage = userCloudManageService.selectForUpdate(uid);
|
| | | if (cloudManage == null) {
|
| | | return;
|
| | | }
|
| | | |
| | | Boolean offlineNotice = cloudManage.getOfflineNotice();
|
| | | if (offlineNotice != null && offlineNotice) {
|
| | | return;
|
| | | }
|
| | | |
| | | try {
|
| | | userOtherMsgNotificationService.cloudMsg(uid, "云发单微信账号", "微信账号掉线", "需要你重新扫描二维码登录");
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | |
| | | // 站内信通知
|
| | | offlineNotificationZNX(uid);
|
| | | |
| | | // 延迟10分钟再次提醒
|
| | | if(!Constant.IS_TEST) {
|
| | | UserCloudMQMsg msg = new UserCloudMQMsg(uid, UserCloudMQMsg.TYPE_PUSH);
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.userCloud, msg);
|
| | | message.setStartDeliverTime(java.lang.System.currentTimeMillis() + 1000 * 60 * 10);
|
| | | producer.send(message);
|
| | | }
|
| | | |
| | | // 更新已提醒
|
| | | UserCloudManage updateManage = new UserCloudManage();
|
| | | updateManage.setId(uid);
|
| | | updateManage.setOfflineNotice(true);
|
| | | userCloudManageService.updateByPrimaryKeySelective(updateManage);
|
| | | }
|
| | | |
| | | // 站内信通知
|
| | | @Override
|
| | | public void offlineNotificationZNX(Long uid) {
|
| | | // 验证是否开通
|
| | | UserCloud userCloud = userCloudMapper.getValidByUid(uid);
|
| | | if (userCloud == null)
|
| | | return;
|
| | | |
| | | Integer robotId = userCloud.getRobotId();
|
| | | if (robotId == null)
|
| | | return;
|
| | | |
| | | // 登录状态
|
| | | if (AitaokerApiUtil.onlineCheck(robotId)) {
|
| | | return;
|
| | | }
|
| | | |
| | | try {
|
| | | pushService.pushZNX(uid, "【重要通知】你的云发单微信已掉线。", "需要你重新扫描二维码登录", null, null);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | } |
| | |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public boolean isRobotCloudOpen();
|
| | | public boolean isRobotCloudOpen(String key);
|
| | |
|
| | | /**
|
| | | * 测试用户信息
|
| | |
| | | */ |
| | | public boolean addByDaTaoKeGoods(DaTaoKeDetailV2 daTaoKe); |
| | | |
| | | |
| | | public void addGoodsEvaluate2(String goodsId, List<String> imgs, ActivityUser user, String title, String comment) |
| | | throws GoodsEvaluateException; |
| | | |
| | | } |
| | |
| | | */
|
| | | public void goldCoinExChangeMsg(Long uid, int num, int banlce, String name, String exNum);
|
| | |
|
| | | /**
|
| | | * 云发单消息
|
| | | * @param uid
|
| | | * @param category
|
| | | * @param item
|
| | | * @param desc
|
| | | */
|
| | | public void cloudMsg(Long uid, String category, String item, String desc);
|
| | |
|
| | | }
|
| | |
| | | */
|
| | | public UserCloudManage selectByPrimaryKey(Long uid);
|
| | |
|
| | | /**
|
| | | * 查询
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public UserCloudManage selectForUpdate(Long uid);
|
| | |
|
| | | public void updateByPrimaryKeySelective(UserCloudManage record);
|
| | |
|
| | | }
|
| | |
| | | */
|
| | | public void cacheMatchGroup(String wxId, String groupId);
|
| | |
|
| | | /**
|
| | | * 站内信通知用户微信下线
|
| | | * @param uid
|
| | | */
|
| | | public void offlineNotificationZNX(Long uid);
|
| | |
|
| | | }
|
| | |
| | | }
|
| | | return null;
|
| | | }
|
| | | |
| | | /**
|
| | | * |
| | | * @param pageId
|
| | | * @return
|
| | | */
|
| | | public static DaTaoKeGoodsResult getFriendsFircleList(String pageId, int pageSize) {
|
| | | DaTaoKeGoodsResult daTaoKeGoodsResult = new DaTaoKeGoodsResult();
|
| | | |
| | | TaoKeAppInfo app = getRandomApp();
|
| | | Map<String, String> params = new TreeMap<>();
|
| | | params.put("version", "v1.2.2");
|
| | | params.put("appKey", app.getAppKey());
|
| | | params.put("pageSize", pageSize + "");
|
| | | if (!StringUtil.isNullOrEmpty(pageId))
|
| | | params.put("pageId", pageId);
|
| | | params.put("sign", getSign(params, app.getAppSecret()));
|
| | |
|
| | | String result = null;
|
| | | try {
|
| | | result = HttpUtil.get("https://openapi.dataoke.com/api/goods/friends-circle-list", params, new HashMap<>());
|
| | | } catch (Exception e) {
|
| | | result = HttpUtil.get("https://openapi.dataoke.com/api/goods/friends-circle-list", params, new HashMap<>());
|
| | | }
|
| | | JSONObject json = JSONObject.fromObject(result);
|
| | | JSONObject dataJson = json.optJSONObject("data");
|
| | | if (dataJson != null) {
|
| | | JSONArray array = dataJson.optJSONArray("list");
|
| | | if (array != null) {
|
| | | List<DaTaoKeDetailV2> list = parseDaTaoKeDetailV2List(array);
|
| | | daTaoKeGoodsResult.setGoodsList(list);
|
| | | }
|
| | | daTaoKeGoodsResult.setPageId(dataJson.optString("pageId"));
|
| | | daTaoKeGoodsResult.setTotalCount(dataJson.optLong("totalNum"));
|
| | | }
|
| | | return daTaoKeGoodsResult;
|
| | | }
|
| | | |
| | | }
|
| | |
| | | return detail;
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 云发单相关信息
|
| | | * @param uid
|
| | | * @param category
|
| | | * @param item
|
| | | * @param desc
|
| | | * @return
|
| | | */
|
| | | public static MsgOtherDetail cloudMsg(Long uid, String category, String item, String desc) {
|
| | | List<CommonMsgItemVO> listMsg = new ArrayList<>();
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("类别", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(category, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("事项", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(item, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("说明", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(desc, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("无", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | |
| | | MsgOtherDetail detail = new MsgOtherDetail();
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setRead(false);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setType(MsgTypeOtherTypeEnum.cloudWX);
|
| | | detail.setExtraInfo(new Gson().toJson(listMsg));
|
| | | return detail;
|
| | | }
|
| | | |
| | | }
|
| | |
| | | import com.aliyun.openservices.ons.api.Message;
|
| | | import com.aliyun.openservices.ons.api.MessageListener;
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dto.mq.order.OrderTopicTagEnum;
|
| | | import com.yeshi.fanli.dto.mq.order.body.OrderConfirmMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.order.body.OrderMoneyRecievedMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.UserTopicTagEnum;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserCloudMQMsg;
|
| | | import com.yeshi.fanli.entity.bus.user.UserActiveLog;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | |
|
| | | /**
|
| | |
| | | if (msg.getType() == UserCloudMQMsg.TYPE_EVALUATE) {
|
| | | LogHelper.cloudInfo("发圈中信息 -" + msg.getId() );
|
| | | userCloudService.autoSendByDynamic(msg.getUid(), msg.getId());
|
| | | } else {
|
| | | } else if (msg.getType() == UserCloudMQMsg.TYPE_STORE) {
|
| | | LogHelper.cloudInfo("选品库信息 -" + msg.getId() );
|
| | | userCloudService.autoSendCustomGoods(msg.getUid(), Long.parseLong(msg.getId()));
|
| | | } else if (msg.getType() == UserCloudMQMsg.TYPE_PUSH) {
|
| | | LogHelper.cloudInfo("站内信息 -" + msg.getId() );
|
| | | userCloudService.offlineNotificationZNX(msg.getUid());
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.dto.taobao.haodanku.HDKGoodsListResultDTO;
|
| | | import com.yeshi.fanli.dto.taobao.haodanku.HDKWXCircleContentDTO;
|
| | | import com.yeshi.fanli.entity.taobao.haodanku.HDKGoodsDetail;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | |
| | | System.out.println(resultJSON.optJSONObject("data").optString("couponurl"));
|
| | | }
|
| | |
|
| | | |
| | | public HDKGoodsListResultDTO listSelected(Integer minId) {
|
| | | if (minId == null)
|
| | | minId = 1;
|
| | | List<ParamsKeyValue> params = new ArrayList<HaoDanKuApiUtil.ParamsKeyValue>();
|
| | | params.add(new ParamsKeyValue("min_id", minId + ""));
|
| | | String result = baseGetRequest("selected_item", params);
|
| | |
|
| | | JSONObject resultData = JSONObject.fromObject(result);
|
| | | if (resultData.optInt("code") == 1) {
|
| | | JSONArray array = resultData.optJSONArray("data");
|
| | | if (array != null) {
|
| | | List<HDKWXCircleContentDTO> list = new ArrayList<>();
|
| | | for (int i = 0; i <array.size(); i ++) {
|
| | | JSONObject item = array.optJSONObject(i);
|
| | | HDKWXCircleContentDTO dto = new HDKWXCircleContentDTO();
|
| | | dto.setTitle(item.optString("title"));
|
| | | dto.setItemid(item.optString("itemid"));
|
| | | dto.setItemtitle(item.optString("itemtitle"));
|
| | | dto.setContent(item.optString("content"));
|
| | | dto.setCopy_content(item.optString("copy_content"));
|
| | | dto.setShow_content(item.optString("show_content"));
|
| | | |
| | | JSONArray imgArray = item.optJSONArray("itempic");
|
| | | if (imgArray != null) {
|
| | | List<String> imgList = new ArrayList<>();
|
| | | for (int n = 0; n < imgArray.size(); n++) {
|
| | | imgList.add(imgArray.optString(n));
|
| | | }
|
| | | dto.setItempic(imgList);
|
| | | }
|
| | | list.add(dto);
|
| | | }
|
| | | HDKGoodsListResultDTO dto = new HDKGoodsListResultDTO();
|
| | | dto.setList(list);
|
| | | dto.setMinId(minId);
|
| | | return dto;
|
| | | }
|
| | | }
|
| | | return null;
|
| | | }
|
| | | |
| | | |
| | | public HDKGoodsListResultDTO getItemDetail(String itemid) {
|
| | | List<ParamsKeyValue> params = new ArrayList<HaoDanKuApiUtil.ParamsKeyValue>();
|
| | | params.add(new ParamsKeyValue("itemid", itemid));
|
| | | String result = baseGetRequest("item_detail", params);
|
| | |
|
| | | JSONObject resultData = JSONObject.fromObject(result);
|
| | | if (resultData.optInt("code") == 1) {
|
| | | Integer newMinId = resultData.optInt("min_id");
|
| | | Type type = new TypeToken<ArrayList<HDKGoodsDetail>>() {
|
| | | }.getType();
|
| | | List<HDKGoodsDetail> list = new Gson().fromJson(resultData.optJSONArray("data").toString(), type);
|
| | | return new HDKGoodsListResultDTO(list, newMinId);
|
| | | }
|
| | |
|
| | | return null;
|
| | | }
|
| | | }
|