春风项目四线(合箱线、总装线)
wujian
2024-04-25 5a05af737f226fffa248e8fdb27546688af19100
change model2
已修改4个文件
42 ■■■■ 文件已修改
jcdm-admin/src/main/resources/application.yml 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/bs/orderScheduling/controller/BsOrderSchedulingController.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/api/main/bs/orderScheduling/orderScheduling.js 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/kb/engineCheck/index.vue 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-admin/src/main/resources/application.yml
@@ -137,4 +137,6 @@
    config:
      default:
        endpoint: opc.tcp://127.0.0.1:49320
        security-policy: none
        security-policy: none
websocketUrl: 'ws://10.10.12.100:8081/websocket/111122'
#websocketUrl: 'ws://127.0.0.1:8086/websocket/111122'
jcdm-main/src/main/java/com/jcdm/main/bs/orderScheduling/controller/BsOrderSchedulingController.java
@@ -25,6 +25,7 @@
import com.kangaroohy.milo.model.ReadWriteEntity;
import com.kangaroohy.milo.service.MiloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@@ -56,11 +57,21 @@
    @Autowired
    MiloService miloService;
    @Value("${websocketUrl}")
    private String websocketUrl;
    @GetMapping("/forceUpload")
    public void forceUpload() throws Exception {
        ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP121_ZZ_CODE_CHECK, 1);
        miloService.writeToOpcByte(entity);
    }
    @GetMapping("/websocketUrl")
    public String websocketName() {
        return websocketUrl;
    }
    /**
     * 查询订单排产列表
     */
jcdm-ui/src/api/main/bs/orderScheduling/orderScheduling.js
@@ -14,6 +14,12 @@
    method: 'get',
  })
}
export function getUrl() {
  return request({
    url: '/bs/orderScheduling/websocketUrl',
    method: 'get',
  })
}
//查询追溯报表
export function getFollowReport(query) {
  return request({
jcdm-ui/src/views/main/kb/engineCheck/index.vue
@@ -74,7 +74,7 @@
</template>
<script>
import { listOrderScheduling, forceUploadMethod, getOrderScheduling, delOrderScheduling, addOrderScheduling, updateOrderScheduling } from "@/api/main/bs/orderScheduling/orderScheduling";
import { listOrderScheduling, forceUploadMethod, getUrl, getOrderScheduling, delOrderScheduling, addOrderScheduling, updateOrderScheduling } from "@/api/main/bs/orderScheduling/orderScheduling";
import { listPassingStationCollection, getPassingStationCollection, delPassingStationCollection, addPassingStationCollection, updatePassingStationCollection } from "@/api/main/da/passingStationCollection/passingStationCollection";
import {listLineInfo} from "@/api/main/bs/lineInfo/lineInfo";
import WebSocketReconnect from "@/utils/WebsocketTool";
@@ -119,6 +119,7 @@
  props: [],
  data() {
    return {
      websocketUrl: '',
      websocket: null,
      result: {},
      transEngineNo: '',
@@ -166,11 +167,22 @@
    //   immediate:true
    // }
  },
  created() {},
  created() {
  },
  mounted() {
    this.initWebSocket()
    this.getWebUrl()
  },
  methods: {
    getWebUrl(){
      console.log("1111")
      getUrl().then(res=>{
        console.log("res",res)
        this.websocketUrl = res
        this.initWebSocket()
      })
    },
    forceUpload() {
      console.log('0000', this.form.engineNo)
      if (this.form.engineNo !== null) {
@@ -189,7 +201,8 @@
      //判断当前浏览器是否支持WebSocket
      if ('WebSocket' in window) {
        //连接WebSocket节点
        this.websocket = new WebSocketReconnect('ws://127.0.0.1:8086/websocket/111122')
        console.log("9999",this.websocketUrl)
        this.websocket = new WebSocketReconnect(this.websocketUrl)
        //接收到消息的回调方法
        this.websocket.socket.onmessage = (event) => {