From 05b8ccfc9eeadddd65e95ea82479c224d1516b4c Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期四, 07 八月 2025 19:19:33 +0800
Subject: [PATCH] no message

---
 zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/LocDetlServiceImpl.java |   35 ++++++++++++++++++-----------------
 1 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/LocDetlServiceImpl.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/LocDetlServiceImpl.java
index 6e726af..0bdab34 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/LocDetlServiceImpl.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/LocDetlServiceImpl.java
@@ -26,6 +26,7 @@
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.*;
+import java.util.stream.Collectors;
 
 @Service("locDetlService")
 public class LocDetlServiceImpl extends ServiceImpl<LocDetlMapper, LocDetl> implements LocDetlService {
@@ -42,15 +43,14 @@
     @Override
     public PageParam<ViewLocDetl, BaseParam> getPage(PageParam<ViewLocDetl, BaseParam> pageParam, QueryWrapper<ViewLocDetl> buildWrapper) {
         PageParam<ViewLocDetl, BaseParam> result = viewLocDetlMapper.selectPage(pageParam, buildWrapper);
-
         //瑙f瀽鍔ㄦ�佸瓧娈�
-        JSONObject data = JSON.parseObject(JSON.toJSONString(result));
-        List<ViewLocDetl> records = result.getRecords();
-        data.put("records", records);
-        for (ViewLocDetl locDetl : records) {
-            Map<String, Object> resultMap = viewLocDetlMapper.getById(locDetl.getId());
-            locDetl.syncFieldMap(resultMap);
-        }
+//        JSONObject data = JSON.parseObject(JSON.toJSONString(result));
+//        List<ViewLocDetl> records = result.getRecords();
+//        data.put("records", records);
+//        for (ViewLocDetl locDetl : records) {
+//            Map<String, Object> resultMap = viewLocDetlMapper.getById(locDetl.getId());
+//            locDetl.syncFieldMap(resultMap);
+//        }
         return result;
     }
 
@@ -103,9 +103,9 @@
 
     @Override
     public List<LocDetl> queryStock(String matnr, String batch, List<FieldParam> param, List<FieldSortParam> sortParam) {
-        List<Map<String, Object>> list = viewLocDetlMapper.queryStock(matnr, batch, param, sortParam);
+        List<Map<String, Object>> list = viewLocDetlMapper.queryStock(matnr, batch, param, sortParam, LocAreaTypeSts.LOC_AREA_TYPE_UTC.id);
         List<LocDetl> locDetlsSort = resortDetls(list);
-        return locDetlsSort;
+        return locDetlsSort.stream().sorted(Comparator.comparing(LocDetl::getCreateTime)).collect(Collectors.toList());
     }
 
     private List<LocDetl> resortDetls(List<Map<String, Object>> list) {
@@ -156,6 +156,7 @@
 
             for (Integer row : direction) {
                 Loc one = locService.getOne(new LambdaQueryWrapper<Loc>()
+                                .select(Loc::getId)
                         .eq(Loc::getRow1, row)
                         .eq(Loc::getBay1, loc.getBay1())
                         .eq(Loc::getLev1, loc.getLev1()));
@@ -213,18 +214,18 @@
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public void removeLocDetl(Long locId) {
         List<LocDetl> locDetls = this.list(new LambdaQueryWrapper<LocDetl>().eq(LocDetl::getLocId, locId));
         for (LocDetl locDetl : locDetls) {
             boolean remove = locDetlFieldService.remove(new LambdaQueryWrapper<LocDetlField>().eq(LocDetlField::getDetlId, locDetl.getId()));
-            if (!remove) {
-                throw new CoolException("鎵╁睍瀛楁鍒犻櫎澶辫触");
-            }
-
+//            if (!remove) {
+//                throw new CoolException("鎵╁睍瀛楁鍒犻櫎澶辫触");
+//            }
             boolean result = this.removeById(locDetl.getId());
-            if (!result) {
-                throw new CoolException("鏄庣粏鍒犻櫎澶辫触");
-            }
+//            if (!result) {
+//                throw new CoolException("鏄庣粏鍒犻櫎澶辫触");
+//            }
         }
     }
 

--
Gitblit v1.9.1