Custom_Response_Service.java 1.5 KB
package com.tianbo.messagebus.service;

import com.tianbo.messagebus.dao.CUSTOM_RESPONSEMapper;
import com.tianbo.messagebus.model.CUSTOM_RESPONSE;
import org.springframework.stereotype.Service;

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

@Service
public class Custom_Response_Service {

    @Resource
    public CUSTOM_RESPONSEMapper custom_responseMapper_nmms20;

    /**
     * 回执入库
     * @return
     */
    public int secondAnalysisReception(CUSTOM_RESPONSE custom_response) {
        //更新分单回执
        int i = custom_responseMapper_nmms20.insertSelective(custom_response);
        return i;

    }

    /**
     * 出错报文的适配问题,
     * @return
     */
    public CUSTOM_RESPONSE getWaybillInfoByCutomResponse(CUSTOM_RESPONSE custom_response){
        List<CUSTOM_RESPONSE> res_list = custom_responseMapper_nmms20.selectByCustomMsgId(custom_response.getCusmsgid());
        if (res_list.size()>0){
            CUSTOM_RESPONSE result = res_list.get(0);
            custom_response.setAwbano(result.getAwbano());

            custom_response.setAwbhno(result.getAwbhno());
            custom_response.setFlightdate(result.getFlightdate());
            custom_response.setCarrier(result.getCarrier());
            custom_response.setFlightno( result.getFlightno());
        }
        return custom_response;

    }

    public CUSTOM_RESPONSE selectByPrimaryKey(String id){
        return custom_responseMapper_nmms20.selectByPrimaryKey(id);
    }
}