From 8ffbbc8dd4e15fcaf44bff0e0763a53c59ac9b44 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Tue, 22 Oct 2024 16:55:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=9B=98=E7=82=B9=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=88=B0input=5Fapply=5Fdetails?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InventoryAndWarehousingServiceImpl.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/InventoryAndWarehousingServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/InventoryAndWarehousingServiceImpl.java index 00fd9d9..4f2c662 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/InventoryAndWarehousingServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/InventoryAndWarehousingServiceImpl.java @@ -1,5 +1,6 @@ package com.bonus.sgzb.material.service.impl; +import com.bonus.sgzb.app.mapper.PurchaseInputMapper; import com.bonus.sgzb.common.core.exception.ServiceException; import com.bonus.sgzb.common.core.utils.DateUtils; import com.bonus.sgzb.common.core.utils.StringUtils; @@ -8,6 +9,7 @@ import com.bonus.sgzb.common.security.utils.SecurityUtils; import com.bonus.sgzb.material.config.ExceptionEnum; import com.bonus.sgzb.material.config.FieldGenerator; import com.bonus.sgzb.base.api.domain.MachIneDto; +import com.bonus.sgzb.app.domain.InputApplyDetails; import com.bonus.sgzb.material.domain.PutInStorageBean; import com.bonus.sgzb.base.api.domain.SavePutInfoDto; import com.bonus.sgzb.material.mapper.InventoryAndWarehousingMapper; @@ -36,6 +38,9 @@ public class InventoryAndWarehousingServiceImpl implements InventoryAndWarehousi @Autowired private InventoryAndWarehousingMapper inventoryAndWarehousingMapper; + @Autowired + private PurchaseInputMapper purchaseInputMapper; + /** * 查询入库盘点列表 * @param bean @@ -132,6 +137,21 @@ public class InventoryAndWarehousingServiceImpl implements InventoryAndWarehousi throw new RuntimeException("insertPutInfo方法插入异常"); } } + + // 盘点入库任务详细表 + if (CollectionUtils.isNotEmpty(machIneDtoList)) { + for (MachIneDto machIneDto : machIneDtoList) { + InputApplyDetails applyDetails = new InputApplyDetails(); + applyDetails.setTaskId(0L); + applyDetails.setTypeId(Long.parseLong(machIneDto.getTypeId())); + applyDetails.setInputNum(machIneDto.getPutInStoreNum() == null ? 0 : machIneDto.getPutInStoreNum()); + applyDetails.setMaId(machIneDto.getMaId()); + applyDetails.setInputType("4"); + applyDetails.setCreateTime(new Date()); + applyDetails.setCreateBy(SecurityUtils.getUsername()); + purchaseInputMapper.insertInputApplyDetails(applyDetails); + } + } } catch (Exception e) { log.error("保存入库盘点异常:{}",e.getMessage()); // 添加事务回滚逻辑,保证入库全部成功或者全部失败 From ef59a9c0844c1c78f757e514af9855951418c945 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Tue, 22 Oct 2024 17:37:11 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=9B=98=E7=82=B9=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=88=B0input=5Fapply=5Fdetails?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/InventoryAndWarehousingServiceImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/InventoryAndWarehousingServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/InventoryAndWarehousingServiceImpl.java index 4f2c662..a659a96 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/InventoryAndWarehousingServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/InventoryAndWarehousingServiceImpl.java @@ -144,7 +144,11 @@ public class InventoryAndWarehousingServiceImpl implements InventoryAndWarehousi InputApplyDetails applyDetails = new InputApplyDetails(); applyDetails.setTaskId(0L); applyDetails.setTypeId(Long.parseLong(machIneDto.getTypeId())); - applyDetails.setInputNum(machIneDto.getPutInStoreNum() == null ? 0 : machIneDto.getPutInStoreNum()); + if (StringUtils.isEmpty(machIneDto.getMaCode())) { + applyDetails.setInputNum(machIneDto.getPutInStoreNum() == null ? 0 : machIneDto.getPutInStoreNum()); + } else { + applyDetails.setInputNum(1); + } applyDetails.setMaId(machIneDto.getMaId()); applyDetails.setInputType("4"); applyDetails.setCreateTime(new Date());