| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoOrderMapper;
|
| | | import com.yeshi.fanli.entity.admin.ReslutOrder;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoOrderService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil;
|
| | | import com.yeshi.fanli.vo.order.TaoBaoOrderVO;
|
| | |
|
| | | @Service
|
| | | public class TaoBaoOrderServiceImpl implements TaoBaoOrderService {
|
| | |
| | | Iterator<String> its = map.keySet().iterator();
|
| | | while (its.hasNext()) {
|
| | | String orderId = its.next();
|
| | | String key = "doorder-" + orderId;
|
| | | String key = "addorder-" + orderId;
|
| | | // redis做频率限制
|
| | | try {
|
| | | if (!StringUtil.isNullOrEmpty(redisManager.getCommonString(key))) {
|
| | | continue;
|
| | | if (Constant.IS_OUTNET) {
|
| | | if (!StringUtil.isNullOrEmpty(redisManager.getCommonString(key))) {
|
| | | continue;
|
| | | }
|
| | | }
|
| | |
|
| | | } catch (Exception e) {
|
| | |
| | | addTaoBaoOrder(orderId, map.get(orderId));
|
| | | try {
|
| | | // 6小时内不再处理
|
| | | redisManager.cacheCommonString(key, "1", 60 * 60 * 6);
|
| | | if (Constant.IS_OUTNET)
|
| | | redisManager.cacheCommonString(key, "1", 60 * 60 * 6);
|
| | | } catch (Exception e) {
|
| | |
|
| | | }
|
| | |
| | | return taoBaoOrderMapper.getStateByOrderIdAndPayment(orderId, payment);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public List<TaoBaoOrderVO> listQuery(int start, int count, String key, |
| | | String startTime, String endTime, Integer state) throws Exception {
|
| | | |
| | | List<TaoBaoOrderVO> listData = taoBaoOrderMapper.listQuery(start, count, key, startTime, endTime, state);
|
| | | |
| | | for (TaoBaoOrderVO taoBaoOrderVO : listData) {
|
| | | |
| | | String orderState = taoBaoOrderVO.getOrderState();
|
| | | if ("订单付款".equals(orderState)) {
|
| | | taoBaoOrderVO.setOrderState("1");
|
| | | }else if ("订单结算".equals(orderState) || "订单成功".equals(orderState)) {
|
| | | taoBaoOrderVO.setOrderState("2");
|
| | | } else if ("订单失效".equals(orderState)) {
|
| | | taoBaoOrderVO.setOrderState("3");
|
| | | }
|
| | | }
|
| | | |
| | | return listData;
|
| | | }
|
| | | |
| | | @Override
|
| | | public long countQuery(String key, String startTime, String endTime, |
| | | Integer state) throws Exception {
|
| | | return taoBaoOrderMapper.countQuery(key, startTime, endTime, state);
|
| | | }
|
| | | |
| | | }
|