New file |
| | |
| | | 2020-08-09 13:39:03 [ Curator-Framework-0:69946 ] - [ ERROR ] Connection timed out for connection string (134.175.68.214:2181) and timeout (3000) / elapsed (5046) |
| | | org.apache.curator.CuratorConnectionLossException: KeeperErrorCode = ConnectionLoss |
| | | at org.apache.curator.ConnectionState.checkTimeouts(ConnectionState.java:225) |
| | | at org.apache.curator.ConnectionState.getZooKeeper(ConnectionState.java:94) |
| | | at org.apache.curator.CuratorZookeeperClient.getZooKeeper(CuratorZookeeperClient.java:117) |
| | | at org.apache.curator.framework.imps.CuratorFrameworkImpl.performBackgroundOperation(CuratorFrameworkImpl.java:835) |
| | | at org.apache.curator.framework.imps.CuratorFrameworkImpl.backgroundOperationsLoop(CuratorFrameworkImpl.java:809) |
| | | at org.apache.curator.framework.imps.CuratorFrameworkImpl.access$300(CuratorFrameworkImpl.java:64) |
| | | at org.apache.curator.framework.imps.CuratorFrameworkImpl$4.call(CuratorFrameworkImpl.java:267) |
| | | at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) |
| | | at java.util.concurrent.FutureTask.run(FutureTask.java) |
| | | at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) |
| | | at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) |
| | | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) |
| | | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) |
| | | at java.lang.Thread.run(Thread.java:748) |
| | | 2020-08-09 13:39:24 [ pushExecutor-5:91460 ] - [ ERROR ] Attempt to send Notification failed and beyond the maximum number of attempts permitted |
| | | 2020-08-09 13:39:24 [ pushExecutor-5:91461 ] - [ ERROR ] Delivery error |
| | | java.net.SocketException: Connection reset |
| | | at java.net.SocketInputStream.read(SocketInputStream.java:210) |
| | | at java.net.SocketInputStream.read(SocketInputStream.java:141) |
| | | at sun.security.ssl.InputRecord.readFully(InputRecord.java:465) |
| | | at sun.security.ssl.InputRecord.read(InputRecord.java:503) |
| | | at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983) |
| | | at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385) |
| | | at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:757) |
| | | at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:123) |
| | | at java.io.OutputStream.write(OutputStream.java:75) |
| | | at javapns.notification.PushNotificationManager.sendNotification(PushNotificationManager.java:402) |
| | | at javapns.notification.PushNotificationManager.sendNotification(PushNotificationManager.java:350) |
| | | at javapns.notification.PushNotificationManager.sendNotifications(PushNotificationManager.java:286) |
| | | at com.yeshi.fanli.util.push.IOSPushUtil.pushIOS(IOSPushUtil.java:172) |
| | | at com.yeshi.fanli.util.push.IOSPushUtil.allPushIOS(IOSPushUtil.java:124) |
| | | at com.yeshi.fanli.service.impl.push.IOSPushServiceImpl.pushZNX(IOSPushServiceImpl.java:253) |
| | | at com.yeshi.fanli.service.impl.push.IOSPushServiceImpl$$FastClassBySpringCGLIB$$9f77791e.invoke(<generated>) |
| | | at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) |
| | | at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720) |
| | | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) |
| | | at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85) |
| | | at com.yeshi.fanli.aspect.VersionLimitAspect.requestSerializable(VersionLimitAspect.java:93) |
| | | at sun.reflect.GeneratedMethodAccessor100.invoke(Unknown Source) |
| | | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) |
| | | at java.lang.reflect.Method.invoke(Method.java:498) |
| | | at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:629) |
| | | at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:618) |
| | | at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70) |
| | | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) |
| | | at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85) |
| | | at com.yeshi.fanli.aspect.RequestSerializableServiceAspect.requestSerializable(RequestSerializableServiceAspect.java:113) |
| | | at sun.reflect.GeneratedMethodAccessor99.invoke(Unknown Source) |
| | | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) |
| | | at java.lang.reflect.Method.invoke(Method.java:498) |
| | | at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:629) |
| | | at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:618) |
| | | at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70) |
| | | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) |
| | | at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) |
| | | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) |
| | | at org.springframework.aop.interceptor.AsyncExecutionInterceptor$1.call(AsyncExecutionInterceptor.java:115) |
| | | at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) |
| | | at java.util.concurrent.FutureTask.run(FutureTask.java) |
| | | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) |
| | | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) |
| | | at java.lang.Thread.run(Thread.java:748) |
| | | 2020-08-09 13:39:24 [ pushExecutor-5:91462 ] - [ ERROR ] Delivery error: java.net.SocketException: Connection reset |
| | | 2020-08-09 13:39:24 [ pushExecutor-5:91462 ] - [ ERROR ] Delivery error: java.net.SocketException: Socket Closed |
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | return obj;
|
| | |
|
| | | }
|
| | | }
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping("orderParse")
|
| | | public void dubboGoodsService(int sourceType, HttpServletResponse response, PrintWriter out) {
|
| | | public void orderParse(int sourceType, HttpServletResponse response, PrintWriter out) {
|
| | | if (isParseOrderNormal(sourceType+"")) {
|
| | | out.print("200");
|
| | | } else {
|
| | |
| | | import java.net.URLEncoder; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | |
| | | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.entity.accept.AdminAcceptData; |
| | | import com.yeshi.fanli.entity.order.CommonOrder; |
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService; |
| | | import com.yeshi.fanli.service.inter.user.UserInfoService; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | |
| | | @Resource |
| | | private CommonOrderCountService commonOrderCountService; |
| | | |
| | | @Resource |
| | | private CommonOrderService commonOrderService; |
| | | |
| | | @Resource |
| | | private UserInfoService userInfoService; |
| | |
| | | // 查询同店铺商品,同商品订单超过一定数量的 |
| | | List<Integer> typeList = new ArrayList<>(); |
| | | typeList.add(HongBaoV2.TYPE_ZIGOU); |
| | | long sameGoodsOrderCount = commonOrderCountService.countSameGoodsOrderByUidAndHongBaoType(typeList, uid, |
| | | |
| | | List<Long> goodsIds = commonOrderCountService.listSameGoodsIdByUidAndHongBaoType(typeList, uid, |
| | | Integer.parseInt(configService.getValue(ConfigKeyEnum.adminMinSameGoodsOrderCount.getKey(), acceptData.getSystem()))); |
| | | int sameGoodsDangerCount = 0; |
| | | if (goodsIds.size() > 0) { |
| | | for (int i = 0; i < goodsIds.size(); i++) { |
| | | long goodsId = goodsIds.get(i); |
| | | Date minDate = new Date(System.currentTimeMillis() - 1000 * 60 * 60L * 24 * 365L); |
| | | List<CommonOrder> commonOrdersList = commonOrderService.listByGoodsIdAndUidAndMinThirdCreateTime(goodsId, uid, minDate); |
| | | Map<String, Date> cmap = new HashMap<>(); |
| | | if (commonOrdersList != null) |
| | | for (CommonOrder co : commonOrdersList) { |
| | | if (co.getState() == CommonOrder.STATE_FK || co.getState() == CommonOrder.STATE_JS || co.getState() == CommonOrder.STATE_WQ) |
| | | cmap.put(co.getOrderNo(), co.getThirdCreateTime()); |
| | | } |
| | | List<Date> dateList = new ArrayList<>(); |
| | | for (Iterator<String> its = cmap.keySet().iterator(); its.hasNext(); ) { |
| | | String orderNo = its.next(); |
| | | dateList.add(cmap.get(orderNo)); |
| | | } |
| | | Collections.sort(dateList); |
| | | Date lastDate = null; |
| | | |
| | | for (Date date : dateList) { |
| | | if (lastDate != null) { |
| | | if (Math.abs(date.getTime() - lastDate.getTime()) < 1000 * 60 * 60 * 24L * 15) { |
| | | sameGoodsDangerCount++; |
| | | break; |
| | | } |
| | | } else { |
| | | lastDate = date; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | long sameShopOrderCount = commonOrderCountService.countSameShopOrderByUidAndHongBaoType(typeList, uid, |
| | | Integer.parseInt(configService.getValue(ConfigKeyEnum.adminMinSameShopOrderCount.getKey(), acceptData.getSystem()))); |
| | | if (sameGoodsOrderCount > 0 || sameShopOrderCount > 0) { |
| | | String text = (String.format("同店铺:%s 同商品:%s", sameShopOrderCount, sameGoodsOrderCount)); |
| | | if (sameGoodsDangerCount>0 || sameShopOrderCount > 0) { |
| | | String text = (String.format("同店铺:%s 同商品:%s", sameShopOrderCount, sameGoodsDangerCount)); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(text)); |
| | | return; |
| | | } |
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import com.yeshi.fanli.entity.SystemEnum;
|
| | | import com.yeshi.fanli.util.*;
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | |
| | | out.print(JsonUtil.loadFalseResult(4, "电话号码格式不正确"));
|
| | | return;
|
| | | }
|
| | | smsService.sendLoginVCode(phone, 6);
|
| | |
|
| | | smsService.sendLoginVCode(acceptData.getSystem(), phone, 6);
|
| | | out.print(JsonUtil.loadTrueResult("发送成功"));
|
| | | } catch (SMSException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | |
| | | *
|
| | | * @param acceptData
|
| | | * @param phone
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "sendMSMLogin", method = RequestMethod.POST)
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | sendMSNnew(phone, slideVerify, 1, StringUtil.Md5(phone + "-" + acceptData.getDevice()), out);
|
| | | sendMSNnew(acceptData.getSystem(), phone, slideVerify, 1, StringUtil.Md5(phone + "-" + acceptData.getDevice()), out);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | sendMSNnew(phone, slideVerify, 2, StringUtil.Md5(phone + "-" + acceptData.getDevice()), out);
|
| | | sendMSNnew(acceptData.getSystem(), phone, slideVerify, 2, StringUtil.Md5(phone + "-" + acceptData.getDevice()), out);
|
| | | }
|
| | |
|
| | | public void sendMSNnew(String phone, boolean slideVerify, int type, String key, PrintWriter out) {
|
| | | public void sendMSNnew(SystemEnum system, String phone, boolean slideVerify, int type, String key, PrintWriter out) {
|
| | | try {
|
| | | int count = 0;
|
| | | String cachekey = null;
|
| | |
| | |
|
| | | if (type == 1) {
|
| | | // 登录验证码
|
| | | smsService.sendLoginVCode(phone, 4);
|
| | | smsService.sendLoginVCode(system, phone, 4);
|
| | | } else if (type == 2) {
|
| | | // 绑定验证码
|
| | | smsService.sendBindVCode(phone, 4);
|
| | | smsService.sendBindVCode(system, phone, 4);
|
| | | }
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult("发送成功"));
|
| | |
| | | }
|
| | |
|
| | |
|
| | | |
| | | /**
|
| | | * 注销账户短信验证
|
| | | *
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param phone
|
| | |
| | | count++;
|
| | | redisManager.cacheCommonString(cachekey, count + "", 60 * 60);
|
| | | // 发送验证码
|
| | | smsService.sendRemoveVCode(phone, 4);
|
| | | smsService.sendRemoveVCode(acceptData.getSystem(), phone, 4);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("发送成功"));
|
| | | } catch (SMSException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | |
| | | CouponInfoVO couponInfo = goodsDetail.getCouponInfo();
|
| | | PDDPromotionUrl convertUrl = null;
|
| | | if (couponInfo != null) {
|
| | | convertUrl = PinDuoDuoApiUtil.convert(id, PinDuoDuoApiUtil.PID_COUPON + "", null);
|
| | | convertUrl = PinDuoDuoApiUtil.convert(id, PinDuoDuoApiUtil.PID_COUPON + "", null, false);
|
| | | if (convertUrl != null)
|
| | | couponInfo.setLink(convertUrl.getUrl());
|
| | | }
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | PDDPromotionUrl convertUrl = PinDuoDuoApiUtil.convert(id, pid + "", uid + "");
|
| | | boolean auth = PinDuoDuoApiUtil.isAuth(pid, uid + "");
|
| | | PDDPromotionUrl convertUrl = PinDuoDuoApiUtil.convert(id, pid + "", uid + "", !auth);
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("native", true);
|
| | | data.put("jumpLink", convertUrl.getUrl());
|
| | |
| | | @Resource
|
| | | private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
|
| | |
|
| | |
|
| | | /**
|
| | | * 粘贴板信息推荐
|
| | | *
|
| | |
| | | }
|
| | |
|
| | | // 淘宝api搜索商品
|
| | | TaoBaoSearchResult result = TaoBaoUtil.search(sf, specialId, null);
|
| | |
|
| | | TaoBaoSearchResult result = taoBaoGoodsCacheUtil.getSearchResult(sf); // TaoBaoUtil.search(sf, specialId, null);
|
| | | if (result == null) {
|
| | | result = TaoBaoUtil.search(sf, specialId, null);
|
| | | taoBaoGoodsCacheUtil.saveSearchResult(sf, result);
|
| | | }
|
| | | TaoBaoSearchResult finalResult = result;
|
| | | // 搜索结果缓存到redis
|
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null && result.getTaoBaoGoodsBriefs().size() > 0) {
|
| | | ThreadUtil.run(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | // 更新到緩存
|
| | | for (TaoBaoGoodsBrief goods : result.getTaoBaoGoodsBriefs())
|
| | | for (TaoBaoGoodsBrief goods : finalResult.getTaoBaoGoodsBriefs())
|
| | | taoBaoGoodsCacheUtil.saveCommonTaoBaoGoodsInfo(goods);
|
| | | }
|
| | | });
|
| | |
| | | * 账户系统
|
| | | *
|
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Controller
|
| | | @RequestMapping("api/v2/usermoney")
|
| | |
| | | userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate, 1).abs());
|
| | |
|
| | | // 上月提现
|
| | | calendar = Calendar.getInstance();
|
| | | maxDate = new Date(TimeUtil
|
| | | .convertToTimeTemp(calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1), "yyyy-M"));
|
| | | calendar.add(Calendar.MONTH, -1);
|
| | |
| | | typeList.add(UserMoneyDetailTypeEnum.shareWeiQuan);
|
| | | vo.setTotalMoney(
|
| | | userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate).abs());
|
| | |
|
| | |
|
| | |
|
| | | if (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | |
| | |
|
| | | /**
|
| | | * 提现成功记录
|
| | | *
|
| | | * @param acceptData
|
| | | * @param page
|
| | | * @param uid
|
| | |
| | |
|
| | | /**
|
| | | * 团队分红
|
| | | *
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | |
| | |
|
| | | /**
|
| | | * 订单排行榜
|
| | | *
|
| | | * @param callback
|
| | | * @param acceptData
|
| | | * @param uid
|
New file |
| | |
| | | package com.yeshi.fanli.controller.h5; |
| | | |
| | | import com.yeshi.common.entity.taobao.TaoKeAppInfo; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum; |
| | | import com.yeshi.fanli.entity.taobao.SearchFilter; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoLink; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult; |
| | | import com.yeshi.fanli.exception.taobao.TaoBaoConvertLinkException; |
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException; |
| | | import com.yeshi.fanli.service.inter.config.BusinessSystemService; |
| | | import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService; |
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService; |
| | | import com.yeshi.fanli.service.manger.goods.TaoBaoLinkManager; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | import com.yeshi.fanli.util.TaoBaoConstant; |
| | | import com.yeshi.fanli.util.cache.TaoBaoGoodsCacheUtil; |
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory; |
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil; |
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil; |
| | | import com.yeshi.fanli.vo.goods.CouponInfoVO; |
| | | import com.yeshi.fanli.vo.goods.GoodsDetailExtraVO; |
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO; |
| | | import com.yeshi.fanli.vo.goods.MoneyInfoVO; |
| | | import com.yeshi.goods.facade.entity.taobao.TaoBaoGoodsBrief; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.yeshi.utils.JsonUtil; |
| | | import org.yeshi.utils.taobao.TbImgUtil; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.PrintWriter; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 布丸相关的H5代码接口 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("api/apph5/v1/buwan") |
| | | public class BuWanH5Controller { |
| | | |
| | | @Resource |
| | | private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService; |
| | | |
| | | @Resource |
| | | private TaoBaoGoodsCacheUtil taoBaoGoodsCacheUtil; |
| | | |
| | | @Resource |
| | | private HongBaoManageService hongBaoManageService; |
| | | |
| | | @Resource |
| | | private TaoBaoLinkManager taoBaoLinkManager; |
| | | |
| | | |
| | | private String pid = "mm_124933865_56750082_19509700484"; |
| | | |
| | | /** |
| | | * 获取商品列表 |
| | | * |
| | | * @param sign |
| | | * @param key |
| | | * @param page |
| | | * @param callback |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getGoodsList") |
| | | public void getGoodsList(String sign, String key, int page, String callback, PrintWriter out) { |
| | | //搜索内容 |
| | | if (StringUtil.isNullOrEmpty(key)) |
| | | return; |
| | | SearchFilter sf = new SearchFilter(); |
| | | sf.setPage(page); |
| | | sf.setPageSize(20); |
| | | sf.setKey(key); |
| | | sf.setSort(TaoBaoUtil.SORT_TOTAL_SALES_HIGH_TO_LOW); |
| | | ConfigParamsDTO configParamsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", |
| | | "60", SystemEnum.flq); |
| | | |
| | | List<GoodsDetailVO> goodsList = new ArrayList<>(); |
| | | TaoBaoSearchResult result = taoBaoGoodsCacheUtil.getSearchResult(sf); |
| | | if (result == null) { |
| | | result = TaoKeApiUtil.searchWuLiao(sf, null, null); |
| | | taoBaoGoodsCacheUtil.saveSearchResult(sf, result); |
| | | } |
| | | if (result != null) { |
| | | for (TaoBaoGoodsBrief goods : result.getTaoBaoGoodsBriefs()) { |
| | | GoodsDetailVO goodsVO = GoodsDetailVOFactory.convertTaoBao(goods, configParamsDTO); |
| | | goodsList.add(goodsVO); |
| | | } |
| | | } |
| | | long count = 0; |
| | | if (result != null) |
| | | count = result.getPageEntity().getTotalCount(); |
| | | JSONObject data = new JSONObject(); |
| | | data.put("list", goodsList); |
| | | data.put("count", count); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | } |
| | | |
| | | |
| | | private ConfigParamsDTO getParamsDTO(String platform, String version, Long uid, SystemEnum system) { |
| | | UserLevelEnum level = UserLevelEnum.daRen; |
| | | if (level == null) |
| | | level = UserLevelEnum.daRen; |
| | | |
| | | return orderHongBaoMoneyComputeService.getShowComputeRate(platform, version, level, system); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "getGoodsDetail") |
| | | public void getGoodsDetail(String sign, long id, String callback, PrintWriter out) { |
| | | GoodsDetailExtraVO extraVO = new GoodsDetailExtraVO(); |
| | | extraVO.setIsNative(false); |
| | | TaoBaoGoodsBrief goods = null; |
| | | SystemEnum system = SystemEnum.flq; |
| | | TaoKeAppInfo info = new TaoKeAppInfo(TaoBaoConstant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET, pid); |
| | | try { |
| | | goods = TaoKeApiUtil.searchGoodsDetail(id, info); |
| | | if (goods.getTkRate() == null || new BigDecimal(0).compareTo(goods.getTkRate()) == 0) { |
| | | TaoBaoGoodsBrief linkInfo = TaoKeApiUtil.specialConvertCoupon(goods.getAuctionId(), info, null, null); |
| | | if (linkInfo != null) { |
| | | goods.setAuctionUrl(linkInfo.getAuctionUrl()); |
| | | goods.setCouponLink(linkInfo.getCouponLink()); |
| | | goods.setTkRate(linkInfo.getTkRate()); |
| | | } |
| | | } |
| | | } catch (NumberFormatException e) { |
| | | e.printStackTrace(); |
| | | } catch (TaobaoGoodsDownException e) { |
| | | } |
| | | |
| | | TaoBaoGoodsBrief tb = goods; |
| | | |
| | | |
| | | if (tb == null) { |
| | | out.print(JsonUtil.loadFalseResult(2, "商品不存在")); |
| | | return; |
| | | } |
| | | |
| | | if (tb.getImgList() == null) { |
| | | tb.setImgList(new ArrayList<>()); |
| | | } |
| | | |
| | | List<String> finalImgList = new ArrayList<>(); |
| | | for (String img : tb.getImgList()) { |
| | | finalImgList.add(TbImgUtil.getTBSizeImg(img, 600)); |
| | | } |
| | | |
| | | if (finalImgList.size() == 0) { |
| | | finalImgList.add(tb.getPictUrl()); |
| | | } |
| | | |
| | | if (!StringUtil.isNullOrEmpty(tb.getPictUrlWhite())) |
| | | finalImgList.add(0, tb.getPictUrlWhite()); |
| | | |
| | | // 移除相同图片 |
| | | if (finalImgList.size() > 0) |
| | | for (int i = 0; i < finalImgList.size(); i++) { |
| | | if (i < finalImgList.size() - 1) |
| | | if (TbImgUtil.getTBSizeImg(finalImgList.get(i), 600) |
| | | .equalsIgnoreCase(TbImgUtil.getTBSizeImg(finalImgList.get(i + 1), 600))) { |
| | | finalImgList.remove(i--); |
| | | } |
| | | } |
| | | |
| | | tb.setImgList(finalImgList); |
| | | |
| | | ConfigParamsDTO paramsDTO = getParamsDTO("android", "60", null, SystemEnum.flq); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(system)); |
| | | |
| | | GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO); |
| | | |
| | | extraVO.setDetailUrl("http://apph5.banliapp.com/apppage/goods_img.html?id=" + id); |
| | | |
| | | int moneyType = 1; |
| | | extraVO.setFanliValid(true); |
| | | |
| | | MoneyInfoVO goodsMoney = goodsDetail.getMoneyInfo(); |
| | | if (goodsMoney != null) { |
| | | goodsMoney.setMoneyType(moneyType); |
| | | } |
| | | |
| | | if (goodsDetail.isHasCoupon()) { |
| | | // 设置couponList |
| | | List<CouponInfoVO> couponInfoList = new ArrayList<>(); |
| | | couponInfoList.add(goodsDetail.getCouponInfo()); |
| | | goodsDetail.setCouponInfoList(couponInfoList); |
| | | } |
| | | |
| | | String url = goods.getAuctionUrl(); |
| | | if (!StringUtil.isNullOrEmpty(goods.getCouponLink())) { |
| | | url = goods.getCouponLink(); |
| | | } |
| | | |
| | | String token = TaoKeApiUtil.getTKToken(goods.getPictUrl(), goods.getTitle(), url); |
| | | JSONObject object = new JSONObject(); |
| | | object.put("extra", JsonUtil.getApiCommonGson().toJson(extraVO)); |
| | | object.put("goods", JsonUtil.getApiCommonGson().toJson(goodsDetail)); |
| | | object.put("token", token); |
| | | JsonUtil.printMode(out,callback,JsonUtil.loadTrueResult(object.toString())); |
| | | } |
| | | |
| | | } |
| | |
| | | CouponInfoVO couponInfo = goodsDetail.getCouponInfo();
|
| | | PDDPromotionUrl convertUrl = null;
|
| | | if (couponInfo != null) {
|
| | | convertUrl = PinDuoDuoApiUtil.convert(id, PinDuoDuoApiUtil.PID_COUPON + "", null);
|
| | | convertUrl = PinDuoDuoApiUtil.convert(id, PinDuoDuoApiUtil.PID_COUPON + "", null,false);
|
| | | if (convertUrl != null)
|
| | | couponInfo.setLink(convertUrl.getUrl());
|
| | | }
|
| | |
| | | */ |
| | | Integer getDirectBossUrankByPid(@Param("pid")Long pid); |
| | | |
| | | |
| | | /** |
| | | * 设置红包已领取 |
| | | * @param uid |
| | | * @param typeList |
| | | * @param preGetTime |
| | | * @return |
| | | */ |
| | | int setHongBaoRecieved (@Param("uid")Long uid,@Param("typeList")List<Integer> typeList,@Param("preGetTime")Date preGetTime); |
| | | |
| | | } |
| | |
| | | /** |
| | | * 当前各个状态订单数 |
| | | * |
| | | * @param state |
| | | * 状态 |
| | | * @param state 状态 |
| | | * @return |
| | | */ |
| | | Long countByState(@Param("state") Integer state); |
| | |
| | | List<ChartTDO> countOrderNumber(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime, |
| | | @Param("sourceType") int sourceType); |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 查询用户在同一店铺购买超过一定数量商品的店铺数量 |
| | | * |
| | | * @param typeList |
| | | * -红包类型 |
| | | * @param uid |
| | | * -用户ID |
| | | * @param minSameShopGoodsCount |
| | | * -同一店铺买的最小订单数 |
| | | * @param typeList -红包类型 |
| | | * @param uid -用户ID |
| | | * @param minSameShopGoodsCount -同一店铺买的最小订单数 |
| | | * @return |
| | | */ |
| | | long countSameShopOrderByUidAndHongBaoType(@Param("typeList") List<Integer> typeList, @Param("uid") Long uid, |
| | | @Param("minSameShopGoodsCount") int minSameShopGoodsCount); |
| | | @Param("minSameShopGoodsCount") int minSameShopGoodsCount, @Param("minDate") Date minDate); |
| | | |
| | | |
| | | /** |
| | | * 查询用户购买相同商品超过一定的订单数量的商品数量 |
| | | * |
| | | * @param typeList |
| | | * @param uid |
| | | * @param excludeShopIds |
| | | * @param minSameGoodsOrderCount |
| | | * @return |
| | | */ |
| | | long countSameGoodsOrderByUidAndHongBaoType(@Param("typeList") List<Integer> typeList, @Param("uid") Long uid, |
| | | @Param("minSameGoodsOrderCount") int minSameGoodsOrderCount); |
| | | long countSameGoodsOrderByUidAndHongBaoType(@Param("typeList") List<Integer> typeList, @Param("uid") Long uid, @Param("excludeShopIds") List<Long> excludeShopIds, |
| | | @Param("minSameGoodsOrderCount") int minSameGoodsOrderCount, @Param("minDate") Date minDate); |
| | | |
| | | |
| | | /** |
| | | * 查询用户购买相同商品超过一定的订单数量的商品ID |
| | | * @param typeList |
| | | * @param uid |
| | | * @param excludeShopIds |
| | | * @param minSameGoodsOrderCount |
| | | * @param minDate |
| | | * @return |
| | | */ |
| | | List<Long> listSameGoodsIdByUidAndHongBaoType(@Param("typeList") List<Integer> typeList, @Param("uid") Long uid, @Param("excludeShopIds") List<Long> excludeShopIds, |
| | | @Param("minSameGoodsOrderCount") int minSameGoodsOrderCount, @Param("minDate") Date minDate); |
| | | |
| | | /** |
| | | * 查询用户在同一店铺购买超过一定数量商品的店铺id |
| | | * |
| | | * @param typeList |
| | | * -红包类型 |
| | | * @param uid |
| | | * -用户ID |
| | | * @param minSameShopGoodsCount |
| | | * -同一店铺买的最小订单数 |
| | | * @param typeList -红包类型 |
| | | * @param uid -用户ID |
| | | * @param minSameShopGoodsCount -同一店铺买的最小订单数 |
| | | * @return |
| | | */ |
| | | List<Long> getSameShopOrderByUidAndHongBaoType(@Param("typeList") List<Integer> typeList, @Param("uid") Long uid, |
| | | List<Long> getSameShopOrderByUidAndHongBaoType(@Param("typeList") List<Integer> typeList, @Param("uid") Long uid, @Param("excludeShopIds") List<Long> excludeShopIds, |
| | | @Param("minSameShopGoodsCount") int minSameShopGoodsCount); |
| | | |
| | | /** |
| | | * 查询用户购买相同商品超过一定的订单数量的商品id |
| | | * |
| | | * @param typeList |
| | | * @param uid |
| | | * @param minSameGoodsOrderCount |
| | |
| | | |
| | | /** |
| | | * 通过uid 日期筛选 下单数量 |
| | | * |
| | | * @param preDay |
| | | * @param uid |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 日期筛选 每个用户下单数量 |
| | | * |
| | | * @param preDay |
| | | * @param uid |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 查询当日下单用户 |
| | | * |
| | | * @param preDay |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 通过多个uid 日期筛选 下单用户数量 |
| | | * |
| | | * @param preDay |
| | | * @param uid |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 统计订单产生佣金 |
| | | * |
| | | * @param preDay |
| | | * @param list |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 通过uid 日期筛选 下单数量 |
| | | * |
| | | * @param preDay |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 统计订单产生佣金 |
| | | * |
| | | * @param preDay |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 查询最近50小于10的订单数量 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 统计近 day天有效订单数量 |
| | | * |
| | | * @param uid |
| | | * @param source |
| | | * @param day |
| | |
| | | |
| | | /** |
| | | * 统计历史订单数量 -不区分状态、来源 订单号为主 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | |
| | | /** |
| | | * 根据订单号、订单类型查询商品 |
| | | * |
| | | * @param list |
| | | * 订单对象 |
| | | * @param list 订单对象 |
| | | * @return |
| | | */ |
| | | List<CommonOrderVO> listOrderGoodsInfo(List<CommonOrderVO> list); |
| | |
| | | |
| | | /** |
| | | * 统计有效订单数量 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | |
| | | /** |
| | | * 根据订单号与订单排序值获取详情 |
| | | * |
| | | * @param orderNo |
| | | * -订单号 |
| | | * @param orderBy |
| | | * -订单排序值 |
| | | * @param orderType |
| | | * -订单类型 |
| | | * @param orderNo -订单号 |
| | | * @param orderBy -订单排序值 |
| | | * @param orderType -订单类型 |
| | | * @return |
| | | */ |
| | | CommonOrder selectByOrderNoAndOrderTypeAndOrderBy(@Param("orderNo") String orderNo, |
| | |
| | | @Param("tradeIdList") List<String> tradeIdList); |
| | | |
| | | /** |
| | | * |
| | | * @param sourceType |
| | | * @param state |
| | | * @param minTime |
| | | * -最大创建时间 |
| | | * @param maxTime |
| | | * -最小创建时间 |
| | | * @param minTime -最大创建时间 |
| | | * @param maxTime -最小创建时间 |
| | | * @return |
| | | */ |
| | | List<CommonOrder> listBySourceTypeAndStateAndThirdCrateTime(@Param("sourceType") int sourceType, |
| | |
| | | |
| | | /** |
| | | * 根据用户ID查询 |
| | | * |
| | | * @param uid |
| | | * @param stateList |
| | | * @param start |
| | |
| | | |
| | | /** |
| | | * 查询首笔有效到账订单 |
| | | * |
| | | * @param uid |
| | | * @param typeHB 类型: 1自购 2分享 3邀请 |
| | | * @param typeDate 日期类型: 3本月 4上月 |
| | |
| | | |
| | | /** |
| | | * 获取首笔分享订单; |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 统计订单号到账金额 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 统计24小时有效自购订单 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 搜索订单 |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @param uid |
| | |
| | | |
| | | /** |
| | | * 搜索订单 |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @param uid |
| | |
| | | long countSearchOrderByUid(@Param("uid") Long uid, @Param("list")List<ESOrder> list); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询最小结算时间 |
| | | * |
| | | * @return |
| | | */ |
| | | List<CommonOrder> getMinSettleTimeAndUid(); |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * 统计已结算且付款金额大于1的订单(不区分订单状态) |
| | | * |
| | | * @param uid |
| | | * @param payment |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取最新的淘宝订单号 |
| | | * |
| | | * @return |
| | | */ |
| | | String getNewestOrderNoByTaoBao(); |
| | | |
| | | /** |
| | | * 根据订单号进行sous |
| | | * |
| | | * @param orderNo |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取首个订单 |
| | | * |
| | | * @param orderNo |
| | | * @return |
| | | */ |
| | | CommonOrder getFirstOrder(@Param("uid") Long uid); |
| | | |
| | | |
| | | List<CommonOrder> listByGoodsIdAndUidAndMinThirdCreateTime(@Param("goodsId") Long goodsId, @Param("uid") Long uid, @Param("minThirdCreateTime") Date minThirdCreateTime, @Param("start") long start, @Param("count") int count); |
| | | |
| | | |
| | | List<CommonOrder> test(); |
| | | |
| | | } |
| | |
| | | @SerializedName("mall_id")
|
| | | private Long mallId;//店铺ID
|
| | | // mall_id:4217177,cps_sign:null,cat_id:null mall_rate:10
|
| | | |
| | | @SerializedName("predict_promotion_rate")
|
| | | private BigDecimal predictPromotionRate;//比价的佣金比
|
| | | private Integer state;//状态 1-下线 0-正常
|
| | |
|
| | |
|
| | | public BigDecimal getPredictPromotionRate() {
|
| | | return predictPromotionRate;
|
| | | }
|
| | |
|
| | | public void setPredictPromotionRate(BigDecimal predictPromotionRate) {
|
| | | this.predictPromotionRate = predictPromotionRate;
|
| | | }
|
| | |
|
| | | public Integer getState() {
|
| | | return state;
|
| | | }
|
| | |
| | | public enum SystemEnum { |
| | | blks("com.yeshi.ec.rebate", "com.xyj.ec.fanli-ios", new String[]{}, new SystemFunction[]{ |
| | | SystemFunction.bindPhone, SystemFunction.threeSale, SystemFunction.cloudOrder, SystemFunction.godenCorn, SystemFunction.redPack,SystemFunction.faQuan,SystemFunction.fanli,SystemFunction.vip |
| | | }, 1, "板栗快省"), |
| | | flq("com.fanliunion.android", "com.xyj.ec.flq-ios", new String[]{}, new SystemFunction[]{SystemFunction.faQuan,SystemFunction.fanli}, 11, "返利联盟"), |
| | | yhqjx("com.youhuiquanjx.android","com.youhuiquanjx.ios",new String[]{}, new SystemFunction[]{SystemFunction.faQuan}, 12, "优惠券精选"); |
| | | }, 1, "板栗快省","板栗快省"), |
| | | flq("com.fanliunion.android", "com.xyj.ec.flq-ios", new String[]{}, new SystemFunction[]{SystemFunction.faQuan,SystemFunction.fanli}, 11, "返利联盟","淘拼团"), |
| | | yhqjx("com.youhuiquan.android","com.youhuiquanjx.ios",new String[]{}, new SystemFunction[]{SystemFunction.faQuan}, 12, "优惠券精选","淘拼团"); |
| | | private String packageName; |
| | | private String bundleId; |
| | | private int systemId; |
| | | private String name; |
| | | private String[] wxxcxAppIds; |
| | | private Set<SystemFunction> functionSet; |
| | | private String smsAlias; |
| | | |
| | | private SystemEnum(String packageName, String bundleId, String[] wxxcxAppIds, SystemFunction[] functions, int systemId, String name) { |
| | | public String getSmsAlias() { |
| | | return smsAlias; |
| | | } |
| | | |
| | | private SystemEnum(String packageName, String bundleId, String[] wxxcxAppIds, SystemFunction[] functions, int systemId, String name, String smsAlias) { |
| | | this.bundleId = bundleId; |
| | | this.name = name; |
| | | this.packageName = packageName; |
| | |
| | | for (SystemFunction f : functions) |
| | | set.add(f); |
| | | this.functionSet = set; |
| | | this.smsAlias=smsAlias; |
| | | } |
| | | |
| | | public Set<SystemFunction> getFunctionSet() { |
| | |
| | | public final static int STATE_KELINGQU = 2;
|
| | | public final static int STATE_YILINGQU = 3;
|
| | | public final static int STATE_SHIXIAO = 4;
|
| | | public final static int STATE_LINGQUING = 5;//领取中,处于2和3之间
|
| | | //TODO 中间状态待使用
|
| | |
|
| | | // 5-部分失效(返回客户端显示用,不用作逻辑处理)
|
| | | public final static int STATE_BUFENSHIXIAO = 5;
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | } else {
|
| | | minId = null;
|
| | | }
|
| | |
| | | //团队收益
|
| | | @Component
|
| | | public class OrderTeamIncomeJob {
|
| | |
|
| | | @Resource
|
| | | private TeamDividentsManager teamDividentsManager;
|
| | |
|
| | | @Resource
|
| | | private TeamDividentsSourceUserService teamDividentsSourceUserService;
|
| | |
|
| | | @Resource
|
| | | private OrderProcessService orderProcessService;
|
| | |
|
| | |
| | |
|
| | | private static Logger cloudLogger = Logger.getLogger("cloudLog");
|
| | |
|
| | | private static Logger pushHWLog = Logger.getLogger("pushHWLog");
|
| | |
|
| | |
|
| | | public static void userProtocolListen(Object obj) {
|
| | | userProtocolListenLog.info(obj);
|
| | |
| | | jobLogger.info(obj);
|
| | | }
|
| | |
|
| | | public static void pushHW(Object obj) {
|
| | | pushHWLog.info(obj);
|
| | | }
|
| | |
|
| | | public static void mqError(String errorMsg, String topic, String tag, Object data) {
|
| | | String error = errorMsg + "\ntopic:" + topic + "\ntag:" + tag + "\nbody:" + data;
|
| | | mqLogger.error(error);
|
| | |
| | | |
| | | @Override |
| | | public long countSameShopOrderByUidAndHongBaoType(List<Integer> typeList, Long uid, int minSameShopGoodsCount) { |
| | | return commonOrderCountMapper.countSameShopOrderByUidAndHongBaoType(typeList, uid, minSameShopGoodsCount); |
| | | |
| | | Date date = new Date(System.currentTimeMillis() - 1000 * 60 * 60L * 24 * 365); |
| | | return commonOrderCountMapper.countSameShopOrderByUidAndHongBaoType(typeList, uid, minSameShopGoodsCount, date); |
| | | } |
| | | |
| | | private List<Long> getExcudeGoodsIds() { |
| | | List<Long> shopIds = new ArrayList<>(); |
| | | shopIds.add(2549841410L);//天猫国际官方直营 |
| | | shopIds.add(725677994L);//天猫超市 |
| | | shopIds.add(4066234693L);//天猫国际海外仓直购 |
| | | shopIds.add(123971619L);//天猫国际进口超市 |
| | | shopIds.add(231452441L);//天猫会员店 |
| | | shopIds.add(464516896L);//天猫精灵官方旗舰店 |
| | | shopIds.add(1862759827L);//天猫魔盒官方旗舰店 |
| | | shopIds.add(1910146537L);//天猫超市生鲜店 |
| | | shopIds.add(2928278102L);//阿里健康 |
| | | return shopIds; |
| | | } |
| | | |
| | | @Override |
| | | public long countSameGoodsOrderByUidAndHongBaoType(List<Integer> typeList, Long uid, int minSameGoodsOrderCount) { |
| | | return commonOrderCountMapper.countSameGoodsOrderByUidAndHongBaoType(typeList, uid, minSameGoodsOrderCount); |
| | | //排除特殊店铺 |
| | | List<Long> shopIds = getExcudeGoodsIds(); |
| | | Date date = new Date(System.currentTimeMillis() - 1000 * 60 * 60L * 24 * 365L); |
| | | return commonOrderCountMapper.countSameGoodsOrderByUidAndHongBaoType(typeList, uid, shopIds, minSameGoodsOrderCount, date); |
| | | } |
| | | |
| | | @Override |
| | | public List<Long> listSameGoodsIdByUidAndHongBaoType(List<Integer> typeList, Long uid, int minSameGoodsOrderCount) { |
| | | //排除特殊店铺 |
| | | List<Long> shopIds = getExcudeGoodsIds(); |
| | | |
| | | Date date = new Date(System.currentTimeMillis() - 1000 * 60 * 60L * 24 * 365L); |
| | | return commonOrderCountMapper.listSameGoodsIdByUidAndHongBaoType(typeList, uid, shopIds, minSameGoodsOrderCount, date); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<Long> getSameShopOrderByUidAndHongBaoType(List<Integer> typeList, Long uid, int minSameShopGoodsCount) { |
| | | return commonOrderCountMapper.getSameShopOrderByUidAndHongBaoType(typeList, uid, minSameShopGoodsCount); |
| | | //排除特殊店铺 |
| | | List<Long> shopIds = getExcudeGoodsIds(); |
| | | return commonOrderCountMapper.getSameShopOrderByUidAndHongBaoType(typeList, uid, shopIds, minSameShopGoodsCount); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<CountOrderTrackRate> getOrderTrackRate(int type, Date startTime, Date endTime) { |
| | | |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | private void addOrderTrackRateCount(String preDay, OrderTrackRateEnum trackRateEnum) throws Exception { |
| | |
| | | * 增加提现记录
|
| | | *
|
| | | * @param extract
|
| | | * @param maxCount
|
| | | * 最多提现次数
|
| | | * @param maxMoney
|
| | | * 最大提现金额
|
| | | * @param maxCount 最多提现次数
|
| | | * @param maxMoney 最大提现金额
|
| | | * @param session
|
| | | * @return 如果为0,则增加成功。为1,则超过每日最多提现次数。为2,则超过每日最多提现金额
|
| | | */
|
| | |
| | | BigDecimal hongBaoMoney = hongBaoV2Service.computeMoneyByUidAndState(uid, HongBaoV2.STATE_YILINGQU);
|
| | |
|
| | | Date now = new Date();
|
| | | // 获取提现,获取提现验证
|
| | | //获取团队分红
|
| | | List<UserMoneyDetailTypeEnum> typeList = new ArrayList<>();
|
| | | typeList.add(UserMoneyDetailTypeEnum.teamDividents);
|
| | | BigDecimal teamDividents = userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, new Date(0),
|
| | | now);
|
| | |
|
| | | //红包提现收入
|
| | | typeList = new ArrayList<>();
|
| | | typeList.add(UserMoneyDetailTypeEnum.redPackExchange);
|
| | | BigDecimal redPackExchange = userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, new Date(0),
|
| | | now);
|
| | |
|
| | |
|
| | | //----------所有支出开始------------
|
| | |
|
| | | // 获取提现,获取提现验证
|
| | | typeList = new ArrayList<>();
|
| | | typeList.add(UserMoneyDetailTypeEnum.extract);
|
| | | typeList.add(UserMoneyDetailTypeEnum.extractNew);
|
| | | typeList.add(UserMoneyDetailTypeEnum.extractReject);
|
| | |
| | | typeList.add(UserMoneyDetailTypeEnum.inviteWeiQuan);
|
| | | typeList.add(UserMoneyDetailTypeEnum.shareWeiQuan);
|
| | | typeList.add(UserMoneyDetailTypeEnum.hongbaoDeduct);
|
| | | //新版维权(到账时减去了维权资金,但是在资金明细里面加入了维权金额,但并未外显)
|
| | | typeList.add(UserMoneyDetailTypeEnum.fanliWeiQuanNew);
|
| | |
|
| | | BigDecimal weiqaunMoney = userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, new Date(0),
|
| | | now);
|
| | | weiqaunMoney = weiqaunMoney.abs();
|
| | |
|
| | |
|
| | | //--------------所有支出结束------------
|
| | |
|
| | | BigDecimal balance = userInfoService.selectByPKey(uid).getMyHongBao();
|
| | |
|
| | | BigDecimal after = hongBaoMoney.subtract(extractMoney.add(weiqaunMoney).add(balance).add(compensateMoney));
|
| | | BigDecimal after = hongBaoMoney.add(teamDividents).add(redPackExchange).subtract(extractMoney.add(weiqaunMoney).add(balance).add(compensateMoney));
|
| | |
|
| | | if (after.compareTo(new BigDecimal("0")) != 0)
|
| | | throw new ExtractException(2, "结算资金异常:" + after);
|
| | |
| | | // 退款金额
|
| | | BigDecimal drawBackMoney = computeDrawBackMoney(settleMent, wqMoney, userGetMoney);
|
| | | userSubMoneyMap.put(uid, drawBackMoney);
|
| | | if (subMoneySync) {
|
| | | if (subMoneySync) {//同步减去资金
|
| | | // 计算资金是否充足
|
| | | UserInfo user = userInfoMapper.selectByPrimaryKey(uid);
|
| | | if (user != null && user.getMyHongBao().compareTo(drawBackMoney) < 0)// 资金不足
|
| | |
| | | private UserSystemCouponRecordService userSystemCouponRecordService; |
| | | |
| | | @Resource |
| | | private SystemCouponService systemCouponService; |
| | | |
| | | @Resource |
| | | private HongBaoV2Service hongBaoV2Service; |
| | | |
| | | @Resource |
| | |
| | | return commonOrderMapper.getFirstOrder(uid); |
| | | } |
| | | |
| | | @Override |
| | | public List<CommonOrder> listByGoodsIdAndUidAndMinThirdCreateTime(Long goodsId, Long uid, Date minThirdCreateTime) { |
| | | |
| | | return commonOrderMapper.listByGoodsIdAndUidAndMinThirdCreateTime(goodsId, uid, minThirdCreateTime, 0, 1000); |
| | | } |
| | | |
| | | } |
| | |
| | | List<Integer> stateList = new ArrayList<>();
|
| | | stateList.add(HongBaoV2.STATE_BUKELINGQU);
|
| | | stateList.add(HongBaoV2.STATE_KELINGQU);
|
| | | stateList.add(HongBaoV2.STATE_LINGQUING);
|
| | | stateList.add(HongBaoV2.STATE_YILINGQU);
|
| | | List<HongBaoV2> hongBaoV2List = hongBaoV2Mapper.listByStateAndTypeAndUid(stateList, typeList, uid, 0, 1);
|
| | | if (hongBaoV2List != null && hongBaoV2List.size() > 0)
|
| | |
| | | return hongBaoV2Mapper.getDirectBossUrankByPid(pid);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public void setHongBaoRecieved(Long uid, List<Integer> typeList, Date preGetTime) {
|
| | | hongBaoV2Mapper.setHongBaoRecieved(uid, typeList, preGetTime);
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
| | | public void inviteSettleTB(Long uid, Date maxPregetTime) throws OrderMoneySettleException {
|
| | | // 查询UID的一二级邀请赚
|
| | | int sourceType = Constant.SOURCE_TYPE_TAOBAO;
|
| | | List<Integer> types = new ArrayList<>();
|
| | | types.add(HongBaoV2.TYPE_YIJI);
|
| | | types.add(HongBaoV2.TYPE_ERJI);
|
| | | types.add(HongBaoV2.TYPE_SHARE_YIJI);
|
| | | types.add(HongBaoV2.TYPE_SHARE_ERJI);
|
| | | long count = hongBaoV2Mapper.countCanBalanceHongBaoByTypeAndUid(types, uid, sourceType, maxPregetTime);
|
| | | List<HongBaoV2> hongBaoList = new ArrayList<>();
|
| | | // 1000条数据为1页
|
| | | int page = (int) (count % 1000 == 0 ? count / 1000 : count / 1000 + 1);
|
| | | for (int i = 0; i < page; i++) {
|
| | | List<HongBaoV2> tempHongBaoList = hongBaoV2Mapper.listCanBalanceHongBaoByTypeAndUid(types, uid, sourceType,
|
| | | maxPregetTime, i * 1000, 1000);
|
| | | if (tempHongBaoList != null && tempHongBaoList.size() > 0)
|
| | | hongBaoList.addAll(tempHongBaoList);
|
| | | }
|
| | |
|
| | | for (int i = 0; i < hongBaoList.size(); i++) {
|
| | | HongBaoV2 item = hongBaoList.get(i);
|
| | | if (item != null && item.getParent() != null) {
|
| | | if (item != null) {
|
| | | HongBaoOrder hongBaoOrder = hongBaoOrderMapper.selectByHongBaoId(item.getParent().getId());
|
| | | if (hongBaoOrder != null && hongBaoOrder.getCommonOrder() != null) {
|
| | | CommonOrder co = hongBaoOrder.getCommonOrder();
|
| | | // 上级用户不是正常用户,订单均不能到账
|
| | | UserInfo userInfo = userInfoMapper.selectAvailableByPrimaryKey(co.getUserInfo().getId());
|
| | | if (userInfo == null || userInfo.getState() != UserInfo.STATE_NORMAL) {
|
| | | invalidHongBaoForbidden(item.getId());
|
| | | hongBaoList.remove(i);
|
| | | i--;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | if(hongBaoList.size()==0)
|
| | | return;
|
| | |
|
| | | String taskKey = getTaskKey(uid);
|
| | |
|
| | | TeamRewardPreRecieveMQMsg mqMsg = new TeamRewardPreRecieveMQMsg(taskKey, uid, sourceType, maxPregetTime,
|
| | | new Date());
|
| | |
|
| | | Message msg = MQMsgBodyFactory.create(MQTopicName.TOPIC_ORDER, OrderTopicTagEnum.teamRewardPreRecieved, mqMsg);
|
| | |
|
| | | msg.setKey(taskKey);
|
| | | |
| | | |
| | | // 添加事务消息
|
| | | try {
|
| | | orderTransactionProducer.send(msg, new LocalTransactionExecuter() {
|
| | | @Override
|
| | | public TransactionStatus execute(Message arg0, Object arg1) {
|
| | | try {
|
| | | fanliInvite(hongBaoList, uid, Constant.SOURCE_TYPE_TAOBAO, taskKey, maxPregetTime);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | return TransactionStatus.RollbackTransaction;
|
| | | }
|
| | | return TransactionStatus.CommitTransaction;
|
| | | }
|
| | | }, null);
|
| | | |
| | | // rocketMQManager.sendTransactionalMsg(msg, taskKey, new RocketMQManager.ITransactionalMQEvent() {
|
| | | // @Override
|
| | | // public TransactionStatus excute(Message arg0, Object arg1) {
|
| | | // try {
|
| | | // fanliInvite(hongBaoList, uid, Constant.SOURCE_TYPE_TAOBAO, taskKey, maxPregetTime);
|
| | | // } catch (Exception e) {
|
| | | // e.printStackTrace();
|
| | | // return TransactionStatus.RollbackTransaction;
|
| | | // }
|
| | | // return TransactionStatus.CommitTransaction;
|
| | | // }
|
| | | // });
|
| | | |
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | LogHelper.mqError(e.getMessage(), msg.getTopic(), msg.getTag(), new Gson().toJson(mqMsg));
|
| | | }
|
| | | System.out.println(new Gson().toJson(mqMsg));
|
| | | inviteSettle(uid,sourceType,maxPregetTime);
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | |
| | | public void inviteSettleJD(Long uid, Date maxPregetTime) throws OrderMoneySettleException {
|
| | | // 查询UID的一二级邀请赚
|
| | | int sourceType = Constant.SOURCE_TYPE_JD;
|
| | | List<Integer> types = new ArrayList<>();
|
| | | types.add(HongBaoV2.TYPE_YIJI);
|
| | | types.add(HongBaoV2.TYPE_ERJI);
|
| | | types.add(HongBaoV2.TYPE_SHARE_YIJI);
|
| | | types.add(HongBaoV2.TYPE_SHARE_ERJI);
|
| | | long count = hongBaoV2Mapper.countCanBalanceHongBaoByTypeAndUid(types, uid, sourceType, maxPregetTime);
|
| | | List<HongBaoV2> hongBaoList = new ArrayList<>();
|
| | | // 1000条数据为1页
|
| | | int page = (int) (count % 1000 == 0 ? count / 1000 : count / 1000 + 1);
|
| | | for (int i = 0; i < page; i++) {
|
| | | List<HongBaoV2> tempHongBaoList = hongBaoV2Mapper.listCanBalanceHongBaoByTypeAndUid(types, uid, sourceType,
|
| | | maxPregetTime, i * 1000, 1000);
|
| | | if (tempHongBaoList != null && tempHongBaoList.size() > 0)
|
| | | hongBaoList.addAll(tempHongBaoList);
|
| | | }
|
| | |
|
| | | for (int i = 0; i < hongBaoList.size(); i++) {
|
| | | HongBaoV2 item = hongBaoList.get(i);
|
| | | if (item != null && item.getParent() != null) {
|
| | | if (item != null) {
|
| | | HongBaoOrder hongBaoOrder = hongBaoOrderMapper.selectByHongBaoId(item.getParent().getId());
|
| | | if (hongBaoOrder != null && hongBaoOrder.getCommonOrder() != null) {
|
| | | CommonOrder co = hongBaoOrder.getCommonOrder();
|
| | | // 上级用户不是正常用户,订单均不能到账
|
| | | UserInfo userInfo = userInfoMapper.selectAvailableByPrimaryKey(co.getUserInfo().getId());
|
| | | if (userInfo == null || userInfo.getState() != UserInfo.STATE_NORMAL) {
|
| | | invalidHongBaoForbidden(item.getId());
|
| | | hongBaoList.remove(i);
|
| | | i--;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | if(hongBaoList.size()==0)
|
| | | return;
|
| | |
|
| | | // 邀请赚到账事务消息
|
| | |
|
| | | String taskKey = getTaskKey(uid);
|
| | | TeamRewardPreRecieveMQMsg mqMsg = new TeamRewardPreRecieveMQMsg(taskKey, uid, sourceType, maxPregetTime,
|
| | | new Date());
|
| | | Message msg = MQMsgBodyFactory.create(MQTopicName.TOPIC_ORDER, OrderTopicTagEnum.teamRewardPreRecieved, mqMsg);
|
| | | msg.setKey(taskKey);
|
| | | // 添加事务消息
|
| | | try {
|
| | | orderTransactionProducer.send(msg, new LocalTransactionExecuter() {
|
| | | @Override
|
| | | public TransactionStatus execute(Message arg0, Object arg1) {
|
| | | try {
|
| | | fanliInvite(hongBaoList, uid, sourceType, taskKey, maxPregetTime);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | return TransactionStatus.RollbackTransaction;
|
| | | }
|
| | | return TransactionStatus.CommitTransaction;
|
| | | }
|
| | | }, null);
|
| | | } catch (Exception e) {
|
| | | LogHelper.mqError(e.getMessage(), msg.getTopic(), msg.getTag(), new Gson().toJson(mqMsg));
|
| | | }
|
| | | inviteSettle(uid,sourceType,maxPregetTime);
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | |
| | | public void inviteSettlePDD(Long uid, Date maxPregetTime) throws OrderMoneySettleException {
|
| | | // 查询UID的一二级邀请赚
|
| | | int sourceType = Constant.SOURCE_TYPE_PDD;
|
| | | List<Integer> types = new ArrayList<>();
|
| | | types.add(HongBaoV2.TYPE_YIJI);
|
| | | types.add(HongBaoV2.TYPE_ERJI);
|
| | | types.add(HongBaoV2.TYPE_SHARE_YIJI);
|
| | | types.add(HongBaoV2.TYPE_SHARE_ERJI);
|
| | | long count = hongBaoV2Mapper.countCanBalanceHongBaoByTypeAndUid(types, uid, sourceType, maxPregetTime);
|
| | | List<HongBaoV2> hongBaoList = new ArrayList<>();
|
| | | // 1000条数据为1页
|
| | | int page = (int) (count % 1000 == 0 ? count / 1000 : count / 1000 + 1);
|
| | | for (int i = 0; i < page; i++) {
|
| | | List<HongBaoV2> tempHongBaoList = hongBaoV2Mapper.listCanBalanceHongBaoByTypeAndUid(types, uid, sourceType,
|
| | | maxPregetTime, i * 1000, 1000);
|
| | | if (tempHongBaoList != null && tempHongBaoList.size() > 0)
|
| | | hongBaoList.addAll(tempHongBaoList);
|
| | | }
|
| | |
|
| | | for (int i = 0; i < hongBaoList.size(); i++) {
|
| | | HongBaoV2 item = hongBaoList.get(i);
|
| | | if (item != null && item.getParent() != null) {
|
| | | if (item != null) {
|
| | | HongBaoOrder hongBaoOrder = hongBaoOrderMapper.selectByHongBaoId(item.getParent().getId());
|
| | | if (hongBaoOrder != null && hongBaoOrder.getCommonOrder() != null) {
|
| | | CommonOrder co = hongBaoOrder.getCommonOrder();
|
| | | // 上级用户不是正常用户,订单均不能到账
|
| | | UserInfo userInfo = userInfoMapper.selectAvailableByPrimaryKey(co.getUserInfo().getId());
|
| | | if (userInfo == null || userInfo.getState() != UserInfo.STATE_NORMAL) {
|
| | | invalidHongBaoForbidden(item.getId());
|
| | | hongBaoList.remove(i);
|
| | | i--;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | if(hongBaoList.size()==0)
|
| | | return;
|
| | |
|
| | | // 邀请赚到账事务消息
|
| | | String taskKey = getTaskKey(uid);
|
| | | TeamRewardPreRecieveMQMsg mqMsg = new TeamRewardPreRecieveMQMsg(taskKey, uid, sourceType, maxPregetTime,
|
| | | new Date());
|
| | | Message msg = MQMsgBodyFactory.create(MQTopicName.TOPIC_ORDER, OrderTopicTagEnum.teamRewardPreRecieved, mqMsg);
|
| | | msg.setKey(taskKey);
|
| | | // 添加事务消息
|
| | | try {
|
| | | orderTransactionProducer.send(msg, new LocalTransactionExecuter() {
|
| | | @Override
|
| | | public TransactionStatus execute(Message arg0, Object arg1) {
|
| | | try {
|
| | | fanliInvite(hongBaoList, uid, sourceType, taskKey, maxPregetTime);
|
| | | } catch (Exception e) {
|
| | | return TransactionStatus.RollbackTransaction;
|
| | | }
|
| | | return TransactionStatus.CommitTransaction;
|
| | | }
|
| | | }, null);
|
| | | } catch (Exception e) {
|
| | | LogHelper.mqError(e.getMessage(), msg.getTopic(), msg.getTag(), new Gson().toJson(mqMsg));
|
| | | }
|
| | | inviteSettle(uid,sourceType,maxPregetTime);
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | |
| | | public void inviteSettleVipShop(Long uid, Date maxPregetTime) throws OrderMoneySettleException {
|
| | | // 查询UID的一二级邀请赚
|
| | | int sourceType = Constant.SOURCE_TYPE_VIP;
|
| | | inviteSettle(uid,sourceType,maxPregetTime);
|
| | | }
|
| | |
|
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void inviteSettleSuning(Long uid, Date maxPregetTime) throws OrderMoneySettleException {
|
| | | // 查询UID的一二级邀请赚
|
| | | int sourceType = Constant.SOURCE_TYPE_SUNING;
|
| | | inviteSettle(uid,sourceType,maxPregetTime);
|
| | | }
|
| | |
|
| | |
|
| | | private void inviteSettle(Long uid, int sourceType, Date maxPregetTime) throws OrderMoneySettleException {
|
| | | // 查询UID的一二级邀请赚
|
| | | List<Integer> types = new ArrayList<>();
|
| | | types.add(HongBaoV2.TYPE_YIJI);
|
| | | types.add(HongBaoV2.TYPE_ERJI);
|
| | |
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void shareSettlePDD(Long uid, Date maxPregetTime) throws OrderMoneySettleException {
|
| | | shareSettleVipShop(Constant.SOURCE_TYPE_PDD, uid, maxPregetTime);
|
| | | shareSettle(Constant.SOURCE_TYPE_PDD, uid, maxPregetTime);
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void shareSettleVipShop(Long uid, Date maxPregetTime) throws OrderMoneySettleException {
|
| | | shareSettleVipShop(Constant.SOURCE_TYPE_VIP, uid, maxPregetTime);
|
| | | shareSettle(Constant.SOURCE_TYPE_VIP, uid, maxPregetTime);
|
| | | }
|
| | |
|
| | | private void shareSettleVipShop(int sourceType, Long uid, Date maxPregetTime) throws OrderMoneySettleException {
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void shareSettleSuning(Long uid, Date maxPregetTime) throws OrderMoneySettleException {
|
| | | shareSettle(Constant.SOURCE_TYPE_SUNING, uid, maxPregetTime);
|
| | | }
|
| | |
|
| | | private void shareSettle(int sourceType, Long uid, Date maxPregetTime) throws OrderMoneySettleException {
|
| | | /**
|
| | | * 处理分享赚
|
| | | */
|
| | |
| | | return hongBao;
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | private void fanliInvite(List<HongBaoV2> hongBaoList, Long uid, int sourceType, String key, Date maxPreGetTime)
|
| | | throws TeamEincomeRecordException, ParamsException, TeamRewardDebtException {
|
| | | List<Long> hbIdList = new ArrayList<>();
|
| | |
| | | HongBaoV2 updateHongBao = new HongBaoV2();
|
| | | updateHongBao.setId(hongBao.getId());
|
| | | updateHongBao.setGetTime(new Date());
|
| | | updateHongBao.setState(HongBaoV2.STATE_YILINGQU);
|
| | | updateHongBao.setState(HongBaoV2.STATE_LINGQUING);
|
| | | updateHongBao.setUpdateTime(new Date());
|
| | | hongBaoV2Mapper.updateByPrimaryKeySelective(updateHongBao);
|
| | | // 添加到红包返利记录集合
|
| | |
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dao.mybatis.HongBaoV2Mapper;
|
| | | import com.yeshi.fanli.dao.mybatis.UserInfoMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.money.UserMoneyDetailMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.order.HongBaoOrderMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.order.OrderMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoWeiQuanOrderMapper;
|
| | |
| | | import com.yeshi.fanli.service.inter.elme.ElmeHongBaoOrderMapService;
|
| | | import com.yeshi.fanli.service.inter.elme.ElmeOrderProcessService;
|
| | | import com.yeshi.fanli.service.inter.elme.ElmeOrderService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.AccountDetailsHongBaoMapService;
|
| | | import com.yeshi.fanli.service.inter.money.UserMoneyService;
|
| | | import com.yeshi.fanli.service.inter.money.msg.UserMoneyMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.money.tb.TaoBaoWeiQuanDrawBackService;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.HongBaoV2Service;
|
| | |
| | | import com.yeshi.fanli.service.inter.order.tb.TaoBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoBuyRelationMapService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
|
| | | import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.service.manger.msg.RocketMQManager;
|
| | | import com.yeshi.fanli.service.manger.order.HongBaoV2AddManager;
|
| | |
| | | private TaoBaoWeiQuanOrderMapper taoBaoWeiQuanOrderMapper;
|
| | |
|
| | | @Resource
|
| | | private AccountDetailsHongBaoMapService accountDetailsHongBaoMapService;
|
| | |
|
| | | @Resource
|
| | | private UserMoneyDetailMapper userMoneyDetailMapper;
|
| | |
|
| | | @Resource
|
| | | private HongBaoV2Mapper hongBaoV2Mapper;
|
| | |
|
| | | @Resource
|
| | | private UserMoneyMsgNotificationService userMoneyMsgNotificationService;
|
| | |
|
| | | @Resource
|
| | | private UserOrderMsgNotificationService userOrderMsgNotificationService;
|
| | |
|
| | | @Resource
|
| | | private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
|
| | |
|
| | | @Resource
|
| | | private UserSystemCouponService userSystemCouponService;
|
| | |
|
| | | @Resource
|
| | | private UserMoneyService userMoneyService;
|
| | |
| | | } catch (OrderMoneySettleException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | try {
|
| | | orderMoneySettleService.inviteSettleVipShop(uid, maxPreGetTime);
|
| | | } catch (OrderMoneySettleException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | try {
|
| | | orderMoneySettleService.inviteSettleSuning(uid, maxPreGetTime);
|
| | | } catch (OrderMoneySettleException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | |
|
| | | try {
|
| | | orderMoneySettleService.shareSettlePDD(uid, maxPreGetTime);
|
| | | } catch (OrderMoneySettleException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | try {
|
| | | orderMoneySettleService.shareSettleVipShop(uid, maxPreGetTime);
|
| | | } catch (OrderMoneySettleException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | try {
|
| | | orderMoneySettleService.shareSettleSuning(uid, maxPreGetTime);
|
| | | } catch (OrderMoneySettleException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | * @param jdOrder
|
| | | * @param uid
|
| | | */
|
| | | @Transactional
|
| | | private void processFanLiJDOrder(JDOrder jdOrder, Long uid) {
|
| | | int invalidCount = 0;
|
| | | BigDecimal totalMoney = new BigDecimal(0);
|
| | |
| | |
|
| | | /**
|
| | | * 处理京东分享订单
|
| | | * |
| | | * @param order
|
| | | * @param jdOrder
|
| | | * @param uid
|
| | | */
|
| | | @Transactional
|
| | | private void processShareJDOrder(JDOrder jdOrder, Long uid) {
|
| | | try {
|
| | | List<CommonOrderAddResultDTO> commonOrderList = commonOrderService.addJDOrder(jdOrder, uid);
|
| | |
| | |
|
| | | /**
|
| | | * 是否是分享赚订单
|
| | | * |
| | | * @param order
|
| | | * @param pddOrder
|
| | | * @return
|
| | | */
|
| | | private boolean isShareOrder(PDDOrder pddOrder) {
|
| | |
| | |
|
| | | /**
|
| | | * 处理拼多多自购返利订单
|
| | | * |
| | | * @param pddOrder
|
| | | * @param uid
|
| | | */
|
| | | @Transactional
|
| | | private void processFanLiPDDOrder(PDDOrder pddOrder, Long uid) {
|
| | | int orderState = 0;
|
| | | if (pddOrder.getOrderStatus() == -1 || pddOrder.getOrderStatus() == 8)
|
| | |
| | |
|
| | | /**
|
| | | * 处理拼多多分享订单
|
| | | * |
| | | * @param order
|
| | | * @param pddOrder
|
| | | * @param uid
|
| | | */
|
| | | @Transactional
|
| | | private void processSharePDDOrder(PDDOrder pddOrder, Long uid) {
|
| | | try {
|
| | | List<PDDOrder> pddOrderList = new ArrayList<>();
|
| | |
| | |
|
| | | /**
|
| | | * 处理京东返利订单
|
| | | * |
| | | * @param jdOrder
|
| | | * @param vipShopOrder
|
| | | * @param uid
|
| | | */
|
| | | @Transactional
|
| | | private void processFanLiVipShopOrder(VipShopOrder vipShopOrder, Long uid) {
|
| | | int invalidCount = 0;
|
| | | BigDecimal totalMoney = new BigDecimal(0);
|
| | |
| | |
|
| | | /**
|
| | | * 处理京东分享订单
|
| | | * |
| | | * @param order
|
| | | * @param jdOrder
|
| | | * @param uid
|
| | | */
|
| | | @Transactional
|
| | | private void processShareVipShopOrder(VipShopOrder jdOrder, Long uid) {
|
| | | try {
|
| | | List<CommonOrderAddResultDTO> commonOrderList = commonOrderService.addVipShopOrder(jdOrder, uid);
|
| | |
| | |
|
| | | /**
|
| | | * 处理拼多多自购返利订单
|
| | | * |
| | | * @param pddOrder
|
| | | * @param suningOrder
|
| | | * @param uid
|
| | | */
|
| | | @Transactional
|
| | | private void processFanLiSuningOrder(SuningOrderInfo suningOrder, Long uid) {
|
| | | int orderState = 0;
|
| | |
|
| | |
| | |
|
| | | /**
|
| | | * 处理拼多多分享订单
|
| | | * |
| | | * @param order
|
| | | * @param suningOrder
|
| | | * @param uid
|
| | | */
|
| | | @Transactional
|
| | | private void processShareSuningOrder(SuningOrderInfo suningOrder, Long uid) {
|
| | | try {
|
| | | List<SuningOrderInfo> suningOrderList = new ArrayList<>();
|
| | |
| | | * @param sourceType
|
| | | * @param hongBaoType
|
| | | */
|
| | | @Transactional
|
| | | private void addHongBaoWithMQ(List<CommonOrderAddResultDTO> commonOrderList, String orderId, Long uid,
|
| | | int sourceType, int hongBaoType) {
|
| | | final List<CommonOrder> coList = convertCommonOrder(commonOrderList);
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.UserCustomSettings.UserSettingTypeEnum;
|
| | | import com.yeshi.fanli.entity.push.DeviceTokenHW;
|
| | | import com.yeshi.fanli.exception.push.PushException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.log.LogManager;
|
| | | import com.yeshi.fanli.log.PushLogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.AppVersionService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenHWService;
|
| | |
| | | * @throws PushException
|
| | | */
|
| | | public void push(PushContentDetailDTO dto) throws PushException {
|
| | | LogHelper.pushHW("开始推送");
|
| | | int hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
|
| | | List<Integer> newVersionList = getVersionCodeList(dto.getContent().getVersionCodeList(), dto.getContent().getSystem());
|
| | | // 1.6.5后开始推送
|
| | |
| | | }
|
| | |
|
| | | if (dto.getUid() == null || dto.getUid() == 0) {
|
| | | LogHelper.pushHW("全推");
|
| | | //只推送近30天的活跃
|
| | | Date minUpdateTime = new Date(System.currentTimeMillis() - Constant.PUSH_MIN_TIME);
|
| | | long deviceCount = deviceTokenHWService.countDeviceToken(newVersionList, minUpdateTime);
|
| | |
| | | for (int p = 1; p <= page; p++) {
|
| | | List<DeviceTokenHW> hwDeviceList = deviceTokenHWService.getDeviceTokenList(p, 100, newVersionList, minUpdateTime);
|
| | | hwDeviceList = filterDeviceToken(hwDeviceList, hour);
|
| | |
|
| | | LogHelper.pushHW(String.format("全推:设备数%s",hwDeviceList.size()));
|
| | | List<String> tokenList = new ArrayList<>();
|
| | | for (DeviceTokenHW token : hwDeviceList)
|
| | | tokenList.add(token.getDeviceToken());
|
| | |
| | |
|
| | | }
|
| | | } else {
|
| | | LogHelper.pushHW("单推");
|
| | | // 华为单推
|
| | | List<DeviceTokenHW> hwDeviceList = deviceTokenHWService.getDeviceTokenByUid(dto.getUid(), newVersionList);
|
| | | List<String> tokenList = new ArrayList<>();
|
| | |
| | | for (DeviceTokenHW token : hwDeviceList)
|
| | | tokenList.add(token.getDeviceToken());
|
| | | }
|
| | |
|
| | | LogHelper.pushHW(String.format("单推:设备数%s 用户:%s",hwDeviceList.size(),dto.getUid()+""));
|
| | |
|
| | | if (tokenList.size() == 0)
|
| | | return;
|
| | |
|
| | |
| | |
|
| | | @Override
|
| | | public void addGoods(HDKGoodsDetail goods) {
|
| | | if (goods.getCreateTime() != null)
|
| | | if (goods.getCreateTime() == null)
|
| | | goods.setCreateTime(new Date());
|
| | | goods.setUpdateTime(new Date());
|
| | | hdkGoodsDetailDao.save(goods);
|
| | | }
|
| | |
|
| | |
| | | package com.yeshi.fanli.service.impl.user;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.SMSHistoryMapper;
|
| | | import com.yeshi.fanli.entity.SystemEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.SMSHistory;
|
| | | import com.yeshi.fanli.exception.config.SMSException;
|
| | | import com.yeshi.fanli.service.inter.user.SMSService;
|
| | | import com.yeshi.fanli.util.AliyunSMSUtil;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisKeyEnum;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TencentSMSUtil;
|
| | |
|
| | | import com.yeshi.fanli.util.*;
|
| | | import net.sf.json.JSONObject;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | |
|
| | | @Service
|
| | | public class SMSServiceImpl implements SMSService {
|
| | |
| | | private RedisManager redisManager;
|
| | |
|
| | | @Override
|
| | | public String sendLoginVCode(String phone, int codeLength) throws SMSException {
|
| | | public String sendLoginVCode(SystemEnum system, String phone, int codeLength) throws SMSException {
|
| | | boolean limit = redisManager.isSmsFrequencyLimit(phone, SMSHistory.TYPE_LOGIN);
|
| | | if (limit)
|
| | | throw new SMSException(1001, "请过60秒再试");
|
| | |
| | |
|
| | | String msgCode = StringUtil.getVerifyCode(codeLength);
|
| | | // 验证码模板
|
| | | String msg = Constant.smsConfig.getSmsLogin().replace("[签名]", Constant.smsConfig.getSmsSign()).replace("[验证码]",
|
| | | String msg = Constant.smsConfig.getSmsLogin().replace("[签名]", system.getSmsAlias()).replace("[验证码]",
|
| | | msgCode);
|
| | | // 发送短信
|
| | | // 发送间隔2分钟内的采用阿里云短信发送
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void sendBindVCode(String phone, int codeLength) throws SMSException {
|
| | | public void sendBindVCode(SystemEnum system,String phone, int codeLength) throws SMSException {
|
| | | boolean limit = redisManager.isSmsFrequencyLimit(phone, SMSHistory.TYPE_BIND);
|
| | | if (limit)
|
| | | throw new SMSException(1001, "请过60秒再试");
|
| | | String msgCode = StringUtil.getVerifyCode(codeLength);
|
| | |
|
| | | // 验证码模板
|
| | | String msg = Constant.smsConfig.getSmsBind().replace("[签名]", Constant.smsConfig.getSmsSign()).replace("[验证码]",
|
| | | String msg = Constant.smsConfig.getSmsBind().replace("[签名]", system.getSmsAlias()).replace("[验证码]",
|
| | | msgCode);
|
| | | // 发送短信
|
| | | TencentSMSUtil.sendSingleMsg(phone, msg);
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void sendRemoveVCode(String phone, int codeLength) throws SMSException {
|
| | | public void sendRemoveVCode(SystemEnum system,String phone, int codeLength) throws SMSException {
|
| | | boolean limit = redisManager.isSmsFrequencyLimit(phone, SMSHistory.TYPE_REMVOE);
|
| | | if (limit)
|
| | | throw new SMSException(1001, "请过60秒再试");
|
| | | String msgCode = StringUtil.getVerifyCode(codeLength);
|
| | |
|
| | | // 验证码模板
|
| | | String msg = Constant.smsConfig.getSmsBind().replace("[签名]", Constant.smsConfig.getSmsSign()).replace("[验证码]",
|
| | | String msg = Constant.smsConfig.getSmsBind().replace("[签名]", system.getSmsAlias()).replace("[验证码]",
|
| | | msgCode);
|
| | | // 发送短信
|
| | | TencentSMSUtil.sendSingleMsg(phone, msg);
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void sendExtractVCode(String phone) throws SMSException {
|
| | | public void sendExtractVCode(SystemEnum system,String phone) throws SMSException {
|
| | | boolean limit = redisManager.isSmsFrequencyLimit(phone, SMSHistory.TYPE_EXTRACT);
|
| | | if (limit)
|
| | | throw new SMSException(1001, "请过60秒再试");
|
| | | String msgCode = StringUtil.getRandomCode(6);
|
| | | String msg = Constant.smsConfig.getSmsExtract().replace("[签名]", Constant.smsConfig.getSmsSign())
|
| | | String msg = Constant.smsConfig.getSmsExtract().replace("[签名]",system.getSmsAlias())
|
| | | .replace("[验证码]", msgCode);
|
| | | // 发送短信
|
| | | TencentSMSUtil.sendSingleMsg(phone, msg);
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void sendExtractSuccessMsg(String phone, BigDecimal money) throws SMSException {
|
| | | String msg = Constant.smsConfig.getSmsExtractSuccess().replace("[签名]", Constant.smsConfig.getSmsSign())
|
| | | public void sendExtractSuccessMsg(SystemEnum system,String phone, BigDecimal money) throws SMSException {
|
| | | String msg = Constant.smsConfig.getSmsExtractSuccess().replace("[签名]", system.getSmsAlias())
|
| | | .replace("[金额]", money.toString());
|
| | | // 发送短信
|
| | | TencentSMSUtil.sendSingleMsg(phone, msg);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void sendExtractFailMsg(String phone, BigDecimal money) throws SMSException {
|
| | | String msg = Constant.smsConfig.getSmsExtractFail().replace("[签名]", Constant.smsConfig.getSmsSign())
|
| | | public void sendExtractFailMsg(SystemEnum system,String phone, BigDecimal money) throws SMSException {
|
| | | String msg = Constant.smsConfig.getSmsExtractFail().replace("[签名]", system.getSmsAlias())
|
| | | .replace("[金额]", money.toString());
|
| | | // 发送短信
|
| | | TencentSMSUtil.sendSingleMsg(phone, msg);
|
| | |
| | | */ |
| | | long countSameGoodsOrderByUidAndHongBaoType(List<Integer> typeList, Long uid, int minSameGoodsOrderCount); |
| | | |
| | | |
| | | /** |
| | | *查询用户购买相同商品超过一定的订单数量的商品ID |
| | | * @param typeList |
| | | * @param uid |
| | | * @param minSameGoodsOrderCount |
| | | * @return |
| | | */ |
| | | List<Long> listSameGoodsIdByUidAndHongBaoType(List<Integer> typeList, Long uid, int minSameGoodsOrderCount); |
| | | |
| | | |
| | | /** |
| | | * 查询用户在同一店铺购买超过一定数量商品的店铺id |
| | |
| | | * @param uid |
| | | * @param state |
| | | * @param type |
| | | * @param orderNo |
| | | * 订单号 |
| | | * @param startTime |
| | | * 起始系统录入时间 |
| | | * @param endTime |
| | | * 结束系统录入时间 |
| | | * @param orderNo 订单号 |
| | | * @param startTime 起始系统录入时间 |
| | | * @param endTime 结束系统录入时间 |
| | | * @return |
| | | * @throws CommonOrderException |
| | | */ |
| | |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @param uid |
| | | * 用户id |
| | | * @param type |
| | | * 到账状态 |
| | | * @param uid 用户id |
| | | * @param type 到账状态 |
| | | * @return |
| | | */ |
| | | public List<CommonOrderVO> getOrderByUid(AcceptData acceptData, Integer page, Long uid, Integer state, Integer type, |
| | |
| | | |
| | | /** |
| | | * 添加唯品会订单 |
| | | * @Title: addVipShopOrder |
| | | * @Description: |
| | | * |
| | | * @param order |
| | | * @param uid |
| | | * @return |
| | | * @throws CommonOrderException |
| | | * List<CommonOrderAddResultDTO> 返回类型 |
| | | * @throws CommonOrderException List<CommonOrderAddResultDTO> 返回类型 |
| | | * @throws |
| | | * @Title: addVipShopOrder |
| | | * @Description: |
| | | */ |
| | | public List<CommonOrderAddResultDTO> addVipShopOrder(VipShopOrder order, Long uid) throws CommonOrderException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 添加苏宁订单 |
| | | * @Title: addVipShopOrder |
| | | * @Description: |
| | | * |
| | | * @param order |
| | | * @param uid |
| | | * @return |
| | | * @throws CommonOrderException |
| | | * List<CommonOrderAddResultDTO> 返回类型 |
| | | * @throws CommonOrderException List<CommonOrderAddResultDTO> 返回类型 |
| | | * @throws |
| | | * @Title: addVipShopOrder |
| | | * @Description: |
| | | */ |
| | | public List<CommonOrderAddResultDTO> addSuningOrder(List<SuningOrderInfo> suningOrderList, Long uid) throws CommonOrderException; |
| | | |
| | |
| | | * @param orderNo |
| | | * @param startTime |
| | | * @param endTime |
| | | * @param dateType |
| | | * 1昨天 2今天 3本月 4 上月 |
| | | * @param dateType 1昨天 2今天 3本月 4 上月 |
| | | * @return |
| | | * @throws CommonOrderException |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 查询首笔有效订单 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 查询首笔有效订单 |
| | | * |
| | | * @param uid |
| | | * @param type 类型: 1自购 2分享 3邀请 |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 查询是否上月到账订单 |
| | | * |
| | | * @param uid |
| | | * @param type 类型: 1自购 2分享 3邀请 |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 首个分享订单 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 订单中获得有效奖金 |
| | | * |
| | | * @param orderNo |
| | | * @param sourceType |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 统计24小时有效自购订单 |
| | | * |
| | | * @param uid |
| | | * @param minTime |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 订单统计有效数量 |
| | | * |
| | | * @param uid |
| | | * @param day |
| | | * @param source |
| | |
| | | |
| | | /** |
| | | * 搜索订单信息 |
| | | * |
| | | * @param page |
| | | * @param size |
| | | * @param uid |
| | |
| | | |
| | | /** |
| | | * 返回订单的第三方创建时间 |
| | | * @Title: getThirdCreateTime |
| | | * @Description: |
| | | * |
| | | * @param orderId |
| | | * @param sourceType |
| | | * @return |
| | | * Date 返回类型 |
| | | * @return Date 返回类型 |
| | | * @throws |
| | | * @Title: getThirdCreateTime |
| | | * @Description: |
| | | */ |
| | | public Date getThirdCreateTime(String orderId,int sourceType); |
| | | |
| | |
| | | |
| | | /** |
| | | * 新版红包信息2.1 |
| | | * |
| | | * @param acceptData |
| | | * @param page |
| | | * @param uid |
| | |
| | | |
| | | /** |
| | | * 维权金额计算 |
| | | * |
| | | * @param listWQ |
| | | * @param sourceType |
| | | * @param uid |
| | |
| | | |
| | | /** |
| | | * 统计订单记录数量-非订单号为主 |
| | | * |
| | | * @param uid |
| | | * @param payment |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取最新的淘宝订单号 |
| | | * |
| | | * @return |
| | | */ |
| | | public String getNewestOrderNoByTaoBao(); |
| | | |
| | | /** |
| | | * 根据订单号查询 |
| | | * |
| | | * @param orderNo |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据订单类型+ 订单号查询 |
| | | * |
| | | * @param uid |
| | | * @param orderNO |
| | | * @param sourceType |
| | |
| | | |
| | | /** |
| | | * 首单 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | public CommonOrder getFirstOrder(Long uid); |
| | | |
| | | |
| | | /** |
| | | * 根据商品ID,用户ID,最小创建时间查询 |
| | | * |
| | | * @param goodsId |
| | | * @param uid |
| | | * @param minThirdCreateTime |
| | | * @return |
| | | */ |
| | | public List<CommonOrder> listByGoodsIdAndUidAndMinThirdCreateTime(Long goodsId, Long uid, Date minThirdCreateTime); |
| | | |
| | | } |
| | |
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.exception.order.HongBaoException;
|
| | | import com.yeshi.fanli.exception.user.UserAccountException;
|
| | | import org.omg.CORBA.PUBLIC_MEMBER;
|
| | |
|
| | | public interface HongBaoV2Service {
|
| | |
|
| | |
| | | * @return
|
| | | */
|
| | | public Integer getDirectBossUrankByPid(Long pid);
|
| | |
|
| | |
|
| | | /**
|
| | | * 设置红包已领取
|
| | | * @param uid
|
| | | * @param preGetTime
|
| | | */
|
| | | public void setHongBaoRecieved(Long uid,List<Integer> typeList, Date preGetTime);
|
| | | }
|
| | |
| | |
|
| | | public void inviteSettlePDD(Long uid, Date maxPregetTime) throws OrderMoneySettleException;
|
| | |
|
| | | public void inviteSettleSuning(Long uid, Date maxPregetTime) throws OrderMoneySettleException;
|
| | | |
| | | public void inviteSettleVipShop(Long uid, Date maxPregetTime) throws OrderMoneySettleException;
|
| | |
|
| | | /**
|
| | |
| | |
|
| | | public void shareSettleVipShop(Long uid, Date maxPregetTime) throws OrderMoneySettleException;
|
| | |
|
| | | public void shareSettleSuning(Long uid, Date maxPregetTime) throws OrderMoneySettleException;
|
| | |
|
| | | /**
|
| | | * 自购结算
|
| | | *
|
| | |
| | |
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | import com.yeshi.fanli.entity.SystemEnum;
|
| | | import com.yeshi.fanli.exception.config.SMSException;
|
| | |
|
| | | /**
|
| | |
| | | * @param phone
|
| | | * @throws SMSException
|
| | | */
|
| | | public String sendLoginVCode(String phone, int codeLength) throws SMSException;
|
| | | public String sendLoginVCode(SystemEnum system, String phone, int codeLength) throws SMSException;
|
| | |
|
| | | /**
|
| | | * 发送绑定验证码
|
| | |
| | | * @param phone
|
| | | * @throws SMSException
|
| | | */
|
| | | public void sendBindVCode(String phone, int codeLength) throws SMSException;
|
| | | public void sendBindVCode(SystemEnum system,String phone, int codeLength) throws SMSException;
|
| | |
|
| | | /**
|
| | | * 发送提现验证码
|
| | |
| | | * @param phone
|
| | | * @throws SMSException
|
| | | */
|
| | | public void sendExtractVCode(String phone) throws SMSException;
|
| | | public void sendExtractVCode(SystemEnum system,String phone) throws SMSException;
|
| | |
|
| | | /**
|
| | | * 提现成功短信
|
| | |
| | | * @param phone
|
| | | * @param money
|
| | | */
|
| | | public void sendExtractSuccessMsg(String phone, BigDecimal money) throws SMSException;
|
| | | public void sendExtractSuccessMsg(SystemEnum system,String phone, BigDecimal money) throws SMSException;
|
| | |
|
| | | /**
|
| | | * 发送提现失败验证码
|
| | |
| | | * @param phone
|
| | | * @param money
|
| | | */
|
| | | public void sendExtractFailMsg(String phone, BigDecimal money) throws SMSException;
|
| | | public void sendExtractFailMsg(SystemEnum system,String phone, BigDecimal money) throws SMSException;
|
| | |
|
| | | /**
|
| | | * 账户注销
|
| | |
| | | * @param codeLength
|
| | | * @throws SMSException
|
| | | */
|
| | | public void sendRemoveVCode(String phone, int codeLength) throws SMSException;
|
| | | public void sendRemoveVCode(SystemEnum system,String phone, int codeLength) throws SMSException;
|
| | | }
|
| | |
| | | String goodsId = PinDuoDuoUtil.getPDDGoodsId(shortLink);
|
| | | if (!StringUtil.isNullOrEmpty(goodsId)) {
|
| | | PDDPromotionUrl pddUrl = PinDuoDuoApiUtil.convert(Long.parseLong(goodsId),
|
| | | share ? PinDuoDuoApiUtil.PID_SHARE : PinDuoDuoApiUtil.PID_FANLI, uid + "");
|
| | | share ? PinDuoDuoApiUtil.PID_SHARE : PinDuoDuoApiUtil.PID_FANLI, uid + "",false);
|
| | | if (pddUrl != null) {
|
| | | linkMap.put(shortLink, pddUrl.getShortUrl());
|
| | | }
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.service.inter.order.HongBaoV2Service;
|
| | | import org.springframework.stereotype.Component;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private UserMoneyMsgNotificationService userMoneyMsgNotificationService;
|
| | |
|
| | | @Resource
|
| | | private HongBaoV2Service hongBaoV2Service;
|
| | |
|
| | | /**
|
| | | * @throws ParamsException
|
| | |
| | | // 发送消息
|
| | | BigDecimal balance = userMoneyService.getBalance(uid);
|
| | | userMoneyMsgNotificationService.teamRewardReceive(uid, money, balance, now);
|
| | |
|
| | | //更改状态
|
| | | List<Integer> hongBaoTypeList=new ArrayList<>();
|
| | | hongBaoTypeList.add(HongBaoV2.TYPE_YIJI);
|
| | | hongBaoTypeList.add(HongBaoV2.TYPE_ERJI);
|
| | | hongBaoTypeList.add(HongBaoV2.TYPE_SHARE_YIJI);
|
| | | hongBaoTypeList.add(HongBaoV2.TYPE_SHARE_ERJI);
|
| | | hongBaoV2Service.setHongBaoRecieved(uid,hongBaoTypeList,preSendTime);
|
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | public static final String TAOBAO_SPECIAL_PID_DEFAULT = "mm_124933865_56750082_89555600043";
|
| | |
|
| | |
|
| | | public static final long PUSH_MIN_TIME=1000*60*60*24*30*2L;
|
| | | public static final long PUSH_MIN_TIME=1000*60*60L*24*30*2;
|
| | |
|
| | |
|
| | | //优惠狗云发单群唤起关键词
|
| | |
| | | taobaoCode("taobao-code-", "淘宝code"),
|
| | | taobaoTokenGoodsMap("tb-t-g_m-", "淘宝口令对应商品的映射关系保存"),
|
| | | taobaoBaseLink("tb-b-l-", "淘客商品转链结果缓存"),
|
| | | taobaoSearchResult("tb-s-r-", "淘宝搜索结果缓存"),
|
| | |
|
| | | JDGoods("JD-goods-", "京东商品"),
|
| | | JDShortUrl("jd-link-to-goods-", "京东短链"),
|
| | | jingDongGoods("jingdong-goods-", "京东商品"),
|
| | |
| | | while (its.hasNext()) {
|
| | | String key = its.next();
|
| | | PushContentDetailDTO dto = map.get(key);
|
| | | LogHelper.pushHW("接受到消息:" + new Gson().toJson(dto));
|
| | |
|
| | | try {
|
| | | hwPushService.push(dto);
|
| | | PushCMQManager.getInstance().deleteHWPush(key);
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import com.yeshi.fanli.entity.taobao.SearchFilter;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | |
| | |
|
| | | /**
|
| | | * 缓存转链结果
|
| | | * @Title: cacheBaseConvertLink
|
| | | * @Description: |
| | | *
|
| | | * @param auctionId
|
| | | * @param pid
|
| | | * @param link |
| | | * void 返回类型
|
| | | * @param link void 返回类型
|
| | | * @throws
|
| | | * @Title: cacheBaseConvertLink
|
| | | * @Description:
|
| | | */
|
| | | public void cacheBaseConvertLink(Long auctionId, String pid, String link) {
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.taobaoBaseLink, StringUtil.Md5(auctionId + "#" + pid));
|
| | |
| | | return StringUtil.isNullOrEmpty(url) ? null : url;
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 保存搜索接口
|
| | | *
|
| | | * @param sf
|
| | | * @param result
|
| | | */
|
| | | public void saveSearchResult(SearchFilter sf, TaoBaoSearchResult result) {
|
| | | if (result == null||result.getTaoBaoGoodsBriefs()==null)
|
| | | return;
|
| | | String key = RedisKeyEnum.taobaoSearchResult.getKey() + StringUtil.Md5(new Gson().toJson(sf));
|
| | | //缓存20分钟
|
| | | redisManager.cacheCommonString(key, new Gson().toJson(result), 60 * 20);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取搜索结果
|
| | | *
|
| | | * @param sf
|
| | | * @return
|
| | | */
|
| | | public TaoBaoSearchResult getSearchResult(SearchFilter sf) {
|
| | | String key = RedisKeyEnum.taobaoSearchResult.getKey() + StringUtil.Md5(new Gson().toJson(sf));
|
| | | String result = redisManager.getCommonString(key);
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(result))
|
| | | return null;
|
| | | else
|
| | | return new Gson().fromJson(result, TaoBaoSearchResult.class);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | *
|
| | | * @param page
|
| | | * @param pageSize
|
| | | * @param channelType
|
| | | * 频道类型;0, "1.9包邮", 1, "今日爆款", 2, "品牌清仓", 非必填 ,默认是1
|
| | | * @param channelType 频道类型;0, "1.9包邮", 1, "今日爆款", 2, "品牌清仓", 非必填 ,默认是1
|
| | | * @return
|
| | | */
|
| | | public static PDDGoodsResult searchByChannelType(Integer page, Integer pageSize, String channelType) {
|
| | |
| | | /**
|
| | | * 多多客获取爆款排行商品接口
|
| | | *
|
| | | * @param pid
|
| | | * 推广位id (非必填)
|
| | | * @param page
|
| | | * 从多少位置开始请求;默认值 : 0 (非必填)
|
| | | * @param pageSize
|
| | | * 请求数量;默认值 :20 (非必填)
|
| | | * @param sortType
|
| | | * 1-实时热销榜;2-实时收益榜 (非必填)
|
| | | * @param pid 推广位id (非必填)
|
| | | * @param page 从多少位置开始请求;默认值 : 0 (非必填)
|
| | | * @param pageSize 请求数量;默认值 :20 (非必填)
|
| | | * @param sortType 1-实时热销榜;2-实时收益榜 (非必填)
|
| | | * @return
|
| | | */
|
| | | public static PDDGoodsResult getTopList(String pid, Integer page, Integer pageSize, Integer sortType) {
|
| | |
| | | * @param customParams
|
| | | * @return
|
| | | */
|
| | | public static PDDPromotionUrl convert(Long goodsId, String pid, String customParams) {
|
| | | public static PDDPromotionUrl convert(Long goodsId, String pid, String customParams, boolean withAuthLink) {
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("type", "pdd.ddk.goods.promotion.url.generate");
|
| | | map.put("p_id", pid);
|
| | |
| | | if (!StringUtil.isNullOrEmpty(customParams)) {
|
| | | map.put("custom_parameters", customParams);
|
| | | }
|
| | |
|
| | | //是否生成带授权的单品链接
|
| | | if (withAuthLink)
|
| | | map.put("generate_authority_url", true + "");
|
| | |
|
| | | String result = baseRequest(map);
|
| | | JSONObject root = JSONObject.fromObject(result);
|
| | |
| | | * @return
|
| | | */
|
| | | public static String getPromotionUrl(Long goodsId, String pid, String customParams) {
|
| | | PDDPromotionUrl promotion = convert(goodsId, pid, customParams);
|
| | | PDDPromotionUrl promotion = convert(goodsId, pid, customParams,false);
|
| | | if (promotion != null) {
|
| | | return promotion.getShortUrl();
|
| | | }
|
| | |
| | | /**
|
| | | * 获取订单
|
| | | *
|
| | | * @param page
|
| | | * -页码
|
| | | * @param page -页码
|
| | | * @param pageSize-每页数量
|
| | | * @param startTime-开始时间
|
| | | * @param endTime-结束时间
|
| | | * 与开始时间不得大于24小时
|
| | | * @param endTime-结束时间 与开始时间不得大于24小时
|
| | | * @return
|
| | | */
|
| | | public static PDDOrderResult getOrdersList(int page, int pageSize, long startTime, long endTime) {
|
| | |
| | | map.put("page", page + "");
|
| | | map.put("page_size", pageSize + "");
|
| | | String result = baseRequest(map);
|
| | | System.out.println(result);
|
| | | JSONObject json = JSONObject.fromObject(result);
|
| | | JSONObject root = json.optJSONObject("order_list_get_response");
|
| | | if (root != null) {
|
| | |
| | | map.put("type", "pdd.ddk.order.detail.get");
|
| | | map.put("order_sn", orderSn);
|
| | | String result = baseRequest(map);
|
| | | System.out.println(result);
|
| | | JSONObject json = JSONObject.fromObject(result);
|
| | | JSONObject root = json.optJSONObject("order_detail_response");
|
| | | if (root != null) {
|
| | |
| | | * @param goodsId
|
| | | */
|
| | | public static PDDGoodsDetail getGoodsDetail(Long goodsId) {
|
| | | return getGoodsDetail(goodsId, null, null);
|
| | | }
|
| | |
|
| | | public static PDDGoodsDetail getGoodsDetail(Long goodsId, String pid, String customParameters) {
|
| | | JSONArray array = new JSONArray();
|
| | | array.add(goodsId);
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("type", "pdd.ddk.goods.detail");
|
| | | map.put("goods_id_list", array.toString());
|
| | | if (!StringUtil.isNullOrEmpty(pid)) {
|
| | | map.put("pid", pid);
|
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(customParameters)) {
|
| | | map.put("custom_parameters", customParameters);
|
| | | }
|
| | |
|
| | | String result = baseRequest(map);
|
| | | System.out.println(result);
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | JSONObject root = resultJson.optJSONObject("goods_detail_response");
|
| | | if (root == null) {
|
| | |
| | | map.put("p_id", PID_FANLI);
|
| | | String result = baseRequest(map);
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | System.out.println(result);
|
| | | JSONObject root = resultJson.optJSONObject("ddk_phrase_generate_response");
|
| | | if (root != null) {
|
| | | array = root.optJSONArray("promotion_phrase_list");
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 获取商品详情
|
| | | * |
| | | * @param goodsId
|
| | | * @param page
|
| | | * @param catId
|
| | | * @return
|
| | | */
|
| | | public static PDDShopResult getShopList(Integer page, Long catId) {
|
| | | JSONArray arrayType = new JSONArray();
|
| | |
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 是否授权
|
| | | *
|
| | | * @param pid
|
| | | * @param customParameters
|
| | | * @return
|
| | | */
|
| | | public static boolean isAuth(String pid, String customParameters) {
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("type", "pdd.ddk.member.authority.query");
|
| | | map.put("pid", pid);
|
| | | map.put("custom_parameters", customParameters);
|
| | | String result = baseRequest(map);
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | if (resultJson.optJSONObject("authority_query_response").optInt("bind") == 0) {
|
| | | return false;
|
| | | } else
|
| | | return true;
|
| | | }
|
| | | }
|
| | |
| | | BigDecimal price = MoneyBigDecimalUtil.div(new BigDecimal(goods.getMinGroupPrice()), hundred).setScale(2);
|
| | | BigDecimal promotionRate = MoneyBigDecimalUtil.div3(new BigDecimal(goods.getPromotionRate()),
|
| | | new BigDecimal(1000));
|
| | | if (goods.getPredictPromotionRate() != null)
|
| | | promotionRate = MoneyBigDecimalUtil.div3(goods.getPredictPromotionRate(),
|
| | | new BigDecimal(1000));
|
| | |
|
| | | Boolean hasCoupon = goods.getHasCoupon();
|
| | | if (hasCoupon == null || !hasCoupon) {
|
| | |
| | |
|
| | | static String jdGoodsJs = null;
|
| | | static ScriptEngine engine = null;
|
| | |
|
| | | static {
|
| | | if (jdGoodsJs == null)
|
| | | jdGoodsJs = getJDGoodsJS();
|
| | |
| | |
|
| | | if (newGoods != null) {
|
| | | goods.setTkRate(newGoods.getTkRate());
|
| | | goods.setAuctionUrl(newGoods.getAuctionUrl());
|
| | | goods.setCouponLink(newGoods.getCouponLink());
|
| | | if (!StringUtil.isNullOrEmpty(newGoods.getCouponInfo())) {
|
| | | List<BigDecimal> couponInfo = TaoBaoCouponUtil.getCouponInfo(newGoods.getCouponInfo());
|
| | | if (couponInfo != null && couponInfo.size() > 1) {
|
New file |
| | |
| | | version: '3' |
| | | services: |
| | | jobs: |
| | | restart: always |
| | | image: tomcat:8 |
| | | container_name: fanli-job1 |
| | | ports: |
| | | - "9081:8080" |
| | | - "9991:9999" |
| | | volumes: |
| | | - "/usr/local/docker/fanli-job1/webapps:/usr/local/tomcat/webapps" |
| | | - "/root/logs/fanli-job1:/usr/local/tomcat/logs" |
| | | command: |
| | | - /bin/bash |
| | | - -c |
| | | - | |
| | | cd /usr/local/tomcat/bin |
| | | if [ $(grep -o "Duser.timezone" catalina.sh |wc -l) -le 0 ] ;then |
| | | #sed -i '127i\JAVA_OPTS=\"-Duser.timezone=GMT+08\"' catalina.sh |
| | | fi |
| | | |
| | | logging: |
| | | driver: "json-file" |
| | | options: |
| | | max-size: "1g" |
New file |
| | |
| | | version: '3' |
| | | services: |
| | | jobs: |
| | | restart: always |
| | | image: timecat-bj:8 |
| | | container_name: fanli-job |
| | | ports: |
| | | - "8081:8080" |
| | | - "9999:9999" |
| | | volumes: |
| | | - "/usr/local/docker/fanli-job/webapps:/usr/local/tomcat/webapps" |
| | | - "/root/logs/fanli-job:/usr/local/tomcat/logs" |
| | | |
| | | logging: |
| | | driver: "json-file" |
| | | options: |
| | | max-size: "1g" |
| | |
| | | mongo.dbname=flq
|
| | | mongo.port=27016
|
| | | mongo.port=27017
|
| | | #开发环境
|
| | | #mongo.host=192.168.1.253
|
| | | #mongo.username=admin
|
| | | #mongo.password=123456
|
| | | #
|
| | | mongo.host=193.112.35.168
|
| | | mongo.username=yeshi
|
| | | mongo.password=Yeshi2016@
|
| | | mongo.host=192.168.1.253
|
| | | mongo.username=admin
|
| | | mongo.password=123456
|
| | |
|
| | | #mongo.host=193.112.35.168
|
| | | #mongo.username=yeshi
|
| | | #mongo.password=Yeshi2016@
|
| | |
|
| | | mongo.connectionsPerHost=8
|
| | | mongo.threadsAllowedToBlockForConnectionMultiplier=4
|
| | |
| | | redis.addr=192.168.3.253
|
| | | redis.addr=192.168.1.253
|
| | | redis.port=6379
|
| | | redis.auth=123456
|
| | | #redis.addr=193.112.34.40
|
| | |
| | | </sql> |
| | | <sql id="Count_Select_State"> |
| | | <if test="state != null and state == 1"> <!-- 未到账 --> |
| | | AND (t.hb_state = 1 or t.hb_state = 2) |
| | | AND (t.hb_state = 1 or t.hb_state = 2 or t.hb_state = 5) |
| | | </if> |
| | | <if test="state != null and state == 2"> <!-- 已到账 --> |
| | | AND t.hb_state = 3 |
| | |
| | | </if> |
| | | |
| | | <if test="moneyState != null and moneyState == 1"> <!-- 未到账 --> |
| | | AND (v.hb_state = 1 or v.hb_state = 2) |
| | | AND (v.hb_state = 1 or v.hb_state = 2 or v.hb_state = 5) |
| | | </if> |
| | | <if test="moneyState != null and moneyState == 2"> <!-- 已到账 --> |
| | | AND v.hb_state = 3 |
| | |
| | | SELECT IF(a.money IS NULL,0,a.money ) FROM (SELECT |
| | | SUM(h.`hb_money`) AS money FROM `yeshi_ec_hongbao_v2` h WHERE |
| | | h.`hb_uid`=#{0} |
| | | AND (h.`hb_state`=1 OR h.hb_state=2 )AND |
| | | AND (h.`hb_state`=1 OR h.hb_state=2 OR h.hb_state=5 )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)) a |
| | |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <update id="setHongBaoRecieved" > |
| | | update yeshi_ec_hongbao_v2 v set v.hb_state=3 ,v.hb_update_time=NOW() where v.hb_uid=#{uid} and v.hb_state=5 and v.hb_pre_get_time=#{preGetTime} |
| | | <if test="typeList!=null"> |
| | | <foreach collection="typeList" item="type" open=" and (" separator=" or " close=")"> |
| | | v.hb_type=#{type} |
| | | </foreach> |
| | | </if> |
| | | </update> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_hongbao_v2 where hb_id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | |
| | | </select> |
| | | |
| | | <select id="countOrderNumber" resultMap="ChartMap"> |
| | | SELECT IFNULL(COUNT(t.`co_id`),0) AS showValue,<include refid="Column_DateType"/> |
| | | SELECT IFNULL(COUNT(t.`co_id`),0) AS showValue, |
| | | <include refid="Column_DateType"/> |
| | | FROM `yeshi_ec_common_order` t |
| | | WHERE t.co_source_type=#{sourceType} and t.`co_third_create_time` IS NOT NULL <include refid="Count_Select_DateType"/> |
| | | WHERE t.co_source_type=#{sourceType} and t.`co_third_create_time` IS NOT NULL |
| | | <include refid="Count_Select_DateType"/> |
| | | <include refid="Count_Group_DateType"/> |
| | | ORDER BY t.`co_third_create_time` |
| | | </select> |
| | |
| | | WHERE v2.`hb_uid`= #{uid} AND v2.`hb_type` IN(1,20))hb |
| | | ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL AND <![CDATA[co.`co_state` <> 4]]> |
| | | WHERE hb.hb_id IS NOT NULL AND <![CDATA[co.`co_state` <> 4 |
| | | ]]> |
| | | </select> |
| | | |
| | | <select id="getMoneyByOrderNo" resultType="java.math.BigDecimal"> |
| | |
| | | </if> |
| | | AND v.`hb_id` IS NOT NULL |
| | | AND (co.`co_state`=1 OR co.`co_state`=2 OR co.`co_state`=3) |
| | | AND g.`cog_shop_id`>0 GROUP BY co.`co_order_no`,co.`co_source_type` |
| | | AND g.`cog_shop_id`>0 |
| | | <if test="minDate!=null"> |
| | | and co.co_third_create_time>=#{minDate} |
| | | </if> |
| | | |
| | | GROUP BY co.`co_order_no`,co.`co_source_type` |
| | | ) a GROUP BY a.shopId |
| | | ) b WHERE b.num>=#{minSameShopGoodsCount}; |
| | | </select> |
| | |
| | | LEFT JOIN yeshi_ec_hongbao_order ho ON co.`co_id`=ho.`ho_order_id` |
| | | LEFT JOIN yeshi_ec_hongbao_v2 v ON v.`hb_id`=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order_goods g ON co.`co_order_goods_id`=g.`cog_id` |
| | | WHERE co.`co_uid`=#{uid} AND g.`cog_shop_id` <![CDATA[<>]]> 725677994 <!-- 天猫超市 --> |
| | | WHERE co.`co_uid`=#{uid} |
| | | <if test="excludeShopIds!=null"> |
| | | <foreach collection="excludeShopIds" item="shopId" separator=" and " open="and (" close=")"> |
| | | g.`cog_shop_id` != #{shopId} |
| | | </foreach> |
| | | |
| | | </if> |
| | | |
| | | <!-- 天猫超市 --> |
| | | <if test="typeList!=null"> |
| | | <foreach collection="typeList" item="type" open=" and (" separator=" or " close=")"> |
| | | v.`hb_type`=#{type} |
| | |
| | | </if> |
| | | AND v.`hb_id` IS NOT NULL |
| | | AND (co.`co_state`=1 OR co.`co_state`=2 OR co.`co_state`=3) |
| | | |
| | | <if test="minDate!=null"> |
| | | AND co.co_third_create_time>=#{minDate} |
| | | </if> |
| | | |
| | | GROUP BY co.`co_order_no`,co.`co_order_goods_id` |
| | | ) a GROUP BY goodsId |
| | | ) b WHERE b.c>=#{minSameGoodsOrderCount} |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="listSameGoodsIdByUidAndHongBaoType" resultType="Long"> |
| | | SELECT b.goodsId FROM |
| | | ( |
| | | SELECT a.goodsId,COUNT(*) AS c FROM |
| | | ( |
| | | SELECT co.`co_order_goods_id` AS goodsId,co.`co_order_no` FROM yeshi_ec_common_order co |
| | | LEFT JOIN yeshi_ec_hongbao_order ho ON co.`co_id`=ho.`ho_order_id` |
| | | LEFT JOIN yeshi_ec_hongbao_v2 v ON v.`hb_id`=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order_goods g ON co.`co_order_goods_id`=g.`cog_id` |
| | | WHERE co.`co_uid`=#{uid} |
| | | <if test="excludeShopIds!=null"> |
| | | <foreach collection="excludeShopIds" item="shopId" separator=" and " open="and (" close=")"> |
| | | g.`cog_shop_id` != #{shopId} |
| | | </foreach> |
| | | |
| | | </if> |
| | | |
| | | <!-- 天猫超市 --> |
| | | <if test="typeList!=null"> |
| | | <foreach collection="typeList" item="type" open=" and (" separator=" or " close=")"> |
| | | v.`hb_type`=#{type} |
| | | </foreach> |
| | | </if> |
| | | AND v.`hb_id` IS NOT NULL |
| | | AND (co.`co_state`=1 OR co.`co_state`=2 OR co.`co_state`=3) |
| | | |
| | | <if test="minDate!=null"> |
| | | AND co.co_third_create_time>=#{minDate} |
| | | </if> |
| | | |
| | | GROUP BY co.`co_order_no`,co.`co_order_goods_id` |
| | | ) a GROUP BY goodsId |
| | | ) b WHERE b.c>=#{minSameGoodsOrderCount} |
| | |
| | | LEFT JOIN yeshi_ec_hongbao_order ho ON co.`co_id`=ho.`ho_order_id` |
| | | LEFT JOIN yeshi_ec_hongbao_v2 v ON v.`hb_id`=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order_goods g ON co.`co_order_goods_id`=g.`cog_id` |
| | | WHERE co.`co_uid`=#{uid} AND g.`cog_shop_id` <![CDATA[<>]]> 725677994 <!-- 天猫超市 --> |
| | | WHERE co.`co_uid`=#{uid} |
| | | <if test="excludeShopIds!=null"> |
| | | <foreach collection="excludeShopIds" item="shopId" separator=" and " open="and (" close=")"> |
| | | g.`cog_shop_id` != #{shopId} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="typeList!=null"> |
| | | <foreach collection="typeList" item="type" open=" and (" separator=" or " close=")"> |
| | | v.`hb_type`=#{type} |
| | |
| | | <sql id="SELECT_PARAM_HONGBAO_STATE"> |
| | | <if test="state != null and state == 1"> |
| | | <!-- 未到账 --> |
| | | AND (hb.hb_state = 1 or hb.hb_state = 2) |
| | | AND (hb.hb_state = 1 or hb.hb_state = 2 or hb.hb_state = 5) |
| | | </if> |
| | | <if test="state != null and state == 2"> |
| | | <!-- 已到账 --> |
| | |
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE"/> |
| | | <if test="state != null and state == 1"> |
| | | <!-- 未到账 --> |
| | | AND (v2.hb_state = 1 or v2.hb_state = 2) |
| | | AND (v2.hb_state = 1 or v2.hb_state = 2 or v2.hb_state =5) |
| | | </if> |
| | | <if test="state != null and state == 2"> |
| | | <!-- 已到账 --> |
| | |
| | | <include refid="Hongbao_Column_List"/> |
| | | FROM yeshi_ec_hongbao_v2 v2 WHERE v2.`hb_uid`=${uid} |
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE"/> |
| | | AND (v2.hb_state = 1 or v2.hb_state = 2 or v2.hb_state = 3) ) hb ON |
| | | AND (v2.hb_state = 1 or v2.hb_state = 2 or v2.hb_state = 5 or v2.hb_state = 3) ) hb ON |
| | | IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` LEFT JOIN |
| | | yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` WHERE hb.hb_id |
| | | IS NOT NULL |
| | |
| | | <include refid="Hongbao_Column_List"/> |
| | | FROM yeshi_ec_hongbao_v2 v2 WHERE v2.`hb_uid`=${uid} |
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE"/> |
| | | AND (v2.hb_state = 1 or v2.hb_state = 2 or v2.hb_state = 3) ) hb ON |
| | | AND (v2.hb_state = 1 or v2.hb_state = 2 or v2.hb_state = 5 or v2.hb_state = 3) ) hb ON |
| | | IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` LEFT JOIN |
| | | yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` WHERE hb.hb_id |
| | | IS NOT NULL |
| | |
| | | <sql id="SELECT_HONGBAO_STATE"> |
| | | <if test="state != null and state == 1"> |
| | | <!-- 未到账 --> |
| | | AND (v2.hb_state = 1 or v2.hb_state = 2) |
| | | AND (v2.hb_state = 1 or v2.hb_state = 2 or v2.hb_state = 5) |
| | | </if> |
| | | <if test="state != null and state == 2"> |
| | | <!-- 已到账 --> |
| | |
| | | ORDER BY d.co_third_create_time |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | |
| | | <select id="listByGoodsIdAndUidAndMinThirdCreateTime" resultMap="BaseResultMap"> |
| | | SELECT * FROM `yeshi_ec_common_order` d |
| | | WHERE d.co_uid = #{uid} and d.co_order_goods_id=#{goodsId} |
| | | |
| | | <if test="minThirdCreateTime!=null"> |
| | | and d.co_third_create_time>=#{minThirdCreateTime} |
| | | </if> |
| | | |
| | | limit #{start},#{count} |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | object.put("code", 0);
|
| | | object.put("data", result);
|
| | | return object.toString();
|
| | |
|
| | | }
|
| | |
|
| | | public static String loadFalseResult(String error) {
|