| | |
| | | private DocumentClassificationService documentClassificationService; |
| | | //树结构 |
| | | @GetMapping("/getList") |
| | | public List<DocumentClassificationTreeDto> getList() { |
| | | return documentClassificationService.selectDocumentClassificationList(); |
| | | public AjaxResult getList() { |
| | | return AjaxResult.success(documentClassificationService.selectDocumentClassificationList()); |
| | | } |
| | | @PostMapping("/add") |
| | | @ApiOperation("文档分类-添加") |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public AjaxResult delDocumentationFile(@RequestBody List<Integer> ids) { |
| | | public AjaxResult delDocumentationFile(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("请选择至少一条数据"); |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | *分页查询 |
| | | * @param page |
| | | *查询 |
| | | * @param |
| | | * @param documentationFile |
| | | * @return |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public AjaxResult documentationFileListPage(Page page, DocumentationFile documentationFile) { |
| | | return AjaxResult.success(documentationFileService.documentationFileListPage(page, documentationFile)); |
| | | public AjaxResult documentationFileListPage(DocumentationFile documentationFile) { |
| | | return AjaxResult.success(documentationFileService.documentationFileListPage( documentationFile)); |
| | | } |
| | | |
| | | |
| | |
| | | @GetMapping("/listById") |
| | | @ApiOperation("商品货架-查询") |
| | | @Log(title = "商品货架-查询", businessType = BusinessType.OTHER) |
| | | public AjaxResult listById(@RequestBody WarehouseGoodsShelves warehouseGoodsShelves) { |
| | | public AjaxResult listById(WarehouseGoodsShelves warehouseGoodsShelves) { |
| | | List<WarehouseGoodsShelvesDto> list = warehouseGoodsShelvesService.findList(warehouseGoodsShelves); |
| | | return AjaxResult.success(list); |
| | | } |
| | |
| | | @GetMapping("/list") |
| | | @ApiOperation("商品货架行列-查询") |
| | | @Log(title = "商品货架行列-查询", businessType = BusinessType.OTHER) |
| | | public AjaxResult list(@RequestBody WarehouseGoodsShelvesRowcol warehouseGoodsShelvesRowcol) { |
| | | public AjaxResult list(WarehouseGoodsShelvesRowcol warehouseGoodsShelvesRowcol) { |
| | | |
| | | List<WarehouseGoodsShelvesRowcolDto> list = warehouseGoodsShelvesRowcolService.getList(warehouseGoodsShelvesRowcol); |
| | | return AjaxResult.success(list); |
| | |
| | | @Data |
| | | public class WarehouseGoodsShelvesRowcolDto extends WarehouseGoodsShelvesRowcol { |
| | | private String warehouseName; |
| | | private String goodsShelvesName; |
| | | private String docName; |
| | | private String docNumber; |
| | | private String name; |
| | | private List<DocumentationDto> documentationDtoList; |
| | | private String category; |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface DocumentationFileMapper extends BaseMapper<DocumentationFile> { |
| | | |
| | | IPage<DocumentationFile> documentationFileListPage(Page page, @Param("documentationFile") DocumentationFile documentationFile); |
| | | List<DocumentationFile> documentationFileListPage(@Param("documentationFile") DocumentationFile documentationFile); |
| | | } |
| | |
| | | private String url; |
| | | |
| | | @ApiModelProperty(value = "文件大小") |
| | | private int fileSize; |
| | | private Long fileSize; |
| | | |
| | | @ApiModelProperty(value = "文档ID") |
| | | @NotBlank(message = "文档id不能为空!") |
| | |
| | | /** |
| | | * 货架名称 |
| | | */ |
| | | private String goodsShelvesName; |
| | | private String name; |
| | | /** |
| | | * 层数 |
| | | */ |
| | | private Long storey; |
| | | @TableField("`row`") |
| | | private Long row; |
| | | |
| | | /** |
| | | * 列数 |
| | | */ |
| | | private Long arrange; |
| | | @TableField("`col`") |
| | | private Long col; |
| | | |
| | | /** |
| | | * 仓库id |
| | |
| | | /** |
| | | * 层数 |
| | | */ |
| | | private Long storey; |
| | | @TableField("`row`") |
| | | private Long row; |
| | | |
| | | /** |
| | | * 列数 |
| | | */ |
| | | private Long arrange; |
| | | @TableField("`col`") |
| | | private Long col; |
| | | |
| | | /** |
| | | * 货架id |
| | |
| | | import com.ruoyi.account.pojo.AccountFile; |
| | | import com.ruoyi.warehouse.pojo.DocumentationFile; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface DocumentationFileService extends IService<DocumentationFile> { |
| | | |
| | | |
| | | IPage<DocumentationFile> documentationFileListPage(Page page, DocumentationFile documentationFile); |
| | | List<DocumentationFile> documentationFileListPage(DocumentationFile documentationFile); |
| | | } |
| | |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @AllArgsConstructor |
| | | @Service |
| | | public class DocumentationFileServiceImpl extends ServiceImpl<DocumentationFileMapper, DocumentationFile> implements DocumentationFileService { |
| | |
| | | |
| | | |
| | | @Override |
| | | public IPage<DocumentationFile> documentationFileListPage(Page page, DocumentationFile documentationFile) { |
| | | return documentationFileMapper.documentationFileListPage(page,documentationFile); |
| | | public List<DocumentationFile> documentationFileListPage(DocumentationFile documentationFile) { |
| | | return documentationFileMapper.documentationFileListPage(documentationFile); |
| | | } |
| | | } |
| | |
| | | WarehouseGoodsShelves one = warehouseGoodsShelvesMapper.selectOne(new LambdaQueryWrapper<WarehouseGoodsShelves>().eq(WarehouseGoodsShelves::getId, warehouseGoodsShelves.getId())); |
| | | // 1. 检查货架名称是否已存在 |
| | | if (one == null) { |
| | | if(warehouseGoodsShelves.getRow() == null || warehouseGoodsShelves.getRow() == 0 && warehouseGoodsShelves.getCol() == null || warehouseGoodsShelves.getCol() == 0){ |
| | | throw new IllegalArgumentException("层数和列数不能为空"); |
| | | } |
| | | int insert = warehouseGoodsShelvesMapper.insert(warehouseGoodsShelves); |
| | | if (insert <= 0) return false; |
| | | } |
| | |
| | | Long warehouseId = warehouseGoodsShelves.getWarehouseId(); |
| | | // 3. 批量创建行列记录 |
| | | List<WarehouseGoodsShelvesRowcol> rowcolList = new ArrayList<>(); |
| | | for (long i = 1; i <= warehouseGoodsShelves.getStorey(); i++) { |
| | | for (long j = 1; j <= warehouseGoodsShelves.getArrange(); j++) { |
| | | for (long i = 1; i <= warehouseGoodsShelves.getRow(); i++) { |
| | | for (long j = 1; j <= warehouseGoodsShelves.getCol(); j++) { |
| | | WarehouseGoodsShelvesRowcol rowcol = new WarehouseGoodsShelvesRowcol(); |
| | | rowcol.setStorey(i); |
| | | rowcol.setArrange(j); |
| | | rowcol.setRow(i); |
| | | rowcol.setCol(j); |
| | | rowcol.setWarehouseGoodsShelvesId(shelvesId); |
| | | rowcolList.add(rowcol); |
| | | } |
| | |
| | | private WarehouseTreeDto convertToShelfTreeDto(WarehouseGoodsShelves shelf) { |
| | | WarehouseTreeDto dto = new WarehouseTreeDto(); |
| | | copyProperties(shelf, dto); |
| | | dto.setLabel(shelf.getGoodsShelvesName()); |
| | | // dto.setLabel(shelf.getGoodsShelvesName()); |
| | | dto.setLabel(shelf.getName()); |
| | | dto.setChildren(new ArrayList<>()); |
| | | return dto; |
| | | } |
| | |
| | | private WarehouseTreeDto convertToRowcolTreeDto(WarehouseGoodsShelvesRowcol rowcol) { |
| | | WarehouseTreeDto dto = new WarehouseTreeDto(); |
| | | copyProperties(rowcol, dto); |
| | | dto.setLabel(rowcol.getStorey() + "-" + rowcol.getArrange()); |
| | | // dto.setLabel(rowcol.getStorey() + "-" + rowcol.getArrange()); |
| | | dto.setLabel(rowcol.getRow() + "-" + rowcol.getCol()); |
| | | dto.setChildren(new ArrayList<>()); |
| | | return dto; |
| | | } |
| | |
| | | </if> |
| | | </select> |
| | | <select id="export" resultType="com.ruoyi.warehouse.dto.DocumentationBorrowManagementDto"> |
| | | select dbm.*,doc.doc_name,su.nick_name,sur.nick_name as return_nick_name |
| | | 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 |
| | | LEFT JOIN sys_user sur on sur.user_id = dbm.returner_id |
| | | where sur.nick_name IS NOT NULL |
| | | where 1=1 |
| | | <if test="documentationBorrowManagement.borrowStatus != null"> |
| | | and borrow_status = #{documentationBorrowManagement.borrowStatus} |
| | | </if> |
| | |
| | | <if test="documentationFile.name != null and documentationFile.name != '' "> |
| | | AND name = #{documentationFile.name} |
| | | </if> |
| | | <if test="documentationFile.documentationId != null"> |
| | | AND documentation_id = #{documentationFile.documentationId} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | dc.category, |
| | | CONCAT( |
| | | w.warehouse_name, '-', |
| | | wgs.goods_shelves_name, '-', |
| | | wgsr.storey, '层-', |
| | | wgsr.arrange, '列' |
| | | wgs.name, '-', |
| | | wgsr.row, '层-', |
| | | wgsr.col, '列' |
| | | ) AS location_info -- 合并后的字段名 |
| | | FROM documentation doc |
| | | LEFT JOIN document_classification dc ON doc.document_classification_id = dc.id |
| | |
| | | dc.category, |
| | | CONCAT( |
| | | w.warehouse_name, '-', |
| | | wgs.goods_shelves_name, '-', |
| | | wgsr.storey, '层-', |
| | | wgsr.arrange, '列' |
| | | wgs.name, '-', |
| | | wgsr.row, '层-', |
| | | wgsr.col, '列' |
| | | ) AS location_info -- 合并后的字段名 |
| | | FROM documentation doc |
| | | LEFT JOIN document_classification dc ON doc.document_classification_id = dc.id |
| | |
| | | <mapper namespace="com.ruoyi.warehouse.mapper.WarehouseGoodsShelvesRowcolMapper"> |
| | | <select id="findList" resultType="com.ruoyi.warehouse.dto.WarehouseGoodsShelvesRowcolDto"> |
| | | SELECT |
| | | doc.doc_name, |
| | | doc.doc_number, |
| | | wgsr.*, |
| | | doc.*, |
| | | w.warehouse_name, |
| | | wgs.goods_shelves_name, |
| | | wgs.name, |
| | | dc.category |
| | | FROM documentation doc |
| | | LEFT JOIN warehouse_goods_shelves_rowcol wgsr ON doc.warehouse_goods_shelves_rowcol_id = wgsr.id |
| | | FROM warehouse_goods_shelves_rowcol wgsr |
| | | LEFT JOIN documentation doc ON doc.warehouse_goods_shelves_rowcol_id = wgsr.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 |
| | | LEFT JOIN document_classification dc ON doc.document_classification_id = dc.id |
| | | <where> |
| | | 1=1 |
| | | <if test="warehouseGoodsShelvesRowcol.storey != null"> |
| | | and wgsr.storey = #{warehouseGoodsShelvesRowcol.storey} |
| | | <if test="warehouseGoodsShelvesRowcol.row != null"> |
| | | and wgsr.row = #{warehouseGoodsShelvesRowcol.row} |
| | | </if> |
| | | <if test="warehouseGoodsShelvesRowcol.arrange != null"> |
| | | and wgsr.arrange = #{warehouseGoodsShelvesRowcol.arrange} |
| | | <if test="warehouseGoodsShelvesRowcol.col != null"> |
| | | and wgsr.col = #{warehouseGoodsShelvesRowcol.col} |
| | | </if> |
| | | <if test="warehouseGoodsShelvesRowcol.warehouseGoodsShelvesId != null"> |
| | | and wgsr.warehouse_goods_shelves_id = #{warehouseGoodsShelvesRowcol.warehouseGoodsShelvesId} |
| | |
| | | <select id="findList" resultType="com.ruoyi.warehouse.dto.WarehouseDto"> |
| | | SELECT |
| | | w.*, |
| | | wgs.goods_shelves_name, |
| | | wgs.name, |
| | | doc.doc_name, |
| | | doc.doc_number, |
| | | dc.category |