| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.mapper.WrkMastMapper; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 立体仓库WCS系统主流程业务 |
| | |
| | | LocMast locMast = locMastService.selectById(wrkMast.getSourceLocNo()); |
| | | locMast.setLocSts("S"); |
| | | locMast.setModiTime(new Date()); |
| | | locMastService.selectById(locMast); |
| | | locMastService.updateById(locMast); |
| | | } |
| | | } |
| | | } |
| | |
| | | News.warnNoLog("" + mark + " - 0" + " - 开始执行"); |
| | | // 判断重复工作档 |
| | | // 106也算上,以后106-》107用于更新库存 |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("loc_no", "1001").in("wrk_sts", 106,107)); |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("loc_no", "1001").in("wrk_sts", 106, 107)); |
| | | if (wrkMast == null) { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | public static final ArrayList<Integer> staNos2 = new ArrayList<Integer>() {{ |
| | | |
| | | add(101); |
| | | add(102); |
| | | add(103); |
| | | add(104); |
| | | add(105); |
| | | add(106); |
| | | add(107); |
| | | add(108); |
| | | }}; |
| | | |
| | | public synchronized void in(Integer mark) { |
| | | // 遍历入库口 |
| | | for (Integer inSta : staNos2) { |
| | | // 获取入库站信息 |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | StaProtocol staProtocol = devpThread.getStation().get(inSta); |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | // 判断是否满足条件 |
| | | if (!staProtocol.isAutoing() && !staProtocol.isLoading()) { |
| | | continue; |
| | | } |
| | | // && staProtocol.isInEnable() |
| | | if (staProtocol.isInEnable()) { |
| | | getWrk(staProtocol, "-2"); |
| | | } |
| | | if (staProtocol.isOutEnable()) { |
| | | getWrk(staProtocol, "-3"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void getWrk(StaProtocol staProtocol, String lev) { |
| | | List<WrkMast> sourceLocNo = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("source_loc_no", staProtocol.getSiteId() + lev)); |
| | | if (!Cools.isEmpty(sourceLocNo) && !sourceLocNo.isEmpty()) { |
| | | return; |
| | | } |
| | | WrkMast in = new WrkMast(); |
| | | in.setSourceLocNo(staProtocol.getSiteId() + lev); |
| | | in.setLocNo(""); |
| | | in.setIoType(10); |
| | | in.setIoTime(new Date()); |
| | | in.setWrkSts(1L); // 工作状态:11.生成出库ID |
| | | in.setIoPri(13D); // 优先级:13 |
| | | in.setFullPlt("Y"); // 满板:Y |
| | | in.setPicking("N"); // 拣料 |
| | | in.setExitMk("N"); // 退出 |
| | | in.setEmptyMk("Y"); // 空板 |
| | | in.setLinkMis("N"); |
| | | in.setAppeTime(new Date()); |
| | | in.setModiTime(new Date()); |
| | | wrkMastService.insert(in); |
| | | } |
| | | |
| | | } |