From c2970de1b82a4e769b2e09b1186f498d45697399 Mon Sep 17 00:00:00 2001 From: hongchao <3228015117@qq.com> Date: Sun, 14 Sep 2025 19:15:38 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=98=E7=82=B9=E5=85=A5=E5=BA=93=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bonus/material/ma/domain/Type.java | 5 +++++ .../ma/service/impl/TypeServiceImpl.java | 19 ++++++++++++++++--- .../mapper/material/ma/TypeMapper.xml | 4 ++++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java index 34144235..c8b55cc4 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java @@ -302,4 +302,9 @@ public class Type extends BaseEntity { @ApiModelProperty(value="状态:默认0,其他为异常状态") private Integer status; + + @ApiModelProperty(value="操作结果") + private String resultMsg; + + private Integer inputType; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java index 3772fa43..1c51a6f4 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java @@ -254,6 +254,7 @@ public class TypeServiceImpl implements ITypeService { type.setMaterialName(info.getMaterialName()); type.setTypeName(info.getTypeName()); type.setMethod("/warehousing/addList"); + type.setResultMsg("操作成功"); type.setStatus(0); // 插入修改记录 if ("1".equals(type.getStyle())) { @@ -280,13 +281,25 @@ public class TypeServiceImpl implements ITypeService { } else { throw new RuntimeException("更新库存失败"); } - //盘点往bm_storage_log表 - if ("3".equals(type.getStyle())) { + try { + //盘点往bm_storage_log表 + if ("3".equals(type.getStyle())) { + if(type.getMaId()!=null){ + type.setInputType(0); + }else{ + type.setInputType(1); + } + typeMapper.insertBmStorageNumLog(type); + } + } catch (Exception e) { + type.setResultMsg("操作失败"); + type.setStatus(1); typeMapper.insertBmStorageNumLog(type); + throw new RuntimeException("更新库存失败"); } } return result; - } finally { + }finally { // 释放锁 lock.unlock(); } diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml index 69780031..b2e1f0aa 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml @@ -1000,6 +1000,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" create_time, status, creator, + result_msg, + input_type, #{modelTitle}, @@ -1014,6 +1016,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" NOW(), #{status}, #{createBy}, + #{resultMsg}, + #{inputType},