forked from BaoKaiWms/202501-Wms-Kate-Wuxi
1. 修复一些bug
2. 增加盘点功能
This commit is contained in:
parent
89099c5fcb
commit
f60c8c6295
|
|
@ -39,3 +39,27 @@ export const confirmCurrentTask = (params) => {
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 请求盘点
|
||||||
|
export const requestInventory = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/task/requestInventory',
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 获取盘点信息
|
||||||
|
export const getInventoryConfirm = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/task/getInventoryConfirm',
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 确认盘点信息
|
||||||
|
export const confirmInventory = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/task/confirmInventory',
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -30,13 +30,16 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-button type="success"
|
<el-button type="success"
|
||||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||||
@click="confirmBinding()">绑定物料</el-button>
|
@click="confirmBinding()">绑定物料
|
||||||
|
</el-button>
|
||||||
<el-button type="warning"
|
<el-button type="warning"
|
||||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||||
@click="clearInput()">清除输入</el-button>
|
@click="clearInput()">清除输入
|
||||||
|
</el-button>
|
||||||
<el-button type="primary"
|
<el-button type="primary"
|
||||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||||
@click="openOutForInDialog()">入库料扫码</el-button>
|
@click="openOutForInDialog()">入库料扫码
|
||||||
|
</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
@ -57,10 +60,12 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-button type="success" ref="sendTaskRef"
|
<el-button type="success" ref="sendTaskRef"
|
||||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||||
@click="confirmTasks()">下发任务</el-button>
|
@click="confirmTasks()">下发任务
|
||||||
|
</el-button>
|
||||||
<el-button type="danger"
|
<el-button type="danger"
|
||||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||||
@click="cancelBinding()">取消绑定</el-button>
|
@click="cancelBinding()">取消绑定
|
||||||
|
</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
@ -91,7 +96,8 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-button type="success"
|
<el-button type="success"
|
||||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||||
@click="addForInGoods()">添加物料</el-button>
|
@click="addForInGoods()">添加物料
|
||||||
|
</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
@ -100,7 +106,8 @@
|
||||||
<div style="display: flex; justify-content: space-between;">
|
<div style="display: flex; justify-content: space-between;">
|
||||||
<el-button type="success"
|
<el-button type="success"
|
||||||
style="height: 50px; width: 100px; margin: auto 5px auto auto; font-size: large; color: black;"
|
style="height: 50px; width: 100px; margin: auto 5px auto auto; font-size: large; color: black;"
|
||||||
@click="confirmCallVehicles()">确认需求</el-button>
|
@click="confirmCallVehicles()">确认需求
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-table ref="outForInTableRef" :data="outForInRequestEntity.goodsIds" stripe border
|
<el-table ref="outForInTableRef" :data="outForInRequestEntity.goodsIds" stripe border
|
||||||
class="table-class" max-height="200px" :header-cell-style="{ 'text-align': 'center' }"
|
class="table-class" max-height="200px" :header-cell-style="{ 'text-align': 'center' }"
|
||||||
|
|
@ -128,6 +135,7 @@ import { nextTick, onMounted, reactive, ref } from 'vue'
|
||||||
import {loading} from '@/utils/loading.js'
|
import {loading} from '@/utils/loading.js'
|
||||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
import {labelPosition} from '@/constant/form'
|
import {labelPosition} from '@/constant/form'
|
||||||
|
|
||||||
const inTypeOptions = [
|
const inTypeOptions = [
|
||||||
{
|
{
|
||||||
label: '空箱入库',
|
label: '空箱入库',
|
||||||
|
|
@ -196,8 +204,8 @@ const handleEnter = () => {
|
||||||
// 改变输入焦点
|
// 改变输入焦点
|
||||||
const changeFocus = () => {
|
const changeFocus = () => {
|
||||||
// 进行大写格式化
|
// 进行大写格式化
|
||||||
inTaskEntity.vehicleId = inTaskEntity.vehicleId.toUpperCase()
|
inTaskEntity.vehicleId = inTaskEntity.vehicleId.toUpperCase().trim()
|
||||||
inTaskEntity.goodsId = inTaskEntity.goodsId.toUpperCase()
|
inTaskEntity.goodsId = inTaskEntity.goodsId.toUpperCase().trim()
|
||||||
if (inTaskEntity.vehicleId == '') {
|
if (inTaskEntity.vehicleId == '') {
|
||||||
vehicleId.value.focus()
|
vehicleId.value.focus()
|
||||||
return
|
return
|
||||||
|
|
@ -274,8 +282,35 @@ const clearInput = () => {
|
||||||
}
|
}
|
||||||
// 绑定前确认
|
// 绑定前确认
|
||||||
const confirmBinding = () => {
|
const confirmBinding = () => {
|
||||||
|
// 进行大写格式化
|
||||||
|
inTaskEntity.vehicleId = inTaskEntity.vehicleId.toUpperCase().trim()
|
||||||
|
inTaskEntity.goodsId = inTaskEntity.goodsId.toUpperCase().trim()
|
||||||
// 判断是否是非空箱入库时,未输入料号和数量
|
// 判断是否是非空箱入库时,未输入料号和数量
|
||||||
if (!inTaskEntity.emptyTask && inTaskEntity.goodsId == '') {
|
if (!inTaskEntity.emptyTask && inTaskEntity.goodsId == '' && inTaskEntity.vehicleId != '') {
|
||||||
|
if (inTaskEntity.vehicleId == '') {
|
||||||
|
ElMessage.error("请输入箱号。")
|
||||||
|
vehicleId.value.focus()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 进行格式判断
|
||||||
|
if (inTaskEntity.vehicleId != '') {
|
||||||
|
const vehicleArray = inTaskEntity.vehicleId.split('-')
|
||||||
|
if (vehicleArray.length != 2) {
|
||||||
|
errorBox('箱号格式不正确,正确格式为“ASRS-XXXX”。')
|
||||||
|
vehicleId.value.focus()
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
if (vehicleArray[0] != 'ASRS' || !numberCheck(vehicleArray[1]) || vehicleArray[1].length != 4) {
|
||||||
|
errorBox('箱号格式不正确,正确格式为“ASRS-XXXX”。')
|
||||||
|
vehicleId.value.focus()
|
||||||
|
return
|
||||||
|
} else if (parseInt(vehicleArray[1]) < 1 || parseInt(vehicleArray[1]) > 2200) {
|
||||||
|
errorBox('箱号范围是0001~2200。')
|
||||||
|
vehicleId.value.focus()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
ElMessageBox.confirm(
|
ElMessageBox.confirm(
|
||||||
'非空箱入库未输入料号。\n是否继续绑定',
|
'非空箱入库未输入料号。\n是否继续绑定',
|
||||||
'警告',
|
'警告',
|
||||||
|
|
@ -309,7 +344,7 @@ const addBinding = () => {
|
||||||
if (inTaskEntity.goodsId != '' && inTaskEntity.opNum != null && inTaskEntity.opNum > 0) {
|
if (inTaskEntity.goodsId != '' && inTaskEntity.opNum != null && inTaskEntity.opNum > 0) {
|
||||||
// 非空入库
|
// 非空入库
|
||||||
taskRequestEntity.goodsInfo.push({
|
taskRequestEntity.goodsInfo.push({
|
||||||
goodsId: inTaskEntity.goodsId,
|
goodsId: inTaskEntity.goodsId.trim().toUpperCase(),
|
||||||
opNum: inTaskEntity.opNum
|
opNum: inTaskEntity.opNum
|
||||||
})
|
})
|
||||||
inTaskEntity.goodsId = ''
|
inTaskEntity.goodsId = ''
|
||||||
|
|
@ -318,7 +353,7 @@ const addBinding = () => {
|
||||||
}
|
}
|
||||||
// 添加任务
|
// 添加任务
|
||||||
taskRequestEntity.emptyTask = inTaskEntity.emptyTask
|
taskRequestEntity.emptyTask = inTaskEntity.emptyTask
|
||||||
taskRequestEntity.vehicleId = inTaskEntity.vehicleId
|
taskRequestEntity.vehicleId = inTaskEntity.vehicleId.trim().toUpperCase()
|
||||||
} else {
|
} else {
|
||||||
if (!taskRequestEntity.emptyTask) {
|
if (!taskRequestEntity.emptyTask) {
|
||||||
if (inTaskEntity.goodsId == '') {
|
if (inTaskEntity.goodsId == '') {
|
||||||
|
|
@ -333,7 +368,7 @@ const addBinding = () => {
|
||||||
}
|
}
|
||||||
// 非空入库
|
// 非空入库
|
||||||
taskRequestEntity.goodsInfo.push({
|
taskRequestEntity.goodsInfo.push({
|
||||||
goodsId: inTaskEntity.goodsId,
|
goodsId: inTaskEntity.goodsId.trim().toUpperCase(),
|
||||||
opNum: inTaskEntity.opNum
|
opNum: inTaskEntity.opNum
|
||||||
})
|
})
|
||||||
inTaskEntity.goodsId = ''
|
inTaskEntity.goodsId = ''
|
||||||
|
|
@ -418,6 +453,7 @@ const openOutForInDialog = () => {
|
||||||
}
|
}
|
||||||
// 添加入库料
|
// 添加入库料
|
||||||
const addForInGoods = () => {
|
const addForInGoods = () => {
|
||||||
|
outForInEntity.goodsId = outForInEntity.goodsId.trim()
|
||||||
if (outForInEntity.goodsId == '') {
|
if (outForInEntity.goodsId == '') {
|
||||||
errorBox('请输入料号。')
|
errorBox('请输入料号。')
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -478,27 +514,25 @@ const confirmCallVehicles = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-area {
|
.main-area {
|
||||||
margin: auto;
|
|
||||||
min-height: fit-content;
|
min-height: fit-content;
|
||||||
max-height: 90%;
|
max-height: 90%;
|
||||||
margin-bottom: 10px;
|
margin: auto auto 10px;
|
||||||
min-width: inherit;
|
min-width: inherit;
|
||||||
border: solid 1px;
|
border: solid 1px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
box-shadow: 0px 15px 10px -15px #000;
|
box-shadow: 0 15px 10px -15px #000;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.confirm-area {
|
.confirm-area {
|
||||||
margin: auto;
|
|
||||||
min-height: fit-content;
|
min-height: fit-content;
|
||||||
max-height: 90%;
|
max-height: 90%;
|
||||||
margin-bottom: 10px;
|
margin: auto auto 10px;
|
||||||
min-width: inherit;
|
min-width: inherit;
|
||||||
border: solid 1px;
|
border: solid 1px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
box-shadow: 0px 15px 10px -15px #000;
|
box-shadow: 0 15px 10px -15px #000;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
@ -511,7 +545,7 @@ const confirmCallVehicles = () => {
|
||||||
min-width: inherit;
|
min-width: inherit;
|
||||||
border: solid 1px;
|
border: solid 1px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
box-shadow: 0px 15px 10px -15px #000;
|
box-shadow: 0 15px 10px -15px #000;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,80 +2,60 @@
|
||||||
<el-config-provider :locale="zhCn">
|
<el-config-provider :locale="zhCn">
|
||||||
<el-container class="content">
|
<el-container class="content">
|
||||||
<div class="work-area">
|
<div class="work-area">
|
||||||
<fieldset class="title-area">
|
<fieldset class="search-area">
|
||||||
<legend>
|
<el-form ref="inventoryRequestFormRef" :model="inventoryRequestFormEntity" :label-position="labelPosition"
|
||||||
工作台
|
label-width="158px"
|
||||||
</legend>
|
style="max-width: 100%" :rules="requestRules" status-icon>
|
||||||
<div class="title-div">
|
<div style="display: flex; justify-content: space-between;">
|
||||||
<span class="title-text">物料盘点</span>
|
<el-row>
|
||||||
</div>
|
<el-form-item label="料号" prop="goodsId">
|
||||||
<div class="station-div">
|
<el-input v-model="inventoryRequestFormEntity.goodsId" ref="goodsId" clearable/>
|
||||||
<span class="station-text">工作站:</span>
|
</el-form-item>
|
||||||
</div>
|
<el-form-item label="箱号" prop="vehicleId">
|
||||||
<div class="station-no-div">
|
<el-input v-model="inventoryRequestFormEntity.vehicleId" ref="vehicleId" clearable/>
|
||||||
<span class="station-no-text">{{ standId }}</span>
|
</el-form-item>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-button type="primary"
|
||||||
|
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||||
|
@click="sendInventoryRequest()">下发盘点
|
||||||
|
</el-button>
|
||||||
|
<el-button type="warning"
|
||||||
|
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||||
|
@click="clearInput()">清除输入
|
||||||
|
</el-button>
|
||||||
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
|
</el-form>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset class="main-area">
|
<fieldset class="confirm-area">
|
||||||
<legend>
|
<el-form ref="confirmRef" :model="confirmEntity" :label-position="labelPosition" label-width="158px"
|
||||||
物料盘点
|
style="max-width: 100%" :rules="confirmRules" status-icon>
|
||||||
</legend>
|
<div style="display: flex; justify-content: space-between;">
|
||||||
<el-form ref="workFormRef" :model="workFormEntity" :label-position="labelPosition"
|
<el-row>
|
||||||
label-width="150px" style="max-width: 100%" :rules="rules" status-icon>
|
<el-form-item label="盘点任务号" prop="inventoryId">
|
||||||
<div style="display: flex;">
|
<el-input v-model="confirmEntity.inventoryId" disabled/>
|
||||||
<div style="display: block; margin: 5px;">
|
</el-form-item>
|
||||||
<!-- <div
|
<el-form-item label="物料号" prop="goodsId">
|
||||||
style="display: inline-flex; justify-content: center; height: 60px; width: 655px; margin: 5px; padding: 5px;">
|
<el-input v-model="confirmEntity.goodsId" disabled/>
|
||||||
<UploadExcelPart></UploadExcelPart>
|
</el-form-item>
|
||||||
</div> -->
|
<el-form-item label="箱号" prop="vehicleId">
|
||||||
<div style="height: 50px; margin-bottom: 20px"><UploadExcelInventoryList></UploadExcelInventoryList></div>
|
<el-input v-model="confirmEntity.vehicleId" disabled/>
|
||||||
<div
|
</el-form-item>
|
||||||
style="display: inline-flex; justify-content: center; height: 40px; width: 655px; margin: 5px; padding: 5px; background-color: #00AAE8;">
|
<el-form-item label="系统数量" prop="stockNum">
|
||||||
<span style="align-self: center; font-weight: bold;font-size: 25px;">
|
<el-input v-model="confirmEntity.stockNum" disabled/>
|
||||||
{{ workFormEntity.tip }}
|
</el-form-item>
|
||||||
</span>
|
<el-form-item label="确认数量" prop="confirmNum">
|
||||||
</div>
|
<el-input-number v-model.number="confirmEntity.confirmNum"
|
||||||
<div style="display: flex;">
|
controls-position="right" :min="0" clearable/>
|
||||||
<div style="display: flex; flex-direction: column;">
|
</el-form-item>
|
||||||
<div class="display-title-div">
|
</el-row>
|
||||||
<span class="display-title-text">料号</span>
|
<el-row>
|
||||||
</div>
|
<el-button type="success"
|
||||||
<div class="display-form-div">
|
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||||
<el-input v-model="workFormEntity.goodsId" size="default" ref="goodsId"
|
@click="confirmOrRelease()">确认/放行
|
||||||
v-on:keyup.enter="getCurrentWorkInfo()" clearable></el-input>
|
</el-button>
|
||||||
</div>
|
</el-row>
|
||||||
</div>
|
|
||||||
<div style="display: flex; flex-direction: column;">
|
|
||||||
<div class="display-title-div">
|
|
||||||
<span class="display-title-text">箱号</span>
|
|
||||||
</div>
|
|
||||||
<div class="display-form-div">
|
|
||||||
<el-input v-model="workFormEntity.vehicleId" size="default" ref="vehicleId"
|
|
||||||
v-on:keyup.enter="getCurrentWorkInfo()" clearable></el-input>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="display: flex; flex-direction: column;">
|
|
||||||
<div class="display-title-div">
|
|
||||||
<span class="display-title-text">实物数量</span>
|
|
||||||
</div>
|
|
||||||
<div style="display: flex; margin-top: 20px;">
|
|
||||||
<div class="display-form-div-left">
|
|
||||||
<el-input-number v-model.number="workFormEntity.realNum" ref="realNum"
|
|
||||||
controls-position="right" :min="0" />
|
|
||||||
</div>
|
|
||||||
<div class="display-form-div-right">
|
|
||||||
<span class="display-form-text-right">PC</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="margin: 10px;">
|
|
||||||
<div class="arrow" @click="confirmTask()">
|
|
||||||
<span
|
|
||||||
style="margin-left: 25px; align-self: center; font-weight: bold;font-size: 45px; writing-mode: vertical-lr;">完成确认</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
@ -86,148 +66,163 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import { getWorkByStandAndGoods, confirmFinishWork, queryFinishByStandAndGoods } from '@/api/task'
|
import {nextTick, onBeforeUnmount, onMounted, reactive, ref, watch} from 'vue'
|
||||||
import { reactive, ref } from 'vue'
|
|
||||||
import { errorBox } from '@/utils/myMessageBox.js'
|
|
||||||
import { ElMessage } from 'element-plus'
|
|
||||||
import UploadExcelInventoryList from '@/excel/UploadExcelProduct.vue'
|
|
||||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
</script>
|
import {useRoute} from "vue-router";
|
||||||
|
import {errorBox, warningBox} from "@/utils/myMessageBox";
|
||||||
|
import {ElMessage} from "element-plus";
|
||||||
|
import {confirmInventory, getInventoryConfirm, requestInventory} from "@/api/task";
|
||||||
|
import {labelPosition} from "@/constant/form";
|
||||||
|
|
||||||
<script>
|
const STAND_ID = store.getters.getStandId
|
||||||
export default {
|
const USER_NAME = store.getters.getUserName
|
||||||
name: 'inventory',
|
let timer = ref()
|
||||||
data() {
|
const route = useRoute()// 路由
|
||||||
return {
|
let inventoryRequestFormRef = ref()
|
||||||
standId: store.getters.getStandId,
|
let inventoryRequestFormEntity = reactive({
|
||||||
timer: '',
|
|
||||||
labelPosition: 'top',
|
|
||||||
workFormRef: ref(),
|
|
||||||
workFormEntity: reactive({
|
|
||||||
goodsId: '',
|
goodsId: '',
|
||||||
planPickNum: 0,
|
vehicleId: ''
|
||||||
remainNumOrigin: null,
|
})
|
||||||
remainNumReal: null,
|
const requestRules = reactive({})
|
||||||
remark: '',
|
let confirmRef = ref()
|
||||||
finishedRows: 0,
|
let confirmEntity = reactive({
|
||||||
totalRows: 0,
|
inventoryId: '',
|
||||||
finishedCounts: 0,
|
vehicleId: '',
|
||||||
totalCounts: 0,
|
goodsId: '',
|
||||||
tip: ''
|
stockNum: null,
|
||||||
}),
|
confirmNum: null
|
||||||
rules: reactive({
|
})
|
||||||
goodsId: [
|
const confirmRules = reactive({})
|
||||||
{ required: true, message: '请输入料号' }
|
let pauseGetPickFlag = ref(false)
|
||||||
]
|
// 系统
|
||||||
}),
|
onMounted(() => {
|
||||||
}
|
nextTick(() => {
|
||||||
},
|
timer.value = setInterval(() => {
|
||||||
mounted() {
|
timerTask_1()
|
||||||
this.$refs.goodsId.focus()
|
}, 1000)
|
||||||
this.timer = setInterval(() => {
|
})
|
||||||
this.queryFinish()
|
})
|
||||||
}, 2000)
|
onBeforeUnmount(() => {
|
||||||
},
|
clearInterval(timer.value)
|
||||||
beforeUnmount() {
|
})
|
||||||
clearInterval(this.timer)
|
// 监视路由
|
||||||
},
|
watch(() => route.path, (newVal, oldVal) => {
|
||||||
methods: {
|
if (newVal === '/inventory') {
|
||||||
// 获取当前工作信息
|
timer.value = setInterval(() => {
|
||||||
getCurrentWorkInfo() {
|
timerTask_1()
|
||||||
const request = {
|
}, 1000)
|
||||||
standId: this.standId,
|
|
||||||
goodsId: this.workFormEntity.goodsId
|
|
||||||
}
|
|
||||||
getWorkByStandAndGoods(request).then(res => {
|
|
||||||
const response = res.data
|
|
||||||
if (response.code == 0) {
|
|
||||||
this.workFormEntity.goodsId = response.returnData.goodsId
|
|
||||||
this.workFormEntity.planPickNum = response.returnData.planPickNum
|
|
||||||
this.workFormEntity.remainNumOrigin = response.returnData.remainNumOrigin
|
|
||||||
this.workFormEntity.remainNumReal = response.returnData.remainNumReal
|
|
||||||
this.workFormEntity.remark = response.returnData.remark
|
|
||||||
this.workFormEntity.finishedRows = response.returnData.finishedRows
|
|
||||||
this.workFormEntity.totalRows = response.returnData.totalRows
|
|
||||||
this.workFormEntity.finishedCounts = response.returnData.finishedCounts
|
|
||||||
this.workFormEntity.totalCounts = response.returnData.totalCounts
|
|
||||||
this.workFormEntity.tip = response.returnData.tip
|
|
||||||
} else {
|
} else {
|
||||||
this.resetForms()
|
clearInterval(timer.value)
|
||||||
errorBox(response.message)
|
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
|
||||||
console.log(err)
|
|
||||||
this.resetForms()
|
|
||||||
errorBox('查询工作信息错误')
|
|
||||||
})
|
})
|
||||||
},
|
// 定时器任务1
|
||||||
// 查询是否完成
|
const timerTask_1 = () => {
|
||||||
queryFinish() {
|
// 查询盘点列表
|
||||||
if (this.workFormEntity.goodsId == '') {
|
getInventory()
|
||||||
|
}
|
||||||
|
// 查询盘点信息
|
||||||
|
const getInventory = () => {
|
||||||
|
if (pauseGetPickFlag.value) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const request = {
|
const request = {
|
||||||
standId: this.standId,
|
standId: STAND_ID,
|
||||||
goodsId: this.workFormEntity.goodsId
|
userName: USER_NAME
|
||||||
}
|
}
|
||||||
queryFinishByStandAndGoods(request).then(res => {
|
// 获取当前拣选信息
|
||||||
|
getInventoryConfirm(request).then(res => {
|
||||||
const response = res.data
|
const response = res.data
|
||||||
if (response.code == 0) {
|
if (response.code == 0) {
|
||||||
if (response.returnData != null) {
|
const confirmVo = response.data
|
||||||
this.workFormEntity.tip = response.returnData.tip
|
// 设置form
|
||||||
}
|
confirmEntity.inventoryId = confirmVo.inventoryId
|
||||||
this.resetForms()
|
confirmEntity.goodsId = confirmVo.goodsId
|
||||||
ElMessage.success(response.message)
|
confirmEntity.vehicleId = confirmVo.vehicleId
|
||||||
|
confirmEntity.stockNum = confirmVo.stockNum
|
||||||
|
confirmEntity.confirmNum = confirmVo.confirmNum
|
||||||
|
pauseGetPickFlag.value= true
|
||||||
|
} else if (response.code == 400) {
|
||||||
|
// 警告,弹框
|
||||||
|
pauseGetPickFlag.value = true
|
||||||
|
warningBox(response.message)
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
|
pauseGetPickFlag.value = true
|
||||||
|
errorBox('请求错误,请检查完原因后刷新界面。')
|
||||||
})
|
})
|
||||||
},
|
}
|
||||||
// 重置参数
|
// 下发盘点任务
|
||||||
resetForms() {
|
const sendInventoryRequest = () => {
|
||||||
this.workFormEntity = reactive({
|
inventoryRequestFormEntity.goodsId = inventoryRequestFormEntity.goodsId.trim().toUpperCase()
|
||||||
goodsId: '',
|
inventoryRequestFormEntity.vehicleId = inventoryRequestFormEntity.vehicleId.trim().toUpperCase()
|
||||||
planPickNum: 0,
|
if (inventoryRequestFormEntity.goodsId == '') {
|
||||||
remainNumOrigin: null,
|
ElMessage.error("料号为必须项。")
|
||||||
remainNumReal: null,
|
|
||||||
remark: '',
|
|
||||||
finishedRows: 0,
|
|
||||||
totalRows: 0,
|
|
||||||
finishedCounts: 0,
|
|
||||||
totalCounts: 0,
|
|
||||||
tip: ''
|
|
||||||
})
|
|
||||||
this.$refs.goodsId.focus()
|
|
||||||
},
|
|
||||||
// 确认完成工作
|
|
||||||
confirmTask() {
|
|
||||||
if (this.standId == '' || this.workFormEntity.goodsId == '') {
|
|
||||||
errorBox('站台号和料号不可缺少')
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const confirmParams = {
|
const request = {
|
||||||
standId: this.standId,
|
goodsId: inventoryRequestFormEntity.goodsId,
|
||||||
goodsId: this.workFormEntity.goodsId,
|
vehicleId: inventoryRequestFormEntity.vehicleId,
|
||||||
remainNumOrigin: this.workFormEntity.remainNumOrigin,
|
standId: STAND_ID,
|
||||||
remainNumReal: this.workFormEntity.remainNumReal
|
userName: USER_NAME
|
||||||
}
|
}
|
||||||
confirmFinishWork(confirmParams).then(res => {
|
requestInventory(request).then(res => {
|
||||||
const response = res.data
|
const response = res.data
|
||||||
if (response.code == 0) {
|
if (response.code == 0) {
|
||||||
if (response.returnData != null) {
|
|
||||||
this.workFormEntity.tip = response.returnData.tip
|
|
||||||
}
|
|
||||||
this.resetForms()
|
|
||||||
ElMessage.success(response.message)
|
ElMessage.success(response.message)
|
||||||
|
pauseGetPickFlag.value = false
|
||||||
} else {
|
} else {
|
||||||
errorBox(response.message)
|
errorBox(response.message)
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
errorBox('确认时发生异常')
|
ElMessage.error("发生异常。")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 确认/放行
|
||||||
|
const confirmOrRelease = () => {
|
||||||
|
// 确认放行---与配料工作区分开来
|
||||||
|
const request = {
|
||||||
|
inventoryId: confirmEntity.inventoryId,
|
||||||
|
goodsId: confirmEntity.goodsId,
|
||||||
|
vehicleId: confirmEntity.vehicleId,
|
||||||
|
confirmNum: confirmEntity.confirmNum,
|
||||||
|
standId:STAND_ID,
|
||||||
|
userName: USER_NAME
|
||||||
}
|
}
|
||||||
|
confirmInventory(request).then(res => {
|
||||||
|
const response = res.data
|
||||||
|
if (response.code == 0) {
|
||||||
|
// 设置form
|
||||||
|
resetConfirmEntity()
|
||||||
|
ElMessage.success(response.message)
|
||||||
|
pauseGetPickFlag.value = false
|
||||||
|
} else if (response.code == 400) {
|
||||||
|
// 设置form
|
||||||
|
resetConfirmEntity()
|
||||||
|
warningBox(response.message)
|
||||||
|
pauseGetPickFlag.value = false
|
||||||
|
} else {
|
||||||
|
// 错误,弹框
|
||||||
|
errorBox(response.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
errorBox('请求错误,请检查完原因后刷新界面。')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 重置确认信息
|
||||||
|
const resetConfirmEntity = () => {
|
||||||
|
confirmEntity.inventoryId = ''
|
||||||
|
confirmEntity.goodsId = ''
|
||||||
|
confirmEntity.vehicleId = ''
|
||||||
|
confirmEntity.stockNum = null
|
||||||
|
confirmEntity.confirmNum = null
|
||||||
|
}
|
||||||
|
// 清空下发信息
|
||||||
|
const clearInput = () => {
|
||||||
|
inventoryRequestFormEntity.goodsId = ''
|
||||||
|
inventoryRequestFormEntity.vehicleId = ''
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -242,7 +237,7 @@ export default {
|
||||||
/* padding: 5px; */
|
/* padding: 5px; */
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-area {
|
.search-area {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
min-height: fit-content;
|
min-height: fit-content;
|
||||||
max-height: 90%;
|
max-height: 90%;
|
||||||
|
|
@ -252,150 +247,32 @@ export default {
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
box-shadow: 0px 15px 10px -15px #000;
|
box-shadow: 0px 15px 10px -15px #000;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title-area {
|
.confirm-area {
|
||||||
display: flex;
|
margin: auto;
|
||||||
/* min-height: 10%; */
|
min-height: fit-content;
|
||||||
max-height: max-content;
|
max-height: 90%;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
min-width: inherit;
|
min-width: inherit;
|
||||||
border: solid 1px;
|
border: solid 1px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
box-shadow: 0px 15px 10px -15px #000;
|
box-shadow: 0px 15px 10px -15px #000;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.arrow {
|
.el-form-item {
|
||||||
background: linear-gradient(-105deg,
|
margin: 10px 5px 10px 5px;
|
||||||
transparent 50%,
|
|
||||||
#309330 50%,
|
|
||||||
#309330 100%) top right,
|
|
||||||
linear-gradient(-75deg,
|
|
||||||
transparent 50%,
|
|
||||||
#309330 50%,
|
|
||||||
#309330 100%) bottom right;
|
|
||||||
background-size: 100% 50%;
|
|
||||||
height: 400px;
|
|
||||||
width: 250px;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
display: inline-flex;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.el-input) {
|
.el-form-item .el-input {
|
||||||
width: 195px;
|
width: 196px;
|
||||||
height: 130px;
|
|
||||||
font-size: 25px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.el-input-number) {
|
.table-class {
|
||||||
width: 125px;
|
margin: 5px 5px 5px 5px;
|
||||||
height: 130px;
|
width: inherit;
|
||||||
font-size: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* :deep(.el-input .el-input__inner) {
|
|
||||||
font-size: 60px;
|
|
||||||
height: 130px;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.el-input-number .el-input__inner) {
|
|
||||||
font-size: 60px;
|
|
||||||
height: 130px;
|
|
||||||
} */
|
|
||||||
|
|
||||||
.title-div {
|
|
||||||
display: inline-flex;
|
|
||||||
width: -webkit-fill-available;
|
|
||||||
margin-right: 5px;
|
|
||||||
padding: 5px;
|
|
||||||
background-color: #CCCCCC;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title-text {
|
|
||||||
align-self: center;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.station-div {
|
|
||||||
display: inline-flex;
|
|
||||||
justify-content: center;
|
|
||||||
width: 150px;
|
|
||||||
margin-left: 5px;
|
|
||||||
margin-right: 5px;
|
|
||||||
padding: 5px;
|
|
||||||
background-color: #FFFAAA;
|
|
||||||
}
|
|
||||||
|
|
||||||
.station-text {
|
|
||||||
align-self: center;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.station-no-div {
|
|
||||||
display: inline-flex;
|
|
||||||
justify-content: center;
|
|
||||||
width: 200px;
|
|
||||||
padding: 5px;
|
|
||||||
border: 5px double #000000;
|
|
||||||
}
|
|
||||||
|
|
||||||
.station-no-text {
|
|
||||||
align-self: center;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.display-title-div {
|
|
||||||
display: inline-flex;
|
|
||||||
justify-content: center;
|
|
||||||
width: 205px;
|
|
||||||
height: 80px;
|
|
||||||
margin: 5px;
|
|
||||||
padding: 5px;
|
|
||||||
background-color: #FFFAAA;
|
|
||||||
}
|
|
||||||
|
|
||||||
.display-title-text {
|
|
||||||
align-self: center;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.display-form-div {
|
|
||||||
display: inline-flex;
|
|
||||||
justify-content: center;
|
|
||||||
width: 195px;
|
|
||||||
margin: 5px;
|
|
||||||
padding: 5px;
|
|
||||||
border: 5px double #000000;
|
|
||||||
margin-top: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.display-form-div-left {
|
|
||||||
display: inline-flex;
|
|
||||||
justify-content: center;
|
|
||||||
width: 125px;
|
|
||||||
margin: 5px;
|
|
||||||
padding: 5px;
|
|
||||||
border: 5px double #000000;
|
|
||||||
}
|
|
||||||
|
|
||||||
.display-form-div-right {
|
|
||||||
display: inline-flex;
|
|
||||||
justify-content: center;
|
|
||||||
width: 50px;
|
|
||||||
margin: 5px;
|
|
||||||
padding: 5px;
|
|
||||||
background-color: #CCCCCC;
|
|
||||||
}
|
|
||||||
|
|
||||||
.display-form-text-right {
|
|
||||||
align-self: center;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 25px;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -306,7 +306,6 @@ const route = useRoute()// 路由
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
initWorkOptions()
|
initWorkOptions()
|
||||||
searchKittingGoods()
|
|
||||||
timer.value = setInterval(() => {
|
timer.value = setInterval(() => {
|
||||||
timerTask_1()
|
timerTask_1()
|
||||||
}, 1000)
|
}, 1000)
|
||||||
|
|
@ -364,6 +363,8 @@ const timerTask_1 = () => {
|
||||||
getWork()
|
getWork()
|
||||||
// 判断是否需要显示料盒信息
|
// 判断是否需要显示料盒信息
|
||||||
ifNeedShowBoxSummary()
|
ifNeedShowBoxSummary()
|
||||||
|
// 查询当前配料的物料信息
|
||||||
|
searchKittingGoods()
|
||||||
}
|
}
|
||||||
// 自定义方法
|
// 自定义方法
|
||||||
const solveEnterKey = (e) => {
|
const solveEnterKey = (e) => {
|
||||||
|
|
@ -446,7 +447,6 @@ const confirmStart = () => {
|
||||||
errorBox('请求错误。')
|
errorBox('请求错误。')
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
loading.close()
|
loading.close()
|
||||||
searchKittingGoods()
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 显示料盒总览
|
// 显示料盒总览
|
||||||
|
|
@ -562,7 +562,6 @@ const ifNeedShowBoxSummary = () => {
|
||||||
storeKittingWork.productId = confirmEntity.productId
|
storeKittingWork.productId = confirmEntity.productId
|
||||||
storeKittingWork.singleProductId = confirmEntity.singleProductId
|
storeKittingWork.singleProductId = confirmEntity.singleProductId
|
||||||
storeKittingWork.boxNo = confirmEntity.boxNo
|
storeKittingWork.boxNo = confirmEntity.boxNo
|
||||||
searchKittingGoods()
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 替换store
|
// 替换store
|
||||||
|
|
@ -603,25 +602,20 @@ const confirmOrRelease = () => {
|
||||||
if (response.code == 0) {
|
if (response.code == 0) {
|
||||||
// 设置form
|
// 设置form
|
||||||
resetConfirmEntity()
|
resetConfirmEntity()
|
||||||
// 继续刷新
|
|
||||||
pauseGetWorkFlag.value = false
|
|
||||||
ElMessage.success(response.message)
|
ElMessage.success(response.message)
|
||||||
} else if (response.code == 400) {
|
} else if (response.code == 400) {
|
||||||
// 设置form
|
// 设置form
|
||||||
resetConfirmEntity()
|
resetConfirmEntity()
|
||||||
// 警告
|
// 警告
|
||||||
pauseGetWorkFlag.value = false
|
|
||||||
warningBox(response.message)
|
warningBox(response.message)
|
||||||
} else {
|
} else {
|
||||||
// 错误
|
// 错误
|
||||||
errorBox(response.message)
|
errorBox(response.message)
|
||||||
}
|
}
|
||||||
|
pauseGetWorkFlag.value = false
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
errorBox('请求错误,请检查完原因后刷新界面。')
|
errorBox('请求错误,请检查完原因后刷新界面。')
|
||||||
}).finally(() => {
|
|
||||||
// 刷新一下物料显示
|
|
||||||
searchKittingGoods()
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const resetConfirmEntity = () => {
|
const resetConfirmEntity = () => {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.wms_main.constant.enums.wms;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘点结果枚举
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum WmsInvResultEnums {
|
||||||
|
NONE(-99, "未盘点"),
|
||||||
|
MINUS(-1, "盘亏"),
|
||||||
|
EQUAL(0, "正常"),
|
||||||
|
PLUS(1, "盘盈");
|
||||||
|
private final Integer code;
|
||||||
|
private final String desc;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.wms_main.constant.enums.wms;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘点状态枚举
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum WmsInvStatusEnums {
|
||||||
|
INIT(0, "初始化"),
|
||||||
|
EXECUTED(1, "已解析"),
|
||||||
|
CONFIRMED(2, "已确认");
|
||||||
|
|
||||||
|
private final Integer code;
|
||||||
|
private final String desc;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.wms_main.constant.enums.wms;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘点类型枚举
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum WmsInvTypeEnums {
|
||||||
|
INV_TYPE_1(1, "明盘"),
|
||||||
|
INV_TYPE_2(2, "盲盘");
|
||||||
|
private final Integer code;
|
||||||
|
private final String desc;
|
||||||
|
}
|
||||||
|
|
@ -9,6 +9,7 @@ import com.wms_main.model.dto.response.wcs.BaseWcsApiResponse;
|
||||||
import com.wms_main.model.dto.response.wcs.WcsApiResponse;
|
import com.wms_main.model.dto.response.wcs.WcsApiResponse;
|
||||||
import com.wms_main.model.dto.response.wms.BaseWmsApiResponse;
|
import com.wms_main.model.dto.response.wms.BaseWmsApiResponse;
|
||||||
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||||
|
import com.wms_main.model.vo.wms.InventoryConfirmVo;
|
||||||
import com.wms_main.model.vo.wms.TaskConfirmVo;
|
import com.wms_main.model.vo.wms.TaskConfirmVo;
|
||||||
import com.wms_main.service.controller.ITaskControllerService;
|
import com.wms_main.service.controller.ITaskControllerService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
@ -114,4 +115,34 @@ public class TaskController {
|
||||||
public BaseWmsApiResponse confirmCurrentTask(@RequestBody ConfirmTaskRequest confirmTaskRequest) {
|
public BaseWmsApiResponse confirmCurrentTask(@RequestBody ConfirmTaskRequest confirmTaskRequest) {
|
||||||
return taskControllerService.confirmCurrentTask(confirmTaskRequest);
|
return taskControllerService.confirmCurrentTask(confirmTaskRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下发盘点请求
|
||||||
|
* @param inventoryRequest 盘点请求
|
||||||
|
* @return 请求结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/requestInventory")
|
||||||
|
public BaseWmsApiResponse requestInventory(@RequestBody InventoryRequest inventoryRequest) {
|
||||||
|
return taskControllerService.requestInventory(inventoryRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询盘点任务确认信息
|
||||||
|
* @param inventoryConfirmRequest 请求
|
||||||
|
* @return 请求结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/getInventoryConfirm")
|
||||||
|
WmsApiResponse<InventoryConfirmVo> getInventoryConfirm(@RequestBody InventoryConfirmRequest inventoryConfirmRequest) {
|
||||||
|
return taskControllerService.getInventoryConfirm(inventoryConfirmRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认盘点信息
|
||||||
|
* @param inventoryConfirmRequest 确认请求
|
||||||
|
* @return 处理结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/confirmInventory")
|
||||||
|
BaseWmsApiResponse confirmInventory(@RequestBody InventoryConfirmRequest inventoryConfirmRequest) {
|
||||||
|
return taskControllerService.confirmInventory(inventoryConfirmRequest);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.wms_main.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.wms_main.model.po.TAppInventoryRecord;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘点任务记录服务接口
|
||||||
|
*/
|
||||||
|
public interface ITAppInventoryRecordService extends IService<TAppInventoryRecord> {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.wms_main.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.wms_main.model.po.TAppInventory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘点任务服务接口
|
||||||
|
*/
|
||||||
|
public interface ITAppInventoryService extends IService<TAppInventory> {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.wms_main.dao.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.wms_main.dao.ITAppInventoryRecordService;
|
||||||
|
import com.wms_main.mapper.AppInventoryRecordMapper;
|
||||||
|
import com.wms_main.model.po.TAppInventoryRecord;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘点记录表服务实现
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class TAppInventoryRecordServiceImpl extends ServiceImpl<AppInventoryRecordMapper, TAppInventoryRecord> implements ITAppInventoryRecordService {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.wms_main.dao.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.wms_main.dao.ITAppInventoryService;
|
||||||
|
import com.wms_main.mapper.AppInventoryMapper;
|
||||||
|
import com.wms_main.model.po.TAppInventory;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘点任务表服务实现
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class TAppInventoryServiceImpl extends ServiceImpl<AppInventoryMapper, TAppInventory> implements ITAppInventoryService {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.wms_main.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.wms_main.model.po.TAppConfig;
|
||||||
|
import com.wms_main.model.po.TAppInventory;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘点任务表mapper
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface AppInventoryMapper extends BaseMapper<TAppInventory> {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.wms_main.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.wms_main.model.po.TAppInventory;
|
||||||
|
import com.wms_main.model.po.TAppInventoryRecord;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘点记录表mapper
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface AppInventoryRecordMapper extends BaseMapper<TAppInventoryRecord> {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.wms_main.model.dto.request.wms;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘点确认请求
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class InventoryConfirmRequest extends BaseWmsRequest {
|
||||||
|
/**
|
||||||
|
* 盘点任务号
|
||||||
|
*/
|
||||||
|
@JsonProperty("inventoryId")
|
||||||
|
private String inventoryId;
|
||||||
|
/**
|
||||||
|
* 料号
|
||||||
|
*/
|
||||||
|
@JsonProperty("goodsId")
|
||||||
|
private String goodsId;
|
||||||
|
/**
|
||||||
|
* 箱号
|
||||||
|
*/
|
||||||
|
@JsonProperty("vehicleId")
|
||||||
|
private String vehicleId;
|
||||||
|
/**
|
||||||
|
* 确认数量
|
||||||
|
*/
|
||||||
|
@JsonProperty("confirmNum")
|
||||||
|
private Integer confirmNum;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.wms_main.model.dto.request.wms;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘点下发请求
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class InventoryRequest extends BaseWmsRequest {
|
||||||
|
/**
|
||||||
|
* 料号
|
||||||
|
*/
|
||||||
|
@JsonProperty("goodsId")
|
||||||
|
private String goodsId;
|
||||||
|
/**
|
||||||
|
* 箱号
|
||||||
|
*/
|
||||||
|
@JsonProperty("vehicleId")
|
||||||
|
private String vehicleId;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,93 @@
|
||||||
|
package com.wms_main.model.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘点任务
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "t_app_inventory", autoResultMap = true)
|
||||||
|
public class TAppInventory {
|
||||||
|
/**
|
||||||
|
* 盘点id
|
||||||
|
*/
|
||||||
|
@TableId(value = "inventory_id")
|
||||||
|
private String inventoryId;
|
||||||
|
/**
|
||||||
|
* 料号
|
||||||
|
*/
|
||||||
|
@TableField(value = "goods_id")
|
||||||
|
private String goodsId;
|
||||||
|
/**
|
||||||
|
* 载具号
|
||||||
|
*/
|
||||||
|
@TableField(value = "vehicle_id")
|
||||||
|
private String vehicleId;
|
||||||
|
/**
|
||||||
|
* 库存数量
|
||||||
|
* 只记录盘点确认时间点
|
||||||
|
*/
|
||||||
|
@TableField(value = "stock_num")
|
||||||
|
private Integer stockNum;
|
||||||
|
/**
|
||||||
|
* 确认数量
|
||||||
|
*/
|
||||||
|
@TableField(value = "confirm_num")
|
||||||
|
private Integer confirmNum;
|
||||||
|
/**
|
||||||
|
* 盘点站台
|
||||||
|
*/
|
||||||
|
@TableField(value = "inv_stand")
|
||||||
|
private String invStand;
|
||||||
|
/**
|
||||||
|
* 盘点人
|
||||||
|
*/
|
||||||
|
@TableField(value = "inv_user")
|
||||||
|
private String invUser;
|
||||||
|
/**
|
||||||
|
* 盘点类型:1:明盘;2:盲盘
|
||||||
|
*/
|
||||||
|
@TableField(value = "inv_type")
|
||||||
|
private Integer invType;
|
||||||
|
/**
|
||||||
|
* 盘点状态
|
||||||
|
* 0. 初始化
|
||||||
|
* 1. 已解析
|
||||||
|
* 2. 已确认
|
||||||
|
*/
|
||||||
|
@TableField(value = "inv_status")
|
||||||
|
private Integer invStatus;
|
||||||
|
/**
|
||||||
|
* 盘点结果
|
||||||
|
* -99:未盘
|
||||||
|
* -1: 盘亏
|
||||||
|
* 0: 正常
|
||||||
|
* 1: 盘盈
|
||||||
|
*/
|
||||||
|
@TableField(value = "inv_result")
|
||||||
|
private Integer invResult;
|
||||||
|
/**
|
||||||
|
* 盘点任务创建时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "inv_create_time")
|
||||||
|
private LocalDateTime invCreateTime;
|
||||||
|
/**
|
||||||
|
* 盘点确认时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "inv_confirm_time")
|
||||||
|
private LocalDateTime invConfirmTime;
|
||||||
|
/**
|
||||||
|
* 这个字段用于合并哪些任务是同一时间下发的
|
||||||
|
*/
|
||||||
|
@TableField(value = "inv_order_id")
|
||||||
|
private String invOrderId;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,93 @@
|
||||||
|
package com.wms_main.model.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘点记录
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "t_app_inventory_record", autoResultMap = true)
|
||||||
|
public class TAppInventoryRecord {
|
||||||
|
/**
|
||||||
|
* 盘点id
|
||||||
|
*/
|
||||||
|
@TableId(value = "inventory_id")
|
||||||
|
private String inventoryId;
|
||||||
|
/**
|
||||||
|
* 料号
|
||||||
|
*/
|
||||||
|
@TableField(value = "goods_id")
|
||||||
|
private String goodsId;
|
||||||
|
/**
|
||||||
|
* 载具号
|
||||||
|
*/
|
||||||
|
@TableField(value = "vehicle_id")
|
||||||
|
private String vehicleId;
|
||||||
|
/**
|
||||||
|
* 库存数量
|
||||||
|
* 只记录盘点确认时间点
|
||||||
|
*/
|
||||||
|
@TableField(value = "stock_num")
|
||||||
|
private Integer stockNum;
|
||||||
|
/**
|
||||||
|
* 确认数量
|
||||||
|
*/
|
||||||
|
@TableField(value = "confirm_num")
|
||||||
|
private Integer confirmNum;
|
||||||
|
/**
|
||||||
|
* 盘点站台
|
||||||
|
*/
|
||||||
|
@TableField(value = "inv_stand")
|
||||||
|
private String invStand;
|
||||||
|
/**
|
||||||
|
* 盘点人
|
||||||
|
*/
|
||||||
|
@TableField(value = "inv_user")
|
||||||
|
private String invUser;
|
||||||
|
/**
|
||||||
|
* 盘点类型:1:明盘;2:盲盘
|
||||||
|
*/
|
||||||
|
@TableField(value = "inv_type")
|
||||||
|
private Integer invType;
|
||||||
|
/**
|
||||||
|
* 盘点状态
|
||||||
|
* 1. 初始化
|
||||||
|
* 2. 已解析
|
||||||
|
* 3. 数量确认
|
||||||
|
* 4. 盘点关闭
|
||||||
|
*/
|
||||||
|
@TableField(value = "inv_status")
|
||||||
|
private Integer invStatus;
|
||||||
|
/**
|
||||||
|
* 盘点结果
|
||||||
|
* -1: 盘亏
|
||||||
|
* 0: 正常
|
||||||
|
* 1: 盘盈
|
||||||
|
*/
|
||||||
|
@TableField(value = "inv_result")
|
||||||
|
private Integer invResult;
|
||||||
|
/**
|
||||||
|
* 盘点任务创建时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "inv_create_time")
|
||||||
|
private LocalDateTime invCreateTime;
|
||||||
|
/**
|
||||||
|
* 盘点确认时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "inv_confirm_time")
|
||||||
|
private LocalDateTime invConfirmTime;
|
||||||
|
/**
|
||||||
|
* 这个字段用于合并哪些任务是同一时间下发的
|
||||||
|
*/
|
||||||
|
@TableField(value = "inv_order_id")
|
||||||
|
private String invOrderId;
|
||||||
|
}
|
||||||
|
|
@ -7,7 +7,6 @@ import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
|
@ -99,4 +98,14 @@ public class TAppStock {
|
||||||
*/
|
*/
|
||||||
@TableField(value = "sled")
|
@TableField(value = "sled")
|
||||||
private Integer sled;
|
private Integer sled;
|
||||||
|
/**
|
||||||
|
* 上次盘点任务号
|
||||||
|
*/
|
||||||
|
@TableField(value = "last_inventory_id")
|
||||||
|
private String lastInventoryId;
|
||||||
|
/**
|
||||||
|
* 上次盘点时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "last_inventory_time")
|
||||||
|
private LocalDateTime lastInventoryTime;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.wms_main.model.vo.wms;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘点确认界面显示Vo
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class InventoryConfirmVo {
|
||||||
|
/**
|
||||||
|
* 盘点任务号
|
||||||
|
*/
|
||||||
|
@JsonProperty("inventoryId")
|
||||||
|
private String inventoryId;
|
||||||
|
/**
|
||||||
|
* 料号
|
||||||
|
*/
|
||||||
|
@JsonProperty("goodsId")
|
||||||
|
private String goodsId;
|
||||||
|
/**
|
||||||
|
* 载具号
|
||||||
|
*/
|
||||||
|
@JsonProperty("vehicleId")
|
||||||
|
private String vehicleId;
|
||||||
|
/**
|
||||||
|
* 库存数量
|
||||||
|
*/
|
||||||
|
@JsonProperty("stockNum")
|
||||||
|
private Integer stockNum;
|
||||||
|
/**
|
||||||
|
* 确认数量
|
||||||
|
*/
|
||||||
|
@JsonProperty("confirmNum")
|
||||||
|
private Integer confirmNum;
|
||||||
|
}
|
||||||
|
|
@ -2,11 +2,10 @@ package com.wms_main.service.business;
|
||||||
|
|
||||||
import com.wms_main.model.bo.wms.WmsPickTask;
|
import com.wms_main.model.bo.wms.WmsPickTask;
|
||||||
import com.wms_main.model.po.TAppPickTask;
|
import com.wms_main.model.po.TAppPickTask;
|
||||||
import com.wms_main.model.po.TAppStock;
|
import com.wms_main.model.vo.wms.InventoryConfirmVo;
|
||||||
import com.wms_main.model.vo.wms.TaskConfirmVo;
|
import com.wms_main.model.vo.wms.TaskConfirmVo;
|
||||||
import com.wms_main.model.vo.wms.WorkConfirmVo;
|
import com.wms_main.model.vo.wms.WorkConfirmVo;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -49,4 +48,11 @@ public interface IConveyTaskService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
TaskConfirmVo getCurrentStandTask(TAppPickTask thisPickTask);
|
TaskConfirmVo getCurrentStandTask(TAppPickTask thisPickTask);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取这个载具的盘点确认信息
|
||||||
|
* @param vehicleId 载具号
|
||||||
|
* @return 盘点确认信息
|
||||||
|
*/
|
||||||
|
InventoryConfirmVo getInventoryConfirm(String vehicleId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,9 @@ public interface IStockDataService {
|
||||||
* @param stockConfirm 库存确认信息
|
* @param stockConfirm 库存确认信息
|
||||||
* @param standId 站台号
|
* @param standId 站台号
|
||||||
* @param userName 用户名
|
* @param userName 用户名
|
||||||
|
* @param inventoryId 盘点任务号
|
||||||
*/
|
*/
|
||||||
void updateStockInfo(StockConfirmEntity stockConfirm, String standId, String userName, String reason);
|
void updateStockInfo(StockConfirmEntity stockConfirm, String standId, String userName, String reason, String inventoryId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询库存预警值
|
* 查询库存预警值
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ import com.wms_main.model.dto.request.wcs.WcsReleaseBoxRequest;
|
||||||
import com.wms_main.model.dto.response.wcs.BaseWcsApiResponse;
|
import com.wms_main.model.dto.response.wcs.BaseWcsApiResponse;
|
||||||
import com.wms_main.model.dto.response.wcs.WcsApiResponse;
|
import com.wms_main.model.dto.response.wcs.WcsApiResponse;
|
||||||
import com.wms_main.model.po.*;
|
import com.wms_main.model.po.*;
|
||||||
|
import com.wms_main.model.vo.wms.InventoryConfirmVo;
|
||||||
import com.wms_main.model.vo.wms.TaskConfirmVo;
|
import com.wms_main.model.vo.wms.TaskConfirmVo;
|
||||||
import com.wms_main.model.vo.wms.WorkConfirmVo;
|
import com.wms_main.model.vo.wms.WorkConfirmVo;
|
||||||
import com.wms_main.repository.utils.StringUtils;
|
import com.wms_main.repository.utils.StringUtils;
|
||||||
|
|
@ -51,6 +52,7 @@ public class ConveyTaskServiceImpl implements IConveyTaskService {
|
||||||
private final ITAppStockService appStockService;// 库存服务
|
private final ITAppStockService appStockService;// 库存服务
|
||||||
private final AppCommon appCommon;
|
private final AppCommon appCommon;
|
||||||
private final ITAppVehicleService appVehicleService;// 载具服务
|
private final ITAppVehicleService appVehicleService;// 载具服务
|
||||||
|
private final ITAppInventoryService appInventoryService;// 盘点服务
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 取消拣选任务实现
|
* 取消拣选任务实现
|
||||||
|
|
@ -457,4 +459,50 @@ public class ConveyTaskServiceImpl implements IConveyTaskService {
|
||||||
|
|
||||||
return resultVo;
|
return resultVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取这个载具的盘点确认信息
|
||||||
|
* @param vehicleId 载具号
|
||||||
|
* @return 盘点确认信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public InventoryConfirmVo getInventoryConfirm(String vehicleId) {
|
||||||
|
// 获取这个箱子的盘点任务
|
||||||
|
List<TAppInventory> inventoryList = appInventoryService.list(new LambdaQueryWrapper<TAppInventory>()
|
||||||
|
.eq(TAppInventory::getVehicleId, vehicleId));
|
||||||
|
if (inventoryList == null || inventoryList.isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
List<String> goodsIds = inventoryList.stream().map(TAppInventory::getGoodsId).distinct().toList();
|
||||||
|
// 查询这个箱子的库存信息
|
||||||
|
List<TAppStock> stockList = appStockService.list(new LambdaQueryWrapper<TAppStock>()
|
||||||
|
.eq(TAppStock::getVehicleId, vehicleId)
|
||||||
|
.in(TAppStock::getGoodsId, goodsIds));
|
||||||
|
if (stockList == null || stockList.isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
// 将这些库存根据料号Map一下, 并汇总库存数量
|
||||||
|
Map<String, Integer> sumNumByGoodsMap = new HashMap<>();
|
||||||
|
for (TAppStock stock : stockList) {
|
||||||
|
if (sumNumByGoodsMap.containsKey(stock.getGoodsId())) {
|
||||||
|
sumNumByGoodsMap.replace(stock.getGoodsId(), sumNumByGoodsMap.get(stock.getGoodsId()) + stock.getRealNum());
|
||||||
|
} else {
|
||||||
|
sumNumByGoodsMap.put(stock.getGoodsId(), stock.getRealNum());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (TAppInventory inventory : inventoryList) {
|
||||||
|
if (sumNumByGoodsMap.containsKey(inventory.getGoodsId())) {
|
||||||
|
// 返回盘点确认信息
|
||||||
|
InventoryConfirmVo inventoryConfirmVo = new InventoryConfirmVo();
|
||||||
|
inventoryConfirmVo.setInventoryId(inventory.getInventoryId());
|
||||||
|
inventoryConfirmVo.setGoodsId(inventory.getGoodsId());
|
||||||
|
inventoryConfirmVo.setVehicleId(inventory.getVehicleId());
|
||||||
|
inventoryConfirmVo.setStockNum(sumNumByGoodsMap.get(inventory.getGoodsId()));
|
||||||
|
inventoryConfirmVo.setConfirmNum(sumNumByGoodsMap.get(inventory.getGoodsId()));
|
||||||
|
// 返回结果
|
||||||
|
return inventoryConfirmVo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -368,7 +368,9 @@ public class StackerTaskServiceImpl implements IStackerTaskService {
|
||||||
thisVehicleInTask.getOpNum(),
|
thisVehicleInTask.getOpNum(),
|
||||||
thisVehicleInTask.getGoodsDesc(),
|
thisVehicleInTask.getGoodsDesc(),
|
||||||
expireDate,
|
expireDate,
|
||||||
sledDays
|
sledDays,
|
||||||
|
null,
|
||||||
|
null
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -522,7 +524,9 @@ public class StackerTaskServiceImpl implements IStackerTaskService {
|
||||||
thisVehicleInTask.getOpNum(),
|
thisVehicleInTask.getOpNum(),
|
||||||
thisVehicleInTask.getGoodsDesc(),
|
thisVehicleInTask.getGoodsDesc(),
|
||||||
expireDate,
|
expireDate,
|
||||||
sledDays
|
sledDays,
|
||||||
|
null,
|
||||||
|
null
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
// 更新已有库存信息
|
// 更新已有库存信息
|
||||||
|
|
@ -551,7 +555,9 @@ public class StackerTaskServiceImpl implements IStackerTaskService {
|
||||||
originSum + thisVehicleInTask.getOpNum(),
|
originSum + thisVehicleInTask.getOpNum(),
|
||||||
thisVehicleInTask.getGoodsDesc(),
|
thisVehicleInTask.getGoodsDesc(),
|
||||||
expireDate,
|
expireDate,
|
||||||
sledDays
|
sledDays,
|
||||||
|
null,
|
||||||
|
null
|
||||||
));
|
));
|
||||||
needDeleteStockIds.addAll(oldStockList.stream()
|
needDeleteStockIds.addAll(oldStockList.stream()
|
||||||
.map(TAppStock::getStockId)
|
.map(TAppStock::getStockId)
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ public class StockDataServiceImpl implements IStockDataService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updateStockInfo(StockConfirmEntity stockConfirm, String standId, String userName, String reason) {
|
public void updateStockInfo(StockConfirmEntity stockConfirm, String standId, String userName, String reason, String inventoryId) {
|
||||||
if (stockConfirm == null || StringUtils.isEmpty(stockConfirm.getVehicleId()) || StringUtils.isEmpty(stockConfirm.getGoodsId())
|
if (stockConfirm == null || StringUtils.isEmpty(stockConfirm.getVehicleId()) || StringUtils.isEmpty(stockConfirm.getGoodsId())
|
||||||
|| stockConfirm.getRealRemainQty() == null) {
|
|| stockConfirm.getRealRemainQty() == null) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -59,7 +59,12 @@ public class StockDataServiceImpl implements IStockDataService {
|
||||||
List<TAppStockUpdate> stockUpdateList = new ArrayList<>();
|
List<TAppStockUpdate> stockUpdateList = new ArrayList<>();
|
||||||
// 剩余数量
|
// 剩余数量
|
||||||
int remainQty = stockConfirm.getRealRemainQty();
|
int remainQty = stockConfirm.getRealRemainQty();
|
||||||
for (TAppStock stock : stockList) {
|
for (int i = 0; i < stockList.size(); i++) {
|
||||||
|
TAppStock stock = stockList.get(i);
|
||||||
|
if (StringUtils.isNotEmpty(inventoryId)) {
|
||||||
|
stock.setLastInventoryId(inventoryId);
|
||||||
|
stock.setLastInventoryTime(LocalDateTime.now());
|
||||||
|
}
|
||||||
if (remainQty <= 0) {
|
if (remainQty <= 0) {
|
||||||
// 需要移除的库存
|
// 需要移除的库存
|
||||||
removeStocks.add(stock);
|
removeStocks.add(stock);
|
||||||
|
|
@ -78,11 +83,8 @@ public class StockDataServiceImpl implements IStockDataService {
|
||||||
stockUpdateList.add(stockUpdate);
|
stockUpdateList.add(stockUpdate);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (stock.getRealNum() <= remainQty) {
|
if ((i == stockList.size() - 1) || stock.getRealNum() > remainQty) {
|
||||||
// 库存不变
|
// 最先进的库存,剩余数量全部分配给他
|
||||||
remainQty -= stock.getRealNum();
|
|
||||||
} else {
|
|
||||||
// 增加库存更新记录
|
|
||||||
TAppStockUpdate stockUpdate = new TAppStockUpdate(
|
TAppStockUpdate stockUpdate = new TAppStockUpdate(
|
||||||
UUIDUtils.getNewUUID(),
|
UUIDUtils.getNewUUID(),
|
||||||
stock.getVehicleId(),
|
stock.getVehicleId(),
|
||||||
|
|
@ -100,6 +102,9 @@ public class StockDataServiceImpl implements IStockDataService {
|
||||||
remainQty = 0;
|
remainQty = 0;
|
||||||
// 添加更新库存列表
|
// 添加更新库存列表
|
||||||
updateStocks.add(stock);
|
updateStocks.add(stock);
|
||||||
|
} else {
|
||||||
|
// 库存不变
|
||||||
|
remainQty -= stock.getRealNum();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 删除库存
|
// 删除库存
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import com.wms_main.model.dto.response.wcs.BaseWcsApiResponse;
|
||||||
import com.wms_main.model.dto.response.wcs.WcsApiResponse;
|
import com.wms_main.model.dto.response.wcs.WcsApiResponse;
|
||||||
import com.wms_main.model.dto.response.wms.BaseWmsApiResponse;
|
import com.wms_main.model.dto.response.wms.BaseWmsApiResponse;
|
||||||
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||||
|
import com.wms_main.model.vo.wms.InventoryConfirmVo;
|
||||||
import com.wms_main.model.vo.wms.TaskConfirmVo;
|
import com.wms_main.model.vo.wms.TaskConfirmVo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -77,4 +78,25 @@ public interface ITaskControllerService {
|
||||||
* @return 处理结果
|
* @return 处理结果
|
||||||
*/
|
*/
|
||||||
BaseWmsApiResponse confirmCurrentTask(ConfirmTaskRequest confirmTaskRequest);
|
BaseWmsApiResponse confirmCurrentTask(ConfirmTaskRequest confirmTaskRequest);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下发盘点请求
|
||||||
|
* @param inventoryRequest 盘点请求
|
||||||
|
* @return 请求结果
|
||||||
|
*/
|
||||||
|
BaseWmsApiResponse requestInventory(InventoryRequest inventoryRequest);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询盘点任务确认信息
|
||||||
|
* @param inventoryConfirmRequest 请求
|
||||||
|
* @return 请求结果
|
||||||
|
*/
|
||||||
|
WmsApiResponse<InventoryConfirmVo> getInventoryConfirm(InventoryConfirmRequest inventoryConfirmRequest);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认盘点信息
|
||||||
|
* @param inventoryConfirmRequest 确认请求
|
||||||
|
* @return 处理结果
|
||||||
|
*/
|
||||||
|
BaseWmsApiResponse confirmInventory(InventoryConfirmRequest inventoryConfirmRequest);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -402,7 +402,7 @@ public class KateWorkControllerServiceImpl implements IKateWorkControllerService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 更新库存信息
|
// 更新库存信息
|
||||||
stockDataService.updateStockInfo(confirmWorkRequest.getStockConfirm(), confirmWorkRequest.getStandId(), confirmWorkRequest.getUserName(), "配料拣选");
|
stockDataService.updateStockInfo(confirmWorkRequest.getStockConfirm(), confirmWorkRequest.getStandId(), confirmWorkRequest.getUserName(), "配料拣选", null);
|
||||||
// 查询库存获得当前载具中存储的库存列表
|
// 查询库存获得当前载具中存储的库存列表
|
||||||
LambdaQueryWrapper<TAppStock> stockQueryWrapper = new LambdaQueryWrapper<TAppStock>()
|
LambdaQueryWrapper<TAppStock> stockQueryWrapper = new LambdaQueryWrapper<TAppStock>()
|
||||||
.eq(TAppStock::getVehicleId, thisPickTask.getVehicleId())
|
.eq(TAppStock::getVehicleId, thisPickTask.getVehicleId())
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import com.wms_main.constant.enums.wms.*;
|
||||||
import com.wms_main.dao.*;
|
import com.wms_main.dao.*;
|
||||||
import com.wms_main.model.bo.wcs.WcsStackerTask;
|
import com.wms_main.model.bo.wcs.WcsStackerTask;
|
||||||
import com.wms_main.model.bo.wms.GoodsInfoForTask;
|
import com.wms_main.model.bo.wms.GoodsInfoForTask;
|
||||||
|
import com.wms_main.model.bo.wms.StockConfirmEntity;
|
||||||
import com.wms_main.model.bo.wms.TaskConfirmEntity;
|
import com.wms_main.model.bo.wms.TaskConfirmEntity;
|
||||||
import com.wms_main.model.bo.wms.WmsPickTask;
|
import com.wms_main.model.bo.wms.WmsPickTask;
|
||||||
import com.wms_main.model.dto.request.wcs.WcsBoxArriveRequest;
|
import com.wms_main.model.dto.request.wcs.WcsBoxArriveRequest;
|
||||||
|
|
@ -21,6 +22,7 @@ import com.wms_main.model.dto.response.wcs.WcsApiResponse;
|
||||||
import com.wms_main.model.dto.response.wms.BaseWmsApiResponse;
|
import com.wms_main.model.dto.response.wms.BaseWmsApiResponse;
|
||||||
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||||
import com.wms_main.model.po.*;
|
import com.wms_main.model.po.*;
|
||||||
|
import com.wms_main.model.vo.wms.InventoryConfirmVo;
|
||||||
import com.wms_main.model.vo.wms.TaskConfirmVo;
|
import com.wms_main.model.vo.wms.TaskConfirmVo;
|
||||||
import com.wms_main.model.vo.wms.WorkConfirmVo;
|
import com.wms_main.model.vo.wms.WorkConfirmVo;
|
||||||
import com.wms_main.repository.utils.ConvertUtils;
|
import com.wms_main.repository.utils.ConvertUtils;
|
||||||
|
|
@ -60,6 +62,8 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
private final IStockDataService stockDataService;// 库存数据服务
|
private final IStockDataService stockDataService;// 库存数据服务
|
||||||
private final ITAppOutsRecordService appOutsRecordService;// 出库单记录服务
|
private final ITAppOutsRecordService appOutsRecordService;// 出库单记录服务
|
||||||
private final ITAppPickPlanService appPickPlanService;// 拣选计划服务
|
private final ITAppPickPlanService appPickPlanService;// 拣选计划服务
|
||||||
|
private final ITAppInventoryService appInventoryService;// 盘点任务服务
|
||||||
|
private final ITAppInventoryRecordService appInventoryRecordService;// 盘点记录服务
|
||||||
private final AppCommon appCommon;
|
private final AppCommon appCommon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -267,6 +271,10 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (stockOutRequest.getOutType().equals(WmsOutTypeEnums.EMERGE.getCode())) {
|
} else if (stockOutRequest.getOutType().equals(WmsOutTypeEnums.EMERGE.getCode())) {
|
||||||
|
if (!appStandService.exists(new LambdaQueryWrapper<TAppStand>().eq(TAppStand::getStandId, stockOutRequest.getDestination())
|
||||||
|
.eq(TAppStand::getStandType, 1))) {
|
||||||
|
return BaseWmsApiResponse.error("非拣选站台不允许紧急出库。");
|
||||||
|
}
|
||||||
// 判断理由是否输入
|
// 判断理由是否输入
|
||||||
if (StringUtils.isEmpty(stockOutRequest.getReason())) {
|
if (StringUtils.isEmpty(stockOutRequest.getReason())) {
|
||||||
return BaseWmsApiResponse.error("请求错误:紧急出库必须输入原因。");
|
return BaseWmsApiResponse.error("请求错误:紧急出库必须输入原因。");
|
||||||
|
|
@ -712,7 +720,7 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 更新库存信息
|
// 更新库存信息
|
||||||
stockDataService.updateStockInfo(confirmTaskRequest.getStockConfirm(), confirmTaskRequest.getStandId(), confirmTaskRequest.getUserName(), "出库拣选");
|
stockDataService.updateStockInfo(confirmTaskRequest.getStockConfirm(), confirmTaskRequest.getStandId(), confirmTaskRequest.getUserName(), "出库拣选", null);
|
||||||
// 查询库存获得当前载具中存储的库存列表
|
// 查询库存获得当前载具中存储的库存列表
|
||||||
LambdaQueryWrapper<TAppStock> stockQueryWrapper = new LambdaQueryWrapper<TAppStock>()
|
LambdaQueryWrapper<TAppStock> stockQueryWrapper = new LambdaQueryWrapper<TAppStock>()
|
||||||
.eq(TAppStock::getVehicleId, thisPickTask.getVehicleId())
|
.eq(TAppStock::getVehicleId, thisPickTask.getVehicleId())
|
||||||
|
|
@ -743,6 +751,227 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求盘点---实现
|
||||||
|
* @param inventoryRequest 盘点请求
|
||||||
|
* @return 请求结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public BaseWmsApiResponse requestInventory(InventoryRequest inventoryRequest) {
|
||||||
|
if (inventoryRequest == null) {
|
||||||
|
return BaseWmsApiResponse.error("请求为NULL。");
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(inventoryRequest.getStandId())) {
|
||||||
|
return BaseWmsApiResponse.error("请求缺少信息,请输入站台号。");
|
||||||
|
}
|
||||||
|
if (!appStandService.exists(new LambdaQueryWrapper<TAppStand>().eq(TAppStand::getStandId, inventoryRequest.getStandId())
|
||||||
|
.eq(TAppStand::getStandType, 1))) {
|
||||||
|
return BaseWmsApiResponse.error("非拣选站台不允许盘点。");
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(inventoryRequest.getGoodsId())) {
|
||||||
|
return BaseWmsApiResponse.error("请求缺少信息,请输入料号。");
|
||||||
|
}
|
||||||
|
// 判断这个料有没有还没盘点完的任务
|
||||||
|
List<TAppInventory> inventoryList = appInventoryService.list(new LambdaQueryWrapper<TAppInventory>()
|
||||||
|
.eq(TAppInventory::getGoodsId, inventoryRequest.getGoodsId())
|
||||||
|
.eq(StringUtils.isNotEmpty(inventoryRequest.getVehicleId()), TAppInventory::getVehicleId, inventoryRequest.getVehicleId()));
|
||||||
|
if (inventoryList != null && !inventoryList.isEmpty()) {
|
||||||
|
String errMsg = StringUtils.isNotEmpty(inventoryRequest.getVehicleId()) ? "载具:" + inventoryRequest.getVehicleId() : "";
|
||||||
|
return BaseWmsApiResponse.error(errMsg + "料号:" + inventoryRequest.getGoodsId() + "还有盘点任务未完成。");
|
||||||
|
}
|
||||||
|
// 查询库存,创建盘点任务
|
||||||
|
List<TAppStock> stockList = appStockService.list(new LambdaQueryWrapper<TAppStock>()
|
||||||
|
.eq(TAppStock::getGoodsId, inventoryRequest.getGoodsId())
|
||||||
|
.eq(StringUtils.isNotEmpty(inventoryRequest.getVehicleId()), TAppStock::getVehicleId, inventoryRequest.getVehicleId()));
|
||||||
|
if (stockList == null || stockList.isEmpty()) {
|
||||||
|
return BaseWmsApiResponse.error("物料" + inventoryRequest.getGoodsId() + "没有库存。");
|
||||||
|
}
|
||||||
|
// 根据载具号map一下
|
||||||
|
Map<String, TAppInventory> inventoryByVehicleMap = new HashMap<>();
|
||||||
|
// 盘点单号
|
||||||
|
String orderId = UUIDUtils.getNewUUID();
|
||||||
|
for (TAppStock stock : stockList) {
|
||||||
|
if (!inventoryByVehicleMap.containsKey(stock.getVehicleId())) {
|
||||||
|
// 添加盘点任务
|
||||||
|
TAppInventory inventoryTask = new TAppInventory(
|
||||||
|
UUIDUtils.getNewUUID(),
|
||||||
|
inventoryRequest.getGoodsId(),
|
||||||
|
stock.getVehicleId(),
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
inventoryRequest.getStandId(),
|
||||||
|
inventoryRequest.getUserName(),
|
||||||
|
WmsInvTypeEnums.INV_TYPE_1.getCode(),
|
||||||
|
WmsInvStatusEnums.INIT.getCode(),
|
||||||
|
WmsInvResultEnums.NONE.getCode(),
|
||||||
|
LocalDateTime.now(),
|
||||||
|
null,
|
||||||
|
orderId
|
||||||
|
);
|
||||||
|
inventoryByVehicleMap.put(stock.getVehicleId(), inventoryTask);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!inventoryByVehicleMap.isEmpty()) {
|
||||||
|
appInventoryService.saveBatch(inventoryByVehicleMap.values());
|
||||||
|
}
|
||||||
|
// 保存盘点任务
|
||||||
|
return BaseWmsApiResponse.success("创建盘点任务成功。");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询盘点确认信息
|
||||||
|
* @param inventoryConfirmRequest 请求
|
||||||
|
* @return 查询结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public WmsApiResponse<InventoryConfirmVo> getInventoryConfirm(InventoryConfirmRequest inventoryConfirmRequest) {
|
||||||
|
// 判断请求是否参数完备
|
||||||
|
if (inventoryConfirmRequest == null) {
|
||||||
|
return WmsApiResponse.error("请求参数为空。", null);
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(inventoryConfirmRequest.getStandId())) {
|
||||||
|
return WmsApiResponse.error("请求参数缺少站台号。", null);
|
||||||
|
}
|
||||||
|
// 查询当前站台的拣选任务
|
||||||
|
List<TAppPickTask> pickTaskList = appPickTaskService.list(new LambdaQueryWrapper<TAppPickTask>()
|
||||||
|
.eq(TAppPickTask::getPickStand, inventoryConfirmRequest.getStandId())
|
||||||
|
.eq(TAppPickTask::getPickStatus, WmsPickTaskStatusEnum.ARRIVE.getCode()));
|
||||||
|
if (pickTaskList == null || pickTaskList.isEmpty()) {
|
||||||
|
return WmsApiResponse.error("当前站台没有箱子到达, 请检查。", null);
|
||||||
|
}
|
||||||
|
if (pickTaskList.size() > 1) {
|
||||||
|
return WmsApiResponse.error("当前站台有多个箱子到达,请检查。", null);
|
||||||
|
}
|
||||||
|
// 获取当前拣选任务
|
||||||
|
TAppPickTask thisPickTask = pickTaskList.getFirst();
|
||||||
|
InventoryConfirmVo inventoryConfirmVo = conveyTaskService.getInventoryConfirm(thisPickTask.getVehicleId());
|
||||||
|
if (inventoryConfirmVo != null) {
|
||||||
|
// 返回结果
|
||||||
|
return WmsApiResponse.success("查询盘点确认信息成功。", inventoryConfirmVo);
|
||||||
|
}
|
||||||
|
return WmsApiResponse.instanceOf(WmsApiResponseCodeEnums.WARNING.getCode(),"当前箱子没有要盘点的任务,请放行。", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认盘点信息
|
||||||
|
* @param inventoryConfirmRequest 确认请求
|
||||||
|
* @return 处理结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public BaseWmsApiResponse confirmInventory(InventoryConfirmRequest inventoryConfirmRequest) {
|
||||||
|
if (inventoryConfirmRequest == null) {
|
||||||
|
return BaseWmsApiResponse.error("请求信息为空。");
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(inventoryConfirmRequest.getStandId())) {
|
||||||
|
return BaseWmsApiResponse.error("请求信息缺少站台号。");
|
||||||
|
}
|
||||||
|
// 查询当前站台上的已到达的拣选任务
|
||||||
|
List<TAppPickTask> pickTaskList = appPickTaskService.list(new LambdaQueryWrapper<TAppPickTask>()
|
||||||
|
.eq(TAppPickTask::getPickStand, inventoryConfirmRequest.getStandId())
|
||||||
|
.eq(TAppPickTask::getPickStatus, WmsPickTaskStatusEnum.ARRIVE.getCode()));
|
||||||
|
if (pickTaskList == null || pickTaskList.isEmpty()) {
|
||||||
|
return BaseWmsApiResponse.error("当前站台没有箱子到达, 请检查。");
|
||||||
|
}
|
||||||
|
if (pickTaskList.size() > 1) {
|
||||||
|
return BaseWmsApiResponse.error("当前站台有多个箱子到达,请检查。");
|
||||||
|
}
|
||||||
|
// 当前站台到达的拣选任务
|
||||||
|
TAppPickTask thisPickTask = pickTaskList.getFirst();
|
||||||
|
if (StringUtils.isNotEmpty(inventoryConfirmRequest.getInventoryId())) {
|
||||||
|
TAppInventory targetInventory = appInventoryService.getById(inventoryConfirmRequest.getInventoryId());
|
||||||
|
if (targetInventory != null) {
|
||||||
|
if (!Objects.equals(targetInventory.getVehicleId(), thisPickTask.getVehicleId())) {
|
||||||
|
// 盘点的载具号与当前站台到达的拣选任务载具号不一致,请检查。
|
||||||
|
return BaseWmsApiResponse.error("盘点的载具号与当前站台到达的载具号不一致,请检查。");
|
||||||
|
}
|
||||||
|
if (inventoryConfirmRequest.getConfirmNum() == null || inventoryConfirmRequest.getConfirmNum() < 0) {
|
||||||
|
return BaseWmsApiResponse.error("请求信息中的盘点确认数量不正确。");
|
||||||
|
}
|
||||||
|
// 添加盘点记录
|
||||||
|
TAppInventoryRecord inventoryRecord = new TAppInventoryRecord();
|
||||||
|
inventoryRecord.setInventoryId(inventoryConfirmRequest.getInventoryId());
|
||||||
|
inventoryRecord.setGoodsId(targetInventory.getGoodsId());
|
||||||
|
inventoryRecord.setVehicleId(targetInventory.getVehicleId());
|
||||||
|
// 查询这个载具-料号对应的库存数量
|
||||||
|
List<TAppStock> thisVehicleAndGoodsStock = appStockService.list(new LambdaQueryWrapper<TAppStock>()
|
||||||
|
.eq(TAppStock::getVehicleId, targetInventory.getVehicleId())
|
||||||
|
.eq(TAppStock::getGoodsId, targetInventory.getGoodsId()));
|
||||||
|
int stockNum = 0;
|
||||||
|
if (thisVehicleAndGoodsStock != null && !thisVehicleAndGoodsStock.isEmpty()) {
|
||||||
|
// 获取realNum总和
|
||||||
|
stockNum = thisVehicleAndGoodsStock.stream().mapToInt(TAppStock::getRealNum).sum();
|
||||||
|
}
|
||||||
|
inventoryRecord.setStockNum(stockNum);
|
||||||
|
inventoryRecord.setConfirmNum(inventoryConfirmRequest.getConfirmNum());
|
||||||
|
inventoryRecord.setInvStand(inventoryConfirmRequest.getStandId());
|
||||||
|
inventoryRecord.setInvUser(inventoryConfirmRequest.getUserName());
|
||||||
|
inventoryRecord.setInvType(WmsInvTypeEnums.INV_TYPE_1.getCode());
|
||||||
|
inventoryRecord.setInvStatus(WmsInvStatusEnums.CONFIRMED.getCode());
|
||||||
|
if (stockNum < inventoryConfirmRequest.getConfirmNum()) {
|
||||||
|
// 盘盈
|
||||||
|
inventoryRecord.setInvResult(WmsInvResultEnums.PLUS.getCode());
|
||||||
|
} else if (stockNum == inventoryConfirmRequest.getConfirmNum()) {
|
||||||
|
// 正常
|
||||||
|
inventoryRecord.setInvResult(WmsInvResultEnums.EQUAL.getCode());
|
||||||
|
} else {
|
||||||
|
// 盘亏
|
||||||
|
inventoryRecord.setInvResult(WmsInvResultEnums.MINUS.getCode());
|
||||||
|
}
|
||||||
|
inventoryRecord.setInvCreateTime(targetInventory.getInvCreateTime());
|
||||||
|
inventoryRecord.setInvConfirmTime(LocalDateTime.now());
|
||||||
|
inventoryRecord.setInvOrderId(targetInventory.getInventoryId());
|
||||||
|
appInventoryRecordService.save(inventoryRecord);
|
||||||
|
// 移除任务表
|
||||||
|
appInventoryService.removeById(inventoryConfirmRequest.getInventoryId());
|
||||||
|
// 根据盘点确认信息更新库存
|
||||||
|
StockConfirmEntity stockConfirm = new StockConfirmEntity();
|
||||||
|
stockConfirm.setVehicleId(targetInventory.getVehicleId());
|
||||||
|
stockConfirm.setGoodsId(targetInventory.getGoodsId());
|
||||||
|
stockConfirm.setRealRemainQty(inventoryConfirmRequest.getConfirmNum());
|
||||||
|
// 更新库存信息
|
||||||
|
stockDataService.updateStockInfo(stockConfirm, inventoryConfirmRequest.getStandId(), inventoryConfirmRequest.getUserName(), "盘点确认", targetInventory.getInventoryId());
|
||||||
|
} else {
|
||||||
|
return BaseWmsApiResponse.error("请求的盘点任务号未查到对应的盘点任务。");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 查询库存获得当前载具中存储的库存列表
|
||||||
|
LambdaQueryWrapper<TAppStock> stockQueryWrapper = new LambdaQueryWrapper<TAppStock>()
|
||||||
|
.eq(TAppStock::getVehicleId, thisPickTask.getVehicleId());
|
||||||
|
List<TAppStock> stockList = appStockService.list(stockQueryWrapper);
|
||||||
|
// 界面直接点击确认/放行
|
||||||
|
if (!stockList.isEmpty()) {
|
||||||
|
// 判断是否还有其他盘点任务
|
||||||
|
List<TAppInventory> otherInventoryList = appInventoryService.list(new LambdaQueryWrapper<TAppInventory>()
|
||||||
|
.eq(TAppInventory::getVehicleId, thisPickTask.getVehicleId())
|
||||||
|
.ne(TAppInventory::getInventoryId, inventoryConfirmRequest.getInventoryId()));
|
||||||
|
if (otherInventoryList != null && !otherInventoryList.isEmpty()) {
|
||||||
|
return BaseWmsApiResponse.error("当前载具还有其他的盘点任务,请继续盘点。");
|
||||||
|
}
|
||||||
|
// 判断还有没有当前站台的其他拣选任务
|
||||||
|
TaskConfirmVo taskConfirmVo = conveyTaskService.getCurrentStandTask(thisPickTask);
|
||||||
|
if (taskConfirmVo != null) {
|
||||||
|
return BaseWmsApiResponse.warn("当前载具还有紧急出库任务,请切换到出库界面信息进行拣配。");
|
||||||
|
}
|
||||||
|
WorkConfirmVo resultVo = conveyTaskService.getCurrentStandWork(thisPickTask);
|
||||||
|
if (resultVo != null) {
|
||||||
|
return BaseWmsApiResponse.warn("当前载具还有工作,请切换到拣配界面进行拣配。");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 取消后续拣选任务
|
||||||
|
conveyTaskService.cancelOtherStandPickTasks(thisPickTask.getVehicleId(), thisPickTask.getPickStand());
|
||||||
|
}
|
||||||
|
// 放行
|
||||||
|
if (conveyTaskService.releaseStandVehicle(thisPickTask)) {
|
||||||
|
return BaseWmsApiResponse.success("确认成功。");
|
||||||
|
} else {
|
||||||
|
// 回滚事务
|
||||||
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
|
return BaseWmsApiResponse.error("释放箱子失败。");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新出库单信息
|
* 更新出库单信息
|
||||||
* @param confirmTaskRequest 确认信息
|
* @param confirmTaskRequest 确认信息
|
||||||
|
|
|
||||||
|
|
@ -25,4 +25,9 @@ public interface IOutsExecutorService {
|
||||||
* 修复出库单
|
* 修复出库单
|
||||||
*/
|
*/
|
||||||
void repairOuts();
|
void repairOuts();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行盘点
|
||||||
|
*/
|
||||||
|
void executeInventory();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,5 +39,11 @@ public class OutsExecutor implements Job {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("处理出库单失败{}", StringUtils.objectToString(e));
|
log.error("处理出库单失败{}", StringUtils.objectToString(e));
|
||||||
}
|
}
|
||||||
|
// 处理盘点单
|
||||||
|
try {
|
||||||
|
outsExecutorService.executeInventory();
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("处理盘点单失败{}", StringUtils.objectToString(e));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
private final ITAppPickPlanService appPickPlanService;// 拣选计划服务
|
private final ITAppPickPlanService appPickPlanService;// 拣选计划服务
|
||||||
private final IStockDataService stockDataService;// 库存数据服务
|
private final IStockDataService stockDataService;// 库存数据服务
|
||||||
private final ITAppOutsRecordService appOutsRecordService;// 出库单记录服务
|
private final ITAppOutsRecordService appOutsRecordService;// 出库单记录服务
|
||||||
|
private final ITAppInventoryService appInventoryService;// 盘点任务服务
|
||||||
private final AppCommon appCommon;// 应用共通数据
|
private final AppCommon appCommon;// 应用共通数据
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -197,6 +198,7 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理出库(入库用)请求
|
* 处理出库(入库用)请求
|
||||||
|
*
|
||||||
* @param equipVehicleMap 载具与载具编号的映射
|
* @param equipVehicleMap 载具与载具编号的映射
|
||||||
* @param appOuts 出库单
|
* @param appOuts 出库单
|
||||||
* @param allStocks 所有库存
|
* @param allStocks 所有库存
|
||||||
|
|
@ -326,10 +328,6 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
// 不是这个料
|
// 不是这个料
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// if (StringUtils.isNotEmpty(appOuts.getVehicleId()) && !Objects.equals(stock.getVehicleId(), appOuts.getVehicleId())) {
|
|
||||||
// // 紧急出库选择了箱号
|
|
||||||
// continue;
|
|
||||||
// }
|
|
||||||
String stockId = stockDataService.getFirstInStock(stock.getGoodsId(), allStocks);
|
String stockId = stockDataService.getFirstInStock(stock.getGoodsId(), allStocks);
|
||||||
if (StringUtils.isNotEmpty(stockId) && !Objects.equals(stockId, stock.getStockId())) {
|
if (StringUtils.isNotEmpty(stockId) && !Objects.equals(stockId, stock.getStockId())) {
|
||||||
// 不是当前物料最先进的库存
|
// 不是当前物料最先进的库存
|
||||||
|
|
@ -742,8 +740,8 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (work.getWorkStatus() == 2 && work.getLackStatus() == 1) {
|
if (work.getWorkStatus() == 2 && work.getLackStatus() == 1) {
|
||||||
// 缺料,添加记录
|
// 缺料,不算完成
|
||||||
workRecords.add(RecordOfWork(work));
|
ifAllFinished = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// 判断库内料分配的数量是否需要修正
|
// 判断库内料分配的数量是否需要修正
|
||||||
|
|
@ -943,6 +941,143 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理盘点任务
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void executeInventory() {
|
||||||
|
// 查询对应的盘点任务
|
||||||
|
List<TAppInventory> waitExecuteInventoryList = appInventoryService.list(new LambdaQueryWrapper<TAppInventory>()
|
||||||
|
.eq(TAppInventory::getInvStatus, WmsInvStatusEnums.INIT.getCode()));
|
||||||
|
if (waitExecuteInventoryList == null || waitExecuteInventoryList.isEmpty()) {
|
||||||
|
// 没有需要解析的盘点任务
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 筛选出对应载具号
|
||||||
|
List<String> vehicleIds = waitExecuteInventoryList.stream().map(TAppInventory::getVehicleId).distinct().toList();
|
||||||
|
if (vehicleIds.isEmpty()) {
|
||||||
|
// 没有对应载具号
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 查询对应的库存信息
|
||||||
|
List<TAppStock> targetStocks = appStockService.list(new LambdaQueryWrapper<TAppStock>()
|
||||||
|
.in(TAppStock::getVehicleId, vehicleIds)
|
||||||
|
.le(TAppStock::getStockStatus, WmsStockStatusEnums.OUTED.getCode())
|
||||||
|
.orderByAsc(TAppStock::getFirstInTime));
|
||||||
|
// 拣选任务
|
||||||
|
List<TAppPickTask> pickTasks = appPickTaskService.list(new LambdaQueryWrapper<TAppPickTask>()
|
||||||
|
.in(TAppPickTask::getVehicleId, vehicleIds));
|
||||||
|
// 需要保存的信息
|
||||||
|
List<TAppTask> newOutWmsTasks = new ArrayList<>();// 新的出库任务
|
||||||
|
List<TAppPickTask> newPickTasks = new ArrayList<>();// 新的拣选任务
|
||||||
|
List<String> thisTimeOutVehicleIds = new ArrayList<>();// 本次出库载具
|
||||||
|
// 获取可用堆垛机
|
||||||
|
List<TAppEquipment> usableStackers = appEquipmentService.list(new LambdaQueryWrapper<TAppEquipment>()
|
||||||
|
.eq(TAppEquipment::getEquipmentType, 1)
|
||||||
|
.eq(TAppEquipment::getEquipmentStatus, WmsUsableStatusEnums.USABLE.getCode()));
|
||||||
|
Map<Integer, String> equipVehicleMap = new HashMap<>();
|
||||||
|
getVehicleEquipMap("", true, equipVehicleMap, usableStackers);
|
||||||
|
for (TAppInventory inventory : waitExecuteInventoryList) {
|
||||||
|
// 查找
|
||||||
|
for (TAppStock stock : targetStocks) {
|
||||||
|
if (thisTimeOutVehicleIds.contains(stock.getVehicleId())) {
|
||||||
|
// 设置这个箱子的库存都为出库中
|
||||||
|
stock.setStockStatus(WmsStockStatusEnums.OUTING.getCode());
|
||||||
|
}
|
||||||
|
if (!Objects.equals(inventory.getGoodsId(), stock.getGoodsId())) {
|
||||||
|
// 不是这个料
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!Objects.equals(stock.getVehicleId(), inventory.getVehicleId())) {
|
||||||
|
// 不是这个箱子
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (Objects.equals(stock.getStockStatus(), WmsStockStatusEnums.OK.getCode()) && ifThisLocationCantOut(stock.getLocationId(), equipVehicleMap)) {
|
||||||
|
// 当前堆垛机已经无法生成新的出库任务了
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// 拣选任务状态
|
||||||
|
int pickTaskStatus = WmsPickTaskStatusEnum.TEMP.getCode();
|
||||||
|
// 库存正常
|
||||||
|
if (Objects.equals(stock.getStockStatus(), WmsStockStatusEnums.OK.getCode())) {
|
||||||
|
// 需要生成出库任务
|
||||||
|
newOutWmsTasks.add(new TAppTask(
|
||||||
|
UUIDUtils.getNewUUID(),
|
||||||
|
WmsTaskTypeEnums.OUT.getCode(),
|
||||||
|
0,
|
||||||
|
2,
|
||||||
|
stock.getVehicleId(),
|
||||||
|
stock.getLocationId(),
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
LocalDateTime.now(),
|
||||||
|
null,
|
||||||
|
AppConstant.EMPTY_GOODS_ID,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
inventory.getInvUser(),
|
||||||
|
"",
|
||||||
|
inventory.getInvStand(),
|
||||||
|
""
|
||||||
|
));
|
||||||
|
stock.setStockStatus(WmsStockStatusEnums.OUTING.getCode());
|
||||||
|
thisTimeOutVehicleIds.add(stock.getVehicleId());
|
||||||
|
updateVehicleEquipMapByLocation(equipVehicleMap, stock.getVehicleId(), stock.getLocationId());
|
||||||
|
}
|
||||||
|
// 如果是已经出库的库存
|
||||||
|
if (Objects.equals(stock.getStockStatus(), WmsStockStatusEnums.OUTED.getCode())) {
|
||||||
|
pickTaskStatus = WmsPickTaskStatusEnum.WAIT.getCode();
|
||||||
|
}
|
||||||
|
// 已有的拣选任务
|
||||||
|
List<TAppPickTask> oldPickTasks = new ArrayList<>();
|
||||||
|
if (pickTasks != null) {
|
||||||
|
oldPickTasks = pickTasks.stream().filter(pickTask ->
|
||||||
|
Objects.equals(pickTask.getPickStand(), inventory.getInvStand())
|
||||||
|
&& pickTask.getVehicleId().equals(stock.getVehicleId())
|
||||||
|
&& !Objects.equals(pickTask.getPickStatus(), WmsPickTaskStatusEnum.FOR_IN.getCode())).toList();
|
||||||
|
}
|
||||||
|
// 新生成的拣选任务
|
||||||
|
List<TAppPickTask> newOldPickTasks = newPickTasks.stream().filter(pickTask -> pickTask.getVehicleId().equals(stock.getVehicleId())
|
||||||
|
&& Objects.equals(pickTask.getPickStand(), inventory.getInvStand())
|
||||||
|
&& !Objects.equals(pickTask.getPickStatus(), WmsPickTaskStatusEnum.FOR_IN.getCode())).toList();
|
||||||
|
// 生成拣选任务
|
||||||
|
if (oldPickTasks.isEmpty() && newOldPickTasks.isEmpty()) {
|
||||||
|
newPickTasks.add(new TAppPickTask(
|
||||||
|
UUIDUtils.getNewUUID(),
|
||||||
|
inventory.getInvStand(),
|
||||||
|
stock.getVehicleId(),
|
||||||
|
pickTaskStatus,
|
||||||
|
LocalDateTime.now(),
|
||||||
|
null, null, null
|
||||||
|
));
|
||||||
|
}
|
||||||
|
// 设置盘点状态
|
||||||
|
inventory.setInvStatus(WmsInvStatusEnums.EXECUTED.getCode());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 更新盘点信息
|
||||||
|
appInventoryService.updateBatchById(waitExecuteInventoryList);
|
||||||
|
// 保存出库任务
|
||||||
|
if (!newOutWmsTasks.isEmpty()) {
|
||||||
|
appTaskService.saveBatch(newOutWmsTasks);
|
||||||
|
}
|
||||||
|
// 保存拣选任务
|
||||||
|
if (!newPickTasks.isEmpty()) {
|
||||||
|
appPickTaskService.saveBatch(newPickTasks);
|
||||||
|
}
|
||||||
|
// 更新载具信息
|
||||||
|
if (!thisTimeOutVehicleIds.isEmpty()) {
|
||||||
|
appVehicleService.update(new LambdaUpdateWrapper<TAppVehicle>()
|
||||||
|
.set(TAppVehicle::getVehicleStatus, WmsVehicleStatusEnums.OUT.getCode())
|
||||||
|
.in(TAppVehicle::getVehicleId, thisTimeOutVehicleIds));
|
||||||
|
// 更新库存状态
|
||||||
|
appStockService.update(new LambdaUpdateWrapper<TAppStock>()
|
||||||
|
.set(TAppStock::getStockStatus, WmsStockStatusEnums.OUTING.getCode())
|
||||||
|
.in(TAppStock::getVehicleId, thisTimeOutVehicleIds));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 转化记录
|
* 转化记录
|
||||||
*
|
*
|
||||||
|
|
@ -1191,6 +1326,7 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加待删除序号以及记录
|
* 添加待删除序号以及记录
|
||||||
|
*
|
||||||
* @param outIds 待删除id列表
|
* @param outIds 待删除id列表
|
||||||
* @param thisOuts 待删除outs
|
* @param thisOuts 待删除outs
|
||||||
* @param addRecords 待添加的记录
|
* @param addRecords 待添加的记录
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?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.wms_main.mapper.AppInventoryMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?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.wms_main.mapper.AppInventoryRecordMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user