| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import com.yeshi.fanli.entity.accept.AdminAcceptData; |
| | | import com.yeshi.fanli.util.OrderConstant; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | return; |
| | | } |
| | | } else if (riskType == 3) { |
| | | money = new BigDecimal(100); |
| | | money = OrderConstant.BIG_ORDER_MONEY; |
| | | minTime = new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24 * 180L); |
| | | } |
| | | } |
| | |
| | | * 当前未收货订单数 |
| | | * |
| | | * @param callback |
| | | * @param type |
| | | * 订单状态-暂未使用 |
| | | * @param type 订单状态-暂未使用 |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getHistoryUnreceived") |
| | |
| | | couponUrl = couponInfo.getLink(); |
| | | } |
| | | String materialId = "https://item.jd.com/" + goodsVO.getGoodsId() + ".html"; |
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "", |
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null,JDApiUtil.POSITION_SHARE + "", |
| | | user.getId() + ""); |
| | | } else if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_PDD) { |
| | | jumpLink = PinDuoDuoApiUtil.getPromotionUrl(Long.parseLong(goodsVO.getGoodsId()), |
| | |
| | | if (couponInfo != null) {
|
| | | // 券链接处理
|
| | | String materialId = "https://item.jd.com/" + id + ".html";
|
| | | String url = JDApiUtil.convertLinkWithSubUnionId(materialId, couponInfo.getLink(),
|
| | | String url = JDApiUtil.convertLinkWithSubUnionId(materialId, couponInfo.getLink(),null,
|
| | | JDApiUtil.POSITION_COUPON + "", null);
|
| | | couponInfo.setLink(url);
|
| | | }
|
| | |
| | | if (couponInfo != null) {
|
| | | couponUrl = couponInfo.getLink();
|
| | | }
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_COUPON + "",
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null,JDApiUtil.POSITION_COUPON + "",
|
| | | "");
|
| | | if (jumpLink == null) {
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, null, JDApiUtil.POSITION_COUPON + "",
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, null, null,JDApiUtil.POSITION_COUPON + "",
|
| | | "");
|
| | | }
|
| | | } else {
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_COUPON + "",
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null,JDApiUtil.POSITION_COUPON + "",
|
| | | "");
|
| | | if (StringUtil.isNullOrEmpty(jumpLink)) {
|
| | | jumpLink = couponUrl;
|
| | |
| | | if (couponInfo != null) {
|
| | | couponUrl = couponInfo.getLink();
|
| | | }
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_FANLI + "",
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null,JDApiUtil.POSITION_FANLI + "",
|
| | | uid + "");
|
| | | if (jumpLink == null) {
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, null, JDApiUtil.POSITION_FANLI + "",
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, null, null,JDApiUtil.POSITION_FANLI + "",
|
| | | uid + "");
|
| | | }
|
| | | } else {
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_FANLI + "",
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null,JDApiUtil.POSITION_FANLI + "",
|
| | | uid + "");
|
| | | if (StringUtil.isNullOrEmpty(jumpLink)) {
|
| | | jumpLink = couponUrl;
|
| | |
| | | String jumpLink = null;
|
| | | String materialId = "https://item.jd.com/" + id + ".html";
|
| | |
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_FANLI + "", null);
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null,JDApiUtil.POSITION_FANLI + "", null);
|
| | | if (StringUtil.isNullOrEmpty(jumpLink)) {
|
| | | jumpLink = couponUrl;
|
| | | }
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | link = JDApiUtil.convertLinkWithSubUnionId(link, null, JDApiUtil.POSITION_FANLI + "", uid + "");
|
| | | link = JDApiUtil.convertLinkWithSubUnionId(link, null, null,JDApiUtil.POSITION_FANLI + "", uid + "");
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("link", link);
|
| | |
| | | couponUrl = couponInfo.getLink(); |
| | | } |
| | | String materialId = "https://item.jd.com/" + goodsId + ".html"; |
| | | String jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "", uid + ""); |
| | | String jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null,JDApiUtil.POSITION_SHARE + "", uid + ""); |
| | | if (StringUtil.isNullOrEmpty(jumpLink)) { |
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, null, JDApiUtil.POSITION_SHARE + "", uid + ""); |
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, null, null,JDApiUtil.POSITION_SHARE + "", uid + ""); |
| | | } |
| | | |
| | | ShareInfoVO shareInfo = new ShareInfoVO(); |
| | |
| | | couponUrl = couponInfo.getLink(); |
| | | } |
| | | String materialId = "https://item.jd.com/" + goodsId + ".html"; |
| | | String shortLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "", |
| | | String shortLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null,JDApiUtil.POSITION_SHARE + "", |
| | | uid + ""); |
| | | |
| | | String content = shareGoodsTextTemplateService.createContentJD(template, goods, shortLink, hasCoupon); |
| | |
| | | }
|
| | |
|
| | | String materialId = "https://item.jd.com/" + id + ".html";
|
| | | String jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "",
|
| | | String jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null,JDApiUtil.POSITION_SHARE + "",
|
| | | uid);
|
| | |
|
| | | int priceType = 1;
|
| | |
| | | JSONObject paramsJson = JSONObject.fromObject(params);
|
| | | // 京东转链
|
| | | String url = paramsJson.optString("url");
|
| | | String link = JDApiUtil.convertLinkWithSubUnionId(url, null, JDApiUtil.POSITION_FANLI + "", uid + "");
|
| | | String link = JDApiUtil.convertLinkWithSubUnionId(url, null, null,JDApiUtil.POSITION_FANLI + "", uid + "");
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(link)) {
|
| | | out.print(JsonUtil.loadFalseResult("转链失败"));
|
| | |
| | | // 券链接处理
|
| | | String materialId = "https://item.jd.com/" + id + ".html";
|
| | | String url = JDApiUtil.convertLinkWithSubUnionId(materialId, couponInfo.getLink(),
|
| | | JDApiUtil.POSITION_COUPON + "", null);
|
| | | null,JDApiUtil.POSITION_COUPON + "", null);
|
| | | couponInfo.setLink(url);
|
| | | }
|
| | |
|
| | |
| | | if (share) {
|
| | | position = JDApiUtil.POSITION_SHARE;
|
| | | }
|
| | | String jdLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, position + "", subUnionId);
|
| | | String jdLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null,position + "", subUnionId);
|
| | | try {
|
| | | jumpLink = "/pages/union/proxy/proxy?spreadUrl=" + URLEncoder.encode(jdLink, "UTF-8");
|
| | | } catch (Exception e) {
|
| | |
| | | */
|
| | | List<UserMoneyDebt> listByUidWithHasLeftMoney(@Param("uid") Long uid, @Param("start") long start,
|
| | | @Param("count") int count);
|
| | |
|
| | | /**
|
| | | * 查询需要还欠款的用户ID
|
| | | * @param start
|
| | | * @param count
|
| | | * @return
|
| | | */
|
| | | List<Long> listUidWithHasDebtToRepay(@Param("start") long start,
|
| | | @Param("count") int count);
|
| | |
|
| | |
|
| | | long countUidWithHasDebtToRepay();
|
| | |
|
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dao.taobao; |
| | | |
| | | import com.yeshi.common.MongodbBaseDao; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrderBackUp; |
| | | import com.yeshi.fanli.entity.taobao.UserTLJBuyHistory; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | @Repository |
| | | public class TaoBaoOrderBackUpDao extends MongodbBaseDao<TaoBaoOrderBackUp> { |
| | | |
| | | |
| | | } |
| | |
| | | package com.yeshi.fanli.dto.taobao;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | |
| | | private boolean hasNext;
|
| | | private boolean hasPre;
|
| | | private String positionIndex;
|
| | | private List<TaoBaoOrder> orderList;
|
| | | private List<Serializable> orderList;
|
| | |
|
| | | public TaoBaoOrderResultDTO(boolean hasNext, boolean hasPre, String positionIndex, List<TaoBaoOrder> orderList) {
|
| | | public TaoBaoOrderResultDTO(boolean hasNext, boolean hasPre, String positionIndex, List<Serializable> orderList) {
|
| | | this.hasNext = hasNext;
|
| | | this.hasPre = hasPre;
|
| | | this.positionIndex = positionIndex;
|
| | |
| | | this.positionIndex = positionIndex;
|
| | | }
|
| | |
|
| | | public List<TaoBaoOrder> getOrderList() {
|
| | | public List<Serializable> getOrderList() {
|
| | | return orderList;
|
| | | }
|
| | |
|
| | | public void setOrderList(List<TaoBaoOrder> orderList) {
|
| | | public void setOrderList(List<Serializable> orderList) {
|
| | | this.orderList = orderList;
|
| | | }
|
| | | }
|
| | |
| | | VipShopOrderQueryModel model = new VipShopOrderQueryModel();
|
| | | model.setOrderTimeStart(orderTimeStart);
|
| | | model.setOrderTimeEnd(orderTimeEnd);
|
| | | if (status != null)
|
| | | model.setStatus(status);
|
| | | model.setPage(page);
|
| | | return model;
|
| | |
| | | package com.yeshi.fanli.entity.taobao;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | |
|
| | |
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | @Table("yeshi_ec_taobao_order")
|
| | | public class TaoBaoOrder {
|
| | | public class TaoBaoOrder implements Serializable {
|
| | | @Column(name = "to_id")
|
| | | private Long id;
|
| | |
|
New file |
| | |
| | | package com.yeshi.fanli.entity.taobao; |
| | | |
| | | |
| | | import org.springframework.data.annotation.Id; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Document(collection = "taoBaoOrderBackUp") |
| | | public class TaoBaoOrderBackUp implements Serializable { |
| | | @Id |
| | | private String tradeId; |
| | | private String orderId; |
| | | private String content;//订单内容 |
| | | |
| | | |
| | | public String getOrderId() { |
| | | return orderId; |
| | | } |
| | | |
| | | public void setOrderId(String orderId) { |
| | | this.orderId = orderId; |
| | | } |
| | | |
| | | public String getTradeId() { |
| | | return tradeId; |
| | | } |
| | | |
| | | public void setTradeId(String tradeId) { |
| | | this.tradeId = tradeId; |
| | | } |
| | | |
| | | public String getContent() { |
| | | return content; |
| | | } |
| | | |
| | | public void setContent(String content) { |
| | | this.content = content; |
| | | } |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.job.money; |
| | | |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.handler.annotation.XxlJob; |
| | | import com.yeshi.fanli.service.inter.money.UserMoneyDebtService; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Component |
| | | public class UserMoneyJob { |
| | | |
| | | @Resource |
| | | private UserMoneyDebtService userMoneyDebtService; |
| | | |
| | | /** |
| | | * 还账 |
| | | * |
| | | * @param param 用户ID |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("usermoney-repayDebt") |
| | | public ReturnT<String> repayDebt(String param) throws Exception { |
| | | if (!StringUtil.isNullOrEmpty(param)) { |
| | | userMoneyDebtService.repayDebt(Long.parseLong(param)); |
| | | } else { |
| | | long count = userMoneyDebtService.countNeedRepayDebtUser(); |
| | | int page = (int) (count % 100 == 0 ? count / 100 : count / 100 + 1); |
| | | for (int i = 0; i < page; i++) { |
| | | List<Long> uids = userMoneyDebtService.listNeedRepayDebtUser(i + 1, 100); |
| | | for (long uid : uids) { |
| | | userMoneyDebtService.repayDebt(uid); |
| | | } |
| | | } |
| | | } |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.job.order.taobao; |
| | | |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.handler.annotation.XxlJob; |
| | | import com.yeshi.fanli.dao.taobao.TaoBaoOrderBackUpDao; |
| | | import com.yeshi.fanli.dto.taobao.WeiQuanOrderResult; |
| | | import com.yeshi.fanli.entity.bus.user.LostOrder; |
| | | import com.yeshi.fanli.entity.bus.user.Order; |
| | | import com.yeshi.fanli.entity.order.CommonOrder; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrderBackUp; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder; |
| | | import com.yeshi.fanli.log.LogHelper; |
| | | import com.yeshi.fanli.service.inter.common.DataMonitorService; |
| | | import com.yeshi.fanli.service.inter.order.*; |
| | | import com.yeshi.fanli.service.inter.order.tb.TaoBaoOrderService; |
| | | import com.yeshi.fanli.service.inter.order.tb.TaoBaoWeiQuanOrderService; |
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService; |
| | | import com.yeshi.fanli.util.*; |
| | | import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil; |
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil; |
| | | import com.yeshi.fanli.util.taobao.TaoKeOrderApiUtil; |
| | | import org.springframework.stereotype.Component; |
| | | import org.yeshi.utils.TimeUtil; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | |
| | | //从淘宝爬去订单更新 |
| | | @Component |
| | | public class TaoBaoOrderBackUpJob { |
| | | @Resource |
| | | private TaoBaoOrderBackUpDao taoBaoOrderBackUpDao; |
| | | |
| | | //同步某一天的订单 |
| | | private void syncOrder(Date day, int queryType, int status, int orderSence) { |
| | | long startTime = TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(day.getTime(), "yyyy-MM-dd"), "yyyy-MM-dd"); |
| | | long endTime = startTime + 1000 * 60 * 60 * 24L; |
| | | List<TaoBaoOrderBackUp> backUpList = TaoKeOrderApiUtil.getTaoBaoOrderBackUpList(startTime, endTime, status, queryType, orderSence); |
| | | for (TaoBaoOrderBackUp backUp : backUpList) { |
| | | taoBaoOrderBackUpDao.save(backUp); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 同步订单 |
| | | * |
| | | * @param day |
| | | */ |
| | | public void syncOrder(Date day) { |
| | | syncOrder(day, 1, 12, 1); |
| | | syncOrder(day, 1, 13, 1); |
| | | syncOrder(day, 1, 3, 1); |
| | | |
| | | syncOrder(day, 3, 12, 1); |
| | | syncOrder(day, 3, 13, 1); |
| | | syncOrder(day, 3, 3, 1); |
| | | } |
| | | |
| | | |
| | | //同步90天到88天的订单 |
| | | @XxlJob("order-taobao-backUpOrderHandler") |
| | | public ReturnT<String> syncOrder(String param) throws Exception { |
| | | long now = TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd"), "yyyy-MM-dd"); |
| | | for (int i = 90; i > 87; i--) { |
| | | syncOrder(new Date(now - 1000 * 60 * 60L * 24 * i)); |
| | | } |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | |
|
| | |
|
| | | @XxlJob("order-updateTaoBaoOrderByOrderId")
|
| | | public ReturnT<String> updateTaoBaoOrderByOrderId(String param) throws Exception {
|
| | | List<TaoBaoOrder> orderList = taoBaoOrderService.getTaoBaoOrderByOrderId(param);
|
| | | Map<String, List<TaoBaoOrder>> orders = new HashMap<>();
|
| | | orders.put(param, orderList);
|
| | | orderProcessService.processOrder(orders);
|
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | /**
|
| | | * 更新最近的本地单(30分钟更新一次)
|
| | | */
|
| | |
| | | /**
|
| | | * 保存订单
|
| | | *
|
| | | * @param VipShopOrderList
|
| | | * @param vipShopOrderList
|
| | | */
|
| | | public void saveVipShopOrders(List<VipShopOrder> vipShopOrderList) {
|
| | | //5分钟不更新就报警
|
| | |
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | //根据订单号更新
|
| | | @XxlJob("order-vip-updateByOrderSn")
|
| | | public ReturnT<String> updateByOrderSn(String param) throws Exception {
|
| | | List<VipShopOrder> orders = vipShopOrderService.listByOrderSn(param);
|
| | | if (orders == null || orders.size() == 0)
|
| | | throw new Exception("订单不存在");
|
| | |
|
| | | VipShopQueryOrderResultDTO result = VipShopApiUtil
|
| | | .getOrderList(VipShopOrderQueryModel.createOrderTime(orders.get(0).getOrderTime(), orders.get(0).getOrderTime() + 1000, null, 1));
|
| | | saveVipShopOrders(result.getOrderList());
|
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 按下单时间更新
|
| | | *
|
| | | * @param startTime
|
| | | * @param endTime void 返回类型
|
| | | * @throws
|
| | | * @Title: updateByOrderTime
|
| | | * @Description:
|
| | | * @param startTime
|
| | | * @param endTime |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | |
|
| | | public void updateByOrderTime(long startTime, long endTime) {
|
| | |
| | |
|
| | | /**
|
| | | * 按更新时间更新
|
| | | *
|
| | | * @param startTime
|
| | | * @param endTime void 返回类型
|
| | | * @throws
|
| | | * @Title: updateByOrderTime
|
| | | * @Description:
|
| | | * @param startTime
|
| | | * @param endTime |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | |
|
| | | public void updateByUpdateTime(long startTime, long endTime) {
|
| | |
| | | saveVipShopOrders(vipShopOrderList);
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
| | | couponUrl = couponInfo.getLink(); |
| | | } |
| | | String materialId = "https://item.jd.com/" + goodsId + ".html"; |
| | | String jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, |
| | | String jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl,null, |
| | | JDApiUtil.POSITION_SHARE + "", "1"); |
| | | String template = configService.getValue(ConfigKeyEnum.quickShareJDCommentText.getKey(), system); |
| | | if (jumpLink == null) { |
| | |
| | | couponUrl = couponInfo.getLink(); |
| | | } |
| | | String materialId = "https://item.jd.com/" + goodsDetailVO.getGoodsId() + ".html"; |
| | | String jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "", |
| | | String jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null,JDApiUtil.POSITION_SHARE + "", |
| | | "1"); |
| | | String template = configService.getValue(ConfigKeyEnum.quickShareJDCommentText.getKey(), system); |
| | | commentText = template.replace("[链接]", jumpLink); |
| | |
| | | return true;
|
| | | return false;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Long> listNeedRepayDebtUser(int page, int pageSize) {
|
| | | return userMoneyDebtMapper.listUidWithHasDebtToRepay((page - 1) * pageSize, pageSize);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countNeedRepayDebtUser() {
|
| | | return userMoneyDebtMapper.countUidWithHasDebtToRepay();
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import com.yeshi.fanli.util.*;
|
| | | import org.dom4j.Document;
|
| | | import org.dom4j.DocumentException;
|
| | | import org.dom4j.DocumentHelper;
|
| | |
| | | import com.yeshi.fanli.service.inter.push.PushService;
|
| | | import com.yeshi.fanli.service.inter.user.UserAccountBindingHistoryService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.util.AlipayUtil;
|
| | | import com.yeshi.fanli.util.CMQManager;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.GsonUtil;
|
| | | import org.yeshi.utils.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import org.yeshi.utils.TimeUtil;
|
| | | import com.yeshi.fanli.util.factory.UserMoneyDetailFactory;
|
| | |
|
| | |
| | | int less10Count = commonOrderCountService.countOderByUidAndLess10(user.getId());
|
| | | ExtractAuditRecord update = new ExtractAuditRecord();
|
| | | update.setId(auditRecord.getId());
|
| | | int orderCount50More = orderUserStatisticService.countOrderCount100MoreByUidAndMinTime(user.getId(),
|
| | | minTime);
|
| | | int orderCountBigMoneyOrder = orderUserStatisticService.countOrderMoneyMoreByUidAndMinTime(user.getId(),
|
| | | minTime, OrderConstant.BIG_ORDER_MONEY);
|
| | | BigDecimal weiQuanOrderFanAmount = orderUserStatisticService.sumWeiQuanOrderFanAmountByUid(user.getId(),
|
| | | minTime);
|
| | | int weiQuanOrderCount = orderUserStatisticService.countWeiQuanOrderByUid(user.getId(), minTime);
|
| | | update.setExtraInfoStr(new Gson().toJson(new ExtractOrderStatisticDTO(orderCount50More,
|
| | | update.setExtraInfoStr(new Gson().toJson(new ExtractOrderStatisticDTO(orderCountBigMoneyOrder,
|
| | | weiQuanOrderCount, weiQuanOrderFanAmount, 0, less10Count)));
|
| | | extractAuditRecordMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | |
| | | private HongBaoOrderMapper hongBaoOrderMapper;
|
| | |
|
| | | @Override
|
| | | public int countOrderCount100MoreByUidAndMinTime(Long uid, Date minTime) {
|
| | | return hongBaoOrderMapper.countOrderCountMoneyMoreByUidAndMinTime(uid, minTime, new BigDecimal(100));
|
| | | public int countOrderMoneyMoreByUidAndMinTime(Long uid, Date minTime,BigDecimal money) {
|
| | | return hongBaoOrderMapper.countOrderCountMoneyMoreByUidAndMinTime(uid, minTime,money);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | couponUrl = couponInfo.getLink();
|
| | | }
|
| | | String materialId = "https://item.jd.com/" + goodsId + ".html";
|
| | | String jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "",
|
| | | String jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null,JDApiUtil.POSITION_SHARE + "",
|
| | | user.getId() + "");
|
| | |
|
| | | boolean coupon = false;
|
| | |
| | | package com.yeshi.fanli.service.inter.money;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDebt;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDebt.UserMoneyDebtTypeEnum;
|
| | |
| | | */
|
| | | public boolean isHaveDebtToRepay(Long uid);
|
| | |
|
| | |
|
| | | /**
|
| | | * 查询需要偿还的用户列表
|
| | | *
|
| | | * @param page
|
| | | * @param pageSize
|
| | | * @return
|
| | | */
|
| | | public List<Long> listNeedRepayDebtUser(int page, int pageSize);
|
| | |
|
| | | /**
|
| | | * @return
|
| | | */
|
| | | public long countNeedRepayDebtUser();
|
| | | }
|
| | |
| | | * @param minTime
|
| | | * @return
|
| | | */
|
| | | public int countOrderCount100MoreByUidAndMinTime(Long uid, Date minTime);
|
| | | public int countOrderMoneyMoreByUidAndMinTime(Long uid, Date minTime,BigDecimal money);
|
| | |
|
| | | /**
|
| | | * 维权订单数量(包含邀请赚)
|
| | |
| | | for (String shortLink : linkSet) {
|
| | | String link = null;
|
| | | if (share)
|
| | | link = JDApiUtil.convertLinkWithSubUnionId(shortLink, null, JDApiUtil.POSITION_SHARE + "",
|
| | | link = JDApiUtil.convertLinkWithSubUnionId(shortLink, null, null,JDApiUtil.POSITION_SHARE + "",
|
| | | uid + "");
|
| | | else
|
| | | link = JDApiUtil.convertLinkWithSubUnionId(shortLink, null, JDApiUtil.POSITION_FANLI + "",
|
| | | link = JDApiUtil.convertLinkWithSubUnionId(shortLink, null, null,JDApiUtil.POSITION_FANLI + "",
|
| | | uid + "");
|
| | | if (!StringUtil.isNullOrEmpty(link)) {
|
| | | linkMap.put(shortLink, link);
|
New file |
| | |
| | | package com.yeshi.fanli.util; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | public class OrderConstant { |
| | | |
| | | //大额订单阈值 |
| | | public final static BigDecimal BIG_ORDER_MONEY = new BigDecimal(50); |
| | | } |
| | |
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import com.sun.istack.NotNull;
|
| | | import org.apache.commons.httpclient.HttpClient;
|
| | | import org.apache.commons.httpclient.methods.PostMethod;
|
| | |
|
| | |
| | | return resultJson.optJSONObject("data").optString("clickURL");
|
| | | }
|
| | |
|
| | | public static String convertLinkWithSubUnionId(String materialId, String couponUrl, String positionId,
|
| | | public static String convertLinkWithSubUnionId(@NotNull String materialId, String couponUrl, String giftCouponKey, @NotNull String positionId,
|
| | | String subUnionId) {
|
| | | String log = "京东转链出错:";
|
| | | try {
|
| | | JSONObject json = new JSONObject();
|
| | | json.put("materialId", materialId);
|
| | |
|
| | | json.put("siteId", APP_ID);
|
| | | json.put("positionId", positionId);
|
| | | json.put("materialId", materialId);
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(giftCouponKey)) {
|
| | | json.put("giftCouponKey", giftCouponKey);
|
| | | }
|
| | | if (!StringUtil.isNullOrEmpty(couponUrl))
|
| | | json.put("couponUrl", couponUrl);
|
| | |
|
| | |
| | | /**
|
| | | * 关键词商品查询接口【申请】
|
| | | *
|
| | | * @param skuIdList
|
| | | * @param filter
|
| | | * @return
|
| | | */
|
| | | public static JDSearchResult queryByKey(JDFilter filter) {
|
| | |
| | | * @param page
|
| | | * @param pageSize
|
| | | * @param time
|
| | | * @param type
|
| | | * 时间类型 1-下单时间 2-完成时间 3-更新时间
|
| | | * @param type 时间类型 1-下单时间 2-完成时间 3-更新时间
|
| | | * @return
|
| | | */
|
| | | public static JDOrderResult getOrderList(int page, int pageSize, Date time, int type) {
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | |
|
| | | public static String createLiJin(String sku) {
|
| | | JSONObject json = new JSONObject();
|
| | | JSONObject couponReq = new JSONObject();
|
| | | couponReq.put("skuMaterialId", sku);
|
| | | couponReq.put("discount", 10);
|
| | | couponReq.put("amount", 5);
|
| | | couponReq.put("receiveStartTime", TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd HH"));
|
| | | couponReq.put("receiveEndTime", TimeUtil.getGernalTime(System.currentTimeMillis() + 1000 * 60 * 2, "yyyy-MM-dd HH"));
|
| | | couponReq.put("isSpu", 0);
|
| | | couponReq.put("expireType", 2);
|
| | | couponReq.put("useStartTime", TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd"));
|
| | | couponReq.put("useEndTime", TimeUtil.getGernalTime(System.currentTimeMillis() + 1000 * 60 * 60L * 24, "yyyy-MM-dd"));
|
| | | couponReq.put("share", 1);
|
| | | couponReq.put("contentMatch", 0);
|
| | |
|
| | | json.put("couponReq", couponReq);
|
| | | String result = baseRequest2("jd.union.open.coupon.gift.get", null, json);
|
| | | System.out.println(result);
|
| | | JSONObject root = JSONObject.fromObject(result).optJSONObject("jd_union_open_coupon_gift_get_response");
|
| | | if (root.optInt("code") == 0) {
|
| | | boolean hasMore = root.optBoolean("hasMore");
|
| | | root = JSONObject.fromObject(root.optString("result"));
|
| | | if (root.optInt("code") == 200 && root.optJSONObject("data") != null) {
|
| | | JSONObject data = root.optJSONObject("data");
|
| | | String giftCouponKey = data.optString("giftCouponKey");
|
| | | return giftCouponKey;
|
| | | }
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | |
|
| | | public static void toolConvert() {
|
| | | JSONObject json = new JSONObject();
|
| | | JSONObject couponReq = new JSONObject();
|
| | | couponReq.put("materialId", "https://item.jd.com/71751967284.html");
|
| | | couponReq.put("unionId", "2011217145");
|
| | | // couponReq.put("pid", "2011217145_4100059717_3003005722");
|
| | | couponReq.put("subUnionId", "123_437032");
|
| | | couponReq.put("giftCouponKey","123123123123");
|
| | | json.put("promotionCodeReq", couponReq);
|
| | | String result = baseRequest2("jd.union.open.promotion.byunionid.get", null, json);
|
| | | System.out.println(result);
|
| | | }
|
| | |
|
| | | public static void toolOrder() {
|
| | | JSONObject json = new JSONObject();
|
| | | JSONObject couponReq = new JSONObject();
|
| | | couponReq.put("pageIndex", 1);
|
| | | couponReq.put("pageSize", 20);
|
| | | couponReq.put("type", 3);
|
| | | couponReq.put("startTime", "2020-10-31 16:00:00");
|
| | | couponReq.put("endTime", "2020-10-31 16:55:00");
|
| | | // couponReq.put("key", "026eea846250e0dcbcacd750faf07de0");
|
| | |
|
| | |
|
| | | // couponReq.put("pid", "2011217145_4100059717_3003005722");
|
| | | couponReq.put("childUnionId", "2011217145");
|
| | | json.put("orderReq", couponReq);
|
| | | String result = baseRequest2("jd.union.open.order.row.query", null, json);
|
| | | System.out.println(result);
|
| | | }
|
| | |
|
| | |
|
| | | public static void test() {
|
| | | JSONObject json = new JSONObject();
|
| | | json.put("materialId", "https://item.jd.com/32376790478.html");
|
New file |
| | |
| | | package com.yeshi.fanli.util.rocketmq.consumer.user; |
| | | |
| | | import com.aliyun.openservices.ons.api.Action; |
| | | import com.aliyun.openservices.ons.api.ConsumeContext; |
| | | import com.aliyun.openservices.ons.api.Message; |
| | | import com.aliyun.openservices.ons.api.MessageListener; |
| | | import com.google.gson.Gson; |
| | | import com.yeshi.fanli.dto.mq.order.OrderTopicTagEnum; |
| | | import com.yeshi.fanli.dto.mq.order.body.OrderConfirmMQMsg; |
| | | import com.yeshi.fanli.dto.mq.order.body.OrderMoneyRecievedMQMsg; |
| | | import com.yeshi.fanli.dto.mq.user.UserTopicTagEnum; |
| | | import com.yeshi.fanli.dto.mq.user.body.UserLevelChangedMQMsg; |
| | | import com.yeshi.fanli.dto.mq.user.body.UserMoneyChangeMQMsg; |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.entity.SystemFunction; |
| | | import com.yeshi.fanli.entity.bus.user.UserActiveLog; |
| | | import com.yeshi.fanli.entity.bus.user.UserInfo; |
| | | import com.yeshi.fanli.log.LogHelper; |
| | | import com.yeshi.fanli.service.inter.money.UserMoneyDebtService; |
| | | import com.yeshi.fanli.service.inter.user.UserActiveLogService; |
| | | import com.yeshi.fanli.service.inter.user.UserInfoService; |
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce; |
| | | import com.yeshi.fanli.service.inter.user.invite.UserInviteValidNumService; |
| | | import com.yeshi.fanli.service.inter.user.vip.TeamUserLevelStatisticService; |
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPPreInfoService; |
| | | import com.yeshi.fanli.util.Constant; |
| | | import com.yeshi.fanli.util.SystemInfoUtil; |
| | | import com.yeshi.fanli.util.VersionUtil; |
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 用户超级会员 |
| | | * |
| | | * @author Administrator |
| | | */ |
| | | @Component |
| | | public class UserMoneyDebtMessageListener implements MessageListener { |
| | | @Resource |
| | | private UserMoneyDebtService userMoneyDebtService; |
| | | |
| | | |
| | | @Override |
| | | public Action consume(Message message, ConsumeContext context) { |
| | | |
| | | LogHelper.mqInfo("consumer-UserMoneyMessageListener", message.getMsgID(), message.getTopic(), message.getTag(), |
| | | new String(message.getBody())); |
| | | String tag = message.getTag(); |
| | | if (tag == null) |
| | | tag = ""; |
| | | |
| | | // 资金偿还 |
| | | if (MQTopicName.TOPIC_USER.name().equalsIgnoreCase(message.getTopic())) { |
| | | if (tag.equalsIgnoreCase(UserTopicTagEnum.userMoneyAdd.name())) {//用户资金增加 |
| | | UserMoneyChangeMQMsg msg = new Gson().fromJson(new String(message.getBody()), |
| | | UserMoneyChangeMQMsg.class); |
| | | userMoneyDebtService.repayDebt(msg.getUid()); |
| | | return Action.CommitMessage; |
| | | } |
| | | } |
| | | return Action.CommitMessage; |
| | | } |
| | | } |
| | |
| | | package com.yeshi.fanli.util.taobao;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | |
| | | import com.yeshi.fanli.dto.order.OrderQuery;
|
| | | import com.yeshi.fanli.dto.taobao.TaoBaoOrderResultDTO;
|
| | | import com.yeshi.fanli.dto.taobao.WeiQuanOrderResult;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrderGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoPunishOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder;
|
| | | import com.yeshi.fanli.entity.taobao.*;
|
| | | import com.yeshi.common.entity.taobao.TaoKeAppInfo;
|
| | | import com.yeshi.fanli.exception.taobao.TaoKeApiException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | |
| | |
|
| | | TaoBaoOrderResultDTO dto = new TaoBaoOrderResultDTO(false, false, null, new ArrayList<>());
|
| | |
|
| | | List<TaoBaoOrder> orderList = new ArrayList<>();
|
| | | List<Serializable> orderList = new ArrayList<>();
|
| | | JSONArray array = null;
|
| | | JSONObject data = JSONObject.fromObject(response);
|
| | | try {
|
| | |
| | | dto.setOrderList(orderList);
|
| | | return dto;
|
| | | }
|
| | |
|
| | |
|
| | | private static TaoBaoOrderResultDTO parseTaoBaoOrderForBackUp(String response) {
|
| | |
|
| | | TaoBaoOrderResultDTO dto = new TaoBaoOrderResultDTO(false, false, null, new ArrayList<>());
|
| | |
|
| | | List<Serializable> orderList = new ArrayList<>();
|
| | | JSONArray array = null;
|
| | | JSONObject data = JSONObject.fromObject(response);
|
| | | try {
|
| | | JSONObject rootData = data.optJSONObject("tbk_order_details_get_response").optJSONObject("data");
|
| | | array = rootData.optJSONObject("results").optJSONArray("publisher_order_dto");
|
| | | dto.setHasPre(rootData.optBoolean("has_pre"));
|
| | | dto.setPositionIndex(rootData.optString("position_index"));
|
| | | dto.setHasNext(rootData.optBoolean("has_next"));
|
| | | } catch (Exception e) {
|
| | | return dto;
|
| | | }
|
| | |
|
| | | if (array != null)
|
| | | for (int i = 0; i < array.size(); i++) {
|
| | | JSONObject item = array.optJSONObject(i);
|
| | | try {
|
| | | String tradeId = item.optString("trade_id");
|
| | | String orderId = item.optString("trade_parent_id");
|
| | | TaoBaoOrderBackUp orderBackUp = new TaoBaoOrderBackUp();
|
| | | orderBackUp.setContent(item.toString());
|
| | | orderBackUp.setTradeId(tradeId);
|
| | | orderBackUp.setOrderId(orderId);
|
| | | orderList.add(orderBackUp);
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e, "订单号信息:" + item.toString(), "订单解析出错");
|
| | | } catch (Exception e1) {
|
| | | }
|
| | | }
|
| | | }
|
| | | dto.setOrderList(orderList);
|
| | | return dto;
|
| | | }
|
| | |
|
| | |
|
| | | public static WeiQuanOrderResult getTaoBaoRelationWeiQuanOrderList(Date startTime, int searchType, int page,
|
| | | boolean third) {
|
| | |
| | | }
|
| | |
|
| | | public static List<TaoBaoOrder> getTaoBaoOrderList(long startTime, long endTime, int queryType, int orderScene) {
|
| | | List<TaoBaoOrder> orderList = new ArrayList<>();
|
| | | List<Serializable> orderList = new ArrayList<>();
|
| | | // 跨度20分钟
|
| | | long span = (1000 * 60 * 20L);
|
| | | long jianGe = endTime - startTime;
|
| | |
| | | if (end > endTime)
|
| | | end = endTime;
|
| | | TaoBaoOrderResultDTO dto = queryNewOrder(TimeUtil.getGernalTime(start, "yyyy-MM-dd HH:mm:ss"),
|
| | | TimeUtil.getGernalTime(end, "yyyy-MM-dd HH:mm:ss"), null, queryType, orderScene);
|
| | | TimeUtil.getGernalTime(end, "yyyy-MM-dd HH:mm:ss"), null, null, queryType, orderScene, new TaoBaoOrder());
|
| | | if (dto != null)
|
| | | orderList.addAll(dto.getOrderList());
|
| | | while (dto!=null&&dto.isHasNext()) {
|
| | | dto = queryNewOrder(TimeUtil.getGernalTime(start, "yyyy-MM-dd HH:mm:ss"),
|
| | | TimeUtil.getGernalTime(end, "yyyy-MM-dd HH:mm:ss"), dto.getPositionIndex(), queryType,
|
| | | orderScene);
|
| | | TimeUtil.getGernalTime(end, "yyyy-MM-dd HH:mm:ss"), dto.getPositionIndex(), null, queryType,
|
| | | orderScene, new TaoBaoOrder());
|
| | | if (dto != null)
|
| | | orderList.addAll(dto.getOrderList());
|
| | | }
|
| | | }
|
| | | return orderList;
|
| | | List<TaoBaoOrder> orders = new ArrayList<>();
|
| | | for (Serializable s : orderList)
|
| | | orders.add((TaoBaoOrder) s);
|
| | |
|
| | | return orders;
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 获取淘宝订单备份数据
|
| | | *
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @param status 12-付款,13-关闭,14-确认收货,3-结算成功;不传
|
| | | * @param queryType 1:按照订单淘客创建时间查询,2:按照订单淘客付款时间查询,3:按照订单淘客结算时间查询
|
| | | * @param orderScene 1:常规订单,2:渠道订单,3:会员运营订单
|
| | | * @return
|
| | | */
|
| | | public static List<TaoBaoOrderBackUp> getTaoBaoOrderBackUpList(long startTime, long endTime, Integer status, int queryType, int orderScene) {
|
| | | List<Serializable> orderList = new ArrayList<>();
|
| | | // 跨度20分钟
|
| | | long span = (1000 * 60 * 20L);
|
| | | long jianGe = endTime - startTime;
|
| | | long page = jianGe % span == 0 ? jianGe / span : jianGe / span + 1;
|
| | | if (page == 0)
|
| | | page = 1;
|
| | | for (int i = 1; i <= page; i++) {
|
| | | long start = startTime + (i - 1) * span;
|
| | | long end = start + span;
|
| | | if (end > endTime)
|
| | | end = endTime;
|
| | | TaoBaoOrderResultDTO dto = queryNewOrder(TimeUtil.getGernalTime(start, "yyyy-MM-dd HH:mm:ss"),
|
| | | TimeUtil.getGernalTime(end, "yyyy-MM-dd HH:mm:ss"), null, status, queryType, orderScene, new TaoBaoOrderBackUp());
|
| | | if (dto != null)
|
| | | orderList.addAll(dto.getOrderList());
|
| | | while (dto != null && dto.isHasNext()) {
|
| | | dto = queryNewOrder(TimeUtil.getGernalTime(start, "yyyy-MM-dd HH:mm:ss"),
|
| | | TimeUtil.getGernalTime(end, "yyyy-MM-dd HH:mm:ss"), dto.getPositionIndex(), status, queryType,
|
| | | orderScene, new TaoBaoOrderBackUp());
|
| | | if (dto != null)
|
| | | orderList.addAll(dto.getOrderList());
|
| | |
|
| | | try {
|
| | | Thread.sleep(1000);
|
| | | } catch (InterruptedException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | try {
|
| | | Thread.sleep(1000);
|
| | | } catch (InterruptedException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | List<TaoBaoOrderBackUp> orders = new ArrayList<>();
|
| | | for (Serializable s : orderList)
|
| | | orders.add((TaoBaoOrderBackUp) s);
|
| | |
|
| | | return orders;
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @param positionIndex
|
| | | * @param queryType
|
| | | * 1:按照订单淘客创建时间查询,2:按照订单淘客付款时间查询,3:按照订单淘客结算时间查询
|
| | | * @param queryType 1:按照订单淘客创建时间查询,2:按照订单淘客付款时间查询,3:按照订单淘客结算时间查询
|
| | | * @param orderScene
|
| | | * @return
|
| | | */
|
| | | private static TaoBaoOrderResultDTO queryNewOrder(String startTime, String endTime, String positionIndex,
|
| | | int queryType, int orderScene) {
|
| | | private static TaoBaoOrderResultDTO queryNewOrder(String startTime, String endTime, String positionIndex, Integer status,
|
| | | int queryType, int orderScene, Serializable clazz) {
|
| | | Map<String, String> params = new HashMap<>();
|
| | | params.put("query_type", queryType + "");
|
| | | if (status != null)
|
| | | params.put("tk_status", status + "");
|
| | | params.put("page_size", "100");
|
| | | params.put("start_time", startTime);
|
| | | params.put("end_time", endTime);
|
| | |
| | | JSONObject json = TaoKeBaseUtil.baseRequest(params, app);
|
| | | if (Constant.IS_TEST)
|
| | | System.out.println(json);
|
| | | if (clazz instanceof TaoBaoOrder)
|
| | | return parseTaoBaoOrderNew(json.toString());
|
| | | else
|
| | | return parseTaoBaoOrderForBackUp(json.toString());
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | from yeshi_ec_user_debt where ud_uid=#{uid} and ud_left_money>0 limit #{start},#{count} |
| | | </select> |
| | | |
| | | |
| | | <select id="listUidWithHasDebtToRepay" resultType="java.lang.Long"> |
| | | SELECT DISTINCT( d.`ud_uid`) FROM `yeshi_ec_user_debt` d WHERE d.`ud_left_money`>0 limit #{start},#{count} |
| | | </select> |
| | | |
| | | |
| | | <select id="countUidWithHasDebtToRepay" resultType="java.lang.Long"> |
| | | SELECT COUNT( DISTINCT( d.`ud_uid`)) FROM `yeshi_ec_user_debt` d WHERE d.`ud_left_money`>0 |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_user_debt where ud_id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | |
| | | </property>
|
| | | </bean>
|
| | |
|
| | | <!--用户贷款资金订阅 -->
|
| | |
|
| | | <bean id="userMoneyDebtMessageListener"
|
| | | class="com.yeshi.fanli.util.rocketmq.consumer.user.UserMoneyDebtMessageListener"></bean>
|
| | | <bean id="userMoneyDebtConsumer" class="com.aliyun.openservices.ons.api.bean.ConsumerBean"
|
| | | init-method="start" destroy-method="shutdown">
|
| | | <property name="properties"> <!--消费者配置信息 -->
|
| | | <props>
|
| | | <prop key="AccessKey">${rocketmq.AccessKey}</prop>
|
| | | <prop key="SecretKey">${rocketmq.SecretKey}</prop>
|
| | | <prop key="GROUP_ID">GID_USER_MONEY_DEBT</prop>
|
| | | <prop key="NAMESRV_ADDR">${rocketmq.NAMESRV_ADDR}</prop>
|
| | | <prop key="ConsumeThreadNums">50</prop>
|
| | | </props>
|
| | | </property>
|
| | | <property name="subscriptionTable">
|
| | | <map>
|
| | | <entry value-ref="userMoneyDebtMessageListener">
|
| | | <key>
|
| | | <bean class="com.aliyun.openservices.ons.api.bean.Subscription">
|
| | | <property name="topic" value="TOPIC_USER" />
|
| | | <property name="expression" value="userMoneyAdd" />
|
| | | </bean>
|
| | | </key>
|
| | | </entry>
|
| | | </map>
|
| | | </property>
|
| | | </bean>
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | <!-- 测试消息订阅 -->
|
| | | <bean id="testRocketMQCosumerListener"
|
| | |
| | | </bean>
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | </beans> |