-
admin
2024-06-18 bdb4046a1ed5358a94cc9ce846f2a1ec88e5d5ec
jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java
@@ -214,16 +214,16 @@
    public AjaxResult yzUpdateTighteningFormula(BsFormulaChildInfo bsFormulaChildInfo) {
        Boolean b = true;
        String result = "1";
        BsFormulaChildInfo getMaterTwo = new BsFormulaChildInfo();
        getMaterTwo.setProcessesCode(bsFormulaChildInfo.getLocationCode());
        getMaterTwo.setOperationType("2");
        List<BsFormulaChildInfo> operationType = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(getMaterTwo);
        List<String> collect = operationType.stream().map(BsFormulaChildInfo::getResults).collect(Collectors.toList());
        for (String s : collect) {
            if(s.equals("")){
//                return AjaxResult.success("扫描未完成,禁止拧紧操作!");
            }
        }
//        BsFormulaChildInfo getMaterTwo = new BsFormulaChildInfo();
//        getMaterTwo.setProcessesCode(bsFormulaChildInfo.getLocationCode());
//        getMaterTwo.setOperationType("2");
//        List<BsFormulaChildInfo> operationType = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(getMaterTwo);
//        List<String> collect = operationType.stream().map(BsFormulaChildInfo::getResults).collect(Collectors.toList());
//        for (String s : collect) {
//            if(s.equals("")){
////                return AjaxResult.success("扫描未完成,禁止拧紧操作!");
//            }
//        }
        BsFormulaChildInfo listQuery = new BsFormulaChildInfo();
        listQuery.setParamCode(bsFormulaChildInfo.getParamCode());
        listQuery.setProcessesCode(bsFormulaChildInfo.getLocationCode());
@@ -319,7 +319,7 @@
//                        miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+strA+".RecordDataDone").value(21).build());
//                        miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+strB+".RecordDataDone").value(21).build());
                        String locationCode = bsFormulaChildInfo.getLocationCode();
                        miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+locationCode+".RecordDataDone").value(21).build());
//                        miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+locationCode+".RecordDataDone").value(21).build());
                    } catch (Exception e) {
                        throw new RuntimeException(e);
                    }
@@ -373,6 +373,22 @@
    }
    @Override
    public AjaxResult checkMaterialCode(BsFormulaChildInfo bsFormulaChildInfo) {
        String result = "1";
        BsFormulaChildInfo getMaterTwo = new BsFormulaChildInfo();
        getMaterTwo.setProcessesCode(bsFormulaChildInfo.getLocationCode());
        getMaterTwo.setOperationType("2");
        List<BsFormulaChildInfo> operationType = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(getMaterTwo);
        List<String> collect = operationType.stream().map(BsFormulaChildInfo::getResults).collect(Collectors.toList());
        for (String s : collect) {
            if(s.equals("")){
                result = "2";
            }
        }
        return AjaxResult.success(result);
    }
    @Override
    public BsFormulaChildInfo releaseCheck(BsFormulaChildInfo bsFormulaChildInfo) {
        return bsFormulaChildInfoMapper.releaseCheck(bsFormulaChildInfo);
    }
@@ -415,7 +431,7 @@
                if(bsFormulaChildInfos.get(0).getSpareField4().equals("1")){
                    try {
                        result = "3";
                        miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+bsFormulaChildInfo.getLocationCode()+".RecordDataDone").value(21).build());
//                        miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+bsFormulaChildInfo.getLocationCode()+".RecordDataDone").value(21).build());
                    } catch (Exception e) {
                        throw new RuntimeException(e);
                    }
@@ -563,7 +579,7 @@
    //                        List<DaPassingStationCollection> daPassingStationCollections = daPassingStationCollectionMapper.selectDaPassingStationCollectionList(daPassingStationCollection);
    //                        daPassingStationCollections.get(0).setOutboundTime(new Date());
    //                        daPassingStationCollectionMapper.updateDaPassingStationCollection(daPassingStationCollections.get(0));
                            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+bsFormulaChildInfo.getLocationCode()+".RecordDataDone").value(21).build());
//                            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+bsFormulaChildInfo.getLocationCode()+".RecordDataDone").value(21).build());
                            WebSocketUsers.sendMessageToUserByText(map.get(bsFormulaChildInfo.getLocationCode()), "OUT");
                        } catch (Exception e) {
                            throw new RuntimeException(e);