package com.aucma.api.controller;


import com.aucma.report.service.IRecordElectricalInspectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

import java.util.Map;

/**
 * @Author YinQ
 * @create 2023-09-26 14:29
 */
@RestController
@RequestMapping("/webApi")
public class ElectricalInspectionController {


    @Autowired
    private IRecordElectricalInspectionService electricalInspectionService;


    /**
     * 二线电检
     * http://10.100.72.10:8010/Electricalinspection
     * 解析电检数据接口
     * @param paramMap
     * @return
     */
    @PostMapping("/electricalInspectionElectricalinspection")
    public HashMap<String, String> getSAPMaterialData(@RequestBody Map paramMap) {
        String productLineCode = "CX_02";
        System.out.println("++++++++解析电检数据接口++++++++");
        return electricalInspectionService.analysisElectricalInspectionData(paramMap, productLineCode);
    }

    /**

     * 解析电检数据接口NEW
     * @param paramMap
     * @return
     */
    @PostMapping("/Electricalinspection")
    public HashMap<String, String> electricalInspection(@RequestBody Map paramMap) {
        String productLineCode = "CX_02";
        System.out.println("++++++++解析电检数据接口NEW++++++++");
        return electricalInspectionService.analysisElectricalInspectionData(paramMap, productLineCode);
    }

    /**
     * 一线电检
     * http://10.100.72.10:8020/Electricalinspection
     * 解析电检数据接口NEW
     * @param paramMap
     * @return
     */
    @PostMapping("/oneElectricalInspection")
    public HashMap<String, String> oneElectricalInspection(@RequestBody Map paramMap) {
        String productLineCode = "CX_01";
        System.out.println("++++++++一线解析电检数据接口NEW++++++++");
        return electricalInspectionService.analysisElectricalInspectionData(paramMap, productLineCode);
    }


}
