From 30d8e227e8d823b6c38c3b9c90ac2df03b63befe Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 25 二月 2025 16:41:22 +0800 Subject: [PATCH] 淘宝转链接口更新 --- fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/UserTLJBuyHistoryServiceImpl.java | 92 +++++++++++++++++++++++----------------------- 1 files changed, 46 insertions(+), 46 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/UserTLJBuyHistoryServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/UserTLJBuyHistoryServiceImpl.java index 0a852e0..503c64c 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/UserTLJBuyHistoryServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/UserTLJBuyHistoryServiceImpl.java @@ -1,46 +1,46 @@ -package com.yeshi.fanli.service.impl.taobao; - -import java.util.Date; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.yeshi.fanli.dao.taobao.UserTLJBuyHistoryDao; -import com.yeshi.fanli.entity.taobao.UserTLJBuyHistory; -import com.yeshi.fanli.service.inter.taobao.UserTLJBuyHistoryService; -import com.yeshi.fanli.util.StringUtil; -import org.yeshi.utils.TimeUtil; - - -@Service -public class UserTLJBuyHistoryServiceImpl implements UserTLJBuyHistoryService { - @Resource - private UserTLJBuyHistoryDao userTLJBuyHistoryDao; - - @Override - public boolean canBuy(Long uid, Long auctionId) { - if (uid == null || auctionId == null) - return false; - String day = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd"); - List<UserTLJBuyHistory> list = userTLJBuyHistoryDao.listByDayAndUidAndAuctionId(uid, auctionId, day); - if (list == null || list.size() < 3) - return true; - return false; - } - - @Override - public void addHistory(UserTLJBuyHistory history) throws Exception { - if (history == null || history.getAuctionId() == null || history.getUid() == null) - throw new Exception("淇℃伅涓嶅畬鏁�"); - if (history.getCreateTime() == null) - history.setCreateTime(new Date()); - String day = TimeUtil.getGernalTime(history.getCreateTime().getTime(), "yyyy-MM-dd"); - history.setDay(day); - history.setId( - StringUtil.Md5(history.getAuctionId() + "-" + history.getUid() + "-" + System.currentTimeMillis())); - userTLJBuyHistoryDao.save(history); - } - -} +package com.yeshi.fanli.service.impl.taobao; + +import java.util.Date; +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import com.yeshi.fanli.dao.taobao.UserTLJBuyHistoryDao; +import com.yeshi.fanli.entity.taobao.UserTLJBuyHistory; +import com.yeshi.fanli.service.inter.taobao.UserTLJBuyHistoryService; +import com.yeshi.fanli.util.StringUtil; +import org.yeshi.utils.TimeUtil; + + +@Service +public class UserTLJBuyHistoryServiceImpl implements UserTLJBuyHistoryService { + @Resource + private UserTLJBuyHistoryDao userTLJBuyHistoryDao; + + @Override + public boolean canBuy(Long uid, String auctionId) { + if (uid == null || auctionId == null) + return false; + String day = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd"); + List<UserTLJBuyHistory> list = userTLJBuyHistoryDao.listByDayAndUidAndAuctionId(uid, auctionId, day); + if (list == null || list.size() < 3) + return true; + return false; + } + + @Override + public void addHistory(UserTLJBuyHistory history) throws Exception { + if (history == null || history.getAuctionId() == null || history.getUid() == null) + throw new Exception("淇℃伅涓嶅畬鏁�"); + if (history.getCreateTime() == null) + history.setCreateTime(new Date()); + String day = TimeUtil.getGernalTime(history.getCreateTime().getTime(), "yyyy-MM-dd"); + history.setDay(day); + history.setId( + StringUtil.Md5(history.getAuctionId() + "-" + history.getUid() + "-" + System.currentTimeMillis())); + userTLJBuyHistoryDao.save(history); + } + +} -- Gitblit v1.8.0