package com.fuzamei.web;

import java.util.Map;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.fastjson.JSON;
import com.fuzamei.baseTest.BaseJunit4Test;
import com.fuzamei.constant.Role;
import com.fuzamei.entity.Param;
import com.fuzamei.entity.UserDetail;
import com.fuzamei.service.UserAuthoricationService;

public class OrdersIssueActionTest extends BaseJunit4Test{
	
	@Autowired
	private UserAuthoricationService userAuthoricationService;
	
	@Autowired
	private OrdersIssueAction ordersIssueAction;
	
	@Test//测试添加订单功能
	public void test01(){
		Param param=new Param();
		param.setUserId(9001);
		param.setOrderId(100000001);
		param.setSupplierId(9003);
		param.setPartNo("partNo1");
		param.setBoxNo("FCIU4615794");
		param.setInboxQty(20);
		Map<String, Object> result = ordersIssueAction.addOrder(param);
		String jsonString = JSON.toJSONString(result,true);
		System.out.println(jsonString);
	}
	
	@Test//测试【计划员】查看订单功能
	public void test02(){
		Param param=new Param();
		param.setUserId(9001);
		param.setPage(1);
		param.setSupplierName("ylx003供应商");
		param.setBoxNo("FCIU4615794");
		param.setStartTime(null);
		param.setEndTime(null);
		Map<String, Object> result = ordersIssueAction.queryOrdersByPlanner(param);
		String jsonString = JSON.toJSONString(result,true);
		System.out.println(jsonString);
	}
	
	@Test//测试【供应商】查看订单功能
	public void test03(){
		Param param=new Param();
		param.setUserId(9003);
		param.setPage(1);
		param.setOrderId(null);
		param.setBoxNo(null);
		param.setStatusId(null);
		param.setStartTime(null);
		param.setEndTime(null);
		Map<String, Object> result = ordersIssueAction.queryOrdersBySupplier(param);
		String jsonString = JSON.toJSONString(result,true);
		System.out.println(jsonString);
	}
	
	@Test//测试显示计划员下的所有供应商
	public void test04(){
		Param param=new Param();
		param.setUserId(9001);
		Map<String, Object> result = ordersIssueAction.showSuppliersUnderPlanner(param);
		String jsonString = JSON.toJSONString(result,true);
		System.out.println(jsonString);
	}
	
	@Test//测试显示所有箱号
	public void test05(){
		Param param=new Param();
		param.setUserId(9002);
		Map<String, Object> result = ordersIssueAction.showAllBoxNo(param);
		String jsonString = JSON.toJSONString(result,true);
		System.out.println(jsonString);
	}
	
	@Test//测试订单跟踪信息
	public void test06(){
		Param param=new Param();
		param.setUserId(9003);
		param.setOrderId(100000001);
		Map<String, Object> result = ordersIssueAction.orderTracking(param);
		String jsonString = JSON.toJSONString(result,true);
		System.out.println(jsonString);
	}
	
	
	
	
	
}
