diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/VendorInfoServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/VendorInfoServiceImpl.java index 2dabf787..d94ffa11 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/VendorInfoServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/VendorInfoServiceImpl.java @@ -18,6 +18,7 @@ import com.ruoyi.sip.domain.VendorInfo; import com.ruoyi.sip.mapper.VendorInfoMapper; import com.ruoyi.sip.service.IOmsWarehouseInfoService; import com.ruoyi.sip.service.IVendorInfoService; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -29,6 +30,7 @@ import com.ruoyi.common.core.text.Convert; * @author ruoyi * @date 2025-07-23 */ +@Slf4j @Service public class VendorInfoServiceImpl implements IVendorInfoService { @Autowired @@ -74,9 +76,10 @@ public class VendorInfoServiceImpl implements IVendorInfoService { public int insertVendorInfo(VendorInfo vendorInfo) { lock.lock(); try { - checkUnqCode(vendorInfo); - vendorInfo.setVendorStatus(VendorInfo.VendorStatusEnum.NORMAL.getCode()); + if (StringUtils.isEmpty(vendorInfo.getVendorStatus())) { + vendorInfo.setVendorStatus(VendorInfo.VendorStatusEnum.NORMAL.getValue()); + } vendorInfo.setCreateTime(DateUtils.getNowDate()); vendorInfo.setCreateBy(ShiroUtils.getUserId().toString()); return vendorInfoMapper.insertVendorInfo(vendorInfo); @@ -85,7 +88,6 @@ public class VendorInfoServiceImpl implements IVendorInfoService { } finally { lock.unlock(); } - } private void checkUnqCode(VendorInfo vendorInfo) { @@ -97,6 +99,7 @@ public class VendorInfoServiceImpl implements IVendorInfoService { count = Math.toIntExact(vendorInfos.stream().filter(vendorInfo1 -> !vendorInfo1.getVendorId().equals(vendorInfo.getVendorId())).count()); } if (count > 0) { + log.error("制造商编码重复,保存失败"); throw new ServiceException("制造商编码重复,保存失败"); } }