admin
2024-09-27 ac3856a47fe649cff0b7c6d0a7edd1d8b83f9253
jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java
@@ -53,6 +53,30 @@
    private MiloService miloService;
    /**
     * 返修信息写入plc
     */
    @GetMapping("/writeRepairInformationIntoPlc")
    public AjaxResult writeRepairInformationIntoPlc(BsFormulaChildInfo bsFormulaChildInfo)
    {
        String thoroughfare = Constants.thoroughfareMap.get(bsFormulaChildInfo.getProcessesCode());//获取通道
        try {
            String prefix = thoroughfare+".OP165.";
            miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(prefix+"SNCode").value(bsFormulaChildInfo.getSfcCode()).build());
            miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(prefix+"WorkOrderNumber").value(bsFormulaChildInfo.getWorkOrderNo()).build());
            miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(prefix+"ProcessesCode").value(bsFormulaChildInfo.getProcessesCode()).build());
            miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(prefix+"EngravingStatus").value(bsFormulaChildInfo.getEngravingStatus()).build());
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return AjaxResult.success();
    }
    public static void main(String[] args) {
        String str = "TZ180XSDSZX012409120000001";
        System.out.println(str.length());
    }
    /**
     * 未做完工序回复plc信号
     */
    @GetMapping("/unfinishedProcess")