From 7ef9e16de086e2eaa7ef0632dcbcb355ed50decc Mon Sep 17 00:00:00 2001 From: xins Date: Wed, 22 May 2024 13:57:00 +0800 Subject: [PATCH] =?UTF-8?q?2.2.7=20WMS=EF=BC=9A=201=E3=80=81=E4=BB=93?= =?UTF-8?q?=E5=BA=93=E7=B1=BB=E5=88=AB=E5=A2=9E=E5=88=A0=E6=94=B9=E6=9F=A5?= =?UTF-8?q?=202=E3=80=81=E5=8E=9F=E6=9D=90=E6=96=99=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/WmsRawInstockController.java | 22 +- .../java/com/hw/wms/domain/WmsRawInstock.java | 22 ++ .../hw/wms/mapper/WmsRawInstockMapper.java | 8 + .../impl/WmsBaseCategoryServiceImpl.java | 50 +-- .../impl/WmsRawInstockServiceImpl.java | 2 +- .../mapper/wms/WmsRawInstockMapper.xml | 30 ++ .../src/views/wms/base/wmscategory/index.vue | 285 ++++++++++++++++++ hw-ui/src/views/wms/info/rawinstock/index.vue | 260 ++++++++++++++++ 8 files changed, 656 insertions(+), 23 deletions(-) create mode 100644 hw-ui/src/views/wms/base/wmscategory/index.vue create mode 100644 hw-ui/src/views/wms/info/rawinstock/index.vue diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsRawInstockController.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsRawInstockController.java index ea8f5ae..a1694b7 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsRawInstockController.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsRawInstockController.java @@ -3,6 +3,10 @@ package com.hw.wms.controller; import java.util.List; import java.io.IOException; import javax.servlet.http.HttpServletResponse; + +import com.hw.common.core.constant.WmsConstants; +import com.hw.wms.domain.WmsBaseWarehouse; +import com.hw.wms.service.IWmsBaseWarehouseService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -24,7 +28,7 @@ import com.hw.common.core.web.page.TableDataInfo; /** * 原材料入库记录Controller - * + * * @author xs * @date 2023-12-20 */ @@ -35,6 +39,9 @@ public class WmsRawInstockController extends BaseController @Autowired private IWmsRawInstockService wmsRawInstockService; + @Autowired + private IWmsBaseWarehouseService wmsBaseWarehouseService; + /** * 查询原材料入库记录列表 */ @@ -102,4 +109,17 @@ public class WmsRawInstockController extends BaseController { return toAjax(wmsRawInstockService.deleteWmsRawInstockByRawInstockIds(rawInstockIds)); } + + + + /** + * 获取仓库列表 + */ + @RequiresPermissions("wms:rawinstock:query") + @GetMapping(value = "/getRawWarehouses") + public AjaxResult getRawWarehouses(WmsBaseWarehouse wmsBaseWarehouse) + { + wmsBaseWarehouse.setWarehouseInstockType(WmsConstants.WMS_WAREHOUSE_INSTOCK_TYPE_RAW); + return success(wmsBaseWarehouseService.selectWmsBaseWarehouseList(wmsBaseWarehouse)); + } } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsRawInstock.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsRawInstock.java index e8a3823..de5000e 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsRawInstock.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsRawInstock.java @@ -109,6 +109,12 @@ public class WmsRawInstock extends BaseEntity @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd") private Date endTime; + + private String materialCode; + + private String materialName; + + public void setRawInstockId(Long rawInstockId) { this.rawInstockId = rawInstockId; @@ -308,6 +314,22 @@ public class WmsRawInstock extends BaseEntity return endTime; } + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsRawInstockMapper.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsRawInstockMapper.java index 7a6a870..81913d3 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsRawInstockMapper.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsRawInstockMapper.java @@ -69,4 +69,12 @@ public interface WmsRawInstockMapper * @return 原材料入库记录 */ public WmsRawInstock selectWmsRawInstockByBarcode(String materialBarcode); + + /** + * 查询原材料入库记录列表,Join material + * + * @param wmsRawInstock 原材料入库记录 + * @return 原材料入库记录集合 + */ + public List selectWmsRawInstockJoinList(WmsRawInstock wmsRawInstock); } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsBaseCategoryServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsBaseCategoryServiceImpl.java index 4aa42fa..7cf7423 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsBaseCategoryServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsBaseCategoryServiceImpl.java @@ -1,7 +1,11 @@ package com.hw.wms.service.impl; import java.util.List; + +import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; +import com.hw.wms.domain.WmsBaseWarehouse; +import com.hw.wms.mapper.WmsBaseWarehouseMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.hw.wms.mapper.WmsBaseCategoryMapper; @@ -10,87 +14,91 @@ import com.hw.wms.service.IWmsBaseCategoryService; /** * 仓库类别Service业务层处理 - * + * * @author xs * @date 2023-12-20 */ @Service -public class WmsBaseCategoryServiceImpl implements IWmsBaseCategoryService -{ +public class WmsBaseCategoryServiceImpl implements IWmsBaseCategoryService { @Autowired private WmsBaseCategoryMapper wmsBaseCategoryMapper; + @Autowired + private WmsBaseWarehouseMapper wmsBaseWarehouseMapper; + /** * 查询仓库类别 - * + * * @param categoryId 仓库类别主键 * @return 仓库类别 */ @Override - public WmsBaseCategory selectWmsBaseCategoryByCategoryId(Long categoryId) - { + public WmsBaseCategory selectWmsBaseCategoryByCategoryId(Long categoryId) { return wmsBaseCategoryMapper.selectWmsBaseCategoryByCategoryId(categoryId); } /** * 查询仓库类别列表 - * + * * @param wmsBaseCategory 仓库类别 * @return 仓库类别 */ @Override - public List selectWmsBaseCategoryList(WmsBaseCategory wmsBaseCategory) - { + public List selectWmsBaseCategoryList(WmsBaseCategory wmsBaseCategory) { return wmsBaseCategoryMapper.selectWmsBaseCategoryList(wmsBaseCategory); } /** * 新增仓库类别 - * + * * @param wmsBaseCategory 仓库类别 * @return 结果 */ @Override - public int insertWmsBaseCategory(WmsBaseCategory wmsBaseCategory) - { + public int insertWmsBaseCategory(WmsBaseCategory wmsBaseCategory) { wmsBaseCategory.setCreateTime(DateUtils.getNowDate()); return wmsBaseCategoryMapper.insertWmsBaseCategory(wmsBaseCategory); } /** * 修改仓库类别 - * + * * @param wmsBaseCategory 仓库类别 * @return 结果 */ @Override - public int updateWmsBaseCategory(WmsBaseCategory wmsBaseCategory) - { + public int updateWmsBaseCategory(WmsBaseCategory wmsBaseCategory) { wmsBaseCategory.setUpdateTime(DateUtils.getNowDate()); return wmsBaseCategoryMapper.updateWmsBaseCategory(wmsBaseCategory); } /** * 批量删除仓库类别 - * + * * @param categoryIds 需要删除的仓库类别主键 * @return 结果 */ @Override - public int deleteWmsBaseCategoryByCategoryIds(Long[] categoryIds) - { + public int deleteWmsBaseCategoryByCategoryIds(Long[] categoryIds) { + for (Long categoryId : categoryIds) { + WmsBaseWarehouse queryWarehouse = new WmsBaseWarehouse(); + queryWarehouse.setWarehouseCategoryId(categoryId); + List baseWarehouses = wmsBaseWarehouseMapper.selectWmsBaseWarehouseList(queryWarehouse); + if (baseWarehouses != null && !baseWarehouses.isEmpty()) { + throw new ServiceException("仓库ID[" + categoryId + "]已经被仓库引用,不能删除"); + } + } return wmsBaseCategoryMapper.deleteWmsBaseCategoryByCategoryIds(categoryIds); } /** * 删除仓库类别信息 - * + * * @param categoryId 仓库类别主键 * @return 结果 */ @Override - public int deleteWmsBaseCategoryByCategoryId(Long categoryId) - { + public int deleteWmsBaseCategoryByCategoryId(Long categoryId) { return wmsBaseCategoryMapper.deleteWmsBaseCategoryByCategoryId(categoryId); } } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawInstockServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawInstockServiceImpl.java index 1606550..ab76866 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawInstockServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawInstockServiceImpl.java @@ -70,7 +70,7 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService { */ @Override public List selectWmsRawInstockList(WmsRawInstock wmsRawInstock) { - return wmsRawInstockMapper.selectWmsRawInstockList(wmsRawInstock); + return wmsRawInstockMapper.selectWmsRawInstockJoinList(wmsRawInstock); } diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawInstockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawInstockMapper.xml index 4ce6a8c..1b6051a 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawInstockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawInstockMapper.xml @@ -29,6 +29,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + @@ -161,4 +164,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where material_barcode = #{materialBarcode} + + + + diff --git a/hw-ui/src/views/wms/base/wmscategory/index.vue b/hw-ui/src/views/wms/base/wmscategory/index.vue new file mode 100644 index 0000000..7dfe5d8 --- /dev/null +++ b/hw-ui/src/views/wms/base/wmscategory/index.vue @@ -0,0 +1,285 @@ + + + diff --git a/hw-ui/src/views/wms/info/rawinstock/index.vue b/hw-ui/src/views/wms/info/rawinstock/index.vue new file mode 100644 index 0000000..4aa564c --- /dev/null +++ b/hw-ui/src/views/wms/info/rawinstock/index.vue @@ -0,0 +1,260 @@ + + +