Merge remote-tracking branch 'origin/div' into div
Conflicts:
fanli/src/main/java/com/yeshi/fanli/util/SpringContext.java
| | |
| | | <attribute name="maven.pomderived" value="true"/>
|
| | | </attributes>
|
| | | </classpathentry>
|
| | | <classpathentry kind="lib" path="libs/opush-server-sdk-1.0.3.jar"/>
|
| | | <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.8.0_131"/>
|
| | | <classpathentry kind="output" path="target/classes"/>
|
| | | </classpath>
|
New file |
| | |
| | | package com.yeshi.fanli.aspect;
|
| | |
|
| | | import java.lang.reflect.Method;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.aspectj.lang.ProceedingJoinPoint;
|
| | | import org.aspectj.lang.Signature;
|
| | | import org.aspectj.lang.annotation.Around;
|
| | | import org.aspectj.lang.annotation.Aspect;
|
| | | import org.aspectj.lang.reflect.MethodSignature;
|
| | | import org.springframework.core.DefaultParameterNameDiscoverer;
|
| | | import org.springframework.expression.EvaluationContext;
|
| | | import org.springframework.expression.Expression;
|
| | | import org.springframework.expression.ExpressionParser;
|
| | | import org.springframework.expression.spel.standard.SpelExpressionParser;
|
| | | import org.springframework.expression.spel.support.StandardEvaluationContext;
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestSerializableByKeyService;
|
| | |
|
| | | import redis.clients.jedis.Jedis;
|
| | | import redis.clients.jedis.JedisPool;
|
| | |
|
| | | @Component
|
| | | @Aspect
|
| | | public class RequestSerializableServiceAspect {
|
| | |
|
| | | @Resource
|
| | | private JedisPool jedisPool;
|
| | |
|
| | | private ExpressionParser parser = new SpelExpressionParser();
|
| | |
|
| | | private DefaultParameterNameDiscoverer nameDiscoverer = new DefaultParameterNameDiscoverer();
|
| | |
|
| | | public String generateKeyBySpEL(String spELString, ProceedingJoinPoint joinPoint) {
|
| | | MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
|
| | | String[] paramNames = nameDiscoverer.getParameterNames(methodSignature.getMethod());
|
| | | Expression expression = parser.parseExpression(spELString);
|
| | | EvaluationContext context = new StandardEvaluationContext();
|
| | | Object[] args = joinPoint.getArgs();
|
| | | for (int i = 0; i < args.length; i++) {
|
| | | context.setVariable(paramNames[i], args[i]);
|
| | | }
|
| | | return expression.getValue(context).toString();
|
| | | }
|
| | |
|
| | | @Around("execution(public * com.yeshi.fanli.service.impl..*.*(..))")
|
| | | public Object requestSerializable(ProceedingJoinPoint joinPoint) throws Throwable {
|
| | | Signature signature = joinPoint.getSignature();
|
| | | MethodSignature methodSignature = (MethodSignature) signature;
|
| | | Method targetMethod = methodSignature.getMethod();
|
| | | String cacheKey = null;
|
| | | try {
|
| | | Method realMethod = joinPoint.getTarget().getClass().getDeclaredMethod(joinPoint.getSignature().getName(),
|
| | | targetMethod.getParameterTypes());
|
| | | if (realMethod.isAnnotationPresent(RequestSerializableByKeyService.class)) {
|
| | | RequestSerializableByKeyService rs = realMethod.getAnnotation(RequestSerializableByKeyService.class);
|
| | | String key = rs.key();
|
| | | cacheKey = generateKeyBySpEL(key, joinPoint);
|
| | | try {// redis做原子性保护
|
| | | if (!StringUtil.isNullOrEmpty(cacheKey)) {
|
| | | cacheKey = joinPoint.getTarget().getClass().getName() + "." + targetMethod.getName() + "-"
|
| | | + cacheKey;
|
| | | cacheKey = "service-" + StringUtil.Md5(cacheKey);
|
| | | // jiedis原子性做拦截
|
| | | Jedis jedis = jedisPool.getResource();
|
| | | try {
|
| | | Constant.waitingThreadSet.add(Thread.currentThread().getId());
|
| | | long result = 0;
|
| | | long startTime = System.currentTimeMillis();
|
| | | // 等待响应
|
| | | while (result <= 0) {
|
| | | result = jedis.setnx(cacheKey, "1");
|
| | | if (result <= 0) {
|
| | | try {
|
| | | System.out.println("__________已有线程在执行");
|
| | | Thread.sleep(50);
|
| | | } catch (InterruptedException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | if (System.currentTimeMillis() - startTime > 1000 * 60L) {
|
| | | Constant.waitingThreadSet.remove(Thread.currentThread().getId());
|
| | | System.out.println("__________删除线程");
|
| | | return null;
|
| | | }
|
| | | } else {
|
| | | // 设置30秒处理时间
|
| | | jedis.expire(cacheKey, 30);
|
| | | }
|
| | | }
|
| | |
|
| | | if (result > 0) {
|
| | | try {
|
| | | System.out.println("__________放行执行");
|
| | | return joinPoint.proceed();
|
| | | } catch (Throwable e) {
|
| | | e.printStackTrace();
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } finally {
|
| | | jedis.del(cacheKey);
|
| | | Constant.waitingThreadSet.remove(Thread.currentThread().getId());
|
| | | }
|
| | | }
|
| | | } finally {
|
| | | jedisPool.returnResource(jedis);
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {// 原子性保护出错
|
| | | try {
|
| | | return joinPoint.proceed();
|
| | | } catch (Throwable e1) {
|
| | | e.printStackTrace();
|
| | | LogHelper.errorDetailInfo(e1);
|
| | | }
|
| | | }
|
| | | }
|
| | | } catch (NoSuchMethodException e) {
|
| | | e.printStackTrace();
|
| | | } catch (SecurityException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | return joinPoint.proceed();
|
| | | |
| | | }
|
| | |
|
| | | }
|
| | |
| | | import org.springframework.expression.spel.support.StandardEvaluationContext;
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.annotation.integral.IntegralGetFrequencyLimit;
|
| | |
|
| | |
| | | return expression.getValue(context).toString();
|
| | | }
|
| | |
|
| | | @Around("execution(public * com.yeshi.fanli.service.impl.integral.*.*(..))")
|
| | | @Around("execution(public * com.yeshi.fanli.service.impl.user.integral.*.*(..))")
|
| | | public Object requestSerializable(ProceedingJoinPoint joinPoint) throws Throwable {
|
| | | Signature signature = joinPoint.getSignature();
|
| | | MethodSignature methodSignature = (MethodSignature) signature;
|
| | |
| | | return expression.getValue(context).toString();
|
| | | }
|
| | |
|
| | | @Around("execution(public * com.yeshi.fanli.service.impl.integral.*.*(..))")
|
| | | @Around("execution(public * com.yeshi.fanli.service.impl.user.integral.*.*(..))")
|
| | | public Object requestSerializable(ProceedingJoinPoint joinPoint) throws Throwable {
|
| | | Signature signature = joinPoint.getSignature();
|
| | | MethodSignature methodSignature = (MethodSignature) signature;
|
| | |
| | |
|
| | | @RequestMapping(value = "tb")
|
| | | public void tb(String code, String state, HttpServletRequest request, HttpServletResponse response) {
|
| | |
|
| | | LogHelper.test("淘宝授权回调:" + code + ":" + state);
|
| | | if (StringUtil.isNullOrEmpty(code) || StringUtil.isNullOrEmpty(state)) {
|
| | | LogHelper.error("淘宝授权回调出错");
|
| | |
| | | }
|
| | | return;
|
| | | }
|
| | |
|
| | | try {
|
| | | String key = StringUtil.Md5("taobao-code-" + code);
|
| | | if (!StringUtil.isNullOrEmpty(redisManager.getCommonString(key)))
|
| | |
| | | } catch (Exception e) {
|
| | |
|
| | | }
|
| | | LogHelper.userErrorInfo("淘宝授权回调state:"+state);
|
| | | String stateStr = AESUtil.decrypt(state, Constant.UIDAESKEY);
|
| | | LogHelper.userErrorInfo("淘宝授权回调解密:"+stateStr);
|
| | | |
| | |
|
| | | String stateStr = null;
|
| | | Long time = null;
|
| | | Long uid = null;
|
| | | String source = null;
|
| | | try {
|
| | | stateStr = AESUtil.decrypt(state, Constant.UIDAESKEY);
|
| | | JSONObject json = JSONObject.fromObject(stateStr);
|
| | | time = json.optLong("t");
|
| | | uid = json.optLong("u");
|
| | | source = json.optString("s");
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | state = URLDecoder.decode(state, "UTF-8");
|
| | | } catch (UnsupportedEncodingException e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | stateStr = AESUtil.decrypt(state, Constant.UIDAESKEY);
|
| | | JSONObject json = JSONObject.fromObject(stateStr);
|
| | | time = json.optLong("t");
|
| | | uid = json.optLong("u");
|
| | | source = json.optString("s");
|
| | | }
|
| | |
|
| | | LogHelper.userErrorInfo("淘宝授权回调state:" + state);
|
| | |
|
| | | LogHelper.userErrorInfo("淘宝授权回调解密:" + stateStr);
|
| | |
|
| | | int errCode = 0;
|
| | | if (StringUtil.isNullOrEmpty(stateStr)) {
|
| | | // 解密错误
|
| | | errCode = 1;
|
| | | }
|
| | | JSONObject json = JSONObject.fromObject(stateStr);
|
| | | Long time = json.optLong("t");
|
| | | Long uid = json.optLong("u");
|
| | | String source = json.optString("s");
|
| | |
|
| | | if (System.currentTimeMillis() - time > 1000 * 60 * 10L) {
|
| | | // 过时
|
| | | errCode = 2;
|
| | |
| | |
|
| | | final String relationId2 = relationId;
|
| | | // 异步申请会员ID
|
| | | final Long fuid=uid;
|
| | | ThreadUtil.run(new Runnable() {
|
| | |
|
| | | @Override
|
| | |
| | | }
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(specialId))
|
| | | LogHelper.test(uid + "会员备案失败");
|
| | | LogHelper.test(fuid + "会员备案失败");
|
| | | try {
|
| | | userExtraTaoBaoInfoService.addSpecialId(uid, specialId, taoBaoUid, name, true);
|
| | | userExtraTaoBaoInfoService.addSpecialId(fuid, specialId, taoBaoUid, name, true);
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(specialId) && !StringUtil.isNullOrEmpty(relationId2))
|
| | | userInfoModifyRecordService.addModifyRecord(uid, ModifyTypeEnum.bindTaoBao, taoBaoUid);
|
| | | userInfoModifyRecordService.addModifyRecord(fuid, ModifyTypeEnum.bindTaoBao, taoBaoUid);
|
| | | } catch (UserExtraTaoBaoInfoException e) {
|
| | | LogHelper.test(e.getMsg());
|
| | | }
|
| | |
| | | LogHelper.test(e.getMsg());
|
| | | errCode = 5;
|
| | | }
|
| | | final Long fuid=uid;
|
| | |
|
| | | final String specialId2 = specialId;
|
| | | // 异步申请渠道ID
|
| | |
| | | } catch (TaoBaoAuthException e1) {
|
| | | } // 渠道ID
|
| | | if (StringUtil.isNullOrEmpty(relationId))
|
| | | LogHelper.test(uid + "渠道备案失败");
|
| | | LogHelper.test(fuid + "渠道备案失败");
|
| | | try {
|
| | | userExtraTaoBaoInfoService.addRelationId(uid, relationId, taoBaoUid, name, true);
|
| | | userExtraTaoBaoInfoService.addRelationId(fuid, relationId, taoBaoUid, name, true);
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(specialId2) && !StringUtil.isNullOrEmpty(relationId))
|
| | | userInfoModifyRecordService.addModifyRecord(uid, ModifyTypeEnum.bindTaoBao, taoBaoUid);
|
| | | userInfoModifyRecordService.addModifyRecord(fuid, ModifyTypeEnum.bindTaoBao, taoBaoUid);
|
| | | } catch (UserExtraTaoBaoInfoException e) {
|
| | | LogHelper.test(e.getMsg());
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.dynamic.GoodsPicture;
|
| | | import com.yeshi.fanli.entity.dynamic.InviteMaterial;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.taobao.SearchFilter;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
|
| | | import com.yeshi.fanli.exception.ActivityException;
|
| | | import com.yeshi.fanli.exception.push.PushException;
|
| | | import com.yeshi.fanli.exception.share.UserShareGoodsRecordException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | |
| | | import com.yeshi.fanli.service.inter.dynamic.InviteMaterialService;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.user.integral.IntegralGetService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.FileUtil;
|
| | |
| | | import com.yeshi.fanli.util.db.MongoDBManager;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.util.jd.JDApiUtil;
|
| | | import com.yeshi.fanli.util.push.OPPOPushUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | |
| | |
|
| | | @Resource
|
| | | private JedisPool jedisPool;
|
| | | |
| | | @Resource
|
| | | private IntegralGetService integralGetService;
|
| | | |
| | |
|
| | | @RequestMapping(value = "testimg")
|
| | | public void testImg(HttpServletRequest request, PrintWriter out) {
|
| | |
| | | }
|
| | | out.println(array.toString());
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "pushOppo")
|
| | | public void pushOppo(String registerId, PrintWriter out) {
|
| | | List<String> registerIds = new ArrayList<>();
|
| | | registerIds.add(registerId);
|
| | | try {
|
| | | OPPOPushUtil.pushUrl(registerIds, "测试网页推送", "测试网页推送内容", "http://www.baidu.com");
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | try {
|
| | | OPPOPushUtil.pushGoods(registerIds, "测试商品网页推送", "测试商品推送内容", 1, 577628549116L);
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | try {
|
| | | OPPOPushUtil.pushUserSignInNotification(registerIds, "测试签到推送", "测试签到推送");
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | try {
|
| | | OPPOPushUtil.pushWelfareCenter(registerIds, "测试福利中心推送", "测试福利中心推送");
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | try {
|
| | | OPPOPushUtil.pushZNX(registerIds, "测试站内信推送", "测试站内信推送");
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | out.print("success");
|
| | | } |
| | |
|
| | | @RequestMapping(value = "testListTLJGoods")
|
| | | public void getGoodsList(String callback,PrintWriter out) {
|
| | | SearchFilter sf = new SearchFilter();
|
| | | sf.setMaterialId("19450");
|
| | | sf.setQuan(1);
|
| | | sf.setTmall(true);
|
| | | sf.setStartTkRate(5);
|
| | | sf.setEndPrice(new BigDecimal(1000));
|
| | | sf.setPage(1);
|
| | | sf.setPage(100);
|
| | | |
| | | TaoBaoSearchResult result = TaoKeApiUtil.searchWuLiao(sf);
|
| | | Gson gson = new Gson();
|
| | | JSONArray array=new JSONArray();
|
| | | for (TaoBaoGoodsBrief goods : result.getTaoBaoGoodsBriefs()) {
|
| | | array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(goods, "100", null)));
|
| | | }
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(array)));
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 插入邀请素材
|
| | | * |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "addInviteOrderLevelOne")
|
| | | public void addInviteOrderLevelOne(PrintWriter out) {
|
| | | try {
|
| | | System.out.println("-------------请求---------------");
|
| | | integralGetService.addShareSingleGoods(974767L);
|
| | | JsonUtil.printMode(out, null, JsonUtil.loadTrueResult("操作成功"));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, null, JsonUtil.loadFalseResult("操作失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | |
| | | platformType = 2;
|
| | | }
|
| | | userSystemCouponService.copyLotteryPrize(uuser.getId(), platformType, acceptData.getDevice());
|
| | | // 绑定oppo推送
|
| | | DeviceActive active = deviceActiveService.getFirstActiveInfo(acceptData.getDevice());
|
| | | if (active != null) {
|
| | | deviceTokenOPPOService.bindUid(uuser.getId(), active.getId());
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | // 绑定oppo推送
|
| | | DeviceActive active = deviceActiveService.getFirstActiveInfo(acceptData.getDevice());
|
| | | if (active != null) {
|
| | | deviceTokenOPPOService.bindUid(uuser.getId(), active.getId());
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | |
| | | } else if (etype == 3) {
|
| | | out.print(JsonUtil.loadFalseResult("提现金额大于我的红包"));
|
| | | } else if (etype == 111) {
|
| | | out.print(JsonUtil.loadFalseResult("更换了手机号后7天内不允许提现"));
|
| | | out.print(JsonUtil.loadFalseResult("修改手机号后,7天内无法提现"));
|
| | | } else if (etype == 110) {
|
| | | out.print(JsonUtil.loadFalseResult("有维权订单尚未扣款"));
|
| | | }
|
| | |
| | | import java.io.PrintWriter;
|
| | | import java.math.BigDecimal;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Arrays;
|
| | | import java.util.Calendar;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
| | |
|
| | | import com.yeshi.fanli.entity.AppVersionInfo;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.LostOrder;
|
| | | import com.yeshi.fanli.entity.bus.user.Order;
|
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | |
| | | import com.yeshi.fanli.util.CMQManager;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.vo.order.CommonOrderVO;
|
| | |
| | | */
|
| | | @RequestMapping(value = "getorder", method = RequestMethod.POST)
|
| | | public void getOrder(AcceptData acceptData, Integer page, Long uid, Integer state,
|
| | | @RequestParam(name = "type",required = false) String type1, Integer orderState, String orderNo, String startTime, String endTime,
|
| | | Integer slotTime, Boolean needCount, Integer dateType, Integer goodsType, PrintWriter out) {
|
| | | @RequestParam(name = "type", required = false) String type1, Integer orderState, String orderNo,
|
| | | String startTime, String endTime, Integer slotTime, Boolean needCount, Integer dateType, Integer goodsType,
|
| | | PrintWriter out) {
|
| | | Integer type = null;
|
| | | |
| | |
|
| | | if (StringUtil.isNullOrEmpty(type1)) {
|
| | | type = null;
|
| | | } else {
|
| | | type = Integer.parseInt(type1);
|
| | | }
|
| | | |
| | |
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | if (needCount == null)
|
| | | needCount = false;
|
| | |
|
| | |
| | | orderState = 2; // 已维权
|
| | | state = null; // 清空
|
| | | }
|
| | | |
| | |
|
| | | if (type != null && type == 0) {
|
| | | type = null; // 所有类型订单
|
| | | }
|
| | | |
| | |
|
| | | Integer tempState = state;
|
| | | // 转换状态
|
| | | if (state != null && orderState != null && (orderState == 2|| orderState == 3)) {
|
| | | if (state != null && orderState != null && (orderState == 2 || orderState == 3)) {
|
| | | state = null; // 清空
|
| | | }
|
| | | |
| | |
|
| | | if (!VersionUtil.greaterThan_1_6_0(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | goodsType = Constant.SOURCE_TYPE_TAOBAO;
|
| | | } else if (goodsType != null && goodsType == 0){
|
| | | } else if (goodsType != null && goodsType == 0) {
|
| | | goodsType = null; // 所有平台订单
|
| | | }
|
| | |
|
| | |
| | | BigDecimal todayMoney = null;
|
| | |
|
| | | // 查询列表
|
| | | List<CommonOrderVO> list = commonOrderService.getOrderByUid(acceptData, page, uid, state, type, orderState, orderNo,
|
| | | startTime, endTime, dateType, goodsType);
|
| | | List<CommonOrderVO> list = commonOrderService.getOrderByUid(acceptData, page, uid, state, type, orderState,
|
| | | orderNo, startTime, endTime, dateType, goodsType);
|
| | |
|
| | | if (list != null && list.size() > 0) {
|
| | | // 统计总数
|
| | |
| | | // 需要统计筛选信息 :未失效的总金额 以及订单
|
| | | if (needCount && page == 1) {
|
| | |
|
| | | todayMoney = commonOrderService.countBonusOrderMoney(uid, type, dateType, startTime, endTime, goodsType);
|
| | | todayMoney = commonOrderService.countBonusOrderMoney(uid, type, dateType, startTime, endTime,
|
| | | goodsType);
|
| | |
|
| | | todayTotal = commonOrderService.countBonusOrderNumber(uid, type, dateType, startTime, endTime, goodsType);
|
| | | todayTotal = commonOrderService.countBonusOrderNumber(uid, type, dateType, startTime, endTime,
|
| | | goodsType);
|
| | |
|
| | | // 有效订单
|
| | | totalValid = commonOrderService.countUserOrderToApp(uid, type, startTime,
|
| | | endTime, dateType, goodsType, tempState, 1);
|
| | | |
| | | totalValid = commonOrderService.countUserOrderToApp(uid, type, startTime, endTime, dateType, goodsType,
|
| | | tempState, 1);
|
| | |
|
| | | // 维权订单
|
| | | totalProces = commonOrderService.countUserOrderToApp(uid, type, startTime,
|
| | | endTime, dateType, goodsType, null, 2);
|
| | | |
| | | totalProces = commonOrderService.countUserOrderToApp(uid, type, startTime, endTime, dateType, goodsType,
|
| | | null, 2);
|
| | |
|
| | | // 失效订单
|
| | | totalInvite = commonOrderService.countUserOrderToApp(uid, type, startTime,
|
| | | endTime, dateType, goodsType, null, 3);
|
| | | totalInvite = commonOrderService.countUserOrderToApp(uid, type, startTime, endTime, dateType, goodsType,
|
| | | null, 3);
|
| | | }
|
| | |
|
| | | if (todayMoney == null) {
|
| | |
| | | Integer goodsType = null; // 版本区分
|
| | | if (!VersionUtil.greaterThan_1_6_0(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | goodsType = Constant.SOURCE_TYPE_TAOBAO;
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | /* 总订单统计 */
|
| | | Map<String, BigDecimal> countOrder = commonOrderService.countHistoryOrder(uid, null, goodsType);
|
| | | int self = 0;
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 统计各个平台数据
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param goodsType
|
| | |
| | | out.print(JsonUtil.loadFalseResult(1, "平台类型缺失或不正确"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | /* 今日订单统计 */
|
| | | Map<String, BigDecimal> countToday = commonOrderService.countHistoryOrder(uid, 1, goodsType);
|
| | |
|
| | |
| | | data.put("yesterday", yesterdaydata);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 统计奖金
|
| | | *
|
| | |
| | | */
|
| | | @RequestMapping(value = "countBonus", method = RequestMethod.POST)
|
| | | public void countBonus(AcceptData acceptData, Long uid, Integer dateType, PrintWriter out) {
|
| | |
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | try {
|
| | | long nowTime = System.currentTimeMillis();
|
| | | long recievedTime = TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(nowTime, "yyyy-MM") + "-25 10",
|
| | | "yyyy-MM-dd HH");
|
| | |
|
| | | try {
|
| | | Object shareCount = 0;
|
| | | BigDecimal sharemoney = new BigDecimal(0.00);
|
| | | Object inviteCount = 0;
|
| | | BigDecimal inviteMoney = new BigDecimal(0.00);
|
| | | |
| | | Integer goodsType = null; // 版本区分
|
| | | if (!VersionUtil.greaterThan_1_6_0(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | goodsType = Constant.SOURCE_TYPE_TAOBAO;
|
| | | } |
| | |
|
| | | Map<String, Object> shareMap = commonOrderService.countBonusOrderMoneyAndNumber(uid, 2, dateType, null,
|
| | | null, goodsType);
|
| | | if (shareMap != null) {
|
| | | Object totalNum = shareMap.get("totalNum");
|
| | | if (totalNum != null) {
|
| | | shareCount = totalNum;
|
| | | if (nowTime > recievedTime && dateType == 4) {// 实际到账
|
| | | List<Integer> inviteTypes = new ArrayList<>();
|
| | | inviteTypes.add(HongBaoV2.TYPE_YIJI);
|
| | | inviteTypes.add(HongBaoV2.TYPE_ERJI);
|
| | | inviteTypes.add(HongBaoV2.TYPE_SHARE_YIJI);
|
| | | inviteTypes.add(HongBaoV2.TYPE_SHARE_ERJI);
|
| | |
|
| | | List<Integer> shareTypes = new ArrayList<>();
|
| | | shareTypes.add(HongBaoV2.TYPE_SHARE_GOODS);
|
| | |
|
| | | Date minGetTime = new Date(
|
| | | TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(nowTime, "yyyy-MM") + "-25", "yyyy-MM-dd"));
|
| | |
|
| | | Date maxGetTime = new Date(nowTime);
|
| | | inviteMoney = hongBaoV2CountService.sumAlreadyGetMoneyByUid(uid, inviteTypes, minGetTime, maxGetTime);
|
| | | inviteCount = hongBaoV2CountService.countAlreadyGetMoneyByUid(uid, inviteTypes, minGetTime, maxGetTime);
|
| | | |
| | | sharemoney = hongBaoV2CountService.sumAlreadyGetMoneyByUid(uid, shareTypes, minGetTime, maxGetTime);
|
| | | shareCount = hongBaoV2CountService.countAlreadyGetMoneyByUid(uid, shareTypes, minGetTime, maxGetTime);
|
| | |
|
| | | } else {// 预估到账
|
| | | Integer goodsType = null; // 版本区分
|
| | | if (!VersionUtil.greaterThan_1_6_0(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | goodsType = Constant.SOURCE_TYPE_TAOBAO;
|
| | | }
|
| | | Map<String, Object> shareMap = commonOrderService.countBonusOrderMoneyAndNumber(uid, 2, dateType, null,
|
| | | null, goodsType);
|
| | | if (shareMap != null) {
|
| | | Object totalNum = shareMap.get("totalNum");
|
| | | if (totalNum != null) {
|
| | | shareCount = totalNum;
|
| | | }
|
| | |
|
| | | Object totalmoney = shareMap.get("totalmoney");
|
| | | if (totalmoney != null) {
|
| | | sharemoney = (BigDecimal) totalmoney;
|
| | | }
|
| | | }
|
| | |
|
| | | Object totalmoney = shareMap.get("totalmoney");
|
| | | if (totalmoney != null) {
|
| | | sharemoney = (BigDecimal) totalmoney;
|
| | | }
|
| | | }
|
| | | // 邀请统计
|
| | |
|
| | | // 邀请统计
|
| | | Map<String, Object> inviteMap = commonOrderService.countBonusOrderMoneyAndNumber(uid, 3, dateType, null,
|
| | | null, goodsType);
|
| | | if (inviteMap != null) {
|
| | | Object totalNum = inviteMap.get("totalNum");
|
| | | if (totalNum != null) {
|
| | | inviteCount = totalNum;
|
| | | }
|
| | | Map<String, Object> inviteMap = commonOrderService.countBonusOrderMoneyAndNumber(uid, 3, dateType, null,
|
| | | null, goodsType);
|
| | | if (inviteMap != null) {
|
| | | Object totalNum = inviteMap.get("totalNum");
|
| | | if (totalNum != null) {
|
| | | inviteCount = totalNum;
|
| | | }
|
| | |
|
| | | Object totalmoney = inviteMap.get("totalmoney");
|
| | | if (totalmoney != null) {
|
| | | inviteMoney = (BigDecimal) totalmoney;
|
| | | Object totalmoney = inviteMap.get("totalmoney");
|
| | | if (totalmoney != null) {
|
| | | inviteMoney = (BigDecimal) totalmoney;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | import com.google.gson.JsonSerializationContext;
|
| | | import com.google.gson.JsonSerializer;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.Special;
|
| | | import com.yeshi.fanli.entity.dynamic.DynamicInfo;
|
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.dynamic.DynamicInfoService;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialService;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.taobao.DaTaoKeUtil;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | | @Resource
|
| | | private DynamicInfoService dynamicInfoService;
|
| | |
|
| | | @Resource
|
| | | private SpecialService specialService;
|
| | | |
| | |
|
| | | /**
|
| | | * 动态商品列表
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (cid != null && cid == 5) {
|
| | | // 活动主题
|
| | | getSpecialList(acceptData, page, subId, out);
|
| | | return;
|
| | | }
|
| | | |
| | | |
| | | long count = 0;
|
| | |
|
| | | int platform = 1;
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform())) {
|
| | | platform = 2;
|
| | | }
|
| | | |
| | | int version = Integer.parseInt(acceptData.getVersion());
|
| | | List<DynamicInfo> list = dynamicInfoService.queryV2(platform, version, (page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, cid,
|
| | | subId);
|
| | |
| | | data.put("list", getGson().toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 活动列表
|
| | | * @param acceptData
|
| | | * @param out
|
| | | */
|
| | | private void getSpecialList(AcceptData acceptData, Integer page, Long subId, PrintWriter out) {
|
| | | if (subId == null) {
|
| | | out.print(JsonUtil.loadFalseResult("分类id不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | | // 平台区分
|
| | | int platformCode = Constant.getPlatformCode(acceptData.getPlatform());
|
| | | List<String> listKey = new ArrayList<String>();
|
| | | |
| | | if (subId == 1) { // 淘宝
|
| | | listKey.add("special_channel_tb");
|
| | | } else if (subId == 2) { // 京东
|
| | | listKey.add("special_channel_jd");
|
| | | } else if (subId == 3) { // 拼多多
|
| | | listKey.add("special_channel_pdd");
|
| | | } else { // 全部
|
| | | listKey.add("special_channel_tb");
|
| | | listKey.add("special_channel_jd");
|
| | | listKey.add("special_channel_pdd");
|
| | | }
|
| | | |
| | | List<Special> list = specialService.listByPlaceKeyList((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, listKey, platformCode,
|
| | | Integer.parseInt(acceptData.getVersion()));
|
| | | |
| | | long time = System.currentTimeMillis();
|
| | | |
| | | // 删除尚未启用的过期的
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | Special special = list.get(i);
|
| | | if (special.getState() == 1L) {
|
| | | list.remove(i--);
|
| | | } else {
|
| | | if (special.getStartTime() != null && special.getEndTime() != null)
|
| | | special.setTimeTask(true);
|
| | | else
|
| | | special.setTimeTask(false);
|
| | | |
| | | if (special.isTimeTask()) {
|
| | | if (time < special.getStartTime().getTime() || time > special.getEndTime().getTime()) {
|
| | | list.remove(i--);
|
| | | } else// 设置倒计时
|
| | | {
|
| | | special.setCountDownTime((special.getEndTime().getTime() - time) / 1000);
|
| | | }
|
| | | }
|
| | | |
| | | if (Constant.IS_TEST) {// 测试标签
|
| | | List<ClientTextStyleVO> labels = new ArrayList<>();
|
| | | labels.add(new ClientTextStyleVO("文章标签", "#FE0014"));
|
| | | labels.add(new ClientTextStyleVO("标签内容", "#FE0014"));
|
| | | special.setLabels(labels);
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | long count = specialService.countByPlaceKeyList( listKey, platformCode, Integer.parseInt(acceptData.getVersion()));
|
| | |
|
| | | GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
|
| | | Gson gson = gsonBuilder.create();
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", count);
|
| | | data.put("list", gson.toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | |
| | | |
| | | |
| | | /**
|
| | | * 查询顶部分类
|
| | | * |
| | | * @param acceptData
|
| | | * @param page
|
| | | * @param cid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getClass", method = RequestMethod.POST)
|
| | | public void getClass(AcceptData acceptData, Integer cid, PrintWriter out) {
|
| | | // ios 只返回子集分类
|
| | | if (cid != null) {
|
| | | List<GoodsClass> list = new ArrayList<GoodsClass>();
|
| | |
|
| | | switch (cid) {
|
| | | case 1:
|
| | | list.add(new GoodsClass(0L, "今日单品"));
|
| | | list.addAll(DaTaoKeUtil.goodsClasses);
|
| | | break;
|
| | | case 2:
|
| | | break;
|
| | | case 3:
|
| | | break;
|
| | | case 4:
|
| | | break;
|
| | | case 5:
|
| | | break;
|
| | | default:
|
| | | break;
|
| | | }
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("list", JsonUtil.getApiCommonGson().toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | return;
|
| | | }
|
| | |
|
| | | // Android 返回分类以及顶部数据
|
| | | List<GoodsClass> listSub = new ArrayList<GoodsClass>();
|
| | | listSub.add(new GoodsClass(0L, "今日单品"));
|
| | | listSub.addAll(DaTaoKeUtil.goodsClasses);
|
| | | |
| | | GoodsClass menu1 = new GoodsClass(1L, "热销");
|
| | | menu1.setListSub(listSub);
|
| | | |
| | | GoodsClass menu2 = new GoodsClass(2L, "推荐");
|
| | | menu2.setListSub(new ArrayList<GoodsClass>());
|
| | | |
| | | GoodsClass menu3 = new GoodsClass(3L, "好店");
|
| | | menu3.setListSub(new ArrayList<GoodsClass>());
|
| | | |
| | | GoodsClass menu4 = new GoodsClass(4L, "邀请");
|
| | | menu4.setListSub(new ArrayList<GoodsClass>());
|
| | | |
| | | GoodsClass menu5 = new GoodsClass(5L, "活动");
|
| | | List<GoodsClass> sub5 = new ArrayList<GoodsClass>();
|
| | | sub5.add(new GoodsClass(0L, "全部"));
|
| | | sub5.add(new GoodsClass(1L, "淘宝"));
|
| | | sub5.add(new GoodsClass(2L, "京东"));
|
| | | sub5.add(new GoodsClass(3L, "拼多多"));
|
| | | menu5.setListSub(sub5);
|
| | | |
| | | List<GoodsClass> list = new ArrayList<GoodsClass>();
|
| | | list.add(menu1);
|
| | | list.add(menu5);
|
| | | list.add(menu2);
|
| | | list.add(menu3);
|
| | | list.add(menu4);
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("list", JsonUtil.getApiCommonGson().toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | | import com.yeshi.fanli.service.inter.goods.recommend.HomeRecommendGoodsService;
|
| | | import com.yeshi.fanli.service.inter.goods.recommend.RecommendGoodsDeleteHistoryService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.DeviceSexService;
|
| | |
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsService daTaoKeGoodsService;
|
| | | |
| | | @Resource
|
| | | private HongBaoV2CountService hongBaoV2CountService;
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 新版推荐专题管理(1.5.3)
|
| | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 获取专题渠道活动
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param callback
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getGuide")
|
| | | public void getGuide(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | String tips = null;
|
| | | if (uid == null || uid <= 0) {
|
| | | tips = configService.get("tip_guide_new_user");
|
| | | } else {
|
| | | long rebateOrder = hongBaoV2CountService.countRebateOrder(uid);
|
| | | long shareOrInviteOrder = hongBaoV2CountService.countShareOrInviteOrder(uid);
|
| | | if (rebateOrder <= 0 && shareOrInviteOrder <= 0) {
|
| | | // 新人版
|
| | | tips = configService.get("tip_guide_new_user");
|
| | | } else if (rebateOrder > 0 && shareOrInviteOrder <= 0) {
|
| | | // 省钱版
|
| | | tips = configService.get("tip_guide_save_money");
|
| | | } else if (shareOrInviteOrder > 0) {
|
| | | // 赚钱版
|
| | | tips = configService.get("tip_guide_share_invite");
|
| | | } else {
|
| | | // 熟客版
|
| | | }
|
| | | }
|
| | | |
| | | if (StringUtil.isNullOrEmpty(tips)) {
|
| | | out.print(JsonUtil.loadFalseResult("暂无提示"));
|
| | | return;
|
| | | }
|
| | | |
| | | JSONObject data = JSONObject.fromObject(tips);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.util.taobao.SearchFilterUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.vo.brand.BrandInfoVO;
|
| | | import com.yeshi.fanli.vo.brand.TaoBaoShopVO;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | | import com.yeshi.fanli.vo.msg.TokenVO;
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (analysisTaoToken(text, out)) {
|
| | | if (analysisTaoToken(acceptData, text, out)) {
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | int type = 3;
|
| | | CommonGoods commonGoods = null;
|
| | | text = matcher.group();
|
| | |
|
| | |
| | | }
|
| | | tb = TaoBaoUtil.isAlimama(id);
|
| | | if (tb == null) {
|
| | | tb = TaoBaoUtil.parsePhoneTmAndTb(id);
|
| | | type = 4;
|
| | | tb = TaoBaoUtil.getTmallGoodsInfo(id);
|
| | | }
|
| | | } else if (text.contains("http://zmnxbc.com")) { // 手机端天猫APP分享
|
| | | tb = TaoBaoUtil.parsePhoneShareUrlByTM(text);
|
| | |
| | | id = map.get("id").replace("}", "");
|
| | | tb = TaoBaoUtil.isAlimama(id);
|
| | | if (tb == null) {
|
| | | tb = TaoBaoUtil.parsePhoneTmAndTb(id);
|
| | | type = 4;
|
| | | tb = TaoBaoUtil.getTmallGoodsInfo(id);
|
| | | }
|
| | | } else {
|
| | | tb = TaoBaoUtil.parsePhoneShareUrlByTB(text);
|
| | |
| | | String jdId = JDUtil.getJDGoodsId(text);
|
| | | if (!StringUtil.isNullOrEmpty(jdId)) {
|
| | | JDGoods goods = JDApiUtil.getGoodsDetail(Long.parseLong(jdId));
|
| | | if (goods != null)
|
| | | if (goods != null) {
|
| | | commonGoods = CommonGoodsFactory.create(goods);
|
| | | } else {
|
| | | type = 4;
|
| | | goods = JDUtil.getSimpleGoodsInfo(jdId);
|
| | | if (goods != null) {
|
| | | commonGoods = new CommonGoods();
|
| | | commonGoods.setTitle(goods.getSkuName());
|
| | | commonGoods.setPicture(goods.getPicUrl());
|
| | | }
|
| | | }
|
| | | } else {
|
| | | String pddId = PinDuoDuoUtil.getPDDGoodsId(text);
|
| | | if (!StringUtil.isNullOrEmpty(pddId)) {
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | if (tb == null && commonGoods == null) {
|
| | | out.println(JsonUtil.loadFalseResult("暂未找到该商品,请稍后再试!"));
|
| | | return;
|
| | | }
|
| | |
|
| | | |
| | | if (type == 4) {
|
| | | if (!VersionUtil.greaterThan_2_0_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | out.println(JsonUtil.loadFalseResult("暂未找到该商品,请稍后再试!"));
|
| | | return;
|
| | | } |
| | | |
| | | JSONObject data = new JSONObject();
|
| | | if (tb != null) {
|
| | | commonGoods = new CommonGoods();
|
| | | commonGoods.setTitle(tb.getTitle());
|
| | | commonGoods.setPicture(tb.getPictUrl());
|
| | | }
|
| | | |
| | | if (StringUtil.isNullOrEmpty(commonGoods.getTitle()) || StringUtil.isNullOrEmpty(commonGoods.getPicture())) {
|
| | | out.println(JsonUtil.loadFalseResult("暂未找到该商品,请稍后再试!"));
|
| | | return;
|
| | | }
|
| | | |
| | | JSONObject goodsJSON = new JSONObject();
|
| | | goodsJSON.put("title", commonGoods.getTitle());
|
| | | goodsJSON.put("pictUrl", commonGoods.getPicture());
|
| | | |
| | | data.put("type", type);
|
| | | data.put("desc", "该商品无推广信息");
|
| | | data.put("goods", goodsJSON);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | return;
|
| | | } |
| | | |
| | | |
| | | JSONObject data = new JSONObject();
|
| | |
|
| | | if (VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | if (tb != null) {
|
| | | TaoBaoGoodsBrief goodsBrief = null;
|
| | |
| | | }
|
| | | commonGoods = CommonGoodsFactory.create(goodsBrief);
|
| | | }
|
| | | |
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | data.put("type", 3);
|
| | | data.put("type", type);
|
| | | data.put("goods",
|
| | | gson.toJson(GoodsDetailVOFactory.convertCommonGoods(commonGoods, null, fanLiRate, shareRate)));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
| | | out.print(JsonUtil.loadTrueResult(root));
|
| | | }
|
| | |
|
| | | private boolean analysisTaoToken(String text, PrintWriter out) {
|
| | | private boolean analysisTaoToken(AcceptData acceptData, String text, PrintWriter out) {
|
| | | String token = StringUtil.picUpTaoToken(text);
|
| | | if (!StringUtil.isNullOrEmpty(token)) {
|
| | | Long auctionId = TaoKeApiUtil.tokenConvertAuctionId(token);
|
| | |
| | | }
|
| | |
|
| | | if (tb != null) {
|
| | | if (VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | TaoBaoGoodsBrief goodsBrief = null;
|
| | | try {
|
| | | goodsBrief = TaoKeApiUtil.searchGoodsDetail(tb.getAuctionId());
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | |
| | | if (goodsBrief == null) {
|
| | | out.println(JsonUtil.loadFalseResult("暂未找到该商品,请稍后再试!"));
|
| | | return false;
|
| | | }
|
| | | |
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("type", 3);
|
| | | data.put("goods", gson.toJson(GoodsDetailVOFactory.convertTaoBao(goodsBrief, null, fanLiRate, shareRate)));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | return true;
|
| | | }
|
| | | |
| | | |
| | | JSONObject data = new JSONObject();
|
| | | JSONObject taoBaoGoodsJSON = new JSONObject();
|
| | | taoBaoGoodsJSON.put("title", tb.getTitle());
|
| | |
| | |
|
| | | /*--------- 京东商品 -------*/
|
| | | if (goodsType.intValue() == Constant.SOURCE_TYPE_JD) {
|
| | | searchJDGoods(searchkey, page, filter, order, out);
|
| | | searchJDGoods(acceptData, searchkey, page, filter, order, out);
|
| | | return;
|
| | | }
|
| | |
|
| | | /*-------- 拼多多商品 -------*/
|
| | | if (goodsType.intValue() == Constant.SOURCE_TYPE_PDD) {
|
| | | searchPDDGoods(searchkey, page, filter, order, out);
|
| | | searchPDDGoods(acceptData, searchkey, page, filter, order, out);
|
| | | return;
|
| | | }
|
| | |
|
| | | /*-------- 淘宝商品 -------*/
|
| | | searchTaoBaoGoods(searchkey, page, filter, order, out);
|
| | | searchTaoBaoGoods(acceptData, searchkey, page, filter, order, out);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | * @param endprice
|
| | | * @return
|
| | | */
|
| | | private void searchTaoBaoGoods(String key, Integer page, String filter, Integer order, PrintWriter out) {
|
| | | private void searchTaoBaoGoods(AcceptData acceptData, String key, Integer page, String filter, Integer order, PrintWriter out) {
|
| | | SearchFilter sf = new SearchFilter();
|
| | | sf.setKey(SearchFilterUtil.filterSearchContent(key));
|
| | | sf.setPage(page);
|
| | |
| | | data.put("result", gson.toJson(list));
|
| | | data.put("count", result.getTaoBaoHead().getDocsfound());
|
| | |
|
| | | if (page == 1) {
|
| | | // 第一页返回店铺信息
|
| | | if (page == 1) { // 第一页返回店铺信息
|
| | | List<TaoBaoShopVO> listShop = taoBaoShopService.getShopByKeyV2(key);
|
| | | if (listShop != null && listShop.size() > 0 && listShop.get(0).getListGoodsVO() != null
|
| | | && listShop.get(0).getListGoodsVO().size() > 2) {
|
| | | data.put("shop", JsonUtil.getApiCommonGson().toJson(listShop.get(0)));
|
| | | String platform = acceptData.getPlatform();
|
| | | TaoBaoShopVO taoBaoShop = listShop.get(0);
|
| | | if (("ios".equalsIgnoreCase(platform) && VersionUtil.greaterThan_2_0(platform, acceptData.getVersion()))
|
| | | || ("android".equalsIgnoreCase(platform) && VersionUtil.greaterThan_2_0_1(platform, acceptData.getVersion()))) {
|
| | | BrandInfoVO brandInfoVO = new BrandInfoVO();
|
| | | brandInfoVO.setId(taoBaoShop.getId());
|
| | | brandInfoVO.setName(taoBaoShop.getShopName());
|
| | | brandInfoVO.setIcon(taoBaoShop.getShopIcon());
|
| | | brandInfoVO.setListGoods(taoBaoShop.getListGoodsVO());
|
| | | data.put("shop", JsonUtil.getApiCommonGson().toJson(brandInfoVO));
|
| | | } else {
|
| | | data.put("shop", JsonUtil.getApiCommonGson().toJson(taoBaoShop));
|
| | | }
|
| | | }
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
| | | * @param endprice
|
| | | * @return
|
| | | */
|
| | | private void searchJDGoods(String key, Integer page, String filter, Integer order, PrintWriter out) {
|
| | | private void searchJDGoods(AcceptData acceptData, String key, Integer page, String filter, Integer order, PrintWriter out) {
|
| | |
|
| | | JDSearchResult result = null;
|
| | | boolean hasCoupon = false;
|
| | |
| | | * @param endprice
|
| | | * @return
|
| | | */
|
| | | private void searchPDDGoods(String key, Integer page, String filter, Integer order, PrintWriter out) {
|
| | | private void searchPDDGoods(AcceptData acceptData, String key, Integer page, String filter, Integer order, PrintWriter out) {
|
| | | PDDSearchFilter pddfilter = new PDDSearchFilter();
|
| | | pddfilter.setKw(SearchFilterUtil.filterSearchContent(key));
|
| | | pddfilter.setPage(page);
|
| | |
| | | import com.yeshi.fanli.exception.share.ShareGoodsException;
|
| | | import com.yeshi.fanli.exception.share.UserShareGoodsRecordException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.BusinessSystemService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemConfigService;
|
| | |
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.TBPidService;
|
| | | import com.yeshi.fanli.service.inter.user.UserShareGoodsGroupService;
|
| | | import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.util.AESUtil;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import com.yeshi.fanli.util.jd.JDApiUtil;
|
| | | import com.yeshi.fanli.util.jd.JDUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserShareGoodsGroupService userShareGoodsGroupService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserTaoLiJinRecordService userTaoLiJinRecordService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
|
| | |
|
| | | /**
|
| | | *
|
| | |
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("商品信息获取失败")));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | Long auctionId = record.getGoodsId();
|
| | | String tljLink = record.getSendUrl();
|
| | | BigDecimal tljMoney= record.getPerFace();
|
| | | |
| | | BigDecimal tljMoney = record.getPerFace();
|
| | |
|
| | | TaoBaoGoodsBrief goods = null;
|
| | | try {
|
| | | goods = redisManager.getTaoBaoGoodsBrief(auctionId);
|
| | |
| | | } else {
|
| | | data.put("coupon", false);
|
| | | }
|
| | | |
| | |
|
| | | data.put("tljMoney", tljMoney);
|
| | | |
| | |
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | }
|
| | |
|
| | |
| | | @RequestMapping(value = "getGoodsDetail", method = RequestMethod.GET)
|
| | | public void getGoodsDetail(final AcceptData acceptData, final String id, String tid, String uid, String callback,
|
| | | PrintWriter out) {
|
| | | if (!StringUtil.isNullOrEmpty(uid))
|
| | | uid = uid.replace(" ", "+");
|
| | |
|
| | | LogHelper.shareGoods("分享出去的H5访问: uid:" + uid + " id:" + id);
|
| | | long begin = java.lang.System.currentTimeMillis();
|
| | | if (StringUtil.isNullOrEmpty(id)) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "请上传id"));
|
| | |
| | | }
|
| | |
|
| | | } else {// 没有分享记录,需要直接分享
|
| | | List<TaoBaoUnionConfig> configList = taoBaoUnionConfigService
|
| | | .getConfigByTypeCache(PidUser.TYPE_SHARE_GOODS);
|
| | | String pid = null;
|
| | | ClientTBPid tbPid = tbPidService.getSharePid();
|
| | | if (tbPid != null)
|
| | | pid = tbPid.getPid();
|
| | | else {
|
| | | pid = configList.get(0).getDefaultPid();
|
| | | }
|
| | |
|
| | | LogHelper.test("没有分享记录:uid:" + uid + " actionid:" + id);
|
| | | // 获取
|
| | | TaoKeAppInfo app = new TaoKeAppInfo();
|
| | | app.setAdzoneId(pid.split("_")[3]);
|
| | | app.setAppKey(configList.get(0).getAppKey());
|
| | | app.setAppSecret(configList.get(0).getAppSecret());
|
| | | app.setPid(pid);
|
| | | app.setPid(TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT);
|
| | | app.setAdzoneId(app.getPid().split("_")[3]);
|
| | | app.setAppKey(TaoBaoConstant.TAOBAO_AUTH_APPKEY);
|
| | | app.setAppSecret(TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | |
|
| | | try {
|
| | | goods = TaoKeApiUtil.searchGoodsDetail(Long.parseLong(id), app);
|
| | | } catch (NumberFormatException e) {
|
| | |
| | | if (!StringUtil.isNullOrEmpty(goods.getCouponLink())) {
|
| | | url = goods.getCouponLink();
|
| | | }
|
| | | String relationId = userExtraTaoBaoInfoService.getRelationIdByUid(Long.parseLong(uid));
|
| | | if (!StringUtil.isNullOrEmpty(relationId))
|
| | | url += "&relationId=" + relationId;
|
| | | token = TaoKeApiUtil.getTKToken(goods.getPictUrl(), goods.getTitle(), url);
|
| | | }
|
| | | }
|
| | |
| | | // 老版本兼容
|
| | | data.put("quan", true);
|
| | | }
|
| | | |
| | |
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | |
|
| | | final String tempUid = uid;
|
| | |
| | | });
|
| | | return;
|
| | | }
|
| | | |
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 京东分享商品信息
|
| | | * |
| | | * @param acceptData
|
| | | * @param id
|
| | | * @param uid
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getJDGoodsDetail")
|
| | | public void getJDGoodsDetail(final AcceptData acceptData, final Long id, String uid, String callback,
|
| | | public void getJDGoodsDetail(final AcceptData acceptData, final Long id, String uid, String callback,
|
| | | PrintWriter out) {
|
| | | if (id == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "请上传id"));
|
| | |
| | | imageList = new ArrayList<>();
|
| | | imageList.add(jdGoods.getPicUrl());
|
| | | }
|
| | | |
| | |
|
| | | boolean hasCoupon = false;
|
| | | String couponUrl = null;
|
| | | BigDecimal discount = new BigDecimal(0);
|
| | |
| | | discount = couponInfo.getDiscount();
|
| | | couponUrl = couponInfo.getLink();
|
| | | }
|
| | | |
| | |
|
| | | boolean jdzy = false;
|
| | | String owner = jdGoods.getOwner();
|
| | | if (!StringUtil.isNullOrEmpty(owner) && "g".equalsIgnoreCase(owner)) {
|
| | | jdzy = true;
|
| | | }
|
| | | |
| | |
|
| | | String materialId = "https://item.jd.com/" + id + ".html";
|
| | | String jumpLink = JDApiUtil.convertShortLink(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "", uid);
|
| | | |
| | |
|
| | | int priceType = 1;
|
| | | BigDecimal price = jdGoods.getPrice();;
|
| | | BigDecimal price = jdGoods.getPrice();
|
| | | ;
|
| | | JDPingouInfo pinGouInfo = jdGoods.getPinGouInfo();
|
| | | if (pinGouInfo != null) {
|
| | | priceType = 2; // 拼购价
|
| | | price = pinGouInfo.getPingouPrice();
|
| | | price = pinGouInfo.getPingouPrice();
|
| | | }
|
| | | |
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("jdzy", jdzy);
|
| | | data.put("imgs", imageList);
|
| | | data.put("title", jdGoods.getSkuName());
|
| | | data.put("zkPrice", price);
|
| | | data.put("priceType", priceType); |
| | | data.put("priceType", priceType);
|
| | | data.put("coupon", hasCoupon);
|
| | | data.put("couponAmount", discount);
|
| | | data.put("couponPrice", JDUtil.getQuanPrice(jdGoods));
|
| | |
| | | public void run() {
|
| | | try {
|
| | | if (!StringUtil.isNullOrEmpty(tempUid))
|
| | | userShareGoodsGroupService.updateBrowseNum(Long.parseLong(tempUid), id, Constant.SOURCE_TYPE_JD);
|
| | | userShareGoodsGroupService.updateBrowseNum(Long.parseLong(tempUid), id,
|
| | | Constant.SOURCE_TYPE_JD);
|
| | | } catch (NumberFormatException e) {
|
| | | e.printStackTrace();
|
| | | } catch (UserShareGoodsRecordException e) {
|
| | |
| | | });
|
| | | return;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 拼多多分享商品详情
|
| | | * |
| | | * @param acceptData
|
| | | * @param id
|
| | | * @param uid
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getPDDGoodsDetail")
|
| | | public void getPDDGoodsDetail(final AcceptData acceptData, final Long id, String uid, String callback,
|
| | | public void getPDDGoodsDetail(final AcceptData acceptData, final Long id, String uid, String callback,
|
| | | PrintWriter out) {
|
| | | if (id == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "请上传id"));
|
| | |
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("商品信息获取失败")));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | List<String> imageList = null;
|
| | | String[] goodsGalleryUrls = pddGoods.getGoodsGalleryUrls();
|
| | | if (goodsGalleryUrls != null) {
|
| | |
| | | imageList.add(goodsImageUrl);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | BigDecimal hundred = new BigDecimal(100);
|
| | | Boolean hasCoupon = pddGoods.getHasCoupon();
|
| | | BigDecimal amount = new BigDecimal(0);
|
| | |
| | | } else {
|
| | | hasCoupon = false;
|
| | | }
|
| | | |
| | |
|
| | | String jumpLink = PinDuoDuoApiUtil.getPromotionUrl(id, PinDuoDuoApiUtil.PID_SHARE + "", uid);
|
| | | |
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("imgs", imageList);
|
| | | data.put("title", pddGoods.getGoodsName());
|
| | |
| | | public void run() {
|
| | | try {
|
| | | if (!StringUtil.isNullOrEmpty(tempUid))
|
| | | userShareGoodsGroupService.updateBrowseNum(Long.parseLong(tempUid), id, Constant.SOURCE_TYPE_PDD);
|
| | | userShareGoodsGroupService.updateBrowseNum(Long.parseLong(tempUid), id,
|
| | | Constant.SOURCE_TYPE_PDD);
|
| | | } catch (NumberFormatException e) {
|
| | | e.printStackTrace();
|
| | | } catch (UserShareGoodsRecordException e) {
|
| | |
| | | |
| | | public interface HongBaoV2CountMapper { |
| | | |
| | | |
| | | /** |
| | | * 统计历史总到账金额 |
| | | * @param uid |
| | | * @param state |
| | | * |
| | | * @param uid |
| | | * @param state |
| | | * @return |
| | | */ |
| | | BigDecimal countMoneyByUidAndState(@Param("uid")Long uid, @Param("state") Integer state); |
| | | |
| | | |
| | | BigDecimal countMoneyByUidAndState(@Param("uid") Long uid, @Param("state") Integer state); |
| | | |
| | | /** |
| | | * 统计历史红包数量 |
| | | * @param uid |
| | | * @param state |
| | | * |
| | | * @param uid |
| | | * @param state |
| | | * @return |
| | | */ |
| | | Integer countNumberByUidAndState(@Param("uid")Long uid, @Param("state") Integer state); |
| | | |
| | | Integer countNumberByUidAndState(@Param("uid") Long uid, @Param("state") Integer state); |
| | | |
| | | /** |
| | | * 统计用户总的红包数量 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | Long countNumberByUid(@Param("uid")Long uid); |
| | | |
| | | Long countNumberByUid(@Param("uid") Long uid); |
| | | |
| | | /** |
| | | * 统计总金额 |
| | | * @param channel 渠道 |
| | | * @param type |
| | | * |
| | | * @param channel |
| | | * 渠道 |
| | | * @param type |
| | | * @param state |
| | | * @param years |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> countHongBaoMoney(@Param("channel")String channel, @Param("dateType")Integer dateType, |
| | | @Param("state") Integer state, @Param("year") String year, |
| | | @Param("startTime")String startTime, @Param("endTime")String endTime); |
| | | |
| | | List<Map<String, Object>> countHongBaoMoney(@Param("channel") String channel, @Param("dateType") Integer dateType, |
| | | @Param("state") Integer state, @Param("year") String year, @Param("startTime") String startTime, |
| | | @Param("endTime") String endTime); |
| | | |
| | | /** |
| | | * 统计总个数 |
| | | * @param channel 渠道 |
| | | * @param type |
| | | * |
| | | * @param channel |
| | | * 渠道 |
| | | * @param type |
| | | * @param state |
| | | * @param years |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> countHongBaoNum(@Param("channel")String channel, @Param("dateType")Integer dateType, |
| | | @Param("state") Integer state, @Param("year") String year, |
| | | @Param("startTime")String startTime, @Param("endTime")String endTime); |
| | | |
| | | |
| | | List<Map<String, Object>> countHongBaoNum(@Param("channel") String channel, @Param("dateType") Integer dateType, |
| | | @Param("state") Integer state, @Param("year") String year, @Param("startTime") String startTime, |
| | | @Param("endTime") String endTime); |
| | | |
| | | /** |
| | | * 统计总个数 |
| | | * @param channel 渠道 |
| | | * @param type |
| | | * |
| | | * @param channel |
| | | * 渠道 |
| | | * @param type |
| | | * @param state |
| | | * @param years |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> countHongBaoType(@Param("dateType")Integer dateType, |
| | | @Param("type") Integer type, @Param("year") String year, |
| | | @Param("startTime")String startTime, @Param("endTime")String endTime); |
| | | |
| | | List<Map<String, Object>> countHongBaoType(@Param("dateType") Integer dateType, @Param("type") Integer type, |
| | | @Param("year") String year, @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | | * 统计总个数 |
| | | * @param channel 渠道 |
| | | * @param type |
| | | * |
| | | * @param channel |
| | | * 渠道 |
| | | * @param type |
| | | * @param state |
| | | * @param years |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> countHongBaoTotalNum(@Param("dateType")Integer dateType, @Param("year") String year, |
| | | @Param("startTime")String startTime, @Param("endTime")String endTime); |
| | | |
| | | List<Map<String, Object>> countHongBaoTotalNum(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | // 累计提成订单数量(包含无效订单) |
| | | int getTotalTiChengCount(Long uid); |
| | | |
| | | |
| | | /** |
| | | * 统计未失效订单数量 |
| | | * |
| | | * @param uid |
| | | * @param dateType |
| | | * @return |
| | | */ |
| | | long countValidNumberByUid(@Param("uid") Long uid, @Param("dateType")Integer dateType); |
| | | |
| | | long countValidNumberByUid(@Param("uid") Long uid, @Param("dateType") Integer dateType); |
| | | |
| | | /** |
| | | * 统计未到账 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | BigDecimal countWillGetMoneyByUid(@Param("uid") Long uid); |
| | | |
| | | |
| | | |
| | | Date getLastHongBaoTime(@Param("uid") Long uid); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据渠道 统计新增用户24小时内产生的订单数量 |
| | | * |
| | |
| | | */ |
| | | List<Map<String, Object>> count24HOderByChannel(@Param("channel") String channel, @Param("type") Integer type, |
| | | @Param("years") String years, @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | |
| | | List<HongBaoV2VO> listShareAndInviteMoney(@Param("start") long start, @Param("count") int count, |
| | | @Param("date") String date); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 统计奖励券总金额 |
| | | * |
| | | * @return |
| | | */ |
| | | BigDecimal countRebateCouponMoney(); |
| | | |
| | | /** |
| | | * 统计用户已到账 |
| | | * |
| | | * @param uid |
| | | * @param typeList |
| | | * @param minGetTime |
| | | * @param maxGetTime |
| | | * @return |
| | | */ |
| | | BigDecimal sumAlreadyGetMoneyByUid(@Param("uid") Long uid, @Param("typeList") List<Integer> typeList, |
| | | @Param("minGetTime") Date minGetTime, @Param("maxGetTime") Date maxGetTime); |
| | | |
| | | long countAlreadyGetMoneyByUid(@Param("uid") Long uid, @Param("typeList") List<Integer> typeList, |
| | | @Param("minGetTime") Date minGetTime, @Param("maxGetTime") Date maxGetTime); |
| | | |
| | | |
| | | /** |
| | | * 统计返利订单 |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | long countRebateOrder(@Param("uid") Long uid); |
| | | |
| | | /** |
| | | * 统计分享和邀请订单 |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | long countShareOrInviteOrder(@Param("uid") Long uid); |
| | | |
| | | } |
| | |
| | | List<Special> listByPlaceKey(@Param("placeKey") String placeKey, @Param("sex")Integer sex
|
| | | , @Param("platform") Integer platform, @Param("versionCode") Integer versionCode);
|
| | |
|
| | | |
| | | /**
|
| | | * 根据多个位置标识查询
|
| | | * @param list
|
| | | * @param sex
|
| | | * @param platform
|
| | | * @param versionCode
|
| | | * @return
|
| | | */
|
| | | List<Special> listByPlaceKeyList(@Param("start")long start, @Param("count")int count,@Param("list") List<String> list, @Param("sex")Integer sex
|
| | | , @Param("platform") Integer platform, @Param("versionCode") Integer versionCode);
|
| | | |
| | | long countByPlaceKeyList(@Param("list") List<String> list, @Param("sex")Integer sex
|
| | | , @Param("platform") Integer platform, @Param("versionCode") Integer versionCode);
|
| | | |
| | | } |
| | |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | int countByTaskIdTodayNum(@Param("uid") Long uid, @Param("tid") Long tid, @Param("date") String date);
|
| | | int countByTaskIdTodayNum(@Param("uid") Long uid, @Param("tid") Long tid, @Param("date") String date,
|
| | | @Param("recordId") Long recordId);
|
| | |
|
| | | /**
|
| | | * 根据类型与创建时间检索
|
| | |
| | | @Column(name = "bf_name")
|
| | | private String name; // 品牌名称
|
| | |
|
| | | @Column(name = "bf_search_key")
|
| | | private String searchKey; // 搜索词
|
| | | |
| | | @Expose
|
| | | @Column(name = "bf_icon")
|
| | | private String icon; // 品牌logo
|
| | |
| | | public void setGoodsTotal(Integer goodsTotal) {
|
| | | this.goodsTotal = goodsTotal;
|
| | | }
|
| | |
|
| | | public String getSearchKey() {
|
| | | return searchKey;
|
| | | }
|
| | |
|
| | | public void setSearchKey(String searchKey) {
|
| | | this.searchKey = searchKey;
|
| | | }
|
| | | } |
| | |
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | |
|
| | | /**
|
| | | * 专题管理
|
| | |
| | | @Expose
|
| | | private long countDownTime;//倒计时
|
| | |
|
| | | @Expose
|
| | | private List<ClientTextStyleVO> labels; //标签
|
| | |
|
| | | |
| | | public long getCountDownTime() {
|
| | | return countDownTime;
|
| | | }
|
| | |
| | | public void setEndTime_str(String endTime_str) {
|
| | | this.endTime_str = endTime_str;
|
| | | }
|
| | | |
| | |
|
| | | public List<ClientTextStyleVO> getLabels() {
|
| | | return labels;
|
| | | }
|
| | |
|
| | | public void setLabels(List<ClientTextStyleVO> labels) {
|
| | | this.labels = labels;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | private String createTime; // 创建时间
|
| | | @Column(name = "to_click_time")
|
| | | private String clickTime; // 点击时间
|
| | | @Column(name = "to_pay_time")
|
| | | private String payTime;// 支付时间
|
| | | @Column(name = "to_title")
|
| | | private String title; // 商品名称
|
| | | @Column(name = "to_auction_id")
|
| | |
| | | @Column(name = "to_relation_id")
|
| | | private String relationId;
|
| | | @Column(name = "to_trade_id")
|
| | | private String tradeId;//交易ID
|
| | | private String tradeId;// 交易ID
|
| | |
|
| | | public String getTradeId() {
|
| | | return tradeId;
|
| | |
| | | this.adPositionName = adPositionName;
|
| | | }
|
| | |
|
| | | public String getPayTime() {
|
| | | return payTime;
|
| | | }
|
| | |
|
| | | public void setPayTime(String payTime) {
|
| | | this.payTime = payTime;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeOrderApiUtil;
|
| | |
|
| | | //从淘宝爬去订单更新
|
| | |
| | | Iterator<String> its = map.keySet().iterator();
|
| | | while (its.hasNext()) {
|
| | | String key = its.next();
|
| | | List<TaoBaoOrder> orders = map.get(key);
|
| | | String redisKey = "addorderqueue-" + key;
|
| | | // redis做频率限制
|
| | | try {
|
| | |
| | | public void doJob6() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | long endTime = System.currentTimeMillis() - 1000 * 60;
|
| | | Date systemDate = TaoKeApiUtil.getTaoBaoSystemTime();
|
| | | long endTime = systemDate != null ? systemDate.getTime() : System.currentTimeMillis();
|
| | | updateOrder(endTime - 1000 * 60 * 20L, endTime);
|
| | | }
|
| | |
|
| | |
| | | package com.yeshi.fanli.job.order.taobao;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.Iterator;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeOrderApiUtil;
|
| | |
|
| | | /**
|
| | |
| | | * 结束页码(每页100条数据)
|
| | | */
|
| | | public void updateRelationAndSpecialOrder(long startTime, long endTime) {
|
| | | List<TaoBaoOrder> list =TaoKeOrderApiUtil.getTaoBaoSpecialOrderList (startTime, endTime,1);
|
| | | List<TaoBaoOrder> list1 = TaoKeOrderApiUtil.getTaoBaoRelationOrderList (startTime, endTime,1);
|
| | | List<TaoBaoOrder> list = TaoKeOrderApiUtil.getTaoBaoSpecialOrderList(startTime, endTime, 1);
|
| | | List<TaoBaoOrder> list1 = TaoKeOrderApiUtil.getTaoBaoRelationOrderList(startTime, endTime, 1);
|
| | | if (list1 != null && list1.size() > 0)
|
| | | list.addAll(list1);
|
| | | // 爬取到的订单号
|
| | |
| | |
|
| | | addRelationAndSpecialOrder(list);
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 按付款时间查询
|
| | | * |
| | | * @param startTime
|
| | | * @param endTime
|
| | | */
|
| | | public void updateRelationAndSpecialPaidOrder(long startTime, long endTime) {
|
| | | List<TaoBaoOrder> list = TaoKeOrderApiUtil.getTaoBaoSpecialOrderList(startTime, endTime, 2);
|
| | | List<TaoBaoOrder> list1 = TaoKeOrderApiUtil.getTaoBaoRelationOrderList(startTime, endTime, 2);
|
| | | if (list1 != null && list1.size() > 0)
|
| | | list.addAll(list1);
|
| | | // 爬取到的订单号
|
| | | if (list != null)
|
| | | for (TaoBaoOrder order : list) {
|
| | | LogHelper.orderInfo("爬取到的订单号:" + order.getOrderId());
|
| | | }
|
| | |
|
| | | addRelationAndSpecialOrder(list);
|
| | | }
|
| | |
|
| | | public void updateRelationAndSpecialSettleOrder(long startTime, long endTime) {
|
| | | List<TaoBaoOrder> list = TaoKeOrderApiUtil.getTaoBaoSpecialOrderList (startTime, endTime,3);
|
| | | List<TaoBaoOrder> list1 = TaoKeOrderApiUtil.getTaoBaoRelationOrderList (startTime, endTime,3);
|
| | | List<TaoBaoOrder> list = TaoKeOrderApiUtil.getTaoBaoSpecialOrderList(startTime, endTime, 3);
|
| | | List<TaoBaoOrder> list1 = TaoKeOrderApiUtil.getTaoBaoRelationOrderList(startTime, endTime, 3);
|
| | | if (list1 != null && list1.size() > 0)
|
| | | list.addAll(list1);
|
| | | // 爬取到的订单号
|
| | |
| | | while (its.hasNext()) {
|
| | | String key = its.next();
|
| | | List<TaoBaoOrder> orders = map.get(key);
|
| | | String redisKey = "addorderqueue-" + TaoBaoOrderUtil.getOrderDataHashCode(orders);;
|
| | | String redisKey = "addorderqueue-" + TaoBaoOrderUtil.getOrderDataHashCode(orders);
|
| | | ;
|
| | | // redis做频率限制
|
| | | try {
|
| | | if (!StringUtil.isNullOrEmpty(redisManager.getCommonString(redisKey))) {
|
| | |
| | | return;
|
| | | // 爬取近20分钟的数据
|
| | | LogHelper.orderInfo("爬单:30s爬取一次单");
|
| | | long endTime = System.currentTimeMillis();
|
| | | Date systemDate = TaoKeApiUtil.getTaoBaoSystemTime();
|
| | | long endTime = systemDate != null ? systemDate.getTime() : System.currentTimeMillis();
|
| | | updateRelationAndSpecialOrder(endTime - 1000 * 60 * 20L, endTime);
|
| | | updateRelationAndSpecialPaidOrder(endTime - 1000 * 60 * 20L, endTime);
|
| | | updateRelationAndSpecialSettleOrder(endTime - 1000 * 60 * 20L, endTime);
|
| | | }
|
| | |
|
| | |
| | | public void doJob2() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | long endTime = System.currentTimeMillis();
|
| | | LogHelper.orderInfo("爬单:5min爬取一次单");
|
| | | Date systemDate = TaoKeApiUtil.getTaoBaoSystemTime();
|
| | | long endTime = systemDate != null ? systemDate.getTime() : System.currentTimeMillis();
|
| | | updateRelationAndSpecialOrder(endTime - 1000 * 60 * 60 * 24L, endTime);
|
| | | updateRelationAndSpecialSettleOrder(endTime - 1000 * 60 * 60 * 24L, endTime);
|
| | | }
|
| | |
|
| | | // 每个小时更新
|
| | | @Scheduled(cron = "0 0 0/1 * * ? ")
|
| | | public void doJob3() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | // Calendar calendar = Calendar.getInstance();
|
| | | // int h = calendar.get(Calendar.HOUR_OF_DAY);
|
| | | // // 每个小时更新100页数据
|
| | | // int fromPage = h * 100;
|
| | | // if (fromPage <= 0)
|
| | | // fromPage = 11;
|
| | | // int toPage = h * 100 + 100;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import org.apache.log4j.Logger;
|
| | |
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_account_message where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.AccountMessage" |
| | | useGeneratedKeys="true" keyProperty="id">insert into |
| | | yeshi_ec_account_message |
| | |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.brand.BrandInfo">
|
| | | <id column="bf_id" property="id" jdbcType="BIGINT"/>
|
| | | <result column="bf_name" property="name" jdbcType="VARCHAR"/>
|
| | | <result column="bf_search_key" property="searchKey" jdbcType="VARCHAR"/>
|
| | | <result column="bf_icon" property="icon" jdbcType="VARCHAR"/>
|
| | | <result column="bf_weight" property="weight" jdbcType="DOUBLE"/>
|
| | | <result column="bf_goods_total" property="goodsTotal" jdbcType="INTEGER"/>
|
| | | <result column="bf_weight" property="weight" jdbcType="VARCHAR"/>
|
| | | <result column="bf_state" property="state" jdbcType="INTEGER"/>
|
| | | <result column="bf_create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="bf_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
| | | <association column="bf_cid" property="brandClass" javaType="com.yeshi.fanli.entity.brand.BrandClass">
|
| | | <association column="bf_cid" property="brandClass" javaType="com.yeshi.fanli.entity.brand.BrandClass">
|
| | | <id column="bf_cid" property="id" jdbcType="BIGINT" />
|
| | | </association>
|
| | | </resultMap>
|
| | |
|
| | | <resultMap id="ResultVOMap" type="com.yeshi.fanli.vo.brand.BrandInfoVO">
|
| | | <resultMap id="ResultVOMap" type="com.yeshi.fanli.vo.brand.BrandInfoVO">
|
| | | <id column="bf_id" property="id" jdbcType="BIGINT"/>
|
| | | <result column="bf_name" property="name" jdbcType="VARCHAR"/>
|
| | | <result column="bf_search_key" property="searchKey" jdbcType="VARCHAR"/>
|
| | | <result column="bf_icon" property="icon" jdbcType="VARCHAR"/>
|
| | | <result column="bf_weight" property="weight" jdbcType="DOUBLE"/>
|
| | | <result column="bf_goods_total" property="goodsTotal" jdbcType="INTEGER"/>
|
| | |
| | | </association>
|
| | | </resultMap>
|
| | |
|
| | | <sql id="Base_Column_List">bf_id,bf_cid,bf_name,bf_icon,bf_weight,bf_goods_total,bf_state,bf_create_time,bf_update_time</sql>
|
| | | <sql id="Base_Column_List">bf_id,bf_cid,bf_name,bf_search_key,bf_icon,bf_goods_total,bf_weight,bf_state,bf_create_time,bf_update_time</sql>
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
|
| | | <include refid="Base_Column_List"/>from yeshi_ec_brand_info where bf_id = #{id,jdbcType=BIGINT}
|
| | | </select>
|
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_brand_info where bf_id = #{id,jdbcType=BIGINT}</delete>
|
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.brand.BrandInfo" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_brand_info (bf_id,bf_cid,bf_name,bf_icon,bf_weight,bf_goods_total,bf_state,bf_create_time,bf_update_time) values (#{id,jdbcType=BIGINT},#{brandClass.id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{icon,jdbcType=VARCHAR},#{weight,jdbcType=DOUBLE},#{goodsTotal,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
|
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.brand.BrandInfo" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_brand_info (bf_id,bf_cid,bf_name,bf_search_key,bf_icon,bf_goods_total,bf_weight,bf_state,bf_create_time,bf_update_time) values (#{id,jdbcType=BIGINT},#{brandClass.id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{searchKey,jdbcType=VARCHAR},#{icon,jdbcType=VARCHAR},#{goodsTotal,jdbcType=INTEGER},#{weight,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
|
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.brand.BrandInfo" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_brand_info
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">bf_id,</if>
|
| | | <if test="brandClass != null">bf_cid,</if>
|
| | | <if test="name != null">bf_name,</if>
|
| | | <if test="searchKey != null">bf_search_key,</if>
|
| | | <if test="icon != null">bf_icon,</if>
|
| | | <if test="weight != null">bf_weight,</if>
|
| | | <if test="goodsTotal != null">bf_goods_total,</if>
|
| | | <if test="weight != null">bf_weight,</if>
|
| | | <if test="state != null">bf_state,</if>
|
| | | <if test="createTime != null">bf_create_time,</if>
|
| | | <if test="updateTime != null">bf_update_time,</if>
|
| | |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if>
|
| | | <if test="brandClass != null">#{brandClass.id,jdbcType=BIGINT},</if>
|
| | | <if test="name != null">#{name,jdbcType=VARCHAR},</if>
|
| | | <if test="searchKey != null">#{searchKey,jdbcType=VARCHAR},</if>
|
| | | <if test="icon != null">#{icon,jdbcType=VARCHAR},</if>
|
| | | <if test="weight != null">#{weight,jdbcType=DOUBLE},</if>
|
| | | <if test="goodsTotal != null">#{goodsTotal,jdbcType=INTEGER},</if>
|
| | | <if test="weight != null">#{weight,jdbcType=VARCHAR},</if>
|
| | | <if test="state != null">#{state,jdbcType=INTEGER},</if>
|
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | </trim>
|
| | | </insert>
|
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.brand.BrandInfo">update yeshi_ec_brand_info set bf_cid = #{brandClass.id,jdbcType=BIGINT},bf_name = #{name,jdbcType=VARCHAR},bf_icon = #{icon,jdbcType=VARCHAR},bf_weight = #{weight,jdbcType=DOUBLE},bf_goods_total = #{goodsTotal,jdbcType=INTEGER},bf_state = #{state,jdbcType=INTEGER},bf_create_time = #{createTime,jdbcType=TIMESTAMP},bf_update_time = #{updateTime,jdbcType=TIMESTAMP} where bf_id = #{id,jdbcType=BIGINT}</update>
|
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.brand.BrandInfo">update yeshi_ec_brand_info set bf_cid = #{brandClass.id,jdbcType=BIGINT},bf_name = #{name,jdbcType=VARCHAR},bf_search_key = #{searchKey,jdbcType=VARCHAR},bf_icon = #{icon,jdbcType=VARCHAR},bf_goods_total = #{goodsTotal,jdbcType=INTEGER},bf_weight = #{weight,jdbcType=VARCHAR},bf_state = #{state,jdbcType=INTEGER},bf_create_time = #{createTime,jdbcType=TIMESTAMP},bf_update_time = #{updateTime,jdbcType=TIMESTAMP} where bf_id = #{id,jdbcType=BIGINT}</update>
|
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.brand.BrandInfo">update yeshi_ec_brand_info
|
| | | <set>
|
| | | <if test="brandClass != null">bf_cid=#{brandClass.id,jdbcType=BIGINT},</if>
|
| | | <if test="name != null">bf_name=#{name,jdbcType=VARCHAR},</if>
|
| | | <if test="searchKey != null">bf_search_key=#{searchKey,jdbcType=VARCHAR},</if>
|
| | | <if test="icon != null">bf_icon=#{icon,jdbcType=VARCHAR},</if>
|
| | | <if test="weight != null">bf_weight=#{weight,jdbcType=DOUBLE},</if>
|
| | | <if test="goodsTotal != null">bf_goods_total=#{goodsTotal,jdbcType=INTEGER},</if>
|
| | | <if test="weight != null">bf_weight=#{weight,jdbcType=VARCHAR},</if>
|
| | | <if test="state != null">bf_state=#{state,jdbcType=INTEGER},</if>
|
| | | <if test="createTime != null">bf_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updateTime != null">bf_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | </set> where bf_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | | |
| | | <delete id="deleteBatchByPrimaryKey" parameterType="java.util.List">
|
| | | delete from yeshi_ec_brand_info WHERE bf_id in
|
| | | <foreach collection="list" item="item" open="(" close=")"
|
| | |
| | | SELECT * FROM yeshi_ec_brand_info
|
| | | WHERE 1=1
|
| | | <if test="key != null and key !='' ">
|
| | | AND bf_name LIKE '%${key}%'
|
| | | AND (bf_name LIKE '%${key}%' or bf_search_key LIKE '%${key}%')
|
| | | </if>
|
| | | <if test="state != null">
|
| | | AND bf_state = #{state}
|
| | |
| | | SELECT IFNULL(COUNT(bf_id),0) FROM yeshi_ec_brand_info
|
| | | WHERE 1=1
|
| | | <if test="key != null and key !='' ">
|
| | | AND bf_name LIKE '%${key}%'
|
| | | AND (bf_name LIKE '%${key}%' or bf_search_key LIKE '%${key}%')
|
| | | </if>
|
| | | <if test="state != null">
|
| | | AND bf_state = #{state}
|
| | |
| | | <if test="platform == 2">
|
| | | AND IF(sp.`b_min_ios_version_code` IS NOT NULL, #{versionCode}<![CDATA[>=]]> sp.b_min_ios_version_code,TRUE)
|
| | | </if>
|
| | | |
| | | <include refid="Sex_Screen" />
|
| | | <include refid="Sex_Screen" />
|
| | | <if test="sex == null"> ORDER BY sp.`b_orderby`</if>
|
| | | </select>
|
| | | |
| | | <select id="listByPlaceKeyList" resultMap="BaseResultMap">
|
| | | SELECT sp.*,c.`cd_bottom_picture` FROM `yeshi_ec_special` sp
|
| | | RIGHT JOIN
|
| | | (SELECT c.* FROM yeshi_ec_special_card c
|
| | | LEFT JOIN
|
| | | `yeshi_ec_special_place` pc ON pc.`sp_id` = c.`cd_place_id`
|
| | | WHERE
|
| | | c.`cd_state` = 0
|
| | | AND IF(c.`cd_start_time` IS NULL,TRUE,
|
| | | c.`cd_start_time`<![CDATA[<=]]>NOW())
|
| | | AND IF(c.`cd_end_time` IS NULL,TRUE,c.`cd_end_time`<![CDATA[>=]]>NOW())
|
| | | AND pc.`sp_key` in
|
| | | <foreach collection="list" item="item" open="(" close=")" separator=",">
|
| | | #{item}
|
| | | </foreach>
|
| | | )c ON sp.`b_card_id` = c.`cd_id`
|
| | | WHERE sp.`b_state` = 0 |
| | | AND IF(sp.b_start_time IS NULL,TRUE, sp.b_start_time<![CDATA[<=]]> NOW()) |
| | | AND IF(sp.b_end_time IS NULL,TRUE, sp.b_end_time <![CDATA[>=]]> NOW())
|
| | | <if test="platform == 1">
|
| | | AND IF(sp.`b_min_android_version_code` IS NOT NULL, #{versionCode}<![CDATA[>=]]> sp.b_min_android_version_code,TRUE)
|
| | | </if>
|
| | | <if test="platform == 2">
|
| | | AND IF(sp.`b_min_ios_version_code` IS NOT NULL, #{versionCode}<![CDATA[>=]]> sp.b_min_ios_version_code,TRUE)
|
| | | </if>
|
| | | <include refid="Sex_Screen" />
|
| | | <if test="sex == null"> ORDER BY sp.`b_orderby`</if>
|
| | | LIMIT ${start},${count}
|
| | | </select>
|
| | | |
| | | |
| | | <select id="countByPlaceKeyList" resultType="Long">
|
| | | SELECT IFNULL(COUNT(sp.`b_id`),0) FROM `yeshi_ec_special` sp
|
| | | RIGHT JOIN
|
| | | (SELECT c.* FROM yeshi_ec_special_card c
|
| | | LEFT JOIN
|
| | | `yeshi_ec_special_place` pc ON pc.`sp_id` = c.`cd_place_id`
|
| | | WHERE
|
| | | c.`cd_state` = 0
|
| | | AND IF(c.`cd_start_time` IS NULL,TRUE,
|
| | | c.`cd_start_time`<![CDATA[<=]]>NOW())
|
| | | AND IF(c.`cd_end_time` IS NULL,TRUE,c.`cd_end_time`<![CDATA[>=]]>NOW())
|
| | | AND pc.`sp_key` in
|
| | | <foreach collection="list" item="item" open="(" close=")" separator=",">
|
| | | #{item}
|
| | | </foreach>
|
| | | )c ON sp.`b_card_id` = c.`cd_id`
|
| | | WHERE sp.`b_state` = 0 |
| | | AND IF(sp.b_start_time IS NULL,TRUE, sp.b_start_time<![CDATA[<=]]> NOW()) |
| | | AND IF(sp.b_end_time IS NULL,TRUE, sp.b_end_time <![CDATA[>=]]> NOW())
|
| | | <if test="platform == 1">
|
| | | AND IF(sp.`b_min_android_version_code` IS NOT NULL, #{versionCode}<![CDATA[>=]]> sp.b_min_android_version_code,TRUE)
|
| | | </if>
|
| | | <if test="platform == 2">
|
| | | AND IF(sp.`b_min_ios_version_code` IS NOT NULL, #{versionCode}<![CDATA[>=]]> sp.b_min_ios_version_code,TRUE)
|
| | | </if>
|
| | | <include refid="Sex_Screen" />
|
| | | </select>
|
| | | </mapper>
|
| | |
| | | <result column="hb_state" property="state" jdbcType="INTEGER" /> |
| | | <result column="hb_version" property="version" jdbcType="INTEGER" /> |
| | | <result column="hb_beizhu" property="beizhu" jdbcType="VARCHAR" /> |
| | | <result column="hb_pre_get_time" property="preGetTime" jdbcType="TIMESTAMP" /> |
| | | <result column="hb_pre_get_time" property="preGetTime" |
| | | jdbcType="TIMESTAMP" /> |
| | | <result column="hb_get_time" property="getTime" jdbcType="TIMESTAMP" /> |
| | | <result column="hb_create_time" property="createTime" jdbcType="TIMESTAMP" /> |
| | | <result column="hb_update_time" property="updateTime" jdbcType="TIMESTAMP" /> |
| | | |
| | | <result column="totalMoney" property="totalMoney" jdbcType="DECIMAL" /> |
| | | |
| | | |
| | | <association property="userInfo" column="hb_uid" |
| | | javaType="com.yeshi.fanli.entity.bus.user.UserInfo"> |
| | | <id column="hb_uid" property="id" jdbcType="BIGINT" /> |
| | |
| | | </select> |
| | | |
| | | <select id="countNumberByUid" resultType="java.lang.Long"> |
| | | select count(hb_id) from yeshi_ec_hongbao_v2 where hb_uid=#{0} |
| | | select count(hb_id) |
| | | from yeshi_ec_hongbao_v2 where hb_uid=#{0} |
| | | </select> |
| | | |
| | | |
| | |
| | | SELECT COUNT(t.`hb_id`)AS showValue, |
| | | <include refid="Column_DateType" /> |
| | | FROM yeshi_ec_hongbao_v2 t |
| | | WHERE t.`hb_uid` IS NOT NULL AND t.`hb_type` not in(1,3,4) |
| | | WHERE t.`hb_uid` IS NOT NULL AND t.`hb_type` |
| | | not in(1,3,4) |
| | | <include refid="Count_Select_DateType" /> |
| | | <include refid="Count_Group_DateType" /> |
| | | ORDER BY t.`hb_create_time` |
| | |
| | | |
| | | <select id="countMoneyByUidAndState" resultType="java.math.BigDecimal"> |
| | | SELECT CAST(SUM(hb.`hb_money`)AS DECIMAL(19,2)) |
| | | FROM `yeshi_ec_hongbao_v2` hb |
| | | FROM |
| | | `yeshi_ec_hongbao_v2` hb |
| | | WHERE hb.`hb_uid` = #{uid} |
| | | <if test="state != null"> |
| | | AND hb.`hb_state` = #{state} |
| | |
| | | SELECT count(*) FROM `yeshi_ec_hongbao_v2` h |
| | | WHERE |
| | | h.`hb_uid`=#{0} |
| | | AND (h.`hb_type`=20 OR h.`hb_type`=21 OR h.`hb_type`=22 OR h.`hb_type`=6 |
| | | AND (h.`hb_type`=20 OR h.`hb_type`=21 OR h.`hb_type`=22 |
| | | OR h.`hb_type`=6 |
| | | OR h.`hb_type`=7) |
| | | </select> |
| | | |
| | |
| | | <if test="dateType != null and dateType == 2"> |
| | | AND DATE_FORMAT( |
| | | FROM_UNIXTIME(hb.`hb_create_time`/1000),'%Y%m' ) = |
| | | DATE_FORMAT( CURDATE( ) , '%Y%m' ) |
| | | DATE_FORMAT( |
| | | CURDATE( ) , '%Y%m' ) |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="countWillGetMoneyByUid" resultType="java.math.BigDecimal"> |
| | | SELECT CAST(SUM(hb.`hb_money`)AS DECIMAL(19,2)) |
| | | SELECT |
| | | CAST(SUM(hb.`hb_money`)AS DECIMAL(19,2)) |
| | | FROM `yeshi_ec_hongbao_v2` hb |
| | | WHERE hb.`hb_uid` = #{uid} AND hb.`hb_state` |
| | | in (1,2) |
| | |
| | | FROM |
| | | ( |
| | | SELECT h.* FROM yeshi_ec_hongbao_v2 h |
| | | LEFT JOIN (SELECT a.`lua_uid` AS uid FROM `yeshi_ec_log_user_active` a |
| | | WHERE a.`lua_channel`='${channel}' GROUP BY a.`lua_uid`) a |
| | | ON a.uid=h.`hb_uid` WHERE a.uid IS NOT NULL AND (h.`hb_type`=1 OR |
| | | LEFT JOIN (SELECT |
| | | a.`lua_uid` AS uid FROM `yeshi_ec_log_user_active` a |
| | | WHERE |
| | | a.`lua_channel`='${channel}' GROUP BY a.`lua_uid`) a |
| | | ON |
| | | a.uid=h.`hb_uid` WHERE a.uid IS NOT NULL AND (h.`hb_type`=1 OR |
| | | h.`hb_type`=20) |
| | | ) b |
| | | LEFT JOIN yeshi_ec_user u ON u.`id`=b.hb_uid |
| | |
| | | totalMoney DESC |
| | | LIMIT ${start},${count} |
| | | </select> |
| | | |
| | | |
| | | <select id="countRebateCouponMoney" resultType="java.math.BigDecimal"> |
| | | SELECT IFNULL(SUM(h.`hb_money`),0) FROM `yeshi_ec_hongbao_v2` h |
| | | SELECT |
| | | IFNULL(SUM(h.`hb_money`),0) FROM `yeshi_ec_hongbao_v2` h |
| | | where h.`hb_type` = 10 |
| | | </select> |
| | | |
| | | |
| | | <select id="sumAlreadyGetMoneyByUid" resultType="java.math.BigDecimal"> |
| | | SELECT IFNULL(SUM(h.`hb_money`),0) FROM `yeshi_ec_hongbao_v2` h |
| | | where h.`hb_uid` = #{uid} |
| | | <if test="typeList!=null"> |
| | | <foreach collection="typeList" item="type" open=" and (" |
| | | separator=" or " close=")"> |
| | | h.hb_type=#{type} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="minGetTime!=null"> |
| | | and h.hb_get_time>=#{minGetTime} |
| | | </if> |
| | | |
| | | <if test="maxGetTime!=null"> |
| | | and #{maxGetTime}>h.hb_get_time |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | <select id="countAlreadyGetMoneyByUid" resultType="java.lang.Long"> |
| | | SELECT count(h.hb_id) FROM `yeshi_ec_hongbao_v2` h |
| | | where h.`hb_uid` = #{uid} |
| | | <if test="typeList!=null"> |
| | | <foreach collection="typeList" item="type" open=" and (" |
| | | separator=" or " close=")"> |
| | | h.hb_type=#{type} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="minGetTime!=null"> |
| | | and h.hb_get_time>=#{minGetTime} |
| | | </if> |
| | | |
| | | <if test="maxGetTime!=null"> |
| | | and #{maxGetTime}>h.hb_get_time |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <select id="countRebateOrder" resultType="Long"> |
| | | SELECT IFNULL(COUNT(hb_id),0) FROM `yeshi_ec_hongbao_v2` |
| | | WHERE hb_uid = #{uid} AND (hb_type =1 OR hb_type =2) |
| | | </select> |
| | | |
| | | <select id="countShareOrInviteOrder" resultType="Long"> |
| | | SELECT IFNULL(COUNT(hb_id),0) FROM `yeshi_ec_hongbao_v2` |
| | | WHERE hb_uid = #{uid} |
| | | AND (`hb_type` =5 OR `hb_type` =6 OR `hb_type` =7 OR `hb_type` =20 OR `hb_type`=21 OR `hb_type` =22 ) |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | </select> |
| | | |
| | | |
| | | <select id="countGetCountByTaskIdAndDay" resultType="Integer"> |
| | | <select id="countGetCountByTaskIdAndDay" resultType="Integer" flushCache="true" useCache="false"> |
| | | SELECT count(*) FROM `yeshi_ec_integral_task_record` |
| | | d |
| | | WHERE |
| | |
| | | </select>
|
| | |
|
| | | <select id="countByTaskIdTodayNum" resultType="Integer">
|
| | | SELECT IFNULL(COUNT(tr.`ir_id`),0) FROM yeshi_ec_integral_task_record
|
| | | tr
|
| | | SELECT IFNULL(COUNT(tr.`ir_id`),0) FROM yeshi_ec_integral_task_record tr
|
| | | WHERE tr.ir_uid = #{uid} AND tr.`ir_task_id`= #{tid}
|
| | | AND TO_DAYS(tr.ir_create_time) = TO_DAYS('${date}') AND tr.ir_create_time <![CDATA[<=]]>'${date}'
|
| | | AND TO_DAYS(tr.ir_create_time) = TO_DAYS('${date}') AND tr.ir_id <![CDATA[<=]]> #{recordId}
|
| | | </select>
|
| | |
|
| | |
|
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.push.DeviceTokenOPPOMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.push.DeviceTokenOPPO"> |
| | | <id column="do_id" property="id" jdbcType="BIGINT" /> |
| | | <result column="do_device_id" property="deviceActiveId" |
| | | jdbcType="BIGINT" /> |
| | | <result column="do_register_id" property="registerId" jdbcType="VARCHAR" /> |
| | | <result column="do_uid" property="uid" jdbcType="BIGINT" /> |
| | | <result column="do_create_time" property="createTime" jdbcType="TIMESTAMP" /> |
| | | <result column="do_update_time" property="updateTime" jdbcType="TIMESTAMP" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">do_id,do_device_id,do_register_id,do_uid,do_create_time,do_update_time |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_uid_devicetoken_oppo where do_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectByDeviceActiveId" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_uid_devicetoken_oppo where do_device_id = #{0} |
| | | </select> |
| | | |
| | | |
| | | <select id="countDeviceToken" resultType="java.lang.Long" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | count(do_id) |
| | | from yeshi_ec_uid_devicetoken_oppo op left join |
| | | yeshi_ec_device_active a on a.da_id=op.do_device_id |
| | | <if test="versionList!=null"> |
| | | <foreach collection="versionList" open="where (" separator=" or " |
| | | item="ver" close=")"> |
| | | da_version_code=#{ver} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <select id="listDeviceToken" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_uid_devicetoken_oppo |
| | | left join |
| | | yeshi_ec_device_active a on a.da_id=do_device_id |
| | | <if test="versionList!=null"> |
| | | <foreach collection="versionList" open="where (" separator=" or " |
| | | item="ver" close=")"> |
| | | da_version_code=#{ver} |
| | | </foreach> |
| | | </if> |
| | | limit #{start},#{count} |
| | | </select> |
| | | |
| | | |
| | | <select id="listByUid" resultMap="BaseResultMap" parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_uid_devicetoken_oppo |
| | | left join |
| | | yeshi_ec_device_active a on a.da_id=do_device_id |
| | | where do_uid=#{uid} |
| | | <if test="versionList!=null"> |
| | | <foreach collection="versionList" open="and (" separator=" or " |
| | | item="ver" close=")"> |
| | | da_version_code=#{ver} |
| | | </foreach> |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | List<Integer> verisonList |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_uid_devicetoken_oppo where do_id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.push.DeviceTokenOPPO" |
| | | useGeneratedKeys="true" keyProperty="id">insert into |
| | | yeshi_ec_uid_devicetoken_oppo |
| | | (do_id,do_device_id,do_register_id,do_uid,do_create_time,do_update_time) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{deviceActiveId,jdbcType=BIGINT},#{registerId,jdbcType=VARCHAR},#{uid,jdbcType=BIGINT},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.push.DeviceTokenOPPO" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | | insert into yeshi_ec_uid_devicetoken_oppo |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">do_id,</if> |
| | | <if test="deviceActiveId != null">do_device_id,</if> |
| | | <if test="registerId != null">do_register_id,</if> |
| | | <if test="uid != null">do_uid,</if> |
| | | <if test="createTime != null">do_create_time,</if> |
| | | <if test="updateTime != null">do_update_time,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="deviceActiveId != null">#{deviceActiveId,jdbcType=BIGINT},</if> |
| | | <if test="registerId != null">#{registerId,jdbcType=VARCHAR},</if> |
| | | <if test="uid != null">#{uid,jdbcType=BIGINT},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.push.DeviceTokenOPPO">update |
| | | yeshi_ec_uid_devicetoken_oppo set do_device_id = |
| | | #{deviceActiveId,jdbcType=BIGINT},do_register_id = |
| | | #{registerId,jdbcType=VARCHAR},do_uid = |
| | | #{uid,jdbcType=BIGINT},do_create_time = |
| | | #{createTime,jdbcType=TIMESTAMP},do_update_time = |
| | | #{updateTime,jdbcType=TIMESTAMP} where do_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.push.DeviceTokenOPPO"> |
| | | update yeshi_ec_uid_devicetoken_oppo |
| | | <set> |
| | | <if test="deviceActiveId != null">do_device_id=#{deviceActiveId,jdbcType=BIGINT},</if> |
| | | <if test="registerId != null">do_register_id=#{registerId,jdbcType=VARCHAR},</if> |
| | | <if test="uid != null">do_uid=#{uid,jdbcType=BIGINT},</if> |
| | | <if test="createTime != null">do_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">do_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> |
| | | where do_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | | <?xml version="1.0" encoding="UTF-8"?>
|
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | |
|
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.push.DeviceTokenOPPOMapper">
|
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.push.DeviceTokenOPPO">
|
| | | <id column="do_id" property="id" jdbcType="BIGINT" />
|
| | | <result column="do_device_id" property="deviceActiveId"
|
| | | jdbcType="BIGINT" />
|
| | | <result column="do_register_id" property="registerId" jdbcType="VARCHAR" />
|
| | | <result column="do_uid" property="uid" jdbcType="BIGINT" />
|
| | | <result column="do_create_time" property="createTime" jdbcType="TIMESTAMP" />
|
| | | <result column="do_update_time" property="updateTime" jdbcType="TIMESTAMP" />
|
| | | </resultMap>
|
| | | <sql id="Base_Column_List">do_id,do_device_id,do_register_id,do_uid,do_create_time,do_update_time
|
| | | </sql>
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
| | | parameterType="java.lang.Long">
|
| | | select
|
| | | <include refid="Base_Column_List" />
|
| | | from yeshi_ec_uid_devicetoken_oppo where do_id = #{id,jdbcType=BIGINT}
|
| | | </select>
|
| | |
|
| | |
|
| | | <select id="selectByDeviceActiveId" resultMap="BaseResultMap"
|
| | | parameterType="java.lang.Long">
|
| | | select
|
| | | <include refid="Base_Column_List" />
|
| | | from yeshi_ec_uid_devicetoken_oppo where do_device_id = #{0}
|
| | | </select>
|
| | |
|
| | |
|
| | | <select id="countDeviceToken" resultType="java.lang.Long"
|
| | | parameterType="java.lang.Long">
|
| | | select
|
| | | count(do_id)
|
| | | from yeshi_ec_uid_devicetoken_oppo op left join
|
| | | yeshi_ec_device_active a on a.da_id=op.do_device_id
|
| | | <if test="versionList!=null">
|
| | | <foreach collection="versionList" open="where (" separator=" or "
|
| | | item="ver" close=")">
|
| | | da_version_code=#{ver}
|
| | | </foreach>
|
| | | </if>
|
| | | </select>
|
| | |
|
| | |
|
| | | <select id="listDeviceToken" resultMap="BaseResultMap">
|
| | | select
|
| | | <include refid="Base_Column_List" />
|
| | | from yeshi_ec_uid_devicetoken_oppo
|
| | | left join
|
| | | yeshi_ec_device_active a on a.da_id=do_device_id
|
| | | <if test="versionList!=null">
|
| | | <foreach collection="versionList" open="where (" separator=" or "
|
| | | item="ver" close=")">
|
| | | da_version_code=#{ver}
|
| | | </foreach>
|
| | | </if>
|
| | | limit #{start},#{count}
|
| | | </select>
|
| | |
|
| | |
|
| | | <select id="listByUid" resultMap="BaseResultMap" parameterType="java.lang.Long">
|
| | | select
|
| | | <include refid="Base_Column_List" />
|
| | | from yeshi_ec_uid_devicetoken_oppo
|
| | | left join
|
| | | yeshi_ec_device_active a on a.da_id=do_device_id
|
| | | where do_uid=#{uid}
|
| | | <if test="versionList!=null">
|
| | | <foreach collection="versionList" open="and (" separator=" or "
|
| | | item="ver" close=")">
|
| | | da_version_code=#{ver}
|
| | | </foreach>
|
| | | </if>
|
| | | </select>
|
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
|
| | | yeshi_ec_uid_devicetoken_oppo where do_id = #{id,jdbcType=BIGINT}
|
| | | </delete>
|
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.push.DeviceTokenOPPO"
|
| | | useGeneratedKeys="true" keyProperty="id">insert into
|
| | | yeshi_ec_uid_devicetoken_oppo
|
| | | (do_id,do_device_id,do_register_id,do_uid,do_create_time,do_update_time)
|
| | | values
|
| | | (#{id,jdbcType=BIGINT},#{deviceActiveId,jdbcType=BIGINT},#{registerId,jdbcType=VARCHAR},#{uid,jdbcType=BIGINT},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
|
| | | </insert>
|
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.push.DeviceTokenOPPO"
|
| | | useGeneratedKeys="true" keyProperty="id">
|
| | | insert into yeshi_ec_uid_devicetoken_oppo
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">do_id,</if>
|
| | | <if test="deviceActiveId != null">do_device_id,</if>
|
| | | <if test="registerId != null">do_register_id,</if>
|
| | | <if test="uid != null">do_uid,</if>
|
| | | <if test="createTime != null">do_create_time,</if>
|
| | | <if test="updateTime != null">do_update_time,</if>
|
| | | </trim>
|
| | | values
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if>
|
| | | <if test="deviceActiveId != null">#{deviceActiveId,jdbcType=BIGINT},</if>
|
| | | <if test="registerId != null">#{registerId,jdbcType=VARCHAR},</if>
|
| | | <if test="uid != null">#{uid,jdbcType=BIGINT},</if>
|
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | </trim>
|
| | | </insert>
|
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.push.DeviceTokenOPPO">update
|
| | | yeshi_ec_uid_devicetoken_oppo set do_device_id =
|
| | | #{deviceActiveId,jdbcType=BIGINT},do_register_id =
|
| | | #{registerId,jdbcType=VARCHAR},do_uid =
|
| | | #{uid,jdbcType=BIGINT},do_create_time =
|
| | | #{createTime,jdbcType=TIMESTAMP},do_update_time =
|
| | | #{updateTime,jdbcType=TIMESTAMP} where do_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.push.DeviceTokenOPPO">
|
| | | update yeshi_ec_uid_devicetoken_oppo
|
| | | <set>
|
| | | <if test="deviceActiveId != null">do_device_id=#{deviceActiveId,jdbcType=BIGINT},</if>
|
| | | <if test="registerId != null">do_register_id=#{registerId,jdbcType=VARCHAR},</if>
|
| | | <if test="uid != null">do_uid=#{uid,jdbcType=BIGINT},</if>
|
| | | <if test="createTime != null">do_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updateTime != null">do_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | </set>
|
| | | where do_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | | </mapper>
|
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.taobao.TaoBaoOrderMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.taobao.TaoBaoOrder"> |
| | | <id column="to_id" property="id" jdbcType="BIGINT" /> |
| | | <result column="to_create_time" property="createTime" jdbcType="VARCHAR" /> |
| | | <result column="to_click_time" property="clickTime" jdbcType="VARCHAR" /> |
| | | <result column="to_title" property="title" jdbcType="VARCHAR" /> |
| | | <result column="to_auction_id" property="auctionId" jdbcType="BIGINT" /> |
| | | <result column="to_manager_wangwang" property="managerWangWang" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="to_shop" property="shop" jdbcType="VARCHAR" /> |
| | | <result column="to_count" property="count" jdbcType="INTEGER" /> |
| | | <result column="to_price" property="price" jdbcType="DECIMAL" /> |
| | | <result column="to_order_state" property="orderState" jdbcType="VARCHAR" /> |
| | | <result column="to_order_type" property="orderType" jdbcType="VARCHAR" /> |
| | | <result column="to_iratio" property="iRatio" jdbcType="DECIMAL" /> |
| | | <result column="to_sratio" property="sRatio" jdbcType="DECIMAL" /> |
| | | <result column="to_payment" property="payment" jdbcType="DECIMAL" /> |
| | | <result column="to_estimate" property="estimate" jdbcType="DECIMAL" /> |
| | | <result column="to_settlement" property="settlement" jdbcType="DECIMAL" /> |
| | | <result column="to_eIncome" property="eIncome" jdbcType="DECIMAL" /> |
| | | <result column="to_settlement_time" property="settlementTime" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="to_tk_rate" property="tkRate" jdbcType="DECIMAL" /> |
| | | <result column="to_tk_money" property="tkMoney" jdbcType="DECIMAL" /> |
| | | <result column="to_technology_support_percent" property="technologySupportPercent" |
| | | jdbcType="DECIMAL" /> |
| | | <result column="to_subsidy_ratio" property="subsidyRatio" |
| | | jdbcType="DECIMAL" /> |
| | | <result column="to_subsidy" property="subsidy" jdbcType="DECIMAL" /> |
| | | <result column="to_subsidy_type" property="subsidyType" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="to_transaction_platform" property="transactionPlatform" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="to_third_service" property="thirdService" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="to_order_id" property="orderId" jdbcType="VARCHAR" /> |
| | | <result column="to_class_name" property="className" jdbcType="VARCHAR" /> |
| | | <result column="to_source_media_id" property="sourceMediaId" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="to_source_media_name" property="sourceMediaName" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="to_ad_position_id" property="adPositionId" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="to_ad_position_name" property="adPositionName" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="to_latest_updatetime" property="latestUpdateTime" |
| | | jdbcType="TIMESTAMP" /> |
| | | <result column="to_orderby" property="orderBy" jdbcType="INTEGER" /> |
| | | <result column="to_relation_id" property="relationId" jdbcType="VARCHAR" /> |
| | | <result column="to_special_id" property="specialId" jdbcType="VARCHAR" /> |
| | | <result column="to_trade_id" property="tradeId" jdbcType="VARCHAR" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">to_id,to_create_time,to_click_time,to_title,to_auction_id,to_manager_wangwang,to_shop,to_count,to_price,to_order_state,to_order_type,to_iratio,to_sratio,to_payment,to_estimate,to_settlement,to_eIncome,to_settlement_time,to_tk_rate,to_tk_money,to_technology_support_percent,to_subsidy_ratio,to_subsidy,to_subsidy_type,to_transaction_platform,to_third_service,to_order_id,to_class_name,to_source_media_id,to_source_media_name,to_ad_position_id,to_ad_position_name,to_latest_updatetime,to_orderby,to_relation_id,to_special_id,to_trade_id |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_taobao_order where to_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <select id="selectTaoBaoOrderByOrderId" resultMap="BaseResultMap" |
| | | parameterType="java.lang.String"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_taobao_order where to_order_id = #{0} for update |
| | | </select> |
| | | <select id="selectLatestByAuctionId" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_taobao_order where to_auction_id = #{0} order by to_id |
| | | desc limit 1 |
| | | </select> |
| | | |
| | | <select id="selectTaoBaoOrderByTradeId" resultMap="BaseResultMap" |
| | | parameterType="java.lang.String"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_taobao_order where to_trade_id = #{0} for update |
| | | </select> |
| | | |
| | | |
| | | <select id="listLongTimeNoUpdateOrders" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_taobao_order t WHERE t.`to_order_state`='订单付款' |
| | | AND UNIX_TIMESTAMP(t.`to_create_time`) <![CDATA[ < ]]> |
| | | UNIX_TIMESTAMP()-60*60*24*15 AND (t.`to_latest_updatetime` IS NULL OR |
| | | UNIX_TIMESTAMP(t.`to_latest_updatetime`)<![CDATA[ < ]]> |
| | | UNIX_TIMESTAMP()-60*60*24*2) ORDER BY t.`to_create_time` DESC limit |
| | | #{start},#{count} |
| | | </select> |
| | | |
| | | <select id="listByTradeId" resultMap="BaseResultMap" |
| | | parameterType="java.lang.String"> |
| | | select * from yeshi_ec_taobao_order where |
| | | to_trade_id=#{0} |
| | | </select> |
| | | |
| | | |
| | | <select id="listAllOrder" resultMap="BaseResultMap"> |
| | | select * from yeshi_ec_taobao_order |
| | | <if test="orderNo!=null"> |
| | | where to_order_id=#{orderNo} |
| | | </if> |
| | | order by to_create_time desc |
| | | limit #{start},#{count} |
| | | </select> |
| | | |
| | | |
| | | <select id="countAllOrder" resultType="java.lang.Long"> |
| | | select count(to_id) from yeshi_ec_taobao_order |
| | | <if test="orderNo!=null"> |
| | | where to_order_id=#{orderNo} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="listBySettlementTime" resultMap="BaseResultMap"> |
| | | select * from yeshi_ec_taobao_order |
| | | where 1=1 |
| | | |
| | | <if test="minTime!=null"> |
| | | and UNIX_TIMESTAMP(to_settlement_time)*1000>=#{minTime} |
| | | </if> |
| | | |
| | | <if test="maxTime!=null"> |
| | | and #{maxTime}>UNIX_TIMESTAMP(to_settlement_time)*1000 |
| | | </if> |
| | | |
| | | order by to_settlement_time desc |
| | | limit #{start},#{count} |
| | | </select> |
| | | |
| | | |
| | | <select id="countBySettlementTime" resultType="java.lang.Long"> |
| | | select count(to_id) from yeshi_ec_taobao_order |
| | | where 1=1 |
| | | |
| | | <if test="minTime!=null"> |
| | | and UNIX_TIMESTAMP(to_settlement_time)*1000>=#{minTime} |
| | | </if> |
| | | |
| | | <if test="maxTime!=null"> |
| | | and #{maxTime}>UNIX_TIMESTAMP(to_settlement_time)*1000 |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_taobao_order where to_id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <delete id="deleteByOrderId" parameterType="java.lang.String">delete from |
| | | yeshi_ec_taobao_order where to_order_id = #{0} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoOrder" |
| | | useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_taobao_order |
| | | (to_id,to_create_time,to_click_time,to_title,to_auction_id,to_manager_wangwang,to_shop,to_count,to_price,to_order_state,to_order_type,to_iratio,to_sratio,to_payment,to_estimate,to_settlement,to_eIncome,to_settlement_time,to_tk_rate,to_tk_money,to_technology_support_percent,to_subsidy_ratio,to_subsidy,to_subsidy_type,to_transaction_platform,to_third_service,to_order_id,to_class_name,to_source_media_id,to_source_media_name,to_ad_position_id,to_ad_position_name,to_latest_updatetime,to_orderby,to_relation_id,to_special_id,to_trade_id) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{createTime,jdbcType=VARCHAR},#{clickTime,jdbcType=VARCHAR},#{title,jdbcType=VARCHAR},#{auctionId,jdbcType=BIGINT},#{managerWangWang,jdbcType=VARCHAR},#{shop,jdbcType=VARCHAR},#{count,jdbcType=INTEGER},#{price,jdbcType=DECIMAL},#{orderState,jdbcType=VARCHAR},#{orderType,jdbcType=VARCHAR},#{iRatio,jdbcType=DECIMAL},#{sRatio,jdbcType=DECIMAL},#{payment,jdbcType=DECIMAL},#{estimate,jdbcType=DECIMAL},#{settlement,jdbcType=DECIMAL},#{eIncome,jdbcType=DECIMAL},#{settlementTime,jdbcType=VARCHAR},#{tkRate,jdbcType=DECIMAL},#{tkMoney,jdbcType=DECIMAL},#{technologySupportPercent,jdbcType=DECIMAL},#{subsidyRatio,jdbcType=DECIMAL},#{subsidy,jdbcType=DECIMAL},#{subsidyType,jdbcType=VARCHAR},#{transactionPlatform,jdbcType=VARCHAR},#{thirdService,jdbcType=VARCHAR},#{orderId,jdbcType=VARCHAR},#{className,jdbcType=VARCHAR},#{sourceMediaId,jdbcType=VARCHAR},#{sourceMediaName,jdbcType=VARCHAR},#{adPositionId,jdbcType=VARCHAR},#{adPositionName,jdbcType=VARCHAR}, |
| | | #{latestUpdateTime,jdbcType=TIMESTAMP},#{orderBy,jdbcType=INTEGER}, |
| | | #{relationId,jdbcType=VARCHAR},#{specialId,jdbcType=VARCHAR} |
| | | ,#{tradeId,jdbcType=VARCHAR}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoOrder" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | | insert into yeshi_ec_taobao_order |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">to_id,</if> |
| | | <if test="createTime != null">to_create_time,</if> |
| | | <if test="clickTime != null">to_click_time,</if> |
| | | <if test="title != null">to_title,</if> |
| | | <if test="auctionId != null">to_auction_id,</if> |
| | | <if test="managerWangWang != null">to_manager_wangwang,</if> |
| | | <if test="shop != null">to_shop,</if> |
| | | <if test="count != null">to_count,</if> |
| | | <if test="price != null">to_price,</if> |
| | | <if test="orderState != null">to_order_state,</if> |
| | | <if test="orderType != null">to_order_type,</if> |
| | | <if test="iRatio != null">to_iratio,</if> |
| | | <if test="sRatio != null">to_sratio,</if> |
| | | <if test="payment != null">to_payment,</if> |
| | | <if test="estimate != null">to_estimate,</if> |
| | | <if test="settlement != null">to_settlement,</if> |
| | | <if test="eIncome != null">to_eIncome,</if> |
| | | <if test="settlementTime != null">to_settlement_time,</if> |
| | | <if test="tkRate != null">to_tk_rate,</if> |
| | | <if test="tkMoney != null">to_tk_money,</if> |
| | | <if test="technologySupportPercent != null">to_technology_support_percent,</if> |
| | | <if test="subsidyRatio != null">to_subsidy_ratio,</if> |
| | | <if test="subsidy != null">to_subsidy,</if> |
| | | <if test="subsidyType != null">to_subsidy_type,</if> |
| | | <if test="transactionPlatform != null">to_transaction_platform,</if> |
| | | <if test="thirdService != null">to_third_service,</if> |
| | | <if test="orderId != null">to_order_id,</if> |
| | | <if test="className != null">to_class_name,</if> |
| | | <if test="sourceMediaId != null">to_source_media_id,</if> |
| | | <if test="sourceMediaName != null">to_source_media_name,</if> |
| | | <if test="adPositionId != null">to_ad_position_id,</if> |
| | | <if test="adPositionName != null">to_ad_position_name,</if> |
| | | <if test="latestUpdateTime != null">to_latest_updatetime,</if> |
| | | <if test="orderBy != null">to_orderby,</if> |
| | | <if test="relationId != null">to_relation_id,</if> |
| | | <if test="specialId != null">to_special_id,</if> |
| | | <if test="tradeId != null">to_trade_id,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=VARCHAR},</if> |
| | | <if test="clickTime != null">#{clickTime,jdbcType=VARCHAR},</if> |
| | | <if test="title != null">#{title,jdbcType=VARCHAR},</if> |
| | | <if test="auctionId != null">#{auctionId,jdbcType=BIGINT},</if> |
| | | <if test="managerWangWang != null">#{managerWangWang,jdbcType=VARCHAR},</if> |
| | | <if test="shop != null">#{shop,jdbcType=VARCHAR},</if> |
| | | <if test="count != null">#{count,jdbcType=INTEGER},</if> |
| | | <if test="price != null">#{price,jdbcType=DECIMAL},</if> |
| | | <if test="orderState != null">#{orderState,jdbcType=VARCHAR},</if> |
| | | <if test="orderType != null">#{orderType,jdbcType=VARCHAR},</if> |
| | | <if test="iRatio != null">#{iRatio,jdbcType=DECIMAL},</if> |
| | | <if test="sRatio != null">#{sRatio,jdbcType=DECIMAL},</if> |
| | | <if test="payment != null">#{payment,jdbcType=DECIMAL},</if> |
| | | <if test="estimate != null">#{estimate,jdbcType=DECIMAL},</if> |
| | | <if test="settlement != null">#{settlement,jdbcType=DECIMAL},</if> |
| | | <if test="eIncome != null">#{eIncome,jdbcType=DECIMAL},</if> |
| | | <if test="settlementTime != null">#{settlementTime,jdbcType=VARCHAR},</if> |
| | | <if test="tkRate != null">#{tkRate,jdbcType=DECIMAL},</if> |
| | | <if test="tkMoney != null">#{tkMoney,jdbcType=DECIMAL},</if> |
| | | <if test="technologySupportPercent != null">#{technologySupportPercent,jdbcType=DECIMAL},</if> |
| | | <if test="subsidyRatio != null">#{subsidyRatio,jdbcType=DECIMAL},</if> |
| | | <if test="subsidy != null">#{subsidy,jdbcType=DECIMAL},</if> |
| | | <if test="subsidyType != null">#{subsidyType,jdbcType=VARCHAR},</if> |
| | | <if test="transactionPlatform != null">#{transactionPlatform,jdbcType=VARCHAR},</if> |
| | | <if test="thirdService != null">#{thirdService,jdbcType=VARCHAR},</if> |
| | | <if test="orderId != null">#{orderId,jdbcType=VARCHAR},</if> |
| | | <if test="className != null">#{className,jdbcType=VARCHAR},</if> |
| | | <if test="sourceMediaId != null">#{sourceMediaId,jdbcType=VARCHAR},</if> |
| | | <if test="sourceMediaName != null">#{sourceMediaName,jdbcType=VARCHAR},</if> |
| | | <if test="adPositionId != null">#{adPositionId,jdbcType=VARCHAR},</if> |
| | | <if test="adPositionName != null">#{adPositionName,jdbcType=VARCHAR},</if> |
| | | <if test="latestUpdateTime != null">#{latestUpdateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="orderBy != null">#{orderBy,jdbcType=INTEGER},</if> |
| | | <if test="relationId != null">#{relationId,jdbcType=VARCHAR},</if> |
| | | <if test="specialId != null">#{specialId,jdbcType=VARCHAR},</if> |
| | | <if test="tradeId != null">#{tradeId,jdbcType=VARCHAR}</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoOrder">update |
| | | yeshi_ec_taobao_order set to_create_time = |
| | | #{createTime,jdbcType=VARCHAR},to_click_time = |
| | | #{clickTime,jdbcType=VARCHAR},to_title = |
| | | #{title,jdbcType=VARCHAR},to_auction_id = |
| | | #{auctionId,jdbcType=BIGINT},to_manager_wangwang = |
| | | #{managerWangWang,jdbcType=VARCHAR},to_shop = |
| | | #{shop,jdbcType=VARCHAR},to_count = #{count,jdbcType=INTEGER},to_price |
| | | = #{price,jdbcType=DECIMAL},to_order_state = |
| | | #{orderState,jdbcType=VARCHAR},to_order_type = |
| | | #{orderType,jdbcType=VARCHAR},to_iratio = |
| | | #{iRatio,jdbcType=DECIMAL},to_sratio = |
| | | #{sRatio,jdbcType=DECIMAL},to_payment = |
| | | #{payment,jdbcType=DECIMAL},to_estimate = |
| | | #{estimate,jdbcType=DECIMAL},to_settlement = |
| | | #{settlement,jdbcType=DECIMAL},to_eIncome = |
| | | #{eIncome,jdbcType=DECIMAL},to_settlement_time = |
| | | #{settlementTime,jdbcType=VARCHAR},to_tk_rate = |
| | | #{tkRate,jdbcType=DECIMAL},to_tk_money = |
| | | #{tkMoney,jdbcType=DECIMAL},to_technology_support_percent = |
| | | #{technologySupportPercent,jdbcType=DECIMAL},to_subsidy_ratio = |
| | | #{subsidyRatio,jdbcType=DECIMAL},to_subsidy = |
| | | #{subsidy,jdbcType=DECIMAL},to_subsidy_type = |
| | | #{subsidyType,jdbcType=VARCHAR},to_transaction_platform = |
| | | #{transactionPlatform,jdbcType=VARCHAR},to_third_service = |
| | | #{thirdService,jdbcType=VARCHAR},to_order_id = |
| | | #{orderId,jdbcType=VARCHAR},to_class_name = |
| | | #{className,jdbcType=VARCHAR},to_source_media_id = |
| | | #{sourceMediaId,jdbcType=VARCHAR},to_source_media_name = |
| | | #{sourceMediaName,jdbcType=VARCHAR},to_ad_position_id = |
| | | #{adPositionId,jdbcType=VARCHAR},to_ad_position_name = |
| | | #{adPositionName,jdbcType=VARCHAR},to_latest_updatetime = |
| | | #{latestUpdateTime,jdbcType=TIMESTAMP},to_orderby= |
| | | #{orderBy,jdbcType=INTEGER},to_relation_id = |
| | | #{relationId,jdbcType=VARCHAR},to_special_id= |
| | | #{specialId,jdbcType=VARCHAR} ,to_trade_id |
| | | =#{tradeId,jdbcType=VARCHAR} where to_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoOrder"> |
| | | update yeshi_ec_taobao_order |
| | | <set> |
| | | <if test="createTime != null">to_create_time=#{createTime,jdbcType=VARCHAR},</if> |
| | | <if test="clickTime != null">to_click_time=#{clickTime,jdbcType=VARCHAR},</if> |
| | | <if test="title != null">to_title=#{title,jdbcType=VARCHAR},</if> |
| | | <if test="auctionId != null">to_auction_id=#{auctionId,jdbcType=BIGINT},</if> |
| | | <if test="managerWangWang != null">to_manager_wangwang=#{managerWangWang,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="shop != null">to_shop=#{shop,jdbcType=VARCHAR},</if> |
| | | <if test="count != null">to_count=#{count,jdbcType=INTEGER},</if> |
| | | <if test="price != null">to_price=#{price,jdbcType=DECIMAL},</if> |
| | | <if test="orderState != null">to_order_state=#{orderState,jdbcType=VARCHAR},</if> |
| | | <if test="orderType != null">to_order_type=#{orderType,jdbcType=VARCHAR},</if> |
| | | <if test="iRatio != null">to_iratio=#{iRatio,jdbcType=DECIMAL},</if> |
| | | <if test="sRatio != null">to_sratio=#{sRatio,jdbcType=DECIMAL},</if> |
| | | <if test="payment != null">to_payment=#{payment,jdbcType=DECIMAL},</if> |
| | | <if test="estimate != null">to_estimate=#{estimate,jdbcType=DECIMAL},</if> |
| | | <if test="settlement != null">to_settlement=#{settlement,jdbcType=DECIMAL},</if> |
| | | <if test="eIncome != null">to_eIncome=#{eIncome,jdbcType=DECIMAL},</if> |
| | | <if test="settlementTime != null">to_settlement_time=#{settlementTime,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="tkRate != null">to_tk_rate=#{tkRate,jdbcType=DECIMAL},</if> |
| | | <if test="tkMoney != null">to_tk_money=#{tkMoney,jdbcType=DECIMAL},</if> |
| | | <if test="technologySupportPercent != null">to_technology_support_percent=#{technologySupportPercent,jdbcType=DECIMAL}, |
| | | </if> |
| | | <if test="subsidyRatio != null">to_subsidy_ratio=#{subsidyRatio,jdbcType=DECIMAL},</if> |
| | | <if test="subsidy != null">to_subsidy=#{subsidy,jdbcType=DECIMAL},</if> |
| | | <if test="subsidyType != null">to_subsidy_type=#{subsidyType,jdbcType=VARCHAR},</if> |
| | | <if test="transactionPlatform != null">to_transaction_platform=#{transactionPlatform,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="thirdService != null">to_third_service=#{thirdService,jdbcType=VARCHAR},</if> |
| | | <if test="orderId != null">to_order_id=#{orderId,jdbcType=VARCHAR},</if> |
| | | <if test="className != null">to_class_name=#{className,jdbcType=VARCHAR},</if> |
| | | <if test="sourceMediaId != null">to_source_media_id=#{sourceMediaId,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="sourceMediaName != null">to_source_media_name=#{sourceMediaName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="adPositionId != null">to_ad_position_id=#{adPositionId,jdbcType=VARCHAR},</if> |
| | | <if test="adPositionName != null">to_ad_position_name=#{adPositionName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="latestUpdateTime != null">to_latest_updatetime=#{latestUpdateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="orderBy != null">to_orderby=#{orderBy,jdbcType=INTEGER},</if> |
| | | <if test="relationId != null">to_relation_id=#{relationId,jdbcType=VARCHAR},</if> |
| | | <if test="specialId != null">to_special_id=#{specialId,jdbcType=VARCHAR},</if> |
| | | <if test="id !=null">to_id =#{id,jdbcType=BIGINT},</if> |
| | | <if test="tradeId !=null">to_trade_id =#{tradeId,jdbcType=VARCHAR},</if> |
| | | </set> |
| | | where to_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <resultMap id="ResultMapExtral" type="com.yeshi.fanli.entity.admin.ReslutOrder"> |
| | | <id column="to_id" property="tboid" jdbcType="BIGINT" /> |
| | | <result column="to_create_time" property="createTime" jdbcType="VARCHAR" /> |
| | | <result column="to_click_time" property="clickTime" jdbcType="VARCHAR" /> |
| | | <result column="to_title" property="title" jdbcType="VARCHAR" /> |
| | | <result column="to_auction_id" property="auctionId" jdbcType="BIGINT" /> |
| | | <result column="to_manager_wangwang" property="managerWangWang" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="to_shop" property="shop" jdbcType="VARCHAR" /> |
| | | <result column="to_count" property="count" jdbcType="INTEGER" /> |
| | | <result column="to_price" property="price" jdbcType="DECIMAL" /> |
| | | <result column="to_order_state" property="orderState" jdbcType="VARCHAR" /> |
| | | <result column="to_order_type" property="orderType" jdbcType="VARCHAR" /> |
| | | <result column="to_iratio" property="iRatio" jdbcType="DECIMAL" /> |
| | | <result column="to_sratio" property="sRatio" jdbcType="DECIMAL" /> |
| | | <result column="to_payment" property="payment" jdbcType="DECIMAL" /> |
| | | <result column="to_estimate" property="estimate" jdbcType="DECIMAL" /> |
| | | <result column="to_settlement" property="settlement" jdbcType="DECIMAL" /> |
| | | <result column="to_eIncome" property="eIncome" jdbcType="DECIMAL" /> |
| | | <result column="to_settlement_time" property="settlementTime" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="to_tk_rate" property="tkRate" jdbcType="DECIMAL" /> |
| | | <result column="to_tk_money" property="tkMoney" jdbcType="DECIMAL" /> |
| | | <result column="to_technology_support_percent" property="technologySupportPercent" |
| | | jdbcType="DECIMAL" /> |
| | | <result column="to_subsidy_ratio" property="subsidyRatio" |
| | | jdbcType="DECIMAL" /> |
| | | <result column="to_subsidy" property="subsidy" jdbcType="DECIMAL" /> |
| | | <result column="to_subsidy_type" property="subsidyType" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="to_transaction_platform" property="transactionPlatform" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="to_third_service" property="thirdService" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="to_order_id" property="orderId" jdbcType="VARCHAR" /> |
| | | <result column="to_class_name" property="className" jdbcType="VARCHAR" /> |
| | | <result column="to_source_media_id" property="sourceMediaId" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="to_source_media_name" property="sourceMediaName" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="to_ad_position_id" property="adPositionId" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="to_ad_position_name" property="adPositionName" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="to_latest_updatetime" property="latestUpdateTime" |
| | | jdbcType="TIMESTAMP" /> |
| | | <association property="userInfo" column="uid" |
| | | javaType="com.yeshi.fanli.entity.bus.user.UserInfo"> |
| | | <id column="uid" property="id" jdbcType="BIGINT" /> |
| | | </association> |
| | | </resultMap> |
| | | <select id="countByOdrerType" resultType="java.util.HashMap">SELECT COUNT(to_id)AS |
| | | countTotal ,IFNULL(SUM(CASE WHEN `to_order_state` = '订单结算' THEN 1 WHEN |
| | | `to_order_state` = '订单成功' THEN 1 ELSE 0 END),0) AS countSettlement, |
| | | IFNULL(SUM(CASE WHEN `to_order_state` = '订单付款' THEN 1 ELSE 0 END),0) |
| | | AS countPayment, IFNULL(SUM(CASE WHEN `to_order_state` = '订单失效' THEN 1 |
| | | ELSE 0 END),0) AS countInvalid FROM `yeshi_ec_taobao_order` |
| | | </select> |
| | | <select id="countToday" resultType="java.lang.Integer">SELECT |
| | | COUNT(DISTINCT(tb.to_order_id)) FROM `yeshi_ec_taobao_order` tb WHERE <![CDATA[tb.`to_order_state`<>'订单失效' AND TO_DAYS(tb.`to_create_time`) = TO_DAYS(NOW())]]> |
| | | </select> |
| | | <select id="countYesterday" resultType="java.lang.Integer">SELECT |
| | | COUNT(DISTINCT(td.to_order_id))FROM `yeshi_ec_taobao_order` td WHERE <![CDATA[td.`to_order_state`<>'订单失效' AND TO_DAYS(NOW()) - TO_DAYS( td.`to_create_time`) = 1 ]]> |
| | | </select> |
| | | <select id="countEstimate" resultType="java.lang.Double">SELECT |
| | | IFNULL(SUM(t.to_estimate),0) FROM `yeshi_ec_taobao_order` t WHERE <![CDATA[ t.`to_order_state`<> '订单失效' ]]> |
| | | AND DATE_FORMAT(t.`to_create_time` , '%Y-%m-%d' )= #{date} |
| | | </select> |
| | | <select id="getStateByOrderIdAndPayment" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_taobao_order where to_order_id = #{orderId} and |
| | | to_payment = #{payment} |
| | | </select> |
| | | <sql id="Column_DateType"> |
| | | <if test="dateType == 1">DATE_FORMAT(t.`to_create_time`,'%Y-%m-%d') AS 'showDate' |
| | | </if> |
| | | <if test="dateType == 2">DATE_FORMAT(t.`to_create_time`,'%m') AS 'showDate'</if> |
| | | <if test="dateType == 3">DATE_FORMAT(t.`to_create_time`,'%Y') AS 'showDate'</if> |
| | | </sql> |
| | | <sql id="Count_Select_DateType"> |
| | | <if test="startTime != null and startTime != '' "> |
| | | AND DATE_FORMAT(t.`to_create_time`,'%Y-%m-%d')<![CDATA[ >= ]]>'${startTime}' |
| | | </if> |
| | | <if test="endTime != null and endTime != '' "> |
| | | AND DATE_FORMAT(t.`to_create_time`,'%Y-%m-%d') <![CDATA[ <= ]]>'${endTime}' |
| | | </if> |
| | | <if test="year != null and year != '' ">AND DATE_FORMAT(t.`to_create_time`,'%Y') = '${year}'</if> |
| | | </sql> |
| | | <sql id="Count_Group_DateType"> |
| | | <if test="dateType == 1">GROUP BY DATE_FORMAT(t.`to_create_time`,'%Y-%m-%d')</if> |
| | | <if test="dateType == 2">GROUP BY DATE_FORMAT(t.`to_create_time`,'%Y-%m')</if> |
| | | <if test="dateType == 3">GROUP BY DATE_FORMAT(t.`to_create_time`,'%Y')</if> |
| | | </sql> |
| | | <select id="countOrderNumber" resultType="java.util.HashMap"> |
| | | SELECT IFNULL(COUNT(t.`to_id`),0) AS showValue, |
| | | <include refid="Column_DateType" /> |
| | | FROM `yeshi_ec_taobao_order` t WHERE t.`to_create_time` IS NOT NULL |
| | | <include refid="Count_Select_DateType" /> |
| | | <include refid="Count_Group_DateType" /> |
| | | ORDER BY t.`to_create_time` |
| | | </select> |
| | | </mapper> |
| | | <?xml version="1.0" encoding="UTF-8"?>
|
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | |
|
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.taobao.TaoBaoOrderMapper">
|
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.taobao.TaoBaoOrder">
|
| | | <id column="to_id" property="id" jdbcType="BIGINT" />
|
| | | <result column="to_create_time" property="createTime" jdbcType="VARCHAR" />
|
| | | <result column="to_click_time" property="clickTime" jdbcType="VARCHAR" />
|
| | | <result column="to_pay_time" property="payTime" jdbcType="VARCHAR" />
|
| | | <result column="to_title" property="title" jdbcType="VARCHAR" />
|
| | | <result column="to_auction_id" property="auctionId" jdbcType="BIGINT" />
|
| | | <result column="to_manager_wangwang" property="managerWangWang"
|
| | | jdbcType="VARCHAR" />
|
| | | <result column="to_shop" property="shop" jdbcType="VARCHAR" />
|
| | | <result column="to_count" property="count" jdbcType="INTEGER" />
|
| | | <result column="to_price" property="price" jdbcType="DECIMAL" />
|
| | | <result column="to_order_state" property="orderState" jdbcType="VARCHAR" />
|
| | | <result column="to_order_type" property="orderType" jdbcType="VARCHAR" />
|
| | | <result column="to_iratio" property="iRatio" jdbcType="DECIMAL" />
|
| | | <result column="to_sratio" property="sRatio" jdbcType="DECIMAL" />
|
| | | <result column="to_payment" property="payment" jdbcType="DECIMAL" />
|
| | | <result column="to_estimate" property="estimate" jdbcType="DECIMAL" />
|
| | | <result column="to_settlement" property="settlement" jdbcType="DECIMAL" />
|
| | | <result column="to_eIncome" property="eIncome" jdbcType="DECIMAL" />
|
| | | <result column="to_settlement_time" property="settlementTime"
|
| | | jdbcType="VARCHAR" />
|
| | | <result column="to_tk_rate" property="tkRate" jdbcType="DECIMAL" />
|
| | | <result column="to_tk_money" property="tkMoney" jdbcType="DECIMAL" />
|
| | | <result column="to_technology_support_percent" property="technologySupportPercent"
|
| | | jdbcType="DECIMAL" />
|
| | | <result column="to_subsidy_ratio" property="subsidyRatio"
|
| | | jdbcType="DECIMAL" />
|
| | | <result column="to_subsidy" property="subsidy" jdbcType="DECIMAL" />
|
| | | <result column="to_subsidy_type" property="subsidyType"
|
| | | jdbcType="VARCHAR" />
|
| | | <result column="to_transaction_platform" property="transactionPlatform"
|
| | | jdbcType="VARCHAR" />
|
| | | <result column="to_third_service" property="thirdService"
|
| | | jdbcType="VARCHAR" />
|
| | | <result column="to_order_id" property="orderId" jdbcType="VARCHAR" />
|
| | | <result column="to_class_name" property="className" jdbcType="VARCHAR" />
|
| | | <result column="to_source_media_id" property="sourceMediaId"
|
| | | jdbcType="VARCHAR" />
|
| | | <result column="to_source_media_name" property="sourceMediaName"
|
| | | jdbcType="VARCHAR" />
|
| | | <result column="to_ad_position_id" property="adPositionId"
|
| | | jdbcType="VARCHAR" />
|
| | | <result column="to_ad_position_name" property="adPositionName"
|
| | | jdbcType="VARCHAR" />
|
| | | <result column="to_latest_updatetime" property="latestUpdateTime"
|
| | | jdbcType="TIMESTAMP" />
|
| | | <result column="to_orderby" property="orderBy" jdbcType="INTEGER" />
|
| | | <result column="to_relation_id" property="relationId" jdbcType="VARCHAR" />
|
| | | <result column="to_special_id" property="specialId" jdbcType="VARCHAR" />
|
| | | <result column="to_trade_id" property="tradeId" jdbcType="VARCHAR" />
|
| | | </resultMap>
|
| | | <sql id="Base_Column_List">to_id,to_create_time,to_click_time,to_pay_time,to_title,to_auction_id,to_manager_wangwang,to_shop,to_count,to_price,to_order_state,to_order_type,to_iratio,to_sratio,to_payment,to_estimate,to_settlement,to_eIncome,to_settlement_time,to_tk_rate,to_tk_money,to_technology_support_percent,to_subsidy_ratio,to_subsidy,to_subsidy_type,to_transaction_platform,to_third_service,to_order_id,to_class_name,to_source_media_id,to_source_media_name,to_ad_position_id,to_ad_position_name,to_latest_updatetime,to_orderby,to_relation_id,to_special_id,to_trade_id
|
| | | </sql>
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
| | | parameterType="java.lang.Long">
|
| | | select
|
| | | <include refid="Base_Column_List" />
|
| | | from yeshi_ec_taobao_order where to_id = #{id,jdbcType=BIGINT}
|
| | | </select>
|
| | | <select id="selectTaoBaoOrderByOrderId" resultMap="BaseResultMap"
|
| | | parameterType="java.lang.String">
|
| | | select
|
| | | <include refid="Base_Column_List" />
|
| | | from yeshi_ec_taobao_order where to_order_id = #{0} for update
|
| | | </select>
|
| | | <select id="selectLatestByAuctionId" resultMap="BaseResultMap"
|
| | | parameterType="java.lang.Long">
|
| | | select
|
| | | <include refid="Base_Column_List" />
|
| | | from yeshi_ec_taobao_order where to_auction_id = #{0} order by to_id
|
| | | desc limit 1
|
| | | </select>
|
| | |
|
| | | <select id="selectTaoBaoOrderByTradeId" resultMap="BaseResultMap"
|
| | | parameterType="java.lang.String">
|
| | | select
|
| | | <include refid="Base_Column_List" />
|
| | | from yeshi_ec_taobao_order where to_trade_id = #{0} for update
|
| | | </select>
|
| | |
|
| | |
|
| | | <select id="listLongTimeNoUpdateOrders" resultMap="BaseResultMap">
|
| | | SELECT * FROM yeshi_ec_taobao_order t WHERE t.`to_order_state`='订单付款'
|
| | | AND UNIX_TIMESTAMP(t.`to_create_time`) <![CDATA[ < ]]>
|
| | | UNIX_TIMESTAMP()-60*60*24*15 AND (t.`to_latest_updatetime` IS NULL OR
|
| | | UNIX_TIMESTAMP(t.`to_latest_updatetime`)<![CDATA[ < ]]>
|
| | | UNIX_TIMESTAMP()-60*60*24*2) ORDER BY t.`to_create_time` DESC limit
|
| | | #{start},#{count}
|
| | | </select>
|
| | |
|
| | | <select id="listByTradeId" resultMap="BaseResultMap"
|
| | | parameterType="java.lang.String">
|
| | | select * from yeshi_ec_taobao_order where
|
| | | to_trade_id=#{0}
|
| | | </select>
|
| | |
|
| | |
|
| | | <select id="listAllOrder" resultMap="BaseResultMap">
|
| | | select * from yeshi_ec_taobao_order
|
| | | <if test="orderNo!=null">
|
| | | where to_order_id=#{orderNo}
|
| | | </if>
|
| | | order by to_create_time desc
|
| | | limit #{start},#{count}
|
| | | </select>
|
| | |
|
| | |
|
| | | <select id="countAllOrder" resultType="java.lang.Long">
|
| | | select count(to_id) from yeshi_ec_taobao_order
|
| | | <if test="orderNo!=null">
|
| | | where to_order_id=#{orderNo}
|
| | | </if>
|
| | | </select>
|
| | | |
| | | <select id="listBySettlementTime" resultMap="BaseResultMap">
|
| | | select * from yeshi_ec_taobao_order
|
| | | where 1=1
|
| | | |
| | | <if test="minTime!=null">
|
| | | and UNIX_TIMESTAMP(to_settlement_time)*1000>=#{minTime}
|
| | | </if>
|
| | | |
| | | <if test="maxTime!=null">
|
| | | and #{maxTime}>UNIX_TIMESTAMP(to_settlement_time)*1000
|
| | | </if>
|
| | | |
| | | order by to_settlement_time desc
|
| | | limit #{start},#{count}
|
| | | </select>
|
| | | |
| | | |
| | | <select id="countBySettlementTime" resultType="java.lang.Long">
|
| | | select count(to_id) from yeshi_ec_taobao_order
|
| | | where 1=1
|
| | | |
| | | <if test="minTime!=null">
|
| | | and UNIX_TIMESTAMP(to_settlement_time)*1000>=#{minTime}
|
| | | </if>
|
| | | |
| | | <if test="maxTime!=null">
|
| | | and #{maxTime}>UNIX_TIMESTAMP(to_settlement_time)*1000
|
| | | </if>
|
| | | |
| | | </select>
|
| | | |
| | |
|
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
|
| | | yeshi_ec_taobao_order where to_id = #{id,jdbcType=BIGINT}
|
| | | </delete>
|
| | | <delete id="deleteByOrderId" parameterType="java.lang.String">delete from
|
| | | yeshi_ec_taobao_order where to_order_id = #{0}
|
| | | </delete>
|
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoOrder"
|
| | | useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_taobao_order
|
| | | (to_id,to_create_time,to_click_time,to_pay_time,to_title,to_auction_id,to_manager_wangwang,to_shop,to_count,to_price,to_order_state,to_order_type,to_iratio,to_sratio,to_payment,to_estimate,to_settlement,to_eIncome,to_settlement_time,to_tk_rate,to_tk_money,to_technology_support_percent,to_subsidy_ratio,to_subsidy,to_subsidy_type,to_transaction_platform,to_third_service,to_order_id,to_class_name,to_source_media_id,to_source_media_name,to_ad_position_id,to_ad_position_name,to_latest_updatetime,to_orderby,to_relation_id,to_special_id,to_trade_id)
|
| | | values
|
| | | (#{id,jdbcType=BIGINT},#{createTime,jdbcType=VARCHAR},#{clickTime,jdbcType=VARCHAR},#{payTime,jdbcType=VARCHAR},#{title,jdbcType=VARCHAR},#{auctionId,jdbcType=BIGINT},#{managerWangWang,jdbcType=VARCHAR},#{shop,jdbcType=VARCHAR},#{count,jdbcType=INTEGER},#{price,jdbcType=DECIMAL},#{orderState,jdbcType=VARCHAR},#{orderType,jdbcType=VARCHAR},#{iRatio,jdbcType=DECIMAL},#{sRatio,jdbcType=DECIMAL},#{payment,jdbcType=DECIMAL},#{estimate,jdbcType=DECIMAL},#{settlement,jdbcType=DECIMAL},#{eIncome,jdbcType=DECIMAL},#{settlementTime,jdbcType=VARCHAR},#{tkRate,jdbcType=DECIMAL},#{tkMoney,jdbcType=DECIMAL},#{technologySupportPercent,jdbcType=DECIMAL},#{subsidyRatio,jdbcType=DECIMAL},#{subsidy,jdbcType=DECIMAL},#{subsidyType,jdbcType=VARCHAR},#{transactionPlatform,jdbcType=VARCHAR},#{thirdService,jdbcType=VARCHAR},#{orderId,jdbcType=VARCHAR},#{className,jdbcType=VARCHAR},#{sourceMediaId,jdbcType=VARCHAR},#{sourceMediaName,jdbcType=VARCHAR},#{adPositionId,jdbcType=VARCHAR},#{adPositionName,jdbcType=VARCHAR},
|
| | | #{latestUpdateTime,jdbcType=TIMESTAMP},#{orderBy,jdbcType=INTEGER},
|
| | | #{relationId,jdbcType=VARCHAR},#{specialId,jdbcType=VARCHAR}
|
| | | ,#{tradeId,jdbcType=VARCHAR})
|
| | | </insert>
|
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoOrder"
|
| | | useGeneratedKeys="true" keyProperty="id">
|
| | | insert into yeshi_ec_taobao_order
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">to_id,</if>
|
| | | <if test="createTime != null">to_create_time,</if>
|
| | | <if test="clickTime != null">to_click_time,</if>
|
| | | <if test="payTime != null">to_pay_time,</if>
|
| | | <if test="title != null">to_title,</if>
|
| | | <if test="auctionId != null">to_auction_id,</if>
|
| | | <if test="managerWangWang != null">to_manager_wangwang,</if>
|
| | | <if test="shop != null">to_shop,</if>
|
| | | <if test="count != null">to_count,</if>
|
| | | <if test="price != null">to_price,</if>
|
| | | <if test="orderState != null">to_order_state,</if>
|
| | | <if test="orderType != null">to_order_type,</if>
|
| | | <if test="iRatio != null">to_iratio,</if>
|
| | | <if test="sRatio != null">to_sratio,</if>
|
| | | <if test="payment != null">to_payment,</if>
|
| | | <if test="estimate != null">to_estimate,</if>
|
| | | <if test="settlement != null">to_settlement,</if>
|
| | | <if test="eIncome != null">to_eIncome,</if>
|
| | | <if test="settlementTime != null">to_settlement_time,</if>
|
| | | <if test="tkRate != null">to_tk_rate,</if>
|
| | | <if test="tkMoney != null">to_tk_money,</if>
|
| | | <if test="technologySupportPercent != null">to_technology_support_percent,</if>
|
| | | <if test="subsidyRatio != null">to_subsidy_ratio,</if>
|
| | | <if test="subsidy != null">to_subsidy,</if>
|
| | | <if test="subsidyType != null">to_subsidy_type,</if>
|
| | | <if test="transactionPlatform != null">to_transaction_platform,</if>
|
| | | <if test="thirdService != null">to_third_service,</if>
|
| | | <if test="orderId != null">to_order_id,</if>
|
| | | <if test="className != null">to_class_name,</if>
|
| | | <if test="sourceMediaId != null">to_source_media_id,</if>
|
| | | <if test="sourceMediaName != null">to_source_media_name,</if>
|
| | | <if test="adPositionId != null">to_ad_position_id,</if>
|
| | | <if test="adPositionName != null">to_ad_position_name,</if>
|
| | | <if test="latestUpdateTime != null">to_latest_updatetime,</if>
|
| | | <if test="orderBy != null">to_orderby,</if>
|
| | | <if test="relationId != null">to_relation_id,</if>
|
| | | <if test="specialId != null">to_special_id,</if>
|
| | | <if test="tradeId != null">to_trade_id,</if>
|
| | | </trim>
|
| | | values
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if>
|
| | | <if test="createTime != null">#{createTime,jdbcType=VARCHAR},</if>
|
| | | <if test="clickTime != null">#{clickTime,jdbcType=VARCHAR},</if>
|
| | | <if test="payTime != null">#{payTime,jdbcType=VARCHAR},</if>
|
| | | <if test="title != null">#{title,jdbcType=VARCHAR},</if>
|
| | | <if test="auctionId != null">#{auctionId,jdbcType=BIGINT},</if>
|
| | | <if test="managerWangWang != null">#{managerWangWang,jdbcType=VARCHAR},</if>
|
| | | <if test="shop != null">#{shop,jdbcType=VARCHAR},</if>
|
| | | <if test="count != null">#{count,jdbcType=INTEGER},</if>
|
| | | <if test="price != null">#{price,jdbcType=DECIMAL},</if>
|
| | | <if test="orderState != null">#{orderState,jdbcType=VARCHAR},</if>
|
| | | <if test="orderType != null">#{orderType,jdbcType=VARCHAR},</if>
|
| | | <if test="iRatio != null">#{iRatio,jdbcType=DECIMAL},</if>
|
| | | <if test="sRatio != null">#{sRatio,jdbcType=DECIMAL},</if>
|
| | | <if test="payment != null">#{payment,jdbcType=DECIMAL},</if>
|
| | | <if test="estimate != null">#{estimate,jdbcType=DECIMAL},</if>
|
| | | <if test="settlement != null">#{settlement,jdbcType=DECIMAL},</if>
|
| | | <if test="eIncome != null">#{eIncome,jdbcType=DECIMAL},</if>
|
| | | <if test="settlementTime != null">#{settlementTime,jdbcType=VARCHAR},</if>
|
| | | <if test="tkRate != null">#{tkRate,jdbcType=DECIMAL},</if>
|
| | | <if test="tkMoney != null">#{tkMoney,jdbcType=DECIMAL},</if>
|
| | | <if test="technologySupportPercent != null">#{technologySupportPercent,jdbcType=DECIMAL},</if>
|
| | | <if test="subsidyRatio != null">#{subsidyRatio,jdbcType=DECIMAL},</if>
|
| | | <if test="subsidy != null">#{subsidy,jdbcType=DECIMAL},</if>
|
| | | <if test="subsidyType != null">#{subsidyType,jdbcType=VARCHAR},</if>
|
| | | <if test="transactionPlatform != null">#{transactionPlatform,jdbcType=VARCHAR},</if>
|
| | | <if test="thirdService != null">#{thirdService,jdbcType=VARCHAR},</if>
|
| | | <if test="orderId != null">#{orderId,jdbcType=VARCHAR},</if>
|
| | | <if test="className != null">#{className,jdbcType=VARCHAR},</if>
|
| | | <if test="sourceMediaId != null">#{sourceMediaId,jdbcType=VARCHAR},</if>
|
| | | <if test="sourceMediaName != null">#{sourceMediaName,jdbcType=VARCHAR},</if>
|
| | | <if test="adPositionId != null">#{adPositionId,jdbcType=VARCHAR},</if>
|
| | | <if test="adPositionName != null">#{adPositionName,jdbcType=VARCHAR},</if>
|
| | | <if test="latestUpdateTime != null">#{latestUpdateTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="orderBy != null">#{orderBy,jdbcType=INTEGER},</if>
|
| | | <if test="relationId != null">#{relationId,jdbcType=VARCHAR},</if>
|
| | | <if test="specialId != null">#{specialId,jdbcType=VARCHAR},</if>
|
| | | <if test="tradeId != null">#{tradeId,jdbcType=VARCHAR}</if>
|
| | | </trim>
|
| | | </insert>
|
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoOrder">update
|
| | | yeshi_ec_taobao_order set to_create_time =
|
| | | #{createTime,jdbcType=VARCHAR},to_click_time =
|
| | | #{clickTime,jdbcType=VARCHAR},to_pay_time =
|
| | | #{payTime,jdbcType=VARCHAR},to_title =
|
| | | #{title,jdbcType=VARCHAR},to_auction_id =
|
| | | #{auctionId,jdbcType=BIGINT},to_manager_wangwang =
|
| | | #{managerWangWang,jdbcType=VARCHAR},to_shop =
|
| | | #{shop,jdbcType=VARCHAR},to_count = #{count,jdbcType=INTEGER},to_price
|
| | | = #{price,jdbcType=DECIMAL},to_order_state =
|
| | | #{orderState,jdbcType=VARCHAR},to_order_type =
|
| | | #{orderType,jdbcType=VARCHAR},to_iratio =
|
| | | #{iRatio,jdbcType=DECIMAL},to_sratio =
|
| | | #{sRatio,jdbcType=DECIMAL},to_payment =
|
| | | #{payment,jdbcType=DECIMAL},to_estimate =
|
| | | #{estimate,jdbcType=DECIMAL},to_settlement =
|
| | | #{settlement,jdbcType=DECIMAL},to_eIncome =
|
| | | #{eIncome,jdbcType=DECIMAL},to_settlement_time =
|
| | | #{settlementTime,jdbcType=VARCHAR},to_tk_rate =
|
| | | #{tkRate,jdbcType=DECIMAL},to_tk_money =
|
| | | #{tkMoney,jdbcType=DECIMAL},to_technology_support_percent =
|
| | | #{technologySupportPercent,jdbcType=DECIMAL},to_subsidy_ratio =
|
| | | #{subsidyRatio,jdbcType=DECIMAL},to_subsidy =
|
| | | #{subsidy,jdbcType=DECIMAL},to_subsidy_type =
|
| | | #{subsidyType,jdbcType=VARCHAR},to_transaction_platform =
|
| | | #{transactionPlatform,jdbcType=VARCHAR},to_third_service =
|
| | | #{thirdService,jdbcType=VARCHAR},to_order_id =
|
| | | #{orderId,jdbcType=VARCHAR},to_class_name =
|
| | | #{className,jdbcType=VARCHAR},to_source_media_id =
|
| | | #{sourceMediaId,jdbcType=VARCHAR},to_source_media_name =
|
| | | #{sourceMediaName,jdbcType=VARCHAR},to_ad_position_id =
|
| | | #{adPositionId,jdbcType=VARCHAR},to_ad_position_name =
|
| | | #{adPositionName,jdbcType=VARCHAR},to_latest_updatetime =
|
| | | #{latestUpdateTime,jdbcType=TIMESTAMP},to_orderby=
|
| | | #{orderBy,jdbcType=INTEGER},to_relation_id =
|
| | | #{relationId,jdbcType=VARCHAR},to_special_id=
|
| | | #{specialId,jdbcType=VARCHAR} ,to_trade_id
|
| | | =#{tradeId,jdbcType=VARCHAR} where to_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoOrder">
|
| | | update yeshi_ec_taobao_order
|
| | | <set>
|
| | | <if test="createTime != null">to_create_time=#{createTime,jdbcType=VARCHAR},</if>
|
| | | <if test="clickTime != null">to_click_time=#{clickTime,jdbcType=VARCHAR},</if>
|
| | | <if test="payTime != null">to_pay_time=#{payTime,jdbcType=VARCHAR},</if>
|
| | | <if test="title != null">to_title=#{title,jdbcType=VARCHAR},</if>
|
| | | <if test="auctionId != null">to_auction_id=#{auctionId,jdbcType=BIGINT},</if>
|
| | | <if test="managerWangWang != null">to_manager_wangwang=#{managerWangWang,jdbcType=VARCHAR},
|
| | | </if>
|
| | | <if test="shop != null">to_shop=#{shop,jdbcType=VARCHAR},</if>
|
| | | <if test="count != null">to_count=#{count,jdbcType=INTEGER},</if>
|
| | | <if test="price != null">to_price=#{price,jdbcType=DECIMAL},</if>
|
| | | <if test="orderState != null">to_order_state=#{orderState,jdbcType=VARCHAR},</if>
|
| | | <if test="orderType != null">to_order_type=#{orderType,jdbcType=VARCHAR},</if>
|
| | | <if test="iRatio != null">to_iratio=#{iRatio,jdbcType=DECIMAL},</if>
|
| | | <if test="sRatio != null">to_sratio=#{sRatio,jdbcType=DECIMAL},</if>
|
| | | <if test="payment != null">to_payment=#{payment,jdbcType=DECIMAL},</if>
|
| | | <if test="estimate != null">to_estimate=#{estimate,jdbcType=DECIMAL},</if>
|
| | | <if test="settlement != null">to_settlement=#{settlement,jdbcType=DECIMAL},</if>
|
| | | <if test="eIncome != null">to_eIncome=#{eIncome,jdbcType=DECIMAL},</if>
|
| | | <if test="settlementTime != null">to_settlement_time=#{settlementTime,jdbcType=VARCHAR},
|
| | | </if>
|
| | | <if test="tkRate != null">to_tk_rate=#{tkRate,jdbcType=DECIMAL},</if>
|
| | | <if test="tkMoney != null">to_tk_money=#{tkMoney,jdbcType=DECIMAL},</if>
|
| | | <if test="technologySupportPercent != null">to_technology_support_percent=#{technologySupportPercent,jdbcType=DECIMAL},
|
| | | </if>
|
| | | <if test="subsidyRatio != null">to_subsidy_ratio=#{subsidyRatio,jdbcType=DECIMAL},</if>
|
| | | <if test="subsidy != null">to_subsidy=#{subsidy,jdbcType=DECIMAL},</if>
|
| | | <if test="subsidyType != null">to_subsidy_type=#{subsidyType,jdbcType=VARCHAR},</if>
|
| | | <if test="transactionPlatform != null">to_transaction_platform=#{transactionPlatform,jdbcType=VARCHAR},
|
| | | </if>
|
| | | <if test="thirdService != null">to_third_service=#{thirdService,jdbcType=VARCHAR},</if>
|
| | | <if test="orderId != null">to_order_id=#{orderId,jdbcType=VARCHAR},</if>
|
| | | <if test="className != null">to_class_name=#{className,jdbcType=VARCHAR},</if>
|
| | | <if test="sourceMediaId != null">to_source_media_id=#{sourceMediaId,jdbcType=VARCHAR},
|
| | | </if>
|
| | | <if test="sourceMediaName != null">to_source_media_name=#{sourceMediaName,jdbcType=VARCHAR},
|
| | | </if>
|
| | | <if test="adPositionId != null">to_ad_position_id=#{adPositionId,jdbcType=VARCHAR},</if>
|
| | | <if test="adPositionName != null">to_ad_position_name=#{adPositionName,jdbcType=VARCHAR},
|
| | | </if>
|
| | | <if test="latestUpdateTime != null">to_latest_updatetime=#{latestUpdateTime,jdbcType=TIMESTAMP},
|
| | | </if>
|
| | | <if test="orderBy != null">to_orderby=#{orderBy,jdbcType=INTEGER},</if>
|
| | | <if test="relationId != null">to_relation_id=#{relationId,jdbcType=VARCHAR},</if>
|
| | | <if test="specialId != null">to_special_id=#{specialId,jdbcType=VARCHAR},</if>
|
| | | <if test="id !=null">to_id =#{id,jdbcType=BIGINT},</if>
|
| | | <if test="tradeId !=null">to_trade_id =#{tradeId,jdbcType=VARCHAR},</if>
|
| | | </set>
|
| | | where to_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | | <resultMap id="ResultMapExtral" type="com.yeshi.fanli.entity.admin.ReslutOrder">
|
| | | <id column="to_id" property="tboid" jdbcType="BIGINT" />
|
| | | <result column="to_create_time" property="createTime" jdbcType="VARCHAR" />
|
| | | <result column="to_click_time" property="clickTime" jdbcType="VARCHAR" />
|
| | | <result column="to_pay_time" property="payTime" jdbcType="VARCHAR" />
|
| | | <result column="to_title" property="title" jdbcType="VARCHAR" />
|
| | | <result column="to_auction_id" property="auctionId" jdbcType="BIGINT" />
|
| | | <result column="to_manager_wangwang" property="managerWangWang"
|
| | | jdbcType="VARCHAR" />
|
| | | <result column="to_shop" property="shop" jdbcType="VARCHAR" />
|
| | | <result column="to_count" property="count" jdbcType="INTEGER" />
|
| | | <result column="to_price" property="price" jdbcType="DECIMAL" />
|
| | | <result column="to_order_state" property="orderState" jdbcType="VARCHAR" />
|
| | | <result column="to_order_type" property="orderType" jdbcType="VARCHAR" />
|
| | | <result column="to_iratio" property="iRatio" jdbcType="DECIMAL" />
|
| | | <result column="to_sratio" property="sRatio" jdbcType="DECIMAL" />
|
| | | <result column="to_payment" property="payment" jdbcType="DECIMAL" />
|
| | | <result column="to_estimate" property="estimate" jdbcType="DECIMAL" />
|
| | | <result column="to_settlement" property="settlement" jdbcType="DECIMAL" />
|
| | | <result column="to_eIncome" property="eIncome" jdbcType="DECIMAL" />
|
| | | <result column="to_settlement_time" property="settlementTime"
|
| | | jdbcType="VARCHAR" />
|
| | | <result column="to_tk_rate" property="tkRate" jdbcType="DECIMAL" />
|
| | | <result column="to_tk_money" property="tkMoney" jdbcType="DECIMAL" />
|
| | | <result column="to_technology_support_percent" property="technologySupportPercent"
|
| | | jdbcType="DECIMAL" />
|
| | | <result column="to_subsidy_ratio" property="subsidyRatio"
|
| | | jdbcType="DECIMAL" />
|
| | | <result column="to_subsidy" property="subsidy" jdbcType="DECIMAL" />
|
| | | <result column="to_subsidy_type" property="subsidyType"
|
| | | jdbcType="VARCHAR" />
|
| | | <result column="to_transaction_platform" property="transactionPlatform"
|
| | | jdbcType="VARCHAR" />
|
| | | <result column="to_third_service" property="thirdService"
|
| | | jdbcType="VARCHAR" />
|
| | | <result column="to_order_id" property="orderId" jdbcType="VARCHAR" />
|
| | | <result column="to_class_name" property="className" jdbcType="VARCHAR" />
|
| | | <result column="to_source_media_id" property="sourceMediaId"
|
| | | jdbcType="VARCHAR" />
|
| | | <result column="to_source_media_name" property="sourceMediaName"
|
| | | jdbcType="VARCHAR" />
|
| | | <result column="to_ad_position_id" property="adPositionId"
|
| | | jdbcType="VARCHAR" />
|
| | | <result column="to_ad_position_name" property="adPositionName"
|
| | | jdbcType="VARCHAR" />
|
| | | <result column="to_latest_updatetime" property="latestUpdateTime"
|
| | | jdbcType="TIMESTAMP" />
|
| | | <association property="userInfo" column="uid"
|
| | | javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
|
| | | <id column="uid" property="id" jdbcType="BIGINT" />
|
| | | </association>
|
| | | </resultMap>
|
| | | <select id="countByOdrerType" resultType="java.util.HashMap">SELECT COUNT(to_id)AS
|
| | | countTotal ,IFNULL(SUM(CASE WHEN `to_order_state` = '订单结算' THEN 1 WHEN
|
| | | `to_order_state` = '订单成功' THEN 1 ELSE 0 END),0) AS countSettlement,
|
| | | IFNULL(SUM(CASE WHEN `to_order_state` = '订单付款' THEN 1 ELSE 0 END),0)
|
| | | AS countPayment, IFNULL(SUM(CASE WHEN `to_order_state` = '订单失效' THEN 1
|
| | | ELSE 0 END),0) AS countInvalid FROM `yeshi_ec_taobao_order`
|
| | | </select>
|
| | | <select id="countToday" resultType="java.lang.Integer">SELECT
|
| | | COUNT(DISTINCT(tb.to_order_id)) FROM `yeshi_ec_taobao_order` tb WHERE <![CDATA[tb.`to_order_state`<>'订单失效' AND TO_DAYS(tb.`to_create_time`) = TO_DAYS(NOW())]]>
|
| | | </select>
|
| | | <select id="countYesterday" resultType="java.lang.Integer">SELECT
|
| | | COUNT(DISTINCT(td.to_order_id))FROM `yeshi_ec_taobao_order` td WHERE <![CDATA[td.`to_order_state`<>'订单失效' AND TO_DAYS(NOW()) - TO_DAYS( td.`to_create_time`) = 1 ]]>
|
| | | </select>
|
| | | <select id="countEstimate" resultType="java.lang.Double">SELECT
|
| | | IFNULL(SUM(t.to_estimate),0) FROM `yeshi_ec_taobao_order` t WHERE <![CDATA[ t.`to_order_state`<> '订单失效' ]]>
|
| | | AND DATE_FORMAT(t.`to_create_time` , '%Y-%m-%d' )= #{date}
|
| | | </select>
|
| | | <select id="getStateByOrderIdAndPayment" resultMap="BaseResultMap">
|
| | | select
|
| | | <include refid="Base_Column_List" />
|
| | | from yeshi_ec_taobao_order where to_order_id = #{orderId} and
|
| | | to_payment = #{payment}
|
| | | </select>
|
| | | <sql id="Column_DateType">
|
| | | <if test="dateType == 1">DATE_FORMAT(t.`to_create_time`,'%Y-%m-%d') AS 'showDate'
|
| | | </if>
|
| | | <if test="dateType == 2">DATE_FORMAT(t.`to_create_time`,'%m') AS 'showDate'</if>
|
| | | <if test="dateType == 3">DATE_FORMAT(t.`to_create_time`,'%Y') AS 'showDate'</if>
|
| | | </sql>
|
| | | <sql id="Count_Select_DateType">
|
| | | <if test="startTime != null and startTime != '' ">
|
| | | AND DATE_FORMAT(t.`to_create_time`,'%Y-%m-%d')<![CDATA[ >= ]]>'${startTime}'
|
| | | </if>
|
| | | <if test="endTime != null and endTime != '' ">
|
| | | AND DATE_FORMAT(t.`to_create_time`,'%Y-%m-%d') <![CDATA[ <= ]]>'${endTime}'
|
| | | </if>
|
| | | <if test="year != null and year != '' ">AND DATE_FORMAT(t.`to_create_time`,'%Y') = '${year}'</if>
|
| | | </sql>
|
| | | <sql id="Count_Group_DateType">
|
| | | <if test="dateType == 1">GROUP BY DATE_FORMAT(t.`to_create_time`,'%Y-%m-%d')</if>
|
| | | <if test="dateType == 2">GROUP BY DATE_FORMAT(t.`to_create_time`,'%Y-%m')</if>
|
| | | <if test="dateType == 3">GROUP BY DATE_FORMAT(t.`to_create_time`,'%Y')</if>
|
| | | </sql>
|
| | | <select id="countOrderNumber" resultType="java.util.HashMap">
|
| | | SELECT IFNULL(COUNT(t.`to_id`),0) AS showValue,
|
| | | <include refid="Column_DateType" />
|
| | | FROM `yeshi_ec_taobao_order` t WHERE t.`to_create_time` IS NOT NULL
|
| | | <include refid="Count_Select_DateType" />
|
| | | <include refid="Count_Group_DateType" />
|
| | | ORDER BY t.`to_create_time`
|
| | | </select>
|
| | | </mapper>
|
| | |
| | | * @return
|
| | | */
|
| | | private int addBrandGoodsTB(BrandInfo brandInfo) {
|
| | | String searchKey = brandInfo.getSearchKey();
|
| | | if (StringUtil.isNullOrEmpty(searchKey))
|
| | | searchKey = brandInfo.getName();
|
| | | |
| | | Date date = new Date();
|
| | | SearchFilter filter = new SearchFilter();
|
| | | filter.setKey(brandInfo.getName());
|
| | | filter.setKey(searchKey);
|
| | | filter.setPage(1);
|
| | | filter.setPageSize(100);
|
| | | filter.setTmall(true);
|
| | |
| | | * @return
|
| | | */
|
| | | private int addBrandGoodsJD(BrandInfo brandInfo) {
|
| | | String searchKey = brandInfo.getSearchKey();
|
| | | if (StringUtil.isNullOrEmpty(searchKey))
|
| | | searchKey = brandInfo.getName();
|
| | | |
| | | int count = 0;
|
| | | JDSearchResult result = null;
|
| | | String way = configService.get("jd_api_search_key");
|
| | |
| | | for (int i=0; i < 2;i ++) {
|
| | | if ("1".equals(way)) {
|
| | | JDFilter filterAPI = new JDFilter();
|
| | | filterAPI.setKeyword(SearchFilterUtil.filterSearchContent(brandInfo.getName()));
|
| | | filterAPI.setKeyword(SearchFilterUtil.filterSearchContent(searchKey));
|
| | | filterAPI.setPageIndex(1);
|
| | | filterAPI.setPageSize(30);
|
| | | filterAPI.setSort(JDFilter.SORT_DESC);
|
| | |
| | | } else {
|
| | | // 网页爬取
|
| | | JDSearchFilter jdfilter = new JDSearchFilter();
|
| | | jdfilter.setKey(SearchFilterUtil.filterSearchContent(brandInfo.getName()));
|
| | | jdfilter.setKey(SearchFilterUtil.filterSearchContent(searchKey));
|
| | | jdfilter.setPageNo(1);
|
| | | jdfilter.setPageSize(30);
|
| | | jdfilter.setSort(JDSearchFilter.SORT_DESC);
|
| | |
| | | * @return
|
| | | */
|
| | | private int addBrandGoodsPDD(BrandInfo brandInfo) {
|
| | | String searchKey = brandInfo.getSearchKey();
|
| | | if (StringUtil.isNullOrEmpty(searchKey))
|
| | | searchKey = brandInfo.getName();
|
| | | |
| | | PDDSearchFilter pddfilter = new PDDSearchFilter();
|
| | | pddfilter.setKw(brandInfo.getName());
|
| | | pddfilter.setKw(searchKey);
|
| | | pddfilter.setPage(1);
|
| | | pddfilter.setPageSize(100);
|
| | | pddfilter.setSortType(6);
|
| | |
| | | @Override
|
| | | public void saveObject(MultipartFile file, BrandInfo record) throws BrandInfoException {
|
| | | String name = record.getName();
|
| | | if (name == null || name.trim().length() == 0)
|
| | | if (StringUtil.isNullOrEmpty(name))
|
| | | throw new BrandInfoException(1, "名称不能为空");
|
| | |
|
| | | String searchKey = record.getSearchKey();
|
| | | if (StringUtil.isNullOrEmpty(searchKey))
|
| | | record.setSearchKey(name);
|
| | | |
| | | Integer state = record.getState();
|
| | | if (state == null)
|
| | | record.setState(0);
|
| | |
| | | return;
|
| | |
|
| | | for (BrandInfo brandInfo : list) {
|
| | | String key = brandInfo.getName();
|
| | | if (StringUtil.isNullOrEmpty(key))
|
| | | String name = brandInfo.getName();
|
| | | String searchKey = brandInfo.getSearchKey();
|
| | | if (StringUtil.isNullOrEmpty(name) && StringUtil.isNullOrEmpty(searchKey))
|
| | | continue;
|
| | |
|
| | | // 添加商品
|
| | |
| | | */
|
| | | @Override
|
| | | public void addBrandShopPDD(BrandInfo brandInfo) {
|
| | | String searchKey = brandInfo.getSearchKey();
|
| | | if (StringUtil.isNullOrEmpty(searchKey))
|
| | | searchKey = brandInfo.getName();
|
| | | |
| | | ShopInfoVO shopInfoVO = null;
|
| | | String key = brandInfo.getName();
|
| | | PDDSearchFilter pddfilter = new PDDSearchFilter();
|
| | | pddfilter.setKw(key);
|
| | | pddfilter.setKw(searchKey);
|
| | | pddfilter.setPage(1);
|
| | | pddfilter.setPageSize(100);
|
| | | pddfilter.setSortType(6);
|
| | |
| | | if (goodsList != null && goodsList.size() > 0) {
|
| | | for (PDDGoodsDetail goods : goodsList) {
|
| | | String mallName = goods.getMallName();
|
| | | if(goods.getMallId() != null && !StringUtil.isNullOrEmpty(mallName) && mallName.contains(key)){
|
| | | if(goods.getMallId() != null && !StringUtil.isNullOrEmpty(mallName) && mallName.contains(brandInfo.getName())){
|
| | | shopInfoVO = new ShopInfoVO();
|
| | | shopInfoVO.setId(goods.getMallId().toString());
|
| | | shopInfoVO.setShopName(mallName);
|
| | |
| | | long count = hongBaoV2CountMapper.countNumberByUid(uid);
|
| | | return (int) count;
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public BigDecimal countRebateCouponMoney() {
|
| | | return hongBaoV2CountMapper.countRebateCouponMoney();
|
| | | }
|
| | | |
| | | @Override
|
| | | public long countRebateOrder(Long uid) {
|
| | | return hongBaoV2CountMapper.countRebateOrder(uid);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public long countShareOrInviteOrder(Long uid) {
|
| | | return hongBaoV2CountMapper.countShareOrInviteOrder(uid);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public BigDecimal sumAlreadyGetMoneyByUid(Long uid, List<Integer> typeList, Date minGetTime, Date maxGetTime) {
|
| | | return hongBaoV2CountMapper.sumAlreadyGetMoneyByUid(uid, typeList, minGetTime, maxGetTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countAlreadyGetMoneyByUid(Long uid, List<Integer> typeList, Date minGetTime, Date maxGetTime) {
|
| | | return hongBaoV2CountMapper.countAlreadyGetMoneyByUid(uid, typeList, minGetTime, maxGetTime);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | public List<Special> listByPlaceKey(String placeKey, Integer platform, Integer versionCode) {
|
| | | return specialMapper.listByPlaceKey(placeKey, null, platform, versionCode);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public List<Special> listByPlaceKeyList(long start, int count, List<String> list, Integer platform, Integer versionCode) {
|
| | | return specialMapper.listByPlaceKeyList(start, count, list, null, platform, versionCode);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public long countByPlaceKeyList(List<String> list, Integer platform, Integer versionCode) {
|
| | | return specialMapper.countByPlaceKeyList(list, null, platform, versionCode);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 处理 数据
|
| | |
| | | // 手机号更换绑定的7天内不能提现
|
| | | if (history != null && !history.getFirst()
|
| | | && (System.currentTimeMillis() - history.getCreateTime().getTime()) < 1000 * 60 * 60 * 24 * 7L) {
|
| | | throw new AlipayAccountException(111, "修改手机号7天内不允许修改支付宝账号");
|
| | | throw new AlipayAccountException(111, "修改手机号后,7天内无法更换提现账号");
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | package com.yeshi.fanli.service.impl.order.tb;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.Collections;
|
| | | import java.util.Comparator;
|
| | | import java.util.Date;
|
| | | import java.util.HashSet;
|
| | | import java.util.Iterator;
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void bindUid(Long uid, Long deviceActiveId) {
|
| | | DeviceTokenOPPO oldOppo = deviceTokenOPPOMapper.selectByDeviceActiveId(deviceActiveId);
|
| | | if (oldOppo != null) {
|
| | | DeviceTokenOPPO update = new DeviceTokenOPPO();
|
| | | update.setId(oldOppo.getId());
|
| | | update.setUid(uid);
|
| | | update.setUpdateTime(new Date());
|
| | | deviceTokenOPPOMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countDeviceToken(List<Integer> versionList) {
|
| | | return deviceTokenOPPOMapper.countDeviceToken(versionList);
|
| | | }
|
| | |
| | | String targetPath = FileUtil.getCacheDir() + "/share_" + uid + "_" + System.currentTimeMillis() + ".jpg";
|
| | | String erCodeTempPath = FileUtil.getCacheDir() + "/" + uid + "_" + System.currentTimeMillis() + ".jpg";
|
| | |
|
| | | String erCode = HttpUtil.getShortLink("http://" + Constant.wxGZConfig.getLoginHost() + "/"
|
| | | String erCode = ("http://" + Constant.wxGZConfig.getLoginHost() + "/"
|
| | | + Constant.systemCommonConfig.getProjectName() + "/client/threeShareNew?uid=" + uid);
|
| | | // 生成
|
| | | try {
|
| | |
| | | String targetPath = FileUtil.getCacheDir() + "/share_" + uid + "_" + System.currentTimeMillis() + ".jpg";
|
| | | String erCodeTempPath = FileUtil.getCacheDir() + "/" + uid + "_" + System.currentTimeMillis() + ".jpg";
|
| | |
|
| | | String erCode = HttpUtil.getShortLink("http://" + Constant.wxGZConfig.getLoginHost() + "/"
|
| | | String erCode = ("http://" + Constant.wxGZConfig.getLoginHost() + "/"
|
| | | + Constant.systemCommonConfig.getProjectName() + "/client/threeShareNew?uid=" + uid);
|
| | | // 生成
|
| | | try {
|
| | |
| | | targetPath = FileUtil.getCacheDir() + "/share_" + uid + "_" + System.currentTimeMillis() + ".jpg";
|
| | | erCodeTempPath = FileUtil.getCacheDir() + "/" + uid + "_" + System.currentTimeMillis() + ".jpg";
|
| | |
|
| | | String erCode = HttpUtil.getShortLink("http://" + Constant.wxGZConfig.getLoginHost() + "/"
|
| | | String erCode = ("http://" + Constant.wxGZConfig.getLoginHost() + "/"
|
| | | + Constant.systemCommonConfig.getProjectName() + "/client/threeShareNew?uid=" + uid);
|
| | | // 生成
|
| | | try {
|
| | |
| | | } else {
|
| | | targetPath = FileUtil.getCacheDir() + "/share_" + uid + "_" + System.currentTimeMillis() + ".jpg";
|
| | | erCodeTempPath = FileUtil.getCacheDir() + "/" + uid + "_" + System.currentTimeMillis() + ".jpg";
|
| | | String erCode = HttpUtil.getShortLink("http://" + Constant.wxGZConfig.getLoginHost() + "/"
|
| | | String erCode = ("http://" + Constant.wxGZConfig.getLoginHost() + "/"
|
| | | + Constant.systemCommonConfig.getProjectName() + "/client/threeShareNew?uid=" + uid);
|
| | | // 生成
|
| | | try {
|
| | |
| | | import com.yeshi.fanli.service.inter.user.integral.IntegralTaskRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.integral.IntegralTaskService;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.annotation.RequestSerializableByKey;
|
| | | import com.yeshi.fanli.util.annotation.RequestSerializableByKeyService;
|
| | | import com.yeshi.fanli.util.annotation.integral.IntegralGetFrequencyLimit;
|
| | | import com.yeshi.fanli.util.annotation.integral.IntegralGetVersionLimit;
|
| | |
|
| | |
| | | @Resource
|
| | | private IntegralTaskRankService integralTaskRankService;
|
| | |
|
| | | // TODO 有bug
|
| | | private UserInfo getBossByUid(Long uid) {
|
| | | return threeSaleMapper.selectBoss(uid);
|
| | | }
|
| | |
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @RequestSerializableByKeyService(key = "#uid + '-' + #event")
|
| | | @Override
|
| | | public IntegralTaskRecord addEventStatistic(Long uid, String event) throws IntegralGetException {
|
| | | Date nowDate = new Date();
|
| | |
| | | }
|
| | |
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @RequestSerializableByKeyService(key = "#uid")
|
| | | @Async()
|
| | | @Override
|
| | | public void addInviteLevelOne(Long uid, Long workerId) {
|
| | |
| | | * @param uid
|
| | | */
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @RequestSerializableByKeyService(key = "#uid")
|
| | | @Async()
|
| | | private void addInviteLevelTwo(Long uid) {
|
| | | try {
|
| | |
| | | }
|
| | |
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @RequestSerializableByKeyService(key = "#uid")
|
| | | @Async()
|
| | | @Override
|
| | | public void addGiveRebateCoupon(Long uid) {
|
| | |
| | | }
|
| | |
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @RequestSerializableByKeyService(key = "#uid")
|
| | | @Async()
|
| | | @Override
|
| | | public void addGiveFreeCoupon(Long uid) {
|
| | |
| | | }
|
| | |
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @RequestSerializableByKeyService(key = "#uid")
|
| | | @Async()
|
| | | @Override
|
| | | public void addGiveTaoLiJin(Long uid) {
|
| | |
| | | * @param uid
|
| | | */
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @RequestSerializableByKeyService(key = "#uid")
|
| | | @Async()
|
| | | private void addCouponRebateLevelOne(Long uid) {
|
| | | try {
|
| | |
| | | * @param uid
|
| | | */
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @RequestSerializableByKeyService(key = "#uid")
|
| | | @Async()
|
| | | private void addCouponRebateLevelTwo(Long uid) {
|
| | | try {
|
| | |
| | | }
|
| | |
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @RequestSerializableByKeyService(key = "#uid")
|
| | | @Async()
|
| | | @Override
|
| | | public void addRebateOrder(Long uid) {
|
| | |
| | | * @param uid
|
| | | */
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @RequestSerializableByKeyService(key = "#uid")
|
| | | @Async()
|
| | | @Override
|
| | | public void addInviteOrderLevelOne(Long uid) {
|
| | |
| | | * @param uid
|
| | | */
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @RequestSerializableByKeyService(key = "#uid")
|
| | | @Async()
|
| | | @Override
|
| | | public void addInviteOrderLevelTwo(Long uid) {
|
| | |
| | | }
|
| | |
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @RequestSerializableByKeyService(key = "#uid")
|
| | | @Async()
|
| | | @Override
|
| | | public void addShareOrder(Long uid) {
|
| | |
| | | }
|
| | |
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @RequestSerializableByKeyService(key = "#uid")
|
| | | @Async()
|
| | | @Override
|
| | | public void addBindWeiXin(Long uid) {
|
| | |
| | | }
|
| | |
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @RequestSerializableByKeyService(key = "#uid")
|
| | | @Async()
|
| | | @Override
|
| | | public void addBindPhone(Long uid) {
|
| | |
| | | }
|
| | |
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @RequestSerializableByKeyService(key = "#uid")
|
| | | @Async()
|
| | | @Override
|
| | | public void addBindTaoBao(Long uid) {
|
| | |
| | | }
|
| | |
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @RequestSerializableByKeyService(key = "#uid")
|
| | | @Async()
|
| | | @Override
|
| | | public void addSetWeiXinNum(Long uid) {
|
| | |
| | | }
|
| | |
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @RequestSerializableByKeyService(key = "#uid")
|
| | | @Async()
|
| | | @Override
|
| | | public void addSetGender(Long uid) {
|
| | |
| | | }
|
| | |
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @RequestSerializableByKeyService(key = "#uid")
|
| | | @Async()
|
| | | @Override
|
| | | public void addSetPortrait(Long uid) {
|
| | |
| | | }
|
| | |
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @RequestSerializableByKeyService(key = "#uid")
|
| | | @Async()
|
| | | @Override
|
| | | public void addSetNickname(Long uid) {
|
| | |
| | | }
|
| | |
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @RequestSerializableByKeyService(key = "#uid")
|
| | | @Async()
|
| | | @Override
|
| | | public void addBindAlipay(Long uid) {
|
| | |
| | | }
|
| | |
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @RequestSerializableByKeyService(key = "#uid")
|
| | | @Async()
|
| | | @Override
|
| | | public void addInviteActivate(Long uid) {
|
| | |
| | | FrequencyEnum frequency = integralTask.getFrequency();
|
| | | if (frequency == FrequencyEnum.everyday) {
|
| | | int num = integralTaskRecordMapper.countByTaskIdTodayNum(uid, taskId,
|
| | | TimeUtil.getWholeTime(record.getCreateTime().getTime()));
|
| | | TimeUtil.getWholeTime(record.getCreateTime().getTime()), record.getId());
|
| | | if (num <= 0)
|
| | | num = 1;
|
| | | String title = taskClass.getName() + "-" + integralTask.getName() + "-第" + num + "次";
|
| | |
| | |
|
| | | /**
|
| | | * 统计用户红包数量
|
| | | * |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * 奖励券金额
|
| | | * |
| | | * @return
|
| | | */
|
| | | public BigDecimal countRebateCouponMoney();
|
| | |
|
| | | /**
|
| | | * 统计返利订单
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public long countRebateOrder(Long uid);
|
| | |
|
| | | /**
|
| | | * 统计分享+ 邀请订单
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public long countShareOrInviteOrder(Long uid);
|
| | | |
| | | /**
|
| | | * 统计已到账
|
| | | * |
| | | * @param uid
|
| | | * @param typeList
|
| | | * @param minGetTime
|
| | | * @param maxGetTime
|
| | | * @return
|
| | | */
|
| | | public BigDecimal sumAlreadyGetMoneyByUid(Long uid, List<Integer> typeList, Date minGetTime, Date maxGetTime);
|
| | |
|
| | | public long countAlreadyGetMoneyByUid(Long uid, List<Integer> typeList, Date minGetTime, Date maxGetTime);
|
| | |
|
| | | }
|
| | |
| | | */
|
| | | public List<Special> listByVersion(long start, int count, String card, Integer platform, Integer versionCode);
|
| | |
|
| | |
|
| | | /**
|
| | | * 专题版本区分 传递多个位置
|
| | | * @param list
|
| | | * @param platform
|
| | | * @param versionCode
|
| | | * @return
|
| | | */
|
| | | public List<Special> listByPlaceKeyList(long start, int count, List<String> list, Integer platform, Integer versionCode);
|
| | |
|
| | |
|
| | | public long countByPlaceKeyList(List<String> list, Integer platform, Integer versionCode);
|
| | |
|
| | | }
|
| | |
| | | public void unBindUid(Long uid, Long deviceActiveId);
|
| | |
|
| | | /**
|
| | | * 绑定设备
|
| | | * |
| | | * @param uid
|
| | | * @param deviceActiveId
|
| | | */
|
| | | public void bindUid(Long uid, Long deviceActiveId);
|
| | |
|
| | | /**
|
| | | * 计算所有的设备
|
| | | *
|
| | | * @return
|
| | |
| | | doJDOrderJob();// 京东订单处理
|
| | | doPDDOrderJob();// 拼多多订单处理
|
| | | doImportantTaoBaoGoodsUpdateJob();// 淘宝重要商品的信息更新
|
| | | doHongBaoRecieveIntegralGetJob();// 返利到账,金币增加
|
| | | doHongBaoRecieveIntegralGetJob();// 返利到账,金币增加 |
| | | // doPlaceOrderIntegralJob();// 下单赠送金币任务
|
| | | doDouYinDeviceActiveJob();// 抖音设备激活广告监测
|
| | | doDouYinDeviceActiveJob();// 抖音设备激活广告监测 |
| | | }
|
| | | }
|
| | |
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | |
| | | public static boolean greaterThan_2_0_1(String platform, String versionCode) {
|
| | | if ((("android".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) >= 50))
|
| | | || (("ios".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) >= 67)))
|
| | | return true;
|
| | | else
|
| | | return false;
|
| | | }
|
| | |
|
| | |
|
| | | public static boolean smallerThan_1_5_1(String platform, String versionCode) {
|
| | | if ((("android".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) < 36))
|
New file |
| | |
| | | package com.yeshi.fanli.util.annotation;
|
| | |
|
| | | import java.lang.annotation.Documented;
|
| | | import java.lang.annotation.ElementType;
|
| | | import java.lang.annotation.Inherited;
|
| | | import java.lang.annotation.Retention;
|
| | | import java.lang.annotation.RetentionPolicy;
|
| | | import java.lang.annotation.Target;
|
| | |
|
| | | @Documented
|
| | | @Target(ElementType.METHOD)
|
| | | @Inherited
|
| | | @Retention(RetentionPolicy.RUNTIME)
|
| | | public @interface RequestSerializableByKeyService {
|
| | | String key();
|
| | | }
|
| | |
| | |
|
| | | import org.apache.commons.httpclient.HttpClient;
|
| | | import org.apache.commons.httpclient.methods.PostMethod;
|
| | | import org.jsoup.Connection;
|
| | | import org.jsoup.Jsoup;
|
| | | import org.jsoup.nodes.Document;
|
| | | import org.jsoup.nodes.Element;
|
| | |
| | | import com.yeshi.fanli.dto.jd.JDSearchResult;
|
| | | import com.yeshi.fanli.dto.jd.JDShopInfo;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | |
|
| | | public class JDUtil {
|
| | |
|
| | | |
| | | public static final String TM_PHONE_URL = "https://item.m.jd.com/product/%s.html";
|
| | | |
| | | public void test() {
|
| | | Map<String, String> systemParams = new HashMap<>();
|
| | | systemParams.put("method", "");
|
| | |
| | | }
|
| | | return null;
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 查询天猫商品图片、标题
|
| | | * @param auctionId
|
| | | * @return
|
| | | */
|
| | | public static JDGoods getSimpleGoodsInfo(String goodsId) {
|
| | | JDGoods jdGoods = null;
|
| | | try {
|
| | | Connection connect = Jsoup.connect(String.format(TM_PHONE_URL, goodsId));
|
| | | Document document = connect.get();
|
| | | Elements elements = document.getElementsByTag("script");
|
| | | if (elements.size() >= 0) {
|
| | | for (int i = 0; i < elements.size(); i++) {
|
| | | String content = elements.get(i).toString();
|
| | | if (content.contains("window._itemOnly")) {
|
| | | System.out.println("存在"); |
| | | content = content.replace("<script>", "");
|
| | | content = content.replace("</script>", "");
|
| | | int indexOf = content.indexOf("window._isLogin");
|
| | | content = content.substring(0,indexOf);
|
| | | |
| | | int indexItem = content.indexOf("\"item\":");
|
| | | content = content.substring(indexItem,content.length() - 1);
|
| | | content = content.replace("\"item\":", "var item =");
|
| | | content = content.replace("});", "").trim();
|
| | | |
| | | content+=";function getData() {return item;}";
|
| | | ScriptEngineManager manager = new ScriptEngineManager();
|
| | | ScriptEngine engine = manager.getEngineByName("javascript");
|
| | | engine.eval(content);
|
| | | |
| | | if (engine instanceof Invocable) {
|
| | | Invocable in = (Invocable) engine;
|
| | | JSONObject json = JSONObject.fromObject(in.invokeFunction("getData"));
|
| | | |
| | | jdGoods = new JDGoods();
|
| | | jdGoods.setSkuName(json.getString("skuName"));
|
| | | JSONObject jsonImage = json.getJSONObject("image");
|
| | | if (jsonImage != null && jsonImage.size() > 0) {
|
| | | String picUrl = jsonImage.getString("0");
|
| | | jdGoods.setPicUrl("http://m.360buyimg.com/mobilecms/s750x750_" + picUrl);
|
| | | }
|
| | | }
|
| | | |
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return jdGoods;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | import javax.annotation.PostConstruct;
|
| | | import javax.annotation.Resource;
|
| | | import javax.script.Invocable;
|
| | | import javax.script.ScriptEngine;
|
| | | import javax.script.ScriptEngineManager;
|
| | | import javax.xml.parsers.DocumentBuilder;
|
| | | import javax.xml.parsers.DocumentBuilderFactory;
|
| | |
|
| | |
| | | return true;
|
| | | }
|
| | |
|
| | | public static void main(String[] args) {
|
| | | String s = channelMap.get("3");
|
| | | System.out.println(s);
|
| | |
|
| | | /**
|
| | | * 查询天猫商品图片、标题
|
| | | * @param auctionId
|
| | | * @return
|
| | | */
|
| | | public static TaoBaoGoodsBrief getTmallGoodsInfo(String auctionId) {
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = null;
|
| | | try {
|
| | | Connection connect = Jsoup.connect(String.format(TM_PHONE_URL, auctionId));
|
| | | Document document = connect.get();
|
| | | Elements elements = document.getElementsByTag("script");
|
| | | if (elements.size() >= 0) {
|
| | | for (int i = 0; i < elements.size(); i++) {
|
| | | String content = elements.get(i).toString();
|
| | | if (content.contains("var _DATA_Mdskip")) {
|
| | | content = content.replace("<script>", "");
|
| | | content = content.replace("</script>", "");
|
| | | content+=";function getData(){ var json={title:_DATA_Mdskip.item.title,pictUrl:_DATA_Mdskip.item.videoDetail.videoThumbnailURL}; return JSON.stringify(json);}";
|
| | | |
| | | ScriptEngineManager manager = new ScriptEngineManager();
|
| | | ScriptEngine engine = manager.getEngineByName("javascript");
|
| | | engine.eval(content);
|
| | | |
| | | if (engine instanceof Invocable) {
|
| | | Invocable in = (Invocable) engine;
|
| | | JSONObject json = JSONObject.fromObject(in.invokeFunction("getData"));
|
| | | Object title = json.get("title");
|
| | | Object pictUrl = json.get("pictUrl");
|
| | | taoBaoGoodsBrief = new TaoBaoGoodsBrief();
|
| | | taoBaoGoodsBrief.setTitle(title.toString());
|
| | | taoBaoGoodsBrief.setPictUrl(pictUrl.toString());
|
| | | }
|
| | | |
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return taoBaoGoodsBrief;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取淘宝系统时间
|
| | | * |
| | | * @return
|
| | | */
|
| | | public static Date getTaoBaoSystemTime() {
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("method", "taobao.time.get");
|
| | | try {
|
| | | JSONObject json = TaoKeBaseUtil.baseRequest(map, false);
|
| | | String time = json.optJSONObject("time_get_response").optString("time");
|
| | | return new Date(TimeUtil.convertToTimeTemp(time, "yyyy-MM-dd HH:mm:ss"));
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return null;
|
| | | }
|
| | | }
|
| | |
|
| | | class QuanInfo {
|
| | |
| | | taoBaoOrder.setAuctionId(item.optLong("item_id"));
|
| | | taoBaoOrder.setClassName(item.optString("item_category_name"));
|
| | | taoBaoOrder.setClickTime(item.optString("click_time"));
|
| | | taoBaoOrder.setPayTime(item.optString("tb_paid_time"));
|
| | | taoBaoOrder.setCount(item.optInt("item_num"));
|
| | | taoBaoOrder.setCreateTime(item.optString("tk_create_time"));
|
| | | if (!StringUtil.isNullOrEmpty(item.optString("total_commission_fee")))
|
| | |
| | | import org.yeshi.utils.mybatis.ColumnParseUtil;
|
| | | import org.yeshi.utils.mybatis.MyBatisMapperUtil;
|
| | |
|
| | | import com.yeshi.fanli.entity.common.Config;
|
| | | import com.yeshi.fanli.entity.jd.JDOrderItem;
|
| | | import com.yeshi.fanli.entity.push.DeviceActive;
|
| | |
|
| | | //@Ignore
|
| | | public class MyBatisProduce {
|
| | |
| | | @Test
|
| | | public void test3() {
|
| | | // MyBatisMapperUtil.createMapper(JDOrder.class);
|
| | | MyBatisMapperUtil.createMapper(JDOrderItem.class);
|
| | | MyBatisMapperUtil.createMapper(ShortUrl.class);
|
| | | // MyBatisMapperUtil.createMapper(UserMoneyDebtReturnHistory.class);
|
| | | }
|
| | |
|
| | | @Test
|
| | | public void test1() {
|
| | | ColumnParseUtil.parseColumn(Config.class,
|
| | | "D:\\workspace\\fanli\\fanli-server\\fanli\\src\\main\\java\\com\\yeshi\\fanli\\mapping\\ConfigMapper.xml");
|
| | | ColumnParseUtil.parseColumn(DeviceActive.class,
|
| | | "D:\\workspace\\fanli\\fanli-server\\fanli\\src\\main\\java\\com\\yeshi\\fanli\\mapping\\push\\DeviceActiveMapper.xml");
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoLink;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
|
| | | import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.goods.ShareGoodsService;
|
| | | import com.yeshi.fanli.service.inter.order.tb.TaoBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoBuyRelationMapService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.TBPidService;
|
| | | import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.util.BeanUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | |
| | |
|
| | | @Test
|
| | | public void test1() {
|
| | | try {
|
| | | TaoKeAppInfo app = new TaoKeAppInfo("27867727", "781fce83545edbed13af32dc3fa9fc3a",
|
| | | "mm_124933865_865950258_109407350204");
|
| | | app.setAdzoneId("109407350204");
|
| | | TaoBaoGoodsBrief goods = TaoKeApiUtil.searchGoodsDetail(596441448615L, app);
|
| | | System.out.println(goods);
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | TaoBaoSearchResult result = TaoKeApiUtil.getMaterialByMaterialId(19450, 1, 100);
|
| | | System.out.println(result);
|
| | | }
|
| | |
|
| | | @Test
|
| | |
| | | System.out.println(goods);
|
| | |
|
| | | // goods = TaoKeApiUtil.searchGoodsDetail(auctionId);
|
| | |
|
| | | }
|
| | |
|
| | | @Test
|
| | |
| | | <attribute name="org.eclipse.jst.component.nondependency" value=""/>
|
| | | </attributes>
|
| | | </classpathentry>
|
| | | <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
| | | <attributes>
|
| | | <attribute name="maven.pomderived" value="true"/>
|
| | | </attributes>
|
| | | </classpathentry>
|
| | | <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.8.0_181"/>
|
| | | <classpathentry kind="output" path="target/classes"/>
|
| | | </classpath>
|
| | |
| | | import org.apache.http.util.EntityUtils;
|
| | | import org.yeshi.utils.entity.ProxyIP;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | public class HttpUtil {
|
| | |
| | | }
|
| | |
|
| | | public static String getShortLink(String url) {
|
| | | String shortLink = getShortLink2(url);
|
| | | if (StringUtil.isNullOrEmpty(shortLink))
|
| | | shortLink = getShortLink3(url);
|
| | | // return url;
|
| | | String shortLink = getShortLink3(url);
|
| | | if (StringUtil.isNullOrEmpty(shortLink))
|
| | | shortLink = getShortLink1(url);
|
| | | if (StringUtil.isNullOrEmpty(shortLink))
|
| | | shortLink = getShortLink2(url);
|
| | | return shortLink;
|
| | | }
|
| | |
|
| | |
| | | try {
|
| | | String totalUrl = String.format(
|
| | | "http://suo.im/api.htm?format=json&url=%s&key=5d7728078e676d45275f816b@681bb0446f1e6af4f8fc6ce3cad2a684",
|
| | | URLEncoder.encode(url));
|
| | | URLEncoder.encode(url));
|
| | | String result = get(totalUrl, null);
|
| | | System.out.println(result);
|
| | | try {
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | //搜狐网址
|
| | | // 搜狐网址
|
| | | private static String getShortLink2(String url) {
|
| | | try {
|
| | | String totalUrl = String.format(
|
| | | "https://sohu.gg/api/?key=2zumZxsL8MuX&url=%s",
|
| | | URLEncoder.encode(url,"UTF-8"));
|
| | | String totalUrl = String.format("https://sohu.gg/api/?key=2zumZxsL8MuX&url=%s",
|
| | | URLEncoder.encode(url, "UTF-8"));
|
| | | String result = get(totalUrl, null);
|
| | | if(result!=null&&result.startsWith("http"))
|
| | | if (result != null && result.startsWith("http"))
|
| | | return result;
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | |
| | |
|
| | | private static String getShortLink3(String url) {
|
| | | try {
|
| | | String totalUrl = String.format(
|
| | | "http://api.t.sina.com.cn/short_url/shorten.json?source=2963429064&url_long=%s",
|
| | | URLEncoder.encode(url));
|
| | | String totalUrl = String.format("http://h5.flq001.com/short/createShort?url=%s",
|
| | | URLEncoder.encode(url, "UTF-8"));
|
| | | String result = get(totalUrl, null);
|
| | | JSONObject data = JSONArray.fromObject(result).optJSONObject(0);
|
| | | return data.optString("url_short");
|
| | | JSONObject data = JSONObject.fromObject(result);
|
| | | return data.optString("short_url");
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|