Merge remote-tracking branch 'origin/div' into div
| | |
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.Scanner;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.crypto.Mac;
|
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | | import org.springframework.web.multipart.MultipartHttpServletRequest;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | | import org.yeshi.utils.wx.WXUtil;
|
| | |
|
| | |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.dto.mq.order.OrderTopicTagEnum;
|
| | | import com.yeshi.fanli.dto.mq.order.body.BanLiShopOrderMQMsg;
|
| | | import com.yeshi.fanli.dto.push.PushContentDTO;
|
| | | import com.yeshi.fanli.entity.bus.activity.ActivityRuleUser;
|
| | | import com.yeshi.fanli.entity.bus.activity.ActivityUser;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgDeviceReadState;
|
| | | import com.yeshi.fanli.entity.config.push.PushMsgFactory;
|
| | | import com.yeshi.fanli.entity.dynamic.ImgInfo;
|
| | | import com.yeshi.fanli.entity.dynamic.ImgInfo.ImgEnum;
|
| | | import com.yeshi.fanli.entity.dynamic.SimpleGoods;
|
| | |
| | | import com.yeshi.fanli.entity.shop.BanLiShopOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.exception.dynamic.GoodsEvaluateException;
|
| | | import com.yeshi.fanli.exception.push.PushException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.activity.ActivityUserService;
|
| | |
| | | String uid = json.optJSONObject("customizedData").optString("用户ID");
|
| | | msgDeviceReadStateService.addUnreadDeviceMsg(MsgDeviceReadState.TYPE_KEFU, customizedId,
|
| | | "android".equalsIgnoreCase(deviceOS) ? 1 : 2, 1, msg, new Date());
|
| | | if (!StringUtil.isNullOrEmpty(uid))// 推送客服消息
|
| | | {
|
| | | PushContentDTO dto = PushMsgFactory.createMsgKefu();
|
| | | try {
|
| | | pushService.pushZNX(Long.parseLong(uid), dto.getTitle(), dto.getContent(), null, null);
|
| | | } catch (NumberFormatException e) {
|
| | | e.printStackTrace();
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | JSONObject data = JSONObject.fromObject(contentDecode).optJSONObject("data");
|
| | |
|
| | | JSONArray array = data.optJSONObject("recommend").optJSONArray("resultList");
|
| | | for (int i = array.size()-1; i >=0; i--) {
|
| | | for (int i = array.size() - 1; i >= 0; i--) {
|
| | | JSONObject item = array.optJSONObject(i);
|
| | | String title = item.optString("itemName");
|
| | | String doc = item.optString("cusShareText");
|
| | | long itemId = item.optLong("itemId");
|
| | | String publishTime=item.optString("cusPublishTime");
|
| | | String publishTime = item.optString("cusPublishTime");
|
| | | JSONArray imageArray = item.optJSONArray("imageList");
|
| | | List<String> imgList = new ArrayList<>();
|
| | | for (int j = 0; j < imageArray.size(); j++) {
|
| | |
| | | if (vipInfo != null && vipInfo.getState() == UserVIPInfo.STATE_SUCCESS)
|
| | | time = vipInfo.getSuccessTime();
|
| | |
|
| | | } else if (level == UserLevelEnum.highVIP || level == UserLevelEnum.normalVIP) {
|
| | | } else if (level == UserLevelEnum.highVIP) {
|
| | | UserVIPPreInfo info = userVIPPreInfoService.selectByUidAndProcess(uid, level.getLevel());
|
| | | if (info != null)
|
| | | time = info.getCreateTime();
|
| | |
| | |
|
| | | public enum UserLevelEnum {
|
| | | daRen(0, 0, "快省达人", "actived", "http://apph5.banliapp.com/AppInside/vipNew/supvip.html"),
|
| | | normalVIP(3, 30, "普通会员", "vipPre1", "http://apph5.banliapp.com/AppInside/vipNew/supvip.html"),
|
| | | highVIP(7, 70, "高级会员", "vipPre2", "http://apph5.banliapp.com/AppInside/vipNew/supvip.html"),
|
| | | superVIP(10, 100, "超级会员", "vip", "http://apph5.banliapp.com/AppInside/vipNew/supvip.html"),
|
| | | tearcher(11, 101, "资深导师", "tearcher", "http://apph5.banliapp.com/AppInside/vipNew/supvip.html");
|
| | |
| | | @Map("money_invite_recieved_msg")
|
| | | private String moneyInviteRecievedMsg;
|
| | |
|
| | | // 团队分红
|
| | | @Map("money_team_dividents_recieved_title")
|
| | | private String moneyTeamDividentsRecievedTitle;
|
| | |
|
| | | @Map("money_team_dividents_recieved_msg")
|
| | | private String moneyTeamDividentsRecievedMsg;
|
| | |
|
| | | // 导师津贴
|
| | | @Map("money_tearcher_subsidy_recieved_title")
|
| | | private String moneyTearcherSubsidyRecievedTitle;
|
| | |
|
| | | @Map("money_tearcher_subsidy_recieved_msg")
|
| | | private String moneyTearcherSubsidyRecievedMsg;
|
| | |
|
| | | // 系统补齐
|
| | | @Map("money_system_compensate_title")
|
| | | private String moneySystemCompensateTitle;
|
| | | @Map("money_system_compensate_msg")
|
| | | private String moneySystemCompensateMsg;
|
| | | // 系统扣除
|
| | | @Map("money_system_sub_title")
|
| | | private String moneySystemSubTitle;
|
| | | @Map("money_system_sub_msg")
|
| | | private String moneySystemSubMsg;
|
| | | // 系统奖励
|
| | | @Map("money_system_reward_title")
|
| | | private String moneySystemRewardTitle;
|
| | | @Map("money_system_reward_msg")
|
| | | private String moneySystemRewardMsg;
|
| | | // 维权扣除
|
| | | @Map("money_weiquan_title")
|
| | | private String moneyWeiquanTitle;
|
| | | @Map("money_weiquan_msg")
|
| | | private String moneyWeiquanMsg;
|
| | |
|
| | | // 提现成功
|
| | | @Map("money_extract_success_title")
|
| | | private String moneyExtractSuccessTitle;
|
| | | @Map("money_extract_success_msg")
|
| | | private String moneyExtractSuccessMsg;
|
| | | // 提现失败
|
| | | @Map("money_extract_fail_title")
|
| | | private String moneyExtractFailTitle;
|
| | | @Map("money_extract_fail_msg")
|
| | | private String moneyExtractFailMsg;
|
| | | // 现金红包
|
| | | @Map("hongbao_recieved_title")
|
| | | private String hongbaoRecievedTitle;
|
| | | @Map("hongbao_recieved_msg")
|
| | | private String hongbaoRecievedMsg;
|
| | | // 支付宝账号验证
|
| | | @Map("alipay_account_valid_title")
|
| | | private String alipayAccountValidTitle;
|
| | | @Map("alipay_account_valid_msg")
|
| | | private String alipayAccountValidMsg;
|
| | | // 积分兑换成功
|
| | | @Map("score_exchange_success_title")
|
| | | private String scoreExchangeSuccessTitle;
|
| | | @Map("score_exchange_success_msg")
|
| | | private String scoreExchangeSuccessMsg;
|
| | | // 积分兑换失败
|
| | | @Map("score_exchange_fail_title")
|
| | | private String scoreExchangeFailTitle;
|
| | | @Map("score_exchange_fail_msg")
|
| | | private String scoreExchangeFailMsg;
|
| | | // 功能开通成功
|
| | | @Map("function_get_success_title")
|
| | | private String functionGetSuccessTitle;
|
| | | @Map("function_get_success_msg")
|
| | | private String functionGetSuccessMsg;
|
| | | // 功能开通失败
|
| | | @Map("function_get_fail_title")
|
| | | private String functionGetFailTitle;
|
| | | @Map("function_get_fail_msg")
|
| | | private String functionGetFailMsg;
|
| | |
|
| | | // 邀请队员成功
|
| | | @Map("invite_team_success_title")
|
| | | private String inviteTeamSuccessTitle;
|
| | | @Map("invite_team_success_msg")
|
| | | private String inviteTeamSuccessMsg;
|
| | | // 客服唤起
|
| | | @Map("msg_kefu_title")
|
| | | private String msgKefuTitle;
|
| | | @Map("msg_kefu_msg")
|
| | | private String msgKefuMsg;
|
| | |
|
| | | public String getMoneyTeamDividentsRecievedTitle() {
|
| | | return moneyTeamDividentsRecievedTitle;
|
| | | }
|
| | |
|
| | | public void setMoneyTeamDividentsRecievedTitle(String moneyTeamDividentsRecievedTitle) {
|
| | | this.moneyTeamDividentsRecievedTitle = moneyTeamDividentsRecievedTitle;
|
| | | }
|
| | |
|
| | | public String getMoneyTeamDividentsRecievedMsg() {
|
| | | return moneyTeamDividentsRecievedMsg;
|
| | | }
|
| | |
|
| | | public void setMoneyTeamDividentsRecievedMsg(String moneyTeamDividentsRecievedMsg) {
|
| | | this.moneyTeamDividentsRecievedMsg = moneyTeamDividentsRecievedMsg;
|
| | | }
|
| | |
|
| | | public String getMoneyTearcherSubsidyRecievedTitle() {
|
| | | return moneyTearcherSubsidyRecievedTitle;
|
| | | }
|
| | |
|
| | | public void setMoneyTearcherSubsidyRecievedTitle(String moneyTearcherSubsidyRecievedTitle) {
|
| | | this.moneyTearcherSubsidyRecievedTitle = moneyTearcherSubsidyRecievedTitle;
|
| | | }
|
| | |
|
| | | public String getMoneyTearcherSubsidyRecievedMsg() {
|
| | | return moneyTearcherSubsidyRecievedMsg;
|
| | | }
|
| | |
|
| | | public void setMoneyTearcherSubsidyRecievedMsg(String moneyTearcherSubsidyRecievedMsg) {
|
| | | this.moneyTearcherSubsidyRecievedMsg = moneyTearcherSubsidyRecievedMsg;
|
| | | }
|
| | |
|
| | | public String getFanliOrderStatisticedTitle() {
|
| | | return fanliOrderStatisticedTitle;
|
| | |
| | | this.moneySystemCompensateMsg = moneySystemCompensateMsg;
|
| | | }
|
| | |
|
| | | public String getMoneySystemSubTitle() {
|
| | | return moneySystemSubTitle;
|
| | | }
|
| | |
|
| | | public void setMoneySystemSubTitle(String moneySystemSubTitle) {
|
| | | this.moneySystemSubTitle = moneySystemSubTitle;
|
| | | }
|
| | |
|
| | | public String getMoneySystemSubMsg() {
|
| | | return moneySystemSubMsg;
|
| | | }
|
| | |
|
| | | public void setMoneySystemSubMsg(String moneySystemSubMsg) {
|
| | | this.moneySystemSubMsg = moneySystemSubMsg;
|
| | | }
|
| | |
|
| | | public String getMoneySystemRewardTitle() {
|
| | | return moneySystemRewardTitle;
|
| | | }
|
| | |
|
| | | public void setMoneySystemRewardTitle(String moneySystemRewardTitle) {
|
| | | this.moneySystemRewardTitle = moneySystemRewardTitle;
|
| | | }
|
| | |
|
| | | public String getMoneySystemRewardMsg() {
|
| | | return moneySystemRewardMsg;
|
| | | }
|
| | |
|
| | | public void setMoneySystemRewardMsg(String moneySystemRewardMsg) {
|
| | | this.moneySystemRewardMsg = moneySystemRewardMsg;
|
| | | }
|
| | |
|
| | | public String getMoneyWeiquanTitle() {
|
| | | return moneyWeiquanTitle;
|
| | | }
|
| | |
|
| | | public void setMoneyWeiquanTitle(String moneyWeiquanTitle) {
|
| | | this.moneyWeiquanTitle = moneyWeiquanTitle;
|
| | | }
|
| | |
|
| | | public String getMoneyWeiquanMsg() {
|
| | | return moneyWeiquanMsg;
|
| | | }
|
| | |
|
| | | public void setMoneyWeiquanMsg(String moneyWeiquanMsg) {
|
| | | this.moneyWeiquanMsg = moneyWeiquanMsg;
|
| | | }
|
| | |
|
| | | public String getMoneyExtractSuccessTitle() {
|
| | | return moneyExtractSuccessTitle;
|
| | | }
|
| | |
| | | this.moneyExtractSuccessMsg = moneyExtractSuccessMsg;
|
| | | }
|
| | |
|
| | | public String getMoneyExtractFailTitle() {
|
| | | return moneyExtractFailTitle;
|
| | | }
|
| | |
|
| | | public void setMoneyExtractFailTitle(String moneyExtractFailTitle) {
|
| | | this.moneyExtractFailTitle = moneyExtractFailTitle;
|
| | | }
|
| | |
|
| | | public String getMoneyExtractFailMsg() {
|
| | | return moneyExtractFailMsg;
|
| | | }
|
| | |
|
| | | public void setMoneyExtractFailMsg(String moneyExtractFailMsg) {
|
| | | this.moneyExtractFailMsg = moneyExtractFailMsg;
|
| | | }
|
| | |
|
| | | public String getHongbaoRecievedTitle() {
|
| | | return hongbaoRecievedTitle;
|
| | | }
|
| | |
|
| | | public void setHongbaoRecievedTitle(String hongbaoRecievedTitle) {
|
| | | this.hongbaoRecievedTitle = hongbaoRecievedTitle;
|
| | | }
|
| | |
|
| | | public String getHongbaoRecievedMsg() {
|
| | | return hongbaoRecievedMsg;
|
| | | }
|
| | |
|
| | | public void setHongbaoRecievedMsg(String hongbaoRecievedMsg) {
|
| | | this.hongbaoRecievedMsg = hongbaoRecievedMsg;
|
| | | }
|
| | |
|
| | | public String getAlipayAccountValidTitle() {
|
| | | return alipayAccountValidTitle;
|
| | | }
|
| | |
|
| | | public void setAlipayAccountValidTitle(String alipayAccountValidTitle) {
|
| | | this.alipayAccountValidTitle = alipayAccountValidTitle;
|
| | | }
|
| | |
|
| | | public String getAlipayAccountValidMsg() {
|
| | | return alipayAccountValidMsg;
|
| | | }
|
| | |
|
| | | public void setAlipayAccountValidMsg(String alipayAccountValidMsg) {
|
| | | this.alipayAccountValidMsg = alipayAccountValidMsg;
|
| | | }
|
| | |
|
| | | public String getScoreExchangeSuccessTitle() {
|
| | | return scoreExchangeSuccessTitle;
|
| | | }
|
| | |
|
| | | public void setScoreExchangeSuccessTitle(String scoreExchangeSuccessTitle) {
|
| | | this.scoreExchangeSuccessTitle = scoreExchangeSuccessTitle;
|
| | | }
|
| | |
|
| | | public String getScoreExchangeSuccessMsg() {
|
| | | return scoreExchangeSuccessMsg;
|
| | | }
|
| | |
|
| | | public void setScoreExchangeSuccessMsg(String scoreExchangeSuccessMsg) {
|
| | | this.scoreExchangeSuccessMsg = scoreExchangeSuccessMsg;
|
| | | }
|
| | |
|
| | | public String getScoreExchangeFailTitle() {
|
| | | return scoreExchangeFailTitle;
|
| | | }
|
| | |
|
| | | public void setScoreExchangeFailTitle(String scoreExchangeFailTitle) {
|
| | | this.scoreExchangeFailTitle = scoreExchangeFailTitle;
|
| | | }
|
| | |
|
| | | public String getScoreExchangeFailMsg() {
|
| | | return scoreExchangeFailMsg;
|
| | | }
|
| | |
|
| | | public void setScoreExchangeFailMsg(String scoreExchangeFailMsg) {
|
| | | this.scoreExchangeFailMsg = scoreExchangeFailMsg;
|
| | | }
|
| | |
|
| | | public String getFunctionGetSuccessTitle() {
|
| | | return functionGetSuccessTitle;
|
| | | }
|
| | |
|
| | | public void setFunctionGetSuccessTitle(String functionGetSuccessTitle) {
|
| | | this.functionGetSuccessTitle = functionGetSuccessTitle;
|
| | | }
|
| | |
|
| | | public String getFunctionGetSuccessMsg() {
|
| | | return functionGetSuccessMsg;
|
| | | }
|
| | |
|
| | | public void setFunctionGetSuccessMsg(String functionGetSuccessMsg) {
|
| | | this.functionGetSuccessMsg = functionGetSuccessMsg;
|
| | | }
|
| | |
|
| | | public String getFunctionGetFailTitle() {
|
| | | return functionGetFailTitle;
|
| | | }
|
| | |
|
| | | public void setFunctionGetFailTitle(String functionGetFailTitle) {
|
| | | this.functionGetFailTitle = functionGetFailTitle;
|
| | | }
|
| | |
|
| | | public String getFunctionGetFailMsg() {
|
| | | return functionGetFailMsg;
|
| | | }
|
| | |
|
| | | public void setFunctionGetFailMsg(String functionGetFailMsg) {
|
| | | this.functionGetFailMsg = functionGetFailMsg;
|
| | | }
|
| | |
|
| | | public String getInviteTeamSuccessTitle() {
|
| | | return inviteTeamSuccessTitle;
|
| | | }
|
| | |
| | |
|
| | | public void setInviteTeamSuccessMsg(String inviteTeamSuccessMsg) {
|
| | | this.inviteTeamSuccessMsg = inviteTeamSuccessMsg;
|
| | | }
|
| | |
|
| | | public String getMsgKefuTitle() {
|
| | | return msgKefuTitle;
|
| | | }
|
| | |
|
| | | public void setMsgKefuTitle(String msgKefuTitle) {
|
| | | this.msgKefuTitle = msgKefuTitle;
|
| | | }
|
| | |
|
| | | public String getMsgKefuMsg() {
|
| | | return msgKefuMsg;
|
| | | }
|
| | |
|
| | | public void setMsgKefuMsg(String msgKefuMsg) {
|
| | | this.msgKefuMsg = msgKefuMsg;
|
| | | }
|
| | |
|
| | | public String getMoneyInviteRecievedTitle() {
|
| | |
| | | String title = Constant.znxConfig.getShareOrderStatisticedTitle();
|
| | | String content = Constant.znxConfig.getShareOrderStatisticedMsg();
|
| | | content = content.replace("[订单类型]", Constant.getSourceName(sourceType))
|
| | | .replace("[订单号]",UserUtil.filterOrderId(orderId))
|
| | | .replace("[金额]", money.toString());
|
| | | .replace("[订单号]", UserUtil.filterOrderId(orderId)).replace("[金额]", money.toString());
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | |
| | | String title = Constant.znxConfig.getInviteOrderStatisticedTitle();
|
| | | String content = Constant.znxConfig.getInviteOrderStatisticedMsg();
|
| | | content = content.replace("[订单类型]", Constant.getSourceName(sourceType))
|
| | | .replace("[订单号]",UserUtil.filterOrderId(orderId))
|
| | | .replace("[金额]", money.toString());
|
| | | .replace("[订单号]", UserUtil.filterOrderId(orderId)).replace("[金额]", money.toString());
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 团队分红
|
| | | * @Title: createMoneyTeamDividents
|
| | | * @Description: |
| | | * @param sourceType
|
| | | * @param money
|
| | | * @return |
| | | * PushContentDTO 返回类型
|
| | | * @throws
|
| | | */
|
| | | public static PushContentDTO createMoneyTeamDividents(BigDecimal money) {
|
| | | String title = Constant.znxConfig.getMoneyTeamDividentsRecievedTitle();
|
| | | String content = Constant.znxConfig.getMoneyTeamDividentsRecievedMsg();
|
| | | content = content.replace("[金额]", money.toString());
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 系统补齐
|
| | | *
|
| | | * @param reason
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 系统扣除
|
| | | * @param reason
|
| | | * @param money
|
| | | * @return
|
| | | */
|
| | | public static PushContentDTO createMoneySystemSub(String reason, BigDecimal money) {
|
| | | String title = Constant.znxConfig.getMoneySystemSubTitle();
|
| | | String content = Constant.znxConfig.getMoneySystemSubMsg();
|
| | | content = content.replace("[原因]", reason).replace("[金额]", money.toString());
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 系统奖励
|
| | | * @param reason
|
| | | * @param money
|
| | | * @return
|
| | | */
|
| | | public static PushContentDTO createMoneySystemReward(String reason, BigDecimal money) {
|
| | | String title = Constant.znxConfig.getMoneySystemRewardTitle();
|
| | | String content = Constant.znxConfig.getMoneySystemRewardMsg();
|
| | | content = content.replace("[原因]", reason).replace("[金额]", money.toString());
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 返利维权扣除
|
| | | * |
| | | * @param sourceType
|
| | | * @param orderId
|
| | | * @param part-是否为部分维权
|
| | | * @param money
|
| | | * @return
|
| | | */
|
| | | public static PushContentDTO createMoneyOrderFanLiWeiquan(int sourceType, String orderId, boolean part,
|
| | | BigDecimal money) {
|
| | | String title = Constant.znxConfig.getMoneyWeiquanTitle();
|
| | | String content = Constant.znxConfig.getMoneyWeiquanMsg();
|
| | | content = content.replace("[订单类型]", Constant.getSourceName(sourceType)).replace("[订单号]", orderId)
|
| | | .replace("[部分]", part ? "部分" : "").replace("[金额]", money.toString());
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 分享或邀请维权扣除
|
| | | * |
| | | * @param sourceType
|
| | | * @param orderId
|
| | | * @param part
|
| | | * @param money
|
| | | * @return
|
| | | */
|
| | |
|
| | | public static PushContentDTO createMoneyOrderShareOrInviteWeiquan(int sourceType, String orderId, boolean part,
|
| | | BigDecimal money) {
|
| | | String title = Constant.znxConfig.getMoneyWeiquanTitle();
|
| | | String content = Constant.znxConfig.getMoneyWeiquanMsg();
|
| | | content = content.replace("[订单类型]", Constant.getSourceName(sourceType))
|
| | | .replace("[订单号]", UserUtil.filterOrderId(orderId))
|
| | | .replace("[部分]", part ? "部分" : "").replace("[金额]", money.toString());
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 提现成功
|
| | | * @param applyTime
|
| | | * @param money
|
| | |
| | | String title = Constant.znxConfig.getMoneyExtractSuccessTitle();
|
| | | String content = Constant.znxConfig.getMoneyExtractSuccessMsg();
|
| | | content = content.replace("[提现时间]", TimeUtil.getGernalTime(applyTime.getTime(), "yyyy.MM.dd HH:mm"))
|
| | | .replace("[支付宝账号]",UserUtil.filterAlipayAccount(alipayAccount)).replace("[金额]", money.toString());
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 提现失败
|
| | | * @param applyTime
|
| | | * @param money
|
| | | * @param alipayAccount
|
| | | * @return
|
| | | */
|
| | | public static PushContentDTO createmoneyExtractFail(Date applyTime, BigDecimal money, String alipayAccount) {
|
| | | String title = Constant.znxConfig.getMoneyExtractFailTitle();
|
| | | String content = Constant.znxConfig.getMoneyExtractFailMsg();
|
| | | content = content.replace("[提现时间]", TimeUtil.getGernalTime(applyTime.getTime(), "yyyy.MM.dd HH:mm"))
|
| | | .replace("[支付宝账号]", UserUtil.filterAlipayAccount(alipayAccount)).replace("[金额]", money.toString());
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 现金红包
|
| | | * @param reason
|
| | | * @param money
|
| | | * @return
|
| | | */
|
| | | public static PushContentDTO createHongbaoRecieved(String reason, BigDecimal money) {
|
| | | String title = Constant.znxConfig.getHongbaoRecievedTitle();
|
| | | String content = Constant.znxConfig.getHongbaoRecievedMsg();
|
| | | content = content.replace("[原因]", reason).replace("[金额]", money.toString());
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 支付宝账号验证
|
| | | * @param alipayAccount
|
| | | * @param money
|
| | | * @return
|
| | | */
|
| | | public static PushContentDTO createAlipayAccountValid(String alipayAccount, BigDecimal money) {
|
| | | String title = Constant.znxConfig.getAlipayAccountValidTitle();
|
| | | String content = Constant.znxConfig.getAlipayAccountValidMsg();
|
| | | content = content.replace("[支付宝账号]", UserUtil.filterAlipayAccount(alipayAccount)).replace("[金额]", money.toString());
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 积分兑换成功
|
| | | * @param reason
|
| | | * @param time
|
| | | * @return
|
| | | */
|
| | | public static PushContentDTO createScoreExchangeSuccess(Date time, int score) {
|
| | | String title = Constant.znxConfig.getScoreExchangeSuccessTitle();
|
| | | String content = Constant.znxConfig.getScoreExchangeSuccessMsg();
|
| | | content = content.replace("[时间]", TimeUtil.getGernalTime(time.getTime(), "yyyy.MM.dd HH:mm")).replace("[积分数额]",
|
| | | score + "");
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 积分兑换失败
|
| | | * @param reason
|
| | | * @param time
|
| | | * @return
|
| | | */
|
| | | public static PushContentDTO createScoreExchangeFail(String reason, Date time) {
|
| | | String title = Constant.znxConfig.getScoreExchangeFailTitle();
|
| | | String content = Constant.znxConfig.getScoreExchangeFailMsg();
|
| | | content = content.replace("[时间]", TimeUtil.getGernalTime(time.getTime(), "yyyy.MM.dd HH:mm")).replace("[原因]",
|
| | | reason);
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 功能开通成功
|
| | | * @param functionName
|
| | | * @return
|
| | | */
|
| | | public static PushContentDTO createFunctionGetSuccess(String functionName) {
|
| | | String title = Constant.znxConfig.getFunctionGetSuccessTitle();
|
| | | String content = Constant.znxConfig.getFunctionGetSuccessMsg();
|
| | | content = content.replace("[增值功能]", functionName);
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 功能开通失败
|
| | | * @param functionName
|
| | | * @return
|
| | | */
|
| | | public static PushContentDTO createFunctionGetFail(String functionName) {
|
| | | String title = Constant.znxConfig.getFunctionGetFailTitle();
|
| | | String content = Constant.znxConfig.getFunctionGetFailMsg();
|
| | | content = content.replace("[增值功能]", functionName);
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | |
| | | String content = Constant.znxConfig.getInviteTeamSuccessMsg();
|
| | | content = content.replace("[时间]", TimeUtil.getGernalTime(time.getTime(), "yyyy.MM.dd HH:mm")).replace("[队员昵称]",
|
| | | nickName);
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 客服唤起
|
| | | * @return
|
| | | */
|
| | | public static PushContentDTO createMsgKefu() {
|
| | | String title = Constant.znxConfig.getMsgKefuTitle();
|
| | | String content = Constant.znxConfig.getMsgKefuMsg();
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | |
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.elme.ElmeOrder;
|
| | | import com.yeshi.fanli.exception.elme.ElmeOrderException;
|
| | | import com.yeshi.fanli.service.inter.elme.ElmeOrderProcessService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderProcessService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.elme.ElmeOrderUtil;
|
| | |
|
| | | //饿了么爬单,到账
|
| | | //旧版饿了么到账
|
| | | @Component
|
| | | public class UpdateElmeOrderJob {
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private OrderProcessService orderProcessService;
|
| | |
|
| | | /**
|
| | | * 更新订单(每天早上凌晨0点,下午4点)
|
| | | */
|
| | | @Scheduled(cron = "0 0 0,16 * * ? ")
|
| | | public void updateOrder() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | try {
|
| | | List<ElmeOrder> orderList = ElmeOrderUtil.pullLatest5DayOrder();
|
| | | try {
|
| | | for (ElmeOrder order : orderList)
|
| | | elmeOrderProcessService.processOrder(order);
|
| | | } catch (ElmeOrderException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | // 每天凌晨过2分到账
|
| | | @Scheduled(cron = "0 2 0 * * ? ")
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.scheduling.annotation.Scheduled;
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import com.xxl.job.core.biz.model.ReturnT;
|
| | |
| | | import com.yeshi.fanli.exception.jd.JDOrderException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.order.jd.JDOrderService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisKeyEnum;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | | /**
|
| | | * 快速订单更新(爬取本小时内的单,每分钟一次)
|
| | | */
|
| | | @XxlJob("updateJDSoonOrderHandler")
|
| | | public ReturnT<String> startPreDividents(String param) throws Exception {
|
| | | @XxlJob("updateJDOrderHandler")
|
| | | public ReturnT<String> updateJDSoonOrder(String param) throws Exception {
|
| | | if ("1".equalsIgnoreCase(param)) {//更新本小时内的单
|
| | | LogHelper.job("开始爬取京东订单");
|
| | | long now = System.currentTimeMillis();
|
| | |
|
| | | LogHelper.job("开始爬取京东订单");
|
| | | long now = System.currentTimeMillis();
|
| | |
|
| | | JDOrderResult result = JDApiUtil.getOrderList(1, 200, new Date(now), JDApiUtil.ORDER_TYPE_CREATETIME);
|
| | | if (result != null && result.getOrderList() != null)
|
| | | saveJDOrders(result.getOrderList());
|
| | | // 查询上个小时的
|
| | | result = JDApiUtil.getOrderList(1, 200, new Date(now - 1000 * 60 * 60L), JDApiUtil.ORDER_TYPE_CREATETIME);
|
| | | if (result != null && result.getOrderList() != null)
|
| | | saveJDOrders(result.getOrderList());
|
| | | JDOrderResult result = JDApiUtil.getOrderList(1, 200, new Date(now), JDApiUtil.ORDER_TYPE_CREATETIME);
|
| | | if (result != null && result.getOrderList() != null)
|
| | | saveJDOrders(result.getOrderList());
|
| | | // 查询上个小时的
|
| | | result = JDApiUtil.getOrderList(1, 200, new Date(now - 1000 * 60 * 60L), JDApiUtil.ORDER_TYPE_CREATETIME);
|
| | | if (result != null && result.getOrderList() != null)
|
| | | saveJDOrders(result.getOrderList());
|
| | | } else if ("1hour".equalsIgnoreCase(param)) {// 更新1小时内的订单
|
| | | updateUpdateOrder();
|
| | | } else if ("3day".equalsIgnoreCase(param)) {// 更新最近3天更新的数据
|
| | | updateLatest3DayOrder();
|
| | | }
|
| | |
|
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | |
| | | /**
|
| | | * 爬取最近一小时内的状态更新了的单(10分钟一次)
|
| | | */
|
| | | @Scheduled(cron = "0 0/10 * * * ? ")
|
| | |
|
| | | public void updateUpdateOrder() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | List<JDOrder> jdOrderList = new ArrayList<>();
|
| | | int pageSize = 200;
|
| | | int page = 1;
|
| | |
| | | /**
|
| | | * 更新最近3天的订单(每天早上凌晨0点过10分,早上8点过10分)
|
| | | */
|
| | | @Scheduled(cron = "0 10 0,8 * * ? ")
|
| | | public void updateLatest3DayOrder() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | Date now = new Date();
|
| | | for (int i = 1; i < 4; i++) {
|
| | | updateDayOrder(new Date(now.getTime() - 1000 * 60 * 60 * 24L * i));
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.scheduling.annotation.Scheduled;
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import com.xxl.job.core.biz.model.ReturnT;
|
| | | import com.xxl.job.core.handler.annotation.XxlJob;
|
| | | import com.yeshi.fanli.dto.pdd.PDDOrderResult;
|
| | | import com.yeshi.fanli.entity.pdd.PDDOrder;
|
| | | import com.yeshi.fanli.exception.pdd.PDDOrderException;
|
| | | import com.yeshi.fanli.service.inter.order.pdd.PDDOrderService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisKeyEnum;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.cmq.order.PDDOrderCMQManager;
|
| | |
| | | /**
|
| | | * 做频率限制
|
| | | */
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.PDDOrder, order.getOrderSn() + "" );
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.PDDOrder, order.getOrderSn() + "");
|
| | | String result = redisManager.getCommonString(key);
|
| | | // if (!StringUtil.isNullOrEmpty(result))
|
| | | // continue;
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 拼多多订单爬取
|
| | | */
|
| | | @XxlJob("updatePDDOrderHandler")
|
| | | public ReturnT<String> updatePDDOrder(String param) throws Exception {
|
| | | if ("1".equalsIgnoreCase(param)) {// 更新本小时内的单
|
| | | updateSoonOrder();
|
| | | } else if ("1day".equalsIgnoreCase(param)) {// 爬取最近1天的订单(30分钟一次)
|
| | | updateUpdateOrder();
|
| | | }
|
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 快速订单更新(爬取本小时内的单,每分钟一次)
|
| | | */
|
| | | @Scheduled(cron = "0 0/1 * * * ? ")
|
| | | // @Scheduled(cron = "0 0/1 * * * ? ")
|
| | | public void updateSoonOrder() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | Date now = null;
|
| | | now = PinDuoDuoApiUtil.getSystemTime();
|
| | | if (now == null)
|
| | |
| | | /**
|
| | | * 爬取最近1天的订单(30分钟一次)
|
| | | */
|
| | | @Scheduled(cron = "0 0/30 * * * ? ")
|
| | | // @Scheduled(cron = "0 0/30 * * * ? ")
|
| | | public void updateUpdateOrder() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | long endTime = System.currentTimeMillis() - 1000 * 60 * 60L;
|
| | | long startTime = System.currentTimeMillis() - 1000 * 60 * 60 * 24L;
|
| | | int page = 1;
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.scheduling.annotation.Scheduled;
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import com.xxl.job.core.biz.model.ReturnT;
|
| | |
| | | * @return
|
| | | */
|
| | | private static List<TaoBaoOrder> getCommonOrder(long startTime, int span) {
|
| | | List<TaoBaoOrder> totalList = new ArrayList<>();
|
| | | List<TaoBaoOrder> orderList = TaoKeOrderApiUtil.getTaoBaoCommonOrderList(startTime, startTime + span * 1000L,
|
| | | 1);
|
| | | return orderList;
|
| | | if (orderList != null && orderList.size() > 0)
|
| | | totalList.addAll(orderList);
|
| | |
|
| | | orderList = TaoKeOrderApiUtil.getTaoBaoCommonOrderList(startTime, startTime + span * 1000L, 2);
|
| | | if (orderList != null && orderList.size() > 0)
|
| | | totalList.addAll(orderList);
|
| | |
|
| | | orderList = TaoKeOrderApiUtil.getTaoBaoCommonOrderList(startTime, startTime + span * 1000L, 3);
|
| | | if (orderList != null && orderList.size() > 0)
|
| | | totalList.addAll(orderList);
|
| | | // 移除重复交易号的订单
|
| | |
|
| | | return totalList;
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | * @return
|
| | | */
|
| | | public static List<TaoBaoOrder> getCommonOrder(long startTime, long endTime) {
|
| | | List<TaoBaoOrder> totalList = new ArrayList<>();
|
| | | List<TaoBaoOrder> orderList = TaoKeOrderApiUtil.getTaoBaoCommonOrderList(startTime, endTime, 1);
|
| | | return orderList;
|
| | | if (orderList != null && orderList.size() > 0)
|
| | | totalList.addAll(orderList);
|
| | |
|
| | | orderList = TaoKeOrderApiUtil.getTaoBaoCommonOrderList(startTime, endTime, 2);
|
| | | if (orderList != null && orderList.size() > 0)
|
| | | totalList.addAll(orderList);
|
| | |
|
| | | orderList = TaoKeOrderApiUtil.getTaoBaoCommonOrderList(startTime, endTime, 3);
|
| | | if (orderList != null && orderList.size() > 0)
|
| | | totalList.addAll(orderList);
|
| | | // 移除重复交易号的订单
|
| | |
|
| | | return totalList;
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | // 每15分钟爬取一次
|
| | | @Scheduled(cron = "0 0/15 * * * ? ")
|
| | | public void pullCommonOrder() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | LogHelper.job("正在执行15min订单爬取");
|
| | | long currentTime = System.currentTimeMillis() - 1000 * 60;
|
| | | String h = TimeUtil.getGernalTime(currentTime, "HH");
|
| | | String m = TimeUtil.getGernalTime(currentTime, "mm");
|
| | | int mm = Integer.parseInt(h) * 60 + Integer.parseInt(m);
|
| | | int pos = mm / 15;
|
| | | if (pos >= 90)
|
| | | pos = 89;
|
| | | long startTime = TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(currentTime, "yyyy-MM-dd"), "yyyy-MM-dd")
|
| | | - (1000 * 60 * 60 * 24L * (90 - pos));
|
| | | long endTime = startTime + 1000 * 60 * 60 * 24L;
|
| | |
|
| | | updateOrder(startTime, endTime);
|
| | | @XxlJob("updateTaoBaoCommonOrderHandler")
|
| | | public ReturnT<String> updateTaoBaoCommonOrder(String param) throws Exception {
|
| | | if ("1".equalsIgnoreCase(param)) {// 更新近20分钟内的单
|
| | | pullLatestCommonOrder();
|
| | | } else if ("1day".equalsIgnoreCase(param)) {// 爬取最近1天的订单(30分钟一次)
|
| | | pullLatestDayCommonOrder();
|
| | | } else if ("3day".equalsIgnoreCase(param)) {
|
| | | pullLatest3DayCommonOrder();
|
| | | }
|
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | |
|
| | | // 淘宝推广订单 每隔1分执行一次
|
| | | @Scheduled(cron = "0 0/1 * * * ? ")
|
| | | public void pullLatestCommonOrder() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | private void pullLatestCommonOrder() {
|
| | | LogHelper.job("pullLatestCommonOrder");
|
| | | Date systemDate = TaoKeApiUtil.getTaoBaoSystemTime();
|
| | | long endTime = systemDate != null ? systemDate.getTime() : System.currentTimeMillis();
|
| | | //
|
| | | updateOrder(endTime - 1000 * 60 * 20L, endTime);
|
| | | }
|
| | |
|
| | | // 返利
|
| | | @Scheduled(cron = "0 0/5 * * * ? ")
|
| | | public void fanli() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | // 爬取最近一天的常规订单(30分钟一次)
|
| | | private void pullLatestDayCommonOrder() {
|
| | | LogHelper.job("pullLatestCommonOrder");
|
| | | Date systemDate = TaoKeApiUtil.getTaoBaoSystemTime();
|
| | | long endTime = systemDate != null ? systemDate.getTime() : System.currentTimeMillis();
|
| | | updateOrder(endTime - 1000 * 60 * 60 * 24L, endTime);
|
| | | }
|
| | |
|
| | | // 爬取最近三天的常规订单(6个小时一次)
|
| | | private void pullLatest3DayCommonOrder() {
|
| | | LogHelper.job("pullLatestCommonOrder");
|
| | | Date systemDate = TaoKeApiUtil.getTaoBaoSystemTime();
|
| | | long endTime = systemDate != null ? systemDate.getTime() : System.currentTimeMillis();
|
| | | updateOrder(endTime - 1000 * 60 * 60 * 24 * 3L, endTime);
|
| | | }
|
| | |
|
| | | // 5分钟执行一次
|
| | | @XxlJob("ownBuyFanLiHandler")
|
| | | public ReturnT<String> ownBuyFanLi(String param) throws Exception {
|
| | | LogHelper.job("处理返利到账前置");
|
| | | try {
|
| | |
|
| | | doTaoBaoWeiQuanOrder(2);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | LogHelper.job("开始处理返利");
|
| | | orderProcessService.fanli();
|
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | |
|
| | | // 维权订单处理-处理最近60天的
|
| | | // 30分钟一次
|
| | | @Scheduled(cron = "0 0/30 * * * ? ")
|
| | | public void doTaoBaoWeiQuan() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | @XxlJob("taoBaoWeiQuanOrderHandler")
|
| | | public ReturnT<String> doTaoBaoWeiQuan(String param) throws Exception {
|
| | | LogHelper.job("维权订单爬取");
|
| | | doTaoBaoWeiQuanOrder(5);
|
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | |
|
| | | // 处理找回订单
|
| | | @XxlJob("doLostOrderHandler")
|
| | | public ReturnT<String> doLostOrder(String param) throws Exception {
|
| | | if ("fail".equalsIgnoreCase(param)) {// 更新最近的本地单(30分钟更新一次)
|
| | | doFailLostOrder();
|
| | | } else if ("success".equalsIgnoreCase(param)) {// 处理最近5天的本地订单
|
| | | addLostOrder();
|
| | | }
|
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | |
|
| | | // 处理订单找回失败的情况 每6个小时执行一次
|
| | | @Scheduled(cron = "0 0 0/6 * * ? ")
|
| | | public void doFailLostOrder() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | private void doFailLostOrder() {
|
| | | LogHelper.job("处理丢失订单自动找回失败的情况");
|
| | | lostOrderService.processFail();
|
| | | }
|
| | |
|
| | | // 每2分钟执行一次
|
| | | @Scheduled(cron = "0 0/2 * * * ? ")
|
| | | public void addLostOrder() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | private void addLostOrder() {
|
| | | LogHelper.job("处理丢失订单");
|
| | | List<LostOrder> list = lostOrderService.listByStateAndResultCode(LostOrder.STATE_PASS,
|
| | | LostOrder.RESULT_CODE_VERFING, 1, 50);
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 处理淘宝结算订单,30分执行一次
|
| | | */
|
| | | @Scheduled(cron = "30 0 0/1 * * ? ")
|
| | | public void doSettleOrders() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | LogHelper.job("doSettleOrders");
|
| | | // 处理3-15天前的订单,每天跑一次
|
| | | Calendar ca = Calendar.getInstance();
|
| | | int hour = ca.get(Calendar.HOUR_OF_DAY);
|
| | | long startTime = TimeUtil.convertToTimeTemp(
|
| | | TimeUtil.getGernalTime(ca.getTimeInMillis() - 1000 * 60 * 60 * 24 * 3L, "yyyy-MM-dd"), "yyyy-MM-dd")
|
| | | - hour * (1000 * 60 * 60 * 12L);
|
| | | long endTime = startTime + 1000 * 60 * 60 * 12L;
|
| | | List<TaoBaoOrder> orderList = TaoKeOrderApiUtil.getTaoBaoCommonOrderList(startTime, endTime, 3);
|
| | | addOrder(orderList);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 13分钟更新最近2小时的结算数据
|
| | | */
|
| | | @Scheduled(cron = "0 0/13 * * * ? ")
|
| | | public void doSettleOrdersToday() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | LogHelper.job("doSettleOrdersToday");
|
| | | // 处理3-15天前的订单,每天跑一次
|
| | | Calendar ca = Calendar.getInstance();
|
| | | long startTime = ca.getTimeInMillis() - 1000 * 60 * 5L - 1000 * 60 * 60 * 2L;
|
| | | long endTime = startTime + 1000 * 60 * 60 * 2L;
|
| | | List<TaoBaoOrder> orderList = TaoKeOrderApiUtil.getTaoBaoCommonOrderList(startTime, endTime, 3);
|
| | | addOrder(orderList);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 更新本地订单(凌晨25分更新)
|
| | | */
|
| | | @Scheduled(cron = "25 0 0 * * ? ")
|
| | | public void doLocalTaoBaoOrder() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | LogHelper.job("doLocalTaoBaoOrder");
|
| | | // 处理3-15天前的订单,每天跑一次
|
| | | Long startTime = System.currentTimeMillis() - 1000 * 60 * 60 * 24 * 60L;
|
| | | Long endTime = startTime + 1000 * 60 * 60 * 24 * 48L;
|
| | | List<CommonOrder> commonOrderList = commonOrderService.listBySourceTypeAndStateAndThirdCrateTime(
|
| | | Constant.SOURCE_TYPE_TAOBAO, CommonOrder.STATE_FK, startTime, endTime, 1, 500);
|
| | | Set<String> orderIds = new HashSet<>();
|
| | | for (CommonOrder co : commonOrderList) {
|
| | | orderIds.add(co.getOrderNo());
|
| | | // 处理淘宝本地订单
|
| | | @XxlJob("doLocalTaoBaoOrder")
|
| | | public ReturnT<String> updatePDDOrder(String param) throws Exception {
|
| | | if ("1".equalsIgnoreCase(param)) {// 更新最近的本地单(30分钟更新一次)
|
| | | doLatestLocalTaoBaoOrder();
|
| | | } else if ("5day".equalsIgnoreCase(param)) {// 处理最近5天的本地订单
|
| | | doLatest5DayLocalTaoBaoOrder();
|
| | | }
|
| | |
|
| | | for (Iterator<String> its = orderIds.iterator(); its.hasNext();) {
|
| | | String orderId = its.next();
|
| | | List<TaoBaoOrder> orderList = taoBaoOrderService.getTaoBaoOrderByOrderId(orderId);
|
| | | Map<String, List<TaoBaoOrder>> orders = new HashMap<>();
|
| | | orders.put(orderId, orderList);
|
| | | orderProcessService.processOrder(orders);
|
| | | }
|
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 更新最近的本地单(30分钟更新一次)
|
| | | */
|
| | |
|
| | | @Scheduled(cron = "0 0/30 * * * ? ")
|
| | | public void doLatestLocalTaoBaoOrder() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | |
|
| | | private void doLatestLocalTaoBaoOrder() {
|
| | | Long endTime = System.currentTimeMillis() - 1000 * 60 * 10L;
|
| | | Long startTime = endTime - 1000 * 60 * 60 * 12L;
|
| | | updateLocalTaoBaoOrder(startTime, endTime, 1, 2000);
|
| | |
| | | /**
|
| | | * 处理最近5天的本地订单
|
| | | */
|
| | | @Scheduled(cron = "30 13 3 * * ? ")
|
| | | public void doLatest5DayLocalTaoBaoOrder() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | private void doLatest5DayLocalTaoBaoOrder() {
|
| | | LogHelper.job("doLatest5DayLocalTaoBaoOrder");
|
| | | Long endTime = System.currentTimeMillis() - 1000 * 60 * 60 * 12L;
|
| | | Long startTime = endTime - 1000 * 60 * 60 * 24 * 5L;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 处理上月订单成功
|
| | | */
|
| | | @Scheduled(cron = "0 0 12 25 * ? ")
|
| | | public void doSellerNotPayOrder() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | // 淘宝商家跑路订单 每月25号12点处理上月的
|
| | | @XxlJob("doTaoBaoSellerNotPayOrderHandler")
|
| | | public ReturnT<String> doSellerNotPayOrder(String param) throws Exception {
|
| | | LogHelper.job("doSellerNotPayOrder");
|
| | | Calendar calender = Calendar.getInstance();
|
| | | long endTime = TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(calender.getTimeInMillis(), "yyyy-MM"),
|
| | |
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.scheduling.annotation.Scheduled;
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import com.xxl.job.core.biz.model.ReturnT;
|
| | | import com.xxl.job.core.handler.annotation.XxlJob;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.order.tb.TaoBaoOrderService;
|
| | | import com.yeshi.fanli.util.CMQManager;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisKeyEnum;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | | while (its.hasNext()) {
|
| | | String key = its.next();
|
| | | List<TaoBaoOrder> orders = map.get(key);
|
| | | String redisKey = RedisKeyEnum.getRedisKey(RedisKeyEnum.addOrderQueue, TaoBaoOrderUtil.getOrderDataHashCode(orders));
|
| | | String redisKey = RedisKeyEnum.getRedisKey(RedisKeyEnum.addOrderQueue,
|
| | | TaoBaoOrderUtil.getOrderDataHashCode(orders));
|
| | | // redis做频率限制
|
| | | try {
|
| | | if (!StringUtil.isNullOrEmpty(redisManager.getCommonString(redisKey))) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @XxlJob("updateTBRelationAndSpecialOrderHandler")
|
| | | public ReturnT<String> updateTBRelationAndSpecialOrder(String param) throws Exception {
|
| | | if ("1".equalsIgnoreCase(param)) {// 爬取近20分钟的数据
|
| | | doJob1();
|
| | | } else if ("1day".equalsIgnoreCase(param)) {// 每5分钟更新(近1天数据)
|
| | | doJob2();
|
| | | }
|
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | |
|
| | | // 每30s爬取一次
|
| | | @Scheduled(cron = "0/30 * * * * ? ")
|
| | | public void doJob1() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | // 爬取近20分钟的数据
|
| | | LogHelper.job("爬单:30s爬取一次单");
|
| | | Date systemDate = TaoKeApiUtil.getTaoBaoSystemTime();
|
| | | long endTime = systemDate != null ? systemDate.getTime() : System.currentTimeMillis();
|
| | |
| | | }
|
| | |
|
| | | // 每5分钟更新(近1天数据)
|
| | | @Scheduled(cron = "0 0/5 * * * ? ")
|
| | | public void doJob2() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | LogHelper.job("爬单:5min爬取一次单");
|
| | | Date systemDate = TaoKeApiUtil.getTaoBaoSystemTime();
|
| | | long endTime = systemDate != null ? systemDate.getTime() : System.currentTimeMillis();
|
| | |
| | | taobaoTrade("淘宝交易(分享/自购)"),
|
| | | taobaoAuth("淘宝授权"),
|
| | | taobaoGoods("淘宝商品信息"),
|
| | | userLogin("用户登录");
|
| | | userLogin("用户登录"),
|
| | | |
| | | ;
|
| | | |
| | |
|
| | | private String desc;
|
| | |
|
| | |
| | | import com.yeshi.fanli.service.inter.order.msg.UserOrderMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.elme.ElmeOrderUtil;
|
| | |
| | | private MsgMoneyDetailService msgMoneyDetailService;
|
| | | @Resource
|
| | | private PushService pushService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private MsgExtraService msgExtraService;
|
| | |
|
| | | @Override
|
| | | public void extractApplay(Extract extract) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createExtractMsg("人工审核中", extract.getUserInfo().getId(),
|
| | | extract, null, null);
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createExtractMsg("人工审核中", extract.getUserInfo().getId(), extract,
|
| | | null, null);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public void extractFail(Extract extract, String reason) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createExtractMsg("提现失败", extract.getUserInfo().getId(),
|
| | | extract, reason, null);
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createExtractMsg("提现失败", extract.getUserInfo().getId(), extract,
|
| | | reason, null);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | PushContentDTO dto = PushMsgFactory.createmoneyExtractFail(new Date(extract.getExtractTime()),
|
| | | extract.getMoney(), extract.getAccount());
|
| | | try {
|
| | | pushService.pushZNX(extract.getUserInfo().getId(), dto.getTitle(), dto.getContent(), null, null);
|
| | | } catch (NumberFormatException e) {
|
| | | e.printStackTrace();
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void extractSuccess(Extract extract, String alipayNo) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createExtractMsg("提现成功", extract.getUserInfo().getId(),
|
| | | extract, null, alipayNo);
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createExtractMsg("提现成功", extract.getUserInfo().getId(), extract,
|
| | | null, alipayNo);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | |
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | PushContentDTO dto = PushMsgFactory.createAlipayAccountValid(history.getAccount(), new BigDecimal("0.1"));
|
| | | try {
|
| | | pushService.pushZNX(history.getUid(), dto.getTitle(), dto.getContent(), null, null);
|
| | | } catch (NumberFormatException e) {
|
| | | e.printStackTrace();
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public void alipayAccountValidFail(AlipayAccountValidNormalHistory history, int limitDay, boolean change) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createAlipayAccountValidFail(history, history.getUid(),
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public void fanliOrderReceived(Long uid, String orderId, int orderType, int goodsCount, BigDecimal money,
|
| | | BigDecimal balance, Date downTime) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.fanLiOrderReceivedMsg(money, balance, orderId, orderType, goodsCount,
|
| | | uid, downTime, false);
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.fanLiOrderReceivedMsg(money, balance, orderId, orderType,
|
| | | goodsCount, uid, downTime, false);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public void rewardCounponReceived(Long uid, String orderId, int orderType, int goodsCount, BigDecimal money,
|
| | | BigDecimal balance, Date downTime) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.fanLiOrderReceivedMsg(money, balance, orderId, orderType, goodsCount,
|
| | | uid, downTime, true);
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.fanLiOrderReceivedMsg(money, balance, orderId, orderType,
|
| | | goodsCount, uid, downTime, true);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void fanliOrderWeiQuan(Long uid, String orderId, int orderType, BigDecimal money, BigDecimal fanliMoney, |
| | | 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);
|
| | |
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | // TODO 需要传入是否部分维权
|
| | | PushContentDTO dto = PushMsgFactory.createMoneyOrderFanLiWeiquan(orderType, orderId, false, money);
|
| | | try {
|
| | | pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null, null);
|
| | | } catch (NumberFormatException e) {
|
| | | e.printStackTrace();
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void shareOrderReceived(Long uid, int orderType, BigDecimal money,BigDecimal balance, Date receivedDate) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.shareOrderReceivedMsg(money, balance, orderType, uid, receivedDate);
|
| | | public void shareOrderReceived(Long uid, int orderType, BigDecimal money, BigDecimal balance, Date receivedDate) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.shareOrderReceivedMsg(money, balance, orderType, uid,
|
| | | receivedDate);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | |
| | |
|
| | | PushContentDTO dto = PushMsgFactory.createMoneyShareRecieved(orderType, money);
|
| | | try {
|
| | | pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null, null);
|
| | |
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | PushContentDTO dto = PushMsgFactory.createMoneyOrderShareOrInviteWeiquan(orderType, orderId, false, money);
|
| | | try {
|
| | | pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null, null);
|
| | | } catch (NumberFormatException e) {
|
| | | e.printStackTrace();
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public void systemEqualize(Long uid, String reason, BigDecimal money, BigDecimal balance) {
|
| | | // MsgMoneyDetail detail = MsgMoneyDetailFactory.createSystemEqualizeMsg(uid, reason, money, balance, null);
|
| | | // try {
|
| | | // msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | // } catch (MsgMoneyDetailException e) {
|
| | | // e.printStackTrace();
|
| | | // }
|
| | | //
|
| | | // PushContentDTO dto = PushMsgFactory.createMoneySystemCompensate(reason, money);
|
| | | // try {
|
| | | // pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null, null);
|
| | | // } catch (NumberFormatException e) {
|
| | | // e.printStackTrace();
|
| | | // } catch (PushException e) {
|
| | | // e.printStackTrace();
|
| | | // }
|
| | | // MsgMoneyDetail detail =
|
| | | // MsgMoneyDetailFactory.createSystemEqualizeMsg(uid, reason, money,
|
| | | // balance, null);
|
| | | // try {
|
| | | // msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | // } catch (MsgMoneyDetailException e) {
|
| | | // e.printStackTrace();
|
| | | // }
|
| | | //
|
| | | // PushContentDTO dto =
|
| | | // PushMsgFactory.createMoneySystemCompensate(reason, money);
|
| | | // try {
|
| | | // pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null,
|
| | | // null);
|
| | | // } catch (NumberFormatException e) {
|
| | | // e.printStackTrace();
|
| | | // } catch (PushException e) {
|
| | | // e.printStackTrace();
|
| | | // }
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public void redPackMsg(Long uid, MsgTypeMoneyTypeEnum type, String content, String beiZhu) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createRedPackMsg(uid, type, content, beiZhu);
|
| | |
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public void teamReceive(Long uid, BigDecimal money, BigDecimal balance, Date receivedDate) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createTeamReceivedMsg(uid, money, balance, receivedDate, "团队收益");
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public void teamDividend(Long uid, BigDecimal money, BigDecimal balance, Date receivedDate) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createTeamReceivedMsg(uid, money, balance, receivedDate, "团队分红");
|
| | |
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | // 推送消息
|
| | | PushContentDTO dto = PushMsgFactory.createMoneyTeamDividents(money);
|
| | | try {
|
| | | pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null, null);
|
| | | } catch (NumberFormatException e) {
|
| | | e.printStackTrace();
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void invalidHongBaoV2AndGiveGodenCorn(Long hongBaoId, Long uid, String orderId, int sourceType,
|
| | | String beiZhu) throws Exception {
|
| | | HongBaoOrder hongbaoOrder = hongBaoOrderMapper.selectByHongBaoId(hongBaoId);
|
| | | if (hongbaoOrder != null) {
|
| | | CommonOrder commonOrder = commonOrderService.selectByPrimaryKey(hongbaoOrder.getCommonOrder().getId());
|
| | | if (commonOrder != null) {
|
| | | if (commonOrder.getState() == CommonOrder.STATE_FK) {
|
| | | CommonOrder updateOrder = new CommonOrder(commonOrder.getId());
|
| | | updateOrder.setState(CommonOrder.STATE_SX);
|
| | | updateOrder.setUpdateTime(new Date());
|
| | | commonOrderService.updateByPrimaryKeySelective(updateOrder);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | HongBaoV2 hongBao = hongBaoV2Service.selectByPrimaryKey(hongBaoId);
|
| | | if (hongBao == null || hongBao.getState() == HongBaoV2.STATE_SHIXIAO)
|
| | | return;
|
| | |
|
| | | HongBaoV2 v2 = new HongBaoV2(hongBaoId);
|
| | | v2.setState(HongBaoV2.STATE_SHIXIAO);
|
| | | v2.setBeizhu(beiZhu);
|
| | |
| | |
|
| | | // 直接粉丝统计
|
| | | int daRenFirstCount = 0;
|
| | | int normalFirstCount = 0;
|
| | | int highFirstCount = 0;
|
| | | int superFirstCount = 0;
|
| | | int tearcherFirstCount = 0;
|
| | |
| | | UserLevelEnum level = userLevelManager.getUserLevel(ts.getWorkerId());
|
| | | if (level == UserLevelEnum.daRen) {
|
| | | daRenFirstCount++;
|
| | | } else if (level == UserLevelEnum.normalVIP) {
|
| | | normalFirstCount++;
|
| | | } else if (level == UserLevelEnum.highVIP) {
|
| | | } else if (level == UserLevelEnum.highVIP) {
|
| | | highFirstCount++;
|
| | | } else if (level == UserLevelEnum.superVIP) {
|
| | | superFirstCount++;
|
| | |
| | |
|
| | | // 间接粉丝统计
|
| | | int daRenSecondCount = 0;
|
| | | int normalSecondCount = 0;
|
| | | int highSecondCount = 0;
|
| | | int superSecondCount = 0;
|
| | | int tearcherSecondCount = 0;
|
| | |
| | | UserLevelEnum level = userLevelManager.getUserLevel(ts.getWorkerId());
|
| | | if (level == UserLevelEnum.daRen) {
|
| | | daRenSecondCount++;
|
| | | } else if (level == UserLevelEnum.normalVIP) {
|
| | | normalSecondCount++;
|
| | | } else if (level == UserLevelEnum.highVIP) {
|
| | | highSecondCount++;
|
| | | } else if (level == UserLevelEnum.superVIP) {
|
| | |
| | | TeamUserLevelStatistic statistic = new TeamUserLevelStatistic();
|
| | | statistic.setDaRenFirstCount(daRenFirstCount);
|
| | | statistic.setDaRenSecondCount(daRenSecondCount);
|
| | | statistic.setNormalFirstCount(normalFirstCount);
|
| | | statistic.setNormalSecondCount(normalSecondCount);
|
| | | statistic.setHighFirstCount(highFirstCount);
|
| | | statistic.setHighSecondCount(highSecondCount);
|
| | | statistic.setSuperFirstCount(superFirstCount);
|
| | |
| | | // 查询低等级的是否已读,如若未读则设为已读
|
| | | if (notify.getToLevel() == UserLevelEnum.highVIP || notify.getToLevel() == UserLevelEnum.superVIP) {
|
| | | List<UserLevelEnum> levels = new ArrayList<>();
|
| | | if (notify.getToLevel() == UserLevelEnum.highVIP) {
|
| | | levels.add(UserLevelEnum.normalVIP);
|
| | | } else {
|
| | | levels.add(UserLevelEnum.normalVIP);
|
| | | if (notify.getToLevel() == UserLevelEnum.superVIP) {
|
| | | levels.add(UserLevelEnum.highVIP);
|
| | | }
|
| | |
|
| | |
| | | "4c7b166fecb6d9f53837e993f2214673", "", "");
|
| | |
|
| | | // 新的规则生效时间
|
| | | public static final long NEW_ORDER_FANLI_RULE_TIME = TimeUtil.convertToTimeTemp("2020-04-14", "yyyy-MM-dd");
|
| | | public static final long NEW_ORDER_FANLI_RULE_TIME = TimeUtil.convertToTimeTemp("2020-04-18", "yyyy-MM-dd");
|
| | |
|
| | | // 使用奖励券最大金额限制
|
| | | public static final BigDecimal REWARD_COUPON_LIMIT_MONEY = new BigDecimal("10");
|
| | |
| | | package com.yeshi.fanli.util.elme;
|
| | |
|
| | | import java.io.IOException;
|
| | | import java.io.InputStream;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Arrays;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.Properties;
|
| | |
|
| | | import javax.mail.Folder;
|
| | | import javax.mail.Message;
|
| | | import javax.mail.Part;
|
| | | import javax.mail.Session;
|
| | | import javax.mail.Store;
|
| | | import javax.mail.internet.MimeMessage;
|
| | |
|
| | | import org.apache.poi.hssf.usermodel.HSSFDateUtil;
|
| | | import org.apache.poi.ss.usermodel.Cell;
|
| | | import org.apache.poi.ss.usermodel.Row;
|
| | | import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
| | | import org.yeshi.utils.mail.ShowMail;
|
| | |
|
| | | import com.yeshi.fanli.entity.elme.ElmeOrder;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | |
|
| | | public class ElmeOrderUtil {
|
| | |
|
| | | public static List<ElmeOrder> parseOrder(InputStream is) {
|
| | | List<ElmeOrder> list = new ArrayList<>();
|
| | |
|
| | | org.apache.poi.ss.usermodel.Workbook wb = null;
|
| | | try {
|
| | | wb = new XSSFWorkbook(is);
|
| | | } catch (IOException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | // 开始解析
|
| | | org.apache.poi.ss.usermodel.Sheet sheet = wb.getSheetAt(0);
|
| | |
|
| | | Row firstRow = sheet.getRow(0);
|
| | | for (int r = 1; r <= sheet.getLastRowNum(); r++) {
|
| | | ElmeOrder order = new ElmeOrder();
|
| | | Row row = sheet.getRow(r);
|
| | | for (int c = row.getFirstCellNum(); c < row.getLastCellNum(); c++) {
|
| | | Cell cell = row.getCell(c);
|
| | | String content = null;
|
| | |
|
| | | String columnName = firstRow.getCell(c).getStringCellValue().trim();
|
| | | if (cell == null)
|
| | | continue;
|
| | | if (cell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
|
| | | if (HSSFDateUtil.isCellDateFormatted(cell)) { // 判断日期类型
|
| | | Date date = cell.getDateCellValue();
|
| | | content = TimeUtil.getGernalTime(date.getTime(), "yyyy-MM-dd");
|
| | | } else { // 否
|
| | | content = cell.getNumericCellValue() + "";
|
| | | }
|
| | |
|
| | | } else if (cell.getCellType() == Cell.CELL_TYPE_STRING) {
|
| | | content = (cell.getStringCellValue());
|
| | | }
|
| | | switch (columnName) {
|
| | | case "渠道号":
|
| | | order.setChannelId(new BigDecimal(content).longValue() + "");
|
| | | break;
|
| | | case "渠道名称":
|
| | | order.setChannelName(content);
|
| | | break;
|
| | | case "track_pid":
|
| | | order.setTrackPid(content);
|
| | | break;
|
| | | case "rid":
|
| | | order.setRid(new BigDecimal(content).longValue() + "");
|
| | | break;
|
| | | case "订单日期":
|
| | | order.setOrderDate(new Date(TimeUtil.convertToTimeTemp(content, "yyyy-MM-dd")));
|
| | | break;
|
| | | case "订单号":
|
| | | order.setOrderId(content.replace("<", "").replace(">", "").replace("<", "").replace(">", ""));
|
| | | break;
|
| | | case "支付金额":
|
| | | order.setPayMoney(new BigDecimal(content));
|
| | | break;
|
| | | case "下单城市":
|
| | | order.setCity(content);
|
| | | break;
|
| | | case "用券金额":
|
| | | order.setCouponMoney(new BigDecimal(content));
|
| | | break;
|
| | | case "是否新客首单":
|
| | | order.setNewerFirstOrder(new BigDecimal(content).intValue());
|
| | | break;
|
| | | case "是否新客复购单":
|
| | | order.setNewerRepayOrder(new BigDecimal(content).intValue());
|
| | | break;
|
| | | case "是否使用淘客红包":
|
| | | order.setTaokeHongBao(new BigDecimal(content).intValue());
|
| | | break;
|
| | | case "是否有在会场内该门店的点击记录":
|
| | | order.setShopClick(new BigDecimal(content).intValue());
|
| | | break;
|
| | | case "是否领券后7天内首单":
|
| | | order.setRecieveCoupon7DayFirstOrder(new BigDecimal(content).intValue());
|
| | | break;
|
| | | case "是否6结佣":
|
| | | if ("是".equalsIgnoreCase(content))
|
| | | order.setIsSettle(true);
|
| | | else
|
| | | order.setIsSettle(false);
|
| | | break;
|
| | | }
|
| | | }
|
| | | list.add(order);
|
| | | }
|
| | | return list;
|
| | | }
|
| | |
|
| | | public static BigDecimal getCommission(BigDecimal payMoney) {
|
| | | return MoneyBigDecimalUtil.mul(payMoney, new BigDecimal("0.06"));
|
| | | }
|
| | |
|
| | | public static List<ElmeOrder> pullLatest5DayOrder() {
|
| | | List<ElmeOrder> totalOrderList = new ArrayList<>();
|
| | | String host = "pop.qq.com";
|
| | | String username = "2780501319@qq.com";
|
| | | String password = "dbltidaeknumdgfd";
|
| | | Properties props = new Properties();
|
| | | Session session = Session.getDefaultInstance(props, null);
|
| | | try {
|
| | | Store store = session.getStore("pop3");
|
| | | store.connect(host, username, password);
|
| | | Folder folder = store.getFolder("INBOX");
|
| | | folder.open(Folder.READ_ONLY);
|
| | | Message message[] = folder.getMessages();
|
| | | List<Message> list = Arrays.asList(message);
|
| | | int count = 0;
|
| | | for (int i = list.size() - 1; i >= 0; i--) {
|
| | | ShowMail showMail = new ShowMail((MimeMessage) list.get(i));
|
| | | if ("qiuming.wu<qiuming.wu@ele.me>".equalsIgnoreCase(showMail.getFrom())) {
|
| | | if (count++ > 5)
|
| | | break;
|
| | | try {
|
| | | boolean attch = showMail.isContainAttach((Part) list.get(i));
|
| | | if (attch) {
|
| | | List<InputStream> attchList = showMail.saveAttachMent((Part) list.get(i));
|
| | | if (attchList.size() > 0) {
|
| | | List<ElmeOrder> orderList = ElmeOrderUtil.parseOrder(attchList.get(0));
|
| | | if (orderList != null && orderList.size() > 0)
|
| | | totalOrderList.addAll(orderList);
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | return totalOrderList;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | return UserLevelEnum.daRen.getName();
|
| | | }
|
| | |
|
| | | if (orderRank == UserLevelEnum.normalVIP.getOrderRank()) {
|
| | | return UserLevelEnum.normalVIP.getName();
|
| | | }
|
| | |
|
| | | if (orderRank == UserLevelEnum.highVIP.getOrderRank()) {
|
| | | return UserLevelEnum.highVIP.getName();
|
| | | }
|
| | |
| | | }
|
| | | return null;
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 根据订单rank获取用户的等级
|
| | | * @Title: getByOrderRank
|
| | |
| | | return null;
|
| | |
|
| | | if (level == UserLevelEnum.daRen) {
|
| | | return UserLevelEnum.normalVIP;
|
| | | } else if (level == UserLevelEnum.normalVIP) {
|
| | | return UserLevelEnum.highVIP;
|
| | | } else if (level == UserLevelEnum.highVIP) {
|
| | | return UserLevelEnum.superVIP;
|
| | |
| | | return null;
|
| | | if (level == UserLevelEnum.daRen) {
|
| | | return null;
|
| | | } else if (level == UserLevelEnum.normalVIP) {
|
| | | return UserLevelEnum.daRen;
|
| | | } else if (level == UserLevelEnum.highVIP) {
|
| | | return UserLevelEnum.normalVIP;
|
| | | return UserLevelEnum.daRen;
|
| | | } else if (level == UserLevelEnum.superVIP) {
|
| | | return UserLevelEnum.highVIP;
|
| | | }
|
| | |
| | | */
|
| | |
|
| | | public static UserLevelEnum getOldLevel(UserLevelEnum userLevel) {
|
| | | if (userLevel == null || userLevel == UserLevelEnum.normalVIP || userLevel == UserLevelEnum.highVIP) {
|
| | | if (userLevel == null || userLevel == UserLevelEnum.highVIP) {
|
| | | return UserLevelEnum.daRen;
|
| | | } else if (userLevel == UserLevelEnum.tearcher)
|
| | | return UserLevelEnum.superVIP;
|
| | |
| | | #推送消息
|
| | |
|
| | | #返利订单被统计(失效订单无推送)
|
| | | fanli_order_statisticed_title=返利订单
|
| | | fanli_order_statisticed_msg=你的[订单类型]返利订单[订单号],预估返利[金额]元,已被成功统计,请到我的-订单中查看。
|
| | | fanli_order_statisticed_title=恭喜,有新订单了!
|
| | | fanli_order_statisticed_msg=订单编号:[订单号]
|
| | |
|
| | | #分享订单被统计(注意订单号隐藏)
|
| | | share_order_statisticed_title=分享订单
|
| | | share_order_statisticed_msg=你的[订单类型]分享订单[订单号],预估分享奖金[金额]元,已被成功统计,请到我的-订单中查看。
|
| | | share_order_statisticed_title=恭喜,有新订单了!
|
| | | share_order_statisticed_msg=订单编号:[订单号]
|
| | |
|
| | | #邀请订单被统计(注意订单号隐藏)
|
| | | invite_order_statisticed_title=邀请订单
|
| | | invite_order_statisticed_msg=你的[订单类型]邀请订单[订单号],预估邀请奖金[金额]元,已被成功统计,请到我的-订单中查看。
|
| | | invite_order_statisticed_title=恭喜,有新订单了!
|
| | | invite_order_statisticed_msg=订单编号:[订单号]
|
| | |
|
| | | #
|
| | | #资金类消息
|
| | | #
|
| | |
|
| | | #返利到账
|
| | | money_fanli_recieved_title=返利到账
|
| | | money_fanli_recieved_msg=[订单类型]订单[订单号],返利[金额]元,已存入到你的账户余额中,需再返请使用返利奖励券。
|
| | | money_fanli_recieved_title=恭喜,有新收入了!
|
| | | money_fanli_recieved_msg=自购返利存入了账户余额
|
| | |
|
| | | #分享奖金到账
|
| | | money_share_recieved_title=分享奖金到账
|
| | | money_share_recieved_msg=你上月[订单类型]渠道有效分享奖金[金额]元,已存入到你的账户余额中,请注意查收。
|
| | | money_share_recieved_title=恭喜,有新收入了!
|
| | | money_share_recieved_msg=分享奖金存入了账户余额
|
| | |
|
| | | #邀请奖金到账
|
| | | money_invite_recieved_title=邀请奖金到账
|
| | | money_invite_recieved_msg=你上月[订单类型]渠道有效邀请奖金[金额]元,已存入到你的账户余额中,请注意查收。
|
| | | money_invite_recieved_title=恭喜,有新收入了!
|
| | | money_invite_recieved_msg=团队收益存入了账户余额
|
| | |
|
| | | #团队分红
|
| | | money_team_dividents_recieved_title=恭喜,有新收入了!
|
| | | money_team_dividents_recieved_msg=团队分红存入了账户余额
|
| | |
|
| | | #导师津贴
|
| | | money_tearcher_subsidy_recieved_title=恭喜,有新收入了!
|
| | | money_tearcher_subsidy_recieved_msg=导师津贴存入了账户余额
|
| | |
|
| | | #提现成功
|
| | | money_extract_success_title=恭喜,提现成功了!
|
| | | money_extract_success_msg=请到提现支付宝中账号中查收
|
| | |
|
| | |
|
| | | #系统补齐
|
| | | money_system_compensate_title=系统补齐
|
| | | money_system_compensate_msg=因[原因]已经修复,系统补齐金额[金额]元,已存入到你的账户余额中,请注意查收。
|
| | | money_system_compensate_title=恭喜,有新收入了!
|
| | | money_system_compensate_msg=系统补齐存入了账户余额
|
| | |
|
| | |
|
| | | #邀请队员成功
|
| | | invite_team_success_title=恭喜,又新增了一个粉丝!
|
| | | invite_team_success_msg=粉丝团队又双叒壮大了!
|
| | |
|
| | |
|
| | | #系统消息
|
| | | system_message_title=你有一条重要的消息未读
|
| | | system_message_msg=请到消息-系统消息中查看
|
| | |
|
| | |
|
| | | #----------------删除开始------------------
|
| | |
|
| | | #系统扣除
|
| | | money_system_sub_title=系统扣除
|
| | |
| | | #维权扣除
|
| | | money_weiquan_title=维权扣除
|
| | | money_weiquan_msg=你的[订单类型]订单[订单号],[部分]维权成功,对应[金额]元已扣除,请到账户明细中查看。
|
| | |
|
| | |
|
| | | #提现成功
|
| | | money_extract_success_title=提现成功
|
| | | money_extract_success_msg=恭喜你于[提现时间]提现[金额]元,提现成功,请到[支付宝账号]中查看。
|
| | |
|
| | |
|
| | | #提现失败
|
| | |
| | | function_get_fail_title=开通失败
|
| | | function_get_fail_msg=你未能开通[增值功能],如有疑问请联系人工客服。
|
| | |
|
| | | #邀请队员成功
|
| | | invite_team_success_title=邀请成功
|
| | | invite_team_success_msg=你于[时间]成功邀请队员[队员昵称],感谢使用和信任。
|
| | |
|
| | | #客服唤起
|
| | | msg_kefu_title=客服信息
|
| | | msg_kefu_msg=人工客服发来了一条消息,请注意查阅(我的-人工客服),以便解决你的疑问。
|
| | |
|
| | | #----------------删除结束------------------
|
| | |
| | | <artifactId>cglib</artifactId>
|
| | | <version>2.2.2</version>
|
| | | </dependency>
|
| | | <dependency>
|
| | | <groupId>log4j</groupId>
|
| | | <artifactId>log4j</artifactId>
|
| | | <version>1.2.14</version>
|
| | | <scope>provided</scope>
|
| | | </dependency>
|
| | |
|
| | | <dependency>
|
| | | <groupId>mysql</groupId>
|
| | | <artifactId>mysql-connector-java</artifactId>
|
| | |
| | | </dependency>
|
| | |
|
| | | <dependency>
|
| | | <groupId>org.apache.logging.log4j</groupId>
|
| | | <artifactId>log4j-core</artifactId>
|
| | | <version>2.11.2</version>
|
| | | </dependency>
|
| | |
|
| | | <dependency>
|
| | | <groupId>org.bouncycastle</groupId>
|
| | | <artifactId>bcprov-jdk16</artifactId>
|
| | | <version>1.46</version>
|