Merge remote-tracking branch 'origin/master'
| | |
| | | package com.yeshi.fanli.controller;
|
| | |
|
| | | import java.io.BufferedReader;
|
| | | import java.io.IOException;
|
| | | import java.security.SignatureException;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.crypto.Mac;
|
| | | import javax.crypto.spec.SecretKeySpec;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgDeviceReadState;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.msg.MsgDeviceReadStateService;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | /**
|
| | | * 授权回调
|
| | | * |
| | | *
|
| | | * @author Administrator
|
| | | *
|
| | |
| | | @Controller
|
| | | @RequestMapping("client/v1/callback")
|
| | | public class CallBackController {
|
| | |
|
| | | @Resource
|
| | | private MsgDeviceReadStateService msgDeviceReadStateService;
|
| | |
|
| | | /**
|
| | | * 客服消息回调
|
| | |
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | | * 美洽消息回调
|
| | | * |
| | | * @param response
|
| | | */
|
| | |
|
| | | @RequestMapping(value = "meiQia")
|
| | | public void meiQia(HttpServletRequest request, HttpServletResponse response) {
|
| | | String auth = request.getHeader("Authorization");
|
| | | String queryString = request.getQueryString();
|
| | | LogHelper.test("美洽:queryString-" + queryString + "-auth:" + auth);
|
| | |
|
| | | BufferedReader br = null;
|
| | | StringBuilder sb = new StringBuilder("");
|
| | | try {
|
| | | br = request.getReader();
|
| | | String str;
|
| | | while ((str = br.readLine()) != null) {
|
| | | sb.append(str);
|
| | | }
|
| | | br.close();
|
| | | } catch (IOException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | String sign = "";
|
| | | try {
|
| | | sign = sign(sb.toString());
|
| | | } catch (SignatureException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | if (!auth.equalsIgnoreCase(sign)) {
|
| | | LogHelper.test("美洽回调签名错误");
|
| | | return;
|
| | | }
|
| | | JSONObject json = JSONObject.fromObject(sb.toString());
|
| | | String msg = "";
|
| | | if (json != null) {
|
| | | String deviceOS = json.optString("deviceOS");
|
| | | String contentType = json.optString("contentType");
|
| | | if (contentType.equalsIgnoreCase("text"))
|
| | | msg = json.optString("content");
|
| | | else if (contentType.equalsIgnoreCase("photo"))
|
| | | msg = "[图片]";
|
| | | else if (contentType.equalsIgnoreCase("audio"))
|
| | | msg = "[语音]";
|
| | | String customizedId = json.optJSONObject("customizedData").optString("设备标识");
|
| | | msgDeviceReadStateService.addUnreadDeviceMsg(MsgDeviceReadState.TYPE_KEFU, customizedId,
|
| | | "android".equalsIgnoreCase(deviceOS) ? 1 : 2, 1, msg);
|
| | | }
|
| | |
|
| | | LogHelper.test("美洽:body----" + sb.toString());
|
| | | }
|
| | |
|
| | | public String sign(String raw_body) throws java.security.SignatureException {
|
| | | String key = "$2a$12$uC3EG/zSaSI37KKOgt1IgetDRHJY6Q2zEVDBr0DeWcwQbGNU7pewy";
|
| | | String result = "";
|
| | | try {
|
| | | SecretKeySpec signingKey = new SecretKeySpec(key.getBytes("UTF-8"), "HmacSHA1");
|
| | | Mac mac = Mac.getInstance("HmacSHA1");
|
| | | mac.init(signingKey);
|
| | | byte[] rawHmac = mac.doFinal(raw_body.getBytes("UTF-8"));
|
| | | byte[] hexBytes = new org.apache.commons.codec.binary.Hex().encode(rawHmac);
|
| | | result = org.apache.commons.codec.binary.Base64.encodeBase64String(hexBytes).trim();
|
| | | } catch (Exception e) {
|
| | | throw new SignatureException("Failed to generate HMAC : " + e.getMessage());
|
| | | }
|
| | | return "meiqia_sign:" + result;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.FloatAD;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgDeviceReadState;
|
| | | import com.yeshi.fanli.entity.config.AppHomeFloatImg;
|
| | | import com.yeshi.fanli.entity.taobao.ClientTBPid;
|
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.FloatADService;
|
| | | import com.yeshi.fanli.service.inter.msg.MsgDeviceReadStateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.user.TBPidService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private JumpDetailV2Service jumpDetailV2Service;
|
| | |
|
| | | @Resource
|
| | | private MsgDeviceReadStateService msgDeviceReadStateService;
|
| | |
|
| | | /**
|
| | | * 首页配置信息
|
| | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("meiqia", "1".equalsIgnoreCase(configService.get("kefu_meiqia")) ? true : false);// 是否跳转美洽,不跳转美洽就用原来的
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | // 设置消息已读
|
| | | ThreadUtil.run(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | msgDeviceReadStateService.setDeviceMsgRead(MsgDeviceReadState.TYPE_KEFU, acceptData.getDevice(),
|
| | | "android".equalsIgnoreCase(acceptData.getPlatform()) ? 1 : 2);
|
| | | }
|
| | | });
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | finalImgList.add(0, tb.getPictUrlWhite());
|
| | |
|
| | | // 大淘客商品过滤
|
| | | goods = daTaoKeGoodsDetailService.filterTaoBaoGoods(goods);
|
| | |
|
| | | try {
|
| | | goods = daTaoKeGoodsDetailService.filterTaoBaoGoods(goods);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | JSONObject goodsJson = new JSONObject();
|
| | | goodsJson.put("auctionId", tb.getAuctionId());
|
| | | goodsJson.put("imgList", finalImgList);
|
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.taobao.TaoBaoAuthUtil;
|
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.dto.dataoke.DaTaoKeGoodsResult;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.lable.QualityFactory;
|
| | | import com.yeshi.fanli.entity.bus.recommend.Honest;
|
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoUnionConfig;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | | import com.yeshi.fanli.service.inter.config.BusinessSystemService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.config.SuperHotSearchService;
|
| | |
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import com.yeshi.fanli.util.cache.TaoBaoGoodsCacheUtil;
|
| | | import com.yeshi.fanli.util.dataoke.DaTaoKeApiUtil;
|
| | | import com.yeshi.fanli.util.taobao.SearchFilterUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.vo.brand.TaoBaoShopVO;
|
| | |
| | | data = searchGoods(kw, page, filter, order, startprice, endprice);
|
| | | } else {
|
| | | // 推荐:精选库
|
| | | data = searchQualityGoods(kw, page, filter, order, startprice, endprice);
|
| | | // data = searchQualityGoods(kw, page, filter, order, startprice,
|
| | | // endprice);
|
| | | data = searchDaTaoKeGoods(kw, page, filter, order, startprice, endprice);
|
| | | }
|
| | |
|
| | | // 获取推荐词
|
| | |
| | | if (daTaoKeList != null && daTaoKeList.size() > 0) {
|
| | | Collections.reverse(daTaoKeList);
|
| | | for (DaTaoKeDetail detail : daTaoKeList) {
|
| | | taoBaoGoodsBriefs.add(0,TaoBaoUtil.convert(detail));
|
| | | taoBaoGoodsBriefs.add(0, TaoBaoUtil.convert(detail));
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | |
| | | return data;
|
| | | }
|
| | |
|
| | | private JSONObject searchDaTaoKeGoods(String key, int page, String filter, String order, String startprice,
|
| | | String endprice) {
|
| | | page=page+1;
|
| | | int sort = DaTaoKeApiUtil.SORT_DEFAULT;
|
| | | if ("5".equalsIgnoreCase(order)) {
|
| | | sort = DaTaoKeApiUtil.SORT_COMMISSION;
|
| | | } else if ("1".equalsIgnoreCase(order)) {
|
| | | sort = DaTaoKeApiUtil.SORT_SALES;
|
| | | } else if ("2".equalsIgnoreCase(order)) {
|
| | | sort = DaTaoKeApiUtil.SORT_PRICE_HIGH_TO_LOW;
|
| | | } else if ("3".equalsIgnoreCase(order)) {
|
| | | sort = DaTaoKeApiUtil.SORT_PRICE_LOW_TO_HIGH;
|
| | | }
|
| | |
|
| | | List<TaoBaoGoodsBriefExtra> listExtra = new ArrayList<TaoBaoGoodsBriefExtra>();
|
| | | BigDecimal proportion = manageService.getFanLiRate();
|
| | |
|
| | | DaTaoKeGoodsResult result = DaTaoKeApiUtil.search(key, null, page, 20, sort);
|
| | | if (result != null && result.getGoodsList() != null)
|
| | | for (DaTaoKeDetailV2 goods : result.getGoodsList()) {
|
| | | listExtra.add(
|
| | | TaoBaoUtil.getTaoBaoGoodsBriefExtra(TaoBaoUtil.convert(goods), proportion.toString(), null));
|
| | | }
|
| | |
|
| | | List<TaoBaoSearchNav> navList = new ArrayList<>();
|
| | | Gson gson = new GsonBuilder().create();
|
| | | Gson gson2 = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().create();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("nav", gson.toJson(navList));
|
| | | data.put("result", gson2.toJson(listExtra));
|
| | | data.put("count", result.getTotalCount());
|
| | |
|
| | | return data;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 设置查询佣金比例范围
|
| | | *
|
| | |
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.factory.CommonGoodsFactory;
|
| | | import com.yeshi.fanli.util.factory.msg.UserMsgVOFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
| | | data.put("totalCount", 0);
|
| | | }
|
| | | } catch (UserCustomSettingsException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
| | |
|
| | | int totalCount = num.getTypeAccount() + num.getTypeInvite() + num.getTypeMoney() + num.getTypeOrder()
|
| | | + num.getTypeScore() + num.getTypeSystem() + num.getTypeOther();
|
| | |
|
| | | // 1.5.50及以后的版本需要添加设备未读消息
|
| | | if (VersionUtil.greaterThan_1_5_50(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | totalCount += msgDeviceReadStateService.getUnReadCount(acceptData.getDevice(),
|
| | | "android".equalsIgnoreCase(acceptData.getPlatform()) ? 1 : 2, MsgDeviceReadState.TYPE_KEFU);
|
| | | }
|
| | |
|
| | | JSONObject data = null;
|
| | | if ("android".equalsIgnoreCase(acceptData.getPlatform())) {
|
| | |
| | | out.print(JsonUtil.loadTrueResult(root));
|
| | | }
|
| | |
|
| | | private UserCommonMsgVO getKeFuMsg(AcceptData acceptData) {
|
| | | MsgDeviceReadState kefuState = msgDeviceReadStateService.getByDeviceAndPlatformAndType(
|
| | | UserCommonMsgVO.TYPE_KEFU, acceptData.getDevice(),
|
| | | acceptData.getPlatform().equalsIgnoreCase("android") ? 1 : 2);
|
| | | // 人工客服
|
| | | UserCommonMsgVO vo = new UserCommonMsgVO("http://img.flqapp.com/resource/msg/icon_kefu.png", "人工客服", new Date(),
|
| | | UserCommonMsgVO.TYPE_KEFU, "", false, null, null, 0);
|
| | | if (kefuState != null) {
|
| | | vo.setUnReadCount(kefuState.getUnReadCount() == null ? 0 : kefuState.getUnReadCount());
|
| | | if (!StringUtil.isNullOrEmpty(kefuState.getLatestContent()))
|
| | | vo.setLatestMsg(kefuState.getLatestContent());
|
| | |
|
| | | if (vo.getUnReadCount() != null && vo.getUnReadCount() > 0)
|
| | | vo.setRead(false);
|
| | | else
|
| | | vo.setRead(true);
|
| | | }
|
| | |
|
| | | return vo;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取消息列表
|
| | | *
|
| | |
| | | // 官宣任务
|
| | | if (uid != null) {
|
| | | MsgCommonDTO guanXuanMsg = msgConfigService.getGuanXuanMsg();
|
| | | if (guanXuanMsg != null&&guanXuanMsg.getShow()==true) {
|
| | | if (guanXuanMsg != null && guanXuanMsg.getShow() == true) {
|
| | | boolean read = false;
|
| | | UserMsgUnReadNum num = userMsgReadStateService.getReadStateByUid(uid);
|
| | | if (num != null && (num.getGuanXuanReadTime() != null
|
| | |
| | | } else
|
| | | commonMsgList.add(new UserCommonMsgVO(guanXuanMsg.getIcon(), guanXuanMsg.getTitle(),
|
| | | guanXuanMsg.getUpdateTime(), UserCommonMsgVO.TYPE_GUANXUAN, guanXuanMsg.getContent(), read,
|
| | | guanXuanMsg.getJumpDetail(), guanXuanMsg.getParams()));
|
| | | guanXuanMsg.getJumpDetail(), guanXuanMsg.getParams(), 0));
|
| | | }
|
| | | }
|
| | |
|
| | | // 返利券小助手
|
| | | MsgCommonDTO zhuShouMsg = msgConfigService.getZhuShouMsg();
|
| | | if (zhuShouMsg != null&&zhuShouMsg.getShow()==true) {
|
| | |
|
| | | if (zhuShouMsg != null && zhuShouMsg.getShow() == true) {
|
| | | boolean read = false;
|
| | |
|
| | | MsgDeviceReadState state = msgDeviceReadStateService.getByDeviceAndPlatformAndType(
|
| | | UserCommonMsgVO.TYPE_ZHUSHOU, acceptData.getDevice(),
|
| | | acceptData.getPlatform().equalsIgnoreCase("android") ? 1 : 2);
|
| | |
| | | } else
|
| | | commonMsgList.add(new UserCommonMsgVO(zhuShouMsg.getIcon(), zhuShouMsg.getTitle(),
|
| | | zhuShouMsg.getUpdateTime(), UserCommonMsgVO.TYPE_ZHUSHOU, zhuShouMsg.getContent(), read,
|
| | | zhuShouMsg.getJumpDetail(), zhuShouMsg.getParams()));
|
| | | zhuShouMsg.getJumpDetail(), zhuShouMsg.getParams(), 0));
|
| | | }
|
| | |
|
| | | // 人工客服
|
| | | commonMsgList.add(new UserCommonMsgVO("http://img.flqapp.com/resource/msg/icon_kefu.png", "人工客服", new Date(),
|
| | | UserCommonMsgVO.TYPE_KEFU, "", false, null, null));
|
| | | commonMsgList.add(getKeFuMsg(acceptData));
|
| | |
|
| | | // 推荐记录
|
| | | DeviceActive deviceActive = deviceActiveService.getDeviceByDeviceAndPlatform(acceptData.getDevice(),
|
| | |
| | |
|
| | | commonMsgList.add(new UserCommonMsgVO("http://img.flqapp.com/resource/msg/icon_recommend.png", "推荐记录",
|
| | | list.get(0).getCreateTime(), UserCommonMsgVO.TYPE_RECOMMEND, list.get(0).getContent(), read,
|
| | | jumpDetailV2Service.getByTypeCache("recommend_list"), null));
|
| | | jumpDetailV2Service.getByTypeCache("recommend_list"), null, 0));
|
| | | }
|
| | | }
|
| | |
|
New file |
| | |
| | | package com.yeshi.fanli.dao;
|
| | |
|
| | | import java.lang.reflect.ParameterizedType;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.data.mongodb.core.MongoTemplate;
|
| | | import org.springframework.data.mongodb.core.query.Criteria;
|
| | | import org.springframework.data.mongodb.core.query.Query;
|
| | | import org.springframework.data.mongodb.core.query.Update;
|
| | | import org.springframework.stereotype.Repository;
|
| | |
|
| | | @Repository
|
| | | public abstract class MongodbBaseDao<T> {
|
| | | @Resource
|
| | | protected MongoTemplate mongoTemplate;
|
| | |
|
| | | /**
|
| | | * 插入数据
|
| | | * |
| | | * @param bean
|
| | | * @return
|
| | | */
|
| | | public T save(T bean) {
|
| | | mongoTemplate.save(bean);
|
| | | return bean;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 根据主键更新数据
|
| | | * |
| | | * @param query
|
| | | * @param update
|
| | | */
|
| | | public void update(Query query, Update update) {
|
| | | mongoTemplate.upsert(query, update, this.getEntityClass());
|
| | | }
|
| | |
|
| | | /**
|
| | | * 查询一个数据
|
| | | * |
| | | * @param query
|
| | | * @return
|
| | | */
|
| | | public T findOne(Query query) {
|
| | | return (T) mongoTemplate.findOne(query, this.getEntityClass());
|
| | | }
|
| | |
|
| | | /**
|
| | | * 查询多个数据
|
| | | * |
| | | * @param query
|
| | | * @return
|
| | | */
|
| | | public List<T> findList(Query query) {
|
| | | return mongoTemplate.find(query, this.getEntityClass());
|
| | | }
|
| | |
|
| | | /**
|
| | | * 主键查询
|
| | | * |
| | | * @param id
|
| | | * @return
|
| | | */
|
| | | public T get(Object id) {
|
| | | return (T) mongoTemplate.findById(id, this.getEntityClass());
|
| | | }
|
| | |
|
| | | /**
|
| | | * 通过主键删除
|
| | | * |
| | | * @param id
|
| | | */
|
| | | public void delete(Object id) {
|
| | | Query query = Query.query(Criteria.where("id").is(id));
|
| | | mongoTemplate.remove(query, getEntityClass());
|
| | | }
|
| | |
|
| | | @SuppressWarnings("unchecked")
|
| | | protected Class<T> getEntityClass() {
|
| | | Class<T> tClass = (Class<T>) ((ParameterizedType) getClass().getGenericSuperclass())
|
| | | .getActualTypeArguments()[0];
|
| | | return tClass;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dao.goods.taobao.dataoke;
|
| | |
|
| | | import java.lang.reflect.Field;
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | | import java.util.regex.Pattern;
|
| | |
|
| | | import org.springframework.data.domain.Sort;
|
| | | import org.springframework.data.domain.Sort.Direction;
|
| | | import org.springframework.data.domain.Sort.Order;
|
| | | import org.springframework.data.mongodb.core.query.Criteria;
|
| | | import org.springframework.data.mongodb.core.query.Query;
|
| | | import org.springframework.data.mongodb.core.query.Update;
|
| | | import org.springframework.stereotype.Repository;
|
| | |
|
| | | import com.yeshi.fanli.dao.MongodbBaseDao;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | |
|
| | | @Repository
|
| | | public class DaTaoKeGoodsDetailV2Dao extends MongodbBaseDao<DaTaoKeDetailV2> {
|
| | |
|
| | | public void updateSelective(DaTaoKeDetailV2 v2) {
|
| | | DaTaoKeDetailV2 old = get(v2.getId());
|
| | | if (old != null) {// 更新
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("id").is(v2.getId()));
|
| | | Field[] fields = v2.getClass().getFields();
|
| | |
|
| | | Update update = new Update();
|
| | | for (Field f : fields) {
|
| | | f.setAccessible(true);
|
| | | String name = f.getName();
|
| | | Object value = null;
|
| | | try {
|
| | | value = f.get(v2);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | if (value != null)
|
| | | update.set(name, value);
|
| | | }
|
| | | update(query, update);
|
| | | }
|
| | | }
|
| | |
|
| | | public DaTaoKeDetailV2 selectLatest() {
|
| | | Query query = new Query();
|
| | | List<Order> orders = new ArrayList<>();
|
| | | orders.add(new Order(Direction.DESC, "createTime"));
|
| | | query.with(new Sort(orders));
|
| | | query.limit(1);
|
| | | List<DaTaoKeDetailV2> list = mongoTemplate.find(query, getEntityClass());
|
| | | if (list != null && list.size() > 0)
|
| | | return list.get(0);
|
| | | else
|
| | | return null;
|
| | | }
|
| | |
|
| | | public List<DaTaoKeDetailV2> listByGoodsIds(List<Long> goodsIdList) {
|
| | | if (goodsIdList == null || goodsIdList.size() == 0)
|
| | | return null;
|
| | | Query query = new Query();
|
| | | Criteria[] criterias = new Criteria[goodsIdList.size()];
|
| | | for (int i = 0; i < goodsIdList.size(); i++) {
|
| | | criterias[i] = Criteria.where("goodsId").is(goodsIdList.get(i));
|
| | | }
|
| | | query.addCriteria(new Criteria().orOperator(criterias));
|
| | | return mongoTemplate.find(query, getEntityClass());
|
| | | }
|
| | |
|
| | | public List<DaTaoKeDetailV2> listByIds(List<Long> idsList) {
|
| | | if (idsList == null || idsList.size() == 0)
|
| | | return null;
|
| | | Query query = new Query();
|
| | | Criteria[] criterias = new Criteria[idsList.size()];
|
| | | for (int i = 0; i < idsList.size(); i++) {
|
| | | criterias[i] = Criteria.where("id").is(idsList.get(i));
|
| | | }
|
| | | query.addCriteria(new Criteria().orOperator(criterias));
|
| | | return mongoTemplate.find(query, getEntityClass());
|
| | | }
|
| | |
|
| | | public List<DaTaoKeDetailV2> listByDtitle(String dtitle) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("dtitle").is(dtitle));
|
| | | return mongoTemplate.find(query, getEntityClass());
|
| | | }
|
| | |
|
| | | public List<DaTaoKeDetailV2> listSearchByTitleWithCid(String key, Long cid, int start, int count) {
|
| | | Pattern pattern = Pattern.compile("^.*" + key + ".*$", Pattern.CASE_INSENSITIVE);
|
| | | List<Criteria> criteriasList = new ArrayList<>();
|
| | | criteriasList.add(Criteria.where("dtitle").regex(pattern));
|
| | | criteriasList.add(Criteria.where("title").regex(pattern));
|
| | | Criteria[] criterias = new Criteria[criteriasList.size()];
|
| | | Query query = new Query();
|
| | | if (cid != null)
|
| | | query.addCriteria(new Criteria().andOperator(Criteria.where("cid").is(Integer.parseInt(cid + "")),
|
| | | new Criteria().orOperator(criteriasList.toArray(criterias))));
|
| | | else
|
| | | query.addCriteria(new Criteria().orOperator(criteriasList.toArray(criterias)));
|
| | | query.skip(start);
|
| | | query.limit(count);
|
| | | return mongoTemplate.find(query, getEntityClass());
|
| | | }
|
| | |
|
| | | public long countSearchByTitleWithCid(String key, Long cid) {
|
| | | Pattern pattern = Pattern.compile("^.*" + key + ".*$", Pattern.CASE_INSENSITIVE);
|
| | | List<Criteria> criteriasList = new ArrayList<>();
|
| | | criteriasList.add(Criteria.where("dtitle").regex(pattern));
|
| | | criteriasList.add(Criteria.where("title").regex(pattern));
|
| | | Criteria[] criterias = new Criteria[criteriasList.size()];
|
| | | Query query = new Query();
|
| | | if (cid != null)
|
| | | query.addCriteria(new Criteria().andOperator(Criteria.where("cid").is(Integer.parseInt(cid + "")),
|
| | | new Criteria().orOperator(criteriasList.toArray(criterias))));
|
| | | else
|
| | | query.addCriteria(new Criteria().orOperator(criteriasList.toArray(criterias)));
|
| | | return mongoTemplate.count(query, getEntityClass());
|
| | | }
|
| | |
|
| | | public List<DaTaoKeDetailV2> getGoodsNotInList(Long cid, List<Long> listId, int count) {
|
| | | List<Criteria> criteriasList = new ArrayList<>();
|
| | | if (cid != null)
|
| | | criteriasList.add(Criteria.where("cid").is(Integer.parseInt(cid + "")));
|
| | | for (Long id : listId)
|
| | | criteriasList.add(Criteria.where("id").not().is(id));
|
| | | Criteria[] criterias = new Criteria[criteriasList.size()];
|
| | | Query query = new Query();
|
| | | query.addCriteria(new Criteria().andOperator(criteriasList.toArray(criterias)));
|
| | | query.limit(count);
|
| | | return mongoTemplate.find(query, getEntityClass());
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.pdd; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.pdd.PDDOrder; |
| | | |
| | | public interface PDDOrderMapper extends BaseMapper<PDDOrder> { |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dto.dataoke;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | |
|
| | | public class DaTaoKeGoodsResult {
|
| | | private long totalCount;
|
| | | private String pageId;
|
| | | private List<DaTaoKeDetailV2> goodsList;
|
| | |
|
| | | public DaTaoKeGoodsResult() {
|
| | | }
|
| | |
|
| | | public DaTaoKeGoodsResult(long totalCount, String pageId, List<DaTaoKeDetailV2> goodsList) {
|
| | | this.totalCount = totalCount;
|
| | | this.pageId = pageId;
|
| | | this.goodsList = goodsList;
|
| | | }
|
| | |
|
| | | public long getTotalCount() {
|
| | | return totalCount;
|
| | | }
|
| | |
|
| | | public void setTotalCount(long totalCount) {
|
| | | this.totalCount = totalCount;
|
| | | }
|
| | |
|
| | | public String getPageId() {
|
| | | return pageId;
|
| | | }
|
| | |
|
| | | public void setPageId(String pageId) {
|
| | | this.pageId = pageId;
|
| | | }
|
| | |
|
| | | public List<DaTaoKeDetailV2> getGoodsList() {
|
| | | return goodsList;
|
| | | }
|
| | |
|
| | | public void setGoodsList(List<DaTaoKeDetailV2> goodsList) {
|
| | | this.goodsList = goodsList;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dto.pdd;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | import com.google.gson.annotations.SerializedName;
|
| | |
|
| | | public class PDDGoodsDetail {
|
| | | @SerializedName("goods_id")
|
| | | private Long goodsId;// 商品id
|
| | | @SerializedName("has_mall_coupon")
|
| | | private Boolean hasMallCoupon;// 是否有店铺券
|
| | | @SerializedName("mall_coupon_id")
|
| | | private Long mallCouponId;// 店铺券id
|
| | | @SerializedName("mall_coupon_discount_pct")
|
| | | private Integer mallCouponDiscountPct;// 店铺券折扣
|
| | | @SerializedName("mall_coupon_min_order_amount")
|
| | | private Integer mallCouponMinOrderAmount;// 最小使用金额
|
| | | @SerializedName("mall_coupon_max_discount_amount")
|
| | | private Integer mallCouponMaxDiscountAmount;// 最大使用金额
|
| | | @SerializedName("mall_coupon_total_quantity")
|
| | | private Long mallCouponTotalQuantity;// 店铺券总量
|
| | | @SerializedName("mall_coupon_remain_quantity")
|
| | | private Long mallCouponRemainQuantity;// 店铺券余量
|
| | | @SerializedName("mall_coupon_start_time")
|
| | | private Long mallCouponStartTime;// 店铺券开始使用时间
|
| | | @SerializedName("mall_coupon_end_time")
|
| | | private Long mallCouponEndTime;// 店铺券结束使用时间
|
| | | @SerializedName("create_at")
|
| | | private Long createAt;// 创建时间(unix时间戳)
|
| | | @SerializedName("goods_name")
|
| | | private String goodsName; // 商品名称
|
| | | @SerializedName("goods_desc")
|
| | | private String goodsDesc;// 商品描述
|
| | | @SerializedName("goods_thumbnail_url")
|
| | | private String goodsThumbnailUrl; // 商品缩略图
|
| | | @SerializedName("goods_image_url")
|
| | | private String goodsImageUrl;// 商品主图
|
| | | @SerializedName("goods_gallery_urls")
|
| | | private String[] goodsGalleryUrls;// 商品轮播图
|
| | | @SerializedName("sold_quantity")
|
| | | private Long soldQuantity;// 已售卖件数
|
| | | @SerializedName("min_group_price")
|
| | | private Long minGroupPrice;// 最小拼团价(单位为分)
|
| | | @SerializedName("min_normal_price")
|
| | | private Long minNormalPrice;// 最小单买价格(单位为分)
|
| | | @SerializedName("mall_name")
|
| | | private String mallName; // 店铺名字
|
| | | @SerializedName("merchant_type")
|
| | | private Integer merchantType; // 铺类型,1-个人,2-企业,3-旗舰店,4-专卖店,5-专营店,6-普通店
|
| | | @SerializedName("category_id")
|
| | | private Long categoryId; // 商品类目ID,使用pdd.goods.cats.get接口获取
|
| | | @SerializedName("category_name")
|
| | | private String categoryName;// 商品类目名
|
| | | @SerializedName("opt_id")
|
| | | private Long optId;// 商品标签ID,使用pdd.goods.opts.get接口获取
|
| | | @SerializedName("opt_name")
|
| | | private String optName;// 商品标签名
|
| | | @SerializedName("opt_ids")
|
| | | private Long[] optIds; // 商品标签id
|
| | | @SerializedName("cat_ids")
|
| | | private Long[] catIds; // 商品类目id
|
| | | @SerializedName("mall_cps")
|
| | | private Integer mallCps; // 该商品所在店铺是否参与全店推广,0:否,1:是
|
| | | @SerializedName("has_coupon")
|
| | | private Boolean hasCoupon; // 商品是否有优惠券
|
| | | // true-有,false-没有
|
| | | @SerializedName("coupon_min_order_amount")
|
| | | private Long couponMinOrderAmount; // 优惠券门槛价格,单位为分
|
| | | @SerializedName("coupon_discount")
|
| | | private Long couponDiscount;// 优惠券面额,单位为分
|
| | | @SerializedName("coupon_total_quantity")
|
| | | private Long couponTotalQuantity; // 优惠券总数量
|
| | | @SerializedName("coupon_remain_quantity")
|
| | | private Long couponRemainQuantity; // 优惠券剩余数量
|
| | | @SerializedName("coupon_start_time")
|
| | | private Long couponStartTime;// 优惠券生效时间,UNIX时间戳
|
| | | @SerializedName("coupon_end_time")
|
| | | private Long couponEndTime;// 优惠券失效时间,UNIX时间戳
|
| | | @SerializedName("promotion_rate")
|
| | | private Long promotionRate;// 佣金比例,千分比
|
| | | @SerializedName("goods_eval_score")
|
| | | private String goodsEvalScore;// 商品评价分
|
| | | @SerializedName("goods_eval_count")
|
| | | private Long goodsEvalCount;// 商品评价数量
|
| | | @SerializedName("avg_desc")
|
| | | private Long avgDesc;// 描述评分
|
| | | @SerializedName("avg_lgst")
|
| | | private Long avgLgst;// 物流评分
|
| | | @SerializedName("avg_serv")
|
| | | private Long avgServ;// 服务评分
|
| | | @SerializedName("desc_pct")
|
| | | private BigDecimal descPct;// 描述分击败同类店铺百分比
|
| | | @SerializedName("lgst_pct")
|
| | | private BigDecimal lgstPct;// 物流分击败同类店铺百分比
|
| | | @SerializedName("serv_pct")
|
| | | private BigDecimal servPct;// 服务分击败同类店铺百分比
|
| | | @SerializedName("sales_tip")
|
| | | private String salesTip;// 模糊销量
|
| | | @SerializedName("activity_type")
|
| | | private Integer activityType;// 活动类型,0-无活动;1-秒杀;3-限量折扣;12-限时折扣;13-大促活动;14-名品折扣;15-品牌清仓;16-食品超市;17-一元幸运团;18-爱逛街;19-时尚穿搭;20-男人帮;21-9块9;22-竞价活动;23-榜单活动;24-幸运半价购;25-定金预售;26-幸运人气购;27-特色主题活动;28-断码清仓;29-一元话费;30-电器城;31-每日好店;32-品牌卡;101-大促搜索池;102-大促品类分会场;
|
| | |
|
| | | // mall_id:4217177,cps_sign:null,cat_id:null mall_rate:10
|
| | |
|
| | | public Long getGoodsId() {
|
| | | return goodsId;
|
| | | }
|
| | |
|
| | | public void setGoodsId(Long goodsId) {
|
| | | this.goodsId = goodsId;
|
| | | }
|
| | |
|
| | | public Boolean getHasMallCoupon() {
|
| | | return hasMallCoupon;
|
| | | }
|
| | |
|
| | | public void setHasMallCoupon(Boolean hasMallCoupon) {
|
| | | this.hasMallCoupon = hasMallCoupon;
|
| | | }
|
| | |
|
| | | public Long getMallCouponId() {
|
| | | return mallCouponId;
|
| | | }
|
| | |
|
| | | public void setMallCouponId(Long mallCouponId) {
|
| | | this.mallCouponId = mallCouponId;
|
| | | }
|
| | |
|
| | | public Integer getMallCouponDiscountPct() {
|
| | | return mallCouponDiscountPct;
|
| | | }
|
| | |
|
| | | public void setMallCouponDiscountPct(Integer mallCouponDiscountPct) {
|
| | | this.mallCouponDiscountPct = mallCouponDiscountPct;
|
| | | }
|
| | |
|
| | | public Integer getMallCouponMinOrderAmount() {
|
| | | return mallCouponMinOrderAmount;
|
| | | }
|
| | |
|
| | | public void setMallCouponMinOrderAmount(Integer mallCouponMinOrderAmount) {
|
| | | this.mallCouponMinOrderAmount = mallCouponMinOrderAmount;
|
| | | }
|
| | |
|
| | | public Integer getMallCouponMaxDiscountAmount() {
|
| | | return mallCouponMaxDiscountAmount;
|
| | | }
|
| | |
|
| | | public void setMallCouponMaxDiscountAmount(Integer mallCouponMaxDiscountAmount) {
|
| | | this.mallCouponMaxDiscountAmount = mallCouponMaxDiscountAmount;
|
| | | }
|
| | |
|
| | | public Long getMallCouponTotalQuantity() {
|
| | | return mallCouponTotalQuantity;
|
| | | }
|
| | |
|
| | | public void setMallCouponTotalQuantity(Long mallCouponTotalQuantity) {
|
| | | this.mallCouponTotalQuantity = mallCouponTotalQuantity;
|
| | | }
|
| | |
|
| | | public Long getMallCouponRemainQuantity() {
|
| | | return mallCouponRemainQuantity;
|
| | | }
|
| | |
|
| | | public void setMallCouponRemainQuantity(Long mallCouponRemainQuantity) {
|
| | | this.mallCouponRemainQuantity = mallCouponRemainQuantity;
|
| | | }
|
| | |
|
| | | public Long getMallCouponStartTime() {
|
| | | return mallCouponStartTime;
|
| | | }
|
| | |
|
| | | public void setMallCouponStartTime(Long mallCouponStartTime) {
|
| | | this.mallCouponStartTime = mallCouponStartTime;
|
| | | }
|
| | |
|
| | | public Long getMallCouponEndTime() {
|
| | | return mallCouponEndTime;
|
| | | }
|
| | |
|
| | | public void setMallCouponEndTime(Long mallCouponEndTime) {
|
| | | this.mallCouponEndTime = mallCouponEndTime;
|
| | | }
|
| | |
|
| | | public Long getCreateAt() {
|
| | | return createAt;
|
| | | }
|
| | |
|
| | | public void setCreateAt(Long createAt) {
|
| | | this.createAt = createAt;
|
| | | }
|
| | |
|
| | | public String getGoodsName() {
|
| | | return goodsName;
|
| | | }
|
| | |
|
| | | public void setGoodsName(String goodsName) {
|
| | | this.goodsName = goodsName;
|
| | | }
|
| | |
|
| | | public String getGoodsDesc() {
|
| | | return goodsDesc;
|
| | | }
|
| | |
|
| | | public void setGoodsDesc(String goodsDesc) {
|
| | | this.goodsDesc = goodsDesc;
|
| | | }
|
| | |
|
| | | public String getGoodsThumbnailUrl() {
|
| | | return goodsThumbnailUrl;
|
| | | }
|
| | |
|
| | | public void setGoodsThumbnailUrl(String goodsThumbnailUrl) {
|
| | | this.goodsThumbnailUrl = goodsThumbnailUrl;
|
| | | }
|
| | |
|
| | | public String getGoodsImageUrl() {
|
| | | return goodsImageUrl;
|
| | | }
|
| | |
|
| | | public void setGoodsImageUrl(String goodsImageUrl) {
|
| | | this.goodsImageUrl = goodsImageUrl;
|
| | | }
|
| | |
|
| | | public String[] getGoodsGalleryUrls() {
|
| | | return goodsGalleryUrls;
|
| | | }
|
| | |
|
| | | public void setGoodsGalleryUrls(String[] goodsGalleryUrls) {
|
| | | this.goodsGalleryUrls = goodsGalleryUrls;
|
| | | }
|
| | |
|
| | | public Long getSoldQuantity() {
|
| | | return soldQuantity;
|
| | | }
|
| | |
|
| | | public void setSoldQuantity(Long soldQuantity) {
|
| | | this.soldQuantity = soldQuantity;
|
| | | }
|
| | |
|
| | | public Long getMinGroupPrice() {
|
| | | return minGroupPrice;
|
| | | }
|
| | |
|
| | | public void setMinGroupPrice(Long minGroupPrice) {
|
| | | this.minGroupPrice = minGroupPrice;
|
| | | }
|
| | |
|
| | | public Long getMinNormalPrice() {
|
| | | return minNormalPrice;
|
| | | }
|
| | |
|
| | | public void setMinNormalPrice(Long minNormalPrice) {
|
| | | this.minNormalPrice = minNormalPrice;
|
| | | }
|
| | |
|
| | | public String getMallName() {
|
| | | return mallName;
|
| | | }
|
| | |
|
| | | public void setMallName(String mallName) {
|
| | | this.mallName = mallName;
|
| | | }
|
| | |
|
| | | public Integer getMerchantType() {
|
| | | return merchantType;
|
| | | }
|
| | |
|
| | | public void setMerchantType(Integer merchantType) {
|
| | | this.merchantType = merchantType;
|
| | | }
|
| | |
|
| | | public Long getCategoryId() {
|
| | | return categoryId;
|
| | | }
|
| | |
|
| | | public void setCategoryId(Long categoryId) {
|
| | | this.categoryId = categoryId;
|
| | | }
|
| | |
|
| | | public String getCategoryName() {
|
| | | return categoryName;
|
| | | }
|
| | |
|
| | | public void setCategoryName(String categoryName) {
|
| | | this.categoryName = categoryName;
|
| | | }
|
| | |
|
| | | public Long getOptId() {
|
| | | return optId;
|
| | | }
|
| | |
|
| | | public void setOptId(Long optId) {
|
| | | this.optId = optId;
|
| | | }
|
| | |
|
| | | public String getOptName() {
|
| | | return optName;
|
| | | }
|
| | |
|
| | | public void setOptName(String optName) {
|
| | | this.optName = optName;
|
| | | }
|
| | |
|
| | | public Long[] getOptIds() {
|
| | | return optIds;
|
| | | }
|
| | |
|
| | | public void setOptIds(Long[] optIds) {
|
| | | this.optIds = optIds;
|
| | | }
|
| | |
|
| | | public Long[] getCatIds() {
|
| | | return catIds;
|
| | | }
|
| | |
|
| | | public void setCatIds(Long[] catIds) {
|
| | | this.catIds = catIds;
|
| | | }
|
| | |
|
| | | public Integer getMallCps() {
|
| | | return mallCps;
|
| | | }
|
| | |
|
| | | public void setMallCps(Integer mallCps) {
|
| | | this.mallCps = mallCps;
|
| | | }
|
| | |
|
| | | public Boolean getHasCoupon() {
|
| | | return hasCoupon;
|
| | | }
|
| | |
|
| | | public void setHasCoupon(Boolean hasCoupon) {
|
| | | this.hasCoupon = hasCoupon;
|
| | | }
|
| | |
|
| | | public Long getCouponMinOrderAmount() {
|
| | | return couponMinOrderAmount;
|
| | | }
|
| | |
|
| | | public void setCouponMinOrderAmount(Long couponMinOrderAmount) {
|
| | | this.couponMinOrderAmount = couponMinOrderAmount;
|
| | | }
|
| | |
|
| | | public Long getCouponDiscount() {
|
| | | return couponDiscount;
|
| | | }
|
| | |
|
| | | public void setCouponDiscount(Long couponDiscount) {
|
| | | this.couponDiscount = couponDiscount;
|
| | | }
|
| | |
|
| | | public Long getCouponTotalQuantity() {
|
| | | return couponTotalQuantity;
|
| | | }
|
| | |
|
| | | public void setCouponTotalQuantity(Long couponTotalQuantity) {
|
| | | this.couponTotalQuantity = couponTotalQuantity;
|
| | | }
|
| | |
|
| | | public Long getCouponRemainQuantity() {
|
| | | return couponRemainQuantity;
|
| | | }
|
| | |
|
| | | public void setCouponRemainQuantity(Long couponRemainQuantity) {
|
| | | this.couponRemainQuantity = couponRemainQuantity;
|
| | | }
|
| | |
|
| | | public Long getCouponStartTime() {
|
| | | return couponStartTime;
|
| | | }
|
| | |
|
| | | public void setCouponStartTime(Long couponStartTime) {
|
| | | this.couponStartTime = couponStartTime;
|
| | | }
|
| | |
|
| | | public Long getCouponEndTime() {
|
| | | return couponEndTime;
|
| | | }
|
| | |
|
| | | public void setCouponEndTime(Long couponEndTime) {
|
| | | this.couponEndTime = couponEndTime;
|
| | | }
|
| | |
|
| | | public Long getPromotionRate() {
|
| | | return promotionRate;
|
| | | }
|
| | |
|
| | | public void setPromotionRate(Long promotionRate) {
|
| | | this.promotionRate = promotionRate;
|
| | | }
|
| | |
|
| | | public String getGoodsEvalScore() {
|
| | | return goodsEvalScore;
|
| | | }
|
| | |
|
| | | public void setGoodsEvalScore(String goodsEvalScore) {
|
| | | this.goodsEvalScore = goodsEvalScore;
|
| | | }
|
| | |
|
| | | public Long getGoodsEvalCount() {
|
| | | return goodsEvalCount;
|
| | | }
|
| | |
|
| | | public void setGoodsEvalCount(Long goodsEvalCount) {
|
| | | this.goodsEvalCount = goodsEvalCount;
|
| | | }
|
| | |
|
| | | public Long getAvgDesc() {
|
| | | return avgDesc;
|
| | | }
|
| | |
|
| | | public void setAvgDesc(Long avgDesc) {
|
| | | this.avgDesc = avgDesc;
|
| | | }
|
| | |
|
| | | public Long getAvgLgst() {
|
| | | return avgLgst;
|
| | | }
|
| | |
|
| | | public void setAvgLgst(Long avgLgst) {
|
| | | this.avgLgst = avgLgst;
|
| | | }
|
| | |
|
| | | public Long getAvgServ() {
|
| | | return avgServ;
|
| | | }
|
| | |
|
| | | public void setAvgServ(Long avgServ) {
|
| | | this.avgServ = avgServ;
|
| | | }
|
| | |
|
| | | public BigDecimal getDescPct() {
|
| | | return descPct;
|
| | | }
|
| | |
|
| | | public void setDescPct(BigDecimal descPct) {
|
| | | this.descPct = descPct;
|
| | | }
|
| | |
|
| | | public BigDecimal getLgstPct() {
|
| | | return lgstPct;
|
| | | }
|
| | |
|
| | | public void setLgstPct(BigDecimal lgstPct) {
|
| | | this.lgstPct = lgstPct;
|
| | | }
|
| | |
|
| | | public BigDecimal getServPct() {
|
| | | return servPct;
|
| | | }
|
| | |
|
| | | public void setServPct(BigDecimal servPct) {
|
| | | this.servPct = servPct;
|
| | | }
|
| | |
|
| | | public String getSalesTip() {
|
| | | return salesTip;
|
| | | }
|
| | |
|
| | | public void setSalesTip(String salesTip) {
|
| | | this.salesTip = salesTip;
|
| | | }
|
| | |
|
| | | public Integer getActivityType() {
|
| | | return activityType;
|
| | | }
|
| | |
|
| | | public void setActivityType(Integer activityType) {
|
| | | this.activityType = activityType;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dto.pdd;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | public class PDDGoodsResult {
|
| | | private int totalCount;// 总数量
|
| | | private List<PDDGoodsDetail> goodsList;// 商品列表
|
| | |
|
| | | public PDDGoodsResult() {
|
| | | }
|
| | |
|
| | | public PDDGoodsResult(int totalCount, List<PDDGoodsDetail> goodsList) {
|
| | | this.totalCount = totalCount;
|
| | | this.goodsList = goodsList;
|
| | | }
|
| | |
|
| | | public int getTotalCount() {
|
| | | return totalCount;
|
| | | }
|
| | |
|
| | | public void setTotalCount(int totalCount) {
|
| | | this.totalCount = totalCount;
|
| | | }
|
| | |
|
| | | public List<PDDGoodsDetail> getGoodsList() {
|
| | | return goodsList;
|
| | | }
|
| | |
|
| | | public void setGoodsList(List<PDDGoodsDetail> goodsList) {
|
| | | this.goodsList = goodsList;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dto.pdd;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.pdd.PDDOrder;
|
| | |
|
| | | public class PDDOrderResult {
|
| | | private int totalCount;// 总数量
|
| | | private List<PDDOrder> orderList;// 商品列表
|
| | |
|
| | | public PDDOrderResult() {
|
| | | }
|
| | |
|
| | | public PDDOrderResult(int totalCount, List<PDDOrder> orderList) {
|
| | | this.totalCount = totalCount;
|
| | | this.orderList = orderList;
|
| | | }
|
| | |
|
| | | public int getTotalCount() {
|
| | | return totalCount;
|
| | | }
|
| | |
|
| | | public void setTotalCount(int totalCount) {
|
| | | this.totalCount = totalCount;
|
| | | }
|
| | |
|
| | | public List<PDDOrder> getGoodsList() {
|
| | | return orderList;
|
| | | }
|
| | |
|
| | | public void setGoodsList(List<PDDOrder> orderList) {
|
| | | this.orderList = orderList;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dto.pdd;
|
| | |
|
| | | public class PDDSearchFilter {
|
| | | private String kw;// 关键字
|
| | | private Long optId;// 标签类目ID
|
| | | private Integer page;// 页码
|
| | | private Integer pageSize;// 页数量
|
| | | private Integer sortType;// 排序类型
|
| | | private Boolean hasCoupon;// 是否有券
|
| | | private Long catId;// 分类ID
|
| | | private Long[] goodsIdList;// 商品列表ID
|
| | | private Integer merchantType;// 卖家类型
|
| | | private String pid;// 推广位ID
|
| | |
|
| | | public String getKw() {
|
| | | return kw;
|
| | | }
|
| | |
|
| | | public void setKw(String kw) {
|
| | | this.kw = kw;
|
| | | }
|
| | |
|
| | | public Long getOptId() {
|
| | | return optId;
|
| | | }
|
| | |
|
| | | public void setOptId(Long optId) {
|
| | | this.optId = optId;
|
| | | }
|
| | |
|
| | | public Integer getPage() {
|
| | | return page;
|
| | | }
|
| | |
|
| | | public void setPage(Integer page) {
|
| | | this.page = page;
|
| | | }
|
| | |
|
| | | public Integer getPageSize() {
|
| | | return pageSize;
|
| | | }
|
| | |
|
| | | public void setPageSize(Integer pageSize) {
|
| | | this.pageSize = pageSize;
|
| | | }
|
| | |
|
| | | public Integer getSortType() {
|
| | | return sortType;
|
| | | }
|
| | |
|
| | | public void setSortType(Integer sortType) {
|
| | | this.sortType = sortType;
|
| | | }
|
| | |
|
| | | public Boolean getHasCoupon() {
|
| | | return hasCoupon;
|
| | | }
|
| | |
|
| | | public void setHasCoupon(Boolean hasCoupon) {
|
| | | this.hasCoupon = hasCoupon;
|
| | | }
|
| | |
|
| | | public Long getCatId() {
|
| | | return catId;
|
| | | }
|
| | |
|
| | | public void setCatId(Long catId) {
|
| | | this.catId = catId;
|
| | | }
|
| | |
|
| | | public Long[] getGoodsIdList() {
|
| | | return goodsIdList;
|
| | | }
|
| | |
|
| | | public void setGoodsIdList(Long[] goodsIdList) {
|
| | | this.goodsIdList = goodsIdList;
|
| | | }
|
| | |
|
| | | public Integer getMerchantType() {
|
| | | return merchantType;
|
| | | }
|
| | |
|
| | | public void setMerchantType(Integer merchantType) {
|
| | | this.merchantType = merchantType;
|
| | | }
|
| | |
|
| | | public String getPid() {
|
| | | return pid;
|
| | | }
|
| | |
|
| | | public void setPid(String pid) {
|
| | | this.pid = pid;
|
| | | }
|
| | | }
|
| | |
| | | public class MsgDeviceReadState {
|
| | | public static String TYPE_ZHUSHOU = "zhushou";// 返利券小助手
|
| | | public static String TYPE_RECOMMEND = "recommend";// 推荐
|
| | | public static String TYPE_KEFU = "kefu";
|
| | |
|
| | | @Column(name = "mdrs_id")
|
| | | private Long id;
|
| | |
| | | private Date readTime;
|
| | | @Column(name = "mdrs_unread_count")
|
| | | private Integer unReadCount;
|
| | | @Column(name = "mdrs_latest_content")
|
| | | private String latestContent;//最近的未读消息
|
| | | @Column(name = "mdrs_createtime")
|
| | | private Date createTime;
|
| | | @Column(name = "mdrs_update_time")
|
| | |
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | | |
| | | public String getLatestContent() {
|
| | | return latestContent;
|
| | | }
|
| | |
|
| | | public void setLatestContent(String latestContent) {
|
| | | this.latestContent = latestContent;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.pdd;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | import com.google.gson.annotations.SerializedName;
|
| | |
|
| | | /**
|
| | | * 拼多多订单
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_pdd_order")
|
| | | public class PDDOrder {
|
| | | @Column(name = "po_id")
|
| | | private Long id;
|
| | | @SerializedName("order_sn")
|
| | | @Column(name = "po_order_sn")
|
| | | private String orderSn;// 推广订单编号
|
| | | @SerializedName("goods_id")
|
| | | @Column(name = "po_goods_id")
|
| | | private Long goodsId;// 商品ID
|
| | | @SerializedName("group_id")
|
| | | @Column(name = "po_group_id")
|
| | | private Long groupId;// 成团ID
|
| | | @SerializedName("goods_name")
|
| | | @Column(name = "po_goods_name")
|
| | | private String goodsName;// 商品标题
|
| | | @SerializedName("goods_thumbnail_url")
|
| | | @Column(name = "po_goods_thumbnail_url")
|
| | | private String goodsThumbnailUrl;// 商品缩略图
|
| | | @SerializedName("goods_quantity")
|
| | | @Column(name = "po_goods_quantity")
|
| | | private Integer goodsQuantity;// 购买商品的数量
|
| | | @SerializedName("goods_price")
|
| | | @Column(name = "po_goods_price")
|
| | | private Long goodsPrice;// 订单中sku的单件价格,单位为分
|
| | | @SerializedName("order_amount")
|
| | | @Column(name = "po_order_amount")
|
| | | private Long orderAmount;// 实际支付金额,单位为分
|
| | | @SerializedName("p_id")
|
| | | @Column(name = "po_p_id")
|
| | | private String pId;// 推广位ID
|
| | | @SerializedName("promotion_rate")
|
| | | @Column(name = "po_promotion_rate")
|
| | | private Long promotionRate;// 佣金比例,千分比
|
| | | @SerializedName("promotion_amount")
|
| | | @Column(name = "po_promotion_amount")
|
| | | private Long promotionAmount;// 佣金金额,单位为分
|
| | | @SerializedName("order_status")
|
| | | @Column(name = "po_order_status")
|
| | | private Integer orderStatus;// 订单状态: -1 未支付;
|
| | | // 0-已支付;1-已成团;2-确认收货;3-审核成功;4-审核失败(不可提现);5-已经结算;8-非多多进宝商品(无佣金订单)
|
| | | @SerializedName("order_status_desc")
|
| | | @Column(name = "po_order_status_desc")
|
| | | private String orderStatusDesc;// 订单状态描述
|
| | | @SerializedName("order_create_time")
|
| | | @Column(name = "po_order_create_time")
|
| | | private Long orderCreateTime;// 订单生成时间,UNIX时间戳
|
| | | @SerializedName("order_pay_time")
|
| | | @Column(name = "po_order_pay_time")
|
| | | private Long orderPayTime;// 支付时间
|
| | | @SerializedName("order_group_success_time")
|
| | | @Column(name = "po_order_group_success_time")
|
| | | private Long orderGroupSuccessTime;// 成团时间
|
| | | @SerializedName("order_verify_time")
|
| | | @Column(name = "po_order_verify_time")
|
| | | private Long orderVerifyTime;// 审核时间
|
| | | @SerializedName("order_modify_at")
|
| | | @Column(name = "po_order_modify_at")
|
| | | private Long orderModifyAt;// 最后更新时间
|
| | | @SerializedName("custom_parameters")
|
| | | @Column(name = "po_custom_parameters")
|
| | | private String customParameters;// 自定义参数
|
| | | @SerializedName("order_settle_time")
|
| | | @Column(name = "po_order_settle_time")
|
| | | private Long orderSettleTime;// 订单结算时间
|
| | | @SerializedName("order_id")
|
| | | @Column(name = "po_order_id")
|
| | | private String orderId;// 订单编号
|
| | | @Column(name = "po_create_time")
|
| | | private Date createTime;// 创建时间
|
| | | @Column(name = "po_update_time")
|
| | | private Date updateTime;// 更新时间
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | public Date getUpdateTime() {
|
| | | return updateTime;
|
| | | }
|
| | |
|
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public String getOrderSn() {
|
| | | return orderSn;
|
| | | }
|
| | |
|
| | | public void setOrderSn(String orderSn) {
|
| | | this.orderSn = orderSn;
|
| | | }
|
| | |
|
| | | public Long getGoodsId() {
|
| | | return goodsId;
|
| | | }
|
| | |
|
| | | public void setGoodsId(Long goodsId) {
|
| | | this.goodsId = goodsId;
|
| | | }
|
| | |
|
| | | public Long getGroupId() {
|
| | | return groupId;
|
| | | }
|
| | |
|
| | | public void setGroupId(Long groupId) {
|
| | | this.groupId = groupId;
|
| | | }
|
| | |
|
| | | public String getGoodsName() {
|
| | | return goodsName;
|
| | | }
|
| | |
|
| | | public void setGoodsName(String goodsName) {
|
| | | this.goodsName = goodsName;
|
| | | }
|
| | |
|
| | | public String getGoodsThumbnailUrl() {
|
| | | return goodsThumbnailUrl;
|
| | | }
|
| | |
|
| | | public void setGoodsThumbnailUrl(String goodsThumbnailUrl) {
|
| | | this.goodsThumbnailUrl = goodsThumbnailUrl;
|
| | | }
|
| | |
|
| | | public Integer getGoodsQuantity() {
|
| | | return goodsQuantity;
|
| | | }
|
| | |
|
| | | public void setGoodsQuantity(Integer goodsQuantity) {
|
| | | this.goodsQuantity = goodsQuantity;
|
| | | }
|
| | |
|
| | | public Long getGoodsPrice() {
|
| | | return goodsPrice;
|
| | | }
|
| | |
|
| | | public void setGoodsPrice(Long goodsPrice) {
|
| | | this.goodsPrice = goodsPrice;
|
| | | }
|
| | |
|
| | | public Long getOrderAmount() {
|
| | | return orderAmount;
|
| | | }
|
| | |
|
| | | public void setOrderAmount(Long orderAmount) {
|
| | | this.orderAmount = orderAmount;
|
| | | }
|
| | |
|
| | | public String getpId() {
|
| | | return pId;
|
| | | }
|
| | |
|
| | | public void setpId(String pId) {
|
| | | this.pId = pId;
|
| | | }
|
| | |
|
| | | public Long getPromotionRate() {
|
| | | return promotionRate;
|
| | | }
|
| | |
|
| | | public void setPromotionRate(Long promotionRate) {
|
| | | this.promotionRate = promotionRate;
|
| | | }
|
| | |
|
| | | public Long getPromotionAmount() {
|
| | | return promotionAmount;
|
| | | }
|
| | |
|
| | | public void setPromotionAmount(Long promotionAmount) {
|
| | | this.promotionAmount = promotionAmount;
|
| | | }
|
| | |
|
| | | public Integer getOrderStatus() {
|
| | | return orderStatus;
|
| | | }
|
| | |
|
| | | public void setOrderStatus(Integer orderStatus) {
|
| | | this.orderStatus = orderStatus;
|
| | | }
|
| | |
|
| | | public String getOrderStatusDesc() {
|
| | | return orderStatusDesc;
|
| | | }
|
| | |
|
| | | public void setOrderStatusDesc(String orderStatusDesc) {
|
| | | this.orderStatusDesc = orderStatusDesc;
|
| | | }
|
| | |
|
| | | public Long getOrderCreateTime() {
|
| | | return orderCreateTime;
|
| | | }
|
| | |
|
| | | public void setOrderCreateTime(Long orderCreateTime) {
|
| | | this.orderCreateTime = orderCreateTime;
|
| | | }
|
| | |
|
| | | public Long getOrderPayTime() {
|
| | | return orderPayTime;
|
| | | }
|
| | |
|
| | | public void setOrderPayTime(Long orderPayTime) {
|
| | | this.orderPayTime = orderPayTime;
|
| | | }
|
| | |
|
| | | public Long getOrderGroupSuccessTime() {
|
| | | return orderGroupSuccessTime;
|
| | | }
|
| | |
|
| | | public void setOrderGroupSuccessTime(Long orderGroupSuccessTime) {
|
| | | this.orderGroupSuccessTime = orderGroupSuccessTime;
|
| | | }
|
| | |
|
| | | public Long getOrderVerifyTime() {
|
| | | return orderVerifyTime;
|
| | | }
|
| | |
|
| | | public void setOrderVerifyTime(Long orderVerifyTime) {
|
| | | this.orderVerifyTime = orderVerifyTime;
|
| | | }
|
| | |
|
| | | public Long getOrderModifyAt() {
|
| | | return orderModifyAt;
|
| | | }
|
| | |
|
| | | public void setOrderModifyAt(Long orderModifyAt) {
|
| | | this.orderModifyAt = orderModifyAt;
|
| | | }
|
| | |
|
| | | public String getCustomParameters() {
|
| | | return customParameters;
|
| | | }
|
| | |
|
| | | public void setCustomParameters(String customParameters) {
|
| | | this.customParameters = customParameters;
|
| | | }
|
| | |
|
| | | public Long getOrderSettleTime() {
|
| | | return orderSettleTime;
|
| | | }
|
| | |
|
| | | public void setOrderSettleTime(Long orderSettleTime) {
|
| | | this.orderSettleTime = orderSettleTime;
|
| | | }
|
| | |
|
| | | public String getOrderId() {
|
| | | return orderId;
|
| | | }
|
| | |
|
| | | public void setOrderId(String orderId) {
|
| | | this.orderId = orderId;
|
| | | }
|
| | | }
|
| | |
| | | public class TaoKeAppInfo {
|
| | | private String appKey;
|
| | | private String appSecret;
|
| | | public TaoKeAppInfo(String appKey, String appSecret) {
|
| | | this.appKey = appKey;
|
| | | this.appSecret = appSecret;
|
| | | }
|
| | | |
| | | public TaoKeAppInfo() {
|
| | | }
|
| | |
|
| | | private String pid;
|
| | | private String adzoneId;
|
| | |
|
New file |
| | |
| | | package com.yeshi.fanli.entity.taobao.dataoke;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | |
|
| | | import org.springframework.data.annotation.Id;
|
| | | import org.springframework.data.mongodb.core.mapping.Document;
|
| | | import org.springframework.data.mongodb.core.mapping.Field;
|
| | |
|
| | | @Document(collection = "daTaoKeGoods")
|
| | | public class DaTaoKeDetailV2 {
|
| | | @Id
|
| | | private Long id;// 商品ID
|
| | | @Field
|
| | | private Long goodsId;// 淘宝商品ID
|
| | | @Field
|
| | | private String title;// 标题
|
| | | @Field
|
| | | private String dtitle;// 大淘客标题
|
| | | @Field
|
| | | private BigDecimal originalPrice;// 原价
|
| | | @Field
|
| | | private BigDecimal actualPrice;// 券后价
|
| | | @Field
|
| | | private Integer shopType;// 店铺类型,1-天猫,0-淘宝
|
| | | @Field
|
| | | private Integer goldSellers;// 是否金牌卖家,1-金牌卖家,0-非金牌卖家
|
| | | @Field
|
| | | private Integer monthSales;// 30天销量
|
| | | @Field
|
| | | private Integer twoHoursSales;// 2小时销量
|
| | | @Field
|
| | | private Integer dailySales;// 当日销量
|
| | | @Field
|
| | | private Integer commissionType;// 佣金类型,0-通用,1-定向,2-高佣,3-营销计划
|
| | | @Field
|
| | | private String desc;// 推广文案
|
| | | @Field
|
| | | private Integer couponReceiveNum;// 领券量
|
| | | @Field
|
| | | private String couponLink;// 领券链接
|
| | | @Field
|
| | | private Date couponEndTime;// 优惠券结束时间
|
| | | @Field
|
| | | private Date couponStartTime;// 优惠券开始时间
|
| | | @Field
|
| | | private BigDecimal couponPrice;// 优惠券金额
|
| | | @Field
|
| | | private String couponConditions;// 优惠券使用条件
|
| | | @Field
|
| | | private String couponId;// 券ID
|
| | | @Field
|
| | | private Integer activityType;// 活动类型,1-无活动,2-淘抢购,3-聚划算
|
| | | @Field
|
| | | private Date createTime;// 商品创建时间
|
| | | @Field
|
| | | private String mainPic;// 商品主图链接
|
| | | @Field
|
| | | private String marketingMainPic;// 营销主图链接
|
| | | @Field
|
| | | private Long sellerId;// 淘宝卖家id
|
| | | @Field
|
| | | private Integer cid;// 商品在大淘客的分类id
|
| | | @Field
|
| | | private BigDecimal discounts;// 折扣力度
|
| | | @Field
|
| | | private BigDecimal commissionRate;// 佣金比例
|
| | | @Field
|
| | | private Integer couponTotalNum;// 券总量
|
| | | @Field
|
| | | private Integer haitao;// 是否海淘,1-海淘商品,0-非海淘商品
|
| | | @Field
|
| | | private String activityStartTime;// 活动开始时间
|
| | | @Field
|
| | | private String activityEndTime;// 活动结束时间
|
| | | @Field
|
| | | private String shopName;// 店铺名称
|
| | | @Field
|
| | | private Integer shopLevel;// 淘宝店铺等级
|
| | | @Field
|
| | | private BigDecimal descScore;// 描述分
|
| | | @Field
|
| | | private Integer brand;// 是否是品牌商品
|
| | | @Field
|
| | | private String brandId;// 品牌id
|
| | | @Field
|
| | | private String brandName;// 品牌名称
|
| | | @Field
|
| | | private Integer hotPush;// 热推值
|
| | | @Field
|
| | | private String teamName;// 放单人名称
|
| | | @Field
|
| | | private String itemLink;// 商品淘宝链接
|
| | | @Field
|
| | | private Integer tchaoshi;// 是否天猫超市商品,1-天猫超市商品,0-非天猫超市商品
|
| | | @Field
|
| | | private Integer tbcid;// 商品在淘宝的二级分类id ,非大淘客的二级分类
|
| | | @Field
|
| | | private Date updateTime;
|
| | |
|
| | | public Date getUpdateTime() {
|
| | | return updateTime;
|
| | | }
|
| | |
|
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Long getGoodsId() {
|
| | | return goodsId;
|
| | | }
|
| | |
|
| | | public void setGoodsId(Long goodsId) {
|
| | | this.goodsId = goodsId;
|
| | | }
|
| | |
|
| | | public String getTitle() {
|
| | | return title;
|
| | | }
|
| | |
|
| | | public void setTitle(String title) {
|
| | | this.title = title;
|
| | | }
|
| | |
|
| | | public String getDtitle() {
|
| | | return dtitle;
|
| | | }
|
| | |
|
| | | public void setDtitle(String dtitle) {
|
| | | this.dtitle = dtitle;
|
| | | }
|
| | |
|
| | | public BigDecimal getOriginalPrice() {
|
| | | return originalPrice;
|
| | | }
|
| | |
|
| | | public void setOriginalPrice(BigDecimal originalPrice) {
|
| | | this.originalPrice = originalPrice;
|
| | | }
|
| | |
|
| | | public BigDecimal getActualPrice() {
|
| | | return actualPrice;
|
| | | }
|
| | |
|
| | | public void setActualPrice(BigDecimal actualPrice) {
|
| | | this.actualPrice = actualPrice;
|
| | | }
|
| | |
|
| | | public Integer getShopType() {
|
| | | return shopType;
|
| | | }
|
| | |
|
| | | public void setShopType(Integer shopType) {
|
| | | this.shopType = shopType;
|
| | | }
|
| | |
|
| | | public Integer getGoldSellers() {
|
| | | return goldSellers;
|
| | | }
|
| | |
|
| | | public void setGoldSellers(Integer goldSellers) {
|
| | | this.goldSellers = goldSellers;
|
| | | }
|
| | |
|
| | | public Integer getMonthSales() {
|
| | | return monthSales;
|
| | | }
|
| | |
|
| | | public void setMonthSales(Integer monthSales) {
|
| | | this.monthSales = monthSales;
|
| | | }
|
| | |
|
| | | public Integer getTwoHoursSales() {
|
| | | return twoHoursSales;
|
| | | }
|
| | |
|
| | | public void setTwoHoursSales(Integer twoHoursSales) {
|
| | | this.twoHoursSales = twoHoursSales;
|
| | | }
|
| | |
|
| | | public Integer getDailySales() {
|
| | | return dailySales;
|
| | | }
|
| | |
|
| | | public void setDailySales(Integer dailySales) {
|
| | | this.dailySales = dailySales;
|
| | | }
|
| | |
|
| | | public Integer getCommissionType() {
|
| | | return commissionType;
|
| | | }
|
| | |
|
| | | public void setCommissionType(Integer commissionType) {
|
| | | this.commissionType = commissionType;
|
| | | }
|
| | |
|
| | | public String getDesc() {
|
| | | return desc;
|
| | | }
|
| | |
|
| | | public void setDesc(String desc) {
|
| | | this.desc = desc;
|
| | | }
|
| | |
|
| | | public Integer getCouponReceiveNum() {
|
| | | return couponReceiveNum;
|
| | | }
|
| | |
|
| | | public void setCouponReceiveNum(Integer couponReceiveNum) {
|
| | | this.couponReceiveNum = couponReceiveNum;
|
| | | }
|
| | |
|
| | | public String getCouponLink() {
|
| | | return couponLink;
|
| | | }
|
| | |
|
| | | public void setCouponLink(String couponLink) {
|
| | | this.couponLink = couponLink;
|
| | | }
|
| | |
|
| | | public Date getCouponEndTime() {
|
| | | return couponEndTime;
|
| | | }
|
| | |
|
| | | public void setCouponEndTime(Date couponEndTime) {
|
| | | this.couponEndTime = couponEndTime;
|
| | | }
|
| | |
|
| | | public Date getCouponStartTime() {
|
| | | return couponStartTime;
|
| | | }
|
| | |
|
| | | public void setCouponStartTime(Date couponStartTime) {
|
| | | this.couponStartTime = couponStartTime;
|
| | | }
|
| | |
|
| | | public BigDecimal getCouponPrice() {
|
| | | return couponPrice;
|
| | | }
|
| | |
|
| | | public void setCouponPrice(BigDecimal couponPrice) {
|
| | | this.couponPrice = couponPrice;
|
| | | }
|
| | |
|
| | | public String getCouponConditions() {
|
| | | return couponConditions;
|
| | | }
|
| | |
|
| | | public void setCouponConditions(String couponConditions) {
|
| | | this.couponConditions = couponConditions;
|
| | | }
|
| | |
|
| | | public String getCouponId() {
|
| | | return couponId;
|
| | | }
|
| | |
|
| | | public void setCouponId(String couponId) {
|
| | | this.couponId = couponId;
|
| | | }
|
| | |
|
| | | public Integer getActivityType() {
|
| | | return activityType;
|
| | | }
|
| | |
|
| | | public void setActivityType(Integer activityType) {
|
| | | this.activityType = activityType;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | public String getMainPic() {
|
| | | return mainPic;
|
| | | }
|
| | |
|
| | | public void setMainPic(String mainPic) {
|
| | | this.mainPic = mainPic;
|
| | | }
|
| | |
|
| | | public String getMarketingMainPic() {
|
| | | return marketingMainPic;
|
| | | }
|
| | |
|
| | | public void setMarketingMainPic(String marketingMainPic) {
|
| | | this.marketingMainPic = marketingMainPic;
|
| | | }
|
| | |
|
| | | public Long getSellerId() {
|
| | | return sellerId;
|
| | | }
|
| | |
|
| | | public void setSellerId(Long sellerId) {
|
| | | this.sellerId = sellerId;
|
| | | }
|
| | |
|
| | | public Integer getCid() {
|
| | | return cid;
|
| | | }
|
| | |
|
| | | public void setCid(Integer cid) {
|
| | | this.cid = cid;
|
| | | }
|
| | |
|
| | | public BigDecimal getDiscounts() {
|
| | | return discounts;
|
| | | }
|
| | |
|
| | | public void setDiscounts(BigDecimal discounts) {
|
| | | this.discounts = discounts;
|
| | | }
|
| | |
|
| | | public BigDecimal getCommissionRate() {
|
| | | return commissionRate;
|
| | | }
|
| | |
|
| | | public void setCommissionRate(BigDecimal commissionRate) {
|
| | | this.commissionRate = commissionRate;
|
| | | }
|
| | |
|
| | | public Integer getCouponTotalNum() {
|
| | | return couponTotalNum;
|
| | | }
|
| | |
|
| | | public void setCouponTotalNum(Integer couponTotalNum) {
|
| | | this.couponTotalNum = couponTotalNum;
|
| | | }
|
| | |
|
| | | public Integer getHaitao() {
|
| | | return haitao;
|
| | | }
|
| | |
|
| | | public void setHaitao(Integer haitao) {
|
| | | this.haitao = haitao;
|
| | | }
|
| | |
|
| | | public String getActivityStartTime() {
|
| | | return activityStartTime;
|
| | | }
|
| | |
|
| | | public void setActivityStartTime(String activityStartTime) {
|
| | | this.activityStartTime = activityStartTime;
|
| | | }
|
| | |
|
| | | public String getActivityEndTime() {
|
| | | return activityEndTime;
|
| | | }
|
| | |
|
| | | public void setActivityEndTime(String activityEndTime) {
|
| | | this.activityEndTime = activityEndTime;
|
| | | }
|
| | |
|
| | | public String getShopName() {
|
| | | return shopName;
|
| | | }
|
| | |
|
| | | public void setShopName(String shopName) {
|
| | | this.shopName = shopName;
|
| | | }
|
| | |
|
| | | public Integer getShopLevel() {
|
| | | return shopLevel;
|
| | | }
|
| | |
|
| | | public void setShopLevel(Integer shopLevel) {
|
| | | this.shopLevel = shopLevel;
|
| | | }
|
| | |
|
| | | public BigDecimal getDescScore() {
|
| | | return descScore;
|
| | | }
|
| | |
|
| | | public void setDescScore(BigDecimal descScore) {
|
| | | this.descScore = descScore;
|
| | | }
|
| | |
|
| | | public Integer getBrand() {
|
| | | return brand;
|
| | | }
|
| | |
|
| | | public void setBrand(Integer brand) {
|
| | | this.brand = brand;
|
| | | }
|
| | |
|
| | | public String getBrandId() {
|
| | | return brandId;
|
| | | }
|
| | |
|
| | | public void setBrandId(String brandId) {
|
| | | this.brandId = brandId;
|
| | | }
|
| | |
|
| | | public String getBrandName() {
|
| | | return brandName;
|
| | | }
|
| | |
|
| | | public void setBrandName(String brandName) {
|
| | | this.brandName = brandName;
|
| | | }
|
| | |
|
| | | public Integer getHotPush() {
|
| | | return hotPush;
|
| | | }
|
| | |
|
| | | public void setHotPush(Integer hotPush) {
|
| | | this.hotPush = hotPush;
|
| | | }
|
| | |
|
| | | public String getTeamName() {
|
| | | return teamName;
|
| | | }
|
| | |
|
| | | public void setTeamName(String teamName) {
|
| | | this.teamName = teamName;
|
| | | }
|
| | |
|
| | | public String getItemLink() {
|
| | | return itemLink;
|
| | | }
|
| | |
|
| | | public void setItemLink(String itemLink) {
|
| | | this.itemLink = itemLink;
|
| | | }
|
| | |
|
| | | public Integer getTchaoshi() {
|
| | | return tchaoshi;
|
| | | }
|
| | |
|
| | | public void setTchaoshi(Integer tchaoshi) {
|
| | | this.tchaoshi = tchaoshi;
|
| | | }
|
| | |
|
| | | public Integer getTbcid() {
|
| | | return tbcid;
|
| | | }
|
| | |
|
| | | public void setTbcid(Integer tbcid) {
|
| | | this.tbcid = tbcid;
|
| | | }
|
| | | }
|
| | |
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | // 每天早上同步一次
|
| | | public void doSyncJobNew() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | try {
|
| | | new Thread(new Runnable() {
|
| | |
|
| | | @Override
|
| | | public void run() {
|
| | | daTaoKeGoodsService.startSyncGoods();
|
| | | }
|
| | | }).start();
|
| | |
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | jdbcType="TIMESTAMP" /> |
| | | <result column="mdrs_update_time" property="updateTime" |
| | | jdbcType="TIMESTAMP" /> |
| | | <result column="mdrs_latest_content" property="latestContent" |
| | | jdbcType="VARCHAR" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">mdrs_id,mdrs_device,mdrs_platform,mdrs_type,mdrs_read_time,mdrs_unread_count,mdrs_create_time,mdrs_update_time |
| | | <sql id="Base_Column_List">mdrs_id,mdrs_device,mdrs_platform,mdrs_type,mdrs_read_time,mdrs_unread_count,mdrs_create_time,mdrs_update_time,mdrs_latest_content |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | |
| | | from yeshi_ec_msg_device_read_state where mdrs_id = |
| | | #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectByDeviceAndPlatformAndType" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_msg_device_read_state where mdrs_device=#{device} and |
| | | mdrs_platform=#{platform} and mdrs_type=#{type} |
| | | </select> |
| | | |
| | | |
| | | <select id="listByDeviceAndPlatform" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_msg_device_read_state where mdrs_device=#{device} and |
| | | mdrs_platform=#{platform} |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_msg_device_read_state where mdrs_id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.msg.MsgDeviceReadState" |
| | | useGeneratedKeys="true" keyProperty="id">insert into |
| | | yeshi_ec_msg_device_read_state |
| | | (mdrs_id,mdrs_device,mdrs_platform,mdrs_type,mdrs_read_time,mdrs_unread_count,mdrs_create_time,mdrs_update_time) |
| | | (mdrs_id,mdrs_device,mdrs_platform,mdrs_type,mdrs_read_time,mdrs_unread_count,mdrs_create_time,mdrs_update_time,mdrs_latest_content) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{device,jdbcType=VARCHAR},#{platform,jdbcType=INTEGER},#{type,jdbcType=VARCHAR},#{readTime,jdbcType=TIMESTAMP},#{unReadCount,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP}) |
| | | (#{id,jdbcType=BIGINT},#{device,jdbcType=VARCHAR},#{platform,jdbcType=INTEGER},#{type,jdbcType=VARCHAR},#{readTime,jdbcType=TIMESTAMP},#{unReadCount,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{latestContent,jdbcType=VARCHAR}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.msg.MsgDeviceReadState" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | |
| | | <if test="unReadCount != null">mdrs_unread_count,</if> |
| | | <if test="createTime != null">mdrs_create_time,</if> |
| | | <if test="updateTime != null">mdrs_update_time,</if> |
| | | <if test="latestContent != null">mdrs_latest_content,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="unReadCount != null">#{unReadCount,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="latestContent != null">#{latestContent,jdbcType=VARCHAR}</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.msg.MsgDeviceReadState">update |
| | |
| | | #{readTime,jdbcType=TIMESTAMP},mdrs_unread_count = |
| | | #{unReadCount,jdbcType=INTEGER},mdrs_create_time = |
| | | #{createTime,jdbcType=TIMESTAMP},mdrs_update_time = |
| | | #{updateTime,jdbcType=TIMESTAMP} where mdrs_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | #{updateTime,jdbcType=TIMESTAMP} ,mdrs_latest_content |
| | | =#{latestContent,jdbcType=VARCHAR} where mdrs_id = |
| | | #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.msg.MsgDeviceReadState"> |
| | | update yeshi_ec_msg_device_read_state |
| | | <set> |
| | |
| | | <if test="unReadCount != null">mdrs_unread_count=#{unReadCount,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">mdrs_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">mdrs_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="id !=null">mdrs_id =#{id,jdbcType=BIGINT},</if> |
| | | <if test="latestContent !=null">mdrs_latest_content =#{latestContent,jdbcType=VARCHAR}, |
| | | </if> |
| | | </set> |
| | | where mdrs_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | |
| | | <update id="setAllMsgRead"> |
| | | update yeshi_ec_msg_device_read_state set |
| | | mdrs_read_time=now(),mdrs_unread_count=0,mdrs_update_time=now() |
| | | where |
| | | mdrs_device=#{device} and |
| | | mdrs_platform=#{platform} |
| | | </update> |
| | | |
| | | |
| | | <update id="setAllMsgRead">update yeshi_ec_msg_device_read_state set |
| | | mdrs_read_time=now(),mdrs_unread_count=0,mdrs_update_time=now() where |
| | | mdrs_device=#{device} and mdrs_platform=#{platform}</update> |
| | | </mapper> |
New file |
| | |
| | | <?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.entity.dao.PDDOrderMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.pdd.PDDOrder"> |
| | | <id column="po_id" property="id" jdbcType="BIGINT" /> |
| | | <result column="po_order_sn" property="orderSn" jdbcType="VARCHAR" /> |
| | | <result column="po_goods_id" property="goodsId" jdbcType="BIGINT" /> |
| | | <result column="po_group_id" property="groupId" jdbcType="BIGINT" /> |
| | | <result column="po_goods_name" property="goodsName" jdbcType="VARCHAR" /> |
| | | <result column="po_goods_thumbnail_url" property="goodsThumbnailUrl" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="po_goods_quantity" property="goodsQuantity" |
| | | jdbcType="INTEGER" /> |
| | | <result column="po_goods_price" property="goodsPrice" jdbcType="BIGINT" /> |
| | | <result column="po_order_amount" property="orderAmount" |
| | | jdbcType="BIGINT" /> |
| | | <result column="po_p_id" property="pId" jdbcType="VARCHAR" /> |
| | | <result column="po_promotion_rate" property="promotionRate" |
| | | jdbcType="BIGINT" /> |
| | | <result column="po_promotion_amount" property="promotionAmount" |
| | | jdbcType="BIGINT" /> |
| | | <result column="po_order_status" property="orderStatus" |
| | | jdbcType="INTEGER" /> |
| | | <result column="po_order_status_desc" property="orderStatusDesc" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="po_order_create_time" property="orderCreateTime" |
| | | jdbcType="BIGINT" /> |
| | | <result column="po_order_pay_time" property="orderPayTime" |
| | | jdbcType="BIGINT" /> |
| | | <result column="po_order_group_success_time" property="orderGroupSuccessTime" |
| | | jdbcType="BIGINT" /> |
| | | <result column="po_order_verify_time" property="orderVerifyTime" |
| | | jdbcType="BIGINT" /> |
| | | <result column="po_order_modify_at" property="orderModifyAt" |
| | | jdbcType="BIGINT" /> |
| | | <result column="po_custom_parameters" property="customParameters" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="po_order_settle_time" property="orderSettleTime" |
| | | jdbcType="BIGINT" /> |
| | | <result column="po_order_id" property="orderId" jdbcType="VARCHAR" /> |
| | | <result column="po_create_time" property="createTime" jdbcType="TIMESTAMP" /> |
| | | <result column="po_update_time" property="updateTime" jdbcType="TIMESTAMP" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">po_id,po_order_sn,po_goods_id,po_group_id,po_goods_name,po_goods_thumbnail_url,po_goods_quantity,po_goods_price,po_order_amount,po_p_id,po_promotion_rate,po_promotion_amount,po_order_status,po_order_status_desc,po_order_create_time,po_order_pay_time,po_order_group_success_time,po_order_verify_time,po_order_modify_at,po_custom_parameters,po_order_settle_time,po_order_id,po_create_time,po_update_time |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_pdd_order where po_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_pdd_order where po_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.pdd.PDDOrder" |
| | | useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_pdd_order |
| | | (po_id,po_order_sn,po_goods_id,po_group_id,po_goods_name,po_goods_thumbnail_url,po_goods_quantity,po_goods_price,po_order_amount,po_p_id,po_promotion_rate,po_promotion_amount,po_order_status,po_order_status_desc,po_order_create_time,po_order_pay_time,po_order_group_success_time,po_order_verify_time,po_order_modify_at,po_custom_parameters,po_order_settle_time,po_order_id,po_create_time,po_update_time) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{orderSn,jdbcType=VARCHAR},#{goodsId,jdbcType=BIGINT},#{groupId,jdbcType=BIGINT},#{goodsName,jdbcType=VARCHAR},#{goodsThumbnailUrl,jdbcType=VARCHAR},#{goodsQuantity,jdbcType=INTEGER},#{goodsPrice,jdbcType=BIGINT},#{orderAmount,jdbcType=BIGINT},#{pId,jdbcType=VARCHAR},#{promotionRate,jdbcType=BIGINT},#{promotionAmount,jdbcType=BIGINT},#{orderStatus,jdbcType=INTEGER},#{orderStatusDesc,jdbcType=VARCHAR},#{orderCreateTime,jdbcType=BIGINT},#{orderPayTime,jdbcType=BIGINT},#{orderGroupSuccessTime,jdbcType=BIGINT},#{orderVerifyTime,jdbcType=BIGINT},#{orderModifyAt,jdbcType=BIGINT},#{customParameters,jdbcType=VARCHAR},#{orderSettleTime,jdbcType=BIGINT},#{orderId,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.pdd.PDDOrder" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | | insert into yeshi_ec_pdd_order |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">po_id,</if> |
| | | <if test="orderSn != null">po_order_sn,</if> |
| | | <if test="goodsId != null">po_goods_id,</if> |
| | | <if test="groupId != null">po_group_id,</if> |
| | | <if test="goodsName != null">po_goods_name,</if> |
| | | <if test="goodsThumbnailUrl != null">po_goods_thumbnail_url,</if> |
| | | <if test="goodsQuantity != null">po_goods_quantity,</if> |
| | | <if test="goodsPrice != null">po_goods_price,</if> |
| | | <if test="orderAmount != null">po_order_amount,</if> |
| | | <if test="pId != null">po_p_id,</if> |
| | | <if test="promotionRate != null">po_promotion_rate,</if> |
| | | <if test="promotionAmount != null">po_promotion_amount,</if> |
| | | <if test="orderStatus != null">po_order_status,</if> |
| | | <if test="orderStatusDesc != null">po_order_status_desc,</if> |
| | | <if test="orderCreateTime != null">po_order_create_time,</if> |
| | | <if test="orderPayTime != null">po_order_pay_time,</if> |
| | | <if test="orderGroupSuccessTime != null">po_order_group_success_time,</if> |
| | | <if test="orderVerifyTime != null">po_order_verify_time,</if> |
| | | <if test="orderModifyAt != null">po_order_modify_at,</if> |
| | | <if test="customParameters != null">po_custom_parameters,</if> |
| | | <if test="orderSettleTime != null">po_order_settle_time,</if> |
| | | <if test="orderId != null">po_order_id,</if> |
| | | <if test="createTime != null">po_create_time,</if> |
| | | <if test="updateTime != null">po_update_time,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="orderSn != null">#{orderSn,jdbcType=VARCHAR},</if> |
| | | <if test="goodsId != null">#{goodsId,jdbcType=BIGINT},</if> |
| | | <if test="groupId != null">#{groupId,jdbcType=BIGINT},</if> |
| | | <if test="goodsName != null">#{goodsName,jdbcType=VARCHAR},</if> |
| | | <if test="goodsThumbnailUrl != null">#{goodsThumbnailUrl,jdbcType=VARCHAR},</if> |
| | | <if test="goodsQuantity != null">#{goodsQuantity,jdbcType=INTEGER},</if> |
| | | <if test="goodsPrice != null">#{goodsPrice,jdbcType=BIGINT},</if> |
| | | <if test="orderAmount != null">#{orderAmount,jdbcType=BIGINT},</if> |
| | | <if test="pId != null">#{pId,jdbcType=VARCHAR},</if> |
| | | <if test="promotionRate != null">#{promotionRate,jdbcType=BIGINT},</if> |
| | | <if test="promotionAmount != null">#{promotionAmount,jdbcType=BIGINT},</if> |
| | | <if test="orderStatus != null">#{orderStatus,jdbcType=INTEGER},</if> |
| | | <if test="orderStatusDesc != null">#{orderStatusDesc,jdbcType=VARCHAR},</if> |
| | | <if test="orderCreateTime != null">#{orderCreateTime,jdbcType=BIGINT},</if> |
| | | <if test="orderPayTime != null">#{orderPayTime,jdbcType=BIGINT},</if> |
| | | <if test="orderGroupSuccessTime != null">#{orderGroupSuccessTime,jdbcType=BIGINT},</if> |
| | | <if test="orderVerifyTime != null">#{orderVerifyTime,jdbcType=BIGINT},</if> |
| | | <if test="orderModifyAt != null">#{orderModifyAt,jdbcType=BIGINT},</if> |
| | | <if test="customParameters != null">#{customParameters,jdbcType=VARCHAR},</if> |
| | | <if test="orderSettleTime != null">#{orderSettleTime,jdbcType=BIGINT},</if> |
| | | <if test="orderId != null">#{orderId,jdbcType=VARCHAR},</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.pdd.PDDOrder">update |
| | | yeshi_ec_pdd_order set po_order_sn = |
| | | #{orderSn,jdbcType=VARCHAR},po_goods_id = |
| | | #{goodsId,jdbcType=BIGINT},po_group_id = |
| | | #{groupId,jdbcType=BIGINT},po_goods_name = |
| | | #{goodsName,jdbcType=VARCHAR},po_goods_thumbnail_url = |
| | | #{goodsThumbnailUrl,jdbcType=VARCHAR},po_goods_quantity = |
| | | #{goodsQuantity,jdbcType=INTEGER},po_goods_price = |
| | | #{goodsPrice,jdbcType=BIGINT},po_order_amount = |
| | | #{orderAmount,jdbcType=BIGINT},po_p_id = |
| | | #{pId,jdbcType=VARCHAR},po_promotion_rate = |
| | | #{promotionRate,jdbcType=BIGINT},po_promotion_amount = |
| | | #{promotionAmount,jdbcType=BIGINT},po_order_status = |
| | | #{orderStatus,jdbcType=INTEGER},po_order_status_desc = |
| | | #{orderStatusDesc,jdbcType=VARCHAR},po_order_create_time = |
| | | #{orderCreateTime,jdbcType=BIGINT},po_order_pay_time = |
| | | #{orderPayTime,jdbcType=BIGINT},po_order_group_success_time = |
| | | #{orderGroupSuccessTime,jdbcType=BIGINT},po_order_verify_time = |
| | | #{orderVerifyTime,jdbcType=BIGINT},po_order_modify_at = |
| | | #{orderModifyAt,jdbcType=BIGINT},po_custom_parameters = |
| | | #{customParameters,jdbcType=VARCHAR},po_order_settle_time = |
| | | #{orderSettleTime,jdbcType=BIGINT},po_order_id = |
| | | #{orderId,jdbcType=VARCHAR},po_create_time = |
| | | #{createTime,jdbcType=TIMESTAMP},po_update_time = |
| | | #{updateTime,jdbcType=TIMESTAMP} where po_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.pdd.PDDOrder"> |
| | | update yeshi_ec_pdd_order |
| | | <set> |
| | | <if test="orderSn != null">po_order_sn=#{orderSn,jdbcType=VARCHAR},</if> |
| | | <if test="goodsId != null">po_goods_id=#{goodsId,jdbcType=BIGINT},</if> |
| | | <if test="groupId != null">po_group_id=#{groupId,jdbcType=BIGINT},</if> |
| | | <if test="goodsName != null">po_goods_name=#{goodsName,jdbcType=VARCHAR},</if> |
| | | <if test="goodsThumbnailUrl != null">po_goods_thumbnail_url=#{goodsThumbnailUrl,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="goodsQuantity != null">po_goods_quantity=#{goodsQuantity,jdbcType=INTEGER},</if> |
| | | <if test="goodsPrice != null">po_goods_price=#{goodsPrice,jdbcType=BIGINT},</if> |
| | | <if test="orderAmount != null">po_order_amount=#{orderAmount,jdbcType=BIGINT},</if> |
| | | <if test="pId != null">po_p_id=#{pId,jdbcType=VARCHAR},</if> |
| | | <if test="promotionRate != null">po_promotion_rate=#{promotionRate,jdbcType=BIGINT},</if> |
| | | <if test="promotionAmount != null">po_promotion_amount=#{promotionAmount,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="orderStatus != null">po_order_status=#{orderStatus,jdbcType=INTEGER},</if> |
| | | <if test="orderStatusDesc != null">po_order_status_desc=#{orderStatusDesc,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="orderCreateTime != null">po_order_create_time=#{orderCreateTime,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="orderPayTime != null">po_order_pay_time=#{orderPayTime,jdbcType=BIGINT},</if> |
| | | <if test="orderGroupSuccessTime != null">po_order_group_success_time=#{orderGroupSuccessTime,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="orderVerifyTime != null">po_order_verify_time=#{orderVerifyTime,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="orderModifyAt != null">po_order_modify_at=#{orderModifyAt,jdbcType=BIGINT},</if> |
| | | <if test="customParameters != null">po_custom_parameters=#{customParameters,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="orderSettleTime != null">po_order_settle_time=#{orderSettleTime,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="orderId != null">po_order_id=#{orderId,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">po_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">po_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> |
| | | where po_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void addUnreadDeviceMsg(String type, String device, int platform, int msgCount) {
|
| | | public void addUnreadDeviceMsg(String type, String device, int platform, int msgCount, String msg) {
|
| | | MsgDeviceReadState state = msgDeviceReadStateMapper.selectByDeviceAndPlatformAndType(device, platform, type);
|
| | | if (state != null) {
|
| | | MsgDeviceReadState update = new MsgDeviceReadState();
|
| | | update.setId(state.getId());
|
| | | update.setUnReadCount(state.getUnReadCount() + msgCount);
|
| | | update.setUpdateTime(new Date());
|
| | | update.setLatestContent(msg);
|
| | | msgDeviceReadStateMapper.updateByPrimaryKeySelective(update);
|
| | | } else {//
|
| | | } else {
|
| | | state = new MsgDeviceReadState();
|
| | | state.setCreateTime(new Date());
|
| | | state.setDevice(device);
|
| | |
| | | state.setType(type);
|
| | | state.setUnReadCount(msgCount);
|
| | | state.setUpdateTime(new Date());
|
| | | state.setLatestContent(msg);
|
| | | msgDeviceReadStateMapper.insertSelective(state);
|
| | | }
|
| | | }
|
| | |
| | | return totalCount;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int getUnReadCount(String device, int platform, String type) {
|
| | | MsgDeviceReadState state = getByDeviceAndPlatformAndType(type, device, platform);
|
| | | if (state == null)
|
| | | return 0;
|
| | | return state.getUnReadCount() == null ? 0 : state.getUnReadCount();
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | } else if (!StringUtil.isNullOrEmpty(list.get(0).getRelationId())) {
|
| | | shareOrderMap.put(orderId, list);
|
| | | } else {
|
| | | // 通过红包查询
|
| | | CommonOrder commonOrder = commonOrderService
|
| | | .selectBySourceTypeAndTradeId(Constant.SOURCE_TYPE_TAOBAO, list.get(0).getTradeId());
|
| | |
|
| | | PidUser pidUser = null;// pidUserMapper.selectByPid(pid);
|
| | | if (pidUser != null && pidUser.getType() == PidUser.TYPE_SHARE_GOODS) {// 商品分享订单
|
| | | // List<PidOrder> pidOrderList = new ArrayList<>();
|
| | | // for (TaoBaoOrder order : list) {
|
| | | // pidOrderList.add(TaoBaoOrderUtil.convertToPidOrder(order));
|
| | | // }
|
| | | // sharePidOrderMap.put(orderId, pidOrderList);
|
| | | shareOrderMap.put(orderId, list);
|
| | | } else {// 普通返利订单
|
| | | fanliOrderMap.put(orderId, list);
|
| | | if (commonOrder != null) {
|
| | | HongBaoOrder hongBaoOrder = hongBaoOrderMapper.selectByCommonOrderId(commonOrder.getId());
|
| | | if (hongBaoOrder != null && hongBaoOrder.getHongBaoV2() != null
|
| | | && hongBaoOrder.getHongBaoV2().getType() == HongBaoV2.TYPE_SHARE_GOODS) {
|
| | | shareOrderMap.put(orderId, list);
|
| | | continue;
|
| | | }
|
| | | }
|
| | | fanliOrderMap.put(orderId, list);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | // 尚未找到和PID对应的用户
|
| | | if (uid == null) {
|
| | | // 通过红包查询
|
| | | CommonOrder commonOrder = commonOrderService.selectBySourceTypeAndTradeId(Constant.SOURCE_TYPE_TAOBAO,
|
| | | orderList.get(0).getTradeId());
|
| | |
|
| | | if (commonOrder != null) {
|
| | | HongBaoOrder hongBaoOrder = hongBaoOrderMapper.selectByCommonOrderId(commonOrder.getId());
|
| | | if (hongBaoOrder != null && hongBaoOrder.getHongBaoV2() != null
|
| | | && hongBaoOrder.getHongBaoV2().getType() == HongBaoV2.TYPE_SHARE_GOODS) {
|
| | | uid = hongBaoOrder.getHongBaoV2().getUserInfo().getId();
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | if (uid == null)
|
| | | return;
|
| | |
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.taobao.dataoke;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.yeshi.fanli.dao.goods.taobao.dataoke.DaTaoKeGoodsDetailV2Dao;
|
| | | import com.yeshi.fanli.dto.dataoke.DaTaoKeGoodsResult;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.dataoke.DaTaoKeApiUtil;
|
| | | import com.yeshi.fanli.util.taobao.DaTaoKeUtil;
|
| | |
|
| | | @Service
|
| | | public class DaTaoKeGoodsDetailV2ServiceImpl implements DaTaoKeGoodsDetailV2Service {
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailV2Dao daTaoKeGoodsDetailV2Dao;
|
| | |
|
| | | @Resource
|
| | | private RedisManager redisManager;
|
| | |
|
| | | @Override
|
| | | public void startSyncGoods() {
|
| | | LogHelper.test("大淘客同步开始");
|
| | | DaTaoKeGoodsResult result = DaTaoKeApiUtil.listAll("1");
|
| | | int page=0;
|
| | | while (result.getGoodsList() != null && result.getGoodsList().size() > 0) {
|
| | | System.out.println(page++);
|
| | | for (DaTaoKeDetailV2 v2 : result.getGoodsList())
|
| | | daTaoKeGoodsDetailV2Dao.save(v2);
|
| | | result = DaTaoKeApiUtil.listAll(result.getPageId());
|
| | | try {
|
| | | Thread.sleep(10);
|
| | | } catch (InterruptedException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void updateData() {
|
| | | DaTaoKeGoodsResult result = DaTaoKeApiUtil.getUpdateGoodsList("1", null, null);
|
| | | while (result.getGoodsList() != null && result.getGoodsList().size() > 0) {
|
| | | for (DaTaoKeDetailV2 v2 : result.getGoodsList()) {
|
| | | v2.setUpdateTime(new Date());
|
| | | daTaoKeGoodsDetailV2Dao.updateSelective(v2);
|
| | | }
|
| | | try {
|
| | | Thread.sleep(100);
|
| | | } catch (InterruptedException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | result = DaTaoKeApiUtil.getUpdateGoodsList(result.getPageId(), null, null);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void deleteInvalid() {
|
| | | String startTime = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd 00:00:00");
|
| | |
|
| | | DaTaoKeGoodsResult result = DaTaoKeApiUtil.getInvalidGoodsList(null, startTime, null);
|
| | | while (result.getGoodsList() != null && result.getGoodsList().size() > 0) {
|
| | | for (DaTaoKeDetailV2 v2 : result.getGoodsList()) {
|
| | | v2.setUpdateTime(new Date());
|
| | | daTaoKeGoodsDetailV2Dao.delete(v2.getId());
|
| | | }
|
| | | result = DaTaoKeApiUtil.getInvalidGoodsList(result.getPageId(), startTime, null);
|
| | | System.out.println(result);
|
| | | try {
|
| | | Thread.sleep(200);
|
| | | } catch (InterruptedException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void updateNewGoods() {
|
| | | String startTime = null;
|
| | | DaTaoKeDetailV2 latest = daTaoKeGoodsDetailV2Dao.selectLatest();
|
| | | if (latest != null) {
|
| | | startTime = TimeUtil.getGernalTime(latest.getCreateTime().getTime(), "yyyy-MM-dd HH:mm:ss");
|
| | | }
|
| | | DaTaoKeGoodsResult result = DaTaoKeApiUtil.getNewGoodsList(null, startTime, null);
|
| | | while (!StringUtil.isNullOrEmpty(result.getPageId())) {
|
| | | for (DaTaoKeDetailV2 v2 : result.getGoodsList()) {
|
| | | v2.setUpdateTime(new Date());
|
| | | daTaoKeGoodsDetailV2Dao.save(v2);
|
| | | }
|
| | | result = DaTaoKeApiUtil.getNewGoodsList(result.getPageId(), startTime, null);
|
| | | try {
|
| | | Thread.sleep(200);
|
| | | } catch (InterruptedException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | private void addGoodsList(List<DaTaoKeDetailV2> goodsList) {
|
| | | for (DaTaoKeDetailV2 goods : goodsList) {
|
| | | goods.setUpdateTime(new Date());
|
| | | daTaoKeGoodsDetailV2Dao.save(goods);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<DaTaoKeDetailV2> listByGoodsIds(List<Long> goodsIdList) {
|
| | | if (goodsIdList == null || goodsIdList.size() == 0)
|
| | | return null;
|
| | | List<DaTaoKeDetailV2> goodsList = daTaoKeGoodsDetailV2Dao.listByGoodsIds(goodsIdList);
|
| | | return goodsList;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<TaoBaoGoodsBrief> filterTaoBaoGoods(List<TaoBaoGoodsBrief> goodsList) {
|
| | | List<Long> goodsIdList = new ArrayList<>();
|
| | | for (TaoBaoGoodsBrief goods : goodsList)
|
| | | goodsIdList.add(goods.getAuctionId());
|
| | |
|
| | | List<DaTaoKeDetailV2> dtList = listByGoodsIds(goodsIdList);
|
| | |
|
| | | Map<Long, DaTaoKeDetailV2> map = new HashMap<>();
|
| | | for (DaTaoKeDetailV2 goods : dtList)
|
| | | map.put(goods.getGoodsId(), goods);
|
| | | for (TaoBaoGoodsBrief goods : goodsList) {
|
| | | DaTaoKeDetailV2 detail = map.get(goods.getAuctionId());
|
| | | goods = DaTaoKeUtil.filterTaoBaoGoods(goods, detail);
|
| | | }
|
| | | return goodsList;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public TaoBaoGoodsBrief filterTaoBaoGoods(TaoBaoGoodsBrief goods) {
|
| | | List<Long> goodsIdList = new ArrayList<>();
|
| | | goodsIdList.add(goods.getAuctionId());
|
| | |
|
| | | List<DaTaoKeDetailV2> daTaoKeList = listByGoodsIds(goodsIdList);
|
| | | if (daTaoKeList == null || daTaoKeList.size() == 0)
|
| | | return goods;
|
| | |
|
| | | // 重新设置标题与券价格
|
| | | goods = DaTaoKeUtil.filterTaoBaoGoods(goods, daTaoKeList.get(0));
|
| | |
|
| | | return goods;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<DaTaoKeDetailV2> listByIds(List<Long> idsList) {
|
| | | return daTaoKeGoodsDetailV2Dao.listByIds(idsList);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<DaTaoKeDetailV2> listByDtitle(String dtitle) {
|
| | |
|
| | | return daTaoKeGoodsDetailV2Dao.listByDtitle(dtitle.trim());
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<DaTaoKeDetailV2> listSearchByTitleWithCid(String title, Long cid, int page, int pageSize) {
|
| | | return daTaoKeGoodsDetailV2Dao.listSearchByTitleWithCid(title, (cid == null || cid == 0 ? null : cid),
|
| | | (page - 1) * pageSize, pageSize);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public Long countSearchByTitleWithCid(String title, Long cid) {
|
| | | return daTaoKeGoodsDetailV2Dao.countSearchByTitleWithCid(title, (cid == null || cid == 0 ? null : cid));
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<DaTaoKeDetailV2> getGoodsNotInList(Long cid, List<Long> listId, int count) {
|
| | | return daTaoKeGoodsDetailV2Dao.getGoodsNotInList(cid, listId, count);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | * @param platform
|
| | | * @param msgCount
|
| | | */
|
| | | public void addUnreadDeviceMsg(String type, String device, int platform, int msgCount);
|
| | | public void addUnreadDeviceMsg(String type, String device, int platform, int msgCount, String msg);
|
| | |
|
| | | /**
|
| | | * 设置所有消息已读
|
| | |
| | | * @param platform
|
| | | */
|
| | | public void initReadState(String device, int platform, String type);
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 获取设备未读消息数量
|
| | | * |
| | | * @param device
|
| | | * @param platform
|
| | | * @return
|
| | | */
|
| | | public int getUnReadCount(String device,int platform);
|
| | | public int getUnReadCount(String device, int platform);
|
| | |
|
| | | /**
|
| | | * 获取设备未读消息数量(根据类型)
|
| | | * @param device
|
| | | * @param platform
|
| | | * @param type
|
| | | * @return
|
| | | */
|
| | | public int getUnReadCount(String device, int platform, String type);
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.taobao.dataoke;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | |
|
| | | /**
|
| | | * 大淘客商品详情服务
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public interface DaTaoKeGoodsDetailV2Service {
|
| | | /**
|
| | | * 启动商品同步服务
|
| | | */
|
| | | public void startSyncGoods();
|
| | |
|
| | | /**
|
| | | * 更新数据
|
| | | */
|
| | | public void updateData();
|
| | |
|
| | | /**
|
| | | * 删除无效的
|
| | | */
|
| | | public void deleteInvalid();
|
| | |
|
| | | /**
|
| | | * 增量更新
|
| | | */
|
| | | public void updateNewGoods();
|
| | |
|
| | | /**
|
| | | * 根据商品ID查询
|
| | | * |
| | | * @param goodsIdList
|
| | | * @return
|
| | | */
|
| | | public List<DaTaoKeDetailV2> listByGoodsIds(List<Long> goodsIdList);
|
| | |
|
| | | /**
|
| | | * 过滤淘宝商品信息
|
| | | * |
| | | * @param goodsList
|
| | | * @return
|
| | | */
|
| | | public List<TaoBaoGoodsBrief> filterTaoBaoGoods(List<TaoBaoGoodsBrief> goodsList);
|
| | |
|
| | | /**
|
| | | * 过滤淘宝商品信息
|
| | | * |
| | | * @param goods
|
| | | * @return
|
| | | */
|
| | | public TaoBaoGoodsBrief filterTaoBaoGoods(TaoBaoGoodsBrief goods);
|
| | |
|
| | | /**
|
| | | * 根据主键查询
|
| | | * |
| | | * @param idList
|
| | | * @return
|
| | | */
|
| | | public List<DaTaoKeDetailV2> listByIds(List<Long> idList);
|
| | |
|
| | | /**
|
| | | * 查询一类全部
|
| | | * |
| | | * @param cid
|
| | | * @param listId
|
| | | * @param count
|
| | | * @return
|
| | | */
|
| | | public List<DaTaoKeDetailV2> getGoodsNotInList(Long cid, List<Long> listId, int count);
|
| | |
|
| | | /*
|
| | | * 根据标题查询
|
| | | * |
| | | * @param dtitle
|
| | | * |
| | | * @return
|
| | | */
|
| | | public List<DaTaoKeDetailV2> listByDtitle(String dtitle);
|
| | |
|
| | | /**
|
| | | * 根据标题类型搜索
|
| | | * |
| | | * @param title
|
| | | * -标题
|
| | | * @param cid
|
| | | * -分类ID
|
| | | * @param page
|
| | | * @param pageSize
|
| | | * @return
|
| | | */
|
| | | public List<DaTaoKeDetailV2> listSearchByTitleWithCid(String title, Long cid, int page, int pageSize);
|
| | |
|
| | | /**
|
| | | * 获取搜索到的数量
|
| | | * |
| | | * @param title
|
| | | * @param cid
|
| | | * @return
|
| | | */
|
| | | public Long countSearchByTitleWithCid(String title, Long cid);
|
| | |
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | |
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | else
|
| | | return false;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | public static boolean greaterThan_1_5_50(String platform, String versionCode) {
|
| | | if ((("android".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) >= 42))
|
| | | || (("ios".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) >= 51)))
|
| | | return true;
|
| | | else
|
| | | return false;
|
| | | }
|
| | |
|
| | | public static boolean smallerThan_1_5_1(String platform, String versionCode) {
|
| | | if ((("android".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) < 36))
|
| | | || (("ios".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) < 44)))
|
| | |
| | | package com.yeshi.fanli.util.dataoke;
|
| | |
|
| | | import java.io.IOException;
|
| | | import java.lang.reflect.Type;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.Iterator;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.Set;
|
| | | import java.util.TreeMap;
|
| | |
|
| | | import org.jsoup.Jsoup;
|
| | | import org.jsoup.nodes.Document;
|
| | |
| | | import org.yeshi.utils.HttpUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.dto.dataoke.DaTaoKeApiResult;
|
| | | import com.yeshi.fanli.dto.dataoke.DaTaoKeGoodsResult;
|
| | | import com.yeshi.fanli.dto.taobao.TaoBaoShopDTO;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
| | | public class DaTaoKeApiUtil {
|
| | | final static String API_KEY = "a083abb893";
|
| | | final static String API_KEY_2 = "b7a5ea2cd9";
|
| | |
|
| | | final static String APP_KEY = "5cf764636d373";
|
| | | final static String APP_KEY_SECRET = "5ea3c24900743f3aa531fb264f9824f2";
|
| | |
|
| | | final static String APP_KEY_2 = "5cf75b0f2c0e4";
|
| | | final static String APP_KEY_SECRET_2 = "b14f1fa115129a447937ca998b311d1e";
|
| | |
|
| | | // 排序值
|
| | |
|
| | | final public static int SORT_DEFAULT = 0;
|
| | | final public static int SORT_CREATETIME = 1;
|
| | | final public static int SORT_SALES = 2;
|
| | | final public static int SORT_COUPON_NUM = 3;
|
| | | final public static int SORT_COMMISSION = 4;
|
| | | final public static int SORT_PRICE_HIGH_TO_LOW = 5;
|
| | | final public static int SORT_PRICE_LOW_TO_HIGH = 6;
|
| | |
|
| | | final static TaoKeAppInfo[] APP_KEYS = new TaoKeAppInfo[] { new TaoKeAppInfo(APP_KEY, APP_KEY_SECRET),
|
| | | new TaoKeAppInfo(APP_KEY_2, APP_KEY_SECRET_2) };
|
| | |
|
| | | final static String[] APP_SECRETS = new String[] { APP_KEY_SECRET, APP_KEY_SECRET_2 };
|
| | |
|
| | | static Gson gson = new Gson();
|
| | |
|
| | | public static DaTaoKeApiResult goodsList(int page) {
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | return taoBaoShopDTO;
|
| | | }
|
| | |
|
| | | private static TaoKeAppInfo getRandomApp() {
|
| | | int pos = (int) (Math.random() * APP_KEYS.length);
|
| | | return APP_KEYS[pos];
|
| | | }
|
| | |
|
| | | public static DaTaoKeGoodsResult listAll(String pageId) {
|
| | | TaoKeAppInfo app = getRandomApp();
|
| | | DaTaoKeGoodsResult daTaoKeGoodsResult = new DaTaoKeGoodsResult();
|
| | | Map<String, String> params = new TreeMap<>();
|
| | | params.put("version", "v1.0.0");
|
| | | params.put("appKey", app.getAppKey());
|
| | | params.put("pageSize", 200 + "");
|
| | | // params.put("sort", "1");
|
| | | if (!StringUtil.isNullOrEmpty(pageId)) {
|
| | | params.put("pageId", pageId);
|
| | | }
|
| | | params.put("sign", getSign(params, app.getAppSecret()));
|
| | | String result = HttpUtil.get("https://openapi.dataoke.com/api/goods/get-goods-list", params, new HashMap<>());
|
| | | JSONObject json = JSONObject.fromObject(result);
|
| | | JSONObject dataJson = json.optJSONObject("data");
|
| | | if (dataJson != null) {
|
| | | JSONArray array = dataJson.optJSONArray("list");
|
| | | if (array != null) {
|
| | | String data = array.toString();
|
| | | Type type = new TypeToken<List<DaTaoKeDetailV2>>() {
|
| | | }.getType();
|
| | |
|
| | | List<DaTaoKeDetailV2> list = gson.fromJson(data, type);
|
| | | daTaoKeGoodsResult.setGoodsList(list);
|
| | | }
|
| | | daTaoKeGoodsResult.setPageId(dataJson.optString("pageId"));
|
| | | daTaoKeGoodsResult.setTotalCount(dataJson.optLong("totalNum"));
|
| | | }
|
| | | return daTaoKeGoodsResult;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 失效商品
|
| | | * |
| | | * @param pageId
|
| | | * @return
|
| | | */
|
| | | public static DaTaoKeGoodsResult getInvalidGoodsList(String pageId, String startTime, String endTime) {
|
| | | TaoKeAppInfo app = getRandomApp();
|
| | | DaTaoKeGoodsResult daTaoKeGoodsResult = new DaTaoKeGoodsResult();
|
| | | Map<String, String> params = new TreeMap<>();
|
| | | params.put("version", "v1.0.0");
|
| | | params.put("appKey", app.getAppKey());
|
| | | params.put("pageSize", 200 + "");
|
| | | if (!StringUtil.isNullOrEmpty(startTime))
|
| | | params.put("startTime", startTime);
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(endTime))
|
| | | params.put("endTime", endTime);
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(pageId))
|
| | | params.put("pageId", pageId);
|
| | |
|
| | | params.put("sign", getSign(params, app.getAppSecret()));
|
| | | String result = HttpUtil.get("https://openapi.dataoke.com/api/goods/get-stale-goods-by-time", params,
|
| | | new HashMap<>());
|
| | | System.out.println(result);
|
| | | JSONObject json = JSONObject.fromObject(result);
|
| | | JSONObject dataJson = json.optJSONObject("data");
|
| | | if (dataJson != null) {
|
| | | JSONArray array = dataJson.optJSONArray("list");
|
| | | if (array != null) {
|
| | | String data = array.toString();
|
| | | Type type = new TypeToken<List<DaTaoKeDetailV2>>() {
|
| | | }.getType();
|
| | |
|
| | | List<DaTaoKeDetailV2> list = gson.fromJson(data, type);
|
| | | daTaoKeGoodsResult.setGoodsList(list);
|
| | | }
|
| | | daTaoKeGoodsResult.setPageId(dataJson.optString("pageId"));
|
| | | daTaoKeGoodsResult.setTotalCount(dataJson.optLong("totalNum"));
|
| | | }
|
| | | return daTaoKeGoodsResult;
|
| | | }
|
| | |
|
| | | public static DaTaoKeGoodsResult getNewGoodsList(String pageId, String startTime, String endTime) {
|
| | | TaoKeAppInfo app = getRandomApp();
|
| | | DaTaoKeGoodsResult daTaoKeGoodsResult = new DaTaoKeGoodsResult();
|
| | | Map<String, String> params = new TreeMap<>();
|
| | | params.put("version", "v1.0.0");
|
| | | params.put("appKey", app.getAppKey());
|
| | | params.put("pageSize", 200 + "");
|
| | | if (!StringUtil.isNullOrEmpty(startTime))
|
| | | params.put("startTime", startTime);
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(endTime))
|
| | | params.put("endTime", endTime);
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(pageId))
|
| | | params.put("pageId", pageId);
|
| | |
|
| | | params.put("sign", getSign(params, app.getAppSecret()));
|
| | | String result = HttpUtil.get("https://openapi.dataoke.com/api/goods/pull-goods-by-time", params,
|
| | | new HashMap<>());
|
| | | JSONObject json = JSONObject.fromObject(result);
|
| | | JSONObject dataJson = json.optJSONObject("data");
|
| | | if (dataJson != null) {
|
| | | JSONArray array = dataJson.optJSONArray("list");
|
| | | if (array != null) {
|
| | | String data = array.toString();
|
| | | Type type = new TypeToken<List<DaTaoKeDetailV2>>() {
|
| | | }.getType();
|
| | |
|
| | | List<DaTaoKeDetailV2> list = gson.fromJson(data, type);
|
| | | daTaoKeGoodsResult.setGoodsList(list);
|
| | | }
|
| | | daTaoKeGoodsResult.setPageId(dataJson.optString("pageId"));
|
| | | daTaoKeGoodsResult.setTotalCount(dataJson.optLong("totalNum"));
|
| | | }
|
| | | return daTaoKeGoodsResult;
|
| | | }
|
| | |
|
| | | public static DaTaoKeGoodsResult getUpdateGoodsList(String pageId, String startTime, String endTime) {
|
| | | TaoKeAppInfo app = getRandomApp();
|
| | | DaTaoKeGoodsResult daTaoKeGoodsResult = new DaTaoKeGoodsResult();
|
| | | Map<String, String> params = new TreeMap<>();
|
| | | params.put("version", "v1.0.0");
|
| | | params.put("appKey", app.getAppKey());
|
| | | params.put("pageSize", 200 + "");
|
| | | if (!StringUtil.isNullOrEmpty(startTime))
|
| | | params.put("startTime", startTime);
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(endTime))
|
| | | params.put("endTime", endTime);
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(pageId))
|
| | | params.put("pageId", pageId);
|
| | |
|
| | | params.put("sign", getSign(params, app.getAppSecret()));
|
| | | String result = HttpUtil.get("https://openapi.dataoke.com/api/goods/get-newest-goods", params, new HashMap<>());
|
| | | JSONObject json = JSONObject.fromObject(result);
|
| | | JSONObject dataJson = json.optJSONObject("data");
|
| | | if (dataJson != null) {
|
| | | JSONArray array = dataJson.optJSONArray("list");
|
| | | if (array != null) {
|
| | | String data = array.toString();
|
| | | Type type = new TypeToken<List<DaTaoKeDetailV2>>() {
|
| | | }.getType();
|
| | |
|
| | | List<DaTaoKeDetailV2> list = gson.fromJson(data, type);
|
| | | daTaoKeGoodsResult.setGoodsList(list);
|
| | | }
|
| | | daTaoKeGoodsResult.setPageId(dataJson.optString("pageId"));
|
| | | daTaoKeGoodsResult.setTotalCount(dataJson.optLong("totalNum"));
|
| | | }
|
| | | return daTaoKeGoodsResult;
|
| | | }
|
| | |
|
| | | public static DaTaoKeGoodsResult search(String key, List<Integer> cidList, int page, int pageSize, int sort) {
|
| | |
|
| | | TaoKeAppInfo app = getRandomApp();
|
| | | DaTaoKeGoodsResult daTaoKeGoodsResult = new DaTaoKeGoodsResult();
|
| | | Map<String, String> params = new TreeMap<>();
|
| | | params.put("version", "v1.0.0");
|
| | | params.put("appKey", app.getAppKey());
|
| | | params.put("pageSize", 200 + "");
|
| | | params.put("pageId", page + "");
|
| | |
|
| | | String cids = "";
|
| | | if (cidList != null && cidList.size() > 0)
|
| | | for (Integer cid : cidList) {
|
| | | cids += cid + ",";
|
| | | }
|
| | |
|
| | | if (cids.endsWith(","))
|
| | | cids = cids.substring(0, cids.length() - 1);
|
| | | if (!StringUtil.isNullOrEmpty(cids))
|
| | | params.put("cids", cids);
|
| | |
|
| | | params.put("keyWords", key);
|
| | | params.put("sort", sort + "");
|
| | | params.put("sign", getSign(params, app.getAppSecret()));
|
| | | String result = HttpUtil.get("https://openapi.dataoke.com/api/goods/get-dtk-search-goods", params,
|
| | | new HashMap<>());
|
| | | JSONObject json = JSONObject.fromObject(result);
|
| | | JSONObject dataJson = json.optJSONObject("data");
|
| | | if (dataJson != null) {
|
| | | JSONArray array = dataJson.optJSONArray("list");
|
| | | if (array != null) {
|
| | | String data = array.toString();
|
| | | Type type = new TypeToken<List<DaTaoKeDetailV2>>() {
|
| | | }.getType();
|
| | |
|
| | | List<DaTaoKeDetailV2> list = gson.fromJson(data, type);
|
| | | daTaoKeGoodsResult.setGoodsList(list);
|
| | | }
|
| | | daTaoKeGoodsResult.setPageId(dataJson.optString("pageId"));
|
| | | daTaoKeGoodsResult.setTotalCount(dataJson.optLong("totalNum"));
|
| | | }
|
| | | return daTaoKeGoodsResult;
|
| | | }
|
| | |
|
| | | private static String getSign(Map<String, String> map, String secretKey) {
|
| | | if (map.size() == 0) {
|
| | | return "";
|
| | | }
|
| | | StringBuffer sb = new StringBuffer("");
|
| | | Set<String> keySet = map.keySet();
|
| | | Iterator<String> iter = keySet.iterator();
|
| | | while (iter.hasNext()) {
|
| | | String key = iter.next();
|
| | | sb.append("&" + key + "=" + map.get(key));
|
| | | }
|
| | | sb.deleteCharAt(0);
|
| | | String signStr = "";
|
| | | signStr = sb.toString() + "&key=" + secretKey;
|
| | | return StringUtil.Md5(signStr).toUpperCase();
|
| | | }
|
| | |
|
| | | public static TaoBaoShopDTO convertTaoBaoShopDTO(JSONObject data) {
|
| | |
| | | package com.yeshi.fanli.util.pinduoduo;
|
| | |
|
| | | import java.io.UnsupportedEncodingException;
|
| | | import java.lang.reflect.Type;
|
| | | import java.net.URLEncoder;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Collections;
|
| | |
| | |
|
| | | import org.yeshi.utils.HttpUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsResult;
|
| | | import com.yeshi.fanli.dto.pdd.PDDOrderResult;
|
| | | import com.yeshi.fanli.dto.pdd.PDDSearchFilter;
|
| | | import com.yeshi.fanli.entity.pdd.PDDOrder;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | public class PinDuoDuoApiUtil {
|
| | | public final static String PID_FANLI = "8590899_72067894";
|
| | | public final static String PID_SHARE = "8590899_72067895";
|
| | |
|
| | | private final static String CLIENT_ID = "9f6ee5ebd3b94c2080c4d51c2427e9fa";
|
| | | private final static String CLIENT_SECRET = "95e1f1904385664bf4b87d4b34de12f9f31c505d";
|
| | |
|
| | |
| | | return result;
|
| | | }
|
| | |
|
| | | public static void searchGoods(String key) {
|
| | | public static PDDGoodsResult searchGoods(PDDSearchFilter sf) {
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("type", "pdd.ddk.goods.search");
|
| | | map.put("keyword", key);
|
| | | if (sf.getOptId() != null)
|
| | | map.put("opt_id", sf.getOptId() + "");
|
| | | if (sf.getPage() != null)
|
| | | map.put("page", sf.getPage() + "");
|
| | | if (sf.getPageSize() != null)
|
| | | map.put("page_size", sf.getPageSize() + "");
|
| | | if (sf.getSortType() != null)
|
| | | map.put("sort_type", sf.getSortType() + "");
|
| | | if (sf.getHasCoupon() != null)
|
| | | map.put("with_coupon", sf.getHasCoupon() + "");
|
| | | if (sf.getCatId() != null)
|
| | | map.put("cat_id", sf.getCatId() + "");
|
| | | if (sf.getKw() != null)
|
| | | map.put("keyword", sf.getKw());
|
| | | map.put("pid", PID_FANLI);
|
| | | String result = baseRequest(map);
|
| | | System.out.println(result);
|
| | | JSONObject json = JSONObject.fromObject(result);
|
| | | JSONObject root = json.optJSONObject("goods_search_response");
|
| | | JSONArray array = root.optJSONArray("goods_list");
|
| | | Type type = new TypeToken<List<PDDGoodsDetail>>() {
|
| | | }.getType();
|
| | | List<PDDGoodsDetail> goodsList = new Gson().fromJson(array.toString(), type);
|
| | | int totalCount = json.optInt("total_count");
|
| | | return new PDDGoodsResult(totalCount, goodsList);
|
| | | }
|
| | |
|
| | | public static void convert(Long goodsId) {
|
| | | /**
|
| | | * 商品转链
|
| | | * |
| | | * @param goodsId
|
| | | * @param pid
|
| | | * @param customParams
|
| | | * @return
|
| | | */
|
| | | public static String convert(Long goodsId, String pid, String customParams) {
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("type", "pdd.ddk.goods.promotion.url.generate");
|
| | | map.put("p_id", "8590899_61877633");
|
| | | map.put("p_id", pid);
|
| | | map.put("multi_group", "true");
|
| | | map.put("generate_weapp_webview", "true");
|
| | | map.put("generate_weiboapp_webview", "true");
|
| | | JSONArray array = new JSONArray();
|
| | | array.add(goodsId);
|
| | | map.put("goods_id_list", array.toString());
|
| | | map.put("custom_parameters", "437032");
|
| | | map.put("custom_parameters", customParams);
|
| | |
|
| | | String result = baseRequest(map);
|
| | | System.out.println(result);
|
| | | JSONObject root = JSONObject.fromObject(result);
|
| | | JSONObject json = root.optJSONObject("goods_promotion_url_generate_response");
|
| | | array = json.optJSONArray("goods_promotion_url_list");
|
| | | if (array != null && array.size() > 0)
|
| | | return array.optJSONObject(0).optString("short_url");
|
| | | return null;
|
| | | }
|
| | |
|
| | | public static void createPid() {
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("type", "pdd.ddk.goods.pid.generate");
|
| | | map.put("number", "1");
|
| | | map.put("number", "2");
|
| | | JSONArray array = new JSONArray();
|
| | | array.add("返利PID");
|
| | | array.add("分享PID");
|
| | | map.put("p_id_name_list", array.toString());
|
| | |
|
| | | String result = baseRequest(map);
|
| | | System.out.println(result);
|
| | | }
|
| | |
|
| | | public static void getOrders() {
|
| | | public static PDDOrderResult getOrders(int page, int pageSize, long startTime, long endTime) {
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("type", "pdd.ddk.order.list.increment.get");
|
| | | map.put("start_update_time", System.currentTimeMillis() / 1000 - 60 * 60 + "");
|
| | | map.put("end_update_time", System.currentTimeMillis() / 1000 + "");
|
| | | map.put("start_update_time", startTime / 1000 + "");
|
| | | map.put("end_update_time", endTime / 1000 + "");
|
| | | map.put("page", page + "");
|
| | | map.put("page_size", pageSize + "");
|
| | | String result = baseRequest(map);
|
| | | System.out.println(result);
|
| | | JSONObject json = JSONObject.fromObject(result);
|
| | | JSONObject root = json.optJSONObject("order_list_get_response");
|
| | | if (root != null) {
|
| | | int totalCount = root.optInt("total_count");
|
| | | JSONArray array = root.optJSONArray("order_list");
|
| | | Type type = new TypeToken<List<PDDOrder>>() {
|
| | | }.getType();
|
| | | List<PDDOrder> orderList = new Gson().fromJson(array.toString(), type);
|
| | | return new PDDOrderResult(totalCount, orderList);
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | *
|
| | | * @param goodsId
|
| | | */
|
| | | public static void getGoodsDetail(Long goodsId) {
|
| | | public static PDDGoodsDetail getGoodsDetail(Long goodsId) {
|
| | | JSONArray array = new JSONArray();
|
| | | array.add(goodsId);
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("type", "pdd.ddk.goods.detail");
|
| | | map.put("goods_id_list", array.toString());
|
| | | String result = baseRequest(map);
|
| | | System.out.println(result);
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | JSONObject root = resultJson.optJSONObject("goods_detail_response");
|
| | | array = root.optJSONArray("goods_details");
|
| | | Type type = new TypeToken<List<PDDGoodsDetail>>() {
|
| | | }.getType();
|
| | | List<PDDGoodsDetail> goodsList = new Gson().fromJson(array.toString(), type);
|
| | | if (goodsList != null && goodsList.size() > 0)
|
| | | return goodsList.get(0);
|
| | | return null;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import java.math.BigDecimal;
|
| | | import java.net.URLEncoder;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Collections;
|
| | | import java.util.Iterator;
|
| | | import java.util.List;
|
| | |
|
| | | import org.jsoup.Jsoup;
|
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoHead;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
| | | if (detail != null) {
|
| | | // 重新设置标题与券价格
|
| | | goods.setTitle(detail.getdTitle());
|
| | | goods.setCouponAmount(detail.getQuanPrice());
|
| | | if (goods.getCouponAmount() != null && detail.getQuanPrice() != null
|
| | | && goods.getCouponAmount().compareTo(detail.getQuanPrice()) < 0)
|
| | | goods.setCouponAmount(detail.getQuanPrice());
|
| | | goods.setZkPrice(detail.getOrgPrice());
|
| | | if (new BigDecimal(detail.getQuanCondition()).compareTo(new BigDecimal(0)) > 0)
|
| | | goods.setCouponInfo(String.format("满%s元减%s元", detail.getQuanCondition(),
|
| | | MoneyBigDecimalUtil.getWithNoZera(detail.getQuanPrice()).toString()));
|
| | | MoneyBigDecimalUtil.getWithNoZera(goods.getCouponAmount()).toString()));
|
| | | else
|
| | | goods.setCouponInfo(String.format("%s元无条件券", detail.getQuanPrice()));
|
| | | goods.setCouponInfo(String.format("%s元无条件券", goods.getCouponAmount()));
|
| | | }
|
| | | return goods;
|
| | | }
|
| | |
|
| | | public static TaoBaoGoodsBrief filterTaoBaoGoods(TaoBaoGoodsBrief goods, DaTaoKeDetailV2 detail) {
|
| | | if (detail != null) {
|
| | | // 重新设置标题与券价格
|
| | | goods.setTitle(detail.getDtitle());
|
| | | if (goods.getCouponAmount() != null && detail.getCouponPrice() != null
|
| | | && goods.getCouponAmount().compareTo(detail.getCouponPrice()) < 0)
|
| | | goods.setCouponAmount(detail.getCouponPrice());
|
| | | goods.setZkPrice(detail.getOriginalPrice());
|
| | | if (new BigDecimal(detail.getCouponConditions()).compareTo(new BigDecimal(0)) > 0)
|
| | | goods.setCouponInfo(String.format("满%s元减%s元", detail.getCouponConditions(),
|
| | | MoneyBigDecimalUtil.getWithNoZera(goods.getCouponAmount()).toString()));
|
| | | else
|
| | | goods.setCouponInfo(String.format("%s元无条件券", goods.getCouponAmount()));
|
| | | }
|
| | | return goods;
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoShop;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoUnionConfig;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoLinkService;
|
| | |
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoHttpUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
| | | return taoBaoGoods;
|
| | | }
|
| | |
|
| | | public static TaoBaoGoodsBrief convert(DaTaoKeDetailV2 detail) {
|
| | | TaoBaoGoodsBrief taoBaoGoods = new TaoBaoGoodsBrief();
|
| | | taoBaoGoods.setAuctionId(detail.getGoodsId());
|
| | | taoBaoGoods.setBiz30day(detail.getMonthSales());
|
| | | taoBaoGoods.setCouponAmount(detail.getCouponPrice());
|
| | | taoBaoGoods.setCouponInfo(String.format("满%s元减%s元", detail.getCouponConditions(),
|
| | | MoneyBigDecimalUtil.getWithNoZera(detail.getCouponPrice())));
|
| | | if (detail.getCouponTotalNum() != null && detail.getCouponReceiveNum() != null)
|
| | | taoBaoGoods.setCouponLeftCount(detail.getCouponTotalNum() - detail.getCouponReceiveNum());
|
| | | else
|
| | | taoBaoGoods.setCouponLeftCount(0);
|
| | | taoBaoGoods.setCouponStartFee(new BigDecimal(detail.getCouponConditions()));
|
| | | taoBaoGoods.setCouponTotalCount(detail.getCouponTotalNum());
|
| | | taoBaoGoods.setPictUrl(detail.getMainPic());
|
| | | taoBaoGoods.setPictUrlWhite(detail.getMainPic());
|
| | | taoBaoGoods.setSellerId(detail.getSellerId());
|
| | | taoBaoGoods.setShopTitle(detail.getShopName());
|
| | | taoBaoGoods.setTitle(detail.getDtitle());
|
| | | taoBaoGoods.setUserType(detail.getShopType());
|
| | | taoBaoGoods.setZkPrice(detail.getOriginalPrice());
|
| | | taoBaoGoods.setTkRate(detail.getCommissionRate());
|
| | | taoBaoGoods.setTkCommFee(new BigDecimal("0"));
|
| | | taoBaoGoods.setState(0);
|
| | | return taoBaoGoods;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取淘宝联盟的授权链接
|
| | | *
|
| | |
| | | public static String TYPE_GUANXUAN = "guanxuan";
|
| | | public static String TYPE_ZHUSHOU = "zhushou";
|
| | | public static String TYPE_RECOMMEND = "recommend";
|
| | | public static String TYPE_SYSTEM = "system";//系统消息
|
| | | public static String TYPE_SYSTEM = "system";// 系统消息
|
| | |
|
| | | private String icon;
|
| | | private String title;
|
| | |
| | | private Boolean read;// 是否已读
|
| | | private JumpDetailV2 jumpDetail;// 跳转详情
|
| | | private String params;// 跳转参数
|
| | | private Integer unReadCount;// 消息未读数
|
| | |
|
| | | public UserCommonMsgVO(String icon, String title, Date time, String type, String latestMsg, Boolean read,
|
| | | JumpDetailV2 jumpDetail, String params) {
|
| | | JumpDetailV2 jumpDetail, String params, Integer unReadCount) {
|
| | | this.icon = icon;
|
| | | this.title = title;
|
| | | this.time = time;
|
| | |
| | | this.read = read;
|
| | | this.jumpDetail = jumpDetail;
|
| | | this.params = params;
|
| | | this.unReadCount = unReadCount;
|
| | | }
|
| | |
|
| | | public Integer getUnReadCount() {
|
| | | return unReadCount;
|
| | | }
|
| | |
|
| | | public void setUnReadCount(Integer unReadCount) {
|
| | | this.unReadCount = unReadCount;
|
| | | }
|
| | |
|
| | | public UserCommonMsgVO() {
|
| | |
| | | mongo.dbname=flq
|
| | | mongo.port=27017
|
| | | mongo.port=27016
|
| | |
|
| | | #上线环境
|
| | | mongo.host=193.112.35.168
|