| src/main/java/com/zy/asrs/service/impl/CtuMainServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/java/com/zy/core/CtuMainProcess.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/java/com/zy/core/thread/SiemensDevpThread.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/resources/application.yml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/zy/asrs/service/impl/CtuMainServiceImpl.java
@@ -1,6 +1,7 @@ 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; @@ -20,7 +21,9 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.Date; import java.util.List; /** * 立体仓库WCS系统主流程业务 @@ -97,7 +100,7 @@ LocMast locMast = locMastService.selectById(wrkMast.getSourceLocNo()); locMast.setLocSts("S"); locMast.setModiTime(new Date()); locMastService.selectById(locMast); locMastService.updateById(locMast); } } } @@ -161,4 +164,63 @@ } } 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); } } src/main/java/com/zy/core/CtuMainProcess.java
@@ -47,7 +47,11 @@ ctuMainService.generateStoreWrkFile(1); // 出库 ctuMainService.out(1); ctuMainService.out(2); // 101-108按钮入库 ctuMainService.in(3); } catch (Exception e) { e.printStackTrace(); src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -52,6 +52,10 @@ add(1006); add(1007); }}; public static final ArrayList<Integer> staNos2 = new ArrayList<Integer>() {{ add(101); add(102); add(103); @@ -218,6 +222,34 @@ } } } ArrayList<Integer> staNosxx = staNos2; int size = staNosxx.size(); OperateResultExOne<byte[]> result3 = siemensS7Net.Read("DB101.14", (short) (size * 2)); if (result3.IsSuccess) { for (int i = 0; i < size; i++) { Integer siteId = staNosxx.get(i); // 站点编号 StaProtocol staProtocol = station.get(siteId); if (null == staProtocol) { staProtocol = new StaProtocol(); staProtocol.setSiteId(siteId); station.put(siteId, staProtocol); } boolean[] status = null; status = siemensS7Net.getByteTransform().TransBool(result3.Content, i * 2, 2); staProtocol.setAutoing(status[0]); // 自动 staProtocol.setLoading(status[1]); // 有物 staProtocol.setInEnable(status[2]); // 可入,二层 staProtocol.setOutEnable(status[3]);// 可出,三层 staProtocol.setEmptyMk(status[4]); // 空板信号 staProtocol.setFullPlt(status[5]); // 满托盘 staProtocol.setHigh(status[6]); // 高库位 staProtocol.setLow(status[7]); // 低库位 if (!staProtocol.isPakMk() && !staProtocol.isLoading()) { staProtocol.setPakMk(true); } } } //条码扫描器 // ArrayList<Integer> barcodeList = BarcodeList; src/main/resources/application.yml
@@ -8,7 +8,7 @@ name: @pom.build.finalName@ datasource: driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver url: jdbc:sqlserver://127.0.0.1:1433;databasename=whxrasrs url: jdbc:sqlserver://10.10.10.247:1433;databasename=whxrasrs username: sa password: sa@123 mvc: