新增用户系统
部分bug修复 11月21日
This commit is contained in:
parent
7e201dd001
commit
c7eebdab59
|
|
@ -5,11 +5,28 @@ import request from "@/http/request";
|
||||||
*/
|
*/
|
||||||
export const getGoodsInfoByPage = (params) => {
|
export const getGoodsInfoByPage = (params) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/goods/getGoodsInfoByPage',
|
url: '/taskQuery/queryOutsByPage',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const upOutsType = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/taskQuery/upOutsType',
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export const editDate = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/taskQuery/editDate',
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据物料id查询物料信息
|
* 根据物料id查询物料信息
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,14 @@ export const requireStockOut = (params) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const requireStockOutEmpty = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/task/requireStockOutEmpty',
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export const getCompareData = (params) => {
|
export const getCompareData = (params) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/task/getCompareData',
|
url: '/task/getCompareData',
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,15 @@ export const queryPickTasksByPage = (params) => {
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const updatePickTaskInfo = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/taskQuery/updatePickTaskInfo',
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 分页查询出库单
|
// 分页查询出库单
|
||||||
export const queryOutsByPage = (params) => {
|
export const queryOutsByPage = (params) => {
|
||||||
return request({
|
return request({
|
||||||
|
|
|
||||||
|
|
@ -147,3 +147,12 @@ export function deleteUserInfo(params) {
|
||||||
timeout: 5000
|
timeout: 5000
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function changePasswordInfo(params) {
|
||||||
|
return request({
|
||||||
|
url: '/user/changePasswordInfo',
|
||||||
|
method: 'post',
|
||||||
|
data: params,
|
||||||
|
timeout: 5000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -177,39 +177,47 @@ export const wmsTaskStatusOptions = [
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
// 拣选任务状态枚举
|
// 拣选任务状态枚举
|
||||||
|
// export const pickingTaskStatusOptions = [
|
||||||
|
// // {
|
||||||
|
// // value: -2,
|
||||||
|
// // label: '入库用'
|
||||||
|
// // },
|
||||||
|
// // {
|
||||||
|
// // value: -1,
|
||||||
|
// // label: '暂存中'
|
||||||
|
// // },
|
||||||
|
// {
|
||||||
|
// value: 0,
|
||||||
|
// label: '待下发'
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// value: 1,
|
||||||
|
// label: '已下发'
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// value: 2,
|
||||||
|
// label: '执行中'
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// value: 3,
|
||||||
|
// label: '已到达'
|
||||||
|
// },
|
||||||
|
// // {
|
||||||
|
// // value: 4,
|
||||||
|
// // label: '已离开'
|
||||||
|
// // },
|
||||||
|
// // {
|
||||||
|
// // value: 5,
|
||||||
|
// // label: '已取消'
|
||||||
|
// // },
|
||||||
|
// ]
|
||||||
|
|
||||||
|
// 确认选项定义类似这样
|
||||||
export const pickingTaskStatusOptions = [
|
export const pickingTaskStatusOptions = [
|
||||||
{
|
{ value: -1, label: '暂存' },
|
||||||
value: -2,
|
{ value: 0, label: '待下发' },
|
||||||
label: '入库用'
|
{ value: 1, label: '已下发' },
|
||||||
},
|
{ value: 3, label: '已到达' }
|
||||||
{
|
|
||||||
value: -1,
|
|
||||||
label: '暂存中'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 0,
|
|
||||||
label: '待下发'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 1,
|
|
||||||
label: '已下发'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 2,
|
|
||||||
label: '执行中'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 3,
|
|
||||||
label: '已到达'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 4,
|
|
||||||
label: '已离开'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 5,
|
|
||||||
label: '已取消'
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
// 是否枚举
|
// 是否枚举
|
||||||
export const yesOrNoOptions = [
|
export const yesOrNoOptions = [
|
||||||
|
|
|
||||||
|
|
@ -11,24 +11,28 @@
|
||||||
<el-input v-model="searchQueryFormEntity.goodsId" @keyup.enter="search()"
|
<el-input v-model="searchQueryFormEntity.goodsId" @keyup.enter="search()"
|
||||||
clearable/>
|
clearable/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="描述">
|
<el-form-item label="工单详情">
|
||||||
<el-input v-model="searchQueryFormEntity.goodsDesc" @keyup.enter="search()"
|
<el-input v-model="searchQueryFormEntity.workOrder" @keyup.enter="search()"
|
||||||
clearable/>
|
clearable/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="工单号">-->
|
||||||
|
<!-- <el-input v-model="searchQueryFormEntity.goodsDesc" @keyup.enter="search()"-->
|
||||||
|
<!-- clearable/>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
</el-row>
|
</el-row>
|
||||||
<div style="align-content: center;">
|
<div style="align-content: center;">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-button type="primary" class="btn-search" @click="search()">查询</el-button>
|
<el-button type="primary" class="btn-search" @click="search()">查询</el-button>
|
||||||
<el-button type="warning" class="btn-search" @click="clearQuery()">清除输入</el-button>
|
<el-button type="warning" class="btn-search" @click="clearQuery()">清除输入</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<!-- <el-row>-->
|
||||||
<el-button style="background-color: #00CED1;" class="btn-search"
|
<!-- <el-button style="background-color: #00CED1;" class="btn-search"-->
|
||||||
@click="openUploadDialog()">导入数据
|
<!-- @click="openUploadDialog()">导入数据-->
|
||||||
</el-button>
|
<!-- </el-button>-->
|
||||||
<el-button type="success" class="btn-search"
|
<!-- <el-button type="success" class="btn-search"-->
|
||||||
@click="exportExcel()">导出excel
|
<!-- @click="exportExcel()">导出excel-->
|
||||||
</el-button>
|
<!-- </el-button>-->
|
||||||
</el-row>
|
<!-- </el-row>-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
@ -43,28 +47,48 @@
|
||||||
<el-radio :label="scope.row.goodsId" v-model="goodsId"> </el-radio>
|
<el-radio :label="scope.row.goodsId" v-model="goodsId"> </el-radio>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column prop="workOrder" label="工单详情" fixed="left" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
<el-table-column prop="goodsId" label="料号" fixed="left" min-width="120px" sortable="custom"
|
<el-table-column prop="goodsId" label="料号" fixed="left" min-width="120px" sortable="custom"
|
||||||
show-overflow-tooltip/>
|
show-overflow-tooltip/>
|
||||||
<el-table-column prop="goodsDescription" label="描述" min-width="120px" sortable="custom"
|
<el-table-column prop="needNum" label="需求数量" min-width="120px" sortable="custom"
|
||||||
show-overflow-tooltip/>
|
show-overflow-tooltip/>
|
||||||
<el-table-column prop="plant" label="工厂" min-width="120px" sortable="custom"
|
<el-table-column prop="distributeNum" label="已分配数量" min-width="120px" sortable="custom"
|
||||||
show-overflow-tooltip/>
|
show-overflow-tooltip/>
|
||||||
<el-table-column prop="vendorName" label="供应商" min-width="120px" sortable="custom"
|
<el-table-column prop="pickNum" label="已拣选数量" min-width="120px" sortable="custom"
|
||||||
show-overflow-tooltip/>
|
show-overflow-tooltip/>
|
||||||
<el-table-column prop="isSled" label="SLED管理" min-width="120px" sortable="custom"
|
<el-table-column prop="outType" label="优先级" min-width="120px" sortable="custom"
|
||||||
show-overflow-tooltip/>
|
show-overflow-tooltip/>
|
||||||
<el-table-column prop="sledDays" label="SLED天数" min-width="120px" sortable="custom"
|
<el-table-column prop="destination" label="呼叫站台" min-width="120px" sortable="custom"
|
||||||
show-overflow-tooltip/>
|
show-overflow-tooltip/>
|
||||||
<el-table-column prop="feedingType" label="补料类型" min-width="120px" sortable="custom"
|
<el-table-column prop="specialStock" label="特殊库存" min-width="120px" sortable="custom"
|
||||||
show-overflow-tooltip/>
|
show-overflow-tooltip/>
|
||||||
<el-table-column prop="boxQty" label="每盒数量" min-width="120px" sortable="custom"
|
<el-table-column prop="specialStockNo" label="特殊库存号" min-width="120px" sortable="custom"
|
||||||
show-overflow-tooltip/>
|
show-overflow-tooltip/>
|
||||||
<el-table-column prop="maxBoxNum" label="最大盒数" min-width="120px" sortable="custom"
|
<el-table-column prop="specialStockItemNo" label="特殊库存Item号" min-width="120px" sortable="custom"
|
||||||
show-overflow-tooltip/>
|
show-overflow-tooltip/>
|
||||||
<el-table-column prop="putArea" label="存放区域" min-width="120px" sortable="custom"
|
<el-table-column prop="batchNo" label="批次号" min-width="120px" sortable="custom"
|
||||||
show-overflow-tooltip/>
|
show-overflow-tooltip/>
|
||||||
<el-table-column prop="hotPoint" label="热点区域" min-width="120px" sortable="custom"
|
<el-table-column prop="taskId" label="任务号" min-width="120px" sortable="custom"
|
||||||
show-overflow-tooltip/>
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column
|
||||||
|
prop="pickingDate"
|
||||||
|
label="执行时间"
|
||||||
|
fixed="right"
|
||||||
|
min-width="120px"
|
||||||
|
sortable="custom"
|
||||||
|
:formatter="(row, column, cellValue) => formatDateToDay(cellValue)"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
|
||||||
|
<el-table-column label="操作" fixed="right" min-width="180px">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<div style="display: flex; gap: 5px; justify-content: center;">
|
||||||
|
<el-button size="default" type="success" @click.stop="handleEdit(scope.row)">编辑</el-button>
|
||||||
|
<el-button size="default" type="warning" @click.stop="handleDelete(scope.row)">加急</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
</el-table>
|
</el-table>
|
||||||
<br/>
|
<br/>
|
||||||
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
||||||
|
|
@ -73,16 +97,27 @@
|
||||||
@current-change="search" layout="total, sizes, prev, pager, next, jumper"
|
@current-change="search" layout="total, sizes, prev, pager, next, jumper"
|
||||||
:total="baseTableQuery.total"/>
|
:total="baseTableQuery.total"/>
|
||||||
</div>
|
</div>
|
||||||
<el-dialog v-model="showUploadDialog" title="上传物料信息" width="40%" draggable :show-close="true">
|
<el-dialog v-model="showEditDialog" title="编辑执行日期" width="30%" draggable>
|
||||||
<fieldset class="search-area">
|
<el-form ref="editFormRef" :model="editForm" label-width="100px">
|
||||||
<legend>导入基础信息</legend>
|
<el-form-item label="执行时间">
|
||||||
<UploadExcelBaseGoods></UploadExcelBaseGoods>
|
<el-date-picker
|
||||||
</fieldset>
|
v-model="editForm.pickingDate"
|
||||||
<fieldset class="search-area">
|
type="date"
|
||||||
<legend>导入看板信息</legend>
|
placeholder="请选择执行时间"
|
||||||
<UploadExcelKanban></UploadExcelKanban>
|
format="YYYY-MM-DD"
|
||||||
</fieldset>
|
value-format="YYYY-MM-DD"
|
||||||
|
style="width: 100%">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="showEditDialog = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="saveEdit(editForm)">确定</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</el-container>
|
</el-container>
|
||||||
</el-config-provider>
|
</el-config-provider>
|
||||||
|
|
@ -91,7 +126,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
import {getGoodsInfoByPage} from '@/api/goods.js'
|
import {editDate, getGoodsInfoByPage, upOutsType} from '@/api/goods.js'
|
||||||
import {ref, reactive, onMounted, nextTick, onBeforeUnmount} from 'vue'
|
import {ref, reactive, onMounted, nextTick, onBeforeUnmount} from 'vue'
|
||||||
import {ElMessage} from 'element-plus'
|
import {ElMessage} from 'element-plus'
|
||||||
import {genTableRequest} from '@/utils/generator.js'
|
import {genTableRequest} from '@/utils/generator.js'
|
||||||
|
|
@ -122,7 +157,8 @@ let baseTableQuery = reactive({
|
||||||
})
|
})
|
||||||
let searchQueryFormEntity = reactive({
|
let searchQueryFormEntity = reactive({
|
||||||
goodsId: '',
|
goodsId: '',
|
||||||
goodsDesc: ''
|
goodsDesc: '',
|
||||||
|
workOrder: '',
|
||||||
})
|
})
|
||||||
let searchQueryFormRef = ref()
|
let searchQueryFormRef = ref()
|
||||||
let rowEditFlag = ref(false)
|
let rowEditFlag = ref(false)
|
||||||
|
|
@ -147,6 +183,81 @@ onBeforeUnmount(() => {
|
||||||
const resizeHeight = () => {
|
const resizeHeight = () => {
|
||||||
maxHeight.value = window.innerHeight * 0.55
|
maxHeight.value = window.innerHeight * 0.55
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 保存编辑
|
||||||
|
const saveEdit = (editForm) => {
|
||||||
|
let request = {
|
||||||
|
taskId: editForm.taskId,
|
||||||
|
pickingDate: editForm.pickingDate
|
||||||
|
}
|
||||||
|
editDate( request).then((res) => {
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
ElMessage({
|
||||||
|
message: '操作成功',
|
||||||
|
type: 'success',
|
||||||
|
});
|
||||||
|
search()
|
||||||
|
} else {
|
||||||
|
ElMessage({
|
||||||
|
message: res.data.message,
|
||||||
|
type: 'error',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
showEditDialog.value = false
|
||||||
|
search() // 刷新表格数据
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 添加优先级
|
||||||
|
const handleDelete = (row) => {
|
||||||
|
//
|
||||||
|
let request = {
|
||||||
|
taskId: row.taskId,
|
||||||
|
}
|
||||||
|
upOutsType( request).then((res) => {
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
ElMessage({
|
||||||
|
message: '操作成功',
|
||||||
|
type: 'success',
|
||||||
|
});
|
||||||
|
search()
|
||||||
|
} else {
|
||||||
|
ElMessage({
|
||||||
|
message: res.data.message,
|
||||||
|
type: 'error',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 编辑弹窗相关
|
||||||
|
const showEditDialog = ref(false)
|
||||||
|
const editForm = reactive({
|
||||||
|
pickingDate: '',
|
||||||
|
taskId: ''
|
||||||
|
})
|
||||||
|
const editFormRef = ref()
|
||||||
|
|
||||||
|
// 打开编辑弹窗
|
||||||
|
const handleEdit = (row) => {
|
||||||
|
editForm.taskId = row.taskId
|
||||||
|
// 使用 formatDateToDay 处理日期,避免时区问题
|
||||||
|
editForm.pickingDate = row.pickingDate ? formatDateToDay(row.pickingDate) : ''
|
||||||
|
showEditDialog.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
const formatDateToDay = (dateString) => {
|
||||||
|
if (!dateString) return '';
|
||||||
|
// 直接解析日期字符串,避免时区转换
|
||||||
|
const date = new Date(dateString);
|
||||||
|
const year = date.getFullYear();
|
||||||
|
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||||
|
const day = String(date.getDate()).padStart(2, '0');
|
||||||
|
return `${year}-${month}-${day}`;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自定义方法
|
* 自定义方法
|
||||||
*/
|
*/
|
||||||
|
|
@ -155,8 +266,10 @@ const search = () => {
|
||||||
tableLoading.value = true
|
tableLoading.value = true
|
||||||
let request = genTableRequest(baseTableQuery)
|
let request = genTableRequest(baseTableQuery)
|
||||||
// 设定查询参数
|
// 设定查询参数
|
||||||
|
request.queryType = 1
|
||||||
request.goodsId = searchQueryFormEntity.goodsId.trim()
|
request.goodsId = searchQueryFormEntity.goodsId.trim()
|
||||||
request.goodsDesc = searchQueryFormEntity.goodsDesc.trim()
|
request.vehicleId = searchQueryFormEntity.goodsDesc.trim()
|
||||||
|
request.workOrder = searchQueryFormEntity.workOrder.trim()
|
||||||
getGoodsInfoByPage(request).then((res) => {
|
getGoodsInfoByPage(request).then((res) => {
|
||||||
const response = res.data
|
const response = res.data
|
||||||
if (response.code === 0) {
|
if (response.code === 0) {
|
||||||
|
|
@ -180,6 +293,7 @@ const search = () => {
|
||||||
const clearQuery = () => {
|
const clearQuery = () => {
|
||||||
searchQueryFormEntity.goodsId = ''
|
searchQueryFormEntity.goodsId = ''
|
||||||
searchQueryFormEntity.goodsDesc = ''
|
searchQueryFormEntity.goodsDesc = ''
|
||||||
|
searchQueryFormEntity.workOrder = ''
|
||||||
}
|
}
|
||||||
const handleSortChange = (data) => {
|
const handleSortChange = (data) => {
|
||||||
if (baseTableQuery.sortBy.has(data.prop)) {
|
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||||
|
|
|
||||||
|
|
@ -253,7 +253,7 @@ const route = useRoute()// 路由
|
||||||
// 系统
|
// 系统
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
startTimer() // 调用启动定时器函数
|
//startTimer() // 调用启动定时器函数
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
|
|
|
||||||
|
|
@ -216,6 +216,8 @@ const getInventory = () => {
|
||||||
childStandOrder = ['P16', 'P15', 'P14']
|
childStandOrder = ['P16', 'P15', 'P14']
|
||||||
} else if (STAND_ID === 'P3') {
|
} else if (STAND_ID === 'P3') {
|
||||||
childStandOrder = ['P19', 'P18', 'P17']
|
childStandOrder = ['P19', 'P18', 'P17']
|
||||||
|
} else {
|
||||||
|
childStandOrder = ['P23', 'P22', 'P21']
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取所有子站台的盘点信息
|
// 获取所有子站台的盘点信息
|
||||||
|
|
@ -267,6 +269,8 @@ const getChildStandIdByIndex = (index) => {
|
||||||
childStandOrder = ['P16', 'P15', 'P14']
|
childStandOrder = ['P16', 'P15', 'P14']
|
||||||
} else if (STAND_ID === 'P3') {
|
} else if (STAND_ID === 'P3') {
|
||||||
childStandOrder = ['P19', 'P18', 'P17']
|
childStandOrder = ['P19', 'P18', 'P17']
|
||||||
|
} else {
|
||||||
|
childStandOrder = ['P23', 'P22', 'P21']
|
||||||
}
|
}
|
||||||
|
|
||||||
return childStandOrder[index] || ''
|
return childStandOrder[index] || ''
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,9 @@ export default {
|
||||||
warningQty: null,
|
warningQty: null,
|
||||||
containerNo: '',
|
containerNo: '',
|
||||||
standId: '',
|
standId: '',
|
||||||
remark: ''
|
remark: '',
|
||||||
|
totalQty: '',
|
||||||
|
isEmpty: ''
|
||||||
},
|
},
|
||||||
transferList: [],
|
transferList: [],
|
||||||
inventoryList: [],
|
inventoryList: [],
|
||||||
|
|
@ -191,6 +193,8 @@ export default {
|
||||||
planPickQty: this.bindingData.planPickQty,
|
planPickQty: this.bindingData.planPickQty,
|
||||||
realPickQty: this.bindingData.realPickQty,
|
realPickQty: this.bindingData.realPickQty,
|
||||||
containerNo: this.bindingData.containerNo,
|
containerNo: this.bindingData.containerNo,
|
||||||
|
totalQty: this.bindingData.totalQty,
|
||||||
|
isEmpty: this.bindingData.isEmpty
|
||||||
},
|
},
|
||||||
stockConfirm: {
|
stockConfirm: {
|
||||||
stockId: this.bindingData.stockId,
|
stockId: this.bindingData.stockId,
|
||||||
|
|
@ -246,6 +250,7 @@ export default {
|
||||||
})
|
})
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
// 用户取消操作
|
// 用户取消操作
|
||||||
|
this.showLoading = false;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -294,6 +299,8 @@ export default {
|
||||||
this.bindingData.planPickQty = result.taskConfirm.planPickQty
|
this.bindingData.planPickQty = result.taskConfirm.planPickQty
|
||||||
this.bindingData.realPickQty = result.taskConfirm.realPickQty
|
this.bindingData.realPickQty = result.taskConfirm.realPickQty
|
||||||
this.bindingData.containerNo = result.taskConfirm.containerNo || '' // 添加 containerNo
|
this.bindingData.containerNo = result.taskConfirm.containerNo || '' // 添加 containerNo
|
||||||
|
this.bindingData.totalQty = result.taskConfirm.totalQty
|
||||||
|
this.bindingData.isEmpty = result.taskConfirm.isEmpty
|
||||||
}
|
}
|
||||||
|
|
||||||
// 从 stockConfirm 对象中获取数据
|
// 从 stockConfirm 对象中获取数据
|
||||||
|
|
|
||||||
|
|
@ -54,14 +54,14 @@
|
||||||
show-overflow-tooltip />
|
show-overflow-tooltip />
|
||||||
<el-table-column prop="leaveTime" label="离开时间" :formatter="timeFormat" min-width="120px" sortable="custom"
|
<el-table-column prop="leaveTime" label="离开时间" :formatter="timeFormat" min-width="120px" sortable="custom"
|
||||||
show-overflow-tooltip />
|
show-overflow-tooltip />
|
||||||
<!-- <el-table-column fixed="right" label="操作" width="170px">
|
<el-table-column fixed="right" label="操作" width="120px">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<div style="display: inline-block; align-content: center;">
|
<div style="display: inline-block; align-content: center;">
|
||||||
<el-button type="primary"
|
<el-button type="primary"
|
||||||
@click="editCurrentRowFormEntity(scope.row)">编辑</el-button>
|
@click="editCurrentRowFormEntity(scope.row)">编辑</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column> -->
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<br />
|
<br />
|
||||||
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
||||||
|
|
@ -72,13 +72,53 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-container>
|
</el-container>
|
||||||
|
<el-dialog v-model="dialogVisible" title="拣选任务详细信息" width="40%" draggable :show-close="false">
|
||||||
|
<div style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
|
||||||
|
<el-form ref="pickTaskFormRef" :model="pickTaskFormEntity" :label-position="labelPosition"
|
||||||
|
label-width="100px" style="width: 95%;" status-icon>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="任务号" prop="pickId">
|
||||||
|
<el-input v-model="pickTaskFormEntity.pickId" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="箱号" prop="vehicleId">
|
||||||
|
<el-input v-model="pickTaskFormEntity.vehicleId" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="目标站台" prop="pickStand">
|
||||||
|
<el-input v-model="pickTaskFormEntity.pickStand" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="任务状态" prop="pickStatus">
|
||||||
|
<el-select-v2 v-model="pickTaskFormEntity.pickStatus" placeholder="请选择任务状态"
|
||||||
|
:options="pickingTaskStatusOptions"></el-select-v2>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="submitInfo(pickTaskFormEntity)">
|
||||||
|
确定
|
||||||
|
</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
</el-config-provider>
|
</el-config-provider>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
import { queryPickTasksByPage } from '@/api/taskQuery.js'
|
import { queryPickTasksByPage,updatePickTaskInfo } from '@/api/taskQuery.js'
|
||||||
import { timeFormatter, pickTaskStatusFormatter } from '@/utils/formatter.js'
|
import { timeFormatter, pickTaskStatusFormatter } from '@/utils/formatter.js'
|
||||||
import { ref, reactive, onMounted, nextTick, onBeforeUnmount } from 'vue'
|
import { ref, reactive, onMounted, nextTick, onBeforeUnmount } from 'vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
|
|
@ -87,6 +127,7 @@ import { labelPosition } from '@/constant/form.js'
|
||||||
import {pickingTaskStatusOptions} from '@/constant/options.js'
|
import {pickingTaskStatusOptions} from '@/constant/options.js'
|
||||||
import { addAllOptionOfOptions } from '@/utils/generator.js'
|
import { addAllOptionOfOptions } from '@/utils/generator.js'
|
||||||
import { loading } from '@/utils/loading'
|
import { loading } from '@/utils/loading'
|
||||||
|
import {errorBox} from "@/utils/myMessageBox";
|
||||||
/**
|
/**
|
||||||
* 常量定义
|
* 常量定义
|
||||||
*/
|
*/
|
||||||
|
|
@ -95,6 +136,10 @@ const USER_NAME = store.getters.getUserName
|
||||||
/**
|
/**
|
||||||
* 变量定义
|
* 变量定义
|
||||||
*/
|
*/
|
||||||
|
// 编辑弹窗相关
|
||||||
|
let dialogVisible = ref(false)
|
||||||
|
let pickTaskFormEntity = reactive({})
|
||||||
|
let pickTaskFormRef = ref()
|
||||||
let maxHeight = ref(window.innerHeight * 0.55)
|
let maxHeight = ref(window.innerHeight * 0.55)
|
||||||
let tableLoading = ref(false)
|
let tableLoading = ref(false)
|
||||||
let tableData = ref([])
|
let tableData = ref([])
|
||||||
|
|
@ -130,6 +175,43 @@ onBeforeUnmount(() => {
|
||||||
const resizeHeight = () => {
|
const resizeHeight = () => {
|
||||||
maxHeight.value = window.innerHeight * 0.55
|
maxHeight.value = window.innerHeight * 0.55
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const editCurrentRowFormEntity = (row) => {
|
||||||
|
pickId = row.pickId
|
||||||
|
Object.assign(pickTaskFormEntity, {
|
||||||
|
pickId: row.pickId,
|
||||||
|
vehicleId: row.vehicleId,
|
||||||
|
pickStand: row.pickStand,
|
||||||
|
pickStatus: parseInt(row.pickStatus) // 确保是数字类型
|
||||||
|
})
|
||||||
|
console.log('编辑行数据:', pickTaskFormEntity) // 调试信息
|
||||||
|
dialogVisible.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const submitInfo = (formData) => {
|
||||||
|
const params = {
|
||||||
|
pickId: formData.pickId,
|
||||||
|
pickStatus: formData.pickStatus,
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
updatePickTaskInfo(params).then(res => {
|
||||||
|
console.log('更新拣选任务参数:', res.data.code)
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
dialogVisible.value = false
|
||||||
|
ElMessage.success('更新拣选任务成功。')
|
||||||
|
} else {
|
||||||
|
console.log(res)
|
||||||
|
errorBox(res.data.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
errorBox('更新拣选任务失败。')
|
||||||
|
})
|
||||||
|
dialogVisible.value = false
|
||||||
|
search() // 更新表格数据
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自定义方法
|
* 自定义方法
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,376 +1,466 @@
|
||||||
<template>
|
<template>
|
||||||
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
|
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
|
||||||
<el-config-provider :locale="zhCn">
|
<el-config-provider :locale="zhCn">
|
||||||
<div style="display: flex;justify-content: space-between;">
|
<div style="display: flex;justify-content: space-between;">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-input v-model="userNameQuery" style="width: 216px; margin-right: 10px;" placeholder="用户名"
|
<el-input v-model="userNameQuery" style="width: 216px; margin-right: 10px;" placeholder="用户名"
|
||||||
:suffix-icon="Search" />
|
:suffix-icon="Search"/>
|
||||||
<el-button type="primary" @click="search()">搜索</el-button>
|
<el-button type="primary" @click="search()">搜索</el-button>
|
||||||
<el-button type="warning" @click="reset()">重置</el-button>
|
<el-button type="warning" @click="reset()">重置</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-button type="success" @click="addOneUser()">新增用户</el-button>
|
<el-button type="success" @click="addOneUser()">新增用户</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br/>
|
||||||
<el-table :data="userList" stripe border v-loading="loading" class="table-class" highlight-current-row
|
<el-table :data="userList" stripe border v-loading="loading" class="table-class" highlight-current-row
|
||||||
max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
||||||
:cell-style="{ 'text-align': 'center' }">
|
:cell-style="{ 'text-align': 'center' }">
|
||||||
<el-table-column width="65px" fixed="left">
|
<el-table-column width="65px" fixed="left">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-radio :label="scope.row.userId" v-model="userId"> </el-radio>
|
<el-radio :label="scope.row.loginAccount" v-model="loginAccount"> </el-radio>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="userId" label="id" fixed="left" min-width="120px" show-overflow-tooltip />
|
<el-table-column prop="loginAccount" label="登录账户" min-width="120px" show-overflow-tooltip/>
|
||||||
<el-table-column prop="userName" label="用户名" min-width="120px" show-overflow-tooltip />
|
<el-table-column prop="userName" label="用户名" min-width="120px" show-overflow-tooltip/>
|
||||||
<el-table-column prop="roleId" label="角色" :formatter="roleFormat" min-width="120px"
|
<el-table-column prop="addTime" label="添加时间" :formatter="timeFormat" show-overflow-tooltip
|
||||||
show-overflow-tooltip />
|
min-width="120px"/>
|
||||||
<el-table-column prop="loginAccount" label="登录账户" min-width="120px" show-overflow-tooltip />
|
<el-table-column prop="updateTime" label="更新时间" :formatter="timeFormat" min-width="120px"
|
||||||
<el-table-column prop="addTime" label="增加时间" :formatter="timeFormat" show-overflow-tooltip
|
show-overflow-tooltip/>
|
||||||
min-width="120px" />
|
<el-table-column prop="addUser" label="添加用户" min-width="120px" show-overflow-tooltip/>
|
||||||
<el-table-column prop="updateTime" label="更新时间" :formatter="timeFormat" min-width="120px"
|
<el-table-column fixed="right" label="操作" min-width="140px">
|
||||||
show-overflow-tooltip />
|
<template v-slot="scope">
|
||||||
<el-table-column prop="addUser" label="添加用户" min-width="120px" show-overflow-tooltip />
|
<div style="display: flex;justify-content: space-between;">
|
||||||
<el-table-column fixed="right" label="操作" min-width="120px">
|
<el-button style="width: 80px" plain type="primary" @click="editCurrentRow(scope.row)">编辑</el-button>
|
||||||
<template v-slot="scope">
|
<el-button style="width: 80px" plain type="warning" @click="changePassword(scope.row)">改密</el-button>
|
||||||
<div style="display: flex;justify-content: space-between;">
|
<el-button style="width: 80px" plain type="danger" @click="deleteCurrentRow(scope.row)">删除</el-button>
|
||||||
<el-button plain type="primary" @click="editCurrentRow(scope.row)">编辑</el-button>
|
</div>
|
||||||
<el-button plain type="danger" @click="deleteCurrentRow(scope.row)">删除</el-button>
|
</template>
|
||||||
</div>
|
</el-table-column>
|
||||||
</template>
|
</el-table>
|
||||||
</el-table-column>
|
<br/>
|
||||||
</el-table>
|
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
||||||
<br />
|
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||||
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
@current-change="search"/>
|
||||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
<el-dialog v-model="dialogVisible" title="编辑用户信息" width="40%" draggable :show-close="false">
|
||||||
@current-change="search" />
|
<div
|
||||||
<el-dialog v-model="dialogVisible" title="编辑用户信息" width="40%" draggable :show-close="false">
|
style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
|
||||||
<div
|
<el-form ref="userFormRef" :model="userFormEntity" :label-position="labelPosition"
|
||||||
style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
|
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
||||||
<el-form ref="userFormRef" :model="userFormEntity" :label-position="labelPosition"
|
<el-row :gutter="16">
|
||||||
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
<el-col :span="12" :offset="0">
|
||||||
<el-row :gutter="16">
|
<el-form-item label="登录账户" prop="loginAccount">
|
||||||
<el-col :span="12" :offset="0">
|
<el-input v-model="userFormEntity.loginAccount" disabled/>
|
||||||
<el-form-item label="用户id" prop="userId">
|
</el-form-item>
|
||||||
<el-input v-model="userFormEntity.userId" disabled />
|
</el-col>
|
||||||
</el-form-item>
|
<el-col :span="12">
|
||||||
</el-col>
|
<el-form-item label="用户名" prop="userName">
|
||||||
<el-col :span="12">
|
<el-input v-model="userFormEntity.userName" clearable/>
|
||||||
<el-form-item label="用户名" prop="userName">
|
</el-form-item>
|
||||||
<el-input v-model="userFormEntity.userName" clearable />
|
</el-col>
|
||||||
</el-form-item>
|
</el-row>
|
||||||
</el-col>
|
</el-form>
|
||||||
</el-row>
|
</div>
|
||||||
<el-row :gutter="16">
|
<template #footer>
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="登录账户" prop="loginAccount">
|
|
||||||
<el-input v-model="userFormEntity.loginAccount" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="角色" prop="roleId">
|
|
||||||
<el-select-v2 v-model="userFormEntity.roleId" placeholder="请选择角色"
|
|
||||||
:options="roleOptions"></el-select-v2>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
<template #footer>
|
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="dialogVisible = false">取消</el-button>
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
<el-button type="primary" @click="submitInfo(userFormEntity)">
|
<el-button type="primary" @click="submitInfo(userFormEntity)">
|
||||||
确定
|
确定
|
||||||
</el-button>
|
</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<el-dialog v-model="addUserDialogVisible" title="添加用户信息" width="40%" draggable :show-close="false">
|
<el-dialog v-model="addUserDialogVisible" title="添加用户信息" width="40%" draggable :show-close="false">
|
||||||
<div
|
<div
|
||||||
style="max-width: 100%; max-height: 350px; overflow: auto; display: flex; justify-content: center;">
|
style="max-width: 100%; max-height: 350px; overflow: auto; display: flex; justify-content: center;">
|
||||||
<el-form ref="addUserFormRef" :model="addUserFormEntity" :label-position="labelPosition"
|
<el-form ref="addUserFormRef" :model="addUserFormEntity" :label-position="labelPosition"
|
||||||
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12">
|
||||||
<el-form-item label="角色" prop="roleIdUpdate">
|
<el-form-item label="用户名" prop="userNameUpdate">
|
||||||
<el-select-v2 v-model="addUserFormEntity.roleIdUpdate" placeholder="请选择角色"
|
<el-input v-model="addUserFormEntity.userNameUpdate" clearable/>
|
||||||
:options="roleOptions"></el-select-v2>
|
</el-form-item>
|
||||||
</el-form-item>
|
</el-col>
|
||||||
</el-col>
|
</el-row>
|
||||||
<el-col :span="12">
|
<el-row :gutter="16">
|
||||||
<el-form-item label="用户名" prop="userNameUpdate">
|
<el-col :span="12" :offset="0">
|
||||||
<el-input v-model="addUserFormEntity.userNameUpdate" clearable />
|
<el-form-item label="登录账户" prop="loginAccountUpdate">
|
||||||
</el-form-item>
|
<el-input v-model="addUserFormEntity.loginAccountUpdate" clearable/>
|
||||||
</el-col>
|
</el-form-item>
|
||||||
</el-row>
|
</el-col>
|
||||||
<el-row :gutter="16">
|
<el-col :span="12">
|
||||||
<el-col :span="12" :offset="0">
|
<el-form-item label="登录密码" prop="loginPasswordUpdate">
|
||||||
<el-form-item label="登录账户" prop="loginAccountUpdate">
|
<el-input v-model="addUserFormEntity.loginPasswordUpdate" show-password clearable/>
|
||||||
<el-input v-model="addUserFormEntity.loginAccountUpdate" clearable />
|
</el-form-item>
|
||||||
</el-form-item>
|
</el-col>
|
||||||
</el-col>
|
</el-row>
|
||||||
<el-col :span="12">
|
</el-form>
|
||||||
<el-form-item label="登录密码" prop="loginPasswordUpdate">
|
</div>
|
||||||
<el-input v-model="addUserFormEntity.loginPasswordUpdate" show-password clearable />
|
<template #footer>
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
<template #footer>
|
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="addUserDialogVisible = false">取消</el-button>
|
<el-button @click="addUserDialogVisible = false">取消</el-button>
|
||||||
<el-button type="primary" @click="submitAddUser(addUserFormEntity)">
|
<el-button type="primary" @click="submitAddUser(addUserFormEntity)">
|
||||||
确认添加
|
确认添加
|
||||||
</el-button>
|
</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</el-config-provider>
|
<el-dialog v-model="passwordDialogVisible" title="修改密码" width="40%" draggable :show-close="false">
|
||||||
</div>
|
<div style="max-width: 100%; max-height: 350px; overflow: auto; display: flex; justify-content: center;">
|
||||||
|
<el-form ref="passwordFormRef" :model="passwordFormEntity" :label-position="labelPosition"
|
||||||
|
label-width="100px" style="width: 95%;" :rules="passwordRules" status-icon>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="登录账户">
|
||||||
|
<el-input v-model="passwordFormEntity.loginAccount" disabled/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="旧密码" prop="oldPassword">
|
||||||
|
<el-input v-model="passwordFormEntity.oldPassword" show-password clearable/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="新密码" prop="newPassword">
|
||||||
|
<el-input v-model="passwordFormEntity.newPassword" show-password clearable/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="确认新密码" prop="confirmPassword">
|
||||||
|
<el-input v-model="passwordFormEntity.confirmPassword" show-password clearable/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="passwordDialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="submitPasswordChange(passwordFormEntity)">
|
||||||
|
确认修改
|
||||||
|
</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</el-config-provider>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import { getUserList, getRoleOptions, updateUserInfo, addUserInfo, deleteUserInfo } from '@/api/user.js'
|
import {getUserList, getRoleOptions, updateUserInfo, addUserInfo, deleteUserInfo, changePasswordInfo} from '@/api/user.js'
|
||||||
import { errorBox } from '@/utils/myMessageBox.js'
|
import {errorBox} from '@/utils/myMessageBox.js'
|
||||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
import {ElMessageBox, ElMessage} from 'element-plus'
|
||||||
import { ref, reactive } from 'vue'
|
import {ref, reactive} from 'vue'
|
||||||
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
import {dateFormatter, timeFormatter} from '@/utils/formatter.js'
|
||||||
import { Search } from '@element-plus/icons-vue'
|
import {Search} from '@element-plus/icons-vue'
|
||||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'role_user',
|
name: 'role_user',
|
||||||
data() {
|
data() {
|
||||||
return {
|
// 密码确认规则
|
||||||
userList: [],
|
const validateConfirmPassword = (rule, value, callback) => {
|
||||||
currentPage: 1,
|
if (value === '') {
|
||||||
pageSize: 10,
|
callback(new Error('请再次输入新密码'))
|
||||||
total: 0,
|
} else if (value !== this.passwordFormEntity.newPassword) {
|
||||||
userNameQuery: '',
|
callback(new Error('两次输入的密码不一致'))
|
||||||
loading: true,
|
} else {
|
||||||
dialogVisible: false,
|
callback()
|
||||||
userId: '',
|
}
|
||||||
userFormEntity: reactive({}),
|
}
|
||||||
userFormRef: ref(),
|
return {
|
||||||
labelPosition: 'top',
|
userList: [],
|
||||||
rules: reactive({}),
|
currentPage: 1,
|
||||||
roleOptions: [],
|
pageSize: 10,
|
||||||
addUserDialogVisible: false,
|
total: 0,
|
||||||
addUserFormEntity: reactive({}),
|
userNameQuery: '',
|
||||||
addUserFormRef: ref(),
|
loading: true,
|
||||||
|
dialogVisible: false,
|
||||||
|
loginAccount: '',
|
||||||
|
userFormEntity: reactive({}),
|
||||||
|
userFormRef: ref(),
|
||||||
|
labelPosition: 'top',
|
||||||
|
rules: reactive({}),
|
||||||
|
roleOptions: [],
|
||||||
|
addUserDialogVisible: false,
|
||||||
|
addUserFormEntity: reactive({}),
|
||||||
|
addUserFormRef: ref(),
|
||||||
|
|
||||||
|
|
||||||
|
passwordDialogVisible: false,
|
||||||
|
passwordFormEntity: reactive({
|
||||||
|
loginAccount: '',
|
||||||
|
oldPassword: '',
|
||||||
|
newPassword: '',
|
||||||
|
confirmPassword: ''
|
||||||
|
}),
|
||||||
|
passwordFormRef: ref(),
|
||||||
|
passwordRules: {
|
||||||
|
oldPassword: [
|
||||||
|
{ required: true, message: '请输入旧密码', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
newPassword: [
|
||||||
|
{ required: true, message: '请输入新密码', trigger: 'blur' },
|
||||||
|
{ min: 6, message: '密码长度至少6位', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
confirmPassword: [
|
||||||
|
{ required: true, message: '请确认新密码', trigger: 'blur' },
|
||||||
|
{ validator: validateConfirmPassword, trigger: 'blur' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.search()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 添加修改密码相关方法
|
||||||
|
changePassword(row) {
|
||||||
|
this.passwordFormEntity = {
|
||||||
|
loginAccount: row.loginAccount,
|
||||||
|
oldPassword: '',
|
||||||
|
newPassword: '',
|
||||||
|
confirmPassword: ''
|
||||||
|
}
|
||||||
|
this.passwordDialogVisible = true
|
||||||
|
},
|
||||||
|
|
||||||
|
getRoleOptions() {
|
||||||
|
const request = {
|
||||||
|
roleId: store.getters.getUser.roleId,
|
||||||
|
}
|
||||||
|
getRoleOptions(request).then(res => {
|
||||||
|
const tableResponse = res.data
|
||||||
|
if (tableResponse.code == 0) {
|
||||||
|
this.roleOptions = tableResponse.data
|
||||||
|
} else {
|
||||||
|
this.roleOptions = []
|
||||||
}
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
this.roleOptions = []
|
||||||
|
})
|
||||||
},
|
},
|
||||||
mounted() {
|
search() {
|
||||||
this.getRoleOptions()
|
this.loading = true
|
||||||
this.search()
|
const request = {
|
||||||
|
pageNo: this.currentPage,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
userName: store.getters.getUserName,
|
||||||
|
roleId: store.getters.getUser.roleId,
|
||||||
|
}
|
||||||
|
getUserList(request).then(res => {
|
||||||
|
const tableResponse = res.data
|
||||||
|
if (tableResponse.code == 0) {
|
||||||
|
this.userList = tableResponse.data.lists
|
||||||
|
this.total = tableResponse.data.total
|
||||||
|
} else {
|
||||||
|
errorBox(tableResponse.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
errorBox('查询用户列表错误')
|
||||||
|
})
|
||||||
|
this.loading = false
|
||||||
},
|
},
|
||||||
methods: {
|
dateFormat: (row, column, cellValue, index) => {
|
||||||
getRoleOptions() {
|
return dateFormatter(cellValue)
|
||||||
const request = {
|
},
|
||||||
roleId: store.getters.getUser.roleId,
|
timeFormat: (row, column, cellValue, index) => {
|
||||||
|
return timeFormatter(cellValue)
|
||||||
|
},
|
||||||
|
roleFormat(row, column, cellValue, index) {
|
||||||
|
const roleOptionInfo = this.roleOptions.find(item => {
|
||||||
|
return item.value == cellValue
|
||||||
|
})
|
||||||
|
return roleOptionInfo == null | undefined ? '未知角色' : roleOptionInfo.label
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
|
this.userNameQuery = ''
|
||||||
|
this.search()
|
||||||
|
},
|
||||||
|
editCurrentRow(row) {
|
||||||
|
this.userId = row.userId
|
||||||
|
this.userFormEntity = {
|
||||||
|
userId: row.userId,
|
||||||
|
userName: row.userName,
|
||||||
|
loginAccount: row.loginAccount,
|
||||||
|
roleId: row.roleId,
|
||||||
|
}
|
||||||
|
// this.getRoleOptions()
|
||||||
|
this.dialogVisible = true
|
||||||
|
},
|
||||||
|
submitPasswordChange(formData) {
|
||||||
|
this.$refs.passwordFormRef.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
const params = {
|
||||||
|
loginAccountUpdate: formData.loginAccount,
|
||||||
|
oldPassword: formData.oldPassword,
|
||||||
|
newPassword: formData.newPassword,
|
||||||
|
roleIdOp: store.getters.getUser.roleId,
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
|
||||||
|
// 调用修改密码的API(假设为 changePassword API)
|
||||||
|
changePasswordInfo(params).then(res => {
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
this.passwordDialogVisible = false
|
||||||
|
ElMessage.success('密码修改成功。')
|
||||||
|
} else {
|
||||||
|
errorBox(res.data.message)
|
||||||
}
|
}
|
||||||
getRoleOptions(request).then(res => {
|
}).catch(err => {
|
||||||
const tableResponse = res.data
|
console.log(err)
|
||||||
if (tableResponse.code == 0) {
|
errorBox('密码修改失败。')
|
||||||
this.roleOptions = tableResponse.returnData
|
})
|
||||||
} else {
|
}
|
||||||
this.roleOptions = []
|
})
|
||||||
}
|
},
|
||||||
}).catch(err => {
|
deleteCurrentRow(row) {
|
||||||
console.log(err)
|
this.loginAccount = row.loginAccount
|
||||||
this.roleOptions = []
|
ElMessageBox.confirm(
|
||||||
})
|
'该操作会从数据库中删除用户。\n是否继续',
|
||||||
},
|
'警告',
|
||||||
search() {
|
{
|
||||||
this.loading = true
|
confirmButtonText: '确认',
|
||||||
const request = {
|
cancelButtonText: '取消',
|
||||||
pageNo: this.currentPage,
|
type: 'warning',
|
||||||
pageSize: this.pageSize,
|
}
|
||||||
userName: this.userNameQuery.trim(),
|
).then(() => {
|
||||||
roleId: store.getters.getUser.roleId,
|
const params = {
|
||||||
}
|
loginAccountUpdate: row.loginAccount,
|
||||||
getUserList(request).then(res => {
|
roleIdOp: store.getters.getUser.roleId,
|
||||||
const tableResponse = res.data
|
userName: store.getters.getUserName
|
||||||
if (tableResponse.code == 0) {
|
}
|
||||||
this.userList = tableResponse.returnData.lists
|
deleteUserInfo(params).then(res => {
|
||||||
this.total = tableResponse.returnData.total
|
if (res.data.code == 0) {
|
||||||
} else {
|
ElMessage.success('删除用户信息成功。')
|
||||||
errorBox(tableResponse.message)
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err)
|
|
||||||
errorBox('查询用户列表错误')
|
|
||||||
})
|
|
||||||
this.loading = false
|
|
||||||
},
|
|
||||||
dateFormat: (row, column, cellValue, index) => {
|
|
||||||
return dateFormatter(cellValue)
|
|
||||||
},
|
|
||||||
timeFormat: (row, column, cellValue, index) => {
|
|
||||||
return timeFormatter(cellValue)
|
|
||||||
},
|
|
||||||
roleFormat(row, column, cellValue, index) {
|
|
||||||
const roleOptionInfo = this.roleOptions.find(item => {
|
|
||||||
return item.value == cellValue
|
|
||||||
})
|
|
||||||
return roleOptionInfo == null|undefined ? '未知角色' : roleOptionInfo.label
|
|
||||||
},
|
|
||||||
reset() {
|
|
||||||
this.userNameQuery = ''
|
|
||||||
this.search()
|
this.search()
|
||||||
},
|
} else {
|
||||||
editCurrentRow(row) {
|
errorBox(res.data.message)
|
||||||
this.userId = row.userId
|
}
|
||||||
this.userFormEntity = {
|
}).catch(err => {
|
||||||
userId: row.userId,
|
console.log(err)
|
||||||
userName: row.userName,
|
errorBox('删除用户信息失败。')
|
||||||
loginAccount: row.loginAccount,
|
})
|
||||||
roleId: row.roleId,
|
}).catch(() => {
|
||||||
}
|
ElMessage.info('操作取消')
|
||||||
this.dialogVisible = true
|
})
|
||||||
},
|
|
||||||
deleteCurrentRow(row) {
|
|
||||||
this.userId = row.userId
|
|
||||||
if (store.getters.getUser.roleId != 1) {
|
|
||||||
errorBox("操作人员必须是管理员级别。")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
ElMessageBox.confirm(
|
|
||||||
'该操作会从数据库中删除用户。\n是否继续',
|
|
||||||
'警告',
|
|
||||||
{
|
|
||||||
confirmButtonText: '确认',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning',
|
|
||||||
}
|
|
||||||
).then(() => {
|
|
||||||
const params = {
|
|
||||||
userIdUpdate: row.userId,
|
|
||||||
roleId1: store.getters.getUser.roleId,
|
|
||||||
userName: store.getters.getUserName
|
|
||||||
}
|
|
||||||
deleteUserInfo(params).then(res => {
|
|
||||||
if (res.data.code == 0) {
|
|
||||||
ElMessage.success('删除用户信息成功。')
|
|
||||||
this.search()
|
|
||||||
} else {
|
|
||||||
errorBox(res.data.message)
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err)
|
|
||||||
errorBox('删除用户信息失败。')
|
|
||||||
})
|
|
||||||
}).catch(() => {
|
|
||||||
ElMessage.info('操作取消')
|
|
||||||
})
|
|
||||||
},
|
|
||||||
addOneUser() {
|
|
||||||
this.addUserFormEntity = {
|
|
||||||
roleIdUpdate: null,
|
|
||||||
userNameUpdate: '',
|
|
||||||
loginAccountUpdate: '',
|
|
||||||
loginPasswordUpdate: '',
|
|
||||||
}
|
|
||||||
this.addUserDialogVisible = true
|
|
||||||
},
|
|
||||||
submitInfo(formData) {
|
|
||||||
const params = {
|
|
||||||
roleIdUpdate: formData.roleId,
|
|
||||||
userIdUpdate: formData.userId,
|
|
||||||
userNameUpdate: formData.userName,
|
|
||||||
loginAccountUpdate: formData.loginAccount,
|
|
||||||
roleId1: store.getters.getUser.roleId,
|
|
||||||
userName: store.getters.getUserName
|
|
||||||
}
|
|
||||||
updateUserInfo(params).then(res => {
|
|
||||||
if (res.data.code == 0) {
|
|
||||||
this.dialogVisible = false
|
|
||||||
ElMessage.success('更新用户信息成功。')
|
|
||||||
this.search()
|
|
||||||
} else {
|
|
||||||
errorBox(res.data.message)
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err)
|
|
||||||
errorBox('更新用户信息失败。')
|
|
||||||
})
|
|
||||||
},
|
|
||||||
submitAddUser(formData) {
|
|
||||||
const params = {
|
|
||||||
roleIdUpdate: formData.roleIdUpdate,
|
|
||||||
userNameUpdate: formData.userNameUpdate,
|
|
||||||
loginAccountUpdate: formData.loginAccountUpdate,
|
|
||||||
loginPasswordUpdate: formData.loginPasswordUpdate,
|
|
||||||
roleId1: store.getters.getUser.roleId,
|
|
||||||
userName: store.getters.getUserName
|
|
||||||
}
|
|
||||||
addUserInfo(params).then(res => {
|
|
||||||
if (res.data.code == 0) {
|
|
||||||
this.addUserDialogVisible = false
|
|
||||||
ElMessage.success('添加用户信息成功。')
|
|
||||||
this.search()
|
|
||||||
} else {
|
|
||||||
errorBox(res.data.message)
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err)
|
|
||||||
errorBox('添加用户信息失败。')
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getCurrentRow(row) {
|
|
||||||
this.userId = row.userId
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
addOneUser() {
|
||||||
|
this.addUserFormEntity = {
|
||||||
|
roleIdUpdate: null,
|
||||||
|
userNameUpdate: '',
|
||||||
|
loginAccountUpdate: '',
|
||||||
|
loginPasswordUpdate: '',
|
||||||
|
}
|
||||||
|
this.getRoleOptions()
|
||||||
|
this.addUserDialogVisible = true
|
||||||
|
},
|
||||||
|
submitInfo(formData) {
|
||||||
|
const params = {
|
||||||
|
roleIdUpdate: formData.roleId,
|
||||||
|
userNameUpdate: formData.userName,
|
||||||
|
loginAccountUpdate: formData.loginAccount,
|
||||||
|
roleIdOp: store.getters.getUser.roleId,
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
updateUserInfo(params).then(res => {
|
||||||
|
if (res.data.code == 0) {
|
||||||
|
this.dialogVisible = false
|
||||||
|
ElMessage.success('更新用户信息成功。')
|
||||||
|
this.search()
|
||||||
|
} else {
|
||||||
|
errorBox(res.data.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
errorBox('更新用户信息失败。')
|
||||||
|
})
|
||||||
|
},
|
||||||
|
submitAddUser(formData) {
|
||||||
|
const params = {
|
||||||
|
roleIdUpdate: formData.roleIdUpdate,
|
||||||
|
userNameUpdate: formData.userNameUpdate,
|
||||||
|
loginAccountUpdate: formData.loginAccountUpdate,
|
||||||
|
loginPasswordUpdate: formData.loginPasswordUpdate,
|
||||||
|
roleIdOp: store.getters.getUser.roleId,
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
addUserInfo(params).then(res => {
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
this.addUserDialogVisible = false
|
||||||
|
ElMessage.success('添加用户信息成功。')
|
||||||
|
this.search()
|
||||||
|
} else {
|
||||||
|
errorBox(res.data.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
errorBox('添加用户信息失败。')
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getCurrentRow(row) {
|
||||||
|
this.userId = row.userId
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.el-pagination {
|
.el-pagination {
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-row .el-button {
|
.el-row .el-button {
|
||||||
width: 72px;
|
width: 72px;
|
||||||
margin-left: 0px;
|
margin-left: 0px;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-class {
|
.table-class {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-row .el-form-item {
|
.el-row .el-form-item {
|
||||||
width: 10% inherit;
|
width: 10% inherit;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-row .el-form-item .el-select-v2 {
|
.el-row .el-form-item .el-select-v2 {
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-row .el-form-item .el-input-number {
|
.el-row .el-form-item .el-input-number {
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-row .el-form-item .el-button {
|
.el-row .el-form-item .el-button {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title-area {
|
.title-area {
|
||||||
display: flex;
|
display: flex;
|
||||||
/* min-height: 10%; */
|
/* min-height: 10%; */
|
||||||
max-height: max-content;
|
max-height: max-content;
|
||||||
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;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -33,6 +33,7 @@
|
||||||
</el-row>
|
</el-row>
|
||||||
<div style="align-content: center;">
|
<div style="align-content: center;">
|
||||||
<el-row>
|
<el-row>
|
||||||
|
<el-button type="danger" class="btn-search" @click="openEmptyBoxDialog()">出空箱</el-button>
|
||||||
<el-button type="primary" class="btn-search" @click="search()">查询</el-button>
|
<el-button type="primary" class="btn-search" @click="search()">查询</el-button>
|
||||||
<el-button type="warning" class="btn-search" @click="clearQuery()">清除输入</el-button>
|
<el-button type="warning" class="btn-search" @click="clearQuery()">清除输入</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
@ -80,94 +81,42 @@
|
||||||
@current-change="search" layout="total, sizes, prev, pager, next, jumper"
|
@current-change="search" layout="total, sizes, prev, pager, next, jumper"
|
||||||
:total="baseTableQuery.total" />
|
:total="baseTableQuery.total" />
|
||||||
</div>
|
</div>
|
||||||
<el-dialog v-model="rowEditFlag" title="工作信息" width="40%" draggable :show-close="false">
|
|
||||||
<el-form ref="rowEditFormRef" :model="rowFormEntity" :label-position="labelPosition"
|
|
||||||
label-width="100px" style="max-width: 100%" status-icon>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="工作编号">
|
|
||||||
<el-input v-model="rowFormEntity.workIndex" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="工单号">
|
|
||||||
<el-input v-model="rowFormEntity.workOrder" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="总成号">
|
|
||||||
<el-input v-model="rowFormEntity.productId" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="成品号">
|
|
||||||
<el-input v-model="rowFormEntity.singleProductId" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="料盒号">
|
|
||||||
<el-input v-model="rowFormEntity.boxNo" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="料号">
|
|
||||||
<el-input v-model="rowFormEntity.goodsId" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="需求数量">
|
|
||||||
<el-input-number v-model.number="rowFormEntity.needNum" controls-position="right"
|
|
||||||
:min="0" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="已完成数量">
|
|
||||||
<el-input-number v-model.number="rowFormEntity.finishNum" controls-position="right"
|
|
||||||
:min="0" :max="rowFormEntity.needNum" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="已分配数量">
|
|
||||||
<el-input-number v-model.number="rowFormEntity.distributeNum"
|
|
||||||
controls-position="right" :min="0" :max="rowFormEntity.needNum" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="工作状态">
|
|
||||||
<el-select-v2 v-model="rowFormEntity.workStatus" placeholder="请选择工作状态"
|
|
||||||
:options="workStatusOptions"></el-select-v2>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="缺料状态">
|
|
||||||
<el-select-v2 v-model="rowFormEntity.lackStatus" placeholder="请选择缺料状态"
|
|
||||||
:options="lackStatusOptions"></el-select-v2>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
<template #footer>
|
|
||||||
<span class="dialog-footer">
|
|
||||||
<el-button type="primary" @click="rowEditFlag = false">取消</el-button>
|
|
||||||
<el-button type="success" @click="submitUpdateRow(rowFormEntity)">
|
|
||||||
确定
|
|
||||||
</el-button>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</el-container>
|
</el-container>
|
||||||
</el-config-provider>
|
</el-config-provider>
|
||||||
|
<el-dialog v-model="emptyBoxDialogVisible" title="出空箱" width="30%" draggable :show-close="false">
|
||||||
|
<el-form ref="emptyBoxFormRef" :model="emptyBoxFormEntity" label-width="100px" status-icon>
|
||||||
|
<el-form-item label="箱号" prop="vehicleId">
|
||||||
|
<el-input
|
||||||
|
v-model="emptyBoxFormEntity.vehicleId"
|
||||||
|
placeholder="请输入箱号"
|
||||||
|
clearable
|
||||||
|
@input="handleVehicleIdInput"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
label="出空箱数量"
|
||||||
|
prop="quantity"
|
||||||
|
:rules="[{ required: true, message: '请输入数量', trigger: 'blur' }]">
|
||||||
|
<el-input-number
|
||||||
|
v-model="emptyBoxFormEntity.quantity"
|
||||||
|
controls-position="right"
|
||||||
|
:min="1"
|
||||||
|
:max="9999"
|
||||||
|
:disabled="!!(emptyBoxFormEntity.vehicleId && emptyBoxFormEntity.vehicleId.trim() !== '')"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="cancelEmptyBox()">取消</el-button>
|
||||||
|
<el-button type="primary" @click="submitEmptyBox()">确定</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|
@ -182,9 +131,20 @@ import { labelPosition } from '@/constant/form.js'
|
||||||
import { yesOrNoOptions, vehicleStatusOptions } from '@/constant/options.js'
|
import { yesOrNoOptions, vehicleStatusOptions } from '@/constant/options.js'
|
||||||
import { addAllOptionOfOptions } from '@/utils/generator.js'
|
import { addAllOptionOfOptions } from '@/utils/generator.js'
|
||||||
import { loading } from '@/utils/loading'
|
import { loading } from '@/utils/loading'
|
||||||
|
import {requireStockOutEmpty} from "@/api/task";
|
||||||
|
import {errorBox} from "@/utils/myMessageBox";
|
||||||
|
// 修改导入语句,添加正确的API函数
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 常量定义
|
* 常量定义
|
||||||
*/
|
*/
|
||||||
|
// 添加出空箱相关的响应式数据
|
||||||
|
const emptyBoxDialogVisible = ref(false)
|
||||||
|
const emptyBoxFormRef = ref()
|
||||||
|
const emptyBoxFormEntity = reactive({
|
||||||
|
quantity: 1,
|
||||||
|
vehicleId: '' // 新增箱号字段
|
||||||
|
})
|
||||||
const STAND_ID = store.getters.getStandId
|
const STAND_ID = store.getters.getStandId
|
||||||
const USER_NAME = store.getters.getUserName
|
const USER_NAME = store.getters.getUserName
|
||||||
/**
|
/**
|
||||||
|
|
@ -230,9 +190,17 @@ onBeforeUnmount(() => {
|
||||||
const resizeHeight = () => {
|
const resizeHeight = () => {
|
||||||
maxHeight.value = window.innerHeight * 0.55
|
maxHeight.value = window.innerHeight * 0.55
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自定义方法
|
* 自定义方法
|
||||||
*/
|
*/
|
||||||
|
const handleVehicleIdInput = (value) => {
|
||||||
|
// 如果输入了箱号,则限制数量为1
|
||||||
|
if (value && value.trim() !== '') {
|
||||||
|
emptyBoxFormEntity.quantity = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 查询
|
// 查询
|
||||||
const search = () => {
|
const search = () => {
|
||||||
tableLoading.value = true
|
tableLoading.value = true
|
||||||
|
|
@ -357,6 +325,59 @@ const submitUpdateRow = (rowFormEntity) => {
|
||||||
loading.close()
|
loading.close()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 出空箱功能相关方法
|
||||||
|
*/
|
||||||
|
const openEmptyBoxDialog = () => {
|
||||||
|
emptyBoxDialogVisible.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
const cancelEmptyBox = () => {
|
||||||
|
emptyBoxDialogVisible.value = false
|
||||||
|
emptyBoxFormEntity.quantity = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
const submitEmptyBox = async () => {
|
||||||
|
try {
|
||||||
|
// 验证表单
|
||||||
|
if (!emptyBoxFormRef.value) return
|
||||||
|
|
||||||
|
await emptyBoxFormRef.value.validate()
|
||||||
|
|
||||||
|
// 构造请求参数
|
||||||
|
const request = {
|
||||||
|
outType: 1,
|
||||||
|
needNum: emptyBoxFormEntity.quantity,
|
||||||
|
vehicleId: emptyBoxFormEntity.vehicleId,
|
||||||
|
standId: STAND_ID,
|
||||||
|
userName: USER_NAME,
|
||||||
|
destination: STAND_ID
|
||||||
|
}
|
||||||
|
|
||||||
|
// 显示加载状态
|
||||||
|
loading.open('提交中...')
|
||||||
|
requireStockOutEmpty(request).then(res => {
|
||||||
|
const response = res.data
|
||||||
|
if (response.code === 0) {
|
||||||
|
// 成功
|
||||||
|
ElMessage.success(response.message)
|
||||||
|
} else {
|
||||||
|
errorBox(response.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
errorBox('请求错误。')
|
||||||
|
}).finally(() => {
|
||||||
|
loading.close()
|
||||||
|
})
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
loading.close()
|
||||||
|
console.error('提交出空箱数量失败:', error)
|
||||||
|
ElMessage.error('提交出空箱数量失败')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.content {
|
.content {
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,18 @@
|
||||||
package com.wms_main.controller.wms;
|
package com.wms_main.controller.wms;
|
||||||
|
|
||||||
import com.wms_main.model.po.TAppInventory;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.wms_main.model.po.TAppOuts;
|
import com.wms_main.dao.impl.TAppLocationServiceImpl;
|
||||||
import com.wms_main.model.po.TAppPickTask;
|
import com.wms_main.dao.impl.TAppStockServiceImpl;
|
||||||
import com.wms_main.model.po.TAppTask;
|
import com.wms_main.model.po.TAppLocation;
|
||||||
|
import com.wms_main.model.po.TAppStock;
|
||||||
import com.wms_main.service.controller.IDataControllerService;
|
import com.wms_main.service.controller.IDataControllerService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
import java.util.ArrayList;
|
||||||
import java.lang.annotation.Retention;
|
import java.util.HashMap;
|
||||||
import java.lang.annotation.RetentionPolicy;
|
|
||||||
import java.lang.annotation.Target;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 看板数据类
|
* 看板数据类
|
||||||
|
|
@ -24,6 +24,161 @@ import java.util.List;
|
||||||
@RequestMapping("/wms/board")
|
@RequestMapping("/wms/board")
|
||||||
public class DataController {
|
public class DataController {
|
||||||
private final IDataControllerService dataControllerService;
|
private final IDataControllerService dataControllerService;
|
||||||
|
private final TAppStockServiceImpl tAppStockService;
|
||||||
|
private final TAppLocationServiceImpl tAppLocationService;
|
||||||
|
|
||||||
|
@GetMapping("/api/query/queryRecentTask")
|
||||||
|
public Map<String, Object> queryRecentTask() {
|
||||||
|
try {
|
||||||
|
List<Map<String, Object>> result = dataControllerService.queryRecentTask();
|
||||||
|
Map<String, Object> response = new HashMap<>();
|
||||||
|
response.put("isSuccess", true);
|
||||||
|
response.put("responseCode", 0);
|
||||||
|
response.put("responseMessage", "查询成功");
|
||||||
|
response.put("returnData", result);
|
||||||
|
return response;
|
||||||
|
} catch (Exception e) {
|
||||||
|
Map<String, Object> response = new HashMap<>();
|
||||||
|
response.put("isSuccess", false);
|
||||||
|
response.put("responseCode", -1);
|
||||||
|
response.put("responseMessage", "查询失败: " + e.getMessage());
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/api/query/queryStockDetail")
|
||||||
|
public Map<String, Object> queryStockDetail(@RequestBody Map<String, Object> request) {
|
||||||
|
try {
|
||||||
|
// 提取请求参数
|
||||||
|
String requestDate = (String) request.get("requestDate");
|
||||||
|
String locationId = (String) request.get("locationId");
|
||||||
|
|
||||||
|
// 验证请求时间参数
|
||||||
|
if (requestDate == null || requestDate.isEmpty()) {
|
||||||
|
Map<String, Object> response = new HashMap<>();
|
||||||
|
response.put("isSuccess", false);
|
||||||
|
response.put("responseCode", 500);
|
||||||
|
response.put("responseMessage", "请求时间不能为空");
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
// 调用服务层查询库存详情
|
||||||
|
//List<Map<String, Object>> stockDetails = dataControllerService.queryStockDetail(locationId);
|
||||||
|
|
||||||
|
List<Map<String, Object>> stockDetails = new ArrayList<>();
|
||||||
|
|
||||||
|
// 1. 构造查询条件
|
||||||
|
LambdaQueryWrapper<TAppStock> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(TAppStock::getLocationId, locationId);
|
||||||
|
|
||||||
|
// 2. 查询库存数据
|
||||||
|
List<TAppStock> stockList = tAppStockService.list(queryWrapper);
|
||||||
|
|
||||||
|
if (stockList.isEmpty()){
|
||||||
|
Map<String, Object> response = new HashMap<>();
|
||||||
|
response.put("isSuccess", false);
|
||||||
|
response.put("responseCode", 500);
|
||||||
|
response.put("responseMessage", "库存数据为空");
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 转换为 Map 格式返回
|
||||||
|
for (TAppStock stock : stockList) {
|
||||||
|
Map<String, Object> item = new HashMap<>();
|
||||||
|
item.put("goodsId", stock.getGoodsId()); // 物料编号
|
||||||
|
item.put("goodsName", stock.getGoodsDesc()); // 物料名称
|
||||||
|
item.put("goodsNum", stock.getRealNum()); // 物料数量
|
||||||
|
item.put("wareDate", stock.getFirstInTime()); // 库上架时间
|
||||||
|
item.put("specialStock", stock.getSpecialStock()); // 质量(kg)
|
||||||
|
item.put("specialStockNo", stock.getSpecialStockNo()); // 产期
|
||||||
|
item.put("specialStockItemNo", stock.getSpecialStockItemNo()); // 到期期
|
||||||
|
item.put("batchId", stock.getBatchNo()); // 批次号
|
||||||
|
stockDetails.add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 构造符合要求的返回数据结构
|
||||||
|
Map<String, Object> locationInfo = new HashMap<>();
|
||||||
|
locationInfo.put("locationId", locationId); // 使用传入的locationId
|
||||||
|
locationInfo.put("vesselNo", stockList.getFirst().getVehicleId()); // 这里需要根据实际业务获取vesselNo
|
||||||
|
locationInfo.put("locationData", stockDetails);
|
||||||
|
|
||||||
|
List<Map<String, Object>> result = new ArrayList<>();
|
||||||
|
result.add(locationInfo);
|
||||||
|
|
||||||
|
// 构造成功响应
|
||||||
|
Map<String, Object> response = new HashMap<>();
|
||||||
|
response.put("isSuccess", true);
|
||||||
|
response.put("responseCode", 0);
|
||||||
|
response.put("responseMessage", "查询成功");
|
||||||
|
response.put("returnData", result);
|
||||||
|
return response;
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 构造失败响应
|
||||||
|
Map<String, Object> response = new HashMap<>();
|
||||||
|
response.put("isSuccess", false);
|
||||||
|
response.put("responseCode", 500);
|
||||||
|
response.put("responseMessage", "查询失败: " + e.getMessage());
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/api/query/queryLocationDetail")
|
||||||
|
public Map<String, Object> queryLocationDetail() {
|
||||||
|
try {
|
||||||
|
// 查询所有库位数据
|
||||||
|
List<TAppLocation> locationList = tAppLocationService.list();
|
||||||
|
|
||||||
|
// 转换为所需格式
|
||||||
|
List<Map<String, Object>> result = new ArrayList<>();
|
||||||
|
for (TAppLocation location : locationList) {
|
||||||
|
Map<String, Object> item = new HashMap<>();
|
||||||
|
item.put("locationId", location.getLocationId()); // 库位编号
|
||||||
|
item.put("row", location.getLRow());
|
||||||
|
item.put("line", location.getLCol());
|
||||||
|
item.put("layer", location.getLLayer());
|
||||||
|
item.put("deep", 1); // 深度默认返回1
|
||||||
|
item.put("locationStatus", location.getIsOccupy());
|
||||||
|
// 设置库位状态(根据是否有库存判断)
|
||||||
|
result.add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, Object> response = new HashMap<>();
|
||||||
|
response.put("isSuccess", true);
|
||||||
|
response.put("responseCode", 0);
|
||||||
|
response.put("responseMessage", "查询成功");
|
||||||
|
response.put("returnData", result);
|
||||||
|
return response;
|
||||||
|
} catch (Exception e) {
|
||||||
|
Map<String, Object> response = new HashMap<>();
|
||||||
|
response.put("isSuccess", false);
|
||||||
|
response.put("responseCode", 500);
|
||||||
|
response.put("responseMessage", "查询失败: " + e.getMessage());
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/api/query/queryRunningTask")
|
||||||
|
public Map<String, Object> queryRunningTask() {
|
||||||
|
try {
|
||||||
|
// 调用服务层查询运行中的任务数据
|
||||||
|
List<Map<String, Object>> result = dataControllerService.queryRunningTask();
|
||||||
|
|
||||||
|
Map<String, Object> response = new HashMap<>();
|
||||||
|
response.put("isSuccess", true);
|
||||||
|
response.put("responseCode", 0);
|
||||||
|
response.put("responseMessage", "查询成功");
|
||||||
|
response.put("returnData", result);
|
||||||
|
return response;
|
||||||
|
} catch (Exception e) {
|
||||||
|
Map<String, Object> response = new HashMap<>();
|
||||||
|
response.put("isSuccess", false);
|
||||||
|
response.put("responseCode", 500);
|
||||||
|
response.put("responseMessage", "查询失败: " + e.getMessage());
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,16 @@ public class TaskController {
|
||||||
return taskControllerService.requireStockOut(stockOutRequest);
|
return taskControllerService.requireStockOut(stockOutRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求出库空箱
|
||||||
|
* @param stockOutRequest 获取请求
|
||||||
|
* @return 处理结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/requireStockOutEmpty")
|
||||||
|
public BaseWmsApiResponse requireStockOutEmpty(@RequestBody StockOutRequest stockOutRequest) {
|
||||||
|
return taskControllerService.requireStockOutEmpty(stockOutRequest);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拉取EWM系统的库存信息进行比对
|
* 拉取EWM系统的库存信息进行比对
|
||||||
*/
|
*/
|
||||||
|
|
@ -103,10 +113,10 @@ public class TaskController {
|
||||||
* @param voiRequest 请求信息
|
* @param voiRequest 请求信息
|
||||||
* @return 处理结果
|
* @return 处理结果
|
||||||
*/
|
*/
|
||||||
// @PostMapping("/requireVehiclesForIn")
|
// @PostMapping("/requireVehiclesForIn")
|
||||||
// public BaseWmsApiResponse requireVehiclesForIn(@RequestBody VehicleOutForInRequest voiRequest) {
|
public BaseWmsApiResponse requireVehiclesForIn(@RequestBody VehicleOutForInRequest voiRequest) {
|
||||||
// return taskControllerService.requireVehiclesForIn(voiRequest);
|
return taskControllerService.requireVehiclesForIn(voiRequest);
|
||||||
// }
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 接收wcs反馈任务状态
|
* 接收wcs反馈任务状态
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import com.wms_main.model.dto.query.OutsQuery;
|
||||||
import com.wms_main.model.dto.query.PickTaskQuery;
|
import com.wms_main.model.dto.query.PickTaskQuery;
|
||||||
import com.wms_main.model.dto.query.WmsTaskQuery;
|
import com.wms_main.model.dto.query.WmsTaskQuery;
|
||||||
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||||
|
import com.wms_main.model.po.TAppPickTask;
|
||||||
import com.wms_main.model.vo.wms.*;
|
import com.wms_main.model.vo.wms.*;
|
||||||
import com.wms_main.service.controller.ITaskQueryControllerService;
|
import com.wms_main.service.controller.ITaskQueryControllerService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
@ -77,6 +78,39 @@ public class TaskQueryController {
|
||||||
return taskQueryControllerService.queryOutsByPage(outsQuery);
|
return taskQueryControllerService.queryOutsByPage(outsQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新出库单信息
|
||||||
|
*
|
||||||
|
* @param appTask 出库单信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/updatePickTaskInfo")
|
||||||
|
public WmsApiResponse<String> updatePickTaskInfo(@RequestBody TAppPickTask appTask) {
|
||||||
|
return taskQueryControllerService.updateOutsInfo(appTask);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出库提高优先级
|
||||||
|
* @param outsVo 修改参数
|
||||||
|
* @return 修改结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/upOutsType")
|
||||||
|
public WmsApiResponse<String> upOutsType(@RequestBody OutsVo outsVo)
|
||||||
|
{
|
||||||
|
return taskQueryControllerService.upOutsType(outsVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
outs修改出库日期
|
||||||
|
*/
|
||||||
|
@PostMapping("/editDate")
|
||||||
|
public WmsApiResponse<String> editDate(@RequestBody OutsVo outsVo)
|
||||||
|
{
|
||||||
|
return taskQueryControllerService.editDate(outsVo);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 盘点信息分页查询
|
* 盘点信息分页查询
|
||||||
* @param inventoryQuery 查询参数
|
* @param inventoryQuery 查询参数
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,14 @@
|
||||||
package com.wms_main.controller.wms;
|
package com.wms_main.controller.wms;
|
||||||
|
|
||||||
|
import com.wms_main.model.dto.query.UserQuery;
|
||||||
|
import com.wms_main.model.dto.query.UserUpdateRequest;
|
||||||
|
import com.wms_main.model.dto.response.wms.BaseWmsApiResponse;
|
||||||
|
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||||
|
import com.wms_main.model.vo.wms.PageVo;
|
||||||
|
import com.wms_main.model.vo.wms.UserVo;
|
||||||
|
import com.wms_main.service.controller.IUserControllerService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户控制类
|
* 用户控制类
|
||||||
|
|
@ -16,4 +20,57 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@RequestMapping("/wms/user")
|
@RequestMapping("/wms/user")
|
||||||
public class UserController {
|
public class UserController {
|
||||||
|
private final IUserControllerService userControllerService;
|
||||||
|
/**
|
||||||
|
* 查询用户列表
|
||||||
|
* @param userQuery 查询参数
|
||||||
|
* @return 查询结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/getUserList")
|
||||||
|
WmsApiResponse<PageVo<UserVo>> getUserList(@RequestBody UserQuery userQuery) {
|
||||||
|
return userControllerService.getUserList(userQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加用户信息
|
||||||
|
* @param userUpdateRequest 添加参数
|
||||||
|
* @return 添加结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/addUserInfo")
|
||||||
|
BaseWmsApiResponse addUserInfo(@RequestBody UserUpdateRequest userUpdateRequest) {
|
||||||
|
return userControllerService.addUserInfo(userUpdateRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除用户信息
|
||||||
|
* @param userUpdateRequest 删除参数
|
||||||
|
* @return 删除结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/deleteUserInfo")
|
||||||
|
BaseWmsApiResponse deleteUserInfo(@RequestBody UserUpdateRequest userUpdateRequest) {
|
||||||
|
return userControllerService.deleteUserInfo(userUpdateRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新用户信息
|
||||||
|
* @param userUpdateRequest 更新参数
|
||||||
|
* @return 更新结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/updateUserInfo")
|
||||||
|
BaseWmsApiResponse updateUserInfo(@RequestBody UserUpdateRequest userUpdateRequest) {
|
||||||
|
return userControllerService.updateUserInfo(userUpdateRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户密码
|
||||||
|
* @param userUpdateRequest 密码修改参数
|
||||||
|
* @return 修改结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/changePasswordInfo")
|
||||||
|
BaseWmsApiResponse changePassword(@RequestBody UserUpdateRequest userUpdateRequest) {
|
||||||
|
return userControllerService.changePassword(userUpdateRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务确认实体
|
* 任务确认实体
|
||||||
*/
|
*/
|
||||||
|
|
@ -53,4 +55,17 @@ public class TaskConfirmEntity {
|
||||||
*/
|
*/
|
||||||
@JsonProperty("containerNo")
|
@JsonProperty("containerNo")
|
||||||
private String containerNo;
|
private String containerNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 需求合并数量
|
||||||
|
*/
|
||||||
|
@JsonProperty("totalQty")
|
||||||
|
private Integer totalQty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否空
|
||||||
|
*/
|
||||||
|
@JsonProperty("isEmpty")
|
||||||
|
private int isEmpty;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import lombok.NoArgsConstructor;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 出库单查询
|
* 出库单查询
|
||||||
|
|
@ -83,4 +84,18 @@ public class OutsQuery extends PageQuery {
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDateTime requestTime;
|
private LocalDateTime requestTime;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拣货日期
|
||||||
|
*/
|
||||||
|
@JsonProperty("pickingDate")
|
||||||
|
private Date pickingDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单号
|
||||||
|
*/
|
||||||
|
@JsonProperty("workOrder")
|
||||||
|
private String workOrder;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,87 @@
|
||||||
|
package com.wms_main.model.dto.query;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户查询类
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class UserQuery extends PageQuery{
|
||||||
|
/**
|
||||||
|
* 登录账号
|
||||||
|
*/
|
||||||
|
@JsonProperty("loginAccount")
|
||||||
|
private String loginAccount;
|
||||||
|
/**
|
||||||
|
* 登录密码
|
||||||
|
*/
|
||||||
|
@JsonProperty("loginPassword")
|
||||||
|
private String loginPassword;
|
||||||
|
/**
|
||||||
|
* 用户名---显示
|
||||||
|
*/
|
||||||
|
@JsonProperty("userName")
|
||||||
|
private String userName;
|
||||||
|
/**
|
||||||
|
* 角色id
|
||||||
|
*/
|
||||||
|
@JsonProperty("roleId")
|
||||||
|
private String roleId;
|
||||||
|
/**
|
||||||
|
* 登录状态
|
||||||
|
*/
|
||||||
|
@JsonProperty("loginStatus")
|
||||||
|
private Integer loginStatus;
|
||||||
|
/**
|
||||||
|
* 账号状态
|
||||||
|
*/
|
||||||
|
@JsonProperty("accountStatus")
|
||||||
|
private Integer accountStatus;
|
||||||
|
/**
|
||||||
|
* 上次登录设备
|
||||||
|
*/
|
||||||
|
@JsonProperty("lastLoginDevice")
|
||||||
|
private String lastLoginDevice;
|
||||||
|
/**
|
||||||
|
* 上次登录时间
|
||||||
|
*/
|
||||||
|
@JsonProperty("lastLoginTime")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime lastLoginTime;
|
||||||
|
/**
|
||||||
|
* 添加用户
|
||||||
|
*/
|
||||||
|
@JsonProperty("addUser")
|
||||||
|
private String addUser;
|
||||||
|
/**
|
||||||
|
* 添加时间
|
||||||
|
*/
|
||||||
|
@JsonProperty("addTime")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime addTime;
|
||||||
|
/**
|
||||||
|
* 上次更新用户
|
||||||
|
*/
|
||||||
|
@JsonProperty("lastUpdateUser")
|
||||||
|
private String lastUpdateUser;
|
||||||
|
/**
|
||||||
|
* 上次更新时间
|
||||||
|
*/
|
||||||
|
@JsonProperty("lastUpdateTime")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime lastUpdateTime;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
package com.wms_main.model.dto.query;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.wms_main.model.dto.request.wms.BaseWmsRequest;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户更新请求
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class UserUpdateRequest extends BaseWmsRequest {
|
||||||
|
/**
|
||||||
|
* 角色id1
|
||||||
|
*/
|
||||||
|
@JsonProperty("roleIdOp")
|
||||||
|
private String roleIdOp;
|
||||||
|
/**
|
||||||
|
* 新增用户角色
|
||||||
|
*/
|
||||||
|
@JsonProperty("roleIdUpdate")
|
||||||
|
private String roleIdUpdate;
|
||||||
|
/**
|
||||||
|
* 用户名
|
||||||
|
*/
|
||||||
|
@JsonProperty("userNameUpdate")
|
||||||
|
private String userNameUpdate;
|
||||||
|
/**
|
||||||
|
* 登录账号
|
||||||
|
*/
|
||||||
|
@JsonProperty("loginAccountUpdate")
|
||||||
|
private String loginAccountUpdate;
|
||||||
|
/**
|
||||||
|
* 登录密码
|
||||||
|
*/
|
||||||
|
@JsonProperty("loginPasswordUpdate")
|
||||||
|
private String loginPasswordUpdate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旧密码
|
||||||
|
*/
|
||||||
|
@JsonProperty("oldPassword")
|
||||||
|
private String oldPassword;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新密码
|
||||||
|
*/
|
||||||
|
@JsonProperty("newPassword")
|
||||||
|
private String newPassword;
|
||||||
|
}
|
||||||
|
|
@ -15,6 +15,7 @@ public class EwmApiLocalResponse {
|
||||||
private String billNo; // 单据号(ASN)
|
private String billNo; // 单据号(ASN)
|
||||||
private String billType; // 单据类型
|
private String billType; // 单据类型
|
||||||
private String containerNo; // 容器号(可选)
|
private String containerNo; // 容器号(可选)
|
||||||
|
private boolean emptyContainer; // 是否空箱
|
||||||
private List<TaskDetailInfo> taskDetailInfo; // 任务明细列表
|
private List<TaskDetailInfo> taskDetailInfo; // 任务明细列表
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.wms_main.model.po;
|
package com.wms_main.model.po;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
|
@ -141,4 +142,14 @@ public class TAppOuts {
|
||||||
*/
|
*/
|
||||||
@TableField(value = "picking_date")
|
@TableField(value = "picking_date")
|
||||||
private Date pickingDate;
|
private Date pickingDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拣货计划ID
|
||||||
|
*/
|
||||||
|
@TableField(value = "pick_plan_id")
|
||||||
|
private String pickPlanId;
|
||||||
|
|
||||||
|
|
||||||
|
@TableField(value = "pick_plan_id_times")
|
||||||
|
private int pickPlanIdTimes;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.wms_main.model.po;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
@ -78,4 +79,5 @@ public class TAppOutsRecord {
|
||||||
*/
|
*/
|
||||||
@TableField(value = "work_order")
|
@TableField(value = "work_order")
|
||||||
private String workOrder;
|
private String workOrder;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,4 +52,16 @@ public class TAppPickPlan {
|
||||||
*/
|
*/
|
||||||
@TableField(value = "stand_id")
|
@TableField(value = "stand_id")
|
||||||
private String standId;
|
private String standId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户工单号
|
||||||
|
*/
|
||||||
|
@TableField(value = "order_no")
|
||||||
|
private String orderNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 箱子是否用完
|
||||||
|
*/
|
||||||
|
@TableField(value = "is_empty")
|
||||||
|
private Integer isEmpty;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import lombok.NoArgsConstructor;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 出库单Vo
|
* 出库单Vo
|
||||||
|
|
@ -77,6 +78,43 @@ public class OutsVo {
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDateTime requestTime;
|
private LocalDateTime requestTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 特殊库存标识(可选)
|
||||||
|
*/
|
||||||
|
@JsonProperty("specialStock")
|
||||||
|
private String specialStock;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* so单号与供应商编号,出库指定SO号或者供应商编号出库(可选)
|
||||||
|
*/
|
||||||
|
@JsonProperty("specialStockNo")
|
||||||
|
private String specialStockNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 特殊库存item号(可选)
|
||||||
|
*/
|
||||||
|
@JsonProperty("specialStockItemNo")
|
||||||
|
private String specialStockItemNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批次号(可选)
|
||||||
|
*/
|
||||||
|
@JsonProperty("batchNo")
|
||||||
|
private String batchNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单
|
||||||
|
*/
|
||||||
|
@JsonProperty("workOrder")
|
||||||
|
private String workOrder;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拣货日期
|
||||||
|
*/
|
||||||
|
@JsonProperty("pickingDate")
|
||||||
|
private Date pickingDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将po转换为vo
|
* 将po转换为vo
|
||||||
* @param po 数据库实体
|
* @param po 数据库实体
|
||||||
|
|
@ -97,7 +135,13 @@ public class OutsVo {
|
||||||
po.getDestination(),
|
po.getDestination(),
|
||||||
po.getUserName(),
|
po.getUserName(),
|
||||||
po.getReason(),
|
po.getReason(),
|
||||||
po.getRequestTime()
|
po.getRequestTime(),
|
||||||
|
po.getSpecialStock(),
|
||||||
|
po.getSpecialStockNo(),
|
||||||
|
po.getSpecialStockItemNo(),
|
||||||
|
po.getBatchNo(),
|
||||||
|
po.getWorkOrder(),
|
||||||
|
po.getPickingDate()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -121,7 +165,10 @@ public class OutsVo {
|
||||||
po.getDestination(),
|
po.getDestination(),
|
||||||
po.getUserName(),
|
po.getUserName(),
|
||||||
po.getReason(),
|
po.getReason(),
|
||||||
po.getRequestTime()
|
po.getRequestTime(),
|
||||||
|
null,null,null,null,
|
||||||
|
po.getWorkOrder(),
|
||||||
|
null
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,14 @@
|
||||||
package com.wms_main.model.vo.wms;
|
package com.wms_main.model.vo.wms;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.wms_main.model.po.TSysUser;
|
import com.wms_main.model.po.TSysUser;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户Vo
|
* 用户Vo
|
||||||
|
|
@ -14,20 +18,71 @@ import lombok.NoArgsConstructor;
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class UserVo {
|
public class UserVo {
|
||||||
/**
|
/**
|
||||||
* 登录账户
|
* 登录账号
|
||||||
*/
|
*/
|
||||||
@JsonProperty("loginAccount")
|
@JsonProperty("loginAccount")
|
||||||
private String loginAccount;
|
private String loginAccount;
|
||||||
/**
|
/**
|
||||||
* 用户名
|
* 登录密码
|
||||||
|
*/
|
||||||
|
@JsonProperty("loginPassword")
|
||||||
|
private String loginPassword;
|
||||||
|
/**
|
||||||
|
* 用户名---显示
|
||||||
*/
|
*/
|
||||||
@JsonProperty("userName")
|
@JsonProperty("userName")
|
||||||
private String userName;
|
private String userName;
|
||||||
/**
|
/**
|
||||||
* 角色Id
|
* 角色id
|
||||||
*/
|
*/
|
||||||
@JsonProperty("roleId")
|
@JsonProperty("roleId")
|
||||||
private String roleId;
|
private String roleId;
|
||||||
|
/**
|
||||||
|
* 登录状态
|
||||||
|
*/
|
||||||
|
@JsonProperty("loginStatus")
|
||||||
|
private Integer loginStatus;
|
||||||
|
/**
|
||||||
|
* 账号状态
|
||||||
|
*/
|
||||||
|
@JsonProperty("accountStatus")
|
||||||
|
private Integer accountStatus;
|
||||||
|
/**
|
||||||
|
* 上次登录设备
|
||||||
|
*/
|
||||||
|
@JsonProperty("lastLoginDevice")
|
||||||
|
private String lastLoginDevice;
|
||||||
|
/**
|
||||||
|
* 上次登录时间
|
||||||
|
*/
|
||||||
|
@JsonProperty("lastLoginTime")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime lastLoginTime;
|
||||||
|
/**
|
||||||
|
* 添加用户
|
||||||
|
*/
|
||||||
|
@JsonProperty("addUser")
|
||||||
|
private String addUser;
|
||||||
|
/**
|
||||||
|
* 添加时间
|
||||||
|
*/
|
||||||
|
@JsonProperty("addTime")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime addTime;
|
||||||
|
/**
|
||||||
|
* 上次更新用户
|
||||||
|
*/
|
||||||
|
@JsonProperty("lastUpdateUser")
|
||||||
|
private String lastUpdateUser;
|
||||||
|
/**
|
||||||
|
* 上次更新时间
|
||||||
|
*/
|
||||||
|
@JsonProperty("lastUpdateTime")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime lastUpdateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 从po转化为vo
|
* 从po转化为vo
|
||||||
|
|
@ -39,6 +94,14 @@ public class UserVo {
|
||||||
userVo.setLoginAccount(userPo.getLoginAccount());
|
userVo.setLoginAccount(userPo.getLoginAccount());
|
||||||
userVo.setUserName(userPo.getUserName());
|
userVo.setUserName(userPo.getUserName());
|
||||||
userVo.setRoleId(userPo.getRoleId());
|
userVo.setRoleId(userPo.getRoleId());
|
||||||
|
userVo.setLoginStatus(userPo.getLoginStatus());
|
||||||
|
userVo.setAccountStatus(userPo.getAccountStatus());
|
||||||
|
userVo.setLastLoginDevice(userPo.getLastLoginDevice());
|
||||||
|
userVo.setLastLoginTime(userPo.getLastLoginTime());
|
||||||
|
userVo.setAddUser(userPo.getAddUser());
|
||||||
|
userVo.setAddTime(userPo.getAddTime());
|
||||||
|
userVo.setLastUpdateUser(userPo.getLastUpdateUser());
|
||||||
|
userVo.setLastUpdateTime(userPo.getLastUpdateTime());
|
||||||
return userVo;
|
return userVo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
package com.wms_main.repository.utils;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.PlatformTransactionManager;
|
||||||
|
import org.springframework.transaction.TransactionDefinition;
|
||||||
|
import org.springframework.transaction.TransactionStatus;
|
||||||
|
import org.springframework.transaction.support.DefaultTransactionDefinition;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class DbTransUtils {
|
||||||
|
private final PlatformTransactionManager transactionManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行一个事务方法
|
||||||
|
* @param baseTran 事务类
|
||||||
|
* @return 执行结果
|
||||||
|
*/
|
||||||
|
public boolean useTran(Runnable baseTran) {
|
||||||
|
DefaultTransactionDefinition def = new DefaultTransactionDefinition();
|
||||||
|
def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
|
||||||
|
TransactionStatus status = transactionManager.getTransaction(def);
|
||||||
|
try {
|
||||||
|
baseTran.run();
|
||||||
|
transactionManager.commit(status);
|
||||||
|
return true;
|
||||||
|
} catch (Exception e) {
|
||||||
|
transactionManager.rollback(status);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -62,6 +62,23 @@ public class StringUtils {
|
||||||
return str + c.repeat(Math.max(0, length - str.length()));
|
return str + c.repeat(Math.max(0, length - str.length()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验证密码是否正确
|
||||||
|
* @param inputPassword 用户输入的明文密码
|
||||||
|
* @param storedPassword 数据库中存储的加密密码
|
||||||
|
* @return 验证结果 true:密码正确
|
||||||
|
*/
|
||||||
|
public static boolean verifyPassword(String inputPassword, String storedPassword) {
|
||||||
|
if (isEmpty(inputPassword) || isEmpty(storedPassword)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 对输入的明文密码进行相同的加密处理
|
||||||
|
String encryptedInput = encryptPassword(inputPassword);
|
||||||
|
// 比较加密后的结果是否与存储的密码一致
|
||||||
|
return encryptedInput.equals(storedPassword);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断一个字符串是否为数字
|
* 判断一个字符串是否为数字
|
||||||
* @param str 要判断的字符串
|
* @param str 要判断的字符串
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@ import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wcs接口服务实现
|
* Wcs接口服务实现
|
||||||
*/
|
*/
|
||||||
|
|
@ -32,39 +34,121 @@ public class WcsApiServiceImpl implements IWcsApiService {
|
||||||
* @param request 任务请求
|
* @param request 任务请求
|
||||||
* @return 响应结果
|
* @return 响应结果
|
||||||
*/
|
*/
|
||||||
|
// @Override
|
||||||
|
// public WcsApiResponse<WcsStackerTask> sendWcsStackerTask(WcsStackerTaskRequest request) {
|
||||||
|
// // 设置http请求
|
||||||
|
// HttpRequest httpRequest = HttpRequest.postInstanceOf(appCommon.getConfigByKey(AppConfigKeyEnums.WCS_STACKER_TASK_URL.getKey()), request);
|
||||||
|
// httpRequest.setTimeout(30000);
|
||||||
|
// HttpResponse httpResponse = httpClient.httpPost(httpRequest);
|
||||||
|
// if (httpResponse != null && httpResponse.isSuccess()) {
|
||||||
|
// WcsApiResponse<WcsStackerTask> response = new WcsApiResponse<>();
|
||||||
|
// response = httpResponse.getData(response.getClass().asSubclass(WcsApiResponse.class));
|
||||||
|
// return response;
|
||||||
|
// }
|
||||||
|
// return WcsApiResponse.error("请求未获得响应信息。", null);
|
||||||
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WcsApiResponse<WcsStackerTask> sendWcsStackerTask(WcsStackerTaskRequest request) {
|
public WcsApiResponse<WcsStackerTask> sendWcsStackerTask(WcsStackerTaskRequest request) {
|
||||||
// 设置http请求
|
final long startNs = System.nanoTime();
|
||||||
HttpRequest httpRequest = HttpRequest.postInstanceOf(appCommon.getConfigByKey(AppConfigKeyEnums.WCS_STACKER_TASK_URL.getKey()), request);
|
|
||||||
httpRequest.setTimeout(30000);
|
try {
|
||||||
HttpResponse httpResponse = httpClient.httpPost(httpRequest);
|
// 设置http请求
|
||||||
if (httpResponse != null && httpResponse.isSuccess()) {
|
HttpRequest httpRequest = HttpRequest.postInstanceOf(appCommon.getConfigByKey(AppConfigKeyEnums.WCS_STACKER_TASK_URL.getKey()), request);
|
||||||
WcsApiResponse<WcsStackerTask> response = new WcsApiResponse<>();
|
httpRequest.setTimeout(30000);
|
||||||
response = httpResponse.getData(response.getClass().asSubclass(WcsApiResponse.class));
|
HttpResponse httpResponse = httpClient.httpPost(httpRequest);
|
||||||
return response;
|
|
||||||
|
final long durationMs = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startNs);
|
||||||
|
|
||||||
|
// 记录请求日志
|
||||||
|
log.info("[WCS堆垛机任务调用] 接口={}, 耗时={}ms" ,
|
||||||
|
appCommon.getConfigByKey(AppConfigKeyEnums.WCS_STACKER_TASK_URL.getKey()),
|
||||||
|
durationMs);
|
||||||
|
|
||||||
|
// 慢请求报警(阈值按需调整)
|
||||||
|
if (durationMs > 5000) {
|
||||||
|
log.warn("慢请求告警: 调用wcs系统堆垛机任务接口超时{} 耗时{}ms",
|
||||||
|
appCommon.getConfigByKey(AppConfigKeyEnums.WCS_STACKER_TASK_URL.getKey()),
|
||||||
|
durationMs);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (httpResponse != null && httpResponse.isSuccess()) {
|
||||||
|
WcsApiResponse<WcsStackerTask> response = new WcsApiResponse<>();
|
||||||
|
response = httpResponse.getData(response.getClass().asSubclass(WcsApiResponse.class));
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
return WcsApiResponse.error("请求未获得响应信息。", null);
|
||||||
|
} catch (Exception e) {
|
||||||
|
final long durationMs = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startNs);
|
||||||
|
log.error("[WCS堆垛机任务调用] 接口={} 异常, 耗时={}ms, 错误信息={}",
|
||||||
|
appCommon.getConfigByKey(AppConfigKeyEnums.WCS_STACKER_TASK_URL.getKey()),
|
||||||
|
durationMs,
|
||||||
|
e.getMessage(), e);
|
||||||
|
throw e;
|
||||||
}
|
}
|
||||||
return WcsApiResponse.error("请求未获得响应信息。", null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送拣选任务
|
* 发送拣选任务
|
||||||
* @param request 任务请求
|
* @param request 任务请求
|
||||||
* @return 响应结果
|
* @return 响应结果
|
||||||
*/
|
*/
|
||||||
|
// @Override
|
||||||
|
// public WcsApiResponse<WcsPickTask> sendPickTask(WcsPickTaskRequest request) {
|
||||||
|
// // 设置http请求
|
||||||
|
// HttpRequest httpRequest = HttpRequest.postInstanceOf(appCommon.getConfigByKey(AppConfigKeyEnums.WCS_PICK_TASK_URL.getKey()), request);
|
||||||
|
// httpRequest.setTimeout(30000);
|
||||||
|
// HttpResponse httpResponse = httpClient.httpPost(httpRequest);
|
||||||
|
// if (httpResponse != null && httpResponse.isSuccess()) {
|
||||||
|
// WcsApiResponse<WcsPickTask> response = new WcsApiResponse<>();
|
||||||
|
// response = httpResponse.getData(response.getClass().asSubclass(WcsApiResponse.class));
|
||||||
|
// return response;
|
||||||
|
// }
|
||||||
|
// return WcsApiResponse.error("请求未获得响应信息。", null);
|
||||||
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WcsApiResponse<WcsPickTask> sendPickTask(WcsPickTaskRequest request) {
|
public WcsApiResponse<WcsPickTask> sendPickTask(WcsPickTaskRequest request) {
|
||||||
// 设置http请求
|
final long startNs = System.nanoTime();
|
||||||
HttpRequest httpRequest = HttpRequest.postInstanceOf(appCommon.getConfigByKey(AppConfigKeyEnums.WCS_PICK_TASK_URL.getKey()), request);
|
|
||||||
httpRequest.setTimeout(30000);
|
try {
|
||||||
HttpResponse httpResponse = httpClient.httpPost(httpRequest);
|
// 设置http请求
|
||||||
if (httpResponse != null && httpResponse.isSuccess()) {
|
HttpRequest httpRequest = HttpRequest.postInstanceOf(appCommon.getConfigByKey(AppConfigKeyEnums.WCS_PICK_TASK_URL.getKey()), request);
|
||||||
WcsApiResponse<WcsPickTask> response = new WcsApiResponse<>();
|
httpRequest.setTimeout(30000);
|
||||||
response = httpResponse.getData(response.getClass().asSubclass(WcsApiResponse.class));
|
HttpResponse httpResponse = httpClient.httpPost(httpRequest);
|
||||||
return response;
|
|
||||||
|
final long durationMs = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startNs);
|
||||||
|
|
||||||
|
// 记录请求日志
|
||||||
|
log.info("[WCS拣选任务调用] 接口={}, 耗时={}ms",
|
||||||
|
appCommon.getConfigByKey(AppConfigKeyEnums.WCS_PICK_TASK_URL.getKey()),
|
||||||
|
durationMs);
|
||||||
|
|
||||||
|
// 慢请求报警(阈值按需调整)
|
||||||
|
if (durationMs > 500) {
|
||||||
|
log.warn("慢请求告警: 调用wcs系统拣选任务接口{}耗时{}ms",
|
||||||
|
appCommon.getConfigByKey(AppConfigKeyEnums.WCS_PICK_TASK_URL.getKey()),
|
||||||
|
durationMs);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (httpResponse != null && httpResponse.isSuccess()) {
|
||||||
|
WcsApiResponse<WcsPickTask> response = new WcsApiResponse<>();
|
||||||
|
response = httpResponse.getData(response.getClass().asSubclass(WcsApiResponse.class));
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
return WcsApiResponse.error("请求未获得响应信息。", null);
|
||||||
|
} catch (Exception e) {
|
||||||
|
final long durationMs = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startNs);
|
||||||
|
log.error("[WCS拣选任务调用] 接口={} 异常, 耗时={}ms, 错误信息={}",
|
||||||
|
appCommon.getConfigByKey(AppConfigKeyEnums.WCS_PICK_TASK_URL.getKey()),
|
||||||
|
durationMs,
|
||||||
|
e.getMessage(), e);
|
||||||
|
throw e;
|
||||||
}
|
}
|
||||||
return WcsApiResponse.error("请求未获得响应信息。", null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送释放载具请求
|
* 发送释放载具请求
|
||||||
* @param request 释放请求信息
|
* @param request 释放请求信息
|
||||||
|
|
|
||||||
|
|
@ -257,7 +257,10 @@ public class ConveyTaskServiceImpl implements IConveyTaskService {
|
||||||
.set(TAppStock::getStockStatus, WmsStockStatusEnums.OUTED.getCode())
|
.set(TAppStock::getStockStatus, WmsStockStatusEnums.OUTED.getCode())
|
||||||
.set(TAppStock::getLocationId, "")
|
.set(TAppStock::getLocationId, "")
|
||||||
.eq(TAppStock::getVehicleId, targetPickTask.getVehicleId())
|
.eq(TAppStock::getVehicleId, targetPickTask.getVehicleId())
|
||||||
.eq(TAppStock::getStockStatus, WmsStockStatusEnums.OUTING.getCode()));
|
.eq(TAppStock::getStockStatus, WmsStockStatusEnums.OUTING.getCode())
|
||||||
|
);
|
||||||
|
// 更新当前载具到达当前点位的拣选任务为已到达
|
||||||
|
updateVehicleArriveStatus(targetPickTask);
|
||||||
}
|
}
|
||||||
// 更新拣选任务信息,添加拣选任务记录信息
|
// 更新拣选任务信息,添加拣选任务记录信息
|
||||||
pickRecords.add(new TAppPickTaskBak(
|
pickRecords.add(new TAppPickTaskBak(
|
||||||
|
|
@ -270,10 +273,9 @@ public class ConveyTaskServiceImpl implements IConveyTaskService {
|
||||||
targetPickTask.getArriveTime(),
|
targetPickTask.getArriveTime(),
|
||||||
LocalDateTime.now()
|
LocalDateTime.now()
|
||||||
));
|
));
|
||||||
|
log.info("保存拣选任务记录:{}", pickRecords);
|
||||||
try {
|
try {
|
||||||
appPickTaskBakService.saveBatch(pickRecords);
|
appPickTaskBakService.saveBatch(pickRecords);
|
||||||
// 更新当前载具到达当前点位的拣选任务为已到达
|
|
||||||
updateVehicleArriveStatus(targetPickTask);
|
|
||||||
// 删除当前载具在当前站台的拣选任务
|
// 删除当前载具在当前站台的拣选任务
|
||||||
// appPickTaskService.remove(new LambdaQueryWrapper<TAppPickTask>()
|
// appPickTaskService.remove(new LambdaQueryWrapper<TAppPickTask>()
|
||||||
// .eq(TAppPickTask::getVehicleId, targetPickTask.getVehicleId())
|
// .eq(TAppPickTask::getVehicleId, targetPickTask.getVehicleId())
|
||||||
|
|
@ -316,7 +318,7 @@ public class ConveyTaskServiceImpl implements IConveyTaskService {
|
||||||
TAppPickTask waitPickTask = appPickTaskService.getOne(queryWrapper);
|
TAppPickTask waitPickTask = appPickTaskService.getOne(queryWrapper);
|
||||||
|
|
||||||
if (waitPickTask == null) {
|
if (waitPickTask == null) {
|
||||||
log.warn("没有找到符合条件的 WAIT 状态任务。载具号: {}", targetPickTask.getVehicleId());
|
log.error("没有找到符合条件的 WAIT 状态任务。载具号: {}", targetPickTask.getVehicleId());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 更新当前载具到达当前点位的拣选任务为已到达
|
// 更新当前载具到达当前点位的拣选任务为已到达
|
||||||
|
|
@ -457,19 +459,37 @@ public class ConveyTaskServiceImpl implements IConveyTaskService {
|
||||||
// 计划拣选数量
|
// 计划拣选数量
|
||||||
int planPickQty = pickPlan.getPlanPickQty();
|
int planPickQty = pickPlan.getPlanPickQty();
|
||||||
// 先查询对应的工作存不存在
|
// 先查询对应的工作存不存在
|
||||||
TAppOuts thisOuts = appOutsService.getById(pickPlan.getWorkIndex());
|
// 根据plan的is_empty决定查询条件,如果是1,根据work_index查询,如果是0,根据plan_id查询
|
||||||
|
List<TAppOuts> thisOuts = new ArrayList<>();
|
||||||
|
if (pickPlan.getIsEmpty() == 1){
|
||||||
|
TAppOuts outs = appOutsService.getById(pickPlan.getWorkIndex());
|
||||||
|
if (outs != null) {
|
||||||
|
thisOuts.add(outs);
|
||||||
|
}
|
||||||
|
} else if (pickPlan.getIsEmpty() == 0) {
|
||||||
|
thisOuts = appOutsService.list(new LambdaQueryWrapper<TAppOuts>()
|
||||||
|
.eq(TAppOuts::getPickPlanId, pickPlan.getPlanId())
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
log.info("is_empty is not 0 or 1");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
// 判断这条工作还存在否
|
// 判断这条工作还存在否
|
||||||
if (thisOuts == null) {
|
if (thisOuts == null || thisOuts.isEmpty()) {
|
||||||
needRemovePlans.add(pickPlan);
|
needRemovePlans.add(pickPlan);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
// 统计剩余需求量
|
||||||
|
int totalPickNum = thisOuts.stream().mapToInt(TAppOuts::getPickNum).sum();
|
||||||
|
int totalNeedNum = thisOuts.stream().mapToInt(TAppOuts::getNeedNum).sum();
|
||||||
|
|
||||||
// 判断有没有需求
|
// 判断有没有需求
|
||||||
if (thisOuts.getPickNum() >= thisOuts.getNeedNum()) {
|
if (totalPickNum >= totalNeedNum) {
|
||||||
needRemovePlans.add(pickPlan);
|
needRemovePlans.add(pickPlan);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// 剩余需求量
|
// 剩余需求量
|
||||||
int remainNeedNum = thisOuts.getNeedNum() - thisOuts.getPickNum();
|
int remainNeedNum = totalNeedNum - totalPickNum;
|
||||||
if (remainNeedNum < planPickQty) {
|
if (remainNeedNum < planPickQty) {
|
||||||
// 需求不足,将计划拣选数量更新成实际需求数量
|
// 需求不足,将计划拣选数量更新成实际需求数量
|
||||||
planPickQty = remainNeedNum;
|
planPickQty = remainNeedNum;
|
||||||
|
|
@ -477,7 +497,7 @@ public class ConveyTaskServiceImpl implements IConveyTaskService {
|
||||||
// 查询这个箱子上库存是否足够
|
// 查询这个箱子上库存是否足够
|
||||||
List<TAppStock> stockList = appStockService.list(new LambdaQueryWrapper<TAppStock>()
|
List<TAppStock> stockList = appStockService.list(new LambdaQueryWrapper<TAppStock>()
|
||||||
.eq(TAppStock::getVehicleId, thisPickTask.getVehicleId())
|
.eq(TAppStock::getVehicleId, thisPickTask.getVehicleId())
|
||||||
.eq(TAppStock::getGoodsId, thisOuts.getGoodsId())
|
.eq(TAppStock::getGoodsId, thisOuts.getFirst().getGoodsId())
|
||||||
.gt(TAppStock::getRealNum, 0).orderByAsc(TAppStock::getFirstInTime));
|
.gt(TAppStock::getRealNum, 0).orderByAsc(TAppStock::getFirstInTime));
|
||||||
if (stockList == null || stockList.isEmpty()) {
|
if (stockList == null || stockList.isEmpty()) {
|
||||||
needRemovePlans.add(pickPlan);
|
needRemovePlans.add(pickPlan);
|
||||||
|
|
@ -491,14 +511,16 @@ public class ConveyTaskServiceImpl implements IConveyTaskService {
|
||||||
}
|
}
|
||||||
// 命中,开始设置返回数据
|
// 命中,开始设置返回数据
|
||||||
TaskConfirmEntity taskConfirmVo = new TaskConfirmEntity(
|
TaskConfirmEntity taskConfirmVo = new TaskConfirmEntity(
|
||||||
thisOuts.getTaskId(),
|
thisOuts.getFirst().getTaskId(),//
|
||||||
thisOuts.getOutType(),
|
thisOuts.getFirst().getOutType(),
|
||||||
thisOuts.getGoodsId(),
|
thisOuts.getFirst().getGoodsId(),
|
||||||
thisOuts.getNeedNum(),
|
totalNeedNum,
|
||||||
remainNeedNum,
|
remainNeedNum,
|
||||||
planPickQty,
|
planPickQty,
|
||||||
planPickQty,
|
planPickQty,
|
||||||
null
|
null,
|
||||||
|
thisOuts.size(),
|
||||||
|
pickPlan.getIsEmpty()
|
||||||
);
|
);
|
||||||
StockConfirmEntity stockConfirmVo = new StockConfirmEntity(
|
StockConfirmEntity stockConfirmVo = new StockConfirmEntity(
|
||||||
pickPlan.getPlanId(),
|
pickPlan.getPlanId(),
|
||||||
|
|
@ -509,12 +531,11 @@ public class ConveyTaskServiceImpl implements IConveyTaskService {
|
||||||
0,
|
0,
|
||||||
"ASRS",
|
"ASRS",
|
||||||
stockDataService.getWarningQty(),
|
stockDataService.getWarningQty(),
|
||||||
thisOuts.getWorkOrder(),
|
thisOuts.getFirst().getWorkOrder(),
|
||||||
thisOuts.getSpecialStock() ,
|
thisOuts.getFirst().getSpecialStock() ,
|
||||||
thisOuts.getBatchNo(),
|
thisOuts.getFirst().getBatchNo(),
|
||||||
thisOuts.getSpecialStockNo(),
|
thisOuts.getFirst().getSpecialStockNo(),
|
||||||
thisOuts.getSpecialStockItemNo()
|
thisOuts.getFirst().getSpecialStockItemNo()
|
||||||
|
|
||||||
|
|
||||||
);
|
);
|
||||||
resultVo = new TaskConfirmVo(thisPickTask.getPickStand(),false,taskConfirmVo, stockConfirmVo);
|
resultVo = new TaskConfirmVo(thisPickTask.getPickStand(),false,taskConfirmVo, stockConfirmVo);
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import com.wms_main.model.dto.request.ewm.SendWarehouseInCompletedRequest;
|
||||||
import com.wms_main.model.dto.response.ewm.EwmApiBackResponse;
|
import com.wms_main.model.dto.response.ewm.EwmApiBackResponse;
|
||||||
import com.wms_main.model.po.*;
|
import com.wms_main.model.po.*;
|
||||||
import com.wms_main.repository.utils.ConvertUtils;
|
import com.wms_main.repository.utils.ConvertUtils;
|
||||||
|
import com.wms_main.repository.utils.DbTransUtils;
|
||||||
import com.wms_main.repository.utils.StringUtils;
|
import com.wms_main.repository.utils.StringUtils;
|
||||||
import com.wms_main.repository.utils.UUIDUtils;
|
import com.wms_main.repository.utils.UUIDUtils;
|
||||||
import com.wms_main.service.api.IEwmApiService;
|
import com.wms_main.service.api.IEwmApiService;
|
||||||
|
|
@ -80,7 +81,7 @@ public class StackerTaskServiceImpl implements IStackerTaskService {
|
||||||
private final ITempEwmInboundDataService tempEwmInboundDataService;
|
private final ITempEwmInboundDataService tempEwmInboundDataService;
|
||||||
|
|
||||||
private final IEwmApiService ewmApiService;
|
private final IEwmApiService ewmApiService;
|
||||||
|
private final DbTransUtils dbTransUtils;// 数据库事务工具
|
||||||
/**
|
/**
|
||||||
* 存WcsTask表
|
* 存WcsTask表
|
||||||
* 更新WmsTask表
|
* 更新WmsTask表
|
||||||
|
|
@ -370,7 +371,6 @@ public class StackerTaskServiceImpl implements IStackerTaskService {
|
||||||
* @param stackerInTasks 已完成的入库任务
|
* @param stackerInTasks 已完成的入库任务
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void finishStackerInTasks(List<TAppTask> stackerInTasks) {
|
public void finishStackerInTasks(List<TAppTask> stackerInTasks) {
|
||||||
// 入库任务完成需要做以下几件事情:
|
// 入库任务完成需要做以下几件事情:
|
||||||
// 1. 生成库存,如果是已有库存则更新库存状态、数量、库位这些信息。
|
// 1. 生成库存,如果是已有库存则更新库存状态、数量、库位这些信息。
|
||||||
|
|
@ -518,81 +518,87 @@ public class StackerTaskServiceImpl implements IStackerTaskService {
|
||||||
thisVehicle.setLastInTime(LocalDateTime.now());
|
thisVehicle.setLastInTime(LocalDateTime.now());
|
||||||
thisVehicle.setLocationId(thisVehicleInTasks.getFirst().getDestination());
|
thisVehicle.setLocationId(thisVehicleInTasks.getFirst().getDestination());
|
||||||
}
|
}
|
||||||
// 保存载具信息
|
final TAppVehicle finalThisVehicle = thisVehicle;
|
||||||
appVehicleService.saveOrUpdate(thisVehicle);
|
boolean doTransResult = dbTransUtils.useTran(() -> {
|
||||||
// 将目标库位的工作状态设置为未工作
|
// 保存载具信息
|
||||||
appLocationService.update(new LambdaUpdateWrapper<TAppLocation>()
|
appVehicleService.saveOrUpdate(finalThisVehicle);
|
||||||
.set(TAppLocation::getIsWorking, 0)
|
// 将目标库位的工作状态设置为未工作
|
||||||
.eq(TAppLocation::getLocationId, thisVehicle.getLocationId())
|
appLocationService.update(new LambdaUpdateWrapper<TAppLocation>()
|
||||||
);
|
.set(TAppLocation::getIsWorking, 0)
|
||||||
// 需要更新下当前载具下的库存其他信息
|
.eq(TAppLocation::getLocationId, finalThisVehicle.getLocationId())
|
||||||
appStockService.update(new LambdaUpdateWrapper<TAppStock>()
|
);
|
||||||
.set(TAppStock::getStockStatus, WmsStockStatusEnums.OK.getCode())
|
// 需要更新下当前载具下的库存其他信息
|
||||||
.set(TAppStock::getLocationId, thisVehicleInTasks.getFirst().getDestination())
|
appStockService.update(new LambdaUpdateWrapper<TAppStock>()
|
||||||
.setSql("remain_num = real_num")
|
.set(TAppStock::getStockStatus, WmsStockStatusEnums.OK.getCode())
|
||||||
.eq(TAppStock::getVehicleId, vehicleId));
|
.set(TAppStock::getLocationId, thisVehicleInTasks.getFirst().getDestination())
|
||||||
// 移除这个载具的所有拣选任务
|
.setSql("remain_num = real_num")
|
||||||
appPickTaskService.remove(new LambdaQueryWrapper<TAppPickTask>()
|
.eq(TAppStock::getVehicleId, vehicleId));
|
||||||
.eq(TAppPickTask::getVehicleId, vehicleId));
|
// 移除这个载具的所有拣选任务
|
||||||
// 取消这个载具下发的所有任务
|
appPickTaskService.remove(new LambdaQueryWrapper<TAppPickTask>()
|
||||||
conveyTaskService.cancelOtherStandPickTasks(vehicleId, "");
|
.eq(TAppPickTask::getVehicleId, vehicleId));
|
||||||
// 保存库存信息
|
// 取消这个载具下发的所有任务
|
||||||
if (!newStockList.isEmpty()) {
|
conveyTaskService.cancelOtherStandPickTasks(vehicleId, "");
|
||||||
appStockService.saveOrUpdateBatch(newStockList);
|
// 保存库存信息
|
||||||
}
|
if (!newStockList.isEmpty()) {
|
||||||
// 增加库存更新记录
|
appStockService.saveOrUpdateBatch(newStockList);
|
||||||
if (!stockUpdateList.isEmpty()) {
|
|
||||||
appStockUpdateService.saveBatch(stockUpdateList);
|
|
||||||
}
|
|
||||||
// 添加任务记录
|
|
||||||
if (!newTaskBakList.isEmpty()) {
|
|
||||||
appTaskBakService.saveBatch(newTaskBakList);
|
|
||||||
}
|
|
||||||
// 删除已经完成的入库任务
|
|
||||||
if (!needDeleteTaskIds.isEmpty()) {
|
|
||||||
appTaskService.removeByIds(needDeleteTaskIds);
|
|
||||||
}
|
|
||||||
// 删除暂存数据表的数据
|
|
||||||
if(!needDeleteTempIds.isEmpty()){
|
|
||||||
tempEwmInboundDataService.removeByIds(needDeleteTempIds);
|
|
||||||
}
|
|
||||||
if(!thisVehicleInTasks.getFirst().getTaskId().startsWith("BACK_")){
|
|
||||||
// 回告ewm系统入库完成
|
|
||||||
SendWarehouseInCompletedRequest request = new SendWarehouseInCompletedRequest();
|
|
||||||
request.setContainerNo(vehicleId);
|
|
||||||
request.setBillType(tempEwmInboundDataList.getFirst().getBillType());
|
|
||||||
request.setBillNo(tempEwmInboundDataList.getFirst().getBillNo());
|
|
||||||
request.setPin("ASRS2-WMS");
|
|
||||||
//request.setPin("");
|
|
||||||
EwmApiBackResponse ewmApiBackResponse = ewmApiService.sendWarehouseInCompleted(request);
|
|
||||||
if (!Objects.equals(ewmApiBackResponse.getState(), "successfully")) {
|
|
||||||
log.error("调用EWM系统接口异常,请求参数: {}", request);
|
|
||||||
// 需要将料箱下架,生成一个出库任务
|
|
||||||
// 生成出库任务
|
|
||||||
TAppTask outTask = new TAppTask(
|
|
||||||
UUIDUtils.getNewUUID(),
|
|
||||||
WmsTaskTypeEnums.OUT.getCode(),
|
|
||||||
0,
|
|
||||||
9,
|
|
||||||
vehicleId,
|
|
||||||
emptyVehicle.getLocationId(),
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
LocalDateTime.now(),
|
|
||||||
null,
|
|
||||||
AppConstant.EMPTY_GOODS_ID,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
appOuts.getUserName(),
|
|
||||||
"",
|
|
||||||
appOuts.getDestination(),
|
|
||||||
""
|
|
||||||
);
|
|
||||||
}else {
|
|
||||||
log.info("调用EWM系统接口成功,请求参数: {}", request);
|
|
||||||
}
|
}
|
||||||
|
// 增加库存更新记录
|
||||||
|
if (!stockUpdateList.isEmpty()) {
|
||||||
|
appStockUpdateService.saveBatch(stockUpdateList);
|
||||||
|
}
|
||||||
|
// 添加任务记录
|
||||||
|
if (!newTaskBakList.isEmpty()) {
|
||||||
|
appTaskBakService.saveBatch(newTaskBakList);
|
||||||
|
}
|
||||||
|
// 删除已经完成的入库任务
|
||||||
|
if (!needDeleteTaskIds.isEmpty()) {
|
||||||
|
appTaskService.removeByIds(needDeleteTaskIds);
|
||||||
|
}
|
||||||
|
// 删除暂存数据表的数据
|
||||||
|
if(!needDeleteTempIds.isEmpty()){
|
||||||
|
tempEwmInboundDataService.removeByIds(needDeleteTempIds);
|
||||||
|
}
|
||||||
|
if(!Objects.equals(thisVehicleInTasks.getFirst().getGoodsId(), AppConstant.EMPTY_GOODS_ID)){
|
||||||
|
// 回告ewm系统入库完成
|
||||||
|
SendWarehouseInCompletedRequest request = new SendWarehouseInCompletedRequest();
|
||||||
|
request.setContainerNo(vehicleId);
|
||||||
|
request.setBillType(tempEwmInboundDataList.getFirst().getBillType());
|
||||||
|
request.setBillNo(tempEwmInboundDataList.getFirst().getBillNo());
|
||||||
|
request.setPin("ASRS2-WMS");
|
||||||
|
//request.setPin("");
|
||||||
|
EwmApiBackResponse ewmApiBackResponse = ewmApiService.sendWarehouseInCompleted(request);
|
||||||
|
if (!Objects.equals(ewmApiBackResponse.getState(), "successfully")) {
|
||||||
|
log.error("调用EWM系统接口异常,请求参数: {}", request);
|
||||||
|
// 需要将料箱下架,生成一个出库任务
|
||||||
|
// 生成出库任务
|
||||||
|
TAppTask outTask = new TAppTask(
|
||||||
|
UUIDUtils.getNewUUID(),
|
||||||
|
WmsTaskTypeEnums.OUT.getCode(),
|
||||||
|
0,
|
||||||
|
9,
|
||||||
|
vehicleId,
|
||||||
|
thisVehicleInTasks.getFirst().getDestination(),
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
LocalDateTime.now(),
|
||||||
|
null,
|
||||||
|
AppConstant.EMPTY_GOODS_ID,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"",
|
||||||
|
"EWM接口异常回退",
|
||||||
|
"P21",
|
||||||
|
""
|
||||||
|
);
|
||||||
|
appTaskService.save(outTask);
|
||||||
|
}else {
|
||||||
|
log.info("调用EWM系统接口成功,请求参数: {}", request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (!doTransResult) {
|
||||||
|
log.error("执行出库单,数据库事务失败。");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -906,57 +912,86 @@ public class StackerTaskServiceImpl implements IStackerTaskService {
|
||||||
.eq(TAppTask::getVehicleId, vehicleId));
|
.eq(TAppTask::getVehicleId, vehicleId));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// 释放当前库位
|
|
||||||
appLocationService.update(new LambdaUpdateWrapper<TAppLocation>()
|
// 检查是否是EWM回退任务
|
||||||
.set(TAppLocation::getIsOccupy, WmsLocationOccupyStatusEnums.EMPTY.getCode())
|
|
||||||
.set(TAppLocation::getVehicleId, "")
|
|
||||||
.set(TAppLocation::getIsWorking, 0)
|
|
||||||
.eq(TAppLocation::getLocationId, thisVehicle.getLocationId())
|
|
||||||
.eq(TAppLocation::getVehicleId, vehicleId));
|
|
||||||
// 更新载具信息
|
|
||||||
thisVehicle.setVehicleStatus(WmsVehicleStatusEnums.OUT.getCode());
|
|
||||||
thisVehicle.setLocationId("");
|
|
||||||
appVehicleService.updateById(thisVehicle);
|
|
||||||
// 更新当前载具对应的所有库存的状态为已出库
|
|
||||||
appStockService.update(new LambdaUpdateWrapper<TAppStock>()
|
|
||||||
.set(TAppStock::getStockStatus, WmsStockStatusEnums.OUTED.getCode())
|
|
||||||
.set(TAppStock::getLocationId, "")
|
|
||||||
.eq(TAppStock::getVehicleId, vehicleId));
|
|
||||||
// 释放当前载具对应的拣选任务
|
|
||||||
appPickTaskService.update(new LambdaUpdateWrapper<TAppPickTask>()
|
|
||||||
.set(TAppPickTask::getPickStatus, WmsPickTaskStatusEnum.WAIT.getCode())
|
|
||||||
.eq(TAppPickTask::getVehicleId, vehicleId)
|
|
||||||
.eq(TAppPickTask::getPickStatus, WmsPickTaskStatusEnum.TEMP.getCode()));
|
|
||||||
// 当前载具的任务列表
|
|
||||||
List<TAppTask> thisVehicleOutTasks = vehicleIdToTaskMap.get(vehicleId);
|
List<TAppTask> thisVehicleOutTasks = vehicleIdToTaskMap.get(vehicleId);
|
||||||
if (!thisVehicleOutTasks.isEmpty()) {
|
boolean isEwmRollback = thisVehicleOutTasks.stream()
|
||||||
// 存储出库记录
|
.anyMatch(task -> "EWM接口异常回退".equals(task.getRemark()));
|
||||||
List<TAppTaskBak> stockOutRecordList = thisVehicleOutTasks.stream()
|
|
||||||
.map(outTask -> new TAppTaskBak(
|
final TAppVehicle finalThisVehicle = thisVehicle;
|
||||||
outTask.getTaskId(),
|
boolean doTransResult = dbTransUtils.useTran(() -> {
|
||||||
outTask.getTaskType(),
|
if (isEwmRollback) {
|
||||||
outTask.getTaskStatus(),
|
// 如果是EWM回退任务,完全删除库存
|
||||||
outTask.getTaskPriority(),
|
appStockService.remove(new LambdaQueryWrapper<TAppStock>()
|
||||||
outTask.getVehicleId(),
|
.eq(TAppStock::getVehicleId, vehicleId));
|
||||||
outTask.getOrigin(),
|
} else {
|
||||||
outTask.getDestination(),
|
// 更新当前载具对应的所有库存的状态为已出库
|
||||||
outTask.getWcsTaskId(),
|
appStockService.update(new LambdaUpdateWrapper<TAppStock>()
|
||||||
outTask.getCreateTime(),
|
.set(TAppStock::getStockStatus, WmsStockStatusEnums.OUTED.getCode())
|
||||||
outTask.getFinishTime(),
|
.set(TAppStock::getLocationId, "")
|
||||||
outTask.getGoodsId(),
|
.eq(TAppStock::getVehicleId, vehicleId));
|
||||||
outTask.getOpNum(),
|
|
||||||
outTask.getStockNum(),
|
appPickTaskService.update(new LambdaUpdateWrapper<TAppPickTask>()
|
||||||
outTask.getOpUser(),
|
.set(TAppPickTask::getPickStatus, WmsPickTaskStatusEnum.WAIT.getCode())
|
||||||
outTask.getRemark(),
|
.eq(TAppPickTask::getVehicleId, vehicleId)
|
||||||
outTask.getCallStand(),
|
.eq(TAppPickTask::getPickStatus, WmsPickTaskStatusEnum.TEMP.getCode()));
|
||||||
""
|
}
|
||||||
)).toList();
|
// 释放当前库位
|
||||||
appTaskBakService.saveBatch(stockOutRecordList);
|
appLocationService.update(new LambdaUpdateWrapper<TAppLocation>()
|
||||||
// 删除当前载具所对应的出库任务
|
.set(TAppLocation::getIsOccupy, WmsLocationOccupyStatusEnums.EMPTY.getCode())
|
||||||
appTaskService.remove(new LambdaQueryWrapper<TAppTask>()
|
.set(TAppLocation::getVehicleId, "")
|
||||||
.eq(TAppTask::getVehicleId, vehicleId)
|
.set(TAppLocation::getIsWorking, 0)
|
||||||
.eq(TAppTask::getTaskType, WmsTaskTypeEnums.OUT.getCode())
|
.eq(TAppLocation::getLocationId, finalThisVehicle.getLocationId())
|
||||||
.in(TAppTask::getTaskId, thisVehicleOutTasks.stream().map(TAppTask::getTaskId).toList()));
|
.eq(TAppLocation::getVehicleId, vehicleId));
|
||||||
|
// 更新载具信息
|
||||||
|
finalThisVehicle.setVehicleStatus(WmsVehicleStatusEnums.OUT.getCode());
|
||||||
|
finalThisVehicle.setLocationId("");
|
||||||
|
appVehicleService.updateById(finalThisVehicle);
|
||||||
|
// // 更新当前载具对应的所有库存的状态为已出库
|
||||||
|
// appStockService.update(new LambdaUpdateWrapper<TAppStock>()
|
||||||
|
// .set(TAppStock::getStockStatus, WmsStockStatusEnums.OUTED.getCode())
|
||||||
|
// .set(TAppStock::getLocationId, "")
|
||||||
|
// .eq(TAppStock::getVehicleId, vehicleId));
|
||||||
|
// 释放当前载具对应的拣选任务
|
||||||
|
// appPickTaskService.update(new LambdaUpdateWrapper<TAppPickTask>()
|
||||||
|
// .set(TAppPickTask::getPickStatus, WmsPickTaskStatusEnum.WAIT.getCode())
|
||||||
|
// .eq(TAppPickTask::getVehicleId, vehicleId)
|
||||||
|
// .eq(TAppPickTask::getPickStatus, WmsPickTaskStatusEnum.TEMP.getCode()));
|
||||||
|
// 当前载具的任务列表
|
||||||
|
//List<TAppTask> thisVehicleOutTasks = vehicleIdToTaskMap.get(vehicleId);
|
||||||
|
if (!thisVehicleOutTasks.isEmpty()) {
|
||||||
|
// 存储出库记录
|
||||||
|
List<TAppTaskBak> stockOutRecordList = thisVehicleOutTasks.stream()
|
||||||
|
.map(outTask -> new TAppTaskBak(
|
||||||
|
outTask.getTaskId(),
|
||||||
|
outTask.getTaskType(),
|
||||||
|
outTask.getTaskStatus(),
|
||||||
|
outTask.getTaskPriority(),
|
||||||
|
outTask.getVehicleId(),
|
||||||
|
outTask.getOrigin(),
|
||||||
|
outTask.getDestination(),
|
||||||
|
outTask.getWcsTaskId(),
|
||||||
|
outTask.getCreateTime(),
|
||||||
|
outTask.getFinishTime(),
|
||||||
|
outTask.getGoodsId(),
|
||||||
|
outTask.getOpNum(),
|
||||||
|
outTask.getStockNum(),
|
||||||
|
outTask.getOpUser(),
|
||||||
|
outTask.getRemark(),
|
||||||
|
outTask.getCallStand(),
|
||||||
|
""
|
||||||
|
)).toList();
|
||||||
|
appTaskBakService.saveBatch(stockOutRecordList);
|
||||||
|
// 删除当前载具所对应的出库任务
|
||||||
|
appTaskService.remove(new LambdaQueryWrapper<TAppTask>()
|
||||||
|
.eq(TAppTask::getVehicleId, vehicleId)
|
||||||
|
.eq(TAppTask::getTaskType, WmsTaskTypeEnums.OUT.getCode())
|
||||||
|
.in(TAppTask::getTaskId, thisVehicleOutTasks.stream().map(TAppTask::getTaskId).toList()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!doTransResult) {
|
||||||
|
log.error("执行出库任务完成处理,数据库事务失败。");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -112,23 +112,24 @@ public class StockDataServiceImpl implements IStockDataService {
|
||||||
if (!removeStocks.isEmpty()) {
|
if (!removeStocks.isEmpty()) {
|
||||||
appStockService.removeBatchByIds(removeStocks.stream().map(TAppStock::getStockId).toList());
|
appStockService.removeBatchByIds(removeStocks.stream().map(TAppStock::getStockId).toList());
|
||||||
}
|
}
|
||||||
// 查询对应的库存信息
|
// // 查询对应的库存信息
|
||||||
List<TAppStock> stockLists = appStockService.list(new LambdaQueryWrapper<TAppStock>()
|
// List<TAppStock> stockLists = appStockService.list(new LambdaQueryWrapper<TAppStock>()
|
||||||
.eq(TAppStock::getVehicleId, stockConfirm.getVehicleId())
|
// .eq(TAppStock::getVehicleId, stockConfirm.getVehicleId())
|
||||||
.eq(TAppStock::getGoodsId, stockConfirm.getGoodsId())
|
// .eq(TAppStock::getGoodsId, stockConfirm.getGoodsId())
|
||||||
.gt(TAppStock::getRemainNum, 0)
|
// .gt(TAppStock::getRemainNum, 0)
|
||||||
);
|
// );
|
||||||
if (stockLists == null || stockLists.isEmpty()){
|
// if (stockLists == null || stockLists.isEmpty()){
|
||||||
// 回告EWM系统
|
// reason = "移除载具";
|
||||||
SendEwmVehicleForInRequest request = new SendEwmVehicleForInRequest();
|
//// // 回告EWM系统
|
||||||
request.setContainerNo(stockConfirm.getVehicleId());
|
//// SendEwmVehicleForInRequest request = new SendEwmVehicleForInRequest();
|
||||||
EwmApiBackResponse ewmApiBackResponse = ewmApiService.sendContainerEmpty(request);
|
//// request.setContainerNo(stockConfirm.getVehicleId());
|
||||||
if (!Objects.equals(ewmApiBackResponse.getState(), "successful")) {
|
//// EwmApiBackResponse ewmApiBackResponse = ewmApiService.sendContainerEmpty(request);
|
||||||
log.error("容器置空调用EWM系统接口异常,请求参数: {}", request);
|
//// if (!Objects.equals(ewmApiBackResponse.getState(), "successful")) {
|
||||||
}else {
|
//// log.error("容器置空调用EWM系统接口异常,请求参数: {}", request);
|
||||||
log.info("容器置空调用EWM系统接口成功,请求参数: {}", request);
|
//// }else {
|
||||||
}
|
//// log.info("容器置空调用EWM系统接口成功,请求参数: {}", request);
|
||||||
}
|
//// }
|
||||||
|
// }
|
||||||
// 更新库存数量
|
// 更新库存数量
|
||||||
if (!updateStocks.isEmpty()) {
|
if (!updateStocks.isEmpty()) {
|
||||||
appStockService.updateBatchById(updateStocks);
|
appStockService.updateBatchById(updateStocks);
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import com.wms_main.model.po.TAppPickTask;
|
||||||
import com.wms_main.model.po.TAppTask;
|
import com.wms_main.model.po.TAppTask;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public interface IDataControllerService {
|
public interface IDataControllerService {
|
||||||
|
|
||||||
|
|
@ -40,4 +41,15 @@ public interface IDataControllerService {
|
||||||
* @return 拣选任务信息
|
* @return 拣选任务信息
|
||||||
*/
|
*/
|
||||||
List<TAppPickTask> getPickTaskDataP3(int pageNum, int pageSize);
|
List<TAppPickTask> getPickTaskDataP3(int pageNum, int pageSize);
|
||||||
|
|
||||||
|
List<Map<String, Object>> queryRecentTask();
|
||||||
|
|
||||||
|
List<Map<String, Object>> queryStockDetail(String locationId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询运行中的任务
|
||||||
|
* @return 运行中的任务列表
|
||||||
|
*/
|
||||||
|
List<Map<String, Object>> queryRunningTask();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,14 @@ public interface ITaskControllerService {
|
||||||
*/
|
*/
|
||||||
BaseWmsApiResponse requireStockOut(StockOutRequest stockOutRequest);
|
BaseWmsApiResponse requireStockOut(StockOutRequest stockOutRequest);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出库空箱
|
||||||
|
* @param stockOutRequest 请求信息
|
||||||
|
* @return 处理结果
|
||||||
|
*/
|
||||||
|
BaseWmsApiResponse requireStockOutEmpty(StockOutRequest stockOutRequest);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 入库用出库请求
|
* 入库用出库请求
|
||||||
* @param voiRequest 请求信息
|
* @param voiRequest 请求信息
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import com.wms_main.model.dto.query.OutsQuery;
|
||||||
import com.wms_main.model.dto.query.PickTaskQuery;
|
import com.wms_main.model.dto.query.PickTaskQuery;
|
||||||
import com.wms_main.model.dto.query.WmsTaskQuery;
|
import com.wms_main.model.dto.query.WmsTaskQuery;
|
||||||
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||||
|
import com.wms_main.model.po.TAppPickTask;
|
||||||
import com.wms_main.model.vo.wms.*;
|
import com.wms_main.model.vo.wms.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -46,10 +47,26 @@ public interface ITaskQueryControllerService {
|
||||||
*/
|
*/
|
||||||
WmsApiResponse<PageVo<OutsVo>> queryOutsByPage(OutsQuery outsQuery);
|
WmsApiResponse<PageVo<OutsVo>> queryOutsByPage(OutsQuery outsQuery);
|
||||||
|
|
||||||
|
|
||||||
|
WmsApiResponse<String> upOutsType(OutsVo outsVo);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询盘点相关信息
|
* 查询盘点相关信息
|
||||||
* @param inventoryQuery 查询参数
|
* @param inventoryQuery 查询参数
|
||||||
* @return 查询结果---分页
|
* @return 查询结果---分页
|
||||||
*/
|
*/
|
||||||
WmsApiResponse<PageVo<InventoryRecordVo>> queryInventoryRecordByPage(InventoryQuery inventoryQuery);
|
WmsApiResponse<PageVo<InventoryRecordVo>> queryInventoryRecordByPage(InventoryQuery inventoryQuery);
|
||||||
|
|
||||||
|
WmsApiResponse<String> editDate(OutsVo outsVo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新出库单信息
|
||||||
|
*
|
||||||
|
* @param appTask 出库单信息
|
||||||
|
* @return 更新结果
|
||||||
|
*/
|
||||||
|
WmsApiResponse<String> updateOutsInfo(TAppPickTask appTask);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,53 @@
|
||||||
package com.wms_main.service.controller;
|
package com.wms_main.service.controller;
|
||||||
|
|
||||||
|
import com.wms_main.model.dto.query.UserQuery;
|
||||||
|
import com.wms_main.model.dto.query.UserUpdateRequest;
|
||||||
|
import com.wms_main.model.dto.response.wms.BaseWmsApiResponse;
|
||||||
|
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||||
|
import com.wms_main.model.vo.wms.PageVo;
|
||||||
|
import com.wms_main.model.vo.wms.UserVo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户控制类服务
|
* 用户控制类服务
|
||||||
*/
|
*/
|
||||||
public interface IUserControllerService {
|
public interface IUserControllerService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户列表
|
||||||
|
* @param userQuery 查询参数
|
||||||
|
* @return 查询结果
|
||||||
|
*/
|
||||||
|
WmsApiResponse<PageVo<UserVo>> getUserList(UserQuery userQuery);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增用户信息
|
||||||
|
* @param userUpdateRequest 新增用户信息请求
|
||||||
|
* @return 新增结果
|
||||||
|
*/
|
||||||
|
BaseWmsApiResponse addUserInfo(UserUpdateRequest userUpdateRequest);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除用户信息
|
||||||
|
* @param userUpdateRequest 删除用户信息请求
|
||||||
|
* @return 删除结果
|
||||||
|
*/
|
||||||
|
BaseWmsApiResponse deleteUserInfo(UserUpdateRequest userUpdateRequest);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户信息
|
||||||
|
* @param userUpdateRequest 修改用户信息请求
|
||||||
|
* @return 修改结果
|
||||||
|
*/
|
||||||
|
BaseWmsApiResponse updateUserInfo(UserUpdateRequest userUpdateRequest);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户密码
|
||||||
|
* @param userUpdateRequest 密码修改参数
|
||||||
|
* @return 修改结果
|
||||||
|
*/
|
||||||
|
BaseWmsApiResponse changePassword(UserUpdateRequest userUpdateRequest);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,20 @@
|
||||||
package com.wms_main.service.controller.serviceImpl;
|
package com.wms_main.service.controller.serviceImpl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.wms_main.dao.impl.TAppOutsServiceImpl;
|
import com.wms_main.dao.impl.*;
|
||||||
import com.wms_main.dao.impl.TAppPickTaskServiceImpl;
|
import com.wms_main.model.po.*;
|
||||||
import com.wms_main.dao.impl.TAppTaskServiceImpl;
|
|
||||||
import com.wms_main.model.po.TAppOuts;
|
|
||||||
import com.wms_main.model.po.TAppPickTask;
|
|
||||||
import com.wms_main.service.controller.IDataControllerService;
|
import com.wms_main.service.controller.IDataControllerService;
|
||||||
import com.wms_main.model.po.TAppTask;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据控制器服务实现类
|
* 数据控制器服务实现类
|
||||||
|
|
@ -25,6 +26,8 @@ public class DataControllerServiceImpl implements IDataControllerService {
|
||||||
private final TAppTaskServiceImpl tAppTaskService;
|
private final TAppTaskServiceImpl tAppTaskService;
|
||||||
private final TAppOutsServiceImpl tAppOutsService;
|
private final TAppOutsServiceImpl tAppOutsService;
|
||||||
private final TAppPickTaskServiceImpl tAppPickTaskService;
|
private final TAppPickTaskServiceImpl tAppPickTaskService;
|
||||||
|
private final TAppTaskBakServiceImpl tAppTaskBakService;
|
||||||
|
private final TAppStockServiceImpl tAppStockService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取任务类型为1的任务数据
|
* 获取任务类型为1的任务数据
|
||||||
|
|
@ -91,4 +94,136 @@ public class DataControllerServiceImpl implements IDataControllerService {
|
||||||
.orderByDesc(TAppPickTask::getPickStatus);;
|
.orderByDesc(TAppPickTask::getPickStatus);;
|
||||||
return tAppPickTaskService.page(new Page<>(pageNum, pageSize), queryWrapper).getRecords();
|
return tAppPickTaskService.page(new Page<>(pageNum, pageSize), queryWrapper).getRecords();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Map<String, Object>> queryRecentTask() {
|
||||||
|
List<Map<String, Object>> result = new ArrayList<>();
|
||||||
|
|
||||||
|
// 获取最近7天的日期
|
||||||
|
List<LocalDate> recentDays = new ArrayList<>();
|
||||||
|
for (int i = 6; i >= 0; i--) {
|
||||||
|
recentDays.add(LocalDate.now().minusDays(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询最近7天的数据
|
||||||
|
for (LocalDate date : recentDays) {
|
||||||
|
LocalDateTime startOfDay = date.atStartOfDay();
|
||||||
|
LocalDateTime endOfDay = date.atTime(23, 59, 59);
|
||||||
|
|
||||||
|
LambdaQueryWrapper<TAppTaskBak> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.between(TAppTaskBak::getCreateTime, startOfDay, endOfDay);
|
||||||
|
|
||||||
|
List<TAppTaskBak> tasks = tAppTaskBakService.list(queryWrapper);
|
||||||
|
|
||||||
|
// 统计各类任务数量
|
||||||
|
int inTaskCount = 0;
|
||||||
|
int outTaskCount = 0;
|
||||||
|
int moveTaskCount = 0;
|
||||||
|
|
||||||
|
for (TAppTaskBak task : tasks) {
|
||||||
|
switch (task.getTaskType()) {
|
||||||
|
case 1: // 入库任务
|
||||||
|
inTaskCount++;
|
||||||
|
break;
|
||||||
|
case 2: // 出库任务
|
||||||
|
outTaskCount++;
|
||||||
|
break;
|
||||||
|
case 3: // 移库任务
|
||||||
|
moveTaskCount++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, Object> item = new HashMap<>();
|
||||||
|
item.put("dataDate", date.toString());
|
||||||
|
item.put("inTaskCount", inTaskCount);
|
||||||
|
item.put("outTaskCount", outTaskCount);
|
||||||
|
item.put("moveTaskCount", moveTaskCount);
|
||||||
|
result.add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 根据库位ID查询库存详情
|
||||||
|
* @param locationId 库位ID
|
||||||
|
* @return 库存详情列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Map<String, Object>> queryStockDetail(String locationId) {
|
||||||
|
List<Map<String, Object>> result = new ArrayList<>();
|
||||||
|
|
||||||
|
// 1. 构造查询条件
|
||||||
|
LambdaQueryWrapper<TAppStock> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(TAppStock::getLocationId, locationId);
|
||||||
|
|
||||||
|
// 2. 查询库存数据
|
||||||
|
List<TAppStock> stockList = tAppStockService.list(queryWrapper);
|
||||||
|
|
||||||
|
// 3. 转换为 Map 格式返回
|
||||||
|
for (TAppStock stock : stockList) {
|
||||||
|
Map<String, Object> item = new HashMap<>();
|
||||||
|
item.put("goodsId", stock.getGoodsId()); // 物料编号
|
||||||
|
item.put("goodsName", stock.getGoodsDesc()); // 物料名称
|
||||||
|
item.put("goodsNum", stock.getRealNum()); // 物料数量
|
||||||
|
item.put("wareDate", stock.getFirstInTime()); // 库上架时间
|
||||||
|
item.put("specialStock", stock.getSpecialStock()); // 质量(kg)
|
||||||
|
item.put("specialStockNo", stock.getSpecialStockNo()); // 产期
|
||||||
|
item.put("specialStockItemNo", stock.getSpecialStockItemNo()); // 到期期
|
||||||
|
item.put("batchId", stock.getBatchNo()); // 批次号
|
||||||
|
item.put("subpool", stock.getLocationId()); // 库编码
|
||||||
|
result.add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Map<String, Object>> queryRunningTask() {
|
||||||
|
List<Map<String, Object>> result = new ArrayList<>();
|
||||||
|
|
||||||
|
// 1. 查询运行中的任务数据,优先从 TAppTask 表中查询(最多10条)
|
||||||
|
LambdaQueryWrapper<TAppTask> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.last("LIMIT 10");
|
||||||
|
List<TAppTask> taskList = tAppTaskService.list(queryWrapper);
|
||||||
|
|
||||||
|
// 2. 添加实时任务到结果中
|
||||||
|
for (TAppTask task : taskList) {
|
||||||
|
Map<String, Object> item = new HashMap<>();
|
||||||
|
item.put("goodsId", task.getGoodsId()); // 物品编号
|
||||||
|
item.put("goodsName", task.getGoodsDesc()); // 物品名称
|
||||||
|
item.put("goodsNum", task.getOpNum()); // 物品数量
|
||||||
|
item.put("origin", task.getOrigin()); // 搬运起点
|
||||||
|
item.put("taskType", task.getTaskType()); // 任务类型
|
||||||
|
item.put("destination", task.getDestination()); // 搬运终点
|
||||||
|
result.add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 如果实时任务不足10条,则从 TAppTaskBak 表中查询最近的任务记录来补足
|
||||||
|
if (result.size() < 10) {
|
||||||
|
int remainingCount = 10 - result.size();
|
||||||
|
|
||||||
|
LambdaQueryWrapper<TAppTaskBak> bakQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
bakQueryWrapper.orderByDesc(TAppTaskBak::getCreateTime);
|
||||||
|
bakQueryWrapper.last("LIMIT " + remainingCount);
|
||||||
|
|
||||||
|
List<TAppTaskBak> bakTaskList = tAppTaskBakService.list(bakQueryWrapper);
|
||||||
|
|
||||||
|
for (TAppTaskBak task : bakTaskList) {
|
||||||
|
Map<String, Object> item = new HashMap<>();
|
||||||
|
item.put("goodsId", task.getGoodsId()); // 物品编号
|
||||||
|
item.put("goodsName", task.getGoodsDesc()); // 物品名称
|
||||||
|
item.put("goodsNum", task.getOpNum()); // 物品数量
|
||||||
|
item.put("origin", task.getOrigin()); // 搬运起点
|
||||||
|
item.put("taskType", task.getTaskType()); // 任务类型
|
||||||
|
item.put("destination", task.getDestination()); // 搬运终点
|
||||||
|
result.add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ public class LoginControllerServiceImpl implements ILoginControllerService {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
List<TSysMenu> menuPoList;
|
List<TSysMenu> menuPoList;
|
||||||
if (roleId.equals(AppConstant.ADMIN_ID)) {
|
if (roleId.equals(AppConstant.ADMIN_ID) || roleId.equals("2")) {
|
||||||
// 管理员获得所得菜单权限
|
// 管理员获得所得菜单权限
|
||||||
menuPoList = menuService.list();
|
menuPoList = menuService.list();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ 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;
|
||||||
|
import com.wms_main.repository.utils.DbTransUtils;
|
||||||
import com.wms_main.repository.utils.StringUtils;
|
import com.wms_main.repository.utils.StringUtils;
|
||||||
import com.wms_main.repository.utils.UUIDUtils;
|
import com.wms_main.repository.utils.UUIDUtils;
|
||||||
import com.wms_main.service.api.IEwmApiService;
|
import com.wms_main.service.api.IEwmApiService;
|
||||||
|
|
@ -42,13 +43,12 @@ import com.wms_main.service.controller.ITaskControllerService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Isolation;
|
|
||||||
import org.springframework.transaction.annotation.Propagation;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务控制类 服务实现
|
* 任务控制类 服务实现
|
||||||
|
|
@ -81,7 +81,7 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
private final ITempEwmInboundDataService tempEwmInboundDataService;
|
private final ITempEwmInboundDataService tempEwmInboundDataService;
|
||||||
private final ITAppStockCompareService appStockCompareService;
|
private final ITAppStockCompareService appStockCompareService;
|
||||||
|
|
||||||
|
private final DbTransUtils dbTransUtils;// 数据库事务工具
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 实现
|
* 实现
|
||||||
|
|
@ -243,6 +243,82 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
return BaseWmsApiResponse.success("生成入库任务成功。");
|
return BaseWmsApiResponse.success("生成入库任务成功。");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求出库空箱---实现
|
||||||
|
*
|
||||||
|
* @param stockOutRequest 请求信息
|
||||||
|
* @return 处理结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public BaseWmsApiResponse requireStockOutEmpty(StockOutRequest stockOutRequest) {
|
||||||
|
// 保存
|
||||||
|
if (stockOutRequest == null || stockOutRequest.getOutType() == null || stockOutRequest.getNeedNum() == null
|
||||||
|
|| stockOutRequest.getNeedNum() <= 0 || StringUtils.isEmpty(stockOutRequest.getDestination())) {
|
||||||
|
return BaseWmsApiResponse.error("请求参数不完整。");
|
||||||
|
}
|
||||||
|
// 判断终点对不对
|
||||||
|
if (!stockOutRequest.getDestination().equals("P4")) {
|
||||||
|
return BaseWmsApiResponse.error("请在入库端电脑操作!");
|
||||||
|
}
|
||||||
|
// 针对不同的出库类型验证请求
|
||||||
|
if (stockOutRequest.getOutType().equals(WmsOutTypeEnums.EMPTY.getCode())) {
|
||||||
|
List<TAppVehicle> emptyVehicles;
|
||||||
|
if (stockOutRequest.getVehicleId() == null || stockOutRequest.getVehicleId().isEmpty()) {
|
||||||
|
// 判断空载具数量够不够
|
||||||
|
emptyVehicles = appVehicleService.list(new LambdaQueryWrapper<TAppVehicle>()
|
||||||
|
.eq(TAppVehicle::getVehicleStatus, WmsVehicleStatusEnums.ON.getCode())
|
||||||
|
.eq(TAppVehicle::getIsEmpty, 1)
|
||||||
|
);
|
||||||
|
}else {
|
||||||
|
emptyVehicles = appVehicleService.list(new LambdaQueryWrapper<TAppVehicle>()
|
||||||
|
.eq(TAppVehicle::getVehicleId, stockOutRequest.getVehicleId())
|
||||||
|
.eq(TAppVehicle::getVehicleStatus, WmsVehicleStatusEnums.ON.getCode())
|
||||||
|
.eq(TAppVehicle::getIsEmpty, 1)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (emptyVehicles == null || emptyVehicles.isEmpty()) {
|
||||||
|
return BaseWmsApiResponse.error("请求错误:库内无可用空箱。");
|
||||||
|
}
|
||||||
|
if (emptyVehicles.size() < stockOutRequest.getNeedNum()) {
|
||||||
|
return BaseWmsApiResponse.error("请求错误:库内空箱数量" + emptyVehicles.size() + ",小于请求数量" + stockOutRequest.getNeedNum() + "。");
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return BaseWmsApiResponse.error("请求错误:未知的出库类型。");
|
||||||
|
}
|
||||||
|
// 添加任务
|
||||||
|
TAppOuts task = new TAppOuts(
|
||||||
|
UUIDUtils.getNewUUID(),
|
||||||
|
stockOutRequest.getGoodsId(),
|
||||||
|
stockOutRequest.getVehicleId(),
|
||||||
|
stockOutRequest.getNeedNum(),
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
stockOutRequest.getOutType(),
|
||||||
|
stockOutRequest.getDestination(),
|
||||||
|
stockOutRequest.getUserName(),
|
||||||
|
stockOutRequest.getReason(),
|
||||||
|
LocalDateTime.now(),
|
||||||
|
stockOutRequest.getWorkOrder(),
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
new Date(),
|
||||||
|
null,
|
||||||
|
-2
|
||||||
|
);
|
||||||
|
appOutsService.save(task);
|
||||||
|
return BaseWmsApiResponse.success("添加出库请求成功。");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求出库---实现
|
* 请求出库---实现
|
||||||
*
|
*
|
||||||
|
|
@ -407,7 +483,7 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
stockOutRequest.getSpecialStockItemNo(),
|
stockOutRequest.getSpecialStockItemNo(),
|
||||||
stockOutRequest.getBatchNo(),
|
stockOutRequest.getBatchNo(),
|
||||||
null,
|
null,
|
||||||
null,null, null,new Date()
|
null,null, null,new Date(),"",-1
|
||||||
);
|
);
|
||||||
appOutsService.save(task);
|
appOutsService.save(task);
|
||||||
return BaseWmsApiResponse.success("添加出库请求成功。");
|
return BaseWmsApiResponse.success("添加出库请求成功。");
|
||||||
|
|
@ -420,6 +496,7 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
* @return 处理结果
|
* @return 处理结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public EwmApiBackResponse ewmRequestOutTask(EwmOutTaskRequest ewmOutTaskRequest) {
|
public EwmApiBackResponse ewmRequestOutTask(EwmOutTaskRequest ewmOutTaskRequest) {
|
||||||
// 保存
|
// 保存
|
||||||
if (ewmOutTaskRequest == null || ewmOutTaskRequest.getTaskDetailInfo() == null
|
if (ewmOutTaskRequest == null || ewmOutTaskRequest.getTaskDetailInfo() == null
|
||||||
|
|
@ -438,7 +515,7 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
// .eq(TAppOuts::getWorkOrder, ewmOutTaskRequest.getWaveNo())
|
// .eq(TAppOuts::getWorkOrder, ewmOutTaskRequest.getWaveNo())
|
||||||
// );
|
// );
|
||||||
|
|
||||||
//List<TAppOuts> appOuts = new ArrayList<>();
|
List<TAppOuts> appOuts = new ArrayList<>();
|
||||||
|
|
||||||
for (EwmOutTaskRequest.TaskDetailInfo task : ewmOutTaskRequest.getTaskDetailInfo()){
|
for (EwmOutTaskRequest.TaskDetailInfo task : ewmOutTaskRequest.getTaskDetailInfo()){
|
||||||
// // 判断有没有出库数据相同的,如果有直接在已有的outs上做累加
|
// // 判断有没有出库数据相同的,如果有直接在已有的outs上做累加
|
||||||
|
|
@ -464,22 +541,29 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
return EwmApiBackResponse.error("请求错误:紧急出库必须输入有效数量。");
|
return EwmApiBackResponse.error("请求错误:紧急出库必须输入有效数量。");
|
||||||
}
|
}
|
||||||
String targetDestination;
|
String targetDestination;
|
||||||
// 判断
|
// 方法一:基于任务数最小的站台
|
||||||
List<TAppOuts> ret = appOutsService.list(new LambdaQueryWrapper<TAppOuts>()
|
|
||||||
.eq(TAppOuts::getOrderNo, task.getOrderNo())
|
// // 判断
|
||||||
);
|
// List<TAppOuts> ret = appOutsService.list(new LambdaQueryWrapper<TAppOuts>()
|
||||||
//查询是否有orderNo相同的数据
|
// .eq(TAppOuts::getOrderNo, task.getOrderNo())
|
||||||
if(!ret.isEmpty()){
|
// );
|
||||||
targetDestination = ret.getFirst().getDestination();
|
// //查询是否有orderNo相同的数据
|
||||||
}else {
|
// if(!ret.isEmpty()){
|
||||||
// 使用Stream API直接找出任务数最少的站台
|
// targetDestination = ret.getFirst().getDestination();
|
||||||
targetDestination = pickStands.stream()
|
// }else {
|
||||||
.min(Comparator.comparingInt(stand ->
|
// // 使用Stream API直接找出任务数最少的站台
|
||||||
Math.toIntExact(appOutsService.count(new LambdaQueryWrapper<TAppOuts>()
|
// targetDestination = pickStands.stream()
|
||||||
.eq(TAppOuts::getDestination, stand.getStandId())))))
|
// .min(Comparator.comparingInt(stand ->
|
||||||
.map(TAppStand::getStandId)
|
// Math.toIntExact(appOutsService.count(new LambdaQueryWrapper<TAppOuts>()
|
||||||
.orElse(null);
|
// .eq(TAppOuts::getDestination, stand.getStandId())))))
|
||||||
}
|
// .map(TAppStand::getStandId)
|
||||||
|
// .orElse(null);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 方法二:基于当前时间戳的轮询分配
|
||||||
|
int standIndex = (int) (System.currentTimeMillis() % pickStands.size());
|
||||||
|
targetDestination = pickStands.get(standIndex).getStandId();
|
||||||
|
|
||||||
if (targetDestination == null) {
|
if (targetDestination == null) {
|
||||||
return EwmApiBackResponse.error("无法找到合适的站台进行任务分配。");
|
return EwmApiBackResponse.error("无法找到合适的站台进行任务分配。");
|
||||||
}
|
}
|
||||||
|
|
@ -571,11 +655,12 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
ewmOutTaskRequest.getWaveNo(),
|
ewmOutTaskRequest.getWaveNo(),
|
||||||
task.getSkuUnit(),
|
task.getSkuUnit(),
|
||||||
task.getSecondPickingKey(),
|
task.getSecondPickingKey(),
|
||||||
ewmOutTaskRequest.getPickingDate()
|
ewmOutTaskRequest.getPickingDate(),"",-1
|
||||||
);
|
);
|
||||||
//appOuts.add(outs);
|
appOuts.add(outs);
|
||||||
appOutsService.save(outs);
|
//appOutsService.save(outs);
|
||||||
}
|
}
|
||||||
|
appOutsService.saveBatch(appOuts);
|
||||||
return EwmApiBackResponse.success("添加出库请求成功。");
|
return EwmApiBackResponse.success("添加出库请求成功。");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -636,7 +721,6 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
// 构造唯一键
|
// 构造唯一键
|
||||||
String key = String.join("|",
|
String key = String.join("|",
|
||||||
matNo != null ? matNo : "",
|
matNo != null ? matNo : "",
|
||||||
matDesc != null ? matDesc : "",
|
|
||||||
specialStock != null ? specialStock : "",
|
specialStock != null ? specialStock : "",
|
||||||
specialStockNo != null ? specialStockNo : "",
|
specialStockNo != null ? specialStockNo : "",
|
||||||
specialStockItemNo != null ? specialStockItemNo : "",
|
specialStockItemNo != null ? specialStockItemNo : "",
|
||||||
|
|
@ -653,7 +737,6 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
// 创建新的BinStock记录
|
// 创建新的BinStock记录
|
||||||
EwmApiStockResponse.BinStock binStock = new EwmApiStockResponse.BinStock();
|
EwmApiStockResponse.BinStock binStock = new EwmApiStockResponse.BinStock();
|
||||||
binStock.setMatNo(matNo);
|
binStock.setMatNo(matNo);
|
||||||
binStock.setMatDesc(matDesc);
|
|
||||||
binStock.setTotalQuantity((double) localStock.getRealNum());
|
binStock.setTotalQuantity((double) localStock.getRealNum());
|
||||||
binStock.setSpecialStock(specialStock);
|
binStock.setSpecialStock(specialStock);
|
||||||
binStock.setSpecialStockNo(specialStockNo);
|
binStock.setSpecialStockNo(specialStockNo);
|
||||||
|
|
@ -885,7 +968,7 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
null,
|
null,
|
||||||
null,null,
|
null,null,
|
||||||
null,
|
null,
|
||||||
null
|
null,"",-1
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1000,7 +1083,7 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
wcsVehicleInRequest.getVehicleNo(),
|
wcsVehicleInRequest.getVehicleNo(),
|
||||||
response != null ? response.getMessage() : "响应为空");
|
response != null ? response.getMessage() : "响应为空");
|
||||||
}
|
}
|
||||||
saveEwmDataToTempTable(response, wcsVehicleInRequest.getVehicleNo());
|
//saveEwmDataToTempTable(response, wcsVehicleInRequest.getVehicleNo());
|
||||||
return response;
|
return response;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// 记录错误日志
|
// 记录错误日志
|
||||||
|
|
@ -1020,37 +1103,21 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
// 先查询要删除的数据
|
boolean deletedCount = tempEwmInboundDataService.remove(new LambdaQueryWrapper<TAppTempEwmInboundData>()
|
||||||
List<TAppTempEwmInboundData> existingData = tempEwmInboundDataService.list(
|
.eq(TAppTempEwmInboundData::getContainerNo, vehicleNo)
|
||||||
new LambdaQueryWrapper<TAppTempEwmInboundData>()
|
.eq(TAppTempEwmInboundData::getProcessStatus, 0));
|
||||||
.eq(TAppTempEwmInboundData::getContainerNo, vehicleNo)
|
|
||||||
.eq(TAppTempEwmInboundData::getProcessStatus, 0)
|
|
||||||
);
|
|
||||||
log.debug("删除前查询到 {} 条待处理数据,载具号: {}", existingData.size(), vehicleNo);
|
|
||||||
|
|
||||||
// 先删除该载具号之前可能存在的未处理数据
|
log.info("删除旧的EWM临时数据: {} 条,载具号: {}", deletedCount, vehicleNo);
|
||||||
boolean removeResult = tempEwmInboundDataService.remove(new LambdaQueryWrapper<TAppTempEwmInboundData>()
|
|
||||||
.eq(TAppTempEwmInboundData::getContainerNo, vehicleNo));
|
|
||||||
|
|
||||||
log.info("删除操作结果: {},载具号: {},删除条件: containerNo={}, processStatus=0",
|
|
||||||
removeResult, vehicleNo, vehicleNo);
|
|
||||||
|
|
||||||
// 再次查询确认是否删除成功
|
|
||||||
List<TAppTempEwmInboundData> afterDeleteData = tempEwmInboundDataService.list(
|
|
||||||
new LambdaQueryWrapper<TAppTempEwmInboundData>()
|
|
||||||
.eq(TAppTempEwmInboundData::getContainerNo, vehicleNo)
|
|
||||||
.eq(TAppTempEwmInboundData::getProcessStatus, 0)
|
|
||||||
);
|
|
||||||
log.debug("删除后剩余 {} 条待处理数据,载具号: {}", afterDeleteData.size(), vehicleNo);
|
|
||||||
|
|
||||||
// 转换并保存数据
|
// 转换并保存数据
|
||||||
List<TAppTempEwmInboundData> dataList = new ArrayList<>();
|
List<TAppTempEwmInboundData> dataList = new ArrayList<>();
|
||||||
for (TaskDetailInfo taskDetail : response.getContent().getTaskDetailInfo()) {
|
EwmApiLocalResponse.Content content = response.getContent();
|
||||||
|
for (TaskDetailInfo taskDetail : content.getTaskDetailInfo()) {
|
||||||
TAppTempEwmInboundData data = new TAppTempEwmInboundData();
|
TAppTempEwmInboundData data = new TAppTempEwmInboundData();
|
||||||
data.setId(UUIDUtils.getNewUUID()); // 不要使用固定值"123"
|
data.setId(UUIDUtils.getNewUUID()); // 不要使用固定值"123"
|
||||||
data.setBillNo(response.getContent().getBillNo());
|
data.setBillNo(content.getBillNo());
|
||||||
data.setBillType(response.getContent().getBillType());
|
data.setBillType(content.getBillType());
|
||||||
data.setContainerNo(response.getContent().getContainerNo() != null ? response.getContent().getContainerNo() : vehicleNo);
|
data.setContainerNo(content.getContainerNo() != null ? content.getContainerNo() : vehicleNo);
|
||||||
data.setTaskNo(taskDetail.getTaskNo());
|
data.setTaskNo(taskDetail.getTaskNo());
|
||||||
data.setOrderNo(taskDetail.getOrderNo());
|
data.setOrderNo(taskDetail.getOrderNo());
|
||||||
data.setOrderType(taskDetail.getOrderType());
|
data.setOrderType(taskDetail.getOrderType());
|
||||||
|
|
@ -1133,13 +1200,15 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新临时表中对应记录的状态为已处理
|
// 更新临时表中对应记录的状态为已处理
|
||||||
|
LambdaUpdateWrapper<TAppTempEwmInboundData> updateWrapper = new LambdaUpdateWrapper<TAppTempEwmInboundData>()
|
||||||
|
.set(TAppTempEwmInboundData::getProcessStatus, 1)
|
||||||
|
.set(TAppTempEwmInboundData::getUpdateTime, LocalDateTime.now())
|
||||||
|
.eq(TAppTempEwmInboundData::getContainerNo, wcsVehicleInRequest.getVehicleNo())
|
||||||
|
.eq(TAppTempEwmInboundData::getProcessStatus, 0);
|
||||||
|
|
||||||
|
boolean updateResult = tempEwmInboundDataService.update(updateWrapper);
|
||||||
|
log.info("更新临时数据状态完成,载具号: {},更新记录数: {}", wcsVehicleInRequest.getVehicleNo(), updateResult);
|
||||||
|
|
||||||
boolean updateResult = tempEwmInboundDataService.update(
|
|
||||||
new LambdaUpdateWrapper<TAppTempEwmInboundData>()
|
|
||||||
.set(TAppTempEwmInboundData::getProcessStatus, 1) // 已处理状态
|
|
||||||
.set(TAppTempEwmInboundData::getUpdateTime, LocalDateTime.now())
|
|
||||||
.in(TAppTempEwmInboundData::getContainerNo, wcsVehicleInRequest.getVehicleNo())
|
|
||||||
);
|
|
||||||
|
|
||||||
if (updateResult) {
|
if (updateResult) {
|
||||||
log.info("成功更新临时数据状态为已处理,载具号: {}", wcsVehicleInRequest.getVehicleNo());
|
log.info("成功更新临时数据状态为已处理,载具号: {}", wcsVehicleInRequest.getVehicleNo());
|
||||||
|
|
@ -1167,48 +1236,91 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
if (StringUtils.isEmpty(wcsVehicleInRequest.getVehicleNo())) {
|
if (StringUtils.isEmpty(wcsVehicleInRequest.getVehicleNo())) {
|
||||||
return WcsApiResponse.error("请求缺少关键信息:载具号。", null);
|
return WcsApiResponse.error("请求缺少关键信息:载具号。", null);
|
||||||
}
|
}
|
||||||
|
// // 0. 验证任务是否已经存在
|
||||||
|
// List<TAppTask> wmsTaskIsExist = appWmsTaskService.list(
|
||||||
|
// new LambdaQueryWrapper<TAppTask>()
|
||||||
|
// .eq(TAppTask::getVehicleId, wcsVehicleInRequest.getVehicleNo())
|
||||||
|
// .eq(TAppTask::getTaskType, WmsTaskTypeEnums.IN.getCode())
|
||||||
|
// );
|
||||||
|
// // 1. 验证WCS任务是否已经存在
|
||||||
|
// List<TAppWcsTask> wcsTaskIsExist = appWcsTaskService.list(
|
||||||
|
// new LambdaQueryWrapper<TAppWcsTask>()
|
||||||
|
// .eq(TAppWcsTask::getVehicleId, wcsVehicleInRequest.getVehicleNo())
|
||||||
|
// .eq(TAppWcsTask::getWcsTaskType, WmsTaskTypeEnums.IN.getCode())
|
||||||
|
// );
|
||||||
|
// if (!wmsTaskIsExist.isEmpty() && !wcsTaskIsExist.isEmpty()){
|
||||||
|
// appWcsTaskService.update(new LambdaUpdateWrapper<TAppWcsTask>()
|
||||||
|
// .set(TAppWcsTask::getWcsTaskStatus, 0)
|
||||||
|
// .eq(TAppWcsTask::getVehicleId, wcsVehicleInRequest.getVehicleNo())
|
||||||
|
// .eq(TAppWcsTask::getWcsTaskType, WcsStackerTaskTypeEnums.IN.getCode()));
|
||||||
|
// return WcsApiResponse.error("该载具号已经存在入库任务,修改wcs状态重新下发。", null);
|
||||||
|
// }
|
||||||
|
// if (!wmsTaskIsExist.isEmpty() || !wcsTaskIsExist.isEmpty()){
|
||||||
|
// return WcsApiResponse.error("该载具号已经存在入库任务,请检查。", null);
|
||||||
|
// }
|
||||||
|
// -1. 验证载具号在check表是否有数据
|
||||||
|
List<TAppOutsCheck> outsCheckList = appOutsCheckService.list(
|
||||||
|
new LambdaQueryWrapper<TAppOutsCheck>()
|
||||||
|
.eq(TAppOutsCheck::getContainerNo, wcsVehicleInRequest.getVehicleNo()) // vehicleId 是你要查询的载具号
|
||||||
|
);
|
||||||
|
|
||||||
// 0. 验证任务是否已经存在
|
// 0. 验证库存信息
|
||||||
List<TAppTask> wmsTaskIsExist = appWmsTaskService.list(
|
List<TAppStock> stockList = appStockService.list(
|
||||||
new LambdaQueryWrapper<TAppTask>()
|
new LambdaQueryWrapper<TAppStock>()
|
||||||
.eq(TAppTask::getVehicleId, wcsVehicleInRequest.getVehicleNo())
|
.eq(TAppStock::getVehicleId, wcsVehicleInRequest.getVehicleNo())
|
||||||
.eq(TAppTask::getTaskType, WmsTaskTypeEnums.IN.getCode())
|
|
||||||
);
|
);
|
||||||
// 1. 验证WCS任务是否已经存在
|
|
||||||
List<TAppWcsTask> wcsTaskIsExist = appWcsTaskService.list(
|
|
||||||
new LambdaQueryWrapper<TAppWcsTask>()
|
|
||||||
.eq(TAppWcsTask::getVehicleId, wcsVehicleInRequest.getVehicleNo())
|
|
||||||
.eq(TAppWcsTask::getWcsTaskType, WmsTaskTypeEnums.IN.getCode())
|
|
||||||
);
|
|
||||||
if (!wmsTaskIsExist.isEmpty() && !wcsTaskIsExist.isEmpty()){
|
|
||||||
appWcsTaskService.update(new LambdaUpdateWrapper<TAppWcsTask>()
|
|
||||||
.set(TAppWcsTask::getWcsTaskStatus, 0)
|
|
||||||
.eq(TAppWcsTask::getVehicleId, wcsVehicleInRequest.getVehicleNo())
|
|
||||||
.eq(TAppWcsTask::getWcsTaskType, WcsStackerTaskTypeEnums.IN.getCode()));
|
|
||||||
return WcsApiResponse.error("该载具号已经存在入库任务,修改wcs状态重新下发。", null);
|
|
||||||
}
|
|
||||||
if (!wmsTaskIsExist.isEmpty() || !wcsTaskIsExist.isEmpty()){
|
|
||||||
return WcsApiResponse.error("该载具号已经存在入库任务,请检查。", null);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 1. 获取EWM数据
|
// 1. 获取EWM数据
|
||||||
EwmApiLocalResponse response = ewmInformationBack(wcsVehicleInRequest);
|
EwmApiLocalResponse response = ewmInformationBack(wcsVehicleInRequest);
|
||||||
if (!response.isSuccess()) {
|
if (!response.isSuccess()) {
|
||||||
return WcsApiResponse.error(response.getMessage(), null);
|
return WcsApiResponse.error(response.getMessage(), null);
|
||||||
}
|
}
|
||||||
try {
|
// 判断是否为空箱
|
||||||
// 2. 将EWM数据保存到临时表
|
if (response.getContent().isEmptyContainer()) {
|
||||||
saveEwmDataToTempTable(response, wcsVehicleInRequest.getVehicleNo());
|
if (!outsCheckList.isEmpty() || !stockList.isEmpty()){
|
||||||
|
return WcsApiResponse.error("该容器已作为拣选任务绑定的目标容器,请检查。", null);
|
||||||
|
}
|
||||||
|
return WcsApiResponse.success("该容器为空箱,请检查。", null);
|
||||||
|
// 创建空载具入库任务
|
||||||
|
// TAppTask task = new TAppTask(
|
||||||
|
// UUIDUtils.getNewUUID(),
|
||||||
|
// WmsTaskTypeEnums.IN.getCode(),
|
||||||
|
// WmsStackerTaskStatusEnums.TEMP.getCode(),
|
||||||
|
// 1,
|
||||||
|
// wcsVehicleInRequest.getVehicleNo(),
|
||||||
|
// wcsVehicleInRequest.getPoint(),
|
||||||
|
// null,
|
||||||
|
// null,
|
||||||
|
// LocalDateTime.now(),
|
||||||
|
// null,
|
||||||
|
// AppConstant.EMPTY_GOODS_ID,
|
||||||
|
// 0,
|
||||||
|
// 0,
|
||||||
|
// "空箱",
|
||||||
|
// "空箱入库",
|
||||||
|
// "R1",
|
||||||
|
// ""
|
||||||
|
// );
|
||||||
|
// try {
|
||||||
|
// // 保存任务
|
||||||
|
// appWmsTaskService.save(task);
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// return WcsApiResponse.error("空箱入库申请失败,请检查。", null);
|
||||||
|
// }
|
||||||
|
}else{
|
||||||
|
try {
|
||||||
|
// 2. 将EWM数据保存到临时表
|
||||||
|
saveEwmDataToTempTable(response, wcsVehicleInRequest.getVehicleNo());
|
||||||
|
|
||||||
// 3. 根据临时表数据生成WMS任务
|
// 3. 根据临时表数据生成WMS任务
|
||||||
generateWmsTasksFromTempData(wcsVehicleInRequest);
|
generateWmsTasksFromTempData(wcsVehicleInRequest);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("处理EWM数据异常,载具号: {}", wcsVehicleInRequest.getVehicleNo(), e);
|
log.error("处理EWM数据异常,载具号: {}", wcsVehicleInRequest.getVehicleNo(), e);
|
||||||
return WcsApiResponse.error("处理EWM数据失败: " + e.getMessage(), null);
|
return WcsApiResponse.error("处理EWM数据失败: " + e.getMessage(), null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 查询该载具对应的wms任务
|
// 查询该载具对应的wms任务
|
||||||
List<TAppTask> wmsTasks = appWmsTaskService.list(
|
List<TAppTask> wmsTasks = appWmsTaskService.list(
|
||||||
new LambdaQueryWrapper<TAppTask>()
|
new LambdaQueryWrapper<TAppTask>()
|
||||||
|
|
@ -1239,25 +1351,25 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
}
|
}
|
||||||
// 判断是否已经分配库位
|
// 判断是否已经分配库位
|
||||||
String locationId = "";
|
String locationId = "";
|
||||||
List<String> goodsIds = new ArrayList<>();
|
//List<String> goodsIds = new ArrayList<>();
|
||||||
for (TAppTask wmsTask : wmsTasks) {
|
for (TAppTask wmsTask : wmsTasks) {
|
||||||
if (StringUtils.isNotEmpty(wmsTask.getDestination())) {
|
if (StringUtils.isNotEmpty(wmsTask.getDestination())) {
|
||||||
locationId = wmsTask.getDestination();
|
locationId = wmsTask.getDestination();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!goodsIds.contains(wmsTask.getGoodsId())) {
|
// if (!goodsIds.contains(wmsTask.getGoodsId())) {
|
||||||
goodsIds.add(wmsTask.getGoodsId());
|
// goodsIds.add(wmsTask.getGoodsId());
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
if (StringUtils.isEmpty(locationId)) {
|
if (StringUtils.isEmpty(locationId)) {
|
||||||
// 如果只有一个料号,那么分配优先存放区域
|
// 如果只有一个料号,那么分配优先存放区域
|
||||||
TAppLocation locationFilter = new TAppLocation();
|
// TAppLocation locationFilter = new TAppLocation();
|
||||||
if (goodsIds.size() == 1) {
|
// if (goodsIds.size() == 1) {
|
||||||
TAppGoods thisGoods = appCommon.getInstantGoodsByGoodsId(goodsIds.getFirst());
|
// TAppGoods thisGoods = appCommon.getInstantGoodsByGoodsId(goodsIds.getFirst());
|
||||||
if (thisGoods != null && StringUtils.isNotEmpty(thisGoods.getPutArea())) {
|
// if (thisGoods != null && StringUtils.isNotEmpty(thisGoods.getPutArea())) {
|
||||||
locationFilter.setSubArea(thisGoods.getPutArea());
|
// locationFilter.setSubArea(thisGoods.getPutArea());
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
// 需要申请库位
|
// 需要申请库位
|
||||||
TAppLocation targetLocation = stackerTaskService.requestOneLocation(null, wcsVehicleInRequest.getVehicleNo());
|
TAppLocation targetLocation = stackerTaskService.requestOneLocation(null, wcsVehicleInRequest.getVehicleNo());
|
||||||
locationId = targetLocation.getLocationId();
|
locationId = targetLocation.getLocationId();
|
||||||
|
|
@ -1333,8 +1445,6 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
* @return 响应信息
|
* @return 响应信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
//@Transactional(rollbackFor = Exception.class)
|
|
||||||
@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
|
|
||||||
public BaseWcsApiResponse boxArrive(WcsBoxArriveRequest boxArriveRequest) {
|
public BaseWcsApiResponse boxArrive(WcsBoxArriveRequest boxArriveRequest) {
|
||||||
if (boxArriveRequest == null
|
if (boxArriveRequest == null
|
||||||
|| StringUtils.isEmpty(boxArriveRequest.getVehicleNo())
|
|| StringUtils.isEmpty(boxArriveRequest.getVehicleNo())
|
||||||
|
|
@ -1347,6 +1457,13 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
return BaseWcsApiResponse.error("没有找到当前载具的拣选任务。");
|
return BaseWcsApiResponse.error("没有找到当前载具的拣选任务。");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pickTask.getPickType() == 3){
|
||||||
|
// 直接删除
|
||||||
|
appPickTaskService.remove(new LambdaQueryWrapper<TAppPickTask>()
|
||||||
|
.eq(TAppPickTask::getPickId, pickTask.getPickId()));
|
||||||
|
return BaseWcsApiResponse.success("空载具出库成功,已自动删除拣选任务。");
|
||||||
|
}
|
||||||
|
|
||||||
String pickStand = pickTask.getPickStand();
|
String pickStand = pickTask.getPickStand();
|
||||||
|
|
||||||
// 判断当前站台有没有别的已到达的拣选任务
|
// 判断当前站台有没有别的已到达的拣选任务
|
||||||
|
|
@ -1354,40 +1471,36 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
.eq(TAppPickTask::getPickStand, boxArriveRequest.getLocation())
|
.eq(TAppPickTask::getPickStand, boxArriveRequest.getLocation())
|
||||||
.eq(TAppPickTask::getPickStatus, WmsPickTaskStatusEnum.ARRIVE.getCode()));
|
.eq(TAppPickTask::getPickStatus, WmsPickTaskStatusEnum.ARRIVE.getCode()));
|
||||||
|
|
||||||
// 如果有其他已到达的拣选任务,将它们的状态设置为0(等待状态)
|
boolean doTransResult = dbTransUtils.useTran(() -> {
|
||||||
if (pickTaskList != null && !pickTaskList.isEmpty()) {
|
// 如果有其他已到达的拣选任务,将它们的状态设置为0(等待状态)
|
||||||
for (TAppPickTask otherTask : pickTaskList) {
|
if (pickTaskList != null && !pickTaskList.isEmpty()) {
|
||||||
appPickTaskService.update(new LambdaUpdateWrapper<TAppPickTask>()
|
for (TAppPickTask otherTask : pickTaskList) {
|
||||||
.set(TAppPickTask::getPickStatus, 0) // 设置为等待状态
|
appPickTaskService.update(new LambdaUpdateWrapper<TAppPickTask>()
|
||||||
.set(TAppPickTask::getPickId, UUIDUtils.getNewUUID()) // 重新设置ID
|
.set(TAppPickTask::getPickStatus, WmsPickTaskStatusEnum.SEND.getCode()) // 设置为等待状态
|
||||||
.eq(TAppPickTask::getPickId, otherTask.getPickId()));
|
.eq(TAppPickTask::getPickId, otherTask.getPickId()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
// 更新当前载具到达当前点位的拣选任务为已到达
|
||||||
// 更新当前载具到达当前点位的拣选任务为已到达
|
appPickTaskService.update(new LambdaUpdateWrapper<TAppPickTask>()
|
||||||
boolean isUpdateSuccess = appPickTaskService.update(new LambdaUpdateWrapper<TAppPickTask>()
|
.set(TAppPickTask::getPickStatus, WmsPickTaskStatusEnum.ARRIVE.getCode())
|
||||||
.set(TAppPickTask::getPickStatus, WmsPickTaskStatusEnum.ARRIVE.getCode())
|
.set(TAppPickTask::getArriveTime, LocalDateTime.now())
|
||||||
.set(TAppPickTask::getArriveTime, LocalDateTime.now())
|
.set(TAppPickTask::getPickStand, boxArriveRequest.getLocation())
|
||||||
.set(TAppPickTask::getPickStand, boxArriveRequest.getLocation())
|
.eq(TAppPickTask::getVehicleId, boxArriveRequest.getVehicleNo())
|
||||||
.eq(TAppPickTask::getVehicleId, boxArriveRequest.getVehicleNo())
|
.gt(TAppPickTask::getPickStatus, WmsPickTaskStatusEnum.WAIT.getCode())
|
||||||
.gt(TAppPickTask::getPickStatus, WmsPickTaskStatusEnum.WAIT.getCode())
|
.ne(TAppPickTask::getPickStatus, WmsPickTaskStatusEnum.FOR_IN.getCode()));
|
||||||
.ne(TAppPickTask::getPickStatus, WmsPickTaskStatusEnum.FOR_IN.getCode()));
|
|
||||||
|
|
||||||
// 更新拣选PLAN
|
// 更新拣选PLAN
|
||||||
boolean isUpdatePlanSuccess = appPickPlanService.update(new LambdaUpdateWrapper<TAppPickPlan>()
|
appPickPlanService.update(new LambdaUpdateWrapper<TAppPickPlan>()
|
||||||
.set(TAppPickPlan::getStandId, boxArriveRequest.getLocation())
|
.set(TAppPickPlan::getStandId, boxArriveRequest.getLocation())
|
||||||
.eq(TAppPickPlan::getVehicleId, boxArriveRequest.getVehicleNo())
|
.eq(TAppPickPlan::getVehicleId, boxArriveRequest.getVehicleNo())
|
||||||
.eq(TAppPickPlan::getStandId, pickStand)
|
.eq(TAppPickPlan::getStandId, pickStand)
|
||||||
.last("LIMIT 1"));
|
.last("LIMIT 1"));
|
||||||
|
});
|
||||||
//boolean isUpdatePlanSuccess = updatePickPlanInNewTransaction(boxArriveRequest, pickStand);
|
if (!doTransResult) {
|
||||||
|
log.error("执行出库单,数据库事务失败。");
|
||||||
if (isUpdateSuccess && isUpdatePlanSuccess) {
|
|
||||||
// 更新成功,返回成功
|
|
||||||
return BaseWcsApiResponse.success("处理成功。");
|
|
||||||
} else {
|
|
||||||
// 更新失败,返回失败
|
|
||||||
return BaseWcsApiResponse.error("处理失败。");
|
return BaseWcsApiResponse.error("处理失败。");
|
||||||
}
|
}
|
||||||
|
return BaseWcsApiResponse.success("处理成功。");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1428,7 +1541,7 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
* @return 获取结果
|
* @return 获取结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
//@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public WmsApiResponse<List<TaskConfirmVo>> getCurrentTask(BaseWmsRequest wmsRequest) {
|
public WmsApiResponse<List<TaskConfirmVo>> getCurrentTask(BaseWmsRequest wmsRequest) {
|
||||||
if (wmsRequest == null || StringUtils.isEmpty(wmsRequest.getStandId())) {
|
if (wmsRequest == null || StringUtils.isEmpty(wmsRequest.getStandId())) {
|
||||||
// 缺少站台号
|
// 缺少站台号
|
||||||
|
|
@ -1545,32 +1658,55 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
if (pickTaskList.size() > 1) {
|
if (pickTaskList.size() > 1) {
|
||||||
return BaseWmsApiResponse.error("当前站台有多个箱子到达,请检查。");
|
return BaseWmsApiResponse.error("当前站台有多个箱子到达,请检查。");
|
||||||
}
|
}
|
||||||
|
if (!Objects.equals(pickTaskList.getFirst().getVehicleId(), confirmTaskRequest.getStockConfirm().getVehicleId())){
|
||||||
TAppOuts thisOut = appOutsService.getOne(new LambdaQueryWrapper<TAppOuts>()
|
return BaseWmsApiResponse.error("当前站台载具与实际任务不一致,请刷新页面后重试。");
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(confirmTaskRequest.getStockConfirm().getVehicleId()) || StringUtils.isEmpty(confirmTaskRequest.getStockConfirm().getGoodsId())
|
||||||
|
|| confirmTaskRequest.getStockConfirm().getRealRemainQty() == null) {
|
||||||
|
return BaseWmsApiResponse.error("网络超时导致数据丢失,请刷新页面后重新拣选。");
|
||||||
|
}
|
||||||
|
List<TAppOuts> thisOut = new ArrayList<>();
|
||||||
|
if (confirmTaskRequest.getTaskConfirm().getIsEmpty() == 0){
|
||||||
|
thisOut = appOutsService.list(new LambdaQueryWrapper<TAppOuts>()
|
||||||
|
.eq(TAppOuts::getPickPlanId, confirmTaskRequest.getStockConfirm().getStockId())
|
||||||
|
);
|
||||||
|
} else if (confirmTaskRequest.getTaskConfirm().getIsEmpty() == 1) {
|
||||||
|
TAppOuts out = appOutsService.getOne(new LambdaQueryWrapper<TAppOuts>()
|
||||||
.eq(TAppOuts::getTaskId, confirmTaskRequest.getTaskConfirm().getTaskId()));
|
.eq(TAppOuts::getTaskId, confirmTaskRequest.getTaskConfirm().getTaskId()));
|
||||||
|
if (out != null){
|
||||||
|
thisOut.add(out);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
return BaseWmsApiResponse.error("字段isEmpty获取失败,请重试");
|
||||||
|
}
|
||||||
|
|
||||||
if (thisOut == null) {
|
if (thisOut == null) {
|
||||||
return BaseWmsApiResponse.error("当前任务不存在或已经拣选完毕,请刷新后重试。");
|
return BaseWmsApiResponse.error("当前任务不存在或已经拣选完毕,请刷新后重试。");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (thisOut.size() != confirmTaskRequest.getTaskConfirm().getTotalQty()){
|
||||||
|
return BaseWmsApiResponse.error("EWM下发新需求,请刷新后重新合并!");
|
||||||
|
}
|
||||||
|
|
||||||
// 调用EWM系统检验箱子
|
// 调用EWM系统检验箱子
|
||||||
SendEwmCheckContainerNo request = new SendEwmCheckContainerNo();
|
SendEwmCheckContainerNo request = new SendEwmCheckContainerNo();
|
||||||
request.setContainerNo(confirmTaskRequest.getTaskConfirm().getContainerNo());
|
request.setContainerNo(confirmTaskRequest.getTaskConfirm().getContainerNo());
|
||||||
request.setType(thisOut.getPickingType());
|
request.setType(thisOut.getFirst().getPickingType());
|
||||||
request.setFirstOrSecond(false);
|
request.setFirstOrSecond(false);
|
||||||
request.setCheckKey(thisOut.getSecondPickingCode());
|
request.setCheckKey(thisOut.getFirst().getSecondPickingCode());
|
||||||
EwmApiBackResponse ewmResponse = ewmApiService.sendEwmCheckContainerNo(request);
|
EwmApiBackResponse ewmResponse = ewmApiService.sendEwmCheckContainerNo(request);
|
||||||
// 检查 EWM 系统返回结果
|
// 检查 EWM 系统返回结果
|
||||||
if (ewmResponse == null) {
|
if (Objects.equals(ewmResponse.getState(), "failed")) {
|
||||||
return BaseWmsApiResponse.error("EWM系统无响应,请检查网络连接。");
|
return BaseWmsApiResponse.error("调用EWM系统检验容器接口异常:{}。" + ewmResponse.getMessage());
|
||||||
}
|
}
|
||||||
// 检查返回内容是否为空
|
// 检查返回内容是否为空
|
||||||
if (ewmResponse.getContent() == null) {
|
if (ewmResponse.getContent() == null) {
|
||||||
// 根据 state 状态处理
|
// 根据 state 状态处理
|
||||||
if ("successfully".equals(ewmResponse.getState())) {
|
if ("successfully".equals(ewmResponse.getState())) {
|
||||||
return BaseWmsApiResponse.success("操作成功,但无返回内容。");
|
//return BaseWmsApiResponse.success("操作成功,但无返回内容。");
|
||||||
|
log.info("EWM系统检验容器接口无返回内容。");
|
||||||
} else {
|
} else {
|
||||||
return BaseWmsApiResponse.error("EWM系统返回异常:" + (ewmResponse.getMessage() != null ? ewmResponse.getMessage() : "未知错误"));
|
return BaseWmsApiResponse.error("EWM系统检验容器接口返回异常:" + (ewmResponse.getMessage() != null ? ewmResponse.getMessage() : "未知错误"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1582,7 +1718,7 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
|
|
||||||
// 1. 检测是否是颗粒度相同(考虑 null 和 empty)
|
// 1. 检测是否是颗粒度相同(考虑 null 和 empty)
|
||||||
String existingSecondPickingCode = existingCheck.getSecondPickingCode();
|
String existingSecondPickingCode = existingCheck.getSecondPickingCode();
|
||||||
String newSecondPickingCode = thisOut.getSecondPickingCode();
|
String newSecondPickingCode = thisOut.getFirst().getSecondPickingCode();
|
||||||
|
|
||||||
boolean isSecondPickingCodeMatch = (StringUtils.isEmpty(existingSecondPickingCode) && StringUtils.isEmpty(newSecondPickingCode))
|
boolean isSecondPickingCodeMatch = (StringUtils.isEmpty(existingSecondPickingCode) && StringUtils.isEmpty(newSecondPickingCode))
|
||||||
|| Objects.equals(existingSecondPickingCode, newSecondPickingCode);
|
|| Objects.equals(existingSecondPickingCode, newSecondPickingCode);
|
||||||
|
|
@ -1593,106 +1729,93 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
|
|
||||||
// 2. 如果颗粒度一致(包括都为空),再检测工单号是否相同
|
// 2. 如果颗粒度一致(包括都为空),再检测工单号是否相同
|
||||||
String existingOrderNo = existingCheck.getOrderNo();
|
String existingOrderNo = existingCheck.getOrderNo();
|
||||||
String newOrderNo = thisOut.getOrderNo();
|
String newOrderNo = thisOut.getFirst().getOrderNo();
|
||||||
|
|
||||||
boolean isOrderNoMatch = Objects.equals(existingOrderNo, newOrderNo);
|
boolean isOrderNoMatch = Objects.equals(existingOrderNo, newOrderNo);
|
||||||
if (!isOrderNoMatch) {
|
if (!isOrderNoMatch) {
|
||||||
return BaseWmsApiResponse.error("当前目标箱号已存在其他工单号物料,请检查。");
|
return BaseWmsApiResponse.error("当前目标箱号已存在其他工单号物料,请检查。");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 将出库完成需要反馈的信息插入outsCheck表中
|
|
||||||
List<TAppOutsCheck> outsChecks = new ArrayList<>();
|
|
||||||
outsChecks.add(new TAppOutsCheck(
|
|
||||||
UUIDUtils.getNewUUID("CHECK_"),
|
|
||||||
thisOut.getWaveNo(),
|
|
||||||
confirmTaskRequest.getTaskConfirm().getTaskId(),
|
|
||||||
confirmTaskRequest.getTaskConfirm().getGoodsId(),
|
|
||||||
confirmTaskRequest.getTaskConfirm().getTotalNeed(),
|
|
||||||
confirmTaskRequest.getTaskConfirm().getRealPickQty(),
|
|
||||||
thisOut.getUnit(),
|
|
||||||
confirmTaskRequest.getTaskConfirm().getContainerNo(),
|
|
||||||
thisOut.getSecondPickingCode(),
|
|
||||||
thisOut.getOrderNo()
|
|
||||||
));
|
|
||||||
appOutsCheckService.saveBatch(outsChecks);
|
|
||||||
// 当前站台到达的拣选任务
|
// 当前站台到达的拣选任务
|
||||||
TAppPickTask thisPickTask = pickTaskList.getFirst();
|
TAppPickTask thisPickTask = pickTaskList.getFirst();
|
||||||
|
SendWarehouseOutCompletedRequest requestForCompleted = new SendWarehouseOutCompletedRequest();
|
||||||
|
|
||||||
if (confirmTaskRequest.getTaskConfirm() != null && StringUtils.isNotEmpty(confirmTaskRequest.getTaskConfirm().getTaskId())) {
|
if (confirmTaskRequest.getTaskConfirm() != null && StringUtils.isNotEmpty(confirmTaskRequest.getTaskConfirm().getTaskId())) {
|
||||||
// 更新工作信息
|
// 更新工作信息
|
||||||
String updateTaskResult = updateTaskInfo(confirmTaskRequest);
|
String updateTaskResult = updateTaskInfo(confirmTaskRequest, requestForCompleted);
|
||||||
if (StringUtils.isNotEmpty(updateTaskResult)) {
|
if (StringUtils.isNotEmpty(updateTaskResult)) {
|
||||||
return BaseWmsApiResponse.error("更新任务信息失败:" + updateTaskResult + ",请重试。");
|
return BaseWmsApiResponse.error("更新任务信息失败:" + updateTaskResult + ",请重试。");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 更新库存信息
|
// 更新库存信息
|
||||||
stockDataService.updateStockInfo(confirmTaskRequest.getStockConfirm(), confirmTaskRequest.getStandId(), confirmTaskRequest.getUserName(), "出库拣选", null);
|
stockDataService.updateStockInfo(confirmTaskRequest.getStockConfirm(), confirmTaskRequest.getStandId(), confirmTaskRequest.getUserName(), "出库拣选", null);
|
||||||
// 查询库存获得当前载具中存储的库存列表
|
|
||||||
// LambdaQueryWrapper<TAppStock> stockQueryWrapper = new LambdaQueryWrapper<TAppStock>()
|
|
||||||
// .eq(TAppStock::getVehicleId, thisPickTask.getVehicleId())
|
|
||||||
// .gt(TAppStock::getRealNum, 0);
|
|
||||||
// List<TAppStock> stockList = appStockService.list(stockQueryWrapper);
|
|
||||||
// 界面直接点击确认/放行
|
|
||||||
// if (stockList.isEmpty()) {
|
|
||||||
// conveyTaskService.cancelOtherStandPickTasks(thisPickTask.getVehicleId(), thisPickTask.getPickStand());
|
|
||||||
// 判断还有没有当前站台的其他拣选任务
|
|
||||||
// TaskConfirmVo taskConfirmVo = conveyTaskService.getCurrentStandTask(thisPickTask);
|
|
||||||
// if (taskConfirmVo != null) {
|
|
||||||
// return BaseWmsApiResponse.warn("当前载具还有其他拣选任务,请根据界面信息进行拣配。");
|
|
||||||
// }
|
|
||||||
// WorkConfirmVo resultVo = conveyTaskService.getCurrentStandWork(thisPickTask);
|
|
||||||
// if (resultVo != null) {
|
|
||||||
// return BaseWmsApiResponse.warn("当前载具还有工作,请切换到拣配界面进行拣配。");
|
|
||||||
// }
|
|
||||||
// 判断当前载具是否还有盘点任务
|
|
||||||
// List<String> goodsIds = stockList.stream().map(TAppStock::getGoodsId).distinct().toList();
|
|
||||||
// List<TAppInventory> inventoryTasks = appInventoryService.list(new LambdaQueryWrapper<TAppInventory>()
|
|
||||||
// .eq(TAppInventory::getVehicleId, thisPickTask.getVehicleId())
|
|
||||||
// .in(TAppInventory::getGoodsId, goodsIds));
|
|
||||||
// if (inventoryTasks != null && !inventoryTasks.isEmpty()) {
|
|
||||||
// return BaseWmsApiResponse.warn("当前载具还有盘点任务,请切换到盘点界面进行拣配。");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// else {
|
|
||||||
// // 取消后续拣选任务
|
|
||||||
// conveyTaskService.cancelOtherStandPickTasks(thisPickTask.getVehicleId(), thisPickTask.getPickStand());
|
|
||||||
// }
|
|
||||||
// 放行
|
|
||||||
if (conveyTaskService.releaseStandVehicle(thisPickTask)) {
|
if (conveyTaskService.releaseStandVehicle(thisPickTask)) {
|
||||||
if (appPickTaskService.exists(new LambdaQueryWrapper<TAppPickTask>()
|
if (requestForCompleted.getPickingDetail() != null && !requestForCompleted.getPickingDetail().isEmpty()){
|
||||||
.eq(TAppPickTask::getVehicleId, thisPickTask.getVehicleId())
|
//1. 回告EWM系统出库完成
|
||||||
.eq(TAppPickTask::getPickStatus, WmsPickTaskStatusEnum.ARRIVE.getCode())
|
EwmApiBackResponse ewmApiBackResponse = ewmApiService.sendWarehouseOutCompleted(requestForCompleted);
|
||||||
)){
|
if (Objects.equals(ewmApiBackResponse.getState(), "successfully")) {
|
||||||
return BaseWmsApiResponse.success("继续拣选");
|
log.info("调用回告EWM系统出库完成成功,请求参数: {}", requestForCompleted);
|
||||||
|
// 重试机制处理remove操作,防止死锁
|
||||||
|
int maxRetries = 3;
|
||||||
|
int retryCount = 0;
|
||||||
|
while (retryCount < maxRetries) {
|
||||||
|
try {
|
||||||
|
for (SendWarehouseOutCompletedRequest.PickingDetail deleteCheck : requestForCompleted.getPickingDetail()){
|
||||||
|
appOutsCheckService.remove(new LambdaQueryWrapper<TAppOutsCheck>()
|
||||||
|
.eq(TAppOutsCheck::getTaskNo, deleteCheck.getTaskNo()));
|
||||||
|
}
|
||||||
|
break; // 成功则跳出循环
|
||||||
|
} catch (Exception e) {
|
||||||
|
retryCount++;
|
||||||
|
log.warn("删除TAppOutsCheck记录失败,第{}次重试,错误: {}", retryCount, e.getMessage());
|
||||||
|
if (retryCount >= maxRetries) {
|
||||||
|
log.error("删除TAppOutsCheck记录最终失败,已重试{}次", maxRetries, e);
|
||||||
|
// 可以选择是否抛出异常或记录到错误表中
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
Thread.sleep(100L * retryCount); // 简单的退避策略
|
||||||
|
} catch (InterruptedException ie) {
|
||||||
|
Thread.currentThread().interrupt();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
log.error("调用回告EWM系统出库完成接口异常,请求参数: {}", requestForCompleted);
|
||||||
|
return BaseWmsApiResponse.error("调用回告EWM系统出库完成接口异常: " + ewmResponse.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// // 回告EWm系统出库完成
|
|
||||||
// SendWarehouseOutCompletedRequest request = new SendWarehouseOutCompletedRequest();
|
|
||||||
// List<SendWarehouseOutCompletedRequest.PickingDetail> pickingDetails = new ArrayList<>();
|
|
||||||
// SendWarehouseOutCompletedRequest.PickingDetail pickingDetail = new SendWarehouseOutCompletedRequest.PickingDetail();
|
|
||||||
// pickingDetail.setTaskNo(confirmTaskRequest.getTaskConfirm().getTaskId());
|
|
||||||
// pickingDetail.setMatNo(confirmTaskRequest.getTaskConfirm().getGoodsId());
|
|
||||||
// pickingDetail.setPickingQty(Double.valueOf(confirmTaskRequest.getTaskConfirm().getTotalNeed()));
|
|
||||||
// pickingDetail.setActQty(Double.valueOf(confirmTaskRequest.getTaskConfirm().getRealPickQty()));
|
|
||||||
// pickingDetail.setUnit(thisOut.getUnit());
|
|
||||||
// pickingDetail.setContainerNo(confirmTaskRequest.getTaskConfirm().getContainerNo());
|
|
||||||
// pickingDetails.add(pickingDetail);
|
|
||||||
// request.setPickingDetail(pickingDetails);
|
|
||||||
// request.setWaveNo(thisOut.getWaveNo());
|
|
||||||
// request.setPickingType(thisOut.getPickingType());
|
|
||||||
//
|
|
||||||
// EwmApiBackResponse ewmApiBackResponse = ewmApiService.sendWarehouseOutCompleted(request);
|
|
||||||
// if (Objects.equals(ewmApiBackResponse.getState(), "successfully")) {
|
|
||||||
// log.info("调用EWM系统接口成功,请求参数: {}", request);
|
|
||||||
//
|
|
||||||
// }else {
|
|
||||||
// log.error("调用EWM系统接口异常,请求参数: {}", request);
|
|
||||||
// //return BaseWmsApiResponse.error("调用EWM系统接口异常: " + ewmApiBackResponse.getMessage());
|
|
||||||
// }
|
|
||||||
return BaseWmsApiResponse.success("确认成功。");
|
|
||||||
} else {
|
} else {
|
||||||
// 回滚事务
|
// 回滚事务
|
||||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
return BaseWmsApiResponse.error("释放箱子失败。");
|
return BaseWmsApiResponse.error("释放箱子失败。");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//2. 回告EWM容器置空
|
||||||
|
// 查询对应的库存信息
|
||||||
|
List<TAppStock> stockLists = appStockService.list(new LambdaQueryWrapper<TAppStock>()
|
||||||
|
.eq(TAppStock::getVehicleId, confirmTaskRequest.getStockConfirm().getVehicleId())
|
||||||
|
);
|
||||||
|
if (stockLists == null || stockLists.isEmpty()){
|
||||||
|
// 回告EWM系统
|
||||||
|
SendEwmVehicleForInRequest requestForEmptyVehicle = new SendEwmVehicleForInRequest();
|
||||||
|
request.setContainerNo(confirmTaskRequest.getStockConfirm().getVehicleId());
|
||||||
|
EwmApiBackResponse ewmApiBackResponseByEmpty = ewmApiService.sendContainerEmpty(requestForEmptyVehicle);
|
||||||
|
if (!Objects.equals(ewmApiBackResponseByEmpty.getState(), "successful")) {
|
||||||
|
log.error("容器置空调用EWM系统接口异常,请求参数: {}", request);
|
||||||
|
}else {
|
||||||
|
log.info("容器置空调用EWM系统接口成功,请求参数: {}", request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (appPickTaskService.exists(new LambdaQueryWrapper<TAppPickTask>()
|
||||||
|
.eq(TAppPickTask::getVehicleId, thisPickTask.getVehicleId())
|
||||||
|
.eq(TAppPickTask::getPickStatus, WmsPickTaskStatusEnum.ARRIVE.getCode())
|
||||||
|
)){
|
||||||
|
return BaseWmsApiResponse.success("继续拣选");
|
||||||
|
}
|
||||||
|
return BaseWmsApiResponse.success("确认成功。");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -2100,7 +2223,7 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
*
|
*
|
||||||
* @param confirmTaskRequest 确认信息
|
* @param confirmTaskRequest 确认信息
|
||||||
*/
|
*/
|
||||||
private String updateTaskInfo(ConfirmTaskRequest confirmTaskRequest) {
|
private String updateTaskInfo(ConfirmTaskRequest confirmTaskRequest,SendWarehouseOutCompletedRequest requestForCompleted) {
|
||||||
if (confirmTaskRequest == null) {
|
if (confirmTaskRequest == null) {
|
||||||
return "请求参数为空";
|
return "请求参数为空";
|
||||||
}
|
}
|
||||||
|
|
@ -2109,104 +2232,104 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
return "请求参数不全";
|
return "请求参数不全";
|
||||||
}
|
}
|
||||||
// 查询对应的任务
|
// 查询对应的任务
|
||||||
TAppOuts outs = appOutsService.getOne(new LambdaQueryWrapper<TAppOuts>()
|
List<TAppOuts> thisOut = new ArrayList<>();
|
||||||
.eq(TAppOuts::getTaskId, taskConfirm.getTaskId()));
|
if (confirmTaskRequest.getTaskConfirm().getIsEmpty() == 0){
|
||||||
if (outs == null || taskConfirm.getRealPickQty() == null) {
|
thisOut = appOutsService.list(new LambdaQueryWrapper<TAppOuts>()
|
||||||
|
.eq(TAppOuts::getPickPlanId, confirmTaskRequest.getStockConfirm().getStockId())
|
||||||
|
.orderByDesc(TAppOuts::getPickPlanIdTimes)
|
||||||
|
);
|
||||||
|
} else if (confirmTaskRequest.getTaskConfirm().getIsEmpty() == 1) {
|
||||||
|
TAppOuts out = appOutsService.getOne(new LambdaQueryWrapper<TAppOuts>()
|
||||||
|
.eq(TAppOuts::getTaskId, confirmTaskRequest.getTaskConfirm().getTaskId()));
|
||||||
|
if (out != null){
|
||||||
|
thisOut.add(out);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
return "字段isEmpty获取失败,请重试";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (thisOut == null) {
|
||||||
return "未查到对应的任务或者实际拣选数量未填写";
|
return "未查到对应的任务或者实际拣选数量未填写";
|
||||||
}
|
}
|
||||||
outs.setPickNum(outs.getPickNum() + taskConfirm.getRealPickQty());
|
|
||||||
outs.setUserName(confirmTaskRequest.getUserName());
|
|
||||||
if (outs.getPickNum() >= outs.getNeedNum()) {
|
|
||||||
// 读取所有wave_no的outs_check表的数据,全部反馈给EWM
|
|
||||||
List<TAppOutsCheck> checkList = appOutsCheckService.list(new LambdaQueryWrapper<TAppOutsCheck>()
|
|
||||||
.eq(TAppOutsCheck::getTaskNo, taskConfirm.getTaskId()));
|
|
||||||
|
|
||||||
// 回告EWm系统出库完成
|
if (thisOut.size() != confirmTaskRequest.getTaskConfirm().getTotalQty()){
|
||||||
SendWarehouseOutCompletedRequest request = new SendWarehouseOutCompletedRequest();
|
return "EWM下发新需求,请刷新后重新合并!";
|
||||||
List<SendWarehouseOutCompletedRequest.PickingDetail> pickingDetails = new ArrayList<>();
|
}
|
||||||
for (TAppOutsCheck check : checkList){
|
List<SendWarehouseOutCompletedRequest.PickingDetail> pickingDetails = new ArrayList<>();
|
||||||
SendWarehouseOutCompletedRequest.PickingDetail pickingDetail = new SendWarehouseOutCompletedRequest.PickingDetail();
|
for (TAppOuts outs : thisOut){
|
||||||
pickingDetail.setTaskNo(check.getTaskNo());
|
int startPickNum = outs.getPickNum();
|
||||||
pickingDetail.setMatNo(check.getMatNo());
|
if (taskConfirm.getRealPickQty() >= (outs.getDistributeNum() - outs.getPickNum())){
|
||||||
pickingDetail.setPickingQty(Double.valueOf(check.getPickingQty()));
|
taskConfirm.setRealPickQty(taskConfirm.getRealPickQty() - outs.getDistributeNum() + outs.getPickNum());
|
||||||
pickingDetail.setActQty(Double.valueOf(check.getActQty()));
|
outs.setPickNum(outs.getDistributeNum() - outs.getPickNum());
|
||||||
pickingDetail.setUnit(check.getUnit());
|
|
||||||
pickingDetail.setContainerNo(check.getContainerNo());
|
|
||||||
pickingDetails.add(pickingDetail);
|
|
||||||
}
|
|
||||||
request.setPickingDetail(pickingDetails);
|
|
||||||
request.setWaveNo(outs.getWaveNo());
|
|
||||||
request.setPickingType(outs.getPickingType());
|
|
||||||
EwmApiBackResponse ewmApiBackResponse = ewmApiService.sendWarehouseOutCompleted(request);
|
|
||||||
if (Objects.equals(ewmApiBackResponse.getState(), "successfully")) {
|
|
||||||
log.info("调用EWM系统接口成功,请求参数: {}", request);
|
|
||||||
appOutsCheckService.remove(new LambdaQueryWrapper<TAppOutsCheck>()
|
|
||||||
.eq(TAppOutsCheck::getTaskNo, taskConfirm.getTaskId())
|
|
||||||
);
|
|
||||||
}else {
|
}else {
|
||||||
log.error("调用EWM系统接口异常,请求参数: {}", request);
|
outs.setPickNum(taskConfirm.getRealPickQty());
|
||||||
// 触发事务回滚
|
|
||||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
||||||
// 返回错误信息
|
|
||||||
return ewmApiBackResponse.toString();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
//outs.setPickNum(outs.getPickNum() + taskConfirm.getRealPickQty());
|
||||||
|
outs.setUserName(confirmTaskRequest.getUserName());
|
||||||
|
|
||||||
// 生成记录
|
// 将出库完成需要反馈的信息插入outsCheck表中
|
||||||
TAppOutsRecord record = new TAppOutsRecord(
|
List<TAppOutsCheck> outsChecks = new ArrayList<>();
|
||||||
|
|
||||||
|
outsChecks.add(new TAppOutsCheck(
|
||||||
|
UUIDUtils.getNewUUID("CHECK_"),
|
||||||
|
outs.getWaveNo(),
|
||||||
outs.getTaskId(),
|
outs.getTaskId(),
|
||||||
outs.getGoodsId(),
|
outs.getGoodsId(),
|
||||||
outs.getVehicleId(),
|
|
||||||
outs.getNeedNum(),
|
outs.getNeedNum(),
|
||||||
outs.getDistributeNum(),
|
|
||||||
outs.getPickNum(),
|
outs.getPickNum(),
|
||||||
outs.getOutType(),
|
outs.getUnit(),
|
||||||
outs.getDestination(),
|
confirmTaskRequest.getTaskConfirm().getContainerNo(),
|
||||||
outs.getUserName(),
|
outs.getSecondPickingCode(),
|
||||||
outs.getReason(),
|
outs.getOrderNo()
|
||||||
outs.getRequestTime(),
|
));
|
||||||
outs.getWorkOrder()
|
|
||||||
);
|
appOutsCheckService.saveBatch(outsChecks);
|
||||||
// 删除出库单
|
outs.setPickNum(outs.getPickNum() + startPickNum);
|
||||||
appOutsService.removeById(outs.getTaskId());
|
|
||||||
// 添加记录
|
if (outs.getPickNum() >= outs.getNeedNum()) {
|
||||||
appOutsRecordService.save(record);
|
// 读取所有wave_no的outs_check表的数据,全部反馈给EWM
|
||||||
} else {
|
List<TAppOutsCheck> checkList = appOutsCheckService.list(new LambdaQueryWrapper<TAppOutsCheck>()
|
||||||
// 更新出库单
|
.eq(TAppOutsCheck::getTaskNo, outs.getTaskId()));
|
||||||
appOutsService.updateById(outs);
|
|
||||||
|
for (TAppOutsCheck check : checkList){
|
||||||
|
SendWarehouseOutCompletedRequest.PickingDetail pickingDetail = new SendWarehouseOutCompletedRequest.PickingDetail();
|
||||||
|
pickingDetail.setTaskNo(check.getTaskNo());
|
||||||
|
pickingDetail.setMatNo(check.getMatNo());
|
||||||
|
pickingDetail.setPickingQty(Double.valueOf(check.getPickingQty()));
|
||||||
|
pickingDetail.setActQty(Double.valueOf(check.getActQty()));
|
||||||
|
pickingDetail.setUnit(check.getUnit());
|
||||||
|
pickingDetail.setContainerNo(check.getContainerNo());
|
||||||
|
pickingDetails.add(pickingDetail);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 生成记录
|
||||||
|
TAppOutsRecord record = new TAppOutsRecord(
|
||||||
|
outs.getTaskId(),
|
||||||
|
outs.getGoodsId(),
|
||||||
|
outs.getVehicleId(),
|
||||||
|
outs.getNeedNum(),
|
||||||
|
outs.getDistributeNum(),
|
||||||
|
outs.getPickNum(),
|
||||||
|
outs.getOutType(),
|
||||||
|
outs.getDestination(),
|
||||||
|
outs.getUserName(),
|
||||||
|
outs.getReason(),
|
||||||
|
outs.getRequestTime(),
|
||||||
|
outs.getWorkOrder()
|
||||||
|
);
|
||||||
|
// 删除出库单
|
||||||
|
appOutsService.removeById(outs.getTaskId());
|
||||||
|
// 添加记录
|
||||||
|
appOutsRecordService.save(record);
|
||||||
|
} else {
|
||||||
|
// 更新出库单
|
||||||
|
appOutsService.updateById(outs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 判断是否是紧急出库且是缺料
|
requestForCompleted.setPickingDetail(pickingDetails);
|
||||||
// if (Objects.equals(outs.getOutType(), WmsOutTypeEnums.EMERGE.getCode())
|
requestForCompleted.setWaveNo(thisOut.getFirst().getWaveNo());
|
||||||
// && outs.getReason().contains(EmergencyOutReasonEnums.GOODS_LACK.getReason()) && StringUtils.isNotEmpty(outs.getWorkOrder())) {
|
requestForCompleted.setPickingType(thisOut.getFirst().getPickingType());
|
||||||
// // 查询此工单下缺料的工作
|
|
||||||
// List<TAppWork> lackGoodsWorks = appWorkService.list(new LambdaQueryWrapper<TAppWork>()
|
|
||||||
// .eq(TAppWork::getWorkOrder, outs.getWorkOrder())
|
|
||||||
// .eq(TAppWork::getWorkStatus, 2)
|
|
||||||
// .eq(TAppWork::getLackStatus, 1));
|
|
||||||
// int canDistributeNum = taskConfirm.getRealPickQty();
|
|
||||||
// List<TAppWork> needUpdateWorks = new ArrayList<>();
|
|
||||||
// for (TAppWork lackGoodsWork : lackGoodsWorks) {
|
|
||||||
// if (canDistributeNum == 0) {
|
|
||||||
// // 本次拣选数量不够分了
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// if (lackGoodsWork.getFinishNum() >= lackGoodsWork.getNeedNum()) {
|
|
||||||
// continue;
|
|
||||||
// }
|
|
||||||
// int remainNeedNum = lackGoodsWork.getNeedNum() - lackGoodsWork.getFinishNum();
|
|
||||||
// // 这里需要重新设置完成数量。
|
|
||||||
// if (remainNeedNum >= canDistributeNum) {
|
|
||||||
// canDistributeNum = 0;
|
|
||||||
// lackGoodsWork.setFinishNum(lackGoodsWork.getFinishNum() + canDistributeNum);
|
|
||||||
// } else {
|
|
||||||
// canDistributeNum -= remainNeedNum;
|
|
||||||
// lackGoodsWork.setFinishNum(lackGoodsWork.getNeedNum());
|
|
||||||
// lackGoodsWork.setLackStatus(0);
|
|
||||||
// }
|
|
||||||
// needUpdateWorks.add(lackGoodsWork);
|
|
||||||
// }
|
|
||||||
// appWorkService.updateBatchById(needUpdateWorks);
|
|
||||||
// }
|
|
||||||
// 清除拣选计划
|
// 清除拣选计划
|
||||||
LambdaQueryWrapper<TAppPickPlan> pickPlanQueryWrapper = new LambdaQueryWrapper<TAppPickPlan>()
|
LambdaQueryWrapper<TAppPickPlan> pickPlanQueryWrapper = new LambdaQueryWrapper<TAppPickPlan>()
|
||||||
.eq(TAppPickPlan::getWorkIndex, confirmTaskRequest.getTaskConfirm().getTaskId());
|
.eq(TAppPickPlan::getWorkIndex, confirmTaskRequest.getTaskConfirm().getTaskId());
|
||||||
|
|
|
||||||
|
|
@ -155,9 +155,10 @@ public class TaskQueryControllerServiceImpl implements ITaskQueryControllerServi
|
||||||
// 查询未关闭
|
// 查询未关闭
|
||||||
Page<TAppOuts> page = outsQuery.toMpPage();
|
Page<TAppOuts> page = outsQuery.toMpPage();
|
||||||
LambdaQueryWrapper<TAppOuts> lambdaQueryWrapper = new LambdaQueryWrapper<TAppOuts>()
|
LambdaQueryWrapper<TAppOuts> lambdaQueryWrapper = new LambdaQueryWrapper<TAppOuts>()
|
||||||
.like(StringUtils.isNotEmpty(outsQuery.getTaskId()), TAppOuts::getTaskId, outsQuery.getTaskId())
|
.ge(outsQuery.getPickingDate() != null, TAppOuts::getPickingDate, outsQuery.getPickingDate()) // 大于等于
|
||||||
|
.le(outsQuery.getPickingDate() != null, TAppOuts::getPickingDate, outsQuery.getPickingDate()) // 小于等于
|
||||||
.like(StringUtils.isNotEmpty(outsQuery.getGoodsId()), TAppOuts::getGoodsId, outsQuery.getGoodsId())
|
.like(StringUtils.isNotEmpty(outsQuery.getGoodsId()), TAppOuts::getGoodsId, outsQuery.getGoodsId())
|
||||||
.like(StringUtils.isNotEmpty(outsQuery.getVehicleId()), TAppOuts::getVehicleId, outsQuery.getVehicleId())
|
.like(StringUtils.isNotEmpty(outsQuery.getWorkOrder()), TAppOuts::getWorkOrder, outsQuery.getWorkOrder())
|
||||||
.eq(outsQuery.getOutType() != null, TAppOuts::getOutType, outsQuery.getOutType());
|
.eq(outsQuery.getOutType() != null, TAppOuts::getOutType, outsQuery.getOutType());
|
||||||
Page<TAppOuts> outsPage = appOutsService.page(page, lambdaQueryWrapper);
|
Page<TAppOuts> outsPage = appOutsService.page(page, lambdaQueryWrapper);
|
||||||
|
|
||||||
|
|
@ -179,6 +180,48 @@ public class TaskQueryControllerServiceImpl implements ITaskQueryControllerServi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过任务ID更新任务优先级
|
||||||
|
* @param outsVo 包含任务ID和新优先级的参数
|
||||||
|
* @return 更新结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public WmsApiResponse<String> upOutsType(OutsVo outsVo) {
|
||||||
|
// 1. 参数校验
|
||||||
|
if (outsVo == null || StringUtils.isEmpty(outsVo.getTaskId())) {
|
||||||
|
return WmsApiResponse.error("任务ID不能为空", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 查询原任务
|
||||||
|
TAppOuts existingOuts = appOutsService.getOne(new LambdaQueryWrapper<TAppOuts>()
|
||||||
|
.eq(TAppOuts::getTaskId, outsVo.getTaskId()));
|
||||||
|
|
||||||
|
if (existingOuts == null) {
|
||||||
|
return WmsApiResponse.error("未找到对应的任务", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (existingOuts.getDistributeNum() > 0) {
|
||||||
|
return WmsApiResponse.error("任务已经开始执行!", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (existingOuts.getOutType() == 1){
|
||||||
|
return WmsApiResponse.error("空箱出库无需提高优先级", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 更新优先级字段(假设outsVo中的outType代表优先级)
|
||||||
|
existingOuts.setOutType(existingOuts.getOutType() + 1);
|
||||||
|
|
||||||
|
// 4. 执行更新操作
|
||||||
|
boolean updateSuccess = appOutsService.updateById(existingOuts);
|
||||||
|
|
||||||
|
if (updateSuccess) {
|
||||||
|
return WmsApiResponse.success("任务优先级更新成功", null);
|
||||||
|
} else {
|
||||||
|
return WmsApiResponse.error("任务优先级更新失败", null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询盘点相关信息---实现
|
* 分页查询盘点相关信息---实现
|
||||||
* @param inventoryQuery 查询参数
|
* @param inventoryQuery 查询参数
|
||||||
|
|
@ -213,4 +256,68 @@ public class TaskQueryControllerServiceImpl implements ITaskQueryControllerServi
|
||||||
return WmsApiResponse.success("查询盘点记录成功。", pageVo);
|
return WmsApiResponse.success("查询盘点记录成功。", pageVo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WmsApiResponse<String> editDate(OutsVo outsVo) {
|
||||||
|
// 1. 参数校验
|
||||||
|
if (outsVo == null || StringUtils.isEmpty(outsVo.getTaskId())) {
|
||||||
|
return WmsApiResponse.error("任务ID不能为空", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (outsVo.getPickingDate() == null){
|
||||||
|
return WmsApiResponse.error("请选择执行时间", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 查询原任务
|
||||||
|
TAppOuts existingOuts = appOutsService.getOne(new LambdaQueryWrapper<TAppOuts>()
|
||||||
|
.eq(TAppOuts::getTaskId, outsVo.getTaskId()));
|
||||||
|
|
||||||
|
if (existingOuts == null) {
|
||||||
|
return WmsApiResponse.error("未找到对应的任务", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (existingOuts.getDistributeNum() > 0) {
|
||||||
|
return WmsApiResponse.error("任务已经开始执行!", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (existingOuts.getPickingDate() == outsVo.getPickingDate()){
|
||||||
|
return WmsApiResponse.error("请勿重复修改", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 更新优先级字段(假设outsVo中的outType代表优先级)
|
||||||
|
existingOuts.setPickingDate(outsVo.getPickingDate());
|
||||||
|
|
||||||
|
// 4. 执行更新操作
|
||||||
|
boolean updateSuccess = appOutsService.updateById(existingOuts);
|
||||||
|
|
||||||
|
if (updateSuccess) {
|
||||||
|
return WmsApiResponse.success("执行时间更新成功", null);
|
||||||
|
} else {
|
||||||
|
return WmsApiResponse.error("执行时间更新失败", null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WmsApiResponse<String> updateOutsInfo(TAppPickTask appTask) {
|
||||||
|
if (appTask == null || StringUtils.isEmpty(appTask.getPickId())) {
|
||||||
|
return WmsApiResponse.error("缺少ID号。", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
TAppPickTask pickTask = appPickTaskService.getOne(new LambdaQueryWrapper<TAppPickTask>()
|
||||||
|
.eq(TAppPickTask::getPickId, appTask.getPickId()));
|
||||||
|
|
||||||
|
if (pickTask == null){
|
||||||
|
return WmsApiResponse.error("未找到对应的任务", null);
|
||||||
|
}
|
||||||
|
// 设置需要更新的字段,这里可以根据实际业务需求设置
|
||||||
|
pickTask.setPickStatus(appTask.getPickStatus());
|
||||||
|
|
||||||
|
|
||||||
|
if (appPickTaskService.updateById(pickTask)) {
|
||||||
|
return WmsApiResponse.success("更新出库单信息成功。", null);
|
||||||
|
} else {
|
||||||
|
return WmsApiResponse.error("更新出库单信息失败。", null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,225 @@
|
||||||
package com.wms_main.service.controller.serviceImpl;
|
package com.wms_main.service.controller.serviceImpl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.wms_main.constant.AppConstant;
|
||||||
|
import com.wms_main.dao.ITSysUserService;
|
||||||
|
import com.wms_main.model.dto.query.UserQuery;
|
||||||
|
import com.wms_main.model.dto.query.UserUpdateRequest;
|
||||||
|
import com.wms_main.model.dto.response.wms.BaseWmsApiResponse;
|
||||||
|
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||||
|
import com.wms_main.model.po.TSysRole;
|
||||||
|
import com.wms_main.model.po.TSysUser;
|
||||||
|
import com.wms_main.model.vo.wms.PageVo;
|
||||||
|
import com.wms_main.model.vo.wms.UserVo;
|
||||||
|
import com.wms_main.repository.utils.StringUtils;
|
||||||
import com.wms_main.service.controller.IUserControllerService;
|
import com.wms_main.service.controller.IUserControllerService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class UserControllerServiceImpl implements IUserControllerService {
|
public class UserControllerServiceImpl implements IUserControllerService {
|
||||||
|
private final ITSysUserService sysUserService;// 用户服务
|
||||||
|
@Override
|
||||||
|
public WmsApiResponse<PageVo<UserVo>> getUserList(UserQuery userQuery) {
|
||||||
|
// 参数校验(可选)
|
||||||
|
if (userQuery == null) {
|
||||||
|
return WmsApiResponse.error("查询参数不能为空", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 直接执行用户分页查询,不考虑角色过滤
|
||||||
|
Page<TSysUser> page = userQuery.toMpPage();
|
||||||
|
|
||||||
|
LambdaQueryWrapper<TSysUser> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
// 根据roleId进行条件过滤
|
||||||
|
if ("0".equals(userQuery.getRoleId())) {
|
||||||
|
// roleId为0时显示所有用户,不添加过滤条件
|
||||||
|
queryWrapper.orderByAsc(TSysUser::getRoleId);
|
||||||
|
} else if ("2".equals(userQuery.getRoleId())) {
|
||||||
|
// roleId为2时只显示该角色的用户
|
||||||
|
queryWrapper.eq(TSysUser::getUserName, userQuery.getUserName());
|
||||||
|
} else {
|
||||||
|
// 其他情况也显示所有用户(可根据需求调整)
|
||||||
|
queryWrapper.orderByAsc(TSysUser::getRoleId);
|
||||||
|
}
|
||||||
|
Page<TSysUser> usersPage = sysUserService.page(page, queryWrapper);
|
||||||
|
|
||||||
|
if (usersPage == null) {
|
||||||
|
return WmsApiResponse.error("获取用户列表发生异常", null);
|
||||||
|
}
|
||||||
|
// 返回结果
|
||||||
|
return WmsApiResponse.success("获取用户列表成功", PageVo.of(usersPage, UserVo::ofPo));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加用户信息---实现
|
||||||
|
*
|
||||||
|
* @param userUpdateRequest 新增用户信息请求
|
||||||
|
* @return 添加结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public BaseWmsApiResponse addUserInfo(UserUpdateRequest userUpdateRequest) {
|
||||||
|
// 参数校验
|
||||||
|
if (userUpdateRequest == null ||
|
||||||
|
StringUtils.isEmpty(userUpdateRequest.getLoginAccountUpdate()) ||
|
||||||
|
StringUtils.isEmpty(userUpdateRequest.getLoginPasswordUpdate())) {
|
||||||
|
return BaseWmsApiResponse.error("请求参数不完整,必须包含登录账号和密码。");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Objects.equals(userUpdateRequest.getRoleIdOp(), "0")){
|
||||||
|
return BaseWmsApiResponse.error("您没有权限添加用户。");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询用户是否已存在
|
||||||
|
boolean ifExist = sysUserService.exists(new LambdaQueryWrapper<TSysUser>()
|
||||||
|
.eq(TSysUser::getLoginAccount, userUpdateRequest.getLoginAccountUpdate()));
|
||||||
|
|
||||||
|
if (ifExist) {
|
||||||
|
return BaseWmsApiResponse.error("用户已存在,请勿重复添加。");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查用户名是否已存在
|
||||||
|
boolean userNameExists = sysUserService.exists(new LambdaQueryWrapper<TSysUser>()
|
||||||
|
.eq(TSysUser::getUserName, userUpdateRequest.getUserNameUpdate()));
|
||||||
|
|
||||||
|
if (userNameExists) {
|
||||||
|
return BaseWmsApiResponse.error("用户名已存在,请使用其他用户名。");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加新用户
|
||||||
|
TSysUser newUser = new TSysUser();
|
||||||
|
newUser.setLoginAccount(userUpdateRequest.getLoginAccountUpdate());
|
||||||
|
newUser.setLoginPassword(StringUtils.encryptPassword(userUpdateRequest.getLoginPasswordUpdate()));
|
||||||
|
newUser.setUserName(userUpdateRequest.getUserNameUpdate());
|
||||||
|
newUser.setRoleId("2");
|
||||||
|
newUser.setAddUser(userUpdateRequest.getUserName());
|
||||||
|
newUser.setAddTime(LocalDateTime.now());
|
||||||
|
|
||||||
|
boolean addResult = sysUserService.save(newUser);
|
||||||
|
|
||||||
|
return addResult ? BaseWmsApiResponse.success("添加用户信息成功") : BaseWmsApiResponse.error("添加用户信息失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除用户信息---实现
|
||||||
|
*
|
||||||
|
* @param userUpdateRequest 删除用户信息请求
|
||||||
|
* @return 删除结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public BaseWmsApiResponse deleteUserInfo(UserUpdateRequest userUpdateRequest) {
|
||||||
|
if (userUpdateRequest == null || StringUtils.isEmpty(userUpdateRequest.getRoleIdOp())) {
|
||||||
|
return BaseWmsApiResponse.error("请求以及操作人员的角色必须输入。");
|
||||||
|
}
|
||||||
|
// 查询被更新人员的角色
|
||||||
|
TSysUser needDeleteUser = sysUserService.getById(userUpdateRequest.getLoginAccountUpdate());
|
||||||
|
if (needDeleteUser == null) {
|
||||||
|
return BaseWmsApiResponse.error("无法删除查询不到的用户。");
|
||||||
|
}
|
||||||
|
if (!Objects.equals(userUpdateRequest.getRoleIdOp(), "0")) {
|
||||||
|
return BaseWmsApiResponse.error("您没有权限删除用户。");
|
||||||
|
}
|
||||||
|
// 删除对应用户
|
||||||
|
boolean deleteResult = sysUserService.removeById(userUpdateRequest.getLoginAccountUpdate());
|
||||||
|
return deleteResult ? BaseWmsApiResponse.success("删除用户成功。") : BaseWmsApiResponse.error("删除用户失败。");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户密码---实现
|
||||||
|
*
|
||||||
|
* @param userUpdateRequest 密码修改参数
|
||||||
|
* @return 修改结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public BaseWmsApiResponse changePassword(UserUpdateRequest userUpdateRequest) {
|
||||||
|
// 参数校验
|
||||||
|
if (userUpdateRequest == null ||
|
||||||
|
StringUtils.isEmpty(userUpdateRequest.getLoginAccountUpdate()) ||
|
||||||
|
StringUtils.isEmpty(userUpdateRequest.getOldPassword()) ||
|
||||||
|
StringUtils.isEmpty(userUpdateRequest.getNewPassword())) {
|
||||||
|
return BaseWmsApiResponse.error("请求参数不完整,必须包含账号、旧密码和新密码。");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询用户是否存在
|
||||||
|
TSysUser user = sysUserService.getOne(new LambdaQueryWrapper<TSysUser>()
|
||||||
|
.eq(TSysUser::getLoginAccount, userUpdateRequest.getLoginAccountUpdate()));
|
||||||
|
|
||||||
|
if (user == null) {
|
||||||
|
return BaseWmsApiResponse.error("用户不存在。");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证旧密码是否正确
|
||||||
|
if (!StringUtils.verifyPassword(userUpdateRequest.getOldPassword(), user.getLoginPassword())) {
|
||||||
|
return BaseWmsApiResponse.error("旧密码错误。");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新密码
|
||||||
|
user.setLoginPassword(StringUtils.encryptPassword(userUpdateRequest.getNewPassword()));
|
||||||
|
user.setLastUpdateTime(LocalDateTime.now());
|
||||||
|
user.setLastUpdateUser(userUpdateRequest.getUserName());
|
||||||
|
|
||||||
|
boolean updateResult = sysUserService.updateById(user);
|
||||||
|
|
||||||
|
return updateResult ? BaseWmsApiResponse.success("密码修改成功") : BaseWmsApiResponse.error("密码修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户信息---实现
|
||||||
|
*
|
||||||
|
* @param userUpdateRequest 修改用户信息请求
|
||||||
|
* @return 修改结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public BaseWmsApiResponse updateUserInfo(UserUpdateRequest userUpdateRequest) {
|
||||||
|
// 参数校验
|
||||||
|
if (userUpdateRequest == null ||
|
||||||
|
StringUtils.isEmpty(userUpdateRequest.getLoginAccountUpdate()) ||
|
||||||
|
StringUtils.isEmpty(userUpdateRequest.getUserNameUpdate())) {
|
||||||
|
return BaseWmsApiResponse.error("请求参数不完整,必须包含登录账号和用户名。");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询被更新人员
|
||||||
|
TSysUser needUpdateUser = sysUserService.getById(userUpdateRequest.getLoginAccountUpdate());
|
||||||
|
if (needUpdateUser == null) {
|
||||||
|
return BaseWmsApiResponse.error("无法找到该用户。");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查用户名是否已存在
|
||||||
|
boolean userNameExists = sysUserService.exists(new LambdaQueryWrapper<TSysUser>()
|
||||||
|
.eq(TSysUser::getUserName, userUpdateRequest.getUserNameUpdate()));
|
||||||
|
|
||||||
|
if (userNameExists) {
|
||||||
|
return BaseWmsApiResponse.error("用户名已存在,请使用其他用户名。");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新用户名
|
||||||
|
needUpdateUser.setUserName(userUpdateRequest.getUserNameUpdate());
|
||||||
|
needUpdateUser.setLastUpdateUser(userUpdateRequest.getUserName());
|
||||||
|
needUpdateUser.setLastUpdateTime(LocalDateTime.now());
|
||||||
|
|
||||||
|
boolean updateResult = sysUserService.updateById(needUpdateUser);
|
||||||
|
return updateResult ? BaseWmsApiResponse.success("修改用户信息成功") : BaseWmsApiResponse.error("修改用户信息失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,27 +27,17 @@ public class OutsExecutor implements Job {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void execute(JobExecutionContext jobExecutionContext) {
|
public void execute(JobExecutionContext jobExecutionContext) {
|
||||||
// 解析工作(配料)
|
|
||||||
// try {
|
|
||||||
// outsExecutorService.executeKateWorks();
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// log.error("解析工作(配料)失败{}", StringUtils.objectToString(e));
|
|
||||||
// }
|
|
||||||
// 处理出库单
|
|
||||||
|
|
||||||
// log.info("处理出库单开始");
|
|
||||||
|
|
||||||
|
|
||||||
try {
|
|
||||||
outsExecutorService.executeOuts();
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("处理出库单失败{}", StringUtils.objectToString(e));
|
|
||||||
}
|
|
||||||
// 处理盘点单
|
// 处理盘点单
|
||||||
try {
|
try {
|
||||||
outsExecutorService.executeInventory();
|
outsExecutorService.executeInventory();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("处理盘点单失败{}", StringUtils.objectToString(e));
|
log.error("处理盘点单失败{}", StringUtils.objectToString(e));
|
||||||
}
|
}
|
||||||
|
// 处理出库单
|
||||||
|
try {
|
||||||
|
outsExecutorService.executeOuts();
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("处理出库单失败{}", StringUtils.objectToString(e));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.wms_main.service.quartz_job.serviceImpl;
|
package com.wms_main.service.quartz_job.serviceImpl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
|
@ -8,6 +9,7 @@ import com.wms_main.constant.AppConstant;
|
||||||
import com.wms_main.constant.enums.wms.*;
|
import com.wms_main.constant.enums.wms.*;
|
||||||
import com.wms_main.dao.*;
|
import com.wms_main.dao.*;
|
||||||
import com.wms_main.model.po.*;
|
import com.wms_main.model.po.*;
|
||||||
|
import com.wms_main.repository.utils.DbTransUtils;
|
||||||
import com.wms_main.repository.utils.StringUtils;
|
import com.wms_main.repository.utils.StringUtils;
|
||||||
import com.wms_main.repository.utils.UUIDUtils;
|
import com.wms_main.repository.utils.UUIDUtils;
|
||||||
import com.wms_main.service.business.IStockDataService;
|
import com.wms_main.service.business.IStockDataService;
|
||||||
|
|
@ -43,94 +45,86 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
private final ITAppOutsRecordService appOutsRecordService;// 出库单记录服务
|
private final ITAppOutsRecordService appOutsRecordService;// 出库单记录服务
|
||||||
private final ITAppInventoryService appInventoryService;// 盘点任务服务
|
private final ITAppInventoryService appInventoryService;// 盘点任务服务
|
||||||
private final AppCommon appCommon;// 应用共通数据
|
private final AppCommon appCommon;// 应用共通数据
|
||||||
|
private final DbTransUtils dbTransUtils;// 数据库事务工具
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 解析出库单 实现
|
* 解析出库单 实现
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void executeOuts() {
|
public void executeOuts() {
|
||||||
try {
|
// 查询到对应的出库单
|
||||||
// 查询到对应的出库单
|
List<TAppOuts> appOutsList = appOutsService.list(
|
||||||
// List<TAppOuts> appOutsList = appOutsService.list(
|
new LambdaQueryWrapper<TAppOuts>()
|
||||||
// new LambdaQueryWrapper<TAppOuts>().orderByDesc(TAppOuts::getOutType)
|
.le(TAppOuts::getPickingDate, LocalDate.now())
|
||||||
// );
|
.orderByDesc(TAppOuts::getOutType)
|
||||||
// List<TAppOuts> appOutsList = appOutsService.list(
|
).stream()
|
||||||
// new LambdaQueryWrapper<TAppOuts>()
|
.filter(appOuts -> appOuts.getOutType() == 1 || appOuts.getDistributeNum() < appOuts.getNeedNum())
|
||||||
// .le(TAppOuts::getPickingDate, LocalDate.now())
|
.toList();
|
||||||
// .orderByDesc(TAppOuts::getOutType)
|
if (appOutsList.isEmpty()) {
|
||||||
// );
|
return;
|
||||||
List<TAppOuts> appOutsList = appOutsService.list(
|
}
|
||||||
new LambdaQueryWrapper<TAppOuts>()
|
// 需要保存的信息
|
||||||
.le(TAppOuts::getPickingDate, LocalDate.now())
|
List<TAppTask> newOutWmsTasks = new ArrayList<>();// 新的出库任务
|
||||||
.orderByDesc(TAppOuts::getOutType)
|
List<TAppPickTask> newPickTasks = new ArrayList<>();// 新的拣选任务
|
||||||
.last("LIMIT 15") // 限制只查询15条记录
|
List<String> thisTimeOutVehicleIds = new ArrayList<>();// 本次出库载具
|
||||||
).stream()
|
List<TAppPickPlan> newPickPlans = new ArrayList<>();// 拣选计划
|
||||||
.filter(appOuts -> appOuts.getDistributeNum() < appOuts.getNeedNum())
|
// 拣选任务
|
||||||
.toList();
|
List<TAppPickTask> pickTasks = appPickTaskService.list();
|
||||||
|
// 查询库存,条件:剩余数量>0,回库中、锁定以外的库存状态。
|
||||||
|
Set<String> requiredGoodsIds = appOutsList.stream()
|
||||||
|
.map(TAppOuts::getGoodsId)
|
||||||
|
.filter(StringUtils::isNotEmpty)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
List<TAppVehicle> emptyVehicles = appVehicleService.list(new LambdaQueryWrapper<TAppVehicle>()
|
||||||
|
.eq(TAppVehicle::getIsEmpty, 1)
|
||||||
|
.eq(TAppVehicle::getVehicleStatus, WmsVehicleStatusEnums.ON.getCode())
|
||||||
|
.orderByDesc(TAppVehicle::getLastInTime));// 先进先出
|
||||||
|
|
||||||
if (appOutsList.isEmpty()) {
|
List<TAppStock> allStocks = new ArrayList<>();
|
||||||
return;
|
if (!requiredGoodsIds.isEmpty()) {
|
||||||
|
allStocks = appStockService.list(new LambdaQueryWrapper<TAppStock>()
|
||||||
|
.in(TAppStock::getGoodsId, requiredGoodsIds)
|
||||||
|
.le(TAppStock::getStockStatus, WmsStockStatusEnums.OUTED.getCode())
|
||||||
|
.gt(TAppStock::getRemainNum, 0)
|
||||||
|
.orderByAsc(TAppStock::getFirstInTime));
|
||||||
|
}
|
||||||
|
|
||||||
|
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 (TAppOuts appOuts : appOutsList) {
|
||||||
|
if (appOuts.getDistributeNum() >= appOuts.getNeedNum() && appOuts.getOutType() != 1) {
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
// 需要保存的信息
|
// 判断目前是否是空箱任务
|
||||||
List<TAppTask> newOutWmsTasks = new ArrayList<>();// 新的出库任务
|
if (Objects.equals(appOuts.getOutType(), WmsOutTypeEnums.EMPTY.getCode())) {
|
||||||
List<TAppPickTask> newPickTasks = new ArrayList<>();// 新的拣选任务
|
solveEmpty(appOuts, emptyVehicles, equipVehicleMap, newOutWmsTasks, thisTimeOutVehicleIds, newPickTasks);
|
||||||
List<String> thisTimeOutVehicleIds = new ArrayList<>();// 本次出库载具
|
|
||||||
List<TAppPickPlan> newPickPlans = new ArrayList<>();// 拣选计划
|
|
||||||
// 拣选任务
|
|
||||||
List<TAppPickTask> pickTasks = appPickTaskService.list();
|
|
||||||
// 查询库存,条件:剩余数量>0,回库中、锁定以外的库存状态。
|
|
||||||
// List<TAppStock> allStocks = appStockService.list(new LambdaQueryWrapper<TAppStock>()
|
|
||||||
// .le(TAppStock::getStockStatus, WmsStockStatusEnums.OUTED.getCode())
|
|
||||||
// .gt(TAppStock::getRemainNum, 0)
|
|
||||||
// .orderByAsc(TAppStock::getFirstInTime));
|
|
||||||
|
|
||||||
Set<String> requiredGoodsIds = appOutsList.stream()
|
|
||||||
.map(TAppOuts::getGoodsId)
|
|
||||||
.filter(StringUtils::isNotEmpty)
|
|
||||||
.collect(Collectors.toSet());
|
|
||||||
|
|
||||||
List<TAppStock> allStocks = new ArrayList<>();
|
|
||||||
if (!requiredGoodsIds.isEmpty()) {
|
|
||||||
allStocks = appStockService.list(new LambdaQueryWrapper<TAppStock>()
|
|
||||||
.in(TAppStock::getGoodsId, requiredGoodsIds)
|
|
||||||
.le(TAppStock::getStockStatus, WmsStockStatusEnums.OUTED.getCode())
|
|
||||||
.gt(TAppStock::getRemainNum, 0)
|
|
||||||
.orderByAsc(TAppStock::getFirstInTime));
|
|
||||||
}
|
}
|
||||||
|
solveEmerge(equipVehicleMap, appOuts, allStocks, pickTasks, newOutWmsTasks, newPickTasks, thisTimeOutVehicleIds, newPickPlans);
|
||||||
// List<TAppVehicle> emptyVehicles = appVehicleService.list(new LambdaQueryWrapper<TAppVehicle>()
|
}
|
||||||
// .eq(TAppVehicle::getIsEmpty, 1)
|
// 保存出库单---只更新分配数量
|
||||||
// .eq(TAppVehicle::getVehicleStatus, WmsVehicleStatusEnums.ON.getCode())
|
List<TAppOuts> onlyDistributeNumOuts = appOutsList.stream().map(outs -> {
|
||||||
// .orderByAsc(TAppVehicle::getLastInTime)); // 先进先出
|
TAppOuts outCopy = new TAppOuts();
|
||||||
// // 获取可用堆垛机
|
outCopy.setTaskId(outs.getTaskId());
|
||||||
List<TAppEquipment> usableStackers = appEquipmentService.list(new LambdaQueryWrapper<TAppEquipment>()
|
outCopy.setDistributeNum(outs.getDistributeNum());
|
||||||
.eq(TAppEquipment::getEquipmentType, 1)
|
outCopy.setPickPlanId(outs.getPickPlanId());
|
||||||
.eq(TAppEquipment::getEquipmentStatus, WmsUsableStatusEnums.USABLE.getCode()));
|
outCopy.setPickPlanIdTimes(outs.getPickPlanIdTimes());
|
||||||
Map<Integer, String> equipVehicleMap = new HashMap<>();
|
return outCopy;
|
||||||
getVehicleEquipMap("", true, equipVehicleMap, usableStackers);
|
}).toList();
|
||||||
for (TAppOuts appOuts : appOutsList) {
|
// 创建一个只复制剩余数量的库存列表
|
||||||
if (appOuts.getDistributeNum() >= appOuts.getNeedNum()) {
|
List<TAppStock> onlyRemainNumStocks = allStocks.stream().map(stock -> {
|
||||||
continue;
|
TAppStock stockCopy = new TAppStock();
|
||||||
}
|
stockCopy.setStockId(stock.getStockId());
|
||||||
// // 判断目前是否是空箱任务
|
stockCopy.setRemainNum(stock.getRemainNum());
|
||||||
// if (Objects.equals(appOuts.getOutType(), WmsOutTypeEnums.EMPTY.getCode())) {
|
if (!thisTimeOutVehicleIds.isEmpty() && thisTimeOutVehicleIds.contains(stock.getVehicleId())) {
|
||||||
// solveEmpty(appOuts, emptyVehicles, equipVehicleMap, newOutWmsTasks, thisTimeOutVehicleIds);
|
stockCopy.setStockStatus(WmsStockStatusEnums.OUTING.getCode());
|
||||||
// } else if (Objects.equals(appOuts.getOutType(), WmsOutTypeEnums.FOR_IN.getCode())) {
|
|
||||||
// solveOutForIn(equipVehicleMap, appOuts, allStocks, pickTasks, newOutWmsTasks, newPickTasks, thisTimeOutVehicleIds);
|
|
||||||
// } else if (Objects.equals(appOuts.getOutType(), WmsOutTypeEnums.EMERGE.getCode())) {
|
|
||||||
// 紧急出库
|
|
||||||
solveEmerge(equipVehicleMap, appOuts, allStocks, pickTasks, newOutWmsTasks, newPickTasks, thisTimeOutVehicleIds, newPickPlans);
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
// 保存出库单---只更新分配数量
|
return stockCopy;
|
||||||
List<TAppOuts> onlyDistributeNumOuts = appOutsList.stream().map(outs -> {
|
}).toList();
|
||||||
TAppOuts outCopy = new TAppOuts();
|
boolean doTransResult = dbTransUtils.useTran(() -> {
|
||||||
outCopy.setTaskId(outs.getTaskId());
|
|
||||||
outCopy.setDistributeNum(outs.getDistributeNum());
|
|
||||||
return outCopy;
|
|
||||||
}).toList();
|
|
||||||
appOutsService.updateBatchById(onlyDistributeNumOuts);
|
appOutsService.updateBatchById(onlyDistributeNumOuts);
|
||||||
// 保存出库任务
|
// 保存出库任务
|
||||||
if (!newOutWmsTasks.isEmpty()) {
|
if (!newOutWmsTasks.isEmpty()) {
|
||||||
|
|
@ -144,16 +138,6 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
if (!newPickPlans.isEmpty()) {
|
if (!newPickPlans.isEmpty()) {
|
||||||
appPickPlanService.saveOrUpdateBatch(mergedPickPlan(newPickPlans));
|
appPickPlanService.saveOrUpdateBatch(mergedPickPlan(newPickPlans));
|
||||||
}
|
}
|
||||||
// 创建一个只复制剩余数量的库存列表
|
|
||||||
List<TAppStock> onlyRemainNumStocks = allStocks.stream().map(stock -> {
|
|
||||||
TAppStock stockCopy = new TAppStock();
|
|
||||||
stockCopy.setStockId(stock.getStockId());
|
|
||||||
stockCopy.setRemainNum(stock.getRemainNum());
|
|
||||||
if (!thisTimeOutVehicleIds.isEmpty() && thisTimeOutVehicleIds.contains(stock.getVehicleId())) {
|
|
||||||
stockCopy.setStockStatus(WmsStockStatusEnums.OUTING.getCode());
|
|
||||||
}
|
|
||||||
return stockCopy;
|
|
||||||
}).toList();
|
|
||||||
// 更新库存信息
|
// 更新库存信息
|
||||||
appStockService.updateBatchById(onlyRemainNumStocks);
|
appStockService.updateBatchById(onlyRemainNumStocks);
|
||||||
// 更新载具信息
|
// 更新载具信息
|
||||||
|
|
@ -162,10 +146,9 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
.set(TAppVehicle::getVehicleStatus, WmsVehicleStatusEnums.OUT.getCode())
|
.set(TAppVehicle::getVehicleStatus, WmsVehicleStatusEnums.OUT.getCode())
|
||||||
.in(TAppVehicle::getVehicleId, thisTimeOutVehicleIds));
|
.in(TAppVehicle::getVehicleId, thisTimeOutVehicleIds));
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
});
|
||||||
// 回滚事务
|
if (!doTransResult) {
|
||||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
log.error("执行出库单,数据库事务失败。");
|
||||||
log.error("解析出库单发生异常。{}", StringUtils.objectToString(e));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -178,11 +161,14 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
* @param newOutWmsTasks 新的出库任务
|
* @param newOutWmsTasks 新的出库任务
|
||||||
* @param thisTimeOutVehicleIds 本次出库的载具列表
|
* @param thisTimeOutVehicleIds 本次出库的载具列表
|
||||||
*/
|
*/
|
||||||
private void solveEmpty(TAppOuts appOuts, List<TAppVehicle> emptyVehicles, Map<Integer, String> equipVehicleMap, List<TAppTask> newOutWmsTasks, List<String> thisTimeOutVehicleIds) {
|
private void solveEmpty(TAppOuts appOuts, List<TAppVehicle> emptyVehicles, Map<Integer, String> equipVehicleMap, List<TAppTask> newOutWmsTasks, List<String> thisTimeOutVehicleIds, List<TAppPickTask> newPickTasks) {
|
||||||
int needNum = appOuts.getNeedNum() - appOuts.getDistributeNum();
|
int needNum = appOuts.getNeedNum() - appOuts.getDistributeNum();
|
||||||
if (needNum <= 0) {
|
if (needNum <= 0) {
|
||||||
|
// 删除出库单
|
||||||
|
appOutsService.removeById(appOuts.getTaskId());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
String optimalDestination = getOptimalSubStand(appOuts.getDestination());
|
||||||
// 生成空箱出库任务
|
// 生成空箱出库任务
|
||||||
for (TAppVehicle emptyVehicle : emptyVehicles) {
|
for (TAppVehicle emptyVehicle : emptyVehicles) {
|
||||||
if (needNum <= 0) {
|
if (needNum <= 0) {
|
||||||
|
|
@ -215,10 +201,19 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
appOuts.getUserName(),
|
appOuts.getUserName(),
|
||||||
"",
|
"空箱出库",
|
||||||
appOuts.getDestination(),
|
optimalDestination,
|
||||||
""
|
""
|
||||||
));
|
));
|
||||||
|
// 生成达到既删除的拣选任务,type设置为3
|
||||||
|
newPickTasks.add(new TAppPickTask(
|
||||||
|
UUIDUtils.getNewUUID(),
|
||||||
|
optimalDestination,
|
||||||
|
emptyVehicle.getVehicleId(),
|
||||||
|
WmsPickTaskStatusEnum.TEMP.getCode(),
|
||||||
|
LocalDateTime.now(),
|
||||||
|
null, null, null,3
|
||||||
|
));
|
||||||
emptyVehicle.setVehicleStatus(WmsVehicleStatusEnums.OUT.getCode());
|
emptyVehicle.setVehicleStatus(WmsVehicleStatusEnums.OUT.getCode());
|
||||||
thisTimeOutVehicleIds.add(emptyVehicle.getVehicleId());
|
thisTimeOutVehicleIds.add(emptyVehicle.getVehicleId());
|
||||||
updateVehicleEquipMapByLocation(equipVehicleMap, emptyVehicle.getVehicleId(), emptyVehicle.getLocationId());
|
updateVehicleEquipMapByLocation(equipVehicleMap, emptyVehicle.getVehicleId(), emptyVehicle.getLocationId());
|
||||||
|
|
@ -409,26 +404,39 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// 判断当前的这条库存,当前站台是否需要
|
// 判断当前的这条库存,当前站台是否需要
|
||||||
|
int stockIsEmpty;
|
||||||
int originNum = stock.getRemainNum();
|
int originNum = stock.getRemainNum();
|
||||||
int remainNum = stock.getRemainNum();
|
int remainNum = stock.getRemainNum();
|
||||||
int needNum = appOuts.getNeedNum() - appOuts.getDistributeNum();
|
int needNum = appOuts.getNeedNum() - appOuts.getDistributeNum();
|
||||||
if (needNum < remainNum) {
|
if (needNum <= remainNum) {
|
||||||
appOuts.setDistributeNum(appOuts.getNeedNum());
|
appOuts.setDistributeNum(appOuts.getNeedNum());
|
||||||
remainNum = remainNum - needNum;
|
remainNum = remainNum - needNum;
|
||||||
|
stockIsEmpty = 0;
|
||||||
} else {
|
} else {
|
||||||
appOuts.setDistributeNum(appOuts.getDistributeNum() + remainNum);
|
appOuts.setDistributeNum(appOuts.getDistributeNum() + remainNum);
|
||||||
remainNum = 0;
|
remainNum = 0;
|
||||||
|
stockIsEmpty = 1;
|
||||||
}
|
}
|
||||||
if (remainNum == originNum) {
|
if (remainNum == originNum) {
|
||||||
// 没用到这条库存
|
// 没用到这条库存
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// // 查找该workIndex的计划有没有,有的话计划需要合并,拣选任务不生产
|
// 查找该工单号orderNo的且goodsId一样的计划有没有,有的话计划需要合并,拣选任务不生产
|
||||||
// // 如果没有的话,拣选任务不会合并,而且对应的拣选任务要生成
|
// 如果没有的话,拣选任务不会合并,而且对应的拣选任务要生成
|
||||||
// // 查询到对应的出库单
|
// 查询到对应的出库单
|
||||||
// List<TAppPickPlan> appPickPlans = appPickPlanService.list(
|
List<TAppPickPlan> appPickPlansByData = appPickPlanService.list(
|
||||||
// new LambdaQueryWrapper<TAppPickPlan>().eq(TAppPickPlan::getWorkIndex, appOuts.getTaskId())
|
new LambdaQueryWrapper<TAppPickPlan>()
|
||||||
// );
|
.eq(TAppPickPlan::getOrderNo, appOuts.getSecondPickingCode())
|
||||||
|
.eq(TAppPickPlan::getGoodsId, appOuts.getGoodsId())
|
||||||
|
.eq(TAppPickPlan::getVehicleId, stock.getVehicleId())
|
||||||
|
.eq(TAppPickPlan::getIsEmpty, stockIsEmpty)
|
||||||
|
);
|
||||||
|
List<TAppPickPlan> appPickPlansByMemory = newPickPlans.stream()
|
||||||
|
.filter(plan -> Objects.equals(plan.getOrderNo(), appOuts.getSecondPickingCode())
|
||||||
|
&& Objects.equals(plan.getGoodsId(), appOuts.getGoodsId())
|
||||||
|
&& Objects.equals(plan.getVehicleId(), stock.getVehicleId())
|
||||||
|
&& Objects.equals(plan.getIsEmpty(), stockIsEmpty)
|
||||||
|
).toList();
|
||||||
|
|
||||||
// 生成拣选计划
|
// 生成拣选计划
|
||||||
TAppPickPlan pickPlan = new TAppPickPlan(
|
TAppPickPlan pickPlan = new TAppPickPlan(
|
||||||
|
|
@ -438,7 +446,9 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
originNum - remainNum,
|
originNum - remainNum,
|
||||||
2,
|
2,
|
||||||
appOuts.getTaskId(),
|
appOuts.getTaskId(),
|
||||||
optimalDestination
|
optimalDestination,
|
||||||
|
appOuts.getSecondPickingCode(),
|
||||||
|
stockIsEmpty
|
||||||
);
|
);
|
||||||
newPickPlans.add(pickPlan);
|
newPickPlans.add(pickPlan);
|
||||||
// 库存变动了,需要更新库存信息
|
// 库存变动了,需要更新库存信息
|
||||||
|
|
@ -489,7 +499,9 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
// && !Objects.equals(pickTask.getPickStatus(), WmsPickTaskStatusEnum.FOR_IN.getCode())).toList();
|
// && !Objects.equals(pickTask.getPickStatus(), WmsPickTaskStatusEnum.FOR_IN.getCode())).toList();
|
||||||
// 生成拣选任务
|
// 生成拣选任务
|
||||||
//if (oldPickTasks.isEmpty() && newOldPickTasks.isEmpty() && appPickPlans.isEmpty()) {
|
//if (oldPickTasks.isEmpty() && newOldPickTasks.isEmpty() && appPickPlans.isEmpty()) {
|
||||||
// if (appPickPlans.isEmpty()) {
|
appOuts.setPickPlanIdTimes(newPickPlans.size());
|
||||||
|
|
||||||
|
if (appPickPlansByData.isEmpty() && appPickPlansByMemory.isEmpty()) {
|
||||||
newPickTasks.add(new TAppPickTask(
|
newPickTasks.add(new TAppPickTask(
|
||||||
UUIDUtils.getNewUUID(),
|
UUIDUtils.getNewUUID(),
|
||||||
optimalDestination,
|
optimalDestination,
|
||||||
|
|
@ -498,7 +510,15 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
LocalDateTime.now(),
|
LocalDateTime.now(),
|
||||||
null, null, null,1
|
null, null, null,1
|
||||||
));
|
));
|
||||||
// }
|
appOuts.setPickPlanId(pickPlan.getPlanId());
|
||||||
|
}else{
|
||||||
|
if (appPickPlansByData.isEmpty()){
|
||||||
|
appOuts.setPickPlanId(appPickPlansByMemory.getFirst().getPlanId());
|
||||||
|
}else {
|
||||||
|
appOuts.setPickPlanId(appPickPlansByData.getFirst().getPlanId());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -515,7 +535,8 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
standMapping.put("P1", List.of("P12"));
|
standMapping.put("P1", List.of("P12"));
|
||||||
standMapping.put("P2", List.of("P15"));
|
standMapping.put("P2", List.of("P15"));
|
||||||
standMapping.put("P3", List.of("P18"));
|
standMapping.put("P3", List.of("P18"));
|
||||||
standMapping.put("P4", Arrays.asList("P21", "P22", "P23"));
|
// 修改P4映射为多个子站台
|
||||||
|
standMapping.put("P4", List.of("P21", "P22", "P23"));
|
||||||
|
|
||||||
// 如果不是主站台,直接返回原站台
|
// 如果不是主站台,直接返回原站台
|
||||||
if (!standMapping.containsKey(mainStand)) {
|
if (!standMapping.containsKey(mainStand)) {
|
||||||
|
|
@ -546,7 +567,7 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
* 实现
|
* 实现
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
//@Transactional(rollbackFor = Exception.class)
|
||||||
public void executeKateWorks() {
|
public void executeKateWorks() {
|
||||||
try {
|
try {
|
||||||
// 查询所有的未完成的工作
|
// 查询所有的未完成的工作
|
||||||
|
|
@ -700,7 +721,7 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
thisTimePickNum,
|
thisTimePickNum,
|
||||||
1,
|
1,
|
||||||
thisWork.getWorkIndex(),
|
thisWork.getWorkIndex(),
|
||||||
stand.getStandId()
|
stand.getStandId(),null,null
|
||||||
);
|
);
|
||||||
newPickPlans.add(pickPlan);
|
newPickPlans.add(pickPlan);
|
||||||
}
|
}
|
||||||
|
|
@ -1429,11 +1450,11 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
// 循环merge
|
// 循环merge
|
||||||
for (TAppPickPlan beforeMergePickPlan : beforeMergePickPlanList) {
|
for (TAppPickPlan beforeMergePickPlan : beforeMergePickPlanList) {
|
||||||
// key:站台+箱号+料号+拣选类型+index
|
// key:站台+箱号+料号+拣选类型+index
|
||||||
String key = beforeMergePickPlan.getPlanId() + "_"
|
String key = beforeMergePickPlan.getVehicleId() + "_"
|
||||||
+beforeMergePickPlan.getVehicleId() + "_"
|
|
||||||
+ beforeMergePickPlan.getGoodsId() + "_"
|
+ beforeMergePickPlan.getGoodsId() + "_"
|
||||||
+ beforeMergePickPlan.getPickType() + "_"
|
+ beforeMergePickPlan.getPickType() + "_"
|
||||||
+ beforeMergePickPlan.getWorkIndex();
|
+ beforeMergePickPlan.getOrderNo() + "_"
|
||||||
|
+ beforeMergePickPlan.getIsEmpty();
|
||||||
|
|
||||||
if (mergedPickPlanMap.containsKey(key)) {
|
if (mergedPickPlanMap.containsKey(key)) {
|
||||||
// 之前已经合并过
|
// 之前已经合并过
|
||||||
|
|
@ -1442,11 +1463,13 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
mergedPickPlanMap.replace(key, mergedPickPlan);
|
mergedPickPlanMap.replace(key, mergedPickPlan);
|
||||||
} else {
|
} else {
|
||||||
// 之前没有合并过
|
// 之前没有合并过
|
||||||
TAppPickPlan existPickPlan = existPickPlanList.stream().filter(pickPlan -> Objects.equals(pickPlan.getPlanId(), beforeMergePickPlan.getPlanId())
|
TAppPickPlan existPickPlan = existPickPlanList.stream().filter(pickPlan ->
|
||||||
&& Objects.equals(pickPlan.getVehicleId(), beforeMergePickPlan.getVehicleId())
|
Objects.equals(pickPlan.getVehicleId(), beforeMergePickPlan.getVehicleId())
|
||||||
&& Objects.equals(pickPlan.getGoodsId(), beforeMergePickPlan.getGoodsId())
|
&& Objects.equals(pickPlan.getGoodsId(), beforeMergePickPlan.getGoodsId())
|
||||||
&& Objects.equals(pickPlan.getPickType(), beforeMergePickPlan.getPickType())
|
&& Objects.equals(pickPlan.getPickType(), beforeMergePickPlan.getPickType())
|
||||||
&& Objects.equals(pickPlan.getWorkIndex(), beforeMergePickPlan.getWorkIndex())).findFirst().orElse(null);
|
&& Objects.equals(pickPlan.getOrderNo(), beforeMergePickPlan.getOrderNo())
|
||||||
|
&& Objects.equals(pickPlan.getIsEmpty(), beforeMergePickPlan.getIsEmpty())
|
||||||
|
).findFirst().orElse(null);
|
||||||
if (existPickPlan != null) {
|
if (existPickPlan != null) {
|
||||||
// 已经存过表
|
// 已经存过表
|
||||||
existPickPlan.setPlanPickQty(existPickPlan.getPlanPickQty() + beforeMergePickPlan.getPlanPickQty());
|
existPickPlan.setPlanPickQty(existPickPlan.getPlanPickQty() + beforeMergePickPlan.getPlanPickQty());
|
||||||
|
|
@ -1460,7 +1483,9 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
beforeMergePickPlan.getPlanPickQty(),
|
beforeMergePickPlan.getPlanPickQty(),
|
||||||
beforeMergePickPlan.getPickType(),
|
beforeMergePickPlan.getPickType(),
|
||||||
beforeMergePickPlan.getWorkIndex(),
|
beforeMergePickPlan.getWorkIndex(),
|
||||||
beforeMergePickPlan.getStandId()
|
beforeMergePickPlan.getStandId(),
|
||||||
|
beforeMergePickPlan.getOrderNo(),
|
||||||
|
beforeMergePickPlan.getIsEmpty()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
mergedPickPlanMap.put(key, existPickPlan);
|
mergedPickPlanMap.put(key, existPickPlan);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user