forked from BaoKaiWms/202501-Wms-Kate-Wuxi
1. 增加导入配料单的数量提示。
2. 减去配料单物料描述的非空筛选。 3. 增加拣选界面的盘点任务遗留查询。
This commit is contained in:
parent
f60c8c6295
commit
e41905ab78
|
|
@ -1,95 +1,92 @@
|
|||
<template>
|
||||
<el-upload ref="uploadRef" :on-preview="previewFile" :limit="1" :on-change="changeFile" :auto-upload="false"
|
||||
:data="uploadForm.data">
|
||||
<template #trigger>
|
||||
<el-button type="primary">选取非服务件配料单文件</el-button>
|
||||
</template>
|
||||
<el-button style="margin-left: 10px;" type="success" @click="uploadProduct">上传非服务件配料清单</el-button>
|
||||
</el-upload>
|
||||
<el-upload ref="uploadRef" :on-preview="previewFile" :limit="1" :on-change="changeFile" :auto-upload="false"
|
||||
:data="uploadForm.data">
|
||||
<template #trigger>
|
||||
<el-button type="primary">选取非服务件配料单文件</el-button>
|
||||
</template>
|
||||
<el-button style="margin-left: 10px;" type="success" @click="uploadProduct">上传非服务件配料清单</el-button>
|
||||
</el-upload>
|
||||
</template>
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { ref, reactive } from 'vue';
|
||||
import { uploadExcelProduct } from '@/api/excel.js'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { errorBox } from '@/utils/myMessageBox';
|
||||
import { sizeFormatter } from '@/utils/formatter.js'
|
||||
import { loading } from '@/utils/loading.js'
|
||||
import { getHashString } from '@/utils/hashUtils.js'
|
||||
import {ref, reactive} from 'vue';
|
||||
import {uploadExcelProduct} from '@/api/excel.js'
|
||||
import {errorBox, successBox} from '@/utils/myMessageBox';
|
||||
import {sizeFormatter} from '@/utils/formatter.js'
|
||||
import {loading} from '@/utils/loading.js'
|
||||
import {getHashString} from '@/utils/hashUtils.js'
|
||||
|
||||
var currentHash = ''
|
||||
const file = ref()
|
||||
const uploadForm = reactive({
|
||||
data: {
|
||||
fileId: '',
|
||||
name: '',
|
||||
type: '',
|
||||
size: null,
|
||||
hash: '',
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
data: {
|
||||
fileId: '',
|
||||
name: '',
|
||||
type: '',
|
||||
size: null,
|
||||
hash: '',
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
})
|
||||
const changeFile = (uploadFile) => {
|
||||
file.value = uploadFile
|
||||
uploadForm.data = {
|
||||
fileId: file.value.raw.uid,
|
||||
name: file.value.raw.name,
|
||||
type: file.value.raw.type,
|
||||
size: sizeFormatter(file.value.raw.size),
|
||||
hash: getHashString(uploadFile),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
file.value = uploadFile
|
||||
uploadForm.data = {
|
||||
fileId: file.value.raw.uid,
|
||||
name: file.value.raw.name,
|
||||
type: file.value.raw.type,
|
||||
size: sizeFormatter(file.value.raw.size),
|
||||
hash: getHashString(uploadFile),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
}
|
||||
const uploadRef = ref()
|
||||
const uploadProduct = () => {
|
||||
if (uploadForm == undefined || file.value == undefined) {
|
||||
errorBox('请选择文件之后再上传')
|
||||
return
|
||||
if (uploadForm == undefined || file.value == undefined) {
|
||||
errorBox('请选择文件之后再上传')
|
||||
return
|
||||
}
|
||||
if (currentHash != '' && currentHash == uploadForm.data.hash) {
|
||||
errorBox('请勿重复上传')
|
||||
return
|
||||
}
|
||||
currentHash = uploadForm.data.hash
|
||||
const jsonStr = JSON.stringify(uploadForm.data);
|
||||
const blob = new Blob([jsonStr], {
|
||||
type: 'application/json'
|
||||
});
|
||||
let formData = new FormData();
|
||||
// 这里很重要 file.value.raw才是真实的file文件,file.value只是一个Proxy代理对象
|
||||
formData.append("fileVo", blob);
|
||||
formData.append("file", file.value.raw);
|
||||
loading.open('导入中...')
|
||||
uploadExcelProduct(formData).then(res => {
|
||||
loading.close()
|
||||
currentHash = ''
|
||||
if (res.data.code == 0) {
|
||||
successBox(res.data.message)
|
||||
clearFileInfos()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
if (currentHash != '' && currentHash == uploadForm.data.hash) {
|
||||
errorBox('请勿重复上传')
|
||||
return
|
||||
}
|
||||
currentHash = uploadForm.data.hash
|
||||
const jsonStr = JSON.stringify(uploadForm.data);
|
||||
const blob = new Blob([jsonStr], {
|
||||
type: 'application/json'
|
||||
});
|
||||
let formData = new FormData();
|
||||
// 这里很重要 file.value.raw才是真实的file文件,file.value只是一个Proxy代理对象
|
||||
formData.append("fileVo", blob);
|
||||
formData.append("file", file.value.raw);
|
||||
loading.open('导入中...')
|
||||
uploadExcelProduct(formData).then(res => {
|
||||
loading.close()
|
||||
currentHash = ''
|
||||
if (res.data.code == 0) {
|
||||
ElMessage({
|
||||
message: '上传成功',
|
||||
type: 'success',
|
||||
})
|
||||
clearFileInfos()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
loading.close()
|
||||
currentHash = ''
|
||||
console.log(err)
|
||||
errorBox('上传错误')
|
||||
})
|
||||
}).catch(err => {
|
||||
loading.close()
|
||||
currentHash = ''
|
||||
console.log(err)
|
||||
errorBox('上传错误')
|
||||
})
|
||||
}
|
||||
const clearFileInfos = () => {
|
||||
// 清空选择的文件项
|
||||
uploadRef.value.clearFiles()
|
||||
uploadForm.data = {
|
||||
fileId: '',
|
||||
name: '',
|
||||
type: '',
|
||||
size: null,
|
||||
hash: '',
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
file.value = undefined
|
||||
// 清空选择的文件项
|
||||
uploadRef.value.clearFiles()
|
||||
uploadForm.data = {
|
||||
fileId: '',
|
||||
name: '',
|
||||
type: '',
|
||||
size: null,
|
||||
hash: '',
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
file.value = undefined
|
||||
}
|
||||
const previewFile = () => {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,95 +1,92 @@
|
|||
<template>
|
||||
<el-upload ref="uploadRef" :on-preview="previewFile" :limit="1" :on-change="changeFile" :auto-upload="false"
|
||||
:data="uploadForm.data">
|
||||
<template #trigger>
|
||||
<el-button type="primary">选取服务件配料单文件</el-button>
|
||||
</template>
|
||||
<el-button style="margin-left: 10px;" type="success" @click="uploadSingleProduct">上传服务件配料单</el-button>
|
||||
</el-upload>
|
||||
<el-upload ref="uploadRef" :on-preview="previewFile" :limit="1" :on-change="changeFile" :auto-upload="false"
|
||||
:data="uploadForm.data">
|
||||
<template #trigger>
|
||||
<el-button type="primary">选取服务件配料单文件</el-button>
|
||||
</template>
|
||||
<el-button style="margin-left: 10px;" type="success" @click="uploadSingleProduct">上传服务件配料单</el-button>
|
||||
</el-upload>
|
||||
</template>
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { ref, reactive } from 'vue';
|
||||
import { uploadExcelSingleProduct } from '@/api/excel.js'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { errorBox } from '@/utils/myMessageBox';
|
||||
import { sizeFormatter } from '@/utils/formatter.js'
|
||||
import { loading } from '@/utils/loading.js'
|
||||
import { getHashString } from '@/utils/hashUtils.js'
|
||||
import {ref, reactive} from 'vue';
|
||||
import {uploadExcelSingleProduct} from '@/api/excel.js'
|
||||
import {errorBox, successBox} from '@/utils/myMessageBox';
|
||||
import {sizeFormatter} from '@/utils/formatter.js'
|
||||
import {loading} from '@/utils/loading.js'
|
||||
import {getHashString} from '@/utils/hashUtils.js'
|
||||
|
||||
var currentHash = ''
|
||||
const file = ref()
|
||||
const uploadForm = reactive({
|
||||
data: {
|
||||
fileId: '',
|
||||
name: '',
|
||||
type: '',
|
||||
size: null,
|
||||
hash: '',
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
data: {
|
||||
fileId: '',
|
||||
name: '',
|
||||
type: '',
|
||||
size: null,
|
||||
hash: '',
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
})
|
||||
const changeFile = (uploadFile) => {
|
||||
file.value = uploadFile
|
||||
uploadForm.data = {
|
||||
fileId: file.value.raw.uid,
|
||||
name: file.value.raw.name,
|
||||
type: file.value.raw.type,
|
||||
size: sizeFormatter(file.value.raw.size),
|
||||
hash: getHashString(uploadFile),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
file.value = uploadFile
|
||||
uploadForm.data = {
|
||||
fileId: file.value.raw.uid,
|
||||
name: file.value.raw.name,
|
||||
type: file.value.raw.type,
|
||||
size: sizeFormatter(file.value.raw.size),
|
||||
hash: getHashString(uploadFile),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
}
|
||||
const uploadRef = ref()
|
||||
const uploadSingleProduct = () => {
|
||||
if (uploadForm == undefined || file.value == undefined) {
|
||||
errorBox('请选择文件之后再上传')
|
||||
return
|
||||
if (uploadForm == undefined || file.value == undefined) {
|
||||
errorBox('请选择文件之后再上传')
|
||||
return
|
||||
}
|
||||
if (currentHash != '' && currentHash == uploadForm.data.hash) {
|
||||
errorBox('请勿重复上传')
|
||||
return
|
||||
}
|
||||
currentHash = uploadForm.data.hash
|
||||
const jsonStr = JSON.stringify(uploadForm.data);
|
||||
const blob = new Blob([jsonStr], {
|
||||
type: 'application/json'
|
||||
});
|
||||
let formData = new FormData();
|
||||
// 这里很重要 file.value.raw才是真实的file文件,file.value只是一个Proxy代理对象
|
||||
formData.append("fileVo", blob);
|
||||
formData.append("file", file.value.raw);
|
||||
loading.open('导入中...')
|
||||
uploadExcelSingleProduct(formData).then(res => {
|
||||
loading.close()
|
||||
currentHash = ''
|
||||
if (res.data.code == 0) {
|
||||
successBox(res.data.message)
|
||||
clearFileInfos()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
if (currentHash != '' && currentHash == uploadForm.data.hash) {
|
||||
errorBox('请勿重复上传')
|
||||
return
|
||||
}
|
||||
currentHash = uploadForm.data.hash
|
||||
const jsonStr = JSON.stringify(uploadForm.data);
|
||||
const blob = new Blob([jsonStr], {
|
||||
type: 'application/json'
|
||||
});
|
||||
let formData = new FormData();
|
||||
// 这里很重要 file.value.raw才是真实的file文件,file.value只是一个Proxy代理对象
|
||||
formData.append("fileVo", blob);
|
||||
formData.append("file", file.value.raw);
|
||||
loading.open('导入中...')
|
||||
uploadExcelSingleProduct(formData).then(res => {
|
||||
loading.close()
|
||||
currentHash = ''
|
||||
if (res.data.code == 0) {
|
||||
ElMessage({
|
||||
message: '上传成功',
|
||||
type: 'success',
|
||||
})
|
||||
clearFileInfos()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
loading.close()
|
||||
currentHash = ''
|
||||
console.log(err)
|
||||
errorBox('上传错误')
|
||||
})
|
||||
}).catch(err => {
|
||||
loading.close()
|
||||
currentHash = ''
|
||||
console.log(err)
|
||||
errorBox('上传错误')
|
||||
})
|
||||
}
|
||||
const clearFileInfos = () => {
|
||||
// 清空选择的文件项
|
||||
uploadRef.value.clearFiles()
|
||||
uploadForm.data = {
|
||||
fileId: '',
|
||||
name: '',
|
||||
type: '',
|
||||
size: null,
|
||||
hash: '',
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
file.value = undefined
|
||||
// 清空选择的文件项
|
||||
uploadRef.value.clearFiles()
|
||||
uploadForm.data = {
|
||||
fileId: '',
|
||||
name: '',
|
||||
type: '',
|
||||
size: null,
|
||||
hash: '',
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
file.value = undefined
|
||||
}
|
||||
const previewFile = () => {
|
||||
|
||||
|
|
|
|||
|
|
@ -166,7 +166,6 @@ public class ImportExcelEasyPoi extends BaseImportExcelEasyPoi implements IImpor
|
|||
|| StringUtils.isEmpty(productRawData.getProductId())
|
||||
|| productRawData.getQuantity1Pair() == null
|
||||
|| StringUtils.isEmpty(productRawData.getGoodsId())
|
||||
|| StringUtils.isEmpty(productRawData.getGoodsDesc())
|
||||
|| productRawData.getQuantityOfPairs() == null
|
||||
|| StringUtils.isEmpty(productRawData.getBoxNo())) {
|
||||
continue;
|
||||
|
|
@ -210,7 +209,8 @@ public class ImportExcelEasyPoi extends BaseImportExcelEasyPoi implements IImpor
|
|||
tAppImageService.saveOrUpdateBatch(imageList);
|
||||
// 保存导入file记录
|
||||
saveFileVo(fileVo);
|
||||
return BaseWmsApiResponse.success("导入配料单成功。");
|
||||
return BaseWmsApiResponse.success("导入配料单成功。\n原始:" + productRawDatas.size() + "条,成功:" + productList.size()
|
||||
+ "条。\n图纸原始:" + imageRawDatas.size() + "条,成功:" + imageList.size() + "条。");
|
||||
} catch (Exception e) {
|
||||
// 回滚事务
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
|
|
@ -245,7 +245,6 @@ public class ImportExcelEasyPoi extends BaseImportExcelEasyPoi implements IImpor
|
|||
|| StringUtils.isEmpty(productRawData.getSingleProductId())
|
||||
|| productRawData.getQuantity1Pair() == null
|
||||
|| StringUtils.isEmpty(productRawData.getGoodsId())
|
||||
|| StringUtils.isEmpty(productRawData.getGoodsDesc())
|
||||
|| productRawData.getQuantityOfPairs() == null
|
||||
|| StringUtils.isEmpty(productRawData.getBoxNo())) {
|
||||
continue;
|
||||
|
|
@ -289,7 +288,8 @@ public class ImportExcelEasyPoi extends BaseImportExcelEasyPoi implements IImpor
|
|||
tAppImageService.saveOrUpdateBatch(imageList);
|
||||
// 保存导入file记录
|
||||
saveFileVo(fileVo);
|
||||
return BaseWmsApiResponse.success("导入服务件配料单成功。");
|
||||
return BaseWmsApiResponse.success("导入服务件配料单成功。\n原始:" + productRawDatas.size() + "条,成功:" + productList.size()
|
||||
+ "条。\n图纸原始:" + imageRawDatas.size() + "条,成功:" + imageList.size() + "条。");
|
||||
} catch (Exception e) {
|
||||
// 回滚事务
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ public class KateWorkControllerServiceImpl implements IKateWorkControllerService
|
|||
private final ITAppKanbanService appKanbanService;// 看板服务
|
||||
private final ITAppWorkRecordService appWorkRecordService;// 工作记录服务
|
||||
private final ITAppPickPlanService appPickPlanService;// 拣选计划服务
|
||||
private final ITAppInventoryService appInventoryService;// 盘点任务服务
|
||||
private final AppCommon appCommon;
|
||||
|
||||
/**
|
||||
|
|
@ -419,6 +420,14 @@ public class KateWorkControllerServiceImpl implements IKateWorkControllerService
|
|||
if (taskConfirmVo != 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());
|
||||
|
|
|
|||
|
|
@ -737,6 +737,14 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
|||
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());
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ spring:
|
|||
# username: developer
|
||||
# password: developer
|
||||
# 本地
|
||||
# url: jdbc:mysql://localhost:3306/wms_kate_wuxi_test?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
|
||||
# url: jdbc:mysql://localhost:3306/wms_kate_wuxi?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
|
||||
# username: root
|
||||
# password: liangzhou
|
||||
# 卡特服务器
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user