Przeglądaj źródła

1、库位视图页面增加打开和关闭拆包机按钮
2、打开和关闭拆包机按钮调用的后端接口

LZH 1 rok temu
rodzic
commit
af774d8391

+ 71 - 20
ruoyi-admin/src/main/java/com/ruoyi/xuankuang/controller/test/UnpackingMachineController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.xuankuang.controller.test;
 
+import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.hard.xuankang.ConvertUtil;
 import com.ruoyi.hard.xuankang.UnpackingMachineClient;
 import com.ruoyi.hard.xuankang.UnpackingMachineSubClient;
@@ -99,8 +100,13 @@ public class UnpackingMachineController {
      */
     @ApiOperation("启动拆包机1#接口")
     @PostMapping("/writeRun01")
-    public boolean write01() {
-        return unpackingMachineSubClient.writeV140_5();
+    public AjaxResult write01() {
+        boolean b = unpackingMachineSubClient.writeV140_5();
+        if (b){
+            return AjaxResult.success("成功");
+        }else {
+            return AjaxResult.error("失败");
+        }
     }
 
     /**
@@ -110,8 +116,13 @@ public class UnpackingMachineController {
      */
     @ApiOperation("启动拆包机2#接口")
     @PostMapping("/writeRun02")
-    public boolean write02() {
-        return unpackingMachineSubClient.writeV140_6();
+    public AjaxResult write02() {
+        boolean b = unpackingMachineSubClient.writeV140_6();
+         if (b){
+             return AjaxResult.success("成功");
+         }else {
+             return AjaxResult.error("失败");
+         }
     }
 
     /**
@@ -121,8 +132,13 @@ public class UnpackingMachineController {
      */
     @ApiOperation("启动拆包机3#接口")
     @PostMapping("/writeRun03")
-    public boolean write03() {
-        return unpackingMachineSubClient.writeV140_7();
+    public AjaxResult write03() {
+        boolean b = unpackingMachineSubClient.writeV140_7();
+        if (b){
+            return AjaxResult.success("成功");
+        }else {
+            return AjaxResult.error("失败");
+        }
     }
 
     /**
@@ -132,8 +148,13 @@ public class UnpackingMachineController {
      */
     @ApiOperation("启动拆包机4#接口")
     @PostMapping("/writeRun04")
-    public boolean write04() {
-        return unpackingMachineSubClient.writeV141_0();
+    public AjaxResult write04() {
+        boolean b = unpackingMachineSubClient.writeV141_0();
+        if (b){
+            return AjaxResult.success("成功");
+        }else {
+            return AjaxResult.error("失败");
+        }
     }
 
     /**
@@ -143,8 +164,13 @@ public class UnpackingMachineController {
      */
     @ApiOperation("启动拆包机5#接口")
     @PostMapping("/writeRun05")
-    public boolean write05() {
-        return unpackingMachineSubClient.writeV141_1();
+    public AjaxResult write05() {
+        boolean b = unpackingMachineSubClient.writeV141_1();
+        if (b){
+            return AjaxResult.success("成功");
+        }else {
+            return AjaxResult.error("失败");
+        }
     }
 
     /**
@@ -154,8 +180,13 @@ public class UnpackingMachineController {
      */
     @ApiOperation("停止拆包机1#接口")
     @PostMapping("/writeEnd01")
-    public boolean writeEnd01(){
-        return unpackingMachineSubClient.writeV141_2();
+    public AjaxResult writeEnd01(){
+        boolean b = unpackingMachineSubClient.writeV141_2();
+        if (b){
+            return AjaxResult.success("成功");
+        }else {
+            return AjaxResult.error("失败");
+        }
     }
 
     /**
@@ -165,8 +196,13 @@ public class UnpackingMachineController {
      */
     @ApiOperation("停止拆包机2#接口")
     @PostMapping("/writeEnd02")
-    public boolean writeEnd02(){
-        return unpackingMachineSubClient.writeV141_3();
+    public AjaxResult writeEnd02(){
+        boolean b = unpackingMachineSubClient.writeV141_3();
+        if (b){
+            return AjaxResult.success("成功");
+        }else {
+            return AjaxResult.error("失败");
+        }
     }
     /**
      * 关闭拆包机3#
@@ -175,8 +211,13 @@ public class UnpackingMachineController {
      */
     @ApiOperation("停止拆包机3#接口")
     @PostMapping("/writeEnd03")
-    public boolean writeEnd03(){
-        return unpackingMachineSubClient.writeV141_4();
+    public AjaxResult writeEnd03(){
+        boolean b = unpackingMachineSubClient.writeV141_4();
+        if (b){
+            return AjaxResult.success("成功");
+        }else {
+            return AjaxResult.error("失败");
+        }
     }
 
     /**
@@ -186,8 +227,13 @@ public class UnpackingMachineController {
      */
     @ApiOperation("停止拆包机4#接口")
     @PostMapping("/writeEnd04")
-    public boolean writeEnd04(){
-        return unpackingMachineSubClient.writeV141_5();
+    public AjaxResult writeEnd04(){
+        boolean b = unpackingMachineSubClient.writeV141_5();
+        if (b){
+            return AjaxResult.success("成功");
+        }else {
+            return AjaxResult.error("失败");
+        }
     }
 
     /**
@@ -197,8 +243,13 @@ public class UnpackingMachineController {
      */
     @ApiOperation("停止拆包机5#接口")
     @PostMapping("/writeEnd05")
-    public boolean writeEnd05(){
-        return unpackingMachineSubClient.writeV141_6();
+    public AjaxResult writeEnd05(){
+        boolean b = unpackingMachineSubClient.writeV141_6();
+        if (b){
+            return AjaxResult.success("成功");
+        }else {
+            return AjaxResult.error("失败");
+        }
     }
 
     /**

+ 70 - 0
ruoyi-ui/src/api/ams/locationView.js

@@ -67,3 +67,73 @@ export function queryWarehouseDict() {
     method: 'get',
   })
 }
+
+export function open1() {
+  return request({
+    url: '/test/wcs2/writeRun01',
+    method: 'post',
+  })
+}
+
+export function open2() {
+  return request({
+    url: '/test/wcs2/writeRun02',
+    method: 'post',
+  })
+}
+
+export function open3() {
+  return request({
+    url: '/test/wcs2/writeRun03',
+    method: 'post',
+  })
+}
+
+export function open4() {
+  return request({
+    url: '/test/wcs2/writeRun04',
+    method: 'post',
+  })
+}
+
+export function open5() {
+  return request({
+    url: '/test/wcs2/writeRun05',
+    method: 'post',
+  })
+}
+
+export function close1() {
+  return request({
+    url: '/test/wcs2/writeEnd01',
+    method: 'post',
+  })
+}
+
+export function close2() {
+  return request({
+    url: '/test/wcs2/writeEnd02',
+    method: 'post',
+  })
+}
+
+export function close3() {
+  return request({
+    url: '/test/wcs2/writeEnd03',
+    method: 'post',
+  })
+}
+
+export function close4() {
+  return request({
+    url: '/test/wcs2/writeEnd04',
+    method: 'post',
+  })
+}
+
+export function close5() {
+  return request({
+    url: '/test/wcs2/writeEnd05',
+    method: 'post',
+  })
+}

+ 161 - 2
ruoyi-ui/src/views/ams/inv/locationView/index.vue

@@ -57,6 +57,16 @@
         <el-form-item>
           <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
           <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+          <el-button type="primary" plain size="mini" @click="open1">打开拆包机1</el-button>
+          <el-button type="primary" plain size="mini" @click="open2">打开拆包机2</el-button>
+          <el-button type="primary" plain size="mini" @click="open3">打开拆包机3</el-button>
+          <el-button type="primary" plain size="mini" @click="open4">打开拆包机4</el-button>
+          <el-button type="primary" plain size="mini" @click="open5">打开拆包机5</el-button>
+          <el-button type="primary" plain size="mini" @click="close1">关闭拆包机1</el-button>
+          <el-button type="primary" plain size="mini" @click="close2">关闭拆包机2</el-button>
+          <el-button type="primary" plain size="mini" @click="close3">关闭拆包机3</el-button>
+          <el-button type="primary" plain size="mini" @click="close4">关闭拆包机4</el-button>
+          <el-button type="primary" plain size="mini" @click="close5">关闭拆包机5</el-button>
         </el-form-item>
       </el-form>
       <el-main>
@@ -121,8 +131,27 @@
     </el-container>
 </template>
 <script>
-import { clearLocRequest,locationInvView,queryLocationZoneDict,lockLocRequest,lotattConfigList
-  ,lotattInfo,occupyLocRequest,queryWarehouseDict} from "@/api/ams/locationView";
+import {
+  clearLocRequest,
+  locationInvView,
+  queryLocationZoneDict,
+  lockLocRequest,
+  lotattConfigList
+  ,
+  lotattInfo,
+  occupyLocRequest,
+  queryWarehouseDict,
+  open1,
+  close1,
+  open2,
+  open3,
+  open4,
+  open5,
+  close2,
+  close3,
+  close4,
+  close5
+} from "@/api/ams/locationView";
 
   export default {
     data () {
@@ -203,6 +232,136 @@ import { clearLocRequest,locationInvView,queryLocationZoneDict,lockLocRequest,lo
       handleQuery() {
         this.getDataList();
       },
+      open1() {
+        let that = this
+        this.$modal.confirm('是否确认要打开1号拆包机').then(function() {
+          open1(that.currentSelect).then(response => {
+            if (response.code === 200) {
+              that.$modal.msgSuccess(response.msg);
+              that.search();
+            } else {
+              that.$modal.msgError(response.msg);
+            }
+          });
+        });
+      },
+      open2() {
+        let that = this
+        this.$modal.confirm('是否确认要打开2号拆包机').then(function() {
+          open2(that.currentSelect).then(response => {
+            if (response.code === 200) {
+              that.$modal.msgSuccess(response.msg);
+              that.search();
+            } else {
+              that.$modal.msgError(response.msg);
+            }
+          });
+        });
+      },
+      open3() {
+        let that = this
+        this.$modal.confirm('是否确认要打开1号拆包机').then(function() {
+          open3(that.currentSelect).then(response => {
+            if (response.code === 200) {
+              that.$modal.msgSuccess(response.msg);
+              that.search();
+            } else {
+              that.$modal.msgError(response.msg);
+            }
+          });
+        });
+      },
+      open4() {
+        let that = this
+        this.$modal.confirm('是否确认要打开1号拆包机').then(function() {
+          open4(that.currentSelect).then(response => {
+            if (response.code === 200) {
+              that.$modal.msgSuccess(response.msg);
+              that.search();
+            } else {
+              that.$modal.msgError(response.msg);
+            }
+          });
+        });
+      },
+      open5() {
+        let that = this
+        this.$modal.confirm('是否确认要打开1号拆包机').then(function() {
+          open5(that.currentSelect).then(response => {
+            if (response.code === 200) {
+              that.$modal.msgSuccess(response.msg);
+              that.search();
+            } else {
+              that.$modal.msgError(response.msg);
+            }
+          });
+        });
+      },
+      close1(){
+        let that = this
+        this.$modal.confirm('是否确认要关闭1号拆包机').then(function() {
+          close1(that.currentSelect).then(response => {
+            if (response.code === 200) {
+              that.$modal.msgSuccess(response.msg);
+              that.search();
+            } else {
+              that.$modal.msgError(response.msg);
+            }
+          });
+        });
+      },
+      close2(){
+        let that = this
+        this.$modal.confirm('是否确认要关闭2号拆包机').then(function() {
+          close2(that.currentSelect).then(response => {
+            if (response.code === 200) {
+              that.$modal.msgSuccess(response.msg);
+              that.search();
+            } else {
+              that.$modal.msgError(response.msg);
+            }
+          });
+        });
+      },
+      close3(){
+        let that = this
+        this.$modal.confirm('是否确认要关闭3号拆包机').then(function() {
+          close3(that.currentSelect).then(response => {
+            if (response.code === 200) {
+              that.$modal.msgSuccess(response.msg);
+              that.search();
+            } else {
+              that.$modal.msgError(response.msg);
+            }
+          });
+        });
+      },
+      close4(){
+        let that = this
+        this.$modal.confirm('是否确认要关闭4号拆包机').then(function() {
+          close4(that.currentSelect).then(response => {
+            if (response.code === 200) {
+              that.$modal.msgSuccess(response.msg);
+              that.search();
+            } else {
+              that.$modal.msgError(response.msg);
+            }
+          });
+        });
+      },
+      close5(){
+        let that = this
+        this.$modal.confirm('是否确认要关闭5号拆包机').then(function() {
+          close5(that.currentSelect).then(response => {
+            if (response.code === 200) {
+              that.$modal.msgSuccess(response.msg);
+              that.search();
+            } else {
+              that.$modal.msgError(response.msg);
+            }
+          });
+        });
+      },
       clearInterval () {
         clearInterval(this.timer)
       },