| | |
| | | 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 class MsgAccountDetailFactory {
|
| | | public final static int TYPE_WX = 1;// 微信
|
| | |
| | |
|
| | | List<CommonMsgItemVO> listMsg = new ArrayList<>();
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("绑定详情", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("恭喜你!" + info +"-"+ way, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | new ClientTextStyleVO("很抱歉!" + info +"-"+ way, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("绑定账号", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(typeName, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | if (!StringUtil.isNullOrEmpty(reason)) {
|
| | |
| | | new ClientTextStyleVO("邀请码修改", ClientTextStyleVO.COLOR_CONTENT)));
|
| | |
|
| | | List<ClientTextStyleVO> contentList2 = new ArrayList<>();
|
| | | contentList2.add(new ClientTextStyleVO(String.format("你原邀请码:%s已经成功修改为新邀请码:", oldCode), ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList2.add(new ClientTextStyleVO(String.format("你原邀请码:%s 已经成功修改为新邀请码:", oldCode), ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList2.add(new ClientTextStyleVO(newCode, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("修改详情", ClientTextStyleVO.COLOR_TITLE),contentList2));
|
| | |
|
| | |
| | | return detail;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | /**
|
| | | * 账号解绑成功
|
| | | * |
| | | * @param uid
|
| | | * @param type
|
| | | * @return
|
| | | */
|
| | | public static MsgAccountDetail createUnBindingAccount(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))
|
| | | return null;
|
| | | MsgAccountDetail detail = new MsgAccountDetail();
|
| | | detail.setBeiZhu("无");
|
| | | detail.setContent(msg);
|
| | | detail.setTitle("解绑账号");
|
| | | detail.setType(MsgTypeAccountTypeEnum.cancelBinding);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setRead(false);
|
| | | return detail;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 账号更换成功
|
| | | * |
| | | * @param uid
|
| | | * @param type
|
| | | * @return
|
| | | */
|
| | | public static MsgAccountDetail createChangeBindingAccount(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))
|
| | | return null;
|
| | | MsgAccountDetail detail = new MsgAccountDetail();
|
| | | detail.setBeiZhu("无");
|
| | | detail.setContent(msg);
|
| | | detail.setTitle("更换绑定账号");
|
| | | detail.setType(MsgTypeAccountTypeEnum.bingdingChange);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setRead(false);
|
| | | return detail;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 账号打通
|
| | | * |
| | | * @param mainUid
|
| | | * @param lessUid
|
| | | * @return
|
| | | */
|
| | | public static MsgAccountDetail createConnectAccount(Long mainUid, Long lessUid) {
|
| | | if (mainUid == null || lessUid == null)
|
| | | return null;
|
| | | String msg = String.format("恭喜你账号合并成功,由“<highlight>%s</highlight>”合并到“<highlight>%s</highlight>”", lessUid + "",
|
| | | mainUid + "");
|
| | | MsgAccountDetail detail = new MsgAccountDetail();
|
| | | detail.setBeiZhu("无");
|
| | | detail.setContent(msg);
|
| | | detail.setTitle("账号合并");
|
| | | detail.setType(MsgTypeAccountTypeEnum.connect);
|
| | | detail.setUser(new UserInfo(mainUid));
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setRead(false);
|
| | | return detail;
|
| | | }
|
| | |
|
| | | // 账号等级
|
| | | public static MsgAccountDetail createUserRank(Long uid, String orderType, int orderCount, String rankName) {
|
| | | if (uid == null || rankName == null)
|
| | | return null;
|
| | | |
| | |
|
| | | String msg = String.format(
|
| | | "恭喜你,上月<highlight>%s</highlight>订单达到<highlight>%s</highlight>单,已为你升级为<highlight>%s</highlight>用户,将会获得对应的福利和特权。",
|
| | | orderType, orderCount + "", rankName);
|
| | | MsgAccountDetail detail = new MsgAccountDetail();
|
| | | detail.setBeiZhu("无");
|
| | | detail.setContent(msg);
|
| | | detail.setTitle("账号等级");
|
| | | detail.setType(MsgTypeAccountTypeEnum.level);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setRead(false);
|
| | | return detail;
|
| | | }
|
| | |
|
| | | // 淘宝授权失败
|
| | | public static MsgAccountDetail createTaoBaoAuthFail(Long uid, String taoBaoNickName, String reason) {
|
| | | if (uid == null || reason == null)
|
| | | return null;
|
| | |
|
| | | JSONArray msg = new JSONArray();
|
| | | JSONObject item = new JSONObject();
|
| | | item.put("name", "账号");
|
| | | item.put("content", String.format("淘宝昵称[%s]", taoBaoNickName));
|
| | | msg.add(item);
|
| | |
|
| | | item = new JSONObject();
|
| | | item.put("name", "原因");
|
| | | item.put("content", reason);
|
| | | msg.add(item);
|
| | |
|
| | | MsgAccountDetail detail = new MsgAccountDetail();
|
| | | detail.setBeiZhu("无");
|
| | | detail.setContent(msg.toString());
|
| | | detail.setTitle("淘宝账号授权失败");
|
| | | detail.setType(MsgTypeAccountTypeEnum.taoBaoAuthFail);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setRead(false);
|
| | | return detail;
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | /**
|
| | | * 普通会员、高级会员自动提升
|
| | |
| | | * @return
|
| | | */
|
| | | public static MsgAccountDetail vipPreUpgrade(Long uid, String originalName, String upName, int days, long targetNum1,
|
| | | Long targetNum2, Integer type, String beizu) {
|
| | | Long targetNum2) {
|
| | | 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) {
|
| | | if (targetNum2 == 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));
|
| | | } else {
|
| | | contentList.add(new ClientTextStyleVO("返利+分享订单已达", ClientTextStyleVO.COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO(targetNum1+"", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("笔", ClientTextStyleVO.COLOR_CONTENT));
|
| | | }
|
| | |
| | | new ClientTextStyleVO("从收到本消息起,你将获得该账户等级对应的全部权益", ClientTextStyleVO.COLOR_CONTENT)));
|
| | |
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(StringUtil.isNullOrEmpty(beizu)?"无":beizu, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | new ClientTextStyleVO("无", ClientTextStyleVO.COLOR_CONTENT)));
|
| | |
|
| | | MsgAccountDetail detail = new MsgAccountDetail();
|
| | | detail.setBeiZhu(beizu);
|
| | | detail.setTitle("等级成长");
|
| | | detail.setType(MsgTypeAccountTypeEnum.vipPgrade);
|
| | | detail.setUser(new UserInfo(uid));
|
| | |
| | | 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)));
|
| | | 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),
|
| | |
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("邀约原因", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("从收到本消息起,你将获得该账户等级对应的全部权益", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("专属客服", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(kefuName + "-微信号:" +kefuWX, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | new ClientTextStyleVO(kefuName + "-微信号:" +kefuWX, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("与你共创辉煌", ClientTextStyleVO.COLOR_CONTENT)));
|
| | |
|