forked from BaoKaiWms/202501-Wms-Kate-Wuxi
1. 增加补打标签功能
This commit is contained in:
parent
3868180fee
commit
89099c5fcb
|
|
@ -153,3 +153,12 @@ export const closeCurrentWorks = (params) => {
|
|||
timeout: 5000
|
||||
})
|
||||
}
|
||||
// 请求料盒标签数据
|
||||
export const requestPrintBoxTags = (params) => {
|
||||
return request({
|
||||
url: '/kate/requestPrintBoxTags',
|
||||
method: 'post',
|
||||
data: params,
|
||||
timeout: 5000
|
||||
})
|
||||
}
|
||||
|
|
@ -65,10 +65,12 @@
|
|||
<el-row>
|
||||
<el-button type="success"
|
||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||
@click="confirmStart()">确认配料</el-button>
|
||||
@click="confirmStart()">确认配料
|
||||
</el-button>
|
||||
<el-button type="warning"
|
||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||
@click="resetWorkFormQuery()">清除选择</el-button>
|
||||
@click="resetWorkFormQuery()">清除选择
|
||||
</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
|
|
@ -121,13 +123,16 @@
|
|||
<el-row>
|
||||
<el-button type="primary"
|
||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||
@click="showBoxSummary()">显示料盒</el-button>
|
||||
@click="showBoxSummary()">显示料盒
|
||||
</el-button>
|
||||
<el-button type="success" ref="confirmReleaseBtn"
|
||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||
@click="confirmOrRelease()">确认/放行</el-button>
|
||||
@click="confirmOrRelease()">确认/放行
|
||||
</el-button>
|
||||
<el-button type="warning"
|
||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||
@click="requestPrint()">打印标签</el-button>
|
||||
@click="requestPrint()">打印标签
|
||||
</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
|
|
@ -200,7 +205,7 @@
|
|||
v-print="getPrintObj('printLackGoodsArea')"></button>
|
||||
<div id="printLackGoodsArea" class="objectDialogFlowPrint">
|
||||
<div class="pageWarp" v-for="item in lackGoodsForPrint">
|
||||
<div class="print-tab-full">
|
||||
<div class="print-tab-full" style="margin-left: 30px">
|
||||
<div class="print-row-big">料盒:{{ item.boxNo }}</div>
|
||||
<div class="print-row-big">料号:{{ item.goodsId }}</div>
|
||||
<div class="print-row-big">需求:{{ item.needNum }}</div>
|
||||
|
|
@ -218,7 +223,15 @@
|
|||
import store from '@/store'
|
||||
import QrcodeVue from 'qrcode.vue'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import { queryKateWorks, initWorks, getCurrentWorks, confirmCurrentWork, getBoxesAndLacks, queryWorkingGoodsByPage, getLackGoods } from '@/api/kateWork.js'
|
||||
import {
|
||||
queryKateWorks,
|
||||
initWorks,
|
||||
getCurrentWorks,
|
||||
confirmCurrentWork,
|
||||
getBoxesAndLacks,
|
||||
queryWorkingGoodsByPage,
|
||||
getLackGoods
|
||||
} from '@/api/kateWork.js'
|
||||
import {errorBox, successBox, warningBox} from '@/utils/myMessageBox.js'
|
||||
import {ElMessage} from 'element-plus'
|
||||
import {dateFormatter} from '@/utils/formatter.js'
|
||||
|
|
@ -227,6 +240,7 @@ import { printObj, labelPosition, shortcuts, getPrintObj } from '@/constant/form
|
|||
import {loading} from '@/utils/loading'
|
||||
import {genTableRequest} from '@/utils/generator.js'
|
||||
import {useRoute} from 'vue-router'
|
||||
|
||||
const standId = store.getters.getStandId
|
||||
const userName = store.getters.getUserName
|
||||
let storeKittingWork = store.getters.getKittingWork
|
||||
|
|
@ -791,10 +805,7 @@ const printLacks = (workOrder, productId, singleProductId, boxNo) => {
|
|||
@media print {
|
||||
@page {
|
||||
size: auto;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
body,
|
||||
|
|
|
|||
|
|
@ -17,6 +17,12 @@
|
|||
<el-form-item label="料盒号">
|
||||
<el-input v-model="searchQueryFormEntity.boxNo" @keyup.enter="search()" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="成品号">
|
||||
<el-input v-model="searchQueryFormEntity.productId" @keyup.enter="search()" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单片号">
|
||||
<el-input v-model="searchQueryFormEntity.singleProductId" @keyup.enter="search()" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工作状态">
|
||||
<el-select-v2 v-model="searchQueryFormEntity.workStatus" placeholder="工作状态"
|
||||
:options="addAllOptionOfOptions(workStatusOptions)"
|
||||
|
|
@ -34,8 +40,12 @@
|
|||
<el-button type="warning" class="btn-search" @click="clearQuery()">清除输入</el-button>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button style="background-color: #00CED1;" class="btn-search"
|
||||
@click="() => { showPrintDialog = true }">打印标签
|
||||
</el-button>
|
||||
<el-button type="success" class="btn-search"
|
||||
@click="exportExcel()">导出excel</el-button>
|
||||
@click="exportExcel()">导出excel
|
||||
</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -103,7 +113,8 @@
|
|||
@current-change="search" layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="baseTableQuery.total"/>
|
||||
</div>
|
||||
<el-dialog v-model="rowEditFlag" title="工作信息" width="40%" draggable :show-close="false">
|
||||
<el-dialog v-model="rowEditFlag" title="工作信息" width="40%" draggable :show-close="false"
|
||||
:close-on-click-modal="false">
|
||||
<el-form ref="rowEditFormRef" :model="rowFormEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="max-width: 100%" status-icon>
|
||||
<el-row :gutter="16">
|
||||
|
|
@ -188,6 +199,70 @@
|
|||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="showPrintDialog" title="打印标签" width="40%" draggable :close-on-click-modal="false">
|
||||
<fieldset class="search-area">
|
||||
<el-form ref="printRequestFormRef" :model="printRequestFormEntity" :label-position="labelPosition"
|
||||
label-width="158px" style="max-width: 100%" status-icon>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-form-item label="工单号(必须)">
|
||||
<el-input v-model="printRequestFormEntity.workOrder" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="料盒号(必须)">
|
||||
<el-input v-model="printRequestFormEntity.boxNo" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单片号(非必须)">
|
||||
<el-input v-model="printRequestFormEntity.singleProductId" clearable/>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<div style="align-content: center;">
|
||||
<el-row>
|
||||
<el-button type="primary" class="btn-search" @click="printBoxTags()">打印料盒标签</el-button>
|
||||
<el-button type="warning" class="btn-search" @click="printLackTags()">打印缺料标签</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</fieldset>
|
||||
</el-dialog>
|
||||
<div style="width: 0;height: 0;overflow: hidden">
|
||||
<button ref="printBtn" style="display: none;" v-print="printObj"></button>
|
||||
<div id="printArea" class="objectDialogFlowPrint">
|
||||
<div class="pageWarp" v-for="item in printTabs">
|
||||
<div class="print-tab-text">
|
||||
<div class="print-row-normal">工单:{{ item.workOrder }}</div>
|
||||
<div class="print-row-normal">总成:{{ item.productId }}</div>
|
||||
<div class="print-row-normal">单片:{{ item.singleProductId }}</div>
|
||||
<div class="print-row-normal">配料:{{ item.kittingDate }}</div>
|
||||
</div>
|
||||
<div class="print-tab-text">
|
||||
<div class="print-row-normal">测试台:{{ item.testNo }}</div>
|
||||
<div class="print-row-normal">产量:{{ item.productionQty }}</div>
|
||||
<div class="print-row-normal">料盒号:{{ item.boxNo }}</div>
|
||||
<div class="print-row-normal">生产:{{ item.produceDate }}</div>
|
||||
</div>
|
||||
<div class="print-tab-image">
|
||||
<qrcode-vue
|
||||
:value="item.imageId"
|
||||
:size="size" :foreground="color" level="H"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 0;height: 0;overflow: hidden">
|
||||
<button ref="printLackGoodsBtn" style="display: none;"
|
||||
v-print="getPrintObj('printLackGoodsArea')"></button>
|
||||
<div id="printLackGoodsArea" class="objectDialogFlowPrint">
|
||||
<div class="pageWarp" v-for="item in lackGoodsForPrint">
|
||||
<div class="print-tab-full" style="margin-left: 30px">
|
||||
<div class="print-row-big">料盒:{{ item.boxNo }}</div>
|
||||
<div class="print-row-big">料号:{{ item.goodsId }}</div>
|
||||
<div class="print-row-big">需求:{{ item.needNum }}</div>
|
||||
<div class="print-row-big">缺料:{{ item.needNum - item.finishNum }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-container>
|
||||
</el-config-provider>
|
||||
|
|
@ -196,16 +271,24 @@
|
|||
<script setup>
|
||||
import store from '@/store'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import { queryWorkSummaryByPage, updateKateWorks, closeCurrentWorks } from '@/api/kateWork.js'
|
||||
import {
|
||||
queryWorkSummaryByPage,
|
||||
updateKateWorks,
|
||||
closeCurrentWorks,
|
||||
requestPrintBoxTags,
|
||||
getLackGoods
|
||||
} from '@/api/kateWork.js'
|
||||
import {dateFormatter, timeFormatter, yesOrNoFormatter} from '@/utils/formatter.js'
|
||||
import {ref, reactive, onMounted, nextTick, onBeforeUnmount} from 'vue'
|
||||
import {ElMessage} from 'element-plus'
|
||||
import {genTableRequest} from '@/utils/generator.js'
|
||||
import { labelPosition } from '@/constant/form.js'
|
||||
import {getPrintObj, labelPosition, printObj} from '@/constant/form.js'
|
||||
import {summaryTypeOptions, workStatusOptions, lackStatusOptions} from '@/constant/options.js'
|
||||
import {exportWorkSummaryExcel} from '@/api/excel.js'
|
||||
import {addAllOptionOfOptions} from '@/utils/generator.js'
|
||||
import {loading} from '@/utils/loading'
|
||||
import QrcodeVue from "qrcode.vue";
|
||||
|
||||
/**
|
||||
* 常量定义
|
||||
*/
|
||||
|
|
@ -228,6 +311,8 @@ let baseTableQuery = reactive({
|
|||
let searchQueryFormEntity = reactive({
|
||||
summaryType: 1,
|
||||
workOrder: '',
|
||||
productId: '',
|
||||
singleProductId: '',
|
||||
boxNo: '',
|
||||
lackStatus: -99,
|
||||
workStatus: -99
|
||||
|
|
@ -237,6 +322,21 @@ let rowEditFlag = ref(false)
|
|||
let workIndex = ''
|
||||
let rowEditFormRef = ref()
|
||||
let rowFormEntity = reactive({})
|
||||
|
||||
let showPrintDialog = ref(false)
|
||||
let printRequestFormRef = ref()
|
||||
let printRequestFormEntity = reactive({
|
||||
workOrder: '',
|
||||
productId: '',
|
||||
singleProductId: '',
|
||||
boxNo: '',
|
||||
})
|
||||
let printTabs = ref([])
|
||||
let lackGoodsForPrint = ref([])
|
||||
const printBtn = ref()
|
||||
const printLackGoodsBtn = ref()
|
||||
const size = ref(35)
|
||||
const color = ref('#000000')
|
||||
/**
|
||||
* 系统方法
|
||||
*/
|
||||
|
|
@ -265,6 +365,8 @@ const search = () => {
|
|||
request.summaryType = searchQueryFormEntity.summaryType
|
||||
request.workOrder = searchQueryFormEntity.workOrder.trim()
|
||||
request.boxNo = searchQueryFormEntity.boxNo.trim()
|
||||
request.productId = searchQueryFormEntity.productId.trim()
|
||||
request.singleProductId = searchQueryFormEntity.singleProductId.trim()
|
||||
request.workStatus = searchQueryFormEntity.workStatus == -99 ? null : searchQueryFormEntity.workStatus
|
||||
request.lackStatus = searchQueryFormEntity.lackStatus == -99 ? null : searchQueryFormEntity.lackStatus
|
||||
queryWorkSummaryByPage(request).then((res) => {
|
||||
|
|
@ -290,6 +392,9 @@ const search = () => {
|
|||
}
|
||||
const clearQuery = () => {
|
||||
searchQueryFormEntity.workOrder = ''
|
||||
searchQueryFormEntity.productId = ''
|
||||
searchQueryFormEntity.singleProductId = ''
|
||||
searchQueryFormEntity.boxNo = ''
|
||||
}
|
||||
const handleSortChange = (data) => {
|
||||
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||
|
|
@ -347,7 +452,10 @@ const outGoodsFormat = (row, column, cellValue, index) => {
|
|||
const exportExcel = () => {
|
||||
const params = {
|
||||
summaryType: searchQueryFormEntity.summaryType,
|
||||
workOrder: searchQueryFormEntity.workOrder,
|
||||
workOrder: searchQueryFormEntity.workOrder.trim(),
|
||||
boxNo: searchQueryFormEntity.boxNo.trim(),
|
||||
productId: searchQueryFormEntity.productId.trim(),
|
||||
singleProductId: searchQueryFormEntity.singleProductId.trim(),
|
||||
workStatus: searchQueryFormEntity.workStatus == -99 ? null : searchQueryFormEntity.workStatus,
|
||||
lackStatus: searchQueryFormEntity.lackStatus == -99 ? null : searchQueryFormEntity.lackStatus,
|
||||
standId: STAND_ID,
|
||||
|
|
@ -446,6 +554,91 @@ const submitUpdateRow = (rowFormEntity) => {
|
|||
loading.close()
|
||||
})
|
||||
}
|
||||
// 打印料盒标签
|
||||
const printBoxTags = () => {
|
||||
if (printRequestFormEntity.workOrder.trim() == '' || printRequestFormEntity.boxNo.trim() == '') {
|
||||
ElMessage.error("工单号、料盒号必须。")
|
||||
return
|
||||
}
|
||||
const requestParam = {
|
||||
workOrder: printRequestFormEntity.workOrder.trim(),
|
||||
boxNo: printRequestFormEntity.boxNo.trim(),
|
||||
productId: printRequestFormEntity.productId.trim(),
|
||||
singleProductId: printRequestFormEntity.singleProductId.trim(),
|
||||
standId: STAND_ID,
|
||||
userName: USER_NAME
|
||||
}
|
||||
loading.open('请求标签数据中...')
|
||||
requestPrintBoxTags(requestParam).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
getPrintTabs(response.data)
|
||||
nextTick(() => {
|
||||
printBtn.value.click()
|
||||
});
|
||||
} else {
|
||||
ElMessage.error(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error("请求发生异常")
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
}
|
||||
// 打印缺料标签
|
||||
const printLackTags = () => {
|
||||
if (printRequestFormEntity.workOrder.trim() == '' || printRequestFormEntity.boxNo.trim() == '') {
|
||||
ElMessage.error("工单号、料盒号必须。")
|
||||
return
|
||||
}
|
||||
const requestParam = {
|
||||
workOrder: printRequestFormEntity.workOrder.trim(),
|
||||
boxNo: printRequestFormEntity.boxNo.trim(),
|
||||
productId: printRequestFormEntity.productId.trim(),
|
||||
singleProductId: printRequestFormEntity.singleProductId.trim(),
|
||||
standId: STAND_ID,
|
||||
userName: USER_NAME
|
||||
}
|
||||
loading.open('请求缺料数据中...')
|
||||
getLackGoods(requestParam).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
lackGoodsForPrint.value = response.data
|
||||
nextTick(() => {
|
||||
printLackGoodsBtn.value.click()
|
||||
});
|
||||
} else {
|
||||
ElMessage.error(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error("请求发生异常")
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
}
|
||||
// 获得打印数据
|
||||
const getPrintTabs = (boxSummary) => {
|
||||
printTabs.value = []
|
||||
if (boxSummary != undefined) {
|
||||
for (let i = 1; i <= boxSummary.boxQty; i++) {
|
||||
printTabs.value.push(
|
||||
{
|
||||
workOrder: boxSummary.workOrder,
|
||||
productId: boxSummary.productIdOrigin,
|
||||
singleProductId: boxSummary.singleProductId,
|
||||
boxNo: boxSummary.boxNo,
|
||||
kittingDate: boxSummary.kittingDate,
|
||||
produceDate: boxSummary.produceDate,
|
||||
testNo: boxSummary.testNo,
|
||||
productionQty: boxSummary.productionQty,
|
||||
imageId: boxSummary.imageId,
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.content {
|
||||
|
|
@ -539,8 +732,65 @@ const submitUpdateRow = (rowFormEntity) => {
|
|||
|
||||
.btn-search {
|
||||
height: 30px;
|
||||
width: 80px;
|
||||
width: 100px;
|
||||
margin: auto 5px 5px auto;
|
||||
color: black;
|
||||
}
|
||||
|
||||
@media print {
|
||||
@page {
|
||||
size: auto;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
body,
|
||||
html {
|
||||
height: auto !important;
|
||||
}
|
||||
}
|
||||
|
||||
.objectDialogFlowPrint {
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
}
|
||||
|
||||
.objectDialogFlowPrint .pageWarp {
|
||||
/*这句话很重要,控制时候强制分页 https://www.w3school.com.cn/cssref/pr_page-break-after.asp*/
|
||||
page-break-after: always;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
print-color-adjust: exact;
|
||||
}
|
||||
|
||||
.print-tab-text {
|
||||
width: 40%;
|
||||
align-content: center;
|
||||
}
|
||||
|
||||
.print-tab-image {
|
||||
width: 20%;
|
||||
align-content: center;
|
||||
}
|
||||
|
||||
.print-row-normal {
|
||||
margin: 8px 3px 8px 3px;
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.print-tab-full {
|
||||
width: 90%;
|
||||
align-content: center;
|
||||
}
|
||||
|
||||
.print-row-big {
|
||||
margin: 8px 3px 8px 3px;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.wms_main.controller.wms;
|
||||
|
||||
import com.wms_main.model.bo.wms.BoxSummary;
|
||||
import com.wms_main.model.dto.query.*;
|
||||
import com.wms_main.model.dto.request.wms.*;
|
||||
import com.wms_main.model.dto.response.wms.BaseWmsApiResponse;
|
||||
|
|
@ -164,12 +165,12 @@ public class KateWorkController {
|
|||
|
||||
/**
|
||||
* 查询当前站台待工作的物料列表
|
||||
* @param workSummaryQuery 查询参数
|
||||
* @param kateWorksQuery 查询参数
|
||||
* @return 查询结果
|
||||
*/
|
||||
@PostMapping("/getLackGoods")
|
||||
public WmsApiResponse<List<KateWorkVo>> getLackGoods(@RequestBody WorkSummaryQuery workSummaryQuery) {
|
||||
return kateWorkControllerService.getLackGoods(workSummaryQuery);
|
||||
public WmsApiResponse<List<KateWorkVo>> getLackGoods(@RequestBody KateWorksQuery kateWorksQuery) {
|
||||
return kateWorkControllerService.getLackGoods(kateWorksQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -191,4 +192,14 @@ public class KateWorkController {
|
|||
public BaseWmsApiResponse closeCurrentWorks(@RequestBody UpdateWorkRequest closeWorkRequest) {
|
||||
return kateWorkControllerService.closeCurrentWorks(closeWorkRequest);
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求打印料盒标签
|
||||
* @param kateWorksQuery 查询参数
|
||||
* @return 需要打印的料盒标签
|
||||
*/
|
||||
@PostMapping("/requestPrintBoxTags")
|
||||
WmsApiResponse<BoxSummary> requestPrintBoxTags(@RequestBody KateWorksQuery kateWorksQuery) {
|
||||
return kateWorkControllerService.requestPrintBoxTags(kateWorksQuery);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -180,6 +180,9 @@ public class ExportExcelEasyPoi extends BaseExportExcelEasyPoi implements IExpor
|
|||
// 未关闭订单
|
||||
List<TAppWork> poList = appWorkService.list(new LambdaQueryWrapper<TAppWork>()
|
||||
.like(StringUtils.isNotEmpty(workSummaryQuery.getWorkOrder()), TAppWork::getWorkOrder, workSummaryQuery.getWorkOrder())
|
||||
.like(StringUtils.isNotEmpty(workSummaryQuery.getProductId()), TAppWork::getProductId, workSummaryQuery.getProductId())
|
||||
.like(StringUtils.isNotEmpty(workSummaryQuery.getSingleProductId()), TAppWork::getSingleProductId, workSummaryQuery.getSingleProductId())
|
||||
.like(StringUtils.isNotEmpty(workSummaryQuery.getBoxNo()), TAppWork::getBoxNo, workSummaryQuery.getBoxNo())
|
||||
.eq(workSummaryQuery.getWorkStatus() != null, TAppWork::getWorkStatus, workSummaryQuery.getWorkStatus())
|
||||
.eq(workSummaryQuery.getLackStatus() != null, TAppWork::getLackStatus, workSummaryQuery.getLackStatus()));
|
||||
// excel模版列表
|
||||
|
|
@ -215,6 +218,9 @@ public class ExportExcelEasyPoi extends BaseExportExcelEasyPoi implements IExpor
|
|||
// 已关闭订单
|
||||
List<TAppWorkRecord> poList = appWorkRecordService.list(new LambdaQueryWrapper<TAppWorkRecord>()
|
||||
.like(StringUtils.isNotEmpty(workSummaryQuery.getWorkOrder()), TAppWorkRecord::getWorkOrder, workSummaryQuery.getWorkOrder())
|
||||
.like(StringUtils.isNotEmpty(workSummaryQuery.getProductId()), TAppWorkRecord::getProductId, workSummaryQuery.getProductId())
|
||||
.like(StringUtils.isNotEmpty(workSummaryQuery.getSingleProductId()), TAppWorkRecord::getSingleProductId, workSummaryQuery.getSingleProductId())
|
||||
.like(StringUtils.isNotEmpty(workSummaryQuery.getBoxNo()), TAppWorkRecord::getBoxNo, workSummaryQuery.getBoxNo())
|
||||
.eq(workSummaryQuery.getWorkStatus() != null, TAppWorkRecord::getWorkStatus, workSummaryQuery.getWorkStatus())
|
||||
.eq(workSummaryQuery.getLackStatus() != null, TAppWorkRecord::getLackStatus, workSummaryQuery.getLackStatus()));
|
||||
// excel模版列表
|
||||
|
|
|
|||
|
|
@ -416,6 +416,8 @@ public class ImportExcelEasyPoi extends BaseImportExcelEasyPoi implements IImpor
|
|||
return BaseWmsApiResponse.error("符合条件数据行为0。");
|
||||
}
|
||||
try {
|
||||
// 先清除数据
|
||||
tAppGoodsService.remove(new LambdaQueryWrapper<>());
|
||||
// 保存数据
|
||||
tAppGoodsService.saveOrUpdateBatch(goodsList);
|
||||
// 更新common
|
||||
|
|
@ -468,7 +470,7 @@ public class ImportExcelEasyPoi extends BaseImportExcelEasyPoi implements IImpor
|
|||
}
|
||||
try {
|
||||
// 先移除这些物料的看板
|
||||
tAppKanbanService.remove(new LambdaQueryWrapper<TAppKanban>().in(TAppKanban::getGoodsId, kanbanListMap.keySet()));
|
||||
tAppKanbanService.remove(new LambdaQueryWrapper<>());
|
||||
// 转换保存数据
|
||||
List<TAppKanban> kanbanList = new ArrayList<>();
|
||||
kanbanListMap.values().forEach(kanbanList::addAll);
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import lombok.AllArgsConstructor;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 数据库出库单表映射
|
||||
*/
|
||||
|
|
@ -66,4 +68,9 @@ public class TAppOuts {
|
|||
*/
|
||||
@TableField(value = "reason")
|
||||
private String reason;
|
||||
/**
|
||||
* 请求时间
|
||||
*/
|
||||
@TableField(value = "request_time")
|
||||
private LocalDateTime requestTime;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import lombok.AllArgsConstructor;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 数据库出库单表映射
|
||||
*/
|
||||
|
|
@ -66,4 +68,9 @@ public class TAppOutsRecord {
|
|||
*/
|
||||
@TableField(value = "reason")
|
||||
private String reason;
|
||||
/**
|
||||
* 请求时间
|
||||
*/
|
||||
@TableField(value = "request_time")
|
||||
private LocalDateTime requestTime;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.wms_main.service.controller;
|
||||
|
||||
import com.wms_main.model.bo.wms.BoxSummary;
|
||||
import com.wms_main.model.dto.query.*;
|
||||
import com.wms_main.model.dto.request.wms.*;
|
||||
import com.wms_main.model.dto.response.wms.BaseWmsApiResponse;
|
||||
|
|
@ -112,10 +113,10 @@ public interface IKateWorkControllerService {
|
|||
|
||||
/**
|
||||
* 查询当前站台待工作的物料列表
|
||||
* @param workSummaryQuery 查询参数
|
||||
* @param kateWorksQuery 查询参数
|
||||
* @return 查询结果---分页
|
||||
*/
|
||||
WmsApiResponse<List<KateWorkVo>> getLackGoods(WorkSummaryQuery workSummaryQuery);
|
||||
WmsApiResponse<List<KateWorkVo>> getLackGoods(KateWorksQuery kateWorksQuery);
|
||||
|
||||
/**
|
||||
* 更新当前工作流
|
||||
|
|
@ -130,4 +131,11 @@ public interface IKateWorkControllerService {
|
|||
* @return 关闭结果
|
||||
*/
|
||||
BaseWmsApiResponse closeCurrentWorks(UpdateWorkRequest closeWorkRequest);
|
||||
|
||||
/**
|
||||
* 请求打印料盒标签
|
||||
* @param kateWorksQuery 查询参数
|
||||
* @return 需要打印的料盒标签
|
||||
*/
|
||||
WmsApiResponse<BoxSummary> requestPrintBoxTags(KateWorksQuery kateWorksQuery);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -929,6 +929,9 @@ public class KateWorkControllerServiceImpl implements IKateWorkControllerService
|
|||
Page<TAppWorkRecord> page = workSummaryQuery.toMpPage();
|
||||
LambdaQueryWrapper<TAppWorkRecord> lambdaQueryWrapper = new LambdaQueryWrapper<TAppWorkRecord>()
|
||||
.like(StringUtils.isNotEmpty(workSummaryQuery.getWorkOrder()), TAppWorkRecord::getWorkOrder, workSummaryQuery.getWorkOrder())
|
||||
.like(StringUtils.isNotEmpty(workSummaryQuery.getProductId()), TAppWorkRecord::getProductId, workSummaryQuery.getProductId())
|
||||
.like(StringUtils.isNotEmpty(workSummaryQuery.getSingleProductId()), TAppWorkRecord::getSingleProductId, workSummaryQuery.getSingleProductId())
|
||||
.like(StringUtils.isNotEmpty(workSummaryQuery.getBoxNo()), TAppWorkRecord::getBoxNo, workSummaryQuery.getBoxNo())
|
||||
.eq(workSummaryQuery.getWorkStatus() != null, TAppWorkRecord::getWorkStatus, workSummaryQuery.getWorkStatus())
|
||||
.eq(workSummaryQuery.getLackStatus() != null, TAppWorkRecord::getLackStatus, workSummaryQuery.getLackStatus());
|
||||
Page<TAppWorkRecord> pagePo = appWorkRecordService.page(page, lambdaQueryWrapper);
|
||||
|
|
@ -973,19 +976,19 @@ public class KateWorkControllerServiceImpl implements IKateWorkControllerService
|
|||
/**
|
||||
* 查询缺料列表
|
||||
*
|
||||
* @param workSummaryQuery 查询参数
|
||||
* @param kateWorksQuery 查询参数
|
||||
* @return 查询结果
|
||||
*/
|
||||
@Override
|
||||
public WmsApiResponse<List<KateWorkVo>> getLackGoods(WorkSummaryQuery workSummaryQuery) {
|
||||
if (workSummaryQuery == null) {
|
||||
public WmsApiResponse<List<KateWorkVo>> getLackGoods(KateWorksQuery kateWorksQuery) {
|
||||
if (kateWorksQuery == null) {
|
||||
return WmsApiResponse.error("查询参数为空。", null);
|
||||
}
|
||||
LambdaQueryWrapper<TAppWork> lambdaQueryWrapper = new LambdaQueryWrapper<TAppWork>()
|
||||
.eq(TAppWork::getWorkOrder, workSummaryQuery.getWorkOrder())
|
||||
.eq(TAppWork::getProductId, workSummaryQuery.getProductId())
|
||||
.eq(StringUtils.isNotEmpty(workSummaryQuery.getSingleProductId()), TAppWork::getSingleProductId, workSummaryQuery.getSingleProductId())
|
||||
.eq(TAppWork::getBoxNo, workSummaryQuery.getBoxNo())
|
||||
.eq(TAppWork::getWorkOrder, kateWorksQuery.getWorkOrder())
|
||||
.eq(StringUtils.isNotEmpty(kateWorksQuery.getProductId()), TAppWork::getProductId, kateWorksQuery.getProductId())
|
||||
.eq(StringUtils.isNotEmpty(kateWorksQuery.getSingleProductId()), TAppWork::getSingleProductId, kateWorksQuery.getSingleProductId())
|
||||
.eq(TAppWork::getBoxNo, kateWorksQuery.getBoxNo())
|
||||
.eq(TAppWork::getLackStatus, 1);
|
||||
List<TAppWork> poList = appWorkService.list(lambdaQueryWrapper);
|
||||
if (poList == null || poList.isEmpty()) {
|
||||
|
|
@ -1070,6 +1073,116 @@ public class KateWorkControllerServiceImpl implements IKateWorkControllerService
|
|||
return BaseWmsApiResponse.success("关闭缺料工作成功。");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取料盒打印标签数量
|
||||
* @param kateWorksQuery 查询参数
|
||||
* @return 标签信息
|
||||
*/
|
||||
@Override
|
||||
public WmsApiResponse<BoxSummary> requestPrintBoxTags(KateWorksQuery kateWorksQuery) {
|
||||
if (kateWorksQuery == null) {
|
||||
// 站台号不能为空
|
||||
return WmsApiResponse.error("请求为空。", null);
|
||||
}
|
||||
if (StringUtils.isEmpty(kateWorksQuery.getWorkOrder())) {
|
||||
return WmsApiResponse.error("请求缺少工单号。", null);
|
||||
}
|
||||
if (StringUtils.isEmpty(kateWorksQuery.getBoxNo())) {
|
||||
return WmsApiResponse.error("请求缺少料盒号。", null);
|
||||
}
|
||||
// 查询对应的dbs
|
||||
List<TAppDbs> dbsList = appDbsService.list(new LambdaQueryWrapper<TAppDbs>()
|
||||
.eq(TAppDbs::getWorkOrder, kateWorksQuery.getWorkOrder()));
|
||||
if (dbsList == null || dbsList.isEmpty()) {
|
||||
return WmsApiResponse.error("DBS数据异常:不存在工单" + kateWorksQuery.getWorkOrder() + "。", null);
|
||||
}
|
||||
TAppDbs thisDbs = dbsList.getFirst();
|
||||
// 计划产量
|
||||
int planProduction = thisDbs.getPlanProduction();
|
||||
// 结果集
|
||||
BoxSummary boxSummary = new BoxSummary();
|
||||
boxSummary.setWorkOrder(thisDbs.getWorkOrder());
|
||||
boxSummary.setTaoQty(planProduction);
|
||||
boxSummary.setSingleProductId(kateWorksQuery.getSingleProductId());
|
||||
boxSummary.setBoxNo(kateWorksQuery.getBoxNo());
|
||||
// 设置打印标签相关的信息
|
||||
boxSummary.setProductIdOrigin(thisDbs.getProductIdOrigin());
|
||||
boxSummary.setKittingDate(thisDbs.getTestPlanStartDate());
|
||||
boxSummary.setProduceDate(thisDbs.getPntPlanStartDate());
|
||||
boxSummary.setTestNo(thisDbs.getTestNo());
|
||||
boxSummary.setProductionQty(planProduction);
|
||||
// 服务件
|
||||
List<TAppSingleProduct> singleProductList;
|
||||
// 非服务件
|
||||
List<TAppProduct> productList = new ArrayList<>();
|
||||
// 查询对应料盒信息
|
||||
String queryProductId = thisDbs.getProductIdOrigin();
|
||||
if (StringUtils.isNotEmpty(kateWorksQuery.getSingleProductId())) {
|
||||
// 输入单片号
|
||||
queryProductId = kateWorksQuery.getSingleProductId();
|
||||
// 查询服务件
|
||||
singleProductList = appSingleProductService.list(new LambdaQueryWrapper<TAppSingleProduct>()
|
||||
.eq(TAppSingleProduct::getProductId, queryProductId)
|
||||
.eq(TAppSingleProduct::getBoxNo, kateWorksQuery.getBoxNo()));
|
||||
if (singleProductList.isEmpty()) {
|
||||
// 查询非服务件
|
||||
productList = appProductService.list(new LambdaQueryWrapper<TAppProduct>()
|
||||
.eq(TAppProduct::getProductId, queryProductId)
|
||||
.eq(TAppProduct::getBoxNo, kateWorksQuery.getBoxNo()));
|
||||
}
|
||||
} else {
|
||||
// 查询服务件
|
||||
singleProductList = appSingleProductService.list(new LambdaQueryWrapper<TAppSingleProduct>()
|
||||
.eq(TAppSingleProduct::getProductId, queryProductId)
|
||||
.eq(TAppSingleProduct::getBoxNo, kateWorksQuery.getBoxNo()));
|
||||
if (singleProductList.isEmpty()) {
|
||||
queryProductId = thisDbs.getProductId();
|
||||
// 查询非服务件
|
||||
productList = appProductService.list(new LambdaQueryWrapper<TAppProduct>()
|
||||
.eq(TAppProduct::getProductId, queryProductId)
|
||||
.eq(TAppProduct::getBoxNo, kateWorksQuery.getBoxNo()));
|
||||
}
|
||||
}
|
||||
if (singleProductList.isEmpty() && productList.isEmpty()) {
|
||||
return WmsApiResponse.error("数据异常:配料单信息缺失。", null);
|
||||
}
|
||||
// 查询到对应的图纸信息
|
||||
List<TAppImage> imageList = appImageService.list(new LambdaQueryWrapper<TAppImage>()
|
||||
.eq(TAppImage::getProductId, queryProductId)
|
||||
.eq(TAppImage::getBoxNo, kateWorksQuery.getBoxNo()));
|
||||
if (imageList != null && !imageList.isEmpty()) {
|
||||
boxSummary.setImageId(imageList.getFirst().getImageId());
|
||||
}
|
||||
// 最大料盒数量
|
||||
int maxBoxQty = 0;
|
||||
if (!singleProductList.isEmpty()) {
|
||||
boxSummary.setProductId(thisDbs.getProductIdOrigin());
|
||||
// 处理服务件
|
||||
for (TAppSingleProduct singleProduct : singleProductList) {
|
||||
// 设置料盒数量
|
||||
int tempBoxQty = Math.ceilDiv(planProduction, singleProduct.getQuantityOfPair());
|
||||
if (tempBoxQty > maxBoxQty) {
|
||||
maxBoxQty = tempBoxQty;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!productList.isEmpty()) {
|
||||
// 处理非服务件
|
||||
boxSummary.setProductId(thisDbs.getProductId());
|
||||
for (TAppProduct product : productList) {
|
||||
// 设置料盒数量
|
||||
int tempBoxQty = Math.ceilDiv(planProduction, product.getQuantityOfPair());
|
||||
if (tempBoxQty > maxBoxQty) {
|
||||
maxBoxQty = tempBoxQty;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 设置料盒数量
|
||||
boxSummary.setBoxQty(maxBoxQty);
|
||||
return WmsApiResponse.success("获取料盒标签数据成功。", boxSummary);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取服务件成品号的物料需求
|
||||
*
|
||||
|
|
@ -1296,8 +1409,14 @@ public class KateWorkControllerServiceImpl implements IKateWorkControllerService
|
|||
.set(TAppStandWork::getPutArea, "")
|
||||
.eq(TAppStandWork::getStandId, confirmWorkRequest.getStandId()));
|
||||
// 清除拣选计划
|
||||
appPickPlanService.remove(new LambdaQueryWrapper<TAppPickPlan>()
|
||||
.eq(TAppPickPlan::getWorkIndex, confirmWorkRequest.getOrderConfirm().getWorkIndex()));
|
||||
// 清除拣选计划
|
||||
LambdaQueryWrapper<TAppPickPlan> pickPlanQueryWrapper = new LambdaQueryWrapper<TAppPickPlan>()
|
||||
.eq(TAppPickPlan::getWorkIndex, confirmWorkRequest.getOrderConfirm().getWorkIndex());
|
||||
if (confirmWorkRequest.getStockConfirm() != null && StringUtils.isNotEmpty(confirmWorkRequest.getStockConfirm().getVehicleId())) {
|
||||
// 箱号
|
||||
pickPlanQueryWrapper.eq(TAppPickPlan::getVehicleId, confirmWorkRequest.getStockConfirm().getVehicleId());
|
||||
}
|
||||
appPickPlanService.remove(pickPlanQueryWrapper);
|
||||
return "";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -316,7 +316,8 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
|||
stockOutRequest.getOutType(),
|
||||
stockOutRequest.getDestination(),
|
||||
stockOutRequest.getUserName(),
|
||||
stockOutRequest.getReason()
|
||||
stockOutRequest.getReason(),
|
||||
LocalDateTime.now()
|
||||
);
|
||||
appOutsService.save(task);
|
||||
return BaseWmsApiResponse.success("添加出库请求成功。");
|
||||
|
|
@ -381,7 +382,8 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
|||
WmsOutTypeEnums.FOR_IN.getCode(),
|
||||
"R1",
|
||||
voiRequest.getUserName(),
|
||||
""
|
||||
"",
|
||||
LocalDateTime.now()
|
||||
));
|
||||
}
|
||||
|
||||
|
|
@ -773,7 +775,8 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
|||
outs.getOutType(),
|
||||
outs.getDestination(),
|
||||
outs.getUserName(),
|
||||
outs.getReason()
|
||||
outs.getReason(),
|
||||
outs.getRequestTime()
|
||||
);
|
||||
// 删除出库单
|
||||
appOutsService.removeById(outs.getTaskId());
|
||||
|
|
@ -784,8 +787,13 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
|||
appOutsService.updateById(outs);
|
||||
}
|
||||
// 清除拣选计划
|
||||
appPickPlanService.remove(new LambdaQueryWrapper<TAppPickPlan>()
|
||||
.eq(TAppPickPlan::getWorkIndex, confirmTaskRequest.getTaskConfirm().getTaskId()));
|
||||
LambdaQueryWrapper<TAppPickPlan> pickPlanQueryWrapper = new LambdaQueryWrapper<TAppPickPlan>()
|
||||
.eq(TAppPickPlan::getWorkIndex, confirmTaskRequest.getTaskConfirm().getTaskId());
|
||||
if (confirmTaskRequest.getStockConfirm() != null && StringUtils.isNotEmpty(confirmTaskRequest.getStockConfirm().getVehicleId())) {
|
||||
// 箱号
|
||||
pickPlanQueryWrapper.eq(TAppPickPlan::getVehicleId, confirmTaskRequest.getStockConfirm().getVehicleId());
|
||||
}
|
||||
appPickPlanService.remove(pickPlanQueryWrapper);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1207,7 +1207,8 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
|||
thisOuts.getOutType(),
|
||||
thisOuts.getDestination(),
|
||||
thisOuts.getUserName(),
|
||||
thisOuts.getReason()
|
||||
thisOuts.getReason(),
|
||||
thisOuts.getRequestTime()
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,10 @@ spring:
|
|||
# url: jdbc:mysql://112.4.208.194:3001/wms_kate_wuxi?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||
# username: developer
|
||||
# password: developer
|
||||
# 本地
|
||||
# url: jdbc:mysql://localhost:3306/wms_kate_wuxi_test?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
|
||||
# username: root
|
||||
# password: liangzhou
|
||||
# 卡特服务器
|
||||
url: jdbc:mysql://10.90.83.37:3306/wms_kate_wuxi?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
|
||||
username: developer
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user