自动化立体仓库 - WMS系统
lty
4 天以前 f08dd93e49e8461f362c8f45f17fe10e0fbdebec
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -29,6 +29,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import javax.annotation.Resource;
import java.util.*;
@@ -936,7 +937,7 @@
            List<OrderDetlPakin> orderDetlPakins = orderDetlPakinService.selectList(new EntityWrapper<OrderDetlPakin>()
                    .eq("matnr", combMat.getMatnr()).eq("box_type3", combMat.getOrderNo())
                    .eq("standby1", combMat.getStandby1()).eq("standby2", combMat.getStandby2())
                    .eq("standby3", combMat.getStandby3()).eq("box_type2","shyucheng.test"));
                    .eq("standby3", combMat.getStandby3()));
            if (orderDetlPakins.size() > 0) {
                orderNo = orderDetlPakins.get(0).getOrderNo();
                combMat.setBoxType1(orderDetlPakins.get(0).getBoxType1());
@@ -1680,4 +1681,41 @@
            throw new CoolException(locDetl.getLocNo() + "库位不是在库状态");
        }
    }
    @Override
    public void agvUnlockLoc(AgvUnlockLoc agvUnlockLoc){
        Date now = new Date();
        if(agvUnlockLoc.getFloorNo().equals(1)){
            LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no",agvUnlockLoc.getPositionCode()));
            if(locMast != null){
                locMast.setLocSts("O");
                locMast.setBarcode("");
                locMast.setIoTime(now);
                locMast.setModiTime(now);
                if (!locMastService.updateById(locMast)) {
                    throw new CoolException(agvUnlockLoc.getPositionCode() + "库位不是在库状态");
                }
            }
        }else{
            LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no",agvUnlockLoc.getPositionCode()));
            AgvBindCtnrAndBinTwoParam agvBindCtnrAndBinTwoParam = new AgvBindCtnrAndBinTwoParam();
            agvBindCtnrAndBinTwoParam.setReqCode(String.valueOf(snowflakeIdWorker.nextId()));
            agvBindCtnrAndBinTwoParam.setPodcode(agvUnlockLoc.getPodcode());
            agvBindCtnrAndBinTwoParam.setPositionCode(agvUnlockLoc.getPositionCode());
            agvBindCtnrAndBinTwoParam.setIndBind("0");;
            ReturnT<String> resultBind = new PostMesDataUtils().postMesDataArmGrating("AGV库位解绑",
                    AgvConstant.AGV_URL+"/"+AgvConstant.AGV_hikRpcService,AgvConstant.getAGVADAPTOR(2), agvBindCtnrAndBinTwoParam);
            if (resultBind.getCode()!=1){
                if(locMast != null){
                    locMast.setLocSts("O");
                    locMast.setBarcode("");
                    locMast.setIoTime(now);
                    locMast.setModiTime(now);
                    if (!locMastService.updateById(locMast)) {
                        throw new CoolException(agvUnlockLoc.getPositionCode() + "库位不是在库状态");
                    }
                }
            }
        }
    }
}