Commit 25ca88d15b5f2bb95a850fd626fe3cc71a7721d4

Authored by 肖超群
1 parent f230b3a9

1. 创建入库任务

2. 任务界面
Showing 29 changed files with 2063 additions and 11 deletions
jeecg-boot-master/ant-design-vue-jeecg/src/api/api.js
... ... @@ -106,6 +106,7 @@ export const getReceiptTypeList = (params)=>getAction('/config/receiptType/getRe
106 106 export const getShipmentTypeList = (params)=>getAction('/config/shipmentType/getShipmentTypeList', params);
107 107 export const searchMaterialByCode = (params)=>postAction('/config/material/searchMaterialByCode', params);
108 108 export const listReceiveByReceiptId = (params)=>postAction('/receipt/receiveHeader/listReceiveByReceiptId', params);
  109 +export const createTask = (params)=>postAction('/receipt/receiptContainerHeader/createTask', params);
109 110  
110 111  
111 112 // 中转HTTP请求
... ...
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/receipt/ReceiptContainerHeaderList.vue
... ... @@ -113,7 +113,8 @@
113 113  
114 114 <span slot="action" slot-scope="text, record">
115 115 <a @click="handleEdit(record)">编辑</a>
116   -
  116 + <a-divider type="vertical" />
  117 + <a @click="createTask(record)">生成任务</a>
117 118 <a-divider type="vertical" />
118 119 <a-dropdown>
119 120 <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
... ... @@ -148,6 +149,7 @@
148 149 import ReceiptContaienrDetailList from './ReceiptContaienrDetailList'
149 150 import {initDictOptions,filterMultiDictText} from '@/components/dict/JDictSelectUtil'
150 151 import '@/assets/less/TableExpand.less'
  152 + import {createTask} from '@/api/api'
151 153  
152 154 export default {
153 155 name: "ReceiptContainerHeaderList",
... ... @@ -159,6 +161,7 @@
159 161 data () {
160 162 return {
161 163 description: '入库组盘管理页面',
  164 + querySource:{},
162 165 // 表头
163 166 columns: [
164 167 {
... ... @@ -277,6 +280,16 @@
277 280 this.selectedRowKeys = selectedRowKeys;
278 281 this.selectionRows = selectionRows;
279 282 },
  283 + createTask(record){
  284 + this.loading = true;
  285 + const that = this;
  286 + this.model = Object.assign({}, record);
  287 + that.querySource.id = record.id;
  288 + createTask(that.querySource).then((res) => {
  289 + this.loading = false;
  290 + this.search();
  291 + });
  292 + },
280 293 loadData(arg) {
281 294 if(!this.url.list){
282 295 this.$message.error("请设置url.list属性!")
... ...
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiptHeaderModal.vue
... ... @@ -100,8 +100,8 @@
100 100 ],
101 101 },
102 102 url: {
103   - add: "/config/receiptHeader/add",
104   - edit: "/config/receiptHeader/edit",
  103 + add: "/receipt/receiptHeader/add",
  104 + edit: "/receipt/receiptHeader/edit",
105 105 }
106 106  
107 107 }
... ...
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/task/TaskDetailList.vue 0 → 100644
  1 +<template>
  2 + <a-card :bordered="false" :class="'cust-erp-sub-tab'">
  3 + <!-- 操作按钮区域 -->
  4 + <div class="table-operator" v-if="mainId">
  5 + <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  6 + <a-button type="primary" icon="download" @click="handleExportXls('任务详情')">导出</a-button>
  7 + <a-upload
  8 + name="file"
  9 + :showUploadList="false"
  10 + :multiple="false"
  11 + :headers="tokenHeader"
  12 + :action="importExcelUrl"
  13 + @change="handleImportExcel">
  14 + <a-button type="primary" icon="import">导入</a-button>
  15 + </a-upload>
  16 + <a-dropdown v-if="selectedRowKeys.length > 0">
  17 + <a-menu slot="overlay">
  18 + <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  19 + </a-menu>
  20 + <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  21 + </a-dropdown>
  22 + </div>
  23 +
  24 + <!-- table区域-begin -->
  25 + <div>
  26 + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  27 + <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  28 + <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  29 + </div>
  30 +
  31 + <a-table
  32 + ref="table"
  33 + size="middle"
  34 + bordered
  35 + rowKey="id"
  36 + :scroll="{x:true}"
  37 + :columns="columns"
  38 + :dataSource="dataSource"
  39 + :pagination="ipagination"
  40 + :loading="loading"
  41 + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  42 + @change="handleTableChange">
  43 +
  44 + <template slot="htmlSlot" slot-scope="text">
  45 + <div v-html="text"></div>
  46 + </template>
  47 + <template slot="imgSlot" slot-scope="text">
  48 + <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  49 + <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  50 + </template>
  51 + <template slot="fileSlot" slot-scope="text">
  52 + <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  53 + <a-button
  54 + v-else
  55 + :ghost="true"
  56 + type="primary"
  57 + icon="download"
  58 + size="small"
  59 + @click="downloadFile(text)">
  60 + 下载
  61 + </a-button>
  62 + </template>
  63 +
  64 + <span slot="action" slot-scope="text, record">
  65 + <a @click="handleEdit(record)">编辑</a>
  66 + <a-divider type="vertical" />
  67 + <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  68 + <a>删除</a>
  69 + </a-popconfirm>
  70 + </span>
  71 +
  72 + </a-table>
  73 + </div>
  74 +
  75 + <taskDetail-modal ref="modalForm" @ok="modalFormOk" :mainId="mainId"></taskDetail-modal>
  76 + </a-card>
  77 +</template>
  78 +
  79 +<script>
  80 +
  81 + import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  82 + import TaskDetailModal from './modules/TaskDetailModal'
  83 +
  84 + export default {
  85 + name: "TaskDetailList",
  86 + mixins:[JeecgListMixin],
  87 + components: { TaskDetailModal },
  88 + props:{
  89 + mainId:{
  90 + type:String,
  91 + default:'',
  92 + required:false
  93 + }
  94 + },
  95 + watch:{
  96 + mainId:{
  97 + immediate: true,
  98 + handler(val) {
  99 + if(!this.mainId){
  100 + this.clearList()
  101 + }else{
  102 + this.queryParam['taskHeaderId'] = val
  103 + this.loadData(1);
  104 + }
  105 + }
  106 + }
  107 + },
  108 + data () {
  109 + return {
  110 + description: '任务表管理页面',
  111 + disableMixinCreated:true,
  112 + // 表头
  113 + columns: [
  114 + {
  115 + title: '#',
  116 + dataIndex: '',
  117 + key:'rowIndex',
  118 + width:60,
  119 + align:"center",
  120 + customRender:function (t,r,index) {
  121 + return parseInt(index)+1;
  122 + }
  123 + },
  124 + {
  125 + title:'货主',
  126 + align:"center",
  127 + dataIndex: 'companyCode'
  128 + },
  129 + {
  130 + title:'物料编码',
  131 + align:"center",
  132 + dataIndex: 'materialCode'
  133 + },
  134 + {
  135 + title:'物料名称',
  136 + align:"center",
  137 + dataIndex: 'materialName'
  138 + },
  139 + {
  140 + title:'物料规格',
  141 + align:"center",
  142 + dataIndex: 'materialSpec'
  143 + },
  144 + {
  145 + title:'物料单位',
  146 + align:"center",
  147 + dataIndex: 'materialUnit'
  148 + },
  149 + {
  150 + title:'数量',
  151 + align:"center",
  152 + dataIndex: 'qty'
  153 + },
  154 + {
  155 + title:'批次',
  156 + align:"center",
  157 + dataIndex: 'batch'
  158 + },
  159 + {
  160 + title:'库存状态',
  161 + align:"center",
  162 + dataIndex: 'inventoryStatus_dictText',
  163 + },
  164 + {
  165 + title:'创建人',
  166 + align:"center",
  167 + dataIndex: 'createBy'
  168 + },
  169 + {
  170 + title:'创建日期',
  171 + align:"center",
  172 + dataIndex: 'createTime'
  173 + },
  174 + {
  175 + title:'更新人',
  176 + align:"center",
  177 + dataIndex: 'updateBy'
  178 + },
  179 + {
  180 + title:'更新日期',
  181 + align:"center",
  182 + dataIndex: 'updateTime'
  183 + },
  184 + {
  185 + title: '操作',
  186 + dataIndex: 'action',
  187 + align:"center",
  188 + fixed:"right",
  189 + width:147,
  190 + scopedSlots: { customRender: 'action' },
  191 + }
  192 + ],
  193 + url: {
  194 + list: "/task/taskHeader/listTaskDetailByMainId",
  195 + delete: "/task/taskHeader/deleteTaskDetail",
  196 + deleteBatch: "/task/taskHeader/deleteBatchTaskDetail",
  197 + exportXlsUrl: "/task/taskHeader/exportTaskDetail",
  198 + importUrl: "/task/taskHeader/importTaskDetail",
  199 + },
  200 + dictOptions:{
  201 + taskType:[],
  202 + isEmptyOut:[],
  203 + isDoubleIn:[],
  204 + status:[],
  205 + }
  206 + }
  207 + },
  208 + created() {
  209 + },
  210 + computed: {
  211 + importExcelUrl(){
  212 + return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`;
  213 + }
  214 + },
  215 + methods: {
  216 + clearList(){
  217 + this.dataSource=[]
  218 + this.selectedRowKeys=[]
  219 + this.ipagination.current = 1
  220 + }
  221 +
  222 + }
  223 + }
  224 +</script>
  225 +<style scoped>
  226 + @import '~@assets/less/common.less'
  227 +</style>
... ...
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/task/TaskHeaderList.vue 0 → 100644
  1 +<template>
  2 + <a-card :bordered="false">
  3 + <!-- 查询区域 -->
  4 + <div class="table-page-search-wrapper">
  5 + <a-form layout="inline" @keyup.enter.native="searchQuery">
  6 + <a-row :gutter="24">
  7 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  8 + <a-form-item label="任务类型">
  9 + <j-dict-select-tag placeholder="请选择任务类型" v-model="queryParam.taskType" dictCode="task_type"/>
  10 + </a-form-item>
  11 + </a-col>
  12 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  13 + <a-form-item label="容器号">
  14 + <a-input placeholder="请输入容器号" v-model="queryParam.containerCode"></a-input>
  15 + </a-form-item>
  16 + </a-col>
  17 + <template v-if="toggleSearchStatus">
  18 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  19 + <a-form-item label="起始库位">
  20 + <a-input placeholder="请输入起始库位" v-model="queryParam.fromLocationCode"></a-input>
  21 + </a-form-item>
  22 + </a-col>
  23 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  24 + <a-form-item label="目标库位">
  25 + <a-input placeholder="请输入目标库位" v-model="queryParam.toLocationCode"></a-input>
  26 + </a-form-item>
  27 + </a-col>
  28 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  29 + <a-form-item label="是否空出">
  30 + <j-dict-select-tag placeholder="请选择是否空出" v-model="queryParam.isEmptyOut" dictCode="is_or_not"/>
  31 + </a-form-item>
  32 + </a-col>
  33 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  34 + <a-form-item label="是否重入">
  35 + <j-dict-select-tag placeholder="请选择是否重入" v-model="queryParam.isDoubleIn" dictCode="is_or_not"/>
  36 + </a-form-item>
  37 + </a-col>
  38 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  39 + <a-form-item label="重入库位号">
  40 + <a-input placeholder="请输入重入库位号" v-model="queryParam.originLocationCode"></a-input>
  41 + </a-form-item>
  42 + </a-col>
  43 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  44 + <a-form-item label="任务状态">
  45 + <j-dict-select-tag placeholder="请选择任务状态" v-model="queryParam.status" dictCode="task_header_status"/>
  46 + </a-form-item>
  47 + </a-col>
  48 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  49 + <a-form-item label="起始出入口">
  50 + <a-input placeholder="请输入起始出入口" v-model="queryParam.fromPort"></a-input>
  51 + </a-form-item>
  52 + </a-col>
  53 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  54 + <a-form-item label="目标出入口">
  55 + <a-input placeholder="请输入目标出入口" v-model="queryParam.toPort"></a-input>
  56 + </a-form-item>
  57 + </a-col>
  58 + <a-col :xl="10" :lg="11" :md="12" :sm="24">
  59 + <a-form-item label="创建日期">
  60 + <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" class="query-group-cust" v-model="queryParam.createTime_begin"></j-date>
  61 + <span class="query-group-split-cust"></span>
  62 + <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust" v-model="queryParam.createTime_end"></j-date>
  63 + </a-form-item>
  64 + </a-col>
  65 + </template>
  66 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  67 + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  68 + <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  69 + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  70 + <a @click="handleToggleSearch" style="margin-left: 8px">
  71 + {{ toggleSearchStatus ? '收起' : '展开' }}
  72 + <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  73 + </a>
  74 + </span>
  75 + </a-col>
  76 + </a-row>
  77 + </a-form>
  78 + </div>
  79 + <!-- 查询区域-END -->
  80 +
  81 + <!-- 操作按钮区域 -->
  82 + <div class="table-operator">
  83 + <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  84 + <a-button type="primary" icon="download" @click="handleExportXls('任务表')">导出</a-button>
  85 + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  86 + <a-button type="primary" icon="import">导入</a-button>
  87 + </a-upload>
  88 + <!-- 高级查询区域 -->
  89 + <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
  90 + </div>
  91 +
  92 + <!-- table区域-begin -->
  93 + <div>
  94 + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  95 + <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  96 + <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  97 + </div>
  98 +
  99 + <a-table
  100 + ref="table"
  101 + size="middle"
  102 + bordered
  103 + rowKey="id"
  104 + class="j-table-force-nowrap"
  105 + :scroll="{x:true}"
  106 + :columns="columns"
  107 + :dataSource="dataSource"
  108 + :pagination="ipagination"
  109 + :loading="loading"
  110 + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}"
  111 + :customRow="clickThenSelect"
  112 + @change="handleTableChange">
  113 +
  114 + <template slot="htmlSlot" slot-scope="text">
  115 + <div v-html="text"></div>
  116 + </template>
  117 + <template slot="imgSlot" slot-scope="text">
  118 + <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  119 + <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  120 + </template>
  121 + <template slot="fileSlot" slot-scope="text">
  122 + <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  123 + <a-button
  124 + v-else
  125 + :ghost="true"
  126 + type="primary"
  127 + icon="download"
  128 + size="small"
  129 + @click="downloadFile(text)">
  130 + 下载
  131 + </a-button>
  132 + </template>
  133 +
  134 + <span slot="action" slot-scope="text, record">
  135 + <a @click="handleEdit(record)">编辑</a>
  136 +
  137 + <a-divider type="vertical" />
  138 + <a-dropdown>
  139 + <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  140 + <a-menu slot="overlay">
  141 + <a-menu-item>
  142 + <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  143 + <a>删除</a>
  144 + </a-popconfirm>
  145 + </a-menu-item>
  146 + </a-menu>
  147 + </a-dropdown>
  148 + </span>
  149 +
  150 + </a-table>
  151 + </div>
  152 +
  153 + <a-tabs defaultActiveKey="1">
  154 + <a-tab-pane tab="任务详情" key="1" >
  155 + <TaskDetailList :mainId="selectedMainId" />
  156 + </a-tab-pane>
  157 + </a-tabs>
  158 +
  159 + <taskHeader-modal ref="modalForm" @ok="modalFormOk"></taskHeader-modal>
  160 + </a-card>
  161 +</template>
  162 +
  163 +<script>
  164 +
  165 + import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  166 + import TaskHeaderModal from './modules/TaskHeaderModal'
  167 + import { getAction } from '@/api/manage'
  168 + import TaskDetailList from './TaskDetailList'
  169 + import {initDictOptions,filterMultiDictText} from '@/components/dict/JDictSelectUtil'
  170 + import '@/assets/less/TableExpand.less'
  171 +
  172 + export default {
  173 + name: "TaskHeaderList",
  174 + mixins:[JeecgListMixin],
  175 + components: {
  176 + TaskDetailList,
  177 + TaskHeaderModal
  178 + },
  179 + data () {
  180 + return {
  181 + description: '任务表管理页面',
  182 + // 表头
  183 + columns: [
  184 + {
  185 + title:'任务类型',
  186 + align:"center",
  187 + dataIndex: 'taskType_dictText',
  188 + },
  189 + {
  190 + title:'容器号',
  191 + align:"center",
  192 + dataIndex: 'containerCode'
  193 + },
  194 + {
  195 + title:'起始库位',
  196 + align:"center",
  197 + dataIndex: 'fromLocationCode'
  198 + },
  199 + {
  200 + title:'目标库位',
  201 + align:"center",
  202 + dataIndex: 'toLocationCode'
  203 + },
  204 + {
  205 + title:'是否空出',
  206 + align:"center",
  207 + dataIndex: 'isEmptyOut_dictText',
  208 + },
  209 + {
  210 + title:'是否重入',
  211 + align:"center",
  212 + dataIndex: 'isDoubleIn_dictText',
  213 + },
  214 + {
  215 + title:'重入库位号',
  216 + align:"center",
  217 + dataIndex: 'originLocationCode'
  218 + },
  219 + {
  220 + title:'任务状态',
  221 + align:"center",
  222 + dataIndex: 'status_dictText',
  223 + },
  224 + {
  225 + title:'起始出入口',
  226 + align:"center",
  227 + dataIndex: 'fromPort'
  228 + },
  229 + {
  230 + title:'目标出入口',
  231 + align:"center",
  232 + dataIndex: 'toPort'
  233 + },
  234 + {
  235 + title:'创建人',
  236 + align:"center",
  237 + dataIndex: 'createBy'
  238 + },
  239 + {
  240 + title:'创建日期',
  241 + align:"center",
  242 + dataIndex: 'createTime'
  243 + },
  244 + {
  245 + title:'更新人',
  246 + align:"center",
  247 + dataIndex: 'updateBy'
  248 + },
  249 + {
  250 + title:'更新日期',
  251 + align:"center",
  252 + dataIndex: 'updateTime'
  253 + },
  254 + {
  255 + title: '操作',
  256 + dataIndex: 'action',
  257 + align:"center",
  258 + fixed:"right",
  259 + width:147,
  260 + scopedSlots: { customRender: 'action' },
  261 + }
  262 + ],
  263 + url: {
  264 + list: "/task/taskHeader/list",
  265 + delete: "/task/taskHeader/delete",
  266 + deleteBatch: "/task/taskHeader/deleteBatch",
  267 + exportXlsUrl: "/task/taskHeader/exportXls",
  268 + importExcelUrl: "task/taskHeader/importExcel",
  269 + },
  270 + dictOptions:{
  271 + taskType:[],
  272 + isEmptyOut:[],
  273 + isDoubleIn:[],
  274 + status:[],
  275 + },
  276 + /* 分页参数 */
  277 + ipagination:{
  278 + current: 1,
  279 + pageSize: 5,
  280 + pageSizeOptions: ['5', '10', '50'],
  281 + showTotal: (total, range) => {
  282 + return range[0] + "-" + range[1] + " 共" + total + "条"
  283 + },
  284 + showQuickJumper: true,
  285 + showSizeChanger: true,
  286 + total: 0
  287 + },
  288 + selectedMainId:'',
  289 + superFieldList:[],
  290 + }
  291 + },
  292 + created() {
  293 + this.getSuperFieldList();
  294 + },
  295 + computed: {
  296 + importExcelUrl: function(){
  297 + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  298 + }
  299 + },
  300 + methods: {
  301 + initDictConfig(){
  302 + },
  303 + clickThenSelect(record) {
  304 + return {
  305 + on: {
  306 + click: () => {
  307 + this.onSelectChange(record.id.split(","), [record]);
  308 + }
  309 + }
  310 + }
  311 + },
  312 + onClearSelected() {
  313 + this.selectedRowKeys = [];
  314 + this.selectionRows = [];
  315 + this.selectedMainId=''
  316 + },
  317 + onSelectChange(selectedRowKeys, selectionRows) {
  318 + this.selectedMainId=selectedRowKeys[0]
  319 + this.selectedRowKeys = selectedRowKeys;
  320 + this.selectionRows = selectionRows;
  321 + },
  322 + loadData(arg) {
  323 + if(!this.url.list){
  324 + this.$message.error("请设置url.list属性!")
  325 + return
  326 + }
  327 + //加载数据 若传入参数1则加载第一页的内容
  328 + if (arg === 1) {
  329 + this.ipagination.current = 1;
  330 + }
  331 + this.onClearSelected()
  332 + var params = this.getQueryParams();//查询条件
  333 + this.loading = true;
  334 + getAction(this.url.list, params).then((res) => {
  335 + if (res.success) {
  336 + this.dataSource = res.result.records;
  337 + this.ipagination.total = res.result.total;
  338 + }
  339 + if(res.code===510){
  340 + this.$message.warning(res.message)
  341 + }
  342 + this.loading = false;
  343 + })
  344 + },
  345 + getSuperFieldList(){
  346 + let fieldList=[];
  347 + fieldList.push({type:'int',value:'taskType',text:'任务类型',dictCode:'task_type'})
  348 + fieldList.push({type:'string',value:'containerCode',text:'容器号',dictCode:''})
  349 + fieldList.push({type:'string',value:'fromLocationCode',text:'起始库位',dictCode:''})
  350 + fieldList.push({type:'string',value:'toLocationCode',text:'目标库位',dictCode:''})
  351 + fieldList.push({type:'string',value:'isEmptyOut',text:'是否空出',dictCode:'is_or_not'})
  352 + fieldList.push({type:'int',value:'isDoubleIn',text:'是否重入',dictCode:'is_or_not'})
  353 + fieldList.push({type:'string',value:'originLocationCode',text:'重入库位号',dictCode:''})
  354 + fieldList.push({type:'int',value:'status',text:'任务状态',dictCode:'task_header_status'})
  355 + fieldList.push({type:'string',value:'fromPort',text:'起始出入口',dictCode:''})
  356 + fieldList.push({type:'string',value:'toPort',text:'目标出入口',dictCode:''})
  357 + fieldList.push({type:'string',value:'createBy',text:'创建人',dictCode:''})
  358 + fieldList.push({type:'datetime',value:'createTime',text:'创建日期'})
  359 + fieldList.push({type:'string',value:'updateBy',text:'更新人',dictCode:''})
  360 + fieldList.push({type:'datetime',value:'updateTime',text:'更新日期'})
  361 + this.superFieldList = fieldList
  362 + }
  363 + }
  364 + }
  365 +</script>
  366 +<style scoped>
  367 + @import '~@assets/less/common.less'
  368 +</style>
0 369 \ No newline at end of file
... ...
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/task/modules/TaskDetailModal.vue 0 → 100644
  1 +<template>
  2 + <j-modal
  3 + :title="title"
  4 + :width="width"
  5 + :visible="visible"
  6 + :confirmLoading="confirmLoading"
  7 + switchFullscreen
  8 + @ok="handleOk"
  9 + @cancel="handleCancel"
  10 + cancelText="关闭">
  11 + <a-spin :spinning="confirmLoading">
  12 + <a-form-model ref="form" :model="model" :rules="validatorRules">
  13 + <a-row>
  14 + <a-col :span="24">
  15 + <a-form-model-item label="货主" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="companyCode">
  16 + <a-input v-model="model.companyCode"placeholder="请输入货主" ></a-input>
  17 + </a-form-model-item>
  18 + </a-col>
  19 + <a-col :span="24">
  20 + <a-form-model-item label="物料编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialCode">
  21 + <a-input v-model="model.materialCode"placeholder="请输入物料编码" ></a-input>
  22 + </a-form-model-item>
  23 + </a-col>
  24 + <a-col :span="24">
  25 + <a-form-model-item label="物料名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialName">
  26 + <a-input v-model="model.materialName"placeholder="请输入物料名称" ></a-input>
  27 + </a-form-model-item>
  28 + </a-col>
  29 + <a-col :span="24">
  30 + <a-form-model-item label="物料规格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialSpec">
  31 + <a-input v-model="model.materialSpec"placeholder="请输入物料规格" ></a-input>
  32 + </a-form-model-item>
  33 + </a-col>
  34 + <a-col :span="24">
  35 + <a-form-model-item label="物料单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialUnit">
  36 + <a-input v-model="model.materialUnit"placeholder="请输入物料单位" ></a-input>
  37 + </a-form-model-item>
  38 + </a-col>
  39 + <a-col :span="24">
  40 + <a-form-model-item label="数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="qty">
  41 + <a-input-number v-model="model.qty"placeholder="请输入数量" style="width: 100%" />
  42 + </a-form-model-item>
  43 + </a-col>
  44 + <a-col :span="24">
  45 + <a-form-model-item label="批次" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="batch">
  46 + <a-input v-model="model.batch"placeholder="请输入批次" ></a-input>
  47 + </a-form-model-item>
  48 + </a-col>
  49 + <a-col :span="24">
  50 + <a-form-model-item label="库存状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inventoryStatus">
  51 + <j-dict-select-tag type="list" v-model="model.inventoryStatus" dictCode="inventory_status" placeholder="请选择库存状态" />
  52 + </a-form-model-item>
  53 + </a-col>
  54 + </a-row>
  55 + </a-form-model>
  56 + </a-spin>
  57 + </j-modal>
  58 +</template>
  59 +
  60 +<script>
  61 +
  62 + import { httpAction } from '@/api/manage'
  63 + import { validateDuplicateValue } from '@/utils/util'
  64 +
  65 + export default {
  66 + name: "TaskDetailModal",
  67 + components: {
  68 + },
  69 + props:{
  70 + mainId:{
  71 + type:String,
  72 + required:false,
  73 + default:''
  74 + }
  75 + },
  76 + data () {
  77 + return {
  78 + title:"操作",
  79 + width:800,
  80 + visible: false,
  81 + model:{
  82 + },
  83 + labelCol: {
  84 + xs: { span: 24 },
  85 + sm: { span: 5 },
  86 + },
  87 + wrapperCol: {
  88 + xs: { span: 24 },
  89 + sm: { span: 16 },
  90 + },
  91 +
  92 + confirmLoading: false,
  93 + validatorRules: {
  94 + },
  95 + url: {
  96 + add: "/task/taskHeader/addTaskDetail",
  97 + edit: "/task/taskHeader/editTaskDetail",
  98 + }
  99 +
  100 + }
  101 + },
  102 + created () {
  103 + //备份model原始值
  104 + this.modelDefault = JSON.parse(JSON.stringify(this.model));
  105 + },
  106 + methods: {
  107 + add () {
  108 + this.edit(this.modelDefault);
  109 + },
  110 + edit (record) {
  111 + this.model = Object.assign({}, record);
  112 + this.visible = true;
  113 + },
  114 + close () {
  115 + this.$emit('close');
  116 + this.visible = false;
  117 + this.$refs.form.clearValidate();
  118 + },
  119 + handleOk () {
  120 + const that = this;
  121 + // 触发表单验证
  122 + this.$refs.form.validate(valid => {
  123 + if (valid) {
  124 + that.confirmLoading = true;
  125 + let httpurl = '';
  126 + let method = '';
  127 + if(!this.model.id){
  128 + httpurl+=this.url.add;
  129 + method = 'post';
  130 + }else{
  131 + httpurl+=this.url.edit;
  132 + method = 'put';
  133 + }
  134 + this.model['taskHeaderId'] = this.mainId
  135 + httpAction(httpurl,this.model,method).then((res)=>{
  136 + if(res.success){
  137 + that.$message.success(res.message);
  138 + that.$emit('ok');
  139 + }else{
  140 + that.$message.warning(res.message);
  141 + }
  142 + }).finally(() => {
  143 + that.confirmLoading = false;
  144 + that.close();
  145 + })
  146 + }else{
  147 + return false
  148 + }
  149 + })
  150 + },
  151 + handleCancel () {
  152 + this.close()
  153 + },
  154 +
  155 +
  156 + }
  157 + }
  158 +</script>
... ...
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/task/modules/TaskHeaderModal.vue 0 → 100644
  1 +<template>
  2 + <j-modal
  3 + :title="title"
  4 + :width="width"
  5 + :visible="visible"
  6 + :confirmLoading="confirmLoading"
  7 + switchFullscreen
  8 + @ok="handleOk"
  9 + @cancel="handleCancel"
  10 + cancelText="关闭">
  11 + <a-spin :spinning="confirmLoading">
  12 + <a-form-model ref="form" :model="model" :rules="validatorRules">
  13 + <a-row>
  14 + <a-col :span="24">
  15 + <a-form-model-item label="任务类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="taskType">
  16 + <j-dict-select-tag type="list" v-model="model.taskType" dictCode="task_type" placeholder="请选择任务类型" />
  17 + </a-form-model-item>
  18 + </a-col>
  19 + <a-col :span="24">
  20 + <a-form-model-item label="容器号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="containerCode">
  21 + <a-input v-model="model.containerCode" placeholder="请输入容器号" ></a-input>
  22 + </a-form-model-item>
  23 + </a-col>
  24 + <a-col :span="24">
  25 + <a-form-model-item label="起始库位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fromLocationCode">
  26 + <a-input v-model="model.fromLocationCode" placeholder="请输入起始库位" ></a-input>
  27 + </a-form-model-item>
  28 + </a-col>
  29 + <a-col :span="24">
  30 + <a-form-model-item label="目标库位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toLocationCode">
  31 + <a-input v-model="model.toLocationCode" placeholder="请输入目标库位" ></a-input>
  32 + </a-form-model-item>
  33 + </a-col>
  34 + <a-col :span="24">
  35 + <a-form-model-item label="是否空出" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isEmptyOut">
  36 + <j-dict-select-tag type="list" v-model="model.isEmptyOut" dictCode="is_or_not" placeholder="请选择是否空出" />
  37 + </a-form-model-item>
  38 + </a-col>
  39 + <a-col :span="24">
  40 + <a-form-model-item label="是否重入" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isDoubleIn">
  41 + <j-dict-select-tag type="list" v-model="model.isDoubleIn" dictCode="is_or_not" placeholder="请选择是否重入" />
  42 + </a-form-model-item>
  43 + </a-col>
  44 + <a-col :span="24">
  45 + <a-form-model-item label="重入库位号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="originLocationCode">
  46 + <a-input v-model="model.originLocationCode" placeholder="请输入重入库位号" ></a-input>
  47 + </a-form-model-item>
  48 + </a-col>
  49 + <a-col :span="24">
  50 + <a-form-model-item label="任务状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
  51 + <j-dict-select-tag type="list" v-model="model.status" dictCode="task_header_status" placeholder="请选择任务状态" />
  52 + </a-form-model-item>
  53 + </a-col>
  54 + <a-col :span="24">
  55 + <a-form-model-item label="起始出入口" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fromPort">
  56 + <a-input v-model="model.fromPort" placeholder="请输入起始出入口" ></a-input>
  57 + </a-form-model-item>
  58 + </a-col>
  59 + <a-col :span="24">
  60 + <a-form-model-item label="目标出入口" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toPort">
  61 + <a-input v-model="model.toPort" placeholder="请输入目标出入口" ></a-input>
  62 + </a-form-model-item>
  63 + </a-col>
  64 + </a-row>
  65 + </a-form-model>
  66 + </a-spin>
  67 + </j-modal>
  68 +</template>
  69 +
  70 +<script>
  71 +
  72 + import { httpAction } from '@/api/manage'
  73 + import { validateDuplicateValue } from '@/utils/util'
  74 +
  75 + export default {
  76 + name: "TaskHeaderModal",
  77 + components: {
  78 + },
  79 + data () {
  80 + return {
  81 + title:"操作",
  82 + width:800,
  83 + visible: false,
  84 + model:{
  85 + },
  86 + labelCol: {
  87 + xs: { span: 24 },
  88 + sm: { span: 5 },
  89 + },
  90 + wrapperCol: {
  91 + xs: { span: 24 },
  92 + sm: { span: 16 },
  93 + },
  94 +
  95 + confirmLoading: false,
  96 + validatorRules: {
  97 + },
  98 + url: {
  99 + add: "/task/taskHeader/add",
  100 + edit: "/task/taskHeader/edit",
  101 + }
  102 +
  103 + }
  104 + },
  105 + created () {
  106 + //备份model原始值
  107 + this.modelDefault = JSON.parse(JSON.stringify(this.model));
  108 + },
  109 + methods: {
  110 + add () {
  111 + this.edit(this.modelDefault);
  112 + },
  113 + edit (record) {
  114 + this.model = Object.assign({}, record);
  115 + this.visible = true;
  116 + },
  117 + close () {
  118 + this.$emit('close');
  119 + this.visible = false;
  120 + this.$refs.form.clearValidate();
  121 + },
  122 + handleOk () {
  123 + const that = this;
  124 + // 触发表单验证
  125 + this.$refs.form.validate(valid => {
  126 + if (valid) {
  127 + that.confirmLoading = true;
  128 + let httpurl = '';
  129 + let method = '';
  130 + if(!this.model.id){
  131 + httpurl+=this.url.add;
  132 + method = 'post';
  133 + }else{
  134 + httpurl+=this.url.edit;
  135 + method = 'put';
  136 + }
  137 + httpAction(httpurl,this.model,method).then((res)=>{
  138 + if(res.success){
  139 + that.$message.success(res.message);
  140 + that.$emit('ok');
  141 + }else{
  142 + that.$message.warning(res.message);
  143 + }
  144 + }).finally(() => {
  145 + that.confirmLoading = false;
  146 + that.close();
  147 + })
  148 + }else{
  149 + return false
  150 + }
  151 + })
  152 + },
  153 + handleCancel () {
  154 + this.close()
  155 + },
  156 +
  157 +
  158 + }
  159 + }
  160 +</script>
0 161 \ No newline at end of file
... ...
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/container/service/IContainerService.java
... ... @@ -15,4 +15,6 @@ public interface IContainerService extends IService&lt;Container&gt; {
15 15 Result batchAddContainers(Container container, int number);
16 16  
17 17 Container getContainerByCode(String containCode, String warehouseCode);
  18 +
  19 + boolean updateStatus(String containerCode, String status, String wareohuseCode);
18 20 }
... ...
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/container/service/impl/ContainerServiceImpl.java
... ... @@ -27,8 +27,6 @@ public class ContainerServiceImpl extends ServiceImpl&lt;ContainerMapper, Container
27 27  
28 28 @Resource
29 29 IContainerTypeService containerTypeService;
30   - @Resource
31   - IContainerService containerService;
32 30  
33 31 @Override
34 32 public Result batchAddContainers(Container container, int number) {
... ... @@ -47,7 +45,7 @@ public class ContainerServiceImpl extends ServiceImpl&lt;ContainerMapper, Container
47 45 container1.setWarehouseCode(warehouseCode);
48 46 containerList.add(container1);
49 47 }
50   - boolean result = containerService.saveBatch(containerList);
  48 + boolean result = this.saveBatch(containerList);
51 49 if(result) {
52 50 Result.OK("添加成功!");
53 51 }
... ... @@ -59,17 +57,28 @@ public class ContainerServiceImpl extends ServiceImpl&lt;ContainerMapper, Container
59 57 LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery();
60 58 containerLambdaQueryWrapper.eq(Container::getCode, containCode)
61 59 .eq(Container::getWarehouseCode, warehouseCode);
62   - Container container = containerService.getOne(containerLambdaQueryWrapper);
  60 + Container container = this.getOne(containerLambdaQueryWrapper);
63 61 return container;
64 62 }
65 63  
  64 + @Override
  65 + public boolean updateStatus(String containerCode, String status, String wareohuseCode) {
  66 + Container container = this.getContainerByCode(containerCode, wareohuseCode);
  67 + if(container == null) {
  68 + return false;
  69 + }
  70 + container.setStatus(status);
  71 + boolean result = this.updateById(container);
  72 + return result;
  73 + }
  74 +
66 75  
67 76 private int getStartNumber(String containerTypeCode, String warehouseCode) {
68 77 LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery();
69 78 containerLambdaQueryWrapper.eq(Container::getContainerTypeCode, containerTypeCode)
70 79 .eq(Container::getWarehouseCode, warehouseCode)
71 80 .orderByDesc(Container::getId).last("Limit 1");
72   - Container container = containerService.getOne(containerLambdaQueryWrapper);
  81 + Container container = this.getOne(containerLambdaQueryWrapper);
73 82 //如果指定类型的最后的code存在,那么 code = 容器类型 + (排序号 + 1)
74 83 if (container != null && container.getCode() != null) {
75 84 Integer number = Integer.valueOf(container.getCode().substring(container.getCode().length() - 5, container.getCode().length()));
... ...
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/location/service/ILocationService.java
... ... @@ -11,4 +11,14 @@ import org.jeecg.modules.wms.config.location.entity.Location;
11 11 */
12 12 public interface ILocationService extends IService<Location> {
13 13  
  14 + Location getLocationByCode(String locationCode, String wareohuseCode);
  15 +
  16 + boolean updateStatus(String locationCode, String status, String wareohuseCode);
  17 +
  18 + Location getNear(Location location);
  19 +
  20 + Location getInsideNear(Location location);
  21 +
  22 + Location getOutSideNear(Location location);
  23 +
14 24 }
... ...
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/location/service/impl/LocationServiceImpl.java
1 1 package org.jeecg.modules.wms.config.location.service.impl;
2 2  
  3 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  4 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
3 5 import org.jeecg.modules.wms.config.location.entity.Location;
4 6 import org.jeecg.modules.wms.config.location.mapper.LocationMapper;
5 7 import org.jeecg.modules.wms.config.location.service.ILocationService;
  8 +import org.jeecg.utils.constant.QuantityConstant;
6 9 import org.springframework.stereotype.Service;
7 10  
8 11 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
9 12  
  13 +import javax.annotation.Resource;
  14 +import java.util.List;
  15 +
10 16 /**
11 17 * @Description: 库位管理
12 18 * @Author: jeecg-boot
... ... @@ -16,4 +22,76 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
16 22 @Service
17 23 public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> implements ILocationService {
18 24  
  25 +
  26 + @Override
  27 + public Location getLocationByCode(String locationCode, String wareohuseCode) {
  28 + LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery();
  29 + locationLambdaQueryWrapper.eq(Location::getCode, locationCode)
  30 + .eq(Location::getWarehouseCode, wareohuseCode);
  31 + Location location = this.getOne(locationLambdaQueryWrapper);
  32 + return location;
  33 + }
  34 +
  35 + @Override
  36 + public boolean updateStatus(String locationCode, String status, String wareohuseCode) {
  37 + Location location = getLocationByCode(locationCode, wareohuseCode);
  38 + if(location == null) {
  39 + return false;
  40 + }
  41 + location.setStatus(QuantityConstant.STATUS_LOCATION_LOCK);
  42 + boolean result = updateById(location);
  43 + return result;
  44 + }
  45 +
  46 + @Override
  47 + public Location getNear(Location location) {
  48 + int rowFlag = location.getRowFlag();
  49 + Location locaiton1 = null;
  50 + if (rowFlag == 1) {
  51 + locaiton1 = getInsideNear(location);
  52 + } else {
  53 + locaiton1 = getOutSideNear(location);
  54 + }
  55 + return locaiton1;
  56 + }
  57 +
  58 + @Override
  59 + public Location getInsideNear(Location location) {
  60 + LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery();
  61 + locationLambdaQueryWrapper.eq(Location::getWarehouseCode, location.getWarehouseCode())
  62 + .eq(Location::getZoneCode, location.getZoneCode())
  63 + .eq(Location::getRoadWay, location.getRoadWay())
  64 + .eq(Location::getIcolumn, location.getIcolumn())
  65 + .eq(Location::getLayer, location.getLayer())
  66 + .eq(Location::getLocationTypeCode, location.getLocationTypeCode())
  67 + .eq(Location::getRowFlag, QuantityConstant.ROW_IN);
  68 + List<Location> locationList = list(locationLambdaQueryWrapper);
  69 + for (Location location1 : locationList) {
  70 + int diff = Math.abs(location1.getRow().intValue() - location.getRow().intValue());
  71 + if (diff == 1) {
  72 + return location1;
  73 + }
  74 + }
  75 + return null;
  76 + }
  77 +
  78 + @Override
  79 + public Location getOutSideNear(Location location) {
  80 + LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery();
  81 + locationLambdaQueryWrapper.eq(Location::getWarehouseCode, location.getWarehouseCode())
  82 + .eq(Location::getZoneCode, location.getZoneCode())
  83 + .eq(Location::getRoadWay, location.getRoadWay())
  84 + .eq(Location::getIcolumn, location.getIcolumn())
  85 + .eq(Location::getLayer, location.getLayer())
  86 + .eq(Location::getLocationTypeCode, location.getLocationTypeCode())
  87 + .eq(Location::getRowFlag, QuantityConstant.ROW_OUT);
  88 + List<Location> locationList = list(locationLambdaQueryWrapper);
  89 + for (Location location1 : locationList) {
  90 + int diff = Math.abs(location1.getRow().intValue() - location.getRow().intValue());
  91 + if (diff == 1) {
  92 + return location1;
  93 + }
  94 + }
  95 + return null;
  96 + }
19 97 }
... ...
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/controller/ReceiptContainerHeaderController.java
... ... @@ -7,10 +7,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7 7 import lombok.extern.slf4j.Slf4j;
8 8 import org.jeecg.common.system.base.controller.JeecgController;
9 9 import org.jeecg.common.api.vo.Result;
  10 +import org.jeecg.common.system.util.JwtUtil;
10 11 import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContaienrDetail;
11 12 import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader;
12 13 import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContaienrDetailService;
13 14 import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerHeaderService;
  15 +import org.jeecg.modules.wms.receipt.receiving.domain.Receive;
14 16 import org.springframework.beans.factory.annotation.Autowired;
15 17 import org.springframework.web.bind.annotation.*;
16 18 import javax.servlet.http.HttpServletRequest;
... ... @@ -290,7 +292,17 @@ public class ReceiptContainerHeaderController extends JeecgController&lt;ReceiptCon
290 292  
291 293 /*--------------------------------子表处理-入库组盘详情-end----------------------------------------------*/
292 294  
293   -
  295 + /**
  296 + * 创建任务
  297 + * @return
  298 + */
  299 + @ApiOperation(value="入库组盘-创建任务", notes="入库组盘-创建任务")
  300 + @PostMapping("/createTask")
  301 + @ResponseBody
  302 + public Result createTask(@RequestBody ReceiptContainerHeader receiptContainerHeader, HttpServletRequest req) {
  303 + String warehouseCode = JwtUtil.getWarehouseCodeByToken(req);
  304 + return receiptContainerHeaderService.createTask(receiptContainerHeader, warehouseCode);
  305 + }
294 306  
295 307  
296 308 }
... ...
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/service/IReceiptContainerHeaderService.java
1 1 package org.jeecg.modules.wms.receipt.receiptContainerHeader.service;
2 2  
3 3 import com.baomidou.mybatisplus.extension.service.IService;
  4 +import org.jeecg.common.api.vo.Result;
4 5 import org.jeecg.modules.wms.config.container.entity.Container;
5 6 import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader;
6 7 import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -27,4 +28,6 @@ public interface IReceiptContainerHeaderService extends IService&lt;ReceiptContaine
27 28 public void delBatchMain (Collection<? extends Serializable> idList);
28 29  
29 30 ReceiptContainerHeader getUnCompleteReceiptContainerByCode(String containerCode, String warehouseCode);
  31 +
  32 + public Result createTask(ReceiptContainerHeader receiptContainerHeader, String warehouseCode);
30 33 }
... ...
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/service/impl/ReceiptContainerHeaderServiceImpl.java
1 1 package org.jeecg.modules.wms.receipt.receiptContainerHeader.service.impl;
2 2  
  3 +import com.aliyun.oss.ServiceException;
3 4 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
4 5 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  6 +import org.jeecg.common.api.vo.Result;
  7 +import org.jeecg.modules.wms.config.container.entity.Container;
  8 +import org.jeecg.modules.wms.config.container.service.IContainerService;
  9 +import org.jeecg.modules.wms.config.location.entity.Location;
  10 +import org.jeecg.modules.wms.config.location.service.ILocationService;
  11 +import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContaienrDetail;
5 12 import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader;
6 13 import org.jeecg.modules.wms.receipt.receiptContainerHeader.mapper.ReceiptContaienrDetailMapper;
7 14 import org.jeecg.modules.wms.receipt.receiptContainerHeader.mapper.ReceiptContainerHeaderMapper;
  15 +import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContaienrDetailService;
8 16 import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerHeaderService;
  17 +import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail;
  18 +import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptDetailService;
  19 +import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptHeaderService;
  20 +import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail;
  21 +import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader;
  22 +import org.jeecg.modules.wms.task.taskHeader.service.ITaskDetailService;
  23 +import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService;
  24 +import org.jeecg.utils.StringUtils;
9 25 import org.jeecg.utils.constant.QuantityConstant;
10 26 import org.springframework.stereotype.Service;
11 27 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
12 28 import org.springframework.beans.factory.annotation.Autowired;
13 29 import org.springframework.transaction.annotation.Transactional;
  30 +
  31 +import javax.annotation.Resource;
14 32 import java.io.Serializable;
  33 +import java.util.ArrayList;
15 34 import java.util.List;
16 35 import java.util.Collection;
  36 +import java.util.stream.Collectors;
17 37  
18 38 /**
19 39 * @Description: 入库组盘
... ... @@ -28,6 +48,22 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
28 48 private ReceiptContainerHeaderMapper receiptContainerHeaderMapper;
29 49 @Autowired
30 50 private ReceiptContaienrDetailMapper receiptContaienrDetailMapper;
  51 + @Resource
  52 + private IContainerService containerService;
  53 + @Resource
  54 + private IReceiptContaienrDetailService receiptContaienrDetailService;
  55 + @Resource
  56 + private ILocationService locationService;
  57 + @Resource
  58 + private IReceiptContainerHeaderService receiptContainerHeaderService;
  59 + @Resource
  60 + private ITaskHeaderService taskHeaderService;
  61 + @Resource
  62 + private ITaskDetailService taskDetailService;
  63 + @Resource
  64 + private IReceiptDetailService receiptDetailService;
  65 + @Resource
  66 + private IReceiptHeaderService receiptHeaderService;
31 67  
32 68 @Override
33 69 @Transactional
... ... @@ -55,4 +91,135 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
55 91 return receiptContainerHeader;
56 92 }
57 93  
  94 + @Override
  95 + @Transactional
  96 + public Result createTask(ReceiptContainerHeader receiptContainerHeader, String warehouseCode) {
  97 + int id = receiptContainerHeader.getId();
  98 + receiptContainerHeader = this.getById(id);
  99 + if (receiptContainerHeader == null) {
  100 + return Result.error("id:" + id + "的入库组盘不存在!");
  101 + }
  102 + if (!receiptContainerHeader.getWarehouseCode().equals(warehouseCode)) {
  103 + return Result.error("id:" + id + "的入库组盘不能在" + warehouseCode + "仓库操作");
  104 + }
  105 + String containerCode = receiptContainerHeader.getContainerCode();
  106 + Container container = containerService.getContainerByCode(containerCode, warehouseCode);
  107 + if(container.getStatus().equals(QuantityConstant.STATUS_CONTAINER_LOCK)) {
  108 + return Result.error("托盘已经锁定,不能生成任务");
  109 + }
  110 + LambdaQueryWrapper<ReceiptContaienrDetail> receiptContaienrDetailLambdaQueryWrapper = Wrappers.lambdaQuery();
  111 + receiptContaienrDetailLambdaQueryWrapper.eq(ReceiptContaienrDetail::getReceiptContainerId, receiptContainerHeader.getId());
  112 + List<ReceiptContaienrDetail> receiptContaienrDetailList =
  113 + receiptContaienrDetailService.list(receiptContaienrDetailLambdaQueryWrapper);
  114 + if(receiptContaienrDetailList.isEmpty()) {
  115 + return Result.error("id:" + id + "的入库组盘,没有组盘明细,请先组盘!");
  116 + }
  117 + boolean result = containerService.updateStatus(containerCode,
  118 + QuantityConstant.STATUS_CONTAINER_LOCK, warehouseCode);
  119 + if(!result) {
  120 + throw new ServiceException("更新容器状态失败");
  121 + }
  122 + String fromLocationCode = receiptContainerHeader.getFromLocationCode();
  123 + String toLocaitonCode = receiptContainerHeader.getToLocationCode();
  124 + if(StringUtils.isNotEmpty(fromLocationCode)) {
  125 + result = locationService.updateStatus(fromLocationCode,
  126 + QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode);
  127 + if(!result) {
  128 + throw new ServiceException("更新起始库位状态失败");
  129 + }
  130 + }
  131 + String zoneCode = null;
  132 + if(StringUtils.isNotEmpty(toLocaitonCode)) {
  133 + result = locationService.updateStatus(toLocaitonCode,
  134 + QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode);
  135 + if(!result) {
  136 + throw new ServiceException("更新目标库位状态失败");
  137 + }
  138 + Location toLocation = locationService.getLocationByCode(toLocaitonCode, warehouseCode);
  139 + if(!toLocation.getWarehouseCode().equals(warehouseCode)) {
  140 + throw new ServiceException("库位对应的仓库不匹配");
  141 + }
  142 + zoneCode = toLocation.getZoneCode();
  143 + //旁边库位有任务
  144 + if (taskHeaderService.haveUncompleteTaskInNear(toLocation)) {
  145 + throw new ServiceException("旁边库位任务数大于0");
  146 + }
  147 + }
  148 + int receiptContainerStatus = receiptContainerHeader.getStatus();
  149 + if(receiptContainerStatus != QuantityConstant.RECEIPT_CONTAINER_BUILD) {
  150 + throw new ServiceException("入库组盘状态不是创建状态");
  151 + }
  152 + receiptContainerHeader.setStatus(QuantityConstant.RECEIPT_CONTAINER_TASK);
  153 + result = receiptContainerHeaderService.updateById(receiptContainerHeader);
  154 + if(!result) {
  155 + throw new ServiceException("更新入库组盘头状态失败");
  156 + }
  157 + TaskHeader taskHeader = new TaskHeader();
  158 + taskHeader.setContainerCode(containerCode);
  159 + taskHeader.setTaskType(receiptContainerHeader.getTaskType());
  160 + taskHeader.setInnernalTaskType(QuantityConstant.TASK_INTENERTYPE_RECEIPT);
  161 + taskHeader.setFromLocationCode(fromLocationCode);
  162 + taskHeader.setToLocationCode(toLocaitonCode);
  163 + taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD);
  164 + taskHeader.setCompanyCode(receiptContainerHeader.getCompanyCode());
  165 + taskHeader.setReceiptContaienrHeaderId(receiptContainerHeader.getId());
  166 + taskHeader.setWarehouseCode(warehouseCode);
  167 + taskHeader.setZoneCode(zoneCode);
  168 + taskHeader.setToPort(receiptContainerHeader.getToPort());
  169 + result = taskHeaderService.save(taskHeader);
  170 + if(!result) {
  171 + throw new ServiceException("任务生成失败");
  172 + }
  173 + List<TaskDetail> taskDetailList = new ArrayList<>();
  174 + List<ReceiptDetail> receiptDetailList = new ArrayList<>();
  175 + for(ReceiptContaienrDetail receiptContaienrDetail : receiptContaienrDetailList) {
  176 + TaskDetail taskDetail = new TaskDetail();
  177 + taskDetail.setTaskHeaderId(taskHeader.getId());
  178 + taskDetail.setTaskType(taskHeader.getTaskType());
  179 + taskDetail.setWarehouseCode(receiptContaienrDetail.getWarehouseCode());
  180 + taskDetail.setReceiptId(receiptContaienrDetail.getReceiptId());
  181 + taskDetail.setReceiptDetailId(receiptContaienrDetail.getReceiptDetailId());
  182 + taskDetail.setReceiptContainerDetailId(receiptContaienrDetail.getId());
  183 + taskDetail.setCompanyCode(receiptContaienrDetail.getCompanyCode());
  184 + taskDetail.setMaterialCode(receiptContaienrDetail.getMaterialCode());
  185 + taskDetail.setMaterialName(receiptContaienrDetail.getMaterialName());
  186 + taskDetail.setMaterialSpec(receiptContaienrDetail.getMaterialSpec());
  187 + taskDetail.setMaterialUnit(receiptContaienrDetail.getMaterialUnit());
  188 + taskDetail.setInventoryStatus(receiptContaienrDetail.getInventoryStatus());
  189 + taskDetail.setQty(receiptContaienrDetail.getQty());
  190 + taskDetail.setBatch(receiptContaienrDetail.getBatch());
  191 + taskDetail.setLot(receiptContaienrDetail.getLot());
  192 + taskDetail.setProject(receiptContaienrDetail.getProject());
  193 + taskDetailList.add(taskDetail);
  194 + ReceiptDetail receiptDetail = receiptDetailService.getById(receiptContaienrDetail.getReceiptDetailId());
  195 + if(receiptDetail == null) {
  196 + throw new ServiceException("根据id:" + receiptContaienrDetail.getReceiptDetailId() + ",没有找到入库单详情");
  197 + }
  198 + receiptDetail.setStatus(QuantityConstant.RECEIPT_HEADER_WAIT_SHELF);
  199 + receiptDetailList.add(receiptDetail);
  200 + }
  201 + result = taskDetailService.saveBatch(taskDetailList);
  202 + if(!result) {
  203 + throw new ServiceException("任务详情生成失败");
  204 + }
  205 + receiptContainerHeader.setStatus(QuantityConstant.RECEIPT_CONTAINER_TASK);
  206 + result = this.updateById(receiptContainerHeader);
  207 + if(!result) {
  208 + throw new ServiceException("生成任务时,更新入库组盘头失败");
  209 + }
  210 + result = receiptDetailService.updateBatchById(receiptDetailList);
  211 + if(!result) {
  212 + throw new ServiceException("更新入库单明细失败");
  213 + }
  214 + List<Integer> receiptIdList =receiptDetailList.stream()
  215 + .map(ReceiptDetail::getReceiptId).distinct().collect(Collectors.toList());
  216 + for(Integer receiptId : receiptIdList) {
  217 + result = receiptHeaderService.updateReceiptHeaderStatus(receiptId);
  218 + if (!result) {
  219 + throw new ServiceException("更新入库单明细失败");
  220 + }
  221 + }
  222 + return Result.OK("生成入库任务成功");
  223 + }
  224 +
58 225 }
... ...
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/IReceiptHeaderService.java
... ... @@ -29,4 +29,6 @@ public interface IReceiptHeaderService extends IService&lt;ReceiptHeader&gt; {
29 29 public Result saveReceiptHeader(ReceiptHeader receiptHeader);
30 30  
31 31 public String createCode(String receiptType);
  32 +
  33 + public boolean updateReceiptHeaderStatus(Integer id);
32 34 }
... ...
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/impl/ReceiptHeaderServiceImpl.java
... ... @@ -8,9 +8,11 @@ import org.jeecg.common.util.DateUtils;
8 8 import org.jeecg.modules.wms.config.receiptType.entity.ReceiptType;
9 9 import org.jeecg.modules.wms.config.receiptType.service.IReceiptTypeService;
10 10 import org.jeecg.modules.wms.config.receiptType.service.impl.ReceiptTypeServiceImpl;
  11 +import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail;
11 12 import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader;
12 13 import org.jeecg.modules.wms.receipt.receiptHeader.mapper.ReceiptDetailMapper;
13 14 import org.jeecg.modules.wms.receipt.receiptHeader.mapper.ReceiptHeaderMapper;
  15 +import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptDetailService;
14 16 import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptHeaderService;
15 17 import org.jeecg.utils.StringUtils;
16 18 import org.jeecg.utils.constant.QuantityConstant;
... ... @@ -41,6 +43,10 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl&lt;ReceiptHeaderMapper, R
41 43 private ReceiptDetailMapper receiptDetailMapper;
42 44 @Resource
43 45 private IReceiptTypeService receiptTypeService;
  46 + @Resource
  47 + private IReceiptDetailService receiptDetailService;
  48 + @Resource
  49 + private IReceiptHeaderService receiptHeaderService;
44 50  
45 51 @Override
46 52 @Transactional
... ... @@ -112,4 +118,45 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl&lt;ReceiptHeaderMapper, R
112 118 }
113 119 return code;
114 120 }
  121 +
  122 + /**
  123 + * 更新入库单 头状态和尾状态
  124 + * 头状态是单据详情中最大的状态
  125 + * 尾状态是单据详情中最小的状态
  126 + * @param id
  127 + * @return
  128 + */
  129 + @Override
  130 + public boolean updateReceiptHeaderStatus(Integer id) {
  131 + LambdaQueryWrapper<ReceiptDetail> receiptDetailLambdaQueryWrapper = Wrappers.lambdaQuery();
  132 + receiptDetailLambdaQueryWrapper.eq(ReceiptDetail::getId, id);
  133 + List<ReceiptDetail> receiptDetailList = receiptDetailService.list(receiptDetailLambdaQueryWrapper);
  134 + ReceiptHeader receiptHeader = receiptHeaderService.getById(id);
  135 + if(receiptHeader == null) {
  136 + return false;
  137 + }
  138 + int minStatus;
  139 + int maxStatus;
  140 + if(receiptDetailList.size() == 0) {
  141 + minStatus = QuantityConstant.RECEIPT_HEADER_BUILD;
  142 + maxStatus = QuantityConstant.RECEIPT_HEADER_BUILD;
  143 + } else {
  144 + minStatus = QuantityConstant.RECEIPT_HEADER_BUILD;
  145 + maxStatus = QuantityConstant.RECEIPT_HEADER_BUILD;
  146 + for(ReceiptDetail receiptDetail : receiptDetailList) {
  147 + int status = receiptDetail.getStatus();
  148 + if (minStatus > status) {
  149 + minStatus = status;
  150 + }
  151 + if (maxStatus < status) {
  152 + maxStatus = status;
  153 + }
  154 + }
  155 + }
  156 +
  157 + receiptHeader.setFirstStatus(maxStatus);
  158 + receiptHeader.setLastStatus(minStatus);
  159 + boolean result = receiptHeaderService.updateById(receiptHeader);
  160 + return result;
  161 + }
115 162 }
... ...
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiving/service/impl/ReceiveServiceImpl.java
... ... @@ -52,6 +52,8 @@ public class ReceiveServiceImpl extends ServiceImpl&lt;ReceiveMapper, Receive&gt; imp
52 52 private IContainerTypeService containerTypeService;
53 53 @Resource
54 54 private IReceiptContaienrDetailService receiptContaienrDetailService;
  55 + @Resource
  56 + private IReceiptHeaderService receiptHeaderService;
55 57  
56 58 /**
57 59 * 1.判断容器是否存在,并且不能被锁定
... ... @@ -140,6 +142,13 @@ public class ReceiveServiceImpl extends ServiceImpl&lt;ReceiveMapper, Receive&gt; imp
140 142 if(receiptDetail == null) {
141 143 throw new ServiceException("没有找到入库单详情,id:" + receive.getId());
142 144 }
  145 + ReceiptHeader receiptHeader = receiptHeaderService.getById(receiptDetail.getReceiptId());
  146 + if(receiptHeader == null) {
  147 + throw new ServiceException("没有找到入库单,id:" + receiptDetail.getReceiptId());
  148 + }
  149 + if(receiptHeader.getWarehouseCode().equals(warehouseCode)) {
  150 + throw new ServiceException("仓库编码不一致,不能操作");
  151 + }
143 152 String materialCode = receiptDetail.getMaterialCode();
144 153 if(StringUtils.isEmpty(materialCode)) {
145 154 throw new ServiceException("物料编码为空");
... ... @@ -198,7 +207,7 @@ public class ReceiveServiceImpl extends ServiceImpl&lt;ReceiveMapper, Receive&gt; imp
198 207 throw new ServiceException("保存入库组盘详情失败");
199 208 }
200 209 }
201   -
  210 +
202 211 return Result.OK("收货成功");
203 212 }
204 213 }
... ...
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/task/taskHeader/controller/TaskHeaderController.java 0 → 100644
  1 +package org.jeecg.modules.wms.task.taskHeader.controller;
  2 +
  3 +import org.jeecg.common.system.query.QueryGenerator;
  4 +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  5 +import com.baomidou.mybatisplus.core.metadata.IPage;
  6 +import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  7 +import lombok.extern.slf4j.Slf4j;
  8 +import org.jeecg.common.system.base.controller.JeecgController;
  9 +import org.jeecg.common.api.vo.Result;
  10 +import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail;
  11 +import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader;
  12 +import org.jeecg.modules.wms.task.taskHeader.service.ITaskDetailService;
  13 +import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService;
  14 +import org.springframework.beans.factory.annotation.Autowired;
  15 +import org.springframework.web.bind.annotation.*;
  16 +import javax.servlet.http.HttpServletRequest;
  17 +import javax.servlet.http.HttpServletResponse;
  18 +import org.springframework.web.servlet.ModelAndView;
  19 +import java.util.Arrays;
  20 +import org.jeecg.common.util.oConvertUtils;
  21 +import io.swagger.annotations.Api;
  22 +import io.swagger.annotations.ApiOperation;
  23 +import org.jeecg.common.aspect.annotation.AutoLog;
  24 +import org.apache.shiro.SecurityUtils;
  25 +import org.jeecg.common.system.vo.LoginUser;
  26 +import org.jeecgframework.poi.excel.ExcelImportUtil;
  27 +import org.jeecgframework.poi.excel.def.NormalExcelConstants;
  28 +import org.jeecgframework.poi.excel.entity.ExportParams;
  29 +import org.jeecgframework.poi.excel.entity.ImportParams;
  30 +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
  31 +import org.springframework.web.multipart.MultipartFile;
  32 +import org.springframework.web.multipart.MultipartHttpServletRequest;
  33 +import java.io.IOException;
  34 +import java.util.List;
  35 +import java.util.Map;
  36 +import java.util.stream.Collectors;
  37 +
  38 + /**
  39 + * @Description: 任务表
  40 + * @Author: jeecg-boot
  41 + * @Date: 2022-11-10
  42 + * @Version: V1.0
  43 + */
  44 +@Api(tags="任务表")
  45 +@RestController
  46 +@RequestMapping("/task/taskHeader")
  47 +@Slf4j
  48 +public class TaskHeaderController extends JeecgController<TaskHeader, ITaskHeaderService> {
  49 +
  50 + @Autowired
  51 + private ITaskHeaderService taskHeaderService;
  52 +
  53 + @Autowired
  54 + private ITaskDetailService taskDetailService;
  55 +
  56 +
  57 + /*---------------------------------主表处理-begin-------------------------------------*/
  58 +
  59 + /**
  60 + * 分页列表查询
  61 + * @param taskHeader
  62 + * @param pageNo
  63 + * @param pageSize
  64 + * @param req
  65 + * @return
  66 + */
  67 + //@AutoLog(value = "任务表-分页列表查询")
  68 + @ApiOperation(value="任务表-分页列表查询", notes="任务表-分页列表查询")
  69 + @GetMapping(value = "/list")
  70 + public Result<IPage<TaskHeader>> queryPageList(TaskHeader taskHeader,
  71 + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
  72 + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
  73 + HttpServletRequest req) {
  74 + QueryWrapper<TaskHeader> queryWrapper = QueryGenerator.initQueryWrapper(taskHeader, req.getParameterMap());
  75 + Page<TaskHeader> page = new Page<TaskHeader>(pageNo, pageSize);
  76 + IPage<TaskHeader> pageList = taskHeaderService.page(page, queryWrapper);
  77 + return Result.OK(pageList);
  78 + }
  79 +
  80 + /**
  81 + * 添加
  82 + * @param taskHeader
  83 + * @return
  84 + */
  85 + @AutoLog(value = "任务表-添加")
  86 + @ApiOperation(value="任务表-添加", notes="任务表-添加")
  87 + @PostMapping(value = "/add")
  88 + public Result<String> add(@RequestBody TaskHeader taskHeader) {
  89 + taskHeaderService.save(taskHeader);
  90 + return Result.OK("添加成功!");
  91 + }
  92 +
  93 + /**
  94 + * 编辑
  95 + * @param taskHeader
  96 + * @return
  97 + */
  98 + @AutoLog(value = "任务表-编辑")
  99 + @ApiOperation(value="任务表-编辑", notes="任务表-编辑")
  100 + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
  101 + public Result<String> edit(@RequestBody TaskHeader taskHeader) {
  102 + taskHeaderService.updateById(taskHeader);
  103 + return Result.OK("编辑成功!");
  104 + }
  105 +
  106 + /**
  107 + * 通过id删除
  108 + * @param id
  109 + * @return
  110 + */
  111 + @AutoLog(value = "任务表-通过id删除")
  112 + @ApiOperation(value="任务表-通过id删除", notes="任务表-通过id删除")
  113 + @DeleteMapping(value = "/delete")
  114 + public Result<String> delete(@RequestParam(name="id",required=true) String id) {
  115 + taskHeaderService.delMain(id);
  116 + return Result.OK("删除成功!");
  117 + }
  118 +
  119 + /**
  120 + * 批量删除
  121 + * @param ids
  122 + * @return
  123 + */
  124 + @AutoLog(value = "任务表-批量删除")
  125 + @ApiOperation(value="任务表-批量删除", notes="任务表-批量删除")
  126 + @DeleteMapping(value = "/deleteBatch")
  127 + public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
  128 + this.taskHeaderService.delBatchMain(Arrays.asList(ids.split(",")));
  129 + return Result.OK("批量删除成功!");
  130 + }
  131 +
  132 + /**
  133 + * 导出
  134 + * @return
  135 + */
  136 + @RequestMapping(value = "/exportXls")
  137 + public ModelAndView exportXls(HttpServletRequest request, TaskHeader taskHeader) {
  138 + return super.exportXls(request, taskHeader, TaskHeader.class, "任务表");
  139 + }
  140 +
  141 + /**
  142 + * 导入
  143 + * @return
  144 + */
  145 + @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
  146 + public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
  147 + return super.importExcel(request, response, TaskHeader.class);
  148 + }
  149 + /*---------------------------------主表处理-end-------------------------------------*/
  150 +
  151 +
  152 + /*--------------------------------子表处理-任务详情-begin----------------------------------------------*/
  153 + /**
  154 + * 通过主表ID查询
  155 + * @return
  156 + */
  157 + //@AutoLog(value = "任务详情-通过主表ID查询")
  158 + @ApiOperation(value="任务详情-通过主表ID查询", notes="任务详情-通过主表ID查询")
  159 + @GetMapping(value = "/listTaskDetailByMainId")
  160 + public Result<IPage<TaskDetail>> listTaskDetailByMainId(TaskDetail taskDetail,
  161 + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
  162 + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
  163 + HttpServletRequest req) {
  164 + QueryWrapper<TaskDetail> queryWrapper = QueryGenerator.initQueryWrapper(taskDetail, req.getParameterMap());
  165 + Page<TaskDetail> page = new Page<TaskDetail>(pageNo, pageSize);
  166 + IPage<TaskDetail> pageList = taskDetailService.page(page, queryWrapper);
  167 + return Result.OK(pageList);
  168 + }
  169 +
  170 + /**
  171 + * 添加
  172 + * @param taskDetail
  173 + * @return
  174 + */
  175 + @AutoLog(value = "任务详情-添加")
  176 + @ApiOperation(value="任务详情-添加", notes="任务详情-添加")
  177 + @PostMapping(value = "/addTaskDetail")
  178 + public Result<String> addTaskDetail(@RequestBody TaskDetail taskDetail) {
  179 + taskDetailService.save(taskDetail);
  180 + return Result.OK("添加成功!");
  181 + }
  182 +
  183 + /**
  184 + * 编辑
  185 + * @param taskDetail
  186 + * @return
  187 + */
  188 + @AutoLog(value = "任务详情-编辑")
  189 + @ApiOperation(value="任务详情-编辑", notes="任务详情-编辑")
  190 + @RequestMapping(value = "/editTaskDetail", method = {RequestMethod.PUT,RequestMethod.POST})
  191 + public Result<String> editTaskDetail(@RequestBody TaskDetail taskDetail) {
  192 + taskDetailService.updateById(taskDetail);
  193 + return Result.OK("编辑成功!");
  194 + }
  195 +
  196 + /**
  197 + * 通过id删除
  198 + * @param id
  199 + * @return
  200 + */
  201 + @AutoLog(value = "任务详情-通过id删除")
  202 + @ApiOperation(value="任务详情-通过id删除", notes="任务详情-通过id删除")
  203 + @DeleteMapping(value = "/deleteTaskDetail")
  204 + public Result<String> deleteTaskDetail(@RequestParam(name="id",required=true) String id) {
  205 + taskDetailService.removeById(id);
  206 + return Result.OK("删除成功!");
  207 + }
  208 +
  209 + /**
  210 + * 批量删除
  211 + * @param ids
  212 + * @return
  213 + */
  214 + @AutoLog(value = "任务详情-批量删除")
  215 + @ApiOperation(value="任务详情-批量删除", notes="任务详情-批量删除")
  216 + @DeleteMapping(value = "/deleteBatchTaskDetail")
  217 + public Result<String> deleteBatchTaskDetail(@RequestParam(name="ids",required=true) String ids) {
  218 + this.taskDetailService.removeByIds(Arrays.asList(ids.split(",")));
  219 + return Result.OK("批量删除成功!");
  220 + }
  221 +
  222 + /**
  223 + * 导出
  224 + * @return
  225 + */
  226 + @RequestMapping(value = "/exportTaskDetail")
  227 + public ModelAndView exportTaskDetail(HttpServletRequest request, TaskDetail taskDetail) {
  228 + // Step.1 组装查询条件
  229 + QueryWrapper<TaskDetail> queryWrapper = QueryGenerator.initQueryWrapper(taskDetail, request.getParameterMap());
  230 + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
  231 +
  232 + // Step.2 获取导出数据
  233 + List<TaskDetail> pageList = taskDetailService.list(queryWrapper);
  234 + List<TaskDetail> exportList = null;
  235 +
  236 + // 过滤选中数据
  237 + String selections = request.getParameter("selections");
  238 + if (oConvertUtils.isNotEmpty(selections)) {
  239 + List<String> selectionList = Arrays.asList(selections.split(","));
  240 + exportList = pageList.stream().filter(item -> selectionList.contains(item.getId())).collect(Collectors.toList());
  241 + } else {
  242 + exportList = pageList;
  243 + }
  244 +
  245 + // Step.3 AutoPoi 导出Excel
  246 + ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
  247 + mv.addObject(NormalExcelConstants.FILE_NAME, "任务详情"); //此处设置的filename无效 ,前端会重更新设置一下
  248 + mv.addObject(NormalExcelConstants.CLASS, TaskDetail.class);
  249 + mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("任务详情报表", "导出人:" + sysUser.getRealname(), "任务详情"));
  250 + mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
  251 + return mv;
  252 + }
  253 +
  254 + /**
  255 + * 导入
  256 + * @return
  257 + */
  258 + @RequestMapping(value = "/importTaskDetail/{mainId}")
  259 + public Result<?> importTaskDetail(HttpServletRequest request, HttpServletResponse response, @PathVariable("mainId") Integer mainId) {
  260 + MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
  261 + Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
  262 + for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
  263 + MultipartFile file = entity.getValue();// 获取上传文件对象
  264 + ImportParams params = new ImportParams();
  265 + params.setTitleRows(2);
  266 + params.setHeadRows(1);
  267 + params.setNeedSave(true);
  268 + try {
  269 + List<TaskDetail> list = ExcelImportUtil.importExcel(file.getInputStream(), TaskDetail.class, params);
  270 + for (TaskDetail temp : list) {
  271 + temp.setTaskHeaderId(mainId);
  272 + }
  273 + long start = System.currentTimeMillis();
  274 + taskDetailService.saveBatch(list);
  275 + log.info("消耗时间" + (System.currentTimeMillis() - start) + "毫秒");
  276 + return Result.OK("文件导入成功!数据行数:" + list.size());
  277 + } catch (Exception e) {
  278 + log.error(e.getMessage(), e);
  279 + return Result.error("文件导入失败:" + e.getMessage());
  280 + } finally {
  281 + try {
  282 + file.getInputStream().close();
  283 + } catch (IOException e) {
  284 + e.printStackTrace();
  285 + }
  286 + }
  287 + }
  288 + return Result.error("文件导入失败!");
  289 + }
  290 +
  291 + /*--------------------------------子表处理-任务详情-end----------------------------------------------*/
  292 +
  293 +
  294 +
  295 +
  296 +}
... ...
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/task/taskHeader/entity/TaskDetail.java 0 → 100644
  1 +package org.jeecg.modules.wms.task.taskHeader.entity;
  2 +
  3 +import java.io.Serializable;
  4 +import com.baomidou.mybatisplus.annotation.IdType;
  5 +import com.baomidou.mybatisplus.annotation.TableId;
  6 +import com.baomidou.mybatisplus.annotation.TableName;
  7 +import org.jeecg.common.aspect.annotation.Dict;
  8 +import lombok.Data;
  9 +import com.fasterxml.jackson.annotation.JsonFormat;
  10 +import org.springframework.format.annotation.DateTimeFormat;
  11 +import org.jeecgframework.poi.excel.annotation.Excel;
  12 +
  13 +import java.math.BigDecimal;
  14 +import java.util.Date;
  15 +import io.swagger.annotations.ApiModel;
  16 +import io.swagger.annotations.ApiModelProperty;
  17 +import java.io.UnsupportedEncodingException;
  18 +
  19 +/**
  20 + * @Description: 任务详情
  21 + * @Author: jeecg-boot
  22 + * @Date: 2022-11-10
  23 + * @Version: V1.0
  24 + */
  25 +@Data
  26 +@TableName("task_detail")
  27 +@ApiModel(value="task_detail对象", description="任务详情")
  28 +public class TaskDetail implements Serializable {
  29 + private static final long serialVersionUID = 1L;
  30 +
  31 + /**主键*/
  32 + @TableId(type = IdType.AUTO)
  33 + @ApiModelProperty(value = "主键")
  34 + private Integer id;
  35 + /**任务头ID*/
  36 + @ApiModelProperty(value = "任务头ID")
  37 + private Integer taskHeaderId;
  38 + /**任务类型*/
  39 + @Excel(name = "任务类型", width = 15)
  40 + @ApiModelProperty(value = "任务类型")
  41 + private Integer taskType;
  42 + /**仓库编码*/
  43 + @Excel(name = "仓库编码", width = 15)
  44 + @ApiModelProperty(value = "仓库编码")
  45 + private String warehouseCode;
  46 + /**货主*/
  47 + @Excel(name = "货主", width = 15)
  48 + @ApiModelProperty(value = "货主")
  49 + private String companyCode;
  50 + /**出库单id*/
  51 + @Excel(name = "出库单id", width = 15)
  52 + @ApiModelProperty(value = "出库单id")
  53 + private Integer shipmentId;
  54 + /**出库详情id*/
  55 + @Excel(name = "出库详情id", width = 15)
  56 + @ApiModelProperty(value = "出库详情id")
  57 + private Integer shipmentDetailId;
  58 + /**出库组盘详情id*/
  59 + @Excel(name = "出库组盘详情id", width = 15)
  60 + @ApiModelProperty(value = "出库组盘详情id")
  61 + private Integer shipmentContainerDetailId;
  62 + /**入库单id*/
  63 + @Excel(name = "入库单id", width = 15)
  64 + @ApiModelProperty(value = "入库单id")
  65 + private Integer receiptId;
  66 + /**入库单详情id*/
  67 + @Excel(name = "入库单详情id", width = 15)
  68 + @ApiModelProperty(value = "入库单详情id")
  69 + private Integer receiptDetailId;
  70 + /**入库组盘详情Id*/
  71 + @Excel(name = "入库组盘详情Id", width = 15)
  72 + @ApiModelProperty(value = "入库组盘详情Id")
  73 + private Integer receiptContainerDetailId;
  74 + /**物料编码*/
  75 + @Excel(name = "物料编码", width = 15)
  76 + @ApiModelProperty(value = "物料编码")
  77 + private String materialCode;
  78 + /**物料名称*/
  79 + @Excel(name = "物料名称", width = 15)
  80 + @ApiModelProperty(value = "物料名称")
  81 + private String materialName;
  82 + /**物料规格*/
  83 + @Excel(name = "物料规格", width = 15)
  84 + @ApiModelProperty(value = "物料规格")
  85 + private String materialSpec;
  86 + /**物料单位*/
  87 + @Excel(name = "物料单位", width = 15)
  88 + @ApiModelProperty(value = "物料单位")
  89 + private String materialUnit;
  90 + /**数量*/
  91 + @Excel(name = "数量", width = 15)
  92 + @ApiModelProperty(value = "数量")
  93 + private BigDecimal qty;
  94 + /**批次*/
  95 + @Excel(name = "批次", width = 15)
  96 + @ApiModelProperty(value = "批次")
  97 + private String batch;
  98 + /**批号*/
  99 + @Excel(name = "批号", width = 15)
  100 + @ApiModelProperty(value = "批号")
  101 + private String lot;
  102 + /**项目号*/
  103 + @Excel(name = "项目号", width = 15)
  104 + @ApiModelProperty(value = "项目号")
  105 + private String project;
  106 + /**库存状态*/
  107 + @Excel(name = "库存状态", width = 15)
  108 + @Dict(dicCode = "inventory_status")
  109 + @ApiModelProperty(value = "库存状态")
  110 + private String inventoryStatus;
  111 + /**出库的库存详情id*/
  112 + @Excel(name = "出库的库存详情id", width = 15)
  113 + @ApiModelProperty(value = "出库的库存详情id")
  114 + private Integer fromInventoryDetailId;
  115 + /**入库的库存详情id*/
  116 + @Excel(name = "入库的库存详情id", width = 15)
  117 + @ApiModelProperty(value = "入库的库存详情id")
  118 + private Integer toInventoryDetailId;
  119 + /**备用字段1*/
  120 + @Excel(name = "备用字段1", width = 15)
  121 + @ApiModelProperty(value = "备用字段1")
  122 + private String userdef1;
  123 + /**备用字段2*/
  124 + @Excel(name = "备用字段2", width = 15)
  125 + @ApiModelProperty(value = "备用字段2")
  126 + private String userdef2;
  127 + /**备用字段3*/
  128 + @Excel(name = "备用字段3", width = 15)
  129 + @ApiModelProperty(value = "备用字段3")
  130 + private String userdef3;
  131 + /**创建人*/
  132 + @ApiModelProperty(value = "创建人")
  133 + private String createBy;
  134 + /**创建日期*/
  135 + @ApiModelProperty(value = "创建日期")
  136 + private Date createTime;
  137 + /**更新人*/
  138 + @ApiModelProperty(value = "更新人")
  139 + private String updateBy;
  140 + /**更新日期*/
  141 + @ApiModelProperty(value = "更新日期")
  142 + private Date updateTime;
  143 +}
... ...
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/task/taskHeader/entity/TaskHeader.java 0 → 100644
  1 +package org.jeecg.modules.wms.task.taskHeader.entity;
  2 +
  3 +import java.io.Serializable;
  4 +import java.io.UnsupportedEncodingException;
  5 +import java.util.Date;
  6 +import com.baomidou.mybatisplus.annotation.IdType;
  7 +import com.baomidou.mybatisplus.annotation.TableId;
  8 +import com.baomidou.mybatisplus.annotation.TableName;
  9 +import org.jeecgframework.poi.excel.annotation.Excel;
  10 +import lombok.Data;
  11 +import com.fasterxml.jackson.annotation.JsonFormat;
  12 +import org.springframework.format.annotation.DateTimeFormat;
  13 +import org.jeecg.common.aspect.annotation.Dict;
  14 +import io.swagger.annotations.ApiModel;
  15 +import io.swagger.annotations.ApiModelProperty;
  16 +
  17 +/**
  18 + * @Description: 任务表
  19 + * @Author: jeecg-boot
  20 + * @Date: 2022-11-10
  21 + * @Version: V1.0
  22 + */
  23 +@Data
  24 +@TableName("task_header")
  25 +@ApiModel(value="task_header对象", description="任务表")
  26 +public class TaskHeader implements Serializable {
  27 + private static final long serialVersionUID = 1L;
  28 +
  29 + /**主键*/
  30 + @TableId(type = IdType.AUTO)
  31 + @ApiModelProperty(value = "主键")
  32 + private Integer id;
  33 + /**前置任务号*/
  34 + @Excel(name = "前置任务号", width = 15)
  35 + @ApiModelProperty(value = "前置任务号")
  36 + private Integer preTaskNo;
  37 + /**前置任务号*/
  38 + @Excel(name = "入库组盘ID", width = 15)
  39 + @ApiModelProperty(value = "入库组盘ID")
  40 + private Integer receiptContaienrHeaderId;
  41 + /**仓库*/
  42 + @Excel(name = "仓库", width = 15)
  43 + @ApiModelProperty(value = "仓库")
  44 + private String warehouseCode;
  45 + /**货主*/
  46 + @Excel(name = "货主", width = 15)
  47 + @ApiModelProperty(value = "货主")
  48 + private String companyCode;
  49 + /**库区*/
  50 + @Excel(name = "库区", width = 15)
  51 + @ApiModelProperty(value = "库区")
  52 + private String zoneCode;
  53 + /**任务类型*/
  54 + @Excel(name = "任务类型", width = 15, dicCode = "task_type")
  55 + @Dict(dicCode = "task_type")
  56 + @ApiModelProperty(value = "任务类型")
  57 + private Integer taskType;
  58 + /**内部任务类型*/
  59 + @Excel(name = "内部任务类型", width = 15)
  60 + @ApiModelProperty(value = "内部任务类型")
  61 + private Integer innernalTaskType;
  62 + /**容器号*/
  63 + @Excel(name = "容器号", width = 15)
  64 + @ApiModelProperty(value = "容器号")
  65 + private String containerCode;
  66 + /**起始库位*/
  67 + @Excel(name = "起始库位", width = 15)
  68 + @ApiModelProperty(value = "起始库位")
  69 + private String fromLocationCode;
  70 + /**目标库位*/
  71 + @Excel(name = "目标库位", width = 15)
  72 + @ApiModelProperty(value = "目标库位")
  73 + private String toLocationCode;
  74 + /**是否空出*/
  75 + @Excel(name = "是否空出", width = 15, dicCode = "is_or_not")
  76 + @Dict(dicCode = "is_or_not")
  77 + @ApiModelProperty(value = "是否空出")
  78 + private String isEmptyOut;
  79 + /**是否重入*/
  80 + @Excel(name = "是否重入", width = 15, dicCode = "is_or_not")
  81 + @Dict(dicCode = "is_or_not")
  82 + @ApiModelProperty(value = "是否重入")
  83 + private Integer isDoubleIn;
  84 + /**重入库位号*/
  85 + @Excel(name = "重入库位号", width = 15)
  86 + @ApiModelProperty(value = "重入库位号")
  87 + private String originLocationCode;
  88 + /**任务状态*/
  89 + @Excel(name = "任务状态", width = 15, dicCode = "task_header_status")
  90 + @Dict(dicCode = "task_header_status")
  91 + @ApiModelProperty(value = "任务状态")
  92 + private Integer status;
  93 + /**起始出入口*/
  94 + @Excel(name = "起始出入口", width = 15)
  95 + @ApiModelProperty(value = "起始出入口")
  96 + private String fromPort;
  97 + /**目标出入口*/
  98 + @Excel(name = "目标出入口", width = 15)
  99 + @ApiModelProperty(value = "目标出入口")
  100 + private String toPort;
  101 + /**备用字段1*/
  102 + @Excel(name = "备用字段1", width = 15)
  103 + @ApiModelProperty(value = "备用字段1")
  104 + private String userdef1;
  105 + /**备用字段2*/
  106 + @Excel(name = "备用字段2", width = 15)
  107 + @ApiModelProperty(value = "备用字段2")
  108 + private String userdef2;
  109 + /**备用字段3*/
  110 + @Excel(name = "备用字段3", width = 15)
  111 + @ApiModelProperty(value = "备用字段3")
  112 + private String userdef3;
  113 + /**创建人*/
  114 + @ApiModelProperty(value = "创建人")
  115 + private String createBy;
  116 + /**创建日期*/
  117 + @ApiModelProperty(value = "创建日期")
  118 + private Date createTime;
  119 + /**更新人*/
  120 + @ApiModelProperty(value = "更新人")
  121 + private String updateBy;
  122 + /**更新日期*/
  123 + @ApiModelProperty(value = "更新日期")
  124 + private Date updateTime;
  125 +}
... ...
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/task/taskHeader/mapper/TaskDetailMapper.java 0 → 100644
  1 +package org.jeecg.modules.wms.task.taskHeader.mapper;
  2 +
  3 +import java.util.List;
  4 +import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  5 +import org.apache.ibatis.annotations.Param;
  6 +import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail;
  7 +
  8 +/**
  9 + * @Description: 任务详情
  10 + * @Author: jeecg-boot
  11 + * @Date: 2022-11-10
  12 + * @Version: V1.0
  13 + */
  14 +public interface TaskDetailMapper extends BaseMapper<TaskDetail> {
  15 +
  16 + public boolean deleteByMainId(@Param("mainId") String mainId);
  17 +
  18 + public List<TaskDetail> selectByMainId(@Param("mainId") String mainId);
  19 +
  20 +}
... ...
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/task/taskHeader/mapper/TaskHeaderMapper.java 0 → 100644
  1 +package org.jeecg.modules.wms.task.taskHeader.mapper;
  2 +
  3 +import java.util.List;
  4 +
  5 +import org.apache.ibatis.annotations.Param;
  6 +import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  7 +import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader;
  8 +
  9 +/**
  10 + * @Description: 任务表
  11 + * @Author: jeecg-boot
  12 + * @Date: 2022-11-10
  13 + * @Version: V1.0
  14 + */
  15 +public interface TaskHeaderMapper extends BaseMapper<TaskHeader> {
  16 +
  17 +}
... ...
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/task/taskHeader/mapper/xml/TaskDetailMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="org.jeecg.modules.wms.task.taskHeader.mapper.TaskDetailMapper">
  4 +
  5 + <delete id="deleteByMainId" parameterType="java.lang.String">
  6 + DELETE
  7 + FROM task_detail
  8 + WHERE
  9 + task_header_id = #{mainId}
  10 + </delete>
  11 +
  12 + <select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail">
  13 + SELECT *
  14 + FROM task_detail
  15 + WHERE
  16 + task_header_id = #{mainId}
  17 + </select>
  18 +</mapper>
... ...
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/task/taskHeader/mapper/xml/TaskHeaderMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="org.jeecg.modules.wms.task.taskHeader.mapper.TaskHeaderMapper">
  4 +
  5 +</mapper>
... ...
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/ITaskDetailService.java 0 → 100644
  1 +package org.jeecg.modules.wms.task.taskHeader.service;
  2 +
  3 +import com.baomidou.mybatisplus.extension.service.IService;
  4 +import org.jeecg.modules.wms.config.location.entity.Location;
  5 +import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail;
  6 +
  7 +import java.util.List;
  8 +
  9 +/**
  10 + * @Description: 任务详情
  11 + * @Author: jeecg-boot
  12 + * @Date: 2022-11-10
  13 + * @Version: V1.0
  14 + */
  15 +public interface ITaskDetailService extends IService<TaskDetail> {
  16 +
  17 + public List<TaskDetail> selectByMainId(String mainId);
  18 +
  19 +}
... ...
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/ITaskHeaderService.java 0 → 100644
  1 +package org.jeecg.modules.wms.task.taskHeader.service;
  2 +
  3 +import com.baomidou.mybatisplus.extension.service.IService;
  4 +import org.jeecg.modules.wms.config.location.entity.Location;
  5 +import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import java.io.Serializable;
  8 +import java.util.Collection;
  9 +import java.util.List;
  10 +
  11 +/**
  12 + * @Description: 任务表
  13 + * @Author: jeecg-boot
  14 + * @Date: 2022-11-10
  15 + * @Version: V1.0
  16 + */
  17 +public interface ITaskHeaderService extends IService<TaskHeader> {
  18 +
  19 + /**
  20 + * 删除一对多
  21 + */
  22 + public void delMain (String id);
  23 +
  24 + /**
  25 + * 批量删除一对多
  26 + */
  27 + public void delBatchMain (Collection<? extends Serializable> idList);
  28 +
  29 + public boolean haveUncompleteTaskInNear(Location location);
  30 +}
... ...
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskDetailServiceImpl.java 0 → 100644
  1 +package org.jeecg.modules.wms.task.taskHeader.service.impl;
  2 +
  3 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  4 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  5 +import org.jeecg.modules.wms.config.location.entity.Location;
  6 +import org.jeecg.modules.wms.config.location.service.ILocationService;
  7 +import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail;
  8 +import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader;
  9 +import org.jeecg.modules.wms.task.taskHeader.mapper.TaskDetailMapper;
  10 +import org.jeecg.modules.wms.task.taskHeader.service.ITaskDetailService;
  11 +import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService;
  12 +import org.jeecg.utils.constant.QuantityConstant;
  13 +import org.springframework.stereotype.Service;
  14 +import java.util.List;
  15 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  16 +import org.springframework.beans.factory.annotation.Autowired;
  17 +
  18 +import javax.annotation.Resource;
  19 +
  20 +/**
  21 + * @Description: 任务详情
  22 + * @Author: jeecg-boot
  23 + * @Date: 2022-11-10
  24 + * @Version: V1.0
  25 + */
  26 +@Service
  27 +public class TaskDetailServiceImpl extends ServiceImpl<TaskDetailMapper, TaskDetail> implements ITaskDetailService {
  28 +
  29 + @Autowired
  30 + private TaskDetailMapper taskDetailMapper;
  31 + @Resource
  32 + private ILocationService locationService;
  33 + @Resource
  34 + private ITaskHeaderService taskHeaderService;
  35 +
  36 + @Override
  37 + public List<TaskDetail> selectByMainId(String mainId) {
  38 + return taskDetailMapper.selectByMainId(mainId);
  39 + }
  40 +
  41 +
  42 +
  43 +}
... ...
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java 0 → 100644
  1 +package org.jeecg.modules.wms.task.taskHeader.service.impl;
  2 +
  3 +import org.jeecg.modules.wms.config.location.entity.Location;
  4 +import org.jeecg.modules.wms.config.location.service.ILocationService;
  5 +import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader;
  6 +import org.jeecg.modules.wms.task.taskHeader.mapper.TaskDetailMapper;
  7 +import org.jeecg.modules.wms.task.taskHeader.mapper.TaskHeaderMapper;
  8 +import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService;
  9 +import org.jeecg.utils.constant.QuantityConstant;
  10 +import org.springframework.stereotype.Service;
  11 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  12 +import org.springframework.beans.factory.annotation.Autowired;
  13 +import org.springframework.transaction.annotation.Transactional;
  14 +
  15 +import javax.annotation.Resource;
  16 +import java.io.Serializable;
  17 +import java.util.List;
  18 +import java.util.Collection;
  19 +
  20 +/**
  21 + * @Description: 任务表
  22 + * @Author: jeecg-boot
  23 + * @Date: 2022-11-10
  24 + * @Version: V1.0
  25 + */
  26 +@Service
  27 +public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHeader> implements ITaskHeaderService {
  28 +
  29 + @Autowired
  30 + private TaskHeaderMapper taskHeaderMapper;
  31 + @Autowired
  32 + private TaskDetailMapper taskDetailMapper;
  33 + @Resource
  34 + private ILocationService locationService;
  35 +
  36 + @Override
  37 + @Transactional
  38 + public void delMain(String id) {
  39 + taskDetailMapper.deleteByMainId(id);
  40 + taskHeaderMapper.deleteById(id);
  41 + }
  42 +
  43 + @Override
  44 + @Transactional
  45 + public void delBatchMain(Collection<? extends Serializable> idList) {
  46 + for(Serializable id:idList) {
  47 + taskDetailMapper.deleteByMainId(id.toString());
  48 + taskHeaderMapper.deleteById(id);
  49 + }
  50 + }
  51 +
  52 + /**
  53 + * 如果库位是锁定的,那么这个库位一定是被某个任务占用。
  54 + * @param location
  55 + * @return
  56 + */
  57 + @Override
  58 + public boolean haveUncompleteTaskInNear(Location location) {
  59 + Location location1 = locationService.getNear(location);
  60 + if (location1 == null) {
  61 + return false;
  62 + }
  63 + String status = location1.getStatus();
  64 + if(QuantityConstant.STATUS_LOCATION_LOCK.equals(status)) {
  65 + return true;
  66 + }
  67 + return false;
  68 + }
  69 +
  70 +}
... ...
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/utils/constant/QuantityConstant.java
... ... @@ -58,7 +58,7 @@ public class QuantityConstant {
58 58 public static final Integer RECEIPT_HEADER_POSITION = 240;
59 59  
60 60 //等待上架
61   - public static final Integer RECEIPT_HEADER_WAIT = 280;
  61 + public static final Integer RECEIPT_HEADER_WAIT_SHELF = 280;
62 62  
63 63 //上架
64 64 public static final Integer RECEIPT_HEADER_SHELF = 300;
... ...