yaowanxin
6 天以前 9d5128803ebebb5788f13924a5775ac16494dfef
仓库,树,文档,借出修改
已修改31个文件
已添加15个文件
1288 ■■■■ 文件已修改
src/main/java/com/ruoyi/warehouse/controller/DocumentClassificationController.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/controller/DocumentationBorrowManagementController.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/controller/DocumentationController.java 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/controller/DocumentationFileController.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/controller/WarehouseController.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/controller/WarehouseGoodsShelvesController.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/controller/WarehouseGoodsShelvesRowcolController.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/dto/DocumentClassificationDto.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/dto/DocumentClassificationTreeDto.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/dto/DocumentationBorrowManagementDto.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/dto/DocumentationDto.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/dto/ReturnExportDto.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/dto/WarehouseDto.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/dto/WarehouseGoodsShelvesDto.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/dto/WarehouseGoodsShelvesRowcolDto.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/dto/WarehouseTreeDto.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/mapper/DocumentationBorrowManagementMapper.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/mapper/DocumentationFileMapper.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/mapper/DocumentationMapper.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/mapper/WarehouseGoodsShelvesMapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/mapper/WarehouseGoodsShelvesRowcolMapper.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/mapper/WarehouseMapper.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/pojo/DocumentClassification.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/pojo/Documentation.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/pojo/DocumentationBorrowManagement.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/pojo/DocumentationFile.java 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/service/DocumentClassificationService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/service/DocumentationBorrowManagementService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/service/DocumentationFileService.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/service/DocumentationService.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/service/WarehouseGoodsShelvesRowcolService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/service/WarehouseGoodsShelvesService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/service/WarehouseService.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/service/impl/DocumentClassificationServiceImpl.java 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/service/impl/DocumentationBorrowManagementServiceImpl.java 125 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/service/impl/DocumentationFileServiceImpl.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/service/impl/DocumentationServiceImpl.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/service/impl/WarehouseGoodsShelvesRowcolServiceImpl.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/service/impl/WarehouseGoodsShelvesServiceImpl.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/service/impl/WarehouseServiceImpl.java 135 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/warehouse/DocumentationBorrowManagementMapper.xml 87 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/warehouse/DocumentationFileMapper.xml 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/warehouse/DocumentationMapper.xml 83 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/warehouse/WarehouseGoodsShelvesMapper.xml 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/warehouse/WarehouseGoodsShelvesRowcolMapper.xml 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/warehouse/WarehouseMapper.xml 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/warehouse/controller/DocumentClassificationController.java
@@ -1,9 +1,13 @@
package com.ruoyi.warehouse.controller;
import com.ruoyi.basic.dto.ProductDto;
import com.ruoyi.basic.dto.ProductTreeDto;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.warehouse.dto.DocumentClassificationDto;
import com.ruoyi.warehouse.dto.DocumentClassificationTreeDto;
import com.ruoyi.warehouse.pojo.DocumentClassification;
import com.ruoyi.warehouse.service.DocumentClassificationService;
import io.swagger.annotations.Api;
@@ -20,11 +24,10 @@
public class DocumentClassificationController extends BaseController {
    @Autowired
    private DocumentClassificationService documentClassificationService;
    //树结构
    @GetMapping("/getList")
    @ApiOperation("文档分类-查询")
    @Log(title = "文档分类-查询", businessType = BusinessType.OTHER)
    public AjaxResult getList() {
        return AjaxResult.success(documentClassificationService.list());
    public List<DocumentClassificationTreeDto> getList(DocumentClassificationDto documentClassificationDto) {
        return documentClassificationService.selectDocumentClassificationList(documentClassificationDto);
    }
    @PostMapping("/add")
    @ApiOperation("文档分类-添加")
@@ -32,7 +35,7 @@
    public AjaxResult add(@RequestBody DocumentClassification documentClassification) {
        return AjaxResult.success(documentClassificationService.save(documentClassification));
    }
    @PostMapping("/update")
    @PutMapping("/update")
    @ApiOperation("文档分类-更新")
    @Log(title = "文档分类-更新", businessType = BusinessType.UPDATE)
    public AjaxResult update(@RequestBody DocumentClassification documentClassification) {
src/main/java/com/ruoyi/warehouse/controller/DocumentationBorrowManagementController.java
@@ -21,6 +21,7 @@
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDateTime;
import java.util.List;
@RestController
@@ -32,39 +33,56 @@
    @Autowired
    private DocumentationBorrowManagementMapper documentationBorrowManagementMapper;
    @GetMapping("/listPage")
    @ApiOperation("文档借阅管理-分页查询")
    @Log(title = "文档借阅管理-分页查询", businessType = BusinessType.OTHER)
    @ApiOperation("文档借阅管理-借阅分页查询")
    @Log(title = "文档借阅管理-借阅分页查询", businessType = BusinessType.OTHER)
    public AjaxResult listPage(Page page, DocumentationBorrowManagement documentationBorrowManagement) {
        IPage<DocumentationBorrowManagement> listPage = documentationBorrowManagementService.listPage(page, documentationBorrowManagement);
        return AjaxResult.success(listPage);
        return AjaxResult.success(documentationBorrowManagementService.listPage(page, documentationBorrowManagement));
    }
    @PostMapping("/add")
    @ApiOperation("文档借阅管理-添加")
    @Log(title = "文档借阅管理-添加", businessType = BusinessType.INSERT)
    @ApiOperation("文档借阅管理-借阅")
    @Log(title = "文档借阅管理-借阅", businessType = BusinessType.INSERT)
    public AjaxResult add(@RequestBody DocumentationBorrowManagement documentationBorrowManagement) {
        return AjaxResult.success(documentationBorrowManagementService.add(documentationBorrowManagement));
    }
    @PostMapping("/update")
    @PutMapping("/revent")
    @ApiOperation("文档借阅管理-归还")
    @Log(title = "文档借阅管理-归还", businessType = BusinessType.UPDATE)
    public AjaxResult reventdbm(@RequestBody DocumentationBorrowManagement documentationBorrowManagement) {
        return AjaxResult.success(documentationBorrowManagementService.reventdbm(documentationBorrowManagement));
    }
    @PutMapping("/update")
    @ApiOperation("文档借阅管理-更新")
    @Log(title = "文档借阅管理-更新", businessType = BusinessType.UPDATE)
    public AjaxResult update(@RequestBody DocumentationBorrowManagement documentationBorrowManagement) {
//        documentationBorrowManagementService.updateById(documentationBorrowManagement);
        return AjaxResult.success(documentationBorrowManagementService.updateById(documentationBorrowManagement));
    }
    @PostMapping("/delete")
    @ApiOperation("文档借阅管理-删除")
    @Log(title = "文档借阅管理-删除", businessType = BusinessType.DELETE)
    @DeleteMapping ("/delete")
    @ApiOperation("文档借阅管理-借阅删除")
    @Log(title = "文档借阅管理-借阅删除", businessType = BusinessType.DELETE)
    public AjaxResult delete(@RequestBody List<Long> ids) {
        if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("请传入要删除的ID");
        return AjaxResult.success(documentationBorrowManagementService.deleteByIds(ids));
    }
    @DeleteMapping ("/reventDelete")
    @ApiOperation("文档借阅管理-归还删除")
    @Log(title = "文档借阅管理-归还删除", businessType = BusinessType.DELETE)
    public AjaxResult reventdelete(@RequestBody List<Long> ids) {
        if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("请传入要删除的ID");
        return AjaxResult.success(documentationBorrowManagementService.reventDeleteByIds(ids));
    }
    @PostMapping("/export")
    @ApiOperation("文档借阅管理-导出")
    @Log(title = "文档借阅管理-导出", businessType = BusinessType.EXPORT)
    @ApiOperation("文档借阅管理-借阅导出")
    @Log(title = "文档借阅管理-借阅导出", businessType = BusinessType.EXPORT)
    public void export(HttpServletResponse response,DocumentationBorrowManagement documentationBorrowManagement) {
        String borrowStatus = documentationBorrowManagement.getBorrowStatus();
        List<DocumentationBorrowManagement> documentationBorrowManagements = documentationBorrowManagementMapper.selectList(new LambdaQueryWrapper<DocumentationBorrowManagement>().eq(DocumentationBorrowManagement::getBorrowStatus, borrowStatus));
        ExcelUtil<DocumentationBorrowManagement> util = new ExcelUtil<>(DocumentationBorrowManagement.class);
        util.exportExcel(response, documentationBorrowManagements, "文档借阅-归还记录");
        documentationBorrowManagementService.export(response,documentationBorrowManagement);
    }
    @PostMapping("/exportrevent")
    @ApiOperation("文档借阅管理-归还导出")
    @Log(title = "文档借阅管理-归还导出", businessType = BusinessType.EXPORT)
    public void exportrevent(HttpServletResponse response,DocumentationBorrowManagement documentationBorrowManagement) {
        documentationBorrowManagementService.exportrevent(response,documentationBorrowManagement);
//        List<DocumentationBorrowManagement> documentationBorrowManagements = documentationBorrowManagementMapper.selectList(new LambdaQueryWrapper<DocumentationBorrowManagement>().eq(DocumentationBorrowManagement::getBorrowStatus, "归还"));
//        ExcelUtil<DocumentationBorrowManagement> util = new ExcelUtil<>(DocumentationBorrowManagement.class);
//        util.exportExcel(response, documentationBorrowManagements, "文档借阅-归还记录");
    }
}
src/main/java/com/ruoyi/warehouse/controller/DocumentationController.java
@@ -8,6 +8,7 @@
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.warehouse.dto.DocumentationDto;
import com.ruoyi.warehouse.pojo.Documentation;
import com.ruoyi.warehouse.pojo.Warehouse;
import com.ruoyi.warehouse.service.DocumentationService;
@@ -29,14 +30,7 @@
    @ApiOperation("文档信息表-分页查询")
    @Log(title = "文档信息表-分页查询", businessType = BusinessType.OTHER)
    public AjaxResult listPage(Page page, Documentation documentation) {
        IPage<Documentation> listPage = documentationService.listPage(page, documentation);
        return AjaxResult.success(listPage);
    }
    @GetMapping("/list")
    @ApiOperation("文档信息表")
    @Log(title = "文档信息表", businessType = BusinessType.OTHER)
    public AjaxResult list() {
        List<Documentation> list = documentationService.list();
        List<DocumentationDto> list = documentationService.listPage(page, documentation);
        return AjaxResult.success(list);
    }
    @PostMapping("/add")
@@ -45,24 +39,29 @@
    public AjaxResult add(@RequestBody Documentation documentation) {
        return AjaxResult.success(documentationService.save(documentation));
    }
    @PostMapping("/update")
    @PutMapping("/update")
    @ApiOperation("文档信息表-更新")
    @Log(title = "文档信息表-更新", businessType = BusinessType.UPDATE)
    public AjaxResult update(@RequestBody Documentation documentation) {
        return AjaxResult.success(documentationService.updateById(documentation));
    }
    @PostMapping("/delete")
    @DeleteMapping("/delete")
    @ApiOperation("文档信息表-删除")
    @Log(title = "文档信息表-删除", businessType = BusinessType.DELETE)
    public AjaxResult delete(@RequestBody List<Long> ids) {
        if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("请传入要删除的ID");
        return AjaxResult.success(documentationService.removeBatchByIds(ids));
        return AjaxResult.success(documentationService.deleteByIds(ids));
    }
    @PostMapping("/export")
    @ApiOperation("文档信息表-导出")
    @Log(title = "文档信息表-导出", businessType = BusinessType.EXPORT)
    public void export(HttpServletResponse response) {
        documentationService.export(response);
    public void export(HttpServletResponse response,Documentation documentation ) {
        documentationService.export(response,documentation);
    }
    //附件详情
//    @GetMapping("/getDocumentation")
//    public Documentation getDocumentation(Documentation documentation) {
//        return documentationService.getById(id);
//    }
}
src/main/java/com/ruoyi/warehouse/controller/DocumentationFileController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,64 @@
package com.ruoyi.warehouse.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.account.pojo.AccountFile;
import com.ruoyi.account.service.AccountFileService;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.warehouse.pojo.DocumentationFile;
import com.ruoyi.warehouse.service.DocumentationFileService;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
 * æ–‡æ¡£é™„ä»¶
 */
@RestController
@RequestMapping("/documentation/documentationFile")
public class DocumentationFileController {
    @Resource
    private DocumentationFileService documentationFileService;
    /**
     * æ–°å¢ž
     * @param documentationFile
     * @return
     */
    @PostMapping("/add")
    public AjaxResult add(@RequestBody DocumentationFile documentationFile) {
        return AjaxResult.success(documentationFileService.save(documentationFile));
    }
    /**
     * åˆ é™¤
     * @param ids
     * @return
     */
    @DeleteMapping("/del")
    public AjaxResult delDocumentationFile(@RequestBody List<Integer> ids) {
        if(CollectionUtils.isEmpty(ids)){
            return AjaxResult.error("请选择至少一条数据");
        }
        //删除检验附件
        return AjaxResult.success(documentationFileService.removeBatchByIds(ids));
    }
    /**
     *分页查询
     * @param page
     * @param documentationFile
     * @return
     */
    @GetMapping("/listPage")
    public AjaxResult documentationFileListPage(Page page, DocumentationFile documentationFile) {
        return AjaxResult.success(documentationFileService.documentationFileListPage(page, documentationFile));
    }
}
src/main/java/com/ruoyi/warehouse/controller/WarehouseController.java
@@ -27,12 +27,17 @@
public class WarehouseController extends BaseController {
    @Autowired
    private WarehouseService warehouseService;
    @GetMapping("/tree")
    @ApiOperation("仓库-查询树")
    @Log(title = "仓库-查询树", businessType = BusinessType.OTHER)
    public AjaxResult listTree() {
        return AjaxResult.success(warehouseService.findListTree());
    }
    @GetMapping("/list")
    @ApiOperation("仓库-查询")
    @Log(title = "仓库-查询", businessType = BusinessType.OTHER)
    public AjaxResult list(@RequestBody Warehouse warehouse) {
        return AjaxResult.success(warehouseService.listPage( warehouse));
    public AjaxResult list(Warehouse warehouse) {
        return AjaxResult.success(warehouseService.findList(warehouse));
    }
    @PostMapping("/add")
    @ApiOperation("仓库-添加")
@@ -41,7 +46,7 @@
        return AjaxResult.success(warehouseService.save(warehouse));
    }
    @PostMapping("/update")
    @PutMapping("/update")
    @ApiOperation("仓库-更新")
    @Log(title = "仓库-更新", businessType = BusinessType.UPDATE)
    public AjaxResult update(@RequestBody Warehouse warehouse) {
src/main/java/com/ruoyi/warehouse/controller/WarehouseGoodsShelvesController.java
@@ -8,6 +8,7 @@
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.warehouse.dto.WarehouseGoodsShelvesDto;
import com.ruoyi.warehouse.pojo.WarehouseGoodsShelves;
import com.ruoyi.warehouse.service.WarehouseGoodsShelvesService;
import io.swagger.annotations.Api;
@@ -27,9 +28,8 @@
    @GetMapping("/listById")
    @ApiOperation("商品货架-查询")
    @Log(title = "商品货架-查询", businessType = BusinessType.OTHER)
    public AjaxResult listById(Long warehouseId) {
        List<WarehouseGoodsShelves> list = warehouseGoodsShelvesService.list(new QueryWrapper<WarehouseGoodsShelves>().lambda()
                .eq(WarehouseGoodsShelves::getWarehouseId, warehouseId));
    public AjaxResult listById(@RequestBody WarehouseGoodsShelves warehouseGoodsShelves) {
        List<WarehouseGoodsShelves> list = warehouseGoodsShelvesService.findList(warehouseGoodsShelves);
        return AjaxResult.success(list);
    }
    @PostMapping("/add")
@@ -38,7 +38,7 @@
    public AjaxResult add(@RequestBody WarehouseGoodsShelves warehouseGoodsShelves) {
        return AjaxResult.success(warehouseGoodsShelvesService.add(warehouseGoodsShelves));
    }
    @PostMapping("/update")
    @PutMapping("/update")
    @ApiOperation("商品货架-更新")
    @Log(title = "商品货架-更新", businessType = BusinessType.UPDATE)
    public AjaxResult update(@RequestBody WarehouseGoodsShelves warehouseGoodsShelves) {
src/main/java/com/ruoyi/warehouse/controller/WarehouseGoodsShelvesRowcolController.java
@@ -1,15 +1,11 @@
package com.ruoyi.warehouse.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.warehouse.mapper.WarehouseGoodsShelvesRowcolMapper;
import com.ruoyi.warehouse.pojo.WarehouseGoodsShelvesRowcol;
import com.ruoyi.warehouse.dto.WarehouseGoodsShelvesRowcolDto;
import com.ruoyi.warehouse.service.WarehouseGoodsShelvesRowcolService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -24,42 +20,13 @@
public class WarehouseGoodsShelvesRowcolController extends BaseController {
    @Autowired
    private WarehouseGoodsShelvesRowcolService warehouseGoodsShelvesRowcolService;
    @Autowired
    private WarehouseGoodsShelvesRowcolMapper warehouseGoodsShelvesRowcolMapper;
    @GetMapping("/list")
    @ApiOperation("商品货架行列-查询")
    @Log(title = "商品货架行列-查询", businessType = BusinessType.OTHER)
    public AjaxResult list(Long warehouseGoodsShelvesId) {
        List<WarehouseGoodsShelvesRowcol> list = warehouseGoodsShelvesRowcolService.list(new QueryWrapper<WarehouseGoodsShelvesRowcol>().lambda()
                .eq(WarehouseGoodsShelvesRowcol::getWarehouseGoodsShelvesId, warehouseGoodsShelvesId));
    public AjaxResult list(@RequestBody WarehouseGoodsShelvesRowcol warehouseGoodsShelvesRowcol) {
        List<WarehouseGoodsShelvesRowcolDto> list = warehouseGoodsShelvesRowcolService.getList(warehouseGoodsShelvesRowcol);
        return AjaxResult.success(list);
    }
//    @GetMapping("/listPage")
//    @ApiOperation("商品货架行列-分页查询")
//    @Log(title = "商品货架行列-分页查询", businessType = BusinessType.OTHER)
//    public AjaxResult listPage(Page page, WarehouseGoodsShelvesRowcol warehouseGoodsShelvesRowcol) {
//        IPage<WarehouseGoodsShelvesRowcol> listPage = warehouseGoodsShelvesRowcolService.listPage(page, warehouseGoodsShelvesRowcol);
//        return AjaxResult.success(listPage);
//    }
//    @PostMapping("/add")
//    @ApiOperation("商品货架行列-添加")
//    @Log(title = "商品货架行列-添加", businessType = BusinessType.INSERT)
//    public AjaxResult add(@RequestBody WarehouseGoodsShelvesRowcol warehouseGoodsShelvesRowcol) {
//        return AjaxResult.success(warehouseGoodsShelvesRowcolService.save(warehouseGoodsShelvesRowcol));
//    }
//    @PostMapping("/update")
//    @ApiOperation("商品货架行列-更新")
//    @Log(title = "商品货架行列-更新", businessType = BusinessType.UPDATE)
//    public AjaxResult update(@RequestBody WarehouseGoodsShelvesRowcol warehouseGoodsShelvesRowcol) {
//        return AjaxResult.success(warehouseGoodsShelvesRowcolService.updateById(warehouseGoodsShelvesRowcol));
//    }
//    @PostMapping("/delete")
//    @ApiOperation("商品货架行列-删除")
//    @Log(title = "商品货架行列-删除", businessType = BusinessType.DELETE)
//    public AjaxResult delete(@RequestBody List<Long> ids) {
//        if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("请传入要删除的ID");
//        return AjaxResult.success(warehouseGoodsShelvesRowcolService.removeByIds(ids));
//    }
}
src/main/java/com/ruoyi/warehouse/dto/DocumentClassificationDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,12 @@
package com.ruoyi.warehouse.dto;
import com.ruoyi.warehouse.pojo.DocumentClassification;
import lombok.Data;
import java.util.List;
@Data
public class DocumentClassificationDto extends DocumentClassification {
    private List<DocumentClassification> documentClassificationList;
}
src/main/java/com/ruoyi/warehouse/dto/DocumentClassificationTreeDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
package com.ruoyi.warehouse.dto;
import lombok.Data;
import java.util.List;
@Data
public class DocumentClassificationTreeDto {
    private Long id;
    private Long parentId;
    private String category;
    private List<DocumentClassificationTreeDto> children;
}
src/main/java/com/ruoyi/warehouse/dto/DocumentationBorrowManagementDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,20 @@
package com.ruoyi.warehouse.dto;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.warehouse.pojo.DocumentationBorrowManagement;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class DocumentationBorrowManagementDto extends DocumentationBorrowManagement {
    /**
     * æ–‡æ¡£åç§°
     */
    @Excel(name = "文档名称")
    private String docName;
    /**
     * å€Ÿé˜…人
     */
    @Excel(name = "借阅人")
    private String nickName;
}
src/main/java/com/ruoyi/warehouse/dto/DocumentationDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,20 @@
package com.ruoyi.warehouse.dto;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.warehouse.pojo.Documentation;
import lombok.Data;
@Data
public class DocumentationDto extends Documentation {
    /**
     * ç±»åˆ«åç§°
     */
    @Excel(name = "类别名称")
    private String category;
    /**
     * ä½ç½®ä¿¡æ¯
     */
    @Excel(name = "位置信息")
    private String locationInfo;
}
src/main/java/com/ruoyi/warehouse/dto/ReturnExportDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
package com.ruoyi.warehouse.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;
public class ReturnExportDto {
    private String id; // è®°å½•编号
    @Excel(name = "文档名称")
    private String docName; // æ–‡æ¡£åç§°
    @Excel(name = "原借阅人")
    private String nickName; // å€Ÿé˜…人
    @Excel(name = "归还时间", dateFormat = "yyyy-MM-dd", width = 30)
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDateTime borrowTime; // å€Ÿé˜…时间(可能需要保留)
    @Excel(name = "归还人")
    @NotBlank(message = "归还人不能为空!!")
    private String returnNickName; // å½’还人
    @Excel(name = "归还时间", dateFormat = "yyyy-MM-dd", width = 30)
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDateTime updateTime; // å½’还时间
}
src/main/java/com/ruoyi/warehouse/dto/WarehouseDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
package com.ruoyi.warehouse.dto;
import com.ruoyi.warehouse.pojo.*;
import lombok.Data;
import java.util.List;
@Data
public class WarehouseDto extends Warehouse {
    private String goodsShelvesName;
    private String category;
//    private List<DocumentationDto> documentationList;
//    private List<WarehouseGoodsShelvesRowcolDto> warehouseGoodsShelvesRowcolList;
    private List<WarehouseGoodsShelvesDto> warehouseGoodsShelvesList;
}
src/main/java/com/ruoyi/warehouse/dto/WarehouseGoodsShelvesDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
package com.ruoyi.warehouse.dto;
import com.ruoyi.warehouse.pojo.WarehouseGoodsShelves;
import java.util.List;
public class WarehouseGoodsShelvesDto extends WarehouseGoodsShelves {
    private String warehouseName;
    private String goodsShelvesName;
//    private List<DocumentationDto> documentationList;
    private List<WarehouseGoodsShelvesRowcolDto> warehouseGoodsShelvesRowcolList;
    private String category;
}
src/main/java/com/ruoyi/warehouse/dto/WarehouseGoodsShelvesRowcolDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,15 @@
package com.ruoyi.warehouse.dto;
import com.ruoyi.warehouse.dto.DocumentationDto;
import com.ruoyi.warehouse.pojo.WarehouseGoodsShelvesRowcol;
import lombok.Data;
import java.util.List;
@Data
public class WarehouseGoodsShelvesRowcolDto extends WarehouseGoodsShelvesRowcol {
    private String warehouseName;
    private String goodsShelvesName;
    private List<DocumentationDto> documentationList;
    private String category;
}
src/main/java/com/ruoyi/warehouse/dto/WarehouseTreeDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,12 @@
package com.ruoyi.warehouse.dto;
import lombok.Data;
import java.util.List;
@Data
public class WarehouseTreeDto {
    private Long id;
    private String label;
    private List<WarehouseTreeDto> children;
}
src/main/java/com/ruoyi/warehouse/mapper/DocumentationBorrowManagementMapper.java
@@ -2,10 +2,15 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.warehouse.dto.DocumentationBorrowManagementDto;
import com.ruoyi.warehouse.dto.ReturnExportDto;
import com.ruoyi.warehouse.pojo.DocumentationBorrowManagement;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* @author 86151
@@ -16,7 +21,11 @@
@Mapper
public interface DocumentationBorrowManagementMapper extends BaseMapper<DocumentationBorrowManagement> {
    IPage<DocumentationBorrowManagement> listPage(Page page,@Param("documentationBorrowManagement") DocumentationBorrowManagement documentationBorrowManagement);
    IPage<DocumentationBorrowManagement> listPage(Page page, @Param("documentationBorrowManagement") DocumentationBorrowManagement documentationBorrowManagement);
    List<DocumentationBorrowManagementDto> export(@Param("documentationBorrowManagement") DocumentationBorrowManagement documentationBorrowManagement);
    List<ReturnExportDto> exportrevent(DocumentationBorrowManagement documentationBorrowManagement);
}
src/main/java/com/ruoyi/warehouse/mapper/DocumentationFileMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,15 @@
package com.ruoyi.warehouse.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.account.pojo.AccountFile;
import com.ruoyi.warehouse.pojo.DocumentationFile;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface DocumentationFileMapper extends BaseMapper<DocumentationFile> {
    IPage<DocumentationFile> documentationFileListPage(Page page, @Param("documentationFile") DocumentationFile documentationFile);
}
src/main/java/com/ruoyi/warehouse/mapper/DocumentationMapper.java
@@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.procurementrecord.dto.ProcurementRecordOutPageDto;
import com.ruoyi.warehouse.dto.DocumentationDto;
import com.ruoyi.warehouse.pojo.Documentation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
@@ -19,9 +20,8 @@
@Mapper
public interface DocumentationMapper extends BaseMapper<Documentation> {
    IPage<Documentation> listPage(Page page,@Param("documentation") Documentation documentation);
    List<Documentation> list();
    List<DocumentationDto> listPage(Page page, @Param("documentation") Documentation documentation);
    List<DocumentationDto> listByDocumentClassificationId(@Param("documentClassificationId") Long documentClassificationId);
}
src/main/java/com/ruoyi/warehouse/mapper/WarehouseGoodsShelvesMapper.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.warehouse.dto.WarehouseGoodsShelvesDto;
import com.ruoyi.warehouse.pojo.WarehouseGoodsShelves;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -18,9 +19,9 @@
*/
@Mapper
public interface WarehouseGoodsShelvesMapper extends BaseMapper<WarehouseGoodsShelves> {
    IPage<WarehouseGoodsShelves> listPage(Page page,@Param("warehouseGoodsShelves") WarehouseGoodsShelves warehouseGoodsShelves);
    List<WarehouseGoodsShelves> list(@Param("warehouseGoodsShelves") WarehouseGoodsShelves warehouseGoodsShelves);
    List<WarehouseGoodsShelvesDto> findList(@Param("warehouseGoodsShelves") WarehouseGoodsShelves warehouseGoodsShelves);
    List<WarehouseGoodsShelves> listAll(@Param("warehouseGoodsShelves") WarehouseGoodsShelves warehouseGoodsShelves);
}
src/main/java/com/ruoyi/warehouse/mapper/WarehouseGoodsShelvesRowcolMapper.java
@@ -1,11 +1,13 @@
package com.ruoyi.warehouse.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.warehouse.dto.WarehouseGoodsShelvesRowcolDto;
import org.apache.ibatis.annotations.Mapper;
import com.ruoyi.warehouse.pojo.WarehouseGoodsShelvesRowcol;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author 86151
* @description é’ˆå¯¹è¡¨ã€warehouse_goods_shelves_rowcol(仓库货架层,列表)】的数据库操作Mapper
@@ -15,8 +17,7 @@
@Mapper
public interface WarehouseGoodsShelvesRowcolMapper extends BaseMapper<WarehouseGoodsShelvesRowcol> {
    IPage<WarehouseGoodsShelvesRowcol> listPage(Page page,@Param("warehouseGoodsShelvesRowcol") WarehouseGoodsShelvesRowcol warehouseGoodsShelvesRowcol);
    List<WarehouseGoodsShelvesRowcolDto> findList(@Param("warehouseGoodsShelvesRowcol") WarehouseGoodsShelvesRowcol warehouseGoodsShelvesRowcol);
}
src/main/java/com/ruoyi/warehouse/mapper/WarehouseMapper.java
@@ -1,7 +1,7 @@
package com.ruoyi.warehouse.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.warehouse.dto.WarehouseDto;
import com.ruoyi.warehouse.pojo.Warehouse;
import org.apache.ibatis.annotations.Mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -17,8 +17,8 @@
*/
@Mapper
public interface WarehouseMapper extends BaseMapper<Warehouse> {
    List<Warehouse> listPage(@Param("warehouse") Warehouse warehouse);
    List<WarehouseDto> findList(@Param("warehouse") Warehouse warehouse);
    List<Warehouse> listAll(@Param("warehouse") Warehouse warehouse);
}
src/main/java/com/ruoyi/warehouse/pojo/DocumentClassification.java
@@ -43,7 +43,7 @@
     * åˆ›å»ºç”¨æˆ·
     */
    @TableField(fill = FieldFill.INSERT)
    private Long createUser;
    private Integer createUser;
    /**
     * ä¿®æ”¹æ—¶é—´
@@ -55,7 +55,7 @@
     * ä¿®æ”¹ç”¨æˆ·
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateUser;
    private Integer updateUser;
    /**
     * ç§Ÿæˆ·id
src/main/java/com/ruoyi/warehouse/pojo/Documentation.java
@@ -46,7 +46,7 @@
     */
    @Excel(name = "文档编号")
    @ApiModelProperty(value = "文档编号")
    private Long docNumber;
    private String docNumber;
    /**
     * å¹´ä»½
@@ -151,7 +151,7 @@
     * åˆ›å»ºç”¨æˆ·
     */
    @TableField(fill = FieldFill.INSERT)
    private Long createUser;
    private Integer createUser;
    /**
     * ä¿®æ”¹æ—¶é—´
@@ -163,7 +163,7 @@
     * ä¿®æ”¹ç”¨æˆ·
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateUser;
    private Integer updateUser;
    /**
     * ç§Ÿæˆ·ID
src/main/java/com/ruoyi/warehouse/pojo/DocumentationBorrowManagement.java
@@ -7,10 +7,12 @@
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.dto.DateQueryDto;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
/**
 * æ–‡æ¡£å€Ÿé˜…-归还表
@@ -19,7 +21,9 @@
@TableName(value ="documentation_borrow_management")
@Data
@ApiModel(value = "文档借阅-归还表")
public class DocumentationBorrowManagement implements Serializable {
public class DocumentationBorrowManagement extends DateQueryDto implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * ä¸»é”®
     */
@@ -29,13 +33,12 @@
    /**
     * æ–‡æ¡£id
     */
    @Excel(name = "文档id")
    @ApiModelProperty(value = "文档id")
    private Long documentationId;
    /**
     * å€Ÿé˜…人id
     */
    @Excel(name = "借阅人id")
    @ApiModelProperty(value = "借阅人id")
    private Long borrowerId;
@@ -53,6 +56,7 @@
    @ApiModelProperty(value = "借阅日期")
    @Excel(name = "借阅日期", dateFormat = "yyyy-MM-dd", width = 30)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDateTime borrowDate;
    /**
@@ -95,7 +99,7 @@
     * åˆ›å»ºç”¨æˆ·
     */
    @TableField(fill = FieldFill.INSERT)
    private Long createUser;
    private Integer createUser;
    /**
     * ä¿®æ”¹æ—¶é—´
@@ -107,13 +111,11 @@
     * ä¿®æ”¹ç”¨æˆ·
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateUser;
    private Integer updateUser;
    /**
     * ç§Ÿæˆ·id
     */
    @TableField(fill = FieldFill.INSERT)
    private Long tenantId;
    private static final long serialVersionUID = 1L;
}
src/main/java/com/ruoyi/warehouse/pojo/DocumentationFile.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,60 @@
package com.ruoyi.warehouse.pojo;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
 * æ–‡æ¡£ä¿¡æ¯è¡¨--附件
 * documentation_file
 */
@TableName(value = "documentation_file")
@Data
public class DocumentationFile implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * åºå·
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    @ApiModelProperty(value = "文件名称")
    private String name;
    @ApiModelProperty(value = "文件路径")
    private String url;
    @ApiModelProperty(value = "文件大小")
    private int fileSize;
    @ApiModelProperty(value = "文档ID")
    @NotBlank(message = "文档id不能为空!")
    private Long documentationId;
    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    @ApiModelProperty(value = "修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
    @ApiModelProperty(value = "创建用户")
    @TableField(fill = FieldFill.INSERT)
    private Integer createUser;
    @ApiModelProperty(value = "修改用户")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Integer updateUser;
    @ApiModelProperty(value = "租户ID")
    @TableField(fill = FieldFill.INSERT)
    private Long tenantId;
}
src/main/java/com/ruoyi/warehouse/service/DocumentClassificationService.java
@@ -1,6 +1,8 @@
package com.ruoyi.warehouse.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.warehouse.dto.DocumentClassificationDto;
import com.ruoyi.warehouse.dto.DocumentClassificationTreeDto;
import com.ruoyi.warehouse.pojo.DocumentClassification;
import java.util.List;
@@ -13,4 +15,6 @@
public interface DocumentClassificationService extends IService<DocumentClassification> {
    boolean deleteByIds(List<Long> ids);
    List<DocumentClassificationTreeDto> selectDocumentClassificationList(DocumentClassificationDto documentClassificationDto);
}
src/main/java/com/ruoyi/warehouse/service/DocumentationBorrowManagementService.java
@@ -22,4 +22,11 @@
    boolean deleteByIds(List<Long> ids);
    boolean reventdbm(DocumentationBorrowManagement documentationBorrowManagement);
    boolean reventDeleteByIds(List<Long> ids);
    void export(HttpServletResponse response, DocumentationBorrowManagement documentationBorrowManagement);
    void exportrevent(HttpServletResponse response, DocumentationBorrowManagement documentationBorrowManagement);
}
src/main/java/com/ruoyi/warehouse/service/DocumentationFileService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
package com.ruoyi.warehouse.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.account.pojo.AccountFile;
import com.ruoyi.warehouse.pojo.DocumentationFile;
public interface DocumentationFileService extends IService<DocumentationFile> {
    IPage<DocumentationFile> documentationFileListPage(Page page, DocumentationFile documentationFile);
}
src/main/java/com/ruoyi/warehouse/service/DocumentationService.java
@@ -2,10 +2,12 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.warehouse.dto.DocumentationDto;
import com.ruoyi.warehouse.pojo.Documentation;
import com.baomidou.mybatisplus.extension.service.IService;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* @author 86151
@@ -14,8 +16,9 @@
*/
public interface DocumentationService extends IService<Documentation> {
    IPage<Documentation> listPage(Page page, Documentation documentation);
    List<DocumentationDto> listPage(Page page, Documentation documentation);
    void export(HttpServletResponse response);
    void export(HttpServletResponse response,Documentation documentation);
    boolean deleteByIds(List<Long> ids);
}
src/main/java/com/ruoyi/warehouse/service/WarehouseGoodsShelvesRowcolService.java
@@ -1,9 +1,8 @@
package com.ruoyi.warehouse.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.warehouse.pojo.WarehouseGoodsShelvesRowcol;
import com.ruoyi.warehouse.dto.WarehouseGoodsShelvesRowcolDto;
import java.util.List;
@@ -14,11 +13,11 @@
*/
public interface WarehouseGoodsShelvesRowcolService extends IService<WarehouseGoodsShelvesRowcol> {
    IPage<WarehouseGoodsShelvesRowcol> listPage(Page page, WarehouseGoodsShelvesRowcol warehouseGoodsShelvesRowcol);
    boolean deleteByIds(List<Long> ids);
//    boolean add(WarehouseGoodsShelvesRowcol warehouseGoodsShelvesRowcol);
    List<WarehouseGoodsShelvesRowcolDto> getList(WarehouseGoodsShelvesRowcol warehouseGoodsShelvesRowcol);
}
src/main/java/com/ruoyi/warehouse/service/WarehouseGoodsShelvesService.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.warehouse.dto.WarehouseGoodsShelvesDto;
import com.ruoyi.warehouse.pojo.WarehouseGoodsShelves;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param;
@@ -15,7 +16,6 @@
*/
public interface WarehouseGoodsShelvesService extends IService<WarehouseGoodsShelves> {
    IPage<WarehouseGoodsShelves> listPage(Page page,WarehouseGoodsShelves warehouseGoodsShelves);
    boolean add(WarehouseGoodsShelves warehouseGoodsShelves);
@@ -23,6 +23,5 @@
    boolean deleteByIds(List<Long> ids);
    List<WarehouseGoodsShelves> list(WarehouseGoodsShelves warehouseGoodsShelves);
    List<WarehouseGoodsShelves> findList(WarehouseGoodsShelves warehouseGoodsShelves);
}
src/main/java/com/ruoyi/warehouse/service/WarehouseService.java
@@ -2,6 +2,9 @@
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.warehouse.dto.WarehouseDto;
import com.ruoyi.warehouse.dto.WarehouseGoodsShelvesDto;
import com.ruoyi.warehouse.dto.WarehouseTreeDto;
import com.ruoyi.warehouse.pojo.Warehouse;
import java.util.List;
@@ -13,7 +16,9 @@
*/
public interface WarehouseService extends IService<Warehouse> {
    List<Warehouse> listPage( Warehouse warehouse);
    boolean deleteByIds(List<Long> ids);
    List<Warehouse> findList(Warehouse warehouse);
    List<WarehouseTreeDto> findListTree();
}
src/main/java/com/ruoyi/warehouse/service/impl/DocumentClassificationServiceImpl.java
@@ -3,6 +3,12 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.basic.dto.ProductTreeDto;
import com.ruoyi.basic.pojo.Product;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.warehouse.dto.DocumentClassificationDto;
import com.ruoyi.warehouse.dto.DocumentClassificationTreeDto;
import com.ruoyi.warehouse.dto.DocumentationDto;
import com.ruoyi.warehouse.mapper.DocumentationMapper;
import com.ruoyi.warehouse.pojo.DocumentClassification;
import com.ruoyi.warehouse.pojo.Documentation;
@@ -11,7 +17,9 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* @author 86151
@@ -23,16 +31,69 @@
    implements DocumentClassificationService{
    @Autowired
    private DocumentationMapper documentationMapper;
    @Autowired
    private DocumentClassificationMapper documentClassificationMapper;
    @Override
    public boolean deleteByIds(List<Long> ids) {
        List<Documentation> documentations = documentationMapper.selectList(new LambdaQueryWrapper<Documentation>().in(Documentation::getDocumentClassificationId, ids));
        if(!CollectionUtils.isEmpty(documentations)){
            return false;
        List<DocumentClassification> list = documentClassificationMapper.selectList(new LambdaQueryWrapper<DocumentClassification>().in(DocumentClassification::getId, ids));
        for (DocumentClassification documentClassification : list) {
          //如果每项的父id为空,说明是根节点,需要删除文档信息表中的数据
            List<DocumentationDto> documentationDtos = documentationMapper.listByDocumentClassificationId(documentClassification.getId());
            if (CollectionUtils.isNotEmpty(documentationDtos)){
                throw new RuntimeException("存在文档信息,不能删除");
            }
            documentClassificationMapper.deleteById(documentClassification.getId());
        }
        baseMapper.deleteBatchIds(ids);
        return true;
    }
    @Override
    public List<DocumentClassificationTreeDto> selectDocumentClassificationList(DocumentClassificationDto documentClassificationDto) {
        // æŸ¥è¯¢æ ¹èŠ‚ç‚¹ï¼ˆparentId ä¸º null)
        LambdaQueryWrapper<DocumentClassification> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.isNull(DocumentClassification::getParentId);
        if (documentClassificationDto.getCategory() != null && !documentClassificationDto.getCategory().isEmpty()) {
            queryWrapper.like(DocumentClassification::getCategory, documentClassificationDto.getCategory());
        }
        // æŸ¥è¯¢æ ¹èŠ‚ç‚¹åˆ—è¡¨
        List<DocumentClassification> rootList = baseMapper.selectList(queryWrapper);
        // è½¬æ¢ä¸ºæ ‘节点并递归构建子树
        List<DocumentClassificationTreeDto> tree = new ArrayList<>();
        for (DocumentClassification documentClassification : rootList) {
            DocumentClassificationTreeDto node = convertToTreeDto(documentClassification);
            node.setChildren(buildDocumentChildrenNodes(documentClassification.getId()));
            tree.add(node);
        }
        return tree;
    }
    // é€’归构建子节点
    private List<DocumentClassificationTreeDto> buildDocumentChildrenNodes(Long parentId) {
        // æŸ¥è¯¢å½“前父节点的子节点
        LambdaQueryWrapper<DocumentClassification> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(DocumentClassification::getParentId, parentId);
        List<DocumentClassification> childList = baseMapper.selectList(queryWrapper);
        // è½¬æ¢å­èŠ‚ç‚¹å¹¶é€’å½’æž„å»ºå®ƒä»¬çš„å­æ ‘
        List<DocumentClassificationTreeDto> children = new ArrayList<>();
        for (DocumentClassification child : childList) {
            DocumentClassificationTreeDto childNode = convertToTreeDto(child);
            childNode.setChildren(buildDocumentChildrenNodes(child.getId()));
            children.add(childNode);
        }
        return children;
    }
    // å°† DocumentClassification è½¬æ¢ä¸º DocumentClassificationTreeDto
    private DocumentClassificationTreeDto convertToTreeDto(DocumentClassification documentClassification) {
        DocumentClassificationTreeDto dto = new DocumentClassificationTreeDto();
        BeanUtils.copyProperties(documentClassification, dto);
        dto.setCategory(documentClassification.getCategory()); // è®¾ç½® label ä¸ºäº§å“åç§°
        dto.setChildren(new ArrayList<>());
        return dto;
    }
}
src/main/java/com/ruoyi/warehouse/service/impl/DocumentationBorrowManagementServiceImpl.java
@@ -6,7 +6,8 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.procurementrecord.dto.ProcurementRecordOutPageDto;
import com.ruoyi.warehouse.dto.DocumentationBorrowManagementDto;
import com.ruoyi.warehouse.dto.ReturnExportDto;
import com.ruoyi.warehouse.pojo.Documentation;
import com.ruoyi.warehouse.pojo.DocumentationBorrowManagement;
import com.ruoyi.warehouse.service.DocumentationBorrowManagementService;
@@ -17,6 +18,7 @@
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDateTime;
import java.util.List;
import java.util.stream.Collectors;
@@ -42,68 +44,75 @@
    @Override
    public boolean add(DocumentationBorrowManagement documentationBorrowManagement) {
        Long documentationId = documentationBorrowManagement.getDocumentationId();
        String borrowStatus = documentationBorrowManagement.getBorrowStatus();
        Documentation documentation = documentationService.getById(documentationId);
        if (documentation==null){
            System.out.println("文档不存在");
            return false;
        }
        if ("借出".equals(documentation.getDocStatus())){
            if ("归还".equals(borrowStatus)){
                documentation.setDocStatus("正常");
                documentationService.updateById(documentation);
                documentationBorrowManagementMapper.insert(documentationBorrowManagement);
                return true;
            }else{
                System.out.println("文档已借出,不能重复借出");
                return false;
            }
        }else if("正常".equals(documentation.getDocStatus())){
            if ("归还".equals(borrowStatus)){
                System.out.println("文档已归还,不能重复归还");
                return false;
            }else if("借出".equals(borrowStatus)){
                documentation.setDocStatus("借出");
                documentationService.updateById(documentation);
                documentationBorrowManagementMapper.insert(documentationBorrowManagement);
                return true;
            }
        }else{
            System.out.println("文档状态异常");
            return false;
        }
        return false;
        documentationBorrowManagementMapper.insert(documentationBorrowManagement);
        Documentation documentation = documentationService.getById(documentationBorrowManagement.getDocumentationId());
        documentation.setDocStatus("借出");
        documentationService.updateById(documentation);
        return true;
    }
//    @Override
//    public boolean updateDBMById(DocumentationBorrowManagement documentationBorrowManagement) {
//        Long id = documentationBorrowManagement.getId();
////        Long documentationId = documentationBorrowManagement.getDocumentationId();
//        //查询文档是否已归还
//        DocumentationBorrowManagement dbm = documentationBorrowManagementMapper.selectById(id);
////        Long documentationId = dbm.getDocumentationId();
//        if ("归还".equals(dbm.getBorrowStatus())){
//            System.out.println("文档已归还,不能更新");
//            return false;
//        }
//        //查询文档
//        Documentation documentation = documentationService.getById(dbm.getDocumentationId());
//        String docStatus = documentation.getDocStatus();
//        if ("正常".equals(docStatus)){
//            System.out.println("文档已归还,不能更新");
//            return false;
//        }
//        return false;
//    }
    @Override
    public boolean reventdbm(DocumentationBorrowManagement documentationBorrowManagement) {
        DocumentationBorrowManagement documentationBorrowManagement1 = new DocumentationBorrowManagement();
        // æ›´æ–°å€Ÿé˜…记录状态为归还
        documentationBorrowManagement1.setBorrowStatus("归还");
        documentationBorrowManagement1.setReturnDate(LocalDateTime.now());
        documentationBorrowManagementMapper.updateById(documentationBorrowManagement1);
        documentationBorrowManagementMapper.update(documentationBorrowManagement1,new LambdaQueryWrapper<DocumentationBorrowManagement>().eq(DocumentationBorrowManagement::getId,documentationBorrowManagement.getId()));
        // æ›´æ–°æ–‡æ¡£çŠ¶æ€ä¸ºæ­£å¸¸
        Documentation documentation = documentationService.getById(documentationBorrowManagement.getDocumentationId());
        documentation.setDocStatus("正常");
        documentationService.updateById(documentation);
        return true;
    }
    @Override
    public boolean reventDeleteByIds(List<Long> ids) {
        QueryWrapper<DocumentationBorrowManagement> queryWrapper = new QueryWrapper<>();
        queryWrapper.in("id", ids);
        queryWrapper.eq("borrow_status", "归还");
        List<DocumentationBorrowManagement> list = documentationBorrowManagementMapper.selectList(queryWrapper);
        for (DocumentationBorrowManagement documentationBorrowManagement : list) {
            try {
                documentationBorrowManagement.setBorrowStatus("借阅");
                documentationBorrowManagement.setReturnDate(null);
                documentationBorrowManagementMapper.updateById(documentationBorrowManagement);
                Documentation documentation = documentationService.getById(documentationBorrowManagement.getDocumentationId());
                if (documentation != null) {
                    documentation.setDocStatus("借出");
                    documentationService.updateById(documentation);
                }
            } catch (Exception e) {
                throw new RuntimeException("更新借阅记录和文档状态时出错", e);
            }
        }
        return true;
    }
    @Override
    public void export(HttpServletResponse response, DocumentationBorrowManagement documentationBorrowManagement) {
        List<DocumentationBorrowManagementDto> documentationBorrowManagements = documentationBorrowManagementMapper.export(documentationBorrowManagement);
        ExcelUtil<DocumentationBorrowManagementDto> util = new ExcelUtil<>(DocumentationBorrowManagementDto.class);
        util.exportExcel(response, documentationBorrowManagements, "文档借阅-借阅记录");
    }
    @Override
    public void exportrevent(HttpServletResponse response, DocumentationBorrowManagement documentationBorrowManagement) {
        List<ReturnExportDto> documentationBorrowManagements = documentationBorrowManagementMapper.exportrevent(documentationBorrowManagement);
        ExcelUtil<ReturnExportDto> util = new ExcelUtil<>(ReturnExportDto.class);
        util.exportExcel(response, documentationBorrowManagements, "文档借阅-归还记录");
    }
    @Override
    public boolean deleteByIds(List<Long> ids) {
        List<DocumentationBorrowManagement> list = documentationBorrowManagementMapper.selectList(new LambdaQueryWrapper<DocumentationBorrowManagement>().in(DocumentationBorrowManagement::getId, ids));
        for (DocumentationBorrowManagement documentationBorrowManagement : list) {
            String borrowStatus = documentationBorrowManagement.getBorrowStatus();
            if ("借阅".equals(borrowStatus)){
                System.out.println("文档已借出,不能删除");
                return false;
            Documentation documentation = documentationService.getById(documentationBorrowManagement.getDocumentationId());
            documentation.setDocStatus("正常");
            boolean b = documentationService.updateById(documentation);
            if (!b){
                throw new RuntimeException("更新文档状态失败");
            }
        }
        documentationBorrowManagementMapper.deleteBatchIds(ids);
@@ -111,6 +120,8 @@
    }
}
src/main/java/com/ruoyi/warehouse/service/impl/DocumentationFileServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,24 @@
package com.ruoyi.warehouse.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.warehouse.mapper.DocumentationFileMapper;
import com.ruoyi.warehouse.pojo.DocumentationFile;
import com.ruoyi.warehouse.service.DocumentationFileService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
@AllArgsConstructor
@Service
public class DocumentationFileServiceImpl extends ServiceImpl<DocumentationFileMapper, DocumentationFile> implements DocumentationFileService {
    private DocumentationFileMapper documentationFileMapper;
    @Override
    public IPage<DocumentationFile> documentationFileListPage(Page page, DocumentationFile documentationFile) {
        return documentationFileMapper.documentationFileListPage(page,documentationFile);
    }
}
src/main/java/com/ruoyi/warehouse/service/impl/DocumentationServiceImpl.java
@@ -1,10 +1,13 @@
package com.ruoyi.warehouse.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.warehouse.dto.DocumentationDto;
import com.ruoyi.warehouse.pojo.Documentation;
import com.ruoyi.warehouse.pojo.DocumentationBorrowManagement;
import com.ruoyi.warehouse.service.DocumentationService;
import com.ruoyi.warehouse.mapper.DocumentationMapper;
import org.springframework.beans.factory.annotation.Autowired;
@@ -24,16 +27,29 @@
    @Autowired
    private DocumentationMapper documentationMapper;
    @Override
    public IPage<Documentation> listPage(Page page, Documentation documentation) {
    public List<DocumentationDto> listPage(Page page, Documentation documentation) {
        return documentationMapper.listPage(page, documentation);
    }
    @Override
    public void export(HttpServletResponse response) {
        List<Documentation> list =documentationMapper.list();
        ExcelUtil<Documentation> util = new ExcelUtil<>(Documentation.class);
    public void export(HttpServletResponse response,Documentation documentation) {
        List<DocumentationDto> list = documentationMapper.listPage(null, documentation);
        ExcelUtil<DocumentationDto> util = new ExcelUtil<>(DocumentationDto.class);
        util.exportExcel(response, list, "文档信息表");
    }
    @Override
    public boolean deleteByIds(List<Long> ids) {
        List<Documentation> documentationList = documentationMapper.selectList(new LambdaQueryWrapper<Documentation>().in(Documentation::getId, ids));
        for (Documentation documentation : documentationList) {
            //如果文档状态是已借出,不能删除
            if ("借出".equals(documentation.getDocStatus()) || "作废".equals(documentation.getDocStatus())) {
                throw new RuntimeException("当前文档状态为 " + documentation.getDocStatus() + ",不支持删除");
            }
            documentationMapper.deleteById(documentation.getId());
        }
        return true;
    }
}
src/main/java/com/ruoyi/warehouse/service/impl/WarehouseGoodsShelvesRowcolServiceImpl.java
@@ -3,20 +3,18 @@
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.warehouse.mapper.DocumentationMapper;
import com.ruoyi.warehouse.mapper.WarehouseGoodsShelvesRowcolMapper;
import com.ruoyi.warehouse.pojo.Documentation;
import com.ruoyi.warehouse.pojo.WarehouseGoodsShelvesRowcol;
import com.ruoyi.warehouse.dto.WarehouseGoodsShelvesRowcolDto;
import com.ruoyi.warehouse.service.WarehouseGoodsShelvesRowcolService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
/**
@@ -34,21 +32,23 @@
    private DocumentationMapper documentationMapper;
    @Override
    public IPage<WarehouseGoodsShelvesRowcol> listPage(Page page, WarehouseGoodsShelvesRowcol warehouseGoodsShelvesRowcol) {
        IPage<WarehouseGoodsShelvesRowcol> list = warehouseGoodsShelvesRowcolMapper.listPage(page, warehouseGoodsShelvesRowcol);
    public List<WarehouseGoodsShelvesRowcolDto> getList(WarehouseGoodsShelvesRowcol warehouseGoodsShelvesRowcol) {
        List<WarehouseGoodsShelvesRowcolDto> list = warehouseGoodsShelvesRowcolMapper.findList(warehouseGoodsShelvesRowcol);
        return list;
    }
    @Override
    public boolean deleteByIds(List<Long> ids) {
        // 3. æ£€æŸ¥æ˜¯å¦æœ‰å•†å“
        Wrapper<Documentation> queryWrapper = new LambdaQueryWrapper<Documentation>()
                .in(Documentation::getWarehouseGoodsShelvesRowcolId, ids);
        List<Documentation> documentations = documentationMapper.selectList(queryWrapper);
        if (!documentations.isEmpty()) return false;
        if (!documentations.isEmpty()) throw new RuntimeException("货架下有商品,不能删除");
        warehouseGoodsShelvesRowcolMapper.deleteBatchIds(ids);
        return true;
    }
}
src/main/java/com/ruoyi/warehouse/service/impl/WarehouseGoodsShelvesServiceImpl.java
@@ -9,6 +9,7 @@
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.warehouse.dto.WarehouseGoodsShelvesDto;
import com.ruoyi.warehouse.mapper.DocumentationMapper;
import com.ruoyi.warehouse.mapper.WarehouseGoodsShelvesMapper;
import com.ruoyi.warehouse.mapper.WarehouseGoodsShelvesRowcolMapper;
@@ -49,10 +50,6 @@
    private DocumentationService documentationService;
    @Autowired
    private DocumentationMapper documentationMapper;
    @Override
    public IPage<WarehouseGoodsShelves> listPage(Page page, WarehouseGoodsShelves warehouseGoodsShelves) {
        return warehouseGoodsShelvesMapper.listPage(page,warehouseGoodsShelves);
    }
    @Override
    public boolean add(WarehouseGoodsShelves warehouseGoodsShelves) {
@@ -109,7 +106,7 @@
        Wrapper<Documentation> queryWrapper1 = new LambdaQueryWrapper<Documentation>()
                .in(Documentation::getWarehouseGoodsShelvesRowcolId, rowcolIds);
        List<Documentation> documentations = documentationMapper.selectList(queryWrapper1);
        if (!documentations.isEmpty()) return false;
        if (!documentations.isEmpty()) throw new RuntimeException("货架下有商品,不能删除");
        // å…ˆæ›´æ–°è´§æž¶ä¸»ä¿¡æ¯
        updateById(warehouseGoodsShelves);
@@ -148,7 +145,7 @@
            Wrapper<Documentation> queryWrapper1 = new LambdaQueryWrapper<Documentation>()
                    .in(Documentation::getWarehouseGoodsShelvesRowcolId, rowcolIds);
            List<Documentation> documentations = documentationMapper.selectList(queryWrapper1);
            if (!documentations.isEmpty()) return false; // ä»»ä¸€è´§æž¶æœ‰å•†å“åˆ™ç»ˆæ­¢åˆ é™¤
            if (!documentations.isEmpty()) throw new RuntimeException("货架下有商品,不能删除"); // ä»»ä¸€è´§æž¶æœ‰å•†å“åˆ™ç»ˆæ­¢åˆ é™¤
        }
        // 3. å…ˆåˆ é™¤è´§æž¶ä¸»è®°å½•
@@ -166,9 +163,10 @@
        return true;
    }
    @Override
    public List<WarehouseGoodsShelves> list(WarehouseGoodsShelves warehouseGoodsShelves) {
        return warehouseGoodsShelvesMapper.list(warehouseGoodsShelves);
    public List<WarehouseGoodsShelves> findList(WarehouseGoodsShelves warehouseGoodsShelves) {
        return warehouseGoodsShelvesMapper.listAll(warehouseGoodsShelves);
    }
}
src/main/java/com/ruoyi/warehouse/service/impl/WarehouseServiceImpl.java
@@ -8,9 +8,15 @@
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.warehouse.dto.WarehouseDto;
import com.ruoyi.warehouse.dto.WarehouseGoodsShelvesDto;
import com.ruoyi.warehouse.dto.WarehouseTreeDto;
import com.ruoyi.warehouse.mapper.WarehouseGoodsShelvesMapper;
import com.ruoyi.warehouse.mapper.WarehouseGoodsShelvesRowcolMapper;
import com.ruoyi.warehouse.mapper.WarehouseMapper;
import com.ruoyi.warehouse.pojo.Warehouse;
import com.ruoyi.warehouse.pojo.WarehouseGoodsShelves;
import com.ruoyi.warehouse.pojo.WarehouseGoodsShelvesRowcol;
import com.ruoyi.warehouse.service.WarehouseGoodsShelvesService;
import com.ruoyi.warehouse.service.WarehouseService;
import lombok.extern.slf4j.Slf4j;
@@ -19,8 +25,11 @@
import org.springframework.transaction.annotation.Transactional;
import java.sql.Array;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import static org.springframework.beans.BeanUtils.copyProperties;
/**
* @author 86151
@@ -35,25 +44,11 @@
    private WarehouseMapper warehouseMapper;
    @Autowired
    private WarehouseGoodsShelvesService warehouseGoodsShelvesService;
    @Autowired
    private WarehouseGoodsShelvesMapper warehouseGoodsShelvesMapper;
    @Autowired
    private WarehouseGoodsShelvesRowcolMapper warehouseGoodsShelvesRowcolMapper;
    @Override
    public List<Warehouse> listPage(Warehouse warehouse) {
        return warehouseMapper.listPage( warehouse);
    }
//    @Override
//    public boolean deleteByIds(List<Long> ids) {
//
//        for (Long id : ids) {
//            List<WarehouseGoodsShelves> list = warehouseGoodsShelvesService.list(new QueryWrapper<WarehouseGoodsShelves>().lambda()
//                    .eq(WarehouseGoodsShelves::getWarehouseId, id));
//            if(list.size()>0){
//                log.error("仓库下有货架,不能删除 é‡æ–°é€‰æ‹©");
//                return false;
//            }
//        }
//        return removeByIds(ids);
//    }
    @Override
    public boolean deleteByIds(List<Long> ids) {
        // 1. æ£€æŸ¥æ˜¯å¦æœ‰è´§æž¶
@@ -61,14 +56,116 @@
                .in(WarehouseGoodsShelves::getWarehouseId, ids);
        List<WarehouseGoodsShelves> shelvesList = warehouseGoodsShelvesService.list(queryWrapper);
        //获得shelvesList中所有的Id
        List<Long> shelvesIds = shelvesList.stream().map(WarehouseGoodsShelves::getId).collect(Collectors.toList());
        // 2. åˆ é™¤è´§æž¶
        if (!shelvesIds.isEmpty()) {
            warehouseGoodsShelvesService.deleteByIds(shelvesIds);
            boolean b = warehouseGoodsShelvesService.deleteByIds(shelvesIds);
            if (!b) {
                throw new RuntimeException("删除货架失败");
            }
        }
        return removeByIds(ids);
    }
    @Override
    public List<Warehouse> findList(Warehouse warehouse) {
        return warehouseMapper.listAll(warehouse);
    }
    /**
     * æŸ¥è¯¢ä»“库-货架-层列三级树结构
     */
    @Override
    public List<WarehouseTreeDto> findListTree() {
        // æŸ¥è¯¢æ‰€æœ‰æ ¹èŠ‚ç‚¹ï¼ˆä»“åº“ï¼‰
        LambdaQueryWrapper<Warehouse> queryWrapper = new LambdaQueryWrapper<>();
        // æŸ¥è¯¢ä»“库列表(一级节点)
        List<Warehouse> warehouseList = warehouseMapper.selectList(queryWrapper);
        // è½¬æ¢ä¸ºæ ‘节点并构建子树
        List<WarehouseTreeDto> tree = new ArrayList<>();
        for (Warehouse warehouse : warehouseList) {
            WarehouseTreeDto node = convertToWarehouseTreeDto(warehouse);
            // ä¸ºæ¯ä¸ªä»“库添加货架子节点
            node.setChildren(buildShelfChildrenNodes(warehouse.getId()));
            tree.add(node);
        }
        return tree;
    }
    /**
     * æž„建货架子节点(二级节点)
     */
    private List<WarehouseTreeDto> buildShelfChildrenNodes(Long warehouseId) {
        // æŸ¥è¯¢æŒ‡å®šä»“库下的所有货架
        LambdaQueryWrapper<WarehouseGoodsShelves> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(WarehouseGoodsShelves::getWarehouseId, warehouseId);
        List<WarehouseGoodsShelves> shelfList = warehouseGoodsShelvesMapper.selectList(queryWrapper);
        // è½¬æ¢ä¸ºæ ‘节点并构建层列子节点
        List<WarehouseTreeDto> shelfNodes = new ArrayList<>();
        for (WarehouseGoodsShelves shelf : shelfList) {
            WarehouseTreeDto shelfNode = convertToShelfTreeDto(shelf);
            // ä¸ºæ¯ä¸ªè´§æž¶æ·»åŠ å±‚åˆ—å­èŠ‚ç‚¹
            shelfNode.setChildren(buildRowcolChildrenNodes(shelf.getId()));
            shelfNodes.add(shelfNode);
        }
        return shelfNodes;
    }
    /**
     * æž„建层列子节点(三级节点)
     */
    private List<WarehouseTreeDto> buildRowcolChildrenNodes(Long shelfId) {
        // æŸ¥è¯¢æŒ‡å®šè´§æž¶ä¸‹çš„æ‰€æœ‰å±‚列
        LambdaQueryWrapper<WarehouseGoodsShelvesRowcol> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(WarehouseGoodsShelvesRowcol::getWarehouseGoodsShelvesId, shelfId);
        List<WarehouseGoodsShelvesRowcol> rowcolList = warehouseGoodsShelvesRowcolMapper.selectList(queryWrapper);
        // è½¬æ¢ä¸ºæ ‘节点(层列没有子节点)
        List<WarehouseTreeDto> rowcolNodes = new ArrayList<>();
        for (WarehouseGoodsShelvesRowcol rowcol : rowcolList) {
            WarehouseTreeDto rowcolNode = convertToRowcolTreeDto(rowcol);
            rowcolNodes.add(rowcolNode);
        }
        return rowcolNodes;
    }
    /**
     * ä»“库实体转换为树节点DTO
     */
    private WarehouseTreeDto convertToWarehouseTreeDto(Warehouse warehouse) {
        WarehouseTreeDto dto = new WarehouseTreeDto();
        copyProperties(warehouse, dto);
        dto.setLabel(warehouse.getWarehouseName());
        dto.setChildren(new ArrayList<>());
        return dto;
    }
    /**
     * è´§æž¶å®žä½“转换为树节点DTO
     */
    private WarehouseTreeDto convertToShelfTreeDto(WarehouseGoodsShelves shelf) {
        WarehouseTreeDto dto = new WarehouseTreeDto();
        copyProperties(shelf, dto);
        dto.setLabel(shelf.getGoodsShelvesName());
        dto.setChildren(new ArrayList<>());
        return dto;
    }
    /**
     * å±‚列实体转换为树节点DTO
     */
    private WarehouseTreeDto convertToRowcolTreeDto(WarehouseGoodsShelvesRowcol rowcol) {
        WarehouseTreeDto dto = new WarehouseTreeDto();
        copyProperties(rowcol, dto);
        dto.setLabel(rowcol.getStorey() + "-" + rowcol.getArrange());
        dto.setChildren(new ArrayList<>());
        return dto;
    }
}
src/main/resources/mapper/warehouse/DocumentationBorrowManagementMapper.xml
@@ -4,22 +4,22 @@
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.warehouse.mapper.DocumentationBorrowManagementMapper">
<!--    <resultMap id="BaseResultMap" type="com.ruoyi.warehouse.pojo.DocumentationBorrowManagement">-->
<!--            <id property="id" column="id" jdbcType="BIGINT"/>-->
<!--            <result property="documentationId" column="documentation_id" jdbcType="BIGINT"/>-->
<!--            <result property="borrowerId" column="borrower_id" jdbcType="BIGINT"/>-->
<!--            <result property="borrowPurpose" column="borrow_purpose" jdbcType="VARCHAR"/>-->
<!--            <result property="borrowDate" column="borrow_date" jdbcType="TIMESTAMP"/>-->
<!--            <result property="dueReturnDate" column="due_return_date" jdbcType="TIMESTAMP"/>-->
<!--            <result property="returnDate" column="return_date" jdbcType="TIMESTAMP"/>-->
<!--            <result property="borrowStatus" column="borrow_status" jdbcType="VARCHAR"/>-->
<!--            <result property="remark" column="remark" jdbcType="VARCHAR"/>-->
<!--            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>-->
<!--            <result property="createUser" column="create_user" jdbcType="BIGINT"/>-->
<!--            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>-->
<!--            <result property="updateUser" column="update_user" jdbcType="BIGINT"/>-->
<!--            <result property="tenantId" column="tenant_id" jdbcType="BIGINT"/>-->
<!--    </resultMap>-->
    <resultMap id="BaseResultMap" type="com.ruoyi.warehouse.pojo.DocumentationBorrowManagement">
            <id property="id" column="id"/>
            <result property="documentationId" column="documentation_id" />
            <result property="borrowerId" column="borrower_id" />
            <result property="borrowPurpose" column="borrow_purpose" />
            <result property="borrowDate" column="borrow_date"/>
            <result property="dueReturnDate" column="due_return_date" />
            <result property="returnDate" column="return_date"/>
            <result property="borrowStatus" column="borrow_status" />
            <result property="remark" column="remark"/>
            <result property="createTime" column="create_time"/>
            <result property="createUser" column="create_user"/>
            <result property="updateTime" column="update_time"/>
            <result property="updateUser" column="update_user"/>
            <result property="tenantId" column="tenant_id"/>
    </resultMap>
<!--    <sql id="Base_Column_List">-->
<!--        id,documentation_id,borrower_id,-->
@@ -29,7 +29,7 @@
<!--        update_user,tenant_id-->
<!--    </sql>-->
    <select id="listPage" resultType="com.ruoyi.warehouse.pojo.DocumentationBorrowManagement">
        select * from documentation_borrow_management
        select *from documentation_borrow_management
        where 1=1
        <if test="documentationBorrowManagement.borrowStatus != null">
            and borrow_status = #{documentationBorrowManagement.borrowStatus}
@@ -40,14 +40,55 @@
        <if test="documentationBorrowManagement.borrowerId != null">
            and borrower_id = #{documentationBorrowManagement.borrowerId}
        </if>
        <if test="documentationBorrowManagement.borrowPurpose != null">
            and borrow_purpose = #{documentationBorrowManagement.borrowPurpose}
        <if test="documentationBorrowManagement.entryDateStart != null and documentationBorrowManagement.entryDateStart != ''">
            and borrow_date >= DATE_FORMAT(#{documentationBorrowManagement.entryDateStart},'%Y-%m-%d')
        </if>
        <if test="documentationBorrowManagement.borrowDate != null">
            and borrow_date = #{documentationBorrowManagement.borrowDate}
        <if test="documentationBorrowManagement.entryDateEnd != null and documentationBorrowManagement.entryDateEnd != ''">
            and borrow_date &lt;= DATE_FORMAT(#{documentationBorrowManagement.entryDateEnd},'%Y-%m-%d')
        </if>
        <if test="documentationBorrowManagement.dueReturnDate != null">
            and due_return_date = #{documentationBorrowManagement.dueReturnDate}
    </select>
    <select id="export" resultType="com.ruoyi.warehouse.dto.DocumentationBorrowManagementDto">
        select dbm.*,doc.doc_name,su.nick_name
        from documentation_borrow_management dbm
        LEFT JOIN documentation doc on doc.id = dbm.documentation_id
        LEFT JOIN sys_user su on su.user_id = dbm.borrower_id
        where 1=1
        <if test="documentationBorrowManagement.borrowStatus != null">
            and borrow_status = #{documentationBorrowManagement.borrowStatus}
        </if>
        <if test="documentationBorrowManagement.documentationId != null">
            and documentation_id = #{documentationBorrowManagement.documentationId}
        </if>
        <if test="documentationBorrowManagement.borrowerId != null">
            and borrower_id = #{documentationBorrowManagement.borrowerId}
        </if>
        <if test="documentationBorrowManagement.entryDateStart != null and documentationBorrowManagement.entryDateStart != ''">
            and borrow_date >= DATE_FORMAT(#{documentationBorrowManagement.entryDateStart},'%Y-%m-%d')
        </if>
        <if test="documentationBorrowManagement.entryDateEnd != null and documentationBorrowManagement.entryDateEnd != ''">
            and borrow_date &lt;= DATE_FORMAT(#{documentationBorrowManagement.entryDateEnd},'%Y-%m-%d')
        </if>
    </select>
    <select id="exportrevent" resultType="com.ruoyi.warehouse.dto.ReturnExportDto">
        select dbm.*,doc.doc_name,su.nick_name,su.nick_name as return_nick_name
        from documentation_borrow_management dbm
        LEFT JOIN documentation doc on doc.id = dbm.documentation_id
        LEFT JOIN sys_user su on su.user_id = dbm.borrower_id
        where 1=1
        <if test="documentationBorrowManagement.borrowStatus != null">
            and borrow_status = #{documentationBorrowManagement.borrowStatus}
        </if>
        <if test="documentationBorrowManagement.documentationId != null">
            and documentation_id = #{documentationBorrowManagement.documentationId}
        </if>
        <if test="documentationBorrowManagement.borrowerId != null">
            and borrower_id = #{documentationBorrowManagement.borrowerId}
        </if>
        <if test="documentationBorrowManagement.entryDateStart != null and documentationBorrowManagement.entryDateStart != ''">
            and borrow_date >= DATE_FORMAT(#{documentationBorrowManagement.entryDateStart},'%Y-%m-%d')
        </if>
        <if test="documentationBorrowManagement.entryDateEnd != null and documentationBorrowManagement.entryDateEnd != ''">
            and borrow_date &lt;= DATE_FORMAT(#{documentationBorrowManagement.entryDateEnd},'%Y-%m-%d')
        </if>
    </select>
</mapper>
src/main/resources/mapper/warehouse/DocumentationFileMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.ruoyi.warehouse.mapper.DocumentationFileMapper">
    <select id="documentationFileListPage" resultType="com.ruoyi.warehouse.pojo.DocumentationFile">
        SELECT
        *
        FROM documentation_file
        where
        1=1
        <if test="documentationFile.name != null and documentationFile.name != '' ">
            AND name = #{documentationFile.name}
        </if>
    </select>
</mapper>
src/main/resources/mapper/warehouse/DocumentationMapper.xml
@@ -4,58 +4,51 @@
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.warehouse.mapper.DocumentationMapper">
    <resultMap id="BaseResultMap" type="com.ruoyi.warehouse.pojo.Documentation">
            <id property="id" column="id" jdbcType="BIGINT"/>
            <result property="documentClassificationId" column="document_classification_id"/>
            <result property="docName" column="doc_name" jdbcType="VARCHAR"/>
            <result property="docNumber" column="doc_number" jdbcType="BIGINT"/>
            <result property="year" column="year" jdbcType="BIGINT"/>
            <result property="responsiblePerson" column="responsible_person" jdbcType="VARCHAR"/>
            <result property="warehouseGoodsShelvesRowcolId" column="warehouse_goods_shelves_rowcol_id" jdbcType="BIGINT"/>
            <result property="docDate" column="doc_date" jdbcType="TIMESTAMP"/>
            <result property="retentionPeriod" column="retention_period" jdbcType="BIGINT"/>
            <result property="securityLevel" column="security_level" jdbcType="VARCHAR"/>
            <result property="copyCount" column="copy_count" jdbcType="BIGINT"/>
            <result property="pageCount" column="page_count" jdbcType="BIGINT"/>
            <result property="docCategory" column="doc_category" jdbcType="VARCHAR"/>
            <result property="docType" column="doc_type" jdbcType="VARCHAR"/>
            <result property="urgencyLevel" column="urgency_level" jdbcType="VARCHAR"/>
            <result property="docStatus" column="doc_status" jdbcType="VARCHAR"/>
            <result property="remark" column="remark" jdbcType="VARCHAR"/>
            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
            <result property="createUser" column="create_user" jdbcType="VARCHAR"/>
            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
            <result property="updateUser" column="update_user" jdbcType="VARCHAR"/>
            <result property="tenantId" column="tenant_id" jdbcType="BIGINT"/>
    </resultMap>
    <sql id="Base_Column_List">
        id,category_name,doc_name,
        doc_number,year,responsible_person,
        warehouse_goods_shelves_rowcol_id,doc_date,retention_period,
        security_level,copy_count,page_count,
        doc_category,doc_type,urgency_level,
        doc_status,remark,create_time,
        create_user,update_time,update_user,
        tenant_id
    </sql>
    <select id="listPage" resultType="com.ruoyi.warehouse.pojo.Documentation">
        select * from documentation
    <select id="listPage" resultType="com.ruoyi.warehouse.dto.DocumentationDto">
        SELECT
        doc.*,
        dc.category,
        CONCAT(
            w.warehouse_name, '-',
            wgs.goods_shelves_name, '-',
            wgsr.storey, '层-',
            wgsr.arrange, '列'
        ) AS location_info  -- åˆå¹¶åŽçš„字段名
        FROM documentation doc
        LEFT JOIN document_classification dc ON doc.document_classification_id = dc.id
        LEFT JOIN warehouse_goods_shelves_rowcol wgsr ON wgsr.id = doc.warehouse_goods_shelves_rowcol_id
        LEFT JOIN warehouse_goods_shelves wgs ON wgs.id = wgsr.warehouse_goods_shelves_id
        LEFT JOIN warehouse w ON w.id = wgs.warehouse_id
        where 1=1
        <if test="documentation.documentClassificationId != null">
            and document_classification_id = #{documentation.documentClassificationId}
            and doc.document_classification_id = #{documentation.documentClassificationId}
        </if>
        <if test="documentation.docName != null">
            and doc_name = #{documentation.docName}
            and doc.doc_name = #{documentation.docName}
        </if>
        <if test="documentation.docNumber != null">
            and doc_number = #{documentation.docNumber}
            and doc.doc_number = #{documentation.docNumber}
        </if>
        <if test="documentation.id != null">
            and doc.id = #{documentation.id}
        </if>
    </select>
    <select id="list" resultType="com.ruoyi.warehouse.pojo.Documentation">
        select * from documentation t1
              left join warehouse_goods_shelves_rowcol t2 on t1.warehouse_goods_shelves_rowcol_id = t2.id
              left join warehouse_goods_shelves t3 on t2.warehouse_goods_shelves_id = t3.id
              left join warehouse t4 on t3.warehouse_id = t4.id
    <select id="listByDocumentClassificationId" resultType="com.ruoyi.warehouse.dto.DocumentationDto">
        SELECT
        doc.*,
        dc.category,
        CONCAT(
        w.warehouse_name, '-',
        wgs.goods_shelves_name, '-',
        wgsr.storey, '层-',
        wgsr.arrange, '列'
        ) AS location_info  -- åˆå¹¶åŽçš„字段名
        FROM documentation doc
        LEFT JOIN document_classification dc ON doc.document_classification_id = dc.id
        LEFT JOIN warehouse_goods_shelves_rowcol wgsr ON wgsr.id = doc.warehouse_goods_shelves_rowcol_id
        LEFT JOIN warehouse_goods_shelves wgs ON wgs.id = wgsr.warehouse_goods_shelves_id
        LEFT JOIN warehouse w ON w.id = wgs.warehouse_id
        where doc.document_classification_id = #{documentClassificationId}
    </select>
</mapper>
src/main/resources/mapper/warehouse/WarehouseGoodsShelvesMapper.xml
@@ -4,19 +4,32 @@
<mapper namespace="com.ruoyi.warehouse.mapper.WarehouseGoodsShelvesMapper">
    <select id="listPage" resultType="com.ruoyi.warehouse.pojo.WarehouseGoodsShelves">
        select * from warehouse_goods_shelves
    <select id="findList" resultType="com.ruoyi.warehouse.dto.WarehouseGoodsShelvesDto">
        SELECT
        wgsr.*,
        w.warehouse_name,
        wgs.goods_shelves_name,
        doc.*,
        dc.category
        FROM warehouse_goods_shelves_rowcol wgsr
        LEFT JOIN warehouse_goods_shelves wgs ON wgs.id = wgsr.warehouse_goods_shelves_id
        LEFT JOIN warehouse w ON w.id = wgs.warehouse_id
        LEFT JOIN documentation doc ON doc.warehouse_goods_shelves_rowcol_id = wgsr.id
        LEFT JOIN document_classification dc ON doc.document_classification_id = dc.id
        <where>
            1=1
            <if test="goodsShelvesName != null and goodsShelvesName != ''">
                and goods_shelves_name like concat('%',#{goodsShelvesName},'%')
            <if test="warehouseGoodsShelves.goodsShelvesName != null and warehouseGoodsShelves.goodsShelvesName != ''">
                and wgs.goods_shelves_name like concat('%',#{warehouseGoodsShelves.goodsShelvesName},'%')
            </if>
            <if test="warehouseId != null">
                and warehouse_id = #{warehouseId}
            <if test="warehouseGoodsShelves.warehouseId != null">
                and wgs.warehouse_id = #{warehouseGoodsShelves.warehouseId}
            </if>
            <if test="warehouseGoodsShelves.id != null">
                and wgs.id = #{warehouseGoodsShelves.id}
            </if>
        </where>
    </select>
    <select id="list" resultType="com.ruoyi.warehouse.pojo.WarehouseGoodsShelves">
    <select id="listAll" resultType="com.ruoyi.warehouse.pojo.WarehouseGoodsShelves">
        select * from warehouse_goods_shelves
        <where>
            1=1
@@ -26,7 +39,11 @@
            <if test="warehouseGoodsShelves.warehouseId != null">
                and warehouse_id = #{warehouseGoodsShelves.warehouseId}
            </if>
            <if test="warehouseGoodsShelves.id != null">
                and id = #{warehouseGoodsShelves.id}
            </if>
        </where>
    </select>
</mapper>
src/main/resources/mapper/warehouse/WarehouseGoodsShelvesRowcolMapper.xml
@@ -5,21 +5,31 @@
<mapper namespace="com.ruoyi.warehouse.mapper.WarehouseGoodsShelvesRowcolMapper">
    <select id="listPage" resultType="com.ruoyi.warehouse.pojo.WarehouseGoodsShelvesRowcol">
        select * from warehouse_goods_shelves_rowcol
    <select id="findList" resultType="com.ruoyi.warehouse.dto.WarehouseGoodsShelvesRowcolDto">
        SELECT
            wgsr.*,
            w.warehouse_name,
            wgs.goods_shelves_name,
            doc.*,
            dc.category
        FROM warehouse_goods_shelves_rowcol wgsr
        LEFT JOIN warehouse_goods_shelves wgs ON wgs.id = wgsr.warehouse_goods_shelves_id
        LEFT JOIN warehouse w ON w.id = wgs.warehouse_id
        LEFT JOIN documentation doc ON doc.warehouse_goods_shelves_rowcol_id = wgsr.id
        LEFT JOIN document_classification dc ON doc.document_classification_id = dc.id
        <where>
            1=1
            <if test="warehouseGoodsShelvesRowcol.storey != null">
                and storey = #{warehouseGoodsShelvesRowcol.storey}
                and wgsr.storey = #{warehouseGoodsShelvesRowcol.storey}
            </if>
            <if test="warehouseGoodsShelvesRowcol.arrange != null">
                and arrange = #{warehouseGoodsShelvesRowcol.arrange}
                and wgsr.arrange = #{warehouseGoodsShelvesRowcol.arrange}
            </if>
            <if test="warehouseGoodsShelvesRowcol.warehouseGoodsShelvesId != null">
                and warehouse_goods_shelves_id = #{warehouseGoodsShelvesRowcol.warehouseGoodsShelvesId}
                and wgsr.warehouse_goods_shelves_id = #{warehouseGoodsShelvesRowcol.warehouseGoodsShelvesId}
            </if>
            <if test="warehouseGoodsShelvesRowcol.warehouseId != null">
                and warehouse_id = #{warehouseGoodsShelvesRowcol.warehouseId}
            <if test="warehouseGoodsShelvesRowcol.id != null">
                and wgsr.id = #{warehouseGoodsShelvesRowcol.id}
            </if>
        </where>
    </select>
src/main/resources/mapper/warehouse/WarehouseMapper.xml
@@ -4,8 +4,89 @@
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.warehouse.mapper.WarehouseMapper">
<!--    &lt;!&ndash; å®šä¹‰ WarehouseDto çš„ resultMap(优化后) &ndash;&gt;-->
<!--    <resultMap id="WarehouseDtoResultMap" type="com.ruoyi.warehouse.dto.WarehouseDto">-->
<!--        &lt;!&ndash; æ˜ å°„ Warehouse çˆ¶ç±»çš„字段(仓库主表信息) &ndash;&gt;-->
<!--        <id property="id" column="w_id"/> &lt;!&ndash; æ˜Žç¡®åˆ«åï¼Œé¿å…ä¸Žå­è¡¨id冲突 &ndash;&gt;-->
<!--        <result property="warehouseName" column="warehouse_name"/>-->
<!--        &lt;!&ndash; å…¶ä»–父类字段按需添加,建议统一加表别名前缀 &ndash;&gt;-->
    <select id="listPage" resultType="com.ruoyi.warehouse.pojo.Warehouse">
<!--        &lt;!&ndash; ç§»é™¤ WarehouseDto ä¸­çš„ goodsShelvesName å­—段映射-->
<!--             åŽŸå› ï¼šè¯¥å­—æ®µå±žäºŽå­è¡¨ warehouse_goods_shelves,应通过嵌套集合获取,避免数据歧义 &ndash;&gt;-->
<!--        &lt;!&ndash; æ˜ å°„ WarehouseDto è‡ªèº«çš„分类字段(若业务需要关联文档分类) &ndash;&gt;-->
<!--        <result property="category" column="category"/>-->
<!--        &lt;!&ndash; æ˜ å°„嵌套集合:仓库-货架(一对多) &ndash;&gt;-->
<!--        <collection property="warehouseGoodsShelvesList" ofType="com.ruoyi.warehouse.dto.WarehouseGoodsShelvesDto">-->
<!--            <id property="id" column="wgs_id"/> &lt;!&ndash; è´§æž¶è¡¨ä¸»é”®ï¼Œå”¯ä¸€æ ‡è¯† &ndash;&gt;-->
<!--            <result property="goodsShelvesName" column="goods_shelves_name"/>-->
<!--            <result property="warehouseId" column="w_id"/> &lt;!&ndash; å…³è”仓库的外键,便于反向追溯 &ndash;&gt;-->
<!--            &lt;!&ndash; å…¶ä»–货架字段按需添加(如创建时间、状态等) &ndash;&gt;-->
<!--            &lt;!&ndash; æ˜ å°„嵌套集合:货架-行列(一对多) &ndash;&gt;-->
<!--            <collection property="warehouseGoodsShelvesRowcolList" ofType="com.ruoyi.warehouse.dto.WarehouseGoodsShelvesRowcolDto">-->
<!--                <id property="id" column="wgsr_id"/> &lt;!&ndash; è¡Œåˆ—表自身主键,修正原外键别名导致的歧义 &ndash;&gt;-->
<!--                <result property="storey" column="storey"/>-->
<!--                <result property="arrange" column="arrange"/>-->
<!--                <result property="warehouseGoodsShelvesId" column="wgs_id"/> &lt;!&ndash; å…³è”货架的外键 &ndash;&gt;-->
<!--                &lt;!&ndash; å…¶ä»–行列字段按需添加(如容量、状态等) &ndash;&gt;-->
<!--            </collection>-->
<!--        </collection>-->
<!--    </resultMap>-->
<!--    <select id="findList" resultMap="WarehouseDtoResultMap">-->
<!--        SELECT-->
<!--        w.id AS w_id, &#45;&#45; ä»“库表id加别名,避免与子表id冲突-->
<!--        w.warehouse_name,-->
<!--        wgs.id AS wgs_id, &#45;&#45; è´§æž¶è¡¨id加别名-->
<!--        wgs.goods_shelves_name,-->
<!--        wgsr.id AS wgsr_id, &#45;&#45; è¡Œåˆ—表id加别名(修正原外键别名,明确为主键)-->
<!--        wgsr.storey,-->
<!--        wgsr.arrange,-->
<!--        dc.category-->
<!--        FROM warehouse_goods_shelves_rowcol wgsr-->
<!--        LEFT JOIN warehouse_goods_shelves wgs ON wgs.id = wgsr.warehouse_goods_shelves_id-->
<!--        LEFT JOIN warehouse w ON  w.id = wgs.warehouse_id-->
<!--        &#45;&#45; å…³è”文档表和分类表时,若无需文档详情,建议用 EXISTS ä¼˜åŒ–,避免重复数据-->
<!--        LEFT JOIN documentation doc ON doc.warehouse_goods_shelves_rowcol_id = wgsr.id-->
<!--        LEFT JOIN document_classification dc ON doc.document_classification_id = dc.id-->
<!--        <where>-->
<!--            &lt;!&ndash; ç§»é™¤ 1=1,MyBatis的where标签会自动处理首个AND &ndash;&gt;-->
<!--            <if test="warehouse.warehouseName != null and warehouse.warehouseName != ''">-->
<!--                AND w.warehouse_name LIKE CONCAT('%', #{warehouse.warehouseName}, '%')-->
<!--            </if>-->
<!--            <if test="warehouse.id != null">-->
<!--                AND w.id = #{warehouse.id}-->
<!--            </if>-->
<!--        </where>-->
<!--        &#45;&#45; åˆ†ç»„去重:避免因多表连接导致的重复数据(核心优化点)-->
<!--        GROUP BY w.id, wgs.id, wgsr.id-->
<!--    </select>-->
        <select id="findList" resultType="com.ruoyi.warehouse.dto.WarehouseDto">
        SELECT
        wgsr.*,
        w.warehouse_name,
        wgs.goods_shelves_name,
        doc.doc_name,
        dc.category
        FROM warehouse_goods_shelves_rowcol wgsr
        LEFT JOIN warehouse_goods_shelves wgs ON wgs.id = wgsr.warehouse_goods_shelves_id
        LEFT JOIN warehouse w ON w.id = wgs.warehouse_id
        LEFT JOIN documentation doc ON doc.warehouse_goods_shelves_rowcol_id = wgsr.id
        LEFT JOIN document_classification dc ON doc.document_classification_id = dc.id
        <where>
            1=1
            <if test="warehouse.warehouseName != null">
                and w.warehouse_name like concat('%',#{warehouse.warehouseName},'%')
            </if>
            <if test="warehouse.id != null">
                and w.id = #{warehouse.id}
            </if>
        </where>
    </select>
    <select id="listAll" resultType="com.ruoyi.warehouse.pojo.Warehouse">
        select * from warehouse
        <where>
            1=1