| | |
| | | import com.jcdm.main.da.opcuaconfig.domain.DaOpcuaConfig; |
| | | import com.jcdm.main.da.opcuaconfig.domain.NodeEntity; |
| | | import com.jcdm.main.da.opcuaconfig.service.IDaOpcuaConfigService; |
| | | import com.jcdm.main.plcserver.sub.OPCUaSubscription; |
| | | import com.kangaroohy.milo.model.ReadWriteEntity; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | @PreAuthorize("@ss.hasPermi('da:opcuaconfig:query')") |
| | | @GetMapping(value = "/SNCode/{SNCode}/{locationCode}") |
| | | public AjaxResult setSNCode(@PathVariable("SNCode") String SNCode,@PathVariable("locationCode") String locationCode) { |
| | | //NodeEntity node= NodeEntity.builder().index(2).identifier("CFL4CVT"+"."+locationCode+".SNCode").value(SNCode).type("string").build(); |
| | | Boolean out= null; |
| | | ReadWriteEntity entity = new ReadWriteEntity("CFL4HX."+locationCode+".SNCode", SNCode); |
| | | Boolean out= true; |
| | | try { |
| | | // out = ClientHandler.write(node); |
| | | OPCUaSubscription.miloService.writeToOpcUa(entity);//写SN |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | |
| | | return toAjax(out); |
| | | } |
| | | } |