lishenao
16 小时以前 5c1a58d067512df6099f9cc95f577c9991128163
入库管理,出库管理,库存管理后端接口
已修改18个文件
已添加6个文件
1451 ■■■■■ 文件已修改
src/main/java/com/ruoyi/inventory/controller/StockInController.java 74 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/controller/StockManagementController.java 64 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/controller/StockOutController.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/dto/StockManagementDto.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/dto/StockinDto.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/dto/StockoutDto.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/excel/StockInExcelDto.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/excel/StockManagementExcelDto.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/excel/StockOutExcelDto.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/mapper/StockInMapper.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/mapper/StockManagementMapper.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/mapper/StockOutMapper.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/pojo/StockIn.java 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/pojo/StockManagement.java 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/pojo/StockOut.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/service/StockInService.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/service/StockManagementService.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/service/StockOutService.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/service/impl/StockInServiceImpl.java 117 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/service/impl/StockManagementServiceImpl.java 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/service/impl/StockOutServiceImpl.java 79 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/inventory/StockInMapper.xml 220 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/inventory/StockManagementMapper.xml 149 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/inventory/StockOutMapper.xml 168 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/controller/StockInController.java
@@ -1,64 +1,66 @@
package com.ruoyi.inventory.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.basic.pojo.Customer;
import com.ruoyi.basic.pojo.SupplierManage;
import com.ruoyi.common.utils.poi.ExcelUtil;
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.inventory.dto.StockinDto;
import com.ruoyi.inventory.excel.StockInExcelDto;
import com.ruoyi.inventory.service.StockInService;
import com.ruoyi.inventory.pojo.StockIn;
import com.ruoyi.purchase.dto.PurchaseLedgerDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;
@RestController
@RequestMapping("/stockin")
public class StockInController extends BaseController {
public class StockInController{
    @Autowired
    private StockInService stockInService;
    @PostMapping("/add")// æ–°å¢žå…¥åº“记录
    public AjaxResult addStockIn(@RequestBody StockIn stockIn) {
        int i = stockInService.addStockIn(stockIn);
        if(i>0){
            return success();
        }
        return error();
    @GetMapping("/listPage")
    public AjaxResult listPage(Page page, StockinDto stockinDto) {
        return AjaxResult.success(stockInService.selectStockInPage(page,stockinDto));
    }
    @GetMapping("/list")// åˆ—出所有入库记录
    public AjaxResult listStockIns() {
        List<StockIn> stockIns = stockInService.listStockIns();
        return success(stockIns);
    @PostMapping("/add")
    public AjaxResult add(@RequestBody StockIn stockIn) {
        stockInService.saveStockin(stockIn);
        return AjaxResult.success();
    }
    @GetMapping("/{id}")// æ ¹æ®ID获取入库记录
    public AjaxResult getStockInById(@PathVariable Long id) {
        StockIn stockIn = stockInService.getStockInById(id);
        return success(stockIn);
        return AjaxResult.success(stockIn);
    }
    @PutMapping("/update")// æ›´æ–°å…¥åº“记录
    public AjaxResult updateStockIn(@RequestBody StockIn stockIn) {
        int i = stockInService.updateStockIn(stockIn);
        if(i>0){
            return success();
        }
        return error();
    }
    @DeleteMapping("/delete/{id}")// åˆ é™¤å…¥åº“记录
    public AjaxResult deleteStockIn(@PathVariable Long id) {
        int i = stockInService.deleteStockIn(id);
        if(i>0){
            return success();
        }
        return error();
    }
//    @Log(title = "岗位管理", businessType = BusinessType.EXPORT)
//    @PreAuthorize("@ss.hasPermi('system:post:export')")
    @GetMapping("/export")// å¯¼å‡ºå…¥åº“数据
    public AjaxResult exportStockInData() {
        List<StockIn> stockIns = stockInService.listStockIns();
        ExcelUtil<StockIn> util = new ExcelUtil<StockIn>(StockIn.class);
        util.exportExcel(stockIns, "库存入库信息");
        return success();
        stockInService.updateStockIn(stockIn);
        return AjaxResult.success();
    }
    @DeleteMapping("/del")
    public AjaxResult delStockin(@RequestBody List<Integer> ids) {
        if(CollectionUtils.isEmpty(ids)){
            return AjaxResult.error("请选择至少一条数据");
        }
        stockInService.delStockin(ids);
        return AjaxResult.success();
    }
//导出
    @Log(title = "入库档案", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, StockinDto stockinDto) {
        stockInService.stockinExport(response, stockinDto);
    }
}
src/main/java/com/ruoyi/inventory/controller/StockManagementController.java
@@ -1,11 +1,17 @@
package com.ruoyi.inventory.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.basic.dto.SupplierManageDto;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.inventory.dto.StockManagementDto;
import com.ruoyi.inventory.dto.StockoutDto;
import com.ruoyi.inventory.pojo.StockManagement;
import com.ruoyi.inventory.service.StockManagementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import static com.ruoyi.framework.web.domain.AjaxResult.error;
@@ -16,39 +22,29 @@
public class StockManagementController {
    @Autowired
    private StockManagementService stockManagementService;
    @RequestMapping("/list")// åˆ—出所有出库记录
    public AjaxResult listStockOuts() {
        List<StockManagement> stockManagements = stockManagementService.getStockManagements();
        return success(stockManagements);
    }
    @GetMapping("/{id}")// æ ¹æ®ID获取出库记录
    public AjaxResult getStockOutById(@PathVariable Long id) {
        StockManagement stockManagement = stockManagementService.getStockManagementById(id);
        return success(stockManagement);
    }
    @PostMapping("add")// æ–°å¢žå‡ºåº“记录
    public AjaxResult addStockOut(@RequestBody StockManagement stockManagement) {
        int i = stockManagementService.addStockManagement(stockManagement);
        if(i>0){
            return success();
        }
        return error();
    }
    @PutMapping("/update")// æ›´æ–°å‡ºåº“记录
    public AjaxResult updateStockOut(@RequestBody StockManagement stockManagement) {
        int i = stockManagementService.updateStockManagement(stockManagement);
        if(i>0){
            return success();
        }
        return error();
    }
    @DeleteMapping("/delete/{id}")// åˆ é™¤å‡ºåº“记录
    public AjaxResult deleteStockOut(@PathVariable Long id) {
        int i = stockManagementService.deleteStockManagement(id);
        if(i>0){
            return success();
        }
        return error();
    }
//    æ›´æ–°åº“å­˜
    @PutMapping("/update")
    public AjaxResult updateStockManagement(@RequestBody StockManagement stockManagement) {
        stockManagementService.updateStockManagement(stockManagement);
        return AjaxResult.success();
    }
    @DeleteMapping("/del")
    public AjaxResult delStockManage(@RequestBody List<Integer> ids) {
        if(CollectionUtils.isEmpty(ids)){
            return AjaxResult.error("请选择至少一条数据");
        }
        stockManagementService.delStockManage(ids);
        return AjaxResult.success();
    }
//    åˆ†é¡µæŸ¥è¯¢
    @GetMapping("/page")
    public AjaxResult getStockManagementPage(Page page, StockManagementDto stockManagementdto) {
        return success(stockManagementService.selectStockManagePage(page, stockManagementdto));
    }
//    å¯¼å‡º
    @PostMapping("/export")
    public void stockmanageExport(HttpServletResponse response, StockManagementDto stockManagementDto) {
        stockManagementService.stockManageExport(response, stockManagementDto);
    }
}
src/main/java/com/ruoyi/inventory/controller/StockOutController.java
@@ -1,13 +1,20 @@
package com.ruoyi.inventory.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.inventory.dto.StockManagementDto;
import com.ruoyi.inventory.dto.StockoutDto;
import com.ruoyi.inventory.mapper.StockManagementMapper;
import com.ruoyi.inventory.pojo.StockIn;
import com.ruoyi.inventory.pojo.StockOut;
import com.ruoyi.inventory.service.StockOutService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@@ -19,38 +26,38 @@
    @Autowired
    private StockManagementMapper stockManagementMapper;
    @RequestMapping("/add")
    public AjaxResult addStockOut(StockOut stockOut) {
        int i = stockOutService.addStockOut(stockOut);
        if(i>0){
            return success();
        }
        return error();
    @PostMapping("/add")
    public AjaxResult add(@RequestBody StockOut stockout) {
        stockOutService.saveStockout(stockout);
        return AjaxResult.success();
    }
    @RequestMapping("/list")
    public AjaxResult listStockOuts() {
        List<StockOut> stockOuts = stockOutService.getStockOuts();
        return success(stockOuts);
    }
    @RequestMapping("/{id}")
    public AjaxResult getStockOutById(@PathVariable Long id) {
        StockOut stockOut = stockOutService.getStockOutById(id);
        return success(stockOut);
        return success(stockOutService.getStockOutById(id));
    }
    @RequestMapping("/update")
    public AjaxResult updateStockOut(@RequestBody StockOut stockOut) {
        int i = stockOutService.updateStockOut(stockOut);
        if(i>0){
            return success();
        }
        return error();
    @PutMapping("/update")// æ›´æ–°å…¥åº“记录
    public AjaxResult updateStockout(@RequestBody StockOut stockOut) {
        stockOutService.updateStockOut(stockOut);
        return AjaxResult.success();
    }
    @RequestMapping("/delete/{id}")
    public AjaxResult deleteStockOut(Long id) {
        int i = stockOutService.deleteStockOut(id);
        if(i>0){
            return success();
    @RequestMapping("/page")
    public AjaxResult getStockOutPage(Page page, StockoutDto stockOutdto) {
        IPage<StockoutDto> stockOutPage = stockOutService.selectStockOutPage(page, stockOutdto);
        return success(stockOutPage);
    }
//    å¯¼å‡º
    @PostMapping("/export")
    public void stockoutExport(HttpServletResponse response, StockoutDto stockoutDto) {
        stockOutService.stockoutExport(response, stockoutDto);
    }
    @DeleteMapping("/del")
    public AjaxResult delStockOut(@RequestBody List<Integer> ids) {
        if(CollectionUtils.isEmpty(ids)){
            return AjaxResult.error("请选择至少一条数据");
        }
        return error();
        stockOutService.delStockOut(ids);
        return AjaxResult.success();
    }
}
src/main/java/com/ruoyi/inventory/dto/StockManagementDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,36 @@
package com.ruoyi.inventory.dto;
import com.ruoyi.inventory.pojo.StockManagement;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class StockManagementDto extends StockManagement {
    private String supplierName;
    private String productCategory;
    private String unit;
    /**
     * å«ç¨Žå•ä»·
     */
    private BigDecimal taxInclusiveUnitPrice;
    /**
     * å«ç¨Žæ€»ä»·
     */
    private BigDecimal taxInclusiveTotalPrice;
    /**
     * ç¨Žçއ
     */
    private BigDecimal taxRate;
    /**
     * ä¸å«ç¨Žæ€»ä»·
     */
    private BigDecimal taxExclusiveTotalPrice;
    /**
     * è§„格型号
     */
    private String specificationModel;
}
src/main/java/com/ruoyi/inventory/dto/StockinDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,52 @@
package com.ruoyi.inventory.dto;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.inventory.pojo.StockIn;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class StockinDto extends StockIn{
    @ApiModelProperty(value = "产品大类")
    private String productCategory;
    /**
     * è§„格型号
     */
    @ApiModelProperty(value = "规格型号")
    private String specificationModel;
    @ApiModelProperty(value = "单位")
    private String unit;
    /**
     * å«ç¨Žå•ä»·
     */
    private BigDecimal taxInclusiveUnitPrice;
    /**
     * å«ç¨Žæ€»ä»·
     */
    private BigDecimal taxInclusiveTotalPrice;
    /**
     * ç¨Žçއ
     */
    private BigDecimal taxRate;
    /**
     * ä¸å«ç¨Žæ€»ä»·
     */
    private BigDecimal taxExclusiveTotalPrice;
    @ApiModelProperty(value = "供应商名称")
    private String supplierName;
    @TableField(exist = false)
    private Date startTime;
    @TableField(exist = false)
    private Date endTime;
}
src/main/java/com/ruoyi/inventory/dto/StockoutDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,38 @@
package com.ruoyi.inventory.dto;
import com.ruoyi.inventory.pojo.StockOut;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class StockoutDto extends StockOut {
    private String supplierName;
    private String unit;
    private String productCategory;
    /**
     * å«ç¨Žå•ä»·
     */
    private BigDecimal taxInclusiveUnitPrice;
    /**
     * å«ç¨Žæ€»ä»·
     */
    private BigDecimal taxInclusiveTotalPrice;
    /**
     * ç¨Žçއ
     */
    private BigDecimal taxRate;
    /**
     * ä¸å«ç¨Žæ€»ä»·
     */
    private BigDecimal taxExclusiveTotalPrice;
    /**
     * è§„格型号
     */
    private String specificationModel;
}
src/main/java/com/ruoyi/inventory/excel/StockInExcelDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,35 @@
package com.ruoyi.inventory.excel;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class StockInExcelDto {
    @Excel(name = "入库时间")
    private String inboundTime;
    @Excel(name = "入库批次")
    private String inboundBatch;
    @Excel(name = "供应商名称")
    private String supplierName;
    @Excel(name = "产品大类")
    private String productCategory;
    @Excel(name = "规格型号")
    private String specificationModel;
    @Excel(name = "单位")
    private String unit;
    @Excel(name = "入库数量")
    private Integer inboundQuantity;
    @Excel(name = "含税单价")
    private BigDecimal taxInclusiveUnitPrice;
    @Excel(name = "含税总价")
    private BigDecimal taxInclusiveTotal;
    @Excel(name = "不含税总价")
    private BigDecimal taxExclusiveTotal;
    @Excel(name = "税率")
    private BigDecimal taxRate;
    @Excel(name = "入库人")
    private String inboundPerson;
}
src/main/java/com/ruoyi/inventory/excel/StockManagementExcelDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,39 @@
package com.ruoyi.inventory.excel;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class StockManagementExcelDto {
    @Excel(name = "库存日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date boundTime;
    @Excel(name = "入库时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date inboundTime;
    @Excel(name = "供应商名称")
    private String supplierName;
    @Excel(name = "产品大类")
    private String productCategory;
    @Excel(name = "规格型号")
    private String specificationModel;
    @Excel(name = "单位")
    private String unit;
    @Excel(name = "库存数量")
    private Integer stockQuantity;
    @Excel(name = "含税单价")
    private BigDecimal taxInclusiveUnitPrice;
    @Excel(name = "含税总价")
    private BigDecimal taxInclusiveTotal;
    @Excel(name = "不含税总价")
    private BigDecimal taxExclusiveTotal;
    @Excel(name = "税率")
    private BigDecimal taxRate;
    @Excel(name = "入库人")
    private String inboundPerson;
}
src/main/java/com/ruoyi/inventory/excel/StockOutExcelDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,33 @@
package com.ruoyi.inventory.excel;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class StockOutExcelDto {
    @Excel(name = "出库时间")
    private String inboundTime;
    @Excel(name = "出库批次")
    private String inboundBatch;
    @Excel(name = "产品大类")
    private String productCategory;
    @Excel(name = "规格型号")
    private String specificationModel;
    @Excel(name = "单位")
    private String unit;
    @Excel(name = "出库数量")
    private Integer inboundQuantity;
    @Excel(name = "含税单价")
    private BigDecimal taxInclusiveUnitPrice;
    @Excel(name = "含税总价")
    private BigDecimal taxInclusiveTotal;
    @Excel(name = "不含税总价")
    private BigDecimal taxExclusiveTotal;
    @Excel(name = "税率")
    private BigDecimal taxRate;
    @Excel(name = "出库人")
    private String outboundPerson;
}
src/main/java/com/ruoyi/inventory/mapper/StockInMapper.java
@@ -1,7 +1,16 @@
package com.ruoyi.inventory.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.basic.excel.SupplierManageExcelDto;
import com.ruoyi.inventory.dto.StockinDto;
import com.ruoyi.inventory.excel.StockInExcelDto;
import com.ruoyi.inventory.pojo.StockIn;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
@@ -10,16 +19,10 @@
* @createDate 2025-06-23 18:11:59
* @Entity inventory.domain.StockIn
*/
public interface StockInMapper {
@Mapper
public interface StockInMapper extends BaseMapper<StockIn> {
    int deleteByPrimaryKey(Long id);
    int insertSelective(StockIn record);
    StockIn selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(StockIn record);
    List<StockIn> selectList();
    IPage<StockIn> selectStockInWithProductInfo(Page page, @Param("stockinDto") StockinDto stockinDto);
    List<StockInExcelDto> stockinExportList(@Param("stockinDto") StockinDto stockinDto);
}
src/main/java/com/ruoyi/inventory/mapper/StockManagementMapper.java
@@ -1,8 +1,19 @@
package com.ruoyi.inventory.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.basic.dto.SupplierManageDto;
import com.ruoyi.basic.excel.SupplierManageExcelDto;
import com.ruoyi.inventory.dto.StockManagementDto;
import com.ruoyi.inventory.dto.StockinDto;
import com.ruoyi.inventory.excel.StockManagementExcelDto;
import com.ruoyi.inventory.pojo.StockManagement;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
@@ -11,15 +22,10 @@
* @createDate 2025-06-23 18:11:59
* @Entity inventory.domain.StockManagement
*/
public interface StockManagementMapper {
    List<StockManagement> selectAll();
    int deleteByPrimaryKey(Long id);
@Mapper
public interface StockManagementMapper extends BaseMapper<StockManagement> {
    int insertSelective(StockManagement record);
    StockManagement selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(StockManagement record);
    IPage<StockManagement> selectStockManagementBypage(Page page, @Param("stockManagementDto") StockManagementDto stockManagementDto);
    List<StockManagementExcelDto> stockManageExportList(@Param("stockManagementDto") StockManagementDto stockManagementDto);
}
src/main/java/com/ruoyi/inventory/mapper/StockOutMapper.java
@@ -1,7 +1,16 @@
package com.ruoyi.inventory.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.basic.dto.SupplierManageDto;
import com.ruoyi.basic.excel.SupplierManageExcelDto;
import com.ruoyi.inventory.dto.StockoutDto;
import com.ruoyi.inventory.excel.StockOutExcelDto;
import com.ruoyi.inventory.pojo.StockOut;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -11,16 +20,11 @@
* @createDate 2025-06-23 18:11:59
* @Entity inventory.domain.StockOut
*/
public interface StockOutMapper {
@Mapper
public interface StockOutMapper extends BaseMapper<StockOut> {
    int deleteByPrimaryKey(Long id);
    List<StockOut> selectAll();
    int insertSelective(StockOut record);
    StockOut selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(StockOut record);
    IPage<StockoutDto> selectStockOutBypage(Page page,@Param("stockOutdto") StockoutDto stockOutdto);
    List<StockOutExcelDto> stockoutExportList(@Param("stockOutdto") StockoutDto stockOutdto);
}
src/main/java/com/ruoyi/inventory/pojo/StockIn.java
@@ -1,31 +1,36 @@
package com.ruoyi.inventory.pojo;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
 * 
 * @TableName stock_in
 */
@Data
public class StockIn implements Serializable {
@TableName("stock_in")
public class StockIn{
    /**
     * å…¥åº“记录ID
     */
    @TableId(type = IdType.AUTO)
    private Integer id;
    /**
     * äº§å“id
     */
    private Integer productId;
    private Long productId;
    /**
     * å…¥åº“æ—¶é—´
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date inboundTime;
    /**
@@ -34,40 +39,30 @@
    private String inboundBatch;
    /**
     * ä¾›åº”商名称
     * ä¾›åº”商id
     */
    private String supplierName;
    private Long supplierId;
    /**
     * å…¥åº“数量
     */
    private Integer inboundQuantity;
    /**
     * å«ç¨Žå•ä»·
     */
    private BigDecimal taxInclusivePrice;
    /**
     * å«ç¨Žæ€»ä»·
     */
    private BigDecimal taxInclusiveTotal;
    /**
     * ç¨Žçއ
     */
    private BigDecimal taxRate;
    /**
     * ä¸å«ç¨Žæ€»ä»·
     */
    private BigDecimal taxExclusiveTotal;
    /**
     * å…¥åº“人
     */
    private String inboundPerson;
//    tenant_id
    /**
     * ç§Ÿæˆ·ID
     */
    @ApiModelProperty(value = "租户ID")
    @TableField(fill = FieldFill.INSERT)
    private Long tenantId;
    private static final long serialVersionUID = 1L;
    private List<StockProduct> stockProducts;
//    private List<StockProduct> stockProducts;
}
src/main/java/com/ruoyi/inventory/pojo/StockManagement.java
@@ -2,6 +2,12 @@
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
/**
@@ -9,7 +15,8 @@
 * @TableName stock_management
 */
@Data
public class StockManagement implements Serializable {
@TableName("stock_management")
public class StockManagement{
    /**
     * åº“存记录ID
     */
@@ -18,37 +25,27 @@
    /**
     * äº§å“id
     */
    private Integer productId;
    private Long productId;
    /**
     * å½“前库存量
     */
    private Integer stockQuantity;
    /**
     * å«ç¨Žå•ä»·
     */
    private BigDecimal taxInclusivePrice;
    /**
     * å«ç¨Žæ€»ä»·
     */
    private BigDecimal taxInclusiveTotal;
    private Long supplierId;
    /**
     * ç¨Žçއ
     */
    private BigDecimal taxRate;
    /**
     * ä¸å«ç¨Žæ€»ä»·
     */
    private BigDecimal taxExclusiveTotal;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date boundTime;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date inboundTime;
    /**
     * å…¥åº“人
     */
    private String inboundPerson;
    @TableField(fill = FieldFill.INSERT)
    private Long tenantId;
    private static final long serialVersionUID = 1L;
}
src/main/java/com/ruoyi/inventory/pojo/StockOut.java
@@ -3,6 +3,10 @@
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
/**
@@ -10,6 +14,7 @@
 * @TableName stock_out
 */
@Data
@TableName("stock_out")
public class StockOut implements Serializable {
    /**
     * å‡ºåº“记录ID
@@ -19,7 +24,7 @@
    /**
     * äº§å“id
     */
    private Integer productId;
    private Long productId;
    /**
     * å‡ºåº“æ—¶é—´
@@ -34,37 +39,21 @@
    /**
     * ä¾›åº”商名称
     */
    private String supplierName;
    private Long supplierId;
    /**
     * å…¥åº“数量
     */
    private Integer inboundQuantity;
    /**
     * å«ç¨Žå•ä»·
     */
    private BigDecimal taxInclusivePrice;
    /**
     * å«ç¨Žæ€»ä»·
     */
    private BigDecimal taxInclusiveTotal;
    /**
     * ç¨Žçއ
     */
    private BigDecimal taxRate;
    /**
     * ä¸å«ç¨Žæ€»ä»·
     */
    private BigDecimal taxExclusiveTotal;
    /**
     * å‡ºåº“人
     */
    private String inboundPerson;
    @TableField(fill = FieldFill.INSERT)
    private Long tenantId;
    private static final long serialVersionUID = 1L;
}
src/main/java/com/ruoyi/inventory/service/StockInService.java
@@ -1,21 +1,28 @@
package com.ruoyi.inventory.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.inventory.dto.StockinDto;
import com.ruoyi.inventory.pojo.StockIn;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;
public interface StockInService {
    int addStockIn(StockIn stockIn);
    List<StockIn> listStockIns();
public interface StockInService extends IService<StockIn> {
    void saveStockin(StockIn stockIn);
    StockIn getStockInById(Long id);
    int updateStockIn(StockIn stockIn);
    int deleteStockIn(Long id);
    int delStockin(List<Integer> ids);
//    PageInfo<StockinProcuct> getStockInPage(Integer pageNum, Integer pageSize, StockInQueryDTO query);
    IPage<StockIn> selectStockInPage(Page page, StockinDto stockinDto);
    void stockinExport(HttpServletResponse response, StockinDto stockinDto);
}
src/main/java/com/ruoyi/inventory/service/StockManagementService.java
@@ -1,14 +1,22 @@
package com.ruoyi.inventory.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.basic.dto.SupplierManageDto;
import com.ruoyi.inventory.dto.StockManagementDto;
import com.ruoyi.inventory.dto.StockinDto;
import com.ruoyi.inventory.pojo.StockManagement;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
public interface StockManagementService {
    List<StockManagement> getStockManagements();
    StockManagement getStockManagementById(Long id);
    int addStockManagement(StockManagement stockManagement);
public interface StockManagementService extends IService<StockManagement> {
    int updateStockManagement(StockManagement stockManagement);
    int deleteStockManagement(Long id);
    int delStockManage(List<Integer> ids);
    IPage<StockManagement> selectStockManagePage(Page page, StockManagementDto stockManagementdto);
    void stockManageExport(HttpServletResponse response, StockManagementDto stockManagementdto);
}
src/main/java/com/ruoyi/inventory/service/StockOutService.java
@@ -1,13 +1,23 @@
package com.ruoyi.inventory.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.basic.dto.SupplierManageDto;
import com.ruoyi.inventory.dto.StockinDto;
import com.ruoyi.inventory.dto.StockoutDto;
import com.ruoyi.inventory.pojo.StockIn;
import com.ruoyi.inventory.pojo.StockOut;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
public interface StockOutService {
    List<StockOut> getStockOuts();
    int delStockOut(List<Integer> ids);
    StockOut getStockOutById(Long id);
    int addStockOut(StockOut stockOut);
    void saveStockout(StockOut stockout);
    int updateStockOut(StockOut stockOut);
    int deleteStockOut(Long id);
    IPage<StockoutDto> selectStockOutPage(Page page, StockoutDto stockoutDto);
    void stockoutExport(HttpServletResponse response, StockoutDto stockoutDto);
}
src/main/java/com/ruoyi/inventory/service/impl/StockInServiceImpl.java
@@ -1,45 +1,128 @@
package com.ruoyi.inventory.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.inventory.dto.StockinDto;
import com.ruoyi.inventory.excel.StockInExcelDto;
import com.ruoyi.inventory.mapper.StockManagementMapper;
import com.ruoyi.inventory.pojo.StockIn;
import com.ruoyi.inventory.mapper.StockInMapper;
import com.ruoyi.inventory.pojo.StockManagement;
import com.ruoyi.inventory.service.StockInService;
import com.ruoyi.purchase.dto.PurchaseLedgerDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@Service
public class StockInServiceImpl implements StockInService {
public class StockInServiceImpl extends ServiceImpl<StockInMapper,StockIn> implements StockInService {
    @Autowired
    private StockInMapper stockInMapper;
    @Autowired
    private StockManagementMapper stockManagementMapper;
    @Override//添加库存入库信息
    public int addStockIn(StockIn stockIn) {
        int i = stockInMapper.insertSelective(stockIn);
        return i;
//    æ–°å¢žæ–¹æ³•
    /**
     * æ–°å¢žåº“存入库信息
     * @param stockIn
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void saveStockin(StockIn stockIn) {
        stockInMapper.insert(stockIn);
        StockManagement stockManagement = new StockManagement();
//        è¿›è¡Œåˆ¤æ–­æ˜¯å¦å­˜åœ¨ç›¸åŒçš„产品id和供应商id
        LambdaQueryWrapper<StockManagement> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(StockManagement::getProductId, stockIn.getProductId());
        queryWrapper.eq(StockManagement::getSupplierId, stockIn.getSupplierId());
        StockManagement stockManagement1 = stockManagementMapper.selectOne(queryWrapper);
        if (stockManagement1!= null) {
            stockManagement1.setStockQuantity(stockManagement1.getStockQuantity() + stockIn.getInboundQuantity());
            stockManagement1.setInboundTime(stockIn.getInboundTime());
            stockManagement1.setBoundTime(new Date());
            stockManagement1.setInboundPerson(stockIn.getInboundPerson());
            System.out.println(stockManagement1+"22");
            stockManagementMapper.updateById(stockManagement1);
        }
    @Override//列出所有库存入库信息
    public List<StockIn> listStockIns() {
        List<StockIn> stockIns = stockInMapper.selectList();
        return stockIns;
        else {
            stockManagement.setProductId(stockIn.getProductId());
            stockManagement.setStockQuantity(stockIn.getInboundQuantity());
            stockManagement.setBoundTime(stockIn.getInboundTime());
            stockManagement.setStockQuantity(stockIn.getInboundQuantity());
            stockManagement.setInboundPerson(stockIn.getInboundPerson());
            stockManagement.setSupplierId(stockIn.getSupplierId());
            stockManagement.setTenantId(stockIn.getTenantId());
            stockManagement.setBoundTime(new Date());
            stockManagementMapper.insert(stockManagement);
        }
    }
    @Override//根据id获取库存入库信息
    public StockIn getStockInById(Long id) {
        StockIn stockIn = stockInMapper.selectByPrimaryKey(id);
        StockIn stockIn = stockInMapper.selectById(id);
        return stockIn;
    }
    @Override//更新库存入库信息
    @Transactional(rollbackFor = Exception.class)
    public int updateStockIn(StockIn stockIn) {
        int i = stockInMapper.updateByPrimaryKeySelective(stockIn);
        return i;
        StockIn stockIn1 = stockInMapper.selectById(stockIn.getId());
//        è¿›è¡Œåˆ¤æ–­æ˜¯å¦å­˜åœ¨ç›¸åŒçš„产品id和供应商id
        LambdaQueryWrapper<StockManagement> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(StockManagement::getProductId, stockIn.getProductId());
        queryWrapper.eq(StockManagement::getSupplierId, stockIn.getSupplierId());
        StockManagement stockManagement1 = stockManagementMapper.selectOne(queryWrapper);
        if (stockManagement1!= null) {
            stockManagement1.setStockQuantity(stockManagement1.getStockQuantity() - stockIn1.getInboundQuantity() + stockIn.getInboundQuantity());
            stockManagement1.setInboundTime(stockIn.getInboundTime());
            stockManagement1.setBoundTime(new Date());
            stockManagement1.setInboundPerson(stockIn.getInboundPerson());
            System.out.println(stockManagement1 + "22");
            stockManagementMapper.updateById(stockManagement1);
        }        else {
            StockManagement stockManagement = new StockManagement();
            stockManagement.setProductId(stockIn.getProductId());
            stockManagement.setStockQuantity(stockIn.getInboundQuantity());
            stockManagement.setBoundTime(stockIn.getInboundTime());
            stockManagement.setStockQuantity(stockIn.getInboundQuantity());
            stockManagement.setInboundPerson(stockIn.getInboundPerson());
            stockManagement.setSupplierId(stockIn.getSupplierId());
            stockManagement.setTenantId(stockIn.getTenantId());
            stockManagement.setBoundTime(new Date());
            System.out.println(stockManagement + "33");
            stockManagementMapper.insert(stockManagement);
        }
        return stockInMapper.updateById(stockIn);
    }
    @Override//删除库存入库信息
    public int deleteStockIn(Long id) {
        int i = stockInMapper.deleteByPrimaryKey(id);
        return i;
    @Override
    public int delStockin(List<Integer> ids) {
        LambdaQueryWrapper<StockIn> delWrapper = new LambdaQueryWrapper<>();
        delWrapper.in(StockIn::getId, ids);
        return stockInMapper.delete(delWrapper);
    }
    @Override
    public IPage<StockIn> selectStockInPage(Page page, StockinDto stockinDto) {
        System.out.println(stockinDto);
        IPage<StockIn> stockinDtoIPage = stockInMapper.selectStockInWithProductInfo(page, stockinDto);
        System.out.println(stockinDtoIPage.getRecords());
        return stockInMapper.selectStockInWithProductInfo(page, stockinDto);
    }
    @Override
    public void stockinExport(HttpServletResponse response, StockinDto stockinDto) {
        List<StockInExcelDto> stockInExcelDtoList = stockInMapper.stockinExportList(stockinDto);
        ExcelUtil<StockInExcelDto> util = new ExcelUtil<StockInExcelDto>(StockInExcelDto.class);
        util.exportExcel(response, stockInExcelDtoList, "供应商导出");
    }
}
src/main/java/com/ruoyi/inventory/service/impl/StockManagementServiceImpl.java
@@ -1,45 +1,46 @@
package com.ruoyi.inventory.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.basic.excel.SupplierManageExcelDto;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.inventory.dto.StockManagementDto;
import com.ruoyi.inventory.excel.StockManagementExcelDto;
import com.ruoyi.inventory.mapper.StockManagementMapper;
import com.ruoyi.inventory.pojo.StockManagement;
import com.ruoyi.inventory.service.StockManagementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@Service
public class StockManagementServiceImpl implements StockManagementService {
public class StockManagementServiceImpl extends ServiceImpl<StockManagementMapper,StockManagement> implements StockManagementService {
    @Autowired
    private StockManagementMapper stockManagementMapper;
    @Override
    public List<StockManagement> getStockManagements() {
        List<StockManagement> stockManagements = stockManagementMapper.selectAll();
        return stockManagements;
    }
    @Override
    public StockManagement getStockManagementById(Long id) {
        StockManagement stockManagement = stockManagementMapper.selectByPrimaryKey(id);
        return stockManagement;
    }
    @Override
    public int addStockManagement(StockManagement stockManagement) {
        int i = stockManagementMapper.insertSelective(stockManagement);
        return i;
    }
    @Override
    public int updateStockManagement(StockManagement stockManagement) {
        int i = stockManagementMapper.updateByPrimaryKeySelective(stockManagement);
        return i;
        return stockManagementMapper.updateById(stockManagement);
    }
    @Override
    public int deleteStockManagement(Long id) {
        int i = stockManagementMapper.deleteByPrimaryKey(id);
        return i;
    public int delStockManage(List<Integer> ids) {
        return stockManagementMapper.deleteBatchIds(ids);
    }
    @Override
    public IPage<StockManagement> selectStockManagePage(Page page, StockManagementDto stockManagementdto) {
        return stockManagementMapper.selectStockManagementBypage(page, stockManagementdto);
    }
    @Override
    public void stockManageExport(HttpServletResponse response, StockManagementDto stockManagementdto) {
        List<StockManagementExcelDto> stockManageList = stockManagementMapper.stockManageExportList(stockManagementdto);
        ExcelUtil<StockManagementExcelDto> util = new ExcelUtil<StockManagementExcelDto>(StockManagementExcelDto.class);
        util.exportExcel(response, stockManageList, "库存导出");
    }
}
src/main/java/com/ruoyi/inventory/service/impl/StockOutServiceImpl.java
@@ -1,46 +1,101 @@
package com.ruoyi.inventory.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.ruoyi.basic.excel.SupplierManageExcelDto;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.inventory.dto.StockoutDto;
import com.ruoyi.inventory.excel.StockOutExcelDto;
import com.ruoyi.inventory.mapper.StockManagementMapper;
import com.ruoyi.inventory.mapper.StockOutMapper;
import com.ruoyi.inventory.pojo.StockManagement;
import com.ruoyi.inventory.pojo.StockOut;
import com.ruoyi.inventory.service.StockOutService;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;
@Service
public class StockOutServiceImpl implements StockOutService {
    @Autowired
    private StockOutMapper stockOutMapper;
    @Autowired
    private StockManagementMapper stockManagementMapper;
    @Override
    public List<StockOut> getStockOuts() {
        List<StockOut> stockOuts = stockOutMapper.selectAll();
        return stockOuts;
    public int delStockOut(List<Integer> ids) {
        return stockOutMapper.deleteBatchIds(ids);
    }
    @Override
    public StockOut getStockOutById(Long id) {
        StockOut stockOut = stockOutMapper.selectByPrimaryKey(id);
        StockOut stockOut = stockOutMapper.selectById(id);
        return stockOut;
    }
    @Override
    public int addStockOut(StockOut stockOut) {
        int i = stockOutMapper.insertSelective(stockOut);
        return i;
    @Transactional(rollbackFor = Exception.class)
    public void saveStockout(StockOut stockOut) {
//    è¿›è¡Œåˆ¤æ–­æ˜¯å¦å­˜åœ¨ç›¸åŒçš„产品id和供应商id
        LambdaQueryWrapper<StockManagement> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(StockManagement::getProductId, stockOut.getProductId());
        queryWrapper.eq(StockManagement::getSupplierId, stockOut.getSupplierId());
        StockManagement stockManagement1 = stockManagementMapper.selectOne(queryWrapper);
        if (stockManagement1!= null) {
//            åˆ¤æ–­åº“存数量是否大于出库数量
            if (stockManagement1.getStockQuantity() < stockOut.getInboundQuantity()) {
                throw new RuntimeException("库存数量不足");
            }
            stockOutMapper.insert(stockOut);
            stockManagement1.setStockQuantity(stockManagement1.getStockQuantity() - stockOut.getInboundQuantity());
            stockManagement1.setInboundTime(new Date());
            stockManagementMapper.updateById(stockManagement1);
        }
        else {
            throw new RuntimeException("库存不存在");
        }
    }
    @Override
    public int updateStockOut(StockOut stockOut) {
        int i = stockOutMapper.updateByPrimaryKeySelective(stockOut);
        return i;
//        éœ€è¦è¿›è¡Œåˆ¤æ–­åœ¨åº“存中是否存在该产品,如果存在,就进行修改,否则就抛出异常
        StockOut stockOut1 = stockOutMapper.selectById(stockOut.getId());
            LambdaQueryWrapper<StockManagement> queryWrapper = new LambdaQueryWrapper<>();
            queryWrapper.eq(StockManagement::getProductId, stockOut.getProductId());
            StockManagement stockManagement1 = stockManagementMapper.selectOne(queryWrapper);
            if (stockManagement1!= null) {
//                åˆ¤æ–­åº“存数量是否大于出库数量
                if (stockManagement1.getStockQuantity()+stockOut1.getInboundQuantity() < stockOut.getInboundQuantity()) {
                    throw new RuntimeException("库存数量不足");
                }
                stockManagement1.setStockQuantity(stockManagement1.getStockQuantity() + stockOut1.getInboundQuantity() - stockOut.getInboundQuantity());
                stockManagement1.setInboundTime(stockOut.getInboundTime());
                stockManagement1.setBoundTime(new Date());
                System.out.println(stockManagement1 + "22");
                stockManagementMapper.updateById(stockManagement1);
            } else {
                throw new RuntimeException("库存不存在");
            }
        return stockOutMapper.updateById(stockOut);
    }
    @Override
    public int deleteStockOut(Long id) {
        int i = stockOutMapper.deleteByPrimaryKey(id);
        return i;
    public IPage<StockoutDto> selectStockOutPage(Page page, StockoutDto stockoutDto) {
        return stockOutMapper.selectStockOutBypage(page, stockoutDto);
    }
    @Override
    public void stockoutExport(HttpServletResponse response, StockoutDto stockoutDto) {
        List<StockOutExcelDto> stockoutList = stockOutMapper.stockoutExportList(stockoutDto);
        ExcelUtil<StockOutExcelDto> util = new ExcelUtil<StockOutExcelDto>(StockOutExcelDto.class);
        util.exportExcel(response, stockoutList, "供应商导出");
    }
}
src/main/resources/mapper/inventory/StockInMapper.xml
@@ -4,119 +4,123 @@
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.inventory.mapper.StockInMapper">
    <resultMap id="BaseResultMap" type="com.ruoyi.inventory.pojo.StockIn">
            <id property="id" column="id" jdbcType="INTEGER"/>
            <result property="productId" column="product_id" jdbcType="INTEGER"/>
            <result property="inboundTime" column="inbound_time" jdbcType="TIMESTAMP"/>
            <result property="inboundBatch" column="inbound_batch" jdbcType="VARCHAR"/>
            <result property="supplierName" column="supplier_name" jdbcType="VARCHAR"/>
            <result property="inboundQuantity" column="inbound_quantity" jdbcType="INTEGER"/>
            <result property="taxInclusivePrice" column="tax_inclusive_price" jdbcType="DECIMAL"/>
            <result property="taxInclusiveTotal" column="tax_inclusive_total" jdbcType="DECIMAL"/>
            <result property="taxRate" column="tax_rate" jdbcType="DECIMAL"/>
            <result property="taxExclusiveTotal" column="tax_exclusive_total" jdbcType="DECIMAL"/>
            <result property="inboundPerson" column="inbound_person" jdbcType="VARCHAR"/>
            <collection property="stockProducts" ofType="com.ruoyi.inventory.pojo.StockProduct"
                        select="com.ruoyi.inventory.mapper.StockProductMapper.selectByPrimaryKey" column="productId">
                <id property="id" column="productId" jdbcType="INTEGER"/>
            </collection>
    </resultMap>
    <sql id="Base_Column_List">
        id,product_id,inbound_time,
        inbound_batch,supplier_name,inbound_quantity,
        tax_inclusive_price,tax_inclusive_total,tax_rate,
        tax_exclusive_total,inbound_person
    </sql>
<!--    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultType="com.ruoyi.inventory.dto.StockinDto">-->
<!--        SELECT-->
<!--            T1.id,-->
<!--            T1.product_id,-->
<!--            T1.inbound_time,-->
<!--            T1.inbound_batch,-->
<!--            T1.supplier_id,-->
<!--            T1.inbound_quantity,-->
<!--            T1.tax_inclusive_price,-->
<!--            T1.tax_inclusive_total,-->
<!--            T1.tax_rate,-->
<!--            T1.tax_exclusive_total,-->
<!--            T1.inbound_person,-->
<!--            T1.tenant_id,-->
<!--            T2.product_category,-->
<!--            T2.specification_model,-->
<!--            T3.supplier_name-->
<!--        FROM-->
<!--            stock_in T1-->
<!--                INNER JOIN-->
<!--            product_record T2-->
<!--            ON-->
<!--                T1.product_id = T2.product_id-->
<!--                INNER JOIN-->
<!--            supplier_manage T3-->
<!--            ON-->
<!--                T1.supplier_id = T3.id-->
<!--        where  T1.id = #{id,jdbcType=INTEGER}-->
<!--    </select>-->
    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from stock_in
        where  id = #{id,jdbcType=INTEGER}
    </select>
    <select id="selectList" resultType="com.ruoyi.inventory.pojo.StockIn">
        select
        <include refid="Base_Column_List" />
        from stock_in
    </select>
    <select id="selectListByPage" resultType="com.ruoyi.inventory.pojo.StockIn">
        select
        <include refid="Base_Column_List" />
        from stock_in
        limit #{pageNum},#{pageSize}
    <select id="selectStockInWithProductInfo" resultType="com.ruoyi.inventory.dto.StockinDto">
        SELECT
        T1.id,
        T1.product_id,
        T1.inbound_time,
        T1.inbound_batch,
        T1.supplier_id,
        T1.inbound_quantity,
        T2.tax_inclusive_unit_price,
        T2.tax_inclusive_total_price,
        T2.tax_rate,
        T2.tax_exclusive_total_price,
        T1.inbound_person,
        T1.tenant_id,
        T2.product_category,
        T2.specification_model,
        T2.unit,
        T3.supplier_name
        FROM
        stock_in T1
        INNER JOIN
        product_record T2
        ON
        T1.product_id = T2.product_id
        INNER JOIN
        supplier_manage T3
        ON
        T1.supplier_id = T3.id
        <where>
            <if test="stockinDto.supplierName != null and stockinDto.supplierName != ''">
                AND T3.supplier_name LIKE CONCAT('%', #{stockinDto.supplierName}, '%')
            </if>
            <if test="stockinDto.startTime != null and stockinDto.startTime != ''">
                AND T1.inbound_time &gt;= #{stockinDto.startTime}
            </if>
            <if test="stockinDto.endTime != null and stockinDto.endTime != ''">
                AND T1.inbound_time &lt;= #{stockinDto.endTime}
            </if>
        </where>
        ORDER BY T1.inbound_time DESC
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
        delete from stock_in
        where  id = #{id,jdbcType=INTEGER}
    </delete>
    <select id="stockinExportList" resultType="com.ruoyi.inventory.excel.StockInExcelDto">
        SELECT
        T1.id,
        T1.product_id,
        T1.inbound_time,
        T1.inbound_batch,
        T1.supplier_id,
        T1.inbound_quantity,
        T2.tax_inclusive_unit_price,
        T2.tax_inclusive_total_price,
        T2.tax_rate,
        T2.tax_exclusive_total_price,
        T1.inbound_person,
        T1.tenant_id,
        T2.product_category,
        T2.specification_model,
        T2.unit,
        T3.supplier_name
        FROM
        stock_in T1
        INNER JOIN
        product_record T2
        ON
        T1.product_id = T2.product_id
        INNER JOIN
        supplier_manage T3
        ON
        T1.supplier_id = T3.id
        <where>
            <if test="stockinDto.supplierName != null and stockinDto.supplierName != ''">
                AND T3.supplier_name LIKE CONCAT('%', #{stockinDto.supplierName}, '%')
            </if>
            <if test="stockinDto.startTime != null and stockinDto.startTime != ''">
                AND T1.inbound_time &gt;= #{stockinDto.startTime}
            </if>
            <if test="stockinDto.endTime != null and stockinDto.endTime != ''">
                AND T1.inbound_time &lt;= #{stockinDto.endTime}
            </if>
        </where>
        ORDER BY T1.inbound_time DESC
    </select>
    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.ruoyi.inventory.pojo.StockIn" useGeneratedKeys="true">
        insert into stock_in
        <trim prefix="(" suffix=")" suffixOverrides=",">
                <if test="id != null">id,</if>
                <if test="productId != null">product_id,</if>
                <if test="inboundTime != null">inbound_time,</if>
                <if test="inboundBatch != null">inbound_batch,</if>
                <if test="supplierName != null">supplier_name,</if>
                <if test="inboundQuantity != null">inbound_quantity,</if>
                <if test="taxInclusivePrice != null">tax_inclusive_price,</if>
                <if test="taxInclusiveTotal != null">tax_inclusive_total,</if>
                <if test="taxRate != null">tax_rate,</if>
                <if test="taxExclusiveTotal != null">tax_exclusive_total,</if>
                <if test="inboundPerson != null">inbound_person,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                <if test="id != null">#{id,jdbcType=INTEGER},</if>
                <if test="productId != null">#{productId,jdbcType=INTEGER},</if>
                <if test="inboundTime != null">#{inboundTime,jdbcType=TIMESTAMP},</if>
                <if test="inboundBatch != null">#{inboundBatch,jdbcType=VARCHAR},</if>
                <if test="supplierName != null">#{supplierName,jdbcType=VARCHAR},</if>
                <if test="inboundQuantity != null">#{inboundQuantity,jdbcType=INTEGER},</if>
                <if test="taxInclusivePrice != null">#{taxInclusivePrice,jdbcType=DECIMAL},</if>
                <if test="taxInclusiveTotal != null">#{taxInclusiveTotal,jdbcType=DECIMAL},</if>
                <if test="taxRate != null">#{taxRate,jdbcType=DECIMAL},</if>
                <if test="taxExclusiveTotal != null">#{taxExclusiveTotal,jdbcType=DECIMAL},</if>
                <if test="inboundPerson != null">#{inboundPerson,jdbcType=VARCHAR},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.inventory.pojo.StockIn">
        update stock_in
        <set>
                <if test="productId != null">
                    product_id = #{productId,jdbcType=INTEGER},
                </if>
                <if test="inboundTime != null">
                    inbound_time = #{inboundTime,jdbcType=TIMESTAMP},
                </if>
                <if test="inboundBatch != null">
                    inbound_batch = #{inboundBatch,jdbcType=VARCHAR},
                </if>
                <if test="supplierName != null">
                    supplier_name = #{supplierName,jdbcType=VARCHAR},
                </if>
                <if test="inboundQuantity != null">
                    inbound_quantity = #{inboundQuantity,jdbcType=INTEGER},
                </if>
                <if test="taxInclusivePrice != null">
                    tax_inclusive_price = #{taxInclusivePrice,jdbcType=DECIMAL},
                </if>
                <if test="taxInclusiveTotal != null">
                    tax_inclusive_total = #{taxInclusiveTotal,jdbcType=DECIMAL},
                </if>
                <if test="taxRate != null">
                    tax_rate = #{taxRate,jdbcType=DECIMAL},
                </if>
                <if test="taxExclusiveTotal != null">
                    tax_exclusive_total = #{taxExclusiveTotal,jdbcType=DECIMAL},
                </if>
                <if test="inboundPerson != null">
                    inbound_person = #{inboundPerson,jdbcType=VARCHAR},
                </if>
        </set>
        where   id = #{id,jdbcType=INTEGER}
    </update>
</mapper>
src/main/resources/mapper/inventory/StockManagementMapper.xml
@@ -4,89 +4,76 @@
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.inventory.mapper.StockManagementMapper">
    <resultMap id="BaseResultMap" type="com.ruoyi.inventory.pojo.StockManagement">
            <id property="id" column="id" jdbcType="INTEGER"/>
            <result property="productId" column="product_id" jdbcType="INTEGER"/>
            <result property="stockQuantity" column="stock_quantity" jdbcType="INTEGER"/>
            <result property="taxInclusivePrice" column="tax_inclusive_price" jdbcType="DECIMAL"/>
            <result property="taxInclusiveTotal" column="tax_inclusive_total" jdbcType="DECIMAL"/>
            <result property="taxRate" column="tax_rate" jdbcType="DECIMAL"/>
            <result property="taxExclusiveTotal" column="tax_exclusive_total" jdbcType="DECIMAL"/>
            <result property="inboundPerson" column="inbound_person" jdbcType="VARCHAR"/>
    </resultMap>
    <sql id="Base_Column_List">
        id,product_id,stock_quantity,
        tax_inclusive_price,tax_inclusive_total,tax_rate,
        tax_exclusive_total,inbound_person
    </sql>
    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from stock_management
        where  id = #{id,jdbcType=INTEGER}
    </select>
    <select id="selectAll" resultType="com.ruoyi.inventory.pojo.StockManagement">
        select
        <include refid="Base_Column_List" />
        from stock_management
<!--    æ ¹æ®ä¾›åº”商模糊搜索-->
    <select id="selectStockManagementBypage" resultType="com.ruoyi.inventory.dto.StockManagementDto">
        SELECT
            T2.unit,
            T2.product_category,
            T2.specification_model,
            T3.supplier_name,
            T1.id,
            T1.product_id,
            T1.stock_quantity,
            T2.tax_inclusive_unit_price,
            T2.tax_inclusive_total_price,
            T2.tax_rate,
            T2.tax_exclusive_total_price,
            T1.inbound_person,
            T1.supplier_id,
            T1.tenant_id,
            T1.bound_time,
            T1.inbound_time
        FROM
            stock_management T1
                INNER JOIN
            product_record T2
            ON
                T1.product_id = T2.product_id
                INNER JOIN
            supplier_manage T3
            ON
                T1.supplier_id = T3.id
        <where>
            <if test="stockManagementDto.supplierName != null and stockManagementDto.supplierName != ''">
                AND T3.supplier_name LIKE CONCAT('%', #{stockManagementDto.supplierName}, '%')
            </if>
        </where>
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
        delete from stock_management
        where  id = #{id,jdbcType=INTEGER}
    </delete>
    <select id="stockManageExportList" resultType="com.ruoyi.inventory.excel.StockManagementExcelDto">
        SELECT
        T2.unit,
        T2.product_category,
        T2.specification_model,
        T3.supplier_name,
        T1.id,
        T1.product_id,
        T1.stock_quantity,
        T2.tax_inclusive_unit_price,
        T2.tax_inclusive_total_price,
        T2.tax_rate,
        T2.tax_exclusive_total_price,
        T1.inbound_person,
        T1.supplier_id,
        T1.tenant_id,
        T1.bound_time,
        T1.inbound_time
        FROM
        stock_management T1
        INNER JOIN
        product_record T2
        ON
        T1.product_id = T2.product_id
        INNER JOIN
        supplier_manage T3
        ON
        T1.supplier_id = T3.id
        <where>
            <if test="stockManagementDto.supplierName != null and stockManagementDto.supplierName != ''">
                AND T3.supplier_name LIKE CONCAT('%', #{stockManagementDto.supplierName}, '%')
            </if>
        </where>
    </select>
    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.ruoyi.inventory.pojo.StockManagement" useGeneratedKeys="true">
        insert into stock_management
        <trim prefix="(" suffix=")" suffixOverrides=",">
                <if test="id != null">id,</if>
                <if test="productId != null">product_id,</if>
                <if test="stockQuantity != null">stock_quantity,</if>
                <if test="taxInclusivePrice != null">tax_inclusive_price,</if>
                <if test="taxInclusiveTotal != null">tax_inclusive_total,</if>
                <if test="taxRate != null">tax_rate,</if>
                <if test="taxExclusiveTotal != null">tax_exclusive_total,</if>
                <if test="inboundPerson != null">inbound_person,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                <if test="id != null">#{id,jdbcType=INTEGER},</if>
                <if test="productId != null">#{productId,jdbcType=INTEGER},</if>
                <if test="stockQuantity != null">#{stockQuantity,jdbcType=INTEGER},</if>
                <if test="taxInclusivePrice != null">#{taxInclusivePrice,jdbcType=DECIMAL},</if>
                <if test="taxInclusiveTotal != null">#{taxInclusiveTotal,jdbcType=DECIMAL},</if>
                <if test="taxRate != null">#{taxRate,jdbcType=DECIMAL},</if>
                <if test="taxExclusiveTotal != null">#{taxExclusiveTotal,jdbcType=DECIMAL},</if>
                <if test="inboundPerson != null">#{inboundPerson,jdbcType=VARCHAR},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.inventory.pojo.StockManagement">
        update stock_management
        <set>
                <if test="productId != null">
                    product_id = #{productId,jdbcType=INTEGER},
                </if>
                <if test="stockQuantity != null">
                    stock_quantity = #{stockQuantity,jdbcType=INTEGER},
                </if>
                <if test="taxInclusivePrice != null">
                    tax_inclusive_price = #{taxInclusivePrice,jdbcType=DECIMAL},
                </if>
                <if test="taxInclusiveTotal != null">
                    tax_inclusive_total = #{taxInclusiveTotal,jdbcType=DECIMAL},
                </if>
                <if test="taxRate != null">
                    tax_rate = #{taxRate,jdbcType=DECIMAL},
                </if>
                <if test="taxExclusiveTotal != null">
                    tax_exclusive_total = #{taxExclusiveTotal,jdbcType=DECIMAL},
                </if>
                <if test="inboundPerson != null">
                    inbound_person = #{inboundPerson,jdbcType=VARCHAR},
                </if>
        </set>
        where   id = #{id,jdbcType=INTEGER}
    </update>
</mapper>
src/main/resources/mapper/inventory/StockOutMapper.xml
@@ -4,108 +4,76 @@
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.inventory.mapper.StockOutMapper">
    <resultMap id="BaseResultMap" type="com.ruoyi.inventory.pojo.StockOut">
            <id property="id" column="id" jdbcType="INTEGER"/>
            <result property="productId" column="product_id" jdbcType="INTEGER"/>
            <result property="inboundTime" column="inbound_time" jdbcType="TIMESTAMP"/>
            <result property="inboundBatch" column="inbound_batch" jdbcType="VARCHAR"/>
            <result property="supplierName" column="supplier_name" jdbcType="VARCHAR"/>
            <result property="inboundQuantity" column="inbound_quantity" jdbcType="INTEGER"/>
            <result property="taxInclusivePrice" column="tax_inclusive_price" jdbcType="DECIMAL"/>
            <result property="taxInclusiveTotal" column="tax_inclusive_total" jdbcType="DECIMAL"/>
            <result property="taxRate" column="tax_rate" jdbcType="DECIMAL"/>
            <result property="taxExclusiveTotal" column="tax_exclusive_total" jdbcType="DECIMAL"/>
            <result property="inboundPerson" column="inbound_person" jdbcType="VARCHAR"/>
    </resultMap>
    <sql id="Base_Column_List">
        id,product_id,inbound_time,
        inbound_batch,supplier_name,inbound_quantity,
        tax_inclusive_price,tax_inclusive_total,tax_rate,
        tax_exclusive_total,inbound_person
    </sql>
    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from stock_out
        where  id = #{id,jdbcType=INTEGER}
    <select id="selectStockOutBypage" resultType="com.ruoyi.inventory.dto.StockoutDto">
        SELECT
        T1.id,
        T1.product_id,
        T1.inbound_time,
        T1.inbound_batch,
        T1.supplier_id,
        T1.inbound_quantity,
        T2.tax_inclusive_unit_price,
        T2.tax_inclusive_total_price,
        T2.tax_rate,
        T2.tax_exclusive_total_price,
        T1.inbound_person,
        T1.tenant_id,
        T2.product_category,
        T2.specification_model,
        T2.unit,
        T3.supplier_name
        FROM
        stock_out T1
        INNER JOIN
        product_record T2
        ON
        T1.product_id = T2.product_id
        INNER JOIN
        supplier_manage T3
        ON
        T1.supplier_id = T3.id
        <where>
            <if test="stockOutdto.supplierName != null and stockOutdto.supplierName != ''">
                AND T3.supplier_name LIKE CONCAT('%', #{stockOutdto.supplierName}, '%')
            </if>
        </where>
        ORDER BY T1.inbound_time DESC
    </select>
    <select id="selectAll" resultType="com.ruoyi.inventory.pojo.StockOut">
        select
        <include refid="Base_Column_List" />
        from stock_out
    <select id="stockoutExportList" resultType="com.ruoyi.inventory.excel.StockOutExcelDto">
        SELECT
        T1.id,
        T1.product_id,
        T1.inbound_time,
        T1.inbound_batch,
        T1.supplier_id,
        T1.inbound_quantity,
        T2.tax_inclusive_unit_price,
        T2.tax_inclusive_total_price,
        T2.tax_rate,
        T2.tax_exclusive_total_price,
        T1.inbound_person,
        T1.tenant_id,
        T2.product_category,
        T2.specification_model,
        T2.unit,
        T3.supplier_name
        FROM
        stock_out T1
        INNER JOIN
        product_record T2
        ON
        T1.product_id = T2.product_id
        INNER JOIN
        supplier_manage T3
        ON
        T1.supplier_id = T3.id
        <where>
            <if test="stockOutdto.supplierName != null and stockOutdto.supplierName != ''">
                AND T3.supplier_name LIKE CONCAT('%', #{stockOutdto.supplierName}, '%')
            </if>
        </where>
        ORDER BY T1.inbound_time DESC
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
        delete from stock_out
        where  id = #{id,jdbcType=INTEGER}
    </delete>
    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.ruoyi.inventory.pojo.StockOut" useGeneratedKeys="true">
        insert into stock_out
        <trim prefix="(" suffix=")" suffixOverrides=",">
                <if test="id != null">id,</if>
                <if test="productId != null">product_id,</if>
                <if test="inboundTime != null">inbound_time,</if>
                <if test="inboundBatch != null">inbound_batch,</if>
                <if test="supplierName != null">supplier_name,</if>
                <if test="inboundQuantity != null">inbound_quantity,</if>
                <if test="taxInclusivePrice != null">tax_inclusive_price,</if>
                <if test="taxInclusiveTotal != null">tax_inclusive_total,</if>
                <if test="taxRate != null">tax_rate,</if>
                <if test="taxExclusiveTotal != null">tax_exclusive_total,</if>
                <if test="inboundPerson != null">inbound_person,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                <if test="id != null">#{id,jdbcType=INTEGER},</if>
                <if test="productId != null">#{productId,jdbcType=INTEGER},</if>
                <if test="inboundTime != null">#{inboundTime,jdbcType=TIMESTAMP},</if>
                <if test="inboundBatch != null">#{inboundBatch,jdbcType=VARCHAR},</if>
                <if test="supplierName != null">#{supplierName,jdbcType=VARCHAR},</if>
                <if test="inboundQuantity != null">#{inboundQuantity,jdbcType=INTEGER},</if>
                <if test="taxInclusivePrice != null">#{taxInclusivePrice,jdbcType=DECIMAL},</if>
                <if test="taxInclusiveTotal != null">#{taxInclusiveTotal,jdbcType=DECIMAL},</if>
                <if test="taxRate != null">#{taxRate,jdbcType=DECIMAL},</if>
                <if test="taxExclusiveTotal != null">#{taxExclusiveTotal,jdbcType=DECIMAL},</if>
                <if test="inboundPerson != null">#{inboundPerson,jdbcType=VARCHAR},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.inventory.pojo.StockOut">
        update stock_out
        <set>
                <if test="productId != null">
                    product_id = #{productId,jdbcType=INTEGER},
                </if>
                <if test="inboundTime != null">
                    inbound_time = #{inboundTime,jdbcType=TIMESTAMP},
                </if>
                <if test="inboundBatch != null">
                    inbound_batch = #{inboundBatch,jdbcType=VARCHAR},
                </if>
                <if test="supplierName != null">
                    supplier_name = #{supplierName,jdbcType=VARCHAR},
                </if>
                <if test="inboundQuantity != null">
                    inbound_quantity = #{inboundQuantity,jdbcType=INTEGER},
                </if>
                <if test="taxInclusivePrice != null">
                    tax_inclusive_price = #{taxInclusivePrice,jdbcType=DECIMAL},
                </if>
                <if test="taxInclusiveTotal != null">
                    tax_inclusive_total = #{taxInclusiveTotal,jdbcType=DECIMAL},
                </if>
                <if test="taxRate != null">
                    tax_rate = #{taxRate,jdbcType=DECIMAL},
                </if>
                <if test="taxExclusiveTotal != null">
                    tax_exclusive_total = #{taxExclusiveTotal,jdbcType=DECIMAL},
                </if>
                <if test="inboundPerson != null">
                    inbound_person = #{inboundPerson,jdbcType=VARCHAR},
                </if>
        </set>
        where   id = #{id,jdbcType=INTEGER}
    </update>
</mapper>