审查视图

src/main/java/com/tianbo/imfClient/controller/FlightController.java 2.9 KB
朱兆平 authored
1 2
package com.tianbo.imfClient.controller;
3
import com.tianbo.imfClient.dao.CUSTOMSMESSAGEMapper;
朱兆平 authored
4
import com.tianbo.imfClient.dao.ORIGINMANIFESTMASTERMapper;
5
import com.tianbo.imfClient.model.CUSTOMSMESSAGE;
朱兆平 authored
6 7 8 9 10 11 12 13
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;
14
import java.util.List;
朱兆平 authored
15
朱兆平 authored
16 17 18
/**
 * 航班信息服务接口
 */
朱兆平 authored
19 20 21 22 23 24 25
@RestController
@RequestMapping("/flight")
public class FlightController {

    @Autowired
    ORIGINMANIFESTMASTERMapper originmanifestmasterMapper;
26 27 28
    @Autowired
    CUSTOMSMESSAGEMapper customsmessageMapper;
朱兆平 authored
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
    /**
     * 修改航班日期
     * @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);
    }
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75


    /**
     * 查询运单的回执状态,目前能查到出港运单的所有回执状态,进港不行
     * @param waybillno
     * @return 返回 业务类型、主单号、分单号、回执内容
     */
    @PostMapping("/customres")
    public ResultJson getCustomResponse(@RequestParam(value = "waybillno",required = true) String waybillno){
        waybillno = waybillno.replace("-","");
        List<CUSTOMSMESSAGE>  customsmessageList = customsmessageMapper.selectCustomResponse(waybillno);
        return new ResultJson(customsmessageList);
    }

    /**
     * 查询运单的回执状态,目前能查到出港运单 发送海关生成报文的messageId
     * @param waybillno
     * @return 返回 messageId,业务类型、主单号、分单号、回执内容
     */
    @PostMapping("/getmessageid")
    public ResultJson getCustomMessageId(@RequestParam(value = "waybillno",required = true) String waybillno){
        List<CUSTOMSMESSAGE>  customsmessageList = customsmessageMapper.selectCustomId(waybillno);
        return new ResultJson(customsmessageList);
    }
朱兆平 authored
76
}