Merge remote-tracking branch 'origin/div' into div
| | |
| | | package com.yeshi.fanli.aspect;
|
| | |
|
| | | import java.io.IOException;
|
| | | import java.io.PrintWriter;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Arrays;
|
| | |
| | | List<String> list = new ArrayList<>();
|
| | | for (Iterator<String> its = json.keySet().iterator(); its.hasNext();) {
|
| | | String key = its.next();
|
| | | list.add(key + "=" + json.optString(key));
|
| | | if (!key.equalsIgnoreCase("sign"))
|
| | | list.add(key + "=" + json.optString(key));
|
| | | }
|
| | | Collections.sort(list);
|
| | | String str = "";
|
| | |
| | | import com.yeshi.fanli.exception.share.UserShareGoodsRecordException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.log.LogManager;
|
| | | import com.yeshi.fanli.log.LogType;
|
| | | import com.yeshi.fanli.service.inter.activity.ActivityService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.dynamic.DynamicInfoService;
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | @RequestMapping(value = "getWaitingThreadsCount")
|
| | | public void getWaitingThreadsCount(PrintWriter out) {
|
| | | out.print(Constant.waitingThreadSet.size());
|
| | |
| | | data.put("waiters", jedisPool.getNumWaiters());
|
| | | out.print(data.toString());
|
| | | }
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
|
| | | @RequestMapping("log")
|
| | | public void log(PrintWriter out) {
|
| | | LogManager.getLogger(LogType.taobaoAuth).info("123123123");
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.controller.admin.user.vip;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.lang.reflect.Type;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.IPUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.google.gson.JsonElement;
|
| | | import com.google.gson.JsonPrimitive;
|
| | | import com.google.gson.JsonSerializationContext;
|
| | | import com.google.gson.JsonSerializer;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.GiveVIPApplyInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.exception.user.vip.GiveVIPApplyInfoException;
|
| | | import com.yeshi.fanli.exception.user.vip.UserVIPPreInfoException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.GiveVIPApplyInfoService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestSerializableByKey;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/vip")
|
| | | public class UserVipApplyAdminController {
|
| | |
|
| | | @Resource
|
| | | private GiveVIPApplyInfoService giveVIPApplyInfoService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | |
|
| | | /**
|
| | | * |
| | | * @param callback
|
| | | * @param pageIndex
|
| | | * @param pageSize
|
| | | * @param key 搜索:暂只提供uid
|
| | | * @param state 状态:
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "queryVip")
|
| | | public void queryVip(String callback, Integer pageIndex, Integer pageSize, String key, Integer state,
|
| | | PrintWriter out) {
|
| | | try {
|
| | |
|
| | | Long targetUid = null;
|
| | | try {
|
| | | targetUid = Long.parseLong(key);
|
| | | } catch (Exception e) {
|
| | | }
|
| | |
|
| | | List<GiveVIPApplyInfo> list = giveVIPApplyInfoService.listByStateAndTargetUid(targetUid, state, pageIndex,
|
| | | pageSize);
|
| | |
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
|
| | | return;
|
| | | }
|
| | |
|
| | | for (GiveVIPApplyInfo info : list) {
|
| | | // 组织用户信息
|
| | | UserInfo userInfo = userInfoService.getUserById(info.getTargetUid());
|
| | | UserInfo simpleInfo = new UserInfo(userInfo.getId());
|
| | | simpleInfo.setNickName(userInfo.getNickName());
|
| | | simpleInfo.setPortrait(userInfo.getPortrait());
|
| | | info.setTargetUser(simpleInfo);
|
| | | // 组织其他平台信息
|
| | | if (info.getHasDoOtherPlatform() != null && info.getHasDoOtherPlatform()) {
|
| | | String st = "平台:" + (StringUtil.isNullOrEmpty(info.getOtherPlatformName()) ? "未知"
|
| | | : info.getOtherPlatformName());
|
| | | st += "\n粉丝数:";
|
| | | st += "直接粉丝数(" + (info.getOtherDirectTeams() == null ? "未知" : info.getOtherDirectTeams());
|
| | |
|
| | | st += ") 间接粉丝数(" + (info.getOtherInDirectTeams() == null ? "未知" : info.getOtherInDirectTeams())
|
| | | + ")";
|
| | |
|
| | | st += "\n平台等级:" + (StringUtil.isNullOrEmpty(info.getOtherLevel()) ? "未知" : info.getOtherLevel());
|
| | |
|
| | | st += "\n月均收入:" + (StringUtil.isNullOrEmpty(info.getOtherMonthIncome()) ? "未知"
|
| | | : info.getOtherMonthIncome());
|
| | |
|
| | | info.setOtherPlatformInfo(st);
|
| | | } else {
|
| | | info.setOtherPlatformInfo("暂无");
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | long count = giveVIPApplyInfoService.countByStateAndTargetUid(targetUid, state);
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
|
| | | GsonBuilder gsonBuilder = new GsonBuilder().registerTypeAdapter(UserLevelEnum.class,
|
| | | new JsonSerializer<UserLevelEnum>() {
|
| | |
|
| | | public JsonElement serialize(UserLevelEnum arg0, Type arg1, JsonSerializationContext arg2) {
|
| | | return new JsonPrimitive(arg0.getName());
|
| | | }
|
| | | });
|
| | | gsonBuilder.serializeNulls();
|
| | | Gson gson = gsonBuilder.setDateFormat("yyyy/MM/dd HH:mm:ss").create();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("result_list", gson.toJson(list));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 超级会员升级通过
|
| | | * @param callback
|
| | | * @param id
|
| | | * @param out
|
| | | * @param request
|
| | | * @throws UserVIPPreInfoException |
| | | */
|
| | | @RequestSerializableByKey(key = "'passApplyVIP-' +#id")
|
| | | @RequestMapping(value = "passVIP")
|
| | | public void passVIP(String callback, String id, PrintWriter out, HttpServletRequest request) {
|
| | | try {
|
| | | /* 检验是否登陆 */
|
| | | AdminUser admin = (AdminUser) request.getSession().getAttribute(Constant.SESSION_ADMIN);
|
| | | if (admin == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("当前账户失效,请重新登陆。"));
|
| | | return;
|
| | | }
|
| | | giveVIPApplyInfoService.pass(id, admin.getId());
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
|
| | | LogHelper.userInfo(
|
| | | "[ip:" + IPUtil.getRemotIP(request) + "]" + admin.getName() + "通过了[id=" + id + "]的升级会员申请!");
|
| | | } catch (GiveVIPApplyInfoException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | return;
|
| | | } catch (UserVIPPreInfoException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 超级会员升级拒绝
|
| | | * @param callback
|
| | | * @param id
|
| | | * @param reason
|
| | | * @param out
|
| | | * @param request
|
| | | */
|
| | |
|
| | | @RequestMapping(value = "rejectVIP")
|
| | | public void rejectVIP(String callback, String id, String reason, PrintWriter out, HttpServletRequest request) {
|
| | | try {
|
| | | /* 检验是否登陆 */
|
| | | AdminUser admin = (AdminUser) request.getSession().getAttribute(Constant.SESSION_ADMIN);
|
| | | if (admin == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("当前账户失效,请重新登陆"));
|
| | | return;
|
| | | }
|
| | |
|
| | | giveVIPApplyInfoService.reject(id, admin.getId(), reason);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("拒绝成功"));
|
| | | LogHelper.userInfo("[ip:" + IPUtil.getRemotIP(request) + "][管理员:" + admin.getName() + "] 拒绝提现id=" + id
|
| | | + "的升级超级会员申请不存在!");
|
| | | } catch (GiveVIPApplyInfoException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | return;
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
|
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "apply")
|
| | | public void apply(String callback, Long uid, String level, String applyReason, PrintWriter out,
|
| | | HttpServletRequest request) {
|
| | | try {
|
| | | /* 检验是否登陆 */
|
| | | AdminUser admin = (AdminUser) request.getSession().getAttribute(Constant.SESSION_ADMIN);
|
| | | if (admin == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("当前账户失效,请重新登陆"));
|
| | | return;
|
| | | }
|
| | | GiveVIPApplyInfo info = new GiveVIPApplyInfo();
|
| | | info.setApplyReason(applyReason);
|
| | | info.setTargetUid(uid);
|
| | | info.setSourceUid(uid);
|
| | | info.setMark(String.format("管理员(%s)代为申请", admin.getName()));
|
| | | info.setLevel(UserLevelEnum.valueOf(level));
|
| | | giveVIPApplyInfoService.addGiveVIPApplyInfo(info);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("成功"));
|
| | | } catch (GiveVIPApplyInfoException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | return;
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
|
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import java.math.BigDecimal;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Calendar;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.entity.order.TeamOrderStatistic;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | | import com.yeshi.fanli.exception.order.CommonOrderException;
|
| | |
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.LostOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderService;
|
| | | import com.yeshi.fanli.service.inter.order.TeamOrderStatisticService;
|
| | | import com.yeshi.fanli.service.inter.order.dividents.TeamDividentsSourceOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.tb.TaoBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | |
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.vo.order.CommonOrderVO;
|
| | | import com.yeshi.fanli.vo.order.TeamOrderStatisticVO;
|
| | | import com.yeshi.fanli.vo.user.UserInfoExtraVO;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
| | |
|
| | | @Resource
|
| | | private RedisManager redisManager;
|
| | |
|
| | | // @Resource
|
| | | private TeamOrderStatisticService teamOrderStatisticService;
|
| | |
|
| | | @Resource
|
| | | private TeamDividentsSourceOrderService teamDividentsSourceOrderService;
|
| | |
|
| | | /**
|
| | | * 订单列表
|
| | |
| | | } else if (goodsType != null && goodsType == 0) {
|
| | | goodsType = null; // 所有平台订单
|
| | | }
|
| | | |
| | |
|
| | | List<Integer> listSource = new ArrayList<>();
|
| | | if (goodsType != null) {
|
| | | listSource.add(goodsType);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | try {
|
| | | if (slotTime != null) {
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
|
| | |
| | | }
|
| | |
|
| | | String orderFindUrl = null;
|
| | | |
| | |
|
| | | try {
|
| | | long count = 0;
|
| | |
| | | if (todayMoney == null) {
|
| | | todayMoney = new BigDecimal(0.00);
|
| | | }
|
| | | |
| | |
|
| | | // 判断是否需要显示订单找回提示
|
| | | if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | if (state ==null && page == 1) {
|
| | | if (redisManager.frequencyLimit("orderlist-" + acceptData.getDevice(), 8, 4)||count==0L) {// 8秒内请求3次触发
|
| | | if (state == null && page == 1) {
|
| | | if (redisManager.frequencyLimit("orderlist-" + acceptData.getDevice(), 8, 4) || count == 0L) {// 8秒内请求3次触发
|
| | | orderFindUrl = configService.get(ConfigKeyEnum.orderFindNotifyUrl.getKey());
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | return startTime;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取团队订单统计
|
| | | * @Title: getTeamOrderStatistic
|
| | | * @Description: |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | @RequestMapping(value = "getTeamOrderStatistic")
|
| | | public void getTeamOrderStatistic(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | long now = System.currentTimeMillis();
|
| | | TeamOrderStatisticVO vo = new TeamOrderStatisticVO();
|
| | | Date minDate = new Date(TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(now, "yyyyMMdd"), "yyyyMMdd"));
|
| | | Date maxDate = new Date(
|
| | | TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(now + 1000 * 60 * 60 * 24L, "yyyyMMdd"), "yyyyMMdd"));
|
| | | List<Integer> countList = new ArrayList<>();
|
| | | // 统计今日
|
| | | TeamOrderStatistic statistic = teamOrderStatisticService.countByUidAndDate(uid, minDate, maxDate);
|
| | | if (statistic == null) {
|
| | | countList.add(0);
|
| | | countList.add(0);
|
| | | countList.add(0);
|
| | | } else {
|
| | | countList.add(statistic.getDirectOrderCount() == null ? 0 : statistic.getDirectOrderCount());
|
| | | countList.add(statistic.getInDirectOrderCount() == null ? 0 : statistic.getInDirectOrderCount());
|
| | | countList.add(statistic.getOtherOrderCount() == null ? 0 : statistic.getOtherOrderCount());
|
| | | }
|
| | |
|
| | | vo.setToday(countList);
|
| | |
|
| | | // 统计昨日
|
| | | minDate = new Date(
|
| | | TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(now - 1000 * 60 * 60 * 24L, "yyyyMMdd"), "yyyyMMdd"));
|
| | | maxDate = new Date(TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(now, "yyyyMMdd"), "yyyyMMdd"));
|
| | |
|
| | | countList = new ArrayList<>();
|
| | | statistic = teamOrderStatisticService.countByUidAndDate(uid, minDate, maxDate);
|
| | | if (statistic == null) {
|
| | | countList.add(0);
|
| | | countList.add(0);
|
| | | countList.add(0);
|
| | | } else {
|
| | | countList.add(statistic.getDirectOrderCount() == null ? 0 : statistic.getDirectOrderCount());
|
| | | countList.add(statistic.getInDirectOrderCount() == null ? 0 : statistic.getInDirectOrderCount());
|
| | | countList.add(statistic.getOtherOrderCount() == null ? 0 : statistic.getOtherOrderCount());
|
| | | }
|
| | |
|
| | | vo.setYesterday(countList);
|
| | |
|
| | | // 统计本月
|
| | |
|
| | | minDate = new Date(
|
| | | TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(now - 1000 * 60 * 60 * 24L, "yyyyMM"), "yyyyMM"));
|
| | | Calendar ca = Calendar.getInstance();
|
| | | ca.setTimeInMillis(now);
|
| | |
|
| | | ca.add(Calendar.MONTH, 1);
|
| | |
|
| | | maxDate = new Date(
|
| | | TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(ca.getTimeInMillis(), "yyyyMM"), "yyyyMM"));
|
| | |
|
| | | countList = new ArrayList<>();
|
| | | statistic = teamOrderStatisticService.countByUidAndDate(uid, minDate, maxDate);
|
| | | if (statistic == null) {
|
| | | countList.add(0);
|
| | | countList.add(0);
|
| | | countList.add(0);
|
| | | } else {
|
| | | countList.add(statistic.getDirectOrderCount() == null ? 0 : statistic.getDirectOrderCount());
|
| | | countList.add(statistic.getInDirectOrderCount() == null ? 0 : statistic.getInDirectOrderCount());
|
| | | countList.add(statistic.getOtherOrderCount() == null ? 0 : statistic.getOtherOrderCount());
|
| | | }
|
| | |
|
| | | vo.setThisMonth(countList);
|
| | |
|
| | | // 统计 累计
|
| | | minDate = new Date(0L);
|
| | | maxDate = new Date(now);
|
| | | countList = new ArrayList<>();
|
| | | statistic = teamOrderStatisticService.countByUidAndDate(uid, minDate, maxDate);
|
| | | if (statistic == null) {
|
| | | countList.add(0);
|
| | | countList.add(0);
|
| | | countList.add(0);
|
| | | } else {
|
| | | countList.add(statistic.getDirectOrderCount() == null ? 0 : statistic.getDirectOrderCount());
|
| | | countList.add(statistic.getInDirectOrderCount() == null ? 0 : statistic.getInDirectOrderCount());
|
| | | countList.add(statistic.getOtherOrderCount() == null ? 0 : statistic.getOtherOrderCount());
|
| | | }
|
| | |
|
| | | vo.setTotal(countList);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取团队订单排行
|
| | | * @Title: getTeamOrderRank
|
| | | * @Description: |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param type 1-今日 2-昨日 3-本月
|
| | | * @param out |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | @RequestMapping(value = "getTeamOrderRank")
|
| | | public void getTeamOrderRank(AcceptData acceptData, Long uid, int type, PrintWriter out) {
|
| | | // TODO 需求不明确
|
| | |
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "searchOrderTeam")
|
| | | public void searchOrderTeam(AcceptData acceptData, String key, PrintWriter out) {
|
| | | // teamDividentsSourceOrderService.selectByOrderNoSourceType(orderNo, sourceType);
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.controller.client.v1;
|
| | |
|
| | | import java.io.IOException;
|
| | | import java.io.PrintWriter;
|
| | | import java.lang.reflect.Type;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | | import org.springframework.web.multipart.MultipartHttpServletRequest;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.entity.FileUploadResult;
|
| | | import org.yeshi.utils.tencentcloud.COSManager;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.google.gson.JsonElement;
|
| | | import com.google.gson.JsonPrimitive;
|
| | | import com.google.gson.JsonSerializationContext;
|
| | | import com.google.gson.JsonSerializer;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.GiveVIPApplyInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.exception.ParamsException;
|
| | | import com.yeshi.fanli.exception.user.vip.GiveVIPApplyInfoException;
|
| | | import com.yeshi.fanli.service.inter.user.vip.GiveVIPApplyInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVipConfigService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.FilePathEnum;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.factory.user.vip.GiveVIPApplyInfoRecordVOFactory;
|
| | | import com.yeshi.fanli.vo.user.vip.GiveVIPApplyInfoRecordVO;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | /**
|
| | | * 会员
|
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Controller
|
| | | @RequestMapping("api/v1/user/vip")
|
| | | public class UserVipController {
|
| | |
|
| | | // 会员申请
|
| | | @Resource
|
| | | private GiveVIPApplyInfoService giveVIPApplyInfoService;
|
| | |
|
| | | @Resource
|
| | | private UserVipConfigService userVipConfigService;
|
| | |
|
| | | @RequestMapping(value = "applyVip")
|
| | | public void applyVip(AcceptData acceptData, GiveVIPApplyInfo info, String callback, PrintWriter out) {
|
| | | try {
|
| | | info = giveVIPApplyInfoService.addGiveVIPApplyInfo(info);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("申请成功"));
|
| | | } catch (ParamsException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请将信息填写完整"));
|
| | | } catch (GiveVIPApplyInfoException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | | }
|
| | | }
|
| | |
|
| | | // 提交申请信息
|
| | | @RequestMapping(value = "uploadApplyInfo")
|
| | | public void uploadApplyInfo(AcceptData acceptData, GiveVIPApplyInfo info, String callback,
|
| | | HttpServletRequest request, PrintWriter out) {
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(info.getId())) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("申请ID为空"));
|
| | | return;
|
| | | }
|
| | |
|
| | | GiveVIPApplyInfo oldInfo = giveVIPApplyInfoService.selectByPrimaryKey(info.getId());
|
| | | if (oldInfo == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("申请记录不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (oldInfo.getState() != GiveVIPApplyInfo.STATE_NO_INFO) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("资料以及提交"));
|
| | | return;
|
| | | }
|
| | |
|
| | | List<MultipartFile> files = new ArrayList<MultipartFile>();
|
| | | // 有文件
|
| | | if (request instanceof MultipartHttpServletRequest) {
|
| | | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
| | | Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
| | | for (String key : fileMap.keySet()) {
|
| | | MultipartFile file = fileMap.get(key);
|
| | | files.add(file);
|
| | | }
|
| | | }
|
| | |
|
| | | // 保存成功后再上传文件
|
| | | if (files.size() > 0) {
|
| | | List<String> imgList = new ArrayList<>();
|
| | | for (MultipartFile file : files) {
|
| | | String fileName = info.getSourceUid() + "_" + System.currentTimeMillis() + "_"
|
| | | + file.getOriginalFilename();
|
| | | fileName = FilePathEnum.vipApply.getPath() + fileName;
|
| | | try {
|
| | | FileUploadResult result = COSManager.getInstance().uploadFile(file.getInputStream(), fileName);
|
| | | imgList.add(result.getUrl());
|
| | | } catch (IOException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | // 设置图片
|
| | | if (imgList.size() > 0)
|
| | | info.setImgList(imgList);
|
| | | info.setState(GiveVIPApplyInfo.STATE_NOT_VERIFY);
|
| | | giveVIPApplyInfoService.updateGiveVIPApplyInfo(info);
|
| | | }
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("资料提交成功"));
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "getApplyRecordList")
|
| | | public void getApplyRecordList(AcceptData acceptData, Long uid, int page, String callback, PrintWriter out) {
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (Constant.IS_TEST) {
|
| | | page = 1;
|
| | | }
|
| | | List<GiveVIPApplyInfo> list = giveVIPApplyInfoService.listByTargetUid(uid, page, Constant.PAGE_SIZE);
|
| | | long count = giveVIPApplyInfoService.countByTargetUid(uid);
|
| | | String uploadInfoLink = userVipConfigService.getValueByKey("apply_vip_upload_info_link");
|
| | | String vipLink = userVipConfigService.getValueByKey("vip_link");
|
| | |
|
| | | List<GiveVIPApplyInfoRecordVO> recordList = new ArrayList<>();
|
| | | for (GiveVIPApplyInfo info : list) {
|
| | | recordList.add(GiveVIPApplyInfoRecordVOFactory.create(info, uploadInfoLink, vipLink));
|
| | | }
|
| | |
|
| | | GsonBuilder gb = new GsonBuilder().registerTypeAdapter(java.util.Date.class, new JsonSerializer<Date>() {
|
| | |
|
| | | public JsonElement serialize(Date arg0, Type arg1, JsonSerializationContext arg2) {
|
| | | return new JsonPrimitive(TimeUtil.getGernalTime(arg0.getTime(), "yyyy.MM.dd HH:mm"));
|
| | | }
|
| | | }).registerTypeAdapter(UserLevelEnum.class, new JsonSerializer<UserLevelEnum>() {
|
| | |
|
| | | public JsonElement serialize(UserLevelEnum arg0, Type arg1, JsonSerializationContext arg2) {
|
| | | return new JsonPrimitive(arg0.getName());
|
| | | }
|
| | | });
|
| | |
|
| | | Gson gson = gb.create();
|
| | |
|
| | | if (Constant.IS_TEST) {
|
| | | count = 100;
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("list", gson.toJson(recordList));
|
| | | data.put("count", count);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | * @throws |
| | | */ |
| | | List<TeamDividentsSourceOrder> lisByUidAndPreSendTimeAndState(@Param("uid") Long uid, |
| | | @Param("preSendTime") Date preSendTime, @Param("state") int state, @Param("start") long start, @Param("count") int count); |
| | | @Param("preSendTime") Date preSendTime, @Param("state") int state, @Param("start") long start, |
| | | @Param("count") int count); |
| | | |
| | | long countByUidAndPreSendTimeAndState(@Param("uid") Long uid, @Param("preSendTime") Date preSendTime, |
| | | @Param("state") int state); |
| | |
| | | * int 返回类型 |
| | | * @throws |
| | | */ |
| | | int setStateByUidAndState(@Param("uid") Long uid, @Param("targetState") int targetState, @Param("state") int state, @Param("beiZhu") String beiZhu); |
| | | int setStateByUidAndState(@Param("uid") Long uid, @Param("targetState") int targetState, @Param("state") int state, |
| | | @Param("beiZhu") String beiZhu); |
| | | |
| | | /** |
| | | * 根据订单信息检索 |
| | |
| | | TeamDividentsSourceOrder selectByOrderNoAndSourceType(@Param("orderNo") String orderNo, |
| | | @Param("sourceType") int sourceType); |
| | | |
| | | List<TeamDividentsSourceOrder> listByOrderNoOrSourceUid(@Param("orderNo") String orderNo, @Param("uid") Long uid, |
| | | @Param("start") long start, @Param("count") int count); |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dao.user.vip;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import org.springframework.data.domain.Sort;
|
| | | import org.springframework.data.mongodb.core.query.Criteria;
|
| | | import org.springframework.data.mongodb.core.query.Query;
|
| | | import org.springframework.data.mongodb.core.query.Update;
|
| | | import org.springframework.stereotype.Repository;
|
| | |
|
| | | import com.yeshi.fanli.dao.MongodbBaseDao;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.GiveVIPApplyInfo;
|
| | |
|
| | | @Repository
|
| | | public class GiveVIPApplyInfoDao extends MongodbBaseDao<GiveVIPApplyInfo> {
|
| | |
|
| | | /**
|
| | | * 查询列表
|
| | | * @Title: list
|
| | | * @Description: |
| | | * @param sourceUid
|
| | | * @param state
|
| | | * @param start
|
| | | * @param count
|
| | | * @return |
| | | * List<GiveVIPApplyInfo> 返回类型
|
| | | * @throws
|
| | | */
|
| | | public List<GiveVIPApplyInfo> list(Long targetUid, Integer state, int start, int count) {
|
| | | Query query = new Query();
|
| | |
|
| | | List<Criteria> list = new ArrayList<Criteria>();
|
| | | if (targetUid != null)
|
| | | list.add(Criteria.where("targetUid").is(targetUid));
|
| | |
|
| | | if (state != null)
|
| | | list.add(Criteria.where("state").is(state));
|
| | |
|
| | | if (list.size() > 0) {
|
| | | Criteria[] cas = new Criteria[list.size()];
|
| | | for (int i = 0; i < list.size(); i++)
|
| | | cas[i] = list.get(i);
|
| | | query.addCriteria(new Criteria().andOperator(cas));
|
| | | }
|
| | | query.skip(start);
|
| | | query.limit(count);
|
| | | query.with(new Sort(Sort.Direction.DESC, "createTime"));
|
| | | return findList(query);
|
| | | }
|
| | |
|
| | | public long count(Long targetUid, Integer state) {
|
| | | Query query = new Query();
|
| | |
|
| | | List<Criteria> list = new ArrayList<Criteria>();
|
| | | if (targetUid != null)
|
| | | list.add(Criteria.where("targetUid").is(targetUid));
|
| | |
|
| | | if (state != null)
|
| | | list.add(Criteria.where("state").is(state));
|
| | |
|
| | | if (list.size() > 0) {
|
| | |
|
| | | Criteria[] cas = new Criteria[list.size()];
|
| | | for (int i = 0; i < list.size(); i++)
|
| | | cas[i] = list.get(i);
|
| | | query.addCriteria(new Criteria().andOperator(cas));
|
| | | }
|
| | | return count(query);
|
| | | }
|
| | |
|
| | | public void updateSelective(GiveVIPApplyInfo info) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("id").is(info.getId()));
|
| | | Update update = new Update();
|
| | | if (info.getHasDoOtherPlatform() != null)
|
| | | update.set("hasDoOtherPlatform", info.getHasDoOtherPlatform());
|
| | | if (info.getApplyReason() != null)
|
| | | update.set("getApplyReson", info.getApplyReason());
|
| | | if (info.getImgList() != null)
|
| | | update.set("imgList", info.getImgList());
|
| | | if (info.getLevel() != null)
|
| | | update.set("level", info.getLevel());
|
| | | if (info.getMark() != null)
|
| | | update.set("mark", info.getMark());
|
| | | if (info.getOtherDirectTeams() != null)
|
| | | update.set("otherDirectTeams", info.getOtherDirectTeams());
|
| | | if (info.getOtherInDirectTeams() != null)
|
| | | update.set("otherInDirectTeams", info.getOtherInDirectTeams());
|
| | | if (info.getOtherLevel() != null)
|
| | | update.set("otherLevel", info.getOtherLevel());
|
| | | if (info.getOtherMonthIncome() != null)
|
| | | update.set("otherMonthIncome", info.getOtherMonthIncome());
|
| | | if (info.getOtherPlatformName() != null)
|
| | | update.set("otherPlatformName", info.getOtherPlatformName());
|
| | | if (info.getPhone() != null)
|
| | | update.set("phone", info.getPhone());
|
| | | if (info.getRejectReson() != null)
|
| | | update.set("rejectReson", info.getRejectReson());
|
| | | if (info.getSourceUid() != null)
|
| | | update.set("sourceUid", info.getSourceUid());
|
| | | if (info.getState() != null)
|
| | | update.set("state", info.getState());
|
| | | if (info.getTargetUid() != null)
|
| | | update.set("targetUid", info.getTargetUid());
|
| | | if (info.getVerifyTime() != null)
|
| | | update.set("verifyTime", info.getVerifyTime());
|
| | | if (info.getWxID() != null)
|
| | | update.set("wxID", info.getWxID());
|
| | | update.set("updateTime", new Date());
|
| | | update(query, update);
|
| | | }
|
| | |
|
| | | public void saveImgs(String id, List<String> imgList) {
|
| | | GiveVIPApplyInfo info = new GiveVIPApplyInfo();
|
| | | info.setId(id);
|
| | | info.setImgList(imgList);
|
| | | updateSelective(info);
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.bus.user.vip;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.persistence.Transient;
|
| | |
|
| | | import org.springframework.data.annotation.Id;
|
| | | import org.springframework.data.mongodb.core.index.Indexed;
|
| | | import org.springframework.data.mongodb.core.mapping.Document;
|
| | | import org.springframework.data.mongodb.core.mapping.Field;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | |
|
| | | /**
|
| | | * 会员赠送申请
|
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Document(collection = "giveVIPApplyInfo")
|
| | | public class GiveVIPApplyInfo {
|
| | |
|
| | | public final static int STATE_NO_INFO = -1;// 需要提交资料
|
| | |
|
| | | public final static int STATE_NOT_VERIFY = 0;// 尚未审核
|
| | |
|
| | | public final static int STATE_REJECT = 1;// 拒绝
|
| | |
|
| | | public final static int STATE_SUCCESS = 2;// 开通成功
|
| | |
|
| | | @Id
|
| | | private String id;
|
| | | @Field
|
| | | private Long targetUid;// 开通目标用户ID
|
| | | @Indexed
|
| | | @Field
|
| | | private Long sourceUid;// 开通源用户ID
|
| | | @Field
|
| | | private UserLevelEnum level;// 开通等级
|
| | | @Field
|
| | | private String phone;// 电话号码
|
| | | @Field
|
| | | private String wxID;// 微信号
|
| | | @Field
|
| | | private String applyReason;// 申请原因
|
| | | @Field
|
| | | private Boolean hasDoOtherPlatform;// 是否做过其他平台
|
| | | @Field
|
| | | private String otherPlatformName;// 做过其他平台的名称
|
| | | @Field
|
| | | private Integer otherDirectTeams;// 其他平台的直接粉丝数量
|
| | | @Field
|
| | | private Integer otherInDirectTeams;// 其他平台的间接粉丝数量
|
| | | @Field
|
| | | private String otherLevel;// 其他平台的等级
|
| | | @Field
|
| | | private String otherMonthIncome;// 其他平台的月收入
|
| | | @Field
|
| | | private List<String> imgList;// 上传的图片列表
|
| | | @Field
|
| | | private Integer state;// 状态
|
| | | @Field
|
| | | private Date verifyTime;// 审核时间
|
| | | @Field
|
| | | private String rejectReson;// 拒绝理由
|
| | | @Field
|
| | | private String mark;// 备注
|
| | | @Indexed
|
| | | @Field
|
| | | private Date createTime;// 创建时间
|
| | | @Field
|
| | | private Date updateTime;// 更改时间
|
| | | @Field
|
| | | private Long adminUserId;// 审核人员ID
|
| | |
|
| | | @Transient
|
| | | private String otherPlatformInfo;// 平台信息
|
| | |
|
| | | @Transient
|
| | | private UserInfo targetUser;
|
| | |
|
| | | public String getApplyReason() {
|
| | | return applyReason;
|
| | | }
|
| | |
|
| | | public void setApplyReason(String applyReason) {
|
| | | this.applyReason = applyReason;
|
| | | }
|
| | |
|
| | | public UserInfo getTargetUser() {
|
| | | return targetUser;
|
| | | }
|
| | |
|
| | | public void setTargetUser(UserInfo targetUser) {
|
| | | this.targetUser = targetUser;
|
| | | }
|
| | |
|
| | | public String getOtherPlatformInfo() {
|
| | | return otherPlatformInfo;
|
| | | }
|
| | |
|
| | | public void setOtherPlatformInfo(String otherPlatformInfo) {
|
| | | this.otherPlatformInfo = otherPlatformInfo;
|
| | | }
|
| | |
|
| | | public Long getAdminUserId() {
|
| | | return adminUserId;
|
| | | }
|
| | |
|
| | | public void setAdminUserId(Long adminUserId) {
|
| | | this.adminUserId = adminUserId;
|
| | | }
|
| | |
|
| | | public String getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(String id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Long getTargetUid() {
|
| | | return targetUid;
|
| | | }
|
| | |
|
| | | public void setTargetUid(Long targetUid) {
|
| | | this.targetUid = targetUid;
|
| | | }
|
| | |
|
| | | public Long getSourceUid() {
|
| | | return sourceUid;
|
| | | }
|
| | |
|
| | | public void setSourceUid(Long sourceUid) {
|
| | | this.sourceUid = sourceUid;
|
| | | }
|
| | |
|
| | | public UserLevelEnum getLevel() {
|
| | | return level;
|
| | | }
|
| | |
|
| | | public void setLevel(UserLevelEnum level) {
|
| | | this.level = level;
|
| | | }
|
| | |
|
| | | public String getPhone() {
|
| | | return phone;
|
| | | }
|
| | |
|
| | | public void setPhone(String phone) {
|
| | | this.phone = phone;
|
| | | }
|
| | |
|
| | | public String getWxID() {
|
| | | return wxID;
|
| | | }
|
| | |
|
| | | public void setWxID(String wxID) {
|
| | | this.wxID = wxID;
|
| | | }
|
| | |
|
| | | public Boolean getHasDoOtherPlatform() {
|
| | | return hasDoOtherPlatform;
|
| | | }
|
| | |
|
| | | public void setHasDoOtherPlatform(Boolean hasDoOtherPlatform) {
|
| | | this.hasDoOtherPlatform = hasDoOtherPlatform;
|
| | | }
|
| | |
|
| | | public String getOtherPlatformName() {
|
| | | return otherPlatformName;
|
| | | }
|
| | |
|
| | | public void setOtherPlatformName(String otherPlatformName) {
|
| | | this.otherPlatformName = otherPlatformName;
|
| | | }
|
| | |
|
| | | public Integer getOtherDirectTeams() {
|
| | | return otherDirectTeams;
|
| | | }
|
| | |
|
| | | public void setOtherDirectTeams(Integer otherDirectTeams) {
|
| | | this.otherDirectTeams = otherDirectTeams;
|
| | | }
|
| | |
|
| | | public Integer getOtherInDirectTeams() {
|
| | | return otherInDirectTeams;
|
| | | }
|
| | |
|
| | | public void setOtherInDirectTeams(Integer otherInDirectTeams) {
|
| | | this.otherInDirectTeams = otherInDirectTeams;
|
| | | }
|
| | |
|
| | | public String getOtherLevel() {
|
| | | return otherLevel;
|
| | | }
|
| | |
|
| | | public void setOtherLevel(String otherLevel) {
|
| | | this.otherLevel = otherLevel;
|
| | | }
|
| | |
|
| | | public String getOtherMonthIncome() {
|
| | | return otherMonthIncome;
|
| | | }
|
| | |
|
| | | public void setOtherMonthIncome(String otherMonthIncome) {
|
| | | this.otherMonthIncome = otherMonthIncome;
|
| | | }
|
| | |
|
| | | public List<String> getImgList() {
|
| | | return imgList;
|
| | | }
|
| | |
|
| | | public void setImgList(List<String> imgList) {
|
| | | this.imgList = imgList;
|
| | | }
|
| | |
|
| | | public Integer getState() {
|
| | | return state;
|
| | | }
|
| | |
|
| | | public void setState(Integer state) {
|
| | | this.state = state;
|
| | | }
|
| | |
|
| | | public Date getVerifyTime() {
|
| | | return verifyTime;
|
| | | }
|
| | |
|
| | | public void setVerifyTime(Date verifyTime) {
|
| | | this.verifyTime = verifyTime;
|
| | | }
|
| | |
|
| | | public String getRejectReson() {
|
| | | return rejectReson;
|
| | | }
|
| | |
|
| | | public void setRejectReson(String rejectReson) {
|
| | | this.rejectReson = rejectReson;
|
| | | }
|
| | |
|
| | | public String getMark() {
|
| | | return mark;
|
| | | }
|
| | |
|
| | | public void setMark(String mark) {
|
| | | this.mark = mark;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | public Date getUpdateTime() {
|
| | | return updateTime;
|
| | | }
|
| | |
|
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | | }
|
| | |
| | | public final static int SOURCE_TYPE_ORDER = 1;// 订单型
|
| | |
|
| | | public final static int SOURCE_TYPE_TEAM = 2;// 团队型
|
| | | |
| | | public final static int SOURCE_TYPE_ARTIFICIAL = 0;// 人工升级
|
| | |
|
| | | @Column(name = "vpi_id")
|
| | | private Long id;
|
| | |
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.Order;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | |
|
| | | /**
|
New file |
| | |
| | | package com.yeshi.fanli.entity.order;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.springframework.data.annotation.Id;
|
| | | import org.springframework.data.mongodb.core.index.Indexed;
|
| | | import org.springframework.data.mongodb.core.mapping.Document;
|
| | | import org.springframework.data.mongodb.core.mapping.Field;
|
| | |
|
| | | /**
|
| | | * 团队订单统计
|
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | |
|
| | | @Document(collection = "teamOrderStatistic")
|
| | | public class TeamOrderStatistic {
|
| | | @Id
|
| | | private String id;
|
| | | @Field
|
| | | @Indexed
|
| | | private Long uid;
|
| | | @Field
|
| | | @Indexed
|
| | | private Date day;
|
| | | @Field
|
| | | private Integer directOrderCount;// 直接订单数
|
| | | @Field
|
| | | private Integer inDirectOrderCount;// 间接订单数
|
| | | @Field
|
| | | private Integer otherOrderCount;// 二级外订单
|
| | | @Field
|
| | | private Date createTime;// 创建时间
|
| | | @Field
|
| | | private Date updateTime;// 更新时间
|
| | |
|
| | | public String getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(String id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Long getUid() {
|
| | | return uid;
|
| | | }
|
| | |
|
| | | public void setUid(Long uid) {
|
| | | this.uid = uid;
|
| | | }
|
| | |
|
| | | public Date getDay() {
|
| | | return day;
|
| | | }
|
| | |
|
| | | public void setDay(Date day) {
|
| | | this.day = day;
|
| | | }
|
| | |
|
| | | public Integer getDirectOrderCount() {
|
| | | return directOrderCount;
|
| | | }
|
| | |
|
| | | public void setDirectOrderCount(Integer directOrderCount) {
|
| | | this.directOrderCount = directOrderCount;
|
| | | }
|
| | |
|
| | | public Integer getInDirectOrderCount() {
|
| | | return inDirectOrderCount;
|
| | | }
|
| | |
|
| | | public void setInDirectOrderCount(Integer inDirectOrderCount) {
|
| | | this.inDirectOrderCount = inDirectOrderCount;
|
| | | }
|
| | |
|
| | | public Integer getOtherOrderCount() {
|
| | | return otherOrderCount;
|
| | | }
|
| | |
|
| | | public void setOtherOrderCount(Integer otherOrderCount) {
|
| | | this.otherOrderCount = otherOrderCount;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | public Date getUpdateTime() {
|
| | | return updateTime;
|
| | | }
|
| | |
|
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.exception.user.vip;
|
| | |
|
| | | import com.yeshi.fanli.exception.BaseException;
|
| | |
|
| | | /**
|
| | | * 赠送会员异常
|
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class GiveVIPApplyInfoException extends BaseException {
|
| | |
|
| | |
|
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | | public GiveVIPApplyInfoException(int code, String msg) {
|
| | | super(code, msg);
|
| | | }
|
| | |
|
| | | public GiveVIPApplyInfoException() {
|
| | | super();
|
| | | }
|
| | | }
|
| | |
| | | tdo_uid=#{uid} and tdo_pre_send_time=#{preSendTime} and |
| | | tdo_state=#{state} |
| | | </select> |
| | | |
| | | |
| | | <select id="listUidByPreSendTimeAndState" resultType="java.lang.Long">select |
| | | distinct(tdo_uid) from yeshi_ec_team_dividents_source_order where |
| | | tdo_pre_send_time=#{preSendTime} and |
| | | tdo_state=#{state} limit |
| | | #{start},#{count} |
| | | </select> |
| | | |
| | | |
| | | <select id="countUidByPreSendTimeAndState" resultType="java.lang.Long">select |
| | | count(distinct(tdo_uid)) from yeshi_ec_team_dividents_source_order |
| | | where tdo_pre_send_time=#{preSendTime} and |
| | | tdo_state=#{state} |
| | | </select> |
| | | |
| | | |
| | | <update id="setStateByUidAndState"> |
| | | update yeshi_ec_team_dividents_source_order |
| | | <set>tdo_state=#{targetState}, tdo_update_time=now(), |
| | |
| | | </set> |
| | | where tdo_uid = #{uid} and tdo_state=#{state} |
| | | </update> |
| | | |
| | | <select id="selectByOrderNoAndSourceType" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_team_dividents_source_order where |
| | | tdo_order_no=#{orderNo} and tdo_source_type=#{sourceType} |
| | | </select> |
| | | |
| | | |
| | | <select id="listByOrderNoOrSourceUid" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_team_dividents_source_order where |
| | | tdo_order_no=#{orderNo} or tdo_uid=#{uid} limit #{start},#{count} |
| | | </select> |
| | | |
| | | |
| | | |
| | | </mapper> |
| | |
| | | json.put("payee_type", "ALIPAY_LOGONID");
|
| | | json.put("payee_account", extract.getAccount());
|
| | | json.put("amount", extract.getMoney());
|
| | | json.put("payer_show_name", appName + "App" + "提现");
|
| | | json.put("payer_show_name", appName);
|
| | | json.put("payee_real_name", extract.getName());
|
| | | json.put("remark", "来自" + appName + "App" + "的提现");
|
| | | json.put("remark", "来自重庆快省科技有限公司");
|
| | | request.setBizContent(json.toString());
|
| | | AlipayFundTransToaccountTransferResponse response = null;
|
| | | try {
|
| | |
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | |
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<TeamDividentsSourceOrder> listByOrderNoOrUid(String orderNo, Long uid) {
|
| | | return null;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | // 有重复的交易ID不处理
|
| | | if (tradesIds.size() != list.size()) {
|
| | | // 去除重复交易ID
|
| | | tradesIds = new HashSet<>();
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | if (tradesIds.contains(list.get(i).getTradeId())) {
|
| | | list.remove(i--);
|
| | | } else
|
| | | tradesIds.add(list.get(i).getTradeId());
|
| | | }
|
| | |
|
| | | LogHelper.test("检测到交易ID重复问题:" + orderId);
|
| | | throw new Exception();
|
| | | // throw new Exception();
|
| | | }
|
| | |
|
| | | List<TaoBaoOrder> oldOrderList = taoBaoOrderMapper.selectTaoBaoOrderByOrderId(orderId);
|
| | |
| | |
|
| | | @Resource
|
| | | private MsgAccountDetailService msgAccountDetailService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private MsgExtraService msgExtraService;
|
| | |
|
| | |
| | |
|
| | | @Override
|
| | | public void taoBaoAuthFail(Long uid, String taoBaoNickName, String reason) {
|
| | | saveDetail(MsgAccountDetailFactory.createBindFail(uid, MsgAccountDetailFactory.TYPE_TB, |
| | | saveDetail(MsgAccountDetailFactory.createBindFail(uid, MsgAccountDetailFactory.TYPE_TB,
|
| | | MsgAccountDetailFactory.WAY_CHANGE, reason));
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public void createChangeInviteCode(Long uid, String oldCode, String newCode) {
|
| | | saveDetail(MsgAccountDetailFactory.createChangeInviteCode(uid, oldCode, newCode));
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public void vipPreUpgrade(Long uid, String originalName, String upName, int days, long targetNum1, Long targetNum2, boolean teamPass) {
|
| | | saveDetail( MsgAccountDetailFactory.vipPreUpgrade(uid, originalName, upName, days, targetNum1,targetNum2, teamPass));
|
| | | public void vipPreUpgrade(Long uid, String originalName, String upName, int days, long targetNum1, Long targetNum2,
|
| | | boolean teamPass) {
|
| | | saveDetail(MsgAccountDetailFactory.vipPreUpgrade(uid, originalName, upName, days, targetNum1, targetNum2,
|
| | | teamPass));
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public void vipUpgradeSuccess(Long uid, int days) {
|
| | | saveDetail(MsgAccountDetailFactory.vipUpgradeSuccess(uid, days));
|
| | |
| | | public void vipUpgradeFail(Long uid, String reason) {
|
| | | saveDetail(MsgAccountDetailFactory.vipUpgradeFail(uid, reason));
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public void teacherInvite(Long uid, String nickname,String kefuName, String kefuWX) {
|
| | | saveDetail(MsgAccountDetailFactory.teacherInvite(uid, nickname, kefuName, kefuWX));
|
| | | public void teacherInvite(Long uid, String nickname, String kefuName, String kefuWX) {
|
| | | saveDetail(MsgAccountDetailFactory.teacherInvite(uid, nickname, kefuName, kefuWX));
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public void teacherSuccess(Long uid, int days, String kefuName, String kefuWX) {
|
| | | saveDetail(MsgAccountDetailFactory.teacherSuccess(uid, days, kefuName, kefuWX));
|
| | | }
|
| | | |
| | |
|
| | | private void saveDetail(MsgAccountDetail detail) {
|
| | | try {
|
| | | msgAccountDetailService.addMsgAccountDetail(detail);
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public void artificialVipUpgradePass(Long uid, String originalName, String upName, int days) {
|
| | | saveDetail(MsgAccountDetailFactory.artificialVipUpgradeSuccess(uid, originalName, upName, days));
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void artificialVipUpgradeReject(Long uid, String originalName, String upName, String reson) {
|
| | | saveDetail(MsgAccountDetailFactory.artificialVipUpgradeFail(uid, originalName, upName, reson));
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.user.vip;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.scheduling.annotation.Async;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.yeshi.fanli.dao.user.vip.GiveVIPApplyInfoDao;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoRegister;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.GiveVIPApplyInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserVIPPreInfo;
|
| | | import com.yeshi.fanli.exception.ParamsException;
|
| | | import com.yeshi.fanli.exception.user.vip.GiveVIPApplyInfoException;
|
| | | import com.yeshi.fanli.exception.user.vip.UserVIPPreInfoException;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoRegisterService;
|
| | | import com.yeshi.fanli.service.inter.user.msg.UserAccountMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.GiveVIPApplyInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPPreInfoService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.user.UserLevelUtil;
|
| | |
|
| | | @Service
|
| | | public class GiveVIPApplyInfoServiceImpl implements GiveVIPApplyInfoService {
|
| | |
|
| | | @Resource
|
| | | private GiveVIPApplyInfoDao giveVIPApplyInfoDao;
|
| | |
|
| | | @Resource
|
| | | private UserVIPPreInfoService userVIPPreInfoService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoRegisterService userInfoRegisterService;
|
| | |
|
| | | @Resource
|
| | | private UserAccountMsgNotificationService userAccountMsgNotificationService;
|
| | |
|
| | | @Async
|
| | | @Override
|
| | | public void saveImgs(String id, List<String> imgList) {
|
| | | giveVIPApplyInfoDao.saveImgs(id, imgList);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void updateGiveVIPApplyInfo(GiveVIPApplyInfo info) {
|
| | | giveVIPApplyInfoDao.updateSelective(info);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public GiveVIPApplyInfo addGiveVIPApplyInfo(GiveVIPApplyInfo info)
|
| | | throws ParamsException, GiveVIPApplyInfoException {
|
| | |
|
| | | if (info.getTargetUid() == null || info.getSourceUid() == null || info.getLevel() == null)
|
| | | throw new ParamsException(1, "参数不完整");
|
| | |
|
| | | info.setId(StringUtil
|
| | | .Md5(String.format("%s#%s#%s", info.getTargetUid(), info.getSourceUid(), info.getLevel().name())));
|
| | |
|
| | | if (info.getCreateTime() == null)
|
| | | info.setCreateTime(new Date());
|
| | | if (info.getState() == null)
|
| | | info.setState(GiveVIPApplyInfo.STATE_NO_INFO);
|
| | |
|
| | | GiveVIPApplyInfo oldInfo = giveVIPApplyInfoDao.get(info.getId());
|
| | |
|
| | | if (oldInfo != null) {
|
| | | throw new GiveVIPApplyInfoException(2, "已经提交过申请");
|
| | | }
|
| | | giveVIPApplyInfoDao.save(info);
|
| | | return info;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<GiveVIPApplyInfo> listByTargetUid(Long uid, int page, int pageSize) {
|
| | | return giveVIPApplyInfoDao.list(uid, null, (page - 1) * pageSize, pageSize);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countByTargetUid(Long uid) {
|
| | | return giveVIPApplyInfoDao.count(uid, null);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<GiveVIPApplyInfo> listByStateAndTargetUid(Long targetUid,Integer state, int page, int pageSize) {
|
| | | return giveVIPApplyInfoDao.list(targetUid, state, (page - 1) * pageSize, pageSize);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countByStateAndTargetUid(Long targetUid,Integer state) {
|
| | | return giveVIPApplyInfoDao.count(targetUid, state);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public GiveVIPApplyInfo selectByPrimaryKey(String id) {
|
| | | return giveVIPApplyInfoDao.get(id);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public void pass(String id, Long adminId) throws GiveVIPApplyInfoException, UserVIPPreInfoException {
|
| | | GiveVIPApplyInfo info = selectByPrimaryKey(id);
|
| | | if (info == null)
|
| | | throw new GiveVIPApplyInfoException(1, "记录不存在");
|
| | |
|
| | | if (info.getState() == GiveVIPApplyInfo.STATE_NO_INFO)
|
| | | throw new GiveVIPApplyInfoException(2, "用户未提交资料");
|
| | |
|
| | | if (info.getState() == GiveVIPApplyInfo.STATE_REJECT)
|
| | | throw new GiveVIPApplyInfoException(3, "已经被拒绝");
|
| | |
|
| | | if (info.getState() == GiveVIPApplyInfo.STATE_SUCCESS)
|
| | | throw new GiveVIPApplyInfoException(4, "已经被通过");
|
| | |
|
| | | Long uid = info.getTargetUid();
|
| | | // 查询当前的条件
|
| | | UserVIPPreInfo preInfo = userVIPPreInfoService.getLatestProcessInfo(uid);
|
| | | if (preInfo == null || preInfo.getProcess() < info.getLevel().getLevel()) {
|
| | | // 会员升级
|
| | | UserVIPPreInfo newInfo = new UserVIPPreInfo();
|
| | | newInfo.setSourceType(UserVIPPreInfo.SOURCE_TYPE_ARTIFICIAL);
|
| | | newInfo.setProcess(info.getLevel().getLevel());
|
| | | newInfo.setUid(uid);
|
| | | userVIPPreInfoService.addUserVIPPreInfo(newInfo);
|
| | | // 发送消息
|
| | |
|
| | | // 计算相隔天数
|
| | | // 默认值
|
| | | Date lastUpgradeTime = new Date(1577836800000L);
|
| | | if (preInfo != null)
|
| | | lastUpgradeTime = preInfo.getCreateTime();
|
| | | else {
|
| | | UserInfoRegister userInfoRegister = userInfoRegisterService.selectByPrimaryKey(uid);
|
| | | if (userInfoRegister != null && userInfoRegister.getCreateTime() != null) {
|
| | | lastUpgradeTime = userInfoRegister.getCreateTime();
|
| | | }
|
| | | }
|
| | |
|
| | | int days = TimeUtil.getDayDifferenceCount(lastUpgradeTime, new Date());
|
| | |
|
| | | userAccountMsgNotificationService.artificialVipUpgradePass(uid,
|
| | | preInfo == null ? UserLevelEnum.daRen.getName()
|
| | | : UserLevelUtil.getByLevel(preInfo.getProcess()).getName(),
|
| | | info.getLevel().getName(), days);
|
| | | }
|
| | |
|
| | | GiveVIPApplyInfo update = new GiveVIPApplyInfo();
|
| | | update.setId(info.getId());
|
| | | update.setState(GiveVIPApplyInfo.STATE_SUCCESS);
|
| | | update.setVerifyTime(new Date());
|
| | | update.setAdminUserId(adminId);
|
| | | giveVIPApplyInfoDao.updateSelective(update);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public void reject(String id, Long adminId, String reason) throws GiveVIPApplyInfoException {
|
| | | GiveVIPApplyInfo info = selectByPrimaryKey(id);
|
| | | if (info == null)
|
| | | throw new GiveVIPApplyInfoException(1, "记录不存在");
|
| | |
|
| | | if (info.getState() == GiveVIPApplyInfo.STATE_REJECT)
|
| | | throw new GiveVIPApplyInfoException(3, "已经被拒绝");
|
| | |
|
| | | if (info.getState() == GiveVIPApplyInfo.STATE_SUCCESS)
|
| | | throw new GiveVIPApplyInfoException(4, "已经被通过");
|
| | |
|
| | | GiveVIPApplyInfo update = new GiveVIPApplyInfo();
|
| | | update.setId(info.getId());
|
| | | update.setState(GiveVIPApplyInfo.STATE_REJECT);
|
| | | update.setVerifyTime(new Date());
|
| | | update.setRejectReson(reason);
|
| | | update.setAdminUserId(adminId);
|
| | | giveVIPApplyInfoDao.updateSelective(update);
|
| | |
|
| | | Long uid = info.getTargetUid();
|
| | | UserVIPPreInfo preInfo = userVIPPreInfoService.getLatestProcessInfo(uid);
|
| | |
|
| | | // 拒绝相关消息
|
| | | userAccountMsgNotificationService
|
| | | .artificialVipUpgradeReject(uid,
|
| | | preInfo == null ? UserLevelEnum.daRen.getName()
|
| | | : UserLevelUtil.getByLevel(preInfo.getProcess()).getName(),
|
| | | info.getLevel().getName(), reason);
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.order;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import com.yeshi.fanli.entity.order.TeamOrderStatistic;
|
| | | import com.yeshi.fanli.exception.ParamsException;
|
| | |
|
| | | /**
|
| | | * 团队订单统计服务
|
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public interface TeamOrderStatisticService {
|
| | |
|
| | | /**
|
| | | * 添加统计
|
| | | * @Title: addTeamOrderStatistic
|
| | | * @Description: |
| | | * @param statistic |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | public void addTeamOrderStatistic(TeamOrderStatistic statistic) throws ParamsException;
|
| | |
|
| | | /**
|
| | | * 增加订单数
|
| | | * @Title: increDirectOrder
|
| | | * @Description: |
| | | * @param uid
|
| | | * @param date |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | public void increDirectOrder(Long uid, Date date);
|
| | |
|
| | | public void increIndirectOrder(Long uid, Date date);
|
| | |
|
| | | public void increOtherOrder(Long uid, Date date);
|
| | |
|
| | | /**
|
| | | * 根据日期统计数量
|
| | | * @Title: countByDate
|
| | | * @Description: |
| | | * @param minDate
|
| | | * @param maxDate
|
| | | * @return |
| | | * TeamOrderStatistic 返回类型
|
| | | * @throws
|
| | | */
|
| | | public TeamOrderStatistic countByUidAndDate(Long uid, Date minDate, Date maxDate);
|
| | |
|
| | | }
|
| | |
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.order.dividents.TeamDividentsSourceOrder;
|
| | | import com.yeshi.fanli.exception.ParamsException;
|
| | |
| | | * @throws
|
| | | */
|
| | | public TeamDividentsSourceOrder selectByOrderNoSourceType(String orderNo, int sourceType);
|
| | | |
| | | |
| | | /**
|
| | | * 根据订单号查询
|
| | | * @Title: listByOrderNoSourceType
|
| | | * @Description: |
| | | * @param orderNo
|
| | | * @return |
| | | * List<TeamDividentsSourceOrder> 返回类型
|
| | | * @throws
|
| | | */
|
| | | public List<TeamDividentsSourceOrder> listByOrderNoOrUid(String orderNo,Long uid);
|
| | |
|
| | | /**
|
| | | * 订单结算
|
| | |
| | | * @param targetNum2
|
| | | * @param teamPass true通过队员验证升级
|
| | | */
|
| | | public void vipPreUpgrade(Long uid, String originalName, String upName, int days, long targetNum1, Long targetNum2, boolean teamPass);
|
| | | public void vipPreUpgrade(Long uid, String originalName, String upName, int days, long targetNum1, Long targetNum2,
|
| | | boolean teamPass);
|
| | |
|
| | | /**
|
| | | * 超级会员升级成功
|
| | |
| | | */
|
| | | public void createChangeInviteCode(Long uid, String oldCode, String newCode);
|
| | |
|
| | | /**
|
| | | * 人工升级会员通过
|
| | | * @Title: artificialVipUpgradePass
|
| | | * @Description: |
| | | * @param uid
|
| | | * @param originalName
|
| | | * @param upName
|
| | | * @param days |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | public void artificialVipUpgradePass(Long uid, String originalName, String upName, int days);
|
| | |
|
| | | /**
|
| | | * 人工升级会员拒绝
|
| | | * @Title: artificialVipUpgradeReject
|
| | | * @Description: |
| | | * @param uid
|
| | | * @param originalName
|
| | | * @param upName
|
| | | * @param reson |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | public void artificialVipUpgradeReject(Long uid, String originalName, String upName, String reson);
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.user.vip;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.vip.GiveVIPApplyInfo;
|
| | | import com.yeshi.fanli.exception.ParamsException;
|
| | | import com.yeshi.fanli.exception.user.vip.GiveVIPApplyInfoException;
|
| | | import com.yeshi.fanli.exception.user.vip.UserVIPPreInfoException;
|
| | |
|
| | | //会员赠送记录
|
| | | public interface GiveVIPApplyInfoService {
|
| | |
|
| | | /**
|
| | | * 添加赠送会员记录
|
| | | * @Title: addGiveVIPApplyInfo
|
| | | * @Description: |
| | | * @param info
|
| | | * @return
|
| | | * @throws GiveVIPApplyInfoException |
| | | * GiveVIPApplyInfo 返回类型
|
| | | * @throws
|
| | | */
|
| | | public GiveVIPApplyInfo addGiveVIPApplyInfo(GiveVIPApplyInfo info)
|
| | | throws ParamsException, GiveVIPApplyInfoException;
|
| | |
|
| | | public GiveVIPApplyInfo selectByPrimaryKey(String id);
|
| | |
|
| | | /**
|
| | | * 修改信息
|
| | | * @Title: updateGiveVIPApplyInfo
|
| | | * @Description: |
| | | * @param info |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | public void updateGiveVIPApplyInfo(GiveVIPApplyInfo info);
|
| | |
|
| | | /**
|
| | | * 保存图片
|
| | | * @Title: saveImgs
|
| | | * @Description: |
| | | * @param id
|
| | | * @param imgList |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | public void saveImgs(String id, List<String> imgList);
|
| | |
|
| | | /**
|
| | | * 根据源用户拉取数据
|
| | | * @Title: listBySourceUid
|
| | | * @Description: |
| | | * @param uid
|
| | | * @return |
| | | * List<GiveVIPApplyInfo> 返回类型
|
| | | * @throws
|
| | | */
|
| | | public List<GiveVIPApplyInfo> listByTargetUid(Long uid, int page, int pageSize);
|
| | |
|
| | | public long countByTargetUid(Long uid);
|
| | |
|
| | | /**
|
| | | * 根据状态查询
|
| | | * @Title: listNeedVerify
|
| | | * @Description: |
| | | * @param page
|
| | | * @param pageSize
|
| | | * @return |
| | | * List<GiveVIPApplyInfo> 返回类型
|
| | | * @throws
|
| | | */
|
| | | public List<GiveVIPApplyInfo> listByStateAndTargetUid(Long targetUid, Integer state, int page, int pageSize);
|
| | |
|
| | | public long countByStateAndTargetUid(Long targetUid,Integer state);
|
| | |
|
| | | /**
|
| | | * 通过
|
| | | * @Title: pass
|
| | | * @Description: |
| | | * @param id
|
| | | * @throws GiveVIPApplyInfoException |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | public void pass(String id, Long adminId) throws GiveVIPApplyInfoException,UserVIPPreInfoException;
|
| | |
|
| | | /**
|
| | | * 拒绝
|
| | | * @Title: reject
|
| | | * @Description: |
| | | * @param id
|
| | | * @param adminId 审核人员ID
|
| | | * @param reason 拒绝理由
|
| | | * @throws GiveVIPApplyInfoException |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | public void reject(String id, Long adminId, String reason) throws GiveVIPApplyInfoException;
|
| | |
|
| | | }
|
| | |
| | | ercode("/user/img/invite/", "分享邀请图二维码图片"),
|
| | | shareGoods("/user/img/sharegoods/", "分享商品图片"),
|
| | | shareXCX("/user/img/sharegoods_xcx/", "分享小程序图片"),
|
| | |
|
| | | vipApply("/usr/img/vip/apply/","会员申请用户上传图片"),
|
| | | // 编辑相关
|
| | | apk("/editor/apk/", "上传Apk安装包"), // -- /img/admin/
|
| | | section("/editor/upload_imgs/", "后台上传图片路径"), // -- /img/admin/
|
| | |
| | | goodsEvaluate("/editor/img/evaluate/", "动态发圈"),
|
| | | banLiShopClass("/editor/img/shop/goods_class/", "板栗商城分类图片"),
|
| | | banLiShopGoods("/editor/img/shop/goods/", "板栗商城商品图片");
|
| | | |
| | |
|
| | |
|
| | | private final String path;
|
| | | private final String desc;
|
| | |
| | | public final static int TYPE_WX = 1;// 微信
|
| | | public final static int TYPE_TB = 2;// 淘宝
|
| | | public final static int TYPE_PHONE = 3;// 电话
|
| | | |
| | | |
| | |
|
| | | public final static int WAY_BIND = 1;// 绑定
|
| | | public final static int WAY_CHANGE = 2;// 更换
|
| | | public final static int WAY_UNBIND = 3;// 解绑
|
| | | |
| | |
|
| | | /**
|
| | | * 账号绑定成功
|
| | |
| | | public static MsgAccountDetail createBindSuccess(Long uid, int type, int changeWay) {
|
| | | if (uid == null)
|
| | | return null;
|
| | | |
| | |
|
| | | String info = "";
|
| | | String typeName = "";
|
| | | if (type == TYPE_PHONE) {
|
| | |
| | | info = "微信账号";
|
| | | typeName = "微信号";
|
| | | }
|
| | | |
| | |
|
| | | String way = "";
|
| | | if (changeWay == WAY_BIND) {
|
| | | way = "绑定成功";
|
| | |
| | | } else if (changeWay == WAY_UNBIND) {
|
| | | way = "解绑成功";
|
| | | }
|
| | | |
| | |
|
| | | String beizu = "无";
|
| | | if (type == TYPE_TB && changeWay == WAY_CHANGE) {
|
| | | beizu = "淘宝账号更换绑定后,请务必要用更换后的淘宝账号领券下单";
|
| | | }
|
| | | |
| | |
|
| | | List<CommonMsgItemVO> listMsg = new ArrayList<>();
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("绑定详情", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("恭喜你!" + info +"-"+ way, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | new ClientTextStyleVO("恭喜你!" + info + "-" + way, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("绑定账号", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(typeName, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(beizu, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | |
| | |
|
| | | MsgAccountDetail detail = new MsgAccountDetail();
|
| | | detail.setTitle("绑定账号");
|
| | | detail.setType(MsgTypeAccountTypeEnum.bingding);
|
| | |
| | | return detail;
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 账号绑定失败
|
| | | *
|
| | |
| | | public static MsgAccountDetail createBindFail(Long uid, int type, int changeWay, String reason) {
|
| | | if (uid == null)
|
| | | return null;
|
| | | |
| | |
|
| | | String info = "";
|
| | | String typeName = "";
|
| | | if (type == TYPE_PHONE) {
|
| | |
| | | info = "微信账号";
|
| | | typeName = "微信号";
|
| | | }
|
| | | |
| | |
|
| | | String way = "";
|
| | | if (changeWay == WAY_BIND) {
|
| | | way = "绑定失败";
|
| | |
| | | } else if (changeWay == WAY_UNBIND) {
|
| | | way = "解绑失败";
|
| | | }
|
| | | |
| | | |
| | |
|
| | | List<CommonMsgItemVO> listMsg = new ArrayList<>();
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("绑定详情", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("很抱歉!" + info +"-"+ way, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | new ClientTextStyleVO("很抱歉!" + info + "-" + way, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("绑定账号", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(typeName, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | if (!StringUtil.isNullOrEmpty(reason)) {
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("失败原因", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(reason, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)));
|
| | | listMsg.add(
|
| | | CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("失败原因", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(reason, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)));
|
| | | }
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("无", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | |
| | |
|
| | | MsgAccountDetail detail = new MsgAccountDetail();
|
| | | detail.setTitle("绑定账号");
|
| | | detail.setType(MsgTypeAccountTypeEnum.bingding);
|
| | |
| | | detail.setExtraInfo(new Gson().toJson(listMsg));
|
| | | return detail;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 邀请码修改
|
| | | * @param uid
|
| | |
| | | public static MsgAccountDetail createChangeInviteCode(Long uid, String oldCode, String newCode) {
|
| | | if (uid == null || StringUtil.isNullOrEmpty(oldCode) || StringUtil.isNullOrEmpty(newCode))
|
| | | return null;
|
| | | |
| | |
|
| | | List<CommonMsgItemVO> listMsg = new ArrayList<>();
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("修改类别", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("邀请码修改", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | |
| | |
|
| | | List<ClientTextStyleVO> contentList2 = new ArrayList<>();
|
| | | contentList2.add(new ClientTextStyleVO(String.format("你原邀请码:%s 已经成功修改为新邀请码:", oldCode), ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList2.add(new ClientTextStyleVO(String.format("你原邀请码:%s 已经成功修改为新邀请码:", oldCode),
|
| | | ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList2.add(new ClientTextStyleVO(newCode, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("修改详情", ClientTextStyleVO.COLOR_TITLE),contentList2));
|
| | | |
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("修改详情", ClientTextStyleVO.COLOR_TITLE),
|
| | | contentList2));
|
| | |
|
| | | List<ClientTextStyleVO> contentList3 = new ArrayList<>();
|
| | | contentList3.add(new ClientTextStyleVO("原邀请码依然可以使用", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList3.add(new ClientTextStyleVO(",每个账户ID仅能修改一次", ClientTextStyleVO.COLOR_CONTENT));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("重要提醒", ClientTextStyleVO.COLOR_TITLE),contentList3));
|
| | | |
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("重要提醒", ClientTextStyleVO.COLOR_TITLE),
|
| | | contentList3));
|
| | |
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("无", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | |
| | |
|
| | | MsgAccountDetail detail = new MsgAccountDetail();
|
| | | detail.setTitle("绑定账号");
|
| | | detail.setType(MsgTypeAccountTypeEnum.changeCode);
|
| | |
| | | detail.setExtraInfo(new Gson().toJson(listMsg));
|
| | | return detail;
|
| | | }
|
| | | |
| | |
|
| | | // artificial
|
| | |
|
| | | |
| | | /**
|
| | | * 人工升级会员消息
|
| | | * @Title: artificialVipPreUpgradeSuccess
|
| | | * @Description: |
| | | * @param uid
|
| | | * @param originalName
|
| | | * @param upName
|
| | | * @param days
|
| | | * @return |
| | | * MsgAccountDetail 返回类型
|
| | | * @throws
|
| | | */
|
| | | public static MsgAccountDetail artificialVipUpgradeSuccess(Long uid, String originalName, String upName, int days) {
|
| | | if (uid == null || originalName == null || upName == null)
|
| | | return null;
|
| | |
|
| | | List<CommonMsgItemVO> listMsg = new ArrayList<>();
|
| | |
|
| | | List<ClientTextStyleVO> contentList2 = new ArrayList<>();
|
| | | contentList2.add(new ClientTextStyleVO("你的账户已由" + originalName + "升级为", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList2.add(new ClientTextStyleVO(upName, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("成长详情", ClientTextStyleVO.COLOR_TITLE),
|
| | | contentList2));
|
| | |
|
| | | |
| | | List<ClientTextStyleVO> contentList3 = new ArrayList<>();
|
| | | contentList3.add(new ClientTextStyleVO(days + "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList3.add(new ClientTextStyleVO("天", ClientTextStyleVO.COLOR_CONTENT));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("共耗时", ClientTextStyleVO.COLOR_TITLE),
|
| | | contentList3));
|
| | |
|
| | | |
| | | |
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("对应权益", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("从收到本消息起,你将获得该账户等级对应的全部权益", ClientTextStyleVO.COLOR_CONTENT)));
|
| | |
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("无", ClientTextStyleVO.COLOR_CONTENT)));
|
| | |
|
| | | MsgAccountDetail detail = new MsgAccountDetail();
|
| | | detail.setTitle("等级成长");
|
| | | detail.setType(MsgTypeAccountTypeEnum.vipPgrade);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setRead(false);
|
| | | detail.setExtraInfo(new Gson().toJson(listMsg));
|
| | | return detail;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 人工升级会员消息失败
|
| | | * @Title: artificialVipUpgradeFail
|
| | | * @Description: |
| | | * @param uid
|
| | | * @param originalName
|
| | | * @param upName
|
| | | * @param reson
|
| | | * @return |
| | | * MsgAccountDetail 返回类型
|
| | | * @throws
|
| | | */
|
| | | public static MsgAccountDetail artificialVipUpgradeFail(Long uid, String originalName, String upName,
|
| | | String reson) {
|
| | | if (uid == null || originalName == null || upName == null)
|
| | | return null;
|
| | |
|
| | | List<CommonMsgItemVO> listMsg = new ArrayList<>();
|
| | |
|
| | | List<ClientTextStyleVO> contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("很抱歉!未通过人工审核 ", ClientTextStyleVO.COLOR_CONTENT));
|
| | |
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("成长说明", ClientTextStyleVO.COLOR_TITLE),
|
| | | contentList));
|
| | |
|
| | | List<ClientTextStyleVO> contentList2 = new ArrayList<>();
|
| | | contentList2.add(new ClientTextStyleVO("你的账户仍是" + originalName, ClientTextStyleVO.COLOR_CONTENT));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("成长详情", ClientTextStyleVO.COLOR_TITLE),
|
| | | contentList2));
|
| | |
|
| | | List<ClientTextStyleVO> contentList3 = new ArrayList<>();
|
| | | contentList3.add(new ClientTextStyleVO(reson, ClientTextStyleVO.COLOR_CONTENT));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("拒绝原因", ClientTextStyleVO.COLOR_TITLE),
|
| | | contentList3));
|
| | |
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("如有疑问请联系人工客服", ClientTextStyleVO.COLOR_CONTENT)));
|
| | |
|
| | | MsgAccountDetail detail = new MsgAccountDetail();
|
| | | detail.setTitle("等级成长");
|
| | | detail.setType(MsgTypeAccountTypeEnum.vipPgrade);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setRead(false);
|
| | | detail.setExtraInfo(new Gson().toJson(listMsg));
|
| | | return detail;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 普通会员、高级会员自动提升
|
| | | * @param uid
|
| | |
| | | * @param beizu
|
| | | * @return
|
| | | */
|
| | | public static MsgAccountDetail vipPreUpgrade(Long uid, String originalName, String upName, int days, long targetNum1, |
| | | Long targetNum2, boolean teamPass) {
|
| | | public static MsgAccountDetail vipPreUpgrade(Long uid, String originalName, String upName, int days,
|
| | | long targetNum1, Long targetNum2, boolean teamPass) {
|
| | | if (uid == null || originalName == null || upName == null)
|
| | | return null;
|
| | | |
| | |
|
| | | List<CommonMsgItemVO> listMsg = new ArrayList<>();
|
| | | List<ClientTextStyleVO> contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("恭喜你!有效", ClientTextStyleVO.COLOR_CONTENT));
|
| | | if (teamPass) {
|
| | | contentList.add(new ClientTextStyleVO("直接粉丝已达", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO(targetNum1+"", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO(targetNum1 + "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("人,有效间接粉丝已达", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO(targetNum2+"", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO(targetNum2 + "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("人", ClientTextStyleVO.COLOR_CONTENT));
|
| | | } else {
|
| | | contentList.add(new ClientTextStyleVO("返利+分享订单已达", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO(targetNum1+"", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO(targetNum1 + "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("笔", ClientTextStyleVO.COLOR_CONTENT));
|
| | | }
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("成长说明", ClientTextStyleVO.COLOR_TITLE),contentList));
|
| | | |
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("成长说明", ClientTextStyleVO.COLOR_TITLE),
|
| | | contentList));
|
| | |
|
| | | List<ClientTextStyleVO> contentList2 = new ArrayList<>();
|
| | | contentList2.add(new ClientTextStyleVO("你的账户已由"+originalName+"升级为", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList2.add(new ClientTextStyleVO("你的账户已由" + originalName + "升级为", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList2.add(new ClientTextStyleVO(upName, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("成长详情", ClientTextStyleVO.COLOR_TITLE),contentList2));
|
| | | |
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("成长详情", ClientTextStyleVO.COLOR_TITLE),
|
| | | contentList2));
|
| | |
|
| | | List<ClientTextStyleVO> contentList3 = new ArrayList<>();
|
| | | contentList3.add(new ClientTextStyleVO(days+"", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList3.add(new ClientTextStyleVO(days + "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList3.add(new ClientTextStyleVO("天", ClientTextStyleVO.COLOR_CONTENT));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("共耗时", ClientTextStyleVO.COLOR_TITLE),contentList3));
|
| | | |
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("共耗时", ClientTextStyleVO.COLOR_TITLE),
|
| | | contentList3));
|
| | |
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("对应权益", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("从收到本消息起,你将获得该账户等级对应的全部权益", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | |
| | |
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("无", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | |
| | |
|
| | | MsgAccountDetail detail = new MsgAccountDetail();
|
| | | detail.setTitle("等级成长");
|
| | | detail.setType(MsgTypeAccountTypeEnum.vipPgrade);
|
| | |
| | | detail.setExtraInfo(new Gson().toJson(listMsg));
|
| | | return detail;
|
| | | }
|
| | | |
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 普通会员、高级会员自动提升
|
| | | * @param uid
|
| | |
| | | public static MsgAccountDetail vipUpgradeSuccess(Long uid, int days) {
|
| | | if (uid == null)
|
| | | return null;
|
| | | |
| | |
|
| | | List<CommonMsgItemVO> listMsg = new ArrayList<>();
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("成长说明", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("恭喜你!已通过人工审核", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | |
| | |
|
| | | List<ClientTextStyleVO> contentList2 = new ArrayList<>();
|
| | | contentList2.add(new ClientTextStyleVO("你的账户已由高级会员升级为", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList2.add(new ClientTextStyleVO("超级会员", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("成长详情", ClientTextStyleVO.COLOR_TITLE),contentList2));
|
| | | |
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("成长详情", ClientTextStyleVO.COLOR_TITLE),
|
| | | contentList2));
|
| | |
|
| | | List<ClientTextStyleVO> contentList3 = new ArrayList<>();
|
| | | contentList3.add(new ClientTextStyleVO(days+"", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList3.add(new ClientTextStyleVO(days + "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList3.add(new ClientTextStyleVO("天", ClientTextStyleVO.COLOR_CONTENT));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("共耗时", ClientTextStyleVO.COLOR_TITLE),contentList3));
|
| | | |
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("共耗时", ClientTextStyleVO.COLOR_TITLE),
|
| | | contentList3));
|
| | |
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("对应权益", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("从收到本消息起,你将获得该账户等级对应的全部权益", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | |
| | |
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("感恩努力的自己,让我们携手板栗快省一起成长", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | |
| | |
|
| | | MsgAccountDetail detail = new MsgAccountDetail();
|
| | | detail.setTitle("等级成长");
|
| | | detail.setType(MsgTypeAccountTypeEnum.vipPgrade);
|
| | |
| | | detail.setExtraInfo(new Gson().toJson(listMsg));
|
| | | return detail;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 普通会员、高级会员自动提升
|
| | | * @param uid
|
| | |
| | | public static MsgAccountDetail vipUpgradeFail(Long uid, String reason) {
|
| | | if (uid == null)
|
| | | return null;
|
| | | |
| | |
|
| | | List<CommonMsgItemVO> listMsg = new ArrayList<>();
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("成长说明", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("很抱歉!未通过人工审核", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("成长详情", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("你的账户仍是高级会员", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | |
| | |
|
| | | if (!StringUtil.isNullOrEmpty(reason)) {
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("拒绝原因", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(reason, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(
|
| | | CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("拒绝原因", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(reason, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | }
|
| | | |
| | |
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("如有疑问请联系人工客服", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | |
| | |
|
| | | MsgAccountDetail detail = new MsgAccountDetail();
|
| | | detail.setTitle("等级成长");
|
| | | detail.setType(MsgTypeAccountTypeEnum.vipPgrade);
|
| | |
| | | detail.setExtraInfo(new Gson().toJson(listMsg));
|
| | | return detail;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 资深导师--运营发出邀约
|
| | | * @param uid
|
| | |
| | | * @param kefuWX
|
| | | * @return
|
| | | */
|
| | | public static MsgAccountDetail teacherInvite(Long uid, String nickname,String kefuName, String kefuWX) {
|
| | | public static MsgAccountDetail teacherInvite(Long uid, String nickname, String kefuName, String kefuWX) {
|
| | | if (uid == null)
|
| | | return null;
|
| | | |
| | |
|
| | | List<CommonMsgItemVO> listMsg = new ArrayList<>();
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("邀约原因", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("尊敬的"+ nickname+",你已符合成长为一名资深导师的条件,希望你能加入板栗快省运营团队,与我们共创辉煌", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | new ClientTextStyleVO("尊敬的" + nickname + ",你已符合成长为一名资深导师的条件,希望你能加入板栗快省运营团队,与我们共创辉煌",
|
| | | ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("专属客服", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(kefuName + "-微信号:" +kefuWX, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | new ClientTextStyleVO(kefuName + "-微信号:" + kefuWX, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("对应权益", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("如果你接受邀约,你将获得该账户等级对应的全部权益 ", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("资深导师资格需要后台手动开通,请务必联系专属客服", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | |
| | |
|
| | | MsgAccountDetail detail = new MsgAccountDetail();
|
| | | detail.setTitle("等级成长");
|
| | | detail.setType(MsgTypeAccountTypeEnum.vipPgrade);
|
| | |
| | | detail.setExtraInfo(new Gson().toJson(listMsg));
|
| | | return detail;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 资深导师--运营发出邀约
|
| | | * @param uid
|
| | |
| | | public static MsgAccountDetail teacherSuccess(Long uid, int days, String kefuName, String kefuWX) {
|
| | | if (uid == null)
|
| | | return null;
|
| | | |
| | |
|
| | | List<CommonMsgItemVO> listMsg = new ArrayList<>();
|
| | | List<ClientTextStyleVO> contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("恭喜你!你的账户已由超级会员升级为", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("资深导师", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("成长详情", ClientTextStyleVO.COLOR_TITLE), contentList));
|
| | | |
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("成长详情", ClientTextStyleVO.COLOR_TITLE),
|
| | | contentList));
|
| | |
|
| | | List<ClientTextStyleVO> contentList2 = new ArrayList<>();
|
| | | contentList2.add(new ClientTextStyleVO(days+ "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList2.add(new ClientTextStyleVO(days + "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList2.add(new ClientTextStyleVO("天", ClientTextStyleVO.COLOR_CONTENT));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("成长详情", ClientTextStyleVO.COLOR_TITLE), contentList2));
|
| | | |
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("成长详情", ClientTextStyleVO.COLOR_TITLE),
|
| | | contentList2));
|
| | |
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("邀约原因", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("从收到本消息起,你将获得该账户等级对应的全部权益", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("专属客服", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(kefuName + "-微信号:" +kefuWX, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | new ClientTextStyleVO(kefuName + "-微信号:" + kefuWX, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("与你共创辉煌", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | |
| | |
|
| | | MsgAccountDetail detail = new MsgAccountDetail();
|
| | | detail.setTitle("等级成长");
|
| | | detail.setType(MsgTypeAccountTypeEnum.vipPgrade);
|
New file |
| | |
| | | package com.yeshi.fanli.util.factory.user.vip;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.vip.GiveVIPApplyInfo;
|
| | | import com.yeshi.fanli.vo.user.vip.GiveVIPApplyInfoRecordVO;
|
| | |
|
| | | public class GiveVIPApplyInfoRecordVOFactory {
|
| | |
|
| | | public static GiveVIPApplyInfoRecordVO create(GiveVIPApplyInfo info, String uploadInfoLink, String vipLink) {
|
| | | GiveVIPApplyInfoRecordVO vo = new GiveVIPApplyInfoRecordVO();
|
| | | vo.setCreateTime(info.getCreateTime());
|
| | | vo.setLevel(info.getLevel());
|
| | | if (info.getState() == GiveVIPApplyInfo.STATE_NO_INFO)
|
| | | vo.setLink(uploadInfoLink.replace("[ID]", info.getId()));
|
| | | else
|
| | | vo.setLink(vipLink);
|
| | | if (info.getState() == GiveVIPApplyInfo.STATE_REJECT)
|
| | | vo.setRejectReson(info.getRejectReson());
|
| | | vo.setState(info.getState());
|
| | | vo.setTargetUid(info.getTargetUid());
|
| | | vo.setReson(info.getApplyReason());
|
| | | return vo;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | UserActiveMQMsg msg = new Gson().fromJson(new String(message.getBody()), UserActiveMQMsg.class);
|
| | | Long uid = msg.getUid();
|
| | | // 老用户同步绑定信息
|
| | | |
| | |
|
| | | userInfoModifyRecordService.syncBeforeInfo(uid);
|
| | | // 低版本全部升级普通会员
|
| | |
|
| | |
| | | if (vipInfo == null) {// 没有生成高级及以上会员
|
| | | UserInfoExtra extra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (extra != null && !StringUtil.isNullOrEmpty(extra.getInviteCode())) {
|
| | | // 老用户生成普通会员
|
| | | UserVIPPreInfo vip = new UserVIPPreInfo();
|
| | | vip.setCreateTime(new Date());
|
| | | vip.setProcess(UserVIPPreInfo.PROCESS_1);
|
| | | vip.setUid(uid);
|
| | | vip.setSourceType(UserVIPPreInfo.SOURCE_TYPE_ORDER);
|
| | | try {
|
| | | userVIPPreInfoService.addUserVIPPreInfo(vip);
|
| | | } catch (UserVIPPreInfoException e) {
|
| | | e.printStackTrace();
|
| | |
|
| | | List<Long> uids = new ArrayList<>();
|
| | | uids.add(uid);
|
| | | List<UserInfoRegister> list = userInfoRegisterService.listByMultipleUids(uids);
|
| | | if (list != null && list.size() > 0)// 有注册信息
|
| | | {
|
| | | if (list.get(0).getCreateTime().getTime() < Constant.NEW_ORDER_FANLI_RULE_TIME) {// 增加注册时间限制
|
| | | // 老用户生成普通会员
|
| | | UserVIPPreInfo vip = new UserVIPPreInfo();
|
| | | vip.setCreateTime(new Date());
|
| | | vip.setProcess(UserVIPPreInfo.PROCESS_1);
|
| | | vip.setUid(uid);
|
| | | vip.setSourceType(UserVIPPreInfo.SOURCE_TYPE_ORDER);
|
| | | try {
|
| | | userVIPPreInfoService.addUserVIPPreInfo(vip);
|
| | | } catch (UserVIPPreInfoException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | } else {//之前老版本处理为普通会员的用户升级新版本
|
| | | } else {// 之前老版本处理为普通会员的用户升级新版本
|
| | | if (vipInfo.getProcess() == UserVIPPreInfo.PROCESS_1
|
| | | && vipInfo.getCreateTime().getTime() < TimeUtil
|
| | | .convertToTimeTemp("2020-04-30 14:10:00", "yyyy-MM-dd HH:mm:ss")) {
|
| | |
| | | TimeUtil.getGernalTime(end, "yyyy-MM-dd HH:mm:ss"), null, queryType, orderScene);
|
| | | if (dto != null)
|
| | | orderList.addAll(dto.getOrderList());
|
| | | while (dto.isHasNext()) {
|
| | | while (dto!=null&&dto.isHasNext()) {
|
| | | dto = queryNewOrder(TimeUtil.getGernalTime(start, "yyyy-MM-dd HH:mm:ss"),
|
| | | TimeUtil.getGernalTime(end, "yyyy-MM-dd HH:mm:ss"), dto.getPositionIndex(), queryType,
|
| | | orderScene);
|
New file |
| | |
| | | package com.yeshi.fanli.vo.order;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | //团队订单统计
|
| | | public class TeamOrderStatisticVO {
|
| | | private List<Integer> today;
|
| | | private List<Integer> yesterday;
|
| | | private List<Integer> thisMonth;
|
| | | private List<Integer> total;
|
| | |
|
| | | public List<Integer> getTotal() {
|
| | | return total;
|
| | | }
|
| | |
|
| | | public void setTotal(List<Integer> total) {
|
| | | this.total = total;
|
| | | }
|
| | |
|
| | | public List<Integer> getToday() {
|
| | | return today;
|
| | | }
|
| | |
|
| | | public void setToday(List<Integer> today) {
|
| | | this.today = today;
|
| | | }
|
| | |
|
| | | public List<Integer> getYesterday() {
|
| | | return yesterday;
|
| | | }
|
| | |
|
| | | public void setYesterday(List<Integer> yesterday) {
|
| | | this.yesterday = yesterday;
|
| | | }
|
| | |
|
| | | public List<Integer> getThisMonth() {
|
| | | return thisMonth;
|
| | | }
|
| | |
|
| | | public void setThisMonth(List<Integer> thisMonth) {
|
| | | this.thisMonth = thisMonth;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.vo.user.vip;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | |
|
| | | /**
|
| | | * 会员申请记录
|
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class GiveVIPApplyInfoRecordVO {
|
| | |
|
| | | private String id;
|
| | | private Long targetUid;
|
| | | private Date createTime;
|
| | | private UserLevelEnum level;
|
| | | private int state;// 状态
|
| | | private String reson;
|
| | | private String link;
|
| | | private String rejectReson;
|
| | |
|
| | | public String getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(String id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Long getTargetUid() {
|
| | | return targetUid;
|
| | | }
|
| | |
|
| | | public void setTargetUid(Long targetUid) {
|
| | | this.targetUid = targetUid;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | public UserLevelEnum getLevel() {
|
| | | return level;
|
| | | }
|
| | |
|
| | | public void setLevel(UserLevelEnum level) {
|
| | | this.level = level;
|
| | | }
|
| | |
|
| | | public int getState() {
|
| | | return state;
|
| | | }
|
| | |
|
| | | public void setState(int state) {
|
| | | this.state = state;
|
| | | }
|
| | |
|
| | | public String getReson() {
|
| | | return reson;
|
| | | }
|
| | |
|
| | | public void setReson(String reson) {
|
| | | this.reson = reson;
|
| | | }
|
| | |
|
| | | public String getLink() {
|
| | | return link;
|
| | | }
|
| | |
|
| | | public void setLink(String link) {
|
| | | this.link = link;
|
| | | }
|
| | |
|
| | | public String getRejectReson() {
|
| | | return rejectReson;
|
| | | }
|
| | |
|
| | | public void setRejectReson(String rejectReson) {
|
| | | this.rejectReson = rejectReson;
|
| | | }
|
| | |
|
| | | }
|