LogicOperation.java 1.6 KB
package com.sy.logic;


import com.sy.model.GatherInfo;
import com.sy.model.LandBusinessTypeList;
import com.sy.service.LandBusListService;
import com.sy.socket.CommandClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.math.BigDecimal;
import java.util.List;

@Component
public class LogicOperation {

    @Autowired
    private LandBusListService listService;

    private static LogicOperation logic;

    @PostConstruct
    public void init(){
        logic = this;
        logic.listService = this.listService;
    }

    public boolean operation(GatherInfo info){
        boolean sign = false;
        BigDecimal grosssWt = info.getGrosswt();
        String ietype = info.getIetype();
        List<LandBusinessTypeList>lists = null;
        if("E".equals(ietype)){
            ietype = "出场站";
            lists = listService.selectByFrameNoAndType(info.getIcvename(),ietype);
            for (LandBusinessTypeList list:lists) {
                //查询是否做了出场申请
                if(list.getContrastflag()==""|list.getContrastflag()==null){
                    //判断车重
                    //判断载货重量是否符合所设定的范围
                    //发送放行指令
                    String flag = "";
                    CommandClient.Client(info,flag);
                    sign = true;
                }
            }
        }else {
            ietype = "进场站";
            lists = listService.selectByFrameNoAndType(info.getIcvename(),ietype);
        }
        return sign;
    }
}