12个文件已修改
	
		
		2 文件已重命名
	
		
		3个文件已添加
	
	
 
	
	
	
	
	
	
	
	
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | get("/api/order/" + newVal, {}).then((resp) => { | 
|---|
|  |  |  | let result = resp.data; | 
|---|
|  |  |  | orderInfo.value = result.data; | 
|---|
|  |  |  | if(result.data != null) { | 
|---|
|  |  |  | orderInfo.value = result.data; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | get("/api/orderLog/" + newVal, {}).then((resp) => { | 
|---|
|  |  |  | let result = resp.data; | 
|---|
|  |  |  | orderInfo.value = result.data; | 
|---|
|  |  |  | if(result.data != null) { | 
|---|
|  |  |  | orderInfo.value = result.data; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <script> | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | name: 'showOrderDetlComponent' | 
|---|
|  |  |  | name: 'showOrderDetlLogComponent' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  |  | 
|---|
| New file | 
|  |  |  | 
|---|
|  |  |  | <script setup> | 
|---|
|  |  |  | import { getCurrentInstance, ref, watch, reactive } from 'vue'; | 
|---|
|  |  |  | import { useRouter } from "vue-router"; | 
|---|
|  |  |  | import { get, post, postForm } from '@/utils/request.js' | 
|---|
|  |  |  | import { message, Modal } from 'ant-design-vue'; | 
|---|
|  |  |  | import { logout } from '@/config.js'; | 
|---|
|  |  |  | import { formatMessage } from '@/utils/localeUtils.js'; | 
|---|
|  |  |  | import useTableSearch from '@/utils/tableUtils.jsx'; | 
|---|
|  |  |  | import ShowOrderDetlLogComponent from '@/components/orderDetlLog/show.vue'; | 
|---|
|  |  |  | const context = getCurrentInstance()?.appContext.config.globalProperties; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const router = useRouter(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const TABLE_KEY = 'table-locDetl'; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | let tableData = ref([]); | 
|---|
|  |  |  | let open = ref(false); | 
|---|
|  |  |  | const taskId = ref(null); | 
|---|
|  |  |  | const taskInfo = ref({ | 
|---|
|  |  |  | taskNo: '', | 
|---|
|  |  |  | taskSts$: '', | 
|---|
|  |  |  | taskType$: '', | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | const showWidth = ref("60%") | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const showOrderDetlChild = ref(null) | 
|---|
|  |  |  | getColumns(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const { | 
|---|
|  |  |  | getColumnSearchProps, | 
|---|
|  |  |  | } = useTableSearch(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const state = reactive({ | 
|---|
|  |  |  | selectedRowKeys: [], | 
|---|
|  |  |  | loading: false, | 
|---|
|  |  |  | columns: [], | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | state.columns = [ | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: '#', | 
|---|
|  |  |  | dataIndex: '_id', | 
|---|
|  |  |  | width: 60, | 
|---|
|  |  |  | ellipsis: true, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: formatMessage('db.man_task_detl.task_no', '任务编号'), | 
|---|
|  |  |  | dataIndex: 'taskNo', | 
|---|
|  |  |  | width: 140, | 
|---|
|  |  |  | ellipsis: true, | 
|---|
|  |  |  | ...getColumnSearchProps('taskNo'), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: formatMessage('db.man_task_detl.matnr', '物料号'), | 
|---|
|  |  |  | dataIndex: ['mat$', 'matnr'], | 
|---|
|  |  |  | width: 140, | 
|---|
|  |  |  | ellipsis: true, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: formatMessage('db.man_task_detl.maktx', '物料名'), | 
|---|
|  |  |  | dataIndex: ['mat$', 'maktx'], | 
|---|
|  |  |  | width: 140, | 
|---|
|  |  |  | ellipsis: true, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: formatMessage('db.man_task_detl.anfme', '数量'), | 
|---|
|  |  |  | dataIndex: 'anfme', | 
|---|
|  |  |  | width: 140, | 
|---|
|  |  |  | ellipsis: true, | 
|---|
|  |  |  | ...getColumnSearchProps('anfme'), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: formatMessage('db.man_task_detl.stock', '库存'), | 
|---|
|  |  |  | dataIndex: 'stock', | 
|---|
|  |  |  | width: 140, | 
|---|
|  |  |  | ellipsis: true, | 
|---|
|  |  |  | ...getColumnSearchProps('stock'), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: formatMessage('db.man_task_detl.batch', '批号'), | 
|---|
|  |  |  | dataIndex: 'batch', | 
|---|
|  |  |  | width: 140, | 
|---|
|  |  |  | ellipsis: true, | 
|---|
|  |  |  | ...getColumnSearchProps('batch'), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: formatMessage('db.man_task_detl.barcode', '托盘码'), | 
|---|
|  |  |  | dataIndex: 'barcode', | 
|---|
|  |  |  | width: 140, | 
|---|
|  |  |  | ellipsis: true, | 
|---|
|  |  |  | ...getColumnSearchProps('barcode'), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: formatMessage('db.man_task_detl.order_no', '订单编号'), | 
|---|
|  |  |  | dataIndex: 'orderNo', | 
|---|
|  |  |  | width: 140, | 
|---|
|  |  |  | ellipsis: true, | 
|---|
|  |  |  | ...getColumnSearchProps('orderNo'), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | ]; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const fieldList = []; | 
|---|
|  |  |  | //加载扩展字段 | 
|---|
|  |  |  | async function getColumns() { | 
|---|
|  |  |  | let fieldResp = await post('/api/matField/list', { | 
|---|
|  |  |  | fieldType: 1 | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | let fieldResult = fieldResp.data; | 
|---|
|  |  |  | let tmp = state.columns; | 
|---|
|  |  |  | if (fieldResult.code == 200) { | 
|---|
|  |  |  | let data = fieldResult.data; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | data.forEach((item) => { | 
|---|
|  |  |  | tmp.push({ | 
|---|
|  |  |  | title: formatMessage(item.language, item.describe), | 
|---|
|  |  |  | name: item.name, | 
|---|
|  |  |  | dataIndex: item.name, | 
|---|
|  |  |  | key: item.name, | 
|---|
|  |  |  | width: 140, | 
|---|
|  |  |  | editable: true, | 
|---|
|  |  |  | }) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | fieldList.push(item.name); | 
|---|
|  |  |  | }) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // tmp.push({ | 
|---|
|  |  |  | //     title: formatMessage('common.operation', '操作'), | 
|---|
|  |  |  | //     name: 'oper', | 
|---|
|  |  |  | //     dataIndex: 'oper', | 
|---|
|  |  |  | //     key: 'oper', | 
|---|
|  |  |  | //     width: 140, | 
|---|
|  |  |  | // }) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | state.columns = tmp; | 
|---|
|  |  |  | } else if (result.code === 401) { | 
|---|
|  |  |  | message.error(result.msg); | 
|---|
|  |  |  | logout() | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | message.error(result.msg); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const handleOk = () => { | 
|---|
|  |  |  | open.value = false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const handleCancel = () => { | 
|---|
|  |  |  | open.value = false; | 
|---|
|  |  |  | taskId.value = null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | watch(taskId, (newVal, oldVal) => { | 
|---|
|  |  |  | if (newVal != null) { | 
|---|
|  |  |  | get("/api/taskDetlLog/taskId/" + newVal, {}).then((resp) => { | 
|---|
|  |  |  | let result = resp.data; | 
|---|
|  |  |  | let index = 1; | 
|---|
|  |  |  | let tmp = []; | 
|---|
|  |  |  | result.data.forEach((item) => { | 
|---|
|  |  |  | item['_id'] = index++; | 
|---|
|  |  |  | tmp.push(item) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | tableData.value = tmp; | 
|---|
|  |  |  | }) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | get("/api/taskLog/" + newVal, {}).then((resp) => { | 
|---|
|  |  |  | let result = resp.data; | 
|---|
|  |  |  | taskInfo.value = result.data; | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const openOrderDetl = (record) => { | 
|---|
|  |  |  | showOrderDetlChild.value.openDetl = true; | 
|---|
|  |  |  | showOrderDetlChild.value.orderId = record.orderId; | 
|---|
|  |  |  | showOrderDetlChild.value.showWidth = '55%' | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | defineExpose({ | 
|---|
|  |  |  | tableData, | 
|---|
|  |  |  | taskId, | 
|---|
|  |  |  | open, | 
|---|
|  |  |  | showWidth, | 
|---|
|  |  |  | }) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <script> | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | name: 'showOrderDetlLogComponent' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <template> | 
|---|
|  |  |  | <div> | 
|---|
|  |  |  | <a-modal v-model:open="open" :width="showWidth" @ok="handleOk" @cancel="handleCancel"> | 
|---|
|  |  |  | <div class="component-header"> | 
|---|
|  |  |  | <div> | 
|---|
|  |  |  | <h3> | 
|---|
|  |  |  | 任务编号:{{ taskInfo.taskNo }} | 
|---|
|  |  |  | </h3> | 
|---|
|  |  |  | <h3> | 
|---|
|  |  |  | 任务状态:{{ taskInfo.taskSts$ }} | 
|---|
|  |  |  | </h3> | 
|---|
|  |  |  | <h3> | 
|---|
|  |  |  | 任务类型:{{ taskInfo.taskType$ }} | 
|---|
|  |  |  | </h3> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="qrcode"> | 
|---|
|  |  |  | <a-qrcode :value="taskInfo.taskNo" :size="100" :bordered="false" /> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <a-table :data-source="tableData" :defaultExpandAllRows="false" :key="TABLE_KEY" rowKey="id" | 
|---|
|  |  |  | :scroll="{ y: 768 }" :columns="state.columns"> | 
|---|
|  |  |  | <template #bodyCell="{ column, text, record }"> | 
|---|
|  |  |  | <template v-if="column.dataIndex === 'orderNo'"> | 
|---|
|  |  |  | <a-button type="link" @click="openOrderDetl(record)">{{ text }}</a-button> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </a-table> | 
|---|
|  |  |  | </a-modal> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <ShowOrderDetlLogComponent ref="showOrderDetlChild" /> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <style> | 
|---|
|  |  |  | .component-header { | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .component-header>div { | 
|---|
|  |  |  | flex: 1; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .qrcode { | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | justify-content: flex-end; | 
|---|
|  |  |  | margin-right: 30px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </style> | 
|---|
| New file | 
|  |  |  | 
|---|
|  |  |  | <script setup> | 
|---|
|  |  |  | import { ref, nextTick } from 'vue'; | 
|---|
|  |  |  | import { get, post, postBlob, postForm } from '@/utils/request.js' | 
|---|
|  |  |  | import { formatMessage } from '@/utils/localeUtils.js'; | 
|---|
|  |  |  | import { message } from 'ant-design-vue'; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const formTable = ref(null); | 
|---|
|  |  |  | const submitButton = ref(null); | 
|---|
|  |  |  | const isSave = ref(true); | 
|---|
|  |  |  | const open = ref(false); | 
|---|
|  |  |  | const initFormData = {} | 
|---|
|  |  |  | let formData = ref(initFormData); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const emit = defineEmits(['tableReload']) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const handleOk = (e) => { | 
|---|
|  |  |  | nextTick(() => { | 
|---|
|  |  |  | setTimeout(() => { | 
|---|
|  |  |  | submitButton.value.$el.click(); | 
|---|
|  |  |  | }, 100); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const onFinish = values => { | 
|---|
|  |  |  | // console.log('Success:', values); | 
|---|
|  |  |  | open.value = false; | 
|---|
|  |  |  | post(isSave.value ? '/api/task/save' : '/api/task/update', formData.value).then((resp) => { | 
|---|
|  |  |  | let result = resp.data; | 
|---|
|  |  |  | if (result.code === 200) { | 
|---|
|  |  |  | message.success(isSave.value ? formatMessage('page.add.success', '新增成功') : formatMessage('page.update.success', '更新成功')); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | message.error(result.msg); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | emit('tableReload', 'reload') | 
|---|
|  |  |  | nextTick(() => { | 
|---|
|  |  |  | formTable.value.resetFields() | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | const onFinishFailed = errorInfo => { | 
|---|
|  |  |  | console.log('Failed:', errorInfo); | 
|---|
|  |  |  | }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const taskStsQueryList = ref(null); | 
|---|
|  |  |  | taskStsQuery(); | 
|---|
|  |  |  | function taskStsQuery() { | 
|---|
|  |  |  | postForm('/api/taskSts/query', {}).then(resp => { | 
|---|
|  |  |  | let result = resp.data; | 
|---|
|  |  |  | taskStsQueryList.value = result.data; | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | const taskTypeQueryList = ref(null); | 
|---|
|  |  |  | taskTypeQuery(); | 
|---|
|  |  |  | function taskTypeQuery() { | 
|---|
|  |  |  | postForm('/api/taskType/query', {}).then(resp => { | 
|---|
|  |  |  | let result = resp.data; | 
|---|
|  |  |  | taskTypeQueryList.value = result.data; | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | const userQueryList = ref(null); | 
|---|
|  |  |  | userQuery(); | 
|---|
|  |  |  | function userQuery() { | 
|---|
|  |  |  | postForm('/api/user/query', {}).then(resp => { | 
|---|
|  |  |  | let result = resp.data; | 
|---|
|  |  |  | userQueryList.value = result.data; | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | defineExpose({ | 
|---|
|  |  |  | open, | 
|---|
|  |  |  | formData, | 
|---|
|  |  |  | initFormData, | 
|---|
|  |  |  | isSave, | 
|---|
|  |  |  | }) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <script> | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | name: '任务管理-edit' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <template> | 
|---|
|  |  |  | <div> | 
|---|
|  |  |  | <a-modal v-model:open="open" | 
|---|
|  |  |  | :title="isSave ? formatMessage('page.add', '添加') : formatMessage('page.edit', '编辑')" @ok="handleOk" | 
|---|
|  |  |  | style="width: 600px;"> | 
|---|
|  |  |  | <a-form :model="formData" ref="formTable" name="formTable" :label-col="{ span: 8 }" | 
|---|
|  |  |  | :wrapper-col="{ span: 16 }" style="display: flex;justify-content: space-between;flex-wrap: wrap;" | 
|---|
|  |  |  | autocomplete="off" @finish="onFinish" @finishFailed="onFinishFailed"> | 
|---|
|  |  |  | <a-form-item :label="formatMessage('db.man_task.task_no', '任务编号')" name="taskNo" style="width: 250px;"> | 
|---|
|  |  |  | <a-input v-model:value="formData.taskNo" /> | 
|---|
|  |  |  | </a-form-item> | 
|---|
|  |  |  | <a-form-item :label="formatMessage('db.man_task.task_sts', '任务状态')" name="taskSts" | 
|---|
|  |  |  | style="width: 250px;"> | 
|---|
|  |  |  | <a-select v-model:value="formData.taskSts" :placeholder="formatMessage('common.select', '请选择')" | 
|---|
|  |  |  | style="width: 100%" show-search :options="taskStsQueryList" optionFilterProp="label" | 
|---|
|  |  |  | optionLabelProp="label"> | 
|---|
|  |  |  | </a-select> | 
|---|
|  |  |  | </a-form-item> | 
|---|
|  |  |  | <a-form-item :label="formatMessage('db.man_task.task_type', '任务类型')" name="taskType" | 
|---|
|  |  |  | style="width: 250px;"> | 
|---|
|  |  |  | <a-select v-model:value="formData.taskType" :placeholder="formatMessage('common.select', '请选择')" | 
|---|
|  |  |  | style="width: 100%" show-search :options="taskTypeQueryList" optionFilterProp="label" | 
|---|
|  |  |  | optionLabelProp="label"> | 
|---|
|  |  |  | </a-select> | 
|---|
|  |  |  | </a-form-item> | 
|---|
|  |  |  | <a-form-item :label="formatMessage('db.man_task.io_pri', '优先级')" name="ioPri" style="width: 250px;"> | 
|---|
|  |  |  | <a-input v-model:value="formData.ioPri" /> | 
|---|
|  |  |  | </a-form-item> | 
|---|
|  |  |  | <a-form-item :label="formatMessage('db.man_task.origin_loc', '源库位')" name="originLoc" | 
|---|
|  |  |  | style="width: 250px;"> | 
|---|
|  |  |  | <a-input v-model:value="formData.originLoc" /> | 
|---|
|  |  |  | </a-form-item> | 
|---|
|  |  |  | <a-form-item :label="formatMessage('db.man_task.target_loc', '目标库位')" name="targetLoc" | 
|---|
|  |  |  | style="width: 250px;"> | 
|---|
|  |  |  | <a-input v-model:value="formData.targetLoc" /> | 
|---|
|  |  |  | </a-form-item> | 
|---|
|  |  |  | <a-form-item :label="formatMessage('db.man_task.origin_site', '源站点')" name="originSite" | 
|---|
|  |  |  | style="width: 250px;"> | 
|---|
|  |  |  | <a-input v-model:value="formData.originSite" /> | 
|---|
|  |  |  | </a-form-item> | 
|---|
|  |  |  | <a-form-item :label="formatMessage('db.man_task.target_site', '目标站点')" name="targetSite" | 
|---|
|  |  |  | style="width: 250px;"> | 
|---|
|  |  |  | <a-input v-model:value="formData.targetSite" /> | 
|---|
|  |  |  | </a-form-item> | 
|---|
|  |  |  | <a-form-item :label="formatMessage('db.man_task.barcode', '托盘码')" name="barcode" style="width: 250px;"> | 
|---|
|  |  |  | <a-input v-model:value="formData.barcode" /> | 
|---|
|  |  |  | </a-form-item> | 
|---|
|  |  |  | <a-form-item :label="formatMessage('db.man_task.status', '状态')" name="status" style="width: 250px;"> | 
|---|
|  |  |  | <a-select v-model:value="formData.status" :options="[ | 
|---|
|  |  |  | { label: '正常', value: 1 }, | 
|---|
|  |  |  | { label: '禁用', value: 0 }, | 
|---|
|  |  |  | ]"> | 
|---|
|  |  |  | </a-select> | 
|---|
|  |  |  | </a-form-item> | 
|---|
|  |  |  | <a-form-item :label="formatMessage('db.man_task.create_time', '添加时间')" name="createTime" | 
|---|
|  |  |  | style="width: 250px;"> | 
|---|
|  |  |  | <a-date-picker v-model:value="formData.createTime" show-time format="YYYY-MM-DD HH:mm:ss" | 
|---|
|  |  |  | value-format="YYYY-MM-DD HH:mm:ss" /> | 
|---|
|  |  |  | </a-form-item> | 
|---|
|  |  |  | <a-form-item :label="formatMessage('db.man_task.create_by', '添加人员')" name="createBy" | 
|---|
|  |  |  | style="width: 250px;"> | 
|---|
|  |  |  | <a-select v-model:value="formData.createBy" :placeholder="formatMessage('common.select', '请选择')" | 
|---|
|  |  |  | style="width: 100%" show-search :options="userQueryList" optionFilterProp="label" | 
|---|
|  |  |  | optionLabelProp="label"> | 
|---|
|  |  |  | </a-select> | 
|---|
|  |  |  | </a-form-item> | 
|---|
|  |  |  | <a-form-item :label="formatMessage('db.man_task.update_time', '修改时间')" name="updateTime" | 
|---|
|  |  |  | style="width: 250px;"> | 
|---|
|  |  |  | <a-date-picker v-model:value="formData.updateTime" show-time format="YYYY-MM-DD HH:mm:ss" | 
|---|
|  |  |  | value-format="YYYY-MM-DD HH:mm:ss" /> | 
|---|
|  |  |  | </a-form-item> | 
|---|
|  |  |  | <a-form-item :label="formatMessage('db.man_task.update_by', '修改人员')" name="updateBy" | 
|---|
|  |  |  | style="width: 250px;"> | 
|---|
|  |  |  | <a-select v-model:value="formData.updateBy" :placeholder="formatMessage('common.select', '请选择')" | 
|---|
|  |  |  | style="width: 100%" show-search :options="userQueryList" optionFilterProp="label" | 
|---|
|  |  |  | optionLabelProp="label"> | 
|---|
|  |  |  | </a-select> | 
|---|
|  |  |  | </a-form-item> | 
|---|
|  |  |  | <a-form-item :label="formatMessage('db.man_task.memo', '备注')" name="memo" style="width: 250px;"> | 
|---|
|  |  |  | <a-input v-model:value="formData.memo" /> | 
|---|
|  |  |  | </a-form-item> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <a-form-item> | 
|---|
|  |  |  | <a-button type="primary" html-type="submit" ref="submitButton" | 
|---|
|  |  |  | style="visibility: hidden;">Submit</a-button> | 
|---|
|  |  |  | </a-form-item> | 
|---|
|  |  |  | </a-form> | 
|---|
|  |  |  | </a-modal> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <style></style> | 
|---|
| New file | 
|  |  |  | 
|---|
|  |  |  | <script setup> | 
|---|
|  |  |  | import { getCurrentInstance, ref, computed, reactive } from 'vue'; | 
|---|
|  |  |  | import { useRouter } from "vue-router"; | 
|---|
|  |  |  | import { get, post, postBlob } from '@/utils/request.js' | 
|---|
|  |  |  | import { message, Modal } from 'ant-design-vue'; | 
|---|
|  |  |  | import { logout } from '@/config.js'; | 
|---|
|  |  |  | import EditView from './edit.vue' | 
|---|
|  |  |  | import { formatMessage } from '@/utils/localeUtils.js'; | 
|---|
|  |  |  | import useTableSearch from '@/utils/tableUtils.jsx'; | 
|---|
|  |  |  | import ShowTaskDetlLogComponent from '@/components/taskLog/showTaskDetlLog/index.vue'; | 
|---|
|  |  |  | const context = getCurrentInstance()?.appContext.config.globalProperties; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const router = useRouter(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const TABLE_KEY = 'table-task'; | 
|---|
|  |  |  | let currentPage = 1; | 
|---|
|  |  |  | let pageSize = 10; | 
|---|
|  |  |  | const searchInput = ref("") | 
|---|
|  |  |  | const editChild = ref(null) | 
|---|
|  |  |  | const showTaskDetlChild = ref(null) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | let tableData = ref([]); | 
|---|
|  |  |  | getPage(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const { | 
|---|
|  |  |  | getColumnSearchProps, | 
|---|
|  |  |  | handleResizeColumn, | 
|---|
|  |  |  | } = useTableSearch(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const columns = [ | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: formatMessage('db.man_task.task_no', '任务编号'), | 
|---|
|  |  |  | dataIndex: 'taskNo', | 
|---|
|  |  |  | width: 140, | 
|---|
|  |  |  | ellipsis: true, | 
|---|
|  |  |  | ...getColumnSearchProps('taskNo'), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: formatMessage('db.man_task.task_sts', '任务状态'), | 
|---|
|  |  |  | dataIndex: 'taskSts$', | 
|---|
|  |  |  | width: 140, | 
|---|
|  |  |  | ellipsis: true, | 
|---|
|  |  |  | ...getColumnSearchProps('taskSts$'), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: formatMessage('db.man_task.task_type', '任务类型'), | 
|---|
|  |  |  | dataIndex: 'taskType$', | 
|---|
|  |  |  | width: 140, | 
|---|
|  |  |  | ellipsis: true, | 
|---|
|  |  |  | ...getColumnSearchProps('taskType$'), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: formatMessage('db.man_task.io_pri', '优先级'), | 
|---|
|  |  |  | dataIndex: 'ioPri', | 
|---|
|  |  |  | width: 140, | 
|---|
|  |  |  | ellipsis: true, | 
|---|
|  |  |  | ...getColumnSearchProps('ioPri'), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: formatMessage('db.man_task.origin_loc', '源库位'), | 
|---|
|  |  |  | dataIndex: 'originLoc', | 
|---|
|  |  |  | width: 140, | 
|---|
|  |  |  | ellipsis: true, | 
|---|
|  |  |  | ...getColumnSearchProps('originLoc'), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: formatMessage('db.man_task.target_loc', '目标库位'), | 
|---|
|  |  |  | dataIndex: 'targetLoc', | 
|---|
|  |  |  | width: 140, | 
|---|
|  |  |  | ellipsis: true, | 
|---|
|  |  |  | ...getColumnSearchProps('targetLoc'), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: formatMessage('db.man_task.origin_site', '源站点'), | 
|---|
|  |  |  | dataIndex: 'originSite', | 
|---|
|  |  |  | width: 140, | 
|---|
|  |  |  | ellipsis: true, | 
|---|
|  |  |  | ...getColumnSearchProps('originSite'), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: formatMessage('db.man_task.target_site', '目标站点'), | 
|---|
|  |  |  | dataIndex: 'targetSite', | 
|---|
|  |  |  | width: 140, | 
|---|
|  |  |  | ellipsis: true, | 
|---|
|  |  |  | ...getColumnSearchProps('targetSite'), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: formatMessage('db.man_task.barcode', '托盘码'), | 
|---|
|  |  |  | dataIndex: 'barcode', | 
|---|
|  |  |  | width: 140, | 
|---|
|  |  |  | ellipsis: true, | 
|---|
|  |  |  | ...getColumnSearchProps('barcode'), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: formatMessage('db.man_task.status', '状态'), | 
|---|
|  |  |  | dataIndex: 'status$', | 
|---|
|  |  |  | width: 140, | 
|---|
|  |  |  | ellipsis: true, | 
|---|
|  |  |  | ...getColumnSearchProps('status$'), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: formatMessage('db.man_task.create_time', '添加时间'), | 
|---|
|  |  |  | dataIndex: 'createTime$', | 
|---|
|  |  |  | width: 140, | 
|---|
|  |  |  | ellipsis: true, | 
|---|
|  |  |  | ...getColumnSearchProps('createTime$'), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: formatMessage('db.man_task.create_by', '添加人员'), | 
|---|
|  |  |  | dataIndex: 'createBy$', | 
|---|
|  |  |  | width: 140, | 
|---|
|  |  |  | ellipsis: true, | 
|---|
|  |  |  | ...getColumnSearchProps('createBy$'), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: formatMessage('db.man_task.update_time', '修改时间'), | 
|---|
|  |  |  | dataIndex: 'updateTime$', | 
|---|
|  |  |  | width: 140, | 
|---|
|  |  |  | ellipsis: true, | 
|---|
|  |  |  | ...getColumnSearchProps('updateTime$'), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: formatMessage('db.man_task.update_by', '修改人员'), | 
|---|
|  |  |  | dataIndex: 'updateBy$', | 
|---|
|  |  |  | width: 140, | 
|---|
|  |  |  | ellipsis: true, | 
|---|
|  |  |  | ...getColumnSearchProps('updateBy$'), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: formatMessage('db.man_task.memo', '备注'), | 
|---|
|  |  |  | dataIndex: 'memo', | 
|---|
|  |  |  | width: 140, | 
|---|
|  |  |  | ellipsis: true, | 
|---|
|  |  |  | ...getColumnSearchProps('memo'), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: formatMessage('common.operation', '操作'), | 
|---|
|  |  |  | name: 'oper', | 
|---|
|  |  |  | dataIndex: 'oper', | 
|---|
|  |  |  | key: 'oper', | 
|---|
|  |  |  | fixed: 'right', | 
|---|
|  |  |  | width: 240, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | ]; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const state = reactive({ | 
|---|
|  |  |  | selectedRowKeys: [], | 
|---|
|  |  |  | loading: false, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | const hasSelected = computed(() => state.selectedRowKeys.length > 0); | 
|---|
|  |  |  | const start = () => { | 
|---|
|  |  |  | state.loading = true; | 
|---|
|  |  |  | // ajax request after empty completing | 
|---|
|  |  |  | setTimeout(() => { | 
|---|
|  |  |  | state.loading = false; | 
|---|
|  |  |  | state.selectedRowKeys = []; | 
|---|
|  |  |  | }, 1000); | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | const onSelectChange = selectedRowKeys => { | 
|---|
|  |  |  | // console.log('selectedRowKeys changed: ', selectedRowKeys); | 
|---|
|  |  |  | state.selectedRowKeys = selectedRowKeys; | 
|---|
|  |  |  | }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function getPage() { | 
|---|
|  |  |  | post('/api/taskLog/page', { | 
|---|
|  |  |  | current: currentPage, | 
|---|
|  |  |  | pageSize: pageSize, | 
|---|
|  |  |  | condition: searchInput.value | 
|---|
|  |  |  | }).then((resp) => { | 
|---|
|  |  |  | let result = resp.data; | 
|---|
|  |  |  | if (result.code == 200) { | 
|---|
|  |  |  | let data = result.data; | 
|---|
|  |  |  | tableData.value = data; | 
|---|
|  |  |  | } else if (result.code === 401) { | 
|---|
|  |  |  | message.error(result.msg); | 
|---|
|  |  |  | logout() | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | message.error(result.msg); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const handleEdit = (item) => { | 
|---|
|  |  |  | editChild.value.open = true; | 
|---|
|  |  |  | editChild.value.formData = item == null ? editChild.value.initFormData : JSON.parse(JSON.stringify(item)); | 
|---|
|  |  |  | editChild.value.isSave = item == null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const handleDel = (rows) => { | 
|---|
|  |  |  | Modal.confirm({ | 
|---|
|  |  |  | title: formatMessage('page.delete', '删除'), | 
|---|
|  |  |  | content: formatMessage('page.delete.confirm', '确定删除该项吗?'), | 
|---|
|  |  |  | maskClosable: true, | 
|---|
|  |  |  | onOk: async () => { | 
|---|
|  |  |  | const hide = message.loading(formatMessage('common.loading', '请求中')); | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | post('/api/taskLog/remove/' + rows.map((row) => row.id).join(','), {}).then(resp => { | 
|---|
|  |  |  | let result = resp.data; | 
|---|
|  |  |  | if (result.code === 200) { | 
|---|
|  |  |  | message.success(result.msg); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | message.error(result.msg); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | getPage() | 
|---|
|  |  |  | hide() | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } catch (error) { | 
|---|
|  |  |  | message.error(formatMessage('common.fail', '请求失败')); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const handleExport = async (intl) => { | 
|---|
|  |  |  | postBlob('/api/taskLog/export', {}).then(result => { | 
|---|
|  |  |  | const blob = new Blob([result.data], { type: 'application/vnd.ms-excel' }); | 
|---|
|  |  |  | window.location.href = window.URL.createObjectURL(blob); | 
|---|
|  |  |  | return true; | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const onSearch = () => { | 
|---|
|  |  |  | // console.log('search'); | 
|---|
|  |  |  | getPage() | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const onPageChange = (page, size) => { | 
|---|
|  |  |  | currentPage = page; | 
|---|
|  |  |  | pageSize = size; | 
|---|
|  |  |  | getPage(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function handleTableReload(value) { | 
|---|
|  |  |  | getPage() | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const showDetl = (record) => { | 
|---|
|  |  |  | showTaskDetlChild.value.open = true; | 
|---|
|  |  |  | showTaskDetlChild.value.taskId = record.id; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <script> | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | name: '任务历史管理' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <template> | 
|---|
|  |  |  | <div> | 
|---|
|  |  |  | <EditView ref="editChild" @tableReload="handleTableReload" /> | 
|---|
|  |  |  | <div class="table-header"> | 
|---|
|  |  |  | <a-input-search v-model:value="searchInput" :placeholder="formatMessage('page.input', '请输入')" | 
|---|
|  |  |  | style="width: 200px;" @search="onSearch" /> | 
|---|
|  |  |  | <div class="table-header-right"> | 
|---|
|  |  |  | <a-button @click="handleEdit(null)" type="primary">{{ formatMessage('page.add', '添加') }}</a-button> | 
|---|
|  |  |  | <a-button @click="handleExport">{{ formatMessage('page.export', '导出') }}</a-button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <a-table :row-selection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }" | 
|---|
|  |  |  | :data-source="tableData.records" :defaultExpandAllRows="false" :key="TABLE_KEY" rowKey="id" | 
|---|
|  |  |  | :pagination="{ total: tableData.total, onChange: onPageChange }" | 
|---|
|  |  |  | :scroll="{ y: 768, scrollToFirstRowOnChange: true }" :columns="columns" @resizeColumn="handleResizeColumn"> | 
|---|
|  |  |  | <template #bodyCell="{ column, text, record }"> | 
|---|
|  |  |  | <template v-if="column.dataIndex === 'oper'"> | 
|---|
|  |  |  | <div style="display: flex;justify-content: space-evenly;"> | 
|---|
|  |  |  | <a-button type="link" primary @click="showDetl(record)">{{ formatMessage('page.task.orderDetl', '任务明细') | 
|---|
|  |  |  | }}</a-button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </a-table> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <ShowTaskDetlLogComponent ref="showTaskDetlChild" /> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <style></style> | 
|---|
|  |  |  | 
|---|
|  |  |  | return R.ok().add(taskDetlLogService.getById(id)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PreAuthorize("hasAuthority('asrs:taskDetlLog:list')") | 
|---|
|  |  |  | @GetMapping("/taskDetlLog/taskId/{id}") | 
|---|
|  |  |  | public R getByTaskId(@PathVariable("id") Long id) { | 
|---|
|  |  |  | return R.ok().add(taskDetlLogService.getTaskDetlLogByTaskId(id)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PreAuthorize("hasAuthority('asrs:taskDetlLog:save')") | 
|---|
|  |  |  | @OperationLog("添加任务明细历史") | 
|---|
|  |  |  | @PostMapping("/taskDetlLog/save") | 
|---|
|  |  |  | 
|---|
|  |  |  | import java.text.SimpleDateFormat; | 
|---|
|  |  |  | import java.util.Date; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.zy.asrs.common.utils.Synchro; | 
|---|
|  |  |  | import com.zy.asrs.wms.asrs.service.TaskStsService; | 
|---|
|  |  |  | import com.zy.asrs.wms.asrs.service.TaskTypeService; | 
|---|
|  |  |  | import com.zy.asrs.wms.system.entity.Host; | 
|---|
|  |  |  | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void sync(Object source) { | 
|---|
|  |  |  | Synchro.Copy(source, this); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | import java.text.SimpleDateFormat; | 
|---|
|  |  |  | import java.util.Date; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.zy.asrs.common.utils.Synchro; | 
|---|
|  |  |  | import com.zy.asrs.wms.asrs.service.MatFieldService; | 
|---|
|  |  |  | import com.zy.asrs.wms.asrs.service.TaskDetlService; | 
|---|
|  |  |  | import com.zy.asrs.wms.system.entity.Host; | 
|---|
|  |  |  | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void sync(Object source) { | 
|---|
|  |  |  | Synchro.Copy(source, this); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | package com.zy.asrs.wms.asrs.entity; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.baomidou.mybatisplus.annotation.TableLogic; | 
|---|
|  |  |  | import java.text.SimpleDateFormat; | 
|---|
|  |  |  | import java.util.Date; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.lang.reflect.Field; | 
|---|
|  |  |  | import java.text.SimpleDateFormat; | 
|---|
|  |  |  | import java.util.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.fasterxml.jackson.annotation.JsonAnyGetter; | 
|---|
|  |  |  | import com.zy.asrs.common.utils.Synchro; | 
|---|
|  |  |  | import com.zy.asrs.wms.asrs.service.MatFieldService; | 
|---|
|  |  |  | import com.zy.asrs.wms.asrs.service.TaskDetlLogService; | 
|---|
|  |  |  | import com.zy.asrs.wms.system.entity.Host; | 
|---|
|  |  |  | 
|---|
|  |  |  | * ID | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty(value= "ID") | 
|---|
|  |  |  | @TableId(value = "id", type = IdType.AUTO) | 
|---|
|  |  |  | @TableId(value = "id", type = IdType.INPUT) | 
|---|
|  |  |  | private Long id; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void sync(Object source) { | 
|---|
|  |  |  | Synchro.Copy(source, this); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | package com.zy.asrs.wms.asrs.entity; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.baomidou.mybatisplus.annotation.TableLogic; | 
|---|
|  |  |  | import java.text.SimpleDateFormat; | 
|---|
|  |  |  | import java.util.Date; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.lang.reflect.Field; | 
|---|
|  |  |  | import java.text.SimpleDateFormat; | 
|---|
|  |  |  | import java.util.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.fasterxml.jackson.annotation.JsonAnyGetter; | 
|---|
|  |  |  | import com.zy.asrs.common.utils.Synchro; | 
|---|
|  |  |  | import com.zy.asrs.wms.asrs.service.MatService; | 
|---|
|  |  |  | import com.zy.asrs.wms.asrs.service.OrderDetlLogService; | 
|---|
|  |  |  | import com.zy.asrs.wms.asrs.service.OrderLogService; | 
|---|
|  |  |  | 
|---|
|  |  |  | * ID | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty(value= "ID") | 
|---|
|  |  |  | @TableId(value = "id", type = IdType.AUTO) | 
|---|
|  |  |  | @TableId(value = "id", type = IdType.INPUT) | 
|---|
|  |  |  | private Long id; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void sync(Object source) { | 
|---|
|  |  |  | Synchro.Copy(source, this); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //动态扩展字段 | 
|---|
|  |  |  | public transient Map<String, Object> dynamicFields = new HashMap<>(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @JsonAnyGetter | 
|---|
|  |  |  | public Map<String,Object> getDynamicFields() { | 
|---|
|  |  |  | return dynamicFields; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void syncField(List<TaskDetlFieldLog> list) { | 
|---|
|  |  |  | ArrayList<String> keys = new ArrayList<>(); | 
|---|
|  |  |  | Field[] fields = this.getClass().getFields(); | 
|---|
|  |  |  | for (Field field : fields) { | 
|---|
|  |  |  | keys.add(field.getName()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Map<String, Object> dynamicFields = new HashMap<>(); | 
|---|
|  |  |  | for (TaskDetlFieldLog taskDetlFieldLog : list) { | 
|---|
|  |  |  | if (keys.contains(taskDetlFieldLog.getName())) { | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | dynamicFields.put(taskDetlFieldLog.getName(), taskDetlFieldLog.getValue()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | this.dynamicFields = dynamicFields; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void syncFieldMap(Map<String, Object> map) { | 
|---|
|  |  |  | ArrayList<String> keys = new ArrayList<>(); | 
|---|
|  |  |  | Field[] fields = this.getClass().getDeclaredFields(); | 
|---|
|  |  |  | for (Field field : fields) { | 
|---|
|  |  |  | keys.add(field.getName()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | keys.add("detlId"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Map<String, Object> dynamicFields = new HashMap<>(); | 
|---|
|  |  |  | for (Map.Entry<String, Object> entry : map.entrySet()) { | 
|---|
|  |  |  | if (keys.contains(entry.getKey())) { | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | dynamicFields.put(entry.getKey(), entry.getValue()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | this.dynamicFields = dynamicFields; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public String getFieldString(String key) { | 
|---|
|  |  |  | return dynamicFields.get(key).toString(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setField(String key, Object value) { | 
|---|
|  |  |  | dynamicFields.put(key, value); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | import java.text.SimpleDateFormat; | 
|---|
|  |  |  | import java.util.Date; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.zy.asrs.common.utils.Synchro; | 
|---|
|  |  |  | import com.zy.asrs.wms.asrs.service.TaskStsService; | 
|---|
|  |  |  | import com.zy.asrs.wms.asrs.service.TaskTypeService; | 
|---|
|  |  |  | import com.zy.asrs.wms.system.entity.Host; | 
|---|
|  |  |  | 
|---|
|  |  |  | * ID | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty(value= "ID") | 
|---|
|  |  |  | @TableId(value = "id", type = IdType.AUTO) | 
|---|
|  |  |  | @TableId(value = "id", type = IdType.INPUT) | 
|---|
|  |  |  | private Long id; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void sync(Object source) { | 
|---|
|  |  |  | Synchro.Copy(source, this); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | import com.baomidou.mybatisplus.extension.service.IService; | 
|---|
|  |  |  | import com.zy.asrs.wms.asrs.entity.TaskDetlLog; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public interface TaskDetlLogService extends IService<TaskDetlLog> { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<TaskDetlLog> getTaskDetlLogByTaskId(Long taskId); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | package com.zy.asrs.wms.asrs.service.impl; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 
|---|
|  |  |  | import com.zy.asrs.wms.asrs.entity.TaskDetl; | 
|---|
|  |  |  | import com.zy.asrs.wms.asrs.entity.TaskDetlField; | 
|---|
|  |  |  | import com.zy.asrs.wms.asrs.entity.TaskDetlFieldLog; | 
|---|
|  |  |  | import com.zy.asrs.wms.asrs.mapper.TaskDetlLogMapper; | 
|---|
|  |  |  | import com.zy.asrs.wms.asrs.entity.TaskDetlLog; | 
|---|
|  |  |  | import com.zy.asrs.wms.asrs.service.TaskDetlFieldLogService; | 
|---|
|  |  |  | import com.zy.asrs.wms.asrs.service.TaskDetlFieldService; | 
|---|
|  |  |  | import com.zy.asrs.wms.asrs.service.TaskDetlLogService; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.Collections; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Service("taskDetlLogService") | 
|---|
|  |  |  | public class TaskDetlLogServiceImpl extends ServiceImpl<TaskDetlLogMapper, TaskDetlLog> implements TaskDetlLogService { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private TaskDetlFieldLogService taskDetlFieldLogService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public List<TaskDetlLog> getTaskDetlLogByTaskId(Long taskId) { | 
|---|
|  |  |  | List<TaskDetlLog> taskDetlLogs = this.list(new LambdaQueryWrapper<TaskDetlLog>().eq(TaskDetlLog::getTaskId, taskId)); | 
|---|
|  |  |  | for (TaskDetlLog taskDetlLog : taskDetlLogs) { | 
|---|
|  |  |  | List<TaskDetlFieldLog> list = taskDetlFieldLogService.list(new LambdaQueryWrapper<TaskDetlFieldLog>().eq(TaskDetlFieldLog::getDetlId, taskDetlLog.getId())); | 
|---|
|  |  |  | taskDetlLog.syncField(list); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return taskDetlLogs; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | private LocService locService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private LocStsService locStsService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private TaskLogService taskLogService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private TaskDetlLogService taskDetlLogService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private TaskDetlFieldLogService taskDetlFieldLogService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public String generateTaskNo(Long taskType) { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //删除明细扩展 | 
|---|
|  |  |  | boolean removeField = taskDetlFieldService.remove(new LambdaQueryWrapper<TaskDetlField>().eq(TaskDetlField::getDetlId, taskDetl.getId())); | 
|---|
|  |  |  | if(!removeField){ | 
|---|
|  |  |  | throw new CoolException("回滚扩展明细失败"); | 
|---|
|  |  |  | List<TaskDetlField> detlFields = taskDetlFieldService.list(new LambdaQueryWrapper<TaskDetlField>().eq(TaskDetlField::getDetlId, taskDetl.getId())); | 
|---|
|  |  |  | for (TaskDetlField detlField : detlFields) { | 
|---|
|  |  |  | //明细扩展字段数据保存至历史档 | 
|---|
|  |  |  | TaskDetlFieldLog taskDetlFieldLog = new TaskDetlFieldLog(); | 
|---|
|  |  |  | taskDetlFieldLog.sync(detlField); | 
|---|
|  |  |  | if (!taskDetlFieldLogService.save(taskDetlFieldLog)) { | 
|---|
|  |  |  | throw new CoolException("明细扩展字段转历史档案失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //删除明细扩展 | 
|---|
|  |  |  | boolean removeField = taskDetlFieldService.removeById(detlField.getId()); | 
|---|
|  |  |  | if(!removeField){ | 
|---|
|  |  |  | throw new CoolException("回滚扩展明细失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //明细数据保存至历史档 | 
|---|
|  |  |  | TaskDetlLog taskDetlLog = new TaskDetlLog(); | 
|---|
|  |  |  | taskDetlLog.sync(taskDetl); | 
|---|
|  |  |  | if (!taskDetlLogService.save(taskDetlLog)) { | 
|---|
|  |  |  | throw new CoolException("明细数据转历史档案失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //删除明细 | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //数据保存至历史档 | 
|---|
|  |  |  | TaskLog taskLog = new TaskLog(); | 
|---|
|  |  |  | taskLog.sync(task); | 
|---|
|  |  |  | if (!taskLogService.save(taskLog)) { | 
|---|
|  |  |  | throw new CoolException("任务档案转历史档案失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //删除任务 | 
|---|
|  |  |  | boolean removeTask = taskService.removeById(taskId); | 
|---|
|  |  |  | if(!removeTask){ | 
|---|
|  |  |  | 
|---|
|  |  |  | //        generator.username="sa"; | 
|---|
|  |  |  | //        generator.password="Zoneyung@zy56$"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | generator.table="man_task_detl_log"; | 
|---|
|  |  |  | generator.tableName="任务明细扩展字段历史"; | 
|---|
|  |  |  | generator.table="man_order_detl_field_log"; | 
|---|
|  |  |  | generator.tableName="订单明细扩展字段历史"; | 
|---|
|  |  |  | generator.rootPackagePath="com.zy.asrs.wms"; | 
|---|
|  |  |  | generator.packagePath="com.zy.asrs.wms.asrs"; | 
|---|
|  |  |  |  | 
|---|