package org.linlinjava.litemall.allinone;

import java.util.List;
import java.util.Map;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.linlinjava.jz.Application;
import org.linlinjava.jz.admin.service.AdminCustomerService;
import org.linlinjava.jz.admin.service.AdminDmTicketConsultTypeService;
import org.linlinjava.jz.admin.service.AdminReportService;
import org.linlinjava.jz.admin.service.AdminSkillGroupService;
import org.linlinjava.jz.admin.vo.SkillGroupVo;
import org.linlinjava.jz.admin.vo.Ticket_Consult_Type_Vo;
import org.linlinjava.jz.core.util.JsonUtil;
import org.linlinjava.jz.db.dao.JzTicketActionMapper;
import org.linlinjava.jz.db.domain.SysUser;
import org.linlinjava.jz.db.dto.JzTicketActionDto;
import org.linlinjava.jz.db.service.JzSysUserService;
import org.linlinjava.jz.db.service.JzTicketActionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class)
public class TestService {

	@Autowired
	private AdminCustomerService userService;

//	@Autowired
//	private AdminTicketService ticketService;
	
	@Autowired
	private JzTicketActionMapper jzTicketActionMapper;
	
	@Autowired
	JzTicketActionService jzTicketActionService;
 
	@Autowired
	private JzSysUserService adminService;
	
	@Autowired
	private AdminSkillGroupService adminSkillGroupService;
	
	@Autowired
	AdminDmTicketConsultTypeService adminDmTicketConsultTypeService;
	
	@Autowired
	AdminReportService adminReportService;

	@Test
	public void test() {
//		List<Map<String, Object>> selectByTicketId = jzTicketActionMapper.selectByTicketId(2);
//		List<JzTicketActionDto> entity = JsonUtil.jsonToListT(selectByTicketId, JzTicketActionDto.class);
//		
//		System.out.println(entity);
		
//		Object findByMobile = userService.findByMobile("18516779956");
//		
//		Object findByMobile2 = userService.read(7165);
//		System.out.println(findByMobile);
//		System.out.println(findByMobile2);
		
//		Object detail = jzTicketActionService.selectByTicketId(2);
//		System.out.println(detail);
		try {
//			List<SysUser> adminList = adminService.querySelectQuit(null, null, 1, 10, null, "desc");
//			System.out.println(adminList);
			
//			List<SkillGroupVo> allUsers = adminSkillGroupService.getSysUser();
//			System.out.println(allUsers);
			
//			List<Ticket_Consult_Type_Vo> lastChild = adminDmTicketConsultTypeService.getLastChild();
//			System.out.println(JsonUtil.getJson(lastChild));
			adminReportService.ticketConsultTypeReport(null, "2020-01-01", "2022-01-01");
		} catch (Exception e) {
			e.printStackTrace();
		}
	
		
	}
}
