yujian
2019-01-11 64fa40bb05e09c55617a581e006cd0d25c6fc986
fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java
@@ -13,6 +13,7 @@
import org.apache.commons.beanutils.PropertyUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.yeshi.utils.taobao.TbImgUtil;
import com.yeshi.fanli.dao.mybatis.order.CommonOrderGoodsMapper;
import com.yeshi.fanli.dao.mybatis.order.CommonOrderMapper;
@@ -29,6 +30,7 @@
import com.yeshi.fanli.service.inter.order.CommonOrderService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.factory.CommonOrderGoodsFactory;
import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
@@ -169,6 +171,11 @@
                  e.printStackTrace();
               }
               String picture = commonGoodsVO.getPicture();
               if (!StringUtil.isNullOrEmpty(picture) && !picture.contains("320x320")) {
                  commonGoodsVO.setPicture(TbImgUtil.getTBSize320Img(picture));
               }
               Integer hongBaoType = order.getHongBaoType();
               // 邀请订单信息保护
               if (HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType
@@ -448,7 +455,68 @@
   @Override
   public long countByUidAndOrderStateWithOrderBalanceTime(Long uid, int state, Date minDate, Date maxDate) {
      return commonOrderMapper.countByUidAndOrderStateWithOrderBalanceTime(uid, state, minDate, maxDate);
   }
   @Override
   public List<CommonOrderVO> listQueryByUid(long start, int count, Long uid, Integer state, Integer type,
         Integer orderState, String orderNo, String startTime, String endTime, Integer dateType)
         throws CommonOrderException {
      List<CommonOrderVO> list = commonOrderMapper.listQueryByUid(start, count, uid, state, type,
            orderState, orderNo, startTime, endTime, dateType);
      if (list == null) {
         list = new ArrayList<CommonOrderVO>();
      }
      if (list.size() == 0) {
         return list;
      }
      for (CommonOrderVO order : list) {
         /* 订单返利类型 转换 */
         Integer hongBaoType = order.getHongBaoType();
         if (HongBaoV2.TYPE_ZIGOU == hongBaoType || 2 == hongBaoType) {
            // 自购
            order.setHongBaoType(1);
         } else if (HongBaoV2.TYPE_SHARE_GOODS == hongBaoType) {
            // 分享
            order.setHongBaoType(2);
         } else if (HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType
               || HongBaoV2.TYPE_ERJI == hongBaoType || HongBaoV2.TYPE_SHARE_YIJI == hongBaoType
               || HongBaoV2.TYPE_SHARE_ERJI == hongBaoType) {
            // 邀请
            order.setHongBaoType(3);
         }
         Integer hongBaoState = order.getHongBaoState();
         if (HongBaoV2.STATE_KELINGQU == hongBaoState || HongBaoV2.STATE_BUKELINGQU == hongBaoState) {
            // 未到账
            order.setHongBaoState(1);
         } else if (HongBaoV2.STATE_YILINGQU == hongBaoState) {
            // 已到账
            order.setHongBaoState(2);
         } else if (HongBaoV2.STATE_SHIXIAO == hongBaoState) {
            // 已失效
            order.setHongBaoState(3);
         }
      }
      return list;
   }
   @Override
   public long countQueryByUid(Long uid, Integer state, Integer type, Integer orderState, String orderNo,
         String startTime, String endTime, Integer dateType) throws CommonOrderException {
      return commonOrderMapper.countQueryByUid(uid, state, type, orderState, orderNo, startTime, endTime, dateType);
   }
}