From 95561f8b865f85b0ce588f9fe0e27e61e7d9c829 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com>
Date: Wed, 1 Dec 2021 23:53:45 +0800
Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=AE=A1=E9=87=8F=E5=8D=95?=
=?UTF-8?q?=E4=BD=8D=E6=9B=B4=E6=96=B0=E7=9A=84bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../com/jsh/erp/datasource/mappers/UnitMapperEx.java | 4 ++++
.../java/com/jsh/erp/service/unit/UnitService.java | 6 ++++++
.../src/main/resources/mapper_xml/UnitMapperEx.xml | 10 ++++++++++
3 files changed, 20 insertions(+)
diff --git a/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/UnitMapperEx.java b/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/UnitMapperEx.java
index 960cc3f9..2b5ffe63 100644
--- a/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/UnitMapperEx.java
+++ b/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/UnitMapperEx.java
@@ -18,4 +18,8 @@ public interface UnitMapperEx {
@Param("name") String name);
int batchDeleteUnitByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
+
+ void updateRatioTwoById(@Param("id") Long id);
+
+ void updateRatioThreeById(@Param("id") Long id);
}
\ No newline at end of file
diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/unit/UnitService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/unit/UnitService.java
index 1682b9a6..56236d8b 100644
--- a/jshERP-boot/src/main/java/com/jsh/erp/service/unit/UnitService.java
+++ b/jshERP-boot/src/main/java/com/jsh/erp/service/unit/UnitService.java
@@ -120,6 +120,12 @@ public class UnitService {
try{
parseNameByUnit(unit);
result=unitMapper.updateByPrimaryKeySelective(unit);
+ if(unit.getRatioTwo()==null) {
+ unitMapperEx.updateRatioTwoById(unit.getId());
+ }
+ if(unit.getRatioThree()==null) {
+ unitMapperEx.updateRatioThreeById(unit.getId());
+ }
logService.insertLog("计量单位",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(unit.getName()).toString(), request);
}catch(Exception e){
diff --git a/jshERP-boot/src/main/resources/mapper_xml/UnitMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/UnitMapperEx.xml
index 05e9a557..fe29f3a8 100644
--- a/jshERP-boot/src/main/resources/mapper_xml/UnitMapperEx.xml
+++ b/jshERP-boot/src/main/resources/mapper_xml/UnitMapperEx.xml
@@ -35,4 +35,14 @@
)
+
+ update jsh_unit
+ set ratio_two=null
+ where id=#{id}
+
+
+ update jsh_unit
+ set ratio_three=null
+ where id=#{id}
+
\ No newline at end of file