xiebin
2022-09-16 25486dd71284f9b8cb724ae1f0e711305a18802c
增加库存管理功能
18 files added
882 ■■■■■ changed files
src/main/java/org/springblade/modules/inventory/controller/InventoryController.java 139 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/inventory/controller/InvreqRecordController.java 132 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/inventory/dto/InventoryDTO.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/inventory/dto/InvreqRecordDTO.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/inventory/entity/InventoryEntity.java 60 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/inventory/entity/InvreqRecordEntity.java 60 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/inventory/mapper/InventoryMapper.java 43 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/inventory/mapper/InventoryMapper.xml 28 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/inventory/mapper/InvreqRecordMapper.java 43 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/inventory/mapper/InvreqRecordMapper.xml 27 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/inventory/service/IInventoryService.java 42 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/inventory/service/IInvreqRecordService.java 49 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/inventory/service/impl/InventoryServiceImpl.java 42 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/inventory/service/impl/InvreqRecordServiceImpl.java 59 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/inventory/vo/InventoryVO.java 35 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/inventory/vo/InvreqRecordVO.java 35 ●●●●● patch | view | raw | blame | history
src/main/java/sql/inventory.menu.sql 10 ●●●●● patch | view | raw | blame | history
src/main/java/sql/invreqrecord.menu.sql 10 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/inventory/controller/InventoryController.java
New file
@@ -0,0 +1,139 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.inventory.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import javax.validation.Valid;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.system.entity.User;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.inventory.entity.InventoryEntity;
import org.springblade.modules.inventory.vo.InventoryVO;
import org.springblade.modules.inventory.service.IInventoryService;
import org.springblade.core.boot.ctrl.BladeController;
import java.util.List;
/**
 * 库存表 控制器
 *
 * @author aix
 * @since 2022-09-16
 */
@RestController
@AllArgsConstructor
@RequestMapping("inventory/inventory")
@Api(value = "库存表", tags = "库存表接口")
public class InventoryController extends BladeController {
    private final IInventoryService inventoryService;
    /**
     * 库存表 详情
     */
    @GetMapping("/detail")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "详情", notes = "传入inventory")
    public R<InventoryEntity> detail(InventoryEntity inventory) {
        InventoryEntity detail = inventoryService.getOne(Condition.getQueryWrapper(inventory));
        return R.data(detail);
    }
    /**
     * 库存表 分页
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "分页", notes = "传入inventory")
    public R<IPage<InventoryEntity>> list(InventoryEntity inventory, Query query) {
        IPage<InventoryEntity> pages = inventoryService.page(Condition.getPage(query), Condition.getQueryWrapper(inventory));
        return R.data(pages);
    }
    @GetMapping("/inv-list")
    @ApiOperationSupport(order = 11)
    @ApiOperation(value = "材料列表", notes = "传入inventory")
    public R<List<InventoryEntity>> userList(InventoryEntity inventory) {
        QueryWrapper<InventoryEntity> queryWrapper = Condition.getQueryWrapper(inventory);
        List<InventoryEntity> list = inventoryService.list();
        return R.data(list);
    }
    /**
     * 库存表 自定义分页
     */
    @GetMapping("/page")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入inventory")
    public R<IPage<InventoryVO>> page(InventoryVO inventory, Query query) {
        IPage<InventoryVO> pages = inventoryService.selectInventoryPage(Condition.getPage(query), inventory);
        return R.data(pages);
    }
    /**
     * 库存表 新增
     */
    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入inventory")
    public R save(@Valid @RequestBody InventoryEntity inventory) {
        return R.status(inventoryService.save(inventory));
    }
    /**
     * 库存表 修改
     */
    @PostMapping("/update")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入inventory")
    public R update(@Valid @RequestBody InventoryEntity inventory) {
        return R.status(inventoryService.updateById(inventory));
    }
    /**
     * 库存表 新增或修改
     */
    @PostMapping("/submit")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入inventory")
    public R submit(@Valid @RequestBody InventoryEntity inventory) {
        return R.status(inventoryService.saveOrUpdate(inventory));
    }
    /**
     * 库存表 删除
     */
    @PostMapping("/remove")
    @ApiOperationSupport(order = 7)
    @ApiOperation(value = "逻辑删除", notes = "传入ids")
    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
        return R.status(inventoryService.deleteLogic(Func.toLongList(ids)));
    }
}
src/main/java/org/springblade/modules/inventory/controller/InvreqRecordController.java
New file
@@ -0,0 +1,132 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.inventory.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import javax.validation.Valid;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.inventory.entity.InvreqRecordEntity;
import org.springblade.modules.inventory.vo.InvreqRecordVO;
import org.springblade.modules.inventory.service.IInvreqRecordService;
import org.springblade.core.boot.ctrl.BladeController;
/**
 * 库存申请 控制器
 *
 * @author aix
 * @since 2022-09-16
 */
@RestController
@AllArgsConstructor
@RequestMapping("invreqRecord/invreqRecord")
@Api(value = "库存申请", tags = "库存申请接口")
public class InvreqRecordController extends BladeController {
    private final IInvreqRecordService invreqRecordService;
    /**
     * 库存申请 详情
     */
    @GetMapping("/detail")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "详情", notes = "传入invreqRecord")
    public R<InvreqRecordEntity> detail(InvreqRecordEntity invreqRecord) {
        InvreqRecordEntity detail = invreqRecordService.getOne(Condition.getQueryWrapper(invreqRecord));
        return R.data(detail);
    }
    /**
     * 库存申请 分页
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "分页", notes = "传入invreqRecord")
    public R<IPage<InvreqRecordEntity>> list(InvreqRecordEntity invreqRecord, Query query) {
        IPage<InvreqRecordEntity> pages = invreqRecordService.page(Condition.getPage(query), Condition.getQueryWrapper(invreqRecord));
        return R.data(pages);
    }
    /**
     * 库存申请 自定义分页
     */
    @GetMapping("/page")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入invreqRecord")
    public R<IPage<InvreqRecordVO>> page(InvreqRecordVO invreqRecord, Query query) {
        IPage<InvreqRecordVO> pages = invreqRecordService.selectInvreqRecordPage(Condition.getPage(query), invreqRecord);
        return R.data(pages);
    }
    /**
     * 库存申请 新增
     */
    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入invreqRecord")
    public R save(@Valid @RequestBody InvreqRecordEntity invreqRecord) {
        return R.status(invreqRecordService.save(invreqRecord));
    }
    /**
     * 库存申请 修改
     */
    @PostMapping("/update")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入invreqRecord")
    public R update(@Valid @RequestBody InvreqRecordEntity invreqRecord) {
        return R.status(invreqRecordService.updateById(invreqRecord));
    }
    /**
     * 库存申请 新增或修改
     */
    @PostMapping("/submit")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入invreqRecord")
    public R submit(@Valid @RequestBody InvreqRecordEntity invreqRecord) {
        return R.status(invreqRecordService.saveOrUpdate(invreqRecord));
    }
    /**
     * 库存申请 删除
     */
    @PostMapping("/remove")
    @ApiOperationSupport(order = 7)
    @ApiOperation(value = "逻辑删除", notes = "传入ids")
    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
        return R.status(invreqRecordService.deleteLogic(Func.toLongList(ids)));
    }
    @PostMapping("/outboundByids")
    @ApiOperationSupport(order = 7)
    @ApiOperation(value = "出库", notes = "传入ids")
    public R outboundByids(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
        return R.status(invreqRecordService.outboundByids(Func.toLongList(ids)));
    }
}
src/main/java/org/springblade/modules/inventory/dto/InventoryDTO.java
New file
@@ -0,0 +1,34 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.inventory.dto;
import org.springblade.modules.inventory.entity.InventoryEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * 库存表 数据传输对象实体类
 *
 * @author aix
 * @since 2022-09-16
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class InventoryDTO extends InventoryEntity {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/inventory/dto/InvreqRecordDTO.java
New file
@@ -0,0 +1,34 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.inventory.dto;
import org.springblade.modules.inventory.entity.InvreqRecordEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * 库存申请 数据传输对象实体类
 *
 * @author aix
 * @since 2022-09-16
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class InvreqRecordDTO extends InvreqRecordEntity {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/inventory/entity/InventoryEntity.java
New file
@@ -0,0 +1,60 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.inventory.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
/**
 * 库存表 实体类
 *
 * @author aix
 * @since 2022-09-16
 */
@Data
@TableName("ins_inventory")
@ApiModel(value = "Inventory对象", description = "库存表")
@EqualsAndHashCode(callSuper = true)
public class InventoryEntity extends TenantEntity {
    /**
     * 名称
     */
    @ApiModelProperty(value = "名称")
    private String name;
    /**
     * 单位
     */
    @ApiModelProperty(value = "单位")
    private String unit;
    /**
     * 库存数量
     */
    @ApiModelProperty(value = "库存数量")
    private Integer inventoryNum;
    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    private String remark;
}
src/main/java/org/springblade/modules/inventory/entity/InvreqRecordEntity.java
New file
@@ -0,0 +1,60 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.inventory.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
/**
 * 库存申请 实体类
 *
 * @author aix
 * @since 2022-09-16
 */
@Data
@TableName("ins_invreq_record")
@ApiModel(value = "InvreqRecord对象", description = "库存申请")
@EqualsAndHashCode(callSuper = true)
public class InvreqRecordEntity extends TenantEntity {
    /**
     * 材料
     */
    @ApiModelProperty(value = "材料")
    private Long inventoryId;
    /**
     * 申请数量
     */
    @ApiModelProperty(value = "申请数量")
    private Integer reqNum;
    /**
     * 申请状态
     */
    @ApiModelProperty(value = "申请状态")
    private String state;
    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    private String remark;
}
src/main/java/org/springblade/modules/inventory/mapper/InventoryMapper.java
New file
@@ -0,0 +1,43 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.inventory.mapper;
import org.springblade.modules.inventory.entity.InventoryEntity;
import org.springblade.modules.inventory.vo.InventoryVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
 * 库存表 Mapper 接口
 *
 * @author aix
 * @since 2022-09-16
 */
public interface InventoryMapper extends BaseMapper<InventoryEntity> {
    /**
     * 自定义分页
     *
     * @param page
     * @param inventory
     * @return
     */
    List<InventoryVO> selectInventoryPage(IPage page, InventoryVO inventory);
}
src/main/java/org/springblade/modules/inventory/mapper/InventoryMapper.xml
New file
@@ -0,0 +1,28 @@
<?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="org.springblade.modules.inventory.mapper.InventoryMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="inventoryResultMap" type="org.springblade.modules.inventory.entity.InventoryEntity">
        <result column="id" property="id"/>
        <result column="name" property="name"/>
        <result column="unit" property="unit"/>
        <result column="inventory_num" property="inventoryNum"/>
        <result column="remark" property="remark"/>
        <result column="create_user" property="createUser"/>
        <result column="create_time" property="createTime"/>
        <result column="update_user" property="updateUser"/>
        <result column="update_time" property="updateTime"/>
        <result column="status" property="status"/>
        <result column="is_deleted" property="isDeleted"/>
        <result column="tenant_id" property="tenantId"/>
        <result column="create_dept" property="createDept"/>
    </resultMap>
    <select id="selectInventoryPage" resultMap="inventoryResultMap">
        select * from ins_inventory where is_deleted = 0
    </select>
</mapper>
src/main/java/org/springblade/modules/inventory/mapper/InvreqRecordMapper.java
New file
@@ -0,0 +1,43 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.inventory.mapper;
import org.springblade.modules.inventory.entity.InvreqRecordEntity;
import org.springblade.modules.inventory.vo.InvreqRecordVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
 * 库存申请 Mapper 接口
 *
 * @author aix
 * @since 2022-09-16
 */
public interface InvreqRecordMapper extends BaseMapper<InvreqRecordEntity> {
    /**
     * 自定义分页
     *
     * @param page
     * @param invreqRecord
     * @return
     */
    List<InvreqRecordVO> selectInvreqRecordPage(IPage page, InvreqRecordVO invreqRecord);
}
src/main/java/org/springblade/modules/inventory/mapper/InvreqRecordMapper.xml
New file
@@ -0,0 +1,27 @@
<?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="org.springblade.modules.inventory.mapper.InvreqRecordMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="invreqRecordResultMap" type="org.springblade.modules.inventory.entity.InvreqRecordEntity">
        <result column="id" property="id"/>
        <result column="inventory_id" property="inventoryId"/>
        <result column="req_num" property="reqNum"/>
        <result column="state" property="state"/>
        <result column="create_user" property="createUser"/>
        <result column="create_time" property="createTime"/>
        <result column="update_user" property="updateUser"/>
        <result column="update_time" property="updateTime"/>
        <result column="status" property="status"/>
        <result column="is_deleted" property="isDeleted"/>
        <result column="tenant_id" property="tenantId"/>
        <result column="create_dept" property="createDept"/>
    </resultMap>
    <select id="selectInvreqRecordPage" resultMap="invreqRecordResultMap">
        select * from ins_invreq_record where is_deleted = 0
    </select>
</mapper>
src/main/java/org/springblade/modules/inventory/service/IInventoryService.java
New file
@@ -0,0 +1,42 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.inventory.service;
import org.springblade.modules.inventory.entity.InventoryEntity;
import org.springblade.modules.inventory.vo.InventoryVO;
import org.springblade.core.mp.base.BaseService;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
 * 库存表 服务类
 *
 * @author aix
 * @since 2022-09-16
 */
public interface IInventoryService extends BaseService<InventoryEntity> {
    /**
     * 自定义分页
     *
     * @param page
     * @param inventory
     * @return
     */
    IPage<InventoryVO> selectInventoryPage(IPage<InventoryVO> page, InventoryVO inventory);
}
src/main/java/org/springblade/modules/inventory/service/IInvreqRecordService.java
New file
@@ -0,0 +1,49 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.inventory.service;
import org.springblade.modules.inventory.entity.InvreqRecordEntity;
import org.springblade.modules.inventory.vo.InvreqRecordVO;
import org.springblade.core.mp.base.BaseService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.transaction.annotation.Transactional;
import javax.validation.constraints.NotEmpty;
import java.util.List;
/**
 * 库存申请 服务类
 *
 * @author aix
 * @since 2022-09-16
 */
public interface IInvreqRecordService extends BaseService<InvreqRecordEntity> {
    /**
     * 自定义分页
     *
     * @param page
     * @param invreqRecord
     * @return
     */
    IPage<InvreqRecordVO> selectInvreqRecordPage(IPage<InvreqRecordVO> page, InvreqRecordVO invreqRecord);
    @Transactional(
        rollbackFor = {Exception.class}
    )
    boolean outboundByids(@NotEmpty List<Long> ids);
}
src/main/java/org/springblade/modules/inventory/service/impl/InventoryServiceImpl.java
New file
@@ -0,0 +1,42 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.inventory.service.impl;
import org.springblade.modules.inventory.entity.InventoryEntity;
import org.springblade.modules.inventory.vo.InventoryVO;
import org.springblade.modules.inventory.mapper.InventoryMapper;
import org.springblade.modules.inventory.service.IInventoryService;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
 * 库存表 服务实现类
 *
 * @author aix
 * @since 2022-09-16
 */
@Service
public class InventoryServiceImpl extends BaseServiceImpl<InventoryMapper, InventoryEntity> implements IInventoryService {
    @Override
    public IPage<InventoryVO> selectInventoryPage(IPage<InventoryVO> page, InventoryVO inventory) {
        return page.setRecords(baseMapper.selectInventoryPage(page, inventory));
    }
}
src/main/java/org/springblade/modules/inventory/service/impl/InvreqRecordServiceImpl.java
New file
@@ -0,0 +1,59 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.inventory.service.impl;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.modules.inventory.entity.InvreqRecordEntity;
import org.springblade.modules.inventory.vo.InvreqRecordVO;
import org.springblade.modules.inventory.mapper.InvreqRecordMapper;
import org.springblade.modules.inventory.service.IInvreqRecordService;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.ArrayList;
import java.util.List;
/**
 * 库存申请 服务实现类
 *
 * @author aix
 * @since 2022-09-16
 */
@Service
public class InvreqRecordServiceImpl extends BaseServiceImpl<InvreqRecordMapper, InvreqRecordEntity> implements IInvreqRecordService {
    @Override
    public IPage<InvreqRecordVO> selectInvreqRecordPage(IPage<InvreqRecordVO> page, InvreqRecordVO invreqRecord) {
        return page.setRecords(baseMapper.selectInvreqRecordPage(page, invreqRecord));
    }
    @Override
    public boolean outboundByids(List<Long> ids) {
        List<InvreqRecordEntity> list = new ArrayList();
        ids.forEach((id) -> {
            InvreqRecordEntity entity = getById(id);
            entity.setUpdateTime(DateUtil.now());
            entity.setId(id);
            entity.setState("1");// 已出库
            list.add(entity);
        });
        return updateBatchById(list);
    }
}
src/main/java/org/springblade/modules/inventory/vo/InventoryVO.java
New file
@@ -0,0 +1,35 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.inventory.vo;
import org.springblade.modules.inventory.entity.InventoryEntity;
import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * 库存表 视图实体类
 *
 * @author aix
 * @since 2022-09-16
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class InventoryVO extends InventoryEntity {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/inventory/vo/InvreqRecordVO.java
New file
@@ -0,0 +1,35 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.inventory.vo;
import org.springblade.modules.inventory.entity.InvreqRecordEntity;
import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * 库存申请 视图实体类
 *
 * @author aix
 * @since 2022-09-16
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class InvreqRecordVO extends InvreqRecordEntity {
    private static final long serialVersionUID = 1L;
}
src/main/java/sql/inventory.menu.sql
New file
@@ -0,0 +1,10 @@
INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
VALUES ('1570691096262303746', 1570691632042692610, 'inventory', '库存列表', 'menu', '/inventory/inventory', NULL, 1, 1, 0, 1, NULL, 0);
INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
VALUES ('1570691096262303747', '1570691096262303746', 'inventory_add', '新增', 'add', '/inventory/inventory/add', 'plus', 1, 2, 1, 1, NULL, 0);
INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
VALUES ('1570691096262303748', '1570691096262303746', 'inventory_edit', '修改', 'edit', '/inventory/inventory/edit', 'form', 2, 2, 2, 1, NULL, 0);
INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
VALUES ('1570691096262303749', '1570691096262303746', 'inventory_delete', '删除', 'delete', '/api/inventory/inventory/remove', 'delete', 3, 2, 3, 1, NULL, 0);
INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
VALUES ('1570691096262303750', '1570691096262303746', 'inventory_view', '查看', 'view', '/inventory/inventory/view', 'file-text', 4, 2, 2, 1, NULL, 0);
src/main/java/sql/invreqrecord.menu.sql
New file
@@ -0,0 +1,10 @@
INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
VALUES ('1570697986476167170', 1570691632042692610, 'invreqRecord', '库存申请', 'menu', '/inventory/invreqRecord', NULL, 1, 1, 0, 1, NULL, 0);
INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
VALUES ('1570697986476167171', '1570697986476167170', 'invreqRecord_add', '新增', 'add', '/inventory/invreqRecord/add', 'plus', 1, 2, 1, 1, NULL, 0);
INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
VALUES ('1570697986476167172', '1570697986476167170', 'invreqRecord_edit', '修改', 'edit', '/inventory/invreqRecord/edit', 'form', 2, 2, 2, 1, NULL, 0);
INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
VALUES ('1570697986476167173', '1570697986476167170', 'invreqRecord_delete', '删除', 'delete', '/api/invreqRecord/invreqRecord/remove', 'delete', 3, 2, 3, 1, NULL, 0);
INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
VALUES ('1570697986476167174', '1570697986476167170', 'invreqRecord_view', '查看', 'view', '/inventory/invreqRecord/view', 'file-text', 4, 2, 2, 1, NULL, 0);