wu
2024-01-19 2a693c6842788d1011d69e62af3df6dfd06ecf16
springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java
@@ -275,16 +275,21 @@
  @PostMapping("/InsertQueueGlassId")
  public Result InsertQueueGlassId(Short id, @RequestBody Queue queue) {
    Map<String, Object> map = new HashMap<>();
    Short zhi=200;
    short result = homeMapper.SelectStorageByGlassId(queue.getglassId());
    if (result > 0) {
      map.put("message", "300");
    } else {
      homeMapper.InsertQueueGlassId(queue, id);
      if (id == 1) {
        // 调用伍存储过程
        spianService.selectAll(queue.getglassId());
        zhi=spianService.selectAll(queue.getglassId());
        if(zhi==200){
          homeMapper.InsertQueueGlassId(queue, id);
      }
      map.put("message", "200");
      }
      map.put("message",zhi);
    }
    return Result.success(map);
  }
@@ -402,7 +407,7 @@
  @PostMapping("/WriteGlassID")
  public Result WriteGlassID(String glassid) {
    // 扫码位写入玻璃id
    spianService.outmesid(glassid, "DB103.256");
    spianService.outmesid(glassid, "DB103.286");
    Map<String, Object> map = new HashMap<>();
    map.put("message", "200");
    return Result.success(map);
@@ -454,8 +459,8 @@
  // 切换PLC获取二维码方式
  @PostMapping("/SwitchScanMethod")
  public Result SwitchScanMethod(Short scansmethod) {
    S7control.getinstance().WriteWord("DB103.255", scansmethod);
  public Result SwitchScanMethod(Boolean scansmethod) {
    S7control.getinstance().WriteBit("DB101.11.4", scansmethod);
    Map<String, Object> map = new HashMap<>();
    map.put("message", "200");
    return Result.success(map);