Merge remote-tracking branch 'origin/div' into div
| | |
| | | import com.yeshi.fanli.dto.vip.VIPSearchResult;
|
| | | import com.yeshi.fanli.dto.vip.goods.VIPGoodsInfo;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.activity.RecommendActivity;
|
| | | import com.yeshi.fanli.entity.bus.help.AppPageNotification;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | |
| | | 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.recommend.RecommendJumpInfoVO;
|
| | | import com.yeshi.fanli.vo.search.GoodsDocParseResultVO;
|
| | |
|
| | | import net.sf.json.JSON;
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | | orderHongBaoMoneyComputeService.getShowComputeRate(
|
| | | acceptData.getPlatform(),
|
| | | acceptData.getVersion()))));
|
| | | // 跳转详情
|
| | | if (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(),
|
| | | acceptData.getVersion())) {
|
| | | buildGoodsClick(data, goods, acceptData, gson);
|
| | | }
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | return;
|
| | | }
|
| | |
| | | orderHongBaoMoneyComputeService.getShowComputeRate(
|
| | | acceptData.getPlatform(),
|
| | | acceptData.getVersion()))));
|
| | | // if (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(),
|
| | | // acceptData.getVersion())) {
|
| | | // buildGoodsClick(data, goods, acceptData, gson);
|
| | | // }
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | return;
|
| | | }
|
| | |
| | | });
|
| | | }
|
| | |
|
| | | private void buildGoodsClick(JSONObject data, CommonGoods goods, AcceptData acceptData, Gson gson) {
|
| | |
|
| | | JSONObject params = new JSONObject();
|
| | | params.put("id", goods.getGoodsId() + "");
|
| | | params.put("from", "猜你喜欢");
|
| | | |
| | | String type="";
|
| | | switch(goods.getGoodsType()){
|
| | | case Constant.SOURCE_TYPE_TAOBAO:
|
| | | type="goodsdetail";
|
| | | break;
|
| | | case Constant.SOURCE_TYPE_JD:
|
| | | type="goodsdetail_jd";
|
| | | break;
|
| | | case Constant.SOURCE_TYPE_PDD:
|
| | | type="goodsdetail_pdd";
|
| | | break;
|
| | | case Constant.SOURCE_TYPE_VIP:
|
| | | type="goodsdetail_vip";
|
| | | break;
|
| | | case Constant.SOURCE_TYPE_SUNING:
|
| | | type="goodsdetail_suning";
|
| | | break;
|
| | | |
| | | }
|
| | |
|
| | | RecommendJumpInfoVO left = new RecommendJumpInfoVO(
|
| | | "去看看", jumpDetailV2Service.getByTypeCache(type,
|
| | | Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion())),
|
| | | params);
|
| | | data.put("left", gson.toJson(left));
|
| | | |
| | | // 去网页
|
| | | params = new JSONObject();
|
| | | params.put("url", "http://www.baidu.com");
|
| | |
|
| | | RecommendJumpInfoVO right = new RecommendJumpInfoVO("有更高返利?", jumpDetailV2Service.getByTypeCache("web",
|
| | | Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion())), params);
|
| | | data.put("right", gson.toJson(right));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 口令领取
|
| | | *
|
| | |
| | | private boolean valid;
|
| | | private int delayHour;// 延时的时间(小时记)
|
| | | private Date staticticDate;// 统计到的时间
|
| | | private Date placeTime;//下单时间
|
| | | private boolean miandan;
|
| | |
|
| | | public OrderMQMsg(String orderId, Integer type, Long uid, int handleType, boolean valid, int delayHour,
|
| | | Date staticticDate, boolean miandan) {
|
| | | Date staticticDate, boolean miandan,Date placeTime) {
|
| | | super();
|
| | | this.orderId = orderId;
|
| | | this.type = type;
|
| | |
| | | this.delayHour = delayHour;
|
| | | this.staticticDate = staticticDate;
|
| | | this.miandan = miandan;
|
| | | this.placeTime=placeTime;
|
| | | }
|
| | | |
| | | public Date getPlaceTime() {
|
| | | return placeTime;
|
| | | }
|
| | |
|
| | | public void setPlaceTime(Date placeTime) {
|
| | | this.placeTime = placeTime;
|
| | | }
|
| | |
|
| | | public Date getStaticticDate() {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void teamReceive(Long uid, BigDecimal money, BigDecimal balance, Date receivedDate) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createTeamReceivedMsg(uid, money, balance, receivedDate, "团队收益");
|
| | | public void teamRewardReceive(Long uid, BigDecimal money, BigDecimal balance, Date receivedDate) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createTeamReceivedMsg(uid, money, balance, receivedDate, "团队奖金");
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | |
| | | if (!Constant.IS_TEST)
|
| | | if (result.getResultCode() == HongBaoAddResult.CODE_ADD) {// 只发送新增消息
|
| | | OrderMQMsg mqMsg = new OrderMQMsg(orderId, sourceType, uid, OrderMQMsg.HANDLE_TYPE_ADD,
|
| | | isCommonOrderValid(coList), 0, new Date(), result.isMiandan());
|
| | | isCommonOrderValid(coList), 0, new Date(), result.isMiandan(),coList.get(0).getThirdCreateTime());
|
| | | Message msg = MQMsgBodyFactory.create(MQTopicName.TOPIC_ORDER, OrderTopicTagEnum.orderStatistic, mqMsg);
|
| | | producer.send(msg);
|
| | | }
|
| | |
| | |
|
| | |
|
| | | /**
|
| | | * 团队收益消息
|
| | | * 团队奖金消息
|
| | | * @param uid
|
| | | * @param money 本次到账金额
|
| | | * @param balance 余额
|
| | | * @param receivedDate 结算月度
|
| | | */
|
| | | public void teamReceive(Long uid, BigDecimal money, BigDecimal balance, Date receivedDate);
|
| | | public void teamRewardReceive(Long uid, BigDecimal money, BigDecimal balance, Date receivedDate);
|
| | |
|
| | | /**
|
| | | * 使用奖励券
|
| | |
| | |
|
| | | /**
|
| | | * @throws UserMoneyDetailException
|
| | | * 团队收益 到账到用户余额
|
| | | * 团队奖金 到账到用户余额
|
| | | * @Title: addTOUserAccount
|
| | | * @Description:
|
| | | * @param day
|
| | |
| | | * @throws
|
| | | */
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void addTeamIncomeTOUserAccount(Date preSendTime, Long uid) throws UserMoneyDetailException {
|
| | |
|
| | | public void addTeamRewardTOUserAccount(Date preSendTime, Long uid) throws UserMoneyDetailException {
|
| | | List<Integer> typeList = new ArrayList<>();
|
| | | typeList.add(TeamEincomeRecord.TYPE_TEAM_SUBSIDY);
|
| | | typeList.add(TeamEincomeRecord.TYPE_TEAM_REWARD);
|
| | |
|
| | | Date now = new Date();
|
| | |
| | | userMoneyService.addUserMoney(uid, money, detail);
|
| | | // 发送消息
|
| | | BigDecimal balance = userMoneyService.getBalance(uid);
|
| | | userMoneyMsgNotificationService.teamReceive(uid, money, balance, now);
|
| | | userMoneyMsgNotificationService.teamRewardReceive(uid, money, balance, now);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 团队分红到账
|
| | | * @Title: addTeamDividentsTOUserAccount
|
| | | * @Description: |
| | | * @param preSendTime
|
| | | * @param uid
|
| | | * @throws UserMoneyDetailException |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void addTeamDividentsTOUserAccount(Date preSendTime, Long uid) throws UserMoneyDetailException {
|
| | | List<Integer> typeList = new ArrayList<>();
|
| | | typeList.add(TeamEincomeRecord.TYPE_TEAM_DIVIDENTS);
|
| | | typeList.add(TeamEincomeRecord.TYPE_TEAM_SUBSIDY);
|
| | | Date now = new Date();
|
| | | List<TeamEincomeRecord> list = teamEincomeRecordService.listCanRecieveRecord(preSendTime, uid, typeList);
|
| | | BigDecimal money = new BigDecimal(0);
|
| | |
| | | doOrderTeamIncomePreFanLi();// 处理订单提成返利
|
| | | doDividentsPreJob();
|
| | |
|
| | | doOrderTeamIncomeFanLi();
|
| | | doOrderTeamRewardFanLi();
|
| | | doDividentsJob();
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 处理团队订单返利
|
| | | * 处理团队奖金返利
|
| | | */
|
| | | public void doOrderTeamIncomeFanLi() {
|
| | | public void doOrderTeamRewardFanLi() {
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | |
| | | String handler = its.next();
|
| | | try {
|
| | | UidDateDTO dto = map.get(handler);
|
| | | teamEincomeManager.addTeamIncomeTOUserAccount(dto.getDate(), dto.getUid());
|
| | | teamEincomeManager.addTeamRewardTOUserAccount(dto.getDate(), dto.getUid());
|
| | | TeamOrderCMQManager.getInstance().deleteTeamIncomeMsg(handler);
|
| | | } catch (Exception e) {
|
| | | try {
|
New file |
| | |
| | | package com.yeshi.fanli.vo.recommend;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | public class RecommendJumpInfoVO {
|
| | | @Expose
|
| | | private String name;// 按钮名称
|
| | | @Expose
|
| | | private JumpDetailV2 jumpDetail;// 跳转
|
| | | @Expose
|
| | | private JSONObject params;// 参数
|
| | |
|
| | | public RecommendJumpInfoVO(String name, JumpDetailV2 jumpDetail, JSONObject params) {
|
| | | super();
|
| | | this.name = name;
|
| | | this.jumpDetail = jumpDetail;
|
| | | this.params = params;
|
| | | }
|
| | | |
| | | public RecommendJumpInfoVO() {
|
| | | |
| | | }
|
| | |
|
| | | public String getName() {
|
| | | return name;
|
| | | }
|
| | |
|
| | | public void setName(String name) {
|
| | | this.name = name;
|
| | | }
|
| | |
|
| | | public JumpDetailV2 getJumpDetail() {
|
| | | return jumpDetail;
|
| | | }
|
| | |
|
| | | public void setJumpDetail(JumpDetailV2 jumpDetail) {
|
| | | this.jumpDetail = jumpDetail;
|
| | | }
|
| | |
|
| | | public JSONObject getParams() {
|
| | | return params;
|
| | | }
|
| | |
|
| | | public void setParams(JSONObject params) {
|
| | | this.params = params;
|
| | | }
|
| | | }
|