From 6166b702c4cf716302e44cc118bc8e5fc8e909b3 Mon Sep 17 00:00:00 2001
From: skyouc <creaycat@gmail.com>
Date: 星期四, 25 十二月 2025 16:11:18 +0800
Subject: [PATCH] 问题修复及优化

---
 rsf-admin/src/page/warehouseAreas/WarehouseAreasCreate.jsx                                  |    3 ++-
 rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/LocServiceImpl.java    |    2 +-
 rsf-admin/src/page/orders/asnOrder/AsnOrderList.jsx                                         |    2 --
 rsf-admin/src/i18n/zh.js                                                                    |    3 +++
 rsf-admin/src/page/system/menu/MenuList.jsx                                                 |   21 ++++++++++++++++-----
 rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/LocController.java       |    9 ++++++---
 rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/WarehouseController.java |    5 ++---
 rsf-admin/src/i18n/en.js                                                                    |    5 ++++-
 8 files changed, 34 insertions(+), 16 deletions(-)

diff --git a/rsf-admin/src/i18n/en.js b/rsf-admin/src/i18n/en.js
index 2e3b8db..152654b 100644
--- a/rsf-admin/src/i18n/en.js
+++ b/rsf-admin/src/i18n/en.js
@@ -217,7 +217,7 @@
         locDeadReport: 'Locs Dead Report',
         stockStatistic: 'Stock Statistic',
         statisticCount: 'Statistic Count',
-        preparation:"澶囨枡鍗�",
+        preparation: "澶囨枡鍗�",
     },
     table: {
         field: {
@@ -1364,6 +1364,9 @@
         selectWave: 'Select Wave Rule',
 
     },
+    placeholder: {
+        warehouseAreasCode: "use for warehouse areas code prefix",
+    },
     request: {
         error: {
             stock: "Insufficient inventory to deliver 锛侊紒",
diff --git a/rsf-admin/src/i18n/zh.js b/rsf-admin/src/i18n/zh.js
index c56d5f1..d8bd10b 100644
--- a/rsf-admin/src/i18n/zh.js
+++ b/rsf-admin/src/i18n/zh.js
@@ -1402,6 +1402,9 @@
         modiftySite: '淇敼搴撳彛',
         selectWave: '娉㈡瑙勫垯',
     },
+    placeholder: {
+        warehouseAreasCode: "鐢ㄤ簬搴撲綅缂栫爜鍓嶇紑鍗犱綅绗�",
+    },
     request: {
         error: {
             stock: "搴撳瓨涓嶈冻锛屾棤娉曟彁浜わ紒锛�",
diff --git a/rsf-admin/src/page/orders/asnOrder/AsnOrderList.jsx b/rsf-admin/src/page/orders/asnOrder/AsnOrderList.jsx
index 3f38817..30787ea 100644
--- a/rsf-admin/src/page/orders/asnOrder/AsnOrderList.jsx
+++ b/rsf-admin/src/page/orders/asnOrder/AsnOrderList.jsx
@@ -414,8 +414,6 @@
     // </Button> : )
     record.exceStatus === 1 ? <ConfirmButton label={"toolbar.complete"} color="secondary" startIcon={<TaskIcon />} onConfirm={requestComplete} /> : <></>
   )
-
-
 }
 
 const CloseButton = () => {
diff --git a/rsf-admin/src/page/system/menu/MenuList.jsx b/rsf-admin/src/page/system/menu/MenuList.jsx
index 5c50e52..74e8c36 100644
--- a/rsf-admin/src/page/system/menu/MenuList.jsx
+++ b/rsf-admin/src/page/system/menu/MenuList.jsx
@@ -199,7 +199,6 @@
                                 onClick={() => column.id === 'name' && toggleNode(row.id)}
                                 sx={{
                                     opacity: column.id === 'icon' ? 0.6 : (depth > 0 ? opacity : 1),
-                                    color: depth > 0 ? `rgba(0, 0, 0, ${opacity})` : 'inherit',
                                     fontWeight: 400,
                                     // 浣跨敤瀛椾綋澶у皬鎴栭鑹叉潵鍖哄垎灞傜骇
                                     fontSize: depth === 0 ? '0.95rem' : '0.9rem',
@@ -267,6 +266,14 @@
     const [editRecord, setEditRecord] = React.useState(null);
     const [openNodes, setOpenNodes] = React.useState({});
     const [expandAll, setExpandAll] = React.useState(false);
+    const notifyState = React.useRef({ last: '', at: 0 });
+    const pushNotify = React.useCallback((type, msg) => {
+        const text = typeof msg === 'string' ? msg : (msg || '');
+        const now = Date.now();
+        if (notifyState.current.last === text && now - notifyState.current.at < 1500) return;
+        notifyState.current = { last: text, at: now };
+        notify(text, { type, messageArgs: { _: text } });
+    }, [notify]);
 
     const http = async () => {
         const res = await request.post(RESOURCE + '/tree', {
@@ -275,7 +282,8 @@
         if (res?.data?.code === 200) {
             setTreeData(res.data.data);
         } else {
-            notify(res.data.msg);
+            const msg = translate('ra.notification.http_error', { _: res?.data?.msg || 'Request failed' });
+            pushNotify('warning', msg);
         }
     }
 
@@ -305,10 +313,12 @@
                 {
                     onSuccess: () => {
                         handleRefresh();
-                        notify('Department deleted successfully', { type: 'info', messageArgs: { _: 'Department deleted successfully' } });
+                        const msg = translate('ra.message.delete_success', { _: 'Deleted successfully' });
+                        pushNotify('success', msg);
                     },
                     onError: (error) => {
-                        notify(`Error: ${error.message}`, { type: 'warning', messageArgs: { _: `Error: ${error.message}` } });
+                        const msg = translate('ra.notification.http_error', { _: error?.message || 'Network error' });
+                        pushNotify('error', msg);
                     },
                 }
             );
@@ -320,6 +330,7 @@
             const newExpandAll = !prevExpandAll;
             const newOpenNodes = {};
             const updateOpenNodes = (nodes) => {
+                if (!nodes) return;
                 nodes.forEach(node => {
                     newOpenNodes[node.id] = newExpandAll;
                     if (node.children) {
@@ -442,4 +453,4 @@
     );
 };
 
-export default MenuList;
\ No newline at end of file
+export default MenuList;
diff --git a/rsf-admin/src/page/warehouseAreas/WarehouseAreasCreate.jsx b/rsf-admin/src/page/warehouseAreas/WarehouseAreasCreate.jsx
index 3d0ee89..f7af039 100644
--- a/rsf-admin/src/page/warehouseAreas/WarehouseAreasCreate.jsx
+++ b/rsf-admin/src/page/warehouseAreas/WarehouseAreasCreate.jsx
@@ -103,11 +103,12 @@
                     source="code"
                     validate={[required()]}
                     parse={(v) => v}
+                    placeholder={translate("placeholder.warehouseAreasCode")}
                   />
                   <AutocompleteInput
                     choices={dicts}
                     optionText="label"
-                    label="table.field.asnOrder.type"
+                    label="table.field.warehouseAreas.type"
                     source="type"
                     optionValue="value"
                     parse={v => v}
diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/LocController.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/LocController.java
index e68e8c8..bf11e25 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/LocController.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/LocController.java
@@ -127,10 +127,13 @@
     public R update(@RequestBody Loc loc) {
         loc.setUpdateBy(getLoginUserId());
         String join = StringUtils.join(loc.getTypeIds(), ",");
-        loc.setType(join);
-        if (Objects.isNull(loc.getTypeIds())) {
-            throw new CoolException("搴撲綅绫诲瀷涓嶈兘涓虹┖锛侊紒");
+        if (!Objects.isNull(loc.getTypeIds())) {
+            loc.setType(join);
         }
+        if (Objects.isNull(loc.getTypeIds()) && !Objects.isNull(loc.getType())) {
+            loc.setTypeIds(Arrays.asList(Long.valueOf(loc.getType())));
+        }
+
         if (!locService.updateById(loc)) {
             return R.error("Update Fail");
         }
diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/WarehouseController.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/WarehouseController.java
index 86ee120..e14b884 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/WarehouseController.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/WarehouseController.java
@@ -104,18 +104,17 @@
 
         Warehouse warehouse1 = warehouseService.getById(warehouse.getId());
         if (!warehouse.getName().equals(warehouse1.getName())) {
-            List<Warehouse> areasList = warehouseService.list(new LambdaQueryWrapper<Warehouse>().eq(Warehouse::getName, warehouse1.getName()));
+            List<Warehouse> areasList = warehouseService.list(new LambdaQueryWrapper<Warehouse>().eq(Warehouse::getName, warehouse.getName()));
             if (!areasList.isEmpty()) {
                 throw new CoolException("浠撳簱鍚嶅凡瀛樺湪锛侊紒");
             }
         }
         if (!warehouse.getCode().equals(warehouse1.getCode())) {
-            List<Warehouse> areasList = warehouseService.list(new LambdaQueryWrapper<Warehouse>().eq(Warehouse::getCode, warehouse1.getCode()));
+            List<Warehouse> areasList = warehouseService.list(new LambdaQueryWrapper<Warehouse>().eq(Warehouse::getCode, warehouse.getCode()));
             if (!areasList.isEmpty()) {
                 throw new CoolException("浠撳簱缂栫爜宸插瓨鍦紒锛�");
             }
         }
-
 
         if (!warehouseService.updateById(warehouse)) {
             return R.error("Update Fail");
diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/LocServiceImpl.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/LocServiceImpl.java
index 0e59c09..9c7b6cc 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/LocServiceImpl.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/LocServiceImpl.java
@@ -115,7 +115,7 @@
         Integer chanl = 0; //榛樿绗竴宸烽亾
         for (int r = param.getStartRow(); r <= param.getEndRow(); r++) {
             try{
-                Shelves shelves = new Shelves(param.getEndRow() - param.getStartRow() + 1, param.getChannel(),param.getStartRow());
+                Shelves shelves = new Shelves(param.getEndRow() - param.getStartRow() + 1, param.getChannel(), param.getStartRow());
                 for (List<Integer> node : shelves.nodes){
                     if (node.contains(r)) {
                         if (!Cools.isEmpty(param.getStartChannel()) && param.getStartChannel() > 0){

--
Gitblit v1.9.1