| | |
| | | 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") |