From 0928f68f6a62b226ca3eb4078ed28364104bb85c Mon Sep 17 00:00:00 2001 From: syruan <321359594@qq.com> Date: Tue, 26 Nov 2024 09:06:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E8=B5=84=E8=A3=85=E5=A4=87SQL?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bonus/material/device/mapper/DevInfoMapper.java | 2 +- .../material/device/service/impl/DevInfoServiceImpl.java | 8 +++----- .../resources/mapper/material/device/DevInfoMapper.xml | 2 -- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/mapper/DevInfoMapper.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/mapper/DevInfoMapper.java index 3f08f7b..32e6694 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/mapper/DevInfoMapper.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/mapper/DevInfoMapper.java @@ -33,7 +33,7 @@ public interface DevInfoMapper { * @param deviceName 物资名称 * @return 条数 */ - int getDeviceNameCount(String deviceName); + Integer getDeviceNameCount(String deviceName); int insertHotSearch(Long maId); diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java index ba62591..eb97202 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java @@ -239,8 +239,8 @@ public class DevInfoServiceImpl implements DevInfoService { throw new ServiceException("非法参数异常: " + e.getMessage()); } - int deviceNameCount = devInfoMapper.getDeviceNameCount(devInfo.getDeviceName()); - if (deviceNameCount > 0) { + Integer deviceNameCount = devInfoMapper.getDeviceNameCount(devInfo.getDeviceName()); + if (deviceNameCount != null && deviceNameCount > 0) { return AjaxResult.error("设备名称已存在,请修改后重试!"); } @@ -279,7 +279,7 @@ public class DevInfoServiceImpl implements DevInfoService { return AjaxResult.error("装备草稿保存失败,请修改后重试"); } AjaxResult error = uploadFiles(devInfo, userId); - if (error != null) return error; + if (error != null) {return error;} } catch (Exception e) { return AjaxResult.error("装备草稿保存失败,执行异常:" + e.getMessage()); } @@ -505,8 +505,6 @@ public class DevInfoServiceImpl implements DevInfoService { //保存用户信息 devInfo1.setCreator(userId); devInfo1.setCode(String.valueOf(UUID.randomUUID())); - // TODO -// devInfo1.setOwnCo(Long.valueOf(bmCompanyInfo.getCompanyId())); devInfo1.setTypeId(typeInfo.getTypeId()); devInfo1.setJsDayPrice(Float.valueOf(leasePrice)); devInfo1.setModelName(modelName); diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml index e5b96f6..16229ce 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml @@ -258,7 +258,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" insert into ma_dev_info - ma_id, device_name, device_weight, device_count, @@ -298,7 +297,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_by, - #{maId}, #{deviceName}, #{deviceWeight}, #{deviceCount},