package com.ruoyi.web.controller.nanjing;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.nanjing.domain.ParaAllShow;
import com.ruoyi.nanjing.domain.ProRpList;
import com.ruoyi.nanjing.domain.TBdProductinfo;
import com.ruoyi.nanjing.service.ITSyTracestateService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/nanjing/selectParaAll")
public class SelectParaAllController extends BaseController {
    private String prefix = "nanjing/ParaAllShow";
    @Autowired
    private ITSyTracestateService tracestateService;

    @RequiresPermissions("nanjing:ParaAllShow:view")
    @GetMapping()
    public String ProRpList(ModelMap map)
    {
        return prefix + "/ParaAllShow";
    }
    @RequiresPermissions("nanjing:ParaAllShow:list")
    @PostMapping("/paraAllShow")
    @ResponseBody
    public TableDataInfo list(HttpServletRequest request)
    {
        String semiBarcode = request.getParameter("semiBarcode");
        Map<String, Object> map = new HashMap<String,Object>();
        map.put("beginTime",null);
        map.put("endTime",null);
        map.put("semiBarcode",semiBarcode);
//        List<List<?>> multiResult = tracestateService.selectAllPara(map);
//        List<ParaAllShow> list = tracestateService.selectAllPara(map);
        List<List<HashMap<String,String>>> list = tracestateService.selectAllPara(map);

        return getDataTable(list);

    }

//    @RequiresPermissions("nanjing:ParaAllShow:export")
//    @Log(title = "产品码查询", businessType = BusinessType.EXPORT)
//    @PostMapping("/export")
//    @ResponseBody
//    public AjaxResult export(HttpServletRequest request)
//    {
//        String semiBarcode = request.getParameter("semiBarcode");
//        Map map = new HashMap<String,Object>();
//        map.put("beginTime",null);
//        map.put("endTime",null);
//        map.put("semiBarcode",semiBarcode);
//        List<ParaAllShow> list = tracestateService.selectAllPara(map);
//        ExcelUtil<ParaAllShow> util = new ExcelUtil<ParaAllShow>(ParaAllShow.class);
//        return util.exportExcel(list, "ParaAllShow");
////        return null;
//    }
}
