zhang
4 天以前 91917e48f87be1cecdb9e1235ff5a8678f50ec6d
Merge branch 'rcs_master' into jdxaj
5个文件已修改
59 ■■■■■ 已修改文件
version/db/new.sql 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-manager/src/main/java/com/zy/acs/manager/ManagerBoot.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/properties/DevpSlave.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/thread/SiemensDevpThread.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asc-conveyor/src/main/resources/application.yml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
version/db/new.sql
@@ -108,3 +108,14 @@
alter table sys_user_login
    change system system_name varchar(255) null comment '登录系统';
ALTER TABLE `man_func_sta`
    ADD COLUMN `protocol` varchar(255) NULL COMMENT '协议' AFTER `angle`,
ADD COLUMN `ip` varchar(255) NULL COMMENT 'ip地址' AFTER `protocol`,
ADD COLUMN `port` varchar(255) NULL COMMENT '端口号' AFTER `ip`;
ALTER TABLE `man_func_sta`
    ADD COLUMN `error` varchar(255) NULL COMMENT '故障信息' AFTER `port`;
zy-acs-manager/src/main/java/com/zy/acs/manager/ManagerBoot.java
@@ -9,7 +9,7 @@
@MapperScan("com.zy.**.mapper")
@EnableDiscoveryClient
@SpringBootApplication
@SpringBootApplication(scanBasePackages = {"com.zy.acs.manager", "com.zy.acs.charge"})
@EnableScheduling
public class ManagerBoot {
zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/properties/DevpSlave.java
@@ -27,6 +27,8 @@
    private List<Integer> barcodeArr = new ArrayList<>();
    private List<Integer> weightArr = new ArrayList<>();
    private List<Integer> staNos = new ArrayList<>();
    private List<Integer> staNosError = new ArrayList<>();
zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/thread/SiemensDevpThread.java
@@ -17,6 +17,8 @@
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -114,6 +116,9 @@
        // 读取条码
        readBarcodes();
        // 称重
        readWeight();
        // 读取外形检测错误
        readDimensionErrors();
@@ -175,9 +180,41 @@
            if (!Cools.isEmpty(barcode)) {
                StaProtocol staProtocol = station.get(barcodeArr.get(i));
                if (staProtocol == null) {
                    log.warn("站点不存在 [id:{}] [staNo:{}]", slave.getId(), barcodeArr.get(i));
                    continue;
                }
                staProtocol.setBarcode(barcode);
                News.info("料箱码:{}", barcode);
            }
        }
    }
    /**
     * 读取条码信息
     */
    private void readWeight() {
        List<Integer> weightArr = slave.getWeightArr();
        if (weightArr == null || weightArr.isEmpty()) {
            return;
        }
        OperateResultExOne<byte[]> result = siemensS7Net.Read(
                DeviceField.WEIGHT.buildAddress(),
                (short) (weightArr.size() * DeviceField.WEIGHT.getByteLength()));
        if (!result.IsSuccess) {
            log.warn("读取重量失败 [id:{}]", slave.getId());
            return;
        }
        for (int i = 0; i < weightArr.size(); i++) {
            StaProtocol staProtocol = station.get(weightArr.get(i));
            if (staProtocol == null) {
                log.warn("站点不存在 [id:{}] [staNo:{}]", slave.getId(), weightArr.get(i));
                continue;
            }
            double weight = siemensS7Net.getByteTransform().TransSingle(result.Content, i * DeviceField.WEIGHT.getByteLength());
            staProtocol.setWeight(BigDecimal.valueOf(weight).setScale(4, RoundingMode.HALF_UP).doubleValue());
        }
    }
@@ -203,6 +240,10 @@
        for (int i = 0; i < staNosError.size(); i++) {
            Integer siteId = staNosError.get(i);
            StaProtocol staProtocol = station.get(siteId);
            if (staProtocol == null){
                log.warn("站点不存在 [id:{}] [staNo:{}]", slave.getId(), staNosError.get(i));
                continue;
            }
            boolean[] status = siemensS7Net.getByteTransform().TransBool(
                    content, i * DeviceField.DIMENSION_WORD.getByteLength(),
@@ -236,6 +277,7 @@
            Integer siteId = staNos.get(i);
            StaProtocol staProtocol = station.get(siteId);
            if (staProtocol == null) {
                log.warn("站点不存在 [id:{}] [staNo:{}]", slave.getId(), siteId);
                continue;
            }
zy-asc-conveyor/src/main/resources/application.yml
@@ -106,6 +106,8 @@
      - 1010
    barcodeArr:
      - 1010
    weightArr:
      - 1010
    # ctu放货站点
    releaseSta[0]:
      # 本站点