| | |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | tbSearch("飘柔铃兰蓬香持久留香柔顺洗发水/露控油蓬松300g女官方正品"); |
| | | DaTaoKeResult result = DaTaoKeApiUtil.listTipOff(null, null, 20); |
| | | System.out.println(result); |
| | | } |
| | | } |
| | |
| | | JSONArray array = new JSONArray(); |
| | | for (GoodsDetailVO vo : voList) { |
| | | if (acceptData.getSystem() == SystemEnum.yhqjx||acceptData.getSystem() == SystemEnum.hsb) { |
| | | if (!StringUtil.isNullOrEmpty(vo.getMoneyInfo().getHongBaoMoney())) { |
| | | //暂时不筛选红包 |
| | | // if (!StringUtil.isNullOrEmpty(vo.getMoneyInfo().getHongBaoMoney())) { |
| | | array.add(gson.toJson(vo)); |
| | | } |
| | | // } |
| | | } else { |
| | | array.add(gson.toJson(vo)); |
| | | } |
| | |
| | | SystemFunction.bindPhone, SystemFunction.threeSale, SystemFunction.cloudOrder, SystemFunction.godenCorn, SystemFunction.redPack, SystemFunction.faQuan, SystemFunction.fanli, SystemFunction.vip, SystemFunction.inviteCode |
| | | }, 1, "板栗快省", "板栗快省", false), |
| | | flq("com.fanliunion.android", "com.xyj.ec.flq-ios", new String[]{}, new SystemFunction[]{SystemFunction.share, SystemFunction.faQuan, SystemFunction.fanli}, 11, "返利联盟", "淘拼团", false), |
| | | yhqjx("com.youhuiquan.android", "com.youhuiquanjx.ios", new String[]{}, new SystemFunction[]{SystemFunction.fanli, SystemFunction.lijinSub, SystemFunction.bindPhone}, 12, "特价", "特价App", true), |
| | | yhqjx("com.youhuiquan.android", "com.youhuiquanjx.ios", new String[]{}, new SystemFunction[]{SystemFunction.fanli, SystemFunction.bindPhone}, 12, "特价", "特价App", true), |
| | | hsb("com.hsb.shop", "com.hsb.shop.ios", new String[]{}, new SystemFunction[]{SystemFunction.fanli, SystemFunction.lijinSub, SystemFunction.bindPhone}, 12, "好省呗", "好省呗App", true), |
| | | |
| | | ; |
| | |
| | | * @return |
| | | */ |
| | | private void addDTKTipOffList(SystemEnum system) { |
| | | DaTaoKeResult result = DaTaoKeApiUtil.listTipOff(4, null, 50); |
| | | DaTaoKeResult result = DaTaoKeApiUtil.listTipOff(null, null, 50); |
| | | if (result != null) { |
| | | List<DaTaoKeListTopOffDTO> list = (List<DaTaoKeListTopOffDTO>) result.getList(); |
| | | for (int i = list.size() - 1; i >= 0; i--) { |
| | |
| | | throw new Exception("25号之前不能到账本月的"); |
| | | } |
| | | Date preSendTime = new Date(TimeUtil.convertToTimeTemp(day, "yyyy-MM-dd")); |
| | | orderProcessService.fanliShare(preSendTime); |
| | | int uidCount = orderProcessService.fanliShare(preSendTime); |
| | | if(uidCount<=0){ |
| | | throw new Exception("暂无需要到账的用户"); |
| | | } |
| | | |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | |
| | | TeamOrderCMQManager.getInstance().addTeamDividentsMsg(new UidDateDTO(uid, preSendTime)); |
| | | } |
| | | } |
| | | if (count <= 0) { |
| | | throw new Exception("暂无需要到账的用户"); |
| | | } |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | |
| | | //团队收益 |
| | | @Component |
| | | public class OrderTeamIncomeJob { |
| | | Logger orderMoneyLog= LoggerFactory.getLogger("orderMoneyLog"); |
| | | @Resource |
| | | private OrderProcessService orderProcessService; |
| | | Logger orderMoneyLog = LoggerFactory.getLogger("orderMoneyLog"); |
| | | @Resource |
| | | private OrderProcessService orderProcessService; |
| | | |
| | | @Resource |
| | | private TeamEincomeRecordService teamEincomeRecordService; |
| | | @Resource |
| | | private TeamEincomeRecordService teamEincomeRecordService; |
| | | |
| | | public OrderTeamIncomeJob() { |
| | | public OrderTeamIncomeJob() { |
| | | |
| | | } |
| | | } |
| | | |
| | | // 预分红 |
| | | @XxlJob("startPreOrderTeamIncomeHandler") |
| | | public ReturnT<String> startPreOrderTeamIncome(String param) throws Exception { |
| | | String day = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM") + "-25"; |
| | | Date preSendTime = new Date(TimeUtil.convertToTimeTemp(day, "yyyy-MM-dd")); |
| | | orderProcessService.fanliPreInvaite(preSendTime); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | // 预分红 |
| | | @XxlJob("startPreOrderTeamIncomeHandler") |
| | | public ReturnT<String> startPreOrderTeamIncome(String param) throws Exception { |
| | | String day = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM") + "-25"; |
| | | Date preSendTime = new Date(TimeUtil.convertToTimeTemp(day, "yyyy-MM-dd")); |
| | | orderProcessService.fanliPreInvaite(preSendTime); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | @XxlJob("addTeamIncomeTOUserAccountHandler") |
| | | public ReturnT<String> addTeamIncomeTOUserAccount(String param) throws Exception { |
| | | String day = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM") + "-25"; |
| | | if (!StringUtil.isNullOrEmpty(param)) |
| | | day = param; |
| | | @XxlJob("addTeamIncomeTOUserAccountHandler") |
| | | public ReturnT<String> addTeamIncomeTOUserAccount(String param) throws Exception { |
| | | String day = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM") + "-25"; |
| | | if (!StringUtil.isNullOrEmpty(param)) |
| | | day = param; |
| | | |
| | | Date preSendTime = new Date(TimeUtil.convertToTimeTemp(day, "yyyy-MM-dd")); |
| | | Date preSendTime = new Date(TimeUtil.convertToTimeTemp(day, "yyyy-MM-dd")); |
| | | |
| | | List<Integer> typeList = new ArrayList<>(); |
| | | typeList.add(TeamEincomeRecord.TYPE_TEAM_REWARD); |
| | | typeList.add(TeamEincomeRecord.TYPE_TEAM_SUBSIDY); |
| | | List<Integer> typeList = new ArrayList<>(); |
| | | typeList.add(TeamEincomeRecord.TYPE_TEAM_REWARD); |
| | | typeList.add(TeamEincomeRecord.TYPE_TEAM_SUBSIDY); |
| | | |
| | | long count = teamEincomeRecordService.countCanRecieveUid(preSendTime, typeList); |
| | | orderMoneyLog.info("团队收益结算: 日期-{} 用户数量-{}",day,count); |
| | | int pageSize = 500; |
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1); |
| | | for (int i = 0; i < totalPage; i++) { |
| | | List<Long> list = teamEincomeRecordService.listCanRecieveUid(preSendTime, typeList, i + 1, pageSize); |
| | | for (Long uid : list) { |
| | | TeamOrderCMQManager.getInstance().addFanLiTeamIncomeMsg(new UidDateDTO(uid, preSendTime)); |
| | | orderMoneyLog.info("团队收益结算: 日期-{} Uid-{}",day,uid); |
| | | } |
| | | } |
| | | //TODO 将红包金额为0的状态设置为已到账 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | long count = teamEincomeRecordService.countCanRecieveUid(preSendTime, typeList); |
| | | orderMoneyLog.info("团队收益结算: 日期-{} 用户数量-{}", day, count); |
| | | int pageSize = 500; |
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1); |
| | | for (int i = 0; i < totalPage; i++) { |
| | | List<Long> list = teamEincomeRecordService.listCanRecieveUid(preSendTime, typeList, i + 1, pageSize); |
| | | for (Long uid : list) { |
| | | TeamOrderCMQManager.getInstance().addFanLiTeamIncomeMsg(new UidDateDTO(uid, preSendTime)); |
| | | orderMoneyLog.info("团队收益结算: 日期-{} Uid-{}", day, uid); |
| | | } |
| | | } |
| | | if (count <= 0) { |
| | | throw new Exception("暂无需要到账的用户"); |
| | | } |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.job.order; |
| | | |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.handler.annotation.XxlJob; |
| | | import com.yeshi.fanli.dto.mq.order.body.CommonOrderMQMsg; |
| | | import com.yeshi.fanli.entity.order.CommonOrder; |
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService; |
| | | import com.yeshi.fanli.util.mq.cmq.order.OrdersCMQManager; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author hxh |
| | | * @title: UpdateOrderJob |
| | | * @description: 订单更新任务 |
| | | * @date 2023/1/11 10:52 |
| | | */ |
| | | @Component |
| | | public class UpdateCommonOrderJob { |
| | | |
| | | @Resource |
| | | private CommonOrderService commonOrderService; |
| | | |
| | | @XxlJob("order-update-pay-state") |
| | | public ReturnT<String> updatePayState(String param) throws Exception { |
| | | //更新20-25天之前的未处理订单 |
| | | List<CommonOrder> resultList = commonOrderService.listPayStateOrder(null,new Date(System.currentTimeMillis() - 1000*60*60*24L*25),new Date(System.currentTimeMillis() - 1000*60*60*24L*20),1,500); |
| | | for(CommonOrder co : resultList){ |
| | | OrdersCMQManager.getInstance().addOrder(new CommonOrderMQMsg(co.getOrderNo(),co.getSourceType())); |
| | | } |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | startTime = param; |
| | | } |
| | | |
| | | List<CommonOrder> commonOrders = commonOrderService.listPayStateOrder(Constant.SOURCE_TYPE_TAOBAO, new Date(TimeUtil.convertToTimeTemp(startTime, "yyyyMMdd")), new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24L * 30)); |
| | | List<CommonOrder> commonOrders = commonOrderService.listPayStateOrder(Constant.SOURCE_TYPE_TAOBAO, new Date(TimeUtil.convertToTimeTemp(startTime, "yyyyMMdd")), new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24L * 30),1,200); |
| | | if (commonOrders == null || commonOrders.size() == 0) { |
| | | throw new Exception("没有订单需要更新"); |
| | | } |
| | |
| | | @XxlJob("order-vip-updateByLongTimeNoUpdate") |
| | | public ReturnT<String> updateByLongTimeNoUpdate(String param) throws Exception { |
| | | |
| | | List<CommonOrder> commonOrders = commonOrderService.listPayStateOrder(Constant.SOURCE_TYPE_VIP, null, new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24L * 10)); |
| | | List<CommonOrder> commonOrders = commonOrderService.listPayStateOrder(Constant.SOURCE_TYPE_VIP, new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24L * 60), new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24L * 10),1,200); |
| | | if (commonOrders == null || commonOrders.size() == 0) { |
| | | throw new Exception("没有需要更新的订单"); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<CommonOrder> listPayStateOrder(int sourceType, Date minThirdCreateTime, Date maxThirdCreateTime) { |
| | | public List<CommonOrder> listPayStateOrder(Integer sourceType, Date minThirdCreateTime, Date maxThirdCreateTime,int page,int pageSize) { |
| | | CommonOrderMapper.DaoQuery daoQuery = new CommonOrderMapper.DaoQuery(); |
| | | daoQuery.minThirdCreateTime = minThirdCreateTime; |
| | | daoQuery.maxThirdCreateTime = maxThirdCreateTime; |
| | | daoQuery.state = CommonOrder.STATE_FK; |
| | | daoQuery.sourceType = sourceType; |
| | | daoQuery.sortList = Arrays.asList(new String[]{"co_third_create_time ASC"}); |
| | | return commonOrderMapper.list(daoQuery, 0, 200); |
| | | return commonOrderMapper.list(daoQuery, (page-1)*pageSize, pageSize); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void fanliShare(Date maxTime) { |
| | | public int fanliShare(Date maxTime) { |
| | | // 查出邀请赚的用户ID |
| | | List<Integer> typeList = new ArrayList<>(); |
| | | typeList.add(HongBaoV2.TYPE_SHARE_GOODS); |
| | |
| | | } |
| | | } |
| | | |
| | | return uidSets.size(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | for (TaoBaoGoodsBrief goods : tempGoodsList) { |
| | | auctionIds.add(goods.getAuctionId()); |
| | | } |
| | | List<TaoBaoGoodsBrief> mList = taoBaoGoodsUpdateDao.listByAuctionIds(auctionIds); |
| | | List<TaoBaoGoodsBrief> mList =null; |
| | | try { |
| | | mList = taoBaoGoodsUpdateDao.listByAuctionIds(auctionIds); |
| | | }catch(Exception e){ |
| | | } |
| | | if (mList != null) |
| | | for (TaoBaoGoodsBrief goods : mList) { |
| | | if (goods.getUpdatetime().getTime() > System.currentTimeMillis() - 1000 * 60 * 60 * 24L)// 在1天内更新的数据才参与过滤 |
| | |
| | | * @param maxThirdCreateTime 最大第三方创建时间 |
| | | * @return |
| | | */ |
| | | public List<CommonOrder> listPayStateOrder(int sourceType, Date minThirdCreateTime, Date maxThirdCreateTime); |
| | | public List<CommonOrder> listPayStateOrder(Integer sourceType, Date minThirdCreateTime, Date maxThirdCreateTime,int page,int pageSize); |
| | | |
| | | } |
| | |
| | | |
| | | public void fanliPreInvaite(Date maxTime); |
| | | |
| | | public void fanliShare(Date maxTime); |
| | | public int fanliShare(Date maxTime); |
| | | |
| | | /** |
| | | * 结算团队奖金+补贴 |
| | |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | DYOrderFilter filter=new DYOrderFilter(); |
| | | filter.setTime_type("update"); |
| | | filter.setOrder_type(1); |
| | | filter.setSize(50); |
| | | filter.setCursor("0"); |
| | | filter.setStart_time(TimeUtil.convertToTimeTemp("2022-12-18","yyyy-MM-dd")/1000); |
| | | filter.setEnd_time(TimeUtil.convertToTimeTemp("2022-12-19","yyyy-MM-dd")/1000); |
| | | |
| | | DYOrderResult result = orderList(filter); |
| | | System.out.println(result); |
| | | // goodsDetails(Arrays.asList(new Long[]{3549871967593209780L})); |
| | | // DYOrderFilter filter=new DYOrderFilter(); |
| | | // filter.setTime_type("update"); |
| | | // filter.setOrder_type(1); |
| | | // filter.setSize(50); |
| | | // filter.setCursor("0"); |
| | | // filter.setStart_time(TimeUtil.convertToTimeTemp("2022-12-18","yyyy-MM-dd")/1000); |
| | | // filter.setEnd_time(TimeUtil.convertToTimeTemp("2022-12-19","yyyy-MM-dd")/1000); |
| | | // |
| | | // DYOrderResult result = orderList(filter); |
| | | // System.out.println(result); |
| | | goodsDetails(Arrays.asList(new Long[]{3549871967593209780L})); |
| | | // DYOrder order = getOrderDetail("5005828634543277401", 1); |
| | | |
| | | } |