| | |
| | | @Resource |
| | | private AdminUserService adminUserService; |
| | | |
| | | @Around("execution(public * com.yeshi.fanli.controller.admin..*.*(..))") |
| | | // @Around("execution(public * com.yeshi.fanli.controller.admin..*.*(..))") |
| | | public Object verifyLoginState(ProceedingJoinPoint joinPoint) throws IOException { |
| | | |
| | | Signature signature = joinPoint.getSignature(); |
| | |
| | |
|
| | | import com.yeshi.fanli.dto.system.ListConfig;
|
| | | import com.yeshi.fanli.entity.AppVersionInfo;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.common.Config;
|
| | | import com.yeshi.fanli.entity.system.ConfigCategory;
|
| | | import com.yeshi.fanli.entity.system.ConfigCategory.ConfigCategoryEnum;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | @RequestMapping(value = "getArticleHot")
|
| | | public void getArticleHot(AcceptData acceptData, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("list", configService.get(ConfigKeyEnum.articleHotWords.getKey()));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 版本号信息
|
| | | *
|
| | |
| | | import com.yeshi.fanli.entity.dynamic.ListComment; |
| | | import com.yeshi.fanli.entity.goods.CommonGoods; |
| | | import com.yeshi.fanli.entity.jd.JDGoods; |
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief; |
| | | import com.yeshi.fanli.exception.dynamic.GoodsEvaluateException; |
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException; |
| | |
| | | import com.yeshi.fanli.util.RedisManager; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | import com.yeshi.fanli.util.TimeUtil; |
| | | import com.yeshi.fanli.util.VersionUtil; |
| | | import com.yeshi.fanli.util.cache.JDGoodsCacheUtil; |
| | | import com.yeshi.fanli.util.cache.PinDuoDuoCacheUtil; |
| | | import com.yeshi.fanli.util.factory.CommonGoodsFactory; |
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory; |
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil; |
| | | import com.yeshi.fanli.vo.common.JumpDetailContentVO; |
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO; |
| | | import com.yeshi.fanli.vo.msg.TokenVO; |
| | | import com.yeshi.fanli.vo.search.GoodsDocParseResultVO; |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 保存信息 |
| | | * |
| | | * @param callback |
| | | * @param special 0a39676f138c4dcba722e321d43c4284 |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "saveGoodsCoupon") |
| | | public void saveGoodsCoupon(String callback, String pid, String content, PrintWriter out) { |
| | | try { |
| | | goodsEvaluateService.saveGoodsCoupon(pid, content); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功")); |
| | | } catch (GoodsEvaluateException e) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg())); |
| | | } catch (Exception e) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("保存失败")); |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 保存信息 |
| | | * |
| | | * @param callback |
| | | * @param pid |
| | | * @param kind : 1单品 2多品 3活动 |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "saveCurrencyCoupon") |
| | | public void saveCurrencyCoupon(String callback, String pid, int kind, CommentInfo commentInfo, PrintWriter out) { |
| | | try { |
| | | goodsEvaluateService.saveCurrencyCoupon(pid, kind, commentInfo); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功")); |
| | | } catch (GoodsEvaluateException e) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg())); |
| | | } catch (Exception e) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("保存失败")); |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取信息 |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取信息 |
| | | * |
| | | * @param callback |
| | | * @param special 0a39676f138c4dcba722e321d43c4284 |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getCurrencyCoupon") |
| | | public void getCurrencyCoupon(String callback, String pid, PrintWriter out) { |
| | | try { |
| | | CommentInfo commentInfo = new CommentInfo(); |
| | | if (!StringUtil.isNullOrEmpty(pid)) { |
| | | GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(pid); |
| | | if (goodsEvaluate != null && goodsEvaluate.getComments() != null |
| | | && goodsEvaluate.getComments().size() > 0) { |
| | | for (CommentInfo info : goodsEvaluate.getComments()) { |
| | | if (info != null) |
| | | if (CommentInfoEnum.currencyCoupon == info.getTypeEnum()) { |
| | | commentInfo = info; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(commentInfo)); |
| | | } catch (Exception e) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("查询失败")); |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取信息 |
| | | * |
| | | * @param callback |
| | | * @param special 0a39676f138c4dcba722e321d43c4284 |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getSingleGoodsCoupon") |
| | | public void getSingleGoodsCoupon(String callback, String pid, PrintWriter out) { |
| | | try { |
| | | CommentInfo commentInfo = new CommentInfo(); |
| | | if (!StringUtil.isNullOrEmpty(pid)) { |
| | | GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(pid); |
| | | if (goodsEvaluate != null && goodsEvaluate.getComments() != null |
| | | && goodsEvaluate.getComments().size() > 0) { |
| | | for (CommentInfo info : goodsEvaluate.getComments()) { |
| | | if (info != null) |
| | | if (CommentInfoEnum.goodsCoupon == info.getTypeEnum()) { |
| | | commentInfo = info; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(commentInfo)); |
| | | } catch (Exception e) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("查询失败")); |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 保存多个商品 |
| | | * |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "saveMultipleGoods") |
| | | public void saveMultipleGoods(String callback, String pid, String videoUrl, String goodsList, |
| | | HttpServletRequest request, PrintWriter out) { |
| | | try { |
| | | MultipartHttpServletRequest fileRequest = null; |
| | | if (request instanceof MultipartHttpServletRequest) { |
| | | fileRequest = (MultipartHttpServletRequest) request; |
| | | } |
| | | goodsEvaluateService.saveMultipleGoods(pid, videoUrl, goodsList, fileRequest); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功")); |
| | | } catch (GoodsEvaluateException e) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg())); |
| | | } catch (Exception e) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("保存失败")); |
| | | e.printStackTrace(); |
| | | LogHelper.errorDetailInfo(e); |
| | | LogHelper.test(e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * |
| | |
| | | } |
| | | |
| | | /** |
| | | * 保存信息 |
| | | * |
| | | * @param callback |
| | | * @param pid |
| | | * @param kind : 1单品 2多品 3活动 |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "saveCurrencyCoupon") |
| | | public void saveCurrencyCoupon(String callback, String pid, int kind, CommentInfo commentInfo, PrintWriter out) { |
| | | try { |
| | | goodsEvaluateService.saveCurrencyCoupon(pid, kind, commentInfo); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功")); |
| | | } catch (GoodsEvaluateException e) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg())); |
| | | } catch (Exception e) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("保存失败")); |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取信息 |
| | | * |
| | | * @param callback |
| | | * @param special 0a39676f138c4dcba722e321d43c4284 |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getCurrencyCoupon") |
| | | public void getCurrencyCoupon(String callback, String pid, PrintWriter out) { |
| | | try { |
| | | CommentInfo commentInfo = new CommentInfo(); |
| | | if (!StringUtil.isNullOrEmpty(pid)) { |
| | | GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(pid); |
| | | if (goodsEvaluate != null && goodsEvaluate.getComments() != null |
| | | && goodsEvaluate.getComments().size() > 0) { |
| | | for (CommentInfo info : goodsEvaluate.getComments()) { |
| | | if (info != null) |
| | | if (CommentInfoEnum.currencyCoupon == info.getTypeEnum()) { |
| | | commentInfo = info; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(commentInfo)); |
| | | } catch (Exception e) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("查询失败")); |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存多个商品 |
| | | * |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "saveMultipleGoods") |
| | | public void saveMultipleGoods(String callback, String pid, String videoUrl, String goodsList, |
| | | HttpServletRequest request, PrintWriter out) { |
| | | try { |
| | | MultipartHttpServletRequest fileRequest = null; |
| | | if (request instanceof MultipartHttpServletRequest) { |
| | | fileRequest = (MultipartHttpServletRequest) request; |
| | | } |
| | | goodsEvaluateService.saveMultipleGoods(pid, videoUrl, goodsList, fileRequest); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功")); |
| | | } catch (GoodsEvaluateException e) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg())); |
| | | } catch (Exception e) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("保存失败")); |
| | | e.printStackTrace(); |
| | | LogHelper.errorDetailInfo(e); |
| | | LogHelper.test(e); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取多个商品信息 |
| | | * |
| | | * @param out |
| | |
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackDetail;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackWinInvite;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackWinInvite.RedPackWinInviteTypeEnum;
|
| | | import com.yeshi.fanli.service.inter.redpack.RedPackBalanceService;
|
| | | import com.yeshi.fanli.service.inter.redpack.RedPackDetailService;
|
| | | import com.yeshi.fanli.service.inter.redpack.RedPackExchangeService;
|
| | | import com.yeshi.fanli.service.inter.redpack.RedPackWinInviteService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
| | |
|
| | | @Resource
|
| | | private RedPackDetailService redPackDetailService;
|
| | | |
| | | @Resource
|
| | | private RedPackWinInviteService redPackWinInviteService;
|
| | |
|
| | |
|
| | | /**
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 明细查询
|
| | | * @param callback
|
| | | * @param pageIndex
|
| | | * @param pageSize
|
| | | * @param key 搜索:暂只提供uid
|
| | | * @param type 类型:1赠送 2使用 3体现 4扣除
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "queryInviteWin")
|
| | | public void queryInviteWin(String callback, Integer pageIndex, Integer pageSize, String key, Integer status, |
| | | PrintWriter out) {
|
| | | if (pageIndex == null || pageIndex < 1) {
|
| | | pageIndex = 1;
|
| | | }
|
| | |
|
| | | if (pageSize == null || pageSize < 1) {
|
| | | pageSize = Constant.PAGE_SIZE;
|
| | | }
|
| | | |
| | | String type = null;
|
| | | if (status != null) {
|
| | | if (status == 0) {
|
| | | type = RedPackWinInviteTypeEnum.zeroStageReward.name();
|
| | | } else if (status == 1) {
|
| | | type = RedPackWinInviteTypeEnum.oneStageReward.name();
|
| | | } else if (status == 2) {
|
| | | type = RedPackWinInviteTypeEnum.twoStageReward.name();
|
| | | } else if (status == 3) {
|
| | | type = RedPackWinInviteTypeEnum.threeStageReward.name();
|
| | | }
|
| | | }
|
| | |
|
| | | try {
|
| | | List<RedPackWinInvite> list = redPackWinInviteService.query(pageIndex, pageSize, key, type);
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("未查找到相关信息"));
|
| | | return;
|
| | | }
|
| | | |
| | | for (RedPackWinInvite win: list) {
|
| | | win.setInviter(userInfoService.selectByPKey(win.getUid()));
|
| | | win.setInvitee(userInfoService.selectByPKey(win.getTeamUid()));
|
| | | }
|
| | | |
| | | long count = redPackWinInviteService.count(key, type);
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | | GsonBuilder gsonBuilder = new GsonBuilder();
|
| | | 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();
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | && Integer.parseInt(acceptData.getVersion()) < 44 && system.getId().longValue() != 5L)
|
| | | ssp.setValue("http://ec-1255749512.file.myqcloud.com/resource/weex/flq_index_v2.js");
|
| | | }
|
| | | |
| | | // 同步管理config
|
| | | if (ssp.getKey().equalsIgnoreCase("inviteRules")) {
|
| | | ssp.setValue(configService.get(ConfigKeyEnum.inviteRules.getKey()) );
|
| | | }
|
| | | |
| | | list.add(ssp);
|
| | | }
|
| | |
|
| | |
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "useRewardCoupon", method = RequestMethod.POST)
|
| | | public void useRewardCoupon(AcceptData acceptData, Long uid, Long cid, String orderNo, Integer goodsType, PrintWriter out) {
|
| | |
|
| | | @RequestMapping(value = "useRewardCoupon")
|
| | | public void useRewardCoupon(String callback, AcceptData acceptData, Long uid, Long cid, String orderNo, Integer goodsType, PrintWriter out) {
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用户未登录"));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (userVIPInfoService.isVIP(uid)) {
|
| | | out.print(JsonUtil.loadFalseResult("超级会员不可使用奖励券"));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("超级会员不可使用奖励券"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (goodsType == null || goodsType > 3 || goodsType < 1) {
|
| | | goodsType = Constant.SOURCE_TYPE_TAOBAO;
|
| | | }
|
| | | |
| | | try {
|
| | | UserSystemCouponService.useOrderCoupon(uid, cid, orderNo, goodsType, acceptData);
|
| | | JSONObject data = commonOrderService.getRewardJumpInfo(orderNo, goodsType);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (UserSystemCouponException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "使用失败"));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "使用失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.UserInfo; |
| | | import com.yeshi.fanli.entity.common.JumpDetailV2; |
| | | import com.yeshi.fanli.entity.dynamic.CommentInfo; |
| | | import com.yeshi.fanli.entity.dynamic.CommentInfo.CommentInfoEnum; |
| | | import com.yeshi.fanli.entity.dynamic.DynamicInfo; |
| | | import com.yeshi.fanli.entity.dynamic.GoodsEvaluate; |
| | | import com.yeshi.fanli.entity.dynamic.GoodsEvaluate.EvaluateEnum; |
| | |
| | | // 2.0.7返回发圈+活动+学院+素材 |
| | | list.add(map.get(TYPE_FAQUAN)); |
| | | list.add(map.get(TYPE_HUODONG)); |
| | | // list.add(map.get(TYPE_XUEYUAN)); |
| | | list.add(map.get(TYPE_XUEYUAN)); |
| | | // list.add(map.get(TYPE_SUCAI)); |
| | | } else if (VersionUtil.greaterThan_2_0_6(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | // 2.0.6返回热销+活动+推荐+学院+邀请 |
| | |
| | | } |
| | | |
| | | String newText = text; // 非通用券需要验证 |
| | | if ((comment != null && comment.getTypeEnum() != CommentInfoEnum.currencyCoupon) |
| | | || goodsEvaluate.getType() == EvaluateEnum.activity) { |
| | | if (comment != null && (comment.getNeedSpin() == null || comment.getNeedSpin())) { |
| | | try { |
| | | newText = convertLinkManager.convertLinkFromText(text, uid, true); |
| | | } catch (ConvertLinkExceptionException e) { |
| | |
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getOrderCouponList", method = RequestMethod.POST)
|
| | | public void getOrderCouponList(AcceptData acceptData, Long uid, String orderNo, PrintWriter out) {
|
| | | @RequestMapping(value = "getOrderCouponList")
|
| | | public void getOrderCouponList(String callback, AcceptData acceptData, Long uid, String orderNo, PrintWriter out) {
|
| | | if (uid == null || StringUtil.isNullOrEmpty(orderNo)) {
|
| | | out.print(JsonUtil.loadFalseResult("传递参数信息不完整"));
|
| | | JsonUtil.printMode(out, callback,JsonUtil.loadFalseResult("传递参数信息不完整"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (userVIPInfoService.isVIP(uid)) {
|
| | | out.print(JsonUtil.loadFalseResult("超级会员不可使用奖励券"));
|
| | | JsonUtil.printMode(out, callback,JsonUtil.loadFalseResult("超级会员不可使用奖励券"));
|
| | | return;
|
| | | }
|
| | |
|
| | | List<CommonOrder> listOrder = commonOrderService.getByOrderNo(uid, orderNo);
|
| | | if (listOrder == null || listOrder.size() == 0) {
|
| | | out.print(JsonUtil.loadFalseResult("订单号不存在"));
|
| | | JsonUtil.printMode(out, callback,JsonUtil.loadFalseResult("订单号不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | for (CommonOrder commonOrder: listOrder) {
|
| | | Integer wholeOrder = commonOrder.getStateWholeOrder();
|
| | | if (wholeOrder != null && CommonOrder.STATE_WHOLE_ORDER_SHIXIAO == wholeOrder) {
|
| | | out.print(JsonUtil.loadFalseResult("整个订单已失效"));
|
| | | JsonUtil.printMode(out, callback,JsonUtil.loadFalseResult("整个订单已失效"));
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | data.put("helpLink", configService.get(ConfigKeyEnum.rewardCouponHelp.getKey()));
|
| | | data.put("count", resultList.size());
|
| | | data.put("result_list", JsonUtil.getApiCommonGson().toJson(resultList));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (UserSystemCouponException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "查询失败"));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "查询失败"));
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.entity.order.CommonOrderGoods;
|
| | |
| | | import com.yeshi.fanli.entity.order.HongBaoOrder;
|
| | | import com.yeshi.fanli.entity.order.InviteOrderSubsidy;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder;
|
| | | import com.yeshi.fanli.exception.order.CommonOrderException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderGoodsService;
|
| | |
| | | import com.yeshi.fanli.service.inter.order.HongBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.InviteOrderSubsidyServiceV2;
|
| | | import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService;
|
| | | import com.yeshi.fanli.service.inter.order.tb.TaoBaoWeiQuanOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.UserCustomSettingsService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.invite.UserInviteService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | |
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.util.user.UserLevelUtil;
|
| | | import com.yeshi.fanli.vo.order.CommonOrderVO;
|
| | | import com.yeshi.fanli.vo.order.CurrentBonusVO;
|
| | | import com.yeshi.fanli.vo.order.GoodsRebateVO;
|
| | | import com.yeshi.fanli.vo.order.HongBaoCountVO;
|
| | | import com.yeshi.fanli.vo.order.OrderCountVO;
|
| | | import com.yeshi.fanli.vo.order.OrderRebateVO;
|
| | | import com.yeshi.fanli.vo.order.TeamBonusVO;
|
| | |
| | |
|
| | | @Resource
|
| | | private CommonOrderGoodsService commonOrderGoodsService;
|
| | | |
| | | @Resource
|
| | | private TaoBaoWeiQuanOrderService taoBaoWeiQuanOrderService;
|
| | | |
| | | @Resource
|
| | | private JumpDetailV2Service jumpDetailV2Service;
|
| | | |
| | | @Resource
|
| | | private UserSystemCouponRecordService userSystemCouponRecordService;
|
| | | |
| | | @Resource
|
| | | private UserInviteService userInviteService;
|
| | | |
| | | @Resource
|
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | |
|
| | | /**
|
| | | * 订单列表
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | // 查询列表
|
| | | List<CommonOrderVO> list = commonOrderService.getOrderByUid(acceptData, page, uid, state, orderType,
|
| | | |
| | | long count = 0L;
|
| | | List<CommonOrderVO> list = null;
|
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | list = commonOrderService.getOrderList(acceptData, page, uid, state, orderType,
|
| | | orderState, orderNo, startTime, endTime, dateType, listSource);
|
| | | // 统计总数
|
| | | long count = commonOrderService.countGroupOrderNoByUid(uid, state, orderType, orderState, orderNo,
|
| | | count = commonOrderService.countOrderList(uid, state, orderType, orderState, orderNo,
|
| | | startTime, endTime, dateType, listSource);
|
| | | } else {
|
| | | list = commonOrderService.getOrderByUid(acceptData, page, uid, state, orderType,
|
| | | orderState, orderNo, startTime, endTime, dateType, listSource);
|
| | | count = commonOrderService.countGroupOrderNoByUid(uid, state, orderType, orderState, orderNo,
|
| | | startTime, endTime, dateType, listSource);
|
| | | }
|
| | |
|
| | | // 判断是否需要显示订单找回提示 8秒内请求3次触发
|
| | | String orderFindUrl = null;
|
| | |
| | |
|
| | | BigDecimal selfMoney = hongBaoV2CountService.getRewardMoneyToCount(uid, dateType, 1, null);
|
| | | BigDecimal shareMoney = hongBaoV2CountService.getRewardMoneyToCount(uid, dateType, 2, null);
|
| | | BigDecimal inviteMoney = hongBaoV2CountService.getRewardMoneyToCount(uid, dateType, 3, null);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("show", show);
|
| | | data.put("selfMoney", selfMoney.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | data.put("shareMoney", shareMoney.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | data.put("inviteMoney", inviteMoney.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | |
|
| | | // 团队奖励 TODO
|
| | | |
| | | BigDecimal teamMoney = new BigDecimal(0);
|
| | | if (!VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | teamMoney = hongBaoV2CountService.getRewardMoneyToCount(uid, dateType, 3, null);
|
| | | } else {
|
| | | BigDecimal bonus = null;
|
| | | BigDecimal subsidy = null;
|
| | | BigDecimal dividend = null; // TODO 分红统计
|
| | | if (dateType == 4) { // 已到账
|
| | | dividend = new BigDecimal(0);
|
| | | bonus = hongBaoV2CountService.geBonusByuid(uid, dateType, 3, 2);
|
| | | subsidy = inviteOrderSubsidyServiceV2.sumMoneyByUidAndDateAndState(uid,dateType,null,3);
|
| | | } else { // 未失效
|
| | | bonus = hongBaoV2CountService.geBonusByuid(uid, dateType, 3, 4);
|
| | | subsidy = inviteOrderSubsidyServiceV2.sumValidMoneyByUidAndDate(uid,dateType,null);
|
| | | }
|
| | | |
| | | dividend = new BigDecimal(0);
|
| | | // 总团队奖励
|
| | | teamMoney = bonus.add(subsidy).add(dividend);
|
| | | |
| | | JSONObject paramsFanli = new JSONObject();
|
| | | paramsFanli.put("type", "1");
|
| | | data.put("paramsFanli", paramsFanli);
|
| | | data.put("jumpFanli", jumpDetailV2Service.getByTypeCache("fanli_share_statistics",
|
| | | Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion())));
|
| | | |
| | | JSONObject paramsShare = new JSONObject();
|
| | | paramsShare.put("type", "2");
|
| | | data.put("paramsShare", paramsShare);
|
| | | data.put("jumpShare", jumpDetailV2Service.getByTypeCache("fanli_share_statistics",
|
| | | Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion())));
|
| | | |
| | | JSONObject paramsTeam = new JSONObject();
|
| | | paramsTeam.put("type", "3");
|
| | | data.put("paramsTeam", paramsTeam);
|
| | | data.put("jumpTeam", jumpDetailV2Service.getByTypeCache("team_statistics",
|
| | | Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion())));
|
| | | }
|
| | | data.put("inviteMoney", teamMoney.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | // 按订单号 查询
|
| | | List<CommonOrder> commonOrderList = commonOrderService.listBySourceTypeAndOrderId(sourceType, orderNo);
|
| | | Integer rank = commonOrderList.get(0).getUrank();
|
| | | UserLevelEnum userLevel = UserLevelUtil.getByOrderRank(rank);
|
| | | if (userLevel == null)
|
| | | userLevel = UserLevelEnum.daRen;
|
| | | // 红包信息
|
| | | List<HongBaoOrder> hoList = hongBaoOrderService.listDetailByOrderIdAndSourceTypeAndUid(orderNo, sourceType, uid);
|
| | | HongBaoCountVO hongBaoCountVO = hongBaoOrderService.getHongBaoCountVO(hoList);
|
| | |
|
| | | List<HongBaoOrder> hongBaoOrderList = hongBaoOrderService.listDetailByOrderIdAndSourceType(orderNo, sourceType);
|
| | | Integer hongBaoState = hongBaoCountVO.getCurrentState();
|
| | | String stateDesc = "";
|
| | | String predictDesc = "";
|
| | | if (HongBaoV2.STATE_KELINGQU == hongBaoState || HongBaoV2.STATE_BUKELINGQU == hongBaoState) {
|
| | | stateDesc = "未到账";
|
| | | predictDesc = "预估";
|
| | | } else if (HongBaoV2.STATE_YILINGQU == hongBaoState) {
|
| | | stateDesc = "已到账";
|
| | | } else if (HongBaoV2.STATE_SHIXIAO == hongBaoState) {
|
| | | stateDesc = "已失效";
|
| | | }
|
| | |
|
| | | OrderRebateVO orderRebateVO = new OrderRebateVO();
|
| | | List<GoodsRebateVO> voList = new ArrayList<>();
|
| | | BigDecimal totalMoney = new BigDecimal(0);
|
| | | UserLevelEnum upperLevel = UserLevelUtil.getNextLevel(userLevel);
|
| | | BigDecimal upperTotalMoney = new BigDecimal(0);
|
| | | Map<Long, CommonOrderGoods> orderGoodsMap = new HashMap<>();
|
| | | int type = 0;
|
| | | String typeName = "";
|
| | | int hongBaoType = hoList.get(0).getHongBaoV2().getType();
|
| | | if (HongBaoV2.TYPE_ZIGOU == hongBaoType || 2 == hongBaoType) {
|
| | | type = 1;
|
| | | typeName = "返利";
|
| | | } else if (HongBaoV2.TYPE_SHARE_GOODS == hongBaoType) {
|
| | | type = 2;
|
| | | typeName = "奖金";
|
| | | } else if (HongBaoV2.TYPE_SHARE_YIJI == hongBaoType || HongBaoV2.TYPE_SHARE_ERJI == hongBaoType
|
| | | || HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType
|
| | | || HongBaoV2.TYPE_ERJI == hongBaoType) {
|
| | | type = 3;
|
| | | typeName = "收益";
|
| | | } |
| | |
|
| | | List<Long> goodsIdList = new ArrayList<>();
|
| | | if (hongBaoOrderList != null)
|
| | | for (HongBaoOrder hongBaoOrder : hongBaoOrderList) {
|
| | | if (hoList != null)
|
| | | for (HongBaoOrder hongBaoOrder : hoList) {
|
| | | if (hongBaoOrder.getCommonOrder() != null)
|
| | | goodsIdList.add(hongBaoOrder.getCommonOrder().getCommonOrderGoods().getId());
|
| | | }
|
| | |
|
| | | Map<Long, CommonOrderGoods> orderGoodsMap = new HashMap<>();
|
| | | List<CommonOrderGoods> goodsList = commonOrderGoodsService.listByByPrimaryKeys(goodsIdList);
|
| | | if (goodsList != null)
|
| | | for (CommonOrderGoods goods : goodsList)
|
| | | orderGoodsMap.put(goods.getId(), goods);
|
| | |
|
| | | if (userLevel == UserLevelEnum.daRen) {
|
| | | for (HongBaoOrder hongBaoOrder : hongBaoOrderList) {
|
| | | |
| | | OrderRebateVO orderRebateVO = new OrderRebateVO();
|
| | | // 红包信息
|
| | | BigDecimal hongBao = hongBaoCountVO.getValidMoney();
|
| | | if (sourceType == Constant.SOURCE_TYPE_TAOBAO) {
|
| | | List<TaoBaoWeiQuanOrder> listWQ = taoBaoWeiQuanOrderService.getWeiQuanSuccessOrders(orderNo);
|
| | | if (listWQ != null && listWQ.size() > 0) {
|
| | | BigDecimal weiQuanMoney = commonOrderService.getWeiQuanMoney(listWQ, sourceType, uid);
|
| | | |
| | | orderRebateVO.setWq(true);
|
| | | orderRebateVO.setWqMoney("-¥"+ weiQuanMoney.setScale(2, BigDecimal.ROUND_DOWN));
|
| | | if (hongBao.compareTo(weiQuanMoney) > 0) {
|
| | | orderRebateVO.setWqDesc("部分售后退回");
|
| | | } else {
|
| | | orderRebateVO.setWqDesc("售后退回");
|
| | | }
|
| | | // 计算剩余红包
|
| | | hongBao = MoneyBigDecimalUtil.sub(hongBao, weiQuanMoney);
|
| | | }
|
| | | }
|
| | | orderRebateVO.setFanLiDesc(predictDesc + typeName);
|
| | | orderRebateVO.setFanLi("¥" + hongBao.setScale(2));
|
| | | |
| | | HongBaoV2 hongBaoV2 = hoList.get(0).getHongBaoV2();
|
| | | UserLevelEnum userLevel = UserLevelUtil.getByOrderRank(hongBaoV2.getUrank());
|
| | | if (userLevel == null)
|
| | | userLevel = UserLevelEnum.daRen;
|
| | | |
| | | UserLevelEnum upperLevel = UserLevelUtil.getNextLevel(userLevel);
|
| | | |
| | | BigDecimal upperTotalMoney = new BigDecimal(0);
|
| | | List<GoodsRebateVO> voList = new ArrayList<>();
|
| | | for (HongBaoOrder hongBaoOrder : hoList) {
|
| | | if (hongBaoOrder.getHongBaoV2().getState() == HongBaoV2.STATE_SHIXIAO)
|
| | | hongBaoOrder.getHongBaoV2().setMoney(new BigDecimal(0));
|
| | | CommonOrder commonOrder = hongBaoOrder.getCommonOrder();
|
| | | |
| | | GoodsRebateVO goodsVO = new GoodsRebateVO();
|
| | | |
| | | // 标题、图片
|
| | | CommonOrder commonOrder = hongBaoOrder.getCommonOrder();
|
| | | if (orderGoodsMap.get(commonOrder.getCommonOrderGoods().getId()) != null) {
|
| | | goodsVO.setTitle(orderGoodsMap.get(commonOrder.getCommonOrderGoods().getId()).getTitle());
|
| | | goodsVO.setPicture(orderGoodsMap.get(commonOrder.getCommonOrderGoods().getId()).getPicture());
|
| | | }
|
| | | |
| | | // 实付款
|
| | | BigDecimal payment = hongBaoOrder.getCommonOrder().getPayment();
|
| | | if (hongBaoOrder.getCommonOrder().getSettlement() != null)
|
| | | payment = hongBaoOrder.getCommonOrder().getSettlement();
|
| | | if (payment == null)
|
| | | payment = new BigDecimal(0);
|
| | | goodsVO.setActualPay("¥" + payment.setScale(2));
|
| | |
|
| | | goodsVO.setActualPay("¥" + payment);
|
| | |
|
| | | if (payment.compareTo(new BigDecimal(0)) <= 0) {
|
| | | goodsVO.setFanliRate("X0%");
|
| | | } else {
|
| | | goodsVO.setFanliRate("X"
|
| | | + MoneyBigDecimalUtil
|
| | | .div(hongBaoOrder.getHongBaoV2().getMoney().multiply(new BigDecimal(100)), payment)
|
| | | + "%");
|
| | | }
|
| | | goodsVO.setFanliExpect("¥" + hongBaoOrder.getHongBaoV2().getMoney());
|
| | | voList.add(goodsVO);
|
| | | totalMoney = totalMoney.add(hongBaoOrder.getHongBaoV2().getMoney());
|
| | | if (upperLevel != null) {
|
| | | upperTotalMoney = upperTotalMoney
|
| | | .add(orderHongBaoMoneyComputeService.computeFanliMoney(commonOrder, upperLevel));
|
| | | }
|
| | | }
|
| | | orderRebateVO.setListGoods(voList);
|
| | | } else {
|
| | | for (HongBaoOrder hongBaoOrder : hongBaoOrderList) {
|
| | | if (hongBaoOrder.getHongBaoV2().getState() == HongBaoV2.STATE_SHIXIAO)
|
| | | hongBaoOrder.getHongBaoV2().setMoney(new BigDecimal(0));
|
| | | CommonOrder commonOrder = hongBaoOrder.getCommonOrder();
|
| | | GoodsRebateVO goodsVO = new GoodsRebateVO();
|
| | | if (orderGoodsMap.get(commonOrder.getCommonOrderGoods().getId()) != null) {
|
| | | goodsVO.setTitle(orderGoodsMap.get(commonOrder.getCommonOrderGoods().getId()).getTitle());
|
| | | goodsVO.setPicture(orderGoodsMap.get(commonOrder.getCommonOrderGoods().getId()).getPicture());
|
| | | }
|
| | | BigDecimal payment = hongBaoOrder.getCommonOrder().getPayment();
|
| | | if (hongBaoOrder.getCommonOrder().getSettlement() != null)
|
| | | payment = hongBaoOrder.getCommonOrder().getSettlement();
|
| | | if (payment == null)
|
| | | payment = new BigDecimal(0);
|
| | |
|
| | | goodsVO.setActualPay("¥" + payment);
|
| | |
|
| | | BigDecimal commission = orderHongBaoMoneyComputeService.computeBaseFanliMoney(commonOrder);
|
| | | if (type == 3) { // 奖金
|
| | | goodsVO.setBonus(hongBaoOrder.getHongBaoV2().getMoney() +"");
|
| | | } else { // 佣金
|
| | | goodsVO.setCommision("¥" +commission);
|
| | | }
|
| | |
|
| | | BigDecimal darenFanli = orderHongBaoMoneyComputeService.computeFanliMoney(commonOrder,
|
| | | UserLevelEnum.daRen);
|
| | |
|
| | | // 平台补贴
|
| | | BigDecimal vipFanli = hongBaoOrder.getHongBaoV2().getMoney();
|
| | | goodsVO.setSubsidy(vipFanli.subtract(commission).setScale(2) + "");
|
| | | // 达人补贴
|
| | | if (userLevel != UserLevelEnum.daRen) {
|
| | | BigDecimal darenFanli = orderHongBaoMoneyComputeService.computeFanliMoney(commonOrder, UserLevelEnum.daRen);
|
| | | goodsVO.setOriginSubsidy("¥" + darenFanli.subtract(commission).setScale(2) + "");
|
| | | }
|
| | |
|
| | | goodsVO.setOriginSubsidy(darenFanli.subtract(commission) + "");
|
| | | goodsVO.setSubsidy("¥" +vipFanli.subtract(commission));
|
| | | voList.add(goodsVO);
|
| | | totalMoney = totalMoney.add(vipFanli);
|
| | | if (upperLevel != null) {
|
| | | upperTotalMoney = upperTotalMoney
|
| | | .add(orderHongBaoMoneyComputeService.computeFanliMoney(commonOrder, upperLevel));
|
| | | }
|
| | | }
|
| | | orderRebateVO.setListGoods(voList);
|
| | | |
| | | // 团队补贴
|
| | | if (type == 3) {
|
| | | BigDecimal teamSubsidy = null;
|
| | | BigDecimal lowerSubsidy = null;
|
| | | InviteOrderSubsidy inviteOrderSubsidy = inviteOrderSubsidyServiceV2.getByOrderNoAndType(uid, orderNo, sourceType);
|
| | | if (inviteOrderSubsidy != null) {
|
| | | teamSubsidy = inviteOrderSubsidy.getMoney();
|
| | | if (userLevel != UserLevelEnum.daRen) {
|
| | | CommonOrder commonOrder = hoList.get(0).getCommonOrder();
|
| | | Integer urank = commonOrder.getUrank();
|
| | | UserLevelEnum buyerUserLevel = UserLevelUtil.getByOrderRank(urank);
|
| | | boolean direct = false;
|
| | | if (hongBaoV2.getType() == HongBaoV2.TYPE_YIJI || hongBaoV2.getType() == HongBaoV2.TYPE_SHARE_YIJI) {
|
| | | direct = true;
|
| | | }
|
| | | orderRebateVO.setTotalFanLi("¥" + totalMoney);
|
| | | // 计算上一级补贴
|
| | | lowerSubsidy = getLowerSubsidy(inviteOrderSubsidy.getMoney(), commonOrder.getThirdCreateTime(), buyerUserLevel, userLevel, direct);
|
| | | }
|
| | | } else {
|
| | | teamSubsidy = BigDecimal.valueOf(0.00);
|
| | | lowerSubsidy = BigDecimal.valueOf(0.00);
|
| | | }
|
| | | |
| | | if (userLevel != UserLevelEnum.daRen) {
|
| | | orderRebateVO.setOriginSubsidy("¥" + lowerSubsidy.setScale(2));
|
| | | }
|
| | | orderRebateVO.setSubsidyDesc("团队补贴");
|
| | | orderRebateVO.setSubsidy(teamSubsidy.setScale(2) +"");
|
| | | }
|
| | | |
| | | orderRebateVO.setType(type);
|
| | | orderRebateVO.setStateDesc(stateDesc);
|
| | | orderRebateVO.setListGoods(voList);
|
| | | |
| | | // 上级返利
|
| | | if (upperLevel != null) {
|
| | | orderRebateVO.setUpperFanLi("¥" + upperTotalMoney);
|
| | | orderRebateVO.setUserLevel(upperLevel.name());
|
| | | orderRebateVO.setJumpLink(upperLevel.getDetailLink());
|
| | | }
|
| | |
|
| | | // 奖励券使用
|
| | | Date accountTime = hongBaoCountVO.getAccountTime();
|
| | | if (accountTime != null) {
|
| | | boolean vip = userInviteService.verifyVIP(uid);
|
| | | Date endDay = DateUtil.plusDayDate(Constant.COUPON_REWARD_LIMIT_DAY, accountTime);
|
| | | long currentTime = java.lang.System.currentTimeMillis();
|
| | | if (endDay.getTime() > currentTime && !vip) {
|
| | | UserSystemCouponRecord couponRecord = userSystemCouponRecordService.getRecordByOrderNo(orderNo, null);
|
| | | if (couponRecord == null |
| | | || (couponRecord.getCouponType() == CouponTypeEnum.rebatePercentCoupon.name() && couponRecord.getState() != UserSystemCouponRecord.STATE_SUCCESS)) {
|
| | | orderRebateVO.setCoupon(true);
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("result", orderRebateVO);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | |
| | | private BigDecimal getLowerSubsidy(BigDecimal money, Date downTime, UserLevelEnum buyerUserLevel, UserLevelEnum userLevel, boolean direct) {
|
| | | // 原始比例
|
| | | BigDecimal originRate = orderHongBaoMoneyComputeService.getTeamSubsidyRate(downTime,
|
| | | buyerUserLevel, userLevel, direct);
|
| | | |
| | | // 小一级比例
|
| | | BigDecimal darenRate = orderHongBaoMoneyComputeService.getTeamSubsidyRate(downTime, buyerUserLevel, UserLevelEnum.daRen, direct);
|
| | | |
| | | return MoneyBigDecimalUtil.mul(MoneyBigDecimalUtil.div(money,originRate), darenRate);
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 数据统计
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param type 1自购 2分享 3团队
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getCurrentBonus", method = RequestMethod.POST)
|
| | | public void getCurrentBonus(AcceptData acceptData, Long uid, Integer type, PrintWriter out) {
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if (type == 1 || type == 2) {
|
| | | CurrentBonusVO bonus = new CurrentBonusVO();
|
| | | bonus.setToday(hongBaoV2CountService.geBonusByuid(uid, 1, type, 2).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | bonus.setYesterday(hongBaoV2CountService.geBonusByuid(uid, 2, type, 2).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | bonus.setThisMonth(hongBaoV2CountService.geBonusByuid(uid, 3, type, 2).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | bonus.setLastMonth(hongBaoV2CountService.geBonusByuid(uid, 4, type, 2).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | |
|
| | | CurrentBonusVO bonusNot = new CurrentBonusVO();
|
| | | bonusNot.setToday(hongBaoV2CountService.geBonusByuid(uid, 1, type, 1).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | bonusNot.setYesterday(hongBaoV2CountService.geBonusByuid(uid, 2, type, 1).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | bonusNot.setThisMonth(hongBaoV2CountService.geBonusByuid(uid, 3, type, 1).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | bonusNot.setLastMonth(hongBaoV2CountService.geBonusByuid(uid, 4, type, 1).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | |
| | | |
| | | data.put("bonus",bonus);
|
| | | data.put("bonusNot",bonusNot);
|
| | | data.put("total", hongBaoV2CountService.geBonusByuid(uid, null, type, 2).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | data.put("totalNot", hongBaoV2CountService.geBonusByuid(uid, null, type, 1).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | } else {
|
| | | CurrentBonusVO bonus = new CurrentBonusVO();
|
| | | bonus.setToday(hongBaoV2CountService.geBonusByuid(uid, 1, type, 4).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | bonus.setYesterday(hongBaoV2CountService.geBonusByuid(uid, 2, type, 4).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | bonus.setThisMonth(hongBaoV2CountService.geBonusByuid(uid, 3, type, 4).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | bonus.setLastMonth(hongBaoV2CountService.geBonusByuid(uid, 4, type, 2).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | |
| | |
|
| | | CurrentBonusVO subsidy = new CurrentBonusVO();
|
| | | subsidy.setToday(inviteOrderSubsidyServiceV2.sumValidMoneyByUidAndDate(uid,1,null).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | subsidy.setYesterday(inviteOrderSubsidyServiceV2.sumValidMoneyByUidAndDate(uid,2,null).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | subsidy.setThisMonth(inviteOrderSubsidyServiceV2.sumValidMoneyByUidAndDate(uid,3,null).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | subsidy.setLastMonth(inviteOrderSubsidyServiceV2.sumMoneyByUidAndDateAndState(uid,4,null,3).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | |
| | | // TODO 分红统计
|
| | | CurrentBonusVO dividend = new CurrentBonusVO();
|
| | | dividend.setThisMonth("0.00");
|
| | | dividend.setLastMonth("0.00");
|
| | | |
| | | BigDecimal totalBonus = hongBaoV2CountService.geBonusByuid(uid, null, type, 2);
|
| | | BigDecimal totalubsidy = inviteOrderSubsidyServiceV2.sumRecievedMoneyByUid(uid,null);
|
| | | BigDecimal totalDividend = new BigDecimal(0);
|
| | | |
| | | BigDecimal total = totalDividend.add(totalBonus).add(totalubsidy);
|
| | | |
| | | |
| | | data.put("bonus",bonus);
|
| | | data.put("subsidy",subsidy);
|
| | | data.put("dividend",dividend);
|
| | | data.put("subsidy",subsidy);
|
| | | data.put("total", total.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | data.put("totalBonus", totalBonus.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | data.put("totalubsidy", totalubsidy.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | data.put("totalDividend", totalDividend.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | }
|
| | | |
| | | String key = null;
|
| | | if (type == 1) {
|
| | | key = ConfigKeyEnum.bonusCountLinkFanli.getKey();
|
| | | } else if (type == 2) {
|
| | | key = ConfigKeyEnum.bonusCountLinkShare.getKey();
|
| | | } else {
|
| | | key = ConfigKeyEnum.bonusCountLinkTeam.getKey();
|
| | | }
|
| | | |
| | | data.put("link",configService.get(key));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.msg; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgExtra; |
| | | |
| | | public interface MsgExtraMapper extends BaseMapper<MsgExtra> { |
| | | |
| | | } |
| | |
| | | List<CommonOrder> getMinSettleTimeAndUid(); |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询用户订单 并订单号分组 |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | |
| | | List<CommonOrderVO> getOrderList(@Param("start") long start, @Param("count") int count, @Param("uid") Long uid, |
| | | @Param("state") Integer state, @Param("type") Integer type, @Param("orderState") Integer orderState, |
| | | @Param("orderNo") String orderNo, @Param("startTime") String startTime, @Param("endTime") String endTime, |
| | | @Param("day") Integer day, @Param("listSource") List<Integer> listSource); |
| | | |
| | | /** |
| | | * 统计用户订单 并订单号分组 |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | long countOrderList(@Param("uid") Long uid, @Param("state") Integer state, @Param("type") Integer type, |
| | | @Param("orderState") Integer orderState, @Param("orderNo") String orderNo, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("day") Integer day, |
| | | @Param("listSource") List<Integer> listSource); |
| | | |
| | | |
| | | } |
| | |
| | | */
|
| | | public List<HongBaoOrder> listDetailByOrderIdAndSourceType(@Param("orderId") String orderId,
|
| | | @Param("sourceType") int sourceType);
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 根据订单ID与来源类型查询详情
|
| | | * @param orderId
|
| | | * @param sourceType
|
| | | * @return
|
| | | */
|
| | | public List<HongBaoOrder> listDetailByOrderIdAndSourceTypeAndUid(@Param("orderId") String orderId,
|
| | | @Param("sourceType") int sourceType, @Param("uid") long uid);
|
| | | } |
| | |
|
| | |
|
| | |
| | | */
|
| | | BigDecimal sumValidMoneyByUidAndDate(@Param("uid") long uid, @Param("day") Integer day, @Param("level") Integer level);
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 统计用户有效金额
|
| | | * @param uid
|
| | | * @param day 1今日 2昨日 3本月 4上月
|
| | | * @return
|
| | | */
|
| | | BigDecimal sumMoneyByUidAndDateAndState(@Param("uid") long uid, @Param("day") Integer day, |
| | | @Param("level") Integer level, @Param("state") Integer state);
|
| | | |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | long countTeamNumByTid(@Param("uid")Long uid, @Param("teamUid")Long teamUid); |
| | | |
| | | |
| | | /** |
| | | * 获取奖励记录 |
| | | * @param uid |
| | | * @param type |
| | | * @return |
| | | */ |
| | | List<RedPackWinInvite> query(@Param("start")long start, @Param("count")int count, @Param("key")String key, @Param("type")String type); |
| | | |
| | | Long count(@Param("key")String key, @Param("type")String type); |
| | | |
| | | } |
| | |
| | | level("账号等级"),
|
| | | connect("账号合并"),
|
| | | taoBaoAuthFail("账号绑定"),
|
| | | changeCode("账号修改"),
|
| | | vipApply("账户升级"),
|
| | | vipPgrade("账户升级");
|
| | | vipPgrade("等级成长");
|
| | | private final String desc;
|
| | |
|
| | | private MsgTypeAccountTypeEnum(String desc) {
|
| | |
| | | private Date createTime;
|
| | | @Column(name = "ma_update_time")
|
| | | private Date updateTime;
|
| | |
|
| | | private String extraInfo;// 新版消息内容
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | |
| | | public void setBeiZhu(String beiZhu) {
|
| | | this.beiZhu = beiZhu;
|
| | | }
|
| | |
|
| | | public String getExtraInfo() {
|
| | | return extraInfo;
|
| | | }
|
| | |
|
| | | public void setExtraInfo(String extraInfo) {
|
| | | this.extraInfo = extraInfo;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.bus.msg;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | /***
|
| | | * 消息内容新版
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_msg_extra")
|
| | | public class MsgExtra {
|
| | | // 消息的类型
|
| | | public final static String MSG_TYPE_ORDER = "order";
|
| | | public final static String MSG_TYPE_MONEY = "money";
|
| | | public final static String MSG_TYPE_ACCOUNT = "account";
|
| | | public final static String MSG_TYPE_INVITE = "invite";
|
| | | public final static String MSG_TYPE_OTHER = "other";
|
| | |
|
| | | @Column(name = "mea_id")
|
| | | private Long id;
|
| | | @Column(name = "mea_rid")
|
| | | private Long rid; // 关联id
|
| | | @Column(name = "mea_type")
|
| | | private String type;// 类型
|
| | | @Column(name = "mea_content")
|
| | | private String content;// 内容
|
| | | @Column(name = "mea_create_time")
|
| | | private Date createTime;
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Long getRid() {
|
| | | return rid;
|
| | | }
|
| | |
|
| | | public void setRid(Long rid) {
|
| | | this.rid = rid;
|
| | | }
|
| | |
|
| | | public String getType() {
|
| | | return type;
|
| | | }
|
| | |
|
| | | public void setType(String type) {
|
| | | this.type = type;
|
| | | }
|
| | |
|
| | | public String getContent() {
|
| | | return content;
|
| | | }
|
| | |
|
| | | public void setContent(String content) {
|
| | | this.content = content;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | @Column(name = "mi_update_time")
|
| | | private Date updateTime;
|
| | |
|
| | | private String extraInfo;// 新版消息内容
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | public String getExtraInfo() {
|
| | | return extraInfo;
|
| | | }
|
| | |
|
| | | public void setExtraInfo(String extraInfo) {
|
| | | this.extraInfo = extraInfo;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | @Table("yeshi_ec_msg_money")
|
| | | public class MsgMoneyDetail {
|
| | | public enum MsgTypeMoneyTypeEnum {
|
| | | share("分享奖金"),
|
| | | invite("团队奖金"),
|
| | | fanli("返利到账"),
|
| | | fanli("资金到账"),
|
| | | share("资金到账"),
|
| | | invite("资金到账"),
|
| | | extract("提现"),
|
| | | fanliWeiQuan("资金退回"),
|
| | | shareWeiQuan("资金退回"),
|
| | | extractAutoWX("自动提现"),
|
| | | extractValid("提现账号验证"),
|
| | | shareWeiQuan("分享奖金扣除"),
|
| | | inviteWeiQuan("团队奖金扣除"),
|
| | | fanliWeiQuan("返利扣除"),
|
| | | orderReward("返利奖励"),
|
| | | systemEqualize("系统补齐"),
|
| | | fanliElme("返利到账"),
|
| | |
| | | private Boolean read;
|
| | | @Column(name = "mm_content") // 消息内容
|
| | | private String content;
|
| | | |
| | | private String extraInfo;// 新版消息内容
|
| | | |
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | |
| | | public void setContent(String content) {
|
| | | this.content = content;
|
| | | }
|
| | |
|
| | | public String getExtraInfo() {
|
| | | return extraInfo;
|
| | | }
|
| | |
|
| | | public void setExtraInfo(String extraInfo) {
|
| | | this.extraInfo = extraInfo;
|
| | | }
|
| | | }
|
| | |
| | | public final static int STATE_SX = 4;// 未付款/已退款
|
| | |
|
| | | public enum MsgTypeOrderTypeEnum {
|
| | | fanli("返利订单"), share("分享订单"), invite("团队订单"), found("订单找回"), elme("饿了么订单");
|
| | | private final String desc;
|
| | | fanli("返利订单被统计", "http://img.flqapp.com/resource/msg/icon_msg_order.png"),
|
| | | share("分享订单被统计", "http://img.flqapp.com/resource/msg/icon_msg_order.png"), |
| | | invite("团队订单被统计", "http://img.flqapp.com/resource/msg/icon_msg_order.png"), |
| | | found("订单找回", "http://img.flqapp.com/resource/msg/icon_msg_order.png"), // 老版
|
| | | foundSucceed("订单找回成功", "http://img.flqapp.com/resource/msg/icon_msg_order.png"), |
| | | foundFail("订单找回失败", "http://img.flqapp.com/resource/msg/icon_msg_order.png"),
|
| | | elme("饿了么订单", "http://img.flqapp.com/resource/msg/icon_msg_order.png");
|
| | |
|
| | | private MsgTypeOrderTypeEnum(String desc) {
|
| | | private final String desc;
|
| | | private final String icon;
|
| | |
|
| | | private MsgTypeOrderTypeEnum(String desc, String icon) {
|
| | | this.desc = desc;
|
| | | this.icon = icon;
|
| | | }
|
| | |
|
| | | public String getDesc() {
|
| | | return desc;
|
| | | }
|
| | | |
| | | public String getIcon() {
|
| | | return icon;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | private Date createTime;
|
| | | @Column(name = "mo_update_time")
|
| | | private Date updateTime;
|
| | | |
| | | private String extraInfo;// 新版消息内容
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | |
| | | this.orderType = orderType;
|
| | | }
|
| | |
|
| | | public String getExtraInfo() {
|
| | | return extraInfo;
|
| | | }
|
| | |
|
| | | public void setExtraInfo(String extraInfo) {
|
| | | this.extraInfo = extraInfo;
|
| | | }
|
| | | |
| | | }
|
| | |
| | | private String couponSource; |
| | | |
| | | // 通用券是否转链 |
| | | private boolean needSpin; |
| | | private Boolean needSpin; |
| | | |
| | | private String tags; |
| | | private String tagsColour; |
| | |
| | | this.endTime = endTime; |
| | | } |
| | | |
| | | public boolean isNeedSpin() { |
| | | public Boolean getNeedSpin() { |
| | | return needSpin; |
| | | } |
| | | |
| | | public void setNeedSpin(boolean needSpin) { |
| | | public void setNeedSpin(Boolean needSpin) { |
| | | this.needSpin = needSpin; |
| | | } |
| | | |
| | |
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | |
|
| | | /**
|
| | | * 红包获得记录-邀请相关
|
| | | *
|
| | |
| | |
|
| | | @Column(name = "rwr_update_time")
|
| | | private Date updateTime;
|
| | |
|
| | | // 邀请人
|
| | | private UserInfo inviter;
|
| | | // 受邀人
|
| | | private UserInfo invitee;
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | |
| | | public void setIdentifyCode(String identifyCode) {
|
| | | this.identifyCode = identifyCode;
|
| | | }
|
| | |
|
| | | public UserInfo getInviter() {
|
| | | return inviter;
|
| | | }
|
| | |
|
| | | public void setInviter(UserInfo inviter) {
|
| | | this.inviter = inviter;
|
| | | }
|
| | |
|
| | | public UserInfo getInvitee() {
|
| | | return invitee;
|
| | | }
|
| | |
|
| | | public void setInvitee(UserInfo invitee) {
|
| | | this.invitee = invitee;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | maskControl("遮罩控制"), |
| | | guanXuan("官宣任务"), |
| | | specialHelper("小助手"), |
| | | article("学院相关"), |
| | | extract("提现相关"); |
| | | |
| | | private final String desc; |
| | |
| | | pushGoodsDetails("push_goods_details", "推送页面"), |
| | | brandBackgroundPicture("brand_background_picture", "品牌背景图片"), |
| | | articleHotWords("article_hot_words", "动态-学院文章热搜词"), |
| | | inviteRules("invite_rules", "动态-学院文章热搜词"), |
| | | vipLink("vip_link", "超级会员升级链接"), // 转移至VIPConfig 已废弃 |
| | | helpLinkVipInfo("help_link_vip_info", "超级会员详情页帮助链接"), // 已废弃 |
| | | //文案转链 |
| | |
| | | orderTeamSubsidyLink("order_team_subsidy_link", "订单补贴帮助链接"), |
| | | orderTeamRewardLink("order_team_reward_link", "订单奖励帮助链接"), |
| | | tutorSubsidyLink("tutor_subsidy_link", "导师津贴帮助链接"), |
| | | |
| | | bonusCountLinkFanli("bonus_count_link_fanli", "自购返利统计页面问号"), |
| | | bonusCountLinkShare("bonus_count_link_share", "分享奖金统计页面问号"), |
| | | bonusCountLinkTeam("bonus_count_link_team", "团队奖励统计页面问号"), |
| | | ; |
| | | |
| | | private final String key; |
| | |
| | | <if test="moneyState != null and moneyState == 3"> <!-- 红包已失效 -->
|
| | | AND v.hb_state =4
|
| | | </if>
|
| | | <if test="moneyState != null and moneyState == 4"> <!-- 红包未失效 -->
|
| | | AND v.hb_state <![CDATA[<>]]> 4
|
| | | </if>
|
| | | )v2
|
| | | LEFT JOIN yeshi_ec_hongbao_order ho ON ho.`ho_hongbao_id` = IF(v2.hb_pid IS NULL,v2.hb_id,v2.hb_pid)
|
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id` = ho.`ho_order_id`
|
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.msg.MsgExtraMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.msg.MsgExtra"> |
| | | <id column="mea_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="mea_rid" property="rid" jdbcType="BIGINT"/> |
| | | <result column="mea_type" property="type" jdbcType="VARCHAR"/> |
| | | <result column="mea_content" property="content" jdbcType="VARCHAR"/> |
| | | <result column="mea_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">mea_id,mea_rid,mea_type,mea_content,mea_create_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_msg_extra where mea_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_msg_extra where mea_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.msg.MsgExtra" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_msg_extra (mea_id,mea_rid,mea_type,mea_content,mea_create_time) values (#{id,jdbcType=BIGINT},#{rid,jdbcType=BIGINT},#{type,jdbcType=VARCHAR},#{content,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.msg.MsgExtra" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_msg_extra |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">mea_id,</if> |
| | | <if test="rid != null">mea_rid,</if> |
| | | <if test="type != null">mea_type,</if> |
| | | <if test="content != null">mea_content,</if> |
| | | <if test="createTime != null">mea_create_time,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="rid != null">#{rid,jdbcType=BIGINT},</if> |
| | | <if test="type != null">#{type,jdbcType=VARCHAR},</if> |
| | | <if test="content != null">#{content,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.msg.MsgExtra">update yeshi_ec_msg_extra set mea_rid = #{rid,jdbcType=BIGINT},mea_type = #{type,jdbcType=VARCHAR},mea_content = #{content,jdbcType=VARCHAR},mea_create_time = #{createTime,jdbcType=TIMESTAMP} where mea_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.msg.MsgExtra">update yeshi_ec_msg_extra |
| | | <set> |
| | | <if test="rid != null">mea_rid=#{rid,jdbcType=BIGINT},</if> |
| | | <if test="type != null">mea_type=#{type,jdbcType=VARCHAR},</if> |
| | | <if test="content != null">mea_content=#{content,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">mea_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where mea_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | <result column="mo_happen_date" property="happendDate"
|
| | | jdbcType="TIMESTAMP" />
|
| | | <result column="mo_order_type" property="orderType" jdbcType="INTEGER" />
|
| | | <result column="extraInfo" property="extraInfo" jdbcType="VARCHAR"/>
|
| | | <association property="user" column="mo_uid"
|
| | | javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
|
| | | <id column="mo_uid" property="id" jdbcType="BIGINT" />
|
| | |
| | | from yeshi_ec_msg_order where mo_order_id = #{orderId}
|
| | | </select>
|
| | | <select id="listByUid" resultMap="BaseResultMap">
|
| | | select
|
| | | <include refid="Base_Column_List" />
|
| | | from yeshi_ec_msg_order where mo_uid = #{uid,jdbcType=BIGINT} order by
|
| | | mo_update_time desc limit #{start},#{count}
|
| | | SELECT d.*, t.`mea_content` AS extraInfo FROM yeshi_ec_msg_order d
|
| | | LEFT JOIN `yeshi_ec_msg_extra` t ON (t.`mea_rid` = d.`mo_id` AND t.`mea_type` = 'order')
|
| | | WHERE d.mo_uid = #{uid,jdbcType=BIGINT}
|
| | | ORDER BY d.mo_update_time DESC |
| | | LIMIT #{start},#{count}
|
| | | </select>
|
| | | <select id="countByUid" resultType="java.lang.Long"
|
| | | parameterType="java.lang.Long">select count(mo_id) from yeshi_ec_msg_order where mo_uid
|
| | |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="happendDate != null">#{happendDate,jdbcType=TIMESTAMP},</if>
|
| | | <if test="orderType != null">#{orderType,jdbcType=INTEGER}</if>
|
| | | <if test="orderType != null">#{orderType,jdbcType=INTEGER},</if>
|
| | | </trim>
|
| | | </insert>
|
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.msg.MsgOrderDetail">update
|
| | |
| | | WHERE d.`co_settle_time` IS NOT NULL AND d.`co_payment` > 1 |
| | | GROUP BY d.`co_uid` |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | <select id="getOrderList" resultMap="ResultMap"> |
| | | SELECT hb.`hb_type` AS hongBaoType, MAX(hb.`hb_get_time`) AS |
| | | accountTime, MAX(hb.`hb_pre_get_time`) AS preAccountTime, |
| | | <include refid="Order_Column_List" /> |
| | | FROM yeshi_ec_hongbao_order ho LEFT JOIN (SELECT |
| | | <include refid="Hongbao_Column_List" /> |
| | | FROM yeshi_ec_hongbao_v2 v2 WHERE v2.`hb_uid`= #{uid} AND <![CDATA[v2.`hb_type`<> 10 ]]> |
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE" /> |
| | | <if test="type == 2 and day == 5"> |
| | | <!-- 本月月将要到账分享订单 --> |
| | | AND DATE_FORMAT(v2.`hb_pre_get_time`,'%Y%m') = |
| | | DATE_FORMAT(CURDATE(),'%Y%m') |
| | | </if> |
| | | <if test="type == 3 and day == 5"> |
| | | <!-- 本月将要到账邀请订单 --> |
| | | AND DATE_FORMAT(v2.`hb_pre_get_time`,'%Y%m') = |
| | | DATE_FORMAT(CURDATE(),'%Y%m') |
| | | </if> |
| | | <!-- 红包类型 --> |
| | | )hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL |
| | | <include refid="SELECT_PARAM_ORDER_STATE" /> |
| | | <!-- 订单状态 --> |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" /> |
| | | <!-- 订单时间 --> |
| | | <include refid="SELECT_PARAM_HONGBAO_STATE" /> |
| | | <!-- 订单号查询 --> |
| | | <if test="orderNo != null and orderNo !='' ">AND co.co_order_no = #{orderNo}</if> |
| | | <!-- 订单来源 --> |
| | | <if test="listSource != null and listSource.size() > 0"> |
| | | <foreach collection="listSource" item="item" open="AND (" close=")" separator="or"> |
| | | co.co_source_type = #{item} |
| | | </foreach> |
| | | </if> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type` ORDER BY |
| | | co.co_third_create_time DESC LIMIT ${start},${count} |
| | | </select> |
| | | <select id="countOrderList" resultType="java.lang.Long"> |
| | | SELECT IFNULL(COUNT(ho_id),0) FROM (SELECT ho.ho_id FROM |
| | | yeshi_ec_hongbao_order ho LEFT JOIN (SELECT |
| | | <include refid="Hongbao_Column_List" /> |
| | | FROM yeshi_ec_hongbao_v2 v2 WHERE v2.`hb_uid`= #{uid} AND <![CDATA[v2.`hb_type`<> 10 ]]> |
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE" /> |
| | | <!-- 红包类型 --> |
| | | <if test="type == 2 and day == 5"> |
| | | <!-- 本月月将要到账分享订单 --> |
| | | AND DATE_FORMAT(v2.`hb_pre_get_time`,'%Y%m') = |
| | | DATE_FORMAT(CURDATE(),'%Y%m') |
| | | </if> |
| | | <if test="type == 3 and day == 5"> |
| | | <!-- 本月将要到账邀请订单 --> |
| | | AND DATE_FORMAT(v2.`hb_pre_get_time`,'%Y%m') = |
| | | DATE_FORMAT(CURDATE(),'%Y%m') |
| | | </if> |
| | | )hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL |
| | | <include refid="SELECT_PARAM_ORDER_STATE" /> |
| | | <!-- 订单状态 --> |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" /> |
| | | <!-- 订单时间 --> |
| | | <include refid="SELECT_PARAM_HONGBAO_STATE" /> |
| | | <!-- 订单号查询 --> |
| | | <if test="orderNo != null and orderNo !='' ">AND co.co_order_no = #{orderNo}</if> |
| | | <!-- 订单来源 --> |
| | | <if test="listSource != null and listSource.size() > 0"> |
| | | <foreach collection="listSource" item="item" open="AND (" close=")" separator="or"> |
| | | co.co_source_type = #{item} |
| | | </foreach> |
| | | </if> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type` )A |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | </select>
|
| | |
|
| | |
|
| | | <select id="listDetailByOrderIdAndSourceTypeAndUid" resultMap="BaseDetailResultMap">
|
| | | SELECT ho.*,co.*,v2.*,co_order_goods_id as cog_id FROM yeshi_ec_common_order co |
| | | LEFT JOIN yeshi_ec_hongbao_order ho ON ho.`ho_order_id`=co.`co_id`
|
| | | left join yeshi_ec_hongbao_v2 v2 ON IF(v2.hb_pid IS NULL,v2.hb_id,v2.hb_pid)=ho.`ho_hongbao_id`
|
| | | WHERE v2.hb_uid =#{uid} AND co.`co_order_no`=#{orderId} AND co.`co_source_type`=#{sourceType} AND ho.`ho_id`>0
|
| | | </select>
|
| | | |
| | |
|
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
|
| | | yeshi_ec_hongbao_order where ho_id = #{id,jdbcType=BIGINT}
|
| | |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <select id="sumMoneyByUidAndDateAndState" resultType="BigDecimal"> |
| | | SELECT SUM(d.`os_money`) FROM yeshi_ec_invite_order_subsidy d |
| | | WHERE d.`os_uid` = #{uid} AND d.`os_state` = #{state} |
| | | <if test="level != null"> |
| | | AND d.os_level = #{level} |
| | | </if> |
| | | <if test="day == 1"> <!-- 今天 --> |
| | | AND TO_DAYS(d.`os_valid_time`) = TO_DAYS(NOW()) |
| | | </if> |
| | | <if test="day == 2"> <!-- 昨天 --> |
| | | AND TO_DAYS(NOW()) - TO_DAYS(d.`os_valid_time`) = 1 |
| | | </if> |
| | | <if test="day == 3"> <!-- 本月 --> |
| | | AND DATE_FORMAT(d.`os_valid_time`,'%Y%m') = DATE_FORMAT(CURDATE(),'%Y%m') |
| | | </if> |
| | | <if test="day == 4"> <!-- 上月 --> |
| | | AND PERIOD_DIFF(DATE_FORMAT(NOW(),'%Y%m'),DATE_FORMAT(d.`os_valid_time`, '%Y%m')) = 1 |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <select id="sumRecievedMoneyByUid" resultType="BigDecimal"> |
| | | SELECT SUM(d.`os_money`) FROM yeshi_ec_invite_order_subsidy d |
| | |
| | | </select> |
| | | |
| | | |
| | | <select id="query" resultMap="BaseResultMap"> |
| | | SELECT * FROM `yeshi_ec_red_pack_win_invite` d |
| | | WHERE 1=1 <if test="key != null and key != ''">AND d.`rwr_uid` = #{key}</if> |
| | | <if test="type != null">AND d.`rwr_type`= #{type}</if> |
| | | ORDER BY d.rwr_id DESC |
| | | LIMIT #{start},#{count} |
| | | </select> |
| | | |
| | | <select id="count" resultType="Long"> |
| | | SELECT COUNT(DISTINCT d.`rwr_id`) FROM `yeshi_ec_red_pack_win_invite` d |
| | | WHERE 1=1 <if test="key != null and key != ''">AND d.`rwr_uid` = #{key}</if> |
| | | <if test="type != null">AND d.`rwr_type`= #{type}</if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | return hongBaoV2CountMapper.getRewardMoneyByDate(uid, dateType, hbType, null, null, null, null, null, listSource);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public BigDecimal geBonusByuid(Long uid, Integer dateType, Integer hbType, Integer moneyState) {
|
| | | BigDecimal money = hongBaoV2CountMapper.getRewardMoneyByDate(uid, dateType, hbType, null, null, moneyState, null, null, null);
|
| | | if (money == null) {
|
| | | money = new BigDecimal(0);
|
| | | }
|
| | | return money;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public BigDecimal getRewardMoneyByToSearch(Long uid, Integer dateType, Integer orderType, Integer orderState,
|
| | |
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2; |
| | | import com.yeshi.fanli.exception.dynamic.ActivityUserException; |
| | | import com.yeshi.fanli.exception.dynamic.GoodsEvaluateException; |
| | | import com.yeshi.fanli.exception.goods.ConvertLinkExceptionException; |
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException; |
| | | import com.yeshi.fanli.log.LogHelper; |
| | | import com.yeshi.fanli.service.inter.activity.ActivityUserService; |
| | |
| | | commentInfo.setId(UUID.randomUUID().toString().replace("-", "")); |
| | | commentInfo.setContent(commentText); |
| | | commentInfo.setTypeEnum(CommentInfoEnum.goodsCoupon); |
| | | commentInfo.setNeedSpin(true); |
| | | commentsNew.add(commentInfo); |
| | | resultObj.setComments(commentsNew); |
| | | } |
| | |
| | | commentInfo.setId(UUID.randomUUID().toString().replace("-", "")); |
| | | } |
| | | |
| | | commentInfo.setNeedSpin(true); |
| | | commentInfo.setType(commentInfo.getTags()); |
| | | commentInfo.setTypeEnum(CommentInfoEnum.goodsCoupon); |
| | | newList.add(commentInfo); |
| | |
| | | goodsEvaluateDao.save(resultObj); |
| | | } |
| | | |
| | | @Override |
| | | public void saveGoodsCoupon(String pid, String content) throws GoodsEvaluateException, Exception { |
| | | if (StringUtil.isNullOrEmpty(pid)) { |
| | | throw new GoodsEvaluateException(1, "请保存第一部分信息"); |
| | | } |
| | | |
| | | GoodsEvaluate resultObj = goodsEvaluateDao.getById(pid); |
| | | if (resultObj == null) |
| | | throw new GoodsEvaluateException(1, "第一部分信息缺失"); |
| | | |
| | | CommentInfo goodsCoupon = null; |
| | | CommentInfo currencyCoupon = null; |
| | | List<CommentInfo> oldComments = resultObj.getComments(); |
| | | if (oldComments != null) { |
| | | for (CommentInfo info : oldComments) { |
| | | if (CommentInfoEnum.goodsCoupon == info.getTypeEnum()) { |
| | | goodsCoupon = info; |
| | | } else if (CommentInfoEnum.currencyCoupon == info.getTypeEnum()) { |
| | | currencyCoupon = info; |
| | | } |
| | | } |
| | | } |
| | | |
| | | List<CommentInfo> comments = new ArrayList<>(); |
| | | if (!StringUtil.isNullOrEmpty(content)) { |
| | | |
| | | if (!StringUtil.isNullOrEmpty(content)) { |
| | | try { |
| | | convertLinkManager.convertLinkFromText(content, 1L, true); |
| | | } catch (Exception e) { |
| | | throw new GoodsEvaluateException(1, "不包含可转链的口令与链接"); |
| | | } |
| | | } |
| | | |
| | | CommentInfo commentInfo = new CommentInfo(); |
| | | if (goodsCoupon != null) { |
| | | commentInfo.setId(goodsCoupon.getId()); |
| | | } else { |
| | | commentInfo.setId(UUID.randomUUID().toString().replace("-", "")); |
| | | } |
| | | commentInfo.setContent(content); |
| | | commentInfo.setType(commentInfo.getTags()); |
| | | commentInfo.setTypeEnum(CommentInfoEnum.goodsCoupon); |
| | | comments.add(commentInfo); |
| | | } |
| | | |
| | | if (currencyCoupon != null) { |
| | | comments.add(currencyCoupon); |
| | | } |
| | | |
| | | resultObj.setComments(comments); |
| | | goodsEvaluateDao.save(resultObj); |
| | | } |
| | | |
| | | @Override |
| | | public void saveCurrencyCoupon(String pid, int kind, CommentInfo commentInfo) |
| | |
| | | throw new GoodsEvaluateException(1, "请填写券截止时间"); |
| | | } |
| | | |
| | | // 均不验证 |
| | | /* |
| | | * if (!StringUtil.isNullOrEmpty(content) && kind != 3) { try { |
| | | * convertLinkManager.convertLinkFromText(content, |
| | | * Constant.LINK_TOKEN_VERIFY_UID, true); } catch |
| | | * (ConvertLinkExceptionException e) { if |
| | | * (ConvertLinkExceptionException.CODE_NONE != e.getCode()) { throw new |
| | | * GoodsEvaluateException(1, "包含不可转链的口令与链接"); } } catch (Exception e) { |
| | | * throw new GoodsEvaluateException(1, "包含不可转链的口令与链接"); } } |
| | | */ |
| | | if (commentInfo.getNeedSpin() == null) { |
| | | commentInfo.setNeedSpin(false); |
| | | } |
| | | |
| | | if (!StringUtil.isNullOrEmpty(content) && commentInfo.getNeedSpin()) { |
| | | try { |
| | | convertLinkManager.convertLinkFromText(content, Constant.LINK_TOKEN_VERIFY_UID, true); |
| | | } catch (ConvertLinkExceptionException e) { |
| | | if (ConvertLinkExceptionException.CODE_NONE != e.getCode()) { |
| | | throw new GoodsEvaluateException(1, "包含不可转链的口令与链接"); |
| | | } |
| | | } catch (Exception e) { |
| | | throw new GoodsEvaluateException(1, "包含不可转链的口令与链接"); |
| | | } |
| | | } |
| | | |
| | | GoodsEvaluate resultObj = goodsEvaluateDao.getById(pid); |
| | | if (resultObj == null) |
| | |
| | | |
| | | // 评论内容 |
| | | CommentInfo commentInfo = new CommentInfo(); |
| | | commentInfo.setNeedSpin(true); |
| | | commentInfo.setId(UUID.randomUUID().toString().replace("-", "")); |
| | | commentInfo.setTypeEnum(CommentInfoEnum.goodsCoupon); |
| | | if (!StringUtil.isNullOrEmpty(comment)) { |
| | |
| | | |
| | | // 一行显示多少个图片 |
| | | int lineNum = 0; |
| | | if (imgs.size() > 0) { |
| | | if (imgs.size() == 1) { |
| | | if (imgList.size() > 0) { |
| | | if (imgList.size() == 1) { |
| | | lineNum = 1; |
| | | } else if (imgs.size() == 3) { |
| | | } else if (imgList.size() == 3) { |
| | | lineNum = 3; |
| | | } else if (imgs.size() <= 4) { |
| | | } else if (imgList.size() <= 4) { |
| | | lineNum = 2; |
| | | } else { |
| | | lineNum = 3; |
| | |
| | | } |
| | | imgs.addAll(goodsimgs); |
| | | |
| | | int lineNum = 0; |
| | | if (imgs.size() > 0) { |
| | | if (imgs.size() == 1) { |
| | | lineNum = 1; |
| | | } else if (imgs.size() == 3) { |
| | | lineNum = 3; |
| | | } else if (imgs.size() <= 4) { |
| | | lineNum = 2; |
| | | } else { |
| | | lineNum = 3; |
| | | } |
| | | } |
| | | goodsEvaluate.setLineNum(lineNum); |
| | | |
| | | int i = 0; |
| | | List<ImgInfo> imgList = new ArrayList<>(); |
| | |
| | | .replace("\r\n\r\n", "\r\n"); |
| | | |
| | | CommentInfo commentInfo = new CommentInfo(); |
| | | commentInfo.setNeedSpin(true); |
| | | commentInfo.setId(UUID.randomUUID().toString().replace("-", "")); |
| | | commentInfo.setContent(commentText); |
| | | commentInfo.setTypeEnum(CommentInfoEnum.goodsCoupon); |
| | |
| | | commentInfo2.setContent(text2); |
| | | commentInfo2.setTypeEnum(CommentInfoEnum.goodsCoupon); |
| | | commentInfo2.setType(""); |
| | | commentInfo2.setNeedSpin(true); |
| | | |
| | | List<CommentInfo> commentsNew = new ArrayList<>(); |
| | | commentsNew.add(commentInfo); |
| | |
| | | i++; |
| | | } |
| | | |
| | | int lineNum = 0; |
| | | if (imgList.size() > 0) { |
| | | if (imgList.size() == 1) { |
| | | lineNum = 1; |
| | | } else if (imgList.size() == 3) { |
| | | lineNum = 3; |
| | | } else if (imgList.size() <= 4) { |
| | | lineNum = 2; |
| | | } else { |
| | | lineNum = 3; |
| | | } |
| | | } |
| | | goodsEvaluate.setLineNum(lineNum); |
| | | |
| | | goodsEvaluate.setGoods(goodsVO); |
| | | goodsEvaluate.setImgList(imgList); |
| | | goodsEvaluateDao.save(goodsEvaluate); |
| | |
| | | detail.setUpdateTime(new Date());
|
| | | detail.setRead(false);
|
| | | msgMoneyDetailMapper.insertSelective(detail);
|
| | | } else if (detail.getMsgType() == MsgTypeMoneyTypeEnum.fanliElme) {
|
| | | if (detail.getMoney() == null || detail.getUser() == null)
|
| | | throw new MsgMoneyDetailException(2, "消息信息不全");
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setRead(false);
|
| | | msgMoneyDetailMapper.insertSelective(detail);
|
| | | }
|
| | | userMsgReadStateService.addMoneyMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | }
|
| | |
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dto.push.PushContentDTO;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgExtra;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.AlipayAccountValidNormalHistory;
|
| | |
| | | import com.yeshi.fanli.exception.push.PushException;
|
| | | import com.yeshi.fanli.service.inter.money.msg.MsgMoneyDetailService;
|
| | | import com.yeshi.fanli.service.inter.money.msg.UserMoneyMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.msg.MsgExtraService;
|
| | | import com.yeshi.fanli.service.inter.push.PushService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.factory.msg.MsgMoneyDetailFactory;
|
| | |
| | | @Resource
|
| | | private PushService pushService;
|
| | |
|
| | | @Resource
|
| | | private MsgExtraService msgExtraService;
|
| | |
|
| | | @Override
|
| | | public void extractApplay(Extract extract) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createExtractApplyMsg(extract, extract.getUserInfo().getId(),
|
| | | null);
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createExtractMsg("人工审核中", extract.getUserInfo().getId(),
|
| | | extract, null, null);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_MONEY);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Async
|
| | | @Override
|
| | | public void extractAuto(ExtractWeiXinRecord extractRecord, String stateDesc, String desc, String beiZhu) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createExtractAutoMsg(extractRecord, stateDesc, desc, beiZhu);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void extractFail(Extract extract, String stateDesc) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createExtractFailMsg(extract, extract.getUserInfo().getId(),
|
| | | stateDesc);
|
| | | public void extractFail(Extract extract, String reason) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createExtractMsg("提现失败", extract.getUserInfo().getId(),
|
| | | extract, reason, null);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_MONEY);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void extractSuccess(Extract extract) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createExtractSuccessMsg(extract, extract.getUserInfo().getId(),
|
| | | null);
|
| | | public void extractSuccess(Extract extract, String alipayNo) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createExtractMsg("提现成功", extract.getUserInfo().getId(),
|
| | | extract, null, alipayNo);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_MONEY);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void alipayAccountValid(AlipayAccountValidNormalHistory history) {
|
| | | public void alipayAccountValid(AlipayAccountValidNormalHistory history, int limitDay, boolean change) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createAlipayAccountValidMsg(history, history.getUid(),
|
| | | Constant.systemCommonConfig.getProjectChineseName(), new BigDecimal("0.1"), null);
|
| | | Constant.systemCommonConfig.getProjectChineseName(), new BigDecimal("0.1"), limitDay, change);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_MONEY);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public void fanliOrderReceived(Long uid, String orderId, int orderType, int goodsCount, BigDecimal money,
|
| | | BigDecimal balance) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createFailiMsg(money, balance, orderId, orderType, goodsCount,
|
| | | uid, "若需再返请使用返利奖励券");
|
| | | public void alipayAccountValidFail(AlipayAccountValidNormalHistory history, int limitDay, boolean change) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createAlipayAccountValidFail(history, history.getUid(),
|
| | | Constant.systemCommonConfig.getProjectChineseName(), new BigDecimal("0.1"), limitDay, change);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_MONEY);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public void fanliOrderReceived(Long uid, String orderId, int orderType, int goodsCount, BigDecimal money,
|
| | | BigDecimal balance, Date downTime) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createOrderReceivedMsg(money, balance, orderId, orderType, goodsCount,
|
| | | uid, Constant.TYPE_REBATE, downTime, false);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_MONEY);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void fanliOrderWeiQuan(Long uid, String orderId, int orderType, BigDecimal money, BigDecimal balance) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createFailiWeiQuanMsg(uid, orderId, orderType, money, balance,
|
| | | null);
|
| | | public void fanliOrderWeiQuan(Long uid, String orderId, int orderType, BigDecimal money, BigDecimal fanliMoney, |
| | | int goodsCount, Date downTime) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createOrderWeiQuanMsg(uid, orderId, orderType, money, fanliMoney,
|
| | | goodsCount, downTime, Constant.TYPE_REBATE);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_MONEY);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | |
|
| | | @Override
|
| | | public void shareOrderReceived(Long uid, int orderType, int orderCount, int goodsCount, BigDecimal money,
|
| | | BigDecimal balance) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createShareMsg(money, balance, orderType, orderCount, goodsCount,
|
| | | uid, null);
|
| | | BigDecimal balance, String orderId, Date downTime) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createOrderReceivedMsg(money, balance, orderId, orderType, goodsCount,
|
| | | uid, Constant.TYPE_SHAER, downTime, false);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_MONEY);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | |
| | | PushContentDTO dto = PushMsgFactory.createMoneyShareRecieved(orderType, money);
|
| | | try {
|
| | | pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null, null);
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void shareOrderWeiQuan(Long uid, String orderId, int orderType, BigDecimal money, BigDecimal balance) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createShareWeiQuanMsg(uid, orderId, orderType, money, balance,
|
| | | null);
|
| | | public void shareOrderWeiQuan(Long uid, String orderId, int orderType, BigDecimal money, BigDecimal fanliMoney,
|
| | | int goodsCount, Date downTime) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createOrderWeiQuanMsg(uid, orderId, orderType, money, fanliMoney,
|
| | | goodsCount, downTime, Constant.TYPE_SHAER);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_MONEY);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void inviteOrderReceived(Long uid, int orderType, int orderCount, int goodsCount, BigDecimal money,
|
| | | BigDecimal balance) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createInviteMsg(money, balance, orderType, orderCount, goodsCount,
|
| | | uid, null);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | // MsgMoneyDetail detail = MsgMoneyDetailFactory.createInviteReceivedMsg(money, balance, orderType, orderCount, goodsCount,
|
| | | // uid, null);
|
| | | // try {
|
| | | // msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | // } catch (MsgMoneyDetailException e) {
|
| | | // e.printStackTrace();
|
| | | // }
|
| | | //
|
| | | // PushContentDTO dto = PushMsgFactory.createMoneyInviteRecieved(orderType, money);
|
| | | // try {
|
| | | // pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null, null);
|
| | | // } catch (NumberFormatException e) {
|
| | | // e.printStackTrace();
|
| | | // } catch (PushException e) {
|
| | | // e.printStackTrace();
|
| | | // }
|
| | | }
|
| | |
|
| | | PushContentDTO dto = PushMsgFactory.createMoneyInviteRecieved(orderType, money);
|
| | | try {
|
| | | pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null, null);
|
| | | } catch (NumberFormatException e) {
|
| | | e.printStackTrace();
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public void inviteOrderWeiQuan(Long uid, String orderId, int orderType, BigDecimal money, BigDecimal balance) {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void orderTeamReward(Long uid, Date date, String from, BigDecimal money, BigDecimal balance) {
|
| | |
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createOrderTeamRewardMsg(uid, date, from, money, balance, null);
|
| | | public void teamReceive(Long uid, BigDecimal money, BigDecimal balance, Date receivedDate) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createTeamReceivedMsg(uid, money, balance, receivedDate);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_MONEY);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.msg;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.msg.MsgExtraMapper;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgExtra;
|
| | | import com.yeshi.fanli.service.inter.msg.MsgExtraService;
|
| | |
|
| | | @Service
|
| | | public class MsgExtraServiceImpl implements MsgExtraService {
|
| | |
|
| | | @Resource
|
| | | private MsgExtraMapper msgExtraMapper;
|
| | |
|
| | | @Override
|
| | | public void addMsgExtra(long rid, String content, String type){
|
| | | MsgExtra msgExtra = new MsgExtra();
|
| | | msgExtra.setRid(rid);
|
| | | msgExtra.setType(type);
|
| | | msgExtra.setContent(content);
|
| | | msgExtra.setCreateTime(new Date());
|
| | | msgExtraMapper.insertSelective(msgExtra);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO; |
| | | import com.yeshi.fanli.vo.order.CommonOrderGoodsVO; |
| | | import com.yeshi.fanli.vo.order.CommonOrderVO; |
| | | import com.yeshi.fanli.vo.order.HongBaoCountVO; |
| | | import com.yeshi.fanli.vo.order.OrderCountVO; |
| | | import com.yeshi.fanli.vo.order.WeiQuanInfo; |
| | | |
| | |
| | | |
| | | // 数据加工重新组织 |
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | orderVOFactoryNew(acceptData, listOrder, listGoods, uid); |
| | | orderVOFactory21(acceptData, listOrder, listGoods, uid); |
| | | } else { |
| | | orderVOFactory(acceptData, listOrder, listGoods, uid); |
| | | } |
| | |
| | | Date august = TimeUtil.parse("2019-08-01"); |
| | | |
| | | // 当前用户是否VIP |
| | | boolean vip = userVIPInfoService.isVIP(uid); |
| | | boolean vip = userInviteService.verifyVIP(uid); |
| | | |
| | | // 是否存在奖励券 |
| | | boolean hasRewardCoupon = userSystemCouponService.getValidRebateCoupon(uid); |
| | | for (CommonOrderVO order : listOrder) { |
| | |
| | | return commonOrderMapper.countUserOrderToApp(uid, type, startTime, endTime, day, source, state, stateOrder); |
| | | } |
| | | |
| | | private BigDecimal getWeiQuanMoney(List<TaoBaoWeiQuanOrder> listWQ, int sourceType, Long uid) { |
| | | |
| | | @Override |
| | | public BigDecimal getWeiQuanMoney(List<TaoBaoWeiQuanOrder> listWQ, int sourceType, Long uid) { |
| | | BigDecimal weiQuanMoney = new BigDecimal(0); |
| | | if (listWQ != null && listWQ.size() > 0) { |
| | | for (TaoBaoWeiQuanOrder weiQuanOrder : listWQ) { |
| | |
| | | } |
| | | |
| | | // 数据加工重新组织 |
| | | orderVOFactoryNew(acceptData, listVO, listGoods, uid); |
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | orderVOFactory21(acceptData, listVO, listGoods, uid); |
| | | } else { |
| | | orderVOFactory(acceptData, listVO, listGoods, uid); |
| | | } |
| | | |
| | | return listVO; |
| | | } |
| | |
| | | return list.get(0).getThirdCreateTime(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<CommonOrderVO> getOrderList(AcceptData acceptData, Integer page, Long uid, Integer state, Integer type, |
| | | Integer orderState, String orderNo, String startTime, String endTime, Integer dateType, |
| | | List<Integer> listSource) throws CommonOrderException, Exception { |
| | | |
| | | int pageSize = Constant.PAGE_SIZE; |
| | | List<CommonOrderVO> listOrder = commonOrderMapper.getOrderList((page - 1) * pageSize, pageSize, uid, state, |
| | | type, orderState, orderNo, startTime, endTime, dateType, listSource); |
| | | |
| | | // 订单信息为空 |
| | | if (listOrder == null || listOrder.size() == 0) { |
| | | listOrder = new ArrayList<CommonOrderVO>(); |
| | | return listOrder; |
| | | } |
| | | |
| | | // 商品信息 |
| | | List<CommonOrderVO> listGoods = commonOrderMapper.listOrderGoodsInfo(listOrder); |
| | | if (listGoods == null || listGoods.size() == 0) { |
| | | return listOrder; |
| | | } |
| | | |
| | | // 数据加工重新组织 |
| | | orderVOFactory21(acceptData, listOrder, listGoods, uid); |
| | | |
| | | return listOrder; |
| | | } |
| | | |
| | | @Override |
| | | public long countOrderList(Long uid, Integer state, Integer type, Integer orderState, String orderNo, |
| | | String startTime, String endTime, Integer dateType, List<Integer> listSource) throws CommonOrderException { |
| | | return commonOrderMapper.countOrderList(uid, state, type, orderState, orderNo, startTime, endTime, dateType, |
| | | listSource); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 订单信息加工 |
| | | * |
| | | * @param acceptData |
| | | * @param listOrder |
| | | * @param listGoods |
| | | * @param uid |
| | | */ |
| | | private void orderVOFactory21(AcceptData acceptData, List<CommonOrderVO> listOrder, List<CommonOrderVO> listGoods, |
| | | Long uid) throws Exception { |
| | | List<String> listTB = new ArrayList<String>(); |
| | | List<String> listJD = new ArrayList<String>(); |
| | | List<String> listPDD = new ArrayList<String>(); |
| | | for (CommonOrderVO order : listOrder) { |
| | | if (order.getHongBaoType() == HongBaoV2.TYPE_YIJI || order.getHongBaoType() == HongBaoV2.TYPE_ERJI |
| | | || order.getHongBaoType() == HongBaoV2.TYPE_SHARE_ERJI |
| | | || order.getHongBaoType() == HongBaoV2.TYPE_SHARE_ERJI) { |
| | | Integer urank = order.getUrank(); |
| | | if (urank != null) { |
| | | String levelName = UserLevelUtil.getLevelName(urank); |
| | | if (!StringUtil.isNullOrEmpty(levelName)) { |
| | | order.setOrderDesc("订单来源:" + levelName); |
| | | } |
| | | } |
| | | } |
| | | |
| | | Integer sourceType = order.getSourceType(); |
| | | if (sourceType == null) { |
| | | continue; |
| | | } else if (sourceType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | listTB.add(order.getOrderNo()); |
| | | } else if (sourceType == Constant.SOURCE_TYPE_JD) { |
| | | listJD.add(order.getOrderNo()); |
| | | } else if (sourceType == Constant.SOURCE_TYPE_PDD) { |
| | | listPDD.add(order.getOrderNo()); |
| | | } |
| | | } |
| | | |
| | | List<UserSystemCouponRecord> listRecordTB = null; |
| | | if (listTB.size() > 0) { |
| | | listRecordTB = userSystemCouponRecordService.getRecordByOrderNoList(Constant.SOURCE_TYPE_TAOBAO, listTB); |
| | | } |
| | | |
| | | List<UserSystemCouponRecord> listRecordJD = null; |
| | | if (listJD.size() > 0) { |
| | | listRecordJD = userSystemCouponRecordService.getRecordByOrderNoList(Constant.SOURCE_TYPE_JD, listJD); |
| | | } |
| | | |
| | | List<UserSystemCouponRecord> listRecordPDD = null; |
| | | if (listPDD.size() > 0) { |
| | | listRecordPDD = userSystemCouponRecordService.getRecordByOrderNoList(Constant.SOURCE_TYPE_PDD, listPDD); |
| | | } |
| | | |
| | | |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy.MM.dd HH:mm"); |
| | | SimpleDateFormat formatday = new SimpleDateFormat("yyyy.MM.dd"); |
| | | // 是否存在奖励券 |
| | | for (CommonOrderVO order : listOrder) { |
| | | String orderNo = order.getOrderNo(); |
| | | Integer sourceType = order.getSourceType(); |
| | | Integer hongBaoType = order.getHongBaoType(); |
| | | |
| | | // 商品信息组合 |
| | | for (CommonOrderVO commonOrder : listGoods) { |
| | | CommonOrderGoods goods = commonOrder.getCommonOrderGoods(); |
| | | if (goods == null) { |
| | | continue; |
| | | } |
| | | |
| | | if (sourceType.equals(commonOrder.getSourceType()) && orderNo.equals(commonOrder.getOrderNo())) { |
| | | CommonOrderGoodsVO commonGoodsVO = new CommonOrderGoodsVO(); |
| | | PropertyUtils.copyProperties(commonGoodsVO, goods); |
| | | if (commonGoodsVO.getGoodsType() == null) { |
| | | commonGoodsVO.setGoodsType(sourceType); |
| | | } |
| | | |
| | | // 淘宝商品图片处理 |
| | | String picture = commonGoodsVO.getPicture(); |
| | | if (sourceType == Constant.SOURCE_TYPE_TAOBAO && !StringUtil.isNullOrEmpty(picture) |
| | | && !picture.contains("320x320")) { |
| | | commonGoodsVO.setPicture(TbImgUtil.getTBSize320Img(picture)); |
| | | } |
| | | |
| | | // 购买数量 |
| | | commonGoodsVO.setActualCount(commonOrder.getTotalCount() + "件"); |
| | | |
| | | // 实付款 |
| | | BigDecimal totalSettlement = commonOrder.getTotalSettlement(); |
| | | if (totalSettlement == null || totalSettlement.compareTo(new BigDecimal(0)) <= 0) { |
| | | totalSettlement = commonOrder.getTotalPayment(); |
| | | } |
| | | commonGoodsVO.setActualPay("付款金额:¥" + totalSettlement); |
| | | |
| | | // 邀请订单信息保护 |
| | | if (HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType |
| | | || HongBaoV2.TYPE_ERJI == hongBaoType || HongBaoV2.TYPE_SHARE_YIJI == hongBaoType |
| | | || HongBaoV2.TYPE_SHARE_ERJI == hongBaoType) { |
| | | Map<String, String> titleMap = new HashMap<String, String>(); |
| | | titleMap.put("content", "为保障用户隐私,商品信息已隐藏!"); |
| | | titleMap.put("fontColor", "#888888"); |
| | | titleMap.put("bottomColor", "#E9E9E9"); |
| | | commonGoodsVO.setTitle(null); |
| | | commonGoodsVO.setGoodsTitle(titleMap); |
| | | } |
| | | |
| | | // 订单类型为空时 已商品类为准 |
| | | String shopType = commonGoodsVO.getShopType(); |
| | | if (CommonOrderGoodsVO.TYPE_TAOBAO.equalsIgnoreCase(shopType)) { |
| | | order.setOrderType(1); |
| | | } else if (CommonOrderGoodsVO.TYPE_TMALL.equalsIgnoreCase(shopType)) { |
| | | order.setOrderType(2); |
| | | } |
| | | |
| | | Integer goodsType = commonGoodsVO.getGoodsType(); |
| | | if (goodsType != null & goodsType == Constant.SOURCE_TYPE_ELME) { |
| | | order.setOrderType(Constant.SOURCE_TYPE_ELME); // 饿了么订单 |
| | | } |
| | | order.getListOrderGoods().add(commonGoodsVO); |
| | | } |
| | | } |
| | | |
| | | // 订单类型 |
| | | if (sourceType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | Integer orderType = order.getOrderType(); |
| | | if (orderType == null) { |
| | | order.setOrderType(1); |
| | | } |
| | | } else if (sourceType == Constant.SOURCE_TYPE_JD) { |
| | | order.setOrderType(3); |
| | | } else if (sourceType == Constant.SOURCE_TYPE_PDD) { |
| | | order.setOrderType(4); |
| | | } |
| | | |
| | | Date thirdCreateTime = order.getThirdCreateTime(); |
| | | if (thirdCreateTime != null) { |
| | | order.setDownTime("下单时间:" + format.format(thirdCreateTime)); |
| | | order.setObtainTime(thirdCreateTime.getTime()); |
| | | } |
| | | |
| | | Date settleTime = order.getSettleTime(); |
| | | if (settleTime != null) { |
| | | order.setReceiveTime("收货时间:" + format.format(settleTime)); |
| | | } |
| | | |
| | | |
| | | Map<String, String> orderStateMap = new HashMap<String, String>(); |
| | | // 订单状态 |
| | | Integer orderState = order.getState(); |
| | | Integer stateWholeOrder = order.getStateWholeOrder(); |
| | | if (CommonOrder.STATE_WHOLE_ORDER_BUFENYOUXIAO == stateWholeOrder) { |
| | | // 整个订单部分失效:判断真实状态 订单、红包 |
| | | CommonOrderVO buFenOrder = commonOrderMapper.getBuFenOrderState(uid, order.getOrderNo()); |
| | | if (buFenOrder != null) { |
| | | // 有效的订单状态 |
| | | orderState = buFenOrder.getState(); |
| | | } |
| | | } |
| | | |
| | | // 显示返利说明连接> 未失效 |
| | | if (CommonOrder.STATE_SX != orderState |
| | | && thirdCreateTime.getTime() > TimeUtil.convertDateToTemp(Constant.ORDER_SHOW_BRACE_TIME)) { |
| | | String rebateLink = configService.get(ConfigKeyEnum.orderRebateDescLink.getKey()); |
| | | order.setRebateLink(rebateLink + "?orderNo=" + orderNo + "&sourceType=" + sourceType); |
| | | } |
| | | |
| | | // 红包信息 |
| | | List<HongBaoOrder> hongBaoOrderList = hongBaoOrderService.listDetailByOrderIdAndSourceTypeAndUid(orderNo, sourceType, uid); |
| | | HongBaoCountVO hongBaoCountVO = hongBaoOrderService.getHongBaoCountVO(hongBaoOrderList); |
| | | BigDecimal hongBao = hongBaoCountVO.getValidMoney(); |
| | | Integer hongBaoState = hongBaoCountVO.getCurrentState(); |
| | | |
| | | |
| | | /* 订单状态 转换处理 */ |
| | | String orderStateContent = ""; |
| | | if (CommonOrder.STATE_FK == orderState) { |
| | | orderStateContent = "已付款"; |
| | | } else if (CommonOrder.STATE_JS == orderState) { |
| | | orderStateContent = "已收货"; |
| | | } else if (CommonOrder.STATE_SX == orderState) { |
| | | orderStateContent = "未付款/已退款"; |
| | | } else if (CommonOrder.STATE_WQ == orderState) { |
| | | orderStateContent = "已售后"; |
| | | if (sourceType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | /* 订单维权 判断是否全部维权 */ |
| | | List<TaoBaoWeiQuanOrder> listWQ = taoBaoWeiQuanOrderMapper.selectListByOrderIdAndState(order.getOrderNo(), "维权成功"); |
| | | BigDecimal weiQuanMoney = getWeiQuanMoney(listWQ, sourceType, uid); |
| | | hongBao = MoneyBigDecimalUtil.sub(hongBao, weiQuanMoney); |
| | | } |
| | | } |
| | | orderStateMap.put("content", orderStateContent); |
| | | orderStateMap.put("fontColor", "#666666"); |
| | | order.setOrderState(orderStateMap); |
| | | |
| | | String hongbaoInfo = ""; |
| | | // 订单标识 |
| | | List<String> signList = new ArrayList<String>(); |
| | | /* 订单返利类型 转换 */ |
| | | if (HongBaoV2.TYPE_ZIGOU == hongBaoType || 2 == hongBaoType) { |
| | | // 自购 |
| | | hongbaoInfo = "返利"; |
| | | order.setOrderOrigin("1"); |
| | | order.setHongBaoTypePic(CommonOrder.TYPE_FANLI); |
| | | signList.add(CommonOrder.TYPE_FANLI); |
| | | |
| | | // 是否已使用奖励券、免单券情况 |
| | | if (sourceType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | couponUseFactory(order, listRecordTB); |
| | | } else if (sourceType == Constant.SOURCE_TYPE_JD) { |
| | | couponUseFactory(order, listRecordJD); |
| | | } else if (sourceType == Constant.SOURCE_TYPE_PDD) { |
| | | couponUseFactory(order, listRecordPDD); |
| | | } |
| | | } else if (HongBaoV2.TYPE_SHARE_GOODS == hongBaoType) { |
| | | // 分享 |
| | | hongbaoInfo = "奖金"; |
| | | order.setOrderOrigin("2"); |
| | | order.setHongBaoTypePic(CommonOrder.TYPE_SHARE); |
| | | signList.add(CommonOrder.TYPE_SHARE); |
| | | |
| | | } else if (HongBaoV2.TYPE_SHARE_YIJI == hongBaoType || HongBaoV2.TYPE_SHARE_ERJI == hongBaoType |
| | | || HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType |
| | | || HongBaoV2.TYPE_ERJI == hongBaoType) { |
| | | // 邀请订单 |
| | | hongbaoInfo = "收益"; |
| | | order.setOrderOrigin("3"); |
| | | order.setHongBaoTypePic(CommonOrder.TYPE_INVITE); |
| | | signList.add(CommonOrder.TYPE_INVITE); |
| | | } |
| | | order.setSignList(signList); |
| | | |
| | | String hongBaoDate = null; |
| | | String hongBaoState_Str = ""; |
| | | String hongbaoInfoFontColor = "#E5005C"; |
| | | |
| | | /* 红包状态 转换 */ |
| | | String stateContent = ""; |
| | | String stateFontColor = "#E5005C"; |
| | | Integer orderHongBaoState = null; |
| | | if (HongBaoV2.STATE_KELINGQU == hongBaoState || HongBaoV2.STATE_BUKELINGQU == hongBaoState) { |
| | | orderHongBaoState = 1; |
| | | stateContent = "未到账"; |
| | | hongBaoState_Str = "预估"; |
| | | Date preAccountTime = order.getPreAccountTime(); |
| | | if (preAccountTime != null) { |
| | | hongBaoDate = "预计到账时间:" + formatday.format(preAccountTime); |
| | | } |
| | | } else if (HongBaoV2.STATE_YILINGQU == hongBaoState) { |
| | | orderHongBaoState = 3; |
| | | stateContent = "已到账"; |
| | | Date accountTime = order.getAccountTime(); |
| | | if (accountTime != null) { |
| | | hongBaoDate = "到账时间:" + formatday.format(accountTime); |
| | | } |
| | | } else if (HongBaoV2.STATE_SHIXIAO == hongBaoState) { |
| | | orderHongBaoState = 4; |
| | | stateContent = "已失效"; |
| | | hongbaoInfoFontColor = "#888888"; |
| | | } |
| | | order.setHongBaoState(orderHongBaoState); |
| | | order.setHongBaoDate(hongBaoDate); |
| | | |
| | | if (!StringUtil.isNullOrEmpty(order.getStateDesc())) { |
| | | stateContent = stateContent + "-" + order.getStateDesc(); |
| | | } |
| | | |
| | | Map<String, String> stateMap = new HashMap<String, String>(); |
| | | stateMap.put("content", stateContent); |
| | | stateMap.put("fontColor", stateFontColor); |
| | | order.setAccountState(stateMap); |
| | | |
| | | hongbaoInfo = hongBaoState_Str + hongbaoInfo; |
| | | |
| | | Map<String, String> hongBaoMap = new HashMap<String, String>(); |
| | | hongBaoMap.put("content", hongbaoInfo + " ¥" + hongBao.setScale(2, BigDecimal.ROUND_DOWN).toString()); |
| | | hongBaoMap.put("fontColor", hongbaoInfoFontColor); |
| | | order.setHongBaoInfo(hongBaoMap); |
| | | |
| | | // 分享、邀请 隐藏订单号 |
| | | if (HongBaoV2.TYPE_SHARE_GOODS == hongBaoType || HongBaoV2.TYPE_YAOQING == hongBaoType |
| | | || HongBaoV2.TYPE_YIJI == hongBaoType || HongBaoV2.TYPE_ERJI == hongBaoType |
| | | || HongBaoV2.TYPE_SHARE_YIJI == hongBaoType || HongBaoV2.TYPE_SHARE_ERJI == hongBaoType) { |
| | | order.setOrderNo(UserUtil.filterOrderId(order.getOrderNo())); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 订单: 免单标识 奖励标识 |
| | | * |
| | | * @param order |
| | | * @param hasRewardCoupon |
| | | * @param hongBaoState |
| | | * @param list |
| | | * @param signList |
| | | */ |
| | | private void couponUseFactory(CommonOrderVO order, List<UserSystemCouponRecord> list) throws Exception { |
| | | if (list == null || list.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | // 是否免单商品 |
| | | boolean freeOrder = false; |
| | | // 是否奖励成功 |
| | | boolean rewardSuccess = false; |
| | | for (UserSystemCouponRecord couponRecord : list) { |
| | | int goodSource = couponRecord.getGoodSource(); |
| | | if (goodSource == 0) |
| | | goodSource = 1; |
| | | |
| | | String orderNo = couponRecord.getOrderNo(); |
| | | if (order.getOrderNo().equals(orderNo) && goodSource == order.getSourceType()) { |
| | | Integer state = couponRecord.getState(); |
| | | String systemCouponType = couponRecord.getCouponType(); |
| | | if (CouponTypeEnum.rebatePercentCoupon.name().equals(systemCouponType) |
| | | && UserSystemCouponRecord.STATE_SUCCESS == state) { |
| | | // 已使用奖励券 |
| | | rewardSuccess = true; |
| | | } else if (CouponTypeEnum.freeCoupon.name().equals(systemCouponType) |
| | | || CouponTypeEnum.welfareFreeCoupon.name().equals(systemCouponType) |
| | | || CouponTypeEnum.freeCouponBuy.name().equals(systemCouponType)) { |
| | | if (UserSystemCouponRecord.STATE_FREE_ON == state) { |
| | | // 免单中 |
| | | freeOrder = true; |
| | | order.getSignList().add(PIC_FREE_ON); |
| | | } else if (UserSystemCouponRecord.STATE_SUCCESS == state) { |
| | | // 免单成功 |
| | | freeOrder = true; |
| | | order.getSignList().add(PIC_FREE_SUCCEED); |
| | | } else if (UserSystemCouponRecord.STATE_FAIL_RULE == state |
| | | || UserSystemCouponRecord.STATE_FAIL_DRAWBACK == state) { |
| | | // 规则不匹配、退款 |
| | | freeOrder = true; |
| | | order.getSignList().add(PIC_FREE_FAIL); |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | |
| | | // 免单详情 |
| | | if (freeOrder) { |
| | | ClientTextStyleVO rewardStyleVO = new ClientTextStyleVO(); |
| | | rewardStyleVO.setContent("免单详情 >"); |
| | | rewardStyleVO.setColor("#E5005C"); |
| | | rewardStyleVO.setBottomColor("#FFDCEA"); |
| | | |
| | | Map<String, Object> jumpLink = new HashMap<String, Object>(); |
| | | jumpLink.put("orderNo", order.getOrderNo()); |
| | | jumpLink.put("goodsType", order.getSourceType() + ""); |
| | | |
| | | Map<String, Object> jump = new HashMap<String, Object>(); |
| | | jump.put("type", 1); // 页面跳转 |
| | | jump.put("params", jumpLink); |
| | | jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("freeCouponDetail")); |
| | | |
| | | Map<String, Object> rewardMap = new HashMap<String, Object>(); |
| | | rewardMap.put("text", rewardStyleVO); |
| | | rewardMap.put("jump", jump); |
| | | order.setRewardDetail(rewardMap); |
| | | } |
| | | |
| | | // 已使用奖励券 |
| | | if (rewardSuccess) { |
| | | ClientTextStyleVO rewardStyleVO = new ClientTextStyleVO(); |
| | | rewardStyleVO.setColor("#E5005C"); |
| | | rewardStyleVO.setBottomColor("#FFDCEA"); |
| | | rewardStyleVO.setContent("已使用奖励券 >"); |
| | | |
| | | Map<String, Object> rewardMap = new HashMap<String, Object>(); |
| | | rewardMap.put("text", rewardStyleVO); |
| | | Map<String, Object> jumpLink = new HashMap<String, Object>(); |
| | | jumpLink.put("orderNo", order.getOrderNo()); |
| | | jumpLink.put("goodsType", order.getSourceType() + ""); |
| | | |
| | | Map<String, Object> jump = new HashMap<String, Object>(); |
| | | jump.put("type", 1); // 1 常规跳转页面 |
| | | jump.put("params", jumpLink); |
| | | jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("rewardCouponDetail")); |
| | | rewardMap.put("jump", jump); |
| | | order.setRewardDetail(rewardMap); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.yeshi.fanli.service.impl.order;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.order.HongBaoOrderMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.order.HongBaoOrder;
|
| | | import com.yeshi.fanli.service.inter.order.HongBaoOrderService;
|
| | | import com.yeshi.fanli.vo.order.HongBaoCountVO;
|
| | |
|
| | | @Service
|
| | | public class HongBaoOrderServiceImpl implements HongBaoOrderService {
|
| | |
| | | return hongBaoOrderMapper.listDetailByOrderIdAndSourceType(orderId, sourceType);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public List<HongBaoOrder> listDetailByOrderIdAndSourceTypeAndUid(String orderId, int sourceType, Long uid) {
|
| | | return hongBaoOrderMapper.listDetailByOrderIdAndSourceTypeAndUid(orderId, sourceType,uid);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public HongBaoCountVO getHongBaoCountVO(List<HongBaoOrder> list) {
|
| | | HongBaoCountVO countVO = new HongBaoCountVO();
|
| | | if (list == null || list.size() == 0) {
|
| | | countVO.setTotalMoney(new BigDecimal(0));
|
| | | countVO.setValidMoney(new BigDecimal(0));
|
| | | countVO.setCurrentState(HongBaoV2.STATE_SHIXIAO);
|
| | | } else {
|
| | | int type = 0;
|
| | | int invalid = 0;
|
| | | int arrivalAccount = 0;
|
| | | BigDecimal totalMoney = new BigDecimal(0);
|
| | | BigDecimal validMoney = new BigDecimal(0);
|
| | | Date accountTime = null;
|
| | | for (HongBaoOrder hongBaoOrder: list) {
|
| | | HongBaoV2 hongBao = hongBaoOrder.getHongBaoV2();
|
| | | totalMoney = totalMoney.add(hongBao.getMoney());
|
| | | |
| | | Integer state = hongBao.getState();
|
| | | if (state != HongBaoV2.STATE_SHIXIAO) {
|
| | | validMoney = validMoney.add(hongBao.getMoney());
|
| | | }
|
| | | if (state == HongBaoV2.STATE_SHIXIAO) {
|
| | | invalid ++;
|
| | | } else if (state == HongBaoV2.STATE_YILINGQU) {
|
| | | arrivalAccount ++;
|
| | | }
|
| | | |
| | | // 到账时间
|
| | | Date getTime = hongBao.getGetTime();
|
| | | if (getTime != null && (accountTime == null || accountTime.getTime() < getTime.getTime())) {
|
| | | accountTime = getTime;
|
| | | }
|
| | | |
| | | if (type == 0) {
|
| | | type = hongBao.getType();
|
| | | }
|
| | | }
|
| | | countVO.setTotalMoney(totalMoney);
|
| | | countVO.setValidMoney(validMoney);
|
| | | countVO.setCurrentState(HongBaoV2.STATE_SHIXIAO);
|
| | | |
| | | if (invalid == list.size()) {
|
| | | countVO.setCurrentState(HongBaoV2.STATE_SHIXIAO);
|
| | | } else if (arrivalAccount > 0) {
|
| | | countVO.setCurrentState(HongBaoV2.STATE_YILINGQU);
|
| | | } else {
|
| | | countVO.setCurrentState(HongBaoV2.STATE_BUKELINGQU);
|
| | | }
|
| | | }
|
| | | return countVO;
|
| | | }
|
| | | |
| | | |
| | | }
|
| | |
| | |
|
| | | @Override
|
| | | public BigDecimal sumRecievedMoneyByUid(long uid, Integer level) {
|
| | | return inviteOrderSubsidyMapper.sumRecievedMoneyByUid(uid, level);
|
| | | BigDecimal money = inviteOrderSubsidyMapper.sumRecievedMoneyByUid(uid, level);
|
| | | if (money == null) {
|
| | | money = new BigDecimal(0);
|
| | | }
|
| | | return money;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public BigDecimal sumValidMoneyByUidAndDate(long uid, Integer day, Integer level) {
|
| | | return inviteOrderSubsidyMapper.sumValidMoneyByUidAndDate(uid, day, level);
|
| | | BigDecimal money = inviteOrderSubsidyMapper.sumValidMoneyByUidAndDate(uid, day, level);
|
| | | if (money == null) {
|
| | | money = new BigDecimal(0);
|
| | | }
|
| | | return money;
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public BigDecimal sumMoneyByUidAndDateAndState(long uid, Integer day, Integer level, Integer state) {
|
| | | BigDecimal money = inviteOrderSubsidyMapper.sumMoneyByUidAndDateAndState(uid, day, level, state);
|
| | | if (money == null) {
|
| | | money = new BigDecimal(0);
|
| | | }
|
| | | return money;
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
| | | * BigDecimal 返回类型
|
| | | * @throws
|
| | | */
|
| | | private BigDecimal getTeamSubsidyRate(Date date, UserLevelEnum buyerUserLevel, UserLevelEnum userLevel,
|
| | | boolean first) {
|
| | | @Override
|
| | | public BigDecimal getTeamSubsidyRate(Date date, UserLevelEnum buyerUserLevel, UserLevelEnum userLevel,
|
| | | boolean direct) {
|
| | | String key = null;
|
| | | if (first)
|
| | | if (direct)
|
| | | key = String.format("team_subsidy_6_pre_%s_%s", buyerUserLevel.getLevel(), userLevel.getLevel());
|
| | | else
|
| | | key = String.format("team_subsidy_7_pre_%s_%s", buyerUserLevel.getLevel(), userLevel.getLevel());
|
| | |
| | | public void addMsgOrderDetail(MsgOrderDetail detail, boolean needNotify) throws MsgOrderDetailException {
|
| | | if (detail == null)
|
| | | throw new MsgOrderDetailException(1, "消息为空");
|
| | | if (detail.getOrderId() == null || detail.getType() == null || detail.getState() == null
|
| | | || detail.getUser() == null)
|
| | | if (detail.getOrderId() == null || detail.getType() == null || detail.getUser() == null)
|
| | | throw new MsgOrderDetailException(2, "消息不完整");
|
| | | // 锁住订单号
|
| | | Jedis jedis = jedisPool.getResource();
|
| | |
| | | package com.yeshi.fanli.service.impl.order.msg;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dto.push.PushContentDTO;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgExtra;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail.MsgTypeOrderTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.config.push.PushMsgFactory;
|
| | | import com.yeshi.fanli.exception.msg.MsgOrderDetailException;
|
| | | import com.yeshi.fanli.exception.push.PushException;
|
| | | import com.yeshi.fanli.service.inter.msg.MsgExtraService;
|
| | | import com.yeshi.fanli.service.inter.order.msg.MsgOrderDetailService;
|
| | | import com.yeshi.fanli.service.inter.order.msg.UserOrderMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.push.PushService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.factory.msg.MsgOrderDetailFactory;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVO;
|
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVOFactory;
|
| | |
|
| | | @Service
|
| | | public class UserOrderMsgNotificationServiceImpl implements UserOrderMsgNotificationService {
|
| | |
| | | @Resource
|
| | | private PushService pushService;
|
| | |
|
| | | @Resource
|
| | | private MsgExtraService msgExtraService;
|
| | | |
| | |
|
| | | @Override
|
| | | public void orderFanLiStatistic(Long uid, String orderId, int orderType, BigDecimal payMoney, BigDecimal money,
|
| | | int goodsCount, int orderState) {
|
| | | MsgOrderDetail detail = MsgOrderDetailFactory.createFanLiOrder(uid, orderId, orderType, goodsCount, orderState,
|
| | | payMoney, money, null);
|
| | | try {
|
| | | msgOrderDetailService.addMsgOrderDetail(detail,
|
| | | (payMoney == null || payMoney.compareTo(new BigDecimal(0)) <= 0) ? false : true);
|
| | | } catch (MsgOrderDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | int goodsCount, int orderState, Date downTime) {
|
| | | // 是否通知
|
| | | boolean needNotify = (payMoney != null && payMoney.compareTo(new BigDecimal(0)) > 0) ? true : false;
|
| | | // 保存消息明细消息
|
| | | addOrderStatistics(uid, orderId, orderType, Constant.TYPE_REBATE, goodsCount, payMoney, money, downTime, null, needNotify);
|
| | |
|
| | | if (payMoney != null && payMoney.compareTo(new BigDecimal(0)) > 0) {
|
| | | if (needNotify) {
|
| | | PushContentDTO dto = PushMsgFactory.createFanLiOrderStatisticed(orderType, orderId, money);
|
| | | try {
|
| | | pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null, null);
|
| | |
| | |
|
| | | @Override
|
| | | public void orderShareStatistic(Long uid, String orderId, int orderType, BigDecimal payMoney, BigDecimal money,
|
| | | int goodsCount, int orderState) {
|
| | | MsgOrderDetail detail = MsgOrderDetailFactory.createShareOrder(uid, orderId, orderType, goodsCount, orderState,
|
| | | payMoney, money, null);
|
| | | try {
|
| | | msgOrderDetailService.addMsgOrderDetail(detail,
|
| | | (payMoney == null || payMoney.compareTo(new BigDecimal(0)) <= 0) ? false : true);
|
| | | } catch (MsgOrderDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | int goodsCount, int orderState, Date downTime) {
|
| | | // 是否通知
|
| | | boolean needNotify = (payMoney != null && payMoney.compareTo(new BigDecimal(0)) > 0) ? true : false;
|
| | | // 保存消息明细消息
|
| | | addOrderStatistics(uid, orderId, orderType, Constant.TYPE_SHAER, goodsCount, payMoney, money, downTime, null, needNotify);
|
| | | |
| | |
|
| | | PushContentDTO dto = PushMsgFactory.createShareOrderStatisticed(orderType, orderId, money);
|
| | | try {
|
| | |
| | |
|
| | | @Override
|
| | | public void orderInviteStatistic(Long uid, String orderId, int orderType, BigDecimal payMoney, BigDecimal money,
|
| | | int goodsCount, int orderState) {
|
| | | MsgOrderDetail detail = MsgOrderDetailFactory.createInviteOrder(uid, orderId, orderType, goodsCount, orderState,
|
| | | payMoney, money, null);
|
| | | try {
|
| | | msgOrderDetailService.addMsgOrderDetail(detail,
|
| | | (money == null || money.compareTo(new BigDecimal(0)) <= 0) ? false : true);
|
| | | } catch (MsgOrderDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | int goodsCount, int orderState, Date downTime) {
|
| | | // 是否通知
|
| | | boolean needNotify = (payMoney != null && payMoney.compareTo(new BigDecimal(0)) > 0) ? true : false;
|
| | | // 保存消息明细消息
|
| | | addOrderStatistics(uid, orderId, orderType, Constant.TYPE_INVITE, goodsCount, payMoney, money, downTime, null, needNotify);
|
| | | |
| | |
|
| | | PushContentDTO dto = PushMsgFactory.createInviteOrderStatisticed(orderType, orderId, money);
|
| | | try {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void orderFoundSuccess(Long uid, String orderId, BigDecimal payMoney, int orderType, Date happendDate) {
|
| | | MsgOrderDetail detail = MsgOrderDetailFactory.createFoundOrder(uid, orderId, true, payMoney, orderType,
|
| | | happendDate, "如有疑问请联系人工客服");
|
| | | try {
|
| | | msgOrderDetailService.addMsgOrderDetail(detail, true);
|
| | | } catch (MsgOrderDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | public void orderFoundSuccess(Long uid, String orderId, int orderSource, int type, BigDecimal payMoney, BigDecimal money, int goodsCount, Date submitTime) {
|
| | | createOrderFoundSuccess(uid, orderId, orderSource, type, goodsCount, payMoney, money, submitTime, "");
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void orderFoundFail(Long uid, String orderId, BigDecimal payMoney, int orderType, Date happendDate) {
|
| | | MsgOrderDetail detail = MsgOrderDetailFactory.createFoundOrder(uid, orderId, false, payMoney, orderType,
|
| | | happendDate, "如有疑问请联系人工客服");
|
| | | try {
|
| | | msgOrderDetailService.addMsgOrderDetail(detail, true);
|
| | | } catch (MsgOrderDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | createOrderFoundFail(uid, orderId, null);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 创建订单被统计消息
|
| | | * @param uid
|
| | | * @param orderId 订单号
|
| | | * @param source 订单来源:淘宝、京东、天猫
|
| | | * @param type 订单类型:自购、分享、团队
|
| | | * @param goodsCount 商品数量
|
| | | * @param payMoney 付款金额
|
| | | * @param money 返利金额
|
| | | * @param downTime 下单时间
|
| | | * @param beiZhu 备注信息 - 非必填
|
| | | * @return
|
| | | */
|
| | | @Transactional
|
| | | private void addOrderStatistics(Long uid, String orderId, int source, int type, int goodsCount,
|
| | | BigDecimal payMoney, BigDecimal money, Date downTime, String beiZhu, boolean needNotify) {
|
| | | try {
|
| | | MsgOrderDetail detail = MsgOrderDetailFactory.createOrderStatistics(uid, orderId, source, type, goodsCount, payMoney, money, downTime, beiZhu);
|
| | | // 消息
|
| | | msgOrderDetailService.addMsgOrderDetail(detail, needNotify);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(),detail.getExtraInfo(), MsgExtra.MSG_TYPE_ORDER);
|
| | | } catch (MsgOrderDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 订单找回成功
|
| | | * @param uid
|
| | | * @param orderId 订单号
|
| | | * @param source 订单来源:淘宝、京东、天猫
|
| | | * @param type 订单类型:自购、分享、团队
|
| | | * @param goodsCount 商品数量
|
| | | * @param payMoney 付款金额
|
| | | * @param money 返利金额
|
| | | * @param submitTime 提交时间
|
| | | * @param beiZhu 备注信息 - 非必填
|
| | | * @return
|
| | | */
|
| | | private void createOrderFoundSuccess(Long uid, String orderId, int source, int type, int goodsCount,
|
| | | BigDecimal payMoney, BigDecimal money, Date submitTime, String beiZhu) {
|
| | | try {
|
| | | MsgOrderDetail detail = MsgOrderDetailFactory.createOrderFoundSuccess(uid, orderId, source, type, goodsCount, payMoney, money, submitTime, beiZhu);
|
| | | // 消息
|
| | | msgOrderDetailService.addMsgOrderDetail(detail, true);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_ORDER);
|
| | | } catch (MsgOrderDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 订单找回失败
|
| | | * @param uid
|
| | | * @param orderId
|
| | | * @param beiZhu
|
| | | * @return
|
| | | */
|
| | | private void createOrderFoundFail(Long uid, String orderId, String beiZhu) {
|
| | | try {
|
| | | MsgOrderDetail detail = MsgOrderDetailFactory.createOrderFoundFail(uid, orderId, beiZhu);
|
| | | // 消息
|
| | | msgOrderDetailService.addMsgOrderDetail(detail, true);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_ORDER);
|
| | | } catch (MsgOrderDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | |
| | | return redPackWinInviteMapper.countTeamNumByTid(uid, teamUid);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public List<RedPackWinInvite> query(long page, int count, String key, String type){
|
| | | return redPackWinInviteMapper.query(count * (page - 1), count, key, type);
|
| | | }
|
| | | |
| | | @Override
|
| | | public long count(String key, String type){
|
| | | Long count = redPackWinInviteMapper.count(key, type);
|
| | | if (count == null) {
|
| | | count = 0L;
|
| | | }
|
| | | return count;
|
| | | }
|
| | | }
|
| | |
| | | import com.yeshi.fanli.service.inter.user.UserInviteRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserRankService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.msg.UserAccountMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.user.notify.UserActivedRecordService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.FilePathEnum;
|
| | |
| | | @Resource
|
| | | @Lazy
|
| | | private UserActivedRecordService userActivedRecordService;
|
| | | |
| | | @Resource
|
| | | private UserAccountMsgNotificationService userAccountMsgNotificationService;
|
| | |
|
| | | @Resource(name = "producer")
|
| | | private Producer producer;
|
| | |
| | | new Date())));
|
| | | producer.send(message);
|
| | | }
|
| | | |
| | | // 消息
|
| | | userAccountMsgNotificationService.createChangeInviteCode(uid, extra.getInviteCode(), inviteCodeVip);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public UserInfoRegister selectByPrimaryKey(Long uid) {
|
| | | return userInfoRegisterMapper.selectByPrimaryKey(uid);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public List<UserInfoRegister> listByMultipleUids(List<Long> list) {
|
| | |
| | |
|
| | | UserSystemCouponUseMQMsg mqMsg = new UserSystemCouponUseMQMsg(userSystemCoupon.getId(), order.getOrderId(),
|
| | | sourceType, systemCoupon.getType().name());
|
| | | // 事务消息
|
| | | |
| | | if (Constant.IS_TEST) {
|
| | | useRewardCouponCore(userSystemCoupon, money, hongBao, uid, order);
|
| | | } else { // 事务消息
|
| | | Message msg = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.useSystemCoupon, mqMsg);
|
| | | try {
|
| | | SendResult result = orderTransactionProducer.send(msg, new LocalTransactionExecuter() {
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void useRewardCouponCore(UserSystemCoupon userSystemCoupon, BigDecimal money, BigDecimal hongBao, Long uid,
|
| | |
| | | if (task == null)
|
| | | throw new IntegralGetException(1, "事件类型不存在");
|
| | |
|
| | | if (TaskUniqueKeyEnum.inShop == TaskUniqueKeyEnum.valueOf(event)) {
|
| | | UserInfo boss = getBossByUid(uid);
|
| | | if (boss != null)
|
| | | addInShopLevelOne(boss.getId()); // 下级浏览店铺
|
| | | }
|
| | | // if (TaskUniqueKeyEnum.inShop == TaskUniqueKeyEnum.valueOf(event)) {
|
| | | // UserInfo boss = getBossByUid(uid);
|
| | | // if (boss != null)
|
| | | // addInShopLevelOne(boss.getId()); // 下级浏览店铺
|
| | | // }
|
| | |
|
| | | if (task.getFrequency() == FrequencyEnum.everyday) {
|
| | | int count = integralTaskRecordService.countGetCountByTaskIdAndDay(task.getId(), uid, nowDate);
|
| | |
| | | @Override
|
| | | public void addInviteLevelOne(Long uid, Long workerId) {
|
| | | try {
|
| | | UserInfo boss = getBossByUid(uid);
|
| | | if (boss != null)
|
| | | addInviteLevelTwo(boss.getId());
|
| | | // UserInfo boss = getBossByUid(uid);
|
| | | // if (boss != null)
|
| | | // addInviteLevelTwo(boss.getId());
|
| | |
|
| | | addEventStatistic(uid, TaskUniqueKeyEnum.inviteLevelOne.name());
|
| | | //addEventStatistic(uid, TaskUniqueKeyEnum.inviteLevelOne.name());
|
| | | } catch (Exception e) {
|
| | | // LogHelper.errorDetailInfo(e);
|
| | | }
|
| | |
| | | @Override
|
| | | public void addCouponRebate(Long uid) {
|
| | | try {
|
| | | UserInfo boss = getBossByUid(uid);
|
| | | if (boss != null)
|
| | | addCouponRebateLevelOne(boss.getId());
|
| | | // UserInfo boss = getBossByUid(uid);
|
| | | // if (boss != null)
|
| | | // addCouponRebateLevelOne(boss.getId());
|
| | |
|
| | | addEventStatistic(uid, TaskUniqueKeyEnum.couponRebate.name());
|
| | | } catch (Exception e) {
|
| | |
| | | *
|
| | | * @param uid
|
| | | */
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @RequestSerializableByKeyService(key = "#uid")
|
| | | //@IntegralGetVersionLimit(uid = "#uid")
|
| | | //@RequestSerializableByKeyService(key = "#uid")
|
| | | @Async()
|
| | | @Transactional
|
| | | @Override
|
| | | public void addInviteOrderLevelOne(Long uid, String orderNo, int sourceType) {
|
| | | try {
|
| | | IntegralTaskRecord record = addEventStatistic(uid, TaskUniqueKeyEnum.inviteOrderLevelOne.name());
|
| | | if (record != null) {
|
| | | userGetIntegralFromOrderRecordService.addRecord(
|
| | | UserGetIntegralFromOrderRecordFactory.create(UserGetIntegralFromOrderRecord.TYPE_RECIEVE_MONEY,
|
| | | uid, orderNo, sourceType, record.getGoldCoin()));
|
| | | }
|
| | | // IntegralTaskRecord record = addEventStatistic(uid, TaskUniqueKeyEnum.inviteOrderLevelOne.name());
|
| | | // if (record != null) {
|
| | | // userGetIntegralFromOrderRecordService.addRecord(
|
| | | // UserGetIntegralFromOrderRecordFactory.create(UserGetIntegralFromOrderRecord.TYPE_RECIEVE_MONEY,
|
| | | // uid, orderNo, sourceType, record.getGoldCoin()));
|
| | | // }
|
| | |
|
| | | } catch (Exception e) {
|
| | | // LogHelper.errorDetailInfo(e);
|
| | |
| | | *
|
| | | * @param uid
|
| | | */
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @RequestSerializableByKeyService(key = "#uid")
|
| | | //@IntegralGetVersionLimit(uid = "#uid")
|
| | | //@RequestSerializableByKeyService(key = "#uid")
|
| | | @Async()
|
| | | @Transactional
|
| | | @Override
|
| | | public void addInviteOrderLevelTwo(Long uid, String orderNo, int sourceType) {
|
| | | try {
|
| | | IntegralTaskRecord record = addEventStatistic(uid, TaskUniqueKeyEnum.inviteOrderLevelTwo.name());
|
| | | if (record != null) {
|
| | | userGetIntegralFromOrderRecordService.addRecord(
|
| | | UserGetIntegralFromOrderRecordFactory.create(UserGetIntegralFromOrderRecord.TYPE_RECIEVE_MONEY,
|
| | | uid, orderNo, sourceType, record.getGoldCoin()));
|
| | | }
|
| | | // IntegralTaskRecord record = addEventStatistic(uid, TaskUniqueKeyEnum.inviteOrderLevelTwo.name());
|
| | | // if (record != null) {
|
| | | // userGetIntegralFromOrderRecordService.addRecord(
|
| | | // UserGetIntegralFromOrderRecordFactory.create(UserGetIntegralFromOrderRecord.TYPE_RECIEVE_MONEY,
|
| | | // uid, orderNo, sourceType, record.getGoldCoin()));
|
| | | // }
|
| | |
|
| | | } catch (Exception e) {
|
| | | // LogHelper.errorDetailInfo(e);
|
| | |
| | |
|
| | | int limitDays = Integer.parseInt(userVipConfigService.getValueByKey("invite_separate_limit_days"));
|
| | |
|
| | | // 消息 TODO
|
| | | // 消息
|
| | | UserInfo userInfo = userInfoService.selectByPKey(workerId);
|
| | | MsgOtherVIPDTO msgboss = new MsgOtherVIPDTO();
|
| | | msgboss.setContent1(userInfo.getNickName() + workerId + "于"+ TimeUtil.formatDateDot(record.getCreateTime()) + "成功升级成为会员 ");
|
| | |
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgExtra;
|
| | | import com.yeshi.fanli.exception.msg.MsgAccountDetailException;
|
| | | import com.yeshi.fanli.service.inter.msg.MsgExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.msg.MsgAccountDetailService;
|
| | | import com.yeshi.fanli.service.inter.user.msg.UserAccountMsgNotificationService;
|
| | | import com.yeshi.fanli.util.factory.msg.MsgAccountDetailFactory;
|
| | |
| | | @Resource
|
| | | private MsgAccountDetailService msgAccountDetailService;
|
| | |
|
| | | @Resource
|
| | | private MsgExtraService msgExtraService;
|
| | |
|
| | | @Override
|
| | | public void bindingSuccess(Long uid, int type) {
|
| | | MsgAccountDetail detail = MsgAccountDetailFactory.createBindingAccount(uid, type);
|
| | | MsgAccountDetail detail = MsgAccountDetailFactory.createBindSuccess(uid, type, MsgAccountDetailFactory.WAY_BIND);
|
| | | try {
|
| | | msgAccountDetailService.addMsgAccountDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_ACCOUNT);
|
| | | } catch (MsgAccountDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | |
|
| | | @Override
|
| | | public void unBindingSuccess(Long uid, int type) {
|
| | | MsgAccountDetail detail = MsgAccountDetailFactory.createUnBindingAccount(uid, type);
|
| | | MsgAccountDetail detail = MsgAccountDetailFactory.createBindSuccess(uid, type, MsgAccountDetailFactory.WAY_UNBIND);
|
| | | try {
|
| | | msgAccountDetailService.addMsgAccountDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_ACCOUNT);
|
| | | } catch (MsgAccountDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | |
|
| | | @Override
|
| | | public void changeBindingSuccess(Long uid, int type) {
|
| | | MsgAccountDetail detail = MsgAccountDetailFactory.createChangeBindingAccount(uid, type);
|
| | | MsgAccountDetail detail = MsgAccountDetailFactory.createBindSuccess(uid, type, MsgAccountDetailFactory.WAY_CHANGE);
|
| | | try {
|
| | | msgAccountDetailService.addMsgAccountDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_ACCOUNT);
|
| | | } catch (MsgAccountDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | |
|
| | | @Override
|
| | | public void taoBaoAuthFail(Long uid, String taoBaoNickName, String reason) {
|
| | | MsgAccountDetail detail = MsgAccountDetailFactory.createTaoBaoAuthFail(uid, taoBaoNickName, reason);
|
| | | MsgAccountDetail detail = MsgAccountDetailFactory.createBindFail(uid, MsgAccountDetailFactory.TYPE_TB, |
| | | MsgAccountDetailFactory.WAY_CHANGE, reason);
|
| | | try {
|
| | | msgAccountDetailService.addMsgAccountDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_ACCOUNT);
|
| | | } catch (MsgAccountDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void createChangeInviteCode(Long uid, String oldCode, String newCode) {
|
| | | MsgAccountDetail detail = MsgAccountDetailFactory.createChangeInviteCode(uid, oldCode, newCode);
|
| | | try {
|
| | | msgAccountDetailService.addMsgAccountDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_ACCOUNT);
|
| | | } catch (MsgAccountDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public void vipPreUpgrade(Long uid, String originalName, String upName, int days, long targetNum1, Long targetNum2,Integer type) {
|
| | | MsgAccountDetail detail = MsgAccountDetailFactory.vipPreUpgrade(uid, originalName, upName, days, targetNum1,
|
| | | targetNum2, type, null);
|
| | | try {
|
| | | msgAccountDetailService.addMsgAccountDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_ACCOUNT);
|
| | | } catch (MsgAccountDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | @Override
|
| | | public void vipUpgradeSuccess(Long uid, int days) {
|
| | | MsgAccountDetail detail = MsgAccountDetailFactory.vipUpgradeSuccess(uid, days);
|
| | | try {
|
| | | msgAccountDetailService.addMsgAccountDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_ACCOUNT);
|
| | | } catch (MsgAccountDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void vipUpgradeFail(Long uid, String reason) {
|
| | | MsgAccountDetail detail = MsgAccountDetailFactory.vipUpgradeFail(uid, reason);
|
| | | try {
|
| | | msgAccountDetailService.addMsgAccountDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_ACCOUNT);
|
| | | } catch (MsgAccountDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | @Override
|
| | | public void teacherInvite(Long uid, String nickname,String kefuName, String kefuWX) {
|
| | | MsgAccountDetail detail = MsgAccountDetailFactory.teacherInvite(uid, nickname, kefuName, kefuWX);
|
| | | try {
|
| | | msgAccountDetailService.addMsgAccountDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_ACCOUNT);
|
| | | } catch (MsgAccountDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | @Override
|
| | | public void teacherSuccess(Long uid, int days, String kefuName, String kefuWX) {
|
| | | MsgAccountDetail detail = MsgAccountDetailFactory.teacherSuccess(uid, days, kefuName, kefuWX);
|
| | | try {
|
| | | msgAccountDetailService.addMsgAccountDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_ACCOUNT);
|
| | | } catch (MsgAccountDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | import org.springframework.context.annotation.Lazy;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.yeshi.utils.DateUtil;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.user.vip.UserVIPInfoMapper;
|
| | | import com.yeshi.fanli.dto.msg.MsgAccountVipDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherSystemGiveDTO;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail.MsgTypeAccountTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail.MsgTypeOtherTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInviteValidNum;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserVIPInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserVIPPreInfo;
|
| | | import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
|
| | | import com.yeshi.fanli.exception.msg.MsgAccountDetailException;
|
| | | import com.yeshi.fanli.exception.user.vip.UserVIPInfoException;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.integral.IntegralDetailService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.invite.UserInviteValidNumService;
|
| | | import com.yeshi.fanli.service.inter.user.msg.MsgAccountDetailService;
|
| | | import com.yeshi.fanli.service.inter.user.msg.UserAccountMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPPreInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVipConfigService;
|
| | |
| | | private UserVIPPreInfoService userVIPPreInfoService;
|
| | |
|
| | | @Resource
|
| | | private MsgAccountDetailService msgAccountDetailService;
|
| | | private UserAccountMsgNotificationService userAccountMsgNotificationService;
|
| | |
|
| | | @Resource
|
| | | private UserInviteValidNumService userInviteValidNumService;
|
| | |
| | | if (userInfo == null) {
|
| | | userInfo = new UserVIPInfo();
|
| | | userInfo.setId(uid);
|
| | | // 添加记录
|
| | | addUserVIPInfo(userInfo);
|
| | | }
|
| | |
|
| | | if (userInfo.getState() != UserVIPInfo.STATE_INVALID)
|
| | | throw new UserVIPInfoException(2, "已经申请过");
|
| | | throw new UserVIPInfoException(2, "系统已收到你的超级会员升级申请,将会尽快完成审核");
|
| | |
|
| | | UserVIPInfo info = new UserVIPInfo();
|
| | | info.setId(userInfo.getId());
|
| | |
| | | info.setState(UserVIPInfo.STATE_VERIFING);
|
| | | info.setUpdateTime(new Date());
|
| | | userVIPInfoMapper.updateByPrimaryKeySelective(info);
|
| | |
|
| | | MsgAccountDetail detail = new MsgAccountDetail();
|
| | | detail.setTitle("尊敬的高级会员,系统已收到你的超级会员升级申请,正在受理中");
|
| | | detail.setBeiZhu("如有疑问请联系我的-人工客服");
|
| | | detail.setRead(false);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setContent("我们将会在48小时内完成审核");
|
| | | detail.setType(MsgTypeAccountTypeEnum.vipApply);
|
| | | try {
|
| | | msgAccountDetailService.addMsgAccountDetail(detail);
|
| | | } catch (MsgAccountDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | |
| | | throw new UserVIPInfoException(1, "券赠送失败");
|
| | | }
|
| | |
|
| | | // 消息
|
| | | MsgAccountVipDTO msgDto = new MsgAccountVipDTO();
|
| | | msgDto.setStatus("已将你的账户由高级会员升级为超级会员");
|
| | | msgDto.setEquity("从收到本消息起,你将获得全部超级会员权益");
|
| | | msgAccountDetailService.addMsgVIP(uid, "恭喜你!经人工审核你满足升级超级会员条件", "如有疑问请联系我的-人工客服", msgDto);
|
| | | // 升级消息
|
| | | try {
|
| | | UserVIPPreInfo pre1 = userVIPPreInfoService.getVipByProcess(uid, UserVIPPreInfo.PROCESS_2);
|
| | | int days = DateUtil.daysBetween(pre1.getCreateTime(), new Date());
|
| | | userAccountMsgNotificationService.vipUpgradeSuccess(uid, days);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | userVIPInfoMapper.updateByPrimaryKeySelective(info);
|
| | |
|
| | | // 消息
|
| | | MsgAccountVipDTO msgDto = new MsgAccountVipDTO();
|
| | | msgDto.setStatus("你的账号仍是高级会员");
|
| | | msgDto.setReason(reason);
|
| | | msgAccountDetailService.addMsgVIP(uid, "很抱歉!经人工审核你未满足或不符合升级超级会员的条件", "如有疑问请联系我的-人工客服", msgDto);
|
| | | userAccountMsgNotificationService.vipUpgradeFail(uid, reason);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import org.springframework.context.annotation.Lazy;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.yeshi.utils.DateUtil;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.user.vip.UserVIPPreInfoMapper;
|
| | | import com.yeshi.fanli.dto.msg.MsgAccountVipDTO;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail.MsgTypeOtherTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoRegister;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInviteValidNum;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserVIPPreInfo;
|
| | |
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | | import com.yeshi.fanli.service.inter.msg.UserOtherMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoRegisterService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInviteSeparateService;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
|
| | | import com.yeshi.fanli.service.inter.user.integral.IntegralDetailService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.invite.UserInviteValidNumService;
|
| | | import com.yeshi.fanli.service.inter.user.msg.MsgAccountDetailService;
|
| | | import com.yeshi.fanli.service.inter.user.msg.UserAccountMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPPreInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVipConfigService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
| | |
|
| | | @Resource
|
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | |
|
| | | @Resource
|
| | | private MsgAccountDetailService msgAccountDetailService;
|
| | |
|
| | | @Resource
|
| | | private UserVipConfigService userVipConfigService;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserOtherMsgNotificationService userOtherMsgNotificationService;
|
| | | |
| | | @Resource
|
| | | private UserAccountMsgNotificationService userAccountMsgNotificationService;
|
| | | |
| | | @Resource
|
| | | private UserInfoRegisterService userInfoRegisterService;
|
| | |
|
| | |
|
| | | @Override
|
| | |
| | | * @param secondTeam
|
| | | */
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | private boolean oneProcess(Long uid, long countZiGou, long countShare, long firstTeam, long secondTeam) {
|
| | | private boolean oneProcess(Long uid, long countZiGou, long countShare, long firstTeam, long secondTeam) throws Exception{
|
| | | UserVIPPreInfo oldInfo = userVIPPreInfoMapper.selectByUidAndProcess(uid, UserVIPPreInfo.PROCESS_1);
|
| | | if (oldInfo != null) {
|
| | | return true;
|
| | | }
|
| | | |
| | | boolean process = false;
|
| | | String msg = "";
|
| | |
|
| | | long limitZiGou = 0;
|
| | | String zigou = userVipConfigService.getValueByKey("vip_pre_3_zigou_order_count");
|
| | |
| | | limitSecond = Long.parseLong(second);
|
| | | }
|
| | |
|
| | | Integer type = null;
|
| | | long targetNum1 = 0L;
|
| | | Long targetNum2 = 0L;
|
| | | boolean process = false;
|
| | | if (countZiGou >= limitZiGou) {
|
| | | process = true;
|
| | | msg = "恭喜你!返利订单达到 " + limitZiGou + "笔";
|
| | | type = Constant.TYPE_REBATE;
|
| | | targetNum1 = limitZiGou;
|
| | | } else if (countShare >= limitShare) {
|
| | | process = true;
|
| | | msg = "恭喜你!分享订单达到 " + limitShare + "笔";
|
| | | type = Constant.TYPE_SHAER;
|
| | | targetNum1 = limitShare;
|
| | | } else if (firstTeam >= limitFirst && secondTeam >= limitSecond) {
|
| | | process = true;
|
| | | msg = "直接粉丝达到" + limitFirst + "人,间接粉丝达到 " + limitSecond + "人";
|
| | | targetNum1 = limitFirst;
|
| | | targetNum2 = limitSecond;
|
| | | }
|
| | |
|
| | | if (process) {
|
| | |
| | | info.setUpdateTime(new Date());
|
| | | addUserVIPPreInfo(info);
|
| | |
|
| | | // 消息
|
| | | MsgAccountVipDTO msgDto = new MsgAccountVipDTO();
|
| | | msgDto.setStatus("系统已将你的账户由快省达人升级为普通会员");
|
| | | msgDto.setEquity("从收到本消息起,你将获得全部普通会员权益");
|
| | | msgAccountDetailService.addMsgVIP(uid, msg, "如有疑问请联系我的-人工客服", msgDto);
|
| | | |
| | | // 升级消息
|
| | | Date registerTime = new Date(1577836800000L);
|
| | | UserInfoRegister userInfoRegister = userInfoRegisterService.selectByPrimaryKey(uid);
|
| | | if (userInfoRegister != null && userInfoRegister.getCreateTime() != null) {
|
| | | registerTime = userInfoRegister.getCreateTime();
|
| | | }
|
| | | int daysBetween = DateUtil.daysBetween(registerTime, new Date());
|
| | | userAccountMsgNotificationService.vipPreUpgrade(uid, "快省达人", "普通会员", daysBetween, targetNum1, targetNum2, type);
|
| | |
|
| | | // 赠送金币
|
| | | String goldcoin = userVipConfigService.getValueByKey("vip_pre_3_gift_goldcoin");
|
| | |
| | | */
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | private boolean twoProcess(Long uid, long countZiGou, long countShare, long firstTeam, long secondTeam) {
|
| | | boolean process = false;
|
| | | String msg = "";
|
| | | |
| | | long limitZiGou = 10;
|
| | | // String zigou = userVipConfigService.getValueByKey("vip_pre_7_zigou_order_count");
|
| | | // if (!StringUtil.isNullOrEmpty(zigou)) {
|
| | | // limitZiGou = Long.parseLong(zigou);
|
| | | // }
|
| | | long limitZiGou = 0;
|
| | | String zigou = userVipConfigService.getValueByKey("vip_pre_7_zigou_order_count");
|
| | | if (!StringUtil.isNullOrEmpty(zigou)) {
|
| | | limitZiGou = Long.parseLong(zigou);
|
| | | }
|
| | |
|
| | | long limitShare = 0;
|
| | | String share = userVipConfigService.getValueByKey("vip_pre_7_share_order_count");
|
| | |
| | | limitSecond = Long.parseLong(second);
|
| | | }
|
| | |
|
| | | Integer type = null;
|
| | | long targetNum1 = 0L;
|
| | | Long targetNum2 = 0L;
|
| | | boolean process = false;
|
| | | if (countZiGou >= limitZiGou) {
|
| | | process = true;
|
| | | msg = "恭喜你!返利订单达到 " + limitZiGou + "笔";
|
| | | targetNum1 = limitZiGou;
|
| | | type = Constant.TYPE_REBATE;
|
| | | } else if (countShare >= limitShare) {
|
| | | process = true;
|
| | | msg = "恭喜你!分享订单达到 " + limitShare + "笔";
|
| | | targetNum1 = limitShare;
|
| | | type = Constant.TYPE_SHAER;
|
| | | } else if (firstTeam >= limitFirst && secondTeam >= limitSecond) {
|
| | | process = true;
|
| | | msg = "直接粉丝达到" + limitFirst + "人,间接粉丝达到 " + limitSecond + "人";
|
| | | targetNum1 = limitFirst;
|
| | | targetNum2 = limitSecond;
|
| | | }
|
| | |
|
| | | if (process) {
|
| | |
| | | info.setUpdateTime(new Date());
|
| | | addUserVIPPreInfo(info);
|
| | |
|
| | | // 消息
|
| | | MsgAccountVipDTO msgDto = new MsgAccountVipDTO();
|
| | | msgDto.setStatus("系统已将你的账户由普通会员升级为高级会员");
|
| | | msgDto.setEquity("从收到本消息起,你将获得全部高级会员权益");
|
| | | msgAccountDetailService.addMsgVIP(uid, msg, "如有疑问请联系我的-人工客服", msgDto);
|
| | | // 升级消息
|
| | | UserVIPPreInfo pre1 = userVIPPreInfoMapper.selectByUidAndProcess(uid, UserVIPPreInfo.PROCESS_1);
|
| | | int daysBetween = DateUtil.daysBetween(pre1.getCreateTime(), new Date());
|
| | | userAccountMsgNotificationService.vipPreUpgrade(uid, "普通会员", "高级会员", daysBetween, targetNum1, targetNum2, type);
|
| | |
|
| | | // 赠送奖励券
|
| | | String rewardCoupon = userVipConfigService.getValueByKey("vip_pre_7_gift_reward_coupon");
|
| | |
| | | * @return
|
| | | */
|
| | | public long countOrderByUidAndSettled(Long uid, Long time, BigDecimal payment); |
| | |
|
| | | public BigDecimal geBonusByuid(Long uid, Integer dateType, Integer hbType, Integer moneyState); |
| | |
|
| | | }
|
| | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.multipart.MultipartHttpServletRequest; |
| | | |
| | | import com.sun.istack.Nullable; |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail; |
| | | import com.yeshi.fanli.entity.bus.activity.ActivityUser; |
| | | import com.yeshi.fanli.entity.dynamic.CommentInfo; |
| | | import com.yeshi.fanli.entity.dynamic.DynamicInfo; |
| | | import com.yeshi.fanli.entity.dynamic.GoodsEvaluate; |
| | | import com.yeshi.fanli.entity.dynamic.ImgInfo; |
| | | import com.yeshi.fanli.entity.jd.JDGoods; |
| | |
| | | public long countValidMaterials(int type); |
| | | |
| | | |
| | | public void saveGoodsCoupon(String pid, String content) throws GoodsEvaluateException, Exception; |
| | | |
| | | |
| | | public void release(String id) throws GoodsEvaluateException; |
| | | |
| | | |
| | | |
| | | public void saveGoodsComment(String id, int kind, List<CommentInfo> comments) throws GoodsEvaluateException, Exception; |
| | |
| | | *
|
| | | * @param extract
|
| | | */
|
| | | public void extractSuccess(Extract extract);
|
| | | public void extractSuccess(Extract extract, String reason);
|
| | |
|
| | | /**
|
| | | * 支付宝账号验证
|
| | | *
|
| | | * @param history
|
| | | * @param limitDay 限制时间
|
| | | * @param change 是否为修改 true 修改 false 首次绑定
|
| | | */
|
| | | public void alipayAccountValid(AlipayAccountValidNormalHistory history);
|
| | | public void alipayAccountValid(AlipayAccountValidNormalHistory history, int limitDay, boolean change);
|
| | |
|
| | | /**
|
| | | * 付宝账号验证失败
|
| | | * @param history
|
| | | * @param limitDay
|
| | | * @param change
|
| | | */
|
| | | public void alipayAccountValidFail(AlipayAccountValidNormalHistory history, int limitDay, boolean change);
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 返利订单到账
|
| | |
| | | * @param balance
|
| | | */
|
| | | public void fanliOrderReceived(Long uid, String orderId, int orderType, int goodsCount, BigDecimal money,
|
| | | BigDecimal balance);
|
| | | BigDecimal balance, Date downTime);
|
| | |
|
| | | /**
|
| | | * 返利订单维权
|
| | |
| | | * @param uid
|
| | | * @param orderId
|
| | | * @param money
|
| | | * @param balance
|
| | | * @param fanliMoney 订单返利
|
| | | */
|
| | | public void fanliOrderWeiQuan(Long uid, String orderId, int orderType, BigDecimal money, BigDecimal balance);
|
| | | public void fanliOrderWeiQuan(Long uid, String orderId, int orderType, BigDecimal money, BigDecimal fanliMoney, int goodsCount, Date downTime);
|
| | |
|
| | | /**
|
| | | * 分享赚订单被统计
|
| | |
| | | * @param balance
|
| | | */
|
| | | public void shareOrderReceived(Long uid, int orderType, int orderCount, int goodsCount, BigDecimal money,
|
| | | BigDecimal balance);
|
| | | BigDecimal balance, String orderId, Date downTime);
|
| | |
|
| | | /**
|
| | | * 分享订单维权
|
| | |
| | | * @param uid
|
| | | * @param orderId
|
| | | * @param money
|
| | | * @param balance
|
| | | * @param fanliMoney
|
| | | */
|
| | |
|
| | | public void shareOrderWeiQuan(Long uid, String orderId, int orderType, BigDecimal money, BigDecimal balance);
|
| | | public void shareOrderWeiQuan(Long uid, String orderId, int orderType, BigDecimal money,BigDecimal fanliMoney, int goodsCount, Date downTime);
|
| | |
|
| | | /**
|
| | | * 邀请赚订单被统计
|
| | |
| | | */
|
| | | public void elmeFanli(Long uid, String orderId, BigDecimal money, BigDecimal balance);
|
| | |
|
| | | /**
|
| | | * 自动提现消息-微信
|
| | | * |
| | | * @param extractRecord
|
| | | * |
| | | * @param stateDesc
|
| | | * |
| | | * @param desc
|
| | | * |
| | | * @param beiZhu
|
| | | */
|
| | | public void extractAuto(ExtractWeiXinRecord extractRecord, String stateDesc, String desc, String beiZhu);
|
| | |
|
| | |
|
| | | /**
|
| | | * 补贴消息
|
| | |
| | | */
|
| | | public void teamRedPackRewardMsg(Long uid, MsgTypeMoneyTypeEnum type, BigDecimal money, String stateDesc,String content);
|
| | |
|
| | | |
| | | /**
|
| | | * 团队奖励消息
|
| | | * @Title: orderTeamReward
|
| | | * @Description: |
| | | * 团队收益消息
|
| | | * @param uid
|
| | | * @param date
|
| | | * @param from
|
| | | * @param money
|
| | | * @param balance |
| | | * void 返回类型
|
| | | * @throws
|
| | | * @param money 本次到账金额
|
| | | * @param balance 余额
|
| | | * @param receivedDate 结算月度
|
| | | */
|
| | | public void orderTeamReward(Long uid, Date date, String from, BigDecimal money, BigDecimal balance);
|
| | | public void teamReceive(Long uid, BigDecimal money, BigDecimal balance, Date receivedDate);
|
| | |
|
| | |
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.msg;
|
| | |
|
| | | /**
|
| | | * 消息
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public interface MsgExtraService {
|
| | |
|
| | | public void addMsgExtra(long rid, String content, String type);
|
| | | |
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.order.ESOrder; |
| | | import com.yeshi.fanli.entity.pdd.PDDOrder; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder; |
| | | import com.yeshi.fanli.exception.order.CommonOrderException; |
| | | import com.yeshi.fanli.vo.order.CommonOrderVO; |
| | | import com.yeshi.fanli.vo.order.OrderCountVO; |
| | |
| | | |
| | | public List<CommonOrder> getMinSettleTimeAndUid(); |
| | | |
| | | /** |
| | | * 新版红包信息2.1 |
| | | * @param acceptData |
| | | * @param page |
| | | * @param uid |
| | | * @param state |
| | | * @param type |
| | | * @param orderState |
| | | * @param orderNo |
| | | * @param startTime |
| | | * @param endTime |
| | | * @param dateType |
| | | * @param listSource |
| | | * @return |
| | | * @throws CommonOrderException |
| | | * @throws Exception |
| | | */ |
| | | public List<CommonOrderVO> getOrderList(AcceptData acceptData, Integer page, Long uid, Integer state, Integer type, |
| | | Integer orderState, String orderNo, String startTime, String endTime, Integer dateType, |
| | | List<Integer> listSource) throws CommonOrderException, Exception; |
| | | |
| | | long countOrderList(Long uid, Integer state, Integer type, Integer orderState, String orderNo, String startTime, |
| | | String endTime, Integer dateType, List<Integer> listSource) throws CommonOrderException; |
| | | |
| | | /** |
| | | * 维权金额计算 |
| | | * @param listWQ |
| | | * @param sourceType |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | public BigDecimal getWeiQuanMoney(List<TaoBaoWeiQuanOrder> listWQ, int sourceType, Long uid); |
| | | |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Param;
|
| | |
|
| | | import com.yeshi.fanli.entity.order.HongBaoOrder;
|
| | | import com.yeshi.fanli.vo.order.HongBaoCountVO;
|
| | |
|
| | | public interface HongBaoOrderService {
|
| | |
|
| | |
| | | public List<HongBaoOrder> listDetailByOrderIdAndSourceType(@Param("orderId") String orderId,
|
| | | @Param("sourceType") int sourceType);
|
| | |
|
| | | /**
|
| | | * 红包信息统计
|
| | | * @param list
|
| | | * @return
|
| | | */
|
| | | public HongBaoCountVO getHongBaoCountVO(List<HongBaoOrder> list);
|
| | |
|
| | | /**
|
| | | * 查询订单相关红包
|
| | | * @param orderId
|
| | | * @param sourceType
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public List<HongBaoOrder> listDetailByOrderIdAndSourceTypeAndUid(String orderId, int sourceType, Long uid);
|
| | |
|
| | | }
|
| | |
| | | * @return
|
| | | */
|
| | | public BigDecimal sumValidMoneyByUidAndDate(long uid, Integer day, Integer level);
|
| | |
|
| | | public BigDecimal sumMoneyByUidAndDateAndState(long uid, Integer day, Integer level, Integer state);
|
| | | }
|
| | |
| | | public BigDecimal computeSecondTeamReward(BigDecimal secondTeamSubsidy, Date placeOrderTime,
|
| | | UserLevelEnum userLevel);
|
| | |
|
| | | /**
|
| | | * 计算团队补贴
|
| | | * @param date 下单时间
|
| | | * @param buyerUserLevel 下单时 下单人当时等级
|
| | | * @param userLevel 下单时 上级人对应等级
|
| | | * @param direct 是否直接邀请关系
|
| | | * @return
|
| | | */
|
| | | public BigDecimal getTeamSubsidyRate(Date date, UserLevelEnum buyerUserLevel, UserLevelEnum userLevel, boolean direct);
|
| | |
|
| | | }
|
| | |
| | | */
|
| | |
|
| | | public void orderFanLiStatistic(Long uid, String orderId, int orderType, BigDecimal payMoney, BigDecimal money,
|
| | | int goodsCount, int orderState);
|
| | | int goodsCount, int orderState, Date downTime);
|
| | |
|
| | | /**
|
| | | * 返利订单状态改变
|
| | |
| | | * @param orderState
|
| | | */
|
| | | public void orderShareStatistic(Long uid, String orderId, int orderType, BigDecimal payMoney, BigDecimal money,
|
| | | int goodsCount, int orderState);
|
| | | int goodsCount, int orderState, Date downTime);
|
| | |
|
| | | /**
|
| | | * 分享订单状态改变
|
| | |
| | | * @param orderState
|
| | | */
|
| | | public void orderInviteStatistic(Long uid, String orderId, int orderType, BigDecimal payMoney, BigDecimal money,
|
| | | int goodsCount, int orderState);
|
| | | int goodsCount, int orderState, Date downTime);
|
| | |
|
| | | /**
|
| | | * 邀请订单状态改变
|
| | |
| | |
|
| | | /**
|
| | | * 订单找回成功
|
| | | * |
| | | * @param uid
|
| | | * @param orderId
|
| | | * @param payMoney
|
| | | * @param money
|
| | | * @param orderType
|
| | | * @param orderId 订单号
|
| | | * @param orderSource 订单来源:淘宝、京东、天猫
|
| | | * @param type 订单类型:自购、分享、团队
|
| | | * @param goodsCount 商品数量
|
| | | * @param payMoney 付款金额
|
| | | * @param money 返利金额
|
| | | * @param submitTime 提交时间
|
| | | * @param beiZhu 备注信息 - 非必填
|
| | | * @return
|
| | | */
|
| | | public void orderFoundSuccess(Long uid, String orderId, BigDecimal payMoney, int orderType, Date happendDate);
|
| | | public void orderFoundSuccess(Long uid, String orderId, int orderSource, int type, BigDecimal payMoney,
|
| | | BigDecimal money, int goodsCount, Date submitTime);
|
| | |
|
| | | /**
|
| | | * 订单找回失败
|
| | |
| | | * @return
|
| | | */
|
| | | public long countTeamNumByTid(Long uid, Long teamUid);
|
| | |
|
| | | /**
|
| | | * 查询邀请红包明细
|
| | | * @param page
|
| | | * @param count
|
| | | * @param key
|
| | | * @param status
|
| | | * @return
|
| | | */
|
| | | public List<RedPackWinInvite> query(long page, int count, String key, String type);
|
| | |
|
| | | public long count(String key, String type);
|
| | |
|
| | | }
|
| | |
| | |
|
| | | public List<UserInfoRegister> listByDay(String preDay);
|
| | |
|
| | | /**
|
| | | * 查询用户注册信息
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public UserInfoRegister selectByPrimaryKey(Long uid);
|
| | |
|
| | | }
|
| | |
| | | public UserInviteLevelEnum getUserInviteLevelNew(Long uid);
|
| | |
|
| | |
|
| | | /**
|
| | | * 判断是会员
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public boolean verifyVIP(Long uid);
|
| | |
|
| | |
|
| | |
| | | */
|
| | | public void taoBaoAuthFail(Long uid, String taoBaoNickName, String reason);
|
| | |
|
| | | /**
|
| | | * 普通会员、高级会员自动提升
|
| | | * @param uid
|
| | | * @param originalName
|
| | | * @param upName
|
| | | * @param days
|
| | | * @param targetNum1
|
| | | * @param targetNum2
|
| | | * @param type
|
| | | */
|
| | | public void vipPreUpgrade(Long uid, String originalName, String upName, int days, long targetNum1, Long targetNum2,
|
| | | Integer type);
|
| | |
|
| | | /**
|
| | | * 超级会员升级成功
|
| | | * @param uid
|
| | | * @param originalName
|
| | | * @param upName
|
| | | * @param days
|
| | | */
|
| | | public void vipUpgradeSuccess(Long uid, int days);
|
| | |
|
| | | /**
|
| | | * 超级会员升级失败
|
| | | * @param uid
|
| | | * @param reason
|
| | | */
|
| | | public void vipUpgradeFail(Long uid, String reason);
|
| | |
|
| | | /**
|
| | | * 资深导师--运营发出邀约
|
| | | * @param uid
|
| | | * @param nickname
|
| | | * @param kefuName
|
| | | * @param kefuWX
|
| | | */
|
| | | public void teacherInvite(Long uid, String nickname, String kefuName, String kefuWX);
|
| | |
|
| | | /**
|
| | | * 资深导师--开通后发出消息
|
| | | * @param uid
|
| | | * @param days
|
| | | * @param kefuName
|
| | | * @param kefuWX
|
| | | */
|
| | | public void teacherSuccess(Long uid, int days, String kefuName, String kefuWX);
|
| | |
|
| | | /**
|
| | | * 创建邀请码修改消息
|
| | | * @param uid
|
| | | * @param oldCode
|
| | | * @param newCode
|
| | | */
|
| | | public void createChangeInviteCode(Long uid, String oldCode, String newCode);
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.util.factory.msg;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail.MsgTypeAccountTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVO;
|
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVOFactory;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
| | | 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;// 解绑
|
| | | |
| | |
|
| | | /**
|
| | | * 账号绑定成功
|
| | | *
|
| | |
| | | * @param type
|
| | | * @return
|
| | | */
|
| | | public static MsgAccountDetail createBindingAccount(Long uid, int type) {
|
| | | String msg = "";
|
| | | if (type == TYPE_PHONE) {
|
| | | msg = "<highlight>恭喜你手机号绑定成功</highlight>";
|
| | | } else if (type == TYPE_TB) {
|
| | | msg = "<highlight>恭喜你淘宝绑定成功</highlight>";
|
| | | } else if (type == TYPE_WX) {
|
| | | msg = "<highlight>恭喜你微信绑定成功</highlight>";
|
| | | }
|
| | | if (StringUtil.isNullOrEmpty(msg))
|
| | | 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 = "手机号";
|
| | | } else if (type == TYPE_TB) {
|
| | | info = "淘宝账号";
|
| | | typeName = "淘宝账号";
|
| | | } else if (type == TYPE_WX) {
|
| | | info = "微信账号";
|
| | | typeName = "微信号";
|
| | | }
|
| | | |
| | | String way = "";
|
| | | if (changeWay == WAY_BIND) {
|
| | | way = "绑定成功";
|
| | | } else if (changeWay == WAY_CHANGE) {
|
| | | 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)));
|
| | | 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.setBeiZhu("无");
|
| | | detail.setContent(msg);
|
| | | detail.setTitle("绑定账号");
|
| | | detail.setType(MsgTypeAccountTypeEnum.bingding);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setRead(false);
|
| | | detail.setExtraInfo(new Gson().toJson(listMsg));
|
| | | return detail;
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 账号绑定失败
|
| | | * |
| | | * @param uid
|
| | | * @param type
|
| | | * @return
|
| | | */
|
| | | 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 = "手机号";
|
| | | } else if (type == TYPE_TB) {
|
| | | info = "淘宝账号";
|
| | | typeName = "淘宝账号";
|
| | | } else if (type == TYPE_WX) {
|
| | | info = "微信账号";
|
| | | typeName = "微信号";
|
| | | }
|
| | | |
| | | String way = "";
|
| | | if (changeWay == WAY_BIND) {
|
| | | way = "绑定失败";
|
| | | } else if (changeWay == WAY_CHANGE) {
|
| | | 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)));
|
| | | 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("无", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | |
| | | MsgAccountDetail detail = new MsgAccountDetail();
|
| | | detail.setTitle("绑定账号");
|
| | | detail.setType(MsgTypeAccountTypeEnum.bingding);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setRead(false);
|
| | | detail.setExtraInfo(new Gson().toJson(listMsg));
|
| | | return detail;
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 邀请码修改
|
| | | * @param uid
|
| | | * @param oldCode
|
| | | * @param newCode
|
| | | * @return
|
| | | */
|
| | | 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(newCode, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | 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),
|
| | | new ClientTextStyleVO("无", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | |
| | | MsgAccountDetail detail = new MsgAccountDetail();
|
| | | detail.setTitle("绑定账号");
|
| | | detail.setType(MsgTypeAccountTypeEnum.changeCode);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setRead(false);
|
| | | detail.setExtraInfo(new Gson().toJson(listMsg));
|
| | | return detail;
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 账号解绑成功
|
| | |
| | | return detail;
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 普通会员、高级会员自动提升
|
| | | * @param uid
|
| | | * @param originalName
|
| | | * @param upName
|
| | | * @param days
|
| | | * @param targetNum1
|
| | | * @param type
|
| | | * @param targetNum2
|
| | | * @param beizu
|
| | | * @return
|
| | | */
|
| | | public static MsgAccountDetail vipPreUpgrade(Long uid, String originalName, String upName, int days, long targetNum1, |
| | | Long targetNum2, Integer type, String beizu) {
|
| | | 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 (type == null) {
|
| | | contentList.add(new ClientTextStyleVO("直接粉丝已达", ClientTextStyleVO.COLOR_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("人", ClientTextStyleVO.COLOR_CONTENT));
|
| | | } else if (type == Constant.TYPE_REBATE) {
|
| | | contentList.add(new ClientTextStyleVO("返利订单已达", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO(targetNum1+"", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("笔", ClientTextStyleVO.COLOR_CONTENT));
|
| | | } else if (type == Constant.TYPE_SHAER) {
|
| | | contentList.add(new ClientTextStyleVO("分享订单已达", ClientTextStyleVO.COLOR_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));
|
| | | |
| | | 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(StringUtil.isNullOrEmpty(beizu)?"无":beizu, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | |
| | | MsgAccountDetail detail = new MsgAccountDetail();
|
| | | detail.setBeiZhu(beizu);
|
| | | 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 originalName
|
| | | * @param upName
|
| | | * @param days
|
| | | * @param targetNum1
|
| | | * @param type
|
| | | * @param targetNum2
|
| | | * @param beizu
|
| | | * @return
|
| | | */
|
| | | 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));
|
| | | |
| | | 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;
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 普通会员、高级会员自动提升
|
| | | * @param uid
|
| | | * @param originalName
|
| | | * @param upName
|
| | | * @param days
|
| | | * @param targetNum1
|
| | | * @param type
|
| | | * @param targetNum2
|
| | | * @param beizu
|
| | | * @return
|
| | | */
|
| | | 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("如有疑问请联系人工客服", 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 nickname
|
| | | * @param kefuName
|
| | | * @param kefuWX
|
| | | * @return
|
| | | */
|
| | | 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)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("专属客服", ClientTextStyleVO.COLOR_TITLE),
|
| | | 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.setUser(new UserInfo(uid));
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setRead(false);
|
| | | detail.setExtraInfo(new Gson().toJson(listMsg));
|
| | | return detail;
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 资深导师--运营发出邀约
|
| | | * @param uid
|
| | | * @param nickname
|
| | | * @param kefuName
|
| | | * @param kefuWX
|
| | | * @return
|
| | | */
|
| | | 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));
|
| | | |
| | | List<ClientTextStyleVO> contentList2 = new ArrayList<>();
|
| | | 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),
|
| | | new ClientTextStyleVO("从收到本消息起,你将获得该账户等级对应的全部权益", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("专属客服", ClientTextStyleVO.COLOR_TITLE),
|
| | | 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);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setRead(false);
|
| | | detail.setExtraInfo(new Gson().toJson(listMsg));
|
| | | return detail;
|
| | | }
|
| | | }
|
| | |
| | | package com.yeshi.fanli.util.factory.msg;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dto.msg.MsgInviteContentDTO;
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVO;
|
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVOFactory;
|
| | |
|
| | | public class MsgInviteDetailFactory {
|
| | |
|
| | |
| | | if (threeSale == null || uid == null)
|
| | | return null;
|
| | |
|
| | | |
| | | |
| | | |
| | | |
| | | MsgInviteDetail detail = new MsgInviteDetail();
|
| | | if (StringUtil.isNullOrEmpty(beiZhu))
|
| | | detail.setBeiZhu("无");
|
| | |
| | | package com.yeshi.fanli.util.factory.msg;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Calendar;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import org.yeshi.utils.StringUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail.MsgTypeOrderTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.AlipayAccountValidNormalHistory;
|
| | | import com.yeshi.fanli.entity.bus.user.Extract;
|
| | | import com.yeshi.fanli.entity.bus.user.ExtractWeiXinRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVO;
|
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVOFactory;
|
| | |
|
| | | public class MsgMoneyDetailFactory {
|
| | |
|
| | | /**
|
| | | * 提现申请消息
|
| | | * 账号验证消息
|
| | | *
|
| | | * @param extract
|
| | | * @param valid
|
| | | * @param uid
|
| | | * @param beiZhu
|
| | | * @return
|
| | | */
|
| | | public static MsgMoneyDetail createExtractApplyMsg(Extract extract, Long uid, String beiZhu) {
|
| | | public static MsgMoneyDetail createExtractMsg(String stateDesc, Long uid, Extract extract, String reason, String alipayNo) {
|
| | | if (extract == null || uid == null)
|
| | | return null;
|
| | | |
| | | String name = filterName(extract.getName());
|
| | | String account = filterAccount(extract.getAccount());
|
| | | |
| | | List<CommonMsgItemVO> listMsg = new ArrayList<>();
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("提现账号", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(String.format("支付宝:%s-姓名:%s",account, name), ClientTextStyleVO.COLOR_CONTENT)));
|
| | | |
| | | List<ClientTextStyleVO> contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("¥" + extract.getMoney().setScale(2), ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | if (!StringUtil.isNullOrEmpty(alipayNo)) {
|
| | | contentList.add(new ClientTextStyleVO(String.format("&支付宝订单号: %s", "*" + alipayNo.substring(alipayNo.length() - 10)), ClientTextStyleVO.COLOR_CONTENT));
|
| | | }
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("提现金额", ClientTextStyleVO.COLOR_TITLE),contentList));
|
| | | |
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("提现状态", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(stateDesc, 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("如有疑问请联系人工客服", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | |
| | | MsgMoneyDetail detail = new MsgMoneyDetail();
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setBeiZhu(reason);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setExtract(extract);
|
| | | detail.setMoney(extract.getMoney());
|
| | | detail.setMsgType(MsgTypeMoneyTypeEnum.extract);
|
| | | detail.setRead(false);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setStateDesc("人工审核中");
|
| | | return detail;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 提现成功消息
|
| | | * |
| | | * @param extract
|
| | | * @param uid
|
| | | * @param beiZhu
|
| | | * @return
|
| | | */
|
| | | public static MsgMoneyDetail createExtractSuccessMsg(Extract extract, Long uid, String beiZhu) {
|
| | | if (extract == null || uid == null)
|
| | | return null;
|
| | | MsgMoneyDetail detail = new MsgMoneyDetail();
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setExtract(extract);
|
| | | detail.setMoney(extract.getMoney());
|
| | | detail.setMsgType(MsgTypeMoneyTypeEnum.extract);
|
| | | detail.setRead(false);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setStateDesc("提现成功");
|
| | | return detail;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 自动提现
|
| | | * |
| | | * @param extract
|
| | | * @param uid
|
| | | * @param beiZhu
|
| | | * @return
|
| | | */
|
| | | public static MsgMoneyDetail createExtractAutoMsg(ExtractWeiXinRecord extractRecord, String stateDesc, String desc,
|
| | | String beiZhu) {
|
| | | if (extractRecord == null)
|
| | | return null;
|
| | | MsgMoneyDetail detail = new MsgMoneyDetail();
|
| | | detail.setUser(new UserInfo(extractRecord.getUid()));
|
| | | detail.setRead(false);
|
| | | detail.setMoney(extractRecord.getMoney());
|
| | | detail.setMsgType(MsgTypeMoneyTypeEnum.extractAutoWX);
|
| | | detail.setExtract(new Extract(extractRecord.getId()));
|
| | | detail.setStateDesc(stateDesc);
|
| | | detail.setDesc(desc);
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setExtraInfo(new Gson().toJson(listMsg));
|
| | | return detail;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 提现失败消息
|
| | | * |
| | | * @param extract
|
| | | * @param uid
|
| | | * @param beiZhu
|
| | | * @return
|
| | | */
|
| | | public static MsgMoneyDetail createExtractFailMsg(Extract extract, Long uid, String beiZhu) {
|
| | | if (extract == null || uid == null)
|
| | | return null;
|
| | | MsgMoneyDetail detail = new MsgMoneyDetail();
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setExtract(extract);
|
| | | detail.setMoney(extract.getMoney());
|
| | | detail.setMsgType(MsgTypeMoneyTypeEnum.extract);
|
| | | detail.setRead(false);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setStateDesc("提现失败");
|
| | | return detail;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 账号验证消息
|
| | |
| | | * @return
|
| | | */
|
| | | public static MsgMoneyDetail createAlipayAccountValidMsg(AlipayAccountValidNormalHistory valid, Long uid,
|
| | | String appName, BigDecimal money, String beiZhu) {
|
| | | String appName, BigDecimal money, int limitDay, boolean change) {
|
| | | if (valid == null || uid == null || appName == null)
|
| | | return null;
|
| | | |
| | | String changeWay = "绑定";
|
| | | if (change) {
|
| | | changeWay = "修改";
|
| | | }
|
| | | String name = filterName(valid.getName());
|
| | | String account = filterAccount(valid.getAccount());
|
| | | |
| | | List<CommonMsgItemVO> listMsg = new ArrayList<>();
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("验证状态", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(String.format("提现账号%s成功", changeWay), ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("提现账号", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(String.format("支付宝:%s-姓名:%s",account, name), ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("打款金额", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(money + "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("提现账号", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(String.format("提现账号收到一笔,来自%s的转账,即绑定成功", appName), ClientTextStyleVO.COLOR_CONTENT)));
|
| | | List<ClientTextStyleVO> contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(String.format("成功%s的提现账号", changeWay), ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO( limitDay+"", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("天内无法修改", ClientTextStyleVO.COLOR_CONTENT));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),contentList));
|
| | | |
| | | |
| | | MsgMoneyDetail detail = new MsgMoneyDetail();
|
| | | detail.setAlipayAccountValid(valid);
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setMoney(money);
|
| | | detail.setStateDesc(String.format("你的支付宝将收到一笔,理由\"来自于%s的支付宝验证打款\"和对方账户\"%s支付宝验证\"的%s元转账。", appName, appName,
|
| | | MoneyBigDecimalUtil.getWithNoZera(money)).toString());
|
| | | detail.setMsgType(MsgTypeMoneyTypeEnum.extractValid);
|
| | | detail.setRead(false);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setExtraInfo(new Gson().toJson(listMsg));
|
| | | return detail;
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 账号验证消息
|
| | | * |
| | | * @param valid
|
| | | * @param uid
|
| | | * @param beiZhu
|
| | | * @return
|
| | | */
|
| | | public static MsgMoneyDetail createAlipayAccountValidFail(AlipayAccountValidNormalHistory valid, Long uid,
|
| | | String appName, BigDecimal money, int limitDay, boolean change) {
|
| | | if (valid == null || uid == null || appName == null)
|
| | | return null;
|
| | | |
| | | String changeWay = "绑定";
|
| | | if (change) {
|
| | | changeWay = "修改";
|
| | | }
|
| | | String name = filterName(valid.getName());
|
| | | String account = filterAccount(valid.getAccount());
|
| | | |
| | | List<CommonMsgItemVO> listMsg = new ArrayList<>();
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("验证状态", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(String.format("提现账号%s失败", changeWay), ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("提现账号", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(String.format("支付宝:%s-姓名:%s",account, name), ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("原因", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("请仔细核对填写账号是否有误或距上一次修改时长是否超过30天", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | |
| | | if (!change) {
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("无", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | } else {
|
| | | List<ClientTextStyleVO> contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("距下一次修改时间还有", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO(limitDay+"", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("天内无法修改", ClientTextStyleVO.COLOR_CONTENT));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),contentList));
|
| | | }
|
| | | |
| | | MsgMoneyDetail detail = new MsgMoneyDetail();
|
| | | detail.setAlipayAccountValid(valid);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setMoney(money);
|
| | | detail.setMsgType(MsgTypeMoneyTypeEnum.extractValid);
|
| | | detail.setRead(false);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setExtraInfo(new Gson().toJson(listMsg));
|
| | | return detail;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 返利到账
|
| | |
| | | * @param beiZhu
|
| | | * @return
|
| | | */
|
| | | public static MsgMoneyDetail createFailiMsg(BigDecimal money, BigDecimal balance, String orderId, int orderType,
|
| | | int goodsCount, Long uid, String beiZhu) {
|
| | | public static MsgMoneyDetail createOrderReceivedMsg(BigDecimal money, BigDecimal balance, String orderId, int source,
|
| | | int goodsCount, Long uid, int type, Date downTime, boolean useCoupon) {
|
| | | if (money == null || balance == null || orderId == null || uid == null)
|
| | | return null;
|
| | |
|
| | | String fanliName = "";
|
| | | MsgTypeMoneyTypeEnum typeEnum = null;
|
| | | String sourceName = Constant.getSourceName(source);
|
| | | if (Constant.TYPE_REBATE == type) {
|
| | | fanliName = "自购返利";
|
| | | sourceName += "-返利订单";
|
| | | typeEnum = MsgTypeMoneyTypeEnum.fanli;
|
| | | } else if (Constant.TYPE_SHAER == type) {
|
| | | fanliName = "分享奖金:";
|
| | | sourceName += "-分享订单";
|
| | | typeEnum = MsgTypeMoneyTypeEnum.share;
|
| | | } |
| | |
|
| | | if (useCoupon) {
|
| | | fanliName = "使用返利奖励券";
|
| | | }
|
| | | |
| | | List<CommonMsgItemVO> listMsg = new ArrayList<>();
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("到账详情", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(sourceName, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("订单号", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(orderId, ClientTextStyleVO.COLOR_CONTENT), true));
|
| | |
|
| | | List<ClientTextStyleVO> contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("下单时间:" + TimeUtil.formatDate(downTime), ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("-商品数量:共", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO(goodsCount + "", 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),
|
| | | new ClientTextStyleVO(fanliName, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | |
| | | List<ClientTextStyleVO> contentList2 = new ArrayList<>();
|
| | | contentList2.add(new ClientTextStyleVO("¥" + money, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList2.add(new ClientTextStyleVO("(账户余额¥)"+ balance, ClientTextStyleVO.COLOR_CONTENT));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("到账金额", ClientTextStyleVO.COLOR_TITLE), contentList2));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("如有疑问请联系人工客服", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | |
| | | MsgMoneyDetail detail = new MsgMoneyDetail();
|
| | | detail.setBalance(balance);
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setGoodsCount(goodsCount);
|
| | | detail.setMoney(money);
|
| | | detail.setMsgType(MsgTypeMoneyTypeEnum.fanli);
|
| | | detail.setMsgType(typeEnum);
|
| | | detail.setOrderId(orderId);
|
| | | detail.setOrderType(orderType);
|
| | | detail.setOrderType(source);
|
| | | detail.setRead(false);
|
| | | detail.setUser(new UserInfo(uid));
|
| | |
|
| | | detail.setExtraInfo(new Gson().toJson(listMsg));
|
| | | return detail;
|
| | | }
|
| | |
|
| | |
| | | * @param beiZhu
|
| | | * @return
|
| | | */
|
| | | public static MsgMoneyDetail createFailiWeiQuanMsg(Long uid, String orderId, int orderType, BigDecimal money,
|
| | | BigDecimal balance, String beiZhu) {
|
| | | public static MsgMoneyDetail createOrderWeiQuanMsg(Long uid, String orderId, int source, BigDecimal money, |
| | | BigDecimal fanliMoney, int goodsCount, Date downTime, int type) {
|
| | | if (money == null || orderId == null || money == null || uid == null)
|
| | | return null;
|
| | |
|
| | | MsgTypeMoneyTypeEnum typeEnum = null;
|
| | | String sourceName = Constant.getSourceName(source);
|
| | | if (Constant.TYPE_REBATE == type) {
|
| | | sourceName += "-返利订单";
|
| | | typeEnum = MsgTypeMoneyTypeEnum.fanliWeiQuan;
|
| | | } else if (Constant.TYPE_SHAER == type) {
|
| | | sourceName += "-分享订单";
|
| | | typeEnum = MsgTypeMoneyTypeEnum.shareWeiQuan;
|
| | | } |
| | |
|
| | | String weiquan = "订单售后";
|
| | | String weiquanMoney = "全额退回";
|
| | | if (fanliMoney.compareTo(money) > 0) {
|
| | | weiquan = "订单部分售后";
|
| | | weiquan = "部分退回";
|
| | | }
|
| | | |
| | | List<CommonMsgItemVO> listMsg = new ArrayList<>();
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("退回详情", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(sourceName, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("订单号", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(orderId, ClientTextStyleVO.COLOR_CONTENT), true));
|
| | |
|
| | | List<ClientTextStyleVO> contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("下单时间:" + TimeUtil.formatDate(downTime), ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("-商品数量:共", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO(goodsCount + "", 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),
|
| | | new ClientTextStyleVO(weiquan, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("到账金额", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("¥" +fanliMoney.setScale(2) + "(原到账金额)", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | |
| | | List<ClientTextStyleVO> contentList2 = new ArrayList<>();
|
| | | contentList2.add(new ClientTextStyleVO("¥" + money.setScale(2), ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList2.add(new ClientTextStyleVO("("+ weiquanMoney + ")", ClientTextStyleVO.COLOR_CONTENT));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("退回金额", ClientTextStyleVO.COLOR_TITLE), contentList2));
|
| | | |
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("如有疑问请联系人工客服", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | |
| | | |
| | | MsgMoneyDetail detail = new MsgMoneyDetail();
|
| | | detail.setBalance(balance);
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setMoney(money);
|
| | | detail.setMsgType(MsgTypeMoneyTypeEnum.fanliWeiQuan);
|
| | | detail.setMsgType(typeEnum);
|
| | | detail.setOrderId(orderId);
|
| | | detail.setOrderType(orderType);
|
| | | detail.setOrderType(source);
|
| | | detail.setRead(false);
|
| | | detail.setUser(new UserInfo(uid));
|
| | |
|
| | | detail.setExtraInfo(new Gson().toJson(listMsg));
|
| | | return detail;
|
| | | }
|
| | |
|
| | |
| | | * @param beiZhu
|
| | | * @return
|
| | | */
|
| | | public static MsgMoneyDetail createInviteMsg(BigDecimal money, BigDecimal balance, int orderType, int orderCount,
|
| | | int goodsCount, Long uid, String beiZhu) {
|
| | | public static MsgMoneyDetail createTeamReceivedMsg(Long uid, BigDecimal money, BigDecimal balance, Date receivedDate) {
|
| | | if (money == null || balance == null || uid == null)
|
| | | return null;
|
| | |
|
| | | List<CommonMsgItemVO> listMsg = new ArrayList<>();
|
| | | List<ClientTextStyleVO> contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(TimeUtil.getYearOnlyYYYY(receivedDate)+ "年", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO(TimeUtil.getMonthOnlyMM(receivedDate), 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),
|
| | | new ClientTextStyleVO("团队收益", ClientTextStyleVO.COLOR_CONTENT), true));
|
| | | |
| | | List<ClientTextStyleVO> contentList2 = new ArrayList<>();
|
| | | contentList2.add(new ClientTextStyleVO("¥" + money.setScale(2), ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList2.add(new ClientTextStyleVO("(账户余额¥ "+ balance.setScale(2)+")", ClientTextStyleVO.COLOR_CONTENT));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("到账金额", ClientTextStyleVO.COLOR_TITLE), contentList2));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("如有疑问请联系人工客服", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | |
| | | MsgMoneyDetail detail = new MsgMoneyDetail();
|
| | | detail.setBalance(balance);
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setGoodsCount(goodsCount);
|
| | | detail.setMoney(money);
|
| | | detail.setMsgType(MsgTypeMoneyTypeEnum.invite);
|
| | | detail.setOrderCount(orderCount);
|
| | | detail.setRead(false);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setOrderType(orderType);
|
| | |
|
| | | detail.setExtraInfo(new Gson().toJson(listMsg));
|
| | | return detail;
|
| | | }
|
| | |
|
| | |
| | | return detail;
|
| | | }
|
| | |
|
| | | |
| | | |
| | | private static String filterName(String oldname) {
|
| | | String name = "";
|
| | | if (StringUtil.isNullOrEmpty(oldname))
|
| | | return name;
|
| | | |
| | | if (oldname.length() > 2)
|
| | | for (int i = 0; i < oldname.length(); i++) {
|
| | | if (i == 0)
|
| | | name += oldname.charAt(i);
|
| | | else
|
| | | name += "*";
|
| | | }
|
| | | else
|
| | | name = oldname.charAt(0) + "*";
|
| | |
|
| | | return name;
|
| | | }
|
| | | |
| | | public static String filterAccount(String alipayAccount) {
|
| | | String account = "";
|
| | | if (StringUtil.isNullOrEmpty(alipayAccount))
|
| | | return account;
|
| | | |
| | | if (alipayAccount.indexOf("@") > -1) {// 邮箱
|
| | | int index = alipayAccount.indexOf("@");
|
| | |
|
| | | for (int i = 0; i < alipayAccount.length(); i++) {
|
| | | if (i < 3 || i >= index)
|
| | | account += alipayAccount.charAt(i);
|
| | | else
|
| | | account += "*";
|
| | | }
|
| | | } else if (StringUtil.isMobile(alipayAccount)) {// 电话
|
| | | account = alipayAccount.substring(0, 7) + "****";
|
| | | } else {// 其他
|
| | | if (alipayAccount.length() >= 6) {
|
| | | for (int i = 0; i < alipayAccount.length(); i++) {
|
| | | if (i < 3 || i >= alipayAccount.length() - 2)
|
| | | account += alipayAccount.charAt(i);
|
| | | else
|
| | | account += "*";
|
| | | }
|
| | | } else {
|
| | | for (int i = 0; i < alipayAccount.length(); i++) {
|
| | | if (i < 1 || i >= alipayAccount.length() - 1)
|
| | | account += alipayAccount.charAt(i);
|
| | | else
|
| | | account += "*";
|
| | | }
|
| | | }
|
| | | }
|
| | | return account;
|
| | | }
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.util.factory.msg;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgExtra;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail.MsgTypeOrderTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.exception.msg.MsgOrderDetailException;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVO;
|
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVOFactory;
|
| | |
|
| | | public class MsgOrderDetailFactory {
|
| | |
|
| | |
| | | }
|
| | |
|
| | |
|
| | |
|
| | | /**
|
| | | * 创建订单被统计消息
|
| | | * @param uid
|
| | | * @param orderId 订单号
|
| | | * @param source 订单来源:淘宝、京东、天猫
|
| | | * @param type 订单类型:自购、分享、团队
|
| | | * @param goodsCount 商品数量
|
| | | * @param payMoney 付款金额
|
| | | * @param money 返利金额
|
| | | * @param downTime 下单时间
|
| | | * @param beiZhu 备注信息 - 非必填
|
| | | * @return
|
| | | */
|
| | | @Transactional
|
| | | public static MsgOrderDetail createOrderStatistics(Long uid, String orderId, int source, int type, int goodsCount,
|
| | | BigDecimal payMoney, BigDecimal money, Date downTime, String beiZhu) {
|
| | | if (uid == null || StringUtil.isNullOrEmpty(orderId) || downTime == null)
|
| | | return null;
|
| | |
|
| | | String fanliName = "";
|
| | | MsgTypeOrderTypeEnum typeEnum = null;
|
| | | String sourceName = Constant.getSourceName(source);
|
| | | if (Constant.TYPE_REBATE == type) {
|
| | | fanliName = "返利:";
|
| | | sourceName += "-返利订单";
|
| | | typeEnum = MsgTypeOrderTypeEnum.fanli;
|
| | | } else if (Constant.TYPE_SHAER == type) {
|
| | | fanliName = "奖金:";
|
| | | sourceName += "-分享订单";
|
| | | typeEnum = MsgTypeOrderTypeEnum.share;
|
| | | } else if (Constant.TYPE_INVITE == type) {
|
| | | fanliName = "收益:";
|
| | | sourceName += "-团队订单";
|
| | | typeEnum = MsgTypeOrderTypeEnum.invite;
|
| | | }
|
| | |
|
| | | // 添加内容
|
| | | List<CommonMsgItemVO> listMsg = new ArrayList<>();
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("订单详情", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(sourceName, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | // 订单号可点击
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("订单号", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(orderId, ClientTextStyleVO.COLOR_CONTENT), true));
|
| | |
|
| | | List<ClientTextStyleVO> contentList = new ArrayList<>();
|
| | | contentList
|
| | | .add(new ClientTextStyleVO("下单时间:" + TimeUtil.formatDate(downTime), ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("-商品数量:共", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO(goodsCount + "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | 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("实付款:", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList2.add(new ClientTextStyleVO("¥" + filterMoney(payMoney), ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList2.add(new ClientTextStyleVO("&" + fanliName, ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList2.add(new ClientTextStyleVO("¥" + filterMoney(money), ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("金额", ClientTextStyleVO.COLOR_TITLE),
|
| | | contentList2));
|
| | |
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(StringUtil.isNullOrEmpty(beiZhu) ? "无" : beiZhu,
|
| | | ClientTextStyleVO.COLOR_CONTENT)));
|
| | |
|
| | | MsgOrderDetail detail = new MsgOrderDetail();
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setGoodsCount(goodsCount);
|
| | | detail.setHongBaoMoney(money);
|
| | | detail.setOrderId(orderId);
|
| | | detail.setOrderType(source);
|
| | | detail.setPayMoney(payMoney);
|
| | | detail.setRead(false);
|
| | | detail.setType(typeEnum);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setExtraInfo(new Gson().toJson(listMsg));
|
| | | return detail;
|
| | | }
|
| | | |
| | | private static BigDecimal filterMoney(BigDecimal money) {
|
| | | if (money == null)
|
| | | return BigDecimal.valueOf(0.00) ;
|
| | | else
|
| | | return money.setScale(2);
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 订单找回成功
|
| | | * @param uid
|
| | | * @param orderId 订单号
|
| | | * @param source 订单来源:淘宝、京东、天猫
|
| | | * @param type 订单类型:自购、分享、团队
|
| | | * @param goodsCount 商品数量
|
| | | * @param payMoney 付款金额
|
| | | * @param money 返利金额
|
| | | * @param submitTime 提交时间
|
| | | * @param beiZhu 备注信息 - 非必填
|
| | | * @return
|
| | | */
|
| | | public static MsgOrderDetail createOrderFoundSuccess(Long uid, String orderId, int source, int type, int goodsCount,
|
| | | BigDecimal payMoney, BigDecimal money, Date submitTime, String beiZhu) {
|
| | | if (uid == null || StringUtil.isNullOrEmpty(orderId) || submitTime == null)
|
| | | return null;
|
| | | |
| | | String fanliName = "";
|
| | | String sourceName = Constant.getSourceName(source);
|
| | | if (Constant.TYPE_REBATE == type) {
|
| | | fanliName = "返利:";
|
| | | sourceName += "-返利订单";
|
| | | } else if (Constant.TYPE_SHAER == type) {
|
| | | fanliName = "奖金:";
|
| | | sourceName += "-分享订单";
|
| | | }
|
| | | |
| | | 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(sourceName, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | |
| | | // 订单号可点击
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("订单号", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(orderId, ClientTextStyleVO.COLOR_CONTENT), true));
|
| | | |
| | | List<ClientTextStyleVO> contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("提交时间:" + TimeUtil.formatDate(submitTime), ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("-商品数量:共", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO(goodsCount + "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | 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("实付款:", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList2.add(new ClientTextStyleVO("¥" + filterMoney(payMoney), ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList2.add(new ClientTextStyleVO("&" + fanliName, ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList2.add(new ClientTextStyleVO("¥" + filterMoney(money), ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("金额", ClientTextStyleVO.COLOR_TITLE),contentList2));
|
| | | |
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(StringUtil.isNullOrEmpty(beiZhu)?"无" : beiZhu, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | |
| | | |
| | | MsgOrderDetail detail = new MsgOrderDetail();
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setOrderType(source);
|
| | | detail.setPayMoney(payMoney);
|
| | | detail.setRead(false);
|
| | | detail.setType(MsgTypeOrderTypeEnum.foundSucceed);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setExtraInfo(new Gson().toJson(listMsg));
|
| | | |
| | | return detail;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 订单找回失败
|
| | | * @param uid
|
| | | * @param orderId
|
| | | * @param beiZhu
|
| | | * @return
|
| | | */
|
| | | public static MsgOrderDetail createOrderFoundFail(Long uid, String orderId, String beiZhu) {
|
| | | if (uid == null || StringUtil.isNullOrEmpty(orderId))
|
| | | 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(orderId, 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(StringUtil.isNullOrEmpty(beiZhu)?"无" : beiZhu, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | |
| | | MsgOrderDetail detail = new MsgOrderDetail();
|
| | | detail.setOrderId(orderId);
|
| | | detail.setType(MsgTypeOrderTypeEnum.foundFail);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setRead(false);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setExtraInfo(new Gson().toJson(listMsg));
|
| | | return detail;
|
| | | }
|
| | | |
| | | }
|
| | |
| | | * @return
|
| | | */
|
| | | public static UserMsgVO create(MsgOrderDetail msg, JumpDetailV2 jumpDetail, JSONObject params) {
|
| | | List<CommonMsgItemVO> items = new ArrayList<>();
|
| | | |
| | | // 新版消息
|
| | | if (!StringUtil.isNullOrEmpty(msg.getExtraInfo())) {
|
| | | Gson gson = new Gson();
|
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() {}.getType()));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setIcon(msg.getType().getIcon());
|
| | | userMsgVO.setTitle(msg.getType().getDesc());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | | userMsgVO.setContentItems(items);
|
| | | return userMsgVO;
|
| | | }
|
| | | |
| | |
|
| | | UserMsgVO vo = new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_order.png", "订单消息",
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), null);
|
| | |
|
| | | List<CommonMsgItemVO> items = new ArrayList<>();
|
| | | List<ClientTextStyleVO> contentList = new ArrayList<>();
|
| | | if (msg.getType() == MsgTypeOrderTypeEnum.found) {
|
| | | contentList = new ArrayList<>();
|
| | |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("渠道来源", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | |
|
| | | contentList.add(new ClientTextStyleVO(msg.getOrderId(), COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("返利订单", COLOR_TITLE), contentList));
|
| | |
|
| | |
| | | contentList = new ArrayList<>();
|
| | |
|
| | | contentList.add(new ClientTextStyleVO(msg.getOrderId(), COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("邀请订单", COLOR_TITLE), contentList));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("分享订单", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("订单售后", COLOR_CONTENT));
|
| | |
| | |
|
| | | return null;
|
| | | }
|
| | | |
| | | /**
|
| | | * 获取上一个等级
|
| | | * @Title: getNextLevel
|
| | | * @Description: |
| | | * @param level
|
| | | * @return |
| | | * UserLevelEnum 返回类型
|
| | | * @throws
|
| | | */
|
| | | public static UserLevelEnum getPrevLevel(UserLevelEnum level) {
|
| | | if (level == null)
|
| | | return null;
|
| | | if (level == UserLevelEnum.daRen) {
|
| | | return null;
|
| | | } else if (level == UserLevelEnum.normalVIP) {
|
| | | return UserLevelEnum.daRen;
|
| | | } else if (level == UserLevelEnum.highVIP) {
|
| | | return UserLevelEnum.normalVIP;
|
| | | } else if (level == UserLevelEnum.superVIP) {
|
| | | return UserLevelEnum.highVIP;
|
| | | }
|
| | | return null;
|
| | | }
|
| | | }
|
| | |
| | | itemVO.setClick(click);
|
| | | return itemVO;
|
| | | }
|
| | | |
| | | public static CommonMsgItemVO createMsgItemVO(ClientTextStyleVO title, List<ClientTextStyleVO> list) {
|
| | | CommonMsgItemVO itemVO = new CommonMsgItemVO();
|
| | | itemVO.setTitle(title);
|
| | | itemVO.setContent(list);
|
| | | return itemVO;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.vo.order;
|
| | |
|
| | | public class CurrentBonusVO {
|
| | | private String today; // 今日
|
| | | private String yesterday; // 昨日
|
| | | private String thisMonth; // 本月
|
| | | private String lastMonth; // 上月
|
| | |
|
| | | public String getToday() {
|
| | | return today;
|
| | | }
|
| | |
|
| | | public void setToday(String today) {
|
| | | this.today = today;
|
| | | }
|
| | |
|
| | | public String getYesterday() {
|
| | | return yesterday;
|
| | | }
|
| | |
|
| | | public void setYesterday(String yesterday) {
|
| | | this.yesterday = yesterday;
|
| | | }
|
| | |
|
| | | public String getThisMonth() {
|
| | | return thisMonth;
|
| | | }
|
| | |
|
| | | public void setThisMonth(String thisMonth) {
|
| | | this.thisMonth = thisMonth;
|
| | | }
|
| | |
|
| | | public String getLastMonth() {
|
| | | return lastMonth;
|
| | | }
|
| | |
|
| | | public void setLastMonth(String lastMonth) {
|
| | | this.lastMonth = lastMonth;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | private String title; // 商品标题
|
| | | private String picture; // 商品图片
|
| | | private String actualPay; // 实付款
|
| | | private String fanliRate; // 返利比例
|
| | | private String fanliExpect; // 预估返利
|
| | | private String commision; // 佣金
|
| | | private String bonus; // 奖金
|
| | | private String subsidy; // 补贴
|
| | | private String originSubsidy; // 原有补贴
|
| | |
|
| | |
| | | this.actualPay = actualPay;
|
| | | }
|
| | |
|
| | | public String getFanliExpect() {
|
| | | return fanliExpect;
|
| | | }
|
| | |
|
| | | public void setFanliExpect(String fanliExpect) {
|
| | | this.fanliExpect = fanliExpect;
|
| | | }
|
| | |
|
| | | public String getCommision() {
|
| | | return commision;
|
| | |
| | | this.subsidy = subsidy;
|
| | | }
|
| | |
|
| | | public String getFanliRate() {
|
| | | return fanliRate;
|
| | |
|
| | | public String getBonus() {
|
| | | return bonus;
|
| | | }
|
| | |
|
| | | public void setFanliRate(String fanliRate) {
|
| | | this.fanliRate = fanliRate;
|
| | | public void setBonus(String bonus) {
|
| | | this.bonus = bonus;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.vo.order;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | |
|
| | | /**
|
| | | * 红包v2统计数据
|
| | | * |
| | | */
|
| | |
|
| | | public class HongBaoCountVO {
|
| | |
|
| | | // 总金额
|
| | | private BigDecimal totalMoney;
|
| | |
|
| | | // 总金额-有效
|
| | | private BigDecimal validMoney;
|
| | |
|
| | | // 当前状态
|
| | | private int currentState;
|
| | | |
| | | // 到账时间
|
| | | private Date accountTime;
|
| | | |
| | | // 当前类型
|
| | | private int type;
|
| | | |
| | |
|
| | | public BigDecimal getTotalMoney() {
|
| | | return totalMoney;
|
| | | }
|
| | |
|
| | | public void setTotalMoney(BigDecimal totalMoney) {
|
| | | this.totalMoney = totalMoney;
|
| | | }
|
| | |
|
| | | public BigDecimal getValidMoney() {
|
| | | return validMoney;
|
| | | }
|
| | |
|
| | | public void setValidMoney(BigDecimal validMoney) {
|
| | | this.validMoney = validMoney;
|
| | | }
|
| | |
|
| | | public int getCurrentState() {
|
| | | return currentState;
|
| | | }
|
| | |
|
| | | public void setCurrentState(int currentState) {
|
| | | this.currentState = currentState;
|
| | | }
|
| | |
|
| | | public Date getAccountTime() {
|
| | | return accountTime;
|
| | | }
|
| | |
|
| | | public void setAccountTime(Date accountTime) {
|
| | | this.accountTime = accountTime;
|
| | | }
|
| | |
|
| | | public int getType() {
|
| | | return type;
|
| | | }
|
| | |
|
| | | public void setType(int type) {
|
| | | this.type = type;
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | /**
|
| | | * 红包v2
|
| | |
|
| | | * |
| | | */
|
| | |
|
| | | public class HongBaoV2VO extends HongBaoV2 implements Serializable {
|
| | |
| | | // 总金额
|
| | | private BigDecimal totalMoney;
|
| | |
|
| | | // 总金额-有效
|
| | | private BigDecimal validMoney;
|
| | |
|
| | | // 当前状态
|
| | | private int currentState;
|
| | |
|
| | | public BigDecimal getTotalMoney() {
|
| | | return totalMoney;
|
| | | }
|
| | |
| | | this.totalMoney = totalMoney;
|
| | | }
|
| | |
|
| | | public BigDecimal getValidMoney() {
|
| | | return validMoney;
|
| | | }
|
| | |
|
| | | public void setValidMoney(BigDecimal validMoney) {
|
| | | this.validMoney = validMoney;
|
| | | }
|
| | |
|
| | | public int getCurrentState() {
|
| | | return currentState;
|
| | | }
|
| | |
|
| | | public void setCurrentState(int currentState) {
|
| | | this.currentState = currentState;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import java.util.List;
|
| | |
|
| | | public class OrderRebateVO {
|
| | | private String totalFanLi; // 预估总返利
|
| | | private int type; // 订单类型 : 1返利 2分享 3邀请团队
|
| | | private String stateDesc; // 到账状态
|
| | | private boolean coupon; // 使用券
|
| | | private boolean wq; // 是否维权
|
| | | private String wqDesc; // 维权文字
|
| | | private String wqMoney; // 维权金额
|
| | |
|
| | | private String fanLi; // 预估总返利
|
| | | private String fanLiDesc; // 返利说明
|
| | | |
| | | private String upperFanLi; // 升级返利
|
| | | private String userLevel; // 用户等级
|
| | | private String jumpLink; // 跳转链接
|
| | |
|
| | | private String subsidyDesc; // 团队说明
|
| | | private String subsidy; // 团队补贴
|
| | | private String originSubsidy; // 小一等级补贴
|
| | | |
| | |
|
| | | private List<GoodsRebateVO> listGoods;
|
| | |
|
| | | public String getTotalFanLi() {
|
| | | return totalFanLi;
|
| | |
|
| | | public String getFanLi() {
|
| | | return fanLi;
|
| | | }
|
| | |
|
| | | public void setTotalFanLi(String totalFanLi) {
|
| | | this.totalFanLi = totalFanLi;
|
| | | public void setFanLi(String fanLi) {
|
| | | this.fanLi = fanLi;
|
| | | }
|
| | |
|
| | | public String getUpperFanLi() {
|
| | |
| | | this.jumpLink = jumpLink;
|
| | | }
|
| | |
|
| | | public int getType() {
|
| | | return type;
|
| | | }
|
| | |
|
| | | public void setType(int type) {
|
| | | this.type = type;
|
| | | }
|
| | |
|
| | | public String getStateDesc() {
|
| | | return stateDesc;
|
| | | }
|
| | |
|
| | | public void setStateDesc(String stateDesc) {
|
| | | this.stateDesc = stateDesc;
|
| | | }
|
| | |
|
| | | public boolean isWq() {
|
| | | return wq;
|
| | | }
|
| | |
|
| | | public void setWq(boolean wq) {
|
| | | this.wq = wq;
|
| | | }
|
| | |
|
| | | public String getWqDesc() {
|
| | | return wqDesc;
|
| | | }
|
| | |
|
| | | public void setWqDesc(String wqDesc) {
|
| | | this.wqDesc = wqDesc;
|
| | | }
|
| | |
|
| | | public String getWqMoney() {
|
| | | return wqMoney;
|
| | | }
|
| | |
|
| | | public void setWqMoney(String wqMoney) {
|
| | | this.wqMoney = wqMoney;
|
| | | }
|
| | |
|
| | | public boolean isCoupon() {
|
| | | return coupon;
|
| | | }
|
| | |
|
| | | public void setCoupon(boolean coupon) {
|
| | | this.coupon = coupon;
|
| | | }
|
| | |
|
| | | public String getFanLiDesc() {
|
| | | return fanLiDesc;
|
| | | }
|
| | |
|
| | | public void setFanLiDesc(String fanLiDesc) {
|
| | | this.fanLiDesc = fanLiDesc;
|
| | | }
|
| | |
|
| | | public String getSubsidy() {
|
| | | return subsidy;
|
| | | }
|
| | |
|
| | | public void setSubsidy(String subsidy) {
|
| | | this.subsidy = subsidy;
|
| | | }
|
| | |
|
| | | public String getOriginSubsidy() {
|
| | | return originSubsidy;
|
| | | }
|
| | |
|
| | | public void setOriginSubsidy(String originSubsidy) {
|
| | | this.originSubsidy = originSubsidy;
|
| | | }
|
| | |
|
| | | public String getSubsidyDesc() {
|
| | | return subsidyDesc;
|
| | | }
|
| | |
|
| | | public void setSubsidyDesc(String subsidyDesc) {
|
| | | this.subsidyDesc = subsidyDesc;
|
| | | }
|
| | |
|
| | | |
| | | }
|