Browse Source

单据管理

hurixing 1 year ago
parent
commit
209b3007c8
21 changed files with 1610 additions and 2 deletions
  1. 109 0
      inventory-admin/src/main/java/com/ruoyi/web/controller/inventory/BillsController.java
  2. 91 0
      inventory-admin/src/main/java/com/ruoyi/web/controller/inventory/GoodsController.java
  3. 1 1
      inventory-admin/src/main/resources/application.yml
  4. 23 0
      inventory-common/src/main/java/com/ruoyi/common/enums/BillsType.java
  5. 104 0
      inventory-system/src/main/java/com/ruoyi/system/domain/Bills.java
  6. 113 0
      inventory-system/src/main/java/com/ruoyi/system/domain/BillsDetails.java
  7. 113 0
      inventory-system/src/main/java/com/ruoyi/system/domain/Goods.java
  8. 30 0
      inventory-system/src/main/java/com/ruoyi/system/domain/vo/BillsDetailsVo.java
  9. 61 0
      inventory-system/src/main/java/com/ruoyi/system/mapper/BillsDetailsMapper.java
  10. 61 0
      inventory-system/src/main/java/com/ruoyi/system/mapper/BillsMapper.java
  11. 70 0
      inventory-system/src/main/java/com/ruoyi/system/mapper/GoodsMapper.java
  12. 62 0
      inventory-system/src/main/java/com/ruoyi/system/service/IBillsDetailsService.java
  13. 61 0
      inventory-system/src/main/java/com/ruoyi/system/service/IBillsService.java
  14. 61 0
      inventory-system/src/main/java/com/ruoyi/system/service/IGoodsService.java
  15. 154 0
      inventory-system/src/main/java/com/ruoyi/system/service/impl/BillsDetailsServiceImpl.java
  16. 96 0
      inventory-system/src/main/java/com/ruoyi/system/service/impl/BillsServiceImpl.java
  17. 96 0
      inventory-system/src/main/java/com/ruoyi/system/service/impl/GoodsServiceImpl.java
  18. 96 0
      inventory-system/src/main/resources/mapper/system/BillsDetailsMapper.xml
  19. 99 0
      inventory-system/src/main/resources/mapper/system/BillsMapper.xml
  20. 108 0
      inventory-system/src/main/resources/mapper/system/GoodsMapper.xml
  21. 1 1
      inventory-ui/vue.config.js

+ 109 - 0
inventory-admin/src/main/java/com/ruoyi/web/controller/inventory/BillsController.java

@@ -0,0 +1,109 @@
+package com.ruoyi.web.controller.inventory;
+
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.system.domain.Bills;
+import com.ruoyi.system.domain.BillsDetails;
+import com.ruoyi.system.domain.vo.BillsDetailsVo;
+import com.ruoyi.system.service.IBillsDetailsService;
+import com.ruoyi.system.service.IBillsService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("inventory/bills")
+public class BillsController extends BaseController {
+
+    @Resource
+    private IBillsService billsService;
+
+    @Resource
+    private IBillsDetailsService billsDetailsService;
+
+    /**
+     * 查询单据列表
+     */
+    @PreAuthorize("@ss.hasPermi('inventory:bills:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(Bills bills)
+    {
+        startPage();
+        List<Bills> list = billsService.selectBillsList(bills);
+        return getDataTable(list);
+    }
+
+
+    /**
+     * 获取单据详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('inventory:bills:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(billsService.selectBillsById(id));
+    }
+
+    /**
+     * 新增单据
+     */
+    @PreAuthorize("@ss.hasPermi('inventory:bills:add')")
+    @Log(title = "单据", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody Bills bills)
+    {
+        return toAjax(billsService.insertBills(bills));
+    }
+
+    /**
+     * 修改单据
+     */
+    @PreAuthorize("@ss.hasPermi('inventory:bills:edit')")
+    @Log(title = "单据", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody Bills bills)
+    {
+        return toAjax(billsService.updateBills(bills));
+    }
+
+    /**
+     * 删除单据
+     */
+    @PreAuthorize("@ss.hasPermi('inventory:bills:remove')")
+    @Log(title = "单据", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(billsService.deleteBillsByIds(ids));
+    }
+
+    /**
+     * 新增单据详情
+     */
+    @PreAuthorize("@ss.hasPermi('inventory:bills:details:add')")
+    @Log(title = "单据详情", businessType = BusinessType.INSERT)
+    @PostMapping("/details")
+    public AjaxResult detailsAdd(@RequestBody BillsDetailsVo billsDetailsVo)
+    {
+        return toAjax(billsDetailsService.insertBillsDetails(billsDetailsVo));
+    }
+
+    /**
+     * 查询单据详情列表
+     */
+    @PreAuthorize("@ss.hasPermi('inventory:bills:details:list')")
+    @GetMapping("/details/list")
+    public TableDataInfo list(BillsDetails billsDetails)
+    {
+        startPage();
+        List<BillsDetails> list = billsDetailsService.selectBillsDetailsList(billsDetails);
+        return getDataTable(list);
+    }
+
+}

+ 91 - 0
inventory-admin/src/main/java/com/ruoyi/web/controller/inventory/GoodsController.java

@@ -0,0 +1,91 @@
+package com.ruoyi.web.controller.inventory;
+
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.system.domain.Goods;
+import com.ruoyi.system.service.IGoodsService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+import java.util.List;
+
+
+@RestController
+@RequestMapping("/inventory/goods")
+public class GoodsController extends BaseController {
+
+    @Resource
+    private IGoodsService goodsService;
+
+    /**
+     * 查询物品列表
+     */
+    @PreAuthorize("@ss.hasPermi('inventory:goods:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(Goods goods)
+    {
+        startPage();
+        List<Goods> list = goodsService.selectGoodsList(goods);
+        return getDataTable(list);
+    }
+
+    /**
+     * 新增物品
+     */
+    @PreAuthorize("@ss.hasPermi('inventory:goods:add')")
+    @Log(title = "物品", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody Goods goods)
+    {
+        Goods goodsCode = new Goods();
+        goodsCode.setGoodsCode(goods.getGoodsCode());
+        List<Goods> list = goodsService.selectGoodsList(goodsCode);
+        if (!list.isEmpty()){
+            throw new RuntimeException("编码已存在!");
+        }
+        return toAjax(goodsService.insertGoods(goods));
+    }
+
+    /**
+     * 获取物品详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('inventory:goods:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(goodsService.selectGoodsById(id));
+    }
+
+    /**
+     * 修改物品
+     */
+    @PreAuthorize("@ss.hasPermi('inventory:goods:edit')")
+    @Log(title = "物品", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody Goods goods)
+    {
+        Goods goodsCode = new Goods();
+        goodsCode.setGoodsCode(goods.getGoodsCode());
+        List<Goods> list = goodsService.selectGoodsList(goodsCode);
+        if (!goods.getId().equals(list.get(0).getId())){
+            throw new RuntimeException("编码已存在!");
+        }
+        return toAjax(goodsService.updateGoods(goods));
+    }
+
+    /**
+     * 删除物品
+     */
+    @PreAuthorize("@ss.hasPermi('inventory:goods:remove')")
+    @Log(title = "物品", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(goodsService.deleteGoodsByIds(ids));
+    }
+}

+ 1 - 1
inventory-admin/src/main/resources/application.yml

@@ -16,7 +16,7 @@ ruoyi:
 # 开发环境配置
 server:
   # 服务器的HTTP端口,默认为8080
-  port: 8080
+  port: 8088
   servlet:
     # 应用的访问路径
     context-path: /

+ 23 - 0
inventory-common/src/main/java/com/ruoyi/common/enums/BillsType.java

@@ -0,0 +1,23 @@
+package com.ruoyi.common.enums;
+
+public enum BillsType {
+    RUKU("0","入库"),
+    CHUKU("1","出库");
+
+    private final String code;
+
+    private final String info;
+
+    BillsType(String code,String info) {
+        this.code = code;
+        this.info = info;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public String getInfo() {
+        return info;
+    }
+}

+ 104 - 0
inventory-system/src/main/java/com/ruoyi/system/domain/Bills.java

@@ -0,0 +1,104 @@
+package com.ruoyi.system.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.Date;
+
+/**
+ * 单据对象 bills
+ *
+ * @date 2024-10-14
+ */
+public class Bills extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 单据id
+     */
+    private Long id;
+
+    /**
+     * 单据类型
+     */
+    @Excel(name = "单据类型")
+    private String billsType;
+
+    /**
+     * 出入库/负责人
+     */
+    @Excel(name = "出入库/负责人")
+    private String principal;
+
+    /**
+     * 单据时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "单据时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date billsTime;
+
+    /**
+     * 出(入)库地点
+     */
+    @Excel(name = "出", readConverterExp = "入=")
+    private String givePlace;
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setBillsType(String billsType) {
+        this.billsType = billsType;
+    }
+
+    public String getBillsType() {
+        return billsType;
+    }
+
+    public void setPrincipal(String principal) {
+        this.principal = principal;
+    }
+
+    public String getPrincipal() {
+        return principal;
+    }
+
+    public void setBillsTime(Date billsTime) {
+        this.billsTime = billsTime;
+    }
+
+    public Date getBillsTime() {
+        return billsTime;
+    }
+
+    public void setGivePlace(String givePlace) {
+        this.givePlace = givePlace;
+    }
+
+    public String getGivePlace() {
+        return givePlace;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("billsType", getBillsType())
+                .append("principal", getPrincipal())
+                .append("billsTime", getBillsTime())
+                .append("givePlace", getGivePlace())
+                .append("createBy", getCreateBy())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateTime", getUpdateTime())
+                .append("remark", getRemark())
+                .toString();
+    }
+}

+ 113 - 0
inventory-system/src/main/java/com/ruoyi/system/domain/BillsDetails.java

@@ -0,0 +1,113 @@
+package com.ruoyi.system.domain;
+
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.math.BigDecimal;
+
+/**
+ * 单据详情对象 bills_details
+ *
+ * @date 2024-10-14
+ */
+public class BillsDetails extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long id;
+
+    /** 单据id */
+    @Excel(name = "单据id")
+    private Long billsId;
+
+    /** 物品编码 */
+    @Excel(name = "物品编码")
+    private String goodsCode;
+
+    /** 数量 */
+    @Excel(name = "数量")
+    private BigDecimal goodsNum;
+
+    /** 物品状态 */
+    @Excel(name = "物品状态")
+    private String goodsStatus;
+
+    /** 物品名称 */
+    @Excel(name = "物品名称")
+    private String goodsName;
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setBillsId(Long billsId)
+    {
+        this.billsId = billsId;
+    }
+
+    public Long getBillsId()
+    {
+        return billsId;
+    }
+    public void setGoodsCode(String goodsCode)
+    {
+        this.goodsCode = goodsCode;
+    }
+
+    public String getGoodsCode()
+    {
+        return goodsCode;
+    }
+
+    public BigDecimal getGoodsNum() {
+        return goodsNum;
+    }
+
+    public void setGoodsNum(BigDecimal goodsNum) {
+        this.goodsNum = goodsNum;
+    }
+
+    public void setGoodsStatus(String goodsStatus)
+    {
+        this.goodsStatus = goodsStatus;
+    }
+
+    public String getGoodsStatus()
+    {
+        return goodsStatus;
+    }
+    public void setGoodsName(String goodsName)
+    {
+        this.goodsName = goodsName;
+    }
+
+    public String getGoodsName()
+    {
+        return goodsName;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("billsId", getBillsId())
+                .append("goodsCode", getGoodsCode())
+                .append("goodsNum", getGoodsNum())
+                .append("goodsStatus", getGoodsStatus())
+                .append("goodsName", getGoodsName())
+                .append("createBy", getCreateBy())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateTime", getUpdateTime())
+                .append("remark", getRemark())
+                .toString();
+    }
+}

+ 113 - 0
inventory-system/src/main/java/com/ruoyi/system/domain/Goods.java

@@ -0,0 +1,113 @@
+package com.ruoyi.system.domain;
+
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.math.BigDecimal;
+
+/**
+ * 物品对象 goods
+ *
+ * @date 2024-10-14
+ */
+public class Goods extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 物品id */
+    private Long id;
+
+    /** 物品编码 */
+    @Excel(name = "物品编码")
+    private String goodsCode;
+
+    /** 物品名称 */
+    @Excel(name = "物品名称")
+    private String goodsName;
+
+    /** 物品类型 */
+    @Excel(name = "物品类型")
+    private String goodsType;
+
+    /** 库窜数量 */
+    @Excel(name = "库窜数量")
+    private BigDecimal quantityStock;
+
+    /** 物品状态(0=在库,1=已出库) */
+    @Excel(name = "物品状态(0=在库,1=已出库)")
+    private String goodsStatus;
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setGoodsCode(String goodsCode)
+    {
+        this.goodsCode = goodsCode;
+    }
+
+    public String getGoodsCode()
+    {
+        return goodsCode;
+    }
+    public void setGoodsName(String goodsName)
+    {
+        this.goodsName = goodsName;
+    }
+
+    public String getGoodsName()
+    {
+        return goodsName;
+    }
+    public void setGoodsType(String goodsType)
+    {
+        this.goodsType = goodsType;
+    }
+
+    public String getGoodsType()
+    {
+        return goodsType;
+    }
+    public void setQuantityStock(BigDecimal quantityStock)
+    {
+        this.quantityStock = quantityStock;
+    }
+
+    public BigDecimal getQuantityStock()
+    {
+        return quantityStock;
+    }
+    public void setGoodsStatus(String goodsStatus)
+    {
+        this.goodsStatus = goodsStatus;
+    }
+
+    public String getGoodsStatus()
+    {
+        return goodsStatus;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("goodsCode", getGoodsCode())
+                .append("goodsName", getGoodsName())
+                .append("goodsType", getGoodsType())
+                .append("quantityStock", getQuantityStock())
+                .append("goodsStatus", getGoodsStatus())
+                .append("createBy", getCreateBy())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateTime", getUpdateTime())
+                .append("remark", getRemark())
+                .toString();
+    }
+}

+ 30 - 0
inventory-system/src/main/java/com/ruoyi/system/domain/vo/BillsDetailsVo.java

@@ -0,0 +1,30 @@
+package com.ruoyi.system.domain.vo;
+
+import java.util.List;
+
+public class BillsDetailsVo {
+
+    private List<Long> ids;
+
+    public void setBillsId(Long billsId) {
+        this.billsId = billsId;
+    }
+
+    public Long getBillsId() {
+        return billsId;
+    }
+
+    private Long billsId;
+
+    public List<Long> getIds() {
+        return ids;
+    }
+
+
+
+    public void setIds(List<Long> ids) {
+        this.ids = ids;
+    }
+
+
+}

+ 61 - 0
inventory-system/src/main/java/com/ruoyi/system/mapper/BillsDetailsMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.mapper;
+
+import com.ruoyi.system.domain.BillsDetails;
+
+import java.util.List;
+
+/**
+ * 单据详情Mapper接口
+ *
+ * @date 2024-10-14
+ */
+public interface BillsDetailsMapper
+{
+    /**
+     * 查询单据详情
+     *
+     * @param id 单据详情主键
+     * @return 单据详情
+     */
+    public BillsDetails selectBillsDetailsById(Long id);
+
+    /**
+     * 查询单据详情列表
+     *
+     * @param billsDetails 单据详情
+     * @return 单据详情集合
+     */
+    public List<BillsDetails> selectBillsDetailsList(BillsDetails billsDetails);
+
+    /**
+     * 新增单据详情
+     *
+     * @param billsDetails 单据详情
+     * @return 结果
+     */
+    public int insertBillsDetails(BillsDetails billsDetails);
+
+    /**
+     * 修改单据详情
+     *
+     * @param billsDetails 单据详情
+     * @return 结果
+     */
+    public int updateBillsDetails(BillsDetails billsDetails);
+
+    /**
+     * 删除单据详情
+     *
+     * @param id 单据详情主键
+     * @return 结果
+     */
+    public int deleteBillsDetailsById(Long id);
+
+    /**
+     * 批量删除单据详情
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteBillsDetailsByIds(Long[] ids);
+}

+ 61 - 0
inventory-system/src/main/java/com/ruoyi/system/mapper/BillsMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.mapper;
+
+import com.ruoyi.system.domain.Bills;
+
+import java.util.List;
+
+/**
+ * 单据Mapper接口
+ *
+ * @date 2024-10-14
+ */
+public interface BillsMapper
+{
+    /**
+     * 查询单据
+     *
+     * @param id 单据主键
+     * @return 单据
+     */
+    public Bills selectBillsById(Long id);
+
+    /**
+     * 查询单据列表
+     *
+     * @param bills 单据
+     * @return 单据集合
+     */
+    public List<Bills> selectBillsList(Bills bills);
+
+    /**
+     * 新增单据
+     *
+     * @param bills 单据
+     * @return 结果
+     */
+    public int insertBills(Bills bills);
+
+    /**
+     * 修改单据
+     *
+     * @param bills 单据
+     * @return 结果
+     */
+    public int updateBills(Bills bills);
+
+    /**
+     * 删除单据
+     *
+     * @param id 单据主键
+     * @return 结果
+     */
+    public int deleteBillsById(Long id);
+
+    /**
+     * 批量删除单据
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteBillsByIds(Long[] ids);
+}

+ 70 - 0
inventory-system/src/main/java/com/ruoyi/system/mapper/GoodsMapper.java

@@ -0,0 +1,70 @@
+package com.ruoyi.system.mapper;
+
+import com.ruoyi.system.domain.Goods;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 物品Mapper接口
+ *
+ * @date 2024-10-14
+ */
+public interface GoodsMapper
+{
+    /**
+     * 查询物品
+     *
+     * @param id 物品主键
+     * @return 物品
+     */
+    public Goods selectGoodsById(Long id);
+
+    /**
+     * 查询物品列表
+     *
+     * @param goods 物品
+     * @return 物品集合
+     */
+    public List<Goods> selectGoodsList(Goods goods);
+
+    /**
+     * 新增物品
+     *
+     * @param goods 物品
+     * @return 结果
+     */
+    public int insertGoods(Goods goods);
+
+    /**
+     * 修改物品
+     *
+     * @param goods 物品
+     * @return 结果
+     */
+    public int updateGoods(Goods goods);
+
+    /**
+     * 删除物品
+     *
+     * @param id 物品主键
+     * @return 结果
+     */
+    public int deleteGoodsById(Long id);
+
+    /**
+     * 批量删除物品
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteGoodsByIds(Long[] ids);
+
+    /**
+     * 根据ids 查询
+     * @param ids
+     * @return
+     */
+    public List<Goods> selectGoodsIds(@Param("ids") List<Long> ids);
+
+}

+ 62 - 0
inventory-system/src/main/java/com/ruoyi/system/service/IBillsDetailsService.java

@@ -0,0 +1,62 @@
+package com.ruoyi.system.service;
+
+import com.ruoyi.system.domain.BillsDetails;
+import com.ruoyi.system.domain.vo.BillsDetailsVo;
+
+import java.util.List;
+
+/**
+ * 单据详情Service接口
+ *
+ * @date 2024-10-14
+ */
+public interface IBillsDetailsService
+{
+    /**
+     * 查询单据详情
+     *
+     * @param id 单据详情主键
+     * @return 单据详情
+     */
+    public BillsDetails selectBillsDetailsById(Long id);
+
+    /**
+     * 查询单据详情列表
+     *
+     * @param billsDetails 单据详情
+     * @return 单据详情集合
+     */
+    public List<BillsDetails> selectBillsDetailsList(BillsDetails billsDetails);
+
+    /**
+     * 新增单据详情
+     *
+     * @param billsDetailsVo 单据详情
+     * @return 结果
+     */
+    public int insertBillsDetails(BillsDetailsVo billsDetailsVo);
+
+    /**
+     * 修改单据详情
+     *
+     * @param billsDetails 单据详情
+     * @return 结果
+     */
+    public int updateBillsDetails(BillsDetails billsDetails);
+
+    /**
+     * 批量删除单据详情
+     *
+     * @param ids 需要删除的单据详情主键集合
+     * @return 结果
+     */
+    public int deleteBillsDetailsByIds(Long[] ids);
+
+    /**
+     * 删除单据详情信息
+     *
+     * @param id 单据详情主键
+     * @return 结果
+     */
+    public int deleteBillsDetailsById(Long id);
+}

+ 61 - 0
inventory-system/src/main/java/com/ruoyi/system/service/IBillsService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.service;
+
+import com.ruoyi.system.domain.Bills;
+
+import java.util.List;
+
+/**
+ * 单据Service接口
+ *
+ * @date 2024-10-14
+ */
+public interface IBillsService
+{
+    /**
+     * 查询单据
+     *
+     * @param id 单据主键
+     * @return 单据
+     */
+    public Bills selectBillsById(Long id);
+
+    /**
+     * 查询单据列表
+     *
+     * @param bills 单据
+     * @return 单据集合
+     */
+    public List<Bills> selectBillsList(Bills bills);
+
+    /**
+     * 新增单据
+     *
+     * @param bills 单据
+     * @return 结果
+     */
+    public int insertBills(Bills bills);
+
+    /**
+     * 修改单据
+     *
+     * @param bills 单据
+     * @return 结果
+     */
+    public int updateBills(Bills bills);
+
+    /**
+     * 批量删除单据
+     *
+     * @param ids 需要删除的单据主键集合
+     * @return 结果
+     */
+    public int deleteBillsByIds(Long[] ids);
+
+    /**
+     * 删除单据信息
+     *
+     * @param id 单据主键
+     * @return 结果
+     */
+    public int deleteBillsById(Long id);
+}

+ 61 - 0
inventory-system/src/main/java/com/ruoyi/system/service/IGoodsService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.service;
+
+import com.ruoyi.system.domain.Goods;
+
+import java.util.List;
+
+/**
+ * 物品Service接口
+ *
+ * @date 2024-10-14
+ */
+public interface IGoodsService
+{
+    /**
+     * 查询物品
+     *
+     * @param id 物品主键
+     * @return 物品
+     */
+    public Goods selectGoodsById(Long id);
+
+    /**
+     * 查询物品列表
+     *
+     * @param goods 物品
+     * @return 物品集合
+     */
+    public List<Goods> selectGoodsList(Goods goods);
+
+    /**
+     * 新增物品
+     *
+     * @param goods 物品
+     * @return 结果
+     */
+    public int insertGoods(Goods goods);
+
+    /**
+     * 修改物品
+     *
+     * @param goods 物品
+     * @return 结果
+     */
+    public int updateGoods(Goods goods);
+
+    /**
+     * 批量删除物品
+     *
+     * @param ids 需要删除的物品主键集合
+     * @return 结果
+     */
+    public int deleteGoodsByIds(Long[] ids);
+
+    /**
+     * 删除物品信息
+     *
+     * @param id 物品主键
+     * @return 结果
+     */
+    public int deleteGoodsById(Long id);
+}

+ 154 - 0
inventory-system/src/main/java/com/ruoyi/system/service/impl/BillsDetailsServiceImpl.java

@@ -0,0 +1,154 @@
+package com.ruoyi.system.service.impl;
+
+import com.ruoyi.common.enums.BillsType;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.system.domain.Bills;
+import com.ruoyi.system.domain.BillsDetails;
+import com.ruoyi.system.domain.Goods;
+import com.ruoyi.system.domain.vo.BillsDetailsVo;
+import com.ruoyi.system.mapper.BillsDetailsMapper;
+import com.ruoyi.system.mapper.BillsMapper;
+import com.ruoyi.system.mapper.GoodsMapper;
+import com.ruoyi.system.service.IBillsDetailsService;
+import org.apache.commons.lang3.ObjectUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 单据详情Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2024-10-14
+ */
+@Service
+public class BillsDetailsServiceImpl implements IBillsDetailsService
+{
+    @Resource
+    private BillsDetailsMapper billsDetailsMapper;
+
+
+    @Resource
+    private GoodsMapper goodsMapper;
+
+    @Resource
+    private BillsMapper billsMapper;
+
+
+    /**
+     * 查询单据详情
+     *
+     * @param id 单据详情主键
+     * @return 单据详情
+     */
+    @Override
+    public BillsDetails selectBillsDetailsById(Long id)
+    {
+        return billsDetailsMapper.selectBillsDetailsById(id);
+    }
+
+    /**
+     * 查询单据详情列表
+     *
+     * @param billsDetails 单据详情
+     * @return 单据详情
+     */
+    @Override
+    public List<BillsDetails> selectBillsDetailsList(BillsDetails billsDetails)
+    {
+        return billsDetailsMapper.selectBillsDetailsList(billsDetails);
+    }
+
+    /**
+     * 新增单据详情
+     *
+     * @param billsDetailsVo 单据详情
+     * @return 结果
+     */
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public int insertBillsDetails(BillsDetailsVo billsDetailsVo)
+    {
+        // 根据ids 获取物品
+        List<Goods> goodsList = goodsMapper.selectGoodsIds(billsDetailsVo.getIds());
+        // 根据 billsId 获取单据
+        Bills bills = billsMapper.selectBillsById(billsDetailsVo.getBillsId());
+        if (ObjectUtils.isEmpty(bills)){
+            throw new RuntimeException("单据信息错误,添加失败");
+        }
+        if (CollectionUtils.isEmpty(goodsList)){
+            throw new RuntimeException("添加失败");
+        }
+        for (Goods goods : goodsList) {
+             // 修改的物品
+            Goods goodsUpdate = new Goods();
+            goodsUpdate.setId(goods.getId());
+            goodsUpdate.setUpdateTime(new Date());
+            goodsUpdate.setUpdateBy(SecurityUtils.getLoginUser().getUser().getUserName());
+            // 添加单据详情
+            BillsDetails billsDetails = new BillsDetails();
+            billsDetails.setBillsId(bills.getId());
+            billsDetails.setGoodsCode(goods.getGoodsCode());
+            billsDetails.setGoodsName(goods.getGoodsName());
+            billsDetails.setGoodsNum(goods.getQuantityStock());
+            billsDetails.setCreateBy(SecurityUtils.getLoginUser().getUser().getUserName());
+            billsDetails.setCreateTime(new Date());
+            // 入库单据时
+            if (bills.getBillsType().equals(BillsType.RUKU.getCode())){
+                goodsUpdate.setGoodsStatus("0");
+                billsDetails.setGoodsStatus("0");
+            }
+            // 出库单据时
+            if (bills.getBillsType().equals(BillsType.CHUKU.getCode())){
+                goodsUpdate.setGoodsStatus("1");
+                billsDetails.setGoodsStatus("1");
+            }
+            billsDetailsMapper.insertBillsDetails(billsDetails);
+            goodsMapper.updateGoods(goodsUpdate);
+        }
+        return 1;
+    }
+
+    /**
+     * 修改单据详情
+     *
+     * @param billsDetails 单据详情
+     * @return 结果
+     */
+    @Override
+    public int updateBillsDetails(BillsDetails billsDetails)
+    {
+        billsDetails.setUpdateTime(DateUtils.getNowDate());
+        return billsDetailsMapper.updateBillsDetails(billsDetails);
+    }
+
+    /**
+     * 批量删除单据详情
+     *
+     * @param ids 需要删除的单据详情主键
+     * @return 结果
+     */
+    @Override
+    public int deleteBillsDetailsByIds(Long[] ids)
+    {
+        return billsDetailsMapper.deleteBillsDetailsByIds(ids);
+    }
+
+    /**
+     * 删除单据详情信息
+     *
+     * @param id 单据详情主键
+     * @return 结果
+     */
+    @Override
+    public int deleteBillsDetailsById(Long id)
+    {
+        return billsDetailsMapper.deleteBillsDetailsById(id);
+    }
+}

+ 96 - 0
inventory-system/src/main/java/com/ruoyi/system/service/impl/BillsServiceImpl.java

@@ -0,0 +1,96 @@
+package com.ruoyi.system.service.impl;
+
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.system.domain.Bills;
+import com.ruoyi.system.mapper.BillsMapper;
+import com.ruoyi.system.service.IBillsService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * 单据Service业务层处理
+ *
+ * @date 2024-10-14
+ */
+@Service
+public class BillsServiceImpl implements IBillsService
+{
+    @Resource
+    private BillsMapper billsMapper;
+
+    /**
+     * 查询单据
+     *
+     * @param id 单据主键
+     * @return 单据
+     */
+    @Override
+    public Bills selectBillsById(Long id)
+    {
+        return billsMapper.selectBillsById(id);
+    }
+
+    /**
+     * 查询单据列表
+     *
+     * @param bills 单据
+     * @return 单据
+     */
+    @Override
+    public List<Bills> selectBillsList(Bills bills)
+    {
+        return billsMapper.selectBillsList(bills);
+    }
+
+    /**
+     * 新增单据
+     *
+     * @param bills 单据
+     * @return 结果
+     */
+    @Override
+    public int insertBills(Bills bills)
+    {
+        bills.setCreateTime(DateUtils.getNowDate());
+        return billsMapper.insertBills(bills);
+    }
+
+    /**
+     * 修改单据
+     *
+     * @param bills 单据
+     * @return 结果
+     */
+    @Override
+    public int updateBills(Bills bills)
+    {
+        bills.setUpdateTime(DateUtils.getNowDate());
+        return billsMapper.updateBills(bills);
+    }
+
+    /**
+     * 批量删除单据
+     *
+     * @param ids 需要删除的单据主键
+     * @return 结果
+     */
+    @Override
+    public int deleteBillsByIds(Long[] ids)
+    {
+        return billsMapper.deleteBillsByIds(ids);
+    }
+
+    /**
+     * 删除单据信息
+     *
+     * @param id 单据主键
+     * @return 结果
+     */
+    @Override
+    public int deleteBillsById(Long id)
+    {
+        return billsMapper.deleteBillsById(id);
+    }
+}

+ 96 - 0
inventory-system/src/main/java/com/ruoyi/system/service/impl/GoodsServiceImpl.java

@@ -0,0 +1,96 @@
+package com.ruoyi.system.service.impl;
+
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.system.domain.Goods;
+import com.ruoyi.system.mapper.GoodsMapper;
+import com.ruoyi.system.service.IGoodsService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * 物品Service业务层处理
+ *
+ * @date 2024-10-14
+ */
+@Service
+public class GoodsServiceImpl implements IGoodsService
+{
+    @Resource
+    private GoodsMapper goodsMapper;
+
+    /**
+     * 查询物品
+     *
+     * @param id 物品主键
+     * @return 物品
+     */
+    @Override
+    public Goods selectGoodsById(Long id)
+    {
+        return goodsMapper.selectGoodsById(id);
+    }
+
+    /**
+     * 查询物品列表
+     *
+     * @param goods 物品
+     * @return 物品
+     */
+    @Override
+    public List<Goods> selectGoodsList(Goods goods)
+    {
+        return goodsMapper.selectGoodsList(goods);
+    }
+
+    /**
+     * 新增物品
+     *
+     * @param goods 物品
+     * @return 结果
+     */
+    @Override
+    public int insertGoods(Goods goods)
+    {
+        goods.setCreateTime(DateUtils.getNowDate());
+        return goodsMapper.insertGoods(goods);
+    }
+
+    /**
+     * 修改物品
+     *
+     * @param goods 物品
+     * @return 结果
+     */
+    @Override
+    public int updateGoods(Goods goods)
+    {
+        goods.setUpdateTime(DateUtils.getNowDate());
+        return goodsMapper.updateGoods(goods);
+    }
+
+    /**
+     * 批量删除物品
+     *
+     * @param ids 需要删除的物品主键
+     * @return 结果
+     */
+    @Override
+    public int deleteGoodsByIds(Long[] ids)
+    {
+        return goodsMapper.deleteGoodsByIds(ids);
+    }
+
+    /**
+     * 删除物品信息
+     *
+     * @param id 物品主键
+     * @return 结果
+     */
+    @Override
+    public int deleteGoodsById(Long id)
+    {
+        return goodsMapper.deleteGoodsById(id);
+    }
+}

+ 96 - 0
inventory-system/src/main/resources/mapper/system/BillsDetailsMapper.xml

@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.system.mapper.BillsDetailsMapper">
+
+    <resultMap type="BillsDetails" id="BillsDetailsResult">
+        <result property="id"    column="id"    />
+        <result property="billsId"    column="bills_id"    />
+        <result property="goodsCode"    column="goods_code"    />
+        <result property="goodsNum"    column="goods_num"    />
+        <result property="goodsStatus"    column="goods_status"    />
+        <result property="goodsName"    column="goods_name"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectBillsDetailsVo">
+        select id, bills_id, goods_code, goods_num, goods_status, goods_name, create_by, create_time, update_by, update_time, remark from bills_details
+    </sql>
+
+    <select id="selectBillsDetailsList" parameterType="BillsDetails" resultMap="BillsDetailsResult">
+        <include refid="selectBillsDetailsVo"/>
+        <where>
+            <if test="billsId != null "> and bills_id = #{billsId}</if>
+            <if test="goodsCode != null  and goodsCode != ''"> and goods_code = #{goodsCode}</if>
+            <if test="goodsNum != null "> and goods_num = #{goodsNum}</if>
+            <if test="goodsStatus != null  and goodsStatus != ''"> and goods_status = #{goodsStatus}</if>
+            <if test="goodsName != null  and goodsName != ''"> and goods_name like concat('%', #{goodsName}, '%')</if>
+        </where>
+    </select>
+
+    <select id="selectBillsDetailsById" parameterType="Long" resultMap="BillsDetailsResult">
+        <include refid="selectBillsDetailsVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertBillsDetails" parameterType="BillsDetails" useGeneratedKeys="true" keyProperty="id">
+        insert into bills_details
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="billsId != null">bills_id,</if>
+            <if test="goodsCode != null">goods_code,</if>
+            <if test="goodsNum != null">goods_num,</if>
+            <if test="goodsStatus != null">goods_status,</if>
+            <if test="goodsName != null">goods_name,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="billsId != null">#{billsId},</if>
+            <if test="goodsCode != null">#{goodsCode},</if>
+            <if test="goodsNum != null">#{goodsNum},</if>
+            <if test="goodsStatus != null">#{goodsStatus},</if>
+            <if test="goodsName != null">#{goodsName},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+        </trim>
+    </insert>
+
+    <update id="updateBillsDetails" parameterType="BillsDetails">
+        update bills_details
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="billsId != null">bills_id = #{billsId},</if>
+            <if test="goodsCode != null">goods_code = #{goodsCode},</if>
+            <if test="goodsNum != null">goods_num = #{goodsNum},</if>
+            <if test="goodsStatus != null">goods_status = #{goodsStatus},</if>
+            <if test="goodsName != null">goods_name = #{goodsName},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteBillsDetailsById" parameterType="Long">
+        delete from bills_details where id = #{id}
+    </delete>
+
+    <delete id="deleteBillsDetailsByIds" parameterType="String">
+        delete from bills_details where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 99 - 0
inventory-system/src/main/resources/mapper/system/BillsMapper.xml

@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.system.mapper.BillsMapper">
+
+    <resultMap type="Bills" id="BillsResult">
+        <result property="id"    column="id"    />
+        <result property="billsType"    column="bills_type"    />
+        <result property="principal"    column="principal"    />
+        <result property="billsTime"    column="bills_time"    />
+        <result property="givePlace"    column="give_place"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="updateTime"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectBillsVo">
+        select id, bills_type, principal, bills_time, give_place, create_by, create_time, update_by, updateTime, remark from bills
+    </sql>
+
+    <select id="selectBillsList" parameterType="Bills" resultMap="BillsResult">
+        <include refid="selectBillsVo"/>
+        <where>
+            <if test="billsType != null  and billsType != ''"> and bills_type = #{billsType}</if>
+            <if test="principal != null  and principal != ''"> and principal like concat('%', #{principal}, '%')</if>
+            <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
+                and date_format(bills_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
+            </if>
+            <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
+                and date_format(bills_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
+            </if>
+            <if test="givePlace != null  and givePlace != ''">and give_place like concat('%', #{givePlace}, '%') </if>
+            <if test="updateTime != null "> and updateTime = #{updateTime}</if>
+        </where>
+    </select>
+
+    <select id="selectBillsById" parameterType="Long" resultMap="BillsResult">
+        <include refid="selectBillsVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertBills" parameterType="Bills">
+        insert into bills
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="billsType != null">bills_type,</if>
+            <if test="principal != null">principal,</if>
+            <if test="billsTime != null">bills_time,</if>
+            <if test="givePlace != null">give_place,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">updateTime,</if>
+            <if test="remark != null">remark,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="billsType != null">#{billsType},</if>
+            <if test="principal != null">#{principal},</if>
+            <if test="billsTime != null">#{billsTime},</if>
+            <if test="givePlace != null">#{givePlace},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+        </trim>
+    </insert>
+
+    <update id="updateBills" parameterType="Bills">
+        update bills
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="billsType != null">bills_type = #{billsType},</if>
+            <if test="principal != null">principal = #{principal},</if>
+            <if test="billsTime != null">bills_time = #{billsTime},</if>
+            <if test="givePlace != null">give_place = #{givePlace},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">updateTime = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteBillsById" parameterType="Long">
+        delete from bills where id = #{id}
+    </delete>
+
+    <delete id="deleteBillsByIds" parameterType="String">
+        delete from bills where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 108 - 0
inventory-system/src/main/resources/mapper/system/GoodsMapper.xml

@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.system.mapper.GoodsMapper">
+
+    <resultMap type="Goods" id="GoodsResult">
+        <result property="id"    column="id"    />
+        <result property="goodsCode"    column="goods_code"    />
+        <result property="goodsName"    column="goods_name"    />
+        <result property="goodsType"    column="goods_type"    />
+        <result property="quantityStock"    column="quantity_stock"    />
+        <result property="goodsStatus"    column="goods_status"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectGoodsVo">
+        select id, goods_code, goods_name, goods_type, quantity_stock, goods_status, create_by, create_time, update_by, update_time, remark from goods
+    </sql>
+
+    <select id="selectGoodsList" parameterType="Goods" resultMap="GoodsResult">
+        <include refid="selectGoodsVo"/>
+        <where>
+            <if test="goodsCode != null  and goodsCode != ''"> and goods_code like concat('%', #{goodsCode}, '%')</if>
+            <if test="goodsName != null  and goodsName != ''"> and goods_name like concat('%', #{goodsName}, '%')</if>
+            <if test="goodsType != null  and goodsType != ''"> and goods_type = #{goodsType}</if>
+            <if test="quantityStock != null "> and quantity_stock = #{quantityStock}</if>
+            <if test="goodsStatus != null "> and goods_status = #{goodsStatus}</if>
+        </where>
+    </select>
+
+    <select id="selectGoodsById" parameterType="Long" resultMap="GoodsResult">
+        <include refid="selectGoodsVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertGoods" parameterType="Goods">
+        insert into goods
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="goodsCode != null">goods_code,</if>
+            <if test="goodsName != null">goods_name,</if>
+            <if test="goodsType != null">goods_type,</if>
+            <if test="quantityStock != null">quantity_stock,</if>
+            <if test="goodsStatus != null">goods_status,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="goodsCode != null">#{goodsCode},</if>
+            <if test="goodsName != null">#{goodsName},</if>
+            <if test="goodsType != null">#{goodsType},</if>
+            <if test="quantityStock != null">#{quantityStock},</if>
+            <if test="goodsStatus != null">#{goodsStatus},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+        </trim>
+    </insert>
+
+    <update id="updateGoods" parameterType="Goods">
+        update goods
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="goodsCode != null">goods_code = #{goodsCode},</if>
+            <if test="goodsName != null">goods_name = #{goodsName},</if>
+            <if test="goodsType != null">goods_type = #{goodsType},</if>
+            <if test="quantityStock != null">quantity_stock = #{quantityStock},</if>
+            <if test="goodsStatus != null">goods_status = #{goodsStatus},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteGoodsById" parameterType="Long">
+        delete from goods where id = #{id}
+    </delete>
+
+    <delete id="deleteGoodsByIds" parameterType="String">
+        delete from goods where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+    
+    <select id="selectGoodsIds" parameterType="Goods" resultMap="GoodsResult">
+        <include refid="selectGoodsVo"/>
+        where id in
+        <foreach collection="ids" item="id" index="index" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+
+    </select>
+
+</mapper>

+ 1 - 1
inventory-ui/vue.config.js

@@ -35,7 +35,7 @@ module.exports = {
     proxy: {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
-        target: `http://localhost:8080`,
+        target: `http://localhost:8088`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''