package com.steerinfo.meterwork.meterworkdatacount.controller;

import com.steerinfo.baseinfo.combaseinfo.mapper.ComBaseInfoMapper;
import com.steerinfo.framework.controller.BaseRESTfulController;
import com.steerinfo.framework.controller.RESTfulResult;
import com.steerinfo.framework.service.pagehelper.PageList;
import com.steerinfo.meterwork.except.MarkerMetException;
import com.steerinfo.meterwork.meterworkcaractual.mapper.MeterWorkCarActualMapper;
import com.steerinfo.meterwork.meterworkcaractual.model.MeterWorkCarActual;
import com.steerinfo.meterwork.meterworkcaractual.model.MeterWorkCarActualTHJCompare;
import com.steerinfo.meterwork.meterworkdatacount.model.*;
import com.steerinfo.meterwork.meterworkdatacount.service.IMeterWorkDataCountService;
import com.steerinfo.meterwork.meterworkdatacount.service.impl.MeterWorkDataCountServiceImpl;
import com.steerinfo.meterwork.meterworkrailwayactual.mapper.MeterWorkRailwayActualMapper;
import com.steerinfo.meterwork.meterworkrailwayactual.model.MeterWorkRailwayActual;
import com.steerinfo.util.StringUtils;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.ss.usermodel.FillPatternType;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

@RestController
@RequestMapping("/${api.version}/meterworkdatacounts")
public class MeterWorkDataCountController extends BaseRESTfulController {

    @Autowired
    MeterWorkDataCountServiceImpl meterWorkDataCountService;

    @Resource
    MeterWorkCarActualMapper meterWorkCarActualMapper;

    @Resource
    MeterWorkRailwayActualMapper meterWorkRailwayActualMapper;

    @ApiOperation(value="统计汽车衡、静态衡、动态衡、铁水衡、吊钩秤的有效一次、未洁净一次、有效净重、未匹配委托净重数据", notes="返回List<HashMap>对象")
    @PostMapping(value = "/countFirstAndActual")
    public RESTfulResult countFirstAndActual(@RequestBody HashMap params) {
        List<HashMap> models = meterWorkDataCountService.countFirstAndActual(params);
        return success(models);
    }

    @ApiOperation(value="检测检验中心生产运行日报", notes="返回List<HashMap>对象")
    @PostMapping(value = "/productionAndOperationDaily")
    public RESTfulResult productionAndOperationDaily(@RequestBody(required = false) HashMap params) throws ParseException {
        if(params.get("filterdate") == null || params.get("filterdate").toString().equals("")) {
            return failed("日期不能为空！！");
        }
        HashMap models = meterWorkDataCountService.productionAndOperationDaily(params);
        return success(models);
    }

    @ApiOperation(value="汽车衡定期比对记录", notes="返回List<HashMap>对象")
    @PostMapping(value = "/carRegularComparison")
    public RESTfulResult carRegularComparison(@RequestBody(required = false) HashMap params) {
        RESTfulResult rm = meterWorkDataCountService.carRegularComparison(params);
        return rm;
    }

    @ApiOperation(value="汽车衡净重数据导出", notes="返回List<HashMap>对象")
    @RequestMapping("/ExcelCarDownload")
    public void ExcelCarDownload(HttpServletResponse response, @RequestParam HashMap param) throws IOException {
        //表头数据
        String[] header = {"序号","车号","业务类型", "物料名称", "数据状态", "匹配委托", "委托单号", "上传状态","预报组合编号","预报类型",
                "发货单位","收货单位","毛重(t)","皮重(t)","净重(t)","净重时间","净重计量点名称",
                "毛重时间","毛重计量点名称","皮重时间","皮重计量点名称","处理人编号","处理人", "处理时间", "操作日志"};
        //声明一个工作簿
        HSSFWorkbook workbook = new HSSFWorkbook();
        //生成一个表格，设置表格名称为"学生表"
        HSSFSheet sheet = workbook.createSheet("汽车衡净重明细表");
        //设置表格列宽度为10个字节
        sheet.setDefaultColumnWidth(10);
        //创建标题的显示样式
        HSSFCellStyle headerStyle = workbook.createCellStyle();
        headerStyle.setFillForegroundColor(IndexedColors.YELLOW.index);
        headerStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        //创建第一行表头
        HSSFRow headrow = sheet.createRow(0);
        //遍历添加表头(下面模拟遍历学生，也是同样的操作过程)
        for (int i = 0; i < header.length; i++) {
            //创建一个单元格
            HSSFCell cell = headrow.createCell(i);
            //创建一个内容对象
            HSSFRichTextString text = new HSSFRichTextString(header[i]);
            //将内容对象的文字内容写入到单元格中
            cell.setCellValue(text);
            cell.setCellStyle(headerStyle);
        }

        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        //获取所有的employee
//        HashMap<String, Object> map = new HashMap<>();
//        map.put("validFlag", "1");
//        map.put("startTime", "2022-12-05 00:00:00");
//        map.put("endTime", "2022-12-05 23:59:59");

        List<MeterWorkCarActual> emps= meterWorkCarActualMapper.carActualDataDetail(param);
        for(int i=0;i<emps.size();i++){
            //创建一行
            HSSFRow row1 = sheet.createRow(i+1);
            //第一列创建并赋值
            row1.createCell(0).setCellValue(new HSSFRichTextString(String.valueOf(i)));
            //第二列创建并赋值
            row1.createCell(1).setCellValue(new HSSFRichTextString(emps.get(i).getCarNo()));

            //业务类型
            if ("GM2GM".equals(emps.get(i).getMeterTypeName())) {
                row1.createCell(3).setCellValue(new HSSFRichTextString("厂内转储"));
            }//业务类型
            else  if ("PO2GM".equals(emps.get(i).getMeterTypeName())) {
                row1.createCell(3).setCellValue(new HSSFRichTextString("外进"));
            }//业务类型
            else if ("SendToOutTms".equals(emps.get(i).getMeterTypeName())) {
                row1.createCell(3).setCellValue(new HSSFRichTextString("外发"));
            }else {
                row1.createCell(3).setCellValue(emps.get(i).getMeterTypeName());
            }
            //第三列创建并赋值
            row1.createCell(3).setCellValue(new HSSFRichTextString(emps.get(i).getMatterName()));
            //第5列创建并赋值
            row1.createCell(4).setCellValue(new HSSFRichTextString(emps.get(i).getValueFlag().equals("1")?"有效":"作废"));
            //第6列创建并赋值
            row1.createCell(5).setCellValue(new HSSFRichTextString(emps.get(i).getIsPreScale().equals("1")?"已匹配":"未匹配"));
            //第7列创建并赋值
            row1.createCell(6).setCellValue(new HSSFRichTextString(emps.get(i).getPredictionNo()));
            //籍贯
            row1.createCell(7).setCellValue(new HSSFRichTextString(emps.get(i).getUploadFlag().equals("1")?"待上传":"已上传"));
            //第8列创建并赋值
            row1.createCell(8).setCellValue(new HSSFRichTextString(emps.get(i).getPredictionCombination()));
            //第9列创建并赋值
            String predictionType = "";
            if(StringUtils.isEmpty(emps.get(i).getPredictionType())) {
                predictionType = "";
            }else if(emps.get(i).getPredictionType().equals("1")) {
                predictionType = "单委托";
            }else if(emps.get(i).getPredictionType().equals("5")) {
                predictionType = "双委托i";
            }else if(emps.get(i).getPredictionType().equals("6")) {
                predictionType = "混卸";
            }else if(emps.get(i).getPredictionType().equals("7")) {
                predictionType = "混装";
            }
            row1.createCell(9).setCellValue(new HSSFRichTextString(predictionType));
            //第10列创建并赋值
            row1.createCell(10).setCellValue(new HSSFRichTextString(emps.get(i).getForwardingUnitName()));
            //第11列创建并赋值
            row1.createCell(11).setCellValue(new HSSFRichTextString(emps.get(i).getReceivingUintName()));
            //第12列创建并赋值
            row1.createCell(12).setCellValue(new HSSFRichTextString((emps.get(i).getGrossWeight().divide(new BigDecimal(1000))).toString()));
            //第13列创建并赋值
            row1.createCell(13).setCellValue(new HSSFRichTextString((emps.get(i).getTareWeight().divide(new BigDecimal(1000))).toString()));
            //第14列创建并赋值
            row1.createCell(14).setCellValue(new HSSFRichTextString((emps.get(i).getNetWeight().divide(new BigDecimal(1000))).toString()));
            //第15列创建并赋值
            if(emps.get(i).getNetTime() != null){
                row1.createCell(15).setCellValue(new HSSFRichTextString(dateFormat.format(emps.get(i).getNetTime())));
            }
            //第16列创建并赋值-入职日期
            row1.createCell(16).setCellValue(new HSSFRichTextString(emps.get(i).getNetSpot3Name()));
            if(emps.get(i).getGrossTime() != null){
                row1.createCell(17).setCellValue(new HSSFRichTextString(dateFormat.format(emps.get(i).getGrossTime())));
            }
            //第16列创建并赋值-入职日期
            row1.createCell(18).setCellValue(new HSSFRichTextString(emps.get(i).getBaseSpot1Name()));
            if(emps.get(i).getTareTime() != null){
                row1.createCell(19).setCellValue(new HSSFRichTextString(dateFormat.format(emps.get(i).getTareTime())));
            }
            //第16列创建并赋值-入职日期
            row1.createCell(20).setCellValue(new HSSFRichTextString(emps.get(i).getBaseSpot2Name()));
            //转正日期
            row1.createCell(21).setCellValue(new HSSFRichTextString(emps.get(i).getUpdateManNo()));
            row1.createCell(22).setCellValue(new HSSFRichTextString(emps.get(i).getUpdateManName()));
            if(emps.get(i).getUpdateTime() != null) {
                row1.createCell(23).setCellValue(new HSSFRichTextString(dateFormat.format(emps.get(i).getUpdateTime())));
            }
            row1.createCell(24).setCellValue(new HSSFRichTextString(emps.get(i).getNote()));
        }
        //准备将Excel的输出流通过response输出到页面下载
        //八进制输出流
        response.setContentType("application/octet-stream");
        //这后面可以设置导出Excel的名称，此例中名为student.xls
        response.setHeader("Content-disposition", "attachment;filename=carActualDetail.xls");
        //刷新缓冲
        response.flushBuffer();
        //workbook将Excel写入到response的输出流中，供页面下载
        workbook.write(response.getOutputStream());
    }

    @ApiOperation(value="轨道衡净重数据导出", notes="返回List<HashMap>对象")
    @RequestMapping("/ExcelRailwayDownload")
    public void ExcelStaticDownload(HttpServletResponse response, @RequestParam HashMap param) throws IOException {
        //表头数据
        String[] header = {"序号","车号","车型","业务类型" , "物料名称", "数据状态", "匹配委托", "委托单号", "上传状态","预报组合编号","预报类型",
                "发货单位","收货单位","毛重(t)","皮重(t)","净重(t)","净重时间","净重计量点名称",
                "毛重时间","毛重计量点名称","皮重时间","皮重计量点名称","处理人编号","处理人", "处理时间", "操作日志"};
        //声明一个工作簿
        HSSFWorkbook workbook = new HSSFWorkbook();
        //生成一个表格，设置表格名称为"学生表"
        HSSFSheet sheet;
        if(param.get("railwayTypeNoStr") == null || StringUtils.isEmpty(param.get("railwayTypeNoStr").toString())) {
            if(param.get("railwayTypeNo").equals("001019001")){
                sheet = workbook.createSheet("静轨净重明细表");
            }else if(param.get("railwayTypeNo").equals("001019002")){
                sheet = workbook.createSheet("动轨衡净重明细表");
            }else{
                //param.get("railwayTypeNo").equals("001019005")
                sheet = workbook.createSheet("吊钩秤净重明细表");
            }
        }else {
            if(param.get("railwayTypeNoStr") != null) {
                String[] typeNoStr = param.get("railwayTypeNoStr").toString().split(",");
                param.put("typeNoStr", typeNoStr);
            }
            //param.get("railwayTypeNoStr").equals("001019003,001019004")
            sheet = workbook.createSheet("铁水衡净重明细表");
        }

        //设置表格列宽度为10个字节
        sheet.setDefaultColumnWidth(10);
        //创建标题的显示样式
        HSSFCellStyle headerStyle = workbook.createCellStyle();
        headerStyle.setFillForegroundColor(IndexedColors.YELLOW.index);
        headerStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        //创建第一行表头
        HSSFRow headrow = sheet.createRow(0);
        //遍历添加表头(下面模拟遍历学生，也是同样的操作过程)
        for (int i = 0; i < header.length; i++) {
            //创建一个单元格
            HSSFCell cell = headrow.createCell(i);
            //创建一个内容对象
            HSSFRichTextString text = new HSSFRichTextString(header[i]);
            //将内容对象的文字内容写入到单元格中
            cell.setCellValue(text);
            cell.setCellStyle(headerStyle);
        }

        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        //获取所有的employee
//        HashMap<String, Object> map = new HashMap<>();
//        map.put("validFlag", "1");
//        map.put("startTime", "2022-12-05 00:00:00");
//        map.put("endTime", "2022-12-05 23:59:59");

        List<MeterWorkRailwayActual> emps= meterWorkRailwayActualMapper.carActualDataDetail(param);
        for(int i=0;i<emps.size();i++){
            //创建一行
            HSSFRow row1 = sheet.createRow(i+1);
            //第一列创建并赋值
            row1.createCell(0).setCellValue(new HSSFRichTextString(String.valueOf(i)));
            //第二列创建并赋值
            row1.createCell(1).setCellValue(new HSSFRichTextString(emps.get(i).getRailwayNo()));

            //车型
            row1.createCell(2).setCellValue(new HSSFRichTextString(emps.get(i).getConveyanceType()));
            //业务类型
            if ("GM2GM".equals(emps.get(i).getMeterTypeName())) {
                row1.createCell(3).setCellValue(new HSSFRichTextString("厂内转储"));
            }//业务类型
            else  if ("PO2GM".equals(emps.get(i).getMeterTypeName())) {
                row1.createCell(3).setCellValue(new HSSFRichTextString("外进"));
            }//业务类型
            else if ("SendToOutTms".equals(emps.get(i).getMeterTypeName())) {
                row1.createCell(3).setCellValue(new HSSFRichTextString("外发"));
            }else {
                row1.createCell(3).setCellValue(emps.get(i).getMeterTypeName());
            }

            //第三列创建并赋值
            row1.createCell(4).setCellValue(new HSSFRichTextString(emps.get(i).getMatterName()));
            //第5列创建并赋值
            row1.createCell(5).setCellValue(new HSSFRichTextString((emps.get(i).getValueFlag().equals("1") || emps.get(i).getValueFlag().equals("2"))?"有效":"作废"));
            //第6列创建并赋值
            row1.createCell(6).setCellValue(new HSSFRichTextString(emps.get(i).getIsPreSacale().equals("1")?"已匹配":"未匹配"));
            //第7列创建并赋值
            row1.createCell(7).setCellValue(new HSSFRichTextString(emps.get(i).getPredictionNo()));
            //籍贯
            row1.createCell(8).setCellValue(new HSSFRichTextString(emps.get(i).getUploadFlag().equals("1")?"待上传":"已上传"));
            //第8列创建并赋值
            row1.createCell(9).setCellValue(new HSSFRichTextString(emps.get(i).getPredictionCombination()));
            //第9列创建并赋值
            String predictionType = "";
            if(StringUtils.isEmpty(emps.get(i).getPredictionType())) {
                predictionType = "";
            }else if(emps.get(i).getPredictionType().equals("1")) {
                predictionType = "单委托";
            }else if(emps.get(i).getPredictionType().equals("5")) {
                predictionType = "双委托i";
            }else if(emps.get(i).getPredictionType().equals("6")) {
                predictionType = "混卸";
            }else if(emps.get(i).getPredictionType().equals("7")) {
                predictionType = "混装";
            }
            row1.createCell(10).setCellValue(new HSSFRichTextString(predictionType));
            //第10列创建并赋值
            row1.createCell(11).setCellValue(new HSSFRichTextString(emps.get(i).getForwardingUnitName()));
            //第11列创建并赋值
            row1.createCell(12).setCellValue(new HSSFRichTextString(emps.get(i).getReceivingUintName()));
            //第12列创建并赋值
            row1.createCell(13).setCellValue(new HSSFRichTextString((emps.get(i).getGrossWeight().divide(new BigDecimal(1000))).toString()));
            //第13列创建并赋值
            row1.createCell(14).setCellValue(new HSSFRichTextString((emps.get(i).getTareWeight().divide(new BigDecimal(1000))).toString()));
            //第14列创建并赋值
            row1.createCell(15).setCellValue(new HSSFRichTextString((emps.get(i).getNetWeight().divide(new BigDecimal(1000))).toString()));
            //第15列创建并赋值
            if(emps.get(i).getNetTime() != null){
                row1.createCell(16).setCellValue(new HSSFRichTextString(dateFormat.format(emps.get(i).getNetTime())));
            }
            //第16列创建并赋值-入职日期
            row1.createCell(17).setCellValue(new HSSFRichTextString(emps.get(i).getNetSpot3Name()));
            if(emps.get(i).getGrossTime() != null){
                row1.createCell(18).setCellValue(new HSSFRichTextString(dateFormat.format(emps.get(i).getGrossTime())));
            }
            //第16列创建并赋值-入职日期
            row1.createCell(19).setCellValue(new HSSFRichTextString(emps.get(i).getBaseSpot1Name()));
            if(emps.get(i).getTareTime() != null){
                row1.createCell(20).setCellValue(new HSSFRichTextString(dateFormat.format(emps.get(i).getTareTime())));
            }
            //第16列创建并赋值-入职日期
            row1.createCell(21).setCellValue(new HSSFRichTextString(emps.get(i).getBaseSpot2Name()));
            //转正日期
            row1.createCell(22).setCellValue(new HSSFRichTextString(emps.get(i).getUpdateManNo()));
            row1.createCell(23).setCellValue(new HSSFRichTextString(emps.get(i).getUpdateManName()));
            if(emps.get(i).getUpdateTime() != null) {
                row1.createCell(24).setCellValue(new HSSFRichTextString(dateFormat.format(emps.get(i).getUpdateTime())));
            }
            row1.createCell(25).setCellValue(new HSSFRichTextString(emps.get(i).getNote()));
        }
        //准备将Excel的输出流通过response输出到页面下载
        //八进制输出流
        response.setContentType("application/octet-stream");
        //这后面可以设置导出Excel的名称，此例中名为student.xls
        response.setHeader("Content-disposition", "attachment;filename=railwayActualDetail.xls");
        //刷新缓冲
        response.flushBuffer();
        //workbook将Excel写入到response的输出流中，供页面下载
        workbook.write(response.getOutputStream());
    }

    @ApiOperation(value = "日工作量分类统计", notes = "根据计量时间、计量点查询")
    @PostMapping(value = "/countDayAllSpot")
    public List<HashMap> countDayAllSpot(@RequestBody(required = false) HashMap params) {
        try {
            List<HashMap> list = meterWorkDataCountService.countDayAllSpot(params);
            return list;
        } catch (Exception ex) {
            ex.printStackTrace();
            throw new MarkerMetException(500, "操作异常！！");
        }
    }

    @ApiOperation(value = "汽车衡同车号历史皮重比对核查", notes = "根据计量时间、车号查询")
    @PostMapping(value = "/truckHisTareComparison")
    public RESTfulResult truckHisTareComparison(@RequestBody(required = false) HashMap params) {
        try {
            PageList<TruckHisTareComparison> list = meterWorkDataCountService.truckHisTareComparison(params);
            return success(list);
        } catch (Exception ex) {
            ex.printStackTrace();
            throw new MarkerMetException(500, "操作异常！！");
        }
    }

    @ApiOperation(value = "计量准确性分析", notes = "根据计量时间、车号查询")
    @PostMapping(value = "/measurementAccuracyAnalysisFunction")
    public RESTfulResult measurementAccuracyAnalysisFunction(@RequestBody(required = false) HashMap params) {
        try {
            List<String> list = meterWorkDataCountService.measurementAccuracyAnalysisFunction(params);
            return success(list);
        } catch (Exception ex) {
            ex.printStackTrace();
            throw new MarkerMetException(500, "操作异常！！");
        }
    }

    @ApiOperation(value = "获取操作页面", notes = "根据计量时间、车号查询")
    @PostMapping(value = "/measurementAccuracyOperationPage")
    public RESTfulResult measurementAccuracyOperationPage(@RequestBody(required = false) HashMap params) {
        try {
            List<String> list1 = meterWorkDataCountService.measurementAccuracyOperationPage(params);
            List<String> list2 = meterWorkDataCountService.measurementAccuracyCreateManName(params);
            List<List<String>> list =new ArrayList<>();
            list.add(list1);
            list.add(list2);
            return success(list);
        } catch (Exception ex) {
            ex.printStackTrace();
            throw new MarkerMetException(500, "操作异常！！");
        }
    }
    @ApiOperation(value = "计量准确性分析", notes = "根据计量时间、车号查询")
    @PostMapping(value = "/measurementAccuracyAnalysis")
    public RESTfulResult measurementAccuracyAnalysis(@RequestBody(required = false) HashMap params) {
        try {
            PageList<MeasurementAccuracyAnalysis> list = meterWorkDataCountService.measurementAccuracyAnalysis(params);
            return success(list);
        } catch (Exception ex) {
            ex.printStackTrace();
            throw new MarkerMetException(500, "操作异常！！");
        }
    }

    @ApiOperation(value = "吊钩秤铁水衡皮重比对核查报表-获取列表", notes = "分页模糊查询")
    @PostMapping(value = "/hookTareWeightAndTheoryAmount")
    public RESTfulResult netWeightAndTheoryAmount(@RequestBody HashMap parmas) {
        try {
            PageList<HookTareWeightAndTheoryAmount> list = meterWorkDataCountService.hookTareWeightAndTheoryAmount(parmas);
            return success(list);
        } catch (Exception ex) {
            ex.printStackTrace();
            throw new MarkerMetException(500, "操作异常！！");
        }
    }

    @ApiOperation(value = "200万铁水衡铁水罐皮重比对核查报表-获取列表", notes = "分页模糊查询")
    @PostMapping(value = "/twoMillionTareWeightComparison")
    public RESTfulResult twoMillionTareWeightComparison(@RequestBody HashMap parmas) {
        try {
            PageList<TwoMillionTareWeightComparison> list = meterWorkDataCountService.twoMillionTareWeightComparison(parmas);
            return success(list);
        } catch (Exception ex) {
            ex.printStackTrace();
            throw new MarkerMetException(500, "操作异常！！");
        }
    }

    @ApiOperation(value = "静态轨道衡同车号当日异地计量结净净重核查报表-获取列表", notes = "分页模糊查询")
    @PostMapping(value = "/staticRailwayRemoteComparison")
    public RESTfulResult staticRailwayRemoteComparison(@RequestBody HashMap parmas) {
        try {
            PageList<StaticRailwayRemoteComparison> list = meterWorkDataCountService.staticRailwayRemoteComparison(parmas);
            return success(list);
        } catch (Exception ex) {
            ex.printStackTrace();
            throw new MarkerMetException(500, "操作异常！！");
        }
    }

    @ApiOperation(value = "静态轨道衡同车号当日异地计量结净净重核查报表-获取列表", notes = "分页模糊查询")
    @PostMapping(value = "/dynamicRailwayRemoteComparison")
    public RESTfulResult dynamicRailwayRemoteComparison(@RequestBody HashMap parmas) {
        try {
            PageList<StaticRailwayRemoteComparison> list = meterWorkDataCountService.dynamicRailwayRemoteComparison(parmas);
            return success(list);
        } catch (Exception ex) {
            ex.printStackTrace();
            throw new MarkerMetException(500, "操作异常！！");
        }
    }

    @ApiOperation(value = "Rfid识别率分析汇总统计-获取列表", notes = "不分页模糊查询")
    @PostMapping(value = "/rfidIdentifyAnalysisSummary")
    public RESTfulResult rfidIdentifyAnalysisSummary(@RequestBody HashMap parmas) {
        try {
            List<HashMap> list = meterWorkDataCountService.rfidIdentifyAnalysisSummary(parmas);
            return success(list);
        } catch (Exception ex) {
            ex.printStackTrace();
            throw new MarkerMetException(500, "操作异常！！");
        }
    }

    @ApiOperation(value = "Rfid识别率分析明细-获取列表", notes = "分页模糊查询")
    @PostMapping(value = "/rfidIdentifyAnalysisDetail")
    public RESTfulResult rfidIdentifyAnalysisDetail(@RequestBody HashMap parmas) {
        try {
            PageList<RfidIdentifyAnalysis> list = meterWorkDataCountService.rfidIdentifyAnalysisDetail(parmas);
            return success(list);
        } catch (Exception ex) {
            ex.printStackTrace();
            throw new MarkerMetException(500, "操作异常！！");
        }
    }

    @ApiOperation(value = "pika车号数核查-获取列表", notes = "不分页模糊查询")
    @PostMapping(value = "/pikaCarNumAnalysisSummary")
    public RESTfulResult pikaCarNumAnalysisSummary(@RequestBody HashMap parmas) {
        try {
            List<HashMap> list = meterWorkDataCountService.pikaCarNumAnalysisSummary(parmas);
            return success(list);
        } catch (Exception ex) {
            ex.printStackTrace();
            throw new MarkerMetException(500, "操作异常！！");
        }
    }

    @ApiOperation(value = "汽车衡结净数据皮重核查-获取列表", notes = "分页模糊查询")
    //@RequiresPermissions("meterworkcaractualfirst:view")
    @PostMapping(value = "/carActualTareWeightComparison")
    public RESTfulResult carActualTareWeightComparison(@RequestBody(required = false) HashMap parmas) {
        try {
            PageList<CarActualTareWeightComparison> list = meterWorkDataCountService.carActualTareWeightComparison(parmas);
            return success(list);
        } catch (Exception ex) {
            ex.printStackTrace();
            throw new MarkerMetException(500, "操作异常！！");
        }
    }

    @ApiOperation(value = "汽车衡结净数据皮重核查明细-获取列表", notes = "分页模糊查询")
    //@RequiresPermissions("meterworkcaractualfirst:view")
    @PostMapping(value = "/carActualTareWeightComparisonDetail")
    public RESTfulResult carActualTareWeightComparisonDetail(@RequestBody(required = false) HashMap parmas) {
        try {
            PageList<CarActualTareWeightComparison> list = meterWorkDataCountService.carActualTareWeightComparisonDetail(parmas);
            return success(list);
        } catch (Exception ex) {
            ex.printStackTrace();
            throw new MarkerMetException(500, "操作异常！！");
        }
    }

    @ApiOperation(value = "汽车衡结净数据净重核查明细-获取列表", notes = "分页模糊查询")
    //@RequiresPermissions("meterworkcaractualfirst:view")
    @PostMapping(value = "/carActualNetWeightComparisonDetail")
    public RESTfulResult carActualNetWeightComparisonDetail(@RequestBody(required = false) HashMap parmas) {
        try {
            PageList<CarActualTareWeightComparison> list = meterWorkDataCountService.carActualNetWeightComparisonDetail(parmas);
            return success(list);
        } catch (Exception ex) {
            ex.printStackTrace();
            throw new MarkerMetException(500, "操作异常！！");
        }
    }

    @ApiOperation(value = "轨道衡结净数据同车型、同物料毛重核查-获取列表", notes = "分页模糊查询")
    //@RequiresPermissions("meterworkcaractualfirst:view")
    @PostMapping(value = "/railwayActualGrossWeightComparison")
    public RESTfulResult railwayActualGrossWeightComparison(@RequestBody(required = false) HashMap parmas) {
        try {
            PageList<RailwayActualGrossWeightComparison> list = meterWorkDataCountService.railwayActualGrossWeightComparison(parmas);
            return success(list);
        } catch (Exception ex) {
            ex.printStackTrace();
            throw new MarkerMetException(500, "操作异常！！");
        }
    }

    @ApiOperation(value = "轨道衡结净数据同车型、同物料毛重核查比对明细-获取列表", notes = "分页模糊查询")
    //@RequiresPermissions("meterworkcaractualfirst:view")
    @PostMapping(value = "/railwayActualGrossWeightComparisonDetail")
    public RESTfulResult railwayActualGrossWeightComparisonDetail(@RequestBody(required = false) HashMap parmas) {
        try {
            PageList<RailwayActualGrossWeightComparison> list = meterWorkDataCountService.railwayActualGrossWeightComparisonDetail(parmas);
            return success(list);
        } catch (Exception ex) {
            ex.printStackTrace();
            throw new MarkerMetException(500, "操作异常！！");
        }
    }

    @ApiOperation(value = "轨道衡结净数据同车型、同物料毛重核查比对明细-获取列表", notes = "分页模糊查询")
    //@RequiresPermissions("meterworkcaractualfirst:view")
    @PostMapping(value = "/railwayActualNetWeightComparisonDetail")
    public RESTfulResult railwayActualNetWeightComparisonDetail(@RequestBody(required = false) HashMap parmas) {
        try {
            PageList<RailwayActualGrossWeightComparison> list = meterWorkDataCountService.railwayActualNetWeightComparisonDetail(parmas);
            return success(list);
        } catch (Exception ex) {
            ex.printStackTrace();
            throw new MarkerMetException(500, "操作异常！！");
        }
    }

    @ApiOperation(value = "轨道衡理论量与计量净重数据对比-获取列表", notes = "分页模糊查询")
    @PostMapping(value = "/railwayNetWeightAndTheoryAmount")
    public RESTfulResult railwayNetWeightAndTheoryAmount(@RequestBody HashMap parmas) {
        try {
            PageList<NetWeightAndTheoryAmount> list = meterWorkDataCountService.railwayNetWeightAndTheoryAmount(parmas);
            return success(list);
        } catch (Exception ex) {
            ex.printStackTrace();
            throw new MarkerMetException(500, "操作异常！！");
        }
    }

    @ApiOperation(value = "轨道衡超长车与一次计量数据重量对比-获取列表", notes = "分页模糊查询")
    @PostMapping(value = "/longCarMeterWeightComparison")
    public RESTfulResult longCarMeterWeightComparison(@RequestBody HashMap parmas) {
        try {
            PageList<LongCarMeterWeightComparison> list = meterWorkDataCountService.longCarMeterWeightComparison(parmas);
            return success(list);
        } catch (Exception ex) {
            ex.printStackTrace();
            throw new MarkerMetException(500, "操作异常！！");
        }
    }

    @ApiOperation(value = "同一委托同一车号匹配多条计量数据核查报表-获取列表", notes = "分页模糊查询")
    @PostMapping(value = "/scaleOrCarComparison")
    public RESTfulResult scaleOrCarComparison(@RequestBody HashMap parmas) {
        try {
            PageList<ScaleOrCarComparison> list = meterWorkDataCountService.scaleOrCarComparison(parmas);
            return success(list);
        } catch (Exception ex) {
            ex.printStackTrace();
            throw new MarkerMetException(500, "操作异常！！");
        }
    }
}
