Commit 96657a78 authored by hanfeng's avatar hanfeng

修改订单统计

parent 2acff168
import com.xxfc.platform.order.OrderApplication; import com.xxfc.platform.order.OrderApplication;
import com.xxfc.platform.order.biz.DailyOrderStatisticsBiz; import com.xxfc.platform.order.biz.DailyOrderStatisticsBiz;
import com.xxfc.platform.order.biz.OrderStatisticsBiz; import com.xxfc.platform.order.biz.OrderStatisticsBiz;
import com.xxfc.platform.order.jobhandler.BaseOrderStatisticsJobHandler;
import com.xxfc.platform.order.pojo.HomePageOrderData; import com.xxfc.platform.order.pojo.HomePageOrderData;
import org.joda.time.DateTime;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
/** /**
* @author libin * @author libin
* @version 1.0 * @version 1.0
...@@ -24,29 +30,31 @@ public class ServiceTest { ...@@ -24,29 +30,31 @@ public class ServiceTest {
@Autowired @Autowired
private OrderStatisticsBiz statisticsBiz; private OrderStatisticsBiz statisticsBiz;
@Autowired
private BaseOrderStatisticsJobHandler handler;
@Test @Test
public void testSchedu(){ public void testSchedu() {
dailyOrderStatisticsBiz.statisticalOrder(1); dailyOrderStatisticsBiz.statisticalOrder(1);
} }
@Test @Test
public void test() throws ParseException { public void test() throws ParseException {
String d="2019-09-01"; String d = "2019-09-01";
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date parse = dateFormat.parse(d); Date parse = dateFormat.parse(d);
System.out.println(parse); System.out.println(parse);
} }
@Test @Test
public void test2() { public void test2() {
DateTime dateTime = DateTime.parse("2019-10-10"); DateTime dateTime = DateTime.parse("2019-10-10");
System.out.println(dateTime); System.out.println(dateTime);
} }
@Test @Test
public void test3() { public void test3() {
DateTime dateTime = DateTime.parse("2019-10-10"); DateTime dateTime = DateTime.parse("2019-10-10");
Date date = dateTime.toDate(); Date date = dateTime.toDate();
DateTime dateTime1 = DateTime.parse("2019-12-10"); DateTime dateTime1 = DateTime.parse("2019-12-10");
...@@ -58,15 +66,14 @@ public class ServiceTest { ...@@ -58,15 +66,14 @@ public class ServiceTest {
} }
@Test @Test
public void handlerTeset() { public void handlerTeset() {
handler.execute("2019-10-12"); handler.execute("2019-10-12");
} }
@Test @Test
public void test(){ public void test4() {
HomePageOrderData totalOrder = statisticsBiz.getTotalOrder(null); HomePageOrderData totalOrder = statisticsBiz.getTotalOrder(null);
System.out.println(totalOrder); System.out.println(totalOrder);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment