春风项目四线(合箱线、总装线)
wujian
2024-04-24 3946f893f84814185dfb97e89bfdb10b82eea906
change model
已修改5个文件
116 ■■■■ 文件已修改
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/domain/DaOpcuaConfig.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/plcserver/conf/OPCElement.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java 98 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/kb/engineCheck/index.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/domain/DaOpcuaConfig.java
@@ -48,7 +48,7 @@
    /** 状态 */
    @Excel(name = "状态")
    private Long state;
    private Integer state;
    public void setId(Long id) 
    {
@@ -122,12 +122,12 @@
    {
        return process;
    }
    public void setState(Long state)
    public void setState(Integer state)
    {
        this.state = state;
    }
    public Long getState()
    public Integer getState()
    {
        return state;
    }
jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java
@@ -72,7 +72,7 @@
     */
    public List<DaOpcuaConfig> getSubList(){
        DaOpcuaConfig config = new DaOpcuaConfig();
        config.setState(1L);
        config.setState(0);
        List<DaOpcuaConfig> list = iDaOpcuaConfigService.selectDaOpcuaConfigList(config);
//        List<String> lists = new ArrayList<>();
//        if (CollUtil.isNotEmpty(list)){
jcdm-main/src/main/java/com/jcdm/main/plcserver/conf/OPCElement.java
@@ -33,6 +33,8 @@
    public static final String OP465_ZZ_CODE_CHECK = "CFL4ZZ.OP465.CodeCheck";
    //返修监听点位-355
    public static final String OP355_ZZ_CODE_CHECK = "CFL4ZZ.OP355.CodeCheck";
    public static final String OP695_ZZ_CODE_CHECK = "CFL4ZZ.OP695.CodeCheck";
    public static final String OP755_ZZ_CODE_CHECK = "CFL4ZZ.OP755.CodeCheck";
    public static final String SN_CHECK = "SNRetrieval";
    public static final String SAVE_DATA = "SaveData";
jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java
@@ -142,6 +142,9 @@
    private void scannerGunMessage() throws Exception {
        String[] parts = OPCElement.OP120_ZZ_CODE_CHECK.split("[.]");
        Object SNCodeObject = miloService.readFromOpcUa(parts[0] + "." + parts[1] + ".Code1").getValue();
        if (null == SNCodeObject){
            SNCodeObject = miloService.readFromOpcUa(parts[0] + "." + parts[1] + ".Code").getValue();
        }
        if (null != SNCodeObject){
            String SNCode = SNCodeObject.toString();
            passingStationCollectionServiceImpl.sendMessage(SNCode);
@@ -155,8 +158,9 @@
            Object SNCodeObject = miloService.readFromOpcUa(parts[0] + "." + parts[1] + ".Code").getValue();
            if(null != SNCodeObject) {
                String SNCode=SNCodeObject.toString();
//                String a=passingStationCollectionServiceImpl.SelectSN(SNCode,parts[1]);
                String a="1";
                String a=passingStationCollectionServiceImpl.SelectSN(SNCode,parts[1]);
                System.out.println("codeCheckFeed:"+a);
//                String a="1";
                // 1:OK可生产 2:NG不可生产 3:NG可返工 4:PC检索失败(无记录)5:PC检索失败(软件)
                if (StrUtil.isNotBlank(a)){
                    int input = Integer.parseInt(a);
@@ -178,9 +182,11 @@
                        miloService.writeToOpcUa(entity2);
                    }
                    //如果是返修工位需要传输返修工位号
                    if (OPCElement.OP465_ZZ_CODE_CHECK.equals(Node) || OPCElement.OP355_ZZ_CODE_CHECK.equals(Node)){
                        rework(SNCode);
                    if (OPCElement.OP465_ZZ_CODE_CHECK.equals(Node) || OPCElement.OP355_ZZ_CODE_CHECK.equals(Node)
                    || OPCElement.OP695_ZZ_CODE_CHECK.equals(Node) || OPCElement.OP755_ZZ_CODE_CHECK.equals(Node)){
                        rework(SNCode,Node);
                    }
                    System.out.println(entity);
                miloService.writeToOpcByte(entity);
                }
@@ -188,7 +194,7 @@
        }
    }
    private void rework(String SNCode)  throws Exception{
    private void rework(String SNCode,String Node)  throws Exception{
        BsOrderScheduling bsOrderScheduling = new BsOrderScheduling();
        bsOrderScheduling.setEngineNo(SNCode);
        List<String> allProcessCoed = new ArrayList<>();
@@ -205,31 +211,83 @@
        rmRepairRecord.setBoxCode(SNCode);
        List<ReadWriteEntity> writeList = new ArrayList<>();
        List<RmRepairRecord> rmRepairRecords = rmRepairRecordService.selectRmRepairRecordList(rmRepairRecord);
        //过站记录
        DaPassingStationCollection PassingStationCollection=new DaPassingStationCollection();
        PassingStationCollection.setSfcCode(SNCode);
        //过站记录
        List<DaPassingStationCollection> daPassingStationCollections = passingStationCollectionServiceImpl.selectDaPassingStationCollectionList(PassingStationCollection);
        //所有反工工位
        List<String> collect1 = rmRepairRecords.stream().map(RmRepairRecord::getProcessesCode).collect(Collectors.toList());
        //所有放行工位
        List<String> collect2 = allProcessCoed;
        if (CollUtil.isNotEmpty(rmRepairRecords)){
            //数据库查询出的工位
            rmRepairRecords.forEach(x -> {
                ReadWriteEntity readWriteEntity = new ReadWriteEntity();
                readWriteEntity.setIdentifier(x.getProcessesCode());
                readWriteEntity.setValue(1);
                writeList.add(readWriteEntity);
        //查询出所有需要返修工位的最小op块
        Integer minOP = 0;
        if (CollUtil.isNotEmpty(collect1)){
            List<Integer> sortList = new ArrayList<>();
            collect1.stream().forEach(x ->{
                String op = x.replace("OP", "");
                if (StrUtil.isNotBlank(op)){
                    int i = Integer.parseInt(op);
                    sortList.add(i);
                }
            });
            collect2 = allProcessCoed.stream().filter(x -> !collect1.contains(x)).collect(Collectors.toList());
            if (CollUtil.isNotEmpty(sortList)){
                List<Integer> collect2 = sortList.stream().sorted().collect(Collectors.toList());
                minOP = collect2.get(0);
            }
        }
        if (CollUtil.isNotEmpty(collect2)){
            collect2.forEach(x -> {
        //所有放行工位
        //过站记录除去返修记录就是传2,返修数据及后面占位数据传1
        List<String> collect3 = daPassingStationCollections.stream().map(DaPassingStationCollection::getLocationCode).collect(Collectors.toList());
        if (CollUtil.isNotEmpty(collect1)){
            collect3 = collect3.stream().filter(x -> !collect1.contains(x)).collect(Collectors.toList());
        }
        if (CollUtil.isNotEmpty(collect3)){
            collect3.forEach(x -> {
                ReadWriteEntity readWriteEntity = new ReadWriteEntity();
                readWriteEntity.setIdentifier(x);
                readWriteEntity.setValue(2);
                writeList.add(readWriteEntity);
            });
        }
        //需生产工位
        List<String> collect4 = allProcessCoed;
        if (CollUtil.isNotEmpty(collect3)){
            List<String> finalCollect = collect3;
            collect4 = allProcessCoed.stream().filter(x -> !finalCollect.contains(x)).collect(Collectors.toList());
        }
        if (CollUtil.isNotEmpty(collect4)){
            //数据库查询出的工位
            collect4.forEach(x -> {
                ReadWriteEntity readWriteEntity = new ReadWriteEntity();
                readWriteEntity.setIdentifier(x);
                readWriteEntity.setValue(1);
                writeList.add(readWriteEntity);
            });
        }
//        List<String> collect2 = allProcessCoed;
//        if (CollUtil.isNotEmpty(rmRepairRecords)){
//            //数据库查询出的工位
//            rmRepairRecords.forEach(x -> {
//                ReadWriteEntity readWriteEntity = new ReadWriteEntity();
//                readWriteEntity.setIdentifier(x.getProcessesCode());
//                readWriteEntity.setValue(1);
//                writeList.add(readWriteEntity);
//            });
//            collect2 = allProcessCoed.stream().filter(x -> !collect1.contains(x)).collect(Collectors.toList());
//        }
//        if (CollUtil.isNotEmpty(collect2)){
//            collect2.forEach(x -> {
//                ReadWriteEntity readWriteEntity = new ReadWriteEntity();
//                readWriteEntity.setIdentifier(x);
//                readWriteEntity.setValue(2);
//                writeList.add(readWriteEntity);
//            });
//        }
        ReadWriteEntity readWriteEntity = new ReadWriteEntity();
        readWriteEntity.setIdentifier("Repair_sign");
        readWriteEntity.setValue(1);
        readWriteEntity.setValue(minOP);
        writeList.add(readWriteEntity);
        miloService.writeToOpcByte(writeList);
    }
@@ -238,7 +296,9 @@
    public void SaveData(String Node) throws Exception {
        String[] parts = Node.split("[.]");
        Object SNCodeObject = miloService.readFromOpcUa(parts[0] + "." + parts[1] + ".Code1").getValue();
        if (null == SNCodeObject){
            SNCodeObject = miloService.readFromOpcUa(parts[0] + "." + parts[1] + ".Code").getValue();
        }
        if(null != SNCodeObject)
        {
            String SNCode = SNCodeObject.toString();
jcdm-ui/src/views/main/kb/engineCheck/index.vue
@@ -17,7 +17,7 @@
             <el-form ref="form" :model="form"  label-width="25%"   >
               <el-form-item prop="engineNo" style="margin-top: 16px">
               <span slot="label" style="font-size:22px;color:black;"><strong>发动机号</strong></span>
                 <el-input style="font-size:20px" v-model="form.engineNo" placeholder="请输入发动机号" clearable  @keyup.enter.native="EngineNohandleChange" >
                 <el-input style="font-size:20px" v-model="form.engineNo" placeholder="请输入发动机号" clearable  @keyup.space.native="EngineNohandleChange" >
                   <el-button slot="append" plain type="info" @click="EngineNohandleChange(form.engineNo)" icon="el-icon-search"></el-button>
                 </el-input>
               </el-form-item>
@@ -186,7 +186,10 @@
            console.log('this.result',this.result)
            this.form.engineNo = this.result.server_message
            // this.transEngineNo = this.result.server_message
            console.log('this.transEngineNo11111111111',this.transEngineNo)
            console.log('this.transEngineNo11111111111',this.form.engineNo)
            if (this.form.engineNo !== null && this.form.engineNo !== ''){
              this.EngineNohandleChange()
            }
          }
        }
//监听窗口关闭事件,当窗口关闭时,主动去关闭websocket连接,防止连接还没断开就关闭窗口,server端会抛异常。
@@ -218,6 +221,7 @@
      this.resetForm("form");
    },
    EngineNohandleChange(){
      console.log("EngineNohandleChange")
      if(this.form.engineNo !== null && this.form.engineNo !== undefined){
        let OrderSchedulingParam = {engineNo: null}
        OrderSchedulingParam.engineNo = this.form.engineNo;