From 28670e94bb74ba937fe0ff73334ec68e969beef9 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@63.com> Date: 星期一, 28 三月 2022 17:05:37 +0800 Subject: [PATCH] # --- src/main/java/com/zy/asrs/controller/OutController.java | 17 ++++++++++++++--- 1 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/zy/asrs/controller/OutController.java b/src/main/java/com/zy/asrs/controller/OutController.java index 01d6dbb..483db64 100644 --- a/src/main/java/com/zy/asrs/controller/OutController.java +++ b/src/main/java/com/zy/asrs/controller/OutController.java @@ -5,6 +5,7 @@ import com.core.common.BaseRes; import com.core.common.Cools; import com.core.common.R; +import com.zy.asrs.entity.BasDevp; import com.zy.asrs.entity.LocDetl; import com.zy.asrs.entity.OrderDetl; import com.zy.asrs.entity.result.StoPreTab; @@ -37,6 +38,11 @@ private LocMastService locMastService; @Autowired private StaDescService staDescService; + @Autowired + private WorkService workService; + @Autowired + private BasDevpService basDevpService; + // @PostMapping("/out/pakout/preview/auth") // public R pakoutPreview(@RequestBody List<Long> ids) { @@ -106,14 +112,15 @@ @PostMapping("/out/pakout/auth") @ManagerAuth(memo = "璁㈠崟鍑哄簱") - public R pakout(@RequestBody List<LocDto> locDtos) { + public synchronized R pakout(@RequestBody List<LocDto> locDtos) { if (Cools.isEmpty(locDtos)) { return R.parse(BaseRes.PARAM); } List<TaskDto> taskDtos = new ArrayList<>(); + // 鏍规嵁 锛堝簱浣� & 鍑哄簱绔欙級 鍒嗙粍锛� 鐞嗘兂鐘舵�侊細涓�缁勪负涓�娆″嚭搴撲换鍔� for (LocDto locDto : locDtos) { if (locDto.isLack()) { continue; } - TaskDto taskDto = new TaskDto(locDto.getLocNo(), locDto.getStaNo(), Collections.singletonList(locDto)); + TaskDto taskDto = new TaskDto(locDto.getLocNo(), locDto.getStaNo(), locDto); if (TaskDto.has(taskDtos, taskDto)) { TaskDto dto = TaskDto.find(taskDtos, taskDto); assert dto != null; @@ -122,7 +129,11 @@ taskDtos.add(taskDto); } } - System.out.println(JSON.toJSONString(locDtos)); + // ----------------------------------------------------------------------------------------------- + for (TaskDto taskDto : taskDtos) { + BasDevp staNo = basDevpService.checkSiteStatus(taskDto.getStaNo()); + workService.stockOut(staNo, taskDto, getUserId()); + } return R.ok(); } -- Gitblit v1.9.1