From d8cbd9c0b6ae133dc0cf09488f124d66296e70ee Mon Sep 17 00:00:00 2001 From: lty <876263681@qq.com> Date: 星期一, 21 四月 2025 08:44:36 +0800 Subject: [PATCH] # --- src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 43 insertions(+), 1 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 a0e4feb..4c0590a 100644 --- a/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java @@ -18,7 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; - +import com.zy.asrs.entity.CheckDetl; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -48,6 +48,8 @@ private TagService tagService; @Autowired private TagMapper tagMapper; + @Autowired + private CheckDetlService checkDetlService; @Override @Transactional @@ -601,6 +603,46 @@ } } } + @Override + @Transactional + public void check(List<MatSyncParam> paramList){ + if (Cools.isEmpty(paramList)) { + throw new CoolException("涓婃姤鏁版嵁涓虹┖"); + } + + for (MatSyncParam param : paramList) { + if (Cools.isEmpty(param.getData()) || param.getData().isEmpty()) { + throw new CoolException("鐗╂枡鏁版嵁涓虹┖"); + } + + for (MatSyncParam.MatParam matParam : param.getData()) { + if (Cools.isEmpty(matParam.getMatnr())) { + throw new CoolException("鍟嗗搧缂栫爜涓虹┖"); + } + + Double LKAnfme = locDetlService.getAnfmeByMatnr(matParam.getMatnr()); + if (LKAnfme == null) { + LKAnfme = 0.0; + } + + // 璁$畻宸�� + double diff = matParam.getAnfme() - LKAnfme; + + if (diff != 0) { + CheckDetl checkDetl = new CheckDetl(); + checkDetl.setAnfme(diff); //杩欓噷璁板綍宸�� + checkDetl.setMatnr(matParam.getMatnr()); + checkDetl.setMaktx(matParam.getMaktx()); + checkDetl.setSpecs(matParam.getSpecs()); + checkDetl.setCreateTime(new Date()); + + checkDetlService.insert(checkDetl); // 鎻掑叆宸紓璁板綍 + } + } + } + } + + -- Gitblit v1.9.1