helongyang
15 小时以前 06eb604f71605c47f015b88b1620b72b6f69df8c
功能增加,代码优化
已修改27个文件
已添加2个文件
2818 ■■■■■ 文件已修改
代码管理/WCS/WIDESEAWCS_Client/src/views/Home.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Client/src/views/Login.vue 1182 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Client/src/views/deviceMonitoring/BoardWarehouse.vue 360 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Client/src/views/deviceMonitoring/TestFrameWarehouse.vue 411 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/板材仓/BCReadData.cs 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/板材仓/StackerCraneJob_BC.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/测试架仓/CSJReadData.cs 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/测试架仓/GroundStationJob_CSJ.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/测试架仓/StackerCraneJob_CSJ.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/extension/outbound/outboundOrderDetail.js 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/extension/stock/stockInfo.js 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/extension/stock/stockInfoDetail.js 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/extension/taskinfo/task.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/views/inbound/inboundOrder.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/views/inbound/inboundOrderDetail.vue 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/views/outbound/outboundOrder.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/views/outbound/outboundOrderDetail.vue 148 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/views/stock/stockInfo.vue 54 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/views/stock/stockInfoDetail.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/APIEnum/APIEnum.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs 246 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Completed.cs 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Reloaction.cs 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Client/src/views/Home.vue
@@ -39,13 +39,12 @@
  setup() {
    // å®šä¹‰ä»“库列表
    const warehouses = [
      { name: '板材仓', component: BoardWarehouse },
      { name: '测试架仓', component: TestFrameWarehouse },
      { name: '阻焊仓', component: SolderMaskWarehouse },
      { name: 'PP仓', component: PpWarehouse },
      { name: '板材仓', component: BoardWarehouse },
      { name: '测试架仓', component: TestFrameWarehouse },
      { name: '油墨仓', component: InkWarehouse },
      { name: '辅料仓', component: AuxiliaryWarehouse },
      { name: '成品仓', component: BoardWarehouse },
      { name: '干膜仓', component: DryFilmWarehouse},
    ];
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Client/src/views/Login.vue
@@ -1,864 +1,408 @@
<template>
  <div id="vol-container" :class="['vol-theme-' + theme]">
    <div class="vol-aside" :style="{ width: menuWidth + 'px' }">
      <div class="header" :style="{ width: menuWidth - 1 + 'px' }">
        <img v-show="!isCollapse" v-bind:src="logo" />
        <i
          @click="toggleLeft"
          class="collapse-menu"
          :class="isCollapse ? 'el-icon-s-unfold' : 'el-icon-s-fold'"
        />
      </div>
      <div class="vol-menu">
        <el-scrollbar style="height: 100%">
          <VolMenu
            :currentMenuId="currentMenuId"
            :on-select="onSelect"
            :enable="true"
            :open-select="false"
            :isCollapse="isCollapse"
            :list="menuOptions"
          ></VolMenu>
        </el-scrollbar>
      </div>
    </div>
    <div class="vol-container" :style="{ left: menuWidth - 1 + 'px' }">
      <div class="vol-header">
        <div class="project-name">WMS</div>
        <div class="header-text">
          <div class="h-link">
            <a
              href="javascript:void(0)"
              @click="to(item)"
              v-for="(item, index) in links.filter((c) => {
                return !c.icon;
              })"
              :key="index"
            >
              <span v-if="!item.icon">{{ item.text }}</span>
              <i v-else :class="item.icon"></i>
            </a>
          </div>
        </div>
        <div class="header-info">
          <div class="h-link">
            <a
              href="javascript:void(0)"
              @click="to(item)"
              v-for="(item, index) in links.filter((c) => {
                return c.icon;
              })"
              :key="index"
            >
              <span v-if="!item.icon">{{ item.text }}</span>
              <i v-else :class="item.icon"></i>
            </a>
          </div>
          <!--消息管理-->
          <div class="h-link" @click="messageModel = true">
            <a>
              <i class="el-icon-message-solid">
                <el-badge
                  :value="messageList.length"
                  :type="messageList.length > 0 ? 'danger' : 'success'"
                  class="item"
                  style="width: 10px"
                ></el-badge>
              </i>
            </a>
          </div>
  <div class="login-container">
    <div class="project-name">WIDESEA_WMS</div>
    <div class="login-form">
      <div class="form-user" @keypress="loginPress">
        <div class="login-text">
          <div>
            <img class="user-header" :src="userImg" :onerror="errorImg" />
            <div>欢迎登录...</div>
            <div class="login-line"></div>
          </div>
          <div class="user">
            <span>{{ userName }}</span>
            <span id="index-date"></span>
          </div>
          <div class="settings">
            <i style="font-size: 20px" class="el-icon-s-tools" @click="drawer_model = true" />
          </div>
          <div style="flex: 1"></div>
        </div>
      </div>
      <div class="vol-path">
        <el-tabs
          @tab-click="selectNav"
          @tab-remove="removeNav"
          @contextmenu.prevent="bindRightClickMenu(false)"
          type="border-card"
          class="header-navigation"
          v-model="selectId"
          :strtch="false"
        >
          <el-tab-pane
            v-for="(item, navIndex) in navigation"
            type="card"
            :name="navIndex + ''"
            :closable="navIndex > 0"
            :key="navIndex"
            :label="item.name"
          >
            <span style="display: none">{{ navIndex }}</span>
          </el-tab-pane>
        </el-tabs>
        <!-- å³é”®èœå• -->
        <div v-show="contextMenuVisible">
          <ul :style="{ left: menuLeft + 'px', top: menuTop + 'px' }" class="contextMenu">
            <li v-show="visibleItem.all">
              <el-button link @click="closeTabs()">
                <i class="el-icon-close"></i>
                {{
                navigation.length == 2 ? "关闭菜单" : "关闭所有"
                }}
              </el-button>
            </li>
            <li v-show="visibleItem.left">
              <el-button link @click="closeTabs('left')">
                <i class="el-icon-back"></i>关闭左边
              </el-button>
            </li>
            <li v-show="visibleItem.right">
              <el-button link @click="closeTabs('right')">
                <i class="el-icon-right"></i>关闭右边
              </el-button>
            </li>
            <li v-show="visibleItem.other">
              <el-button link @click="closeTabs('other')">
                <i class="el-icon-right"></i>关闭其他
              </el-button>
            </li>
          </ul>
        <div class="login-text-small">WELCOME TO LOGIN</div>
        <div class="item">
          <div class="input-icon el-icon-user"></div>
          <input
            type="text"
            v-focus
            v-model="userInfo.userName"
            placeholder="请输入账号"
          />
        </div>
      </div>
      <div class="vol-main" id="vol-main">
        <el-scrollbar style="height: 100%" v-if="permissionInited">
          <loading v-show="$store.getters.isLoading()"></loading>
          <router-view v-slot="{ Component }">
            <keep-alive>
              <component
                :is="Component"
                :key="$route.name"
                v-if="
                  !$route.meta ||
                  ($route.meta && !$route.meta.hasOwnProperty('keepAlive'))
                "
              />
            </keep-alive>
            <component
              :is="Component"
              :key="$route.name"
              v-if="$route.meta && $route.meta.hasOwnProperty('keepAlive')"
            />
          </router-view>
        </el-scrollbar>
      </div>
    </div>
    <el-drawer title="选择主题" v-model="drawer_model" direction="rtl" destroy-on-close>
      <div class="theme-selector">
        <div
          @click="changeTheme(item.name)"
          class="item"
          v-for="(item, index) in theme_color"
          :key="index"
          :style="{ background: item.color }"
        >
          <div
            v-show="item.leftColor"
            :style="{ background: item.leftColor }"
            style="height: 100%; width: 20px"
            class="t-left"
          ></div>
          <div class="t-right"></div>
        <div class="item">
          <div class="input-icon el-icon-lock"></div>
          <input
            type="password"
            v-focus
            v-model="userInfo.password"
            placeholder="请输入密码"
          />
        </div>
      </div>
    </el-drawer>
        <div class="item">
          <div class="input-icon el-icon-mobile"></div>
    <el-drawer title="消息列表" v-model="messageModel" direction="rtl" destroy-on-close size="40%">
      <Message :list="messageList"></Message>
    </el-drawer>
          <input
            v-focus
            type="text"
            v-model="userInfo.verificationCode"
            placeholder="输入验证码"
          />
          <div class="code" @click="getVierificationCode">
            <img v-show="codeImgSrc != ''" :src="codeImgSrc" />
          </div>
        </div>
      </div>
      <div class="loging-btn">
        <el-button
          size="large"
          :loading="loading"
          color="#3a6cd1"
          :dark="true"
          @click="login"
          long
        >
          <span v-if="!loading">登录</span>
          <span v-else>正在登录...</span>
        </el-button>
      </div>
      <!-- è´¦å·ä¿¡æ¯ -->
      <!-- <div class="account-info">
        <p>演示账号:admin666 &nbsp; &nbsp;密码:123456</p>
        <p>本地账号:admin &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;密码:123456</p>
        <p><a href="https://jq.qq.com/?_wv=1027&k=Sqstuy0M" style="text-decoration: none"
            target="_blank">QQ3群:743852316</a>
          &nbsp; &nbsp;&nbsp; &nbsp;
          <a href="http://v2.volcore.xyz/document/guide" style="text-decoration: none" target="_blank">框架文档</a>
        </p>
      </div> -->
      <!-- é“¾æŽ¥ä½ç½® -->
      <!-- <div class="app-link" >
        <a href="#" style="text-decoration: none">移动端扫码</a>
        <a>
          <i class="el-icon-chat-dot-round"></i> å°ç¨‹åº
          <img src="https://app-1256993465.cos.ap-nanjing.myqcloud.com/wechat.jpg" /></a>
        <a>
          <i class="el-icon-apple"></i>
          Android
          <img src="https://app-1256993465.cos.ap-nanjing.myqcloud.com/Android.png" /></a>
        <a>
          <i class="el-icon-document"></i>
          H5
          <img src="https://app-1256993465.cos.ap-nanjing.myqcloud.com/H5.png" /></a>
      </div> -->
    </div>
    <!-- é¡µé¢åº•部 -->
    <!-- <div class="login-footer">
      <a style="text-decoration: none" href="https://beian.miit.gov.cn/" target="_blank">京ICP备19056538号-1</a>
      <a href="https://dotnet9.com/" style="text-decoration: none" target="blank">Dotnet9</a>
      <a href="https://space.bilibili.com/525836469" style="text-decoration: none" target="blank">NET视频教程(微软MVP-ACE录制)</a>
      <a href="https://www.cctalk.com/m/group/90268531" style="text-decoration: none" target="blank">VOL框架视频</a>
      <a href="http://120.48.115.252:9990" style="text-decoration: none" target="blank">视频演示地址</a>
    </div> -->
    <img class="login-bg" src="/static/login_bg.png" />
  </div>
</template>
<style lang="less" scoped>
@import "./index/index.less";
</style>
<script>
import loading from "@/components/basic/RouterLoading";
import VolMenu from "@/components/basic/VolElementMenu.vue";
import Message from "./index/Message.vue";
import MessageConfig from "./index/MessageConfig.js";
var imgUrl = require("@/assets/imgs/wms_x.png");
var $this;
var $interval;
var $indexDate;
<script >
import {
  defineComponent,
  reactive,
  ref,
  watch,
  onMounted,
  reactive,
  toRefs,
  getCurrentInstance,
  h
} from "vue";
import { useRouter, useRoute } from "vue-router";
import store from "../store/index";
import http from "@/../src/api/http.js";
import { ElNotification } from "element-plus";
import { useStore } from "vuex";
export default defineComponent({
  components: {
    VolMenu,
    loading,
    Message
  },
  data() {
    return {
      allTabs: true,
      leftTabs: true,
      rightTabs: true,
      otherTabs: true,
      menuLeft: 0,
      menuTop: 0
    };
  },
  setup(props, context) {
    let client = ref(null);
    // èŠ‚æµç›¸å…³å˜é‡ï¼ˆå»¶è¿Ÿæ—¶é—´å»ºè®®300-500ms,根据后端推送频率调整)
    const THROTTLE_DELAY = 300; // å»¶è¿Ÿæ›´æ–°æ—¶é—´ï¼ˆæ¯«ç§’)
    let lastUpdateTime = ref(0); // ä¸Šä¸€æ¬¡æ›´æ–°æ—¶é—´
    let latestWsData = ref(null); // ç¼“存最新的WebSocket数据
    let throttleTimer = ref(null); // èŠ‚æµå®šæ—¶å™¨
    // èŽ·å–å…¨å±€å±žæ€§å’Œæ–¹æ³•
    const { proxy } = getCurrentInstance();
    // èœå•导航默认宽度
    const menuWidth = ref(200);
    const contextMenuVisible = ref(false);
    const isCollapse = ref(false);
    const drawer_model = ref(false);
    const messageModel = ref(false);
    const theme_color = ref([
      { name: "blue", color: "rgb(45, 140, 240)" },
      { name: "blue2", color: "rgb(45, 140, 240)", leftColor: "#0068d6" },
      { name: "red", color: "rgb(237, 64, 20)" },
      { name: "red2", color: "rgb(237, 64, 20)", leftColor: "#a90000" },
      { name: "dark", color: "#272929" },
      { name: "orange", color: "#ff9900" },
      { name: "orange2", color: "#ff9900", leftColor: "rgb(232 141 5)" },
      { name: "green", color: "rgb(25, 190, 107)" },
      { name: "green2", color: "rgb(25, 190, 107)", leftColor: "#019e4f" },
      { name: "white", color: "#fff" }
    ]);
    const links = ref([
      { text: "个人中心", path: "/UserInfo", id: -1, icon: "el-icon-s-custom" },
      {
        text: "安全退出",
        path: "/login",
        id: -4,
        icon: "el-icon-switch-button"
      }
    ]);
    const errorImg = ref(
      'this.src="' + require("@/assets/imgs/error-img.png") + '"'
    );
    const selectId = ref("1");
    // ã€é¦–页】标签序号(当前右键选中的菜单)
    const selectMenuIndex = ref("0");
    //2022.05.29增加tab选项与菜单联动功能
    const currentMenuId = ref(0);
    const userName = ref("--");
    const userTrueName = ref("--");
    const userInfo = ref({});
    const visibleItem = reactive({
      left: false,
      right: false,
      all: false,
      other: false
    store.commit("clearUserInfo", "");
    const loading = ref(false);
    const codeImgSrc = ref("");
    const userInfo = reactive({
      userName: "",
      password: "",
      verificationCode: "",
      UUID: undefined,
    });
    const userImg = ref("");
    const navigation = reactive([
      { orderNo: "0", id: "1", name: "首页", path: "/home" }
    ]);
    const logo = ref(imgUrl);
    const theme = ref("blue2");
    const menuOptions = ref([]);
    const permissionInited = ref(false);
    const messageList = reactive([]);
    let _config = getCurrentInstance().appContext.config.globalProperties;
    const getVierificationCode = () => {
      http.get("/api/User/getVierificationCode").then((x) => {
        codeImgSrc.value = "data:image/png;base64," + x.img;
        userInfo.UUID = x.uuid;
      });
    };
    getVierificationCode();
    let appContext = getCurrentInstance().appContext;
    let $message = appContext.config.globalProperties.$message;
    let router = useRouter();
    const toggleLeft = () => {
      isCollapse.value = !isCollapse.value;
      menuWidth.value = isCollapse.value ? 63 : 200;
    };
    //2021.08.28开放手动折叠菜单方法
    _config.menu = {
      show() {
        toggleLeft();
      },
      hide() {
        toggleLeft();
    const login = () => {
      if (!userInfo.userName) return $message.error("请输入用户名");
      if (!userInfo.password) return $message.error("请输入密码");
      if (!userInfo.verificationCode) {
        return $message.error("请输入验证码");
      }
    };
    const Store = useStore();
    const s = ref(null);
    // èŠ‚æµå¤„ç†WebSocket数据(核心逻辑)
    const handleThrottledWsData = (rawData) => {
      // ç¼“存最新数据(确保最终更新用的是最新值)
      latestWsData.value = rawData;
      const now = Date.now();
      // æƒ…况1:距离上次更新超过延迟时间,直接处理
      if (now - lastUpdateTime.value >= THROTTLE_DELAY) {
        processAndUpdateData();
        lastUpdateTime.value = now;
      }
      // æƒ…况2:未超过延迟时间,用定时器延迟处理(避免重复触发)
      else {
        if (throttleTimer.value) clearTimeout(throttleTimer.value);
        throttleTimer.value = setTimeout(() => {
          processAndUpdateData();
          lastUpdateTime.value = Date.now();
        }, THROTTLE_DELAY);
      }
    };
    // ç»Ÿä¸€å¤„理并更新数据(避免重复代码)
    const processAndUpdateData = () => {
      if (!latestWsData.value) return;
      try {
        // è§£æžWebSocket数据
        const parsedData = typeof latestWsData.value === 'string'
          ? JSON.parse(latestWsData.value)
          : latestWsData.value;
      loading.value = true;
      http.post("/api/User/login", userInfo, "正在登录....").then((result) => {
        if (!result.status) {
          loading.value = false;
          getVierificationCode();
          return $message.error(result.message);
        }
        $message.success("登录成功,正在跳转!");
        store.commit("setUserInfo", result.data);
        
        // 1. æ›´æ–°Vuex中的homedata
        store.dispatch("sethomedata", parsedData);
        // 2. å¤„理消息列表
        if (parsedData.title && parsedData.message) {
          messageList.push(parsedData);
          // æ˜¾ç¤ºé€šçŸ¥
          ElNotification({
            title: parsedData.title,
            message: h("i", { style: "color: teal" }, parsedData.message),
            position: "bottom-right"
          });
        }
      } catch (err) {
        console.error("WebSocket数据处理失败:", err);
      }
    };
    // WebSocket连接逻辑(使用节流处理数据)
    const createSocket = url => {
      // å…³é—­å·²æœ‰è¿žæŽ¥ï¼ˆé¿å…é‡å¤è¿žæŽ¥ï¼‰
      if (client.value) {
        client.value.close();
      }
      // åˆ›å»ºWebSocket连接
      client.value = new WebSocket("ws:localhost:9260/");
      client.value.onopen = function() {
        console.log("WebSocket è¿žæŽ¥æˆåŠŸ");
      };
      // æ”¶åˆ°æ¶ˆæ¯åŽäº¤ç»™èŠ‚æµå‡½æ•°å¤„ç†
      client.value.onmessage = function(event) {
        if (event && event.data) {
          handleThrottledWsData(event.data);
        }
      };
      client.value.onclose = function() {
        console.log("WebSocket è¿žæŽ¥å…³é—­");
        // é‡è¿žé€»è¾‘
        setTimeout(() => createSocket(url), 5000);
      };
      client.value.onerror = function(err) {
        console.log("WebSocket è¿žæŽ¥é”™è¯¯: ", err);
        // é”™è¯¯åŽé‡è¿ž
        setTimeout(() => createSocket(url), 5000);
      };
    };
    const changeTheme = name => {
      if (theme.value != name) {
        theme.value = name;
      }
      localStorage.setItem("vol3_theme", name);
    };
    const to = item => {
      if (item.path == "#") {
        window.open("https://github.com/cq-panda/Vue.NetCore");
        return;
      }
      if (item.path.indexOf("http") != -1) {
        window.open(item.path);
        return;
      }
      if (typeof item == "string" || item.path == "/login") {
        if (item == "/login" || item.path == "/login") {
          store.commit("clearUserInfo", "");
          window.location.href = "/";
          return;
        }
        router.push({ path: item });
        return;
      }
      if (item.path == "#") return;
      open(item);
    };
    const open = (item, useRoute) => {
      let _index = navigation.findIndex(x => {
        return x.path == item.path;
      });
      if (_index == -1) {
        navigation.push({
          id: item.id + "",
          name: item.name || item.text || "无标题",
          path: item.path,
          query: item.query
        });
        selectId.value = navigation.length - 1 + "";
      } else {
        selectId.value = _index + "";
      }
      if (useRoute === undefined) {
        setItem(item);
        router.push(item);
      }
      currentMenuId.value = item.id * 1;
      // tab菜单绑定右键事件
      proxy.$nextTick(function(e) {
        proxy.bindRightClickMenu(true);
        router.push({ path: "/" });
      });
    };
    const close = path => {
      let index = navigation.findIndex(x => {
        return x.path == path;
      });
      if (index == -1) {
        return _config.$Message.error("未找到菜单");
    const loginPress = (e) => {
      if (e.keyCode == 13) {
        login();
      }
      removeNav(index);
    };
    const setItem = item => {
      localStorage.setItem(
        window.location.origin + "_tabs",
        JSON.stringify(item)
      );
    const openUrl = (url) => {
      window.open(url, "_blank");
    };
    const getItem = () => {
      let nav = localStorage.getItem(window.location.origin + "_tabs");
      return nav ? JSON.parse(nav) : null;
    };
    const selectNav = item => {
      selectId.value = item.props.name;
      let _path = navigation[item.index].path;
      currentMenuId.value = (
        menuOptions.value.find(c => {
          return c.path == _path;
        }) || { id: 0 }
      ).id;
      router.push({
        path: navigation[item.index].path,
        query: navigation[item.index].query
      });
    };
    const removeNav = _index => {
      return new Promise(() => {
        //关闭的当前项,跳转到前一个页面
        if (selectId.value == _index + "") {
          setItem(navigation[_index - 1]);
          router.push({
            path: navigation[_index - 1].path,
            query: navigation[_index - 1].query
          });
          navigation.splice(_index, 1);
          selectId.value = selectId.value - 1 + "";
          return;
        }
        if (_index < selectId.value) {
          selectId.value = selectId.value - 1 + "";
        }
        navigation.splice(_index, 1);
        currentMenuId.value = (
          menuOptions.value.find(c => {
            return c.path == navigation[selectId.value * 1].path;
          }) || { id: 0 }
        ).id;
      });
    };
    const getSelectMenuName = id => {
      return menuOptions.value.find(function(x) {
        return x.id == id;
      });
    };
    const onSelect = treeId => {
      var item = getSelectMenuName(treeId);
      open(item, false);
    };
    /**
     * æ˜¾ç¤ºå³é”®èœå•
     */
    const openTabsMenu = function(e) {
      e.preventDefault();
      let tabId = e.target.id.split("-")[1] * 1;
      //记录当前选中的菜单index
      selectMenuIndex.value =
        document.getElementById("pane-" + tabId).children[0].textContent * 1;
      //只有首页时不显示
      if (navigation.length == 1) {
        return;
      }
      //首页设置显示关闭右边菜单
      if (!selectMenuIndex.value) {
        visibleItem.all = false;
        visibleItem.right = true;
        visibleItem.left = false;
        visibleItem.other = false;
      } else {
        visibleItem.all = true;
        //不是最后一个显示关闭右边菜单
        visibleItem.right = selectMenuIndex.value != navigation.length - 1;
        //只有两个菜单时不显示关闭左边
        visibleItem.left = navigation.length != 2;
        //只有两个菜单时不显示关闭其他
        visibleItem.other = navigation.length != 2;
      }
      contextMenuVisible.value = true;
      // è®¾ç½®å³é”®èœå•显示的位置
      proxy.menuLeft =
        e.target.getBoundingClientRect().left - (isCollapse.value ? 63 : 198);
      proxy.menuTop = 36;
    };
    /**
     * å…³é—­å³é”®èœå•
     */
    const closeTabsMenu = () => {
      contextMenuVisible.value = false;
    };
    const toHome = () => {
      open({
        text: navigation[0].name,
        path: navigation[0].path
      });
    };
    /**
     * å…³é—­å…¶å®ƒæ ‡ç­¾é¡µ
     */
    const closeTabs = value => {
      let _menuId = navigation[selectId.value * 1].id;
      let currnetIndex = selectId.value * 1;
      switch (value) {
        case "left": {
          // åˆ é™¤å·¦ä¾§tab标签
          navigation.splice(1, currnetIndex - 1);
          break;
        }
        case "right": {
          // åˆ é™¤å³ä¾§tab标签
          if (selectMenuIndex.value == 0) {
            navigation.splice(currnetIndex);
            toHome();
          } else {
            navigation.splice(currnetIndex + 1);
            if (selectMenuIndex.value < currnetIndex) {
              navigation.splice(
                selectMenuIndex.value,
                currnetIndex - selectMenuIndex.value
              );
            }
          }
          break;
        }
        case "other": {
          // åˆ é™¤å…¶ä»–所有tab标签
          navigation.splice(currnetIndex + 1);
          navigation.splice(1, currnetIndex - 1);
          break;
        }
        default: {
          //关闭所有
          navigation.splice(1, navigation.length);
          toHome();
          break;
        }
      }
      selectId.value =
        navigation.findIndex(c => {
          return c.id == _menuId;
        }) + "";
      closeTabsMenu();
    };
    watch(
      () => contextMenuVisible.value,
      (newVal, oldVal) => {
        if (newVal) {
          document.body.addEventListener("click", closeTabsMenu);
        } else {
          document.body.removeEventListener("click", closeTabsMenu);
        }
      }
    );
    /**
     * ç³»ç»Ÿåˆ›å»ºå¼€å§‹
     */
    const created = () => {
      let _theme = localStorage.getItem("vol3_theme");
      if (_theme) {
        theme.value = _theme;
      }
      let _userInfo = store.getters.getUserInfo();
      if (_userInfo) {
        userName.value = _userInfo.userName;
        userTrueName.value = _userInfo.userTrueName;
        if (_userInfo.img) {
          userImg.value = _config.base.getImgSrc(_userInfo.img, http.ipAddress);
        }
      }
      createSocket(window.webConfig.webSocketUrl);
      Object.assign(_config.$tabs, { open: open, close: close });
      http.get("api/Sys_Menu/getTreeMenu", {}, true).then(data => {
        data.push({ id: "1", name: "首页", url: "/home" });
        data.forEach(d => {
          d.path = (d.url || "").replace("/Manager", "");
          d.to = (d.url || "").replace("/Manager", "");
          if (!d.icon || d.icon.substring(0, 3) != "el-") {
            d.icon = "el-icon-menu";
          }
        });
        store.dispatch("setPermission", data);
        menuOptions.value = data;
        permissionInited.value = true;
        //开启消息推送
        if (_config.$global.signalR) {
          MessageConfig(http, result => {
            messageList.unshift(result);
          });
        }
        //当前刷新是不是首页
        if (router.currentRoute.value.path != navigation[0].path) {
          //查找系统菜单
          let item = menuOptions.value.find(x => {
            return x.path == router.currentRoute.value.path;
          });
          if (item) return onSelect(item.id);
          //查找顶部快捷连接
          item = links.value.find(x => {
            return x.path == router.currentRoute.value.path;
          });
          //查找最后一次跳转的页面
          if (!item) {
            item = getItem();
          }
          if (item) {
            return open(item, false);
          }
        }
        selectId.value = "1";
      });
    };
    created();
    return {
      menuWidth,
      isCollapse,
      drawer_model,
      theme_color,
      errorImg,
      loading,
      codeImgSrc,
      getVierificationCode,
      login,
      userInfo,
      userName,
      userTrueName,
      userImg,
      selectId,
      selectMenuIndex,
      navigation,
      links,
      onSelect,
      openTabsMenu,
      selectNav,
      getSelectMenuName,
      removeNav,
      logo,
      theme,
      menuOptions,
      permissionInited,
      changeTheme,
      to,
      toggleLeft,
      messageModel,
      messageList,
      contextMenuVisible,
      visibleItem,
      closeTabsMenu,
      closeTabs,
      currentMenuId
      loginPress,
      openUrl,
    };
  },
  /**
   * æŒ‚载钩子函数
   */
  mounted() {
    let _date = showTime();
    $indexDate = document.getElementById("index-date");
    $indexDate.innerText = _date;
    $interval = setInterval(function() {
      $indexDate.innerText = showTime();
    }, 1000);
    this.bindRightClickMenu(true);
  directives: {
    focus: {
      inserted: function (el) {
        el.focus();
      },
    },
  },
});
</script>
<style lang="less" scoped>
.login-container {
  display: flex;
  width: 100%;
  height: 100%;
  background: rgb(246, 247, 252);
  justify-content: flex-end;
  align-items: center;
}
  methods: {
    /**
     * ç»‘定右键事件
     */
    bindRightClickMenu(enable) {
      if (!enable) return;
      let that = this;
      // ä½¿ç”¨åŽŸç”Ÿjs ä¸ºå•个dom绑定鼠标右击事件
      that.$nextTick(() => {
        let tab_top_dom = Object.assign(
          [],
          document.getElementsByClassName("el-tabs__item is-top")
        );
        tab_top_dom.forEach((item, index) => {
          item.oncontextmenu = that.openTabsMenu;
        });
      });
    }
  },
.login-form {
  align-items: center;
  width: 50%;
  display: flex;
  flex-direction: column;
  // margin-right: 150px;
  z-index: 999;
  /**
   * é”€æ¯é’©å­å‡½æ•°
   */
  destroyed() {
    $this = null;
    clearInterval($interval);
    // å…³é—­WebSocket连接
    if (client && client.value) {
      client.value.close();
  .form-user {
    // margin: 25px 0;
    .item {
      border-radius: 5px;
      border: 1px solid #ececec;
      display: flex;
      margin-bottom: 30px;
      background: #ffff;
      height: 45px;
      padding-left: 20px;
      display: flex;
      .code {
        position: relative;
        cursor: pointer;
        width: 74px;
        padding: 5px 10px 0 0;
      }
      .input-icon {
        line-height: 45px;
        color: #7a7a7a;
        padding-right: 20px;
      }
    }
  }
});
const week = new Array(
  "星期一",
  "星期二",
  "星期三",
  "星期四",
  "星期五",
  "星期六",
  "星期日"
);
function showTime() {
  let date = new Date();
  let year = date.getFullYear();
  let month = date.getMonth() + 1;
  let day = date.getDate();
  let hour = date.getHours();
  let minutes = date.getMinutes();
  let second = date.getSeconds();
  return (
    year +
    "." +
    (month < 10 ? "0" + month : month) +
    "." +
    (day < 10 ? "0" + day : day) +
    "" +
    " " +
    (hour < 10 ? "0" + hour : hour) +
    ":" +
    (minutes < 10 ? "0" + minutes : minutes) +
    ":" +
    (second < 10 ? "0" + second : second) +
    " " +
    (week[date.getDay() - 1] || week[6])
  );
  input:-webkit-autofill {
    box-shadow: 0 0 0px 1000px white inset;
    -webkit-box-shadow: 0 0 0px 1000px white inset !important;
  }
  input {
    background: white;
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    color: #323233;
    line-height: inherit;
    text-align: left;
    border: 0;
    outline: none;
    font-size: 16px;
    line-height: 20px;
  }
}
</script>
.form-user,
.loging-btn {
  width: 400px;
}
.loging-btn {
  box-shadow: 2px 4px 11px #a4c2ff;
  margin-top: 10px;
  button {
    padding: 21px;
    font-size: 14px !important;
    width: 100%;
  }
}
.login-text {
  font-weight: bolder;
  font-size: 20px;
  letter-spacing: 2px;
  position: relative;
  display: flex;
  .login-line {
    z-index: -1;
    padding: 5px;
    position: relative;
    top: -8px;
    width: 100%;
    background-image: linear-gradient(to right, #6598ff, white);
  }
}
.login-text-small {
  margin-bottom: 20px;
  font-size: 13px;
  color: #7d7c7c;
}
.login-bg {
  left: 0;
  position: absolute;
  height: 100%;
  width: 50%;
  z-index: 0;
}
.project-name {
  position: absolute;
  top: 40px;
  left: 40px;
  z-index: 9999;
  font-weight: bolder;
  background-image: linear-gradient(to right, #1850c1, #9c009c);
  -webkit-background-clip: text;
  color: transparent;
  font-size: 25px;
}
</style>
<style lang="less" scoped>
.app-link {
  // font-weight: bolder;
  text-align: center;
  padding-top: 5px;
  font-size: 12px;
  width: 400px;
  padding-left: 40px;
  display: flex;
  a {
    flex: 1;
    position: relative;
    cursor: pointer;
    width: 70px;
    color: #666666;
    margin: 2px 10px 0 0;
  }
  img {
    display: none;
  }
  a:hover {
    color: #0545f6 !important;
    img {
      display: block;
      position: absolute;
      z-index: 999999999;
      top: -130px;
      width: 120px;
      left: -22px;
      border: 1px solid #b1b1b1;
    }
  }
}
.login-footer {
  position: absolute;
  width: 50%;
  bottom: 0.5rem;
  font-size: 12px;
  text-align: center;
  padding-bottom: 10px;
  color: #4f4f4f;
  a {
    margin-right: 10px;
    font-size: 12px;
    color: #4f4f4f;
  }
  div {
    margin-bottom: 5px;
  }
  a:hover {
    cursor: pointer;
    color: #0540e3 !important;
  }
}
.account-info {
  font-size: 12px;
  color: #636363;
  margin-top: 15px;
}
</style>
<style lang="less" scoped>
.vol-container .vol-path ::v-deep(.el-tabs__content) {
  padding: 0;
}
@media screen and (max-width: 700px) {
  .login-bg,
  .account-info,
  .app-link,
  .login-footer,
  .project-name {
    display: none;
  }
.item {
  margin-top: -20px;
  margin-right: 40px;
}
  .login-container {
    padding: 2rem;
    justify-content: center;
  }
.contextMenu {
  width: 120px;
  margin: 0;
  border: 1px solid #eaeaea;
  background: #fff;
  z-index: 30000;
  position: absolute;
  list-style-type: none;
  padding: 5px 0;
  border-radius: 4px;
  font-size: 14px;
  color: #333;
  box-shadow: 2px 2px 3px 0 rgb(182 182 182 / 20%);
  i,
  button {
    font-size: 14px !important;
  .login-form {
    width: 100%;
  }
  .form-user,
  .loging-btn {
    width: 100%;
  }
}
.contextMenu li {
  margin: 0;
  padding: 5px 17px;
}
.contextMenu li:hover {
  background: #fafafa;
  cursor: pointer;
}
.contextMenu li button {
  color: #626060;
  font-size: 14px;
  letter-spacing: 1px;
}
.el-tabs.el-tabs--top.el-tabs--border-card.header-navigation
  > .el-tabs__header
  .el-tabs__item:last-child,
.el-tabs--top.el-tabs--border-card.header-navigation
  > .el-tabs__header
  .el-tabs__item:nth-child(2) {
  padding: 0;
}
.header-navigation ::v-deep(.el-tabs__item.is-top) {
  padding: 0 15px;
}
</style>
<style>
.horizontal-collapse-transition {
  transition: 0s width ease-in-out, 0s padding-left ease-in-out,
    0s padding-right ease-in-out;
}
</style>
</style>
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Client/src/views/deviceMonitoring/BoardWarehouse.vue
@@ -1,45 +1,341 @@
<template>
  <div class="message-container">
    <div class="item" v-for="(item, index) in list" :key="index">
      <div class="title">{{ item.title }}({{ item.date }})</div>
      <div class="content">{{ item.message }}</div>
  <div id="title">
    <div id="bkuang" style="border-top: none">
      <!-- BC仓堆垛机状态面板 -->
      <div class="skuang">
        <div class="bcuname">板料仓堆垛机</div>
        <div class="bcankuang">
          <div class="xname">堆垛机状态:</div>
          <div class="xbci" :title="bcData.R_BC_Status">{{ bcData.R_BC_Status || '-' }}</div>
        </div>
        <div class="bcankuang">
          <div class="xname">堆垛机手自动状态:</div>
          <div class="xbci" :title="bcData.R_BC_AutoStatus">{{ bcData.R_BC_AutoStatus || '-' }}</div>
        </div>
        <div class="bcankuang">
          <div class="xname">正在执行的任务号:</div>
          <div class="xbci" :title="bcData.R_BC_TaskNum">{{ bcData.R_BC_TaskNum || '-' }}</div>
        </div>
        <div class="bcankuang">
          <div class="xname">堆垛机工作状态:</div>
          <div class="xbci" :title="bcData.R_BC_WorkStatus">{{ bcData.R_BC_WorkStatus || '-' }}</div>
        </div>
        <div class="bcankuang">
          <div class="xname">作业类型:</div>
          <div class="xbci" :title="bcData.R_BC_WorkType">{{ bcData.R_BC_WorkType || '-' }}</div>
        </div>
        <div class="bcankuang">
          <div class="xname">托盘类型:</div>
          <div class="xbci" :title="bcData.R_BC_TrayType">{{ bcData.R_BC_TrayType || '-' }}</div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { ref, nextTick, watch, onUnmounted } from "vue";
import { useStore } from "vuex";
import { onMounted } from "vue";
export default {
  props: {
    list: {
      type: Array,
      default: () => {
        return [];
      }
    }
  data() {
    return {
      xuan: 0
    };
  },
  created() {
    if (!this.list.length) {
      this.list.push({
        title: '消息测试标qweqweqweqw题',
        message: '消息测试内容消息测试内容消息测试内容消息测试内容',
        date: '2022-05-02 03:10'
  setup() {
    const store = useStore();
    // ä»…存储BC数据,与其他数据隔离
    const bcData = ref({});
    // å»¶è¿Ÿæ›´æ–°é…ç½®ï¼Œè§£å†³é—ªçƒé—®é¢˜
    const UPDATE_DELAY = 300; // å»¶è¿Ÿ300ms更新UI
    let updateTimer = null;   // å®šæ—¶å™¨å®žä¾‹
    // BC数据映射规则
    const bcStatusMap = {
      R_BC_Status: {
        1: "正常",
        2: "故障",
        3: "急停",
      },
      R_BC_AutoStatus: {
        0: "ç»´ä¿®",
        1: "手动",
        2: "半自动",
        3: "自动",
      },
      R_BC_WorkStatus: {
        0: "待机",
        1: "取货中",
        2: "取货完成",
        4: "放货中",
        5: "放货完成",
        6: "任务完成",
      },
      R_BC_WorkType: {
        0: "无作业任务(0)",
        1: "取放货作业(1)",
        2: "只取货作业(2)",
        3: "只放货作业(3)",
        4: "移动到指定位置"
      },
      R_BC_TrayType: {
        "-1": "空箱(-1)",
        1: "小托盘(1)",
        2: "中托盘(2)",
        3: "大托盘(3)",
        4: "特大托盘(4)",
      }
    };
    // BC字段分组
    const bcFieldGroups = {
      permissionFields: {
        keys: ["R_BC_IsCanPut1", "R_BC_IsCanTake1", "R_BC_IsCanPut2", "R_BC_IsCanTake2",
               "R_BC_IsCanPut3", "R_BC_IsCanTake3", "R_BC_IsCanPut4", "R_BC_IsCanTake4"],
        map: { true: "是", false: "否" }
      },
      requestFields: {
        keys: ["W_BC_PutRequest1", "W_BC_TakeRequest1", "W_BC_PutRequest2", "W_BC_TakeRequest2",
               "W_BC_PutRequest3", "W_BC_TakeRequest3", "W_BC_PutRequest4", "W_BC_TakeRequest4"],
        map: { true: "是", false: "否" }
      },
      finishFields: {
        keys: ["W_BC_PutFinish1", "W_BC_TakeFinish1", "W_BC_PutFinish2", "W_BC_TakeFinish2",
               "W_BC_PutFinish3", "W_BC_TakeFinish3", "W_BC_PutFinish4", "W_BC_TakeFinish4"],
        map: { true: "是", false: "否" }
      },
      palletTypeFields: {
        keys: ["R_BC_TakePalletType1", "R_BC_TakePalletType2", "R_BC_TakePalletType3", "R_BC_TakePalletType4",
               "W_BC_PutPalletType1", "W_BC_PutPalletType2", "W_BC_PutPalletType3", "W_BC_PutPalletType4"],
        map: { "-1": "空箱(-1)", 1: "小托盘(1)", 2: "中托盘(2)", 3: "大托盘(3)", 4: "特大托盘(4)" }
      }
    };
    // å¤„理BC原始数据
    const processBCData = (rawData) => {
      if (!rawData) return {};
      const processedData = { ...rawData };
      // å¤„理核心状态字段
      Object.keys(bcStatusMap).forEach(key => {
        if (processedData.hasOwnProperty(key)) {
          processedData[key] = bcStatusMap[key][processedData[key]] || processedData[key];
        }
      });
    }
      // å¤„理分组字段
      Object.values(bcFieldGroups).forEach(group => {
        group.keys.forEach(key => {
          if (processedData.hasOwnProperty(key)) {
            processedData[key] = group.map[processedData[key]] || processedData[key];
          }
        });
      });
      return processedData;
    };
    // å»¶è¿Ÿæ›´æ–°BC数据,避免高频刷新
    const delayedUpdateBCData = (newRawData) => {
      if (updateTimer) {
        clearTimeout(updateTimer);
      }
      updateTimer = setTimeout(() => {
        // åªå¤„理包含BC特征字段的数据
        if (newRawData && newRawData.R_BC_Status !== undefined) {
          bcData.value = processBCData(newRawData);
          // æ›´æ–°æ ·å¼
          nextTick(() => {
            const valueElements = document.getElementsByClassName("xbci");
            for (let i = 0; i < valueElements.length; i++) {
              if (valueElements[i].innerHTML === "是") {
                valueElements[i].style.color = "yellow";
              } else if (valueElements[i].innerHTML === "否") {
                valueElements[i].style.color = "red";
              }
            }
          });
        }
      }, UPDATE_DELAY);
    };
    onMounted(() => {
      // åˆå§‹åŠ è½½æ•°æ®
      const initialData = store.state.homedata;
      if (initialData && initialData.R_BC_Status !== undefined) {
        bcData.value = processBCData(initialData);
      }
      // ç›‘听数据变化,只处理BC数据
      const unwatch = watch(
        () => store.state.homedata,
        (newData) => {
          if (newData && newData.R_BC_Status !== undefined) {
            delayedUpdateBCData(newData);
          }
        },
        { deep: true }
      );
      // ç»„件卸载时清理
      onUnmounted(() => {
        unwatch();
        if (updateTimer) {
          clearTimeout(updateTimer);
        }
      });
    });
    return {
      bcData
    };
  }
};
</script>
<style scoped lang="less">
.message-container {
  .title {
    padding-bottom: 10px;
  }
  .item {
    border-bottom: 1px solid #eee;
    padding: 10px 20px;
  }
  .content {
    color: #7e7e7e;
    font-size: 13px;
  }
<style scoped>
.ding {
  float: left;
  width: 20px;
  height: 20px;
  margin-top: 7px;
}
</style>
.yan {
  color: white;
  float: left;
  font-size: 25px;
}
.dakuang {
  width: 250px;
  height: 50px;
  position: absolute;
  top: 150px;
  left: 200px;
}
#xiugai {
  width: 100px;
  height: 30px;
  float: left;
  border-radius: 5px;
  text-align: center;
  line-height: 30px;
  cursor: pointer;
  border: 1px solid white;
  color: white;
  background: rgba(255, 255, 255, 0.5);
  font-size: 25px;
  position: absolute;
  top: 150px;
  left: 450px;
}
#xiugai:hover {
  background: #f60;
}
#shu1,
#shu2 {
  width: 200px;
  height: 30px;
  float: left;
  margin-top: 0px;
  margin-right: 0px;
  border-radius: 5px;
  border: 1px solid white;
}
#guan {
  width: 40px;
  height: 40px;
  float: left;
  font-size: 1.1cqw;
  text-align: center;
  line-height: 40px;
  cursor: pointer;
  margin-left: 560px;
  color: white;
  position: absolute;
}
#ti {
  width: 600px;
  height: 300px;
  position: relative;
  background: rgba(255, 255, 255, 1);
  border-radius: 10px;
  top: 230px;
  left: 35%;
  display: none;
  background-image: url("../../img/1.png");
  background-repeat: no-repeat;
  background-size: 170%;
  background-position: -220px 0px;
}
.bcuname {
  width: 100%;
  height: 5vh;
  float: left;
  text-align: center;
  line-height: 50px;
  font-weight: 700;
  font-size: 1.1cqw;
  color: white;
}
.xname {
  width: 70%;
  height: 80px;
  float: left;
  line-height: 7vh;
  font-size: 1.1cqw;
  color: white;
}
.xbci {
  width: 30%;
  height: 7vh;
  float: left;
  line-height: 50px;
  font-size: 1.1cqw;
  color: rgb(242, 242, 50);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bcankuang {
  width: 45%;
  height: 3vh;
  margin-top: 10px;
  margin-left: 5%;
  float: left;
}
#title {
  float: left;
  width: 95%;
  height: 88vh;
  margin-top: 40px;
  margin-left: 3%;
  background-image: url("../../img/1.png");
  background-repeat: no-repeat;
  background-size: 100%;
  container-type: inline-size;
}
#bkuang {
  width: 100%;
  height: 55vh;
  float: left;
}
.skuang {
  width: 31%;
  height: 55vh;
  float: left;
  border-top: none;
  border-left: none;
  border-bottom: none;
  background: rgba(255, 255, 255, 0.2);
  margin-left: 1.7%;
  border-radius: 10px;
}
</style>
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Client/src/views/deviceMonitoring/TestFrameWarehouse.vue
@@ -1,45 +1,394 @@
<template>
  <div class="message-container">
    <div class="item" v-for="(item, index) in list" :key="index">
      <div class="title">{{ item.title }}({{ item.date }})</div>
      <div class="content">{{ item.message }}</div>
  <div id="title">
    <div id="bkuang" style="border-top: none">
      <!-- CSJ仓堆垛机状态面板 -->
      <div class="skuang">
        <div class="csjuname">测试架仓堆垛机</div>
        <div class="csjankuang">
          <div class="xname">堆垛机状态:</div>
          <div class="xcsji" :title="csjData.R_CSJ_Status">{{ csjData.R_CSJ_Status || '-' }}</div>
        </div>
        <div class="csjankuang">
          <div class="xname">堆垛机手自动状态:</div>
          <div class="xcsji" :title="csjData.R_CSJ_AutoStatus">{{ csjData.R_CSJ_AutoStatus || '-' }}</div>
        </div>
        <div class="csjankuang">
          <div class="xname">正在执行的任务号:</div>
          <div class="xcsji" :title="csjData.R_CSJ_TaskNum">{{ csjData.R_CSJ_TaskNum || '-' }}</div>
        </div>
        <div class="csjankuang">
          <div class="xname">堆垛机工作状态:</div>
          <div class="xcsji" :title="csjData.R_CSJ_WorkStatus">{{ csjData.R_CSJ_WorkStatus || '-' }}</div>
        </div>
        <div class="csjankuang">
          <div class="xname">作业类型:</div>
          <div class="xcsji" :title="csjData.R_CSJ_WorkType">{{ csjData.R_CSJ_WorkType || '-' }}</div>
        </div>
        <div class="csjankuang">
          <div class="xname">托盘类型:</div>
          <div class="xcsji" :title="csjData.R_CSJ_TrayType">{{ csjData.R_CSJ_TrayType || '-' }}</div>
        </div>
      </div>
      <!-- CSJ关联站台(出库303+出库304) -->
      <div class="skuang">
        <div class="csjuname">出库103站台</div>
        <div class="csjankuang">
          <div class="xname">是否允许放货(读):</div>
          <div class="xcsji" :title="csjData.R_CSJ_IsCanPut3">{{ csjData.R_CSJ_IsCanPut3 || '-' }}</div>
        </div>
        <div class="csjankuang">
          <div class="xname">是否允许取货(读):</div>
          <div class="xcsji" :title="csjData.R_CSJ_IsCanTake3">{{ csjData.R_CSJ_IsCanTake3 || '-' }}</div>
        </div>
        <div class="csjankuang">
          <div class="xname">放货请求(写):</div>
          <div class="xcsji" :title="csjData.W_CSJ_PutRequest3">{{ csjData.W_CSJ_PutRequest3 || '-' }}</div>
        </div>
        <div class="csjankuang">
          <div class="xname">放货完成(写):</div>
          <div class="xcsji" :title="csjData.W_CSJ_PutFinish3">{{ csjData.W_CSJ_PutFinish3 || '-' }}</div>
        </div>
        <div class="csjankuang">
          <div class="xname">取货请求(写):</div>
          <div class="xcsji" :title="csjData.W_CSJ_TakeRequest3">{{ csjData.W_CSJ_TakeRequest3 || '-' }}</div>
        </div>
        <div class="csjankuang">
          <div class="xname">取货完成(写):</div>
          <div class="xcsji" :title="csjData.W_CSJ_TakeFinish3">{{ csjData.W_CSJ_TakeFinish3 || '-' }}</div>
        </div>
        <div class="csjuname">出库104站台</div>
        <div class="csjankuang">
          <div class="xname">是否允许放货(读):</div>
          <div class="xcsji" :title="csjData.R_CSJ_IsCanPut4">{{ csjData.R_CSJ_IsCanPut4 || '-' }}</div>
        </div>
        <div class="csjankuang">
          <div class="xname">是否允许取货(读):</div>
          <div class="xcsji" :title="csjData.R_CSJ_IsCanTake4">{{ csjData.R_CSJ_IsCanTake4 || '-' }}</div>
        </div>
        <div class="csjankuang">
          <div class="xname">放货请求(写):</div>
          <div class="xcsji" :title="csjData.W_CSJ_PutRequest4">{{ csjData.W_CSJ_PutRequest4 || '-' }}</div>
        </div>
        <div class="csjankuang">
          <div class="xname">放货完成(写):</div>
          <div class="xcsji" :title="csjData.W_CSJ_PutFinish4">{{ csjData.W_CSJ_PutFinish4 || '-' }}</div>
        </div>
        <div class="csjankuang">
          <div class="xname">取货请求(写):</div>
          <div class="xcsji" :title="csjData.W_CSJ_TakeRequest4">{{ csjData.W_CSJ_TakeRequest4 || '-' }}</div>
        </div>
        <div class="csjankuang">
          <div class="xname">取货完成(写):</div>
          <div class="xcsji" :title="csjData.W_CSJ_TakeFinish4">{{ csjData.W_CSJ_TakeFinish4 || '-' }}</div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { ref, nextTick, watch, onUnmounted } from "vue";
import { useStore } from "vuex";
import { onMounted } from "vue";
export default {
  props: {
    list: {
      type: Array,
      default: () => {
        return [];
      }
    }
  data() {
    return {
      xuan: 0
    };
  },
  created() {
    if (!this.list.length) {
      this.list.push({
        title: '消息werwer测试标题',
        message: '消息测试内容消息测试内容消息测试内容消息测试内容',
        date: '2022-05-02 03:10'
  setup() {
    const store = useStore();
    // ä»…存储CSJ数据,与其他数据隔离
    const csjData = ref({});
    // å»¶è¿Ÿæ›´æ–°é…ç½®ï¼Œè§£å†³é—ªçƒé—®é¢˜
    const UPDATE_DELAY = 300; // å»¶è¿Ÿ300ms更新UI
    let updateTimer = null;   // å®šæ—¶å™¨å®žä¾‹
    // CSJ数据映射规则
    const csjStatusMap = {
      R_CSJ_Status: {
        1: "正常",
        2: "故障",
        3: "急停",
      },
      R_CSJ_AutoStatus: {
        0: "ç»´ä¿®",
        1: "手动",
        2: "半自动",
        3: "自动",
      },
      R_CSJ_WorkStatus: {
        0: "待机",
        1: "取货中",
        2: "取货完成",
        4: "放货中",
        5: "放货完成",
        6: "任务完成",
      },
      R_CSJ_WorkType: {
        0: "无作业任务(0)",
        1: "取放货作业(1)",
        2: "只取货作业(2)",
        3: "只放货作业(3)",
        4: "移动到指定位置"
      },
      R_CSJ_TrayType: {
        "-1": "空箱(-1)",
        1: "小托盘(1)",
        2: "中托盘(2)",
        3: "大托盘(3)",
        4: "特大托盘(4)",
      }
    };
    // CSJ字段分组
    const csjFieldGroups = {
      permissionFields: {
        keys: ["R_CSJ_IsCanPut1", "R_CSJ_IsCanTake1", "R_CSJ_IsCanPut2", "R_CSJ_IsCanTake2",
               "R_CSJ_IsCanPut3", "R_CSJ_IsCanTake3", "R_CSJ_IsCanPut4", "R_CSJ_IsCanTake4"],
        map: { true: "是", false: "否" }
      },
      requestFields: {
        keys: ["W_CSJ_PutRequest1", "W_CSJ_TakeRequest1", "W_CSJ_PutRequest2", "W_CSJ_TakeRequest2",
               "W_CSJ_PutRequest3", "W_CSJ_TakeRequest3", "W_CSJ_PutRequest4", "W_CSJ_TakeRequest4"],
        map: { true: "是", false: "否" }
      },
      finishFields: {
        keys: ["W_CSJ_PutFinish1", "W_CSJ_TakeFinish1", "W_CSJ_PutFinish2", "W_CSJ_TakeFinish2",
               "W_CSJ_PutFinish3", "W_CSJ_TakeFinish3", "W_CSJ_PutFinish4", "W_CSJ_TakeFinish4"],
        map: { true: "是", false: "否" }
      },
      palletTypeFields: {
        keys: ["R_CSJ_TakePalletType1", "R_CSJ_TakePalletType2", "R_CSJ_TakePalletType3", "R_CSJ_TakePalletType4",
               "W_CSJ_PutPalletType1", "W_CSJ_PutPalletType2", "W_CSJ_PutPalletType3", "W_CSJ_PutPalletType4"],
        map: { "-1": "空箱(-1)", 1: "小托盘(1)", 2: "中托盘(2)", 3: "大托盘(3)", 4: "特大托盘(4)" }
      }
    };
    // å¤„理CSJ原始数据
    const processCSJData = (rawData) => {
      if (!rawData) return {};
      const processedData = { ...rawData };
      // å¤„理核心状态字段
      Object.keys(csjStatusMap).forEach(key => {
        if (processedData.hasOwnProperty(key)) {
          processedData[key] = csjStatusMap[key][processedData[key]] || processedData[key];
        }
      });
    }
      // å¤„理分组字段
      Object.values(csjFieldGroups).forEach(group => {
        group.keys.forEach(key => {
          if (processedData.hasOwnProperty(key)) {
            processedData[key] = group.map[processedData[key]] || processedData[key];
          }
        });
      });
      return processedData;
    };
    // å»¶è¿Ÿæ›´æ–°CSJ数据,避免高频刷新
    const delayedUpdateCSJData = (newRawData) => {
      if (updateTimer) {
        clearTimeout(updateTimer);
      }
      updateTimer = setTimeout(() => {
        // åªå¤„理包含CSJ特征字段的数据
        if (newRawData && newRawData.R_CSJ_Status !== undefined) {
          csjData.value = processCSJData(newRawData);
          // æ›´æ–°æ ·å¼
          nextTick(() => {
            const valueElements = document.getElementsByClassName("xcsji");
            for (let i = 0; i < valueElements.length; i++) {
              if (valueElements[i].innerHTML === "是") {
                valueElements[i].style.color = "yellow";
              } else if (valueElements[i].innerHTML === "否") {
                valueElements[i].style.color = "red";
              }
            }
          });
        }
      }, UPDATE_DELAY);
    };
    onMounted(() => {
      // åˆå§‹åŠ è½½æ•°æ®
      const initialData = store.state.homedata;
      if (initialData && initialData.R_CSJ_Status !== undefined) {
        csjData.value = processCSJData(initialData);
      }
      // ç›‘听数据变化,只处理CSJ数据
      const unwatch = watch(
        () => store.state.homedata,
        (newData) => {
          if (newData && newData.R_CSJ_Status !== undefined) {
            delayedUpdateCSJData(newData);
          }
        },
        { deep: true }
      );
      // ç»„件卸载时清理
      onUnmounted(() => {
        unwatch();
        if (updateTimer) {
          clearTimeout(updateTimer);
        }
      });
    });
    return {
      csjData
    };
  }
};
</script>
<style scoped lang="less">
.message-container {
  .title {
    padding-bottom: 10px;
  }
  .item {
    border-bottom: 1px solid #eee;
    padding: 10px 20px;
  }
  .content {
    color: #7e7e7e;
    font-size: 13px;
  }
<style scoped>
.ding {
  float: left;
  width: 20px;
  height: 20px;
  margin-top: 7px;
}
.yan {
  color: white;
  float: left;
  font-size: 25px;
}
.dakuang {
  width: 250px;
  height: 50px;
  position: absolute;
  top: 150px;
  left: 200px;
}
#xiugai {
  width: 100px;
  height: 30px;
  float: left;
  border-radius: 5px;
  text-align: center;
  line-height: 30px;
  cursor: pointer;
  border: 1px solid white;
  color: white;
  background: rgba(255, 255, 255, 0.5);
  font-size: 25px;
  position: absolute;
  top: 150px;
  left: 450px;
}
#xiugai:hover {
  background: #f60;
}
#shu1,
#shu2 {
  width: 200px;
  height: 30px;
  float: left;
  margin-top: 0px;
  margin-right: 0px;
  border-radius: 5px;
  border: 1px solid white;
}
#guan {
  width: 40px;
  height: 40px;
  float: left;
  font-size: 1.1cqw;
  text-align: center;
  line-height: 40px;
  cursor: pointer;
  margin-left: 560px;
  color: white;
  position: absolute;
}
#ti {
  width: 600px;
  height: 300px;
  position: relative;
  background: rgba(255, 255, 255, 1);
  border-radius: 10px;
  top: 230px;
  left: 35%;
  display: none;
  background-image: url("../../img/1.png");
  background-repeat: no-repeat;
  background-size: 170%;
  background-position: -220px 0px;
}
.csjuname {
  width: 100%;
  height: 5vh;
  float: left;
  text-align: center;
  line-height: 50px;
  font-weight: 700;
  font-size: 1.1cqw;
  color: white;
}
.xname {
  width: 70%;
  height: 80px;
  float: left;
  line-height: 7vh;
  font-size: 1.1cqw;
  color: white;
}
.xcsji {
  width: 30%;
  height: 7vh;
  float: left;
  line-height: 50px;
  font-size: 1.1cqw;
  color: rgb(242, 242, 50);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.csjankuang {
  width: 45%;
  height: 3vh;
  margin-top: 10px;
  margin-left: 5%;
  float: left;
}
#title {
  float: left;
  width: 95%;
  height: 88vh;
  margin-top: 40px;
  margin-left: 3%;
  background-image: url("../../img/1.png");
  background-repeat: no-repeat;
  background-size: 100%;
  container-type: inline-size;
}
#bkuang {
  width: 100%;
  height: 55vh;
  float: left;
}
.skuang {
  width: 31%;
  height: 55vh;
  float: left;
  border-top: none;
  border-left: none;
  border-bottom: none;
  background: rgba(255, 255, 255, 0.2);
  margin-left: 1.7%;
  border-radius: 10px;
}
</style>
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs
@@ -290,5 +290,11 @@
        /// <param name="taskNum"></param>
        /// <returns></returns>
        public WebResponseContent RecWMSTaskCompleted(int taskNum);
        /// <summary>
        /// æŽ¥æ”¶wcs任务取消
        /// </summary>
        /// <param name="taskNum"></param>
        /// <returns></returns>
        public WebResponseContent RecWMSTaskHandCancel(int taskNum);
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs
@@ -121,7 +121,7 @@
                {
                    return WebResponseContent.Instance.Error("未找到该任务信息");
                }
                if(task.TaskState == TaskStatusEnum.SC_Executing.ObjToInt())
                if (task.TaskState == TaskStatusEnum.SC_Executing.ObjToInt() || (task.DeviceCode.Contains("SC01")&& task.TaskState == TaskStatusEnum.Pending.ObjToInt()))
                {
                    _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute);
                }
@@ -164,5 +164,11 @@
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        [HttpPost, HttpGet, Route("RecWMSTaskHandCancel"), AllowAnonymous]
        public WebResponseContent RecWMSTaskHandCancel(int taskNum)
        {
            return Service.RecWMSTaskHandCancel(taskNum);
        }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -1010,5 +1010,28 @@
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        /// <summary>
        /// æŽ¥å—WMS手动取消任务
        /// </summary>
        /// <param name="taskNum"></param>
        /// <returns></returns>
        public WebResponseContent RecWMSTaskHandCancel(int taskNum)
        {
            try
            {
                Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum);
                if (task != null)
                {
                    task.TaskState = TaskStatusEnum.Cancel.ObjToInt();
                    BaseDal.DeleteAndMoveIntoHty(task, OperateTypeEnum.人工删除);
                }
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/°å²Ä²Ö/BCReadData.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_Tasks.板材仓
{
    public class BCReadData
    {
        /// <summary>
        /// å †åž›æœºçŠ¶æ€
        /// </summary>
        public short R_BC_Status;
        /// <summary>
        /// å †åž›æœºæ‰‹è‡ªåŠ¨çŠ¶æ€
        /// </summary>
        public short R_BC_AutoStatus;
        /// <summary>
        /// å½“前正在执行的任务号
        /// </summary>
        public int R_BC_TaskNum;
        /// <summary>
        /// å †åž›æœºå·¥ä½œçŠ¶æ€
        /// </summary>
        public short R_BC_WorkStatus;
        /// <summary>
        /// ä½œä¸šç±»åž‹
        /// </summary>
        public short R_BC_WorkType;
        /// <summary>
        /// æ‰˜ç›˜ç±»åž‹
        /// </summary>
        public short R_BC_TrayType;
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/°å²Ä²Ö/StackerCraneJob_BC.cs
@@ -31,6 +31,9 @@
using Autofac.Core;
using WIDESEAWCS_DTO.TaskInfo;
using AutoMapper;
using WIDESEAWCS_Tasks.板材仓;
using HslCommunication.WebSocket;
using WIDESEAWCS_Tasks.测试架仓;
namespace WIDESEAWCS_Tasks
{
@@ -45,10 +48,12 @@
        private readonly IRouterService _routerService;
        private readonly IStationMangerRepository _stationMangerRepository;
        private readonly IRouterRepository _routerRepository;
        public static BCReadData bCReadData = new BCReadData();
        private List<Dt_ApiInfo> apiInfos;
        private readonly List<Dt_WarehouseDevice> warehouseDevices;
        private WebSocketServer _webSocketServer;
        public StackerCraneJob_BC(IMapper mapper, ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository)
        public StackerCraneJob_BC(IMapper mapper, ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository,WebSocketServer webSocketServer)
        {
            _mapper = mapper;
            _taskService = taskService;
@@ -58,6 +63,7 @@
            _stationMangerRepository = stationMangerRepository;
            _cacheService = cacheService;
            _routerRepository = routerRepository;
            _webSocketServer = webSocketServer;
            string? apiInfoStr = _cacheService.Get("apiInfos");
            if (!string.IsNullOrEmpty(apiInfoStr))
@@ -127,6 +133,14 @@
                            }
                        }
                    }
                    bCReadData.R_BC_Status = ((short)commonStackerCrane.StackerCraneStatusValue);
                    bCReadData.R_BC_AutoStatus = ((short)commonStackerCrane.StackerCraneAutoStatusValue);
                    bCReadData.R_BC_WorkStatus = ((short)commonStackerCrane.StackerCraneWorkStatusValue);
                    bCReadData.R_BC_TaskNum = commonStackerCrane.CurrentTaskNum.ObjToInt();
                    bCReadData.R_BC_WorkType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType);
                    bCReadData.R_BC_TrayType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.TrayType);
                    string bCData = JsonConvert.SerializeObject(bCReadData);
                    _webSocketServer.PublishAllClientPayload(bCData);
                }
            }
            catch (Exception ex)
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/²âÊԼܲÖ/CSJReadData.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,108 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_Tasks.测试架仓
{
    public class CSJReadData
    {
        /// <summary>
        /// å †åž›æœºçŠ¶æ€
        /// </summary>
        public short R_CSJ_Status;
        /// <summary>
        /// å †åž›æœºæ‰‹è‡ªåŠ¨çŠ¶æ€
        /// </summary>
        public short R_CSJ_AutoStatus;
        /// <summary>
        /// å½“前正在执行的任务号
        /// </summary>
        public int R_CSJ_TaskNum;
        /// <summary>
        /// å †åž›æœºå·¥ä½œçŠ¶æ€
        /// </summary>
        public short R_CSJ_WorkStatus;
        /// <summary>
        /// ä½œä¸šç±»åž‹
        /// </summary>
        public short R_CSJ_WorkType;
        /// <summary>
        /// æ‰˜ç›˜ç±»åž‹
        /// </summary>
        public short R_CSJ_TrayType;
        ///各站台读取103
        ///取货托盘类型(读)
        public short R_CSJ_TakePalletType3;
        /// <summary>
        /// æ”¾è´§æ‰˜ç›˜ç±»åž‹(写)
        /// </summary>
        public short W_CSJ_PutPalletType3;
        /// <summary>
        /// æ˜¯å¦å…è®¸æ”¾è´§(读)
        /// </summary>
        public bool R_CSJ_IsCanPut3;
        /// <summary>
        /// æ˜¯å¦å…è®¸å–è´§(读)
        /// </summary>
        public bool R_CSJ_IsCanTake3;
        /// <summary>
        /// æ”¾è´§è¯·æ±‚(写)
        /// </summary>
        public bool W_CSJ_PutRequest3;
        /// <summary>
        /// æ”¾è´§å®Œæˆ(写)
        /// </summary>
        public bool W_CSJ_PutFinish3;
        /// <summary>
        /// å–货请求(写)
        /// </summary>
        public bool W_CSJ_TakeRequest3;
        /// <summary>
        /// å–货完成(写)
        /// </summary>
        public bool W_CSJ_TakeFinish3;
        ///各站台读取104
        ///取货托盘类型(读)
        public short R_CSJ_TakePalletType4;
        /// <summary>
        /// æ”¾è´§æ‰˜ç›˜ç±»åž‹(写)
        /// </summary>
        public short W_CSJ_PutPalletType4;
        /// <summary>
        /// æ˜¯å¦å…è®¸æ”¾è´§(读)
        /// </summary>
        public bool R_CSJ_IsCanPut4;
        /// <summary>
        /// æ˜¯å¦å…è®¸å–è´§(读)
        /// </summary>
        public bool R_CSJ_IsCanTake4;
        /// <summary>
        /// æ”¾è´§è¯·æ±‚(写)
        /// </summary>
        public bool W_CSJ_PutRequest4;
        /// <summary>
        /// æ”¾è´§å®Œæˆ(写)
        /// </summary>
        public bool W_CSJ_PutFinish4;
        /// <summary>
        /// å–货请求(写)
        /// </summary>
        public bool W_CSJ_TakeRequest4;
        /// <summary>
        /// å–货完成(写)
        /// </summary>
        public bool W_CSJ_TakeFinish4;
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/²âÊԼܲÖ/GroundStationJob_CSJ.cs
@@ -89,6 +89,24 @@
                                _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, currentAddress: stationManger.StackerCraneStationCode, targetAddress: locationCode, nextAddress: locationCode, deviceCode: stationManger.StackerCraneCode);
                            }
                        }
                        if (item.StationCode == "103")
                        {
                            StackerCraneJob_CSJ.cSJReadData.R_CSJ_IsCanPut3 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, item.StationCode);
                            StackerCraneJob_CSJ.cSJReadData.R_CSJ_IsCanTake3 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanTake, item.StationCode);
                            StackerCraneJob_CSJ.cSJReadData.W_CSJ_PutRequest3 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutRequest, item.StationCode);
                            StackerCraneJob_CSJ.cSJReadData.W_CSJ_PutFinish3 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutFinish, item.StationCode);
                            StackerCraneJob_CSJ.cSJReadData.W_CSJ_TakeRequest3 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeRequest, item.StationCode);
                            StackerCraneJob_CSJ.cSJReadData.W_CSJ_TakeFinish3 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeFinish, item.StationCode);
                        }
                        else if (item.StationCode == "104")
                        {
                            StackerCraneJob_CSJ.cSJReadData.R_CSJ_IsCanPut4 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, item.StationCode);
                            StackerCraneJob_CSJ.cSJReadData.R_CSJ_IsCanTake4 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanTake, item.StationCode);
                            StackerCraneJob_CSJ.cSJReadData.W_CSJ_PutRequest4 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutRequest, item.StationCode);
                            StackerCraneJob_CSJ.cSJReadData.W_CSJ_PutFinish4 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutFinish, item.StationCode);
                            StackerCraneJob_CSJ.cSJReadData.W_CSJ_TakeRequest4 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeRequest, item.StationCode);
                            StackerCraneJob_CSJ.cSJReadData.W_CSJ_TakeFinish4 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeFinish, item.StationCode);
                        }
                    }
                    catch (Exception ex)
                    {
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/²âÊԼܲÖ/StackerCraneJob_CSJ.cs
@@ -1,4 +1,5 @@
using AutoMapper;
using HslCommunication.WebSocket;
using Microsoft.AspNetCore.Components.Routing;
using Newtonsoft.Json;
using Quartz;
@@ -27,6 +28,7 @@
using WIDESEAWCS_QuartzJob.StackerCrane.Enum;
using WIDESEAWCS_Tasks.HoisterJob;
using WIDESEAWCS_Tasks.StackerCraneJob;
using WIDESEAWCS_Tasks.测试架仓;
namespace WIDESEAWCS_Tasks
{
@@ -36,13 +38,15 @@
        private readonly IMapper _mapper;
        private readonly ICacheService _cacheService;
        private readonly ITaskService _taskService;
        public static CSJReadData cSJReadData = new CSJReadData();
        private readonly ITaskExecuteDetailService _taskExecuteDetailService;
        private readonly ITaskRepository _taskRepository;
        private readonly IRouterService _routerService;
        private readonly IStationMangerRepository _stationMangerRepository;
        private WebSocketServer _webSocketServer;
        private List<Dt_ApiInfo> apiInfos;
        public StackerCraneJob_CSJ(ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, IMapper mapper)
        public StackerCraneJob_CSJ(ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, IMapper mapper, WebSocketServer webSocketServer)
        {
            _taskService = taskService;
            _taskExecuteDetailService = taskExecuteDetailService;
@@ -51,6 +55,7 @@
            _stationMangerRepository = stationMangerRepository;
            _cacheService = cacheService;
            _mapper = mapper;
            _webSocketServer = webSocketServer;
            string? apiInfoStr = _cacheService.Get("apiInfos");
            if (!string.IsNullOrEmpty(apiInfoStr))
@@ -101,6 +106,14 @@
                            }
                        }
                    }
                    cSJReadData.R_CSJ_Status = ((short)commonStackerCrane.StackerCraneStatusValue);
                    cSJReadData.R_CSJ_AutoStatus = ((short)commonStackerCrane.StackerCraneAutoStatusValue);
                    cSJReadData.R_CSJ_WorkStatus = ((short)commonStackerCrane.StackerCraneWorkStatusValue);
                    cSJReadData.R_CSJ_TaskNum = commonStackerCrane.CurrentTaskNum.ObjToInt();
                    cSJReadData.R_CSJ_WorkType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType);
                    cSJReadData.R_CSJ_TrayType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.TrayType);
                    string cSJData = JsonConvert.SerializeObject(cSJReadData);
                    _webSocketServer.PublishAllClientPayload(cSJData);
                }
            }
            catch (Exception ex)
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/extension/outbound/outboundOrderDetail.js
@@ -45,12 +45,20 @@
        this.$refs.table.$refs.table.toggleRowSelection(row); //单击行时选中当前行;
      },
      modelOpenAfter(row) {
        //点击编辑、新建按钮弹出框后,可以在此处写逻辑,如,从后台获取数据
        //(1)判断是编辑还是新建操作: this.currentAction=='Add';
        //(2)给弹出框设置默认值
        //(3)this.editFormFields.字段='xxx';
        //如果需要给下拉框设置默认值,请遍历this.editFormOptions找到字段配置对应data属性的key值
        //看不懂就把输出看:console.log(this.editFormOptions)
        // ç‚¹å‡»ç¼–辑按钮弹出框后执行
            if (this.currentAction === 'Edit') { // åˆ¤æ–­å½“前是编辑操作
                // èŽ·å–å½“å‰ç™»å½•ç”¨æˆ·ï¼ˆå‡è®¾ä»Žå…¨å±€å˜é‡èŽ·å–ï¼Œå…·ä½“æ ¹æ®ä½ çš„é¡¹ç›®å®žçŽ°ï¼‰
                const currentUser = this.$store.state.userInfo?.username || '被人工修改';
                // èŽ·å–å½“å‰æ—¶é—´å¹¶æ ¼å¼åŒ–ä¸ºåŽç«¯éœ€è¦çš„æ ¼å¼
                const now = new Date();
                const formattedDate = now.toISOString().slice(0, 19).replace('T', ' ');
                // è®¾ç½®ä¿®æ”¹äººå­—段
                this.editFormFields.modifier = currentUser;
                // è®¾ç½®ä¿®æ”¹æ—¶é—´å­—段
                this.editFormFields.modifyDate = formattedDate;
            }
      }
    }
  };
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/extension/stock/stockInfo.js
@@ -46,12 +46,20 @@
        this.$refs.table.$refs.table.toggleRowSelection(row); //单击行时选中当前行;
      },
      modelOpenAfter(row) {
        //点击编辑、新建按钮弹出框后,可以在此处写逻辑,如,从后台获取数据
        //(1)判断是编辑还是新建操作: this.currentAction=='Add';
        //(2)给弹出框设置默认值
        //(3)this.editFormFields.字段='xxx';
        //如果需要给下拉框设置默认值,请遍历this.editFormOptions找到字段配置对应data属性的key值
        //看不懂就把输出看:console.log(this.editFormOptions)
        // ç‚¹å‡»ç¼–辑按钮弹出框后执行
            if (this.currentAction === 'Edit') { // åˆ¤æ–­å½“前是编辑操作
                // èŽ·å–å½“å‰ç™»å½•ç”¨æˆ·ï¼ˆå‡è®¾ä»Žå…¨å±€å˜é‡èŽ·å–ï¼Œå…·ä½“æ ¹æ®ä½ çš„é¡¹ç›®å®žçŽ°ï¼‰
                const currentUser = this.$store.state.userInfo?.username || 'system';
                // èŽ·å–å½“å‰æ—¶é—´å¹¶æ ¼å¼åŒ–ä¸ºåŽç«¯éœ€è¦çš„æ ¼å¼
                const now = new Date();
                const formattedDate = now.toISOString().slice(0, 19).replace('T', ' ');
                // è®¾ç½®ä¿®æ”¹äººå­—段
                this.editFormFields.modifier = currentUser;
                // è®¾ç½®ä¿®æ”¹æ—¶é—´å­—段
                this.editFormFields.modifyDate = formattedDate;
            }
      }
    }
  };
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/extension/stock/stockInfoDetail.js
@@ -45,12 +45,20 @@
        this.$refs.table.$refs.table.toggleRowSelection(row); //单击行时选中当前行;
      },
      modelOpenAfter(row) {
        //点击编辑、新建按钮弹出框后,可以在此处写逻辑,如,从后台获取数据
        //(1)判断是编辑还是新建操作: this.currentAction=='Add';
        //(2)给弹出框设置默认值
        //(3)this.editFormFields.字段='xxx';
        //如果需要给下拉框设置默认值,请遍历this.editFormOptions找到字段配置对应data属性的key值
        //看不懂就把输出看:console.log(this.editFormOptions)
        // ç‚¹å‡»ç¼–辑按钮弹出框后执行
            if (this.currentAction === 'Edit') { // åˆ¤æ–­å½“前是编辑操作
                // èŽ·å–å½“å‰ç™»å½•ç”¨æˆ·ï¼ˆå‡è®¾ä»Žå…¨å±€å˜é‡èŽ·å–ï¼Œå…·ä½“æ ¹æ®ä½ çš„é¡¹ç›®å®žçŽ°ï¼‰
                const currentUser = this.$store.state.userInfo?.username || 'system';
                // èŽ·å–å½“å‰æ—¶é—´å¹¶æ ¼å¼åŒ–ä¸ºåŽç«¯éœ€è¦çš„æ ¼å¼
                const now = new Date();
                const formattedDate = now.toISOString().slice(0, 19).replace('T', ' ');
                // è®¾ç½®ä¿®æ”¹äººå­—段
                this.editFormFields.modifier = currentUser;
                // è®¾ç½®ä¿®æ”¹æ—¶é—´å­—段
                this.editFormFields.modifyDate = formattedDate;
            }
      }
    }
  };
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/extension/taskinfo/task.js
@@ -32,7 +32,7 @@
          var param = rows[0].taskNum;
          var warehouseId = rows[0].warehouseId;
          this.http
            .post("api/Task/TaskHandCancel?taskNum="+param+"&&warehouseId="+warehouseId, "数据处理中...")
            .post("api/Task/TaskHandCancel?taskNum="+param, "数据处理中...")
            .then((x) => {
              if (x.status) {
                this.$Message.success('任务取消成功.');
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/views/inbound/inboundOrder.vue
@@ -115,6 +115,7 @@
        require: true,
        align: "left",
      },
      {
        field: "inboundOrderNo",
        title: "单据编号",
@@ -154,6 +155,7 @@
        align: "left",
        bind: { key: "inboundState", data: [] },
      },
      {
        field: "createType",
        title: "创建方式",
@@ -163,6 +165,13 @@
        bind: { key: "createType", data: [] },
      },
      {
        field: "id",
        title: "入库单主键",
        type: "int",
        width: 90,
        align: "left",
      },
      {
        field: "creater",
        title: "创建人",
        type: "string",
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/views/inbound/inboundOrderDetail.vue
@@ -90,11 +90,20 @@
        deviceStatus: "",
      });
      const searchFormOptions = ref([
        [
          { title: "设备编号", field: "deviceCode" },
          { title: "设备类型", field: "deviceType" },
          { title: "设备状态", field: "deviceStatus" },
        ],
      [
        { title: "物料编号", field: "materielCode", type: "like" },
        { title: "物料名称", field: "materielName", type: "like" },
        { title: "入库单主键", field: "orderId", type: "int" },
        { title: "批次号", field: "batchNo", type: "like" },
      ],
      [
        {
          field: "orderDetailStatus",title: "订单明细状态",type: "select",dataKey:"orderDetailStatusEnum", data: []
        },
        { title: "创建者", field: "creater", type: "like" },
        { title: "创建时间", field: "createDate", type: "datetime" },
      ],
      ]);
      const columns = ref([
        {
@@ -162,6 +171,7 @@
          type: "string",
          width: 180,
          align: "left",
          bind: { key: "orderDetailStatusEnum", data: [] },
        },
        {
          field: "creater",
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/views/outbound/outboundOrder.vue
@@ -181,6 +181,13 @@
        bind: { key: "createType", data: [] },
      },
      {
          field: "id",
          title: "出库单主键",
          type: "string",
          width: 90,
          align: "left",
        },
      {
        field: "departmentCode",
        title: "修改时间",
        type: "string",
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/views/outbound/outboundOrderDetail.vue
@@ -38,51 +38,91 @@
      });
      const editFormOptions = ref([
        [
          {
            title: "设备编号",
            required: true,
            field: "deviceCode",
            type: "string",
          },
          {
            title: "设备名称",
            required: true,
            field: "deviceName",
            type: "string",
          },
          {
            title: "设备类型",
            required: true,
            field: "deviceType",
            type: "string",
          },
          {
            title: "设备状态",
            required: true,
            field: "deviceStatus",
            type: "string",
          },
        ],
        [
          { title: "设备IP", required: true, field: "deviceIp", type: "string" },
          {
            title: "设备端口",
            required: true,
            field: "devicePort",
            type: "string",
          },
          {
            title: "PLC类型",
            required: true,
            field: "devicePlcType",
            type: "string",
          },
          {
            title: "备注",
            field: "deviceRemark",
            type: "string",
          },
        ],
        {
          title: "库存主键",
          readonly:true,
          field: "orderId",
          type: "string",
        },
        {
          title: "物料编号",
          required: true,
          field: "materielCode",
          type: "string",
          readonly: true,
        },
        {
          title: "物料名称",
          required: true,
          field: "materielName",
          type: "string",
        },
        {
          title: "行号",
          readonly: true,
          field: "rowNo",
          type: "string",
        },
      ],
      [
        {
          title: "批次号",
          field: "batchNo",
          type: "string",
        },
        {
          field: "orderQuantity",
          title: "单据数量",
          type: "string",
          width: 90,
          align: "left",
          readonly: true,
        },
        {
          field: "lockQuantity",
          title: "锁定数量",
          type: "int",
          width: 120,
          align: "left",
          readonly: true,
        },
        {
          field: "overOutQuantity",
          title: "已出数量",
          type: "string",
          width: 200,
          align: "left",
          readonly: true,
        },
      ],
      [
        {
          field: "orderDetailStatus",
          title: "订单明细状态",
          type: "select",dataKey:"orderDetailStatusEnum",
          data: [],
          readonly: true,
        },
        {
        field: "modifier",
        title: "修改人",
        type: "string",
        width: 100,
        align: "left",
        readonly:true,
        },
        {
          field: "modifyDate",
          title: "修改时间",
          type: "datetime",
          width: 160,
          align: "left",
          readonly:true,
        },
      ],
      ]);
      const searchFormFields = ref({
        deviceCode: "",
@@ -91,10 +131,18 @@
      });
      const searchFormOptions = ref([
        [
          { title: "设备编号", field: "deviceCode" },
          { title: "设备类型", field: "deviceType" },
          { title: "设备状态", field: "deviceStatus" },
        ],
        { title: "物料编号", field: "materielCode", type: "like" },
        { title: "物料名称", field: "materielName", type: "like" },
        { title: "出库单主键", field: "orderId", type: "int" },
        { title: "批次号", field: "batchNo", type: "like" },
      ],
      [
        {
          field: "orderDetailStatus",title: "订单明细状态",type: "select",dataKey:"orderDetailStatusEnum", data: []
        },
        { title: "创建者", field: "creater", type: "like" },
        { title: "创建时间", field: "createDate", type: "datetime" },
      ],
      ]);
      const columns = ref([
      {
@@ -112,7 +160,6 @@
          type: "string",
          width: 90,
          align: "left",
          hidden: true,
        },
        {
          field: "materielCode",
@@ -162,6 +209,7 @@
          type: "string",
          width: 180,
          align: "left",
          bind: { key: "orderDetailStatusEnum", data: [] },
        },
        {
          field: "creater",
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/views/stock/stockInfo.vue
@@ -38,8 +38,27 @@
      });
      const editFormOptions = ref([
       [
        {field:'palletCode',title:'托盘编号',type:'string'},
        {field:'locationCode',title:'货位编号',type:'string'},
          { title: "托盘编号", field: "palletCode", type :"string"},
          { title: "货位编号", field: "locationCode",type:"string",readonly: true, },
          { title: "所属仓库", field: "warehouseId",type: "select",dataKey: "warehouses",data: [],readonly: true,},
          {title: "库存明细状态",field: "stockStatus",type: "select",dataKey:"stockStatusEmun", data: [],readonly: true,},
       ],
       [
       { title: "托盘类型", field: "palletType", type :"select",dataKey:"locationTypeEnum",data:[]},
        {
        field: "modifier",
        title: "修改人",
        type: "string",
        readonly: true,
        },
        {
          field: "modifyDate",
          title: "修改时间",
          type: "datetime",
          readonly: true,
        },
       ]
      ]);
      const searchFormFields = ref({
@@ -48,8 +67,10 @@
      });
      const searchFormOptions = ref([
        [
          { title: "托盘编号", field: "palletCode" },
          { title: "货位编号", field: "locationCode" },
          { title: "托盘编号", field: "palletCode", type :"like"},
          { title: "货位编号", field: "locationCode",type:"like" },
          { title: "所属仓库", field: "warehouseId",type: "select",dataKey: "warehouses",data: [],},
          {title: "库存明细状态",field: "status",type: "select",dataKey:"stockStatusEmun", data: []},
        ],
      ]);
      const columns = ref([
@@ -64,6 +85,13 @@
          align: "left",
        },
        {
          field: "id",
          title: "库存主键",
          type: "string",
          width: 90,
          align: "left",
        },
        {
          field: "palletCode",
          title: "托盘编号",
          type: "string",
@@ -71,12 +99,28 @@
          align: "left",
        },
        {
        field: "palletType",
        title: "托盘类型",
        type: "select",
        width: 120,
        align: "left",
        bind: { key: "locationTypeEnum", data: [] },
      },
        {
          field: "locationCode",
          title: "货位编号",
          type: "string",
          width: 150,
          align: "left",
        },
        {
        field: "stockStatus",
        title: "库存明细状态",
        type: "string",
        width: 120,
        align: "left",
        bind: { key: "stockStatusEmun", data: [] },
      },
        // {
        //   field: "isFull",
        //   title: "是否满盘",
@@ -113,7 +157,6 @@
          type: "string",
          width: 100,
          align: "left",
          hidden:true
        },
        {
          field: "modifyDate",
@@ -121,7 +164,6 @@
          type: "datetime",
          width: 160,
          align: "left",
          hidden:true
        },
        {
          field: "remark",
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/views/stock/stockInfoDetail.vue
@@ -91,9 +91,9 @@
        },
        {
          title: "出库数量",
          required: true,
          field: "outboundQuantity",
          type: "string",
          readonly:true
        },
        {
          title: "库存明细状态",
@@ -107,6 +107,22 @@
          field: "inboundOrderRowNo",
          type: "string",
        },
        {
        field: "modifier",
        title: "修改人",
        type: "string",
        width: 100,
        align: "left",
        hidden:true
      },
      {
        field: "modifyDate",
        title: "修改时间",
        type: "datetime",
        width: 160,
        align: "left",
        hidden:true
      },
      ],
      
    ]);
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Common/APIEnum/APIEnum.cs
@@ -82,5 +82,11 @@
        /// </summary>
        [Description("QMS来料检验接口")]
        WMS_QMSReceiveCheckApi,
        /// <summary>
        /// å›žè°ƒWCS任务完成
        /// </summary>
        [Description("回调WCS任务取消")]
        FeedBackWCSTaskHandCancel,
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs
@@ -397,6 +397,6 @@
        /// <param name="taskNum"></param>
        /// <param name="warehouseId"></param>
        /// <returns></returns>
        public Task<WebResponseContent> TaskHandCancel(int taskNum, int warehouseId);
        public Task<WebResponseContent> TaskHandCancel(int taskNum);
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs
@@ -414,7 +414,7 @@
                var requestBody = new
                {
                    msgtype = "text",
                    text = new { content = "小洋主人说: å°æ´‹è¦å’Œå°å¦å¤©ä¸‹ç¬¬ä¸€æœ€æœ€å¥½" },
                    text = new { content = "钉钉消息推送" },
                };
                var jsonBody = JsonConvert.SerializeObject(requestBody);
                var content = new StringContent(jsonBody, Encoding.UTF8, "application/json");
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
@@ -243,6 +243,7 @@
                if (task.TaskType == TaskTypeEnum.MesPalletLargeReturn.ObjToInt() || task.TaskType == TaskTypeEnum.MesPalletSmallReturn.ObjToInt())
                {
                    task.TaskStatus = TaskStatusEnum.Finish.ObjToInt();
                    FeedBackWCSTaskCompleted(taskNum);
                    _unitOfWorkManage.BeginTran();
                    BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.人工完成 : OperateTypeEnum.自动完成);
                    _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateTypeEnum.自动完成 : OperateTypeEnum.人工完成);
@@ -271,6 +272,7 @@
                {
                    stockInfo.StockStatus = StockStatusEmun.入库完成.ObjToInt();
                    task.TaskStatus = TaskStatusEnum.Finish.ObjToInt();
                    FeedBackWCSTaskCompleted(taskNum);
                    stockInfo.Details.ForEach(x =>
                    {
                        x.Status = StockStatusEmun.入库完成.ObjToInt();
@@ -1156,7 +1158,7 @@
            return content;
        }
        public WebResponseContent InboundTaskHandCancel(int taskNum, int warehouseId)
        public WebResponseContent InboundTaskHandCancel(int taskNum)
        {
            try
            {
@@ -1165,10 +1167,70 @@
                {
                    return WebResponseContent.Instance.Error($"未找到该任务信息");
                }
                Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == task.WarehouseId);
                if (warehouse.WarehouseType == WarehouseTypEnum.成品.ToString())
                {
                    if(task.TaskType == TaskTypeEnum.EmptyProductBack.ObjToInt())
                    {
                        task.TaskStatus = TaskStatusEnum.Cancel.ObjToInt();
                        FeedBackWCSTaskHandCancel(taskNum);
                        _unitOfWorkManage.BeginTran();
                        BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.人工删除 : OperateTypeEnum.自动删除);
                        _unitOfWorkManage.CommitTran();
                        return WebResponseContent.Instance.OK();
                    }
                    Dt_ProStockInfo proStockInfo = _stockRepository.ProStockInfoRepository.Db.Queryable<Dt_ProStockInfo>().Where(x => x.PalletCode == task.PalletCode).Includes(x => x.proStockInfoDetails).First();
                    if (proStockInfo == null)
                    {
                        return WebResponseContent.Instance.Error($"未找到胶框为{task.PalletCode}组盘信息");
                    }
                    Dt_LocationInfo prolocationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress);
                    if (prolocationInfo != null)
                    {
                        if (prolocationInfo.LocationStatus == LocationStatusEnum.InStock.ObjToInt())
                        {
                            return WebResponseContent.Instance.Error($"货位状态不正确");
                        }
                        prolocationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt();
                    }
                    if(task.TaskType == TaskTypeEnum.InProduct.ObjToInt())
                    {
                        task.TaskStatus = TaskStatusEnum.Cancel.ObjToInt();
                        _unitOfWorkManage.BeginTran();
                        FeedBackWCSTaskHandCancel(taskNum);
                        BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.人工删除 : OperateTypeEnum.自动删除);
                        _stockService.ProStockInfoService.Repository.DeleteAndMoveIntoHty(proStockInfo, App.User.UserId == 0 ? OperateTypeEnum.自动删除 : OperateTypeEnum.人工删除);
                        _stockService.ProStockInfoDetailService.Repository.DeleteAndMoveIntoHty(proStockInfo.proStockInfoDetails, App.User.UserId == 0 ? OperateTypeEnum.自动删除 : OperateTypeEnum.人工删除);
                        _basicService.LocationInfoService.UpdateLocationStatus(prolocationInfo, proStockInfo.PalletType, LocationStatusEnum.Free, proStockInfo.WarehouseId);
                        _unitOfWorkManage.CommitTran();
                        return WebResponseContent.Instance.OK();
                    }
                    else
                    {
                        proStockInfo.StockStatus = StockStatusEmun.出库完成.ObjToInt();
                        proStockInfo.proStockInfoDetails.ForEach(x =>
                        {
                            x.ProOutDetailStatus = StockStatusEmun.出库完成.ObjToInt();
                        });
                        task.TaskStatus = TaskStatusEnum.Cancel.ObjToInt();
                        _unitOfWorkManage.BeginTran();
                        FeedBackWCSTaskHandCancel(taskNum);
                        BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.人工删除 : OperateTypeEnum.自动删除);
                        _stockService.ProStockInfoService.Repository.UpdateData(proStockInfo);
                        _stockService.ProStockInfoDetailService.Repository.UpdateData(proStockInfo.proStockInfoDetails);
                        _basicService.LocationInfoService.UpdateLocationStatus(prolocationInfo, proStockInfo.PalletType, LocationStatusEnum.Free, proStockInfo.WarehouseId);
                        _unitOfWorkManage.CommitTran();
                        return WebResponseContent.Instance.OK();
                    }
                }
                Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == task.PalletCode && x.WarehouseId == task.WarehouseId).Includes(x => x.Details).First();
                if (stockInfo == null)
                {
                    return WebResponseContent.Instance.Error($"未找到托盘对应的组盘信息");
                }
                if (!string.IsNullOrEmpty(stockInfo.LocationCode))
                {
                    return WebResponseContent.Instance.Error($"该托盘已绑定货位");
                }
                if (stockInfo.Details.Count == 0 && stockInfo.PalletType != PalletTypeEnum.Empty.ObjToInt())
                {
@@ -1178,6 +1240,7 @@
                {
                    task.TaskStatus = TaskStatusEnum.Cancel.ObjToInt();
                    _unitOfWorkManage.BeginTran();
                    FeedBackWCSTaskHandCancel(taskNum);
                    BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.人工删除 : OperateTypeEnum.自动删除);
                    _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateTypeEnum.自动删除 : OperateTypeEnum.人工删除);
                    _stockService.StockInfoDetailService.Repository.DeleteAndMoveIntoHty(stockInfo.Details, App.User.UserId == 0 ? OperateTypeEnum.自动删除 : OperateTypeEnum.人工删除);
@@ -1191,17 +1254,190 @@
                    {
                        return WebResponseContent.Instance.Error($"货位状态不正确");
                    }
                    LocationStatusEnum lastStatus = (LocationStatusEnum)locationInfo.LocationStatus;
                    locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt();
                    locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt();
                }
                Dt_InboundOrder? inboundOrder = _inboundRepository.InboundOrderRepository.Db.Queryable<Dt_InboundOrder>().Where(x => x.InboundOrderNo == stockInfo.Details.FirstOrDefault().OrderNo).Includes(x => x.Details).First();
                Dt_InboundOrderDetail? inboundOrderDetail = null;
                Dt_ReturnOrder? returnOrder = null;
                //标准入库流程查找入库单据
                if (inboundOrder != null && stockInfo.StockStatus == StockStatusEmun.入库确认.ObjToInt()&&(task.WarehouseId == WarehouseEnum.HA152.ObjToInt()|| task.WarehouseId == WarehouseEnum.HA58.ObjToInt()))
                {
                    inboundOrderDetail = inboundOrder.Details.FirstOrDefault(x => x.RowNo == stockInfo.Details.FirstOrDefault()?.InboundOrderRowNo);
                    foreach (var item in stockInfo.Details)
                    {
                        if (inboundOrderDetail == null)
                        {
                            continue;
                        }
                        inboundOrderDetail.ReceiptQuantity -= item.StockQuantity;
                    }
                    //判断是否为退料入库单
                    if (inboundOrder.OrderType == InOrderTypeEnum.Return.ObjToInt())
                    {
                        returnOrder = _inboundRepository.ReturnOrderRepository.Db.Queryable<Dt_ReturnOrder>().Where(x => x.OrderNo == inboundOrder.UpperOrderNo).Includes(x => x.Details).First();
                        returnOrder.ReturnOrderStatus = ReturnOrderStatusEnum.Returned.ObjToInt();
                        foreach (var item in inboundOrder.Details)
                        {
                            Dt_ReturnOrderDetail returnOrderDetail = returnOrder.Details?.FirstOrDefault(x => x.MCode == item.MaterielCode);
                            if (returnOrderDetail != null)
                            {
                                returnOrderDetail.ReturnQty -= item.ReceiptQuantity;
                            }
                        }
                    }
                }
                if(task.WarehouseId == WarehouseEnum.HA154.ObjToInt()|| task.WarehouseId == WarehouseEnum.HA152.ObjToInt() || task.WarehouseId == WarehouseEnum.HA58.ObjToInt())
                {
                    _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateTypeEnum.自动删除 : OperateTypeEnum.人工删除);
                    _stockService.StockInfoDetailService.Repository.DeleteAndMoveIntoHty(stockInfo.Details, App.User.UserId == 0 ? OperateTypeEnum.自动删除 : OperateTypeEnum.人工删除);
                }else
                {
                    stockInfo.StockStatus = StockStatusEmun.组盘暂存.ObjToInt();
                }
                task.TaskStatus = TaskStatusEnum.Cancel.ObjToInt();
                FeedBackWCSTaskHandCancel(taskNum);
                _unitOfWorkManage.BeginTran();
                BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.人工删除 : OperateTypeEnum.人工删除);
                _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, stockInfo.PalletType, LocationStatusEnum.Free, stockInfo.WarehouseId);
                _stockRepository.StockInfoRepository.UpdateData(stockInfo);
                if (inboundOrder != null && inboundOrderDetail != null)
                {
                    _inboundRepository.InboundOrderRepository.UpdateData(inboundOrder);
                    _inboundRepository.InboundOrderDetailRepository.UpdateData(inboundOrderDetail);
                }
                if (returnOrder != null)
                {
                    _inboundRepository.ReturnOrderRepository.UpdateData(returnOrder);
                    _inboundRepository.ReturnOrderDetailRepository.UpdateData(returnOrder.Details);
                }
                _unitOfWorkManage.CommitTran();
                return WebResponseContent.Instance.OK();
            }
            catch(Exception ex)
            {
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        public WebResponseContent OutboundTaskHandCancel(int taskNum)
        {
            try
            {
                Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum);
                if (task == null)
                {
                    return WebResponseContent.Instance.Error($"未找到该任务信息");
                }
                Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == task.WarehouseId);
                if (warehouse.WarehouseType == WarehouseTypEnum.成品.ToString())
                {
                    Dt_ProStockInfo proStockInfo = _stockRepository.ProStockInfoRepository.Db.Queryable<Dt_ProStockInfo>().Where(x => x.PalletCode == task.PalletCode).Includes(x => x.proStockInfoDetails).First();
                    if (proStockInfo == null)
                    {
                        return WebResponseContent.Instance.Error($"未找到胶框为{task.PalletCode}组盘信息");
                    }
                    Dt_LocationInfo prolocationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress);
                    if (prolocationInfo != null)
                    {
                        if (prolocationInfo.LocationStatus == LocationStatusEnum.Free.ObjToInt())
                        {
                            return WebResponseContent.Instance.Error($"货位状态不正确");
                        }
                        prolocationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt();
                    }
                    proStockInfo.StockStatus = StockStatusEmun.入库完成.ObjToInt();
                    proStockInfo.proStockInfoDetails.ForEach(x =>
                    {
                        x.ProOutDetailStatus = StockStatusEmun.入库完成.ObjToInt();
                        x.OutboundQuantity = 0;
                    });
                    task.TaskStatus = TaskStatusEnum.Cancel.ObjToInt();
                    _unitOfWorkManage.BeginTran();
                    FeedBackWCSTaskHandCancel(taskNum);
                    BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.人工删除 : OperateTypeEnum.自动删除);
                    _stockService.ProStockInfoService.Repository.UpdateData(proStockInfo);
                    _stockService.ProStockInfoDetailService.Repository.UpdateData(proStockInfo.proStockInfoDetails);
                    _basicService.LocationInfoService.UpdateLocationStatus(prolocationInfo, proStockInfo.PalletType, LocationStatusEnum.InStock, proStockInfo.WarehouseId);
                    _unitOfWorkManage.CommitTran();
                    return WebResponseContent.Instance.OK();
                }
                Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == task.PalletCode && x.WarehouseId == task.WarehouseId).Includes(x => x.Details).First();
                if (stockInfo == null)
                {
                    return WebResponseContent.Instance.Error($"未找到托盘对应的组盘信息");
                }
                if (string.IsNullOrEmpty(stockInfo.LocationCode))
                {
                    return WebResponseContent.Instance.Error($"该托盘在立库未绑定货位");
                }
                if (stockInfo.Details.Count == 0 && stockInfo.PalletType != PalletTypeEnum.Empty.ObjToInt())
                {
                    return WebResponseContent.Instance.Error($"未找到该托盘库存明细信息");
                }
                Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress);
                if (locationInfo != null)
                {
                    if (locationInfo.LocationStatus == LocationStatusEnum.Free.ObjToInt())
                    {
                        return WebResponseContent.Instance.Error($"货位状态不正确");
                    }
                    locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt();
                }
                stockInfo.StockStatus = StockStatusEmun.入库完成.ObjToInt();
                stockInfo.Details.ForEach(x =>
                {
                    x.Status = StockStatusEmun.入库完成.ObjToInt();
                    x.OutboundQuantity = 0;
                });
                task.TaskStatus = TaskStatusEnum.Cancel.ObjToInt();
                FeedBackWCSTaskHandCancel(taskNum);
                _unitOfWorkManage.BeginTran();
                BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.人工删除 : OperateTypeEnum.人工删除);
                _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, stockInfo.PalletType, LocationStatusEnum.InStock, stockInfo.WarehouseId);
                _stockRepository.StockInfoRepository.UpdateData(stockInfo);
                _stockRepository.StockInfoDetailRepository.UpdateData(stockInfo.Details);
                _unitOfWorkManage.CommitTran();
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        public WebResponseContent RelocationTaskHandCancel(Dt_Task task)
        {
            Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress);
            if (stockInfo == null)
            {
                return WebResponseContent.Instance.Error($"未找到对应货位的库存信息");
            }
            Dt_LocationInfo locationInfoStart = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress);
            if (locationInfoStart == null)
            {
                return WebResponseContent.Instance.Error($"未找到对应的起点货位信息");
            }
            Dt_LocationInfo locationInfoEnd = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress);
            if (locationInfoEnd == null)
            {
                return WebResponseContent.Instance.Error($"未找到对应的终点货位信息");
            }
            task.TaskStatus = TaskStatusEnum.Cancel.ObjToInt();
            FeedBackWCSTaskHandCancel(task.TaskNum);
            _unitOfWorkManage.BeginTran();
            stockInfo.StockStatus = StockStatusEmun.入库完成.ObjToInt();
            _stockService.StockInfoService.Repository.UpdateData(stockInfo);
            _basicService.LocationInfoService.UpdateLocationStatus(locationInfoStart, stockInfo.PalletType, LocationStatusEnum.InStock, stockInfo.WarehouseId);
            _basicService.LocationInfoService.UpdateLocationStatus(locationInfoEnd, stockInfo.PalletType, LocationStatusEnum.Free, stockInfo.WarehouseId);
            BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? WIDESEA_Core.Enums.OperateTypeEnum.人工删除 : WIDESEA_Core.Enums.OperateTypeEnum.自动删除);
            _unitOfWorkManage.CommitTran();
            return WebResponseContent.Instance.OK();
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Completed.cs
@@ -136,13 +136,38 @@
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        /// <summary>
        /// å›žè°ƒwcs手动取消任务
        /// </summary>
        /// <param name="taskNum"></param>
        /// <returns></returns>
        public WebResponseContent FeedBackWCSTaskHandCancel(int taskNum)
        {
            try
            {
                Dt_ApiInfo? url = _apiInfoRepository.QueryData(x => x.ApiCode == APIEnum.FeedBackWCSTaskHandCancel.ToString()).First();
                string? apiAddress = url.ApiAddress;
                if (string.IsNullOrEmpty(apiAddress))
                {
                    return WebResponseContent.Instance.Error($"{taskNum},未找到WCS任务完成接口,请检查接口配置");
                }
                string responseStr = HttpHelper.Get(apiAddress + "?taskNum=" + taskNum);
                WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(responseStr) ?? WebResponseContent.Instance.Error("未找到任务完成返回值");
                return content;
            }
            catch (Exception ex)
            {
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        /// <summary>
        /// ä»»åŠ¡å–æ¶ˆ
        /// </summary>
        /// <param name="taskNum"></param>
        /// <param name="warehouseId"></param>
        /// <returns></returns>
        public async Task<WebResponseContent> TaskHandCancel(int taskNum,int warehouseId)
        public async Task<WebResponseContent> TaskHandCancel(int taskNum)
        {
            try
            {
@@ -153,15 +178,15 @@
                }
                if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)
                {
                    return await Task.FromResult(InboundTaskCompleted(taskNum));
                    return await Task.FromResult(InboundTaskHandCancel(taskNum));
                }
                else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
                {
                    return await Task.FromResult(OutboundTaskCompleted(taskNum));
                    return await Task.FromResult(OutboundTaskHandCancel(taskNum));
                }
                else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup)
                {
                    return await Task.FromResult(RelocationTaskCompleted(task));
                    return await Task.FromResult(RelocationTaskHandCancel(task));
                }
                else
                {
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Reloaction.cs
@@ -49,7 +49,7 @@
                }
                else
                {
                    Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.LocationCode == needRelocationItem.LocationCode);
                    Dt_StockInfo stockInfo = _stockService.StockInfoService.Db.Queryable<Dt_StockInfo>().Where(x => x.LocationCode == needRelocationItem.LocationCode).Includes(x => x.Details).First();
                    if (stockInfo == null)
                    {
                        return WebResponseContent.Instance.Error($"未找到对应货位的库存信息");
@@ -94,7 +94,15 @@
                            TaskStatus = 0,
                            TaskType = TaskTypeEnum.Relocation.ObjToInt()
                        };
                        string MaterielCode = stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.MaterielCode;
                        float Quantity = (float)stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).Sum(x => x.StockQuantity);
                        string BatchNo = stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.BatchNo;
                        if (MaterielCode != null && Quantity != null && BatchNo != null)
                        {
                            newTask.MaterielCode = MaterielCode;
                            newTask.Quantity = Quantity;
                            newTask.BatchNo = BatchNo;
                        }
                        if (stockInfo.StockLength>0)
                        {
                            newTask.TaskLength = stockInfo.StockLength;
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs
@@ -413,10 +413,10 @@
        /// </summary>
        /// <param name="taskNum">任务号</param>
        /// <returns></returns>
        [HttpPost, HttpGet, Route("TaskHandCa"), AllowAnonymous]
        public async Task<WebResponseContent> TaskHandCancel(int taskNum ,int warehouseId)
        [HttpPost, HttpGet, Route("TaskHandCancel"), AllowAnonymous]
        public async Task<WebResponseContent> TaskHandCancel(int taskNum)
        {
            return await Service.TaskHandCancel(taskNum,warehouseId);
            return await Service.TaskHandCancel(taskNum);
        }
    }
}