| | |
| | | package com.yeshi.goods.facade.dto.taobao.dataoke; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * platformType : tb |
| | | * source : taobao |
| | | * title : |
| | | * remark : |
| | | * type : taobao |
| | | * isLuxury : 0 |
| | | * idList : ["593752130189"] |
| | | * urlList : ["¥O3edXTebmVG¥"] |
| | | * imageList : ["https://img.alicdn.com/bao/uploaded/i4/3512189193/O1CN01xnblyU2HmRiB4LUW1_!!0-item_pic.jpg"] |
| | | * tag : |
| | | * stepId : |
| | | * originContent : 19.9元 桃李食品旗舰店 多口味粽子礼盒装600g ¥O3edXTebmVG¥/ |
| | | * createTime : 2021-06-07 11:22:37 |
| | | * updateTime : 2021-06-07 11:22:37 |
| | | */ |
| | | |
| | | public class DaTaoKeListTopOffDTO implements Serializable { |
| | | |
| | | |
| | | /** |
| | | * platformType : tb |
| | | * source : taobao |
| | | * title : |
| | | * remark : |
| | | * type : taobao |
| | | * isLuxury : 0 |
| | | * idList : ["593752130189"] |
| | | * urlList : ["¥O3edXTebmVG¥"] |
| | | * imageList : ["https://img.alicdn.com/bao/uploaded/i4/3512189193/O1CN01xnblyU2HmRiB4LUW1_!!0-item_pic.jpg"] |
| | | * tag : |
| | | * stepId : |
| | | * originContent : 19.9元 桃李食品旗舰店 多口味粽子礼盒装600g ¥O3edXTebmVG¥/ |
| | | * createTime : 2021-06-07 11:22:37 |
| | | * updateTime : 2021-06-07 11:22:37 |
| | | * content : 佳佰加厚秋冬被子拍下49.9元包u |
| | | https://u.jd.com/XK2exnt |
| | | * contentCopy : 佳佰加厚秋冬被子拍下49.9元包u |
| | | [京东请转链] |
| | | * picUrls : https://img14.360buyimg.com/pop/jfs/t1/92110/6/29819/74220/6322c10eEab5472ae/d4b66c4181572c91.jpg |
| | | * type : 3 |
| | | * platform : 京东 |
| | | * detailType : 7 |
| | | * urls : https://u.jd.com/XK2exnt |
| | | * isRecommend : 2 |
| | | * tgNum : 0 |
| | | * homeRecommend : 2 |
| | | * recommendDesc : |
| | | * msgStepId : |
| | | * createTime : 2022-09-16 15:13:54 |
| | | * updateTime : 2022-09-16 15:13:54 |
| | | * itemIds : 100036048397 |
| | | */ |
| | | |
| | | private String platformType; |
| | | private String source; |
| | | private String title; |
| | | private String originContent; |
| | | private String remark; |
| | | private String type; |
| | | private int isLuxury;//是否神单0-常规;1-神单(优质商品且价低,建议主推) |
| | | private String tag; |
| | | private String stepId; |
| | | private Date createTime; |
| | | private Date updateTime; |
| | | private List<String> idList; |
| | | private List<String> urlList; |
| | | private List<String> imageList; |
| | | private String content; |
| | | private String contentCopy; |
| | | private String picUrls; |
| | | private int type; |
| | | private String platform; |
| | | private int detailType; |
| | | private String urls; |
| | | private int isRecommend; |
| | | private int tgNum; |
| | | private int homeRecommend; |
| | | private String recommendDesc; |
| | | private String msgStepId; |
| | | private String createTime; |
| | | private String updateTime; |
| | | private String itemIds; |
| | | |
| | | public String getPlatformType() { |
| | | return platformType; |
| | | public String getContent() { |
| | | return content; |
| | | } |
| | | |
| | | public void setPlatformType(String platformType) { |
| | | this.platformType = platformType; |
| | | public void setContent(String content) { |
| | | this.content = content; |
| | | } |
| | | |
| | | public String getSource() { |
| | | return source; |
| | | public String getContentCopy() { |
| | | return contentCopy; |
| | | } |
| | | |
| | | public void setSource(String source) { |
| | | this.source = source; |
| | | public void setContentCopy(String contentCopy) { |
| | | this.contentCopy = contentCopy; |
| | | } |
| | | |
| | | public String getTitle() { |
| | | return title; |
| | | public String getPicUrls() { |
| | | return picUrls; |
| | | } |
| | | |
| | | public void setTitle(String title) { |
| | | this.title = title; |
| | | public void setPicUrls(String picUrls) { |
| | | this.picUrls = picUrls; |
| | | } |
| | | |
| | | public String getRemark() { |
| | | return remark; |
| | | } |
| | | |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | |
| | | public String getType() { |
| | | public int getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | public void setType(int type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public int getIsLuxury() { |
| | | return isLuxury; |
| | | public String getPlatform() { |
| | | return platform; |
| | | } |
| | | |
| | | public void setIsLuxury(int isLuxury) { |
| | | this.isLuxury = isLuxury; |
| | | public void setPlatform(String platform) { |
| | | this.platform = platform; |
| | | } |
| | | |
| | | public String getTag() { |
| | | return tag; |
| | | public int getDetailType() { |
| | | return detailType; |
| | | } |
| | | |
| | | public void setTag(String tag) { |
| | | this.tag = tag; |
| | | public void setDetailType(int detailType) { |
| | | this.detailType = detailType; |
| | | } |
| | | |
| | | public String getStepId() { |
| | | return stepId; |
| | | public String getUrls() { |
| | | return urls; |
| | | } |
| | | |
| | | public void setStepId(String stepId) { |
| | | this.stepId = stepId; |
| | | public void setUrls(String urls) { |
| | | this.urls = urls; |
| | | } |
| | | |
| | | public String getOriginContent() { |
| | | return originContent; |
| | | public int getIsRecommend() { |
| | | return isRecommend; |
| | | } |
| | | |
| | | public void setOriginContent(String originContent) { |
| | | this.originContent = originContent; |
| | | public void setIsRecommend(int isRecommend) { |
| | | this.isRecommend = isRecommend; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | | public int getTgNum() { |
| | | return tgNum; |
| | | } |
| | | |
| | | public void setTgNum(int tgNum) { |
| | | this.tgNum = tgNum; |
| | | } |
| | | |
| | | public int getHomeRecommend() { |
| | | return homeRecommend; |
| | | } |
| | | |
| | | public void setHomeRecommend(int homeRecommend) { |
| | | this.homeRecommend = homeRecommend; |
| | | } |
| | | |
| | | public String getRecommendDesc() { |
| | | return recommendDesc; |
| | | } |
| | | |
| | | public void setRecommendDesc(String recommendDesc) { |
| | | this.recommendDesc = recommendDesc; |
| | | } |
| | | |
| | | public String getMsgStepId() { |
| | | return msgStepId; |
| | | } |
| | | |
| | | public void setMsgStepId(String msgStepId) { |
| | | this.msgStepId = msgStepId; |
| | | } |
| | | |
| | | public String getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | public void setCreateTime(String createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public Date getUpdateTime() { |
| | | public String getUpdateTime() { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Date updateTime) { |
| | | public void setUpdateTime(String updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | |
| | | public List<String> getIdList() { |
| | | return idList; |
| | | public String getItemIds() { |
| | | return itemIds; |
| | | } |
| | | |
| | | public void setIdList(List<String> idList) { |
| | | this.idList = idList; |
| | | } |
| | | |
| | | public List<String> getUrlList() { |
| | | return urlList; |
| | | } |
| | | |
| | | public void setUrlList(List<String> urlList) { |
| | | this.urlList = urlList; |
| | | } |
| | | |
| | | public List<String> getImageList() { |
| | | return imageList; |
| | | } |
| | | |
| | | public void setImageList(List<String> imageList) { |
| | | this.imageList = imageList; |
| | | public void setItemIds(String itemIds) { |
| | | this.itemIds = itemIds; |
| | | } |
| | | } |
| | |
| | | import org.yeshi.utils.MoneyBigDecimalUtil; |
| | | import org.yeshi.utils.StringUtil; |
| | | import org.yeshi.utils.TimeUtil; |
| | | import org.yeshi.utils.taobao.TaoBaoAuthUtil; |
| | | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | |
| | | |
| | | private static String baseGet(String url, Map<String, String> params) { |
| | | HttpClient client = new HttpClient(); |
| | | client.getHttpConnectionManager().getParams().setConnectionTimeout(10000); |
| | | client.getHttpConnectionManager().getParams().setSoTimeout(10000); |
| | | try { |
| | | Iterator<String> keys = params.keySet().iterator(); |
| | | String key; |
| | |
| | | * @Title: convertLink |
| | | * @Description: |
| | | */ |
| | | public static String convertLink(String auctionId, String pid) { |
| | | public static String convertLink(String auctionId, String pid, boolean share) { |
| | | TaoKeAppInfo app = APP_KEYS[1]; |
| | | Map<String, String> params = new TreeMap<>(); |
| | | params.put("version", "v1.1.1"); |
| | | params.put("version", "v1.3.1"); |
| | | params.put("goodsId", auctionId + ""); |
| | | params.put("pid", pid); |
| | | params.put("appKey", app.getAppKey()); |
| | | if (share) { |
| | | params.put("promtionType", "2"); |
| | | params.put("bizSceneId", "share"); |
| | | } else { |
| | | params.put("promtionType", "1"); |
| | | params.put("bizSceneId", "fanli"); |
| | | } |
| | | params.put("sign", getSign(params, app.getAppSecret())); |
| | | |
| | | String result = null; |
| | |
| | | JSONObject json = JSONObject.fromObject(result); |
| | | if (json != null) { |
| | | json = json.getJSONObject("data"); |
| | | if (json != null) { |
| | | return json.optString("couponClickUrl"); |
| | | if (json != null && json.keySet().size() > 0) { |
| | | return json.optString("couponClickUrl", null); |
| | | } |
| | | } |
| | | return null; |
| | |
| | | /** |
| | | * 获取线报 (http://www.dataoke.com/kfpt/api-d.html?id=62) |
| | | * |
| | | * @param topic 1-超值买返2-天猫超市3-整点抢购4-最新线报-所有数据(默认)5-最新线报-天猫6-最新线报-京东7-最新线报-拼多多8-最新线报-淘宝 |
| | | * @param topic 1淘宝商品 2天猫商品 3猫超商品 4店铺 5会场 6优惠券 7京东商品 |
| | | * @param pageSize |
| | | * @return |
| | | */ |
| | | public static DaTaoKeResult listTipOff(int topic, String pageId, int pageSize) { |
| | | public static DaTaoKeResult listTipOff(Integer topic, String pageId, int pageSize) { |
| | | TaoKeAppInfo app = getRandomApp(); |
| | | Map<String, String> params = new TreeMap<>(); |
| | | params.put("version", "v3.0.0"); |
| | | params.put("version", "v4.0.0"); |
| | | params.put("appKey", app.getAppKey()); |
| | | params.put("pageSize", pageSize + ""); |
| | | params.put("topic", topic + ""); |
| | | if(topic!=null) { |
| | | params.put("topic", topic + ""); |
| | | } |
| | | params.put("selectTime", System.currentTimeMillis() / 1000 + ""); |
| | | |
| | | if (pageId != null) |
| | |
| | | } catch (Exception e) { |
| | | result = baseGet("https://openapi.dataoke.com/api/dels/spider/list-tip-off", params); |
| | | } |
| | | System.out.println(result); |
| | | |
| | | JSONObject root = JSONObject.fromObject(result); |
| | | if (root.optInt("code") != 0) { |
| | |
| | | params.put("version", "v1.0.0"); |
| | | params.put("appKey", app.getAppKey()); |
| | | params.put("content", content); |
| | | params.put("bizSceneId", "1"); |
| | | |
| | | params.put("sign", getSign(params, app.getAppSecret())); |
| | | String result = baseGet("https://openapi.dataoke.com/api/tb-service/parse-taokouling", params); |
| | | String result = baseGet("https://openapi.dataoke.com/api/tb-service/parse-content", params); |
| | | System.out.println(result); |
| | | JSONObject resultObj = JSONObject.fromObject(result); |
| | | if (resultObj.optInt("code") == 0) { |
| | | if (resultObj.optInt("code") == 0 && resultObj.optJSONObject("data") != null) { |
| | | String goodsId = resultObj.optJSONObject("data").optString("goodsId"); |
| | | if (!StringUtil.isNullOrEmpty(goodsId)) { |
| | | return goodsId; |
| | |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | // DaTaoKeResult result = DaTaoKeApiUtil.listTipOff(4, null, 50); |
| | | // System.out.println(result); |
| | | getGoodsImportantInfo(672479015817L+""); |
| | | |
| | | DaTaoKeResult result = DaTaoKeApiUtil.listTipOff(null, null, 50); |
| | | System.out.println(result); |
| | | } |
| | | } |
| | |
| | | // result.getGoods().setCouponLink(link); |
| | | return result.getGoods(); |
| | | } else { |
| | | link = DaTaoKeApiUtil.convertLink(goods.getAuctionId(), dpid); |
| | | link = DaTaoKeApiUtil.convertLink(goods.getAuctionId(), dpid,false); |
| | | if (!StringUtil.isNullOrEmpty(link)) { |
| | | // result.getGoods().setCouponLink(link); |
| | | taoBaoGoodsCacheUtil.cacheBaseConvertLink(goods.getAuctionId(), dpid, link); |
| | |
| | | TaoBaoGoodsBrief goodsBrief = null; |
| | | String specialId = userExtraTaoBaoInfoService.getSpecialIdByUid(uid); |
| | | try { |
| | | goodsBrief = TaoKeApiUtil.searchGoodsDetail(goods.getGoodsId(), specialId, null); |
| | | goodsBrief = TaoKeApiUtil.searchGoodsDetail(StringUtil.isNullOrEmpty(goods.getGoodsSign())? goods.getGoodsId():goods.getGoodsSign(), specialId, null); |
| | | } catch (TaobaoGoodsDownException e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | switch (goods.getGoodsType()) { |
| | | case Constant.SOURCE_TYPE_TAOBAO: |
| | | type = "goodsdetail"; |
| | | if(!StringUtil.isNullOrEmpty(goods.getGoodsSign())) { |
| | | params.put("id", goods.getGoodsSign() + ""); |
| | | } |
| | | break; |
| | | case Constant.SOURCE_TYPE_JD: |
| | | type = "goodsdetail_jd"; |
| | |
| | | |
| | | //商品ID为空,且是口令的形式就以未加入淘宝联盟的商品处理 |
| | | if (goodsId == null && (linkList != null && linkList.size() > 0) && TaoBaoUtil.isHaveNewVersionTaoBaoToken(key)) { |
| | | String[] ks = key.trim().split(" "); |
| | | if (ks.length > 1) |
| | | key = ks[1].trim(); |
| | | String title = TaoBaoUtil.getGoodsTitleFromTokenText(key); |
| | | if (StringUtil.isNullOrEmpty(title)) { |
| | | String[] ks = key.trim().split(" "); |
| | | if (ks.length > 1) |
| | | key = ks[1].trim(); |
| | | }else{ |
| | | key=title; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | * @param preGetTime |
| | | * @return |
| | | */ |
| | | int setHongBaoRecieved (@Param("uid")Long uid,@Param("typeList")List<Integer> typeList,@Param("preGetTime")Date preGetTime); |
| | | int setHongBaoRecieved (@Param("uid")Long uid,@Param("typeList")List<Integer> typeList,@Param("preGetTime")Date preGetTime,@Param("getMonth")String getMonth); |
| | | |
| | | } |
| | |
| | | private String title; |
| | | @Column(name = "cg_goods_id") |
| | | private String goodsId;// 第三方商品ID |
| | | @Column(name = "cg_goods_sign") |
| | | private String goodsSign;//商品ID的签名 |
| | | @Column(name = "cg_goods_type") |
| | | private Integer goodsType;// 第三方类型 |
| | | @Column(name = "cg_shop_type") |
| | |
| | | this.categoryInfo = categoryInfo; |
| | | } |
| | | |
| | | public String getGoodsSign() { |
| | | return goodsSign; |
| | | } |
| | | |
| | | public void setGoodsSign(String goodsSign) { |
| | | this.goodsSign = goodsSign; |
| | | } |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | |
| | | //团队收益 |
| | | @Component |
| | | public class OrderTeamIncomeJob { |
| | | Logger orderMoneyLog= LoggerFactory.getLogger("orderMoneyLog"); |
| | | @Resource |
| | | private OrderProcessService orderProcessService; |
| | | |
| | |
| | | typeList.add(TeamEincomeRecord.TYPE_TEAM_SUBSIDY); |
| | | |
| | | long count = teamEincomeRecordService.countCanRecieveUid(preSendTime, typeList); |
| | | |
| | | orderMoneyLog.info("团队收益结算: 日期-{} 用户数量-{}",day,count); |
| | | int pageSize = 500; |
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1); |
| | | for (int i = 0; i < totalPage; i++) { |
| | | List<Long> list = teamEincomeRecordService.listCanRecieveUid(preSendTime, typeList, i + 1, pageSize); |
| | | for (Long uid : list) { |
| | | TeamOrderCMQManager.getInstance().addFanLiTeamIncomeMsg(new UidDateDTO(uid, preSendTime)); |
| | | orderMoneyLog.info("团队收益结算: 日期-{} Uid-{}",day,uid); |
| | | } |
| | | } |
| | | //TODO 将红包金额为0的状态设置为已到账 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | |
| | | throw new GoodsEvaluateException(1, "线报已存在"); |
| | | |
| | | List<String> imgs = new ArrayList<>(); |
| | | if (dto.getImageList() != null && dto.getImageList().size() > 0) { |
| | | imgs.addAll(dto.getImageList()); |
| | | if (!StringUtil.isNullOrEmpty(dto.getPicUrls())) { |
| | | imgs.addAll(Arrays.asList(dto.getPicUrls().split(","))); |
| | | } |
| | | |
| | | GoodsDetailVO goods = null; |
| | | |
| | | //获取图片 |
| | | if (dto.getIdList() != null && dto.getIdList().size() > 0) { |
| | | if (!StringUtil.isNullOrEmpty( dto.getItemIds())) { |
| | | Set<String> imgSet = new HashSet<>(); |
| | | imgSet.addAll(imgs); |
| | | String id = dto.getIdList().get(0); |
| | | String source = dto.getPlatformType(); |
| | | String id = dto.getItemIds().split(",")[0]; |
| | | String source = dto.getPlatform(); |
| | | switch (source) { |
| | | case "tb": |
| | | case "淘宝": |
| | | try { |
| | | TaoBaoGoodsBrief goodsBrief = TaoKeApiUtil.searchGoodsDetail(id); |
| | | if (goodsBrief != null && goodsBrief.getImgList() != null) { |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | break; |
| | | case "jd": { |
| | | case "京东": { |
| | | JDGoods jdGoods = JDApiUtil.queryGoodsDetail(Long.parseLong(id)); |
| | | if (jdGoods != null && jdGoods.getImageList() != null) { |
| | | GoodsMoneyConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | |
| | | } |
| | | } |
| | | break; |
| | | case "pdd": { |
| | | case "拼多多": { |
| | | PDDGoodsDetail goodsDetail = PinDuoDuoApiUtil.getGoodsDetail(Long.parseLong(id)); |
| | | if (goodsDetail != null && goodsDetail.getGoodsGalleryUrls() != null) { |
| | | GoodsMoneyConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | |
| | | package com.yeshi.fanli.service.impl.goods; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.fanli.util.CommonGoodsUtil; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.yeshi.utils.StringUtil; |
| | |
| | | @Service |
| | | public class CommonGoodsServiceImpl implements CommonGoodsService { |
| | | |
| | | @Resource |
| | | private CommonGoodsMapper commonGoodsMapper; |
| | | |
| | | |
| | | @Override |
| | | public CommonGoods selectByPrimaryKey(Long id) { |
| | | return commonGoodsMapper.selectByPrimaryKey(id); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 验证数据正确性 |
| | | * |
| | | * @param commonGoods |
| | | * @throws CommonGoodsException |
| | | */ |
| | | private void filterCommonGoods(CommonGoods commonGoods) throws CommonGoodsException { |
| | | // 判断信息是否完成 |
| | | if (commonGoods == null) |
| | | throw new CommonGoodsException(1, "商品信息为空"); |
| | | if (commonGoods.getGoodsId() == null) |
| | | throw new CommonGoodsException(1, "商品信息不完整"); |
| | | if (commonGoods.getGoodsType() == null) |
| | | throw new CommonGoodsException(1, "商品信息不完整"); |
| | | if (StringUtil.isNullOrEmpty(commonGoods.getPicture())) |
| | | throw new CommonGoodsException(1, "商品信息不完整"); |
| | | if (commonGoods.getPrice() == null) |
| | | throw new CommonGoodsException(1, "商品信息不完整"); |
| | | if (commonGoods.getRate() == null) |
| | | throw new CommonGoodsException(1, "商品信息不完整"); |
| | | if (commonGoods.getSales() == null) |
| | | throw new CommonGoodsException(1, "商品信息不完整"); |
| | | if (commonGoods.getSellerId() == null) |
| | | throw new CommonGoodsException(1, "商品信息不完整"); |
| | | if (commonGoods.getSellerName() == null) |
| | | throw new CommonGoodsException(1, "商品信息不完整"); |
| | | if (commonGoods.getShopType() == null) |
| | | throw new CommonGoodsException(1, "商品信息不完整"); |
| | | if (StringUtil.isNullOrEmpty(commonGoods.getTitle())) |
| | | throw new CommonGoodsException(1, "商品信息不完整"); |
| | | } |
| | | |
| | | @Override |
| | | public CommonGoods addOrUpdateCommonGoods(CommonGoods commonGoods) throws CommonGoodsException { |
| | | // 验证数据完整性 |
| | | filterCommonGoods(commonGoods); |
| | | |
| | | CommonGoods goods = commonGoodsMapper.selectByGoodsIdAndGoodsType(commonGoods.getGoodsId(), |
| | | commonGoods.getGoodsType()); |
| | | if (goods != null) { |
| | | updateCommonGoods(commonGoods); |
| | | commonGoods.setId(goods.getId()); |
| | | return commonGoods; |
| | | } |
| | | commonGoods.setCreateTime(new Date()); |
| | | commonGoods.setUpdateTime(new Date()); |
| | | commonGoodsMapper.insertSelective(commonGoods); |
| | | return commonGoods; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public CommonGoods addCommonGoods(CommonGoods commonGoods) throws CommonGoodsException { |
| | | // 验证数据完整性 |
| | | filterCommonGoods(commonGoods); |
| | | |
| | | CommonGoods goods = commonGoodsMapper.selectByGoodsIdAndGoodsType(commonGoods.getGoodsId(), |
| | | commonGoods.getGoodsType()); |
| | | if (goods != null) { |
| | | commonGoods.setId(goods.getId()); |
| | | return commonGoods; |
| | | } |
| | | commonGoods.setCreateTime(new Date()); |
| | | commonGoods.setUpdateTime(new Date()); |
| | | commonGoodsMapper.insertSelective(commonGoods); |
| | | return commonGoods; |
| | | } |
| | | @Resource |
| | | private CommonGoodsMapper commonGoodsMapper; |
| | | |
| | | |
| | | @Override |
| | | public void updateCommonGoods(CommonGoods commonGoods) throws CommonGoodsException { |
| | | // 判断信息是否完整 |
| | | filterCommonGoods(commonGoods); |
| | | |
| | | CommonGoods goods = commonGoodsMapper.selectByGoodsIdAndGoodsType(commonGoods.getGoodsId(), |
| | | commonGoods.getGoodsType()); |
| | | if (goods == null) { |
| | | throw new CommonGoodsException(3, "商品不存在"); |
| | | } |
| | | // 更新商品信息 |
| | | commonGoods.setId(goods.getId()); |
| | | commonGoods.setCreateTime(null); |
| | | commonGoods.setUpdateTime(new Date()); |
| | | commonGoodsMapper.updateByPrimaryKeySelective(commonGoods); |
| | | } |
| | | @Override |
| | | public CommonGoods selectByPrimaryKey(Long id) { |
| | | return commonGoodsMapper.selectByPrimaryKey(id); |
| | | } |
| | | |
| | | @Override |
| | | public void offlineCommonGoods(String goodsId, Integer goodsType) { |
| | | CommonGoods goods = commonGoodsMapper.selectByGoodsIdAndGoodsType(goodsId, goodsType); |
| | | if (goods == null) |
| | | return; |
| | | CommonGoods update = new CommonGoods(); |
| | | update.setId(goods.getId()); |
| | | update.setUpdateTime(new Date()); |
| | | update.setState(CommonGoods.STATE_OFFLINE); |
| | | commonGoodsMapper.updateByPrimaryKeySelective(update); |
| | | } |
| | | |
| | | @Override |
| | | public CommonGoods getCommonGoodsByGoodsIdAndGoodsType(String goodsId, Integer goodsType) { |
| | | return commonGoodsMapper.selectByGoodsIdAndGoodsType(goodsId, goodsType); |
| | | } |
| | | /** |
| | | * 验证数据正确性 |
| | | * |
| | | * @param commonGoods |
| | | * @throws CommonGoodsException |
| | | */ |
| | | private void filterCommonGoods(CommonGoods commonGoods) throws CommonGoodsException { |
| | | // 判断信息是否完成 |
| | | if (commonGoods == null) |
| | | throw new CommonGoodsException(1, "商品信息为空"); |
| | | if (commonGoods.getGoodsId() == null) |
| | | throw new CommonGoodsException(1, "商品信息不完整"); |
| | | if (commonGoods.getGoodsType() == null) |
| | | throw new CommonGoodsException(1, "商品信息不完整"); |
| | | if (StringUtil.isNullOrEmpty(commonGoods.getPicture())) |
| | | throw new CommonGoodsException(1, "商品信息不完整"); |
| | | if (commonGoods.getPrice() == null) |
| | | throw new CommonGoodsException(1, "商品信息不完整"); |
| | | if (commonGoods.getRate() == null) |
| | | throw new CommonGoodsException(1, "商品信息不完整"); |
| | | if (commonGoods.getSales() == null) |
| | | throw new CommonGoodsException(1, "商品信息不完整"); |
| | | if (commonGoods.getSellerId() == null) |
| | | throw new CommonGoodsException(1, "商品信息不完整"); |
| | | if (commonGoods.getSellerName() == null) |
| | | throw new CommonGoodsException(1, "商品信息不完整"); |
| | | if (commonGoods.getShopType() == null) |
| | | throw new CommonGoodsException(1, "商品信息不完整"); |
| | | if (StringUtil.isNullOrEmpty(commonGoods.getTitle())) |
| | | throw new CommonGoodsException(1, "商品信息不完整"); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void updateBatchCommonGoods(List<CommonGoods> listCommonGoods) { |
| | | |
| | | if (listCommonGoods == null || listCommonGoods.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | for (CommonGoods commonGoods: listCommonGoods) { |
| | | try { |
| | | updateCommonGoods(commonGoods); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void addBatchCommonGoods(List<CommonGoods> listCommonGoods) { |
| | | |
| | | if (listCommonGoods == null || listCommonGoods.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | for (CommonGoods commonGoods: listCommonGoods) { |
| | | try { |
| | | addCommonGoods(commonGoods); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<CommonGoods> listBySellerId(Long sellerId, Integer goodsType) { |
| | | return commonGoodsMapper.listBySellerId(sellerId, goodsType); |
| | | } |
| | | |
| | | @Override |
| | | public long countBySellerIdAndHasCoupon(Long sellerId, Integer goodsType) { |
| | | return commonGoodsMapper.countBySellerIdAndHasCoupon(sellerId, goodsType); |
| | | } |
| | | |
| | | @Override |
| | | public List<CommonGoods> getByListGoodsId(List<String> list, Integer goodsType) { |
| | | return commonGoodsMapper.getByListGoodsId(list, goodsType); |
| | | } |
| | | |
| | | @Override |
| | | public CommonGoods addOrUpdateCommonGoods(CommonGoods commonGoods) throws CommonGoodsException { |
| | | // 验证数据完整性 |
| | | filterCommonGoods(commonGoods); |
| | | |
| | | CommonGoods goods = commonGoodsMapper.selectByGoodsIdAndGoodsType(commonGoods.getGoodsId(), |
| | | commonGoods.getGoodsType()); |
| | | if (goods != null) { |
| | | updateCommonGoods(commonGoods); |
| | | commonGoods.setId(goods.getId()); |
| | | return commonGoods; |
| | | } |
| | | commonGoods.setCreateTime(new Date()); |
| | | commonGoods.setUpdateTime(new Date()); |
| | | commonGoodsMapper.insertSelective(commonGoods); |
| | | return commonGoods; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public CommonGoods addCommonGoods(CommonGoods commonGoods) throws CommonGoodsException { |
| | | // 验证数据完整性 |
| | | filterCommonGoods(commonGoods); |
| | | |
| | | CommonGoods goods = commonGoodsMapper.selectByGoodsIdAndGoodsType(commonGoods.getGoodsId(), |
| | | commonGoods.getGoodsType()); |
| | | if (goods != null) { |
| | | commonGoods.setId(goods.getId()); |
| | | return commonGoods; |
| | | } |
| | | commonGoods.setCreateTime(new Date()); |
| | | commonGoods.setUpdateTime(new Date()); |
| | | commonGoodsMapper.insertSelective(commonGoods); |
| | | return commonGoods; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void updateCommonGoods(CommonGoods commonGoods) throws CommonGoodsException { |
| | | // 判断信息是否完整 |
| | | filterCommonGoods(commonGoods); |
| | | |
| | | CommonGoods goods = commonGoodsMapper.selectByGoodsIdAndGoodsType(commonGoods.getGoodsId(), |
| | | commonGoods.getGoodsType()); |
| | | if (goods == null) { |
| | | throw new CommonGoodsException(3, "商品不存在"); |
| | | } |
| | | // 更新商品信息 |
| | | commonGoods.setId(goods.getId()); |
| | | commonGoods.setCreateTime(null); |
| | | commonGoods.setUpdateTime(new Date()); |
| | | commonGoodsMapper.updateByPrimaryKeySelective(commonGoods); |
| | | } |
| | | |
| | | @Override |
| | | public void offlineCommonGoods(String goodsId, Integer goodsType) { |
| | | CommonGoods goods = commonGoodsMapper.selectByGoodsIdAndGoodsType(CommonGoodsUtil.getGoodsId(goodsId, goodsType), goodsType); |
| | | if (goods == null) |
| | | return; |
| | | CommonGoods update = new CommonGoods(); |
| | | update.setId(goods.getId()); |
| | | update.setUpdateTime(new Date()); |
| | | update.setState(CommonGoods.STATE_OFFLINE); |
| | | commonGoodsMapper.updateByPrimaryKeySelective(update); |
| | | } |
| | | |
| | | @Override |
| | | public CommonGoods getCommonGoodsByGoodsIdAndGoodsType(String goodsId, Integer goodsType) { |
| | | return commonGoodsMapper.selectByGoodsIdAndGoodsType(CommonGoodsUtil.getGoodsId(goodsId, goodsType), goodsType); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void updateBatchCommonGoods(List<CommonGoods> listCommonGoods) { |
| | | |
| | | if (listCommonGoods == null || listCommonGoods.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | for (CommonGoods commonGoods : listCommonGoods) { |
| | | try { |
| | | updateCommonGoods(commonGoods); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void addBatchCommonGoods(List<CommonGoods> listCommonGoods) { |
| | | |
| | | if (listCommonGoods == null || listCommonGoods.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | for (CommonGoods commonGoods : listCommonGoods) { |
| | | try { |
| | | addCommonGoods(commonGoods); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<CommonGoods> listBySellerId(Long sellerId, Integer goodsType) { |
| | | return commonGoodsMapper.listBySellerId(sellerId, goodsType); |
| | | } |
| | | |
| | | @Override |
| | | public long countBySellerIdAndHasCoupon(Long sellerId, Integer goodsType) { |
| | | return commonGoodsMapper.countBySellerIdAndHasCoupon(sellerId, goodsType); |
| | | } |
| | | |
| | | @Override |
| | | public List<CommonGoods> getByListGoodsId(List<String> list, Integer goodsType) { |
| | | List<String> goodsIdList = new ArrayList<>(); |
| | | for (String st : list) { |
| | | goodsIdList.add(CommonGoodsUtil.getGoodsId(st, goodsType)); |
| | | } |
| | | return commonGoodsMapper.getByListGoodsId(goodsIdList, goodsType); |
| | | } |
| | | |
| | | } |
| | |
| | | if (oldHongBao == null) |
| | | throw new HongBaoException(10, "红包对象不存在"); |
| | | // 已经失效,已经领取,领取中,新老状态一致的红包不做处理 |
| | | if (oldHongBao.getState() == HongBaoV2.STATE_SHIXIAO || oldHongBao.getState() == HongBaoV2.STATE_YILINGQU|| oldHongBao.getState() == HongBaoV2.STATE_LINGQUING) |
| | | if (oldHongBao.getState() == HongBaoV2.STATE_SHIXIAO || oldHongBao.getState() == HongBaoV2.STATE_YILINGQU || oldHongBao.getState() == HongBaoV2.STATE_LINGQUING) |
| | | return false; |
| | | |
| | | SystemEnum system = userInfoService.getUserSystem(commonOrder.getUserInfo().getId()); |
| | |
| | | List<HongBaoV2> children = hongBaoV2Mapper.listChildrenById(hongBao.getId()); |
| | | if (children != null && children.size() > 0) |
| | | for (HongBaoV2 child : children) { |
| | | if (child.getState() == HongBaoV2.STATE_YILINGQU||child.getState() == HongBaoV2.STATE_LINGQUING) |
| | | if (child.getState() == HongBaoV2.STATE_YILINGQU || child.getState() == HongBaoV2.STATE_LINGQUING) |
| | | continue; |
| | | |
| | | HongBaoV2 childUpdate = new HongBaoV2(child.getId()); |
| | |
| | | List<HongBaoV2> children = hongBaoV2Mapper.listChildrenById(hongBao.getId()); |
| | | if (children != null) |
| | | for (HongBaoV2 child : children) { |
| | | if (child.getState() == HongBaoV2.STATE_YILINGQU||child.getState() == HongBaoV2.STATE_LINGQUING) |
| | | if (child.getState() == HongBaoV2.STATE_YILINGQU || child.getState() == HongBaoV2.STATE_LINGQUING) |
| | | continue; |
| | | |
| | | HongBaoV2 childUpdate = new HongBaoV2(child.getId()); |
| | |
| | | @Transactional |
| | | @Override |
| | | public void setHongBaoRecieved(Long uid, List<Integer> typeList, Date preGetTime) { |
| | | hongBaoV2Mapper.setHongBaoRecieved(uid, typeList, preGetTime); |
| | | |
| | | String getMonth = TimeUtil.getGernalTime(preGetTime.getTime(), "yyyy-MM"); |
| | | //前面几个月的可能有未结算的,统一加入到本月结算 |
| | | hongBaoV2Mapper.setHongBaoRecieved(uid, typeList, preGetTime, getMonth); |
| | | } |
| | | |
| | | |
| | |
| | | import com.yeshi.fanli.util.mq.cmq.order.*; |
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil; |
| | | import com.yeshi.goods.facade.entity.taobao.TaoBaoGoodsBrief; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.core.task.TaskExecutor; |
| | | import org.springframework.stereotype.Component; |
| | | import org.yeshi.utils.NumberUtil; |
| | |
| | | |
| | | @Component |
| | | public class JobManager { |
| | | |
| | | Logger orderMoneyLog= LoggerFactory.getLogger("orderMoneyLog"); |
| | | |
| | | @Resource |
| | | private BoutiqueAutoRuleService boutiqueAutoRuleService; |
| | |
| | | String handler = its.next(); |
| | | try { |
| | | UidDateDTO dto = map.get(handler); |
| | | orderMoneyLog.info("团队收益结算开始处理:日期-{} Uid-{}",TimeUtil.getGernalTime(dto.getDate().getTime(),"yyyy-MM-dd"),dto.getUid()); |
| | | teamEincomeManager.addTeamRewardTOUserAccount(dto.getDate(), dto.getUid()); |
| | | TeamOrderCMQManager.getInstance().deleteTeamIncomeMsg(handler); |
| | | orderMoneyLog.info("团队收益结算处理成功:日期-{} Uid-{}",TimeUtil.getGernalTime(dto.getDate().getTime(),"yyyy-MM-dd"),dto.getUid()); |
| | | } catch (Exception e) { |
| | | try { |
| | | LogHelper.errorDetailInfo(e, map.get(handler).toString(), ""); |
| | |
| | | e1.printStackTrace(); |
| | | } |
| | | } |
| | | //无论结算是否成功都删除消息 |
| | | TeamOrderCMQManager.getInstance().deleteTeamIncomeMsg(handler); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | |
| | | String link = null; |
| | | try { |
| | | link = DaTaoKeApiUtil.convertLink(auctionId, app.getPid()); |
| | | link = DaTaoKeApiUtil.convertLink(auctionId, app.getPid(),false); |
| | | } catch (Exception e) { |
| | | } |
| | | |
| | |
| | | DaTaoKeFilterResult result = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(goods); |
| | | if (result.getFilterType() == DaTaoKeFilterResult.FILTER_TYPE_COUPON |
| | | || result.getFilterType() == DaTaoKeFilterResult.FILTER_TYPE_PRICE_AND_COUPON) { |
| | | link = DaTaoKeApiUtil.convertLink(auctionId, info.getPid()); |
| | | link = DaTaoKeApiUtil.convertLink(auctionId, info.getPid(),true); |
| | | } else if (goods.getCouponAmount() != null && goods.getCouponAmount().compareTo(new BigDecimal(0)) > 0) {// 有券 |
| | | link = DaTaoKeApiUtil.convertLink(auctionId, info.getPid()); |
| | | |
| | | link = DaTaoKeApiUtil.convertLink(auctionId, info.getPid(),true); |
| | | } |
| | | |
| | | if (!StringUtil.isNullOrEmpty(link)) { |
| | |
| | | } |
| | | |
| | | // 查询是否为大淘客商品 |
| | | |
| | | String link = null; |
| | | try { |
| | | link = DaTaoKeApiUtil.convertLink(auctionId, app.getPid()); |
| | | link = DaTaoKeApiUtil.convertLink(auctionId, app.getPid(),pidType==SystemPIDInfo.PidType.share); |
| | | } catch (Exception e) { |
| | | } |
| | | |
| | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil; |
| | | import org.springframework.stereotype.Component; |
| | | import org.yeshi.utils.BigDecimalUtil; |
| | | |
| | |
| | | @Component |
| | | public class CommonGoodsUtil { |
| | | |
| | | /** |
| | | * 商品佣金包含¥符号 |
| | | * |
| | | * @param goods |
| | | * @param rate |
| | | * @return |
| | | */ |
| | | public static String getCommissionInfo(CommonGoods goods, BigDecimal rate) { |
| | | return "¥" + getCommission(goods, rate).toString(); |
| | | } |
| | | /** |
| | | * 商品佣金包含¥符号 |
| | | * |
| | | * @param goods |
| | | * @param rate |
| | | * @return |
| | | */ |
| | | public static String getCommissionInfo(CommonGoods goods, BigDecimal rate) { |
| | | return "¥" + getCommission(goods, rate).toString(); |
| | | } |
| | | |
| | | /** |
| | | * 商品佣金 |
| | | * |
| | | * @param goods |
| | | * @param rate |
| | | * @return |
| | | */ |
| | | public static BigDecimal getCommission(CommonGoods goods, BigDecimal rate) { |
| | | BigDecimal money = null; |
| | | /** |
| | | * 商品佣金 |
| | | * |
| | | * @param goods |
| | | * @param rate |
| | | * @return |
| | | */ |
| | | public static BigDecimal getCommission(CommonGoods goods, BigDecimal rate) { |
| | | BigDecimal money = null; |
| | | |
| | | if (StringUtil.isNullOrEmpty(goods.getCouponInfo()) || goods.getCouponInfo().trim().equalsIgnoreCase("无")) { |
| | | BigDecimal price = goods.getPrice(); |
| | | money = MoneyBigDecimalUtil.mul(MoneyBigDecimalUtil |
| | | .mul(MoneyBigDecimalUtil.mul(price, goods.getRate()), new BigDecimal("0.01")), |
| | | MoneyBigDecimalUtil.div(rate, new BigDecimal(100))); |
| | | if (StringUtil.isNullOrEmpty(goods.getCouponInfo()) || goods.getCouponInfo().trim().equalsIgnoreCase("无")) { |
| | | BigDecimal price = goods.getPrice(); |
| | | money = MoneyBigDecimalUtil.mul(MoneyBigDecimalUtil |
| | | .mul(MoneyBigDecimalUtil.mul(price, goods.getRate()), new BigDecimal("0.01")), |
| | | MoneyBigDecimalUtil.div(rate, new BigDecimal(100))); |
| | | |
| | | } else// 有券 |
| | | { |
| | | List<BigDecimal> list = TaoBaoCouponUtil.getCouponInfo(goods.getCouponInfo()); |
| | | BigDecimal startFee = list.get(0); |
| | | BigDecimal couponAccount = list.get(1); |
| | | if (startFee.compareTo(goods.getPrice()) <= 0 && goods.getPrice().compareTo(couponAccount) > 0) { |
| | | BigDecimal finalPrice = goods.getPrice().subtract(couponAccount); |
| | | money = MoneyBigDecimalUtil.mul(MoneyBigDecimalUtil |
| | | .mul(MoneyBigDecimalUtil.mul(finalPrice, goods.getRate()), new BigDecimal("0.01")), |
| | | MoneyBigDecimalUtil.div(rate, new BigDecimal(100))); |
| | | } else// 有券 |
| | | { |
| | | List<BigDecimal> list = TaoBaoCouponUtil.getCouponInfo(goods.getCouponInfo()); |
| | | BigDecimal startFee = list.get(0); |
| | | BigDecimal couponAccount = list.get(1); |
| | | if (startFee.compareTo(goods.getPrice()) <= 0 && goods.getPrice().compareTo(couponAccount) > 0) { |
| | | BigDecimal finalPrice = goods.getPrice().subtract(couponAccount); |
| | | money = MoneyBigDecimalUtil.mul(MoneyBigDecimalUtil |
| | | .mul(MoneyBigDecimalUtil.mul(finalPrice, goods.getRate()), new BigDecimal("0.01")), |
| | | MoneyBigDecimalUtil.div(rate, new BigDecimal(100))); |
| | | |
| | | } else {// 不能用券 |
| | | money = MoneyBigDecimalUtil.mul(MoneyBigDecimalUtil |
| | | .mul(MoneyBigDecimalUtil.mul(goods.getPrice(), goods.getRate()), new BigDecimal("0.01")), |
| | | MoneyBigDecimalUtil.div(rate, new BigDecimal(100))); |
| | | } |
| | | } |
| | | |
| | | if (goods.getGoodsType() == Constant.SOURCE_TYPE_VIP) { |
| | | money = MoneyBigDecimalUtil.mul(MoneyBigDecimalUtil |
| | | .mul(MoneyBigDecimalUtil.mul(goods.getCouponStartPrice(), goods.getRate()), new BigDecimal("0.01")), |
| | | MoneyBigDecimalUtil.div(rate, new BigDecimal(100))); |
| | | } |
| | | } else {// 不能用券 |
| | | money = MoneyBigDecimalUtil.mul(MoneyBigDecimalUtil |
| | | .mul(MoneyBigDecimalUtil.mul(goods.getPrice(), goods.getRate()), new BigDecimal("0.01")), |
| | | MoneyBigDecimalUtil.div(rate, new BigDecimal(100))); |
| | | } |
| | | } |
| | | |
| | | // 京东商品特殊处理 |
| | | if (goods.getGoodsType() == Constant.SOURCE_TYPE_JD) |
| | | return BigDecimalUtil.getWithNoZera(MoneyBigDecimalUtil.mul(money, new BigDecimal("0.9"))); |
| | | else |
| | | return BigDecimalUtil.getWithNoZera(money); |
| | | } |
| | | if (goods.getGoodsType() == Constant.SOURCE_TYPE_VIP) { |
| | | money = MoneyBigDecimalUtil.mul(MoneyBigDecimalUtil |
| | | .mul(MoneyBigDecimalUtil.mul(goods.getCouponStartPrice(), goods.getRate()), new BigDecimal("0.01")), |
| | | MoneyBigDecimalUtil.div(rate, new BigDecimal(100))); |
| | | } |
| | | |
| | | /** |
| | | * 计算商品券后价,没有券则返回原价 |
| | | * |
| | | * @param goodsBrief |
| | | * @return |
| | | */ |
| | | public static BigDecimal getAfterUseCouplePrice(CommonGoods goods) { |
| | | if (StringUtil.isNullOrEmpty(goods.getCouponInfo()) || "无".equals(goods.getCouponInfo())) { |
| | | return goods.getPrice(); |
| | | } else { |
| | | List<BigDecimal> list = TaoBaoCouponUtil.getCouponInfo(goods.getCouponInfo()); |
| | | BigDecimal startFee = list.get(0); |
| | | BigDecimal couponAccount = list.get(1); |
| | | if (startFee.compareTo(goods.getPrice()) <= 0 && goods.getPrice().compareTo(couponAccount) > 0) { |
| | | BigDecimal finalPrice = goods.getPrice().subtract(couponAccount); |
| | | return finalPrice; |
| | | } else {// 不能用券 |
| | | return goods.getPrice(); |
| | | } |
| | | } |
| | | } |
| | | // 京东商品特殊处理 |
| | | if (goods.getGoodsType() == Constant.SOURCE_TYPE_JD) |
| | | return BigDecimalUtil.getWithNoZera(MoneyBigDecimalUtil.mul(money, new BigDecimal("0.9"))); |
| | | else |
| | | return BigDecimalUtil.getWithNoZera(money); |
| | | } |
| | | |
| | | /** |
| | | * 计算商品券后价,没有券则返回原价 |
| | | * |
| | | * @param goodsBrief |
| | | * @return |
| | | */ |
| | | public static BigDecimal getAfterUseCouplePrice(CommonGoods goods) { |
| | | if (StringUtil.isNullOrEmpty(goods.getCouponInfo()) || "无".equals(goods.getCouponInfo())) { |
| | | return goods.getPrice(); |
| | | } else { |
| | | List<BigDecimal> list = TaoBaoCouponUtil.getCouponInfo(goods.getCouponInfo()); |
| | | BigDecimal startFee = list.get(0); |
| | | BigDecimal couponAccount = list.get(1); |
| | | if (startFee.compareTo(goods.getPrice()) <= 0 && goods.getPrice().compareTo(couponAccount) > 0) { |
| | | BigDecimal finalPrice = goods.getPrice().subtract(couponAccount); |
| | | return finalPrice; |
| | | } else {// 不能用券 |
| | | return goods.getPrice(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public static String getGoodsId(String goodsId, int goodsType) { |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | return TaoBaoUtil.getAuctionId(goodsId); |
| | | } |
| | | return goodsId; |
| | | } |
| | | } |
| | |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | import com.yeshi.fanli.util.factory.goods.TaoBaoGoodsFactory; |
| | | import com.yeshi.fanli.util.jd.JDUtil; |
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil; |
| | | import com.yeshi.goods.facade.dto.taobao.haodanku.HaoDanKuJDGoodsInfo; |
| | | import com.yeshi.goods.facade.dto.taobao.haodanku.HaoDanKuPDDGoodsInfo; |
| | | import com.yeshi.goods.facade.entity.taobao.TaoBaoGoodsBrief; |
| | |
| | | cg.setCouponLeftCount(goods.getCouponLeftCount()); |
| | | cg.setCouponStartPrice(goods.getCouponStartFee()); |
| | | cg.setCouponTotalCount(goods.getCouponTotalCount()); |
| | | cg.setGoodsId(goods.getAuctionId()); |
| | | cg.setGoodsId(TaoBaoUtil.getAuctionId(goods.getAuctionId())); |
| | | if(TaoBaoUtil.isNewAuctionId(goods.getAuctionId())){ |
| | | cg.setGoodsSign(goods.getAuctionId()); |
| | | } |
| | | cg.setGoodsType(CommonGoods.GOODS_TYPE_TB); |
| | | cg.setPicture(goods.getPictUrl()); |
| | | cg.setPictureWhite(goods.getPictUrlWhite()); |
| | |
| | | public static GoodsDetailVO convertCommonGoods(CommonGoods goods, GoodsMoneyConfigParamsDTO params) { |
| | | GoodsDetailVO goodsInfo = new GoodsDetailVO(); |
| | | goodsInfo.setId(goods.getId()); |
| | | goodsInfo.setGoodsId(goods.getGoodsId() + ""); |
| | | if(goods.getGoodsType()==Constant.SOURCE_TYPE_TAOBAO&&!StringUtil.isNullOrEmpty(goods.getGoodsSign())) { |
| | | goodsInfo.setGoodsId(goods.getGoodsSign()+ ""); |
| | | }else { |
| | | goodsInfo.setGoodsId(goods.getGoodsId() + ""); |
| | | } |
| | | goodsInfo.setTitle(goods.getTitle()); |
| | | goodsInfo.setCreatetime(goods.getCreateTime()); |
| | | |
New file |
| | |
| | | package com.yeshi.fanli.util.goods; |
| | | |
| | | import net.sf.json.JSONObject; |
| | | import org.apache.commons.httpclient.HttpClient; |
| | | import org.apache.commons.httpclient.HttpException; |
| | | import org.apache.commons.httpclient.methods.PostMethod; |
| | | import org.yeshi.utils.StringUtil; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author hxh |
| | | * @title: CSJCPSApiUtil |
| | | * @description: 穿山甲商品联盟 |
| | | * 文档:https://lf3-plat.pglstatp-toutiao.com/obj/union-platform/ef1828077907ddfacd07b35665ddd6c3.pdf |
| | | * @date 2022/8/8 15:45 |
| | | */ |
| | | public class CSJCPSApiUtil { |
| | | |
| | | private static String post(String url, String entity) { |
| | | HttpClient client = new HttpClient(); |
| | | client.getHostConfiguration().setProxy("192.168.3.122", 8888); |
| | | PostMethod method = new PostMethod(url); |
| | | method.addRequestHeader("Content-Type", "application/json;charset=UTF-8"); |
| | | method.setRequestHeader("Content-Type", "application/json;charset=UTF-8"); |
| | | method.setRequestBody(entity); |
| | | try { |
| | | client.executeMethod(method); |
| | | return method.getResponseBodyAsString(); |
| | | } catch (HttpException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | |
| | | private static String baseRequest(String path, JSONObject data, CSJAppInfo appInfo) { |
| | | String url = "http://ecom.pangolin-sdk-toutiao.com" + path; |
| | | com.alibaba.fastjson.JSONObject params = new com.alibaba.fastjson.JSONObject(); |
| | | params.put("app_id", appInfo.getAppId()); |
| | | params.put("timestamp", System.currentTimeMillis() / 1000); |
| | | params.put("req_id", UUID.randomUUID().toString()); |
| | | params.put("data", data.toString()); |
| | | List<String> list = new ArrayList<>(); |
| | | for (Iterator<String> its = params.keySet().iterator(); its.hasNext(); ) { |
| | | String key = its.next(); |
| | | list.add(key + "=" + params.get(key)); |
| | | } |
| | | Collections.sort(list); |
| | | String signStr = StringUtil.concat(list, "&") + appInfo.getSecureKey(); |
| | | String sign = StringUtil.Md5(signStr); |
| | | params.put("sign", sign); |
| | | |
| | | return post(url, params.toString()); |
| | | } |
| | | |
| | | private static String baseRequest(String path, JSONObject data) { |
| | | String appId = "5171164"; |
| | | String secureKey = "8a3061d15290ba953f4278a2251b03f4"; |
| | | return baseRequest(path, data, new CSJAppInfo(appId, secureKey)); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | JSONObject data = new JSONObject(); |
| | | data.put("material_id", "10000"); |
| | | String result = baseRequest("/aggregate/h5", data); |
| | | JSONObject root = JSONObject.fromObject(result); |
| | | System.out.println(result); |
| | | String h5 = root.optJSONObject("data").optString("h5_page_link"); |
| | | System.out.println(h5); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | class CSJAppInfo { |
| | | private String appId; |
| | | private String secureKey; |
| | | |
| | | public CSJAppInfo() { |
| | | } |
| | | |
| | | public CSJAppInfo(String appId, String secureKey) { |
| | | this.appId = appId; |
| | | this.secureKey = secureKey; |
| | | } |
| | | |
| | | public String getAppId() { |
| | | return appId; |
| | | } |
| | | |
| | | public void setAppId(String appId) { |
| | | this.appId = appId; |
| | | } |
| | | |
| | | public String getSecureKey() { |
| | | return secureKey; |
| | | } |
| | | |
| | | public void setSecureKey(String secureKey) { |
| | | this.secureKey = secureKey; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | * @return |
| | | */ |
| | | public static String getRecoomendDesc(DaTaoKeListTopOffDTO dto) { |
| | | String text = dto.getOriginContent(); |
| | | String text = dto.getContent(); |
| | | if (StringUtil.isNullOrEmpty(text)) { |
| | | text = dto.getTitle(); |
| | | if (dto.getUrlList() != null && dto.getUrlList().size() > 0) { |
| | | text += "\n" + dto.getUrlList().get(0); |
| | | text = dto.getContentCopy(); |
| | | if (!StringUtil.isNullOrEmpty(dto.getUrls())) { |
| | | text = text.replaceAll("\\[.*\\]", dto.getUrls()); |
| | | } |
| | | } |
| | | return text; |
| | |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | String st = "好价-14点 商品页准点抢20元劵\n" + |
| | | "【39.9元】蒙牛 纯甄 酸牛奶 200g*24盒\n" + |
| | | "https://u.jd.com/8K2aSJ1"; |
| | | st = GoodsTextUtil.encodeAppHtmlText(st, "test", "查看详情"); |
| | | System.out.println(st); |
| | | st = GoodsTextUtil.decodeAppHtmlText(st); |
| | | System.out.println(st); |
| | | String st = "0任选6袋 9.89亓\n都市牧场无糖清新薄荷糖\n[淘口令请转链] \n清新口气,应酬约会更自信/"; |
| | | System.out.println(st.replaceAll("\\[.*\\]", "")); |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | public static TaoBaoGoodsBrief convert(CommonGoods commonGoods) { |
| | | TaoBaoGoodsBrief taoBaoGoods = new TaoBaoGoodsBrief(); |
| | | taoBaoGoods.setAuctionId(commonGoods.getGoodsId()); |
| | | if(!StringUtil.isNullOrEmpty(commonGoods.getGoodsSign())) { |
| | | taoBaoGoods.setAuctionId(commonGoods.getGoodsSign()); |
| | | }else{ |
| | | taoBaoGoods.setAuctionId(commonGoods.getGoodsId()); |
| | | } |
| | | taoBaoGoods.setBiz30day(commonGoods.getSales()); |
| | | taoBaoGoods.setCouponAmount(commonGoods.getCouponAmount()); |
| | | taoBaoGoods.setCouponInfo(commonGoods.getCouponInfo()); |
| | |
| | | } |
| | | |
| | | /** |
| | | * @author hxh |
| | | * @return org.springframework.data.mongodb.core.query.Criteria |
| | | * @author hxh |
| | | * @description 获取mongodb商品ID相同的条件 |
| | | * @date 16:05 2022/8/24 |
| | | * @param: key |
| | | * @param: auctionId |
| | | * @return org.springframework.data.mongodb.core.query.Criteria |
| | | **/ |
| | | public static Criteria getAuctionIdEqualCriteria(String key, String auctionId) { |
| | | if (!isNewAuctionId(auctionId)) { |
| | | return Criteria.where(key).is(auctionId); |
| | | } else { |
| | | return Criteria.where(key).regex("*-" + getAuctionId(auctionId)); |
| | | return Criteria.where(key).regex("-" + getAuctionId(auctionId)); |
| | | } |
| | | } |
| | | |
| | |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * @return java.lang.String |
| | | * @author hxh |
| | | * @description 获取淘宝的商品标题 |
| | | * @date 11:36 2022/9/9 |
| | | **/ |
| | | public static String getGoodsTitleFromTokenText(String text) { |
| | | String reg = "「.*」"; |
| | | Pattern p = Pattern.compile(reg); |
| | | Matcher matcher = p.matcher(text); |
| | | if (matcher.find()) { |
| | | String title = matcher.group(); |
| | | if(title!=null&&title.length()>0) { |
| | | return title.replace("「","").replace("」",""); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | System.out.println(isHaveNewVersionTaoBaoToken("復至\uD83D\uDC8B9.0₪sDO0X7l3Twm₪/ 去táo寶抢")); |
| | | String reg = "「.*」"; |
| | | Pattern p = Pattern.compile(reg); |
| | | Matcher matcher = p.matcher("【淘宝】https://m.tb.cn/h.Ub3d7Kb?tk=g2Az2EmdcIX CZ3457 「造梦【蔷薇少女】复古碎花牛奶绒羊羔绒毛毯秋冬保暖休闲毯沙发毯」\n" + |
| | | "点击链接直接打开"); |
| | | if (matcher.find()) { |
| | | String title = matcher.group(); |
| | | System.out.println(title); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | public static TaoBaoGoodsBrief getSimpleGoodsInfo(String id) throws TaobaoGoodsDownException { |
| | | Map<String, String> map = new HashMap<>(); |
| | | //TODO 临时接口 taobao.tbk.item.info.get |
| | | map.put("method", "taobao.tbk.item.info.temporary.get"); |
| | | map.put("method", "taobao.tbk.item.info.get"); |
| | | map.put("num_iids", id + ""); |
| | | String resultStr = TaoKeBaseUtil.baseRequestForThreeTimes(map, true); |
| | | System.out.println(resultStr); |
| | |
| | | } |
| | | |
| | | //TODO 修改临时接口 tbk_item_info_get_response |
| | | if (data.optJSONObject("tbk_item_info_temporary_get_response") == null) |
| | | if (data.optJSONObject("tbk_item_info_get_response") == null) |
| | | return null; |
| | | JSONArray array = data.optJSONObject("tbk_item_info_temporary_get_response").optJSONObject("results") |
| | | JSONArray array = data.optJSONObject("tbk_item_info_get_response").optJSONObject("results") |
| | | .optJSONArray("n_tbk_item"); |
| | | if (array != null && array.size() > 0) { |
| | | JSONObject item = array.optJSONObject(0); |
| | |
| | | TaoBaoSearchResult taoBaoSearchResult = new TaoBaoSearchResult(); |
| | | Map<String, String> map = new HashMap<>(); |
| | | //TODO 临时接口taobao.tbk.dg.material.optional |
| | | map.put("method", "taobao.tbk.dg.material.temporary.optional"); |
| | | map.put("method", "taobao.tbk.dg.material.optional"); |
| | | map.put("page_size", filter.getPageSize() == 0 ? "20" : filter.getPageSize() + ""); |
| | | map.put("page_no", (filter.getPage() <= 0 ? 1 : filter.getPage()) + ""); |
| | | if (!StringUtil.isNullOrEmpty(specialId) && !StringUtil.isNullOrEmpty(relationId)) { |
| | |
| | | System.out.println("resultStr"+ resultStr); |
| | | JSONObject data = JSONObject.fromObject(resultStr); |
| | | //TODO 临时接口tbk_dg_material_optional_response |
| | | if (data.optJSONObject("tbk_dg_material_temporary_optional_response") != null |
| | | && data.optJSONObject("tbk_dg_material_temporary_optional_response").optJSONObject("result_list") != null) { |
| | | JSONArray array = data.optJSONObject("tbk_dg_material_temporary_optional_response").optJSONObject("result_list") |
| | | if (data.optJSONObject("tbk_dg_material_optional_response") != null |
| | | && data.optJSONObject("tbk_dg_material_optional_response").optJSONObject("result_list") != null) { |
| | | JSONArray array = data.optJSONObject("tbk_dg_material_optional_response").optJSONObject("result_list") |
| | | .optJSONArray("map_data"); |
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>(); |
| | | if (array != null) { |
| | |
| | | } |
| | | taoBaoSearchResult.setTaoBaoGoodsBriefs(goodsList); |
| | | |
| | | JSONObject optJSONObject = data.optJSONObject("tbk_dg_material_temporary_optional_response"); |
| | | JSONObject optJSONObject = data.optJSONObject("tbk_dg_material_optional_response"); |
| | | int totalResults = optJSONObject.getInt("total_results"); |
| | | int totalPage = totalResults % pageEntity.getPageSize() == 0 ? totalResults / pageEntity.getPageSize() |
| | | : totalResults / pageEntity.getPageSize() + 1; |
| | |
| | | TaoBaoSearchResult taoBaoSearchResult = new TaoBaoSearchResult(); |
| | | Map<String, String> map = new HashMap<>(); |
| | | //TODO 临时接口 taobao.tbk.dg.material.optional |
| | | map.put("method", "taobao.tbk.dg.material.temporary.optional"); |
| | | map.put("method", "taobao.tbk.dg.material.optional"); |
| | | map.put("page_size", 50 + ""); |
| | | map.put("page_no", 1 + ""); |
| | | map.put("start_price", (int) zkPrice.subtract(new BigDecimal(1)).doubleValue() + ""); |
| | |
| | | System.out.println(resultStr); |
| | | JSONObject data = JSONObject.fromObject(resultStr); |
| | | //TODO 临时接口 tbk_dg_material_optional_response |
| | | if (data.optJSONObject("tbk_dg_material_temporary_optional_response") != null |
| | | && data.optJSONObject("tbk_dg_material_temporary_optional_response").optJSONObject("result_list") != null) { |
| | | JSONArray array = data.optJSONObject("tbk_dg_material_temporary_optional_response").optJSONObject("result_list") |
| | | if (data.optJSONObject("tbk_dg_material_optional_response") != null |
| | | && data.optJSONObject("tbk_dg_material_optional_response").optJSONObject("result_list") != null) { |
| | | JSONArray array = data.optJSONObject("tbk_dg_material_optional_response").optJSONObject("result_list") |
| | | .optJSONArray("map_data"); |
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>(); |
| | | if (array != null) { |
| | |
| | | |
| | | public static void main(String[] args) throws TaobaoGoodsDownException { |
| | | //搜索 |
| | | TaoBaoGoodsBrief goods= searchGoodsDetail("X4g0DS2OK34iwyyI06AQQCg-XQWo4eH00jgRjx3iB0"); |
| | | TaoBaoGoodsBrief goods= searchGoodsDetail("682141395159"); |
| | | |
| | | System.out.println(goods); |
| | | |
| | |
| | | JSONObject data = JSONObject.fromObject(response); |
| | | try { |
| | | //TODO 临时测试 tbk_order_details_get_response |
| | | JSONObject rootData = data.optJSONObject("tbk_order_details_temporary_get_response").optJSONObject("data"); |
| | | JSONObject rootData = data.optJSONObject("tbk_order_details_get_response").optJSONObject("data"); |
| | | array = rootData.optJSONObject("results").optJSONArray("publisher_order_dto"); |
| | | dto.setHasPre(rootData.optBoolean("has_pre")); |
| | | dto.setPositionIndex(rootData.optString("position_index")); |
| | |
| | | if (!StringUtil.isNullOrEmpty(positionIndex)) |
| | | params.put("position_index", positionIndex + ""); |
| | | //TODO 临时测试taobao.tbk.order.details.get |
| | | params.put("method", "taobao.tbk.order.details.temporary.get"); |
| | | params.put("method", "taobao.tbk.order.details.get"); |
| | | TaoKeAppInfo app = new TaoKeAppInfo(); |
| | | app.setAppKey(TaoBaoConstant.TAOBAO_AUTH_APPKEY); |
| | | app.setAppSecret(TaoBaoConstant.TAOBAO_AUTH_APPSECRET); |
| | |
| | | </appender> |
| | | |
| | | |
| | | <appender name="ORDER_MONEY_APPENDER" class="com.tencentcloudapi.cls.LoghubAppender"> |
| | | <!--必选项--> |
| | | <endpoint>${tencent.log.endpoint}</endpoint> |
| | | <accessKeyId>${tencent.log.accesskey}</accessKeyId> |
| | | <accessKeySecret>${tencent.log.accessKeySecret}</accessKeySecret> |
| | | <topicId>c7b633c7-e76a-4660-b554-5fa9fdde3c9c</topicId> |
| | | |
| | | <!-- 可选项 设置时间格式 --> |
| | | <timeFormat>yyyy-MM-dd'T'HH:mm:ssZ</timeFormat> |
| | | <timeZone>Asia/Shanghai</timeZone> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | <mdcFields>THREAD_ID,MDC_KEY</mdcFields> |
| | | </appender> |
| | | |
| | | |
| | | <!--name表示为哪一个logger指定层级和输出的方式 |
| | | additivity表示叠加祖先的输出方式(默认为true,会叠加),所以com.lxc.o2o以及其子类都会输出在控制台中,因为这个logger继承了root中的appender |
| | | level表示级别大于等于${log.level}的信息才会输出,输出方式为配置的appender, |
| | |
| | | </logger> |
| | | |
| | | |
| | | <!-- 与订单相关的资金日志 --> |
| | | <logger name="orderMoneyLog" level="INFO" additivity="false"> |
| | | <appender-ref ref="ORDER_MONEY_APPENDER"></appender-ref> |
| | | </logger> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <!-- 排除不需要打印的日志 --> |
| | | <logger name="com.qcloud.cmq.CMQTool" level="OFF" additivity="false"/> |
| | | |
| | |
| | | <id column="cg_id" property="id" jdbcType="BIGINT" /> |
| | | <result column="cg_title" property="title" jdbcType="VARCHAR" /> |
| | | <result column="cg_goods_id" property="goodsId" jdbcType="VARCHAR" /> |
| | | <result column="cg_goods_sign" property="goodsSign" jdbcType="VARCHAR" /> |
| | | <result column="cg_goods_type" property="goodsType" jdbcType="INTEGER" /> |
| | | <result column="cg_shop_type" property="shopType" jdbcType="INTEGER" /> |
| | | <result column="cg_seller_id" property="sellerId" jdbcType="BIGINT" /> |
| | |
| | | jdbcType="INTEGER" /> |
| | | <result column="cg_category_info" property="categoryInfo" jdbcType="VARCHAR"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">cg_id,cg_title,cg_goods_id,cg_goods_type,cg_shop_type,cg_seller_id,cg_seller_name,cg_sales,cg_rate,cg_picture,cg_picture_white,cg_state,cg_price,cg_coupon_info,cg_coupon_startprice,cg_coupon_amount,cg_coupon_left_count,cg_coupon_total_count,cg_video_cover,cg_video_url,cg_other_info,cg_createtime,cg_updatetime,cg_material_lib_type,cg_category_info |
| | | <sql id="Base_Column_List">cg_id,cg_title,cg_goods_id,cg_goods_sign,cg_goods_type,cg_shop_type,cg_seller_id,cg_seller_name,cg_sales,cg_rate,cg_picture,cg_picture_white,cg_state,cg_price,cg_coupon_info,cg_coupon_startprice,cg_coupon_amount,cg_coupon_left_count,cg_coupon_total_count,cg_video_cover,cg_video_url,cg_other_info,cg_createtime,cg_updatetime,cg_material_lib_type,cg_category_info |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | |
| | | yeshi_ec_common_goods where cg_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.goods.CommonGoods" |
| | | useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_common_goods |
| | | (cg_id,cg_title,cg_goods_id,cg_goods_type,cg_shop_type,cg_seller_id,cg_seller_name,cg_sales,cg_rate,cg_picture,cg_picture_white,cg_state,cg_price,cg_coupon_info,cg_coupon_startprice,cg_coupon_amount,cg_coupon_left_count,cg_coupon_total_count,cg_video_cover,cg_video_url,cg_other_info,cg_createtime,cg_updatetime,cg_material_lib_type,cg_category_info) |
| | | (cg_id,cg_title,cg_goods_id,cg_goods_sign,cg_goods_type,cg_shop_type,cg_seller_id,cg_seller_name,cg_sales,cg_rate,cg_picture,cg_picture_white,cg_state,cg_price,cg_coupon_info,cg_coupon_startprice,cg_coupon_amount,cg_coupon_left_count,cg_coupon_total_count,cg_video_cover,cg_video_url,cg_other_info,cg_createtime,cg_updatetime,cg_material_lib_type,cg_category_info) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{title,jdbcType=VARCHAR},#{goodsId,jdbcType=VARCHAR},#{goodsType,jdbcType=INTEGER},#{shopType,jdbcType=INTEGER},#{sellerId,jdbcType=BIGINT},#{sellerName,jdbcType=VARCHAR},#{sales,jdbcType=INTEGER},#{rate,jdbcType=DECIMAL},#{picture,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{price,jdbcType=DECIMAL},#{couponInfo,jdbcType=VARCHAR},#{couponStartPrice,jdbcType=DECIMAL},#{couponAmount,jdbcType=DECIMAL},#{couponLeftCount,jdbcType=INTEGER},#{couponTotalCount,jdbcType=INTEGER},#{videoCover,jdbcType=VARCHAR},#{videoUrl,jdbcType=VARCHAR},#{otherInfo,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{materialLibType,jdbcType=INTEGER},#{categoryInfo,jdbcType=VARCHAR}) |
| | | (#{id,jdbcType=BIGINT},#{title,jdbcType=VARCHAR},#{goodsId,jdbcType=VARCHAR},#{goodsSign,jdbcType=VARCHAR},#{goodsType,jdbcType=INTEGER},#{shopType,jdbcType=INTEGER},#{sellerId,jdbcType=BIGINT},#{sellerName,jdbcType=VARCHAR},#{sales,jdbcType=INTEGER},#{rate,jdbcType=DECIMAL},#{picture,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{price,jdbcType=DECIMAL},#{couponInfo,jdbcType=VARCHAR},#{couponStartPrice,jdbcType=DECIMAL},#{couponAmount,jdbcType=DECIMAL},#{couponLeftCount,jdbcType=INTEGER},#{couponTotalCount,jdbcType=INTEGER},#{videoCover,jdbcType=VARCHAR},#{videoUrl,jdbcType=VARCHAR},#{otherInfo,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{materialLibType,jdbcType=INTEGER},#{categoryInfo,jdbcType=VARCHAR}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.goods.CommonGoods" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | |
| | | <if test="id != null">cg_id,</if> |
| | | <if test="title != null">cg_title,</if> |
| | | <if test="goodsId != null">cg_goods_id,</if> |
| | | <if test="goodsSign != null">cg_goods_sign,</if> |
| | | <if test="goodsType != null">cg_goods_type,</if> |
| | | <if test="shopType != null">cg_shop_type,</if> |
| | | <if test="sellerId != null">cg_seller_id,</if> |
| | |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="title != null">#{title,jdbcType=VARCHAR},</if> |
| | | <if test="goodsId != null">#{goodsId,jdbcType=VARCHAR},</if> |
| | | <if test="goodsSign != null">#{goodsSign,jdbcType=VARCHAR},</if> |
| | | <if test="goodsType != null">#{goodsType,jdbcType=INTEGER},</if> |
| | | <if test="shopType != null">#{shopType,jdbcType=INTEGER},</if> |
| | | <if test="sellerId != null">#{sellerId,jdbcType=BIGINT},</if> |
| | |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.goods.CommonGoods">update |
| | | yeshi_ec_common_goods set cg_title = |
| | | #{title,jdbcType=VARCHAR},cg_goods_id = |
| | | #{goodsId,jdbcType=VARCHAR},cg_goods_type = |
| | | #{goodsId,jdbcType=VARCHAR},cg_goods_sign = |
| | | #{goodsSign,jdbcType=VARCHAR},cg_goods_type = |
| | | #{goodsType,jdbcType=INTEGER},cg_shop_type = |
| | | #{shopType,jdbcType=INTEGER},cg_seller_id = |
| | | #{sellerId,jdbcType=BIGINT},cg_seller_name = |
| | |
| | | <set> |
| | | <if test="title != null">cg_title=#{title,jdbcType=VARCHAR},</if> |
| | | <if test="goodsId != null">cg_goods_id=#{goodsId,jdbcType=VARCHAR},</if> |
| | | <if test="goodsSign != null">cg_goods_sign=#{goodsSign,jdbcType=VARCHAR},</if> |
| | | <if test="goodsType != null">cg_goods_type=#{goodsType,jdbcType=INTEGER},</if> |
| | | <if test="shopType != null">cg_shop_type=#{shopType,jdbcType=INTEGER},</if> |
| | | <if test="sellerId != null">cg_seller_id=#{sellerId,jdbcType=BIGINT},</if> |
| | |
| | | </select> |
| | | |
| | | <update id="setHongBaoRecieved" > |
| | | update yeshi_ec_hongbao_v2 v set v.hb_state=3 ,v.hb_update_time=NOW() where v.hb_uid=#{uid} and v.hb_state=5 and v.hb_pre_get_time=#{preGetTime} |
| | | update yeshi_ec_hongbao_v2 v set v.hb_state=3 ,v.hb_update_time=NOW() where v.hb_uid=#{uid} and v.hb_state=5 and (v.hb_pre_get_time=#{preGetTime} or from_unixtime(unix_timestamp( v.`hb_get_time`),'%Y-%m')=#{getMonth} ) |
| | | <if test="typeList!=null"> |
| | | <foreach collection="typeList" item="type" open=" and (" separator=" or " close=")"> |
| | | v.hb_type=#{type} |
| | |
| | | <!-- 根据auctionId 查询商品信息 --> |
| | | SELECT |
| | | <include refid="Base_Column_List" /> |
| | | FROM yeshi_ec_taobao_goods tg WHERE tg.`auctionId` = ${auctionId} order by id desc |
| | | FROM yeshi_ec_taobao_goods tg WHERE tg.`auctionId` = #{auctionId} order by id desc limit 1 |
| | | </select> |
| | | |
| | | |