NmmsImportController.java 1.6 KB
package com.tianbo.analysis.controller;

import com.tianbo.analysis.model.ResultJson;
import com.tianbo.analysis.service.NmmsImportService;
import com.tianbo.analysis.service.OriginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author shenhl
 * <p>
 * 2022/2/14/11:22
 */
@RestController
@RequestMapping("/nmms/imp")
public class NmmsImportController {


    @Autowired
    OriginService originService;

    @Autowired
    NmmsImportService nmmsImportService;

    /**
     *  批量删除
     * @param awbhIds
     * @return
     */
    @RequestMapping(value = "/imp_removes")
    @ResponseBody
    public ResultJson antivirus_log_remove(String[] awbhIds){
        int r = 0;
        for (int i=0; i< awbhIds.length; i++){
            r += originService.deleteAwbh(awbhIds[i]);
        }

        return r > 0 ? new ResultJson("200", "批量删除成功")
                : new ResultJson("201", "批量删除失败");
    }

    /**
     *
     * @param awbhIds
     * @param flightNo
     * @param flightDate
     * @return
     */
    @RequestMapping(value = "/mountAwbh")
    @ResponseBody
    public ResultJson antivirus_log_remove(@RequestParam(value ="awbhIds")String[] awbhIds,
                                           @RequestParam(value ="flightNo") String flightNo,
                                           @RequestParam(value ="flightDate") String flightDate){

        return nmmsImportService.mountAwbh(awbhIds,flightNo,flightDate) > 0 ? new ResultJson("200", "分单挂载成功")
                : new ResultJson("201", "分单挂载失败");
    }
}