From cc59b65bc63b839127c29775bcd410dd407de66d Mon Sep 17 00:00:00 2001
From: shiyunteng <shiyunteng@example.com>
Date: 星期一, 21 四月 2025 17:20:02 +0800
Subject: [PATCH] 设备采购计划与设备照片

---
 platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/DeviceLeasingLedgerController.java |   23 ++++++++++++++++++-----
 1 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/DeviceLeasingLedgerController.java b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/DeviceLeasingLedgerController.java
index 6c6d1ab..38abc15 100644
--- a/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/DeviceLeasingLedgerController.java
+++ b/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,9 +53,11 @@
     @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());
-        return R.ok(deviceLeasingLedgerService.page(page, wrapper));
+		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));
     }
 
 
@@ -67,7 +70,7 @@
     @GetMapping("/{id}" )
     @PreAuthorize("@pms.hasPermission('device_deviceLeasingLedger_view')" )
     public R getById(@PathVariable("id" ) Long id) {
-        return R.ok(deviceLeasingLedgerService.getById(id));
+        return R.ok(deviceLeasingLedgerService.getByIdDeep(id));
     }
 
     /**
@@ -81,7 +84,8 @@
     @PreAuthorize("@pms.hasPermission('device_deviceLeasingLedger_add')" )
     public R save(@RequestBody DeviceLeasingLedger deviceLeasingLedger) {
 		deviceLeasingLedger.setLedgerCode(maxSizeService.nextNo(MaxSizeContant.LEDGER_CODE));
-        return R.ok(deviceLeasingLedgerService.save(deviceLeasingLedger));
+		deviceLeasingLedger.setLesseeContractId(SecurityUtils.getUser().getCompId());
+        return deviceLeasingLedgerService.saveDeep(deviceLeasingLedger);
     }
 
     /**
@@ -139,4 +143,13 @@
 	public R getDeviceSelectList(@PathVariable("ledgerId")Long ledgerId) {
 		return R.ok(deviceLeasingLedgerService.getDeviceSelectList(ledgerId));
 	}
+
+	/**
+	 * 鍙拌处涓澶囧簭鍒楀彿涓嬫媺涓嬫媺
+	 */
+	@Operation(summary = "鍙拌处鏄庣粏涓澶囧簭鍒楀彿涓嬫媺",description = "鍙拌处鏄庣粏涓澶囧簭鍒楀彿涓嬫媺涓嬫媺")
+	@GetMapping("/getLedgerDeviceList/{deviceId}")
+	public R getLedgerDeviceList(@PathVariable("deviceId")Long deviceId) {
+		return R.ok(deviceLeasingLedgerService.getLedgerDeviceList(deviceId));
+	}
 }
\ No newline at end of file

--
Gitblit v1.9.1