FlightController.java 1.6 KB
package com.tianbo.imfClient.controller;

import com.tianbo.imfClient.dao.ORIGINMANIFESTMASTERMapper;
import com.tianbo.imfClient.model.ResultJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

@RestController
@RequestMapping("/flight")
public class FlightController {

    @Autowired
    ORIGINMANIFESTMASTERMapper originmanifestmasterMapper;

    /**
     * 修改航班日期
     * @param currDate  修改前日期
     * @param flightNo  航班号
     * @param setDate   修改后日期
     */
    @PostMapping("/changeDate")
    public ResultJson changeFlightDate(@RequestParam(value = "currDate",required = true) String currDate,
                                 @RequestParam(value = "flightNo",required = true) String flightNo,
                                 @RequestParam(value = "setDate", required = true) String setDate
    ){
        HashMap<String ,String> map = new HashMap();
        map.put("currDate",currDate);
        map.put("flightNo",flightNo);
        map.put("setDate",setDate);
        int i = originmanifestmasterMapper.changeFlightDate(map);
        if (i>0)
        {
            return new ResultJson("200","更新成功",i);
//            return "航班日期更新成功"+i;
        }
        return new ResultJson("500","更新失败或航班信息不正确",i);
    }
}