From fa5d671a53597db853ac1ab2e99f12f0acda8315 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期五, 27 六月 2025 10:54:13 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
index bfab5c5..b28176a 100644
--- a/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
@@ -20,7 +20,9 @@
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.time.LocalDate;
 import java.util.ArrayList;
+import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
 
@@ -617,4 +619,23 @@
 
     }
 
+    @Override
+    public int syncAnfmeToWeight() {
+        Date date = new Date(2025, Calendar.JULY, 24);
+        Date date2 = new Date(2025, Calendar.JULY, 24, 23, 59, 59);
+        List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>()
+                .ge("appe_time", date)
+                .le("appe_time", date2)
+        );
+
+        int i = 0;
+        for (LocDetl locDetl : locDetls) {
+            // 淇敼搴撳瓨
+            Double anfme = MatUtils.calcAnfmeFromWeight(locDetl.getMatnr(), locDetl.getAnfme());
+            locDetlService.updateAnfme(anfme, locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getBatch(), locDetl.getBrand(),
+                    locDetl.getStandby1(), locDetl.getStandby2(), locDetl.getStandby3(), locDetl.getBoxType1(), locDetl.getBoxType2(), locDetl.getBoxType3());
+            i++;
+        }
+        return i;
+    }
 }

--
Gitblit v1.9.1