From 37ac33d233fecb63d6b3a12418579eaadc5f1dc4 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Thu, 24 Oct 2024 15:10:15 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E5=9F=BA=E7=A1=80=E8=B5=84=E6=96=99?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=20=E9=80=9A=E7=94=A8=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=A8=A1=E5=9D=97=EF=BC=8C=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=A0=B9=E6=8D=AEbusinessId=E5=92=8CbusinessKey=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=90=8E=E7=AB=AF=E4=BF=AE=E6=94=B9=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E8=A1=A8=E4=B8=AD=E6=95=B0=E6=8D=AE=E7=9A=84=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E4=BB=93=E5=BA=93=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=9A=84=E5=88=A0=E9=99=A4=E6=96=B9=E6=B3=95=EF=BC=8C=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=88=A0=E9=99=A4=E4=BB=93=E5=BA=93=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=9A=84=E5=90=8C=E6=97=B6=EF=BC=8C=E5=88=A0=E9=99=A4=E8=BF=99?= =?UTF-8?q?=E6=9D=A1=E6=95=B0=E6=8D=AE=E5=9C=A8=E4=BF=AE=E6=94=B9=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E8=A1=A8=E4=B8=AD=E5=AF=B9=E5=BA=94=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=EF=BC=8C=E5=B9=B6=E4=B8=94=E5=8A=A0=E4=B8=8A=E4=BA=8B?= =?UTF-8?q?=E5=8A=A1=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stock/service/impl/StockInfoServiceImpl.java | 12 +++++++++++- .../com/ruoyi/system/mapper/SysDiffLogMapper.java | 10 ++++++++++ .../com/ruoyi/system/service/ISysDiffLogService.java | 9 +++++++++ .../system/service/impl/SysDiffLogServiceImpl.java | 12 ++++++++++++ .../resources/mapper/system/SysDiffLogMapper.xml | 5 +++++ 5 files changed, 47 insertions(+), 1 deletion(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/stock/service/impl/StockInfoServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/stock/service/impl/StockInfoServiceImpl.java index 7b2f31a8..b31c5a40 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/stock/service/impl/StockInfoServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/stock/service/impl/StockInfoServiceImpl.java @@ -120,10 +120,20 @@ public class StockInfoServiceImpl implements IStockInfoService * @param ids 需要删除的数据ID * @return 结果 */ + @Transactional(rollbackFor = Exception.class) @Override public int deleteStockInfoByIds(String ids) { - return stockInfoMapper.deleteStockInfoByIds(Convert.toStrArray(ids)); + SysDiffLog sysDiffLog = new SysDiffLog(); + sysDiffLog.setBusinessId(Long.valueOf(ids)); + sysDiffLog.setBusinessKey(BusinessKeysConstants.STOCK_INFO); + int deleteSysDiffLogByBusiness = diffLogService.deleteSysDiffLogByBusiness(sysDiffLog); + if (deleteSysDiffLogByBusiness <= 0){ + throw new RuntimeException("删除仓库信息数据修改记录失败"); + } + + int result = stockInfoMapper.deleteStockInfoByIds(Convert.toStrArray(ids)); + return result; } /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysDiffLogMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysDiffLogMapper.java index 5178dab7..19363369 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysDiffLogMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysDiffLogMapper.java @@ -67,6 +67,16 @@ public interface SysDiffLogMapper */ public int deleteSysDiffLogByIds(String[] diffIds); + + + /** + * 删除数据修改记录日志通过业务信息 + * + * @param sysDiffLog 数据修改记录日志 + * @return 结果 + */ + public int deleteSysDiffLogByBusiness(SysDiffLog sysDiffLog); + /** * 作废数据修改记录日志 * diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysDiffLogService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysDiffLogService.java index bed7a500..9522e693 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysDiffLogService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysDiffLogService.java @@ -78,6 +78,15 @@ public interface ISysDiffLogService */ public int deleteSysDiffLogById(Long diffId); + + /** + * 删除数据修改记录日志通过业务信息 + * + * @param sysDiffLog 数据修改记录日志 + * @return 结果 + */ + public int deleteSysDiffLogByBusiness(SysDiffLog sysDiffLog); + /** * 作废数据修改记录日志 * @param diffId 数据修改记录日志ID diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysDiffLogServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysDiffLogServiceImpl.java index c5f55787..ec954202 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysDiffLogServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysDiffLogServiceImpl.java @@ -170,6 +170,18 @@ public class SysDiffLogServiceImpl implements ISysDiffLogService return sysDiffLogMapper.deleteSysDiffLogById(diffId); } + + /** + * 删除数据修改记录日志通过业务信息 + * + * @param sysDiffLog 数据修改记录日志 + * @return 结果 + */ + @Override + public int deleteSysDiffLogByBusiness(SysDiffLog sysDiffLog) { + return sysDiffLogMapper.deleteSysDiffLogByBusiness(sysDiffLog); + } + /** * 作废数据修改记录日志 * diff --git a/ruoyi-admin/src/main/resources/mapper/system/SysDiffLogMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/SysDiffLogMapper.xml index 9e4cc6f4..eb9f0081 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/SysDiffLogMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/SysDiffLogMapper.xml @@ -89,6 +89,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + delete from sys_diff_log where business_id = #{businessId} + and business_key = #{businessKey} + + update sys_diff_log set del_flag = '1' where diff_id = #{diffId}