Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div
# Conflicts:
# fanli/src/main/java/com/yeshi/fanli/dao/mybatis/HongBaoV2CountMapper.java
# fanli/src/main/java/com/yeshi/fanli/mapping/hongbao/HongBaoV2CountMapper.xml
# fanli/src/main/java/com/yeshi/fanli/service/inter/count/HongBaoV2CountService.java
| | |
| | | KEY = Constant.systemCommonConfig.getSignKey();
|
| | | }
|
| | |
|
| | | @Around(EDP)
|
| | | // @Around(EDP)
|
| | | public Object testAround(ProceedingJoinPoint joinPoint) throws IOException {
|
| | | Object[] args = joinPoint.getArgs();
|
| | | PrintWriter out = null;
|
| | |
| | |
|
| | | @RequestMapping(value = "tb")
|
| | | public void tb(String code, String state, HttpServletRequest request, HttpServletResponse response) {
|
| | |
|
| | | LogHelper.test("淘宝授权回调:" + code + ":" + state);
|
| | | if (StringUtil.isNullOrEmpty(code) || StringUtil.isNullOrEmpty(state)) {
|
| | | LogHelper.error("淘宝授权回调出错");
|
| | |
| | | }
|
| | | return;
|
| | | }
|
| | |
|
| | | try {
|
| | | String key = StringUtil.Md5("taobao-code-" + code);
|
| | | if (!StringUtil.isNullOrEmpty(redisManager.getCommonString(key)))
|
| | |
| | | } catch (Exception e) {
|
| | |
|
| | | }
|
| | |
|
| | | String stateStr = null;
|
| | | Long time = null;
|
| | | Long uid = null;
|
| | | String source = null;
|
| | | try {
|
| | | stateStr = AESUtil.decrypt(state, Constant.UIDAESKEY);
|
| | | JSONObject json = JSONObject.fromObject(stateStr);
|
| | | time = json.optLong("t");
|
| | | uid = json.optLong("u");
|
| | | source = json.optString("s");
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | state = URLDecoder.decode(state, "UTF-8");
|
| | | } catch (UnsupportedEncodingException e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | stateStr = AESUtil.decrypt(state, Constant.UIDAESKEY);
|
| | | JSONObject json = JSONObject.fromObject(stateStr);
|
| | | time = json.optLong("t");
|
| | | uid = json.optLong("u");
|
| | | source = json.optString("s");
|
| | | }
|
| | |
|
| | | LogHelper.userErrorInfo("淘宝授权回调state:"+state);
|
| | | String stateStr = AESUtil.decrypt(state, Constant.UIDAESKEY);
|
| | |
|
| | | LogHelper.userErrorInfo("淘宝授权回调解密:"+stateStr);
|
| | |
|
| | | int errCode = 0;
|
| | |
| | | // 解密错误
|
| | | errCode = 1;
|
| | | }
|
| | | JSONObject json = JSONObject.fromObject(stateStr);
|
| | | Long time = json.optLong("t");
|
| | | Long uid = json.optLong("u");
|
| | | String source = json.optString("s");
|
| | |
|
| | | if (System.currentTimeMillis() - time > 1000 * 60 * 10L) {
|
| | | // 过时
|
| | | errCode = 2;
|
| | |
| | |
|
| | | final String relationId2 = relationId;
|
| | | // 异步申请会员ID
|
| | | final Long fuid=uid;
|
| | | ThreadUtil.run(new Runnable() {
|
| | |
|
| | | @Override
|
| | |
| | | }
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(specialId))
|
| | | LogHelper.test(uid + "会员备案失败");
|
| | | LogHelper.test(fuid + "会员备案失败");
|
| | | try {
|
| | | userExtraTaoBaoInfoService.addSpecialId(uid, specialId, taoBaoUid, name, true);
|
| | | userExtraTaoBaoInfoService.addSpecialId(fuid, specialId, taoBaoUid, name, true);
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(specialId) && !StringUtil.isNullOrEmpty(relationId2))
|
| | | userInfoModifyRecordService.addModifyRecord(uid, ModifyTypeEnum.bindTaoBao, taoBaoUid);
|
| | | userInfoModifyRecordService.addModifyRecord(fuid, ModifyTypeEnum.bindTaoBao, taoBaoUid);
|
| | | } catch (UserExtraTaoBaoInfoException e) {
|
| | | LogHelper.test(e.getMsg());
|
| | | }
|
| | |
| | | LogHelper.test(e.getMsg());
|
| | | errCode = 5;
|
| | | }
|
| | | final Long fuid=uid;
|
| | |
|
| | | final String specialId2 = specialId;
|
| | | // 异步申请渠道ID
|
| | |
| | | } catch (TaoBaoAuthException e1) {
|
| | | } // 渠道ID
|
| | | if (StringUtil.isNullOrEmpty(relationId))
|
| | | LogHelper.test(uid + "渠道备案失败");
|
| | | LogHelper.test(fuid + "渠道备案失败");
|
| | | try {
|
| | | userExtraTaoBaoInfoService.addRelationId(uid, relationId, taoBaoUid, name, true);
|
| | | userExtraTaoBaoInfoService.addRelationId(fuid, relationId, taoBaoUid, name, true);
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(specialId2) && !StringUtil.isNullOrEmpty(relationId))
|
| | | userInfoModifyRecordService.addModifyRecord(uid, ModifyTypeEnum.bindTaoBao, taoBaoUid);
|
| | | userInfoModifyRecordService.addModifyRecord(fuid, ModifyTypeEnum.bindTaoBao, taoBaoUid);
|
| | | } catch (UserExtraTaoBaoInfoException e) {
|
| | | LogHelper.test(e.getMsg());
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
|
| | | import com.yeshi.fanli.exception.ActivityException;
|
| | | import com.yeshi.fanli.exception.push.PushException;
|
| | | import com.yeshi.fanli.exception.share.UserShareGoodsRecordException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | |
| | | import com.yeshi.fanli.util.db.MongoDBManager;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.util.jd.JDApiUtil;
|
| | | import com.yeshi.fanli.util.push.OPPOPushUtil;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | |
| | | }
|
| | | out.println(array.toString());
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "pushOppo")
|
| | | public void pushOppo(String registerId, PrintWriter out) {
|
| | | List<String> registerIds = new ArrayList<>();
|
| | | registerIds.add(registerId);
|
| | | try {
|
| | | OPPOPushUtil.pushUrl(registerIds, "测试网页推送", "测试网页推送内容", "http://www.baidu.com");
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | try {
|
| | | OPPOPushUtil.pushGoods(registerIds, "测试商品网页推送", "测试商品推送内容", 1, 577628549116L);
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | try {
|
| | | OPPOPushUtil.pushUserSignInNotification(registerIds, "测试签到推送", "测试签到推送");
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | try {
|
| | | OPPOPushUtil.pushWelfareCenter(registerIds, "测试福利中心推送", "测试福利中心推送");
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | try {
|
| | | OPPOPushUtil.pushZNX(registerIds, "测试站内信推送", "测试站内信推送");
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | out.print("success");
|
| | | }
|
| | | }
|
| | |
| | | platformType = 2;
|
| | | }
|
| | | userSystemCouponService.copyLotteryPrize(uuser.getId(), platformType, acceptData.getDevice());
|
| | | // 绑定oppo推送
|
| | | DeviceActive active = deviceActiveService.getFirstActiveInfo(acceptData.getDevice());
|
| | | if (active != null) {
|
| | | deviceTokenOPPOService.bindUid(uuser.getId(), active.getId());
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | // 绑定oppo推送
|
| | | DeviceActive active = deviceActiveService.getFirstActiveInfo(acceptData.getDevice());
|
| | | if (active != null) {
|
| | | deviceTokenOPPOService.bindUid(uuser.getId(), active.getId());
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | |
| | | import java.io.PrintWriter;
|
| | | import java.math.BigDecimal;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Arrays;
|
| | | import java.util.Calendar;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
| | |
|
| | | import com.yeshi.fanli.entity.AppVersionInfo;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.LostOrder;
|
| | | import com.yeshi.fanli.entity.bus.user.Order;
|
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | |
| | | import com.yeshi.fanli.util.CMQManager;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.vo.order.CommonOrderVO;
|
| | |
| | | */
|
| | | @RequestMapping(value = "getorder", method = RequestMethod.POST)
|
| | | public void getOrder(AcceptData acceptData, Integer page, Long uid, Integer state,
|
| | | @RequestParam(name = "type",required = false) String type1, Integer orderState, String orderNo, String startTime, String endTime,
|
| | | Integer slotTime, Boolean needCount, Integer dateType, Integer goodsType, PrintWriter out) {
|
| | | @RequestParam(name = "type", required = false) String type1, Integer orderState, String orderNo,
|
| | | String startTime, String endTime, Integer slotTime, Boolean needCount, Integer dateType, Integer goodsType,
|
| | | PrintWriter out) {
|
| | | Integer type = null;
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(type1)) {
|
| | |
| | | BigDecimal todayMoney = null;
|
| | |
|
| | | // 查询列表
|
| | | List<CommonOrderVO> list = commonOrderService.getOrderByUid(acceptData, page, uid, state, type, orderState, orderNo,
|
| | | startTime, endTime, dateType, goodsType);
|
| | | List<CommonOrderVO> list = commonOrderService.getOrderByUid(acceptData, page, uid, state, type, orderState,
|
| | | orderNo, startTime, endTime, dateType, goodsType);
|
| | |
|
| | | if (list != null && list.size() > 0) {
|
| | | // 统计总数
|
| | |
| | | // 需要统计筛选信息 :未失效的总金额 以及订单
|
| | | if (needCount && page == 1) {
|
| | |
|
| | | todayMoney = commonOrderService.countBonusOrderMoney(uid, type, dateType, startTime, endTime, goodsType);
|
| | | todayMoney = commonOrderService.countBonusOrderMoney(uid, type, dateType, startTime, endTime,
|
| | | goodsType);
|
| | |
|
| | | todayTotal = commonOrderService.countBonusOrderNumber(uid, type, dateType, startTime, endTime, goodsType);
|
| | | todayTotal = commonOrderService.countBonusOrderNumber(uid, type, dateType, startTime, endTime,
|
| | | goodsType);
|
| | |
|
| | | // 有效订单
|
| | | totalValid = commonOrderService.countUserOrderToApp(uid, type, startTime,
|
| | | endTime, dateType, goodsType, tempState, 1);
|
| | | totalValid = commonOrderService.countUserOrderToApp(uid, type, startTime, endTime, dateType, goodsType,
|
| | | tempState, 1);
|
| | |
|
| | | // 维权订单
|
| | | totalProces = commonOrderService.countUserOrderToApp(uid, type, startTime,
|
| | | endTime, dateType, goodsType, null, 2);
|
| | | totalProces = commonOrderService.countUserOrderToApp(uid, type, startTime, endTime, dateType, goodsType,
|
| | | null, 2);
|
| | |
|
| | | // 失效订单
|
| | | totalInvite = commonOrderService.countUserOrderToApp(uid, type, startTime,
|
| | | endTime, dateType, goodsType, null, 3);
|
| | | totalInvite = commonOrderService.countUserOrderToApp(uid, type, startTime, endTime, dateType, goodsType,
|
| | | null, 3);
|
| | | }
|
| | |
|
| | | if (todayMoney == null) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 统计各个平台数据
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param goodsType
|
| | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 统计奖金
|
| | | *
|
| | |
| | | */
|
| | | @RequestMapping(value = "countBonus", method = RequestMethod.POST)
|
| | | public void countBonus(AcceptData acceptData, Long uid, Integer dateType, PrintWriter out) {
|
| | |
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | try {
|
| | | long nowTime = System.currentTimeMillis();
|
| | | long recievedTime = TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(nowTime, "yyyy-MM") + "-25 10",
|
| | | "yyyy-MM-dd HH");
|
| | |
|
| | | try {
|
| | | Object shareCount = 0;
|
| | | BigDecimal sharemoney = new BigDecimal(0.00);
|
| | | Object inviteCount = 0;
|
| | | BigDecimal inviteMoney = new BigDecimal(0.00);
|
| | |
|
| | | if (nowTime > recievedTime && dateType == 4) {// 实际到账
|
| | | List<Integer> inviteTypes = new ArrayList<>();
|
| | | inviteTypes.add(HongBaoV2.TYPE_YIJI);
|
| | | inviteTypes.add(HongBaoV2.TYPE_ERJI);
|
| | | inviteTypes.add(HongBaoV2.TYPE_SHARE_YIJI);
|
| | | inviteTypes.add(HongBaoV2.TYPE_SHARE_ERJI);
|
| | |
|
| | | List<Integer> shareTypes = new ArrayList<>();
|
| | | shareTypes.add(HongBaoV2.TYPE_SHARE_GOODS);
|
| | |
|
| | | Date minGetTime = new Date(
|
| | | TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(nowTime, "yyyy-MM") + "-25", "yyyy-MM-dd"));
|
| | |
|
| | | Date maxGetTime = new Date(nowTime);
|
| | | inviteMoney = hongBaoV2CountService.sumAlreadyGetMoneyByUid(uid, inviteTypes, minGetTime, maxGetTime);
|
| | | inviteCount = hongBaoV2CountService.countAlreadyGetMoneyByUid(uid, inviteTypes, minGetTime, maxGetTime);
|
| | | |
| | | sharemoney = hongBaoV2CountService.sumAlreadyGetMoneyByUid(uid, shareTypes, minGetTime, maxGetTime);
|
| | | shareCount = hongBaoV2CountService.countAlreadyGetMoneyByUid(uid, shareTypes, minGetTime, maxGetTime);
|
| | |
|
| | | } else {// 预估到账
|
| | | Integer goodsType = null; // 版本区分
|
| | | if (!VersionUtil.greaterThan_1_6_0(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | goodsType = Constant.SOURCE_TYPE_TAOBAO;
|
| | | }
|
| | |
|
| | | Map<String, Object> shareMap = commonOrderService.countBonusOrderMoneyAndNumber(uid, 2, dateType, null,
|
| | | null, goodsType);
|
| | | if (shareMap != null) {
|
| | |
| | | }
|
| | |
|
| | | // 邀请统计
|
| | |
|
| | | Map<String, Object> inviteMap = commonOrderService.countBonusOrderMoneyAndNumber(uid, 3, dateType, null,
|
| | | null, goodsType);
|
| | | if (inviteMap != null) {
|
| | |
| | | inviteMoney = (BigDecimal) totalmoney;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("shareCount", shareCount);
|
| | |
| | |
|
| | | public interface HongBaoV2CountMapper {
|
| | |
|
| | | |
| | | /**
|
| | | * 统计历史总到账金额
|
| | | * |
| | | * @param uid
|
| | | * @param state
|
| | | * @return
|
| | | */
|
| | | BigDecimal countMoneyByUidAndState(@Param("uid")Long uid, @Param("state") Integer state);
|
| | |
|
| | | |
| | | /**
|
| | | * 统计历史红包数量
|
| | | * |
| | | * @param uid
|
| | | * @param state
|
| | | * @return
|
| | |
| | |
|
| | | /**
|
| | | * 统计用户总的红包数量
|
| | | * |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * 统计总金额
|
| | | * @param channel 渠道
|
| | | * |
| | | * @param channel |
| | | * 渠道 |
| | | * @param type
|
| | | * @param state
|
| | | * @param years
|
| | |
| | | * @return
|
| | | */
|
| | | List<Map<String, Object>> countHongBaoMoney(@Param("channel")String channel, @Param("dateType")Integer dateType,
|
| | | @Param("state") Integer state, @Param("year") String year, |
| | | @Param("startTime")String startTime, @Param("endTime")String endTime);
|
| | | @Param("state") Integer state, @Param("year") String year, @Param("startTime") String startTime, |
| | | @Param("endTime") String endTime); |
| | |
|
| | | /**
|
| | | * 统计总个数
|
| | | * @param channel 渠道
|
| | | * |
| | | * @param channel |
| | | * 渠道 |
| | | * @param type
|
| | | * @param state
|
| | | * @param years
|
| | |
| | | * @return
|
| | | */
|
| | | List<Map<String, Object>> countHongBaoNum(@Param("channel")String channel, @Param("dateType")Integer dateType,
|
| | | @Param("state") Integer state, @Param("year") String year, |
| | | @Param("startTime")String startTime, @Param("endTime")String endTime);
|
| | | |
| | | @Param("state") Integer state, @Param("year") String year, @Param("startTime") String startTime, |
| | | @Param("endTime") String endTime); |
| | |
|
| | | /**
|
| | | * 统计总个数
|
| | | * @param channel 渠道
|
| | | * |
| | | * @param channel |
| | | * 渠道 |
| | | * @param type
|
| | | * @param state
|
| | | * @param years
|
| | |
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | List<Map<String, Object>> countHongBaoType(@Param("dateType")Integer dateType, |
| | | @Param("type") Integer type, @Param("year") String year, |
| | | @Param("startTime")String startTime, @Param("endTime")String endTime);
|
| | | List<Map<String, Object>> countHongBaoType(@Param("dateType") Integer dateType, @Param("type") Integer type, |
| | | @Param("year") String year, @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | |
|
| | | /**
|
| | | * 统计总个数
|
| | | * @param channel 渠道
|
| | | * |
| | | * @param channel |
| | | * 渠道 |
| | | * @param type
|
| | | * @param state
|
| | | * @param years
|
| | |
| | |
|
| | | /**
|
| | | * 统计未失效订单数量
|
| | | * |
| | | * @param uid
|
| | | * @param dateType
|
| | | * @return
|
| | |
| | |
|
| | | /**
|
| | | * 统计未到账
|
| | | * |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | BigDecimal countWillGetMoneyByUid(@Param("uid") Long uid);
|
| | |
|
| | | |
| | | Date getLastHongBaoTime(@Param("uid") Long uid);
|
| | | |
| | |
|
| | | /**
|
| | | * 根据渠道 统计新增用户24小时内产生的订单数量
|
| | |
| | | List<HongBaoV2VO> listShareAndInviteMoney(@Param("start") long start, @Param("count") int count,
|
| | | @Param("date") String date);
|
| | |
|
| | | |
| | | /**
|
| | | * 统计奖励券总金额
|
| | | * |
| | | * @return
|
| | | */
|
| | | BigDecimal countRebateCouponMoney();
|
| | |
|
| | | /** |
| | | * 统计用户已到账 |
| | | * |
| | | * @param uid |
| | | * @param typeList |
| | | * @param minGetTime |
| | | * @param maxGetTime |
| | | * @return |
| | | */ |
| | | BigDecimal sumAlreadyGetMoneyByUid(@Param("uid") Long uid, @Param("typeList") List<Integer> typeList, |
| | | @Param("minGetTime") Date minGetTime, @Param("maxGetTime") Date maxGetTime); |
| | | |
| | | long countAlreadyGetMoneyByUid(@Param("uid") Long uid, @Param("typeList") List<Integer> typeList, |
| | | @Param("minGetTime") Date minGetTime, @Param("maxGetTime") Date maxGetTime); |
| | | |
| | |
|
| | | /**
|
| | | * 统计返利订单
|
| | |
| | | private String createTime; // 创建时间
|
| | | @Column(name = "to_click_time")
|
| | | private String clickTime; // 点击时间
|
| | | @Column(name = "to_pay_time")
|
| | | private String payTime;// 支付时间
|
| | | @Column(name = "to_title")
|
| | | private String title; // 商品名称
|
| | | @Column(name = "to_auction_id")
|
| | |
| | | this.adPositionName = adPositionName;
|
| | | }
|
| | |
|
| | | public String getPayTime() {
|
| | | return payTime;
|
| | | }
|
| | |
|
| | | public void setPayTime(String payTime) {
|
| | | this.payTime = payTime;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | while (its.hasNext()) {
|
| | | String key = its.next();
|
| | | List<TaoBaoOrder> orders = map.get(key);
|
| | | String redisKey = "addorderqueue-" + TaoBaoOrderUtil.getOrderDataHashCode(orders);;
|
| | | String redisKey = "addorderqueue-" + TaoBaoOrderUtil.getOrderDataHashCode(orders);
|
| | | ;
|
| | | // redis做频率限制
|
| | | try {
|
| | | if (!StringUtil.isNullOrEmpty(redisManager.getCommonString(redisKey))) {
|
| | |
| | | public void doJob2() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | LogHelper.orderInfo("爬单:5min爬取一次单");
|
| | | long endTime = System.currentTimeMillis();
|
| | | updateRelationAndSpecialOrder(endTime - 1000 * 60 * 60 * 24L, endTime);
|
| | | updateRelationAndSpecialSettleOrder(endTime - 1000 * 60 * 60 * 24L, endTime);
|
| | |
| | | |
| | | <?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">
|
| | |
|
| | |
| | | <result column="hb_state" property="state" jdbcType="INTEGER" />
|
| | | <result column="hb_version" property="version" jdbcType="INTEGER" />
|
| | | <result column="hb_beizhu" property="beizhu" jdbcType="VARCHAR" />
|
| | | <result column="hb_pre_get_time" property="preGetTime" jdbcType="TIMESTAMP" />
|
| | | <result column="hb_pre_get_time" property="preGetTime" |
| | | jdbcType="TIMESTAMP" /> |
| | | <result column="hb_get_time" property="getTime" jdbcType="TIMESTAMP" />
|
| | | <result column="hb_create_time" property="createTime" jdbcType="TIMESTAMP" />
|
| | | <result column="hb_update_time" property="updateTime" jdbcType="TIMESTAMP" />
|
| | |
| | | </select>
|
| | |
|
| | | <select id="countNumberByUid" resultType="java.lang.Long">
|
| | | select count(hb_id) from yeshi_ec_hongbao_v2 where hb_uid=#{0}
|
| | | select count(hb_id) |
| | | from yeshi_ec_hongbao_v2 where hb_uid=#{0} |
| | | </select>
|
| | |
|
| | |
|
| | |
| | | SELECT COUNT(t.`hb_id`)AS showValue,
|
| | | <include refid="Column_DateType" />
|
| | | FROM yeshi_ec_hongbao_v2 t
|
| | | WHERE t.`hb_uid` IS NOT NULL AND t.`hb_type` not in(1,3,4)
|
| | | WHERE t.`hb_uid` IS NOT NULL AND t.`hb_type` |
| | | not in(1,3,4) |
| | | <include refid="Count_Select_DateType" />
|
| | | <include refid="Count_Group_DateType" />
|
| | | ORDER BY t.`hb_create_time`
|
| | |
| | |
|
| | | <select id="countMoneyByUidAndState" resultType="java.math.BigDecimal">
|
| | | SELECT CAST(SUM(hb.`hb_money`)AS DECIMAL(19,2))
|
| | | FROM `yeshi_ec_hongbao_v2` hb
|
| | | FROM |
| | | `yeshi_ec_hongbao_v2` hb |
| | | WHERE hb.`hb_uid` = #{uid}
|
| | | <if test="state != null">
|
| | | AND hb.`hb_state` = #{state}
|
| | |
| | | SELECT count(*) FROM `yeshi_ec_hongbao_v2` h
|
| | | WHERE
|
| | | h.`hb_uid`=#{0}
|
| | | AND (h.`hb_type`=20 OR h.`hb_type`=21 OR h.`hb_type`=22 OR h.`hb_type`=6
|
| | | AND (h.`hb_type`=20 OR h.`hb_type`=21 OR h.`hb_type`=22 |
| | | OR h.`hb_type`=6 |
| | | OR h.`hb_type`=7)
|
| | | </select>
|
| | |
|
| | |
| | | <if test="dateType != null and dateType == 2">
|
| | | AND DATE_FORMAT(
|
| | | FROM_UNIXTIME(hb.`hb_create_time`/1000),'%Y%m' ) =
|
| | | DATE_FORMAT( CURDATE( ) , '%Y%m' )
|
| | | DATE_FORMAT( |
| | | CURDATE( ) , '%Y%m' ) |
| | | </if>
|
| | | </select>
|
| | |
|
| | | <select id="countWillGetMoneyByUid" resultType="java.math.BigDecimal">
|
| | | SELECT CAST(SUM(hb.`hb_money`)AS DECIMAL(19,2))
|
| | | SELECT |
| | | CAST(SUM(hb.`hb_money`)AS DECIMAL(19,2)) |
| | | FROM `yeshi_ec_hongbao_v2` hb
|
| | | WHERE hb.`hb_uid` = #{uid} AND hb.`hb_state`
|
| | | in (1,2)
|
| | |
| | | FROM
|
| | | (
|
| | | SELECT h.* FROM yeshi_ec_hongbao_v2 h
|
| | | LEFT JOIN (SELECT a.`lua_uid` AS uid FROM `yeshi_ec_log_user_active` a
|
| | | WHERE a.`lua_channel`='${channel}' GROUP BY a.`lua_uid`) a
|
| | | ON a.uid=h.`hb_uid` WHERE a.uid IS NOT NULL AND (h.`hb_type`=1 OR
|
| | | LEFT JOIN (SELECT |
| | | a.`lua_uid` AS uid FROM `yeshi_ec_log_user_active` a |
| | | WHERE |
| | | a.`lua_channel`='${channel}' GROUP BY a.`lua_uid`) a |
| | | ON |
| | | a.uid=h.`hb_uid` WHERE a.uid IS NOT NULL AND (h.`hb_type`=1 OR |
| | | h.`hb_type`=20)
|
| | | ) b
|
| | | LEFT JOIN yeshi_ec_user u ON u.`id`=b.hb_uid
|
| | |
| | | </select>
|
| | |
|
| | | <select id="countRebateCouponMoney" resultType="java.math.BigDecimal">
|
| | | SELECT IFNULL(SUM(h.`hb_money`),0) FROM `yeshi_ec_hongbao_v2` h |
| | | SELECT |
| | | IFNULL(SUM(h.`hb_money`),0) FROM `yeshi_ec_hongbao_v2` h |
| | | where h.`hb_type` = 10
|
| | | </select> |
| | | |
| | | |
| | | <select id="sumAlreadyGetMoneyByUid" resultType="java.math.BigDecimal"> |
| | | SELECT IFNULL(SUM(h.`hb_money`),0) FROM `yeshi_ec_hongbao_v2` h |
| | | where h.`hb_uid` = #{uid} |
| | | <if test="typeList!=null"> |
| | | <foreach collection="typeList" item="type" open=" and (" |
| | | separator=" or " close=")"> |
| | | h.hb_type=#{type} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="minGetTime!=null"> |
| | | and h.hb_get_time>=#{minGetTime} |
| | | </if> |
| | | |
| | | <if test="maxGetTime!=null"> |
| | | and #{maxGetTime}>h.hb_get_time |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | <select id="countAlreadyGetMoneyByUid" resultType="java.lang.Long"> |
| | | SELECT count(h.hb_id) FROM `yeshi_ec_hongbao_v2` h |
| | | where h.`hb_uid` = #{uid} |
| | | <if test="typeList!=null"> |
| | | <foreach collection="typeList" item="type" open=" and (" |
| | | separator=" or " close=")"> |
| | | h.hb_type=#{type} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="minGetTime!=null"> |
| | | and h.hb_get_time>=#{minGetTime} |
| | | </if> |
| | | |
| | | <if test="maxGetTime!=null"> |
| | | and #{maxGetTime}>h.hb_get_time |
| | | </if> |
| | | </select>
|
| | |
|
| | |
|
| | |
| | | WHERE hb_uid = #{uid}
|
| | | AND (`hb_type` =5 OR `hb_type` =6 OR `hb_type` =7 OR `hb_type` =20 OR `hb_type`=21 OR `hb_type` =22 )
|
| | | </select>
|
| | |
|
| | |
|
| | | </mapper>
|
| | |
| | | da_version_code=#{ver} |
| | | </foreach> |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | List<Integer> verisonList |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_uid_devicetoken_oppo where do_id = #{id,jdbcType=BIGINT} |
| | |
| | | <id column="to_id" property="id" jdbcType="BIGINT" /> |
| | | <result column="to_create_time" property="createTime" jdbcType="VARCHAR" /> |
| | | <result column="to_click_time" property="clickTime" jdbcType="VARCHAR" /> |
| | | <result column="to_pay_time" property="payTime" jdbcType="VARCHAR" />
|
| | | <result column="to_title" property="title" jdbcType="VARCHAR" /> |
| | | <result column="to_auction_id" property="auctionId" jdbcType="BIGINT" /> |
| | | <result column="to_manager_wangwang" property="managerWangWang" |
| | |
| | | <result column="to_special_id" property="specialId" jdbcType="VARCHAR" /> |
| | | <result column="to_trade_id" property="tradeId" jdbcType="VARCHAR" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">to_id,to_create_time,to_click_time,to_title,to_auction_id,to_manager_wangwang,to_shop,to_count,to_price,to_order_state,to_order_type,to_iratio,to_sratio,to_payment,to_estimate,to_settlement,to_eIncome,to_settlement_time,to_tk_rate,to_tk_money,to_technology_support_percent,to_subsidy_ratio,to_subsidy,to_subsidy_type,to_transaction_platform,to_third_service,to_order_id,to_class_name,to_source_media_id,to_source_media_name,to_ad_position_id,to_ad_position_name,to_latest_updatetime,to_orderby,to_relation_id,to_special_id,to_trade_id |
| | | <sql id="Base_Column_List">to_id,to_create_time,to_click_time,to_pay_time,to_title,to_auction_id,to_manager_wangwang,to_shop,to_count,to_price,to_order_state,to_order_type,to_iratio,to_sratio,to_payment,to_estimate,to_settlement,to_eIncome,to_settlement_time,to_tk_rate,to_tk_money,to_technology_support_percent,to_subsidy_ratio,to_subsidy,to_subsidy_type,to_transaction_platform,to_third_service,to_order_id,to_class_name,to_source_media_id,to_source_media_name,to_ad_position_id,to_ad_position_name,to_latest_updatetime,to_orderby,to_relation_id,to_special_id,to_trade_id
|
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | |
| | | </delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoOrder" |
| | | useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_taobao_order |
| | | (to_id,to_create_time,to_click_time,to_title,to_auction_id,to_manager_wangwang,to_shop,to_count,to_price,to_order_state,to_order_type,to_iratio,to_sratio,to_payment,to_estimate,to_settlement,to_eIncome,to_settlement_time,to_tk_rate,to_tk_money,to_technology_support_percent,to_subsidy_ratio,to_subsidy,to_subsidy_type,to_transaction_platform,to_third_service,to_order_id,to_class_name,to_source_media_id,to_source_media_name,to_ad_position_id,to_ad_position_name,to_latest_updatetime,to_orderby,to_relation_id,to_special_id,to_trade_id) |
| | | (to_id,to_create_time,to_click_time,to_pay_time,to_title,to_auction_id,to_manager_wangwang,to_shop,to_count,to_price,to_order_state,to_order_type,to_iratio,to_sratio,to_payment,to_estimate,to_settlement,to_eIncome,to_settlement_time,to_tk_rate,to_tk_money,to_technology_support_percent,to_subsidy_ratio,to_subsidy,to_subsidy_type,to_transaction_platform,to_third_service,to_order_id,to_class_name,to_source_media_id,to_source_media_name,to_ad_position_id,to_ad_position_name,to_latest_updatetime,to_orderby,to_relation_id,to_special_id,to_trade_id)
|
| | | values |
| | | (#{id,jdbcType=BIGINT},#{createTime,jdbcType=VARCHAR},#{clickTime,jdbcType=VARCHAR},#{title,jdbcType=VARCHAR},#{auctionId,jdbcType=BIGINT},#{managerWangWang,jdbcType=VARCHAR},#{shop,jdbcType=VARCHAR},#{count,jdbcType=INTEGER},#{price,jdbcType=DECIMAL},#{orderState,jdbcType=VARCHAR},#{orderType,jdbcType=VARCHAR},#{iRatio,jdbcType=DECIMAL},#{sRatio,jdbcType=DECIMAL},#{payment,jdbcType=DECIMAL},#{estimate,jdbcType=DECIMAL},#{settlement,jdbcType=DECIMAL},#{eIncome,jdbcType=DECIMAL},#{settlementTime,jdbcType=VARCHAR},#{tkRate,jdbcType=DECIMAL},#{tkMoney,jdbcType=DECIMAL},#{technologySupportPercent,jdbcType=DECIMAL},#{subsidyRatio,jdbcType=DECIMAL},#{subsidy,jdbcType=DECIMAL},#{subsidyType,jdbcType=VARCHAR},#{transactionPlatform,jdbcType=VARCHAR},#{thirdService,jdbcType=VARCHAR},#{orderId,jdbcType=VARCHAR},#{className,jdbcType=VARCHAR},#{sourceMediaId,jdbcType=VARCHAR},#{sourceMediaName,jdbcType=VARCHAR},#{adPositionId,jdbcType=VARCHAR},#{adPositionName,jdbcType=VARCHAR}, |
| | | (#{id,jdbcType=BIGINT},#{createTime,jdbcType=VARCHAR},#{clickTime,jdbcType=VARCHAR},#{payTime,jdbcType=VARCHAR},#{title,jdbcType=VARCHAR},#{auctionId,jdbcType=BIGINT},#{managerWangWang,jdbcType=VARCHAR},#{shop,jdbcType=VARCHAR},#{count,jdbcType=INTEGER},#{price,jdbcType=DECIMAL},#{orderState,jdbcType=VARCHAR},#{orderType,jdbcType=VARCHAR},#{iRatio,jdbcType=DECIMAL},#{sRatio,jdbcType=DECIMAL},#{payment,jdbcType=DECIMAL},#{estimate,jdbcType=DECIMAL},#{settlement,jdbcType=DECIMAL},#{eIncome,jdbcType=DECIMAL},#{settlementTime,jdbcType=VARCHAR},#{tkRate,jdbcType=DECIMAL},#{tkMoney,jdbcType=DECIMAL},#{technologySupportPercent,jdbcType=DECIMAL},#{subsidyRatio,jdbcType=DECIMAL},#{subsidy,jdbcType=DECIMAL},#{subsidyType,jdbcType=VARCHAR},#{transactionPlatform,jdbcType=VARCHAR},#{thirdService,jdbcType=VARCHAR},#{orderId,jdbcType=VARCHAR},#{className,jdbcType=VARCHAR},#{sourceMediaId,jdbcType=VARCHAR},#{sourceMediaName,jdbcType=VARCHAR},#{adPositionId,jdbcType=VARCHAR},#{adPositionName,jdbcType=VARCHAR},
|
| | | #{latestUpdateTime,jdbcType=TIMESTAMP},#{orderBy,jdbcType=INTEGER}, |
| | | #{relationId,jdbcType=VARCHAR},#{specialId,jdbcType=VARCHAR} |
| | | ,#{tradeId,jdbcType=VARCHAR}) |
| | |
| | | <if test="id != null">to_id,</if> |
| | | <if test="createTime != null">to_create_time,</if> |
| | | <if test="clickTime != null">to_click_time,</if> |
| | | <if test="payTime != null">to_pay_time,</if>
|
| | | <if test="title != null">to_title,</if> |
| | | <if test="auctionId != null">to_auction_id,</if> |
| | | <if test="managerWangWang != null">to_manager_wangwang,</if> |
| | |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=VARCHAR},</if> |
| | | <if test="clickTime != null">#{clickTime,jdbcType=VARCHAR},</if> |
| | | <if test="payTime != null">#{payTime,jdbcType=VARCHAR},</if>
|
| | | <if test="title != null">#{title,jdbcType=VARCHAR},</if> |
| | | <if test="auctionId != null">#{auctionId,jdbcType=BIGINT},</if> |
| | | <if test="managerWangWang != null">#{managerWangWang,jdbcType=VARCHAR},</if> |
| | |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoOrder">update |
| | | yeshi_ec_taobao_order set to_create_time = |
| | | #{createTime,jdbcType=VARCHAR},to_click_time = |
| | | #{clickTime,jdbcType=VARCHAR},to_title = |
| | | #{clickTime,jdbcType=VARCHAR},to_pay_time =
|
| | | #{payTime,jdbcType=VARCHAR},to_title =
|
| | | #{title,jdbcType=VARCHAR},to_auction_id = |
| | | #{auctionId,jdbcType=BIGINT},to_manager_wangwang = |
| | | #{managerWangWang,jdbcType=VARCHAR},to_shop = |
| | |
| | | <set> |
| | | <if test="createTime != null">to_create_time=#{createTime,jdbcType=VARCHAR},</if> |
| | | <if test="clickTime != null">to_click_time=#{clickTime,jdbcType=VARCHAR},</if> |
| | | <if test="payTime != null">to_pay_time=#{payTime,jdbcType=VARCHAR},</if>
|
| | | <if test="title != null">to_title=#{title,jdbcType=VARCHAR},</if> |
| | | <if test="auctionId != null">to_auction_id=#{auctionId,jdbcType=BIGINT},</if> |
| | | <if test="managerWangWang != null">to_manager_wangwang=#{managerWangWang,jdbcType=VARCHAR}, |
| | |
| | | <id column="to_id" property="tboid" jdbcType="BIGINT" /> |
| | | <result column="to_create_time" property="createTime" jdbcType="VARCHAR" /> |
| | | <result column="to_click_time" property="clickTime" jdbcType="VARCHAR" /> |
| | | <result column="to_pay_time" property="payTime" jdbcType="VARCHAR" />
|
| | | <result column="to_title" property="title" jdbcType="VARCHAR" /> |
| | | <result column="to_auction_id" property="auctionId" jdbcType="BIGINT" /> |
| | | <result column="to_manager_wangwang" property="managerWangWang" |
| | |
| | | return hongBaoV2CountMapper.countShareOrInviteOrder(uid);
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public BigDecimal sumAlreadyGetMoneyByUid(Long uid, List<Integer> typeList, Date minGetTime, Date maxGetTime) {
|
| | | return hongBaoV2CountMapper.sumAlreadyGetMoneyByUid(uid, typeList, minGetTime, maxGetTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countAlreadyGetMoneyByUid(Long uid, List<Integer> typeList, Date minGetTime, Date maxGetTime) {
|
| | | return hongBaoV2CountMapper.countAlreadyGetMoneyByUid(uid, typeList, minGetTime, maxGetTime);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.impl.order.tb;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.Collections;
|
| | | import java.util.Comparator;
|
| | | import java.util.Date;
|
| | | import java.util.HashSet;
|
| | | import java.util.Iterator;
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void bindUid(Long uid, Long deviceActiveId) {
|
| | | DeviceTokenOPPO oldOppo = deviceTokenOPPOMapper.selectByDeviceActiveId(deviceActiveId);
|
| | | if (oldOppo != null) {
|
| | | DeviceTokenOPPO update = new DeviceTokenOPPO();
|
| | | update.setId(oldOppo.getId());
|
| | | update.setUid(uid);
|
| | | update.setUpdateTime(new Date());
|
| | | deviceTokenOPPOMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countDeviceToken(List<Integer> versionList) {
|
| | | return deviceTokenOPPOMapper.countDeviceToken(versionList);
|
| | | }
|
| | |
| | |
|
| | | /**
|
| | | * 统计用户红包数量
|
| | | * |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * 奖励券金额
|
| | | * |
| | | * @return
|
| | | */
|
| | | public BigDecimal countRebateCouponMoney();
|
| | |
| | | */
|
| | | public long countShareOrInviteOrder(Long uid);
|
| | |
|
| | | /**
|
| | | * 统计已到账
|
| | | * |
| | | * @param uid
|
| | | * @param typeList
|
| | | * @param minGetTime
|
| | | * @param maxGetTime
|
| | | * @return
|
| | | */
|
| | | public BigDecimal sumAlreadyGetMoneyByUid(Long uid, List<Integer> typeList, Date minGetTime, Date maxGetTime);
|
| | |
|
| | | public long countAlreadyGetMoneyByUid(Long uid, List<Integer> typeList, Date minGetTime, Date maxGetTime);
|
| | |
|
| | | }
|
| | |
| | | public void unBindUid(Long uid, Long deviceActiveId);
|
| | |
|
| | | /**
|
| | | * 绑定设备
|
| | | * |
| | | * @param uid
|
| | | * @param deviceActiveId
|
| | | */
|
| | | public void bindUid(Long uid, Long deviceActiveId);
|
| | |
|
| | | /**
|
| | | * 计算所有的设备
|
| | | *
|
| | | * @return
|
| | |
| | | doImportantTaoBaoGoodsUpdateJob();// 淘宝重要商品的信息更新
|
| | | doHongBaoRecieveIntegralGetJob();// 返利到账,金币增加
|
| | | // doPlaceOrderIntegralJob();// 下单赠送金币任务
|
| | | doDouYinDeviceActiveJob();// 抖音设备激活广告监测
|
| | | // doDouYinDeviceActiveJob();// 抖音设备激活广告监测
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | taoBaoOrder.setAuctionId(item.optLong("item_id"));
|
| | | taoBaoOrder.setClassName(item.optString("item_category_name"));
|
| | | taoBaoOrder.setClickTime(item.optString("click_time"));
|
| | | taoBaoOrder.setPayTime(item.optString("tb_paid_time"));
|
| | | taoBaoOrder.setCount(item.optInt("item_num"));
|
| | | taoBaoOrder.setCreateTime(item.optString("tk_create_time"));
|
| | | if (!StringUtil.isNullOrEmpty(item.optString("total_commission_fee")))
|