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

import com.tianbo.analysis.dao.ORIGINMANIFESTMASTERMapper;
import com.tianbo.analysis.model.CUSTOMSMESSAGE;
import com.tianbo.analysis.model.ORIGINMANIFESTMASTER;
import com.tianbo.analysis.model.ResultJson;
import com.tianbo.analysis.service.OriginService;
import com.tianbo.util.Date.DateUtil;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

@RestController
@RequestMapping("/nmms/dev")
public class NmmsController {

    @Resource
    ORIGINMANIFESTMASTERMapper originmanifestmasterMapper;

    @Autowired
    OriginService originService;


    @DeleteMapping("/delOriginAWBH")
    public ResultJson getCustomMessageId(@RequestParam(value = "awba",required = true) String awba,
                                         @RequestParam(value = "awbh",required = true) String awbh,
                                         @RequestParam(value = "flightDate",required = true) String flightDate,
                                         @RequestParam(value = "flightNo",required = true) String flightNo
                                         ){
        Date flight_date = DateUtil.parseDate(flightDate,"yyyy-MM-dd");
        ORIGINMANIFESTMASTER originmanifestmaster = new ORIGINMANIFESTMASTER(awba,flight_date,flightNo);
        originmanifestmaster = originmanifestmasterMapper.selectByAHBA(originmanifestmaster);
        return originService.deleteAwbh(originmanifestmaster.getAutoid())>0 ?  new ResultJson("200","删除成功") :  new ResultJson("200","删除失败");

    }
}