huminmin
6 天以前 d06ef3f44d6dc19dae223ab420165369ea13cc16
src/main/java/com/ruoyi/device/service/impl/DeviceLedgerServiceImpl.java
@@ -13,7 +13,7 @@
import com.ruoyi.device.mapper.DeviceLedgerMapper;
import com.ruoyi.device.pojo.DeviceLedger;
import com.ruoyi.device.service.IDeviceLedgerService;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.domain.R;
import com.ruoyi.project.system.domain.SysUser;
import com.ruoyi.project.system.mapper.SysUserMapper;
import jakarta.servlet.http.HttpServletResponse;
@@ -44,25 +44,25 @@
    }
    @Override
    public AjaxResult saveDeviceLedger(DeviceLedger deviceLedger) {
    public R<?> saveDeviceLedger(DeviceLedger deviceLedger) {
        LambdaQueryWrapper<DeviceLedger> deviceLedgerLambdaQueryWrapper = new LambdaQueryWrapper<>();
        deviceLedgerLambdaQueryWrapper.eq(DeviceLedger::getDeviceName,deviceLedger.getDeviceName());
        if (this.count(deviceLedgerLambdaQueryWrapper) > 0) {
            return AjaxResult.error("设备名称已存在");
            return R.fail("设备名称已存在");
        }
        boolean save = this.save(deviceLedger);
        if (save){
            return AjaxResult.success();
            return R.ok();
        }
        return AjaxResult.error();
        return R.fail();
    }
    @Override
    public AjaxResult updateDeviceLedger(DeviceLedger deviceLedger) {
    public R<?> updateDeviceLedger(DeviceLedger deviceLedger) {
        if (this.updateById(deviceLedger)) {
            return AjaxResult.success();
            return R.ok();
        }
        return AjaxResult.error();
        return R.fail();
    }
    @Override