OrderStatisticsServiceImpl.java 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package com.goafanti.order.service.impl;
  2. import com.alibaba.fastjson.JSON;
  3. import com.goafanti.common.dao.TOrderNewMapper;
  4. import com.goafanti.core.mybatis.BaseMybatisDao;
  5. import com.goafanti.order.bo.*;
  6. import com.goafanti.order.bo.outStatistics.OutOrderSalesSourceAmount;
  7. import com.goafanti.order.service.OrderStatisticsService;
  8. import groovy.util.logging.Log4j;
  9. import org.springframework.beans.factory.annotation.Autowired;
  10. import org.springframework.stereotype.Service;
  11. import java.math.BigDecimal;
  12. import java.util.*;
  13. @Service
  14. @Log4j
  15. public class OrderStatisticsServiceImpl extends BaseMybatisDao<TOrderNewMapper> implements OrderStatisticsService {
  16. @Autowired
  17. private TOrderNewMapper tOrderNewMapper;
  18. @Override
  19. public Object orderSalesSource(InputOrderSalesSource in) {
  20. if (in.getSort()==null)in.setSort(1);
  21. if(in.getEndDate()!=null)in.setEndDate(in.getEndDate()+" 23:59:59");
  22. if (in.getDeps()!=null){
  23. List<String> ls= JSON.parseArray(in.getDeps(),String.class);
  24. in.setListDep(ls);
  25. }
  26. if (in.getSort()==1){
  27. List<OutOrderSalesSource> outOrderSalesSources = tOrderNewMapper.orderSalesSource(in);
  28. return outOrderSalesSources;
  29. }else if (in.getSort()==0){
  30. List<OutOrderSalesSourceAmount> outOrderSalesSources = tOrderNewMapper.orderSalesSourceAmount(in);
  31. return outOrderSalesSources;
  32. }
  33. return null;
  34. }
  35. }