自动化立体仓库 - WCS系统
zhangc
2025-03-13 426c2fbeaf634d21db08fc996b433ddd7da43881
配置信息
1个文件已添加
3个文件已修改
120 ■■■■ 已修改文件
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/properties/SlaveProductProperties.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application-prod.yml 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -35,7 +35,7 @@
import com.zy.core.model.command.CrnCommand;
import com.zy.core.model.protocol.CrnProtocol;
import com.zy.core.model.protocol.StaProtocol;
import com.zy.core.properties.SlaveProperties;
import com.zy.core.properties.SlaveProductProperties;
import com.zy.core.thread.BarcodeThread;
import com.zy.core.thread.SiemensDevpThread;
import com.zy.system.entity.Config;
@@ -65,7 +65,7 @@
    public static final long COMMAND_TIMEOUT = 5 * 1000;
    @Autowired
    private SlaveProperties slaveProperties;
    private SlaveProductProperties slaveProductProperties;
    @Autowired
    private WrkMastMapper wrkMastMapper;
    @Autowired
@@ -116,7 +116,7 @@
    public void generateStoreWrkFile1() throws IOException, InterruptedException {
        try {
            // 根据输送线plc遍历
            for (DevpSlave devp : slaveProperties.getDevp()) {
            for (DevpSlave devp : slaveProductProperties.getDevp()) {
                // 遍历入库口
                for (DevpSlave.Sta inSta : devp.getInSta()) {
                    StorageEscalationParam storageEscalationParam = new StorageEscalationParam();
@@ -300,7 +300,7 @@
    public void generateStoreWrkFile() throws IOException, InterruptedException {
        try {
            // 根据输送线plc遍历
            for (DevpSlave devp : slaveProperties.getDevp()) {
            for (DevpSlave devp : slaveProductProperties.getDevp()) {
                // 遍历入库口
                for (DevpSlave.Sta inSta : devp.getInSta()) {
                    // 获取入库站信息
@@ -575,7 +575,7 @@
     * 堆垛机站出库到出库站
     */
    public void crnStnToOutStn() {
        for (CrnSlave crnSlave : slaveProperties.getCrn()) {
        for (CrnSlave crnSlave : slaveProductProperties.getCrn()) {
            // 遍历堆垛机出库站
            for (CrnSlave.CrnStn crnStn : crnSlave.getCrnOutStn()) {
                List<StaDesc> staDescs = staDescMapper.selectList(new EntityWrapper<StaDesc>().eq("crn_no", crnSlave.getId()).eq("crn_stn", crnStn.getStaNo()));
@@ -631,7 +631,7 @@
     * 入出库  ===>>  堆垛机入出库作业下发
     */
    public synchronized void crnIoExecute() throws IOException {
        for (CrnSlave crn : slaveProperties.getCrn()) {
        for (CrnSlave crn : slaveProductProperties.getCrn()) {
            // 获取堆垛机信息
            CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, crn.getId());
            CrnProtocol crnProtocol = crnThread.getCrnProtocol();
@@ -944,8 +944,8 @@
            for (TaskWrk taskWrk : taskWrks) {
                // 双深库位且浅库位有货,则需先对浅库位进行库位移转
//                if (Utils.isDeepLoc(slaveProperties, taskWrk.getStartPoint())) {
//                    String shallowLocNo = Utils.getShallowLoc(slaveProperties, taskWrk.getStartPoint());
//                if (Utils.isDeepLoc(slaveProductProperties, taskWrk.getStartPoint())) {
//                    String shallowLocNo = Utils.getShallowLoc(slaveProductProperties, taskWrk.getStartPoint());
//                    TaskWrk hallowLocNoTask = taskWrkMapper.selectByStartPoint(shallowLocNo);
//                    if (!Cools.isEmpty(hallowLocNoTask)){
//                        continue;
@@ -1033,7 +1033,7 @@
     * 执行对工作档的完成操作
     */
//    public void storeFinished() {
//        for (CrnSlave crn : slaveProperties.getCrn()) {
//        for (CrnSlave crn : slaveProductProperties.getCrn()) {
//            // 获取堆垛机信息
//            CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, crn.getId());
//            CrnProtocol crnProtocol = crnThread.getCrnProtocol();
@@ -1081,7 +1081,7 @@
     * 执行对工作档的完成操作
     */
    public void storeFinished() throws InterruptedException {
        for (CrnSlave crn : slaveProperties.getCrn()) {
        for (CrnSlave crn : slaveProductProperties.getCrn()) {
            // 获取堆垛机信息
            CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, crn.getId());
            CrnProtocol crnProtocol = crnThread.getCrnProtocol();
@@ -1156,7 +1156,7 @@
     */
    public void recCrnErr() {
        Date now = new Date();
        for (CrnSlave crn : slaveProperties.getCrn()) {
        for (CrnSlave crn : slaveProductProperties.getCrn()) {
            // 获取堆垛机信息
            CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, crn.getId());
            CrnProtocol crnProtocol = crnThread.getCrnProtocol();
src/main/java/com/zy/core/properties/SlaveProductProperties.java
New file
@@ -0,0 +1,45 @@
package com.zy.core.properties;
import com.zy.core.Slave;
import com.zy.core.model.CrnSlave;
import com.zy.core.model.DevpSlave;
import com.zy.core.model.LedSlave;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import java.util.ArrayList;
import java.util.List;
/**
 * Created by vincent on 2020/8/4
 *
 */
/**
 * 该类整个就是一个通过配置文件来实体化对象类
 */
@Data
@Configuration
@ConfigurationProperties(prefix = "wcs-slave-product")
public class SlaveProductProperties {
    private boolean doubleDeep;
    private List<Integer> doubleLocs = new ArrayList<>();
    private int groupCount;
    private List<CrnSlave> crn = new ArrayList<>();
    private List<DevpSlave> devp = new ArrayList<>();
    private List<Slave> barcode = new ArrayList<>();
    private List<LedSlave> led = new ArrayList<>();
    private List<Slave> scale = new ArrayList<>();
    private List<Slave> car = new ArrayList<>();
}
src/main/resources/application-prod.yml
@@ -44,26 +44,56 @@
      lev: 2
      backSta: 106
      devpPlcId: ${wcs-slave.devp[0].id}
  crn[2]: #堆垛机3
    id: 3
    ip: 10.10.10.130
  devp[0]: #输送线
    id: 1
    ip: 10.10.10.140
    rack: 0
    port: 102
    slot: 0
    emptyInSta[0]: #空板入库口0
      staNo: 116
    inSta[0]: #入库口1
      staNo: 116
      backSta: 110
      barcode: ${wcs-slave.barcode[0].id}
    outSta[0]: #出库口1
      staNo: 105
    outSta[1]: #出库口2
      staNo: 107
    outSta[2]: #出库口2
      staNo: 109
    outSta[3]: #出库口1
      staNo: 110
  barcode[0]: #条码扫描仪
    port: 51236
    ip: 172.17.91.39
    id: 1
wcs-slave-product:
  doubleDeep: false #双深
  doubleLocs: 1,4,5,8 #双深库位排号 1,4,5,8
  groupCount: 4 #一个堆垛机负责的货架排数
  crn[0]: #堆垛机1
    id: 1
    ip: 10.10.10.110
    slot: 0
    demo: false
    rack: 0
    offset: 2  #偏移量,当堆垛机站点列号=1时,偏移量=2
    port: 102
    crnOutStn[0]: #堆垛机出库站点
      staNo: 115
      row: 7
      staNo: 125
      row: 3
      bay: 1
      lev: 2
      devpPlcId: ${wcs-slave.devp[0].id}
    crnInStn[0]: #堆垛机入库站点1
      staNo: 120
      row: 6
      staNo: 100
      row: 2
      bay: 1
      lev: 2
      backSta: 106
      backSta: 102
      devpPlcId: ${wcs-slave.devp[0].id}
  devp[0]: #输送线
    id: 1
@@ -229,3 +259,6 @@
#    demo: false
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=ynhfasrs
    url: jdbc:sqlserver://127.0.0.1:1433;databasename=czscgkwcs
    username: sa
    password: sa@123
  mvc:
@@ -37,7 +37,7 @@
#License相关配置
license:
  subject: ynhfwcs
  subject: czscgkwcs
  publicAlias: publicCert
  storePass: public_zhongyang_123456789
  licensePath: license.lic