shiyunteng
2025-04-08 608f0d2c05d86510d546a362e44c10feb601b3f1
platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/DeviceLeasingLedgerController.java
@@ -8,6 +8,7 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.by4cloud.platformx.common.core.util.R;
import com.by4cloud.platformx.common.log.annotation.SysLog;
import com.by4cloud.platformx.common.security.util.SecurityUtils;
import com.by4cloud.platformx.device.constant.MaxSizeContant;
import com.by4cloud.platformx.device.entity.DeviceLeasingLedger;
import com.by4cloud.platformx.device.service.DeviceLeasingLedgerService;
@@ -52,8 +53,9 @@
    @PreAuthorize("@pms.hasPermission('device_deviceLeasingLedger_view')" )
    public R getDeviceLeasingLedgerPage(@ParameterObject Page page, @ParameterObject DeviceLeasingLedger deviceLeasingLedger) {
        LambdaQueryWrapper<DeviceLeasingLedger> wrapper = Wrappers.lambdaQuery();
      wrapper.eq(StrUtil.isNotBlank(deviceLeasingLedger.getContractCode()),DeviceLeasingLedger::getContractCode,deviceLeasingLedger.getContractCode());
      wrapper.eq(StrUtil.isNotBlank(deviceLeasingLedger.getLedgerCode()),DeviceLeasingLedger::getLedgerCode,deviceLeasingLedger.getLedgerCode());
      wrapper.like(StrUtil.isNotBlank(deviceLeasingLedger.getLedgerName()),DeviceLeasingLedger::getLedgerName,deviceLeasingLedger.getLedgerName());
      wrapper.like(StrUtil.isNotBlank(deviceLeasingLedger.getContractCode()),DeviceLeasingLedger::getContractCode,deviceLeasingLedger.getContractCode());
      wrapper.like(StrUtil.isNotBlank(deviceLeasingLedger.getLedgerCode()),DeviceLeasingLedger::getLedgerCode,deviceLeasingLedger.getLedgerCode());
        wrapper.orderByDesc(DeviceLeasingLedger::getCreateTime);
      return R.ok(deviceLeasingLedgerService.page(page, wrapper));
    }
@@ -82,6 +84,7 @@
    @PreAuthorize("@pms.hasPermission('device_deviceLeasingLedger_add')" )
    public R save(@RequestBody DeviceLeasingLedger deviceLeasingLedger) {
      deviceLeasingLedger.setLedgerCode(maxSizeService.nextNo(MaxSizeContant.LEDGER_CODE));
      deviceLeasingLedger.setLesseeContractId(SecurityUtils.getUser().getCompId());
        return deviceLeasingLedgerService.saveDeep(deviceLeasingLedger);
    }