From 1fd7a7d67a5df84b57af4fbcc310aa66da3cd8ca Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期三, 25 三月 2026 17:51:16 +0800
Subject: [PATCH] feat:1.出入库单位转换 2.仓储/耗材导出字段值优化 3.仓储/耗材库存为0不展示
---
src/main/java/com/ruoyi/consumables/controller/ConsumablesInRecordController.java | 30 +++++++++++++++++++++++++-----
1 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/src/main/java/com/ruoyi/consumables/controller/ConsumablesInRecordController.java b/src/main/java/com/ruoyi/consumables/controller/ConsumablesInRecordController.java
index a7d9921..12318ea 100644
--- a/src/main/java/com/ruoyi/consumables/controller/ConsumablesInRecordController.java
+++ b/src/main/java/com/ruoyi/consumables/controller/ConsumablesInRecordController.java
@@ -2,14 +2,18 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.consumables.dto.ConsumablesInRecordDto;
import com.ruoyi.consumables.service.ConsumablesInRecordService;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.stock.dto.StockInRecordDto;
+import com.ruoyi.stock.word.WeighbridgeDocGenerator;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
@@ -22,18 +26,34 @@
public class ConsumablesInRecordController {
@Autowired
private ConsumablesInRecordService consumablesInRecordService;
+ @Autowired
+ private WeighbridgeDocGenerator weighbridgeDocGenerator;
@GetMapping("/listPage")
@Log(title = "鐢熶骇鍏ュ簱-鍏ュ簱绠$悊-鍒楄〃", businessType = BusinessType.OTHER)
@ApiOperation(value = "鍏ュ簱绠$悊鍒楄〃")
- public AjaxResult listPage(Page page, ConsumablesInRecordDto ConsumablesInRecordDto) {
- IPage<ConsumablesInRecordDto> result = consumablesInRecordService.listPage(page, ConsumablesInRecordDto);
+ public AjaxResult listPage(Page page, ConsumablesInRecordDto consumablesInRecordDto) {
+ IPage<ConsumablesInRecordDto> result = consumablesInRecordService.listPage(page, consumablesInRecordDto);
return AjaxResult.success(result);
}
-
+ @PostMapping("/editStockInStock")
+ @PreAuthorize("@ss.hasPermi('c_receipt_edit')")
+ @ApiOperation("缂栬緫鍏ュ簱璁板綍")
+ public AjaxResult editStockInStock(@RequestBody ConsumablesInRecordDto consumablesInRecordDto) {
+ if (consumablesInRecordDto.getId() == null) {
+ return AjaxResult.error("鍏ュ簱璁板綍ID涓嶈兘涓虹┖");
+ }
+ StockInRecordDto stockInRecordDto = new StockInRecordDto();
+ BeanUtils.copyProperties(consumablesInRecordDto, stockInRecordDto);
+ String absoluteDocPath = weighbridgeDocGenerator.generateWeighbridgeDoc(stockInRecordDto);
+ consumablesInRecordDto.setWeighbridgeDocPath(absoluteDocPath);
+ consumablesInRecordDto.setStockInNum(consumablesInRecordDto.getQualitity());
+ return AjaxResult.success(consumablesInRecordService.updateById(consumablesInRecordDto));
+ }
@DeleteMapping("")
+ @PreAuthorize("@ss.hasPermi('c_receipt_cancel')")
@Log(title = "鍏ュ簱绠$悊-鍒犻櫎鍏ュ簱", businessType = BusinessType.DELETE)
public AjaxResult delete(@RequestBody List<Long> ids) {
if(CollectionUtils.isEmpty(ids)){
@@ -44,8 +64,8 @@
@PostMapping("/exportConsumablesInRecord")
@ApiOperation("瀵煎嚭鍏ュ簱璁板綍")
- public void exportConsumablesInRecord(HttpServletResponse response, ConsumablesInRecordDto ConsumablesInRecordDto) {
- consumablesInRecordService.exportConsumablesInRecord(response,ConsumablesInRecordDto);
+ public void exportConsumablesInRecord(HttpServletResponse response, ConsumablesInRecordDto consumablesInRecordDto) {
+ consumablesInRecordService.exportConsumablesInRecord(response,consumablesInRecordDto);
}
}
--
Gitblit v1.9.3