CustomMessageServiceImp.java 1.3 KB
package com.tianbo.analysis.service.imp;

import com.tianbo.analysis.dao.CUSTOMSMESSAGEMapper;
import com.tianbo.analysis.model.CUSTOMSMESSAGE;
import com.tianbo.analysis.model.CUSTOMSMESSAGEWithBLOBs;
import com.tianbo.analysis.model.CustomReception;
import com.tianbo.analysis.service.CustomMessageService;
import com.tianbo.util.Date.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CustomMessageServiceImp implements CustomMessageService{

    @Autowired
    public CUSTOMSMESSAGEMapper customsmessageMapper;

    @Override
    public CustomReception getWaybillInfoByCutomResponse(CustomReception customReception){
        List<CUSTOMSMESSAGEWithBLOBs> customsmessages  =  customsmessageMapper.selectMessage(customReception.getMessageID());
        if(!customsmessages.isEmpty()){
            CUSTOMSMESSAGE customsmessage = customsmessages.get(0);
            customReception.setFlightDate(DateUtil.dateToString(customsmessage.getFlightdate(),"yyyyMMdd"));
            customReception.setFlightNo(customsmessage.getFlightno());
            customReception.setWayBillMaster(customsmessage.getWaybillnomaster());
            customReception.setWayBillSecond(customsmessage.getWaybillnosecondary());
        }


        return customReception;
    }
}