WMS:
1、仓库类别增删改查
2、原材料入库记录查询
master
xins 6 months ago
parent 9df4e92923
commit 7ef9e16de0

@ -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;
@ -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));
}
}

@ -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)

@ -69,4 +69,12 @@ public interface WmsRawInstockMapper
* @return
*/
public WmsRawInstock selectWmsRawInstockByBarcode(String materialBarcode);
/**
* Join material
*
* @param wmsRawInstock
* @return
*/
public List<WmsRawInstock> selectWmsRawInstockJoinList(WmsRawInstock wmsRawInstock);
}

@ -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;
@ -15,11 +19,13 @@ import com.hw.wms.service.IWmsBaseCategoryService;
* @date 2023-12-20
*/
@Service
public class WmsBaseCategoryServiceImpl implements IWmsBaseCategoryService
{
public class WmsBaseCategoryServiceImpl implements IWmsBaseCategoryService {
@Autowired
private WmsBaseCategoryMapper wmsBaseCategoryMapper;
@Autowired
private WmsBaseWarehouseMapper wmsBaseWarehouseMapper;
/**
*
*
@ -27,8 +33,7 @@ public class WmsBaseCategoryServiceImpl implements IWmsBaseCategoryService
* @return
*/
@Override
public WmsBaseCategory selectWmsBaseCategoryByCategoryId(Long categoryId)
{
public WmsBaseCategory selectWmsBaseCategoryByCategoryId(Long categoryId) {
return wmsBaseCategoryMapper.selectWmsBaseCategoryByCategoryId(categoryId);
}
@ -39,8 +44,7 @@ public class WmsBaseCategoryServiceImpl implements IWmsBaseCategoryService
* @return
*/
@Override
public List<WmsBaseCategory> selectWmsBaseCategoryList(WmsBaseCategory wmsBaseCategory)
{
public List<WmsBaseCategory> selectWmsBaseCategoryList(WmsBaseCategory wmsBaseCategory) {
return wmsBaseCategoryMapper.selectWmsBaseCategoryList(wmsBaseCategory);
}
@ -51,8 +55,7 @@ public class WmsBaseCategoryServiceImpl implements IWmsBaseCategoryService
* @return
*/
@Override
public int insertWmsBaseCategory(WmsBaseCategory wmsBaseCategory)
{
public int insertWmsBaseCategory(WmsBaseCategory wmsBaseCategory) {
wmsBaseCategory.setCreateTime(DateUtils.getNowDate());
return wmsBaseCategoryMapper.insertWmsBaseCategory(wmsBaseCategory);
}
@ -64,8 +67,7 @@ public class WmsBaseCategoryServiceImpl implements IWmsBaseCategoryService
* @return
*/
@Override
public int updateWmsBaseCategory(WmsBaseCategory wmsBaseCategory)
{
public int updateWmsBaseCategory(WmsBaseCategory wmsBaseCategory) {
wmsBaseCategory.setUpdateTime(DateUtils.getNowDate());
return wmsBaseCategoryMapper.updateWmsBaseCategory(wmsBaseCategory);
}
@ -77,8 +79,15 @@ public class WmsBaseCategoryServiceImpl implements IWmsBaseCategoryService
* @return
*/
@Override
public int deleteWmsBaseCategoryByCategoryIds(Long[] categoryIds)
{
public int deleteWmsBaseCategoryByCategoryIds(Long[] categoryIds) {
for (Long categoryId : categoryIds) {
WmsBaseWarehouse queryWarehouse = new WmsBaseWarehouse();
queryWarehouse.setWarehouseCategoryId(categoryId);
List<WmsBaseWarehouse> baseWarehouses = wmsBaseWarehouseMapper.selectWmsBaseWarehouseList(queryWarehouse);
if (baseWarehouses != null && !baseWarehouses.isEmpty()) {
throw new ServiceException("仓库ID[" + categoryId + "]已经被仓库引用,不能删除");
}
}
return wmsBaseCategoryMapper.deleteWmsBaseCategoryByCategoryIds(categoryIds);
}
@ -89,8 +98,7 @@ public class WmsBaseCategoryServiceImpl implements IWmsBaseCategoryService
* @return
*/
@Override
public int deleteWmsBaseCategoryByCategoryId(Long categoryId)
{
public int deleteWmsBaseCategoryByCategoryId(Long categoryId) {
return wmsBaseCategoryMapper.deleteWmsBaseCategoryByCategoryId(categoryId);
}
}

@ -70,7 +70,7 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
*/
@Override
public List<WmsRawInstock> selectWmsRawInstockList(WmsRawInstock wmsRawInstock) {
return wmsRawInstockMapper.selectWmsRawInstockList(wmsRawInstock);
return wmsRawInstockMapper.selectWmsRawInstockJoinList(wmsRawInstock);
}

@ -29,6 +29,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="beginTime" column="begin_time" />
<result property="endTime" column="end_time" />
<result property="rawReturnId" column="raw_return_id" />
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
</resultMap>
<sql id="selectWmsRawInstockVo">
@ -161,4 +164,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where material_barcode = #{materialBarcode}
</select>
<select id="selectWmsRawInstockJoinList" parameterType="WmsRawInstock" resultMap="WmsRawInstockResult">
select wri.task_code, wri.warehouse_id, wri.location_code, wri.po_no, wri.operation_type, wri.instock_type, wri.material_id,
wri.material_barcode, wri.material_batch_code, wri.pallet_info_code, wri.instock_amount, wri.execute_status,
wri.erp_status, wri.erp_amount, wri.apply_by, wri.apply_date, wri.machine_name, wri.quality_status, wri.update_by, wri.update_date,
wri.begin_time, wri.end_time,mbmi.material_code,mbmi.material_name
from wms_raw_instock wri left join mes_base_material_info mbmi on wri.material_id=mbmi.material_id
<where>
<if test="taskCode != null and taskCode != ''"> and wri.task_code = #{taskCode}</if>
<if test="warehouseId != null "> and wri.warehouse_id = #{warehouseId}</if>
<if test="materialBarcode != null and materialBarcode != ''"> and wri.material_barcode like concat('%', #{materialBarcode}, '%')</if>
<if test="palletInfoCode != null and palletInfoCode != ''"> and wri.pallet_info_code like concat('%', #{palletInfoCode}, '%')</if>
<if test="locationCode != null and locationCode != ''"> and wri.location_code = #{locationCode}</if>
<if test="poNo != null and poNo != ''"> and wri.po_no like concat('%', #{poNo}, '%')</if>
<if test="operationType != null and operationType != ''"> and wri.operation_type = #{operationType}</if>
<if test="instockType != null and instockType != ''"> and wri.instock_type = #{instockType}</if>
<if test="executeStatus != null and executeStatus != ''"> and wri.execute_status = #{executeStatus}</if>
<if test="applyBy != null and applyBy != ''"> and wri.apply_by like concat('%', #{applyBy}, '%')</if>
<if test="materialCode != null and materialCode != ''"> and mbmi.material_code like concat('%', #{materialCode}, '%')</if>
<if test="materialName != null and materialName != ''"> and mbmi.material_name like concat('%', #{materialName}, '%')</if>
</where>
</select>
</mapper>

@ -0,0 +1,285 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="108px">
<el-form-item label="仓库类别名称" prop="categoryName">
<el-input
v-model="queryParams.categoryName"
placeholder="请输入仓库类别名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="虚拟标识" prop="virtualFlag">
<el-select
v-model="queryParams.virtualFlag"
placeholder="请选择虚拟标识"
clearable
>
<el-option
v-for="dict in dict.type.wms_category_virtual_flag"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['wms:wmscategory:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['wms:wmscategory:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['wms:wmscategory:remove']"
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="wmscategoryList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="仓库类别ID" align="center" prop="categoryId" />
<el-table-column label="仓库类别名称" align="center" prop="categoryName" />
<el-table-column label="虚拟标识" align="center" prop="virtualFlag" >
<template slot-scope="scope">
<dict-tag :options="dict.type.wms_category_virtual_flag" :value="scope.row.virtualFlag"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['wms:wmscategory:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['wms:wmscategory:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改仓库类别对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="仓库类别名称" prop="categoryName">
<el-input v-model="form.categoryName" placeholder="请输入仓库类别名称" />
</el-form-item>
<el-form-item label="虚拟标识" prop="virtualFlag">
<el-radio-group v-model="form.virtualFlag">
<el-radio
v-for="dict in dict.type.wms_category_virtual_flag"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listWmscategory, getWmscategory, delWmscategory, addWmscategory, updateWmscategory } from "@/api/wms/wmscategory";
export default {
name: "Wmscategory",
dicts: ['wms_category_virtual_flag'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
wmscategoryList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
categoryName: null,
virtualFlag: null,
},
//
form: {},
//
rules: {
categoryName: [
{ required: true, message: "仓库类别名称不能为空", trigger: "blur" }
],
virtualFlag: [
{ required: true, message: "虚拟标识(0否,1是)不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询仓库类别列表 */
getList() {
this.loading = true;
listWmscategory(this.queryParams).then(response => {
this.wmscategoryList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
categoryId: null,
categoryName: null,
virtualFlag: null,
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.categoryId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加仓库类别";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const categoryId = row.categoryId || this.ids
getWmscategory(categoryId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改仓库类别";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.categoryId != null) {
updateWmscategory(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addWmscategory(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const categoryIds = row.categoryId || this.ids;
this.$modal.confirm('是否确认删除仓库类别ID为"' + categoryIds + '"的数据项?').then(function() {
return delWmscategory(categoryIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('wms/wmscategory/export', {
...this.queryParams
}, `wmscategory_${new Date().getTime()}.xlsx`)
}
}
};
</script>

@ -0,0 +1,260 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="任务编号" prop="taskCode">
<el-input
v-model="queryParams.taskCode"
placeholder="请输入任务编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="仓库" prop="warehouseId">
<el-select v-model="queryParams.warehouseId" placeholder="请选择仓库" clearable>
<el-option
v-for="(category, index) in warehouseOptions"
:key="index"
:label="category.warehouseName"
:value="category.warehouseId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="库位编码" prop="locationCode">
<el-input
v-model="queryParams.locationCode"
placeholder="请输入库位编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="采购订单" prop="poNo">
<el-input
v-model="queryParams.poNo"
placeholder="请输入采购订单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料编码" prop="materialCode">
<el-input
v-model="queryParams.materialCode"
placeholder="请输入物料编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料名称" prop="materialName">
<el-input
v-model="queryParams.materialName"
placeholder="请输入物料名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料条码" prop="materialBarcode">
<el-input
v-model="queryParams.materialBarcode"
placeholder="请输入物料条码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="托盘编码" prop="palletInfoCode">
<el-input
v-model="queryParams.palletInfoCode"
placeholder="请输入托盘编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="入库人" prop="applyBy">
<el-input
v-model="queryParams.applyBy"
placeholder="请输入入库人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="rawinstockList">
<el-table-column label="任务编号" align="center" prop="taskCode" />
<el-table-column label="仓库" align="center" prop="warehouseId" >
<template slot-scope="scope">
<span
v-for="(item, index) in warehouseOptions"
:key="index"
:value="item.warehouseOptions"
v-if="scope.row.warehouseId == item.warehouseId"
>
{{ item.warehouseName }}
</span>
</template>
</el-table-column>
<el-table-column label="库位编码" align="center" prop="locationCode" />
<el-table-column label="采购订单号" align="center" prop="poNo" />
<el-table-column label="操作类型" align="center" prop="operationType" >
<template slot-scope="scope">
<dict-tag :options="dict.type.wms_operation_type" :value="scope.row.operationType"/>
</template>
</el-table-column>
<el-table-column label="入库类型" align="center" prop="instockType" >
<template slot-scope="scope">
<dict-tag :options="dict.type.wms_instock_type" :value="scope.row.instockType"/>
</template>
</el-table-column>
<el-table-column label="物料编码" align="center" prop="materialCode" />
<el-table-column label="物料名称" align="center" prop="materialName" />
<el-table-column label="物料条码" align="center" prop="materialBarcode" />
<el-table-column label="批次条码" align="center" prop="materialBatchCode" />
<el-table-column label="托盘编码" align="center" prop="palletInfoCode" />
<el-table-column label="入库数量" align="center" prop="instockAmount" />
<el-table-column label="执行状态" align="center" prop="executeStatus" >
<template slot-scope="scope">
<dict-tag :options="dict.type.wms_execute_status" :value="scope.row.executeStatus"/>
</template>
</el-table-column>
<el-table-column label="同步ERP状态" align="center" prop="erpStatus" >
<template slot-scope="scope">
<dict-tag :options="dict.type.wms_erp_status" :value="scope.row.erpStatus"/>
</template>
</el-table-column>
<el-table-column label="同步ERP数量" align="center" prop="erpAmount" />
<el-table-column label="入库人" align="center" prop="applyBy" />
<el-table-column label="入库时间" align="center" prop="applyDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.applyDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<!--el-table-column label="质检状态(0:待质检,1:合格,2:NG)" align="center" prop="qualityStatus" /-->
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { listRawinstock, getRawWarehouses } from "@/api/wms/rawinstock";
export default {
name: "Rawinstock",
dicts: ["wms_operation_type","wms_instock_type","wms_execute_status","wms_erp_status"],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
rawinstockList: [],
//
warehouseOptions: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
taskCode: null,
warehouseId: null,
locationCode: null,
poNo: null,
operationType: null,
instockType: null,
materialCode: null,
materialName: null,
materialBarcode: null,
materialBatchCode: null,
palletInfoCode: null,
instockAmount: null,
executeStatus: null,
erpStatus: null,
erpAmount: null,
applyBy: null,
applyDate: null,
machineName: null,
qualityStatus: null,
updateDate: null,
beginTime: null,
endTime: null,
rawReturnId: null
},
};
},
created() {
this.getList();
this.getRawWarehouses();
},
methods: {
/** 查询原材料入库记录列表 */
getList() {
this.loading = true;
listRawinstock(this.queryParams).then(response => {
this.rawinstockList = response.rows;
this.total = response.total;
this.loading = false;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.rawInstockId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 导出按钮操作 */
handleExport() {
this.download('wms/rawinstock/export', {
...this.queryParams
}, `rawinstock_${new Date().getTime()}.xlsx`)
},
/** 查询仓库类别 */
getRawWarehouses() {
getRawWarehouses().then(response => {
this.warehouseOptions = response.data;
});
},
}
};
</script>
Loading…
Cancel
Save